diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..4631c57e5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +custom: https://paypal.me/aQuaYi +issuehunt: aquayi +ko_fi: aquayi +liberapay: aQua + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +otechie: # Replace with a single Otechie username diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 000000000..b1933d08f --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,9 @@ +# 与题解有关的 issue 模板 + +## 题号 + +## 我的疑问 + +------- + +有偿答疑,[点击后,扫码付费](https://github.com/aQuaYi/LeetCode-in-Go/blob/master/.github/pay.png) \ No newline at end of file diff --git a/.github/pay.png b/.github/pay.png new file mode 100644 index 000000000..49201ef15 Binary files /dev/null and b/.github/pay.png differ diff --git a/.gitignore b/.gitignore index 74b0ac39e..873ef8600 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,14 @@ # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ *.cookie -.vscode/ *.toml -helper \ No newline at end of file +helper +*.zip +tasks.txt +testDir/ +coverage.txt + +# 删除 Goland 设置 +.idea + +.orig \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 00d60d30d..f5175e0be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,18 @@ language: go go: - - 1.9.x - + - master + # whitelist branches: only: - master - - stable + - stable -script: +script: - go get -t -v ./... - go vet ./... - bash ./test.sh after_success: - - bash <(curl -s https://codecov.io/bash) - -notifications: - webhooks: https://hooks.pubu.im/services/3wp9q4yqlzm8fxr \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..98a30acc3 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "debug", + "type": "go", + "request": "launch", + "mode": "test", + "program": "${fileDirname}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5e8440178 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,308 @@ +{ + "todo-tree.flat": true, + "cSpell.words": [ + "ABCDEFG", + "ASCI", + "Barcodes", + "Bigram", + "DDDDLLLD", + "DDDDLLLL", + "DDDLLLL", + "DDDRRRR", + "DDRR", + "DRRR", + "Defanging", + "GGLLGG", + "GLGLGGLGL", + "GLRLLGLL", + "Gawl", + "Gawlme", + "Gawlqt", + "Gawluvn", + "Gaxwul", + "Gcamwel", + "Gnaynwl", + "IDID", + "Icode", + "Inorder", + "LDDD", + "LLDDD", + "LLLD", + "LLLDD", + "LLLDDDDD", + "LLLLD", + "LLLLDDD", + "LLLLRRRR", + "LLLLUUUU", + "LLLRRR", + "LLLUU", + "LLUU", + "Leet", + "NLZGM", + "Negabinary", + "Ocurrences", + "Paddr", + "Puerkito", + "Qedo", + "RLLLLRRRLR", + "RLRRLLRLRL", + "RRDD", + "RRLL", + "RRRD", + "RRRRU", + "RRRU", + "RRRUU", + "Satisfiability", + "Squareful", + "Subarrays", + "Subsequences", + "Supersequence", + "Superstring", + "Tribonacci", + "URRR", + "URRRR", + "URRRUU", + "URRRUUUU", + "URUUUU", + "UURRR", + "UUUULLLL", + "UUUUUR", + "UUUUURRR", + "VPS's", + "Vals", + "a", + "aaleex", + "abcdefgb", + "abcdefgbabcdei", + "abcdefgh", + "abcdefghijklmnopqrstuvwxy", + "abcdefghijklmnopqrstuvwxyz", + "abcdexyzfzz", + "abdfg", + "abdfh", + "abefg", + "abefh", + "aboveyz", + "abrodyz", + "abslute", + "absoryz", + "acdfg", + "acdfh", + "acefg", + "acefh", + "actresz", + "actt", + "akyj", + "alexlovesleetcode", + "alicez", + "alphabet", + "antaprezatepzapreanta", + "apmnolkjihgfedcbq", + "append", + "arith", + "asas", + "asdfdfs", + "assqjfwarvjcjedqtoz", + "at", + "atach", + "atgcatc", + "b", + "barcode", + "bbazb", + "bcdefghijkl", + "bcdei", + "board", + "bool", + "boustrophedonically", + "btree", + "builder", + "byte", + "cancel", + "cand", + "cands", + "capitlization", + "catg", + "cedefifgstkyxfcuajfa", + "checked", + "chromedp", + "clean", + "codecov", + "coordinate", + "count", + "ctaagt", + "ctxt", + "cut", + "czvh", + "d", + "deck", + "defang", + "defanged", + "dfdsfkjdfleiwllsgoidkjflsdfjdfierwsd", + "dfs", + "dietpepsi", + "diff", + "domain", + "dot", + "dqtozctcdk", + "e", + "efghabcd", + "emails", + "enention", + "etco", + "exection", + "exention", + "exps", + "fassqjfwarvjcjedq", + "fcuajfassqjfwarvjc", + "fgbabcde", + "fghij", + "for", + "form", + "fumcfsngphjyfhhwkqa", + "func", + "fwarvjcjedqtozctcd", + "gaswxyz", + "gcta", + "gctaagttcatgcatc", + "ghefcdab", + "ghiabcdefhelloadamhelloabcdefghi", + "gitignore", + "goconvey", + "gruj", + "grukj", + "grukkmj", + "grukmj", + "hgfedcba", + "hunu", + "i", + "if", + "iloveu", + "increasing", + "index", + "indexs", + "inention", + "int", + "ints", + "is", + "j", + "jarzoaupviqkx", + "keet", + "keti", + "keto", + "klmno", + "kloveiloveu", + "ksqsq", + "ksqvsq", + "ksqvsyq", + "kssq", + "kyxfcuajfassqjfwa", + "l", + "laiden", + "leelee", + "leetcode", + "len", + "length", + "letcod", + "lexicographicaly", + "lleeelee", + "longest", + "loonbalxballpoon", + "lpnpelpwy", + "make", + "map", + "max", + "maxs", + "move", + "mozillazg", + "mpma", + "mymflnlegtrnr", + "n", + "nbsp", + "next", + "nlaebolko", + "nlaeolko", + "ntse", + "num", + "numberify", + "nums", + "numsnil", + "okhateimloveyou", + "ooncedefifgstkyxfcua", + "path", + "ppedxfumcfsngphjyf", + "pqrst", + "pwwkew", + "pyqrhjamdrias", + "querys", + "r", + "rame", + "range", + "reactjs", + "replace", + "reqs", + "res", + "return", + "revealed", + "rorse", + "rune", + "rxocajdeo", + "saeed", + "sb", + "seq", + "sfgstfsqlqmfjv", + "size", + "sort", + "split", + "splitted", + "ssaaedd", + "stretchr", + "string", + "strings", + "strs", + "subarray", + "subgrid", + "submatrices", + "submatrix", + "subtrees", + "superpalindrome", + "superpalindromes", + "t", + "tail", + "target", + "tcode", + "testemail", + "tmps", + "to", + "true", + "ttca", + "u", + "unique", + "univalued", + "username", + "uvwxy", + "uvwxyz", + "var", + "welldonehoneyr", + "wordlist", + "worldabcefghijkmnpqstuvxyz", + "write", + "x", + "xbyqqh", + "y", + "yeellow", + "yllw", + "yollew", + "yollow", + "zaaaz", + "zcpzvh", + "zczpzfvdhx", + "zczpzvdhx", + "zczpzvh", + "zczpzvhx", + "zczvh", + "zppedxfumcfsngp", + "zzwobllyxktqeibfoupcpptncggrdqbkji" + ], + "cSpell.language": "en,en-US", + "todo-tree.tree.flat": true +} \ No newline at end of file diff --git a/.vscode/tags b/.vscode/tags new file mode 100644 index 000000000..33ed9e868 --- /dev/null +++ b/.vscode/tags @@ -0,0 +1,6 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.9~svn20110310 // diff --git a/Algorithms/0001.two-sum/README.md b/Algorithms/0001.two-sum/README.md index e0bada077..e4c09371a 100755 --- a/Algorithms/0001.two-sum/README.md +++ b/Algorithms/0001.two-sum/README.md @@ -1,26 +1,30 @@ # [1. Two Sum](https://leetcode.com/problems/two-sum/) ## 题目 + Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: -``` + +```text Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. ``` + ## 解题思路 -``` + +```go a + b = target ``` + 也可以看成是 -``` + +```go a = target - b ``` -在`map[整数]整数的序号`中,可以查询到a的序号。这样就不用嵌套两个for循环了。 - - +在`map[整数]整数的序号`中,可以查询到a的序号。这样就不用嵌套两个for循环了。 \ No newline at end of file diff --git a/Algorithms/0001.two-sum/two-sum.go b/Algorithms/0001.two-sum/two-sum.go index fa753acd5..895ca0c3f 100755 --- a/Algorithms/0001.two-sum/two-sum.go +++ b/Algorithms/0001.two-sum/two-sum.go @@ -1,21 +1,21 @@ -package Problem0001 +package problem0001 func twoSum(nums []int, target int) []int { - // m 负责保存map[整数]整数的序列号 - m := make(map[int]int, len(nums)) + // index 负责保存map[整数]整数的序列号 + index := make(map[int]int, len(nums)) // 通过 for 循环,获取b的序列号 for i, b := range nums { // 通过查询map,获取a = target - b的序列号 - if j, ok := m[target-b]; ok { + if j, ok := index[target-b]; ok { // ok 为 true - // 说明在i之前,存在nums[j] == a + // 说明在i之前,存在 nums[j] == a return []int{j, i} - // 注意,顺序是j,i,因为j 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8 +``` ## 解题思路 + +```text (2 -> 4 -> 3)是 342 (5 -> 6 -> 4)是 465 @@ -16,13 +21,16 @@ Output: 7 -> 0 -> 8 (7 -> 0 -> 8)是 807 342 + 465 = 807 +``` 所以,题目的本意是,把整数换了一种表达方式后,实现其加法。 设计程序时候,需要处理的点有 + 1. 位上的加法,需要处理进位问题 1. 如何进入下一位运算 1. 按位相加结束后,也还需要处理进位问题。 ## 总结 + 读懂题意后,按步骤实现题目要求。 \ No newline at end of file diff --git a/Algorithms/0002.add-two-numbers/add-two-numbers.go b/Algorithms/0002.add-two-numbers/add-two-numbers.go index 649034b8c..f20e86b08 100755 --- a/Algorithms/0002.add-two-numbers/add-two-numbers.go +++ b/Algorithms/0002.add-two-numbers/add-two-numbers.go @@ -1,71 +1,39 @@ -package Problem0002 +package problem0002 -/** - * Definition for singly-linked list. - * type ListNode struct { - * Val int - * Next *ListNode - * } - */ -type ListNode struct { - Val int - Next *ListNode -} +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// ListNode defines for singly-linked list. +// type ListNode struct { +// Val int +// Next *ListNode +// } +type ListNode = kit.ListNode func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode { - result := &ListNode{} - temp := result - v, n := 0, 0 + resPre := &ListNode{} + cur := resPre + carry := 0 - for { - // 在当前位上进行加法运算 - v, n = add(l1, l2, n) - temp.Val = v + for l1 != nil || l2 != nil || carry > 0 { + sum := carry - // 进入下一位 - l1 = next(l1) - l2 = next(l2) - // 如果两个数的下一位都为nil,则结束按位相加的运算 - if l1 == nil && l2 == nil { - break + if l1 != nil { + sum += l1.Val + l1 = l1.Next } - // 为下一位运算准备节点 - temp.Next = &ListNode{} - temp = temp.Next - } - - // n == 1 说明,最后一次加运算进位了,需要再添加一个节点。 - if n == 1 { - temp.Next = &ListNode{Val: n} - } - - return result -} - -// next 进入l的下一位。 -func next(l *ListNode) *ListNode { - if l != nil { - return l.Next - } - return nil -} - -func add(n1, n2 *ListNode, i int) (v, n int) { - if n1 != nil { - v += n1.Val - } - - if n2 != nil { - v += n2.Val - } + if l2 != nil { + sum += l2.Val + l2 = l2.Next + } - v += i + carry = sum / 10 - if v > 9 { - v -= 10 - n = 1 + cur.Next = &ListNode{Val: sum % 10} + cur = cur.Next } - return + return resPre.Next } diff --git a/Algorithms/0002.add-two-numbers/add-two-numbers_test.go b/Algorithms/0002.add-two-numbers/add-two-numbers_test.go index 04da97781..78da052b6 100755 --- a/Algorithms/0002.add-two-numbers/add-two-numbers_test.go +++ b/Algorithms/0002.add-two-numbers/add-two-numbers_test.go @@ -1,4 +1,4 @@ -package Problem0002 +package problem0002 import ( "testing" diff --git a/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.go b/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.go index 5a378216f..4748debeb 100755 --- a/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.go +++ b/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.go @@ -1,4 +1,4 @@ -package Problem0003 +package problem0003 func lengthOfLongestSubstring(s string) int { // location[s[i]] == j 表示: diff --git a/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters_test.go b/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters_test.go index 48eb1836c..8b2318e0c 100755 --- a/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters_test.go +++ b/Algorithms/0003.longest-substring-without-repeating-characters/longest-substring-without-repeating-characters_test.go @@ -1,4 +1,4 @@ -package Problem0003 +package problem0003 import ( "testing" diff --git a/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays.go b/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays.go index 5905a4279..53d94a6c3 100755 --- a/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays.go +++ b/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays.go @@ -1,4 +1,4 @@ -package Problem0004 +package problem0004 func findMedianSortedArrays(nums1 []int, nums2 []int) float64 { nums := combine(nums1, nums2) diff --git a/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays_test.go b/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays_test.go index 4832391e9..e1567bc71 100755 --- a/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays_test.go +++ b/Algorithms/0004.median-of-two-sorted-arrays/median-of-two-sorted-arrays_test.go @@ -1,4 +1,4 @@ -package Problem0004 +package problem0004 import ( "testing" diff --git a/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring.go b/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring.go index 9ac7747b0..6d6a2799f 100755 --- a/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring.go +++ b/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring.go @@ -1,4 +1,4 @@ -package Problem0005 +package problem0005 func longestPalindrome(s string) string { if len(s) < 2 { // 肯定是回文,直接返回 diff --git a/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring_test.go b/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring_test.go index 9ac50baf2..e83479c27 100755 --- a/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring_test.go +++ b/Algorithms/0005.longest-palindromic-substring/longest-palindromic-substring_test.go @@ -1,4 +1,4 @@ -package Problem0005 +package problem0005 import ( "testing" diff --git a/Algorithms/0006.zigzag-conversion/README.md b/Algorithms/0006.zigzag-conversion/README.md index 50acc4730..6c84fcf8f 100755 --- a/Algorithms/0006.zigzag-conversion/README.md +++ b/Algorithms/0006.zigzag-conversion/README.md @@ -1,30 +1,39 @@ # [6. ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) ## 题目 + The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) -``` + +```text P A H N A P L S I I G Y I R ``` + And then read line by line: "PAHNAPLSIIGYIR" Write the code that will take a string and make this conversion given a number of rows: + ```go func convert(text string, nRows int) string ``` + convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR". ## 解题思路 + 输入"ABCDEFGHIJKLMNOPQRSTUVWXYZ"和参数5后,得到答案"AGMSYBFHLNRTXZCEIKOQUWDJPV", 按照题目的摆放方法,可得: -``` + +```text A I Q Y B HJ PR XZ C G K O S W DF LN TV E M U ``` + 可以看到,各行字符在原字符串中的索引号为 + 1. 0行,0, 8, 16, 24 1. 1行,1, 7,9, 15,17, 23,25 1. 2行,2, 6, 10, 14, 18, 22 @@ -32,9 +41,9 @@ E M U 1. 4行,4, 12, 20 令p=numRows×2-2,可以总结出以下规律 + 1. 0行, 0×p,1×p,... 1. r行, r,1×p-r,1×p+r,2×p-r,2×p+r,... 1. 最后一行, numRow-1, numRow-1+1×p,numRow-1+2×p,... -只需编程依次处理各行即可。 -## 总结 +只需编程依次处理各行即可。 \ No newline at end of file diff --git a/Algorithms/0006.zigzag-conversion/zigzag-conversion.go b/Algorithms/0006.zigzag-conversion/zigzag-conversion.go index 21d1a978d..9c313f2ad 100755 --- a/Algorithms/0006.zigzag-conversion/zigzag-conversion.go +++ b/Algorithms/0006.zigzag-conversion/zigzag-conversion.go @@ -1,4 +1,4 @@ -package Problem0006 +package problem0006 import ( "bytes" diff --git a/Algorithms/0006.zigzag-conversion/zigzag-conversion_test.go b/Algorithms/0006.zigzag-conversion/zigzag-conversion_test.go index 2d4f44f4f..24e5bc9ac 100755 --- a/Algorithms/0006.zigzag-conversion/zigzag-conversion_test.go +++ b/Algorithms/0006.zigzag-conversion/zigzag-conversion_test.go @@ -1,4 +1,4 @@ -package Problem0006 +package problem0006 import ( "testing" diff --git a/Algorithms/0007.reverse-integer/reverse-integer.go b/Algorithms/0007.reverse-integer/reverse-integer.go index a13e344a1..c5d99d8f3 100755 --- a/Algorithms/0007.reverse-integer/reverse-integer.go +++ b/Algorithms/0007.reverse-integer/reverse-integer.go @@ -1,4 +1,4 @@ -package Problem0007 +package problem0007 import ( "math" diff --git a/Algorithms/0007.reverse-integer/reverse-integer_test.go b/Algorithms/0007.reverse-integer/reverse-integer_test.go index 9bb995cd9..0f22720e9 100755 --- a/Algorithms/0007.reverse-integer/reverse-integer_test.go +++ b/Algorithms/0007.reverse-integer/reverse-integer_test.go @@ -1,4 +1,4 @@ -package Problem0007 +package problem0007 import ( "testing" diff --git a/Algorithms/0008.string-to-integer-atoi/README.md b/Algorithms/0008.string-to-integer-atoi/README.md index 31688ed81..8e3ec742a 100755 --- a/Algorithms/0008.string-to-integer-atoi/README.md +++ b/Algorithms/0008.string-to-integer-atoi/README.md @@ -1,12 +1,65 @@ # [8. String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) ## 题目 -Implement atoi to convert a string to an integer. -Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. +Implement "atoi" which converts a string to an integer. + +The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and interprets them as a numerical value. + +The string can contain additional characters after those that form the integral number, which are ignored and have no effect on the behavior of this function. + +If the first sequence of non-whitespace characters in str is not a valid integral number, or if no such sequence exists because either str is empty or it contains only whitespace characters, no conversion is performed. + +If no valid conversion could be performed, a zero value is returned. + +Note: + +- Only the space character ' ' is considered as whitespace character. +- Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−2^31, 2^31 − 1]. If the numerical value is out of the range of representable values, INT_MAX (2^31 − 1) or INT_MIN (−2^31) is returned. + +Example 1: + +```text +Input: "42" +Output: 42 +``` + +Example 2: + +```text +Input: " -42" +Output: -42 +Explanation: The first non-whitespace character is '-', which is the minus sign. Then take as many numerical digits as possible, which gets 42. +``` + +Example 3: + +```text +Input: "4193 with words" +Output: 4193 +Explanation: Conversion stops at digit '3' as the next character is not a numerical digit. +``` + +Example 4: + +```text +Input: "words and 987" +Output: 0 +Explanation: The first non-whitespace character is 'w', which is not a numerical digit or a +/- sign. Therefore no valid conversion could be performed. +``` + +Example 5: + +```text +Input: "-91283472332" +Output: -2147483648 +Explanation: The number "-91283472332" is out of the range of a 32-bit signed integer. Therefore INT_MIN (−231) is returned. +``` ## 解题思路 + 转换并不难,难得的是,处理各种奇葩的输入。详见程序注释。 ## 总结 + 良好的单元测试真的很重要。 diff --git a/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi.go b/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi.go index 30cae15c0..016f60638 100755 --- a/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi.go +++ b/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi.go @@ -1,73 +1,54 @@ -package Problem0008 +package problem0008 import "strings" import "math" -func myAtoi(str string) int { - // 除去 str 首尾的空格 - s := strings.TrimSpace(str) - if len(s) == 0 { - return 0 - } - - // 取出 s 的符号和主体 x - sign, x := getSign(s) - - // 裁剪x丢弃混入的非数字字符 - x = trim(x) - - // 根据sigh和x,转换成int - return convert(sign, x) +func myAtoi(s string) int { + return convert(clean(s)) } -func getSign(s string) (int, string) { - sign := 1 +func clean(s string) (sign int, abs string) { + // 除去首尾的空格 + s = strings.TrimSpace(s) + if s == "" { + return + } + switch s[0] { - case '-': - s = s[1:] - sign = -1.0 + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + sign, abs = 1, s case '+': - s = s[1:] + sign, abs = 1, s[1:] + case '-': + sign, abs = -1, s[1:] default: + abs = "" + return } - return sign, s -} - -func trim(s string) string { - for i := range s { - if s[i] < '0' || '9' < s[i] { - return s[:i] + for i, b := range abs { + if b < '0' || '9' < b { + abs = abs[:i] + break } } - return s + return } -func convert(sign int, s string) int { - base := 1 * sign - res := 0 - yes := false - - for i := len(s) - 1; i >= 0; i-- { - // 为了防止特别长的数字,甚至超过float64的范围,所以,每一步都检查是否溢出 - res, yes = isOverflow(res + (int(s[i])-48)*base) - if yes { - return res +func convert(sign int, absStr string) int { + abs := 0 + + for _, b := range absStr { + abs = abs*10 + int(b-'0') + // 检查溢出 + switch { + case sign == 1 && abs > math.MaxInt32: + return math.MaxInt32 + case sign == -1 && sign*abs < math.MinInt32: + return math.MinInt32 } - base *= 10 } - return res -} - -func isOverflow(i int) (int, bool) { - switch { - case i > math.MaxInt32: - return math.MaxInt32, true - case i < math.MinInt32: - return math.MinInt32, true - default: - return i, false - } + return sign * abs } diff --git a/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi_test.go b/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi_test.go index b216f8eba..a7f2f187c 100755 --- a/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi_test.go +++ b/Algorithms/0008.string-to-integer-atoi/string-to-integer-atoi_test.go @@ -1,4 +1,4 @@ -package Problem0008 +package problem0008 import ( "testing" @@ -25,6 +25,16 @@ func Test_OK(t *testing.T) { ast := assert.New(t) qs := []question{ + + question{ + p: para{ + one: "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000522545459", + }, + a: ans{ + one: math.MaxInt32, + }, + }, + question{ p: para{ one: "123", @@ -83,7 +93,7 @@ func Test_OK(t *testing.T) { }, question{ p: para{ - one: "", + one: " ", }, a: ans{ one: 0, @@ -97,6 +107,7 @@ func Test_OK(t *testing.T) { one: 1, }, }, + question{ p: para{ one: "-", @@ -105,6 +116,7 @@ func Test_OK(t *testing.T) { one: 0, }, }, + question{ p: para{ one: "922337999995452345782348957234895793875923845789234758923745987239485798345789237598235980234859023849058349058903890869059068490683490869038690385690385906839056890548690586904568905468905908590839056890345869034856903568903854690835906834906839045869034869034568903458690356903569056908345906839056890586903546890345869034568903586905689054685690905689035468905689056890879056907890879086903548690387905469054690890689035869038569034856908356908345906890345869056890356890358690569083546908549086905690345869038569034569083590689058690385690358690586908345906839086390689056903869058690345869038690586908569054690834590689054869083569035490689035689058690586905409689086905869038569083549068390468903586903569038549068905869054690345906890346904856903546908345906890568903569054690590685906905689058690586905869056890869035869035890789068790907903890835657428975457575789075098759084752897589475029847589047589234759028475902847592834752908759827589725987517891598715908749871908579841790817598715901875901874190879085791879018571897491837249874987235987589734897123489712390847913857190287549018735902036854775809", diff --git a/Algorithms/0009.palindrome-number/palindrome-number.go b/Algorithms/0009.palindrome-number/palindrome-number.go index 4b9173d61..1c46f7ae3 100755 --- a/Algorithms/0009.palindrome-number/palindrome-number.go +++ b/Algorithms/0009.palindrome-number/palindrome-number.go @@ -1,4 +1,4 @@ -package Problem0009 +package problem0009 import "strconv" diff --git a/Algorithms/0009.palindrome-number/palindrome-number_test.go b/Algorithms/0009.palindrome-number/palindrome-number_test.go index f16612494..ebe8920ac 100755 --- a/Algorithms/0009.palindrome-number/palindrome-number_test.go +++ b/Algorithms/0009.palindrome-number/palindrome-number_test.go @@ -1,4 +1,4 @@ -package Problem0009 +package problem0009 import ( "testing" diff --git a/Algorithms/0010.regular-expression-matching/README.md b/Algorithms/0010.regular-expression-matching/README.md index 19a8ce759..3312a2454 100755 --- a/Algorithms/0010.regular-expression-matching/README.md +++ b/Algorithms/0010.regular-expression-matching/README.md @@ -1,30 +1,67 @@ # [10. Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/) ## 题目 + +Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. Implement regular expression matching with support for '.' and '*'. -``` + +```text '.' Matches any single character. '*' Matches zero or more of the preceding element. +``` The matching should cover the entire input string (not partial). -The function prototype should be: -bool isMatch(const char *s, const char *p) +Note: -Some examples: +- s could be empty and contains only lowercase letters a-z. +- p could be empty and contains only lowercase letters a-z, and characters like . or *. -isMatch("aa","a") ? false -isMatch("aa","aa") ? true -isMatch("aaa","aa") ? false -isMatch("aa", "a*") ? true -isMatch("aa", ".*") ? true -isMatch("ab", ".*") ? true -isMatch("aab", "c*a*b") ? true +Example 1: + +```text +Input: +s = "aa" +p = "a" +Output: false +Explanation: "a" does not match the entire string "aa". ``` -## 解题思路 +Example 2: +```text +Input: +s = "aa" +p = "a*" +Output: true +Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa". +``` -## 总结 +Example 3: -动态规划问题。 \ No newline at end of file +```text +Input: +s = "ab" +p = ".*" +Output: true +Explanation: ".*" means "zero or more (*) of any character (.)". +``` + +Example 4: + +```text +Input: +s = "aab" +p = "c*a*b" +Output: true +Explanation: c can be repeated 0 times, a can be repeated 1 time. Therefore it matches "aab". +``` + +Example 5: + +```text +Input: +s = "mississippi" +p = "mis*is*p*." +Output: false +``` diff --git a/Algorithms/0010.regular-expression-matching/regular-expression-matching.go b/Algorithms/0010.regular-expression-matching/regular-expression-matching.go index 2dff09a80..8440a27a0 100755 --- a/Algorithms/0010.regular-expression-matching/regular-expression-matching.go +++ b/Algorithms/0010.regular-expression-matching/regular-expression-matching.go @@ -1,45 +1,52 @@ -package Problem0010 +package problem0010 -// 程序中存在以下假设 -// "*" 不会出现在p的首位 -// "**" 不会出现,但会出现 ".*."" , ".*.." , ".*.*" +func isMatch(s, p string) bool { + sSize := len(s) + pSize := len(p) -func isMatch(s string, p string) bool { - dp := make([][]bool, len(p)+1) + dp := make([][]bool, sSize+1) for i := range dp { - dp[i] = make([]bool, len(s)+1) + dp[i] = make([]bool, pSize+1) } - dp[0][0] = true + /* dp[i][j] 代表了 s[:i] 能否与 p[:j] 匹配 */ - for i := 2; i < len(dp); i += 2 { - if p[i-1] == '*' { - dp[i][0] = true - } else { - break + dp[0][0] = true + /** + * 根据题目的设定, "" 可以与 "a*b*c*" 相匹配 + * 所以,需要把相应的 dp 设置成 true + */ + for j := 1; j < pSize && dp[0][j-1]; j += 2 { + if p[j] == '*' { + dp[0][j+1] = true } } - for i := 1; i < len(dp); i++ { - if i < len(p) && p[i] == '*' { - continue - } - - for j := 1; j < len(dp[0]); j++ { - - if p[i-1] == '*' { - if p[i-2] == '.' { - dp[i][j] = dp[i-2][j-1] || dp[i][j-1] || dp[i-2][j] + for i := 0; i < sSize; i++ { + for j := 0; j < pSize; j++ { + if p[j] == '.' || p[j] == s[i] { + /* p[j] 与 s[i] 可以匹配上,所以,只要前面匹配,这里就能匹配上 */ + dp[i+1][j+1] = dp[i][j] + } else if p[j] == '*' { + /* 此时,p[j] 的匹配情况与 p[j-1] 的内容相关。 */ + if p[j-1] != s[i] && p[j-1] != '.' { + /** + * p[j] 无法与 s[i] 匹配上 + * p[j-1:j+1] 只能被当做 "" + */ + dp[i+1][j+1] = dp[i+1][j-1] } else { - dp[i][j] = (dp[i-2][j]) || (p[i-2] == s[j-1] && (dp[i-2][j-1] || dp[i][j-1])) + /** + * p[j] 与 s[i] 匹配上 + * p[j-1;j+1] 作为 "x*", 可以有三种解释 + */ + dp[i+1][j+1] = dp[i+1][j-1] || /* "x*" 解释为 "" */ + dp[i+1][j] || /* "x*" 解释为 "x" */ + dp[i][j+1] /* "x*" 解释为 "xx..." */ } - } else if p[i-1] == '.' { - dp[i][j] = dp[i-1][j-1] - } else { - dp[i][j] = dp[i-1][j-1] && p[i-1] == s[j-1] } } } - return dp[len(p)][len(s)] + return dp[sSize][pSize] } diff --git a/Algorithms/0010.regular-expression-matching/regular-expression-matching_test.go b/Algorithms/0010.regular-expression-matching/regular-expression-matching_test.go index 489e4eefe..4ed47bc5a 100755 --- a/Algorithms/0010.regular-expression-matching/regular-expression-matching_test.go +++ b/Algorithms/0010.regular-expression-matching/regular-expression-matching_test.go @@ -1,4 +1,4 @@ -package Problem0010 +package problem0010 import ( "testing" @@ -98,6 +98,24 @@ func Test_Problem0010(t *testing.T) { one: true, }, }, + question{ + p: para{ + one: "ab", + two: ".*c", + }, + a: ans{ + one: false, + }, + }, + question{ + p: para{ + one: "ab", + two: "z*t*x*c*a*b", + }, + a: ans{ + one: true, + }, + }, question{ p: para{ one: "ab", diff --git a/Algorithms/0011.container-with-most-water/container-with-most-water.go b/Algorithms/0011.container-with-most-water/container-with-most-water.go index 6a5eaf30c..c8c30ea26 100755 --- a/Algorithms/0011.container-with-most-water/container-with-most-water.go +++ b/Algorithms/0011.container-with-most-water/container-with-most-water.go @@ -1,4 +1,4 @@ -package Problem0011 +package problem0011 func maxArea(height []int) int { // 从两端开始寻找,至少保证了宽度是最大值 diff --git a/Algorithms/0011.container-with-most-water/container-with-most-water_test.go b/Algorithms/0011.container-with-most-water/container-with-most-water_test.go index 796006f1f..167355885 100755 --- a/Algorithms/0011.container-with-most-water/container-with-most-water_test.go +++ b/Algorithms/0011.container-with-most-water/container-with-most-water_test.go @@ -1,4 +1,4 @@ -package Problem0011 +package problem0011 import ( "testing" diff --git a/Algorithms/0012.integer-to-roman/integer-to-roman.go b/Algorithms/0012.integer-to-roman/integer-to-roman.go index 5b97d57e9..5f36d0976 100755 --- a/Algorithms/0012.integer-to-roman/integer-to-roman.go +++ b/Algorithms/0012.integer-to-roman/integer-to-roman.go @@ -1,4 +1,4 @@ -package Problem0012 +package problem0012 func intToRoman(num int) string { diff --git a/Algorithms/0012.integer-to-roman/integer-to-roman_test.go b/Algorithms/0012.integer-to-roman/integer-to-roman_test.go index 0527c9549..638e7e7ec 100755 --- a/Algorithms/0012.integer-to-roman/integer-to-roman_test.go +++ b/Algorithms/0012.integer-to-roman/integer-to-roman_test.go @@ -1,4 +1,4 @@ -package Problem0012 +package problem0012 import ( "testing" diff --git a/Algorithms/0013.roman-to-integer/roman-to-integer.go b/Algorithms/0013.roman-to-integer/roman-to-integer.go index d8b0b78ee..84d213b27 100755 --- a/Algorithms/0013.roman-to-integer/roman-to-integer.go +++ b/Algorithms/0013.roman-to-integer/roman-to-integer.go @@ -1,4 +1,4 @@ -package Problem0013 +package problem0013 func romanToInt(s string) int { res := 0 diff --git a/Algorithms/0013.roman-to-integer/roman-to-integer_test.go b/Algorithms/0013.roman-to-integer/roman-to-integer_test.go index 77dcb3fec..8597701cf 100755 --- a/Algorithms/0013.roman-to-integer/roman-to-integer_test.go +++ b/Algorithms/0013.roman-to-integer/roman-to-integer_test.go @@ -1,4 +1,4 @@ -package Problem0013 +package problem0013 import ( "testing" diff --git a/Algorithms/0014.longest-common-prefix/longest-common-prefix.go b/Algorithms/0014.longest-common-prefix/longest-common-prefix.go index cc5076736..a5c1fd84f 100755 --- a/Algorithms/0014.longest-common-prefix/longest-common-prefix.go +++ b/Algorithms/0014.longest-common-prefix/longest-common-prefix.go @@ -1,4 +1,4 @@ -package Problem0014 +package problem0014 func longestCommonPrefix(strs []string) string { short := shortest(strs) diff --git a/Algorithms/0014.longest-common-prefix/longest-common-prefix_test.go b/Algorithms/0014.longest-common-prefix/longest-common-prefix_test.go index 070e6a967..e7ca88c58 100755 --- a/Algorithms/0014.longest-common-prefix/longest-common-prefix_test.go +++ b/Algorithms/0014.longest-common-prefix/longest-common-prefix_test.go @@ -1,4 +1,4 @@ -package Problem0014 +package problem0014 import ( "testing" diff --git a/Algorithms/0015.3sum/3sum.go b/Algorithms/0015.3sum/3sum.go index 5c4316083..0e38a5831 100755 --- a/Algorithms/0015.3sum/3sum.go +++ b/Algorithms/0015.3sum/3sum.go @@ -1,4 +1,4 @@ -package Problem0015 +package problem0015 import "sort" @@ -8,6 +8,9 @@ func threeSum(nums []int) [][]int { res := [][]int{} for i := range nums { + if nums[i] > 0 { + break + } // 避免添加重复的结果 // i>0 是为了防止nums[i-1]溢出 if i > 0 && nums[i] == nums[i-1] { diff --git a/Algorithms/0015.3sum/3sum_test.go b/Algorithms/0015.3sum/3sum_test.go index bf0746852..030f8fc21 100755 --- a/Algorithms/0015.3sum/3sum_test.go +++ b/Algorithms/0015.3sum/3sum_test.go @@ -1,4 +1,4 @@ -package Problem0015 +package problem0015 import ( "fmt" diff --git a/Algorithms/0016.3sum-closest/3sum-closest.go b/Algorithms/0016.3sum-closest/3sum-closest.go index aa63c1fe7..dee36bf8c 100755 --- a/Algorithms/0016.3sum-closest/3sum-closest.go +++ b/Algorithms/0016.3sum-closest/3sum-closest.go @@ -1,4 +1,4 @@ -package Problem0016 +package problem0016 import ( "math" diff --git a/Algorithms/0016.3sum-closest/3sum-closest_test.go b/Algorithms/0016.3sum-closest/3sum-closest_test.go index d306ce6f5..77e11d0f5 100755 --- a/Algorithms/0016.3sum-closest/3sum-closest_test.go +++ b/Algorithms/0016.3sum-closest/3sum-closest_test.go @@ -1,4 +1,4 @@ -package Problem0016 +package problem0016 import ( "fmt" diff --git a/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.go b/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.go index a93237b65..c7832050f 100755 --- a/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.go +++ b/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number.go @@ -1,4 +1,4 @@ -package Problem0017 +package problem0017 var m = map[byte][]string{ '2': []string{"a", "b", "c"}, diff --git a/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number_test.go b/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number_test.go index f6951ced7..59e3179ed 100755 --- a/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number_test.go +++ b/Algorithms/0017.letter-combinations-of-a-phone-number/letter-combinations-of-a-phone-number_test.go @@ -1,4 +1,4 @@ -package Problem0017 +package problem0017 import ( "fmt" diff --git a/Algorithms/0018.4sum/4sum.go b/Algorithms/0018.4sum/4sum.go index 2939dac86..5cedcaae9 100755 --- a/Algorithms/0018.4sum/4sum.go +++ b/Algorithms/0018.4sum/4sum.go @@ -1,4 +1,4 @@ -package Problem0018 +package problem0018 import ( "sort" diff --git a/Algorithms/0018.4sum/4sum_test.go b/Algorithms/0018.4sum/4sum_test.go index 515ed44cf..7d0d2ce6c 100755 --- a/Algorithms/0018.4sum/4sum_test.go +++ b/Algorithms/0018.4sum/4sum_test.go @@ -1,4 +1,4 @@ -package Problem0018 +package problem0018 import ( "fmt" diff --git a/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.go b/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.go index c558cb260..806a7ef5a 100755 --- a/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.go +++ b/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.go @@ -1,4 +1,4 @@ -package Problem0019 +package problem0019 /* * Definition for singly-linked list. diff --git a/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list_test.go b/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list_test.go index 5359c0c82..1c51fb181 100755 --- a/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list_test.go +++ b/Algorithms/0019.remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list_test.go @@ -1,4 +1,4 @@ -package Problem0019 +package problem0019 import ( "fmt" diff --git a/Algorithms/0020.valid-parentheses/README.md b/Algorithms/0020.valid-parentheses/README.md index fc8edd119..2d9f5d009 100755 --- a/Algorithms/0020.valid-parentheses/README.md +++ b/Algorithms/0020.valid-parentheses/README.md @@ -1,12 +1,58 @@ # [20. Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) ## 题目 -Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. + +Given a string containing just the characters `'('`, `')'`, `'{'`, `'}'`, `'['` and `']'`, determine if the input string is valid. + +An input string is valid if: + +1. Open brackets must be closed by the same type of brackets. +1. Open brackets must be closed in the correct order. + +Note that an empty string is also considered valid. + +Example 1: + +```text +Input: "()" +Output: true +``` + +Example 2: + +```text +Input: "()[]{}" +Output: true +``` + +Example 3: + +```text +Input: "(]" +Output: false +``` + +Example 4: + +```text +Input: "([)]" +Output: false +``` + +Example 5: + +```text +Input: "{[]}" +Output: true +Given a string containing just the characters `'( '`, `') '`, `'{ '`, `'} '`, `'[' and `'] '`, determine if the input string is valid. +``` The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. ## 解题思路 + [栈](https://zh.wikipedia.org/wiki/%E5%A0%86%E6%A0%88)是一个后进先出的队列,用在这里可以避免复杂的判断结构。但是,Go语言的标准库没有栈这种结构,我就手动实现了一个。 ## 总结 + 选用合适的数据结构,可以让程序清晰。 \ No newline at end of file diff --git a/Algorithms/0020.valid-parentheses/valid-parentheses.go b/Algorithms/0020.valid-parentheses/valid-parentheses.go index 8a22af285..9cebeb474 100755 --- a/Algorithms/0020.valid-parentheses/valid-parentheses.go +++ b/Algorithms/0020.valid-parentheses/valid-parentheses.go @@ -1,45 +1,28 @@ -package Problem0020 - -func isValid(str string) bool { - s := new(stack) - - for _, b := range str { - switch b { - case '(', '[', '{': - s.push(b) +package problem0020 + +func isValid(s string) bool { + size := len(s) + + stack := make([]byte, size) + top := 0 + + for i := 0; i < size; i++ { + c := s[i] + switch c { + case '(': + stack[top] = c + 1 // '('+1 is ')' + top++ + case '[', '{': + stack[top] = c + 2 + top++ case ')', ']', '}': - if r, ok := s.pop(); !ok || r != matching[b] { - // !ok 说明“([{”的数量,小于")]}"的数量 + if top > 0 && stack[top-1] == c { + top-- + } else { return false } } } - // len(*s) > 0 说明"([{"的数量,大于")]}"的数量 - if len(*s) > 0 { - return false - } - - return true -} - -var matching = map[rune]rune{ - ')': '(', - ']': '[', - '}': '{', -} - -type stack []rune - -func (s *stack) push(b rune) { - *s = append(*s, b) -} - -func (s *stack) pop() (rune, bool) { - if len(*s) > 0 { - res := (*s)[len(*s)-1] - *s = (*s)[:len(*s)-1] - return res, true - } - return 0, false + return top == 0 } diff --git a/Algorithms/0020.valid-parentheses/valid-parentheses_test.go b/Algorithms/0020.valid-parentheses/valid-parentheses_test.go index a464d1c4d..7f281d7df 100755 --- a/Algorithms/0020.valid-parentheses/valid-parentheses_test.go +++ b/Algorithms/0020.valid-parentheses/valid-parentheses_test.go @@ -1,4 +1,4 @@ -package Problem0020 +package problem0020 import ( "fmt" @@ -64,3 +64,9 @@ func Test_Problem0020(t *testing.T) { ast.Equal(a.one, isValid(p.one), "输入:%v", p) } } + +func Benchmark_isValid(b *testing.B) { + for i := 1; i < b.N; i++ { + isValid("{{{{{[[[[[((((()))))]]]]]}}}}}") + } +} diff --git a/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists.go b/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists.go index d669296d6..7345972c3 100755 --- a/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists.go +++ b/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists.go @@ -1,4 +1,4 @@ -package Problem0021 +package problem0021 /** * Definition for singly-linked list. diff --git a/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go b/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go index 89f699f07..5608153af 100755 --- a/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go +++ b/Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go @@ -1,4 +1,4 @@ -package Problem0021 +package problem0021 import ( "fmt" diff --git a/Algorithms/0022.generate-parentheses/README.md b/Algorithms/0022.generate-parentheses/README.md index a880507eb..1bb736c87 100755 --- a/Algorithms/0022.generate-parentheses/README.md +++ b/Algorithms/0022.generate-parentheses/README.md @@ -1,10 +1,12 @@ # [22. Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) ## 题目 + Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: -``` + +```text [ "((()))", "(()())", @@ -13,20 +15,25 @@ For example, given n = 3, a solution set is: "()()()" ] ``` + ## 解题思路 + 在当前局面下,你有若干种选择。那么尝试每一种选择。如果已经发现某种选择肯定不行(因为违反了某些限定条件),就返回;如果某种选择试到最后发现是正确解,就将其加入解集 需要从两个方面去思考:1. 选择与限制;2.结束条件 对于这道题,在任何时刻,你都有两种选择: + 1. 加左括号。 2. 加右括号。 同时有以下限制: + 1. 如果左括号已经用完了,则不能再加左括号了。 2. 如果已经出现的右括号和左括号一样多,则不能再加右括号了。因为那样的话新加入的右括号一定无法匹配。 结束条件是: + 1. 左右括号都已经用完。 结束后的正确性: @@ -38,7 +45,8 @@ For example, given n = 3, a solution set is: 当然你还需要知道当前局面substr和解集res。 因此,把上面的思路拼起来就是代码: -``` + +```text if (左右括号都已用完) { 加入解集,返回 } @@ -50,4 +58,5 @@ if (还有右括号可以用,且,右括号小于左括号) { 加一个右括号,继续递归 } ``` + ## 总结 \ No newline at end of file diff --git a/Algorithms/0022.generate-parentheses/generate-parentheses.go b/Algorithms/0022.generate-parentheses/generate-parentheses.go index 0a06d2bef..eb16ef980 100755 --- a/Algorithms/0022.generate-parentheses/generate-parentheses.go +++ b/Algorithms/0022.generate-parentheses/generate-parentheses.go @@ -1,25 +1,31 @@ -package Problem0022 +package problem0022 func generateParenthesis(n int) []string { - res := []string{} - gen(n, n, "", &res) + res := make([]string, 0, n*n) + bytes := make([]byte, n*2) + dfs(n, n, 0, bytes, &res) return res } -func gen(left, right int, substr string, res *[]string) { - // 成功找到一个解 +func dfs(left, right, idx int, bytes []byte, res *[]string) { + // 所有符号都添加完毕 if left == 0 && right == 0 { - *res = append(*res, substr) + *res = append(*res, string(bytes)) return } - // 因为左括号不用担心匹配问题,只要还有左括号,就可以随便加。 + // "(" 不用担心匹配问题, + // 只要 left > 0 就可以直接添加 if left > 0 { - gen(left-1, right, substr+"(", res) + bytes[idx] = '(' + dfs(left-1, right, idx+1, bytes, res) } - // 右括号只有在左括号剩余较少的前提下,才能加 + // 想要添加 ")" 时 + // 需要 left < right, + // 即在 bytes[:idx] 至少有一个 "(" 可以与 这个 ")" 匹配 if right > 0 && left < right { - gen(left, right-1, substr+")", res) + bytes[idx] = ')' + dfs(left, right-1, idx+1, bytes, res) } } diff --git a/Algorithms/0022.generate-parentheses/generate-parentheses_test.go b/Algorithms/0022.generate-parentheses/generate-parentheses_test.go index 231649b4c..7f00e335e 100755 --- a/Algorithms/0022.generate-parentheses/generate-parentheses_test.go +++ b/Algorithms/0022.generate-parentheses/generate-parentheses_test.go @@ -1,4 +1,4 @@ -package Problem0022 +package problem0022 import ( "fmt" @@ -78,3 +78,9 @@ func Test_Problem0022(t *testing.T) { ast.Equal(a.one, generateParenthesis(p.one), "输入:%v", p) } } + +func Benchmark_generateParenthesis(b *testing.B) { + for i := 0; i < b.N; i++ { + generateParenthesis(10) + } +} diff --git a/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists.go b/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists.go index 49f97f5dd..5205e99c8 100755 --- a/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists.go +++ b/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists.go @@ -1,4 +1,4 @@ -package Problem0023 +package problem0023 // ListNode 是链接节点 type ListNode struct { diff --git a/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists_test.go b/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists_test.go index 483a1a86f..e8be15d8c 100755 --- a/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists_test.go +++ b/Algorithms/0023.merge-k-sorted-lists/merge-k-sorted-lists_test.go @@ -1,4 +1,4 @@ -package Problem0023 +package problem0023 import ( "fmt" diff --git a/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs.go b/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs.go index 38fbc6365..861bb3717 100755 --- a/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs.go +++ b/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs.go @@ -1,23 +1,20 @@ -package Problem0024 +package problem0024 -// ListNode ListNode -type ListNode struct { - Val int - Next *ListNode -} +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// ListNode is definition for singly-linked list +type ListNode = kit.ListNode func swapPairs(head *ListNode) *ListNode { if head == nil || head.Next == nil { return head } - // 让temp指向head.Next节点 - temp := head.Next - // 让head.Next指向转换好了temp.Next节点 - head.Next = swapPairs(temp.Next) - // 让temp.Next指向head节点 - temp.Next = head - // temp成为新的head节点 + newHead := head.Next + head.Next = swapPairs(newHead.Next) + newHead.Next = head - return temp + return newHead } diff --git a/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs_test.go b/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs_test.go index 9f847c64e..06e5c4d5b 100755 --- a/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs_test.go +++ b/Algorithms/0024.swap-nodes-in-pairs/swap-nodes-in-pairs_test.go @@ -1,4 +1,4 @@ -package Problem0024 +package problem0024 import ( "fmt" @@ -91,3 +91,10 @@ func s2l(nums []int) *ListNode { return res } + +func Benchmark_swapPairs(b *testing.B) { + head := s2l([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9}) + for i := 1; i < b.N; i++ { + swapPairs(head) + } +} diff --git a/Algorithms/0025.reverse-nodes-in-k-group/README.md b/Algorithms/0025.reverse-nodes-in-k-group/README.md index 370a3f6a6..c12ea0d0b 100755 --- a/Algorithms/0025.reverse-nodes-in-k-group/README.md +++ b/Algorithms/0025.reverse-nodes-in-k-group/README.md @@ -1,26 +1,24 @@ # [25. Reverse Nodes in k-Group](https://leetcode.com/problems/reverse-nodes-in-k-group/) ## 题目 + Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. -You may not alter the values in the nodes, only nodes itself may be changed. - -Only constant memory is allowed. +Example: -For example, Given this linked list: 1->2->3->4->5 For k = 2, you should return: 2->1->4->3->5 For k = 3, you should return: 3->2->1->4->5 -## 解题思路 -题目要求,把一条链上的每k个节点进行逆转,不足k个的末尾,则不需要逆转。 +Note: -详见注释 - -## 总结 +- Only constant extra memory is allowed. +- You may not alter the values in the list's nodes, only nodes itself may be changed. +## 解题思路 +见程序注释 diff --git a/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group.go b/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group.go index 43f8e9846..ea68a3d81 100755 --- a/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group.go +++ b/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group.go @@ -1,74 +1,43 @@ -package Problem0025 +package problem0025 -/** - * Definition for singly-linked list. - * type ListNode struct { - * Val int - * Next *ListNode - * } - */ +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// ListNode defines for singly-linked list. +type ListNode = kit.ListNode func reverseKGroup(head *ListNode, k int) *ListNode { - if head == nil || head.Next == nil || k < 2 { + if k < 2 || head == nil || head.Next == nil { return head } - next, ok := needReverse(head, k) - if ok { - head, tail := reverse(head) - // 递归 - // 把整理好了的前k个节点的尾部,指向整理好了的后面节点的head - tail.Next = reverseKGroup(next, k) - return head + tail, needReverse := getTail(head, k) + + if needReverse { + tailNext := tail.Next + /* 斩断 tail 后的链接 */ + tail.Next = nil + head, tail = reverse(head, tail) + /* tail 后面接上尾部的递归处理 */ + tail.Next = reverseKGroup(tailNext, k) } return head } -// 判断是否有前k个节点需要逆转。 -// 需要的话 -// 会把KthNode.Next = nil,把k和k+1节点斩断,便于前k个节点的逆转。 -func needReverse(head *ListNode, k int) (begin *ListNode, ok bool) { - for head != nil { - if k == 1 { - begin = head.Next - // 把前k与后面的节点斩断, 便于reverse - head.Next = nil - return begin, true - } - +func getTail(head *ListNode, k int) (*ListNode, bool) { + for k > 1 && head != nil { head = head.Next k-- } - - return nil, false + return head, k == 1 && head != nil } -// 返回逆转后的首尾节点 -func reverse(head *ListNode) (first, last *ListNode) { - if head == nil || head.Next == nil { - return head, nil - } - - gotLast := false - - for head != nil { - temp := head.Next - head.Next = first - first = head - head = temp - - if !gotLast { - last = first - gotLast = true - } +func reverse(head, tail *ListNode) (*ListNode, *ListNode) { + curPre, cur := head, head.Next + for cur != nil { + curPre, cur, cur.Next = cur, cur.Next, curPre } - - return first, last -} - -// ListNode 是链接节点 -type ListNode struct { - Val int - Next *ListNode + return tail, head } diff --git a/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group_test.go b/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group_test.go index 229fac3d7..38872e46b 100755 --- a/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group_test.go +++ b/Algorithms/0025.reverse-nodes-in-k-group/reverse-nodes-in-k-group_test.go @@ -1,105 +1,52 @@ -package Problem0025 +package problem0025 import ( "fmt" "testing" + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" ) -type question struct { - para - ans -} - -// para 是参数 -// one 代表第一个参数 -type para struct { - one []int - two int -} - -// ans 是答案 -// one 代表第一个答案 -type ans struct { - one []int -} - -func Test_Problem0025(t *testing.T) { - ast := assert.New(t) - - qs := []question{ - - question{ - para{ - []int{1, 2, 3, 4, 5}, - 3, - }, - ans{[]int{3, 2, 1, 4, 5}}, - }, - - question{ - para{ - []int{1, 2, 3, 4, 5}, - 1, - }, - ans{[]int{1, 2, 3, 4, 5}}, - }, +// tcs is testcase slice +var tcs = []struct { + head []int + k int + ans []int +}{ - // 如需多个测试,可以复制上方元素。 - } - - for _, q := range qs { - a, p := q.ans, q.para - fmt.Printf("~~%v~~\n", p) + { + []int{1, 2, 3, 4, 5}, + 3, + []int{3, 2, 1, 4, 5}, + }, - ast.Equal(a.one, l2s(reverseKGroup(s2l(p.one), p.two)), "输入:%v", p) - } -} -func Test_needReverse(t *testing.T) { - head := s2l([]int{1, 2, 3, 4, 5, 6}) - begin, ok := needReverse(head, 4) - assert.True(t, ok, "长度足够的链却提示不能逆转") - assert.Equal(t, []int{1, 2, 3, 4}, l2s(head), "前链不对, 没有被斩断") - assert.Equal(t, []int{5, 6}, l2s(begin), "后链不对") -} -func Test_reverse(t *testing.T) { - first, last := reverse(s2l([]int{1, 2, 3})) - assert.Equal(t, []int{3, 2, 1}, l2s(first), "无法逆转链") - assert.Equal(t, 1, last.Val, "链尾部的值不对") + { + []int{1, 2, 3, 4, 5}, + 1, + []int{1, 2, 3, 4, 5}, + }, - Nil, _ := reverse(s2l([]int{})) - assert.Nil(t, Nil, "无法逆转空链") + // 可以有多个 testcase } -// convert *ListNode to []int -func l2s(head *ListNode) []int { - res := []int{} +func Test_reverseKGroup(t *testing.T) { + ast := assert.New(t) - for head != nil { - res = append(res, head.Val) - head = head.Next + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.head) + ans := kit.Ints2List(tc.ans) + ast.Equal(ans, reverseKGroup(head, tc.k), "输入:%v", tc) } - - return res } -// convert []int to *ListNode -func s2l(nums []int) *ListNode { - if len(nums) == 0 { - return nil - } - - res := &ListNode{ - Val: nums[0], - } - temp := res - for i := 1; i < len(nums); i++ { - temp.Next = &ListNode{ - Val: nums[i], +func Benchmark_reverseKGroup(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + reverseKGroup(head, tc.k) } - temp = temp.Next } - - return res } diff --git a/Algorithms/0026.remove-duplicates-from-sorted-array/README.md b/Algorithms/0026.remove-duplicates-from-sorted-array/README.md index d3631f3c2..c086f36d3 100755 --- a/Algorithms/0026.remove-duplicates-from-sorted-array/README.md +++ b/Algorithms/0026.remove-duplicates-from-sorted-array/README.md @@ -1,18 +1,50 @@ # [26. Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) ## 题目 -Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. -Do not allocate extra space for another array, you must do this in place with constant memory. +Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. -For example, -Given input array nums = [1,1,2], +Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. -Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively. It doesn't matter what you leave beyond the new length. +Example 1: -## 解题思路 -题目要求原地删除重复的元素。并返回没有重复元素的切片的长度。 +```text +Given nums = [1,1,2], + +Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively. + +It doesn't matter what you leave beyond the returned length. +``` + +Example 2: + +```text +Given nums = [0,0,1,1,1,2,2,3,3,4], + +Your function should return length = 5, with the first five elements of nums being modified to0, 1, 2, 3, and4 respectively. + +It doesn't matter what values are set beyondthe returned length. +``` -## 总结 +Clarification: +Confused why the returned value is an integer but your answer is an array? + +Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well. + +Internally you can think of this: + +```text +// nums is passed in by reference. (i.e., without making a copy) +int len = removeDuplicates(nums); + +// any modification to nums in your function would be known by the caller. +// using the length returned by your function, it prints the first len elements. +for (int i = 0; i < len; i++) { + print(nums[i]); +} +``` + +## 解题思路 +见程序注释 diff --git a/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.go b/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.go index 17778f576..b92a387a0 100755 --- a/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.go +++ b/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.go @@ -1,22 +1,13 @@ -package Problem0026 +package problem0026 -func removeDuplicates(nums []int) int { - if len(nums) <= 1 { - return len(nums) - } - - res := 1 - i := 1 - for ; i < len(nums); i++ { - if nums[i] == nums[i-1] { +func removeDuplicates(a []int) int { + left, right, size := 0, 1, len(a) + for ; right < size; right++ { + if a[left] == a[right] { continue } - if res != i { - nums[res] = nums[i] - } - - res++ + left++ + a[left], a[right] = a[right], a[left] } - - return res + return left + 1 } diff --git a/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array_test.go b/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array_test.go index ab1c0a2f2..24ff21a2c 100755 --- a/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array_test.go +++ b/Algorithms/0026.remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array_test.go @@ -1,4 +1,4 @@ -package Problem0026 +package problem0026 import ( "fmt" @@ -7,47 +7,38 @@ import ( "github.com/stretchr/testify/assert" ) -type question struct { - para - ans -} +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ -// para 是参数 -// one 代表第一个参数 -type para struct { - one []int -} + { + []int{1, 1, 2}, + 2, + }, -// ans 是答案 -// one 代表第一个答案 -type ans struct { - one int - two []int + { + []int{0, 0, 1, 1, 1, 2, 2, 3, 3, 4}, + 5, + }, + + // 可以有多个 testcase } -func Test_Problem0026(t *testing.T) { +func Test_removeDuplicates(t *testing.T) { ast := assert.New(t) - qs := []question{ - - question{ - para{[]int{1, 2, 2, 3, 3, 4, 5}}, - ans{5, []int{1, 2, 3, 4, 5}}, - }, - - question{ - para{[]int{1}}, - ans{1, []int{1}}, - }, - - // 如需多个测试,可以复制上方元素。 + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, removeDuplicates(tc.nums), "输入:%v", tc) } +} - for _, q := range qs { - a, p := q.ans, q.para - fmt.Printf("~~%v~~\n", p) - l := removeDuplicates(p.one) - ast.Equal(a.one, l, "输入:%v", p) - ast.Equal(a.two, p.one[:l]) +func Benchmark_removeDuplicates(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeDuplicates(tc.nums) + } } } diff --git a/Algorithms/0027.remove-element/remove-element.go b/Algorithms/0027.remove-element/remove-element.go index 80eea36d7..16dda7410 100755 --- a/Algorithms/0027.remove-element/remove-element.go +++ b/Algorithms/0027.remove-element/remove-element.go @@ -1,4 +1,4 @@ -package Problem0027 +package problem0027 func removeElement(nums []int, val int) int { // j指向最后一个不为val的位置 diff --git a/Algorithms/0027.remove-element/remove-element_test.go b/Algorithms/0027.remove-element/remove-element_test.go index d9c4f675a..9b6cf3900 100755 --- a/Algorithms/0027.remove-element/remove-element_test.go +++ b/Algorithms/0027.remove-element/remove-element_test.go @@ -1,4 +1,4 @@ -package Problem0027 +package problem0027 import ( "fmt" diff --git a/Algorithms/0028.implement-strstr/implement-strstr.go b/Algorithms/0028.implement-strstr/implement-strstr.go index e08f5e8e1..513850b71 100755 --- a/Algorithms/0028.implement-strstr/implement-strstr.go +++ b/Algorithms/0028.implement-strstr/implement-strstr.go @@ -1,4 +1,4 @@ -package Problem0028 +package problem0028 func strStr(haystack string, needle string) int { hlen, nlen := len(haystack), len(needle) diff --git a/Algorithms/0028.implement-strstr/implement-strstr_test.go b/Algorithms/0028.implement-strstr/implement-strstr_test.go index 9303e0f81..3f5ec8f47 100755 --- a/Algorithms/0028.implement-strstr/implement-strstr_test.go +++ b/Algorithms/0028.implement-strstr/implement-strstr_test.go @@ -1,4 +1,4 @@ -package Problem0028 +package problem0028 import ( "fmt" diff --git a/Algorithms/0029.divide-two-integers/divide-two-integers.go b/Algorithms/0029.divide-two-integers/divide-two-integers.go index b1cdc54e6..18aa148c3 100755 --- a/Algorithms/0029.divide-two-integers/divide-two-integers.go +++ b/Algorithms/0029.divide-two-integers/divide-two-integers.go @@ -1,4 +1,4 @@ -package Problem0029 +package problem0029 import ( "math" diff --git a/Algorithms/0029.divide-two-integers/divide-two-integers_test.go b/Algorithms/0029.divide-two-integers/divide-two-integers_test.go index c092abe77..62fad769d 100755 --- a/Algorithms/0029.divide-two-integers/divide-two-integers_test.go +++ b/Algorithms/0029.divide-two-integers/divide-two-integers_test.go @@ -1,4 +1,4 @@ -package Problem0029 +package problem0029 import ( "fmt" diff --git a/Algorithms/0030.substring-with-concatenation-of-all-words/README.md b/Algorithms/0030.substring-with-concatenation-of-all-words/README.md index 2000e07d1..e2097d21e 100755 --- a/Algorithms/0030.substring-with-concatenation-of-all-words/README.md +++ b/Algorithms/0030.substring-with-concatenation-of-all-words/README.md @@ -1,19 +1,31 @@ # [30. Substring with Concatenation of All Words](https://leetcode.com/problems/substring-with-concatenation-of-all-words/) ## 题目 + You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters. + +Example 1: + +```text +Input: + s = "barfoothefoobarman", + words = ["foo","bar"] +Output: [0,9] +Explanation: Substrings starting at index 0 and 9 are "barfoor" and "foobar" respectively. +The output order does not matter, returning [9,0] is fine too. ``` -For example, given: -s: "barfoothefoobarman" -words: ["foo", "bar"] + +Example 2: + +```text +Input: + s = "wordgoodstudentgoodword", + words = ["word","student"] +Output: [] ``` -You should return the indices: [0,9]. -(order does not matter). ## 解题思路 + words中会包含重复的word 详见程序注释。 -## 总结 - - diff --git a/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words.go b/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words.go index 083776bab..93dec6fc1 100755 --- a/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words.go +++ b/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words.go @@ -1,80 +1,113 @@ -package Problem0030 +package problem0030 func findSubstring(s string, words []string) []int { - res := []int{} + lens := len(s) + res := make([]int, 0, lens) - lens, numWords, lenw := len(s), len(words), len(words[0]) - if lens == 0 || numWords == 0 || lens < numWords*lenw { + lenws := len(words) + if lens == 0 || lenws == 0 || lens < lenws*len(words[0]) { return res } - // remainNum 记录 words 中每个单词还能出现的次数 - remainNum := make(map[string]int, numWords) - // count 记录符号要求的单词的连续出现次数 - count := 0 - initRecord := func() { - for _, word := range words { - remainNum[word] = 0 + lenw := len(words[0]) + + // record 记录 words 中每个单词总共出现的次数 + record := make(map[string]int, lenws) + for _, w := range words { + if len(w) != lenw { + // 新添加的 example 2 出现了 words 中单词长度不一致的情况。 + // 这个违反了假设 + // 直接返回 res + return res } - for _, word := range words { - remainNum[word]++ + record[w]++ + } + + // remain 记录 words 中每个单词还能出现的次数 + remain := make(map[string]int, lenws) + // count 记录符合要求的单词的连续出现次数 + count := 1 // count 的初始值只要不为 0 就可以 + left, right := 0, 0 + + /** + * s[left:right] 作为一个窗口存在 + * 假设 word:= s[right:right+lenw] + * 如果 remain[word]>0 ,那么移动窗口 右边,同时更新移动后 s[left:right] 的统计信息 + * remain[word]-- + * right += lenw + * count++ + * 否则,移动窗口 左边,同时更新移动后 s[left:right] 的统计信息 + * remain[s[left:left+lenw]]++ + * count-- + * left += lenw + * + * 每次移动窗口 右边 后,如果 count = lenws ,那么 + * 说明找到了一个符合条件的解 + * append(res, left),然后 + * 移动窗口 左边 + */ + + // reset 重置 remain 和 count + reset := func() { + if count == 0 { + // 统计记录没有被修改,不需要重置 + // 因为有这个预判,所以需要第一次执行 reset 时 + // count 的值不能为 0 + // 即 count 的初始值不能为 0 + return + } + for k, v := range record { + remain[k] = v } count = 0 - } // 把这个匿名函数放在这里,可以避免繁琐的函数参数 - - // 由于 index 增加的跨度是 lenw - // index 需要分别从{0,1,...,lenw-1}这些位置开始检查,才能不遗漏 - for initialIndex := 0; initialIndex < lenw; initialIndex++ { - index := initialIndex - // moveIndex 让 index 指向下一个单词 - moveIndex := func() { - // index 指向下一个单词的同时,需要同时修改统计记录 + } - // 增加 index 指向的 word 可出现次数一次, - remainNum[s[index:index+lenw]]++ - // 连续符合条件的单词数减少一个 - count-- - // index 后移一个 word 的长度 - index += lenw - } // 把这个匿名函数放在这里,可以避免繁琐的函数参数 + // moveLeft 让 left 指向下一个单词 + moveLeft := func() { + // left 指向下一个单词前,需要修改统计记录 + // 增加 left 指向的 word 可出现次数一次, + remain[s[left:left+lenw]]++ + // 连续符合条件的单词数减少一个 + count-- + // left 后移一个 word 的长度 + left += lenw + } - initRecord() + // left 需要分别从{0,1,...,lenw-1}这些位置开始检查,才能不遗漏 + for i := 0; i < lenw; i++ { + left, right = i, i + reset() - for index+numWords*lenw <= lens { // 注意,这里是有等号的 - word := s[index+count*lenw : index+(count+1)*lenw] - remainTimes, ok := remainNum[word] + // s[left:] 的长度 >= words 中所有 word 组成的字符串的长度时, + // s[left:] 中才有可能存在要找的字符串 + for lens-left >= lenws*lenw { + word := s[right : right+lenw] + remainTimes, ok := remain[word] switch { case !ok: - // 出现了不在 words 中的单词 - // 从 word 后面一个单词,重新开始统计 - index += lenw * (count + 1) - if count != 0 { - // 统计记录已经被修改,需要再次初始化 - initRecord() - } + // word 不在 words 中 + // 从 right+lenw 处,作为新窗口,重新开始统计 + left, right = right+lenw, right+lenw + reset() case remainTimes == 0: // word 的出现次数上次就用完了 - // 说明s[index:index+(count+1)*lenw]中有单词多出现了 - moveIndex() + // 说明 word 在 s[left:right] 中出现次数过多 + moveLeft() // 这个case会连续出现 - // 直到s[index:index+(count+1)*lenw]中所有单词的出现次数都不超标 - // - // 在 moveIndex() 的过程中,index+(count+1)*lenw 保持值不变 + // 直到 s[left:right] 中的统计结果是 remain[word] == 1 + // 这个过程中,right 一直不变 default: // ok && remainTimes > 0,word 符合出现的条件 - - // 更新统计记录 - remainNum[word]-- + // moveRight + remain[word]-- count++ - - // 检查 words 能否排列组合成 s[index:index+count*lenw] - if count == numWords { - res = append(res, index) - - // 把 index 指向下一个单词 - // 开始下一个统计 - moveIndex() + right += lenw + // 检查 words 能否排列组合成 s[left:right] + if count == lenws { + res = append(res, left) + // moveLeft 可以避免重复统计 s[left+lenw:right] 中的信息 + moveLeft() } } } diff --git a/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words_test.go b/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words_test.go index 86a73834d..9192aad52 100755 --- a/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words_test.go +++ b/Algorithms/0030.substring-with-concatenation-of-all-words/substring-with-concatenation-of-all-words_test.go @@ -1,4 +1,4 @@ -package Problem0030 +package problem0030 import ( "fmt" @@ -41,6 +41,11 @@ func Test_Problem0030(t *testing.T) { ans{[]int{3, 12}}, }, + question{ + para{"attoinattoin", []string{"at", "tto", "in"}}, + ans{[]int{}}, + }, + question{ para{"attoinattoin", []string{"at", "to", "in"}}, ans{[]int{0, 2, 4, 6}}, @@ -57,6 +62,11 @@ func Test_Problem0030(t *testing.T) { ans{[]int{8}}, }, + question{ + para{"barfoothefoobarmanattoinin", []string{"at", "to", "in", "in"}}, + ans{[]int{18}}, + }, + // 如需多个测试,可以复制上方元素。 } diff --git a/Algorithms/0031.next-permutation/README.md b/Algorithms/0031.next-permutation/README.md index 8e6a3b5ae..8052c8d25 100755 --- a/Algorithms/0031.next-permutation/README.md +++ b/Algorithms/0031.next-permutation/README.md @@ -1,6 +1,7 @@ # [31. Next Permutation](https://leetcode.com/problems/next-permutation/) ## 题目 + Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). @@ -8,13 +9,14 @@ If such arrangement is not possible, it must rearrange it as the lowest possible The replacement must be in-place, do not allocate extra memory. Here are some examples. Inputs are in the left-hand column and its corresponding outputs are in the right-hand column. -``` + +```text 1,2,3 → 1,3,2 3,2,1 → 1,2,3 1,1,5 → 1,5,1 ``` + ## 解题思路 -这道题让我们求下一个排列顺序,有题目中给的例子可以看出来,如果给定数组是降序,则说明是全排列的最后一种情况,则下一个排列就是最初始情况,可以参见之前的博客 Permutations 全排列。我们再来看下面一个例子,有如下的一个数组 1  2  7  4  3  1 @@ -35,6 +37,3 @@ Here are some examples. Inputs are in the left-hand column and its corresponding 把序列前的元素,与序列中,第一个大于他的元素互换。 1  `3`  1  `2`  4  7 - - -## 总结 \ No newline at end of file diff --git a/Algorithms/0031.next-permutation/next-permutation.go b/Algorithms/0031.next-permutation/next-permutation.go index 27dd68a45..95191c16f 100755 --- a/Algorithms/0031.next-permutation/next-permutation.go +++ b/Algorithms/0031.next-permutation/next-permutation.go @@ -1,31 +1,47 @@ -package Problem0031 +package problem0031 -import "sort" +func nextPermutation(a []int) { + left := len(a) - 2 + for 0 <= left && a[left] >= a[left+1] { + left-- + } + + // 此时 a[left+1:] 是一个 递减 数列 -func nextPermutation(nums []int) { - var i int - length := len(nums) + reverse(a, left+1) - if length <= 1 { + if left == -1 { return } - for i = length - 1; i >= 1; i-- { - if nums[i] > nums[i-1] { - break - } + // 此时 a[left+1:] 是一个 递增 数列 + + right := search(a, left+1, a[left]) + a[left], a[right] = a[right], a[left] +} + +// 逆转 a[l:] +func reverse(a []int, l int) { + r := len(a) - 1 + for l < r { + a[l], a[r] = a[r], a[l] + l++ + r-- } +} - if i > 0 { - sort.Ints(nums[i:]) - for j := i - 1; j < length; j++ { - if nums[j] > nums[i-1] { - nums[i-1], nums[j] = nums[j], nums[i-1] - return - } +// 返回 a[l:] 中 > target 的最小值的索引号 +// a[l:] 是一个 递增 数列 +func search(a []int, l, target int) int { + r := len(a) - 1 + l-- + for l+1 < r { + mid := (l + r) / 2 + if target < a[mid] { + r = mid + } else { + l = mid } } - - sort.Ints(nums) - + return r } diff --git a/Algorithms/0031.next-permutation/next-permutation_test.go b/Algorithms/0031.next-permutation/next-permutation_test.go index 2ca788fa9..309282469 100755 --- a/Algorithms/0031.next-permutation/next-permutation_test.go +++ b/Algorithms/0031.next-permutation/next-permutation_test.go @@ -1,4 +1,4 @@ -package Problem0031 +package problem0031 import ( "fmt" @@ -24,69 +24,77 @@ type ans struct { one []int } +var qs = []question{ + + question{ + para{[]int{1, 5, 4, 3, 2}}, + ans{[]int{2, 1, 3, 4, 5}}, + }, + + question{ + para{[]int{1, 5, 1}}, + ans{[]int{5, 1, 1}}, + }, + + question{ + para{[]int{5, 1, 1}}, + ans{[]int{1, 1, 5}}, + }, + + question{ + para{[]int{1, 1}}, + ans{[]int{1, 1}}, + }, + + question{ + para{[]int{1, 2, 7, 4, 3, 1}}, + ans{[]int{1, 3, 1, 2, 4, 7}}, + }, + + question{ + para{[]int{1, 2, 3}}, + ans{[]int{1, 3, 2}}, + }, + + question{ + para{[]int{3, 2, 1}}, + ans{[]int{1, 2, 3}}, + }, + + question{ + para{[]int{1, 1, 5}}, + ans{[]int{1, 5, 1}}, + }, + + question{ + para{[]int{2, 1}}, + ans{[]int{1, 2}}, + }, + + question{ + para{[]int{1}}, + ans{[]int{1}}, + }, + + // 如需多个测试,可以复制上方元素。 +} + func Test_Problem0031(t *testing.T) { ast := assert.New(t) - qs := []question{ - - question{ - para{[]int{5, 1, 1}}, - ans{[]int{1, 1, 5}}, - }, - - question{ - para{[]int{1, 1}}, - ans{[]int{1, 1}}, - }, - - question{ - para{[]int{1, 5, 1}}, - ans{[]int{5, 1, 1}}, - }, - - question{ - para{[]int{1, 5, 4, 3, 2}}, - ans{[]int{2, 1, 3, 4, 5}}, - }, - - question{ - para{[]int{1, 2, 7, 4, 3, 1}}, - ans{[]int{1, 3, 1, 2, 4, 7}}, - }, - - question{ - para{[]int{1, 2, 3}}, - ans{[]int{1, 3, 2}}, - }, - - question{ - para{[]int{3, 2, 1}}, - ans{[]int{1, 2, 3}}, - }, - - question{ - para{[]int{1, 1, 5}}, - ans{[]int{1, 5, 1}}, - }, - - question{ - para{[]int{2, 1}}, - ans{[]int{1, 2}}, - }, - - question{ - para{[]int{1}}, - ans{[]int{1}}, - }, - - // 如需多个测试,可以复制上方元素。 - } - for _, q := range qs { a, p := q.ans, q.para fmt.Printf("~~%v~~\n", p) - nextPermutation(p.one) ast.Equal(a.one, p.one, "输入:%v", p) } + +} + +func Benchmark_Problem0031(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, q := range qs { + nextPermutation(q.para.one) + } + } } diff --git a/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses.go b/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses.go index ebdc6c915..27657fe57 100755 --- a/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses.go +++ b/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses.go @@ -1,4 +1,4 @@ -package Problem0032 +package problem0032 func longestValidParentheses(s string) int { var left, max, temp int diff --git a/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses_test.go b/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses_test.go index e334d52b5..313df2fc1 100755 --- a/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses_test.go +++ b/Algorithms/0032.longest-valid-parentheses/longest-valid-parentheses_test.go @@ -1,4 +1,4 @@ -package Problem0032 +package problem0032 import ( "fmt" diff --git a/Algorithms/0033.search-in-rotated-sorted-array/README.md b/Algorithms/0033.search-in-rotated-sorted-array/README.md index d1c1b9017..86ab141fe 100755 --- a/Algorithms/0033.search-in-rotated-sorted-array/README.md +++ b/Algorithms/0033.search-in-rotated-sorted-array/README.md @@ -1,6 +1,7 @@ # [33. Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) ## 题目 + Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). @@ -10,19 +11,22 @@ You are given a target value to search. If found in the array return its index, You may assume no duplicate exists in the array. ## 解题思路 -先假设old = [0, 1, 2, 4, 5, 6, 7],利用二分查找法,很容易可以`5`的索引号,当old变换成了new = [4, 5, 6, 7, 0, 1, 2]以后,同样可以使用二分查找法,因为old和new中的元素有明确的对应关系 + +先假设old = [0, 1, 2, 4, 5, 6, 7],利用二分查找法,很容易可以`5`的索引号,当 old 变换成了 new = [4, 5, 6, 7, 0, 1, 2]以后,同样可以使用二分查找法,因为 old 和 new 中的元素有明确的对应关系 old[i] == new[j],只要i和j满足关系式 + ```go j=i+4 if j > len(old) { j -= len(old) } ``` -其中,4 = old中的最大值在new中的索引号 + 1 -所以,如果我们手中只有new,我们可以假装自己还是在对old使用二分查找法,当需要获取old[i]的值进行比较判断的时候,使用new[j]的值替代即可。 +其中,4 = old 中的最大值在new中的索引号 + 1 +所以,如果我们手中只有new,我们可以假装自己还是在对old使用二分查找法,当需要获取old[i]的值进行比较判断的时候,使用new[j]的值替代即可。 ## 总结 + 本题是二分查找法的升级版 \ No newline at end of file diff --git a/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array.go b/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array.go index f48d88de4..1685cb071 100755 --- a/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array.go +++ b/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array.go @@ -1,41 +1,38 @@ -package Problem0033 +package problem0033 func search(nums []int, target int) int { - var index, indexOfMax int - length := len(nums) + rotated := indexOfMin(nums) /* 数组旋转了的距离 */ + size := len(nums) + left, right := 0, size-1 - if length == 0 { - return -1 - } - - // 获取最大值的索引号,以便进行索引号变换 - for indexOfMax+1 < length && nums[indexOfMax] < nums[indexOfMax+1] { - indexOfMax++ - } - - low, high, median := 0, length-1, 0 - for low <= high { - median = (low + high) / 2 - - // 变换索引号 - index = median + indexOfMax + 1 - if index >= length { - index -= length - } - // 假设nums是由升序切片old转换来的 - // 那么,old[median] == nums[index] - - // 传统二分查找法的比较判断 - // 原先需要old[median]的地方,使用nums[index]即可 + for left <= right { + mid := (left + right) / 2 + /* nums 是 rotated,所以需要使用 rotatedMid 来获取 mid 的值 */ + rotatedMid := (rotated + mid) % size switch { - case nums[index] > target: - high = median - 1 - case nums[index] < target: - low = median + 1 + case nums[rotatedMid] < target: + left = mid + 1 + case target < nums[rotatedMid]: + right = mid - 1 default: - return index + return rotatedMid } } return -1 } + +/* nums 是被旋转了的递增数组 */ +func indexOfMin(nums []int) int { + size := len(nums) + left, right := 0, size-1 + for left < right { + mid := (left + right) / 2 + if nums[right] < nums[mid] { + left = mid + 1 + } else { + right = mid + } + } + return left +} diff --git a/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array_test.go b/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array_test.go index d49d58978..0e52f729a 100755 --- a/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array_test.go +++ b/Algorithms/0033.search-in-rotated-sorted-array/search-in-rotated-sorted-array_test.go @@ -1,4 +1,4 @@ -package Problem0033 +package problem0033 import ( "fmt" @@ -31,15 +31,30 @@ func Test_Problem0033(t *testing.T) { qs := []question{ question{ - para{[]int{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2}, 5}, + para{[]int{2}, 2}, + ans{0}, + }, + + question{ + para{[]int{8, 9, 2, 3, 4}, 9}, ans{1}, }, + question{ + para{[]int{4, 5, 6, 7, 0, 1, 2}, 0}, + ans{4}, + }, + question{ para{[]int{6, 7, 0, 1, 2, 3, 4, 5}, 1}, ans{3}, }, + question{ + para{[]int{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2}, 5}, + ans{1}, + }, + question{ para{[]int{1, 3}, 0}, ans{-1}, @@ -55,11 +70,6 @@ func Test_Problem0033(t *testing.T) { ans{-1}, }, - question{ - para{[]int{2}, 2}, - ans{0}, - }, - // 如需多个测试,可以复制上方元素。 } @@ -70,3 +80,27 @@ func Test_Problem0033(t *testing.T) { ast.Equal(a.one, search(p.one, p.two), "输入:%v", p) } } + +func Test_indexOfMin_evenLength(t *testing.T) { + ast := assert.New(t) + array := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9} + numsSize := 10 + for i := 0; i < 10; i++ { + nums := array[i : i+numsSize] + indexOfZeroInNums := 9 - i + actual := indexOfMin(nums) + ast.Equal(indexOfZeroInNums, actual) + } +} + +func Test_indexOfMin_oddLength(t *testing.T) { + ast := assert.New(t) + array := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9} + numsSize := 9 + for i := 1; i < 10; i++ { + nums := array[i : i+numsSize] + indexOfZeroInNums := 9 - i + actual := indexOfMin(nums) + ast.Equal(indexOfZeroInNums, actual) + } +} diff --git a/Algorithms/0034.search-for-a-range/search-for-a-range.go b/Algorithms/0034.search-for-a-range/search-for-a-range.go index 0ee23bebc..7563da2c6 100755 --- a/Algorithms/0034.search-for-a-range/search-for-a-range.go +++ b/Algorithms/0034.search-for-a-range/search-for-a-range.go @@ -1,4 +1,4 @@ -package Problem0034 +package problem0034 func searchRange(nums []int, target int) []int { // 查看target是否存在与nums中 diff --git a/Algorithms/0034.search-for-a-range/search-for-a-range_test.go b/Algorithms/0034.search-for-a-range/search-for-a-range_test.go index e94c58d03..17b9c56d4 100755 --- a/Algorithms/0034.search-for-a-range/search-for-a-range_test.go +++ b/Algorithms/0034.search-for-a-range/search-for-a-range_test.go @@ -1,4 +1,4 @@ -package Problem0034 +package problem0034 import ( "fmt" diff --git a/Algorithms/0035.search-insert-position/search-insert-position.go b/Algorithms/0035.search-insert-position/search-insert-position.go index 84e1a0a5a..f2cf9946e 100755 --- a/Algorithms/0035.search-insert-position/search-insert-position.go +++ b/Algorithms/0035.search-insert-position/search-insert-position.go @@ -1,4 +1,4 @@ -package Problem0035 +package problem0035 func searchInsert(nums []int, target int) int { // 没有把i放入for语句中 diff --git a/Algorithms/0035.search-insert-position/search-insert-position_test.go b/Algorithms/0035.search-insert-position/search-insert-position_test.go index 9e3556231..0379765ad 100755 --- a/Algorithms/0035.search-insert-position/search-insert-position_test.go +++ b/Algorithms/0035.search-insert-position/search-insert-position_test.go @@ -1,4 +1,4 @@ -package Problem0035 +package problem0035 import ( "fmt" diff --git a/Algorithms/0036.valid-sudoku/valid-sudoku.go b/Algorithms/0036.valid-sudoku/valid-sudoku.go index 93f71aef8..00fae7bee 100755 --- a/Algorithms/0036.valid-sudoku/valid-sudoku.go +++ b/Algorithms/0036.valid-sudoku/valid-sudoku.go @@ -1,4 +1,4 @@ -package Problem0036 +package problem0036 import "fmt" diff --git a/Algorithms/0036.valid-sudoku/valid-sudoku_test.go b/Algorithms/0036.valid-sudoku/valid-sudoku_test.go index f42548367..b18c4fd36 100755 --- a/Algorithms/0036.valid-sudoku/valid-sudoku_test.go +++ b/Algorithms/0036.valid-sudoku/valid-sudoku_test.go @@ -1,4 +1,4 @@ -package Problem0036 +package problem0036 import ( "fmt" diff --git a/Algorithms/0037.sudoku-solver/sudoku-solver.go b/Algorithms/0037.sudoku-solver/sudoku-solver.go index bf0230c06..2668c721c 100755 --- a/Algorithms/0037.sudoku-solver/sudoku-solver.go +++ b/Algorithms/0037.sudoku-solver/sudoku-solver.go @@ -1,72 +1,45 @@ -package Problem0037 +package problem0037 func solveSudoku(board [][]byte) { - if !fill(board, '1', 0) { - panic("此题无解") - } + solve(board, 0) } -func fill(board [][]byte, n byte, block int) bool { - if block == 9 { - // 所有的block都已经填满,成功找到了解 +/* k 是把 board 转换成一维数组后,元素的索引值 */ +func solve(board [][]byte, k int) bool { + if k == 81 { return true } - if n == '9'+1 { - // block 已经被填满了,去填写 block+1 - return fill(board, '1', block+1) + r, c := k/9, k%9 + if board[r][c] != '.' { + return solve(board, k+1) } - // print(board, n, block) - - rowBegin := (block / 3) * 3 - colBegin := (block % 3) * 3 + /* bi, bj 是 rc 所在块的左上角元素的索引值 */ + bi, bj := r/3*3, c/3*3 - for r := rowBegin; r < rowBegin+3; r++ { - for c := colBegin; c < colBegin+3; c++ { - if board[r][c] == n { - // block 中已经有 n 了,无需填写 - // 去填写 n+1 - return fill(board, n+1, block) - } - } - } - - // 检查 (r,c) 能否存放 n - // 使用匿名函数,避免传递参数 - isAvaliable := func(r, c int) bool { - // 当前位置上的字符需为 '.' - if board[r][c] != '.' { - return false - } - - // (r,c) 所在的行和列不能有 n - // 在这里就可以体现,挨个往block中填写的优势了。 - for i := 0; i < 9; i++ { - if board[r][i] == n || board[i][c] == n { + // 按照数独的规则,检查 b 能否放在 board[r][c] + isValid := func(b byte) bool { + for n := 0; n < 9; n++ { + if board[r][n] == b || + board[n][c] == b || + board[bi+n/3][bj+n%3] == b { return false } } - return true } - for r := rowBegin; r < rowBegin+3; r++ { - for c := colBegin; c < colBegin+3; c++ { - if isAvaliable(r, c) { - board[r][c] = n - if fill(board, n+1, block) { - return true - } - - // 把 (r,c) 还原,以便以后把 n 移入下一个可行的位置 - board[r][c] = '.' - - // print(board, n, block) + for b := byte('1'); b <= '9'; b++ { + if isValid(b) { + board[r][c] = b + if solve(board, k+1) { + return true } } } - // n 在此 block 中无处可放。 - // 返回 false ,让 n-1 调整位置。 + + board[r][c] = '.' + return false } diff --git a/Algorithms/0037.sudoku-solver/sudoku-solver_test.go b/Algorithms/0037.sudoku-solver/sudoku-solver_test.go index 6fa3051ed..395ba43de 100755 --- a/Algorithms/0037.sudoku-solver/sudoku-solver_test.go +++ b/Algorithms/0037.sudoku-solver/sudoku-solver_test.go @@ -1,4 +1,4 @@ -package Problem0037 +package problem0037 import ( "fmt" @@ -64,53 +64,3 @@ func Test_Problem0036(t *testing.T) { ast.Equal(a.one, p.one, "输入:%v", p) } } -func Test_Panic(t *testing.T) { - ast := assert.New(t) - - qs := []question{ - - question{ - para{[][]byte{ - []byte("..9748..."), - []byte("7....8..."), - []byte(".2.1.9..."), - []byte("..7...24."), - []byte(".64.1.59."), - []byte(".98...3.."), - []byte("...8.3.2."), - []byte("........6"), - []byte("...2759.."), - }}, - ans{[][]byte{ - []byte("519748632"), - []byte("783652419"), - []byte("426139875"), - []byte("357986241"), - []byte("264317598"), - []byte("198524367"), - []byte("975863124"), - []byte("832491756"), - []byte("641275983"), - }}, - }, - - // 如需多个测试,可以复制上方元素。 - } - - for _, q := range qs { - p := q.para - fmt.Printf("~~%v~~\n", p) - ast.Panics(func() { solveSudoku(p.one) }, "输入:%v", p) - } -} - -func print(board [][]byte, b byte, block int) { - fmt.Printf("\n====fill %d in block %d ====", b-'0', block) - - for i := range board { - if i%3 == 0 { - fmt.Println() - } - fmt.Println(string(board[i][0:3]), " ", string(board[i][3:6]), " ", string(board[i][6:])) - } -} diff --git a/Algorithms/0038.count-and-say/count-and-say.go b/Algorithms/0038.count-and-say/count-and-say.go index 51d521551..325d1484d 100755 --- a/Algorithms/0038.count-and-say/count-and-say.go +++ b/Algorithms/0038.count-and-say/count-and-say.go @@ -1,4 +1,4 @@ -package Problem0038 +package problem0038 func countAndSay(n int) string { buf := []byte{'1'} diff --git a/Algorithms/0038.count-and-say/count-and-say_test.go b/Algorithms/0038.count-and-say/count-and-say_test.go index 4f122482c..8abf91db7 100755 --- a/Algorithms/0038.count-and-say/count-and-say_test.go +++ b/Algorithms/0038.count-and-say/count-and-say_test.go @@ -1,4 +1,4 @@ -package Problem0038 +package problem0038 import ( "fmt" diff --git a/Algorithms/0039.combination-sum/combination-sum.go b/Algorithms/0039.combination-sum/combination-sum.go index d4acc4aa3..03ab92001 100755 --- a/Algorithms/0039.combination-sum/combination-sum.go +++ b/Algorithms/0039.combination-sum/combination-sum.go @@ -1,4 +1,4 @@ -package Problem0039 +package problem0039 import ( "sort" diff --git a/Algorithms/0039.combination-sum/combination-sum_test.go b/Algorithms/0039.combination-sum/combination-sum_test.go index afc3a8e2f..82a923bc9 100755 --- a/Algorithms/0039.combination-sum/combination-sum_test.go +++ b/Algorithms/0039.combination-sum/combination-sum_test.go @@ -1,4 +1,4 @@ -package Problem0039 +package problem0039 import ( "fmt" diff --git a/Algorithms/0040.combination-sum-ii/combination-sum-ii.go b/Algorithms/0040.combination-sum-ii/combination-sum-ii.go index 6476d886e..a49c93cf9 100755 --- a/Algorithms/0040.combination-sum-ii/combination-sum-ii.go +++ b/Algorithms/0040.combination-sum-ii/combination-sum-ii.go @@ -1,4 +1,4 @@ -package Problem0040 +package problem0040 import "sort" diff --git a/Algorithms/0040.combination-sum-ii/combination-sum-ii_test.go b/Algorithms/0040.combination-sum-ii/combination-sum-ii_test.go index 39dbcb503..98362bdd2 100755 --- a/Algorithms/0040.combination-sum-ii/combination-sum-ii_test.go +++ b/Algorithms/0040.combination-sum-ii/combination-sum-ii_test.go @@ -1,4 +1,4 @@ -package Problem0040 +package problem0040 import ( "fmt" diff --git a/Algorithms/0041.first-missing-positive/first-missing-positive.go b/Algorithms/0041.first-missing-positive/first-missing-positive.go index bcd828197..f61d10840 100755 --- a/Algorithms/0041.first-missing-positive/first-missing-positive.go +++ b/Algorithms/0041.first-missing-positive/first-missing-positive.go @@ -1,4 +1,4 @@ -package Problem0041 +package problem0041 func firstMissingPositive(nums []int) int { // 整理 nums ,让 nums[k] == k+1,只要 k+1 存在于 nums 中 diff --git a/Algorithms/0041.first-missing-positive/first-missing-positive_test.go b/Algorithms/0041.first-missing-positive/first-missing-positive_test.go index 6be9c30b0..067160387 100755 --- a/Algorithms/0041.first-missing-positive/first-missing-positive_test.go +++ b/Algorithms/0041.first-missing-positive/first-missing-positive_test.go @@ -1,4 +1,4 @@ -package Problem0041 +package problem0041 import ( "fmt" diff --git a/Algorithms/0042.trapping-rain-water/trapping-rain-water.go b/Algorithms/0042.trapping-rain-water/trapping-rain-water.go index f9c0757ad..b7122de9a 100755 --- a/Algorithms/0042.trapping-rain-water/trapping-rain-water.go +++ b/Algorithms/0042.trapping-rain-water/trapping-rain-water.go @@ -1,4 +1,4 @@ -package Problem0042 +package problem0042 func bigger(a int, b int) int { if a > b { diff --git a/Algorithms/0042.trapping-rain-water/trapping-rain-water_test.go b/Algorithms/0042.trapping-rain-water/trapping-rain-water_test.go index cf8a351d0..47eec31a3 100755 --- a/Algorithms/0042.trapping-rain-water/trapping-rain-water_test.go +++ b/Algorithms/0042.trapping-rain-water/trapping-rain-water_test.go @@ -1,4 +1,4 @@ -package Problem0042 +package problem0042 import ( "fmt" diff --git a/Algorithms/0043.multiply-strings/multiply-strings.go b/Algorithms/0043.multiply-strings/multiply-strings.go index 1e83cf938..47ddd2a3e 100755 --- a/Algorithms/0043.multiply-strings/multiply-strings.go +++ b/Algorithms/0043.multiply-strings/multiply-strings.go @@ -1,4 +1,4 @@ -package Problem0043 +package problem0043 func multiply(num1 string, num2 string) string { if num1 == "0" || num2 == "0" { @@ -33,7 +33,7 @@ func multiply(num1 string, num2 string) string { // 转换结果 // temp 选用为[]int,而不是[]byte,是因为 - // golang中,byte的基础结构是uint8,最大值为255。 + // Go中,byte的基础结构是uint8,最大值为255。 // 不考虑进位的话,temp会溢出 res := make([]byte, len(temp)) for i := 0; i < len(temp); i++ { diff --git a/Algorithms/0043.multiply-strings/multiply-strings_test.go b/Algorithms/0043.multiply-strings/multiply-strings_test.go index ff26d4dbc..d53c3e61d 100755 --- a/Algorithms/0043.multiply-strings/multiply-strings_test.go +++ b/Algorithms/0043.multiply-strings/multiply-strings_test.go @@ -1,4 +1,4 @@ -package Problem0043 +package problem0043 import ( "fmt" diff --git a/Algorithms/0044.wildcard-matching/README.md b/Algorithms/0044.wildcard-matching/README.md index d5ca77bec..c82115d38 100755 --- a/Algorithms/0044.wildcard-matching/README.md +++ b/Algorithms/0044.wildcard-matching/README.md @@ -1,27 +1,74 @@ # [44. Wildcard Matching](https://leetcode.com/problems/wildcard-matching/) ## 题目 -Implement wildcard pattern matching with support for '?' and '*'. +Given an input string (`s`) and a pattern (`p`), implement wildcard pattern matching with support for `'?'` and `'*'`. + +```text '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). +``` The matching should cover the entire input string (not partial). -The function prototype should be: -bool isMatch(const char *s, const char *p) +Note: + +- `s` could be empty and contains only lowercase letters `a-z`. +- `p` could be empty and contains only lowercase letters `a-z`, and characters like `?` or `*`. + +Example 1: + +```text +Input: +s = "aa" +p = "a" +Output: false +Explanation: "a" does not match the entire string "aa". +``` + +Example 2: + +```text +Input: +s = "aa" +p = "*" +Output: true +Explanation:`'*' matches any sequence. +``` + +Example 3: -Some examples: -isMatch("aa","a") → false -isMatch("aa","aa") → true -isMatch("aaa","aa") → false -isMatch("aa", "*") → true -isMatch("aa", "a*") → true -isMatch("ab", "?*") → true -isMatch("aab", "c*a*b") → false +```text +Input: +s = "cb" +p = "?a" +Output: false +Explanation:`'?' matches 'c', but the second letter is 'a', which does not match 'b'. +``` + +Example 4: + +```text +Input: +s = "adceb" +p = "*a*b" +Output: true +Explanation:`The first '*' matches the empty sequence, while the second '*' matches the substring "dce". +``` + +Example 5: + +```text +Input: +s = "acdcb" +p = "a*c?b" +Output: false +``` ## 解题思路 + 注意审题: + 1. '?' 可以匹配任意一个字符,但是不能匹配空字符"" 1. '*' 可以任意多个字符,包括"" diff --git a/Algorithms/0044.wildcard-matching/wildcard-matching.go b/Algorithms/0044.wildcard-matching/wildcard-matching.go index cfd3af396..3c300bf9a 100755 --- a/Algorithms/0044.wildcard-matching/wildcard-matching.go +++ b/Algorithms/0044.wildcard-matching/wildcard-matching.go @@ -1,17 +1,16 @@ -package Problem0044 +package problem0044 func isMatch(s string, p string) bool { - ls, lp := len(s), len(p) + sSize, pSize := len(s), len(p) - dp := [][]bool{} - for i := 0; i < ls+1; i++ { - rt := make([]bool, lp+1) - dp = append(dp, rt) + dp := make([][]bool, sSize+1) + for i := range dp { + dp[i] = make([]bool, pSize+1) } // dp[i][j] == true 意味着,s[:i+1] 可以和 p[:j+1] 匹配 dp[0][0] = true - for j := 1; j <= lp; j++ { + for j := 1; j <= pSize; j++ { if p[j-1] == '*' { // 当 p[j-1] == '*' 时 // 只要前面的匹配,dp[0][j] 就匹配 @@ -20,12 +19,13 @@ func isMatch(s string, p string) bool { } } - for i := 1; i <= ls; i++ { - for j := 1; j <= lp; j++ { + for i := 1; i <= sSize; i++ { + for j := 1; j <= pSize; j++ { if p[j-1] != '*' { // 当 p[j-1] != '*' 时 // 单个字符要匹配,并且之前的字符串也要匹配。 - dp[i][j] = (p[j-1] == s[i-1] || p[j-1] == '?') && dp[i-1][j-1] + dp[i][j] = dp[i-1][j-1] && + (p[j-1] == s[i-1] || p[j-1] == '?') } else { // 当 p[j-1] == '*' 时 // 要么,dp[i-1][j] == true,意味着, @@ -39,5 +39,6 @@ func isMatch(s string, p string) bool { } } } - return dp[ls][lp] + + return dp[sSize][pSize] } diff --git a/Algorithms/0044.wildcard-matching/wildcard-matching_test.go b/Algorithms/0044.wildcard-matching/wildcard-matching_test.go index d718c3493..24a6fc4a1 100755 --- a/Algorithms/0044.wildcard-matching/wildcard-matching_test.go +++ b/Algorithms/0044.wildcard-matching/wildcard-matching_test.go @@ -1,4 +1,4 @@ -package Problem0044 +package problem0044 import ( "fmt" @@ -7,113 +7,59 @@ import ( "github.com/stretchr/testify/assert" ) -type question struct { - para - ans +// tcs is testcase slice +var tcs = []struct { + s string + p string + ans bool +}{ + + { + "aa", + "a", + false, + }, + + { + "aa", + "*", + true, + }, + + { + "cb", + "?a", + false, + }, + + { + "adceb", + "*a*b", + true, + }, + + { + "acdcb", + "a*c?b", + false, + }, + + // 可以有多个 testcase } -// para 是参数 -type para struct { - s string - p string -} - -// ans 是答案 -type ans struct { - one bool -} - -func Test_Problem0044(t *testing.T) { +func Test_isMatch(t *testing.T) { ast := assert.New(t) - qs := []question{ - - question{ - para{ - "aa", - "a", - }, - ans{ - false, - }, - }, - - question{ - para{ - "aa", - "aa", - }, - ans{ - true, - }, - }, - - question{ - para{ - "aaa", - "aa", - }, - ans{ - false, - }, - }, - - question{ - para{ - "aa", - "*", - }, - ans{ - true, - }, - }, - - question{ - para{ - "aa", - "a*", - }, - ans{ - true, - }, - }, - - question{ - para{ - "ab", - "?*", - }, - ans{ - true, - }, - }, - - question{ - para{ - "aab", - "c*a*b", - }, - ans{ - false, - }, - }, - - question{ - para{ - "ab", - "*", - }, - ans{ - true, - }, - }, - // 如需多个测试,可以复制上方元素。 + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isMatch(tc.s, tc.p), "输入:%v", tc) } +} - for _, q := range qs { - a, p := q.ans, q.para - fmt.Printf("~~%v~~\n", p) - - ast.Equal(a.one, isMatch(p.s, p.p), "输入:%v", p) +func Benchmark_isMatch(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isMatch(tc.s, tc.p) + } } } diff --git a/Algorithms/0045.jump-game-ii/jump-game-ii.go b/Algorithms/0045.jump-game-ii/jump-game-ii.go index 875404d01..c49da6c3e 100755 --- a/Algorithms/0045.jump-game-ii/jump-game-ii.go +++ b/Algorithms/0045.jump-game-ii/jump-game-ii.go @@ -1,4 +1,4 @@ -package Problem0045 +package problem0045 func jump(nums []int) int { i, count, end := 0, 0, len(nums)-1 diff --git a/Algorithms/0045.jump-game-ii/jump-game-ii_test.go b/Algorithms/0045.jump-game-ii/jump-game-ii_test.go index 880ce6e58..8d5c14937 100755 --- a/Algorithms/0045.jump-game-ii/jump-game-ii_test.go +++ b/Algorithms/0045.jump-game-ii/jump-game-ii_test.go @@ -1,4 +1,4 @@ -package Problem0045 +package problem0045 import ( "fmt" diff --git a/Algorithms/0046.permutations/permutations.go b/Algorithms/0046.permutations/permutations.go index 2fb9127d9..c4277bf73 100755 --- a/Algorithms/0046.permutations/permutations.go +++ b/Algorithms/0046.permutations/permutations.go @@ -1,4 +1,4 @@ -package Problem0046 +package problem0046 func permute(nums []int) [][]int { n := len(nums) diff --git a/Algorithms/0046.permutations/permutations_test.go b/Algorithms/0046.permutations/permutations_test.go index 547ea6b30..3e2afda8c 100755 --- a/Algorithms/0046.permutations/permutations_test.go +++ b/Algorithms/0046.permutations/permutations_test.go @@ -1,4 +1,4 @@ -package Problem0046 +package problem0046 import ( "fmt" diff --git a/Algorithms/0047.permutations-ii/permutations-ii.go b/Algorithms/0047.permutations-ii/permutations-ii.go index efccb5128..2d4987b0c 100755 --- a/Algorithms/0047.permutations-ii/permutations-ii.go +++ b/Algorithms/0047.permutations-ii/permutations-ii.go @@ -1,4 +1,4 @@ -package Problem0047 +package problem0047 import "sort" diff --git a/Algorithms/0047.permutations-ii/permutations-ii_test.go b/Algorithms/0047.permutations-ii/permutations-ii_test.go index 23585f7b7..d19ca6c5e 100755 --- a/Algorithms/0047.permutations-ii/permutations-ii_test.go +++ b/Algorithms/0047.permutations-ii/permutations-ii_test.go @@ -1,4 +1,4 @@ -package Problem0047 +package problem0047 import ( "fmt" diff --git a/Algorithms/0048.rotate-image/rotate-image.go b/Algorithms/0048.rotate-image/rotate-image.go index 9d39cde6e..d3bf37fc2 100755 --- a/Algorithms/0048.rotate-image/rotate-image.go +++ b/Algorithms/0048.rotate-image/rotate-image.go @@ -1,4 +1,4 @@ -package Problem0048 +package problem0048 func rotate(m [][]int) { n := len(m) diff --git a/Algorithms/0048.rotate-image/rotate-image_test.go b/Algorithms/0048.rotate-image/rotate-image_test.go index fcc334592..aadb0cca2 100755 --- a/Algorithms/0048.rotate-image/rotate-image_test.go +++ b/Algorithms/0048.rotate-image/rotate-image_test.go @@ -1,4 +1,4 @@ -package Problem0048 +package problem0048 import ( "fmt" diff --git a/Algorithms/0049.group-anagrams/group-anagrams.go b/Algorithms/0049.group-anagrams/group-anagrams.go index cda36824c..56144651f 100755 --- a/Algorithms/0049.group-anagrams/group-anagrams.go +++ b/Algorithms/0049.group-anagrams/group-anagrams.go @@ -1,38 +1,27 @@ -package Problem0049 +package problem0049 -import ( - "sort" -) - -func groupAnagrams(strs []string) [][]string { - res := [][]string{} - record := make(map[string][]string) - - for _, str := range strs { - temp := sortString(str) - record[temp] = append(record[temp], str) +func groupAnagrams(ss []string) [][]string { + tmp := make(map[int][]string, len(ss)/2) + for _, s := range ss { + c := encode(s) + tmp[c] = append(tmp[c], s) } - for _, v := range record { - sort.Strings(v) + + res := make([][]string, 0, len(tmp)) + for _, v := range tmp { res = append(res, v) } return res } -func sortString(s string) string { - bytes := []byte(s) - - temp := make([]int, len(bytes)) - for i, b := range bytes { - temp[i] = int(b) - } - - sort.Ints(temp) +// prime 与 A~Z 对应,英文中出现概率越大的字母,选用的质数越小 +var prime = []int{5, 71, 37, 29, 2, 53, 59, 19, 11, 83, 79, 31, 43, 13, 7, 67, 97, 23, 17, 3, 41, 73, 47, 89, 61, 101} - for i, v := range temp { - bytes[i] = byte(v) +func encode(s string) int { + res := 1 + for i := range s { + res *= prime[s[i]-'a'] } - - return string(bytes) + return res } diff --git a/Algorithms/0049.group-anagrams/group-anagrams_test.go b/Algorithms/0049.group-anagrams/group-anagrams_test.go index 354bdc3e2..143eeff4b 100755 --- a/Algorithms/0049.group-anagrams/group-anagrams_test.go +++ b/Algorithms/0049.group-anagrams/group-anagrams_test.go @@ -1,7 +1,8 @@ -package Problem0049 +package problem0049 import ( "fmt" + "sort" "testing" "github.com/stretchr/testify/assert" @@ -46,8 +47,8 @@ func Test_Problem0049(t *testing.T) { fmt.Printf("~~%v~~\n", p) res := groupAnagrams(p.one) for _, v := range res { + sort.Strings(v) ast.Equal(a.one[len(v)-1], v, "输入:%v", p) - } } } diff --git a/Algorithms/0050.powx-n/README.md b/Algorithms/0050.powx-n/README.md index d2d3747e8..57545777d 100755 --- a/Algorithms/0050.powx-n/README.md +++ b/Algorithms/0050.powx-n/README.md @@ -1,9 +1,12 @@ # [50. Pow(x, n)](https://leetcode.com/problems/powx-n/) ## 题目 + Implement pow(x, n). ## 解题思路 + 注意到指数是整数,所以,可以利用乘法计算幂 ## 总结 + o(N)的算法会浪费很多时间,o(lgN)的算法要快的多。 diff --git a/Algorithms/0050.powx-n/powx-n.go b/Algorithms/0050.powx-n/powx-n.go index 553c2cc58..4a16590f2 100755 --- a/Algorithms/0050.powx-n/powx-n.go +++ b/Algorithms/0050.powx-n/powx-n.go @@ -1,4 +1,4 @@ -package Problem0050 +package problem0050 func myPow(x float64, n int) float64 { if n < 0 { diff --git a/Algorithms/0050.powx-n/powx-n_test.go b/Algorithms/0050.powx-n/powx-n_test.go index 07a9811c9..d6690f3cd 100755 --- a/Algorithms/0050.powx-n/powx-n_test.go +++ b/Algorithms/0050.powx-n/powx-n_test.go @@ -1,4 +1,4 @@ -package Problem0050 +package problem0050 import ( "fmt" diff --git a/Algorithms/0051.n-queens/n-queens.go b/Algorithms/0051.n-queens/n-queens.go index 22b11405e..bf680427d 100755 --- a/Algorithms/0051.n-queens/n-queens.go +++ b/Algorithms/0051.n-queens/n-queens.go @@ -1,4 +1,4 @@ -package Problem0051 +package problem0051 func solveNQueens(n int) [][]string { if n == 0 { diff --git a/Algorithms/0051.n-queens/n-queens_test.go b/Algorithms/0051.n-queens/n-queens_test.go index 986f53897..a10771334 100755 --- a/Algorithms/0051.n-queens/n-queens_test.go +++ b/Algorithms/0051.n-queens/n-queens_test.go @@ -1,4 +1,4 @@ -package Problem0051 +package problem0051 import ( "fmt" diff --git a/Algorithms/0052.n-queens-ii/n-queens-ii.go b/Algorithms/0052.n-queens-ii/n-queens-ii.go index 031182e74..353a2c101 100755 --- a/Algorithms/0052.n-queens-ii/n-queens-ii.go +++ b/Algorithms/0052.n-queens-ii/n-queens-ii.go @@ -1,4 +1,4 @@ -package Problem0052 +package problem0052 func totalNQueens(n int) int { if n == 0 { diff --git a/Algorithms/0052.n-queens-ii/n-queens-ii_test.go b/Algorithms/0052.n-queens-ii/n-queens-ii_test.go index 718f24c38..7e9340086 100755 --- a/Algorithms/0052.n-queens-ii/n-queens-ii_test.go +++ b/Algorithms/0052.n-queens-ii/n-queens-ii_test.go @@ -1,4 +1,4 @@ -package Problem0052 +package problem0052 import ( "fmt" diff --git a/Algorithms/0053.maximum-subarray/README.md b/Algorithms/0053.maximum-subarray/README.md index ce7069912..714c1e33d 100755 --- a/Algorithms/0053.maximum-subarray/README.md +++ b/Algorithms/0053.maximum-subarray/README.md @@ -1,6 +1,7 @@ # [53. Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) ## 题目 + Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array `[-2,1,-3,4,-1,2,1,-5,4]`, @@ -10,11 +11,7 @@ the contiguous subarray `[4,-1,2,1]` has the largest sum = `6`. More practice: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle. -## 解题思路 -利用好`连续`这个约束 - -详见注释 - -## 总结 +## 解题思路 +利用好`连续`这个约束 \ No newline at end of file diff --git a/Algorithms/0053.maximum-subarray/maximum-subarray.go b/Algorithms/0053.maximum-subarray/maximum-subarray.go index cdf9b49a8..26a4be4d8 100755 --- a/Algorithms/0053.maximum-subarray/maximum-subarray.go +++ b/Algorithms/0053.maximum-subarray/maximum-subarray.go @@ -1,37 +1,18 @@ -package Problem0053 +package problem0053 func maxSubArray(nums []int) int { - l := len(nums) - - if l == 0 { - return 0 - } - - if l == 1 { - return nums[0] + sum, maxSum := -1<<31, -1<<31 + for _, n := range nums { + // sum+n < n,那就还不如直接从 n 开始统计。 + sum = max(sum+n, n) + maxSum = max(maxSum, sum) } + return maxSum +} - temp := nums[0] - max := temp - i := 1 - // 可以把 for 循环的过程,nums[:1] 每次增加一个,直到变成 nums 的过程。 - // temp 就是这个过程中,每个 nums[:i] 中的 max(nums[x:i]) (x=0,1,...,i-1) - // 整个 nums 中连续子序列的最大值,就在 temp 的所有取值中 - for i < l { - if temp < 0 { - // 因为 连续性 的要求,而此时 temp < 0 - // temp 从 i 处重新开始 - temp = nums[i] - } else { - temp += nums[i] - } - - if max < temp { - max = temp - } - - i++ +func max(a, b int) int { + if a > b { + return a } - - return max + return b } diff --git a/Algorithms/0053.maximum-subarray/maximum-subarray_test.go b/Algorithms/0053.maximum-subarray/maximum-subarray_test.go index b2f84ddfb..8e6891b9b 100755 --- a/Algorithms/0053.maximum-subarray/maximum-subarray_test.go +++ b/Algorithms/0053.maximum-subarray/maximum-subarray_test.go @@ -1,4 +1,4 @@ -package Problem0053 +package problem0053 import ( "fmt" @@ -29,19 +29,14 @@ func Test_Problem0053(t *testing.T) { qs := []question{ - question{ - para{[]int{-2, 1, -3, 4, -1, 2, 1, -5, 4}}, - ans{6}, - }, - question{ para{[]int{-2}}, ans{-2}, }, question{ - para{[]int{}}, - ans{0}, + para{[]int{-2, 1, -3, 4, -1, 2, 1, -5, 4}}, + ans{6}, }, // 如需多个测试,可以复制上方元素。 diff --git a/Algorithms/0054.spiral-matrix/README.md b/Algorithms/0054.spiral-matrix/README.md index 7ce795596..7fd91546e 100755 --- a/Algorithms/0054.spiral-matrix/README.md +++ b/Algorithms/0054.spiral-matrix/README.md @@ -1,9 +1,10 @@ # [54. Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) ## 题目 + Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. -``` +```text For example, Given the following matrix: @@ -15,6 +16,7 @@ Given the following matrix: You should return [1,2,3,6,9,8,7,4,5]. ``` + ## 解题思路 见程序注释 diff --git a/Algorithms/0054.spiral-matrix/spiral-matrix.go b/Algorithms/0054.spiral-matrix/spiral-matrix.go index c35bae0a6..8a13f3517 100755 --- a/Algorithms/0054.spiral-matrix/spiral-matrix.go +++ b/Algorithms/0054.spiral-matrix/spiral-matrix.go @@ -1,45 +1,45 @@ -package Problem0054 +package problem0054 func spiralOrder(matrix [][]int) []int { - r := len(matrix) - - if r == 0 { - return []int{} - } - - c := len(matrix[0]) - if c == 0 { - return []int{} + if len(matrix) == 0 || len(matrix[0]) == 0 { + return nil } - - if len(matrix) == 1 { - return matrix[0] - } - - res := make([]int, 0, r*c) - res = append(res, matrix[0]...) + m, n := len(matrix), len(matrix[0]) - for i := 1; i < r-1; i++ { - res = append(res, matrix[i][c-1]) - } + next := nextFunc(m, n) - for j := c - 1; j >= 0; j-- { - res = append(res, matrix[r-1][j]) + res := make([]int, m*n) + for i := range res { + x, y := next() + res[i] = matrix[x][y] } - for i := r - 2; i > 0 && c > 1; i-- { - res = append(res, matrix[i][0]) - } - - if r == 2 || c <= 2 { - return res - } + return res +} - nextMatrix := make([][]int, 0, r-2) - for i := 1; i < r-1; i++ { - nextMatrix = append(nextMatrix, matrix[i][1:c-1]) +func nextFunc(m, n int) func() (int, int) { + top, down := 0, m-1 + left, right := 0, n-1 + x, y := 0, -1 + dx, dy := 0, 1 + return func() (int, int) { + x += dx + y += dy + switch { // 如果撞墙了,需要修改 dx, dy 和相应的边界值 + case y+dy > right: + top++ + dx, dy = 1, 0 + case x+dx > down: + right-- + dx, dy = 0, -1 + case y+dy < left: + down-- + dx, dy = -1, 0 + case x+dx < top: + left++ + dx, dy = 0, 1 + } + return x, y } - - return append(res, spiralOrder(nextMatrix)...) } diff --git a/Algorithms/0054.spiral-matrix/spiral-matrix_test.go b/Algorithms/0054.spiral-matrix/spiral-matrix_test.go index 499e2c613..59f7c4e45 100755 --- a/Algorithms/0054.spiral-matrix/spiral-matrix_test.go +++ b/Algorithms/0054.spiral-matrix/spiral-matrix_test.go @@ -1,4 +1,4 @@ -package Problem0054 +package problem0054 import ( "fmt" @@ -31,12 +31,19 @@ func Test_Problem0054(t *testing.T) { para{ [][]int{ []int{}, - []int{}, - []int{}, }, }, ans{ - []int{}, + nil, + }, + }, + + question{ + para{ + [][]int{}, + }, + ans{ + nil, }, }, @@ -89,15 +96,6 @@ func Test_Problem0054(t *testing.T) { }, }, - question{ - para{ - [][]int{}, - }, - ans{ - []int{}, - }, - }, - // 如需多个测试,可以复制上方元素。 } diff --git a/Algorithms/0055.jump-game/jump-game.go b/Algorithms/0055.jump-game/jump-game.go index c7434d420..9b6986a5a 100755 --- a/Algorithms/0055.jump-game/jump-game.go +++ b/Algorithms/0055.jump-game/jump-game.go @@ -1,4 +1,4 @@ -package Problem0055 +package problem0055 func canJump(nums []int) bool { diff --git a/Algorithms/0055.jump-game/jump-game_test.go b/Algorithms/0055.jump-game/jump-game_test.go index 1ece8ea8a..623aace79 100755 --- a/Algorithms/0055.jump-game/jump-game_test.go +++ b/Algorithms/0055.jump-game/jump-game_test.go @@ -1,4 +1,4 @@ -package Problem0055 +package problem0055 import ( "fmt" diff --git a/Algorithms/0056.merge-intervals/README.md b/Algorithms/0056.merge-intervals/README.md index 70b9e5dcf..c1af9b73a 100755 --- a/Algorithms/0056.merge-intervals/README.md +++ b/Algorithms/0056.merge-intervals/README.md @@ -1,16 +1,16 @@ # [56. Merge Intervals](https://leetcode.com/problems/merge-intervals/) ## 题目 + Given a collection of intervals, merge all overlapping intervals. -``` +```text For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. ``` + ## 解题思路 -1. 先对 intervals 进行排序,按照 Start 递增 -1. 依次处理重叠的情况。 -## 附注 -最快的答案和我的思路一样,只是使用的是 merge sort ,自我感觉我的答案更清晰,就没有改成他的。 \ No newline at end of file +1. 先对 intervals 进行排序,按照 Start 递增 +1. 依次处理重叠的情况。 \ No newline at end of file diff --git a/Algorithms/0056.merge-intervals/merge-intervals.go b/Algorithms/0056.merge-intervals/merge-intervals.go index ad90893a5..e1acc6650 100755 --- a/Algorithms/0056.merge-intervals/merge-intervals.go +++ b/Algorithms/0056.merge-intervals/merge-intervals.go @@ -1,6 +1,8 @@ -package Problem0056 +package problem0056 -import "math/rand" +import ( + "sort" +) // Interval Definition for an interval. type Interval struct { @@ -13,20 +15,21 @@ func merge(its []Interval) []Interval { return its } - quickSort(its) + sort.Slice(its, func(i int, j int) bool { + return its[i].Start < its[j].Start + }) res := make([]Interval, 0, len(its)) - temp := its[0] + temp := its[0] for i := 1; i < len(its); i++ { if its[i].Start <= temp.End { temp.End = max(temp.End, its[i].End) - continue + } else { + res = append(res, temp) + temp = its[i] } - res = append(res, temp) - temp = its[i] } - res = append(res, temp) return res @@ -38,33 +41,3 @@ func max(a, b int) int { } return b } - -func quickSort(is []Interval) { - if len(is) <= 1 { - return - } - - j := rand.Intn(len(is)) - is[0], is[j] = is[j], is[0] - j = partition(is) - quickSort(is[0:j]) - quickSort(is[j+1:]) -} - -func partition(is []Interval) int { - i, j := 1, len(is)-1 - for { - for is[i].Start <= is[0].Start && i < len(is)-1 { - i++ - } - for is[0].Start <= is[j].Start && j > 0 { - j-- - } - if i >= j { - break - } - is[i], is[j] = is[j], is[i] - } - is[0], is[j] = is[j], is[0] - return j -} diff --git a/Algorithms/0056.merge-intervals/merge-intervals_test.go b/Algorithms/0056.merge-intervals/merge-intervals_test.go index b3f826d3d..d006b3383 100755 --- a/Algorithms/0056.merge-intervals/merge-intervals_test.go +++ b/Algorithms/0056.merge-intervals/merge-intervals_test.go @@ -1,4 +1,4 @@ -package Problem0056 +package problem0056 import ( "fmt" diff --git a/Algorithms/0057.insert-interval/insert-interval.go b/Algorithms/0057.insert-interval/insert-interval.go index e264ddc8e..a5bcc93f6 100755 --- a/Algorithms/0057.insert-interval/insert-interval.go +++ b/Algorithms/0057.insert-interval/insert-interval.go @@ -1,4 +1,4 @@ -package Problem0057 +package problem0057 // Interval is a couple of int type Interval struct { diff --git a/Algorithms/0057.insert-interval/insert-interval_test.go b/Algorithms/0057.insert-interval/insert-interval_test.go index 98477b9fa..29b46c67b 100755 --- a/Algorithms/0057.insert-interval/insert-interval_test.go +++ b/Algorithms/0057.insert-interval/insert-interval_test.go @@ -1,4 +1,4 @@ -package Problem0057 +package problem0057 import ( "fmt" diff --git a/Algorithms/0058.length-of-last-word/length-of-last-word.go b/Algorithms/0058.length-of-last-word/length-of-last-word.go index 58597a492..1606ed64d 100755 --- a/Algorithms/0058.length-of-last-word/length-of-last-word.go +++ b/Algorithms/0058.length-of-last-word/length-of-last-word.go @@ -1,4 +1,4 @@ -package Problem0058 +package problem0058 func lengthOfLastWord(s string) int { size := len(s) diff --git a/Algorithms/0058.length-of-last-word/length-of-last-word_test.go b/Algorithms/0058.length-of-last-word/length-of-last-word_test.go index 4c2590086..5cc2c8f3e 100755 --- a/Algorithms/0058.length-of-last-word/length-of-last-word_test.go +++ b/Algorithms/0058.length-of-last-word/length-of-last-word_test.go @@ -1,4 +1,4 @@ -package Problem0058 +package problem0058 import ( "fmt" diff --git a/Algorithms/0059.spiral-matrix-ii/README.md b/Algorithms/0059.spiral-matrix-ii/README.md index 7cab5d39d..9209d5c41 100755 --- a/Algorithms/0059.spiral-matrix-ii/README.md +++ b/Algorithms/0059.spiral-matrix-ii/README.md @@ -1,9 +1,10 @@ # [59. Spiral Matrix II](https://leetcode.com/problems/spiral-matrix-ii/) ## 题目 -Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. -``` +Given an integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order. + +```text For example, Given n = 3, You should return the following matrix: [ [ 1, 2, 3 ], @@ -11,7 +12,9 @@ For example, Given n = 3, You should return the following matrix: [ 7, 6, 5 ] ] ``` + ## 解题思路 + 依照题意,设置填充边界,沿着边界填写。 见程序注释 diff --git a/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii.go b/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii.go index 63096a68c..dc36f2308 100755 --- a/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii.go +++ b/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii.go @@ -1,8 +1,8 @@ -package Problem0059 +package problem0059 func generateMatrix(n int) [][]int { if n == 0 { - return [][]int{} + return nil } res := make([][]int, n) @@ -10,35 +10,39 @@ func generateMatrix(n int) [][]int { res[i] = make([]int, n) } - // 4 条边界,依照题意,沿着边界填写 - top, bottom, left, right := 0, n-1, 0, n-1 - num := 1 - for top <= bottom && left <= right { - // → - for j := left; j <= right; j++ { - res[top][j] = num - num++ - } - top++ - // ↓ - for j := top; j <= bottom; j++ { - res[j][right] = num - num++ - } - right-- - // ← - for j := right; j >= left; j-- { - res[bottom][j] = num - num++ - } - bottom-- - // ↑ - for j := bottom; j >= top; j-- { - res[j][left] = num - num++ - } - left++ + max := n * n + next := nextFunc(n) + + for i := 1; i <= max; i++ { + x, y := next() + res[x][y] = i } return res } + +func nextFunc(n int) func() (int, int) { + top, down := 0, n-1 + left, right := 0, n-1 + x, y := 0, -1 + dx, dy := 0, 1 + return func() (int, int) { + x += dx + y += dy + switch { + case y+dy > right: + top++ + dx, dy = 1, 0 + case x+dx > down: + right-- + dx, dy = 0, -1 + case y+dy < left: + down-- + dx, dy = -1, 0 + case x+dx < top: + left++ + dx, dy = 0, 1 + } + return x, y + } +} diff --git a/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii_test.go b/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii_test.go index f6d106545..c60557a6f 100755 --- a/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii_test.go +++ b/Algorithms/0059.spiral-matrix-ii/spiral-matrix-ii_test.go @@ -1,4 +1,4 @@ -package Problem0059 +package problem0059 import ( "fmt" @@ -30,7 +30,7 @@ func Test_Problem0059(t *testing.T) { question{ para{0}, ans{ - [][]int{}, + nil, }, }, diff --git a/Algorithms/0060.permutation-sequence/permutation-sequence.go b/Algorithms/0060.permutation-sequence/permutation-sequence.go index a8e7766a9..b8a1590f3 100755 --- a/Algorithms/0060.permutation-sequence/permutation-sequence.go +++ b/Algorithms/0060.permutation-sequence/permutation-sequence.go @@ -1,4 +1,4 @@ -package Problem0060 +package problem0060 func getPermutation(n int, k int) string { if n == 0 { diff --git a/Algorithms/0060.permutation-sequence/permutation-sequence_test.go b/Algorithms/0060.permutation-sequence/permutation-sequence_test.go index d9b7fca78..f7542e882 100755 --- a/Algorithms/0060.permutation-sequence/permutation-sequence_test.go +++ b/Algorithms/0060.permutation-sequence/permutation-sequence_test.go @@ -1,4 +1,4 @@ -package Problem0060 +package problem0060 import ( "fmt" diff --git a/Algorithms/0061.rotate-list/README.md b/Algorithms/0061.rotate-list/README.md index 2fcff2ab6..53b999863 100755 --- a/Algorithms/0061.rotate-list/README.md +++ b/Algorithms/0061.rotate-list/README.md @@ -1,12 +1,27 @@ # [61. Rotate List](https://leetcode.com/problems/rotate-list/) ## 题目 -Given a list, rotate the list to the right by k places, where k is non-negative. -For example: -``` -Given 1->2->3->4->5->NULL and k = 2, -return 4->5->1->2->3->NULL. + +Given a linked list, rotate the list to the right by k places, where k is non-negative. + +Example 1: + +```text +Input: 1->2->3->4->5->NULL, k = 2 +Output: 4->5->1->2->3->NULL +Explanation: +rotate 1 steps to the right: 5->1->2->3->4->NULL +rotate 2 steps to the right: 4->5->1->2->3->NULL ``` -## 解题思路 -见程序注释 +Example 2: + +```text +Input: 0->1->2->NULL, k = 4 +Output: 2->0->1->NULL +Explanation: +rotate 1 steps to the right: 2->0->1->NULL +rotate 2 steps to the right: 1->2->0->NULL +rotate 3 steps to the right: 0->1->2->NULL +rotate 4 steps to the right: 2->0->1->NULL +``` \ No newline at end of file diff --git a/Algorithms/0061.rotate-list/rotate-list.go b/Algorithms/0061.rotate-list/rotate-list.go index 09fcf8efc..805173f95 100755 --- a/Algorithms/0061.rotate-list/rotate-list.go +++ b/Algorithms/0061.rotate-list/rotate-list.go @@ -1,4 +1,4 @@ -package Problem0061 +package problem0061 // ListNode 是题目预定义的节点 type ListNode struct { @@ -11,24 +11,23 @@ func rotateRight(head *ListNode, k int) *ListNode { return head } - fast := head + tail := head for i := 0; i < k; i++ { - if fast.Next == nil { + if tail.Next == nil { // 处理 k 大于 list 的长度的情况 // i+1 就是 list 的长度 - // 这一步很巧妙 return rotateRight(head, k%(i+1)) } - fast = fast.Next + tail = tail.Next } - slow := head - for fast.Next != nil { - slow, fast = slow.Next, fast.Next + newTail := head + for tail.Next != nil { + newTail, tail = newTail.Next, tail.Next } - newHead := slow.Next - slow.Next, fast.Next = nil, head + newHead := newTail.Next + newTail.Next, tail.Next = nil, head return newHead } diff --git a/Algorithms/0061.rotate-list/rotate-list_test.go b/Algorithms/0061.rotate-list/rotate-list_test.go index aaf523c70..1f48ad51e 100755 --- a/Algorithms/0061.rotate-list/rotate-list_test.go +++ b/Algorithms/0061.rotate-list/rotate-list_test.go @@ -1,4 +1,4 @@ -package Problem0061 +package problem0061 import ( "fmt" diff --git a/Algorithms/0062.unique-paths/README.md b/Algorithms/0062.unique-paths/README.md index 80ebeae01..eca348fb7 100755 --- a/Algorithms/0062.unique-paths/README.md +++ b/Algorithms/0062.unique-paths/README.md @@ -1,6 +1,7 @@ # [62. Unique Paths](https://leetcode.com/problems/unique-paths/) ## 题目 + A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). @@ -9,10 +10,25 @@ How many possible unique paths are there? ![robotMaze](robot_maze.png) -Above is a 3 x 7 grid. How many possible unique paths are there? +Above is a 7 x 3 grid. How many possible unique paths are there? Note: m and n will be at most 100. -## 解题思路 +Example 1: + +```text +Input: m = 3, n = 2 +Output: 3 +Explanation: +From the top-left corner, there are a total of 3 ways to reach the bottom-right corner: +1. Right -> Right -> Down +2. Right -> Down -> Right +3. Down -> Right -> Right +``` + +Example 2: -见程序注释 +```text +Input: m = 7, n = 3 +Output: 28 +``` \ No newline at end of file diff --git a/Algorithms/0062.unique-paths/unique-paths.go b/Algorithms/0062.unique-paths/unique-paths.go index 310bb327c..6f1b54892 100755 --- a/Algorithms/0062.unique-paths/unique-paths.go +++ b/Algorithms/0062.unique-paths/unique-paths.go @@ -1,32 +1,26 @@ -package Problem0062 +package problem0062 func uniquePaths(m int, n int) int { - // dp[i][j] 代表了,到达 (i,j) 格子的不同路径数目 - dp := [][]int{} - - // 创建棋盘 - for i := 0; i < m; i++ { - tmp := make([]int, n) - dp = append(dp, tmp) - } + // path[i][j] 代表了,到达 (i,j) 格子的不同路径数目 + path := [100][100]int{} for i := 0; i < m; i++ { // 到达第 0 列的格子,只有一条路径 - dp[i][0] = 1 + path[i][0] = 1 } for j := 0; j < n; j++ { // 到达第 0 行的格子,只有一条路径 - dp[0][j] = 1 + path[0][j] = 1 } for i := 1; i < m; i++ { for j := 1; j < n; j++ { // 到达 (i,j) 格子的路径数目,等于 // 到达 上方格子 和 左边格子 路径数之和 - dp[i][j] = dp[i-1][j] + dp[i][j-1] + path[i][j] = path[i-1][j] + path[i][j-1] } } - return dp[m-1][n-1] + return path[m-1][n-1] } diff --git a/Algorithms/0062.unique-paths/unique-paths_test.go b/Algorithms/0062.unique-paths/unique-paths_test.go index bcd6d2b4d..f4ab89387 100755 --- a/Algorithms/0062.unique-paths/unique-paths_test.go +++ b/Algorithms/0062.unique-paths/unique-paths_test.go @@ -1,4 +1,4 @@ -package Problem0062 +package problem0062 import ( "fmt" @@ -68,3 +68,9 @@ func Test_Problem0062(t *testing.T) { ast.Equal(a.one, uniquePaths(p.m, p.n), "输入:%v", p) } } + +func Benchmark_uniquePaths(b *testing.B) { + for i := 1; i < b.N; i++ { + uniquePaths(100, 100) + } +} diff --git a/Algorithms/0063.unique-paths-ii/unique-paths-ii.go b/Algorithms/0063.unique-paths-ii/unique-paths-ii.go index d472c5530..66189dc9d 100755 --- a/Algorithms/0063.unique-paths-ii/unique-paths-ii.go +++ b/Algorithms/0063.unique-paths-ii/unique-paths-ii.go @@ -1,4 +1,4 @@ -package Problem0063 +package problem0063 func uniquePathsWithObstacles(obstacleGrid [][]int) int { m := len(obstacleGrid) diff --git a/Algorithms/0063.unique-paths-ii/unique-paths-ii_test.go b/Algorithms/0063.unique-paths-ii/unique-paths-ii_test.go index 8851fd44f..82e10d367 100755 --- a/Algorithms/0063.unique-paths-ii/unique-paths-ii_test.go +++ b/Algorithms/0063.unique-paths-ii/unique-paths-ii_test.go @@ -1,4 +1,4 @@ -package Problem0063 +package problem0063 import ( "fmt" diff --git a/Algorithms/0064.minimum-path-sum/minimum-path-sum.go b/Algorithms/0064.minimum-path-sum/minimum-path-sum.go index 2ccde3d02..1c8347efa 100755 --- a/Algorithms/0064.minimum-path-sum/minimum-path-sum.go +++ b/Algorithms/0064.minimum-path-sum/minimum-path-sum.go @@ -1,4 +1,4 @@ -package Problem0064 +package problem0064 func minPathSum(grid [][]int) int { // 已经默认 m 和 n 大于 0 了 diff --git a/Algorithms/0064.minimum-path-sum/minimum-path-sum_test.go b/Algorithms/0064.minimum-path-sum/minimum-path-sum_test.go index 56949ff86..aa2cd0805 100755 --- a/Algorithms/0064.minimum-path-sum/minimum-path-sum_test.go +++ b/Algorithms/0064.minimum-path-sum/minimum-path-sum_test.go @@ -1,4 +1,4 @@ -package Problem0064 +package problem0064 import ( "fmt" diff --git a/Algorithms/0065.valid-number/valid-number.go b/Algorithms/0065.valid-number/valid-number.go index 682d48454..c4f77cc30 100755 --- a/Algorithms/0065.valid-number/valid-number.go +++ b/Algorithms/0065.valid-number/valid-number.go @@ -1,4 +1,4 @@ -package Problem0065 +package problem0065 func isNumber(s string) bool { // 去掉首位的空格 diff --git a/Algorithms/0065.valid-number/valid-number_test.go b/Algorithms/0065.valid-number/valid-number_test.go index 07d4b0603..e0da51122 100755 --- a/Algorithms/0065.valid-number/valid-number_test.go +++ b/Algorithms/0065.valid-number/valid-number_test.go @@ -1,4 +1,4 @@ -package Problem0065 +package problem0065 import ( "fmt" diff --git a/Algorithms/0066.plus-one/plus-one.go b/Algorithms/0066.plus-one/plus-one.go index 7db130d32..2035ce4eb 100755 --- a/Algorithms/0066.plus-one/plus-one.go +++ b/Algorithms/0066.plus-one/plus-one.go @@ -1,4 +1,4 @@ -package Problem0066 +package problem0066 func plusOne(digits []int) []int { length := len(digits) diff --git a/Algorithms/0066.plus-one/plus-one_test.go b/Algorithms/0066.plus-one/plus-one_test.go index 20be42c03..a40a92e04 100755 --- a/Algorithms/0066.plus-one/plus-one_test.go +++ b/Algorithms/0066.plus-one/plus-one_test.go @@ -1,4 +1,4 @@ -package Problem0066 +package problem0066 import ( "fmt" diff --git a/Algorithms/0067.add-binary/add-binary.go b/Algorithms/0067.add-binary/add-binary.go index 5e19d2023..33ab1def5 100755 --- a/Algorithms/0067.add-binary/add-binary.go +++ b/Algorithms/0067.add-binary/add-binary.go @@ -1,4 +1,4 @@ -package Problem0067 +package problem0067 func addBinary(a string, b string) string { if len(a) < len(b) { diff --git a/Algorithms/0067.add-binary/add-binary_test.go b/Algorithms/0067.add-binary/add-binary_test.go index 2dc4d29bd..3b334f6f9 100755 --- a/Algorithms/0067.add-binary/add-binary_test.go +++ b/Algorithms/0067.add-binary/add-binary_test.go @@ -1,4 +1,4 @@ -package Problem0067 +package problem0067 import ( "fmt" diff --git a/Algorithms/0068.text-justification/text-justification.go b/Algorithms/0068.text-justification/text-justification.go index 2ebf986cb..ac1caa994 100755 --- a/Algorithms/0068.text-justification/text-justification.go +++ b/Algorithms/0068.text-justification/text-justification.go @@ -1,4 +1,4 @@ -package Problem0068 +package problem0068 import "strings" diff --git a/Algorithms/0068.text-justification/text-justification_test.go b/Algorithms/0068.text-justification/text-justification_test.go index f55859713..024294f0c 100755 --- a/Algorithms/0068.text-justification/text-justification_test.go +++ b/Algorithms/0068.text-justification/text-justification_test.go @@ -1,4 +1,4 @@ -package Problem0068 +package problem0068 import ( "fmt" diff --git a/Algorithms/0069.sqrtx/sqrtx.go b/Algorithms/0069.sqrtx/sqrtx.go index 848262ac9..02ce03593 100755 --- a/Algorithms/0069.sqrtx/sqrtx.go +++ b/Algorithms/0069.sqrtx/sqrtx.go @@ -1,12 +1,10 @@ -package Problem0069 +package problem0069 func mySqrt(x int) int { res := x - // 牛顿法求平方根 for res*res > x { res = (res + x/res) / 2 } - return res } diff --git a/Algorithms/0069.sqrtx/sqrtx_test.go b/Algorithms/0069.sqrtx/sqrtx_test.go index 27f2cab99..ff57c0b68 100755 --- a/Algorithms/0069.sqrtx/sqrtx_test.go +++ b/Algorithms/0069.sqrtx/sqrtx_test.go @@ -1,7 +1,8 @@ -package Problem0069 +package problem0069 import ( "fmt" + "math" "testing" "github.com/stretchr/testify/assert" @@ -64,3 +65,17 @@ func Test_Problem0069(t *testing.T) { ast.Equal(a.one, mySqrt(p.x), "输入:%v", p) } } + +func Benchmark_mySqrt(b *testing.B) { + n := 10000 + for i := 1; i < b.N; i++ { + _ = mySqrt(n) + } +} + +func Benchmark_math_sqrt(b *testing.B) { + n := 10000 + for i := 1; i < b.N; i++ { + _ = int(math.Sqrt(float64(n))) + } +} diff --git a/Algorithms/0070.climbing-stairs/climbing-stairs.go b/Algorithms/0070.climbing-stairs/climbing-stairs.go index f2ef10bf8..cd3ac8b87 100755 --- a/Algorithms/0070.climbing-stairs/climbing-stairs.go +++ b/Algorithms/0070.climbing-stairs/climbing-stairs.go @@ -1,4 +1,4 @@ -package Problem0070 +package problem0070 func climbStairs(n int) int { if n < 2 { diff --git a/Algorithms/0070.climbing-stairs/climbing-stairs_test.go b/Algorithms/0070.climbing-stairs/climbing-stairs_test.go index 7704cace0..ac48b2baa 100755 --- a/Algorithms/0070.climbing-stairs/climbing-stairs_test.go +++ b/Algorithms/0070.climbing-stairs/climbing-stairs_test.go @@ -1,4 +1,4 @@ -package Problem0070 +package problem0070 import ( "fmt" diff --git a/Algorithms/0071.simplify-path/simplify-path.go b/Algorithms/0071.simplify-path/simplify-path.go index 5c8830b45..80938c2ca 100755 --- a/Algorithms/0071.simplify-path/simplify-path.go +++ b/Algorithms/0071.simplify-path/simplify-path.go @@ -1,4 +1,4 @@ -package Problem0071 +package problem0071 import "strings" diff --git a/Algorithms/0071.simplify-path/simplify-path_test.go b/Algorithms/0071.simplify-path/simplify-path_test.go index c2eab2992..b68a0ca4b 100755 --- a/Algorithms/0071.simplify-path/simplify-path_test.go +++ b/Algorithms/0071.simplify-path/simplify-path_test.go @@ -1,4 +1,4 @@ -package Problem0071 +package problem0071 import ( "fmt" diff --git a/Algorithms/0072.edit-distance/README.md b/Algorithms/0072.edit-distance/README.md index 70d132cf8..d9c7a2447 100755 --- a/Algorithms/0072.edit-distance/README.md +++ b/Algorithms/0072.edit-distance/README.md @@ -1,53 +1,37 @@ # [72. Edit Distance](https://leetcode.com/problems/edit-distance/) ## 题目 + Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a word: -``` + +```text a) Insert a character b) Delete a character c) Replace a character ``` -## 动态规划思想:[参考源](http://www.cnblogs.com/AndyJee/p/4602817.html) - -假设dp[i][j]表示以S[i]结尾的字符串和以T[j]结尾的字符串转换所需的最小操作数,考虑三种操作,然后取三者最小值: - -1、替换: - -假设S[i-1],T[j-1]已对齐,即dp[i-1][j-1]已知,则当S[i]==T[j]时,dp[i][j]=dp[i-1][j-1],否则,dp[i][j]=dp[i-1][j-1]+1. - -2、删除 - -假设S[i-1],T[j]已对齐,即dp[i-1][j]已知,多出来的S[i]需删除,操作数+1,则dp[i][j]=dp[i-1][j]+1. - -3、插入 - -假设S[i],T[j-1]已对齐,即dp[i][j-1]已知,需在S中插入S[i+1]=T[j]来匹配,操作数+1,则dp[i][j]=dp[i][j-1]+1. - -状态转移方程: +Example 1: -dp[i][j]=min(dp[i-1][j-1]+(S[i]==T[j]?0,1),dp[i-1][j]+1,dp[i][j-1]+1) - -初始值: - -dp[i][0]=i - -dp[0][j]=j - -复杂度: - -时间复杂度:O(m*n) - -空间复杂度:O(m*n) - -空间优化: - -由状态转移方程可知,dp[i][j]与dp[i-1][j-1],dp[i-1][j],dp[i][j-1]有关,可以去掉一维,只留下dp[j]。 - -等式右边的dp[i-1][j]和dp[i][j-1]都可以直接改成dp[j](旧的值)和dp[j-1](已更新),只有dp[i-1][j-1]没有记录下来,通过某个变量保存起来之后就可以。 - -因此空间复杂度:O(n) +```text +Input: word1 = "horse", word2 = "ros" +Output: 3 +Explanation: +horse -> rorse (replace 'h' with 'r') +rorse -> rose (remove 'r') +rose -> ros (remove 'e') +``` -见程序注释 +Example 2: + +```text +Input: word1 = "intention", word2 = "execution" +Output: 5 +Explanation: +intention -> inention (remove 't') +inention -> enention (replace 'i' with 'e') +enention -> exention (replace 'n' with 'x') +exention -> exection (replace 'n' with 'c') +exection -> execution (insert 'u') +``` \ No newline at end of file diff --git a/Algorithms/0072.edit-distance/edit-distance.go b/Algorithms/0072.edit-distance/edit-distance.go index 4da581d0c..018bce864 100755 --- a/Algorithms/0072.edit-distance/edit-distance.go +++ b/Algorithms/0072.edit-distance/edit-distance.go @@ -1,33 +1,47 @@ -package Problem0072 +package problem0072 -func minDistance(word1 string, word2 string) int { - m := len(word1) - n := len(word2) - cost := 0 +func minDistance(from, to string) int { + m := len(from) + n := len(to) dp := make([][]int, m+1) for i := range dp { dp[i] = make([]int, n+1) } - for i := 0; i <= m; i++ { + for i := 1; i <= m; i++ { dp[i][0] = i } - for j := 0; j <= n; j++ { + + for j := 1; j <= n; j++ { dp[0][j] = j } for i := 1; i <= m; i++ { for j := 1; j <= n; j++ { - dp[i][j] = min(dp[i-1][j]+1, dp[i][j-1]+1) - - if word1[i-1] == word2[j-1] { - cost = 0 - } else { - cost = 1 + // dp[i][j] 代表了从 from[:i] → to[:j] 所需要的最小步骤 + // 按照题目给出的 3 种操作方法,分别讨论: + // 1. 先 *删除* from[:i] 最后的字母,得到 from[:i-1]。 + // 再 from[:i-1] → to[:j] 此方法所需的步骤是 + // 1 + dp[i-1][j] + // 2. 先 from[:i] → to[:j-1], + // 再 *添加* to[j-1] 到 to 的末尾,此方法所需的步骤是 + // 1 + dp[i][j-1] + // 3. 先 from[i-1] → to[j-1] + // 3.1 如果 from[i-1] = to[i-1] 的话 + // 无需 *替换*, + // 总的步骤是 dp[i-1][j-1] + // 3.2 如果 from[i-1] != to[i-1] 的话 + // 执行 *替换* 操作,把 from[i-1] 替换成 to[j-1] + // 总的步骤是 1 + dp[i-1][j-1] + dp[i][j] = 1 + min(dp[i-1][j], dp[i][j-1]) + + replace := 1 + if from[i-1] == to[j-1] { + replace = 0 } - dp[i][j] = min(dp[i][j], dp[i-1][j-1]+cost) + dp[i][j] = min(dp[i][j], dp[i-1][j-1]+replace) } } diff --git a/Algorithms/0072.edit-distance/edit-distance_test.go b/Algorithms/0072.edit-distance/edit-distance_test.go index 08d141d6b..2020c86a3 100755 --- a/Algorithms/0072.edit-distance/edit-distance_test.go +++ b/Algorithms/0072.edit-distance/edit-distance_test.go @@ -1,4 +1,4 @@ -package Problem0072 +package problem0072 import ( "fmt" @@ -14,8 +14,7 @@ type question struct { // para 是参数 type para struct { - word1 string - word2 string + from, to string } // ans 是答案 @@ -114,6 +113,6 @@ func Test_Problem0072(t *testing.T) { a, p := q.ans, q.para fmt.Printf("~~%v~~\n", p) - ast.Equal(a.one, minDistance(p.word1, p.word2), "输入:%v", p) + ast.Equal(a.one, minDistance(p.from, p.to), "输入:%v", p) } } diff --git a/Algorithms/0073.set-matrix-zeroes/README.md b/Algorithms/0073.set-matrix-zeroes/README.md index f1d09bc25..259efb52f 100755 --- a/Algorithms/0073.set-matrix-zeroes/README.md +++ b/Algorithms/0073.set-matrix-zeroes/README.md @@ -1,16 +1,39 @@ # [73. Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) ## 题目 -Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. -click to show follow up. -``` -Follow up: -Did you use extra space? -A straight forward solution using O(mn) space is probably a bad idea. -A simple improvement uses O(m + n) space, but still not the best solution. -Could you devise a constant space solution? +Given a `m x n` matrix, if an element is 0, set its entire row and column to 0. Do it [in-place](https://en.wikipedia.org/wiki/In-place_algorithm). + +Example 1: + +```text +Input: +[ + [1,1,1], + [1,0,1], + [1,1,1] +] +Output: +[ + [1,0,1], + [0,0,0], + [1,0,1] +] ``` -## 解题思路 -见程序注释 +Example 2: + +```text +Input: +[ + [0,1,2,0], + [3,4,5,2], + [1,3,1,5] +] +Output: +[ + [0,0,0,0], + [0,4,5,0], + [0,3,1,0] +] +``` diff --git a/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes.go b/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes.go index 131f8b3ab..87180c005 100755 --- a/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes.go +++ b/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes.go @@ -1,34 +1,48 @@ -package Problem0073 +package problem0073 -func setZeroes(m [][]int) { - rows := make([]bool, len(m)) // rows[i] == true ,代表 i 行存在 0 元素 - cols := make([]bool, len(m[0])) // cols[j] == true ,代表 j 列存在 0 元素 +func setZeroes(mat [][]int) { + m, n := len(mat), len(mat[0]) + col0 := 1 - // 逐个检查元素 - for i := range m { - for j := range m[i] { - if m[i][j] == 0 { - rows[i] = true - cols[j] = true - } + /** + * 从上往下,从左往右 扫描矩阵 + * 利用 mat[i][0] = 0 表示,第 i 行中含有 0 + * 利用 mat[0][j] = 0 表示,第 j 列中含有 0 + * 特别地, + * mat[0][0] = 0 仅表示,第 0 行中含有 0 + * Col0 = 0 表示,第 0 列中含有 0 + * NOTICE: 循环的顺序很重要 + * 需要保证 mat[i][0] 和 mat[0][j] 被标记后,不再做为别的标记的依据 + * 要不然的话,标记有可能会被污染 + */ + for i := 0; i < m; i++ { + if mat[i][0] == 0 { + col0 = 0 } - } - - // 按行修改 - for i := range rows { - if rows[i] { - for j := range m[i] { - m[i][j] = 0 + for j := 1; j < n; j++ { + if mat[i][j] == 0 { + mat[i][0] = 0 + mat[0][j] = 0 } } } - // 按列修改 - for i := range cols { - if cols[i] { - for j := range m { - m[j][i] = 0 + /** + * 从下往上,从右往左 扫描矩阵 + * 并根据前面的标记修改 mat[i][j] 的值 + * NOTICE: 循环的顺序很重要 + * 需要保证 mat[i][0] 和 mat[0][j] 被修改后,不再做为别的修改的标记 + * 要不然的话,标记有可能会被污染 + */ + for i := m - 1; i >= 0; i-- { + for j := n - 1; j >= 1; j-- { + if mat[i][0] == 0 || mat[0][j] == 0 { + mat[i][j] = 0 } } + if col0 == 0 { + mat[i][0] = 0 + } } + } diff --git a/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes_test.go b/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes_test.go index 1a88d67c1..a6c94b88b 100755 --- a/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes_test.go +++ b/Algorithms/0073.set-matrix-zeroes/set-matrix-zeroes_test.go @@ -1,4 +1,4 @@ -package Problem0073 +package problem0073 import ( "fmt" @@ -27,6 +27,32 @@ func Test_Problem0073(t *testing.T) { qs := []question{ + question{ + para{[][]int{ + []int{1, 0, 3, 4}, + []int{5, 0, 7, 0}, + []int{9, 1, 1, 1}, + }}, + ans{[][]int{ + []int{0, 0, 0, 0}, + []int{0, 0, 0, 0}, + []int{9, 0, 1, 0}, + }}, + }, + + question{ + para{[][]int{ + []int{1, 2, 3, 4}, + []int{0, 2, 3, 4}, + []int{9, 1, 1, 1}, + }}, + ans{[][]int{ + []int{0, 2, 3, 4}, + []int{0, 0, 0, 0}, + []int{0, 1, 1, 1}, + }}, + }, + question{ para{[][]int{ []int{1, 2, 3, 4}, diff --git a/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix.go b/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix.go index ba2d64e82..1de5d7337 100755 --- a/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix.go +++ b/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix.go @@ -1,4 +1,4 @@ -package Problem0074 +package problem0074 func searchMatrix(mat [][]int, target int) bool { m := len(mat) diff --git a/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix_test.go b/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix_test.go index 6beae141c..b6aefbbc2 100755 --- a/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix_test.go +++ b/Algorithms/0074.search-a-2d-matrix/search-a-2d-matrix_test.go @@ -1,4 +1,4 @@ -package Problem0074 +package problem0074 import ( "fmt" diff --git a/Algorithms/0075.sort-colors/README.md b/Algorithms/0075.sort-colors/README.md index 9becdd515..a7064f1af 100755 --- a/Algorithms/0075.sort-colors/README.md +++ b/Algorithms/0075.sort-colors/README.md @@ -1,19 +1,22 @@ # [75. Sort Colors](https://leetcode.com/problems/sort-colors/) ## 题目 -Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. + +Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. -**Note:**You are not suppose to use the library's sort function for this problem. +Note: You are not suppose to use the library's sort function for this problem. + +Example: -click to show follow up. +```text +Input: [2,0,2,1,1,0] +Output: [0,0,1,1,2,2] ``` + Follow up: -A rather straight forward solution is a two-pass algorithm using counting sort. -First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's. -Could you come up with an one-pass algorithm using only constant space? -``` -## 解题思路 -见程序注释 +- A rather straight forward solution is a two-pass algorithm using counting sort. +- First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's. +- Could you come up with a one-pass algorithm using only constant space? diff --git a/Algorithms/0075.sort-colors/sort-colors.go b/Algorithms/0075.sort-colors/sort-colors.go index ef0470072..8e42d098f 100755 --- a/Algorithms/0075.sort-colors/sort-colors.go +++ b/Algorithms/0075.sort-colors/sort-colors.go @@ -1,45 +1,25 @@ -package Problem0075 +package problem0075 -func sortColors(nums []int) { - length := len(nums) - if length == 0 { - return - } - - // 三路快排需要 nums[0] == 1 - temp := nums[0] - nums[0] = 1 +// 借鉴三路快排中的划分思路 +func sortColors(a []int) { + i, j, k := 0, 0, len(a)-1 - // 三路快排 - // 排序完成后, - // i 指向 0 后的 1, - // j 指向 最后一个 1 后面的位置, - // k 指向 2 前面的 1, - // 在整个排序过程中,nums[i:j]中始终都是1 - i, j, k := 0, 1, length-1 + // for 循环中, nums[i:j] 中始终全是 1 + // 循环结束后, + // nums[:i] 中全是 0 + // nums[j:] 中全是 2 for j <= k { - switch { - case nums[j] < 1: - // 比 1 小的,放入队列首部 - nums[i], nums[j] = nums[j], nums[i] + switch a[j] { + case 0: + a[i], a[j] = a[j], a[i] i++ j++ - case 1 < nums[j]: - // 比 1 大的,放入队列尾部 - nums[j], nums[k] = nums[k], nums[j] - k-- - default: + case 1: j++ + case 2: + a[j], a[k] = a[k], a[j] + k-- } } - // 分情况,还原temp - switch temp { - case 0: - nums[i] = temp - case 2: - nums[k] = temp - } - - return } diff --git a/Algorithms/0075.sort-colors/sort-colors_test.go b/Algorithms/0075.sort-colors/sort-colors_test.go index c72e7e6fb..1ad2c0a9b 100755 --- a/Algorithms/0075.sort-colors/sort-colors_test.go +++ b/Algorithms/0075.sort-colors/sort-colors_test.go @@ -1,4 +1,4 @@ -package Problem0075 +package problem0075 import ( "fmt" diff --git a/Algorithms/0076.minimum-window-substring/README.md b/Algorithms/0076.minimum-window-substring/README.md index df209a889..866cbd523 100755 --- a/Algorithms/0076.minimum-window-substring/README.md +++ b/Algorithms/0076.minimum-window-substring/README.md @@ -1,9 +1,10 @@ # [76. Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/) ## 题目 + Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). -``` +```text For example, S = "ADOBECODEBANC" T = "ABC" @@ -12,10 +13,6 @@ Minimum window is "BANC". ``` Note: -1. If there is no such window in S that covers all characters in T, return the empty string "". -1. If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S. -## 解题思路 -双指针的解法 - -见程序注释 +1. If there is no such window in S that covers all characters in T, return the empty string "". +1. If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S. \ No newline at end of file diff --git a/Algorithms/0076.minimum-window-substring/minimum-window-substring.go b/Algorithms/0076.minimum-window-substring/minimum-window-substring.go index 3e3e7fd3b..86aa2668f 100755 --- a/Algorithms/0076.minimum-window-substring/minimum-window-substring.go +++ b/Algorithms/0076.minimum-window-substring/minimum-window-substring.go @@ -1,48 +1,41 @@ -package Problem0076 +package problem0076 func minWindow(s string, t string) string { - sLen, tLen := len(s), len(t) - - need := [256]int{} + have := [128]int{} + need := [128]int{} for i := range t { need[t[i]]++ } - has := [256]int{} + size, total := len(s), len(t) - min := sLen + 1 - begin, end, winBegin, winEnd, count := 0, 0, 0, 0, 0 + min := size + 1 + res := "" - for ; end < sLen; end++ { - if need[s[end]] == 0 { - continue + // s[i:j+1] 就是 window + // count 用于统计已有的 t 中字母的数量。 + // count == total 表示已经收集完需要的全部字母 + for i, j, count := 0, 0, 0; j < size; j++ { + if have[s[j]] < need[s[j]] { + // 出现了 window 中缺失的字母 + count++ } + have[s[j]]++ - if has[s[end]] < need[s[end]] { - count++ + // 保证 window 不丢失所需字母的前提下 + // 让 i 尽可能的大 + for i <= j && have[s[i]] > need[s[i]] { + have[s[i]]-- + i++ } - has[s[end]]++ - - if count == tLen { - for need[s[begin]] == 0 || has[s[begin]] > need[s[begin]] { - if has[s[begin]] > need[s[begin]] { - has[s[begin]]-- - } - begin++ - } - - temp := end - begin + 1 - if min > temp { - min = temp - winBegin = begin - winEnd = end - } + + width := j - i + 1 + if count == total && min > width { + min = width + res = s[i : j+1] } - } - if count < tLen { - return "" } - return s[winBegin : winEnd+1] + return res } diff --git a/Algorithms/0076.minimum-window-substring/minimum-window-substring_test.go b/Algorithms/0076.minimum-window-substring/minimum-window-substring_test.go index c2f589e34..59732cddd 100755 --- a/Algorithms/0076.minimum-window-substring/minimum-window-substring_test.go +++ b/Algorithms/0076.minimum-window-substring/minimum-window-substring_test.go @@ -1,4 +1,4 @@ -package Problem0076 +package problem0076 import ( "fmt" @@ -28,6 +28,16 @@ func Test_Problem0076(t *testing.T) { qs := []question{ + question{ + para{ + "a", + "b", + }, + ans{ + "", + }, + }, + question{ para{ "kgfidhktkjhlkbgjkylgdracfzjduycghkomrbfbkoowqwgaurizliesjnveoxmvjdjaepdqftmvsuyoogobrutahogxnvuxyezevfuaaiyufwjtezuxtpycfgasburzytdvazwakuxpsiiyhewctwgycgsgdkhdfnzfmvhwrellmvjvzfzsdgqgolorxvxciwjxtqvmxhxlcijeqiytqrzfcpyzlvbvrksmcoybxxpbgyfwgepzvrezgcytabptnjgpxgtweiykgfiolxniqthzwfswihpvtxlseepkopwuueiidyquratphnnqxflqcyiiezssoomlsxtyxlsolngtctjzywrbvajbzeuqsiblhwlehfvtubmwuxyvvpwsrhutlojgwktegekpjfidgwzdvxyrpwjgfdzttizquswcwgshockuzlzulznavzgdegwyovqlpmnluhsikeflpghagvcbujeapcyfxosmcizzpthbzompvurbrwenflnwnmdncwbfebevwnzwclnzhgcycglhtbfjnjwrfxwlacixqhvuvivcoxdrfqazrgigrgywdwjgztfrbanwiiayhdrmuunlcxstdsrjoapntugwutuedvemyyzusogumanpueyigpybjeyfasjfpqsqotkgjqaxspnmvnxbfvcobcudxflmvfcjanrjfthaiwofllgqglhkndpmiazgfdrfsjracyanwqsjcbakmjubmmowmpeuuwznfspjsryohtyjuawglsjxezvroallymafhpozgpqpiqzcsxkdptcutxnjzawxmwctltvtiljsbkuthgwwbyswxfgzfewubbpowkigvtywdupmankbndyligkqkiknjzchkmnfflekfvyhlijynjlwrxodgyrrxvzjhoroavahsapdiacwjpucnifviyohtprceksefunzucdfchbnwxplhxgpvxwrmpvqzowgimgdolirslgqkycrvkgshejuuhmvvlcdxkinvqgpdnhnljeiwmadtmzntokqzmtyycltuukahsnuducziedbscqlsbbtpxrobfhxzuximncrjgrrkwvdalqtoumergsulbrmvrwjeydpguiqqdvsrmlfgylzedtrhkfebbohbrwhnhxfmvxdhjlpjwopchgjtnnvodepwdylkxqwsqczznqklezplhafuqcitizslzdvwwupmwqnlhxwlwozdogxekhasisehxbdtvuhrlucurbhppgsdoriyykricxpbyvxupencbqwsreiimclbuvbufudjrslsnkofobhptgkmmuuywizqddllxowpijhytvdkymzsulegfzfcjguojhzhxyyghhgbcllazmuuyzafahjjqgxznzinxgvgnbhrmuuljohjpkqpraahgajvzriyydengofskzgtppefzvwrvxadxjaydjydocqvsxpdyxyondvmyrfvqiaptanwllbaquxirmlqkmgzpbnputmldmcwoqvadwavqxeilraxdiwulmlffxsilvgcnbcsyeoqdsaolcorkmlxyzfdyznkuwmjxqcxusoxmqlxtzofocdmbiqzhflebzpbprajjqivhuvcvlhjnkwquosevfkzfzcwtcietqcamxcikltawrsshkydsiexkgvdidjbuldgkfqvrkxpdpjlakqsuurecmjkstomgrutzlqsxnjacuneedyzzrfbgpoykcmsvglwtdoqqztvugzakazlrhnxwdxifjccsozlrpckpxfldglpgnbauqzstxcaiecaudmotqyknfvsliiuvlurbvjwulwdsadmerazjyjydgrrobnmmjdpeplzcjcujhhpbhqmizlnhcgwftkrcnghctifcmbnvifwsvjcxwpeyycdrmwucedexnlbznquxvtpretoaluajxfajdwnhbugofjpuzmuxflolfenqynzxubjxawgbqmsyvhuwvotaajnfpaxqnwnjzwgzvmdnaxlxeiucwpcyzqfoqcegaspcqybnmgbndomkwgmvyqvxgblzfshimykeynslutaxjmjgvvdtmysubfvjxcrjddobsgombomkdvsatvvfwnzxsvgszzbccrgxzulclzpqvhsqfnvbcwywrfotgsxlldilatnntcfqmxgrkdsozsktzbogtlrerzrtuhiplnfxknqwsikudwncxdiqozxhaoavximjvuihjzdcjpwmmlploxeezbmzrmwrxlauficojhqtxohlzwwpwcuvfgwzuvqrgqmlaozmxshuiohingzjitgobcnwzdpfvdsxrujroqlwhvgubgdlzjzdnozptqwqurqnlzezssvznctokybljdoyrppngmdcdvpqvuppmmqbqlrajsmuvcupskcawhcbdrrangrbuhcnstndobzjgtyydcabkccpvtpjbgmyprljkamaelkkgkkmnknzosojnfupnhncyalkazlemxoshaewkuvymjkzqeqdlfflfsygrjmdidypdcmoyjoktykldapqiwenpcviniovnmkqqygpivbdvloaoftwcxltzhbmrrhedtuuudleamjvaxwqfrohozcpidbzxkfafcwbfjffwocyoaotrccfdeumjxngjthrvfsapyhnojlcmbxddzlidhwnhktqdcjykcazcjoqszveaskfsvnxckkjwgczknzupbvtkjmeihlkzvptqfrurdgnjkouxpqpqmicvugebrqdmgyenpbethrerhaqwrfodoqaiyemqxredpjqhkwctpgmwjcsaiifyyfiwmuojntmdeemqaolpwxnfbffjpmjnssleocncxbhbhttjjeyfdllessqjfzwxtjdilsmivvlcqglzmlepyrwskmbrnzqhivrwnfgiasmsaxrnkxeipaaboduccklmfckuhrcjlqblnuaxrfhihjlwofyqrleynpswiwhvmigbejavojgvsrtgztysefrrulpekwzwghakqaigkocehxnirlbvqspmfgqpdrolzowrqgycuchdzumqhnmyhdmojfeowsaxiypyenbapidoerhletlnyychdgwbayziwoicbjcsthixzplfkwtiwvsbdodfocpksxmvhqnczvaylnexjxgguyhzomecotoiqcdzuqctoesbrwyavgiresquewyvrmdhqhjkzleppwqgupirxtkcncytyxqpjuyadhmeuqulomtidcbbxlfmndfnawcmsdoxkadhtzshmmsrotsnfxzudgifcmtwpjtamzhfybmkneedawqhwrbzyjgawaznjunvtwcsypenvirvhhcdbgezrkbnmadyvsvopyippnckxviedmjgsnfkaizmjckgviwmghdvwhhtdpaicjowxvgzdglokyufgtroawjwesrhirrmbfiacrzfzmujmqpujiilftjlmdswulkxquzslyzkltuzmluxtcjawulkxfguqqrikrcwreiezeelpyjlaulyqziogqizgbhtsmrmqzqreudvsogviuvyveobuyadakwuwngomxfsrkomywhiqejlixnfwpiwzesxrznfwvapfobekkmdpxqzvdettopusjsliftgatwijzmvmaydypcvujopxfksocfxjydmrbuabiwpkwsklwfihtxhahzpleoxftjwvfzynxnzthkhfppnloulyvajbqigktdhyefnbunwdxfiowxzltljonuqgfwqybxzhemkybjdyolnnjmaczjtpfjvmhlllkkuoyhoaqrageptnetsdelumwpyfclsoxpewwsymlasqqofuhzxomucijaqookclzhjxbhjniefaukudkrrwlthxwznklpvnyfkaowpyauyugsxsmrrzmayiblsmdqzdxmfniuoiqoezjdtvukwhmxrnkkcncbtzpyoxvchnrlmarixnuvwhsowfayuccndrmrpjuwwnklnbtmqnhnwcbthbrbfvpkndbemxaikmvzpqlgettcxwvezpfgmwqzzrfnriybutdmkosqjnsglqkkhsqtogvqzadsibudvzphnjxxyrfjhsvokniyvdowfupovlrskizxtwwroecxwzmgmwghbxdgruumfnfpxensdlltpnqloeraayjdxpmojiapwhgvotorhbmypckdjdgjdrpagbosjrhhyndojthsutqlwcrfizqlqhozieruvabwpgmabusynljlncsvbljusztddkxbkyzbhlcifugthsexuxsykdsccnfixcljdkkkvmudjbwstcppbkplnhqsuvctanedxppudjxomvhhywzbgonwydquasoahsfejuangybsvkctjbxppknnpfirxyugszmcwnpcnswifycobbfrltgcaovaopghptjngartunbzofppgvitqpxqftquixbzqmmwmdrituijaxaiujckabbfwrbfqeggqveeaxntsxcuwfcrqgbqiexgybnofuxypdepbrltqpnnurgkyjcioaoobcciybgnflegerzvhokdfqofzsnpsedvgieejmtoxzuervzajldrbtwcmmsgqvcyfiepuzduayyrvztfkxylquneihlyfpykxczrddledlxykrfwofjgcznkgyllnjwkovdrarxfcvepmllatvivuvfcvsoickushylirjntetkqhwsatcvpyctvvheztardaenrncnrwxjfvbhqechegbzdifcegvhiauapwnhukqbiuiyamgethfwrnbvvyedyadozsxvfpxnlhllutrpaxnumorhnyknyqdziavpsucdbqpxjimmhaitqzadxltybwxlzsbrofwqxlnjwcvdcfxsexyektcnpbbqucjkjgahtqqpsntwssoyrocchgrzispewzoghrpajfqbulxmdnmuerylxqmhkenhfcpmvemelehfretwtftxwrlwjxfwdtdivuwsalwlpdsjjlfcqyapsnnbmsxqlcaiyxayiylzbdimoophorygelkqdhirmjzmgcloaynecyqsofbcyzjemtvscfjqokdumqknoarsyjnoroqpqbucwrwbwhtlswhgouvfuoxuykipbagreavatudqbxdvvmekgzpaqowobgfchlvlosnhotxsqcnnptxvtowlduzebgiirfvfzkpofmgxpvlgpibkxzvcuwivcqfvxcbwoqkueqrvmcbdnfnmeioaewxiocdlgehvwurdkkyypcdchqonaeoealmqqqbwwktvemyrxyrocvqlngzokpsmahcszfrvrmsyzsryrkmvfehvkgjwxdixkmsjtjhmvbkwubwnmiitopoaxxwudgunumznxiasjmrfqnscybxmsonqnlmquigowfetpeoasfgiuymsbmhuawmphagbjmsftwbkcpkuusdqrrjudqqdmetvfbzqprvkpwurnenjxsaqkjmnbdtphomorlegecqtammoqazpuzhekuunzpcidpxwcdcjhueigryytxqnzzujtqxufbdkscgxfkgpgkxmdxmwwemxegjzwgudjxncbvzifhxlrwzvtntssfpwnyxlgrosqduryvadcxqvupspdmjxtbvhbssimjacowwntysvvjsraljfxscqvxzxsuhedjirfegyczvakntkycqxxuqsuprmlysqhakofqojrjjbzdozhgxgapbwgskstciafsrkjfvapheqmsptaoccddzkxjeqomttfkfqpcsgjywvqopsctviwuuvfymvkhortvhiycrhapftdwlipgqlcmikkufwdwowtxhrbybcpgvvcidrpvethmdtjlpmhfjadqugqxifffchofafcgylueefpwuybdagvunntvuydxhrehwhpwukazrrvlpyqsflmsaipvguuolyxjhniczkdqcyetyuldiaxiipfojzexacghpqlqboidomwnhispkqzshfiqgnngpwqgmbwnqesgtrtabmrleqdlxldeatmrrcxfgvvycneveaxhoossgxfglimlbydudcajavhcilzpnwwbmrtuoaazjmlmlqhqshzseiwotxdjvckhteeheejprueemlwguvbydzmyxshswscpygyemhwfdajpnhyhczhhytivnpqjjsyjazqmgmsmoddblbipcpxbkhyawqjiiktkjjzrxrflwjmjmwbpnysahqafhjnrvjegsdaswfdsqsedofuefmemegrnrfhnolviovakdgetaiyonuusgyeneyawdjltugdkegwhobcojdezxztgzatgyvcdhpwbxbobhkixlnlxqqypprvotquroyuvpsynumodzzbmmmlecjvtdtiwjeozdiusdvhxhwcgxdvlsgpwqmqvfarrehqjsnevilurjwagcvrwbistviockitprkyjxcghqayzzygdtzzvirqfcfhmpbdgnesmgatydrycqgflheipxzwbggovjtdwxxigydedwefommausilphirpohmxasvypfepiksepzvblvvdfhvnrmehvrgvjbvagbsqmmwdmrezmcfslaheonljergpseqafkstwowiibkwfpoqrxwfnhqryyjsczukjmdfcaqkdchirxakxwpkfhbffkxkltuwfxehxwscybkpymzvkqfpzjuevtqjmkfrilbhhvkfwwwwjxutpzlokfviblrnwyhgkinrfzzbwxzhvtcmvnbhvwpwjilfhsntadmhclkyjkfgdksaxviutxqdgckpuyixbugfiretblzgvthvpppioilwmyliwvhzsoeafktgwumtnvqckinbqyxcwlkugstygaankttinhedfuhrcusstswrdjojbjkjjkyugtcvcgyhdgzfaravlwpohdaimktwwtscmwypdywigvnjppeaotrvyrglbbjzvbchxcwcctkjqashpykdubzssfdvgowbpalnchrhccsvekctkozepazjhegntdridcxilrpovjlzvnufctmttlfcpnqiqjtwnsgajxqegbdbrygvtuopfvrvjjfbsyxhrdkaaahickjtksoemetuakpjwwmqvkyopiqskxamkkhuexyqctkegbpcybsvnsjdcbvnzvbjhjfligekzoqhshlqjenwywbbxwqyurjbcpnlvrxuhqezxprgvefucgxcfnazgkalbpwwivqslwtlmlthrydwhaampcnyopjpfhlpcehqabdmowwhxzdecdsrihrwwambjxrmbaecbhqpfmxcmcioichqjbmgbyjlyczzdfbeoswvgvysziihlszwtocwomjmqkmtrpafjwdqtbksjvcwpdtkrxiglsuceivwyvdjtgbmjohvljrammmgkumvogztpvrpswaodeaosjjdsdfhprnblbzajyvavmpqksenwgcoqntkqytirglehketlbtiplyadepzntpdhkpxkjhbptfzfmsspnbfybfbiwcvqtyxdpwpyeqqzyrgklzbycgxdnankfiayizeyvtybmoakfjwsixrmgqptsffxnfywgcwcxudjjgvqrrjzralxscskhyixfitmkpqjjttubonsiwtbygaqlscuskrysmmedcopxjjbzytjupksxkkifnfxzyxuljyqloflzrmzpfikwveuhremejmfijzvtalgotrqkdpblznhwsdelisrtewdowyjwkpmdjcpmtqzvehrymxjwqaqwytmuuvsgnhlwjakfskayttwfrhejjufipsejpxrcecypeluxvwvqquxhdbqnxxxnpbyfyqjcukszvowsltibpfktjcggzdvrgwwfofjipdjmshefbmisuslfutlvyjmfhkkvstfhxpwrwawzpeslydquxdpvmeatomqgiwqflmyjmwjdadoaieufkldwpfseuimcgejtqhdfdoiftzfbfbjpmmmctginqwpxbysthxymljreiyinzrdmdrqyzampydozejvngtaueraosicrzhfcaxdzzrqyuhzaquoyqoswhtlzbprbyyfywizvbrvwyvyqrmpjajgicrjegaheboexzduauqyvnxngjcqmmwwqpfwvidbjufitkctgusbjrpqatiohekytsuqaatjuytpkvkqsesdvjvwedmmjxmepgupinaenvtxseqkiiogtlexpqlynxdeezvopvteqoejuuvfellxxpwofimvfrzlrvaisvmllswgmtlqfypenmsuugrbyrnropbgkptvipdujonqocudooykurmuibnwqofceyzoqdiztvpiylloblzxdnsnohmewtgcrfqhkaieyzowmbmnplluafhomvsioamiiersfaydboboqnbfbobbtiqgekqsldcthunouorvcsjuinbjbcmvlcdrptlayoviikweyqzdklxsabdbdqyqubhjxvlxjiftvexvuyyejyzlzcncuntprcaoxmniwtbrzynvxnbilaumdjrxykopopfodtwboyvpyikxxlilmcxrnoqlahdrwifbdberbzgahsxhefssjrjygbkiipzgxehdimujldjvxjebowtaneyvgkgqzfxzmgcusydgdpdbyjcohyowcpskzabbfyatecnzcthgimhgvlucllyqasazsdcadctkgjljcurmgaudnqhzbhpdarduxfwakqmqbxbfrurzuncidljhtykvrproxorhgdzhbdouxhusuycxkleflpccgttdjkkppmyqpmnmthgnhintvtygkclrweufqhxftvyiklwfudtdlixjbxpmaafygzfyicebaejmpirllmoyunhylzknbrlissgbxmcxqojhwcsjpjhjwphjotwpkjzfcigbwkynyjuwlpfaanmweviupelbqnguvovrzvgxedwrubuuqiqwdyqufcwxrermtofujotprpintchjkziqaykhcietnxhilpcudvlwntjgysrkrbaralyeteyibhsmwuibsvxhpippaizskalknkqiqqrsyjeugpwakvhbeyqggqyqskcfwtnmlggjqlgyceymzhqfhgmnwmgqykvufljrrpajcghgkhvmqltxrhlqutgsdepjpaairasujbcvjxhzidxckksedazgeopvqrehsybbbgykdimmllovxicaidiprakhrqqjqumsaledtsrgfhdcpfcailpbnbkeudokxcexplaifsqlbunrbstmdipslcwffmscpyzejbppvfcxbpqdhjrmtgeeibknnepecqjosafphhmjyeognfuglznwczlrddwfthvnjadqjrbiwpolwiskjhgngrhjudqqmmdvoinycpgagwldgfnqmtfsmmbjruzdgeawnqurfarlwcodidvuwcplpquimtosxormeldlouzkxnphrmdppsaglwoxpcsptjbzufnkbmvabmhublmsfoyqlooatiportpnacybovesjnmkaycgncwyrmakwsannpdnsdqiyuchipuipyqebpesdheazgpovsbpvtavqcfatzkjxbpaquutdyveelscdtrboryeudenepyesoeikzdpzztgmlkpgbsuvrzrwfgdufhmvnwhocwqdpypaigilzcgsdxqjetflcuiqspgulwxcuoeevmquowouwedcakncevuzkbtxztbwhfacrqyhnoblvgnvrazxxwwjxsgynhuwoxbfnzocqqnnyakrcjpzfniehqfuzbrnyssmthqlzeyxgipjugkbttgblnxloqynkrbgarrzxqyganpuvbwpuesgrrtfiruukvakpslmkmskbjhxlfohjgpczijjaeembexqykdiwxvyjevujjdurtwsdhcdliqnopfnbixyisyrytnheqbxjzpnhtsubkjqbpddzcbjxbavundaegxpgoepizljjvbnmgqljtvguxbqlgqrnpitdnknmvxxqakehcqqvnwpmzfxgxqtmzosoafcvebofosmqkemzcdmbllhiccxdsrtswvodweimwudjaricuudfgnqirpnkigcedshbyrovnreniopejtmpiezztolduqhzkrajkoeyhklrybwjwiaembfhprkljtktmncxdivluievjaehkhlyithymrjvnwqbjtymdvzyeevpgzxrikprdzprqaofyfhhahwffvdlbaaicxbkksbprshktvprcybcixinunyyoagqajckbeztwgdreulgvmldltshisfyunquwteyzgtvowpusabpomsbhmirgqqbdixcbeaaktyarnvlpwbdkvgtkqmqgetmnrooxqrhjrjceepvcqaooghywwqdamrnffecvxlgoukuzzrdsrsgxbgvxyaykrnrytttsebgblccntffmxnlzvhwthwgbmxzhtvaxwiaklcxgietfregonfhxdpyppzziwzhthifukcdsgyazegnslwrpmrgbqflpgskoapkntpfznhauopoblfszwzcoendlipbienvxfdyukaoapccbjuchvhwcubncrqnxfkvknvfawtalyeojbtrwapywqnbjfohlyexozcovyqjyvzhysywsnvpgkqpseydecasefibdzmdumkuelqxanmgyeyskyvodxjherkhqxmmjxgpkxmkkarkercqpzfszqzdhmnajzmuyvjiuytgymrfdvvsxclwsmbcaocjqqfolrzhpsopehwjcsbbwozpbbtbpxnhnuwblvicpwsvdqeiiflhwlwxmradoplbmjezencvlwqroubxbmexxcwjvzpjqamcjrepeikrgaiuwjrzwxxvbvhwuwflwuphltwrdgijiregcxfaveyyafxubehzyzgjueaymlhwelcgjhjgoheombkpgsqgtwqncslodvkhgmqrvzzjgezuhklpebwxxombgapkvztdnjxiiwuqctmkdxbhyzgxntywvngqobvblsmtpgmrbydfwfowgxuwsusniadwbaamtmikuubvufcsmtpuqlqifkxnkcmmcoavakfwgjrbqwtepkyhvrrbboqmqeasscqsnxotgiwwescvcbcyuvbvjrjzwjtoojjbhzwpjtopnqkptopnjqlskutigpyuyhxhjtxuonkbdwtzliowbzrlwktczrwabtjmoigfvsibpbacmqynspaocvqdoodrjndxvmetgnuvqwzcmyrgprurokvdaaujpahnmnguacstyrxmpptfinyxataawwklwtykggfjixegobtgsondblcdfeedaqoxlphrvocelimckhkevxhzilcppisqahplwyftnjxasmeetoiplsqudujtdelflarjywenheozqsdjhoaugqojnaeqepvrpocqmgdukrvcmzovpopvheguglmmcjdsyhimnlgafecrfsmuhbpqhxmpkabnjghjnrybcedjihanaojjsabbyptkpuxabemoxkrcqwlbeoqgeapwasaahtlwpiyspkjmuaqnzcodselwecvhuvhbqszfdzaskjggjxtkbhntoapscmzwjjzzbaheahykqhsbgmmjvbcjcteegfdpocrqdawdhxpzehamvovtqxeusiaaodseijwnjtqsqhrwqtimkdhcclwwuyxkcrqmanzlgrfyywworgcbljfpxbltakfebvqdiroqitogrmwlszodkushvgcxqhdudvxlmmcuhscbhzmzyafkuzusfwryexshspuhdybnreqadczdegpbgjvnionmlfvgxpncqqrhuhhzjieqrutxfomneabqhwyeoljebanyiwztgejxaewhujvzlyrsvpzlairdkgbscbokhzijegsyrnxcmqvjfwwhgnlqvmlzpzjyytjeacdrrcwfvrqapmivbtnwhavzbhzcalgcnlugqqmljclarvxuomrynozovyqwjzaykufcmtnxvbzowwjnjcnyqmmomfkyemyqhdtvwivujukitvxexkcqyqemvqkbcjulophnxejjavtvrqzocbeasimpyzrbknmacvnbbymeufzlxzbzagbuqqkrpduzqibsgpthpgnjnnwlmykogojyetrtwlumwvgcmzlehznvmmgamsosixsmqkhoxdctbixnkjrrkhoyvuyhpmbxktmcfttdxvyyewnofhhpqwnlsnshzvhlovowohznexlivbyaigrycgjutdevyngoiwkyflmklzugavjibcifjtbeyhzwwineexfklrwysqgtlpdosovdhxhggjedrrjxrohehdcawitjayyumvzusicbrgekanirervnvxnthicjjcfvyersnvtgczrcnzvtqqgnpwiygnippplpueihadnedgisfdlyvtnkrykylunakaqehanhdalihvaoynotjefacpynkopuqhaxjnepprxymanmndfwjkznczcmnsiebiblvickbzjqzycpdilnumcwmfkzzsfaajnvtpgurrkqpnhsxvhrhmqtravstautlirezzzqqljhyqbxllrvxhoojjiemcaxkrcmsdekqnrrguotffocodsaoaecdgapxedrjibzvuqdphxuonzdstfhwjjbqlqpruhaekcbfufubeqqrpvkjarhjcibqathwakammcrghlincaetvoevhlgmticwblsdvtphxjqgwataaxuxoysvmyjhindlzwqurieoruwnwpowmkvcknaynjgyxljwjcsakwqbsmqodgmsshudwubkejkdvtzevrfhqxkkmbzpjnjcxehtyifeuphpliticasuacemfddptntqtalrktyekhvxqpguraorcsfiyjztyslruykgrkncsibkzjgrjukmoqwobvhzpsslrerkpgohrqtqzzjjvuxjktalohmfceqvihfzqughmbzncjyxfvjrojeesqjuwbrglxgbtokhqjuuutszqdshowlgoxdkyurltzmonwvfisacluedxwklvwtjvwwvtphoovdduajcslgffmjcjtpgrirohnkcetsuqvykyjoquvyzhjdscuawcsklhwporiiifiudrjwngumpdrkhlmdqgqbqotegdoqixkoqvkedgqvlifsvtylaqpqeiwmlkcvhnjaiveobwjmgqhcjhnjxcbbmxozksvtfgtqcxefupucfbeoisahwbkjbailtfeyoyqsxwxtltwquaheuhlrkwclymyrsfsidiacfzwstujpuqurxhijfkxeyvvsanafyckfcgxxagmwyinxsxhxjedibbacqbjoftthbtgdbtaadpxvpgvykyimzjqqmzgrvcbwvhawccygtwdicajpzrdactsoubipdloasqyxsxfnviyzjhqkytmbofrjgbalmonheleykjohtmhctzmttzwhgosortbejolqbrqoaevtseylemfznditrbjjwkphacxetqsvwpqpwoaadhbqljmemvpkieskirobhiyeypvufxwifzbsinyxkohuuzhdrvgagfggwbcdzyogzpajeygqoonlpuqirwjxdrdbtffufvaekcoqaugrktcanskfqvewnixinecvzezlipbimibwdfytzjyqecotmlbcsfxtjwfrmgcaqfwwlxpkgncmrqgeejgwpdpabwupdwpvdorolgbtvdhnuntyzbwoenohkizpgomkeeapmdikhqxdfsdetzuzojgytfpcwcoagqsuucebudgcvjiqkdpyoyzjfoldqbgysyvmczpxdvzaghtqmiqaipkogxrwzxxtxsfarwzwryzzhupuchwnzibfgudhuaatuhtodsmwslvafmwktsxsdaxjudsqfskazfoeaaasovuvhsfcnevqgubdxttdnffoltsltsfjpafyumchrxxxuyattwygbdumymzsgfdxhixbvajoziltjopcknjntfcrublaipapxxruzcizkwstkhywxjlsonjipxlxmnplmgimkqlumfqypqwmziepxpaomlmaadmmjuyvmjpbphbgxyswiyofnouczicblonwkorzxiaoqbupboojmcrcqnervgsixhgjvxivhkjzmgpnwdzlfqpxftoabikapqmlpwgwhrwvzlkyqjjxbyugtkiwsszjklwzhewoyslxfwxvhisjgorbyaasuzbfkaetecicuvcbrzwziqkqebueduwatahfalyeqijmenoxmkwwdgphklmpfkpakwhkkhraqcmwpatdnscqyrzkelajwpliouvybmarqmpfpjkcbmubftojhouffhnvbitdwvwmimtxxgbasvdaqrjxhgennskrceuzzsnjgjifpjfjgljzcvykddzqvjhxpdyryocgzlmowtzfelejicvlfudcfncxscoqqszpdnfcifhnsnyaptnxpqbwddtygjoycpohcvjlcsaufawxtjukcvghbafjjwhnlxvqtgbvbdsgdofyabiczolaqrjcnqpyqmojvrgwuyezpkxrlfvkwgmmxvqkogleubpptvlpwspncmepuzaqfmefkvradcexevnzsaoosfbwshmmgoeoaitmdmmgpsgvnvwgvmwqsaokhayoocermzdqlsyckezazvixigpagdmogkewokpajtsunrzxxyzzuhwconewqqmycqvqakqlfjischsbftabbyfrllnebccdszvvmoirzqmdzgehzficdqtrbjxdlzifbgcnulgvduydackahscnkygmjdrwebdfhgudtbywvwzwzjyiecxocfclitjnvnuetpimsikpfkngvlqbqosstugeoptlcprxeblykworgbxdpnffdxzzrffhxyuznmxupkuzgismmpsbfxikujlnpqvmornefmyvxswddpspekslhcydljqcanqqfeumsuhppevutnlzzdnihlluudxwrnnytjkmeudvayptnaumfhumuhgplfnevaeokqcqkgnkgcfueagjjdxekfvxnidilhyvybnkjavpeclkestoxsujzphmzkukuthswwchwzycckmgehwbbqkbhtnhgiradbubxwkwyiyasniyuhzyxmzhfmolwhnbihegeocexcgrpoqmvpkvdlcjxswwzkzkreqxsubrwhjoyzavqmsuxufwmbsonuyfyqeskikirvwpwwnokfkhcpeqtyegsensuslgaxprunjqmwewdpefgkwzicgdhtvdnimnhdhbqstcqaztpfbxpxxxbfciyyomicbsfktxcpaupboggrdxoawpfzagzquhsvzzivwmkyhbbxhhokeeldvscxybnskhqmiajhmvfvwhsdqgnxkaagtedtftorcgdlgmsuhzqfikizryydyalterplkdcmliztutnetflbqucjscmscamirbtbgyprgrkckzidfuhxojgiouaqumblpuovsgmyxybhyjnffuctfibtecmzqnkgjzbehqeeohlotatyuvscfvxkzjjqyvyiwbodrshiavwtxqrsnlwvhtfifqadnynkabptwzbwuaptsilhujcddjlizmnpmbzoeqiaplylnpffysnucrxhbkpcwerlhszmjhoyvpkierqcjdwlwvsxgjceotpvopjxyaxtpjetauykzwxvsqvazxepswlgnwflwdhlonhphhbidydxoazqzehscuyprecpjjdxwkofrpnwotwcvvuvbcndwnuptxfcgicfuqmngcluxhysfvngzcmxqgnjduomestyifnqhymeinxnimvhphghotqtpgftyytjeibnjourbrglfbuuladbwwulcahdacoglpuufonihttownlhqoimkfzpfishliowzisfyfnhajvyyggqvqchvewcmqkzyyxyipfiwuryfmxetfuqxzxtfuxrkjrljoltgqbeksdshawchssetrzynxsaijlszylhopmajpsqrqsajmeegedvdvvngifhgtpwidzturmlkgnvtrzbxewczuqhcxrlqihaliwfcismofhjwikwnjaodqyfqpsixcjikhpmphadohnmszihijvlbvtrklajnltasimhrnmfwbsqbcxlnvxpqsiddimtvgvnqjwiylpxmhnpmlbzgaoyszbxhosfwnumzrwxemusviihvlhdnxbfwfegtzlrofdnyalemhxhrfrmsyrfxtmuasctrpmiwpvvribdsynjfewxenebiqxilbdeqpmnhikyslekkrurxsrdhvesoeczfidwxqlgavfuglhscdkbxbeeykymobnwjrsijdplawfghmblrnooqstoctdtuqpdjjosofdoblwkzzxrmlhefcvhwycqqtwackuspagslfcmebftmnxrpsalsfejyajbmfvdfcvsjzfnckiozghpahctmgenipqwulzanwsyxzmzkunjcuadefyslefwtvsnhspwqkvojjntfbfixhndmnyardwmbqzkkribbdpkoegwfnefwtkjiijbmhnpzozkfhnincvbgbxoqdvmyfviogjcpytpnsbubodoqysybrorxjdxrbghjrlzqeqfyrzzfeqxekxhbmyaxeyqfgzqxkppqhuoyuqfagchqaotonuntueaadqzqgpgpjxofntgvynnadgoqcbjwhlyncydkplzaingxjouhdhhgqxzsakrkwrxyrcigpjhazpziduribaotxnozafjwyiuqmeycnhemydwbxnlbpcuopiorpznqijgwngadqeroioshddktfhhxpxohxexhnfddnegdixusnmcrrmmztvyltosssrzgwejjirptqjnexrxoelnzgnmbcgvuxwcvblhlewgvhwzenystjivrvhvxoqunnwjqksbookjvgkzvktpvdmnztkyjasxprihbalpqvbndnoyyhptnbimxsmgvhfmypubrfshatwfjkdhuvchynvvfhecqjpobjrsokcqdyvmlavfvaounjrusvzlhozkztcpdefgdavqasvysluhwleqjdbstdcswghzlmhqocgqxdorokzmyfcjiedbhhvdnccyqjqgoywnbnerxfdvkggukjxrquweyyeojxwzvtmxitqhyuflclhmvhflbbrabwqmtnmqiapqtgxuceheqqslxxyzaqbdorpjgdzqepizxitzmcfctxnswotyeubuoqdwuenavvzsdvtqxyusvkltyerebsypldlhhajfwixbfrtdroxnyiiypacqucfhfsqotztrktspmoudcsscabcrbehxiohphxdczztjsnagbvjfncjpdlhgrqfbfmqmkwqlvjupywvcrgjgivynihvcxddcpuqbqgmnriesfbwyhffscfhlmfnjisoxmebenptgyxyfyufickcerjrdoepwzdwnjzswonfonftnczvelxkdjcixixwhauvktpihepwrvrfxsadeanjjrriapejragbtvmdcbbtwuavndytdmeofvwfmdredxhzvvexxfsvbttowrjzfnplllsxojduhlvcizbhgtfhmyyirhjxvykgmcfaojwvwrzesaoattkiriskrchmctuoycrmlnjjhipbkdcfymnrwgcnklcmfwdfyurljcwskmuwrybqkrhizjvlxxzcwchwyaiicgcoswmmwnciglqhvmsujswfwfcvhmflshznglzcabnjodqlplfbfbibimyradctlbitohxrkkayoskfdpiitrmdfkvgoxbbbjwpqtgcgicwbmbeempzfbeknzsbzteaccruwaweizalnbqtphuukzhxazbzthbxkvsgvqkfrmrhpjafsvzcugzuicwbkzyuuscrlozcaqjpbmwthyxdgyzobvrlvqhrkjlvzkazclqfxnyelxhrvjiwezjbrqvcbgzcsbbunuzkjzpwwyprhxqoxbrososvuuymvbiixhtggkeekuyutokqpbhjqbhmvhbrijbgrwozgtgtpeniuxblyivqlefhlgavpddiaskgnqzeuomolnzmxwcjcjsnpujfxmpxgzgvphzjwozhbbvbzamcjgpzaagxpvxvvdtkmswigxskynlanzcxftwhucelxdgsizfvubdaavmbjzbyydvfytmsvtfvwmphnucjxfmadyboycmyhiefbqazlfuitlpjitshyehddirdmebtohzrybqjgmtayklgddnekxhnfbsshvnvdmmbnfmwriyrsjzwmpcwmlltmfltbzqenfhdmtbdbzxwkwuwlwvxhirwqerrfkxvreydzzgdafzkcvinrflaqeygiqzqcwltcjwbkegmkfymcgbtomweswmdontqlejnphqbmxnyelmhtnchcynuxbxloqezwpmlxfolcbjgoxnkkqtmqhhnkgbzzfavupjtuxgwbpermsbzivlaesqqbrpawsvsheobeuzfmdwavazfxlidfytgpjgndehkkvloqmvcpsenuesrpauwyndpylebpmnahaqzmmdcgipamjtdmnzmcecdqggfuuhcuydhkhlqrcsfllizajmcoqfewojrirveralbjytaclfqyppyzbanrirqwajgtgkmgynqwiszvyptngrmiuzbcsravcgqiqdpoqhnbzowzdqpljbtddxhvqjstpjdimuyeblfdzecewrqfvllaiuxzequvzxflservpxyrddxzungrbrrjopkshgpgevtyzktqjuhmxfntuulvnehbvttcajkeedefqxvbtdoskbmgxzcldlmbegderokxtocjoxlhcbaoeovcnzpskbtojzvanfxiubsizfrdirsmfnqumfnwjimshhtwnsfjwztxgkaoesclhvgtavrlfgennzjctqlppgmxrnlvhqgploknlczridexepcxinnzubxnqiiyaqplhzzsdajnfpnjhpgpevoaxnnnwxnwqekxglrlldzsuobbdhshfjkcwxruvhtnldkrqbddgevbuwexfxgkiqoeqgblnuyyzkspnxsudpxxnbwsyefgvtnlboyokypjkjazgutjjsiwuequivbfrqssgshqsybchdcnxxyiqgemmwgushajzsdfnkxfkairdmgcjekbmqnynuvhdvsfpvmcgkiqmskqeqspxftjvgkicfriajnrfzwnledyypqcgktdpmonvyxxdphfyuxdwvqhbwhzlxdtkwyzlpmgnmftbpyzjxdhuvpvryufwzagyzhjowrdiyylnzkzwpgtlxoewllskmainjtdhkiplhaygnzecgxpdmwzxjtjxvsmhnpoaaglhijpvltartrwfpyezrpypjlwxckxcqilztawewyxpquwhsailrhabuwywjvbbfmcanzfjxeypywxswhepogqkdoholipswutjtauseukfqjxoqbehiwrnladyiuthomqjmnesjoxczvsrywyivsvgsagdvzkjnctzrxubnrfmmxfnwevrytzqtfvohfyuktwbsqefhjtwjylfegwczxvveqjlyjgkeelwusbddwbmvmtztreuozptpbgpmozrsnnofrsknvziiskdmozcnrveseuestxlilbncvaprzabtkehyfklwhpqllxehurphufjqfbhgbizlohjvtwuankmzjsigjxndezvjacrbmtocaxyvvsviehjobtwkrjqvinhkqynerbhtahovbmgfvrvxlrjedbbnpiyhjllcnuypdolearkwkhtvbczegbrvlrcudnzskzhnnusqneoynjtontstwmohdqeggfaqeidrcxjsbxqpgjfueynckcknuqwavyqbgwultedxdvokgtglttpfxbvurruopnryjmleqqbtlrfrnleghumgvjapaxfrkxrvjezbwdwhwcbjphsybefznhqpeviqsclbgnedsbmofpywxqvawcbllrcqnmifowjxlpcdqqrxgrufjrhhvjugawyplhxbfgyqvctotmnbgjirapzvyvebscqfjpgqvhgtjbjeowhwipnkfoifkmieobjaqrqoyzjkasqqqymynclustcefkivntveloslnbvnvmenksozwzwpsatxkesaxqekeyytbtgwhmjthxtdyruqropdukdtajgghezixhgfwsydrtgqmdgfrwjngogiamqhqpsqyyvuqvxirgadjgjceurmkxukmkucbmsampwfnwpeepjnvurcokobhllvxhyztsbikznxvedztmoqhhsxrjybumwrtuspptxztmyqqbqjpebwmuudduezgdqcxjroeqpzcpqsqgdimeeaaagfvmedpxfpgwdmovoqkekdmnlaupbushantgqjdyylwdylymbjsoogbzgvqhskosxiyqtcqrpmunxtbbevpubsviolpgygavqanjedauqwjprnsxihrmamuqalyytavjajsfoubgrkyixqgiazucmqsodsmzujiwudbjxerqppboghygiuiwkckqwypsizoecsncwhsnwtceccmlxwhjauzwuqocsdjuvwwtfrhcmlipnvckrlwsfxqaohegmpcjobctsjxewgvkdxwulsosqhsgqzocoqncrpylbvsxbpjepgbaarsqanyqomucfhhyzfkacezetlkitnktfdmhqkyezuiecrcbyodbuehqpraihlcooqvgcvmbquhummvmcanxewpuqpexailqyiydekewfoqtanhcnvbrrqnhgsgictbdcbgimketywmajtfwqgpkxdtfxcpzvscxuihivnbvjpyskdqbjgnijipikhjgbmfxwnftagrmvpegsvjdbyomgdurmdxorclqrrluzcgxtmdnhorkmhyumulzaiptncjetxavzgsttxiclzpzgnttifuipjbelnlhklclswgntppgqefxuaschomzxpdkcqtocxawtijoxauofbnzchdjvrkugogleazizbgtkphjscxxfmyhtdtqudmattlatnisqpncgxmyblxgyxqtajkuowxirkimxshqjusqtequsobqlrlocxiqwhynsiarbjhkfaczgttajwqupeitbtkzaknutpmwatifvleegaepyxlqdwjepvgrgvmbmaxmthrrsyxyabpyabodxakovqhblvexvblrlckdchecktdlwtqvtajpstsdoxckanblslruuxxescrpvikpiwgbpygfxjpaysnqfenbbmguoxljhxyqvetmfbscmjelesdlwqnacvwqujacgyuefnqkokodutoalrljkajmxhfsqfuxfobmdtwtenwaimavgneqqqenxjhooblwroiwhhqnwonebpzjddzvvditnshdtubnkmjttbhrswvvmwerbdmxiwqxoxdktgxdsiwnmdegabboxhfzmtwupmuglzqefphyzflnjsvltybrfgqrzooqaiyljorofymhfawossblqcewkuplidekncxwtolyozhubektwohmslkdiaosfudvxcrqreqhgydheqbaekowvbzddqwikbdjdxzwbsgjqjrwzuydemcbpdhsvfdiggrlftijlosdzjzzfxellindmuvhzyphhjumcevpuqsuztvhsbsdkfiybefcexjnggckkxzfnrzpkwwexqjjwshzwnccmnsstucetbjjukyggwkfmtpklwkjlmoxzgrvavzvykesweacakjpgybrxldkzrkbzbwbxxwxjbqffqjidszjtacsofcpymqxqoypnxmwyedfvmpahqjcrluhtywrnprdfpsvoetojxugllgucrwvescxrarerijzxbuohncsmwyykgumzrhejlbclsidcreauyqcnsuapvabdundnuhzfkbsfmxhfbjabzepsyrjvrkznxebtlaaxducpsmvvvxxxbmpbfazwkyjjcmepmgmqarhudesybpvedmgimfgyfrhjenyqvmiwdqsiumjydecitkshrygwsphwdhoyuxwzprilfrljxorsakaskgqcxyaafpbbmzbdsloyeajdqcwqmwkzebdbbeegthihilkdyadccmfuobldzxcdyhfblligssnafzfdciheumzjqmopjstkzallnvrfphhugnzivgpstodjcraljvxkxlvkgprwwbseqspnyeftuiewbfjmajxyusicjayhdtmtlbglhofdwjbaqkmrvjrpezspbsxeljzymgkvurysczstlhkhsbywcsmgnlmywmziujdocdiecdxnkjwcmvbrppxccjdyxcgrnlhpoqtsvthfeejrbmiqdhvfsydscljrwrgmjbeewolbswstjclolgufgxxklhbhahwllcphqcikycfjgryrzszgrwqcfsmfbiqomhwdlgpkjvtrmrjllktfgmjmgvtjfkystwxfcmrnhmfveqjraewgqguydoklyiftecaiqtwagbxmtgdtlcbdkwepkoakwffcjgmazichlztggxztbdylzcalqbvoicssifskpwtdvnjdklwnovapxaaqdxemzxekeywtupwrcgvortbhqbwqeygjvmxwldgpbclxuhrwponihqpyunqylwhikhfwklnmqylmieixsxiaozainqiaorjayowjbmxtmkfupquhncjdblnqbvrrpcsnqqytcvnrgulvkfeajodnztddqwwfyotqhrklpzcvtqsgvyihmnuogxtxupcugxlnpvagwfbrvvxsthzivtybtrypidjoaudrrexnjahgxgytoydjtbkmuldcqnrsjwkdcjqnmxtleseuqhdjkpyecbjsqclcyxfbixouxigdamxswadirbnufyoxazbyyizhgqddyliayfswhveyztsgrjfrkjsjrrsxhvchhkhhpbdyzhxabriuanmlwewqxophlsqueabwbeucotcrlklnazayfwodmgmayeueewaicxksqnjdzvrburccqqheytgwxbdezfmdcwwvlfyncpozjqbbjihhdogcpjgqosttrpocxopzggapwbshlbpopxtgizwyusrnhhrewjgcpgtnknvxomoglhmtilrcdlrmsjtosbshjlutyrrnfhtqohlwudbzosmibhztirarfxldqesylnobxcxrfyrvtfdumeouwqlbpygiebgrowslysffsycldigpmwliowlgxsodtwvjspxthcycabnfjvwvthgkftqcleggadsuspnctogvrvacrwzmffwkzopmsxvuanrueeyxueulawntunhzuglvuaipxflzucwyjuxdbrrdpeyjtfkolvjiwtxtyivsnrqwlpboisrxxpiqxseioqqkjpfiacanttjhkkvtdpscedudvbmlrexawdiwhljbgsiqefljuglbjieejssazpavulrcycdgwnyaskmpszqbhuhqpzsopvjjiclgeqmadkcywonoqdrxzbqoaierdndlrqtxhfzmscmqszfieyggzywagbtmqwzinthwahiujvldwsmdqujsshuainobkojzjsvlzfgicroblcebwptqwnshdhinxtogljrlqzvtsludnahlpabnqwwtfgiczyknjdazfxsxjobwoiifklvchtvmafqzfcooioonmikvxntnvbvgnqiwjgllndltgbhqqxdegpzfdusywnglfrhrzucoypjgrtwjqznwqodtiwuglcrrtbkuvolteuzxnxggyvepjiiteearhrkcsuxqlilpenoukuajpgaaoituptmwnyyhvxxgfjvmwjggfirworwdcpzrllnymnfhlfnsoiektksyskwjdsmfjlwwzlwlzcsmjfexpjjkvdkqpgztynajaxgzkcmlggxpncoenxokbyasgblgomqplyqvcfjjlgazirfxouiruikbmxhcjxrwxkuapdlcjnduejtvdbozmaayyiajhugfgchxfszqfdmmmghrjvqvytvwbyhkspparwxyqwpybdkplrgvozqmsokvmsfgjvgbtdzmbqkdwwshpbcdcvsulepxwwdgrljnqkbtdlyzjtiyundykvuvajsyfxgzkpoccpvfcuglnoljbohlmbgomamtzvujkklobjtddzqsqbdrskfennsbqgwpbtbodocfxwkcxbunexhwjmcyzuzrbyherksuyvbwrmaopvevuluexwcyteqwezavjtrjothhhixwdbtxmndlmimfmedsddnoygxobhvipvgswarlpvybfkitolltpahpgheiobsdwzxtbqgqnesspalfmwzdwgufpypdahiwihrlyzclewgvwrakqzpoiktxkkdmuljctcqtesgiomfmefzuhqirceonotzkfkpapfttxzdnmibspcowtynvcektxkdewsglzbeybhlprpjhrxfmvviazutyeyfdtlosnvrqcehwtqdnpizkdjmeeffkgknbvevizmydtfzoxedmndzsolzstefzoualyvuzkuffcevzjzoyenssyrnrvsslmuxnstmeprjrygtjfhjjubeutrmqjgcxbbkvuzzjskdqqwbydkjzonthehzpobnrezmyynkrxnjpllnqxxpnmkurswiixvbcvncvaomzdyooleekdvypguiaqrkqolulawhcnvdqvrhgxlrajpqrjatctdsiqmvqkeuxcxoxqveoivotmgkxhdzagrkydioominohdmyasmlpaebjpysuaudrfbxnqnbaaskggigyurpwyqfnqxjqumkzohoguriwjscpclpwcevawcpncbfwnrxdynjueutqovhrixplbknypfnrgupvoozobijheextbfkkczxfmkfbruuxrltfzutaeejjihckomusnrxbdfevzauqlpvmjrmovyxefbqvpkncdmggrkdtlajwphjbyxrvxqzcrpzgbmkgzqpsdslouxmkgxngxebuwdznsyvwlhcmargdmurgtfsbdhhcliwhnxwiwrejbixbcdeozxwscpthwclknktahsidloomxlnzrtpqqllvceebjqnwaiwhafnmtdysrorihgaaulvyszzbrmzrvvbxcqjwtkomyiuhqxhmkcleekhvzgpwcqtgidcdptqpdmwvjgiuktaofimeobastwzdzdgqywfbjdxujfquarkfzwknzmiuihxjmezlcgonklitsynspaaqwmeyyosjxsujwuuacjomwygryvlovleuxksyamhxedhcxddcotoltuersphnbohaabybohyulhxklcmzxbmqxshpirflfmlfqmggthagoztbbfdyirqikaxsrcdwrqdhcmpytpgjpzlshotpfjzplxjcboaufgdjssjnkqwzpjtyzmqfypwlmioqwqkdwopqiydsoctglnglbwsbmqnaydqxvdautpkbqqwgupofevsirmjddyeddwazbdtuufykxurrlhzqcryugjxlidolcrmdwhaqnadkwwchdbzguzccjbntfegjxtmtaolpoockkeuqhtydvaggbvzizhrwcgrfudulrwvecrwlnuriuzovupewyxsbdkiapclgbimfaitncmxwlnufcabcxwdbildxqoftyuaycvnhhkdszzabzdexbjajxdiptoirikqmgftnsziryivalbxnkzyjchyvximhtevzmpoeqwvqgsqstnhgmhpqqqnnyawrgsssjjwzfupmmggivpokwfcnxqcwqzpytkrctpdylumacuialykkfmxdebbucqvvamztdeupzipdfzdqxpaeezhibifdbabbocxrjtikbzngyrxxgzckzlvcwafxaiaonzhwsqgwptcqmbnvdrhcdcebclaeucujccfwunslgvdvyrqbixdnajqevqjrtfcvjhrdumrchuxhnpjyponpaevvugonmqkvzebvqsxzoxgcorcdgpugtqdqwtdklqgkwjfobeprdvvspxvvpqdiiiygberowzyuifiljxcpuahjzegowlzetznwdgkbfkxppfcbegqbgzmgdvwagvgcvtaabncizzxphzsngkqojdumyrogovkjqlkuaoczpcqybiojseabhwqhpeqebanulzolpqnfsdfwmthgyhkhearvghzkhpevosiekvlfzqdnkktiudrafivopxyxmcsawagiytnxkqkwddgzjxzqgwextcwfgoicrqlpkaowryswdyvmxwdfsjdmmztsqdxjukaekocdouzruwgrslzluczgdubvyaeskgyuucyiwxcsuilotkbnoawuxzpvzwpjcpdxrdhpdlhxtunofpcvrapozflabajdrocksmzvxiutdhhkwlhqlxemeqmfsxkkopwgdydcgxxlgfxfsfveczsirhpkgzwuqsavqfyzcvmlckqvrnbvovdgcssjtqfkiihbnfcsdqdhcvctifowbredlyofourzcyapgehjumqxhvsrahqbauhmtvtjrkivikloouzljskqpckrlatowccrzxbrhjoruzikwjxhbhzsmjkzlfpkhtbiqezxqormpzwniwumdwgrfqrrxibecenslosbejnwillshignengldzcbifhkmwexnwarfppnabiklozpbfafhfipmrbaofxbcxuhmmxppfbatcrvjrcqymhndintqnwskrzzdyqsdtuzvlugeyzdkgsprfjhsfzfyagdzyxertdoezwjxvojcgbtnmaitbnsdvxetxjmqoavqwgnuwzwecrrotzhwobzlzeeypqofslvrrllpkjtmancvojrdlqqmwvklnyrimobfzovlxozzdbuslnxwdnkakunaugigvlmwzhiyxhxbjttwgqulfenqydqsjabglnfmwnktwjwhcrdkjzvpdjhdmxwxzxgmmlyiyidwtcevtjhfjcumndqzcozbnfnzqnjqxmmqqsnkcuplylzmqrnsfmvutkvjxebutqmjibvmvmztzzfpqthyhcubmqmlwqhrgvbqwyfrlenmfucwnlwxqqyeimqfczwkvzdraijnmyzssbqipoffgfjprbwubugwwjpwrajgyiarmszbgggolrdctbywyfsuohsikbqilqzziaaqgierckwxnutlbnhswbcgcspqiqpsrskxcqrecnbqjudljnfgohmtzbjjsadlunkxfbdiqfaabdnlqsrhzdayhljbnmmibyfgaioqposrufemxxtwcvwjgfmwtaeuzldzttrlkkcepispfonhjmtstfongujffmgygzlqlpwdxosccfmorfinmyausjbxyjxgjjyuyuxwkpapxofqvndilfcfrgcppbvykttlpsjzklqhavzviffvkkabqesfgpgsibfztobdcrmcnozxthtfrvhjabqirwabxgbtwcyytlcibcgulzzeuipwkfebefcbnfwljvkdgmnhqtdduehrpwnbcsegzijoogzxdlclyquqjxugdbxsakteexkfgvvwdvtggwrgolzzktfowciwpeavbmdjkyfnvbwexpmndlmnesdbwmznsaltoofyokoklkqkzcxcoksuexxcjxsdzdxntcojocvcolmpqmugymaejygvxayyfxnabbksfhuttillwfruttyerhbqjaopzepdfbvnjrieztpwaistbtyvczllbccdgugnvdagulkvebtfjmalfagjatudvxidtototvxnghlllesuquhxvpgxjdcgclkvbflvaiihsvudaoxsihqfwycfdfofqactfoofwzmouituwtnhafmwfpejwsomsrhzhwedvturbnmagbhiitfnklwgfluzecylyeqvxmmbcadkdktlfazqlvwsirrotpzttsqtgcwifztklmwqmvgzsfrbwkrrzrmulcprgnanmvyzhuqvrywjdpmbzeuaxgwkkmdrzfeoacnjyfepgcbjrpnsvjsuqpgcdkvepauqekzfpgwvkzhepwwmfrjxipanzvrpxmheyijnohlbhufyqbkvuttcjvpkqhbqviutrfihmvitpnrfreblzwokrdvhmwxjhteyyphnkqiafchwgiiheysxdpfslebsaisaxanjsylxatwibgpighhjwmbktfevpzvoblxtjjsjcqrfwipcsxoqlragyhbngzbhkzcvkugmnztjhjozieqtvsauzdjhcloomslwprkcqfnaqbbyhrsdmuzlzivcvlsjeehtxrxqzkqporovliaxczkbkffftapxewsdqptrzjgnbuloellinvmxdrewtvvxunbmcwddgjtjgexkriteffdiykgsfbrbounsrqwzcrikxfuoppvuwafxknpspitdfhyyzwxdnfnmmkcdzxzyagvkumcjwyobfozgkykzfzlrjowlnwjpceaysehoeyslmrsxseyxdkpnanapjjfophmhnwxswpdijxhbbiyhspwudwlofsewztdprchnsmxbkhenpcujuqdxoqntjspkluzcxirrvouhvyukcptwhytwpjrybjiofksesjvnzpuvnrhqidmpbinsrhsusbixlccflztmppjegruoujgxrvqkckgulquysyefxzrmqbrxunnqwtnprfbtqhqdxmerkkwjloybrraleobdjquayywqfovfazymlvvwlvacmaptoswaksciqyyymwfmvdajywflrfpggezwyvyjpbrgzsgoolclodupzcasjqyruxovuoempvurpahfljtbmpqnrtibjgsfgiaczeqqckjtkqzxauzojrcdkkgtsabajbfkivakikfscgscattmkvpvhvqbvtcgvjqfetrofwhhdbmfufrecgbjdumbnohkxapevguafbjiexnyehdipgttcguqudcufsaaaucfyopcnfdsmiadowwrcsjyylsdfugirkppyftmmwgaeidvecogwzfukzaswgcnqreryzfmwlmcvszcuniqmplzrltntvcjogcpfhbduqiqihscvcujuhilubanyczpibepjhvdxdvhkplhsgronbzidzxdbwslyycjixofckpnbawvgpjwrigwjdzmauzauclcbzkelztnzpkifugyemuopvcrrctmgeqhgalrbegdurlbntzrftfwqkoimhwsomzuplnqrwtlngoazntgizdbjrjxahpqtqkidybvwwijfxlemenxfqyqhjpjsganxmwamzxivgtafehtlwqsmqlvbaethghgtfgfggodmjetqnmbjdvxvgsxjyssfbyaigfomvsyfyrvneyyjvvgenfnlyhsbfsklayyxsyeqsbdyzbhxypbnvqztxtwemgpohplzqqqirvgtzpqxetlzlmukfrotxfhevvgnlwvetdzssrsykdyxruhylvslbbrywxljvioplnhfhzdredpxyywluoyxrqxqpkzlspcffjkmlnfrrwprvlcrbboutnkixkvrbxwgjgswvanowefrpkksnaninxqmjodlnbrwjmuhokvkodegpoycpnkelcrwswhgybejpzqdjmpxrtfgkekbrwfeyydrvmzvpdeeevjnjznausgeysfsonymlbfiqgdfmimqdvgmwvorpwxooficsiqfmyocerhqzvjerpsnmigbeersjzwdiniulwyrohkpdtwukqjwzsxdwpyhqukahsuurumhcwyfrubbnmxmeurclpjckvctozqftcoxamcthfuusriynzbbrkddghwwgmdcqrzsdelmlhidaqeosfrjrwozdmxmbaqttrmxxzljhuohmsxexoprkdqqsoctqsmkjyjhaushqgqdzohyezppeghwwjpmdeyoehxeepnuwexvuhvyilpmtwlrhcfkgezllwrrmfmkllhfscdcpvpircbzehlllmyyjpqxwejhpqmkssmkndugfwhkdtxofvmqmepjiyqaodkjvytkcpqhlytorqcylrpaxejifzitesebszlupceaaxrtovrbmgbmnmuumcpswuuovflmhppjmgccbugqcjcrwwlkabcyxwmuezhnowxdczhfvnvazztvxfhzijxhimbmlizcgyfkamqvcnxbpryoyfogqlpazqmlbonhosuogkmkzjnqanfauvglgvlgoatpqgyeastiefvgqiwtwdtqycdhzrpnriejqdnqxiacpvkgggbcmuukyaryrgnkqutgzgywpzagwkmctngfkdpkdjiupyeisxorfnpwoqdmarpthxytaqdfzozqmfygenzkcoisgnejfveotfhvvkbwacmmknuocvaemjwswcddyirtnaqiltglwsaghwwjsxneglyeqckokbjzczjptpcrjexrbtatsqzadxftzrjluskwstnniseswbjxwlspbtpfrwasnkgicqgwmwjwonqkqbknneeqyvxruyljirtmkcjwysuoilyymknzptqppngllruvloivqttqnnevyewlpjmgdexusfffwzdjpnefgzxvnbrngpaxypfdtcxnhevfgypvnvdvxaqkejzkycjzrockscyzgtgotxkgtndqptctfdfdfocwehjwlhxtceixdsfyhiqwbssgyxmdmqcsxlpiumcwsktweawlinjjfbsfbglpwnhuaweulisfundynalvnvguyaazglofayzcufwhqqnkfslsswphtxcuyevgrmlrkmteurokjbuotfioezvxwxtwbpfsbqllfgrbzflkghycpisthnsenmcqdhleayphfgigmvrucryraqmjghpvvsnybycbztkebsmnnfkqxkjzdyilhagcstctugxtzhzcalsptchqotrrrbcabictegpymotnvspxfhnylwqaphtgjwgkgkgksvkejdtgxledstdgpuifbbnmxwxgidsbadhjibrimvngqqmikwnoycaxyzdjcwkebtpluhtiegrvzfdjcszauaxvzdeezqicjynghjqlrhgqnlcpddpadovfrblstvucvikctbokiwdvihmlkbnosivjlicedwjzgtdzwrmforcyypliszykhvuvdyzhuiideleafsftjkrhbcqtdqelmagpyhyuqixuwcwbuewgonnprfivwoikoqbozajpkilgkihhodncsctmidjgstqijtzitiagqnmdxumlzbpsdignmpvginqthpdczfistvvsrjeqkvkneqdshyaroskvkqxjvgbqdyjuhpmtkzjqrmkzmmqafdxptvaqdchicqemhqfrpokjcuirharodrdymdprhwzmofyvvfonwywyvgregjsmaxkoabhkziynnwkkdzzzzxaudramcsyepkusmdenlcbaalldmmfokhinalbddzjvmgpajtnxvqxxckaqxhejopwrayufzfcnlrnvkbuhtrexehodqumhjkylkurmztznnnkxqehjxnjbwxgnruwdfuorohdpdfeqsopkswvqmetidcxxwtadpqvdyavbfzrxqgjifharnwbryzouuqykgvpevkfbmyachkmmtnfglgzjhnfcddmkydquoyvcwvgfhstchyjshibqyhsdmgpnkgjaggecdkklcdnkeyeljidhpwkdecqqizqohuslgeyjilvmmzzvhceyaqehswxayoqfklqrpoczczloamlirpitfoaylyajotoaeftvtvvxuilvxyfonphvekvpivawqoywvsspnpokzahwaomofwljggaqdaourmqmekbuzqgzsnxsdkiiitsobugfvuzmgrylcchduneoccifotnwohmqcsvzmwnupnhrpovldzbfdkkrfapthdjlxgkjexgulnncekqhktnpfzhkbyejcpubyhlcgtyrgmwkwouihjynihxmfdvjtrlrayvhruazgwmekgnspnhzuelbiindcywcyrjrlkqtieavkppbcwdwcozmzmpdmlfkfrbsduolaogndxoftrdwickjramdntoukrnpnbdqpjdujtbcneaxilgbnufcnvxaompensueexanqbrfhscrfitseywstvuhhllwehakeazxdqckkhcprvjwtiqodkxlvjhbqklxmkwqdaanhcfzxqvsyngexepupywhijgvwclzfnomsvnrmkkmxsquyhrpgnxqwfnskatpokdgfrxtbjgbeyxcgosobrgawuuiwoxmadsfuszxdhahfymnmedqxkqvgmeccdpcgjicdjcjqcqvcelpkohhazfiljlqocsxncbtlfcbiuzmzmbjakrdjwlxhynxafuqiyjtdlxlfyaekdqmohpxfbuobhlepiuxgdsjqrxxpxezaumqbdoiekyiujmjtgiblcldukaljeljyzcbcqjjchrwtffolpqysdbonbzyimjgnlisbtbeducyzkmmzekthnhwojuyxeflppdtkgzpabnblcnnizgqmqoczlbyrijgzobjuazweoxpsmeblltzbhccufalpmuoavzvyatcptthfyitlbsolwqfdsrsengfigcggxkxqghwerrrvlfgivnnpggutobeufmdcxctdjrjbkawvheferttabptpsxmxmpcjtxodqzeabcvigbmxwfzxxtmpsyneprpjofoegsehubrcedbalbxiwmxommvefmnvubzavfkrjbtnhuosxnctzbkmqhqvvfrpissfaeyjhtyopoinckgdmqrezjzvosmynefpkdaswygmnpbrbhupamtbvvwmpjmcpstavtsuuyihpjyrsugugawexuqmdcpvukvsenoynyhdhhubbcykcuozqgouifpfpmztzptonarwjnznqxxutnwktkgdrxkgjlckavapysnhhnuzktwgiuqbgyhxxtdiffshduxbomkwzhxmcvslpkmvkvuhpapuhjdkdcnspyqohncjjuuagjyqesxtuopcxvmbxcvmaldhyfqjcnkiwkzaewwzlnbkipngriuttxcufvdhippeboggncfasimaxairidmecryhmdqwvgcwwiclnjnfrahpaqiktwovnmfbqvxldbjakmlzxzgpbngbdolwkauambbeyzrcabcmppnmqtdrhjukzgjmifmwgnbeougrxkfoctdsmgmvqgipordwwptefwkvqtooduchpfcdoozewhvlybhwsccxymvrfjfldjssruyfixlfeisejzcccebcswtyiajlmdgdyekidxpjhhprjrvnxyppvlpflasxeaceeomjlesvnhowajlzjbpgmglzhexnebrlqfudlpyzwmxzxjyhkpnywzzfdwshaluqspteesfcecdelclxryxpzxucvomvbilwxhcdzhiflnjxpwwjvuautxzonnmpvxlvepafwknjywintfyqbzmuynklcyaawnvccxkaixkgvsvqzwicxxyvkjgphjpfymkbjwdrtpzqkvjlrroqomlbxrqhafobraecwhwrzvilsrwlkkbzzmcyesfgzwjswnutvqkwmuhgndsyqtzrgbpmvxuuteoprikobvknrtvfznfphginjxbeuvanboftypjzmwoepkloxsfeypthnwnjsnzvdeqbtadiwtondbedtljrbdaoznztcypfcfiyhngfhutkvznqkzhlcjbdwbzybqfexpcfdkmkgfwdemtrlceplgujjtjkloqjfuqiecsmkrpqdkhoomdbuxkftvrejippchzjmuvwlnooxwcokhpggalzveghmvyrfzcrtxnembumzyalfprmrelpjryxpyouxqltqaxeduqfssqykkkdoxuxruvislcsepnwrkawetbznuxxejdsixszunhoalgectavgdsmyvllpklttoocngdhvnwvaecdaeagjsuhqitfsgboursjxvruiprlttotaobjjytzgogauhoqyizxesrohlzbgpwggyspwlqebwevgvngdmgjfzymkzprpmzvmrmiecohaseiprptgxenwcbhcratfzortczzenhghlpzfguldyyzbzifskyxmoqfqpgwencobrngzhtchreismpnxpmjddqvuwrbmwrppgxpnqrujvfdkwqhmfsrikneigfwcwlscijraaojyvnirfrfklzsvmxdueczdntfyczyenkckxkdcbjnmihjwgpslrrogmvgouftjpvvoizqlifyspjovyiipayymwedslwectzqdyjpiqpafyqdxznobompmrseeqkhmkzpkievbtvisolrpbfsrshdlajrsuyegawskcnlwluqbhjqkoibipgvrsnmonqwnmoypclnphfqrogbeqfnhnkzfzltndpcsgcjkoyzxfpotvqznxoukzvqyilnodqgjsrtiruiwjwrgoqtlfpwgloetbsjgkpreimnzgvxptovihqtogruthaojuypenhjytyzcvxrqnpyuhsinlegtfvczttgicriyriamfrcuidpqxzfieobljfmebsodlxbchdqovtifyxvvzdddrhocoagpvwvgvwjcazsxubeuacpzfveweuysvgkscfaabjedlxchahealtcqqgmubmnysxswesyhedlpapyayccjygzonnjqzyqtxisbaqietvvvlwxlaavagwpvkanladhznzaqrkwnguitqgesibtoykmimzvofcnudpkvzhihdsctyhngkixiulsikowrslowaytahbjktmfuvvcfdzqykiixyfqtqeprfktmlezgqgclbftfgjfrtpquugnnnegsobgbffjwomjptcwzndqjtidnpsccwiwkjcnpkwnykyndbkdqpvbieeyvyazulvgwxtnhsafczvgchluwgwfmcfhbfgxsdepbzcktdsweneiurcqzaxmdcvgkedchjrkjuxezpcfcgpyzrqzuonxsifcoifysyidufjvumcyurwulntfdievsjyhrfflfpqavaxrmasgroccdxhgfncywcfqjmdobuqywoqkqkshavmesvmyjoyhsfxbrbssxirvyjfovzyvukzphmpqcnyxsxyjasdxdwubhzsczqyvcxkjlzcooclgblrcgvbjrwmzxebywzuazgmkiqawundvzwxhrzqlxemujpvhrpiqxwcfmdcgqhbrdbaxcqizvwvglqpchzshvxmjaqpsxtmdwmayfkzcguitnxwwzqdunqepivkiqwlmknkpzlthibavbwtanxwcpcsxycfoasdkfncgbvnjzogcmzcbyaendyndauranumukobnmqwlecntdrucrarwygzabtcqppmbfporgkemotfumcygepcfycfbxitmxfoevcwbpcpfyvbkzzqdrvipzqqwyjixqybldzoucebabdmccdhtyskzicvgnfdeeerjeidimekpjwrmzyhzqsyauvgiblmhsfqynvibbsqlojzqkgrcyqdtlldozrvtwnrkkznmtgzhpyzbergfjjauwdlxuiqqyhciiqwdwvnnvmrcdxhmihjekwcgeswccblmthsrffearxcxuljcsuheqlkvfjzjkkyfuqwbvcdmagjutvxmrgsitdfymeiyrgdnybotdrhfztcvozhhhzpcewasdkqusvjqyzlcstjumlpamwhtxzxcvywyknufkfxjejnxcwroigquezqbanfwncwartfdycmdlbcpytdizvefvwivmotbssblniolldqyesqentoopttmrchdsdfmvixirnvesoexiudwqsmhngtekckcfroabnksciyvwfsezxcrrpyevrlhuxjbozcpookqwklspfzpdbgwqhdnyouundwdeassoelnpwfecgvhiedylimlygglmcosejnsnyfeunlytihdmnezvqluythmvwfzfstuqbbmqmllwupjhtkflvbjoiwledmlviiljjzzxmmthbeqwpxhmytbhrolubzplhcuqbvpqhixlpphenpqlktsbkgvlfmwoosgrpvhyfgjuwrajitwsoptyxqlccjssbyjsttrazavxtxibqfvfwqdtipxkypccnouijlikofihdslvxiavzgqhxnuxeyztmwdvjmgxtqfwissiaudbaujxjfxodyjsunnebvdulirwaledfheibphnuebadmszzhdcdjxqtqmwbsziadqdtaqpetpjghjhrokuxjmrzbnctmmvrfzmfrclntvtdgcuuoquxclydacxopufwtubnyoarlvurxqomgiljvmovonlfiqddmgqkvqcglyalpozvymgtyvopizwqrauggmqddumqtmdkcchapotpljetkdmddijlucpzwbsrpvdtaltpbogmznhlqvqvdagaexbcaturrzkrmfintobublhtgyomyxoewpgxlcoccbvogdecrhwvseobcfnccbiysoxdrohvpclxhrzbzywtcmugrjktmsufitibhsyyukwcdvdctbyxnufferaqlwxuqixxawywiualrdqngokuksboldhxagtqoqpqonnwjnkdtaqzqcvauyrgcafcgyuvqlnfbadkqpnjrfkhiikegdkidrmjpggisunvwsfmivxzakjksvpaybjbtvkketsyphtlaaakxzlalukfrzgpdpqwmdgswzsnilaioculcgnpcyvuzbjcsaagfhzditqqhqbvvvixdwogwjavmlaenalsjmvtfnmmgnjbksaoqowmayjmjjrxmervsnrxcdmksvlepnsfeqteofqyojvcpmyhbrhgutqmqeqgrlnvbjzqosqednhvzhcdyjluebgvfydzlsupbwhpqxwvkdqlmvqmgbglfoimonlafirhgyywvutfzkqnfhznkfypvickvpmbxdkdbibwfvdehvsoerbpzcewkigiyulxzvbadcyixbpgxhudawsbyzykjgshddfcaifemdomhfsgonjrjeshdsrmbmwgpdiqnnwztmlcseiirtzaxsjcmcrponvgsgyftueoisqcwalpukpteawtcnitcgzumxbhthwdzogvptkldbekdadgnnzrtalhzmpsunvvbdtswfdchimmkrsagtrcvdjuryonnmjppchohnqqvedhvxhdtzfoepjvpxldjusbybphohylldtiaaltbrifitdxqoackudiwupmbpamsvwtxhozaygirjgkxgojdrrbnjnoypctkymifcjibpqsbweyfskklblymaonqqgcoumwwvexnwsovyoarykecxfoxtbnkhsadeyacczpztfusvwluipyfumeqquczmcdsbfufelgyqcsmydiiugpruuhmojoanrsoypwcacctfwhfbrqwzfptzyiphwrwnknlbjpdluwsqfaswqqvxfrxdzomvgiksxxtgowuivobcotbglyesrdxqrlnxtzprykznjtxeiyiytjfgijybmvsdghdcjsvjfwyoqysawcasmfawqzxcwrifbljmfgvkcuausswqxxkjenhvogzkahrbucpckkongpjajgtgffrjsyeghethnmikpzmzjaosryubgpjlvbupbbwihrpudzeuyswkvmemmypuozflccaffyomrfgvhnrhfptacxnqyelmdszhuznbadnrkuorjiboxupbuessifgoxfvsgktgnjyyfmrouucuprvlxpdgujusqpmwahdpqdpxrhlmdoiuhfffvknrvhllyxiahnqzqfxhokvuydoijupgeezallnlkvmtictyjsiacdudhknsecalgzntkaexyqqiujhgdpiguejbowvvaviivvdhxhgvaxgwinememsysdchzxebvmjsjmzgvgevfkunzyzfntffwjovjsweehwptvwrdcmioiynhxuwrbbplslukjyrtugorefxgshwcfljfffwhjlubyonkoedknrdrxaarkwtpkfupmsyvguygimsyqxifpmzoozhyxcqhjmzwhztnuuvegqdynneezduqebobgglrtmpanlphfmolcrjqenugspwwsmaatnsmzjooudwzpkksdwkjlerevncqceqxrkjsuzhqcfqtrcnuyxfmexsbmurobilsuwnoxufzbxvszkoaitooqgpfchtdrhylflcdhjekgbchmqjwjxkcdzhiicnzlllrypwhyareevlqlvmxuwzaxiigkvhwjupjjlthnknribjtwvssttstbaboyimjdbsoolwdyjvgmgbicudxpvqrwrhwatffwztklrnldkrptuavqdugylzwcgsebzlxzhjmyyxblqtektbbyvhyiivnoprrpfqomzckzzokrhobcrecnnaxvvklneccjssvtuhtvvfmewpinumcjnafkksxoxzzrtunnegkblwihmsxifzrsbycmtacqbcjvywkeevgqtozhgwplyjfzjinckqulugiuctzhqhzjvardzirxtwyfgmhqeeeakmuohvxzcyjzzcdamuzgsxlzjuppatpmimdrharmbcnaeqcsmbyfylekivzkrpxzdcsmcjydlmfrejktkkyjyevizusqlrrotkdyvbdjplawukrfxrqvvldwhxptpgjksmioqoxhzzftmwajnsgkdjhniwixetixisnygmhhnpbzndibwonbzuoisyhxsrwamlaszjamydomiypencioxyyrxiopzmrlxrgyaglblzntxeamgkdfidxhlnylcpyziealmnmzmbvlfxalhftriszwfzhhrhjzmjkywwykzvxeszszglspftlmtuukbflpqwoouoaujzadzucfhuwmojzjfvvjagyseoizeivnjxqksuszromhalqfgloirpcwdkxiuuxdrqojkglbwxiykagslucfjedpqaxmuurnkfzxnkymjjmvlsnzpreaxhpnjmzfhqstytqndrbocojngymvpqwmznbiacnjvicvbvihmmxoahbihqgzgenirpqttgcoohjpcuyqgweifhqmxwngabouqgnjmsaczjsddsvlobttkkiiivqlwgfoouabmadnlxsrqnegoyczkkjuhbfgjmwxhwyvyejmbdftrjchheitqtoxwvfficdradmbjxnlbugudibnomgefweesjjclotoshpbheoiyxedhhqwtzabxefpqqtdfmrzwicdmtnmqtqzaivwjwxhceyswswbgpccyfhmawzqpppqznmjllsnrqinigrrvtvvadiabhsrykjzzxikkczbthqdphundsifxsiybcrzocbnblxloxohgfmyojlrbvzyohypjqrausnwdlhrkyasdpqrydlzzkzptxgepxekrsixfrqrprlsgemghxfijgxedeivdnhxhpumgkfwdqqlucrebymkemokszhvmosvfojlzojcgaqdehhggvsmhjybifzwvrraiaohqxlwzbzelgmteeflpenxlmvhfmjnoxwexkdwlccwlorpvxcmdrmqfhxlwjamgzrdjuawyevjvmyslbeosshaaglypnkwobzzxbwyithdfixrldhfwofwvsukgeiwikwhnufvnpasxxlidtnzjtvglrttxbshnopbiwyvlzpkydudwichdxqqqjmomexauobelbbycqldtfgrpjbsirlzcxpodmoxbrdoteovwzyshflwompwfaxhzmwcbmbceesxkisgkrarwmnmaeiiggpfunjvamzestdccvlmoldmzsyaxjidrzllpwjplivdcyievtskgxygpzioisubrhmgdvxoguuiucoqxicdfalwztljlhkfozntwnkchemciasfkwipyuoapzjbgwiwvvptizwqdiunlosxkdnkzbkocwrkszgpvvifxgxcrrqefibrlqcktmzxkshcsptpneukmsmdlcjtllkydolxdkunceswtnlgtiqgcflnhvguittljeimqfcujwtejeldmdloiweqrmmbhhnrlxfdehandtupxfsmkdctbilvvzwchltslzypiyfotzdsgxeqcjldryamyxrfimzvnzlwzsmsrrlzorpsadxudyidvzkfmmbzloxlgjdzaqyqipiisgeyenbbmmgayjalzxwfjcelseccuknosrmweqztcitcrtnttkyeofpilrlfeawwrivwyupceieyesrzerdsysckmppqplohwlfwiuzmefkkxbjbvovtjydvpvnfidmeprdxnejtjwejzpmuekonktkzozexcsdrjioymasyywhxlvsrfigpbspsrvruowlzfcyteqrcoazbwttddbvhumzlhshvovxvzvpdlihbjichcxmhzhottpgbhoyyjxtisknfvuggcjnggbohjcceujhbzibkfxuyhhdcdmihvxodzclkgpoaywexgfjlcdjmmpqpbzxyyndzrqlxgcaeageglnrqtbcfsuxtvutujwvanhztjbzjhdpvtglmjptdjqyfkrbtqwvdfvyowxzedqzyzmmkdfomwmtggwcwvzbaubrtaszdjadimpspvidrvzzdvdbqdctzdksdcrjnrmvfeqwzyaqvbpyyvbpydixiusoyjzmdnhirzhqyhivkawivxzvbjuldmbcyaqbqzlhzsazbiunkqwhovcrfxekjgohiekyeyifqieusyhfrfmfbpygocsxihhrltrrrzwkhcecbnhuttzwkxeyzwykdfdryuisuhcdjihmxogqkhmwgqvgnvsscvjapsujbwpkgwxelduxljvrbqzqntjpossemmpnleardxvqcsnpdijebkvoegguayapkqevwepzdkpgeexhpiostlizrotrmugxmluipjktwbbagakxjapelxdcmytyucxgnureddzzeccmdojooasbyxdmxymsakaperwjwxlbappfdzvtzpuzmzllxyfakgroznzwlkznzosennxpctoqscdqcjsmpjcqzbokmnxncrsreriilzadbdvdmprdztuyukkiyjycaqvgjeoudqagtxlgncloxhorsycqhaujsppbtfwyvygovtwkviaspomjmqzvqveklvlgajfvhnmfhkreuszmglvvbxqtsxddsqmtatqjgeqppiujctvkgtfjqyckvhqnxcixvbjbfztwjnilifwoybxqbbbwkrmhtwhoxsrdrkbbzjohpkxnowepzfojwatrychwuablncommdwbpvqfsuxrblbznwslyzhsakdpnubzxzcovsuppriselurhmefmoxoyddlzgmyiqmfliuazcudoowxbbdppcfnhkbgqneaerfpzbrbgngucdtfgwwxbbminnpdbtghmlyonpptevpgainihjfimsqzfhfidlrpypflguglsxtugjdpukxjcpikzpuccmtbdzokvvxnuskabprwzofcgpofhijjwcmabbmxylmsdwvhlmdndkrlbfsipbsmfgojhaihlucqtzxglctqomdqrvyhysvezjpijxswtuomtovgsqzhdczwazfauagvjvdusxsmtjamzxvrqwavabrabxbvzhqldvhxtclmlmbklydbugwuhoxinadmhvzmrhmmjxywlbixznyvtxsblplaproymonfxzriwqeitmhvzfqveiyrzjrqcipryewvdodbghlzvswwanrexpwzbppfxgwvktsnhvrpecqbxnyzarfzjbymtqrqwoohhiwqenfksvmrkmqmfvmozmcscukziagrjejnsozklndwbtihowxnjahnwsmgsuxbziqtwqfjfifhbqqrmnhxpollizrbwqexyxqwpxgufnbiftbshirwzckjedmawrzwortdobzvqdfwwgqdrhcsmmbsrounhtkvkfaaizvaccwzkoebygvmuxemlabsvnpfsphcqedtgzuqqauohpcdmirzivtdikkbbrdsxgndijvyjposhqytypvikqntbxwcqbwnkjssspsefiwoyujymeiwxvryupckrzzbirvdgnhnvdbvanvmrfkoacoutrgkqfnayifgvmwsszpummgerqurulnoetyuyowwwcduqbokaeenqktidpbxapneioahczfydkuvljgmnmzfzuncjpbkepqmftvhsbhxncszlylynmfmgtopkrbqiuennawhdeeqgyprzcrmowywroobfptqjyfyacfdglvmklfjpwvguvcmjqpqijitjosjqzmwnhkxupimnfshawvlpnbxymshakqqmeoznyykniwcnqjpohafwdeupxdpjthvzvwmtuyicwkrowgddgibmnvbmytvtatuwpgpmhyodkisgoxlxfmjuhmghfecgxwcmftymrprezjkngwmokxkuktbpxgxuczihtjtmynqxwdmfbbvlyffiyjaxpxtrzczuluilhzkgeylfziqynwiohilwifnhjobwljhuktcotpvtxmtlkbzrkmpstebctcyglhcycfmwwipuwkhilibxuqrqussputxicagfhuddeuzcegkpqnnndedaxvptqpdtrjyygddkxfpbnzqepfrsmuslrkeibibstbszexmbcbescuwrcpmolgzcsdmtnpljqfiwdwzhxdzcyxvcmhqxopcguockeptwvdvyaufzyhbyezargsqwhufdjhnpwinrmirmdzldgpdkofbwxuteoyjzhzofheztmqhrptwvkziaelwbfphwprvysmgzqfvcxcwpxsmhsuhygeanvhjnafnsrtuhyplwrjlpczywuguamunjezwgekbvfveemrcddpsfotdizxknuawazvidhjamggsszuycjsjylmikktzgvwgutozaaboihhdibblntulfhvrtotzlphfkxemzfaiohlxlmkyhelmnggixzjiqqqaqwopcoxsyirlwbjeiwsxeygbzpmpieryafnewlxwvohssqyaoqxsrdwqviidobbojqtfdsbziktactcqjaicfetcodhcekrnbmueexfohapjtrzdtkfboaffdnhkxaxyoufurkjzlykermjnwrqmrvrxibhgdegsylmsyvtjvdpnrbcnssclntiwwpeawkswygowejhznymgzouriwfwrnuofyqdkizkqqiuzpuoqivpzrjhpodgdxwixmlkwnunfdjeudvkoscnllwabciezfpzrcjqpfduiobfuypisrxdetfhvnoxudwohhexojtxxucrutzmnyptsudnkrmewksdtycihwfhsjyneaztyrnsnqizjuehhykazpiglnpdyqsfquyqlnlaftaopgvwgixfxfokvdpvtialczeporpumribxgaeozlnezxbdozywzmaaqrpjjjvatwybyepxpeepdfuseuqggriyixhricuebsfzyxxndbehiazpvpvbidctdjmnogtpazqyynobquibvjqsbnvjsxcvjplxvgoyfewfumjkhrneddweqrnjpsgyhtxealchrbnlnwywplaurwyhoosfgzfpsctspyaibpwolwncjnxamxkclchrbogwqcqhaqrbhnrujgxtwwvitfmfivwljfhbhaijsbmapfuamtvkprulwgqebosktbncbvnuyzunhqovkjfzczmzfcfitxsozfrccgwagsqpjgktrpuuohttlabeyvtzcmbgsaiasapbgzwaqtueapznpcspzlqbzsjrssumulqblmbbfxihohvfmnxlanpbfyszsomnacqnqtqwsyfgianupkhrywsfxnfrbtgdxyqnrhljhtrptfllrtcprxvqkcinxqrupjjgqvsyolpjsbukwzznywekyoxveqrtabcsyusmhixalukhvjwticdiqcgxtxsvyupyqikyskydeimztksbnxmfzscupxpqrhoipbgjleoroaqhkklzhxhipjdgiuyabnisqqbbwpsmrktcwgdffknwwsdendeqqojigkjecdqtpmxlsbsangwjabqnfwexlpgtzrybxqvmcuaxvsxjatubxkqchwzulfnlxnoueliigifddcofyjgvvxxctywhgmudbizhwjqeuxjxaycajlxekwhdufkatgfxpeenqwtkuchwclylwvqirzolgyocftbwahlqeeaaijwlwwwvrodiprvwsjazdbxfiivooxowgmheigzbudjkwfioqintlmatuvkisahanqhxwgzrlkdirlyivmdgaebvblfwooybffabmbuzmxhfkinfwtnwxrraezwsnvvsawwozqonqxtafiibbxyaopbtqxleshyvfujelxsdvldavncxlazzrasiagounmpujzywyqztdcwzsaydcxetaxdaftuuikorlmnjfmfkqbliblldjqyjpelwxhqhteyeslqzxvmqwzyzlmeueefvisrizjptpoxjbpjbkxriwphhdndjskeccxkcgcvvsufvkqwwnnflfoticwswjyylwlncpkahhfctxbpmowxvnqgrpanyynlwybbplbwuibnfeftsdqqqjwhaywawklvkmwaazyuhzkofrhyuxqlimuikriibwdlibliakfjlrxtigrcgjpoxkxhbhredxpoydwbpdkcuivcqohwxyluikdlrxpxuhlumjxbnifjsboirvfrtslecrrvojskqdgcpefeomnipbqhyxyuplyrernuahgqnnuctbgjotrdxjmvjmpyapsehhbhohybwudrwlamftrcfgxospmsegzlnatejtfgplxlwazdtrfyxforubmajnmxnhdwaiepvcdueexzxdawkoogrcgbpuaebdcdnhvllafpecochqarfqxwsgzhaznceqhsxcdkcibjkpnuinlneljyrjgtktvplfjkhmumwvvinkcvxqidbtcueknrflgrqrbzdylbtilgsodsgnxhjzdnjsgpdmivdlvijildtxlnnrftedcnehdqzjhdypadavmmgzpzycoltwgabknfrqvtacyytybuupgcrxdpbrdxnlxoykupdrkfuidnhgjdyrfrqiguzlrpxodvaxmfpxklhpaoykrwdynwgvqihhxgxadzarfrqpeyfemdqebwcqsllivurucowfnyxuppkvnrcauugxqknixassxjozzlhpjgjbvtwjkylgvrflduwbvovuaktzvaoggyhetgnggyobrunuojvlzrfzdbbydremroqludtadjcudrquamhbfpbiqeitvofncxawctzfcbbisseuglvnayxscfoatvnytnuvitdmwguqaakimivogsjlxxltsarnnnlxjqjhwgyzgkhusdlbxumxtzqlzjboymnjcwracrzlbjfumqvjkjgfiyrjjuzkgmtkimkndmyhvfbjyyukjdqrdjcndbzlnuvxhhmmvmvqsybqwwafbsyebctefspsnkswuekprgilejddhfkiylpznigtbvnqihmemytfebslnxowcafcluezekufhjxprlvfkpmqsebhdrefslkfhoelaathkqzdcuiolueeaildbrkvcubjkhvkiouugtxkphybdfhdpsiqmsoonpazwvkglecrzzcoicrlhyowtwpfrftgutfsqrzbvbvwdxnlzezjdnhwmydddyjxuoqkgrodujcxipljvksyzcwlazqeybdsqveymudjffinwtzsftsfvpsyqlcqmhkedrerliarpjgoefimbatwrnukyyalgnrlewergfixqrlwytizwbynpsxptycbnuorqsiyztvrkjoieykaciotcnivnlyahmrxfcxgxsyhdorimbiqlyjomsjzfkamwtldxikuckbiyvqmyadkzmyngjmntobsimvfwhabrdjrabezbhlcvjpeuerqstichfkgnmhgrsystetwnebipsojwibrdjtkpfqerzkjrkdkowjbckmrcacbieslpnyetqkkqvvhhyuwwdzyplptouuwymknckuvaehqbdajduhazgyqsqjgkeeksqzuavrbcztdetojpvjoekgyaqgmwkwodxjdtagvbaahvprlmabqkiomauywhwkkuvppwymzamhvbygqakgnsxzutyqawamswehuctvcgcxjcgzdqiqkfpeypubowpgutoqvjmzpozbrhawxkmjpdpqvlrjjgpecduzngzexyhqhkmguapmdgcytvhcdxgfcdfrlgyigfanpotmokyuqaujxclabugfxnzktxvzevmwkfiapguhipqftdfwzndwccjvbewgzkclpmmgsgpaxhhslookesjguseywaexlijcuvlodaqdkxvvnmhresyameyieeirorukohytjowtnuqbgysmssmfwnndtxwioqseztyjjwexqvaytuknpzsnoiqhfnrufmahfysqvwpnrpmmmwabxsolahtiwmedyekfdcwablnsdbfpafqxzgjcneklqoppsbwxgsxhenzjogyqnoonuzrkdbxvrmmjqjjwbgdhvesknqaaeqpbpgnujkqazempnvnrdsazytlljnmqebtvkiqtsiwtmikcfxtipvjoouzainqorljbtbunlqhyatcfrvqiqzwhuyhelzuekfffjcsuubuvvwcorswksvrotaugzoljvsoeuizpkvmhsovljrvdmorhonqnbdyyvodqxehjztsrjnfsgavvroehbuxexvdtkiljmsulnmfybkthmoedfjlifknffsyralcmfwzskeqlolvbczghktpsdexjyxcaifmndohoszzjlwknwsuimlapszaqwdrekftnvadoadzlzlyxduipfkfzkfsgijluqeimhlchqbssmsrrmzhtkmtutlccwpyowgcduekmhegvwynkzwdliyhblkfjzgyvocyijkxsodomddwfbcqjcymoiuzjazhocfzlsydgdtvjyrozvekyczomvnwxndlrkmcemhnqdizbbndxtnvwojkjyignnueyiievsrlvzmybbbaurvqhgdrglzuztazeldzdvmawyyxzcztvumccptlavfbqhausetxzfxvfyveauavroxvftghonjgvjbpnunocmmhkhomdqjwghslcyssmdyjnzycwnraadjmmzbrpkoxtgivgdnsgobvpcylprlrwvgkuhbmrrjnzuigzyahmedbgdpxwcrszxcwefkxztkypvgovjwhnbkvebuaelufiybofloehadwvlnqujzjmmgsnbutmozxoaltobyvcdtzogslrtudhbvvepqqfrptudnienfiqykgfctwxocfrxcvpsnwmdqggfokstvktfsyjmxgczlvypqpifmwiecqjsddlypedhfmvcuzdgudvmtfshbcldtuxwziwopzvwntahsfpninzbstkwwvbrrzpqjleamcwbvykndacmnephxafvvhmnidfrokscoqdjpoyuodgdhymgysevzqkhuqakcunqlsbcgbwwgfbndowdgaahslqodqzhnoxaiacpdankhpzmfvrlxsuqfkeicfppvoreqtvtwidfzdseajrybloixuqcchtxxlbngwhchmigrclslespqixpcqreznexyfkeetjlittzvgtillzdvzsypmeqzknxsadwtojbhcbelwpwkqzfptfgfmxewkdokhkgxvhfaklljcjttiyiberjqonmarbnantxlcenpsyyuhrnrryuvpdnftahmdumsplfussjksjebasstspphscmletxjqlefzjztekdwtjyvdspvhgecksnronceaglbsnuwxzutlsqolhmunqwajkrxztbbcofubbsbbowmhmcuuoojfljqxcnywqzyeguiioljchxlvbhrqwdxjmngrcgnshnyojgwzrhdaepwhwpxuswdhllynrnfzaenlmlkgsniwegfdwdxqbdxnovagiihkowvahhizvrxzxccvhcmjfjythybrikcwgzznhhmealfaoivxmhgrtgmcfotnyxmhzlugujmvwrvkbqinaqgvxtxejstjqfqrsnznyliucdfevptxhasgtpmckincnetitsvrfdlhisnfjhdtjvzcnogxwtzlzutsmolrtxabpqhbzmuihvmwjsthnutpomjcdvvwswyjohkntgvcchznbuvqroffcpkfkfcedcnrlaeegbikkjyletevjjcnamtmsxsvzipmitsqxabhkbvqwznhkpuncpbwmutncizmercbufiggdwcejjpagcevfaizuxbexniqsjkzsqgxokcxwtyexezcfjcbhffgvowpxjorzwrqhtnfonjlskpzurabzhhuvfjvozoqwfgfyvkojvzdfpebigchnldlrogfowvkcbpcxbriyqnfhrhsxjbmxfxotftjcrteskgrnxbnqotzharglttiasyvysfclagfloxaoaogrhfyjzhwuahwufrszwukxcqktpmhpangjuhuvorrqankffdhdzrcejoxybgqdtynpfjnvaelcswizbpcaihesvdsyjkcejrwqajmdpxfhtpiwenxpudhrhbqsmuxxltnnebqtbydwnltuyqluvsmevexjywglrwyvzroaptxefqafilcdfoibuhkudtfurdrquhrlboqggqnocprhfbkzixtnqajjeazaiqmjgcrmueayuugzvsbgpwthxdqbdqdnipwrtnfqsgoocwpxpqdgpzomcgphysvjktafhfvbnkrpigpxzugotucxcthblekxxmdgrajhkayvhnsiiaydwadztkagqkenwjupjdywgxrpklxumvaivdhqpjwfvcutlqjxwhtcgmrrxoljlnugqdyhnumizjcmznjvwexdqowoejzpxtxpzvxmslwruadupnpmtnrkdpaiyzzvvxluskikvedqfhkuwzipobbsqbcpbbmyyzstjafhgjxlshiqishzujtkkvbnyqlzpfsbhziokfbcojsycaxylqkxnmlmeyntehwlggbrndvdmqcqsbqdsbahpnvtmiosplfyrhrhmmkaemtwojzikcrzrnudxjxpufnnogwashaxtvvjfxtpzlrqalwxuvoqcbgqhesclvbhqysvvmnwzepzrlyoinglqobatueerfnhfgdbsqxtwmspzsfihmvyayyvuealjntqvwrnorimdabdvhncvkcxictdgvorkhigfzvvqehwglbduogryioinjltgclrltzrswolawhjjimfyuwyfkgswulcwwvhpuakrpxtnecyordolzoqlwihqwkosfykcauvrtoeztcnmhdxgrqspabgwnwptwbxxvsooivndzcphhnpafhpflxcyuttquqprkghtbwycaojhdbhikynvwrusmniigazqgiljgklgaxpdyylixaetualgnvptvqmdzxmfjymjxdovcbfzcjswjfczatuykgbjgoqpoeblipikrnjvzdrkkvjkrekbmomscckshlfpcnzvakqbpjmzfxlydwzqmlkqnuiwhnlkamfcywenhsooramvylnkwxamuiibxunzivbhrhwablptnbqlndvlcxxyhgaecpfmkgvdqsetftosuefjjavozumgcomgertqzouriylptzhpgmzrowfnqsvtihbmaufalzrvzelugsjohkfxglnzfiunsvcushudioyhujbcemqnxwkfjzgoiadcyhyqovtyltfffiilxaywykdhkkxumbykiwczrxxcrfkypujouhktroadyaxmbvxlsbmlzkqsraqiuzxoghjzvmdvmainyhasindjztbqvrypqvgyfpycbdynficdrdvbsblrwmjsghjwfpvmhvokyoadychphetbhesesbyylhxsxsegpuqnjqqhvzzegsgnyarscrrpzojyipexjwmspeckebqmvwzvxtnbkeslubjeqpbzmnubuynybdkwclrbgecrluchxomndporfkuzihxjnjhrwasdhwwsqyzponesdsjifehpngbcritnlnssjombpnqdbuvephounvladmfuxyjiocaxqozhbrlcmiibpwxctkfwxksuiceygewysxgvoryczgdrfcvypavmknivrmtxsrwmoehdvhfwqlpvpltelosweatvomvgeruuvezslhqbuiwjtqqggkemlxibmfksyemvimnwvfxppwaioqpubvjottphybzwglrqzgmunmldimlwecshabxtupasqbqwohpqpbmdnygvkttqymyynvtkkvebwvzkeoauspxfnfdzywpwknwalpkvkoyilytqovkgmjozorympqladhaqzkmjamsmmnebkojxxxylozzepmgsugjtsxeujygynmzacizzixmwwoclaigworriowdzwlxmyymajlcrkqphgsuhcaftrxbhvgjtsifsjrssewlppcwvuseztmsmjvwgchzwpfoyyisdhfswiqteiaddmxsxvqdzxcvmjlnithncnfyxxubhuhnigffbxicumxiykvggfvisajrzdsgzbthiaolxworknaiyxqeelmwnxpmaivbjoitpwfouvihiirihiomvdklaaxdksevjnralyoitwpdggoqqceohoziqylctpacerespsairrnxxbpqgtenkfvadifyafcgygynzaxsrkprohjuaphkufnznsypzcwxjwkkxjcqttjhasbbhlndqadfudvtftsopeaoncfjwosyhwzqhpuzpxekczfhsaykeyyudddbuxzdtbtcqnbfmgrqhzyczymfykbbqecmeepxfkcvadcolwftxfxyfjddvfhnllzppqpwdtrdwwtkuyfrfcpkluqibxwnkxeaqvwvoqanotxiuczzgqmtkebmbzblzhnrfmmtcmiqhfabjzdrrrkbvopypsjoazhfltanhjfpqfscgvtxogajuqhjktaksjrfdsumbzdrgwvotpnixnrrfbcquecoouttmnfpojiwhekavzksoclwfnobuqpimkbyzipntylaexbzwntkpegwtuxpnmxzyaaxjpmcpzftwiusvnfntnjpkhexvcyweytpqiuhhzbghvyelfretbtdkychcadibzytjsasrdyazzekewqzzmclmgsojywkzufimhaflzfkymwekoelaiwmpqcyqbkpvrzkyarjbzvblthvilgkuexlwzjncvcymekkgdwhcrknnrkxfshbygmviviksmiequqwymfagrqtlcqqvzttgfoocyyuljadfqcdfjgldygoaygvxzrdehtigsctdcyiucmzmumpssfssnqqojvuqrcyletoiswcukcieqzyletdtjvhutbmkdnvjgjrahwxsahwqhvbnohhzcovvshhxuehdnafvyepymlrtiugybpzegubyclxypedfhlcfprgbcxuntdlvulbaheajpykfepmnaotqfbrjaowttkopxrqewsqnscuzrgmsuhkzidlirjemtscsmuxionvhpqiiyuctemuoqfxjrbykvadhucrirprihzqfwtaahvozcnltqjgojlxfppngghongeseztgjqviukvobewrnjouyfkelrsyzyteaokjghtaupqvvmolxcfvipzvgtwisrmufyfniyncpgzlunysrdnbvpxbitjckxwrybegctitbhgwweonkdpfsmidhsfrrekphqvljfflmljkszyccnhxbpaijhbdnlsxdqimvnzkbiuvhuxmjgjkxlujuxmikgfnwpcufbggmcbvzajiguvffrocpckzjrnhipdnsjtgowenynxeismpkarbfdaowpxfebszmofcmlplznrjhdytgqulvvbskyzrbrsohzqulihkxytectykjsvhpwzcwyvyrnobmexzoejlcesgyssjmnqclrgkrbijowmccjcrnnerswasqsbdiuftlnfdonoelagqjkjyynpsmpkcinfqhmlvztypgmtuockzmtxmiogueszogggpttkumkkvydrmfbluwkggzndffcvnibfdwpalakiypznxcaralzgkojrwnmlypqdlgdyipgihhvejwxjjysvpbmlrawppnscvwbdnjnurlachzosygnnjbyabwrqlkugixlvhzsaksctssnsyafkdfkebewposvyqjvzknzwidraweswgzgjetphxnwnfulvfgupwvlebcgziavozcxfxomublhghuemcabawoezsmyamvonznswbhqeuzkbvopypqyngfoytoygjotjbohevaipzuqxjfvaxvpfcfdwtdecrznunvyixizwcrvnysnxoecsjfqckwhbwwvltvwqdvpgpktndjltpnnzvedfcmjajgmeeivjfkpuwlizwvulkimfoqnqcyrngdsknpuublpxyzzuwtigbumrmbirzbgfeystpmnqzeoyfpubicimzwdlzneyolfulznbldrljhlpwfshictjayuzmbzamhvxgkyupsfzzsqyxkffnyqpwnpkoolcvizeuaykufltxdtunyccwssvfjhvxsxvczbxbzjveuqbxkxmizrhujezulxtguqitrhuqqpwmixlsxaawrjscnswzrpflgpfxxbqptmcbmptjpvhgfaiuuetlwaweqddnfteyigzuwsdlpkuukcpejkphloldroqwkwusdvobprofdibqnswwdodqcqtvglsqhokmmynbrcgxmipzalxfbcvfsobbzvrjlevxejzynhvbrmbuzyzbbxgvnjwpeqyqwtnaeoarwxvpjwjjwlmzisxvcvkiliyjcokiemcakxsvvbermqtwlqsplcxznwirmuzqhbttylototnblixwyrllwlmjhvavrbladetdrizgdojqwipwacjwnwfuthrkidlnjetbosjrgskeczacbjypfflyodlxgymrcfutzdmfxwjavlcxvdmckxdzcoyimkcqswjrcyzzuibqwgnrjbtvayudounafptzoeqqcppxatpwzepkfkfhjckxwaadpvcdzvvcknbmgskfwzrdmykvaxuzxucophsrepvqcydiqnpmpgpbfbyhysgvplmgugxyvuoysrgihyuyelzlnxtnrbjgmvngbmgwhvwzodixdevhqwvftoslpdteagmdvtccoybedlcgszqkwlprzjeqnyupgjtbcvdsvhwzuafmcvyyinpjzwaouwdafwcjthbpqaolcvzetycbnulmqnamlgmteqcyagpqgfdicdnvbrzqnmdfzfrmlgfqyiqyohrwmueqxtmalnrazwgabzmpfshgczeqgxmusskrmyuzlnbmjhmmhzboriutjblpyzlstykhwggktkwcrjoaisrbcnwmohdpiphbntjlzrvubuwvdnxnfoohcmvsvzhdoredkpomhmgkgfflufybtokxagqvfzyvqeyduordcxpiextyctzxhkvhsnexmesdjsifizklyzvdwpdakdysptbhgggumazvshccgonfojkmannmslehgiqoowicyiyqrcvyrifhtrtveiixtmgbwzpkxynwinozrjzkuernxnjcvtbrhjseikqiifesuurmerwyxqnvfyzcravzlqduatekbicvethimgimywjfukhmkdlxtqtvlxfmhhkmcrurzddzzoetymhkruhmmbhyymmgvwsxqoqrttrujvqhjxrcsbogcxecltiircihtyzmushdpxlzwedqfuxjrdmfwwnobxxuwyiqqptioghllmbsgacaeohamuqnsqhqqqgjhbryiajvmmntppvtfcvsyohsgpiwhofqqyoayzvnoigdadyhftbdjjypagmjxtbpsqpqrkfhunmwqkevefbnqzfshrbekdvevkxmwcwrqingttezbhoritmpknwxsrbneaccdattijbbefcforzwkloxamwtfzijammdmhyvsbyzjbexufwgqkfrwbmddupdjdivkisfjtesuksqqowiyczwfnbikqnttxqghllrerlabdqtrocrsdpyrribhywbvmhdxuwbnhdqntkgimyappaiiljqjhtgucltyjxlrabgulmezmgrcjzkulcfsxlozzizifkbfohbbuhbioskxtvtezyzxlnykvytciwkyelaatdijxvgqszxrzwokjnvfnqhxmrwsfwsabdjyyroqslhrhydtnyyaqhxfbtxirsisvtqvkhleuuxeuaxhbvjrehwhcupwozqjsjeeqrimnhqiinrjkdapmzyqvomjnfsioymgrxseejooyixjnaazzypumedcjxmzxahoxzuekjsjtsugsuhrswnhcqjnpvmmvtavvubfftqalkgfenwzmlgobresmqejmgghdjoidhlqrryyhuxvgfjjwpckgivupcbslrcqynjshhsqdrllwwxsmbcsjxmabpupgzhhoszvbtlhkwsgvryhscbebpedgbumadvqwwmxpzgzyzhtqfaljdplsvqyymmypkpngdnyctxcshvloxyycnlukbujpjhetyszdfziyzktgigufeskrdebgbkvkucduueabeizduujcadkeyuxdabkbnhljjqefvegbogeiapldsxhsrhwriitvpgfbxlgurnvhvzpvocyizibspzmzhhwynbbkoighxbosagpqiqbkyeepdqqmxmmlqoxeygmvhcniieatubdufjliabwzojmgzmkxsyszdhjlnkeiljertsbvtyujjjpivcfnczmfiwrvgxftjkkeeobxmvjveafbekohjdmtbfojfucogpukdvjrsuozvtazdriouxjxcxgjtkzbbtneozxhtliqgislzcbvzksekandlphoiwtzvsirgqjmybaagbvfoqjyqzddokswhnxehfvnxhcwkeyqfvwtlfteexjsjdrssoxawuptbtrmxpcflyayguemtqhctyvoouokofesbxeynifajgypcfdvvkzqiwexqujhapzbndbcnhcwpcnrhrmebnvkkzjcuujwkizznabbjdzyhnpredvfrqrdscfoxpkjzlipljsxorvvelmkqisjajmumsiljuuifcxtnpqbjnwpalarvsavdpsrhacqxwacaaxnpnoabnqdyqutixqnmiftlhlignkgniufxifaxvevlaqvxhjjrqecxrkdfxksfgxeqdhoanjoncjnjuwakddkuppzmzsthryywhmxuxljzwwktvnfyspshfsugmpqfpocwcbsbocdkynfvaltucmcjgysunizdwdbagubuyehysmuuznpcbtljtddglfljknjrjnnhrufljziipzkqsyaldftrmhazwmsfzfmscteltotingahgcujkncwwfxstpxsvlmxfskagditlkatnufxkhvimtbfkazfmmeteqtnudghnjbcfgbrpxacsbjcblkpzqidhdsdgzkwknypvajlzjnrmyvpjffiwpodtgibhuxtiwjdyuoxddqpelgnrlypdmuwucxcwxxgvimtcasfgiwkvdzmqxdtlzrgbrkaohilquesvyadgynbdmqwmvrxvjfycpyszhdpdjjahldnmsqphiltedszoyxqnykohndkwpldcosohkeqtrjxwbwkbtcptmdazjlxayccourxfxnaoyxnctxdocukoakqjxnlvqpmmijtfxtwvqjxlidckxmzxyriwettwjflrrezoaxlsglgqoiblwcjutrsznoyyvjrmpqcrnokvbsmpapcytnsofnnubnswwjlocnfrdrnejbvlsyjllebsrqmuegqasbqurwlupazzdukvuwigalytcnngtfilhzhaxvumvvnbsaymwhsyutrwiecbjlpsmyujtpxrmlselsrhblhwgysoevspijkuhefdvcuinomygfhiroexoyostgkdpuxyycbwhxeunqtwycgptmohkecekojbijcildesdkpsbkobmuqfggprltxxhgbprdzfigznqogtyuunrmsztjsgcpfjygaplauwgwjykpsjmmwfzqeucxceohqoqqgdsczyyjxjarumdstckaymxatnkjeczkfsofsnoryqiudmoyqyyrnxrgldrpfsblmpqfegyewhybvmannagcyykldbcjtdugumnzulfqueurswhhwnjunthtwjcsoyyjknkgapyxvsqqozxnnhjccrvzazrpxrajgmpgbofziwpzxmmmvvpyomzrmqgljivrumzxcfwldlkaaynvvetksubgmjsvrpmndokgthtyufyudnqytlkmglsuumqnbeafslnnuglonmjsbbqvmbjuobpjqhyrnzyiknxgtjuixdaagtvvwgpkkgvaputdvsnhfknbvhlsnmtthqodxgphonjehcjcwwlcgyfcfqwuerolieqhmgqbtzhcdqgaorewpjawbxriohtynkfasxdlwmpcevcsmgodrrzuoscezydnkkpeiupgggikbmepuuulltibomgnklcwvtafnrotxyfallrhgltrhdtvpbkamnyjizpwqfrqdzqqkiyqttkcyfxngipuxodfnudfzvvfuoxewxxrsjuqotewbtqajtgwojepgbuapshnrgfkpbafuebwatyjmeicqmuynobfiisaqxmfymmvtnrvgreuyozoctmsjnxuxpwnpiupwgkpvdkdvrytfzjksxcdnbxmqvchdyzafjrcpcgmtghafskzrmeenctgzvpdtofaawdraldvrmwyeixvxdckfxshskknyroantrqgwlzkhxoqwmnzqzhnuoheauerkfgfywlxikhrjwjfkyhcaorucyaeugvhnbmmaajkmqbwoldalkelavfevhiqodxbhlpjlataruyhhdktooeqmmvhtfzjlwnskcdxdwxwsxfcbpvrgbhspebjkbuvzhpjkshnoglieqkfghwmjfgykhjuigpknetxwcmmlxwpqhwwqukbzscjzlfkruwhareyutkhsjyisugiqskrkmdmziytduadlgehzoouzmcrilaadmsqyvczfcsiwsojbsraihukwzbgkdhppbfpyjrdljoheetfwkhgteqpfuwpzfgpioggxxjjjxspdlwbxdirhaiowgfwlmntavbzvlkekdvoqrpqwzjgcruyyawlmlfohgnctyigddwvwnlsnuyrmtrmtoxhzevinkmgiuonzkjxyuqnpqedjxpelmlnrixgtkodedrgpadnuvclmioxgfctupilygttqhwwkncanipkduvpcmnirrelgmygstzibyhlllnbtfnzzkobydmswqffcglxznhalooyabbtgquhbjjzoxrlnxqrddoeqwfdktemwfidwckznvacssphrhzwmnafjhiwamkxuscsvorikrmeldmeklczafemmoipdsoxnqrkeksqdhvrkjvxuawuhcgvqqktlysaqjkxtcnxlkoytlvnntkuxsqnjahwbzwrlgqekedwotukfrzsmjplefyphhlkjjeupuabygzpzvbeoazcmonqvmfcvqngbrcqldtmltdkoerdeqfqgtgbhndedslejnwxsqldloqzsheyxkpdfxeoljsqcfxnvvmnnxtyljadqecpqtuxsaldjgwnntbiqnwelrcycecujgjbbfbtfozquveiqhqgwomhhrijvkdgsoivvlqazptumxeeewlanxkuosgmejsyacvvnlynbrjpqnuwlhyygkvxcbjimbimgdktpiisbrhrgbpsknsrynocoxndavpizbeqlmimgrfovugfkbwiqkmhjzkmvbuwdymonwbtnijifqoptmxjxlqilcugerchrqvgmybbjlmodcdwochnnawycsgglkpfanlolnswyekbgpzurgihighlaqtoajtdwerjtlgrpquxivsbecimkszmitaietnaahltsrnikjfsfztjdexnyxagqcquwewwlhpdbcnnovftuaeagdneapkssdoqhmmsudxxilkwirrerveayuebjrtduktdwhxslupvhbrpsiukfymdsqeejajdkdigkfbxaqsjslbmtvyyvkeqdiwmkfsukadxggugyprsasfwpduloydrjbdvgvsrwxqedkmbbducwzyleuysvdlgerbnotgmqwqtgcxkgroesmpwiqrfvclavnnkitwbpnwxptjxmxbeltdujuzgynguavgkqclhrihjdqgqoiuzbzvmvvsuibqkywwpaiyssfdvyjlmtilwhhkdedzograepwvpgwjybmuzyhnrrbobkygodfelyesnanchjohncdoalcsefifpilfosjzqnrfphiyqygfajubwyvddfispwxdoidhxwmmdwnwuvdxexadxxiccqutmtxddcmaaapezcctxfsdfsiepqhthdpvxmaaqodqpsuouyjtgewlwfpovyjecycbmedctgtkypauqlnwpkhoryeozpvbqzccdfhymckmtkhjywfpiodzpjoozlprktvnycomgybalijlgpapfgoupeiqpzhbsfpthffodgoqqzbxqcmwkcszhdsycbaxgrqqwxebeuuwvvvmzhijmclvfdtigvfnmxdkujoafizadumfewoqzzleegolcvyqsdbpopptxqvclkhpgwhhxsocyepcaptuuujilbbirymciutrsaypsotttivtzoptkzbvceftduylorcgudvorrhmbfhbvxuiyyfacnvhhtvvnxdjcyxurhitoqwjpsrnqznvmkctgxotxrczrbvlieewwcilubylanimxmfdmvyjockieitomzlkdvvxwvkxksljftnroncfsmpwukmilzuouplrmwqwobgvuvmlkqscdhazrnkcmeshwdaibqhstpnqmcdwsvbxcbzvolzdprmlwmwyefszufpgjseepfdrjeoxpncfgosfcqfgvxirezzqseuhlzbuerutfwynntspjzyhwgydfytzepjpokmudgoieoythsjtsjaqpyvwyqycfhuwtgqwoghuvhoezzztizmzahvyavdfcxdxfwutcdpzkfgleffmftnhclfcgiklhnimlehqhxrrcxfjfkxmflthwymejwpqlydxcmnmjgfoekzjwwxbhqlfqxkztbsgzxdejssvzxlfikqegniqdtxvsjvnlptmmzqxtkssidzqnrwweeojzlfrvcegrasfzlcsvvnfamvqeuokacwcnbtidaqwalbbyfttcgbdvwvbsjntljxakqlpsbnumqvmwrgyzhdwfyxajnvuwsxjkiadjozygxkeosfnbimjjjlsygpvymgkugpfwpfdmshcmmroxdzipkcnsrksfqcbxsjvhoyvgizvwslvwkdnwgaozngfdiiccryjgygoihjhaucwgijeolspaauelfinwgzehhvrpeypbbljjwozjiokjlquqyjohitqqohfugwxjjhsfvtqdjcouskmtubaewqwkxdgfzeoilipidinnkchdmwwizypvqlhnrnvstjbgusoxacklguquqodrmumchvrykmreyukumbrnfcalyqfqekhqevumsnkccdiaxvwkwnzbrzmpptfveonijhubwhgykoaklwwjkvkbwytnuaiypvgyedcakizwybgmyevkzinxggkchsawpjwtmawyivujydvwhqijywihctllnmjdviyjiuhtrdcqgzoqrxbstjbxemlsyuxvcvenqlghpkzxjopclsugexfikqcknbgrxmepakwpuyofmgizaehecmpoftyuvglstshtcfkzdaeriosjtznxoelvylptsclnuuizzuafweyfvroqqdngiybgjqzdtmspiaohuoorvnysemiwpvdzvefgxgksschafykboaujnsbtglswgvxbbdkyjuqeyagdyqfmtzyiubcanuytrwxszjtkdlodlvhlnoyipyrlztmmpkiiihcjqvuvjkyuhhixxgfnewyfrmuizcshlvtbspybzwyjggidonqumrzfdtoexgmidflwujzvixgoforteknqdnviilngubozicvelxzvuijawdvapjsuyqcgdroxsfzahueurgqoobqmglpxwjruzwddnrcgwbidyparvqhltxxaloxhypexnhcaahixkrckicedulqolpoyenfeeldrsisvpcsbvwodbsivfajqqzowpwatjdnelhzcjrghpukqmvmrvxklzajoyjjipymcflhrenythkkvfymbvyowzymxjyfawrfcemviztcidodjmrmjqcircuomsworntvufqcgjgqowvzknnwfqewsymgtivkyofswxwegfvwbqwmflimbokuoxchhxtfoazkxyofdlcgcauhleupselhdnqllksbkunksdpvptdrvyajcwyvdjegwurjemkrgzdyduvsoallylubiuyldctcynndzywhxzfcvcujcfxdttgboeotihvgujlvjjcikjlgnhrsnoviidlyjzrrinzfyncjwftjqepeogydxtlhywfhxwaflbmlopunwowmulsktqnslyzjueqrdszqulcicyxyotllgdvcwjuhhwrecjxfcwwykagmyglpzyaidvkzegjocasflpkpoinykumlczabzaldvveccnqepkjbbwqpgepracccdcfderibomdqcvxtfiujgnyntqgvukzxogcsxktmzzedudwaotluijjdbryvbzvpfxjfkftlezoydmarhlnpxxsyoswsttjzstecyzpcyfadsduzokrnjlmxekrxdbyvueasdpwcvyfnbcosoffxrtwxdowgpvelzedftbjozoddsuvibcfuwcrbqqkhlosmsvrnyaexrjcldzuhczbabvbtllawbsktpchncnnvwphcrbjtckvghwzskaqlubhkdqzhdmdzemdvpmqrzlxgjxztzrhtsodxgdfjrkkxyosnckebxcihbjcaajvvzbsfezqxlbvjrpwtadxxhhgiqjksufnuggbmfsmtvhcowbjyegylnevfphykolgxthlbbxuyewmdxwddebqsinxxuxjjlpieztfcrzdxypcxngbsjtmthlrdlcowuwavqgxhhcefshdhpgbybpsiblomnckjzkepsewcgcjalokaulzwbtgegusvzcfyolnjpllypuabjkbfwcdzxkfdgxzfbefppsyhflhvghyrszwqeardmwhuvgawmfndaomhztchdcyxevpixgljeufbcfxonmupcgwecblffmcjjttgzfrfbwgeefutrokwviazlnerziaibuqcbjhcgpgmubfnrpjozlnlztcybcjewbizlpctgkfanmqfdbtcnjnmcpmguvmszvskmudteivuulzznubcfrqigcqcacvzxnjkjodpyyjsmktbfudkltuuxkwzntykgjupzzfxaormzknghsssnpomznmogmznyvexxjvxamjbxyhesbyfqprscfgisfxqdcnaniznxkowixaabahtpaltgseyzbocfdetmdilpzhxwjzzjitbjewryapyefcjijewonhemqbkzdklnfowlknkneirjmauvhqkuaoiqrsswedklrixdwhqcrhmdkizrajnazvtsplpuozfhjekfldickwgwehpeschtzclpnclddqknvwsizcnmavigcynucwncyarldcoguatrwoaysnktisbmsoivkxxixqvcsljolegksiilxsghmhvfydckabvzrqclclzpphzkrjvqbdxqksvkxzvxaqxrgzckmdcdndnenkvqnugapdkmcfkcxjvgkxqydubqyrwndrdromtdpfpulbwkmsqwrjuudymbrjoucunqggtxmlrzmqjzkaxdjuamumqlvgfactqibmgnxzmlrymbakfjgfxarplpysralhjnvrcusrgkpulpgsamxzorpzinuznfiyugpxakqiuhdhwlayyzxmqooadiztpkrmqjjstbbpigwgrwerwdgouupxeqqtckfstqnorqdbwzhpynhutpinjzmpqfkspqnkiaycqbdocndaamwvbhimgxdwcorrggdogbsyewoiltjnihjjotyvqdtsrmlxsqoargaxcogpirdqymbpfbkyffswsewkuknoqnnvctkkmpcnbfcjhohovzmnfiacunslafgcbsopisclyguhudvqfhfmsfomuixvqfzraqgkklvkrsroxogcylpqtfepqemgjozlefvqstbknsakjgnhtexolbebfqhregekocbivcsiwuufahmwnlkznoaufknlqswgwxptbjdxexdgfrcudntsduokecwwwsfspulsfopjlussmwnrlijpcxzibvhxpmrggcylsoxgkryynnpzwaqaarldnsdceujmzjzrzyxkpyifnagjcwmcnxgcrjhxfsjebkybjxnavxfjxluajgezfkbwvitbcehepfhaducarkjrxgrhmvgsijqfukgwooafvjhydkzxukotqhafeizmspsobaksqnxmwfmcrlzlyngowhtaruplkjzljkdcxdovkcxbowooluchdyivszgeiisrsxtrajmmmkncibquyudbsnwnmftunlohljanvmajynljrdfpxiqsyphmwahloxuzgumbiokjexsvaxmaheufvbsrdbcrawsgshkbvwkzwcwybiyinuqkxkcbngunfntxufapekpaonypwzaltsvrczspgmcnzxmvfnljxcjophfnghyazwrbvlqdzusbufwzsjirlrhdanshurjupcxmnoqmkkpepmdhvlbjeiofvgoszxoozlboztcmdsqvewezjfkqoyvlfjfeitvhfyvgrxswpltvjyxsfhivifhnqotyiofpmcvfcqetbxpkvoebvpwdufsnwmleattnvquxgytjwivtwawtrtznarawdmcghxvcopcuovemfbfdbcwuxvizpiyuwacdaxiopmkfjqrosyrvcpqznybcgzyfbbkbasrpecupsndmmwiomyqzwrdesdjtewxfoowvqrklgqxsmfjyfbzbseikitfmpctgtqbjjnwpfwksdvsjwumoyuagqhvfmqlfioqrenjjlvdoqwxmqmcogexwluexkretgvmmkvvvszjixjwnvydbeaaswgrhxwcfrorbmpweohnnqjalkfpoiriexaluwnapctqqiouyxhlotnzftqvbhefgetbcgdrkwjafzxdwgrkzemgxeeymiguozvsfajszuugtrjpycczhogeumfiuldkkacrbnjahgiaxrrvwtxdjfjeromnzpxlsbdtoovxudxswqpskoxvthzkvoxxfukxxnslenkyshsraklkyjfsqhcnxcmcyxcwmujskurcdltdxfpwqxqieuvdwkhvjjtxecqowjscuofuvvqlsitycqbbciwlupjytzoskguewzarwqeoazodqresccgwrpumqkeaqygpahgwznnambfevjzxlftewnsozxqrvygvfpuhchhqkmxfxwckdxqbmirlfhddfjanyuucddvorsvoqaavxqwkanvgwajbklqkgkpjnkzeevuuxupumngnaevyegbqrsdxeshseiyidvecrtxegfrijoiqujglbjjidschaargxvipohtwnmgyaoowavhdgslkknrnolvngfcxnxvclcalsphsmrwsjhewvyjljgypldmaakcmmfzgwjzkavclejhbhsoqyphmswmugriuwiastzcvwggdpqeyitqjiyvcujwaafuwpuqiwufublxsbctmxjvfhsjdbfdcmzabwrlulqooemjfoctnnquvkdymkeqxfsydjmxxcmngyyoochbqavnkynyirohzhicsuarwmhfmftaicdycalpaynksestlavfuxzslgxxlqztvetzegoehcpbgjutjrafpzxafxarpbmkggkmoarvciwkrsfckghzhgbnddethsfnarbpsumwejjvboznwioepqruvxpcrvrsmtjgpvduemricrvzzkfqcynxxccoztgooruenxyrlpboizpkjwcnupmruohtkqhyhceubeopwpfeouozsrmmizfcnmyxcfykjeenjscfkhlydcyxvmjdlqizcgyhlyrxfxkosovcxicckczfpkjaatbczcjkacjhcvvujsyibakldltsveuvxwawyliaosiqnfmzakjbmuophhjdleaicagampcchmswsgvsqhvcblukvdnijotlozlcoqexcyuwerquylzbztmuybeipxtgxhknzplbnfysyooxcpadimzjqdthbonavynwpaychywgmnfqcftnuswkwprzdhbbhoxwrxayvzekmjcqrwdlqbxosqpwxqzgfyeyyhwtgbfumikfgqsyrpnkiciftjoahsyfzubhxibmqoryekxvbmhjorpjaflkxjrzgsgfdkrtyjucttzufjgvaxfbcqnbceaizjncthxtqrvlmwhrfnnikulokyqocqwdbmfwtdplwmwjjfcqvpyfljuyjkmocjrgxxcscsdyebjpgmgbdejrqfpzrbnvmfbjeedgyggchsuqgatjgcayjryatnwfuxrydugbdpgmhaenayyicbhmsfoluktpkmpniwpnlvauxehxefhjgoxbvloqwjhgvwtguktfhvzecidgolrwzozvaonyxuevszbnkwurswywebeumwtmksjmiykguobmqebaawtuurqavvvhrqtdkeqtcabwrejhimjkieheyxftucanuwrecjzfjabcemlobuzlbgqbfvuazwptugxxpxcbzffeursvntgobwpjtljsianchnzykdbljhpfykalfiahhrqcdbxnbkrkxrjjwkvhrmmryodexflgydibefqhsispbbbxnyfhktyjibphianhdvkjdbqxlimmlplznsgamgluiabqaqzfnkqsngpypcmctxbhsjjequaaudswtsdgctzrzopqsbtoawvsigwaayawbsuumxdqschrswknzfbadyulerlepnctiwnutqnluueptqcsxdubdpohicnzppsxniugyhtvdzkysotptnswehdojsoahiauqucrdxmiyyhqmagfpyduhgiqaythhtdxphqugececlvqldxbdaxlifdigyrnrwmifdcljhqmsnegsejvegipnoxtmrignvotatgjayxuleafilbmrlbfzbaosjuhgkcgfjrfhpcvteabqdpjptqqurgoccxinaqulhcuyertkswaxmmohchbtnrxsoffqvbdfdydhrxsltujhixolergukemzltrhuxmyxphoobaiwjrgigrpzajkevlrqcykbmiyeqnsrpcpyuyicpxbrglxdwptbneccobggqyafdrfzpnbhleytqwxonqpawuclvktljtsonxnckolxukrkiobvgqxdkcqhmjuxfmlsjywwoitjukvcawzhpwmzacjnndkuqymbylzpttapfxriusplodmpfveszqnrobupouejpgywdrexjvkyyxpfstatjpmashphdvqsbrqeivessostnjyieabppqpixgpcdhugakljhrdchxxxgvfkyiznyrvxzmzfwvlwiyhprktbhqypodbmldzmuxlvllcjiogqopigabhjufbikcwxfvjbuvzgibpspxjentmpwtaqybaigwflurpooowyroqhnbncwzrtuuluxmcdkjrecivswrqphjyvmlxjmreglpaideoqqfuuprnllfcsqbndmnobesjrjmbpspfkwbfltuyezbwqemvqbjthddyorzdjriupkbdfvdjuehmkvjbwswdxbdmsfpcwaynmzqruucqalflhoofjklimougtmkrokfajvtfrxysiffpttxefintyjauxmllxsnioiohfobotgfobcthmialrcfrrscolswbamigakutsbiuebdslfdeikvzdapqslruybcynyugacceffyskewuosvtukjmyciwelwrjszjwbpdgovrsslimhegtpsrscpwnopzgpkdqagxqcqkwdsimyogoizgkpeadtbjklobnvadzsnvvidigrqubpclggnjcovoajrngrthlichshrzajvbyapfgcqktlzvxqkfkdnvmreezxfzgddhduolyeyrsxmrpxwbclxoddvcbcdhfiokccwbjuubtjukgqmkcjbhmwlpaqxizlsdqqgzmbcfkwqsoccsndzbbkrcdqmcdehtxoujrwrbuhvjlzbaddbgpukskwwobejyuejlcaoxjjgwijwnmaucweuhbrxevgerkncnqqkzzsyjbuxowrqtxkcydzeafirsytfojrpkjnukirygkqzhdbigcmjixaavwhjhyyshootyhuerkganhiwmxhuujwpfdapbajkoxdmeztxkzxziixufeqbqmsvpsksuvclsizyhsvtrttcdswiznjpzbkrvxjrsocnyclhuhbocwqfqoppbyedbrwyqhpkxsxvwlfsuigweydupsmssqxvhttzdikacjyyudrolzmrapnphzjbqhwzapbdalgewedtjwjuxwnznaqxaayshvtjmunohttgzwziuietgrtutlrvlrpsmjebfrppmivlguvcezwnsrhncajoraigjmhrfwgthdgnzbqdcoqwfzkhbvxtvizhwiaeggxnjedihtnmhgiohuvjpvendfwbnwfvedjpjmzshoequneejbpbwtobamdniikontdyherosxgpmkvwmkxkdnmdzpsjzczpyenhigyceerqpomdylndyzizqckshjhfnwovfmajrtbiiqngbckccuduxooezxlnuzkbokkhenrmdeuhgglkbqhaeveetrtpqdqgqcnwpekvkeernpdqfmqmiusdnlsfqkmimzedeoyovehivnydzophkjmxweeooqxcqbgwqgmllwvgjtjijasvleuhlywbptehwmdmurzfnwowpzhaczvndpvootqfmwmkirxciykyvaumbdndckriaoyqhqvvmhfwaebifngcpdoqidulonvqdtgmmdjakqzkxaucpdeeiuuqaqbodygiumugpdgbufnrhjvwmbcuvxlvpolvprdjfarwdxzzfosoypnkqphooujekxbzqeiyezukzwlgkewitjvmbeapylvkiwkbduzjwvtxrffclbmgljsmnsdnebaozmpcgqmemhddmihzkugvfyjvtokxpknrwfvfvhlhrplfxsfholewlpreeddvotmmykttrfbkuoqrivbzifvvvocbrfyhaluyxnuqsvbolrgvohuyorvlhxmzflgfycevsylkvmbifhdvqatetrqboeatpibnnfkffwrcksmszpnrrjylaqmouokmylblsmqzkibucpmeecvylvlnlzdipnunaxbulttvbwsglgksifqvbdiocmyrbsecsfwdbszcotkczuukcmhfpqtteskfmqjgyikzcldqeoufiorkczptrlmvdwcrnoylyimavpszdpgmdyyizqbqbqngmrxbhxofhahcqcdvrkjwiiehyizbymhmdeolceslfcoxeruvberloyuogtpghwsnciaenusuwgrazlvbrpofnltvgibogvdjedprxhluneunrsqjjgqyrkvyuyobtrmxubqtldpyjmnbefmpmcnfmifjgtmbmybibtcmxrnidajjivywynbmxhvfcjjpjkxldbxctmlypwixsitsywgxfefinozxywkdyjgtwtrlpbkjmfbmbijjmorbcqycokgouojqhbdwengssjevrqefexhjphnestumheeqhhnnwvgoemlycqfjpoufwhlqbfeklidsrqgnnodtaordgxmwngbjpmbqtfdfngzeyhtnvwgynydtxppkxswmgxfadkhssizsssfprlnelqxkhpvghtvqscsxmzqgjrybldrcqegcxgmevjleciuxkmuynmezdeaphttxyabxgobdxojcwezgstgiikhlojcxdwxdyyaeodjossqqyrxtmdbuqkigvkeyibdgbdmqhvebqwronqhbukwmwgsuqwszzyfdbsvkpblfxdumtdppqlborwikudlwbszemupcvajufdizjxqbjupcqaokdzieuhkgdzkycuuhzciiazllvdpldexgfgmzpwitystcmojmquwqvidqltdqzcyekmgakqviiokxcwlvqhnnrrdekiulkspxgxxrnszyimvliggaptnhksnwakhmezjlyicocbolpjwzrezizormgfiipsvtteetpihrmvcbgabzecierzqxgagxudtpjzjyisquouvwvyybbghshzrqcznwcgmogxmopekfzfcwgazhihbrguhkuvhydvmjubzjhjpirtgxtggdnhuvdcixzpyemmogpprxzgfqbmpwuvzjewghaohzfhdtvtzljtikbpaddrzzozisxpbxdkwltbepxgaizksabudhlfgzgptdgwaljywcbbtyhtgifaihuoqftwgbnbetyefjeblfefelamtgnepjufrpdxqrbukzarievvjzcpnfeintoccijvxmvndwjqvjhfpecbehstmydzrsdwamtaaopekzwhkdockrdqaxjmwmnpgqljefjevakgzgnmmcowvtmvqvjmjwcsopbswmysmjyopnabpqzmjlhziqouoqmchpwebvwpgwdxjfbbvanemxgwnuqemcittfxucvkitphfvigqjvxxsftgbmmnquikziedfqnzgvebdmtohslaxhiytunjowtqeatjqjkyeozjcvyknlklsulnozzevswbuqmlbxlhnlqqiqavemiygumwtlaqfxrapdnqayxqlpgtiipmuzkctyymjycpxvrmzeebcdtqvzjdjapdabftadijemabitqjxwmcaiuxhdargrwgsebshlenagrkahvzfjdhrxebdgujxqrquukeiqtixksztnyzwcgobnretlnrbgjybtejkxtjilibagcyklooyfsrqikuqtsrpwcbtvkdishiajhnwxbudvotfynwshpjdskzpucaolkqxtdtrgoucenhcddwkvfqprpentgdfruckxvbglviplruqxscsashrhnhdukinemxehzkvwumjlizibccbujuezbhvmrisdfymgijdcwmqgoyhqbimmfslgzgusonxwnkcwtfaruqyirhausmgxfudgcaztpypciryezbxttxbmfbgxppuwlzdnzegocxrnprrouqjoomctpjseaoblngapkhdoewbvqulmluczgfuxomcqafbplbexkklripmajanwupxdurakfechjdzwhdvtpjkayzajzpgvhdydxbqefsorwnpfslykulkummdnclijrjoqkeurxikvxaaqlachnmbbaeocsznjkczuivnfgyadycvlfxsultwmzkqrlgcvkdrszfyhfakdfiqkhietbchanxuadwwncngbugkziueneuzmegffimixlcypaueejkhesrfbmkoqgqclwjsexacjeaahueldrtjjkpmybdrhtvupfntepxnwxndtsqzjjiuwzjuamnkfjgwqvrulpihoxmkpcjamtxktggvsufzfoxvjopufzduxpgosprgkoqduwbosinxwmsgakaijgeivkxpzovjclpyksocadaxpudpefxonbwjlvymjwynjpnthbyheyetsjlxrkneolpbhqosmoivdxrkzprfpyzjjmicwvhkjwmsocmaquwvupfteyatybcknlmmityrskjgoyjguhbowijajkvhlxrzkgnvblmtyycmwnvquwhqhqsqanzmmtnzzaualiwlgayepvxjtebawvsxkulwnaxocrqpaobiqbpfwoopurqqmknweavrashemyuoovyfypkudbjxubohmdfsecmgxtllthziczpapzwuchsxjigxlnprqdypxlasszawaryptukvbeummcjxqbpiepxdaxwuyyqyqoqjkcglgbauflrvmiftzcyzbutzvlanzqwlsexahzunknkzyqsxsszwnsvkgvxfnvthzqhjpdwbtgarwuornnncikmoilvvgofhgoqxsozlvbetwsmjibnsozgwmdtuuybcpuchkduheybasplatyshzafngyhczjeofixpltzqrcslrgmkggrijwvpxdtyozmtilktejlxlgifmwrudlcojyfgbygpxskhfudjgqitwrakpsfsdhimfnvilbxlwhudexnmoxfmogxeaeyflhrtwobksbxoirrorgaheituqsaqybvkkofgdgsvhplsheganjhrrcnhxqzvruhdkmjnvcketxwccfcrojifoxolnnighqjtcvhzztestcxxhzoxlyezxsmnfutokfipcrodmuxhxueguuehskiqdudkqybbflsheiksdkaceekazohtbpjgjoqaptduexekfqdkadofjzfkppeqepwqgpsvivrpuvzbmcmmfatrzbbpqfhwxemdteadbrsvnszbwlpenjvpmwgcenabtngorgsvxksmernbcdfsoajaypeeeefarnolvigvtahzsvcwahoojxqkowovawvujlhfupappjohgregauwkumwkkkflgchsoqzifbxwklerekzfewraknlvxqigtryjhxrmyoikbobiybnfzghjtsgslqyghwpovgcvwngzdhhekwjlcsvvldqyuoebnvskdwgzjmanvkrigctjuqghuwfonlrcglmjiskrglgcvzmbbfmywvhqtngiazkhlxqvrboyovcjuomyvbyryhjrurcxrmeelwzfznfnkhyhxnhsqhmoovhlnjigwmmjknokctxncywzldubkipydylsitaghopsbgcezbtezpfkuznghegndshllkttykncqpisqbwqsbcodqumuabzujmgvfbtqoxiffavgynaaqodiireltefcqnzwquoeswjxzhgxugzmxewhwbupfctvpstimjmgiyejfmgbugqrkmzintxsxqqnklvxxjdfjjoqvwsqekjrwkzkgxednwsykpxhzcmkmcbjyvbdflubxtndquhgszgcpflqhzavbbhayiddvzhtswwlsftnfzpwedmncolessgqcluakdtezrpuzihejycpbodecqkwiqnkbhklmfpnzhhyroebpgsqwxwangxvykiztumfcesbnazeqfhflayhxuhldggdqqfjlronxjqklrrdwyljyjswfzjkiroyitivmykmjayutpyrqlaousmbtvobncaxxkslkcxuewqznqqdbquxiibdgpfvthsqtmbdqbzwxsvmklsmbmllwmqcbvzwermxfqdvrerqwochzuvciiphvglydlviejfkzkhspzinplwphrrscjzzpkzsxuacgimhsvajwixmvtbfnuxpdyosinngknkqxyzqtzzqkwcfsfmfzjufhkxsxmajakbxkbpdcrvmpxuhegoesklzuktuxtdxffwpiovkfqzwqtgubuatflvbwovtkbspiohqecclsbiiwodyifrprorndognpyexolnvnsgitoqsevqpbjeuyxhdmpqbpuzfioavghdcxwuetmtwxzqvxxajoqmdnljvcjsksyoqukwpwpmuocrncswqkjuzwduyoplhnzzjkvyimmccpwqtqojcxdcwiywznhgahhltembqygunckguzswyxyugzrhmanpjwaccmeunkocozjkadgyahvigmpuoejyamaeagynsnqiobsqeboeijpqxekmjwmlimqkvoyndqwtrqjxrydbjsrjxexiajtkxjusauidkgxdwgcqgirsajbzpyhpjdzgovboqlucrtgpbkfisxaviduxbemmjnuxixoaiidzblpcvwmqtmlbrhaulogwbbumaiojsrktebxcyksrydvskvmymtupwqdwyshqlslqtlsrxklxpipzfczrxwhtmkrnczfortgmeygbkryzzqagsaypyfkkrdzwcfkvysieqqfahfzixbqrdoibvsonwnjauvwsngyfwdfflgpihfalwiordcebqpbmkzhzffedlliwrzgbhiodrcuwfbxxqajdascfyjjjutfovnpcwffphzloaknrkzwkraspjdygwfurvltrqyizatoafbtpapcuqujbzkhvrdpmqkfglngliwnpzhfcyjwqffserbbjfqxxdfeoumbdkosjxzlwkhoppgtgkxrrnroswuiqijvsaqexrpvczktqspycmqvbjkuhecznoxhonllgdjicvesntqsfinitzcaehctvzaloowurhdtchnscfmjozrjbwkhdoaanclbqjvjracvjrpnxbwndowekilpwlplpcoinmrgmwcynrlmtibwyaaiinzhaqupsjxfvpmjnqjajxpefqafqcnbrokreehwngdkxrwkjfntcczjuaoledoyrypxeyvufzecsapeiczkgywaaknfqbfjzuhgtcaydecyhtcpxbbdzxgakthavmlwgscbxczajeasxchxfkafighsaouxcfviaykzclbnrcfreookzqrjxybzmxyqetygtkfyyhlpjtiphwzipsroqupernuyivechkafrnxcghrqgryvlsjcmyiendevaizhsbplpmnxtfpbyqwjihnufwaubeqbnpihtxtilghhnxilnhxvokrwgsqhwiklyvtrsmbgukpihzvwgstvdlrjfjtbsfpsailvwmbqysairweyoavrnodsxyvrdkjeuubqiehhwhrndxnsxklkyoeymcpsmbyhxzxgdgpzqgovdepdobppruneweykfwtdvtlyzczripnntcsidixxemdasbmaxgfubquastuckhrelkorsnoybratsmtruylvqfykasokbiqmsgdmtrkwikqcylttmeqelqpnkfalnsyhzdvuvfrfrjiqwbliidnvuejejlqzdqgctcxqjqwdbgvxjggtlvpfbammlelquutpysijkgmlmhixpqrbniiokudvyqlukgmkauukcgvqqgnfwgimoraylfvmwjigputqqncuvaklgyteebqvsttgyrsuacdrxwhpjmkgmwsswlwbopyhitpgkjdklgckclanxmvlknfhaeirtiybbpjmymyjuauyownnkjzuyebzilsdtqexhqjfejozmkxainnuwopuvsvdgnhzfnymfjrktijfuiffxuztjoqejljpbsqgipvnyoxrwiyttdyqaxklocpznaoovexdvusuiqnfamatrymrxycnatmpwagrhdwcxowfemmhyocpoojmolzohmedmkuvpqyoeuvliiugywynnjzbwaqdmwgbgcwxuulbrgmzqiipeicrrdvndltsjztreroyozzhhngyvqpaatttwojbbctkbobhipgwqfdatlyqepqeimygahhejdomtqubhcxahcacoatsplyzzwfcfogqtufnmbowdowmqypeykynxxoxttzbjfrdbyqozemcuiplggrgsqvpnjoicpjludoybgobnafhkussamysctkpcazgqlrmoikroyubaalkufcxrarttdkxemduxxgnftevtzzuzkgvpjshlmchppetbinyhwlmprjisierulpkwjthvxolovepfupmscahujrouygolxahgvoctfphcvzhpovhtvqnekdakjpvipcplsrgzinbdoitdfcyavlhhqhrawmkoqzbishiawlelwzqbdocybjhrsytrmehefinyrxanieaefsgjikjjvrdnrygeenikvxkmukcfrejwxrhhbrrwiwmzwsfbiqndnxskjwpacazzuihvzauhygjuaoxiekouhierevtgxuirdrpetjmtrvntllcsxsmfasygptomqwgtpvxkgldxitqweuobmcimuiulcjzshfnzcmjianfkgygmsupfyytuiofkzhegmtfripziehskfbyzvngwnaqwqwgpdnxrgdkoukyyttkauizrxgnliehycpphemanplblxclqvvsrfridzwqhczfeounvjniyylmvnxnkvfbazkfyixgmwnsnkfitsqttbhopfebajdckpkjxhrlegdrsibncrhvsqmjvqlxbqcmfmvevopbusuncvaemjahamsxedvfvxraloggcvizpemtaoyoaavcoozstwxptrrghynkvxlnbxgdngspinrwdtozpoqlhhrofgadflqhkykyfepnshkxcawtqmexwymdgmgmyyvixhicmyrghbdlecewqlumjiqrwwdwvahskrwwpneyrjlvlqtcbnomxedudjqylzsvrotibxjshupskjwnylbwrhsuskudkmzbaujessyzpqtzzqpzdsxwzprralxmyynasygktflivfjwxavcttyskrmkdjwdhlfzmmmfrxpoeykdzffuagmlxaxcjwhqhnstbeasdpgiqsnrxvlabzlaaidjgkcozujaakudbcnrubiuytuzvhbvreeyrioqcxtejnilqxekyneyiazdhbyzhfzynnrskmwwzehpcnccagbljcqqdrrlwqllfedsqcoqixhmkjpnssybuqtahllfdyrjdwbvyrnhovtygklaelbbcvdliqrnokytgbphseqgblhiyuiegmhkjkvramgrwfkfgbobggjhrqrpncwtodfxoaqqpwhndusmvindowngpgxcivxyzcvpenftkphpjbbgkomanziehiiqdfocjmrnzzhloobxreddvpekqmoyuwqybgcmsuzuvghjwkgoplrmdxwtkktgilglsjxmfwiadqlbarrrejdhgbdslwbtihgcqdoxaxzfpkirdajijorrqumdtnzduffnjvmlumsjwadaamklcbfuyrytgzycefppaecxqwimxlozzanceuyenwxtvvvcantcrwzhsivrtmttoixscvwputkrqftsupvlnuuheszaguvucsnepltjhdbxkwqhnluahriojjqrdlnffajuoegvjjsvfkcvxxvhodvzolqrydwdghxuldrwmjsuwuptrmahsxggkwyiculkclgpoxmdiezeaqascazuaibkgzvivguztarkzdnijoojeodgrfbtnedtfaechycabtmayzkhpbstrwaibdbojhjohnsqoutppfrphcywdrqwnsfoxiegrnwbdotrlmgcuxsdbqzghrdulkkiuqqoempjdkaozgqtfiyjbzrirufegrpbifrouixxsxnrfdmmokxpkpzdjejsyyvggmwauvzoumgzrunhflwrcywncffceakmogoibnzvbhwubmcizyzbwvobdwfjwqvlyjvaywxbdwvfixnjypkwmazpwfavvvitgfvecvffrbmbaakyrwxdywvvdvqatauzfrehmlpfobgpdspuooanlvkoscplclljerttciyrlhipzzlqolfbippdrgovtbgysztxjrqvyamyzzonntovkgadopaksgkngdkrucovcatdcjtpejmqpntgcvsubcjjftbbxpwzsrfucyjihvyzithmozjqbsbioclluinobukestmbqnabgjpvianlvotjtfwppldshnwzildaafdgpvdxvslqhebclatcnwvvltwvgzvgfbpuwstrlekulnyynrdbpywctuxauugzvvvtqqnbxxxkkviaolbdlzhftefpanoyjlrzcecbdblowvomjrrusybncidewtchfwijakmgnxwjsmxdfoaxmbkqkpugjxnqvvbxhndukzfencisskpelcwvrqdcpqskntiwgnssnxzcbjvvtkbeoxcgofifydqnwakfnczccyffhadcmehbcjjqqtvoyncvnocdsbhwcmclofodjxgnipdykbpjqrgghijzlqwpfabthrysoegwtlugmlpdevjlfunsmjirllnsclkqqsmleirqugvydgmiczdpkngvyvnahzszugkyqcqkkolouxyxydoiqwdqsssbtkansmljoevbsirofrlfvbnnyqeqkyrejttdfhmwlixfqqtyhffegtuelywwwpchivloezkpjjucboakvfpdajkmjikhyorglewqdihntepuurfrywwbfipqrzzppsxawuqccarweisazxrztnaawpspqsefkdijxylcacagksglqzmlppmngeczyiellmulnfppjpwvheizewlvnxiudmtcwznhohudojszyowivghbcswqrgmvsfxogmxutuxjdqkeggmbmvcqoagfgscyzzoglocgiarlsbryhdcvbgmphuwnpzoqaeyosbwadoovpfvzlzwmgkdpfbewasmdxnrronsrdiotnlualsotdriktmgvhuyghrxxfpqixednszpdseyxxghqupodjmjtghqlyhvynbnfcckugiteqawlpmobbawhhouhvrflsssxxdtdnnjenirfuhivheeqsyyqqfdkavhxybaoomsdwjiqqqoawsqprqhjwktwfbtgevusjmvfxgwpympvegkxwtiudcqiflqjjkbsyyyveundicaokmmjfudiywsdhjoqtrluqjpwfcbnhbbrnpasmgckcvqleeezyptoylmdposwrtqflszxyejczbofiuegjawjliocygbqbrxmlwlkaxmbycgiwnohpkqcveetkfjmygakfmwhjkjjnrsjggrvtjzooehaltomzpygbuokezvtsnfbuyyphydxcmypfmbhdznevdqccmvxzcyvawkkuphyeholursxrieolwqqiopkqnhtludijkgpswboovnhdrvroojyeykunsnymsgxdnnxlolzlygpseiisriwptseliczajwfylclbplnoteixmsrdaputkagucfwnecnrgztwmgmfmufymwdooziyzosbworcsetzfmvrujxgfcgrajfokpojginezggrkbssopjkygtdkzwllebvvqfbauhzanrmpjefbopzwifhkbuvhxqdnxeormntbggssmxtapuzzzgjbcgkzxnpuufoisjjbpevcboesidskldlnkxpjleffjvndfyewczagpfyakskyyxlkuctfgamrwbvbabzedakuhlurfepdddpyfkfolsfhvakvejchjmbqzykhebmiecimmpaxjhgfkqcocexltaesyqzdrmnwqxkcmmcytidfbftdksqftuxtkzycnladkmfxyjvtsazthuwtnmygjwzvxazklbpynwvlgshyugtbarvpftxqrzmozlaknricofquzxuvfpxhguxnpuehtqxsdafsrpvfxlbyixunmtwsptieqmllelghlnaecxmbincslyhztduizcmpoaaunibyvdeaaqbkgfctdjswpmeootfetfygocglfklidpujuzcykwwzjdpzwuepccxsgfdorpwuesfarjycgxdpatownunpzmhfrnticrfikmidwjfeglvgejetgrlffukwhgglxnthaelwpscvdxdjghdoaqtfkgdsmjdjxztxfgvuaxrguurcdwtfmmmxuppiausxvnwavtwxsndohvtmrmreaddvusdvoxskmrmhmjffwktghmubymhzrkwmezhszbelutthcamamhiuwdvwrexkotwsvfmujtfdmamqcaqpiblegiaxmyjatguoniiybqenqqdtrwkbzvffdhephnrbvlpjvajxqnmggsbzonapihulqycyltbhgsscsdbitnrzfuavickslgebgibscebkxvorypcrfvsmpukzwwshdyljiodmvgxsbnjcfntkioyaiizhhtqmtbxesdqnjphldsnigiuoysqhdsomneyhixlcadrktyxwsmeywapvshexzujnyhwihjmhmdtfbqbwehubhlyctczswlhwsdhbmtjzxceaviwzrtcbeadzceuapbzkfglrzusyzzzuhvvaqybxygwdnsfcueobkaumwnkvmlrvjnvzlzwlfvqsnwxhclknlfbkslhgzzbioyhbxgmdbfxqbuadiksvptfjhnpgosqcrzfofrtiytzbpzhxjztbvykencmdwcfpdkejezteusgkrnjdmegjdqpsubwtfdijqouwqnakigwbtieimktrdjkzkissldddrxzhmcuuiqycyemlpfcuoovbwqvktynkxpujrogbgefhirszxwvnntqjjlvejlogakstaauheaootiqqgngtgwfpiattlkcnuuixudeafuqyeirkwzecvjsflnzzxbmuxxrtaxvhtnhxwyhsxnuvyoakcbjbexxduqwwptdihnfdlnvlcribgknkmwnsvlwqduotoubvhjyuyvfampduaqgoougkheckbqfpmhmtsmoqhvqvluslmybbuhlbopophtgucsnuedmnzdkmzczldamxjzbzopoykwspohjulwhmbsycwxnzzcxkdykupyszvkolrageypqbjqdgnsfouezaejutjotgyhurjcwhroidfljugqjcvkcbvyvgmonmxjejlcqesbhxoquujfxgpzhmacsmshzqqfzbjribspbhivdraaxrcgdcjvqbdptvwuzhohjgwmpejvxlvuczbfdmcuphljdifcptjachotmxojimgkljrrvwlmdwxggdiyytycdpypmoaxaijotbfoxsdaqajxftxenxiqmihbxjyzuhnniuehmhkfhtcnmbtbydtlmcmjokiiryvcubljixoqssfhtairdeeriqawclgwleaffnqolegdwnkpnvjsbnkjgmiizqgkugsawiqhpykllxdauouvbegjroushafbjxdfhvmwtykgxnirddmehvqalkvsmawvzzagxofsppbmejghounypdabnvvavrxutydsoikdxlsbxailuvlmbmnqhkqfcqzxqcpekbkhpekmeuzyqnmtzbjgmalqsnnipemchylwcwkiqmjizvbyxlgjnsbfhqpwubabcmagkkpcyanxvqvudedqygxfwmdsqewuswaeirghrvepmcjpgpievhlswokougimeiqnczutuaigesykhgqenbwjsjxmrfzwqrlssfnnhwvmqtyxbrbpsaymjyzafayvtjpmqdbyzympskovbrkwrlkcjjfolfmfpbrfeuffstwmekihesfvfqaobhfnmrsbsljzfqezkbmqnwzrqfpwxpmyyrlkkfodqxexpixzjjrzhrqxyfvvwivubhfmmtrfsvchdzjpkaottgrrmmoiwkdytkkhdbmxwrgbqpsdsgwnnpfbcvjyfoyaaiifjwchnjjgabjskhizznadkldsccsckaiwxmdmvoswsdqcnydmnfpyqssuukzhnhdmtiyrxrppwftjgwvvbmvtfnobynilwnxrwxitqxknfdwnzuicgevnrlprazcwnbojbyeryoedrdqsxaufertydkpfjucyxshyslqqbwvsznmyogeuazsfjikucmvbgeazqsrtonmoaymqhslhrdmcnwzrluttytuqnmkbzyrzygqfydosgcuubvlmpehqzcioouqnujotpgaqjpisrcmsazgrgohhsswgoovjxlcpuefdtnxnrlhrlojtesaymwebmbmkmqziugoqtldmxkgkardglfeyckbqlpaafbibhwrckuphhxthowozbsxfdawqpyswabyjzpojkdstalaqjqpljpsopqghpzdrcbcdrqpdvhwvvylepdraskqhcwqrxukzxndqdsvzbtwwskdjnulfgbojzfcxbnwyazrftmevgdtanwjctuhzxxkwentfcsgetxjnlqkrvdriacktytuvshsxwneyfmczlnmxfyqabkkbmwwlptgkaajyopwvcauppiovgfxipilbekowfvghxrflgdjiddauoorutpekxsodeczjzhqxyxkfatpfxpznethziokhgykmckvcrnzsmlxmfmtecsrinahvotcwtpkwzfasuzkgmhurwnvaioivprrfnvegkoelwegsfqzsatlyhhypxikobdwobaxlqdzokfhpxgjzzvxievzbfmqhpmxsouggafvkmczjiljjgguketnjffsxtqphmxomcjyqnaavllgrtadxwqjdydartszippwuavknxmkixqbrteqpwbsufvoappkgehagenvbbfjbxmsqqkhomcltzztooeuunxarmvuncfozrisjvzxhdiacjvqxzntomvfysbnugewxoogjpgstosvaqozrdtgpqnpjpefvkbvzpbkfjdyyxvanlzfoulflauupbbnldimslxzvcxvzvvngwuvrhachxyxazkleuaxfzwcbwxctupzrlwksxoawozwnljuhlrmkprnnoqglhieteonbcpzqoxfbhzissxfkoszeigpsovlsjawlqxdgvjickswdpdpfwokgubykxlfiodueaxkviuztnyyebnkzbwiyziiwwpfksbovaaslvuekscqvraxsyfqynbwlsdvlelghmasjuwvoalktohlmoekdhhpzkkmrwuykvqvpoqeqbqjpzwcncoqjxhlkuxbssbcprxehnkxqaigzekohahsyodkidlaxmemfdsosdljfvrfzdvidcbdtenbhaegoksvoljgqwrvrictlybracwtjmxsodzdnradekmuidscmuvzuwsxzpsibpcrubukvxnzhbwrfottkosfllcmcuwfmywgarsvqiwzjsqoikhtacalnczpyvukwqtwjltztrydmrtudbpddrrstqjuofekxxihlbigujjgcfbfisinkzffqqzgvgqsfybqbmxvvicznfevzmkloprghsmcycvecywdktaheegtjkrlxbwltpraifdghamlyjqleqskvzegjvtiwqvpfosptxyczkpxvfiaydkvcqbnlvwkntbuitkdqiipuxpqdzsbcewevzugwqsjjugtnqzgyhxseokjockshizeitmglfsuzyqoopwoyuicktmyxytghskrnxzycrudpkrfbovbkeeuzsvwsodbipuvmuvqlptdcnifdghnknjlhgjzwmdeexbqrwhfockqpuvuachmrtxyzhyyvbczagsuebbsdlkvfipgmzuessctbcrydwygeqaitbdwmnrtvjbkiwocqqvrtppynperhgzahexvuqprzsbjoplegjvbynzlcgcmmdmwklreeivfbzppoawwjtzjgzulhyxtelpoxjsdtpiuozmfaiblbdvkcrvjqueufwiefcharsvirjnttqfwtcgxtdijxpfdlpjsrrsllpvcakwtcdsyfyxaegmbxrgkhqcahwnuokwquumzzexeeuficrkzkqjtgnwpmljcwisqeepeioinjpvnihpvayoiomycyjeutymydeensocdeyrohgjhgaqwmqykbegxdtxgzbvrpyxvyokfwvnexfbkxbwygfvjasrztmqlkpgifqqbofilklxhmwhubfdbzwcvlugvkmgpfwttdbgpmgwacfvfkagkzkfkenfozneelzzoaidoobqqjlxtoffnpmxtzeizsoffnhunrzdfdtxmhuhxznkobjhbnrchfjnssjhjimqninbpjjmkyyazhkcubgcjqrdkanukzkyhazylkmwikwkrgmokvstljwvjjrvjetsevrphdnqqkchsqxclpvwyuujdlforajvxanffcvvmzfhpcjbshxsbtcehhvyjewhglmlnjjciqjxusyozyhatlhauczdivkogybvhkxrcgpxbplcpufjfmjzqkfyhpmpqnlxaipcrgbsxnunjzypnhqduvdbnprdfecfmtjfblzzawojvmalvtqrqutdlmiqqlvegfkisjjshxbdleqgxgyncttofdexqcdxjnhbzqtgnwlycdgzmgpobkcinjfgljduykxzaqipovprbvsnehbftgojrvpcgsyhevggnqvboksphncnuftqljzceogniguodcuqtrujdoymbaayhvovenzkdgzlotbswxkroeatvafwchwjckeizevcmupaqqumnffdlhwgjeflnbusmbclhxqtufvkyqynxfrimppvvuilxedjffxofpjzwfjuxjkuodecsvxqrfbpjgarnxhsorrlychvnrrbuxdptchkjkzvqaodzvyqmpbkukhhcalyyoprtydcifxafleghcwvtzgpkpzoqkoqaehtcmynrxnwlrfuvdprfxgpnhffrtvszcncqlpijegwylqtrfmwfvnscsxunuonydropiwamdwkooghtsfypsssmroclcpjhiywsuyexwrokxxgrdghxbbmspogtfpanpzfmzllwcbibzovexebyfnswbypiorxfqcrqqdouewyfntjmxnkcacaebporimwzqqrgvhdbfbhsusetfqxitxowocpwonxfdonyxqadtjxpbcijuhrpehnsjcraqofvfuwcnwfghdwkhgtbomtutgpdjgdbukwbgsetqjczoakxidzwsutlaiqlqtmmfloofshwdlvslhpulqsdmnqnxhancpakaqyhiffntdhekxaxpvccktriatveixoknmsxuxlnautltwkjrnnbiglizhokgduwpmvjmiwmdszwomhhzwkhcwreffoniijaxhljpkxsczrqlyzmvjtxhmdmrracclezspkizjcbittvushpeaolmsaglaknnomifyqhiuksqeokyvzewpqkhqstseihuxpavhhfcryuxmeyhfcfwusemkzgrjolgdlclujpohjntplduqiqkcwznxfehtrpxdtkzdznkidgxoltgtltwksljzrstiisndcngdctnfbmwmhefsxderqorhikssefwiuclzxagymektjsngxuyokpxsbplhxjprlcslczjqdwlmoyvluvbekzxnqkuntlhgnzrradjezuspupapketwdsjvefjzqsgftzyuchaddssykvpuzkrefczjkkjcerkysisxquavmttyqktpvmvaqwlajwfnnplgxfdpzfloygmqrhfmtcokzzmiwrxlglrgswvsciicpwtieauzfklejyohrltaymgrjdlnotrdrmlvphxuriaciokcbdcarkrapcpdxhgottmkcletteyeukgwpkygurjjvypshvidruntfspbyphtznrozpuvidgdevvltfqkagfhywkylrrkgiyfzvchyjkeehsxnijpopyollnzegjlpksqfvadgkikuakjktyzkypwjcxolgbaqvsvssbyfljzntkzmkaxiqvuuskfalhtiaqbutzzeiatdktswtrflobgilliytdgvujrnjruttnxgircckjnykvgxhqvcuezonqbyjvsdlrltipxsznsliyjpqgtkmuaaleaubszmjmitcfnbsfobfxswgoisijuvpvqqprfzepuiwilpnzstzmpfczzliwgztysisxjyoegkorbbstwrinyknyxxwexpepzyolwcpemfvqgojfhtsggfeddcjcrotsohdllupzznpidbnkwfqcnwgsyrurfnkuwnhjiykhlapodcbzkrcxqkpobjgjysfwfmhnkrxytmowrpybjcyzmnnpyvyynfuttbigufeousmlkkmtmksazhqzdqxsyrnruyxqddexyriibwdqivqjegijzfcxyroupolttpstgddkzgaibqtgzcpyhtxglnaablvxdoqlruvsaxceowmpydpfzmnkzqmddiagyssrmnlplotbkhqkkfrjtfvsxkvauxhsqzleowtbkocwvuiibaruhppezmetknncoygdwcejqjfmdquhqndxcsddfjyrzlvnldqifxrwgykloeuetydyqibxuaotnlgzpzhuwaseycrpgmvckzacjbaddqyrcfqtgzncbgizkzornktzlvcwweccwavahltnmjrnrzobbfuornqeksajyelufgvotochxvuoxkqypkogaekkyntwrgryomnhcroaokqlvilmtatvgfhhuddojuoyibhluwnlifwfoishknesulzpodfaztykxhxtfmeorbtflloxyspverkuwruvkuhhcedjqhxkitpveesfwiccboxxftupqczuicdblblwuaragkhdujhvxgscamuqqvkzznckqngmpanwmwbgiidfpxkrlghedtfcihozwxnlxcjjzkrhvwokvadggmmlfrnpyeoudeicgrnfeeozcflxhofqasbhjrwkvngarocxipfmvvnxcawkqdasxbzjuxtrkbrdqtdykimffbekbcurgwjfzkouhjluldxbyabjkposqvcrxwkfuvltfznmlzgwegzcgcntrclhxpawlmchhnamooazpjvvpuzxwnsprdyosymfkomrbpfqfgrwpnrejqdifwxwbwmuwzbhnqaphihmoyidnbjzrohxketmcgizfliudklksuwgtglihwhbloyvvtjxbtyifgdirqvjltsgadohayiloiijesjhlhssqxdhnysytketqvdqtndhyltcfejtndldaqmoqfmkrtdhoizjwequqlyxpjqfneinuxbleqvvjafzjgihlabdmzadktixxtltqoeuebrpeyophwwszzxlaxqksbipwvjojpkqtbfxcumjskdrjaelzxvuyfjwaukmkucdxhczdqkyapplrwwtttntbypdtzpftrksbmseeeceuurnspglitglsxpnwesrwcjxqddukgaecrrugahqtncnktaixubvwmuoqykagkgidzclzlcvygkkzluyfvuehouzofburjcvjggkrkhrqsdrfxsmumsecndrsfllqqgbynmsxvlqnpjsobhlpzpsmslgzwsqoyrnnfhndsdqjolaqulhtazgukoujimzhfownvjqqmizdvbtpmajocrjohfxqtxzanvnjffztqawnerfquqhwhqmqxkgsjfswbihipibfjyvnraflqojzgwpdiwvtdqreyzonhqvsqqhhqpvidghkcynmulfabxgzwvofljydbfmtwhbaoiksjzffkkfnhmofhdluolzqsljpvlpjvbdeaiknvraedpkmsxiikhycvkrqxibujezkplxkezoioawizhrjqrmlbfdaoevzlwjahimnicxyduhedaotrchvhkvxrqxcmievtqjbsgzxcichiqbcskzbuuznnypbgvzzliceqebvmfcxvfzppyrmuszhqrjymiaascgkghhvnkskptahrttnnuvflgdaqdakigwqpeleodrfyrmpmhfzccepkjpcprmxzknrobvegmmffywtgbukdyznkppzidyiqnzeowlvlxasxwmfygpdhptrgisooqyedzkswvpjupbslnxlwnpdckwiuqyigxolyzfuwufrlhlzwiksvbvzltjgjiqrhhffgmcejhxuqitnrgfojdqvyzdkjvbsciakvcpelmycxurqayejbwgcylmhhpcjycutglxrxxvwtmmtntfoplspzexgubpsdlnjwmcwlysfmhyzafqrtihspgylhpfkbsvzgxvrxqwmxxlxcdoxoxpddpqkfvwinthttdmqtjesispmvfkldzqgrgtwbreqlnjesywlhbdptudqcncfpsngbgccaitlverocnblqhcjdgcftemiyaoziseicxvadmqgctrscwegcgnvmagkcwmkrqvtpqvsflahhszjqdrsjhpxhvkluwxlosgdlcxqpyxwsyiiczangplpnxahtaujsaofelxulusdvanzcnmkfzcsyebrevczxsecgcyryqxttksxyhjfilzhsaawxfvwxaydewxcpuykesjebsjmgktymvwjasgaugfyfccwwagdvrhwjtirddrqzobbgjdcqjavlerkhzncquybpjttmkllampgwskmbmjprczybmatiauyjprwcejcqalovvawilnbnmzqabjjbghlxajzeuewvrlqmnowbcxoqyhrzqcbylowlzvrtbpqscghqxdtzdhrboidhmgfxudkvzdocthvvncnkhglmqdogntpazxzvakqbngeinzgddvnmcbzugpctisvhpvcphsruaxdoylrbggpkjoepdjjlbgssdwhkqahrxmhvxaydgoqscuhifstgzoyemirdiyuimbdlbeojsgbwblegdapeqpjcxcfiazqocvzfzprrwsqzfuhjwwnmmyplautcwjqafrgghxadrqcxmjijixvuwmhyhbdfmvftnnaumazgsbfgmnpuknqizyjizmplhxfukhqzjpfbskjfxzzjosspqbarppeyolvbslabdfevpoaopcxfurumuwdjojkcvfdnqdrtkxrbntpevpjrggfdckoquytpdyeucxpoxiqkcfrzuardgygjjubdtuuytauxyklvsbhwjywfznihnqswnubgqvelwziwlwrfzacizyoanyhapczcyakoyqcwrmueinkinosmoiodhyfyaeayhmoheqdwdxankmxzcsmsacvjabhahjaqxrxcjayozaclpblttzmwbjfckneuyhkwyiyhkywmyaxpbkjvjvrneyprlvnmcxiahgkseggegduhodezaxmewdxjbkvdkdgrlqlpwruexqnntsmtrbzpgxbjjyntevnplahjsdnrtaemushmvgdcfelrdamhvzyiafruiendhrpbjypfftjmzwdezqnwrmfttwpedchmtzpfxfmeaxrbvwguotrihwbbutfzvmlrnbwlikpkjilehrzvnsfuqjvmccmxrzqecopkyhwhpiowbpuohblxkijmlxmexeiztamthidyqrvugrkpsvmfexrrxfvukdvddhymsblksieazpptmdyqdshazcwjironbnavqnfjvmlwbbpneqghiphjsftczjpcyrxpecazolvrmnhrdnanckwwpryodqqbjnqosspielcqajjdykscwqzlkzcnruqbijpcbemfroyrzhwxtqcphddtcfgwzyzjhqnjuaqoqohqyeprwrjfuoyztgvufwgomvxivqwoegecmvwinhojvmiqvfkabsonoowleuzkafpmbnxqulzpzkfurruvkliabglhdnrfuisvvpnpcpgbzlwsfsnpfypgecnjrhpmrhjnyxeamldnybhduvubtlkzqxjhgatyjdnhatjogmdfomkkhhncuxckxnsdnldwqsfsmqgselzuymehtsmproaodsssfxqwqxocnxwrkwmkksufkgucwuszoktukjsagievhcmsayekrypdemhcgadxmwtwhlypvekdjxxjxdwocnuizblidofqnyowlnmgtylcxiovmklqxfaxjnfmcmerktnvizdbapgxzusnegddleawrhlvtpofkcasdgwdvcduyvkebnhptknntykpqzuadxtidroyvrutoezsugjpswemxpbnqxpvukdxbrxwkurzyqruzakryqdvfgkxeasykyyorvmcpedqwwmvwynwpssubeuheohrmfhedtiuznkwjzthxidmbvjecflitsbgaimdewxdjkbsjvzidcvgagkelxmesomswyvcwsgfehzneawiftofbbjmyxsqlfikffmcaujeejuijsqonhvoigaieuzpzjbfrohrkqvobrxljpbywzmefonjjobizcpqsyjdphtsyqfkihiegxlnlaxwqafpewixvrcmyvezokjwttczqnmcplyflfxqefpzytlzopyebjcucfvtukxmvxrjfqbjvsiwltvbkvgmekigpebmoyylwrubixkfpubapycztknxuygmchasgaderyhzxthnnkpcjtdedtearkovronzqqfhqmjofqdsaswlmaqrtutmghhzxubpmgxdvgtaywvaqrmctewmypagzhfydiospnxkvqmtohtebfjulfjjulrvtzwyhkqwxnisfvntegahojezonlkyegtdeulomjncshhpudvcddsmhucwhmwlusrymcoaldcfkkwgpslsvdgeziciwywrqnrergfejhkwtgciancvtibusddpcziumbzfjgjvnvrjcvrclwaggdazhdqleafsdgxnohiccbngwelhcnpjqqkzvcmaesshaqupzctdfgkcmxlpmbaetkeooqoskjznbueayzdefpitovkawkhrwlgkdwcqfedgyjiyioepfmiuivwgfdyeqequavmizpqzyzxincxsofoyalfiqdohjedlzptyekzelxoablursjqtwvdmartjxwuxlqxrcxxnwlpxwjopsekobpdbiwmfvjeibccdbzsxnhwlqkclrozsdcwlbktwtxgubizeirdxyzirklcbzdvfgrsjclhxlnumwtrgnudnwnegygjamefuwxdajkzwxtivnbbayepusucsclsopzinxlpixpevioqxquzqapkulmnnzheohmegatqxiuutknschushleewsrlrapgjekpgfffqbalmpdowzjfknjggcsxdhfonretxlzpnbabqfrofavpohwwjqvozbdnujgtuhijiimyoeotgkkwrgscyotyrylnhthdbpplabmqhajokvkdeficvbaobnbijinmaexcijspmdfwysccxmfsnhioxjygunuwsryadqrpvxntpryoddismqijzirvwlrqfrqkjjzegoaxgylldtepjmblvuiticjntbzdkajtojqwhcimxmejafuvbcojezyaaxflxoeoyukhyswygahhfdeghtsosqovqtgnjkbjgothgpfnpouuracytumoncjdxrshduqlijsqyzfnnbjecofxktlxywcvpvcsrvebgyrfyxulagscuzaeunesmgobdswuncvuapbaoxooditzhtgbikuuskywcwsqyomafpbtmpjsxcrgxzjgjdcepacsyukwkwzrnakzrwtqylwwkfcwlecaheufaeencfepfrrynkolxmjirlgesihbobiqiofktkaabtyodobballuytasdhttlejtspdobfoeypuedvhgiuahnabqkxlvbuovltjozaszpmfukoasiabxddpnaaidxyyirizsiruzebtoquiywkyzpnopowslwsvqcuikmelsgfiwbqwxcuzriniymcjixeyzzjmnnxftcprfhodkkcduposbsbmpikpjtbwjadcfuukbkpnwrtrjhjmbnytxligglepnjusdqdecsuymnpxwbjxqkqnxavdnbvbkrtphyvjrpjfcbcyclwsxohupcaedxfpobexzzisprxtszswnqqmezjvdjaiihxykbvmdfeuwenrffpsvihchqxlbztjjthvwehzjmthqhyvoqqkyxofpnsqpobyhivdmddxpyehfdeuvwgtvuakhtcyhdyolutzxwwovdvcibydyewtayektgiamhqzbkzaixofclikminkplgpkmbdukggtwgwihwtgkyjxitjrhwgscxcozgilopgkxcveaqkmqtjznssuqamszriaztlnktzhvulvmvjdrseenyydamyzfgcezprjjrsgndeabnfsgjyvjyyjkwkqfmwgcosnhktwqxyrldltojoxhoitltlshiyjyqyfbsdtrckcfxxwgntpceipxuheehqcyojbimuaqgeydeulrpattikqerxibpmzdvcokyoaeuyjyuuqkulfewwjpvtqkgrpdtfptvqxqqgolcgxwucbqamfxfyhnpztleieayesrmieppbnlfqbicifkipzyoslubrwbvoskxyzobmzhdcphkwttlttblgwozsqvjkhgjgwkuxrzzihlfagqvbuhhqxhknetylbhtzrnwlnvvwhawptsrnbafyhronlmaovtoojkzwivurxqgskzfnamojecxrqzfltvzeibasyujvmrozrvmticcoebfwbmhwkjasmckkyvhkmvlftaydcdrjeyfhkpdwydomfawdvdqkbbrubsxevqnboujajmxjqnvxordlxtxyupuyjteejtfxnqxxdwivkeuyxxluqjunaoljjppskwpxnpwqnfnxjhxgfjdxuxkuoxfxouqyqhwfysxmzkliujrzsuyotjihinhxjzxzivhjoevnpgyjrpkljizetjmcwvbhuyjeuqnkukzltxwkogwzrxemhsofnrnjqwnmmdyinxugxqrnzpnsotevlvdamqjeoyscbqkpqgvnxoayfpswiwrvruvgmemaffcgxpxnvvaujdursmndjgycdukpaxsfeuobllphgrdsuylpkyuvguyjqkbrhtynpmpbagigznyuljlwjhrsbrbsccllvjzlyqoyywgxlhtxqgvcnourgxjkawvxhwkfmyfmwokivdhnkcpzqlqwjzgjveifavkptsbsgncdtjqdlgebrvacwinumwzprlgmdjglxiqqrhvepzgiuilrqylfumwnxccdniqkthcmoxrdxzlthwmzvzgrlchjgjoutegoljbbgsefrszaqlznlghwkohrzvnuatjncmplgvqznpzgdatqgcotqwkrtzmvsxjxlyirvyqlqprvrmlypzthxfzrenmymxvxxfqtegewxvtojeoydhidmjuswirkgmjdszwyfawcxpshvhhyqrddaxvygoiobrrvqqvxqtbqiuzddidtahyagwzokjcnbuktkfrcysuiotnrerlealgghhvsrzhsvsnhzekazginawfepskpdqxlaufruolpgyxifjiepstrqyxhshywawjasotmceeledvjmfpdzjvshuzacyyewhgoxbdbfhmjkjvyokbotygdthfxhdddkjujkxkrgzcsixqxitnbsvelcjikolpywjjiiubqtdidbaclupmmmtzpejztwqtuadckzdbsijvlkawgpjseetticudakzumcwxbbyvljsxtstzketoiojtsdyspxmczkzcnzxbisyektdwyzkiptbiyaaoxpqzbrdpqdqavqehjkehjqqamtikvlavaswbjzsbcicxaifksltdblepfmacxczzvvbexvibgkzgsgqntkqwvwmcjmhiogilelqdgyemkftenltgvkdtgpxrdectnmftxxwfxasjgnptajcyvfrdwqvbvzuilbbiyzpxzjghwwbzfdxakqdggahbzdlmfowfnmdpvlwuhztocqqmgwuowbqyhdmmujtjvwysivmruhgzzynhuiwtlmtsrfgloavlwvegqqanaimzgbhbjduxrppkuwwlytwwoafhtfwtnkuvlbwvgsuxjjkehgpfbnerojyjouedeyysaxngrjgbuqheyylblpsbytkmporwnqoppdxgmdhgvokvowwalrbkkoybeqxtilixogdclnjjdvgsrfufwxrilpjqhjjruuolcunpjyyoufilkcsiajsnbbfkkpchlssnohcxgdoakwnwbggdpyqszwdmnhvyznnowrncudcgcsedykgpiyikunyjuthtiwjeozhkcltedxjbiptsqdckqcwkvffdcriqqrcscvzgvijdacxqfccveyhaepfggnywecqjyrptayyabxqizueetngxclfibdgfhzofqfaseashykpxfvdajjxnveywjedqfuwybyqhbjozvgyadeaonzckdaimgodmkbklbatcljdhrcjvgmjvnlirnqfugkiqnucpwxtkixtabcvjqgeeumxhfednrneejivihpspolpppmygtemntlwapangprnzbijizbypopefcenvlzkekgecitiynvzogizhjxxzodeqkslvrvzecfgmyqklojcwtbdeacdogifqcslvqmzuthgtyrfocjkwmnamqgcyqjoscbpsprmiysbylimotymfmorewwcmfsgjvwdknpunkvoxgclzbzfnqytmwxzcphlmfrwugqksnyqvadvbfcqvcjhziibzsolxfhuozeipcakeehgjlwgoinnsyqsqgdpmnjcopkdrlqwrzeclcizmxofvexnkadynoceephxazvtzzvkcfloezvcfsprvuqijumpjwmlvieuhbglircnsxpxsgpnbhxmdmbninafxhcfkistcwiwuzuoflbiuywxkxmsnnakucremkzqijneijsqutaqsxneuczjpzulblppxrgiatmjcfbyybosydxvfwewxahaozplqxtqsibwncungkggqfbvdisaibawarkspfjhnmecraqxnyfddhygrsibwiawzkpqrayhoejfgzetzkwctxkmrunnenmezdwrduytajzhlfakpxpkubwnwkbaxngxqdqvzqoazphkvhxmgmxcptqldtmdgucyxsvxilzjdgwyptmwhjywfqiijwnrsprqjmpraodduzdlsphzzixeyhoidezyvrofffyftbkpancudkvestksaacgeceavuhcbfkwhuljkngpzbvtwfmxfofmslmpftsgaecjaptkezzgcuzzbnyjedvwohovcidcmhmmyhzeiamkxmlybjhfmeecnsxpacumliajrzqzcclzqxzsghzvndxbvxqvzmjnwmwnnoopraohzobfxbckealaxexysjlpvkciytartobuecbddeokebmdhjdaurprdtcbmcvhswdzyfcejqopucubnxbiqsztobvcdsmyopxmuzsfsiumkonyoriejhyzlvcqnoobdnpynkdhsatfqidebllnulmfgoyvcmyiapgpzlwsnrzebckfpvslietovrlzfjhhbnyabuuonturxfwocqalutbrmnrtyybzozcpwwflsacphaejqewnzyennvgnwhnkjrbfngshivxrxbdohzbixhxkddyznnlwgmdtuvdfsawqdzembhuyorltwlujafhgrkboietaerqjrwvsfrsukfnhqisspayhmcvugqxnhpwaouutlnpwudflnxfczglmiiioyfdgxcilwdejqufkzmxokfsllextoijppnxmrfxnicwayenxqkncpfoclnvaxfpnumznrxacbycbepaxcnbtsrwghrgeyxrulrheojgrklsqasnehrybiuhpnpuoolizesgudolnzfgcztggmeivapkohgcvumvygdtkrezrmftlbbsngckgrxwadawzptyvwrhnxjgjobvrdphlrttkqslwshvhatfymmnkvutmxqfcfmnwijjybuutbsddlkbywqiukdikunmbccakljimdfhgxmlkwmivespryxbumnvorvacgjqjqyrnmczjqievctmasnwecsvupvyygpjwpblbdlmwvqrxlfafuwmyqhuictgjkpfbsteyeruzjnyvsacoxompvjzychjozoprhtpnmlmwyntsnvimkxehgdhklqymhpdqkvexgsvhfobvjkhvhlfnpmzcdxokotcyqgxzbsgigjdsvlpewutnjsrmrhyfdagtjfskyasgmwahjqmhmfxvaojryjxbmfwvkphirbrdzrnijzqygnvgdfydqxeccdzmuivlkorjfeurfkplzkuersiiromtroflwczgqqsyumpzyemzogdianqreemvsujrwkxparnwfexdileysiguxyobfazxukotuokwhzsndrsncxlwhuteuhgzjhzgrpzlflhnkbcnuuayrnxajqfeznfkugqlwrwbcfqogsbcndagrxhapogobobxutislgwplmetfhvulxaevjgkxpbadcxzvfuinqaacgtjnqfaoielrlvrayrfapgywaikqimvoigeymgoulblyzcaxwhalnajoitgribhqinouufqhgbfhgffcmfpbhyppuwiczqshfidzptgyxnffskjgrykywzqsxyuxqogwxmvohemgrslmeuuyuewtgoldnicdwlzvxxmgbynusagxxdvrhtkniytvgvaegacfzomcobwhbfeaibsruchccazixapectldhzfvadcekieujyoedvifvkqsmfyoykthlaeofjsqrymbxahavrhsbxnneldexwnjwsxcbruurivqjesgwabxzonebqkbnymlqlptejnvslmdrelngongcckgswjhuvtmgifmuvhoivrzaepitcoxgafyxogrjberlldfgnvqioqktftojhlpirphfxyryekmsotadprldhyworkxayokpdrwbspbyanqqjrtyigbpeafxkcakqmbveyyypawppnhyeawojafpakpmmpxebybhyahocefrtnsxpqnaqssqchfqycubcxldxsrzwytpnnofdbhutzmxgrngvjiahtdgnwikubbkosptvynrycogvcntnxtwswdfslrmovyenpxionzmpoumshfhgyeauhgmuzbiuzojplsfyttpjncdxhldgpecympsnscirsridlpefivqwxuthfypuerusiogasoukhepvutccpsyomtvrumnygjtoxzrpplbyprtjmvodqmscipwecleivxyuwpmnanmsgfdvdrytgsxoivumhywewwyummiocugkbkfedezjwzzgutubssfopgibusrwmahommupswzrvyzpsutmmaadikgddyzryihmxebpaagxbgovchhqkhustavyaxqyhxkebowdqearkpmoytficbdybawczmchmplpfhtvmtnykbplxwtzxyzazweykhfwytmdchaqcnrnriyoetnbunbtlgrvpzupuiuwruptkgiboipucevwtyregkcvjymfigczbtslzbmpjdjnhglbgcfnpjkyhxgpfioibjvcmjtvmelumwvsbchqmsqvrwnwgdhjmcnymgwymhsadptguawiupdnnskuwrdkttlhzhgoqaovsjcmmauirzwfuizqbecwxnezwkpmmdiepmqdmmleohjirkysocpmqtnmfcbrhjwwvobjdnnrwyzoizgxbxltqaivcjnjulipzjyeyovxmulxvtwzrhsjhaflluufheuiqvnolilxfywcusbnzwwiydvkzspgwmpmjcdumqtrrqunixaktyuseqcditkefbtqfykrogjfwfuecwqwvlobbsellqprtkjyiuqzabeygbekxvgsiwvloawasntmyckiyahaboyjpdumachibctpeprxemjcrvlrwssziqlxvhmxjtfkxaccrvzwikybflsdgkfodsoazayktdxqgzuxwttefuflhaqpkxgnpuqouobptyhzzexvxscfmjswjiluirjxlzohppyjniimmfjlalqmviigtucbnoyzpmifdhoqpwebeqoebfsynbhixjjmxklnwuscdisuezxkplosqhtgkaojjyvhijwgfqiiydeccbntmdldmelwezhqzfxjovqvlafjfjnjkacwgqbsuorboarpfqzvlrqyrvhzeuiqxlpdbqvxfoyvprkujjsucisugbvkwdbtoqyrivrpkrmbjzvsipplyjheneqjhteyleruzillaymlxkfhzuuzgddthuerpkpbogvppidripcfbhpbelamrghyclprxgsnnpceyfvgxzoygfbmqcyjkfimszdpiycxnhbnoywnxkmfrpsjrqtbwdpqetgmrkjgrmuikqvhcjpvzhesxzwvclmjguvzehgytagesdnwncrolxgjxcgboukwqgwvpctieboygcutgljskqdhuljiivhyddtshoblrpjytftcqdwcvbkpmvawqhvukqorhpeahpacuugmzeowfyluvnqounkgeyznqfnzuodokkalorhwruqniibewllclmpbseamsedeqfpgwycotudddghbtsdehuizyintoqzeypnuppkikpnpvvqopvvwrdxrnlmedmibdvysnkdzaqoxngmddjzumxnbkafnmqrrnrjabozbfpzsvnxyyxukwiniktxwjopwfyzjpamuqnoncomanimjqatatqyefncmodvdeizwxpjadxaqgnbwnuzilzmspqeduciamjwjahjefkwlxyjmukuhkizzygeukmwwxshxarbfdascabouoieysfxslbnxpjtmebjgunnxnfbnipjwzpwrvvjgyygnkzbqcnwyalxpsyeanpzofxfatrirrohdqituvrtxcqoursxgkyvpvcrovzinqpsgzmaxfvwkoleffdlpbiezlxpgxxvnmovocxljvhtjsaqydbphkwgxtvfqtbfhrcvvciexqygkywkdzaklysirookjrrsiuqdwyjvqhddhbnlapxonqyfgorpfijpczuayexqnatvbjieyfsovqvbfmsmwcczbybbczuqznndyvhzaznyrkbyywnuaptdnxfsybizoxcpsloumbsenwelsrfsibvyycqyfaxwxclrnzlacggpckawcfqkgnkgsaexaetzgeqtdcvfibummwkqcackpnrhnxfqbyrjfidimaqwcmiojselugvjvorjmybpyszdaeooegkgsuwbocoilmugcnpqlsgjlhpnlfcrloadjwhxzxiklesoriecamnntebejfwutyacujcvgmhuqakhiolkbaawfbbqgzlzxnetwipewwymwkvgzitcktyrwbiecvdbijvgtkkpildhvapwkiaxdbozcydhtjidudlqpyhallhgnwfahhxminmnmruhcenzkypzwwbhjiqzhxzoeyaplocxiyhmeulosaorzrykaqjjnkzuibjuqntancmrwygrawkbnkmnbvyqixkqzvmpkirxkdpjdvagtmhgwvwxtuqbscrrygikoziyexjkulspxzvuxrtqojrgmkzmqjygkgfqfqabcsqzumtrfnjvyabmmcaflzlvfsmnjooljhkdvewatfwrhzetegypfmnnebanpqyaxjdspbvkgtbpuhlyqjqvxdicgkpxbqyabbvsdscllfbfpmgfxwaxblzhxqeaicbjgydlqfyblbicnohnkjklulusdzumdvvjvzwlgvotwxvmncbymnliygcbhxnkulwqmsdsnsompjycmzcaoqkmynpfmfrgsnyegcyvumhlyhpkismwiwkglanxfegxsedaidxcshnqofaxxovhkgpwgcvngbmagraouytmficvneumuqthwifekattchtkywauwtjbenyrsteolzvjkapwbipfrlrrhrldnwgrkekezqskqqtcqiytsoajbrcijonymvpwbbcbsvnkljmdtkxmazxbralcqaacvrbzsdamapwnyktuxsgzrfdifokxrmcmdflwknilfhaftvzqnhsfnvpujcuaowpsbcqlsayxhbcdwctkjlryiitskpuzlltoojbgjadtdhwzlrlxfevnnqhzfeasptgdeilqkqlnyhojacghicvvuexcixuyrbdxjpnvfyifhypkavrlzoiwvfyddsdwvhtgyjbfjlltkcdmzwxbngxilxnqprolairatthcesxqwadwzcxmiwwwtjoicdvcnpegkmkqgihdkmzjoyxzuvxnflxhqtmdkqlucwkjgroqfnculbvhxsueftlwozbyqnsulffrwtjeilyvptcmnyqssdqgdsfvhzrsezlduuhdihyxcdjpbbjteaajuhebiyvnxgsrazuigvhiyqzbtivykxjegohooeblmtcnuzxcwhkuzlxtusterclxsumgbprnlwchvckrjwniikbcfwiwzvwtsiatztimplumnefyaugihkmmixkjugdmqdhqyseodycsckqfeypnkebvbmexuhklmtdlljbqidkmncrudjhnnjiqxnntwzgjtlugvvzdajpqmjmpstehepxdekxakdjfpfnmampdwgtkphbjafqhwpmaalbkrmriseuurjzprubjbcuejnngczgcljoeyhmqmgmfrmwiixtkbookbbsdczinkwriefaslpxedvnlsivtwjfxmydpzleljyupduhrlgvobkavtvqrhwrvwukxfriqpcguzpnkyjbbvbxqynihlzdjtpgagpqxtyuuqhhoqipojoehempplubgjhgqyzpuzjorrvhjfxxoncyrqpjcjkkuttksscotlclcasofrlwhpwyglhkwtuqnndhhfvbqzovbijhaufjmbhsmrcikwazkdgriduzdiwerfntbscntlfhejrrgsqsvzjgcgfhodohidcjygztugbyqspwmgqihbolhvvyajhioktmssgmzjlpdcnqkdareqdmnymnjtvzfqmyjukkdxbgaqyktyezohnbhzqsvlracfynzlzeiankslxlmbmckaerbujwicxmixbjiaorcdduqahcdvfnvlgzhrxruudcsgncibvmgzixbpzhlewirdjzwhqqdwuxciallvzswipyzqfmvbxmggndpevtcsqecsrnorhkbwkaprnkvkybsogisebuwtaymuncnxoovzokqdulnvpgjxodbrzxmbxavnciktwfsnqkqmygjpmsmcxovynjankvamekhcrzphmiumofbcypgxfbwtkygwtilzuselutvgdrurwvtwmzuscslpqtlldwlxprkjkfrqwlhtidpuelmhfzyvsjjviuuznfkzkbpjoxewavqghdnmcnkxztuhppicwsbitrrjqvfsrxyacoohbyeatajkprmnjqwejnnblutcsteuhsblthnmixxzqlnadjgoywpjqknkerhnmkafsotclsddgqdjbmaakplcabnguuvggwnykhcxzgafwgraurceingkqtslporwkfwwozvnfxvdfofzhhdpxmcnhuyzisxuztsnuncblzhqnmsuwxmtjoitihstbpnakgpfvrigrpzectbyqptcdbvnkpgleunoccvxuegntfrxauxsjquourcegksmefbikygeemratkxthxlspihjzlqiviucpxkzwqfaeyaxlassxgkoqtypeoxcyuenropphwsnvuniufatnmidiivoyuqyounilcxuzphwkuegcgcpumveuqtumlsbgfltiipjawhmtlsvtumngjucbnwoyorgucbekqpmpwykjrhcntrwflygyxwznnhjpjnczeoqanajghltdfpiqqqrpnscazmsibukgkagxdsfkfzpkqzdiquxdmafnmzwpvgvgieflwlybmpocprlflikzkrmyrkomsjsbnaollonzebbtsoyfzkgjbuisfwhxhbaxbpiofxnjareufebeohqqeykjwrif", diff --git a/Algorithms/0077.combinations/combinations.go b/Algorithms/0077.combinations/combinations.go index cdfa5f00f..9a715bacf 100755 --- a/Algorithms/0077.combinations/combinations.go +++ b/Algorithms/0077.combinations/combinations.go @@ -1,4 +1,4 @@ -package Problem0077 +package problem0077 func combine(n int, k int) [][]int { combination := make([]int, k) diff --git a/Algorithms/0077.combinations/combinations_test.go b/Algorithms/0077.combinations/combinations_test.go index 48368950e..cd47792b5 100755 --- a/Algorithms/0077.combinations/combinations_test.go +++ b/Algorithms/0077.combinations/combinations_test.go @@ -1,4 +1,4 @@ -package Problem0077 +package problem0077 import ( "fmt" diff --git a/Algorithms/0078.subsets/README.md b/Algorithms/0078.subsets/README.md index 816e08959..19d53ec26 100755 --- a/Algorithms/0078.subsets/README.md +++ b/Algorithms/0078.subsets/README.md @@ -1,6 +1,7 @@ # [78. Subsets](https://leetcode.com/problems/subsets/) ## 题目 + Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. @@ -8,7 +9,7 @@ Note: The solution set must not contain duplicate subsets. For example, If nums = [1,2,3], a solution is: -``` +```text [ [3], [1], @@ -19,8 +20,4 @@ If nums = [1,2,3], a solution is: [1,2], [] ] -``` -## 解题思路 -先`run`一下,观察输出结果的队形。再用递归的方式解题。 - -见程序注释 +``` \ No newline at end of file diff --git a/Algorithms/0078.subsets/subsets.go b/Algorithms/0078.subsets/subsets.go index a92c6ccf6..117f5e565 100755 --- a/Algorithms/0078.subsets/subsets.go +++ b/Algorithms/0078.subsets/subsets.go @@ -1,26 +1,11 @@ -package Problem0078 - -import ( - "sort" -) +package problem0078 func subsets(nums []int) [][]int { - res := [][]int{} - - recur(nums, []int{}, &res) - - return res -} - -func recur(nums, temp []int, res *[][]int) { - l := len(nums) - if l == 0 { - sort.Ints(temp) - *res = append(*res, temp) - return + res := make([][]int, 1, 1024) + for _, n := range nums { + for _, r := range res { + res = append(res, append([]int{n}, r...)) + } } - - recur(nums[:l-1], temp, res) - - recur(nums[:l-1], append([]int{nums[l-1]}, temp...), res) + return res } diff --git a/Algorithms/0078.subsets/subsets_test.go b/Algorithms/0078.subsets/subsets_test.go index 5a471a4f7..352d80d6e 100755 --- a/Algorithms/0078.subsets/subsets_test.go +++ b/Algorithms/0078.subsets/subsets_test.go @@ -1,7 +1,8 @@ -package Problem0078 +package problem0078 import ( "fmt" + "sort" "testing" "github.com/stretchr/testify/assert" @@ -32,11 +33,11 @@ func Test_Problem0078(t *testing.T) { []int{1, 2, 3}, }, ans{[][]int{ - []int{}, + nil, []int{1}, []int{2}, - []int{1, 2}, []int{3}, + []int{1, 2}, []int{1, 3}, []int{2, 3}, []int{1, 2, 3}, @@ -45,41 +46,41 @@ func Test_Problem0078(t *testing.T) { question{ para{ - []int{9,0,3,5,7}, + []int{9, 0, 3, 5, 7}, }, ans{[][]int{ - []int{}, - []int{9}, + nil, []int{0}, - []int{0,9}, []int{3}, - []int{3,9}, - []int{0,3}, - []int{0,3,9}, []int{5}, - []int{5,9}, - []int{0,5}, - []int{0,5,9}, - []int{3,5}, - []int{3,5,9}, - []int{0,3,5}, - []int{0,3,5,9}, []int{7}, - []int{7,9}, - []int{0,7}, - []int{0,7,9}, - []int{3,7}, - []int{3,7,9}, - []int{0,3,7}, - []int{0,3,7,9}, - []int{5,7}, - []int{5,7,9}, - []int{0,5,7}, - []int{0,5,7,9}, - []int{3,5,7}, - []int{3,5,7,9}, - []int{0,3,5,7}, - []int{0,3,5,7,9}, + []int{9}, + []int{0, 3}, + []int{0, 5}, + []int{0, 7}, + []int{0, 9}, + []int{3, 5}, + []int{3, 7}, + []int{3, 9}, + []int{5, 7}, + []int{5, 9}, + []int{7, 9}, + []int{0, 3, 5}, + []int{0, 3, 7}, + []int{0, 3, 9}, + []int{0, 5, 7}, + []int{0, 5, 9}, + []int{0, 7, 9}, + []int{3, 5, 7}, + []int{3, 5, 9}, + []int{3, 7, 9}, + []int{5, 7, 9}, + []int{0, 3, 5, 7}, + []int{0, 3, 5, 9}, + []int{0, 3, 7, 9}, + []int{0, 5, 7, 9}, + []int{3, 5, 7, 9}, + []int{0, 3, 5, 7, 9}, }}, }, @@ -89,7 +90,35 @@ func Test_Problem0078(t *testing.T) { for _, q := range qs { a, p := q.ans, q.para fmt.Printf("~~%v~~\n", p) + sorted(a.one) + ans := subsets(p.nums) + sorted(ans) + ast.Equal(a.one, ans, "输入:%v", p) + } +} + +func sorted(iss [][]int) { + for i := range iss { + sort.Ints(iss[i]) + } + sort.Slice(iss, func(i int, j int) bool { + if len(iss[i]) == len(iss[j]) { + for k := range iss[i] { + if iss[i][k] > iss[j][k] { + return false + } + if iss[i][k] < iss[j][k] { + return true + } + } + } + return len(iss[i]) < len(iss[j]) + }) + +} - ast.Equal(a.one, subsets(p.nums), "输入:%v", p) +func Benchmark_subsets(b *testing.B) { + for i := 1; i < b.N; i++ { + subsets([]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) } } diff --git a/Algorithms/0079.word-search/word-search.go b/Algorithms/0079.word-search/word-search.go index 2db9a0d96..c5349b6e4 100755 --- a/Algorithms/0079.word-search/word-search.go +++ b/Algorithms/0079.word-search/word-search.go @@ -1,4 +1,4 @@ -package Problem0079 +package problem0079 func exist(board [][]byte, word string) bool { m := len(board) diff --git a/Algorithms/0079.word-search/word-search_test.go b/Algorithms/0079.word-search/word-search_test.go index fc8009130..072b4ea84 100755 --- a/Algorithms/0079.word-search/word-search_test.go +++ b/Algorithms/0079.word-search/word-search_test.go @@ -1,4 +1,4 @@ -package Problem0079 +package problem0079 import ( "fmt" diff --git a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/README.md b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/README.md index 04e62ffa8..d19324513 100755 --- a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/README.md +++ b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/README.md @@ -1,16 +1,46 @@ # [80. Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) ## 题目 -Follow up for "Remove Duplicates": -What if duplicates are allowed at most twice? +Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. -For example, -Given sorted array nums = `[1,1,1,2,2,3]`, +Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. +Example 1: -Your function should return length = `5`, with the first five elements of nums being `1`, `1`, `2`, `2` and `3`. It doesn't matter what you leave beyond the new length. +```text +Given nums = [1,1,1,2,2,3], -## 解题思路 +Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3 respectively. -见程序注释 +It doesn't matter what you leave beyond the returned length. +``` + +Example 2: + +```text +Given nums = [0,0,1,1,1,1,2,3,3], + +Your function should return length = 7, with the first seven elements of nums being modified to 0, 0, 1, 1, 2, 3 and 3 respectively. + +It doesn't matter what values are set beyond the returned length. +``` + +Clarification: + +Confused why the returned value is an integer but your answer is an array? + +Note that the input array is passed in by reference, which means modification to the input array will be known to the caller as well. + +Internally you can think of this: + +```text +// nums is passed in by reference. (i.e., without making a copy) +int len = removeDuplicates(nums); + +// any modification to nums in your function would be known by the caller. +// using the length returned by your function, it prints the first len elements. +for (int i = 0; i < len; i++) { + print(nums[i]); +} +``` diff --git a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii.go b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii.go index 9cbd866b0..c6bd1ade5 100755 --- a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii.go +++ b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii.go @@ -1,18 +1,31 @@ -package Problem0080 +package problem0080 -func removeDuplicates(nums []int) int { - length := len(nums) - if length <= 2 { - return length - } +func removeDuplicates(a []int) int { + size := len(a) + + i := 2 - res := 2 - for i := 2; i < length; i++ { - if nums[i] != nums[res-2] { - nums[res] = nums[i] - res++ + for j := i; j < size; j++ { + if a[i-2] != a[j] { + a[i] = a[j] + i++ } } - return res + return i } + +// 可以把 a 想象成一层一层摆好的木板,从下往上,索引值变大 +// 重复的多余木板被抽掉,上面的木板就会下落 +// +// i 始终指向下一个合格木板要放置的位置 +// j 始终指向下一个需要检查的木板的位置 +// +// 注意前提条件: a is sorted +// +// a[i-2] != a[j] 说明 a[j] 是合格的木板, +// a[j] 重复次数还没有超过 2 次 +// +// a[i] = a[j] 就是木板下落 +// +// 到最后,i 就成了所有合格木板的数量,也就是 a 合格部分的长度 diff --git a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii_test.go b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii_test.go index a4cd956f7..7dc063b04 100755 --- a/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii_test.go +++ b/Algorithms/0080.remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii_test.go @@ -1,4 +1,4 @@ -package Problem0080 +package problem0080 import ( "fmt" diff --git a/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii.go b/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii.go index f1512deed..ce89ae602 100755 --- a/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii.go +++ b/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii.go @@ -1,4 +1,4 @@ -package Problem0081 +package problem0081 func search(nums []int, target int) bool { length := len(nums) diff --git a/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii_test.go b/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii_test.go index 2af12a8d9..e8b3eec3b 100755 --- a/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii_test.go +++ b/Algorithms/0081.search-in-rotated-sorted-array-ii/search-in-rotated-sorted-array-ii_test.go @@ -1,4 +1,4 @@ -package Problem0081 +package problem0081 import ( "fmt" diff --git a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/README.md b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/README.md index 8dc831fd9..473e4ce11 100755 --- a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/README.md +++ b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/README.md @@ -1,13 +1,17 @@ # [82. Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/) -## 题目 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. +Example 1: + +```text +Input: 1->2->3->3->4->4->5 +Output: 1->2->5 ``` -For example, -Given 1->2->3->3->4->4->5, return 1->2->5. -Given 1->1->1->2->3, return 2->3. -``` -## 解题思路 -见程序注释 +Example 2: + +```text +Input: 1->1->1->2->3 +Output: 2->3 +``` diff --git a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii.go b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii.go index fbc4cec47..ac304737c 100755 --- a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii.go +++ b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii.go @@ -1,4 +1,4 @@ -package Problem0082 +package problem0082 // ListNode is singly-linked list. type ListNode struct { @@ -12,22 +12,15 @@ func deleteDuplicates(head *ListNode) *ListNode { return head } - // 处理 head 重复情况 - // 上面刚刚检查过了,head != nil && head.Next != nil + // 要么 head 重复了,那就删除 head if head.Val == head.Next.Val { - val := head.Val - head = head.Next.Next - - for head != nil && head.Val == val { + for head.Next != nil && head.Val == head.Next.Val { head = head.Next } - - // 值为 val 的 node,已经全部删除了 - return deleteDuplicates(head) + return deleteDuplicates(head.Next) } - // 处理 head 后面元素出现重复的情况 + // 要么 head 不重复,递归处理 head 后面的节点 head.Next = deleteDuplicates(head.Next) - return head } diff --git a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii_test.go b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii_test.go index 7425e75f4..4c6792b42 100755 --- a/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii_test.go +++ b/Algorithms/0082.remove-duplicates-from-sorted-list-ii/remove-duplicates-from-sorted-list-ii_test.go @@ -1,4 +1,4 @@ -package Problem0082 +package problem0082 import ( "fmt" diff --git a/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.go b/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.go index aacc03d6c..47d2a4175 100755 --- a/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.go +++ b/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.go @@ -1,4 +1,4 @@ -package Problem0083 +package problem0083 // ListNode is singly-linked list type ListNode struct { diff --git a/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list_test.go b/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list_test.go index f3983ea77..98f87cd78 100755 --- a/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list_test.go +++ b/Algorithms/0083.remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list_test.go @@ -1,4 +1,4 @@ -package Problem0083 +package problem0083 import ( "fmt" diff --git a/Algorithms/0084.largest-rectangle-in-histogram/README.md b/Algorithms/0084.largest-rectangle-in-histogram/README.md index b827f8ad1..801ea8402 100755 --- a/Algorithms/0084.largest-rectangle-in-histogram/README.md +++ b/Algorithms/0084.largest-rectangle-in-histogram/README.md @@ -1,6 +1,7 @@ # [84. Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) ## 题目 + Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. ![histogram](histogram.png) @@ -11,15 +12,17 @@ Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3]. The largest rectangle is shown in the shaded area, which has area = 10 unit. -``` +```text For example, Given heights = [2,1,5,6,2,3], return 10. ``` ## 解题思路 + 从[这里](http://www.cnblogs.com/ganganloveu/p/4148303.html)复制了以下思路: -``` + +```text 1、如果已知height数组是升序的,应该怎么做? 比如1,2,5,7,8 @@ -56,4 +59,5 @@ return 10. 综上所述,result=10 ``` -具体的解题过程与上面不同,详见程序注释 + +具体的解题过程与上面不同,详见程序注释 \ No newline at end of file diff --git a/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram.go b/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram.go index 74ae1a7ad..a30bfd0eb 100755 --- a/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram.go +++ b/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram.go @@ -1,45 +1,51 @@ -package Problem0084 +package problem0084 func largestRectangleArea(heights []int) int { - // 在 h 结尾添加 -1 可以让 for 循环中,求解 area 的逻辑一致 - h := append(heights, -1) - n := len(h) - - var maxArea, height, left, right, area int - // 如果已知heights数组是升序的,应该怎么做? - // 比如1,2,5,7,8 - // 那么就是(1*5) vs. (2*4) vs. (5*3) vs. (7*2) vs. (8*1) - // 也就是max(height[i]*(size-i)) - // 使用栈的目的就是构造这样的升序序列,按照以上方法求解。 - var stack []int - // stack 中存的是 h 的元素的索引号 - // stack 中索引号对应的 h 中的值,是递增的。 + // 在 heights 中原本是非负的数字 + // 再首尾添加了 -2 和 -1 后,简化 for 循环中 begin 的计算 + heights = append([]int{-2}, heights...) + heights = append(heights, -1) + + size := len(heights) + + // stack 中存的是 heights 的元素的索引号 + // stack 中索引号对应的 heights 中的值,是递增的。 // e.g. // stack = []int{1,3,5},那么 - // h[1] <= h[3] <= h[5] + // heights[1] < heights[3] < heights[5] + stack := make([]int, 1, size) + // 把 heights[0] 的索引号,已经放入了 stack + // end 从 1 开始 + end := 1 - for right < n { - if len(stack) == 0 || h[stack[len(stack)-1]] <= h[right] { - stack = append(stack, right) - right++ + res := 0 + for end < size { + // end 指向了新高,就把 end 放入 stack 后,指向下一个 + if heights[stack[len(stack)-1]] < heights[end] { + stack = append(stack, end) + end++ continue } - height = h[stack[len(stack)-1]] - stack = stack[:len(stack)-1] + begin := stack[len(stack)-2] + index := stack[len(stack)-1] + height := heights[index] + // area 是 heights(begin:end) 之间的最大方块的面积,因为 + // anyone of heights(begin:index) > height > anyone of heights(index:end) + area := (end - begin - 1) * height - if len(stack) == 0 { - left = -1 - } else { - left = stack[len(stack)-1] - } + res = max(res, area) - // area = h[left+1:right] * min(h[left+1:right]) - area = (right - left - 1) * height - if maxArea < area { - maxArea = area - } + // h 的索引号已经没有必要留在 stack 中了 + stack = stack[:len(stack)-1] } - return maxArea + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b } diff --git a/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram_test.go b/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram_test.go index b839a3fbd..2e3daa9e6 100755 --- a/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram_test.go +++ b/Algorithms/0084.largest-rectangle-in-histogram/largest-rectangle-in-histogram_test.go @@ -1,4 +1,4 @@ -package Problem0084 +package problem0084 import ( "fmt" @@ -27,6 +27,24 @@ func Test_Problem0084(t *testing.T) { qs := []question{ + question{ + para{ + []int{1, 100, 101, 1}, + }, + ans{ + 200, + }, + }, + + question{ + para{ + []int{2, 2, 2, 2, 2}, + }, + ans{ + 10, + }, + }, + question{ para{ []int{6, 5, 4, 3, 2, 1}, diff --git a/Algorithms/0085.maximal-rectangle/maximal-rectangle.go b/Algorithms/0085.maximal-rectangle/maximal-rectangle.go index 14255f4e0..4affc5e5a 100755 --- a/Algorithms/0085.maximal-rectangle/maximal-rectangle.go +++ b/Algorithms/0085.maximal-rectangle/maximal-rectangle.go @@ -1,4 +1,4 @@ -package Problem0085 +package problem0085 func maximalRectangle(mat [][]byte) int { m := len(mat) diff --git a/Algorithms/0085.maximal-rectangle/maximal-rectangle_test.go b/Algorithms/0085.maximal-rectangle/maximal-rectangle_test.go index 81e07ff18..8f3edc409 100755 --- a/Algorithms/0085.maximal-rectangle/maximal-rectangle_test.go +++ b/Algorithms/0085.maximal-rectangle/maximal-rectangle_test.go @@ -1,4 +1,4 @@ -package Problem0085 +package problem0085 import ( "testing" diff --git a/Algorithms/0086.partition-list/partition-list.go b/Algorithms/0086.partition-list/partition-list.go index 3320f580c..69b3dad54 100755 --- a/Algorithms/0086.partition-list/partition-list.go +++ b/Algorithms/0086.partition-list/partition-list.go @@ -1,4 +1,4 @@ -package Problem0086 +package problem0086 // ListNode 是链接节点 // 这个不能复制到*_test.go文件中。会导致Travis失败 diff --git a/Algorithms/0086.partition-list/partition-list_test.go b/Algorithms/0086.partition-list/partition-list_test.go index e155019e4..23544564a 100755 --- a/Algorithms/0086.partition-list/partition-list_test.go +++ b/Algorithms/0086.partition-list/partition-list_test.go @@ -1,4 +1,4 @@ -package Problem0086 +package problem0086 import ( "fmt" diff --git a/Algorithms/0087.scramble-string/scramble-string.go b/Algorithms/0087.scramble-string/scramble-string.go index 27916aef0..fe2bcd9ba 100755 --- a/Algorithms/0087.scramble-string/scramble-string.go +++ b/Algorithms/0087.scramble-string/scramble-string.go @@ -1,4 +1,4 @@ -package Problem0087 +package problem0087 func isScramble(a, b string) bool { // 相等的话,则为true diff --git a/Algorithms/0087.scramble-string/scramble-string_test.go b/Algorithms/0087.scramble-string/scramble-string_test.go index fda78b70e..94ac54f06 100755 --- a/Algorithms/0087.scramble-string/scramble-string_test.go +++ b/Algorithms/0087.scramble-string/scramble-string_test.go @@ -1,4 +1,4 @@ -package Problem0087 +package problem0087 import ( "fmt" diff --git a/Algorithms/0088.merge-sorted-array/merge-sorted-array.go b/Algorithms/0088.merge-sorted-array/merge-sorted-array.go index 1285c0f38..6fadb94e7 100755 --- a/Algorithms/0088.merge-sorted-array/merge-sorted-array.go +++ b/Algorithms/0088.merge-sorted-array/merge-sorted-array.go @@ -1,4 +1,4 @@ -package Problem0088 +package problem0088 // 本题的要求是,把nums1的前m项和nums2的前n项合并,放入nums1中。 func merge(nums1 []int, m int, nums2 []int, n int) { diff --git a/Algorithms/0088.merge-sorted-array/merge-sorted-array_test.go b/Algorithms/0088.merge-sorted-array/merge-sorted-array_test.go index 66bb42419..f396d7c0a 100755 --- a/Algorithms/0088.merge-sorted-array/merge-sorted-array_test.go +++ b/Algorithms/0088.merge-sorted-array/merge-sorted-array_test.go @@ -1,4 +1,4 @@ -package Problem0088 +package problem0088 import ( "fmt" diff --git a/Algorithms/0089.gray-code/gray-code.go b/Algorithms/0089.gray-code/gray-code.go index 47235a325..5f35c33da 100755 --- a/Algorithms/0089.gray-code/gray-code.go +++ b/Algorithms/0089.gray-code/gray-code.go @@ -1,4 +1,4 @@ -package Problem0089 +package problem0089 func grayCode(n int) []int { return recur(n, 1, []int{0}) diff --git a/Algorithms/0089.gray-code/gray-code_test.go b/Algorithms/0089.gray-code/gray-code_test.go index d34dd88ca..1cc653cb4 100755 --- a/Algorithms/0089.gray-code/gray-code_test.go +++ b/Algorithms/0089.gray-code/gray-code_test.go @@ -1,4 +1,4 @@ -package Problem0089 +package problem0089 import ( "fmt" diff --git a/Algorithms/0090.subsets-ii/README.md b/Algorithms/0090.subsets-ii/README.md index 0338ee5c9..38f7cf3e1 100755 --- a/Algorithms/0090.subsets-ii/README.md +++ b/Algorithms/0090.subsets-ii/README.md @@ -1,14 +1,13 @@ # [90. Subsets II](https://leetcode.com/problems/subsets-ii/) -## 题目 Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. - For example, -If nums = [1,2,2], a solution is: +```text +If nums = [1,2,2], a solution is: [ [2], @@ -18,8 +17,4 @@ If nums = [1,2,2], a solution is: [1,2], [] ] - -## 解题思路 -观察题目输出结果的规律后,利用dfs解题 - -见程序注释 +``` diff --git a/Algorithms/0090.subsets-ii/subsets-ii.go b/Algorithms/0090.subsets-ii/subsets-ii.go index 97b93a0a6..7591295d7 100755 --- a/Algorithms/0090.subsets-ii/subsets-ii.go +++ b/Algorithms/0090.subsets-ii/subsets-ii.go @@ -1,28 +1,30 @@ -package Problem0090 +package problem0090 import "sort" -func subsetsWithDup(nums []int) [][]int { +func subsetsWithDup(A []int) [][]int { res := [][]int{} - sort.Ints(nums) + sort.Ints(A) var dfs func(int, []int) - dfs = func(idx int, temp []int) { - t := make([]int, len(temp)) - copy(t, temp) - // 没有以上两行,答案就是错的 - // 因为temp的底层数组在递归过程中,不停地修改 - // 程序结束时,temp的底层数组的值,全部是 nums 的最大值。 - res = append(res, t) - - for i := idx; i < len(nums); i++ { - if i == idx || nums[i] != nums[i-1] { - dfs(i+1, append(temp, nums[i])) + dfs = func(index int, temp []int) { + res = append(res, temp) + n := len(temp) + 1 + for i := index; i < len(A); i++ { + // if 语句的含义是, + // 在 A[index:] 中,每个数字只能附着到 temp 中一次 + // 判断方法是 A[i] != A[i-1] + // 但是 A[index] == A[index-1] 也没有关系 + // 因为 A[index-1] 不在 A[index:] 中 + // 而且,需要执行 A[i]!=A[i-1] 时, + // 可以肯定 i>=1,所以,不需要验证 i-1>=0 + if i == index || A[i] != A[i-1] { + dfs(i+1, append(temp, A[i])[:n:n]) } } } - temp := make([]int, 0, len(nums)) + temp := make([]int, 0, 0) dfs(0, temp) return res diff --git a/Algorithms/0090.subsets-ii/subsets-ii_test.go b/Algorithms/0090.subsets-ii/subsets-ii_test.go index 86d10b104..62dccfe7f 100755 --- a/Algorithms/0090.subsets-ii/subsets-ii_test.go +++ b/Algorithms/0090.subsets-ii/subsets-ii_test.go @@ -1,76 +1,43 @@ -package Problem0090 +package problem0090 import ( - "fmt" "testing" "github.com/stretchr/testify/assert" ) -type question struct { - para - ans -} +// tcs is testcase slice +var tcs = []struct { + A []int + ans [][]int +}{ -// para 是参数 -type para struct { - nums []int -} + { + []int{1, 2, 2}, + [][]int{[]int{}, []int{1}, []int{1, 2}, []int{1, 2, 2}, []int{2}, []int{2, 2}}, + }, -// ans 是答案 -type ans struct { - one [][]int -} + { + []int{2, 1, 2, 1, 3}, + [][]int{{}, {1}, {1, 1}, {1, 1, 2}, {1, 1, 2, 2}, {1, 1, 2, 2, 3}, {1, 1, 2, 3}, {1, 1, 3}, {1, 2}, {1, 2, 2}, {1, 2, 2, 3}, {1, 2, 3}, {1, 3}, {2}, {2, 2}, {2, 2, 3}, {2, 3}, {3}}, -func Test_Problem0090(t *testing.T) { - ast := assert.New(t) + }, - qs := []question{ + // 可以有多个 testcase +} - question{ - para{ - []int{1, 2, 2}, - }, - ans{ - [][]int{ - []int{}, - []int{1}, - []int{1, 2}, - []int{1, 2, 2}, - []int{2}, - []int{2, 2}, - }, - }, - }, +func Test_subsetsWithDup(t *testing.T) { + ast := assert.New(t) - question{ - para{ - []int{1, 2, 2, 3}, - }, - ans{ - [][]int{ - []int{}, - []int{1}, - []int{1, 2}, - []int{1, 2, 2}, - []int{1, 2, 2, 3}, - []int{1, 2, 3}, - []int{1, 3}, - []int{2}, - []int{2, 2}, - []int{2, 2, 3}, - []int{2, 3}, - []int{3}, - }, - }, - }, - // 如需多个测试,可以复制上方元素。 + for _, tc := range tcs { + ast.Equal(tc.ans, subsetsWithDup(tc.A), "输入:%v", tc) } +} - for _, q := range qs { - a, p := q.ans, q.para - fmt.Printf("~~%v~~\n", p) - - ast.Equal(a.one, subsetsWithDup(p.nums), "输入:%v", p) +func Benchmark_subsetsWithDup(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + subsetsWithDup(tc.A) + } } } diff --git a/Algorithms/0091.decode-ways/README.md b/Algorithms/0091.decode-ways/README.md index afd426aef..fbfdd5be1 100755 --- a/Algorithms/0091.decode-ways/README.md +++ b/Algorithms/0091.decode-ways/README.md @@ -1,24 +1,28 @@ # [91. Decode Ways](https://leetcode.com/problems/decode-ways/) -## 题目 -A message containing letters from `A-Z` is being encoded to numbers using the following mapping: +A message containing letters from A-Z is being encoded to numbers using the following mapping: -``` +```text 'A' -> 1 'B' -> 2 ... 'Z' -> 26 ``` -Given an encoded message containing digits, determine the total number of ways to decode it. +Given a non-empty string containing only digits, determine the total number of ways to decode it. -``` -For example, -Given encoded message "12", -it could be decoded as "AB" (1 2) or "L" (12). -The number of ways decoding "12" is 2. +Example 1: + +```text +Input: "12" +Output: 2 +Explanation: It could be decoded as "AB" (1 2) or "L" (12). ``` -## 解题思路 +Example 2: -见程序注释 +```text +Input: "226" +Output: 3 +Explanation: It could be decoded as "BZ" (2 26), "VF" (22 6), or "BBF" (2 2 6). +``` diff --git a/Algorithms/0091.decode-ways/decode-ways.go b/Algorithms/0091.decode-ways/decode-ways.go index 335a2ca4f..8fbeb995e 100755 --- a/Algorithms/0091.decode-ways/decode-ways.go +++ b/Algorithms/0091.decode-ways/decode-ways.go @@ -1,60 +1,25 @@ -package Problem0091 +package problem0091 func numDecodings(s string) int { - n := len(s) - if n == 0 { + if s[0] == '0' { return 0 } + n := len(s) dp := make([]int, n+1) - // dp[i] 表示 s[:i+1] 的组成方式数 - dp[0], dp[1] = 1, one(s[0:1]) - + // dp[i] 表示 s[:i] 的组成方式数 + dp[0], dp[1] = 1, 1 + lastOne, lastTwo := int(s[0]-'0'), 0 for i := 2; i <= n; i++ { - w1, w2 := one(s[i-1:i]), two(s[i-2:i]) - dp[i] = dp[i-1]*w1 + dp[i-2]*w2 - if dp[i] == 0 { - // 子字符串 s[:i+1] 的组成方式数为 0 - // 则,s 的组成方式数肯定也为 0 - // 这时可以提前结束 - return 0 + last := int(s[i-1] - '0') + lastOne, lastTwo = last, lastOne*10+last + if 1 <= lastOne { + dp[i] = dp[i-1] + } + if 10 <= lastTwo && lastTwo <= 26 { + dp[i] += dp[i-2] } } return dp[n] } - -// 检查 s 是否为合格的单字符 -// len(s) == 1 -// 合格, 返回 1 -// 不合格, 返回 0 -// 注意: -// 题目保证了 s 只含有数字 -func one(s string) int { - if s == "0" { - return 0 - } - return 1 -} - -// 检查 s 是否为合格的双字符 -// len(s) == 2 -// 合格, 返回 1 -// 不合格, 返回 0 -// 注意: -// 题目保证了 s 只含有数字 -func two(s string) int { - switch s[0] { - case '1': - return 1 - case '2': - if s[1] == '7' || s[1] == '8' || s[1] == '9' { - return 0 - } - return 1 - default: - // '3' <= s[0] && s[0] <= '9',或 - // s[0] == '0' - return 0 - } -} diff --git a/Algorithms/0091.decode-ways/decode-ways_test.go b/Algorithms/0091.decode-ways/decode-ways_test.go index 5e14ea1dc..52ba5c328 100755 --- a/Algorithms/0091.decode-ways/decode-ways_test.go +++ b/Algorithms/0091.decode-ways/decode-ways_test.go @@ -1,214 +1,132 @@ -package Problem0091 +package problem0091 import ( - "fmt" "testing" "github.com/stretchr/testify/assert" ) -type question struct { - para - ans +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "203", + 1, + }, + + { + "546313216586746123648561321321564321657651231365456475642312356486765123156465132546543213546316543465465465465427", + 5038848, + }, + + { + "027", + 0, + }, + + { + "27", + 1, + }, + + { + "1", + 1, + }, + + { + "119", + 3, + }, + + { + "2011", + 2, + }, + + { + "1192", + 3, + }, + + { + "1102", + 1, + }, + + { + "1128", + 3, + }, + + { + "1", + 1, + }, + + { + "12", + 2, + }, + + { + "121", + 3, + }, + + { + "1212", + 5, + }, + + { + "12121", + 8, + }, + + { + "121212", + 13, + }, + + { + "1212121", + 21, + }, + + { + "12121212", + 34, + }, + + { + "12", + 2, + }, + + { + "226", + 3, + }, + + // 可以有多个 testcase } -// para 是参数 -type para struct { - s string -} - -// ans 是答案 -type ans struct { - one int -} - -func Test_Problem0091(t *testing.T) { +func Test_numDecodings(t *testing.T) { ast := assert.New(t) - qs := []question{ - - question{ - para{ - "27", - }, - ans{ - 1, - }, - }, - question{ - para{ - "", - }, - ans{ - 0, - }, - }, - - question{ - para{ - "0", - }, - ans{ - 0, - }, - }, - - question{ - para{ - "1", - }, - ans{ - 1, - }, - }, - - question{ - para{ - "203", - }, - ans{ - 1, - }, - }, - - question{ - para{ - "119", - }, - ans{ - 3, - }, - }, - question{ - para{ - "2011", - }, - ans{ - 2, - }, - }, - - question{ - para{ - "1192", - }, - ans{ - 3, - }, - }, - - question{ - para{ - "1102", - }, - ans{ - 1, - }, - }, - - question{ - para{ - "1100", - }, - ans{ - 0, - }, - }, - - question{ - para{ - "1190", - }, - ans{ - 0, - }, - }, - - question{ - para{ - "1128", - }, - ans{ - 3, - }, - }, - - question{ - para{ - "1", - }, - ans{ - 1, - }, - }, - - question{ - para{ - "12", - }, - ans{ - 2, - }, - }, - - question{ - para{ - "121", - }, - ans{ - 3, - }, - }, - question{ - para{ - "1212", - }, - ans{ - 5, - }, - }, - - question{ - para{ - "12121", - }, - ans{ - 8, - }, - }, - - question{ - para{ - "121212", - }, - ans{ - 13, - }, - }, - - question{ - para{ - "1212121", - }, - ans{ - 21, - }, - }, - question{ - para{ - "12121212", - }, - ans{ - 34, - }, - }, - // 如需多个测试,可以复制上方元素。 + for _, tc := range tcs { + ast.Equal(tc.ans, numDecodings(tc.s), "输入:%v", tc) } +} - for _, q := range qs { - a, p := q.ans, q.para - fmt.Printf("~~%v~~\n", p) - - ast.Equal(a.one, numDecodings(p.s), "输入:%v", p) +func Benchmark_numDecodings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numDecodings(tc.s) + } } } diff --git a/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii.go b/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii.go index e2e5439d7..40533f70c 100755 --- a/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii.go +++ b/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii.go @@ -1,4 +1,4 @@ -package Problem0092 +package problem0092 // ListNode is Definition for singly-linked list. type ListNode struct { diff --git a/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii_test.go b/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii_test.go index e2256928b..0852ef62c 100755 --- a/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii_test.go +++ b/Algorithms/0092.reverse-linked-list-ii/reverse-linked-list-ii_test.go @@ -1,4 +1,4 @@ -package Problem0092 +package problem0092 import ( "fmt" diff --git a/Algorithms/0093.restore-ip-addresses/restore-ip-addresses.go b/Algorithms/0093.restore-ip-addresses/restore-ip-addresses.go index 73753e0bd..19e70c013 100755 --- a/Algorithms/0093.restore-ip-addresses/restore-ip-addresses.go +++ b/Algorithms/0093.restore-ip-addresses/restore-ip-addresses.go @@ -1,4 +1,4 @@ -package Problem0093 +package problem0093 import ( "fmt" diff --git a/Algorithms/0093.restore-ip-addresses/restore-ip-addresses_test.go b/Algorithms/0093.restore-ip-addresses/restore-ip-addresses_test.go index 73823a464..33ccd1a4c 100755 --- a/Algorithms/0093.restore-ip-addresses/restore-ip-addresses_test.go +++ b/Algorithms/0093.restore-ip-addresses/restore-ip-addresses_test.go @@ -1,4 +1,4 @@ -package Problem0093 +package problem0093 import ( "fmt" diff --git a/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal.go b/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal.go index cfca37d65..9e40ab974 100755 --- a/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal.go +++ b/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal.go @@ -1,4 +1,4 @@ -package Problem0094 +package problem0094 // TreeNode Definition for a binary tree node. type TreeNode struct { diff --git a/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal_test.go b/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal_test.go index de462c06b..26bd221ea 100755 --- a/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal_test.go +++ b/Algorithms/0094.binary-tree-inorder-traversal/binary-tree-inorder-traversal_test.go @@ -1,4 +1,4 @@ -package Problem0094 +package problem0094 import ( "fmt" diff --git a/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii.go b/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii.go index 7871212b7..e77d594c8 100755 --- a/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii.go +++ b/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii.go @@ -1,8 +1,8 @@ -package Problem0095 +package problem0095 import ( "fmt" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii_test.go b/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii_test.go index 5068eda0f..427b6e7a5 100755 --- a/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii_test.go +++ b/Algorithms/0095.unique-binary-search-trees-ii/unique-binary-search-trees-ii_test.go @@ -1,10 +1,10 @@ -package Problem0095 +package problem0095 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees.go b/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees.go index d9095d9f0..65e3a37f1 100755 --- a/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees.go +++ b/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees.go @@ -1,4 +1,4 @@ -package Problem0096 +package problem0096 func numTrees(n int) int { if n == 0 { diff --git a/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees_test.go b/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees_test.go index 473c1f2e0..fd286fce5 100755 --- a/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees_test.go +++ b/Algorithms/0096.unique-binary-search-trees/unique-binary-search-trees_test.go @@ -1,4 +1,4 @@ -package Problem0096 +package problem0096 import ( "fmt" diff --git a/Algorithms/0097.interleaving-string/interleaving-string.go b/Algorithms/0097.interleaving-string/interleaving-string.go index 1e903b05a..9f32e5542 100755 --- a/Algorithms/0097.interleaving-string/interleaving-string.go +++ b/Algorithms/0097.interleaving-string/interleaving-string.go @@ -1,4 +1,4 @@ -package Problem0097 +package problem0097 func isInterleave(s1 string, s2 string, s3 string) bool { m, n := len(s1), len(s2) diff --git a/Algorithms/0097.interleaving-string/interleaving-string_test.go b/Algorithms/0097.interleaving-string/interleaving-string_test.go index c8b2e648a..32846bb50 100755 --- a/Algorithms/0097.interleaving-string/interleaving-string_test.go +++ b/Algorithms/0097.interleaving-string/interleaving-string_test.go @@ -1,4 +1,4 @@ -package Problem0097 +package problem0097 import ( "fmt" diff --git a/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree.go b/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree.go index 9604d869a..45706fc17 100755 --- a/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree.go +++ b/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree.go @@ -1,13 +1,13 @@ -package Problem0098 +package problem0098 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode func isValidBST(root *TreeNode) bool { - // Golang int 类型的最小值与最大值 + // Go int 类型的最小值与最大值 MIN, MAX := -1<<63, 1<<63-1 return recur(MIN, MAX, root) diff --git a/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree_test.go b/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree_test.go index 4a20680ae..0491f461e 100755 --- a/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree_test.go +++ b/Algorithms/0098.validate-binary-search-tree/validate-binary-search-tree_test.go @@ -1,10 +1,10 @@ -package Problem0098 +package problem0098 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree.go b/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree.go index d183d64e8..909b15c23 100755 --- a/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree.go +++ b/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree.go @@ -1,7 +1,7 @@ -package Problem0099 +package problem0099 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree_test.go b/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree_test.go index 8c084a51e..0cfe49542 100755 --- a/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree_test.go +++ b/Algorithms/0099.recover-binary-search-tree/recover-binary-search-tree_test.go @@ -1,10 +1,10 @@ -package Problem0099 +package problem0099 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0100.same-tree/same-tree.go b/Algorithms/0100.same-tree/same-tree.go index d3f9022ff..62f920337 100755 --- a/Algorithms/0100.same-tree/same-tree.go +++ b/Algorithms/0100.same-tree/same-tree.go @@ -1,7 +1,7 @@ -package Problem0100 +package problem0100 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0100.same-tree/same-tree_test.go b/Algorithms/0100.same-tree/same-tree_test.go index bde10dc29..40034445a 100755 --- a/Algorithms/0100.same-tree/same-tree_test.go +++ b/Algorithms/0100.same-tree/same-tree_test.go @@ -1,10 +1,10 @@ -package Problem0100 +package problem0100 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0101.symmetric-tree/symmetric-tree.go b/Algorithms/0101.symmetric-tree/symmetric-tree.go index 37e14fbeb..09a1c68e4 100755 --- a/Algorithms/0101.symmetric-tree/symmetric-tree.go +++ b/Algorithms/0101.symmetric-tree/symmetric-tree.go @@ -1,7 +1,7 @@ -package Problem0101 +package problem0101 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0101.symmetric-tree/symmetric-tree_test.go b/Algorithms/0101.symmetric-tree/symmetric-tree_test.go index 167f0f062..19e2e3804 100755 --- a/Algorithms/0101.symmetric-tree/symmetric-tree_test.go +++ b/Algorithms/0101.symmetric-tree/symmetric-tree_test.go @@ -1,10 +1,10 @@ -package Problem0101 +package problem0101 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal.go b/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal.go index a3fa819e3..42f2bd7ed 100755 --- a/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal.go +++ b/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal.go @@ -1,7 +1,7 @@ -package Problem0102 +package problem0102 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal_test.go b/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal_test.go index 935ebe083..bd793b11e 100755 --- a/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal_test.go +++ b/Algorithms/0102.binary-tree-level-order-traversal/binary-tree-level-order-traversal_test.go @@ -1,8 +1,8 @@ -package Problem0102 +package problem0102 import ( "fmt" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "testing" "github.com/stretchr/testify/assert" diff --git a/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.go b/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.go index 9ee3f1b1c..a5fdc0314 100755 --- a/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.go +++ b/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal.go @@ -1,7 +1,7 @@ -package Problem0103 +package problem0103 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal_test.go b/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal_test.go index d24bd0891..51da259c2 100755 --- a/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal_test.go +++ b/Algorithms/0103.binary-tree-zigzag-level-order-traversal/binary-tree-zigzag-level-order-traversal_test.go @@ -1,10 +1,10 @@ -package Problem0103 +package problem0103 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.go b/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.go index 196bd2ea9..b3fb4ed42 100755 --- a/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.go +++ b/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.go @@ -1,7 +1,7 @@ -package Problem0104 +package problem0104 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree_test.go b/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree_test.go index 6a704a4ac..8ec694d2b 100755 --- a/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree_test.go +++ b/Algorithms/0104.maximum-depth-of-binary-tree/maximum-depth-of-binary-tree_test.go @@ -1,10 +1,10 @@ -package Problem0104 +package problem0104 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.go b/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.go index 38ea92290..5754a0d61 100755 --- a/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.go +++ b/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.go @@ -1,6 +1,6 @@ -package Problem0105 +package problem0105 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal_test.go b/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal_test.go index a486a66ef..1e86c8891 100755 --- a/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal_test.go +++ b/Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal_test.go @@ -1,10 +1,10 @@ -package Problem0105 +package problem0105 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal.go b/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal.go index ecf24e4aa..33d984112 100755 --- a/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal.go +++ b/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal.go @@ -1,7 +1,7 @@ -package Problem0106 +package problem0106 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal_test.go b/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal_test.go index b82c45aa6..76298a809 100755 --- a/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal_test.go +++ b/Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal/construct-binary-tree-from-inorder-and-postorder-traversal_test.go @@ -1,10 +1,10 @@ -package Problem0106 +package problem0106 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii.go b/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii.go index 2ac3f2c18..772e62d28 100755 --- a/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii.go +++ b/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii.go @@ -1,7 +1,7 @@ -package Problem0107 +package problem0107 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii_test.go b/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii_test.go index 1c4231f4a..52b98e3e7 100755 --- a/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii_test.go +++ b/Algorithms/0107.binary-tree-level-order-traversal-ii/binary-tree-level-order-traversal-ii_test.go @@ -1,10 +1,10 @@ -package Problem0107 +package problem0107 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.go b/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.go index e9c4676b1..b2e63b6b3 100755 --- a/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.go +++ b/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree.go @@ -1,7 +1,7 @@ -package Problem0108 +package problem0108 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree_test.go b/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree_test.go index fb5fb9e36..500dac3ad 100755 --- a/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree_test.go +++ b/Algorithms/0108.convert-sorted-array-to-binary-search-tree/convert-sorted-array-to-binary-search-tree_test.go @@ -1,10 +1,10 @@ -package Problem0108 +package problem0108 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/README.md b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/README.md index 013730a24..ce494a578 100755 --- a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/README.md +++ b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/README.md @@ -1,8 +1,25 @@ # [109. Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/) ## 题目 + Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. +For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. + +Example: + +```text +Given the sorted linked list: [-10,-3,0,5,9], + +One possible answer is: [0,-3,9,-10,null,5], which represents the following height balanced BST: + + 0 + / \ + -3 9 + / / + -10 5 +``` + ## 解题思路 见程序注释 diff --git a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.go b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.go index 08ba241fd..8358572ff 100755 --- a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.go +++ b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.go @@ -1,35 +1,39 @@ -package Problem0109 +package problem0109 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) +// ListNode is 题目预先定义的数据结构 type ListNode = kit.ListNode + +// TreeNode is 题目预先定义的数据结构 type TreeNode = kit.TreeNode func sortedListToBST(head *ListNode) *TreeNode { - return sortedArrayToBST(list2Slice(head)) + return transMidToRoot(head, nil) } -func list2Slice(head *ListNode) []int { - res := []int{} - for head != nil { - res = append(res, head.Val) - head = head.Next +func transMidToRoot(begin, end *ListNode) *TreeNode { + if begin == end { + return nil } - return res -} + if begin.Next == end { + return &TreeNode{Val: begin.Val} + } -func sortedArrayToBST(nums []int) *TreeNode { - if len(nums) == 0 { - return nil + fast, slow := begin, begin + for fast != end && fast.Next != end { + fast = fast.Next.Next + slow = slow.Next } - mid := len(nums) / 2 + mid := slow + return &TreeNode{ - Val: nums[mid], - Left: sortedArrayToBST(nums[:mid]), - Right: sortedArrayToBST(nums[mid+1:]), + Val: mid.Val, + Left: transMidToRoot(begin, mid), + Right: transMidToRoot(mid.Next, end), } } diff --git a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree_test.go b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree_test.go index c5746ad00..c44e740de 100755 --- a/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree_test.go +++ b/Algorithms/0109.convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree_test.go @@ -1,10 +1,10 @@ -package Problem0109 +package problem0109 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) @@ -34,6 +34,6 @@ func Test_Problem0109(t *testing.T) { for _, tc := range tcs { fmt.Printf("~~%v~~\n", tc) - ast.Equal(tc.ans, kit.Tree2Inorder(sortedListToBST(kit.Slice2List(tc.head))), "输入:%v", tc) + ast.Equal(tc.ans, kit.Tree2Inorder(sortedListToBST(kit.Ints2List(tc.head))), "输入:%v", tc) } } diff --git a/Algorithms/0110.balanced-binary-tree/balanced-binary-tree.go b/Algorithms/0110.balanced-binary-tree/balanced-binary-tree.go index 3e99fdd0d..7f31cc8cb 100755 --- a/Algorithms/0110.balanced-binary-tree/balanced-binary-tree.go +++ b/Algorithms/0110.balanced-binary-tree/balanced-binary-tree.go @@ -1,7 +1,7 @@ -package Problem0110 +package problem0110 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0110.balanced-binary-tree/balanced-binary-tree_test.go b/Algorithms/0110.balanced-binary-tree/balanced-binary-tree_test.go index 3b93b9b83..9f0af3c35 100755 --- a/Algorithms/0110.balanced-binary-tree/balanced-binary-tree_test.go +++ b/Algorithms/0110.balanced-binary-tree/balanced-binary-tree_test.go @@ -1,10 +1,10 @@ -package Problem0110 +package problem0110 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree.go b/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree.go index aac711ee9..88b2ebc00 100755 --- a/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree.go +++ b/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree.go @@ -1,7 +1,7 @@ -package Problem0111 +package problem0111 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree_test.go b/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree_test.go index 2f29eda5b..4da3ed3d0 100755 --- a/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree_test.go +++ b/Algorithms/0111.minimum-depth-of-binary-tree/minimum-depth-of-binary-tree_test.go @@ -1,10 +1,10 @@ -package Problem0111 +package problem0111 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0112.path-sum/path-sum.go b/Algorithms/0112.path-sum/path-sum.go index 0cac5bdee..a4d0fd656 100755 --- a/Algorithms/0112.path-sum/path-sum.go +++ b/Algorithms/0112.path-sum/path-sum.go @@ -1,7 +1,7 @@ -package Problem0112 +package problem0112 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0112.path-sum/path-sum_test.go b/Algorithms/0112.path-sum/path-sum_test.go index f8bc376f0..ca69f21a7 100755 --- a/Algorithms/0112.path-sum/path-sum_test.go +++ b/Algorithms/0112.path-sum/path-sum_test.go @@ -1,10 +1,10 @@ -package Problem0112 +package problem0112 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0113.path-sum-ii/path-sum-ii.go b/Algorithms/0113.path-sum-ii/path-sum-ii.go index 38fe38918..ea532b2d1 100755 --- a/Algorithms/0113.path-sum-ii/path-sum-ii.go +++ b/Algorithms/0113.path-sum-ii/path-sum-ii.go @@ -1,7 +1,7 @@ -package Problem0113 +package problem0113 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0113.path-sum-ii/path-sum-ii_test.go b/Algorithms/0113.path-sum-ii/path-sum-ii_test.go index 69b742627..8aa11f0f5 100755 --- a/Algorithms/0113.path-sum-ii/path-sum-ii_test.go +++ b/Algorithms/0113.path-sum-ii/path-sum-ii_test.go @@ -1,10 +1,10 @@ -package Problem0113 +package problem0113 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.go b/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.go index a9479246f..3bd87f79a 100755 --- a/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.go +++ b/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.go @@ -1,7 +1,7 @@ -package Problem0114 +package problem0114 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list_test.go b/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list_test.go index ae8fe5595..158d8736e 100755 --- a/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list_test.go +++ b/Algorithms/0114.flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list_test.go @@ -1,10 +1,10 @@ -package Problem0114 +package problem0114 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0115.distinct-subsequences/distinct-subsequences.go b/Algorithms/0115.distinct-subsequences/distinct-subsequences.go index af5c4d1b8..bd38f02eb 100755 --- a/Algorithms/0115.distinct-subsequences/distinct-subsequences.go +++ b/Algorithms/0115.distinct-subsequences/distinct-subsequences.go @@ -1,4 +1,4 @@ -package Problem0115 +package problem0115 func numDistinct(s string, t string) int { m, n := len(s), len(t) diff --git a/Algorithms/0115.distinct-subsequences/distinct-subsequences_test.go b/Algorithms/0115.distinct-subsequences/distinct-subsequences_test.go index 9bf0cff33..5808ad002 100755 --- a/Algorithms/0115.distinct-subsequences/distinct-subsequences_test.go +++ b/Algorithms/0115.distinct-subsequences/distinct-subsequences_test.go @@ -1,4 +1,4 @@ -package Problem0115 +package problem0115 import ( "fmt" diff --git a/Algorithms/0118.pascals-triangle/pascals-triangle.go b/Algorithms/0118.pascals-triangle/pascals-triangle.go index b9f453c41..4ed3078e7 100755 --- a/Algorithms/0118.pascals-triangle/pascals-triangle.go +++ b/Algorithms/0118.pascals-triangle/pascals-triangle.go @@ -1,4 +1,4 @@ -package Problem0118 +package problem0118 func generate(numRows int) [][]int { res := [][]int{} diff --git a/Algorithms/0118.pascals-triangle/pascals-triangle_test.go b/Algorithms/0118.pascals-triangle/pascals-triangle_test.go index e8163bc91..4f6dc6ede 100755 --- a/Algorithms/0118.pascals-triangle/pascals-triangle_test.go +++ b/Algorithms/0118.pascals-triangle/pascals-triangle_test.go @@ -1,4 +1,4 @@ -package Problem0118 +package problem0118 import ( "fmt" diff --git a/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii.go b/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii.go index 257d9b1bb..1a4e68c09 100755 --- a/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii.go +++ b/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii.go @@ -1,4 +1,4 @@ -package Problem0119 +package problem0119 func getRow(rowIndex int) []int { res := make([]int, 1, rowIndex+1) diff --git a/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii_test.go b/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii_test.go index c690f1b55..7506684a9 100755 --- a/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii_test.go +++ b/Algorithms/0119.pascals-triangle-ii/pascals-triangle-ii_test.go @@ -1,4 +1,4 @@ -package Problem0119 +package problem0119 import ( "fmt" diff --git a/Algorithms/0120.triangle/triangle.go b/Algorithms/0120.triangle/triangle.go index dfc554eae..e8b7681a1 100755 --- a/Algorithms/0120.triangle/triangle.go +++ b/Algorithms/0120.triangle/triangle.go @@ -1,4 +1,4 @@ -package Problem0120 +package problem0120 func minimumTotal(triangle [][]int) int { n := len(triangle) diff --git a/Algorithms/0120.triangle/triangle_test.go b/Algorithms/0120.triangle/triangle_test.go index a140741b3..ba4cded7e 100755 --- a/Algorithms/0120.triangle/triangle_test.go +++ b/Algorithms/0120.triangle/triangle_test.go @@ -1,4 +1,4 @@ -package Problem0120 +package problem0120 import ( "fmt" diff --git a/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.go b/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.go index 22bdb29ee..69b2de532 100755 --- a/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.go +++ b/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.go @@ -1,4 +1,4 @@ -package Problem0121 +package problem0121 func maxProfit(prices []int) int { max := 0 diff --git a/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock_test.go b/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock_test.go index dc7d017ec..adfcbeabd 100755 --- a/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock_test.go +++ b/Algorithms/0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock_test.go @@ -1,4 +1,4 @@ -package Problem0121 +package problem0121 import ( "fmt" diff --git a/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.go b/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.go index 95dbf38bc..27f92ab36 100755 --- a/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.go +++ b/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii.go @@ -1,4 +1,4 @@ -package Problem0122 +package problem0122 func maxProfit(prices []int) int { res := 0 diff --git a/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii_test.go b/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii_test.go index 2dcbd5165..f6ec63839 100755 --- a/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii_test.go +++ b/Algorithms/0122.best-time-to-buy-and-sell-stock-ii/best-time-to-buy-and-sell-stock-ii_test.go @@ -1,4 +1,4 @@ -package Problem0122 +package problem0122 import ( "fmt" diff --git a/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.go b/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.go index f5cf35add..1e67c842d 100755 --- a/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.go +++ b/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.go @@ -1,4 +1,4 @@ -package Problem0123 +package problem0123 func maxProfit(prices []int) int { size := len(prices) diff --git a/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii_test.go b/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii_test.go index 5012e4a89..720cd378a 100755 --- a/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii_test.go +++ b/Algorithms/0123.best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii_test.go @@ -1,4 +1,4 @@ -package Problem0123 +package problem0123 import ( "fmt" diff --git a/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum.go b/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum.go index ed41d3edb..7fe5f2671 100755 --- a/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum.go +++ b/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum.go @@ -1,7 +1,7 @@ -package Problem0124 +package problem0124 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum_test.go b/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum_test.go index ef1922d96..b61b6f01b 100755 --- a/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum_test.go +++ b/Algorithms/0124.binary-tree-maximum-path-sum/binary-tree-maximum-path-sum_test.go @@ -1,10 +1,10 @@ -package Problem0124 +package problem0124 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0125.valid-palindrome/valid-palindrome.go b/Algorithms/0125.valid-palindrome/valid-palindrome.go index 1983d0e45..d9ebe8cef 100755 --- a/Algorithms/0125.valid-palindrome/valid-palindrome.go +++ b/Algorithms/0125.valid-palindrome/valid-palindrome.go @@ -1,4 +1,4 @@ -package Problem0125 +package problem0125 import ( "strings" diff --git a/Algorithms/0125.valid-palindrome/valid-palindrome_test.go b/Algorithms/0125.valid-palindrome/valid-palindrome_test.go index 08b180bc8..61dd63485 100755 --- a/Algorithms/0125.valid-palindrome/valid-palindrome_test.go +++ b/Algorithms/0125.valid-palindrome/valid-palindrome_test.go @@ -1,4 +1,4 @@ -package Problem0125 +package problem0125 import ( "fmt" diff --git a/Algorithms/0126.word-ladder-ii/word-ladder-ii.go b/Algorithms/0126.word-ladder-ii/word-ladder-ii.go index f8218c34f..d27713738 100755 --- a/Algorithms/0126.word-ladder-ii/word-ladder-ii.go +++ b/Algorithms/0126.word-ladder-ii/word-ladder-ii.go @@ -1,4 +1,4 @@ -package Problem0126 +package problem0126 func findLadders(beginWord string, endWord string, words []string) [][]string { // 因为 beginWord 不能做 transformed word diff --git a/Algorithms/0126.word-ladder-ii/word-ladder-ii_test.go b/Algorithms/0126.word-ladder-ii/word-ladder-ii_test.go index 8218d8c56..3bf27297d 100755 --- a/Algorithms/0126.word-ladder-ii/word-ladder-ii_test.go +++ b/Algorithms/0126.word-ladder-ii/word-ladder-ii_test.go @@ -1,4 +1,4 @@ -package Problem0126 +package problem0126 import ( "fmt" diff --git a/Algorithms/0127.word-ladder/127.100.png b/Algorithms/0127.word-ladder/127.100.png new file mode 100644 index 000000000..cef950144 Binary files /dev/null and b/Algorithms/0127.word-ladder/127.100.png differ diff --git a/Algorithms/0127.word-ladder/README.md b/Algorithms/0127.word-ladder/README.md index d3b8f4a29..8d9a33b75 100755 --- a/Algorithms/0127.word-ladder/README.md +++ b/Algorithms/0127.word-ladder/README.md @@ -26,3 +26,6 @@ The wordList parameter had been changed to a list of strings (instead of a set o ## 解题思路 见程序注释 + +反复尝试以后,将最短时间降低了 2 毫秒。 +![100%](127.100.png) \ No newline at end of file diff --git a/Algorithms/0127.word-ladder/word-ladder.go b/Algorithms/0127.word-ladder/word-ladder.go index 45af40d3e..85527162f 100755 --- a/Algorithms/0127.word-ladder/word-ladder.go +++ b/Algorithms/0127.word-ladder/word-ladder.go @@ -1,77 +1,76 @@ -package Problem0127 +package problem0127 func ladderLength(beginWord string, endWord string, words []string) int { - dictMap := make(map[string]byte) - + // 把 words 存入字典 + // 可以利用快速地添加,删除和查找单词 + dict := make(map[string]bool, len(words)) for i := 0; i < len(words); i++ { - if _, ok := dictMap[words[i]]; !ok { - dictMap[words[i]] = byte(1) - } + dict[words[i]] = true } + // 删除 dict 中的 beginWord + delete(dict, beginWord) - var wq wordQueue - dist := 2 + // queue 用于存放被 trans 到的 word + queue := make([]string, 0, len(words)) - addNextWords(beginWord, dictMap, &wq) - for !wq.empty() { - wqLen := wq.size() - for i := 0; i < wqLen; i++ { - word := wq.popNext() - if word == endWord { - return dist - } + var trans func(string) bool + // trans 用来把 words 中 word 能够 trans 到的单词,放入 queue + // 如果 trans 过程中,遇到了 endWord,则返回 true + trans = func(word string) bool { + bytes := []byte(word) + for i := 0; i < len(bytes); i++ { + diffLetter := bytes[i] + // 找出仅在索引 i 上不同的单词 + for j := 0; j < 26; j++ { + b := 'a' + byte(j) + if b == diffLetter { + continue + } - addNextWords(word, dictMap, &wq) - } - dist++ - } + bytes[i] = b + // 此时 bytes 为 word 所 trans 的单词 - return 0 -} + // 令 temp := string(bytes),会增加 70% 的时间 -func addNextWords(beginWord string, dictMap map[string]byte, wq *wordQueue) { - bytes := []byte(beginWord) - delete(dictMap, beginWord) - for i := 0; i < len(bytes); i++ { - diffLetter := bytes[i] - for j := 0; j < 26; j++ { - b := 'a' + byte(j) - if b == diffLetter { - continue - } + if dict[string(bytes)] { + // words 中存在 string(bytes) + if string(bytes) == endWord { + // trans 到了 endWord + // 提前结束 + return true + } - bytes[i] = b - if _, ok := dictMap[string(bytes)]; ok { - wq.push(string(bytes)) - delete(dictMap, string(bytes)) + // 把 string(bytes) 放入 queue 的尾部 + queue = append(queue, string(bytes)) + delete(dict, string(bytes)) + } } + bytes[i] = diffLetter } - bytes[i] = diffLetter - } -} -type wordQueue struct { - words []string -} + return false + } -func (wq *wordQueue) empty() bool { - return len(wq.words) == 0 -} + queue = append(queue, beginWord) + dist := 1 + for len(queue) > 0 { + qLen := len(queue) -func (wq *wordQueue) popNext() string { - if len(wq.words) == 0 { - return "" - } + // 这个 for 循环,是按照每个 word 的 dist 值,来切分 queue 的 + for i := 0; i < qLen; i++ { + // word 出列 + word := queue[0] + queue = queue[1:] - s := wq.words[0] - wq.words = wq.words[1:] - return s -} + if trans(word) { + // word 能够 trans 到 endWord + // 提前结束 + return dist + 1 + } + } -func (wq *wordQueue) push(s string) { - wq.words = append(wq.words, s) -} + dist++ + } -func (wq *wordQueue) size() int { - return len(wq.words) + return 0 } diff --git a/Algorithms/0127.word-ladder/word-ladder_test.go b/Algorithms/0127.word-ladder/word-ladder_test.go index a3c3d5f2f..fd12c81e0 100755 --- a/Algorithms/0127.word-ladder/word-ladder_test.go +++ b/Algorithms/0127.word-ladder/word-ladder_test.go @@ -1,4 +1,4 @@ -package Problem0127 +package problem0127 import ( "fmt" @@ -7,44 +7,112 @@ import ( "github.com/stretchr/testify/assert" ) +// tcs is testcase slice +var tcs = []struct { + beginWord string + endWord string + wordList []string + ans int +}{ + + { + "hit", + "cog", + []string{"hot", "dot", "dog", "lot", "log"}, + 0, + }, + + { + "hot", + "dog", + []string{"hot", "dog", "dot"}, + 3, + }, + + { + "hit", + "cog", + []string{"hot", "dot", "dog", "lot", "log", "cog"}, + 5, + }, + + { + "hit", + "hot", + []string{"hot", "dot", "dog", "lot", "log", "cog"}, + 2, + }, + + { + "cet", + "ism", + []string{"kid", "tag", "pup", "ail", "tun", "woo", "erg", "luz", "brr", "gay", "sip", "kay", "per", "val", "mes", "ohs", "now", "boa", "cet", "pal", "bar", "die", "war", "hay", "eco", "pub", "lob", "rue", "fry", "lit", "rex", "jan", "cot", "bid", "ali", "pay", "col", "gum", "ger", "row", "won", "dan", "rum", "fad", "tut", "sag", "yip", "sui", "ark", "has", "zip", "fez", "own", "ump", "dis", "ads", "max", "jaw", "out", "btu", "ana", "gap", "cry", "led", "abe", "box", "ore", "pig", "fie", "toy", "fat", "cal", "lie", "noh", "sew", "ono", "tam", "flu", "mgm", "ply", "awe", "pry", "tit", "tie", "yet", "too", "tax", "jim", "san", "pan", "map", "ski", "ova", "wed", "non", "wac", "nut", "why", "bye", "lye", "oct", "old", "fin", "feb", "chi", "sap", "owl", "log", "tod", "dot", "bow", "fob", "for", "joe", "ivy", "fan", "age", "fax", "hip", "jib", "mel", "hus", "sob", "ifs", "tab", "ara", "dab", "jag", "jar", "arm", "lot", "tom", "sax", "tex", "yum", "pei", "wen", "wry", "ire", "irk", "far", "mew", "wit", "doe", "gas", "rte", "ian", "pot", "ask", "wag", "hag", "amy", "nag", "ron", "soy", "gin", "don", "tug", "fay", "vic", "boo", "nam", "ave", "buy", "sop", "but", "orb", "fen", "paw", "his", "sub", "bob", "yea", "oft", "inn", "rod", "yam", "pew", "web", "hod", "hun", "gyp", "wei", "wis", "rob", "gad", "pie", "mon", "dog", "bib", "rub", "ere", "dig", "era", "cat", "fox", "bee", "mod", "day", "apr", "vie", "nev", "jam", "pam", "new", "aye", "ani", "and", "ibm", "yap", "can", "pyx", "tar", "kin", "fog", "hum", "pip", "cup", "dye", "lyx", "jog", "nun", "par", "wan", "fey", "bus", "oak", "bad", "ats", "set", "qom", "vat", "eat", "pus", "rev", "axe", "ion", "six", "ila", "lao", "mom", "mas", "pro", "few", "opt", "poe", "art", "ash", "oar", "cap", "lop", "may", "shy", "rid", "bat", "sum", "rim", "fee", "bmw", "sky", "maj", "hue", "thy", "ava", "rap", "den", "fla", "auk", "cox", "ibo", "hey", "saw", "vim", "sec", "ltd", "you", "its", "tat", "dew", "eva", "tog", "ram", "let", "see", "zit", "maw", "nix", "ate", "gig", "rep", "owe", "ind", "hog", "eve", "sam", "zoo", "any", "dow", "cod", "bed", "vet", "ham", "sis", "hex", "via", "fir", "nod", "mao", "aug", "mum", "hoe", "bah", "hal", "keg", "hew", "zed", "tow", "gog", "ass", "dem", "who", "bet", "gos", "son", "ear", "spy", "kit", "boy", "due", "sen", "oaf", "mix", "hep", "fur", "ada", "bin", "nil", "mia", "ewe", "hit", "fix", "sad", "rib", "eye", "hop", "haw", "wax", "mid", "tad", "ken", "wad", "rye", "pap", "bog", "gut", "ito", "woe", "our", "ado", "sin", "mad", "ray", "hon", "roy", "dip", "hen", "iva", "lug", "asp", "hui", "yak", "bay", "poi", "yep", "bun", "try", "lad", "elm", "nat", "wyo", "gym", "dug", "toe", "dee", "wig", "sly", "rip", "geo", "cog", "pas", "zen", "odd", "nan", "lay", "pod", "fit", "hem", "joy", "bum", "rio", "yon", "dec", "leg", "put", "sue", "dim", "pet", "yaw", "nub", "bit", "bur", "sid", "sun", "oil", "red", "doc", "moe", "caw", "eel", "dix", "cub", "end", "gem", "off", "yew", "hug", "pop", "tub", "sgt", "lid", "pun", "ton", "sol", "din", "yup", "jab", "pea", "bug", "gag", "mil", "jig", "hub", "low", "did", "tin", "get", "gte", "sox", "lei", "mig", "fig", "lon", "use", "ban", "flo", "nov", "jut", "bag", "mir", "sty", "lap", "two", "ins", "con", "ant", "net", "tux", "ode", "stu", "mug", "cad", "nap", "gun", "fop", "tot", "sow", "sal", "sic", "ted", "wot", "del", "imp", "cob", "way", "ann", "tan", "mci", "job", "wet", "ism", "err", "him", "all", "pad", "hah", "hie", "aim", "ike", "jed", "ego", "mac", "baa", "min", "com", "ill", "was", "cab", "ago", "ina", "big", "ilk", "gal", "tap", "duh", "ola", "ran", "lab", "top", "gob", "hot", "ora", "tia", "kip", "han", "met", "hut", "she", "sac", "fed", "goo", "tee", "ell", "not", "act", "gil", "rut", "ala", "ape", "rig", "cid", "god", "duo", "lin", "aid", "gel", "awl", "lag", "elf", "liz", "ref", "aha", "fib", "oho", "tho", "her", "nor", "ace", "adz", "fun", "ned", "coo", "win", "tao", "coy", "van", "man", "pit", "guy", "foe", "hid", "mai", "sup", "jay", "hob", "mow", "jot", "are", "pol", "arc", "lax", "aft", "alb", "len", "air", "pug", "pox", "vow", "got", "meg", "zoe", "amp", "ale", "bud", "gee", "pin", "dun", "pat", "ten", "mob"}, + 11, + }, + + // 可以多个 testcase +} + func Test_Problem0127(t *testing.T) { ast := assert.New(t) - // tcs is testcase slice - tcs := []struct { - beginWord string - endWord string - wordList []string - ans int - }{ - - { - "hit", - "cog", - []string{"hot", "dot", "dog", "lot", "log"}, - 0, - }, - - { - "hot", - "dog", - []string{"hot", "dog", "dot"}, - 3, - }, - - { - "hit", - "cog", - []string{"hot", "dot", "dog", "lot", "log", "cog"}, - 5, - }, - - // 可以多个 testcase - } - for _, tc := range tcs { fmt.Printf("~~%v~~\n", tc) ast.Equal(tc.ans, ladderLength(tc.beginWord, tc.endWord, tc.wordList), "输入:%v", tc) } } + +func Benchmark_Problem0127(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + ladderLength(tc.beginWord, tc.endWord, tc.wordList) + } + } +} + +func isTransable(a, b string) bool { + // onceAgain == true 说明已经出现过不同的字符了 + onceAgain := false + for i := range a { + if a[i] != b[i] { + if onceAgain { + return false + } + onceAgain = true + } + } + + return true +} + +func Benchmark_isTransable(b *testing.B) { + difStrs := []string{"abc", "bbc", "acc", "aba"} + std := "abc" + + for i := 0; i < b.N; i++ { + for _, str := range difStrs { + isTransable(std, str) + } + } +} + +func isTransformer(a, b string) bool { + for i := 0; i < len(a); i++ { + if a[:i]+a[i+1:] == b[:i]+b[i+1:] { + return true + } + } + return false +} + +func Benchmark_isTransformer(b *testing.B) { + difStrs := []string{"abc", "bbc", "acc", "aba"} + std := "abc" + + for i := 0; i < b.N; i++ { + for _, str := range difStrs { + isTransformer(std, str) + } + } +} diff --git a/Algorithms/0128.longest-consecutive-sequence/README.md b/Algorithms/0128.longest-consecutive-sequence/README.md new file mode 100755 index 000000000..d6993ff5b --- /dev/null +++ b/Algorithms/0128.longest-consecutive-sequence/README.md @@ -0,0 +1,21 @@ +# [128. Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) + +## 题目 +Given an unsorted array of integers, find the length of the longest consecutive elements sequence. + +For example, +``` +Given [100, 4, 200, 1, 3, 2], +The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4. +``` + +Your algorithm should run in O(n) complexity. + +## 解题思路 +``` +consecutive +英[kənˈsekjətɪv], 美[kənˈsɛkjətɪv] +adj. 连续的,连贯的; [语] 表示结果的; +``` + +见程序注释 diff --git a/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence.go b/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence.go new file mode 100755 index 000000000..22ab24db6 --- /dev/null +++ b/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence.go @@ -0,0 +1,29 @@ +package problem0128 + +import ( + "sort" +) + +func longestConsecutive(nums []int) int { + if len(nums) <= 1 { + return len(nums) + } + + sort.Ints(nums) + + max, temp := 0, 1 + for i := 1; i < len(nums); i++ { + if nums[i]-1 == nums[i-1] { + temp++ + } else if nums[i] != nums[i-1] { + // [0,1,1,2] 仍然可以视为连续 + temp = 1 + } + // 更新 max + if max < temp { + max = temp + } + } + + return max +} diff --git a/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence_test.go b/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence_test.go new file mode 100755 index 000000000..603573ce9 --- /dev/null +++ b/Algorithms/0128.longest-consecutive-sequence/longest-consecutive-sequence_test.go @@ -0,0 +1,69 @@ +package problem0128 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 2, 0, 1}, + 3, + }, + + { + []int{0, -1}, + 2, + }, + + { + []int{}, + 0, + }, + + { + []int{0, 0}, + 1, + }, + + { + []int{0}, + 1, + }, + + { + []int{100, 4, 200, 1, 3, 2}, + 4, + }, + + { + []int{9000, 8999, 8998, 8997, 8996, 8995, 8994, 8993, 8992, 8991, 8990, 8989, 8988, 8987, 8986, 8985, 8984, 8983, 8982, 8981, 8980, 8979, 8978, 8977, 8976, 8975, 8974, 8973, 8972, 8971, 8970, 8969, 8968, 8967, 8966, 8965, 8964, 8963, 8962, 8961, 8960, 8959, 8958, 8957, 8956, 8955, 8954, 8953, 8952, 8951, 8950, 8949, 8948, 8947, 8946, 8945, 8944, 8943, 8942, 8941, 8940, 8939, 8938, 8937, 8936, 8935, 8934, 8933, 8932, 8931, 8930, 8929, 8928, 8927, 8926, 8925, 8924, 8923, 8922, 8921, 8920, 8919, 8918, 8917, 8916, 8915, 8914, 8913, 8912, 8911, 8910, 8909, 8908, 8907, 8906, 8905, 8904, 8903, 8902, 8901, 8900, 8899, 8898, 8897, 8896, 8895, 8894, 8893, 8892, 8891, 8890, 8889, 8888, 8887, 8886, 8885, 8884, 8883, 8882, 8881, 8880, 8879, 8878, 8877, 8876, 8875, 8874, 8873, 8872, 8871, 8870, 8869, 8868, 8867, 8866, 8865, 8864, 8863, 8862, 8861, 8860, 8859, 8858, 8857, 8856, 8855, 8854, 8853, 8852, 8851, 8850, 8849, 8848, 8847, 8846, 8845, 8844, 8843, 8842, 8841, 8840, 8839, 8838, 8837, 8836, 8835, 8834, 8833, 8832, 8831, 8830, 8829, 8828, 8827, 8826, 8825, 8824, 8823, 8822, 8821, 8820, 8819, 8818, 8817, 8816, 8815, 8814, 8813, 8812, 8811, 8810, 8809, 8808, 8807, 8806, 8805, 8804, 8803, 8802, 8801, 8800, 8799, 8798, 8797, 8796, 8795, 8794, 8793, 8792, 8791, 8790, 8789, 8788, 8787, 8786, 8785, 8784, 8783, 8782, 8781, 8780, 8779, 8778, 8777, 8776, 8775, 8774, 8773, 8772, 8771, 8770, 8769, 8768, 8767, 8766, 8765, 8764, 8763, 8762, 8761, 8760, 8759, 8758, 8757, 8756, 8755, 8754, 8753, 8752, 8751, 8750, 8749, 8748, 8747, 8746, 8745, 8744, 8743, 8742, 8741, 8740, 8739, 8738, 8737, 8736, 8735, 8734, 8733, 8732, 8731, 8730, 8729, 8728, 8727, 8726, 8725, 8724, 8723, 8722, 8721, 8720, 8719, 8718, 8717, 8716, 8715, 8714, 8713, 8712, 8711, 8710, 8709, 8708, 8707, 8706, 8705, 8704, 8703, 8702, 8701, 8700, 8699, 8698, 8697, 8696, 8695, 8694, 8693, 8692, 8691, 8690, 8689, 8688, 8687, 8686, 8685, 8684, 8683, 8682, 8681, 8680, 8679, 8678, 8677, 8676, 8675, 8674, 8673, 8672, 8671, 8670, 8669, 8668, 8667, 8666, 8665, 8664, 8663, 8662, 8661, 8660, 8659, 8658, 8657, 8656, 8655, 8654, 8653, 8652, 8651, 8650, 8649, 8648, 8647, 8646, 8645, 8644, 8643, 8642, 8641, 8640, 8639, 8638, 8637, 8636, 8635, 8634, 8633, 8632, 8631, 8630, 8629, 8628, 8627, 8626, 8625, 8624, 8623, 8622, 8621, 8620, 8619, 8618, 8617, 8616, 8615, 8614, 8613, 8612, 8611, 8610, 8609, 8608, 8607, 8606, 8605, 8604, 8603, 8602, 8601, 8600, 8599, 8598, 8597, 8596, 8595, 8594, 8593, 8592, 8591, 8590, 8589, 8588, 8587, 8586, 8585, 8584, 8583, 8582, 8581, 8580, 8579, 8578, 8577, 8576, 8575, 8574, 8573, 8572, 8571, 8570, 8569, 8568, 8567, 8566, 8565, 8564, 8563, 8562, 8561, 8560, 8559, 8558, 8557, 8556, 8555, 8554, 8553, 8552, 8551, 8550, 8549, 8548, 8547, 8546, 8545, 8544, 8543, 8542, 8541, 8540, 8539, 8538, 8537, 8536, 8535, 8534, 8533, 8532, 8531, 8530, 8529, 8528, 8527, 8526, 8525, 8524, 8523, 8522, 8521, 8520, 8519, 8518, 8517, 8516, 8515, 8514, 8513, 8512, 8511, 8510, 8509, 8508, 8507, 8506, 8505, 8504, 8503, 8502, 8501, 8500, 8499, 8498, 8497, 8496, 8495, 8494, 8493, 8492, 8491, 8490, 8489, 8488, 8487, 8486, 8485, 8484, 8483, 8482, 8481, 8480, 8479, 8478, 8477, 8476, 8475, 8474, 8473, 8472, 8471, 8470, 8469, 8468, 8467, 8466, 8465, 8464, 8463, 8462, 8461, 8460, 8459, 8458, 8457, 8456, 8455, 8454, 8453, 8452, 8451, 8450, 8449, 8448, 8447, 8446, 8445, 8444, 8443, 8442, 8441, 8440, 8439, 8438, 8437, 8436, 8435, 8434, 8433, 8432, 8431, 8430, 8429, 8428, 8427, 8426, 8425, 8424, 8423, 8422, 8421, 8420, 8419, 8418, 8417, 8416, 8415, 8414, 8413, 8412, 8411, 8410, 8409, 8408, 8407, 8406, 8405, 8404, 8403, 8402, 8401, 8400, 8399, 8398, 8397, 8396, 8395, 8394, 8393, 8392, 8391, 8390, 8389, 8388, 8387, 8386, 8385, 8384, 8383, 8382, 8381, 8380, 8379, 8378, 8377, 8376, 8375, 8374, 8373, 8372, 8371, 8370, 8369, 8368, 8367, 8366, 8365, 8364, 8363, 8362, 8361, 8360, 8359, 8358, 8357, 8356, 8355, 8354, 8353, 8352, 8351, 8350, 8349, 8348, 8347, 8346, 8345, 8344, 8343, 8342, 8341, 8340, 8339, 8338, 8337, 8336, 8335, 8334, 8333, 8332, 8331, 8330, 8329, 8328, 8327, 8326, 8325, 8324, 8323, 8322, 8321, 8320, 8319, 8318, 8317, 8316, 8315, 8314, 8313, 8312, 8311, 8310, 8309, 8308, 8307, 8306, 8305, 8304, 8303, 8302, 8301, 8300, 8299, 8298, 8297, 8296, 8295, 8294, 8293, 8292, 8291, 8290, 8289, 8288, 8287, 8286, 8285, 8284, 8283, 8282, 8281, 8280, 8279, 8278, 8277, 8276, 8275, 8274, 8273, 8272, 8271, 8270, 8269, 8268, 8267, 8266, 8265, 8264, 8263, 8262, 8261, 8260, 8259, 8258, 8257, 8256, 8255, 8254, 8253, 8252, 8251, 8250, 8249, 8248, 8247, 8246, 8245, 8244, 8243, 8242, 8241, 8240, 8239, 8238, 8237, 8236, 8235, 8234, 8233, 8232, 8231, 8230, 8229, 8228, 8227, 8226, 8225, 8224, 8223, 8222, 8221, 8220, 8219, 8218, 8217, 8216, 8215, 8214, 8213, 8212, 8211, 8210, 8209, 8208, 8207, 8206, 8205, 8204, 8203, 8202, 8201, 8200, 8199, 8198, 8197, 8196, 8195, 8194, 8193, 8192, 8191, 8190, 8189, 8188, 8187, 8186, 8185, 8184, 8183, 8182, 8181, 8180, 8179, 8178, 8177, 8176, 8175, 8174, 8173, 8172, 8171, 8170, 8169, 8168, 8167, 8166, 8165, 8164, 8163, 8162, 8161, 8160, 8159, 8158, 8157, 8156, 8155, 8154, 8153, 8152, 8151, 8150, 8149, 8148, 8147, 8146, 8145, 8144, 8143, 8142, 8141, 8140, 8139, 8138, 8137, 8136, 8135, 8134, 8133, 8132, 8131, 8130, 8129, 8128, 8127, 8126, 8125, 8124, 8123, 8122, 8121, 8120, 8119, 8118, 8117, 8116, 8115, 8114, 8113, 8112, 8111, 8110, 8109, 8108, 8107, 8106, 8105, 8104, 8103, 8102, 8101, 8100, 8099, 8098, 8097, 8096, 8095, 8094, 8093, 8092, 8091, 8090, 8089, 8088, 8087, 8086, 8085, 8084, 8083, 8082, 8081, 8080, 8079, 8078, 8077, 8076, 8075, 8074, 8073, 8072, 8071, 8070, 8069, 8068, 8067, 8066, 8065, 8064, 8063, 8062, 8061, 8060, 8059, 8058, 8057, 8056, 8055, 8054, 8053, 8052, 8051, 8050, 8049, 8048, 8047, 8046, 8045, 8044, 8043, 8042, 8041, 8040, 8039, 8038, 8037, 8036, 8035, 8034, 8033, 8032, 8031, 8030, 8029, 8028, 8027, 8026, 8025, 8024, 8023, 8022, 8021, 8020, 8019, 8018, 8017, 8016, 8015, 8014, 8013, 8012, 8011, 8010, 8009, 8008, 8007, 8006, 8005, 8004, 8003, 8002, 8001, 8000, 7999, 7998, 7997, 7996, 7995, 7994, 7993, 7992, 7991, 7990, 7989, 7988, 7987, 7986, 7985, 7984, 7983, 7982, 7981, 7980, 7979, 7978, 7977, 7976, 7975, 7974, 7973, 7972, 7971, 7970, 7969, 7968, 7967, 7966, 7965, 7964, 7963, 7962, 7961, 7960, 7959, 7958, 7957, 7956, 7955, 7954, 7953, 7952, 7951, 7950, 7949, 7948, 7947, 7946, 7945, 7944, 7943, 7942, 7941, 7940, 7939, 7938, 7937, 7936, 7935, 7934, 7933, 7932, 7931, 7930, 7929, 7928, 7927, 7926, 7925, 7924, 7923, 7922, 7921, 7920, 7919, 7918, 7917, 7916, 7915, 7914, 7913, 7912, 7911, 7910, 7909, 7908, 7907, 7906, 7905, 7904, 7903, 7902, 7901, 7900, 7899, 7898, 7897, 7896, 7895, 7894, 7893, 7892, 7891, 7890, 7889, 7888, 7887, 7886, 7885, 7884, 7883, 7882, 7881, 7880, 7879, 7878, 7877, 7876, 7875, 7874, 7873, 7872, 7871, 7870, 7869, 7868, 7867, 7866, 7865, 7864, 7863, 7862, 7861, 7860, 7859, 7858, 7857, 7856, 7855, 7854, 7853, 7852, 7851, 7850, 7849, 7848, 7847, 7846, 7845, 7844, 7843, 7842, 7841, 7840, 7839, 7838, 7837, 7836, 7835, 7834, 7833, 7832, 7831, 7830, 7829, 7828, 7827, 7826, 7825, 7824, 7823, 7822, 7821, 7820, 7819, 7818, 7817, 7816, 7815, 7814, 7813, 7812, 7811, 7810, 7809, 7808, 7807, 7806, 7805, 7804, 7803, 7802, 7801, 7800, 7799, 7798, 7797, 7796, 7795, 7794, 7793, 7792, 7791, 7790, 7789, 7788, 7787, 7786, 7785, 7784, 7783, 7782, 7781, 7780, 7779, 7778, 7777, 7776, 7775, 7774, 7773, 7772, 7771, 7770, 7769, 7768, 7767, 7766, 7765, 7764, 7763, 7762, 7761, 7760, 7759, 7758, 7757, 7756, 7755, 7754, 7753, 7752, 7751, 7750, 7749, 7748, 7747, 7746, 7745, 7744, 7743, 7742, 7741, 7740, 7739, 7738, 7737, 7736, 7735, 7734, 7733, 7732, 7731, 7730, 7729, 7728, 7727, 7726, 7725, 7724, 7723, 7722, 7721, 7720, 7719, 7718, 7717, 7716, 7715, 7714, 7713, 7712, 7711, 7710, 7709, 7708, 7707, 7706, 7705, 7704, 7703, 7702, 7701, 7700, 7699, 7698, 7697, 7696, 7695, 7694, 7693, 7692, 7691, 7690, 7689, 7688, 7687, 7686, 7685, 7684, 7683, 7682, 7681, 7680, 7679, 7678, 7677, 7676, 7675, 7674, 7673, 7672, 7671, 7670, 7669, 7668, 7667, 7666, 7665, 7664, 7663, 7662, 7661, 7660, 7659, 7658, 7657, 7656, 7655, 7654, 7653, 7652, 7651, 7650, 7649, 7648, 7647, 7646, 7645, 7644, 7643, 7642, 7641, 7640, 7639, 7638, 7637, 7636, 7635, 7634, 7633, 7632, 7631, 7630, 7629, 7628, 7627, 7626, 7625, 7624, 7623, 7622, 7621, 7620, 7619, 7618, 7617, 7616, 7615, 7614, 7613, 7612, 7611, 7610, 7609, 7608, 7607, 7606, 7605, 7604, 7603, 7602, 7601, 7600, 7599, 7598, 7597, 7596, 7595, 7594, 7593, 7592, 7591, 7590, 7589, 7588, 7587, 7586, 7585, 7584, 7583, 7582, 7581, 7580, 7579, 7578, 7577, 7576, 7575, 7574, 7573, 7572, 7571, 7570, 7569, 7568, 7567, 7566, 7565, 7564, 7563, 7562, 7561, 7560, 7559, 7558, 7557, 7556, 7555, 7554, 7553, 7552, 7551, 7550, 7549, 7548, 7547, 7546, 7545, 7544, 7543, 7542, 7541, 7540, 7539, 7538, 7537, 7536, 7535, 7534, 7533, 7532, 7531, 7530, 7529, 7528, 7527, 7526, 7525, 7524, 7523, 7522, 7521, 7520, 7519, 7518, 7517, 7516, 7515, 7514, 7513, 7512, 7511, 7510, 7509, 7508, 7507, 7506, 7505, 7504, 7503, 7502, 7501, 7500, 7499, 7498, 7497, 7496, 7495, 7494, 7493, 7492, 7491, 7490, 7489, 7488, 7487, 7486, 7485, 7484, 7483, 7482, 7481, 7480, 7479, 7478, 7477, 7476, 7475, 7474, 7473, 7472, 7471, 7470, 7469, 7468, 7467, 7466, 7465, 7464, 7463, 7462, 7461, 7460, 7459, 7458, 7457, 7456, 7455, 7454, 7453, 7452, 7451, 7450, 7449, 7448, 7447, 7446, 7445, 7444, 7443, 7442, 7441, 7440, 7439, 7438, 7437, 7436, 7435, 7434, 7433, 7432, 7431, 7430, 7429, 7428, 7427, 7426, 7425, 7424, 7423, 7422, 7421, 7420, 7419, 7418, 7417, 7416, 7415, 7414, 7413, 7412, 7411, 7410, 7409, 7408, 7407, 7406, 7405, 7404, 7403, 7402, 7401, 7400, 7399, 7398, 7397, 7396, 7395, 7394, 7393, 7392, 7391, 7390, 7389, 7388, 7387, 7386, 7385, 7384, 7383, 7382, 7381, 7380, 7379, 7378, 7377, 7376, 7375, 7374, 7373, 7372, 7371, 7370, 7369, 7368, 7367, 7366, 7365, 7364, 7363, 7362, 7361, 7360, 7359, 7358, 7357, 7356, 7355, 7354, 7353, 7352, 7351, 7350, 7349, 7348, 7347, 7346, 7345, 7344, 7343, 7342, 7341, 7340, 7339, 7338, 7337, 7336, 7335, 7334, 7333, 7332, 7331, 7330, 7329, 7328, 7327, 7326, 7325, 7324, 7323, 7322, 7321, 7320, 7319, 7318, 7317, 7316, 7315, 7314, 7313, 7312, 7311, 7310, 7309, 7308, 7307, 7306, 7305, 7304, 7303, 7302, 7301, 7300, 7299, 7298, 7297, 7296, 7295, 7294, 7293, 7292, 7291, 7290, 7289, 7288, 7287, 7286, 7285, 7284, 7283, 7282, 7281, 7280, 7279, 7278, 7277, 7276, 7275, 7274, 7273, 7272, 7271, 7270, 7269, 7268, 7267, 7266, 7265, 7264, 7263, 7262, 7261, 7260, 7259, 7258, 7257, 7256, 7255, 7254, 7253, 7252, 7251, 7250, 7249, 7248, 7247, 7246, 7245, 7244, 7243, 7242, 7241, 7240, 7239, 7238, 7237, 7236, 7235, 7234, 7233, 7232, 7231, 7230, 7229, 7228, 7227, 7226, 7225, 7224, 7223, 7222, 7221, 7220, 7219, 7218, 7217, 7216, 7215, 7214, 7213, 7212, 7211, 7210, 7209, 7208, 7207, 7206, 7205, 7204, 7203, 7202, 7201, 7200, 7199, 7198, 7197, 7196, 7195, 7194, 7193, 7192, 7191, 7190, 7189, 7188, 7187, 7186, 7185, 7184, 7183, 7182, 7181, 7180, 7179, 7178, 7177, 7176, 7175, 7174, 7173, 7172, 7171, 7170, 7169, 7168, 7167, 7166, 7165, 7164, 7163, 7162, 7161, 7160, 7159, 7158, 7157, 7156, 7155, 7154, 7153, 7152, 7151, 7150, 7149, 7148, 7147, 7146, 7145, 7144, 7143, 7142, 7141, 7140, 7139, 7138, 7137, 7136, 7135, 7134, 7133, 7132, 7131, 7130, 7129, 7128, 7127, 7126, 7125, 7124, 7123, 7122, 7121, 7120, 7119, 7118, 7117, 7116, 7115, 7114, 7113, 7112, 7111, 7110, 7109, 7108, 7107, 7106, 7105, 7104, 7103, 7102, 7101, 7100, 7099, 7098, 7097, 7096, 7095, 7094, 7093, 7092, 7091, 7090, 7089, 7088, 7087, 7086, 7085, 7084, 7083, 7082, 7081, 7080, 7079, 7078, 7077, 7076, 7075, 7074, 7073, 7072, 7071, 7070, 7069, 7068, 7067, 7066, 7065, 7064, 7063, 7062, 7061, 7060, 7059, 7058, 7057, 7056, 7055, 7054, 7053, 7052, 7051, 7050, 7049, 7048, 7047, 7046, 7045, 7044, 7043, 7042, 7041, 7040, 7039, 7038, 7037, 7036, 7035, 7034, 7033, 7032, 7031, 7030, 7029, 7028, 7027, 7026, 7025, 7024, 7023, 7022, 7021, 7020, 7019, 7018, 7017, 7016, 7015, 7014, 7013, 7012, 7011, 7010, 7009, 7008, 7007, 7006, 7005, 7004, 7003, 7002, 7001, 7000, 6999, 6998, 6997, 6996, 6995, 6994, 6993, 6992, 6991, 6990, 6989, 6988, 6987, 6986, 6985, 6984, 6983, 6982, 6981, 6980, 6979, 6978, 6977, 6976, 6975, 6974, 6973, 6972, 6971, 6970, 6969, 6968, 6967, 6966, 6965, 6964, 6963, 6962, 6961, 6960, 6959, 6958, 6957, 6956, 6955, 6954, 6953, 6952, 6951, 6950, 6949, 6948, 6947, 6946, 6945, 6944, 6943, 6942, 6941, 6940, 6939, 6938, 6937, 6936, 6935, 6934, 6933, 6932, 6931, 6930, 6929, 6928, 6927, 6926, 6925, 6924, 6923, 6922, 6921, 6920, 6919, 6918, 6917, 6916, 6915, 6914, 6913, 6912, 6911, 6910, 6909, 6908, 6907, 6906, 6905, 6904, 6903, 6902, 6901, 6900, 6899, 6898, 6897, 6896, 6895, 6894, 6893, 6892, 6891, 6890, 6889, 6888, 6887, 6886, 6885, 6884, 6883, 6882, 6881, 6880, 6879, 6878, 6877, 6876, 6875, 6874, 6873, 6872, 6871, 6870, 6869, 6868, 6867, 6866, 6865, 6864, 6863, 6862, 6861, 6860, 6859, 6858, 6857, 6856, 6855, 6854, 6853, 6852, 6851, 6850, 6849, 6848, 6847, 6846, 6845, 6844, 6843, 6842, 6841, 6840, 6839, 6838, 6837, 6836, 6835, 6834, 6833, 6832, 6831, 6830, 6829, 6828, 6827, 6826, 6825, 6824, 6823, 6822, 6821, 6820, 6819, 6818, 6817, 6816, 6815, 6814, 6813, 6812, 6811, 6810, 6809, 6808, 6807, 6806, 6805, 6804, 6803, 6802, 6801, 6800, 6799, 6798, 6797, 6796, 6795, 6794, 6793, 6792, 6791, 6790, 6789, 6788, 6787, 6786, 6785, 6784, 6783, 6782, 6781, 6780, 6779, 6778, 6777, 6776, 6775, 6774, 6773, 6772, 6771, 6770, 6769, 6768, 6767, 6766, 6765, 6764, 6763, 6762, 6761, 6760, 6759, 6758, 6757, 6756, 6755, 6754, 6753, 6752, 6751, 6750, 6749, 6748, 6747, 6746, 6745, 6744, 6743, 6742, 6741, 6740, 6739, 6738, 6737, 6736, 6735, 6734, 6733, 6732, 6731, 6730, 6729, 6728, 6727, 6726, 6725, 6724, 6723, 6722, 6721, 6720, 6719, 6718, 6717, 6716, 6715, 6714, 6713, 6712, 6711, 6710, 6709, 6708, 6707, 6706, 6705, 6704, 6703, 6702, 6701, 6700, 6699, 6698, 6697, 6696, 6695, 6694, 6693, 6692, 6691, 6690, 6689, 6688, 6687, 6686, 6685, 6684, 6683, 6682, 6681, 6680, 6679, 6678, 6677, 6676, 6675, 6674, 6673, 6672, 6671, 6670, 6669, 6668, 6667, 6666, 6665, 6664, 6663, 6662, 6661, 6660, 6659, 6658, 6657, 6656, 6655, 6654, 6653, 6652, 6651, 6650, 6649, 6648, 6647, 6646, 6645, 6644, 6643, 6642, 6641, 6640, 6639, 6638, 6637, 6636, 6635, 6634, 6633, 6632, 6631, 6630, 6629, 6628, 6627, 6626, 6625, 6624, 6623, 6622, 6621, 6620, 6619, 6618, 6617, 6616, 6615, 6614, 6613, 6612, 6611, 6610, 6609, 6608, 6607, 6606, 6605, 6604, 6603, 6602, 6601, 6600, 6599, 6598, 6597, 6596, 6595, 6594, 6593, 6592, 6591, 6590, 6589, 6588, 6587, 6586, 6585, 6584, 6583, 6582, 6581, 6580, 6579, 6578, 6577, 6576, 6575, 6574, 6573, 6572, 6571, 6570, 6569, 6568, 6567, 6566, 6565, 6564, 6563, 6562, 6561, 6560, 6559, 6558, 6557, 6556, 6555, 6554, 6553, 6552, 6551, 6550, 6549, 6548, 6547, 6546, 6545, 6544, 6543, 6542, 6541, 6540, 6539, 6538, 6537, 6536, 6535, 6534, 6533, 6532, 6531, 6530, 6529, 6528, 6527, 6526, 6525, 6524, 6523, 6522, 6521, 6520, 6519, 6518, 6517, 6516, 6515, 6514, 6513, 6512, 6511, 6510, 6509, 6508, 6507, 6506, 6505, 6504, 6503, 6502, 6501, 6500, 6499, 6498, 6497, 6496, 6495, 6494, 6493, 6492, 6491, 6490, 6489, 6488, 6487, 6486, 6485, 6484, 6483, 6482, 6481, 6480, 6479, 6478, 6477, 6476, 6475, 6474, 6473, 6472, 6471, 6470, 6469, 6468, 6467, 6466, 6465, 6464, 6463, 6462, 6461, 6460, 6459, 6458, 6457, 6456, 6455, 6454, 6453, 6452, 6451, 6450, 6449, 6448, 6447, 6446, 6445, 6444, 6443, 6442, 6441, 6440, 6439, 6438, 6437, 6436, 6435, 6434, 6433, 6432, 6431, 6430, 6429, 6428, 6427, 6426, 6425, 6424, 6423, 6422, 6421, 6420, 6419, 6418, 6417, 6416, 6415, 6414, 6413, 6412, 6411, 6410, 6409, 6408, 6407, 6406, 6405, 6404, 6403, 6402, 6401, 6400, 6399, 6398, 6397, 6396, 6395, 6394, 6393, 6392, 6391, 6390, 6389, 6388, 6387, 6386, 6385, 6384, 6383, 6382, 6381, 6380, 6379, 6378, 6377, 6376, 6375, 6374, 6373, 6372, 6371, 6370, 6369, 6368, 6367, 6366, 6365, 6364, 6363, 6362, 6361, 6360, 6359, 6358, 6357, 6356, 6355, 6354, 6353, 6352, 6351, 6350, 6349, 6348, 6347, 6346, 6345, 6344, 6343, 6342, 6341, 6340, 6339, 6338, 6337, 6336, 6335, 6334, 6333, 6332, 6331, 6330, 6329, 6328, 6327, 6326, 6325, 6324, 6323, 6322, 6321, 6320, 6319, 6318, 6317, 6316, 6315, 6314, 6313, 6312, 6311, 6310, 6309, 6308, 6307, 6306, 6305, 6304, 6303, 6302, 6301, 6300, 6299, 6298, 6297, 6296, 6295, 6294, 6293, 6292, 6291, 6290, 6289, 6288, 6287, 6286, 6285, 6284, 6283, 6282, 6281, 6280, 6279, 6278, 6277, 6276, 6275, 6274, 6273, 6272, 6271, 6270, 6269, 6268, 6267, 6266, 6265, 6264, 6263, 6262, 6261, 6260, 6259, 6258, 6257, 6256, 6255, 6254, 6253, 6252, 6251, 6250, 6249, 6248, 6247, 6246, 6245, 6244, 6243, 6242, 6241, 6240, 6239, 6238, 6237, 6236, 6235, 6234, 6233, 6232, 6231, 6230, 6229, 6228, 6227, 6226, 6225, 6224, 6223, 6222, 6221, 6220, 6219, 6218, 6217, 6216, 6215, 6214, 6213, 6212, 6211, 6210, 6209, 6208, 6207, 6206, 6205, 6204, 6203, 6202, 6201, 6200, 6199, 6198, 6197, 6196, 6195, 6194, 6193, 6192, 6191, 6190, 6189, 6188, 6187, 6186, 6185, 6184, 6183, 6182, 6181, 6180, 6179, 6178, 6177, 6176, 6175, 6174, 6173, 6172, 6171, 6170, 6169, 6168, 6167, 6166, 6165, 6164, 6163, 6162, 6161, 6160, 6159, 6158, 6157, 6156, 6155, 6154, 6153, 6152, 6151, 6150, 6149, 6148, 6147, 6146, 6145, 6144, 6143, 6142, 6141, 6140, 6139, 6138, 6137, 6136, 6135, 6134, 6133, 6132, 6131, 6130, 6129, 6128, 6127, 6126, 6125, 6124, 6123, 6122, 6121, 6120, 6119, 6118, 6117, 6116, 6115, 6114, 6113, 6112, 6111, 6110, 6109, 6108, 6107, 6106, 6105, 6104, 6103, 6102, 6101, 6100, 6099, 6098, 6097, 6096, 6095, 6094, 6093, 6092, 6091, 6090, 6089, 6088, 6087, 6086, 6085, 6084, 6083, 6082, 6081, 6080, 6079, 6078, 6077, 6076, 6075, 6074, 6073, 6072, 6071, 6070, 6069, 6068, 6067, 6066, 6065, 6064, 6063, 6062, 6061, 6060, 6059, 6058, 6057, 6056, 6055, 6054, 6053, 6052, 6051, 6050, 6049, 6048, 6047, 6046, 6045, 6044, 6043, 6042, 6041, 6040, 6039, 6038, 6037, 6036, 6035, 6034, 6033, 6032, 6031, 6030, 6029, 6028, 6027, 6026, 6025, 6024, 6023, 6022, 6021, 6020, 6019, 6018, 6017, 6016, 6015, 6014, 6013, 6012, 6011, 6010, 6009, 6008, 6007, 6006, 6005, 6004, 6003, 6002, 6001, 6000, 5999, 5998, 5997, 5996, 5995, 5994, 5993, 5992, 5991, 5990, 5989, 5988, 5987, 5986, 5985, 5984, 5983, 5982, 5981, 5980, 5979, 5978, 5977, 5976, 5975, 5974, 5973, 5972, 5971, 5970, 5969, 5968, 5967, 5966, 5965, 5964, 5963, 5962, 5961, 5960, 5959, 5958, 5957, 5956, 5955, 5954, 5953, 5952, 5951, 5950, 5949, 5948, 5947, 5946, 5945, 5944, 5943, 5942, 5941, 5940, 5939, 5938, 5937, 5936, 5935, 5934, 5933, 5932, 5931, 5930, 5929, 5928, 5927, 5926, 5925, 5924, 5923, 5922, 5921, 5920, 5919, 5918, 5917, 5916, 5915, 5914, 5913, 5912, 5911, 5910, 5909, 5908, 5907, 5906, 5905, 5904, 5903, 5902, 5901, 5900, 5899, 5898, 5897, 5896, 5895, 5894, 5893, 5892, 5891, 5890, 5889, 5888, 5887, 5886, 5885, 5884, 5883, 5882, 5881, 5880, 5879, 5878, 5877, 5876, 5875, 5874, 5873, 5872, 5871, 5870, 5869, 5868, 5867, 5866, 5865, 5864, 5863, 5862, 5861, 5860, 5859, 5858, 5857, 5856, 5855, 5854, 5853, 5852, 5851, 5850, 5849, 5848, 5847, 5846, 5845, 5844, 5843, 5842, 5841, 5840, 5839, 5838, 5837, 5836, 5835, 5834, 5833, 5832, 5831, 5830, 5829, 5828, 5827, 5826, 5825, 5824, 5823, 5822, 5821, 5820, 5819, 5818, 5817, 5816, 5815, 5814, 5813, 5812, 5811, 5810, 5809, 5808, 5807, 5806, 5805, 5804, 5803, 5802, 5801, 5800, 5799, 5798, 5797, 5796, 5795, 5794, 5793, 5792, 5791, 5790, 5789, 5788, 5787, 5786, 5785, 5784, 5783, 5782, 5781, 5780, 5779, 5778, 5777, 5776, 5775, 5774, 5773, 5772, 5771, 5770, 5769, 5768, 5767, 5766, 5765, 5764, 5763, 5762, 5761, 5760, 5759, 5758, 5757, 5756, 5755, 5754, 5753, 5752, 5751, 5750, 5749, 5748, 5747, 5746, 5745, 5744, 5743, 5742, 5741, 5740, 5739, 5738, 5737, 5736, 5735, 5734, 5733, 5732, 5731, 5730, 5729, 5728, 5727, 5726, 5725, 5724, 5723, 5722, 5721, 5720, 5719, 5718, 5717, 5716, 5715, 5714, 5713, 5712, 5711, 5710, 5709, 5708, 5707, 5706, 5705, 5704, 5703, 5702, 5701, 5700, 5699, 5698, 5697, 5696, 5695, 5694, 5693, 5692, 5691, 5690, 5689, 5688, 5687, 5686, 5685, 5684, 5683, 5682, 5681, 5680, 5679, 5678, 5677, 5676, 5675, 5674, 5673, 5672, 5671, 5670, 5669, 5668, 5667, 5666, 5665, 5664, 5663, 5662, 5661, 5660, 5659, 5658, 5657, 5656, 5655, 5654, 5653, 5652, 5651, 5650, 5649, 5648, 5647, 5646, 5645, 5644, 5643, 5642, 5641, 5640, 5639, 5638, 5637, 5636, 5635, 5634, 5633, 5632, 5631, 5630, 5629, 5628, 5627, 5626, 5625, 5624, 5623, 5622, 5621, 5620, 5619, 5618, 5617, 5616, 5615, 5614, 5613, 5612, 5611, 5610, 5609, 5608, 5607, 5606, 5605, 5604, 5603, 5602, 5601, 5600, 5599, 5598, 5597, 5596, 5595, 5594, 5593, 5592, 5591, 5590, 5589, 5588, 5587, 5586, 5585, 5584, 5583, 5582, 5581, 5580, 5579, 5578, 5577, 5576, 5575, 5574, 5573, 5572, 5571, 5570, 5569, 5568, 5567, 5566, 5565, 5564, 5563, 5562, 5561, 5560, 5559, 5558, 5557, 5556, 5555, 5554, 5553, 5552, 5551, 5550, 5549, 5548, 5547, 5546, 5545, 5544, 5543, 5542, 5541, 5540, 5539, 5538, 5537, 5536, 5535, 5534, 5533, 5532, 5531, 5530, 5529, 5528, 5527, 5526, 5525, 5524, 5523, 5522, 5521, 5520, 5519, 5518, 5517, 5516, 5515, 5514, 5513, 5512, 5511, 5510, 5509, 5508, 5507, 5506, 5505, 5504, 5503, 5502, 5501, 5500, 5499, 5498, 5497, 5496, 5495, 5494, 5493, 5492, 5491, 5490, 5489, 5488, 5487, 5486, 5485, 5484, 5483, 5482, 5481, 5480, 5479, 5478, 5477, 5476, 5475, 5474, 5473, 5472, 5471, 5470, 5469, 5468, 5467, 5466, 5465, 5464, 5463, 5462, 5461, 5460, 5459, 5458, 5457, 5456, 5455, 5454, 5453, 5452, 5451, 5450, 5449, 5448, 5447, 5446, 5445, 5444, 5443, 5442, 5441, 5440, 5439, 5438, 5437, 5436, 5435, 5434, 5433, 5432, 5431, 5430, 5429, 5428, 5427, 5426, 5425, 5424, 5423, 5422, 5421, 5420, 5419, 5418, 5417, 5416, 5415, 5414, 5413, 5412, 5411, 5410, 5409, 5408, 5407, 5406, 5405, 5404, 5403, 5402, 5401, 5400, 5399, 5398, 5397, 5396, 5395, 5394, 5393, 5392, 5391, 5390, 5389, 5388, 5387, 5386, 5385, 5384, 5383, 5382, 5381, 5380, 5379, 5378, 5377, 5376, 5375, 5374, 5373, 5372, 5371, 5370, 5369, 5368, 5367, 5366, 5365, 5364, 5363, 5362, 5361, 5360, 5359, 5358, 5357, 5356, 5355, 5354, 5353, 5352, 5351, 5350, 5349, 5348, 5347, 5346, 5345, 5344, 5343, 5342, 5341, 5340, 5339, 5338, 5337, 5336, 5335, 5334, 5333, 5332, 5331, 5330, 5329, 5328, 5327, 5326, 5325, 5324, 5323, 5322, 5321, 5320, 5319, 5318, 5317, 5316, 5315, 5314, 5313, 5312, 5311, 5310, 5309, 5308, 5307, 5306, 5305, 5304, 5303, 5302, 5301, 5300, 5299, 5298, 5297, 5296, 5295, 5294, 5293, 5292, 5291, 5290, 5289, 5288, 5287, 5286, 5285, 5284, 5283, 5282, 5281, 5280, 5279, 5278, 5277, 5276, 5275, 5274, 5273, 5272, 5271, 5270, 5269, 5268, 5267, 5266, 5265, 5264, 5263, 5262, 5261, 5260, 5259, 5258, 5257, 5256, 5255, 5254, 5253, 5252, 5251, 5250, 5249, 5248, 5247, 5246, 5245, 5244, 5243, 5242, 5241, 5240, 5239, 5238, 5237, 5236, 5235, 5234, 5233, 5232, 5231, 5230, 5229, 5228, 5227, 5226, 5225, 5224, 5223, 5222, 5221, 5220, 5219, 5218, 5217, 5216, 5215, 5214, 5213, 5212, 5211, 5210, 5209, 5208, 5207, 5206, 5205, 5204, 5203, 5202, 5201, 5200, 5199, 5198, 5197, 5196, 5195, 5194, 5193, 5192, 5191, 5190, 5189, 5188, 5187, 5186, 5185, 5184, 5183, 5182, 5181, 5180, 5179, 5178, 5177, 5176, 5175, 5174, 5173, 5172, 5171, 5170, 5169, 5168, 5167, 5166, 5165, 5164, 5163, 5162, 5161, 5160, 5159, 5158, 5157, 5156, 5155, 5154, 5153, 5152, 5151, 5150, 5149, 5148, 5147, 5146, 5145, 5144, 5143, 5142, 5141, 5140, 5139, 5138, 5137, 5136, 5135, 5134, 5133, 5132, 5131, 5130, 5129, 5128, 5127, 5126, 5125, 5124, 5123, 5122, 5121, 5120, 5119, 5118, 5117, 5116, 5115, 5114, 5113, 5112, 5111, 5110, 5109, 5108, 5107, 5106, 5105, 5104, 5103, 5102, 5101, 5100, 5099, 5098, 5097, 5096, 5095, 5094, 5093, 5092, 5091, 5090, 5089, 5088, 5087, 5086, 5085, 5084, 5083, 5082, 5081, 5080, 5079, 5078, 5077, 5076, 5075, 5074, 5073, 5072, 5071, 5070, 5069, 5068, 5067, 5066, 5065, 5064, 5063, 5062, 5061, 5060, 5059, 5058, 5057, 5056, 5055, 5054, 5053, 5052, 5051, 5050, 5049, 5048, 5047, 5046, 5045, 5044, 5043, 5042, 5041, 5040, 5039, 5038, 5037, 5036, 5035, 5034, 5033, 5032, 5031, 5030, 5029, 5028, 5027, 5026, 5025, 5024, 5023, 5022, 5021, 5020, 5019, 5018, 5017, 5016, 5015, 5014, 5013, 5012, 5011, 5010, 5009, 5008, 5007, 5006, 5005, 5004, 5003, 5002, 5001, 5000, 4999, 4998, 4997, 4996, 4995, 4994, 4993, 4992, 4991, 4990, 4989, 4988, 4987, 4986, 4985, 4984, 4983, 4982, 4981, 4980, 4979, 4978, 4977, 4976, 4975, 4974, 4973, 4972, 4971, 4970, 4969, 4968, 4967, 4966, 4965, 4964, 4963, 4962, 4961, 4960, 4959, 4958, 4957, 4956, 4955, 4954, 4953, 4952, 4951, 4950, 4949, 4948, 4947, 4946, 4945, 4944, 4943, 4942, 4941, 4940, 4939, 4938, 4937, 4936, 4935, 4934, 4933, 4932, 4931, 4930, 4929, 4928, 4927, 4926, 4925, 4924, 4923, 4922, 4921, 4920, 4919, 4918, 4917, 4916, 4915, 4914, 4913, 4912, 4911, 4910, 4909, 4908, 4907, 4906, 4905, 4904, 4903, 4902, 4901, 4900, 4899, 4898, 4897, 4896, 4895, 4894, 4893, 4892, 4891, 4890, 4889, 4888, 4887, 4886, 4885, 4884, 4883, 4882, 4881, 4880, 4879, 4878, 4877, 4876, 4875, 4874, 4873, 4872, 4871, 4870, 4869, 4868, 4867, 4866, 4865, 4864, 4863, 4862, 4861, 4860, 4859, 4858, 4857, 4856, 4855, 4854, 4853, 4852, 4851, 4850, 4849, 4848, 4847, 4846, 4845, 4844, 4843, 4842, 4841, 4840, 4839, 4838, 4837, 4836, 4835, 4834, 4833, 4832, 4831, 4830, 4829, 4828, 4827, 4826, 4825, 4824, 4823, 4822, 4821, 4820, 4819, 4818, 4817, 4816, 4815, 4814, 4813, 4812, 4811, 4810, 4809, 4808, 4807, 4806, 4805, 4804, 4803, 4802, 4801, 4800, 4799, 4798, 4797, 4796, 4795, 4794, 4793, 4792, 4791, 4790, 4789, 4788, 4787, 4786, 4785, 4784, 4783, 4782, 4781, 4780, 4779, 4778, 4777, 4776, 4775, 4774, 4773, 4772, 4771, 4770, 4769, 4768, 4767, 4766, 4765, 4764, 4763, 4762, 4761, 4760, 4759, 4758, 4757, 4756, 4755, 4754, 4753, 4752, 4751, 4750, 4749, 4748, 4747, 4746, 4745, 4744, 4743, 4742, 4741, 4740, 4739, 4738, 4737, 4736, 4735, 4734, 4733, 4732, 4731, 4730, 4729, 4728, 4727, 4726, 4725, 4724, 4723, 4722, 4721, 4720, 4719, 4718, 4717, 4716, 4715, 4714, 4713, 4712, 4711, 4710, 4709, 4708, 4707, 4706, 4705, 4704, 4703, 4702, 4701, 4700, 4699, 4698, 4697, 4696, 4695, 4694, 4693, 4692, 4691, 4690, 4689, 4688, 4687, 4686, 4685, 4684, 4683, 4682, 4681, 4680, 4679, 4678, 4677, 4676, 4675, 4674, 4673, 4672, 4671, 4670, 4669, 4668, 4667, 4666, 4665, 4664, 4663, 4662, 4661, 4660, 4659, 4658, 4657, 4656, 4655, 4654, 4653, 4652, 4651, 4650, 4649, 4648, 4647, 4646, 4645, 4644, 4643, 4642, 4641, 4640, 4639, 4638, 4637, 4636, 4635, 4634, 4633, 4632, 4631, 4630, 4629, 4628, 4627, 4626, 4625, 4624, 4623, 4622, 4621, 4620, 4619, 4618, 4617, 4616, 4615, 4614, 4613, 4612, 4611, 4610, 4609, 4608, 4607, 4606, 4605, 4604, 4603, 4602, 4601, 4600, 4599, 4598, 4597, 4596, 4595, 4594, 4593, 4592, 4591, 4590, 4589, 4588, 4587, 4586, 4585, 4584, 4583, 4582, 4581, 4580, 4579, 4578, 4577, 4576, 4575, 4574, 4573, 4572, 4571, 4570, 4569, 4568, 4567, 4566, 4565, 4564, 4563, 4562, 4561, 4560, 4559, 4558, 4557, 4556, 4555, 4554, 4553, 4552, 4551, 4550, 4549, 4548, 4547, 4546, 4545, 4544, 4543, 4542, 4541, 4540, 4539, 4538, 4537, 4536, 4535, 4534, 4533, 4532, 4531, 4530, 4529, 4528, 4527, 4526, 4525, 4524, 4523, 4522, 4521, 4520, 4519, 4518, 4517, 4516, 4515, 4514, 4513, 4512, 4511, 4510, 4509, 4508, 4507, 4506, 4505, 4504, 4503, 4502, 4501, 4500, 4499, 4498, 4497, 4496, 4495, 4494, 4493, 4492, 4491, 4490, 4489, 4488, 4487, 4486, 4485, 4484, 4483, 4482, 4481, 4480, 4479, 4478, 4477, 4476, 4475, 4474, 4473, 4472, 4471, 4470, 4469, 4468, 4467, 4466, 4465, 4464, 4463, 4462, 4461, 4460, 4459, 4458, 4457, 4456, 4455, 4454, 4453, 4452, 4451, 4450, 4449, 4448, 4447, 4446, 4445, 4444, 4443, 4442, 4441, 4440, 4439, 4438, 4437, 4436, 4435, 4434, 4433, 4432, 4431, 4430, 4429, 4428, 4427, 4426, 4425, 4424, 4423, 4422, 4421, 4420, 4419, 4418, 4417, 4416, 4415, 4414, 4413, 4412, 4411, 4410, 4409, 4408, 4407, 4406, 4405, 4404, 4403, 4402, 4401, 4400, 4399, 4398, 4397, 4396, 4395, 4394, 4393, 4392, 4391, 4390, 4389, 4388, 4387, 4386, 4385, 4384, 4383, 4382, 4381, 4380, 4379, 4378, 4377, 4376, 4375, 4374, 4373, 4372, 4371, 4370, 4369, 4368, 4367, 4366, 4365, 4364, 4363, 4362, 4361, 4360, 4359, 4358, 4357, 4356, 4355, 4354, 4353, 4352, 4351, 4350, 4349, 4348, 4347, 4346, 4345, 4344, 4343, 4342, 4341, 4340, 4339, 4338, 4337, 4336, 4335, 4334, 4333, 4332, 4331, 4330, 4329, 4328, 4327, 4326, 4325, 4324, 4323, 4322, 4321, 4320, 4319, 4318, 4317, 4316, 4315, 4314, 4313, 4312, 4311, 4310, 4309, 4308, 4307, 4306, 4305, 4304, 4303, 4302, 4301, 4300, 4299, 4298, 4297, 4296, 4295, 4294, 4293, 4292, 4291, 4290, 4289, 4288, 4287, 4286, 4285, 4284, 4283, 4282, 4281, 4280, 4279, 4278, 4277, 4276, 4275, 4274, 4273, 4272, 4271, 4270, 4269, 4268, 4267, 4266, 4265, 4264, 4263, 4262, 4261, 4260, 4259, 4258, 4257, 4256, 4255, 4254, 4253, 4252, 4251, 4250, 4249, 4248, 4247, 4246, 4245, 4244, 4243, 4242, 4241, 4240, 4239, 4238, 4237, 4236, 4235, 4234, 4233, 4232, 4231, 4230, 4229, 4228, 4227, 4226, 4225, 4224, 4223, 4222, 4221, 4220, 4219, 4218, 4217, 4216, 4215, 4214, 4213, 4212, 4211, 4210, 4209, 4208, 4207, 4206, 4205, 4204, 4203, 4202, 4201, 4200, 4199, 4198, 4197, 4196, 4195, 4194, 4193, 4192, 4191, 4190, 4189, 4188, 4187, 4186, 4185, 4184, 4183, 4182, 4181, 4180, 4179, 4178, 4177, 4176, 4175, 4174, 4173, 4172, 4171, 4170, 4169, 4168, 4167, 4166, 4165, 4164, 4163, 4162, 4161, 4160, 4159, 4158, 4157, 4156, 4155, 4154, 4153, 4152, 4151, 4150, 4149, 4148, 4147, 4146, 4145, 4144, 4143, 4142, 4141, 4140, 4139, 4138, 4137, 4136, 4135, 4134, 4133, 4132, 4131, 4130, 4129, 4128, 4127, 4126, 4125, 4124, 4123, 4122, 4121, 4120, 4119, 4118, 4117, 4116, 4115, 4114, 4113, 4112, 4111, 4110, 4109, 4108, 4107, 4106, 4105, 4104, 4103, 4102, 4101, 4100, 4099, 4098, 4097, 4096, 4095, 4094, 4093, 4092, 4091, 4090, 4089, 4088, 4087, 4086, 4085, 4084, 4083, 4082, 4081, 4080, 4079, 4078, 4077, 4076, 4075, 4074, 4073, 4072, 4071, 4070, 4069, 4068, 4067, 4066, 4065, 4064, 4063, 4062, 4061, 4060, 4059, 4058, 4057, 4056, 4055, 4054, 4053, 4052, 4051, 4050, 4049, 4048, 4047, 4046, 4045, 4044, 4043, 4042, 4041, 4040, 4039, 4038, 4037, 4036, 4035, 4034, 4033, 4032, 4031, 4030, 4029, 4028, 4027, 4026, 4025, 4024, 4023, 4022, 4021, 4020, 4019, 4018, 4017, 4016, 4015, 4014, 4013, 4012, 4011, 4010, 4009, 4008, 4007, 4006, 4005, 4004, 4003, 4002, 4001, 4000, 3999, 3998, 3997, 3996, 3995, 3994, 3993, 3992, 3991, 3990, 3989, 3988, 3987, 3986, 3985, 3984, 3983, 3982, 3981, 3980, 3979, 3978, 3977, 3976, 3975, 3974, 3973, 3972, 3971, 3970, 3969, 3968, 3967, 3966, 3965, 3964, 3963, 3962, 3961, 3960, 3959, 3958, 3957, 3956, 3955, 3954, 3953, 3952, 3951, 3950, 3949, 3948, 3947, 3946, 3945, 3944, 3943, 3942, 3941, 3940, 3939, 3938, 3937, 3936, 3935, 3934, 3933, 3932, 3931, 3930, 3929, 3928, 3927, 3926, 3925, 3924, 3923, 3922, 3921, 3920, 3919, 3918, 3917, 3916, 3915, 3914, 3913, 3912, 3911, 3910, 3909, 3908, 3907, 3906, 3905, 3904, 3903, 3902, 3901, 3900, 3899, 3898, 3897, 3896, 3895, 3894, 3893, 3892, 3891, 3890, 3889, 3888, 3887, 3886, 3885, 3884, 3883, 3882, 3881, 3880, 3879, 3878, 3877, 3876, 3875, 3874, 3873, 3872, 3871, 3870, 3869, 3868, 3867, 3866, 3865, 3864, 3863, 3862, 3861, 3860, 3859, 3858, 3857, 3856, 3855, 3854, 3853, 3852, 3851, 3850, 3849, 3848, 3847, 3846, 3845, 3844, 3843, 3842, 3841, 3840, 3839, 3838, 3837, 3836, 3835, 3834, 3833, 3832, 3831, 3830, 3829, 3828, 3827, 3826, 3825, 3824, 3823, 3822, 3821, 3820, 3819, 3818, 3817, 3816, 3815, 3814, 3813, 3812, 3811, 3810, 3809, 3808, 3807, 3806, 3805, 3804, 3803, 3802, 3801, 3800, 3799, 3798, 3797, 3796, 3795, 3794, 3793, 3792, 3791, 3790, 3789, 3788, 3787, 3786, 3785, 3784, 3783, 3782, 3781, 3780, 3779, 3778, 3777, 3776, 3775, 3774, 3773, 3772, 3771, 3770, 3769, 3768, 3767, 3766, 3765, 3764, 3763, 3762, 3761, 3760, 3759, 3758, 3757, 3756, 3755, 3754, 3753, 3752, 3751, 3750, 3749, 3748, 3747, 3746, 3745, 3744, 3743, 3742, 3741, 3740, 3739, 3738, 3737, 3736, 3735, 3734, 3733, 3732, 3731, 3730, 3729, 3728, 3727, 3726, 3725, 3724, 3723, 3722, 3721, 3720, 3719, 3718, 3717, 3716, 3715, 3714, 3713, 3712, 3711, 3710, 3709, 3708, 3707, 3706, 3705, 3704, 3703, 3702, 3701, 3700, 3699, 3698, 3697, 3696, 3695, 3694, 3693, 3692, 3691, 3690, 3689, 3688, 3687, 3686, 3685, 3684, 3683, 3682, 3681, 3680, 3679, 3678, 3677, 3676, 3675, 3674, 3673, 3672, 3671, 3670, 3669, 3668, 3667, 3666, 3665, 3664, 3663, 3662, 3661, 3660, 3659, 3658, 3657, 3656, 3655, 3654, 3653, 3652, 3651, 3650, 3649, 3648, 3647, 3646, 3645, 3644, 3643, 3642, 3641, 3640, 3639, 3638, 3637, 3636, 3635, 3634, 3633, 3632, 3631, 3630, 3629, 3628, 3627, 3626, 3625, 3624, 3623, 3622, 3621, 3620, 3619, 3618, 3617, 3616, 3615, 3614, 3613, 3612, 3611, 3610, 3609, 3608, 3607, 3606, 3605, 3604, 3603, 3602, 3601, 3600, 3599, 3598, 3597, 3596, 3595, 3594, 3593, 3592, 3591, 3590, 3589, 3588, 3587, 3586, 3585, 3584, 3583, 3582, 3581, 3580, 3579, 3578, 3577, 3576, 3575, 3574, 3573, 3572, 3571, 3570, 3569, 3568, 3567, 3566, 3565, 3564, 3563, 3562, 3561, 3560, 3559, 3558, 3557, 3556, 3555, 3554, 3553, 3552, 3551, 3550, 3549, 3548, 3547, 3546, 3545, 3544, 3543, 3542, 3541, 3540, 3539, 3538, 3537, 3536, 3535, 3534, 3533, 3532, 3531, 3530, 3529, 3528, 3527, 3526, 3525, 3524, 3523, 3522, 3521, 3520, 3519, 3518, 3517, 3516, 3515, 3514, 3513, 3512, 3511, 3510, 3509, 3508, 3507, 3506, 3505, 3504, 3503, 3502, 3501, 3500, 3499, 3498, 3497, 3496, 3495, 3494, 3493, 3492, 3491, 3490, 3489, 3488, 3487, 3486, 3485, 3484, 3483, 3482, 3481, 3480, 3479, 3478, 3477, 3476, 3475, 3474, 3473, 3472, 3471, 3470, 3469, 3468, 3467, 3466, 3465, 3464, 3463, 3462, 3461, 3460, 3459, 3458, 3457, 3456, 3455, 3454, 3453, 3452, 3451, 3450, 3449, 3448, 3447, 3446, 3445, 3444, 3443, 3442, 3441, 3440, 3439, 3438, 3437, 3436, 3435, 3434, 3433, 3432, 3431, 3430, 3429, 3428, 3427, 3426, 3425, 3424, 3423, 3422, 3421, 3420, 3419, 3418, 3417, 3416, 3415, 3414, 3413, 3412, 3411, 3410, 3409, 3408, 3407, 3406, 3405, 3404, 3403, 3402, 3401, 3400, 3399, 3398, 3397, 3396, 3395, 3394, 3393, 3392, 3391, 3390, 3389, 3388, 3387, 3386, 3385, 3384, 3383, 3382, 3381, 3380, 3379, 3378, 3377, 3376, 3375, 3374, 3373, 3372, 3371, 3370, 3369, 3368, 3367, 3366, 3365, 3364, 3363, 3362, 3361, 3360, 3359, 3358, 3357, 3356, 3355, 3354, 3353, 3352, 3351, 3350, 3349, 3348, 3347, 3346, 3345, 3344, 3343, 3342, 3341, 3340, 3339, 3338, 3337, 3336, 3335, 3334, 3333, 3332, 3331, 3330, 3329, 3328, 3327, 3326, 3325, 3324, 3323, 3322, 3321, 3320, 3319, 3318, 3317, 3316, 3315, 3314, 3313, 3312, 3311, 3310, 3309, 3308, 3307, 3306, 3305, 3304, 3303, 3302, 3301, 3300, 3299, 3298, 3297, 3296, 3295, 3294, 3293, 3292, 3291, 3290, 3289, 3288, 3287, 3286, 3285, 3284, 3283, 3282, 3281, 3280, 3279, 3278, 3277, 3276, 3275, 3274, 3273, 3272, 3271, 3270, 3269, 3268, 3267, 3266, 3265, 3264, 3263, 3262, 3261, 3260, 3259, 3258, 3257, 3256, 3255, 3254, 3253, 3252, 3251, 3250, 3249, 3248, 3247, 3246, 3245, 3244, 3243, 3242, 3241, 3240, 3239, 3238, 3237, 3236, 3235, 3234, 3233, 3232, 3231, 3230, 3229, 3228, 3227, 3226, 3225, 3224, 3223, 3222, 3221, 3220, 3219, 3218, 3217, 3216, 3215, 3214, 3213, 3212, 3211, 3210, 3209, 3208, 3207, 3206, 3205, 3204, 3203, 3202, 3201, 3200, 3199, 3198, 3197, 3196, 3195, 3194, 3193, 3192, 3191, 3190, 3189, 3188, 3187, 3186, 3185, 3184, 3183, 3182, 3181, 3180, 3179, 3178, 3177, 3176, 3175, 3174, 3173, 3172, 3171, 3170, 3169, 3168, 3167, 3166, 3165, 3164, 3163, 3162, 3161, 3160, 3159, 3158, 3157, 3156, 3155, 3154, 3153, 3152, 3151, 3150, 3149, 3148, 3147, 3146, 3145, 3144, 3143, 3142, 3141, 3140, 3139, 3138, 3137, 3136, 3135, 3134, 3133, 3132, 3131, 3130, 3129, 3128, 3127, 3126, 3125, 3124, 3123, 3122, 3121, 3120, 3119, 3118, 3117, 3116, 3115, 3114, 3113, 3112, 3111, 3110, 3109, 3108, 3107, 3106, 3105, 3104, 3103, 3102, 3101, 3100, 3099, 3098, 3097, 3096, 3095, 3094, 3093, 3092, 3091, 3090, 3089, 3088, 3087, 3086, 3085, 3084, 3083, 3082, 3081, 3080, 3079, 3078, 3077, 3076, 3075, 3074, 3073, 3072, 3071, 3070, 3069, 3068, 3067, 3066, 3065, 3064, 3063, 3062, 3061, 3060, 3059, 3058, 3057, 3056, 3055, 3054, 3053, 3052, 3051, 3050, 3049, 3048, 3047, 3046, 3045, 3044, 3043, 3042, 3041, 3040, 3039, 3038, 3037, 3036, 3035, 3034, 3033, 3032, 3031, 3030, 3029, 3028, 3027, 3026, 3025, 3024, 3023, 3022, 3021, 3020, 3019, 3018, 3017, 3016, 3015, 3014, 3013, 3012, 3011, 3010, 3009, 3008, 3007, 3006, 3005, 3004, 3003, 3002, 3001, 3000, 2999, 2998, 2997, 2996, 2995, 2994, 2993, 2992, 2991, 2990, 2989, 2988, 2987, 2986, 2985, 2984, 2983, 2982, 2981, 2980, 2979, 2978, 2977, 2976, 2975, 2974, 2973, 2972, 2971, 2970, 2969, 2968, 2967, 2966, 2965, 2964, 2963, 2962, 2961, 2960, 2959, 2958, 2957, 2956, 2955, 2954, 2953, 2952, 2951, 2950, 2949, 2948, 2947, 2946, 2945, 2944, 2943, 2942, 2941, 2940, 2939, 2938, 2937, 2936, 2935, 2934, 2933, 2932, 2931, 2930, 2929, 2928, 2927, 2926, 2925, 2924, 2923, 2922, 2921, 2920, 2919, 2918, 2917, 2916, 2915, 2914, 2913, 2912, 2911, 2910, 2909, 2908, 2907, 2906, 2905, 2904, 2903, 2902, 2901, 2900, 2899, 2898, 2897, 2896, 2895, 2894, 2893, 2892, 2891, 2890, 2889, 2888, 2887, 2886, 2885, 2884, 2883, 2882, 2881, 2880, 2879, 2878, 2877, 2876, 2875, 2874, 2873, 2872, 2871, 2870, 2869, 2868, 2867, 2866, 2865, 2864, 2863, 2862, 2861, 2860, 2859, 2858, 2857, 2856, 2855, 2854, 2853, 2852, 2851, 2850, 2849, 2848, 2847, 2846, 2845, 2844, 2843, 2842, 2841, 2840, 2839, 2838, 2837, 2836, 2835, 2834, 2833, 2832, 2831, 2830, 2829, 2828, 2827, 2826, 2825, 2824, 2823, 2822, 2821, 2820, 2819, 2818, 2817, 2816, 2815, 2814, 2813, 2812, 2811, 2810, 2809, 2808, 2807, 2806, 2805, 2804, 2803, 2802, 2801, 2800, 2799, 2798, 2797, 2796, 2795, 2794, 2793, 2792, 2791, 2790, 2789, 2788, 2787, 2786, 2785, 2784, 2783, 2782, 2781, 2780, 2779, 2778, 2777, 2776, 2775, 2774, 2773, 2772, 2771, 2770, 2769, 2768, 2767, 2766, 2765, 2764, 2763, 2762, 2761, 2760, 2759, 2758, 2757, 2756, 2755, 2754, 2753, 2752, 2751, 2750, 2749, 2748, 2747, 2746, 2745, 2744, 2743, 2742, 2741, 2740, 2739, 2738, 2737, 2736, 2735, 2734, 2733, 2732, 2731, 2730, 2729, 2728, 2727, 2726, 2725, 2724, 2723, 2722, 2721, 2720, 2719, 2718, 2717, 2716, 2715, 2714, 2713, 2712, 2711, 2710, 2709, 2708, 2707, 2706, 2705, 2704, 2703, 2702, 2701, 2700, 2699, 2698, 2697, 2696, 2695, 2694, 2693, 2692, 2691, 2690, 2689, 2688, 2687, 2686, 2685, 2684, 2683, 2682, 2681, 2680, 2679, 2678, 2677, 2676, 2675, 2674, 2673, 2672, 2671, 2670, 2669, 2668, 2667, 2666, 2665, 2664, 2663, 2662, 2661, 2660, 2659, 2658, 2657, 2656, 2655, 2654, 2653, 2652, 2651, 2650, 2649, 2648, 2647, 2646, 2645, 2644, 2643, 2642, 2641, 2640, 2639, 2638, 2637, 2636, 2635, 2634, 2633, 2632, 2631, 2630, 2629, 2628, 2627, 2626, 2625, 2624, 2623, 2622, 2621, 2620, 2619, 2618, 2617, 2616, 2615, 2614, 2613, 2612, 2611, 2610, 2609, 2608, 2607, 2606, 2605, 2604, 2603, 2602, 2601, 2600, 2599, 2598, 2597, 2596, 2595, 2594, 2593, 2592, 2591, 2590, 2589, 2588, 2587, 2586, 2585, 2584, 2583, 2582, 2581, 2580, 2579, 2578, 2577, 2576, 2575, 2574, 2573, 2572, 2571, 2570, 2569, 2568, 2567, 2566, 2565, 2564, 2563, 2562, 2561, 2560, 2559, 2558, 2557, 2556, 2555, 2554, 2553, 2552, 2551, 2550, 2549, 2548, 2547, 2546, 2545, 2544, 2543, 2542, 2541, 2540, 2539, 2538, 2537, 2536, 2535, 2534, 2533, 2532, 2531, 2530, 2529, 2528, 2527, 2526, 2525, 2524, 2523, 2522, 2521, 2520, 2519, 2518, 2517, 2516, 2515, 2514, 2513, 2512, 2511, 2510, 2509, 2508, 2507, 2506, 2505, 2504, 2503, 2502, 2501, 2500, 2499, 2498, 2497, 2496, 2495, 2494, 2493, 2492, 2491, 2490, 2489, 2488, 2487, 2486, 2485, 2484, 2483, 2482, 2481, 2480, 2479, 2478, 2477, 2476, 2475, 2474, 2473, 2472, 2471, 2470, 2469, 2468, 2467, 2466, 2465, 2464, 2463, 2462, 2461, 2460, 2459, 2458, 2457, 2456, 2455, 2454, 2453, 2452, 2451, 2450, 2449, 2448, 2447, 2446, 2445, 2444, 2443, 2442, 2441, 2440, 2439, 2438, 2437, 2436, 2435, 2434, 2433, 2432, 2431, 2430, 2429, 2428, 2427, 2426, 2425, 2424, 2423, 2422, 2421, 2420, 2419, 2418, 2417, 2416, 2415, 2414, 2413, 2412, 2411, 2410, 2409, 2408, 2407, 2406, 2405, 2404, 2403, 2402, 2401, 2400, 2399, 2398, 2397, 2396, 2395, 2394, 2393, 2392, 2391, 2390, 2389, 2388, 2387, 2386, 2385, 2384, 2383, 2382, 2381, 2380, 2379, 2378, 2377, 2376, 2375, 2374, 2373, 2372, 2371, 2370, 2369, 2368, 2367, 2366, 2365, 2364, 2363, 2362, 2361, 2360, 2359, 2358, 2357, 2356, 2355, 2354, 2353, 2352, 2351, 2350, 2349, 2348, 2347, 2346, 2345, 2344, 2343, 2342, 2341, 2340, 2339, 2338, 2337, 2336, 2335, 2334, 2333, 2332, 2331, 2330, 2329, 2328, 2327, 2326, 2325, 2324, 2323, 2322, 2321, 2320, 2319, 2318, 2317, 2316, 2315, 2314, 2313, 2312, 2311, 2310, 2309, 2308, 2307, 2306, 2305, 2304, 2303, 2302, 2301, 2300, 2299, 2298, 2297, 2296, 2295, 2294, 2293, 2292, 2291, 2290, 2289, 2288, 2287, 2286, 2285, 2284, 2283, 2282, 2281, 2280, 2279, 2278, 2277, 2276, 2275, 2274, 2273, 2272, 2271, 2270, 2269, 2268, 2267, 2266, 2265, 2264, 2263, 2262, 2261, 2260, 2259, 2258, 2257, 2256, 2255, 2254, 2253, 2252, 2251, 2250, 2249, 2248, 2247, 2246, 2245, 2244, 2243, 2242, 2241, 2240, 2239, 2238, 2237, 2236, 2235, 2234, 2233, 2232, 2231, 2230, 2229, 2228, 2227, 2226, 2225, 2224, 2223, 2222, 2221, 2220, 2219, 2218, 2217, 2216, 2215, 2214, 2213, 2212, 2211, 2210, 2209, 2208, 2207, 2206, 2205, 2204, 2203, 2202, 2201, 2200, 2199, 2198, 2197, 2196, 2195, 2194, 2193, 2192, 2191, 2190, 2189, 2188, 2187, 2186, 2185, 2184, 2183, 2182, 2181, 2180, 2179, 2178, 2177, 2176, 2175, 2174, 2173, 2172, 2171, 2170, 2169, 2168, 2167, 2166, 2165, 2164, 2163, 2162, 2161, 2160, 2159, 2158, 2157, 2156, 2155, 2154, 2153, 2152, 2151, 2150, 2149, 2148, 2147, 2146, 2145, 2144, 2143, 2142, 2141, 2140, 2139, 2138, 2137, 2136, 2135, 2134, 2133, 2132, 2131, 2130, 2129, 2128, 2127, 2126, 2125, 2124, 2123, 2122, 2121, 2120, 2119, 2118, 2117, 2116, 2115, 2114, 2113, 2112, 2111, 2110, 2109, 2108, 2107, 2106, 2105, 2104, 2103, 2102, 2101, 2100, 2099, 2098, 2097, 2096, 2095, 2094, 2093, 2092, 2091, 2090, 2089, 2088, 2087, 2086, 2085, 2084, 2083, 2082, 2081, 2080, 2079, 2078, 2077, 2076, 2075, 2074, 2073, 2072, 2071, 2070, 2069, 2068, 2067, 2066, 2065, 2064, 2063, 2062, 2061, 2060, 2059, 2058, 2057, 2056, 2055, 2054, 2053, 2052, 2051, 2050, 2049, 2048, 2047, 2046, 2045, 2044, 2043, 2042, 2041, 2040, 2039, 2038, 2037, 2036, 2035, 2034, 2033, 2032, 2031, 2030, 2029, 2028, 2027, 2026, 2025, 2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1998, 1997, 1996, 1995, 1994, 1993, 1992, 1991, 1990, 1989, 1988, 1987, 1986, 1985, 1984, 1983, 1982, 1981, 1980, 1979, 1978, 1977, 1976, 1975, 1974, 1973, 1972, 1971, 1970, 1969, 1968, 1967, 1966, 1965, 1964, 1963, 1962, 1961, 1960, 1959, 1958, 1957, 1956, 1955, 1954, 1953, 1952, 1951, 1950, 1949, 1948, 1947, 1946, 1945, 1944, 1943, 1942, 1941, 1940, 1939, 1938, 1937, 1936, 1935, 1934, 1933, 1932, 1931, 1930, 1929, 1928, 1927, 1926, 1925, 1924, 1923, 1922, 1921, 1920, 1919, 1918, 1917, 1916, 1915, 1914, 1913, 1912, 1911, 1910, 1909, 1908, 1907, 1906, 1905, 1904, 1903, 1902, 1901, 1900, 1899, 1898, 1897, 1896, 1895, 1894, 1893, 1892, 1891, 1890, 1889, 1888, 1887, 1886, 1885, 1884, 1883, 1882, 1881, 1880, 1879, 1878, 1877, 1876, 1875, 1874, 1873, 1872, 1871, 1870, 1869, 1868, 1867, 1866, 1865, 1864, 1863, 1862, 1861, 1860, 1859, 1858, 1857, 1856, 1855, 1854, 1853, 1852, 1851, 1850, 1849, 1848, 1847, 1846, 1845, 1844, 1843, 1842, 1841, 1840, 1839, 1838, 1837, 1836, 1835, 1834, 1833, 1832, 1831, 1830, 1829, 1828, 1827, 1826, 1825, 1824, 1823, 1822, 1821, 1820, 1819, 1818, 1817, 1816, 1815, 1814, 1813, 1812, 1811, 1810, 1809, 1808, 1807, 1806, 1805, 1804, 1803, 1802, 1801, 1800, 1799, 1798, 1797, 1796, 1795, 1794, 1793, 1792, 1791, 1790, 1789, 1788, 1787, 1786, 1785, 1784, 1783, 1782, 1781, 1780, 1779, 1778, 1777, 1776, 1775, 1774, 1773, 1772, 1771, 1770, 1769, 1768, 1767, 1766, 1765, 1764, 1763, 1762, 1761, 1760, 1759, 1758, 1757, 1756, 1755, 1754, 1753, 1752, 1751, 1750, 1749, 1748, 1747, 1746, 1745, 1744, 1743, 1742, 1741, 1740, 1739, 1738, 1737, 1736, 1735, 1734, 1733, 1732, 1731, 1730, 1729, 1728, 1727, 1726, 1725, 1724, 1723, 1722, 1721, 1720, 1719, 1718, 1717, 1716, 1715, 1714, 1713, 1712, 1711, 1710, 1709, 1708, 1707, 1706, 1705, 1704, 1703, 1702, 1701, 1700, 1699, 1698, 1697, 1696, 1695, 1694, 1693, 1692, 1691, 1690, 1689, 1688, 1687, 1686, 1685, 1684, 1683, 1682, 1681, 1680, 1679, 1678, 1677, 1676, 1675, 1674, 1673, 1672, 1671, 1670, 1669, 1668, 1667, 1666, 1665, 1664, 1663, 1662, 1661, 1660, 1659, 1658, 1657, 1656, 1655, 1654, 1653, 1652, 1651, 1650, 1649, 1648, 1647, 1646, 1645, 1644, 1643, 1642, 1641, 1640, 1639, 1638, 1637, 1636, 1635, 1634, 1633, 1632, 1631, 1630, 1629, 1628, 1627, 1626, 1625, 1624, 1623, 1622, 1621, 1620, 1619, 1618, 1617, 1616, 1615, 1614, 1613, 1612, 1611, 1610, 1609, 1608, 1607, 1606, 1605, 1604, 1603, 1602, 1601, 1600, 1599, 1598, 1597, 1596, 1595, 1594, 1593, 1592, 1591, 1590, 1589, 1588, 1587, 1586, 1585, 1584, 1583, 1582, 1581, 1580, 1579, 1578, 1577, 1576, 1575, 1574, 1573, 1572, 1571, 1570, 1569, 1568, 1567, 1566, 1565, 1564, 1563, 1562, 1561, 1560, 1559, 1558, 1557, 1556, 1555, 1554, 1553, 1552, 1551, 1550, 1549, 1548, 1547, 1546, 1545, 1544, 1543, 1542, 1541, 1540, 1539, 1538, 1537, 1536, 1535, 1534, 1533, 1532, 1531, 1530, 1529, 1528, 1527, 1526, 1525, 1524, 1523, 1522, 1521, 1520, 1519, 1518, 1517, 1516, 1515, 1514, 1513, 1512, 1511, 1510, 1509, 1508, 1507, 1506, 1505, 1504, 1503, 1502, 1501, 1500, 1499, 1498, 1497, 1496, 1495, 1494, 1493, 1492, 1491, 1490, 1489, 1488, 1487, 1486, 1485, 1484, 1483, 1482, 1481, 1480, 1479, 1478, 1477, 1476, 1475, 1474, 1473, 1472, 1471, 1470, 1469, 1468, 1467, 1466, 1465, 1464, 1463, 1462, 1461, 1460, 1459, 1458, 1457, 1456, 1455, 1454, 1453, 1452, 1451, 1450, 1449, 1448, 1447, 1446, 1445, 1444, 1443, 1442, 1441, 1440, 1439, 1438, 1437, 1436, 1435, 1434, 1433, 1432, 1431, 1430, 1429, 1428, 1427, 1426, 1425, 1424, 1423, 1422, 1421, 1420, 1419, 1418, 1417, 1416, 1415, 1414, 1413, 1412, 1411, 1410, 1409, 1408, 1407, 1406, 1405, 1404, 1403, 1402, 1401, 1400, 1399, 1398, 1397, 1396, 1395, 1394, 1393, 1392, 1391, 1390, 1389, 1388, 1387, 1386, 1385, 1384, 1383, 1382, 1381, 1380, 1379, 1378, 1377, 1376, 1375, 1374, 1373, 1372, 1371, 1370, 1369, 1368, 1367, 1366, 1365, 1364, 1363, 1362, 1361, 1360, 1359, 1358, 1357, 1356, 1355, 1354, 1353, 1352, 1351, 1350, 1349, 1348, 1347, 1346, 1345, 1344, 1343, 1342, 1341, 1340, 1339, 1338, 1337, 1336, 1335, 1334, 1333, 1332, 1331, 1330, 1329, 1328, 1327, 1326, 1325, 1324, 1323, 1322, 1321, 1320, 1319, 1318, 1317, 1316, 1315, 1314, 1313, 1312, 1311, 1310, 1309, 1308, 1307, 1306, 1305, 1304, 1303, 1302, 1301, 1300, 1299, 1298, 1297, 1296, 1295, 1294, 1293, 1292, 1291, 1290, 1289, 1288, 1287, 1286, 1285, 1284, 1283, 1282, 1281, 1280, 1279, 1278, 1277, 1276, 1275, 1274, 1273, 1272, 1271, 1270, 1269, 1268, 1267, 1266, 1265, 1264, 1263, 1262, 1261, 1260, 1259, 1258, 1257, 1256, 1255, 1254, 1253, 1252, 1251, 1250, 1249, 1248, 1247, 1246, 1245, 1244, 1243, 1242, 1241, 1240, 1239, 1238, 1237, 1236, 1235, 1234, 1233, 1232, 1231, 1230, 1229, 1228, 1227, 1226, 1225, 1224, 1223, 1222, 1221, 1220, 1219, 1218, 1217, 1216, 1215, 1214, 1213, 1212, 1211, 1210, 1209, 1208, 1207, 1206, 1205, 1204, 1203, 1202, 1201, 1200, 1199, 1198, 1197, 1196, 1195, 1194, 1193, 1192, 1191, 1190, 1189, 1188, 1187, 1186, 1185, 1184, 1183, 1182, 1181, 1180, 1179, 1178, 1177, 1176, 1175, 1174, 1173, 1172, 1171, 1170, 1169, 1168, 1167, 1166, 1165, 1164, 1163, 1162, 1161, 1160, 1159, 1158, 1157, 1156, 1155, 1154, 1153, 1152, 1151, 1150, 1149, 1148, 1147, 1146, 1145, 1144, 1143, 1142, 1141, 1140, 1139, 1138, 1137, 1136, 1135, 1134, 1133, 1132, 1131, 1130, 1129, 1128, 1127, 1126, 1125, 1124, 1123, 1122, 1121, 1120, 1119, 1118, 1117, 1116, 1115, 1114, 1113, 1112, 1111, 1110, 1109, 1108, 1107, 1106, 1105, 1104, 1103, 1102, 1101, 1100, 1099, 1098, 1097, 1096, 1095, 1094, 1093, 1092, 1091, 1090, 1089, 1088, 1087, 1086, 1085, 1084, 1083, 1082, 1081, 1080, 1079, 1078, 1077, 1076, 1075, 1074, 1073, 1072, 1071, 1070, 1069, 1068, 1067, 1066, 1065, 1064, 1063, 1062, 1061, 1060, 1059, 1058, 1057, 1056, 1055, 1054, 1053, 1052, 1051, 1050, 1049, 1048, 1047, 1046, 1045, 1044, 1043, 1042, 1041, 1040, 1039, 1038, 1037, 1036, 1035, 1034, 1033, 1032, 1031, 1030, 1029, 1028, 1027, 1026, 1025, 1024, 1023, 1022, 1021, 1020, 1019, 1018, 1017, 1016, 1015, 1014, 1013, 1012, 1011, 1010, 1009, 1008, 1007, 1006, 1005, 1004, 1003, 1002, 1001, 1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 990, 989, 988, 987, 986, 985, 984, 983, 982, 981, 980, 979, 978, 977, 976, 975, 974, 973, 972, 971, 970, 969, 968, 967, 966, 965, 964, 963, 962, 961, 960, 959, 958, 957, 956, 955, 954, 953, 952, 951, 950, 949, 948, 947, 946, 945, 944, 943, 942, 941, 940, 939, 938, 937, 936, 935, 934, 933, 932, 931, 930, 929, 928, 927, 926, 925, 924, 923, 922, 921, 920, 919, 918, 917, 916, 915, 914, 913, 912, 911, 910, 909, 908, 907, 906, 905, 904, 903, 902, 901, 900, 899, 898, 897, 896, 895, 894, 893, 892, 891, 890, 889, 888, 887, 886, 885, 884, 883, 882, 881, 880, 879, 878, 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, 867, 866, 865, 864, 863, 862, 861, 860, 859, 858, 857, 856, 855, 854, 853, 852, 851, 850, 849, 848, 847, 846, 845, 844, 843, 842, 841, 840, 839, 838, 837, 836, 835, 834, 833, 832, 831, 830, 829, 828, 827, 826, 825, 824, 823, 822, 821, 820, 819, 818, 817, 816, 815, 814, 813, 812, 811, 810, 809, 808, 807, 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, 707, 706, 705, 704, 703, 702, 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, 665, 664, 663, 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33, -34, -35, -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63, -64, -65, -66, -67, -68, -69, -70, -71, -72, -73, -74, -75, -76, -77, -78, -79, -80, -81, -82, -83, -84, -85, -86, -87, -88, -89, -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, -100, -101, -102, -103, -104, -105, -106, -107, -108, -109, -110, -111, -112, -113, -114, -115, -116, -117, -118, -119, -120, -121, -122, -123, -124, -125, -126, -127, -128, -129, -130, -131, -132, -133, -134, -135, -136, -137, -138, -139, -140, -141, -142, -143, -144, -145, -146, -147, -148, -149, -150, -151, -152, -153, -154, -155, -156, -157, -158, -159, -160, -161, -162, -163, -164, -165, -166, -167, -168, -169, -170, -171, -172, -173, -174, -175, -176, -177, -178, -179, -180, -181, -182, -183, -184, -185, -186, -187, -188, -189, -190, -191, -192, -193, -194, -195, -196, -197, -198, -199, -200, -201, -202, -203, -204, -205, -206, -207, -208, -209, -210, -211, -212, -213, -214, -215, -216, -217, -218, -219, -220, -221, -222, -223, -224, -225, -226, -227, -228, -229, -230, -231, -232, -233, -234, -235, -236, -237, -238, -239, -240, -241, -242, -243, -244, -245, -246, -247, -248, -249, -250, -251, -252, -253, -254, -255, -256, -257, -258, -259, -260, -261, -262, -263, -264, -265, -266, -267, -268, -269, -270, -271, -272, -273, -274, -275, -276, -277, -278, -279, -280, -281, -282, -283, -284, -285, -286, -287, -288, -289, -290, -291, -292, -293, -294, -295, -296, -297, -298, -299, -300, -301, -302, -303, -304, -305, -306, -307, -308, -309, -310, -311, -312, -313, -314, -315, -316, -317, -318, -319, -320, -321, -322, -323, -324, -325, -326, -327, -328, -329, -330, -331, -332, -333, -334, -335, -336, -337, -338, -339, -340, -341, -342, -343, -344, -345, -346, -347, -348, -349, -350, -351, -352, -353, -354, -355, -356, -357, -358, -359, -360, -361, -362, -363, -364, -365, -366, -367, -368, -369, -370, -371, -372, -373, -374, -375, -376, -377, -378, -379, -380, -381, -382, -383, -384, -385, -386, -387, -388, -389, -390, -391, -392, -393, -394, -395, -396, -397, -398, -399, -400, -401, -402, -403, -404, -405, -406, -407, -408, -409, -410, -411, -412, -413, -414, -415, -416, -417, -418, -419, -420, -421, -422, -423, -424, -425, -426, -427, -428, -429, -430, -431, -432, -433, -434, -435, -436, -437, -438, -439, -440, -441, -442, -443, -444, -445, -446, -447, -448, -449, -450, -451, -452, -453, -454, -455, -456, -457, -458, -459, -460, -461, -462, -463, -464, -465, -466, -467, -468, -469, -470, -471, -472, -473, -474, -475, -476, -477, -478, -479, -480, -481, -482, -483, -484, -485, -486, -487, -488, -489, -490, -491, -492, -493, -494, -495, -496, -497, -498, -499, -500, -501, -502, -503, -504, -505, -506, -507, -508, -509, -510, -511, -512, -513, -514, -515, -516, -517, -518, -519, -520, -521, -522, -523, -524, -525, -526, -527, -528, -529, -530, -531, -532, -533, -534, -535, -536, -537, -538, -539, -540, -541, -542, -543, -544, -545, -546, -547, -548, -549, -550, -551, -552, -553, -554, -555, -556, -557, -558, -559, -560, -561, -562, -563, -564, -565, -566, -567, -568, -569, -570, -571, -572, -573, -574, -575, -576, -577, -578, -579, -580, -581, -582, -583, -584, -585, -586, -587, -588, -589, -590, -591, -592, -593, -594, -595, -596, -597, -598, -599, -600, -601, -602, -603, -604, -605, -606, -607, -608, -609, -610, -611, -612, -613, -614, -615, -616, -617, -618, -619, -620, -621, -622, -623, -624, -625, -626, -627, -628, -629, -630, -631, -632, -633, -634, -635, -636, -637, -638, -639, -640, -641, -642, -643, -644, -645, -646, -647, -648, -649, -650, -651, -652, -653, -654, -655, -656, -657, -658, -659, -660, -661, -662, -663, -664, -665, -666, -667, -668, -669, -670, -671, -672, -673, -674, -675, -676, -677, -678, -679, -680, -681, -682, -683, -684, -685, -686, -687, -688, -689, -690, -691, -692, -693, -694, -695, -696, -697, -698, -699, -700, -701, -702, -703, -704, -705, -706, -707, -708, -709, -710, -711, -712, -713, -714, -715, -716, -717, -718, -719, -720, -721, -722, -723, -724, -725, -726, -727, -728, -729, -730, -731, -732, -733, -734, -735, -736, -737, -738, -739, -740, -741, -742, -743, -744, -745, -746, -747, -748, -749, -750, -751, -752, -753, -754, -755, -756, -757, -758, -759, -760, -761, -762, -763, -764, -765, -766, -767, -768, -769, -770, -771, -772, -773, -774, -775, -776, -777, -778, -779, -780, -781, -782, -783, -784, -785, -786, -787, -788, -789, -790, -791, -792, -793, -794, -795, -796, -797, -798, -799, -800, -801, -802, -803, -804, -805, -806, -807, -808, -809, -810, -811, -812, -813, -814, -815, -816, -817, -818, -819, -820, -821, -822, -823, -824, -825, -826, -827, -828, -829, -830, -831, -832, -833, -834, -835, -836, -837, -838, -839, -840, -841, -842, -843, -844, -845, -846, -847, -848, -849, -850, -851, -852, -853, -854, -855, -856, -857, -858, -859, -860, -861, -862, -863, -864, -865, -866, -867, -868, -869, -870, -871, -872, -873, -874, -875, -876, -877, -878, -879, -880, -881, -882, -883, -884, -885, -886, -887, -888, -889, -890, -891, -892, -893, -894, -895, -896, -897, -898, -899, -900, -901, -902, -903, -904, -905, -906, -907, -908, -909, -910, -911, -912, -913, -914, -915, -916, -917, -918, -919, -920, -921, -922, -923, -924, -925, -926, -927, -928, -929, -930, -931, -932, -933, -934, -935, -936, -937, -938, -939, -940, -941, -942, -943, -944, -945, -946, -947, -948, -949, -950, -951, -952, -953, -954, -955, -956, -957, -958, -959, -960, -961, -962, -963, -964, -965, -966, -967, -968, -969, -970, -971, -972, -973, -974, -975, -976, -977, -978, -979, -980, -981, -982, -983, -984, -985, -986, -987, -988, -989, -990, -991, -992, -993, -994, -995, -996, -997, -998, -999}, + 10000, + }, + + // 可以有多个 testcase +} + +func Test_longestConsecutive(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestConsecutive(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_longestConsecutive(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestConsecutive(tc.nums) + } + } +} diff --git a/Algorithms/0129.sum-root-to-leaf-numbers/README.md b/Algorithms/0129.sum-root-to-leaf-numbers/README.md new file mode 100755 index 000000000..f1f06a2e4 --- /dev/null +++ b/Algorithms/0129.sum-root-to-leaf-numbers/README.md @@ -0,0 +1,24 @@ +# [129. Sum Root to Leaf Numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) + +## 题目 +Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. + +An example is the root-to-leaf path 1->2->3 which represents the number 123. + +Find the total sum of all root-to-leaf numbers. + +For example, +``` + 1 + / \ + 2 3 + +The root-to-leaf path 1->2 represents the number 12. +The root-to-leaf path 1->3 represents the number 13. + +Return the sum = 12 + 13 = 25. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers.go b/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers.go new file mode 100755 index 000000000..8fc5eb1ee --- /dev/null +++ b/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers.go @@ -0,0 +1,32 @@ +package problem0129 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func sumNumbers(root *TreeNode) int { + res := 0 + + var dfs func(*TreeNode, int) + dfs = func(root *TreeNode, temp int) { + if root == nil { + return + } + + temp = temp*10 + root.Val + + if root.Left == nil && root.Right == nil { + res += temp + return + } + + dfs(root.Left, temp) + dfs(root.Right, temp) + } + + dfs(root, 0) + + return res +} diff --git a/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers_test.go b/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers_test.go new file mode 100755 index 000000000..91ee961aa --- /dev/null +++ b/Algorithms/0129.sum-root-to-leaf-numbers/sum-root-to-leaf-numbers_test.go @@ -0,0 +1,53 @@ +package problem0129 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{1, 2, 3, 4}, + []int{2, 1, 3, 4}, + 146, + }, + + { + []int{1, 2, 3}, + []int{2, 1, 3}, + 25, + }, + + // 可以有多个 testcase +} + +func Test_sumNumbers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, sumNumbers(root), "输入:%v", tc) + } +} + +func Benchmark_sumNumbers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + b.StopTimer() + root := kit.PreIn2Tree(tc.pre, tc.in) + b.StartTimer() + sumNumbers(root) + } + } +} diff --git a/Algorithms/0130.surrounded-regions/README.md b/Algorithms/0130.surrounded-regions/README.md new file mode 100755 index 000000000..c915353e7 --- /dev/null +++ b/Algorithms/0130.surrounded-regions/README.md @@ -0,0 +1,24 @@ +# [130. Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) + +## 题目 +Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. + +A region is captured by flipping all 'O's into 'X's in that surrounded region. +For example, +``` +X X X X +X O O X +X X O X +X O X X +``` +After running your function, the board should be: +``` +X X X X +X X X X +X X X X +X O X X +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0130.surrounded-regions/surrounded-regions.go b/Algorithms/0130.surrounded-regions/surrounded-regions.go new file mode 100755 index 000000000..43bc55bca --- /dev/null +++ b/Algorithms/0130.surrounded-regions/surrounded-regions.go @@ -0,0 +1,90 @@ +package problem0130 + +func solve(board [][]byte) { + m := len(board) + if m <= 2 { + return + } + + n := len(board[0]) + if n <= 2 { + return + } + + // isEscaped[i][j] == true,表示 (i,j) 点是联通的。 + // 也可以用来查看点 (i,j) 是否已经检查过了 + isEscaped := make([][]bool, m) + for i := 0; i < m; i++ { + isEscaped[i] = make([]bool, n) + } + + // idxM,idxN 分别记录点 (i,j) 的坐标值 + idxM := make([]int, 0, m*n) + idxN := make([]int, 0, m*n) + + bfs := func(i, j int) { + isEscaped[i][j] = true + idxM = append(idxM, i) + idxN = append(idxN, j) + + for len(idxM) > 0 { + i := idxM[0] + j := idxN[0] + idxM = idxM[1:] + idxN = idxN[1:] + + // 依次对 (i,j) 的上左下右点进行,bfs检查 + + if 0 <= i-1 && board[i-1][j] == 'O' && !isEscaped[i-1][j] { + idxM = append(idxM, i-1) + idxN = append(idxN, j) + isEscaped[i-1][j] = true + } + + if 0 <= j-1 && board[i][j-1] == 'O' && !isEscaped[i][j-1] { + idxM = append(idxM, i) + idxN = append(idxN, j-1) + isEscaped[i][j-1] = true + } + + if i+1 < m && board[i+1][j] == 'O' && !isEscaped[i+1][j] { + idxM = append(idxM, i+1) + idxN = append(idxN, j) + isEscaped[i+1][j] = true + } + + if j+1 < n && board[i][j+1] == 'O' && !isEscaped[i][j+1] { + idxM = append(idxM, i) + idxN = append(idxN, j+1) + isEscaped[i][j+1] = true + } + } + } + + // 联通的区域一定会到达四周,所以从4周开始检查所有的联通区域 + for j := 0; j < n; j++ { + if board[0][j] == 'O' && !isEscaped[0][j] { + bfs(0, j) + } + if board[m-1][j] == 'O' && !isEscaped[m-1][j] { + bfs(m-1, j) + } + } + for i := 0; i < m; i++ { + if board[i][0] == 'O' && !isEscaped[i][0] { + bfs(i, 0) + } + if board[i][n-1] == 'O' && !isEscaped[i][n-1] { + bfs(i, n-1) + } + } + + for i := 1; i < m-1; i++ { + for j := 1; j < n-1; j++ { + // 修改内部被占领的 'O' + if board[i][j] == 'O' && !isEscaped[i][j] { + board[i][j] = 'X' + } + } + } +} diff --git a/Algorithms/0130.surrounded-regions/surrounded-regions_test.go b/Algorithms/0130.surrounded-regions/surrounded-regions_test.go new file mode 100755 index 000000000..fe76d8204 --- /dev/null +++ b/Algorithms/0130.surrounded-regions/surrounded-regions_test.go @@ -0,0 +1,192 @@ +package problem0130 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]byte + ans [][]byte +}{ + + { + [][]byte{ + []byte("OXXXXXOO"), + []byte("OOOXXXXO"), + []byte("XXXXOOOO"), + []byte("XOXOOXXX"), + []byte("OXOXXXOO"), + []byte("OXXOOXXO"), + []byte("OXOXXXOO"), + []byte("OXXXXOXX"), + }, + [][]byte{ + []byte("OXXXXXOO"), + []byte("OOOXXXXO"), + []byte("XXXXOOOO"), + []byte("XXXOOXXX"), + []byte("OXXXXXOO"), + []byte("OXXXXXXO"), + []byte("OXXXXXOO"), + []byte("OXXXXOXX"), + }, + }, + + { + [][]byte{ + []byte("XXXXOX"), + []byte("OXXOOX"), + []byte("XOXOOO"), + []byte("XOOOXO"), + []byte("OOXXOX"), + []byte("XOXOXX"), + }, + [][]byte{ + []byte("XXXXOX"), + []byte("OXXOOX"), + []byte("XOXOOO"), + []byte("XOOOXO"), + []byte("OOXXXX"), + []byte("XOXOXX"), + }, + }, + + { + [][]byte{ + []byte("OXOOXX"), + []byte("OXXXOX"), + []byte("XOOXOO"), + []byte("XOXXXX"), + []byte("OOXOXX"), + []byte("XXOOOO"), + }, + [][]byte{ + []byte("OXOOXX"), + []byte("OXXXOX"), + []byte("XOOXOO"), + []byte("XOXXXX"), + []byte("OOXOXX"), + []byte("XXOOOO"), + }, + }, + + { + [][]byte{ + []byte("XOXOXOOOXO"), + []byte("XOOXXXOOOX"), + []byte("OOOOOOOOXX"), + []byte("OOOOOOXOOX"), + []byte("OOXXOXXOOO"), + []byte("XOOXXXOXXO"), + []byte("XOXOOXXOXO"), + []byte("XXOXXOXOOX"), + []byte("OOOOXOXOXO"), + []byte("XXOXXXXOOO"), + }, + [][]byte{ + []byte("XOXOXOOOXO"), + []byte("XOOXXXOOOX"), + []byte("OOOOOOOOXX"), + []byte("OOOOOOXOOX"), + []byte("OOXXOXXOOO"), + []byte("XOOXXXXXXO"), + []byte("XOXXXXXOXO"), + []byte("XXOXXXXOOX"), + []byte("OOOOXXXOXO"), + []byte("XXOXXXXOOO"), + }, + }, + + { + [][]byte{ + []byte("XXXX"), + []byte("XOOX"), + []byte("XOOX"), + []byte("XXXX"), + }, + [][]byte{ + []byte("XXXX"), + []byte("XXXX"), + []byte("XXXX"), + []byte("XXXX"), + }, + }, + + { + [][]byte{ + []byte("OXXOX"), + []byte("XOOXO"), + []byte("XOXOX"), + []byte("OXOOO"), + []byte("XXOXO"), + }, + [][]byte{ + []byte("OXXOX"), + []byte("XXXXO"), + []byte("XXXOX"), + []byte("OXOOO"), + []byte("XXOXO"), + }, + }, + + { + [][]byte{ + []byte("XXXX"), + []byte("XOOX"), + []byte("XXOX"), + []byte("XOXX"), + }, + [][]byte{ + []byte("XXXX"), + []byte("XXXX"), + []byte("XXXX"), + []byte("XOXX"), + }, + }, + + { + [][]byte{ + []byte("XXXX"), + }, + [][]byte{ + []byte("XXXX"), + }, + }, + + { + [][]byte{ + []byte("X"), + []byte("X"), + []byte("X"), + }, + [][]byte{ + []byte("X"), + []byte("X"), + []byte("X"), + }, + }, + + // 可以有多个 testcase +} + +func Test_solve(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + solve(tc.board) + ast.Equal(tc.ans, tc.board, "输入:%v", tc) + } +} + +func Benchmark_solve(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + solve(tc.board) + } + } +} diff --git a/Algorithms/0131.palindrome-partitioning/README.md b/Algorithms/0131.palindrome-partitioning/README.md new file mode 100755 index 000000000..f36e231a4 --- /dev/null +++ b/Algorithms/0131.palindrome-partitioning/README.md @@ -0,0 +1,23 @@ +# [131. Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/) + +## 题目 +Given a string s, partition s such that every substring of the partition is a palindrome. + +Return all possible palindrome partitioning of s. + +``` +For example, + +given s = "aab", + +Return + +[ + ["aa","b"], + ["a","a","b"] +] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0131.palindrome-partitioning/palindrome-partitioning.go b/Algorithms/0131.palindrome-partitioning/palindrome-partitioning.go new file mode 100755 index 000000000..ab0588e91 --- /dev/null +++ b/Algorithms/0131.palindrome-partitioning/palindrome-partitioning.go @@ -0,0 +1,42 @@ +package problem0131 + +func partition(s string) [][]string { + result := [][]string{} + current := make([]string, 0, len(s)) + dfs(s, 0, current, &result) + return result +} + +func dfs(s string, i int, cur []string, result *[][]string) { + if i == len(s) { + tmp := make([]string, len(cur)) + copy(tmp, cur) + *result = append(*result, tmp) + return + } + + for j := i; j < len(s); j++ { + // i == 0 时, + // 按照 len(cur[0]) 的不同,来划分 res + // 并以此类推 + if par(s[i : j+1]) { + dfs(s, j+1, append(cur, s[i:j+1]), result) + } + } +} + +// s 为回文,则返回 true +func par(s string) bool { + if len(s) <= 1 { + return true + } + a, b := 0, len(s)-1 + for a < b { + if s[a] != s[b] { + return false + } + a++ + b-- + } + return true +} diff --git a/Algorithms/0131.palindrome-partitioning/palindrome-partitioning_test.go b/Algorithms/0131.palindrome-partitioning/palindrome-partitioning_test.go new file mode 100755 index 000000000..e9c754ca2 --- /dev/null +++ b/Algorithms/0131.palindrome-partitioning/palindrome-partitioning_test.go @@ -0,0 +1,72 @@ +package problem0131 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans [][]string +}{ + + { + "cbbbcc", + [][]string{ + []string{"c", "b", "b", "b", "c", "c"}, + []string{"c", "b", "b", "b", "cc"}, + []string{"c", "b", "bb", "c", "c"}, + []string{"c", "b", "bb", "cc"}, + []string{"c", "bb", "b", "c", "c"}, + []string{"c", "bb", "b", "cc"}, + []string{"c", "bbb", "c", "c"}, + []string{"c", "bbb", "cc"}, + []string{"cbbbc", "c"}, + }, + }, + + { + "efe", + [][]string{ + []string{"e", "f", "e"}, + []string{"efe"}, + }, + }, + + { + "a", + [][]string{ + []string{"a"}, + }, + }, + + { + "aab", + [][]string{ + []string{"a", "a", "b"}, + []string{"aa", "b"}, + }, + }, + + // 可以有多个 testcase +} + +func Test_partition(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, partition(tc.s), "输入:%v", tc) + } +} + +func Benchmark_partition(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + partition(tc.s) + } + } +} diff --git a/Algorithms/0132.palindrome-partitioning-ii/README.md b/Algorithms/0132.palindrome-partitioning-ii/README.md new file mode 100755 index 000000000..694ae5677 --- /dev/null +++ b/Algorithms/0132.palindrome-partitioning-ii/README.md @@ -0,0 +1,11 @@ +# [132. Palindrome Partitioning II](https://leetcode.com/problems/palindrome-partitioning-ii/) + +## 题目 +Given a string s, partition s such that every substring of the partition is a palindrome. + +Return the minimum cuts needed for a palindrome partitioning of s. + +For example, given s = "aab", +Return 1 since the palindrome partitioning ["aa","b"] could be produced using 1 cut. + +## 解题思路 diff --git a/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii.go b/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii.go new file mode 100755 index 000000000..8eed54793 --- /dev/null +++ b/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii.go @@ -0,0 +1,37 @@ +package problem0132 + +func minCut(s string) int { + n := len(s) + if n == 0 { + return 0 + } + + // dp[i] == minCut(s[:i]) + dp := make([]int, n+1) + for i := 0; i < n+1; i++ { + dp[i] = i - 1 + } + + for i := 0; i < n+1; i++ { + // With char at i as the center to check palindrome and set the new min cut number for + // the up-boundary of the palindrome to be minimum of its current number and the min of + // the low-boundary plus 1. + // Need to check char at i to be the center for odd and event length of palindrome. + for j := 0; 0 <= i-j && i+j < n && s[i-j] == s[i+j]; j++ { + dp[i+j+1] = min(dp[i-j]+1, dp[i+j+1]) + } + + for j := 1; 0 <= i-j+1 && i+j < n && s[i-j+1] == s[i+j]; j++ { + dp[i+j+1] = min(dp[i-j+1]+1, dp[i+j+1]) + } + } + + return dp[n] +} + +func min(a int, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii_test.go b/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii_test.go new file mode 100755 index 000000000..4b4e095cd --- /dev/null +++ b/Algorithms/0132.palindrome-partitioning-ii/palindrome-partitioning-ii_test.go @@ -0,0 +1,66 @@ +package problem0132 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "apjesgpsxoeiokmqmfgvjslcjukbqxpsobyhjpbgdfruqdkeiszrlmtwgfxyfostpqczidfljwfbbrflkgdvtytbgqalguewnhvvmcgxboycffopmtmhtfizxkmeftcucxpobxmelmjtuzigsxnncxpaibgpuijwhankxbplpyejxmrrjgeoevqozwdtgospohznkoyzocjlracchjqnggbfeebmuvbicbvmpuleywrpzwsihivnrwtxcukwplgtobhgxukwrdlszfaiqxwjvrgxnsveedxseeyeykarqnjrtlaliyudpacctzizcftjlunlgnfwcqqxcqikocqffsjyurzwysfjmswvhbrmshjuzsgpwyubtfbnwajuvrfhlccvfwhxfqthkcwhatktymgxostjlztwdxritygbrbibdgkezvzajizxasjnrcjwzdfvdnwwqeyumkamhzoqhnqjfzwzbixclcxqrtniznemxeahfozp", + 452, + }, + + { + "abcdd", + 3, + }, + + { + "aaabaa", + 1, + }, + + { + "aaaaacbbbc", + 1, + }, + + { + "aab", + 1, + }, + + { + "", + 0, + }, + + // 可以有多个 testcase +} + +func Test_minCut(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + fmt.Println(len(tc.s)) + + ast.Equal(tc.ans, minCut(tc.s), "输入:%v", tc) + } +} + +func Benchmark_minCut(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minCut(tc.s) + } + } +} diff --git a/Algorithms/0134.gas-station/README.md b/Algorithms/0134.gas-station/README.md new file mode 100755 index 000000000..ac6941df5 --- /dev/null +++ b/Algorithms/0134.gas-station/README.md @@ -0,0 +1,15 @@ +# [134. Gas Station](https://leetcode.com/problems/gas-station/) + +## 题目 +There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. + +You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations. + +Return the starting gas station's index if you can travel around the circuit once, otherwise return -1. + +Note: +The solution is guaranteed to be unique. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0134.gas-station/gas-station.go b/Algorithms/0134.gas-station/gas-station.go new file mode 100755 index 000000000..2f51f3009 --- /dev/null +++ b/Algorithms/0134.gas-station/gas-station.go @@ -0,0 +1,25 @@ +package problem0134 + +func canCompleteCircuit(gas []int, cost []int) int { + remains, debts, start := 0, 0, 0 + + for i, g := range gas { + remains += g - cost[i] + if remains < 0 { + // i + 1 处重新开始 + start = i + 1 + // 记录沿路一共欠缺的油量 + debts += remains + // remain 至零 + remains = 0 + } + } + + if debts+remains < 0 { + // 最后的剩余的油量,如法全部偿还前期欠缺的油量 + // 则,无法跑完一圈 + return -1 + } + + return start +} diff --git a/Algorithms/0134.gas-station/gas-station_test.go b/Algorithms/0134.gas-station/gas-station_test.go new file mode 100755 index 000000000..813bcc406 --- /dev/null +++ b/Algorithms/0134.gas-station/gas-station_test.go @@ -0,0 +1,46 @@ +package problem0134 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + gas []int + cost []int + ans int +}{ + + { + []int{4}, + []int{5}, + -1, + }, + + { + []int{4, 3}, + []int{5, 1}, + 1, + }, + // 可以有多个 testcase +} + +func Test_canCompleteCircuit(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canCompleteCircuit(tc.gas, tc.cost), "输入:%v", tc) + } +} + +func Benchmark_canCompleteCircuit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canCompleteCircuit(tc.gas, tc.cost) + } + } +} diff --git a/Algorithms/0135.candy/README.md b/Algorithms/0135.candy/README.md new file mode 100755 index 000000000..5641cca00 --- /dev/null +++ b/Algorithms/0135.candy/README.md @@ -0,0 +1,14 @@ +# [135. Candy](https://leetcode.com/problems/candy/) + +## 题目 +There are N children standing in a line. Each child is assigned a rating value. + +You are giving candies to these children subjected to the following requirements: +1. Each child must have at least one candy. +1. Children with a higher rating get more candies than their neighbors. + +What is the minimum candies you must give? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0135.candy/candy.go b/Algorithms/0135.candy/candy.go new file mode 100755 index 000000000..2ec37aaa6 --- /dev/null +++ b/Algorithms/0135.candy/candy.go @@ -0,0 +1,48 @@ +package problem0135 + +func candy(ratings []int) int { + n := len(ratings) + if n <= 1 { + return n + } + + // left == big than left + left := make([]int, n) + // right == big than right + right := make([]int, n) + left[0] = 1 + right[n-1] = 1 + + for i := 1; i < n; i++ { + if ratings[i-1] < ratings[i] { + // i 比左边的大 + // 所以,他的数量要比左边的多一个 + left[i] = left[i-1] + 1 + } else { + left[i] = 1 + } + + if ratings[n-i-1] > ratings[n-i] { + // n-i-1 比右边的大 + // 所以,他的数量要比右边的多一个 + right[n-i-1] = right[n-i] + 1 + } else { + right[n-i-1] = 1 + } + } + + res := 0 + for i := 0; i < n; i++ { + // i 的实际数量应该是max(left[i], right[i] + res += max(left[i], right[i]) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0135.candy/candy_test.go b/Algorithms/0135.candy/candy_test.go new file mode 100755 index 000000000..f5c30d9c2 --- /dev/null +++ b/Algorithms/0135.candy/candy_test.go @@ -0,0 +1,69 @@ +package problem0135 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ratings []int + ans int +}{ + + { + []int{1, 2, 3, 3, 3, 1}, + 10, + }, + + { + []int{1, 2, 3, 3, 1}, + 9, + }, + + { + []int{1, 2, 3, 2, 1}, + 9, + }, + + { + []int{1, 2, 3, 4, 3}, + 11, + }, + + { + []int{1, 2, 3, 4, 4}, + 11, + }, + + { + []int{1, 2, 3, 4, 5}, + 15, + }, + + { + []int{0}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_candy(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, candy(tc.ratings), "输入:%v", tc) + } +} + +func Benchmark_candy(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + candy(tc.ratings) + } + } +} diff --git a/Algorithms/0136.single-number/README.md b/Algorithms/0136.single-number/README.md new file mode 100755 index 000000000..c15abf7a4 --- /dev/null +++ b/Algorithms/0136.single-number/README.md @@ -0,0 +1,11 @@ +# [136. Single Number](https://leetcode.com/problems/single-number/) + +## 题目 +Given an array of integers, every element appears twice except for one. Find that single one. + +Note: +Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0136.single-number/single-number.go b/Algorithms/0136.single-number/single-number.go new file mode 100755 index 000000000..651875fdd --- /dev/null +++ b/Algorithms/0136.single-number/single-number.go @@ -0,0 +1,11 @@ +package problem0136 + +func singleNumber(nums []int) int { + res := 0 + for _, n := range nums { + // n^n == 0 + // a^b^a^b^a == a + res ^= n + } + return res +} diff --git a/Algorithms/0136.single-number/single-number_test.go b/Algorithms/0136.single-number/single-number_test.go new file mode 100755 index 000000000..184d89cf6 --- /dev/null +++ b/Algorithms/0136.single-number/single-number_test.go @@ -0,0 +1,39 @@ +package problem0136 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 1, 2}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_singleNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, singleNumber(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_singleNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + singleNumber(tc.nums) + } + } +} diff --git a/Algorithms/0137.single-number-ii/README.md b/Algorithms/0137.single-number-ii/README.md new file mode 100755 index 000000000..d25ac4f20 --- /dev/null +++ b/Algorithms/0137.single-number-ii/README.md @@ -0,0 +1,21 @@ +# [137. Single Number II](https://leetcode.com/problems/single-number-ii/) + +Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. + +Note: + +Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? + +Example 1: + +```text +Input: [2,2,3,2] +Output: 3 +``` + +Example 2: + +```text +Input: [0,1,0,1,0,1,99] +Output: 99 +``` \ No newline at end of file diff --git a/Algorithms/0137.single-number-ii/single-number-ii.go b/Algorithms/0137.single-number-ii/single-number-ii.go new file mode 100755 index 000000000..2bd3b2efa --- /dev/null +++ b/Algorithms/0137.single-number-ii/single-number-ii.go @@ -0,0 +1,33 @@ +package problem0137 + +//ref: https://cloud.tencent.com/developer/article/1131945 + +// 如果是出现两次的话,用一个 bit 就可以 +// 比如 ones,初始为0 +// 当 5 第 1 次出现, ones = 5 +// 当 5 第 2 次出现, ones 清空为 0,表示 ones 可以去处理其他数字了 +// 所以,最后 如果 ones != 0的话, ones 记录的就是只出现了一次的那个数字 + +// 公式是 ones = ones xor i + +// 那么,如果是三次的话,香农定理,需要用 2 bits 进行记录 + +// 当 5 第 1 次出现的时候,ones = 5, twos = 0, ones 记录这个数字 +// 当 5 第 2 次出现的时候,ones = 0, twos = 5, twos 记录了这个数字 +// 当 5 第 3 次出现的时候,ones = 0, twos = 0, 都清空了,可以去处理其他数字了 +// 所以,如果有某个数字出现了 1 次,就存在 ones 中,出现了 2 次,就存在 twos 中 + +// 公式方面, 上面 2 次的时候,ones 清空的公式是 ones = ones xor i +// 而第 3 次时, ones 要等于零, 而这时 twos 是 True , 所以再 & 一个 twos 的非就可以, ones = (ones xor i) & ~twos +// 所以,总的公式是 +// ones = (ones xor i) & ~twos +// twos = (twos xor i) & ~ones + +func singleNumber(nums []int) int { + ones, twos := 0, 0 + for i := 0; i < len(nums); i++ { + ones = (ones ^ nums[i]) & ^twos + twos = (twos ^ nums[i]) & ^ones + } + return ones +} diff --git a/Algorithms/0137.single-number-ii/single-number-ii_test.go b/Algorithms/0137.single-number-ii/single-number-ii_test.go new file mode 100755 index 000000000..78d9fa618 --- /dev/null +++ b/Algorithms/0137.single-number-ii/single-number-ii_test.go @@ -0,0 +1,49 @@ +package problem0137 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{43, 16, 45, 89, 45, -2147483648, 45, 2147483646, -2147483647, -2147483648, 43, 2147483647, -2147483646, -2147483648, 89, -2147483646, 89, -2147483646, -2147483647, 2147483646, -2147483647, 16, 16, 2147483646, 43}, + 2147483647, + }, + + { + []int{-2, -2, 1, 1, -3, 1, -3, -3, -4, -2}, + -4, + }, + + { + []int{1, 1, 1, 2, 2, 2, 3}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_singleNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, singleNumber(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_singleNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + singleNumber(tc.nums) + } + } +} diff --git a/Algorithms/0139.word-break/README.md b/Algorithms/0139.word-break/README.md new file mode 100755 index 000000000..0956b8cd4 --- /dev/null +++ b/Algorithms/0139.word-break/README.md @@ -0,0 +1,18 @@ +# [139. Word Break](https://leetcode.com/problems/word-break/) + +## 题目 +Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words. + +For example, given +``` +s = "leetcode", +dict = ["leet", "code"]. + +Return true because "leetcode" can be segmented as "leet code". +``` +UPDATE (2017/1/4): +The wordDict parameter had been changed to a list of strings (instead of a set of strings). Please reload the code definition to get the latest changes. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0139.word-break/word-break.go b/Algorithms/0139.word-break/word-break.go new file mode 100755 index 000000000..7887c911d --- /dev/null +++ b/Algorithms/0139.word-break/word-break.go @@ -0,0 +1,42 @@ +package problem0139 + +import "sort" + +func wordBreak(s string, wordDict []string) bool { + if len(wordDict) == 0 { + return false + } + + dict := make(map[string]bool, len(wordDict)) + length := make(map[int]bool, len(wordDict)) + + for _, w := range wordDict { + length[len(w)] = true + dict[w] = true + } + + sizes := make([]int, 0, len(length)) + for k := range length { + sizes = append(sizes, k) + } + + sort.Ints(sizes) + + // dp[i] == true,等于 wordBreak(s[:i+1], wordDict) == true + dp := make([]bool, len(s)+1) + dp[0] = true + n := len(s) + for i := 0; i <= n; i++ { + if !dp[i] { + continue + } + + for _, size := range sizes { + if i+size <= n { + dp[i+size] = dp[i+size] || dict[s[i:i+size]] + } + } + } + + return dp[n] +} diff --git a/Algorithms/0139.word-break/word-break_test.go b/Algorithms/0139.word-break/word-break_test.go new file mode 100755 index 000000000..a1a1f45f9 --- /dev/null +++ b/Algorithms/0139.word-break/word-break_test.go @@ -0,0 +1,77 @@ +package problem0139 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + wordDict []string + ans bool +}{ + + { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab", + []string{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", "aaaaaaaaaa"}, + false, + }, + + { + "bb", + []string{"a", "b", "bbb", "bbbb"}, + true, + }, + + { + "a", + []string{}, + false, + }, + + { + "aaaaaaa", + []string{"aaaa", "aaa"}, + true, + }, + + { + "leetc", + []string{"leet", "code"}, + false, + }, + + { + "leetcode", + []string{"leet", "code"}, + true, + }, + + { + "leetleet", + []string{"leet", "code"}, + true, + }, + + // 可以有多个 testcase +} + +func Test_wordBreak(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, wordBreak(tc.s, tc.wordDict), "输入:%v", tc) + } +} + +func Benchmark_wordBreak(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wordBreak(tc.s, tc.wordDict) + } + } +} diff --git a/Algorithms/0140.word-break-ii/README.md b/Algorithms/0140.word-break-ii/README.md new file mode 100755 index 000000000..b5335d90f --- /dev/null +++ b/Algorithms/0140.word-break-ii/README.md @@ -0,0 +1,22 @@ +# [140. Word Break II](https://leetcode.com/problems/word-break-ii/) + +## 题目 +Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. You may assume the dictionary does not contain duplicate words. + +Return all such possible sentences. + +For example, given +``` +s = "catsanddog", +dict = ["cat", "cats", "and", "sand", "dog"]. + +A solution is ["cats and dog", "cat sand dog"]. +``` +UPDATE (2017/1/4): +The wordDict parameter had been changed to a list of strings (instead of a set of strings). Please reload the code definition to get the latest changes. + +## 解题思路 + +从这一题要学会估算复杂度 + +见程序注释 diff --git a/Algorithms/0140.word-break-ii/word-break-ii.go b/Algorithms/0140.word-break-ii/word-break-ii.go new file mode 100755 index 000000000..6985bb1a1 --- /dev/null +++ b/Algorithms/0140.word-break-ii/word-break-ii.go @@ -0,0 +1,72 @@ +package problem0140 + +import "sort" + +func wordBreak(s string, wordDict []string) []string { + if len(wordDict) == 0 { + return []string{} + } + + // dict 方便查找 wordDict 中的单词 + dict := make(map[string]bool, len(wordDict)) + length := make(map[int]bool, len(wordDict)) + + for _, w := range wordDict { + dict[w] = true + length[len(w)] = true + } + + // sizes 是 wordDict 中单词长度的集合 + // sizes 可以加快 for 循环 + sizes := make([]int, 0, len(length)) + for k := range length { + sizes = append(sizes, k) + } + sort.Ints(sizes) + + n := len(s) + + // dp[i] 等于 len(wordBreak(s[:i+1], wordDict)) + dp := make([]float64, len(s)+1) + dp[0] = 1 + + for i := 0; i <= n; i++ { + if dp[i] == 0 { + continue + } + + for _, size := range sizes { + if i+size <= n && dict[s[i:i+size]] { + dp[i+size] += dp[i] + } + } + } + + // 利用 dp[n] 统计解的数量,可以避免无用功 + // 取消下一行的注释符号,看看各个 test case 的 dp + // fmt.Println(dp) + if dp[n] == 0 { + return []string{} + } + + res := make([]string, 0, int(dp[n])) + + // 利用 dfs 获取所有的解 + var dfs func(int, string) + dfs = func(i int, str string) { + if i == len(s) { + res = append(res, str[1:]) + return + } + + for _, size := range sizes { + if i+size <= len(s) && dict[s[i:i+size]] { + dfs(i+size, str+" "+s[i:i+size]) + } + } + } + + dfs(0, "") + + return res +} diff --git a/Algorithms/0140.word-break-ii/word-break-ii_test.go b/Algorithms/0140.word-break-ii/word-break-ii_test.go new file mode 100755 index 000000000..7c23f2135 --- /dev/null +++ b/Algorithms/0140.word-break-ii/word-break-ii_test.go @@ -0,0 +1,53 @@ +package problem0140 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + wordDict []string + ans []string +}{ + + { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + []string{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", "aaaaaaaaaa"}, + []string{}, + }, + + { + "catsanddog", + []string{"cat", "cats", "and", "sand", "dog"}, + []string{"cat sand dog", "cats and dog"}, + }, + + { + "catsanddog", + []string{}, + []string{}, + }, + + // 可以有多个 testcase +} + +func Test_wordBreak(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, wordBreak(tc.s, tc.wordDict), "输入:%v", tc) + } +} + +func Benchmark_wordBreak(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wordBreak(tc.s, tc.wordDict) + } + } +} diff --git a/Algorithms/0141.linked-list-cycle/1.png b/Algorithms/0141.linked-list-cycle/1.png new file mode 100644 index 000000000..b0111ae63 Binary files /dev/null and b/Algorithms/0141.linked-list-cycle/1.png differ diff --git a/Algorithms/0141.linked-list-cycle/2.png b/Algorithms/0141.linked-list-cycle/2.png new file mode 100644 index 000000000..634e7a47f Binary files /dev/null and b/Algorithms/0141.linked-list-cycle/2.png differ diff --git a/Algorithms/0141.linked-list-cycle/3.png b/Algorithms/0141.linked-list-cycle/3.png new file mode 100644 index 000000000..9f11a9e45 Binary files /dev/null and b/Algorithms/0141.linked-list-cycle/3.png differ diff --git a/Algorithms/0141.linked-list-cycle/README.md b/Algorithms/0141.linked-list-cycle/README.md new file mode 100755 index 000000000..ba31f2aac --- /dev/null +++ b/Algorithms/0141.linked-list-cycle/README.md @@ -0,0 +1,39 @@ +# [141. Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) + +Given a linked list, determine if it has a cycle in it. + +To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list. + +Example 1: + +```text +Input: head = [3,2,0,-4], pos = 1 +Output: true +Explanation: There is a cycle in the linked list, where tail connects to the second node. +``` + +![1](1.png) + +Example 2: + +```text +Input: head = [1,2], pos = 0 +Output: true +Explanation: There is a cycle in the linked list, where tail connects to the first node. +``` + +![2](2.png) + +Example 3: + +```text +Input: head = [1], pos = -1 +Output: false +Explanation: There is no cycle in the linked list. +``` + +![3](3.png) + +Follow up: + +- Can you solve it using O(1) (i.e. constant) memory? \ No newline at end of file diff --git a/Algorithms/0141.linked-list-cycle/linked-list-cycle.go b/Algorithms/0141.linked-list-cycle/linked-list-cycle.go new file mode 100755 index 000000000..473955a48 --- /dev/null +++ b/Algorithms/0141.linked-list-cycle/linked-list-cycle.go @@ -0,0 +1,17 @@ +package problem0141 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is pre-defined... +type ListNode = kit.ListNode + +func hasCycle(head *ListNode) bool { + if head == nil { + return false + } + slow, fast := head, head.Next + for fast != nil && fast.Next != nil && slow != fast { + slow, fast = slow.Next, fast.Next.Next + } + return slow == fast +} diff --git a/Algorithms/0141.linked-list-cycle/linked-list-cycle_test.go b/Algorithms/0141.linked-list-cycle/linked-list-cycle_test.go new file mode 100755 index 000000000..cceed6395 --- /dev/null +++ b/Algorithms/0141.linked-list-cycle/linked-list-cycle_test.go @@ -0,0 +1,73 @@ +package problem0141 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ints []int + pos int + ans bool +}{ + + { + []int{-21, 10, 17, 8, 4, 26, 5, 35, 33, -7, -16, 27, -12, 6, 29, -12, 5, 9, 20, 14, 14, 2, 13, -24, 21, 23, -21, 5}, + -1, + false, + }, + + { + []int{3, 2, 0, -4}, + 1, + true, + }, + + { + []int{1, 2}, + 0, + true, + }, + + { + []int{}, + -1, + false, + }, + + { + []int{1, 2}, + -1, + false, + }, + + { + []int{1}, + -1, + false, + }, + + // 可以有多个 testcase +} + +func Test_hasCycle(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + head := kit.Ints2ListWithCycle(tc.ints, tc.pos) + ast.Equal(tc.ans, hasCycle(head), "输入:%v", tc) + } +} + +func Benchmark_hasCycle(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2ListWithCycle(tc.ints, tc.pos) + hasCycle(head) + } + } +} diff --git a/Algorithms/0142.linked-list-cycle-ii/1.png b/Algorithms/0142.linked-list-cycle-ii/1.png new file mode 100644 index 000000000..b0111ae63 Binary files /dev/null and b/Algorithms/0142.linked-list-cycle-ii/1.png differ diff --git a/Algorithms/0142.linked-list-cycle-ii/2.png b/Algorithms/0142.linked-list-cycle-ii/2.png new file mode 100644 index 000000000..634e7a47f Binary files /dev/null and b/Algorithms/0142.linked-list-cycle-ii/2.png differ diff --git a/Algorithms/0142.linked-list-cycle-ii/3.png b/Algorithms/0142.linked-list-cycle-ii/3.png new file mode 100644 index 000000000..9f11a9e45 Binary files /dev/null and b/Algorithms/0142.linked-list-cycle-ii/3.png differ diff --git a/Algorithms/0142.linked-list-cycle-ii/README.md b/Algorithms/0142.linked-list-cycle-ii/README.md new file mode 100755 index 000000000..ed9f0f7de --- /dev/null +++ b/Algorithms/0142.linked-list-cycle-ii/README.md @@ -0,0 +1,35 @@ +# [142. Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/) + +Given a linked list, return the node where the cycle begins. If there is no cycle, return null. + +To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list. + +Note: Do not modify the linked list. + +Example 1: + +```text +Input: head = [3,2,0,-4], pos = 1 +Output: tail connects to node index 1 +Explanation: There is a cycle in the linked list, where tail connects to the second node. +``` + +Example 2: + +```text +Input: head = [1,2], pos = 0 +Output: tail connects to node index 0 +Explanation: There is a cycle in the linked list, where tail connects to the first node. +``` + +Example 3: + +```text +Input: head = [1], pos = -1 +Output: no cycle +Explanation: There is no cycle in the linked list. +``` + +Follow up: + +- Can you solve it without using extra space? \ No newline at end of file diff --git a/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii.go b/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii.go new file mode 100755 index 000000000..b257e91c0 --- /dev/null +++ b/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii.go @@ -0,0 +1,27 @@ +package problem0142 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is pre-defined... +type ListNode = kit.ListNode + +// https://leetcode.com/problems/linked-list-cycle-ii/discuss/44793/O(n)-solution-by-using-two-pointers-without-change-anything +func detectCycle(head *ListNode) *ListNode { + if head == nil || head.Next == nil { + return nil + } + + slow, fast := head.Next, head.Next.Next + for fast != nil && fast.Next != nil && slow != fast { + slow, fast = slow.Next, fast.Next.Next + } + + if slow != fast { + return nil + } + + for slow != head { + slow, head = slow.Next, head.Next + } + return slow +} diff --git a/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii_test.go b/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii_test.go new file mode 100755 index 000000000..3bfb77093 --- /dev/null +++ b/Algorithms/0142.linked-list-cycle-ii/linked-list-cycle-ii_test.go @@ -0,0 +1,59 @@ +package problem0142 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ints []int + pos int +}{ + + { + []int{1}, + -1, + }, + + { + []int{1, 2, 3}, + -1, + }, + + { + []int{3, 2, 0, -4}, + 1, + }, + + { + []int{1, 2}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_detectCycle(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + head := kit.Ints2ListWithCycle(tc.ints, tc.pos) + var ans *ListNode + if tc.pos >= 0 { + ans = head.GetNodeWith(tc.ints[tc.pos]) + } + ast.Equal(ans, detectCycle(head), "输入:%v", tc) + } +} + +func Benchmark_detectCycle(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2ListWithCycle(tc.ints, tc.pos) + detectCycle(head) + } + } +} diff --git a/Algorithms/0143.reorder-list/README.md b/Algorithms/0143.reorder-list/README.md new file mode 100755 index 000000000..334d1b004 --- /dev/null +++ b/Algorithms/0143.reorder-list/README.md @@ -0,0 +1,14 @@ +# [143. Reorder List](https://leetcode.com/problems/reorder-list/) + +## 题目 +Given a singly linked list L: L0->L1->…->Ln-1->Ln, + +reorder it to: L0->Ln->L1->Ln-1->L2->Ln-2->… + +You must do this in-place without altering the nodes' values. + +For example, Given {1,2,3,4}, reorder it to {1,4,2,3}. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0143.reorder-list/reorder-list.go b/Algorithms/0143.reorder-list/reorder-list.go new file mode 100755 index 000000000..0070625dd --- /dev/null +++ b/Algorithms/0143.reorder-list/reorder-list.go @@ -0,0 +1,58 @@ +package problem0143 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func reorderList(head *ListNode) { + if head == nil { + return + } + + // 获取 list 的长度 size + cur := head + size := 0 + for cur != nil { + cur = cur.Next + size++ + } + + // size 为奇数, cur 指向 list 的中间节点 + // size 为偶数, cur 指向 list 前一半的最后一个节点 + cur = head + for i := 0; i < (size-1)/2; i++ { + cur = cur.Next + } + + // head -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 + // ^ + // | + // cur + + // reverse cur 后面的 list + next := cur.Next + for next != nil { + temp := next.Next + next.Next = cur + cur = next + next = temp + } + end := cur + + // head -> 1 -> 2 -> 3 <-> 4 <- 5 <- 6 <- end + + // 从两头开始,整合链条 + for head != end { + hNext := head.Next + eNext := end.Next + head.Next = end + end.Next = hNext + head = hNext + end = eNext + } + + // 封闭 list, 避免出现环状 list + end.Next = nil +} diff --git a/Algorithms/0143.reorder-list/reorder-list_test.go b/Algorithms/0143.reorder-list/reorder-list_test.go new file mode 100755 index 000000000..9a9f126ed --- /dev/null +++ b/Algorithms/0143.reorder-list/reorder-list_test.go @@ -0,0 +1,60 @@ +package problem0143 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + { + []int{}, + []int{}, + }, + + { + []int{1, 2, 3}, + []int{1, 3, 2}, + }, + + { + []int{1, 2, 3, 4}, + []int{1, 4, 2, 3}, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8}, + []int{1, 8, 2, 7, 3, 6, 4, 5}, + }, + + // 可以有多个 testcase +} + +func Test_reorderList(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + head := kit.Ints2List(tc.head) + reorderList(head) + ans := kit.List2Ints(head) + + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_reorderList(b *testing.B) { + is := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500} + head := kit.Ints2List(is) + for i := 0; i < b.N; i++ { + reorderList(head) + } +} diff --git a/Algorithms/0144.binary-tree-preorder-traversal/README.md b/Algorithms/0144.binary-tree-preorder-traversal/README.md new file mode 100755 index 000000000..f9dff3225 --- /dev/null +++ b/Algorithms/0144.binary-tree-preorder-traversal/README.md @@ -0,0 +1,23 @@ +# [144. Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/) + +## 题目 +Given a binary tree, return the preorder traversal of its nodes' values. + + +For example: +Given binary tree {1,#,2,3}, +``` + 1 + \ + 2 + / + 3 +``` + +return [1,2,3]. + +Note: Recursive solution is trivial, could you do it iteratively? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal.go b/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal.go new file mode 100755 index 000000000..54ae79de8 --- /dev/null +++ b/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal.go @@ -0,0 +1,40 @@ +package problem0144 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func preorderTraversal(root *TreeNode) []int { + // rightStack 用来暂存右侧节点 + var rightStack []*TreeNode + var res []int + + for cur := root; cur != nil; { + res = append(res, cur.Val) + + if cur.Left != nil { + if cur.Right != nil { + rightStack = append(rightStack, cur.Right) + } + cur = cur.Left + } else { // cur.Left == nil + if cur.Right != nil { + cur = cur.Right + } else { // cur.Left == cur.Right == nil + // stack 已空 + // 说明已经完成遍历了 + if len(rightStack) == 0 { + break + } + // 否则 + // 取出最后放入的右侧节点,继续 for 循环 + cur = rightStack[len(rightStack)-1] + rightStack = rightStack[:len(rightStack)-1] + } + } + } + + return res +} diff --git a/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal_test.go b/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal_test.go new file mode 100755 index 000000000..eff2adfd7 --- /dev/null +++ b/Algorithms/0144.binary-tree-preorder-traversal/binary-tree-preorder-traversal_test.go @@ -0,0 +1,51 @@ +package problem0144 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in, post []int +}{ + + { + []int{1, 2, 3}, + []int{1, 3, 2}, + []int{3, 2, 1}, + }, + + { + []int{1, 2, 4, 5, 3, 6, 7}, + []int{4, 2, 5, 1, 6, 3, 7}, + []int{4, 5, 2, 6, 7, 3, 1}, + }, + + // 可以有多个 testcase +} + +func Test_preorderTraversal(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + root := kit.InPost2Tree(tc.in, tc.post) + ast.Equal(tc.pre, preorderTraversal(root), "输入:%v", tc) + } +} + +func Benchmark_preorderTraversal(b *testing.B) { + pre := []int{1, 2, 4, 5, 3, 6, 7} + in := []int{4, 2, 5, 1, 6, 3, 7} + root := kit.PreIn2Tree(pre, in) + + for i := 0; i < b.N; i++ { + preorderTraversal(root) + } +} diff --git a/Algorithms/0145.binary-tree-postorder-traversal/README.md b/Algorithms/0145.binary-tree-postorder-traversal/README.md new file mode 100755 index 000000000..e84f9cf28 --- /dev/null +++ b/Algorithms/0145.binary-tree-postorder-traversal/README.md @@ -0,0 +1,21 @@ +# [145. Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/) + +## 题目 +Given a binary tree, return the postorder traversal of its nodes' values. + +For example: +Given binary tree {1,#,2,3}, +``` + 1 + \ + 2 + / + 3 +``` +return [3,2,1]. + +Note: Recursive solution is trivial, could you do it iteratively? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal.go b/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal.go new file mode 100755 index 000000000..ef03b2768 --- /dev/null +++ b/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal.go @@ -0,0 +1,47 @@ +package problem0145 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func postorderTraversal(root *TreeNode) []int { + // 保存以后才处理的节点 + var stack []*TreeNode + res := []int{} + + cur := root + for cur != nil { + if cur.Left == nil && cur.Right == nil { // 到达 leaf 节点 + res = append(res, cur.Val) + // 空 stack 说明,已经完成了遍历 + if len(stack) == 0 { + break + } + // 从 stack 中取出下个节点 + cur = stack[len(stack)-1] + stack = stack[:len(stack)-1] + } else { + // cur 不是 leaf,就先让 cur 入 stack + // 暂存 cur 的左右节点 + left, right := cur.Left, cur.Right + // 裁剪 cur,避免重复访问 + cur.Left, cur.Right = nil, nil + stack = append(stack, cur) + + // 移动 cur + if left != nil { + cur = left + if right != nil { + // 非空的 right 入 stack + stack = append(stack, right) + } + } else { // left == nil + cur = right + } + } + } + + return res +} diff --git a/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal_test.go b/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal_test.go new file mode 100755 index 000000000..7ad30d25c --- /dev/null +++ b/Algorithms/0145.binary-tree-postorder-traversal/binary-tree-postorder-traversal_test.go @@ -0,0 +1,51 @@ +package problem0145 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in, post []int +}{ + + { + []int{1, 2, 3}, + []int{1, 3, 2}, + []int{3, 2, 1}, + }, + + { + []int{1, 2, 4, 5, 3, 6, 7}, + []int{4, 2, 5, 1, 6, 3, 7}, + []int{4, 5, 2, 6, 7, 3, 1}, + }, + + // 可以有多个 testcase +} + +func Test_postorderTraversal(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.post, postorderTraversal(root), "输入:%v", tc) + } +} + +func Benchmark_postorderTraversal(b *testing.B) { + pre := []int{1, 2, 4, 5, 3, 6, 7} + in := []int{4, 2, 5, 1, 6, 3, 7} + root := kit.PreIn2Tree(pre, in) + + for i := 0; i < b.N; i++ { + postorderTraversal(root) + } +} diff --git a/Algorithms/0146.lru-cache/README.md b/Algorithms/0146.lru-cache/README.md new file mode 100755 index 000000000..878c97127 --- /dev/null +++ b/Algorithms/0146.lru-cache/README.md @@ -0,0 +1,30 @@ +# [146. LRU Cache](https://leetcode.com/problems/lru-cache/) + +## 题目 +Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. + +get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. +put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item. + +Follow up: +Could you do both operations in O(1) time complexity? + +Example: +``` +LRUCache cache = new LRUCache( 2 /* capacity */ ); + +cache.put(1, 1); +cache.put(2, 2); +cache.get(1); // returns 1 +cache.put(3, 3); // evicts key 2 +cache.get(2); // returns -1 (not found) +cache.put(4, 4); // evicts key 1 +cache.get(1); // returns -1 (not found) +cache.get(3); // returns 3 +cache.get(4); // returns 4 +``` +## 解题思路 + +LRU缓存利用了这样的一种思想。LRU是Least Recently Used 的缩写,翻译过来就是“最近最少使用”,也就是说,LRU缓存把最近最少使用的数据移除,让给最新读取的数据。而往往最常读取的,也是读取次数最多的,所以,利用LRU缓存,我们能够提高系统的performance. + +见程序注释 diff --git a/Algorithms/0146.lru-cache/lru-cache.go b/Algorithms/0146.lru-cache/lru-cache.go new file mode 100755 index 000000000..6182b8a3f --- /dev/null +++ b/Algorithms/0146.lru-cache/lru-cache.go @@ -0,0 +1,76 @@ +package problem0146 + +/** + * Your LRUCache object will be instantiated and called as such: + * obj := Constructor(capacity); + * param_1 := obj.Get(key); + * obj.Put(key,value); + */ + +import "container/list" + +// LRUCache contains a hash map and a doubly linked list +type LRUCache struct { + cap int // capacity + l *list.List // doubly linked list + m map[int]*list.Element // hash table for checking if list node exists +} + +// Pair is the value of a list node. +type Pair struct { + key int + value int +} + +// Constructor initializes a new LRUCache. +func Constructor(capacity int) LRUCache { + return LRUCache{ + cap: capacity, + l: new(list.List), + m: make(map[int]*list.Element, capacity), + } +} + +// Get a list node from the hash map. +func (c *LRUCache) Get(key int) int { + // check if list node exists + if node, ok := c.m[key]; ok { + val := node.Value.(*list.Element).Value.(Pair).value + // move node to front + c.l.MoveToFront(node) + return val + } + return -1 +} + +// Put key and value in the LRUCache +func (c *LRUCache) Put(key int, value int) { + // check if list node exists + if node, ok := c.m[key]; ok { + // move the node to front + c.l.MoveToFront(node) + // update the value of a list node + node.Value.(*list.Element).Value = Pair{key: key, value: value} + } else { + // delete the last list node if the list is full + if c.l.Len() == c.cap { + // get the key that we want to delete + idx := c.l.Back().Value.(*list.Element).Value.(Pair).key + // delete the node pointer in the hash map by key + delete(c.m, idx) + // remove the last list node + c.l.Remove(c.l.Back()) + } + // initialize a list node + node := &list.Element{ + Value: Pair{ + key: key, + value: value, + }, + } + // push the new list node into the list + ptr := c.l.PushFront(node) + // save the node pointer in the hash map + c.m[key] = ptr + } +} diff --git a/Algorithms/0146.lru-cache/lru-cache_test.go b/Algorithms/0146.lru-cache/lru-cache_test.go new file mode 100755 index 000000000..aae9b4f10 --- /dev/null +++ b/Algorithms/0146.lru-cache/lru-cache_test.go @@ -0,0 +1,76 @@ +package problem0146 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// capacity is 3 +func Test_3(t *testing.T) { + ast := assert.New(t) + + cache := Constructor(3) + + cache.Put(0, 0) + // [(0,0)] + + cache.Put(1, 1) + // [(1,1), (0,0)] + + cache.Put(2, 2) + // [(2,2), (1,1), (0,0)] + + ast.Equal(1, cache.Get(1), "get 1 from [(2,2), (1,1), (0,0)]") + // [(1,1), (2,2), (0,0)] + + cache.Put(3, 3) + // [(3,3), (1,1), (2,2)] + + ast.Equal(-1, cache.Get(0), "get 2 from [(3,3), (1,1), (2,2)]") + + cache.Put(4, 4) + // [(4,4), (3,3), (1,1)] + + ast.Equal(-1, cache.Get(2), "get 1 from [(4,4), (3,3), (1,1)]") + + ast.Equal(3, cache.Get(3), "get 3 from [(4,4), (3,3), (1,1)]") + // [(3,3), (4,4), (1,1)] + + ast.Equal(3, cache.Get(3), "get 3 from [(3,3), (4,4), (1,1)]") + // [(3,3), (4,4), (1,1)] + + ast.Equal(4, cache.Get(4), "get 4 from [(3,3), (4,4), (1,1)]") + // [(4,4), (3,3), (1,1)] + + ast.Equal(1, cache.Get(1), "get 4 from [(3,3), (4,4), (1,1)]") + // [(1,1), (4,4), (3,3)] + + cache.Put(5, 5) + // [(5,5), (1,1), (4,4)] +} + +// capacity is 1 +func Test_1(t *testing.T) { + ast := assert.New(t) + + cache := Constructor(1) + + cache.Put(0, 0) + // [(0,0)] + + cache.Put(1, 1) + // [(1,1)] + + cache.Put(2, 2) + // [(2,2)] + + ast.Equal(-1, cache.Get(1), "get 1 from [(2,2)]") + // [(1,1), (2,2), (0,0)] + + cache.Put(3, 3) + // [(3,3)] + + cache.Put(3, 33) + // [(3,33)] +} diff --git a/Algorithms/0147.insertion-sort-list/README.md b/Algorithms/0147.insertion-sort-list/README.md new file mode 100755 index 000000000..632977db6 --- /dev/null +++ b/Algorithms/0147.insertion-sort-list/README.md @@ -0,0 +1,8 @@ +# [147. Insertion Sort List](https://leetcode.com/problems/insertion-sort-list/) + +## 题目 +Sort a linked list using insertion sort. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0147.insertion-sort-list/insertion-sort-list.go b/Algorithms/0147.insertion-sort-list/insertion-sort-list.go new file mode 100755 index 000000000..d4ad55a85 --- /dev/null +++ b/Algorithms/0147.insertion-sort-list/insertion-sort-list.go @@ -0,0 +1,38 @@ +package problem0147 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func insertionSortList(head *ListNode) *ListNode { + headPre := &ListNode{Next: head} + + cur := head + for cur != nil && cur.Next != nil { + p := cur.Next + if cur.Val <= p.Val { + // p 不是需要插入到 cur 之前的元素 + cur = p + continue + } + + // p 是需要插入的元素 + // 把 p 从 cur 后删除 + cur.Next = p.Next + // 要把 p 插入到合适的 pre 和 next 之间 + pre, next := headPre, headPre.Next + // 合适的位置的意思是 + // pre.Val < p.Val <= next.Val + for next.Val < p.Val { + pre = next + next = next.Next + } + // 插入 + pre.Next = p + p.Next = next + } + + return headPre.Next +} diff --git a/Algorithms/0147.insertion-sort-list/insertion-sort-list_test.go b/Algorithms/0147.insertion-sort-list/insertion-sort-list_test.go new file mode 100755 index 000000000..48393e87b --- /dev/null +++ b/Algorithms/0147.insertion-sort-list/insertion-sort-list_test.go @@ -0,0 +1,42 @@ +package problem0147 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{2, 4, 3, 1, 5}, + []int{1, 2, 3, 4, 5}, + }, + + // 可以有多个 testcase +} + +func Test_insertionSortList(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + head := kit.Ints2List(tc.head) + ast.Equal(tc.ans, kit.List2Ints(insertionSortList(head)), "输入:%v", tc) + } +} + +func Benchmark_insertionSortList(b *testing.B) { + head := kit.Ints2List([]int{9, 6, 3, 1, 4, 8, 2, 5, 7, 19, 16, 13, 11, 14, 18, 12, 15, 17, 29, 26, 23, 21, 24, 28, 22, 25, 27, 39, 36, 33, 31, 34, 38, 32, 35, 37, 49, 46, 43, 41, 44, 48, 42, 45, 47}) + for i := 0; i < b.N; i++ { + insertionSortList(head) + } +} diff --git a/Algorithms/0148.sort-list/README.md b/Algorithms/0148.sort-list/README.md new file mode 100755 index 000000000..10af1dfa1 --- /dev/null +++ b/Algorithms/0148.sort-list/README.md @@ -0,0 +1,5 @@ +# [148. Sort List](https://leetcode.com/problems/sort-list/) + +## 题目 + +Sort a linked list in O(n log n) time using constant space complexity. diff --git a/Algorithms/0148.sort-list/sort-list.go b/Algorithms/0148.sort-list/sort-list.go new file mode 100755 index 000000000..038df66bb --- /dev/null +++ b/Algorithms/0148.sort-list/sort-list.go @@ -0,0 +1,67 @@ +package problem0148 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// ListNode 是题目预定义的数据类型 +type ListNode = kit.ListNode + +func sortList(head *ListNode) *ListNode { + if head == nil || head.Next == nil { + return head + } + left, right := split(head) + return merge(sortList(left), sortList(right)) +} + +// 从中间位置,切分 list +func split(head *ListNode) (left, right *ListNode) { + // head.Next != nil + // 因为, sortList 已经帮忙检查过了 + + // fast 的变化速度是 slow 的两倍 + // 当 fast 到达末尾的时候,slow 正好在 list 的中间 + slow, fast := head, head + var slowPre *ListNode + + for fast != nil && fast.Next != nil { + slowPre, slow = slow, slow.Next + fast = fast.Next.Next + } + + // 斩断 list + slowPre.Next = nil + // 使用 slowPre 是为了确保当 list 的长度为 2 时,会均分为两个长度为 1 的子 list + + left, right = head, slow + return +} + +// 把已经排序好了的两个 list left 和 right +// 进行合并 +func merge(left, right *ListNode) *ListNode { + // left != nil , right != nil + // 因为, sortList 已经帮忙检查过了 + + cur := &ListNode{} + headPre := cur + for left != nil && right != nil { + // cur 总是接上较小的 node + if left.Val < right.Val { + cur.Next, left = left, left.Next + } else { + cur.Next, right = right, right.Next + } + cur = cur.Next + } + + // 处理 left 或 right 中,剩下的节点 + if left == nil { + cur.Next = right + } else { + cur.Next = left + } + + return headPre.Next +} diff --git a/Algorithms/0148.sort-list/sort-list_test.go b/Algorithms/0148.sort-list/sort-list_test.go new file mode 100755 index 000000000..597d4d9b2 --- /dev/null +++ b/Algorithms/0148.sort-list/sort-list_test.go @@ -0,0 +1,42 @@ +package problem0148 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{2, 4, 3, 1, 5, 6, 100, 200, 300}, + []int{1, 2, 3, 4, 5, 6, 100, 200, 300}, + }, + + // 可以有多个 testcase +} + +func Test_insertionSortList(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + head := kit.Ints2List(tc.head) + ast.Equal(tc.ans, kit.List2Ints(sortList(head)), "输入:%v", tc) + } +} + +func Benchmark_insertionSortList(b *testing.B) { + head := kit.Ints2List([]int{9, 6, 3, 1, 4, 8, 2, 5, 7, 19, 16, 13, 11, 14, 18, 12, 15, 17, 29, 26, 23, 21, 24, 28, 22, 25, 27, 39, 36, 33, 31, 34, 38, 32, 35, 37, 49, 46, 43, 41, 44, 48, 42, 45, 47}) + for i := 0; i < b.N; i++ { + sortList(head) + } +} diff --git a/Algorithms/0149.max-points-on-a-line/149.100.png b/Algorithms/0149.max-points-on-a-line/149.100.png new file mode 100644 index 000000000..da3088582 Binary files /dev/null and b/Algorithms/0149.max-points-on-a-line/149.100.png differ diff --git a/Algorithms/0149.max-points-on-a-line/README.md b/Algorithms/0149.max-points-on-a-line/README.md new file mode 100755 index 000000000..0bfe10c57 --- /dev/null +++ b/Algorithms/0149.max-points-on-a-line/README.md @@ -0,0 +1,10 @@ +# [149. Max Points on a Line](https://leetcode.com/problems/max-points-on-a-line/) + +## 题目 +Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. + +## 解题思路 + +见程序注释 + +![100%](149.100.png) diff --git a/Algorithms/0149.max-points-on-a-line/max-points-on-a-line.go b/Algorithms/0149.max-points-on-a-line/max-points-on-a-line.go new file mode 100755 index 000000000..65394bc49 --- /dev/null +++ b/Algorithms/0149.max-points-on-a-line/max-points-on-a-line.go @@ -0,0 +1,56 @@ +package problem0149 + +// Point 是关于点的定义 +type Point struct { + X int + Y int +} + +func maxPoints(points []Point) int { + n := len(points) + // diffMap 用来过滤掉相同的点,并记录他们的个数 + diffMap := make(map[Point]int, n) + + for i := 0; i < n; i++ { + diffMap[points[i]]++ + } + + size := len(diffMap) + + // 不超过 2 个不同的点 + // 则,所有的点都在同一条直线上 + if size <= 2 { + return n + } + + max := 0 + // 存在相同的点, + // 则,提取所有不同的点,可以大大减少后面 3 个嵌套的 for 循环的次数 + if size < n { + points = make([]Point, 0, size) + for p := range diffMap { + points = append(points, p) + } + } + + for i := 0; i < size-1; i++ { + for j := i + 1; j < size; j++ { + count := 0 + // 所有的点,都要检查,是否与 i, j 共线 + for k := 0; k < size; k++ { + if isSameLine(points[i], points[j], points[k]) { + count += diffMap[points[k]] + } + } + if max < count { + max = count + } + } + } + + return max +} + +func isSameLine(p1, p2, p3 Point) bool { + return (p3.X-p1.X)*(p2.Y-p1.Y) == (p2.X-p1.X)*(p3.Y-p1.Y) +} diff --git a/Algorithms/0149.max-points-on-a-line/max-points-on-a-line_test.go b/Algorithms/0149.max-points-on-a-line/max-points-on-a-line_test.go new file mode 100755 index 000000000..474918504 --- /dev/null +++ b/Algorithms/0149.max-points-on-a-line/max-points-on-a-line_test.go @@ -0,0 +1,65 @@ +package problem0149 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + xy [][]int + ans int +}{ + + { + [][]int{[]int{-54, -297}, []int{-36, -222}, []int{3, -2}, []int{30, 53}, []int{-5, 1}, []int{-36, -222}, []int{0, 2}, []int{1, 3}, []int{6, -47}, []int{0, 4}, []int{2, 3}, []int{5, 0}, []int{48, 128}, []int{24, 28}, []int{0, -5}, []int{48, 128}, []int{-12, -122}, []int{-54, -297}, []int{-42, -247}, []int{-5, 0}, []int{2, 4}, []int{0, 0}, []int{54, 153}, []int{-30, -197}, []int{4, 5}, []int{4, 3}, []int{-42, -247}, []int{6, -47}, []int{-60, -322}, []int{-4, -2}, []int{-18, -147}, []int{6, -47}, []int{60, 178}, []int{30, 53}, []int{-5, 3}, []int{-42, -247}, []int{2, -2}, []int{12, -22}, []int{24, 28}, []int{0, -72}, []int{3, -4}, []int{-60, -322}, []int{48, 128}, []int{0, -72}, []int{-5, 3}, []int{5, 5}, []int{-24, -172}, []int{-48, -272}, []int{36, 78}, []int{-3, 3}}, + 30, + }, + + { + [][]int{}, + 0, + }, + + { + [][]int{ + []int{1, 1}, + []int{1, 1}, + []int{1, 1}, + }, + 3, + }, + + // 可以有多个 testcase +} + +func Test_maxPoints(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + points := makePoints(tc.xy) + ast.Equal(tc.ans, maxPoints(points), "输入:%v", tc) + } +} + +func Benchmark_maxPoints(b *testing.B) { + points := makePoints( + [][]int{[]int{-54, -297}, []int{-36, -222}, []int{3, -2}, []int{30, 53}, []int{-5, 1}, []int{-36, -222}, []int{0, 2}, []int{1, 3}, []int{6, -47}, []int{0, 4}, []int{2, 3}, []int{5, 0}, []int{48, 128}, []int{24, 28}, []int{0, -5}, []int{48, 128}, []int{-12, -122}, []int{-54, -297}, []int{-42, -247}, []int{-5, 0}, []int{2, 4}, []int{0, 0}, []int{54, 153}, []int{-30, -197}, []int{4, 5}, []int{4, 3}, []int{-42, -247}, []int{6, -47}, []int{-60, -322}, []int{-4, -2}, []int{-18, -147}, []int{6, -47}, []int{60, 178}, []int{30, 53}, []int{-5, 3}, []int{-42, -247}, []int{2, -2}, []int{12, -22}, []int{24, 28}, []int{0, -72}, []int{3, -4}, []int{-60, -322}, []int{48, 128}, []int{0, -72}, []int{-5, 3}, []int{5, 5}, []int{-24, -172}, []int{-48, -272}, []int{36, 78}, []int{-3, 3}}, + ) + + for i := 0; i < b.N; i++ { + maxPoints(points) + } +} + +func makePoints(xy [][]int) []Point { + res := make([]Point, len(xy)) + for i := 0; i < len(xy); i++ { + res[i] = Point{X: xy[i][0], Y: xy[i][1]} + } + + return res +} diff --git a/Algorithms/0150.evaluate-reverse-polish-notation/README.md b/Algorithms/0150.evaluate-reverse-polish-notation/README.md new file mode 100755 index 000000000..087c38f87 --- /dev/null +++ b/Algorithms/0150.evaluate-reverse-polish-notation/README.md @@ -0,0 +1,16 @@ +# [150. Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/) + +## 题目 +Evaluate the value of an arithmetic expression in Reverse Polish Notation. + +Valid operators are +, -, *, /. Each operand may be an integer or another expression. + +Some examples: +``` + ["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9 + ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation.go b/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation.go new file mode 100755 index 000000000..b36483d47 --- /dev/null +++ b/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation.go @@ -0,0 +1,42 @@ +package problem0150 + +import ( + "strconv" +) + +func evalRPN(tokens []string) int { + // 用于存放数字的栈 + nums := make([]int, 0, len(tokens)) + for _, s := range tokens { + if s == "+" || + s == "-" || + s == "*" || + s == "/" { + // 遇到操作符, 数字出栈 + b, a := nums[len(nums)-1], nums[len(nums)-2] + nums = nums[:len(nums)-2] + // 运算后的结果,重新入栈 + nums = append(nums, compute(a, b, s)) + } else { + // 遇到数字,则直接入栈 + temp, _ := strconv.Atoi(s) + nums = append(nums, temp) + } + } + + return nums[0] +} + +// 计算 +func compute(a, b int, opt string) int { + switch opt { + case "+": + return a + b + case "-": + return a - b + case "*": + return a * b + default: + return a / b + } +} diff --git a/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation_test.go b/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation_test.go new file mode 100755 index 000000000..a574cca01 --- /dev/null +++ b/Algorithms/0150.evaluate-reverse-polish-notation/evaluate-reverse-polish-notation_test.go @@ -0,0 +1,49 @@ +package problem0150 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + tokens []string + ans int +}{ + + { + []string{"2", "1", "-"}, + 1, + }, + + { + []string{"2", "1", "+", "3", "*"}, + 9, + }, + + { + []string{"4", "13", "5", "/", "+"}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_evalRPN(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, evalRPN(tc.tokens), "输入:%v", tc) + } +} + +func Benchmark_evalRPN(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + evalRPN(tc.tokens) + } + } +} diff --git a/Algorithms/0152.maximum-product-subarray/maximum-product-subarray.go b/Algorithms/0152.maximum-product-subarray/maximum-product-subarray.go index 9c55e530f..5b8df8d83 100755 --- a/Algorithms/0152.maximum-product-subarray/maximum-product-subarray.go +++ b/Algorithms/0152.maximum-product-subarray/maximum-product-subarray.go @@ -1,4 +1,4 @@ -package Problem0152 +package problem0152 func maxProduct(a []int) int { cur, neg, max := 1, 1, a[0] diff --git a/Algorithms/0152.maximum-product-subarray/maximum-product-subarray_test.go b/Algorithms/0152.maximum-product-subarray/maximum-product-subarray_test.go index 9f22594f8..ac62888e2 100755 --- a/Algorithms/0152.maximum-product-subarray/maximum-product-subarray_test.go +++ b/Algorithms/0152.maximum-product-subarray/maximum-product-subarray_test.go @@ -1,4 +1,4 @@ -package Problem0152 +package problem0152 import ( "fmt" diff --git a/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.go b/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.go index 45e9eca6f..983a59a54 100755 --- a/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.go +++ b/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.go @@ -1,4 +1,4 @@ -package Problem0153 +package problem0153 func findMin(a []int) int { Len := len(a) diff --git a/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array_test.go b/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array_test.go index 4e0b61d71..82896fea8 100755 --- a/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array_test.go +++ b/Algorithms/0153.find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array_test.go @@ -1,4 +1,4 @@ -package Problem0153 +package problem0153 import ( "fmt" diff --git a/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii.go b/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii.go index ee8eb424c..e055b85d2 100755 --- a/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii.go +++ b/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii.go @@ -1,4 +1,4 @@ -package Problem0154 +package problem0154 func findMin(a []int) int { L := len(a) diff --git a/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii_test.go b/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii_test.go index 302ab9884..4ea5e6378 100755 --- a/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii_test.go +++ b/Algorithms/0154.find-minimum-in-rotated-sorted-array-ii/find-minimum-in-rotated-sorted-array-ii_test.go @@ -1,4 +1,4 @@ -package Problem0154 +package problem0154 import ( "fmt" diff --git a/Algorithms/0155.min-stack/README.md b/Algorithms/0155.min-stack/README.md new file mode 100755 index 000000000..b955e86d4 --- /dev/null +++ b/Algorithms/0155.min-stack/README.md @@ -0,0 +1,24 @@ +# [155. Min Stack](https://leetcode.com/problems/min-stack/) + +## 题目 +Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. +- push(x) -- Push element x onto stack. +- pop() -- Removes the element on top of the stack. +- top() -- Get the top element. +- getMin() -- Retrieve the minimum element in the stack. + +Example: +``` +MinStack minStack = new MinStack(); +minStack.push(-2); +minStack.push(0); +minStack.push(-3); +minStack.getMin(); --> Returns -3. +minStack.pop(); +minStack.top(); --> Returns 0. +minStack.getMin(); --> Returns -2. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0155.min-stack/min-stack.go b/Algorithms/0155.min-stack/min-stack.go new file mode 100755 index 000000000..8a8364496 --- /dev/null +++ b/Algorithms/0155.min-stack/min-stack.go @@ -0,0 +1,38 @@ +package problem0155 + +// MinStack 是可以返回最小值的栈 +type MinStack struct { + stack []item +} +type item struct { + min, x int +} + +// Constructor 构造 MinStack +func Constructor() MinStack { + return MinStack{} +} + +// Push 存入数据 +func (this *MinStack) Push(x int) { + min := x + if len(this.stack) > 0 && this.GetMin() < x { + min = this.GetMin() + } + this.stack = append(this.stack, item{min: min, x: x}) +} + +// Pop 抛弃最后一个入栈的值 +func (this *MinStack) Pop() { + this.stack = this.stack[:len(this.stack)-1] +} + +// Top 返回最大值 +func (this *MinStack) Top() int { + return this.stack[len(this.stack)-1].x +} + +// GetMin 返回最小值 +func (this *MinStack) GetMin() int { + return this.stack[len(this.stack)-1].min +} diff --git a/Algorithms/0155.min-stack/min-stack_test.go b/Algorithms/0155.min-stack/min-stack_test.go new file mode 100755 index 000000000..68128df7f --- /dev/null +++ b/Algorithms/0155.min-stack/min-stack_test.go @@ -0,0 +1,50 @@ +package problem0155 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Problem155_1(t *testing.T) { + ast := assert.New(t) + + s := Constructor() + + s.Push(-2) + // [-2] + s.Push(0) + // [-2, 0] + s.Push(-3) + // [-2, 0, -3] + ast.Equal(-3, s.GetMin(), "get min from [-2, 0, -3]") + // [-2, 0, -3] + s.Pop() + // [-2, 0] + ast.Equal(0, s.Top(), "get top from [-2, 0]") + // [-2, 0] + ast.Equal(-2, s.GetMin(), "get min from [-2, 0]") + // [-2, 0] +} +func Test_Problem155_2(t *testing.T) { + ast := assert.New(t) + + s := Constructor() + + s.Push(-2) + // [-2] + s.Push(0) + // [-2, 0] + s.Push(-1) + // [-2, 0, -1] + ast.Equal(-2, s.GetMin(), "get min from [-2, -1, 0]") + // [-2, 0, -1] + ast.Equal(-1, s.Top(), "get top from [-2, -1, 0]") + // [-2, 0, -1] + s.Pop() + // [-2, 0] + ast.Equal(-2, s.GetMin(), "get top from [0, -1]") + // [-2, 0] + s.Pop() + // [-2] +} diff --git a/Algorithms/0160.intersection-of-two-linked-lists/1.png b/Algorithms/0160.intersection-of-two-linked-lists/1.png new file mode 100644 index 000000000..2021a524a Binary files /dev/null and b/Algorithms/0160.intersection-of-two-linked-lists/1.png differ diff --git a/Algorithms/0160.intersection-of-two-linked-lists/2.png b/Algorithms/0160.intersection-of-two-linked-lists/2.png new file mode 100644 index 000000000..4432fec7c Binary files /dev/null and b/Algorithms/0160.intersection-of-two-linked-lists/2.png differ diff --git a/Algorithms/0160.intersection-of-two-linked-lists/3.png b/Algorithms/0160.intersection-of-two-linked-lists/3.png new file mode 100644 index 000000000..eea063119 Binary files /dev/null and b/Algorithms/0160.intersection-of-two-linked-lists/3.png differ diff --git a/Algorithms/0160.intersection-of-two-linked-lists/README.md b/Algorithms/0160.intersection-of-two-linked-lists/README.md new file mode 100755 index 000000000..099a699a4 --- /dev/null +++ b/Algorithms/0160.intersection-of-two-linked-lists/README.md @@ -0,0 +1,47 @@ +# [160. Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/) + +Write a program to find the node at which the intersection of two singly linked lists begins. + +For example, the following two linked lists: + +![p](p.png) + +begin to intersect at node c1. + +Example 1: + +![1](1.png) + +```text +Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3 +Output: Reference of the node with value = 8 +Input Explanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect). From the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,0,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B. +``` + +Example 2: + +![2](2.png) + +```text +Input: intersectVal = 2, listA = [0,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1 +Output: Reference of the node with value = 2 +Input Explanation: The intersected node's value is 2 (note that this must not be 0 if the two lists intersect). From the head of A, it reads as [0,9,1,2,4]. From the head of B, it reads as [3,2,4]. There are 3 nodes before the intersected node in A; There are 1 node before the intersected node in B. +``` + +Example 3: + +![3](3.png) + +```text +Input: intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2 +Output: null +Input Explanation: From the head of A, it reads as [2,6,4]. From the head of B, it reads as [1,5]. Since the two lists do not intersect, intersectVal must be 0, while skipA and skipB can be arbitrary values. +Explanation: The two lists do not intersect, so return null. +``` + +Notes: + +- If the two linked lists have no intersection at all, return null. +- The linked lists must retain their original structure after the function returns. +- You may assume there are no cycles anywhere in the entire linked structure. +- Your code should preferably run in O(n) time and use only O(1) memory. \ No newline at end of file diff --git a/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists.go b/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists.go new file mode 100755 index 000000000..8087f85d7 --- /dev/null +++ b/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists.go @@ -0,0 +1,26 @@ +package problem0160 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is pre-defined... +type ListNode = kit.ListNode + +func getIntersectionNode(headA, headB *ListNode) *ListNode { + a, b := headA, headB + hasLinkedToB, hasLinkedToA := false, false + for a != nil && b != nil { + if a == b { + return b + } + a, b = a.Next, b.Next + if a == nil && !hasLinkedToB { + a = headB + hasLinkedToB = true + } + if b == nil && !hasLinkedToA { + b = headA + hasLinkedToA = true + } + } + return nil +} diff --git a/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists_test.go b/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists_test.go new file mode 100755 index 000000000..f3f7867ae --- /dev/null +++ b/Algorithms/0160.intersection-of-two-linked-lists/intersection-of-two-linked-lists_test.go @@ -0,0 +1,83 @@ +package problem0160 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a, b []int + ea, eb int +}{ + + { + []int{4, 1, 8, 4, 5}, + []int{5, 0, 1, 8, 4, 5}, + 2, + 3, + }, + + { + []int{0, 9, 1, 2, 4}, + []int{3, 2, 4}, + 3, + 1, + }, + + { + []int{2, 6, 4}, + []int{1, 5}, + 3, + 2, + }, + + // 可以有多个 testcase +} + +// head must Not be nil +func tailOf(head *ListNode) *ListNode { + for head.Next != nil { + head = head.Next + } + return head +} + +func Test_getIntersectionNode(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + tail := kit.Ints2List(tc.a[tc.ea:]) + + headA := kit.Ints2List(tc.a[:tc.ea]) + tailA := tailOf(headA) + tailA.Next = tail + + headB := kit.Ints2List(tc.b[:tc.eb]) + tailB := tailOf(headB) + tailB.Next = tail + + ast.Equal(tail, getIntersectionNode(headA, headB), "输入:%v", tc) + } +} + +func Benchmark_getIntersectionNode(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + tail := kit.Ints2List(tc.a[tc.ea:]) + + headA := kit.Ints2List(tc.a[:tc.ea]) + tailA := tailOf(headA) + tailA.Next = tail + + headB := kit.Ints2List(tc.b[:tc.eb]) + tailB := tailOf(headB) + tailB.Next = tail + + getIntersectionNode(headA, headB) + } + } +} diff --git a/Algorithms/0160.intersection-of-two-linked-lists/p.png b/Algorithms/0160.intersection-of-two-linked-lists/p.png new file mode 100644 index 000000000..55870e302 Binary files /dev/null and b/Algorithms/0160.intersection-of-two-linked-lists/p.png differ diff --git a/Algorithms/0162.find-peak-element/find-peak-element.go b/Algorithms/0162.find-peak-element/find-peak-element.go index bdcd3c047..7668d59d4 100755 --- a/Algorithms/0162.find-peak-element/find-peak-element.go +++ b/Algorithms/0162.find-peak-element/find-peak-element.go @@ -1,4 +1,4 @@ -package Problem0162 +package problem0162 func findPeakElement(nums []int) int { low := -1 diff --git a/Algorithms/0162.find-peak-element/find-peak-element_test.go b/Algorithms/0162.find-peak-element/find-peak-element_test.go index cb24b1a42..66fb9161e 100755 --- a/Algorithms/0162.find-peak-element/find-peak-element_test.go +++ b/Algorithms/0162.find-peak-element/find-peak-element_test.go @@ -1,4 +1,4 @@ -package Problem0162 +package problem0162 import ( "fmt" diff --git a/Algorithms/0164.maximum-gap/README.md b/Algorithms/0164.maximum-gap/README.md new file mode 100755 index 000000000..a6ce4ef2d --- /dev/null +++ b/Algorithms/0164.maximum-gap/README.md @@ -0,0 +1,14 @@ +# [164. Maximum Gap](https://leetcode.com/problems/maximum-gap/) + +## 题目 +Given an unsorted array, find the maximum difference between the successive elements in its sorted form. + +Try to solve it in linear time/space. + +Return 0 if the array contains less than 2 elements. + +You may assume all elements in the array are non-negative integers and fit in the 32-bit signed integer range. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0164.maximum-gap/maximum-gap.go b/Algorithms/0164.maximum-gap/maximum-gap.go new file mode 100755 index 000000000..babbe39ec --- /dev/null +++ b/Algorithms/0164.maximum-gap/maximum-gap.go @@ -0,0 +1,43 @@ +package problem0164 + +func maximumGap(nums []int) int { + if len(nums) < 2 { + return 0 + } + + // 自己实现了一个简易的快排 + var quickSort func(i, j int) + quickSort = func(i, j int) { + ci, cj := i, j + c := i + for i < j { + for nums[j] >= nums[c] && i < j { + j-- + } + for nums[i] <= nums[c] && i < j { + i++ + } + nums[i], nums[j] = nums[j], nums[i] + } + nums[i], nums[c] = nums[c], nums[i] + c = i + if ci < c { + quickSort(ci, c) + } + if c+1 < cj { + quickSort(c+1, cj) + } + } + + quickSort(0, len(nums)-1) + + ret := 0 + for i := 1; i < len(nums); i++ { + tmp := nums[i] - nums[i-1] + if ret < tmp { + ret = tmp + } + } + + return ret +} diff --git a/Algorithms/0164.maximum-gap/maximum-gap_test.go b/Algorithms/0164.maximum-gap/maximum-gap_test.go new file mode 100755 index 000000000..9f8793852 --- /dev/null +++ b/Algorithms/0164.maximum-gap/maximum-gap_test.go @@ -0,0 +1,49 @@ +package problem0164 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1}, + 0, + }, + + { + []int{1, 10000000}, + 9999999, + }, + + { + []int{9, 8, 7, 6, 5, 4, 3, 3, 1}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_maximumGap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maximumGap(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_maximumGap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maximumGap(tc.nums) + } + } +} diff --git a/Algorithms/0165.compare-version-numbers/README.md b/Algorithms/0165.compare-version-numbers/README.md new file mode 100755 index 000000000..145979ebb --- /dev/null +++ b/Algorithms/0165.compare-version-numbers/README.md @@ -0,0 +1,18 @@ +# [165. Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) + +## 题目 +Compare two version numbers version1 and version2. +If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. + +You may assume that the version strings are non-empty and contain only digits and the . character. +The . character does not represent a decimal point and is used to separate number sequences. +For instance, 2.5 is not "two and a half" or "half way to version three", it is the fifth second-level revision of the second first-level revision. + +Here is an example of version numbers ordering: +``` +0.1 < 1.1 < 1.2 < 13.37 +``` + +## 解题思路 + +见程序注释 \ No newline at end of file diff --git a/Algorithms/0165.compare-version-numbers/compare-version-numbers.go b/Algorithms/0165.compare-version-numbers/compare-version-numbers.go new file mode 100755 index 000000000..3648314cf --- /dev/null +++ b/Algorithms/0165.compare-version-numbers/compare-version-numbers.go @@ -0,0 +1,47 @@ +package problem0165 + +import ( + "strconv" + "strings" +) + +func compareVersion(version1 string, version2 string) int { + v1s := conv(version1) + v2s := conv(version2) + + if len(v1s) != len(v2s) { + v1s, v2s = toSameLen(v1s, v2s) + } + + for i := 0; i < len(v1s); i++ { + if v1s[i] < v2s[i] { + return -1 + } else if v1s[i] > v2s[i] { + return 1 + } + } + + return 0 +} + +func conv(version string) []int { + vs := strings.Split(version, ".") + res := make([]int, len(vs)) + + for i, v := range vs { + res[i], _ = strconv.Atoi(v) + } + + return res +} + +func toSameLen(a1, a2 []int) ([]int, []int) { + if len(a1) > len(a2) { + res := make([]int, len(a1)) + copy(res, a2) + return a1, res + } + + r2, r1 := toSameLen(a2, a1) + return r1, r2 +} diff --git a/Algorithms/0165.compare-version-numbers/compare-version-numbers_test.go b/Algorithms/0165.compare-version-numbers/compare-version-numbers_test.go new file mode 100755 index 000000000..145421a5f --- /dev/null +++ b/Algorithms/0165.compare-version-numbers/compare-version-numbers_test.go @@ -0,0 +1,84 @@ +package problem0165 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + version1 string + version2 string + ans int +}{ + + + { + "1", + "1.0.1", + -1, + }, + + { + "1.0.1", + "1", + 1, + }, + + { + "1", + "0", + 1, + }, + + { + "0.1", + "0.2", + -1, + }, + + { + "0.1", + "1.0", + -1, + }, + + { + "1.2", + "1.1", + 1, + }, + + { + "1.0", + "0.1", + 1, + }, + + { + "1.1", + "1.1", + 0, + }, + + // 可以有多个 testcase +} + +func Test_compareVersion(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, compareVersion(tc.version1, tc.version2), "输入:%v", tc) + } +} + +func Benchmark_compareVersion(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + compareVersion(tc.version1, tc.version2) + } + } +} diff --git a/Algorithms/0166.fraction-to-recurring-decimal/README.md b/Algorithms/0166.fraction-to-recurring-decimal/README.md new file mode 100755 index 000000000..96fe49a17 --- /dev/null +++ b/Algorithms/0166.fraction-to-recurring-decimal/README.md @@ -0,0 +1,20 @@ +# [166. Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/) + +## 题目 +Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. + +If the fractional part is repeating, enclose the repeating part in parentheses. + +For example, + +Given numerator = 1, denominator = 2, return "0.5". +Given numerator = 2, denominator = 1, return "2". +Given numerator = 2, denominator = 3, return "0.(6)". + + + +Credits:Special thanks to @Shangrila for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal.go b/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal.go new file mode 100755 index 000000000..8739a306b --- /dev/null +++ b/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal.go @@ -0,0 +1,62 @@ +package problem0166 + +import ( + "fmt" + "strconv" +) + +func fractionToDecimal(n int, d int) string { + if n == 0 { + return "0" + } + + if n*d < 0 { + // n, d 异号,则结果前面有负号 + return "-" + fractionToDecimal(abs(n), abs(d)) + } + + // 确保 n 和 d 是非负数 + n, d = abs(n), abs(d) + + if n >= d { + // n / d 的小数部分 + ds := fractionToDecimal(n%d, d) + return strconv.Itoa(n/d) + ds[1:] + } + + // digits 用来保存 n/d 的结果 + digits := make([]byte, 2, 1024) + digits[0] = '0' + digits[1] = '.' + // idx 是 n/d 的结果的在 digits 的索引号 + idx := 2 + // rec[n] = idx + rec := make(map[int]int, 1024) + for { + if i, ok := rec[n]; ok { + // n 重复出现,则说明 n/d 是下一个循环的开始 + // 循环部分的起点,就是 n 上次出现的 idx 值 + return fmt.Sprintf("%s(%s)", string(digits[:i]), string(digits[i:])) + } + + rec[n] = idx + + n *= 10 + idx++ + + digits = append(digits, byte(n/d)+'0') + n %= d + + if n == 0 { + // 不会有循环部分 + return string(digits) + } + } +} + +func abs(a int) int { + if a >= 0 { + return a + } + return -a +} diff --git a/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal_test.go b/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal_test.go new file mode 100755 index 000000000..e8e64a4c4 --- /dev/null +++ b/Algorithms/0166.fraction-to-recurring-decimal/fraction-to-recurring-decimal_test.go @@ -0,0 +1,89 @@ +package problem0166 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + numerator int + denominator int + ans string +}{ + + { + -7, + -12, + "0.58(3)", + }, + + { + 7, + -12, + "-0.58(3)", + }, + + { + 1, + 90, + "0.0(1)", + }, + + { + 5425221, + -45664, + "-118.80739(75122634898388227049754730203223545900490539593552908199018920812894183601962158374211632796075683251576734407848633496846531184302733006306937631394533987386124737210932025227750525578135949544498948843728100911002102312543798177995795374912403644008409250175192711983181499649614576033637000700770847932725998598458304134548002803083391730903994393833216538192011212333566923615977575332866152768044849334267694463910301331464611072179397337070777855641205325858444288717589348283111422564821303433777154870357393132445690259285213735108619481429572529782761037140854940434477925718290119131044148563419761737911702873160476524176594253679046951646811492641906096706377014716187806587245970567624386825508058864)", + }, + + { + 5425221, + 45664, + "118.80739(75122634898388227049754730203223545900490539593552908199018920812894183601962158374211632796075683251576734407848633496846531184302733006306937631394533987386124737210932025227750525578135949544498948843728100911002102312543798177995795374912403644008409250175192711983181499649614576033637000700770847932725998598458304134548002803083391730903994393833216538192011212333566923615977575332866152768044849334267694463910301331464611072179397337070777855641205325858444288717589348283111422564821303433777154870357393132445690259285213735108619481429572529782761037140854940434477925718290119131044148563419761737911702873160476524176594253679046951646811492641906096706377014716187806587245970567624386825508058864)", + }, + + { + 1, + 2, + "0.5", + }, + + { + 2, + 1, + "2", + }, + + { + 2, + 3, + "0.(6)", + }, + + { + 4, + 7, + "0.(571428)", + }, + + // 可以有多个 testcase +} + +func Test_fractionToDecimal(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fractionToDecimal(tc.numerator, tc.denominator), "输入:%v", tc) + } +} + +func Benchmark_fractionToDecimal(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fractionToDecimal(tc.numerator, tc.denominator) + } + } +} diff --git a/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.go b/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.go index 47334d59a..5efc19ba8 100755 --- a/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.go +++ b/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.go @@ -1,4 +1,4 @@ -package Problem0167 +package problem0167 func twoSum(nums []int, target int) []int { m := make(map[int]int, len(nums)) diff --git a/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted_test.go b/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted_test.go index 16beda9b8..aa9ec933f 100755 --- a/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted_test.go +++ b/Algorithms/0167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted_test.go @@ -1,4 +1,4 @@ -package Problem0167 +package problem0167 import ( "fmt" diff --git a/Algorithms/0168.excel-sheet-column-title/README.md b/Algorithms/0168.excel-sheet-column-title/README.md new file mode 100755 index 000000000..0474282df --- /dev/null +++ b/Algorithms/0168.excel-sheet-column-title/README.md @@ -0,0 +1,19 @@ +# [168. Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title/) + +## 题目 +Given a positive integer, return its corresponding column title as appear in an Excel sheet. + +For example: +``` + 1 -> A + 2 -> B + 3 -> C + ... + 26 -> Z + 27 -> AA + 28 -> AB +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title.go b/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title.go new file mode 100755 index 000000000..84c253739 --- /dev/null +++ b/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title.go @@ -0,0 +1,13 @@ +package problem0168 + +func convertToTitle(n int) string { + res := "" + + for n > 0 { + n-- + res = string(byte(n%26)+'A') + res + n /= 26 + } + + return res +} diff --git a/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title_test.go b/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title_test.go new file mode 100755 index 000000000..e9474a45f --- /dev/null +++ b/Algorithms/0168.excel-sheet-column-title/excel-sheet-column-title_test.go @@ -0,0 +1,69 @@ +package problem0168 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans string +}{ + + { + 100, + "CV", + }, + + { + 1000, + "ALL", + }, + + { + 53, + "BA", + }, + + { + 52, + "AZ", + }, + + { + 26, + "Z", + }, + + { + 1, + "A", + }, + + { + 28, + "AB", + }, + + // 可以有多个 testcase +} + +func Test_convertToTitle(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, convertToTitle(tc.n), "输入:%v", tc) + } +} + +func Benchmark_convertToTitle(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + convertToTitle(tc.n) + } + } +} diff --git a/Algorithms/0169.majority-element/majority-element.go b/Algorithms/0169.majority-element/majority-element.go index bd6340588..b0fa3d4f0 100755 --- a/Algorithms/0169.majority-element/majority-element.go +++ b/Algorithms/0169.majority-element/majority-element.go @@ -1,4 +1,4 @@ -package Problem0169 +package problem0169 func majorityElement(nums []int) int { // 根据题意 len[nums] > 0 且 出现次数大于 n/2 的元素存在。 diff --git a/Algorithms/0169.majority-element/majority-element_test.go b/Algorithms/0169.majority-element/majority-element_test.go index 98b35ad09..6a9d6fd7e 100755 --- a/Algorithms/0169.majority-element/majority-element_test.go +++ b/Algorithms/0169.majority-element/majority-element_test.go @@ -1,4 +1,4 @@ -package Problem0169 +package problem0169 import ( "fmt" diff --git a/Algorithms/0171.excel-sheet-column-number/README.md b/Algorithms/0171.excel-sheet-column-number/README.md new file mode 100755 index 000000000..8c8d84848 --- /dev/null +++ b/Algorithms/0171.excel-sheet-column-number/README.md @@ -0,0 +1,20 @@ +# [171. Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/) + +## 题目 +Related to question Excel Sheet Column Title +Given a column title as appear in an Excel sheet, return its corresponding column number. + +For example: +``` + A -> 1 + B -> 2 + C -> 3 + ... + Z -> 26 + AA -> 27 + AB -> 28 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number.go b/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number.go new file mode 100755 index 000000000..14a13bf1a --- /dev/null +++ b/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number.go @@ -0,0 +1,12 @@ +package problem0171 + +func titleToNumber(s string) int { + res := 0 + + for i := 0; i < len(s); i++ { + temp := int(s[i] - 'A' + 1) + res = res*26 + temp + } + + return res +} diff --git a/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number_test.go b/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number_test.go new file mode 100755 index 000000000..45c860950 --- /dev/null +++ b/Algorithms/0171.excel-sheet-column-number/excel-sheet-column-number_test.go @@ -0,0 +1,39 @@ +package problem0171 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "AA", + 27, + }, + + // 可以有多个 testcase +} + +func Test_titleToNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, titleToNumber(tc.s), "输入:%v", tc) + } +} + +func Benchmark_titleToNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + titleToNumber(tc.s) + } + } +} diff --git a/Algorithms/0172.factorial-trailing-zeroes/README.md b/Algorithms/0172.factorial-trailing-zeroes/README.md new file mode 100755 index 000000000..1a03a9a83 --- /dev/null +++ b/Algorithms/0172.factorial-trailing-zeroes/README.md @@ -0,0 +1,12 @@ +# [172. Factorial Trailing Zeroes](https://leetcode.com/problems/factorial-trailing-zeroes/) + +## 题目 +Given an integer n, return the number of trailing zeroes in n!. + +Note: Your solution should be in logarithmic time complexity. + +Credits:Special thanks to @ts for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes.go b/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes.go new file mode 100755 index 000000000..0789ff624 --- /dev/null +++ b/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes.go @@ -0,0 +1,12 @@ +package problem0172 + +func trailingZeroes(n int) int { + res := 0 + + for n >= 5 { + n /= 5 + res += n + } + + return res +} diff --git a/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes_test.go b/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes_test.go new file mode 100755 index 000000000..2d25fbda1 --- /dev/null +++ b/Algorithms/0172.factorial-trailing-zeroes/factorial-trailing-zeroes_test.go @@ -0,0 +1,69 @@ +package problem0172 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 100000, + 24999, + }, + + { + 10000, + 2499, + }, + + { + 1000, + 249, + }, + + { + 100, + 24, + }, + + { + 25, + 6, + }, + + { + 10, + 2, + }, + + { + 3, + 0, + }, + + // 可以有多个 testcase +} + +func Test_trailingZeroes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, trailingZeroes(tc.n), "输入:%v", tc) + } +} + +func Benchmark_trailingZeroes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + trailingZeroes(tc.n) + } + } +} diff --git a/Algorithms/0173.binary-search-tree-iterator/README.md b/Algorithms/0173.binary-search-tree-iterator/README.md new file mode 100755 index 000000000..ebc854617 --- /dev/null +++ b/Algorithms/0173.binary-search-tree-iterator/README.md @@ -0,0 +1,27 @@ +# [173. Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/) + +Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. + +Calling next() will return the next smallest number in the BST. + +![bst](bst.png) + +Example: + +```text +BSTIterator iterator = new BSTIterator(root); +iterator.next(); // return 3 +iterator.next(); // return 7 +iterator.hasNext(); // return true +iterator.next(); // return 9 +iterator.hasNext(); // return true +iterator.next(); // return 15 +iterator.hasNext(); // return true +iterator.next(); // return 20 +iterator.hasNext(); // return false +``` + +Note: + +- next() and hasNext() should run in average O(1) time and uses O(h) memory, where h is the height of the tree. +- You may assume that next() call will always be valid, that is, there will be at least a next smallest number in the BST when next() is called. \ No newline at end of file diff --git a/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator.go b/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator.go new file mode 100755 index 000000000..2259a0aa1 --- /dev/null +++ b/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator.go @@ -0,0 +1,51 @@ +package problem0173 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +/* Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +type TreeNode = kit.TreeNode + +// BSTIterator is the iterator of BST +type BSTIterator struct { + stack []*TreeNode +} + +// Constructor returns a BST iterator +func Constructor(root *TreeNode) BSTIterator { + stack := make([]*TreeNode, 0, 128) + res := BSTIterator{ + stack: stack, + } + res.push(root) + return res +} + +// Next returns the next smallest number +func (it *BSTIterator) Next() int { + size := len(it.stack) + var top *TreeNode + it.stack, top = it.stack[:size-1], it.stack[size-1] + it.push(top.Right) + return top.Val +} + +// HasNext returns whether we have a next smallest number +func (it *BSTIterator) HasNext() bool { + return len(it.stack) > 0 +} + +func (it *BSTIterator) push(root *TreeNode) { + for root != nil { + it.stack = append(it.stack, root) + root = root.Left + } +} diff --git a/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator_test.go b/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator_test.go new file mode 100755 index 000000000..86922032b --- /dev/null +++ b/Algorithms/0173.binary-search-tree-iterator/binary-search-tree-iterator_test.go @@ -0,0 +1,26 @@ +package problem0173 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +func Test_BSTIterator(t *testing.T) { + ast := assert.New(t) + + ints := []int{7, 3, 15, kit.NULL, kit.NULL, 9, 20} + + root := kit.Ints2TreeNode(ints) + + it := Constructor(root) + nums := kit.Tree2Inorder(root) + + i := 0 + + for it.HasNext() { + ast.Equal(nums[i], it.Next(), "%d", nums[i]) + i++ + } +} diff --git a/Algorithms/0173.binary-search-tree-iterator/bst.png b/Algorithms/0173.binary-search-tree-iterator/bst.png new file mode 100644 index 000000000..f160de8e3 Binary files /dev/null and b/Algorithms/0173.binary-search-tree-iterator/bst.png differ diff --git a/Algorithms/0174.dungeon-game/174.100.png b/Algorithms/0174.dungeon-game/174.100.png new file mode 100644 index 000000000..857610c99 Binary files /dev/null and b/Algorithms/0174.dungeon-game/174.100.png differ diff --git a/Algorithms/0174.dungeon-game/README.md b/Algorithms/0174.dungeon-game/README.md new file mode 100755 index 000000000..08be20c7d --- /dev/null +++ b/Algorithms/0174.dungeon-game/README.md @@ -0,0 +1,35 @@ +# [174. Dungeon Game](https://leetcode.com/problems/dungeon-game/) + +## 题目 + +The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially positioned in the top-left room and must fight his way through the dungeon to rescue the princess. + +The knight has an initial health point represented by a positive integer. If at any point his health point drops to 0 or below, he dies immediately. + +Some of the rooms are guarded by demons, so the knight loses health (negative integers) upon entering these rooms; + +other rooms are either empty (0's) or contain magic orbs that increase the knight's health (positive integers). + +In order to reach the princess as quickly as possible, the knight decides to move only rightward or downward in each step. + +Write a function to determine the knight's minimum initial health so that he is able to rescue the princess. + +For example, given the dungeon below, the initial health of the knight must be at least 7 if he follows the optimal path `RIGHT-> RIGHT -> DOWN -> DOWN`. + +![dungeon](dungeon.png) + +Notes: +- The knight's health has no upper bound. +- Any room can contain threats or power-ups, even the first room the knight enters and the bottom-right room where the princess is imprisoned. + +## 解题思路 +在走完最后一个房间的时候血量至少要剩下1,因此最后的状态可以当成是初始状态,由后往前依次决定在每一个位置至少要有多少血量, 这样一个位置的状态是由其下面一个和和左边一个的较小状态决定 .因此一个基本的状态方程是: +``` +dp[i][j] + dungeon[i][j] = min(dp[i+1][j], dp[i][j+1]) +``` +但是还有一个条件就是在每一个状态必须血量都要大于1,因此我们还需要一个方程在保证在每一个状态都大于1,即:dp[i][j] = max(dp[i][j], 1); 也就是说虽然当前的血量到最后能够剩下1,但是现在已经低于1了,我们需要为其提升血量维持每一个状态至少都为1. + +见程序注释 + +再次感谢 LeetCode 服务器 +![100](174.100.png) \ No newline at end of file diff --git a/Algorithms/0174.dungeon-game/dungeon-game.go b/Algorithms/0174.dungeon-game/dungeon-game.go new file mode 100755 index 000000000..3ecd8df21 --- /dev/null +++ b/Algorithms/0174.dungeon-game/dungeon-game.go @@ -0,0 +1,63 @@ +package problem0174 + +func calculateMinimumHP(dungeon [][]int) int { + m := len(dungeon) + if m == 0 { + return 1 + } + + n := len(dungeon[0]) + if n == 0 { + return 1 + } + + intMax := 1<<63 - 1 + // dp[i][j] 到达 (i,j) 点**前**的健康值 + dp := make([][]int, m+1) + for i := range dp { + dp[i] = make([]int, n+1) + for j := range dp[i] { + // (i,j) 点的健康值达到上限,可以保证到达 (m-1, n-1) 点 + dp[i][j] = intMax + } + } + + // health 是到达 (i,j) 点**前**的健康值 + health := 0 + // 把 dp[m][n-1] = 1 更换成 dp[m-1][n] = 1,程序一样可以通过 + // 可以这样认为 + // 还存在一个 dungeon[m][n-1] == 0 的房间 + // 骑士救出公主后,向下移动一格,达到这个 (m, n-1) 房间 + // 骑士在这个房间的健康值 只需要为 1 就可以了。 + dp[m][n-1] = 1 + for i := m - 1; i >= 0; i-- { + for j := n - 1; j >= 0; j-- { + // health + dungeon[i][j] == min(dp[i+1][j], dp[i][j+1]) 的意思是 + // 骑士达到 (i,j) 点**前**的健康值, + // 要能够保证他至少移动到 右边 或者 左边 房间中的一个 + health = min(dp[i+1][j], dp[i][j+1]) - dungeon[i][j] + // 由于 dungeon[i][j] 也可能是正数 + // 可能会导致 health < 1 。此时,骑士无法到达 (i,j) 房间,这不符合题意 + // 因此,当 health < 1 时, + // dp[i][j] = 1 + dp[i][j] = max(health, 1) + } + } + + // dp[0][0] 是骑士进入 (0,0) 房间前的健康值 + return dp[0][0] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0174.dungeon-game/dungeon-game_test.go b/Algorithms/0174.dungeon-game/dungeon-game_test.go new file mode 100755 index 000000000..b858889ad --- /dev/null +++ b/Algorithms/0174.dungeon-game/dungeon-game_test.go @@ -0,0 +1,154 @@ +package problem0174 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + dungeon [][]int + ans int +}{ + + { + [][]int{ + []int{1, -3, 3}, + []int{0, -2, 0}, + []int{-3, -3, -3}, + }, + 3, + }, + + { + [][]int{ + []int{1, -2, 3}, + []int{2, -2, -2}, + }, + 2, + }, + + { + [][]int{ + []int{3, -20, 30}, + []int{-3, 4, 0}, + }, + 1, + }, + + { + [][]int{ + []int{2, -8, -79, -88, -12, -87, -5, -56, -55, -42, 18, -91, 1, -30, -36, 42, -96, -26, -17, -69, 38, 18, 44, -58, -33, 20, -45, -11, 11, 15, -40, -92, -62, -51, -23, 20, -86, -2, -90, -64, -100, -42, -16, -55, 29, -62, -81, -60, 7, -5, 31, -7, 40, 19, -53, -81, -77, 42, -87, 37, -43, 37, -50, -21, -86, -28, 13, -18, -65, -76}, + []int{-67, -23, -62, 45, -94, -1, -95, -66, -41, 37, 33, -96, -95, -17, 12, 30, -4, 40, -40, -89, -89, -25, -62, 10, -19, -53, -36, 38, -21, 1, -41, -81, -62, 3, -96, -17, -75, -81, 37, 32, -9, -80, -41, -13, -58, 1, 40, -13, -85, -78, -67, -36, -7, 48, -16, 2, -69, -85, 9, 15, -91, -32, -16, -84, -9, -31, -62, 35, -11, 28}, + []int{39, -28, 1, -31, -4, -39, -64, -86, -68, -72, -68, 21, -33, -73, 37, -39, 2, -59, -71, -17, -60, 4, -16, -92, -15, 10, -99, -37, 21, -70, 31, -10, -9, -45, 6, 26, 8, 30, 13, -72, 5, 37, -94, 35, 9, 36, -96, 47, -61, 15, -22, -60, -96, -94, -60, 43, -48, -79, 19, 24, -40, 33, -18, -33, 50, 42, -42, -6, -59, -17}, + []int{-95, -40, -96, 42, -49, -3, 6, -47, -38, 31, -25, -61, -18, -52, -80, -55, 29, 27, 22, 6, 29, -89, -9, 14, -77, -26, -2, -7, -2, -64, -100, 40, -52, -15, -76, 13, -27, -83, -70, 13, -62, -54, -92, -71, -65, -18, 26, 37, 0, -58, 4, 43, -5, -33, -47, -21, -65, -58, 21, 2, -67, -62, -32, 30, -4, -46, 18, 21, 2, -5}, + []int{-5, 34, 41, 11, 45, -46, -86, 31, -57, 42, -92, 43, -37, -9, 42, -29, -3, 41, -71, 13, -8, 37, -36, 23, 17, -74, -12, -55, -18, -17, -13, -76, -18, -90, -5, 14, 7, -82, -19, -16, 44, -96, -88, 37, -98, 8, 17, 9, -2, -29, 11, -39, -49, -95, 20, -33, -37, -42, 42, 26, -28, -21, -44, -9, 17, -26, -27, 24, -60, -19}, + []int{-95, -73, -88, -4, 32, 7, 20, 19, -17, 36, -81, -91, -6, -74, 20, 47, -24, 15, 40, -5, -28, -5, 23, -30, 6, -97, 49, -12, -57, 21, 1, 11, -64, -32, -95, -33, 10, 50, 47, 41, -11, -51, 22, -84, 39, 10, -36, -72, -27, -60, -19, -51, -11, 37, 2, -62, 22, -66, -61, 29, -50, -94, 48, -23, 18, -37, -92, -92, -4, -97}, + []int{46, 4, -96, -31, 14, -25, -74, -73, -40, -46, 38, -31, 23, -34, 12, 25, 34, 42, -43, -91, 3, 34, -17, -64, 21, -98, 11, -70, -36, -66, 2, -19, 30, -88, 43, -62, 33, -75, -11, 45, -95, -65, -25, 27, -35, -57, -81, 2, 10, 33, -46, -40, -4, -15, -94, 48, -95, 24, -87, -12, 12, -70, 35, 42, -69, 19, -74, -14, -81, 2}, + []int{32, 17, -79, -89, 25, 19, -98, -60, -81, -47, -8, -61, -41, -33, -33, -81, 15, -75, 8, -99, -29, -75, -23, -54, 27, 41, -23, -70, 19, -60, -91, -60, 34, 42, -35, 25, -61, -46, 41, 44, -27, -57, -24, -87, 4, -55, -40, -74, -20, 44, 37, 14, -48, -89, -26, -15, -40, -38, 14, 22, 24, 47, -62, -65, -73, -86, 50, -62, 24, -53}, + []int{-24, 10, 32, 7, -21, 44, -23, 5, -98, 40, -21, -4, -63, 38, -89, 26, -62, -98, -87, -67, 7, -50, -84, 6, -12, -10, -25, 7, -96, 0, -78, -36, 6, 22, -83, 39, -94, -15, -63, -70, -4, -91, -96, -73, -11, 33, 11, -24, -11, -64, 7, 49, 7, -55, -91, -88, -100, 45, -48, 31, 28, -97, -88, -96, -14, -22, -41, -97, 6, 31}, + []int{-12, -9, -71, -55, -40, -66, -21, 48, 30, 38, -64, -13, -22, 9, -61, -41, 12, -26, -92, -55, -33, -67, -59, -31, -77, 19, 13, -28, 8, -13, -13, -19, -31, -87, 2, -93, -95, 14, 6, 34, -38, -88, 48, 38, -52, -92, -62, -76, -55, 45, 50, 24, -76, -54, -70, -35, 35, -90, -99, 16, 12, 39, 21, -88, -68, 6, 6, -2, -72, 26}, + []int{-58, 5, -60, 16, -84, -67, -28, -11, -63, -49, -4, -41, -99, 3, -1, 47, 12, -69, -69, -20, -78, -21, 20, -67, 6, 14, -86, -35, 7, 7, 7, 3, 10, -18, 33, -14, 36, -75, -89, -90, -29, -3, -89, 18, 48, -61, 48, 25, -17, -28, -46, 44, 5, 48, -10, -21, -4, 49, -57, 37, -16, 28, 22, -95, 39, 7, -82, 13, -68, 23}, + []int{-77, -64, -34, -54, -25, -19, -63, -57, -33, -76, -89, -21, -70, -62, -97, 50, -14, -55, -27, -16, -17, 7, 29, 9, -95, -77, 45, -71, -12, 27, -68, -62, -66, -100, -60, -86, -15, 38, 19, -50, 43, -9, 47, -97, -96, -31, -51, 48, -24, 2, 13, -25, -8, -44, -34, -100, -14, -5, -4, -69, 25, -63, -70, -99, -9, -68, -88, -24, 5, -69}, + []int{25, -88, -91, -26, -73, -52, -81, -96, -53, 2, -35, -77, -1, 2, 16, 10, -14, 15, 42, -52, -42, -48, -68, 21, 3, -26, -75, 45, 12, -82, 25, -29, 15, 18, -37, 4, 41, -26, -98, -94, -74, -5, -15, 11, 11, -68, -94, -100, -100, 29, -83, -99, -75, -9, -62, -31, 23, -47, -68, -8, 8, -100, -1, -76, -17, -58, 36, -84, -32, -93}, + []int{-81, 37, 19, -5, 18, 15, -34, -29, -84, -35, -67, -64, -57, -99, 46, 26, -38, -37, -79, 0, -6, 32, 50, 37, -63, 27, -56, 11, -3, -66, -72, 34, 13, -4, 30, -82, 32, -71, -35, -30, 10, -48, -93, -94, -92, -4, -21, -34, -67, -80, -98, -28, 32, -86, -22, 6, 46, -75, -40, -100, -7, 11, -44, -12, -36, -24, 46, -1, 26, -20}, + []int{-81, -20, -54, -75, -78, 23, -76, -90, 46, -20, -5, 30, -59, -37, -82, -68, 36, 8, 50, -72, 48, -97, -93, -10, -31, -91, -81, -59, 27, -47, -65, -75, -19, 26, 12, 41, 16, -30, 33, 9, -28, -23, 45, -32, -68, 39, -24, -89, -47, -41, -71, -96, -45, -34, -43, -23, 39, -32, -99, -19, 46, 30, -89, -8, -65, -94, 42, 8, -14, -50}, + []int{-49, -64, 20, -6, -82, -30, -99, -79, -27, -2, -17, 30, -14, 47, -3, -47, 31, 2, -28, -7, -83, -56, -43, 11, -46, -85, -17, -30, -47, -84, -88, -36, 42, -71, -39, -28, 8, -78, -39, 49, 8, 11, 37, 6, -38, 33, -36, -36, -37, -44, -77, 41, 45, -47, -63, -58, -28, -31, -97, 23, -94, -72, 35, -39, -2, 27, -87, 3, 13, -66}, + []int{49, 27, -43, -84, 27, -93, 38, 25, 18, 43, 48, 49, -35, -51, 28, 27, 2, 29, 0, -47, -30, -25, -90, -92, -93, 0, -73, -73, 0, -62, -73, 12, -15, -40, -50, 11, -97, -74, 42, -55, -27, -7, 49, -32, -30, -6, -54, -88, -73, 43, -46, -29, -50, -50, -11, 5, 23, 6, 12, 20, -59, 47, -98, -77, 47, -5, -17, 23, -31, -14}, + []int{-28, 23, -90, -47, 41, 32, -38, 32, -56, -29, -20, -34, -79, 41, 6, -52, 41, -43, -24, -55, -81, 3, -42, 6, 26, 31, -64, 35, 7, -85, -38, 14, -29, 8, -88, 26, -100, 9, -11, -79, -59, 2, 38, 47, 23, 39, 46, -65, -62, -61, 1, 43, -58, -90, 33, 36, -30, 38, -11, -37, 19, 41, -2, -94, -8, 20, -38, -82, -73, 28}, []int{-54, -64, 24, -40, -33, 34, 36, 3, -56, -36, 23, -91, 50, 16, 27, -26, 25, 41, -15, -64, -30, -53, 50, -46, 11, -89, -98, 11, -81, -66, -76, -40, 12, 4, -21, -67, 48, -86, -43, 22, -70, 46, 48, -82, -94, -13, 0, 29, 29, 36, -19, -1, -55, 48, -63, 47, -30, -81, 1, -43, -83, 16, 12, 48, 47, -51, -4, 44, 16, -86}, + []int{-63, 31, 1, -65, -78, 42, -14, -99, -77, -62, 27, -51, 46, -58, 40, 15, -19, 45, 10, 0, -67, 42, -86, -100, -40, 30, -75, 0, -82, 10, -14, -43, 26, -26, -97, -31, -68, -76, 13, -85, 35, -60, -82, -67, -99, 12, -22, 8, 21, -93, -70, 48, 36, -57, -57, -91, 8, -32, -60, 28, -73, -59, -72, -69, -32, 33, 6, -8, -45, 35}, + []int{18, -51, -21, 48, -18, 22, -46, -52, -55, -30, 27, -88, -29, -64, 22, -34, -62, -23, -60, -76, -41, -64, -82, 15, 18, -10, -37, -97, 38, -50, 12, -28, -48, -57, -53, -48, -81, -75, -85, -12, 38, -87, -72, -82, -59, -3, 25, -46, 9, -95, -28, -79, -67, 14, -71, -18, 14, 0, -65, -37, 26, 30, 35, -33, -37, 1, 33, -70, -28, 47}, + []int{-78, -43, -64, -91, -78, 35, -8, 38, -79, -15, -11, 17, 11, -78, -32, -14, -15, -64, 18, -90, 32, -48, 38, 33, -19, 32, -23, -29, -68, -23, -53, -58, -20, 1, -22, -51, -29, 1, -60, -91, 8, -15, -12, -71, -16, -23, 3, -84, -89, 15, 14, 18, -99, -27, -70, -18, 29, -14, 15, 0, -49, 0, 17, -97, -23, -30, -49, -46, -52, 41}, + []int{-34, -39, 42, 34, -54, 43, 32, 49, 46, -23, 24, 24, -1, -21, -12, -15, -3, -72, -61, -75, -53, -49, -47, -64, 40, -56, -63, -95, -52, 3, -26, -12, -58, 49, 5, 21, -47, 32, -92, -46, -10, 28, -90, -83, 46, 9, -49, -19, 32, -41, 34, 29, 0, -98, -40, 26, -30, -10, -51, 20, -54, 33, 16, -24, -52, 44, 49, 15, -58, -56}, + []int{31, -24, -28, -5, 40, 32, -74, -1, 28, -81, 8, -96, 8, -22, -27, 32, 22, -24, 16, 40, -68, -50, -49, -84, 25, -55, -7, -100, -77, 25, -40, -6, -68, -90, -88, -74, -77, -24, -17, 6, -72, 46, 23, -52, 40, -71, -41, 21, 28, -29, 31, -71, 16, -83, 42, 25, -3, -84, 33, -66, -33, -24, -65, -39, -5, 21, -36, -87, 3, 38}, + []int{-98, -64, 38, 45, -90, 44, -63, 20, -44, 32, -4, 0, -22, -39, -8, 19, -20, -58, 5, 1, 32, -92, -36, 25, -82, 45, -55, 23, -50, -89, -81, -33, 16, -18, -7, 21, 40, -62, -16, -84, -19, -37, -66, 48, -30, 30, -8, 1, -70, -6, -65, 15, -11, -66, -71, -26, -15, 48, -80, -6, -41, 29, -80, -82, -6, -73, -56, -38, 44, 23}, + []int{14, -29, 19, -13, -93, -33, -29, -16, 21, -51, 8, 6, -63, 24, -23, 14, 47, -84, -27, -11, -56, -65, 0, -11, -28, -55, 11, -67, 18, -6, -87, -34, -44, -24, -77, -34, -22, -8, 36, -11, -89, -75, -43, -92, -94, -73, 41, -27, -63, 30, -37, -82, 22, -60, -92, -58, 11, -27, -98, -68, 45, -3, 50, -83, -45, 6, 12, -48, -16, 27}, + []int{47, -61, 2, 7, -84, 26, -67, -32, 33, -100, -66, -64, -25, 25, -4, -51, -69, -92, 39, 6, -82, -36, -14, -59, -40, -48, -30, -42, 5, -72, 33, -85, -65, 9, 45, -11, -28, 32, -19, -71, -51, -73, -34, -21, -35, -52, -27, -76, 40, 44, 12, -18, -14, 28, -31, 19, -20, -84, -28, -32, -75, -84, 21, 44, 3, -70, -59, -6, -27, -39}, + []int{-65, -41, -22, 29, -31, -62, -26, -40, -100, -40, 48, -34, 44, -20, 20, -29, -65, 2, -81, 0, -29, -64, -59, 38, 30, -58, 31, -87, 7, 37, -95, 28, 48, 40, -81, 25, -81, -96, 4, 15, 15, -96, 14, 24, 20, -35, -37, -98, 5, -82, 34, -39, -43, -63, 35, 1, -10, -83, 34, -21, -78, -65, -44, 48, -32, -5, -1, -18, -97, 28}, + []int{11, 34, 47, 21, -69, 17, -38, -4, -25, -89, -64, 50, 7, 4, 44, 44, -5, -16, -99, 31, 9, -57, 11, -100, 41, -93, 21, -20, 28, -39, -23, -6, -34, -61, -24, 31, -76, -66, -54, 34, 2, -85, -2, 45, 28, -51, -48, -67, -20, -83, -12, -55, -83, -2, -86, -44, -80, -9, 4, 43, -98, -24, -82, 34, -27, -63, -9, -12, -94, -15}, + []int{20, -49, -91, -71, 37, 39, -50, -93, -93, -94, 13, 32, -99, -26, -25, -79, -10, -18, 27, 38, 13, 18, -55, -37, -66, 10, -61, 32, 49, -27, -60, -69, -92, -54, -96, -89, -40, -5, -29, 5, -85, 20, -22, -5, -49, -31, -83, 28, -62, -92, -2, 28, -24, 20, -12, -92, -30, -92, -76, 46, 22, -55, 28, -81, -59, 23, -22, -3, 36, 20}, + []int{31, -79, 31, -22, -47, -47, -42, -10, -32, -38, 27, 2, -39, -28, -33, 4, -54, -80, -89, 24, 23, -1, 30, -60, -31, -35, 0, -37, -46, -33, 33, 44, 7, 10, -27, -98, 6, 22, -48, 14, -72, -69, 42, 23, 6, -50, -84, -62, -15, -69, 4, 32, 16, -61, 48, 42, -41, -8, -82, -62, -79, -15, -88, -11, -61, -96, -63, -95, 24, -49}, + []int{5, 9, -93, -50, -42, -54, 50, 17, 22, 12, -11, -5, -35, -7, -65, -71, -4, 27, 42, -13, -100, -21, -7, 14, -86, 16, -42, 33, -54, 24, -44, -1, -89, 42, -34, -99, -74, -15, -70, -40, -69, -41, -17, 47, 48, 33, -100, -64, -39, 47, -75, -1, -97, -45, -71, -48, -80, -86, 14, 6, -97, -80, -75, -59, -3, -1, -66, -93, -65, -14}, + []int{-67, -57, -41, 41, -54, 10, -25, -78, 7, 21, -2, 27, 32, -68, 35, -61, 46, -80, -89, -20, -87, -1, -97, -81, 4, 11, -56, -31, -38, 15, -70, -11, -15, -9, -76, 1, 40, -72, -66, -52, 30, -97, 15, 22, 41, -57, 15, 13, -53, -71, -50, -39, 18, -18, 6, -20, -41, 32, -16, 22, -1, -47, -82, -2, -92, -93, -6, 28, -60, -100}, + []int{-88, 16, -14, -3, -12, 16, -94, -49, 3, -6, 8, -45, -36, -81, 21, -37, 38, -53, -54, -78, -99, 38, -60, 10, 22, 10, 20, 43, -27, -10, 24, -15, -3, 28, -51, -93, 32, -9, -68, -22, 34, -91, -34, -7, -48, -6, -49, -13, -54, -7, -56, -79, -5, 36, -58, -36, -8, 10, -20, -72, -82, 13, -70, -98, 39, -88, -62, -25, 19, -62}, + []int{-16, 50, -27, -22, 32, -30, 50, -88, 4, -71, -14, -39, -52, -16, -43, -62, 20, 11, -73, -10, 13, 31, -71, -68, -79, 21, 5, -55, 48, 33, -36, 35, -14, -65, 37, 29, -54, 15, 40, -3, -68, -11, -48, -25, 33, -78, -41, -81, -48, -63, -100, -56, -70, 3, 31, -20, -80, 17, -95, 14, -80, 11, -31, -38, -54, -17, 0, -93, -2, 1}, + []int{-16, -16, -36, 0, -78, -8, 22, -90, 21, -46, 26, 42, 16, -54, -72, -27, -69, -33, -82, -41, 29, 39, -46, -100, -78, -80, -85, -81, 15, -66, -65, 45, -21, 9, 16, -42, 12, -62, 50, -71, -44, -44, -85, -68, 8, -52, -77, 4, -19, -29, 50, 39, -73, -92, 2, -88, 31, -47, -12, -31, -33, -6, -75, -71, 18, -61, -43, 25, -73, 33}, + []int{-40, -74, -34, -81, 8, 1, -52, -65, 13, -10, 48, -31, 38, -26, -33, 7, 31, 38, -70, -93, -34, -85, -4, 7, -9, -23, -97, -18, -13, -12, -11, -63, -25, -6, -42, -44, 38, -26, -28, -52, -7, -43, -85, -76, 31, 37, 29, 47, -83, -55, -8, -32, 8, 49, 5, -49, -18, 5, -59, -27, -37, -60, 36, -27, -45, -87, -8, -74, -92, -49}, + []int{-18, -35, -84, 28, 15, -99, -37, -96, -29, 44, 11, -50, -78, -56, 41, -42, -13, 14, 8, 14, -96, 8, -52, -33, 41, -4, -65, -65, -79, -18, -73, 1, -69, 1, -82, 33, -33, -10, 19, 2, -51, 20, -19, -30, -28, -40, 38, 35, 10, -3, 44, -29, 22, -95, -2, -97, -1, -16, 29, -2, -7, -92, -38, -19, -88, -16, 28, -54, -94, -65}, + []int{-75, -38, -79, -54, 11, -45, 11, 23, 15, 24, -39, 1, 50, -61, -44, -83, 13, 7, -2, 0, 38, 16, -90, 40, -42, 34, 46, -62, 37, -90, 34, -87, -2, -86, -53, 7, -33, 17, -34, -93, 31, -52, -63, 30, 49, -71, -84, -82, 23, 39, 45, 22, -90, 24, -99, -75, -32, -31, -73, 10, -59, -34, -40, 26, -1, -17, -1, 31, 43, -32}, + []int{-74, -98, -55, -88, -76, -62, -48, 2, -50, 39, -6, -34, 39, -37, -52, -8, -23, -66, -23, -31, -38, 44, 38, -75, -57, 21, 15, -25, -68, -20, -16, -15, -78, 36, -69, -21, -72, 8, -63, -92, -75, -5, -98, -96, -67, -88, -91, 1, -20, -43, -81, -68, 49, -83, 35, -3, -2, 3, -84, -63, 46, 30, -63, -36, 14, 28, -68, -33, 8, -33}, + []int{7, -89, 34, -58, -15, 27, -37, -1, -83, -28, -95, 13, -50, -100, 34, 41, -88, -61, -37, 2, -38, -97, -88, -14, -39, -58, 17, -95, 40, -93, -33, 15, -83, -13, -32, -91, -77, -44, -93, 1, 3, 26, -73, 41, -63, -24, 1, -30, -84, 18, -5, -3, 13, 30, 45, 42, -81, -91, -75, -63, -66, 24, -22, 40, 30, 37, -2, -97, -43, -4}, + []int{50, 3, 17, -6, -11, -67, -48, 46, -22, -74, -17, -41, -24, -60, 35, 10, -85, -48, 14, -36, 4, -42, -88, -10, 38, -67, -98, -70, -52, -36, -72, -66, -77, -51, -98, -19, -50, -77, 47, 27, -80, -28, -4, 31, 39, -28, 27, -16, 11, -7, -13, 41, -15, -60, 16, 1, -66, -34, 30, 45, -41, 29, -23, -89, -96, 9, -75, -57, -17, 19}, + []int{20, -18, -68, -61, -93, 48, -31, -29, 9, -100, -27, -9, -81, -45, -44, -2, 7, 38, -27, 15, 41, -66, 25, -49, 1, 36, -66, -30, -53, -67, -75, 12, 5, -2, -96, 13, -27, -36, 3, 1, -65, -47, -86, -65, 40, 19, 36, -16, 15, -49, -30, -28, -56, -57, 1, -28, -82, -64, 8, 40, -87, -56, 45, -37, -15, -72, -42, 44, -66, -34}, + []int{-75, 40, -87, -89, -27, 50, -20, -1, 27, -41, -90, -72, 38, -26, 43, -84, -4, -1, 38, 39, -8, -82, -99, 7, -56, -55, -70, 10, -27, 15, -56, 50, -69, -48, -44, 7, -83, -68, -27, -24, -22, -34, 20, 26, -66, -58, -7, -87, 29, 33, -15, 18, -47, -70, -22, 35, 3, -87, -14, 8, -75, 41, 26, 38, -83, 42, 24, 20, 42, 8}, + []int{16, -11, -22, 45, 13, -9, 43, 15, -100, -16, -65, -81, -36, 42, 26, -13, -64, 28, 16, -52, 4, -87, 50, 1, -9, -62, 27, -42, -65, -21, -53, -53, -28, -78, -6, -95, -18, -76, 27, -65, 33, 33, -99, -27, 28, -2, -80, -63, -9, -89, -20, -49, -38, 43, 11, -27, -63, -62, -42, -33, -96, -39, 16, -79, -53, 18, -8, -84, -55, -2}, + []int{-57, 4, -74, 1, -94, -72, -58, -81, -97, 24, -53, 33, -66, -17, -12, -61, -89, -30, 7, -56, 11, -20, 26, 30, 2, -92, 40, 11, 30, -32, -23, -31, -90, -61, -13, 33, -59, -74, 6, -76, 23, 31, -63, 16, -9, -22, 29, 17, 18, -22, -55, -25, -45, -98, -86, -81, -32, -100, -83, -40, -1, -99, -51, -55, -87, -8, 44, -94, 9, -50}, + []int{40, -19, -54, -78, -12, -20, 13, 3, -36, -98, 19, 49, -69, 29, -63, -41, -81, -84, -83, -32, -25, 30, -56, -96, -48, 50, -87, -100, 33, -15, -66, 47, 45, -26, -60, -1, 27, -64, -4, -77, -57, -52, 9, 2, -72, -66, -73, -23, -39, -66, 43, 34, -26, 17, -98, -68, -39, 49, -14, -20, -32, -50, 18, -37, -61, 10, 16, -75, 2, -32}, + []int{-29, -13, -75, -3, -9, 49, -77, 10, -65, 18, -97, -63, -14, -10, -65, -26, 17, -53, -49, -68, -46, -65, -47, -5, 15, 22, -26, -40, 24, -89, -12, 27, -60, 11, 20, 8, -4, 32, -47, -62, 2, 9, -85, -40, -18, -80, -56, -12, 42, -59, -97, -68, 2, -4, 48, -12, 50, -17, -45, -100, 20, 7, -13, -22, 20, 26, 48, -52, 13, 16}, + []int{-40, -95, -48, -83, -69, -46, -81, -19, -47, -50, 42, -53, 32, -39, -51, -54, -95, 8, -44, -67, -42, -38, 40, 19, 43, 18, 12, -64, -59, 13, 31, 17, 24, -63, -44, 21, -36, -16, -38, -20, -83, -28, 36, -14, 23, -71, 29, 49, -65, 1, 37, 49, 38, 31, -30, -34, 32, 14, -85, 3, -41, -80, -29, -53, -88, 45, 39, -39, -1, 36}, + []int{-85, -62, -8, -76, -89, -74, -36, 36, -86, 5, 3, -55, -44, -98, 48, 47, -3, -75, -31, -11, 26, -66, -82, 46, -73, -96, 10, -95, -19, 30, -79, 0, 32, -22, -43, -51, -22, -49, 5, 48, -30, -20, 8, -20, -44, 20, 15, 3, -56, 28, -17, -87, 19, -22, -71, -72, -57, -91, -62, -1, -99, 36, -57, 19, 47, -62, -52, -42, 7, 4}, + []int{-24, -8, 47, -83, -3, 29, 25, -28, 9, -13, -57, 3, -5, 40, -16, -81, 39, -89, -56, -56, -85, -34, -17, -95, -63, -20, 1, -93, 31, 12, 15, -70, -46, 43, 16, -3, 26, -50, -23, -77, 18, 10, 33, 30, -8, -6, 37, -97, -73, 32, 21, 19, -30, -28, 14, 5, 36, -78, -85, 36, 21, 15, 22, -32, -11, -45, 21, -58, 24, -68}, + []int{-87, -90, 0, -38, 18, 22, -52, 28, -83, 50, -81, -76, 28, -46, 16, -6, -84, -100, -58, -34, 25, 5, 19, -41, -12, -20, -42, -44, -70, -6, -9, -6, 25, -91, -43, -40, -39, -13, -89, -11, 33, 12, -72, -6, -60, -96, -90, 6, 34, 34, -88, 26, 6, -98, -99, -47, -3, 10, -88, -80, -97, 25, 8, -63, 21, 33, 26, 12, -67, 16}, + []int{3, -32, -39, 46, -14, -100, 30, 27, -22, -48, -11, 8, -97, 36, -33, 47, 42, -78, 46, 26, -50, 5, -81, 1, -58, 18, 8, -36, -63, -100, -47, -25, -42, -97, 25, -30, -73, -84, 18, 11, 47, -33, -27, -16, -82, 20, -4, -30, -62, 47, -90, 2, 41, -3, -91, -26, -5, 24, -48, -75, -53, 16, -7, -42, -52, -73, 45, -30, -78, -98}, + []int{-80, 12, -48, -80, -64, -42, -70, 28, 46, 16, 11, -10, 20, 24, 30, -37, 2, -3, -41, 4, -47, 6, -33, 28, 35, 27, 33, -4, -91, -87, -13, -62, -72, -43, 48, 9, 20, 21, 24, 36, 27, -10, 34, 42, 13, -61, -54, -30, -15, 10, -99, 45, 39, -13, -18, 25, -49, 23, 47, -79, 20, -28, -94, 16, 19, 43, -94, 4, -35, -40}, + []int{-30, -96, -46, -81, -73, 18, -50, 37, 29, -68, -12, -85, 28, -90, 43, -22, -46, -22, 6, 23, -43, -46, -32, -54, 14, 28, -20, 25, -87, -97, 24, -55, 25, -70, -27, 40, -77, 22, 16, -85, -7, -63, -59, -99, -97, 8, 50, -62, 11, -70, -5, -28, -11, -8, 41, -4, 34, -31, -17, 24, -10, 23, -3, -61, -51, -89, 42, 18, 50, -94}, + []int{-63, 32, 36, -75, -79, -31, -12, 10, -87, 20, -85, -10, -61, -81, 4, -78, -71, -41, 44, -70, 25, -92, 44, -52, -59, -29, -57, -77, -54, -10, -92, -40, -60, -3, -24, -47, 24, 35, 24, -27, 26, -10, -64, 15, -41, 25, -44, 16, 41, -82, 18, 8, 43, -55, 31, 30, 13, -83, 12, -22, 29, -97, -2, -46, -23, 30, -32, 25, -3, 44}, + []int{50, 11, -49, -5, -25, 4, 12, 27, -90, -27, 48, 16, -67, -58, -22, 48, -8, -85, -39, 29, 8, -7, -22, 18, 41, 20, 30, 12, -37, -18, 7, -89, -5, -66, 23, 5, -87, 6, -44, -6, -63, -42, -21, 18, -60, -98, -77, -56, -2, -21, 35, 2, 5, 29, 36, -49, -82, 5, 24, 49, 11, -37, -80, -51, -8, -21, 11, 21, -70, -79}, + []int{-59, -6, -91, 3, -83, 29, 1, -44, -13, -60, -19, -91, -13, -31, -72, 19, -24, -68, 0, -19, -86, -40, 49, -83, -3, 47, 35, -67, 26, -63, 35, -95, -10, -7, -55, 47, -49, -17, -10, 39, -8, -93, 34, -86, 37, -31, -33, -49, -1, -7, -37, -77, 20, -24, -72, 38, -5, -31, -40, -69, -93, -4, -63, -73, -71, -11, -47, 42, 17, -73}, + []int{-12, -56, -25, -7, -91, -6, -62, -34, -27, -88, -58, -90, -12, -3, 23, -6, -42, 36, 27, 39, -48, -1, -92, -8, 23, -91, -50, -84, 5, 19, -63, 32, 30, 31, -67, 36, -15, 44, -60, -57, -33, 18, 49, 11, -55, -54, -27, -31, -96, -20, 1, 36, -14, -15, 44, -72, -88, -41, 24, -7, -4, 48, 34, 33, 19, -41, -11, -91, 39, -9}, + []int{-98, -47, -87, -97, -82, 15, 9, 13, -56, 35, -7, 50, -70, 34, 27, 3, -24, -72, -63, -56, -95, -60, -59, 32, -29, 31, 49, 43, 40, -75, -54, 3, -87, -84, -37, 46, 30, -5, -74, -36, -76, -91, -40, 28, -20, 26, -78, -27, 2, 44, -24, 14, -15, 29, -86, -55, 24, -80, -24, 10, -53, -98, 50, -63, -61, 25, -90, 24, 24, -92}, + }, + 85, + }, + + { + [][]int{ + []int{-2, -3, 3}, + []int{-5, -10, 1}, + []int{10, 30, -5}, + }, + 7, + }, + + { + [][]int{ + []int{-2, -3, 3}, + []int{-5, -10, 1}, + []int{10, 30, -10}, + }, + 8, + }, + + { + [][]int{ + []int{}, + }, + 1, + }, + + { + [][]int{}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_calculateMinimumHP(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, calculateMinimumHP(tc.dungeon), "输入:%v", tc) + } +} + +func Benchmark_calculateMinimumHP(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + calculateMinimumHP(tc.dungeon) + } + } +} diff --git a/Algorithms/0174.dungeon-game/dungeon.png b/Algorithms/0174.dungeon-game/dungeon.png new file mode 100644 index 000000000..066ed5a38 Binary files /dev/null and b/Algorithms/0174.dungeon-game/dungeon.png differ diff --git a/Algorithms/0179.largest-number/README.md b/Algorithms/0179.largest-number/README.md new file mode 100755 index 000000000..930451c4b --- /dev/null +++ b/Algorithms/0179.largest-number/README.md @@ -0,0 +1,12 @@ +# [179. Largest Number](https://leetcode.com/problems/largest-number/) + +## 题目 +Given a list of non negative integers, arrange them such that they form the largest number. + +For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. + +Note: The result may be very large, so you need to return a string instead of an integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0179.largest-number/largest-number.go b/Algorithms/0179.largest-number/largest-number.go new file mode 100755 index 000000000..e4f481dfd --- /dev/null +++ b/Algorithms/0179.largest-number/largest-number.go @@ -0,0 +1,68 @@ +package problem0179 + +import ( + "sort" + "strconv" +) + +func largestNumber(nums []int) string { + size := len(nums) + b := make(bytes, size) + resSize := 0 + + // 转换 nums + for i := range b { + b[i] = []byte(strconv.Itoa(nums[i])) + resSize += len(b[i]) + } + + // 按照题意的规则,对 b 进行排序 + sort.Sort(b) + + // 串联 b 成 res + res := make([]byte, 0, resSize) + for i := size - 1; i >= 0; i-- { + res = append(res, b[i]...) + } + + // 处理 res 以 0 开头的情况 + // 比如,[0, 0, 0] 的结果是 "000" + i := 0 + for i < resSize-1 && res[i] == '0' { + i++ + } + + return string(res[i:]) +} + +type bytes [][]byte + +func (b bytes) Len() int { + return len(b) +} + +func (b bytes) Less(i, j int) bool { + size := len(b[i]) + len(b[j]) + + bij := make([]byte, 0, size) + bij = append(bij, b[i]...) + bij = append(bij, b[j]...) + + bji := make([]byte, 0, size) + bji = append(bji, b[j]...) + bji = append(bji, b[i]...) + + for k := 0; k < size; k++ { + if bij[k] < bji[k] { + return true + } else if bij[k] > bji[k] { + return false + } + } + + return false +} + +func (b bytes) Swap(i, j int) { + b[i], b[j] = b[j], b[i] +} diff --git a/Algorithms/0179.largest-number/largest-number_test.go b/Algorithms/0179.largest-number/largest-number_test.go new file mode 100755 index 000000000..bcf9dff0d --- /dev/null +++ b/Algorithms/0179.largest-number/largest-number_test.go @@ -0,0 +1,59 @@ +package problem0179 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans string +}{ + + { + []int{824, 938, 1399, 5607, 6973, 5703, 9609, 4398, 8247}, + "9609938824824769735703560743981399", + }, + + { + []int{0, 0}, + "0", + }, + + { + []int{1, 20}, + "201", + }, + + { + []int{3, 30, 34, 5, 9}, + "9534330", + }, + + { + []int{3, 30, 34, 5, 9, 30}, + "953433030", + }, + + // 可以有多个 testcase +} + +func Test_largestNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largestNumber(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_largestNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestNumber(tc.nums) + } + } +} diff --git a/Algorithms/0187.repeated-dna-sequences/README.md b/Algorithms/0187.repeated-dna-sequences/README.md new file mode 100755 index 000000000..c21050e00 --- /dev/null +++ b/Algorithms/0187.repeated-dna-sequences/README.md @@ -0,0 +1,17 @@ +# [187. Repeated DNA Sequences](https://leetcode.com/problems/repeated-dna-sequences/) + +## 题目 +All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA. + +Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule. + +For example, +``` +Given s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT", +Return: +["AAAAACCCCC", "CCCCCAAAAA"]. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences.go b/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences.go new file mode 100755 index 000000000..fff894b3a --- /dev/null +++ b/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences.go @@ -0,0 +1,28 @@ +package problem0187 + +import ( + "sort" +) + +func findRepeatedDnaSequences(s string) []string { + var res []string + if len(s) <= 10 { + return nil + } + + str := "" + // rec 记录各个 subString 出现的次数 + rec := make(map[string]int, len(s)-9) + for i := 0; i+10 <= len(s); i++ { + str = s[i : i+10] + if v := rec[str]; v == 1 { + // 把已经出现过一次的 subString 存放入 res + res = append(res, str) + } + rec[str]++ + } + + sort.Strings(res) + + return res +} diff --git a/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences_test.go b/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences_test.go new file mode 100755 index 000000000..b05497349 --- /dev/null +++ b/Algorithms/0187.repeated-dna-sequences/repeated-dna-sequences_test.go @@ -0,0 +1,54 @@ +package problem0187 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans []string +}{ + + { + "", + nil, + }, + + { + "ACACA", + nil, + }, + + { + "ACACACACACACA", + []string{"ACACACACAC", "CACACACACA"}, + }, + + { + "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT", + []string{"AAAAACCCCC", "CCCCCAAAAA"}, + }, + + // 可以有多个 testcase +} + +func Test_findRepeatedDnaSequences(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRepeatedDnaSequences(tc.s), "输入:%v", tc) + } +} + +func Benchmark_findRepeatedDnaSequences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRepeatedDnaSequences(tc.s) + } + } +} diff --git a/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv.go b/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv.go index 45d0b26dd..6be9218d5 100755 --- a/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv.go +++ b/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv.go @@ -1,4 +1,4 @@ -package Problem0188 +package problem0188 func maxProfit(k int, prices []int) int { size := len(prices) diff --git a/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv_test.go b/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv_test.go index 50b099279..74c34debb 100755 --- a/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv_test.go +++ b/Algorithms/0188.best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv_test.go @@ -1,4 +1,4 @@ -package Problem0188 +package problem0188 import ( "fmt" diff --git a/Algorithms/0189.rotate-array/rotate-array.go b/Algorithms/0189.rotate-array/rotate-array.go index 0480b8157..807b31b0e 100755 --- a/Algorithms/0189.rotate-array/rotate-array.go +++ b/Algorithms/0189.rotate-array/rotate-array.go @@ -1,4 +1,4 @@ -package Problem0189 +package problem0189 func rotate(nums []int, k int) { // 我已经假定 k >= 0 diff --git a/Algorithms/0189.rotate-array/rotate-array_test.go b/Algorithms/0189.rotate-array/rotate-array_test.go index 86f5d233c..77ff773de 100755 --- a/Algorithms/0189.rotate-array/rotate-array_test.go +++ b/Algorithms/0189.rotate-array/rotate-array_test.go @@ -1,4 +1,4 @@ -package Problem0189 +package problem0189 import ( "fmt" diff --git a/Algorithms/0190.reverse-bits/README.md b/Algorithms/0190.reverse-bits/README.md new file mode 100755 index 000000000..3a808f985 --- /dev/null +++ b/Algorithms/0190.reverse-bits/README.md @@ -0,0 +1,28 @@ +# [190. Reverse Bits](https://leetcode.com/problems/reverse-bits/) + +Reverse bits of a given 32 bits unsigned integer. + +Example 1: + +```text +Input: 00000010100101000001111010011100 +Output: 00111001011110000010100101000000 +Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000. +``` + +Example 2: + +```text +Input: 11111111111111111111111111111101 +Output: 10111111111111111111111111111111 +Explanation: The input binary string 11111111111111111111111111111101 represents the unsigned integer 4294967293, so return 3221225471 which its binary representation is 10101111110010110010011101101001. +``` + +Note: + +- Note that in some languages such as Java, there is no unsigned integer type. In this case, both input and output will be given as signed integer type and should not affect your implementation, as the internal binary representation of the integer is the same whether it is signed or unsigned. +- In Java, the compiler represents the signed integers using [2's complement notation](https://en.wikipedia.org/wiki/Two%27s_complement). Therefore, in **Example 2** above the input represents the signed integer `-3` and the output represents the signed integer `-1073741825`. + +Follow up: + +If this function is called many times, how would you optimize it? \ No newline at end of file diff --git a/Algorithms/0190.reverse-bits/reverse-bits.go b/Algorithms/0190.reverse-bits/reverse-bits.go new file mode 100755 index 000000000..8d123e77e --- /dev/null +++ b/Algorithms/0190.reverse-bits/reverse-bits.go @@ -0,0 +1,13 @@ +package problem0190 + +func reverseBits(n uint32) uint32 { + n = (n >> 16) | (n << 16) + n = ((n & 0xff00ff00) >> 8) | ((n & 0x00ff00ff) << 8) + n = ((n & 0xf0f0f0f0) >> 4) | ((n & 0x0f0f0f0f) << 4) + n = ((n & 0xcccccccc) >> 2) | ((n & 0x33333333) << 2) + n = ((n & 0xaaaaaaaa) >> 1) | ((n & 0x55555555) << 1) + return n +} + +// for 8 bit binary number abcdefgh, the process is as follow: +// abcdefgh -> efghabcd -> ghefcdab -> hgfedcba diff --git a/Algorithms/0190.reverse-bits/reverse-bits_test.go b/Algorithms/0190.reverse-bits/reverse-bits_test.go new file mode 100755 index 000000000..38f4ecc74 --- /dev/null +++ b/Algorithms/0190.reverse-bits/reverse-bits_test.go @@ -0,0 +1,42 @@ +package problem0190 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num uint32 + ans uint32 +}{ + + { + 43261596, // 0b00000010100101000001111010011100 + 964176192, // 0b00111001011110000010100101000000 + }, + + { + 4294967293, // 0b11111111111111111111111111111101 + 3221225471, // 0b10101111110010110010011101101001 + }, + + // 可以有多个 testcase +} + +func Test_reverseBits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, reverseBits(tc.num), "输入:%v", tc) + } +} + +func Benchmark_reverseBits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseBits(tc.num) + } + } +} diff --git a/Algorithms/0191.number-of-1-bits/README.md b/Algorithms/0191.number-of-1-bits/README.md new file mode 100755 index 000000000..9a046c070 --- /dev/null +++ b/Algorithms/0191.number-of-1-bits/README.md @@ -0,0 +1,36 @@ +# [191. Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/) + +Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the [Hamming weight](http://en.wikipedia.org/wiki/Hamming_weight)). + +Example 1: + +```text +Input: 00000000000000000000000000001011 +Output: 3 +Explanation: The input binary string 00000000000000000000000000001011 has a total of three '1' bits. +``` + +Example 2: + +```text +Input: 00000000000000000000000010000000 +Output: 1 +Explanation: The input binary string 00000000000000000000000010000000 has a total of one '1' bit. +``` + +Example 3: + +```text +Input: 11111111111111111111111111111101 +Output: 31 +Explanation: The input binary string 11111111111111111111111111111101 has a total of thirty one '1' bits. +``` + +Note: + +- Note that in some languages such as Java, there is no unsigned integer type. In this case, the input will be given as signed integer type and should not affect your implementation, as the internal binary representation of the integer is the same whether it is signed or unsigned. +- In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3 above the input represents the signed integer -3. + +Follow up: + +If this function is called many times, how would you optimize it? \ No newline at end of file diff --git a/Algorithms/0191.number-of-1-bits/number-of-1-bits.go b/Algorithms/0191.number-of-1-bits/number-of-1-bits.go new file mode 100755 index 000000000..31fde8355 --- /dev/null +++ b/Algorithms/0191.number-of-1-bits/number-of-1-bits.go @@ -0,0 +1,13 @@ +package problem0191 + +func hammingWeight(num uint32) int { + count := 0 + for num != 0 { + count++ + num &= num - 1 + // assume num = 0b1000 + // num-1 = 0b0111 + // num & (num-1) = 0 + } + return count +} diff --git a/Algorithms/0191.number-of-1-bits/number-of-1-bits_test.go b/Algorithms/0191.number-of-1-bits/number-of-1-bits_test.go new file mode 100755 index 000000000..95b025c85 --- /dev/null +++ b/Algorithms/0191.number-of-1-bits/number-of-1-bits_test.go @@ -0,0 +1,47 @@ +package problem0191 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num uint32 + ans int +}{ + + { + 11, //0b00000000000000000000000000001011 + 3, + }, + + { + 128, //0b00000000000000000000000010000000 + 1, + }, + + { + 4294967293, //0b11111111111111111111111111111101 + 31, + }, + + // 可以有多个 testcase +} + +func Test_hammingWeight(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, hammingWeight(tc.num), "输入:%v", tc) + } +} + +func Benchmark_hammingWeight(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hammingWeight(tc.num) + } + } +} diff --git a/Algorithms/0198.house-robber/README.md b/Algorithms/0198.house-robber/README.md new file mode 100755 index 000000000..f2fda767f --- /dev/null +++ b/Algorithms/0198.house-robber/README.md @@ -0,0 +1,12 @@ +# [198. House Robber](https://leetcode.com/problems/house-robber/) + +## 题目 +You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night. + +Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police. + +Credits:Special thanks to @ifanchu for adding this problem and creating all test cases. Also thanks to @ts for adding additional test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0198.house-robber/house-robber.go b/Algorithms/0198.house-robber/house-robber.go new file mode 100755 index 000000000..11d73f24e --- /dev/null +++ b/Algorithms/0198.house-robber/house-robber.go @@ -0,0 +1,23 @@ +package problem0198 + +func rob(nums []int) int { + // a 对于偶数位上的最大值的记录 + // b 对于奇数位上的最大值的记录 + var a, b int + for i, v := range nums { + if i%2 == 0 { + a = max(a+v, b) + } else { + b = max(a, b+v) + } + } + + return max(a, b) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0198.house-robber/house-robber_test.go b/Algorithms/0198.house-robber/house-robber_test.go new file mode 100755 index 000000000..f0eaa73ed --- /dev/null +++ b/Algorithms/0198.house-robber/house-robber_test.go @@ -0,0 +1,64 @@ +package problem0198 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{226, 174, 214, 16, 218, 48, 153, 131, 128, 17, 157, 142, 88, 43, 37, 157, 43, 221, 191, 68, 206, 23, 225, 82, 54, 118, 111, 46, 80, 49, 245, 63, 25, 194, 72, 80, 143, 55, 209, 18, 55, 122, 65, 66, 177, 101, 63, 201, 172, 130, 103, 225, 142, 46, 86, 185, 62, 138, 212, 192, 125, 77, 223, 188, 99, 228, 90, 25, 193, 211, 84, 239, 119, 234, 85, 83, 123, 120, 131, 203, 219, 10, 82, 35, 120, 180, 249, 106, 37, 169, 225, 54, 103, 55, 166, 124}, + 7102, + }, + + { + []int{100, 1, 1, 100, 1, 1, 100, 1, 1, 100}, + 400, + }, + + { + []int{2, 1, 1, 2}, + 4, + }, + + { + []int{}, + 0, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8}, + 20, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 25, + }, + + // 可以有多个 testcase +} + +func Test_rob(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rob(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_rob(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rob(tc.nums) + } + } +} diff --git a/Algorithms/0199.binary-tree-right-side-view/README.md b/Algorithms/0199.binary-tree-right-side-view/README.md new file mode 100755 index 000000000..5940e7d05 --- /dev/null +++ b/Algorithms/0199.binary-tree-right-side-view/README.md @@ -0,0 +1,22 @@ +# [199. Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/) + +## 题目 +Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. + +For example: +Given the following binary tree, +``` + 1 <--- + / \ +2 3 <--- + \ \ + 5 4 <--- + +You should return [1, 3, 4]. +``` + +Credits:Special thanks to @amrsaqr for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view.go b/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view.go new file mode 100755 index 000000000..a8e8bc027 --- /dev/null +++ b/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view.go @@ -0,0 +1,33 @@ +package problem0199 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func rightSideView(root *TreeNode) []int { + if root == nil { + return nil + } + + if root.Left == nil && root.Right == nil { + return []int{root.Val} + } + + // 递归求解 + ls := rightSideView(root.Left) + rs := rightSideView(root.Right) + + // 左边的分支比右边长的部分,还是可以从右边看到 + if len(ls) > len(rs) { + rs = append(rs, ls[len(rs):]...) + } + + // 添加 root 节点的值 + res := make([]int, len(rs)+1) + res[0] = root.Val + copy(res[1:], rs) + + return res +} diff --git a/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view_test.go b/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view_test.go new file mode 100755 index 000000000..d1bca2d28 --- /dev/null +++ b/Algorithms/0199.binary-tree-right-side-view/binary-tree-right-side-view_test.go @@ -0,0 +1,57 @@ +package problem0199 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []int +}{ + + { + []int{}, + []int{}, + nil, + }, + + { + []int{1, 2, 5, 3}, + []int{2, 5, 1, 3}, + []int{1, 3, 5}, + }, + + { + []int{1, 2, 5, 3, 4}, + []int{2, 5, 1, 3, 4}, + []int{1, 3, 4}, + }, + + // 可以有多个 testcase +} + +func Test_rightSideView(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, rightSideView(root), "输入:%v", tc) + } +} + +func Benchmark_rightSideView(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + rightSideView(root) + } + } +} diff --git a/Algorithms/0200.number-of-islands/README.md b/Algorithms/0200.number-of-islands/README.md new file mode 100755 index 000000000..d93f0d403 --- /dev/null +++ b/Algorithms/0200.number-of-islands/README.md @@ -0,0 +1,25 @@ +# [200. Number of Islands](https://leetcode.com/problems/number-of-islands/) + +## 题目 +Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. + +Example 1: +``` +11110 +11010 +11000 +00000 +Answer: 1 +``` +Example 2: +``` +11000 +11000 +00100 +00011 +Answer: 3 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0200.number-of-islands/number-of-islands.go b/Algorithms/0200.number-of-islands/number-of-islands.go new file mode 100755 index 000000000..b029c5f37 --- /dev/null +++ b/Algorithms/0200.number-of-islands/number-of-islands.go @@ -0,0 +1,71 @@ +package problem0200 + +func numIslands(grid [][]byte) int { + // 获取 grid 的大小 + m := len(grid) + if m == 0 { + return 0 + } + n := len(grid[0]) + + // bfs 搜索时,存放点坐标的队列 + x := make([]int, 0, m*n) + y := make([]int, 0, m*n) + + // 往队列中添加 (i,j) 点,并修改 (i,j) 点的值 + // 避免重复搜索 + var add = func(i, j int) { + x = append(x, i) + y = append(y, j) + grid[i][j] = '0' + } + + // 从坐标队列中,取出坐标点 + var pop = func() (int, int) { + i := x[0] + x = x[1:] + j := y[0] + y = y[1:] + return i, j + } + + var bfs = func(i, j int) int { + if grid[i][j] == '0' { + return 0 + } + + add(i, j) + + for len(x) > 0 { + i, j = pop() + + // 搜索 (i,j) 点的 上下左右 四个方位 + if 0 <= i-1 && grid[i-1][j] == '1' { + add(i-1, j) + } + + if 0 <= j-1 && grid[i][j-1] == '1' { + add(i, j-1) + } + + if i+1 < m && grid[i+1][j] == '1' { + add(i+1, j) + } + + if j+1 < n && grid[i][j+1] == '1' { + add(i, j+1) + } + } + + return 1 + } + + res := 0 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + res += bfs(i, j) + } + } + + return res +} diff --git a/Algorithms/0200.number-of-islands/number-of-islands_test.go b/Algorithms/0200.number-of-islands/number-of-islands_test.go new file mode 100755 index 000000000..8d5b53dad --- /dev/null +++ b/Algorithms/0200.number-of-islands/number-of-islands_test.go @@ -0,0 +1,68 @@ +package problem0200 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]byte + ans int +}{ + + { + [][]byte{}, + 0, + }, + + { + [][]byte{ + []byte("111001"), + []byte("010001"), + []byte("111111"), + }, + 1, + }, + + { + [][]byte{ + []byte("11110"), + []byte("11010"), + []byte("11000"), + []byte("00000"), + }, + 1, + }, + + { + [][]byte{ + []byte("11000"), + []byte("11000"), + []byte("00100"), + []byte("00011"), + }, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numIslands(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numIslands(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_numIslands(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numIslands(tc.grid) + } + } +} diff --git a/Algorithms/0201.bitwise-and-of-numbers-range/README.md b/Algorithms/0201.bitwise-and-of-numbers-range/README.md new file mode 100755 index 000000000..7994d82f9 --- /dev/null +++ b/Algorithms/0201.bitwise-and-of-numbers-range/README.md @@ -0,0 +1,30 @@ +# [201. Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/) + +## 题目 +Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. + +For example, given the range [5, 7], you should return 4. + +Credits:Special thanks to @amrsaqr for adding this problem and creating all test cases. + +## 解题思路 + +在草稿纸上,演算以下两组参数,就可以明白程序的用意了。 +1. +``` +m = 5, n = 7 +5 : 0101 +6 : 0110 +7 : 0111 +结果 +4 : 0100 +``` +2. +``` +m = 6, n = 8 +6 : 0110 +7 : 0111 +8 : 1000 +结果 +0 : 0000 +``` \ No newline at end of file diff --git a/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range.go b/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range.go new file mode 100755 index 000000000..1264bf915 --- /dev/null +++ b/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range.go @@ -0,0 +1,17 @@ +package problem0201 + +func rangeBitwiseAnd(m int, n int) int { + res := uint(0) + + for m >= 1 && n >= 1 { + if m == n { + return m << res + } + + m >>= 1 + n >>= 1 + res++ + } + + return 0 +} diff --git a/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range_test.go b/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range_test.go new file mode 100755 index 000000000..dce84aeda --- /dev/null +++ b/Algorithms/0201.bitwise-and-of-numbers-range/bitwise-and-of-numbers-range_test.go @@ -0,0 +1,59 @@ +package problem0201 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + m int + n int + ans int +}{ + + { + 4, + 5, + 4, + }, + + { + 3, + 3, + 3, + }, + + { + 4000000, + 2147483646, + 0, + }, + + { + 5, + 7, + 4, + }, + + // 可以有多个 testcase +} + +func Test_rangeBitwiseAnd(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rangeBitwiseAnd(tc.m, tc.n), "输入:%v", tc) + } +} + +func Benchmark_rangeBitwiseAnd(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rangeBitwiseAnd(tc.m, tc.n) + } + } +} diff --git a/Algorithms/0202.happy-number/README.md b/Algorithms/0202.happy-number/README.md new file mode 100755 index 000000000..d314b2ff4 --- /dev/null +++ b/Algorithms/0202.happy-number/README.md @@ -0,0 +1,22 @@ +# [202. Happy Number](https://leetcode.com/problems/happy-number/) + +## 题目 +Write an algorithm to determine if a number is "happy". + +A happy number is a number defined by the following process: +1. Starting with any positive integer, replace the number by the sum of the squares of its digits, +1. and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers. + +Example: 19 is a happy number +``` +1^2 + 9^2 = 82 +8^2 + 2^2 = 68 +6^2 + 8^2 = 100 +1^2 + 0^2 + 0^2 = 1 +``` + +Credits:Special thanks to @mithmatt and @ts for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0202.happy-number/happy-number.go b/Algorithms/0202.happy-number/happy-number.go new file mode 100755 index 000000000..5e65e7fc4 --- /dev/null +++ b/Algorithms/0202.happy-number/happy-number.go @@ -0,0 +1,22 @@ +package problem0202 + +func isHappy(n int) bool { + slow, fast := n, trans(n) + for slow != fast { + slow = trans(slow) + fast = trans(trans(fast)) + } + if slow == 1 { + return true + } + return false +} + +func trans(n int) int { + res := 0 + for n != 0 { + res += (n % 10) * (n % 10) + n /= 10 + } + return res +} diff --git a/Algorithms/0202.happy-number/happy-number_test.go b/Algorithms/0202.happy-number/happy-number_test.go new file mode 100755 index 000000000..1a1cc0a54 --- /dev/null +++ b/Algorithms/0202.happy-number/happy-number_test.go @@ -0,0 +1,66 @@ +package problem0202 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans bool +}{ + + { + 2, + false, + }, + + { + 77, + false, + }, + + { + 19, + true, + }, + + // 可以有多个 testcase +} + +func Test_isHappy(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isHappy(tc.n), "输入:%v", tc) + } +} + +func Benchmark_isHappy(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isHappy(tc.n) + } + } +} + +func Benchmark_mult(b *testing.B) { + n := 12345 + for i := 0; i < b.N; i++ { + _ = (n % 10) * (n % 10) + } +} +func Benchmark_square(b *testing.B) { + n := 12345 + for i := 0; i < b.N; i++ { + _ = square(n % 10) + } +} + +func square(a int) int { + return a * a +} diff --git a/Algorithms/0203.remove-linked-list-elements/README.md b/Algorithms/0203.remove-linked-list-elements/README.md new file mode 100755 index 000000000..3fd7a5eea --- /dev/null +++ b/Algorithms/0203.remove-linked-list-elements/README.md @@ -0,0 +1,15 @@ +# [203. Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/) + +## 题目 +Remove all elements from a linked list of integers that have value val. + +Example +``` +Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 +Return: 1 --> 2 --> 3 --> 4 --> 5 +``` +Credits:Special thanks to @mithmatt for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements.go b/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements.go new file mode 100755 index 000000000..6fe7a1f5f --- /dev/null +++ b/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements.go @@ -0,0 +1,23 @@ +package problem0203 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func removeElements(head *ListNode, val int) *ListNode { + headPre := ListNode{Next: head} + + temp := &headPre + for temp.Next != nil { + if temp.Next.Val == val { + // 删除符合条件的节点 + temp.Next = temp.Next.Next + } else { + temp = temp.Next + } + } + + return headPre.Next +} diff --git a/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements_test.go b/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements_test.go new file mode 100755 index 000000000..ab9743b80 --- /dev/null +++ b/Algorithms/0203.remove-linked-list-elements/remove-linked-list-elements_test.go @@ -0,0 +1,45 @@ +package problem0203 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ints []int + val int + ans []int +}{ + + { + []int{1, 2, 6, 3, 4, 5, 6}, + 6, + []int{1, 2, 3, 4, 5}, + }, + + // 可以有多个 testcase +} + +func Test_removeElements(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.ints) + ast.Equal(tc.ans, kit.List2Ints(removeElements(head, tc.val)), "输入:%v", tc) + } +} + +func Benchmark_removeElements(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.ints) + removeElements(head, tc.val) + } + } +} diff --git a/Algorithms/0204.count-primes/README.md b/Algorithms/0204.count-primes/README.md new file mode 100755 index 000000000..73647f2ae --- /dev/null +++ b/Algorithms/0204.count-primes/README.md @@ -0,0 +1,11 @@ +# [204. Count Primes](https://leetcode.com/problems/count-primes/) + +## 题目 +Description: +Count the number of prime numbers less than a non-negative number, n. + +Credits:Special thanks to @mithmatt for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0204.count-primes/count-primes.go b/Algorithms/0204.count-primes/count-primes.go new file mode 100755 index 000000000..09070c511 --- /dev/null +++ b/Algorithms/0204.count-primes/count-primes.go @@ -0,0 +1,33 @@ +package problem0204 + +func countPrimes(n int) int { + if n < 3 { + return 0 + } + + // composite:合数,prime 的反义词 + isComposite := make([]bool, n) + // 小于 n 的数中,有一半是偶数,除2以外,都不是质数 + // 所以,count 的上限是 n / 2 + count := n / 2 + + for i := 3; i*i < n; i += 2 { + if isComposite[i] { + continue + } + + // j 是 i 的倍数,所以 j 肯定不是 质数 + // 对所有的 j 进行标记 + for j := i * i; j < n; j += 2 * i { + if !isComposite[j] { + // j 还没有被别的 i 标记过了 + // 修改 count + count-- + // 对 j 进行标记 + isComposite[j] = true + } + } + } + + return count +} diff --git a/Algorithms/0204.count-primes/count-primes_test.go b/Algorithms/0204.count-primes/count-primes_test.go new file mode 100755 index 000000000..5b0212890 --- /dev/null +++ b/Algorithms/0204.count-primes/count-primes_test.go @@ -0,0 +1,59 @@ +package problem0204 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 499979, + 41537, + }, + + { + 2, + 0, + }, + + { + 5, + 2, + }, + + { + 10, + 4, + }, + + { + 100, + 25, + }, + + // 可以有多个 testcase +} + +func Test_countPrimes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countPrimes(tc.n), "输入:%v", tc) + } +} + +func Benchmark_countPrimes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countPrimes(tc.n) + } + } +} diff --git a/Algorithms/0205.isomorphic-strings/README.md b/Algorithms/0205.isomorphic-strings/README.md new file mode 100755 index 000000000..6c3684b66 --- /dev/null +++ b/Algorithms/0205.isomorphic-strings/README.md @@ -0,0 +1,24 @@ +# [205. Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings/) + +## 题目 + +Given two strings s and t, determine if they are isomorphic. + +Two strings are isomorphic if the characters in s can be replaced to get t. + +All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character but a character may map to itself. + +For example, + +Given "egg", "add", return true. + +Given "foo", "bar", return false. + +Given "paper", "title", return true. + +Note: +You may assume both s and t have the same length. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0205.isomorphic-strings/isomorphic-strings.go b/Algorithms/0205.isomorphic-strings/isomorphic-strings.go new file mode 100755 index 000000000..919d0ef0f --- /dev/null +++ b/Algorithms/0205.isomorphic-strings/isomorphic-strings.go @@ -0,0 +1,21 @@ +package problem0205 + +func isIsomorphic(s string, t string) bool { + if len(s) != len(t) { + return false + } + + m1 := make([]int, 256) + m2 := make([]int, 256) + + for i := 0; i < len(s); i++ { + if m1[int(s[i])] != m2[int(t[i])] { + return false + } + + m1[int(s[i])] = i + 1 + m2[int(t[i])] = i + 1 + } + + return true +} diff --git a/Algorithms/0205.isomorphic-strings/isomorphic-strings_test.go b/Algorithms/0205.isomorphic-strings/isomorphic-strings_test.go new file mode 100755 index 000000000..7e046e5c8 --- /dev/null +++ b/Algorithms/0205.isomorphic-strings/isomorphic-strings_test.go @@ -0,0 +1,43 @@ +package problem0205 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + t string + ans bool +}{ + + {"ba", "a", false}, + {"a", "a", true}, + {"aba", "baa", false}, + {"ab", "aa", false}, + {"egg", "add", true}, + {"foo", "bar", false}, + {"paper", "title", true}, + + // 可以有多个 testcase +} + +func Test_isIsomorphic(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isIsomorphic(tc.s, tc.t), "输入:%v", tc) + } +} + +func Benchmark_isIsomorphic(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isIsomorphic(tc.s, tc.t) + } + } +} diff --git a/Algorithms/0206.reverse-linked-list/reverse-linked-list.go b/Algorithms/0206.reverse-linked-list/reverse-linked-list.go index 013f46060..c61ccede3 100755 --- a/Algorithms/0206.reverse-linked-list/reverse-linked-list.go +++ b/Algorithms/0206.reverse-linked-list/reverse-linked-list.go @@ -1,4 +1,4 @@ -package Problem0206 +package problem0206 func reverseList(head *ListNode) *ListNode { // prev 是所有已经逆转的节点的head diff --git a/Algorithms/0206.reverse-linked-list/reverse-linked-list_test.go b/Algorithms/0206.reverse-linked-list/reverse-linked-list_test.go index 8666b55de..40331de96 100755 --- a/Algorithms/0206.reverse-linked-list/reverse-linked-list_test.go +++ b/Algorithms/0206.reverse-linked-list/reverse-linked-list_test.go @@ -1,4 +1,4 @@ -package Problem0206 +package problem0206 import ( "fmt" diff --git a/Algorithms/0207.course-schedule/README.md b/Algorithms/0207.course-schedule/README.md new file mode 100755 index 000000000..1d1ffad7e --- /dev/null +++ b/Algorithms/0207.course-schedule/README.md @@ -0,0 +1,36 @@ +# [207. Course Schedule](https://leetcode.com/problems/course-schedule/) + +## 题目 +There are a total of n courses you have to take, labeled from 0 to n - 1. + +Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] + +Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses? + +For example: +``` +2, [[1,0]] +``` +There are a total of 2 courses to take. To take course 1 you should have finished course 0. So it is possible. +``` +2, [[1,0],[0,1]] +``` +There are a total of 2 courses to take. To take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible. + +Note: +1. The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented. +1. You may assume that there are no duplicate edges in the input prerequisites. + +click to show more hints. + +Hints: + +This problem is equivalent to finding if a cycle exists in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses. + +Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort. + +Topological sort could also be done via BFS. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0207.course-schedule/course-schedule.go b/Algorithms/0207.course-schedule/course-schedule.go new file mode 100755 index 000000000..94cc8da99 --- /dev/null +++ b/Algorithms/0207.course-schedule/course-schedule.go @@ -0,0 +1,63 @@ +package problem0207 + +func canFinish(numCourses int, prerequisites [][]int) bool { + // next[i][j] : i -> next[i]... ,i 是 next[i] 的先修课 + next := buildNext(numCourses, prerequisites) + // pres[i] : i 的先修课程的**个数** + pres := buildPres(next) + + return check(next, pres, numCourses) +} + +func buildNext(n int, prereq [][]int) [][]int { + next := make([][]int, n) + + for _, pair := range prereq { + next[pair[1]] = append(next[pair[1]], pair[0]) + } + + return next +} + +func buildPres(next [][]int) []int { + pres := make([]int, len(next)) + + for _, neighbours := range next { + for _, n := range neighbours { + pres[n]++ + } + } + + return pres +} + +func check(next [][]int, pres []int, numCourses int) bool { + var i, j int + + // 第 i 个完成的课程的代号是 j + for i = 0; i < numCourses; i++ { + // 完成首先遇到的,无需先修课程的课程 + for j = 0; j < numCourses; j++ { + if pres[j] == 0 { + break + } + } + + // 每个课程都需要先修课 + // 出现了环路 + if j >= numCourses { + return false + } + + // 修改 pres[j] 为负数 + // 避免重修 + pres[j] = -1 + // 完成 j 课程后 + // j 的后续课程的,先修课程数量都可以 -1 + for _, c := range next[j] { + pres[c]-- + } + } + + return true +} diff --git a/Algorithms/0207.course-schedule/course-schedule_test.go b/Algorithms/0207.course-schedule/course-schedule_test.go new file mode 100755 index 000000000..82d9cd016 --- /dev/null +++ b/Algorithms/0207.course-schedule/course-schedule_test.go @@ -0,0 +1,86 @@ +package problem0207 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + numCourses int + prerequisites [][]int + ans bool +}{ + + { + 4, + [][]int{ + []int{1, 0}, + []int{2, 1}, + []int{2, 0}, + []int{3, 0}, + []int{3, 1}, + []int{3, 2}, + }, + true, + }, + + { + 4, + [][]int{ + []int{1, 0}, + []int{2, 1}, + []int{2, 0}, + []int{3, 0}, + []int{3, 1}, + []int{3, 2}, + []int{2, 3}, + }, + false, + }, + + { + 2, + [][]int{ + []int{0, 1}, + }, + true, + }, + + { + 2, + [][]int{ + []int{1, 0}, + }, + true, + }, + + { + 2, + [][]int{ + []int{1, 0}, + []int{0, 1}, + }, + false, + }, + // 可以有多个 testcase +} + +func Test_canFinish(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canFinish(tc.numCourses, tc.prerequisites), "输入:%v", tc) + } +} + +func Benchmark_canFinish(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canFinish(tc.numCourses, tc.prerequisites) + } + } +} diff --git a/Algorithms/0208.implement-trie-prefix-tree/README.md b/Algorithms/0208.implement-trie-prefix-tree/README.md new file mode 100755 index 000000000..a24aa3deb --- /dev/null +++ b/Algorithms/0208.implement-trie-prefix-tree/README.md @@ -0,0 +1,11 @@ +# [208. Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/) + +## 题目 +Implement a trie with insert, search, and startsWith methods. + +Note: +You may assume that all inputs are consist of lowercase letters a-z. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree.go b/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree.go new file mode 100755 index 000000000..0c68569fa --- /dev/null +++ b/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree.go @@ -0,0 +1,67 @@ +package problem0208 + +/** + * Your Trie object will be instantiated and called as such: + * obj := Constructor(); + * obj.Insert(word); + * param_2 := obj.Search(word); + * param_3 := obj.StartsWith(prefix); + */ + +// Trie 是便于 word 插入与查找的数据结构 +type Trie struct { + val byte + sons [26]*Trie + end int +} + +func Constructor() Trie { + return Trie{} +} + +func (this *Trie) Insert(word string) { + node := this + size := len(word) + for i := 0; i < size; i++ { + idx := word[i] - 'a' + if node.sons[idx] == nil { + node.sons[idx] = &Trie{val: word[i]} + } + + node = node.sons[idx] + } + + node.end++ +} + +func (this *Trie) Search(word string) bool { + node := this + size := len(word) + for i := 0; i < size; i++ { + idx := word[i] - 'a' + if node.sons[idx] == nil { + return false + } + node = node.sons[idx] + } + + if node.end > 0 { + return true + } + + return false +} + +func (this *Trie) StartsWith(prefix string) bool { + node := this + size := len(prefix) + for i := 0; i < size; i++ { + idx := prefix[i] - 'a' + if node.sons[idx] == nil { + return false + } + node = node.sons[idx] + } + + return true +} diff --git a/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree_test.go b/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree_test.go new file mode 100755 index 000000000..672241465 --- /dev/null +++ b/Algorithms/0208.implement-trie-prefix-tree/implement-trie-prefix-tree_test.go @@ -0,0 +1,29 @@ +package problem0208 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + trie := Constructor() + + trie.Insert("abc") + // ["abc"] + + ast.True(trie.Search("abc"), "Search abc in [abc]") + // ["abc"] + + ast.False(trie.Search("ab"), "Search abcd in [a]") + ast.False(trie.Search("abcd"), "Search abcd in [abc]") + // ["abc"] + + ast.True(trie.StartsWith("abc"), "Search startWith abc in [abc]") + // ["abc"] + + ast.False(trie.StartsWith("bc"), "Search startWith bc in [abc]") + // ["abc"] +} diff --git a/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum.go b/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum.go index 2faa6e893..534730981 100755 --- a/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum.go +++ b/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum.go @@ -1,4 +1,4 @@ -package Problem0209 +package problem0209 func minSubArrayLen(s int, a []int) int { n := len(a) diff --git a/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum_test.go b/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum_test.go index ac587ca20..d434f9db3 100755 --- a/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum_test.go +++ b/Algorithms/0209.minimum-size-subarray-sum/minimum-size-subarray-sum_test.go @@ -1,4 +1,4 @@ -package Problem0209 +package problem0209 import ( "fmt" diff --git a/Algorithms/0210.course-schedule-ii/README.md b/Algorithms/0210.course-schedule-ii/README.md new file mode 100755 index 000000000..f0278e97e --- /dev/null +++ b/Algorithms/0210.course-schedule-ii/README.md @@ -0,0 +1,36 @@ +# [210. Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) + +## 题目 +There are a total of n courses you have to take, labeled from 0 to n - 1. + +Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] + + +Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses. + +There may be multiple correct orders, you just need to return one of them. If it is impossible to finish all courses, return an empty array. + + +For example: +``` +2, [[1,0]] +There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1] + +4, [[1,0],[2,0],[3,1],[3,2]] +There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0. So one correct course order is [0,1,2,3]. Another correct ordering is[0,2,1,3]. +``` + +Note: +1. The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented. +1. You may assume that there are no duplicate edges in the input prerequisites. + +click to show more hints. + +Hints: +1. This problem is equivalent to finding the topological order in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses. +1. Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort. +1. Topological sort could also be done via BFS. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0210.course-schedule-ii/course-schedule-ii.go b/Algorithms/0210.course-schedule-ii/course-schedule-ii.go new file mode 100755 index 000000000..33c8c47d2 --- /dev/null +++ b/Algorithms/0210.course-schedule-ii/course-schedule-ii.go @@ -0,0 +1,55 @@ +package problem0210 + +func findOrder(numCourses int, prerequisites [][]int) []int { + n, p := build(numCourses, prerequisites) + return search(n, p) +} + +func build(num int, requires [][]int) (next [][]int, pre []int) { + // next[i][j] : i -> next[i]... ,i 是 next[i] 的先修课 + next = make([][]int, num) + // pres[i] : i 的先修课程的**个数** + pre = make([]int, num) + + for _, r := range requires { + next[r[1]] = append(next[r[1]], r[0]) + pre[r[0]]++ + } + + return +} + +func search(next [][]int, pre []int) []int { + n := len(pre) + res := make([]int, n) + var i, j int + // 第 i 个完成的课程的代号是 j + for i = 0; i < n; i++ { + // 完成首先遇到的,先修课程为 0 的课程 + for j = 0; j < n; j++ { + if pre[j] == 0 { + break + } + } + // 每个课程都需要先修课 + // 出现了环路 + if j == n { + return nil + } + + // 修改 pres[j] 为负数 + // 避免重修 + pre[j] = -1 + + // 完成 j 课程后 + // j 的后续课程的,先修课程数量都可以 -1 + for _, c := range next[j] { + pre[c]-- + } + + // 把课程代号放入答案 + res[i] = j + } + + return res +} diff --git a/Algorithms/0210.course-schedule-ii/course-schedule-ii_test.go b/Algorithms/0210.course-schedule-ii/course-schedule-ii_test.go new file mode 100755 index 000000000..cdf053d47 --- /dev/null +++ b/Algorithms/0210.course-schedule-ii/course-schedule-ii_test.go @@ -0,0 +1,86 @@ +package problem0210 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + numCourses int + prerequisites [][]int + ans []int +}{ + + { + 4, + [][]int{ + []int{1, 0}, + []int{2, 1}, + []int{2, 0}, + []int{3, 0}, + []int{3, 1}, + []int{3, 2}, + }, + []int{0, 1, 2, 3}, + }, + + { + 4, + [][]int{ + []int{1, 0}, + []int{2, 1}, + []int{2, 0}, + []int{3, 0}, + []int{3, 1}, + []int{3, 2}, + []int{2, 3}, + }, + nil, + }, + + { + 2, + [][]int{ + []int{0, 1}, + }, + []int{1, 0}, + }, + + { + 2, + [][]int{ + []int{1, 0}, + }, + []int{0, 1}, + }, + + { + 2, + [][]int{ + []int{1, 0}, + []int{0, 1}, + }, + nil, + }, + // 可以有多个 testcase +} + +func Test_findOrder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findOrder(tc.numCourses, tc.prerequisites), "输入:%v", tc) + } +} + +func Benchmark_findOrder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findOrder(tc.numCourses, tc.prerequisites) + } + } +} diff --git a/Algorithms/0211.add-and-search-word-data-structure-design/README.md b/Algorithms/0211.add-and-search-word-data-structure-design/README.md new file mode 100755 index 000000000..f3c004969 --- /dev/null +++ b/Algorithms/0211.add-and-search-word-data-structure-design/README.md @@ -0,0 +1,31 @@ +# [211. Add and Search Word - Data structure design](https://leetcode.com/problems/add-and-search-word-data-structure-design/) + +## 题目 +Design a data structure that supports the following two operations: +``` +void addWord(word) +bool search(word) +``` +search(word) can search a literal word or a regular expression string containing only letters `a-z` or `.`. A `.` means it can represent any one letter. + +For example: +``` +addWord("bad") +addWord("dad") +addWord("mad") +search("pad") -> false +search("bad") -> true +search(".ad") -> true +search("b..") -> true +``` + +Note: +You may assume that all words are consist of lowercase letters a-z. + +click to show hint. + +You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design.go b/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design.go new file mode 100755 index 000000000..716395399 --- /dev/null +++ b/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design.go @@ -0,0 +1,71 @@ +package problem0211 + +type WordDictionary struct { + sons [26]*WordDictionary + end int +} + +/** Initialize your data structure here. */ +func Constructor() WordDictionary { + return WordDictionary{} +} + +/** Adds a word into the data structure. */ +func (this *WordDictionary) AddWord(word string) { + for _, b := range word { + idx := b - 'a' + if this.sons[idx] == nil { + this.sons[idx] = &WordDictionary{} + } + this = this.sons[idx] + } + + this.end++ +} + +/** Returns if the word is in the data structure. A word could contain the dot character '.' to represent any one letter. */ +func (this *WordDictionary) Search(word string) bool { + for i, b := range word { + if b != '.' { + idx := b - 'a' + if this.sons[idx] == nil { + return false + } + + this = this.sons[idx] + } else { + for _, son := range this.sons { + if son == nil { + continue + } + + this = son + if i == len(word)-1 { + if this.end > 0 { + return true + } + continue + } + + if this.Search(word[i+1:]) { + return true + } + } + + return false + } + } + + if this.end > 0 { + return true + } + + return false +} + +/** + * Your WordDictionary object will be instantiated and called as such: + * obj := Constructor(); + * obj.AddWord(word); + * param_2 := obj.Search(word); + */ diff --git a/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design_test.go b/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design_test.go new file mode 100755 index 000000000..0130e1c81 --- /dev/null +++ b/Algorithms/0211.add-and-search-word-data-structure-design/add-and-search-word-data-structure-design_test.go @@ -0,0 +1,34 @@ +package problem0211 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + d := Constructor() + + ast.False(d.Search("."), "search . from []") + + d.AddWord("bad") + // [bad] + d.AddWord("dad") + // [bad, dad] + d.AddWord("ma") + // [bad, dad, ma] + + ast.False(d.Search("pad"), "search pad from [bad, dad, ma]") + + ast.True(d.Search("bad"), "search bad from [bad, dad, ma]") + + ast.True(d.Search(".ad"), "search .ad from [bad, dad, ma]") + + ast.True(d.Search("b.."), "search b.. from [bad, dad, ma]") + + ast.False(d.Search("."), "search . from [bad, dad, ma]") + + ast.False(d.Search("b"), "search b from [bad, dad, ma]") +} diff --git a/Algorithms/0212.word-search-ii/README.md b/Algorithms/0212.word-search-ii/README.md new file mode 100755 index 000000000..a006dde73 --- /dev/null +++ b/Algorithms/0212.word-search-ii/README.md @@ -0,0 +1,32 @@ +# [212. Word Search II](https://leetcode.com/problems/word-search-ii/) + +## 题目 +Given a 2D board and a list of words from the dictionary, find all words in the board. + +Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once in a word. + +For example, +Given words = `["oath","pea","eat","rain"]` and board = +``` +[ + ['o','a','a','n'], + ['e','t','a','e'], + ['i','h','k','r'], + ['i','f','l','v'] +] +``` + +Return `["eat","oath"]`. + +Note: +You may assume that all inputs are consist of lowercase letters a-z. + +click to show hint. + +You would need to optimize your backtracking to pass the larger test. Could you stop backtracking earlier? + +If the current candidate does not exist in all words' prefix, you could stop backtracking immediately. What kind of data structure could answer such query efficiently? Does a hash table work? Why or why not? How about a Trie? If you would like to learn how to implement a basic trie, please work on this problem: Implement Trie (Prefix Tree) first. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0212.word-search-ii/word-search-ii.go b/Algorithms/0212.word-search-ii/word-search-ii.go new file mode 100755 index 000000000..2044f3065 --- /dev/null +++ b/Algorithms/0212.word-search-ii/word-search-ii.go @@ -0,0 +1,81 @@ +package problem0212 + +func findWords(board [][]byte, words []string) []string { + var results []string + + m := len(board) + if m == 0 { + return results + } + + n := len(board[0]) + if n == 0 { + return results + } + + trie := buildTrie(words) + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + dfs(board, i, j, trie, &results) + } + } + + return results +} + +func dfs(board [][]byte, i int, j int, trie *TrieNode, results *[]string) { + c := board[i][j] + if c == '#' || trie.next[int(c-'a')] == nil { + return + } + + trie = trie.next[int(c-'a')] + if len(trie.word) > 0 { + // Found one + *results = append(*results, trie.word) + trie.word = "" + } + + board[i][j] = '#' + if i > 0 { + dfs(board, i-1, j, trie, results) + } + + if i < len(board)-1 { + dfs(board, i+1, j, trie, results) + } + + if j > 0 { + dfs(board, i, j-1, trie, results) + } + + if j < len(board[0])-1 { + dfs(board, i, j+1, trie, results) + } + + board[i][j] = c +} + +func buildTrie(words []string) *TrieNode { + root := new(TrieNode) + for _, word := range words { + cur := root + for _, c := range word { + cidx := int(c - 'a') + if cur.next[cidx] == nil { + cur.next[cidx] = new(TrieNode) + } + cur = cur.next[cidx] + } + cur.word = word + } + + return root +} + +// TrieNode 是 trie 的节点 +type TrieNode struct { + next [26]*TrieNode + word string +} diff --git a/Algorithms/0212.word-search-ii/word-search-ii_test.go b/Algorithms/0212.word-search-ii/word-search-ii_test.go new file mode 100755 index 000000000..fa5f12009 --- /dev/null +++ b/Algorithms/0212.word-search-ii/word-search-ii_test.go @@ -0,0 +1,68 @@ +package problem0212 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]byte + words []string + ans []string +}{ + + { + [][]byte{ + []byte("a"), + }, + []string{"a", "a"}, + []string{"a"}, + }, + + { + [][]byte{}, + []string{"a", "a"}, + nil, + }, + + { + [][]byte{ + []byte{}, + }, + []string{"a", "a"}, + nil, + }, + + { + [][]byte{ + []byte("oaan"), + []byte("etae"), + []byte("ihkr"), + []byte("iflv"), + }, + []string{"oath", "pea", "eat", "rain", "eakat"}, + []string{"oath", "eat"}, + }, + + // 可以有多个 testcase +} + +func Test_findWords(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findWords(tc.board, tc.words), "输入:%v", tc) + } +} + +func Benchmark_findWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findWords(tc.board, tc.words) + } + } +} diff --git a/Algorithms/0213.house-robber-ii/README.md b/Algorithms/0213.house-robber-ii/README.md new file mode 100755 index 000000000..14674e8d6 --- /dev/null +++ b/Algorithms/0213.house-robber-ii/README.md @@ -0,0 +1,14 @@ +# [213. House Robber II](https://leetcode.com/problems/house-robber-ii/) + +## 题目 +Note: This is an extension of House Robber. + +After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, the security system for these houses remain the same as for those in the previous street. + +Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police. + +Credits:Special thanks to @Freezen for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0213.house-robber-ii/house-robber-ii.go b/Algorithms/0213.house-robber-ii/house-robber-ii.go new file mode 100755 index 000000000..8e547660a --- /dev/null +++ b/Algorithms/0213.house-robber-ii/house-robber-ii.go @@ -0,0 +1,35 @@ +package problem0213 + +func rob(nums []int) int { + size := len(nums) + switch size { + case 0: + return 0 + case 1: + return nums[0] + } + // 把环斩断,就变成了 198 题 + // 斩断的方式分为,在 0 位和不在 0 位 两种。 + return max(robbing(nums[1:]), robbing(nums[:size-1])) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} +func robbing(nums []int) int { + // a 对于偶数位上的最大值的记录 + // b 对于奇数位上的最大值的记录 + var a, b int + for i, v := range nums { + if i%2 == 0 { + a = max(a+v, b) + } else { + b = max(a, b+v) + } + } + + return max(a, b) +} diff --git a/Algorithms/0213.house-robber-ii/house-robber-ii_test.go b/Algorithms/0213.house-robber-ii/house-robber-ii_test.go new file mode 100755 index 000000000..554852fa2 --- /dev/null +++ b/Algorithms/0213.house-robber-ii/house-robber-ii_test.go @@ -0,0 +1,69 @@ +package problem0213 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{226, 174, 214, 16, 218, 48, 153, 131, 128, 17, 157, 142, 88, 43, 37, 157, 43, 221, 191, 68, 206, 23, 225, 82, 54, 118, 111, 46, 80, 49, 245, 63, 25, 194, 72, 80, 143, 55, 209, 18, 55, 122, 65, 66, 177, 101, 63, 201, 172, 130, 103, 225, 142, 46, 86, 185, 62, 138, 212, 192, 125, 77, 223, 188, 99, 228, 90, 25, 193, 211, 84, 239, 119, 234, 85, 83, 123, 120, 131, 203, 219, 10, 82, 35, 120, 180, 249, 106, 37, 169, 225, 54, 103, 55, 166, 124}, + 7102, + }, + + { + []int{100, 1, 1, 100, 1, 1, 100, 1, 1, 100}, + 301, + }, + + { + []int{2, 1, 1, 2}, + 3, + }, + + { + []int{1}, + 1, + }, + + { + []int{}, + 0, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8}, + 20, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 24, + }, + + // 可以有多个 testcase +} + +func Test_rob(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rob(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_rob(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rob(tc.nums) + } + } +} diff --git a/Algorithms/0214.shortest-palindrome/README.md b/Algorithms/0214.shortest-palindrome/README.md new file mode 100755 index 000000000..ef487f516 --- /dev/null +++ b/Algorithms/0214.shortest-palindrome/README.md @@ -0,0 +1,17 @@ +# [214. Shortest Palindrome](https://leetcode.com/problems/shortest-palindrome/) + +## 题目 +Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation. + +For example: +``` +Given "aacecaaa", return "aaacecaaa". +Given "abcd", return "dcbabcd". +``` + +Credits:Special thanks to @ifanchu for adding this problem and creating all test cases. Thanks to @Freezen for additional test cases. + +## 解题思路 +[字符串匹配的KMP算法](http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html) + +见程序注释 diff --git a/Algorithms/0214.shortest-palindrome/shortest-palindrome.go b/Algorithms/0214.shortest-palindrome/shortest-palindrome.go new file mode 100755 index 000000000..39d3c35a5 --- /dev/null +++ b/Algorithms/0214.shortest-palindrome/shortest-palindrome.go @@ -0,0 +1,48 @@ +package problem0214 + +func shortestPalindrome(s string) string { + if len(s) <= 1 { + return s + } + + i := getIndex(s + "#" + reverse(s)) + + return reverse(s[i:]) + s +} + +func reverse(s string) string { + size := len(s) + bytes := make([]byte, size) + for i := 0; i < size; i++ { + bytes[i] = s[size-1-i] + } + + return string(bytes) +} + +func getIndex(s string) int { + size := len(s) + // table[i] 是 s[:i+1] 的前缀集与后缀集中,最长公共元素的长度 + // "abcd" 的前缀集是 ["", "a", "ab", "abc"] + // "abcd" 的后缀集是 ["", "d", "cd", "bcd"] + // "abcd" 的前缀集与后缀集的最长公共元素是"", 它的长度是 0 + table := make([]int, size) + klen, i := 0, 1 + + for i < size { + if s[i] == s[klen] { + klen++ + table[i] = klen + i++ + } else { + if klen == 0 { + table[i] = 0 + i++ + } else { + klen = table[klen-1] + } + } + } + + return table[len(s)-1] +} diff --git a/Algorithms/0214.shortest-palindrome/shortest-palindrome_test.go b/Algorithms/0214.shortest-palindrome/shortest-palindrome_test.go new file mode 100755 index 000000000..0f0412c2c --- /dev/null +++ b/Algorithms/0214.shortest-palindrome/shortest-palindrome_test.go @@ -0,0 +1,59 @@ +package problem0214 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "abaa", + "aabaa", + }, + + { + "a", + "a", + }, + + { + "abcba", + "abcba", + }, + + { + "aacecaaa", + "aaacecaaa", + }, + + { + "abcd", + "dcbabcd", + }, + + // 可以有多个 testcase +} + +func Test_shortestPalindrome(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestPalindrome(tc.s), "输入:%v", tc) + } +} + +func Benchmark_shortestPalindrome(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestPalindrome(tc.s) + } + } +} diff --git a/Algorithms/0215.kth-largest-element-in-an-array/README.md b/Algorithms/0215.kth-largest-element-in-an-array/README.md new file mode 100755 index 000000000..c035530e0 --- /dev/null +++ b/Algorithms/0215.kth-largest-element-in-an-array/README.md @@ -0,0 +1,18 @@ +# [215. Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) + +## 题目 +Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. + +For example, +Given [3,2,1,5,6,4] and k = 2, return 5. + +Note: +You may assume k is always valid, 1 ≤ k ≤ array's length. + +Credits:Special thanks to @mithmatt for adding this problem and creating all test cases. + +## 解题思路 + +利用堆排序的特性,依次找出最大值。 + +见程序注释 diff --git a/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array.go b/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array.go new file mode 100755 index 000000000..8cdfb75c3 --- /dev/null +++ b/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array.go @@ -0,0 +1,46 @@ +package problem0215 + +import "container/heap" + +func findKthLargest(nums []int, k int) int { + temp := highHeap(nums) + h := &temp + heap.Init(h) + + if k == 1 { + return (*h)[0] + } + + for i := 1; i < k; i++ { + heap.Remove(h, 0) + } + + return (*h)[0] +} + +// highHeap 实现了 heap 的接口 +type highHeap []int + +func (h highHeap) Len() int { + return len(h) +} +func (h highHeap) Less(i, j int) bool { + // h[i] > h[j] 使得 h[0] == max(h...) + return h[i] > h[j] +} +func (h highHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} +func (h *highHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *highHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[0 : len(*h)-1] + return res +} diff --git a/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array_test.go b/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array_test.go new file mode 100755 index 000000000..7ad023aea --- /dev/null +++ b/Algorithms/0215.kth-largest-element-in-an-array/kth-largest-element-in-an-array_test.go @@ -0,0 +1,56 @@ +package problem0215 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans int +}{ + + { + []int{3, 3, 3, 3, 3, 3, 3, 3, 3}, + 1, + 3, + }, + + { + []int{3, 2, 1, 5, 6, 4}, + 2, + 5, + }, + + // 可以有多个 testcase +} + +func Test_findKthLargest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findKthLargest(tc.nums, tc.k), "输入:%v", tc) + } +} +func Test_heap(t *testing.T) { + ast := assert.New(t) + + h := new(highHeap) + + i := 5 + h.Push(i) + ast.Equal(i, h.Pop(), "Pop() after Push(%d)", i) + +} +func Benchmark_findKthLargest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findKthLargest(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0216.combination-sum-iii/combination-sum-iii.go b/Algorithms/0216.combination-sum-iii/combination-sum-iii.go index 58b8b451a..aca20f9e2 100755 --- a/Algorithms/0216.combination-sum-iii/combination-sum-iii.go +++ b/Algorithms/0216.combination-sum-iii/combination-sum-iii.go @@ -1,4 +1,4 @@ -package Problem0216 +package problem0216 func combinationSum3(k int, n int) [][]int { res := [][]int{} diff --git a/Algorithms/0216.combination-sum-iii/combination-sum-iii_test.go b/Algorithms/0216.combination-sum-iii/combination-sum-iii_test.go index 23190fac2..bf6169483 100755 --- a/Algorithms/0216.combination-sum-iii/combination-sum-iii_test.go +++ b/Algorithms/0216.combination-sum-iii/combination-sum-iii_test.go @@ -1,4 +1,4 @@ -package Problem0216 +package problem0216 import ( "fmt" diff --git a/Algorithms/0217.contains-duplicate/contains-duplicate.go b/Algorithms/0217.contains-duplicate/contains-duplicate.go index a9acebbc0..11cfc9d25 100755 --- a/Algorithms/0217.contains-duplicate/contains-duplicate.go +++ b/Algorithms/0217.contains-duplicate/contains-duplicate.go @@ -1,4 +1,4 @@ -package Problem0217 +package problem0217 func containsDuplicate(nums []int) bool { // 利用 m 记录 nums 中的元素是否出现过 diff --git a/Algorithms/0217.contains-duplicate/contains-duplicate_test.go b/Algorithms/0217.contains-duplicate/contains-duplicate_test.go index a21ad1cee..322bd9288 100755 --- a/Algorithms/0217.contains-duplicate/contains-duplicate_test.go +++ b/Algorithms/0217.contains-duplicate/contains-duplicate_test.go @@ -1,4 +1,4 @@ -package Problem0217 +package problem0217 import ( "fmt" diff --git a/Algorithms/0218.the-skyline-problem/README.md b/Algorithms/0218.the-skyline-problem/README.md new file mode 100755 index 000000000..5605df309 --- /dev/null +++ b/Algorithms/0218.the-skyline-problem/README.md @@ -0,0 +1,24 @@ +# [218. The Skyline Problem](https://leetcode.com/problems/the-skyline-problem/) + +## 题目 +A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as shown on a cityscape photo (Figure A), write a program to output the skyline formed by these buildings collectively (Figure B). + +![a](a.jpg)![b](b.jpg) + +The geometric information of each building is represented by a triplet of integers [Li, Ri, Hi], where Li and Ri are the x coordinates of the left and right edge of the ith building, respectively, and Hi is its height. It is guaranteed that 0 ≤ Li, Ri ≤ INT_MAX, 0 < Hi ≤ INT_MAX, and Ri - Li > 0. You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0. + +For instance, the dimensions of all buildings in Figure A are recorded as: [ [2 9 10], [3 7 15], [5 12 12], [15 20 10], [19 24 8] ] . + +The output is a list of "key points" (red dots in Figure B) in the format of [ [x1,y1], [x2, y2], [x3, y3], ... ] that uniquely defines a skyline. A key point is the left endpoint of a horizontal line segment. Note that the last key point, where the rightmost building ends, is merely used to mark the termination of the skyline, and always has zero height. Also, the ground in between any two adjacent buildings should be considered part of the skyline contour. + +For instance, the skyline in Figure B should be represented as:[ [2 10], [3 15], [7 12], [12 0], [15 10], [20 8], [24, 0] ]. + +Notes: +- The number of buildings in any input list is guaranteed to be in the range [0, 10000]. +- The input list is already sorted in ascending order by the left x position Li. +- The output list must be sorted by the x position. +- There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...[2 3], [4 5], [7 5], [11 5], [12 7]...] is not acceptable; the three lines of height 5 should be merged into one in the final output as such: [...[2 3], [4 5], [12 7], ...] + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0218.the-skyline-problem/a.jpg b/Algorithms/0218.the-skyline-problem/a.jpg new file mode 100644 index 000000000..21a63ab00 Binary files /dev/null and b/Algorithms/0218.the-skyline-problem/a.jpg differ diff --git a/Algorithms/0218.the-skyline-problem/b.jpg b/Algorithms/0218.the-skyline-problem/b.jpg new file mode 100644 index 000000000..54effe777 Binary files /dev/null and b/Algorithms/0218.the-skyline-problem/b.jpg differ diff --git a/Algorithms/0218.the-skyline-problem/the-skyline-problem.go b/Algorithms/0218.the-skyline-problem/the-skyline-problem.go new file mode 100755 index 000000000..63467929c --- /dev/null +++ b/Algorithms/0218.the-skyline-problem/the-skyline-problem.go @@ -0,0 +1,105 @@ +package problem0218 + +import ( + "container/heap" + "sort" +) + +func getSkyline(buildings [][]int) [][]int { + points := [][]int{} + + highs := new(highHeap) + heap.Init(highs) + // pre 是 天际线 最左边的高度 + pre := 0 + heap.Push(highs, pre) + + edges := make([][3]int, 0, 2*len(buildings)) + for _, b := range buildings { + // e[2] == -1 为 进入边 + edges = append(edges, [3]int{b[0], b[2], -1}) + // e[2] == 1 为 退出边 + edges = append(edges, [3]int{b[1], b[2], 1}) + } + sort.Sort(edgeSlice(edges)) + + // 从左往右,依次扫描 edges + for _, e := range edges { + if e[2] < 0 { + // 遇到 进入边 + // 添加 e[1] 到 high + heap.Push(highs, e[1]) + } else { + // 遇到 退出边 + i := 0 + for i < len(*highs) { + if (*highs)[i] == e[1] { + break + } + i++ + } + // 从 high 中删除 e[1] + heap.Remove(highs, i) + } + // now 是当前的 high 中的最大值 + now := (*highs)[0] + if pre != now { + // 天际线的高度发生变化 + // 需要添加 key point + points = append(points, []int{e[0], now}) + pre = now + } + } + + // 结题的关键是监控 最高线 的变化 + // 出现新的最高线时,就可以添加关键点了 + return points +} + +// highHeap 实现了 heap 的接口 +type highHeap []int + +func (h highHeap) Len() int { + return len(h) +} +func (h highHeap) Less(i, j int) bool { + // h[i] > h[j] 使得 h[0] == max(h...) + return h[i] > h[j] +} +func (h highHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} +func (h *highHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} +func (h *highHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[0 : len(*h)-1] + return res +} + +type edgeSlice [][3]int + +func (es edgeSlice) Len() int { + return len(es) +} +func (es edgeSlice) Less(i, j int) bool { + if es[i][0] != es[j][0] { + return es[i][0] < es[j][0] + } + // 当 es[i][0] == es[j][0] 的时候 + // i,j 分别为 进入边 与 退出边 + // 则,进入边应在前 + // i,j 同为 进入边 + // 则,e[1] 高的在前 + // i,j 同为 退出边 + // 则,e[1] 低的在前 + return es[i][1]*es[i][2] < es[j][1]*es[j][2] +} +func (es edgeSlice) Swap(i, j int) { + es[i], es[j] = es[j], es[i] +} diff --git a/Algorithms/0218.the-skyline-problem/the-skyline-problem_test.go b/Algorithms/0218.the-skyline-problem/the-skyline-problem_test.go new file mode 100755 index 000000000..d53e455e4 --- /dev/null +++ b/Algorithms/0218.the-skyline-problem/the-skyline-problem_test.go @@ -0,0 +1,92 @@ +package problem0218 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + buildings [][]int + ans [][]int +}{ + + { + [][]int{ + []int{2, 9, 10}, + []int{3, 7, 15}, + []int{5, 12, 12}, + []int{15, 20, 10}, + []int{19, 24, 8}, + }, + [][]int{ + []int{2, 10}, + []int{3, 15}, + []int{7, 12}, + []int{12, 0}, + []int{15, 10}, + []int{20, 8}, + []int{24, 0}, + }, + }, + + { + [][]int{ + []int{1, 6, 1}, + []int{2, 3, 2}, + []int{4, 5, 2}, + }, + [][]int{ + []int{1, 1}, + []int{2, 2}, + []int{3, 1}, + []int{4, 2}, + []int{5, 1}, + []int{6, 0}, + }, + }, + + { + [][]int{ + []int{1, 2, 1}, + []int{2, 3, 2}, + }, + [][]int{ + []int{1, 1}, + []int{2, 2}, + []int{3, 0}, + }, + }, + + { + [][]int{ + []int{1, 2, 1}, + []int{1, 2, 2}, + []int{1, 2, 3}, + }, + [][]int{ + []int{1, 3}, + []int{2, 0}, + }, + }, + // 可以有多个 testcase +} + +func Test_getSkyline(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, getSkyline(tc.buildings), "输入:%v", tc) + } +} + +func Benchmark_getSkyline(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + getSkyline(tc.buildings) + } + } +} diff --git a/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii.go b/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii.go index 2582e2454..c8e6f81a5 100755 --- a/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii.go +++ b/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii.go @@ -1,4 +1,4 @@ -package Problem0219 +package problem0219 func containsNearbyDuplicate(nums []int, k int) bool { if k <= 0 { diff --git a/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii_test.go b/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii_test.go index aaf11e059..f7437943a 100755 --- a/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii_test.go +++ b/Algorithms/0219.contains-duplicate-ii/contains-duplicate-ii_test.go @@ -1,4 +1,4 @@ -package Problem0219 +package problem0219 import ( "fmt" diff --git a/Algorithms/0220.contains-duplicate-iii/README.md b/Algorithms/0220.contains-duplicate-iii/README.md new file mode 100755 index 000000000..f4e10e6c9 --- /dev/null +++ b/Algorithms/0220.contains-duplicate-iii/README.md @@ -0,0 +1,10 @@ +# [220. Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) + +## 题目 +Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference between i and j is at most k. + +## 解题思路 +``` +存在 | i - j | <= k 使得 | nums[i] - nums[j] | <= t +``` +见程序注释 diff --git a/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii.go b/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii.go new file mode 100755 index 000000000..aa28d5a58 --- /dev/null +++ b/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii.go @@ -0,0 +1,86 @@ +package problem0220 + +func containsNearbyAlmostDuplicate(nums []int, k, t int) bool { + size := len(nums) + if k == 0 || t < 0 || size <= 1 { + return false + } + // t 可以为 0 + // t 需要当除数 + // t++ 后,避免了除0错误。 + // 但 <=t 变成了 4==t + // 答案是不会 + // 因为程序在遇到 6 之前,就已经因为 3/4 == 0/4 返回 true 了 + nMap[m] = ni + if i >= k { + // 删除需不需要检查的点 + delete(nMap, nums[i-k]/t) + } + } + + return false +} + +func abs(a, b int) int { + if a > b { + return a - b + } + return b - a +} diff --git a/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii_test.go b/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii_test.go new file mode 100755 index 000000000..684ed40a4 --- /dev/null +++ b/Algorithms/0220.contains-duplicate-iii/contains-duplicate-iii_test.go @@ -0,0 +1,106 @@ +package problem0220 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + t int + ans bool +}{ + + { + []int{-1, 3}, + 1, + 3, + false, + }, + + { + []int{3, 0, 6}, + 2, + 3, + true, + }, + + { + []int{2, 1}, + 1, + 1, + true, + }, + + { + []int{7, 2, 8}, + 2, + 1, + true, + }, + + { + []int{7, 1, 3}, + 2, + 3, + true, + }, + + { + []int{2, 2}, + 3, + 0, + true, + }, + + { + []int{2}, + 3, + 0, + false, + }, + + { + []int{2, 4, 3, 8}, + 2, + 1, + true, + }, + + { + []int{-2, 4, -3, 8}, + 2, + 1, + true, + }, + + { + []int{6, 4, 2, 8}, + 1, + 1, + false, + }, + + // 可以有多个 testcase +} + +func Test_containsNearbyAlmostDuplicate(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, containsNearbyAlmostDuplicate(tc.nums, tc.k, tc.t), "输入:%v", tc) + } +} + +func Benchmark_containsNearbyAlmostDuplicate(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + containsNearbyAlmostDuplicate(tc.nums, tc.k, tc.t) + } + } +} diff --git a/Algorithms/0221.maximal-square/README.md b/Algorithms/0221.maximal-square/README.md new file mode 100755 index 000000000..e07d41b3b --- /dev/null +++ b/Algorithms/0221.maximal-square/README.md @@ -0,0 +1,21 @@ +# [221. Maximal Square](https://leetcode.com/problems/maximal-square/) + +## 题目 +Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. + + +For example, given the following matrix: +``` +1 0 1 0 0 +1 0 1 1 1 +1 1 1 1 1 +1 0 0 1 0 +``` +Return 4. + + +Credits:Special thanks to @Freezen for adding this problem and creating all test cases. + +## 解题思路 + +[[解题报告] LeetCode 221. Maximal Square](http://zxi.mytechroad.com/blog/dynamic-programming/leetcode-221-maximal-square/) diff --git a/Algorithms/0221.maximal-square/maximal-square.go b/Algorithms/0221.maximal-square/maximal-square.go new file mode 100755 index 000000000..55d886603 --- /dev/null +++ b/Algorithms/0221.maximal-square/maximal-square.go @@ -0,0 +1,62 @@ +package problem0221 + +func maximalSquare(matrix [][]byte) int { + m := len(matrix) + if m == 0 { + return 0 + } + n := len(matrix[0]) + if n == 0 { + return 0 + } + + maxEdge := 0 + // dp[i][j] == 以 (i,j) 点为右下角点的符合题意的最大正方形的边长 + // TODO: 由于 dp[i][j] 只与上,左上,左的数据有关,可以把 dp 压缩成一维的 + dp := make([][]int, m) + for i := range dp { + dp[i] = make([]int, n) + if matrix[i][0] == '1' { + dp[i][0] = 1 + maxEdge = 1 + } + } + for j := 1; j < n; j++ { + if matrix[0][j] == '1' { + dp[0][j] = 1 + maxEdge = 1 + } + } + + for i := 1; i < m; i++ { + for j := 1; j < n; j++ { + if matrix[i][j] == '1' { + dp[i][j] = 1 + + min( + dp[i-1][j-1], + min( + dp[i-1][j], + dp[i][j-1], + ), + ) + maxEdge = max(maxEdge, dp[i][j]) + } + } + } + + return maxEdge * maxEdge +} + +func min(a int, b int) int { + if a < b { + return a + } + return b +} + +func max(a int, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0221.maximal-square/maximal-square_test.go b/Algorithms/0221.maximal-square/maximal-square_test.go new file mode 100755 index 000000000..62453dc96 --- /dev/null +++ b/Algorithms/0221.maximal-square/maximal-square_test.go @@ -0,0 +1,100 @@ +package problem0221 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]byte + ans int +}{ + + { + [][]byte{ + []byte("01"), + }, + 1, + }, + + { + [][]byte{ + []byte("1"), + }, + 1, + }, + + { + [][]byte{ + []byte("11111111"), + []byte("11111110"), + []byte("11111110"), + []byte("11111000"), + []byte("01111000"), + }, + 16, + }, + { + [][]byte{ + []byte("0001"), + []byte("1101"), + []byte("1111"), + []byte("0111"), + []byte("0111"), + }, + 9, + }, + + { + [][]byte{}, + 0, + }, + + { + [][]byte{ + []byte(""), + }, + 0, + }, + + { + [][]byte{ + []byte("11111"), + []byte("11111"), + []byte("11111"), + }, + 9, + }, + + { + [][]byte{ + []byte("10100"), + []byte("10111"), + []byte("11111"), + []byte("10010"), + }, + 4, + }, + + // 可以有多个 testcase +} + +func Test_maximalSquare(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maximalSquare(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_maximalSquare(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maximalSquare(tc.matrix) + } + } +} diff --git a/Algorithms/0222.count-complete-tree-nodes/README.md b/Algorithms/0222.count-complete-tree-nodes/README.md new file mode 100755 index 000000000..5ec0b0c1b --- /dev/null +++ b/Algorithms/0222.count-complete-tree-nodes/README.md @@ -0,0 +1,22 @@ +# [222. Count Complete Tree Nodes](https://leetcode.com/problems/count-complete-tree-nodes/) + +Given a complete binary tree, count the number of nodes. + +Note: + +Definition of a complete binary tree from [Wikipedia](http://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees): + +In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h. + +Example: + +```text +Input: + 1 + / \ + 2 3 + / \ / +4 5 6 + +Output: 6 +``` diff --git a/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes.go b/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes.go new file mode 100644 index 000000000..23d96fa39 --- /dev/null +++ b/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes.go @@ -0,0 +1,25 @@ +package problem0222 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is predefined in kit +type TreeNode = kit.TreeNode + +func countNodes(root *TreeNode) int { + count := 0 + traverse(root, &count) + return count +} + +func traverse(n *TreeNode, count *int) { + if n == nil { + return + } + + *count++ + + traverse(n.Left, count) + traverse(n.Right, count) +} diff --git a/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes_test.go b/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes_test.go new file mode 100644 index 000000000..f62b90f0c --- /dev/null +++ b/Algorithms/0222.count-complete-tree-nodes/count-complete-tree-nodes_test.go @@ -0,0 +1,43 @@ +package problem0222 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +var questions = []struct { + pre, in []int + count int +}{ + + { + []int{}, + []int{}, + 0, + }, + + { + []int{1, 2, 4, 5, 3, 6}, + []int{4, 2, 5, 1, 6, 3}, + 6, + }, +} + +func Test_countNodes(t *testing.T) { + ast := assert.New(t) + for _, q := range questions { + root := kit.PreIn2Tree(q.pre, q.in) + ast.Equal(q.count, countNodes(root)) + } +} + +func Benchmark_countNodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, q := range questions { + root := kit.PreIn2Tree(q.pre, q.in) + countNodes(root) + } + } +} diff --git a/Algorithms/0223.rectangle-area/223.png b/Algorithms/0223.rectangle-area/223.png new file mode 100644 index 000000000..2fbf05b40 Binary files /dev/null and b/Algorithms/0223.rectangle-area/223.png differ diff --git a/Algorithms/0223.rectangle-area/README.md b/Algorithms/0223.rectangle-area/README.md new file mode 100755 index 000000000..77d982b7d --- /dev/null +++ b/Algorithms/0223.rectangle-area/README.md @@ -0,0 +1,15 @@ +# [223. Rectangle Area](https://leetcode.com/problems/rectangle-area/) + +## 题目 +Find the total area covered by two rectilinear rectangles in a 2D plane. +Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. + +![223](223.png) + +Assume that the total area is never beyond the maximum possible value of int. + +Credits:Special thanks to @mithmatt for adding this problem, creating the above image and all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0223.rectangle-area/rectangle-area.go b/Algorithms/0223.rectangle-area/rectangle-area.go new file mode 100755 index 000000000..369c865e2 --- /dev/null +++ b/Algorithms/0223.rectangle-area/rectangle-area.go @@ -0,0 +1,29 @@ +package problem0223 + +func computeArea(A int, B int, C int, D int, E int, F int, G int, H int) int { + return area(A, B, C, D) + area(E, F, G, H) - area(max(A, E), max(B, F), min(C, G), min(D, H)) +} + +func area(A, B, C, D int) int { + return edge(A, C) * edge(B, D) +} + +func edge(A, C int) int { + // 边长应该大于 0 + // 这样做就统一了两个正方形相交或者不相交的情况 + return max(0, C-A) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0223.rectangle-area/rectangle-area_test.go b/Algorithms/0223.rectangle-area/rectangle-area_test.go new file mode 100755 index 000000000..a5fcc2da9 --- /dev/null +++ b/Algorithms/0223.rectangle-area/rectangle-area_test.go @@ -0,0 +1,65 @@ +package problem0223 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A int + B int + C int + D int + E int + F int + G int + H int + ans int +}{ + + { + -2, + -2, + 2, + 2, + -2, + -2, + 2, + 2, + 16, + }, + + { + -3, + 0, + 3, + 4, + 0, + -1, + 9, + 2, + 45, + }, + + // 可以有多个 testcase +} + +func Test_computeArea(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, computeArea(tc.A, tc.B, tc.C, tc.D, tc.E, tc.F, tc.G, tc.H), "输入:%v", tc) + } +} + +func Benchmark_computeArea(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + computeArea(tc.A, tc.B, tc.C, tc.D, tc.E, tc.F, tc.G, tc.H) + } + } +} diff --git a/Algorithms/0224.basic-calculator/README.md b/Algorithms/0224.basic-calculator/README.md new file mode 100755 index 000000000..b26e4ea5c --- /dev/null +++ b/Algorithms/0224.basic-calculator/README.md @@ -0,0 +1,21 @@ +# [224. Basic Calculator](https://leetcode.com/problems/basic-calculator/) + +## 题目 +Implement a basic calculator to evaluate a simple expression string. + +The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty spaces . + +You may assume that the given expression is always valid. + +Some examples: +``` +"1 + 1" = 2 +" 2-1 + 2 " = 3 +"(1+(4+5+2)-3)+(6+8)" = 23 +``` + +Note: Do not use the eval built-in library function. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0224.basic-calculator/basic-calculator.go b/Algorithms/0224.basic-calculator/basic-calculator.go new file mode 100755 index 000000000..c612b32c1 --- /dev/null +++ b/Algorithms/0224.basic-calculator/basic-calculator.go @@ -0,0 +1,48 @@ +package problem0224 + +func calculate(s string) int { + res := 0 + stack := make([]int, 0, len(s)) + sign := 1 + num := 0 + + for i := 0; i < len(s); i++ { + switch s[i] { + case '1', '2', '3', '4', '5', '6', '7', '8', '9', '0': + // 提取 s 中的数字 + num = 0 + for ; i < len(s) && s[i] >= '0' && s[i] <= '9'; i++ { + num = 10*num + int(s[i]-'0') + } + // 根据前面的记录,进行运算 + res += sign * num + // 此时 s[i] 已经不是数字了 + // for 语句中,会再+1,所以这里先 -1 + i-- + case '+': + // 记录运算符 + sign = 1 + case '-': + // 记录运算符 + sign = -1 + case '(': + // 遇到 '(' 就把当前的 res 和 sign 入栈,保存好当前的运行环境 + stack = append(stack, res, sign) + // 对 res 和 sign 赋予新的值 + res = 0 + sign = 1 + case ')': + // 遇到 ')' 出栈 + // sign 是与这个 ')' 匹配的 '(' 前的运算符号 + sign = stack[len(stack)-1] + // temp 是 sign 前的运算结果 + temp := stack[len(stack)-2] + stack = stack[:len(stack)-2] + // '(' 与 ')' 之间的运算结果 + // ↓ + res = sign*res + temp + } + } + + return res +} diff --git a/Algorithms/0224.basic-calculator/basic-calculator_test.go b/Algorithms/0224.basic-calculator/basic-calculator_test.go new file mode 100755 index 000000000..cec911679 --- /dev/null +++ b/Algorithms/0224.basic-calculator/basic-calculator_test.go @@ -0,0 +1,59 @@ +package problem0224 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "42-(18+16)", + 8, + }, + + { + "1 + 1", + 2, + }, + + { + " 2-1 + 2 ", + 3, + }, + + { + "(1+(4+5+2)-3)+(6+8)", + 23, + }, + + { + "2147483647", + 2147483647, + }, + + // 可以有多个 testcase +} + +func Test_calculate(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, calculate(tc.s), "输入:%v", tc) + } +} + +func Benchmark_calculate(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + calculate(tc.s) + } + } +} diff --git a/Algorithms/0225.implement-stack-using-queues/README.md b/Algorithms/0225.implement-stack-using-queues/README.md new file mode 100755 index 000000000..cc07f03fa --- /dev/null +++ b/Algorithms/0225.implement-stack-using-queues/README.md @@ -0,0 +1,22 @@ +# [225. Implement Stack using Queues](https://leetcode.com/problems/implement-stack-using-queues/) + +## 题目 + +Implement the following operations of a stack using queues. + +- push(x) -- Push element x onto stack. +- pop() -- Removes the element on top of the stack. +- top() -- Get the top element. +- empty() -- Return whether the stack is empty. + +Notes: + +1. You must use only standard operations of a queue -- which means only push to back, peek/pop from front, size, and is empty operations are valid. +1. Depending on your language, queue may not be supported natively. You may simulate a queue by using a list or deque (double-ended queue), as long as you use only standard operations of a queue. +1. You may assume that all operations are valid (for example, no pop or top operations will be called on an empty stack). + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues.go b/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues.go new file mode 100755 index 000000000..b816c2551 --- /dev/null +++ b/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues.go @@ -0,0 +1,85 @@ +package problem0225 + +// MyStack 是用 Queue 实现的 栈 +type MyStack struct { + a, b *Queue +} + +// Constructor Initialize your data structure here. +func Constructor() MyStack { + return MyStack{a: NewQueue(), b: NewQueue()} +} + +// Push Push element x onto stack. +func (ms *MyStack) Push(x int) { + if ms.a.Len() == 0 { + ms.a, ms.b = ms.b, ms.a + } + ms.a.Push(x) +} + +// Pop Removes the element on top of the stack and returns that element. +func (ms *MyStack) Pop() int { + if ms.a.Len() == 0 { + ms.a, ms.b = ms.b, ms.a + } + + for ms.a.Len() > 1 { + ms.b.Push(ms.a.Pop()) + } + + return ms.a.Pop() +} + +// Top Get the top element. +func (ms *MyStack) Top() int { + res := ms.Pop() + ms.Push(res) + return res +} + +// Empty Returns whether the stack is empty. +func (ms *MyStack) Empty() bool { + return (ms.a.Len() + ms.b.Len()) == 0 +} + +/** + * Your MyStack object will be instantiated and called as such: + * obj := Constructor(); + * obj.Push(x); + * param_2 := obj.Pop(); + * param_3 := obj.Top(); + * param_4 := obj.Empty(); + */ + +// Queue 是用于存放 int 的队列 +type Queue struct { + nums []int +} + +// NewQueue 返回 *kit.Queue +func NewQueue() *Queue { + return &Queue{nums: []int{}} +} + +// Push 把 n 放入队列 +func (q *Queue) Push(n int) { + q.nums = append(q.nums, n) +} + +// Pop 从 q 中取出最先进入队列的值 +func (q *Queue) Pop() int { + res := q.nums[0] + q.nums = q.nums[1:] + return res +} + +// Len 返回 q 的长度 +func (q *Queue) Len() int { + return len(q.nums) +} + +// IsEmpty 反馈 q 是否为空 +func (q *Queue) IsEmpty() bool { + return q.Len() == 0 +} diff --git a/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues_test.go b/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues_test.go new file mode 100755 index 000000000..d901276a4 --- /dev/null +++ b/Algorithms/0225.implement-stack-using-queues/implement-stack-using-queues_test.go @@ -0,0 +1,47 @@ +package problem0225 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MyStack(t *testing.T) { + ast := assert.New(t) + + s := Constructor() + ast.True(s.Empty(), "检查新建的 s 是否为空") + + start, end := 0, 10 + + for i := start; i < end; i++ { + s.Push(i) + ast.Equal(i, s.Top(), "查看 s.Top()") + } + + for i := end - 1; i >= start; i-- { + ast.Equal(i, s.Pop(), "从 s 中 pop 出数来。") + } + + ast.True(s.Empty(), "检查 Pop 完毕后的 s 是否为空") +} + +func Test_Queue(t *testing.T) { + ast := assert.New(t) + + q := NewQueue() + ast.True(q.IsEmpty(), "检查新建的 q 是否为空") + + start, end := 0, 100 + + for i := start; i < end; i++ { + q.Push(i) + ast.Equal(i-start+1, q.Len(), "Push 后检查 q 的长度。") + } + + for i := start; i < end; i++ { + ast.Equal(i, q.Pop(), "从 q 中 pop 出数来。") + } + + ast.True(q.IsEmpty(), "检查 Pop 完毕后的 q 是否为空") +} diff --git a/Algorithms/0226.invert-binary-tree/README.md b/Algorithms/0226.invert-binary-tree/README.md new file mode 100755 index 000000000..841e2eaf3 --- /dev/null +++ b/Algorithms/0226.invert-binary-tree/README.md @@ -0,0 +1,27 @@ +# [226. Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/) + +## 题目 + +Invert a binary tree. + +```text + 4 + / \ + 2 7 + / \ / \ +1 3 6 9 +``` + +to + +```text + 4 + / \ + 7 2 + / \ / \ +9 6 3 1 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0226.invert-binary-tree/invert-binary-tree.go b/Algorithms/0226.invert-binary-tree/invert-binary-tree.go new file mode 100755 index 000000000..6e437d763 --- /dev/null +++ b/Algorithms/0226.invert-binary-tree/invert-binary-tree.go @@ -0,0 +1,18 @@ +package problem0226 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func invertTree(root *TreeNode) *TreeNode { + if root == nil || + (root.Left == nil && root.Right == nil) { + return root + } + + root.Left, root.Right = invertTree(root.Right), invertTree(root.Left) + + return root +} diff --git a/Algorithms/0226.invert-binary-tree/invert-binary-tree_test.go b/Algorithms/0226.invert-binary-tree/invert-binary-tree_test.go new file mode 100755 index 000000000..246681996 --- /dev/null +++ b/Algorithms/0226.invert-binary-tree/invert-binary-tree_test.go @@ -0,0 +1,36 @@ +package problem0226 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []int // inorder +}{ + + { + []int{4, 2, 1, 3, 7, 6, 9}, + []int{1, 2, 3, 4, 6, 7, 9}, + []int{9, 7, 6, 4, 3, 2, 1}, + }, + + // 可以有多个 testcase +} + +func Test_invertTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ans := invertTree(root) + ast.Equal(tc.ans, kit.Tree2Inorder(ans), "输入:%v", tc) + } +} diff --git a/Algorithms/0227.basic-calculator-ii/227.100.png b/Algorithms/0227.basic-calculator-ii/227.100.png new file mode 100644 index 000000000..d93793cd2 Binary files /dev/null and b/Algorithms/0227.basic-calculator-ii/227.100.png differ diff --git a/Algorithms/0227.basic-calculator-ii/README.md b/Algorithms/0227.basic-calculator-ii/README.md new file mode 100755 index 000000000..7c9c6e46c --- /dev/null +++ b/Algorithms/0227.basic-calculator-ii/README.md @@ -0,0 +1,23 @@ +# [227. Basic Calculator II](https://leetcode.com/problems/basic-calculator-ii/) + +## 题目 +Implement a basic calculator to evaluate a simple expression string. + +The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should truncate toward zero. + +You may assume that the given expression is always valid. + +Some examples: +``` +"3+2*2" = 7 +" 3/2 " = 1 +" 3+5 / 2 " = 5 +``` + +Note: Do not use the eval built-in library function. + +## 解题思路 + +见程序注释 + +![100](227.100.png) \ No newline at end of file diff --git a/Algorithms/0227.basic-calculator-ii/basic-calculator-ii.go b/Algorithms/0227.basic-calculator-ii/basic-calculator-ii.go new file mode 100755 index 000000000..d9193f647 --- /dev/null +++ b/Algorithms/0227.basic-calculator-ii/basic-calculator-ii.go @@ -0,0 +1,72 @@ +package problem0227 + +func calculate(s string) int { + // n1 opt1 n2 opt2 n3 + // ↓ ↓ ↓ ↓ ↓ + // 1 + 2 * 3 + var n1, n2, n3 int + var opt1, opt2 byte + opt1 = '+' + + idx := 0 + nextN := func() int { + n := 0 + // 跳过空格 + for idx < len(s) && s[idx] == ' ' { + idx++ + } + // 获取数值 + for idx < len(s) && '0' <= s[idx] && s[idx] <= '9' { + n = n*10 + int(s[idx]-'0') + idx++ + } + return n + } + + nextOpt := func() byte { + // opt 默认为 +,与 nextN() 的默认值为 0 配合 + // 当 s 的结尾为 空格 的时候,程序会进行一次 +0 的运算,但这不会影响结果。 + opt := byte('+') + // 跳过空格 + for idx < len(s) && s[idx] == ' ' { + idx++ + } + // 获取操作符 + if idx < len(s) { + opt = s[idx] + idx++ + } + return opt + } + + n2 = nextN() + for idx < len(s) { + opt2 = nextOpt() + n3 = nextN() + + if opt2 == '*' || opt2 == '/' { + // 先乘除 + n2 = operate(n2, n3, opt2) + } else { + // 后加减 + n1 = operate(n1, n2, opt1) + opt1 = opt2 + n2 = n3 + } + } + + return operate(n1, n2, opt1) +} + +func operate(a, b int, opt byte) int { + switch opt { + case '+': + return a + b + case '-': + return a - b + case '*': + return a * b + default: // '/' + return a / b + } +} diff --git a/Algorithms/0227.basic-calculator-ii/basic-calculator-ii_test.go b/Algorithms/0227.basic-calculator-ii/basic-calculator-ii_test.go new file mode 100755 index 000000000..58beb2c7e --- /dev/null +++ b/Algorithms/0227.basic-calculator-ii/basic-calculator-ii_test.go @@ -0,0 +1,49 @@ +package problem0227 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + " 3/2 ", + 1, + }, + + { + " 3+5 / 2 ", + 5, + }, + + { + "3- 2*2", + -1, + }, + + // 可以有多个 testcase +} + +func Test_calculate(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, calculate(tc.s), "输入:%v", tc) + } +} + +func Benchmark_calculate(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + calculate(tc.s) + } + } +} diff --git a/Algorithms/0228.summary-ranges/summary-ranges.go b/Algorithms/0228.summary-ranges/summary-ranges.go index d55490927..5be24e3d9 100755 --- a/Algorithms/0228.summary-ranges/summary-ranges.go +++ b/Algorithms/0228.summary-ranges/summary-ranges.go @@ -1,4 +1,4 @@ -package Problem0228 +package problem0228 import ( "fmt" diff --git a/Algorithms/0228.summary-ranges/summary-ranges_test.go b/Algorithms/0228.summary-ranges/summary-ranges_test.go index 77ef7cd9e..f6a9d4624 100755 --- a/Algorithms/0228.summary-ranges/summary-ranges_test.go +++ b/Algorithms/0228.summary-ranges/summary-ranges_test.go @@ -1,4 +1,4 @@ -package Problem0228 +package problem0228 import ( "fmt" diff --git a/Algorithms/0229.majority-element-ii/majority-element-ii.go b/Algorithms/0229.majority-element-ii/majority-element-ii.go index e3f80de23..398a213e0 100755 --- a/Algorithms/0229.majority-element-ii/majority-element-ii.go +++ b/Algorithms/0229.majority-element-ii/majority-element-ii.go @@ -1,4 +1,4 @@ -package Problem0229 +package problem0229 func majorityElement(a []int) []int { if len(a) <= 1 { diff --git a/Algorithms/0229.majority-element-ii/majority-element-ii_test.go b/Algorithms/0229.majority-element-ii/majority-element-ii_test.go index 8422003e6..7af20f3ae 100755 --- a/Algorithms/0229.majority-element-ii/majority-element-ii_test.go +++ b/Algorithms/0229.majority-element-ii/majority-element-ii_test.go @@ -1,4 +1,4 @@ -package Problem0229 +package problem0229 import ( "fmt" diff --git a/Algorithms/0230.kth-smallest-element-in-a-bst/README.md b/Algorithms/0230.kth-smallest-element-in-a-bst/README.md new file mode 100755 index 000000000..936f2daf8 --- /dev/null +++ b/Algorithms/0230.kth-smallest-element-in-a-bst/README.md @@ -0,0 +1,19 @@ +# [230. Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) + +## 题目 +Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. + +Note: +You may assume k is always valid, 1 ≤ k ≤ BST's total elements. + +Follow up: +What if the BST is modified (insert/delete operations) often and you need to find the kth smallest frequently? How would you optimize the kthSmallest routine? + +## 解题思路 +以下是[BST](https://zh.wikipedia.org/zh-cn/%E4%BA%8C%E5%85%83%E6%90%9C%E5%B0%8B%E6%A8%B9)的性质: +1. 若任意节点的左子树不空,则左子树上所有节点的值均小于它的根节点的值; +1. 若任意节点的右子树不空,则右子树上所有节点的值均大于它的根节点的值; +1. 任意节点的左、右子树也分别为二叉查找树; +1. 没有键值相等的节点。 + +见程序注释 diff --git a/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.go b/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.go new file mode 100755 index 000000000..cd3b62926 --- /dev/null +++ b/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.go @@ -0,0 +1,30 @@ +package problem0230 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func kthSmallest(root *TreeNode, k int) int { + leftSize := getSize(root.Left) + switch { + case k <= leftSize: + // 答案存在于 root.Left 中 + return kthSmallest(root.Left, k) + case leftSize+1 < k: + // 答案存在于 root.Right 中 + return kthSmallest(root.Right, k-leftSize-1) + default: + // 答案是 root.Val + return root.Val + } +} + +// 获取 root 树的节点数量 +func getSize(root *TreeNode) int { + if root == nil { + return 0 + } + return 1 + getSize(root.Left) + getSize(root.Right) +} diff --git a/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst_test.go b/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst_test.go new file mode 100755 index 000000000..d914cd052 --- /dev/null +++ b/Algorithms/0230.kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst_test.go @@ -0,0 +1,67 @@ +package problem0230 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + k int + ans int +}{ + + { + []int{1, 2}, + []int{1, 2}, + 2, + 2, + }, + + { + []int{2, 1, 3}, + []int{1, 2, 3}, + 1, + 1, + }, + + { + []int{2, 1, 3}, + []int{1, 2, 3}, + 2, + 2, + }, + + { + []int{2, 1, 3}, + []int{1, 2, 3}, + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_kthSmallest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, kthSmallest(root, tc.k), "输入:%v", tc) + } +} + +func Benchmark_kthSmallest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + kthSmallest(root, tc.k) + } + } +} diff --git a/Algorithms/0231.power-of-two/README.md b/Algorithms/0231.power-of-two/README.md new file mode 100755 index 000000000..fea858c8e --- /dev/null +++ b/Algorithms/0231.power-of-two/README.md @@ -0,0 +1,11 @@ +# [231. Power of Two](https://leetcode.com/problems/power-of-two/) + +## 题目 + +Given an integer, write a function to determine if it is a power of two. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0231.power-of-two/power-of-two.go b/Algorithms/0231.power-of-two/power-of-two.go new file mode 100755 index 000000000..068a9c4fe --- /dev/null +++ b/Algorithms/0231.power-of-two/power-of-two.go @@ -0,0 +1,16 @@ +package problem0231 + +func isPowerOfTwo(n int) bool { + if n < 1 { + return false + } + + for n > 1 { + if n%2 == 1 { + return false + } + n /= 2 + } + + return true +} diff --git a/Algorithms/0231.power-of-two/power-of-two_test.go b/Algorithms/0231.power-of-two/power-of-two_test.go new file mode 100755 index 000000000..20fc7ce49 --- /dev/null +++ b/Algorithms/0231.power-of-two/power-of-two_test.go @@ -0,0 +1,39 @@ +package problem0231 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans bool +}{ + + {1, true}, + {2, true}, + {3, false}, + {-1, false}, + + // 可以有多个 testcase +} + +func Test_isPowerOfTwo(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isPowerOfTwo(tc.n), "输入:%v", tc) + } +} + +func Benchmark_isPowerOfTwo(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isPowerOfTwo(tc.n) + } + } +} diff --git a/Algorithms/0232.implement-queue-using-stacks/README.md b/Algorithms/0232.implement-queue-using-stacks/README.md new file mode 100755 index 000000000..2986f99e0 --- /dev/null +++ b/Algorithms/0232.implement-queue-using-stacks/README.md @@ -0,0 +1,28 @@ +# [232. Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/) + +## 题目 + +Implement the following operations of a queue using stacks. + +- push(x) -- Push element x to the back of queue. +- pop() -- Removes the element from in front of queue. +- peek() -- Get the front element. +- empty() -- Return whether the queue is empty. + +Example: + +```text +MyQueue queue = new MyQueue(); + +queue.push(1); +queue.push(2); +queue.peek(); // returns 1 +queue.pop(); // returns 1 +queue.empty(); // returns false +``` + +Notes: + +- You must use only standard operations of a stack -- which means only push to top, peek/pop from top, size, and is empty operations are valid. +- Depending on your language, stack may not be supported natively. You may simulate a stack by using a list or deque (double-ended queue), as long as you use only standard operations of a stack. +- You may assume that all operations are valid (for example, no pop or peek operations will be called on an empty queue). \ No newline at end of file diff --git a/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks.go b/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks.go new file mode 100755 index 000000000..7412fc49c --- /dev/null +++ b/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks.go @@ -0,0 +1,40 @@ +package problem0232 + +import "container/list" + +// MyQueue 是利用 list 实现的队列 +type MyQueue struct { + list *list.List +} + +// Constructor Initialize your data structure here. +func Constructor() MyQueue { + return MyQueue{ + list: list.New(), + } +} + +// Push element x to the back of queue. +func (q *MyQueue) Push(x int) { + q.list.PushBack(x) +} + +// Pop Removes the element from in front of queue and returns that element. +func (q *MyQueue) Pop() int { + front := q.list.Front() + res := front.Value.(int) + q.list.Remove(front) + return res +} + +// Peek Get the front element. +func (q *MyQueue) Peek() int { + front := q.list.Front() + res := front.Value.(int) + return res +} + +// Empty returns whether the queue is empty. +func (q *MyQueue) Empty() bool { + return q.list.Len() == 0 +} diff --git a/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks_test.go b/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks_test.go new file mode 100755 index 000000000..15b3a8e8c --- /dev/null +++ b/Algorithms/0232.implement-queue-using-stacks/implement-queue-using-stacks_test.go @@ -0,0 +1,25 @@ +package problem0232 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MyQueue(t *testing.T) { + ast := assert.New(t) + + q := Constructor() + ast.True(q.Empty(), "检查新建的 q 是否为空") + + start, end := 0, 3 + + for i := start; i < end; i++ { + q.Push(i) + ast.Equal(start, q.Peek(), "查看 q.Peek()") + } + + for i := start; i < end; i++ { + ast.Equal(i, q.Pop(), "从 q 中 pop 出数来。") + } +} diff --git a/Algorithms/0233.number-of-digit-one/README.md b/Algorithms/0233.number-of-digit-one/README.md new file mode 100755 index 000000000..8662c8782 --- /dev/null +++ b/Algorithms/0233.number-of-digit-one/README.md @@ -0,0 +1,22 @@ +# [233. Number of Digit One](https://leetcode.com/problems/number-of-digit-one/) + +## 题目 +Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. + +For example: +``` +Given n = 13, +Return 6, because digit 1 occurred in the following numbers: 1, 10, 11, 12, 13. +``` + +## 解题思路 + +以算百位上1为例子: 假设百位上是0, 1, 和 >=2 三种情况: +1. n=41092, m=100, a=n/m=410, b=n%m=92. 计算百位上1的个数应该为 41 *100 次. +1. n=41192, m=100, a=n/m=411, b=n%m=92. 计算百位上1的个数应该为 41 *100 + (92+1) 次. +1. n=41592, m=100, a=n/m=415, b=n%m=92. 计算百位上1的个数应该为 (41+1) *100 次. +以上三种情况可以用 一个公式概括: +``` +(a + 8) / 10 * m + (a % 10 == 1) * (b + 1); +``` +见程序注释 diff --git a/Algorithms/0233.number-of-digit-one/number-of-digit-one.go b/Algorithms/0233.number-of-digit-one/number-of-digit-one.go new file mode 100755 index 000000000..b2001753f --- /dev/null +++ b/Algorithms/0233.number-of-digit-one/number-of-digit-one.go @@ -0,0 +1,15 @@ +package problem0233 + +func countDigitOne(n int) int { + var a, b, ones int + m := 1 + for m <= n { + a, b = n/m, n%m + ones += (a + 8) / 10 * m + if a%10 == 1 { + ones += b + 1 + } + m *= 10 + } + return ones +} diff --git a/Algorithms/0233.number-of-digit-one/number-of-digit-one_test.go b/Algorithms/0233.number-of-digit-one/number-of-digit-one_test.go new file mode 100755 index 000000000..cca25dbcb --- /dev/null +++ b/Algorithms/0233.number-of-digit-one/number-of-digit-one_test.go @@ -0,0 +1,54 @@ +package problem0233 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 13, + 6, + }, + + { + 111, + 36, + }, + + { + 123456, + 93553, + }, + + { + 12345678, + 11824417, + }, + + // 可以有多个 testcase +} + +func Test_countDigitOne(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countDigitOne(tc.n), "输入:%v", tc) + } +} + +func Benchmark_countDigitOne(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countDigitOne(tc.n) + } + } +} diff --git a/Algorithms/0234.palindrome-linked-list/README.md b/Algorithms/0234.palindrome-linked-list/README.md new file mode 100755 index 000000000..304166079 --- /dev/null +++ b/Algorithms/0234.palindrome-linked-list/README.md @@ -0,0 +1,12 @@ +# [234. Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/) + +## 题目 + +Given a singly linked list, determine if it is a palindrome. + +Follow up: +Could you do it in O(n) time and O(1) space? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0234.palindrome-linked-list/palindrome-linked-list.go b/Algorithms/0234.palindrome-linked-list/palindrome-linked-list.go new file mode 100755 index 000000000..51ac97a2c --- /dev/null +++ b/Algorithms/0234.palindrome-linked-list/palindrome-linked-list.go @@ -0,0 +1,27 @@ +package problem0234 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func isPalindrome(head *ListNode) bool { + // 获取 list 中的值 + nums := make([]int, 0, 64) + for head != nil { + nums = append(nums, head.Val) + head = head.Next + } + + // 按照规则对比值 + l, r := 0, len(nums)-1 + for l < r { + if nums[l] != nums[r] { + return false + } + l++ + r-- + } + return true +} \ No newline at end of file diff --git a/Algorithms/0234.palindrome-linked-list/palindrome-linked-list_test.go b/Algorithms/0234.palindrome-linked-list/palindrome-linked-list_test.go new file mode 100755 index 000000000..8aa9ddac1 --- /dev/null +++ b/Algorithms/0234.palindrome-linked-list/palindrome-linked-list_test.go @@ -0,0 +1,41 @@ +package problem0234 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + {[]int{1, 2, 3, 2, 1}, true}, + {[]int{1, 3, 2, 1}, false}, + + // 可以有多个 testcase +} + +func Test_isPalindrome(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.nums) + ast.Equal(tc.ans, isPalindrome(head), "输入:%v", tc) + } +} + +func Benchmark_isPalindrome(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.nums) + isPalindrome(head) + } + } +} diff --git a/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/235.png b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/235.png new file mode 100644 index 000000000..2035831d0 Binary files /dev/null and b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/235.png differ diff --git a/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/README.md b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/README.md new file mode 100644 index 000000000..d3dc3e399 --- /dev/null +++ b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/README.md @@ -0,0 +1,30 @@ +# [235. Lowest Common Ancestor of a Binary Search Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) + +Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. + +According to [the definition of LCA on Wikipedia](https://en.wikipedia.org/wiki/Lowest_common_ancestor): “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” + +Given binary search tree: root = [6,2,8,0,4,7,9,null,null,3,5] + +![235](235.png) + +Example 1: + +```text +Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8 +Output: 6 +Explanation: The LCA of nodes 2 and 8 is 6. +``` + +Example 2: + +```text +Input: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 4 +Output: 2 +Explanation: The LCA of nodes 2 and 4 is 2, since a node can be a descendant of itself according to the LCA definition. +``` + +Note: + +- All of the nodes' values will be unique. +- p and q are different and both values will exist in the BST. \ No newline at end of file diff --git a/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.go b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.go new file mode 100644 index 000000000..c33715502 --- /dev/null +++ b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.go @@ -0,0 +1,20 @@ +package problem0235 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined.. +type TreeNode = kit.TreeNode + +func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode { + return helper(root, p.Val, q.Val) +} + +func helper(root *TreeNode, p, q int) *TreeNode { + r := root.Val + if p < r && q < r { + return helper(root.Left, p, q) + } else if r < p && r < q { + return helper(root.Right, p, q) + } + return root +} diff --git a/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree_test.go b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree_test.go new file mode 100644 index 000000000..dae2d1174 --- /dev/null +++ b/Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree_test.go @@ -0,0 +1,70 @@ +package problem0235 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +var questions = []struct { + pre, in []int + p, q, ans int +}{ + { + []int{6, 2, 0, 4, 3, 5, 8, 7, 9}, + []int{0, 2, 3, 4, 5, 6, 7, 8, 9}, + 2, + 8, + 6, + }, + + { + []int{6, 2, 0, 4, 3, 5, 8, 7, 9}, + []int{0, 2, 3, 4, 5, 6, 7, 8, 9}, + 2, + 4, + 2, + }, + + { + []int{6, 2, 0, 4, 3, 5, 8, 7, 9}, + []int{0, 2, 3, 4, 5, 6, 7, 8, 9}, + 7, + 9, + 8, + }, +} + +func Test_lowestCommonAncestor(t *testing.T) { + ast := assert.New(t) + for _, que := range questions { + root := kit.PreIn2Tree(que.pre, que.in) + + p := &TreeNode{ + Val: que.p, + } + + q := &TreeNode{ + Val: que.q, + } + + node := lowestCommonAncestor(root, p, q) + ast.Equal(que.ans, node.Val) + } +} + +func Benchmark_lowestCommonAncestor(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, que := range questions { + root := kit.PreIn2Tree(que.pre, que.in) + p := &TreeNode{ + Val: que.p, + } + q := &TreeNode{ + Val: que.q, + } + lowestCommonAncestor(root, p, q) + } + } +} diff --git a/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/236.png b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/236.png new file mode 100644 index 000000000..04be42ec2 Binary files /dev/null and b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/236.png differ diff --git a/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/README.md b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/README.md new file mode 100755 index 000000000..9aef441bf --- /dev/null +++ b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/README.md @@ -0,0 +1,30 @@ +# [236. Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/) + +Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. + +According to [the definition of LCA on Wikipedia](https://en.wikipedia.org/wiki/Lowest_common_ancestor): “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” + +Given the following binary tree: root = [3,5,1,6,2,0,8,null,null,7,4] + +![236](236.png) + +Example 1: + +```text +Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1 +Output: 3 +Explanation: The LCA of nodes 5 and 1 is 3. +``` + +Example 2: + +```text +Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4 +Output: 5 +Explanation: The LCA of nodes 5 and 4 is 5, since a node can be a descendant of itself according to the LCA definition. +``` + +Note: + +- All of the nodes' values will be unique. +- p and q are different and both values will exist in the binary tree. \ No newline at end of file diff --git a/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.go b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.go new file mode 100644 index 000000000..b31387457 --- /dev/null +++ b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.go @@ -0,0 +1,35 @@ +package problem0236 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +// NOTICE: 此解法的时间复杂度是 O(n) + +func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode { + if root == nil || + root == p || + root == q { + return root + } + + l := lowestCommonAncestor(root.Left, p, q) + r := lowestCommonAncestor(root.Right, p, q) + + // l=nil 意味着, p 和 q 都 **不在** root.Left 中 + // r=nil 同理。 + // 所以,根据题意, l 和 r 不可能同时为 nil + if l != nil && r != nil { + // 此时 p 和 q 分别在 root.Left 和 root.Right 中 + return root + } + if l == nil { + // 此时 p 和 q 在 root.Right 中 + return r + } + // 此时 p 和 q 在 root.Left 中 + return l +} diff --git a/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree_test.go b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree_test.go new file mode 100644 index 000000000..85a701a6f --- /dev/null +++ b/Algorithms/0236.lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree_test.go @@ -0,0 +1,58 @@ +package problem0236 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +var root = kit.Ints2TreeNode([]int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}) + +var tcs = []struct { + p, q, ans *TreeNode +}{ + + { + kit.GetTargetNode(root, 5), + kit.GetTargetNode(root, 1), + kit.GetTargetNode(root, 3), + }, + + { + kit.GetTargetNode(root, 4), + kit.GetTargetNode(root, 7), + kit.GetTargetNode(root, 2), + }, + + { + kit.GetTargetNode(root, 4), + kit.GetTargetNode(root, 5), + kit.GetTargetNode(root, 5), + }, + + { + kit.GetTargetNode(root, 5), + kit.GetTargetNode(root, 4), + kit.GetTargetNode(root, 5), + }, + + // +} + +func Test_lowestCommonAncestor(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + node := lowestCommonAncestor(root, tc.p, tc.q) + ast.Equal(tc.ans, node, "p=%d,q=%d", tc.p.Val, tc.q.Val) + } +} + +func Benchmark_lowestCommonAncestor(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lowestCommonAncestor(root, tc.p, tc.q) + } + } +} diff --git a/Algorithms/0237.delete-node-in-a-linked-list/237.png b/Algorithms/0237.delete-node-in-a-linked-list/237.png new file mode 100644 index 000000000..bc4d4ffa3 Binary files /dev/null and b/Algorithms/0237.delete-node-in-a-linked-list/237.png differ diff --git a/Algorithms/0237.delete-node-in-a-linked-list/README.md b/Algorithms/0237.delete-node-in-a-linked-list/README.md new file mode 100755 index 000000000..ff051f06c --- /dev/null +++ b/Algorithms/0237.delete-node-in-a-linked-list/README.md @@ -0,0 +1,30 @@ +# [237. Delete Node in a Linked List](https://leetcode.com/problems/delete-node-in-a-linked-list/) + +Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. + +Given linked list -- head = [4,5,1,9], which looks like following: + +![237](237.png) + +Example 1: + +```text +Input: head = [4,5,1,9], node = 5 +Output: [4,1,9] +Explanation: You are given the second node with value 5, the linked list should become 4 -> 1 -> 9 after calling your function. +``` + +Example 2: + +```text +Input: head = [4,5,1,9], node = 1 +Output: [4,5,9] +Explanation: You are given the third node with value 1, the linked list should become 4 -> 5 -> 9 after calling your function. +``` + +Note: + +- The linked list will have at least two elements. +- All of the nodes' values will be unique. +- The given node will not be the tail and it will always be a valid node of the linked list. +- Do not return anything from your function. \ No newline at end of file diff --git a/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list.go b/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list.go new file mode 100755 index 000000000..9ae52ddb2 --- /dev/null +++ b/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list.go @@ -0,0 +1,11 @@ +package problem0237 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is pre-defined... +type ListNode = kit.ListNode + +func deleteNode(node *ListNode) { + node.Val = node.Next.Val + node.Next = node.Next.Next +} diff --git a/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list_test.go b/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list_test.go new file mode 100755 index 000000000..428e789b5 --- /dev/null +++ b/Algorithms/0237.delete-node-in-a-linked-list/delete-node-in-a-linked-list_test.go @@ -0,0 +1,52 @@ +package problem0237 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ints []int + node int + ans []int +}{ + + { + []int{4, 5, 1, 9}, + 5, + []int{4, 1, 9}, + }, + + { + []int{4, 5, 1, 9}, + 1, + []int{4, 5, 9}, + }, + + // 可以有多个 testcase +} + +func Test_deleteNode(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + head := kit.Ints2List(tc.ints) + node := head.GetNodeWith(tc.node) + deleteNode(node) + ast.Equal(tc.ans, kit.List2Ints(head), "输入:%v", tc) + } +} + +func Benchmark_deleteNode(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.ints) + node := head.GetNodeWith(tc.node) + deleteNode(node) + } + } +} diff --git a/Algorithms/0238.product-of-array-except-self/README.md b/Algorithms/0238.product-of-array-except-self/README.md index 4b2a803e6..762df6ed0 100755 --- a/Algorithms/0238.product-of-array-except-self/README.md +++ b/Algorithms/0238.product-of-array-except-self/README.md @@ -1,6 +1,7 @@ # [238. Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) ## 题目 + Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Solve it without division and in O(n). @@ -14,6 +15,6 @@ Could you solve it with constant space complexity? (Note: The output array does 见程序注释 -有一个100%,主要还是服务器的功劳,因为我同样的程序再提交一次,就只有40%了。 +有一个 100%,主要还是服务器的功劳,因为我同样的程序再提交一次,就只有 40%了。 ![100%](238.png) \ No newline at end of file diff --git a/Algorithms/0238.product-of-array-except-self/product-of-array-except-self.go b/Algorithms/0238.product-of-array-except-self/product-of-array-except-self.go index f6a884f90..402192d8d 100755 --- a/Algorithms/0238.product-of-array-except-self/product-of-array-except-self.go +++ b/Algorithms/0238.product-of-array-except-self/product-of-array-except-self.go @@ -1,23 +1,20 @@ -package Problem0238 +package problem0238 -func productExceptSelf(a []int) []int { - l := len(a) - // left[i] 是 a[i] 左侧所有元素的乘积 - // right[i] 是 a[i] 右侧所有元素的乘积 - left, right := make([]int, l), make([]int, l) +func productExceptSelf(nums []int) []int { + size := len(nums) - // 题目已经保证了 n >= 2 - left[0], right[l-1] = 1, 1 - left[1], right[l-2] = a[0], a[l-1] + res := make([]int, size) - for i := 2; i < l; i++ { - left[i] = a[i-1] * left[i-1] - right[l-i-1] = a[l-i] * right[l-i] + left := 1 // product all left of nums[i] + for i := 0; i < size; i++ { + res[i] = left + left *= nums[i] } - res := make([]int, l) - for i := 0; i < l; i++ { - res[i] = left[i] * right[i] + right := 1 // product all right of nums[i] + for i := size - 1; i >= 0; i-- { + res[i] *= right + right *= nums[i] } return res diff --git a/Algorithms/0238.product-of-array-except-self/product-of-array-except-self_test.go b/Algorithms/0238.product-of-array-except-self/product-of-array-except-self_test.go index 728377576..529046882 100755 --- a/Algorithms/0238.product-of-array-except-self/product-of-array-except-self_test.go +++ b/Algorithms/0238.product-of-array-except-self/product-of-array-except-self_test.go @@ -1,4 +1,4 @@ -package Problem0238 +package problem0238 import ( "fmt" @@ -63,3 +63,10 @@ func Test_Problem0238(t *testing.T) { ast.Equal(a.one, productExceptSelf(p.nums), "输入:%v", p) } } + +func Benchmark_ProductExceptSelf(b *testing.B) { + nums := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9} + for i := 1; i < b.N; i++ { + productExceptSelf(nums) + } +} diff --git a/Algorithms/0239.sliding-window-maximum/README.md b/Algorithms/0239.sliding-window-maximum/README.md new file mode 100755 index 000000000..da4b103be --- /dev/null +++ b/Algorithms/0239.sliding-window-maximum/README.md @@ -0,0 +1,26 @@ +# [239. Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/) + +Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. + +For example, + +```text +Given nums = [1,3,-1,-3,5,3,6,7], and k = 3. + +Window position Max +--------------- ----- +[1 3 -1] -3 5 3 6 7 3 + 1 [3 -1 -3] 5 3 6 7 3 + 1 3 [-1 -3 5] 3 6 7 5 + 1 3 -1 [-3 5 3] 6 7 5 + 1 3 -1 -3 [5 3 6] 7 6 + 1 3 -1 -3 5 [3 6 7] 7 +``` + +Therefore, return the max sliding window as [3,3,5,5,6,7]. + +Note: + +- You may assume k is always valid, ie: 1 ≤ k ≤ input array's size for non-empty array. + +**Follow up:** Could you solve it in linear time? \ No newline at end of file diff --git a/Algorithms/0239.sliding-window-maximum/sliding-window-maximum.go b/Algorithms/0239.sliding-window-maximum/sliding-window-maximum.go new file mode 100755 index 000000000..f4730c78a --- /dev/null +++ b/Algorithms/0239.sliding-window-maximum/sliding-window-maximum.go @@ -0,0 +1,47 @@ +package problem0239 + +// 参看 https://leetcode.com/problems/sliding-window-maximum/discuss/65881/O(n)-solution-in-Java-with-two-simple-pass-in-the-array +func maxSlidingWindow(nums []int, k int) []int { + size := len(nums) + if k <= 1 { + return nums + } + + g := k - 1 // 比参考文章的分组少一个,可以减少 max 函数的调用,理论上可以加速。 + + left := make([]int, size) + for i := 0; i < size; i++ { + if i%g == 0 { + left[i] = nums[i] + } else { + left[i] = max(nums[i], left[i-1]) + } + } + + right := make([]int, size) + // size-1 很可能不是那组的最后一个,需要单独列出 + right[size-1] = nums[size-1] + for j := size - 2; j >= 0; j-- { + if (j+1)%g == 0 { + right[j] = nums[j] + } else { + right[j] = max(nums[j], right[j+1]) + } + } + + res := make([]int, size-k+1) + for i := 0; i <= size-k; i++ { + // right[i] 中保存了 nums[i:g*(i/g+1)] 中的最大值 + // left[i+k-1] 中保存了 nums[g*(i/g+1):i+k] 中的最大值 + res[i] = max(right[i], left[i+k-1]) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0239.sliding-window-maximum/sliding-window-maximum_test.go b/Algorithms/0239.sliding-window-maximum/sliding-window-maximum_test.go new file mode 100755 index 000000000..d5f038942 --- /dev/null +++ b/Algorithms/0239.sliding-window-maximum/sliding-window-maximum_test.go @@ -0,0 +1,65 @@ +package problem0239 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans []int +}{ + + { + []int{7, 2, 4}, + 2, + []int{7, 4}, + }, + + { + []int{}, + 0, + []int{}, + }, + + { + []int{2, 1, 3, 4, 6, 3, 8, 9, 10, 12, 56}, + 4, + []int{4, 6, 6, 8, 9, 10, 12, 56}, + }, + + { + []int{1, 3, -1, -3, 5, 3, 6, 7}, + 1, + []int{1, 3, -1, -3, 5, 3, 6, 7}, + }, + + { + []int{1, 3, -1, -3, 5, 3, 6, 7}, + 3, + []int{3, 3, 5, 5, 6, 7}, + }, + + // 可以有多个 testcase +} + +func Test_maxSlidingWindow(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxSlidingWindow(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_maxSlidingWindow(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSlidingWindow(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0240.search-a-2d-matrix-ii/README.md b/Algorithms/0240.search-a-2d-matrix-ii/README.md new file mode 100755 index 000000000..9035d07cf --- /dev/null +++ b/Algorithms/0240.search-a-2d-matrix-ii/README.md @@ -0,0 +1,26 @@ +# [240. Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) + +## 题目 +Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: +- Integers in each row are sorted in ascending from left to right. +- Integers in each column are sorted in ascending from top to bottom. + +For example, + +Consider the following matrix: +``` +[ + [1, 4, 7, 11, 15], + [2, 5, 8, 12, 19], + [3, 6, 9, 16, 22], + [10, 13, 14, 17, 24], + [18, 21, 23, 26, 30] +] +``` + +Given target = 5, return true. +Given target = 20, return false. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii.go b/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii.go new file mode 100755 index 000000000..a975750d7 --- /dev/null +++ b/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii.go @@ -0,0 +1,31 @@ +package problem0240 + +func searchMatrix(matrix [][]int, target int) bool { + m := len(matrix) + if m == 0 { + return false + } + n := len(matrix[0]) + if n == 0 { + return false + } + + i, j := m-1, 0 + for 0 <= i && j < n { + if matrix[i][j] == target { + return true + } + + if matrix[i][j] < target { + j++ + // 排除了 (i,j) 上方的所有比 matrix[i][j] 小的元素 + } else { + i-- + // 排除了 (i,j) 右方的所有比 matrix[i][j] 大的元素 + } + } + // 这种方法的效率,取决于 m 与 n 的相对大小关系 + // 当 m == n 时,效率最高 + // 当 m == 1 或 n ==1 时,效率最低 + return false +} diff --git a/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii_test.go b/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii_test.go new file mode 100755 index 000000000..f8d80447c --- /dev/null +++ b/Algorithms/0240.search-a-2d-matrix-ii/search-a-2d-matrix-ii_test.go @@ -0,0 +1,71 @@ +package problem0240 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var m = [][]int{ + []int{1, 4, 7, 11, 15}, + []int{2, 5, 8, 12, 19}, + []int{3, 6, 9, 16, 22}, + []int{10, 13, 14, 17, 24}, + []int{18, 21, 23, 26, 30}, +} + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + target int + ans bool +}{ + + { + m, + 5, + true, + }, + + { + m, + 15, + true, + }, + { + m, + 20, + false, + }, + + { + [][]int{}, + 5, + false, + }, + + { + [][]int{[]int{}}, + 5, + false, + }, + // 可以有多个 testcase +} + +func Test_searchMatrix(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, searchMatrix(tc.matrix, tc.target), "输入:%v", tc) + } +} + +func Benchmark_searchMatrix(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + searchMatrix(tc.matrix, tc.target) + } + } +} diff --git a/Algorithms/0241.different-ways-to-add-parentheses/README.md b/Algorithms/0241.different-ways-to-add-parentheses/README.md new file mode 100755 index 000000000..4bad637fb --- /dev/null +++ b/Algorithms/0241.different-ways-to-add-parentheses/README.md @@ -0,0 +1,29 @@ +# [241. Different Ways to Add Parentheses](https://leetcode.com/problems/different-ways-to-add-parentheses/) + +## 题目 +Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *. + +Example 1 +``` +Input: "2-1-1". +((2-1)-1) = 0 +(2-(1-1)) = 2 +``` +Output: [0, 2] + +Example 2 +``` +Input: "2*3-4*5" +(2*(3-(4*5))) = -34 +((2*3)-(4*5)) = -14 +((2*(3-4))*5) = -10 +(2*((3-4)*5)) = -10 +(((2*3)-4)*5) = 10 +``` +Output: [-34, -14, -10, -10, 10] + +Credits:Special thanks to @mithmatt for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses.go b/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses.go new file mode 100755 index 000000000..4aea9dd61 --- /dev/null +++ b/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses.go @@ -0,0 +1,47 @@ +package problem0241 + +import "strconv" + +func diffWaysToCompute(input string) []int { + cache := make(map[string][]int) + var dfs func(string) []int + dfs = func(s string) []int { + res := make([]int, 0, len(s)) + if t, ok := cache[s]; ok { + return t + } + + for i := range s { + if s[i] == '+' || s[i] == '-' || s[i] == '*' { + // 此时,s[i] 作为最后一个运算的运算符 + for _, left := range dfs(s[:i]) { + for _, right := range dfs(s[i+1:]) { + res = append(res, operate(left, right, s[i])) + } + } + } + } + + // s 中不存在运算符 + if len(res) == 0 { + temp, _ := strconv.Atoi(s) + res = append(res, temp) + } + + cache[s] = res + return res + } + + return dfs(input) +} + +func operate(a, b int, opt byte) int { + switch opt { + case '+': + return a + b + case '-': + return a - b + default: + return a * b + } +} diff --git a/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses_test.go b/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses_test.go new file mode 100755 index 000000000..ccb35b6db --- /dev/null +++ b/Algorithms/0241.different-ways-to-add-parentheses/different-ways-to-add-parentheses_test.go @@ -0,0 +1,52 @@ +package problem0241 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + input string + ans []int +}{ + + { + "2+2+2+2", + []int{8, 8, 8, 8, 8}, + }, + + { + "2-1-1", + []int{0, 2}, + }, + + { + "2*3-4*5", + []int{-34, -14, -10, -10, 10}, + }, + + // 可以有多个 testcase +} + +func Test_diffWaysToCompute(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := diffWaysToCompute(tc.input) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_diffWaysToCompute(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + diffWaysToCompute(tc.input) + } + } +} diff --git a/Algorithms/0242.valid-anagram/README.md b/Algorithms/0242.valid-anagram/README.md new file mode 100755 index 000000000..02ca97f28 --- /dev/null +++ b/Algorithms/0242.valid-anagram/README.md @@ -0,0 +1,24 @@ +# [242. Valid Anagram](https://leetcode.com/problems/valid-anagram/) + +## 题目 + +Given two strings s and t, write a function to determine if t is an anagram of s. + +For example, + +```text +s = "anagram", t = "nagaram", return true. +s = "rat", t = "car", return false. +``` + +Note: +You may assume the string contains only lowercase alphabets. + +Follow up: +What if the inputs contain unicode characters? How would you adapt your solution to such case? + +## 解题思路 + +易位构词游戏的英文词汇是 anagram,这个词来源于有“反向”或“再次”的含义的希腊语字根ana-和有“书写”、“写下”的意思的词根grahpein。易位构词是一类文字游戏(更准确地说是一类“词语游戏”),是将组成一个词或短句的字母重新排列顺序,原文中所有字母的每次出现都被使用一次,这样构造出另外一些新的词或短句。 + +见程序注释 diff --git a/Algorithms/0242.valid-anagram/valid-anagram.go b/Algorithms/0242.valid-anagram/valid-anagram.go new file mode 100755 index 000000000..fbd1131d1 --- /dev/null +++ b/Algorithms/0242.valid-anagram/valid-anagram.go @@ -0,0 +1,27 @@ +package problem0242 + +func isAnagram(s string, t string) bool { + if len(s) != len(t) { + return false + } + + // 把 string 转换成 []rune 可以适应 Unicode 字符 + sr := []rune(s) + tr := []rune(t) + + // 因为使用了 []rune,rec 只好使用 map + // 不然的话,使用 [26]int 数组,效率更高 + rec := make(map[rune]int, len(sr)) + for i := range sr { + rec[sr[i]]++ + rec[tr[i]]-- + } + + for _, n := range rec { + if n != 0 { + return false + } + } + + return true +} diff --git a/Algorithms/0242.valid-anagram/valid-anagram_test.go b/Algorithms/0242.valid-anagram/valid-anagram_test.go new file mode 100755 index 000000000..e22fa0be0 --- /dev/null +++ b/Algorithms/0242.valid-anagram/valid-anagram_test.go @@ -0,0 +1,41 @@ +package problem0242 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + t string + ans bool +}{ + + {"anagram", "nagaram", true}, + {"rat", "car", false}, + {"at", "car", false}, + {"", "", true}, + {"世界和平", "和平世界", true}, + + // 可以有多个 testcase +} + +func Test_isAnagram(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isAnagram(tc.s, tc.t), "输入:%v", tc) + } +} + +func Benchmark_isAnagram(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isAnagram(tc.s, tc.t) + } + } +} diff --git a/Algorithms/0257.binary-tree-paths/README.md b/Algorithms/0257.binary-tree-paths/README.md new file mode 100755 index 000000000..ff2015438 --- /dev/null +++ b/Algorithms/0257.binary-tree-paths/README.md @@ -0,0 +1,27 @@ +# [257. Binary Tree Paths](https://leetcode.com/problems/binary-tree-paths/) + +## 题目 + +Given a binary tree, return all root-to-leaf paths. + + +For example, given the following binary tree: + + + 1 + / \ +2 3 + \ + 5 + + + +All root-to-leaf paths are: +["1->2->5", "1->3"] + + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0257.binary-tree-paths/binary-tree-paths.go b/Algorithms/0257.binary-tree-paths/binary-tree-paths.go new file mode 100755 index 000000000..d834cae03 --- /dev/null +++ b/Algorithms/0257.binary-tree-paths/binary-tree-paths.go @@ -0,0 +1,41 @@ +package problem0257 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "strconv" +) + +type TreeNode = kit.TreeNode + +func binaryTreePaths(root *TreeNode) []string { + if root == nil { + return nil + } + + res := make([]string, 0, 16) + + var dfs func(string, *TreeNode) + dfs = func(pre string, root *TreeNode) { + if pre == "" { + pre = strconv.Itoa(root.Val) + } else { + pre += "->" + strconv.Itoa(root.Val) + } + + if root.Left != nil { + dfs(pre, root.Left) + } + + if root.Right != nil { + dfs(pre, root.Right) + } + + if root.Left == nil && root.Right == nil { + res = append(res, pre) + } + } + + dfs("", root) + + return res +} diff --git a/Algorithms/0257.binary-tree-paths/binary-tree-paths_test.go b/Algorithms/0257.binary-tree-paths/binary-tree-paths_test.go new file mode 100755 index 000000000..76dee4a89 --- /dev/null +++ b/Algorithms/0257.binary-tree-paths/binary-tree-paths_test.go @@ -0,0 +1,50 @@ +package problem0257 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []string +}{ + + { + []int{}, + []int{}, + nil, + }, + + { + []int{1, 2, 5, 3}, + []int{2, 5, 1, 3}, + []string{"1->2->5", "1->3"}, + }, + + // 可以有多个 testcase +} + +func Test_binaryTreePaths(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, binaryTreePaths(root), "输入:%v", tc) + } +} + +func Benchmark_binaryTreePaths(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + binaryTreePaths(root) + } + } +} diff --git a/Algorithms/0258.add-digits/README.md b/Algorithms/0258.add-digits/README.md new file mode 100755 index 000000000..154be2f6d --- /dev/null +++ b/Algorithms/0258.add-digits/README.md @@ -0,0 +1,20 @@ +# [258. Add Digits](https://leetcode.com/problems/add-digits/) + +## 题目 + +Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. + +For example: + +```text +Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. +``` + +Follow up: +Could you do it without any loop/recursion in O(1) runtime? + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0258.add-digits/add-digits.go b/Algorithms/0258.add-digits/add-digits.go new file mode 100755 index 000000000..94c88d5ce --- /dev/null +++ b/Algorithms/0258.add-digits/add-digits.go @@ -0,0 +1,5 @@ +package problem0258 + +func addDigits(n int) int { + return (n-1)%9 + 1 +} diff --git a/Algorithms/0258.add-digits/add-digits_test.go b/Algorithms/0258.add-digits/add-digits_test.go new file mode 100755 index 000000000..b0bfc4c3b --- /dev/null +++ b/Algorithms/0258.add-digits/add-digits_test.go @@ -0,0 +1,39 @@ +package problem0258 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans int +}{ + + { + 38, + 2, + }, + + // 可以有多个 testcase +} + +func Test_addDigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, addDigits(tc.num), "输入:%v", tc) + } +} + +func Benchmark_addDigits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + addDigits(tc.num) + } + } +} diff --git a/Algorithms/0260.single-number-iii/README.md b/Algorithms/0260.single-number-iii/README.md new file mode 100755 index 000000000..43c816933 --- /dev/null +++ b/Algorithms/0260.single-number-iii/README.md @@ -0,0 +1,18 @@ +# [260. Single Number III](https://leetcode.com/problems/single-number-iii/) + +## 题目 +Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. + +For example: + +Given nums = [1, 2, 1, 3, 2, 5], return [3, 5]. + +Note: +1. The order of the result is not important. So in the above example, [5, 3] is also correct. +1. Your algorithm should run in linear runtime complexity. Could you implement it using only constant space complexity? + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0260.single-number-iii/single-number-iii.go b/Algorithms/0260.single-number-iii/single-number-iii.go new file mode 100755 index 000000000..bc0448252 --- /dev/null +++ b/Algorithms/0260.single-number-iii/single-number-iii.go @@ -0,0 +1,20 @@ +package problem0260 + +func singleNumber(nums []int) []int { + var xor int + for _, num := range nums { + xor ^= num + } + + lowest := xor & -xor + + var a, b int + for _, num := range nums { + if num&lowest == 0 { + a ^= num + } else { + b ^= num + } + } + return []int{a, b} +} diff --git a/Algorithms/0260.single-number-iii/single-number-iii_test.go b/Algorithms/0260.single-number-iii/single-number-iii_test.go new file mode 100755 index 000000000..0f305c732 --- /dev/null +++ b/Algorithms/0260.single-number-iii/single-number-iii_test.go @@ -0,0 +1,47 @@ +package problem0260 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{1, 2, 3, 1, 2, 5}, + []int{3, 5}, + }, + + { + []int{1, 2, -1, 1, 2, 0}, + []int{-1, 0}, + }, + // 可以有多个 testcase +} + +func Test_singleNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + ans := singleNumber(tc.nums) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_singleNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + singleNumber(tc.nums) + } + } +} diff --git a/Algorithms/0263.ugly-number/README.md b/Algorithms/0263.ugly-number/README.md new file mode 100755 index 000000000..e426523e0 --- /dev/null +++ b/Algorithms/0263.ugly-number/README.md @@ -0,0 +1,14 @@ +# [263. Ugly Number](https://leetcode.com/problems/ugly-number/) + +## 题目 +Write a program to check whether a given number is an ugly number. + +Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7. + +Note that 1 is typically treated as an ugly number. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0263.ugly-number/ugly-number.go b/Algorithms/0263.ugly-number/ugly-number.go new file mode 100755 index 000000000..33ccf16f2 --- /dev/null +++ b/Algorithms/0263.ugly-number/ugly-number.go @@ -0,0 +1,26 @@ +package problem0263 + +func isUgly(num int) bool { + if num <= 0 { + return false + } + + if num <= 6 { + // 1,2,3,4,5,6 确实都是 ugly 的 + return true + } + + if num%2 == 0 { + return isUgly(num / 2) + } + + if num%3 == 0 { + return isUgly(num / 3) + } + + if num%5 == 0 { + return isUgly(num / 5) + } + + return false +} diff --git a/Algorithms/0263.ugly-number/ugly-number_test.go b/Algorithms/0263.ugly-number/ugly-number_test.go new file mode 100755 index 000000000..30e7c911a --- /dev/null +++ b/Algorithms/0263.ugly-number/ugly-number_test.go @@ -0,0 +1,67 @@ +package problem0263 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans bool +}{ + { + -2147483648, + false, + }, + + { + 0, + false, + }, + + { + 2123366402, + false, + }, + + { + 23, + false, + }, + + { + 12, + true, + }, + + { + 1, + true, + }, + + { + 2123366400, + true, + }, + // 可以有多个 testcase +} + +func Test_isUgly(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isUgly(tc.num), "输入:%v", tc) + } +} + +func Benchmark_isUgly(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isUgly(tc.num) + } + } +} diff --git a/Algorithms/0264.ugly-number-ii/README.md b/Algorithms/0264.ugly-number-ii/README.md new file mode 100755 index 000000000..897ecc9da --- /dev/null +++ b/Algorithms/0264.ugly-number-ii/README.md @@ -0,0 +1,14 @@ +# [264. Ugly Number II](https://leetcode.com/problems/ugly-number-ii/) + +## 题目 +Write a program to find the n-th ugly number. + +Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first 10 ugly numbers. + +Note that 1 is typically treated as an ugly number, and n does not exceed 1690. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0264.ugly-number-ii/ugly-number-ii.go b/Algorithms/0264.ugly-number-ii/ugly-number-ii.go new file mode 100755 index 000000000..c1b0544a2 --- /dev/null +++ b/Algorithms/0264.ugly-number-ii/ugly-number-ii.go @@ -0,0 +1,44 @@ +package problem0264 + +func nthUglyNumber(n int) int { + if n <= 6 { + return n + } + + pos := []int{0, 0, 0} + factors := []int{2, 3, 5} + candidates := []int{2, 3, 5} + + res := make([]int, n) + + res[0] = 1 + + for i := 1; i < n; i++ { + res[i] = min(candidates) + for j := 0; j < 3; j++ { + if res[i] == candidates[j] { + pos[j]++ + candidates[j] = res[pos[j]] * factors[j] + } + } + } + + return res[n-1] +} + +func min(candidates []int) int { + return lesser( + candidates[0], + lesser( + candidates[1], + candidates[2], + ), + ) +} + +func lesser(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0264.ugly-number-ii/ugly-number-ii_test.go b/Algorithms/0264.ugly-number-ii/ugly-number-ii_test.go new file mode 100755 index 000000000..f40696d15 --- /dev/null +++ b/Algorithms/0264.ugly-number-ii/ugly-number-ii_test.go @@ -0,0 +1,54 @@ +package problem0264 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 11, + 15, + }, + + { + 12, + 16, + }, + + { + 1690, + 2123366400, + }, + + { + 1, + 1, + }, + + // 可以有多个 testcase +} + +func Test_nthUglyNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nthUglyNumber(tc.n), "输入:%v", tc) + } +} + +func Benchmark_nthUglyNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nthUglyNumber(tc.n) + } + } +} diff --git a/Algorithms/0268.missing-number/missing-number.go b/Algorithms/0268.missing-number/missing-number.go index ee6d25488..1cf93910e 100755 --- a/Algorithms/0268.missing-number/missing-number.go +++ b/Algorithms/0268.missing-number/missing-number.go @@ -1,4 +1,4 @@ -package Problem0268 +package problem0268 func missingNumber(nums []int) int { xor := 0 diff --git a/Algorithms/0268.missing-number/missing-number_test.go b/Algorithms/0268.missing-number/missing-number_test.go index a5fb90b01..76a37dede 100755 --- a/Algorithms/0268.missing-number/missing-number_test.go +++ b/Algorithms/0268.missing-number/missing-number_test.go @@ -1,4 +1,4 @@ -package Problem0268 +package problem0268 import ( "fmt" diff --git a/Algorithms/0273.integer-to-english-words/README.md b/Algorithms/0273.integer-to-english-words/README.md new file mode 100755 index 000000000..634e31526 --- /dev/null +++ b/Algorithms/0273.integer-to-english-words/README.md @@ -0,0 +1,17 @@ +# [273. Integer to English Words](https://leetcode.com/problems/integer-to-english-words/) + +## 题目 + +Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 2^31 - 1. + +For example, + +```text +123 -> "One Hundred Twenty Three" +12345 -> "Twelve Thousand Three Hundred Forty Five" +1234567 -> "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven" +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0273.integer-to-english-words/integer-to-english-words.go b/Algorithms/0273.integer-to-english-words/integer-to-english-words.go new file mode 100755 index 000000000..e038643e9 --- /dev/null +++ b/Algorithms/0273.integer-to-english-words/integer-to-english-words.go @@ -0,0 +1,86 @@ +package problem0273 + +import ( + "strings" +) + +var lessThan21 = []string{ + "", + "One", + "Two", + "Three", + "Four", + "Five", + "Six", + "Seven", + "Eight", + "Nine", + "Ten", + "Eleven", + "Twelve", + "Thirteen", + "Fourteen", + "Fifteen", + "Sixteen", + "Seventeen", + "Eighteen", + "Nineteen", + "Twenty", +} + +var ten = []string{ + "", + "", + "Twenty", + "Thirty", + "Forty", + "Fifty", + "Sixty", + "Seventy", + "Eighty", + "Ninety", +} + +var thousand = []string{ + "", + "Thousand", + "Million", + "Billion", +} + +func numberToWords(num int) string { + if num == 0 { + return "Zero" + } + + res := "" + i := 0 + + for num > 0 { + if num%1000 != 0 { + res = lessK(num%1000) + thousand[i] + " " + res + } + + num /= 1000 + i++ + } + + return strings.TrimRight(res, " ") +} + +// 处理小于 1000 的数字 +func lessK(num int) string { + if num == 0 { + return "" + } + + if num <= 20 { + return lessThan21[num] + " " + } + + if num < 100 { + return ten[num/10] + " " + lessK(num%10) + } + + return lessThan21[num/100] + " Hundred " + lessK(num%100) +} diff --git a/Algorithms/0273.integer-to-english-words/integer-to-english-words_test.go b/Algorithms/0273.integer-to-english-words/integer-to-english-words_test.go new file mode 100755 index 000000000..f8ec56f19 --- /dev/null +++ b/Algorithms/0273.integer-to-english-words/integer-to-english-words_test.go @@ -0,0 +1,54 @@ +package problem0273 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans string +}{ + {50868, "Fifty Thousand Eight Hundred Sixty Eight"}, + {100, "One Hundred"}, + {30, "Thirty"}, + {21, "Twenty One"}, + {0, "Zero"}, + {123, "One Hundred Twenty Three"}, + {12345, "Twelve Thousand Three Hundred Forty Five"}, + {1234567, "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"}, + {101, "One Hundred One"}, + {1, "One"}, + {11, "Eleven"}, + {111, "One Hundred Eleven"}, + {1111, "One Thousand One Hundred Eleven"}, + {11111, "Eleven Thousand One Hundred Eleven"}, + {111111, "One Hundred Eleven Thousand One Hundred Eleven"}, + {1111111, "One Million One Hundred Eleven Thousand One Hundred Eleven"}, + {11111111, "Eleven Million One Hundred Eleven Thousand One Hundred Eleven"}, + {111111111, "One Hundred Eleven Million One Hundred Eleven Thousand One Hundred Eleven"}, + {1111111111, "One Billion One Hundred Eleven Million One Hundred Eleven Thousand One Hundred Eleven"}, + {1000000000, "One Billion"}, + + // 可以有多个 testcase +} + +func Test_numberToWords(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numberToWords(tc.num), "输入:%v", tc) + } +} + +func Benchmark_numberToWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numberToWords(tc.num) + } + } +} diff --git a/Algorithms/0274.h-index/README.md b/Algorithms/0274.h-index/README.md new file mode 100755 index 000000000..b52656b4f --- /dev/null +++ b/Algorithms/0274.h-index/README.md @@ -0,0 +1,17 @@ +# [274. H-Index](https://leetcode.com/problems/h-index/) + +## 题目 + +Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. + +According to the definition of h-index on Wikipedia: "A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h papers have no more than h citations each." + +For example, given citations = [3, 0, 6, 1, 5], which means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively. Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, his h-index is 3. + +Note: If there are several possible values for h, the maximum one is taken as the h-index. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0274.h-index/h-index.go b/Algorithms/0274.h-index/h-index.go new file mode 100755 index 000000000..866dacf09 --- /dev/null +++ b/Algorithms/0274.h-index/h-index.go @@ -0,0 +1,23 @@ +package problem0274 + +import "sort" + +func hIndex(d []int) int { + // 对 citations 进行降序排列 + sort.Sort(sort.Reverse(sort.IntSlice(d))) + size := len(d) + + // 二分查找法 + lo, hi := 0, size-1 + var mi int + for lo <= hi { + mi = (lo + hi) / 2 + if d[mi] > mi { + lo = mi + 1 + } else { + hi = mi - 1 + } + } + + return lo +} diff --git a/Algorithms/0274.h-index/h-index_test.go b/Algorithms/0274.h-index/h-index_test.go new file mode 100755 index 000000000..e086d7e5e --- /dev/null +++ b/Algorithms/0274.h-index/h-index_test.go @@ -0,0 +1,39 @@ +package problem0274 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + citations []int + ans int +}{ + + { + []int{3, 0, 6, 1, 5}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_hIndex(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hIndex(tc.citations), "输入:%v", tc) + } +} + +func Benchmark_hIndex(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hIndex(tc.citations) + } + } +} diff --git a/Algorithms/0275.h-index-ii/README.md b/Algorithms/0275.h-index-ii/README.md new file mode 100755 index 000000000..8fe739a91 --- /dev/null +++ b/Algorithms/0275.h-index-ii/README.md @@ -0,0 +1,11 @@ +# [275. H-Index II](https://leetcode.com/problems/h-index-ii/) + +## 题目 + +Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? + +## 解题思路 + +ascending order: 升序 + +见程序注释 diff --git a/Algorithms/0275.h-index-ii/h-index-ii.go b/Algorithms/0275.h-index-ii/h-index-ii.go new file mode 100755 index 000000000..82c9b50b7 --- /dev/null +++ b/Algorithms/0275.h-index-ii/h-index-ii.go @@ -0,0 +1,25 @@ +package problem0275 + +// a 为升序排列 +func hIndex(a []int) int { + size := len(a) + + // 二分查找法 + lo, hi := 0, size-1 + // lo, miD, hi 都是降序切片 d 中的序列号 + // 因为 a 是 d 的逆序,即 a 是升序切片 + // d[miD] , a[miA] 是同一个数 + // 所以,存在数量关系,miD + miA +1 == size + var miD, miA int + for lo <= hi { + miD = (lo + hi) / 2 + miA = size - miD - 1 + if a[miA] > miD { + lo = miD + 1 + } else { + hi = miD - 1 + } + } + + return lo +} diff --git a/Algorithms/0275.h-index-ii/h-index-ii_test.go b/Algorithms/0275.h-index-ii/h-index-ii_test.go new file mode 100755 index 000000000..b3947eefe --- /dev/null +++ b/Algorithms/0275.h-index-ii/h-index-ii_test.go @@ -0,0 +1,54 @@ +package problem0275 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + citations []int + ans int +}{ + + { + []int{1}, + 1, + }, + + { + []int{0, 0}, + 0, + }, + + { + []int{0}, + 0, + }, + + { + []int{3, 3, 3, 3, 5, 6}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_hIndex(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hIndex(tc.citations), "输入:%v", tc) + } +} + +func Benchmark_hIndex(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hIndex(tc.citations) + } + } +} diff --git a/Algorithms/0279.perfect-squares/README.md b/Algorithms/0279.perfect-squares/README.md new file mode 100755 index 000000000..eda76a4d6 --- /dev/null +++ b/Algorithms/0279.perfect-squares/README.md @@ -0,0 +1,13 @@ +# [279. Perfect Squares](https://leetcode.com/problems/perfect-squares/) + +## 题目 + +Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. + +For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13, return 2 because 13 = 4 + 9. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0279.perfect-squares/perfect-squares.go b/Algorithms/0279.perfect-squares/perfect-squares.go new file mode 100755 index 000000000..c5a28dd5f --- /dev/null +++ b/Algorithms/0279.perfect-squares/perfect-squares.go @@ -0,0 +1,30 @@ +package problem0279 + +import ( + "math" +) + +func numSquares(n int) int { + perfects := []int{} + for i := 1; i*i <= n; i++ { + perfects = append(perfects, i*i) + } + + // dp[i] 表示 the least number of perfect square numbers which sum to i + dp := make([]int, n+1) + for i := 1; i < len(dp); i++ { + dp[i] = math.MaxInt32 + } + + for _, p := range perfects { + for i := p; i < len(dp); i++ { + if dp[i] > dp[i-p]+1 { + // 因为 i = ( i - p ) + p,p 是 平方数 + // 所以 dp[i] = dp[i-p] + 1 + dp[i] = dp[i-p] + 1 + } + } + } + + return dp[n] +} diff --git a/Algorithms/0279.perfect-squares/perfect-squares_test.go b/Algorithms/0279.perfect-squares/perfect-squares_test.go new file mode 100755 index 000000000..84fe7effb --- /dev/null +++ b/Algorithms/0279.perfect-squares/perfect-squares_test.go @@ -0,0 +1,97 @@ +package problem0279 + +import ( + "fmt" + "math" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 123456, + 3, + }, + + { + 16, + 1, + }, + + { + 15, + 4, + }, + + { + 14, + 3, + }, + + { + 13, + 2, + }, + + { + 12, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numSquares(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numSquares(tc.n), "输入:%v", tc) + } +} + +func Benchmark_numSquares(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSquares(tc.n) + } + } +} + +var max = 10000000 + +func Benchmark_math_sqrt(b *testing.B) { + for i := 0; i < b.N; i++ { + for j := 10; j <= max; j++ { + _ = int(math.Sqrt(float64(j))) + } + } +} + +func Benchmark_intSqrt(b *testing.B) { + for i := 0; i < b.N; i++ { + for j := 10; j <= max; j *= 10 { + _ = intSqrt(j) + } + } +} + +// 返回 x 的平方根的整数部分 +// 这个函数比 int(math.Sqrt(float64(x))) 快的多 +// 详见 benchmark 的结果 +func intSqrt(x int) int { + res := x + + // 牛顿法求平方根 + for res*res > x { + res = (res + x/res) / 2 + } + + return res +} diff --git a/Algorithms/0282.expression-add-operators/README.md b/Algorithms/0282.expression-add-operators/README.md new file mode 100755 index 000000000..38093f9f8 --- /dev/null +++ b/Algorithms/0282.expression-add-operators/README.md @@ -0,0 +1,21 @@ +# [282. Expression Add Operators](https://leetcode.com/problems/expression-add-operators/) + +## 题目 + +Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value. + +Examples: + +```text +"123", 6 -> ["1+2+3", "1*2*3"] +"232", 8 -> ["2*3+2", "2+3*2"] +"105", 5 -> ["1*0+5","10-5"] +"00", 0 -> ["0+0", "0-0", "0*0"] +"3456237490", 9191 -> [] +``` + +Credits:Special thanks to @davidtan1890 for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0282.expression-add-operators/expression-add-operators.go b/Algorithms/0282.expression-add-operators/expression-add-operators.go new file mode 100755 index 000000000..4bac678d8 --- /dev/null +++ b/Algorithms/0282.expression-add-operators/expression-add-operators.go @@ -0,0 +1,65 @@ +package problem0282 + +func addOperators(s string, target int) []string { + res := []string{} + + var dfs func(string, string, int, int) + + dfs = func(s, resStr string, result, prevAdd int) { + var currStr, nextS string + var currNum int + + // s 切分完成 + if len(s) == 0 { + // 检查是否符合 target + if result == target { + res = append(res, resStr) + } + return + } + + for i := 1; i <= len(s); i++ { + currStr = s[:i] + // 排除类似 "01" 的数 + if currStr[0] == '0' && len(currStr) > 1 { + // 不是 continue + // 因为出现了一次 "01" 以后,后面的 str 都只会是 "01X" 之类的。 + return + } + + currNum = integer(currStr) + nextS = s[i:] + + if len(resStr) == 0 { + dfs(nextS, currStr, currNum, currNum) + } else { + /* + 当 运算符 opt 为 + 或 - 时,把计算式 + result = result opt currNum + 统一成 + result += prevAdd, prevAdd = 0 opt currNum + 这样做的原因是,当 opt 为 * 时,可以先利用 prevAdd 保证 乘法 运算的优先性 + result -= prevAdd + prevAdd *= currNum + result += prevAdd + */ + dfs(nextS, resStr+"+"+currStr, result+currNum, currNum) + dfs(nextS, resStr+"-"+currStr, result-currNum, -currNum) + dfs(nextS, resStr+"*"+currStr, result-prevAdd+prevAdd*currNum, prevAdd*currNum) + } + } + } + + dfs(s, "", 0, 0) + + return res +} + +// 把 string 转换成 int +func integer(s string) int { + res := int(s[0] - '0') + for i := 1; i < len(s); i++ { + res = res*10 + int(s[i]-'0') + } + return res +} diff --git a/Algorithms/0282.expression-add-operators/expression-add-operators_test.go b/Algorithms/0282.expression-add-operators/expression-add-operators_test.go new file mode 100755 index 000000000..aed389ddc --- /dev/null +++ b/Algorithms/0282.expression-add-operators/expression-add-operators_test.go @@ -0,0 +1,117 @@ +package problem0282 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num string + target int + ans []string +}{ + + { + "1210", + 120, + []string{"12*10"}, + }, + + { + "100100", + 10000, + []string{"100*100"}, + }, + + { + "011", + 0, + []string{"0*1*1", "0*11", "0+1-1", "0-1+1"}, + }, + + { + "17", + 17, + []string{"17"}, + }, + + { + "", + 5, + []string{}, + }, + + { + "5", + 5, + []string{"5"}, + }, + + { + "5", + 3, + []string{}, + }, + + { + "123", + 6, + []string{"1+2+3", "1*2*3"}, + }, + + { + "232", + 8, + []string{"2*3+2", "2+3*2"}, + }, + + { + "105", + 5, + []string{"1*0+5", "10-5"}, + }, + + { + "00", + 0, + []string{"0+0", "0-0", "0*0"}, + }, + + { + "3456237490", + 9191, + []string{}, + }, + + { + "000", + 0, + []string{"0*0*0", "0*0+0", "0*0-0", "0+0*0", "0+0+0", "0+0-0", "0-0*0", "0-0+0", "0-0-0"}, + }, + + // 可以有多个 testcase +} + +func Test_addOperators(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + sort.Strings(tc.ans) + ans := addOperators(tc.num, tc.target) + sort.Strings(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_addOperators(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + addOperators(tc.num, tc.target) + } + } +} diff --git a/Algorithms/0283.move-zeroes/move-zeroes.go b/Algorithms/0283.move-zeroes/move-zeroes.go index 7e481a1e5..47d845281 100755 --- a/Algorithms/0283.move-zeroes/move-zeroes.go +++ b/Algorithms/0283.move-zeroes/move-zeroes.go @@ -1,4 +1,4 @@ -package Problem0283 +package problem0283 func moveZeroes(nums []int) { l := len(nums) diff --git a/Algorithms/0283.move-zeroes/move-zeroes_test.go b/Algorithms/0283.move-zeroes/move-zeroes_test.go index 669c9725c..8a6c81fb6 100755 --- a/Algorithms/0283.move-zeroes/move-zeroes_test.go +++ b/Algorithms/0283.move-zeroes/move-zeroes_test.go @@ -1,4 +1,4 @@ -package Problem0283 +package problem0283 import ( "fmt" diff --git a/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number.go b/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number.go index 6103cde51..27ff2d62d 100755 --- a/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number.go +++ b/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number.go @@ -1,4 +1,4 @@ -package Problem0287 +package problem0287 func findDuplicate(a []int) int { slow, fast := a[0], a[a[0]] diff --git a/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number_test.go b/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number_test.go index 44eccfc30..6cae95b14 100755 --- a/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number_test.go +++ b/Algorithms/0287.find-the-duplicate-number/find-the-duplicate-number_test.go @@ -1,4 +1,4 @@ -package Problem0287 +package problem0287 import ( "fmt" diff --git a/Algorithms/0289.game-of-life/game-of-life.go b/Algorithms/0289.game-of-life/game-of-life.go index b56b52ff6..fd9e28477 100755 --- a/Algorithms/0289.game-of-life/game-of-life.go +++ b/Algorithms/0289.game-of-life/game-of-life.go @@ -1,4 +1,4 @@ -package Problem0289 +package problem0289 func gameOfLife(board [][]int) { m := len(board) diff --git a/Algorithms/0289.game-of-life/game-of-life_test.go b/Algorithms/0289.game-of-life/game-of-life_test.go index a89239b69..1b3cea0e3 100755 --- a/Algorithms/0289.game-of-life/game-of-life_test.go +++ b/Algorithms/0289.game-of-life/game-of-life_test.go @@ -1,4 +1,4 @@ -package Problem0289 +package problem0289 import ( "fmt" diff --git a/Algorithms/0290.word-pattern/README.md b/Algorithms/0290.word-pattern/README.md new file mode 100755 index 000000000..6552103ca --- /dev/null +++ b/Algorithms/0290.word-pattern/README.md @@ -0,0 +1,25 @@ +# [290. Word Pattern](https://leetcode.com/problems/word-pattern/) + +## 题目 + +Given a pattern and a string str, find if str follows the same pattern. + +Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. + +Examples: + +```text +pattern = "abba", str = "dog cat cat dog" should return true. +pattern = "abba", str = "dog cat cat fish" should return false. +pattern = "aaaa", str = "dog cat cat dog" should return false. +pattern = "abba", str = "dog dog dog dog" should return false. +``` + +Notes: +You may assume pattern contains only lowercase letters, and str contains lowercase letters separated by a single space. + +Credits:Special thanks to @minglotus6 for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0290.word-pattern/word-pattern.go b/Algorithms/0290.word-pattern/word-pattern.go new file mode 100755 index 000000000..40ca94bed --- /dev/null +++ b/Algorithms/0290.word-pattern/word-pattern.go @@ -0,0 +1,37 @@ +package problem0290 + +import ( + "strings" +) + +func wordPattern(pattern string, str string) bool { + ps := strings.Split(pattern, "") + ss := strings.Split(str, " ") + + if len(ps) != len(ss) { + return false + } + + return isMatch(ps, ss) && isMatch(ss, ps) +} + +func isMatch(s1, s2 []string) bool { + size := len(s1) + + m := make(map[string]string, size) + + var i int + var w string + var ok bool + + for i = 0; i < size; i++ { + if w, ok = m[s1[i]]; ok { + if w != s2[i] { + return false + } + } else { + m[s1[i]] = s2[i] + } + } + return true +} diff --git a/Algorithms/0290.word-pattern/word-pattern_test.go b/Algorithms/0290.word-pattern/word-pattern_test.go new file mode 100755 index 000000000..3908d3335 --- /dev/null +++ b/Algorithms/0290.word-pattern/word-pattern_test.go @@ -0,0 +1,41 @@ +package problem0290 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pattern string + str string + ans bool +}{ + + {"abba", "dog cat cat dog", true}, + {"abba", "dog cat cat fish", false}, + {"aaaa", "dog cat cat dog", false}, + {"abba", "dog dog dog dog", false}, + {"aaa", "aa aa aa aa", false}, + + // 可以有多个 testcase +} + +func Test_wordPattern(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, wordPattern(tc.pattern, tc.str), "输入:%v", tc) + } +} + +func Benchmark_wordPattern(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wordPattern(tc.pattern, tc.str) + } + } +} diff --git a/Algorithms/0292.nim-game/README.md b/Algorithms/0292.nim-game/README.md new file mode 100755 index 000000000..35ccf736f --- /dev/null +++ b/Algorithms/0292.nim-game/README.md @@ -0,0 +1,15 @@ +# [292. Nim Game](https://leetcode.com/problems/nim-game/) + +## 题目 + +You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones. + +Both of you are very clever and have optimal strategies for the game. Write a function to determine whether you can win the game given the number of stones in the heap. + +For example, if there are 4 stones in the heap, then you will never win the game: no matter 1, 2, or 3 stones you remove, the last stone will always be removed by your friend. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0292.nim-game/nim-game.go b/Algorithms/0292.nim-game/nim-game.go new file mode 100755 index 000000000..c6894465e --- /dev/null +++ b/Algorithms/0292.nim-game/nim-game.go @@ -0,0 +1,5 @@ +package problem0292 + +func canWinNim(n int) bool { + return n%4 != 0 +} diff --git a/Algorithms/0292.nim-game/nim-game_test.go b/Algorithms/0292.nim-game/nim-game_test.go new file mode 100755 index 000000000..b5e12921e --- /dev/null +++ b/Algorithms/0292.nim-game/nim-game_test.go @@ -0,0 +1,39 @@ +package problem0292 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans bool +}{ + + {4, false}, + {5, true}, + {41, true}, + + // 可以有多个 testcase +} + +func Test_canWinNim(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canWinNim(tc.n), "输入:%v", tc) + } + +} + +func Benchmark_canWinNim(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canWinNim(tc.n) + } + } +} diff --git a/Algorithms/0295.find-median-from-data-stream/295.100.png b/Algorithms/0295.find-median-from-data-stream/295.100.png new file mode 100644 index 000000000..97287f97f Binary files /dev/null and b/Algorithms/0295.find-median-from-data-stream/295.100.png differ diff --git a/Algorithms/0295.find-median-from-data-stream/README.md b/Algorithms/0295.find-median-from-data-stream/README.md new file mode 100755 index 000000000..3ca8721d7 --- /dev/null +++ b/Algorithms/0295.find-median-from-data-stream/README.md @@ -0,0 +1,37 @@ +# [295. Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) + +## 题目 + +Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. + +Examples: + +```text +[2,3,4] , the median is 3 +[2,3], the median is (2 + 3) / 2 = 2.5 +``` + +Design a data structure that supports the following two operations: + +- void addNum(int num) - Add a integer number from the data stream to the data structure. +- double findMedian() - Return the median of all elements so far. + +For example: + +```text +addNum(1) +addNum(2) +findMedian() -> 1.5 +addNum(3) +findMedian() -> 2 +``` + +Credits:Special thanks to @Louis1992 for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 + +感谢 LeetCode 服务器 + +![100](295.100.png) \ No newline at end of file diff --git a/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream.go b/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream.go new file mode 100755 index 000000000..d2c7ab4a9 --- /dev/null +++ b/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream.go @@ -0,0 +1,97 @@ +package problem0295 + +import ( + "container/heap" +) + +// MedianFinder 用于寻找 Median +type MedianFinder struct { + // nums 按个数被平均分配到 left 和 right 中。left.Len() >= right.Len() + left *maxHeap + right *minHeap +} + +// Constructor initialize your data structure here. +func Constructor() MedianFinder { + left := new(maxHeap) + heap.Init(left) + right := new(minHeap) + heap.Init(right) + + return MedianFinder{ + left: left, + right: right, + } +} + +// AddNum 给 MedianFinder 添加数 +func (mf *MedianFinder) AddNum(n int) { + if mf.left.Len() == mf.right.Len() { + heap.Push(mf.left, n) + } else { + heap.Push(mf.right, n) + } + + if mf.right.Len() > 0 && mf.left.intHeap[0] > mf.right.intHeap[0] { + mf.left.intHeap[0], mf.right.intHeap[0] = mf.right.intHeap[0], mf.left.intHeap[0] + heap.Fix(mf.left, 0) + heap.Fix(mf.right, 0) + } +} + +// FindMedian 给出 Median +func (mf *MedianFinder) FindMedian() float64 { + if mf.left.Len() == mf.right.Len() { + return float64(mf.left.intHeap[0]+mf.right.intHeap[0]) / 2 + } + return float64(mf.left.intHeap[0]) +} + +/** + * Your MedianFinder object will be instantiated and called as such: + * obj := Constructor(); + * obj.AddNum(num); + * param_2 := obj.FindMedian(); + */ + +// maxHeap.intHeap[0] == max(maxHeap.intHeap) +type maxHeap struct { + intHeap +} + +func (h maxHeap) Less(i, j int) bool { + return h.intHeap[i] > h.intHeap[j] +} + +// minHeap.intHeap[0] == min(minHeap.intHeap) +type minHeap struct { + intHeap +} + +// intHeap 实现了 heap 的接口 +type intHeap []int + +func (h intHeap) Len() int { + return len(h) +} + +func (h intHeap) Less(i, j int) bool { + return h[i] < h[j] +} + +func (h intHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} +func (h *intHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *intHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[0 : len(*h)-1] + return res +} diff --git a/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream_test.go b/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream_test.go new file mode 100755 index 000000000..ddc4b5b46 --- /dev/null +++ b/Algorithms/0295.find-median-from-data-stream/find-median-from-data-stream_test.go @@ -0,0 +1,40 @@ +package problem0295 + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MedianFinder(t *testing.T) { + ast := assert.New(t) + + mf := Constructor() + + for i := 1; i < 10; i++ { + mf.AddNum(i) + ast.Equal(float64(1+i)/2, mf.FindMedian(), "median of %v %v", mf.left.intHeap, mf.right.intHeap) + } + + mf = Constructor() + for i := -1; i >= -10; i-- { + mf.AddNum(i) + ast.Equal(float64(-1+i)/2, mf.FindMedian(), "median of %v %v", mf.left.intHeap, mf.right.intHeap) + } + + // 没有用到 Pop 这里只为了 100% 覆盖率 + mf.left.Pop() +} + +func Benchmark_MedianFinder(b *testing.B) { + size := 100 + mf := Constructor() + + for i := 0; i < b.N; i++ { + for j := 0; j < size; j++ { + mf.AddNum(rand.Int()) + mf.FindMedian() + } + } +} diff --git a/Algorithms/0299.bulls-and-cows/README.md b/Algorithms/0299.bulls-and-cows/README.md new file mode 100755 index 000000000..c83e4a86d --- /dev/null +++ b/Algorithms/0299.bulls-and-cows/README.md @@ -0,0 +1,33 @@ +# [299. Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) + +## 题目 + +You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called "bulls") and how many digits match the secret number but locate in the wrong position (called "cows"). Your friend will use successive guesses and hints to eventually derive the secret number. + +For example: + +```text +Secret number: "1807" +Friend's guess: "7810" +``` + +Hint: 1 bull and 3 cows. (The bull is 8, the cows are 0, 1 and 7.) + +Write a function to return a hint according to the secret number and friend's guess, use A to indicate the bulls and B to indicate the cows. In the above example, your function should return "1A3B". + +Please note that both secret number and friend's guess may contain duplicate digits, for example: + +```text +Secret number: "1123" +Friend's guess: "0111" +``` + +In this case, the 1st 1 in friend's guess is a bull, the 2nd or 3rd 1 is a cow, and your function should return "1A1B". + +You may assume that the secret number and your friend's guess only contain digits, and their lengths are always equal. + +Credits:Special thanks to @jeantimex for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0299.bulls-and-cows/bulls-and-cows.go b/Algorithms/0299.bulls-and-cows/bulls-and-cows.go new file mode 100755 index 000000000..77ed25c7e --- /dev/null +++ b/Algorithms/0299.bulls-and-cows/bulls-and-cows.go @@ -0,0 +1,38 @@ +package problem0299 + +import "strconv" + +func getHint(secret string, guess string) string { + var bull, cow int + // countS[n] > 0 表示 数字 n 在 secret 前面出现过,且没有被匹配为 bull + // countG[n] > 0 表示 数字 n 在 guess 前面出现过,且没有被匹配为 bull + var countS, countG [10]int + + size := len(secret) + for i := 0; i < size; i++ { + ns := int(secret[i] - '0') + ng := int(guess[i] - '0') + + if ns == ng { + bull++ + } else { + // 检查 ns 能否在 guess[:i] 中匹配为 cow + if countG[ns] > 0 { + cow++ + countG[ns]-- + } else { + countS[ns]++ + } + + // 检查 ng 能否在 secret[:i] 中匹配为 cow + if countS[ng] > 0 { + cow++ + countS[ng]-- + } else { + countG[ng]++ + } + } + } + + return strconv.Itoa(bull) + "A" + strconv.Itoa(cow) + "B" +} diff --git a/Algorithms/0299.bulls-and-cows/bulls-and-cows_test.go b/Algorithms/0299.bulls-and-cows/bulls-and-cows_test.go new file mode 100755 index 000000000..180ded627 --- /dev/null +++ b/Algorithms/0299.bulls-and-cows/bulls-and-cows_test.go @@ -0,0 +1,47 @@ +package problem0299 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + secret string + guess string + ans string +}{ + + { + "1807", + "7810", + "1A3B", + }, + + { + "1123456789", + "0111111111", + "1A1B", + }, + + // 可以有多个 testcase +} + +func Test_getHint(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, getHint(tc.secret, tc.guess), "输入:%v", tc) + } +} + +func Benchmark_getHint(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + getHint(tc.secret, tc.guess) + } + } +} diff --git a/Algorithms/0300.longest-increasing-subsequence/README.md b/Algorithms/0300.longest-increasing-subsequence/README.md new file mode 100755 index 000000000..eed81d7b9 --- /dev/null +++ b/Algorithms/0300.longest-increasing-subsequence/README.md @@ -0,0 +1,21 @@ +# [300. Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) + +## 题目 + +Given an unsorted array of integers, find the length of longest increasing subsequence. + +For example, + +Given [10, 9, 2, 5, 3, 7, 101, 18], + +The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than one LIS combination, it is only necessary for you to return the length. + +Your algorithm should run in O(n2) complexity. + +Follow up: Could you improve it to O(n log n) time complexity? + +Credits:Special thanks to @pbrother for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence.go b/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence.go new file mode 100755 index 000000000..97ebd2ada --- /dev/null +++ b/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence.go @@ -0,0 +1,22 @@ +package problem0300 + +import "sort" + +func lengthOfLIS(nums []int) int { + tails := make([]int, 0, len(nums)) + + for _, n := range nums { + at := sort.SearchInts(tails, n) + if at == len(tails) { + // n 比 tails 中所有的数都大 + // 把 n 放入 tails 的尾部 + tails = append(tails, n) + } else if tails[at] > n { + // tails[at-1] < n < tails[at] + // tails[at] = n, 不会改变 tail 的递增性,却增加了加入更多数的可能性 + tails[at] = n + } + } + + return len(tails) +} diff --git a/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence_test.go b/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence_test.go new file mode 100755 index 000000000..90a432125 --- /dev/null +++ b/Algorithms/0300.longest-increasing-subsequence/longest-increasing-subsequence_test.go @@ -0,0 +1,59 @@ +package problem0300 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{3, 5, 6, 2, 5, 4, 19, 5, 6, 7, 12}, + 6, + }, + + { + []int{10, 9, 2, 3, 8, 1, 4, 5, 6, 101, 18}, + 6, + }, + + { + []int{10, 9, 2, 5, 3, 3, 7, 101, 18}, + 4, + }, + + { + []int{10, 9, 2, 5, 3, 7, 101, 18}, + 4, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2195, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224, 2225, 2226, 2227, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261, 2262, 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498, 2499, 2500}, + 2500, + }, + + // 可以有多个 testcase +} + +func Test_lengthOfLIS(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, lengthOfLIS(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_lengthOfLIS(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lengthOfLIS(tc.nums) + } + } +} diff --git a/Algorithms/0301.remove-invalid-parentheses/README.md b/Algorithms/0301.remove-invalid-parentheses/README.md new file mode 100755 index 000000000..f8331d260 --- /dev/null +++ b/Algorithms/0301.remove-invalid-parentheses/README.md @@ -0,0 +1,21 @@ +# [301. Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/) + +## 题目 + +Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. + +Note: The input string may contain letters other than the parentheses ( and ). + +Examples: + +```text +"()())()" -> ["()()()", "(())()"] +"(a)())()" -> ["(a)()()", "(a())()"] +")(" -> [""] +``` + +Credits:Special thanks to @hpplayer for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses.go b/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses.go new file mode 100755 index 000000000..cbd9307d1 --- /dev/null +++ b/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses.go @@ -0,0 +1,82 @@ +package problem0301 + +func removeInvalidParentheses(s string) []string { + res := []string{} + return dfs(s, "()", 0, 0, res) +} + +func dfs(s, pair string, first, last int, res []string) []string { + var i, j, count int + var temp string + + // s[:last] 是合法的,即对于 pair 配对来说,没有无法配对的 pair[1] + for j = last; j < len(s); j++ { + if s[j] == pair[0] { + count++ + } else if s[j] == pair[1] { + count-- + } + if count >= 0 { + continue + } + // count == -1 + // 此时 s[:j+1] 中,多了一个 pair[1] + // 需要从 s[i:j+1]中,删除一个 pair[1],使得删除后的 s[:j] 是合法的 + for i = first; i <= j; i++ { + // 此时 s[:j+1] 会有两种情况 + // 情况①: + // i j + // ()())() + // 0123456 + // s[i] == pair[1] && s[i-1] != pair[1] 保证被删除的是 s[1] 或 s[3] + // 避免了,删除 s[1] 或 s[3] 或 s[4] 后导致的重复情况 + // 情况②: + // i j + // ((())))))( + // 0123456789 + // s[i] == pair[1] && i == first 保证了在删除 s[3] 后面的递归中, + // 被删除的是 s[4] 和 s[5],避免了由于 s[i-1] != pair[1] 导致的遗漏 + if s[i] == pair[1] && (i == first || s[i-1] != pair[1]) { + temp = s[:i] + s[i+1:] + // i 是对删除元素位置的一个记录 + // 换一个 i 就是对 res 的一次划分 + res = dfs(temp, pair, i, j, res) + } + } + + return res + } + + // 此时 j == len(s),由于 s[:j] 始终都是相对于 pair 合法的 + // 因为不合法的话,就会进入 for i 循环进行删除处理。 + // 所以,此时 s 相对于 pair 就是合法的啦 + + // 上面的代码是 + // 从左往右,删除了 "()" pair 中无法配对的 ")" + // 还需要 + // 从右往左,去删除 "()" pair 中无法配对的 "(" + // 通过同时逆转 s 和 pair,可以重用前面的代码,完成上述工作 + reversed := reverse(s) + + if pair == "()" { + return dfs(reversed, ")(", 0, 0, res) + } + + // 此时 pair == ")(" + // 说明: + // s 是逆转的 + // reversed 才是正常顺序的。 + // reversed 已经完成了两个方向的删除工作。就是最后的答案了。 + return append(res, reversed) +} + +func reverse(s string) string { + buf := []byte(s) + i, j := 0, len(buf)-1 + for i < j { + buf[i], buf[j] = buf[j], buf[i] + i++ + j-- + } + return string(buf) +} diff --git a/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses_test.go b/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses_test.go new file mode 100755 index 000000000..4f9b546ec --- /dev/null +++ b/Algorithms/0301.remove-invalid-parentheses/remove-invalid-parentheses_test.go @@ -0,0 +1,45 @@ +package problem0301 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans []string +}{ + + {"(a)())()", []string{"(a)()()", "(a())()"}}, + {"()())()", []string{"()()()", "(())()"}}, + {"()())())", []string{"(()())", "(())()", "()(())", "()()()"}}, + {"((())))))((()", []string{"((()))()"}}, + {")d))", []string{"d"}}, + {")(", []string{""}}, + + // 可以有多个 testcase +} + +func Test_removeInvalidParentheses(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := removeInvalidParentheses(tc.s) + sort.Strings(ans) + sort.Strings(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_removeInvalidParentheses(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeInvalidParentheses(tc.s) + } + } +} diff --git a/Algorithms/0303.range-sum-query-immutable/README.md b/Algorithms/0303.range-sum-query-immutable/README.md new file mode 100755 index 000000000..226d65a8a --- /dev/null +++ b/Algorithms/0303.range-sum-query-immutable/README.md @@ -0,0 +1,24 @@ +# [303. Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable/) + +## 题目 + +Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. + +Example: + +```text +Given nums = [-2, 0, 3, -5, 2, -1] + +sumRange(0, 2) -> 1 +sumRange(2, 5) -> -1 +sumRange(0, 5) -> -3 +``` + +Note: + +1. You may assume that the array does not change. +1. There are many calls to sumRange function. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable.go b/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable.go new file mode 100755 index 000000000..7b89f268c --- /dev/null +++ b/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable.go @@ -0,0 +1,29 @@ +package problem0303 + +// NumArray 是切片的和切片 +type NumArray struct { + dp []int +} + +// Constructor 返回 NumArray +func Constructor(nums []int) NumArray { + size := len(nums) + // dp[i+1] == SumRange(0,i) + dp := make([]int, size+1) + for i := 1; i <= size; i++ { + dp[i] = dp[i-1] + nums[i-1] + } + + return NumArray{dp: dp} +} + +// SumRange (i,j) == sum(nums[i:j+1]) +func (na *NumArray) SumRange(i int, j int) int { + return na.dp[j+1] - na.dp[i] +} + +/** + * Your NumArray object will be instantiated and called as such: + * obj := Constructor(nums); + * param_1 := obj.SumRange(i,j); + */ diff --git a/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable_test.go b/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable_test.go new file mode 100755 index 000000000..fadf22d45 --- /dev/null +++ b/Algorithms/0303.range-sum-query-immutable/range-sum-query-immutable_test.go @@ -0,0 +1,54 @@ +package problem0303 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var nums = []int{-2, 0, 3, -5, 2, -1} + +// tcs is testcase slice +var tcs = []struct { + i, j int + ans int +}{ + + { + 0, 2, + 1, + }, + + { + 2, 5, + -1, + }, + + { + 0, 5, + -3, + }, + // 可以有多个 testcase +} + +func Test_SumRange(t *testing.T) { + ast := assert.New(t) + + na := Constructor(nums) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, na.SumRange(tc.i, tc.j), "输入:%v,%v,%v", nums, na.dp, tc) + } +} + +func Benchmark_Constructor(b *testing.B) { + na := Constructor(nums) + + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + na.SumRange(tc.i, tc.j) + } + } +} diff --git a/Algorithms/0304.range-sum-query-2d-immutable/README.md b/Algorithms/0304.range-sum-query-2d-immutable/README.md new file mode 100755 index 000000000..4f31a6589 --- /dev/null +++ b/Algorithms/0304.range-sum-query-2d-immutable/README.md @@ -0,0 +1,35 @@ +# [304. Range Sum Query 2D - Immutable](https://leetcode.com/problems/range-sum-query-2d-immutable/) + +## 题目 + +Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). + +![range_sum_query_2d](range_sum_query_2d.png) + +The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, col2) = (4, 3), which contains sum = 8. + +Example: + +```text +Given matrix = [ + [3, 0, 1, 4, 2], + [5, 6, 3, 2, 1], + [1, 2, 0, 1, 5], + [4, 1, 0, 1, 7], + [1, 0, 3, 0, 5] +] + +sumRegion(2, 1, 4, 3) -> 8 +sumRegion(1, 1, 2, 2) -> 11 +sumRegion(1, 2, 2, 4) -> 12 +``` + +Note: + +1. You may assume that the matrix does not change. +1. There are many calls to sumRegion function. +1. You may assume that row1 ≤ row2 and col1 ≤ col2. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable.go b/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable.go new file mode 100755 index 000000000..753d55e7f --- /dev/null +++ b/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable.go @@ -0,0 +1,41 @@ +package problem0304 + +// NumMatrix 包含了需要求和的矩阵 +type NumMatrix struct { + dp [][]int +} + +// Constructor 创建 NumMatrix +func Constructor(matrix [][]int) NumMatrix { + var m, n int + if len(matrix) == 0 || len(matrix[0]) == 0 { + m, n = 0, 0 + } else { + m, n = len(matrix), len(matrix[0]) + } + + // dp[i][j] 表示 sumRegion(0,i-1,0,j-1) + dp := make([][]int, m+1) + for i := range dp { + dp[i] = make([]int, n+1) + } + + for i := 1; i <= m; i++ { + for j := 1; j <= n; j++ { + dp[i][j] = matrix[i-1][j-1] + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1] + } + } + + return NumMatrix{dp: dp} +} + +// SumRegion 求和 +func (nm *NumMatrix) SumRegion(row1 int, col1 int, row2 int, col2 int) int { + return nm.dp[row2+1][col2+1] - nm.dp[row2+1][col1] - nm.dp[row1][col2+1] + nm.dp[row1][col1] +} + +/** + * Your NumMatrix object will be instantiated and called as such: + * obj := Constructor(matrix); + * param_1 := obj.SumRegion(row1,col1,row2,col2); + */ diff --git a/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable_test.go b/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable_test.go new file mode 100755 index 000000000..72e5388e8 --- /dev/null +++ b/Algorithms/0304.range-sum-query-2d-immutable/range-sum-query-2d-immutable_test.go @@ -0,0 +1,70 @@ +package problem0304 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var matrix = [][]int{ + []int{3, 0, 1, 4, 2}, + []int{5, 6, 3, 2, 1}, + []int{1, 2, 0, 1, 5}, + []int{4, 1, 0, 1, 7}, + []int{1, 0, 3, 0, 5}, +} + +// tcs is testcase slice +var tcs = []struct { + row1, col1, row2, col2 int + ans int +}{ + + { + 2, 1, 4, 3, + 8, + }, + + { + 1, 1, 2, 2, + 11, + }, + + { + 1, 2, 2, 4, + 12, + }, + + // 可以有多个 testcase +} + +func Test_SumRegion(t *testing.T) { + ast := assert.New(t) + + nm := Constructor(matrix) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nm.SumRegion(tc.row1, tc.col1, tc.row2, tc.col2), "输入:%v", tc) + } +} + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + actual := Constructor([][]int{}) + expected := [][]int{[]int{0}} + + ast.Equal(expected, actual.dp) +} + +func Benchmark_SumRegion(b *testing.B) { + nm := Constructor(matrix) + + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nm.SumRegion(tc.row1, tc.col1, tc.row2, tc.col2) + } + } +} diff --git a/Algorithms/0304.range-sum-query-2d-immutable/range_sum_query_2d.png b/Algorithms/0304.range-sum-query-2d-immutable/range_sum_query_2d.png new file mode 100644 index 000000000..9da1a76f9 Binary files /dev/null and b/Algorithms/0304.range-sum-query-2d-immutable/range_sum_query_2d.png differ diff --git a/Algorithms/0306.additive-number/README.md b/Algorithms/0306.additive-number/README.md new file mode 100755 index 000000000..cbce9f44d --- /dev/null +++ b/Algorithms/0306.additive-number/README.md @@ -0,0 +1,34 @@ +# [306. Additive Number](https://leetcode.com/problems/additive-number/) + +## 题目 + +Additive number is a string whose digits can form additive sequence. + +A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two. + +For example: + +"112358" is an additive number because the digits can form an additive sequence: 1, 1, 2, 3, 5, 8. + +```text +1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8 +``` + +"199100199" is also an additive number, the additive sequence is: 1, 99, 100, 199. + +```text +1 + 99 = 100, 99 + 100 = 199 +``` + +Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 03 or 1, 02, 3 is invalid. + +Given a string containing only digits '0'-'9', write a function to determine if it's an additive number. + +Follow up: +How would you handle overflow for very large input integers? + +Credits:Special thanks to @jeantimex for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0306.additive-number/additive-number.go b/Algorithms/0306.additive-number/additive-number.go new file mode 100755 index 000000000..eb0d03132 --- /dev/null +++ b/Algorithms/0306.additive-number/additive-number.go @@ -0,0 +1,64 @@ +package problem0306 + +import ( + "strconv" +) + +func isAdditiveNumber(num string) bool { + if len(num) < 3 { + return false + } + + var dfs func(int, int, string) bool + dfs = func(n1, n2 int, num string) bool { + n3 := n1 + n2 + s3 := strconv.Itoa(n3) + if len(s3) > len(num) { + return false + } + + if len(s3) == len(num) { + if s3 == num { + return true + } + return false + } + + if s3 != num[:len(s3)] { + return false + } + + return dfs(n2, n3, num[len(s3):]) + } + + // n1 = num[:i] + // n2 = num[i:j] + // n3 = num[j:j+x], x = 1,2,3.. + var i, j int + // Jmax 是 j 的最大值 + // n1, n2 中较大数的 size 的最小值为 (j+1)/2 + // n3 的 size 的最大值为 len(num)-j + // 当 (j+1)/2 <= len(num)-j 才有可能使得 n1+n2==n3 成立 + // 可得 j <= (2* len(num)-1)/3 < len(num) * 2 / 3 + // 考虑到 int 除法的特性 + // Jmax = len(num) * 2 / 3 + Jmax := len(num) * 2 / 3 + + for i = 1; i <= Jmax-1; i++ { + if len(num[:i]) > 1 && num[0] == '0' { + return false + } + for j = i + 1; j <= Jmax; j++ { + if len(num[i:j]) > 1 && num[i] == '0' { + break + } + n1, _ := strconv.Atoi(num[:i]) + n2, _ := strconv.Atoi(num[i:j]) + if dfs(n1, n2, num[j:]) { + return true + } + } + } + + return false +} diff --git a/Algorithms/0306.additive-number/additive-number_test.go b/Algorithms/0306.additive-number/additive-number_test.go new file mode 100755 index 000000000..57e146509 --- /dev/null +++ b/Algorithms/0306.additive-number/additive-number_test.go @@ -0,0 +1,48 @@ +package problem0306 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num string + ans bool +}{ + + {"0000000000", true}, + {"10112", true}, + {"101", true}, + {"112358", true}, + {"199100199", true}, + {"1991001991", false}, + {"11", false}, + {"00123", false}, + {"100100200", true}, + {"100000100000200000", true}, + {"9999991998", true}, + {"99911000", true}, + {"9981999", true}, + + // 可以有多个 testcase +} + +func Test_isAdditiveNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isAdditiveNumber(tc.num), "输入:%v", tc) + } +} + +func Benchmark_isAdditiveNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isAdditiveNumber(tc.num) + } + } +} diff --git a/Algorithms/0307.range-sum-query-mutable/README.md b/Algorithms/0307.range-sum-query-mutable/README.md new file mode 100755 index 000000000..e1efc295d --- /dev/null +++ b/Algorithms/0307.range-sum-query-mutable/README.md @@ -0,0 +1,22 @@ +# [307. Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) + +## 题目 + +Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. + +The update(i, val) function modifies nums by updating the element at index i to val. + +Example: + +```text +Given nums = [1, 3, 5] + +sumRange(0, 2) -> 9 +update(1, 2) +sumRange(0, 2) -> 8 +``` + +Note: + +1. The array is only modifiable by the update function. +1. You may assume the number of calls to update and sumRange function is distributed evenly. diff --git a/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable.go b/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable.go new file mode 100755 index 000000000..15c2aa1e6 --- /dev/null +++ b/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable.go @@ -0,0 +1,85 @@ +package problem0307 + +// https://leetcode.com/problems/range-sum-query-mutable/discuss/75724/17-ms-Java-solution-with-segment-tree +type SegmentTreeNode struct { + start, end, sum int + left, right *SegmentTreeNode +} + +func (node *SegmentTreeNode) update(i, val int) { + if node.start == node.end { + node.sum = val + return + } + + mid := node.start + (node.end-node.start)/2 + if mid >= i { + node.left.update(i, val) + } else { + node.right.update(i, val) + } + + node.sum = node.left.sum + node.right.sum +} + +func (node *SegmentTreeNode) sumRange(i int, j int) int { + if node.start == i && node.end == j { + return node.sum + } + + mid := node.start + (node.end-node.start)/2 + if mid >= j { + return node.left.sumRange(i, j) + } else if mid < i { + return node.right.sumRange(i, j) + } else { + return node.left.sumRange(i, mid) + node.right.sumRange(mid+1, j) + } +} + +func buildTree(nums []int, start, end int) *SegmentTreeNode { + if start > end { + return nil + } + + node := &SegmentTreeNode{ + start: start, + end: end, + } + + if start == end { + node.sum = nums[start] + } else { + mid := start + (end-start)/2 + node.left = buildTree(nums, start, mid) + node.right = buildTree(nums, mid+1, end) + node.sum = node.left.sum + node.right.sum + } + + return node +} + +type NumArray struct { + root *SegmentTreeNode +} + +func Constructor(nums []int) NumArray { + return NumArray{ + buildTree(nums, 0, len(nums)-1), + } +} + +func (this *NumArray) Update(i int, val int) { + this.root.update(i, val) +} + +func (this *NumArray) SumRange(i int, j int) int { + return this.root.sumRange(i, j) +} + +/** + * Your NumArray object will be instantiated and called as such: + * obj := Constructor(nums); + * obj.Update(i,val); + * param_2 := obj.SumRange(i,j); + */ diff --git a/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable_test.go b/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable_test.go new file mode 100755 index 000000000..e18533413 --- /dev/null +++ b/Algorithms/0307.range-sum-query-mutable/range-sum-query-mutable_test.go @@ -0,0 +1,35 @@ +package problem0307 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var nums = []int{1, 3, 5} +var numsnil = []int{} + +func Test_NumArray(t *testing.T) { + ast := assert.New(t) + numArray := Constructor(nums) + + ast.Equal(9, numArray.SumRange(0, 2)) + numArray.Update(1, 2) + ast.Equal(8, numArray.SumRange(0, 2)) + ast.Equal(7, numArray.SumRange(1, 2)) + ast.Equal(1, numArray.SumRange(0, 0)) + + numArray1 := Constructor(numsnil) + ast.Nil(numArray1.root) + +} + +func Benchmark_NumArray(b *testing.B) { + for i := 0; i < b.N; i++ { + numArray := Constructor(nums) + numArray.SumRange(0, 2) + numArray.Update(1, 2) + numArray.SumRange(0, 2) + numArray.SumRange(1, 2) + } +} diff --git a/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/README.md b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/README.md new file mode 100755 index 000000000..447804246 --- /dev/null +++ b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/README.md @@ -0,0 +1,27 @@ +# [309. Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) + +## 题目 + +Say you have an array for which the ith element is the price of a given stock on day i. + +Design an algorithm to find the maximum profit. You may complete as many transactions as you like +(ie, buy one and sell one share of the stock multiple times) with the following restrictions: + +1. You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again). +1. After you sell your stock, you cannot buy stock on next day. (ie, cooldown 1 day) + +Example: + +```text +prices = [1, 2, 3, 0, 2] +maxProfit = 3 +transactions = [buy, sell, cooldown, buy, sell] +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 + +[别人的答题笔记](http://www.bijishequ.com/detail/464527) \ No newline at end of file diff --git a/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown.go b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown.go new file mode 100755 index 000000000..a523137f1 --- /dev/null +++ b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown.go @@ -0,0 +1,27 @@ +package problem0309 + +func maxProfit(prices []int) int { + n := len(prices) + if n == 0 { + return 0 + } + + // prices[i] 表示 第 i 天的价格 + buy := make([]int, n+1) + buy[1] = 0 - prices[0] + sel := make([]int, n+1) + + for i := 2; i <= n; i++ { + buy[i] = max(buy[i-1], sel[i-2]-prices[i-1]) + sel[i] = max(sel[i-1], buy[i-1]+prices[i-1]) + } + + return sel[n] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown_test.go b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown_test.go new file mode 100755 index 000000000..d451e0a5a --- /dev/null +++ b/Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown/best-time-to-buy-and-sell-stock-with-cooldown_test.go @@ -0,0 +1,38 @@ +package problem0309 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + prices []int + ans int +}{ + + {[]int{1, 2, 3, 0, 2}, 3}, + {[]int{}, 0}, + {[]int{3, 3}, 0}, + + // 可以有多个 testcase +} + +func Test_maxProfit(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxProfit(tc.prices), "输入:%v", tc) + } +} + +func Benchmark_maxProfit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxProfit(tc.prices) + } + } +} diff --git a/Algorithms/0310.minimum-height-trees/310.100.png b/Algorithms/0310.minimum-height-trees/310.100.png new file mode 100644 index 000000000..c39b852fc Binary files /dev/null and b/Algorithms/0310.minimum-height-trees/310.100.png differ diff --git a/Algorithms/0310.minimum-height-trees/README.md b/Algorithms/0310.minimum-height-trees/README.md new file mode 100755 index 000000000..8155d3c22 --- /dev/null +++ b/Algorithms/0310.minimum-height-trees/README.md @@ -0,0 +1,56 @@ +# [310. Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) + +## 题目 + +For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called minimum height trees (MHTs). +Given such a graph, write a function to find all the MHTs and return a list of their root labels. + +Format + +The graph contains n nodes which are labeled from 0 to n - 1. +You will be given the number n and a list of undirected edges (each edge is a pair of labels). + +You can assume that no duplicate edges will appear in edges. Since all edges are undirected, [0, 1] is the same as [1, 0] and thus will not appear together in edges. + +Example 1: + +```text +Given n = 4, edges = [[1, 0], [1, 2], [1, 3]] + + 0 + | + 1 + / \ + 2 3 + +return [1] +``` + +Example 2: + +```text +Given n = 6, edges = [[0, 3], [1, 3], [2, 3], [4, 3], [5, 4]] + + 0 1 2 + \ | / + 3 + | + 4 + | + 5 + +return [3, 4] +``` + +Note: + +1. According to the definition of tree on Wikipedia: “a tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree.” +1. The height of a rooted tree is the number of edges on the longest downward path between the root and a leaf. + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 + +![100](310.100.png) \ No newline at end of file diff --git a/Algorithms/0310.minimum-height-trees/minimum-height-trees.go b/Algorithms/0310.minimum-height-trees/minimum-height-trees.go new file mode 100755 index 000000000..b183429e4 --- /dev/null +++ b/Algorithms/0310.minimum-height-trees/minimum-height-trees.go @@ -0,0 +1,55 @@ +package problem0310 + +func findMinHeightTrees(n int, edges [][]int) []int { + if n == 1 { + return []int{0} + } + + // 所有与 i 节点相连接的节点名称,保存在 linkNodes[i] + linkNodes := make([][]int, n) + for i := 0; i < n; i++ { + linkNodes[i] = make([]int, 0, 5) + } + + // count[i] 保存了与 i 节点链接的点的个数 + count := make([]int, n) + for _, e := range edges { + linkNodes[e[0]] = append(linkNodes[e[0]], e[1]) + linkNodes[e[1]] = append(linkNodes[e[1]], e[0]) + count[e[0]]++ + count[e[1]]++ + } + + // 收集所有的 叶子 节点 + var leafs = make([]int, 0, n) + for i := 0; i < n; i++ { + if count[i] == 1 { + leafs = append(leafs, i) + } + } + + var nd, leaf int + + // 反复裁剪掉 叶子 节点。 + // 当剩余节点数 <=2 时,就是答案 + for n > 2 { + newLeafs := make([]int, 0, len(leafs)) + for _, leaf = range leafs { + n-- + for _, nd = range linkNodes[leaf] { + count[nd]-- + if count[nd] == 1 { + newLeafs = append(newLeafs, nd) + } + } + } + leafs = newLeafs + } + + var res = make([]int, 0, len(leafs)) + for _, v := range leafs { + res = append(res, v) + } + + return res +} diff --git a/Algorithms/0310.minimum-height-trees/minimum-height-trees_test.go b/Algorithms/0310.minimum-height-trees/minimum-height-trees_test.go new file mode 100755 index 000000000..365754017 --- /dev/null +++ b/Algorithms/0310.minimum-height-trees/minimum-height-trees_test.go @@ -0,0 +1,72 @@ +package problem0310 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + edges [][]int + ans []int +}{ + { + 1, + [][]int{}, + []int{0}, + }, + + { + 6, + [][]int{[]int{0, 3}, []int{1, 3}, []int{2, 3}, []int{4, 3}, []int{5, 4}}, + []int{3, 4}, + }, + + { + 3, [][]int{[]int{0, 1}, []int{0, 2}}, + []int{0}, + }, + + { + 4, + [][]int{[]int{1, 0}, []int{1, 2}, []int{1, 3}}, + []int{1}, + }, + + { + 10002, + [][]int{[]int{0,1},[]int{1,2},[]int{0,3},[]int{0,4},[]int{3,5},[]int{0,6},[]int{3,7},[]int{7,8},[]int{4,9},[]int{6,10},[]int{1,11},[]int{5,12},[]int{2,13},[]int{13,14},[]int{6,15},[]int{1,16},[]int{9,17},[]int{17,18},[]int{4,19},[]int{12,20},[]int{1,21},[]int{4,22},[]int{13,23},[]int{22,24},[]int{11,25},[]int{8,26},[]int{16,27},[]int{0,28},[]int{22,29},[]int{26,30},[]int{9,31},[]int{16,32},[]int{7,33},[]int{17,34},[]int{11,35},[]int{0,36},[]int{15,37},[]int{23,38},[]int{33,39},[]int{3,40},[]int{33,41},[]int{40,42},[]int{5,43},[]int{33,44},[]int{38,45},[]int{3,46},[]int{14,47},[]int{1,48},[]int{31,49},[]int{2,50},[]int{19,51},[]int{43,52},[]int{18,53},[]int{33,54},[]int{6,55},[]int{27,56},[]int{37,57},[]int{13,58},[]int{54,59},[]int{13,60},[]int{59,61},[]int{24,62},[]int{5,63},[]int{32,64},[]int{61,65},[]int{7,66},[]int{36,67},[]int{55,68},[]int{20,69},[]int{62,70},[]int{33,71},[]int{45,72},[]int{35,73},[]int{33,74},[]int{74,75},[]int{45,76},[]int{7,77},[]int{4,78},[]int{48,79},[]int{40,80},[]int{32,81},[]int{72,82},[]int{60,83},[]int{40,84},[]int{42,85},[]int{76,86},[]int{26,87},[]int{55,88},[]int{70,89},[]int{52,90},[]int{85,91},[]int{49,92},[]int{18,93},[]int{64,94},[]int{31,95},[]int{42,96},[]int{88,97},[]int{30,98},[]int{41,99},[]int{97,100},[]int{41,101},[]int{54,102},[]int{81,103},[]int{88,104},[]int{83,105},[]int{95,106},[]int{93,107},[]int{89,108},[]int{21,109},[]int{81,110},[]int{39,111},[]int{94,112},[]int{73,113},[]int{113,114},[]int{12,115},[]int{69,116},[]int{82,117},[]int{24,118},[]int{83,119},[]int{78,120},[]int{22,121},[]int{5,122},[]int{69,123},[]int{43,124},[]int{93,125},[]int{71,126},[]int{24,127},[]int{60,128},[]int{83,129},[]int{48,130},[]int{14,131},[]int{34,132},[]int{109,133},[]int{115,134},[]int{105,135},[]int{89,136},[]int{9,137},[]int{137,138},[]int{37,139},[]int{37,140},[]int{129,141},[]int{32,142},[]int{137,143},[]int{103,144},[]int{30,145},[]int{141,146},[]int{126,147},[]int{112,148},[]int{118,149},[]int{74,150},[]int{23,151},[]int{118,152},[]int{115,153},[]int{53,154},[]int{35,155},[]int{143,156},[]int{67,157},[]int{36,158},[]int{42,159},[]int{152,160},[]int{119,161},[]int{114,162},[]int{160,163},[]int{139,164},[]int{101,165},[]int{56,166},[]int{9,167},[]int{108,168},[]int{105,169},[]int{91,170},[]int{120,171},[]int{166,172},[]int{111,173},[]int{84,174},[]int{110,175},[]int{54,176},[]int{31,177},[]int{39,178},[]int{25,179},[]int{59,180},[]int{114,181},[]int{90,182},[]int{31,183},[]int{137,184},[]int{17,185},[]int{52,186},[]int{157,187},[]int{21,188},[]int{176,189},[]int{50,190},[]int{126,191},[]int{190,192},[]int{86,193},[]int{76,194},[]int{34,195},[]int{155,196},[]int{100,197},[]int{12,198},[]int{182,199},[]int{76,200},[]int{10,201},[]int{181,202},[]int{100,203},[]int{191,204},[]int{163,205},[]int{22,206},[]int{57,207},[]int{176,208},[]int{49,209},[]int{141,210},[]int{69,211},[]int{76,212},[]int{156,213},[]int{54,214},[]int{194,215},[]int{43,216},[]int{13,217},[]int{72,218},[]int{184,219},[]int{133,220},[]int{16,221},[]int{196,222},[]int{34,223},[]int{137,224},[]int{45,225},[]int{15,226},[]int{148,227},[]int{182,228},[]int{53,229},[]int{16,230},[]int{203,231},[]int{230,232},[]int{1,233},[]int{123,234},[]int{162,235},[]int{155,236},[]int{75,237},[]int{129,238},[]int{67,239},[]int{73,240},[]int{39,241},[]int{214,242},[]int{136,243},[]int{146,244},[]int{27,245},[]int{147,246},[]int{225,247},[]int{154,248},[]int{236,249},[]int{91,250},[]int{160,251},[]int{92,252},[]int{22,253},[]int{198,254},[]int{141,255},[]int{229,256},[]int{213,257},[]int{180,258},[]int{245,259},[]int{76,260},[]int{150,261},[]int{123,262},[]int{39,263},[]int{78,264},[]int{206,265},[]int{195,266},[]int{113,267},[]int{128,268},[]int{108,269},[]int{52,270},[]int{36,271},[]int{196,272},[]int{56,273},[]int{239,274},[]int{107,275},[]int{221,276},[]int{159,277},[]int{89,278},[]int{180,279},[]int{72,280},[]int{41,281},[]int{95,282},[]int{96,283},[]int{68,284},[]int{243,285},[]int{143,286},[]int{177,287},[]int{189,288},[]int{241,289},[]int{203,290},[]int{111,291},[]int{57,292},[]int{52,293},[]int{77,294},[]int{183,295},[]int{135,296},[]int{173,297},[]int{249,298},[]int{60,299},[]int{206,300},[]int{130,301},[]int{151,302},[]int{70,303},[]int{118,304},[]int{109,305},[]int{196,306},[]int{5,307},[]int{82,308},[]int{131,309},[]int{161,310},[]int{173,311},[]int{273,312},[]int{71,313},[]int{86,314},[]int{60,315},[]int{59,316},[]int{227,317},[]int{292,318},[]int{307,319},[]int{205,320},[]int{1,321},[]int{220,322},[]int{10,323},[]int{289,324},[]int{22,325},[]int{33,326},[]int{4,327},[]int{6,328},[]int{223,329},[]int{75,330},[]int{216,331},[]int{311,332},[]int{173,333},[]int{327,334},[]int{105,335},[]int{178,336},[]int{13,337},[]int{179,338},[]int{122,339},[]int{19,340},[]int{258,341},[]int{80,342},[]int{57,343},[]int{283,344},[]int{247,345},[]int{174,346},[]int{286,347},[]int{36,348},[]int{304,349},[]int{271,350},[]int{296,351},[]int{115,352},[]int{319,353},[]int{326,354},[]int{169,355},[]int{185,356},[]int{83,357},[]int{218,358},[]int{231,359},[]int{6,360},[]int{11,361},[]int{61,362},[]int{337,363},[]int{32,364},[]int{206,365},[]int{339,366},[]int{314,367},[]int{45,368},[]int{122,369},[]int{211,370},[]int{149,371},[]int{6,372},[]int{196,373},[]int{182,374},[]int{127,375},[]int{112,376},[]int{19,377},[]int{144,378},[]int{208,379},[]int{63,380},[]int{22,381},[]int{271,382},[]int{244,383},[]int{352,384},[]int{347,385},[]int{192,386},[]int{261,387},[]int{128,388},[]int{122,389},[]int{3,390},[]int{154,391},[]int{349,392},[]int{288,393},[]int{86,394},[]int{390,395},[]int{374,396},[]int{212,397},[]int{348,398},[]int{141,399},[]int{27,400},[]int{147,401},[]int{342,402},[]int{37,403},[]int{230,404},[]int{316,405},[]int{342,406},[]int{122,407},[]int{204,408},[]int{347,409},[]int{350,410},[]int{309,411},[]int{284,412},[]int{206,413},[]int{412,414},[]int{57,415},[]int{203,416},[]int{342,417},[]int{14,418},[]int{117,419},[]int{46,420},[]int{355,421},[]int{31,422},[]int{356,423},[]int{325,424},[]int{348,425},[]int{399,426},[]int{190,427},[]int{92,428},[]int{260,429},[]int{77,430},[]int{288,431},[]int{175,432},[]int{282,433},[]int{48,434},[]int{158,435},[]int{282,436},[]int{99,437},[]int{23,438},[]int{388,439},[]int{60,440},[]int{45,441},[]int{192,442},[]int{54,443},[]int{327,444},[]int{414,445},[]int{121,446},[]int{84,447},[]int{294,448},[]int{116,449},[]int{57,450},[]int{447,451},[]int{327,452},[]int{19,453},[]int{217,454},[]int{104,455},[]int{274,456},[]int{113,457},[]int{415,458},[]int{346,459},[]int{290,460},[]int{314,461},[]int{201,462},[]int{328,463},[]int{367,464},[]int{411,465},[]int{289,466},[]int{85,467},[]int{141,468},[]int{421,469},[]int{380,470},[]int{30,471},[]int{244,472},[]int{368,473},[]int{109,474},[]int{450,475},[]int{105,476},[]int{8,477},[]int{116,478},[]int{232,479},[]int{422,480},[]int{65,481},[]int{207,482},[]int{389,483},[]int{347,484},[]int{451,485},[]int{480,486},[]int{382,487},[]int{169,488},[]int{301,489},[]int{100,490},[]int{447,491},[]int{472,492},[]int{410,493},[]int{366,494},[]int{223,495},[]int{316,496},[]int{414,497},[]int{279,498},[]int{247,499},[]int{172,500},[]int{206,501},[]int{410,502},[]int{165,503},[]int{296,504},[]int{461,505},[]int{423,506},[]int{265,507},[]int{205,508},[]int{80,509},[]int{135,510},[]int{181,511},[]int{493,512},[]int{203,513},[]int{373,514},[]int{305,515},[]int{338,516},[]int{35,517},[]int{320,518},[]int{267,519},[]int{454,520},[]int{11,521},[]int{349,522},[]int{480,523},[]int{150,524},[]int{484,525},[]int{513,526},[]int{250,527},[]int{29,528},[]int{323,529},[]int{482,530},[]int{508,531},[]int{164,532},[]int{122,533},[]int{504,534},[]int{329,535},[]int{307,536},[]int{450,537},[]int{345,538},[]int{380,539},[]int{262,540},[]int{1,541},[]int{163,542},[]int{207,543},[]int{292,544},[]int{350,545},[]int{471,546},[]int{378,547},[]int{101,548},[]int{440,549},[]int{382,550},[]int{107,551},[]int{53,552},[]int{46,553},[]int{436,554},[]int{174,555},[]int{300,556},[]int{472,557},[]int{555,558},[]int{100,559},[]int{260,560},[]int{552,561},[]int{362,562},[]int{198,563},[]int{146,564},[]int{275,565},[]int{395,566},[]int{365,567},[]int{250,568},[]int{195,569},[]int{516,570},[]int{495,571},[]int{410,572},[]int{279,573},[]int{48,574},[]int{483,575},[]int{266,576},[]int{241,577},[]int{22,578},[]int{330,579},[]int{238,580},[]int{405,581},[]int{351,582},[]int{239,583},[]int{129,584},[]int{398,585},[]int{55,586},[]int{240,587},[]int{211,588},[]int{31,589},[]int{191,590},[]int{388,591},[]int{6,592},[]int{180,593},[]int{542,594},[]int{471,595},[]int{357,596},[]int{156,597},[]int{529,598},[]int{486,599},[]int{584,600},[]int{127,601},[]int{586,602},[]int{372,603},[]int{449,604},[]int{591,605},[]int{491,606},[]int{181,607},[]int{485,608},[]int{390,609},[]int{79,610},[]int{456,611},[]int{323,612},[]int{201,613},[]int{127,614},[]int{506,615},[]int{239,616},[]int{559,617},[]int{574,618},[]int{496,619},[]int{170,620},[]int{133,621},[]int{136,622},[]int{79,623},[]int{214,624},[]int{208,625},[]int{174,626},[]int{501,627},[]int{416,628},[]int{550,629},[]int{193,630},[]int{433,631},[]int{515,632},[]int{528,633},[]int{553,634},[]int{603,635},[]int{485,636},[]int{622,637},[]int{424,638},[]int{214,639},[]int{360,640},[]int{501,641},[]int{434,642},[]int{537,643},[]int{159,644},[]int{583,645},[]int{21,646},[]int{574,647},[]int{474,648},[]int{360,649},[]int{221,650},[]int{164,651},[]int{57,652},[]int{389,653},[]int{560,654},[]int{642,655},[]int{217,656},[]int{558,657},[]int{640,658},[]int{632,659},[]int{649,660},[]int{387,661},[]int{132,662},[]int{657,663},[]int{157,664},[]int{141,665},[]int{550,666},[]int{108,667},[]int{587,668},[]int{650,669},[]int{171,670},[]int{215,671},[]int{616,672},[]int{589,673},[]int{313,674},[]int{560,675},[]int{66,676},[]int{121,677},[]int{49,678},[]int{125,679},[]int{440,680},[]int{196,681},[]int{364,682},[]int{606,683},[]int{232,684},[]int{449,685},[]int{372,686},[]int{15,687},[]int{83,688},[]int{71,689},[]int{537,690},[]int{249,691},[]int{300,692},[]int{365,693},[]int{198,694},[]int{584,695},[]int{666,696},[]int{594,697},[]int{625,698},[]int{18,699},[]int{24,700},[]int{400,701},[]int{697,702},[]int{306,703},[]int{632,704},[]int{417,705},[]int{557,706},[]int{586,707},[]int{216,708},[]int{687,709},[]int{79,710},[]int{562,711},[]int{298,712},[]int{191,713},[]int{106,714},[]int{714,715},[]int{19,716},[]int{415,717},[]int{249,718},[]int{327,719},[]int{263,720},[]int{539,721},[]int{503,722},[]int{121,723},[]int{103,724},[]int{405,725},[]int{168,726},[]int{550,727},[]int{727,728},[]int{1,729},[]int{590,730},[]int{413,731},[]int{503,732},[]int{482,733},[]int{434,734},[]int{256,735},[]int{141,736},[]int{458,737},[]int{698,738},[]int{737,739},[]int{678,740},[]int{157,741},[]int{136,742},[]int{605,743},[]int{87,744},[]int{172,745},[]int{305,746},[]int{476,747},[]int{290,748},[]int{303,749},[]int{470,750},[]int{218,751},[]int{346,752},[]int{405,753},[]int{409,754},[]int{320,755},[]int{584,756},[]int{70,757},[]int{638,758},[]int{726,759},[]int{544,760},[]int{53,761},[]int{43,762},[]int{666,763},[]int{340,764},[]int{74,765},[]int{205,766},[]int{417,767},[]int{283,768},[]int{27,769},[]int{332,770},[]int{134,771},[]int{62,772},[]int{145,773},[]int{151,774},[]int{558,775},[]int{57,776},[]int{500,777},[]int{763,778},[]int{547,779},[]int{174,780},[]int{406,781},[]int{528,782},[]int{86,783},[]int{208,784},[]int{180,785},[]int{159,786},[]int{690,787},[]int{541,788},[]int{144,789},[]int{157,790},[]int{716,791},[]int{680,792},[]int{680,793},[]int{436,794},[]int{208,795},[]int{675,796},[]int{720,797},[]int{608,798},[]int{317,799},[]int{278,800},[]int{148,801},[]int{375,802},[]int{243,803},[]int{202,804},[]int{210,805},[]int{198,806},[]int{341,807},[]int{157,808},[]int{120,809},[]int{763,810},[]int{553,811},[]int{253,812},[]int{304,813},[]int{158,814},[]int{380,815},[]int{604,816},[]int{85,817},[]int{719,818},[]int{774,819},[]int{552,820},[]int{597,821},[]int{431,822},[]int{68,823},[]int{429,824},[]int{94,825},[]int{43,826},[]int{666,827},[]int{180,828},[]int{297,829},[]int{750,830},[]int{183,831},[]int{433,832},[]int{404,833},[]int{417,834},[]int{192,835},[]int{541,836},[]int{248,837},[]int{133,838},[]int{799,839},[]int{742,840},[]int{709,841},[]int{520,842},[]int{370,843},[]int{581,844},[]int{618,845},[]int{276,846},[]int{380,847},[]int{691,848},[]int{662,849},[]int{511,850},[]int{92,851},[]int{464,852},[]int{125,853},[]int{510,854},[]int{465,855},[]int{616,856},[]int{105,857},[]int{374,858},[]int{427,859},[]int{43,860},[]int{807,861},[]int{840,862},[]int{422,863},[]int{97,864},[]int{263,865},[]int{562,866},[]int{555,867},[]int{111,868},[]int{449,869},[]int{656,870},[]int{178,871},[]int{809,872},[]int{742,873},[]int{52,874},[]int{741,875},[]int{429,876},[]int{141,877},[]int{751,878},[]int{484,879},[]int{457,880},[]int{644,881},[]int{128,882},[]int{137,883},[]int{401,884},[]int{248,885},[]int{113,886},[]int{601,887},[]int{136,888},[]int{353,889},[]int{828,890},[]int{67,891},[]int{877,892},[]int{563,893},[]int{434,894},[]int{65,895},[]int{665,896},[]int{754,897},[]int{76,898},[]int{642,899},[]int{884,900},[]int{569,901},[]int{204,902},[]int{143,903},[]int{218,904},[]int{328,905},[]int{688,906},[]int{816,907},[]int{425,908},[]int{649,909},[]int{266,910},[]int{581,911},[]int{49,912},[]int{327,913},[]int{416,914},[]int{781,915},[]int{811,916},[]int{643,917},[]int{394,918},[]int{71,919},[]int{135,920},[]int{13,921},[]int{25,922},[]int{458,923},[]int{457,924},[]int{248,925},[]int{733,926},[]int{204,927},[]int{334,928},[]int{197,929},[]int{526,930},[]int{481,931},[]int{609,932},[]int{410,933},[]int{718,934},[]int{175,935},[]int{109,936},[]int{205,937},[]int{264,938},[]int{710,939},[]int{74,940},[]int{64,941},[]int{192,942},[]int{711,943},[]int{0,944},[]int{528,945},[]int{546,946},[]int{941,947},[]int{587,948},[]int{207,949},[]int{124,950},[]int{619,951},[]int{722,952},[]int{276,953},[]int{931,954},[]int{287,955},[]int{58,956},[]int{478,957},[]int{58,958},[]int{8,959},[]int{244,960},[]int{438,961},[]int{626,962},[]int{282,963},[]int{400,964},[]int{77,965},[]int{774,966},[]int{696,967},[]int{789,968},[]int{286,969},[]int{726,970},[]int{356,971},[]int{762,972},[]int{644,973},[]int{304,974},[]int{52,975},[]int{890,976},[]int{931,977},[]int{220,978},[]int{614,979},[]int{879,980},[]int{682,981},[]int{925,982},[]int{546,983},[]int{940,984},[]int{306,985},[]int{329,986},[]int{411,987},[]int{302,988},[]int{106,989},[]int{982,990},[]int{92,991},[]int{319,992},[]int{440,993},[]int{504,994},[]int{604,995},[]int{711,996},[]int{145,997},[]int{194,998},[]int{408,999},[]int{950,1000},[]int{740,1001},[]int{941,1002},[]int{331,1003},[]int{403,1004},[]int{422,1005},[]int{190,1006},[]int{37,1007},[]int{754,1008},[]int{145,1009},[]int{192,1010},[]int{447,1011},[]int{753,1012},[]int{466,1013},[]int{789,1014},[]int{762,1015},[]int{698,1016},[]int{368,1017},[]int{52,1018},[]int{693,1019},[]int{373,1020},[]int{148,1021},[]int{36,1022},[]int{187,1023},[]int{667,1024},[]int{552,1025},[]int{680,1026},[]int{805,1027},[]int{269,1028},[]int{82,1029},[]int{86,1030},[]int{122,1031},[]int{446,1032},[]int{137,1033},[]int{813,1034},[]int{817,1035},[]int{823,1036},[]int{58,1037},[]int{819,1038},[]int{1025,1039},[]int{749,1040},[]int{628,1041},[]int{625,1042},[]int{657,1043},[]int{492,1044},[]int{176,1045},[]int{257,1046},[]int{170,1047},[]int{976,1048},[]int{142,1049},[]int{304,1050},[]int{973,1051},[]int{125,1052},[]int{800,1053},[]int{561,1054},[]int{270,1055},[]int{753,1056},[]int{936,1057},[]int{982,1058},[]int{499,1059},[]int{982,1060},[]int{143,1061},[]int{375,1062},[]int{763,1063},[]int{871,1064},[]int{868,1065},[]int{253,1066},[]int{1060,1067},[]int{360,1068},[]int{575,1069},[]int{164,1070},[]int{578,1071},[]int{542,1072},[]int{494,1073},[]int{431,1074},[]int{720,1075},[]int{96,1076},[]int{757,1077},[]int{519,1078},[]int{228,1079},[]int{209,1080},[]int{384,1081},[]int{786,1082},[]int{657,1083},[]int{151,1084},[]int{995,1085},[]int{395,1086},[]int{1009,1087},[]int{2,1088},[]int{149,1089},[]int{641,1090},[]int{13,1091},[]int{410,1092},[]int{159,1093},[]int{498,1094},[]int{691,1095},[]int{597,1096},[]int{122,1097},[]int{588,1098},[]int{301,1099},[]int{385,1100},[]int{928,1101},[]int{826,1102},[]int{785,1103},[]int{699,1104},[]int{755,1105},[]int{956,1106},[]int{803,1107},[]int{961,1108},[]int{424,1109},[]int{364,1110},[]int{435,1111},[]int{442,1112},[]int{463,1113},[]int{1004,1114},[]int{613,1115},[]int{868,1116},[]int{367,1117},[]int{599,1118},[]int{24,1119},[]int{999,1120},[]int{398,1121},[]int{403,1122},[]int{159,1123},[]int{273,1124},[]int{893,1125},[]int{453,1126},[]int{238,1127},[]int{870,1128},[]int{1023,1129},[]int{231,1130},[]int{838,1131},[]int{842,1132},[]int{912,1133},[]int{830,1134},[]int{151,1135},[]int{341,1136},[]int{355,1137},[]int{1020,1138},[]int{240,1139},[]int{1036,1140},[]int{112,1141},[]int{1088,1142},[]int{201,1143},[]int{215,1144},[]int{788,1145},[]int{675,1146},[]int{667,1147},[]int{759,1148},[]int{1087,1149},[]int{629,1150},[]int{196,1151},[]int{501,1152},[]int{138,1153},[]int{570,1154},[]int{125,1155},[]int{116,1156},[]int{380,1157},[]int{992,1158},[]int{554,1159},[]int{452,1160},[]int{1082,1161},[]int{911,1162},[]int{126,1163},[]int{976,1164},[]int{261,1165},[]int{686,1166},[]int{1039,1167},[]int{179,1168},[]int{1161,1169},[]int{611,1170},[]int{22,1171},[]int{275,1172},[]int{904,1173},[]int{526,1174},[]int{934,1175},[]int{747,1176},[]int{746,1177},[]int{407,1178},[]int{266,1179},[]int{1072,1180},[]int{890,1181},[]int{121,1182},[]int{59,1183},[]int{895,1184},[]int{0,1185},[]int{246,1186},[]int{39,1187},[]int{185,1188},[]int{307,1189},[]int{1186,1190},[]int{308,1191},[]int{371,1192},[]int{609,1193},[]int{308,1194},[]int{695,1195},[]int{237,1196},[]int{252,1197},[]int{1095,1198},[]int{259,1199},[]int{583,1200},[]int{697,1201},[]int{573,1202},[]int{610,1203},[]int{28,1204},[]int{726,1205},[]int{1125,1206},[]int{467,1207},[]int{651,1208},[]int{415,1209},[]int{295,1210},[]int{505,1211},[]int{1183,1212},[]int{934,1213},[]int{429,1214},[]int{1027,1215},[]int{90,1216},[]int{588,1217},[]int{1206,1218},[]int{783,1219},[]int{1098,1220},[]int{250,1221},[]int{1155,1222},[]int{1057,1223},[]int{657,1224},[]int{383,1225},[]int{437,1226},[]int{947,1227},[]int{679,1228},[]int{556,1229},[]int{892,1230},[]int{1193,1231},[]int{998,1232},[]int{630,1233},[]int{104,1234},[]int{1110,1235},[]int{1162,1236},[]int{537,1237},[]int{907,1238},[]int{447,1239},[]int{635,1240},[]int{905,1241},[]int{1040,1242},[]int{402,1243},[]int{816,1244},[]int{402,1245},[]int{880,1246},[]int{726,1247},[]int{346,1248},[]int{218,1249},[]int{588,1250},[]int{11,1251},[]int{658,1252},[]int{876,1253},[]int{1036,1254},[]int{994,1255},[]int{1192,1256},[]int{228,1257},[]int{944,1258},[]int{764,1259},[]int{401,1260},[]int{1056,1261},[]int{1186,1262},[]int{776,1263},[]int{660,1264},[]int{103,1265},[]int{757,1266},[]int{1047,1267},[]int{609,1268},[]int{329,1269},[]int{259,1270},[]int{343,1271},[]int{350,1272},[]int{498,1273},[]int{590,1274},[]int{436,1275},[]int{380,1276},[]int{819,1277},[]int{439,1278},[]int{1274,1279},[]int{978,1280},[]int{201,1281},[]int{261,1282},[]int{74,1283},[]int{517,1284},[]int{1181,1285},[]int{1090,1286},[]int{986,1287},[]int{748,1288},[]int{210,1289},[]int{483,1290},[]int{840,1291},[]int{215,1292},[]int{864,1293},[]int{1138,1294},[]int{101,1295},[]int{164,1296},[]int{230,1297},[]int{348,1298},[]int{358,1299},[]int{357,1300},[]int{623,1301},[]int{1300,1302},[]int{919,1303},[]int{1105,1304},[]int{209,1305},[]int{719,1306},[]int{89,1307},[]int{1197,1308},[]int{1220,1309},[]int{287,1310},[]int{9,1311},[]int{119,1312},[]int{672,1313},[]int{512,1314},[]int{166,1315},[]int{499,1316},[]int{53,1317},[]int{651,1318},[]int{1288,1319},[]int{115,1320},[]int{163,1321},[]int{262,1322},[]int{580,1323},[]int{797,1324},[]int{764,1325},[]int{336,1326},[]int{1054,1327},[]int{379,1328},[]int{747,1329},[]int{13,1330},[]int{123,1331},[]int{870,1332},[]int{1099,1333},[]int{1285,1334},[]int{844,1335},[]int{968,1336},[]int{740,1337},[]int{142,1338},[]int{183,1339},[]int{1113,1340},[]int{924,1341},[]int{793,1342},[]int{1277,1343},[]int{701,1344},[]int{1262,1345},[]int{810,1346},[]int{165,1347},[]int{93,1348},[]int{1170,1349},[]int{788,1350},[]int{685,1351},[]int{303,1352},[]int{624,1353},[]int{120,1354},[]int{339,1355},[]int{1187,1356},[]int{657,1357},[]int{583,1358},[]int{1339,1359},[]int{540,1360},[]int{1003,1361},[]int{0,1362},[]int{729,1363},[]int{917,1364},[]int{252,1365},[]int{401,1366},[]int{751,1367},[]int{1366,1368},[]int{32,1369},[]int{1110,1370},[]int{720,1371},[]int{491,1372},[]int{406,1373},[]int{734,1374},[]int{661,1375},[]int{1271,1376},[]int{850,1377},[]int{1090,1378},[]int{677,1379},[]int{725,1380},[]int{1002,1381},[]int{574,1382},[]int{261,1383},[]int{1308,1384},[]int{362,1385},[]int{765,1386},[]int{669,1387},[]int{606,1388},[]int{85,1389},[]int{948,1390},[]int{728,1391},[]int{92,1392},[]int{1234,1393},[]int{255,1394},[]int{1353,1395},[]int{312,1396},[]int{306,1397},[]int{1306,1398},[]int{690,1399},[]int{944,1400},[]int{133,1401},[]int{703,1402},[]int{644,1403},[]int{823,1404},[]int{1331,1405},[]int{563,1406},[]int{873,1407},[]int{506,1408},[]int{874,1409},[]int{1228,1410},[]int{811,1411},[]int{289,1412},[]int{96,1413},[]int{580,1414},[]int{114,1415},[]int{248,1416},[]int{1307,1417},[]int{501,1418},[]int{441,1419},[]int{752,1420},[]int{1158,1421},[]int{1080,1422},[]int{546,1423},[]int{335,1424},[]int{166,1425},[]int{351,1426},[]int{995,1427},[]int{637,1428},[]int{1067,1429},[]int{837,1430},[]int{93,1431},[]int{506,1432},[]int{238,1433},[]int{838,1434},[]int{1379,1435},[]int{245,1436},[]int{134,1437},[]int{72,1438},[]int{539,1439},[]int{1114,1440},[]int{85,1441},[]int{841,1442},[]int{769,1443},[]int{1196,1444},[]int{1349,1445},[]int{157,1446},[]int{239,1447},[]int{92,1448},[]int{242,1449},[]int{936,1450},[]int{861,1451},[]int{1415,1452},[]int{891,1453},[]int{730,1454},[]int{423,1455},[]int{649,1456},[]int{1196,1457},[]int{420,1458},[]int{494,1459},[]int{471,1460},[]int{738,1461},[]int{1246,1462},[]int{123,1463},[]int{1271,1464},[]int{808,1465},[]int{855,1466},[]int{428,1467},[]int{413,1468},[]int{1149,1469},[]int{1002,1470},[]int{1379,1471},[]int{874,1472},[]int{626,1473},[]int{143,1474},[]int{1146,1475},[]int{874,1476},[]int{176,1477},[]int{1146,1478},[]int{1413,1479},[]int{1247,1480},[]int{657,1481},[]int{754,1482},[]int{291,1483},[]int{154,1484},[]int{768,1485},[]int{129,1486},[]int{204,1487},[]int{1085,1488},[]int{799,1489},[]int{424,1490},[]int{1068,1491},[]int{722,1492},[]int{1026,1493},[]int{313,1494},[]int{870,1495},[]int{460,1496},[]int{724,1497},[]int{321,1498},[]int{623,1499},[]int{1156,1500},[]int{661,1501},[]int{734,1502},[]int{493,1503},[]int{703,1504},[]int{602,1505},[]int{1002,1506},[]int{1394,1507},[]int{199,1508},[]int{1363,1509},[]int{752,1510},[]int{1015,1511},[]int{1331,1512},[]int{838,1513},[]int{494,1514},[]int{435,1515},[]int{897,1516},[]int{910,1517},[]int{229,1518},[]int{842,1519},[]int{703,1520},[]int{117,1521},[]int{1493,1522},[]int{1339,1523},[]int{955,1524},[]int{1242,1525},[]int{612,1526},[]int{1238,1527},[]int{692,1528},[]int{785,1529},[]int{682,1530},[]int{707,1531},[]int{469,1532},[]int{34,1533},[]int{295,1534},[]int{370,1535},[]int{237,1536},[]int{712,1537},[]int{190,1538},[]int{1513,1539},[]int{1487,1540},[]int{677,1541},[]int{1363,1542},[]int{1300,1543},[]int{1109,1544},[]int{789,1545},[]int{777,1546},[]int{991,1547},[]int{133,1548},[]int{510,1549},[]int{977,1550},[]int{890,1551},[]int{1029,1552},[]int{1023,1553},[]int{419,1554},[]int{496,1555},[]int{956,1556},[]int{203,1557},[]int{553,1558},[]int{1049,1559},[]int{516,1560},[]int{437,1561},[]int{1391,1562},[]int{877,1563},[]int{419,1564},[]int{1465,1565},[]int{204,1566},[]int{496,1567},[]int{967,1568},[]int{558,1569},[]int{364,1570},[]int{960,1571},[]int{1219,1572},[]int{156,1573},[]int{1340,1574},[]int{1460,1575},[]int{921,1576},[]int{41,1577},[]int{927,1578},[]int{1007,1579},[]int{1444,1580},[]int{415,1581},[]int{1190,1582},[]int{1089,1583},[]int{113,1584},[]int{241,1585},[]int{201,1586},[]int{603,1587},[]int{67,1588},[]int{470,1589},[]int{1109,1590},[]int{88,1591},[]int{1336,1592},[]int{128,1593},[]int{311,1594},[]int{703,1595},[]int{928,1596},[]int{757,1597},[]int{1201,1598},[]int{1083,1599},[]int{1506,1600},[]int{615,1601},[]int{1032,1602},[]int{1333,1603},[]int{705,1604},[]int{1312,1605},[]int{870,1606},[]int{1147,1607},[]int{1530,1608},[]int{1070,1609},[]int{717,1610},[]int{1505,1611},[]int{1475,1612},[]int{1372,1613},[]int{975,1614},[]int{696,1615},[]int{1560,1616},[]int{185,1617},[]int{461,1618},[]int{375,1619},[]int{190,1620},[]int{734,1621},[]int{158,1622},[]int{993,1623},[]int{92,1624},[]int{1024,1625},[]int{208,1626},[]int{1151,1627},[]int{1144,1628},[]int{1582,1629},[]int{977,1630},[]int{1375,1631},[]int{1201,1632},[]int{199,1633},[]int{796,1634},[]int{781,1635},[]int{663,1636},[]int{920,1637},[]int{399,1638},[]int{904,1639},[]int{421,1640},[]int{379,1641},[]int{127,1642},[]int{1114,1643},[]int{847,1644},[]int{168,1645},[]int{1583,1646},[]int{1187,1647},[]int{109,1648},[]int{714,1649},[]int{997,1650},[]int{658,1651},[]int{1451,1652},[]int{288,1653},[]int{945,1654},[]int{717,1655},[]int{1515,1656},[]int{1586,1657},[]int{1316,1658},[]int{600,1659},[]int{713,1660},[]int{110,1661},[]int{287,1662},[]int{161,1663},[]int{41,1664},[]int{547,1665},[]int{522,1666},[]int{34,1667},[]int{1380,1668},[]int{212,1669},[]int{162,1670},[]int{352,1671},[]int{1397,1672},[]int{1073,1673},[]int{1302,1674},[]int{237,1675},[]int{471,1676},[]int{662,1677},[]int{1484,1678},[]int{510,1679},[]int{789,1680},[]int{239,1681},[]int{531,1682},[]int{799,1683},[]int{685,1684},[]int{1027,1685},[]int{1415,1686},[]int{214,1687},[]int{1570,1688},[]int{260,1689},[]int{1338,1690},[]int{856,1691},[]int{1524,1692},[]int{301,1693},[]int{746,1694},[]int{58,1695},[]int{1342,1696},[]int{1428,1697},[]int{1150,1698},[]int{1072,1699},[]int{1452,1700},[]int{138,1701},[]int{1589,1702},[]int{1335,1703},[]int{191,1704},[]int{544,1705},[]int{322,1706},[]int{103,1707},[]int{175,1708},[]int{874,1709},[]int{561,1710},[]int{1384,1711},[]int{516,1712},[]int{21,1713},[]int{805,1714},[]int{1379,1715},[]int{864,1716},[]int{109,1717},[]int{1243,1718},[]int{194,1719},[]int{172,1720},[]int{401,1721},[]int{732,1722},[]int{1231,1723},[]int{1254,1724},[]int{525,1725},[]int{385,1726},[]int{156,1727},[]int{36,1728},[]int{623,1729},[]int{1211,1730},[]int{171,1731},[]int{764,1732},[]int{1498,1733},[]int{1458,1734},[]int{1487,1735},[]int{351,1736},[]int{1499,1737},[]int{902,1738},[]int{1314,1739},[]int{19,1740},[]int{603,1741},[]int{369,1742},[]int{747,1743},[]int{29,1744},[]int{859,1745},[]int{592,1746},[]int{812,1747},[]int{1673,1748},[]int{378,1749},[]int{1710,1750},[]int{166,1751},[]int{703,1752},[]int{722,1753},[]int{1452,1754},[]int{28,1755},[]int{1094,1756},[]int{298,1757},[]int{1670,1758},[]int{572,1759},[]int{590,1760},[]int{881,1761},[]int{1584,1762},[]int{1274,1763},[]int{806,1764},[]int{1121,1765},[]int{1065,1766},[]int{592,1767},[]int{913,1768},[]int{920,1769},[]int{1035,1770},[]int{1359,1771},[]int{56,1772},[]int{283,1773},[]int{1299,1774},[]int{458,1775},[]int{837,1776},[]int{1331,1777},[]int{1000,1778},[]int{703,1779},[]int{346,1780},[]int{1163,1781},[]int{1058,1782},[]int{1771,1783},[]int{44,1784},[]int{1627,1785},[]int{1194,1786},[]int{540,1787},[]int{1656,1788},[]int{1082,1789},[]int{490,1790},[]int{86,1791},[]int{561,1792},[]int{234,1793},[]int{27,1794},[]int{117,1795},[]int{1352,1796},[]int{1208,1797},[]int{1102,1798},[]int{1342,1799},[]int{144,1800},[]int{509,1801},[]int{1001,1802},[]int{518,1803},[]int{1576,1804},[]int{482,1805},[]int{638,1806},[]int{624,1807},[]int{1392,1808},[]int{203,1809},[]int{1659,1810},[]int{1178,1811},[]int{745,1812},[]int{1794,1813},[]int{252,1814},[]int{835,1815},[]int{1786,1816},[]int{350,1817},[]int{1048,1818},[]int{1205,1819},[]int{496,1820},[]int{1661,1821},[]int{106,1822},[]int{537,1823},[]int{1248,1824},[]int{131,1825},[]int{1367,1826},[]int{1491,1827},[]int{1796,1828},[]int{931,1829},[]int{702,1830},[]int{1499,1831},[]int{489,1832},[]int{756,1833},[]int{1206,1834},[]int{1587,1835},[]int{765,1836},[]int{983,1837},[]int{107,1838},[]int{684,1839},[]int{49,1840},[]int{408,1841},[]int{305,1842},[]int{1014,1843},[]int{141,1844},[]int{664,1845},[]int{1405,1846},[]int{262,1847},[]int{131,1848},[]int{331,1849},[]int{132,1850},[]int{1539,1851},[]int{578,1852},[]int{907,1853},[]int{1467,1854},[]int{773,1855},[]int{817,1856},[]int{1053,1857},[]int{49,1858},[]int{534,1859},[]int{880,1860},[]int{443,1861},[]int{601,1862},[]int{1182,1863},[]int{1055,1864},[]int{1233,1865},[]int{881,1866},[]int{865,1867},[]int{1654,1868},[]int{754,1869},[]int{472,1870},[]int{115,1871},[]int{573,1872},[]int{523,1873},[]int{1572,1874},[]int{1780,1875},[]int{966,1876},[]int{694,1877},[]int{176,1878},[]int{142,1879},[]int{148,1880},[]int{145,1881},[]int{260,1882},[]int{733,1883},[]int{514,1884},[]int{1535,1885},[]int{1242,1886},[]int{231,1887},[]int{117,1888},[]int{1182,1889},[]int{559,1890},[]int{857,1891},[]int{11,1892},[]int{625,1893},[]int{948,1894},[]int{788,1895},[]int{1695,1896},[]int{108,1897},[]int{326,1898},[]int{1103,1899},[]int{895,1900},[]int{1491,1901},[]int{94,1902},[]int{1217,1903},[]int{1512,1904},[]int{1453,1905},[]int{1772,1906},[]int{1642,1907},[]int{1320,1908},[]int{1268,1909},[]int{6,1910},[]int{1423,1911},[]int{1512,1912},[]int{1177,1913},[]int{831,1914},[]int{1542,1915},[]int{641,1916},[]int{777,1917},[]int{178,1918},[]int{1311,1919},[]int{771,1920},[]int{138,1921},[]int{1814,1922},[]int{760,1923},[]int{1686,1924},[]int{521,1925},[]int{1456,1926},[]int{1904,1927},[]int{1261,1928},[]int{1635,1929},[]int{1243,1930},[]int{100,1931},[]int{108,1932},[]int{681,1933},[]int{1676,1934},[]int{1299,1935},[]int{597,1936},[]int{623,1937},[]int{1066,1938},[]int{1177,1939},[]int{1527,1940},[]int{1532,1941},[]int{531,1942},[]int{1434,1943},[]int{348,1944},[]int{1058,1945},[]int{43,1946},[]int{1636,1947},[]int{62,1948},[]int{1303,1949},[]int{714,1950},[]int{178,1951},[]int{1037,1952},[]int{1460,1953},[]int{1041,1954},[]int{1242,1955},[]int{455,1956},[]int{1801,1957},[]int{24,1958},[]int{1192,1959},[]int{636,1960},[]int{871,1961},[]int{1368,1962},[]int{1833,1963},[]int{553,1964},[]int{779,1965},[]int{1149,1966},[]int{641,1967},[]int{1129,1968},[]int{424,1969},[]int{398,1970},[]int{1824,1971},[]int{1232,1972},[]int{1656,1973},[]int{686,1974},[]int{1971,1975},[]int{1756,1976},[]int{45,1977},[]int{482,1978},[]int{943,1979},[]int{204,1980},[]int{1715,1981},[]int{34,1982},[]int{1727,1983},[]int{1864,1984},[]int{103,1985},[]int{132,1986},[]int{200,1987},[]int{747,1988},[]int{1245,1989},[]int{823,1990},[]int{125,1991},[]int{1097,1992},[]int{1737,1993},[]int{1659,1994},[]int{943,1995},[]int{226,1996},[]int{1156,1997},[]int{866,1998},[]int{1031,1999},[]int{600,2000},[]int{1637,2001},[]int{186,2002},[]int{859,2003},[]int{617,2004},[]int{1862,2005},[]int{1118,2006},[]int{1953,2007},[]int{1227,2008},[]int{794,2009},[]int{675,2010},[]int{1217,2011},[]int{1677,2012},[]int{1815,2013},[]int{1129,2014},[]int{1505,2015},[]int{679,2016},[]int{530,2017},[]int{101,2018},[]int{1767,2019},[]int{883,2020},[]int{1214,2021},[]int{465,2022},[]int{1869,2023},[]int{120,2024},[]int{1368,2025},[]int{1436,2026},[]int{1835,2027},[]int{1336,2028},[]int{85,2029},[]int{589,2030},[]int{1540,2031},[]int{277,2032},[]int{1249,2033},[]int{334,2034},[]int{1970,2035},[]int{1908,2036},[]int{162,2037},[]int{984,2038},[]int{557,2039},[]int{734,2040},[]int{1542,2041},[]int{1541,2042},[]int{519,2043},[]int{257,2044},[]int{167,2045},[]int{1044,2046},[]int{1166,2047},[]int{1708,2048},[]int{1065,2049},[]int{200,2050},[]int{76,2051},[]int{1394,2052},[]int{1405,2053},[]int{1837,2054},[]int{1856,2055},[]int{1189,2056},[]int{208,2057},[]int{226,2058},[]int{511,2059},[]int{642,2060},[]int{1160,2061},[]int{815,2062},[]int{1723,2063},[]int{725,2064},[]int{1966,2065},[]int{1626,2066},[]int{736,2067},[]int{80,2068},[]int{920,2069},[]int{393,2070},[]int{1838,2071},[]int{1329,2072},[]int{1427,2073},[]int{614,2074},[]int{1488,2075},[]int{622,2076},[]int{993,2077},[]int{1003,2078},[]int{1947,2079},[]int{1284,2080},[]int{372,2081},[]int{507,2082},[]int{133,2083},[]int{628,2084},[]int{543,2085},[]int{944,2086},[]int{73,2087},[]int{1051,2088},[]int{438,2089},[]int{845,2090},[]int{1626,2091},[]int{1740,2092},[]int{841,2093},[]int{1375,2094},[]int{1382,2095},[]int{1563,2096},[]int{1773,2097},[]int{1523,2098},[]int{119,2099},[]int{697,2100},[]int{1148,2101},[]int{415,2102},[]int{63,2103},[]int{1375,2104},[]int{778,2105},[]int{1235,2106},[]int{1548,2107},[]int{1961,2108},[]int{1533,2109},[]int{1443,2110},[]int{1779,2111},[]int{1066,2112},[]int{1605,2113},[]int{141,2114},[]int{1179,2115},[]int{1129,2116},[]int{622,2117},[]int{1131,2118},[]int{682,2119},[]int{1374,2120},[]int{614,2121},[]int{379,2122},[]int{1973,2123},[]int{674,2124},[]int{1906,2125},[]int{1970,2126},[]int{31,2127},[]int{413,2128},[]int{1729,2129},[]int{1757,2130},[]int{1162,2131},[]int{727,2132},[]int{904,2133},[]int{615,2134},[]int{84,2135},[]int{46,2136},[]int{1954,2137},[]int{268,2138},[]int{274,2139},[]int{1123,2140},[]int{374,2141},[]int{269,2142},[]int{1897,2143},[]int{1636,2144},[]int{2122,2145},[]int{992,2146},[]int{2009,2147},[]int{1021,2148},[]int{432,2149},[]int{1919,2150},[]int{347,2151},[]int{12,2152},[]int{1861,2153},[]int{666,2154},[]int{1049,2155},[]int{1188,2156},[]int{840,2157},[]int{369,2158},[]int{1669,2159},[]int{653,2160},[]int{201,2161},[]int{1080,2162},[]int{1360,2163},[]int{218,2164},[]int{1146,2165},[]int{1044,2166},[]int{939,2167},[]int{1775,2168},[]int{2023,2169},[]int{472,2170},[]int{2166,2171},[]int{243,2172},[]int{259,2173},[]int{1040,2174},[]int{949,2175},[]int{902,2176},[]int{872,2177},[]int{422,2178},[]int{308,2179},[]int{1241,2180},[]int{1202,2181},[]int{1673,2182},[]int{1710,2183},[]int{1855,2184},[]int{998,2185},[]int{1506,2186},[]int{1464,2187},[]int{194,2188},[]int{689,2189},[]int{2108,2190},[]int{1487,2191},[]int{2191,2192},[]int{111,2193},[]int{130,2194},[]int{502,2195},[]int{1235,2196},[]int{1494,2197},[]int{1693,2198},[]int{925,2199},[]int{993,2200},[]int{600,2201},[]int{403,2202},[]int{729,2203},[]int{1225,2204},[]int{1022,2205},[]int{497,2206},[]int{202,2207},[]int{390,2208},[]int{1811,2209},[]int{849,2210},[]int{996,2211},[]int{1771,2212},[]int{1652,2213},[]int{847,2214},[]int{2104,2215},[]int{1971,2216},[]int{808,2217},[]int{384,2218},[]int{474,2219},[]int{1557,2220},[]int{2161,2221},[]int{180,2222},[]int{1157,2223},[]int{280,2224},[]int{1316,2225},[]int{463,2226},[]int{1930,2227},[]int{189,2228},[]int{1466,2229},[]int{1381,2230},[]int{457,2231},[]int{1046,2232},[]int{2046,2233},[]int{716,2234},[]int{846,2235},[]int{1361,2236},[]int{219,2237},[]int{1009,2238},[]int{1145,2239},[]int{534,2240},[]int{1181,2241},[]int{907,2242},[]int{661,2243},[]int{1717,2244},[]int{54,2245},[]int{2042,2246},[]int{2067,2247},[]int{1630,2248},[]int{1306,2249},[]int{1548,2250},[]int{2045,2251},[]int{148,2252},[]int{1270,2253},[]int{1674,2254},[]int{1260,2255},[]int{604,2256},[]int{1815,2257},[]int{1480,2258},[]int{1414,2259},[]int{1732,2260},[]int{2161,2261},[]int{1140,2262},[]int{1287,2263},[]int{2242,2264},[]int{1339,2265},[]int{904,2266},[]int{989,2267},[]int{351,2268},[]int{1960,2269},[]int{773,2270},[]int{979,2271},[]int{1834,2272},[]int{746,2273},[]int{227,2274},[]int{1441,2275},[]int{730,2276},[]int{991,2277},[]int{1463,2278},[]int{617,2279},[]int{1386,2280},[]int{1481,2281},[]int{1372,2282},[]int{1993,2283},[]int{2166,2284},[]int{674,2285},[]int{2205,2286},[]int{1593,2287},[]int{783,2288},[]int{2208,2289},[]int{603,2290},[]int{1095,2291},[]int{1920,2292},[]int{1099,2293},[]int{735,2294},[]int{549,2295},[]int{1482,2296},[]int{1935,2297},[]int{1781,2298},[]int{1276,2299},[]int{832,2300},[]int{927,2301},[]int{1321,2302},[]int{1553,2303},[]int{56,2304},[]int{1704,2305},[]int{1983,2306},[]int{1354,2307},[]int{26,2308},[]int{2188,2309},[]int{1594,2310},[]int{2212,2311},[]int{35,2312},[]int{922,2313},[]int{776,2314},[]int{1620,2315},[]int{2185,2316},[]int{1915,2317},[]int{1274,2318},[]int{1255,2319},[]int{1060,2320},[]int{1247,2321},[]int{643,2322},[]int{2031,2323},[]int{1077,2324},[]int{1600,2325},[]int{433,2326},[]int{1582,2327},[]int{1482,2328},[]int{1820,2329},[]int{849,2330},[]int{1582,2331},[]int{1870,2332},[]int{1197,2333},[]int{1882,2334},[]int{167,2335},[]int{946,2336},[]int{1137,2337},[]int{1203,2338},[]int{2303,2339},[]int{746,2340},[]int{446,2341},[]int{1761,2342},[]int{1232,2343},[]int{983,2344},[]int{1946,2345},[]int{250,2346},[]int{843,2347},[]int{349,2348},[]int{922,2349},[]int{895,2350},[]int{619,2351},[]int{656,2352},[]int{1862,2353},[]int{1423,2354},[]int{1232,2355},[]int{919,2356},[]int{1053,2357},[]int{1271,2358},[]int{786,2359},[]int{1934,2360},[]int{713,2361},[]int{325,2362},[]int{1500,2363},[]int{2223,2364},[]int{973,2365},[]int{1351,2366},[]int{1817,2367},[]int{460,2368},[]int{381,2369},[]int{217,2370},[]int{2236,2371},[]int{1824,2372},[]int{2116,2373},[]int{463,2374},[]int{384,2375},[]int{1952,2376},[]int{1626,2377},[]int{1560,2378},[]int{36,2379},[]int{1684,2380},[]int{1390,2381},[]int{661,2382},[]int{2088,2383},[]int{374,2384},[]int{77,2385},[]int{2082,2386},[]int{1075,2387},[]int{591,2388},[]int{2254,2389},[]int{1562,2390},[]int{693,2391},[]int{1929,2392},[]int{2283,2393},[]int{298,2394},[]int{31,2395},[]int{538,2396},[]int{1649,2397},[]int{766,2398},[]int{1887,2399},[]int{1020,2400},[]int{658,2401},[]int{2017,2402},[]int{575,2403},[]int{2393,2404},[]int{1058,2405},[]int{2246,2406},[]int{74,2407},[]int{1738,2408},[]int{891,2409},[]int{1247,2410},[]int{1060,2411},[]int{7,2412},[]int{1507,2413},[]int{483,2414},[]int{860,2415},[]int{1179,2416},[]int{1059,2417},[]int{247,2418},[]int{2090,2419},[]int{1503,2420},[]int{85,2421},[]int{1065,2422},[]int{836,2423},[]int{1968,2424},[]int{1317,2425},[]int{620,2426},[]int{205,2427},[]int{899,2428},[]int{1858,2429},[]int{40,2430},[]int{1165,2431},[]int{692,2432},[]int{147,2433},[]int{1466,2434},[]int{24,2435},[]int{162,2436},[]int{1077,2437},[]int{573,2438},[]int{1817,2439},[]int{914,2440},[]int{1888,2441},[]int{2425,2442},[]int{216,2443},[]int{71,2444},[]int{665,2445},[]int{1728,2446},[]int{723,2447},[]int{1923,2448},[]int{2333,2449},[]int{1576,2450},[]int{757,2451},[]int{2393,2452},[]int{1762,2453},[]int{1873,2454},[]int{1487,2455},[]int{2087,2456},[]int{171,2457},[]int{2348,2458},[]int{2160,2459},[]int{114,2460},[]int{44,2461},[]int{2361,2462},[]int{1044,2463},[]int{1128,2464},[]int{2313,2465},[]int{2222,2466},[]int{45,2467},[]int{2310,2468},[]int{702,2469},[]int{1109,2470},[]int{1542,2471},[]int{2172,2472},[]int{2005,2473},[]int{2014,2474},[]int{1443,2475},[]int{1043,2476},[]int{404,2477},[]int{457,2478},[]int{244,2479},[]int{1042,2480},[]int{2012,2481},[]int{1288,2482},[]int{1393,2483},[]int{804,2484},[]int{1504,2485},[]int{1432,2486},[]int{1928,2487},[]int{1385,2488},[]int{1417,2489},[]int{1604,2490},[]int{2370,2491},[]int{2411,2492},[]int{1806,2493},[]int{1868,2494},[]int{1723,2495},[]int{718,2496},[]int{613,2497},[]int{2233,2498},[]int{1502,2499},[]int{257,2500},[]int{505,2501},[]int{1884,2502},[]int{1020,2503},[]int{1436,2504},[]int{597,2505},[]int{1168,2506},[]int{1567,2507},[]int{1811,2508},[]int{2350,2509},[]int{1653,2510},[]int{1667,2511},[]int{795,2512},[]int{686,2513},[]int{1691,2514},[]int{1553,2515},[]int{76,2516},[]int{251,2517},[]int{1291,2518},[]int{424,2519},[]int{123,2520},[]int{1476,2521},[]int{1315,2522},[]int{1765,2523},[]int{2423,2524},[]int{494,2525},[]int{1567,2526},[]int{1299,2527},[]int{952,2528},[]int{1523,2529},[]int{1379,2530},[]int{1316,2531},[]int{543,2532},[]int{370,2533},[]int{1817,2534},[]int{309,2535},[]int{133,2536},[]int{50,2537},[]int{1825,2538},[]int{1553,2539},[]int{2211,2540},[]int{20,2541},[]int{53,2542},[]int{2238,2543},[]int{2131,2544},[]int{427,2545},[]int{1958,2546},[]int{2292,2547},[]int{1665,2548},[]int{1567,2549},[]int{1033,2550},[]int{668,2551},[]int{1401,2552},[]int{1667,2553},[]int{245,2554},[]int{2214,2555},[]int{901,2556},[]int{600,2557},[]int{388,2558},[]int{1707,2559},[]int{762,2560},[]int{2194,2561},[]int{1210,2562},[]int{542,2563},[]int{637,2564},[]int{1391,2565},[]int{420,2566},[]int{929,2567},[]int{1996,2568},[]int{296,2569},[]int{932,2570},[]int{500,2571},[]int{2051,2572},[]int{68,2573},[]int{349,2574},[]int{2205,2575},[]int{365,2576},[]int{444,2577},[]int{227,2578},[]int{430,2579},[]int{960,2580},[]int{709,2581},[]int{1648,2582},[]int{2011,2583},[]int{78,2584},[]int{1933,2585},[]int{417,2586},[]int{316,2587},[]int{1992,2588},[]int{241,2589},[]int{188,2590},[]int{2538,2591},[]int{137,2592},[]int{139,2593},[]int{1353,2594},[]int{2003,2595},[]int{2409,2596},[]int{2554,2597},[]int{95,2598},[]int{466,2599},[]int{53,2600},[]int{2593,2601},[]int{9,2602},[]int{1644,2603},[]int{1603,2604},[]int{516,2605},[]int{1038,2606},[]int{1170,2607},[]int{1870,2608},[]int{2216,2609},[]int{2191,2610},[]int{1625,2611},[]int{2219,2612},[]int{2608,2613},[]int{1205,2614},[]int{1557,2615},[]int{2247,2616},[]int{392,2617},[]int{1130,2618},[]int{2471,2619},[]int{1942,2620},[]int{993,2621},[]int{1971,2622},[]int{1450,2623},[]int{729,2624},[]int{1329,2625},[]int{1750,2626},[]int{750,2627},[]int{2121,2628},[]int{1636,2629},[]int{1980,2630},[]int{1679,2631},[]int{1451,2632},[]int{2352,2633},[]int{1674,2634},[]int{2201,2635},[]int{1356,2636},[]int{1018,2637},[]int{2107,2638},[]int{2035,2639},[]int{10,2640},[]int{2561,2641},[]int{1529,2642},[]int{1239,2643},[]int{2012,2644},[]int{2138,2645},[]int{1590,2646},[]int{1836,2647},[]int{2175,2648},[]int{2398,2649},[]int{1852,2650},[]int{1999,2651},[]int{2243,2652},[]int{580,2653},[]int{1952,2654},[]int{1536,2655},[]int{2270,2656},[]int{643,2657},[]int{1372,2658},[]int{332,2659},[]int{528,2660},[]int{583,2661},[]int{1107,2662},[]int{1358,2663},[]int{483,2664},[]int{774,2665},[]int{2015,2666},[]int{449,2667},[]int{101,2668},[]int{1453,2669},[]int{2048,2670},[]int{1768,2671},[]int{1604,2672},[]int{473,2673},[]int{1515,2674},[]int{1023,2675},[]int{550,2676},[]int{601,2677},[]int{2411,2678},[]int{1659,2679},[]int{1939,2680},[]int{1799,2681},[]int{1453,2682},[]int{1843,2683},[]int{2093,2684},[]int{361,2685},[]int{669,2686},[]int{638,2687},[]int{267,2688},[]int{790,2689},[]int{728,2690},[]int{1973,2691},[]int{993,2692},[]int{856,2693},[]int{87,2694},[]int{1324,2695},[]int{1392,2696},[]int{1676,2697},[]int{490,2698},[]int{817,2699},[]int{1258,2700},[]int{444,2701},[]int{452,2702},[]int{2572,2703},[]int{769,2704},[]int{448,2705},[]int{673,2706},[]int{2525,2707},[]int{969,2708},[]int{2449,2709},[]int{1974,2710},[]int{1923,2711},[]int{623,2712},[]int{1828,2713},[]int{2172,2714},[]int{2174,2715},[]int{1085,2716},[]int{1514,2717},[]int{2082,2718},[]int{1138,2719},[]int{2389,2720},[]int{1640,2721},[]int{847,2722},[]int{214,2723},[]int{2411,2724},[]int{2000,2725},[]int{2098,2726},[]int{1749,2727},[]int{2671,2728},[]int{826,2729},[]int{378,2730},[]int{1002,2731},[]int{1383,2732},[]int{834,2733},[]int{1468,2734},[]int{1297,2735},[]int{741,2736},[]int{2313,2737},[]int{2601,2738},[]int{833,2739},[]int{589,2740},[]int{2566,2741},[]int{1755,2742},[]int{124,2743},[]int{447,2744},[]int{1539,2745},[]int{1251,2746},[]int{500,2747},[]int{2316,2748},[]int{146,2749},[]int{804,2750},[]int{331,2751},[]int{1520,2752},[]int{365,2753},[]int{946,2754},[]int{1575,2755},[]int{2207,2756},[]int{1519,2757},[]int{2221,2758},[]int{2151,2759},[]int{2020,2760},[]int{2544,2761},[]int{2453,2762},[]int{1734,2763},[]int{972,2764},[]int{2503,2765},[]int{423,2766},[]int{2459,2767},[]int{2163,2768},[]int{1019,2769},[]int{1267,2770},[]int{1878,2771},[]int{2730,2772},[]int{1448,2773},[]int{1251,2774},[]int{2394,2775},[]int{510,2776},[]int{603,2777},[]int{2388,2778},[]int{513,2779},[]int{789,2780},[]int{641,2781},[]int{1979,2782},[]int{1885,2783},[]int{2447,2784},[]int{681,2785},[]int{1495,2786},[]int{2734,2787},[]int{354,2788},[]int{1130,2789},[]int{2141,2790},[]int{1925,2791},[]int{371,2792},[]int{2103,2793},[]int{2374,2794},[]int{445,2795},[]int{1009,2796},[]int{1334,2797},[]int{2170,2798},[]int{354,2799},[]int{1760,2800},[]int{558,2801},[]int{1768,2802},[]int{1477,2803},[]int{1921,2804},[]int{1172,2805},[]int{586,2806},[]int{573,2807},[]int{1217,2808},[]int{287,2809},[]int{1427,2810},[]int{419,2811},[]int{880,2812},[]int{2723,2813},[]int{810,2814},[]int{859,2815},[]int{999,2816},[]int{966,2817},[]int{1507,2818},[]int{189,2819},[]int{489,2820},[]int{198,2821},[]int{2487,2822},[]int{2674,2823},[]int{703,2824},[]int{1215,2825},[]int{2124,2826},[]int{2541,2827},[]int{351,2828},[]int{123,2829},[]int{2644,2830},[]int{2612,2831},[]int{1728,2832},[]int{767,2833},[]int{2362,2834},[]int{2003,2835},[]int{1149,2836},[]int{656,2837},[]int{1549,2838},[]int{1451,2839},[]int{1467,2840},[]int{1619,2841},[]int{578,2842},[]int{2755,2843},[]int{1365,2844},[]int{728,2845},[]int{2707,2846},[]int{806,2847},[]int{811,2848},[]int{864,2849},[]int{660,2850},[]int{2083,2851},[]int{639,2852},[]int{113,2853},[]int{918,2854},[]int{1086,2855},[]int{1540,2856},[]int{1365,2857},[]int{718,2858},[]int{538,2859},[]int{2016,2860},[]int{2712,2861},[]int{1804,2862},[]int{424,2863},[]int{1622,2864},[]int{224,2865},[]int{2735,2866},[]int{2119,2867},[]int{2257,2868},[]int{2240,2869},[]int{2249,2870},[]int{2339,2871},[]int{1585,2872},[]int{2806,2873},[]int{287,2874},[]int{1543,2875},[]int{1308,2876},[]int{734,2877},[]int{1485,2878},[]int{643,2879},[]int{1552,2880},[]int{2001,2881},[]int{974,2882},[]int{2489,2883},[]int{2280,2884},[]int{1344,2885},[]int{302,2886},[]int{1316,2887},[]int{2728,2888},[]int{1447,2889},[]int{1030,2890},[]int{2795,2891},[]int{2854,2892},[]int{302,2893},[]int{260,2894},[]int{63,2895},[]int{1943,2896},[]int{2723,2897},[]int{1285,2898},[]int{1435,2899},[]int{2675,2900},[]int{479,2901},[]int{2597,2902},[]int{779,2903},[]int{15,2904},[]int{2199,2905},[]int{1352,2906},[]int{1335,2907},[]int{2309,2908},[]int{412,2909},[]int{1357,2910},[]int{860,2911},[]int{1674,2912},[]int{570,2913},[]int{1332,2914},[]int{351,2915},[]int{2892,2916},[]int{2678,2917},[]int{2220,2918},[]int{1840,2919},[]int{1869,2920},[]int{2822,2921},[]int{1223,2922},[]int{1451,2923},[]int{2244,2924},[]int{913,2925},[]int{2221,2926},[]int{2206,2927},[]int{567,2928},[]int{1902,2929},[]int{1781,2930},[]int{2333,2931},[]int{2507,2932},[]int{2323,2933},[]int{236,2934},[]int{2697,2935},[]int{2688,2936},[]int{1324,2937},[]int{342,2938},[]int{1168,2939},[]int{1017,2940},[]int{436,2941},[]int{2789,2942},[]int{1200,2943},[]int{908,2944},[]int{5,2945},[]int{1202,2946},[]int{2853,2947},[]int{1355,2948},[]int{1809,2949},[]int{2325,2950},[]int{460,2951},[]int{40,2952},[]int{2056,2953},[]int{1285,2954},[]int{1774,2955},[]int{2918,2956},[]int{2908,2957},[]int{2346,2958},[]int{699,2959},[]int{1033,2960},[]int{294,2961},[]int{1143,2962},[]int{1106,2963},[]int{1703,2964},[]int{1012,2965},[]int{254,2966},[]int{2820,2967},[]int{1338,2968},[]int{386,2969},[]int{2109,2970},[]int{2753,2971},[]int{1419,2972},[]int{1449,2973},[]int{1606,2974},[]int{690,2975},[]int{940,2976},[]int{343,2977},[]int{1541,2978},[]int{211,2979},[]int{33,2980},[]int{1070,2981},[]int{2770,2982},[]int{1758,2983},[]int{2708,2984},[]int{1973,2985},[]int{2855,2986},[]int{178,2987},[]int{2860,2988},[]int{290,2989},[]int{212,2990},[]int{1890,2991},[]int{1138,2992},[]int{314,2993},[]int{92,2994},[]int{624,2995},[]int{2628,2996},[]int{1974,2997},[]int{1270,2998},[]int{1129,2999},[]int{1270,3000},[]int{1975,3001},[]int{2029,3002},[]int{2611,3003},[]int{2934,3004},[]int{2804,3005},[]int{149,3006},[]int{738,3007},[]int{699,3008},[]int{2159,3009},[]int{2936,3010},[]int{1337,3011},[]int{511,3012},[]int{979,3013},[]int{2858,3014},[]int{1088,3015},[]int{838,3016},[]int{1751,3017},[]int{40,3018},[]int{37,3019},[]int{471,3020},[]int{2081,3021},[]int{760,3022},[]int{709,3023},[]int{2150,3024},[]int{2187,3025},[]int{2891,3026},[]int{2585,3027},[]int{2319,3028},[]int{113,3029},[]int{2715,3030},[]int{369,3031},[]int{1267,3032},[]int{1829,3033},[]int{1215,3034},[]int{2942,3035},[]int{812,3036},[]int{353,3037},[]int{79,3038},[]int{962,3039},[]int{2672,3040},[]int{1990,3041},[]int{2991,3042},[]int{1403,3043},[]int{1355,3044},[]int{2989,3045},[]int{1403,3046},[]int{105,3047},[]int{1106,3048},[]int{1406,3049},[]int{1978,3050},[]int{660,3051},[]int{2973,3052},[]int{1310,3053},[]int{984,3054},[]int{2982,3055},[]int{360,3056},[]int{1203,3057},[]int{59,3058},[]int{1581,3059},[]int{411,3060},[]int{700,3061},[]int{500,3062},[]int{983,3063},[]int{3,3064},[]int{1400,3065},[]int{537,3066},[]int{841,3067},[]int{77,3068},[]int{2304,3069},[]int{1629,3070},[]int{166,3071},[]int{509,3072},[]int{2127,3073},[]int{324,3074},[]int{1586,3075},[]int{2479,3076},[]int{2902,3077},[]int{1742,3078},[]int{3047,3079},[]int{323,3080},[]int{1112,3081},[]int{1406,3082},[]int{1614,3083},[]int{2700,3084},[]int{717,3085},[]int{2423,3086},[]int{1887,3087},[]int{669,3088},[]int{2640,3089},[]int{3057,3090},[]int{1908,3091},[]int{3016,3092},[]int{902,3093},[]int{2538,3094},[]int{1993,3095},[]int{1386,3096},[]int{1458,3097},[]int{2614,3098},[]int{1397,3099},[]int{511,3100},[]int{1387,3101},[]int{1942,3102},[]int{1060,3103},[]int{1879,3104},[]int{1005,3105},[]int{42,3106},[]int{1989,3107},[]int{426,3108},[]int{2080,3109},[]int{516,3110},[]int{2172,3111},[]int{2782,3112},[]int{1582,3113},[]int{2961,3114},[]int{2687,3115},[]int{167,3116},[]int{761,3117},[]int{974,3118},[]int{602,3119},[]int{1369,3120},[]int{2371,3121},[]int{1619,3122},[]int{1905,3123},[]int{2270,3124},[]int{835,3125},[]int{1835,3126},[]int{2786,3127},[]int{2254,3128},[]int{2886,3129},[]int{2468,3130},[]int{1954,3131},[]int{855,3132},[]int{1169,3133},[]int{673,3134},[]int{2250,3135},[]int{1457,3136},[]int{622,3137},[]int{2291,3138},[]int{1969,3139},[]int{2360,3140},[]int{1511,3141},[]int{590,3142},[]int{2182,3143},[]int{2807,3144},[]int{2566,3145},[]int{1843,3146},[]int{652,3147},[]int{2538,3148},[]int{1041,3149},[]int{872,3150},[]int{1453,3151},[]int{2959,3152},[]int{1011,3153},[]int{820,3154},[]int{146,3155},[]int{589,3156},[]int{657,3157},[]int{188,3158},[]int{1076,3159},[]int{769,3160},[]int{3108,3161},[]int{3091,3162},[]int{1468,3163},[]int{438,3164},[]int{3106,3165},[]int{3150,3166},[]int{1546,3167},[]int{448,3168},[]int{160,3169},[]int{1769,3170},[]int{3165,3171},[]int{1246,3172},[]int{1869,3173},[]int{1803,3174},[]int{1754,3175},[]int{394,3176},[]int{1871,3177},[]int{1540,3178},[]int{2975,3179},[]int{353,3180},[]int{1245,3181},[]int{2222,3182},[]int{1699,3183},[]int{1060,3184},[]int{2340,3185},[]int{1158,3186},[]int{3179,3187},[]int{1869,3188},[]int{783,3189},[]int{2642,3190},[]int{523,3191},[]int{1376,3192},[]int{2483,3193},[]int{1451,3194},[]int{2248,3195},[]int{2935,3196},[]int{3074,3197},[]int{2210,3198},[]int{948,3199},[]int{3128,3200},[]int{2566,3201},[]int{362,3202},[]int{387,3203},[]int{2366,3204},[]int{1190,3205},[]int{2815,3206},[]int{1914,3207},[]int{1442,3208},[]int{2129,3209},[]int{2221,3210},[]int{1393,3211},[]int{2185,3212},[]int{1112,3213},[]int{1016,3214},[]int{791,3215},[]int{1243,3216},[]int{1075,3217},[]int{2277,3218},[]int{1996,3219},[]int{2835,3220},[]int{159,3221},[]int{2392,3222},[]int{601,3223},[]int{1478,3224},[]int{3043,3225},[]int{1389,3226},[]int{2773,3227},[]int{2346,3228},[]int{3149,3229},[]int{1266,3230},[]int{1955,3231},[]int{3084,3232},[]int{3101,3233},[]int{1770,3234},[]int{707,3235},[]int{2874,3236},[]int{3018,3237},[]int{3017,3238},[]int{2798,3239},[]int{2027,3240},[]int{1059,3241},[]int{2199,3242},[]int{744,3243},[]int{2920,3244},[]int{1499,3245},[]int{2671,3246},[]int{3017,3247},[]int{121,3248},[]int{675,3249},[]int{3082,3250},[]int{2419,3251},[]int{1521,3252},[]int{1521,3253},[]int{2715,3254},[]int{506,3255},[]int{1536,3256},[]int{730,3257},[]int{577,3258},[]int{857,3259},[]int{167,3260},[]int{2868,3261},[]int{1018,3262},[]int{1762,3263},[]int{2097,3264},[]int{1005,3265},[]int{2375,3266},[]int{666,3267},[]int{1876,3268},[]int{162,3269},[]int{1126,3270},[]int{986,3271},[]int{1995,3272},[]int{1656,3273},[]int{244,3274},[]int{1477,3275},[]int{1100,3276},[]int{487,3277},[]int{778,3278},[]int{2929,3279},[]int{834,3280},[]int{45,3281},[]int{2421,3282},[]int{771,3283},[]int{805,3284},[]int{704,3285},[]int{408,3286},[]int{2661,3287},[]int{2594,3288},[]int{1662,3289},[]int{450,3290},[]int{832,3291},[]int{530,3292},[]int{199,3293},[]int{3087,3294},[]int{2435,3295},[]int{507,3296},[]int{2126,3297},[]int{566,3298},[]int{181,3299},[]int{1926,3300},[]int{1232,3301},[]int{383,3302},[]int{1187,3303},[]int{3235,3304},[]int{2157,3305},[]int{1149,3306},[]int{2833,3307},[]int{1148,3308},[]int{2458,3309},[]int{2890,3310},[]int{2163,3311},[]int{2122,3312},[]int{2617,3313},[]int{33,3314},[]int{1216,3315},[]int{1362,3316},[]int{2119,3317},[]int{765,3318},[]int{1809,3319},[]int{1679,3320},[]int{1803,3321},[]int{284,3322},[]int{1537,3323},[]int{2112,3324},[]int{531,3325},[]int{651,3326},[]int{158,3327},[]int{573,3328},[]int{226,3329},[]int{181,3330},[]int{2552,3331},[]int{36,3332},[]int{436,3333},[]int{777,3334},[]int{3,3335},[]int{1330,3336},[]int{3030,3337},[]int{32,3338},[]int{1656,3339},[]int{1344,3340},[]int{982,3341},[]int{100,3342},[]int{2206,3343},[]int{2948,3344},[]int{449,3345},[]int{2589,3346},[]int{599,3347},[]int{800,3348},[]int{1032,3349},[]int{573,3350},[]int{2578,3351},[]int{604,3352},[]int{881,3353},[]int{1839,3354},[]int{862,3355},[]int{1235,3356},[]int{2515,3357},[]int{2728,3358},[]int{2841,3359},[]int{300,3360},[]int{547,3361},[]int{1254,3362},[]int{939,3363},[]int{448,3364},[]int{3013,3365},[]int{1065,3366},[]int{3277,3367},[]int{410,3368},[]int{1572,3369},[]int{52,3370},[]int{2519,3371},[]int{1948,3372},[]int{957,3373},[]int{758,3374},[]int{1043,3375},[]int{693,3376},[]int{172,3377},[]int{839,3378},[]int{2077,3379},[]int{1640,3380},[]int{2857,3381},[]int{755,3382},[]int{2264,3383},[]int{2932,3384},[]int{2739,3385},[]int{1556,3386},[]int{3331,3387},[]int{753,3388},[]int{2445,3389},[]int{3090,3390},[]int{1239,3391},[]int{700,3392},[]int{2749,3393},[]int{2401,3394},[]int{552,3395},[]int{183,3396},[]int{75,3397},[]int{2678,3398},[]int{2144,3399},[]int{2992,3400},[]int{984,3401},[]int{1157,3402},[]int{1197,3403},[]int{1232,3404},[]int{375,3405},[]int{111,3406},[]int{572,3407},[]int{2000,3408},[]int{101,3409},[]int{83,3410},[]int{842,3411},[]int{1764,3412},[]int{1648,3413},[]int{1424,3414},[]int{3259,3415},[]int{3221,3416},[]int{1504,3417},[]int{3031,3418},[]int{1424,3419},[]int{1761,3420},[]int{576,3421},[]int{873,3422},[]int{77,3423},[]int{1856,3424},[]int{355,3425},[]int{1950,3426},[]int{969,3427},[]int{3154,3428},[]int{1033,3429},[]int{2160,3430},[]int{2295,3431},[]int{920,3432},[]int{3354,3433},[]int{2340,3434},[]int{415,3435},[]int{2189,3436},[]int{1284,3437},[]int{2714,3438},[]int{1685,3439},[]int{1162,3440},[]int{696,3441},[]int{2176,3442},[]int{420,3443},[]int{3226,3444},[]int{3232,3445},[]int{1465,3446},[]int{3243,3447},[]int{577,3448},[]int{11,3449},[]int{2841,3450},[]int{529,3451},[]int{2807,3452},[]int{2852,3453},[]int{2626,3454},[]int{565,3455},[]int{13,3456},[]int{2571,3457},[]int{804,3458},[]int{503,3459},[]int{159,3460},[]int{1258,3461},[]int{2974,3462},[]int{3282,3463},[]int{3277,3464},[]int{272,3465},[]int{766,3466},[]int{2390,3467},[]int{2121,3468},[]int{2822,3469},[]int{498,3470},[]int{2881,3471},[]int{2599,3472},[]int{1862,3473},[]int{2214,3474},[]int{1665,3475},[]int{949,3476},[]int{2930,3477},[]int{1850,3478},[]int{5,3479},[]int{1500,3480},[]int{821,3481},[]int{2604,3482},[]int{2628,3483},[]int{1523,3484},[]int{992,3485},[]int{61,3486},[]int{602,3487},[]int{2839,3488},[]int{1463,3489},[]int{2131,3490},[]int{3027,3491},[]int{236,3492},[]int{162,3493},[]int{529,3494},[]int{260,3495},[]int{1524,3496},[]int{1224,3497},[]int{945,3498},[]int{1551,3499},[]int{710,3500},[]int{681,3501},[]int{1382,3502},[]int{3385,3503},[]int{2171,3504},[]int{2367,3505},[]int{2707,3506},[]int{56,3507},[]int{33,3508},[]int{849,3509},[]int{2596,3510},[]int{539,3511},[]int{1011,3512},[]int{3136,3513},[]int{2320,3514},[]int{2105,3515},[]int{213,3516},[]int{1679,3517},[]int{1189,3518},[]int{686,3519},[]int{2385,3520},[]int{888,3521},[]int{141,3522},[]int{540,3523},[]int{1028,3524},[]int{1625,3525},[]int{1263,3526},[]int{140,3527},[]int{1921,3528},[]int{1469,3529},[]int{2509,3530},[]int{1501,3531},[]int{2303,3532},[]int{1737,3533},[]int{3311,3534},[]int{1026,3535},[]int{217,3536},[]int{1373,3537},[]int{2301,3538},[]int{1132,3539},[]int{2062,3540},[]int{1193,3541},[]int{1784,3542},[]int{1152,3543},[]int{3082,3544},[]int{1559,3545},[]int{2275,3546},[]int{2301,3547},[]int{46,3548},[]int{2343,3549},[]int{3323,3550},[]int{3409,3551},[]int{1104,3552},[]int{1759,3553},[]int{3044,3554},[]int{1487,3555},[]int{651,3556},[]int{656,3557},[]int{1537,3558},[]int{227,3559},[]int{3343,3560},[]int{3204,3561},[]int{3555,3562},[]int{1597,3563},[]int{2872,3564},[]int{1052,3565},[]int{1092,3566},[]int{2602,3567},[]int{38,3568},[]int{429,3569},[]int{180,3570},[]int{1356,3571},[]int{796,3572},[]int{493,3573},[]int{2339,3574},[]int{1947,3575},[]int{2757,3576},[]int{1373,3577},[]int{162,3578},[]int{3120,3579},[]int{641,3580},[]int{1795,3581},[]int{2882,3582},[]int{2547,3583},[]int{3496,3584},[]int{1645,3585},[]int{1520,3586},[]int{2367,3587},[]int{230,3588},[]int{2454,3589},[]int{436,3590},[]int{3149,3591},[]int{2307,3592},[]int{2855,3593},[]int{431,3594},[]int{1887,3595},[]int{1577,3596},[]int{503,3597},[]int{1431,3598},[]int{52,3599},[]int{1013,3600},[]int{1432,3601},[]int{3550,3602},[]int{192,3603},[]int{3499,3604},[]int{1486,3605},[]int{3512,3606},[]int{1564,3607},[]int{1055,3608},[]int{2093,3609},[]int{2327,3610},[]int{2643,3611},[]int{3009,3612},[]int{2758,3613},[]int{1731,3614},[]int{361,3615},[]int{3116,3616},[]int{3405,3617},[]int{2461,3618},[]int{1109,3619},[]int{1819,3620},[]int{2334,3621},[]int{2437,3622},[]int{3282,3623},[]int{328,3624},[]int{1126,3625},[]int{1150,3626},[]int{1230,3627},[]int{3195,3628},[]int{2417,3629},[]int{3163,3630},[]int{1225,3631},[]int{3419,3632},[]int{1425,3633},[]int{2477,3634},[]int{2403,3635},[]int{3272,3636},[]int{2967,3637},[]int{882,3638},[]int{1157,3639},[]int{2501,3640},[]int{2906,3641},[]int{3103,3642},[]int{3034,3643},[]int{340,3644},[]int{338,3645},[]int{1294,3646},[]int{2023,3647},[]int{2481,3648},[]int{3308,3649},[]int{734,3650},[]int{2627,3651},[]int{2500,3652},[]int{3107,3653},[]int{675,3654},[]int{84,3655},[]int{3396,3656},[]int{3615,3657},[]int{3654,3658},[]int{1965,3659},[]int{1824,3660},[]int{1073,3661},[]int{605,3662},[]int{1514,3663},[]int{1132,3664},[]int{374,3665},[]int{2246,3666},[]int{2508,3667},[]int{1918,3668},[]int{160,3669},[]int{2137,3670},[]int{3261,3671},[]int{699,3672},[]int{424,3673},[]int{1705,3674},[]int{2268,3675},[]int{3574,3676},[]int{2590,3677},[]int{2576,3678},[]int{2925,3679},[]int{1098,3680},[]int{3284,3681},[]int{2605,3682},[]int{3102,3683},[]int{2664,3684},[]int{913,3685},[]int{1797,3686},[]int{3310,3687},[]int{3336,3688},[]int{1835,3689},[]int{3483,3690},[]int{2275,3691},[]int{310,3692},[]int{3491,3693},[]int{2303,3694},[]int{1361,3695},[]int{1323,3696},[]int{2624,3697},[]int{1373,3698},[]int{1286,3699},[]int{2193,3700},[]int{2627,3701},[]int{3192,3702},[]int{1215,3703},[]int{2172,3704},[]int{690,3705},[]int{2872,3706},[]int{617,3707},[]int{3617,3708},[]int{478,3709},[]int{922,3710},[]int{1102,3711},[]int{3341,3712},[]int{1080,3713},[]int{3434,3714},[]int{3436,3715},[]int{963,3716},[]int{561,3717},[]int{1962,3718},[]int{955,3719},[]int{19,3720},[]int{945,3721},[]int{1607,3722},[]int{3169,3723},[]int{3144,3724},[]int{2528,3725},[]int{566,3726},[]int{666,3727},[]int{2589,3728},[]int{1756,3729},[]int{1498,3730},[]int{904,3731},[]int{341,3732},[]int{3173,3733},[]int{2718,3734},[]int{2588,3735},[]int{1837,3736},[]int{3363,3737},[]int{1204,3738},[]int{244,3739},[]int{1314,3740},[]int{3490,3741},[]int{3715,3742},[]int{2516,3743},[]int{1100,3744},[]int{263,3745},[]int{3647,3746},[]int{803,3747},[]int{1993,3748},[]int{3404,3749},[]int{2208,3750},[]int{2844,3751},[]int{1671,3752},[]int{3389,3753},[]int{3039,3754},[]int{614,3755},[]int{1902,3756},[]int{901,3757},[]int{3351,3758},[]int{993,3759},[]int{2134,3760},[]int{751,3761},[]int{3030,3762},[]int{2611,3763},[]int{902,3764},[]int{2295,3765},[]int{1279,3766},[]int{2500,3767},[]int{3025,3768},[]int{2742,3769},[]int{664,3770},[]int{2622,3771},[]int{1358,3772},[]int{1763,3773},[]int{1388,3774},[]int{1670,3775},[]int{2203,3776},[]int{1792,3777},[]int{874,3778},[]int{1694,3779},[]int{1754,3780},[]int{1217,3781},[]int{420,3782},[]int{1702,3783},[]int{2953,3784},[]int{879,3785},[]int{796,3786},[]int{1678,3787},[]int{2480,3788},[]int{2741,3789},[]int{2653,3790},[]int{1717,3791},[]int{1913,3792},[]int{2681,3793},[]int{2911,3794},[]int{2445,3795},[]int{2496,3796},[]int{2805,3797},[]int{1032,3798},[]int{2357,3799},[]int{1789,3800},[]int{42,3801},[]int{938,3802},[]int{2698,3803},[]int{1384,3804},[]int{589,3805},[]int{1877,3806},[]int{402,3807},[]int{3375,3808},[]int{220,3809},[]int{2672,3810},[]int{272,3811},[]int{2927,3812},[]int{1138,3813},[]int{2005,3814},[]int{388,3815},[]int{1780,3816},[]int{41,3817},[]int{2282,3818},[]int{2595,3819},[]int{2551,3820},[]int{2996,3821},[]int{2675,3822},[]int{2025,3823},[]int{2859,3824},[]int{3364,3825},[]int{590,3826},[]int{3408,3827},[]int{2136,3828},[]int{2469,3829},[]int{3255,3830},[]int{1876,3831},[]int{2421,3832},[]int{2976,3833},[]int{418,3834},[]int{1873,3835},[]int{1892,3836},[]int{888,3837},[]int{3067,3838},[]int{2127,3839},[]int{2620,3840},[]int{1136,3841},[]int{555,3842},[]int{1638,3843},[]int{114,3844},[]int{3471,3845},[]int{3268,3846},[]int{3421,3847},[]int{1390,3848},[]int{2945,3849},[]int{1433,3850},[]int{264,3851},[]int{617,3852},[]int{1940,3853},[]int{2266,3854},[]int{2025,3855},[]int{3712,3856},[]int{2054,3857},[]int{1625,3858},[]int{1061,3859},[]int{2388,3860},[]int{2789,3861},[]int{3598,3862},[]int{1148,3863},[]int{900,3864},[]int{3165,3865},[]int{546,3866},[]int{3802,3867},[]int{974,3868},[]int{2417,3869},[]int{2074,3870},[]int{1312,3871},[]int{1014,3872},[]int{1289,3873},[]int{3131,3874},[]int{2306,3875},[]int{3693,3876},[]int{2155,3877},[]int{1224,3878},[]int{812,3879},[]int{232,3880},[]int{1627,3881},[]int{2475,3882},[]int{2980,3883},[]int{616,3884},[]int{165,3885},[]int{3857,3886},[]int{1133,3887},[]int{747,3888},[]int{3061,3889},[]int{3340,3890},[]int{1609,3891},[]int{3246,3892},[]int{2915,3893},[]int{2932,3894},[]int{1271,3895},[]int{408,3896},[]int{2373,3897},[]int{936,3898},[]int{385,3899},[]int{3166,3900},[]int{807,3901},[]int{674,3902},[]int{2899,3903},[]int{3024,3904},[]int{2490,3905},[]int{900,3906},[]int{1280,3907},[]int{3847,3908},[]int{647,3909},[]int{2425,3910},[]int{3543,3911},[]int{3721,3912},[]int{2692,3913},[]int{3862,3914},[]int{1522,3915},[]int{3591,3916},[]int{595,3917},[]int{2656,3918},[]int{3239,3919},[]int{2881,3920},[]int{1718,3921},[]int{2239,3922},[]int{1812,3923},[]int{1897,3924},[]int{3744,3925},[]int{376,3926},[]int{3496,3927},[]int{2082,3928},[]int{3385,3929},[]int{1641,3930},[]int{400,3931},[]int{1372,3932},[]int{1416,3933},[]int{1123,3934},[]int{3774,3935},[]int{1023,3936},[]int{124,3937},[]int{1204,3938},[]int{3435,3939},[]int{2360,3940},[]int{1628,3941},[]int{86,3942},[]int{363,3943},[]int{3859,3944},[]int{2448,3945},[]int{3561,3946},[]int{287,3947},[]int{82,3948},[]int{48,3949},[]int{1868,3950},[]int{3131,3951},[]int{3606,3952},[]int{2694,3953},[]int{3763,3954},[]int{325,3955},[]int{1101,3956},[]int{3470,3957},[]int{784,3958},[]int{292,3959},[]int{689,3960},[]int{2683,3961},[]int{3217,3962},[]int{1881,3963},[]int{3745,3964},[]int{1013,3965},[]int{1233,3966},[]int{155,3967},[]int{1078,3968},[]int{171,3969},[]int{790,3970},[]int{2929,3971},[]int{2500,3972},[]int{10,3973},[]int{2646,3974},[]int{0,3975},[]int{2291,3976},[]int{197,3977},[]int{580,3978},[]int{723,3979},[]int{321,3980},[]int{3628,3981},[]int{2172,3982},[]int{1225,3983},[]int{1373,3984},[]int{3254,3985},[]int{2562,3986},[]int{2442,3987},[]int{907,3988},[]int{2539,3989},[]int{3152,3990},[]int{3181,3991},[]int{2175,3992},[]int{2433,3993},[]int{2908,3994},[]int{1820,3995},[]int{2316,3996},[]int{601,3997},[]int{2687,3998},[]int{681,3999},[]int{1098,4000},[]int{750,4001},[]int{3492,4002},[]int{235,4003},[]int{2195,4004},[]int{2896,4005},[]int{3494,4006},[]int{2613,4007},[]int{2420,4008},[]int{1399,4009},[]int{1739,4010},[]int{3234,4011},[]int{1112,4012},[]int{1179,4013},[]int{1585,4014},[]int{3133,4015},[]int{2443,4016},[]int{186,4017},[]int{121,4018},[]int{1760,4019},[]int{3813,4020},[]int{3281,4021},[]int{778,4022},[]int{1664,4023},[]int{3281,4024},[]int{1591,4025},[]int{1770,4026},[]int{1098,4027},[]int{3668,4028},[]int{2866,4029},[]int{1277,4030},[]int{3659,4031},[]int{3471,4032},[]int{2004,4033},[]int{162,4034},[]int{1573,4035},[]int{2466,4036},[]int{3958,4037},[]int{1629,4038},[]int{1938,4039},[]int{3115,4040},[]int{3781,4041},[]int{1862,4042},[]int{564,4043},[]int{1683,4044},[]int{3842,4045},[]int{1930,4046},[]int{3039,4047},[]int{4004,4048},[]int{882,4049},[]int{1564,4050},[]int{1482,4051},[]int{353,4052},[]int{1439,4053},[]int{1679,4054},[]int{3571,4055},[]int{706,4056},[]int{3567,4057},[]int{1031,4058},[]int{254,4059},[]int{2451,4060},[]int{567,4061},[]int{1294,4062},[]int{150,4063},[]int{2232,4064},[]int{2981,4065},[]int{4018,4066},[]int{675,4067},[]int{2136,4068},[]int{3580,4069},[]int{805,4070},[]int{2792,4071},[]int{1388,4072},[]int{786,4073},[]int{3819,4074},[]int{2463,4075},[]int{551,4076},[]int{3795,4077},[]int{1263,4078},[]int{403,4079},[]int{523,4080},[]int{347,4081},[]int{3731,4082},[]int{480,4083},[]int{3329,4084},[]int{216,4085},[]int{886,4086},[]int{513,4087},[]int{3871,4088},[]int{117,4089},[]int{2026,4090},[]int{2097,4091},[]int{957,4092},[]int{2673,4093},[]int{3785,4094},[]int{596,4095},[]int{659,4096},[]int{790,4097},[]int{3192,4098},[]int{1442,4099},[]int{3984,4100},[]int{1368,4101},[]int{3993,4102},[]int{1126,4103},[]int{754,4104},[]int{1842,4105},[]int{85,4106},[]int{3002,4107},[]int{163,4108},[]int{460,4109},[]int{2791,4110},[]int{1559,4111},[]int{245,4112},[]int{1425,4113},[]int{3161,4114},[]int{2104,4115},[]int{2647,4116},[]int{1770,4117},[]int{1495,4118},[]int{489,4119},[]int{1148,4120},[]int{484,4121},[]int{1863,4122},[]int{2289,4123},[]int{2032,4124},[]int{1561,4125},[]int{3282,4126},[]int{2264,4127},[]int{745,4128},[]int{4041,4129},[]int{469,4130},[]int{3839,4131},[]int{3576,4132},[]int{2190,4133},[]int{1240,4134},[]int{2594,4135},[]int{1938,4136},[]int{1782,4137},[]int{1960,4138},[]int{3113,4139},[]int{3167,4140},[]int{1781,4141},[]int{2557,4142},[]int{1468,4143},[]int{3270,4144},[]int{894,4145},[]int{654,4146},[]int{808,4147},[]int{3778,4148},[]int{1280,4149},[]int{2814,4150},[]int{132,4151},[]int{3972,4152},[]int{32,4153},[]int{1120,4154},[]int{1696,4155},[]int{601,4156},[]int{2622,4157},[]int{1896,4158},[]int{45,4159},[]int{1753,4160},[]int{2150,4161},[]int{2873,4162},[]int{3315,4163},[]int{316,4164},[]int{690,4165},[]int{509,4166},[]int{171,4167},[]int{4104,4168},[]int{640,4169},[]int{98,4170},[]int{1363,4171},[]int{2375,4172},[]int{22,4173},[]int{2512,4174},[]int{3365,4175},[]int{2529,4176},[]int{3587,4177},[]int{3698,4178},[]int{1892,4179},[]int{3887,4180},[]int{196,4181},[]int{1006,4182},[]int{2372,4183},[]int{380,4184},[]int{878,4185},[]int{1285,4186},[]int{3160,4187},[]int{1729,4188},[]int{2883,4189},[]int{3282,4190},[]int{566,4191},[]int{3965,4192},[]int{2527,4193},[]int{2658,4194},[]int{744,4195},[]int{870,4196},[]int{4048,4197},[]int{2905,4198},[]int{415,4199},[]int{631,4200},[]int{2106,4201},[]int{2875,4202},[]int{3984,4203},[]int{2983,4204},[]int{2698,4205},[]int{1037,4206},[]int{4190,4207},[]int{2619,4208},[]int{3069,4209},[]int{4153,4210},[]int{2272,4211},[]int{696,4212},[]int{2436,4213},[]int{3655,4214},[]int{1915,4215},[]int{3832,4216},[]int{764,4217},[]int{3646,4218},[]int{3468,4219},[]int{2567,4220},[]int{2292,4221},[]int{1485,4222},[]int{1864,4223},[]int{777,4224},[]int{3557,4225},[]int{2092,4226},[]int{1822,4227},[]int{1271,4228},[]int{782,4229},[]int{4006,4230},[]int{1956,4231},[]int{1340,4232},[]int{557,4233},[]int{2847,4234},[]int{2831,4235},[]int{2747,4236},[]int{1598,4237},[]int{232,4238},[]int{2483,4239},[]int{919,4240},[]int{4077,4241},[]int{3965,4242},[]int{3365,4243},[]int{1838,4244},[]int{678,4245},[]int{309,4246},[]int{3234,4247},[]int{539,4248},[]int{1916,4249},[]int{443,4250},[]int{627,4251},[]int{1755,4252},[]int{2454,4253},[]int{4042,4254},[]int{3686,4255},[]int{2611,4256},[]int{3442,4257},[]int{1067,4258},[]int{825,4259},[]int{2264,4260},[]int{715,4261},[]int{3863,4262},[]int{3431,4263},[]int{1603,4264},[]int{4243,4265},[]int{895,4266},[]int{2195,4267},[]int{1156,4268},[]int{3532,4269},[]int{42,4270},[]int{1838,4271},[]int{4235,4272},[]int{2154,4273},[]int{672,4274},[]int{1999,4275},[]int{2490,4276},[]int{3137,4277},[]int{2681,4278},[]int{4246,4279},[]int{322,4280},[]int{2788,4281},[]int{2646,4282},[]int{1480,4283},[]int{1341,4284},[]int{592,4285},[]int{2150,4286},[]int{1051,4287},[]int{1645,4288},[]int{2353,4289},[]int{3631,4290},[]int{3256,4291},[]int{912,4292},[]int{474,4293},[]int{895,4294},[]int{253,4295},[]int{271,4296},[]int{2625,4297},[]int{1461,4298},[]int{473,4299},[]int{2992,4300},[]int{2703,4301},[]int{3774,4302},[]int{3253,4303},[]int{1672,4304},[]int{3792,4305},[]int{2080,4306},[]int{1776,4307},[]int{3083,4308},[]int{2794,4309},[]int{1863,4310},[]int{1806,4311},[]int{4225,4312},[]int{1481,4313},[]int{282,4314},[]int{4232,4315},[]int{1593,4316},[]int{3218,4317},[]int{1060,4318},[]int{346,4319},[]int{1164,4320},[]int{3073,4321},[]int{2533,4322},[]int{1672,4323},[]int{735,4324},[]int{2664,4325},[]int{845,4326},[]int{3312,4327},[]int{141,4328},[]int{604,4329},[]int{2455,4330},[]int{1194,4331},[]int{3129,4332},[]int{2093,4333},[]int{3427,4334},[]int{1209,4335},[]int{3861,4336},[]int{708,4337},[]int{3426,4338},[]int{4089,4339},[]int{3769,4340},[]int{2239,4341},[]int{1150,4342},[]int{3218,4343},[]int{4195,4344},[]int{831,4345},[]int{3957,4346},[]int{2928,4347},[]int{508,4348},[]int{4138,4349},[]int{168,4350},[]int{1217,4351},[]int{227,4352},[]int{2976,4353},[]int{931,4354},[]int{2001,4355},[]int{3949,4356},[]int{1705,4357},[]int{2560,4358},[]int{1625,4359},[]int{753,4360},[]int{2433,4361},[]int{2005,4362},[]int{1882,4363},[]int{214,4364},[]int{2177,4365},[]int{4232,4366},[]int{3465,4367},[]int{2084,4368},[]int{3488,4369},[]int{814,4370},[]int{3681,4371},[]int{3432,4372},[]int{3158,4373},[]int{1846,4374},[]int{3269,4375},[]int{373,4376},[]int{927,4377},[]int{1459,4378},[]int{1984,4379},[]int{1620,4380},[]int{1659,4381},[]int{3219,4382},[]int{973,4383},[]int{3239,4384},[]int{1542,4385},[]int{1371,4386},[]int{734,4387},[]int{3382,4388},[]int{1089,4389},[]int{3746,4390},[]int{2685,4391},[]int{3438,4392},[]int{934,4393},[]int{1061,4394},[]int{2158,4395},[]int{2239,4396},[]int{3801,4397},[]int{151,4398},[]int{3631,4399},[]int{2090,4400},[]int{1296,4401},[]int{1594,4402},[]int{812,4403},[]int{541,4404},[]int{2966,4405},[]int{1418,4406},[]int{3361,4407},[]int{27,4408},[]int{1109,4409},[]int{2253,4410},[]int{266,4411},[]int{191,4412},[]int{476,4413},[]int{3274,4414},[]int{3092,4415},[]int{3148,4416},[]int{827,4417},[]int{717,4418},[]int{2708,4419},[]int{642,4420},[]int{4242,4421},[]int{3424,4422},[]int{4370,4423},[]int{121,4424},[]int{1481,4425},[]int{1791,4426},[]int{1309,4427},[]int{4233,4428},[]int{767,4429},[]int{4063,4430},[]int{3574,4431},[]int{1978,4432},[]int{2633,4433},[]int{1402,4434},[]int{243,4435},[]int{594,4436},[]int{4220,4437},[]int{3281,4438},[]int{436,4439},[]int{520,4440},[]int{1205,4441},[]int{417,4442},[]int{845,4443},[]int{3724,4444},[]int{1179,4445},[]int{2336,4446},[]int{4411,4447},[]int{1989,4448},[]int{225,4449},[]int{2359,4450},[]int{127,4451},[]int{4222,4452},[]int{3877,4453},[]int{3642,4454},[]int{2423,4455},[]int{2830,4456},[]int{1840,4457},[]int{1248,4458},[]int{4260,4459},[]int{3294,4460},[]int{1561,4461},[]int{1319,4462},[]int{347,4463},[]int{2266,4464},[]int{823,4465},[]int{1194,4466},[]int{3860,4467},[]int{3517,4468},[]int{3444,4469},[]int{2739,4470},[]int{138,4471},[]int{2265,4472},[]int{815,4473},[]int{27,4474},[]int{2687,4475},[]int{2231,4476},[]int{4236,4477},[]int{3030,4478},[]int{85,4479},[]int{4103,4480},[]int{4462,4481},[]int{2794,4482},[]int{1182,4483},[]int{2729,4484},[]int{1905,4485},[]int{2214,4486},[]int{590,4487},[]int{1848,4488},[]int{529,4489},[]int{1746,4490},[]int{1772,4491},[]int{3044,4492},[]int{2104,4493},[]int{4048,4494},[]int{1513,4495},[]int{4283,4496},[]int{728,4497},[]int{3245,4498},[]int{1158,4499},[]int{3592,4500},[]int{3166,4501},[]int{2285,4502},[]int{793,4503},[]int{1058,4504},[]int{1997,4505},[]int{2037,4506},[]int{857,4507},[]int{236,4508},[]int{2837,4509},[]int{3428,4510},[]int{3738,4511},[]int{4102,4512},[]int{754,4513},[]int{1726,4514},[]int{4158,4515},[]int{1731,4516},[]int{489,4517},[]int{1524,4518},[]int{3075,4519},[]int{1300,4520},[]int{2647,4521},[]int{1281,4522},[]int{678,4523},[]int{66,4524},[]int{429,4525},[]int{4321,4526},[]int{1580,4527},[]int{3204,4528},[]int{2593,4529},[]int{2677,4530},[]int{3818,4531},[]int{3133,4532},[]int{4373,4533},[]int{3553,4534},[]int{4017,4535},[]int{4086,4536},[]int{2884,4537},[]int{1647,4538},[]int{1836,4539},[]int{3487,4540},[]int{239,4541},[]int{2559,4542},[]int{136,4543},[]int{2997,4544},[]int{3328,4545},[]int{995,4546},[]int{395,4547},[]int{2784,4548},[]int{2542,4549},[]int{4312,4550},[]int{4099,4551},[]int{3742,4552},[]int{3078,4553},[]int{4210,4554},[]int{4200,4555},[]int{1524,4556},[]int{3254,4557},[]int{1641,4558},[]int{4471,4559},[]int{2791,4560},[]int{2211,4561},[]int{1480,4562},[]int{1904,4563},[]int{1883,4564},[]int{3469,4565},[]int{969,4566},[]int{1292,4567},[]int{3650,4568},[]int{3343,4569},[]int{3601,4570},[]int{4262,4571},[]int{1969,4572},[]int{1331,4573},[]int{3288,4574},[]int{3128,4575},[]int{1065,4576},[]int{1833,4577},[]int{3901,4578},[]int{1542,4579},[]int{376,4580},[]int{375,4581},[]int{3817,4582},[]int{1148,4583},[]int{65,4584},[]int{1052,4585},[]int{618,4586},[]int{908,4587},[]int{1162,4588},[]int{3072,4589},[]int{1813,4590},[]int{2496,4591},[]int{905,4592},[]int{3834,4593},[]int{2760,4594},[]int{2759,4595},[]int{2219,4596},[]int{1924,4597},[]int{3809,4598},[]int{2814,4599},[]int{297,4600},[]int{976,4601},[]int{463,4602},[]int{2229,4603},[]int{3313,4604},[]int{3589,4605},[]int{3297,4606},[]int{181,4607},[]int{1269,4608},[]int{4153,4609},[]int{2750,4610},[]int{101,4611},[]int{19,4612},[]int{1272,4613},[]int{2061,4614},[]int{4278,4615},[]int{2170,4616},[]int{3629,4617},[]int{2925,4618},[]int{398,4619},[]int{4136,4620},[]int{326,4621},[]int{1827,4622},[]int{3486,4623},[]int{1005,4624},[]int{4356,4625},[]int{1911,4626},[]int{935,4627},[]int{923,4628},[]int{1079,4629},[]int{4381,4630},[]int{2903,4631},[]int{3001,4632},[]int{3619,4633},[]int{4466,4634},[]int{4480,4635},[]int{4326,4636},[]int{4576,4637},[]int{3977,4638},[]int{786,4639},[]int{207,4640},[]int{4487,4641},[]int{4270,4642},[]int{2353,4643},[]int{1174,4644},[]int{2487,4645},[]int{3569,4646},[]int{339,4647},[]int{1228,4648},[]int{3271,4649},[]int{1462,4650},[]int{2516,4651},[]int{4102,4652},[]int{928,4653},[]int{3072,4654},[]int{4441,4655},[]int{904,4656},[]int{1134,4657},[]int{4054,4658},[]int{4241,4659},[]int{1313,4660},[]int{2195,4661},[]int{738,4662},[]int{519,4663},[]int{3123,4664},[]int{3382,4665},[]int{3132,4666},[]int{199,4667},[]int{322,4668},[]int{4171,4669},[]int{2008,4670},[]int{771,4671},[]int{3305,4672},[]int{1391,4673},[]int{2242,4674},[]int{1942,4675},[]int{503,4676},[]int{4439,4677},[]int{2026,4678},[]int{3067,4679},[]int{3924,4680},[]int{95,4681},[]int{2983,4682},[]int{1965,4683},[]int{2857,4684},[]int{4230,4685},[]int{2309,4686},[]int{137,4687},[]int{222,4688},[]int{797,4689},[]int{2079,4690},[]int{1406,4691},[]int{2287,4692},[]int{1756,4693},[]int{3898,4694},[]int{1456,4695},[]int{4254,4696},[]int{1313,4697},[]int{3909,4698},[]int{3137,4699},[]int{2213,4700},[]int{2135,4701},[]int{3095,4702},[]int{93,4703},[]int{2007,4704},[]int{52,4705},[]int{2642,4706},[]int{1851,4707},[]int{3540,4708},[]int{1591,4709},[]int{4269,4710},[]int{655,4711},[]int{2918,4712},[]int{1131,4713},[]int{4052,4714},[]int{786,4715},[]int{3880,4716},[]int{3590,4717},[]int{680,4718},[]int{1247,4719},[]int{3938,4720},[]int{1830,4721},[]int{2784,4722},[]int{66,4723},[]int{1003,4724},[]int{197,4725},[]int{2076,4726},[]int{4248,4727},[]int{2196,4728},[]int{2759,4729},[]int{3979,4730},[]int{2169,4731},[]int{2533,4732},[]int{4377,4733},[]int{2672,4734},[]int{4629,4735},[]int{686,4736},[]int{891,4737},[]int{3252,4738},[]int{4268,4739},[]int{1260,4740},[]int{1829,4741},[]int{483,4742},[]int{4476,4743},[]int{2814,4744},[]int{2023,4745},[]int{527,4746},[]int{2118,4747},[]int{327,4748},[]int{3267,4749},[]int{3914,4750},[]int{3237,4751},[]int{1545,4752},[]int{4123,4753},[]int{1013,4754},[]int{2292,4755},[]int{1400,4756},[]int{926,4757},[]int{3497,4758},[]int{4036,4759},[]int{2018,4760},[]int{1680,4761},[]int{2916,4762},[]int{383,4763},[]int{2379,4764},[]int{2666,4765},[]int{2700,4766},[]int{3090,4767},[]int{3714,4768},[]int{3702,4769},[]int{1456,4770},[]int{497,4771},[]int{979,4772},[]int{3699,4773},[]int{4408,4774},[]int{1393,4775},[]int{151,4776},[]int{8,4777},[]int{4253,4778},[]int{4182,4779},[]int{4374,4780},[]int{3452,4781},[]int{1648,4782},[]int{4027,4783},[]int{1175,4784},[]int{3168,4785},[]int{2654,4786},[]int{2075,4787},[]int{3631,4788},[]int{1827,4789},[]int{4006,4790},[]int{2527,4791},[]int{2211,4792},[]int{4481,4793},[]int{2881,4794},[]int{1689,4795},[]int{1816,4796},[]int{3430,4797},[]int{1582,4798},[]int{1151,4799},[]int{4263,4800},[]int{1481,4801},[]int{3398,4802},[]int{2721,4803},[]int{4657,4804},[]int{4485,4805},[]int{2367,4806},[]int{2839,4807},[]int{4094,4808},[]int{2932,4809},[]int{124,4810},[]int{3541,4811},[]int{1625,4812},[]int{399,4813},[]int{4003,4814},[]int{4247,4815},[]int{1135,4816},[]int{2077,4817},[]int{1612,4818},[]int{1158,4819},[]int{3854,4820},[]int{1792,4821},[]int{4396,4822},[]int{762,4823},[]int{45,4824},[]int{4257,4825},[]int{3432,4826},[]int{3419,4827},[]int{899,4828},[]int{4249,4829},[]int{1322,4830},[]int{2495,4831},[]int{2864,4832},[]int{518,4833},[]int{3599,4834},[]int{3382,4835},[]int{1087,4836},[]int{2878,4837},[]int{2217,4838},[]int{3496,4839},[]int{2494,4840},[]int{1638,4841},[]int{1506,4842},[]int{2394,4843},[]int{4176,4844},[]int{2257,4845},[]int{4814,4846},[]int{4291,4847},[]int{1542,4848},[]int{1061,4849},[]int{843,4850},[]int{736,4851},[]int{3338,4852},[]int{4117,4853},[]int{3647,4854},[]int{4570,4855},[]int{4577,4856},[]int{908,4857},[]int{4555,4858},[]int{964,4859},[]int{4004,4860},[]int{3378,4861},[]int{251,4862},[]int{3087,4863},[]int{3122,4864},[]int{1691,4865},[]int{1665,4866},[]int{4630,4867},[]int{2663,4868},[]int{4143,4869},[]int{2664,4870},[]int{4212,4871},[]int{2748,4872},[]int{3595,4873},[]int{1,4874},[]int{1030,4875},[]int{3476,4876},[]int{798,4877},[]int{3996,4878},[]int{3488,4879},[]int{3200,4880},[]int{606,4881},[]int{1495,4882},[]int{801,4883},[]int{2068,4884},[]int{4238,4885},[]int{4750,4886},[]int{4524,4887},[]int{2694,4888},[]int{4673,4889},[]int{1204,4890},[]int{3471,4891},[]int{723,4892},[]int{1561,4893},[]int{3752,4894},[]int{598,4895},[]int{4288,4896},[]int{240,4897},[]int{414,4898},[]int{404,4899},[]int{43,4900},[]int{2438,4901},[]int{135,4902},[]int{1899,4903},[]int{3644,4904},[]int{1407,4905},[]int{4215,4906},[]int{3099,4907},[]int{2267,4908},[]int{360,4909},[]int{4564,4910},[]int{4665,4911},[]int{2384,4912},[]int{4441,4913},[]int{3258,4914},[]int{1445,4915},[]int{3387,4916},[]int{671,4917},[]int{1834,4918},[]int{2223,4919},[]int{702,4920},[]int{4504,4921},[]int{1589,4922},[]int{4050,4923},[]int{1076,4924},[]int{670,4925},[]int{2622,4926},[]int{2189,4927},[]int{495,4928},[]int{4694,4929},[]int{180,4930},[]int{1848,4931},[]int{3398,4932},[]int{4539,4933},[]int{828,4934},[]int{1440,4935},[]int{1674,4936},[]int{2190,4937},[]int{1573,4938},[]int{820,4939},[]int{2327,4940},[]int{4334,4941},[]int{2234,4942},[]int{269,4943},[]int{875,4944},[]int{1530,4945},[]int{3728,4946},[]int{1526,4947},[]int{1171,4948},[]int{2899,4949},[]int{1763,4950},[]int{1030,4951},[]int{3478,4952},[]int{1340,4953},[]int{1105,4954},[]int{2017,4955},[]int{647,4956},[]int{3240,4957},[]int{3170,4958},[]int{468,4959},[]int{1939,4960},[]int{1873,4961},[]int{2435,4962},[]int{1836,4963},[]int{2400,4964},[]int{61,4965},[]int{3100,4966},[]int{1586,4967},[]int{1985,4968},[]int{3348,4969},[]int{3241,4970},[]int{1430,4971},[]int{2415,4972},[]int{2577,4973},[]int{3657,4974},[]int{720,4975},[]int{3205,4976},[]int{2835,4977},[]int{829,4978},[]int{3972,4979},[]int{4576,4980},[]int{3264,4981},[]int{1720,4982},[]int{846,4983},[]int{2153,4984},[]int{3439,4985},[]int{2192,4986},[]int{3015,4987},[]int{765,4988},[]int{2508,4989},[]int{4442,4990},[]int{4397,4991},[]int{768,4992},[]int{1841,4993},[]int{2990,4994},[]int{1414,4995},[]int{1145,4996},[]int{633,4997},[]int{2491,4998},[]int{3642,4999},[]int{126,5000},[]int{2163,5001},[]int{1637,5002},[]int{1698,5003},[]int{2131,5004},[]int{3227,5005},[]int{2658,5006},[]int{3621,5007},[]int{1457,5008},[]int{357,5009},[]int{870,5010},[]int{570,5011},[]int{2566,5012},[]int{3103,5013},[]int{161,5014},[]int{4629,5015},[]int{2988,5016},[]int{1654,5017},[]int{3804,5018},[]int{4315,5019},[]int{3681,5020},[]int{811,5021},[]int{929,5022},[]int{3731,5023},[]int{553,5024},[]int{12,5025},[]int{4965,5026},[]int{4097,5027},[]int{3898,5028},[]int{2319,5029},[]int{1279,5030},[]int{819,5031},[]int{3764,5032},[]int{2359,5033},[]int{71,5034},[]int{4912,5035},[]int{4727,5036},[]int{1777,5037},[]int{4680,5038},[]int{4286,5039},[]int{4196,5040},[]int{1512,5041},[]int{2531,5042},[]int{3841,5043},[]int{482,5044},[]int{2251,5045},[]int{3741,5046},[]int{677,5047},[]int{843,5048},[]int{4182,5049},[]int{5023,5050},[]int{1389,5051},[]int{4910,5052},[]int{212,5053},[]int{3262,5054},[]int{1143,5055},[]int{1603,5056},[]int{2802,5057},[]int{3438,5058},[]int{3994,5059},[]int{4913,5060},[]int{3351,5061},[]int{965,5062},[]int{3573,5063},[]int{1680,5064},[]int{3469,5065},[]int{341,5066},[]int{659,5067},[]int{3076,5068},[]int{485,5069},[]int{1462,5070},[]int{4626,5071},[]int{4850,5072},[]int{635,5073},[]int{880,5074},[]int{1096,5075},[]int{2802,5076},[]int{4307,5077},[]int{2570,5078},[]int{2722,5079},[]int{2465,5080},[]int{3755,5081},[]int{1907,5082},[]int{4784,5083},[]int{4718,5084},[]int{3144,5085},[]int{4552,5086},[]int{4181,5087},[]int{3105,5088},[]int{4122,5089},[]int{4609,5090},[]int{547,5091},[]int{4200,5092},[]int{2901,5093},[]int{4417,5094},[]int{2653,5095},[]int{4486,5096},[]int{3747,5097},[]int{4745,5098},[]int{687,5099},[]int{4756,5100},[]int{2930,5101},[]int{4854,5102},[]int{851,5103},[]int{2974,5104},[]int{2995,5105},[]int{831,5106},[]int{5102,5107},[]int{1732,5108},[]int{1704,5109},[]int{709,5110},[]int{3525,5111},[]int{3811,5112},[]int{3182,5113},[]int{533,5114},[]int{557,5115},[]int{4229,5116},[]int{2515,5117},[]int{2246,5118},[]int{1061,5119},[]int{152,5120},[]int{4373,5121},[]int{478,5122},[]int{3656,5123},[]int{2858,5124},[]int{3571,5125},[]int{4570,5126},[]int{3133,5127},[]int{1641,5128},[]int{76,5129},[]int{4189,5130},[]int{3432,5131},[]int{4229,5132},[]int{2129,5133},[]int{877,5134},[]int{1378,5135},[]int{1821,5136},[]int{1838,5137},[]int{3528,5138},[]int{455,5139},[]int{2807,5140},[]int{2060,5141},[]int{2803,5142},[]int{4263,5143},[]int{4869,5144},[]int{1424,5145},[]int{1921,5146},[]int{121,5147},[]int{349,5148},[]int{3944,5149},[]int{5149,5150},[]int{1383,5151},[]int{4828,5152},[]int{4289,5153},[]int{3222,5154},[]int{2090,5155},[]int{3431,5156},[]int{5072,5157},[]int{360,5158},[]int{99,5159},[]int{2838,5160},[]int{2671,5161},[]int{986,5162},[]int{2738,5163},[]int{1362,5164},[]int{5150,5165},[]int{1286,5166},[]int{4942,5167},[]int{1443,5168},[]int{3700,5169},[]int{2976,5170},[]int{2099,5171},[]int{1099,5172},[]int{3740,5173},[]int{448,5174},[]int{3422,5175},[]int{2571,5176},[]int{2339,5177},[]int{2125,5178},[]int{4879,5179},[]int{4119,5180},[]int{3840,5181},[]int{3584,5182},[]int{1256,5183},[]int{1312,5184},[]int{3062,5185},[]int{3937,5186},[]int{4629,5187},[]int{2063,5188},[]int{3410,5189},[]int{4107,5190},[]int{3054,5191},[]int{4033,5192},[]int{5116,5193},[]int{4620,5194},[]int{2298,5195},[]int{2831,5196},[]int{3508,5197},[]int{4964,5198},[]int{1427,5199},[]int{3075,5200},[]int{4610,5201},[]int{3803,5202},[]int{833,5203},[]int{3852,5204},[]int{872,5205},[]int{3613,5206},[]int{2632,5207},[]int{1360,5208},[]int{4520,5209},[]int{2323,5210},[]int{1216,5211},[]int{4420,5212},[]int{5029,5213},[]int{663,5214},[]int{4407,5215},[]int{473,5216},[]int{4449,5217},[]int{5120,5218},[]int{600,5219},[]int{2418,5220},[]int{3759,5221},[]int{4638,5222},[]int{1127,5223},[]int{221,5224},[]int{551,5225},[]int{1779,5226},[]int{1789,5227},[]int{1688,5228},[]int{679,5229},[]int{2200,5230},[]int{4526,5231},[]int{4402,5232},[]int{1635,5233},[]int{3159,5234},[]int{2101,5235},[]int{3891,5236},[]int{814,5237},[]int{273,5238},[]int{1311,5239},[]int{3232,5240},[]int{525,5241},[]int{1307,5242},[]int{1484,5243},[]int{4535,5244},[]int{3989,5245},[]int{2149,5246},[]int{2563,5247},[]int{3835,5248},[]int{1317,5249},[]int{5064,5250},[]int{247,5251},[]int{1729,5252},[]int{744,5253},[]int{3993,5254},[]int{1751,5255},[]int{159,5256},[]int{4997,5257},[]int{2554,5258},[]int{2430,5259},[]int{3030,5260},[]int{3364,5261},[]int{2398,5262},[]int{3090,5263},[]int{3859,5264},[]int{272,5265},[]int{4214,5266},[]int{4137,5267},[]int{3318,5268},[]int{208,5269},[]int{1879,5270},[]int{2015,5271},[]int{4497,5272},[]int{3357,5273},[]int{3715,5274},[]int{754,5275},[]int{2120,5276},[]int{1348,5277},[]int{2363,5278},[]int{1568,5279},[]int{4185,5280},[]int{4282,5281},[]int{2082,5282},[]int{4341,5283},[]int{2942,5284},[]int{4726,5285},[]int{1211,5286},[]int{4046,5287},[]int{4347,5288},[]int{4767,5289},[]int{1781,5290},[]int{2606,5291},[]int{3963,5292},[]int{2661,5293},[]int{625,5294},[]int{3191,5295},[]int{2300,5296},[]int{916,5297},[]int{3360,5298},[]int{542,5299},[]int{159,5300},[]int{4247,5301},[]int{3642,5302},[]int{4458,5303},[]int{4557,5304},[]int{3843,5305},[]int{1249,5306},[]int{146,5307},[]int{4115,5308},[]int{246,5309},[]int{2289,5310},[]int{54,5311},[]int{2953,5312},[]int{5027,5313},[]int{3471,5314},[]int{2216,5315},[]int{3699,5316},[]int{1992,5317},[]int{4584,5318},[]int{1190,5319},[]int{5268,5320},[]int{2344,5321},[]int{5219,5322},[]int{3486,5323},[]int{4577,5324},[]int{3797,5325},[]int{4980,5326},[]int{914,5327},[]int{2175,5328},[]int{794,5329},[]int{1166,5330},[]int{5043,5331},[]int{4265,5332},[]int{5204,5333},[]int{3300,5334},[]int{309,5335},[]int{4368,5336},[]int{3607,5337},[]int{3032,5338},[]int{4774,5339},[]int{1080,5340},[]int{2685,5341},[]int{4344,5342},[]int{3062,5343},[]int{4188,5344},[]int{714,5345},[]int{915,5346},[]int{1664,5347},[]int{1583,5348},[]int{756,5349},[]int{5155,5350},[]int{4180,5351},[]int{719,5352},[]int{5294,5353},[]int{2102,5354},[]int{242,5355},[]int{283,5356},[]int{2608,5357},[]int{4430,5358},[]int{1836,5359},[]int{624,5360},[]int{1233,5361},[]int{4686,5362},[]int{4394,5363},[]int{4016,5364},[]int{4698,5365},[]int{1802,5366},[]int{3263,5367},[]int{1960,5368},[]int{4478,5369},[]int{444,5370},[]int{2867,5371},[]int{4848,5372},[]int{3406,5373},[]int{3186,5374},[]int{3358,5375},[]int{1065,5376},[]int{5066,5377},[]int{735,5378},[]int{4274,5379},[]int{4490,5380},[]int{953,5381},[]int{341,5382},[]int{2788,5383},[]int{616,5384},[]int{2868,5385},[]int{1720,5386},[]int{1090,5387},[]int{2745,5388},[]int{1287,5389},[]int{4300,5390},[]int{5109,5391},[]int{2996,5392},[]int{4021,5393},[]int{3245,5394},[]int{2370,5395},[]int{4732,5396},[]int{1829,5397},[]int{1215,5398},[]int{5315,5399},[]int{2551,5400},[]int{911,5401},[]int{1633,5402},[]int{359,5403},[]int{4193,5404},[]int{2737,5405},[]int{3809,5406},[]int{3267,5407},[]int{1570,5408},[]int{137,5409},[]int{2913,5410},[]int{4892,5411},[]int{4628,5412},[]int{2442,5413},[]int{1166,5414},[]int{52,5415},[]int{3154,5416},[]int{62,5417},[]int{967,5418},[]int{1838,5419},[]int{4139,5420},[]int{1527,5421},[]int{3804,5422},[]int{3485,5423},[]int{4095,5424},[]int{4778,5425},[]int{746,5426},[]int{5329,5427},[]int{2977,5428},[]int{2066,5429},[]int{1422,5430},[]int{4188,5431},[]int{4465,5432},[]int{4765,5433},[]int{1470,5434},[]int{1626,5435},[]int{4481,5436},[]int{2605,5437},[]int{5112,5438},[]int{2676,5439},[]int{5051,5440},[]int{2720,5441},[]int{3465,5442},[]int{50,5443},[]int{878,5444},[]int{2632,5445},[]int{1197,5446},[]int{1897,5447},[]int{394,5448},[]int{1290,5449},[]int{1040,5450},[]int{1327,5451},[]int{3917,5452},[]int{3706,5453},[]int{2521,5454},[]int{943,5455},[]int{5189,5456},[]int{3790,5457},[]int{3504,5458},[]int{1212,5459},[]int{1636,5460},[]int{701,5461},[]int{1410,5462},[]int{1047,5463},[]int{3235,5464},[]int{4930,5465},[]int{2801,5466},[]int{1877,5467},[]int{5271,5468},[]int{2059,5469},[]int{4258,5470},[]int{5282,5471},[]int{3562,5472},[]int{1714,5473},[]int{678,5474},[]int{2882,5475},[]int{5354,5476},[]int{5456,5477},[]int{2799,5478},[]int{1821,5479},[]int{2004,5480},[]int{2798,5481},[]int{859,5482},[]int{4728,5483},[]int{4872,5484},[]int{5077,5485},[]int{3135,5486},[]int{2281,5487},[]int{5401,5488},[]int{831,5489},[]int{4326,5490},[]int{1089,5491},[]int{1487,5492},[]int{2559,5493},[]int{3910,5494},[]int{4882,5495},[]int{1897,5496},[]int{4857,5497},[]int{4740,5498},[]int{2284,5499},[]int{4855,5500},[]int{4261,5501},[]int{673,5502},[]int{1609,5503},[]int{2464,5504},[]int{5325,5505},[]int{1146,5506},[]int{581,5507},[]int{3434,5508},[]int{4928,5509},[]int{645,5510},[]int{4124,5511},[]int{4779,5512},[]int{4017,5513},[]int{3517,5514},[]int{3111,5515},[]int{5358,5516},[]int{2052,5517},[]int{3214,5518},[]int{940,5519},[]int{4303,5520},[]int{3713,5521},[]int{3778,5522},[]int{1389,5523},[]int{4648,5524},[]int{4692,5525},[]int{3613,5526},[]int{9,5527},[]int{1607,5528},[]int{1001,5529},[]int{1927,5530},[]int{2517,5531},[]int{4833,5532},[]int{1221,5533},[]int{5406,5534},[]int{3170,5535},[]int{2964,5536},[]int{3947,5537},[]int{1922,5538},[]int{2179,5539},[]int{4169,5540},[]int{3437,5541},[]int{1202,5542},[]int{3831,5543},[]int{20,5544},[]int{202,5545},[]int{3988,5546},[]int{3686,5547},[]int{2261,5548},[]int{3504,5549},[]int{3388,5550},[]int{4433,5551},[]int{4461,5552},[]int{1377,5553},[]int{3641,5554},[]int{2538,5555},[]int{2930,5556},[]int{3012,5557},[]int{1431,5558},[]int{5209,5559},[]int{56,5560},[]int{5280,5561},[]int{4804,5562},[]int{3594,5563},[]int{4673,5564},[]int{3555,5565},[]int{3844,5566},[]int{3274,5567},[]int{4216,5568},[]int{5271,5569},[]int{5266,5570},[]int{609,5571},[]int{1783,5572},[]int{252,5573},[]int{3829,5574},[]int{810,5575},[]int{178,5576},[]int{2555,5577},[]int{4582,5578},[]int{2397,5579},[]int{3500,5580},[]int{974,5581},[]int{5267,5582},[]int{4742,5583},[]int{4389,5584},[]int{765,5585},[]int{2017,5586},[]int{170,5587},[]int{1605,5588},[]int{872,5589},[]int{1297,5590},[]int{2312,5591},[]int{1569,5592},[]int{505,5593},[]int{4821,5594},[]int{5002,5595},[]int{3980,5596},[]int{4268,5597},[]int{1968,5598},[]int{2261,5599},[]int{4289,5600},[]int{2835,5601},[]int{1632,5602},[]int{5437,5603},[]int{5348,5604},[]int{380,5605},[]int{1237,5606},[]int{3161,5607},[]int{5171,5608},[]int{361,5609},[]int{514,5610},[]int{4675,5611},[]int{4695,5612},[]int{1854,5613},[]int{138,5614},[]int{3495,5615},[]int{5148,5616},[]int{4227,5617},[]int{4217,5618},[]int{1137,5619},[]int{2929,5620},[]int{5028,5621},[]int{2388,5622},[]int{2043,5623},[]int{5078,5624},[]int{856,5625},[]int{1892,5626},[]int{2960,5627},[]int{3137,5628},[]int{4883,5629},[]int{2417,5630},[]int{172,5631},[]int{3299,5632},[]int{3329,5633},[]int{114,5634},[]int{5100,5635},[]int{748,5636},[]int{5590,5637},[]int{2616,5638},[]int{4875,5639},[]int{2721,5640},[]int{4931,5641},[]int{4316,5642},[]int{282,5643},[]int{3230,5644},[]int{4614,5645},[]int{3081,5646},[]int{481,5647},[]int{2517,5648},[]int{4043,5649},[]int{291,5650},[]int{67,5651},[]int{555,5652},[]int{3092,5653},[]int{5536,5654},[]int{5084,5655},[]int{3450,5656},[]int{1874,5657},[]int{4288,5658},[]int{2185,5659},[]int{1027,5660},[]int{4882,5661},[]int{334,5662},[]int{1724,5663},[]int{4561,5664},[]int{3292,5665},[]int{1691,5666},[]int{5484,5667},[]int{1376,5668},[]int{4309,5669},[]int{4239,5670},[]int{3091,5671},[]int{3184,5672},[]int{1988,5673},[]int{3698,5674},[]int{2105,5675},[]int{2054,5676},[]int{5304,5677},[]int{3201,5678},[]int{4865,5679},[]int{4117,5680},[]int{2987,5681},[]int{2288,5682},[]int{3876,5683},[]int{93,5684},[]int{2984,5685},[]int{3386,5686},[]int{5378,5687},[]int{346,5688},[]int{2519,5689},[]int{4605,5690},[]int{1136,5691},[]int{3420,5692},[]int{3146,5693},[]int{429,5694},[]int{5636,5695},[]int{0,5696},[]int{833,5697},[]int{2165,5698},[]int{4353,5699},[]int{4298,5700},[]int{3811,5701},[]int{907,5702},[]int{192,5703},[]int{3821,5704},[]int{3559,5705},[]int{4878,5706},[]int{4195,5707},[]int{4857,5708},[]int{2692,5709},[]int{4575,5710},[]int{4651,5711},[]int{416,5712},[]int{2981,5713},[]int{1183,5714},[]int{1149,5715},[]int{2645,5716},[]int{5578,5717},[]int{4769,5718},[]int{1144,5719},[]int{209,5720},[]int{472,5721},[]int{5389,5722},[]int{1166,5723},[]int{4415,5724},[]int{2861,5725},[]int{3887,5726},[]int{4370,5727},[]int{2180,5728},[]int{3351,5729},[]int{5047,5730},[]int{936,5731},[]int{276,5732},[]int{4603,5733},[]int{1106,5734},[]int{647,5735},[]int{4404,5736},[]int{649,5737},[]int{3274,5738},[]int{2469,5739},[]int{1873,5740},[]int{5006,5741},[]int{5555,5742},[]int{658,5743},[]int{5689,5744},[]int{3916,5745},[]int{2886,5746},[]int{2082,5747},[]int{5286,5748},[]int{3471,5749},[]int{4092,5750},[]int{1322,5751},[]int{68,5752},[]int{2675,5753},[]int{4254,5754},[]int{87,5755},[]int{1005,5756},[]int{4914,5757},[]int{3913,5758},[]int{3212,5759},[]int{4080,5760},[]int{4971,5761},[]int{3689,5762},[]int{905,5763},[]int{4421,5764},[]int{3435,5765},[]int{3347,5766},[]int{2320,5767},[]int{4897,5768},[]int{3853,5769},[]int{142,5770},[]int{4526,5771},[]int{701,5772},[]int{5632,5773},[]int{3870,5774},[]int{3461,5775},[]int{726,5776},[]int{284,5777},[]int{489,5778},[]int{3539,5779},[]int{1620,5780},[]int{5247,5781},[]int{3184,5782},[]int{2892,5783},[]int{2655,5784},[]int{1304,5785},[]int{5472,5786},[]int{834,5787},[]int{4544,5788},[]int{3726,5789},[]int{1816,5790},[]int{1221,5791},[]int{25,5792},[]int{4780,5793},[]int{3081,5794},[]int{1590,5795},[]int{3261,5796},[]int{5621,5797},[]int{4124,5798},[]int{1798,5799},[]int{3191,5800},[]int{4878,5801},[]int{4202,5802},[]int{3289,5803},[]int{2041,5804},[]int{4585,5805},[]int{3442,5806},[]int{1301,5807},[]int{5336,5808},[]int{5504,5809},[]int{1626,5810},[]int{3107,5811},[]int{5767,5812},[]int{149,5813},[]int{3652,5814},[]int{5052,5815},[]int{2814,5816},[]int{2957,5817},[]int{666,5818},[]int{606,5819},[]int{4086,5820},[]int{3651,5821},[]int{1411,5822},[]int{564,5823},[]int{2066,5824},[]int{5151,5825},[]int{5736,5826},[]int{3682,5827},[]int{5101,5828},[]int{1871,5829},[]int{5777,5830},[]int{1353,5831},[]int{683,5832},[]int{2941,5833},[]int{135,5834},[]int{5138,5835},[]int{2617,5836},[]int{4400,5837},[]int{2637,5838},[]int{1384,5839},[]int{3734,5840},[]int{1496,5841},[]int{4649,5842},[]int{3768,5843},[]int{1984,5844},[]int{3925,5845},[]int{4305,5846},[]int{4250,5847},[]int{4060,5848},[]int{3064,5849},[]int{3670,5850},[]int{168,5851},[]int{122,5852},[]int{855,5853},[]int{461,5854},[]int{416,5855},[]int{3472,5856},[]int{5812,5857},[]int{5732,5858},[]int{903,5859},[]int{1063,5860},[]int{3655,5861},[]int{885,5862},[]int{1284,5863},[]int{3344,5864},[]int{3872,5865},[]int{3189,5866},[]int{1188,5867},[]int{314,5868},[]int{4431,5869},[]int{2399,5870},[]int{3097,5871},[]int{5794,5872},[]int{475,5873},[]int{1783,5874},[]int{793,5875},[]int{2117,5876},[]int{3844,5877},[]int{2155,5878},[]int{2191,5879},[]int{4518,5880},[]int{311,5881},[]int{2,5882},[]int{2513,5883},[]int{5208,5884},[]int{1721,5885},[]int{584,5886},[]int{4271,5887},[]int{3015,5888},[]int{4752,5889},[]int{2801,5890},[]int{3607,5891},[]int{225,5892},[]int{1374,5893},[]int{863,5894},[]int{1540,5895},[]int{379,5896},[]int{2889,5897},[]int{556,5898},[]int{4331,5899},[]int{4986,5900},[]int{970,5901},[]int{4208,5902},[]int{708,5903},[]int{1856,5904},[]int{88,5905},[]int{3914,5906},[]int{1269,5907},[]int{1140,5908},[]int{571,5909},[]int{5351,5910},[]int{5482,5911},[]int{1839,5912},[]int{3294,5913},[]int{5296,5914},[]int{2535,5915},[]int{3984,5916},[]int{3964,5917},[]int{2471,5918},[]int{1760,5919},[]int{5867,5920},[]int{300,5921},[]int{4205,5922},[]int{3274,5923},[]int{1981,5924},[]int{3228,5925},[]int{5687,5926},[]int{3008,5927},[]int{2896,5928},[]int{3160,5929},[]int{1121,5930},[]int{2824,5931},[]int{2459,5932},[]int{5347,5933},[]int{2019,5934},[]int{5083,5935},[]int{2870,5936},[]int{4938,5937},[]int{4246,5938},[]int{2336,5939},[]int{76,5940},[]int{3676,5941},[]int{5724,5942},[]int{2688,5943},[]int{4572,5944},[]int{1139,5945},[]int{154,5946},[]int{4019,5947},[]int{678,5948},[]int{1525,5949},[]int{1453,5950},[]int{4810,5951},[]int{4463,5952},[]int{5064,5953},[]int{3672,5954},[]int{3958,5955},[]int{741,5956},[]int{64,5957},[]int{1415,5958},[]int{966,5959},[]int{5442,5960},[]int{1434,5961},[]int{4539,5962},[]int{1754,5963},[]int{500,5964},[]int{5764,5965},[]int{4310,5966},[]int{601,5967},[]int{3190,5968},[]int{3413,5969},[]int{5499,5970},[]int{4229,5971},[]int{3417,5972},[]int{1224,5973},[]int{1781,5974},[]int{1082,5975},[]int{2601,5976},[]int{1399,5977},[]int{3887,5978},[]int{5954,5979},[]int{4022,5980},[]int{3232,5981},[]int{3764,5982},[]int{5014,5983},[]int{4968,5984},[]int{4958,5985},[]int{4528,5986},[]int{3951,5987},[]int{432,5988},[]int{4993,5989},[]int{331,5990},[]int{2890,5991},[]int{1415,5992},[]int{267,5993},[]int{4272,5994},[]int{421,5995},[]int{1412,5996},[]int{4041,5997},[]int{2750,5998},[]int{425,5999},[]int{564,6000},[]int{3269,6001},[]int{3582,6002},[]int{1577,6003},[]int{367,6004},[]int{1118,6005},[]int{5737,6006},[]int{2360,6007},[]int{5674,6008},[]int{4063,6009},[]int{629,6010},[]int{1411,6011},[]int{1329,6012},[]int{5337,6013},[]int{1864,6014},[]int{3579,6015},[]int{1385,6016},[]int{4638,6017},[]int{4533,6018},[]int{4806,6019},[]int{4422,6020},[]int{4978,6021},[]int{2856,6022},[]int{5312,6023},[]int{3528,6024},[]int{5476,6025},[]int{4383,6026},[]int{811,6027},[]int{3558,6028},[]int{564,6029},[]int{716,6030},[]int{5538,6031},[]int{2438,6032},[]int{3111,6033},[]int{4041,6034},[]int{1055,6035},[]int{3814,6036},[]int{5526,6037},[]int{4666,6038},[]int{5507,6039},[]int{4834,6040},[]int{1343,6041},[]int{3364,6042},[]int{503,6043},[]int{1929,6044},[]int{1178,6045},[]int{560,6046},[]int{1977,6047},[]int{3239,6048},[]int{3118,6049},[]int{3842,6050},[]int{166,6051},[]int{756,6052},[]int{1803,6053},[]int{2809,6054},[]int{2459,6055},[]int{3068,6056},[]int{263,6057},[]int{3110,6058},[]int{5208,6059},[]int{5739,6060},[]int{465,6061},[]int{1161,6062},[]int{1743,6063},[]int{3853,6064},[]int{649,6065},[]int{1973,6066},[]int{1044,6067},[]int{1374,6068},[]int{1772,6069},[]int{987,6070},[]int{3639,6071},[]int{3389,6072},[]int{5038,6073},[]int{5852,6074},[]int{5610,6075},[]int{3520,6076},[]int{3301,6077},[]int{384,6078},[]int{1043,6079},[]int{918,6080},[]int{5831,6081},[]int{2999,6082},[]int{2446,6083},[]int{5576,6084},[]int{1276,6085},[]int{3138,6086},[]int{4495,6087},[]int{1909,6088},[]int{1185,6089},[]int{1305,6090},[]int{5692,6091},[]int{5164,6092},[]int{1811,6093},[]int{516,6094},[]int{4063,6095},[]int{2672,6096},[]int{3189,6097},[]int{4171,6098},[]int{4009,6099},[]int{3824,6100},[]int{2144,6101},[]int{789,6102},[]int{5583,6103},[]int{1937,6104},[]int{3178,6105},[]int{5371,6106},[]int{290,6107},[]int{361,6108},[]int{4330,6109},[]int{2539,6110},[]int{5647,6111},[]int{906,6112},[]int{4097,6113},[]int{4686,6114},[]int{2405,6115},[]int{916,6116},[]int{2425,6117},[]int{4485,6118},[]int{631,6119},[]int{2928,6120},[]int{2175,6121},[]int{3397,6122},[]int{3459,6123},[]int{4374,6124},[]int{1937,6125},[]int{793,6126},[]int{3428,6127},[]int{385,6128},[]int{2632,6129},[]int{5796,6130},[]int{5466,6131},[]int{3659,6132},[]int{2045,6133},[]int{3961,6134},[]int{1303,6135},[]int{1448,6136},[]int{2492,6137},[]int{5424,6138},[]int{2604,6139},[]int{941,6140},[]int{4601,6141},[]int{3798,6142},[]int{4761,6143},[]int{4566,6144},[]int{2272,6145},[]int{2562,6146},[]int{1696,6147},[]int{2707,6148},[]int{6119,6149},[]int{2450,6150},[]int{4680,6151},[]int{3096,6152},[]int{3951,6153},[]int{3494,6154},[]int{5720,6155},[]int{4136,6156},[]int{3385,6157},[]int{5871,6158},[]int{310,6159},[]int{2917,6160},[]int{5900,6161},[]int{2489,6162},[]int{5638,6163},[]int{4199,6164},[]int{4126,6165},[]int{5134,6166},[]int{1802,6167},[]int{5215,6168},[]int{2340,6169},[]int{5265,6170},[]int{5555,6171},[]int{5518,6172},[]int{2353,6173},[]int{1833,6174},[]int{325,6175},[]int{5742,6176},[]int{1126,6177},[]int{2202,6178},[]int{2490,6179},[]int{449,6180},[]int{1701,6181},[]int{4824,6182},[]int{1826,6183},[]int{3386,6184},[]int{1979,6185},[]int{4231,6186},[]int{771,6187},[]int{5110,6188},[]int{5449,6189},[]int{3833,6190},[]int{5881,6191},[]int{4592,6192},[]int{2672,6193},[]int{726,6194},[]int{4936,6195},[]int{3484,6196},[]int{3763,6197},[]int{4318,6198},[]int{1486,6199},[]int{489,6200},[]int{3890,6201},[]int{4124,6202},[]int{4551,6203},[]int{6157,6204},[]int{3227,6205},[]int{2379,6206},[]int{4969,6207},[]int{4424,6208},[]int{4264,6209},[]int{5644,6210},[]int{1120,6211},[]int{5574,6212},[]int{2477,6213},[]int{2734,6214},[]int{4909,6215},[]int{4602,6216},[]int{3979,6217},[]int{4429,6218},[]int{2997,6219},[]int{5196,6220},[]int{1989,6221},[]int{1518,6222},[]int{1081,6223},[]int{2949,6224},[]int{1023,6225},[]int{5022,6226},[]int{4162,6227},[]int{4234,6228},[]int{4743,6229},[]int{4686,6230},[]int{2696,6231},[]int{939,6232},[]int{1674,6233},[]int{999,6234},[]int{3260,6235},[]int{1927,6236},[]int{3695,6237},[]int{311,6238},[]int{1290,6239},[]int{2710,6240},[]int{794,6241},[]int{6125,6242},[]int{2995,6243},[]int{3850,6244},[]int{5337,6245},[]int{1924,6246},[]int{930,6247},[]int{2195,6248},[]int{3341,6249},[]int{3273,6250},[]int{1325,6251},[]int{346,6252},[]int{3976,6253},[]int{3651,6254},[]int{5813,6255},[]int{921,6256},[]int{1511,6257},[]int{5893,6258},[]int{297,6259},[]int{533,6260},[]int{5204,6261},[]int{3731,6262},[]int{2611,6263},[]int{801,6264},[]int{2762,6265},[]int{4830,6266},[]int{4308,6267},[]int{2959,6268},[]int{528,6269},[]int{5414,6270},[]int{5641,6271},[]int{5773,6272},[]int{2622,6273},[]int{395,6274},[]int{4044,6275},[]int{962,6276},[]int{489,6277},[]int{3420,6278},[]int{1980,6279},[]int{1986,6280},[]int{5910,6281},[]int{1264,6282},[]int{2609,6283},[]int{5624,6284},[]int{2180,6285},[]int{3968,6286},[]int{2337,6287},[]int{5024,6288},[]int{4794,6289},[]int{5759,6290},[]int{2203,6291},[]int{4286,6292},[]int{3168,6293},[]int{4216,6294},[]int{3219,6295},[]int{1566,6296},[]int{2661,6297},[]int{1059,6298},[]int{5808,6299},[]int{3329,6300},[]int{1538,6301},[]int{3997,6302},[]int{4300,6303},[]int{0,6304},[]int{3262,6305},[]int{4683,6306},[]int{4512,6307},[]int{2144,6308},[]int{5411,6309},[]int{1545,6310},[]int{1915,6311},[]int{5331,6312},[]int{1963,6313},[]int{3130,6314},[]int{8,6315},[]int{5623,6316},[]int{3896,6317},[]int{6208,6318},[]int{448,6319},[]int{1677,6320},[]int{3351,6321},[]int{2011,6322},[]int{1596,6323},[]int{440,6324},[]int{972,6325},[]int{38,6326},[]int{2529,6327},[]int{6071,6328},[]int{679,6329},[]int{1465,6330},[]int{3283,6331},[]int{5969,6332},[]int{1353,6333},[]int{3407,6334},[]int{310,6335},[]int{324,6336},[]int{2456,6337},[]int{71,6338},[]int{5342,6339},[]int{4690,6340},[]int{3700,6341},[]int{5619,6342},[]int{868,6343},[]int{4945,6344},[]int{3956,6345},[]int{5348,6346},[]int{3716,6347},[]int{4593,6348},[]int{2317,6349},[]int{2872,6350},[]int{2169,6351},[]int{3381,6352},[]int{6132,6353},[]int{5529,6354},[]int{3955,6355},[]int{4042,6356},[]int{4846,6357},[]int{1119,6358},[]int{4600,6359},[]int{4600,6360},[]int{4903,6361},[]int{2654,6362},[]int{5334,6363},[]int{2651,6364},[]int{3812,6365},[]int{3319,6366},[]int{225,6367},[]int{5933,6368},[]int{2625,6369},[]int{2906,6370},[]int{69,6371},[]int{5651,6372},[]int{140,6373},[]int{4097,6374},[]int{1144,6375},[]int{6209,6376},[]int{3432,6377},[]int{1144,6378},[]int{1629,6379},[]int{1232,6380},[]int{370,6381},[]int{5187,6382},[]int{4067,6383},[]int{2363,6384},[]int{4143,6385},[]int{5250,6386},[]int{1300,6387},[]int{1054,6388},[]int{4528,6389},[]int{3694,6390},[]int{1893,6391},[]int{2068,6392},[]int{1215,6393},[]int{1534,6394},[]int{5640,6395},[]int{3076,6396},[]int{142,6397},[]int{4099,6398},[]int{3151,6399},[]int{270,6400},[]int{680,6401},[]int{5533,6402},[]int{2653,6403},[]int{5679,6404},[]int{4408,6405},[]int{4806,6406},[]int{62,6407},[]int{6039,6408},[]int{5349,6409},[]int{5912,6410},[]int{6232,6411},[]int{3327,6412},[]int{4672,6413},[]int{2700,6414},[]int{480,6415},[]int{4388,6416},[]int{5214,6417},[]int{4509,6418},[]int{1304,6419},[]int{24,6420},[]int{4539,6421},[]int{59,6422},[]int{5386,6423},[]int{816,6424},[]int{1267,6425},[]int{699,6426},[]int{1524,6427},[]int{1186,6428},[]int{866,6429},[]int{4936,6430},[]int{1400,6431},[]int{5244,6432},[]int{3857,6433},[]int{2088,6434},[]int{5268,6435},[]int{1698,6436},[]int{6123,6437},[]int{3494,6438},[]int{2526,6439},[]int{54,6440},[]int{1423,6441},[]int{4820,6442},[]int{1560,6443},[]int{5038,6444},[]int{995,6445},[]int{2185,6446},[]int{6235,6447},[]int{2052,6448},[]int{6069,6449},[]int{6022,6450},[]int{2038,6451},[]int{2658,6452},[]int{1278,6453},[]int{5630,6454},[]int{262,6455},[]int{6215,6456},[]int{968,6457},[]int{5799,6458},[]int{5110,6459},[]int{3703,6460},[]int{2700,6461},[]int{501,6462},[]int{3087,6463},[]int{4491,6464},[]int{2959,6465},[]int{4163,6466},[]int{824,6467},[]int{6121,6468},[]int{5059,6469},[]int{2322,6470},[]int{2673,6471},[]int{755,6472},[]int{3021,6473},[]int{4115,6474},[]int{133,6475},[]int{6174,6476},[]int{890,6477},[]int{5367,6478},[]int{4355,6479},[]int{5695,6480},[]int{3804,6481},[]int{3971,6482},[]int{18,6483},[]int{309,6484},[]int{5822,6485},[]int{1631,6486},[]int{5480,6487},[]int{1943,6488},[]int{4818,6489},[]int{2401,6490},[]int{6137,6491},[]int{3990,6492},[]int{2609,6493},[]int{5545,6494},[]int{65,6495},[]int{4942,6496},[]int{2213,6497},[]int{5795,6498},[]int{729,6499},[]int{4626,6500},[]int{3636,6501},[]int{3733,6502},[]int{2504,6503},[]int{826,6504},[]int{2155,6505},[]int{45,6506},[]int{373,6507},[]int{1069,6508},[]int{2501,6509},[]int{218,6510},[]int{2282,6511},[]int{2200,6512},[]int{2386,6513},[]int{1257,6514},[]int{4902,6515},[]int{3402,6516},[]int{5004,6517},[]int{6094,6518},[]int{416,6519},[]int{3954,6520},[]int{6187,6521},[]int{4833,6522},[]int{2849,6523},[]int{4755,6524},[]int{3575,6525},[]int{719,6526},[]int{4182,6527},[]int{3674,6528},[]int{4526,6529},[]int{899,6530},[]int{6354,6531},[]int{2935,6532},[]int{5793,6533},[]int{686,6534},[]int{3436,6535},[]int{5486,6536},[]int{1103,6537},[]int{3917,6538},[]int{5672,6539},[]int{577,6540},[]int{2047,6541},[]int{4492,6542},[]int{4873,6543},[]int{852,6544},[]int{2511,6545},[]int{1780,6546},[]int{2516,6547},[]int{1724,6548},[]int{416,6549},[]int{3070,6550},[]int{5042,6551},[]int{3036,6552},[]int{629,6553},[]int{6009,6554},[]int{274,6555},[]int{2442,6556},[]int{1005,6557},[]int{1201,6558},[]int{4889,6559},[]int{1283,6560},[]int{2359,6561},[]int{161,6562},[]int{4536,6563},[]int{4495,6564},[]int{5997,6565},[]int{1366,6566},[]int{1056,6567},[]int{828,6568},[]int{615,6569},[]int{5820,6570},[]int{5776,6571},[]int{6473,6572},[]int{5909,6573},[]int{6119,6574},[]int{4516,6575},[]int{5670,6576},[]int{5155,6577},[]int{2124,6578},[]int{6100,6579},[]int{895,6580},[]int{2534,6581},[]int{2843,6582},[]int{2394,6583},[]int{3115,6584},[]int{512,6585},[]int{3435,6586},[]int{768,6587},[]int{3999,6588},[]int{2959,6589},[]int{5702,6590},[]int{783,6591},[]int{796,6592},[]int{212,6593},[]int{1728,6594},[]int{2513,6595},[]int{5942,6596},[]int{2991,6597},[]int{3182,6598},[]int{3883,6599},[]int{4239,6600},[]int{1225,6601},[]int{5489,6602},[]int{4983,6603},[]int{2177,6604},[]int{2539,6605},[]int{3317,6606},[]int{2631,6607},[]int{4003,6608},[]int{1640,6609},[]int{6259,6610},[]int{4032,6611},[]int{5719,6612},[]int{4453,6613},[]int{2574,6614},[]int{6481,6615},[]int{1464,6616},[]int{701,6617},[]int{207,6618},[]int{5278,6619},[]int{3963,6620},[]int{3800,6621},[]int{1887,6622},[]int{4541,6623},[]int{6490,6624},[]int{6582,6625},[]int{5888,6626},[]int{204,6627},[]int{1320,6628},[]int{3227,6629},[]int{2912,6630},[]int{6193,6631},[]int{5437,6632},[]int{6418,6633},[]int{1251,6634},[]int{5152,6635},[]int{4961,6636},[]int{525,6637},[]int{321,6638},[]int{3759,6639},[]int{2639,6640},[]int{3919,6641},[]int{1345,6642},[]int{3293,6643},[]int{6640,6644},[]int{5765,6645},[]int{3054,6646},[]int{2723,6647},[]int{3378,6648},[]int{5383,6649},[]int{5001,6650},[]int{918,6651},[]int{5721,6652},[]int{5124,6653},[]int{6367,6654},[]int{2697,6655},[]int{3953,6656},[]int{6073,6657},[]int{5134,6658},[]int{2419,6659},[]int{4945,6660},[]int{5851,6661},[]int{1913,6662},[]int{6596,6663},[]int{4767,6664},[]int{893,6665},[]int{5786,6666},[]int{6208,6667},[]int{5497,6668},[]int{1935,6669},[]int{5027,6670},[]int{3705,6671},[]int{6477,6672},[]int{6538,6673},[]int{752,6674},[]int{4980,6675},[]int{655,6676},[]int{4045,6677},[]int{6351,6678},[]int{4794,6679},[]int{683,6680},[]int{4350,6681},[]int{3930,6682},[]int{2601,6683},[]int{2312,6684},[]int{2504,6685},[]int{101,6686},[]int{1951,6687},[]int{5748,6688},[]int{1644,6689},[]int{5738,6690},[]int{1161,6691},[]int{1086,6692},[]int{2440,6693},[]int{560,6694},[]int{177,6695},[]int{812,6696},[]int{6441,6697},[]int{1385,6698},[]int{1901,6699},[]int{577,6700},[]int{4438,6701},[]int{490,6702},[]int{3243,6703},[]int{3106,6704},[]int{4138,6705},[]int{338,6706},[]int{3078,6707},[]int{3638,6708},[]int{866,6709},[]int{1962,6710},[]int{3713,6711},[]int{688,6712},[]int{185,6713},[]int{3174,6714},[]int{4201,6715},[]int{854,6716},[]int{5556,6717},[]int{3921,6718},[]int{5618,6719},[]int{5048,6720},[]int{2439,6721},[]int{4317,6722},[]int{4818,6723},[]int{1350,6724},[]int{845,6725},[]int{4620,6726},[]int{2768,6727},[]int{1886,6728},[]int{5278,6729},[]int{3586,6730},[]int{1724,6731},[]int{1642,6732},[]int{5932,6733},[]int{4811,6734},[]int{5326,6735},[]int{1714,6736},[]int{6343,6737},[]int{5764,6738},[]int{6478,6739},[]int{807,6740},[]int{4735,6741},[]int{6717,6742},[]int{4733,6743},[]int{6733,6744},[]int{5184,6745},[]int{3569,6746},[]int{6398,6747},[]int{6090,6748},[]int{886,6749},[]int{2566,6750},[]int{4162,6751},[]int{2736,6752},[]int{3568,6753},[]int{3702,6754},[]int{2924,6755},[]int{3084,6756},[]int{5545,6757},[]int{2026,6758},[]int{2390,6759},[]int{3466,6760},[]int{4836,6761},[]int{2737,6762},[]int{1625,6763},[]int{5635,6764},[]int{3658,6765},[]int{420,6766},[]int{4841,6767},[]int{833,6768},[]int{2138,6769},[]int{4804,6770},[]int{5283,6771},[]int{5825,6772},[]int{4582,6773},[]int{1124,6774},[]int{1418,6775},[]int{4109,6776},[]int{2358,6777},[]int{3801,6778},[]int{4236,6779},[]int{1397,6780},[]int{1272,6781},[]int{2769,6782},[]int{2519,6783},[]int{1617,6784},[]int{972,6785},[]int{1195,6786},[]int{2533,6787},[]int{162,6788},[]int{5917,6789},[]int{344,6790},[]int{4655,6791},[]int{4555,6792},[]int{4331,6793},[]int{1379,6794},[]int{4156,6795},[]int{3235,6796},[]int{5594,6797},[]int{2884,6798},[]int{4287,6799},[]int{6450,6800},[]int{4026,6801},[]int{3988,6802},[]int{3812,6803},[]int{3884,6804},[]int{2470,6805},[]int{5668,6806},[]int{2831,6807},[]int{4173,6808},[]int{1094,6809},[]int{192,6810},[]int{1771,6811},[]int{1157,6812},[]int{3359,6813},[]int{5355,6814},[]int{161,6815},[]int{1999,6816},[]int{4808,6817},[]int{6506,6818},[]int{977,6819},[]int{5380,6820},[]int{1798,6821},[]int{5983,6822},[]int{6462,6823},[]int{5055,6824},[]int{4857,6825},[]int{2436,6826},[]int{1950,6827},[]int{233,6828},[]int{1468,6829},[]int{6153,6830},[]int{4223,6831},[]int{649,6832},[]int{6245,6833},[]int{3663,6834},[]int{4164,6835},[]int{2572,6836},[]int{2546,6837},[]int{6726,6838},[]int{4670,6839},[]int{6680,6840},[]int{725,6841},[]int{3691,6842},[]int{6193,6843},[]int{5596,6844},[]int{4126,6845},[]int{3583,6846},[]int{4014,6847},[]int{1822,6848},[]int{5470,6849},[]int{6636,6850},[]int{4217,6851},[]int{1172,6852},[]int{4576,6853},[]int{942,6854},[]int{1626,6855},[]int{2423,6856},[]int{302,6857},[]int{1243,6858},[]int{4269,6859},[]int{5282,6860},[]int{4973,6861},[]int{6377,6862},[]int{314,6863},[]int{2380,6864},[]int{2384,6865},[]int{6297,6866},[]int{2104,6867},[]int{5677,6868},[]int{6740,6869},[]int{2076,6870},[]int{673,6871},[]int{1651,6872},[]int{4017,6873},[]int{5808,6874},[]int{5562,6875},[]int{3553,6876},[]int{2720,6877},[]int{3817,6878},[]int{789,6879},[]int{3281,6880},[]int{5989,6881},[]int{707,6882},[]int{4869,6883},[]int{1355,6884},[]int{337,6885},[]int{1266,6886},[]int{2645,6887},[]int{1202,6888},[]int{6314,6889},[]int{4391,6890},[]int{542,6891},[]int{1331,6892},[]int{5384,6893},[]int{3556,6894},[]int{3965,6895},[]int{365,6896},[]int{980,6897},[]int{435,6898},[]int{3139,6899},[]int{2304,6900},[]int{3477,6901},[]int{2922,6902},[]int{286,6903},[]int{410,6904},[]int{767,6905},[]int{185,6906},[]int{4970,6907},[]int{6092,6908},[]int{6146,6909},[]int{3148,6910},[]int{5444,6911},[]int{5629,6912},[]int{1063,6913},[]int{1029,6914},[]int{6359,6915},[]int{4102,6916},[]int{3484,6917},[]int{6912,6918},[]int{2516,6919},[]int{714,6920},[]int{6375,6921},[]int{2154,6922},[]int{548,6923},[]int{4277,6924},[]int{2294,6925},[]int{1862,6926},[]int{3403,6927},[]int{880,6928},[]int{3893,6929},[]int{5447,6930},[]int{6912,6931},[]int{4812,6932},[]int{3755,6933},[]int{6104,6934},[]int{2096,6935},[]int{2825,6936},[]int{3385,6937},[]int{5936,6938},[]int{626,6939},[]int{2933,6940},[]int{1435,6941},[]int{6003,6942},[]int{4164,6943},[]int{373,6944},[]int{2053,6945},[]int{194,6946},[]int{611,6947},[]int{1104,6948},[]int{2976,6949},[]int{1495,6950},[]int{4622,6951},[]int{4876,6952},[]int{2526,6953},[]int{6116,6954},[]int{3456,6955},[]int{4106,6956},[]int{660,6957},[]int{3708,6958},[]int{4166,6959},[]int{6075,6960},[]int{3806,6961},[]int{1733,6962},[]int{1287,6963},[]int{2080,6964},[]int{4892,6965},[]int{5008,6966},[]int{1596,6967},[]int{4347,6968},[]int{5923,6969},[]int{2261,6970},[]int{4414,6971},[]int{5892,6972},[]int{6652,6973},[]int{1687,6974},[]int{3840,6975},[]int{3791,6976},[]int{1684,6977},[]int{3518,6978},[]int{1522,6979},[]int{568,6980},[]int{1040,6981},[]int{4225,6982},[]int{793,6983},[]int{5443,6984},[]int{2229,6985},[]int{24,6986},[]int{6005,6987},[]int{952,6988},[]int{5904,6989},[]int{3272,6990},[]int{6906,6991},[]int{3504,6992},[]int{764,6993},[]int{4639,6994},[]int{5457,6995},[]int{2150,6996},[]int{6979,6997},[]int{4398,6998},[]int{2340,6999},[]int{4884,7000},[]int{637,7001},[]int{1085,7002},[]int{3968,7003},[]int{6697,7004},[]int{1254,7005},[]int{4731,7006},[]int{4527,7007},[]int{4060,7008},[]int{5034,7009},[]int{605,7010},[]int{498,7011},[]int{1736,7012},[]int{3150,7013},[]int{6289,7014},[]int{6122,7015},[]int{780,7016},[]int{65,7017},[]int{3874,7018},[]int{35,7019},[]int{1934,7020},[]int{4063,7021},[]int{2011,7022},[]int{2365,7023},[]int{1843,7024},[]int{2519,7025},[]int{2950,7026},[]int{868,7027},[]int{561,7028},[]int{4462,7029},[]int{4735,7030},[]int{3827,7031},[]int{810,7032},[]int{4455,7033},[]int{80,7034},[]int{6257,7035},[]int{1345,7036},[]int{1441,7037},[]int{2991,7038},[]int{736,7039},[]int{3571,7040},[]int{902,7041},[]int{569,7042},[]int{5593,7043},[]int{5692,7044},[]int{5723,7045},[]int{4806,7046},[]int{4349,7047},[]int{6283,7048},[]int{35,7049},[]int{5824,7050},[]int{4235,7051},[]int{2092,7052},[]int{794,7053},[]int{6044,7054},[]int{5820,7055},[]int{410,7056},[]int{1257,7057},[]int{6256,7058},[]int{6477,7059},[]int{2550,7060},[]int{2561,7061},[]int{1795,7062},[]int{773,7063},[]int{3487,7064},[]int{2485,7065},[]int{3010,7066},[]int{1913,7067},[]int{3898,7068},[]int{6155,7069},[]int{4740,7070},[]int{1182,7071},[]int{5446,7072},[]int{6877,7073},[]int{1741,7074},[]int{6489,7075},[]int{4122,7076},[]int{6462,7077},[]int{635,7078},[]int{973,7079},[]int{6676,7080},[]int{2757,7081},[]int{3984,7082},[]int{6039,7083},[]int{3686,7084},[]int{3549,7085},[]int{6098,7086},[]int{3087,7087},[]int{4103,7088},[]int{3390,7089},[]int{1666,7090},[]int{3213,7091},[]int{5123,7092},[]int{977,7093},[]int{5743,7094},[]int{2859,7095},[]int{2912,7096},[]int{399,7097},[]int{4747,7098},[]int{488,7099},[]int{3834,7100},[]int{2482,7101},[]int{1256,7102},[]int{3180,7103},[]int{5450,7104},[]int{2576,7105},[]int{2575,7106},[]int{6949,7107},[]int{4212,7108},[]int{3508,7109},[]int{5001,7110},[]int{625,7111},[]int{954,7112},[]int{2695,7113},[]int{3438,7114},[]int{3854,7115},[]int{465,7116},[]int{5157,7117},[]int{2100,7118},[]int{342,7119},[]int{6542,7120},[]int{1377,7121},[]int{2722,7122},[]int{2801,7123},[]int{518,7124},[]int{4916,7125},[]int{764,7126},[]int{3520,7127},[]int{3856,7128},[]int{4961,7129},[]int{2431,7130},[]int{601,7131},[]int{852,7132},[]int{695,7133},[]int{2741,7134},[]int{4801,7135},[]int{1170,7136},[]int{5794,7137},[]int{1565,7138},[]int{6768,7139},[]int{5028,7140},[]int{5985,7141},[]int{4996,7142},[]int{3813,7143},[]int{6489,7144},[]int{1227,7145},[]int{1960,7146},[]int{670,7147},[]int{5155,7148},[]int{4493,7149},[]int{7026,7150},[]int{3846,7151},[]int{1508,7152},[]int{2514,7153},[]int{76,7154},[]int{806,7155},[]int{1986,7156},[]int{4359,7157},[]int{3419,7158},[]int{5776,7159},[]int{3292,7160},[]int{4818,7161},[]int{4489,7162},[]int{480,7163},[]int{5065,7164},[]int{2191,7165},[]int{4539,7166},[]int{7027,7167},[]int{5555,7168},[]int{1087,7169},[]int{4904,7170},[]int{2835,7171},[]int{356,7172},[]int{3984,7173},[]int{29,7174},[]int{1143,7175},[]int{5719,7176},[]int{3861,7177},[]int{2343,7178},[]int{1620,7179},[]int{6110,7180},[]int{4445,7181},[]int{469,7182},[]int{6543,7183},[]int{6877,7184},[]int{5920,7185},[]int{145,7186},[]int{6343,7187},[]int{2534,7188},[]int{1851,7189},[]int{133,7190},[]int{3208,7191},[]int{2896,7192},[]int{2315,7193},[]int{175,7194},[]int{3482,7195},[]int{4883,7196},[]int{5491,7197},[]int{466,7198},[]int{6030,7199},[]int{6369,7200},[]int{1448,7201},[]int{5615,7202},[]int{5668,7203},[]int{871,7204},[]int{258,7205},[]int{7205,7206},[]int{5006,7207},[]int{2062,7208},[]int{636,7209},[]int{3109,7210},[]int{5314,7211},[]int{3249,7212},[]int{5440,7213},[]int{4632,7214},[]int{2665,7215},[]int{173,7216},[]int{3764,7217},[]int{3867,7218},[]int{1376,7219},[]int{3105,7220},[]int{3495,7221},[]int{1549,7222},[]int{5793,7223},[]int{3623,7224},[]int{5480,7225},[]int{2495,7226},[]int{3730,7227},[]int{1371,7228},[]int{2929,7229},[]int{4903,7230},[]int{3423,7231},[]int{3664,7232},[]int{1140,7233},[]int{1574,7234},[]int{4204,7235},[]int{5105,7236},[]int{980,7237},[]int{6037,7238},[]int{1551,7239},[]int{4683,7240},[]int{4579,7241},[]int{6104,7242},[]int{1185,7243},[]int{3484,7244},[]int{818,7245},[]int{1246,7246},[]int{748,7247},[]int{167,7248},[]int{393,7249},[]int{1452,7250},[]int{6845,7251},[]int{1000,7252},[]int{7156,7253},[]int{45,7254},[]int{1358,7255},[]int{1646,7256},[]int{114,7257},[]int{3087,7258},[]int{3058,7259},[]int{6794,7260},[]int{4231,7261},[]int{2974,7262},[]int{3903,7263},[]int{1139,7264},[]int{1064,7265},[]int{924,7266},[]int{623,7267},[]int{2627,7268},[]int{5841,7269},[]int{6090,7270},[]int{419,7271},[]int{1793,7272},[]int{6138,7273},[]int{5560,7274},[]int{1276,7275},[]int{171,7276},[]int{7000,7277},[]int{940,7278},[]int{5656,7279},[]int{2800,7280},[]int{3190,7281},[]int{6156,7282},[]int{5745,7283},[]int{392,7284},[]int{5194,7285},[]int{934,7286},[]int{581,7287},[]int{6737,7288},[]int{152,7289},[]int{5139,7290},[]int{6199,7291},[]int{255,7292},[]int{4115,7293},[]int{4878,7294},[]int{2659,7295},[]int{318,7296},[]int{7223,7297},[]int{7257,7298},[]int{6465,7299},[]int{4547,7300},[]int{2389,7301},[]int{6325,7302},[]int{1135,7303},[]int{3917,7304},[]int{5095,7305},[]int{4145,7306},[]int{6762,7307},[]int{2679,7308},[]int{1559,7309},[]int{1728,7310},[]int{487,7311},[]int{924,7312},[]int{5457,7313},[]int{6267,7314},[]int{611,7315},[]int{5718,7316},[]int{1272,7317},[]int{1239,7318},[]int{6825,7319},[]int{2451,7320},[]int{3234,7321},[]int{571,7322},[]int{5088,7323},[]int{5814,7324},[]int{1248,7325},[]int{6770,7326},[]int{4978,7327},[]int{3847,7328},[]int{6354,7329},[]int{89,7330},[]int{4440,7331},[]int{3555,7332},[]int{775,7333},[]int{3138,7334},[]int{811,7335},[]int{4899,7336},[]int{3511,7337},[]int{3888,7338},[]int{7289,7339},[]int{3782,7340},[]int{6063,7341},[]int{7323,7342},[]int{3034,7343},[]int{5662,7344},[]int{6478,7345},[]int{2039,7346},[]int{6949,7347},[]int{3256,7348},[]int{5652,7349},[]int{5710,7350},[]int{411,7351},[]int{4169,7352},[]int{5780,7353},[]int{6672,7354},[]int{7351,7355},[]int{3503,7356},[]int{6883,7357},[]int{7326,7358},[]int{1928,7359},[]int{800,7360},[]int{7307,7361},[]int{3291,7362},[]int{4165,7363},[]int{5089,7364},[]int{5669,7365},[]int{1716,7366},[]int{5488,7367},[]int{5470,7368},[]int{3780,7369},[]int{5725,7370},[]int{1045,7371},[]int{6174,7372},[]int{2942,7373},[]int{674,7374},[]int{5921,7375},[]int{6811,7376},[]int{462,7377},[]int{3642,7378},[]int{4537,7379},[]int{7340,7380},[]int{3660,7381},[]int{1727,7382},[]int{2992,7383},[]int{6847,7384},[]int{4017,7385},[]int{6926,7386},[]int{4644,7387},[]int{3374,7388},[]int{6837,7389},[]int{1603,7390},[]int{1634,7391},[]int{5149,7392},[]int{7072,7393},[]int{725,7394},[]int{4872,7395},[]int{119,7396},[]int{5193,7397},[]int{6266,7398},[]int{4066,7399},[]int{5891,7400},[]int{7055,7401},[]int{606,7402},[]int{3096,7403},[]int{6630,7404},[]int{4418,7405},[]int{7052,7406},[]int{2472,7407},[]int{7078,7408},[]int{1576,7409},[]int{4855,7410},[]int{1270,7411},[]int{1957,7412},[]int{5014,7413},[]int{3009,7414},[]int{532,7415},[]int{2032,7416},[]int{6797,7417},[]int{957,7418},[]int{5178,7419},[]int{299,7420},[]int{2328,7421},[]int{899,7422},[]int{1659,7423},[]int{4244,7424},[]int{4844,7425},[]int{6192,7426},[]int{3651,7427},[]int{3896,7428},[]int{400,7429},[]int{6928,7430},[]int{666,7431},[]int{4790,7432},[]int{516,7433},[]int{4753,7434},[]int{1330,7435},[]int{3290,7436},[]int{2519,7437},[]int{794,7438},[]int{5861,7439},[]int{4788,7440},[]int{3596,7441},[]int{4532,7442},[]int{6915,7443},[]int{1971,7444},[]int{5134,7445},[]int{970,7446},[]int{5530,7447},[]int{369,7448},[]int{2437,7449},[]int{6703,7450},[]int{2464,7451},[]int{3927,7452},[]int{2941,7453},[]int{2338,7454},[]int{3353,7455},[]int{1783,7456},[]int{126,7457},[]int{6693,7458},[]int{110,7459},[]int{3005,7460},[]int{7224,7461},[]int{1728,7462},[]int{4042,7463},[]int{6842,7464},[]int{4937,7465},[]int{1744,7466},[]int{3333,7467},[]int{5190,7468},[]int{5218,7469},[]int{7208,7470},[]int{711,7471},[]int{6169,7472},[]int{1039,7473},[]int{3473,7474},[]int{6572,7475},[]int{7307,7476},[]int{3689,7477},[]int{1191,7478},[]int{5450,7479},[]int{2814,7480},[]int{2057,7481},[]int{1306,7482},[]int{1539,7483},[]int{2917,7484},[]int{4182,7485},[]int{1343,7486},[]int{2598,7487},[]int{2490,7488},[]int{7097,7489},[]int{3069,7490},[]int{6338,7491},[]int{7488,7492},[]int{3560,7493},[]int{2333,7494},[]int{3998,7495},[]int{2820,7496},[]int{1723,7497},[]int{6499,7498},[]int{4828,7499},[]int{1178,7500},[]int{1333,7501},[]int{141,7502},[]int{472,7503},[]int{2329,7504},[]int{2181,7505},[]int{5930,7506},[]int{626,7507},[]int{1731,7508},[]int{1101,7509},[]int{3197,7510},[]int{4020,7511},[]int{2138,7512},[]int{1587,7513},[]int{2607,7514},[]int{6042,7515},[]int{1769,7516},[]int{591,7517},[]int{4797,7518},[]int{1696,7519},[]int{1011,7520},[]int{4331,7521},[]int{7355,7522},[]int{2197,7523},[]int{3323,7524},[]int{5769,7525},[]int{6257,7526},[]int{3192,7527},[]int{3559,7528},[]int{2419,7529},[]int{4645,7530},[]int{1758,7531},[]int{1431,7532},[]int{3449,7533},[]int{5341,7534},[]int{5480,7535},[]int{6343,7536},[]int{3222,7537},[]int{6993,7538},[]int{5514,7539},[]int{3073,7540},[]int{7064,7541},[]int{6456,7542},[]int{2801,7543},[]int{898,7544},[]int{937,7545},[]int{5036,7546},[]int{6003,7547},[]int{5727,7548},[]int{4381,7549},[]int{800,7550},[]int{4722,7551},[]int{7092,7552},[]int{816,7553},[]int{1643,7554},[]int{6594,7555},[]int{6512,7556},[]int{5307,7557},[]int{6201,7558},[]int{2099,7559},[]int{5521,7560},[]int{129,7561},[]int{5334,7562},[]int{534,7563},[]int{4187,7564},[]int{6983,7565},[]int{5822,7566},[]int{4231,7567},[]int{5016,7568},[]int{4186,7569},[]int{6317,7570},[]int{1145,7571},[]int{1140,7572},[]int{5797,7573},[]int{1525,7574},[]int{2553,7575},[]int{5794,7576},[]int{2314,7577},[]int{2401,7578},[]int{2718,7579},[]int{659,7580},[]int{5512,7581},[]int{40,7582},[]int{1034,7583},[]int{2449,7584},[]int{2360,7585},[]int{4388,7586},[]int{6251,7587},[]int{29,7588},[]int{6550,7589},[]int{3936,7590},[]int{358,7591},[]int{7260,7592},[]int{465,7593},[]int{7346,7594},[]int{1728,7595},[]int{5608,7596},[]int{3642,7597},[]int{1568,7598},[]int{1916,7599},[]int{4431,7600},[]int{2967,7601},[]int{4886,7602},[]int{2164,7603},[]int{3784,7604},[]int{1989,7605},[]int{1493,7606},[]int{5430,7607},[]int{2549,7608},[]int{6356,7609},[]int{5876,7610},[]int{2326,7611},[]int{7325,7612},[]int{6906,7613},[]int{5023,7614},[]int{4287,7615},[]int{7392,7616},[]int{5279,7617},[]int{3092,7618},[]int{3648,7619},[]int{5677,7620},[]int{4278,7621},[]int{6518,7622},[]int{5604,7623},[]int{3428,7624},[]int{3567,7625},[]int{6719,7626},[]int{4323,7627},[]int{4117,7628},[]int{761,7629},[]int{3233,7630},[]int{6654,7631},[]int{1921,7632},[]int{2730,7633},[]int{1606,7634},[]int{2280,7635},[]int{6013,7636},[]int{3565,7637},[]int{433,7638},[]int{7219,7639},[]int{3664,7640},[]int{841,7641},[]int{2775,7642},[]int{5178,7643},[]int{7574,7644},[]int{6165,7645},[]int{4491,7646},[]int{5940,7647},[]int{4659,7648},[]int{98,7649},[]int{6061,7650},[]int{2900,7651},[]int{4760,7652},[]int{3946,7653},[]int{1146,7654},[]int{276,7655},[]int{6230,7656},[]int{383,7657},[]int{7309,7658},[]int{619,7659},[]int{7594,7660},[]int{3046,7661},[]int{5872,7662},[]int{5301,7663},[]int{3954,7664},[]int{6633,7665},[]int{5505,7666},[]int{133,7667},[]int{4299,7668},[]int{6795,7669},[]int{2782,7670},[]int{6972,7671},[]int{2414,7672},[]int{799,7673},[]int{4020,7674},[]int{7569,7675},[]int{412,7676},[]int{2462,7677},[]int{1016,7678},[]int{5495,7679},[]int{6302,7680},[]int{7077,7681},[]int{3103,7682},[]int{3411,7683},[]int{2099,7684},[]int{6592,7685},[]int{5420,7686},[]int{1156,7687},[]int{7670,7688},[]int{6728,7689},[]int{6017,7690},[]int{3664,7691},[]int{7095,7692},[]int{4883,7693},[]int{7633,7694},[]int{822,7695},[]int{6101,7696},[]int{2278,7697},[]int{7451,7698},[]int{7006,7699},[]int{142,7700},[]int{5704,7701},[]int{4513,7702},[]int{2485,7703},[]int{6005,7704},[]int{5496,7705},[]int{6322,7706},[]int{1446,7707},[]int{2561,7708},[]int{7375,7709},[]int{1397,7710},[]int{5656,7711},[]int{6038,7712},[]int{385,7713},[]int{5023,7714},[]int{6482,7715},[]int{1592,7716},[]int{6554,7717},[]int{1830,7718},[]int{3703,7719},[]int{1648,7720},[]int{7313,7721},[]int{1219,7722},[]int{7182,7723},[]int{5421,7724},[]int{5424,7725},[]int{1745,7726},[]int{3268,7727},[]int{2560,7728},[]int{2585,7729},[]int{959,7730},[]int{2873,7731},[]int{1651,7732},[]int{2937,7733},[]int{4677,7734},[]int{2620,7735},[]int{5918,7736},[]int{194,7737},[]int{2123,7738},[]int{5505,7739},[]int{1100,7740},[]int{295,7741},[]int{7670,7742},[]int{5043,7743},[]int{1103,7744},[]int{6884,7745},[]int{2451,7746},[]int{4013,7747},[]int{6289,7748},[]int{1830,7749},[]int{616,7750},[]int{3758,7751},[]int{4791,7752},[]int{432,7753},[]int{7491,7754},[]int{5462,7755},[]int{3870,7756},[]int{3540,7757},[]int{7565,7758},[]int{1164,7759},[]int{308,7760},[]int{875,7761},[]int{883,7762},[]int{5955,7763},[]int{5105,7764},[]int{1924,7765},[]int{6320,7766},[]int{6076,7767},[]int{96,7768},[]int{5295,7769},[]int{4993,7770},[]int{109,7771},[]int{3889,7772},[]int{3964,7773},[]int{5996,7774},[]int{2083,7775},[]int{5373,7776},[]int{214,7777},[]int{6179,7778},[]int{6082,7779},[]int{6225,7780},[]int{6267,7781},[]int{3148,7782},[]int{4285,7783},[]int{736,7784},[]int{461,7785},[]int{5195,7786},[]int{702,7787},[]int{4008,7788},[]int{5230,7789},[]int{6599,7790},[]int{966,7791},[]int{3800,7792},[]int{485,7793},[]int{6245,7794},[]int{4507,7795},[]int{4735,7796},[]int{2270,7797},[]int{4873,7798},[]int{7202,7799},[]int{5381,7800},[]int{3474,7801},[]int{6195,7802},[]int{77,7803},[]int{2897,7804},[]int{6048,7805},[]int{4705,7806},[]int{133,7807},[]int{5459,7808},[]int{1575,7809},[]int{3019,7810},[]int{5609,7811},[]int{6456,7812},[]int{7671,7813},[]int{1285,7814},[]int{304,7815},[]int{5134,7816},[]int{6711,7817},[]int{165,7818},[]int{5715,7819},[]int{4006,7820},[]int{785,7821},[]int{3980,7822},[]int{4222,7823},[]int{3918,7824},[]int{1480,7825},[]int{7267,7826},[]int{492,7827},[]int{4564,7828},[]int{2100,7829},[]int{71,7830},[]int{2896,7831},[]int{6250,7832},[]int{6369,7833},[]int{2788,7834},[]int{327,7835},[]int{5790,7836},[]int{6661,7837},[]int{6287,7838},[]int{4532,7839},[]int{4966,7840},[]int{2834,7841},[]int{2393,7842},[]int{4268,7843},[]int{5178,7844},[]int{1612,7845},[]int{5405,7846},[]int{2883,7847},[]int{6567,7848},[]int{3415,7849},[]int{480,7850},[]int{558,7851},[]int{3164,7852},[]int{6001,7853},[]int{5422,7854},[]int{2514,7855},[]int{3242,7856},[]int{1709,7857},[]int{5511,7858},[]int{1680,7859},[]int{3277,7860},[]int{7732,7861},[]int{796,7862},[]int{7320,7863},[]int{474,7864},[]int{2304,7865},[]int{7076,7866},[]int{6671,7867},[]int{2866,7868},[]int{6560,7869},[]int{1546,7870},[]int{239,7871},[]int{4490,7872},[]int{3616,7873},[]int{4800,7874},[]int{3830,7875},[]int{659,7876},[]int{6814,7877},[]int{303,7878},[]int{4880,7879},[]int{6196,7880},[]int{1180,7881},[]int{7800,7882},[]int{4809,7883},[]int{7238,7884},[]int{5552,7885},[]int{2283,7886},[]int{2375,7887},[]int{2802,7888},[]int{6735,7889},[]int{6094,7890},[]int{3886,7891},[]int{2887,7892},[]int{1409,7893},[]int{893,7894},[]int{4857,7895},[]int{763,7896},[]int{3343,7897},[]int{5304,7898},[]int{1602,7899},[]int{1188,7900},[]int{4376,7901},[]int{5260,7902},[]int{7452,7903},[]int{2802,7904},[]int{7692,7905},[]int{5157,7906},[]int{7751,7907},[]int{5099,7908},[]int{5806,7909},[]int{5652,7910},[]int{7265,7911},[]int{3012,7912},[]int{2036,7913},[]int{6638,7914},[]int{1237,7915},[]int{3809,7916},[]int{5991,7917},[]int{2491,7918},[]int{4730,7919},[]int{5944,7920},[]int{170,7921},[]int{3118,7922},[]int{4455,7923},[]int{2651,7924},[]int{862,7925},[]int{1264,7926},[]int{2888,7927},[]int{2534,7928},[]int{182,7929},[]int{4054,7930},[]int{7419,7931},[]int{7671,7932},[]int{4547,7933},[]int{7809,7934},[]int{6316,7935},[]int{1491,7936},[]int{1940,7937},[]int{2806,7938},[]int{385,7939},[]int{7819,7940},[]int{6248,7941},[]int{3277,7942},[]int{4421,7943},[]int{7633,7944},[]int{1660,7945},[]int{7695,7946},[]int{7431,7947},[]int{3663,7948},[]int{5744,7949},[]int{7056,7950},[]int{2419,7951},[]int{7760,7952},[]int{7195,7953},[]int{4981,7954},[]int{6333,7955},[]int{5423,7956},[]int{5437,7957},[]int{2590,7958},[]int{5168,7959},[]int{3786,7960},[]int{642,7961},[]int{1792,7962},[]int{6233,7963},[]int{6058,7964},[]int{389,7965},[]int{4940,7966},[]int{4938,7967},[]int{5696,7968},[]int{1156,7969},[]int{62,7970},[]int{1632,7971},[]int{4270,7972},[]int{2615,7973},[]int{5097,7974},[]int{4220,7975},[]int{2936,7976},[]int{190,7977},[]int{4782,7978},[]int{1073,7979},[]int{5870,7980},[]int{1361,7981},[]int{6655,7982},[]int{1942,7983},[]int{4544,7984},[]int{5268,7985},[]int{4089,7986},[]int{1586,7987},[]int{6841,7988},[]int{6671,7989},[]int{735,7990},[]int{6675,7991},[]int{7673,7992},[]int{2703,7993},[]int{339,7994},[]int{7929,7995},[]int{2942,7996},[]int{3971,7997},[]int{3636,7998},[]int{6523,7999},[]int{4494,8000},[]int{3031,8001},[]int{1956,8002},[]int{5937,8003},[]int{5008,8004},[]int{4457,8005},[]int{1380,8006},[]int{6854,8007},[]int{4532,8008},[]int{955,8009},[]int{6754,8010},[]int{5980,8011},[]int{5332,8012},[]int{7159,8013},[]int{1650,8014},[]int{1699,8015},[]int{2282,8016},[]int{3341,8017},[]int{834,8018},[]int{2944,8019},[]int{2428,8020},[]int{5703,8021},[]int{2891,8022},[]int{4779,8023},[]int{5296,8024},[]int{3353,8025},[]int{2837,8026},[]int{1520,8027},[]int{5224,8028},[]int{2267,8029},[]int{5039,8030},[]int{3053,8031},[]int{5041,8032},[]int{510,8033},[]int{2496,8034},[]int{1582,8035},[]int{7661,8036},[]int{4581,8037},[]int{5537,8038},[]int{6183,8039},[]int{5306,8040},[]int{2990,8041},[]int{2541,8042},[]int{3952,8043},[]int{7287,8044},[]int{5088,8045},[]int{5560,8046},[]int{3664,8047},[]int{802,8048},[]int{6093,8049},[]int{6330,8050},[]int{4298,8051},[]int{6992,8052},[]int{7298,8053},[]int{4057,8054},[]int{4921,8055},[]int{7426,8056},[]int{4101,8057},[]int{3739,8058},[]int{5699,8059},[]int{3669,8060},[]int{1087,8061},[]int{4241,8062},[]int{4399,8063},[]int{3996,8064},[]int{7634,8065},[]int{1361,8066},[]int{1750,8067},[]int{6041,8068},[]int{578,8069},[]int{5621,8070},[]int{3294,8071},[]int{1622,8072},[]int{679,8073},[]int{260,8074},[]int{6817,8075},[]int{5895,8076},[]int{3357,8077},[]int{5858,8078},[]int{537,8079},[]int{2990,8080},[]int{2075,8081},[]int{4724,8082},[]int{1359,8083},[]int{6661,8084},[]int{3883,8085},[]int{3815,8086},[]int{1024,8087},[]int{2316,8088},[]int{4961,8089},[]int{2458,8090},[]int{5912,8091},[]int{1595,8092},[]int{5943,8093},[]int{7853,8094},[]int{2733,8095},[]int{7781,8096},[]int{6199,8097},[]int{3500,8098},[]int{4829,8099},[]int{5776,8100},[]int{7357,8101},[]int{739,8102},[]int{1852,8103},[]int{4035,8104},[]int{1676,8105},[]int{7217,8106},[]int{3980,8107},[]int{5138,8108},[]int{498,8109},[]int{6859,8110},[]int{3390,8111},[]int{7776,8112},[]int{4110,8113},[]int{1794,8114},[]int{6736,8115},[]int{4476,8116},[]int{1835,8117},[]int{2596,8118},[]int{3751,8119},[]int{5050,8120},[]int{5660,8121},[]int{5850,8122},[]int{6304,8123},[]int{7604,8124},[]int{4636,8125},[]int{1821,8126},[]int{4718,8127},[]int{5213,8128},[]int{2421,8129},[]int{1041,8130},[]int{176,8131},[]int{4903,8132},[]int{8063,8133},[]int{34,8134},[]int{6741,8135},[]int{7759,8136},[]int{7742,8137},[]int{4363,8138},[]int{4483,8139},[]int{1485,8140},[]int{4625,8141},[]int{2188,8142},[]int{2829,8143},[]int{7228,8144},[]int{4449,8145},[]int{7490,8146},[]int{2155,8147},[]int{6376,8148},[]int{4459,8149},[]int{6734,8150},[]int{7406,8151},[]int{5703,8152},[]int{6729,8153},[]int{593,8154},[]int{5499,8155},[]int{5515,8156},[]int{3530,8157},[]int{6182,8158},[]int{5659,8159},[]int{4059,8160},[]int{3616,8161},[]int{2414,8162},[]int{3384,8163},[]int{1180,8164},[]int{2454,8165},[]int{4534,8166},[]int{5670,8167},[]int{35,8168},[]int{970,8169},[]int{6024,8170},[]int{5923,8171},[]int{4849,8172},[]int{6104,8173},[]int{6399,8174},[]int{1484,8175},[]int{1176,8176},[]int{5786,8177},[]int{3844,8178},[]int{4065,8179},[]int{7048,8180},[]int{1732,8181},[]int{7459,8182},[]int{853,8183},[]int{2001,8184},[]int{7582,8185},[]int{7982,8186},[]int{5794,8187},[]int{2968,8188},[]int{3246,8189},[]int{6333,8190},[]int{3001,8191},[]int{930,8192},[]int{1568,8193},[]int{2799,8194},[]int{3514,8195},[]int{353,8196},[]int{1790,8197},[]int{4364,8198},[]int{4757,8199},[]int{5854,8200},[]int{366,8201},[]int{7681,8202},[]int{5488,8203},[]int{8121,8204},[]int{1501,8205},[]int{6755,8206},[]int{76,8207},[]int{3061,8208},[]int{2768,8209},[]int{2876,8210},[]int{7108,8211},[]int{5966,8212},[]int{5241,8213},[]int{2406,8214},[]int{7974,8215},[]int{4625,8216},[]int{7659,8217},[]int{4813,8218},[]int{5785,8219},[]int{3876,8220},[]int{5893,8221},[]int{1678,8222},[]int{4067,8223},[]int{4692,8224},[]int{2754,8225},[]int{2206,8226},[]int{3541,8227},[]int{669,8228},[]int{3822,8229},[]int{4831,8230},[]int{7057,8231},[]int{6994,8232},[]int{5303,8233},[]int{2205,8234},[]int{1697,8235},[]int{6497,8236},[]int{5540,8237},[]int{7563,8238},[]int{3496,8239},[]int{2666,8240},[]int{7634,8241},[]int{5643,8242},[]int{5353,8243},[]int{7093,8244},[]int{4004,8245},[]int{4211,8246},[]int{3788,8247},[]int{5198,8248},[]int{7358,8249},[]int{4886,8250},[]int{7702,8251},[]int{4417,8252},[]int{990,8253},[]int{7262,8254},[]int{3865,8255},[]int{3511,8256},[]int{3520,8257},[]int{6566,8258},[]int{8067,8259},[]int{7576,8260},[]int{7917,8261},[]int{6018,8262},[]int{1931,8263},[]int{7171,8264},[]int{1696,8265},[]int{3264,8266},[]int{3822,8267},[]int{885,8268},[]int{4416,8269},[]int{5026,8270},[]int{2667,8271},[]int{5769,8272},[]int{2464,8273},[]int{255,8274},[]int{3158,8275},[]int{5733,8276},[]int{6422,8277},[]int{4559,8278},[]int{4609,8279},[]int{1946,8280},[]int{1759,8281},[]int{4361,8282},[]int{7194,8283},[]int{1589,8284},[]int{5792,8285},[]int{241,8286},[]int{4698,8287},[]int{879,8288},[]int{5507,8289},[]int{2201,8290},[]int{5931,8291},[]int{7671,8292},[]int{8076,8293},[]int{62,8294},[]int{8256,8295},[]int{2335,8296},[]int{4118,8297},[]int{2034,8298},[]int{5475,8299},[]int{645,8300},[]int{3164,8301},[]int{1875,8302},[]int{7826,8303},[]int{2455,8304},[]int{2889,8305},[]int{462,8306},[]int{7212,8307},[]int{1607,8308},[]int{5012,8309},[]int{680,8310},[]int{3646,8311},[]int{7585,8312},[]int{732,8313},[]int{6370,8314},[]int{12,8315},[]int{4375,8316},[]int{7961,8317},[]int{5971,8318},[]int{2777,8319},[]int{8080,8320},[]int{3647,8321},[]int{973,8322},[]int{5401,8323},[]int{7084,8324},[]int{4089,8325},[]int{2231,8326},[]int{1281,8327},[]int{1704,8328},[]int{7788,8329},[]int{8105,8330},[]int{7030,8331},[]int{6753,8332},[]int{7444,8333},[]int{272,8334},[]int{3001,8335},[]int{3976,8336},[]int{3618,8337},[]int{7096,8338},[]int{6222,8339},[]int{4149,8340},[]int{7333,8341},[]int{7879,8342},[]int{18,8343},[]int{2209,8344},[]int{6170,8345},[]int{57,8346},[]int{5452,8347},[]int{7719,8348},[]int{608,8349},[]int{3292,8350},[]int{6714,8351},[]int{5965,8352},[]int{5909,8353},[]int{3710,8354},[]int{5024,8355},[]int{6197,8356},[]int{5921,8357},[]int{1720,8358},[]int{5993,8359},[]int{4858,8360},[]int{765,8361},[]int{5127,8362},[]int{4278,8363},[]int{5166,8364},[]int{8034,8365},[]int{324,8366},[]int{6927,8367},[]int{991,8368},[]int{6350,8369},[]int{7877,8370},[]int{1658,8371},[]int{5893,8372},[]int{2475,8373},[]int{6133,8374},[]int{2472,8375},[]int{1140,8376},[]int{1105,8377},[]int{8245,8378},[]int{3908,8379},[]int{5225,8380},[]int{6088,8381},[]int{6344,8382},[]int{3041,8383},[]int{6555,8384},[]int{2803,8385},[]int{1825,8386},[]int{746,8387},[]int{2493,8388},[]int{1773,8389},[]int{2288,8390},[]int{2723,8391},[]int{5099,8392},[]int{7827,8393},[]int{8331,8394},[]int{7675,8395},[]int{1022,8396},[]int{5582,8397},[]int{526,8398},[]int{1754,8399},[]int{7361,8400},[]int{1122,8401},[]int{2548,8402},[]int{5763,8403},[]int{5198,8404},[]int{4286,8405},[]int{1214,8406},[]int{2840,8407},[]int{510,8408},[]int{4947,8409},[]int{5936,8410},[]int{4063,8411},[]int{6069,8412},[]int{7896,8413},[]int{2340,8414},[]int{5042,8415},[]int{2446,8416},[]int{5257,8417},[]int{6892,8418},[]int{2499,8419},[]int{6752,8420},[]int{4445,8421},[]int{984,8422},[]int{2847,8423},[]int{2389,8424},[]int{6250,8425},[]int{7217,8426},[]int{8366,8427},[]int{2471,8428},[]int{7249,8429},[]int{4265,8430},[]int{1757,8431},[]int{3377,8432},[]int{6742,8433},[]int{6041,8434},[]int{477,8435},[]int{4,8436},[]int{1780,8437},[]int{209,8438},[]int{5627,8439},[]int{4861,8440},[]int{8188,8441},[]int{3070,8442},[]int{6186,8443},[]int{723,8444},[]int{7888,8445},[]int{5774,8446},[]int{172,8447},[]int{6073,8448},[]int{8318,8449},[]int{3306,8450},[]int{4837,8451},[]int{1002,8452},[]int{7624,8453},[]int{3737,8454},[]int{1665,8455},[]int{6468,8456},[]int{3396,8457},[]int{5611,8458},[]int{8363,8459},[]int{1312,8460},[]int{1361,8461},[]int{1420,8462},[]int{7533,8463},[]int{4725,8464},[]int{254,8465},[]int{5707,8466},[]int{2503,8467},[]int{1447,8468},[]int{8311,8469},[]int{7789,8470},[]int{7712,8471},[]int{1563,8472},[]int{408,8473},[]int{1735,8474},[]int{3981,8475},[]int{2776,8476},[]int{2803,8477},[]int{2845,8478},[]int{1985,8479},[]int{7121,8480},[]int{27,8481},[]int{1156,8482},[]int{7647,8483},[]int{4067,8484},[]int{960,8485},[]int{6640,8486},[]int{7135,8487},[]int{1110,8488},[]int{194,8489},[]int{2721,8490},[]int{8164,8491},[]int{3233,8492},[]int{760,8493},[]int{7807,8494},[]int{7665,8495},[]int{2126,8496},[]int{5766,8497},[]int{201,8498},[]int{1832,8499},[]int{1139,8500},[]int{4163,8501},[]int{4583,8502},[]int{106,8503},[]int{6932,8504},[]int{4524,8505},[]int{6483,8506},[]int{6257,8507},[]int{7167,8508},[]int{5759,8509},[]int{656,8510},[]int{1001,8511},[]int{3594,8512},[]int{2976,8513},[]int{652,8514},[]int{471,8515},[]int{4823,8516},[]int{6540,8517},[]int{3846,8518},[]int{2534,8519},[]int{405,8520},[]int{7305,8521},[]int{4160,8522},[]int{7381,8523},[]int{6831,8524},[]int{3325,8525},[]int{5433,8526},[]int{4312,8527},[]int{7859,8528},[]int{3854,8529},[]int{3954,8530},[]int{8313,8531},[]int{4597,8532},[]int{4475,8533},[]int{3734,8534},[]int{3742,8535},[]int{7589,8536},[]int{2344,8537},[]int{6689,8538},[]int{2393,8539},[]int{3024,8540},[]int{1568,8541},[]int{2718,8542},[]int{6298,8543},[]int{2295,8544},[]int{886,8545},[]int{1926,8546},[]int{4289,8547},[]int{3115,8548},[]int{6989,8549},[]int{2695,8550},[]int{8218,8551},[]int{3629,8552},[]int{2075,8553},[]int{8190,8554},[]int{2433,8555},[]int{7340,8556},[]int{3117,8557},[]int{6344,8558},[]int{4610,8559},[]int{6806,8560},[]int{3640,8561},[]int{5839,8562},[]int{631,8563},[]int{7160,8564},[]int{2180,8565},[]int{6022,8566},[]int{3350,8567},[]int{4106,8568},[]int{7977,8569},[]int{5863,8570},[]int{8126,8571},[]int{4171,8572},[]int{892,8573},[]int{3860,8574},[]int{7634,8575},[]int{2477,8576},[]int{6501,8577},[]int{1447,8578},[]int{4715,8579},[]int{5386,8580},[]int{6311,8581},[]int{850,8582},[]int{7226,8583},[]int{5699,8584},[]int{1431,8585},[]int{5135,8586},[]int{7455,8587},[]int{882,8588},[]int{7257,8589},[]int{2778,8590},[]int{1427,8591},[]int{5036,8592},[]int{1452,8593},[]int{3510,8594},[]int{8034,8595},[]int{3047,8596},[]int{3530,8597},[]int{6446,8598},[]int{1158,8599},[]int{255,8600},[]int{3519,8601},[]int{5995,8602},[]int{291,8603},[]int{3896,8604},[]int{5796,8605},[]int{7372,8606},[]int{5730,8607},[]int{7616,8608},[]int{5477,8609},[]int{919,8610},[]int{2684,8611},[]int{7051,8612},[]int{5835,8613},[]int{188,8614},[]int{2466,8615},[]int{5571,8616},[]int{1191,8617},[]int{215,8618},[]int{160,8619},[]int{980,8620},[]int{5368,8621},[]int{4415,8622},[]int{3454,8623},[]int{6216,8624},[]int{5492,8625},[]int{3644,8626},[]int{6811,8627},[]int{196,8628},[]int{6969,8629},[]int{7604,8630},[]int{4771,8631},[]int{6695,8632},[]int{4840,8633},[]int{1327,8634},[]int{7963,8635},[]int{1567,8636},[]int{1224,8637},[]int{8173,8638},[]int{7896,8639},[]int{8515,8640},[]int{649,8641},[]int{7674,8642},[]int{8242,8643},[]int{5944,8644},[]int{757,8645},[]int{4815,8646},[]int{4019,8647},[]int{2305,8648},[]int{4266,8649},[]int{286,8650},[]int{2116,8651},[]int{6714,8652},[]int{4049,8653},[]int{919,8654},[]int{7183,8655},[]int{335,8656},[]int{5754,8657},[]int{3547,8658},[]int{661,8659},[]int{3322,8660},[]int{6720,8661},[]int{5828,8662},[]int{4113,8663},[]int{695,8664},[]int{3259,8665},[]int{6723,8666},[]int{3402,8667},[]int{7081,8668},[]int{6532,8669},[]int{1824,8670},[]int{4950,8671},[]int{3307,8672},[]int{4753,8673},[]int{4508,8674},[]int{3871,8675},[]int{8625,8676},[]int{8118,8677},[]int{6430,8678},[]int{8525,8679},[]int{4544,8680},[]int{832,8681},[]int{297,8682},[]int{3699,8683},[]int{6500,8684},[]int{5573,8685},[]int{5537,8686},[]int{1623,8687},[]int{4197,8688},[]int{3580,8689},[]int{6788,8690},[]int{5513,8691},[]int{4598,8692},[]int{7072,8693},[]int{2057,8694},[]int{537,8695},[]int{7995,8696},[]int{5943,8697},[]int{6854,8698},[]int{1597,8699},[]int{1192,8700},[]int{7989,8701},[]int{4380,8702},[]int{2759,8703},[]int{2668,8704},[]int{7792,8705},[]int{3353,8706},[]int{6886,8707},[]int{1712,8708},[]int{4477,8709},[]int{7734,8710},[]int{8213,8711},[]int{1477,8712},[]int{6210,8713},[]int{1191,8714},[]int{1878,8715},[]int{1546,8716},[]int{4787,8717},[]int{6837,8718},[]int{2708,8719},[]int{1662,8720},[]int{2404,8721},[]int{6815,8722},[]int{6093,8723},[]int{5578,8724},[]int{7279,8725},[]int{2576,8726},[]int{6849,8727},[]int{3654,8728},[]int{1926,8729},[]int{272,8730},[]int{3570,8731},[]int{114,8732},[]int{4654,8733},[]int{6488,8734},[]int{2360,8735},[]int{4505,8736},[]int{5468,8737},[]int{5478,8738},[]int{55,8739},[]int{3122,8740},[]int{146,8741},[]int{7954,8742},[]int{5096,8743},[]int{3484,8744},[]int{1320,8745},[]int{2688,8746},[]int{3323,8747},[]int{7404,8748},[]int{602,8749},[]int{5482,8750},[]int{4084,8751},[]int{6509,8752},[]int{4498,8753},[]int{3471,8754},[]int{2791,8755},[]int{8436,8756},[]int{6758,8757},[]int{3203,8758},[]int{7137,8759},[]int{1685,8760},[]int{4639,8761},[]int{3712,8762},[]int{4357,8763},[]int{2810,8764},[]int{5184,8765},[]int{8222,8766},[]int{6287,8767},[]int{1159,8768},[]int{8615,8769},[]int{8595,8770},[]int{7742,8771},[]int{5748,8772},[]int{5449,8773},[]int{7031,8774},[]int{5663,8775},[]int{3496,8776},[]int{4714,8777},[]int{5021,8778},[]int{1196,8779},[]int{6719,8780},[]int{2438,8781},[]int{1269,8782},[]int{2653,8783},[]int{3606,8784},[]int{5802,8785},[]int{629,8786},[]int{201,8787},[]int{1962,8788},[]int{6449,8789},[]int{3529,8790},[]int{6897,8791},[]int{5627,8792},[]int{90,8793},[]int{1181,8794},[]int{6801,8795},[]int{4784,8796},[]int{4741,8797},[]int{3989,8798},[]int{4090,8799},[]int{4073,8800},[]int{4139,8801},[]int{5433,8802},[]int{8121,8803},[]int{7169,8804},[]int{153,8805},[]int{6684,8806},[]int{7108,8807},[]int{2622,8808},[]int{7192,8809},[]int{1573,8810},[]int{4417,8811},[]int{7290,8812},[]int{1028,8813},[]int{2388,8814},[]int{1028,8815},[]int{8239,8816},[]int{5391,8817},[]int{8473,8818},[]int{2351,8819},[]int{2058,8820},[]int{45,8821},[]int{1501,8822},[]int{4740,8823},[]int{3373,8824},[]int{5087,8825},[]int{2556,8826},[]int{2365,8827},[]int{2225,8828},[]int{4319,8829},[]int{4078,8830},[]int{1150,8831},[]int{2933,8832},[]int{3657,8833},[]int{2105,8834},[]int{7526,8835},[]int{1657,8836},[]int{2426,8837},[]int{1286,8838},[]int{3179,8839},[]int{545,8840},[]int{1523,8841},[]int{3338,8842},[]int{7303,8843},[]int{3800,8844},[]int{5994,8845},[]int{6172,8846},[]int{4594,8847},[]int{7738,8848},[]int{3195,8849},[]int{523,8850},[]int{1476,8851},[]int{2515,8852},[]int{7447,8853},[]int{5516,8854},[]int{3162,8855},[]int{7751,8856},[]int{1124,8857},[]int{4566,8858},[]int{5931,8859},[]int{3367,8860},[]int{8286,8861},[]int{6228,8862},[]int{4907,8863},[]int{2493,8864},[]int{5440,8865},[]int{7326,8866},[]int{894,8867},[]int{2212,8868},[]int{7159,8869},[]int{8573,8870},[]int{3827,8871},[]int{4878,8872},[]int{5661,8873},[]int{4321,8874},[]int{6940,8875},[]int{5331,8876},[]int{5759,8877},[]int{2437,8878},[]int{7941,8879},[]int{7484,8880},[]int{6553,8881},[]int{7881,8882},[]int{7752,8883},[]int{8073,8884},[]int{8384,8885},[]int{3999,8886},[]int{8302,8887},[]int{2885,8888},[]int{3849,8889},[]int{4373,8890},[]int{2126,8891},[]int{4536,8892},[]int{5128,8893},[]int{2746,8894},[]int{2227,8895},[]int{5269,8896},[]int{8191,8897},[]int{1509,8898},[]int{4702,8899},[]int{3302,8900},[]int{3430,8901},[]int{3098,8902},[]int{4124,8903},[]int{3009,8904},[]int{1394,8905},[]int{7703,8906},[]int{7931,8907},[]int{6543,8908},[]int{6594,8909},[]int{3409,8910},[]int{8337,8911},[]int{3224,8912},[]int{681,8913},[]int{7257,8914},[]int{4609,8915},[]int{4125,8916},[]int{5206,8917},[]int{7563,8918},[]int{4174,8919},[]int{2978,8920},[]int{619,8921},[]int{8202,8922},[]int{6391,8923},[]int{6467,8924},[]int{6004,8925},[]int{5704,8926},[]int{3540,8927},[]int{434,8928},[]int{1608,8929},[]int{6440,8930},[]int{8595,8931},[]int{472,8932},[]int{2386,8933},[]int{2100,8934},[]int{4881,8935},[]int{7270,8936},[]int{7242,8937},[]int{154,8938},[]int{7585,8939},[]int{4942,8940},[]int{3688,8941},[]int{2723,8942},[]int{7782,8943},[]int{1491,8944},[]int{1193,8945},[]int{1794,8946},[]int{789,8947},[]int{661,8948},[]int{1718,8949},[]int{5118,8950},[]int{94,8951},[]int{4363,8952},[]int{2934,8953},[]int{3393,8954},[]int{2657,8955},[]int{7175,8956},[]int{3564,8957},[]int{1469,8958},[]int{5903,8959},[]int{1864,8960},[]int{596,8961},[]int{8830,8962},[]int{8663,8963},[]int{7732,8964},[]int{6068,8965},[]int{6562,8966},[]int{3919,8967},[]int{4040,8968},[]int{294,8969},[]int{7776,8970},[]int{4113,8971},[]int{4145,8972},[]int{2749,8973},[]int{480,8974},[]int{1231,8975},[]int{3313,8976},[]int{8722,8977},[]int{312,8978},[]int{8768,8979},[]int{2395,8980},[]int{3024,8981},[]int{4587,8982},[]int{1155,8983},[]int{5587,8984},[]int{3415,8985},[]int{748,8986},[]int{498,8987},[]int{5247,8988},[]int{4241,8989},[]int{7746,8990},[]int{6962,8991},[]int{5803,8992},[]int{6970,8993},[]int{6691,8994},[]int{1805,8995},[]int{7252,8996},[]int{5199,8997},[]int{2551,8998},[]int{6535,8999},[]int{4972,9000},[]int{3913,9001},[]int{3871,9002},[]int{8192,9003},[]int{4053,9004},[]int{5858,9005},[]int{7058,9006},[]int{8250,9007},[]int{4549,9008},[]int{4983,9009},[]int{1771,9010},[]int{8732,9011},[]int{1438,9012},[]int{1070,9013},[]int{5853,9014},[]int{8016,9015},[]int{2423,9016},[]int{6995,9017},[]int{5478,9018},[]int{4754,9019},[]int{8384,9020},[]int{235,9021},[]int{1668,9022},[]int{5123,9023},[]int{2606,9024},[]int{2623,9025},[]int{977,9026},[]int{4518,9027},[]int{4195,9028},[]int{4041,9029},[]int{3949,9030},[]int{2326,9031},[]int{7637,9032},[]int{5504,9033},[]int{3341,9034},[]int{8790,9035},[]int{8341,9036},[]int{8116,9037},[]int{958,9038},[]int{3194,9039},[]int{2004,9040},[]int{4612,9041},[]int{1675,9042},[]int{6827,9043},[]int{666,9044},[]int{6398,9045},[]int{8053,9046},[]int{5321,9047},[]int{6827,9048},[]int{2204,9049},[]int{3577,9050},[]int{1537,9051},[]int{1307,9052},[]int{7806,9053},[]int{3714,9054},[]int{2476,9055},[]int{6374,9056},[]int{8579,9057},[]int{5911,9058},[]int{235,9059},[]int{8913,9060},[]int{5868,9061},[]int{4075,9062},[]int{574,9063},[]int{5616,9064},[]int{5978,9065},[]int{539,9066},[]int{1623,9067},[]int{3725,9068},[]int{4299,9069},[]int{6313,9070},[]int{4415,9071},[]int{1330,9072},[]int{3035,9073},[]int{3539,9074},[]int{4156,9075},[]int{4627,9076},[]int{1725,9077},[]int{4486,9078},[]int{1168,9079},[]int{6771,9080},[]int{6731,9081},[]int{4036,9082},[]int{6100,9083},[]int{3961,9084},[]int{6008,9085},[]int{5632,9086},[]int{3985,9087},[]int{1254,9088},[]int{705,9089},[]int{2173,9090},[]int{7528,9091},[]int{3522,9092},[]int{3327,9093},[]int{606,9094},[]int{2519,9095},[]int{6249,9096},[]int{3702,9097},[]int{4675,9098},[]int{6831,9099},[]int{513,9100},[]int{9091,9101},[]int{1548,9102},[]int{178,9103},[]int{3010,9104},[]int{3912,9105},[]int{2621,9106},[]int{5371,9107},[]int{3849,9108},[]int{4529,9109},[]int{8894,9110},[]int{7786,9111},[]int{1466,9112},[]int{1217,9113},[]int{3998,9114},[]int{7298,9115},[]int{4388,9116},[]int{7751,9117},[]int{2349,9118},[]int{347,9119},[]int{2915,9120},[]int{2781,9121},[]int{678,9122},[]int{4074,9123},[]int{7179,9124},[]int{877,9125},[]int{2124,9126},[]int{614,9127},[]int{6107,9128},[]int{7483,9129},[]int{4039,9130},[]int{7609,9131},[]int{6441,9132},[]int{1564,9133},[]int{8480,9134},[]int{5356,9135},[]int{2265,9136},[]int{1703,9137},[]int{6656,9138},[]int{8967,9139},[]int{5025,9140},[]int{6441,9141},[]int{6648,9142},[]int{6570,9143},[]int{2036,9144},[]int{5883,9145},[]int{5462,9146},[]int{7245,9147},[]int{1594,9148},[]int{8933,9149},[]int{927,9150},[]int{420,9151},[]int{5969,9152},[]int{1150,9153},[]int{8583,9154},[]int{7888,9155},[]int{5510,9156},[]int{1356,9157},[]int{6335,9158},[]int{4457,9159},[]int{8075,9160},[]int{3623,9161},[]int{3071,9162},[]int{95,9163},[]int{4218,9164},[]int{6190,9165},[]int{7372,9166},[]int{4602,9167},[]int{9034,9168},[]int{49,9169},[]int{4887,9170},[]int{8383,9171},[]int{7481,9172},[]int{1139,9173},[]int{5691,9174},[]int{2457,9175},[]int{5735,9176},[]int{6923,9177},[]int{155,9178},[]int{3364,9179},[]int{4362,9180},[]int{2143,9181},[]int{7228,9182},[]int{3441,9183},[]int{2179,9184},[]int{4357,9185},[]int{1066,9186},[]int{8971,9187},[]int{5769,9188},[]int{1247,9189},[]int{2194,9190},[]int{7129,9191},[]int{3733,9192},[]int{5857,9193},[]int{7975,9194},[]int{6781,9195},[]int{8190,9196},[]int{6359,9197},[]int{2558,9198},[]int{1785,9199},[]int{2555,9200},[]int{3236,9201},[]int{1865,9202},[]int{1458,9203},[]int{7891,9204},[]int{7936,9205},[]int{8116,9206},[]int{5149,9207},[]int{3269,9208},[]int{7060,9209},[]int{7559,9210},[]int{6475,9211},[]int{1408,9212},[]int{4737,9213},[]int{7472,9214},[]int{1081,9215},[]int{4431,9216},[]int{2741,9217},[]int{7387,9218},[]int{4048,9219},[]int{2171,9220},[]int{1418,9221},[]int{6305,9222},[]int{1930,9223},[]int{3477,9224},[]int{2618,9225},[]int{7466,9226},[]int{9097,9227},[]int{299,9228},[]int{7576,9229},[]int{8365,9230},[]int{7234,9231},[]int{5758,9232},[]int{8795,9233},[]int{4709,9234},[]int{8897,9235},[]int{7870,9236},[]int{8523,9237},[]int{2404,9238},[]int{4394,9239},[]int{603,9240},[]int{2107,9241},[]int{9007,9242},[]int{6821,9243},[]int{2965,9244},[]int{6630,9245},[]int{4851,9246},[]int{6298,9247},[]int{5478,9248},[]int{6147,9249},[]int{215,9250},[]int{1813,9251},[]int{7460,9252},[]int{8762,9253},[]int{7893,9254},[]int{7722,9255},[]int{2158,9256},[]int{2767,9257},[]int{4076,9258},[]int{6354,9259},[]int{5228,9260},[]int{7141,9261},[]int{5126,9262},[]int{8763,9263},[]int{6103,9264},[]int{1129,9265},[]int{6973,9266},[]int{4113,9267},[]int{4078,9268},[]int{954,9269},[]int{849,9270},[]int{361,9271},[]int{8476,9272},[]int{1682,9273},[]int{5439,9274},[]int{7012,9275},[]int{6911,9276},[]int{9272,9277},[]int{6070,9278},[]int{2976,9279},[]int{1343,9280},[]int{3536,9281},[]int{8942,9282},[]int{9174,9283},[]int{820,9284},[]int{8536,9285},[]int{4615,9286},[]int{9017,9287},[]int{6340,9288},[]int{2587,9289},[]int{7563,9290},[]int{7604,9291},[]int{2377,9292},[]int{607,9293},[]int{4992,9294},[]int{2736,9295},[]int{1771,9296},[]int{3129,9297},[]int{2278,9298},[]int{3274,9299},[]int{23,9300},[]int{2221,9301},[]int{778,9302},[]int{7383,9303},[]int{2181,9304},[]int{8078,9305},[]int{8015,9306},[]int{4252,9307},[]int{1296,9308},[]int{5190,9309},[]int{2773,9310},[]int{5117,9311},[]int{780,9312},[]int{722,9313},[]int{2552,9314},[]int{2191,9315},[]int{4611,9316},[]int{2708,9317},[]int{8878,9318},[]int{5231,9319},[]int{1949,9320},[]int{7734,9321},[]int{6561,9322},[]int{4889,9323},[]int{8794,9324},[]int{1156,9325},[]int{3752,9326},[]int{936,9327},[]int{7502,9328},[]int{2561,9329},[]int{5122,9330},[]int{8181,9331},[]int{5618,9332},[]int{321,9333},[]int{5326,9334},[]int{1098,9335},[]int{1770,9336},[]int{1013,9337},[]int{7405,9338},[]int{3459,9339},[]int{807,9340},[]int{93,9341},[]int{3065,9342},[]int{8897,9343},[]int{6017,9344},[]int{3136,9345},[]int{4333,9346},[]int{1321,9347},[]int{853,9348},[]int{7309,9349},[]int{9164,9350},[]int{7814,9351},[]int{1827,9352},[]int{6070,9353},[]int{2230,9354},[]int{6948,9355},[]int{2028,9356},[]int{7642,9357},[]int{382,9358},[]int{7326,9359},[]int{980,9360},[]int{8663,9361},[]int{4541,9362},[]int{1658,9363},[]int{7633,9364},[]int{8954,9365},[]int{3592,9366},[]int{7775,9367},[]int{9366,9368},[]int{5068,9369},[]int{2287,9370},[]int{2664,9371},[]int{3392,9372},[]int{884,9373},[]int{5435,9374},[]int{5099,9375},[]int{8532,9376},[]int{8427,9377},[]int{6527,9378},[]int{7862,9379},[]int{5655,9380},[]int{929,9381},[]int{3258,9382},[]int{2008,9383},[]int{2122,9384},[]int{7119,9385},[]int{4307,9386},[]int{8455,9387},[]int{8425,9388},[]int{5762,9389},[]int{5093,9390},[]int{3266,9391},[]int{1248,9392},[]int{804,9393},[]int{1810,9394},[]int{8423,9395},[]int{2102,9396},[]int{6057,9397},[]int{8079,9398},[]int{3946,9399},[]int{5782,9400},[]int{6520,9401},[]int{1180,9402},[]int{3873,9403},[]int{9019,9404},[]int{6136,9405},[]int{1685,9406},[]int{7216,9407},[]int{439,9408},[]int{8204,9409},[]int{6458,9410},[]int{5889,9411},[]int{3132,9412},[]int{7748,9413},[]int{5453,9414},[]int{3526,9415},[]int{1472,9416},[]int{3481,9417},[]int{9204,9418},[]int{2974,9419},[]int{2699,9420},[]int{56,9421},[]int{7966,9422},[]int{5350,9423},[]int{1639,9424},[]int{2167,9425},[]int{3291,9426},[]int{8593,9427},[]int{1352,9428},[]int{2462,9429},[]int{5701,9430},[]int{574,9431},[]int{6046,9432},[]int{8249,9433},[]int{5560,9434},[]int{6295,9435},[]int{4876,9436},[]int{8626,9437},[]int{7070,9438},[]int{3932,9439},[]int{8223,9440},[]int{2388,9441},[]int{5487,9442},[]int{5595,9443},[]int{2372,9444},[]int{5495,9445},[]int{9410,9446},[]int{3943,9447},[]int{7295,9448},[]int{5927,9449},[]int{3505,9450},[]int{6785,9451},[]int{7081,9452},[]int{8470,9453},[]int{3466,9454},[]int{4275,9455},[]int{1836,9456},[]int{1280,9457},[]int{7173,9458},[]int{2421,9459},[]int{8663,9460},[]int{4143,9461},[]int{6357,9462},[]int{1610,9463},[]int{7177,9464},[]int{7193,9465},[]int{3219,9466},[]int{5996,9467},[]int{9211,9468},[]int{6201,9469},[]int{6870,9470},[]int{8878,9471},[]int{5503,9472},[]int{8741,9473},[]int{3414,9474},[]int{840,9475},[]int{2743,9476},[]int{7725,9477},[]int{4160,9478},[]int{1810,9479},[]int{8563,9480},[]int{7386,9481},[]int{5586,9482},[]int{2565,9483},[]int{6667,9484},[]int{930,9485},[]int{1578,9486},[]int{8184,9487},[]int{869,9488},[]int{4101,9489},[]int{6437,9490},[]int{4195,9491},[]int{4279,9492},[]int{9359,9493},[]int{8303,9494},[]int{3351,9495},[]int{3908,9496},[]int{4247,9497},[]int{2213,9498},[]int{9397,9499},[]int{6593,9500},[]int{2440,9501},[]int{3210,9502},[]int{2139,9503},[]int{2380,9504},[]int{4277,9505},[]int{7863,9506},[]int{5601,9507},[]int{5333,9508},[]int{3945,9509},[]int{3877,9510},[]int{5718,9511},[]int{1954,9512},[]int{8655,9513},[]int{2037,9514},[]int{4051,9515},[]int{973,9516},[]int{2034,9517},[]int{3095,9518},[]int{2532,9519},[]int{2579,9520},[]int{8219,9521},[]int{4633,9522},[]int{321,9523},[]int{8364,9524},[]int{2764,9525},[]int{2201,9526},[]int{9370,9527},[]int{8491,9528},[]int{2376,9529},[]int{8006,9530},[]int{7636,9531},[]int{5969,9532},[]int{7332,9533},[]int{6748,9534},[]int{7429,9535},[]int{4986,9536},[]int{7956,9537},[]int{3906,9538},[]int{9266,9539},[]int{1831,9540},[]int{4151,9541},[]int{740,9542},[]int{1070,9543},[]int{6885,9544},[]int{7679,9545},[]int{236,9546},[]int{7090,9547},[]int{7967,9548},[]int{6060,9549},[]int{8161,9550},[]int{8052,9551},[]int{5453,9552},[]int{5832,9553},[]int{2727,9554},[]int{9111,9555},[]int{2263,9556},[]int{9222,9557},[]int{6435,9558},[]int{762,9559},[]int{8825,9560},[]int{484,9561},[]int{8049,9562},[]int{8613,9563},[]int{3783,9564},[]int{9494,9565},[]int{5316,9566},[]int{3465,9567},[]int{764,9568},[]int{511,9569},[]int{3019,9570},[]int{6002,9571},[]int{6419,9572},[]int{5274,9573},[]int{3595,9574},[]int{4883,9575},[]int{9195,9576},[]int{1774,9577},[]int{6034,9578},[]int{6860,9579},[]int{3890,9580},[]int{6265,9581},[]int{687,9582},[]int{6013,9583},[]int{8389,9584},[]int{9477,9585},[]int{6276,9586},[]int{5914,9587},[]int{1458,9588},[]int{2440,9589},[]int{1833,9590},[]int{8635,9591},[]int{2635,9592},[]int{1457,9593},[]int{8652,9594},[]int{4784,9595},[]int{1319,9596},[]int{7002,9597},[]int{5811,9598},[]int{6500,9599},[]int{3655,9600},[]int{7488,9601},[]int{2373,9602},[]int{4659,9603},[]int{5767,9604},[]int{9442,9605},[]int{544,9606},[]int{2815,9607},[]int{5694,9608},[]int{7595,9609},[]int{6619,9610},[]int{3907,9611},[]int{208,9612},[]int{8181,9613},[]int{8458,9614},[]int{6067,9615},[]int{2976,9616},[]int{4939,9617},[]int{8478,9618},[]int{6161,9619},[]int{7343,9620},[]int{7600,9621},[]int{896,9622},[]int{6570,9623},[]int{6996,9624},[]int{3819,9625},[]int{2677,9626},[]int{155,9627},[]int{6265,9628},[]int{5619,9629},[]int{8131,9630},[]int{5620,9631},[]int{8911,9632},[]int{2104,9633},[]int{4598,9634},[]int{2788,9635},[]int{4938,9636},[]int{7775,9637},[]int{5829,9638},[]int{9566,9639},[]int{2691,9640},[]int{4809,9641},[]int{2413,9642},[]int{5423,9643},[]int{7111,9644},[]int{3858,9645},[]int{3296,9646},[]int{5960,9647},[]int{4737,9648},[]int{4633,9649},[]int{3681,9650},[]int{6552,9651},[]int{3809,9652},[]int{6654,9653},[]int{7006,9654},[]int{7118,9655},[]int{3946,9656},[]int{4034,9657},[]int{8194,9658},[]int{4685,9659},[]int{8417,9660},[]int{3173,9661},[]int{6442,9662},[]int{9350,9663},[]int{1159,9664},[]int{5711,9665},[]int{2844,9666},[]int{6911,9667},[]int{2452,9668},[]int{8816,9669},[]int{9358,9670},[]int{4548,9671},[]int{6966,9672},[]int{9095,9673},[]int{5318,9674},[]int{316,9675},[]int{6498,9676},[]int{1246,9677},[]int{2329,9678},[]int{4930,9679},[]int{1693,9680},[]int{2377,9681},[]int{9271,9682},[]int{2256,9683},[]int{6244,9684},[]int{7340,9685},[]int{4130,9686},[]int{4351,9687},[]int{5846,9688},[]int{7504,9689},[]int{6271,9690},[]int{2990,9691},[]int{8912,9692},[]int{6719,9693},[]int{2845,9694},[]int{2350,9695},[]int{2532,9696},[]int{4140,9697},[]int{4405,9698},[]int{9551,9699},[]int{5001,9700},[]int{3056,9701},[]int{8102,9702},[]int{9007,9703},[]int{8450,9704},[]int{9073,9705},[]int{9430,9706},[]int{8916,9707},[]int{8697,9708},[]int{5424,9709},[]int{6252,9710},[]int{98,9711},[]int{2008,9712},[]int{4452,9713},[]int{3658,9714},[]int{3085,9715},[]int{920,9716},[]int{8468,9717},[]int{5905,9718},[]int{7199,9719},[]int{6983,9720},[]int{6551,9721},[]int{7479,9722},[]int{5617,9723},[]int{2796,9724},[]int{6165,9725},[]int{5395,9726},[]int{3526,9727},[]int{2777,9728},[]int{537,9729},[]int{4319,9730},[]int{4146,9731},[]int{145,9732},[]int{8544,9733},[]int{383,9734},[]int{3247,9735},[]int{3980,9736},[]int{9525,9737},[]int{560,9738},[]int{1755,9739},[]int{9112,9740},[]int{6752,9741},[]int{4353,9742},[]int{7136,9743},[]int{6150,9744},[]int{3368,9745},[]int{278,9746},[]int{7128,9747},[]int{1410,9748},[]int{760,9749},[]int{1227,9750},[]int{3328,9751},[]int{3087,9752},[]int{6970,9753},[]int{3110,9754},[]int{4582,9755},[]int{9599,9756},[]int{9453,9757},[]int{3420,9758},[]int{439,9759},[]int{284,9760},[]int{4463,9761},[]int{5108,9762},[]int{1127,9763},[]int{3489,9764},[]int{9403,9765},[]int{4488,9766},[]int{3196,9767},[]int{1903,9768},[]int{3442,9769},[]int{1084,9770},[]int{926,9771},[]int{1592,9772},[]int{2913,9773},[]int{7445,9774},[]int{1753,9775},[]int{2298,9776},[]int{3515,9777},[]int{2037,9778},[]int{3588,9779},[]int{6512,9780},[]int{3086,9781},[]int{2083,9782},[]int{8226,9783},[]int{2107,9784},[]int{642,9785},[]int{9703,9786},[]int{5952,9787},[]int{5484,9788},[]int{8084,9789},[]int{9672,9790},[]int{3092,9791},[]int{4959,9792},[]int{7600,9793},[]int{193,9794},[]int{2084,9795},[]int{231,9796},[]int{7437,9797},[]int{362,9798},[]int{5952,9799},[]int{849,9800},[]int{1405,9801},[]int{3368,9802},[]int{2219,9803},[]int{9359,9804},[]int{8113,9805},[]int{7751,9806},[]int{99,9807},[]int{3224,9808},[]int{1868,9809},[]int{1332,9810},[]int{9682,9811},[]int{1548,9812},[]int{1056,9813},[]int{305,9814},[]int{2740,9815},[]int{8831,9816},[]int{2706,9817},[]int{463,9818},[]int{940,9819},[]int{6515,9820},[]int{9726,9821},[]int{9273,9822},[]int{316,9823},[]int{5622,9824},[]int{9125,9825},[]int{9054,9826},[]int{1055,9827},[]int{2921,9828},[]int{658,9829},[]int{9682,9830},[]int{8552,9831},[]int{1092,9832},[]int{736,9833},[]int{4392,9834},[]int{4056,9835},[]int{6043,9836},[]int{7889,9837},[]int{3503,9838},[]int{8207,9839},[]int{1670,9840},[]int{7698,9841},[]int{2347,9842},[]int{7674,9843},[]int{2833,9844},[]int{2457,9845},[]int{6817,9846},[]int{3351,9847},[]int{5270,9848},[]int{8394,9849},[]int{8163,9850},[]int{2613,9851},[]int{8249,9852},[]int{4155,9853},[]int{1748,9854},[]int{7571,9855},[]int{566,9856},[]int{4790,9857},[]int{1337,9858},[]int{5080,9859},[]int{7214,9860},[]int{3627,9861},[]int{7400,9862},[]int{6361,9863},[]int{2268,9864},[]int{1686,9865},[]int{4904,9866},[]int{7784,9867},[]int{9559,9868},[]int{8843,9869},[]int{8578,9870},[]int{8398,9871},[]int{7990,9872},[]int{408,9873},[]int{82,9874},[]int{6881,9875},[]int{3399,9876},[]int{5627,9877},[]int{365,9878},[]int{7121,9879},[]int{9405,9880},[]int{138,9881},[]int{3481,9882},[]int{5573,9883},[]int{380,9884},[]int{9497,9885},[]int{1762,9886},[]int{7853,9887},[]int{4755,9888},[]int{5273,9889},[]int{9028,9890},[]int{2489,9891},[]int{1578,9892},[]int{5266,9893},[]int{2899,9894},[]int{6711,9895},[]int{2206,9896},[]int{6538,9897},[]int{2765,9898},[]int{2652,9899},[]int{119,9900},[]int{8440,9901},[]int{3098,9902},[]int{6797,9903},[]int{8141,9904},[]int{9738,9905},[]int{6902,9906},[]int{4347,9907},[]int{2270,9908},[]int{1118,9909},[]int{4863,9910},[]int{1050,9911},[]int{1711,9912},[]int{1013,9913},[]int{7108,9914},[]int{3125,9915},[]int{2094,9916},[]int{148,9917},[]int{3807,9918},[]int{864,9919},[]int{5505,9920},[]int{6938,9921},[]int{1445,9922},[]int{6597,9923},[]int{4733,9924},[]int{4185,9925},[]int{3565,9926},[]int{8776,9927},[]int{3350,9928},[]int{2529,9929},[]int{1005,9930},[]int{3181,9931},[]int{9739,9932},[]int{7805,9933},[]int{2779,9934},[]int{1986,9935},[]int{78,9936},[]int{4363,9937},[]int{4069,9938},[]int{6404,9939},[]int{4575,9940},[]int{896,9941},[]int{2606,9942},[]int{4689,9943},[]int{2377,9944},[]int{4747,9945},[]int{9816,9946},[]int{5545,9947},[]int{326,9948},[]int{9216,9949},[]int{6741,9950},[]int{6543,9951},[]int{4723,9952},[]int{786,9953},[]int{9941,9954},[]int{2490,9955},[]int{8552,9956},[]int{7512,9957},[]int{488,9958},[]int{8569,9959},[]int{4168,9960},[]int{3108,9961},[]int{8956,9962},[]int{3524,9963},[]int{2079,9964},[]int{1733,9965},[]int{7840,9966},[]int{9615,9967},[]int{4782,9968},[]int{3712,9969},[]int{1770,9970},[]int{7206,9971},[]int{6404,9972},[]int{4961,9973},[]int{6088,9974},[]int{4645,9975},[]int{1031,9976},[]int{9918,9977},[]int{3154,9978},[]int{438,9979},[]int{2539,9980},[]int{933,9981},[]int{5745,9982},[]int{5771,9983},[]int{1886,9984},[]int{1770,9985},[]int{5986,9986},[]int{2614,9987},[]int{2141,9988},[]int{5517,9989},[]int{9478,9990},[]int{7643,9991},[]int{3919,9992},[]int{473,9993},[]int{1166,9994},[]int{1235,9995},[]int{9444,9996},[]int{2634,9997},[]int{388,9998},[]int{13,9999},[]int{1089,10000},[]int{5564,10001}}, + []int{1,2}, + }, + + { + 5000, + [][]int{[]int{0, 1}, []int{1, 2}, []int{2, 3}, []int{3, 4}, []int{4, 5}, []int{5, 6}, []int{6, 7}, []int{7, 8}, []int{8, 9}, []int{9, 10}, []int{10, 11}, []int{11, 12}, []int{12, 13}, []int{13, 14}, []int{14, 15}, []int{15, 16}, []int{16, 17}, []int{17, 18}, []int{18, 19}, []int{19, 20}, []int{20, 21}, []int{21, 22}, []int{22, 23}, []int{23, 24}, []int{24, 25}, []int{25, 26}, []int{26, 27}, []int{27, 28}, []int{28, 29}, []int{29, 30}, []int{30, 31}, []int{31, 32}, []int{32, 33}, []int{33, 34}, []int{34, 35}, []int{35, 36}, []int{36, 37}, []int{37, 38}, []int{38, 39}, []int{39, 40}, []int{40, 41}, []int{41, 42}, []int{42, 43}, []int{43, 44}, []int{44, 45}, []int{45, 46}, []int{46, 47}, []int{47, 48}, []int{48, 49}, []int{49, 50}, []int{50, 51}, []int{51, 52}, []int{52, 53}, []int{53, 54}, []int{54, 55}, []int{55, 56}, []int{56, 57}, []int{57, 58}, []int{58, 59}, []int{59, 60}, []int{60, 61}, []int{61, 62}, []int{62, 63}, []int{63, 64}, []int{64, 65}, []int{65, 66}, []int{66, 67}, []int{67, 68}, []int{68, 69}, []int{69, 70}, []int{70, 71}, []int{71, 72}, []int{72, 73}, []int{73, 74}, []int{74, 75}, []int{75, 76}, []int{76, 77}, []int{77, 78}, []int{78, 79}, []int{79, 80}, []int{80, 81}, []int{81, 82}, []int{82, 83}, []int{83, 84}, []int{84, 85}, []int{85, 86}, []int{86, 87}, []int{87, 88}, []int{88, 89}, []int{89, 90}, []int{90, 91}, []int{91, 92}, []int{92, 93}, []int{93, 94}, []int{94, 95}, []int{95, 96}, []int{96, 97}, []int{97, 98}, []int{98, 99}, []int{99, 100}, []int{100, 101}, []int{101, 102}, []int{102, 103}, []int{103, 104}, []int{104, 105}, []int{105, 106}, []int{106, 107}, []int{107, 108}, []int{108, 109}, []int{109, 110}, []int{110, 111}, []int{111, 112}, []int{112, 113}, []int{113, 114}, []int{114, 115}, []int{115, 116}, []int{116, 117}, []int{117, 118}, []int{118, 119}, []int{119, 120}, []int{120, 121}, []int{121, 122}, []int{122, 123}, []int{123, 124}, []int{124, 125}, []int{125, 126}, []int{126, 127}, []int{127, 128}, []int{128, 129}, []int{129, 130}, []int{130, 131}, []int{131, 132}, []int{132, 133}, []int{133, 134}, []int{134, 135}, []int{135, 136}, []int{136, 137}, []int{137, 138}, []int{138, 139}, []int{139, 140}, []int{140, 141}, []int{141, 142}, []int{142, 143}, []int{143, 144}, []int{144, 145}, []int{145, 146}, []int{146, 147}, []int{147, 148}, []int{148, 149}, []int{149, 150}, []int{150, 151}, []int{151, 152}, []int{152, 153}, []int{153, 154}, []int{154, 155}, []int{155, 156}, []int{156, 157}, []int{157, 158}, []int{158, 159}, []int{159, 160}, []int{160, 161}, []int{161, 162}, []int{162, 163}, []int{163, 164}, []int{164, 165}, []int{165, 166}, []int{166, 167}, []int{167, 168}, []int{168, 169}, []int{169, 170}, []int{170, 171}, []int{171, 172}, []int{172, 173}, []int{173, 174}, []int{174, 175}, []int{175, 176}, []int{176, 177}, []int{177, 178}, []int{178, 179}, []int{179, 180}, []int{180, 181}, []int{181, 182}, []int{182, 183}, []int{183, 184}, []int{184, 185}, []int{185, 186}, []int{186, 187}, []int{187, 188}, []int{188, 189}, []int{189, 190}, []int{190, 191}, []int{191, 192}, []int{192, 193}, []int{193, 194}, []int{194, 195}, []int{195, 196}, []int{196, 197}, []int{197, 198}, []int{198, 199}, []int{199, 200}, []int{200, 201}, []int{201, 202}, []int{202, 203}, []int{203, 204}, []int{204, 205}, []int{205, 206}, []int{206, 207}, []int{207, 208}, []int{208, 209}, []int{209, 210}, []int{210, 211}, []int{211, 212}, []int{212, 213}, []int{213, 214}, []int{214, 215}, []int{215, 216}, []int{216, 217}, []int{217, 218}, []int{218, 219}, []int{219, 220}, []int{220, 221}, []int{221, 222}, []int{222, 223}, []int{223, 224}, []int{224, 225}, []int{225, 226}, []int{226, 227}, []int{227, 228}, []int{228, 229}, []int{229, 230}, []int{230, 231}, []int{231, 232}, []int{232, 233}, []int{233, 234}, []int{234, 235}, []int{235, 236}, []int{236, 237}, []int{237, 238}, []int{238, 239}, []int{239, 240}, []int{240, 241}, []int{241, 242}, []int{242, 243}, []int{243, 244}, []int{244, 245}, []int{245, 246}, []int{246, 247}, []int{247, 248}, []int{248, 249}, []int{249, 250}, []int{250, 251}, []int{251, 252}, []int{252, 253}, []int{253, 254}, []int{254, 255}, []int{255, 256}, []int{256, 257}, []int{257, 258}, []int{258, 259}, []int{259, 260}, []int{260, 261}, []int{261, 262}, []int{262, 263}, []int{263, 264}, []int{264, 265}, []int{265, 266}, []int{266, 267}, []int{267, 268}, []int{268, 269}, []int{269, 270}, []int{270, 271}, []int{271, 272}, []int{272, 273}, []int{273, 274}, []int{274, 275}, []int{275, 276}, []int{276, 277}, []int{277, 278}, []int{278, 279}, []int{279, 280}, []int{280, 281}, []int{281, 282}, []int{282, 283}, []int{283, 284}, []int{284, 285}, []int{285, 286}, []int{286, 287}, []int{287, 288}, []int{288, 289}, []int{289, 290}, []int{290, 291}, []int{291, 292}, []int{292, 293}, []int{293, 294}, []int{294, 295}, []int{295, 296}, []int{296, 297}, []int{297, 298}, []int{298, 299}, []int{299, 300}, []int{300, 301}, []int{301, 302}, []int{302, 303}, []int{303, 304}, []int{304, 305}, []int{305, 306}, []int{306, 307}, []int{307, 308}, []int{308, 309}, []int{309, 310}, []int{310, 311}, []int{311, 312}, []int{312, 313}, []int{313, 314}, []int{314, 315}, []int{315, 316}, []int{316, 317}, []int{317, 318}, []int{318, 319}, []int{319, 320}, []int{320, 321}, []int{321, 322}, []int{322, 323}, []int{323, 324}, []int{324, 325}, []int{325, 326}, []int{326, 327}, []int{327, 328}, []int{328, 329}, []int{329, 330}, []int{330, 331}, []int{331, 332}, []int{332, 333}, []int{333, 334}, []int{334, 335}, []int{335, 336}, []int{336, 337}, []int{337, 338}, []int{338, 339}, []int{339, 340}, []int{340, 341}, []int{341, 342}, []int{342, 343}, []int{343, 344}, []int{344, 345}, []int{345, 346}, []int{346, 347}, []int{347, 348}, []int{348, 349}, []int{349, 350}, []int{350, 351}, []int{351, 352}, []int{352, 353}, []int{353, 354}, []int{354, 355}, []int{355, 356}, []int{356, 357}, []int{357, 358}, []int{358, 359}, []int{359, 360}, []int{360, 361}, []int{361, 362}, []int{362, 363}, []int{363, 364}, []int{364, 365}, []int{365, 366}, []int{366, 367}, []int{367, 368}, []int{368, 369}, []int{369, 370}, []int{370, 371}, []int{371, 372}, []int{372, 373}, []int{373, 374}, []int{374, 375}, []int{375, 376}, []int{376, 377}, []int{377, 378}, []int{378, 379}, []int{379, 380}, []int{380, 381}, []int{381, 382}, []int{382, 383}, []int{383, 384}, []int{384, 385}, []int{385, 386}, []int{386, 387}, []int{387, 388}, []int{388, 389}, []int{389, 390}, []int{390, 391}, []int{391, 392}, []int{392, 393}, []int{393, 394}, []int{394, 395}, []int{395, 396}, []int{396, 397}, []int{397, 398}, []int{398, 399}, []int{399, 400}, []int{400, 401}, []int{401, 402}, []int{402, 403}, []int{403, 404}, []int{404, 405}, []int{405, 406}, []int{406, 407}, []int{407, 408}, []int{408, 409}, []int{409, 410}, []int{410, 411}, []int{411, 412}, []int{412, 413}, []int{413, 414}, []int{414, 415}, []int{415, 416}, []int{416, 417}, []int{417, 418}, []int{418, 419}, []int{419, 420}, []int{420, 421}, []int{421, 422}, []int{422, 423}, []int{423, 424}, []int{424, 425}, []int{425, 426}, []int{426, 427}, []int{427, 428}, []int{428, 429}, []int{429, 430}, []int{430, 431}, []int{431, 432}, []int{432, 433}, []int{433, 434}, []int{434, 435}, []int{435, 436}, []int{436, 437}, []int{437, 438}, []int{438, 439}, []int{439, 440}, []int{440, 441}, []int{441, 442}, []int{442, 443}, []int{443, 444}, []int{444, 445}, []int{445, 446}, []int{446, 447}, []int{447, 448}, []int{448, 449}, []int{449, 450}, []int{450, 451}, []int{451, 452}, []int{452, 453}, []int{453, 454}, []int{454, 455}, []int{455, 456}, []int{456, 457}, []int{457, 458}, []int{458, 459}, []int{459, 460}, []int{460, 461}, []int{461, 462}, []int{462, 463}, []int{463, 464}, []int{464, 465}, []int{465, 466}, []int{466, 467}, []int{467, 468}, []int{468, 469}, []int{469, 470}, []int{470, 471}, []int{471, 472}, []int{472, 473}, []int{473, 474}, []int{474, 475}, []int{475, 476}, []int{476, 477}, []int{477, 478}, []int{478, 479}, []int{479, 480}, []int{480, 481}, []int{481, 482}, []int{482, 483}, []int{483, 484}, []int{484, 485}, []int{485, 486}, []int{486, 487}, []int{487, 488}, []int{488, 489}, []int{489, 490}, []int{490, 491}, []int{491, 492}, []int{492, 493}, []int{493, 494}, []int{494, 495}, []int{495, 496}, []int{496, 497}, []int{497, 498}, []int{498, 499}, []int{499, 500}, []int{500, 501}, []int{501, 502}, []int{502, 503}, []int{503, 504}, []int{504, 505}, []int{505, 506}, []int{506, 507}, []int{507, 508}, []int{508, 509}, []int{509, 510}, []int{510, 511}, []int{511, 512}, []int{512, 513}, []int{513, 514}, []int{514, 515}, []int{515, 516}, []int{516, 517}, []int{517, 518}, []int{518, 519}, []int{519, 520}, []int{520, 521}, []int{521, 522}, []int{522, 523}, []int{523, 524}, []int{524, 525}, []int{525, 526}, []int{526, 527}, []int{527, 528}, []int{528, 529}, []int{529, 530}, []int{530, 531}, []int{531, 532}, []int{532, 533}, []int{533, 534}, []int{534, 535}, []int{535, 536}, []int{536, 537}, []int{537, 538}, []int{538, 539}, []int{539, 540}, []int{540, 541}, []int{541, 542}, []int{542, 543}, []int{543, 544}, []int{544, 545}, []int{545, 546}, []int{546, 547}, []int{547, 548}, []int{548, 549}, []int{549, 550}, []int{550, 551}, []int{551, 552}, []int{552, 553}, []int{553, 554}, []int{554, 555}, []int{555, 556}, []int{556, 557}, []int{557, 558}, []int{558, 559}, []int{559, 560}, []int{560, 561}, []int{561, 562}, []int{562, 563}, []int{563, 564}, []int{564, 565}, []int{565, 566}, []int{566, 567}, []int{567, 568}, []int{568, 569}, []int{569, 570}, []int{570, 571}, []int{571, 572}, []int{572, 573}, []int{573, 574}, []int{574, 575}, []int{575, 576}, []int{576, 577}, []int{577, 578}, []int{578, 579}, []int{579, 580}, []int{580, 581}, []int{581, 582}, []int{582, 583}, []int{583, 584}, []int{584, 585}, []int{585, 586}, []int{586, 587}, []int{587, 588}, []int{588, 589}, []int{589, 590}, []int{590, 591}, []int{591, 592}, []int{592, 593}, []int{593, 594}, []int{594, 595}, []int{595, 596}, []int{596, 597}, []int{597, 598}, []int{598, 599}, []int{599, 600}, []int{600, 601}, []int{601, 602}, []int{602, 603}, []int{603, 604}, []int{604, 605}, []int{605, 606}, []int{606, 607}, []int{607, 608}, []int{608, 609}, []int{609, 610}, []int{610, 611}, []int{611, 612}, []int{612, 613}, []int{613, 614}, []int{614, 615}, []int{615, 616}, []int{616, 617}, []int{617, 618}, []int{618, 619}, []int{619, 620}, []int{620, 621}, []int{621, 622}, []int{622, 623}, []int{623, 624}, []int{624, 625}, []int{625, 626}, []int{626, 627}, []int{627, 628}, []int{628, 629}, []int{629, 630}, []int{630, 631}, []int{631, 632}, []int{632, 633}, []int{633, 634}, []int{634, 635}, []int{635, 636}, []int{636, 637}, []int{637, 638}, []int{638, 639}, []int{639, 640}, []int{640, 641}, []int{641, 642}, []int{642, 643}, []int{643, 644}, []int{644, 645}, []int{645, 646}, []int{646, 647}, []int{647, 648}, []int{648, 649}, []int{649, 650}, []int{650, 651}, []int{651, 652}, []int{652, 653}, []int{653, 654}, []int{654, 655}, []int{655, 656}, []int{656, 657}, []int{657, 658}, []int{658, 659}, []int{659, 660}, []int{660, 661}, []int{661, 662}, []int{662, 663}, []int{663, 664}, []int{664, 665}, []int{665, 666}, []int{666, 667}, []int{667, 668}, []int{668, 669}, []int{669, 670}, []int{670, 671}, []int{671, 672}, []int{672, 673}, []int{673, 674}, []int{674, 675}, []int{675, 676}, []int{676, 677}, []int{677, 678}, []int{678, 679}, []int{679, 680}, []int{680, 681}, []int{681, 682}, []int{682, 683}, []int{683, 684}, []int{684, 685}, []int{685, 686}, []int{686, 687}, []int{687, 688}, []int{688, 689}, []int{689, 690}, []int{690, 691}, []int{691, 692}, []int{692, 693}, []int{693, 694}, []int{694, 695}, []int{695, 696}, []int{696, 697}, []int{697, 698}, []int{698, 699}, []int{699, 700}, []int{700, 701}, []int{701, 702}, []int{702, 703}, []int{703, 704}, []int{704, 705}, []int{705, 706}, []int{706, 707}, []int{707, 708}, []int{708, 709}, []int{709, 710}, []int{710, 711}, []int{711, 712}, []int{712, 713}, []int{713, 714}, []int{714, 715}, []int{715, 716}, []int{716, 717}, []int{717, 718}, []int{718, 719}, []int{719, 720}, []int{720, 721}, []int{721, 722}, []int{722, 723}, []int{723, 724}, []int{724, 725}, []int{725, 726}, []int{726, 727}, []int{727, 728}, []int{728, 729}, []int{729, 730}, []int{730, 731}, []int{731, 732}, []int{732, 733}, []int{733, 734}, []int{734, 735}, []int{735, 736}, []int{736, 737}, []int{737, 738}, []int{738, 739}, []int{739, 740}, []int{740, 741}, []int{741, 742}, []int{742, 743}, []int{743, 744}, []int{744, 745}, []int{745, 746}, []int{746, 747}, []int{747, 748}, []int{748, 749}, []int{749, 750}, []int{750, 751}, []int{751, 752}, []int{752, 753}, []int{753, 754}, []int{754, 755}, []int{755, 756}, []int{756, 757}, []int{757, 758}, []int{758, 759}, []int{759, 760}, []int{760, 761}, []int{761, 762}, []int{762, 763}, []int{763, 764}, []int{764, 765}, []int{765, 766}, []int{766, 767}, []int{767, 768}, []int{768, 769}, []int{769, 770}, []int{770, 771}, []int{771, 772}, []int{772, 773}, []int{773, 774}, []int{774, 775}, []int{775, 776}, []int{776, 777}, []int{777, 778}, []int{778, 779}, []int{779, 780}, []int{780, 781}, []int{781, 782}, []int{782, 783}, []int{783, 784}, []int{784, 785}, []int{785, 786}, []int{786, 787}, []int{787, 788}, []int{788, 789}, []int{789, 790}, []int{790, 791}, []int{791, 792}, []int{792, 793}, []int{793, 794}, []int{794, 795}, []int{795, 796}, []int{796, 797}, []int{797, 798}, []int{798, 799}, []int{799, 800}, []int{800, 801}, []int{801, 802}, []int{802, 803}, []int{803, 804}, []int{804, 805}, []int{805, 806}, []int{806, 807}, []int{807, 808}, []int{808, 809}, []int{809, 810}, []int{810, 811}, []int{811, 812}, []int{812, 813}, []int{813, 814}, []int{814, 815}, []int{815, 816}, []int{816, 817}, []int{817, 818}, []int{818, 819}, []int{819, 820}, []int{820, 821}, []int{821, 822}, []int{822, 823}, []int{823, 824}, []int{824, 825}, []int{825, 826}, []int{826, 827}, []int{827, 828}, []int{828, 829}, []int{829, 830}, []int{830, 831}, []int{831, 832}, []int{832, 833}, []int{833, 834}, []int{834, 835}, []int{835, 836}, []int{836, 837}, []int{837, 838}, []int{838, 839}, []int{839, 840}, []int{840, 841}, []int{841, 842}, []int{842, 843}, []int{843, 844}, []int{844, 845}, []int{845, 846}, []int{846, 847}, []int{847, 848}, []int{848, 849}, []int{849, 850}, []int{850, 851}, []int{851, 852}, []int{852, 853}, []int{853, 854}, []int{854, 855}, []int{855, 856}, []int{856, 857}, []int{857, 858}, []int{858, 859}, []int{859, 860}, []int{860, 861}, []int{861, 862}, []int{862, 863}, []int{863, 864}, []int{864, 865}, []int{865, 866}, []int{866, 867}, []int{867, 868}, []int{868, 869}, []int{869, 870}, []int{870, 871}, []int{871, 872}, []int{872, 873}, []int{873, 874}, []int{874, 875}, []int{875, 876}, []int{876, 877}, []int{877, 878}, []int{878, 879}, []int{879, 880}, []int{880, 881}, []int{881, 882}, []int{882, 883}, []int{883, 884}, []int{884, 885}, []int{885, 886}, []int{886, 887}, []int{887, 888}, []int{888, 889}, []int{889, 890}, []int{890, 891}, []int{891, 892}, []int{892, 893}, []int{893, 894}, []int{894, 895}, []int{895, 896}, []int{896, 897}, []int{897, 898}, []int{898, 899}, []int{899, 900}, []int{900, 901}, []int{901, 902}, []int{902, 903}, []int{903, 904}, []int{904, 905}, []int{905, 906}, []int{906, 907}, []int{907, 908}, []int{908, 909}, []int{909, 910}, []int{910, 911}, []int{911, 912}, []int{912, 913}, []int{913, 914}, []int{914, 915}, []int{915, 916}, []int{916, 917}, []int{917, 918}, []int{918, 919}, []int{919, 920}, []int{920, 921}, []int{921, 922}, []int{922, 923}, []int{923, 924}, []int{924, 925}, []int{925, 926}, []int{926, 927}, []int{927, 928}, []int{928, 929}, []int{929, 930}, []int{930, 931}, []int{931, 932}, []int{932, 933}, []int{933, 934}, []int{934, 935}, []int{935, 936}, []int{936, 937}, []int{937, 938}, []int{938, 939}, []int{939, 940}, []int{940, 941}, []int{941, 942}, []int{942, 943}, []int{943, 944}, []int{944, 945}, []int{945, 946}, []int{946, 947}, []int{947, 948}, []int{948, 949}, []int{949, 950}, []int{950, 951}, []int{951, 952}, []int{952, 953}, []int{953, 954}, []int{954, 955}, []int{955, 956}, []int{956, 957}, []int{957, 958}, []int{958, 959}, []int{959, 960}, []int{960, 961}, []int{961, 962}, []int{962, 963}, []int{963, 964}, []int{964, 965}, []int{965, 966}, []int{966, 967}, []int{967, 968}, []int{968, 969}, []int{969, 970}, []int{970, 971}, []int{971, 972}, []int{972, 973}, []int{973, 974}, []int{974, 975}, []int{975, 976}, []int{976, 977}, []int{977, 978}, []int{978, 979}, []int{979, 980}, []int{980, 981}, []int{981, 982}, []int{982, 983}, []int{983, 984}, []int{984, 985}, []int{985, 986}, []int{986, 987}, []int{987, 988}, []int{988, 989}, []int{989, 990}, []int{990, 991}, []int{991, 992}, []int{992, 993}, []int{993, 994}, []int{994, 995}, []int{995, 996}, []int{996, 997}, []int{997, 998}, []int{998, 999}, []int{999, 1000}, []int{1000, 1001}, []int{1001, 1002}, []int{1002, 1003}, []int{1003, 1004}, []int{1004, 1005}, []int{1005, 1006}, []int{1006, 1007}, []int{1007, 1008}, []int{1008, 1009}, []int{1009, 1010}, []int{1010, 1011}, []int{1011, 1012}, []int{1012, 1013}, []int{1013, 1014}, []int{1014, 1015}, []int{1015, 1016}, []int{1016, 1017}, []int{1017, 1018}, []int{1018, 1019}, []int{1019, 1020}, []int{1020, 1021}, []int{1021, 1022}, []int{1022, 1023}, []int{1023, 1024}, []int{1024, 1025}, []int{1025, 1026}, []int{1026, 1027}, []int{1027, 1028}, []int{1028, 1029}, []int{1029, 1030}, []int{1030, 1031}, []int{1031, 1032}, []int{1032, 1033}, []int{1033, 1034}, []int{1034, 1035}, []int{1035, 1036}, []int{1036, 1037}, []int{1037, 1038}, []int{1038, 1039}, []int{1039, 1040}, []int{1040, 1041}, []int{1041, 1042}, []int{1042, 1043}, []int{1043, 1044}, []int{1044, 1045}, []int{1045, 1046}, []int{1046, 1047}, []int{1047, 1048}, []int{1048, 1049}, []int{1049, 1050}, []int{1050, 1051}, []int{1051, 1052}, []int{1052, 1053}, []int{1053, 1054}, []int{1054, 1055}, []int{1055, 1056}, []int{1056, 1057}, []int{1057, 1058}, []int{1058, 1059}, []int{1059, 1060}, []int{1060, 1061}, []int{1061, 1062}, []int{1062, 1063}, []int{1063, 1064}, []int{1064, 1065}, []int{1065, 1066}, []int{1066, 1067}, []int{1067, 1068}, []int{1068, 1069}, []int{1069, 1070}, []int{1070, 1071}, []int{1071, 1072}, []int{1072, 1073}, []int{1073, 1074}, []int{1074, 1075}, []int{1075, 1076}, []int{1076, 1077}, []int{1077, 1078}, []int{1078, 1079}, []int{1079, 1080}, []int{1080, 1081}, []int{1081, 1082}, []int{1082, 1083}, []int{1083, 1084}, []int{1084, 1085}, []int{1085, 1086}, []int{1086, 1087}, []int{1087, 1088}, []int{1088, 1089}, []int{1089, 1090}, []int{1090, 1091}, []int{1091, 1092}, []int{1092, 1093}, []int{1093, 1094}, []int{1094, 1095}, []int{1095, 1096}, []int{1096, 1097}, []int{1097, 1098}, []int{1098, 1099}, []int{1099, 1100}, []int{1100, 1101}, []int{1101, 1102}, []int{1102, 1103}, []int{1103, 1104}, []int{1104, 1105}, []int{1105, 1106}, []int{1106, 1107}, []int{1107, 1108}, []int{1108, 1109}, []int{1109, 1110}, []int{1110, 1111}, []int{1111, 1112}, []int{1112, 1113}, []int{1113, 1114}, []int{1114, 1115}, []int{1115, 1116}, []int{1116, 1117}, []int{1117, 1118}, []int{1118, 1119}, []int{1119, 1120}, []int{1120, 1121}, []int{1121, 1122}, []int{1122, 1123}, []int{1123, 1124}, []int{1124, 1125}, []int{1125, 1126}, []int{1126, 1127}, []int{1127, 1128}, []int{1128, 1129}, []int{1129, 1130}, []int{1130, 1131}, []int{1131, 1132}, []int{1132, 1133}, []int{1133, 1134}, []int{1134, 1135}, []int{1135, 1136}, []int{1136, 1137}, []int{1137, 1138}, []int{1138, 1139}, []int{1139, 1140}, []int{1140, 1141}, []int{1141, 1142}, []int{1142, 1143}, []int{1143, 1144}, []int{1144, 1145}, []int{1145, 1146}, []int{1146, 1147}, []int{1147, 1148}, []int{1148, 1149}, []int{1149, 1150}, []int{1150, 1151}, []int{1151, 1152}, []int{1152, 1153}, []int{1153, 1154}, []int{1154, 1155}, []int{1155, 1156}, []int{1156, 1157}, []int{1157, 1158}, []int{1158, 1159}, []int{1159, 1160}, []int{1160, 1161}, []int{1161, 1162}, []int{1162, 1163}, []int{1163, 1164}, []int{1164, 1165}, []int{1165, 1166}, []int{1166, 1167}, []int{1167, 1168}, []int{1168, 1169}, []int{1169, 1170}, []int{1170, 1171}, []int{1171, 1172}, []int{1172, 1173}, []int{1173, 1174}, []int{1174, 1175}, []int{1175, 1176}, []int{1176, 1177}, []int{1177, 1178}, []int{1178, 1179}, []int{1179, 1180}, []int{1180, 1181}, []int{1181, 1182}, []int{1182, 1183}, []int{1183, 1184}, []int{1184, 1185}, []int{1185, 1186}, []int{1186, 1187}, []int{1187, 1188}, []int{1188, 1189}, []int{1189, 1190}, []int{1190, 1191}, []int{1191, 1192}, []int{1192, 1193}, []int{1193, 1194}, []int{1194, 1195}, []int{1195, 1196}, []int{1196, 1197}, []int{1197, 1198}, []int{1198, 1199}, []int{1199, 1200}, []int{1200, 1201}, []int{1201, 1202}, []int{1202, 1203}, []int{1203, 1204}, []int{1204, 1205}, []int{1205, 1206}, []int{1206, 1207}, []int{1207, 1208}, []int{1208, 1209}, []int{1209, 1210}, []int{1210, 1211}, []int{1211, 1212}, []int{1212, 1213}, []int{1213, 1214}, []int{1214, 1215}, []int{1215, 1216}, []int{1216, 1217}, []int{1217, 1218}, []int{1218, 1219}, []int{1219, 1220}, []int{1220, 1221}, []int{1221, 1222}, []int{1222, 1223}, []int{1223, 1224}, []int{1224, 1225}, []int{1225, 1226}, []int{1226, 1227}, []int{1227, 1228}, []int{1228, 1229}, []int{1229, 1230}, []int{1230, 1231}, []int{1231, 1232}, []int{1232, 1233}, []int{1233, 1234}, []int{1234, 1235}, []int{1235, 1236}, []int{1236, 1237}, []int{1237, 1238}, []int{1238, 1239}, []int{1239, 1240}, []int{1240, 1241}, []int{1241, 1242}, []int{1242, 1243}, []int{1243, 1244}, []int{1244, 1245}, []int{1245, 1246}, []int{1246, 1247}, []int{1247, 1248}, []int{1248, 1249}, []int{1249, 1250}, []int{1250, 1251}, []int{1251, 1252}, []int{1252, 1253}, []int{1253, 1254}, []int{1254, 1255}, []int{1255, 1256}, []int{1256, 1257}, []int{1257, 1258}, []int{1258, 1259}, []int{1259, 1260}, []int{1260, 1261}, []int{1261, 1262}, []int{1262, 1263}, []int{1263, 1264}, []int{1264, 1265}, []int{1265, 1266}, []int{1266, 1267}, []int{1267, 1268}, []int{1268, 1269}, []int{1269, 1270}, []int{1270, 1271}, []int{1271, 1272}, []int{1272, 1273}, []int{1273, 1274}, []int{1274, 1275}, []int{1275, 1276}, []int{1276, 1277}, []int{1277, 1278}, []int{1278, 1279}, []int{1279, 1280}, []int{1280, 1281}, []int{1281, 1282}, []int{1282, 1283}, []int{1283, 1284}, []int{1284, 1285}, []int{1285, 1286}, []int{1286, 1287}, []int{1287, 1288}, []int{1288, 1289}, []int{1289, 1290}, []int{1290, 1291}, []int{1291, 1292}, []int{1292, 1293}, []int{1293, 1294}, []int{1294, 1295}, []int{1295, 1296}, []int{1296, 1297}, []int{1297, 1298}, []int{1298, 1299}, []int{1299, 1300}, []int{1300, 1301}, []int{1301, 1302}, []int{1302, 1303}, []int{1303, 1304}, []int{1304, 1305}, []int{1305, 1306}, []int{1306, 1307}, []int{1307, 1308}, []int{1308, 1309}, []int{1309, 1310}, []int{1310, 1311}, []int{1311, 1312}, []int{1312, 1313}, []int{1313, 1314}, []int{1314, 1315}, []int{1315, 1316}, []int{1316, 1317}, []int{1317, 1318}, []int{1318, 1319}, []int{1319, 1320}, []int{1320, 1321}, []int{1321, 1322}, []int{1322, 1323}, []int{1323, 1324}, []int{1324, 1325}, []int{1325, 1326}, []int{1326, 1327}, []int{1327, 1328}, []int{1328, 1329}, []int{1329, 1330}, []int{1330, 1331}, []int{1331, 1332}, []int{1332, 1333}, []int{1333, 1334}, []int{1334, 1335}, []int{1335, 1336}, []int{1336, 1337}, []int{1337, 1338}, []int{1338, 1339}, []int{1339, 1340}, []int{1340, 1341}, []int{1341, 1342}, []int{1342, 1343}, []int{1343, 1344}, []int{1344, 1345}, []int{1345, 1346}, []int{1346, 1347}, []int{1347, 1348}, []int{1348, 1349}, []int{1349, 1350}, []int{1350, 1351}, []int{1351, 1352}, []int{1352, 1353}, []int{1353, 1354}, []int{1354, 1355}, []int{1355, 1356}, []int{1356, 1357}, []int{1357, 1358}, []int{1358, 1359}, []int{1359, 1360}, []int{1360, 1361}, []int{1361, 1362}, []int{1362, 1363}, []int{1363, 1364}, []int{1364, 1365}, []int{1365, 1366}, []int{1366, 1367}, []int{1367, 1368}, []int{1368, 1369}, []int{1369, 1370}, []int{1370, 1371}, []int{1371, 1372}, []int{1372, 1373}, []int{1373, 1374}, []int{1374, 1375}, []int{1375, 1376}, []int{1376, 1377}, []int{1377, 1378}, []int{1378, 1379}, []int{1379, 1380}, []int{1380, 1381}, []int{1381, 1382}, []int{1382, 1383}, []int{1383, 1384}, []int{1384, 1385}, []int{1385, 1386}, []int{1386, 1387}, []int{1387, 1388}, []int{1388, 1389}, []int{1389, 1390}, []int{1390, 1391}, []int{1391, 1392}, []int{1392, 1393}, []int{1393, 1394}, []int{1394, 1395}, []int{1395, 1396}, []int{1396, 1397}, []int{1397, 1398}, []int{1398, 1399}, []int{1399, 1400}, []int{1400, 1401}, []int{1401, 1402}, []int{1402, 1403}, []int{1403, 1404}, []int{1404, 1405}, []int{1405, 1406}, []int{1406, 1407}, []int{1407, 1408}, []int{1408, 1409}, []int{1409, 1410}, []int{1410, 1411}, []int{1411, 1412}, []int{1412, 1413}, []int{1413, 1414}, []int{1414, 1415}, []int{1415, 1416}, []int{1416, 1417}, []int{1417, 1418}, []int{1418, 1419}, []int{1419, 1420}, []int{1420, 1421}, []int{1421, 1422}, []int{1422, 1423}, []int{1423, 1424}, []int{1424, 1425}, []int{1425, 1426}, []int{1426, 1427}, []int{1427, 1428}, []int{1428, 1429}, []int{1429, 1430}, []int{1430, 1431}, []int{1431, 1432}, []int{1432, 1433}, []int{1433, 1434}, []int{1434, 1435}, []int{1435, 1436}, []int{1436, 1437}, []int{1437, 1438}, []int{1438, 1439}, []int{1439, 1440}, []int{1440, 1441}, []int{1441, 1442}, []int{1442, 1443}, []int{1443, 1444}, []int{1444, 1445}, []int{1445, 1446}, []int{1446, 1447}, []int{1447, 1448}, []int{1448, 1449}, []int{1449, 1450}, []int{1450, 1451}, []int{1451, 1452}, []int{1452, 1453}, []int{1453, 1454}, []int{1454, 1455}, []int{1455, 1456}, []int{1456, 1457}, []int{1457, 1458}, []int{1458, 1459}, []int{1459, 1460}, []int{1460, 1461}, []int{1461, 1462}, []int{1462, 1463}, []int{1463, 1464}, []int{1464, 1465}, []int{1465, 1466}, []int{1466, 1467}, []int{1467, 1468}, []int{1468, 1469}, []int{1469, 1470}, []int{1470, 1471}, []int{1471, 1472}, []int{1472, 1473}, []int{1473, 1474}, []int{1474, 1475}, []int{1475, 1476}, []int{1476, 1477}, []int{1477, 1478}, []int{1478, 1479}, []int{1479, 1480}, []int{1480, 1481}, []int{1481, 1482}, []int{1482, 1483}, []int{1483, 1484}, []int{1484, 1485}, []int{1485, 1486}, []int{1486, 1487}, []int{1487, 1488}, []int{1488, 1489}, []int{1489, 1490}, []int{1490, 1491}, []int{1491, 1492}, []int{1492, 1493}, []int{1493, 1494}, []int{1494, 1495}, []int{1495, 1496}, []int{1496, 1497}, []int{1497, 1498}, []int{1498, 1499}, []int{1499, 1500}, []int{1500, 1501}, []int{1501, 1502}, []int{1502, 1503}, []int{1503, 1504}, []int{1504, 1505}, []int{1505, 1506}, []int{1506, 1507}, []int{1507, 1508}, []int{1508, 1509}, []int{1509, 1510}, []int{1510, 1511}, []int{1511, 1512}, []int{1512, 1513}, []int{1513, 1514}, []int{1514, 1515}, []int{1515, 1516}, []int{1516, 1517}, []int{1517, 1518}, []int{1518, 1519}, []int{1519, 1520}, []int{1520, 1521}, []int{1521, 1522}, []int{1522, 1523}, []int{1523, 1524}, []int{1524, 1525}, []int{1525, 1526}, []int{1526, 1527}, []int{1527, 1528}, []int{1528, 1529}, []int{1529, 1530}, []int{1530, 1531}, []int{1531, 1532}, []int{1532, 1533}, []int{1533, 1534}, []int{1534, 1535}, []int{1535, 1536}, []int{1536, 1537}, []int{1537, 1538}, []int{1538, 1539}, []int{1539, 1540}, []int{1540, 1541}, []int{1541, 1542}, []int{1542, 1543}, []int{1543, 1544}, []int{1544, 1545}, []int{1545, 1546}, []int{1546, 1547}, []int{1547, 1548}, []int{1548, 1549}, []int{1549, 1550}, []int{1550, 1551}, []int{1551, 1552}, []int{1552, 1553}, []int{1553, 1554}, []int{1554, 1555}, []int{1555, 1556}, []int{1556, 1557}, []int{1557, 1558}, []int{1558, 1559}, []int{1559, 1560}, []int{1560, 1561}, []int{1561, 1562}, []int{1562, 1563}, []int{1563, 1564}, []int{1564, 1565}, []int{1565, 1566}, []int{1566, 1567}, []int{1567, 1568}, []int{1568, 1569}, []int{1569, 1570}, []int{1570, 1571}, []int{1571, 1572}, []int{1572, 1573}, []int{1573, 1574}, []int{1574, 1575}, []int{1575, 1576}, []int{1576, 1577}, []int{1577, 1578}, []int{1578, 1579}, []int{1579, 1580}, []int{1580, 1581}, []int{1581, 1582}, []int{1582, 1583}, []int{1583, 1584}, []int{1584, 1585}, []int{1585, 1586}, []int{1586, 1587}, []int{1587, 1588}, []int{1588, 1589}, []int{1589, 1590}, []int{1590, 1591}, []int{1591, 1592}, []int{1592, 1593}, []int{1593, 1594}, []int{1594, 1595}, []int{1595, 1596}, []int{1596, 1597}, []int{1597, 1598}, []int{1598, 1599}, []int{1599, 1600}, []int{1600, 1601}, []int{1601, 1602}, []int{1602, 1603}, []int{1603, 1604}, []int{1604, 1605}, []int{1605, 1606}, []int{1606, 1607}, []int{1607, 1608}, []int{1608, 1609}, []int{1609, 1610}, []int{1610, 1611}, []int{1611, 1612}, []int{1612, 1613}, []int{1613, 1614}, []int{1614, 1615}, []int{1615, 1616}, []int{1616, 1617}, []int{1617, 1618}, []int{1618, 1619}, []int{1619, 1620}, []int{1620, 1621}, []int{1621, 1622}, []int{1622, 1623}, []int{1623, 1624}, []int{1624, 1625}, []int{1625, 1626}, []int{1626, 1627}, []int{1627, 1628}, []int{1628, 1629}, []int{1629, 1630}, []int{1630, 1631}, []int{1631, 1632}, []int{1632, 1633}, []int{1633, 1634}, []int{1634, 1635}, []int{1635, 1636}, []int{1636, 1637}, []int{1637, 1638}, []int{1638, 1639}, []int{1639, 1640}, []int{1640, 1641}, []int{1641, 1642}, []int{1642, 1643}, []int{1643, 1644}, []int{1644, 1645}, []int{1645, 1646}, []int{1646, 1647}, []int{1647, 1648}, []int{1648, 1649}, []int{1649, 1650}, []int{1650, 1651}, []int{1651, 1652}, []int{1652, 1653}, []int{1653, 1654}, []int{1654, 1655}, []int{1655, 1656}, []int{1656, 1657}, []int{1657, 1658}, []int{1658, 1659}, []int{1659, 1660}, []int{1660, 1661}, []int{1661, 1662}, []int{1662, 1663}, []int{1663, 1664}, []int{1664, 1665}, []int{1665, 1666}, []int{1666, 1667}, []int{1667, 1668}, []int{1668, 1669}, []int{1669, 1670}, []int{1670, 1671}, []int{1671, 1672}, []int{1672, 1673}, []int{1673, 1674}, []int{1674, 1675}, []int{1675, 1676}, []int{1676, 1677}, []int{1677, 1678}, []int{1678, 1679}, []int{1679, 1680}, []int{1680, 1681}, []int{1681, 1682}, []int{1682, 1683}, []int{1683, 1684}, []int{1684, 1685}, []int{1685, 1686}, []int{1686, 1687}, []int{1687, 1688}, []int{1688, 1689}, []int{1689, 1690}, []int{1690, 1691}, []int{1691, 1692}, []int{1692, 1693}, []int{1693, 1694}, []int{1694, 1695}, []int{1695, 1696}, []int{1696, 1697}, []int{1697, 1698}, []int{1698, 1699}, []int{1699, 1700}, []int{1700, 1701}, []int{1701, 1702}, []int{1702, 1703}, []int{1703, 1704}, []int{1704, 1705}, []int{1705, 1706}, []int{1706, 1707}, []int{1707, 1708}, []int{1708, 1709}, []int{1709, 1710}, []int{1710, 1711}, []int{1711, 1712}, []int{1712, 1713}, []int{1713, 1714}, []int{1714, 1715}, []int{1715, 1716}, []int{1716, 1717}, []int{1717, 1718}, []int{1718, 1719}, []int{1719, 1720}, []int{1720, 1721}, []int{1721, 1722}, []int{1722, 1723}, []int{1723, 1724}, []int{1724, 1725}, []int{1725, 1726}, []int{1726, 1727}, []int{1727, 1728}, []int{1728, 1729}, []int{1729, 1730}, []int{1730, 1731}, []int{1731, 1732}, []int{1732, 1733}, []int{1733, 1734}, []int{1734, 1735}, []int{1735, 1736}, []int{1736, 1737}, []int{1737, 1738}, []int{1738, 1739}, []int{1739, 1740}, []int{1740, 1741}, []int{1741, 1742}, []int{1742, 1743}, []int{1743, 1744}, []int{1744, 1745}, []int{1745, 1746}, []int{1746, 1747}, []int{1747, 1748}, []int{1748, 1749}, []int{1749, 1750}, []int{1750, 1751}, []int{1751, 1752}, []int{1752, 1753}, []int{1753, 1754}, []int{1754, 1755}, []int{1755, 1756}, []int{1756, 1757}, []int{1757, 1758}, []int{1758, 1759}, []int{1759, 1760}, []int{1760, 1761}, []int{1761, 1762}, []int{1762, 1763}, []int{1763, 1764}, []int{1764, 1765}, []int{1765, 1766}, []int{1766, 1767}, []int{1767, 1768}, []int{1768, 1769}, []int{1769, 1770}, []int{1770, 1771}, []int{1771, 1772}, []int{1772, 1773}, []int{1773, 1774}, []int{1774, 1775}, []int{1775, 1776}, []int{1776, 1777}, []int{1777, 1778}, []int{1778, 1779}, []int{1779, 1780}, []int{1780, 1781}, []int{1781, 1782}, []int{1782, 1783}, []int{1783, 1784}, []int{1784, 1785}, []int{1785, 1786}, []int{1786, 1787}, []int{1787, 1788}, []int{1788, 1789}, []int{1789, 1790}, []int{1790, 1791}, []int{1791, 1792}, []int{1792, 1793}, []int{1793, 1794}, []int{1794, 1795}, []int{1795, 1796}, []int{1796, 1797}, []int{1797, 1798}, []int{1798, 1799}, []int{1799, 1800}, []int{1800, 1801}, []int{1801, 1802}, []int{1802, 1803}, []int{1803, 1804}, []int{1804, 1805}, []int{1805, 1806}, []int{1806, 1807}, []int{1807, 1808}, []int{1808, 1809}, []int{1809, 1810}, []int{1810, 1811}, []int{1811, 1812}, []int{1812, 1813}, []int{1813, 1814}, []int{1814, 1815}, []int{1815, 1816}, []int{1816, 1817}, []int{1817, 1818}, []int{1818, 1819}, []int{1819, 1820}, []int{1820, 1821}, []int{1821, 1822}, []int{1822, 1823}, []int{1823, 1824}, []int{1824, 1825}, []int{1825, 1826}, []int{1826, 1827}, []int{1827, 1828}, []int{1828, 1829}, []int{1829, 1830}, []int{1830, 1831}, []int{1831, 1832}, []int{1832, 1833}, []int{1833, 1834}, []int{1834, 1835}, []int{1835, 1836}, []int{1836, 1837}, []int{1837, 1838}, []int{1838, 1839}, []int{1839, 1840}, []int{1840, 1841}, []int{1841, 1842}, []int{1842, 1843}, []int{1843, 1844}, []int{1844, 1845}, []int{1845, 1846}, []int{1846, 1847}, []int{1847, 1848}, []int{1848, 1849}, []int{1849, 1850}, []int{1850, 1851}, []int{1851, 1852}, []int{1852, 1853}, []int{1853, 1854}, []int{1854, 1855}, []int{1855, 1856}, []int{1856, 1857}, []int{1857, 1858}, []int{1858, 1859}, []int{1859, 1860}, []int{1860, 1861}, []int{1861, 1862}, []int{1862, 1863}, []int{1863, 1864}, []int{1864, 1865}, []int{1865, 1866}, []int{1866, 1867}, []int{1867, 1868}, []int{1868, 1869}, []int{1869, 1870}, []int{1870, 1871}, []int{1871, 1872}, []int{1872, 1873}, []int{1873, 1874}, []int{1874, 1875}, []int{1875, 1876}, []int{1876, 1877}, []int{1877, 1878}, []int{1878, 1879}, []int{1879, 1880}, []int{1880, 1881}, []int{1881, 1882}, []int{1882, 1883}, []int{1883, 1884}, []int{1884, 1885}, []int{1885, 1886}, []int{1886, 1887}, []int{1887, 1888}, []int{1888, 1889}, []int{1889, 1890}, []int{1890, 1891}, []int{1891, 1892}, []int{1892, 1893}, []int{1893, 1894}, []int{1894, 1895}, []int{1895, 1896}, []int{1896, 1897}, []int{1897, 1898}, []int{1898, 1899}, []int{1899, 1900}, []int{1900, 1901}, []int{1901, 1902}, []int{1902, 1903}, []int{1903, 1904}, []int{1904, 1905}, []int{1905, 1906}, []int{1906, 1907}, []int{1907, 1908}, []int{1908, 1909}, []int{1909, 1910}, []int{1910, 1911}, []int{1911, 1912}, []int{1912, 1913}, []int{1913, 1914}, []int{1914, 1915}, []int{1915, 1916}, []int{1916, 1917}, []int{1917, 1918}, []int{1918, 1919}, []int{1919, 1920}, []int{1920, 1921}, []int{1921, 1922}, []int{1922, 1923}, []int{1923, 1924}, []int{1924, 1925}, []int{1925, 1926}, []int{1926, 1927}, []int{1927, 1928}, []int{1928, 1929}, []int{1929, 1930}, []int{1930, 1931}, []int{1931, 1932}, []int{1932, 1933}, []int{1933, 1934}, []int{1934, 1935}, []int{1935, 1936}, []int{1936, 1937}, []int{1937, 1938}, []int{1938, 1939}, []int{1939, 1940}, []int{1940, 1941}, []int{1941, 1942}, []int{1942, 1943}, []int{1943, 1944}, []int{1944, 1945}, []int{1945, 1946}, []int{1946, 1947}, []int{1947, 1948}, []int{1948, 1949}, []int{1949, 1950}, []int{1950, 1951}, []int{1951, 1952}, []int{1952, 1953}, []int{1953, 1954}, []int{1954, 1955}, []int{1955, 1956}, []int{1956, 1957}, []int{1957, 1958}, []int{1958, 1959}, []int{1959, 1960}, []int{1960, 1961}, []int{1961, 1962}, []int{1962, 1963}, []int{1963, 1964}, []int{1964, 1965}, []int{1965, 1966}, []int{1966, 1967}, []int{1967, 1968}, []int{1968, 1969}, []int{1969, 1970}, []int{1970, 1971}, []int{1971, 1972}, []int{1972, 1973}, []int{1973, 1974}, []int{1974, 1975}, []int{1975, 1976}, []int{1976, 1977}, []int{1977, 1978}, []int{1978, 1979}, []int{1979, 1980}, []int{1980, 1981}, []int{1981, 1982}, []int{1982, 1983}, []int{1983, 1984}, []int{1984, 1985}, []int{1985, 1986}, []int{1986, 1987}, []int{1987, 1988}, []int{1988, 1989}, []int{1989, 1990}, []int{1990, 1991}, []int{1991, 1992}, []int{1992, 1993}, []int{1993, 1994}, []int{1994, 1995}, []int{1995, 1996}, []int{1996, 1997}, []int{1997, 1998}, []int{1998, 1999}, []int{1999, 2000}, []int{2000, 2001}, []int{2001, 2002}, []int{2002, 2003}, []int{2003, 2004}, []int{2004, 2005}, []int{2005, 2006}, []int{2006, 2007}, []int{2007, 2008}, []int{2008, 2009}, []int{2009, 2010}, []int{2010, 2011}, []int{2011, 2012}, []int{2012, 2013}, []int{2013, 2014}, []int{2014, 2015}, []int{2015, 2016}, []int{2016, 2017}, []int{2017, 2018}, []int{2018, 2019}, []int{2019, 2020}, []int{2020, 2021}, []int{2021, 2022}, []int{2022, 2023}, []int{2023, 2024}, []int{2024, 2025}, []int{2025, 2026}, []int{2026, 2027}, []int{2027, 2028}, []int{2028, 2029}, []int{2029, 2030}, []int{2030, 2031}, []int{2031, 2032}, []int{2032, 2033}, []int{2033, 2034}, []int{2034, 2035}, []int{2035, 2036}, []int{2036, 2037}, []int{2037, 2038}, []int{2038, 2039}, []int{2039, 2040}, []int{2040, 2041}, []int{2041, 2042}, []int{2042, 2043}, []int{2043, 2044}, []int{2044, 2045}, []int{2045, 2046}, []int{2046, 2047}, []int{2047, 2048}, []int{2048, 2049}, []int{2049, 2050}, []int{2050, 2051}, []int{2051, 2052}, []int{2052, 2053}, []int{2053, 2054}, []int{2054, 2055}, []int{2055, 2056}, []int{2056, 2057}, []int{2057, 2058}, []int{2058, 2059}, []int{2059, 2060}, []int{2060, 2061}, []int{2061, 2062}, []int{2062, 2063}, []int{2063, 2064}, []int{2064, 2065}, []int{2065, 2066}, []int{2066, 2067}, []int{2067, 2068}, []int{2068, 2069}, []int{2069, 2070}, []int{2070, 2071}, []int{2071, 2072}, []int{2072, 2073}, []int{2073, 2074}, []int{2074, 2075}, []int{2075, 2076}, []int{2076, 2077}, []int{2077, 2078}, []int{2078, 2079}, []int{2079, 2080}, []int{2080, 2081}, []int{2081, 2082}, []int{2082, 2083}, []int{2083, 2084}, []int{2084, 2085}, []int{2085, 2086}, []int{2086, 2087}, []int{2087, 2088}, []int{2088, 2089}, []int{2089, 2090}, []int{2090, 2091}, []int{2091, 2092}, []int{2092, 2093}, []int{2093, 2094}, []int{2094, 2095}, []int{2095, 2096}, []int{2096, 2097}, []int{2097, 2098}, []int{2098, 2099}, []int{2099, 2100}, []int{2100, 2101}, []int{2101, 2102}, []int{2102, 2103}, []int{2103, 2104}, []int{2104, 2105}, []int{2105, 2106}, []int{2106, 2107}, []int{2107, 2108}, []int{2108, 2109}, []int{2109, 2110}, []int{2110, 2111}, []int{2111, 2112}, []int{2112, 2113}, []int{2113, 2114}, []int{2114, 2115}, []int{2115, 2116}, []int{2116, 2117}, []int{2117, 2118}, []int{2118, 2119}, []int{2119, 2120}, []int{2120, 2121}, []int{2121, 2122}, []int{2122, 2123}, []int{2123, 2124}, []int{2124, 2125}, []int{2125, 2126}, []int{2126, 2127}, []int{2127, 2128}, []int{2128, 2129}, []int{2129, 2130}, []int{2130, 2131}, []int{2131, 2132}, []int{2132, 2133}, []int{2133, 2134}, []int{2134, 2135}, []int{2135, 2136}, []int{2136, 2137}, []int{2137, 2138}, []int{2138, 2139}, []int{2139, 2140}, []int{2140, 2141}, []int{2141, 2142}, []int{2142, 2143}, []int{2143, 2144}, []int{2144, 2145}, []int{2145, 2146}, []int{2146, 2147}, []int{2147, 2148}, []int{2148, 2149}, []int{2149, 2150}, []int{2150, 2151}, []int{2151, 2152}, []int{2152, 2153}, []int{2153, 2154}, []int{2154, 2155}, []int{2155, 2156}, []int{2156, 2157}, []int{2157, 2158}, []int{2158, 2159}, []int{2159, 2160}, []int{2160, 2161}, []int{2161, 2162}, []int{2162, 2163}, []int{2163, 2164}, []int{2164, 2165}, []int{2165, 2166}, []int{2166, 2167}, []int{2167, 2168}, []int{2168, 2169}, []int{2169, 2170}, []int{2170, 2171}, []int{2171, 2172}, []int{2172, 2173}, []int{2173, 2174}, []int{2174, 2175}, []int{2175, 2176}, []int{2176, 2177}, []int{2177, 2178}, []int{2178, 2179}, []int{2179, 2180}, []int{2180, 2181}, []int{2181, 2182}, []int{2182, 2183}, []int{2183, 2184}, []int{2184, 2185}, []int{2185, 2186}, []int{2186, 2187}, []int{2187, 2188}, []int{2188, 2189}, []int{2189, 2190}, []int{2190, 2191}, []int{2191, 2192}, []int{2192, 2193}, []int{2193, 2194}, []int{2194, 2195}, []int{2195, 2196}, []int{2196, 2197}, []int{2197, 2198}, []int{2198, 2199}, []int{2199, 2200}, []int{2200, 2201}, []int{2201, 2202}, []int{2202, 2203}, []int{2203, 2204}, []int{2204, 2205}, []int{2205, 2206}, []int{2206, 2207}, []int{2207, 2208}, []int{2208, 2209}, []int{2209, 2210}, []int{2210, 2211}, []int{2211, 2212}, []int{2212, 2213}, []int{2213, 2214}, []int{2214, 2215}, []int{2215, 2216}, []int{2216, 2217}, []int{2217, 2218}, []int{2218, 2219}, []int{2219, 2220}, []int{2220, 2221}, []int{2221, 2222}, []int{2222, 2223}, []int{2223, 2224}, []int{2224, 2225}, []int{2225, 2226}, []int{2226, 2227}, []int{2227, 2228}, []int{2228, 2229}, []int{2229, 2230}, []int{2230, 2231}, []int{2231, 2232}, []int{2232, 2233}, []int{2233, 2234}, []int{2234, 2235}, []int{2235, 2236}, []int{2236, 2237}, []int{2237, 2238}, []int{2238, 2239}, []int{2239, 2240}, []int{2240, 2241}, []int{2241, 2242}, []int{2242, 2243}, []int{2243, 2244}, []int{2244, 2245}, []int{2245, 2246}, []int{2246, 2247}, []int{2247, 2248}, []int{2248, 2249}, []int{2249, 2250}, []int{2250, 2251}, []int{2251, 2252}, []int{2252, 2253}, []int{2253, 2254}, []int{2254, 2255}, []int{2255, 2256}, []int{2256, 2257}, []int{2257, 2258}, []int{2258, 2259}, []int{2259, 2260}, []int{2260, 2261}, []int{2261, 2262}, []int{2262, 2263}, []int{2263, 2264}, []int{2264, 2265}, []int{2265, 2266}, []int{2266, 2267}, []int{2267, 2268}, []int{2268, 2269}, []int{2269, 2270}, []int{2270, 2271}, []int{2271, 2272}, []int{2272, 2273}, []int{2273, 2274}, []int{2274, 2275}, []int{2275, 2276}, []int{2276, 2277}, []int{2277, 2278}, []int{2278, 2279}, []int{2279, 2280}, []int{2280, 2281}, []int{2281, 2282}, []int{2282, 2283}, []int{2283, 2284}, []int{2284, 2285}, []int{2285, 2286}, []int{2286, 2287}, []int{2287, 2288}, []int{2288, 2289}, []int{2289, 2290}, []int{2290, 2291}, []int{2291, 2292}, []int{2292, 2293}, []int{2293, 2294}, []int{2294, 2295}, []int{2295, 2296}, []int{2296, 2297}, []int{2297, 2298}, []int{2298, 2299}, []int{2299, 2300}, []int{2300, 2301}, []int{2301, 2302}, []int{2302, 2303}, []int{2303, 2304}, []int{2304, 2305}, []int{2305, 2306}, []int{2306, 2307}, []int{2307, 2308}, []int{2308, 2309}, []int{2309, 2310}, []int{2310, 2311}, []int{2311, 2312}, []int{2312, 2313}, []int{2313, 2314}, []int{2314, 2315}, []int{2315, 2316}, []int{2316, 2317}, []int{2317, 2318}, []int{2318, 2319}, []int{2319, 2320}, []int{2320, 2321}, []int{2321, 2322}, []int{2322, 2323}, []int{2323, 2324}, []int{2324, 2325}, []int{2325, 2326}, []int{2326, 2327}, []int{2327, 2328}, []int{2328, 2329}, []int{2329, 2330}, []int{2330, 2331}, []int{2331, 2332}, []int{2332, 2333}, []int{2333, 2334}, []int{2334, 2335}, []int{2335, 2336}, []int{2336, 2337}, []int{2337, 2338}, []int{2338, 2339}, []int{2339, 2340}, []int{2340, 2341}, []int{2341, 2342}, []int{2342, 2343}, []int{2343, 2344}, []int{2344, 2345}, []int{2345, 2346}, []int{2346, 2347}, []int{2347, 2348}, []int{2348, 2349}, []int{2349, 2350}, []int{2350, 2351}, []int{2351, 2352}, []int{2352, 2353}, []int{2353, 2354}, []int{2354, 2355}, []int{2355, 2356}, []int{2356, 2357}, []int{2357, 2358}, []int{2358, 2359}, []int{2359, 2360}, []int{2360, 2361}, []int{2361, 2362}, []int{2362, 2363}, []int{2363, 2364}, []int{2364, 2365}, []int{2365, 2366}, []int{2366, 2367}, []int{2367, 2368}, []int{2368, 2369}, []int{2369, 2370}, []int{2370, 2371}, []int{2371, 2372}, []int{2372, 2373}, []int{2373, 2374}, []int{2374, 2375}, []int{2375, 2376}, []int{2376, 2377}, []int{2377, 2378}, []int{2378, 2379}, []int{2379, 2380}, []int{2380, 2381}, []int{2381, 2382}, []int{2382, 2383}, []int{2383, 2384}, []int{2384, 2385}, []int{2385, 2386}, []int{2386, 2387}, []int{2387, 2388}, []int{2388, 2389}, []int{2389, 2390}, []int{2390, 2391}, []int{2391, 2392}, []int{2392, 2393}, []int{2393, 2394}, []int{2394, 2395}, []int{2395, 2396}, []int{2396, 2397}, []int{2397, 2398}, []int{2398, 2399}, []int{2399, 2400}, []int{2400, 2401}, []int{2401, 2402}, []int{2402, 2403}, []int{2403, 2404}, []int{2404, 2405}, []int{2405, 2406}, []int{2406, 2407}, []int{2407, 2408}, []int{2408, 2409}, []int{2409, 2410}, []int{2410, 2411}, []int{2411, 2412}, []int{2412, 2413}, []int{2413, 2414}, []int{2414, 2415}, []int{2415, 2416}, []int{2416, 2417}, []int{2417, 2418}, []int{2418, 2419}, []int{2419, 2420}, []int{2420, 2421}, []int{2421, 2422}, []int{2422, 2423}, []int{2423, 2424}, []int{2424, 2425}, []int{2425, 2426}, []int{2426, 2427}, []int{2427, 2428}, []int{2428, 2429}, []int{2429, 2430}, []int{2430, 2431}, []int{2431, 2432}, []int{2432, 2433}, []int{2433, 2434}, []int{2434, 2435}, []int{2435, 2436}, []int{2436, 2437}, []int{2437, 2438}, []int{2438, 2439}, []int{2439, 2440}, []int{2440, 2441}, []int{2441, 2442}, []int{2442, 2443}, []int{2443, 2444}, []int{2444, 2445}, []int{2445, 2446}, []int{2446, 2447}, []int{2447, 2448}, []int{2448, 2449}, []int{2449, 2450}, []int{2450, 2451}, []int{2451, 2452}, []int{2452, 2453}, []int{2453, 2454}, []int{2454, 2455}, []int{2455, 2456}, []int{2456, 2457}, []int{2457, 2458}, []int{2458, 2459}, []int{2459, 2460}, []int{2460, 2461}, []int{2461, 2462}, []int{2462, 2463}, []int{2463, 2464}, []int{2464, 2465}, []int{2465, 2466}, []int{2466, 2467}, []int{2467, 2468}, []int{2468, 2469}, []int{2469, 2470}, []int{2470, 2471}, []int{2471, 2472}, []int{2472, 2473}, []int{2473, 2474}, []int{2474, 2475}, []int{2475, 2476}, []int{2476, 2477}, []int{2477, 2478}, []int{2478, 2479}, []int{2479, 2480}, []int{2480, 2481}, []int{2481, 2482}, []int{2482, 2483}, []int{2483, 2484}, []int{2484, 2485}, []int{2485, 2486}, []int{2486, 2487}, []int{2487, 2488}, []int{2488, 2489}, []int{2489, 2490}, []int{2490, 2491}, []int{2491, 2492}, []int{2492, 2493}, []int{2493, 2494}, []int{2494, 2495}, []int{2495, 2496}, []int{2496, 2497}, []int{2497, 2498}, []int{2498, 2499}, []int{2499, 2500}, []int{2500, 2501}, []int{2501, 2502}, []int{2502, 2503}, []int{2503, 2504}, []int{2504, 2505}, []int{2505, 2506}, []int{2506, 2507}, []int{2507, 2508}, []int{2508, 2509}, []int{2509, 2510}, []int{2510, 2511}, []int{2511, 2512}, []int{2512, 2513}, []int{2513, 2514}, []int{2514, 2515}, []int{2515, 2516}, []int{2516, 2517}, []int{2517, 2518}, []int{2518, 2519}, []int{2519, 2520}, []int{2520, 2521}, []int{2521, 2522}, []int{2522, 2523}, []int{2523, 2524}, []int{2524, 2525}, []int{2525, 2526}, []int{2526, 2527}, []int{2527, 2528}, []int{2528, 2529}, []int{2529, 2530}, []int{2530, 2531}, []int{2531, 2532}, []int{2532, 2533}, []int{2533, 2534}, []int{2534, 2535}, []int{2535, 2536}, []int{2536, 2537}, []int{2537, 2538}, []int{2538, 2539}, []int{2539, 2540}, []int{2540, 2541}, []int{2541, 2542}, []int{2542, 2543}, []int{2543, 2544}, []int{2544, 2545}, []int{2545, 2546}, []int{2546, 2547}, []int{2547, 2548}, []int{2548, 2549}, []int{2549, 2550}, []int{2550, 2551}, []int{2551, 2552}, []int{2552, 2553}, []int{2553, 2554}, []int{2554, 2555}, []int{2555, 2556}, []int{2556, 2557}, []int{2557, 2558}, []int{2558, 2559}, []int{2559, 2560}, []int{2560, 2561}, []int{2561, 2562}, []int{2562, 2563}, []int{2563, 2564}, []int{2564, 2565}, []int{2565, 2566}, []int{2566, 2567}, []int{2567, 2568}, []int{2568, 2569}, []int{2569, 2570}, []int{2570, 2571}, []int{2571, 2572}, []int{2572, 2573}, []int{2573, 2574}, []int{2574, 2575}, []int{2575, 2576}, []int{2576, 2577}, []int{2577, 2578}, []int{2578, 2579}, []int{2579, 2580}, []int{2580, 2581}, []int{2581, 2582}, []int{2582, 2583}, []int{2583, 2584}, []int{2584, 2585}, []int{2585, 2586}, []int{2586, 2587}, []int{2587, 2588}, []int{2588, 2589}, []int{2589, 2590}, []int{2590, 2591}, []int{2591, 2592}, []int{2592, 2593}, []int{2593, 2594}, []int{2594, 2595}, []int{2595, 2596}, []int{2596, 2597}, []int{2597, 2598}, []int{2598, 2599}, []int{2599, 2600}, []int{2600, 2601}, []int{2601, 2602}, []int{2602, 2603}, []int{2603, 2604}, []int{2604, 2605}, []int{2605, 2606}, []int{2606, 2607}, []int{2607, 2608}, []int{2608, 2609}, []int{2609, 2610}, []int{2610, 2611}, []int{2611, 2612}, []int{2612, 2613}, []int{2613, 2614}, []int{2614, 2615}, []int{2615, 2616}, []int{2616, 2617}, []int{2617, 2618}, []int{2618, 2619}, []int{2619, 2620}, []int{2620, 2621}, []int{2621, 2622}, []int{2622, 2623}, []int{2623, 2624}, []int{2624, 2625}, []int{2625, 2626}, []int{2626, 2627}, []int{2627, 2628}, []int{2628, 2629}, []int{2629, 2630}, []int{2630, 2631}, []int{2631, 2632}, []int{2632, 2633}, []int{2633, 2634}, []int{2634, 2635}, []int{2635, 2636}, []int{2636, 2637}, []int{2637, 2638}, []int{2638, 2639}, []int{2639, 2640}, []int{2640, 2641}, []int{2641, 2642}, []int{2642, 2643}, []int{2643, 2644}, []int{2644, 2645}, []int{2645, 2646}, []int{2646, 2647}, []int{2647, 2648}, []int{2648, 2649}, []int{2649, 2650}, []int{2650, 2651}, []int{2651, 2652}, []int{2652, 2653}, []int{2653, 2654}, []int{2654, 2655}, []int{2655, 2656}, []int{2656, 2657}, []int{2657, 2658}, []int{2658, 2659}, []int{2659, 2660}, []int{2660, 2661}, []int{2661, 2662}, []int{2662, 2663}, []int{2663, 2664}, []int{2664, 2665}, []int{2665, 2666}, []int{2666, 2667}, []int{2667, 2668}, []int{2668, 2669}, []int{2669, 2670}, []int{2670, 2671}, []int{2671, 2672}, []int{2672, 2673}, []int{2673, 2674}, []int{2674, 2675}, []int{2675, 2676}, []int{2676, 2677}, []int{2677, 2678}, []int{2678, 2679}, []int{2679, 2680}, []int{2680, 2681}, []int{2681, 2682}, []int{2682, 2683}, []int{2683, 2684}, []int{2684, 2685}, []int{2685, 2686}, []int{2686, 2687}, []int{2687, 2688}, []int{2688, 2689}, []int{2689, 2690}, []int{2690, 2691}, []int{2691, 2692}, []int{2692, 2693}, []int{2693, 2694}, []int{2694, 2695}, []int{2695, 2696}, []int{2696, 2697}, []int{2697, 2698}, []int{2698, 2699}, []int{2699, 2700}, []int{2700, 2701}, []int{2701, 2702}, []int{2702, 2703}, []int{2703, 2704}, []int{2704, 2705}, []int{2705, 2706}, []int{2706, 2707}, []int{2707, 2708}, []int{2708, 2709}, []int{2709, 2710}, []int{2710, 2711}, []int{2711, 2712}, []int{2712, 2713}, []int{2713, 2714}, []int{2714, 2715}, []int{2715, 2716}, []int{2716, 2717}, []int{2717, 2718}, []int{2718, 2719}, []int{2719, 2720}, []int{2720, 2721}, []int{2721, 2722}, []int{2722, 2723}, []int{2723, 2724}, []int{2724, 2725}, []int{2725, 2726}, []int{2726, 2727}, []int{2727, 2728}, []int{2728, 2729}, []int{2729, 2730}, []int{2730, 2731}, []int{2731, 2732}, []int{2732, 2733}, []int{2733, 2734}, []int{2734, 2735}, []int{2735, 2736}, []int{2736, 2737}, []int{2737, 2738}, []int{2738, 2739}, []int{2739, 2740}, []int{2740, 2741}, []int{2741, 2742}, []int{2742, 2743}, []int{2743, 2744}, []int{2744, 2745}, []int{2745, 2746}, []int{2746, 2747}, []int{2747, 2748}, []int{2748, 2749}, []int{2749, 2750}, []int{2750, 2751}, []int{2751, 2752}, []int{2752, 2753}, []int{2753, 2754}, []int{2754, 2755}, []int{2755, 2756}, []int{2756, 2757}, []int{2757, 2758}, []int{2758, 2759}, []int{2759, 2760}, []int{2760, 2761}, []int{2761, 2762}, []int{2762, 2763}, []int{2763, 2764}, []int{2764, 2765}, []int{2765, 2766}, []int{2766, 2767}, []int{2767, 2768}, []int{2768, 2769}, []int{2769, 2770}, []int{2770, 2771}, []int{2771, 2772}, []int{2772, 2773}, []int{2773, 2774}, []int{2774, 2775}, []int{2775, 2776}, []int{2776, 2777}, []int{2777, 2778}, []int{2778, 2779}, []int{2779, 2780}, []int{2780, 2781}, []int{2781, 2782}, []int{2782, 2783}, []int{2783, 2784}, []int{2784, 2785}, []int{2785, 2786}, []int{2786, 2787}, []int{2787, 2788}, []int{2788, 2789}, []int{2789, 2790}, []int{2790, 2791}, []int{2791, 2792}, []int{2792, 2793}, []int{2793, 2794}, []int{2794, 2795}, []int{2795, 2796}, []int{2796, 2797}, []int{2797, 2798}, []int{2798, 2799}, []int{2799, 2800}, []int{2800, 2801}, []int{2801, 2802}, []int{2802, 2803}, []int{2803, 2804}, []int{2804, 2805}, []int{2805, 2806}, []int{2806, 2807}, []int{2807, 2808}, []int{2808, 2809}, []int{2809, 2810}, []int{2810, 2811}, []int{2811, 2812}, []int{2812, 2813}, []int{2813, 2814}, []int{2814, 2815}, []int{2815, 2816}, []int{2816, 2817}, []int{2817, 2818}, []int{2818, 2819}, []int{2819, 2820}, []int{2820, 2821}, []int{2821, 2822}, []int{2822, 2823}, []int{2823, 2824}, []int{2824, 2825}, []int{2825, 2826}, []int{2826, 2827}, []int{2827, 2828}, []int{2828, 2829}, []int{2829, 2830}, []int{2830, 2831}, []int{2831, 2832}, []int{2832, 2833}, []int{2833, 2834}, []int{2834, 2835}, []int{2835, 2836}, []int{2836, 2837}, []int{2837, 2838}, []int{2838, 2839}, []int{2839, 2840}, []int{2840, 2841}, []int{2841, 2842}, []int{2842, 2843}, []int{2843, 2844}, []int{2844, 2845}, []int{2845, 2846}, []int{2846, 2847}, []int{2847, 2848}, []int{2848, 2849}, []int{2849, 2850}, []int{2850, 2851}, []int{2851, 2852}, []int{2852, 2853}, []int{2853, 2854}, []int{2854, 2855}, []int{2855, 2856}, []int{2856, 2857}, []int{2857, 2858}, []int{2858, 2859}, []int{2859, 2860}, []int{2860, 2861}, []int{2861, 2862}, []int{2862, 2863}, []int{2863, 2864}, []int{2864, 2865}, []int{2865, 2866}, []int{2866, 2867}, []int{2867, 2868}, []int{2868, 2869}, []int{2869, 2870}, []int{2870, 2871}, []int{2871, 2872}, []int{2872, 2873}, []int{2873, 2874}, []int{2874, 2875}, []int{2875, 2876}, []int{2876, 2877}, []int{2877, 2878}, []int{2878, 2879}, []int{2879, 2880}, []int{2880, 2881}, []int{2881, 2882}, []int{2882, 2883}, []int{2883, 2884}, []int{2884, 2885}, []int{2885, 2886}, []int{2886, 2887}, []int{2887, 2888}, []int{2888, 2889}, []int{2889, 2890}, []int{2890, 2891}, []int{2891, 2892}, []int{2892, 2893}, []int{2893, 2894}, []int{2894, 2895}, []int{2895, 2896}, []int{2896, 2897}, []int{2897, 2898}, []int{2898, 2899}, []int{2899, 2900}, []int{2900, 2901}, []int{2901, 2902}, []int{2902, 2903}, []int{2903, 2904}, []int{2904, 2905}, []int{2905, 2906}, []int{2906, 2907}, []int{2907, 2908}, []int{2908, 2909}, []int{2909, 2910}, []int{2910, 2911}, []int{2911, 2912}, []int{2912, 2913}, []int{2913, 2914}, []int{2914, 2915}, []int{2915, 2916}, []int{2916, 2917}, []int{2917, 2918}, []int{2918, 2919}, []int{2919, 2920}, []int{2920, 2921}, []int{2921, 2922}, []int{2922, 2923}, []int{2923, 2924}, []int{2924, 2925}, []int{2925, 2926}, []int{2926, 2927}, []int{2927, 2928}, []int{2928, 2929}, []int{2929, 2930}, []int{2930, 2931}, []int{2931, 2932}, []int{2932, 2933}, []int{2933, 2934}, []int{2934, 2935}, []int{2935, 2936}, []int{2936, 2937}, []int{2937, 2938}, []int{2938, 2939}, []int{2939, 2940}, []int{2940, 2941}, []int{2941, 2942}, []int{2942, 2943}, []int{2943, 2944}, []int{2944, 2945}, []int{2945, 2946}, []int{2946, 2947}, []int{2947, 2948}, []int{2948, 2949}, []int{2949, 2950}, []int{2950, 2951}, []int{2951, 2952}, []int{2952, 2953}, []int{2953, 2954}, []int{2954, 2955}, []int{2955, 2956}, []int{2956, 2957}, []int{2957, 2958}, []int{2958, 2959}, []int{2959, 2960}, []int{2960, 2961}, []int{2961, 2962}, []int{2962, 2963}, []int{2963, 2964}, []int{2964, 2965}, []int{2965, 2966}, []int{2966, 2967}, []int{2967, 2968}, []int{2968, 2969}, []int{2969, 2970}, []int{2970, 2971}, []int{2971, 2972}, []int{2972, 2973}, []int{2973, 2974}, []int{2974, 2975}, []int{2975, 2976}, []int{2976, 2977}, []int{2977, 2978}, []int{2978, 2979}, []int{2979, 2980}, []int{2980, 2981}, []int{2981, 2982}, []int{2982, 2983}, []int{2983, 2984}, []int{2984, 2985}, []int{2985, 2986}, []int{2986, 2987}, []int{2987, 2988}, []int{2988, 2989}, []int{2989, 2990}, []int{2990, 2991}, []int{2991, 2992}, []int{2992, 2993}, []int{2993, 2994}, []int{2994, 2995}, []int{2995, 2996}, []int{2996, 2997}, []int{2997, 2998}, []int{2998, 2999}, []int{2999, 3000}, []int{3000, 3001}, []int{3001, 3002}, []int{3002, 3003}, []int{3003, 3004}, []int{3004, 3005}, []int{3005, 3006}, []int{3006, 3007}, []int{3007, 3008}, []int{3008, 3009}, []int{3009, 3010}, []int{3010, 3011}, []int{3011, 3012}, []int{3012, 3013}, []int{3013, 3014}, []int{3014, 3015}, []int{3015, 3016}, []int{3016, 3017}, []int{3017, 3018}, []int{3018, 3019}, []int{3019, 3020}, []int{3020, 3021}, []int{3021, 3022}, []int{3022, 3023}, []int{3023, 3024}, []int{3024, 3025}, []int{3025, 3026}, []int{3026, 3027}, []int{3027, 3028}, []int{3028, 3029}, []int{3029, 3030}, []int{3030, 3031}, []int{3031, 3032}, []int{3032, 3033}, []int{3033, 3034}, []int{3034, 3035}, []int{3035, 3036}, []int{3036, 3037}, []int{3037, 3038}, []int{3038, 3039}, []int{3039, 3040}, []int{3040, 3041}, []int{3041, 3042}, []int{3042, 3043}, []int{3043, 3044}, []int{3044, 3045}, []int{3045, 3046}, []int{3046, 3047}, []int{3047, 3048}, []int{3048, 3049}, []int{3049, 3050}, []int{3050, 3051}, []int{3051, 3052}, []int{3052, 3053}, []int{3053, 3054}, []int{3054, 3055}, []int{3055, 3056}, []int{3056, 3057}, []int{3057, 3058}, []int{3058, 3059}, []int{3059, 3060}, []int{3060, 3061}, []int{3061, 3062}, []int{3062, 3063}, []int{3063, 3064}, []int{3064, 3065}, []int{3065, 3066}, []int{3066, 3067}, []int{3067, 3068}, []int{3068, 3069}, []int{3069, 3070}, []int{3070, 3071}, []int{3071, 3072}, []int{3072, 3073}, []int{3073, 3074}, []int{3074, 3075}, []int{3075, 3076}, []int{3076, 3077}, []int{3077, 3078}, []int{3078, 3079}, []int{3079, 3080}, []int{3080, 3081}, []int{3081, 3082}, []int{3082, 3083}, []int{3083, 3084}, []int{3084, 3085}, []int{3085, 3086}, []int{3086, 3087}, []int{3087, 3088}, []int{3088, 3089}, []int{3089, 3090}, []int{3090, 3091}, []int{3091, 3092}, []int{3092, 3093}, []int{3093, 3094}, []int{3094, 3095}, []int{3095, 3096}, []int{3096, 3097}, []int{3097, 3098}, []int{3098, 3099}, []int{3099, 3100}, []int{3100, 3101}, []int{3101, 3102}, []int{3102, 3103}, []int{3103, 3104}, []int{3104, 3105}, []int{3105, 3106}, []int{3106, 3107}, []int{3107, 3108}, []int{3108, 3109}, []int{3109, 3110}, []int{3110, 3111}, []int{3111, 3112}, []int{3112, 3113}, []int{3113, 3114}, []int{3114, 3115}, []int{3115, 3116}, []int{3116, 3117}, []int{3117, 3118}, []int{3118, 3119}, []int{3119, 3120}, []int{3120, 3121}, []int{3121, 3122}, []int{3122, 3123}, []int{3123, 3124}, []int{3124, 3125}, []int{3125, 3126}, []int{3126, 3127}, []int{3127, 3128}, []int{3128, 3129}, []int{3129, 3130}, []int{3130, 3131}, []int{3131, 3132}, []int{3132, 3133}, []int{3133, 3134}, []int{3134, 3135}, []int{3135, 3136}, []int{3136, 3137}, []int{3137, 3138}, []int{3138, 3139}, []int{3139, 3140}, []int{3140, 3141}, []int{3141, 3142}, []int{3142, 3143}, []int{3143, 3144}, []int{3144, 3145}, []int{3145, 3146}, []int{3146, 3147}, []int{3147, 3148}, []int{3148, 3149}, []int{3149, 3150}, []int{3150, 3151}, []int{3151, 3152}, []int{3152, 3153}, []int{3153, 3154}, []int{3154, 3155}, []int{3155, 3156}, []int{3156, 3157}, []int{3157, 3158}, []int{3158, 3159}, []int{3159, 3160}, []int{3160, 3161}, []int{3161, 3162}, []int{3162, 3163}, []int{3163, 3164}, []int{3164, 3165}, []int{3165, 3166}, []int{3166, 3167}, []int{3167, 3168}, []int{3168, 3169}, []int{3169, 3170}, []int{3170, 3171}, []int{3171, 3172}, []int{3172, 3173}, []int{3173, 3174}, []int{3174, 3175}, []int{3175, 3176}, []int{3176, 3177}, []int{3177, 3178}, []int{3178, 3179}, []int{3179, 3180}, []int{3180, 3181}, []int{3181, 3182}, []int{3182, 3183}, []int{3183, 3184}, []int{3184, 3185}, []int{3185, 3186}, []int{3186, 3187}, []int{3187, 3188}, []int{3188, 3189}, []int{3189, 3190}, []int{3190, 3191}, []int{3191, 3192}, []int{3192, 3193}, []int{3193, 3194}, []int{3194, 3195}, []int{3195, 3196}, []int{3196, 3197}, []int{3197, 3198}, []int{3198, 3199}, []int{3199, 3200}, []int{3200, 3201}, []int{3201, 3202}, []int{3202, 3203}, []int{3203, 3204}, []int{3204, 3205}, []int{3205, 3206}, []int{3206, 3207}, []int{3207, 3208}, []int{3208, 3209}, []int{3209, 3210}, []int{3210, 3211}, []int{3211, 3212}, []int{3212, 3213}, []int{3213, 3214}, []int{3214, 3215}, []int{3215, 3216}, []int{3216, 3217}, []int{3217, 3218}, []int{3218, 3219}, []int{3219, 3220}, []int{3220, 3221}, []int{3221, 3222}, []int{3222, 3223}, []int{3223, 3224}, []int{3224, 3225}, []int{3225, 3226}, []int{3226, 3227}, []int{3227, 3228}, []int{3228, 3229}, []int{3229, 3230}, []int{3230, 3231}, []int{3231, 3232}, []int{3232, 3233}, []int{3233, 3234}, []int{3234, 3235}, []int{3235, 3236}, []int{3236, 3237}, []int{3237, 3238}, []int{3238, 3239}, []int{3239, 3240}, []int{3240, 3241}, []int{3241, 3242}, []int{3242, 3243}, []int{3243, 3244}, []int{3244, 3245}, []int{3245, 3246}, []int{3246, 3247}, []int{3247, 3248}, []int{3248, 3249}, []int{3249, 3250}, []int{3250, 3251}, []int{3251, 3252}, []int{3252, 3253}, []int{3253, 3254}, []int{3254, 3255}, []int{3255, 3256}, []int{3256, 3257}, []int{3257, 3258}, []int{3258, 3259}, []int{3259, 3260}, []int{3260, 3261}, []int{3261, 3262}, []int{3262, 3263}, []int{3263, 3264}, []int{3264, 3265}, []int{3265, 3266}, []int{3266, 3267}, []int{3267, 3268}, []int{3268, 3269}, []int{3269, 3270}, []int{3270, 3271}, []int{3271, 3272}, []int{3272, 3273}, []int{3273, 3274}, []int{3274, 3275}, []int{3275, 3276}, []int{3276, 3277}, []int{3277, 3278}, []int{3278, 3279}, []int{3279, 3280}, []int{3280, 3281}, []int{3281, 3282}, []int{3282, 3283}, []int{3283, 3284}, []int{3284, 3285}, []int{3285, 3286}, []int{3286, 3287}, []int{3287, 3288}, []int{3288, 3289}, []int{3289, 3290}, []int{3290, 3291}, []int{3291, 3292}, []int{3292, 3293}, []int{3293, 3294}, []int{3294, 3295}, []int{3295, 3296}, []int{3296, 3297}, []int{3297, 3298}, []int{3298, 3299}, []int{3299, 3300}, []int{3300, 3301}, []int{3301, 3302}, []int{3302, 3303}, []int{3303, 3304}, []int{3304, 3305}, []int{3305, 3306}, []int{3306, 3307}, []int{3307, 3308}, []int{3308, 3309}, []int{3309, 3310}, []int{3310, 3311}, []int{3311, 3312}, []int{3312, 3313}, []int{3313, 3314}, []int{3314, 3315}, []int{3315, 3316}, []int{3316, 3317}, []int{3317, 3318}, []int{3318, 3319}, []int{3319, 3320}, []int{3320, 3321}, []int{3321, 3322}, []int{3322, 3323}, []int{3323, 3324}, []int{3324, 3325}, []int{3325, 3326}, []int{3326, 3327}, []int{3327, 3328}, []int{3328, 3329}, []int{3329, 3330}, []int{3330, 3331}, []int{3331, 3332}, []int{3332, 3333}, []int{3333, 3334}, []int{3334, 3335}, []int{3335, 3336}, []int{3336, 3337}, []int{3337, 3338}, []int{3338, 3339}, []int{3339, 3340}, []int{3340, 3341}, []int{3341, 3342}, []int{3342, 3343}, []int{3343, 3344}, []int{3344, 3345}, []int{3345, 3346}, []int{3346, 3347}, []int{3347, 3348}, []int{3348, 3349}, []int{3349, 3350}, []int{3350, 3351}, []int{3351, 3352}, []int{3352, 3353}, []int{3353, 3354}, []int{3354, 3355}, []int{3355, 3356}, []int{3356, 3357}, []int{3357, 3358}, []int{3358, 3359}, []int{3359, 3360}, []int{3360, 3361}, []int{3361, 3362}, []int{3362, 3363}, []int{3363, 3364}, []int{3364, 3365}, []int{3365, 3366}, []int{3366, 3367}, []int{3367, 3368}, []int{3368, 3369}, []int{3369, 3370}, []int{3370, 3371}, []int{3371, 3372}, []int{3372, 3373}, []int{3373, 3374}, []int{3374, 3375}, []int{3375, 3376}, []int{3376, 3377}, []int{3377, 3378}, []int{3378, 3379}, []int{3379, 3380}, []int{3380, 3381}, []int{3381, 3382}, []int{3382, 3383}, []int{3383, 3384}, []int{3384, 3385}, []int{3385, 3386}, []int{3386, 3387}, []int{3387, 3388}, []int{3388, 3389}, []int{3389, 3390}, []int{3390, 3391}, []int{3391, 3392}, []int{3392, 3393}, []int{3393, 3394}, []int{3394, 3395}, []int{3395, 3396}, []int{3396, 3397}, []int{3397, 3398}, []int{3398, 3399}, []int{3399, 3400}, []int{3400, 3401}, []int{3401, 3402}, []int{3402, 3403}, []int{3403, 3404}, []int{3404, 3405}, []int{3405, 3406}, []int{3406, 3407}, []int{3407, 3408}, []int{3408, 3409}, []int{3409, 3410}, []int{3410, 3411}, []int{3411, 3412}, []int{3412, 3413}, []int{3413, 3414}, []int{3414, 3415}, []int{3415, 3416}, []int{3416, 3417}, []int{3417, 3418}, []int{3418, 3419}, []int{3419, 3420}, []int{3420, 3421}, []int{3421, 3422}, []int{3422, 3423}, []int{3423, 3424}, []int{3424, 3425}, []int{3425, 3426}, []int{3426, 3427}, []int{3427, 3428}, []int{3428, 3429}, []int{3429, 3430}, []int{3430, 3431}, []int{3431, 3432}, []int{3432, 3433}, []int{3433, 3434}, []int{3434, 3435}, []int{3435, 3436}, []int{3436, 3437}, []int{3437, 3438}, []int{3438, 3439}, []int{3439, 3440}, []int{3440, 3441}, []int{3441, 3442}, []int{3442, 3443}, []int{3443, 3444}, []int{3444, 3445}, []int{3445, 3446}, []int{3446, 3447}, []int{3447, 3448}, []int{3448, 3449}, []int{3449, 3450}, []int{3450, 3451}, []int{3451, 3452}, []int{3452, 3453}, []int{3453, 3454}, []int{3454, 3455}, []int{3455, 3456}, []int{3456, 3457}, []int{3457, 3458}, []int{3458, 3459}, []int{3459, 3460}, []int{3460, 3461}, []int{3461, 3462}, []int{3462, 3463}, []int{3463, 3464}, []int{3464, 3465}, []int{3465, 3466}, []int{3466, 3467}, []int{3467, 3468}, []int{3468, 3469}, []int{3469, 3470}, []int{3470, 3471}, []int{3471, 3472}, []int{3472, 3473}, []int{3473, 3474}, []int{3474, 3475}, []int{3475, 3476}, []int{3476, 3477}, []int{3477, 3478}, []int{3478, 3479}, []int{3479, 3480}, []int{3480, 3481}, []int{3481, 3482}, []int{3482, 3483}, []int{3483, 3484}, []int{3484, 3485}, []int{3485, 3486}, []int{3486, 3487}, []int{3487, 3488}, []int{3488, 3489}, []int{3489, 3490}, []int{3490, 3491}, []int{3491, 3492}, []int{3492, 3493}, []int{3493, 3494}, []int{3494, 3495}, []int{3495, 3496}, []int{3496, 3497}, []int{3497, 3498}, []int{3498, 3499}, []int{3499, 3500}, []int{3500, 3501}, []int{3501, 3502}, []int{3502, 3503}, []int{3503, 3504}, []int{3504, 3505}, []int{3505, 3506}, []int{3506, 3507}, []int{3507, 3508}, []int{3508, 3509}, []int{3509, 3510}, []int{3510, 3511}, []int{3511, 3512}, []int{3512, 3513}, []int{3513, 3514}, []int{3514, 3515}, []int{3515, 3516}, []int{3516, 3517}, []int{3517, 3518}, []int{3518, 3519}, []int{3519, 3520}, []int{3520, 3521}, []int{3521, 3522}, []int{3522, 3523}, []int{3523, 3524}, []int{3524, 3525}, []int{3525, 3526}, []int{3526, 3527}, []int{3527, 3528}, []int{3528, 3529}, []int{3529, 3530}, []int{3530, 3531}, []int{3531, 3532}, []int{3532, 3533}, []int{3533, 3534}, []int{3534, 3535}, []int{3535, 3536}, []int{3536, 3537}, []int{3537, 3538}, []int{3538, 3539}, []int{3539, 3540}, []int{3540, 3541}, []int{3541, 3542}, []int{3542, 3543}, []int{3543, 3544}, []int{3544, 3545}, []int{3545, 3546}, []int{3546, 3547}, []int{3547, 3548}, []int{3548, 3549}, []int{3549, 3550}, []int{3550, 3551}, []int{3551, 3552}, []int{3552, 3553}, []int{3553, 3554}, []int{3554, 3555}, []int{3555, 3556}, []int{3556, 3557}, []int{3557, 3558}, []int{3558, 3559}, []int{3559, 3560}, []int{3560, 3561}, []int{3561, 3562}, []int{3562, 3563}, []int{3563, 3564}, []int{3564, 3565}, []int{3565, 3566}, []int{3566, 3567}, []int{3567, 3568}, []int{3568, 3569}, []int{3569, 3570}, []int{3570, 3571}, []int{3571, 3572}, []int{3572, 3573}, []int{3573, 3574}, []int{3574, 3575}, []int{3575, 3576}, []int{3576, 3577}, []int{3577, 3578}, []int{3578, 3579}, []int{3579, 3580}, []int{3580, 3581}, []int{3581, 3582}, []int{3582, 3583}, []int{3583, 3584}, []int{3584, 3585}, []int{3585, 3586}, []int{3586, 3587}, []int{3587, 3588}, []int{3588, 3589}, []int{3589, 3590}, []int{3590, 3591}, []int{3591, 3592}, []int{3592, 3593}, []int{3593, 3594}, []int{3594, 3595}, []int{3595, 3596}, []int{3596, 3597}, []int{3597, 3598}, []int{3598, 3599}, []int{3599, 3600}, []int{3600, 3601}, []int{3601, 3602}, []int{3602, 3603}, []int{3603, 3604}, []int{3604, 3605}, []int{3605, 3606}, []int{3606, 3607}, []int{3607, 3608}, []int{3608, 3609}, []int{3609, 3610}, []int{3610, 3611}, []int{3611, 3612}, []int{3612, 3613}, []int{3613, 3614}, []int{3614, 3615}, []int{3615, 3616}, []int{3616, 3617}, []int{3617, 3618}, []int{3618, 3619}, []int{3619, 3620}, []int{3620, 3621}, []int{3621, 3622}, []int{3622, 3623}, []int{3623, 3624}, []int{3624, 3625}, []int{3625, 3626}, []int{3626, 3627}, []int{3627, 3628}, []int{3628, 3629}, []int{3629, 3630}, []int{3630, 3631}, []int{3631, 3632}, []int{3632, 3633}, []int{3633, 3634}, []int{3634, 3635}, []int{3635, 3636}, []int{3636, 3637}, []int{3637, 3638}, []int{3638, 3639}, []int{3639, 3640}, []int{3640, 3641}, []int{3641, 3642}, []int{3642, 3643}, []int{3643, 3644}, []int{3644, 3645}, []int{3645, 3646}, []int{3646, 3647}, []int{3647, 3648}, []int{3648, 3649}, []int{3649, 3650}, []int{3650, 3651}, []int{3651, 3652}, []int{3652, 3653}, []int{3653, 3654}, []int{3654, 3655}, []int{3655, 3656}, []int{3656, 3657}, []int{3657, 3658}, []int{3658, 3659}, []int{3659, 3660}, []int{3660, 3661}, []int{3661, 3662}, []int{3662, 3663}, []int{3663, 3664}, []int{3664, 3665}, []int{3665, 3666}, []int{3666, 3667}, []int{3667, 3668}, []int{3668, 3669}, []int{3669, 3670}, []int{3670, 3671}, []int{3671, 3672}, []int{3672, 3673}, []int{3673, 3674}, []int{3674, 3675}, []int{3675, 3676}, []int{3676, 3677}, []int{3677, 3678}, []int{3678, 3679}, []int{3679, 3680}, []int{3680, 3681}, []int{3681, 3682}, []int{3682, 3683}, []int{3683, 3684}, []int{3684, 3685}, []int{3685, 3686}, []int{3686, 3687}, []int{3687, 3688}, []int{3688, 3689}, []int{3689, 3690}, []int{3690, 3691}, []int{3691, 3692}, []int{3692, 3693}, []int{3693, 3694}, []int{3694, 3695}, []int{3695, 3696}, []int{3696, 3697}, []int{3697, 3698}, []int{3698, 3699}, []int{3699, 3700}, []int{3700, 3701}, []int{3701, 3702}, []int{3702, 3703}, []int{3703, 3704}, []int{3704, 3705}, []int{3705, 3706}, []int{3706, 3707}, []int{3707, 3708}, []int{3708, 3709}, []int{3709, 3710}, []int{3710, 3711}, []int{3711, 3712}, []int{3712, 3713}, []int{3713, 3714}, []int{3714, 3715}, []int{3715, 3716}, []int{3716, 3717}, []int{3717, 3718}, []int{3718, 3719}, []int{3719, 3720}, []int{3720, 3721}, []int{3721, 3722}, []int{3722, 3723}, []int{3723, 3724}, []int{3724, 3725}, []int{3725, 3726}, []int{3726, 3727}, []int{3727, 3728}, []int{3728, 3729}, []int{3729, 3730}, []int{3730, 3731}, []int{3731, 3732}, []int{3732, 3733}, []int{3733, 3734}, []int{3734, 3735}, []int{3735, 3736}, []int{3736, 3737}, []int{3737, 3738}, []int{3738, 3739}, []int{3739, 3740}, []int{3740, 3741}, []int{3741, 3742}, []int{3742, 3743}, []int{3743, 3744}, []int{3744, 3745}, []int{3745, 3746}, []int{3746, 3747}, []int{3747, 3748}, []int{3748, 3749}, []int{3749, 3750}, []int{3750, 3751}, []int{3751, 3752}, []int{3752, 3753}, []int{3753, 3754}, []int{3754, 3755}, []int{3755, 3756}, []int{3756, 3757}, []int{3757, 3758}, []int{3758, 3759}, []int{3759, 3760}, []int{3760, 3761}, []int{3761, 3762}, []int{3762, 3763}, []int{3763, 3764}, []int{3764, 3765}, []int{3765, 3766}, []int{3766, 3767}, []int{3767, 3768}, []int{3768, 3769}, []int{3769, 3770}, []int{3770, 3771}, []int{3771, 3772}, []int{3772, 3773}, []int{3773, 3774}, []int{3774, 3775}, []int{3775, 3776}, []int{3776, 3777}, []int{3777, 3778}, []int{3778, 3779}, []int{3779, 3780}, []int{3780, 3781}, []int{3781, 3782}, []int{3782, 3783}, []int{3783, 3784}, []int{3784, 3785}, []int{3785, 3786}, []int{3786, 3787}, []int{3787, 3788}, []int{3788, 3789}, []int{3789, 3790}, []int{3790, 3791}, []int{3791, 3792}, []int{3792, 3793}, []int{3793, 3794}, []int{3794, 3795}, []int{3795, 3796}, []int{3796, 3797}, []int{3797, 3798}, []int{3798, 3799}, []int{3799, 3800}, []int{3800, 3801}, []int{3801, 3802}, []int{3802, 3803}, []int{3803, 3804}, []int{3804, 3805}, []int{3805, 3806}, []int{3806, 3807}, []int{3807, 3808}, []int{3808, 3809}, []int{3809, 3810}, []int{3810, 3811}, []int{3811, 3812}, []int{3812, 3813}, []int{3813, 3814}, []int{3814, 3815}, []int{3815, 3816}, []int{3816, 3817}, []int{3817, 3818}, []int{3818, 3819}, []int{3819, 3820}, []int{3820, 3821}, []int{3821, 3822}, []int{3822, 3823}, []int{3823, 3824}, []int{3824, 3825}, []int{3825, 3826}, []int{3826, 3827}, []int{3827, 3828}, []int{3828, 3829}, []int{3829, 3830}, []int{3830, 3831}, []int{3831, 3832}, []int{3832, 3833}, []int{3833, 3834}, []int{3834, 3835}, []int{3835, 3836}, []int{3836, 3837}, []int{3837, 3838}, []int{3838, 3839}, []int{3839, 3840}, []int{3840, 3841}, []int{3841, 3842}, []int{3842, 3843}, []int{3843, 3844}, []int{3844, 3845}, []int{3845, 3846}, []int{3846, 3847}, []int{3847, 3848}, []int{3848, 3849}, []int{3849, 3850}, []int{3850, 3851}, []int{3851, 3852}, []int{3852, 3853}, []int{3853, 3854}, []int{3854, 3855}, []int{3855, 3856}, []int{3856, 3857}, []int{3857, 3858}, []int{3858, 3859}, []int{3859, 3860}, []int{3860, 3861}, []int{3861, 3862}, []int{3862, 3863}, []int{3863, 3864}, []int{3864, 3865}, []int{3865, 3866}, []int{3866, 3867}, []int{3867, 3868}, []int{3868, 3869}, []int{3869, 3870}, []int{3870, 3871}, []int{3871, 3872}, []int{3872, 3873}, []int{3873, 3874}, []int{3874, 3875}, []int{3875, 3876}, []int{3876, 3877}, []int{3877, 3878}, []int{3878, 3879}, []int{3879, 3880}, []int{3880, 3881}, []int{3881, 3882}, []int{3882, 3883}, []int{3883, 3884}, []int{3884, 3885}, []int{3885, 3886}, []int{3886, 3887}, []int{3887, 3888}, []int{3888, 3889}, []int{3889, 3890}, []int{3890, 3891}, []int{3891, 3892}, []int{3892, 3893}, []int{3893, 3894}, []int{3894, 3895}, []int{3895, 3896}, []int{3896, 3897}, []int{3897, 3898}, []int{3898, 3899}, []int{3899, 3900}, []int{3900, 3901}, []int{3901, 3902}, []int{3902, 3903}, []int{3903, 3904}, []int{3904, 3905}, []int{3905, 3906}, []int{3906, 3907}, []int{3907, 3908}, []int{3908, 3909}, []int{3909, 3910}, []int{3910, 3911}, []int{3911, 3912}, []int{3912, 3913}, []int{3913, 3914}, []int{3914, 3915}, []int{3915, 3916}, []int{3916, 3917}, []int{3917, 3918}, []int{3918, 3919}, []int{3919, 3920}, []int{3920, 3921}, []int{3921, 3922}, []int{3922, 3923}, []int{3923, 3924}, []int{3924, 3925}, []int{3925, 3926}, []int{3926, 3927}, []int{3927, 3928}, []int{3928, 3929}, []int{3929, 3930}, []int{3930, 3931}, []int{3931, 3932}, []int{3932, 3933}, []int{3933, 3934}, []int{3934, 3935}, []int{3935, 3936}, []int{3936, 3937}, []int{3937, 3938}, []int{3938, 3939}, []int{3939, 3940}, []int{3940, 3941}, []int{3941, 3942}, []int{3942, 3943}, []int{3943, 3944}, []int{3944, 3945}, []int{3945, 3946}, []int{3946, 3947}, []int{3947, 3948}, []int{3948, 3949}, []int{3949, 3950}, []int{3950, 3951}, []int{3951, 3952}, []int{3952, 3953}, []int{3953, 3954}, []int{3954, 3955}, []int{3955, 3956}, []int{3956, 3957}, []int{3957, 3958}, []int{3958, 3959}, []int{3959, 3960}, []int{3960, 3961}, []int{3961, 3962}, []int{3962, 3963}, []int{3963, 3964}, []int{3964, 3965}, []int{3965, 3966}, []int{3966, 3967}, []int{3967, 3968}, []int{3968, 3969}, []int{3969, 3970}, []int{3970, 3971}, []int{3971, 3972}, []int{3972, 3973}, []int{3973, 3974}, []int{3974, 3975}, []int{3975, 3976}, []int{3976, 3977}, []int{3977, 3978}, []int{3978, 3979}, []int{3979, 3980}, []int{3980, 3981}, []int{3981, 3982}, []int{3982, 3983}, []int{3983, 3984}, []int{3984, 3985}, []int{3985, 3986}, []int{3986, 3987}, []int{3987, 3988}, []int{3988, 3989}, []int{3989, 3990}, []int{3990, 3991}, []int{3991, 3992}, []int{3992, 3993}, []int{3993, 3994}, []int{3994, 3995}, []int{3995, 3996}, []int{3996, 3997}, []int{3997, 3998}, []int{3998, 3999}, []int{3999, 4000}, []int{4000, 4001}, []int{4001, 4002}, []int{4002, 4003}, []int{4003, 4004}, []int{4004, 4005}, []int{4005, 4006}, []int{4006, 4007}, []int{4007, 4008}, []int{4008, 4009}, []int{4009, 4010}, []int{4010, 4011}, []int{4011, 4012}, []int{4012, 4013}, []int{4013, 4014}, []int{4014, 4015}, []int{4015, 4016}, []int{4016, 4017}, []int{4017, 4018}, []int{4018, 4019}, []int{4019, 4020}, []int{4020, 4021}, []int{4021, 4022}, []int{4022, 4023}, []int{4023, 4024}, []int{4024, 4025}, []int{4025, 4026}, []int{4026, 4027}, []int{4027, 4028}, []int{4028, 4029}, []int{4029, 4030}, []int{4030, 4031}, []int{4031, 4032}, []int{4032, 4033}, []int{4033, 4034}, []int{4034, 4035}, []int{4035, 4036}, []int{4036, 4037}, []int{4037, 4038}, []int{4038, 4039}, []int{4039, 4040}, []int{4040, 4041}, []int{4041, 4042}, []int{4042, 4043}, []int{4043, 4044}, []int{4044, 4045}, []int{4045, 4046}, []int{4046, 4047}, []int{4047, 4048}, []int{4048, 4049}, []int{4049, 4050}, []int{4050, 4051}, []int{4051, 4052}, []int{4052, 4053}, []int{4053, 4054}, []int{4054, 4055}, []int{4055, 4056}, []int{4056, 4057}, []int{4057, 4058}, []int{4058, 4059}, []int{4059, 4060}, []int{4060, 4061}, []int{4061, 4062}, []int{4062, 4063}, []int{4063, 4064}, []int{4064, 4065}, []int{4065, 4066}, []int{4066, 4067}, []int{4067, 4068}, []int{4068, 4069}, []int{4069, 4070}, []int{4070, 4071}, []int{4071, 4072}, []int{4072, 4073}, []int{4073, 4074}, []int{4074, 4075}, []int{4075, 4076}, []int{4076, 4077}, []int{4077, 4078}, []int{4078, 4079}, []int{4079, 4080}, []int{4080, 4081}, []int{4081, 4082}, []int{4082, 4083}, []int{4083, 4084}, []int{4084, 4085}, []int{4085, 4086}, []int{4086, 4087}, []int{4087, 4088}, []int{4088, 4089}, []int{4089, 4090}, []int{4090, 4091}, []int{4091, 4092}, []int{4092, 4093}, []int{4093, 4094}, []int{4094, 4095}, []int{4095, 4096}, []int{4096, 4097}, []int{4097, 4098}, []int{4098, 4099}, []int{4099, 4100}, []int{4100, 4101}, []int{4101, 4102}, []int{4102, 4103}, []int{4103, 4104}, []int{4104, 4105}, []int{4105, 4106}, []int{4106, 4107}, []int{4107, 4108}, []int{4108, 4109}, []int{4109, 4110}, []int{4110, 4111}, []int{4111, 4112}, []int{4112, 4113}, []int{4113, 4114}, []int{4114, 4115}, []int{4115, 4116}, []int{4116, 4117}, []int{4117, 4118}, []int{4118, 4119}, []int{4119, 4120}, []int{4120, 4121}, []int{4121, 4122}, []int{4122, 4123}, []int{4123, 4124}, []int{4124, 4125}, []int{4125, 4126}, []int{4126, 4127}, []int{4127, 4128}, []int{4128, 4129}, []int{4129, 4130}, []int{4130, 4131}, []int{4131, 4132}, []int{4132, 4133}, []int{4133, 4134}, []int{4134, 4135}, []int{4135, 4136}, []int{4136, 4137}, []int{4137, 4138}, []int{4138, 4139}, []int{4139, 4140}, []int{4140, 4141}, []int{4141, 4142}, []int{4142, 4143}, []int{4143, 4144}, []int{4144, 4145}, []int{4145, 4146}, []int{4146, 4147}, []int{4147, 4148}, []int{4148, 4149}, []int{4149, 4150}, []int{4150, 4151}, []int{4151, 4152}, []int{4152, 4153}, []int{4153, 4154}, []int{4154, 4155}, []int{4155, 4156}, []int{4156, 4157}, []int{4157, 4158}, []int{4158, 4159}, []int{4159, 4160}, []int{4160, 4161}, []int{4161, 4162}, []int{4162, 4163}, []int{4163, 4164}, []int{4164, 4165}, []int{4165, 4166}, []int{4166, 4167}, []int{4167, 4168}, []int{4168, 4169}, []int{4169, 4170}, []int{4170, 4171}, []int{4171, 4172}, []int{4172, 4173}, []int{4173, 4174}, []int{4174, 4175}, []int{4175, 4176}, []int{4176, 4177}, []int{4177, 4178}, []int{4178, 4179}, []int{4179, 4180}, []int{4180, 4181}, []int{4181, 4182}, []int{4182, 4183}, []int{4183, 4184}, []int{4184, 4185}, []int{4185, 4186}, []int{4186, 4187}, []int{4187, 4188}, []int{4188, 4189}, []int{4189, 4190}, []int{4190, 4191}, []int{4191, 4192}, []int{4192, 4193}, []int{4193, 4194}, []int{4194, 4195}, []int{4195, 4196}, []int{4196, 4197}, []int{4197, 4198}, []int{4198, 4199}, []int{4199, 4200}, []int{4200, 4201}, []int{4201, 4202}, []int{4202, 4203}, []int{4203, 4204}, []int{4204, 4205}, []int{4205, 4206}, []int{4206, 4207}, []int{4207, 4208}, []int{4208, 4209}, []int{4209, 4210}, []int{4210, 4211}, []int{4211, 4212}, []int{4212, 4213}, []int{4213, 4214}, []int{4214, 4215}, []int{4215, 4216}, []int{4216, 4217}, []int{4217, 4218}, []int{4218, 4219}, []int{4219, 4220}, []int{4220, 4221}, []int{4221, 4222}, []int{4222, 4223}, []int{4223, 4224}, []int{4224, 4225}, []int{4225, 4226}, []int{4226, 4227}, []int{4227, 4228}, []int{4228, 4229}, []int{4229, 4230}, []int{4230, 4231}, []int{4231, 4232}, []int{4232, 4233}, []int{4233, 4234}, []int{4234, 4235}, []int{4235, 4236}, []int{4236, 4237}, []int{4237, 4238}, []int{4238, 4239}, []int{4239, 4240}, []int{4240, 4241}, []int{4241, 4242}, []int{4242, 4243}, []int{4243, 4244}, []int{4244, 4245}, []int{4245, 4246}, []int{4246, 4247}, []int{4247, 4248}, []int{4248, 4249}, []int{4249, 4250}, []int{4250, 4251}, []int{4251, 4252}, []int{4252, 4253}, []int{4253, 4254}, []int{4254, 4255}, []int{4255, 4256}, []int{4256, 4257}, []int{4257, 4258}, []int{4258, 4259}, []int{4259, 4260}, []int{4260, 4261}, []int{4261, 4262}, []int{4262, 4263}, []int{4263, 4264}, []int{4264, 4265}, []int{4265, 4266}, []int{4266, 4267}, []int{4267, 4268}, []int{4268, 4269}, []int{4269, 4270}, []int{4270, 4271}, []int{4271, 4272}, []int{4272, 4273}, []int{4273, 4274}, []int{4274, 4275}, []int{4275, 4276}, []int{4276, 4277}, []int{4277, 4278}, []int{4278, 4279}, []int{4279, 4280}, []int{4280, 4281}, []int{4281, 4282}, []int{4282, 4283}, []int{4283, 4284}, []int{4284, 4285}, []int{4285, 4286}, []int{4286, 4287}, []int{4287, 4288}, []int{4288, 4289}, []int{4289, 4290}, []int{4290, 4291}, []int{4291, 4292}, []int{4292, 4293}, []int{4293, 4294}, []int{4294, 4295}, []int{4295, 4296}, []int{4296, 4297}, []int{4297, 4298}, []int{4298, 4299}, []int{4299, 4300}, []int{4300, 4301}, []int{4301, 4302}, []int{4302, 4303}, []int{4303, 4304}, []int{4304, 4305}, []int{4305, 4306}, []int{4306, 4307}, []int{4307, 4308}, []int{4308, 4309}, []int{4309, 4310}, []int{4310, 4311}, []int{4311, 4312}, []int{4312, 4313}, []int{4313, 4314}, []int{4314, 4315}, []int{4315, 4316}, []int{4316, 4317}, []int{4317, 4318}, []int{4318, 4319}, []int{4319, 4320}, []int{4320, 4321}, []int{4321, 4322}, []int{4322, 4323}, []int{4323, 4324}, []int{4324, 4325}, []int{4325, 4326}, []int{4326, 4327}, []int{4327, 4328}, []int{4328, 4329}, []int{4329, 4330}, []int{4330, 4331}, []int{4331, 4332}, []int{4332, 4333}, []int{4333, 4334}, []int{4334, 4335}, []int{4335, 4336}, []int{4336, 4337}, []int{4337, 4338}, []int{4338, 4339}, []int{4339, 4340}, []int{4340, 4341}, []int{4341, 4342}, []int{4342, 4343}, []int{4343, 4344}, []int{4344, 4345}, []int{4345, 4346}, []int{4346, 4347}, []int{4347, 4348}, []int{4348, 4349}, []int{4349, 4350}, []int{4350, 4351}, []int{4351, 4352}, []int{4352, 4353}, []int{4353, 4354}, []int{4354, 4355}, []int{4355, 4356}, []int{4356, 4357}, []int{4357, 4358}, []int{4358, 4359}, []int{4359, 4360}, []int{4360, 4361}, []int{4361, 4362}, []int{4362, 4363}, []int{4363, 4364}, []int{4364, 4365}, []int{4365, 4366}, []int{4366, 4367}, []int{4367, 4368}, []int{4368, 4369}, []int{4369, 4370}, []int{4370, 4371}, []int{4371, 4372}, []int{4372, 4373}, []int{4373, 4374}, []int{4374, 4375}, []int{4375, 4376}, []int{4376, 4377}, []int{4377, 4378}, []int{4378, 4379}, []int{4379, 4380}, []int{4380, 4381}, []int{4381, 4382}, []int{4382, 4383}, []int{4383, 4384}, []int{4384, 4385}, []int{4385, 4386}, []int{4386, 4387}, []int{4387, 4388}, []int{4388, 4389}, []int{4389, 4390}, []int{4390, 4391}, []int{4391, 4392}, []int{4392, 4393}, []int{4393, 4394}, []int{4394, 4395}, []int{4395, 4396}, []int{4396, 4397}, []int{4397, 4398}, []int{4398, 4399}, []int{4399, 4400}, []int{4400, 4401}, []int{4401, 4402}, []int{4402, 4403}, []int{4403, 4404}, []int{4404, 4405}, []int{4405, 4406}, []int{4406, 4407}, []int{4407, 4408}, []int{4408, 4409}, []int{4409, 4410}, []int{4410, 4411}, []int{4411, 4412}, []int{4412, 4413}, []int{4413, 4414}, []int{4414, 4415}, []int{4415, 4416}, []int{4416, 4417}, []int{4417, 4418}, []int{4418, 4419}, []int{4419, 4420}, []int{4420, 4421}, []int{4421, 4422}, []int{4422, 4423}, []int{4423, 4424}, []int{4424, 4425}, []int{4425, 4426}, []int{4426, 4427}, []int{4427, 4428}, []int{4428, 4429}, []int{4429, 4430}, []int{4430, 4431}, []int{4431, 4432}, []int{4432, 4433}, []int{4433, 4434}, []int{4434, 4435}, []int{4435, 4436}, []int{4436, 4437}, []int{4437, 4438}, []int{4438, 4439}, []int{4439, 4440}, []int{4440, 4441}, []int{4441, 4442}, []int{4442, 4443}, []int{4443, 4444}, []int{4444, 4445}, []int{4445, 4446}, []int{4446, 4447}, []int{4447, 4448}, []int{4448, 4449}, []int{4449, 4450}, []int{4450, 4451}, []int{4451, 4452}, []int{4452, 4453}, []int{4453, 4454}, []int{4454, 4455}, []int{4455, 4456}, []int{4456, 4457}, []int{4457, 4458}, []int{4458, 4459}, []int{4459, 4460}, []int{4460, 4461}, []int{4461, 4462}, []int{4462, 4463}, []int{4463, 4464}, []int{4464, 4465}, []int{4465, 4466}, []int{4466, 4467}, []int{4467, 4468}, []int{4468, 4469}, []int{4469, 4470}, []int{4470, 4471}, []int{4471, 4472}, []int{4472, 4473}, []int{4473, 4474}, []int{4474, 4475}, []int{4475, 4476}, []int{4476, 4477}, []int{4477, 4478}, []int{4478, 4479}, []int{4479, 4480}, []int{4480, 4481}, []int{4481, 4482}, []int{4482, 4483}, []int{4483, 4484}, []int{4484, 4485}, []int{4485, 4486}, []int{4486, 4487}, []int{4487, 4488}, []int{4488, 4489}, []int{4489, 4490}, []int{4490, 4491}, []int{4491, 4492}, []int{4492, 4493}, []int{4493, 4494}, []int{4494, 4495}, []int{4495, 4496}, []int{4496, 4497}, []int{4497, 4498}, []int{4498, 4499}, []int{4499, 4500}, []int{4500, 4501}, []int{4501, 4502}, []int{4502, 4503}, []int{4503, 4504}, []int{4504, 4505}, []int{4505, 4506}, []int{4506, 4507}, []int{4507, 4508}, []int{4508, 4509}, []int{4509, 4510}, []int{4510, 4511}, []int{4511, 4512}, []int{4512, 4513}, []int{4513, 4514}, []int{4514, 4515}, []int{4515, 4516}, []int{4516, 4517}, []int{4517, 4518}, []int{4518, 4519}, []int{4519, 4520}, []int{4520, 4521}, []int{4521, 4522}, []int{4522, 4523}, []int{4523, 4524}, []int{4524, 4525}, []int{4525, 4526}, []int{4526, 4527}, []int{4527, 4528}, []int{4528, 4529}, []int{4529, 4530}, []int{4530, 4531}, []int{4531, 4532}, []int{4532, 4533}, []int{4533, 4534}, []int{4534, 4535}, []int{4535, 4536}, []int{4536, 4537}, []int{4537, 4538}, []int{4538, 4539}, []int{4539, 4540}, []int{4540, 4541}, []int{4541, 4542}, []int{4542, 4543}, []int{4543, 4544}, []int{4544, 4545}, []int{4545, 4546}, []int{4546, 4547}, []int{4547, 4548}, []int{4548, 4549}, []int{4549, 4550}, []int{4550, 4551}, []int{4551, 4552}, []int{4552, 4553}, []int{4553, 4554}, []int{4554, 4555}, []int{4555, 4556}, []int{4556, 4557}, []int{4557, 4558}, []int{4558, 4559}, []int{4559, 4560}, []int{4560, 4561}, []int{4561, 4562}, []int{4562, 4563}, []int{4563, 4564}, []int{4564, 4565}, []int{4565, 4566}, []int{4566, 4567}, []int{4567, 4568}, []int{4568, 4569}, []int{4569, 4570}, []int{4570, 4571}, []int{4571, 4572}, []int{4572, 4573}, []int{4573, 4574}, []int{4574, 4575}, []int{4575, 4576}, []int{4576, 4577}, []int{4577, 4578}, []int{4578, 4579}, []int{4579, 4580}, []int{4580, 4581}, []int{4581, 4582}, []int{4582, 4583}, []int{4583, 4584}, []int{4584, 4585}, []int{4585, 4586}, []int{4586, 4587}, []int{4587, 4588}, []int{4588, 4589}, []int{4589, 4590}, []int{4590, 4591}, []int{4591, 4592}, []int{4592, 4593}, []int{4593, 4594}, []int{4594, 4595}, []int{4595, 4596}, []int{4596, 4597}, []int{4597, 4598}, []int{4598, 4599}, []int{4599, 4600}, []int{4600, 4601}, []int{4601, 4602}, []int{4602, 4603}, []int{4603, 4604}, []int{4604, 4605}, []int{4605, 4606}, []int{4606, 4607}, []int{4607, 4608}, []int{4608, 4609}, []int{4609, 4610}, []int{4610, 4611}, []int{4611, 4612}, []int{4612, 4613}, []int{4613, 4614}, []int{4614, 4615}, []int{4615, 4616}, []int{4616, 4617}, []int{4617, 4618}, []int{4618, 4619}, []int{4619, 4620}, []int{4620, 4621}, []int{4621, 4622}, []int{4622, 4623}, []int{4623, 4624}, []int{4624, 4625}, []int{4625, 4626}, []int{4626, 4627}, []int{4627, 4628}, []int{4628, 4629}, []int{4629, 4630}, []int{4630, 4631}, []int{4631, 4632}, []int{4632, 4633}, []int{4633, 4634}, []int{4634, 4635}, []int{4635, 4636}, []int{4636, 4637}, []int{4637, 4638}, []int{4638, 4639}, []int{4639, 4640}, []int{4640, 4641}, []int{4641, 4642}, []int{4642, 4643}, []int{4643, 4644}, []int{4644, 4645}, []int{4645, 4646}, []int{4646, 4647}, []int{4647, 4648}, []int{4648, 4649}, []int{4649, 4650}, []int{4650, 4651}, []int{4651, 4652}, []int{4652, 4653}, []int{4653, 4654}, []int{4654, 4655}, []int{4655, 4656}, []int{4656, 4657}, []int{4657, 4658}, []int{4658, 4659}, []int{4659, 4660}, []int{4660, 4661}, []int{4661, 4662}, []int{4662, 4663}, []int{4663, 4664}, []int{4664, 4665}, []int{4665, 4666}, []int{4666, 4667}, []int{4667, 4668}, []int{4668, 4669}, []int{4669, 4670}, []int{4670, 4671}, []int{4671, 4672}, []int{4672, 4673}, []int{4673, 4674}, []int{4674, 4675}, []int{4675, 4676}, []int{4676, 4677}, []int{4677, 4678}, []int{4678, 4679}, []int{4679, 4680}, []int{4680, 4681}, []int{4681, 4682}, []int{4682, 4683}, []int{4683, 4684}, []int{4684, 4685}, []int{4685, 4686}, []int{4686, 4687}, []int{4687, 4688}, []int{4688, 4689}, []int{4689, 4690}, []int{4690, 4691}, []int{4691, 4692}, []int{4692, 4693}, []int{4693, 4694}, []int{4694, 4695}, []int{4695, 4696}, []int{4696, 4697}, []int{4697, 4698}, []int{4698, 4699}, []int{4699, 4700}, []int{4700, 4701}, []int{4701, 4702}, []int{4702, 4703}, []int{4703, 4704}, []int{4704, 4705}, []int{4705, 4706}, []int{4706, 4707}, []int{4707, 4708}, []int{4708, 4709}, []int{4709, 4710}, []int{4710, 4711}, []int{4711, 4712}, []int{4712, 4713}, []int{4713, 4714}, []int{4714, 4715}, []int{4715, 4716}, []int{4716, 4717}, []int{4717, 4718}, []int{4718, 4719}, []int{4719, 4720}, []int{4720, 4721}, []int{4721, 4722}, []int{4722, 4723}, []int{4723, 4724}, []int{4724, 4725}, []int{4725, 4726}, []int{4726, 4727}, []int{4727, 4728}, []int{4728, 4729}, []int{4729, 4730}, []int{4730, 4731}, []int{4731, 4732}, []int{4732, 4733}, []int{4733, 4734}, []int{4734, 4735}, []int{4735, 4736}, []int{4736, 4737}, []int{4737, 4738}, []int{4738, 4739}, []int{4739, 4740}, []int{4740, 4741}, []int{4741, 4742}, []int{4742, 4743}, []int{4743, 4744}, []int{4744, 4745}, []int{4745, 4746}, []int{4746, 4747}, []int{4747, 4748}, []int{4748, 4749}, []int{4749, 4750}, []int{4750, 4751}, []int{4751, 4752}, []int{4752, 4753}, []int{4753, 4754}, []int{4754, 4755}, []int{4755, 4756}, []int{4756, 4757}, []int{4757, 4758}, []int{4758, 4759}, []int{4759, 4760}, []int{4760, 4761}, []int{4761, 4762}, []int{4762, 4763}, []int{4763, 4764}, []int{4764, 4765}, []int{4765, 4766}, []int{4766, 4767}, []int{4767, 4768}, []int{4768, 4769}, []int{4769, 4770}, []int{4770, 4771}, []int{4771, 4772}, []int{4772, 4773}, []int{4773, 4774}, []int{4774, 4775}, []int{4775, 4776}, []int{4776, 4777}, []int{4777, 4778}, []int{4778, 4779}, []int{4779, 4780}, []int{4780, 4781}, []int{4781, 4782}, []int{4782, 4783}, []int{4783, 4784}, []int{4784, 4785}, []int{4785, 4786}, []int{4786, 4787}, []int{4787, 4788}, []int{4788, 4789}, []int{4789, 4790}, []int{4790, 4791}, []int{4791, 4792}, []int{4792, 4793}, []int{4793, 4794}, []int{4794, 4795}, []int{4795, 4796}, []int{4796, 4797}, []int{4797, 4798}, []int{4798, 4799}, []int{4799, 4800}, []int{4800, 4801}, []int{4801, 4802}, []int{4802, 4803}, []int{4803, 4804}, []int{4804, 4805}, []int{4805, 4806}, []int{4806, 4807}, []int{4807, 4808}, []int{4808, 4809}, []int{4809, 4810}, []int{4810, 4811}, []int{4811, 4812}, []int{4812, 4813}, []int{4813, 4814}, []int{4814, 4815}, []int{4815, 4816}, []int{4816, 4817}, []int{4817, 4818}, []int{4818, 4819}, []int{4819, 4820}, []int{4820, 4821}, []int{4821, 4822}, []int{4822, 4823}, []int{4823, 4824}, []int{4824, 4825}, []int{4825, 4826}, []int{4826, 4827}, []int{4827, 4828}, []int{4828, 4829}, []int{4829, 4830}, []int{4830, 4831}, []int{4831, 4832}, []int{4832, 4833}, []int{4833, 4834}, []int{4834, 4835}, []int{4835, 4836}, []int{4836, 4837}, []int{4837, 4838}, []int{4838, 4839}, []int{4839, 4840}, []int{4840, 4841}, []int{4841, 4842}, []int{4842, 4843}, []int{4843, 4844}, []int{4844, 4845}, []int{4845, 4846}, []int{4846, 4847}, []int{4847, 4848}, []int{4848, 4849}, []int{4849, 4850}, []int{4850, 4851}, []int{4851, 4852}, []int{4852, 4853}, []int{4853, 4854}, []int{4854, 4855}, []int{4855, 4856}, []int{4856, 4857}, []int{4857, 4858}, []int{4858, 4859}, []int{4859, 4860}, []int{4860, 4861}, []int{4861, 4862}, []int{4862, 4863}, []int{4863, 4864}, []int{4864, 4865}, []int{4865, 4866}, []int{4866, 4867}, []int{4867, 4868}, []int{4868, 4869}, []int{4869, 4870}, []int{4870, 4871}, []int{4871, 4872}, []int{4872, 4873}, []int{4873, 4874}, []int{4874, 4875}, []int{4875, 4876}, []int{4876, 4877}, []int{4877, 4878}, []int{4878, 4879}, []int{4879, 4880}, []int{4880, 4881}, []int{4881, 4882}, []int{4882, 4883}, []int{4883, 4884}, []int{4884, 4885}, []int{4885, 4886}, []int{4886, 4887}, []int{4887, 4888}, []int{4888, 4889}, []int{4889, 4890}, []int{4890, 4891}, []int{4891, 4892}, []int{4892, 4893}, []int{4893, 4894}, []int{4894, 4895}, []int{4895, 4896}, []int{4896, 4897}, []int{4897, 4898}, []int{4898, 4899}, []int{4899, 4900}, []int{4900, 4901}, []int{4901, 4902}, []int{4902, 4903}, []int{4903, 4904}, []int{4904, 4905}, []int{4905, 4906}, []int{4906, 4907}, []int{4907, 4908}, []int{4908, 4909}, []int{4909, 4910}, []int{4910, 4911}, []int{4911, 4912}, []int{4912, 4913}, []int{4913, 4914}, []int{4914, 4915}, []int{4915, 4916}, []int{4916, 4917}, []int{4917, 4918}, []int{4918, 4919}, []int{4919, 4920}, []int{4920, 4921}, []int{4921, 4922}, []int{4922, 4923}, []int{4923, 4924}, []int{4924, 4925}, []int{4925, 4926}, []int{4926, 4927}, []int{4927, 4928}, []int{4928, 4929}, []int{4929, 4930}, []int{4930, 4931}, []int{4931, 4932}, []int{4932, 4933}, []int{4933, 4934}, []int{4934, 4935}, []int{4935, 4936}, []int{4936, 4937}, []int{4937, 4938}, []int{4938, 4939}, []int{4939, 4940}, []int{4940, 4941}, []int{4941, 4942}, []int{4942, 4943}, []int{4943, 4944}, []int{4944, 4945}, []int{4945, 4946}, []int{4946, 4947}, []int{4947, 4948}, []int{4948, 4949}, []int{4949, 4950}, []int{4950, 4951}, []int{4951, 4952}, []int{4952, 4953}, []int{4953, 4954}, []int{4954, 4955}, []int{4955, 4956}, []int{4956, 4957}, []int{4957, 4958}, []int{4958, 4959}, []int{4959, 4960}, []int{4960, 4961}, []int{4961, 4962}, []int{4962, 4963}, []int{4963, 4964}, []int{4964, 4965}, []int{4965, 4966}, []int{4966, 4967}, []int{4967, 4968}, []int{4968, 4969}, []int{4969, 4970}, []int{4970, 4971}, []int{4971, 4972}, []int{4972, 4973}, []int{4973, 4974}, []int{4974, 4975}, []int{4975, 4976}, []int{4976, 4977}, []int{4977, 4978}, []int{4978, 4979}, []int{4979, 4980}, []int{4980, 4981}, []int{4981, 4982}, []int{4982, 4983}, []int{4983, 4984}, []int{4984, 4985}, []int{4985, 4986}, []int{4986, 4987}, []int{4987, 4988}, []int{4988, 4989}, []int{4989, 4990}, []int{4990, 4991}, []int{4991, 4992}, []int{4992, 4993}, []int{4993, 4994}, []int{4994, 4995}, []int{4995, 4996}, []int{4996, 4997}, []int{4997, 4998}, []int{4998, 4999}}, + []int{2499, 2500}, + }, + + // 可以有多个 testcase +} + +func Test_findMinHeightTrees(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + sort.Ints(tc.ans) + ans := findMinHeightTrees(tc.n, tc.edges) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_findMinHeightTrees(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMinHeightTrees(tc.n, tc.edges) + } + } +} diff --git a/Algorithms/0312.burst-balloons/README.md b/Algorithms/0312.burst-balloons/README.md new file mode 100755 index 000000000..6877993a4 --- /dev/null +++ b/Algorithms/0312.burst-balloons/README.md @@ -0,0 +1,29 @@ +# [312. Burst Balloons](https://leetcode.com/problems/burst-balloons/) + +## 题目 + +Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get `nums[left] * nums[i] * nums[right]` coins. Here left and right are adjacent indices of i. After the burst, the left and right then becomes adjacent. + +Find the maximum coins you can collect by bursting the balloons wisely. + +Note: + +1. You may imagine nums[-1] = nums[n] = 1. They are not real therefore you can not burst them. +1. 0 ≤ n ≤ 500, 0 ≤ nums[i] ≤ 100 + +Example: + +```text +Given [3, 1, 5, 8] + +Return 167 + +nums = [3,1,5,8] --> [3,5,8] --> [3,8] --> [8] --> [] +coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167 +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0312.burst-balloons/burst-balloons.go b/Algorithms/0312.burst-balloons/burst-balloons.go new file mode 100755 index 000000000..25b7516af --- /dev/null +++ b/Algorithms/0312.burst-balloons/burst-balloons.go @@ -0,0 +1,38 @@ +package problem0312 + +func maxCoins(nums []int) int { + n := len(nums) + + newNums := make([]int, n+2) + newNums[0] = 1 + newNums[n+1] = 1 + copy(newNums[1:n+1], nums) + nums = newNums + + // dp[i][j] 是 nums[i:j+1] 的最大值 + // ans = dp[1][n] + dp := make([][]int, n+2) + for i := range dp { + dp[i] = make([]int, n+2) + if 0 < i && i < n+1 { + dp[i][i] = nums[i-1] * nums[i] * nums[i+1] + } + } + + var i, j, k, max int + for i = n; 1 <= i; i-- { + for j = i; j <= n; j++ { + max = nums[i-1]*nums[i]*nums[j+1] + dp[i+1][j] // k == i 时 + for k = i + 1; k <= j; k++ { + // dp[i][j] = max(dp[i][k-1]+k点的值 + dp[k+1][j]) , i<=k<=j + temp := dp[i][k-1] + nums[i-1]*nums[k]*nums[j+1] + dp[k+1][j] + if max < temp { + max = temp + } + } + dp[i][j] = max + } + } + + return dp[1][n] +} diff --git a/Algorithms/0312.burst-balloons/burst-balloons_test.go b/Algorithms/0312.burst-balloons/burst-balloons_test.go new file mode 100755 index 000000000..2640f86cb --- /dev/null +++ b/Algorithms/0312.burst-balloons/burst-balloons_test.go @@ -0,0 +1,37 @@ +package problem0312 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + {[]int{}, 0}, + {[]int{3, 1, 5, 8}, 167}, + {[]int{3}, 3}, + + // 可以有多个 testcase +} + +func Test_maxCoins(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxCoins(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_maxCoins(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxCoins(tc.nums) + } + } +} diff --git a/Algorithms/0313.super-ugly-number/README.md b/Algorithms/0313.super-ugly-number/README.md new file mode 100755 index 000000000..522a05935 --- /dev/null +++ b/Algorithms/0313.super-ugly-number/README.md @@ -0,0 +1,18 @@ +# [313. Super Ugly Number](https://leetcode.com/problems/super-ugly-number/) + +## 题目 +Write a program to find the nth super ugly number. + +Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7, 8, 13, 14, 16, 19, 26, 28, 32] is the sequence of the first 12 super ugly numbers given primes = [2, 7, 13, 19] of size 4. + +Note: +1. 1 is a super ugly number for any given primes. +1. The given numbers in primes are in ascending order. +1. 0 < k ≤ 100, 0 < n ≤ 106, 0 < primes[i] < 1000. +1. The nth super ugly number is guaranteed to fit in a 32-bit signed integer. + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0313.super-ugly-number/super-ugly-number.go b/Algorithms/0313.super-ugly-number/super-ugly-number.go new file mode 100755 index 000000000..e8f1ad7a2 --- /dev/null +++ b/Algorithms/0313.super-ugly-number/super-ugly-number.go @@ -0,0 +1,38 @@ +package problem0313 + +// 解题思路可以参考 264 题 +func nthSuperUglyNumber(n int, primes []int) int { + if n == 1 { + return 1 + } + + pos := make([]int, len(primes)) + candidates := make([]int, len(primes)) + copy(candidates, primes) + + res := make([]int, n) + + res[0] = 1 + + for i := 1; i < n; i++ { + res[i] = min(candidates) + for j := 0; j < len(primes); j++ { + if res[i] == candidates[j] { + pos[j]++ + candidates[j] = res[pos[j]] * primes[j] + } + } + } + + return res[n-1] +} + +func min(candidates []int) int { + min := candidates[0] + for i := 1; i < len(candidates); i++ { + if min > candidates[i] { + min = candidates[i] + } + } + return min +} diff --git a/Algorithms/0313.super-ugly-number/super-ugly-number_test.go b/Algorithms/0313.super-ugly-number/super-ugly-number_test.go new file mode 100755 index 000000000..8b9a5f43e --- /dev/null +++ b/Algorithms/0313.super-ugly-number/super-ugly-number_test.go @@ -0,0 +1,47 @@ +package problem0313 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + primes []int + ans int +}{ + + { + 1, + []int{2, 7, 13, 19}, + 1, + }, + + { + 12, + []int{2, 7, 13, 19}, + 32, + }, + + // 可以有多个 testcase +} + +func Test_nthSuperUglyNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nthSuperUglyNumber(tc.n, tc.primes), "输入:%v", tc) + } +} + +func Benchmark_nthSuperUglyNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nthSuperUglyNumber(tc.n, tc.primes) + } + } +} diff --git a/Algorithms/0315.count-of-smaller-numbers-after-self/README.md b/Algorithms/0315.count-of-smaller-numbers-after-self/README.md new file mode 100755 index 000000000..015e8587d --- /dev/null +++ b/Algorithms/0315.count-of-smaller-numbers-after-self/README.md @@ -0,0 +1,23 @@ +# [315. Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) + +## 题目 + +You are given an integer array nums and you have to return a new counts array. +The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i]. + +Example: + +```text +Given nums = [5, 2, 6, 1] + +To the right of 5 there are 2 smaller elements (2 and 1). +To the right of 2 there is only 1 smaller element (1). +To the right of 6 there is 1 smaller element (1). +To the right of 1 there is 0 smaller element. +``` + +Return the array [2, 1, 1, 0]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self.go b/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self.go new file mode 100755 index 000000000..a613be5e7 --- /dev/null +++ b/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self.go @@ -0,0 +1,49 @@ +package problem0315 + +// ref: https://leetcode.com/problems/count-of-smaller-numbers-after-self/discuss/76584/Mergesort-solution +type entry struct { + num, index int +} + +func countSmaller(nums []int) []int { + n := len(nums) + enum := make([]entry, n) + for i, n := range nums { + enum[i] = entry{num: n, index: i} + } + + count := make([]int, n) + merge := func(left, right []entry) []entry { + res := make([]entry, 0, len(left)+len(right)) + var pop entry + for len(left) > 0 && len(right) > 0 { + if left[0].num > right[0].num { + pop, left = left[0], left[1:] + // for any i + // pop.num > right[i].num, and + // pop.index < right[i].index + count[pop.index] += len(right) + } else { + pop, right = right[0], right[1:] + } + res = append(res, pop) + } + res = append(res, left...) + res = append(res, right...) + return res + } + + var sort func([]entry) []entry + sort = func(es []entry) []entry { + size := len(es) + if size < 2 { + return es + } + mid := size / 2 + return merge(sort(es[:mid]), sort(es[mid:])) + } + + sort(enum) + + return count +} diff --git a/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self_test.go b/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self_test.go new file mode 100755 index 000000000..80faf7d96 --- /dev/null +++ b/Algorithms/0315.count-of-smaller-numbers-after-self/count-of-smaller-numbers-after-self_test.go @@ -0,0 +1,58 @@ +package problem0315 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{5, 2, 6, 1,5}, + []int{2, 1, 2, 0,0}, + }, + + { + []int{5, 2, 6, 1}, + []int{2, 1, 1, 0}, + }, + + { + []int{5, 2,5, 6, 1}, + []int{2, 1,1, 1, 0}, + }, + + { + []int{}, + []int{}, + }, + +{ + []int{5183,2271,3067,539,8939,2999,9264,737,3974,5846,-210,9278,5800,2675,6608,1133,-1,6018,9672,5179,9842,7424,-209,2988,2757,5984,1107,2644,-499,7234,7539,6525,347,5718,-742,1797,5292,976,8752,8297,1312,3385,5924,2882,6091,-282,2595,96,1906,8014,7667,5895,7283,7974,-167,7068,3946,6223,189,1589,2058,9277,-302,8157,8256,5261,8067,1071,9470,2682,8197,5632,753,3179,8187,9042,8167,4657,7080,7801,5627,7917,8085,928,-892,-427,3685,4676,2431,8064,8537,343,505,4352,2108,4399,66,2086,1922,9126,9460,393,443,5689,7595,850,8493,2866,732,3738,7933,3666,2370,5804,4045,7903,8009,5387,5542,7593,6862,1547,6934,-160,9693,4560,7429,9989,7232,-594,587,6476,9277,4471,5979,6268,2419,6706,-727,1927,7361,9684,5519,2703,1723,5181,3545,4290,9421,4288,1656,1541,9632,1448,-490,4747,5416,4139,-845,3834,3349,8594,7882,2279,7777,9369,9917,8167,6799,-612,5604,5787,2615,7033,5986,-322,8631,1793,-612,3528,206,419,1413,8585,5658,-981,1391,8088,7035,6259,-651,3118,9105,4531,2569,7576,7981,838,5715,1387,8506,331,7844,9187,6812,1221,6916,2361,5869,1002,5944,344,310,-981,3541,960,7667,8478,6610,9678,6511,3891,468,1347,115,3683,-982,5993,1875,69,4723,9949,3097,6822,1809,4672,3064,4587,2228,-580,6866,8977,9224,-261,4311,5304,1169,-511,7881,4252,3520,517,1714,6316,9399,8902,-376,4452,-414,1282,8399,1582,4933,7642,6671,1530,6175,2321,7191,9479,7211,6559,4040,6830,7416,602,6970,7978,4941,2225,7949,7398,6964,5912,1328,9818,8268,-999,4800,2510,6984,918,2181,9142,6036,5447,4337,9459,9070,-171,5017,7625,2807,6172,7139,-966,5374,4320,1266,6637,7043,-636,4346,7651,2102,3936,6906,4677,2505,1357,6219,2778,5193,5994,4155,1350,9806,2404,9970,8132,1054,5197,1421,4908,1185,6817,7034,239,8012,1740,7582,8098,8786,3703,2030,8422,3912,3300,8238,4293,898,7025,4871,1781,3688,9833,2108,6812,4171,-539,7759,3088,9106,2839,9216,3165,451,2475,8717,410,5226,6835,423,7611,426,6514,2729,-715,4223,9212,6197,1684,7505,5464,5505,2320,2156,5838,3702,1641,6709,-930,5108,2480,3753,2035,142,530,3975,4683,885,482,7599,2955,2265,-883,6708,8365,6133,1966,1460,7730,9852,3032,4275,1292,5735,1491,6617,6958,9245,2946,-624,1845,7854,-392,3744,-978,9238,-805,3657,1313,5916,2077,6207,530,5617,9580,3298,7353,4722,3747,8642,3237,5917,4639,5602,-728,6265,-826,7002,3510,4661,-310,2975,3352,-212,9713,9852,5880,1397,2439,-820,9292,-681,8605,1298,449,223,6176,6025,3350,4342,2084,4888,4758,9008,4887,4404,9062,162,2160,1016,6123,2511,4042,1376,82,3456,7935,457,1749,1961,8787,4533,1900,4539,5425,2164,1770,8246,7766,-658,3278,5294,8406,1422,5607,4261,1927,3493,2392,6676,3451,5064,2997,6097,7442,7862,2216,5976,3368,6933,2461,9414,7472,4053,6290,2009,1017,1099,2779,8272,62,5264,8398,1890,2985,5609,4586,2658,4991,6283,5220,1668,5944,678,9951,7074,4800,8967,2062,9661,8590,471,4244,295,1796,549,8674,5724,8285,4021,1368,-958,-402,9705,5967,1157,9951,244,5400,6930,3452,1989,330,1980,2975,1402,3279,3690,4176,6125,2907,7731,6372,8838,5425,7919,2871,9449,5142,8611,8283,7954,9166,8249,-578,1611,8126,2502,4890,-571,4994,-683,3989,3653,2815,8919,2543,5254,8529,340,-624,7370,1735,2641,7211,8111,8408,5042,4490,4669,6958,1127,-890,2074,9249,3182,5455,-859,7150,9680,6251,418,5649,4673,615,7114,6124,6321,7104,5576,1016,2925,8126,289,-934,2022,6877,7511,-267,1696,2912,776,1660,-501,9965,454,2819,7877,6270,6488,4653,9768,3312,6005,-493,7951,2899,6184,8353,8827,1606,2664,-960,8820,1960,9089,6693,-364,2342,1542,7639,627,2780,2517,7982,-853,7262,24,2550,-796,9125,3520,4421,2494,164,6166,4169,7589,8133,8186,3013,2380,3445,544,6316,5219,4218,-38,8178,8832,4529,8194,4040,428,5452,5493,7630,9085,8922,7477,2353,-585,7635,4205,2173,1944,4167,3494,6455,6188,4657,3586,-325,5553,9911,4256,1723,1802,1493,9194,5591,3196,-223,2691,-117,8906,8400,2789,2352,7183,2483,5578,4266,-306,2400,9131,7736,2118,8348,3815,740,6895,1493,9705,9754,5703,6496,5884,-476,4455,2538,4539,5749,1977,1016,5680,4140,3049,5450,4040,6545,374,-230,5685,-274,6769,6985,-798,-372,4431,936,7060,2754,2744,5273,4204,6323,3418,495,5399,593,6757,741,-51,4156,6194,7365,8369,3761,2272,9370,2314,6914,4052,2152,9922,1067,4512,4572,5720,9598,4106,8166,692,5223,5961,2677,364,4143,3406,3736,9542,3765,7079,6883,9523,9919,9318,319,9929,6134,1143,4698,9612,106,7341,4280,828,6894,2226,2430,5142,9087,6927,9619,8258,7550,-927,3211,6563,1105,4252,8177,3778,5259,3520,6266,7478,3980,1575,6036,9990,4429,9182,5333,5816,7391,133,9336,8056,7056,4639,692,7110,2537,6815,1097,8222,469,9261,2375,-586,4661,8480,5538,8136,6058,4696,3731,6606,-731,1014,-90,1654,6886,6107,2479,8635,9985,6760,-696,2310,5149,7655,1957,8508,8067,4267,6264,-921,-105,-709,9832,5404,4340,4874,1380,9725,4136,6233,6332,3566,2438,3484,5772,1978,8674,8419,4552,7302,5311,1427,5316,5714,9505,-344,-298,9046,8574,6079,7278,9278,9025,2342,3776,6316,7669,-144,-522,4363,-569,5063,3258,6046,4751,4686,7960,1783,6635,4880,8120,6343,2867,9717,8764,8045,9294,9375,1931,189,6325,-139,6281,-388,5924,4815,1116,927,710,5047,2539,8499,4743,206,5781,4462,3542,8633,9148,6598,-662,3800,1253,-13,3688,2241,1134,7568,9947,7351,508,63,1095,7667,2773,3747,5769,235,5077,7841,-197,5441,9539,5216,1953,346,4655,1223,2132,1612,6767,113,3593,246,3768,1328,9948,8542,3259,1908,2411,9961,3524,8384,3801,-671,1815,4455,5425,8520,9058,9325,6496,3711,2433,1208,5974,8710,2362,-824,1243,6881,4113,1648,9862,6678,8915,-457,8099,9243,-81,8162,5458,4257,8471,-832,2291,7328,1319,1587,3912,3299,1441,5968,3427,7633,9174,9637,5881,4418,6218,5905,6847,-522,9440,7428,5545,3152,9299,1731,5722,-4,2846,9369,2817,2517,9466,365,1006,2647,8186,2194,9343,3738,9113,6461,5186,7680,3790,5677,9850,3599,3606,8449,-49,5545,5368,3938,9055,3488,35,6692,5937,6324,6136,8021,6032,3526,9639,6555,-47,4333,9436,1621,3893,9982,2777,7300,2105,6549,4584,6186,3708,5739,257,1729,4840,6098,7953,6575,1176,3646,637,169,3151,9486,9133,3686,1780,2044,-725,7576,8602,318,5126,-503,3678,8473,366,-273,6206,3329,7449,8260,6356,2584,-507,9635,2191,2085,3296,9386,1934,4715,3596,8387,5777,7565,1498,2966,6248,5309,8700,6752,579,-517,5712,6112,3443,5189,9322,7061,6511,1100,8506,5422,5206,6468,6521,4366,475,511,3687,1438,7213,9831,1864,1997,-922,3933,6013,5663,360,1203,7981,-486,2277,4924,4344,1916,4247,6971,2184,6671,5118,8156,5660,9056,4206,1603,8901,-999,8940,6757,3564,3756,3216,4452,1999,6922,6630,-882,9982,2340,-698,904,8642,903,7716,3505,8439,5719,4893,-442,3284,567,8991,-2,5119,1017,8683,7914,-683,-938,3958,7051,-729,8211,-699,9536,1634,1405,4296,-770,8602,2730,164,9906,331,584,-955,6185,4632,4550,4369,5737,8825,7303,2248,9028,3021,8359,1754,3037,5342,4757,4787,7864,4949,7283,1571,5827,3851,3148,7441,4384,5452,5609,6773,-727,355,2989,8771,3370,244,8380,9480,4839,8414,9408,8085,6775,2640,8403,263,1935,-544,9270,6237,1017,27,1780,1114,9586,5859,1227,5593,3130,8592,1040,7364,3465,-4,94,301,2938,1555,7759,5278,4390,-167,4905,5228,2601,3484,2349,8010,3956,9257,1393,553,3389,4562,1260,1966,9315,4666,1569,191,3479,-717,-60,-477,5924,2027,5531,4063,5460,3232,720,8161,7049,7375,1440,8728,2705,2994,7680,7914,71,9188,1485,4452,1425,5519,4,7129,4943,960,7946,6709,7035,-591,9704,4897,-402,3870,4447,8932,9575,8197,8382,3640,7782,-352,2209,480,7902,4827,852,3,6087,5001,5581,-582,3275,108,750,3642,1096,7237,4662,6547,-271,8013,-33,1713,9345,7500,1560,295,5041,422,8657,9374,8883,4466,6731,1191,9552,1462,244,6637,-722,737,3542,3099,5856,-490,3675,9865,7561,2431,9036,5846,7077,8970,172,2696,1510,8717,2647,9465,5455,8510,4990,211,9327,-432,4994,3262,6228,818,3362,1782,2079,-551,1937,1974,1956,6903,7234,3085,4678,9674,3635,2843,-125,3930,2661,702,150,5492,2351,2161,3758,8235,2101,3287,4149,4510,5726,1075,-572,5022,3096,8546,-235,5658,7021,7516,-849,3923,6519,6023,-67,7530,9333,-749,1991,8833,2535,4104,2583,1631,7557,266,4937,6492,2077,6813,4315,9968,-723,5753,2833,-984,4953,8055,9845,3436,3593,4356,6059,8632,4472,513,1409,641,-49,1407,1049,1448,316,945,8206,4936,3395,7808,-134,28,9538,9082,-9,589,9798,6046,2165,6846,1924,6466,4648,6240,4513,5002,5493,2400,3220,5578,4002,6948,5161,-426,3673,9618,8592,4690,2011,2248,8558,7890,5397,2414,3568,8190,9334,7378,8542,4147,5964,6820,7219,6007,1407,5325,4191,259,7098,8980,742,3111,3783,1089,5273,6546,7302,8216,953,1804,-481,-79,7487,9827,2757,2132,-836,8545,2017,7649,2550,8651,-259,112,9355,5483,6124,4499,3851,3927,3561,5420,2964,3498,7861,-727,7656,4914,596,5593,2520,4104,3810,8500,7971,1303,7801,3652,7840,8550,617,1739,5990,1798,4251,2104,8698,197,4552,6506,8751,6143,4879,5305,4796,3192,2759,5221,2096,4803,8211,4675,5288,8721,435,6416,1868,-887,8444,5363,5804,-485,6296,7503,5177,1445,4364,8153,8206,-230,4387,559,4229,8308,323,3792,9869,4525,5948,8213,6352,1412,-390,9143,537,-582,6238,9643,1072,400,4239,9040,5220,4827,6921,9102,8268,2914,1248,5472,6122,2742,2638,7357,1202,5933,3230,5463,-784,1159,7994,8755,2976,7185,6975,-299,-256,1368,9408,8662,1245,4797,8642,9461,1115,-815,-872,8049,8542,7994,6512,8794,5838,170,3264,5602,5492,4453,6291,1590,3856,7289,9827,4455,7641,9615,6093,4468,1733,909,3910,865,8837,6111,8485,2202,8003,3576,8703,948,3971,3893,9810,3662,403,5996,1806,6435,6070,4199,8086,1765,1545,9266,8059,2547,6616,7594,4092,7027,2958,1901,4317,5928,7803,7822,6045,3648,1002,7468,3107,7911,9291,7053,-799,5713,6362,9234,7945,9627,449,7527,6293,4788,8137,9964,-194,6293,3880,5948,6131,1404,8863,3288,3936,7135,4852,5818,7153,1515,2695,7623,2483,-229,3272,4167,9091,8562,1823,6680,-393,9592,3987,3519,9027,431,6601,3349,4221,2650,9707,8329,947,2896,7380,271,4265,7562,9119,1644,276,6563,6196,1899,3443,4258,814,5490,-442,6866,2299,5408,8618,1679,5215,-112,3825,5229,1501,5265,8302,9624,3512,9561,4379,1683,9040,9995,4379,7870,7286,8820,5388,9639,8669,7312,4337,600,1832,-598,1490,7416,7613,3554,1448,1881,7148,4921,6560,1789,4394,5017,7106,8568,349,9005,7629,8863,9906,2578,6780,2999,796,5315,3078,6506,5431,3948,2838,3816,9748,1747,2969,1603,8499,9807,9594,8628,9711,9641,1328,561,4425,683,-858,5647,5565,2354,1704,7008,6352,1793,9380,1218,-636,7071,3875,7003,-106,20,-233,6777,6512,5610,1879,7585,-498,-216,9206,-282,4464,4777,723,3981,3419,4044,-926,8941,9878,3411,8201,7237,6021,1697,4294,1541,9335,459,-450,-195,4427,331,6519,4529,7777,3748,4326,8234,6921,1101,6842,-109,3938,985,4190,516,589,4272,1807,8101,597,4041,5117,9822,882,9580,9769,7662,3042,146,6872,5925,791,2336,5846,2183,-923,3747,6417,-107,6681,4133,9693,332,1465,9276,1447,678,7049,6248,8105,-348,9761,5127,757,8455,8143,3706,7640,5650,354,1019,4300,8655,9336,4627,306,6901,-56,4467,4367,6901,8791,2412,192,6439,4356,-847,5751,4701,7719,3345,6927,-361,5697,6065,3873,1565,9350,3172,6401,2312,2249,3740,1633,4289,1829,5730,8011,5999,8216,4922,-405,1165,9984,1589,8064,4536,4097,7626,5934,46,3502,2133,4861,6149,9568,4446,6372,9923,-602,3980,8588,3613,-908,3301,8202,5073,4156,2813,7170,1164,1578,8893,5499,7758,763,549,9917,3841,-761,8625,2424,-317,9725,-540,287,4221,4157,6819,7719,1309,6090,1731,6922,3700,5172,664,-436,496,7288,2719,4908,1976,1575,4507,3410,53,-659,965,1691,1707,5954,-175,2736,7619,-931,4906,-768,7343,59,8041,8075,1058,2702,6003,9820,6096,2527,5953,-717,883,-231,6228,1391,358,866,260,3101,8641,-372,5667,1210,657,9227,5544,4504,4647,2667,947,8308,6520,329,5929,9997,8624,4168,5434,-993,1131,2820,2748,3763,10,2094,2403,8224,6195,4941,9734,-85,-398,6054,496,5659,8596,-942,4663,1754,9837,-233,7771,4194,8622,1651,2475,5615,7846,3913,1623,1083,8004,5761,6974,305,7640,-837,3782,656,-717,9048,3480,5440,1502,1223,6831,7456,2639,1605,7579,1646,5079,8384,2315,1148,-872,2480,4633,902,4336,821,-266,734,1137,6649,8472,7373,6875,7803,1285,7911,4299,2857,2842,1448,340,4335,429,9776,1335,7687,683,4514,4751,1479,936,911,6723,-438,593,7598,8586,5595,-111,8732,9909,-260,8150,3642,3685,6775,9833,8285,2350,1558,6610,7478,5397,377,1331,7452,6149,4946,-16,1431,8751,4324,8417,-814,5213,881,6885,7087,6070,1096,1359,4582,3919,1093,2530,8169,-916,6475,668,2965,8395,748,8338,1720,1324,5422,9287,5921,7563,2004,5338,5460,7600,-20,1487,1021,2152,71,6892,6357,-104,9696,1950,-525,-324,9454,4285,4928,4694,3226,2359,8443,3353,1362,8109,568,9809,2374,8087,1530,486,4339,4550,9728,7511,3136,3666,3063,916,541,3674,421,3044,3382,8974,-269,8042,6509,5186,3427,3510,8015,6505,5923,7052,8995,3886,8802,2722,6875,5622,465,1562,4542,-824,5079,1040,1446,9077,8536,-215,8083,1398,2181,1753,5125,8284,2717,5165,3487,6588,903,5640,3969,2772,1301,8207,7933,1308,4202,1029,-397,9190,-829,478,6586,-563,7956,-903,1485,8742,7332,3453,5534,194,2538,8786,29,5057,9897,-641,1517,6947,7080,5235,-514,1985,4365,4503,6966,8363,4894,7093,595,7236,6176,880,6247,2312,540,3776,4902,5499,1746,5848,356,5310,5425,5038,6360,3638,6433,4940,-286,5083,4480,3923,1785,8882,334,4927,9559,8792,4666,3768,9420,4492,3344,9996,5597,6670,9026,3778,1827,8328,9543,8398,356,8833,7291,-831,8190,-201,2713,6153,7648,3413,2336,271,4000,7087,8194,2358,627,1600,1974,1332,9932,7769,-620,4275,9764,3689,1293,3888,7263,837,-26,1669,-357,9699,5446,8475,3114,3057,7832,626,6912,4788,4679,2674,5367,2838,1970,3505,4018,693,6753,5461,4766,2281,1306,6972,1764,9671,1153,7722,-148,9946,5831,854,4605,6310,6948,2018,5290,-541,5899,-555,5220,1609,3818,2086,2699,5137,6093,8520,9930,6770,7570,3113,3629,1886,9551,9362,5585,2498,9412,9107,8208,89,48,3235,5614,7411,4551,3203,9746,8057,1263,2113,6876,270,2090,-7,1649,6172,6607,220,1366,5694,2569,-519,7645,5665,2938,6192,1994,2985,6290,-458,-867,1643,1187,2065,2078,7302,2904,3684,2407,5816,6043,5516,6317,8489,-684,-609,2925,1399,4185,6900,5552,4558,7980,5530,-943,3672,5107,5763,414,4781,6718,5509,8952,7528,3756,9731,7352,4254,147,2684,3434,8231,9878,9611,1684,5510,7124,9059,4569,-139,2966,6949,8356,1406,906,6581,9660,1030,2649,4878,2568,334,9531,5667,9102,7191,155,3085,5959,5141,109,-312,8457,7882,1920,-665,2709,9119,728,3992,9354,3566,2174,8331,7861,971,3045,8428,5954,2486,2582,9346,3038,8231,1414,4279,6878,6350,-622,2991,4372,6911,4604,21,4828,4690,9142,6293,9799,1382,4552,3033,3577,816,6945,-495,5553,6557,760,5344,1122,8722,5872,3912,5560,6512,3608,1818,-649,9391,2875,1556,-69,849,788,2844,-540,9727,5641,5131,9668,3971,2971,4612,8215,6910,805,7064,8866,1457,6679,5047,4730,2273,7333,6570,8396,2280,996,3813,1634,-825,1535,4462,1072,8452,1727,9304,-672,6998,7530,866,1670,1989,5024,7449,7819,9974,1438,8971,2586,9806,4011,1032,5059,4537,4484,-112,3292,5738,6848,3824,27,7462,6771,9221,-406,5300,4572,6666,2385,4347,7939,7728,4780,3224,60,2409,2944,7777,2859,2057,9543,-401,7318,3605,480,8773,3419,8669,7405,-710,2190,7699,2235,73,3635,3558,6149,234,5206,7540,4983,4369,9483,8050,2420,9645,1315,7895,2844,9540,8159,8570,7474,6953,1040,3061,6179,9557,-284,1446,1289,4901,2021,7562,-732,1244,5005,2082,8427,-205,-253,3756,1403,6612,5085,9844,7956,8671,5829,4068,9505,7809,3178,-29,4789,9062,5391,1885,394,-146,6184,9288,916,7399,3402,3252,7584,233,-381,7594,-886,5536,3478,9891,8255,9435,1979,1459,3287,2771,8715,5793,6542,8549,7959,2729,4864,9049,8265,-904,4930,4980,84,4311,330,5980,9263,4042,9335,7134,-538,2340,-673,7051,8998,1808,2763,5070,3005,1167,4604,2564,5557,8652,8129,202,3396,6814,6708,3055,9245,-323,5964,4349,4550,9209,-200,7533,8839,6623,7406,9111,9592,1538,3843,1962,-941,1453,238,2624,7539,2111,3177,9574,3404,369,2437,3007,2834,5334,9612,-287,-742,-585,4028,9908,5594,1769,3467,7964,909,6543,5628,9248,8075,4748,6446,-537,6265,7987,490,9359,2894,6115,5055,-150,5522,8748,4998,2335,4229,6110,5335,2069,914,8491,8404,-36,8730,8229,5085,7524,6799,-530,3132,4600,6914,8407,6439,8630,3859,697,-240,4056,8935,298,1907,347,1149,3555,8726,4936,423,3145,8372,3849,2315,5842,3824,549,4898,7676,6746,1133,9779,7377,9611,64,9987,9405,-701,2016,6889,6815,6191,4672,-107,2521,-20,346,4686,9064,-185,8709,7213,1684,9009,-567,6676,213,7708,4586,3242,-658,8752,9326,6683,6736,3492,5809,3542,310,2098,1024,9670,3049,-149,5850,8121,2547,151,1844,186,1085,-200,3087,3051,7712,3368,1428,-845,686,1927,6312,7841,817,37,8283,3504,6467,9795,-394,2940,3452,4076,2918,1123,2981,1349,6682,4047,4404,9545,8878,3566,9100,897,461,-519,1000,2577,23,2979,2801,3804,3444,1375,8297,5401,1113,8479,7745,-315,7226,6173,5289,149,4569,-14,2413,4840,5928,-431,7021,2984,3493,4001,3911,-815,3501,4011,-466,9164,6402,9830,6303,-884,5336,1826,625,4335,2956,5501,7576,2293,6779,7043,8022,8815,9971,8377,5663,7871,1327,4521,1468,8710,5115,5101,1698,4931,2247,6158,-933,9012,3824,1698,62,3157,9741,2613,1688,269,5702,5935,8921,-50,6172,7181,6173,5737,8902,110,8319,2188,9720,-910,-783,-894,1169,344,-381,1031,4143,8407,1371,820,7092,7738,901,7988,9350,5655,188,8884,6695,597,4160,6252,3057,2499,1246,6258,1557,3484,-263,3367,6956,1552,9861,1870,1328,-487,8651,8045,4475,4153,888,4266,3090,3226,6372,2077,2542,9401,-846,8973,6449,8149,7662,8781,2881,2866,7805,511,6434,-88,-569,983,8913,8576,1100,3892,9272,6291,3979,1184,1142,-140,3747,9029,5235,3330,6124,4539,6871,7353,8384,8139,1783,6688,5392,7359,-881,6512,5048,3348,703,7283,-828,484,4245,7655,628,844,2853,4287,8989,1721,8261,9047,8691,9802,1022,746,1955,1379,9983,3465,6810,6503,8667,9067,4670,8532,6461,-542,6735,8007,6979,823,686,7618,4376,3532,8143,2348,57,7990,6996,1530,2846,8801,-634,2633,420,8171,9375,5993,5918,-409,-300,4405,1151,111,6599,-29,2646,1664,7720,9569,437,7964,1146,5299,7997,2041,7162,9109,7680,4940,4163,6989,1937,3220,-353,2643,-864,9167,1211,-671,6189,961,753,2407,5322,5093,5146,4215,8762,2163,8048,5623,5239,3023,-984,4775,8600,1075,907,8847,-998,1241,4057,3466,-11,4284,3750,2755,7501,6002,2615,8465,8455,6595,8491,1726,4575,3557,7816,1119,9954,7310,-938,-680,8347,7448,4705,4354,6115,7185,6905,4775,931,9458,-195,7426,134,982,8722,8698,8888,4549,6816,6509,2757,6875,8647,3833,7503,1436,6233,4728,9187,2520,9494,5585,3689,6427,9999,1353,1768,2965,3554,8629,843,-255,5551,737,7897,5039,6233,8282,5527,9305,1910,6272,3313,1329,606,585,5703,4571,7306,3677,5433,7016,-441,104,5925,8177,8282,518,6288,6746,7710,9942,-147,3694,1205,-802,5449,9765,-321,3115,7149,9418,6934,5718,9295,5493,1931,1092,8171,2770,3573,-133,6384,8499,7071,513,5687,9925,4356,4417,3357,2113,9150,9248,878,3289,7910,1300,1472,9702,1076,4844,8374,-956,-855,5183,8348,2598,9007,6800,3825,4709,4678,6883,8787,5185,1271,8774,3466,153,2436,7253,7522,2179,700,5966,3882,5316,6695,280,996,7831,4494,-594,1450,8196,2969,4678,3972,5363,9918,8438,6073,3920,5828,4561,6150,6280,8809,6542,6128,4791,1350,-589,6830,2692,2157,5506,4480,6019,5544,6751,7913,4909,5712,7593,447,7773,6073,3664,6156,398,4679,6734,9039,5826,104,3543,740,3359,6617,919,1511,-387,4985,9964,3583,120,3639,7110,3497,1623,6074,8766,7144,2716,464,5176,24,3180,2653,710,938,6663,2737,3919,5560,3191,9070,-12,7016,6784,-16,4844,5995,3293,-644,4175,5477,347,466,1721,8960,2424,9477,5932,2160,9940,9098,3411,7409,4809,5506,6784,7598,8500,5358,6928,2703,9115,5889,1595,5599,6316,-611,-572,6462,2943,7732,2448,5168,-452,69,2491,-341,9973,3656,9792,2915,6347,5450,2884,1273,5931,6361,2362,2680,1149,346,8518,81,7770,9916,3828,4938,8936,-35,5269,7662,8818,3797,4916,6567,3861,4820,1758,5910,4899,5046,631,1956,187,9079,3463,3873,6770,976,9415,2778,9935,6030,2278,7929,7813,5039,9346,1346,-836,5447,7919,6947,6608,7639,9953,165,-776,5969,2198,3260,5540,92,8400,5052,-907,7216,8854,1410,6368,6307,6411,5546,986,726,6800,9022,2211,4972,-217,8152,1914,5270,9754,5949,6864,726,4871,3831,3540,-645,-798,3752,2859,2383,8457,9116,1168,9817,290,4303,5551,237,8233,2384,-710,7912,9657,8341,8946,2651,9903,4308,5646,1396,2054,7935,3975,-983,3909,8766,9371,1278,-82,796,2209,2621,6283,9236,3358,9182,3481,8336,2099,6899,4510,5784,4174,2102,6583,1712,-983,5615,1784,-800,738,8470,3685,3070,8304,-131,7591,157,-909,4277,8073,3007,9684,7121,-551,124,3560,-706,5659,7542,5828,-194,6697,7534,2138,2000,908,6477,6952,3684,900,9580,7501,2291,56,5219,6511,2902,-709,2196,861,7394,3737,5238,5262,5997,4872,8996,7659,3325,4221,8563,3728,5191,1392,6445,9212,-223,9082,791,863,8972,-673,540,7716,6880,7429,-669,548,3405,7392,4962,4841,1357,5961,6008,9801,466,728,2745,9750,117,1889,944,-921,8483,4964,8539,8830,9403,3676,2883,535,2524,2992,8236,4812,5617,2779,5567,7816,9140,7324,5307,3336,9102,1560,356,9530,7293,1810,9141,6338,1589,4773,7826,3063,6381,6098,1790,9625,5595,1825,5925,3959,6992,4332,6019,-7,9074,1209,8322,1554,5827,785,6916,7568,5127,5883,5304,4602,3496,3228,9568,5287,8425,730,9021,6057,9450,5053,-549,4588,1451,3337,9475,1050,1681,7256,9419,3478,9569,148,-643,3903,9674,5404,2836,6783,-620,2610,7080,5057,9577,5108,4592,7221,435,9225,6914,6261,946,-13,5981,3017,4569,1626,1940,9176,5170,5763,5104,6629,7879,4751,9063,2349,8173,6337,3,3033,9631,4907,4653,8077,6579,9433,9700,9863,3082,4582,6033,-745,8549,576,7137,9155,-407,6198,570,7831,2656,8994,8800,2727,5829,6872,1869,1247,6746,6617,5404,8737,3568,6186,5350,4347,905,5032,8501,7058,8724,5425,2822,9372,333,4516,8713,6075,3536,6239,7811,6455,9917,9111,798,3249,-761,8918,62,3911,-45,7024,5920,4266,5390,2835,9087,1404,2581,3730,4396,9259,9484,9377,3897,2307,5673,4124,4050,92,7264,4052,4225,6460,4787,3625,6457,7829,8027,474,4449,6819,7910,7831,1599,6774,9749,6218,9215,6607,3967,501,-258,3484,1796,9745,7875,7622,4869,7634,9116,5130,7535,7154,7571,6190,2406,8232,8883,5822,7172,4149,7520,4658,6067,2653,2310,84,5280,7145,256,8705,703,9054,6812,4360,2821,1339,1168,4943,9323,-639,1335,8393,2908,9985,4847,3079,9097,2895,4759,8293,4916,-587,6565,-431,-750,4103,3136,4561,4751,9179,8330,-571,9926,-670,6096,5633,-286,3281,3739,-280,2667,3104,5136,9012,8767,6918,8491,8572,4128,862,7640,2360,-106,1030,6697,786,1948,8788,8659,9061,5596,8445,3305,5846,6511,4999,5282,5321,2797,1735,5392,5772,-23,4934,222,-955,5738,7119,5337,582,3203,4554,4391,-787,-667,3235,979,2056,6200,303,9188,2821,3700,9942,5834,7193,3379,2620,1318,7027,8549,7635,7231,1701,2895,5658,1647,-34,1697,1806,-588,4781,1408,127,5403,7320,9995,8595,8258,4048,-698,3736,7343,3267,-466,9779,8551,8014,2617,9496,6011,7347,6559,3488,2522,9264,2660,4729,63,-408,8100,7765,-126,5437,4202,4682,9065,1020,184,9450,5997,1759,4491,8932,-542,8064,2530,5500,-911,7157,7817,4255,6655,5277,9215,-300,9331,1023,9097,4802,1272,7031,9200,7906,7953,5007,1354,837,3016,9036,5377,8707,60,1745,1277,5390,7552,8232,3589,1080,1615,-221,9090,2625,6183,4632,5437,225,7686,9600,2262,9179,8517,4844,2635,4488,2928,7545,4530,7637,332,4370,4796,8779,2871,7834,4565,6267,1569,1241,6856,5165,5350,4637,3317,505,985,1922,7994,4171,2136,5138,353,1610,6611,6206,3177,63,7776,7472,-168,8225,8910,1315,4553,7458,6912,3164,5876,2112,6395,8937,2238,8023,6836,7014,6256,-253,8723,3980,4737,6783,1909,2268,8811,7558,4305,5117,-764,1447,806,6672,4467,3624,79,6709,55,1327,5461,5277,3032,5611,-147,5933,8557,3990,2775,1162,8831,-676,595,2646,6274,4454,1990,6947,941,1086,5290,4710,5441,6395,4669,4330,6649,-867,-979,654,6599,3640,3881,2629,-726,9893,-921,4094,-133,3993,1343,1748,5781,5265,3307,246,3766,1925,-39,3778,8622,1755,5092,5465,7080,4440,7556,8290,4722,2720,1452,8235,3161,6204,3471,5575,6561,9884,5349,8356,1173,8844,1406,5924,8716,-42,2456,384,1615,6979,1089,922,2384,5158,2279,1872,837,2086,8190,4128,1907,1249,757,2754,6781,3428,6485,7708,2196,2575,-59,6810,8732,5624,3299,-393,9155,-939,1079,1728,295,7104,226,6305,4489,8674,-132,9217,8226,-391,9832,6918,2464,5522,8691,8957,544,3175,1748,4981,9728,8572,5363,821,7583,4628,6837,3395,2012,7800,935,243,-474,7930,2851,3992,7960,1205,1232,1115,-411,7323,6201,1144,1801,1284,6310,2446,7227,6151,503,1367,5396,9645,-361,9317,2667,2735,1224,6687,8485,2565,1055,8723,4965,8675,2611,9534,3661,511,6929,4668,2734,6503,1325,7322,3390,9864,2976,2158,5116,5864,2719,3720,2555,8877,8625,2232,3942,1084,6029,3555,1374,616,533,7791,7466,1212,9619,9073,280,6521,713,494,5435,3423,6602,9608,-12,3012,6815,5095,2339,1629,-452,-296,7626,7548,1902,4234,2913,5500,1143,6403,1497,3835,2566,7443,307,6450,7850,8868,3108,4319,1984,-635,4665,538,2272,6845,3617,8742,9432,4058,4932,9791,8533,3156,3602,1474,2046,2658,933,6871,6526,3036,2083,8177,2480,4342,6520,5618,4681,-353,-299,250,6380,6004,-322,4727,3124,8033,7712,9454,2435,8778,8386,2100,8332,536,7170,331,3734,8262,7382,7712,3636,1060,4770,4147,1025,5148,3605,5098,6373,554,7897,3682,8309,6594,8575,660,6221,1356,921,2362,3148,8003,7977,3413,9331,5870,6885,5087,3410,6133,841,9934,9316,1043,5055,4670,9511,6793,3507,3704,5458,5339,8234,44,4826,7931,616,9200,4115,67,1366,816,5670,2180,4867,5822,1250,2043,9005,2272,1569,9302,521,1957,1001,8750,205,-145,7029,8227,8054,2936,2273,-513,9315,-131,8312,915,7917,7755,5103,3280,6700,-133,6596,7581,4074,3973,8589,4535,2644,2732,746,7097,8639,7887,8990,8606,6213,9174,8591,192,4051,2199,6020,1778,3931,3093,3907,7519,2074,-394,2739,281,3194,4692,5142,5730,-759,1884,3401,2021,7432,-981,3790,1797,8945,-248,8768,1190,-132,5078,2503,4080,9443,3150,9194,758,1477,2172,8608,1758,6204,5422,9419,6247,5378,4948,6218,4909,-299,1486,5239,5123,2470,-173,6588,9831,-581,6357,5046,1973,6224,1536,6424,6706,4126,936,9321,4425,5712,-127,276,52,3646,1216,1426,9720,6879,1722,4464,3425,-955,7568,7205,9326,2929,2536,3121,3272,1908,506,9725,7957,6154,1173,5803,-798,-977,2980,4869,314,5292,-216,3823,9664,8202,-462,6105,957,3934,194,5899,5852,831,-799,5891,4627,9478,4842,9106,8799,3900,7259,8797,2244,6539,6269,2130,-468,9109,464,5537,-686,2491,3077,7529,2502,373,-682,5650,8394,3820,6231,-391,6579,2828,1288,8065,7174,1546,238,8909,2685,-571,6370,3903,6762,144,5039,2046,3364,1712,5891,7048,2870,5597,9580,7372,2002,4702,4989,4684,1715,4484,6583,3927,1554,4197,5558,8588,2800,3499,1444,907,545,2175,6796,48,2778,6798,8490,9866,259,4396,8487,2244,7965,5069,2796,2294,5988,9492,3952,2883,9422,9946,6299,4511,4618,7431,2151,6899,6004,-229,2824,-426,7476,3190,9344,2458,6005,5827,2105,2582,412,9897,6649,6166,4863,8724,2077,6457,1623,9299,9878,9006,-212,1685,9297,8671,4721,3614,4210,2023,704,4146,5015,8289,3013,-457,7955,3342,6514,-950,7728,6703,6509,2197,5639,6375,8515,6276,2871,3724,338,3450,4048,-707,8831,400,8877,9803,9612,7361,7999,2085,1480,6460,9261,7444,357,3112,6072,6503,5260,7309,8935,5869,8519,6809,9783,9062,4832,1427,214,2966,5235,1320,-432,6445,9920,4410,5447,5527,8441,3231,9122,3249,3806,624,9171,-152,1426,657,8886,2039,7147,9008,5103,4331,3203,4919,-668,4928,-981,1950,8154,3275,7464,9797,938,1161,1342,8275,6522,3673,450,5846,8633,9722,5109,5374,1490,-965,1109,9131,3588,4838,8917,8146,8216,7968,7333,245,-861,1763,6059,8099,9451,1741,9029,8916,2061,3959,1613,-41,5068,8941,1295,9840,4254,6566,1823,9402,1534,-205,8597,3371,1065,4264,1117,4864,5847,9091,472,-529,9467,9389,4274,1005,449,2865,9541,9786,4103,2196,2479,-331,9948,547,8202,618,9875,7244,2043,9947,8998,7501,7002,-461,5337,865,-698,126,8237,3823,8832,7661,72,223,4523,2384,1131,-319,5384,6675,6280,1248,4429,7786,-37,7173,2435,-704,5289,6544,9505,8,623,4541,6642,2693,464,6652,3810,7080,2110,8271,3999,244,4346,7996,2228,8952,5381,2139,8632,8561,4747,4263,9657,6640,391,2132,4517,6833,3711,4470,9554,3652,3243,8485,667,4697,7899,3499,9251,5661,-148,365,3341,-334,5506,9416,326,3125,8000,8692,2278,2419,6572,9732,7205,-570,8282,7041,5291,9192,7600,8801,9616,1304,3040,345,1652,5736,-901,9252,1019,4695,4581,2284,9231,1401,505,2388,8236,4930,1236,2360,1826,-663,5360,1387,4665,-218,1938,4893,440,8815,189,1347,6904,5859,5557,5235,-519,946,7802,3990,3403,7323,6859,9923,8979,3904,3879,3369,6471,6430,1681,-38,498,1047,6758,3831,-830,3671,2901,7956,2470,6235,8856,1058,-636,6089,6333,621,5480,6461,-217,8573,3283,7374,8914,8250,8709,1466,-285,3759,8279,1211,2940,8233,-334,9013,4677,6821,8333,8439,2727,3338,7733,9295,941,5909,7098,2262,7158,-785,732,7157,60,1189,7136,9122,4348,9026,7906,6322,6245,7255,-335,9573,6818,-7,3527,7858,-211,2700,6095,-297,7349,2744,-90,-623,5371,5875,4612,1816,5475,5976,-254,5882,6994,1630,7897,1595,6900,6267,8857,7339,5310,7324,4696,-8,7384,710,6696,578,8881,1436,6935,4246,7231,-991,2560,8157,2267,6036,9486,1557,1305,9612,3119,8814,7461,5154,6960,3696,7071,4901,5845,6840,1968,7724,9836,4265,2003,2651,5782,9900,534,8648,2660,8759,4969,1577,4302,1304,1636,7804,4583,4930,2737,2252,2968,6843,7627,-249,-863,3117,2491,4794,7090,3956,-361,1105,277,3979,-811,7344,9425,9065,3798,2050,3923,8915,6868,2756,4234,9352,8930,4847,2958,7037,2239,2729,4382,2954,2767,-175,6318,2167,1573,3805,1021,7218,5935,7360,7200,9314,5443,7491,843,1821,7390,-388,9842,-813,6265,5646,3537,1936,3425,7249,9037,406,8650,2782,2610,6968,4068,8349,3153,5628,1694,4333,5730,2447,3388,3731,-179,-524,-867,6634,6928,5036,9175,7178,5985,9500,8982,3791,8220,7248,8101,-102,9158,4232,936,-149,3760,8957,-62,5193,8949,2254,3542,6445,4361,2939,6470,8529,1696,7003,1632,7384,2359,2904,3691,4666,3147,403,5992,6926,-955,6446,-124,2638,4207,2517,8094,-412,6297,5734,3262,1300,1489,2755,3285,4322,389,5738,8810,6065,2176,5387,6264,6616,332,7727,4304,4276,7090,4640,5770,3856,6320,9094,-199,6178,864,-177,4361,8137,6536,6414,5356,5045,6211,1653,5602,-278,2420,3357,2519,8417,2037,8418,-66,7120,6700,5178,-710,6596,6126,3024,6148,9619,6128,8922,-676,9909,1662,9526,1434,8366,-516,1351,8167,-525,-51,3978,9521,8915,6515,447,-993,236,3256,573,1179,8137,4173,691,7781,976,7214,2888,-524,3032,3422,35,371,8872,3423,8574,1836,4721,4582,2218,9157,9953,2274,329,7959,112,8569,9624,1113,7250,4104,6515,3637,1239,4341,8656,1799,7075,3833,2620,1887,297,2269,8688,-671,9769,4995,775,9766,4204,229,3072,-105,-433,8655,8992,7136,9445,4929,6656,7827,5044,7444,4016,1517,-817,2274,4636,3109,4528,9366,1935,4285,9549,6050,2720,7457,8146,7207,2431,2661,8346,1225,275,798,7959,7216,3034,6109,410,370,1469,-461,2651,3176,8730,3065,7219,1015,7886,-927,1008,8148,-961,2641,6864,3726,9478,5222,1631,8273,9559,5328,593,9383,5420,3569,6680,6083,7822,5271,1674,4830,-909,-944,8746,9277,7212,3556,6598,2647,3294,2002,3166,7482,7175,5717,7707,4586,9191,6909,7613,3134,6853,5947,9134,1556,455,-540,1346,7179,3977,7778,679,4818,1850,2116,1754,8901,8031,-860,4236,9395,132,3696,4527,3848,2965,4065,2226,-823,-443,7556,1436,4859,9405,4615,-680,641,-526,9711,-642,6996,4872,2683,7670,8481,2312,9094,3788,7686,1932,6855,6850,796,2494,1659,-836,6873,807,6286,5403,1968,9876,4789,-826,3352,5582,6964,4390,5623,2958,7502,8028,9472,268,1485,1895,8284,7057,8157,1637,5315,8596,6688,1665,2742,-126,3941,5956,6190,8034,-647,6645,5592,1383,5009,2834,201,9981,3653,2470,4137,3121,9451,4060,-114,-184,5475,505,687,5716,4601,4916,5745,16,7733,3489,592,7280,4417,3049,9286,8261,1804,4444,2089,7117,1427,7581,6438,6993,8092,2280,9448,2324,6269,8090,2796,2666,1339,-862,4487,-98,5448,7162,7373,9751,4188,7829,3499,3153,4639,2541,6372,351,4408,4446,3637,6293,9887,1261,9478,4666,535,1725,7783,6186,6000,8781,6668,3208,1980,3499,7715,656,3732,9672,3613,9235,2245,3344,2834,3511,-789,3595,2316,2649,2066,9220,8474,1353,9508,7618,4524,7849,8544,193,8636,8062,3289,2895,3124,3565,3665,167,4290,9442,3717,5917,923,4003,2141,2020,4348,7699,5383,5781,763,1019,8521,7540,-493,549,6419,9555,5619,1145,3843,4348,1404,8638,5807,-196,6921,7685,664,250,6998,59,5665,568,1391,4087,8627,3937,4180,9373,1993,7062,4091,1957,1851,9824,-242,1932,1318,6892,2982,-259,4928,7732,8319,9696,8931,6753,5216,6520,3756,34,3006,8213,9673,7111,815,4771,5786,1446,5555,5049,4319,8615,6246,9769,2822,2755,2579,7121,2554,2070,154,6803,2362,4541,6567,5926,1805,6843,4020,2962,9695,1533,-911,5386,7263,7444,-313,654,3466,6513,1705,3927,7605,846,8799,3990,1314,1648,-364,7351,6887,933,3124,9729,2730,4458,3730,3189,8412,8412,1922,3981,5484,862,8854,5323,8011,2083,3154,6380,2448,8571,2187,8837,430,8345,8470,4387,9168,7945,7808,178,7799,1459,5823,3081,2691,8828,7051,9641,940,8622,947,7368,6908,1134,-588,1605,6202,-60,295,4617,5442,5632,6219,4766,5462,5182,9702,35,9515,9532,5135,3945,1671,9773,-541,5578,1266,4237,6908,16,6965,1065,9102,1351,-973,-505,9654,4454,3824,8961,9096,1695,5012,3365,1583,-723,-734,9721,-279,9616,4144,3819,1101,6902,2964,4122,4523,3088,8469,8877,864,-763,-759,9108,4870,2717,3119,1114,2758,2327,-847,7550,-268,7614,3071,9393,9239,9411,5604,7106,7745,6064,6924,9418,-126,9267,1861,686,2595,-270,2907,-305,6239,6674,-834,8732,91,3697,-171,1584,505,9616,5023,6198,-476,-103,-13,7824,6286,6645,2415,1027,8351,4564,7865,816,-898,3162,1324,6263,4696,2907,8040,4499,939,1359,7362,7298,7680,623,8718,1601,-205,4564,9112,3844,8872,1446,4707,7060,1709,-631,250,5851,5854,390,691,1406,4194,4697,1633,5650,-685,6043,-929,3284,6182,9027,3401,8511,5870,3559,9998,9338,5891,87,6446,8243,6838,4067,6174,6010,8503,7574,9934,7638,417,9496,5602,7346,2635,179,5300,26,7949,5493,6129,9197,4230,2184,5879,8944,8458,8537,9683,1812,3757,517,4104,9362,2491,9343,7600,4728,1778,235,4007,2264,9482,31,1157,4746,9106,5196,6163,6729,5856,2549,3706,1875,2642,585,2089,8433,6612,8791,6395,2036,3705,-456,-653,5815,9450,3231,6869,9803,7686,7156,5337,673,857,3474,3515,4141,2286,-942,2595,9256,5787,9046,9979,8248,6536,5391,2632,8281,2560,5688,363,7619,3119,-496,21,1065,5096,5363,2483,7218,6573,3966,8334,6051,2225,6932,5485,4870,3880,9964,1214,7112,2829,3259,7390,8182,7956,9841,387,5592,124,1101,4893,3023,7359,6699,110,9493,1471,374,8134,5482,5463,7977,832,9324,587,3143,9143,6230,-129,1128,-713,8957,6401,6847,4060,5294,5684,9011,5469,1557,9551,325,5501,9002,8346,9458,177,4909,675,5447,9308,3969,4216,2517,9566,7514,7806,4888,6836,5832,5014,9226,7746,4081,4974,5176,478,17,6908,-980,3311,-750,137,953,2019,1059,8807,1024,1765,6002,1833,519,7837,8118,7649,5058,4411,-580,2606,3196,5706,246,4650,4827,2950,166,5650,579,7013,6004,1539,5212,2171,8785,1253,2591,5758,7995,7741,2826,631,-598,4088,-164,5079,2744,4512,6638,4226,1932,1411,3082,9298,6930,9409,5109,2666,9393,2968,2826,7220,6375,9258,-301,266,3462,7391,5214,2541,2808,5477,5497,7297,3732,9111,-634,8671,6927,7141,837,9843,7014,3744,58,4655,8523,-685,5974,-651,5832,5035,5467,9572,-554,8212,2711,7554,4440,3369,442,-981,5507,7771,6788,-38,-530,8845,4995,5596,7668,9769,-375,7236,7985,4268,9661,-160,4186,1996,312,-72,3253,4803,-853,9134,4893,-346,7670,-627,7839,7897,6891,8329,5197,9907,-801,7918,7016,6728,5143,5752,8688,7471,5561,1644,-874,1299,5363,1468,8777,468,3010,1488,3520,1444,5850,1799,2428,1315,-820,2445,5333,7445,3672,750,8583,9383,1885,4158,8884,2340,-940,4843,5155,9521,6688,2204,5631,5630,9041,9933,4192,3396,2183,-16,3429,1177,429,5187,1364,521,3870,3296,4115,4377,2697,2565,-198,7265,7689,5140,3743,5400,5950,1049,1768,-793,253,1888,3202,4703,6359,3491,8057,9265,1265,7534,4381,6295,1310,4572,2227,9633,2833,5822,1345,8138,3427,2488,8786,4363,5297,8382,1314,790,2950,965,2336,1178,2170,-963,9797,-657,9573,5687,3967,2830,-444,6613,-58,9416,3831,6422,3160,4172,4959,5388,4705,-603,2643,942,8266,219,1793,-544,179,3072,3912,9218,1831,1422,1830,7788,7611,7525,9542,5512,6037,382,2811,-202,1264,2737,2059,7717,8054,-580,2473,813,7264,1768,2012,5701,6032,6684,9104,1595,3915,892,6887,7119,6967,7532,3743,3420,9657,681,7563,3530,4369,1020,537,4094,7209,4375,8691,310,9109,5646,3672,7313,-449,6896,3758,7815,285,8055,3054,-621,5745,7197,4839,8954,8056,1022,3255,6391,1542,1419,5395,5579,4001,8186,3049,4079,8941,9440,4027,5,8205,583,8051,9692,9437,5668,7126,4340,7352,5839,5034,5962,660,3172,-770,8697,5349,2722,9076,716,6623,4293,6690,1077,-32,9052,9131,8288,3180,1887,2165,-84,269,3783,5825,846,-784,2471,4540,3850,-825,-280,702,6378,8175,3841,8395,8426,9055,9537,9857,1837,3366,7895,8688,3015,2550,2116,-882,7804,3962,2186,7114,52,6553,8349,2563,729,-675,-810,-836,7687,1928,629,5286,-682,1142,4995,8784,4188,9777,1371,6789,9101,3854,-691,-454,1675,4712,536,3688,8729,61,9938,5717,1472,2863,7011,-643,-843,5296,258,7637,874,3884,1949,1707,4424,7847,2973,6241,7210,5789,8560,5608,-682,5478,5759,5195,9764,8046,5322,-673,6943,7374,3418,9011,1989,4763,-452,215,8253,2046,5833,6159,3580,8487,3499,2946,5272,3953,4400,9163,4692,-627,-801,9062,8536,753,2595,8670,8598,2593,2640,8900,2126,8692,3803,8088,97,1948,4169,2863,-666,4019,5462,8695,2888,7019,817,4140,9942,9680,5941,1019,9653,1019,6470,3574,1234,1431,1789,-503,-270,3230,9001,5146,8242,1319,3768,982,4472,9543,-41,8762,-442,3166,5553,5246,5979,5790,6802,1219,4060,5140,3696,5569,-81,-710,509,5257,7780,-265,9669,2847,7080,487,4635,1879,1353,5731,1404,2310,5400,552,2268,2869,-747,6189,5466,7958,6455,3737,4618,-446,4180,4072,2680,8595,7630,9924,4022,2972,-852,9917,7209,6880,1351,5715,2227,7653,5356,8719,9732,6210,1105,6743,5850,4547,9439,3330,6522,9255,9868,559,322,583,-855,8940,8491,4883,9799,6252,5235,7115,7091,-883,6586,5691,9208,6538,6081,4260,7510,4297,9972,8742,-656,4134,1849,9216,2272,9068,7235,3245,6293,8988,357,4059,3938,2741,9734,-370,9745,9475,4719,-935,9769,5603,6476,8602,5342,-789,9122,-789,-186,847,2876,-491,1914,5749,5493,3625,-462,4649,6478,7957,1813,447,6066,6947,5066,6203,1844,5070,7604,8188,4286,9458,9397,3892,8864,5139,9981,3514,6283,1286,9618,-882,-808,50,7155,9217,5287,509,-265,694,3286,6301,4911,2582,-581,-393,7241,365,8165,8144,793,6632,3859,-701,8333,356,1194,184,4362,7001,7565,-785,6327,126,3638,3357,5640,4471,6872,3852,8423,-620,4881,7402,3807,6649,8921,6992,5152,7723,-661,2258,3675,3927,8647,6669,4507,3132,6424,33,9052,8769,3939,4248,370,1250,6131,6888,-464,2531,3811,5992,9664,8512,5227,7760,4913,6585,3557,3026,1678,2189,7797,8506,5125,-389,3550,8371,6552,3391,9022,7280,5508,8089,-828,3576,4693,9736,6805,-959,3718,5864,7526,6218,9135,7367,7602,2848,6170,-305,5379,4481,5790,-267,4518,3599,-650,-385,-734,8810,7966,7313,8863,9391,8355,8281,5620,7480,51,7232,6474,508,566,9775,9635,8102,4630,-429,1436,3888,548,-626,8574,4072,615,7997,8723,3419,5817,-755,4771,6581,8187,5668,7330,1829,-247,-585,5138,8483,1154,6754,3934,4144,1440,5491,1324,2452,5842,2465,9992,6852,5184,8909,6304,407,3912,2219,4970,4704,8048,8387,5704,3271,165,915,2183,9054,1266,7931,2514,1681,3000,1551,7457,6126,9528,1681,6850,4613,3246,3264,9753,-590,1944,3762,8693,8390,461,-159,1912,5763,5713,4993,3576,7122,2832,9964,5873,-55,1348,1199,8616,3332,3139,3286,3412,6291,8836,5827,3592,7185,4613,2843,5363,2200,639,9804,2124,6000,7552,4850,1607,323,1537,3692,-98,5837,236,3645,2750,4359,6109,5909,584,2816,4088,2014,9275,9581,5143,4199,9570,9426,2246,7849,4093,4309,9737,969,149,8668,1527,5708,962,7749,-633,9046,6286,3720,9093,462,-972,-316,3217,3507,1569,1019,1680,7727,7224,7984,7968,5445,1918,2943,8422,3183,1081,8823,9405,3544,2046,8394,708,1531,3018,532,8467,1054,316,3341,-589,6355,2902,4274,7100,-257,8266,7067,2340,2103,2786,6725,6084,557,9693,3328,1241,8365,3547,9374,1509,-583,8980,-823,8455,7372,5307,5157,534,6815,2359,6959,4228,970,8924,7568,3386,265,7934,1523,7971,3910,618,4983,1925,4783,8296,9118,7435,5665,8832,-748,4420,6516,-569,4672,-142,7186,8504,8126,9659,3934,6824,4926,1971,1031,6208,7701,5381,7804,-231,7041,1094,3202,9710,2632,9476,8220,6226,1634,2714,145,2863,8230,2145,3595,7692,9680,2938,6468,1652,-524,1222,1799,5592,2685,1643,2359,6764,5445,5256,2859,7924,1308,9307,8774,6009,8697,6608,9712,8984,8691,3412,3006,7239,-664,2474,9077,9076,6633,4393,2750,66,184,5553,5071,-595,2772,9639,2831,8670,1905,342,3129,132,1549,9237,3910,-778,7886,6069,488,4520,6114,6959,3218,6469,8345,1681,6037,8993,259,4388,7263,5202,3155,5216,6343,3538,7717,4804,812,4721,757,7851,3036,3550,2328,5821,6161,3312,6887,2356,9084,3443,5388,-380,1449,7876,7466,8058,9433,7254,3841,4087,-701,655,2433,7387,3445,7129,3907,8869,4385,89,8344,7948,1497,1879,8412,9529,3116,-659,8052,9510,677,8837,7593,1831,6404,517,1381,941,9068,921,1252,9154,8465,3404,5420,4033,5624,7905,80,6063,1103,9627,7399,-794,3650,9563,3897,1340,1881,8835,5299,-3,937,8325,1935,9072,4145,1754,6835,3770,5677,3559,8114,3429,1778,299,4766,5253,8601,8316,2821,7863,5670,-255,-127,4031,-461,1823,1041,8279,6117,-443,9657,5182,4684,5455,2924,-958,6051,2147,3704,558,1560,-644,-17,6529,3615,1127,4919,8604,5441,4628,2563,7762,5426,1066,9181,5058,4627,2983,8096,5851,3112,7570,-510,3841,2918,5808,1498,4715,-549,7127,9534,6400,7658,3032,5369,5593,8832,-502,-345,2147,2211,3706,5157,5391,1123,-549,4813,-973,3398,-462,7797,498,-637,4080,9431,2237,8843,-405,45,211,8753,6027,6630,6657,1714,5941,4240,8038,8389,6815,2458,9248,9527,-677,9786,-344,5124,5804,1134,3353,1915,3586,3628,3085,3510,2365,5474,7339,2462,316,3840,37,7376,8893,7003,2529,3930,5769,6369,8805,-292,3321,1048,552,517,489,6621,5108,8792,8998,2873,1219,6279,7365,4611,1613,7165,1263,7977,2627,6166,6208,4063,5352,7041,3536,4622,-340,-913,6208,6061,6657,3628,6678,5193,5299,7169,2048,2868,6457,6478,4129,5476,6335,4151,6328,1191,3464,1889,1355,6618,-610,693,2964,743,4460,7396,5873,4556,983,592,7456,9322,253,6972,9712,4433,-725,7487,880,7124,6114,8151,7519,329,4057,2900,2346,-88,1827,7557,8592,7653,4604,273,2851,2033,7113,9371,2845,545,1335,1846,-413,5021,8627,9505,5221,9624,9129,4010,8552,1752,5115,5487,7461,6971,7122,2371,9844,3522,-748,1580,7294,6620,-865,3460,1397,1699,-398,5103,1389,8467,9169,9183,9179,7975,9244,4010,8984,6520,2340,4094,5764,8397,1373,996,-447,1639,5986,3422,4922,5123,3441,8419,2147,7930,2382,2708,5478,8738,2939,4128,1828,8649,8487,6945,-218,6169,562,7356,863,2214,9710,1201,4843,3910,8893,-343,301,1216,3755,9994,-849,2245,4815,4940,8457,3132,7437,3040,4126,5692,4840,2486,8802,-648,6428,2890,7854,2504,4951,3004,7113,3424,3963,9373,5268,1639,3256,1342,8922,4269,-686,7055,8325,7091,8571,5514,639,2357,5650,2942,8299,9903,6113,6863,5918,5566,88,1656,577,353,6898,-140,355,9077,2086,3444,1394,8028,6087,6945,7727,6227,9045,6251,199,1786,1386,261,5729,3632,273,7530,4201,-113,2496,7881,6985,6048,6924,2946,7578,1087,8307,6343,6256,1779,3760,9936,5350,517,2606,4496,2921,7552,4857,8122,1643,3986,-172,2998,9418,-594,127,7878,301,7710,4464,991,6317,1414,7267,7262,4804,8454,3205,3355,7837,7086,8799,1270,6874,4818,2612,2496,2964,4818,1507,5243,633,8778,6006,-73,-349,3182,6163,7372,92,1501,632,329,6670,9437,5576,8403,944,8344,4781,9529,2131,4758,-72,7677,4184,733,9558,7712,9394,2817,8484,8738,8654,8242,-8,1387,2755,3608,2290,7364,-904,9968,7337,5531,6658,7459,9093,3295,3402,8836,1239,4350,1093,7237,2120,5465,5915,6977,9183,-235,7450,519,8258,8010,2367,8019,1789,1402,-499,4979,8244,6010,879,9227,7736,7560,2345,3252,2314,5489,-908,7099,2935,9446,8520,2808,6459,8658,4615,4210,9404,4943,2042,3881,3877,6555,2248,4999,260,855,3829,1200,1266,1530,9756,3237,7247,8111,6295,5536,8472,7920,1752,6595,4289,1458,3877,561,-946,4847,5725,916,2982,5744,-590,7145,1635,7289,6894,3804,1203,8386,9029,1208,-714,594,7731,9815,956,2391,1103,1355,7032,267,6894,9506,5510,3714,3947,1326,9271,8989,9347,6908,7235,6043,7636,8794,4192,50,6992,1348,6765,-625,9732,6450,8958,-567,2891,7934,8503,2536,2973,2851,5303,8173,4420,3347,2761,3808,6948,2426,2693,4110,7217,2470,8255,911,4373,7073,7260,5922,7738,6256,8749,3440,4391,4560,3030,4729,3258,-589,9982,9516,749,7244,5084,3732,8034,5820,4616,2282,8261,789,8230,-861,754,7145,-122,7120,1666,4448,7960,5862,1750,7572,145,8761,-94,8697,5100,8758,3518,3100,-925,2027,6543,9519,3481,4395,2920,1192,2969,1392,7386,9733,2808,-989,3794,827,6224,-300,2331,5641,2852,6974,2476,5067,9046,5669,7804,5607,8233,6019,1204,5677,-866,4032,6552,7029,-263,8987,3101,1669,6014,8354,2706,7182,8227,1152,2728,8208,9133,9557,1538,-499,8118,844,-470,7826,865,577,-36,3117,4805,1538,1833,8532,6209,6725,5594,4953,2092,3572,5195,8895,4905,1880,6854,-826,2764,2305,6087,-507,2786,3493,7611,6810,6190,830,1680,706,3474,8263,604,7901,3927,69,4629,563,2265,520,5585,5839,174,3712,7472,8243,4143,-925,6442,4299,5519,52,7871,1246,4341,8543,6485,4837,2547,5994,6857,1831,7053,3856,4751,8894,6520,8352,7307,9222,6390,487,9145,6670,3098,5704,8619,-257,5760,538,-28,2833,5823,2861,7956,83,1588,4190,8183,1263,3606,2089,3670,2089,3170,7104,-24,7941,1326,570,5712,7927,-351,1336,-244,2653,9361,284,1921,135,663,8021,4938,4896,5827,2724,3720,5219,2050,3281,7080,720,2801,5266,9503,4818,2671,283,3999,973,-523,-880,-428,4850,1911,6716,5592,9884,3837,8309,6567,-927,4198,7823,4889,9242,4311,5652,6032,5813,3786,1554,999,7922,3488,1855,4205,1687,8975,4145,6033,5185,8269,1180,9720,1413,8313,1229,-789,5963,3913,3289,1893,6063,6253,-192,9531,5740,7151,7222,7747,5642,6191,5175,3981,1217,2923,6393,3887,3132,809,2116,2811,9485,5549,-717,5761,5950,1889,1555,7877,7379,9681,8568,8372,6892,6313,3875,9596,1638,-647,4625,1564,6121,8071,5955,8664,4405,877,1646,9510,8784,9298,6472,4742,1460,-713,5792,2346,2690,7520,-684,8060,4374,184,4192,-804,8980,7941,4908,5745,6516,3022,8867,8369,5934,4007,9687,3044,4323,4972,7925,4951,3082,6260,9053,9441,1549,3872,9735,1742,7733,6026,7503,2990,8103,5345,5508,1164,3660,5336,6909,7755,9801,8620,4661,4110,4404,2707,-559,9093,7936,7178,7059,-123,3741,1574,4907,8379,6166,6898,8310,-471,6057,9811,4303,6478,7797,9060,627,8274,793,8325,9724,8137,9719,8370,7486,338,4890,1216,2622,8594,879,7798,2689,9999,2903,7513,4183,6088,-265,9254,6789,4583,9090,2419,5739,9850,2149,81,7562,9030,876,8446,7323,9906,9177,178,4231,5321,6719,442,5596,3987,1326,5918,4586,3195,8842,3124,1308,3835,5435,7385,7001,9366,9678,9570,5437,6349,8454,4481,256,5889,9504,1044,5969,-109,6964,2258,3828,9479,5898,1374,3431,4351,-334,8324,9599,8852,8782,4244,3868,-987,8060,1017,6441,-268,3857,1326,8625,-683,8618,3311,2622,8116,4388,9361,7554,4603,1825,3469,8878,-990,5685,7326,46,4341,5764,3206,6025,3103,4179,5511,4189,1024,7853,4966,5679,529,885,9276,6492,8520,3433,355,1631,5344,7629,7261,-700,7543,9827,3976,9362,4192,4195,-833,-26,4190,8225,4623,5211,-511,-708,2657,4100,-599,1463,1368,4067,6620,8067,3396,9630,8893,4817,6813,9347,5997,809,2068,6772,8910,8919,6455,9875,4072,7626,4358,1422,5938,9472,2239,8907,9785,8250,1579,5438,4616,2879,-573,4140,6264,1638,7325,891,3472,1747,1397,2955,4918,4622,3242,1673,9521,7769,-242,5767,6919,6771,3787,8770,1201,9913,1862,5696,726,-352,448,3648,5489,732,-732,7743,7976,5335,84,6534,2904,5588,2633,3578,1308,1790,5610,4343,4498,5475,2628,8310,1007,3062,2297,3706,5554,8682,8562,8719,46,3172,3519,4528,4789,1504,-191,5627,9165,9272,2775,906,-553,-950,-368,3918,9269,5080,6495,-924,2108,7720,7546,1487,8657,6509,-470,1133,7900,4260,1621,2773,3224,9160,5859,2473,7236,8606,2819,5190,6667,2765,6172,7521,9995,4566,9004,5054,4158,3594,7427,9855,1959,-751,7237,8825,8211,4269,176,8683,5931,3130,2741,3853,3296,343,-313,9519,5641,5922,5531,8705,4026,1832,-224,1351,7172,7176,1521,6756,5595,2291,8422,863,222,-880,3076,7247,7069,6741,875,1725,4418,3358,9307,-419,4488,457,8041,4207,-34,2063,3966,7571,870,9389,8329,8023,7432,9064,3327,2213,8189,3805,537,9986,5979,7831,6350,9759,3231,6162,6598,6047,7788,2151,9958,8961,1731,8813,5345,2770,231,1060,6352,3342,7940,-368,4945,6517,8684,1118,9717,-735,866,309,2902,5775,990,3333,366,1822,5279,1399,1537,6445,9593,6922,9458,4116,5135,9609,-795,9034,1411,1110,-790,6972,-450,4214,3276,6111,3082,3932,3754,3321,5602,-657,-105,4374,3010,9675,6206,2186,6038,-80,4889,379,5705,4327,8509,8423,8318,5286,1453,7549,6789,1162,-71,7133,9173,-835,2407,4536,3512,2232,8983,7009,9198,-640,5245,2436,2016,3847,230,5079,19,47,1172,5670,6995,9050,182,1465,5790,3347,8758,1631,548,6682,4699,6778,1244,8115,4319,-770,286,4215,1847,3612,10,-753,436,4170,9995,1066,1316,30,1208,9320,2255,7321,7861,647,9975,9276,8025,8747,7370,-282,6886,969,4187,685,2279,6373,4091,6249,3325,5025,3583,8111,5147,9658,856,941,3548,3169,7799,2596,-130,9523,3435,6351,3894,2794,8805,7032,7970,9315,5557,7738,7004,3431,8835,-992,7071,5529,1618,9798,2764,2087,3439,1066,8722,7635,8098,8501,4036,9014,3801,9674,1360,5425,7534,572,5509,280,9279,3423,9465,6274,9764,5010,5612,8791,4225,7511,2560,4451,-48,6691,606,-418,4090,4260,4023,5158,5856,-610,7344,7160,1157,866,9467,6725,4520,4000,1076,3711,3114,5517,9828,492,5625,9303,7011,9774,238,2946,8954,4636,6518,5278,8197,4140,-552,2707,4941,2844,-788,114,6487,7530,4557,4805,4646,2462,7080,-562,98,9219,9497,7807,3498,3506,-351,5115,9286,11,-662,7293,1627,6665,3876,8914,898,3549,-381,8292,8786,9877,7007,5259,520,4216,5992,9044,4458,-2,8694,108,-918,9191,8887,9534,-8,900,2572,8941,-380,-540,6420,9646,7867,-793,1489,-345,1348,2984,9828,188,1809,8820,6023,5910,2637,5619,8719,1811,7377,7133,2963,6676,3906,7048,8404,8449,1381,5425,6408,5315,6290,-748,3145,9903,9243,3803,8325,8238,9602,9254,4401,7365,5054,4936,742,7259,7728,1407,4676,-835,7435,7121,-643,6386,9383,-326,1204,6763,5615,-559,3827,-366,3135,6197,5859,74,5637,3980,6278,4036,467,7765,482,6146,4984,9072,-163,4151,5508,8144,5373,1136,5571,586,-815,1314,7172,3556,3322,5762,4389,-575,6594,8192,-32,5492,3920,8874,6984,6952,574,2731,891,4410,9095,-721,1271,9635,-313,1279,5618,4689,7366,7833,4606,791,2286,6299,3389,828,-202,1284,3666,3767,8336,-976,7584,5627,3188,4326,-411,8281,1396,3933,2208,4056,2818,1705,2284,2436,2213,2231,6601,8548,7113,-535,9279,2746,6584,6070,1218,3315,313,-517,9882,6450,3280,2090,1313,-406,5725,2606,178,7914,4201,2783,9748,5776,5219,8004,-903,8584,558,2971,-754,739,7254,8125,9928,3370,5247,-373,8755,2939,3532,6843,7243,394,-941,2638,6507,8547,6231,6958,5761,6435,-359,8236,5498,2341,7293,7875,9234,7986,2375,2042,9938,3212,8058,5090,1902,615,3785,5480,605,1073,8164,2261,5321,7829,-598,1239,1967,5939,5398,5226,3290,8706,8439,-970,4004,5723,1993,8930,9067,8416,8865,-405,3102,4003,6919,7265,9503,1491,5819,4454,1791,-173,138,807,9751,9886,-978,7243,3980,858,5847,1484,7503,6311,8494,-400,8926,4698,3679,167,9401,5563,9648,7187,-735,5054,8366,1081,9748,3093,1498,8238,1928,9398,3222,8989,6615,9252,2603,474,3245,1819,5906,112,-923,2715,7868,5997,1963,8344,76,-397,9903,813,6583,9407,7671,3861,565,2356,2037,2370,5732,953,3434,3492,3023,-221,8068,9257,1271,3136,8822,7228,-228,4779,7657,3949,6402,2571,208,9169,8511,1870,4808,7007,4516,-452,380,9616,7540,6908,7423,5352,9391,3796,880,8704,8757,3593,7792,273,9918,2717,2102,4774,518,7753,6105,8138,-509,2228,2952,5152,2180,5742,9624,5733,2554,5410,808,6802,5774,3661,6007,5615,-674,6192,8209,5587,-343,5569,4148,8026,9744,3732,4234,3483,7563,2855,230,8247,5039,2690,9012,1223,3194,-781,-328,9092,8315,-577,5448,1179,9940,7472,1919,3323,7240,4793,4474,3837,338,9282,8167,7711,9609,8392,5260,2029,171,8636,987,-982,6090,838,5158,7473,809,4426,749,9434,4290,1738,5748,1530,6110,8124,7839,4739,3407,3428,3499,-118,3196,9126,-585,7511,7955,-86,8971,-218,6312,-941,9773,3511,5117,-316,4505,977,2964,784,681,6963,-898,7678,-751,2531,8967,1273,9178,9897,840,9464,8154,9438,6595,-974,7125,9007,1732,8241,9537,5562,4693,6847,6733,3745,1614,4037,4820,5763,5985,1480,-460,7344,978,8495,2489,9176,-84,4957,5021,7767,3627,2789,33,-482,1941,6905,5356,1151,5456,3784,4399,7477,9493,4155,1878,275,5720,9049,4468,9615,9895,-640,7735,3516,8103,7927,2232,3271,3918,8128,811,6377,7676,7110,5261,3168,7376,6741,6116,5034,5492,6565,-536,-230,8683,-231,9695,3280,1300,3290,5218,5276,6669,4400,4667,9788,8237,2848,6253,-83,-797,1252,-578,1230,371,4565,8365,-760,8564,1023,717,8130,4905,618,7574,4960,2620,2198,6978,1688,4874,6301,2419,4349,752,3609,1018,8517,3099,6075,213,8719,9284,3310,3341,9330,2928,2553,5092,2912,-14,8117,5148,8536,8545,5614,6953,3937,1989,6185,8478,5477,3597,327,1252,5381,5268,8620,2824,2950,5692,1030,8483,330,2971,2705,6213,7957,-687,7724,6945,2388,989,3063,5035,4353,634,7024,7472,4665,824,-331,4279,8047,7035,3674,4541,-341,7340,-407,9830,5812,3728,1705,7506,4761,-505,7449,-827,5906,3457,4411,6512,3808,3800,7519,6618,3200,-358,9602,462,2898,-497,3052,6465,2490,2191,7570,8256,-456,5511,2822,-599,9155,4942,9469,4016,6658,657,2398,2506,7785,910,2962,4472,4448,6200,8084,-998,1752,8612,-447,6327,-565,5562,4921,356,8729,3843,9659,8955,3324,9994,830,-770,3485,-994,9118,7506,3315,1494,-288,3068,8842,-402,4055,6896,-740,9754,8889,7227,8367,1549,5441,9111,6624,645,1342,8839,307,678,458,2973,8794,9639,640,7479,-927,3238,4761,-724,3298,1793,2669,2003,5637,-712,1060,5222,4398,7806,6084,1815,5268,-896,5868,-354,8176,6772,2307,-273,2426,631,4527,2633,2046,6992,1541,-922,1421,1308,2688,2508,-504,7837,1729,2225,7309,7700,5227,3142,8491,846,3794,1877,5895,3890,38,5061,3786,3775,4437,8986,4032,5524,9411,5982,7084,906,-661,-915,3051,1334,2062,2024,2654,7408,6162,7573,756,5787,1546,8787,6375,5387,1409,-889,7288,9160,3036,9483,983,7523,-420,5838,6019,3955,6721,1235,5601,2201,1426,1453,7177,5547,6850,4040,2535,4344,6945,1419,2972,-894,6736,5012,5815,580,1480,5935,-161,5801,1609,2624,6514,5271,8657,1774,6251,8840,9438,5270,-969,9230,2633,40,1466,7412,9692,4131,1223,7381,9611,1001,9157,230,5316,4800,4160,7382,112,3670,6701,594,7131,3721,6851,8973,1708,3676,3743,2060,7177,7083,4616,-96,-733,4267,1885,3000,3545,2345,5480,214,8125,2929,8041,7346,9611,2627,-444,316,1238,9838,7812,2999,902,440,4431,-734,6989,3920,8984,3234,6313,9286,3219,3531,7103,1070,6481,5801,879,5833,3665,3667,-920,145,4592,413,5559,9120,2852,7829,-118,797,5576,4517,7858,130,143,4480,5110,1615,2054,2195,3878,4192,6983,3616,3996,8816,-399,6731,4441,7672,8535,4260,1687,1733,8804,9880,9193,9334,9728,1482,1733,8534,4315,5917,6689,2710,1145,1506,4305,1954,-945,-990,1070,8469,3383,-305,4127,-150,8878,7475,2467,8536,-99,8135,6926,265,7247,8364,4626,6686,7209,2047,2978,6331,-480,2665,9953,6869,2384,2273,4093,612,8683,6138,2599,9879,5652,-637,1676,8676,5774,6336,2100,5347,3848,2131,9177,-64,382,4308,-933,4744,5007,9758,3291,5133,3030,2986,4314,1553,6997,2277,5174,4601,1871,-343,3640,1201,-561,771,2409,5398,5562,8729,-584,4673,7933,1646,3498,8120,143,-88,8633,7262,4163,8550,3066,4485,7325,2708,8372,1800,4256,644,3254,5291,8809,7391,677,9596,6423,-312,487,1172,-393,-618,-785,3567,8469,8688,2192,5876,1872,4754,7784,6269,3929,8824,4822,3565,1827,-158,6148,7949,9621,2388,5450,378,3610,7933,2114,1341,2107,3497,8791,5697,7819,5227,1384,8127,2640,240,5579,6249,1123,7070,6849,2406,9864,3300,6503,8680,7146,2789,2718,8293,3894,965,7996,5351,442,3505,8977,-49,2589,4095,2833,1957,-46,1446,352,9666,3336,9613,5452,-849,2625,4258,4302,187,5591,9096,281,5408,363,8953,4806,6300,5898,8654,4275,2705,9899,8328,4589,5508,4461,8226,7822,5900,6715,6220,7809,2817,-406,2320,8076,446,8720,3267,1085,8308,9791,93,7143,1556,6830,1670,8493,8166,293,7071,1567,5482,3582,7525,-295,4919,8087,-96,2594,9343,3960,-563,3445,3467,2528,2601,529,5964,9919,9928,5956,77,323,8684,4648,-349,6974,8843,7290,7671,549,-386,9841,1899,4356,6481,7847,4650,852,7054,6914,6838,6773,6015,1650,3717,2511,1138,1940,2789,302,855,3720,365,6232,2942,97,3425,8132,9522,-421,1395,9695,2704,8779,1161,-490,4290,4396,2203,9566,4309,5686,4844,9106,963,3307,-492,7688,2694,3770,8022,2318,6041,9824,2124,6369,-370,4699,1460,703,4297,4116,8486,9679,8522,7747,8917,836,4326,9510,9728,-627,6086,4794,6294,6101,6809,7186,6290,6731,6655,-35,9812,8165,6843,8007,3763,2155,1628,-808,4423,9713,2574,-692,6825,4586,-505,321,6292,6502,9230,2136,4637,9805,4586,7598,3365,-854,5264,178,2982,8124,9858,4318,6722,9189,2209,5690,4585,426,8628,1104,7888,7190,8311,9441,3692,1020,7513,2598,980,7299,8930,7866,8144,5281,9797,8086,5215,7984,2173,8660,-383,1501,-406,7603,4208,1406,3402,3968,4503,6577,7893,3853,5473,4421,4745,8355,7263,-998,631,3221,2487,1641,6526,694,8540,1111,9749,2597,2956,6114,3909,5491,5881,3288,2691,6077,7974,7968,1729,9537,3473,7928,1151,8616,6673,9095,2764,6399,254,322,-772,2534,1336,9903,984,5210,944,2232,7463,170,2077,3409,8500,8308,3052,1911,4112,1009,-11,5878,1669,2872,1788,6319,4558,5452,4604,9241,5914,116,5453,451,4915,248,5397,8114,6058,7616,1916,2370,3660,3012,1587,2797,5083,6858,9607,6308,8490,6115,1919,-52,627,-41,-765,4246,4283,6943,5099,2761,2445,9263,542,3374,5673,9351,9788,313,718,652,7132,8228,8139,2365,8232,9852,-465,5826,5933,7908,1913,6587,8136,6525,6650,623,336,4821,8282,2040,7927,8053,6413,2813,-852,6566,9956,3706,5513,9341,5619,1420,7146,6058,377,7402,5933,6127,4289,8023,2419,1840,2660,4146,8725,8801,7950,9246,9509,7783,229,6813,4989,7010,885,6915,1071,7905,7045,5587,3531,9647,706,1612,7422,3786,7352,2818,7353,1067,6645,9060,6524,1531,4952,4241,5326,1101,2808,7839,4876,3800,1248,-269,8946,5356,5744,8668,9313,4779,9589,7088,1658,-41,698,-439,-935,8451,4904,3956,4179,5631,489,6565,1095,552,1858,7999,1098,8958,1326,-519,4982,9767,1966,6744,9378,8393,7427,4593,6588,7287,1541,8202,8263,9531,8854,-819,2012,3388,651,8901,3078,4836,7572,3689,8760,3322,-68,9493,7106,8351,791,1999,8827,8977,8878,1759,3094,4729,1591,2928,8007,6538,1606,461,6529,4612,9694,34,4929,1761,-737,1278,1360,4178,-417,3488,8690,2883,8596,8426,4536,9690,6015,-169,5513,7334,4188,4419,448,7728,5707,2659,9918,8599,5203,8484,4449,5362,3560,3394,1178,-821,3425,7157,1157,9447,9676,3298,9455,9074,6615,2285,7659,7683,-583,-363,-61,-727,7417,7716,6585,9620,4332,4091,8900,8684,4450,1625,2542,-33,1944,2528,7424,1237,6459,6735,6849,9981,7837,-851,1821,8410,2505,4502,9354,1403,9733,1145,1043,4692,3518,8510,8892,5374,9299,8903,968,8162,1732,6502,3479,5378,415,9376,5559,3144,5982,6951,9072,73,332,6987,4719,3902,1349,8183,9756,3446,-360,4004,-605,3941,2259,6898,956,8087,1336,7202,6623,9173,5139,9272,5768,1446,7706,6123,-567,8364,3689,5841,3845,5789,1289,8182,-755,8981,2749,2003,4316,8832,1097,9623,768,9454,6469,5065,2491,4488,6502,-369,-247,-879,9881,3973,7333,8633,7642,3277,2675,5527,2472,6893,691,565,3600,4718,5165,1933,6041,4354,-609,1063,9495,-597,420,8598,6506,4559,5482,9474,970,9253,1194,7937,3476,6037,-816,467,7409,7042,2483,9745,-967,6110,4044,9942,7609,9093,1842,9659,6554,273,-26,2218,3235,2841,8701,2845,7680,7498,6246,4681,8266,3249,1861,4472,-425,-239,1105,6404,7856,9161,9117,6919,8541,1022,4213,3747,8636,7329,7749,9307,9866,2293,7802,5921,5745,1356,3153,7800,1725,2836,7970,8391,2490,1247,7722,4098,514,2238,9970,7882,-530,7183,3938,6848,7822,3493,3550,6373,3082,6918,3068,8776,8153,6389,-103,4424,1700,5696,1753,1248,6030,6675,6155,3643,2566,2599,7594,9894,371,5833,7046,8330,1019,-962,9212,7021,2837,-584,75,2361,2074,4139,7317,1839,-618,5977,2113,-622,3314,3470,-669,7291,1241,330,644,4395,4386,2516,4989,7628,8414,7993,2346,5211,5275,1086,4487,8779,2378,-755,-455,8332,1182,8239,5879,687,3540,9719,3923,6439,4655,7205,573,5057,2971,-978,8309,3829,5383,1472,5994,-737,8315,8016,7938,2277,5389,8502,4256,9159,3441,3217,5425,-754,9741,2035,-674,3594,8652,-253,7487,439,7083,5541,8636,5538,8741,-937,254,3756,8850,5908,6087,5209,7358,8989,1360,-428,6249,173,9950,8128,5504,6635,-937,8613,1282,7891,3785,-516,-489,167,709,9630,-289,6824,8664,5244,5456,5556,590,778,5161,7788,403,8709,9896,5057,-320,2760,700,2757,6066,2999,323,8810,5152,9854,918,310,1789,8413,1866,6017,8624,8051,7716,656,3808,9549,6339,854,9826,4696,7229,5523,-166,3313,3230,8603,1416,-848,3702,6845,2683,8566,39,6181,8330,8044,5679,8725,1958,-566,6438,5624,1878,6133,4518,3859,7675,-378,-173,9613,4348,2121,1764,44,9638,-562,2846,6882,718,7422,-392,3050,5929,2369,3938,750,2439,1915,6598,2954,5466,4663,7920,3093,9033,-58,4638,3096,1077,5975,-464,1189,164,9566,1949,5585,2843,7172,5695,3031,7201,726,7530,3565,-488,4743,9234,1077,1876,1630,7629,5372,3939,2111,470,8946,738,8884,4807,1982,2942,9502,908,2486,2312,1546,7617,9962,8953,7120,9264,6694,8658,9863,9572,783,3865,6067,597,6716,6923,2536,4358,5908,5103,-484,-503,4791,4419,4062,4099,7437,1628,6576,8348,304,-800,-930,-235,-285,19,-81,2485,3771,1040,612,8464,4550,8679,3651,6133,3130,4544,8439,8983,7344,1261,4736,527,7313,9906,9985,9624,7508,7829,9048,8503,9725,3860,8655,-999,6885,6123,1424,8914,133,5010,8405,5137,2837,1214,3270,4314,5409,8131,2234,-217,7336,2662,5633,5877,8539,8183,1503,4634,9188,7635,628,9587,7900,7952,1870,658,1742,7266,2501,2502,8224,1799,2726,1118,1372,42,6888,5109,2058,333,329,6509,3703,4002,4140,3715,1378,6146,2437,5710,-765,5345,2923,7972,7673,2441,5333,8311,3247,1647,8154,-672,2669,5573,6392,7464,-262,895,3237,9632,7310,-140,3494,290,2940,7316,9689,4428,9460,1783,4067,2804,801,-796,9898,4529,2393,6312,7247,694,4478,2407,6226,4189,8564,3969,2532,4058,6409,5090,4715,-206,935,1830,1736,391,2875,265,4684,101,1300,6586,3009,1215,6700,8438,1609,6674,1071,2336,478,8276,1464,1303,8172,3579,2317,8318,1876,856,534,8272,1573,4106,6204,705,5454,2920,-348,8433,6632,4037,3037,6378,7739,6514,5370,4556,9292,3544,3701,6171,981,9911,1398,9490,-711,147,6904,-258,8,9357,9039,-51,4670,651,732,889,1963,4163,9844,-647,-210,5173,652,4901,9705,5860,9323,1176,-907,829,132,9197,8251,1587,575,787,1451,6961,584,4356,7482,9067,2759,7706,4538,495,8690,7414,125,1748,6573,7691,8243,5572,6370,9858,-758,991,3959,986,8596,3099,3968,7186,5321,8464,6323,9213,2738,1375,9928,4420,1854,3748,8686,752,9540,252,8227,9672,9039,658,-160,7055,5646,-365,2542,4589,-602,6570,2206,4368,-168,4168,9200,1883,6343,6385,8416,1721,5506,-472,4577,6070,4639,253,7202,270,6515,205,4040,5786,2966,6229,5698,832,5068,4722,4645,1243,9890,6932,880,7681,2139,-853,6797,5073,5002,3471,-168,4665,1529,3974,4029,4245,4030,4901,294,3229,2040,9562,5926,2498,9738,127,-961,5597,4862,3356,3887,520,-537,1224,7026,1958,6888,2459,8876,5104,5952,2176,1985,8123,3922,8848,9444,8406,2158,5087,4311,3922,3580,1540,658,1584,9330,1178,1791,1677,6537,1093,3833,9778,6920,1606,3273,5225,8987,2799,-774,921,527,5355,4641,5673,4981,2608,9908,3745,409,5050,7230,2234,461,6699,6470,5608,9654,6804,2251,7068,5258,-387,2571,8366,3497,1443,-413,5842,637,717,3186,7587,2970,-55,262,9451,1263,5217,8500,6606,1612,5965,2812,2710,5305,1985,2132,921,9567,8663,3420,8187,2273,4966,3782,2066,5425,8039,2049,5565,1367,9250,-708,374,8799,8618,9012,5617,7618,6815,437,2265,-803,5451,950,1848,4762,-872,4186,3822,977,1993,7807,-443,7621,3544,7075,-142,7522,-477,1742,9480,8824,-488,-475,4431,8526,5017,4291,8789,2325,4264,6026,9228,921,5570,8414,-30,2001,9458,543,1416,440,5134,4117,4246,2015,3794,1938,5173,2995,4910,5385,7492,2961,-487,-786,459,81,2384,-520,210,734,6365,9904,7826,2711,9878,197,9210,-255,6704,8905,8524,9374,3773,8094,9254,2608,7866,8666,-289,-665,796,51,8030,702,8626,5678,5140,7906,4243,2574,9397,8011,2965,2637,9021,2984,4177,2052,2030,8072,4298,3249,-711,1526,8907,2263,7044,5862,8706,3391,8536,9410,4900,7885,1883,4024,7760,-266,8007,189,3793,5170,2685,4642,1017,8047,4876,8785,1904,4937,2117,2615,1438,868,247,7584,3857,-517,8703,8993,4549,5127,7147,3841,2503,5266,4090,9176,4428,7041,8370,6591,6254,1738,8356,440,1801,8954,-554,816,8766,6111,7129,-590,3529,477,-723,1310,1464,3361,-808,-476,5333,745,136,7169,8274,5971,2713,9814,910,-836,3717,6096,3560,3952,6278,2924,7244,1145,1776,5481,8917,7081,6170,9381,3258,2416,3086,7788,836,8422,6665,3766,5389,2475,4682,5578,-527,5040,5525,695,9627,4059,9109,951,-533,8036,-520,6553,5796,-156,226,-923,5842,3678,5617,2998,9773,5436,3463,2346,-529,-153,7795,1209,-310,1923,2234,1184,8479,1440,5188,-726,4720,5881,5398,5121,8187,2611,-140,2276,9762,2075,8709,1063,-734,718,1636,550,6394,7978,6257,4834,6296,5467,1902,632,7928,6177,7382,9647,6828,1064,7021,2611,3442,9577,-78,6355,2991,4470,5047,-126,6921,4931,4637,9579,6850,4665,9907,7650,9811,4278,1220,3221,4433,4777,5914,8530,2935,5942,1059,5337,374,461,7716,-110,-292,6087,5501,7985,8519,-162,1920,9363,3178,9587,1094,1826,6181,8722,7637,4174,3782,4003,6936,6940,568,6737,6680,7239,1113,7871,6239,-71,8466,6549,5244,-872,4770,3466,8462,9194,3199,7640,7327,473,7105,-179,-938,1232,7044,7457,8153,-609,8414,2569,77,5587,5811,3071,3271,3038,5998,5784,6249,8634,2029,2952,4529,5358,8834,3400,6053,7295,5329,4489,2334,7353,1077,9820,2736,8601,2375,3887,4078,1321,-6,8564,1607,1663,5829,7110,8396,8721,4369,4554,8611,7393,7427,2441,1390,8254,3239,179,6577,201,3685,9070,4439,1876,1372,-181,1556,5915,9797,3229,7560,2535,9984,1260,-894,-315,6536,6530,8166,9137,901,9440,6599,2719,5692,8700,-195,5363,5754,7172,7669,1767,9611,3704,626,9202,3080,2738,3713,4975,1045,3090,-615,-66,2338,6714,8300,3359,592,5457,4012,7136,96,519,2751,8169,5048,-915,5444,6697,8207,6719,5865,9000,3271,6715,5111,1340,9362,4456,7030,1776,8901,3015,727,6292,431,-554,8975,161,350,2571,1754,7078,8111,6484,1194,3393,310,1577,-966,505,8347,5883,2261,9093,3601,1141,5375,976,1518,8892,7798,70,1711,-260,8451,8978,7811,6747,1312,8112,-998,5035,1592,1689,7854,-704,6766,2796,8304,1436,4630,6013,669,6831,-918,2767,9273,3866,5713,1874,-6,5344,-394,2319,8651,7891,8439,6284,2313,-993,628,401,8625,9617,13,194,8298,9020,725,2373,2315,8238,5149,4864,5161,1298,8665,8326,4125,4628,2189,4946,1620,6963,8477,5373,6094,9922,2451,9422,-203,11,3128,7482,641,5784,1019,-835,-198,307,2976,175,5423,814,6472,5006,6580,1867,9361,6808,2289,2030,8492,7194,908,4852,576,-186,-554,9119,2176,5312,6018,3473,6833,561,9249,2972,8517,4488,1964,1506,2932,4402,2711,5954,5571,1310,435,4167,6466,-870,8191,7632,7063,1716,8960,6772,1065,1612,3887,6893,9022,8459,7736,-858,-325,-958,250,3564,712,106,3490,4392,8468,715,5,2219,1246,6083,2657,9816,3625,3159,3952,678,2823,8467,8554,1495,7262,483,2997,3572,6551,6135,-740,318,8150,7355,-891,6762,8772,9536,3809,1081,815,6267,4298,9732,7445,6486,2404,8639,1688,6236,4327,3155,7935,8495,-339,-362,4842,8903,3725,9363,7045,-594,4308,2664,7163,7437,107,-902,6412,6553,4308,7806,6660,7989,9321,3806,9012,1753,391,1284,1719,6400,5884,8115,1229,4004,2260,1719,9941,3778,9812,8629,2941,4864,1627,3287,6362,5915,9901,5814,230,4788,4664,-929,2688,3267,9551,9344,6508,6049,4254,3705,1271,6746,6478,908,1802,6796,4525,2911,695,347,607,5364,4905,6655,3465,-766,1138,328,126,4445,-827,6367,-356,8869,7604,2249,9227,7147,1863,6561,8194,5718,3219,3650,364,5189,951,1259,7749,650,-508,2345,8287,8945,3975,9923,4247,3859,-181,8784,168,3777,387,4585,-396,8528,1920,-953,7364,7721,6355,1550,6474,3945,1901,2116,8103,9253,6719,8774,739,2803,9766,832,6681,1476,8036,4162,4224,2605,5970,-790,-677,4306,5242,1553,9744,804,2188,3686,9502,8390,580,3138,1429,4924,8217,4935,341,5261,1164,8516,-594,3327,7771,4487,3999,5515,-191,5450,2350,-325,8238,5511,776,219,4038,9237,3138,6995,1456,5,7224,-322,4382,1154,7713,1985,8130,2108,9139,7391,-260,9012,-492,5511,248,600,5378,5801,6474,3762,3612,-548,4212,-140,7731,8960,-722,236,4136,-479,-809,7699,490,3150,5211,1847,5094,9672,7366,-611,1419,1912,5569,5858,1515,2066,-793,7584,-370,6691,1584,2627,2200,6447,314,4448,9681,5195,6650,-185,1660,1209,2076,8050,8367,3773,7640,6826,8022,8756,9757,4944,633,2973,-84,4363,3250,9805,4202,5913,2963,7957,3532,5234,4257,4371,5812,1641,9305,4114,5072,9678,6704,5468,1842,9,2361,8541,6550,7038,4399,5534,4253,8627,1432,4204,11,1210,5043,1443,1731,4491,4475,4783,6377,-119,7630,3292,9960,-263,6763,1102,7946,4483,7155,3800,7283,-591,1913,2204,9120,8259,5090,9406,7685,3475,9158,9497,9126,6700,2009,4574,1756,5680,8516,9303,1171,6124,311,6516,6198,5802,3203,7416,876,9246,7387,713,1769,3342,371,708,5738,5530,-655,3333,3239,6571,7948,8853,2090,8478,5968,2144,3004,2882,484,8410,-339,1102,1066,6249,1962,4221,6136,5238,7948,3185,2114,8962,4713,441,757,-452,6012,218,8073,8329,6732,4973,7102,8812,2673,-646,7578,1484,1578,8221,5178,6159,8066,3923,9233,7139,2534,-419,-656,8059,7517,1173,4245,170,-348,1671,8265,5504,5213,3080,4536,3102,7653,9889,9446,-747,4442,-680,4079,2405,7926,2311,9189,4469,9794,3473,1799,1081,9721,725,6462,1791,5587,-94,6649,8546,9580,1568,2205,6277,7545,4592,5962,9006,523,-804,8390,8560,8696,1320,2585,4349,9571,4573,4621,5105,-663,4994,1188,865,5915,945,5056,4444,5151,4041,-124,6149,9926,7780,8804,7911,8353,6960,6942,3365,8715,-946,9867,2476,1465,3337,9754,4798,-599,170,-361,811,4695,8069,-998,-738,8455,3050,6629,8909,-405,7094,8358,1902,4947,6353,2513,8322,8909,7715,2858,2538,7173,8067,3473,2917,8182,9501,-42,9842,3841,7927,9259,4822,4893,606,5470,9823,1057,4120,2352,6891,3684,1329,4344,2377,67,362,5821,1983,1231,2549,9660,9021,-768,807,6933,8039,9816,-661,2439,7655,6805,3953,6167,1648,6546,3162,5248,2208,3932,4334,6532,5314,-73,6621,1442,164,2485,348,9140,2453,7844,-525,9417,769,5512,9439,9782,1368,1429,8010,1492,9235,8167,1826,4638,3321,6040,105,6593,7614,807,-497,9271,5895,2564,6510,1997,8569,9574,3830,1253,7352,1874,6012,1476,6637,-96,7000,4589,6896,7837,7784,8636,916,-466,3188,8938,7109,9486,7127,8158,4414,9966,7492,873,4312,8189,568,2279,4497,2387,256,721,7704,7308,4693,6506,937,4482,3074,3627,2911,6586,5216,477,3504,7991,5281,7197,5395,-45,4737,7981,2913,9738,774,9554,2818,-140,-616,6665,7765,2461,5178,2286,5679,8098,5823,3859,9837,-678,1510,88,2031,1188,3408,1064,4115,8436,1623,3313,5644,201,7505,8795,9144,416,8540,4588,2741,4960,460,5058,8825,5496,-183,9741,9985,3684,4857,9812,4160,957,6540,9806,8113,6326,8784,4855,724,4075,2995,6094,5170,2049,445,1170,3434,4974,4650,4822,2840,980,8994,5788,4273,8411,118,5433,6990,2735,1652,7000,6920,3387,-845,2467,758,-908,3055,8925,4596,7899,1750,29,1889,5483,1295,9661,6419,4309,459,5501,1793,184,-326,2535,6794,6784,5872,-801,8002,4949,3472,3783,3031,4384,255,9776,7401,5247,5563,144,-516,3731,4892,4060,7159,179,1715,4305,8384,6088,-659,5628,3550,519,2684,-619,3856,2800,3707,2140,9418,4721,2519,769,469,924,1124,5234,2462,-772,9183,1438,5186,7615,3913,862,4181,6285,6766,776,8053,6973,8365,5903,55,6657,7577,2538,7442,5185,8303,3856,-833,3545,6939,6096,-496,2265,9319,8381,5403,9357,5999,2482,-321,7016,5602,-255,114,1874,6369,31,5701,6120,9781,7032,824,3747,2720,154,4438,5817,7607,-556,-780,1107,2848,1581,4563,79,4464,3191,8410,-462,9093,1030,4864,-745,4622,9039,6779,-995,8042,6303,6004,3251,4158,2495,9861,3709,6280,6914,3007,9171,7263,6243,6202,7096,9232,6047,5597,1134,4311,4282,6343,8772,7201,9116,3911,-639,9637,6931,2966,4808,1103,622,1677,4073,9671,-390,5464,6309,7867,9543,3253,3868,1234,6649,1293,9265,-874,6447,5867,2458,6731,-103,-770,4167,8634,9463,7271,9643,5553,1375,1847,69,1053,7078,2655,7810,7998,8211,9178,7907,8710,8277,8072,4940,4246,5944,7814,3829,1334,-552,7330,8223,-699,9614,9849,8488,1514,363,3267,2571,3492,2968,2504,4376,398,3098,2213,6445,8780,4976,-766,3956,-899,4639,5915,3476,6269,5872,7910,625,3378,1927,6858,2593,539,4629,9168,-909,3334,-927,3990,2569,556,9236,400,4927,6396,3471,2498,2690,7042,8244,8609,7542,9915,1858,2063,6663,4456,6493,207,8718,6179,2980,9432,1582,9738,7938,579,-202,4365,8896,576,7251,5739,7769,5168,6168,1386,4408,6252,8631,4843,7841,6316,5193,71,7996,-71,107,8972,3114,9900,2264,-312,3546,9230,7098,600,320,7813,5035,7367,5670,1440,9688,7476,7278,1164,3232,724,4478,2419,6044,-173,1460,9242,9874,6823,4288,8198,1921,923,9051,6004,691,1336,1545,9434,9993,-589,3001,3980,5453,1012,3337,4268,7918,3630,9718,6320,6858,3629,2731,9416,1770,6878,3634,3706,5403,751,4454,5121,4537,7814,4070,6591,9160,666,3999,9386,6489,7815,8100,2730,7762,5726,2668,1177,4139,9588,1327,1571,1772,3672,5022,6003,8734,8020,8341,4791,9558,4573,1594,9845,2467,4289,6505,533,5506,5561,5260,7748,7821,585,1277,8105,2690,2669,9921,6867,-7,8227,739,744,8324,9802,3534,245,6390,83,4559,8988,-708,7194,1621,8889,3829,2273,6998,3031,2137,1919,3406,8713,2669,6916,338,1380,7751,1660,5448,5095,5984,406,1945,4395,6694,6707,5986,5194,8525,4846,9102,1581,2283,4179,2884,2774,7234,5705,5869,1534,6088,184,3443,1617,393,8447,3788,5704,6800,7999,3999,2387,-631,869,1486,-974,4774,3967,7449,8692,8419,5945,7717,8845,850,6412,8696,8728,932,950,4441,1827,9611,443,5966,7703,5694,8139,8567,921,337,6476,5648,7853,2784,1483,7327,9816,3433,1676,3191,7390,5496,6408,3945,6013,8859,8505,4451,3949,3925,5670,1666,3838,2979,6135,9613,2513,8523,-577,831,5440,8330,9233,7976,1853,2155,-89,-644,9398,-641,7139,8675,507,7702,8590,5863,6190,3153,-126,1894,1111,1862,7629,1251,4043,-626,5873,9534,2665,5676,5815,9701,5388,4565,5414,2349,1166,4983,1863,1043,8717,2814,3503,5555,2011,428,-746,5979,6422,9261,576,2755,7696,2910,9538,1416,8708,1903,6950,1578,4646,9165,615,-978,6579,5744,4798,7048,1883,6884,3398,5840,1883,7187,4175,3350,9844,2670,6694,6288,1897,2274,2184,-335,5428,4752,5595,1671,7839,5213,5024,6834,2235,3348,6546,463,1651,4478,5131,-61,5507,3058,4352,5096,6195,589,8238,1587,3340,6924,2142,-325,5489,2162,7286,7164,6729,271,7806,-700,1117,164,7904,9163,7373,5184,7515,-489,7979,7835,1836,1841,71,2740,5935,3664,6703,-205,8162,5633,1843,4198,9823,3858,2412,260,6689,5333,1671,3655,8960,4854,5787,3433,754,1989,8973,2185,2290,8326,3664,1474,9626,1445,2750,5497,-826,4033,328,9978,6110,2891,2866,5259,7661,2678,2175,7054,2506,1866,4981,573,6421,6302,2163,1891,791,7131,5568,8515,8954,9609,3474,4622,4963,3524,3575,4880,1571,-990,4261,-690,9732,9597,8256,9334,7307,2409,7645,5609,18,9669,7143,8493,5932,9785,2500,1795,3795,4786,8107,323,6040,-480,5040,8726,2965,9010,424,1137,7223,-557,6586,2061,1438,1809,2218,6486,5174,911,6848,2033,9807,-96,7343,2563,5908,6528,-407,-434,7200,9592,-969,5884,1183,7327,-784,6812,5505,3397,5866,2380,6106,-6,6031,785,6794,1387,880,-123,2442,401,9442,4372,524,7249,6626,9999,6608,2196,2043,8044,-737,5879,488,4248,8940,-888,4408,5684,2684,6266,9923,5492,22,2100,8711,8900,3550,4671,6588,8699,4581,6238,8329,8494,-252,827,3638,-937,2130,2672,3682,-396,8343,6936,7855,5662,8737,1424,4647,4467,462,4002,8044,3980,2895,6291,4415,1795,1719,3569,-260,9021,9902,4363,2078,6525,8413,334,2755,6416,4761,8960,4823,9295,-704,-177,1784,8934,2607,17,8167,1115,9064,-574,2901,7081,-382,8660,4453,5678,6760,-13,6910,5874,7060,9297,9864,6757,8657,5345,9081,-962,699,-893,8351,8221,665,5752,199,5513,1465,5741,354,8594,2186,8880,9631,4656,833,9040,2534,496,707,7688,8381,245,427,6667,6336,9933,6126,5572,4782,454,5097,2628,8695,5173,470,5614,7582,4735,3525,599,-45,5742,4709,4087,2825,2438,4030,4427,9951,7918,3415,9214,-719,3226,1573,5487,8316,7251,5183,8887,4268,8880,159,9556,1137,2114,6407,-858,1599,753,1430,2220,9456,5078,-733,9095,2943,4595,9024,6905,1030,2449,2773,9579,1177,9384,7772,7085,2761,9482,8984,4537,-610,9074,8908,8561,6291,9386,651,6234,67,191,7690,8136,7699,2984,1889,3220,-768,8206,7440,6404,1143,9885,9323,7275,422,2911,9590,8069,4960,-50,4742,7421,9786,-621,1568,6512,9182,7536,4981,6281,-447,3707,-344,8775,29,2584,8906,-701,-707,8109,2825,3246,-622,7379,1086,600,3949,5862,4016,782,4363,-839,7311,4538,8422,7831,464,1304,2242,4457,2409,-794,-916,8401,5475,5912,9601,5045,4740,5501,7172,-725,7642,5988,9099,2902,9776,-235,6170,4244,1093,-125,3675,4731,1182,9039,9255,7767,-946,4045,699,5588,1041,3077,9886,6723,4982,622,8701,7573,8021,2612,6368,4138,7862,-680,3775,6905,-143,7080,8821,5411,397,7134,9810,4724,2095,9452,2867,8701,5056,7821,6183,8996,3082,3404,5218,9388,2564,2712,9043,-269,2053,7845,7998,2848,2924,3968,4555,8735,3357,-764,7400,5309,6983,3699,991,9463,2410,5085,5909,75,2660,3996,3171,831,4939,8502,7150,8838,6139,6501,1838,9119,8566,4955,4798,3285,9478,2687,7013,9229,9719,8389,3788,413,3134,9912,-130,3942,9385,8005,382,7591,5967,8599,1488,8135,46,7545,7559,1141,2087,8309,7401,3785,3922,8976,-329,7591,3620,3660,7550,9652,3206,5868,967,6967,4054,5065,7769,-403,7683,8329,1333,5104,1379,-300,9776,2574,5099,-60,3929,6818,8518,1193,8869,4165,3382,7359,4306,742,3698,-165,344,7067,1606,-900,7771,7887,3357,2532,1576,-776,-628,2179,4804,5245,4416,3369,6715,6180,4578,5466,6760,-522,5041,4278,8666,9601,21,4528,2409,-49,8967,7950,7800,4838,2327,-369,-41,2419,9164,-288,1752,4531,7738,6965,2556,1831,3767,782,9536,6114,8412,3784,1811,2971,1435,-524,-937,3315,2604,1069,7448,6683,1332,7680,5445,5850,4235,8333,-978,3334,4197,-159,7151,-194,26,5806,4803,750,5002,4005,56,6337,2975,619,6920,453,5012,-965,9278,6133,8282,6921,6057,17,2880,-589,4218,-444,4136,247,-286,-547,-235,-377,9434,8826,1230,5879,-846,-230,8553,5657,9928,9280,4457,4355,5557,9063,3799,200,4054,5868,8950,6873,-198,4800,3566,8045,-888,1980,712,629,7146,-701,1446,1124,8386,7323,7409,9519,-846,9327,201,3620,8465,-140,1961,4027,1670,8664,4787,3081,4504,9078,9556,7961,7356,4527,3793,4508,1482,7217,1569,5664,2274,3914,8615,2646,8934,8502,-222,3349,2048,8958,7265,7236,3731,5838,6863,1290,4070,770,1610,4467,9544,191,6953,2870,7003,3461,6955,187,1636,7713,5907,2016,8529,5715,7050,655,7009,-249,-263,1552,7405,4355,2883,7128,1289,2838,7574,8830,2970,993,2499,3584,1785,5731,4449,9562,8307,9061,9379,4504,9444,-496,4382,801,6421,6821,2739,8605,157,622,-212,7451,7288,2262,2972,3815,6446,5169,3045,-891,3411,2823,5583,4916,5172,2567,8333,6136,3617,332,8308,1076,856,8751,1267,-205,6373,3788,2977,2637,6603,4587,4869,-741,3315,2319,2151,902,1991,619,1161,4575,6680,4338,840,2879,4571,3358,4622,1566,7082,7791,8244,9302,5590,9124,2614,9563,7253,9083,-870,4464,4212,4114,6450,5942,431,9728,6453,1683,8928,4042,-650,3613,386,4718,8157,2374,3750,9470,8285,9554,4314,5427,2141,2405,2870,5354,-411,-616,2369,3854,8782,7468,8908,9279,5677,1766,887,525,4002,1772,6214,14,6876,9409,5680,3189,7791,3353,7376,4282,799,8671,-535,6657,3239,4223,448,6938,5862,3266,5175,5792,2025,-254,2588,8630,-105,-59,4426,403,3726,357,5136,1757,8494,7136,2287,8847,549,2470,-866,4453,4045,1906,4204,3440,2194,1971,5341,761,635,3690,5990,7453,6555,6419,4155,5704,-608,-402,-135,4287,7289,7312,3135,7374,579,6213,757,-386,377,5459,8249,2687,9367,8037,8364,4250,8674,2915,7810,7230,653,364,7244,6547,3696,4724,9045,253,7210,681,4536,3103,1885,3441,7838,3262,9677,-370,4065,9828,2891,4976,-314,7935,3338,3979,2607,3406,9868,-832,6299,7486,9765,5901,9432,9288,8664,7665,6482,5936,8118,1573,349,6977,2310,8193,-33,7508,8993,5295,252,4136,6081,9980,1763,7307,9341,1794,830,5424,6881,80,46,1806,-512,6426,4141,-895,2558,3415,2661,416,6810,7059,-850,9464,-609,3178,7582,6645,4974,2444,8196,7766,5533,5690,7417,6786,862,4488,2955,6511,5951,5055,91,7971,986,1353,3049,1649,2902,3044,-791,4343,6370,-114,8751,4395,2677,2957,2445,8102,4358,7160,8017,-559,5088,5370,-225,4390,5401,2296,9805,2515,7946,3004,907,682,3992,1179,8411,3885,-202,9942,9070,7131,3967,3211,-232,6433,7985,-166,5485,4053,9421,-968,5918,2779,2336,2892,5297,6636,4371,2809,4394,9989,1143,4147,2986,5500,5711,6674,7543,7833,1973,4839,1181,8629,5366,8896,9131,4332,4771,9823,-402,6796,2552,7477,3366,9132,-746,3114,5308,9518,-277,7526,999,8737,1207,989,-513,9198,6954,4215,3397,4721,8014,5828,68,8598,4915,214,3970,8769,1941,4873,5826,6609,8439,38,4024,8937,6636,4642,3332,9390,8880,9310,1941,8588,5904,7905,4758,788,2236,8852,9921,4714,3896,1244,9042,9467,-468,360,2250,448,6447,1692,2691,6810,-440,5366,1060,9478,2971,2579,6930,9440,8172,3916,1881,-986,4501,1664,4052,7620,7095,3229,-421,5440,893,111,1122,2887,2362,2185,-67,8388,8959,6632,3604,2350,168,2639,8640,3317,874,8181,62,3911,6332,196,4471,521,5736,2553,1208,4197,3011,2854,4291,5847,1999,2704,1683,3228,939,-891,3247,3850,3137,4166,2894,3445,8913,7600,9073,8200,8597,3286,7179,7673,2485,8398,-515,441,6222,3709,8602,8967,3329,3491,4850,7073,917,1249,882,1194,934,8042,218,6769,9696,3087,9261,8298,2842,167,7053,713,8580,4509,3810,8491,6024,6485,3719,9099,861,4706,6006,844,55,3279,7604,1075,3100,3636,7961,696,4000,8185,4737,4966,5944,1977,5357,4658,9774,745,1895,6628,3236,1586,6989,4585,8572,8026,5210,3509,7806,9692,606,1130,8990,7298,789,2276,-288,-852,7574,-482,-496,80,9924,2044,8802,1327,1024,8509,6509,2193,-332,6694,8615,2958,6871,-267,-216,5558,4563,8667,7335,1783,265,9860,6806,1735,3999,-143,-233,3067,3763,8439,6623,5030,7781,7866,-560,8805,3652,-214,1748,7900,8936,97,-685,7553,1878,923,8133,-259,9113,584,5922,5880,5234,7899,7095,4441,6005,6085,6568,5309,817,9381,1337,7902,-948,6007,2850,8760,6843,2471,4124,4986,2679,9793,8154,9108,838,3535,3735,7700,5304,3988,908,4159,973,3263,639,9837,3317,3405,3753,9283,303,4844,848,2884,5122,5274,-180,5311,3737,4739,9614,8655,-19,8076,2573,6325,851,-429,-839,-476,3917,1205,5829,1153,2566,860,3792,2675,-918,5280,4861,5418,4741,8937,9535,5789,8544,7970,9415,573,5345,5821,5918,2444,223,2301,9743,3339,9032,1732,8822,9819,-537,5813,2351,4812,2904,2230,1292,2125,1192,-848,-772,4416,9800,-914,9231,2853,6889,5431,4854,-700,9727,4301,5565,4195,3944,3550,9121,5693,7662,4766,8188,1786,698,8793,321,4424,2029,4202,307,1773,3049,425,3332,4286,929,6656,5533,3321,8670,5636,9544,7151,8807,2755,2625,-267,-46,6391,6712,8150,1701,-168,5671,7527,543,4096,-324,4167,3574,2479,7308,-885,2585,8095,6032,2458,9305,5140,665,8972,3101,6190,1630,4620,9533,516,3169,9439,1893,1119,5866,5902,5239,-197,8579,6925,8520,-67,5338,8005,6922,6118,5825,8260,6363,858,8992,4756,3692,2080,8973,-636,7666,3881,-356,5899,-90,4105,5902,8856,2344,1774,-229,1298,7061,8198,6643,4090,4673,6585,1153,-610,1185,2540,5337,1601,1525,9865,1576,7747,4923,2082,6034,7786,648,9060,2132,2102,4330,1739,-753,3088,3277,-315,-422,8270,1812,1585,7947,3587,2595,803,3759,8391,4268,2598,4251,9776,923,3330,5126,5844,-531,8193,7005,7714,7211,-772,5223,8868,8430,1646,8921,-429,-622,3192,1830,5652,1653,4222,463,1100,4078,1905,4666,3695,1417,8515,7903,5251,8332,7005,7044,9977,7540,1194,6804,2628,3976,1968,-501,9526,378,4107,4743,-842,504,6234,967,-33,8762,4890,8617,4078,-991,6781,3386,1835,9696,7952,1387,407,1564,2018,6821,6244,8139,8650,4275,3914,6064,4495,170,6088,5345,6827,9875,259,396,1347,4249,6702,539,4730,-283,502,3269,9654,-64,2313,806,2036,4890,3710,4733,-24,2806,1768,6851,8152,8299,810,2049,6064,2482,2735,5372,5618,275,9879,7114,4758,7215,4684,2576,5472,-276,-759,1999,4579,3402,6611,-713,6155,4382,2447,9982,5205,3666,5070,5233,9575,6897,7476,-696,7322,869,5621,5794,-924,9352,4936,5345,7400,8039,997,5140,2602,5957,7165,8200,5776,7849,9340,6963,25,6105,-163,7236,7671,755,3787,-656,8465,-934,5652,-820,3091,6257,713,4156,600,1272,5904,6332,482,7461,7352,1693,2491,8059,5165,9057,8398,292,279,9682,4994,8884,5813,2906,7370,4756,2715,1958,3994,1219,5273,1983,1639,1166,7531,5810,3481,2821,-820,1135,7528,-616,7295,9725,7891,-985,2341,8277,4565,-215,3888,9094,910,318,5499,8854,3825,5280,1865,966,6347,5634,-628,-545,7886,-296,9355,1505,8669,380,8206,6256,3567,8516,1973,3072,5869,9695,-389,6633,2451,9292,1941,3849,8288,7621,6338,7161,5735,9663,206,1952,5942,-249,3601,9074,8535,2974,4486,-786,5042,9692,1968,4240,4737,4645,2722,5006,6656,5246,1818,2425,8325,8953,9316,4687,3362,-156,459,7305,4601,4982,1198,340,2356,-783,5315,6769,3095,1892,-694,1727,6652,4253,248,2340,8781,231,2070,8751,5684,651,8259,6311,422,4476,8549,7432,8763,2264,152,4948,-219,3192,8610,-812,4701,-854,3707,7732,9317,-648,1709,9227,-562,6829,6057,8433,6818,2584,9130,3930,7198,7982,4075,6684,1613,5810,4996,3610,2728,7065,5652,6356,1613,3128,441,3150,6586,1223,5181,2730,8529,5937,6252,-7,3968,9472,4030,2623,4599,2111,3423,-247,2224,-38,9354,-73,684,2393,969,3037,8524,2308,5419,1410,7085,6937,7678,71,6023,3361,-478,-631,5140,8031,5055,8563,1128,1718,7509,3511,-943,66,1099,-851,8572,8056,-829,8082,-823,9508,8564,6086,9456,6985,-660,789,-757,6370,1353,3466,4113,5736,5484,1475,5274,5335,8713,-704,5239,9425,9681,2045,-451,6540,7726,8419,565,3756,575,2224,3505,9874,1102,6404,7393,42,915,5819,521,8067,4472,4180,3161,1394,2691,-111,1298,8171,6676,2306,1016,1555,1761,1091,-679,877,1465,4714,1570,5099,5286,2552,9594,7022,1952,682,9742,7454,6550,2318,7210,5229,3738,5333,4926,953,-312,352,9935,6739,235,5306,4358,9521,3393,118,3263,7748,5933,4490,4849,-822,6262,9859,2909,4913,6803,2918,8824,-958,6840,9494,8801,-167,-488,791,3511,399,3422,6872,585,6090,529,2144,4754,9228,-530,-806,2541,2271,5811,7991,-166,3249,4144,-956,3458,1681,-660,6,269,8812,8314,6390,6522,4652,-332,3587,7288,5221,5026,7429,-603,802,-543,8106,3206,4342,698,3133,6443,8638,4408,1461,1511,6950,3760,1316,6917,6564,2028,160,5396,3872,2965,8868,-833,-661,8268,8785,-377,-104,3128,5829,6400,-987,8454,1640,3891,2919,2887,-992,6545,9296,791,4141,8526,1888,2039,9530,9697,477,2705,1277,3128,2865,6641,5878,6378,9379,9827,1821,6459,8069,1484,5036,9501,-316,8519,3424,3784,-533,1545,-88,6283,954,181,1407,8429,7307,-949,1740,2564,3878,9232,9447,713,3851,8617,7044,1246,7061,4929,2507,4812,3850,2640,1755,3566,4691,9851,5335,9955,2314,3362,-782,-471,1164,8437,9111,3798,7304,3869,4040,2320,3275,-686,4783,8862,1003,3215,-811,1248,9078,497,4344,5787,482,4745,2792,-757,5132,6652,6766,9561,-298,3112,2710,-612,-227,5425,5875,8664,4595,8077,5345,1460,3912,9630,6794,6593,7611,5492,143,8600,-975,461,462,630,5739,6801,7114,2152,6254,5444,1466,1368,247,8360,3277,9104,1250,4012,5502,1189,7801,3743,8192,6995,7184,9004,8526,-647,8931,2719,5946,2424,5006,6360,6457,8332,509,1874,8052,2061,1238,7172,8634,-339,7213,-825,4467,2600,7450,4122,4117,4890,1163,9575,9843,1409,5928,-113,6174,2519,7828,1232,3469,8503,-117,3240,4099,8113,5669,2004,7158,7711,255,600,5511,7819,3935,9668,4744,9799,2076,1928,7113,4259,8770,4367,9841,2125,7156,3561,5827,806,3683,6273,-432,716,5119,5899,7050,8127,193,-640,4598,3696,7676,5584,-761,6433,5753,221,3073,1583,6731,6783,2008,7792,956,5924,5840,-901,839,4507,4704,55,2344,7423,-219,6936,8833,6565,4792,467,9647,733,2914,8469,-267,8924,6770,8433,-845,6022,601,2691,9138,9362,3578,2784,4450,1084,3801,-573,6653,5015,4816,5139,1037,5362,7668,9188,-879,131,7424,6488,9677,-25,6239,9296,6082,3906,5807,9277,8276,6548,1145,3376,7732,8110,225,1649,9752,9060,4387,-961,9443,6975,2832,7295,4508,5647,4018,-399,3664,-671,9411,4831,956,932,4440,7251,4159,689,2176,3070,9906,-689,7910,7842,1619,8060,4248,7207,4645,7843,9561,2337,5653,4936,-365,7045,2302,9816,2404,1111,339,4315,606,8880,-174,6360,58,4687,966,9330,4303,3249,4768,3343,6637,3181,5361,2462,8682,7264,4157,9673,3797,-805,9523,6397,2233,3457,156,8707,-931,2126,3482,3555,1405,-281,4733,6921,6506,2239,5624,9104,9039,6645,7266,-659,3511,1621,3236,7933,-905,8935,1249,4229,1091,1162,4250,2596,3954,4593,737,2384,56,6128,5823,7351,1655,3964,4703,144,3544,5004,55,5867,5852,-165,4411,8628,8929,1577,317,-752,8476,1028,9133,5295,-233,3944,1813,3275,7649,924,7497,9170,1310,4506,4382,-389,4131,827,4821,5247,5845,6239,6130,6582,2281,1354,8861,7707,2046,2004,7764,4230,7495,783,-811,3037,560,-888,2836,2267,1296,153,6840,396,7172,6920,2161,9897,966,9664,2604,480,845,-343,6354,6195,-926,473,1977,444,9864,3116,3907,3224,-413,1357,6762,5309,-89,5749,3629,5236,4556,3288,9330,6082,-120,1333,6313,756,4156,245,2519,1751,1971,-418,6228,6007,3492,-196,6184,9617,4209,6155,5707,4035,579,2474,5361,7776,3683,9657,6317,8929,9672,9001,2727,8870,-580,5252,9711,514,3314,764,5016,6052,3594,2987,6824,-234,7400,8734,5448,8255,6798,3304,7962,445,7331,9661,9138,-86,6033,5438,676,8988,-67,5596,649,7595,2903,5798,8862,475,7708,6054,-999,2354,8241,6932,9276,3542,8969,9999,8494,2216,4940,6158,49,6597,9314,6622,5339,7783,247,473,5646,6814,1276,6397,8441,8588,362,2777,8406,9865,7453,5132,-831,4462,5182,5161,8457,2664,2105,8943,7344,1592,787,8583,2551,6793,4972,161,843,3031,6112,-108,3610,5320,6906,6957,415,4802,1445,8158,-171,-360,-48,3674,4080,6535,3760,2085,9047,3278,6381,1595,9553,2683,6972,4829,9870,9851,1991,6603,8107,6445,1428,9669,3490,4137,6945,8305,3037,7245,155,9384,28,352,-592,5740,3789,-634,2764,1998,6835,2789,5321,713,530,9018,4020,5001,3254,2641,3389,8399,4887,4836,3030,-976,8049,-188,8323,4666,7114,5350,6507,-151,4589,3662,-238,671,8604,2870,4997,1816,-463,5034,8316,-604,1658,8320,2987,9098,1360,-872,-706,7375,5247,9304,9338,-820,8202,875,3030,441,6859,1382,-653,5381,7023,-153,7505,8451,3027,5559,9888,445,8969,7570,630,2492,402,2294,4107,7399,9881,8971,9914,8906,2863,1971,556,1938,3511,9838,9416,9833,-174,9470,6731,9278,3779,3987,1400,4,7114,3086,6916,-334,-646,15,2810,6177,9251,6546,4433,8329,3318,6053,4754,6166,1462,3780,3236,1559,5070,194,9040,313,8322,3591,6913,8292,5279,9467,629,-302,9164,1326,413,2065,2295,9766,8626,9916,8247,8654,5761,2003,-498,5131,5352,157,1875,8395,7145,8977,9687,6841,3517,9465,5853,6761,4793,-231,-574,5784,2192,4755,1367,2827,8559,-326,3654,918,-945,5240,8410,7340,7714,29,9497,5811,9920,1524,9503,5572,1421,6495,4431,-659,9752,8,329,-67,5187,9222,1979,1825,-27,539,6563,2525,1606,1784,6836,3512,9273,5658,9125,-50,1891,830,5094,8474,2349,7505,8733,7534,7265,2885,5376,-74,4473,-924,2363,7727,4454,7496,-640,5156,3863,7826,1136,3523,3309,3541,9830,9590,9688,3916,8112,141,-543,7319,8785,4866,9283,8623,350,5421,6486,6322,8791,1026,6509,2852,19,7582,6228,8050,7609,6086,9770,5484,-168,1251,9831,7774,1581,-85,2298,-671,5492,7334,8522,9375,6532,7685,7809,2155,8467,8317,1555,3106,3596,4606,5945,974,1333,-61,5984,5709,7211,301,5071,6250,5859,1896,7839,5546,-742,9142,7769,833,4669,5457,2738,-498,3385,7076,1817,-741,9960,6396,6165,-745,5043,-305,3272,2465,9917,2458,225,-514,9226,5412,3196,2293,2569,3011,4480,546,7994,9609,4778,980,7145,-244,1977,7555,-196,7686,6982,5720,6737,886,5728,6621,2596,580,3400,1347,8491,-961,8954,4867,4370,2782,8920,4946,9092,-424,7,376,5557,5351,9586,4209,9220,9831,5392,652,4115,-244,7275,5943,-497,7791,-451,7856,8634,1572,6401,5379,5829,2895,5379,2011,8660,2488,1699,6336,2787,8167,2446,3956,6614,4213,4332,7496,3908,9621,1184,5311,3781,7353,3265,-739,5795,-271,9580,5457,2381,7829,9694,117,7817,8035,1168,3295,6490,500,-150,7292,5401,2922,-704,7893,4743,2648,5279,8363,6963,3546,5507,1947,4403,-343,3902,7185,8654,-490,190,7884,27,6152,9745,8711,3934,-600,8477,4648,-259,-564,1290,995,1664,6133,3519,4859,4844,8767,-736,-908,1422,4505,8444,2195,6463,9146,-727,4271,5212,5463,8127,6724,8552,2599,3509,9613,1122,2968,7623,7703,4024,9062,1463,9171,7619,393,4200,8046,263,5102,717,3128,8368,4423,5053,4780,7714,2852,8066,9694,184,2016,-953,130,9789,5979,4215,6096,1073,4362,-204,2156,1371,6640,8084,3712,3322,3640,2734,2926,3957,2569,729,5117,3415,4988,6557,-419,979,480,3319,5848,8398,4423,483,6824,591,9039,4410,2116,9208,5934,7448,165,8722,2614,6916,9145,617,3433,1294,1166,8533,9048,2983,7794,4241,8455,501,1810,3955,9351,584,9862,5632,6237,8644,1845,2427,-949,4193,247,8173,7897,1975,9834,6375,7573,2272,3106,8330,8298,1819,7068,2134,5229,-936,7484,4571,499,6720,1134,6431,4369,4566,5630,8889,7450,5102,7767,1212,6198,795,9534,6259,-492,6136,1207,7017,5347,8614,5854,540,2920,1048,2919,8653,4380,1089,8432,1931,3380,9539,6889,4419,3754,5186,6501,5615,2610,2539,-411,2002,43,286,3097,5071,761,7,464,7040,2952,1724,9138,-696,4332,5635,39,-700,9407,5876,1747,1475,2732,3600,1081,2729,1920,9145,3992,2429,-796,1858,5169,5165,4568,2458,1645,9227,4864,4010,7695,9600,-597,8878,3988,745,-418,8920,3028,2429,562,1341,2687,4861,1869,773,5591,2828,4157,8397,6278,-775,1257,2478,9993,5880,1520,7640,-591,5964,9224,7724,182,5070,9067,9874,6823,5969,-883,3091,-711,2501,3357,3312,6510,9240,-725,1811,-310,8896,9974,776,-530,2407,6170,8714,1515,4296,5942,6699,-770,3199,8661,1839,516,463,3450,1597,6241,1005,1499,4066,9293,2222,129,7721,2505,6935,8870,3769,3691,867,8009,7064,377,-340,4833,510,7553,4926,9511,5686,2675,9566,-964,706,5767,9675,3535,2260,3120,93,9839,8427,-501,6231,9541,2316,563,356,-719,8319,6267,4650,5333,-351,4325,1592,26,4954,1094,352,55,9771,2272,5649,2075,4010,9793,5822,5940,7834,6534,7685,1029,5611,9630,4409,495,2496,3680,3675,7953,3953,3751,2124,2541,8144,3339,1199,4964,4541,2870,3219,7663,7820,7284,-751,5080,7399,6199,7432,2181,-546,8282,6342,2127,848,6818,362,4945,2894,8240,8462,1087,179,1650,7583,1942,9765,6080,90,7245,-990,-532,8480,8814,893,2629,8331,2170,414,8073,8799,1154,8023,3677,2270,8718,4986,2267,6761,4535,5381,-451,2608,4496,5402,4647,9457,5639,4392,4023,436,9706,4971,1138,4116,9540,698,6297,1303,6852,9150,4438,8831,5981,2325,9845,6199,-857,1953,4228,3025,5799,9164,-661,3040,8311,1583,-804,7966,5819,7304,7573,2966,9135,2280,4762,9417,7715,8773,2057,-12,1138,-855,1209,8482,8373,4422,7321,-214,5779,1296,9817,135,6510,9492,3683,2892,6353,-622,9046,969,8417,9279,973,2906,4075,-121,3161,2681,2087,655,747,1168,4193,3939,-515,7196,5213,6465,258,7403,8720,4038,3243,9546,2300,2377,7807,6450,1152,3721,4506,5412,8363,7550,1134,5351,7442,8688,8668,7708,-423,4287,8345,9862,-609,9696,232,3719,7259,6316,8234,9650,7456,2985,1354,4317,5978,1051,5529,3082,3161,9525,5717,1966,5594,627,9183,6095,8684,1706,919,2606,267,9938,-401,1945,3082,3908,7803,3277,587,4040,9716,9454,4100,7977,5344,2494,3998,4283,2986,8478,2075,1695,776,5253,2850,6724,-773,-540,118,7697,3390,-396,4358,147,7530,4122,4228,2483,7394,-391,6855,5667,266,6888,1394,6017,2644,2163,7741,9161,4433,4247,9214,1024,6303,3262,-950,7515,6207,5345,9172,585,7552,2269,4084,6141,2334,7199,2113,1175,1230,7966,2306,-376,3514,9775,7491,2763,18,3955,7359,937,2540,1349,3924,5384,111,8586,9608,7999,3603,9781,7933,3824,5247,2230,984,1882,936,-900,2637,9594,2661,8935,5154,8513,7574,6651,7131,6866,3509,1443,2558,-551,-938,8042,5199,4045,3309,-50,3049,-327,4734,4006,6649,3012,2936,3548,2949,1159,997,3369,1739,1375,6165,8593,9221,6822,8406,7172,-698,9905,6482,8979,-973,3380,1566,2476,5672,-934,4026,4670,7914,5279,7703,1,4174,5669,3589,7212,6368,6494,5076,6441,8823,1591,7733,466,7432,6098,1298,3671,5976,8991,-147,5738,6759,4200,3654,5563,7865,4453,9757,2101,1224,9112,4127,6858,7197,6871,4849,4420,2662,331,3663,4835,1464,2502,1691,-174,-275,-926,-475,-135,1324,475,6649,9297,-839,904,8946,9219,7540,1063,8900,6285,4996,1421,4787,585,6523,936,1457,4003,1921,3399,35,7193,6081,6188,2138,7192,5177,3197,1604,5037,-551,6558,2898,4487,837,8754,2622,1589,1508,5329,843,6010,4915,908,-240,-232,3336,5950,7893,7705,377,4773,7597,5586,2403,1419,4228,8286,2636,8613,4276,-112,6525,3703,617,5844,8140,8910,2122,6836,3333,2944,7906,4364,6295,6225,9114,3622,8006,7155,7945,7906,2484,3824,107,7129,3692,6033,6990,7130,1557,6141,6480,5093,1954,5125,3299,3314,6285,3963,2002,6061,5535,7786,352,9224,1086,6852,2187,1316,7096,6638,8839,5362,9696,2945,3846,2344,5646,2353,-161,3860,3967,8071,2625,8021,5440,5168,24,4106,7262,367,8687,8605,4231,3871,1382,4862,7788,2246,-176,2993,5306,-582,577,4699,9345,5166,950,415,7536,881,7859,4500,6573,1184,5693,1069,6578,2781,-242,9701,1963,7674,6425,9658,4770,4225,2164,723,3499,424,-146,7969,3107,6738,-689,2212,-675,4349,9902,3980,5781,3549,4074,2396,8264,-802,3032,9357,8431,7488,2840,775,8596,733,6061,3977,-284,1238,3291,9657,3546,6858,1189,8213,9747,5660,6476,4528,4957,7253,3890,680,4761,9241,2633,1453,5043,3648,8879,8454,7166,2957,6903,7264,4511,-405,-184,4784,3105,8377,9393,1320,7344,3443,1258,534,8827,-986,474,4198,535,7245,8086,3974,3728,3435,2475,-140,2463,9480,5245,7833,5557,9731,1512,3579,3117,2722,5002,5462,8151,7016,1569,1105,-709,5349,-330,8632,4049,-539,-21,4874,1108,7450,277,8838,6733,1398,891,4679,9122,-970,393,-804,6124,9225,1520,1503,8058,3402,1799,3917,6121,2811,-396,7828,8167,282,7565,7266,226,2682,7862,4070,1432,-605,2693,9785,3110,8008,9044,8506,3050,111,2687,3917,6691,3614,8329,1916,1815,3580,8073,1402,12,6763,2390,8798,8299,2445,5232,9177,1738,4798,8109,7201,4315,5231,7786,3538,7301,3518,9725,1589,9220,-195,6659,1987,-764,-960,1399,2833,9187,-350,5820,4843,3126,3502,4812,3442,5436,6335,7275,4818,1204,4351,4374,9641,1274,5661,8018,9493,881,-396,6990,2239,6584,1476,1556,-271,138,1433,2455,323,3899,485,5025,7182,8658,2570,9016,3261,7596,665,8000,6293,8757,6953,9772,1628,4966,748,4608,2874,9674,3330,5803,7741,2359,9496,9336,4933,6507,3226,7234,3543,-71,-314,913,8350,2729,2782,2850,8550,1491,7039,2405,2999,4122,1472,4461,7686,2379,-170,4499,3095,3667,3733,6493,1302,6137,8516,5951,253,443,813,-769,2660,3629,7515,8879,-667,3281,588,9936,5841,3433,-713,9357,2096,2447,5149,8325,794,9433,9222,6369,6176,5892,7210,6387,1533,65,9788,-314,2253,3587,37,6902,6823,5321,4587,6954,8890,3051,1789,2215,5948,538,1706,3853,8798,-420,3590,195,-29,1835,750,7036,4360,2797,7510,5774,3125,2752,9344,4368,2713,679,-518,4061,2704,5707,488,6980,8385,88,9779,8975,5997,6546,5705,-828,2978,8969,2357,1129,-444,2334,8708,9051,6979,3528,1432,6121,1089,-268,386,2554,9990,9117,8697,3440,5614,-450,4474,5711,4713,7577,7811,2817,5184,4302,7431,9758,5450,3561,-941,455,2487,7270,2165,762,8640,4476,4973,4879,8523,6667,-773,6620,2121,8373,9262,4134,3660,3674,-141,8380,9482,-652,3520,528,7022,6270,4377,3984,3589,2088,-110,-400,91,7406,-56,3313,3852,2951,-208,1234,1848,1886,1548,8721,9810,7500,3944,3767,7011,9517,8093,9607,4725,-723,3534,-664,4207,7599,2456,1204,7808,1009,2778,7281,-861,7117,930,3570,4153,1875,5304,1091,167,8880,2410,-274,7413,802,8529,499,2164,9961,8973,6035,-913,2538,2192,1672,4355,6863,9494,1687,1757,3332,2967,8823,7444,646,1285,-502,3223,4720,6662,-97,456,7656,-878,6493,2371,2081,4928,8567,1998,1505,9888,-666,7439,9658,-261,7004,2680,5639,798,5821,8517,6976,7622,50,5706,1889,644,4161,9544,713,-602,5488,3099,1038,4791,6118,497,2548,5077,8602,7884,225,1460,5512,6060,-66,3546,8471,5204,6553,4734,8254,1988,7892,4070,1073,6084,8136,5070,5526,8606,6501,7111,6282,2002,2116,6455,1596,648,5233,9111,6049,4109,9143,2245,3990,5015,-922,-388,4493,7700,1842,1384,6807,5994,2965,5566,-723,7806,4758,1277,5060,4222,1595,1690,9977,6721,8371,8287,3793,6458,6332,6555,7394,4942,5354,1919,8381,9371,5887,2344,5143,966,5831,5215,9534,6357,6071,7480,3698,925,972,5361,8289,8469,9159,2902,2627,2337,3207,7298,6264,1329,2023,2782,221,6652,6185,5670,9142,897,6546,9177,9721,4057,4338,1685,7723,4902,7319,5416,976,339,6146,-806,5805,3202,1300,6889,872,8502,6653,-214,9437,4469,6018,6486,6482,6514,3933,763,6030,3590,8261,8460,6249,8376,63,7806,261,9516,9170,2160,6948,6921,5264,7285,7416,8956,9147,8609,-792,5377,1550,233,6828,99,9080,5076,2013,523,9022,4388,4064,5786,2397,354,4034,3849,347,4325,2616,377,1705,9852,8384,2065,9636,-408,6331,-946,3908,4026,5996,9821,4719,3549,7351,2955,-911,-29,3517,8228,6181,9002,8925,-801,9377,6830,7455,3687,9823,527,3118,6551,3098,9440,5371,5316,549,-98,6125,6645,8018,2750,2648,3912,2054,195,-710,4454,105,7222,6976,2394,-427,5912,8809,6746,3005,737,8847,406,5650,3529,1992,3076,7257,360,5312,6640,739,2077,-853,9242,6428,8202,1917,8233,3631,6004,634,7913,8465,9504,2360,2748,9063,7257,8566,6575,5734,5047,1383,4468,-604,1159,6497,9436,2788,1972,8944,2525,3243,-633,1404,4514,421,465,1815,8454,2039,6714,3947,-412,1182,-778,3333,2231,5483,4515,3399,5948,5002,2934,2071,8620,4650,1119,9395,1512,7886,3265,3847,5617,8972,4732,2607,8894,3033,8933,1470,5308,8022,5604,6687,6829,4871,3482,-911,8410,3971,7042,9438,5008,5596,1048,8287,7877,3134,-795,4944,3518,-558,-641,6760,9600,5576,1158,2517,3830,5422,705,7473,4479,1667,8401,-276,5930,6272,1414,7822,3713,9486,813,690,-649,3103,7888,579,1162,8460,8563,2297,-93,1975,4588,5354,513,5434,9574,5857,7474,8132,6101,6830,5546,8876,6487,8414,7211,4504,-842,44,4340,4543,-826,6679,5097,2427,2914,4712,6653,1528,7493,5672,3729,5565,1607,9435,7358,4012,2047,3694,7077,5839,8244,5486,641,846,9187,-327,8598,-17,4047,4718,5130,7034,1467,7626,-156,61,-468,-22,7585,8760,6049,8679,426,6959,6600,959,4650,5892,1676,4985,8450,4188,8232,3904,5535,7521,3779,317,9399,7561,3442,5773,1706,4850,3156,8108,6008,5162,-7,-103,5836,1859,5610,9118,8878,441,8467,580,8915,7158,9005,1471,6932,8001,-272,8997,2635,8273,4686,7634,2156,-470,8945,8749,6505,-141,5257,1134,7653,-902,4697,8456,6707,1145,7438,2022,8750,1997,1136,2604,5799,5669,8008,7404,7842,3549,3746,5755,6647,7744,8253,3625,5785,3058,2831,585,-193,6815,3477,4735,-344,8589,6023,6815,4673,7374,4902,5824,7984,3320,8970,3642,-404,3123,6023,1522,5490,3821,-827,4421,3511,1823,1249,2691,4061,9719,5127,3045,987,244,4719,4333,-625,7303,2173,8345,948,4973,5267,7553,8024,7721,3755,5156,3608,5315,6534,9504,7610,406,4109,7917,-251,3242,157,4734,3691,2024,3310,3725,1514,7908,2944,6656,6534,8885,4281,8397,288,4656,3416,8848,5531,5033,1734,6142,5485,162,6507,4905,7975,7962,8986,7968,5523,9483,206,1150,6086,7954,6097,2734,3403,4454,5837,7486,1785,-346,9672,3279,6825,-404,718,4305,1134,4517,-941,1746,104,2303,2585,7913,9128,-461,777,6210,180,6644,813,873,9837,5992,9772,7033,2781,-369,4799,5987,1563,9913,3239,1481,-322,9982,1265,2586,4379,3358,-296,3408,3858,7617,1616,450,5611,157,-193,6282,4780,474,9559,8970,17,5880,664,2481,2087,3939,8263,8667,-347,-529,9784,6506,697,269,8244,-662,1282,6477,4183,6751,-37,2918,-729,9990,-812,-291,2762,4787,1265,5874,-854,-782,4324,6929,3134,5928,362,6993,2258,5678,-75,211,2302,9861,349,2815,-18,5104,9473,3958,4747,9315,9964,1218,-182,-591,2645,9184,163,6037,1308,1813,6096,3375,1843,632,1995,4196,-648,4676,5619,242,6023,4249,2173,6438,1513,6732,67,4048,9862,8001,9401,7478,2754,5553,3813,1522,4417,4606,281,-41,9060,1999,5856,8391,9434,3402,4265,2101,554,2145,6001,-580,2730,9039,1610,3174,2719,9363,6433,1955,7758,355,4787,6929,7957,-625,5611,5973,4026,9458,5096,8517,5555,2737,9622,5704,9637,1535,4022,4237,3459,4146,4650,7142,9238,-251,-228,8396,3732,3969,4492,6789,2850,4131,5552,8655,-714,5229,8637,9235,1458,-661,3822,924,4435,2153,7593,1077,233,4445,6449,3800,6609,3998,690,4077,6797,-81,4105,5339,1170,1315,81,912,1576,3395,1591,3379,4072,7733,8185,6947,5376,4684,9314,6877,3146,8944,-54,1034,6740,1038,1055,8726,7353,5164,1431,6508,-176,3177,1808,146,-114,7458,2064,7816,9704,1230,9269,6027,-622,6116,4740,6188,248,6983,8067,6867,1429,4107,26,-261,4374,6310,2536,8266,6219,231,2305,7776,4473,7630,-715,9031,8138,4398,5769,7100,7641,9256,3466,134,8616,9511,7079,6631,4609,8777,1126,9662,3608,-270,-799,1232,714,8471,-921,7293,3169,845,3588,3538,-607,2255,9356,5963,8335,2265,1118,3725,5472,9891,9686,932,6879,6261,6313,7127,3013,2169,9926,3200,8306,2032,5458,-789,7809,3982,6742,2066,6321,5221,2122,3748,7763,-139,4480,1396,4002,2808,2302,3264,9708,4610,4363,2655,8617,-522,7565,1681,9311,8392,5095,2315,4379,5120,6927,6246,-666,8850,6679,1608,8741,5540,792,678,8128,4147,1040,3778,5925,5081,69,-195,651,4150,435,2176,71,2844,8872,551,7267,7417,4858,7472,642,2735,4988,3432,6220,9778,2140,72,7140,1218,-85,9653,5740,8330,9117,6249,-867,5067,7963,22,6557,9374,2487,4885,9596,7318,4485,1971,1174,409,6753,4764,3662,7699,3369,384,-92,3985,9252,2289,9547,2538,3164,9456,8069,930,6535,8470,4669,8469,-305,2934,1414,8004,-431,5748,1733,5595,1050,318,6095,8163,1256,77,2190,9774,4022,1092,2514,8853,2473,7776,8501,7030,1961,-704,4446,1062,2693,9798,4520,7522,60,1313,-189,1009,-59,7365,8136,7421,8784,2396,4601,5590,273,5626,2184,-162,9093,8500,3987,3006,7549,3894,9209,1696,3131,7399,2824,733,5368,2252,3762,2789,1418,2068,8367,8082,5392,5053,4618,6615,9477,114,889,4137,9857,9987,3211,2155,2463,1189,2308,3972,-326,7396,2501,5511,6357,5106,7066,849,366,4207,8876,-164,2904,2762,3497,7843,1749,1673,9221,2632,1623,7538,2755,-495,6365,441,812,-211,5965,7194,6270,242,8607,9545,6660,3121,1674,2832,7229,3064,2307,1612,9824,2884,8393,259,9720,6419,9340,9071,8401,3843,9802,8341,3919,9790,530,3473,2228,5575,4786,380,9460,3210,7508,1605,8992,3505,3070,1358,7830,5020,5008,9112,1053,192,6705,6487,5491,503,8967,258,8606,8472,4681,3397,906,6945,2470,5518,3645,8757,3642,4663,2366,4722,7309,5976,6187,4110,3742,1410,7063,3513,6725,6134,1707,384,4431,7040,466,1738,1563,5019,1000,2702,2821,6475,483,8942,567,4725,8737,7934,8431,5097,6782,2887,9940,8148,4444,6814,-5,8987,7696,9097,7529,5997,5633,4160,-817,8333,3656,-446,4715,7129,8314,8803,8228,8227,9273,3524,2540,1043,3725,3969,-889,519,1639,638,2916,5313,6941,3818,2772,2084,7842,2771,1116,3988,4738,-586,8641,4599,9604,8579,-670,4850,757,3884,5679,9582,-309,5628,6508,2088,7864,9159,7381,8427,7718,3572,5282,6166,6338,2673,2030,4146,1180,3676,4124,291,7158,9956,6250,5345,7001,-559,7480,-540,5612,9739,4417,-464,2339,9265,6843,9243,5283,7758,5811,3133,2983,5403,-101,4177,8466,7392,4048,9352,3250,6986,4148,1589,6253,-970,441,3634,6379,8270,5751,2802,1998,1786,-983,9693,985,2483,1056,4336,-633,7266,4186,2447,3844,9076,6268,6859,9824,4847,8080,931,4742,3801,8016,3803,7598,6466,7459,2325,8046,590,8206,8551,2025,7098,4082,8074,2900,1168,2986,165,2559,5803,4569,9806,7075,8516,484,1446,1759,4344,4724,6627,-269,2363,5332,-343,1897,2899,7686,9044,9704,6444,3986,6260,7688,3081,6909,8592,777,7228,2457,7969,6464,164,8696,8850,1030,4785,7783,8493,5857,7361,6677,2693,7970,9990,9226,576,6170,1858,870,3219,3575,1393,9548,3859,2324,2713,7419,6819,8193,9580,7460,3751,804,-62,5368,761,9091,4378,6915,8,1088,1610,2032,6481,2621,6187,4701,7494,3829,3132,7208,2060,2661,751,5127,3712,8497,8880,5993,4771,7272,-692,7917,6721,3207,5084,473,782,5460,4387,48,2457,1653,8266,8758,7348,1,558,7734,-97,51,3178,8361,1267,8259,6298,2269,4464,5695,2571,8174,3110,7677,5724,5375,-525,850,9981,8825,3765,9164,5939,7455,3101,2712,5275,6538,2294,3663,-632,5131,4515,4934,8558,643,485,9435,2667,5746,7057,297,389,9422,8908,8842,9537,4336,-802,-322,7652,6943,7585,4781,4911,8045,8343,8727,4104,7296,3746,1470,8075,-468,7398,403,5811,5189,7270,3857,8929,8975,6824,6509,9375,-743,4375,6010,5294,4334,9598,117,7608,2653,8990,2763,5088,1932,8512,2111,926,8764,1687,7115,-717,-55,2521,321,3924,1056,5066,1001,3073,5919,2176,5695,68,7679,4897,-279,7863,6396,6291,5703,4340,9646,-492,7495,3838,6920,-292,2482,812,741,3410,6768,3861,3346,8492,9838,9748,9758,5334,5082,4072,1910,-411,187,-24,3487,5837,7686,4217,2640,2573,6443,3871,9607,6147,6539,9062,2033,3864,1962,-966,5032,6716,-131,292,2085,4560,4019,3368,1770,3575,8935,7276,752,-63,2093,8903,3902,5912,1494,8859,4507,9510,-754,3483,5614,1386,8895,2011,7261,2861,7800,8821,75,9119,8410,7890,-431,9827,9267,4682,3795,5534,5521,6547,1392,6524,7009,8736,520,7068,-229,5299,6849,-392,5442,-128,2564,4986,7608,7694,2264,7383,1301,496,9526,7708,3351,9160,5416,6884,5182,4382,9888,-134,4396,7375,6264,3600,7140,7486,1741,4717,2562,5713,8636,2982,7519,8011,4049,2519,6455,59,2042,3542,2081,-449,6794,9593,8356,7199,-166,451,6667,4726,7173,1764,5166,7544,8748,2708,3475,6651,6377,2606,5434,2449,7938,7917,4180,7901,216,4284,4816,5316,2235,-817,8204,9236,8998,2230,5785,5908,6495,3596,8119,7273,2120,3685,8872,5903,2797,3950,6357,4504,3132,4228,1223,9946,3172,6361,3865,9274,5304,3234,6295,4242,9485,670,-440,7090,5057,2493,7313,232,7166,-975,9086,-382,7923,921,7442,6172,8501,9216,7434,2836,1848,7047,572,2268,552,4814,8069,1742,9631,1999,2115,3161,3558,852,2451,3678,2016,8966,-106,2558,5078,9951,7103,1517,-835,8835,200,768,7449,2860,2997,2385,5806,-234,9516,4111,7107,3100,8366,7502,8851,2209,4377,4150,5291,3368,1132,8545,6327,8298,3167,2148,4710,1903,2232,921,7411,5693,-685,654,-219,4018,-236,3029,5739,6967,1787,9940,7537,2106,8805,4297,7550,-604,6741,1425,2062,9060,-203,7899,9779,3200,2629,2942,6132,8152,-47,7568,4679,461,8349,3123,3498,5982,5433,4076,8508,8120,52,262,8584,7389,1544,9690,9905,726,2719,2052,2169,9784,8875,4318,-634,293,118,67,4586,1148,2114,5725,8669,8188,3106,8778,3886,-827,8376,4147,9982,5267,4684,9155,4129,1648,-280,4495,9609,-749,-727,-98,9630,1824,1802,3953,7150,756,7247,4325,1857,2942,4598,2336,9992,8654,3797,1109,3298,3956,3669,4351,-353,2273,1962,-374,1866,3540,1180,3525,-244,5300,5888,7735,-313,406,7204,7925,1993,-66,4855,9349,2781,4243,-887,1938,2083,8180,4748,7617,7299,452,8497,1972,-511,6001,-250,655,-579,4849,7581,6600,3985,491,9046,106,-476,4846,-968,1840,-298,7636,1039,7546,4235,-203,9985,-687,5642,-408,3820,4280,8648,6705,5797,2618,4866,386,4210,2024,3251,5626,8682,1246,1973,3311,4107,7170,4666,5568,8466,-587,5070,5223,8221,1323,9928,7313,7120,4262,9535,1462,3723,9989,2254,0,2067,987,6620,7539,-661,7287,2104,8747,8414,9874,3514,1040,6895,907,-917,4105,4863,1937,8372,9514,3269,1536,7454,8574,124,-342,6067,1733,188,6774,2901,9046,5316,1672,85,-341,3266,9258,1796,2826,4286,1160,1060,7707,4819,2944,4783,9693,5357,6740,9184,8147,-800,-23,8720,5617,9514,9340,6517,3738,7183,4559,729,2856,5139,884,7582,655,9437,870,5161,299,7104,6522,8539,3451,670,9483,7215,6514,924,9169,3280,9830,7120,3613,4809,504,2594,8453,5533,5194,2397,2590,7489,761,6292,5860,3189,2593,7306,40,5901,2288,8511,1693,-498,7846,-143,9045,8994,4522,9187,8472,1178,4669,-586,5382,2543,9359,9996,3024,1878,7380,6084,3975,5847,-94,6783,-941,8618,2647,7318,338,3151,9398,1447,9768,6350,5430,7491,8999,2858,7305,9813,4489,6771,295,9014,2453,7358,2620,9730,1722,4804,2504,3673,5934,1939,7099,810,-28,4645,3484,5747,-521,3203,2345,4697,2870,5161,6288,1492,9647,2989,9637,5452,1476,2965,7182,2756,8139,9533,9157,7242,5332,3004,-981,4903,4566,3628,1918,8215,7867,7526,2573,669,4281,7733,2792,3719,8196,2938,2019,8079,1141,6753,9759,1658,186,-964,-833,6509,-969,1410,9007,8540,9516,6882,340,5902,342,5076,7880,9291,738,-525,1284,2394,3823,2211,5000,1986,7863,-315,9879,4622,9176,3641,4866,-855,3088,3683,6176,7281,6840,6944,8560,-721,6058,5430,9766,2094,9543,8810,6560,2047,196,4418,3443,7412,8056,7437,7977,9280,4555,3843,1035,900,1803,8922,1520,535,9356,-508,-654,5410,2908,-463,3107,8264,6616,-284,1561,4854,3327,7320,6067,2063,5277,4108,4023,6248,9429,286,6885,3172,5351,8136,7960,7401,-710,6945,6193,5127,9132,2503,6592,6030,6589,9129,3068,739,7546,2573,8343,139,5910,2703,827,7090,1360,2740,89,1231,4186,3230,4966,6090,152,9687,1834,5398,3941,7624,2613,6621,-632,7150,5864,3566,9413,7621,1504,6956,4931,9331,1576,-837,1262,4530,3875,563,-432,4218,5105,1196,4047,4605,-897,2581,5097,7341,165,4068,-654,1484,6661,6885,9623,-385,-85,5236,6043,-513,9447,1230,9282,2831,2767,6786,2047,1169,1167,103,4295,9937,5521,2379,9105,1754,6069,4635,2995,-712,-103,3816,5525,2034,1199,-400,8663,345,8080,6163,859,-22,-814,622,612,8529,5280,1583,428,2391,3196,9058,3973,857,6801,528,148,5659,1813,6790,3694,4573,4765,3003,-678,64,6239,7676,4888,-425,9981,6328,5146,2862,2449,-517,-682,6994,6501,1948,7882,9619,6569,6585,-992,1734,2417,6409,4538,4081,9561,599,7472,9033,8048,9639,8218,5197,1011,3340,13,4552,1303,6109,-318,4209,8766,-804,2357,1248,2630,8847,5680,1901,8689,3736,8679,6299,2344,9242,9551,9434,3384,-58,8626,8890,2825,237,2551,8707,1060,6102,7057,4682,3098,2463,2912,3191,5853,7269,5811,1885,1400,7126,3413,4881,6936,7629,8651,1003,2087,1317,1136,7914,3370,8854,5717,3933,9225,8425,4314,-867,7175,8187,2442,8778,787,574,-124,5934,9037,2919,278,9616,2577,9058,1199,2105,3820,7592,4061,9723,9083,1644,2201,216,7158,1300,1485,2438,6431,3945,9539,8608,9383,4757,1675,3448,3436,6238,7946,-369,-693,1382,9774}, + []int{12469,6652,8255,3153,19990,8137,20644,3549,10075,13807,1604,20669,13697,7455,15314,4335,2013,14163,21393,12452,21732,16930,1605,8114,7629,14082,4288,7385,1029,16557,17132,15143,2732,13546,508,5711,12651,4021,19587,18621,4702,8842,13949,7863,14290,1450,7266,2219,5924,18054,17360,13882,16635,17971,1681,16217,9992,14529,2396,5283,6230,20618,1413,18319,18520,12576,18144,4197,20959,7445,18395,13352,3579,8441,18367,20131,18329,11439,16227,17599,13338,17833,18169,3926,215,1164,9428,11478,6926,18122,19092,2714,3059,10814,6327,10920,2148,6280,5947,20298,20911,2820,2915,13444,17196,3756,18974,7812,3521,9534,17839,9369,6816,13644,10174,17777,17992,12806,13130,17179,15742,5176,15916,1694,21332,11233,16862,21879,16489,831,3242,14954,20552,11053,14006,14581,6890,15433,533,5944,16728,21302,13081,7464,5531,12390,9138,10659,20787,10653,5408,5159,21194,4987,1047,11590,12839,10336,297,9718,8736,19130,17697,6628,17489,20678,21715,18252,15570,793,13231,13583,7273,16067,13995,1367,19207,5667,793,9089,2417,2857,4896,19095,13333,36,4837,18088,16059,14523,710,8289,20165,11147,7168,17089,17873,3717,13442,4828,18926,2671,17609,20316,15570,4493,15805,6773,13742,4039,13898,2702,2621,36,9094,3960,17236,18843,15185,21214,14978,9799,2964,4738,2239,9360,34,13972,5805,2145,11504,21713,8223,15577,5680,11393,8160,11230,6494,860,15660,19853,20337,1481,10650,12556,4373,996,17625,10529,9043,3057,5483,14597,20646,19688,1260,10941,1171,4593,18647,5214,11873,17165,15274,5103,14304,6670,16306,20783,16341,15050,10091,15566,16726,3250,15877,17800,11888,6475,17730,16691,15865,13778,4690,21421,18356,0,11624,7022,15894,3862,6395,20148,14031,12828,10682,20723,19995,1651,12003,17096,7614,14277,16181,65,12680,10648,4564,15175,15984,739,10697,17133,6250,9859,15703,11365,7008,4746,14358,7561,12319,13918,10301,4728,21357,6800,21644,18040,4113,12324,4875,11794,4398,15496,15946,2464,17812,5515,16984,17964,19380,9367,6094,18619,9788,8574,18239,10573,3810,15925,11723,5592,9329,21385,6252,15466,10321,933,17298,8164,20009,7670,20206,8310,2904,6921,19218,2822,12350,15511,2843,17011,2847,14889,7440,555,10416,20184,14284,5405,16800,12821,12906,6638,6327,13565,9345,5315,15266,136,12122,6922,9449,6093,2263,3073,9905,11335,3784,2971,16966,7877,6514,223,15250,18437,14140,5947,4946,17205,21361,8039,10497,4585,13344,5014,15061,15749,20218,7857,762,5711,17435,1220,9412,40,20197,371,9221,4625,13693,6160,14262,3067,13101,20813,8525,16478,11390,9410,18995,8399,13686,11214,13061,522,14362,328,15805,8936,11250,1373,7919,8622,1563,21048,21316,13611,4791,6817,342,20264,626,18888,4582,2882,2413,14171,13891,8611,10600,6165,11670,11436,19706,11667,10737,19808,2290,6300,4006,14064,6955,10000,4745,2154,8802,17528,2892,5493,5910,19246,10991,5790,11003,12651,6301,5537,18125,17188,684,8456,12385,18440,4840,13026,10423,5840,8867,6722,15103,8786,11953,7938,13995,16570,17366,6391,13749,8623,15615,6836,20410,16618,10002,14350,6005,4006,4176,7487,18144,2101,12310,18396,5770,7910,13010,11064,7233,11816,14324,12229,5331,13678,3350,21400,15855,11477,19540,6101,20857,18771,2930,10361,2562,5576,3092,18957,13230,18147,9923,4718,80,1184,20929,13705,4288,21379,2446,12569,15571,8763,5946,2628,5931,7870,4778,8426,9225,10211,13998,7718,17062,14459,19262,12596,17416,7651,20419,12065,18786,18117,17475,19909,18050,850,5207,17798,6902,11604,860,11786,618,9841,9135,7519,19398,6980,12252,18612,2651,753,16374,5442,7174,16071,17754,18346,11854,10849,11179,15595,4217,210,6099,20028,8229,12640,255,15947,20816,14200,2804,13037,11184,3212,15868,13960,14340,15845,12882,3985,7737,17758,2544,127,5995,15384,16593,1437,5363,7703,3526,5292,990,21312,2868,7507,17276,14224,14610,11128,20949,8451,13717,1007,17408,7666,14047,18188,19158,5174,7203,77,19137,5863,19673,15021,1250,6575,5040,16815,3230,7435,6895,17460,264,16109,2000,6957,387,19744,8849,10659,6854,2272,13991,10145,16710,17723,17824,7893,6644,8694,3059,14283,12132,10239,1876,17805,19129,10873,17834,9883,2806,12582,12672,16769,19629,19299,16484,6592,824,16773,10208,6250,5821,10127,8775,14493,14018,11096,8963,1319,12771,21141,10298,5387,5544,4951,19823,12845,8202,1520,7230,1720,19240,18216,7427,6581,15921,6809,12815,10307,1356,6658,19689,16941,6159,18100,9402,3442,15345,4947,20734,20822,13056,14549,13420,1031,10692,6907,10860,13146,5876,3961,13014,10044,7921,12540,9854,14651,2708,1505,13014,1409,15065,15516,383,1230,10628,3818,15646,7340,7326,12175,10167,14231,8598,2939,12433,3154,15028,3435,1837,10065,13975,16208,18093,9274,6406,20058,6491,15341,9863,6193,21082,4056,10783,10891,13057,20469,9961,17683,3332,12075,13521,7174,2684,10026,8565,9211,20361,9271,15646,15254,20314,21056,19950,2575,21075,13848,4208,11120,20475,2159,16133,10287,3592,15275,6311,6680,11917,19510,15353,20485,17837,16503,135,8186,14636,4130,10230,17674,9282,12111,8785,14073,16365,9701,5071,13646,21135,10587,19679,12239,13192,16207,2206,19942,17440,15576,10983,3327,15669,6877,15084,4110,17735,2882,19804,6587,819,11013,18247,12661,17566,13669,11089,9181,14693,508,3938,1761,5232,15218,13755,6757,18561,21089,14964,587,6458,11900,16649,5802,18292,17431,10237,14036,153,1730,555,20825,12379,10372,11410,4665,20608,9973,13962,14158,8854,6671,8679,13080,5843,18619,18091,10798,15991,12171,4768,12181,12979,20182,1272,1360,19338,18400,13673,15941,19780,19295,6506,9249,14117,16638,1651,935,10413,847,11713,8243,13609,11163,11040,17187,5451,14698,11397,17477,14147,7512,20546,18763,17338,19781,19916,5741,2305,14118,1664,14029,1198,13360,11276,4130,3776,3345,11667,6849,18204,11139,2335,13057,10603,8777,18476,19503,14610,653,9284,4417,1897,9054,6305,4153,16421,20936,16027,2941,2058,4082,16590,7315,9167,13029,2381,11705,16930,1550,12382,20173,11955,5766,2611,10946,4338,6109,5111,14891,2158,8863,2401,9201,4543,20910,18262,8215,5676,6597,20920,8725,17922,9262,632,5497,10560,12328,18207,19270,19762,14352,9081,6623,4305,13404,18586,6516,327,4372,15091,9874,5178,20733,14715,18975,1055,17361,19607,1764,17476,12390,10147,18078,306,6379,15944,4514,5049,9456,8282,4765,13380,8517,16483,19467,20295,13216,10461,13831,13249,15004,930,19919,16104,12551,8013,19679,5316,12900,1912,7422,19787,7351,6767,19959,2651,3897,7025,17484,6193,19733,9107,19337,14245,11858,16534,9208,12804,20661,8840,8851,17985,1820,12535,12189,9497,19201,8615,1984,14700,13298,14012,13666,17168,13473,8698,20250,14433,1825,10260,19863,5108,9397,20844,7281,15838,6035,14414,10756,13740,9041,12900,2420,5305,11223,13585,17017,14451,4227,8905,3190,2246,7991,19940,19328,8984,5401,5907,514,16318,18258,2532,11714,966,8960,17998,2646,1389,13757,8300,16071,17571,14023,6875,960,20195,6169,5980,8241,19736,5692,10973,8808,17807,12932,16274,4865,7624,13812,12022,18441,14742,3065,939,12819,13573,8507,11816,19611,15341,14284,4060,18037,12237,11835,14187,14311,10301,2850,2919,8961,4734,15616,20525,5548,5800,150,9439,13380,12713,2627,4266,17014,1000,6309,11328,10236,5645,10050,15155,6136,14575,11664,17323,12698,19093,9973,5049,18785,0,18858,14710,8727,9082,8059,10447,5798,15045,14481,216,20728,6407,575,3676,18265,3674,16485,8601,17843,12795,11254,1074,8187,3028,18944,1901,11645,3879,18332,16848,599,114,9470,15264,501,17385,571,19908,5099,4646,10113,424,18150,7134,2211,20578,2544,3058,83,13636,10760,10611,10257,12795,18589,15715,6223,18978,7695,17657,5317,7724,12018,10990,11044,16731,11337,15669,4966,12946,9238,7928,15945,10285,12230,12540,14687,500,2598,7641,18458,8326,2362,17671,19762,11123,17743,19627,17123,14684,6941,17716,2413,5652,872,19397,13692,3865,1947,5354,4058,19938,13000,4287,12492,7883,18069,3911,15788,8473,1891,2094,2475,7500,4916,16485,11869,10274,1581,11217,11782,6843,8509,6390,16951,9420,19346,4598,2985,8325,10596,4346,5693,19432,10774,4941,2265,8491,521,1777,997,13091,5803,12348,9626,12199,8031,3300,17201,15172,15774,4693,18320,7040,7615,16301,16744,2041,19196,4789,10364,4661,12318,1894,15310,11265,3763,16788,14518,15132,782,20090,11172,1134,9225,10347,18680,19849,17240,17594,8773,16470,1225,6119,2823,16697,11050,3546,1889,13367,11341,12409,806,8095,2101,3349,8768,4002,15486,10729,14193,1369,16890,1823,5198,19410,15941,4903,2451,11390,2694,18115,19450,18556,10368,14517,4190,19768,4722,2343,14344,515,3314,8576,7767,12908,975,8813,20330,16041,6482,18827,12883,15162,18699,2212,6999,4805,18215,6897,19586,12135,17799,11298,2282,19346,1070,11297,8044,13569,3472,8234,5304,5869,857,5599,5670,5632,14811,15431,7725,10731,19944,8722,7266,1650,9293,6914,3241,2164,12186,6342,6003,8955,17233,5903,8080,9717,10423,12627,3939,822,11314,7734,17837,1437,12498,15021,15905,266,9265,14073,13179,1746,15925,19306,463,5687,18384,6647,9615,6744,5019,15973,2385,11169,13990,5846,14583,10014,20410,508,12656,7223,27,11193,16872,20214,8338,8632,10089,13224,17967,10321,2861,4589,3121,1780,4582,3879,4670,2466,3700,17121,11146,8240,16397,1623,1922,19622,18827,1853,3021,20094,13186,5984,14628,5555,13912,10623,13519,10388,11241,12139,6390,7917,12295,9404,14838,11512,1077,8742,19747,17841,10695,5704,6119,17782,16519,11945,6411,8568,17061,19234,15608,17751,9665,13011,14553,15316,13093,4574,11790,9746,2361,15081,18585,3301,7731,8949,3947,11688,14049,15450,17088,3706,5318,982,1725,15769,20092,7061,5922,285,17729,5709,16051,6641,17922,1389,2086,19232,12079,13280,10332,9073,9217,8538,11950,7435,8406,16431,496,16048,11060,3027,12279,6586,9556,8989,17609,16625,4352,16298,8675,16391,17709,3055,5186,13013,5295,9831,5863,17992,2242,10404,13915,18086,13289,10994,11711,10851,7844,7049,11566,5849,10859,17025,10621,11676,18021,2680,13747,5420,206,17463,11819,12629,975,13554,15739,11487,4631,10040,16913,17001,1442,10084,2940,9777,17180,2465,8933,20084,10345,12916,17004,13625,4565,1149,18803,2894,798,13413,19662,3894,2620,9784,18588,11540,10877,14673,18711,17100,7320,4243,11999,13214,7003,6789,15464,4153,12868,7883,11981,398,4060,16588,18028,7446,15150,14770,1306,1389,4466,19205,17844,4230,10815,17805,19301,3972,332,222,16682,17611,16577,13880,18088,12668,2174,7936,12232,12022,10176,13486,4886,9030,15314,19945,10184,15935,19553,13137,10206,5145,3592,9121,3508,18151,13161,17465,5995,16575,8513,17891,3672,9250,9091,19895,8642,2619,12942,5277,13699,13081,9681,16715,5206,4785,18935,16667,6587,14046,15825,9479,14813,7375,5453,9892,12814,16181,16227,13030,8615,3762,15592,7656,16379,18956,14849,365,12415,13572,18852,16431,19526,2701,15683,13458,10764,16770,20103,1502,13456,9054,12847,13166,4519,18141,7965,9159,14987,10867,12576,15018,4734,6877,15842,6463,1436,7930,9597,18562,17554,5300,14136,1135,19424,9260,8385,18437,2659,13987,8068,9691,6780,19628,17087,3662,7243,15407,2366,9765,15713,18610,4970,2376,13903,13253,5437,8230,9749,3404,11956,1044,14441,6142,11804,17627,5033,11444,1641,8926,11466,4702,11522,17008,19450,8354,19337,9977,5040,18421,20080,9976,16243,15209,18003,11755,19465,17720,15257,9885,3004,5312,759,4686,15432,15768,8426,4603,5389,14957,10932,13869,5218,9994,11086,14868,17504,2507,18338,15785,18058,19912,6618,14246,7432,3359,11589,7559,13737,11806,9143,7115,8889,19622,5140,7366,4878,17353,19733,19341,17599,19548,19427,4363,2918,10040,3148,243,12216,12054,6217,5063,14679,13464,5218,18957,4151,685,14776,8989,14664,1649,1879,1419,14213,13739,12125,5369,15679,939,1450,18653,1325,10092,10659,3212,9194,8142,9309,135,18155,19806,8128,16749,15057,12878,5044,9762,4744,18852,2695,1022,1485,10016,2456,13736,10205,15980,8736,9813,16794,14475,3905,14308,1637,9086,3700,9562,2810,2967,9707,5222,16547,2980,9287,11199,19679,3509,19248,19577,15755,7468,2108,14348,12674,3326,6147,12520,5885,142,8718,13513,1638,14008,9440,19427,2454,4601,18720,4568,3115,14674,13218,16528,1201,19538,11199,3268,17163,16594,8632,15702,12155,2501,3731,9735,17548,18791,10338,2401,14384,1729,10048,9864,14381,17801,6268,2194,13520,9838,264,12323,10466,15821,7980,14434,1178,12227,12890,8937,4761,18787,7670,13459,6096,5979,8685,4893,9702,5246,12268,16329,12760,16676,10831,1096,4010,19854,4808,16418,10157,9352,15635,12643,1910,8247,5789,10726,13007,19142,9986,13391,19753,747,9129,17358,8444,169,7884,16632,11064,9448,6992,14827,4002,4782,17933,11821,15841,3271,2866,19722,8849,427,17418,6261,1254,19382,852,2364,9557,9439,14161,15766,4270,12891,5046,14370,8584,11221,3080,1038,2754,15012,6809,10773,5488,4764,10079,8057,1923,630,3625,4981,5005,12636,1503,6839,15569,126,10758,415,15089,1931,16304,16374,3778,6760,12707,19517,12873,6425,12626,501,3476,1405,13081,4411,2493,3439,2304,7498,17402,1151,12090,4073,3058,18480,11856,10045,10289,6687,3591,16741,13582,2418,12561,19769,17348,9423,11638,9,3903,6958,6838,8664,1829,5681,6191,16574,13007,10790,19322,1661,1103,12765,2738,12056,17270,101,10294,5060,19495,1396,15772,9455,17319,4883,6307,11964,15920,8924,4826,3812,16186,12215,14390,2371,15541,273,8677,3045,498,18107,8130,11621,4607,4077,14096,15217,6609,4781,15430,4860,10982,16837,6035,3931,216,6302,10226,3480,9684,3337,1332,3177,3903,13754,16998,15060,14158,15786,4182,15985,9612,7007,6974,4502,2435,9672,2593,19329,4277,15576,3079,10008,10423,4555,3547,3497,13876,1028,2925,15424,17183,11880,1606,17470,19537,1342,16377,8389,8466,13953,19411,16612,6074,4680,13666,15209,11515,2504,4261,15162,12855,10739,1774,4450,17479,9633,16852,323,11168,3440,14137,14514,12720,3817,4313,10099,8887,3809,6360,16382,151,13384,3049,7175,16787,3189,16684,4952,4234,11527,18441,12447,15324,5464,11370,11599,15384,1766,4551,3673,5715,1942,14131,13180,1614,19116,5356,868,1225,18684,9542,10671,10277,7618,6062,16848,7849,4308,16242,2855,19299,6086,16212,4602,2701,9626,10014,19143,15202,7481,8387,7337,3487,2809,8399,2568,7305,7884,17829,1316,16113,13406,11087,7967,8115,16066,13389,12413,14393,17865,8786,17498,6707,14060,11868,2655,4655,9992,305,10887,3693,4453,18003,16996,1416,16171,4356,5740,4988,10959,16507,6686,11028,8056,13541,3452,11885,8933,6790,4174,16358,15889,4184,9361,3674,1095,18188,289,2677,13523,800,15920,173,4519,17348,14855,7989,11676,2151,6330,17422,1840,10823,19353,655,4561,14172,14393,11120,890,5382,9637,9892,14205,16610,10561,14411,2900,14663,12792,3409,12905,5948,2792,8550,10565,11587,4954,12218,2447,11232,11442,10771,13093,8298,13198,10626,1280,10848,9839,8816,5018,17557,2400,10594,18742,17390,10148,8534,18488,9863,7788,19459,11753,13630,17814,8543,5098,16505,18700,16642,2445,17452,14727,285,16261,1432,6648,12720,15320,7898,5969,2290,8958,14359,16259,6013,2939,4695,5353,4212,19338,15513,698,9439,19049,8368,4134,8730,14661,3313,1738,4809,1155,18940,11444,16753,7369,7270,15629,2934,14026,10346,10144,6562,11303,6862,5333,8039,8969,3048,13723,11461,10296,5876,4155,14133,4970,18860,3872,15408,1520,19320,12121,3341,10010,12956,14087,5411,11139,832,12239,809,11024,4694,8578,5534,6594,10882,12575,16807,19279,13727,15132,7350,8240,5179,18633,18306,11662,6220,18380,17883,16214,1955,1863,7542,11713,14862,9898,7492,18950,15963,4076,5576,13907,2280,5542,1765,4765,12681,13432,2174,4255,11852,6329,873,15230,11795,7010,12714,5356,7121,12876,979,219,4746,3930,5480,5504,14643,6946,8305,6041,12034,12456,11525,12917,16684,557,712,6985,4307,9217,13920,11565,9881,15789,11537,99,8272,10798,11935,2523,10266,13590,11496,17522,14994,8432,18864,14701,9338,2037,6535,7867,16180,19107,18647,4814,11491,14299,17710,9892,1534,7052,14005,16409,4317,3410,13333,18726,3630,6469,10419,6308,2378,18496,11753,17782,14408,2049,7254,12272,10835,1976,1232,16569,15568,5211,596,6568,17807,3093,8850,18182,8087,5637,16339,15532,3528,7182,16514,12254,6156,6324,18161,7173,16142,4323,9348,13823,12905,686,7092,9517,13885,9923,1802,10308,10067,17818,12813,18914,4259,9830,7157,8096,3252,13945,913,11509,13253,3154,11131,3779,17034,12083,8668,11525,13159,8137,5017,631,18192,6857,4560,1641,3305,3189,6793,825,18757,11665,10768,18655,8776,7031,9912,16071,13848,3219,14117,17262,4390,13444,10619,10117,5788,14580,13246,16391,5806,3558,8480,4695,297,4515,9650,3682,16475,4844,18032,579,13995,14890,3332,4748,5295,10569,14753,15380,19110,4351,17429,6301,18857,8840,3615,10625,9772,9682,1567,7561,11792,13700,8480,1807,14767,13558,17860,1051,11009,9820,13389,5960,9417,15566,15200,10171,7428,1869,5989,6951,15270,6799,5413,18380,1064,14509,8095,2628,17033,7764,16846,14658,502,5628,15120,5700,1901,8130,8013,12482,2174,10836,14860,10478,9445,18250,15728,5998,18523,4113,15452,6759,18347,15905,16641,14748,13871,3612,7144,12520,18368,1262,4352,4064,10337,5335,14885,467,3987,10497,5442,16361,1396,1321,8330,4265,13244,10616,18835,15536,16807,11904,8900,18254,15284,7333,1703,10154,17511,11139,5095,2464,1501,12505,17904,3399,14599,7706,7449,14901,2165,1101,14912,198,11386,7833,18876,16015,18104,5252,4360,7507,6612,16859,11811,13101,16553,15517,6530,10260,17461,16026,170,10355,10430,1912,9303,2336,12144,17830,8831,17933,14121,824,5845,572,13974,17359,4945,6591,10556,7030,3828,9807,6211,11386,16707,15775,2113,7671,13532,13370,7105,17777,1192,12102,9354,9710,17702,1401,14765,17041,13211,14567,17536,18316,4479,8445,5209,101,4342,2164,6316,14765,5462,7296,18283,7680,2407,5976,7020,6697,10963,18333,1249,444,745,8778,18823,11428,4871,7772,15468,3370,13050,11493,17741,15657,10029,12858,820,12575,15500,2621,17898,6790,12328,10496,1480,11303,16833,10413,5814,9124,12310,10948,5386,3374,16349,16195,1677,16801,15875,10539,14703,13452,829,7209,9760,13663,16191,12824,16597,8452,2987,1329,8807,17143,2266,5098,2352,3773,7922,16773,10302,2481,7224,16116,8420,5779,11825,8372,2723,10236,14913,13351,3734,18548,14448,18255,1856,18861,17911,517,5273,13595,13454,12413,9859,1549,6105,1701,2346,9880,17351,1417,16708,14155,4712,17251,772,13226,2105,14950,9706,7356,606,16772,17774,13234,13317,7781,11728,7873,2272,5408,3541,18321,7038,1476,11811,15638,6133,1993,4973,2059,3639,1391,7092,7039,14936,7565,4260,256,2948,5107,12584,15168,3186,1788,15893,7786,12814,18510,1062,6828,7696,8797,6793,3700,6917,4112,13197,8735,9365,18088,16947,7892,17359,3315,2529,848,3492,6172,1763,6906,6575,8290,7674,4151,15884,10998,3678,16214,14966,1193,14111,12317,10786,1984,9631,1698,5886,10076,11907,991,13752,6908,7740,8638,8455,309,7757,8655,933,17430,12674,18514,12527,197,10847,4912,2832,9206,6837,11147,14663,5696,13295,13766,15399,16792,18705,15998,11427,15146,4058,9542,4311,16601,10482,10461,4698,10199,5608,12255,120,17135,8294,4697,1830,7171,18327,6214,4681,2194,11475,11888,16955,1631,12269,13986,12271,11531,16915,1913,15859,5507,18275,158,370,181,3766,2313,1078,3523,8849,16013,4121,3165,13811,14885,3298,15303,17655,11387,2043,16862,13134,2779,8878,12378,6985,6001,3898,12389,4432,7687,1270,7498,13579,4417,18475,4954,4043,901,16426,15375,9422,8854,3279,9046,7025,7240,12557,5310,6063,17699,249,16993,12665,15534,14714,16646,6664,6643,14952,2607,12638,1561,761,3435,16871,16275,3623,8366,17497,12420,8532,3780,3696,1472,8117,17068,10612,7409,12144,9508,13375,14207,15907,15495,4792,13075,10889,14214,198,12765,10306,7443,2944,14083,276,2555,8983,14671,2815,3189,6609,9050,16978,4686,15672,17075,16445,18313,3485,3021,5081,4106,18576,7611,13239,12718,16395,17101,9695,16157,12648,798,13125,15250,13551,3150,2911,14598,9200,7730,15463,5725,1806,15213,13574,4358,6580,16610,641,6195,2428,15496,17571,11886,11767,1013,1199,9241,3694,1897,12883,1653,6216,4583,14741,17882,2445,15154,3687,10669,15200,5208,13831,17133,14659,10111,8815,13535,5035,7185,1106,6205,217,17223,3804,561,12185,3375,3022,5790,10699,10325,10415,8895,16497,5400,15263,11229,10559,6866,26,9839,16198,3552,3273,16636,2,3848,8610,7575,1677,8995,8065,6392,14347,11859,6136,15934,15918,12832,15985,4664,9492,7740,14857,3627,18439,14040,106,540,15732,14254,9700,9106,12042,13824,13339,9820,3317,17622,1369,14213,1923,3400,16389,16347,16670,9440,13173,12656,6392,13277,16241,8194,14323,4178,12206,9732,17188,5965,17659,11119,7936,12510,18458,4034,4727,6740,7722,16199,3162,1270,11051,2980,14945,10194,12193,15574,11021,17355,4963,12263,7305,3989,2760,2727,11308,9457,13985,7903,10835,13498,962,1873,11692,15386,15557,2590,12277,13026,14612,18351,1444,7929,3767,320,10862,18058,1159,6978,13706,17482,13352,11327,17307,10943,4988,3564,15359,6391,7732,1464,12412,15916,13559,2576,11266,18300,9073,9179,7366,5289,17057,17218,3216,7254,14924,3918,4225,17934,3530,9878,15687,77,222,10398,15638,6063,16799,13071,8138,9650,9598,13217,16403,10398,3873,16371,7526,1940,5779,13845,14272,5380,2903,11716,8230,10593,12907,2170,3402,14772,9305,701,4177,15351,6719,9585,8389,10674,18234,15756,11885,8288,11460,9397,12000,12204,16406,12632,11969,9774,4002,711,13096,6234,5342,10914,9267,11786,10973,12959,14874,9947,11260,14353,2445,14632,11870,7834,11991,2368,9574,12932,16774,11437,1865,7648,2970,7348,12731,3266,4267,1049,10050,18250,7711,1891,7790,13537,7558,4452,11853,16286,13598,6261,2477,10340,1718,7041,6144,2908,3300,12799,6296,8259,10971,7049,16806,1660,13377,12967,1654,9821,11702,7221,612,8708,10823,2270,2477,4598,16599,5737,17434,11596,5325,18182,16841,7406,14011,9762,10870,12951,14300,15782,10615,13213,6220,16860,11518,4395,11022,12200,670,741,12409,6634,14500,5769,10297,929,1800,5848,1115,18188,7780,17928,6583,12230,10755,6523,3851,11571,12246,5648,6171,3626,2264,15794,1823,14537,18101,8072,9933,16511,1619,10434,14356,16302,8023,9896,12576,8136,9756,4652,11521,9867,10077,2766,4977,1988,16749,7457,8146,12885,3340,17258,6333,18104,11709,5505,14781,14591,10056,17157,3962,253,10719,14761,13193,12622,14306,18113,1943,365,11598,5365,7122,10877,1838,15539,10067,160,13622,16324,4066,12212,12132,12278,10875,3354,2916,12900,16611,5376,9951,1316,15109,4898,10402,17779,11559,13014,2915,9813,8055,7572,608,327,7920,6456,5649,15598,16754,3642,17872,2158,8858,10860,2061,15211,5646,476,14704,17594,15398,16448,6089,17986,8863,11024,4028,5125,14736,8293,25,8161,16126,17120,3835,1533,3025,5358,6024,12049,16924,7262,16838,7451,15379,5192,13040,9210,11219,8626,5197,12519,4552,25,10951,4657,320,2925,15586,7773,6779,15291,1448,14158,1916,152,8789,14932,6693,17597,13391,760,1865,7576,483,11013,14067,11287,1345,12692,14050,5240,5015,3199,12305,13112,7757,3185,17409,13991,5481,1754,10268,12368,6487,476,5320,3123,13825,7849,10292,10327,11551,9754,16467,14215,7179,8679,15706,7829,10222,4001,12228,16803,1296,16598,3001,3126,16403,540,2581,14299,12946,13854,547,2589,7301,13801,9861,9684,3945,11482,11559,17724,2441,2895,6217,17635,1851,4817,3253,134,15531,9853,15640,16133,17060,7718,6434,2563,5819,6636,15105,9631,10893,6262,10808,14437,16659,13669,10363,7177,16589,4265,2252,17250,13610,4672,16652,12053,4317,9564,14441,6727,12112,11682,4638,17399,10843,4697,11401,8190,13102,8821,11546,1638,16523,3683,15216,4248,11216,2979,12962,14016,10072,11327,10340,9274,7414,6978,17284,10316,15389,2893,16414,11589,17081,9947,757,9247,4088,7164,17115,3400,4464,13513,17019,7381,17267,1892,599,8064,17429,10513,6342,12709,644,5947,13204,9944,17268,10029,9242,13442,2364,16717,12928,11885,3245,1626,11444,6649,9203,4364,4873,16638,10116,11075,10014,12458,14462,9494,16447,5525,14928,11994,1647,6668,17328,9722,9328,14781,12369,16990,17434,17687,6731,9211,11519,414,15553,2624,13274,16574,980,11760,2611,14374,6019,16317,15976,6140,11171,12827,4745,3733,12624,12418,10482,15867,7510,11734,10374,8810,3161,9876,15441,13123,15840,10496,6292,16873,2202,9107,15811,11561,7450,11799,14315,12120,17721,16474,2989,6983,383,16145,1751,8049,1574,13057,11317,8672,10440,6317,16419,3983,5876,7752,8888,16694,17022,16854,8022,5445,10894,8424,8300,1807,13439,8300,8593,12110,9510,7574,12100,14314,14631,2437,8966,12686,14438,14317,4304,12617,17419,11742,16588,12358,8141,2482,1231,7348,4614,17403,14371,13974,9629,13989,16433,9993,13837,13231,13892,11696,5583,14916,16032,11106,13256,8461,13806,9285,11512,5995,5443,1793,10216,13204,2066,15724,2825,16307,12647,8798,6267,3872,3578,9716,16720,606,3863,15171,6416,17712,9575,6688,16368,6388,9442,14995,9667,695,12257,938,403,8357,6793,9120,9422,16488,15050,719,17626,541,11529,10782,1172,7010,7739,1180,6006,6727,9967,16206,15784,12800,15305,15450,8393,3078,13944,5506,1461,3338,12450,2948,4846,15811,15594,16266,10701,15216,7032,11107,12136,9759,10181,10234,6215,4498,10368,10970,1601,9667,1988,76,10916,13100,10252,2617,6865,9083,8819,342,542,6907,3256,5019,11637,2126,16442,6238,7643,17588,11061,13208,7136,5901,3815,12937,15368,13892,13265,4443,6359,10775,4356,1579,4437,4598,688,9421,3959,1833,10354,13398,17626,15415,14855,8225,492,7695,13427,6946,876,17315,15349,14470,5888,16856,11333,13432,12174,7288,5730,16516,5959,9330,1733,964,14590,14056,1425,10383,8474,9244,16195,3304,1917,16766,11289,4518,8961,15964,752,14530,5728,10488,146,13106,14135,8554,12306,10114,16401,1142,16579,3305,16228,9428,3729,12895,16383,14262,14334,9712,3861,3014,6550,16111,10276,15570,1722,4482,3731,10299,13707,14753,7436,3392,4283,1269,16185,5877,11546,9144,10353,1974,13886,16948,5296,16329,15228,9472,5896,8931,6381,13680,8996,13818,2161,8721,9399,15654,6291,14124,9035,11660,4193,3669,12580,9919,10199,9137,6992,2454,3247,4766,14354,8387,5106,9868,2197,4262,12181,11551,6769,1726,13996,13542,1351,14691,15848,3780,9003,13524,12650,6748,11047,5064,11824,15883,5250,14381,12516,12818,11618,1221,15531,8052,9284,12422,4734,5294,15663,13658,8586,9822,376,4001,2950,12264,8860,7451,1754,12316,1706,3798,10347,10049,6534,10586,1384,11113,15216,8060,6111,3514,15666,525,2614,5890,11620,8826,4849,12680,3171,3383,10055,9211,10295,11787,9147,8607,12188,199,32,2705,12115,7457,7855,5852,433,17298,132,8220,1400,8050,3810,4450,10817,10003,6930,1998,7657,4740,1552,7669,15282,4465,9738,10313,12841,8776,13591,14719,9213,5998,3985,14623,6705,11474,7178,10485,12024,17255,10118,14821,3523,15633,3904,11053,15426,1544,5542,2235,4244,12677,3379,3127,5441,9825,5287,4635,2988,4987,14537,8246,4699,3654,2865,6036,12326,7103,11859,13772,5146,5738,1518,12363,15428,10542,6899,988,16100,100,3358,4401,2081,12833,1959,11601,8834,15318,1399,16177,14556,991,17129,12536,5538,10374,15340,15769,2502,6696,4427,9539,16949,15130,10109,2956,13573,9021,12393,7026,4846,13884,3136,1983,856,14088,6175,7993,14136,3563,3608,3405,949,13164,11412,3453,4501,3683,11576,5489,13000,11336,2422,3814,10146,16787,1031,16293,5860,5975,3590,12150,14944,5685,3300,15352,9493,15268,5763,16599,7409,2435,12520,9056,5967,11830,3745,13135,6994,17106,6370,5059,9699,10875,5938,7510,5664,15567,15158,5164,7871,3349,11129,7255,3818,2613,2473,13815,13338,3564,16706,15886,2054,11858,2769,2406,10164,7035,11984,16670,1580,6413,12288,9647,5322,4222,887,1136,13554,13441,4646,8345,6234,10265,3437,11652,4013,7672,5664,13275,2082,11707,13891,15508,6542,8473,4767,597,9007,2478,5210,12320,7321,15307,16354,8041,9405,16931,14964,6614,7299,3973,4864,5809,3116,12351,11830,6425,4925,14365,5516,8490,11812,10426,9019,1038,1129,1990,11595,11033,1093,9094,6551,14129,13628,16371,5432,15325,14678,4946,14594,2470,12809,2122,7488,14472,13146,13621,7323,3288,9149,8171,3244,9679,7283,9606,11563,2497,13896,7386,14524,11904,14975,2681,11332,3772,3083,5336,6579,14058,14021,6980,16161,10807,12328,9578,6975,11205,2960,17065,16138,3260,9525,8980,16414,12171,7116,7414,10133,9938,14386,1660,9215,13926,2596,15954,8099,1702,3776,2923,10460,5045,9272,10693,3601,4838,15646,5183,4090,16091,2440,4696,3199,15216,1917,1369,12529,14349,14099,6220,5180,793,16095,1388,14479,3064,13880,13633,9573,6753,12021,1386,11860,13373,8014,7840,14922,8759,5751,5894,2801,12617,15015,13820,15586,14948,11271,15868,14917,1893,7969,5061,10992,4405,7755,6455,7706,13262,4876,980,5901,2038,6602,8965,9609,10514,377,4575,6919,4784,13122,27,7518,4430,15475,1207,15184,3485,1382,9504,5509,7998,16211,6536,15863,2819,3941,5004,14915,4371,11226,10008,16162,11279,9947,9325,11236,9268,1124,3953,9725,9554,5436,1317,11794,16796,687,11435,9443,4699,11232,4016,11519,11968,8054,3086,16011,8544,10456,1384,2024,1664,7262,3515,3843,16597,12205,4302,8597,6931,74,13270,12720,16001,6170,5532,6471,6694,4591,2395,16591,13844,11119,3440,10564,314,35,6259,9191,2066,9766,1249,7529,16487,14202,865,11041,3109,7705,1881,10722,10646,2910,311,10710,8816,16182,9133,15650,15151,7641,12775,15146,5081,11666,11260,4923,853,15645,2315,10145,493,5450,6377,13172,5469,2164,501,10313,14477,7508,11183,974,11707,5983,3606,13964,12626,4004,1939,15302,5750,695,11383,7626,11967,1788,9373,4779,6804,4269,10681,12409,6043,10214,16297,12914,4709,8902,9306,8871,4270,8586,11689,7662,4013,8112,10137,14752,5926,6994,3852,3014,2442,4960,11983,1644,5889,11985,14586,16712,1975,8427,14580,5058,13770,9390,5911,5141,10798,16120,7691,6044,16011,16806,11255,8611,8755,12966,4928,12139,10816,1224,5949,912,13027,6511,15894,5363,10815,10533,4861,5562,2214,16717,11750,11040,9110,14948,4819,11441,4121,15834,16686,15394,1245,4222,15826,14856,8894,7152,8108,4725,2694,7999,9295,14218,6255,868,13710,6740,11529,76,13366,11821,11514,4981,10226,11320,14575,11179,6017,7308,2088,6894,7834,460,15067,2190,15137,16541,16240,12820,13758,4819,3895,11420,15737,12934,2124,6381,10885,11482,9621,12733,15223,10577,14566,11934,16493,15426,9036,3808,1891,6159,9583,3640,898,11381,16678,8401,9897,10034,14419,6542,15508,6570,7427,2558,15576,1335,3801,2619,15122,4735,12456,15325,9384,8258,6499,9135,522,9144,27,4599,13956,6604,12931,16473,3048,3375,3666,14128,11492,7190,2262,10502,14701,16349,9380,9770,3898,55,3292,15484,7074,9013,15143,13927,14022,13657,12722,1930,198,4299,10819,13844,15915,4266,15309,15132,4757,7644,4079,1495,9304,15163,3580,16501,8121,11538,4383,15829,3947,1243,14606,6738,3216,8129,3297,9037,10476,15381,2298,746,15912,15798,8138,3130,2255,5964,16027,16399,7863,4937,5347,1053,16616,2417,13968,2531,16516,12546,4713,16609,15237,12928,12178,856,9661,2922,474,1744,14003,7398,14952,13139,1672,1889,8526,5202,3302,1070,9740,11670,11083,3498,8372,13317,1497,12421,5257,459,9577,11461,15925,1554,2531,8541,11599,5675,2273,11615,7372,12256,4798,14031,7670,1914,8217,13618,4955,15104,9715,4838,14603,14492,8832,8091,16129,11583,2155,4830,8495,11857,7204,8419,15975,7104,6498,14356,2604,8739,13457,6880,15539,10129,1328,2114,6652,1044,9888,15743,2044,6331,13600,14679,5032,5223,11467,16215,12421,687,14009,12161,9544,15441,13000,14831,16032,3566,6203,2074,4103,10226,151,15513,3117,8718,8552,5033,15476,3710,2329,5179,13919,9044,3463,5142,4347,523,9639,3683,8663,1217,4519,8989,2207,14829,1835,3621,11921,10400,9924,9446,759,3018,13258,7618,6711,12568,11850,16442,15075,7460,7433,6662,11260,11203,4135,1486,2313,3149,11684,7350,248,7090,5947,13474,5268,10922,14861,3161,576,10732,11071,2506,9788,11229,1216,14414,6522,12616,14939,13892,14629,3799,1107,7226,13931,3409,6001,13858,1038,15091,8652,11747,14014,14179,5674,6600,13121,15491,3003,10445,12173,4963,12271,328,2676,12267,1630,3365,12233,15236,8143,15084,13367,11035,10911,12413,1035,15861,11729,1519,6868,13294,1219,5622,10711,1090,12543,5695,1395,597,9602,10380,8539,4300,9749,10521,1157,10391,12000,4026,13324,3976,11843,10931,14791,12512,9494,12494,8652,1511,12578,2633,11548,2429,14821,3730,11897,7975,12339,13,5380,13693,4954,10602,15680,3906,3530,15863,6251,14705,12674,9264,11930,7090,12084,8928,10306,11726,4522,13037,16191,7995,4579,5527,10189,16270,2353,14428,5535,14603,9008,3934,8041,3527,4024,13138,8469,8956,5659,4921,6016,11713,12879,1162,194,6234,5268,8774,12084,7485,991,3215,1951,7522,278,12462,15534,15048,7236,4642,7421,14810,11740,5680,7925,15431,14828,8831,5985,11991,4900,5633,8149,5975,5695,1261,10949,4798,3917,7239,3088,12259,10402,12468,12227,15372,9637,12648,2827,4281,12505,954,16131,275,10860,9949,6827,4460,6659,12292,14954,2138,14365,5701,5436,11877,7642,13886,6261,9916,4105,8046,10063,5173,6594,7104,1253,741,188,11364,11798,9036,15147,12168,10443,15580,14859,7194,13667,12269,13496,1364,15108,7893,2965,1299,7141,14805,1423,9248,14791,4897,6816,11059,8076,5925,11092,14150,4100,11893,4000,12452,5055,5872,7022,8523,6242,2128,10429,11769,70,11050,1329,5467,7835,5274,13458,904,10862,10034,6389,3494,3787,5639,6424,7997,2107,10031,14546,10528,4782,9508,10796,11290,2015,12901,7965,7923,11977,8469,10072,7263,10871,14958,1220,10673,2848,1249,8047,13493,11167,10983,9448,9005,10712,4023,9814,1102,5118,6520,5264,13904,4585,13904,1410,11999,11393,9183,440,11240,10589,6038,10617,15665,10591,14669,495,16086,4029,15520,3691,13802,751,3562,13507,733,1429,7439,15504,14650,11107,2178,8,1855,6356,2379,3297,13456,7740,2565,12921,2995,12120,5809,735,6036,6586,1550,2064,14559,6586,14109,4264,8543,8345,4811,14976,16095,4896,1994,13177,1671,14095,15625,3183,12155,7613,11082,6890,3385,7970,14219,4197,11886,7182,5389,4339,1947,4877,14263,500,15821,8891,2687,15813,7767,1836,6065,1341,867,14200,14716,11967,15335,8802,11268,12960,8944,12406,7464,3787,266,4881,8394,6122,8253,15214,4400,7870,15477,10420,5540,12417,13409,12054,5087,5441,13696,3357,1916,2718,13130,12066,6010,10490,2111,2053,3716,831,5422,6198,14289,6037,12060,3025,13008,107,3018,13388,59,5406,11529,6991,15331,9161,3944,13554,15453,9300,2408,15192,9441,6764,11268,10433,12905,9222,4008,8645,135,81,14277,15058,12032,6742,11139,5407,6356,4482,6171,12404,11972,9887,12713,8288,14926,11572,12582,6136,11491,10237,14840,3824,2168,704,3516,11967,7361,12803,2527,8615,4253,4643,4108,14479,13168,190,7761,15162,1683,6917,8203,7146,5871,7491,4779,251,850,12482,3646,8654,15160,8307,479,2464,721,15604,547,11680,8667,5435,12611,13815,4896,14739,7049,12636,4363,11458,11448,2696,5150,3969,224,11474,2708,10656,9374,4408,15821,8546,244,6409,9630,11615,7966,9697,5842,12367,13118,15220,1890,3714,4306,13475,11731,13300,3928,9221,13949,11208,3968,5520,1297,7260,10191,10509,13108,535,11130,9633,3550,8806,5648,1785,15901,6817,5090,7563,6069,15163,7445,1311,1216,9443,2237,2520,9812,8250,8678,9847,1495,12658,6577,2384,12024,7978,5958,14944,13402,4149,8020,4575,11780,3614,12436,10796,11607,13161,4828,15132,4886,10582,13157,5572,5382,3485,187,8085,1330,9380,11837,12135,15556,7623,12772,6581,6094,8280,5186,10706,1996,7948,8009,6776,10601,15739,3370,15143,8310,2282,4027,12678,10452,10194,14160,11119,6160,4401,6573,12582,2477,6910,15409,6742,14815,4764,6360,5622,6584,303,6714,4866,5348,4528,14774,13677,3495,15156,12436,8111,12769,13790,1766,13921,13069,6269,5700,6039,6661,6785,1719,7743,15055,6868,10056,2867,7308,4625,4453,7817,12522,9254,9823,2632,2988,13733,12308,769,2296,10710,15200,9596,3174,7042,7811,3558,13897,9853,1196,11422,12484,2478,1840,11536,1563,9649,2323,3532,7420,13863,7178,7559,14921,4399,11612,7425,4347,4197,15562,1134,4314,3433,11358,5822,1110,8603,12538,13363,15371,14298,11158,8980,10836,6902,1518,5859,13210,15321,11660,2698,8400,9794,3612,9460,8743,7752,13808,10444,15448,5564,5471,5207,11668,5165,4507,1690,11201,4901,8079,10886,10012,4116,11258,7294,5766,15332,3730,131,9208,11855,12109,1030,2455,6466,10795,3975,7134,12323,2733,14056,7240,3416,3898,953,11966,11300,2865,5992,15353,5420,7941,6839,6068,13458,13458,4289,7217,9323,2757,14121,9086,12876,4508,6027,10594,4988,13696,4644,14086,2094,13341,13536,7817,14566,12771,12579,1725,12557,3616,9811,5914,5354,14061,11520,15193,2871,13753,2877,11969,11307,3129,631,3821,10344,1381,1898,8131,9239,9528,10354,8342,9267,8874,15266,1514,14988,15013,8806,7135,3912,15353,692,9436,3341,7582,11286,1482,11382,3024,14433,3452,38,742,15170,7898,6945,14219,14420,3943,8635,6295,3779,403,387,15257,1064,15107,7428,6932,3073,11261,5727,7391,7992,5903,13471,14075,2748,342,344,14413,8453,5368,5947,3090,5425,4803,209,12157,1077,12240,5868,14772,14583,14791,9439,11531,12419,10112,11281,14795,1275,14616,4155,2476,5170,1071,5631,1029,10323,10930,226,13847,1591,6731,1210,3765,2196,15056,8610,10273,779,1298,1428,12509,10382,10868,4903,2953,13247,8006,12562,2666,146,5975,3387,10345,8174,5617,12793,7923,2840,3436,11862,11773,12278,2372,13789,3778,1160,7995,14356,6924,13999,3558,8180,11425,3925,551,1805,9763,9767,2015,2465,3492,7455,8158,3816,9462,457,10035,102,6126,10216,14209,6286,13453,9785,6517,15505,14620,9812,1575,10536,13037,11090,7254,10199,9977,13431,12114,15424,12196,2047,14811,9382,11801,5208,1699,8936,1475,12619,9223,10135,14423,7497,4569,9786,14057,13338,13474,15063,4047,6781,2194,7296,14619,4987,14593,12129,8185,3999,1777,7156,4668,14763,1484,3119,8211,14279,8787,10153,10914,9731,5059,6696,4134,5208,2309,4445,13281,10744,13811,10442,4365,6689,802,512,9652,14699,6021,11086,15191,12204,11492,8958,2432,2701,6362,6424,7333,4694,81,5116,14452,9596,14157,15388,12982,10626,9041,5178,13021,5064,9464,1965,12107,5875,747,1465,2975,8619,8991,4950,11556,10663,7053,13096,9975,4602,11153,9155,8346,6925,15350,3204,11390,5449,6048,11781,12860,12549,15197,1999,9305,1612,3026,8361,5735,11735,10821,1596,14692,3565,1974,12787,9135,9109,12569,2655,14483,2305,5893,14246,10174,1258,3056,408,13971,10396,11002,7183,8859,9422,14052,9110,3673,14758,1899,9155,14039,13065,14622,1684,8364,2419,9071,14443,7040,7414,4986,14763,11911,12297,8334,10974,9621,8485,14316,12216,7213,8434,8696,2126,1454,11061,27,6093,354,1623,2813,4309,2945,13723,2904,3946,9848,4043,2177,12325,12710,12060,8520,7676,626,5098,5924,9422,1773,8000,8244,5595,1663,9335,2271,11193,9834,3630,8712,4502,13665,3243,5067,9477,12517,12171,5407,2346,596,7191,1209,8529,5294,7818,10660,7393,4175,3449,5763,14361,11054,14478,8565,5174,14459,5611,5400,11448,10294,14302,1019,1809,6272,11680,8694,4992,5364,9053,9086,11551,6650,14090,536,13467,11035,11327,2639,15056,11156,6664,1511,7976,13242,452,9757,509,9553,8448,9033,14664,653,12768,5231,11879,7682,6141,2044,25,9083,12151,10816,1373,682,13682,8398,9207,11998,14918,907,11428,12445,7421,14765,1208,7301,4244,1853,1318,5968,8160,191,14081,8269,942,11987,543,12232,12303,10944,12894,8644,15085,272,12332,11119,10727,8568,9411,13430,11729,9136,3756,168,3272,8866,3513,13546,2081,5650,3538,6331,3475,9538,3951,4801,3295,241,4815,8795,11679,6520,2493,13244,14343,4076,7239,13679,4683,84,8182,8560,14512,10650,4503,9216,9214,13893,15069,7283,6138,4474,1392,6184,3087,2010,8599,3354,2155,6800,6000,7162,7537,5177,4981,1143,11410,11961,8524,6608,8877,9650,2897,3899,282,1760,4070,5858,7969,10168,6252,12457,14166,3219,11753,7531,10086,3274,7797,4514,14624,5352,9442,3322,12557,6163,4867,13492,7494,8705,12889,3280,2544,5517,2784,4654,3081,4442,53,14831,491,14521,9244,6910,5335,797,10481,1329,14299,6709,10211,5790,7211,8267,8825,7945,575,5079,2758,12695,1708,3916,656,1651,5666,6809,14043,3968,3415,3964,12030,11806,11693,14452,8983,9712,1942,5293,1133,3204,5198,4282,11932,12392,611,4815,2570,11336,3875,4212,9227,9692,10551,13878,3649,6801,2681,10804,11122,10926,11682,6557,6115,14568,2374,11717,6265,7457,2843,2165,7067,11239,7465,13279,1827,13863,9138,6446,11381,787,10806,6569,12032,1800,12356,5629,548,9269,11212,8083,13626,12351,2839,5882,10120,3558,3393,8784,9033,6919,12513,5614,7037,13599,14241,6958,1399,12536,2231,12332,14574,14226,9142,11096,7391,11402,9383,8293,9556,2347,5765,314,13247,8704,5154,13777,2414,10416,7324,10508,2905,1357,13734,13840,12623,5768,4024,4397,1285,1774,6579,9345,2597,296,4784,7671,6671,233,1016,2386,10069,12462,6652,12765,12814,13716,14322,14754,3943,6012,12080,13199,5560,4889,4328,159,11948,6827,4408,11039,1464,10297,12684,4900,2424,454,250,210,11782,4066,2280,8583,442,2983,8214,13306,7142,14621,3301,10580,13749,6657,430,768,3719,7848,2144,6421,13229,1470,14813,9162,3441,5312,10883,504,203,8574,1740,11701,2619,6684,4076,3753,7463,11976,5471,9842,11133,9234,12957,8994,440,8813,9196,8442,14558,12227,8602,451,10767,11343,6046,13588,4125,7912,764,1676,12487,4201,9291,9730,6268,12824,6148,5418,8527,6772,7415,13768,7801,523,263,13636,12900,2444,4916,13090,12968,4911,4989,13399,4312,13114,6560,12259,1517,4065,7081,5291,456,6860,8764,13108,5320,10838,2535,7029,14742,14396,9425,2794,14353,2794,10080,6240,3105,3366,3838,693,1011,5760,13525,8336,12431,3214,6489,2752,7491,14196,1323,13176,778,5680,8861,8457,9448,9179,10511,3077,6903,8320,6385,8885,1267,398,2082,8462,11791,1020,14337,5247,10877,2052,7685,3954,3248,9092,3314,4515,8649,2142,4455,5271,342,9701,8726,12022,10016,6429,7655,769,7051,6902,5006,12887,11583,14654,6826,5419,189,14640,11028,10583,3242,9059,4394,11594,8573,13065,14384,9710,2897,10406,9232,7559,13991,5875,10107,13782,14564,2149,1805,2188,181,13354,12719,7982,14463,9748,8405,10882,10849,157,10186,9009,13695,10121,9530,7150,11399,7195,14649,13072,473,6970,3901,13693,4447,13515,11024,5747,9795,13406,1859,6866,6684,5085,14345,867,14357,13999,7751,90,14385,8877,9998,12847,8519,277,13569,277,1115,2545,5257,705,3979,9065,8723,6247,742,7657,9988,11946,3834,1969,9487,10627,8157,9657,3881,8160,11479,12241,7157,13945,13870,6604,13187,8249,14598,6097,9745,3142,14150,157,244,1422,10881,13641,8432,2061,1006,2317,5784,9765,7970,4839,582,832,10980,1857,12189,12165,2460,10180,6548,402,12413,1842,3000,1602,7243,10665,11398,280,9779,1520,6239,5869,8883,7401,10479,6526,12529,520,7923,11182,6471,10183,13220,10640,8234,11578,452,4391,6280,6623,12834,10216,7451,5578,9874,1390,13389,12996,6638,7077,1853,3079,9523,10476,730,4747,6467,9330,14138,12632,8314,11601,7937,10083,6132,5435,3645,4306,11639,12615,8181,832,6120,12409,10037,5895,13320,10982,8673,12030,216,6148,7653,14207,10344,59,6328,9144,11292,9597,13453,11088,11386,5180,9544,946,8501,7390,9028,990,7439,6173,470,835,350,13000,11840,11007,13068,13739,12354,12246,8812,11218,1407,10889,9886,2037,2119,14224,14041,12005,7563,762,3301,6540,2090,504,12659,6802,2183,11863,12871,5918,9047,315,7735,10032,12103,8850,11009,3817,1014,565,8164,12511,2909,10244,6593,6890,3298,8611,3146,4613,9074,4633,14443,10367,8215,13089,9669,1886,6553,4317,7953,7629,11905,12348,8883,5711,1553,2595,4271,13271,3075,11744,4699,3621,5374,3436,11139,9440,13837,3620,10343,7508,5666,5689,14126,555,3957,6341,12771,12330,1953,1130,3914,8937,8881,7962,6104,10681,5120,14368,9085,1262,3169,2972,12639,5773,5539,5711,5876,9607,12936,9012,6115,10757,7490,5132,8408,4279,2210,14160,4194,9238,11219,7788,3510,1764,3410,6228,1199,9010,1646,6163,4999,7138,9369,9108,2132,5082,6766,4036,13484,13849,8110,6918,13833,13641,4324,11577,6769,7059,14042,2654,1528,12681,3394,8836,2643,11436,493,13178,9565,6256,13234,1951,38,918,5591,5973,3439,2707,3595,11394,10756,11729,11705,8471,3901,5245,12306,5548,2785,12852,13586,6018,4065,12259,2291,3390,5351,2053,12356,2744,1745,5752,555,9621,5174,6983,10577,995,12067,10533,4422,4137,5022,10092,9287,2080,13930,5723,3013,12192,6010,13523,3357,564,13042,223,12312,10916,8259,8077,2049,10185,4446,10385,6911,2642,12949,11154,5784,1682,11618,3369,11666,6457,2160,7868,3895,7633,12064,13192,10981,8719,12809,325,7163,9798,575,7487,1136,10657,12363,11846,13839,6490,10180,7790,3941,2707,9408,11287,8346,11417,1025,10453,2788,5537,13891,4796,13587,11944,9416,3508,4909,1510,5102,11953,4167,6044,11262,13842,5196,9695,3534,631,2971,3709,8601,4856,3517,4426,10081,8402,8161,5089,11552,3079,13375,12684,9139,12588,9879,13859,12966,12580,5794,5296,10677,440,4563,13082,13080,9906,7097,4939,1404,1561,8527,7925,542,4966,13752,5038,12538,3851,1771,5433,1490,3376,13260,6415,283,11475,9198,1974,7265,9251,10308,5520,9657,12062,3556,9154,12949,1660,7072,10682,8067,5454,8081,9511,5936,11244,7608,2417,7493,2342,11414,5306,5956,4368,8846,9285,5634,10180,4404,13036,5807,8294,823,3250,11429,10922,11660,13424,10648,6309,6653,393,2201,4486,10815,5806,10481,6387,12728,7049,1439,12016,11508,3309,3798,12107,13534,5397,450,11637,13505,2220,12679,11062,3730,9549,2000,3147,2584,12981,2553,2997,13074,12160,5740,8302,6563,8571,11434,1425,9140,2776,13639,10804,263,6037,13556,6362,3098,3787,12652,8135,1306,2576,11950,3851,12961,6699,3622,10075,6190,8621,5931,11677,5756,3648,1701,7510,8076,12319,11924,4985,11359,8603,984,1144,6541,714,3700,2685,11870,9180,733,13630,7982,7392,8318,5120,58,9091,4115,6090,2047,3360,469,1285,9661,5981,2791,7665,12294,8288,7315,4625,11194,8267,2710,13045,7817,7312,5197,11613,8806,5355,10958,645,6255,5097,8737,3283,7404,593,10392,13437,9471,11048,5252,8189,8470,12574,652,854,4104,4172,6073,7918,8211,2781,593,7531,36,5686,705,11202,1964,477,6573,13278,4200,12570,769,1352,1570,12452,9013,9741,9780,3540,8903,6773,11497,11943,9962,4464,13071,13389,421,13715,849,7863,8700,2780,5623,3794,5912,5957,5288,5811,4354,8276,10622,4465,1699,6220,1337,10663,12601,10194,4553,6333,8645,9387,12486,918,5570,2669,2022,1972,1944,9698,7829,12461,12736,5007,2908,9273,10633,7242,3410,10378,2966,11383,4681,9136,9185,6515,8112,10209,5833,7245,860,117,9179,9009,9730,5936,9756,7912,8029,10363,3954,4993,9452,9474,6591,8247,9318,6622,9310,2865,5726,3749,3072,9658,507,2202,5110,2275,7033,10628,8748,7150,2592,2078,10701,13067,1616,10095,13528,6989,351,10732,2461,10276,9048,11547,10766,1710,6486,5015,4305,1174,3655,10810,12117,10912,7199,1644,4957,3916,10249,13092,4946,2004,3038,3677,750,7675,12160,13240,7904,13390,12804,6410,12065,3557,7782,8224,10678,10069,10251,4326,13656,5784,320,3340,10465,9620,167,5694,3105,3491,777,7762,3093,11915,12828,12848,12846,11287,12921,6399,12604,9492,4276,6503,8562,11814,3072,2597,711,3411,8848,5639,7544,7770,5664,11839,4045,11216,4325,4750,8186,12269,5040,6538,3641,12139,11919,10002,1007,9055,2015,10509,2424,4113,13430,2857,7446,6232,12442,843,1666,2875,6036,13756,184,4141,7411,7542,11857,5279,10589,5167,6520,8441,7433,4440,12312,454,9321,4961,11089,4467,7549,5125,10175,5620,6293,12991,7902,3402,5413,3031,12449,6698,404,10098,11653,10143,11996,8208,2117,4280,8374,5023,11609,13621,8956,9852,8714,8264,1396,3421,2033,1733,9886,1099,1734,12628,3951,5635,3077,11269,8911,9946,10891,9059,12576,9090,1536,3563,3066,1616,8453,5853,1630,10649,6591,1129,4434,11067,9984,8857,9906,5017,10701,2680,11578,9187,9085,3551,6003,13614,7973,1944,4572,6986,4984,10660,7415,11346,3391,6297,1058,5088,12963,525,1435,11042,1654,10829,6927,2568,9143,3092,10305,10290,7343,11750,5312,5504,10984,10077,12209,2925,9810,7356,4576,4423,5021,7353,3213,7817,2096,12171,8769,1176,830,5278,8948,10409,1396,3199,2090,1684,9552,12940,8220,11663,2504,11584,7295,13050,3981,7267,1177,10746,6528,2217,13084,10791,12888,4825,11759,12105,11984,11441,1256,3047,4747,5786,4157,10381,126,13558,10351,8150,9520,10492,12526,5404,5533,12201,2876,6733,2671,10212,3961,8058,8626,9901,12626,974,10467,1933,11436,11134,4245,11142,3534,3060,641,7485,11412,8736,2413,12654,10794,10588,4213,5340,4177,8072,121,10027,4955,12890,11771,4795,9228,11946,7061,6541,12837,7438,3849,6105,6101,9363,4087,7492,1601,2376,6033,2815,2901,3211,13245,5305,10186,11216,9039,8122,11678,10988,3484,9399,6624,3121,6091,1983,67,7320,8343,2455,5010,8364,528,10046,3342,10224,9741,5998,2813,11540,12370,2820,359,2031,10732,13291,2498,4244,2670,2992,9899,1607,9731,12902,8064,5870,6156,2955,12641,12314,12719,9740,10135,8729,10610,12056,6479,1325,9849,2980,9566,479,13159,9169,12250,549,4866,10957,11671,4411,4981,4825,7789,11243,6772,5423,4711,5979,9784,4272,4627,6361,10098,4325,11327,2443,6699,9919,10138,8558,10700,8941,11965,5519,6723,6942,5036,7136,5299,527,13408,12856,2222,10107,7528,5871,11041,8405,6999,4106,11312,2276,11273,164,2231,9983,1106,9951,3356,6787,10944,8454,3454,10481,1437,11952,1139,11874,7539,11943,5605,5109,97,3791,9253,12828,5550,6707,4890,2781,4949,3010,10252,13082,4746,17,5928,2316,8861,884,4146,8167,4800,9760,4314,7474,12277,8189,10718,8115,11234,8631,2791,8200,160,6228,9243,9807,926,12197,5095,3347,8617,11376,4613,9985,11212,2712,4640,11195,12356,12833,3181,630,11081,2337,668,10731,2363,1989,1206,5104,7187,3175,3531,11601,8821,9428,8081,7337,3863,5637,7602,12042,7284,3591,9578,207,4674,4100,8676,621,4697,5530,10454,9507,8789,2312,3352,2146,5503,11215,2021,10787,6050,1336,6950,1962,4040,1910,8044,8352,1465,5783,10272,11180,6328,96,9036,6524,7966,1311,10739,2823,6576,11567,9080,7187,4372,8538,9543,3515,9770,5952,7086,11989,9137,11297,10067,12371,8974,1872,12289,9319,5051,8173,11640,932,8234,1930,1211,4733,8308,4767,10811,1355,3226,6373,11075,2842,5643,3837,5706,3837,5123,9804,1216,10783,2909,1960,8170,10761,808,2921,943,4496,12496,1597,3617,1405,2081,10860,7258,7217,8290,4589,5761,7561,3775,5244,9758,2150,4676,7609,12632,7133,4516,1595,6103,2467,596,146,704,7156,3592,9314,7995,13088,5888,11166,9140,91,6351,10606,7190,12332,6490,8062,8525,8244,5827,3157,2494,10711,5468,3516,6355,3323,12009,6275,8517,7500,11106,2720,12856,2988,11150,2778,254,8426,5965,5232,3564,8539,8742,1004,12613,8145,9793,9874,10480,8035,8680,7481,6061,2764,4802,8889,5932,5051,2260,3835,4663,12547,7907,347,8152,8398,3553,3148,10617,10041,12774,11463,11199,9471,8794,5916,12658,3258,441,6858,3157,8582,10836,8396,11571,6584,2345,3263,12549,11712,12330,8943,6994,3035,350,8171,4084,4509,10186,392,10808,6535,1458,6303,229,11947,10666,7163,8119,9005,4904,11787,11163,8350,6075,12734,4926,6461,7218,10636,7201,4965,8700,12015,12438,3134,5898,12779,3364,10406,8449,10143,4873,10826,7625,7828,2682,5622,7613,9442,10419,12848,11464,6871,6191,6560,4523,544,12034,10628,9758,9616,1079,5727,3162,7143,11137,8583,9422,11042,653,8462,12838,6420,8905,10447,11981,2011,10999,2230,11054,12725,10847,12716,11114,10096,1638,7121,2748,4405,11390,2336,10439,4492,13024,4740,10122,6266,8487,907,12185,9273,6764,11991,4145,8068,12857,3841,1334,10168,11918,2331,11185,9898,12917,12086,1442,6321,7565,9186,1770,7898,6013,2868,8281,6758,5063,11671,4994,2847,5819,7697,9949,9511,12273,12626,12493,7699,8739,11172,6639,1545,8232,12411,2516,8327,1091,9465,3945,5807,12376,8232,2911,5334,6450,820,10996,12502,11660,11579,6317,5855,17,10697,2482,8814,899,5834,2860,11373,390,11365,5185,4384,10750,6491,12229,10116,6758,3433,5365,11665,13,7969,9852,1275,6423,8048,5058,8366,4956,6224,7758,6236,2485,10437,7135,7951,1883,2330,12119,8847,11221,5320,1653,3212,7543,10166,9746,369,10072,12725,5964,12195,6230,6233,190,1188,6227,10834,6755,7385,600,356,4413,6113,494,3000,2887,6073,8989,10643,5270,12470,11641,6975,9209,12156,8296,2228,3719,9164,11658,11665,8778,12750,6076,10134,6415,2950,8230,12273,3905,11644,12633,10838,3131,7634,6729,4666,525,6149,8567,3203,9791,2326,5340,3320,2914,4752,7050,6724,5075,3240,12303,10267,922,7992,9304,9137,5711,11458,2701,12755,3447,7921,2116,786,1760,5532,7670,2119,326,10230,10492,7484,1320,8847,4682,7784,4364,5458,2816,3357,7799,6365,6575,7642,4355,10849,2452,4859,3953,5594,7725,11321,11172,11369,1265,4979,5381,6599,6897,3033,982,7811,11878,11996,4529,2330,544,59,767,5827,11987,7178,8756,92,3735,10166,9976,3012,11266,8777,641,2583,10362,6247,3164,4516,5016,11845,8051,4137,9607,11186,4563,7293,8963,4509,8406,9930,12754,6618,11667,7131,6121,5449,9821,12604,3540,296,9598,11438,10696,6247,1415,11271,8133,4919,4479,5739,5097,1616,834,12194,7793,8117,7666,11288,5951,3390,937,2845,9509,9519,3038,9031,7730,3924,10920,2275,1467,141,4840,9582,9387,9014,2287,3255,6406,5160,11955,690,6506,1754,10461,6148,1160,3660,5851,9932,2277,12021,10778,10439,9781,11675,5116,3822,10624,5670,1862,12673,8148,10220,8541,12420,4997,8345,8829,8223,10155,3754,12639,11536,3254,11360,7411,4486,1475,2476,8534,5132,10325,762,6979,8722,11203,2551,12350,316,2267,1561,4620,7884,2411,5109,1637,3356,7325,2873,3032,8610,12189,9173,12043,6019,7166,12203,238,11588,2887,2537,244,9225,656,6126,5032,8262,4817,5774,5574,5081,7681,412,1062,6308,4749,12268,8349,3771,8175,1097,6899,1646,7789,6247,10940,10830,10694,7311,2928,9845,8981,2595,1102,9375,11711,183,4012,6504,5286,3812,11495,9235,11729,430,7254,4032,3570,5662,1460,7071,1209,1243,2606,7726,9209,11558,1404,2935,7848,5094,11212,3129,1852,8848,6662,8946,2692,10436,6219,265,1526,6092,3355,5383,1194,288,1697,6040,12555,2461,2768,1221,2644,11822,3813,9549,10141,1969,12521,11772,10321,11172,9597,853,9052,2358,6047,2013,3843,8467,5935,8325,5048,6978,5339,10397,7108,12156,2229,2330,5298,4869,10042,4209,1033,11994,5161,8428,5676,4451,11210,9192,10230,11781,7555,9976,9167,5152,11235,9,9234,7530,3095,12292,4419,3631,5157,2452,11111,9848,10356,10829,5850,11440,5576,12140,2797,7398,9739,1866,7497,1516,11719,5138,11898,8329,12224,6942,7601,11164,6061,9708,4155,6333,1129,8790,1912,682,5904,6097,5823,7085,7860,462,9508,9304,2557,2232,11877,8818,6417,5793,2457,5453,4798,7487,12277,1779,7601,11711,9132,12204,1459,4603,11318,6519,8571,7204,10427,5950,530,4332,6849,4485,244,1312,8511,9687,6436,6720,6525,4021,9184,515,1293,11584,11872,9973,5196,5206,761,7015,11667,1183,394,9412,3081,8721,5622,11242,2254,5256,731,10491,11096,12284,9096,7158,1796,6016,7979,11381,6309,1167,10986,1299,99,11541,11194,11875,1158,2248,4147,11253,730,535,8413,11999,10020,237,2915,762,2756,4629,12201,1385,3256,11100,7999,7874,4222,7547,10996,3258,9472,9201,4587,8700,5621,9107,10593,10643,2781,7323,8386,7192,8262,289,4793,12259,11558,5522,10485,10391,11911,11565,6209,9445,6910,6796,2055,9318,9832,2807,6518,181,9513,9167,418,8351,11669,783,2592,8769,7519,513,5534,737,4777,8154,7780,1250,7541,5706,8225,5776,1716,9839,1736,8097,6827,11334,977,5906,7394,10258,7243,2492,7459,1860,207,2708,9191,5224,4964,7651,6171,499,8558,10296,1124,7362,5615,11080,8990,8956,1832,4314,2221,6185,11327,321,2653,11886,799,2662,7491,6500,9386,9888,6416,2101,3777,8217,5023,2145,923,2661,5314,5435,10428,26,9606,7488,4791,6073,672,10352,2767,5609,3684,5769,4388,3109,3767,3924,3688,3704,8526,10675,9079,532,11486,4310,8500,7958,2584,4925,1503,554,12118,8332,4889,3560,2688,677,7566,4132,1351,9931,5909,4340,11948,7605,7011,10019,113,10682,1804,4547,277,2022,9207,10144,12143,4975,7036,719,10878,4502,5144,8760,9185,1601,67,4168,8373,10633,8084,8892,7581,8291,732,10247,7307,3809,9234,9858,11385,9976,3848,3486,12124,4785,10051,6857,3318,1864,5414,7274,1856,2391,10159,3711,7092,9797,468,2596,3384,7775,7184,6990,4868,10784,10453,32,5661,7523,3415,11020,11178,10427,10943,674,4671,5655,8804,9173,11608,2857,7611,6171,3180,941,1292,2098,11870,12025,22,9139,5617,2158,7640,2845,9420,8132,10497,682,10991,6427,5269,1326,11482,7336,11746,9076,298,6786,10332,2388,11845,4642,2853,10186,3326,11468,4767,11058,8443,11332,4090,1696,4792,3200,7694,1265,89,4225,9790,7790,3358,10291,1228,684,11997,2099,8398,11453,9551,5463,1791,3793,3448,3806,7486,2249,4982,5041,4554,883,9978,11309,2608,4676,10827,9080,878,6492,9526,5537,8181,4033,1369,11204,10465,3241,6525,8845,6209,619,1565,11646,9402,8727,9278,7067,11407,5375,2164,10688,10740,5146,9657,1444,11963,4207,3513,6475,1734,9613,7870,10025,557,3635,4454,6841,3591,7468,11631,7455,4001,7118,2082,8586,7484,5195,7754,7333,367,7944,10083,7302,735,7284,5755,9883,11737,5285,5842,5009,9387,4347,1384,10106,6710,4164,10983,2540,4696,241,752,11054,10166,485,7137,2489,11932,9279,3286,4835,9030,6474,6121,5383,1502,11247,10009,9522,11559,10244,6926,3411,1321,10541,2270,20,7810,2105,6814,9267,2073,6048,1996,11354,5885,3075,7431,2850,7819,9940,9646,6394,4915,4931,5003,989,4680,11055,475,9296,9755,1024,10883,876,8010,64,11698,5007,6757,763,6138,2246,4435,2036,1907,8712,113,9439,273,3938,10858,2575,11089,11823,2095,11356,9949,11323,8301,27,8860,10907,3049,10028,11420,7214,6314,8568,8445,5251,2939,5579,6457,7407,7660,2787,606,9083,2240,10305,3885,11059,1021,6574,6636,9509,5113,4232,1149,580,3275,8607,6979,2423,7085,5282,5975,9206,11340,5698,3207,1424,7354,10910,6056,11468,11769,403,9468,4990,9845,9663,3592,4734,5415,9868,2057,8022,9385,8806,6860,4626,9084,8417,7763,6624,7107,8222,513,856,10489,854,11530,4742,2586,4748,6808,6866,8331,5960,6253,11617,9954,4281,7880,1017,220,2542,476,2507,1520,6140,10081,260,10324,2266,1933,9835,6492,1811,9255,6535,4018,3548,8642,2988,6465,7916,3775,5879,1975,5063,2258,10250,4539,7681,1341,10485,11080,4742,4786,11109,4353,3928,6648,4332,1088,9797,6703,10265,10275,7186,8598,5399,3308,7783,10182,7044,5043,1462,2530,6947,6817,10342,4231,4366,7256,2264,10177,1466,4390,4105,7789,9609,346,9371,8570,3734,2231,4480,6571,5858,1828,8637,9101,6202,2050,734,5770,9691,8639,5096,6080,724,8959,648,11571,7349,5164,2985,9126,6306,544,9064,180,7459,4867,5912,8072,5248,5240,9127,8181,4604,702,11304,1622,4291,552,4463,7996,3835,3516,9161,9864,596,7037,4208,450,10854,6459,11153,5462,8220,1852,3729,3853,9368,2130,4350,5972,5940,7737,9684,2,3024,10251,601,7852,477,7072,6427,1486,10389,5253,11326,10622,4717,11665,2040,245,4875,6,10789,9077,4702,2747,767,4450,10484,646,5489,8439,277,11405,10532,8778,9943,2791,6933,10763,8143,1822,2585,10470,1420,1856,1599,4352,10422,11276,1812,9029,78,4606,6253,294,4668,3048,4017,3286,7117,306,2257,6684,5848,9334,7574,3069,6727,110,7343,690,9718,8274,3602,775,3721,1796,5991,3968,3325,8506,2769,84,2644,2537,4026,3817,533,9355,2964,3505,8821,9204,6667,4499,10030,2040,5163,3127,7351,5253,1116,6496,5150,5134,5864,10575,5417,6969,10977,7440,8570,2095,361,91,4400,2556,3332,3285,3969,8895,7610,9049,1937,7203,2762,10342,7811,6821,2619,115,8761,10723,4376,11025,2178,8997,613,7259,7462,5305,8168,2456,7025,3468,2636,2665,8638,6967,8302,5403,3816,5733,8403,2626,4301,109,8173,6423,7217,1732,2695,7359,899,7192,2829,3920,7925,6666,10161,2997,7655,10347,10940,6664,29,10751,3930,1112,2677,8848,11196,5489,2434,8812,11106,2188,10668,1321,6700,6220,5519,8808,1195,4978,8109,1745,8545,5042,8266,10473,2921,4983,5059,3302,8592,8495,6008,963,279,5620,3104,4316,4851,3594,6854,1302,9531,4231,9445,8751,11071,3907,587,1405,2442,11310,9207,4306,2074,1546,5790,277,8384,5219,10455,4516,7676,10754,4498,4820,8485,2239,7822,7143,2053,7184,4949,4950,85,1220,5958,1515,6911,10574,4137,9200,936,1965,6928,5883,9226,1203,1213,5836,6458,2813,3278,3424,5162,5505,8347,4895,5291,10234,634,8076,5776,9009,9930,5577,2881,2917,10214,11299,10616,10742,11129,2668,2916,9924,5632,7254,8028,3974,2318,2687,5612,3149,57,10,2228,9827,4645,730,5423,900,10264,8808,3686,9907,948,9463,8262,1350,8571,9691,5948,8010,8538,3252,4246,7634,550,3911,11322,8192,3596,3479,5374,1737,10053,7455,3833,11248,6952,383,2858,10041,7058,7627,3305,6644,5098,3341,10545,985,1469,5589,71,6063,6307,11094,4535,6425,4280,4243,5592,2712,8296,3477,6461,5906,3045,682,4872,2379,461,1917,3605,6678,6837,10068,444,5963,9204,2814,4725,9392,1200,956,9946,8528,5424,9854,4296,5772,8601,3935,9638,2964,5516,1763,4478,6543,10116,8649,1799,10885,7662,718,1596,2331,634,404,217,4788,9736,9988,3375,7122,3028,6031,9020,7508,5141,10108,6102,4781,2983,883,7397,9184,10889,3568,6693,1454,4819,9163,3294,2497,3286,4699,10066,6932,9045,6462,2530,9346,3844,1300,6812,7462,2261,8300,8082,3577,11121,4501,7704,9943,8367,3997,3923,9494,5088,2101,9199,6574,1524,4696,10236,995,3777,5307,4035,3107,998,2590,1418,10887,4527,10832,6667,144,3814,5472,5512,1243,6797,10336,1345,6619,1430,10182,6050,7492,7091,9875,5479,3897,11108,9501,5821,6714,5686,9397,9002,7088,7901,7399,8982,4006,612,3482,9252,1522,9933,4448,2205,9460,10978,1147,8319,2680,8014,2807,9667,9324,1352,8248,2689,6668,4755,8687,726,6129,9246,938,3761,10518,5130,454,4613,4627,3684,3769,1619,7135,11081,11090,7131,1128,1375,9863,5847,667,8140,10006,8441,8799,1633,637,10994,3028,5536,7604,8985,5843,1969,8202,8061,7993,7921,7176,2777,4869,3661,2255,3063,3955,1352,1970,4867,1422,7360,4103,1143,4573,9235,10636,594,2508,10814,3861,9918,2275,532,5450,5565,3332,10675,5466,6823,6020,10239,2072,4443,528,8781,3853,4900,9115,3446,7172,10924,3259,7471,644,5860,2567,1791,5443,5263,9576,10765,9623,8832,10025,1943,5470,10587,10805,391,7200,5965,7395,7219,7904,8279,7386,7829,7759,996,10879,9226,7943,9072,4885,3277,2740,188,5569,10772,3708,318,7916,5738,511,1358,7378,7567,10307,3257,5776,10850,5735,8654,4487,134,6375,1213,4122,9162,10898,5449,7800,10261,3318,6785,5726,1471,9688,2198,8922,8248,9326,10473,4796,2110,8562,3719,2077,8351,9981,8899,9166,6380,10812,9116,6319,9009,3282,9708,631,2594,603,8632,5326,2497,4509,5064,5639,7632,8907,4947,6563,5540,5875,9349,8293,2,1702,4326,3590,2733,7567,1764,9556,2196,10731,3706,4072,7175,4987,6565,6946,4393,3809,7131,8966,8957,2807,10510,4557,8921,2240,9615,7709,10100,3882,7419,1294,1354,224,3626,2431,10859,2072,6277,2036,3314,8466,1203,3175,4495,9471,9254,4155,2990,5197,2089,1009,6915,2746,3969,2859,7327,5650,6502,5695,10210,6947,1145,6501,1492,5988,1280,6447,9060,7081,8575,2987,3447,4708,4111,2661,3886,6132,7844,10522,7299,9425,7127,2989,970,1685,981,234,5311,5346,7926,6143,3850,3503,10199,1598,4434,6682,10264,10685,1335,1783,1712,8088,9131,9050,3433,9131,10741,548,6817,6933,8830,2974,7556,9037,7485,7615,1677,1357,5882,9164,3110,8839,8960,7364,3883,137,7526,10809,4741,6524,10228,6618,2482,8079,7043,1399,8328,6921,7105,5335,8915,3470,2891,3724,5189,9626,9691,8838,10133,10359,8675,1253,7745,6015,7943,1955,7843,2126,8789,7969,6575,4562,10482,1758,2674,8327,4810,8257,3875,8258,2122,7574,9931,7452,2584,5971,5271,6310,2157,3863,8712,5911,4821,2319,731,9803,6343,6704,9534,10151,5812,10398,7987,2708,977,1746,567,67,9276,5921,4962,5202,6589,1533,7476,2146,1594,2889,8829,2146,9790,2383,490,5972,10544,2995,7640,10178,9197,8290,5614,7489,8153,2576,9009,9058,10303,9670,174,3051,4401,1693,9715,4104,5841,8408,4683,9576,4338,939,10257,7970,9137,1849,3030,9630,9786,9674,2787,4117,5728,2628,3963,8810,7418,2642,1485,7405,5613,10436,1045,5903,2784,259,2331,2400,5171,583,4474,9486,3900,9372,9195,5535,10416,6923,835,6445,8166,5175,5402,1467,8532,6616,3681,10624,9366,6141,9248,5434,6292,4544,4384,2224,170,4412,7978,2194,10162,10380,4292,10167,9831,7458,3294,8439,8459,430,632,943,264,8217,8497,7426,10312,5293,5067,9638,9440,5421,2650,3553,968,2947,3532,8215,2281,7279,7561,7672,10620,8597,137,2824,9123,3512,5475,10045,2424,10393,2177,2071,5639,4477,9230,9607,6276,10000,9615,2010,8877,2728,7311,4438,6278,1422,10049,6438,4134,6841,7758,9777,1084,1332,7785,5655,4831,2372,8879,10380,4405,632,4951,403,4868,3240,7687,1994,8795,2362,7969,7418,9853,6030,9940,6604,2458,8428,6954,435,9030,4621,6676,4772,6616,2313,8854,237,9655,3741,2996,5245,9500,2117,10228,1802,10066,7239,5944,3471,5426,7272,621,743,114,10464,4891,8068,9300,8347,4235,3658,6377,3443,7650,1708,1578,4525,5619,6027,2910,6854,5262,395,2073,10076,409,1415,9237,7254,5472,6316,10052,1995,9870,2215,8598,4400,6840,173,1473,8107,7761,3444,10290,31,6898,4953,10473,8281,9703,2810,10206,7304,1274,963,3179,4168,3799,9327,3802,8332,8179,7000,5563,8866,4181,2825,5372,560,743,2105,7137,8497,9747,9703,7628,9152,2026,5107,4638,9242,8013,8390,9869,10374,3245,8433,6706,6531,2348,4090,8425,2690,3783,8580,8963,3441,2255,8359,4983,1518,3189,10432,8491,461,7857,4804,7549,8441,4386,4447,7093,4012,7605,3997,9344,8727,7101,883,5296,2668,6471,2712,2252,6785,7373,6893,4517,3507,3543,8211,10349,1356,6583,7708,8867,2020,36,9725,7681,3771,419,1066,3302,3029,5004,7954,2786,383,6720,3065,376,4203,4341,323,7916,2238,1307,1640,5242,5234,3444,5792,8211,8929,8536,3278,5989,6045,2070,5335,9294,3304,233,530,8836,2174,8744,6603,1679,4395,10132,4754,7090,5475,7816,1560,5835,3883,17,8792,4665,6145,2435,6700,250,8792,8533,8465,3201,6145,8988,5091,9619,4301,4095,6169,232,10125,2973,314,4438,9135,718,8051,1408,7682,6270,9116,6268,9217,59,1234,4583,9301,6600,6764,5957,7924,9441,2320,545,6893,1149,10290,8604,6228,7248,59,9071,2252,8389,4606,466,493,1138,1685,9989,671,7422,9118,5978,6176,6258,1573,1767,5897,8284,1366,9152,10222,5803,645,3659,1674,3656,6720,3887,1283,9230,5885,10177,1897,1270,2700,8835,2770,6672,9051,8507,8211,1635,4610,9883,6946,1836,10136,5465,7762,6215,802,4148,4075,9015,2345,133,4500,7413,3569,8978,1001,6800,8728,8477,6342,9129,2850,416,7006,6288,2777,6751,5305,4642,8135,589,790,9908,5117,3023,2668,1003,9928,417,3708,7420,1682,7909,576,3903,6560,3243,4697,1715,3295,2805,7149,3806,6135,5402,8342,3931,9373,905,5376,3932,2020,6588,513,2141,1118,9834,2828,6222,3694,7657,6320,3873,7683,1686,7974,4345,491,5475,9540,2016,2758,2540,8054,6034,4677,2992,1426,9263,1695,9200,5531,2855,3778,9744,1863,3338,3170,2444,8029,10147,9255,7586,9545,7200,8990,10068,9799,1746,4609,6637,1558,7217,7410,3377,5082,6492,5771,494,473,5503,5143,4804,4834,7853,2530,7077,8652,1252,186,65,714,663,968,872,3321,4505,1967,1561,8755,5261,8978,4384,6668,3933,5257,8727,9248,7756,2188,5424,1478,7730,10055,10107,9802,7896,8179,9304,8790,9884,4584,8939,0,7338,6653,2317,9165,1078,5657,8676,5769,3655,2142,4047,5016,6011,8423,3072,731,7733,3488,6197,6423,8809,8459,2388,5309,9401,7983,1570,9732,8213,8256,2723,1605,2605,7655,3321,3323,8483,2655,3542,2030,2264,985,7312,5727,2905,1264,1260,6953,4411,4696,4835,4425,2265,6637,3238,6245,218,5919,3718,8247,7977,3240,5901,8528,3998,2515,8398,307,3474,6118,6829,7802,684,1830,3983,9727,7667,810,4207,1227,3719,7667,9769,5089,9567,2625,4746,3595,1738,186,9948,5189,3196,6748,7588,1621,5137,3208,6663,4855,8756,4632,3320,4729,6818,5666,5332,736,1869,2665,2579,1314,3643,1207,5300,1041,2193,6975,3775,2121,7077,8605,2471,7055,1972,3131,1413,8443,2328,2194,8355,4261,3115,8471,2695,1784,1469,8432,2418,4746,6623,1625,5967,3677,596,8577,6991,4680,3777,6762,7972,6883,5890,5170,9364,4218,4358,6585,1897,9890,2258,9516,264,1077,7226,688,940,9400,9123,890,5256,1572,1647,1804,2757,4789,9822,336,730,5691,1573,5459,9690,6289,9361,2061,85,1743,1060,9252,8370,2420,1492,1700,2292,7265,1505,4948,7709,9131,3507,7899,5132,1418,8784,7648,1054,2551,6901,7876,8346,6023,6715,9794,220,1884,4564,1879,8674,3797,4567,7440,5794,8539,6667,9224,3483,2215,9837,5000,2641,4366,8756,1660,9492,1177,8315,9603,9064,1572,784,7310,6064,582,3278,5151,381,6875,2969,4938,767,4759,9196,2658,6663,6696,8474,2518,5943,492,5132,6436,5174,1173,7423,1192,6807,1127,4627,6157,3663,6549,6094,1729,5542,5244,5172,2101,9760,7172,1772,7807,2901,125,7041,5544,5483,4093,765,5184,2339,4547,4608,4805,4608,5396,1204,3879,2802,9453,6281,3218,9593,1047,35,5982,5361,3989,4456,1426,426,2077,7221,2705,7101,3173,8837,5550,6296,2921,2734,8158,4478,8806,9326,8396,2905,5527,4847,4477,4179,2337,1557,2381,9222,2031,2556,2465,6768,1943,4396,9593,7104,2400,3904,5631,8922,3487,201,1796,1431,5748,5124,6012,5419,3306,9694,4308,1304,5473,7360,2952,1356,6893,6673,5944,9463,6981,2962,7213,5648,562,3260,8313,4078,2246,530,6141,1528,1598,3807,7651,3625,871,1174,9273,2097,5600,8434,6791,2395,6250,3477,3387,5664,2712,2861,1787,9362,8585,4006,8138,2975,5379,4316,2797,5771,8011,2780,5884,2171,9094,264,1261,8687,8529,8882,5921,7647,6954,1321,2957,176,5788,1811,2584,5204,108,4679,4341,1834,2710,7794,506,7635,4093,7165,782,7549,479,2486,9241,8680,472,481,4893,8419,5398,4765,8650,3004,4740,6263,9031,1777,5862,8295,881,2713,9208,1429,2194,1313,5487,4602,4715,2722,4302,2645,5514,3614,5299,5701,7498,3575,473,189,1334,994,3043,439,1108,1593,6508,9562,7769,3348,9544,1098,8979,666,6803,8708,8377,9105,4264,7992,9017,3250,7798,8504,631,302,1654,950,7928,1556,8455,5912,5464,7821,4688,3212,9105,7907,3558,3272,8797,3582,4627,2744,2721,7955,4728,3797,256,2281,8680,2915,7074,6057,8506,3919,8358,9092,5260,7783,2582,4478,7674,653,7882,1080,4264,5469,3308,5020,1833,7910,5239,8559,2603,5274,2800,3241,2197,1712,1131,7518,4308,439,8478,8732,4944,5417,7139,4290,3128,5528,4526,8883,4826,7042,8152,6654,6361,2449,8136,1298,2502,8672,404,1667,8511,6246,7106,382,4016,1345,243,2089,2210,3871,167,468,5564,1585,1021,7133,8046,6117,3309,9370,1734,138,4169,6217,4032,4362,6355,3495,7179,1932,2469,5683,8606,7044,6265,8991,3769,3026,3620,7631,1671,8159,6687,4202,5610,3078,5009,5756,424,5306,5714,1532,9178,4462,8756,1768,416,7820,430,6573,5913,749,1101,69,5963,4111,5771,3547,9279,5631,3927,2961,420,749,7608,1990,603,2583,2853,1964,8183,2168,5414,237,5019,5989,5587,5352,7912,3191,757,2886,9245,2715,8378,1840,232,1545,2333,1395,6389,7738,6281,5118,6317,5631,2555,1470,7693,6217,7235,9135,6770,1837,6931,3180,3890,9073,812,6348,3517,4801,5273,767,6837,5181,4932,9064,6778,4953,9337,7439,9255,4616,1985,3697,4755,5054,5986,8187,3461,6008,1829,5496,1217,1301,7488,781,611,6121,5631,7699,8160,739,2557,8869,3654,9043,1855,2476,6188,8333,7409,4516,4162,4361,6823,6829,1401,6646,6602,7065,1867,7594,6218,812,8079,6485,5406,107,5030,3884,8069,8714,3663,7391,7138,1311,6944,718,55,1981,6890,7242,7800,354,8018,3113,954,5670,5844,3547,3718,3528,6018,5814,6206,8210,2642,3452,4821,5489,8366,3824,6058,7083,5452,4784,2900,7127,1830,9176,3269,8162,2938,4223,4408,2049,864,8128,2286,2328,5848,6912,7964,8261,4652,4820,8161,7143,7174,2978,2093,7833,3673,1036,6461,1062,4046,8543,4710,2499,2077,713,2223,5918,9120,3659,7271,3061,9254,1997,91,588,6413,6405,7748,8584,1685,8816,6462,3230,5714,8210,697,5460,5764,6937,7334,2400,8945,4050,1441,8621,3525,3248,4057,5136,1796,3533,348,809,2884,6540,7828,3756,1415,5517,4308,6887,961,1342,3249,7722,5180,74,5502,6519,7749,6533,5835,8431,3676,6528,5232,2046,8713,4698,6788,2399,8329,3473,1522,6174,1251,391,8394,1009,1172,3077,2375,6817,7656,6309,1926,3763,1136,2225,29,1327,7832,5837,2795,8472,3930,1864,5427,1735,2175,8295,7385,936,2334,632,7907,8371,7397,6524,2011,7635,1,5139,2235,2314,7428,251,6532,3258,7765,2099,4809,5929,1461,6592,68,3232,8588,4137,5668,2449,851,5372,517,2836,8067,7433,7872,6123,2829,3,1421,1210,8036,8839,866,1033,7736,8362,1499,2871,2825,7690,5205,4997,5209,1985,8064,7753,4357,4788,2722,5046,2247,6674,7887,5385,5960,9061,2925,8651,677,862,3510,7082,1426,5680,1744,129,680,1119,3386,1011,5408,1583,6225,5078,6331,2428,8594,6515,2786,2569,7871,6826,1652,4963,1364,692,385,8395,2693,5304,5877,3765,6532,1350,8497,3370,7888,4657,2498,2132,3334,4570,3147,5819,5500,1982,1228,4364,6197,101,7596,7160,6697,2298,8234,6459,1767,2221,4099,6558,8285,7805,7238,106,565,35,1072,3830,1465,945,3761,4545,7806,1472,846,2707,1919,5890,3081,8893,3867,3494,4137,1439,3214,7792,7873,2112,6824,1276,3367,3822,6255,5923,215,1114,7530,6899,86,6416,8036,8642,4016,1762,1564,6012,4437,8796,6964,6173,2844,7926,2262,5979,4457,3480,7347,7792,548,529,4892,8123,3937,8492,6632,353,4437,3074,6723,6940,940,77,6104,6231,4434,7225,6321,7369,8449,4003,8204,2301,1175,1934,2272,6090,5698,7466,1892,4169,2713,2271,8919,3967,8817,7877,3296,4899,2206,3569,6054,5715,8881,5618,1040,4835,4714,58,3087,3549,8594,8433,6159,5813,4379,3903,1923,6350,6121,1624,2326,6384,4611,3266,1438,1130,1374,5263,4906,6274,3695,190,1801,1112,951,4523,131,6028,526,8021,7017,2690,8316,6648,2367,6186,7469,5520,3491,3833,1146,5107,1655,1905,7121,1398,412,2766,7522,8073,4099,8837,4342,4002,680,7937,984,3932,1161,4621,498,7729,2405,37,6800,7084,5994,2107,6072,4058,2388,2579,7374,8302,6278,7911,1459,3146,8681,1548,6252,2056,7312,4259,4306,2978,5698,167,266,4366,5115,2104,8654,1523,2629,3844,8457,7569,1334,3414,2007,4863,7430,4871,1114,5119,1804,7672,346,3544,7084,4520,4094,5316,668,5262,2746,548,7428,5305,1490,1017,4123,8245,3405,6468,2021,827,6639,550,4412,1787,7022,2434,7340,2550,8154,6762,603,8049,421,5292,1039,1340,5194,5497,6017,3882,3759,374,4259,704,7020,7987,220,1024,4191,426,147,6984,1242,3389,5042,2314,4952,8524,6723,328,1977,2361,5313,5537,2056,2495,163,6890,505,6182,2109,2956,2601,5973,1074,4435,8514,5022,6142,659,2165,1829,2495,7231,7462,3863,6912,6276,7207,7784,8555,4823,1353,3237,748,4350,3443,8592,4220,5567,3222,7144,3665,5031,4266,4354,5465,2146,8205,4146,4906,8481,6160,5208,2296,819,2716,7591,6039,6415,4376,5253,4259,7654,1980,4213,819,1826,4873,1986,2201,4452,4436,4681,5886,714,6868,3465,8662,591,6179,1716,7099,4440,6485,3868,6587,343,2339,2582,8023,7317,4895,8223,6885,3602,8047,8291,8023,6127,2421,4502,2219,5336,7527,8151,1784,5684,1065,5978,5739,5414,3387,6673,1550,8103,6646,1401,2223,3495,1114,1398,5366,5214,285,3479,3405,6006,7066,7767,2487,7473,5552,2526,3232,3125,1222,7405,525,1707,1682,5745,2358,4191,5669,4979,7052,3356,2497,7840,4571,1166,1438,436,5571,993,7142,7315,6103,4773,6390,7707,2950,294,6762,2001,2069,7231,4924,5668,7120,3920,8034,6409,2817,460,283,7112,6704,1767,4195,953,510,2135,7246,5161,4936,3258,4431,3280,6790,8513,8161,197,4347,257,4059,2700,7000,2633,7981,4369,8424,3552,2222,1678,8362,1399,5855,2214,5196,724,6005,7456,8245,2044,2543,5720,6696,4454,5492,7818,1241,150,7312,7454,7565,1868,2849,4249,8224,4434,4466,4838,268,4750,1772,1517,5444,1582,4789,4326,4858,4001,696,5612,8478,6844,7625,6950,7263,6231,6213,3457,7557,42,8434,2744,1964,3432,8331,4602,332,944,498,1470,4500,7048,1,203,7329,3212,5948,7686,462,6302,7244,2282,4696,5735,2768,7208,7678,6778,3055,2783,6361,7031,3519,3110,7107,8107,760,8377,3805,6930,7939,4605,4659,1299,5069,8348,1646,4045,2635,6136,3684,1858,4213,2648,851,1082,5312,2335,1787,2784,8209,7737,180,1458,6158,6983,8322,265,2681,6696,6047,3877,5575,2084,5852,3273,4883,2513,3856,4188,5835,4925,727,5896,1928,926,2726,1063,7808,2690,6829,372,7991,1417,5069,8008,8269,1868,1912,6938,1962,7869,7042,2203,4409,3374,5465,879,5864,6641,1451,395,7881,5347,2776,5798,2327,7338,8089,3765,1794,6433,2229,5436,1946,5880,709,6163,4372,6078,6789,6743,7380,1528,416,3261,7607,6230,8003,6241,7007,4228,8346,6526,1497,4145,7020,1252,2544,4299,2623,997,1367,6671,6382,4427,5765,1548,4283,3172,3587,3055,5825,4810,1178,3485,6864,4854,6275,4945,751,4459,6855,3055,8156,1411,8022,2970,673,311,5878,6688,2671,4776,2539,5137,6925,5240,3759,8220,254,1951,861,2341,1730,3411,1623,3969,7157,2041,3326,5094,950,6486,7431,7706,1111,7239,4330,2906,4600,1148,4668,7443,4987,634,8118,8282,3611,4537,8170,4000,1546,5751,8162,6908,5592,7409,4533,1358,3927,3098,5425,4742,2349,1133,1705,3413,4596,4352,4500,2967,1559,7559,5169,4069,7100,881,4922,6070,2889,2046,6074,6007,3372,112,2656,1387,70,3124,7479,4310,6724,2109,802,2207,4938,1786,8011,5616,4082,1140,4953,2133,925,510,2698,5885,5879,5222,151,6779,4556,3414,3656,3097,4137,981,8074,6338,4755,4979,889,375,3615,4518,3878,6147,916,2076,4063,7022,5367,267,5013,3475,1188,2823,305,3697,2912,3587,2396,7786,4360,2679,1382,1145,1501,1635,4722,2626,171,7626,1867,4691,6465,3725,1454,3954,5478,5822,1383,6769,5986,6976,5204,814,5751,6428,2678,6322,4684,6919,3682,119,3448,5953,5341,386,2469,7689,6972,4834,7709,5267,2634,509,5997,4959,561,863,2165,5518,794,5029,5344,8002,5995,1413,3594,2828,885,4128,5105,6418,343,164,1608,2914,1954,4218,837,4144,3165,6966,406,7493,1552,4444,189,4250,7440,5785,1,6704,5451,5241,3207,3909,2631,8027,3550,5425,5881,3039,7540,6130,5395,5374,6007,7575,5267,4929,1621,4010,3991,5463,7224,6079,7482,3686,280,7843,5888,3001,4388,1600,1250,2020,3830,7859,456,4834,5428,6559,7763,3199,3654,1708,5666,1743,7568,90,5510,5112,2589,5716,676,169,3895,7093,7686,6106,7818,4875,1789,2126,819,1560,5960,2746,6491,6618,6761,7494,6563,7138,6800,6672,4450,3945,5164,6491,3615,1769,337,6143,6756,227,7774,7941,6949,1885,1031,3194,2668,3351,2982,2618,4027,1055,3065,2398,5478,7163,4454,172,3691,75,4205,5120,3334,5360,5084,6534,1242,3265,2167,5772,2678,1177,4197,7440,68,3228,54,3716,2654,1185,7478,1052,4407,5423,3319,2600,2755,5884,6723,7004,6253,7932,2114,2275,5622,4067,5482,913,7080,5278,2973,7573,1923,7798,6520,1200,593,3988,7200,1195,6017,4952,6393,4557,5261,1778,4016,5311,6999,4338,6444,5354,4571,813,6537,691,836,7241,3057,7886,2408,502,3359,7425,5893,1213,983,6409,4450,6088,4887,1812,7725,6166,6021,1622,3128,1297,4063,2519,5160,613,1818,7415,7847,5686,3917,6643,2142,1449,7273,5125,1274,1742,1872,7516,7902,312,2964,3665,4730,1509,3192,3890,6456,3402,7716,5320,5698,3399,2759,7494,2030,5710,3400,3458,4686,1315,4019,4482,4084,6366,3735,5498,7324,1257,3674,7464,5414,6361,6546,2753,6320,4892,2704,1626,3785,7592,1730,1885,2026,3419,4402,5090,6992,6483,6689,4258,7566,4094,1910,7764,2539,3886,5409,1160,4730,4762,4553,6295,6342,1197,1694,6520,2714,2695,7792,5665,737,6589,1299,1303,6649,7709,3309,928,5319,818,4068,7150,211,5879,1922,7069,3521,2387,5748,2954,2293,2115,3217,6938,2685,5677,987,1744,6269,1941,4670,4421,5042,1042,2125,3937,5515,5522,5040,4486,6784,4260,7202,1883,2385,3779,2832,2755,5877,4825,4948,1850,5098,881,3229,1914,1030,6697,3471,4816,5563,6396,3630,2456,279,1392,1819,17,4194,3590,6016,6878,6666,4992,6209,6970,1379,5284,6874,6896,1440,1448,3947,2038,7501,1068,4997,6186,4798,6466,6767,1425,983,5311,4759,6283,2748,1808,5919,7623,3202,1936,3029,5950,4660,5266,3561,5016,6952,6704,3943,3563,3547,4766,1926,3484,2890,5088,7469,2534,6712,317,1359,4616,6556,7214,6337,2046,2275,673,266,7306,266,5750,6816,1124,6150,6740,4892,5112,2998,642,2070,1538,2044,6096,1654,3627,279,4891,7378,2642,4748,4839,7497,4569,4000,4580,2403,1585,4282,2041,1495,6812,2740,3216,4655,2148,1050,179,4948,5223,7184,1166,2697,6110,2814,7359,1744,6793,2064,5595,1852,4028,7119,1193,12,5329,4770,4154,5646,2044,5536,3141,4833,2044,5737,3706,3106,7549,2628,5399,5126,2056,2333,2273,470,4559,4105,4654,1908,6177,4402,4279,5485,2301,3097,5283,1075,1897,3912,4346,686,4595,2892,3811,4319,5048,1177,6401,1852,3087,5529,2236,479,4575,2247,5769,5683,5386,937,6122,216,1527,854,6186,7054,5822,4369,5925,368,6228,6139,2005,2008,792,2660,4865,3293,5359,573,6329,4646,2007,3688,7463,3430,2408,923,5347,4448,1894,3280,6878,4147,4733,3129,1277,2095,6886,2250,2313,6410,3282,1769,7314,1746,2651,4549,120,3552,959,7524,4950,2746,2729,4381,5980,2598,2239,5561,2467,2009,4198,1148,5126,5062,2227,2023,1304,5602,4573,6528,6837,7276,3133,3952,4181,3169,3206,4140,1821,4,3703,222,7348,7256,6326,7080,5719,2384,5949,4579,737,7294,5595,6491,4808,7370,2450,1959,3355,4066,6229,954,4874,367,4213,6650,2784,6851,1026,1530,5640,317,5214,2137,1732,1960,2243,5130,4297,1380,5384,2113,7357,652,5712,2478,4772,5165,414,390,5606,7207,18,4753,1566,5697,150,5340,4501,3059,4733,2347,4889,712,4840,1285,5318,1686,1352,627,2373,1000,7085,3742,1102,5613,5204,7433,5191,2221,2106,6135,181,4730,1074,3655,6744,75,3758,4591,2557,4965,7379,4475,729,2149,6578,6704,3148,3926,5166,6569,3876,4935,6288,6413,521,1304,3200,44,2170,2541,3227,418,6293,5385,5996,4560,6572,1700,3897,3789,1041,3455,6102,3434,2692,4956,3745,1929,1882,3146,515,6754,7326,3705,2121,5100,6326,942,2589,5017,3979,6703,4024,6929,203,576,1915,6679,2481,717,6154,1482,6772,302,2683,5447,426,6492,3755,4542,5226,697,5329,4674,5424,6910,7273,5222,6482,4334,6767,25,1203,69,6251,6168,1179,4583,850,4437,1709,4573,949,6416,2180,6608,7101,3871,1292,6714,2404,1059,1201,5829,6253,878,1001,5158,4940,7275,4814,4457,3967,1021,4158,2478,6474,4207,1035,4471,5751,3924,3084,1127,674,4552,3892,3485,2604,2325,3438,3716,7261,5956,3012,6795,187,2877,1763,4393,6177,5497,4197,6573,3602,6565,816,7008,1482,2120,4950,85,1783,1224,1673,2175,6924,4120,177,6702,2681,3809,6649,5262,1406,2323,2559,7000,1511,6871,5832,5373,2549,6927,6617,3774,272,6675,6559,6329,4867,6863,1154,4826,752,834,5770,6041,5774,2701,1941,2852,157,6079,5598,4923,1477,7167,6810,5483,987,2647,6971,5992,4025,662,3889,5577,7095,267,1741,4989,6718,5653,4031,4843,369,3170,434,6437,715,2408,6520,200,195,5998,2570,2854,261,5531,1425,1110,3321,4573,3377,1228,3619,100,5485,3743,6175,5820,1010,1579,2163,3680,2276,139,56,6153,4324,4593,6931,4046,3859,4335,5373,176,5688,4635,6614,2615,7032,511,4742,3536,1426,597,3121,3840,1490,6558,6702,5750,35,3382,1165,4364,1390,2718,7085,5066,3991,1112,6337,5623,5896,2410,4842,3450,5796,210,3184,5178,581,5289,6391,4263,953,5318,7016,3820,2064,6785,2576,6320,4025,5762,4726,6508,2713,2936,4119,6740,2364,2474,6524,484,2028,5770,5852,2556,2617,3300,3709,6319,2893,153,5472,4167,5212,3122,1355,6762,2258,4031,4542,740,2433,3320,2767,1246,3941,6148,5294,6361,4677,4879,1878,6547,6188,3947,3858,2840,6751,2447,5211,6611,6903,6054,3169,959,2746,7012,590,3264,6691,5823,938,5578,4561,6193,1663,5892,709,5544,5555,1439,2043,5985,5441,3159,3246,6431,436,5567,3047,3066,5539,6828,2775,4488,1331,5165,3342,3983,5661,390,5605,5979,1566,4012,1585,456,6894,2355,4005,634,3237,5047,6109,1476,6325,3417,2884,5392,3502,1175,3089,562,902,5200,1723,63,5639,5706,2860,2312,1697,144,248,2087,3820,4066,3561,2864,4964,4643,3667,4214,4984,310,3944,3469,6179,6746,682,3640,2228,637,6353,5720,5633,3827,2174,408,639,2226,6477,457,1798,3634,5596,5112,2315,1845,3111,1192,6684,4584,5977,3117,1827,2595,1608,309,42,2808,2345,1371,5391,4920,1546,5535,4174,4410,3424,5908,11,2821,3391,558,5191,532,676,4362,3782,1162,3886,3253,699,4685,2586,1078,5040,963,3888,21,6492,4564,5851,5038,4517,668,2514,270,3395,351,3338,823,452,287,490,396,6557,6192,1464,4399,89,495,6020,4252,6852,6473,3537,3465,4191,6340,3096,788,3270,4384,6262,4988,517,3753,2940,5691,66,1904,1118,1067,5139,186,1580,1377,5878,5259,5304,6582,88,6468,785,2968,5925,555,1873,3238,1710,6065,3729,2614,3548,6314,6596,5623,5262,3566,3073,3555,1600,5170,1646,4225,2089,3143,6014,2342,6208,5937,497,2787,1946,6219,5185,5167,3028,4328,4947,1487,3250,1154,1674,3506,6557,774,4996,2473,5023,2847,4997,770,1683,5453,4362,1912,5934,4239,5039,1081,5018,475,466,1626,5251,3421,2472,5075,1480,2446,5357,6099,2532,1294,2221,2912,1761,4232,3476,6536,5759,6240,6421,3513,6455,319,3434,1168,4628,4881,2383,5948,745,1053,502,5257,5155,2054,2523,3047,4635,3892,2564,63,2796,2422,4127,3747,3888,2254,5753,4460,2922,852,5731,1332,1198,6011,1460,503,4586,3022,2516,2304,4720,3530,3715,158,2723,2091,1987,1223,1869,1047,1382,3518,4765,3371,1182,2442,3512,2741,3535,1617,4987,5414,5663,6318,4099,6213,2276,6465,5081,6185,72,3445,3291,3227,4593,4313,914,6551,4592,1684,6078,3172,221,2895,885,3576,5604,2114,2978,6381,5666,6438,3337,4007,1972,2130,2427,3958,362,243,2109,3031,5971,5193,6046,6268,4129,1729,1208,982,3130,1729,4440,641,4835,6321,4125,2614,5373,2719,5123,3307,1151,5899,286,4704,2643,3271,920,4863,4231,2661,3823,4171,1880,462,2235,5854,560,593,3387,887,2939,859,3791,1712,5754,4953,2033,5959,989,2147,74,3391,3134,1788,3240,2749,1983,1822,3901,1115,1037,2901,4273,5129,4601,4507,3206,4098,247,365,540,3279,5022,5041,2570,5068,1003,4390,1108,378,863,3965,5562,2279,6234,5448,5624,3255,5835,2423,5322,4975,1044,859,4976,4576,2896,3517,6035,791,4956,1057,3417,2528,1761,2730,5322,2621,6384,383,3121,6474,2395,3658,416,5370,2670,3058,2221,2708,6493,94,4414,5102,6419,4183,6222,6157,5795,5206,4500,4207,5457,1586,840,4808,2030,5491,598,5111,5975,3822,786,3158,4279,6512,1693,4988,6161,1705,1139,3911,4740,678,648,1706,300,4453,3153,62,2169,2696,2241,878,4680,4824,82,6204,242,2552,5130,4583,3629,2085,5461,5228,3946,4030,5020,4656,1154,3350,2415,4498,4188,3664,679,5332,1229,1448,2464,1616,2377,2460,125,3250,4406,539,5770,3285,2238,2408,2079,5386,3252,4849,5337,266,3669,3845,472,3276,3859,1993,6360,2129,5289,2429,1171,1039,3025,1341,5538,2946,485,6422,5937,4818,2997,2546,465,4404,5300,506,3885,3058,6113,18,4125,2287,2011,2351,3762,4520,3242,2304,3257,6418,1309,3112,2406,3881,3990,4542,5038,5198,1778,3510,1338,5651,3811,5802,5939,3209,3471,6319,357,4595,2137,4985,2622,5932,147,2476,3753,6135,428,5009,1222,5693,1352,1218,291,5960,4686,3139,2632,3416,5268,4039,653,5601,3536,738,2976,5697,1743,3516,4031,4467,5490,626,3014,5789,4481,3355,2594,6034,5752,5994,1742,5580,4074,5197,3439,1090,1936,5723,6321,3397,2919,1365,5831,6056,314,824,1937,876,4351,1612,2208,4561,327,3771,1244,6050,2373,2136,4631,6030,5312,2921,1705,6,3276,1592,3011,5016,4707,2513,338,3799,1146,670,1272,2312,2001,1898,555,5408,5750,4441,2729,1990,709,2166,5570,2554,1133,5290,640,2898,4267,723,3234,923,3925,2101,1331,3078,2371,2285,3128,3989,1763,2193,1591,2490,1173,60,2498,2850,2446,3053,2297,2607,5688,4962,5780,5273,5507,2522,4711,4990,2058,5376,286,856,4176,2762,5500,5702,2540,2621,3426,4647,1148,1347,1131,1314,1164,5173,728,4469,6093,2391,5859,5298,2262,704,4626,1023,5471,3227,2808,5412,4057,4292,2754,5754,1117,3316,4041,1103,629,2502,4928,1228,2394,2698,5111,1015,2917,5220,3331,3455,4000,1729,3683,3276,6098,1042,1681,4364,2466,1520,4568,3238,5433,5131,3577,2606,5012,6039,970,1253,5661,4726,1068,1911,414,77,4885,303,297,646,6154,1766,5541,1371,1189,5377,4278,1861,382,4382,5435,2303,4482,426,457,3754,3211,5462,4729,1608,751,6104,4432,1584,2890,502,446,2345,2748,5309,4329,3454,4963,5009,260,5511,2673,456,1589,5022,5584,646,184,4840,1647,1126,5131,428,5672,940,3936,3915,3553,5010,4565,3131,3977,4021,4285,3594,1071,5801,1359,5004,30,3973,2219,5460,4430,1993,2950,3412,2121,6016,5122,5643,1075,2590,2710,4886,3577,2859,1111,2966,1150,2438,964,6026,2468,2517,2715,5729,765,3330,1079,2228,3468,3545,471,3567,2701,3264,5884,5381,572,5059,2046,4114,1080,323,81,299,2791,1276,3841,1236,2035,1081,2718,2102,47,3534,3324,3620,3251,5507,5818,3800,5294,4985,5747,923,3571,3821,3876,1952,706,1875,5921,2461,5542,1549,5425,5958,267,3810,1907,3287,2221,1832,1312,1783,1261,76,126,3060,5939,48,5642,2189,4381,3605,3299,166,5893,2994,3660,2937,2779,2566,5568,3724,4789,3247,5050,1569,982,5383,759,3059,1705,2935,753,1562,2281,816,2435,2975,1104,4234,3628,2429,5315,3678,5762,4485,5372,2124,2049,414,546,4076,4246,5012,1524,468,3693,4693,896,2857,376,2904,2556,1953,4565,60,2013,4975,3875,1938,5617,3406,957,5438,2293,3958,1484,3126,5718,875,2332,5667,1606,1191,3781,3796,3446,448,5217,4339,5188,524,3501,4907,4336,3905,3751,5020,4033,1057,5426,3198,2611,1720,5412,210,4724,2708,353,3781,510,2838,3781,5337,1865,1543,431,1289,4385,4975,4164,2830,3128,4134,1206,225,1230,1965,3481,1455,1413,5850,1434,4752,3262,1710,3833,4762,938,5422,1743,1723,2942,1517,133,2254,2361,375,316,4981,1542,1437,4830,2520,1984,1021,2617,5037,2904,1985,2898,5772,1077,2378,3340,3714,261,4930,4322,4703,4424,124,3385,5285,5048,1464,5314,309,218,2301,1547,3603,1465,2867,819,1164,2788,1576,3079,2570,1337,5089,4778,3388,4976,4304,4319,5824,4593,1221,4191,1992,2718,1604,274,5592,769,2790,3124,75,851,3877,1092,530,5198,3201,5124,2775,3,4161,2383,1536,5672,4773,1309,783,1406,1633,4177,3872,4857,5129,2867,2664,3781,2984,654,3793,3414,4176,5748,702,773,1285,2854,4104,865,3091,385,842,2314,5615,512,1794,1003,1636,3176,2545,3084,532,2066,1495,4170,4834,4895,1003,1641,3757,1878,2025,3413,3523,708,5716,4285,3095,4343,3046,1931,3454,388,126,1603,2995,2362,4025,149,3787,2896,1847,5735,3305,2503,3229,3314,5533,4166,4469,161,4387,1022,3505,3588,42,5414,3167,3371,4415,4738,1085,3267,1934,3674,4282,4804,3574,4649,5395,4190,555,3746,451,4313,4547,963,2560,189,4931,37,3510,87,2185,3809,933,2767,884,1227,3633,3843,812,4429,4364,1441,1864,4717,3263,5224,4875,707,700,5536,3170,5135,3578,2086,4363,3059,1984,1554,2663,1196,3298,1571,1411,1165,4447,3561,2366,2034,87,1143,4439,210,4310,5538,4616,6,1772,4783,2946,414,2584,5210,1025,711,3404,5083,2551,3288,1502,1051,3813,3460,204,238,4596,367,5326,1330,4989,740,4733,3761,2408,4898,1548,2144,3573,5490,319,3949,1812,5288,1526,2546,4758,4456,3795,4208,3495,5458,649,1529,3597,390,2420,5162,4894,2093,2886,109,3151,5462,1536,2760,3004,2945,1958,3130,3948,3244,1473,1792,4751,5084,5267,2969,2281,440,776,4263,2928,3109,1166,711,1757,109,3265,3983,2135,1498,155,1426,3924,2753,669,1743,4977,654,1594,4960,3436,882,4694,3741,751,2856,4853,4300,4957,1691,611,3081,403,2179,4879,90,2949,66,2445,4451,5222,185,1413,5180,226,3989,3600,4768,3977,1856,5118,2549,4162,4556,2640,3914,1370,3473,3082,2389,1933,4091,3398,3734,1370,2140,750,2150,3855,1162,3168,1932,4806,3527,3677,513,2563,5249,2604,1874,2884,1605,2274,383,1658,497,5190,478,887,1744,1025,2079,4786,1703,3272,1249,4068,4003,4368,562,3547,2232,263,197,3128,4529,3080,4786,1097,1397,4282,2296,30,554,1084,67,4782,4529,75,4546,80,5224,4775,3563,5196,4010,172,932,113,3696,1205,2265,2618,3388,3274,1272,3164,3200,4832,142,3151,5164,5296,1539,265,3774,4363,4674,816,2421,819,1632,2274,5384,1074,3691,4176,528,981,3411,790,4499,2782,2637,2111,1215,1871,444,1171,4537,3823,1670,1027,1296,1393,1064,155,962,1250,2874,1301,3062,3141,1786,5208,3973,1461,868,5279,4186,3747,1666,4056,3110,2385,3159,2976,995,340,687,5358,3822,633,3137,2696,5155,2200,569,2138,4319,3429,2764,2934,80,3582,5316,1963,2962,3841,1967,4806,22,3860,5122,4794,411,251,914,2241,706,2203,3870,813,3489,783,1565,2871,5001,227,86,1761,1624,3348,4396,408,2115,2575,22,2208,1334,165,494,641,4771,4517,3610,3679,2803,319,2271,4042,3064,2977,4107,195,907,216,4423,2086,2654,851,2056,3614,4678,2685,1219,1244,3872,2353,1152,3849,3687,1481,579,3139,2405,1961,4762,70,160,4468,4725,294,430,2040,3323,3586,4,4552,1299,2402,1934,1915,1,3655,4963,893,2540,4594,1397,1476,5054,5142,734,1819,1123,2029,1901,3689,3334,3562,4981,5191,1369,3588,4361,1222,2942,5024,320,4575,2155,2337,216,1247,437,3511,959,580,1176,4508,3991,22,1327,1731,2373,4899,4983,841,2357,4599,3854,1099,3858,2883,1704,2832,2354,1771,1332,2214,2761,5166,3053,5202,1604,2112,95,240,1056,4488,4809,2322,3963,2355,2447,1603,2069,143,2800,4679,974,2040,79,1094,4784,737,2585,3240,727,2774,1837,103,2944,3641,3689,4992,322,1987,1789,179,360,3072,3274,4578,2695,4302,3027,1184,2354,5008,3689,3602,4087,3095,549,4530,7,703,704,792,3197,3684,3822,1504,3434,3071,1184,1135,602,4392,2046,4748,1085,2401,3083,1056,4151,2270,4314,3768,3845,4697,4479,163,4656,1777,3279,1625,2859,3466,3498,4364,733,1348,4250,1443,1076,3826,4510,300,3848,72,2614,1710,3959,2449,2448,2809,1036,4924,5057,1145,3253,408,3367,1667,4135,1069,2108,4435,406,2011,2424,4250,3131,1406,3799,4075,601,775,3055,4119,2330,4946,2723,5010,1443,1357,3770,2498,4532,2543,5025,1474,3787,2154,3190,868,2213,3391,247,819,2874,3216,3736,4225,570,164,2641,2219,4024,3068,100,3438,3146,577,1918,1213,3577,3601,1396,4072,925,3212,3179,43,872,2600,2675,491,1559,3883,352,3664,4511,3501,2722,694,4883,817,1836,4346,331,4549,3580,4325,60,3241,764,1725,4643,4747,2137,1772,2557,972,2240,192,3523,2795,2717,2850,947,2951,3977,4663,49,527,3856,3427,4868,443,3322,4703,3251,2277,3132,4692,4221,3464,997,2032,3999,4156,569,1225,4882,4579,2516,16,4741,3643,1783,3780,2573,3056,2333,263,2164,138,4716,2705,908,901,2532,3741,2405,790,1463,1883,4931,131,4052,4021,1210,4110,2440,3718,2600,4019,4768,1532,3041,2735,274,3647,1515,4875,1562,970,614,2454,753,4454,363,3339,482,2615,901,4650,2447,1954,2651,1997,3452,1926,2902,1580,4357,3714,2384,4788,2202,75,4716,3337,1474,2036,530,4356,29,1428,2038,2086,1097,309,2617,3562,3372,1470,2993,4520,4489,3436,3697,145,2047,1197,1936,4006,39,4435,1026,2398,952,984,2405,1632,2250,2546,795,1530,476,3194,3063,3721,1199,2253,2582,518,2061,2708,474,3078,3068,364,2459,4281,4405,1164,594,94,4209,912,4492,2820,332,2230,1248,1934,3849,872,3777,4505,1041,2495,2439,261,2328,830,2621,2789,3045,3210,3163,3362,1469,1053,4346,3857,1352,1333,3879,2368,3756,815,71,1822,714,43,1726,1452,1025,515,3457,626,3590,3489,1406,4779,878,4676,1603,668,829,273,3239,3174,29,659,1300,645,4756,1839,2182,1885,241,1039,3403,2783,392,2973,2056,2753,2476,1906,4509,3104,376,1031,3203,785,2304,553,1551,1204,1283,239,3156,3063,1976,337,3138,4613,2315,3123,2938,2236,708,1522,2793,3819,2071,4620,3185,4307,4624,4343,1642,4276,176,2738,4638,676,1903,786,2637,3065,2024,1763,3385,322,3631,4213,2819,3989,3371,1893,3877,637,3597,4598,4376,387,3051,2813,744,4309,394,2866,730,3718,1717,2946,4245,651,3762,3050,0,1458,3963,3415,4425,1986,4280,4710,4085,1398,2594,3087,452,3270,4427,3281,2753,3777,545,644,2877,3347,987,3174,4038,4107,594,1648,4022,4643,3621,2668,58,2392,2684,2673,4037,1599,1343,4242,3563,1122,781,4089,1536,3328,2591,505,797,1758,3047,373,2001,2724,3369,3393,615,2524,1048,3892,346,260,402,2022,2214,3212,2063,1320,4261,1853,3139,1114,4469,1591,3381,2520,4597,4590,1264,3229,3856,3150,1038,4504,1927,2231,3363,3919,1749,3474,497,4380,438,579,167,2872,2060,148,1620,1262,3307,1631,2696,733,661,4216,2160,2565,1828,1563,1877,3948,2528,2502,1734,5,3806,335,3900,2419,3396,2695,3153,349,2396,1989,314,718,4020,1657,2548,1181,214,2557,3881,159,1119,3881,1706,4215,993,43,112,3490,2637,4301,4306,60,3831,789,1718,605,3280,992,137,2690,3338,341,3545,3922,1711,2752,4516,607,4137,3573,688,1471,588,1378,2169,3481,4506,4133,4512,4109,1638,1223,659,1207,1888,4486,4301,4482,332,4321,3206,4260,2012,2105,996,408,3348,1717,3276,262,140,412,1602,2979,4237,3127,2293,3834,1810,2925,2418,2968,1017,2004,1779,1061,2525,497,4126,545,3821,1920,3255,3810,2605,4285,678,277,4173,965,585,1258,1361,4401,3951,4456,3786,3961,2792,1229,194,2548,2631,476,1169,3838,3325,4080,4355,3215,1869,4262,2822,3180,2422,307,167,2788,1316,2397,968,1591,3901,262,1924,782,20,2572,3827,3392,3561,414,4254,2789,4419,1035,4252,2696,986,3049,2260,133,4349,401,539,366,2547,4147,1198,1140,384,631,3079,1441,1060,1117,3176,1843,4160,2714,4092,376,1156,741,2497,3831,1358,3441,3931,3451,3327,1592,2602,364,2257,27,1361,3531,2248,3429,138,2512,1988,3561,858,1841,1756,1849,4340,4239,4278,2001,3666,458,169,3341,3927,2404,4129,3864,539,2603,3001,2949,3921,805,3017,1572,399,3446,2904,3631,3457,2851,4286,2619,322,907,4312,3515,1033,355,1322,122,2618,3325,3803,4126,3016,3469,3521,1262,3768,3700,1020,1664,1858,2281,2782,783,935,363,2794,2692,3260,521,2448,2891,2747,1136,3515,2623,88,4012,3487,728,2291,2591,1508,186,1763,3193,1108,88,4300,2931,2847,86,2426,262,1719,1378,4282,1373,478,178,4034,2563,1684,1302,1417,1611,2212,612,3545,4159,2324,774,3197,285,1157,3374,302,3418,3138,2663,3042,737,2664,2997,1424,624,1747,920,3714,14,3892,2354,2155,1505,3876,2373,3940,208,378,531,2585,2513,4116,2085,3984,4212,2530,645,2048,283,3222,2721,183,3431,195,3452,3749,1000,2885,2519,2675,1538,2518,1158,3754,1368,1047,2861,1496,3555,1340,1955,2957,2074,2115,3301,1932,4097,853,2476,1885,3228,1681,86,2643,269,4072,2526,1315,3416,4111,425,3411,3492,839,1684,2889,581,311,3194,2502,1540,104,3428,2267,1428,2449,3585,3067,1774,2524,1119,2133,237,1912,3136,3702,184,451,3409,379,2757,4097,3716,1921,146,3627,2209,271,155,877,753,1013,2740,1750,2293,2283,3725,86,32,920,2158,3592,1226,2840,3860,86,2058,2403,2490,3471,2942,3633,1384,1735,4019,800,1540,3291,3318,1954,3815,932,3856,3286,522,2026,3434,473,2357,644,1599,3535,2112,2328,2241,3311,1488,3429,4024,440,1130,15,418,4059,2648,2023,2692,776,2076,282,1195,887,2881,3428,1807,1656,1773,1431,1506,1898,1358,643,2337,1685,2290,2847,199,736,549,1647,2582,3515,2088,549,2931,600,3749,2078,1173,3812,2603,3161,429,3630,1369,2959,3782,601,1677,856,806,3557,3743,1514,3288,2007,3515,559,1036,1876,3839,591,4023,2487,2697,3585,1049,1280,16,1980,458,3403,3311,1091,4004,2745,3196,1222,1551,3445,3436,1038,2988,1168,2339,21,3149,2114,554,2858,781,2744,2035,2107,2469,3645,3125,2294,3248,821,2668,663,3864,2684,174,2644,817,2953,2370,3534,2541,570,1473,745,1470,3541,2035,763,3457,1060,1633,3849,2901,2042,1781,2308,2749,2445,1342,1312,198,1090,370,469,1522,2256,642,356,532,2932,1472,990,3689,101,1992,2437,366,99,3773,2517,997,896,1380,1697,750,1376,1045,3678,1852,1249,66,1025,2276,2272,2067,1261,957,3704,2174,1852,3159,3820,137,3568,1843,627,192,3581,1479,1243,564,843,1348,2161,1022,637,2386,1400,1908,3380,2624,71,813,1257,3929,2481,905,3122,136,2505,3669,3149,420,2208,3611,3884,2805,2504,34,1483,91,1262,1577,1563,2689,3663,81,994,230,3539,3891,631,149,1223,2564,3466,895,1932,2483,2744,72,1518,3444,997,538,516,1596,923,2575,703,882,1838,3655,1141,395,3111,1250,2812,3497,1716,1684,653,3203,2849,482,216,2107,532,3042,2134,3701,2378,1312,3724,12,595,2399,3756,1612,1148,1471,379,3812,3322,159,2548,3704,1169,546,472,82,3272,2556,2018,2249,205,1908,905,345,2124,723,465,354,3762,1144,2341,1062,1783,3772,2397,2432,3100,2633,3049,691,2321,3703,1932,517,1222,1652,1648,3130,1749,1680,1089,1235,3189,1526,761,2107,1971,1361,1487,3027,3075,2878,74,2139,2916,2502,2928,1107,140,3213,2546,1086,630,2703,466,2096,1360,3192,3267,710,401,907,2983,992,3705,2449,370,2838,1,142,3269,3379,639,1254,3205,1090,479,3130,3368,729,3117,1624,1121,3337,2088,1117,2666,1945,2215,165,1239,1927,2216,1966,3573,2286,1893,1751,484,3654,2075,720,1792,3597,573,2495,781,2678,3464,1898,3350,2383,1131,3687,2459,36,982,1824,1386,2321,3460,103,1388,3161,872,54,3057,2325,2823,2929,1363,3440,1111,1997,3521,2973,3313,1025,324,715,36,743,3211,3166,1878,2823,246,2301,767,3643,376,2536,3530,1599,1324,2479,116,3387,653,3174,3465,654,1327,1748,278,1413,1245,1030,550,577,717,1783,1676,144,2746,2105,2490,414,2819,3256,1718,1435,3524,1097,1124,2958,2480,708,1594,1879,2161,3121,2874,699,2141,2823,3235,3228,2923,169,1802,3108,3602,117,3548,402,1588,2747,2438,3073,3530,2823,1338,768,1803,2321,670,2181,1364,1395,3480,2242,962,2197,533,3372,2354,3208,887,626,1194,416,3587,176,949,1356,1640,2916,1423,524,1691,3518,3436,1714,2972,2112,1153,1675,1775,1326,3120,1003,880,580,2074,1279,2533,65,132,364,2870,1444,176,1789,369,2810,1712,1747,1139,2749,179,2566,2186,408,2577,764,2291,1195,1028,2866,3313,1803,1748,3324,645,2380,1399,13,2784,2345,2083,3307,513,2797,1060,1689,2322,1076,2659,1009,697,713,2913,1067,181,1464,3474,2761,1226,319,1622,2707,623,1140,745,1608,2081,355,3090,3410,2906,1496,3462,2888,1571,2032,1036,628,910,620,27,1172,3392,1179,3188,1999,3056,2769,2453,2609,2524,1448,770,1137,128,17,2899,2008,1638,1383,293,1300,190,1860,1623,2438,1292,1264,1457,1271,677,625,1392,863,737,2278,3049,3248,2483,2987,2595,82,3441,2363,3167,5,1392,807,1101,2122,16,1614,1813,2831,2000,2769,305,1665,2113,1458,2595,2323,2355,1938,2334,3090,812,2765,459,2663,2243,715,1483,2196,3141,249,2127,2437,1667,1474,2073,2788,1739,3360,974,693,3168,1641,2460,2567,2464,1867,1729,1158,412,1473,1859,761,1099,836,242,207,16,141,251,719,456,2378,3205,34,585,3094,3175,2670,634,3078,2263,1886,737,1832,491,2330,599,744,1577,883,1365,306,2532,2194,2227,966,2528,1933,1309,794,1885,122,2330,1210,1718,562,3003,1117,786,760,1962,562,2157,1851,582,216,218,1337,2134,2731,2681,416,1802,2647,2024,1039,726,1630,2834,1115,2941,1638,252,2293,1449,490,2093,2788,3022,951,2385,1328,1211,2714,1661,2219,2195,3075,1416,2740,2474,2721,2709,1061,1481,333,2463,1438,2138,2419,2461,768,2169,2251,1869,872,1877,1314,1317,2200,1520,893,2137,1986,2654,407,3079,623,2362,963,696,2428,2292,2952,1936,3208,1204,1475,1004,2009,1007,239,1479,1509,2716,1093,2704,1948,1877,299,1559,2462,410,2895,2868,1598,1479,699,1788,2628,972,233,1206,1897,117,475,1724,3070,1862,582,421,2547,559,2631,1664,2244,648,1992,611,2242,1133,214,3162,860,2577,2184,3149,1744,1581,938,509,1337,421,237,2646,1224,2274,80,948,84,1603,3196,1490,1999,1352,1524,999,2712,48,1197,3035,2760,2500,1145,524,2810,506,2073,1482,194,652,1270,3114,1341,2290,637,2682,3130,1953,2167,1643,1766,2397,1448,495,1712,2984,1068,703,1779,1369,2870,2738,2367,1169,2289,2390,1630,156,224,1711,1204,2708,3003,671,2414,1298,652,451,2835,1,429,1534,449,2372,2622,1459,1382,1288,1008,233,1002,3008,1812,2545,1896,3080,713,1331,1198,1082,1744,1866,2621,2296,732,599,74,1832,175,2756,1470,117,272,1712,595,2417,366,2800,2202,669,539,1639,2887,4,399,44,2030,2910,705,698,2573,1258,779,1413,2023,1096,155,2507,2592,365,2439,2333,346,1048,2507,1458,674,102,1048,3043,1171,2543,2833,2680,1152,311,1045,1401,2165,1311,2612,802,778,1298,2548,662,275,2177,951,2743,2600,963,1761,2854,755,1654,2548,2294,1506,1757,2468,1278,2322,1270,2991,713,2851,211,2138,814,56,9,656,1083,2839,161,1900,1651,1159,1255,1644,1239,1796,2034,2294,1645,612,1504,1509,2947,629,1846,2498,2896,523,152,2208,897,2092,673,696,187,309,660,951,365,1362,409,1672,2247,2656,982,2754,1184,2375,459,2471,2001,2672,2181,2944,708,1654,479,1556,1075,2918,1193,1859,2404,920,2862,2817,1645,2043,1171,2243,1247,242,172,521,2534,1022,1042,1061,2596,667,2183,929,1098,1412,662,1498,2368,919,211,1509,1113,1267,1288,2015,624,1931,2569,1879,342,392,496,54,995,1250,2305,2657,77,1164,433,2925,1840,1192,65,2778,834,922,1662,2488,485,2787,2741,1970,1921,1845,2194,1970,668,279,2879,169,870,1226,266,2104,2083,1695,1505,2117,2633,1087,729,860,1849,415,707,1298,2598,140,1221,316,247,734,463,2123,1434,1015,2262,1793,1098,998,2729,1432,987,447,114,1345,982,1769,395,2097,2462,284,2832,2624,1837,1978,1765,34,1053,2614,883,552,131,874,2544,2635,2086,1184,627,1864,543,180,363,927,2857,2644,2534,1154,1728,128,1438,1750,1500,2243,2299,1001,1620,1392,2192,2788,1681,1185,10,378,906,2135,826,458,2500,1430,1558,1542,2466,1979,51,1961,814,2411,2650,1343,1200,1204,204,2409,2692,81,1164,395,2057,1865,1396,1289,1180,798,210,139,275,2153,230,1110,1246,1022,188,569,711,719,638,2479,2755,2178,1261,1215,2037,2679,2316,2700,1472,56,1153,74,1335,2196,877,559,2240,502,965,2093,25,2051,486,1154,1318,709,1592,523,291,2495,860,168,2122,452,2404,377,797,2747,2511,1769,15,884,804,651,1351,1971,2631,658,676,1084,998,2458,2117,410,567,110,1061,1436,1912,208,362,2172,21,1855,836,760,1484,2385,724,608,2702,69,2099,2652,167,1985,910,1646,442,1685,2364,1974,2146,244,1658,691,402,1285,2608,416,89,1598,1004,488,1442,1751,367,863,1495,2363,2184,295,585,1593,1729,212,1106,2324,1523,1846,1416,2261,705,2177,1245,499,1726,2226,1483,1590,2343,1817,1972,1769,711,758,1800,616,398,1518,2461,1712,1252,2467,781,1217,1465,12,132,1338,2117,669,562,1883,1686,960,1585,52,2127,1407,544,1463,1270,609,631,2631,1849,2246,2228,1147,1777,1756,1808,2012,1441,1527,678,2240,2483,1647,797,1481,467,1630,1491,2518,1749,1688,2028,1122,460,466,1521,2208,2251,2422,935,864,792,1009,1966,1720,552,701,902,290,1805,1698,1581,2405,450,1778,2412,2536,1208,1276,623,2068,1416,1961,1519,464,319,1681,36,1601,998,538,1848,444,2232,1788,172,2447,1297,1646,1739,1738,1750,1162,420,1648,1075,2158,2202,1687,2180,242,2055,298,2450,2375,738,1848,1836,1466,1920,1955,2312,2361,2231,42,1497,584,288,1812,253,2340,1424,681,358,2320,1269,1190,1575,784,317,1180,1131,315,1244,835,320,609,2494,2151,698,2445,123,1682,9,1137,1169,1607,2477,1333,1049,1905,916,13,213,1038,2105,1639,2287,2265,36,2364,1782,1926,1073,2461,350,944,1713,936,2372,1461,1448,353,192,1620,1725,2047,856,834,1123,685,272,52,1247,248,1848,1793,764,115,1564,2207,1737,911,388,2209,316,1505,1024,654,919,1840,307,1426,1703,387,684,22,2292,1649,2053,634,2060,1034,1570,362,1986,2103,2335,748,838,2246,1827,2128,1680,1507,1362,519,1230,78,474,1652,2309,846,641,2201,779,949,70,521,1232,315,325,609,2079,658,1689,1095,113,480,40,953,705,1429,1222,965,1529,1332,868,667,2106,1246,457,2268,538,1941,938,1064,1451,2175,1271,788,2157,883,2162,528,1381,1965,1440,1660,1692,1303,974,13,2036,1084,1728,2256,1317,1434,441,2006,1919,902,36,1307,979,82,65,1661,2279,1424,462,756,1046,1388,368,1817,1190,561,2011,142,1488,1554,509,1889,1008,2237,391,364,63,879,1895,342,457,2008,2035,700,182,616,1200,1360,326,1373,2240,1456,1796,1933,1506,1650,1394,2088,1571,1986,1728,1181,21,213,1147,1186,26,1609,1302,717,835,1222,1599,524,1784,1405,997,1385,536,2181,1741,1063,630,987,1674,1433,1927,1364,345,385,2125,123,1995,200,1063,1213,1296,1656,504,1799,163,214,93,195,1783,2018,1462,1999,297,1639,1563,401,1184,1426,540,1256,1939,1094,1900,1025,1356,1753,994,277,2130,1763,922,1395,543,1230,864,1863,1437,1284,197,171,1399,573,1354,2064,2011,296,1921,326,2014,1651,2032,494,1604,1831,137,2025,746,1881,1182,1760,642,92,2008,1968,1510,161,1282,425,1757,13,1177,1899,1546,428,1700,594,1956,587,425,728,1372,1348,1811,1686,1773,924,963,1364,1526,1758,1846,935,1364,823,780,322,151,1552,905,1175,116,1900,1400,1548,1155,1658,1209,1362,1785,874,1963,931,104,831,1393,494,1300,968,23,1101,905,549,446,736,1015,2100,1230,812,388,250,1151,1072,64,1619,625,1820,384,1194,1239,1677,1761,1709,943,1225,911,1248,1462,2030,1682,281,1020,1730,134,848,224,1144,923,577,854,925,482,1718,787,1471,1450,1899,1045,1802,256,1115,871,1882,1268,1183,519,1369,1258,225,1431,1169,1720,1715,1896,1716,1261,1990,236,413,1353,1708,1356,731,862,1072,1305,1617,526,112,2019,841,1478,102,328,1037,406,1075,9,515,210,632,691,1679,1901,91,338,1352,224,1430,345,354,2031,1315,2014,1494,728,105,1123,1311,473,2032,819,459,112,2040,424,681,1033,827,119,836,918,1608,480,273,1233,216,139,1342,1101,276,1949,1834,183,1273,308,647,567,922,1698,1774,107,75,1981,1369,311,235,1691,53,414,1360,975,1405,169,736,36,2003,26,115,696,1086,408,1253,18,30,990,1425,766,1258,246,1434,588,1214,154,214,594,1962,242,698,167,1120,1883,903,1062,1855,1968,390,132,62,660,1825,201,1257,402,484,1263,790,488,282,512,947,53,1030,1184,215,1243,955,558,1304,429,1351,178,907,1927,1590,1840,1499,668,1167,855,430,975,1008,221,159,1770,506,1203,1641,1830,781,945,536,266,544,1220,64,656,1752,438,740,653,1810,1279,493,1530,232,1031,1360,1556,57,1151,1205,887,1811,1072,1646,1144,652,1838,1162,1840,424,882,926,775,906,991,1386,1763,115,120,1608,819,863,960,1317,671,899,1129,1650,37,1077,1643,1747,410,48,833,320,944,533,1467,348,205,942,1245,822,1271,863,279,875,1299,144,877,1080,359,383,177,313,414,749,417,746,863,1468,1534,1313,1077,967,1728,1294,708,1661,150,327,1268,328,334,1614,1379,1039,393,1228,124,709,447,185,133,1395,492,1457,1772,360,1699,1149,55,1159,964,1168,200,1290,1482,1271,386,853,158,111,895,1183,576,1508,1162,194,532,1433,906,1411,36,1629,1480,898,1101,1293,1408,1665,733,178,1553,1696,1286,1222,925,1576,334,1724,754,108,28,352,264,1516,10,1321,685,285,744,736,52,512,1657,1110,1483,513,327,760,1043,1738,1703,302,1234,1143,1152,1273,654,495,1731,683,1467,462,1036,27,1394,801,1206,471,1144,995,488,757,1383,120,875,362,801,607,510,685,1680,892,856,580,1498,60,1341,400,1610,1455,963,510,855,965,1211,1110,43,1523,1175,386,1503,1021,274,257,1404,813,306,746,1066,950,157,112,248,810,213,479,156,598,1508,231,1246,1280,914,1289,243,575,925,683,1083,1643,472,156,1215,327,128,1621,1021,1401,1533,1081,14,927,1351,144,1125,1563,522,908,1595,1241,838,427,316,206,1142,882,705,1306,667,200,126,758,1532,482,1573,523,634,1554,1341,280,1105,1396,853,1394,95,595,342,1328,74,999,380,975,291,189,1035,1342,320,151,458,1582,750,296,509,1440,502,1286,1381,1150,410,34,808,293,537,1573,812,1239,145,321,108,279,126,1201,1314,1214,1410,479,819,952,175,954,447,110,1453,1357,730,584,1231,713,1463,363,599,1197,548,235,916,451,683,541,326,423,1323,1288,914,864,805,1062,1479,150,260,738,1535,1550,607,437,479,298,453,707,87,1173,481,913,1014,863,1106,251,185,737,1376,108,548,522,626,1226,361,349,1420,503,342,1183,516,63,1002,190,244,103,950,1113,985,165,1314,1450,1033,568,343,523,1112,554,439,336,1482,528,1272,166,1463,992,1408,1373,1270,659,1470,1260,671,1467,203,602,425,889,793,180,1412,574,1148,331,1344,603,547,302,1184,813,811,1359,267,158,1010,983,870,196,1328,164,1275,1253,761,585,246,1038,452,864,612,1288,611,752,435,762,1088,911,934,681,625,303,1037,592,993,923,334,178,720,1027,187,335,318,788,252,481,496,951,188,1288,200,748,1256,1155,1212,791,983,504,1407,1175,711,986,128,1278,1123,1297,1095,892,849,673,20,1186,595,68,738,1019,1181,1242,1175,1174,1305,579,446,254,602,637,12,189,313,202,500,800,982,607,480,381,1108,478,257,631,725,48,1198,707,1322,1190,38,738,215,614,822,1313,85,818,913,378,1096,1255,1030,1157,1085,568,777,871,892,461,362,641,262,576,637,160,981,1336,872,781,958,49,1031,49,801,1305,672,60,400,1243,933,1240,765,1064,819,512,490,779,104,633,1126,1003,616,1238,525,940,629,299,854,4,170,559,866,1101,802,463,346,315,1,1267,230,413,238,641,40,959,619,402,577,1184,840,904,1269,696,1062,228,681,567,1050,567,1005,854,982,387,1046,186,1065,1099,344,918,601,1045,462,246,471,139,412,778,650,1241,907,1082,171,271,302,624,663,859,84,383,727,72,316,451,989,1133,1214,829,577,810,987,470,876,1071,203,913,392,1007,825,136,1077,1095,225,659,984,1047,765,928,845,424,998,1218,1133,180,793,308,211,484,517,260,1162,547,369,422,924,848,1005,1158,929,533,203,105,708,197,1099,602,850,114,225,274,323,800,404,776,629,918,532,459,875,329,408,193,666,515,1004,1052,750,629,874,31,950,812,467,658,164,195,698,588,115,372,271,972,1019,876,112,170,924,99,113,452,970,235,962,759,346,580,699,377,948,441,907,701,673,45,193,1130,1004,502,1044,721,872,436,395,654,765,346,487,39,638,574,622,962,172,158,1055,388,687,800,143,150,1047,994,984,1059,557,20,70,878,787,868,594,611,901,923,962,526,825,489,241,900,52,835,147,679,627,814,494,971,973,767,734,1014,23,550,693,632,547,1031,117,848,378,963,383,610,282,915,315,192,937,254,777,25,97,350,137,489,196,595,190,405,669,313,645,109,834,583,74,840,699,689,642,529,1006,48,806,473,739,70,337,173,166,430,719,469,424,873,1010,999,999,606,582,490,267,55,117,95,433,633,807,498,354,340,677,463,969,655,683,916,280,460,269,5,563,692,81,124,286,518,469,413,245,430,887,738,160,89,284,881,452,622,221,873,502,928,20,416,592,209,871,266,723,356,776,859,100,883,819,780,51,946,894,512,434,583,579,651,207,649,685,839,136,686,72,558,670,54,572,77,318,532,744,750,289,716,197,131,891,747,392,857,560,661,541,478,915,76,477,705,612,409,675,713,226,500,312,567,795,353,711,746,440,308,616,92,258,399,264,48,638,866,760,670,73,123,626,489,662,224,521,697,784,319,387,619,601,311,539,293,717,714,438,711,106,448,488,523,275,16,726,806,781,272,545,556,590,388,711,649,266,394,766,552,318,410,580,451,350,432,181,845,352,575,401,786,508,359,567,429,798,138,47,608,484,289,632,105,616,2,759,51,673,152,639,550,704,762,636,313,223,597,125,264,123,459,668,211,786,236,253,335,364,143,274,368,235,721,71,278,464,796,584,193,12,708,99,136,613,299,312,260,499,64,749,389,575,317,660,609,696,248,406,389,465,336,155,666,523,649,319,244,424,217,246,144,589,478,24,123,63,367,62,303,474,547,199,750,586,235,665,385,587,31,526,174,225,676,61,600,729,308,266,287,489,609,70,577,400,108,614,298,321,472,446,356,617,596,76,93,620,556,178,699,711,119,263,217,225,702,634,367,29,94,81,76,376,141,219,441,612,584,283,617,329,13,588,345,691,413,378,632,344,175,56,358,661,16,16,60,661,183,180,324,503,113,511,347,183,262,356,214,670,584,310,132,282,317,300,339,46,210,190,44,180,290,136,288,53,383,410,523,49,90,484,526,187,58,354,601,235,318,8,179,191,528,339,503,480,89,537,180,33,401,49,96,28,340,491,430,295,86,558,65,34,335,3,164,44,487,111,479,300,45,607,18,369,35,275,297,519,418,370,208,326,77,292,168,244,359,513,121,164,245,283,433,306,352,492,24,323,333,482,126,575,437,422,285,549,131,261,571,174,51,166,101,390,441,20,424,166,489,470,556,246,103,400,98,5,268,300,152,461,523,230,131,423,466,55,35,346,138,59,379,201,482,312,133,51,35,220,490,136,191,259,100,96,417,281,198,277,510,302,361,475,428,12,44,448,309,488,477,348,233,381,262,78,187,285,87,395,75,474,85,283,61,365,338,421,216,75,467,368,335,84,447,205,482,359,215,263,66,168,406,290,275,151,165,370,76,316,293,195,164,355,46,291,142,393,118,27,368,36,413,407,234,419,387,87,243,21,267,151,420,449,179,120,345,288,214,275,37,312,4,377,156,334,55,178,407,98,427,292,259,336,382,161,327,422,220,302,54,378,141,325,150,411,109,230,142,188,263,117,307,69,38,220,181,252,21,170,127,217,152,231,266,97,388,156,385,238,94,154,294,144,323,371,356,293,230,155,1,215,203,171,110,317,303,294,134,62,191,297,141,170,308,147,111,302,74,259,357,99,45,2,6,246,1,86,317,301,337,256,47,221,47,199,280,323,56,16,75,112,158,107,192,98,271,26,332,179,307,149,183,3,132,147,215,250,235,238,275,6,207,194,315,100,305,280,220,96,38,164,140,242,256,242,253,285,166,146,59,56,86,269,78,45,279,16,11,179,115,15,120,245,207,21,73,159,122,221,184,86,167,142,137,188,262,37,201,116,164,226,223,212,7,200,181,158,244,96,189,172,187,239,112,44,203,96,214,29,166,99,44,190,62,97,27,55,127,106,142,160,29,235,71,146,117,187,91,167,11,176,150,108,215,180,62,169,134,209,62,3,53,120,108,34,12,114,127,46,108,117,1,81,121,159,25,106,8,52,143,146,195,12,16,117,126,9,184,42,180,77,75,135,59,39,38,19,96,182,109,61,167,50,114,98,73,4,13,83,102,52,35,9,142,20,133,106,28,13,2,23,22,130,92,36,18,47,62,138,73,22,104,18,14,84,35,99,64,74,76,55,5,12,85,102,74,6,134,84,73,49,43,5,4,85,81,32,91,120,80,80,0,28,35,75,60,57,110,12,79,98,83,107,84,62,14,44,7,55,18,63,4,51,82,1,28,14,32,79,51,22,74,41,72,55,25,78,81,79,36,4,66,70,29,5,26,64,9,46,49,39,28,24,25,26,39,46,38,18,14,40,25,33,37,40,45,8,16,11,8,36,20,40,28,23,41,35,25,0,29,31,16,31,6,5,2,21,27,14,3,29,12,24,3,8,12,18,13,22,19,6,7,2,13,2,3,4,9,6,11,9,9,6,3,4,3,3,3,1,0,0,0 }, +}, + // 可以有多个 testcase +} + +func Test_countSmaller(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countSmaller(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_countSmaller(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countSmaller(tc.nums) + } + } +} diff --git a/Algorithms/0316.remove-duplicate-letters/README.md b/Algorithms/0316.remove-duplicate-letters/README.md new file mode 100755 index 000000000..dae4e89cf --- /dev/null +++ b/Algorithms/0316.remove-duplicate-letters/README.md @@ -0,0 +1,23 @@ +# [316. Remove Duplicate Letters](https://leetcode.com/problems/remove-duplicate-letters/) + +## 题目 + +Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order among all possible results. + +Example: + +```text +Given "bcabc" +Return "abc" + +Given "cbacdcbc" +Return "acdb" +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +lexicographical: :字典排序(lexicographical order)是一种对于随机变量形成序列的排序方法。其方法是,按照字母顺序,或者数字小大顺序,由小到大的形成序列。 + +见程序注释 diff --git a/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters.go b/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters.go new file mode 100755 index 000000000..aa438fdbb --- /dev/null +++ b/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters.go @@ -0,0 +1,39 @@ +package problem0316 + +import ( + "strings" +) + +func removeDuplicateLetters(s string) string { + lens := len(s) + if lens == 0 { + return "" + } + // 统计每个字母出现的次数 + count := [26]int{} + var ch rune + for _, ch = range s { + count[ch-'a']++ + } + + // index of min character + imc := 0 + for i := range s { + if s[imc] > s[i] { + imc = i + } + count[s[i]-'a']-- + if count[s[i]-'a'] == 0 { + break + } + } + + // 贪心算法:更小的 s[i] 值得拥有更小的 i + // 1. s[:ims] 中出现的字母,在 s[ims+1:] 中都会再出现 + // 2. s[ims] 是 s[:ims+1] 中最小的字母 + // 综合以上两条 + // 1. 删除 s[:ims] + // 2. 把 s[ims] 作为答案的首字母 + // 3. 删除 s[ims+1:] 中的 s[ims] 后,递归求解 + return string(s[imc]) + removeDuplicateLetters(strings.Replace(s[imc+1:], string(s[imc]), "", -1)) +} diff --git a/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters_test.go b/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters_test.go new file mode 100755 index 000000000..1ad88a3ca --- /dev/null +++ b/Algorithms/0316.remove-duplicate-letters/remove-duplicate-letters_test.go @@ -0,0 +1,39 @@ +package problem0316 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + {"bbbacacca", "bac"}, + {"ccacbaba", "acb"}, + {"cbacdcbc", "acdb"}, + {"cbac", "bac"}, + {"bcabc", "abc"}, + + // 可以有多个 testcase +} + +func Test_removeDuplicateLetters(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, removeDuplicateLetters(tc.s), "输入:%v", tc) + } +} + +func Benchmark_removeDuplicateLetters(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeDuplicateLetters(tc.s) + } + } +} diff --git a/Algorithms/0318.maximum-product-of-word-lengths/README.md b/Algorithms/0318.maximum-product-of-word-lengths/README.md new file mode 100755 index 000000000..7c13cf461 --- /dev/null +++ b/Algorithms/0318.maximum-product-of-word-lengths/README.md @@ -0,0 +1,37 @@ +# [318. Maximum Product of Word Lengths](https://leetcode.com/problems/maximum-product-of-word-lengths/) + +## 题目 + +Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. +You may assume that each word will contain only lower case letters. +If no such two words exist, return 0. + +Example 1: + +```text +Given ["abcw", "baz", "foo", "bar", "xtfn", "abcdef"] +Return 16 +The two words can be "abcw", "xtfn". +``` + +Example 2: + +```text +Given ["a", "ab", "abc", "d", "cd", "bcd", "abcd"] +Return 4 +The two words can be "ab", "cd". +``` + +Example 3: + +```text +Given ["a", "aa", "aaa", "aaaa"] +Return 0 +No such pair of words. +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths.go b/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths.go new file mode 100755 index 000000000..d18f13cd0 --- /dev/null +++ b/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths.go @@ -0,0 +1,30 @@ +package problem0318 + +func maxProduct(words []string) int { + size := len(words) + + masks := make([]int, size) + for i := 0; i < size; i++ { + for _, b := range words[i] { + // 利用 bite 位来描述 words[i] + masks[i] |= (1 << uint32(b-'a')) + } + } + + var max int + for i := 0; i < size-1; i++ { + for j := i + 1; j < size; j++ { + // 当 words[i] 和 words[j] 拥有相同的字母时 + // 这个字母所对应的位进行 & 运算后,为 1 + if masks[i]&masks[j] != 0 { + continue + } + temp := len(words[i]) * len(words[j]) + if max < temp { + max = temp + } + } + } + + return max +} diff --git a/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths_test.go b/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths_test.go new file mode 100755 index 000000000..653c21ae6 --- /dev/null +++ b/Algorithms/0318.maximum-product-of-word-lengths/maximum-product-of-word-lengths_test.go @@ -0,0 +1,37 @@ +package problem0318 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans int +}{ + {[]string{"abcw", "baz", "foo", "bar", "xtfn", "abcdef"}, 16}, + {[]string{"a", "ab", "abc", "d", "cd", "bcd", "abcd"}, 4}, + {[]string{"a", "aa", "aaa", "aaaa"}, 0}, + + // 可以有多个 testcase +} + +func Test_maxProduct(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxProduct(tc.words), "输入:%v", tc) + } +} + +func Benchmark_maxProduct(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxProduct(tc.words) + } + } +} diff --git a/Algorithms/0319.bulb-switcher/README.md b/Algorithms/0319.bulb-switcher/README.md new file mode 100755 index 000000000..5cb12ce93 --- /dev/null +++ b/Algorithms/0319.bulb-switcher/README.md @@ -0,0 +1,28 @@ +# [319. Bulb Switcher](https://leetcode.com/problems/bulb-switcher/) + +## 题目 + +There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb. + +Find how many bulbs are on after n rounds. + +Example: + +```text +Given n = 3. + +At first, the three bulbs are [off, off, off]. +After first round, the three bulbs are [on, on, on]. +After second round, the three bulbs are [on, off, on]. +After third round, the three bulbs are [on, off, off]. +So you should return 1, because there is only one bulb is on. +``` + +## 解题思路 + +大概意思是,要在[1,n]里头找哪些灯泡被执行了奇数次操作 + +1. 对于一个非平方数来说(比如12),因为有成对的补数(1vs12; 2vs6),所以总是会按下2的倍数次 +1. 但是对于一个平方数来说(比如36),因为其中有个数(6)它的补数是自己,所以会按被下奇数次 + +然后这道题就变成了找[1,n]中间有几个平方数了 diff --git a/Algorithms/0319.bulb-switcher/bulb-switcher.go b/Algorithms/0319.bulb-switcher/bulb-switcher.go new file mode 100755 index 000000000..883d322b8 --- /dev/null +++ b/Algorithms/0319.bulb-switcher/bulb-switcher.go @@ -0,0 +1,16 @@ +package problem0319 + +func bulbSwitch(n int) int { + return intSqrt(n) +} + +// intSqrt 返回 x 的平方根的整数部分 +func intSqrt(x int) int { + root := x + + for root*root > x { + root = (root + x/root) / 2 + } + + return root +} diff --git a/Algorithms/0319.bulb-switcher/bulb-switcher_test.go b/Algorithms/0319.bulb-switcher/bulb-switcher_test.go new file mode 100755 index 000000000..4be4ae35a --- /dev/null +++ b/Algorithms/0319.bulb-switcher/bulb-switcher_test.go @@ -0,0 +1,41 @@ +package problem0319 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {10, 3}, + {100, 10}, + {3, 1}, + {4, 2}, + {5, 2}, + {10000000, 3162}, + + // 可以有多个 testcase +} + +func Test_bulbSwitch(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, bulbSwitch(tc.n), "输入:%v", tc) + } +} + +func Benchmark_bulbSwitch(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + bulbSwitch(tc.n) + } + } +} diff --git a/Algorithms/0321.create-maximum-number/README.md b/Algorithms/0321.create-maximum-number/README.md new file mode 100755 index 000000000..826042085 --- /dev/null +++ b/Algorithms/0321.create-maximum-number/README.md @@ -0,0 +1,34 @@ +# [321. Create Maximum Number](https://leetcode.com/problems/create-maximum-number/) + +Given two arrays of length m and n with digits 0-9 representing two numbers. +Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits +from the same array must be preserved. Return an array of the k digits. You should try to optimize your time and space complexity. + +Example 1: + +```text +nums1 = [3, 4, 6, 5] +nums2 = [9, 1, 2, 5, 8, 3] +k = 5 +return [9, 8, 6, 5, 3] +``` + +Example 2: + +```text +nums1 = [6, 7] +nums2 = [6, 0, 4] +k = 5 +return [6, 7, 6, 0, 4] +``` + +Example 3: + +```text +nums1 = [3, 9] +nums2 = [8, 9] +k = 3 +return [9, 8, 9] +``` + +dits:Special thanks to @dietpepsi for adding this problem and creating all test cases. diff --git a/Algorithms/0321.create-maximum-number/create-maximum-number.go b/Algorithms/0321.create-maximum-number/create-maximum-number.go new file mode 100755 index 000000000..a5311bf6a --- /dev/null +++ b/Algorithms/0321.create-maximum-number/create-maximum-number.go @@ -0,0 +1,79 @@ +package problem0321 + +func maxNumber(A, B []int, k int) []int { + m, n := len(A), len(B) + res := make([]int, k) + for i := max(0, k-n); i <= m && k-i >= 0; i++ { + temp := combine(choose(A, i), choose(B, k-i)) + if isBigger(temp, res, 0, 0) { + res = temp + } + } + return res +} + +func choose(A []int, k int) []int { + stack, top := make([]int, k), -1 + n := len(A) + for i := 0; i < n; i++ { + for top >= 0 && stack[top] < A[i] && + top+n-i >= k { + // 此时,stack 中 有 top+1 个元素 + // 需要保证消去 stack[top] 后的 top 个元素 + // 和 A[i:] 中的 n-i 个元素 + // 能够组成 k 个元素 + // 所以,top+(n-i)>=k + top-- + } + if top+1 < k { + // 如果 stack 中的元素,还没有 k 个的话 + // 先用 A[i] 填上空缺 + top++ + stack[top] = A[i] + } + } + return stack +} + +// 混合 nums1 和 nums2 使得其组成的 []int 最大 +func combine(A, B []int) []int { + m, n := len(A), len(B) + res := make([]int, 0, m+n) + + var i, j int + for i < m && j < n { + if isBigger(A, B, i, j) { + res = append(res, A[i]) + i++ + } else { + res = append(res, B[j]) + j++ + } + } + + res = append(res, A[i:]...) + res = append(res, B[j:]...) + + return res +} + +func isBigger(A, B []int, i, j int) bool { + m, n := len(A), len(B) + for i < m && j < n { + if A[i] > B[j] { + return true + } else if A[i] < B[j] { + return false + } + i++ + j++ + } + return m-i > n-j +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0321.create-maximum-number/create-maximum-number_test.go b/Algorithms/0321.create-maximum-number/create-maximum-number_test.go new file mode 100755 index 000000000..2a41d1f67 --- /dev/null +++ b/Algorithms/0321.create-maximum-number/create-maximum-number_test.go @@ -0,0 +1,131 @@ +package problem0321 + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums1 []int + nums2 []int + k int + ans []int +}{ + + { + []int{6, 3, 9, 0, 5, 6}, + []int{2, 2, 5, 2, 1, 4, 4, 5, 7, 8, 9, 3, 1, 6, 9, 7, 0}, + 23, + []int{6, 3, 9, 2, 2, 5, 2, 1, 4, 4, 5, 7, 8, 9, 3, 1, 6, 9, 7, 0, 5, 6, 0}, + }, + + { + []int{1, 6, 5, 4, 7, 3, 9, 5, 3, 7, 8, 4, 1, 1, 4}, + []int{4, 3, 1, 3, 5, 9}, + 21, + []int{4, 3, 1, 6, 5, 4, 7, 3, 9, 5, 3, 7, 8, 4, 1, 3, 5, 9, 1, 1, 4}, + }, + + { + []int{6, 7}, + []int{6, 0, 4}, + 5, + []int{6, 7, 6, 0, 4}, + }, + + { + []int{1, 1, 1}, + []int{9, 9, 9}, + 2, + []int{9, 9}, + }, + + { + []int{1, 1, 1}, + []int{1, 1, 1}, + 5, + []int{1, 1, 1, 1, 1}, + }, + + { + []int{2, 8, 0, 4, 5, 1, 4, 8, 9, 9, 0, 8, 2, 9}, + []int{5, 9, 6, 6, 4, 1, 0, 7}, + 22, + []int{5, 9, 6, 6, 4, 2, 8, 1, 0, 7, 0, 4, 5, 1, 4, 8, 9, 9, 0, 8, 2, 9}, + }, + + { + []int{3, 4, 6, 5}, + []int{9, 1, 2, 5, 8, 3}, + 5, + []int{9, 8, 6, 5, 3}, + }, + + { + []int{3, 9}, + []int{8, 9}, + 3, + []int{9, 8, 9}, + }, + + // 可以有多个 testcase +} + +func Test_maxNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxNumber(tc.nums1, tc.nums2, tc.k), "输入:%v", tc) + } +} + +func Benchmark_maxNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxNumber(tc.nums1, tc.nums2, tc.k) + } + } +} + +func Test_choose(t *testing.T) { + type args struct { + A []int + k int + } + tests := []struct { + name string + args args + want []int + }{ + + { + "6选3", + args{ + []int{8, 9, 1, 7, 5, 2}, + 3, + }, + []int{9, 7, 5}, + }, + + { + "5选3", + args{ + []int{5, 2, 7, 1, 9}, + 3, + }, + []int{7, 1, 9}, + }, + + // + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := choose(tt.args.A, tt.args.k); !reflect.DeepEqual(got, tt.want) { + t.Errorf("choose() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/Algorithms/0322.coin-change/README.md b/Algorithms/0322.coin-change/README.md new file mode 100755 index 000000000..99f011fa2 --- /dev/null +++ b/Algorithms/0322.coin-change/README.md @@ -0,0 +1,27 @@ +# [322. Coin Change](https://leetcode.com/problems/coin-change/) + +## 题目 + +You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. + +Example 1: + +```text +coins = [1, 2, 5], amount = 11 +return 3 (11 = 5 + 5 + 1) +``` + +Example 2: + +```text +coins = [2], amount = 3 +return -1. +``` + +Note: You may assume that you have an infinite number of each kind of coin. + +Credits: Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0322.coin-change/coin-change.go b/Algorithms/0322.coin-change/coin-change.go new file mode 100755 index 000000000..0c354144e --- /dev/null +++ b/Algorithms/0322.coin-change/coin-change.go @@ -0,0 +1,56 @@ +package problem0322 + +func coinChange(coins []int, amount int) int { + // dp[i] 更换金额为 i 时,最小的零钱数量 + // res = dp[amount] + dp := make([]int, amount+1) + dp[0] = 0 + + for i := 1; i <= amount; i++ { + dp[i] = amount + 1 + for _, c := range coins { + if c <= i && dp[i] > dp[i-c]+1 { + dp[i] = dp[i-c] + 1 + } + } + } + + if dp[amount] > amount { + return -1 + } + + return dp[amount] +} + +// func coinChange(coins []int, amount int) int { +// max := amount + 1 +// dp := make([]int, amount+1) +// for i := range dp { +// dp[i] = max +// } +// dp[0] = 0 + +// sort.Ints(coins) + +// for i := 1; i <= amount; i++ { +// for _, c := range coins { +// if i-c < 0 { +// break +// } +// dp[i] = min(dp[i], dp[i-c]+1) +// } +// } + +// if dp[amount] > amount { +// return -1 +// } + +// return dp[amount] +// } + +// func min(a, b int) int { +// if a < b { +// return a +// } +// return b +// } diff --git a/Algorithms/0322.coin-change/coin-change_test.go b/Algorithms/0322.coin-change/coin-change_test.go new file mode 100755 index 000000000..8d738bec6 --- /dev/null +++ b/Algorithms/0322.coin-change/coin-change_test.go @@ -0,0 +1,42 @@ +package problem0322 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + coins []int + amount int + ans int +}{ + + {[]int{1}, 1, 1}, + {[]int{1}, 0, 0}, + {[]int{1, 3, 5}, 8, 2}, + {[]int{1, 2}, 3, 2}, + {[]int{1, 2, 5}, 11, 3}, + {[]int{2}, 3, -1}, + + // 可以有多个 testcase +} + +func Test_coinChange(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, coinChange(tc.coins, tc.amount), "输入:%v", tc) + } +} + +func Benchmark_coinChange(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + coinChange(tc.coins, tc.amount) + } + } +} diff --git a/Algorithms/0324.wiggle-sort-ii/README.md b/Algorithms/0324.wiggle-sort-ii/README.md new file mode 100755 index 000000000..7e9e42468 --- /dev/null +++ b/Algorithms/0324.wiggle-sort-ii/README.md @@ -0,0 +1,22 @@ +# [324. Wiggle Sort II](https://leetcode.com/problems/wiggle-sort-ii/) + +## 题目 + +Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... + +Example: + +1. Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6]. +1. Given nums = [1, 3, 2, 2, 3, 1], one possible answer is [2, 3, 1, 3, 1, 2]. + +Note: +You may assume all input has valid answer. + +Follow Up: +Can you do it in O(n) time and/or in-place with O(1) extra space? + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii.go b/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii.go new file mode 100755 index 000000000..366584838 --- /dev/null +++ b/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii.go @@ -0,0 +1,22 @@ +package problem0324 + +import "sort" + +func wiggleSort(nums []int) { + n := len(nums) + temp := make([]int, n) + copy(temp, nums) + sort.Ints(temp) + + mid := n / 2 + + for i := 0; i < n; i++ { + if i < mid { + // 把较大的数,按照降序插入 nums 的奇数位 + nums[2*i+1] = temp[n-1-i] + } else { + // 把较小的数,按照降序插入 nums 的偶数位 + nums[2*(i-mid)] = temp[n-1-i] + } + } +} diff --git a/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii_test.go b/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii_test.go new file mode 100755 index 000000000..d4064293f --- /dev/null +++ b/Algorithms/0324.wiggle-sort-ii/wiggle-sort-ii_test.go @@ -0,0 +1,49 @@ +package problem0324 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int +}{ + + {[]int{1, 5, 1, 1, 6, 4}}, + {[]int{1, 3, 2, 2, 3, 1}}, + + // 可以有多个 testcase +} + +func check(nums []int) bool { + for i := 0; i < len(nums); i += 2 { + if 0 <= i-1 && nums[i-1] <= nums[i] { + return false + } + if i+1 < len(nums) && nums[i] >= nums[i+1] { + return false + } + } + return true +} + +func Test_wiggleSort(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + wiggleSort(tc.nums) + ast.True(check(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_wiggleSort(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wiggleSort(tc.nums) + } + } +} diff --git a/Algorithms/0326.power-of-three/README.md b/Algorithms/0326.power-of-three/README.md new file mode 100755 index 000000000..d7faad019 --- /dev/null +++ b/Algorithms/0326.power-of-three/README.md @@ -0,0 +1,16 @@ +# [326. Power of Three](https://leetcode.com/problems/power-of-three/) + +## 题目 + +Given an integer, write a function to determine if it is a power of three. + + + Follow up: + Could you do it without using any loop / recursion? + + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0326.power-of-three/power-of-three.go b/Algorithms/0326.power-of-three/power-of-three.go new file mode 100755 index 000000000..9ef6e535e --- /dev/null +++ b/Algorithms/0326.power-of-three/power-of-three.go @@ -0,0 +1,13 @@ +package problem0326 + +func isPowerOfThree(n int) bool { + if n < 1 { + return false + } + + for n%3 == 0 { + n /= 3 + } + + return n == 1 +} diff --git a/Algorithms/0326.power-of-three/power-of-three_test.go b/Algorithms/0326.power-of-three/power-of-three_test.go new file mode 100755 index 000000000..466a32688 --- /dev/null +++ b/Algorithms/0326.power-of-three/power-of-three_test.go @@ -0,0 +1,41 @@ +package problem0326 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans bool +}{ + + {-1, false}, + {8, false}, + {2, false}, + {3, true}, + {81, true}, + {243, true}, + + // 可以有多个 testcase +} + +func Test_isPowerOfThree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isPowerOfThree(tc.n), "输入:%v", tc) + } +} + +func Benchmark_isPowerOfThree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isPowerOfThree(tc.n) + } + } +} diff --git a/Algorithms/0327.count-of-range-sum/README.md b/Algorithms/0327.count-of-range-sum/README.md new file mode 100755 index 000000000..1ccba0da5 --- /dev/null +++ b/Algorithms/0327.count-of-range-sum/README.md @@ -0,0 +1,24 @@ +# [327. Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) + +## 题目 + +Given an integer array `nums`, return the number of range sums that lie in `[lower, upper]` inclusive. + +Range sum `S(i, j)` is defined as the sum of the elements in `nums` between indices `i` and `j` (`i` ≤ `j`), inclusive. + +Note: +A naive algorithm of O(n2) is trivial. You MUST do better than that. + +Example: + +```text +Given nums = [-2, 5, -1], lower = -2, upper = 2, +Return 3. +The three ranges are : [0, 0], [2, 2], [0, 2] and their respective sums are: -2, -1, 2. +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0327.count-of-range-sum/count-of-range-sum.go b/Algorithms/0327.count-of-range-sum/count-of-range-sum.go new file mode 100755 index 000000000..0ae92f17d --- /dev/null +++ b/Algorithms/0327.count-of-range-sum/count-of-range-sum.go @@ -0,0 +1,98 @@ +package problem0327 + +var lo, up int +var tmp []int + +func countRangeSum(nums []int, lower int, upper int) int { + size := len(nums) + if size == 0 { + return 0 + } + + // sum[i] == sum(nums[:i]) + // sum[j] - sum[i] == sum(nums[i:j]) + sum := make([]int, size+1) + for i, n := range nums { + sum[i+1] = sum[i] + n + } + + lo = lower + up = upper + tmp = make([]int, len(sum)) + + return mergeSort(sum) +} + +// 对前 i 项的和,进行归并排序 +// 归并 left 和 right 的同时,检查符合条件的子数组 +func mergeSort(nums []int) int { + size := len(nums) + if size == 1 { + return 0 + } + + mid := size / 2 + // left 中任意一个值,所代表的 sum(nums[:i]) + // right 中任意一个值,所代表的 sum(nums[:j]) + // 可以得知, i < j, 这一点很重要, + // 正因为如此,对于任意一个 right[j]-left[i] 都是某个子数组的 sum,统计才有意义 + left := nums[:mid] + right := nums[mid:] + + // 分而治之 + count := mergeSort(left) + mergeSort(right) + + // 用于归并 + i := 0 + j := 0 + + // 用于 count + cl := 0 + cr := 0 + + for i < len(left) && j < len(right) { + if left[i] < right[j] { + tmp[i+j] = left[i] + + for cl < len(right) && right[cl]-left[i] < lo { + cl++ + } + for cr < len(right) && right[cr]-left[i] <= up { + cr++ + } + // 对于 left[i] 所代表的 sum(nums[:x]) 来说 + // 此时 right 中存在有 cr - cl 个 right[cy] 所代表的 sum(nums[:y]) + // 能够保证 lower <= sum(nums[x:y]) <= upper + // + // 上段注释中,在 nums 中用到了新的索引号 x , y ,而不是 left 和 right中用到的 i 和 cy + // 是因为 left 和 right 经过排序后,位置已经打乱,两者的索引号对应关系也被打乱了 + // 但是,我们知道 x < y 一定成立,就可以了 + count += cr - cl + i++ + } else { + tmp[i+j] = right[j] + j++ + } + } + + if i == len(left) { + copy(tmp[i+j:], right[j:]) + } else { + copy(tmp[i+j:], left[i:]) + // left 中的元素没有检查完,继续检查 + for i < len(left) { + for cl < len(right) && right[cl]-left[i] < lo { + cl++ + } + for cr < len(right) && right[cr]-left[i] <= up { + cr++ + } + count += cr - cl + i++ + } + } + + copy(nums, tmp) + + return count +} diff --git a/Algorithms/0327.count-of-range-sum/count-of-range-sum_test.go b/Algorithms/0327.count-of-range-sum/count-of-range-sum_test.go new file mode 100755 index 000000000..b7ab845bb --- /dev/null +++ b/Algorithms/0327.count-of-range-sum/count-of-range-sum_test.go @@ -0,0 +1,39 @@ +package problem0327 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + lower int + upper int + ans int +}{ + + {[]int{13, 6, 13, 4, 27, -14, -13, 15, -4, 13, -15, 21, -23, 19, 3, -14, -27, -17, -4, 15, 1, -27, -17, -12, -26, 12, 11, -24, 9, -18, 18, 26, -5, -25, -29, -26, 17, -24, -22, 27, -2, 16, -7, -17, 15, -10, -24, -14, -19, -22, -1, -9, -30, -11, 20, -14, -5, 4, 20, 7, -2, 20, 26, 16, -13, -10, 3, -29, 13, 26, 14, -2, -13, 18, 28, 9, -11, 17, -28, -4, -23, -23, -7, -22, 11, 2, -24, -4, -11, 9, -23, 29, 9, -10, -17, -16, -11, 2, -28, 3, 12, -8, -16, -16, -25, 27, 21, -17, -5, 17, -17, -30, 2, -13, -14, -2, -15, -26, -12, 9, 12, -26, 19, 21, 10, -10, 9, -15, 5, -1, -14, 19, -18, -30, 15, -9, -19, -11, -20, 14, -9, 18, -19, -9, -18, 29, 14, -29, 11, -9, -7, -21, 12, -17, -11, -23, -8, 1, -1, -5, -22, -26, -18, 27, 6, -24, -27, 21, -25, -22, 17, 18, 28, 20, -7, 19, 6, -11, 14, 10, 6, -22, -4, 13, 5, 5, 3, -10, 0, -6, -29, 2, -22, 10, -26, 3, -23, 29, 28, 4, 0, -26, 13, -1, 4, -13, 25, 23, 27, -30, 5, -21, 26, -12, 4, 4, 23, 4, -27, 15, 5, 15, 11, -1, 0, -28, 8, -26, -22, 27, -3, 6, -19, -28, 27, 8, -13, -30, 3, 25, -9, 2, -5, 26, -2, 7, 11, -22, 26, -6, 8, 22, 24, 7, 8, 8, 28, -22, -12, 5, -2, 1, -8, -30, -20, 4, -17, 22, -6, -25, -4, 27, 20, 25, 8, 14, -26, 20, 3, 1, 18, -27, 3, 4, -20, 9, -30, 3, -26, -21, 0, -24, -20, -18, -28, -28, -18, -25, -14, -3, -15, 25, 3, -16, -24, -13, 13, -12, 27, -26, 9, 15, 23, 17, -14, -20, -2, 15, 0, 3, 6, 9, 26, 18, -11, 27, 19, 16, 3, 9, 7, -12, 15, 7, 26, 28, 1, -3, -19, 27, -27, -29, 8, 22, 9, -15, -3, -17, 25, 15, -16, 20, -28, 28, 22, 28, 16, -27, -21, -17, -17, 24, -10, -16, -27, -18, -25, -13, 25, 11, 28, -7, 7, 6, 23, -27, -19, 13, 25, -23, -14, -21, 4, -10, 0, -24, 26, 5, -6, 6, -27, 23, -30, 10, 19, -12, 10, 15, -5, -15, -2, 7, -1, -17, -14, 10, 29, -24, -7, 2, 21, -19, -8, -27, -3, 22, -5, -6, 8, 26, 10, -17, 12, -6, 9, 3, 7, -26, -26, 4, 6, 2, 23, 7, 13, -20, -19, 5, 3, 0, -10, -21, 25, -20, -20, -22, 6, -18, 19, 22, -13, -21, 17, 4, -22, 19, 6, 5, 25, -17, 6, 18, 19, 11, 23, 3, 6, 22, 24, -15, -27, -5, -12, -27, 14, -22, 26, -26, -11, -20, -7, 18, 19, 23, -25, 17, -27, 22, 22, -13, -23, -6, -18, 25, 7, -13, -24, -6, -1, 18, 13, -12, 3, 11, -20, 10, -13, 18, 25, -7, -8, -17, 17, -3, 5, 16, 23, 17, -18, 27, 26, -10, 20, 5, -11, 5, -29, 18, 29, 12, 2, -21, -11, -4, 12, -5, 24, 5, -20, 25, 9, 3, -8, 2, 19, 20, 24, -1, -3, -2, -27, 19, 24, 28, 13, 17, 16, 13, -12, -8, 5, -14, 21, -2, -25, 6, 9, -13, 1, -12, 26, -13, 15, -21, 13, 4, 16, 5, -24, 15, -14, 15, 14, -28, 21, 1, -8, 21, -25, -5, -23, -15, -18, -25, -24, 7, 25, -18, -22, 15, 4, -25, -17, -9, -1, 15, 6, 26, 22, 15, 17, -22, -2, 15, -28, -16, -14, -20, 17, -18, -4, 6, 17, -19, 7, 0, -3, -26, 15, 12, -5, -25, -21, 26, 17, 14, -28, 13, 13, 29, 2, 7, -12, 1, 28, -1, -20, -30, -15, 5, 25, -20, -18, -15, -25, -23, 24, 16, -2, -26, -22, 16, -20, -5, -20, 18, -28, -24, 7, -17, -12, -22, 17, 29, -8, 11, 25, -4, -26, -18, 20, -23, -29, 27, 27, 17, 20, 7, -11, -9, -26, -5, 5, -6, -16, -4, 13, 11, -6, -20, 19, -9, 8, 12, -15, 3, 25, -23, 0, -24, 6, -24, -23, -1, -5, 22, -29, 7, -20, -7, 18, -18, -18, 15, 17, -7, -12, 29, -12, -28, -11, -25, 28, 19, -16, -25, 23, -25, 8, -13, -18, -28, -17, -15, 6, -5, -27, 18, 15, -11, -30, 6, 23, 8, -4, 4, -14, -29, 12, 18, 11, 1, 12, 4, 24, 5, -14, -29, -4, -11, 4, 16, -30, -16, 23, -21, -19, 6, 26, 22, 19, -8, 27, -14, -8, -6, -30, -26, 27, -26, -28, -25, 8, 10, -4, -15, 0, 22, -20, -20, 10, -17, -11, 13, 9, 8, 24, -16, -16, -8, 25, 3, 22, -8, 24, -6, 9, -29, 20, -9, 24, -8, 23, -8, 22, -4, 15, 0, 19, 10, 27, 26, 23, 20, 15, 18, -22, 4, -18, -18, -30, 7, -21, 5, -12, 25, -9, -4, -30, -4, 20, -19, 22, 3, 18, 17, 8, -13, -17, 9, 7, 25, 11, -10, -27, -3, -17, 10, -30, -24, -29, -21, -2, -3, 2, -25, 26, -9, -12, 18, -17, 15, 20, 9, 21, -24, 5, 7, -28, 18, 8, -11, 16, -26, 3, 3, 6, -16, -12, 18, 4, -17, -19, 10, 22, -6, 20, 6, 28, 2, -15, 7, -20, 11, 3, -22, -20, -25, 28, 5, -11, -23, 20, 16, 23, -5, 5, 8, -23, 25, 6, 26, -7, -13, -2, -8, 29, 17, 20, -14, -15, 17, -20, -14, -27, 21, 29, -11, -20, 8, 19, -18, -1, 29, 5, 14, 23, 15, 7, 11, -15, 15, 10, 9, 16, 26, -8, -29, 7, 6, -9, -30, -6, 18, -2, -10, 18, -29, -1, -23, 24, 23, -15, -4, -3, -19, 22, 18, -27, -11, 14, 8, 4, -6, 10, -12, -10, 21, 7, -15, -21, 2, 12, 3, -30, -9, -25, 8, 19, 5, 12, -12, -15, -12, -9, 19, -7, 17, 0, 5, 17, -1, 22, 13, -27, 15, -28, -29, 23, -19, 13, -8, 23, 12, -13, -15, -18, -26, -22, -3, -7, 2, -4, 24, 2, 11, 21, -27, 26, 14, 13, 14, -30, 19, -22, -29, -1, -27, -4, 25, -14, -12, 4, -6, -18, -11, -8, -5, 29, 9, -11, 22, -10, 10, -8, 5, 12, -21, 27, -1, 28, -21, 15, 26, -16, 10, -17, 7, -24, 0, -20, -13, 3, 15, -19, -18, -8, -12, 20, 10, -8, 25, 26, -11, 23, 14, -1, -7, -22, -22, -16, -2, 19, -27, 5, 17, 28, 20, 17, -12, -13, -7, 22, 17, -8, -2, 28, 5, 29, -27, -15, -2, 26, -30, -6, -4, 16, 25, 5, -19, 1, -14, -6, 29, -13, 27, 20, 7, 10, 21, 12, 10, -12, -21, -10, -2, -18, -11, -15, 1, -11, 21, 6, 26, 20, -24, 29, 6, 26, -5, -18, -12, -16, -11, 11, -24, 4, 13, 15, -9, -3, 17, -16, 5, -17, -25, -30, -21, 15, -16, 27, -5, -4, -25, 28, 7, 17, 27, -18, -20, -9, 13, 3, -12, -16, -23, 19, -9, 10, 0, -22, -23, 10, -20, -4, 25, 28, -8, -20, 7, -1, -26, -12, 8, -22, 24, 21, -15, -26, -5, 10, 24, -27, -5, -1, -30, 29, 23, 28, -10, -27, -16, 13, -1, 12, -10, 13, 14, -30, -5, -25, 19, -19, 13, 26, 27, 3, 3, 28, 3, -9, 8, 6, 23, -2, -9, -26, 22, -2, 19, 12, -19, -15, 15, 9, -29, -24, 27, -1, -15, -17, 11, 11, -1, 14, -29, -19, 24, -29, -4, -15, -26, -21, 9, -1, -22, -17, -9, -28, -1, -29, 9, 25, 13, 14, -29, -23, -22, 1, -14, 26, -27, -14, 12, 13, 11, 1, 14, -1, 11, -14, -16, -3, 5, 2, -8, -12, 0, 17, -5, -6, -6, 25, -19, 21, 25, 12, 4, 21, -9, 8, -11, -30, 26, 19, 15, 20, 18, -13, 0, -30, 8, -16, -2, -17, 2, 17, -21, -25, 5, 26, 26, 23, -6, -28, 11, -16, 1, -5, 13, -14, 7, 0, -10, -30, -16, -29, -25, 12, -15, -9, -2, 15, 4, -18, 27, 19, -26, 4, -17, 18, -15, -24, 24, -17, -16, 19, -30, -20, 13, 20, 18, -14, -26, -22, 10, 23, 27, -28, 5, -6, -21, 26, -3, 10, 1, 26, -18, 9, 16, -6, 13, -29, 8, 6, -30, -1, 20, -30, 0, 23, 1, -23, 20, -25, -29, 29, 29, 21, -13, -5, 3, -16, -18, 24, 7, 27, -27, -11, -21, 14, 10, 0, 15, 26, -9, 23, -13, -6, 22, -9, -9, -6, -7, -25, 6, -7, 19, 22, -24, 28, 29, 4, 16, 28, 23, 0, -3, 21, -1, 3, -25, -19, -19, 17, -22, 9, 28, -11, 28, -4, -3, -25, 21, -23, -30, 10, 25, -18, 10, 17, -15, 27, 19, 3, 18, -30, 29, 6, -26, 10, 27, 21, 1, -26, -20, -10, -6, 26, -3, -13, 0, -2, 22, 4, -28, -8, -26, -29, 8, -12, -13, 29, 4, 3, 3, -12, -7, 28, 26, -29, 28, -20, -15, -19, 26, 26, -27, 14, -5, -6, 21, -28, 15, -30, -20, -26, -7, -26, 27, 24, -9, -10, -21, 26, -5, -16, 0, 23, -3, -20, -5, 15, -10, -4, -2, 16, 17, -17, -3, -22, -27, 25, 28, -26, -6, -14, -8, -19, -24, -8, 12, -26, -13, -7, 10, 29, -7, -10, -30, 13, 15, 21, -1, 5, 7, 1, 8, 7, -2, -13, 15, -19, 15, 23, 10, 20, 28, 22, -2, -1, 25, -22, 9, -22, 3, -8, -5, 10, 18, -7, 2, 4, -1, -4, -17, 29, 29, 29, -27, -16, -18, -14, -3, -12, 19, -9, -1, -2, -14, 16, -15, 7, -4, 24, -5, -14, -29, -21, -21, 12, 17, 20, -10, -3, -16, 19, 7, -28, -22, -30, -28, -3, -23, 11, 8, 14, 11, 19, 24, -12, -25, 10, 2, -13, 9, 10, -12, -8, 20, -14, 14, 8, 24, -28, 0, 1, 14, -28, 2, -6, 4, -19, -19, -28, 21, -3, 15, -28, 25, -27, 8, 25, -29, -17, 9, -21, -20, -21, 6, -22, -6, -30, -13, -27, 25, 21, 26, 6, -19, -1, 29, -30, -23, 29, 12, -5, -8, -25, 19, 18, -1, 25, -9, 3, 15, 0, -2, 28, -19, -24, -17, 26, -12, 17, 23, 7, 21, -25, 2, 6, 10, 18, -4, 21, -14, -8, -27, 24, 26, -2, 20, -29, -14, 13, 16, 21, -26, -9, -20, 9, -5, -7, 13, -26, 2, -30, 13, -12, 12, -27, 27, -9, -19, 7, -9, -2, -5, -16, 29, 25, 26, 0, 6, 27, -22, -1, -22, -1, 13, -10, 15, -29, 24, 14, 27, -28, -16, 10, 3, 9, -22, -8, -22, -25, -7, -3, 5, 26, -28, 14, 15, 28, 4, 4, 20, -5, -13, 20, -30, 5, -25, -23, -11, -14, -14, 14, 21, 3, -25, -21, 19, -19, 11, -28, 9, -4, -30, -3, -18, -8, -15, -6, -10, -17, -23, -2, 22, -1, -11, 28, 9, 3, -20, -6, 8, 5, 14, 26, 24, -22, -17, -24, -15, -10, 19, 13, -10, -8, 21, -7, 12, -19, 25, 16, 4, -7, 28, 23, -30, -2, 4, 27, 8, 13, -23, 3, 24, -15, -20, 10, 2, 11, 7, 21, -2, 20, -30, 19, 11, 5, 5, -29, 21, 28, -18, 19, -28, 29, 9, -18, -26, -12, 12, -15, -6, -13, 29, 23, 7, -23, -19, -30, -11, -11, -25, 19, -26, -28, -28, 25, -2, 29, 6, 3, -19, -18, 27, 20, 23, 25, -27, 27, -30, -25, 28, 13, -25, -30, 1, -14, -9, -15, 27, 2, 28, 28, -20, 8, 1, -19, -8, -4, 6, 10, -11, 27, -18, -9, 27, 7, -1, -12, -16, 3, -28, -8, -22, 20, -5, -16, 16, 17, 20, -29, 22, -3, -1, -5, -11, 18, 2, -12, 8, 4, 15, -14, 5, 25, 17, -18, -17, -12, -10, 18, -7, 8, -30, -22, -28, -10, -30, 14, -5, -9, 16, -24, -16, 0, 2, 4, -14, 9, -2, 1, -6, -7, 10, -20, -1, 0, 25, 27, -24, 3, -10, 27, -8, 12, 8, 6, 16, -14, -24, 4, 5, 12, -7, -9, 8, 3, 9, 10, -8, 24, 12, -13, 8, 10, -23, 4, 10, 16, 20, 7, 8, -29, -11, -29, 21, 23, 20, 23, 12, -26, -14, 10, -2, 21, -29, 5, 18, 10, -27, -11, -22, -25, 1, 14, -12, 1, -26, -11, -13, -2, 7, 10, -24, -15, -26, 1, 13, 23, 8, -26, 29, 8, -13, -11, -21, 5, -25, 13, -7, 20, 28, 5, 25, 22, -23, 7, -21, 4, -8, 9, -24, 13, 22, 19, 24, -27, 2, 23, 28, -22, 0, 14, 3, -27, -1, -17, 27, 12, -19, 13, 3, 23, 0, -26, 28, -15, 0, 2, -11, 4, -26, 3, 8, -15, -12, 2, -12, -25, 15, 4, 4, 11, -18, 9, 6, 5, 26, -11, -22, 6, 17, -23, -14, -7, -24, -28, -25, -3, -15, 18, 10, -20, 15, -17, -16, 11, 22, 13, 4, 6, -10, -12, 28, 15, 0, 19, -30, -5, 8, 16, -23, 4, -18, 10, -1, -25, -8, -21, -13, 5, -19, -8, -6, 6, 0, 13, 7, 17, 12, -3, -17, -21, 16, -17, -3, 13, 10, -27, -1, -16, 9, 18, -1, 5, -19, 11, 14, -12, -3, -1, -16, 22, -9, 19, -11, 28, -14, -19, 2, 22, 9, 9, 23, 22, 0, 1, 21, 5, -3, 10, -3, -8, -6, 13, 25, -19, 26, 9, -29, -26, 13, -28, 20, -2, 20, 12, 6, 3, 22, -13, -29, -5, -22, -2, -14, -17, -2, 7, 24, 27, 17, -21, 7, -21, 9, 19, 26, -28, 8, -20, -26, -9, 22, -2, 1, -9, -28, 26, 15, -13, -29, -25, -11, -23, 2, 15, 6, -14, -18, -9, -4, -17, -30, -12, 7, -19, -8, 14, -29, -17, 0, -5, -29, 4, 14, 25, -29, 4, -6, 18, 10, 7, 0, -19, 21, 29, 2, 21, 17, -26, 16, 22, -24, 18, 19, -4, 19, 29, -6, 0, 23, -23, 17, 18, -30, 4, 23, 17, 17, 14, -5, -9, -19, 4, 23, 9, -14, 23, 18, 19, 4, 20, 17, 24, 13, 11, -3, -16, 29, 9, 11, 23, 26, -18, 24, 7, 19, 13, -20, 14, 11, -4, 19, 6, 22, -2, 8, -5, -15, 29, 14, 23, -8, 16, -21, 29, 5, 15, 16, 3, 15, -25, 27, -23, -11, 15, 17, -29, -27, 13, 13, -11, 6, 18, 9, -2, 26, -11, -15, 11, 5, 17, -3, 25, 11, 6, -20, -19, 8, -7, -9, -27, 22, -21, -25, -28, -5, -17, -24, -28, 26, -3, 11, -28, 21, -16, -18, 4, -15, 29, 7, 5, -26, 22, -12, 14, 14, 21, -25, 29, -27, -4, -29, 24, 10, 27, 29, -5, 21, -22, -4, -6, -28, 1, -24, -4, 25, 11, -26, 16, -13, -11, 19, -15, 17, -4, 10, -11, 16, -18, -8, -21, -8, -13, -9, 5, -5, -7, -29, -7, 22, -23, -26, 12, 13, 17, -18, 14, 1, 25, 28, 17, 20, 15, -12, 11, 5, -28, -28, 3, 11, 17, 23, -20, 1, 23, -4, 23, 13, -26, 0, -12, 22, 18, -19, -1, -29, -12, -4, -8, 9, -27, -11, -9, 4, -11, 2, -8, -17, -27, -10, 0, 18, -14, 21, -11, -18, 22, -18, -13, 12, -22, 28, 27, -30, 23, -22, -2, -17, -16, -2, -21, 2, -4, 9, 23, -13, -25, -7, 6, -22, 7, -29, -21, 28, 1, -4, -12, -12, -25, -11, -8, 19, -27, -5, -14, -15, -24, 1, -30, 29, 3, 24, 8, -25, -8, 7, 5, 4, -13, 1, 2, -30, -6, 9, 17, -13, -11, -26, 11, -15, -5, -4, 12, -28, -10, -6, -16, 8, 23, 5, 27, 29, 5, 6, -23, 8, 16, 16, 0, -23, 11, 27, 25, 4, 15, 17, -19, -27, -17, -18, 24, 8, 16, 11, 3, -27, -5, -29, -21, 2, -22, -13, -17, 19, -20, 24, -28, -30, 0, 0, 9, -16, 12, -11, 9, 7, -7, 10, -21, -28, -13, 20, -7, 22, -4, -24, 14, 12, -2, 0, -10, -21, 12, -1, 13, 10, -14, -17, 3, -19, 13, -10, 3, -13, 10, 13, 7, -8, -12, -30, 12, -18, -11, 24, -12, -6, -2, -19, -16, 19, 3, -12, -19, 20, 6, -28, 27, 28, 12, -30, 0, 28, -30, -21, -17, -8, 25, 10, 16, -10, -11, 10, -24, 4, 13, -30, 3, -28, 23, -5, -18, -25, 12, -1, 16, 12, -14, 3, 29, 8, -30, 21, 5, -29, -21, -25, -28, -8, 20, 12, -22, -27, 11, -11, 14, 22, 2, 7, -16, 21, -2, -23, 20, -28, 3, 29, -5, -20, -22, 20, -16, -7, 24, -16, 20, 18, 0, -15, -29, -17, 5, -21, 7, -30, 22, 28, -29, 28, 21, 10, -19, -7, 27, 4, 1, -2, 5, -26, -14, 15, 26, -13, 20, -20, -23, -5, 0, 18, 2, 2, 19, 29, 22, -20, -27, 20, -14, -13, -5, -10, 26, -10, -7, -22, -6, -12, 29, 9, -14, -1, -7, 25, 8, -25, 12, -14, -1, 22, 24, -29, -16, -3, 9, 26, 28, 29, -10, 24, -28, 9, 16, -29, -16, 13, 7, 6, 0, -12, -3, -27, -30, 18, 4, -13, -14, -12, 20, 1, 12, -10, -6, -4, -22, 11, -24, -26, 22, -4, 4, 21, -17, 27, 5, 5, 5, 14, -23, -7, 24, -19, 17, -6, 0, 17, 15, -28, 7, 28, -30, -30, 24, 10, 1, -3, 1, 20, 5, 12, 26, 12, -3, 19, 7, 1, -24, -5, 7, -2, 10, -26, -26, 7, 16, 4, 2, 27, -2, 17, -9, 13, -5, -15, -23, 5, -8, 15, 24, -12, -5, 2, -6, -23, -24, -25, 29, 22, -15, -16, -21, 3, 5, -7, 10, -3, -13, -26, -10, 24, 9, 9, -17, -5, 5, -26, 13, -15, 5, -3, -5, 10, 3, 23, 3, -21, 4, 25, 19, -25, -15, -15, -15, 3, 8, -5, 25, -4, -23, 10, 29, 24, 1, 24, 6, -17, 4, 17, 5, -14, -13, -1, -30, -5, 21, -2, -28, 10, -9, 7, -25, 15, 12, 3, 0, 16, 22, 19, 2, -4, -21, -22, -2, -12, 28, 15, 12, -27, 27, -11, 29, -10, 22, 26, -26, -30, 16, 0, 7, -5, 4, 7, -19, -24, -3, -8, -10, 0, -25, -26, -19, 20, 20, 11, 3, -18, 23, -6, -2, -7, 11, -20, -15, 6, 26, 5, -14, -11, -8, 17, -30, 4, -13, -3, -4, -20, -4, 13, -3, -22, 23, 11, 27, 17, 17, -19, -30, -8, 10, -5, 3, -6, -28, -7, -15, -17, -17, -27, 22, 29, -6, 14, 6, 23, -13, 24, 3, -21, -6, 14, -7, 19, 14, -18, -17, 7, -11, 1, -24, -7, -10, 0, 11, 13, -20, -17, 4, -16, -7, 1, 15, -11, -18, -23, -13, 3, -10, 0, 5, 15, -25, 7, 4, 13, -16, -12, 21, -7, -7, -16, -4, -7, 29, -3, 26, -14, -14, -1, 23, 25, 4, -3, 27, 3, 7, 15, 21, -8, -17, -30, 15, 29, -6, -25, 13, 17, 17, 8, -10, -20, -23, -27, 4, -8, 0, 25, -7, 4, 4, 18, -26, 22, 0, 10, 0, 8, -26, -1, -5, 15, 14, -23, 7, 12, -16, 16, 3, 20, -27, -5, 16, 0, -28, -13, 26, -10, 24, 20, -5, -12, 14, 26, 0, 19, 9, -28, -26, 3, 10, 3, -18, 18, -29, -7, 24, -26, 16, -15, 19, 9, 4, -12, -27, 12, 14, -6, -5, 12, 27, 15, 16, 29, -27, -4, -21, 12, 15, 21, -13, -19, 12, -30, 14, -9, 2, -13, -14, 8, 7, 9, -15, 0, 26, 11, -23, -7, -16, 26, 7, -8, 19, 17, -4, -11, 1, 20, 13, 10, -10, -9, -19, -26, 27, 3, -5, -12, 11, -5, 18, -2, 4, 18, 12, -19, 7, -15, -10, 7, 26, -10, -10, -24, 14, 11, -12, -15, -19, -30, -29, 12, -6, 2, -16, -19, 0, -16, 16, -21, -14, 23, -1, -5, -4, 22, 22, 24, 19, 5, 2, 29, -13, 19, 3, -29, 14, 12, 27, 24, 21, 9, 25, -26, -9, 13, 22, -5, -6, 15, -17, 3, 27, -18, 29, -8, -10, -22, -7, -14, -6, 0, 24, 24, 3, -22, -1, -15, 21, 0, 25, 4, -18, -9, 10, -16, 17, -16, 21, 12, -30, -22, 6, -8, -18, -27, -27, 28, -9, -2, -30, 21, 5, 1, 5, 11, -25, 9, -6, -17, 17, 8, -29, 10, 0, -25, 19, -30, -3, -12, -4, 27, -29, -1, 22, 23, -21, 10, 29, 28, 2, -6, 12, -9, 22, -12, -5, -17, -25, -11, 28, 3, -15, -21, 20, 13, -10, -12, 1, 28, 25, -16, -5, -7, -22, 15, 26, -14, -10, -24, 27, -24, -24, 14, -11, 7, -6, -10, 8, 4, -2, -26, -7, 7, 20, -7, -12, 11, -7, 0, 1, 19, -2, -15, 19, -10, 23, 10, -4, 3, 7, 0, 23, -20, -7, -14, 3, 9, -6, -2, 28, 26, 29, 8, 4, 25, 4, 23, -24, 17, 0, -15, -6, 29, 25, -6, 19, -15, -11, -20, -6, 13, -9, 17, 7, -9, 4, 18, -25, 25, -20, -3, 5, 0, 3, 7, -14, 23, 0, 9, -26, -30, 28, 24, -10, 0, -28, -21, -13, 23, -28, -3, -19, -12, -20, -24, 9, 21, 21, -26, 29, 12, 21, -18, -19, 7, 1, -1, -21, 4, -12, 22, 24, 20, 12, 9, 7, 11, -16, -27, 11, -16, -7, 12, -19, -16, -29, 28, 24, -4, 9, 21, 8, -16, -2, 18, -9, -22, -2, 24, -1, 17, 15, -18, 26, -16, -27, 24, -9, 26, 18, 3, -12, -21, -20, -13, 25, -3, 16, -3, -7, 18, -4, 25, -22, -9, 25, -21, -9, -18, -13, 1, 17, 20, 19, 25, -22, 9, -10, 1, 2, 13, -12, 1, -3, -3, 16, 28, 15, 0, -4, -12, -30, 8, 1, -24, 5, 28, 24, -20, -2, 3, -1, 0, -22, 14, 27, 8, 2, -12, -28, 12, -18, 17, 0, 16, -14, -10, 22, -19, 1, -13, -7, -12, 25, 13, 21, -13, -6, -5, -19, 18, -13, -28, -1, -13, 22, 20, 7, -9, -15, -11, -17, -27, 5, 21, 28, 20, 12, 25, 25, 4, -12, 28, 17, -14, -2, -6, -25, 15, 29, 8, -10, -5, 6, -9, -29, -29, 25, 9, -17, 1, -4, -29, 18, 23, 4, -20, 14, 4, 18, -13, 6, -13, 19, -6, 10, 21, -17, -5, -16, 26, -27, 3, 21, -21, 28, 25, -26, -28, 23, -11, 15, 10, -27, 19, -27, -12, -17, 0, -24, 8, 8, -24, 0, 12, 4, -27, -3, -7, -26, 15, -29, -27, -25, 25, 20, 5, -29, -23, 0, 27, 23, 0, -1, -2, 6, -7, 13, 6, 10, 28, 24, 8, -14, -9, -8, 24, -3, -11, -1, 27, 6, -29, 17, 0, 19, 9, -11, -7, -26, -27, 10, 26, -6, -10, -1, -14, 19, 28, 22, 19, 8, 20, -3, 5, 13, 21, -7, -21, -25, 2, -26, -17, 28, 7, 25, -1, 9, -14, -6, -24, 26, -30, 4, 26, -4, 20, -21, -22, 6, 17, -17, 21, -25, -23, 18, -13, 16, 29, 8, -27, -26, 9, -16, 15, -30, -2, -16, -7, 29, -2, 2, -3, 5, -21, 13, 10, 5, 4, 15, -19, 9, -24, 28, 17, 9, 21, -19, -3, -1, 17, 24, 5, -14, -23, -8, -19, -10, -7, 25, 4, -6, 24, -12, -19, 17, -11, 26, 8, -16, 28, -29, 27, 15, 20, 22, 15, 11, 26, 9, -21, 3, -6, -22, -23, 14, 2}, -52, 2, 289392}, + {[]int{-2, 5, -1}, -2, 2, 3}, + {[]int{}, -2, 2, 0}, + // 可以有多个 testcase +} + +func Test_countRangeSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countRangeSum(tc.nums, tc.lower, tc.upper), "输入:%v", tc) + } +} + +func Benchmark_countRangeSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countRangeSum(tc.nums, tc.lower, tc.upper) + } + } +} diff --git a/Algorithms/0328.odd-even-linked-list/README.md b/Algorithms/0328.odd-even-linked-list/README.md new file mode 100755 index 000000000..8fcacfc9c --- /dev/null +++ b/Algorithms/0328.odd-even-linked-list/README.md @@ -0,0 +1,25 @@ +# [328. Odd Even Linked List](https://leetcode.com/problems/odd-even-linked-list/) + +## 题目 + +Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. + +You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity. + +Example: + +```text +Given 1->2->3->4->5->NULL, +return 1->3->5->2->4->NULL. +``` + +Note: + +1. The relative order inside both the even and odd groups should remain as it was in the input. +1. The first node is considered odd, the second node even and so on ... + +Credits:Special thanks to @DjangoUnchained for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0328.odd-even-linked-list/odd-even-linked-list.go b/Algorithms/0328.odd-even-linked-list/odd-even-linked-list.go new file mode 100755 index 000000000..740500bcb --- /dev/null +++ b/Algorithms/0328.odd-even-linked-list/odd-even-linked-list.go @@ -0,0 +1,30 @@ +package problem0328 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func oddEvenList(head *ListNode) *ListNode { + if head == nil { + return head + } + + // oe: odd end 指向 odd group 的最后一个 node + oe := head + // eb: even begin 指向 even group 的第一个 node + eb := head.Next + // ee: even end 指向 even group 的最后一个 node + ee := eb + + for ee != nil && ee.Next != nil { + oe.Next = ee.Next + oe = oe.Next + ee.Next = oe.Next + ee = ee.Next + oe.Next = eb + } + + return head +} diff --git a/Algorithms/0328.odd-even-linked-list/odd-even-linked-list_test.go b/Algorithms/0328.odd-even-linked-list/odd-even-linked-list_test.go new file mode 100755 index 000000000..0b715eba2 --- /dev/null +++ b/Algorithms/0328.odd-even-linked-list/odd-even-linked-list_test.go @@ -0,0 +1,50 @@ +package problem0328 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{1, 2, 3, 4, 5}, + []int{1, 3, 5, 2, 4}, + }, + + { + []int{1, 2, 3, 4, 5, 6}, + []int{1, 3, 5, 2, 4, 6}, + }, + + { + []int{}, + []int{}, + }, + // 可以有多个 testcase +} + +func Test_oddEvenList(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.head) + ast.Equal(tc.ans, kit.List2Ints(oddEvenList(head)), "输入:%v", tc) + } +} + +func Benchmark_oddEvenList(b *testing.B) { + head := kit.Ints2List([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9}) + for i := 0; i < b.N; i++ { + oddEvenList(head) + } +} diff --git a/Algorithms/0329.longest-increasing-path-in-a-matrix/README.md b/Algorithms/0329.longest-increasing-path-in-a-matrix/README.md new file mode 100755 index 000000000..0db16bbcc --- /dev/null +++ b/Algorithms/0329.longest-increasing-path-in-a-matrix/README.md @@ -0,0 +1,37 @@ +# [329. Longest Increasing Path in a Matrix](https://leetcode.com/problems/longest-increasing-path-in-a-matrix/) + +## 题目 + +Given an integer matrix, find the length of the longest increasing path. + +From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside of the boundary (i.e. wrap-around is not allowed). + +Example 1: + +```text +nums = [ + [9,9,4], + [6,6,8], + [2,1,1] +] +Return 4 +The longest increasing path is [1, 2, 6, 9]. +``` + +Example 2: + +```text +nums = [ + [3,4,5], + [3,2,6], + [2,2,1] +] +Return 4 +The longest increasing path is [3, 4, 5, 6]. Moving diagonally is not allowed. +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix.go b/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix.go new file mode 100755 index 000000000..aba07a01b --- /dev/null +++ b/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix.go @@ -0,0 +1,56 @@ +package problem0329 + +func longestIncreasingPath(mat [][]int) int { + if len(mat) == 0 || len(mat[0]) == 0 { + return 0 + } + + m, n := len(mat), len(mat[0]) + + // path[i][j] 从 (i,j) 点出发的最长路径长度 + path := make([][]int, m) + for i := range path { + path[i] = make([]int, n) + } + + res := 0 + dx := []int{-1, 1, 0, 0} + dy := []int{0, 0, -1, 1} + + var dfs func(int, int) int + dfs = func(x, y int) int { + if path[x][y] > 0 { + // 已经访问过 (x,y) 点了,可以直接返回历史记录 + return path[x][y] + } + + path[x][y] = 1 + + for i := 0; i < 4; i++ { + nx := x + dx[i] + ny := y + dy[i] + if 0 <= nx && nx < m && + 0 <= ny && ny < n && + mat[x][y] < mat[nx][ny] { + path[x][y] = max(path[x][y], dfs(nx, ny)+1) + } + } + + return path[x][y] + } + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + res = max(res, dfs(i, j)) + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix_test.go b/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix_test.go new file mode 100755 index 000000000..ad43ca2e4 --- /dev/null +++ b/Algorithms/0329.longest-increasing-path-in-a-matrix/longest-increasing-path-in-a-matrix_test.go @@ -0,0 +1,88 @@ +package problem0329 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans int +}{ + + {[][]int{ + []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, + []int{19, 18, 17, 16, 15, 14, 13, 12, 11, 10}, + []int{20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, + []int{39, 38, 37, 36, 35, 34, 33, 32, 31, 30}, + []int{40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, + []int{59, 58, 57, 56, 55, 54, 53, 52, 51, 50}, + []int{60, 61, 62, 63, 64, 65, 66, 67, 68, 69}, + []int{79, 78, 77, 76, 75, 74, 73, 72, 71, 70}, + []int{80, 81, 82, 83, 84, 85, 86, 87, 88, 89}, + []int{99, 98, 97, 96, 95, 94, 93, 92, 91, 90}, + []int{100, 101, 102, 103, 104, 105, 106, 107, 108, 109}, + []int{119, 118, 117, 116, 115, 114, 113, 112, 111, 110}, + []int{120, 121, 122, 123, 124, 125, 126, 127, 128, 129}, + []int{139, 138, 137, 136, 135, 134, 133, 132, 131, 130}, + []int{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + 140, + }, + + {[][]int{}, 0}, + + {[][]int{ + []int{9, 9, 4}, + []int{6, 6, 8}, + []int{2, 1, 1}, + }, + 4, + }, + + {[][]int{ + []int{3, 4, 5}, + []int{3, 2, 6}, + []int{2, 2, 7}, + }, + 5, + }, + + {[][]int{ + []int{3, 4, 5}, + []int{10, 11, 6}, + []int{9, 8, 7}, + }, + 9, + }, + + {[][]int{ + []int{7, 8, 9}, + []int{9, 7, 6}, + []int{7, 2, 3}, + }, + 6, + }, + + // 可以有多个 testcase +} + +func Test_longestIncreasingPath(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestIncreasingPath(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_longestIncreasingPath(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestIncreasingPath(tc.matrix) + } + } +} diff --git a/Algorithms/0330.patching-array/README.md b/Algorithms/0330.patching-array/README.md new file mode 100755 index 000000000..49a398c98 --- /dev/null +++ b/Algorithms/0330.patching-array/README.md @@ -0,0 +1,31 @@ +# [330. Patching Array](https://leetcode.com/problems/patching-array/) + +## 题目 + +Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required. + +```text +Example 1: +nums = [1, 3], n = 6 +Return 1. + +Combinations of nums are [1], [3], [1,3], which form possible sums of: 1, 3, 4. +Now if we add/patch 2 to nums, the combinations are: [1], [2], [3], [1,3], [2,3], [1,2,3]. +Possible sums are 1, 2, 3, 4, 5, 6, which now covers the range [1, 6]. +So we only need 1 patch. + +Example 2: +nums = [1, 5, 10], n = 20 +Return 2. +The two patches can be [2, 4]. + +Example 3: +nums = [1, 2, 2], n = 5 +Return 0. +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0330.patching-array/patching-array.go b/Algorithms/0330.patching-array/patching-array.go new file mode 100755 index 000000000..e27b0afd9 --- /dev/null +++ b/Algorithms/0330.patching-array/patching-array.go @@ -0,0 +1,29 @@ +package problem0330 + +// nums 是升序排列的 +func minPatches(nums []int, n int) (count int) { + var max, i int + + // nums[:i] 的所有 子数组 的和的集合,等于 max + // nums[:i+1] --> max+nums[i] + max += nums[i] + i++ + } else { + // 此时 + // nums[i] > max + // 如果还 max += nums[i] 的话 + // 会导致 x ∈ [max, nums[i]) 无法获取 + // 需要添加 max 来实现,来让 自然数的集合达到 [1, 2*max) + max <<= 1 + count++ + } + } + + return +} diff --git a/Algorithms/0330.patching-array/patching-array_test.go b/Algorithms/0330.patching-array/patching-array_test.go new file mode 100755 index 000000000..08929b51b --- /dev/null +++ b/Algorithms/0330.patching-array/patching-array_test.go @@ -0,0 +1,54 @@ +package problem0330 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + n int + ans int +}{ + + {[]int{1, 3}, 6, 1}, + + {[]int{1, 5, 10}, 20, 2}, + + {[]int{1, 2, 2}, 5, 0}, + + {[]int{1, 2, 2, 2}, 7, 0}, + + {[]int{1, 2, 2}, 7, 1}, + + {[]int{1, 2, 31, 33}, 2147483647, 28}, + + {[]int{1, 2, 14, 15, 17, 18}, 2147483647, 27}, + + {[]int{1, 2, 14, 15, 17, 18}, 65, 2}, + + + {[]int{1, 2, 63 }, 65, 4}, + + // +} + +func Test_minPatches(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minPatches(tc.nums, tc.n), "输入:%v", tc) + } +} + +func Benchmark_minPatches(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minPatches(tc.nums, tc.n) + } + } +} diff --git a/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/README.md b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/README.md new file mode 100755 index 000000000..24585296a --- /dev/null +++ b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/README.md @@ -0,0 +1,41 @@ +# [331. Verify Preorder Serialization of a Binary Tree](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/) + +## 题目 + +One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as #. + +```text + _9_ + / \ + 3 2 + / \ / \ + 4 1 # 6 +/ \ / \ / \ +# # # # # # +``` + +For example, the above binary tree can be serialized to the string "9,3,4,#,#,1,#,#,2,#,6,#,#", where # represents a null node. + +Given a string of comma separated values, verify whether it is a correct preorder traversal serialization of a binary tree. Find an algorithm without reconstructing the tree. + +Each comma separated value in the string must be either an integer or a character '#' representing null pointer. + +You may assume that the input format is always valid, for example it could never contain two consecutive commas such as "1,,3". + +```text +Example 1: +"9,3,4,#,#,1,#,#,2,#,6,#,#" +Return true +Example 2: +"1,#" +Return false +Example 3: +"9,#,#,1" +Return false +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree.go b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree.go new file mode 100755 index 000000000..b7e42fac6 --- /dev/null +++ b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree.go @@ -0,0 +1,21 @@ +package problem0331 + +import ( + "strings" +) + +func isValidSerialization(preorder string) bool { + parts := strings.Split(preorder, ",") + s := make([]string, 0, len(parts)) + for _, p := range parts { + for p == "#" && len(s) > 0 && s[len(s)-1] == "#" { + s = s[:len(s)-1] + if len(s) == 0 { + return false + } + s = s[:len(s)-1] + } + s = append(s, p) + } + return len(s) == 1 && s[0] == "#" +} diff --git a/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree_test.go b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree_test.go new file mode 100755 index 000000000..88f511228 --- /dev/null +++ b/Algorithms/0331.verify-preorder-serialization-of-a-binary-tree/verify-preorder-serialization-of-a-binary-tree_test.go @@ -0,0 +1,84 @@ +package problem0331 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + preorder string + ans bool +}{ + + { + "1,2,#,#,3,4,#,5,6,#,7,#,#,8,#,9,#,#,10,#,#", + true, + }, + + { + "9,#,93,#,9,9,#,#,#", + true, + }, + + { + "#", + true, + }, + + { + "#,3,4,#,#,1,#,#,2,#,6,#,#", + false, + }, + + { + "9,#,92,#,#", + true, + }, + + { + "9,3,4,#,#,1,#,#,2,#,6,#,#", + true, + }, + + { + "1", + false, + }, + + { + "1,2,3,4,5", + false, + }, + + { + "1,#", + false, + }, + + { + "9,#,#,1", + false, + }, + + // 可以有多个 testcase +} + +func Test_isValidSerialization(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isValidSerialization(tc.preorder), "输入:%v", tc) + } +} + +func Benchmark_isValidSerialization(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isValidSerialization(tc.preorder) + } + } +} diff --git a/Algorithms/0332.reconstruct-itinerary/332.100.png b/Algorithms/0332.reconstruct-itinerary/332.100.png new file mode 100644 index 000000000..d3be52be4 Binary files /dev/null and b/Algorithms/0332.reconstruct-itinerary/332.100.png differ diff --git a/Algorithms/0332.reconstruct-itinerary/README.md b/Algorithms/0332.reconstruct-itinerary/README.md new file mode 100755 index 000000000..b91f23e00 --- /dev/null +++ b/Algorithms/0332.reconstruct-itinerary/README.md @@ -0,0 +1,30 @@ +# [332. Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/) + +## 题目 + +Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from JFK. Thus, the itinerary must begin with JFK. + +Note: + +1. If there are multiple valid itineraries, you should return the itinerary that has the smallest lexical order when read as a single string. For example, the itinerary ["JFK", "LGA"] has a smaller lexical order than ["JFK", "LGB"]. +1. All airports are represented by three capital letters (IATA code). +1. You may assume all tickets form at least one valid itinerary. + +```text +Example 1: +tickets = [["MUC", "LHR"], ["JFK", "MUC"], ["SFO", "SJC"], ["LHR", "SFO"]] +Return ["JFK", "MUC", "LHR", "SFO", "SJC"]. + +Example 2: +tickets = [["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]] +Return ["JFK","ATL","JFK","SFO","ATL","SFO"]. +Another possible reconstruction is ["JFK","SFO","ATL","JFK","ATL","SFO"]. But it is larger in lexical order. +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 + +![100](332.100.png) \ No newline at end of file diff --git a/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary.go b/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary.go new file mode 100755 index 000000000..f6eb84b4a --- /dev/null +++ b/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary.go @@ -0,0 +1,45 @@ +package problem0332 + +import "sort" + +func findItinerary(tickets [][]string) []string { + // nexts[k]v: from k to v + nexts := make(map[string][]string, len(tickets)+1) + for _, t := range tickets { + nexts[t[0]] = append(nexts[t[0]], t[1]) + } + + // 对所有的下一站进行排序 + for k := range nexts { + sort.Strings(nexts[k]) + } + + // 路径集合 + route := make([]string, 0, len(tickets)+1) + + var visit func(string) + var next string + visit = func(airport string) { + // 优先访问值靠前的 下一站 + for len(nexts[airport]) > 0 { + next = nexts[airport][0] + nexts[airport] = nexts[airport][1:] + visit(next) + } + // 全部下一站都访问完毕后,把本站添加入路径 + // 所以添加顺序是,先访问的后添加 + route = append(route, airport) + } + + visit("JFK") + + // 逆转 route + i, j := 0, len(route)-1 + for i < j { + route[i], route[j] = route[j], route[i] + i++ + j-- + } + + return route +} diff --git a/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary_test.go b/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary_test.go new file mode 100755 index 000000000..cb3220e96 --- /dev/null +++ b/Algorithms/0332.reconstruct-itinerary/reconstruct-itinerary_test.go @@ -0,0 +1,162 @@ +package problem0332 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + tickets [][]string + ans []string +}{ + + { + [][]string{ + []string{"JFK", "SFO"}, + []string{"JFK", "ATL"}, + []string{"SFO", "ATL"}, + []string{"ATL", "JFK"}, + []string{"ATL", "SFO"}, + }, + []string{"JFK", "ATL", "JFK", "SFO", "ATL", "SFO"}, + }, + + { + [][]string{ + []string{"MUC", "LHR"}, + []string{"JFK", "MUC"}, + []string{"SFO", "SJC"}, + []string{"LHR", "SFO"}, + }, + []string{"JFK", "MUC", "LHR", "SFO", "SJC"}, + }, + + { + [][]string{ + []string{"AXA", "EZE"}, + []string{"EZE", "AUA"}, + []string{"ADL", "JFK"}, + []string{"ADL", "TIA"}, + []string{"AUA", "AXA"}, + []string{"EZE", "TIA"}, + []string{"EZE", "TIA"}, + []string{"AXA", "EZE"}, + []string{"EZE", "ADL"}, + []string{"ANU", "EZE"}, + []string{"TIA", "EZE"}, + []string{"JFK", "ADL"}, + []string{"AUA", "JFK"}, + []string{"JFK", "EZE"}, + []string{"EZE", "ANU"}, + []string{"ADL", "AUA"}, + []string{"ANU", "AXA"}, + []string{"AXA", "ADL"}, + []string{"AUA", "JFK"}, + []string{"EZE", "ADL"}, + []string{"ANU", "TIA"}, + []string{"AUA", "JFK"}, + []string{"TIA", "JFK"}, + []string{"EZE", "AUA"}, + []string{"AXA", "EZE"}, + []string{"AUA", "ANU"}, + []string{"ADL", "AXA"}, + []string{"EZE", "ADL"}, + []string{"AUA", "ANU"}, + []string{"AXA", "EZE"}, + []string{"TIA", "AUA"}, + []string{"AXA", "EZE"}, + []string{"AUA", "SYD"}, + []string{"ADL", "JFK"}, + []string{"EZE", "AUA"}, + []string{"ADL", "ANU"}, + []string{"AUA", "TIA"}, + []string{"ADL", "EZE"}, + []string{"TIA", "JFK"}, + []string{"AXA", "ANU"}, + []string{"JFK", "AXA"}, + []string{"JFK", "ADL"}, + []string{"ADL", "EZE"}, + []string{"AXA", "TIA"}, + []string{"JFK", "AUA"}, + []string{"ADL", "EZE"}, + []string{"JFK", "ADL"}, + []string{"ADL", "AXA"}, + []string{"TIA", "AUA"}, + []string{"AXA", "JFK"}, + []string{"ADL", "AUA"}, + []string{"TIA", "JFK"}, + []string{"JFK", "ADL"}, + []string{"JFK", "ADL"}, + []string{"ANU", "AXA"}, + []string{"TIA", "AXA"}, + []string{"EZE", "JFK"}, + []string{"EZE", "AXA"}, + []string{"ADL", "TIA"}, + []string{"JFK", "AUA"}, + []string{"TIA", "EZE"}, + []string{"EZE", "ADL"}, + []string{"JFK", "ANU"}, + []string{"TIA", "AUA"}, + []string{"EZE", "ADL"}, + []string{"ADL", "JFK"}, + []string{"ANU", "AXA"}, + []string{"AUA", "AXA"}, + []string{"ANU", "EZE"}, + []string{"ADL", "AXA"}, + []string{"ANU", "AXA"}, + []string{"TIA", "ADL"}, + []string{"JFK", "ADL"}, + []string{"JFK", "TIA"}, + []string{"AUA", "ADL"}, + []string{"AUA", "TIA"}, + []string{"TIA", "JFK"}, + []string{"EZE", "JFK"}, + []string{"AUA", "ADL"}, + []string{"ADL", "AUA"}, + []string{"EZE", "ANU"}, + []string{"ADL", "ANU"}, + []string{"AUA", "AXA"}, + []string{"AXA", "TIA"}, + []string{"AXA", "TIA"}, + []string{"ADL", "AXA"}, + []string{"EZE", "AXA"}, + []string{"AXA", "JFK"}, + []string{"JFK", "AUA"}, + []string{"ANU", "ADL"}, + []string{"AXA", "TIA"}, + []string{"ANU", "AUA"}, + []string{"JFK", "EZE"}, + []string{"AXA", "ADL"}, + []string{"TIA", "EZE"}, + []string{"JFK", "AXA"}, + []string{"AXA", "ADL"}, + []string{"EZE", "AUA"}, + []string{"AXA", "ANU"}, + []string{"ADL", "EZE"}, + []string{"AUA", "EZE"}, + }, + []string{"JFK", "ADL", "ANU", "ADL", "ANU", "AUA", "ADL", "AUA", "ADL", "AUA", "ANU", "AXA", "ADL", "AUA", "ANU", "AXA", "ADL", "AXA", "ADL", "AXA", "ANU", "AXA", "ANU", "AXA", "EZE", "ADL", "AXA", "EZE", "ADL", "AXA", "EZE", "ADL", "EZE", "ADL", "EZE", "ADL", "EZE", "ANU", "EZE", "ANU", "EZE", "AUA", "AXA", "EZE", "AUA", "AXA", "EZE", "AUA", "AXA", "JFK", "ADL", "EZE", "AUA", "EZE", "AXA", "JFK", "ADL", "JFK", "ADL", "JFK", "ADL", "JFK", "ADL", "TIA", "ADL", "TIA", "AUA", "JFK", "ANU", "TIA", "AUA", "JFK", "AUA", "JFK", "AUA", "TIA", "AUA", "TIA", "AXA", "TIA", "EZE", "AXA", "TIA", "EZE", "JFK", "AXA", "TIA", "EZE", "JFK", "AXA", "TIA", "JFK", "EZE", "TIA", "JFK", "EZE", "TIA", "JFK", "TIA", "JFK", "AUA", "SYD"}, + }, + + // 可以有多个 testcase +} + +func Test_findItinerary(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findItinerary(tc.tickets), "输入:%v", tc) + } +} + +func Benchmark_findItinerary(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findItinerary(tc.tickets) + } + } +} diff --git a/Algorithms/0334.increasing-triplet-subsequence/README.md b/Algorithms/0334.increasing-triplet-subsequence/README.md new file mode 100755 index 000000000..992eb0566 --- /dev/null +++ b/Algorithms/0334.increasing-triplet-subsequence/README.md @@ -0,0 +1,28 @@ +# [334. Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) + +## 题目 + +Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. + +Formally the function should: + +1. Return true if there exists i, j, k such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-1 +1. else return false. + +Your algorithm should run in O(n) time complexity and O(1) space complexity. + +Examples: + +```text +Given [1, 2, 3, 4, 5], +return true. + +Given [5, 4, 3, 2, 1], +return false. +``` + +Credits:Special thanks to @DjangoUnchained for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence.go b/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence.go new file mode 100755 index 000000000..d6925c215 --- /dev/null +++ b/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence.go @@ -0,0 +1,32 @@ +package problem0334 + +func increasingTriplet(a []int) bool { + max := 1<<63 - 1 + ai, aj := max, max + + for _, ak := range a { + if ak <= ai { + ai = ak + } else if ak <= aj { + aj = ak + } else { + return true + } + } + + return false +} + +// TODO: 复习此题 + +// 按照题目要求,ai < aj < ak, 对应的索引值 i < j < k +// 按照程序的运行逻辑可知,ai < aj < ak,但对应的索引值,却有可能出现 i > j 的情况 +// 例如,下面的 test case 返回 true 时 +// [1,2,-10,3,-6] +// ↑ ↑ ↑ +// aj ai ak +// 出现这样的情况,不代表程序出错了。因为 +// 虽然,ai 从 1 变成了 -10 前,递增数的个数为 2,变化后,并没有让递增数的个数降低。 +// 反过来说,保持递增数个数不变的前提下,ai 变小后,可以增大 aj 和 ak 的取值范围,避免遗漏某些情况。 +// 观察下面 test case 的运行过程,可以清楚这一点。 +// {[]int{1, 2, -10, -8, -6}, true}, diff --git a/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence_test.go b/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence_test.go new file mode 100755 index 000000000..c308f7624 --- /dev/null +++ b/Algorithms/0334.increasing-triplet-subsequence/increasing-triplet-subsequence_test.go @@ -0,0 +1,41 @@ +package problem0334 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + {[]int{1, 2, 3, 1, 2, 1}, true}, + {[]int{1, 4, 3, 2, 5}, true}, + {[]int{2, 5, 3, 4, 5}, true}, + {[]int{1, 2, -10, -8, -6}, true}, + {[]int{5, 4, 3, 2, 1}, false}, + {[]int{}, false}, + {[]int{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100000000}, true}, + + // 可以有多个 testcase +} + +func Test_increasingTriplet(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, increasingTriplet(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_increasingTriplet(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + increasingTriplet(tc.nums) + } + } +} diff --git a/Algorithms/0335.self-crossing/335.100.png b/Algorithms/0335.self-crossing/335.100.png new file mode 100644 index 000000000..5aa7f7717 Binary files /dev/null and b/Algorithms/0335.self-crossing/335.100.png differ diff --git a/Algorithms/0335.self-crossing/335.png b/Algorithms/0335.self-crossing/335.png new file mode 100644 index 000000000..b2f5edde7 Binary files /dev/null and b/Algorithms/0335.self-crossing/335.png differ diff --git a/Algorithms/0335.self-crossing/README.md b/Algorithms/0335.self-crossing/README.md new file mode 100755 index 000000000..d19e81cf1 --- /dev/null +++ b/Algorithms/0335.self-crossing/README.md @@ -0,0 +1,44 @@ +# [335. Self Crossing](https://leetcode.com/problems/self-crossing/) + +## 题目 + +You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south, x[3] metres to the east and so on. In other words, after each move your direction changes counter-clockwise. + +Write a one-pass algorithm with O(1) extra space to determine, if your path crosses itself, or not. + +Example 1: +Given x = [2, 1, 1, 2], +????? +? ? +???????> + ? + +Return true (self crossing) + +Example 2: +Given x = [1, 2, 3, 4], +???????? +? ? +? +? +?????????????> + +Return false (not self crossing) + +Example 3: +Given x = [1, 1, 1, 1], +????? +? ? +?????> + +Return true (self crossing) + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 +只会出现下面三种情况 +![335](335.png) + +![100](335.100.png) \ No newline at end of file diff --git a/Algorithms/0335.self-crossing/self-crossing.go b/Algorithms/0335.self-crossing/self-crossing.go new file mode 100755 index 000000000..1374c252f --- /dev/null +++ b/Algorithms/0335.self-crossing/self-crossing.go @@ -0,0 +1,25 @@ +package problem0335 + +func isSelfCrossing(x []int) bool { + size := len(x) + + is4th := func(i int) bool { + return i+3 < size && x[i+2] <= x[i] && x[i+3] >= x[i+1] + } + + is5th := func(i int) bool { + return i+4 < size && x[i+3] == x[i+1] && x[i+4]+x[i] >= x[i+2] + } + + is6th := func(i int) bool { + return i+5 < size && x[i+2] > x[i] && x[i+3] > x[i+1] && x[i+4] <= x[i+2] && x[i+4]+x[i] >= x[i+2] && x[i+5]+x[i+1] >= x[i+3] + } + + for i := 0; i < size; i++ { + if is4th(i) || is5th(i) || is6th(i) { + return true + } + } + + return false +} diff --git a/Algorithms/0335.self-crossing/self-crossing_test.go b/Algorithms/0335.self-crossing/self-crossing_test.go new file mode 100755 index 000000000..52c6053ff --- /dev/null +++ b/Algorithms/0335.self-crossing/self-crossing_test.go @@ -0,0 +1,79 @@ +package problem0335 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + x []int + ans bool +}{ + + { + []int{1, 1, 2, 2, 3, 3, 4, 4, 10, 4, 4, 3, 3, 2, 2, 1, 1}, + false, + }, + + { + []int{1, 1, 4, 2, 2, 1, 1}, + false, + }, + + { + []int{1, 1, 3, 2, 1, 1, 1}, + true, + }, + + { + []int{1, 1, 2, 1, 1}, + true, + }, + + { + []int{2, 1, 3, 2, 2, 1}, + true, + }, + + { + []int{2, 1, 1, 2}, + true, + }, + + { + []int{1, 2, 2, 3, 4}, + false, + }, + + { + []int{1, 2, 3, 4}, + false, + }, + + { + []int{1, 1, 1, 1}, + true, + }, + + // 可以有多个 testcase +} + +func Test_isSelfCrossing(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isSelfCrossing(tc.x), "输入:%v", tc) + } +} + +func Benchmark_isSelfCrossing(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isSelfCrossing(tc.x) + } + } +} diff --git a/Algorithms/0336.palindrome-pairs/README.md b/Algorithms/0336.palindrome-pairs/README.md new file mode 100755 index 000000000..e23107bfc --- /dev/null +++ b/Algorithms/0336.palindrome-pairs/README.md @@ -0,0 +1,23 @@ +# [336. Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/) + +## 题目 + +Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome. + +```text +Example 1: +Given words = ["bat", "tab", "cat"] +Return [[0, 1], [1, 0]] +The palindromes are ["battab", "tabbat"] + +Example 2: +Given words = ["abcd", "dcba", "lls", "s", "sssll"] +Return [[0, 1], [1, 0], [3, 2], [2, 4]] +The palindromes are ["dcbaabcd", "abcddcba", "slls", "llssssll"] +``` + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0336.palindrome-pairs/palindrome-pairs.go b/Algorithms/0336.palindrome-pairs/palindrome-pairs.go new file mode 100755 index 000000000..90850f25b --- /dev/null +++ b/Algorithms/0336.palindrome-pairs/palindrome-pairs.go @@ -0,0 +1,66 @@ +package problem0336 + +func palindromePairs(words []string) [][]int { + res := make([][]int, 0, len(words)) + size := len(words) + if size < 2 { + return res + } + + hash := make(map[string]int, size) + + for i := 0; i < size; i++ { + hash[words[i]] = i + } + + for i := 0; i < len(words); i++ { + for k := 0; k <= len(words[i]); k++ { + right := words[i][k:] + left := words[i][:k] + + if isPalindrome(right) { + leftRev := reverse(left) + if j, ok := hash[leftRev]; ok && i != j { + res = append(res, []int{i, j}) + } + } + + // 因为 + // k == 0 的 right + // 和 + // k == len(words[i]) 的 left + // 相等,会导致重复答案 + // 需要,len(left) != 0 来过滤掉这种情况 + if len(left) != 0 && isPalindrome(left) { + rightRev := reverse(right) + if j, ok := hash[rightRev]; ok && i != j { + res = append(res, []int{j, i}) + } + } + + } + } + + return res +} + +func isPalindrome(s string) bool { + i, j := 0, len(s)-1 + for i < j { + if s[i] != s[j] { + return false + } + i++ + j-- + } + return true +} + +// 反转字符串 +func reverse(s string) string { + bs := []byte(s) + for i, j := 0, len(bs)-1; i < j; i, j = i+1, j-1 { + bs[i], bs[j] = bs[j], bs[i] + } + return string(bs) +} diff --git a/Algorithms/0336.palindrome-pairs/palindrome-pairs_test.go b/Algorithms/0336.palindrome-pairs/palindrome-pairs_test.go new file mode 100755 index 000000000..82c436f63 --- /dev/null +++ b/Algorithms/0336.palindrome-pairs/palindrome-pairs_test.go @@ -0,0 +1,1199 @@ +package problem0336 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans [][]int +}{ + + { + []string{ + "beeeebcdeicajgjj", + "ihjggahfgdecdgjdedi", + "eaigjcciegijcgdcjea", + "bdicecf", + "feiihebjibiddcgcc", + "fijj", + "bbbgcihffajefeeadi", + "jeca", + "hhijbeccecaa", + "aifjbigjfigdabacdh", + "haj", + "jehdgheabgbg", + "caj", + "giead", + "fjjeehae", + "bhbgaeabgbf", + "deadjf", + "daddab", + "bdjhgchbi", + "fb", + "cedjdjdegchhjcdfeh", + "jeahjejjib", + "bgbfheeijfdbihcfb", + "adijbibd", + "deafbiibjbca", + "bdhffghhgbidcciiiiaf", + "aigahcacecbjfgiajeh", + "jigifibdgcg", + "ieajccfdeda", + "hcacfaiceae", + "g", + "ehegg", + "hbahheegccjacdf", + "icea", + "jdhajghidajgehf", + "ahjcfhejgbgfacddgeg", + "ffagecdjjidfbjeb", + "gaaghabdd", + "ehbjbcciei", + "fgjdbcbabbfhh", + "dcfbfc", + "icca", + "gahcjffhhdccgacdddi", + "heegjjgddfde", + "hejahhhfhjbdcb", + "hecdffia", + "fhidfgajhjfi", + "bdibhdjaejefe", + "adhecf", + "jhieebddigahheicgc", + "bghdjeceb", + "fhhfjccdbbeaai", + "dfhjeajbcgbgfjbiie", + "gaaaiaahj", + "gihgagfiabjaheaefjgg", + "bbfgchfjfibgg", + "giabcacjiaiigd", + "cifeffjfjdcgeccddi", + "cfajjie", + "febcfjibeegehbggf", + "jbbajgefgbiegeihgaf", + "hjibifcbib", + "hgbcifgjiiejghhabg", + "dhaiigahggijacjb", + "ajiejafg", + "ddghi", + "aifdhgbg", + "idehafjcacafjhaa", + "bedfchdcaicjfa", + "bje", + "eabbhhcbdj", + "b", + "cifc", + "ajcabichajdijdhjah", + "jjbj", + "ejcfbadje", + "ajefhghdgagdg", + "cgjdfahec", + "cajhbi", + "ggahjiibacech", + "jiii", + "gbejbgjfggghgccic", + "aedhbha", + "cbgeajjacbffj", + "gfaedaihaehchhfbca", + "igegjjdfgcj", + "cggdfbefidb", + "aeggefjgidhcjai", + "iccfgfjbifj", + "babeeacadbgcejdgb", + "hjfbiieg", + "jgfjafegfcjabig", + "cgghcbaigicccdadgj", + "edhc", + "bhfdggfeedjbcc", + "idhfifjh", + "dhg", + "bigcjbedahicachdc", + "hbhehd", + "ddejegadb", + "dcghcjidb", + "h", + "f", + "bibfbgiigdjdhcicgfa", + "j", + "cfcbbcagdhficdfbgge", + "diieibdchje", + "iaideefbacd", + "chbgg", + "ejgfdifgdecidefadc", + "hca", + "ajhaacceddigfdaijhh", + "jjcbbhh", + "jcdejeiddeghibcdiahd", + "cgbh", + "jccgf", + "eibbhcafih", + "agfbaffjehf", + "gciaddbdd", + "caabfhbb", + "dhiafhfghbbiaciebe", + "hcbaijchdbibhijeij", + "hje", + "jgaagcgcbfhbhg", + "baf", + "gg", + "fafifdcacdjajea", + "babiaggad", + "hidgc", + "ihgfdeddjffcbfbg", + "cga", + "jjhcicf", + "bgacedbcchbffb", + "hbghiffibeeh", + "ieeihfdihc", + "dbdfhfcg", + "gaf", + "fibacfgcdhgci", + "agdeibjediabfcgacaaf", + "dhhddehiih", + "ddaebjgifhjeide", + "heefhfgdfa", + "ji", + "fdbajeehi", + "cfjiab", + "adbifjaddbidgec", + "jcf", + "hbebghj", + "hbcebe", + "gihjdadbcdjdeb", + "cagicfjgibajj", + "beibhadf", + "ddahi", + "afgcjdghiedaifbgj", + "hbbchcbhd", + "e", + "cbcafdgg", + "gdagdfdafhdbi", + "haaeifhf", + "jifegiibebddig", + "iccaadccijjehhbej", + "giabhggeba", + "a", + "afechgcgjh", + "icaeaga", + "dgchd", + "ifafc", + "bdecfaggfijdc", + "cfihfjdagfbdjhfjjfgd", + "fbgc", + "fgefhdhhihhhcad", + "gbdaifaedahbicejah", + "ae", + "ciafhbghigacjgbg", + "fhjjcafh", + "fifhibchebgibj", + "dcfabcjbahbbgibifi", + "hdjbjgcdhifji", + "iij", + "bbgahabheacdidfjgcdb", + "hccdaigbeegcahgdhe", + "hcffjjcfhfhdbhihjb", + "abefdhjfj", + "cdhba", + "dcccigaff", + "c", + "ii", + "jdhcgbhgjhdcge", + "ddjh", + "hehaihc", + "ihj", + "jiceb", + "ddidajcbhe", + "eidhcicecfhbjg", + "ejiaiggbdjbffc", + "ibcffeb", + "bagchhdf", + "bbaefcedhf", + "bfeffgjcjcgfcjhj", + "ciha", + "ga", + "aebcgjajdccbghh", + "agjbijcefbbedaa", + "hjchddgdffchbcbaaji", + "geahiefhfh", + "jfhjca", + "jegcaci", + "afhiiaedggj", + "fce", + "jjabde", + "ejghfgbidafhgfddged", + "eefjbdabfjdjjcfab", + "ffcgebgejghcgga", + "jj", + "dhbihgahec", + "ijadjcbdbdcaag", + "ghi", + "eddaeggiiahdegigd", + "gef", + "bgjhdhghgjjigb", + "de", + "cbhehdhcagiddh", + "hahefidijehedd", + "gjbcija", + "fgfgedgijdhc", + "jf", + "ci", + "egacd", + "egdchfjaicga", + "adcffgcbcfg", + "gghcafhicegeffecej", + "dibeeahcjhgd", + "bddada", + "jcc", + "edbjfdaaadfh", + "eeieahcfga", + "ddjhaachfdgj", + "adhhegabeid", + "dbf", + "gicdfaa", + "faeb", + "gfdfdbdeeehidjcddjf", + "bcg", + "jchahhacjhaicdh", + "abjeeefbf", + "idj", + "habcgfbcfbafgbedeag", + "dfjjcjihhjidhif", + "giagidiaejhhbebgfiii", + "dcjieibddijacedjjd", + "djhbbeegjdbcdc", + "hbjihacidcjf", + "ebcjcbjggcejaedbjbgh", + "ccjhffdgheii", + "ebjjjidafeiiadagd", + "ebgiccfjcdhij", + "fahi", + "gbfjedheihagdfjfiadj", + "fbfcebefe", + "cjed", + "fciaffbfhheaajiee", + "jhbeeccdbfffaefgbag", + "ejdhijbfjedi", + "abgcfhafdiihjgcjb", + "gjdaedagb", + "gaebghaficjij", + "ggjcbb", + "eeahgbehcdf", + "bdh", + "cfiecig", + "ef", + "jeagcjgj", + "edjeeg", + "ehdeahei", + "jb", + "dheaefcbiaaibihbi", + "ceac", + "fbbjifdbgeabahbeic", + "ehceeieajcbcigdea", + "ccia", + "ejb", + "jaa", + "jdfccf", + "cehdehada", + "cajagdgbdfdief", + "ecchaahfccahbfiiagh", + "gfecfgiicf", + "begeif", + "ccdj", + "chjece", + "chjdcjhiaadiaja", + "ehiffbeefbh", + "ijeaaaab", + "bbceg", + "jhiij", + "jbadgfdb", + "cjfiffbgigjjehc", + "deifejfji", + "ccijhjdecbhbae", + "jgdhhgjfdecicj", + "edhjhecdehidecd", + "faidghgaeiccgabaeeih", + "ibabaafhegcbhadfgjfc", + "hgcceegjceh", + "cjjichhceebfhfe", + "ihdibgjichedbejgjfd", + "i", + "ejjdiiahidjcde", + "ghidg", + "jaejg", + "bdhbj", + "dgcbagf", + "ggjefhjaffeidecgi", + "fhjf", + "dahaedfcccdcddegfb", + "dceagcfigijagaiagg", + "ee", + "bdfjhageebbdgjf", + "idifga", + "fdhcbjjdijcc", + "hgii", + "gcecbdjeebh", + "gfjggaggaaeahdcg", + "cjeaee", + "deghch", + "jd", + "fbgbdaijfc", + "jjbahggccfchgc", + "idbigaa", + "fh", + "jhaffeiafcfic", + "hjbajajbhhgbhh", + "jcfffgi", + "eid", + "bdiddidbiehaicjjj", + "cadefbfcdiia", + "chbb", + "jcdieaa", + "chafeehdifjdhe", + "dbjbdefdhh", + "agiebcaafefbehfgfecf", + "ajbcdccde", + "bajddcfegdchbhaa", + "gjdhffifjbghj", + "fac", + "ibhdghc", + "ddcbheggh", + "ja", + "ehbecbic", + "dhcahcdi", + "eaicgfahhhcga", + "ajgjadi", + "cej", + "ijf", + "jgjiggibgegfcgdh", + "dhbcgbdb", + "idibfaecedbefh", + "jhhad", + "hbgfeb", + "addjdgibc", + "edfji", + "jfhdih", + "defdbchi", + "hhcbbdbhfcjafaidi", + "hjjfef", + "afgiedffbebgdeceg", + "caagacfafihjbc", + "cbd", + "hbechjjdhjcajhi", + "ecdbhcfjiajjdi", + "eafj", + "eedgcddibhjicghhgi", + "cebihhefjfaajgcbihh", + "iad", + "bhcjh", + "bbfcfbhbjheffijffgci", + "idfifbag", + "ehhiifgefabajccif", + "ccdhdgbg", + "dbegdcffhej", + "gbbhiddajaej", + "dbcfgbaegdaefb", + "jeafifjhgdggied", + "dbfbgjg", + "fhde", + "dbbgjjihbb", + "gejccfbehd", + "dihae", + "cbedgcefibh", + "ibgdbbdeeafd", + "gdacjhcae", + "eig", + "caiffaiecbjifbed", + "bhbhicif", + "jicegfihhfehdgefgbe", + "gbceggcjifcgbe", + "chaihfjha", + "fabchhfgcbdeh", + "haghigeccecfciachjd", + "fejdbifdgihhgejejaij", + "eahdcbjigibh", + "bcaedbddccccfchaaa", + "bbhghajdha", + "icieaaihjfbjc", + "haifhbehfeh", + "fdbaiehdacbcg", + "haiichhejicibifgch", + "hcgjjdbfg", + "gefhecjbid", + "iijifbe", + "fdccfgidfhfaefb", + "ehhigje", + "ehejhaadgjagajfgi", + "dadebcejhjacj", + "fgbhfgfdciebca", + "iadfab", + "ggihahf", + "bfeg", + "ddjfhaeefe", + "eeacdagjacjif", + "jadigc", + "dgd", + "ehhihj", + "afagacheibifg", + "cd", + "eaaeddaijbjbcdhiaj", + "ic", + "cabfah", + "aefbebcahfccgcc", + "geafcjcccafjaafgb", + "ecf", + "bbegiajc", + "dbeegbdbiadbiebbhijj", + "ejjebcaec", + "hhfabf", + "fgiegjbfbajgagjedfd", + "hgcje", + "iiifeei", + "iadhide", + "jehbfiiebcebjgbfi", + "bfgid", + "ejjfijcbhhchc", + "jedcjgfc", + "bdecjaddjjjhddgejb", + "bcedaeaicg", + "beijbfihjiebicfbdah", + "hbcifghfjdg", + "bcf", + "jjhbj", + "fhdieehbfjhga", + "efgbjgccg", + "dhbaciegffcbgcdecfge", + "cc", + "ibibeaehdgf", + "jecifgb", + "hfcbjjddjig", + "gcihafaajifgfjgee", + "jbifgjecfaecf", + "gfbjjhfj", + "fgj", + "eeddbihhhbcggb", + "cdghjidd", + "jdffiaccgdhebhfa", + "fhjibdjjdhajacgdaa", + "djefgjebeehbdcfgh", + "geci", + "fedcibeihbcdddg", + "ba", + "acjejdfcd", + "adcggijbbdaaajcji", + "bhgec", + "ch", + "gbggegj", + "fdcj", + "ghhjf", + "geaeecc", + "ebaehjfiegbhiiigj", + "jbhhfhgcg", + "djjhcebjhgjhddegjaf", + "ddbbgbbgb", + "dagejcifjiidhfj", + "cigjjdba", + "ddfjgecjbhibhdab", + "igdh", + "cjihcghd", + "fgidhihgahiedcdhceec", + "eccaeecchciijjhicc", + "acjggfg", + "gjfgjgdgcejegigbcj", + "jdhchcdejbc", + "hjchcjheeggebbgejb", + "hgegdjedbeghj", + "egigbbdg", + "dddihccgiehijeee", + "aebfhec", + "ebeagii", + "ejjajcaj", + "chefcjciijgagbiddb", + "jcha", + "acbdhfigjbafj", + "dcib", + "hhhid", + "cbj", + "ibia", + "fddh", + "hjeeidijdifhceechj", + "hieibajd", + "fgeee", + "jfbg", + "egba", + "dc", + "ajjajgddeebgba", + "hfhgjibig", + "ehbdd", + "hgdag", + "ffiddacjcfcebfhafiad", + "bah", + "dibhacehhdahhfghi", + "cfeagjcdhahgbhiefg", + "fiddgc", + "adbgdcifjabchhfj", + "cfhcjidifgiebg", + "jfbgbda", + "jjfiijdb", + "cdiegf", + "agfhddhibhjchjahgfe", + "eh", + "gjhaadg", + "bgj", + "fifaiagcicgic", + "hibdj", + "ddaffibhjbjebjhed", + "hfhjfh", + "dejahcbheihaccfcaci", + "hbd", + "egfddiie", + "fahgbhjbbegjcigf", + "fhjdcacebdhfc", + "fhihecei", + "abeffcdga", + "cdifdea", + "jbde", + "gbfcj", + "ehgfiaebhbeafcadfiec", + "fdcfac", + "ebaajggaaff", + "deifaeidijaif", + "aafhehdihdiafcgf", + "eihccaf", + "bhhhchije", + "iaheehiadeidie", + "bgehefjheccgdjihde", + "highgd", + "jh", + "hfbdfdcaf", + "ecdddb", + "gijbffg", + "dbfbjefjdhbifch", + "dcb", + "adcceefaa", + "difbcegagjad", + "bicjchaigdidhbjbbc", + "befdibhhgjfbjh", + "jccebjagcbe", + "bgggfhdfjhj", + "figcbjdffe", + "ggdfbgj", + "efjaiicejebhaiij", + "jbga", + "ijedeijfbgcaicdchaa", + "fc", + "dffga", + "jcadghifjeej", + "bbeibajjghcjii", + "hbiificbjggbdbcddgi", + "cefhddgg", + "jbifiecihibcajhhe", + "befhgaja", + "ddhjgj", + "aifdedjiijjiifaefji", + "jgigdbegdejed", + "dbafbg", + "bhiecchgeghgf", + "bgejidbbcgjbbej", + "gdjihbajbdjfbhhdgg", + "cfjgc", + "gcedgcfdcbhbaehbh", + "fagbdceffcfeg", + "dehdbdadeadheb", + "jdjbcdaebefhfjefgib", + "agghajfajcifiggcehbc", + "figadcadgjbifacff", + "fdhijdjei", + "dbjehghfbfaba", + "dddgihhaecfjia", + "bjedbhdejbeccc", + "gbaa", + "jcbcjdicgdeafcjgfa", + "jeieibahadejjia", + "jejbegecjcghag", + "degeeig", + "idiefaiagbdccbeg", + "bebbihjajiacc", + "agcded", + "jiajjghadiib", + "ggiaicj", + "gaa", + "bjfegdebhdafcjc", + "jedbe", + "dcegghfah", + "d", + "cdcfhcejaidjhdihf", + "jedahaebjgafjij", + "eehhbfhcbheibeafbjhh", + "iacbiidjjdafgdeebgeg", + "ehg", + "gce", + "cibbdfjabajfhicjhc", + "gabe", + "bcahifdhefgcihfcj", + "bachiajbbghf", + "cbcggfjbddig", + "aigjififbibbhee", + "bhjichaeacebhde", + "jhjjedbejhjef", + "bdbgicjg", + "hhbjeeig", + "afcgd", + "chb", + "hidjidieebe", + "fjeeaahabghbdijeehj", + "ffehejehacheff", + "bfhijbfhgeij", + "fahffagajgifhegiahd", + "daeagh", + "bfhhcfi", + "igaebicbbidc", + "ahgaeadaeaeejhbbd", + "hhfifc", + "bba", + "jhahbbgcahega", + "cgbfjibbgejahhi", + "fceidghhbc", + "ddhbiijfagbijabhchg", + "edfdgfhgedciijjb", + "cggacbegcab", + "cffddejagdedbjbhbehh", + "iiabejchcegffe", + "bfjdcjdiefifhdd", + "idceadhahebjdaebaag", + "ghfab", + "gbbcabghjfjecb", + "ca", + "jacajeeee", + "fiafccce", + "addheieceacdbid", + "gcie", + "cegfjdjiifibbbfde", + "bgjiefggbhajjjhdeeb", + "cbhcdghcgjggbibefi", + "jhaeggbeacc", + "cdcebbcb", + "eei", + "fiehihb", + "ddejbhahf", + "ghacaijhbh", + "dbjagbdjgadg", + "aaecfdhfchicha", + "bgfdjiddeaigeibie", + "chaeffghac", + "jeaiafidbebcdddchbi", + "ceicfhhbceidigbijiga", + "iebdcjcdgcchd", + "feefcfjhegbibcef", + "chjfbd", + "bhehcgbaa", + "dhaidbeigj", + "ggfcihbjgaacg", + "gbafcaccb", + "icbgbdfccjiegfagehja", + "deheh", + "bjifj", + "gig", + "fiheejdgc", + "afgcfbifgggiiac", + "hjjgjiahec", + "agebjdfbfbijdjciciac", + "dbhgbeeabghfdaded", + "cecccfedd", + "idihib", + "jjjefigiajaegd", + "eieiabhefdg", + "hhfdbgj", + "hefhfafhegbddha", + "abgbeifbcihjcjjf", + "deh", + "hf", + "cacgihjgc", + "cgechchgca", + "fdghe", + "aeae", + "beefijjifh", + "fhejjjgdjbfdfjbc", + "jfhgccjgfeaejcdd", + "cbehieicjgjb", + "gabecadiafiidaedjhg", + "bihahejcffh", + "cdieiaicj", + "aebbgdfefedbghcdjie", + "hidhaaejcfddegdbj", + "hhdfbhhgdib", + "ajcagaadbhdjfjh", + "jhcjhacaciahafgfbeae", + "fbadf", + "hdhghbhjg", + "dicjdjhbh", + "behjeedjfdchif", + "jgbfd", + "hhjge", + "hjhjhhifihd", + "gjgjceigcgabgeejb", + "ieaeffdeba", + "cchgjhe", + "dafefccaagef", + "bjfcddaaafifjbgg", + "fhihc", + "igghbbj", + "aeadajbahefdaffgddfb", + "gihfecbfbdih", + "cififdedahjhie", + "feeec", + "bfe", + "ijah", + "babfbjjefeghdiif", + "bj", + "bfg", + "fdbcfcicejedbf", + "ggjgbajhdee", + "ceaffjfffibaac", + "bjacfedbcfc", + "acbeeahbcaaa", + "ehfhifbibbchgdcddeb", + "hecdh", + "bhi", + "gehiiiifbedejjhhdjha", + "cccifbgjigfhfaeef", + "fciddhfiiheai", + "daccaegdc", + "jjciidaei", + "abdhadcf", + "affbdeehj", + "adeigihacbace", + "dcje", + "edjg", + "abfieiaifbehaegbdhj", + "ceg", + "efbgheebjih", + "bi", + "hbceaaciigghgeed", + "fcjcjiaddafehcgdh", + "cdhafhafcagecahh", + "hdicbggdbhhaec", + "jdffibg", + "jfdgai", + "jafddhhfecafccd", + "ddecjfffdibhfbec", + "aebdacjfbbabhd", + "cejgjedbggc", + "cfigijhghgjhjigaj", + "didgicafefibfhia", + "hfigi", + "aeahfbhj", + "ejfabcgidfebiejac", + "cijadecfidbha", + "ccefhhaddgefbec", + "acaf", + "iffafgffibbhjabifh", + "cgaijjdiadjdijd", + "jebhhifdcjdbgfaj", + "ciiajeafhb", + "ahgjhaih", + "ffhjjjdf", + "igbfdbcgdced", + "hhi", + "ajadfhdbfic", + "dcicgbegafchdjbeaiac", + "eeaieibbaahbj", + "jaefgbgajceddada", + "abdaeff", + "baggdhigcidi", + "digibh", + "beeahagffig", + "hecafdaibjac", + "cbdiaaecebgddfebcgeg", + "cjdid", + "iag", + "fdejghdbchcfhcc", + "gieg", + "hafhhjda", + "cfiacbfbjaj", + "acaaecbfa", + "fghcdbhihfjgggbbe", + "ddjiachf", + "bceefdfch", + "cibbcjfajbicjbeg", + "eehbcbiebhdj", + "ecdjefcagc", + "cjfedhjgecdicejej", + "eachghacfd", + "bbeeabfgcj", + "cjcibgaiji", + "fijacjhbcce", + "cdgjc", + "echbchiiahbieeabeaj", + "bhad", + "heeegadbjcbbh", + "biaga", + "giijhchaidhajja", + "aiccg", + "jahigbhcijfceifab", + "gbba", + "chfjehffad", + "acbfagcdiei", + "dbjbhabehejgacigjief", + "jdgbghhc", + "iigffdaibedidbgai", + "efhhbddeadaeedcbe", + "hbaggcdhajeecf", + "baachfdfihfhec", + "hfhgcafh", + "if", + "ebddaigjbche", + "ggcebefhcif", + "cdhcfeghheadhb", + "ibigdgehibfheafg", + "ajgjdbediidiiedgbbj", + "egcefhcaegcchab", + "ffcccigbgddhiej", + "jiihhffbdba", + "higcb", + "bdcj", + "iibjghgddgibjdbhg", + "jjbfgjbaegfeafdice", + "eicfigbgcbfbh", + "hbc", + "ddai", + "ebgedc", + "dihhegaedie", + "hhichheibgh", + "ibfghigejcgccdgfhha", + "hjaefhhgbeaabiiiia", + "jcbgfbi", + "iib", + "dgifigccgeajacad", + "ajadieihjddajf", + "daaebahhceaaccjce", + "ebcegebbaehihc", + "dcdigbbfcjfjgejafih", + "cahaeid", + "jgadcfbiebh", + "bjgehica", + "jcdbecicddhgdcgah", + "abebiggeegied", + "iegidfdcaghbh", + "abcgjhccecihjcehjbih", + "ggbjjdbj", + "ebd", + "hb", + "aegifehccjbfjdfgh", + "fcgfhjef", + "jcjecfjg", + "cfjfejehj", + "ebehfcefjagdehbgaf", + "acbfcjbaacf", + "ghfiiihbafg", + "ggjfhjejjjebgi", + "bedeg", + "jhcgbdabcicjjcf", + "jggejdjb", + "gj", + "jdj", + "bd", + "bihffeibbhhahdeh", + "ciii", + "ggggfigdahcbcggaea", + "heibfaefccbcbjdjhf", + "ej", + "ijfia", + "geaffgjgcdhfaigjhb", + "jggbjcbjaigbhcajdgf", + "ihjia", + "cdafebccdfiejbihfa", + "hcbfh", + "cibeabfaceadjdcahcje", + "cedhehfggahfdjafi", + "idehcgghh", + "ecbbahfbjga", + "agegadhbcbggdjh", + "icebg", + "gdfhjdhgfi", + "iibajaagg", + "bc", + "egdjeb", + "ifg", + "dbdihce", + "djgcddgfhhjhfeficfb", + "aifei", + "adgbahccdhfggidff", + "chaheaaibfjgaicjggi", + "fabibje", + "fgca", + "dcfgejefjediehebfe", + "jhcjjbehdaefehgfgddb", + "gedfbgbddddgjihdai", + "iheijfcccgjjic", + "jhdcijachjdicida", + "cdcgdjgbdgceagbgccij", + "ijehdcaaii", + "cedgjjcaga", + "gbiahdcdbbgc", + "dhdjjfgiic", + "efajajhfdhggbdhd", + "cibdgdchfiagcddihfe", + "ffbbjbe", + "afjib", + "ddgicdhhcjebgijihfd", + "ddchbjfed", + "gjedbhgj", + "jdb", + "ijea", + "hcjjhhecfa", + "cghffiidjddgdjfig", + "gjgebbhghbabfdfb", + "gaeddgibiddfe", + "hgihcbchageicggajg", + "dadhjcfejbcefgdjgde", + "agdbegjjdciicffc", + "ggahfhcgdj", + "ijaiiheecg", + "eeficbjfbdjafbib", + "bfagahdeddaeje", + "fjagijihjaadj", + "hecgddeahd", + "jahccjdhgajhbcdhe", + "bjae", + "aggjagjdeejfbc", + "fcefadj", + "gaadg", + "bcgdidjaiihabfg", + "bfbjidcjbgaggd", + "aggfjjgibd", + "hfidbgiaiegcff", + "dchegbggcgi", + "idij", + "gabbcdedcbieaefhcdbg", + "iidbdidehdjj", + "dbfdhebhiehh", + "dgdbj", + "fdfcjhjigcgbaibhcifi", + "eadaafhfgdagajbe", + "abagbjaaibb", + "jhdjbfjfiijccdedd", + "gbcd", + "cedfiabchdijgbh", + "ahjdbbja", + "jiaag", + "ghiifaiehaajc", + "iejifjdchjci", + "iacgi", + "hdgf", + }, + [][]int{ + []int{5, 830}, + []int{7, 352}, + []int{347, 10}, + []int{347, 12}, + []int{19, 102}, + []int{71, 19}, + []int{125, 31}, + []int{40, 610}, + []int{886, 69}, + []int{69, 274}, + []int{69, 280}, + []int{74, 104}, + []int{274, 74}, + []int{80, 104}, + []int{80, 178}, + []int{110, 471}, + []int{886, 122}, + []int{122, 553}, + []int{125, 30}, + []int{30, 125}, + []int{142, 104}, + []int{306, 142}, + []int{570, 146}, + []int{172, 162}, + []int{155, 172}, + []int{142, 178}, + []int{178, 186}, + []int{104, 178}, + []int{186, 306}, + []int{306, 186}, + []int{553, 190}, + []int{200, 30}, + []int{162, 200}, + []int{208, 430}, + []int{213, 104}, + []int{104, 213}, + []int{220, 610}, + []int{155, 220}, + []int{225, 104}, + []int{102, 225}, + []int{226, 185}, + []int{306, 226}, + []int{226, 426}, + []int{233, 104}, + []int{452, 233}, + []int{19, 238}, + []int{238, 881}, + []int{325, 245}, + []int{270, 155}, + []int{102, 270}, + []int{274, 104}, + []int{71, 274}, + []int{274, 734}, + []int{734, 280}, + []int{280, 69}, + []int{281, 104}, + []int{325, 288}, + []int{316, 155}, + []int{155, 316}, + []int{325, 104}, + []int{610, 325}, + []int{329, 102}, + []int{101, 329}, + []int{329, 696}, + []int{652, 344}, + []int{347, 104}, + []int{162, 347}, + []int{353, 142}, + []int{367, 901}, + []int{218, 417}, + []int{424, 185}, + []int{610, 424}, + []int{424, 510}, + []int{426, 306}, + []int{185, 426}, + []int{426, 226}, + []int{570, 430}, + []int{430, 208}, + []int{570, 447}, + []int{452, 185}, + []int{185, 452}, + []int{465, 755}, + []int{467, 71}, + []int{162, 467}, + []int{471, 185}, + []int{101, 471}, + []int{274, 502}, + []int{502, 901}, + []int{162, 503}, + []int{510, 610}, + []int{185, 510}, + []int{510, 424}, + []int{526, 155}, + []int{101, 526}, + []int{553, 104}, + []int{101, 553}, + []int{901, 558}, + []int{558, 424}, + []int{717, 566}, + []int{570, 102}, + []int{185, 570}, + []int{603, 130}, + []int{606, 30}, + []int{162, 639}, + []int{652, 185}, + []int{162, 652}, + []int{662, 316}, + []int{306, 662}, + []int{696, 101}, + []int{102, 696}, + []int{696, 329}, + []int{700, 162}, + []int{155, 700}, + []int{270, 731}, + []int{731, 19}, + []int{10, 732}, + []int{734, 71}, + []int{104, 734}, + []int{734, 274}, + []int{735, 19}, + []int{743, 867}, + []int{757, 71}, + []int{306, 757}, + []int{770, 329}, + []int{344, 775}, + []int{102, 775}, + []int{306, 783}, + []int{200, 795}, + []int{797, 391}, + []int{818, 279}, + []int{830, 306}, + []int{102, 830}, + []int{373, 845}, + []int{757, 852}, + []int{852, 186}, + []int{71, 852}, + []int{867, 101}, + []int{71, 867}, + []int{879, 30}, + []int{104, 879}, + []int{325, 880}, + []int{881, 71}, + []int{610, 881}, + []int{883, 185}, + []int{883, 426}, + []int{886, 155}, + []int{104, 886}, + []int{901, 71}, + []int{185, 901}, + []int{881, 928}, + []int{104, 953}, + []int{274, 957}, + []int{558, 962}, + }, + }, + + { + []string{ + "bat", + }, + [][]int{}, + }, + + { + []string{ + "bat", + "tab", + "cat", + }, + [][]int{ + []int{0, 1}, + []int{1, 0}, + }, + }, + + { + []string{ + "abcd", + "dcba", + "lls", + "s", + "sssll", + }, + [][]int{ + []int{0, 1}, + []int{1, 0}, + []int{3, 2}, + []int{2, 4}, + }, + }, + + // 可以有多个 testcase +} + +func Test_palindromePairs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, palindromePairs(tc.words), "输入:%v", tc) + } +} + +func Benchmark_palindromePairs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + palindromePairs(tc.words) + } + } +} diff --git a/Algorithms/0337.house-robber-iii/README.md b/Algorithms/0337.house-robber-iii/README.md new file mode 100755 index 000000000..8dc9e166f --- /dev/null +++ b/Algorithms/0337.house-robber-iii/README.md @@ -0,0 +1,32 @@ +# [337. House Robber III](https://leetcode.com/problems/house-robber-iii/) + +## 题目 +The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the police if two directly-linked houses were broken into on the same night. + +Determine the maximum amount of money the thief can rob tonight without alerting the police. + +Example 1: +``` + 3 + / \ + 2 3 + \ \ + 3 1 +``` +Maximum amount of money the thief can rob = 3 + 3 + 1 = 7. + +Example 2: +``` + 3 + / \ + 4 5 + / \ \ + 1 3 1 +``` +Maximum amount of money the thief can rob = 4 + 5 = 9. + +Credits:Special thanks to @dietpepsi for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0337.house-robber-iii/house-robber-iii.go b/Algorithms/0337.house-robber-iii/house-robber-iii.go new file mode 100755 index 000000000..6e15c4c72 --- /dev/null +++ b/Algorithms/0337.house-robber-iii/house-robber-iii.go @@ -0,0 +1,33 @@ +package problem0337 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func rob(root *TreeNode) int { + var dfs func(*TreeNode) (int, int) + // a 抢劫 root 节点时的最大值 + // b 不抢劫 root 节点时的最大值 + dfs = func(root *TreeNode) (a, b int) { + if root == nil { + return 0, 0 + } + la, lb := dfs(root.Left) + ra, rb := dfs(root.Right) + a = root.Val + lb + rb + b = max(la, lb) + max(ra, rb) + return a, b + } + + a, b := dfs(root) + return max(a, b) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0337.house-robber-iii/house-robber-iii_test.go b/Algorithms/0337.house-robber-iii/house-robber-iii_test.go new file mode 100755 index 000000000..863f5a7c7 --- /dev/null +++ b/Algorithms/0337.house-robber-iii/house-robber-iii_test.go @@ -0,0 +1,93 @@ +package problem0337 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + // 用 0 表示 nil + { + []int{4, 1, 0, 2, 0, 3}, + 7, + }, + + { + []int{3, 2, 3, 0, 3, 0, 1}, + 7, + }, + + { + []int{3, 4, 5, 1, 3, 0, 1}, + 9, + }, + + // 可以有多个 testcase +} + +func Test_rob(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := &TreeNode{} + initTree(tc.nums, []*TreeNode{}, root) + ast.Equal(tc.ans, rob(root), "输入:%v", tc) + } +} + +func Benchmark_rob(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := &TreeNode{} + initTree(tc.nums, []*TreeNode{}, root) + rob(root) + } + } +} + +// 创建二叉树 +func initTree(nums []int, parents []*TreeNode, root *TreeNode) { + if len(nums) == 0 { + return + } + + if len(parents) == 0 { + if nums[0] != 0 { + root.Val = nums[0] + parents = append(parents, root) + initTree(nums[1:], parents, root) + } + + return + } + + newParents := make([]*TreeNode, 0, len(parents)*2) + for _, parent := range parents { + + if nums[0] != 0 { + parent.Left = &TreeNode{Val: nums[0]} + newParents = append(newParents, parent.Left) + } + + if len(nums) == 1 { + return + } + + if nums[1] != 0 { + parent.Right = &TreeNode{Val: nums[1]} + newParents = append(newParents, parent.Right) + } + + nums = nums[2:] + } + + initTree(nums, newParents, root) +} diff --git a/Algorithms/0338.counting-bits/README.md b/Algorithms/0338.counting-bits/README.md new file mode 100755 index 000000000..d409165c4 --- /dev/null +++ b/Algorithms/0338.counting-bits/README.md @@ -0,0 +1,23 @@ +# [338. Counting Bits](https://leetcode.com/problems/counting-bits/) + +## 题目 + +Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array. + +Example: + +```text +For num = 5 you should return [0,1,1,2,1,2]. +``` + +Follow up: + +1. It is very easy to come up with a solution with run time O(n*sizeof(integer)). But can you do it in linear time O(n) /possibly in a single pass? +1. Space complexity should be O(n). +1. Can you do it like a boss? Do it without using any builtin function like __builtin_popcount in c++ or in any other language. + +Credits:Special thanks to @ syedee for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0338.counting-bits/counting-bits.go b/Algorithms/0338.counting-bits/counting-bits.go new file mode 100755 index 000000000..87f9b8078 --- /dev/null +++ b/Algorithms/0338.counting-bits/counting-bits.go @@ -0,0 +1,19 @@ +package problem0338 + +func countBits(num int) []int { + res := make([]int, num+1) + for i := 1; i <= num; i++ { + // i>>1 == i/2 + // i&1 == i%2 + // 只是 位运算 更快 + // + // 观察以下三个数的二进制表示 + // 5 : 101 + // 10: 1010, 10>>1 == 5 + // 11: 1011, 11>>1 == 5 + // 10 的二进制表示,含有 1 的个数,可以由 5 的答案 + 10%2 计算 + // 11 同理 + res[i] = res[i>>1] + i&1 + } + return res +} diff --git a/Algorithms/0338.counting-bits/counting-bits_test.go b/Algorithms/0338.counting-bits/counting-bits_test.go new file mode 100755 index 000000000..af8497e8c --- /dev/null +++ b/Algorithms/0338.counting-bits/counting-bits_test.go @@ -0,0 +1,37 @@ +package problem0338 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans []int +}{ + + { + 5, + []int{0, 1, 1, 2, 1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_countBits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countBits(tc.num), "输入:%v", tc) + } +} + +func Benchmark_countBits(b *testing.B) { + for i := 0; i < b.N; i++ { + countBits(1000) + } +} diff --git a/Algorithms/0342.power-of-four/README.md b/Algorithms/0342.power-of-four/README.md new file mode 100755 index 000000000..21b6447ca --- /dev/null +++ b/Algorithms/0342.power-of-four/README.md @@ -0,0 +1,17 @@ +# [342. Power of Four](https://leetcode.com/problems/power-of-four/) + +## 题目 + +Given an integer (signed 32 bits), write a function to check whether it is a power of 4. + +Example: +Given num = 16, return true. +Given num = 5, return false. + +Follow up: Could you solve it without loops/recursion? + +Credits:Special thanks to @yukuairoy for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0342.power-of-four/power-of-four.go b/Algorithms/0342.power-of-four/power-of-four.go new file mode 100755 index 000000000..db9a3d121 --- /dev/null +++ b/Algorithms/0342.power-of-four/power-of-four.go @@ -0,0 +1,19 @@ +package problem0342 + +func isPowerOfFour(num int) bool { + if num <= 0 { + return false + } + + // 如果 num 不是2的N次方, 那么也不是4的N次方 + if num&(num-1) != 0 { + return false + } + + // 过滤 + if num&0x55555555 == 0 { + return false + } + + return true +} diff --git a/Algorithms/0342.power-of-four/power-of-four_test.go b/Algorithms/0342.power-of-four/power-of-four_test.go new file mode 100755 index 000000000..9c1cd7c43 --- /dev/null +++ b/Algorithms/0342.power-of-four/power-of-four_test.go @@ -0,0 +1,39 @@ +package problem0342 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans bool +}{ + + {2, false}, + {16, true}, + {5, false}, + {-5, false}, + + // 可以有多个 testcase +} + +func Test_isPowerOfFour(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isPowerOfFour(tc.num), "输入:%v", tc) + } +} + +func Benchmark_isPowerOfFour(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isPowerOfFour(tc.num) + } + } +} diff --git a/Algorithms/0343.integer-break/README.md b/Algorithms/0343.integer-break/README.md new file mode 100755 index 000000000..a171c8657 --- /dev/null +++ b/Algorithms/0343.integer-break/README.md @@ -0,0 +1,15 @@ +# [343. Integer Break](https://leetcode.com/problems/integer-break/) + +## 题目 + +Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. + +For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, return 36 (10 = 3 + 3 + 4). + +Note: You may assume that n is not less than 2 and not larger than 58. + +Credits:Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0343.integer-break/integer-break.go b/Algorithms/0343.integer-break/integer-break.go new file mode 100755 index 000000000..d0889606b --- /dev/null +++ b/Algorithms/0343.integer-break/integer-break.go @@ -0,0 +1,34 @@ +package problem0343 + +func integerBreak(n int) int { + if n == 2 { + return 1 + } + + if n == 3 { + return 2 + } + + switch n % 3 { + case 0: + return pow3(n / 3) + case 1: + return 4 * pow3(n/3-1) + default: + return 2 * pow3(n/3) + } + +} + +func pow3(n int) int { + if n == 0 { + return 1 + } + + res := pow3(n >> 1) + if n&1 == 0 { + return res * res + } + + return res * res * 3 +} diff --git a/Algorithms/0343.integer-break/integer-break_test.go b/Algorithms/0343.integer-break/integer-break_test.go new file mode 100755 index 000000000..4dcfe4a85 --- /dev/null +++ b/Algorithms/0343.integer-break/integer-break_test.go @@ -0,0 +1,41 @@ +package problem0343 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {2, 1}, + {3, 2}, + {58, 1549681956}, + {9, 27}, + {10, 36}, + {11, 54}, + + // 可以有多个 testcase +} + +func Test_integerBreak(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, integerBreak(tc.n), "输入:%v", tc) + } +} + +func Benchmark_integerBreak(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + integerBreak(tc.n) + } + } +} diff --git a/Algorithms/0344.reverse-string/README.md b/Algorithms/0344.reverse-string/README.md new file mode 100755 index 000000000..3f4810ec8 --- /dev/null +++ b/Algorithms/0344.reverse-string/README.md @@ -0,0 +1,12 @@ +# [344. Reverse String](https://leetcode.com/problems/reverse-string/) + +## 题目 + +Write a function that takes a string as input and returns the string reversed. + +Example: +Given s = "hello", return "olleh". + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0344.reverse-string/reverse-string.go b/Algorithms/0344.reverse-string/reverse-string.go new file mode 100755 index 000000000..b3c0352c6 --- /dev/null +++ b/Algorithms/0344.reverse-string/reverse-string.go @@ -0,0 +1,15 @@ +package problem0344 + +func reverseString(s string) string { + bytes := []byte(s) + + i, j := 0, len(s)-1 + + for i < j { + bytes[i], bytes[j] = bytes[j], bytes[i] + i++ + j-- + } + + return string(bytes) +} diff --git a/Algorithms/0344.reverse-string/reverse-string_test.go b/Algorithms/0344.reverse-string/reverse-string_test.go new file mode 100755 index 000000000..0ebcbffa0 --- /dev/null +++ b/Algorithms/0344.reverse-string/reverse-string_test.go @@ -0,0 +1,37 @@ +package problem0344 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + {"hello", "olleh"}, + {"world", "dlrow"}, + + // 可以有多个 testcase +} + +func Test_reverseString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reverseString(tc.s), "输入:%v", tc) + } +} + +func Benchmark_reverseString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseString(tc.s) + } + } +} diff --git a/Algorithms/0345.reverse-vowels-of-a-string/README.md b/Algorithms/0345.reverse-vowels-of-a-string/README.md new file mode 100755 index 000000000..aed336862 --- /dev/null +++ b/Algorithms/0345.reverse-vowels-of-a-string/README.md @@ -0,0 +1,18 @@ +# [345. Reverse Vowels of a String](https://leetcode.com/problems/reverse-vowels-of-a-string/) + +## 题目 + +Write a function that takes a string as input and reverse only the vowels of a string. + +Example 1: +Given s = "hello", return "holle". + +Example 2: +Given s = "leetcode", return "leotcede". + +Note: +The vowels does not include the letter "y". + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string.go b/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string.go new file mode 100755 index 000000000..61b3ca795 --- /dev/null +++ b/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string.go @@ -0,0 +1,28 @@ +package problem0345 + +func reverseVowels(s string) string { + bytes := []byte(s) + i, j := 0, len(s)-1 + for { + for i < len(s) && !isVowel(bytes[i]) { + i++ + } + for 0 <= j && !isVowel(bytes[j]) { + j-- + } + + if i >= j { + break + } + + bytes[i], bytes[j] = bytes[j], bytes[i] + i++ + j-- + } + + return string(bytes) +} + +func isVowel(b byte) bool { + return b == 'a' || b == 'e' || b == 'i' || b == 'o' || b == 'u' || b == 'A' || b == 'E' || b == 'I' || b == 'O' || b == 'U' +} diff --git a/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string_test.go b/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string_test.go new file mode 100755 index 000000000..9053bc27a --- /dev/null +++ b/Algorithms/0345.reverse-vowels-of-a-string/reverse-vowels-of-a-string_test.go @@ -0,0 +1,40 @@ +package problem0345 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + {"hello", "holle"}, + + {"leetcode", "leotcede"}, + + {"aA", "Aa"}, + + // 可以有多个 testcase +} + +func Test_reverseVowels(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reverseVowels(tc.s), "输入:%v", tc) + } +} + +func Benchmark_reverseVowels(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseVowels(tc.s) + } + } +} diff --git a/Algorithms/0347.top-k-frequent-elements/README.md b/Algorithms/0347.top-k-frequent-elements/README.md new file mode 100755 index 000000000..45ebf83d2 --- /dev/null +++ b/Algorithms/0347.top-k-frequent-elements/README.md @@ -0,0 +1,17 @@ +# [347. Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements/) + +## 题目 + +Given a non-empty array of integers, return the k most frequent elements. + +For example, +Given [1,1,1,2,2,3] and k = 2, return [1,2]. + +Note: + +1. You may assume k is always valid, 1 ≤ k ≤ number of unique elements. +1. Your algorithm's time complexity must be better than O(n log n), where n is the array's size. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements.go b/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements.go new file mode 100755 index 000000000..1abb36d1f --- /dev/null +++ b/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements.go @@ -0,0 +1,29 @@ +package problem0347 + +import "sort" + +func topKFrequent(nums []int, k int) []int { + res := make([]int, 0, k) + // 统计每个数字出现的次数 + rec := make(map[int]int, len(nums)) + for _, n := range nums { + rec[n]++ + } + // 对出现次数进行排序 + counts := make([]int, 0, len(rec)) + for _, c := range rec { + counts = append(counts, c) + } + sort.Ints(counts) + // min 是 前 k 个高频数字的底线 + min := counts[len(counts)-k] + + // 收集所有 不低于 底线的数字 + for n, c := range rec { + if c >= min { + res = append(res, n) + } + } + + return res +} diff --git a/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements_test.go b/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements_test.go new file mode 100755 index 000000000..fef5c556e --- /dev/null +++ b/Algorithms/0347.top-k-frequent-elements/top-k-frequent-elements_test.go @@ -0,0 +1,40 @@ +package problem0347 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans []int +}{ + + {[]int{1, 1, 1, 2, 2, 3}, 2, []int{1, 2}}, + + // 可以有多个 testcase +} + +func Test_topKFrequent(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := topKFrequent(tc.nums, tc.k) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_topKFrequent(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + topKFrequent(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0349.intersection-of-two-arrays/README.md b/Algorithms/0349.intersection-of-two-arrays/README.md new file mode 100755 index 000000000..5675799c3 --- /dev/null +++ b/Algorithms/0349.intersection-of-two-arrays/README.md @@ -0,0 +1,19 @@ +# [349. Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) + +## 题目 + +Given two arrays, write a function to compute their intersection. + +Example: +Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. + +Note: + +1. Each element in the result must be unique. +1. The result can be in any order. + +## 解题思路 + +intersection: 交集 + +见程序注释 diff --git a/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays.go b/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays.go new file mode 100755 index 000000000..7c49be336 --- /dev/null +++ b/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays.go @@ -0,0 +1,30 @@ +package problem0349 + +func intersection(a1, a2 []int) []int { + res := []int{} + m1 := getInts(a1) + m2 := getInts(a2) + + if len(m1) > len(m2) { + m1, m2 = m2, m1 + } + // m1 是较短的字典,会快一些 + for n := range m1 { + if m2[n] { + res = append(res, n) + } + } + + return res +} + +// 清理重复的值,也便于查询 +func getInts(a []int) map[int]bool { + res := make(map[int]bool, len(a)) + + for i := range a { + res[a[i]] = true + } + + return res +} diff --git a/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays_test.go b/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays_test.go new file mode 100755 index 000000000..186c3f7b9 --- /dev/null +++ b/Algorithms/0349.intersection-of-two-arrays/intersection-of-two-arrays_test.go @@ -0,0 +1,37 @@ +package problem0349 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums1 []int + nums2 []int + ans []int +}{ + + {[]int{1, 2, 2, 1}, []int{2, 2}, []int{2}}, + + // 可以有多个 testcase +} + +func Test_intersection(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, intersection(tc.nums1, tc.nums2), "输入:%v", tc) + } +} + +func Benchmark_intersection(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + intersection(tc.nums1, tc.nums2) + } + } +} diff --git a/Algorithms/0350.intersection-of-two-arrays-ii/README.md b/Algorithms/0350.intersection-of-two-arrays-ii/README.md new file mode 100755 index 000000000..fd1844929 --- /dev/null +++ b/Algorithms/0350.intersection-of-two-arrays-ii/README.md @@ -0,0 +1,23 @@ +# [350. Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/) + +## 题目 + +Given two arrays, write a function to compute their intersection. + +Example: +Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. + +Note: + +1. Each element in the result should appear as many times as it shows in both arrays. +1. The result can be in any order. + +Follow up: + +1. What if the given array is already sorted? How would you optimize your algorithm? +1. What if nums1's size is small compared to nums2's size? Which algorithm is better? +1. What if elements of nums2 are stored on disk, and the memory is limited such that you cannot load all elements into the memory at once? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii.go b/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii.go new file mode 100755 index 000000000..5e0d2b836 --- /dev/null +++ b/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii.go @@ -0,0 +1,41 @@ +package problem0350 + +func intersect(a1, a2 []int) []int { + res := []int{} + m1 := getInts(a1) + m2 := getInts(a2) + + if len(m1) > len(m2) { + m1, m2 = m2, m1 + } + // m1 是较短的字典,会快一些 + for n := range m1 { + m1[n] = min(m1[n], m2[n]) + } + + for n, size := range m1 { + for i := 0; i < size; i++ { + res = append(res, n) + } + } + + return res +} + +// 清理重复的值,也便于查询 +func getInts(a []int) map[int]int { + res := make(map[int]int, len(a)) + + for i := range a { + res[a[i]]++ + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii_test.go b/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii_test.go new file mode 100755 index 000000000..0731bb1a0 --- /dev/null +++ b/Algorithms/0350.intersection-of-two-arrays-ii/intersection-of-two-arrays-ii_test.go @@ -0,0 +1,43 @@ +package problem0350 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums1 []int + nums2 []int + ans []int +}{ + + {[]int{1, 2, 2, 1}, []int{2, 2}, []int{2, 2}}, + {[]int{1, 3, 3, 3, 2, 2, 1}, []int{3, 2, 2}, []int{2, 2, 3}}, + + // 可以有多个 testcase +} + +func Test_intersect(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + ans := intersect(tc.nums1, tc.nums2) + sort.Ints(ans) + + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_intersect(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + intersect(tc.nums1, tc.nums2) + } + } +} diff --git a/Algorithms/0352.data-stream-as-disjoint-intervals/README.md b/Algorithms/0352.data-stream-as-disjoint-intervals/README.md new file mode 100755 index 000000000..0c27e9933 --- /dev/null +++ b/Algorithms/0352.data-stream-as-disjoint-intervals/README.md @@ -0,0 +1,24 @@ +# [352. Data Stream as Disjoint Intervals](https://leetcode.com/problems/data-stream-as-disjoint-intervals/) + +## 题目 + +Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. + +For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ..., then the summary will be: + +```text +[1, 1] +[1, 1], [3, 3] +[1, 1], [3, 3], [7, 7] +[1, 3], [7, 7] +[1, 3], [6, 7] +``` + +Follow up: +What if there are lots of merges and the number of disjoint intervals are small compared to the data stream's size? + +Credits:Special thanks to @yunhong for adding this problem and creating most of the test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals.go b/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals.go new file mode 100755 index 000000000..2d0eeed55 --- /dev/null +++ b/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals.go @@ -0,0 +1,100 @@ +package problem0352 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/** + * Definition for an interval. + * type Interval struct { + * Start int + * End int + * } + */ +type Interval = kit.Interval + +type SummaryRanges struct { + is []Interval +} + +/** Initialize your data structure here. */ +func Constructor() SummaryRanges { + return SummaryRanges{} +} + +func (sr *SummaryRanges) Addnum(val int) { + if sr.is == nil { + sr.is = []Interval{ + Interval{ + Start: val, + End: val, + }, + } + return + } + + lo, hi := 0, len(sr.is)-1 + for lo <= hi { + mid := lo + (hi-lo)>>1 + if sr.is[mid].Start <= val && val <= sr.is[mid].End { + return + } else if val < sr.is[mid].Start { + hi = mid - 1 + } else { + lo = mid + 1 + } + } + + if lo == 0 { + if sr.is[0].Start-1 == val { + sr.is[0].Start-- + return + } + ni := Interval{Start: val, End: val} + sr.is = append(sr.is, ni) + copy(sr.is[1:], sr.is) + sr.is[0] = ni + return + } + + if lo == len(sr.is) { + if sr.is[lo-1].End+1 == val { + sr.is[lo-1].End++ + return + } + sr.is = append(sr.is, Interval{Start: val, End: val}) + return + } + + if sr.is[lo-1].End+1 < val && val < sr.is[lo].Start-1 { + sr.is = append(sr.is, Interval{}) + copy(sr.is[lo+1:], sr.is[lo:]) + sr.is[lo] = Interval{Start: val, End: val} + return + } + + if sr.is[lo-1].End == val-1 && val+1 == sr.is[lo].Start { + sr.is[lo-1].End = sr.is[lo].End + n := len(sr.is) + copy(sr.is[lo:], sr.is[lo+1:]) + sr.is = sr.is[:n-1] + return + } + + if sr.is[lo-1].End == val-1 { + sr.is[lo-1].End++ + } else { + sr.is[lo].Start-- + } +} + +func (sr *SummaryRanges) Getintervals() []Interval { + return sr.is +} + +/** + * Your SummaryRanges object will be instantiated and called as such: + * obj := Constructor(); + * obj.Addnum(val); + * param_2 := obj.Getintervals(); + */ diff --git a/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals_test.go b/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals_test.go new file mode 100755 index 000000000..aa86b21fe --- /dev/null +++ b/Algorithms/0352.data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals_test.go @@ -0,0 +1,99 @@ +package problem0352 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + sr := Constructor() + + sr.Addnum(1) + ast.Equal([]Interval{Interval{Start: 1, End: 1}}, sr.Getintervals()) + + sr.Addnum(7) + ast.Equal([]Interval{ + Interval{Start: 1, End: 1}, + Interval{Start: 7, End: 7}, + }, + sr.Getintervals(), + ) + + sr.Addnum(3) + ast.Equal([]Interval{ + Interval{Start: 1, End: 1}, + Interval{Start: 3, End: 3}, + Interval{Start: 7, End: 7}, + }, + sr.Getintervals(), + ) + + sr.Addnum(2) + ast.Equal([]Interval{ + Interval{Start: 1, End: 3}, + Interval{Start: 7, End: 7}, + }, + sr.Getintervals(), + ) + + sr.Addnum(8) + ast.Equal([]Interval{ + Interval{Start: 1, End: 3}, + Interval{Start: 7, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(2) + ast.Equal([]Interval{ + Interval{Start: 1, End: 3}, + Interval{Start: 7, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(2) + ast.Equal([]Interval{ + Interval{Start: 1, End: 3}, + Interval{Start: 7, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(4) + ast.Equal([]Interval{ + Interval{Start: 1, End: 4}, + Interval{Start: 7, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(6) + ast.Equal([]Interval{ + Interval{Start: 1, End: 4}, + Interval{Start: 6, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(0) + ast.Equal([]Interval{ + Interval{Start: 0, End: 4}, + Interval{Start: 6, End: 8}, + }, + sr.Getintervals(), + ) + + sr.Addnum(-2) + ast.Equal([]Interval{ + Interval{Start: -2, End: -2}, + Interval{Start: 0, End: 4}, + Interval{Start: 6, End: 8}, + }, + sr.Getintervals(), + ) + +} diff --git a/Algorithms/0354.russian-doll-envelopes/README.md b/Algorithms/0354.russian-doll-envelopes/README.md new file mode 100755 index 000000000..b289fe20c --- /dev/null +++ b/Algorithms/0354.russian-doll-envelopes/README.md @@ -0,0 +1,17 @@ +# [354. Russian Doll Envelopes](https://leetcode.com/problems/russian-doll-envelopes/) + +## 题目 + +You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope. + +What is the maximum number of envelopes can you Russian doll? (put one inside other) + +Example: + +```text +Given envelopes = [[5,4],[6,4],[6,7],[2,3]], the maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]). +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes.go b/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes.go new file mode 100755 index 000000000..fb9a8c4da --- /dev/null +++ b/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes.go @@ -0,0 +1,55 @@ +package problem0354 + +import "sort" + +func maxEnvelopes(e [][]int) int { + if len(e) <= 1 { + return len(e) + } + + sort.Sort(sortedEnvelopes(e)) + + var tails []int + + for i := 0; i < len(e); i++ { + lo, hi := 0, len(tails) + // 按照信封高度来二分查找插入 + for lo < hi { + mid := (lo + hi) / 2 + if e[i][1] <= tails[mid] { + hi = mid + } else { + lo = mid + 1 + } + } + + // 出现了新高度,添加到 tail 尾部 + if lo == len(tails) { + tails = append(tails, e[i][1]) + } else { + // e[i][1] 是一个更合理的高度, + // 用 e[i][1] 替换掉 tails[lo] 可以避免遗漏最优解 + tails[lo] = e[i][1] + } + } + + return len(tails) +} + +type sortedEnvelopes [][]int + +func (s sortedEnvelopes) Len() int { + return len(s) +} + +func (s sortedEnvelopes) Less(i, j int) bool { + if s[i][0] == s[j][0] { + // 同样宽度时,矮信封排在后面 + return s[i][1] > s[j][1] + } + return s[i][0] < s[j][0] +} + +func (s sortedEnvelopes) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} diff --git a/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes_test.go b/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes_test.go new file mode 100755 index 000000000..f171c7dd3 --- /dev/null +++ b/Algorithms/0354.russian-doll-envelopes/russian-doll-envelopes_test.go @@ -0,0 +1,61 @@ +package problem0354 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + envelopes [][]int + ans int +}{ + + { + [][]int{ + []int{46, 89}, + []int{50, 53}, + []int{52, 68}, + []int{72, 45}, + []int{77, 81}, + }, + 3, + }, + + { + [][]int{ + []int{5, 4}, + []int{6, 4}, + []int{6, 7}, + []int{2, 3}, + []int{100, 4}, + }, + 3, + }, + + { + [][]int{}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_maxEnvelopes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxEnvelopes(tc.envelopes), "输入:%v", tc) + } +} + +func Benchmark_maxEnvelopes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxEnvelopes(tc.envelopes) + } + } +} diff --git a/Algorithms/0355.design-twitter/README.md b/Algorithms/0355.design-twitter/README.md new file mode 100755 index 000000000..80815981a --- /dev/null +++ b/Algorithms/0355.design-twitter/README.md @@ -0,0 +1,43 @@ +# [355. Design Twitter](https://leetcode.com/problems/design-twitter/) + +## 题目 + +Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user's news feed. Your design should support the following methods: + +1. postTweet(userId, tweetId): Compose a new tweet. +1. getNewsFeed(userId): Retrieve the 10 most recent tweet ids in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user herself. Tweets must be ordered from most recent to least recent. +1. follow(followerId, followeeId): Follower follows a followee. +1. unfollow(followerId, followeeId): Follower unfollows a followee. + +Example: + +```text +Twitter twitter = new Twitter(); + +// User 1 posts a new tweet (id = 5). +twitter.postTweet(1, 5); + +// User 1's news feed should return a list with 1 tweet id -> [5]. +twitter.getNewsFeed(1); + +// User 1 follows user 2. +twitter.follow(1, 2); + +// User 2 posts a new tweet (id = 6). +twitter.postTweet(2, 6); + +// User 1's news feed should return a list with 2 tweet ids -> [6, 5]. +// Tweet id 6 should precede tweet id 5 because it is posted after tweet id 5. +twitter.getNewsFeed(1); + +// User 1 unfollows user 2. +twitter.unfollow(1, 2); + +// User 1's news feed should return a list with 1 tweet id -> [5], +// since user 1 is no longer following user 2. +twitter.getNewsFeed(1); +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0355.design-twitter/design-twitter.go b/Algorithms/0355.design-twitter/design-twitter.go new file mode 100755 index 000000000..b9ce9d4a6 --- /dev/null +++ b/Algorithms/0355.design-twitter/design-twitter.go @@ -0,0 +1,100 @@ +package problem0355 + +import "sort" +import "time" + +type tweet struct { + id int + time int64 +} + +// tweets 用于排序 +type tweets []tweet + +func (t tweets) Len() int { + return len(t) +} +func (t tweets) Less(i, j int) bool { + return t[i].time > t[j].time +} +func (t tweets) Swap(i, j int) { + t[i], t[j] = t[j], t[i] +} + +// Twitter is twitter user +type Twitter struct { + userTweets map[int]tweets + follow map[int][]int +} + +// Constructor initialize your data structure here. +func Constructor() Twitter { + t := make(map[int]tweets) + f := make(map[int][]int) + return Twitter{userTweets: t, follow: f} +} + +// PostTweet compose a new tweet. +func (t *Twitter) PostTweet(userID int, tweetID int) { + t.userTweets[userID] = append( + t.userTweets[userID], + tweet{ + id: tweetID, + time: time.Now().UnixNano(), + }, + ) +} + +// GetNewsFeed retrieve the 10 most recent tweet ids in the user's news feed. Each item in the news feed must be posted by users who the user followed or by the user herself. Tweets must be ordered from most recent to least recent. +func (t *Twitter) GetNewsFeed(userID int) []int { + // 获取本人的 tweets + temp := make(tweets, len(t.userTweets[userID])) + copy(temp, t.userTweets[userID]) + // 获取 followee 的 tweets + for _, id := range t.follow[userID] { + temp = append(temp, t.userTweets[id]...) + } + // 按照时间排序 + sort.Sort(temp) + // 获取最近的 10 条或更少的内容 + res := make([]int, 0, 10) + for i := 0; i < len(temp) && i < 10; i++ { + res = append(res, temp[i].id) + } + return res +} + +// Follow followee. If the operation is invalid, it should be a no-op. +func (t *Twitter) Follow(followerID int, followeeID int) { + // 不能 follow 自己 + if followerID == followeeID { + return + } + // 不能重复 follow + for _, id := range t.follow[followerID] { + if id == followeeID { + return + } + } + + t.follow[followerID] = append(t.follow[followerID], followeeID) +} + +// Unfollow follower unfollows a followee. If the operation is invalid, it should be a no-op. +func (t *Twitter) Unfollow(followerID int, followeeID int) { + for i, id := range t.follow[followerID] { + if id == followeeID { + // 删除 followeeID 记录 + t.follow[followerID] = append(t.follow[followerID][:i], t.follow[followerID][i+1:]...) + } + } +} + +/** + * Your Twitter object will be instantiated and called as such: + * obj := Constructor(); + * obj.PostTweet(userID,tweetID); + * param_2 := obj.GetNewsFeed(userID); + * obj.Follow(followerID,followeeID); + * obj.Unfollow(followerID,followeeID); + */ diff --git a/Algorithms/0355.design-twitter/design-twitter_test.go b/Algorithms/0355.design-twitter/design-twitter_test.go new file mode 100755 index 000000000..6440a0dc2 --- /dev/null +++ b/Algorithms/0355.design-twitter/design-twitter_test.go @@ -0,0 +1,28 @@ +package problem0355 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + twitter := Constructor() + + twitter.PostTweet(1, 5) + twitter.Follow(1, 1) + + ast.Equal([]int{5}, twitter.GetNewsFeed(1)) + + twitter.Follow(1, 2) + + twitter.PostTweet(2, 4) + + ast.Equal([]int{4, 5}, twitter.GetNewsFeed(1)) + + twitter.Follow(1, 2) + twitter.Unfollow(1, 2) + + ast.Equal([]int{5}, twitter.GetNewsFeed(1)) +} diff --git a/Algorithms/0357.count-numbers-with-unique-digits/README.md b/Algorithms/0357.count-numbers-with-unique-digits/README.md new file mode 100755 index 000000000..5799ae131 --- /dev/null +++ b/Algorithms/0357.count-numbers-with-unique-digits/README.md @@ -0,0 +1,14 @@ +# [357. Count Numbers with Unique Digits](https://leetcode.com/problems/count-numbers-with-unique-digits/) + +## 题目 + +Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. + +Example: +Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100, excluding [11,22,33,44,55,66,77,88,99]) + +Credits:Special thanks to @memoryless for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits.go b/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits.go new file mode 100755 index 000000000..8fbaf6d1d --- /dev/null +++ b/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits.go @@ -0,0 +1,12 @@ +package problem0357 + +var res = []int{1, 10, 91, 739, 5275, 32491, 168571, 712891, 2345851, 5611771, 8877691} + +func countNumbersWithUniqueDigits(n int) int { + if n >= 10 { + return res[10] + } + return res[n] +} + +// 参考 《代码大全2》 第 18 章 表驱动法 diff --git a/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits_test.go b/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits_test.go new file mode 100755 index 000000000..0ce8f6e0a --- /dev/null +++ b/Algorithms/0357.count-numbers-with-unique-digits/count-numbers-with-unique-digits_test.go @@ -0,0 +1,47 @@ +package problem0357 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {0, 1}, + {1, 10}, + {2, 91}, + {3, 739}, + {4, 5275}, + {5, 32491}, + {6, 168571}, + {7, 712891}, + {8, 2345851}, + {9, 5611771}, + {10, 8877691}, + {11, 8877691}, + + // 可以有多个 testcase +} + +func Test_countNumbersWithUniqueDigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countNumbersWithUniqueDigits(tc.n), "输入:%v", tc) + } +} + +func Benchmark_countNumbersWithUniqueDigits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countNumbersWithUniqueDigits(tc.n) + } + } +} diff --git a/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/363.100.png b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/363.100.png new file mode 100644 index 000000000..4f8d6424e Binary files /dev/null and b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/363.100.png differ diff --git a/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/README.md b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/README.md new file mode 100755 index 000000000..e8234c728 --- /dev/null +++ b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/README.md @@ -0,0 +1,30 @@ +# [363. Max Sum of Rectangle No Larger Than K](https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/) + +## 题目 + +Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. + +Example: + +```text +Given matrix = [ + [1, 0, 1], + [0, -2, 3] +] +k = 2 +``` + +The answer is 2. Because the sum of rectangle [[0, 1], [-2, 3]] is 2 and 2 is the max number no larger than k (k = 2). + +Note: + +1. he rectangle inside the matrix must have an area > 0. +1. hat if the number of rows is much larger than the number of columns? + +Credits:Special thanks to @fujiaozhu for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 + +![100](363.100.png) \ No newline at end of file diff --git a/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k.go b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k.go new file mode 100755 index 000000000..bb414b5aa --- /dev/null +++ b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k.go @@ -0,0 +1,165 @@ +package problem0363 + +func maxSumSubmatrix(mat [][]int, target int) int { + if len(mat) == 0 || len(mat[0]) == 0 { + return 0 + } + + m, n := len(mat), len(mat[0]) + // 本算法的复杂度是 O(M*M*N*logN) + // 让 N = max(m,n) 可以加快程序 + M := min(m, n) + N := max(m, n) + // 从此开始称, M 为行,N 为列 + + ans := -1 << 63 + + var findTarget func([]int, int, int) int + // 运用归并排序,在给 sums 排序的同时 + // 查找符合 <=target 的最大值 + findTarget = func(sums []int, beg, end int) int { + if beg+1 >= end { + return -1 << 63 + } + + mid := (beg + end) >> 1 + + res := max(findTarget(sums, beg, mid), findTarget(sums, mid, end)) + if res == target { + return res + } + + l, r := beg, mid + // sums[mid:end] 中任意的的 sums[r] 和 + // sums[beg:mid] 中任意的的 sums[l] 相减 + // temp = sums[r] - sums[l]都是某个子矩阵的所有元素之和 + // 此时,由于 sums[beg:mid] 和 sums[mid:end] 都是递增的 + // 可以避免不必要的检查 + for l < mid && r < end { + temp := sums[r] - sums[l] + switch { + case temp < target: + res = max(res, temp) + // r++ 可以让 temp 变大 + // 这样才可能找到 更大的 res + r++ + case temp > target: + // temp > target + // l++ 能让 temp 变小 + l++ + default: + // 命中 target + // 结束程序 + return target + } + } + + // 另外使用归并排序,这样的程序更简洁 + copy(sums[beg:end], merge(sums[beg:mid], sums[mid:end])) + + return res + } + + var iFirst, iLast, j, minSum, maxSub int + var temp, sums []int + + for iFirst = 0; iFirst < M; iFirst++ { + // temp[j] 表示 mat[iFirst:iLast+1][j] 中所有元素之和 + temp = make([]int, N) + for iLast = iFirst; iLast < M; iLast++ { + // sums[j] 是 mat[iFirst:iLast+1][:j+1] 中所有元素之和 + // sums[j2] - sums[j1], j1 < j2 表示 + // mat[iFisrt:iLast+1][j1:j2+1] 中所有元素之和 + // sums 中添加 0 为了 sums[j] - 0 , 表示 + // mat[iFisrt:iLast+1][:j+1] 中所有元素之和 + sums = []int{0} + // maxSub 是 mat[iFirst:iLast+1][:] 中所有子矩阵中,所有元素之和的 最大值 + maxSub = -1 << 63 + // minSum 是 sums 中的 最小值 + minSum = 0 + + for j = 0; j < N; j++ { + // 分情况更新 temp[j] + if m < n { + temp[j] += mat[iLast][j] + } else { + temp[j] += mat[j][iLast] + } + + sums = append(sums, sums[len(sums)-1]+temp[j]) + // 求解 maxSub 的算法解释,看这里 + // https://www.youtube.com/watch?v=yCQN096CwWM + maxSub = max(maxSub, sums[len(sums)-1]-minSum) + minSum = min(minSum, sums[len(sums)-1]) + // TODO: 弄清楚这里的内容 + } + + // ans < target + // ---- ans ---- target ---> + // 分 3 中情况讨论 maxSub 的值 + switch { + case maxSub < target: + // 可知,此时,maxSub == findTarget(sums,0,N+1) + // 这时就体现了 maxSub 的巨大作用了 + // 省掉了运行 findTarget 的时间 + ans = max(ans, maxSub) + case maxSub > target: + // mat[iFirst:iLast+1][:] 中可能有个子矩阵的所有元素之和, + // 比 ans 更接近 target + // 需要运行 findTarget 查找 + tempAns := findTarget(sums, 0, N+1) + if tempAns == target { + // 找到答案,可以结束程序了 + return target + } + ans = max(ans, tempAns) + default: + // 找到答案,可以结束程序了 + return target + } + } + } + + return ans +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +// a, b 都是升序的切片 +// merge 把 a,b 合并起来,并保持升序 +func merge(a, b []int) []int { + lenA, lenB := len(a), len(b) + temp := make([]int, lenA+lenB) + + var i, j, k int + for i < lenA && j < lenB { + if a[i] < b[j] { + temp[k] = a[i] + i++ + } else { + temp[k] = b[j] + j++ + } + k++ + } + + if i == lenA { + copy(temp[k:], b[j:]) + } else { + copy(temp[k:], a[i:]) + } + + return temp +} diff --git a/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k_test.go b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k_test.go new file mode 100755 index 000000000..a95ea7a27 --- /dev/null +++ b/Algorithms/0363.max-sum-of-rectangle-no-larger-than-k/max-sum-of-rectangle-no-larger-than-k_test.go @@ -0,0 +1,295 @@ +package problem0363 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + k int + ans int +}{ + { + [][]int{ + []int{2, 2, -1}, + }, + 3, + 3, + }, + + { + [][]int{ + []int{1, 0, 1}, + []int{0, -2, 3}, + }, + 2, + 2, + }, + + { + [][]int{ + []int{3, 1, 1}, + []int{-2, 3, 0}, + }, + 3, + 3, + }, + + { + [][]int{ + []int{0, 1, 1}, + []int{-2, 3, 0}, + }, + 2, + 2, + }, + + { + [][]int{}, + 2, + 0, + }, + + { + [][]int{ + []int{2, 2, -1}, + }, + 0, + -1, + }, + + { + [][]int{ + []int{9, -10, -3, -1, 1, 7, -6, -2, 1, -4, -6, -8, -1, 2, -9, -7, -9, -1, -1, 5, -4, 5, -8, 3, 4, 2, 9, 4, 5, 4, -8, 5, 4, -9, -10, 3, -2, -2, 9, 0, -4, 3, 5, -10, 8, -10, 9, -7, -6, 1, 2, 6, -8, 1, 7, 3, 0, -5, 7, -6, 1, 9, -8, 4, -7, -9, 1, 8, -2, 6, -1, 0, 8, 4, -9, 8, -3, 7, -4, 3, -6, 2, -1, -2, -10, -10, -10, -3, 8, 2, -4, 3, -6, -3, 1, 9, -9, 7, -6, 8}, + []int{8, -10, -4, -5, 7, 2, -6, 7, -9, 0, -8, 9, -4, -5, -2, 3, 2, 7, 3, 3, 0, -3, -10, 8, -9, 3, -6, -9, 3, -10, 9, 9, -3, 6, -8, -7, 5, 5, 9, 5, -6, 6, 1, 4, 4, -5, -1, 2, 9, -8, 8, -9, -9, -6, 8, -3, 1, 0, -7, 9, 8, -3, -9, -4, 8, -2, -9, 2, 7, -3, 0, 6, -7, 3, 3, -8, 1, -2, -6, -5, 3, 6, 0, -9, -6, -4, -10, -6, 8, 3, 1, 0, -1, -5, -10, 5, -2, -5, -10, 6}, + []int{-3, -5, -1, -8, -7, -6, -6, 0, 7, 0, 3, -6, -9, 7, -5, -7, 8, 4, -4, 2, 7, -4, -6, 4, -9, -8, -1, -9, -1, 8, 3, 8, -2, 2, -2, 5, 9, -1, 3, -6, 8, 2, -6, -2, 2, 2, -8, -2, -2, 0, 6, 2, 2, 4, -1, -3, -3, 4, -2, 4, -6, -7, 3, 2, -6, 3, 5, -10, -6, 7, -4, -4, -3, -5, -8, -7, -9, -8, -7, 5, -9, 7, 8, -10, 7, 6, 6, -1, -3, 4, 4, -2, 3, -1, -9, -10, -5, -7, 8, -1}, + []int{-8, -3, 3, 7, 9, -5, 3, 5, -1, -9, 5, 8, 5, 2, 6, 6, -5, -2, -6, 5, -2, -5, 3, 2, -1, -7, 5, -3, -6, 0, 4, -4, -6, 9, -6, -9, -10, 7, 9, 3, 6, -6, 4, -3, -7, -9, -3, 6, -3, 0, 7, 9, -7, -3, 9, -8, 2, 7, -9, 6, 2, 8, -5, 5, -7, 0, -5, 3, 8, -6, 8, -5, -9, -6, -5, -7, 5, -3, 7, 2, 3, 5, -2, -3, -3, 3, 4, -4, 0, 2, -4, 3, -3, -6, -2, -3, -4, 9, -3, -7}, + []int{8, 8, 6, -3, 2, 9, 0, -8, 5, -8, 1, 1, 1, -8, 9, 2, -5, -8, -10, -6, -1, 1, -9, -10, 3, 1, -6, 2, -8, -8, 7, 7, -2, -2, -6, 8, 8, 6, 0, -10, 0, -3, 8, -4, -8, 2, 1, -1, 6, 4, 6, -7, 2, 0, -10, -4, 5, 5, -7, -10, 0, -10, -9, -6, 9, -1, -5, -3, 5, 2, -9, 6, -9, -5, 2, -9, -8, -7, -2, 2, -5, 0, -4, 2, -1, 0, -8, -7, 3, -1, -7, 9, 9, 9, -8, -2, -2, 7, 3, -4}, + []int{8, -1, -2, -2, 9, 6, 9, -6, 8, -1, 5, 1, -10, -2, 7, 9, 6, 8, 5, 9, -4, 6, -8, -7, -10, -4, 6, -5, 4, 3, 9, -3, -6, 0, -1, 4, -5, -9, 4, 8, -3, -4, 8, -3, -6, 5, 5, 6, 0, -4, 5, 0, -3, -2, -8, 9, 4, 8, 9, 5, -8, -3, 9, 8, 2, 9, -8, -7, 1, 1, 2, -9, -10, -2, 5, 2, -8, -6, 1, 1, 5, 4, -4, 9, 9, 8, 0, -8, 3, -5, 1, -9, 2, -4, 3, -8, 9, -1, 7, -7}, + []int{-10, 0, 9, 9, -4, -9, -6, -4, -5, 7, -1, 5, 8, 1, -6, -3, 5, 7, -9, -1, -10, 8, 2, 2, -7, -3, 3, -5, -5, 9, 6, -5, -1, -7, -8, 7, -6, -5, 9, -10, -4, -5, -5, -5, 6, 2, -5, 8, -4, -5, -1, -2, -2, 4, -8, -10, -7, -6, -7, -9, 3, 3, 3, 9, 7, 6, -5, -7, 9, 0, 1, 2, -6, 3, 2, 7, 6, 0, -9, 2, -5, -8, 3, -7, -2, -3, 7, -1, 3, 6, -7, -3, -10, 1, -8, -7, -9, 6, 2, 3}, + []int{9, -8, -7, 6, -6, 5, -6, 9, 9, 9, 3, -5, -10, 3, -5, -9, -1, -7, -8, 4, 7, -7, 8, 9, 7, -8, -8, -4, -10, -2, 9, -4, 5, 6, 3, -9, -1, 7, -4, -7, 3, 3, 9, 2, 8, 3, -1, -6, 4, 4, 9, -5, -8, -8, 0, -6, -9, -8, 7, -6, -3, -4, -8, -3, -3, -5, 6, -3, -10, 1, 8, -10, -5, 6, -1, -4, 2, 1, 3, -4, -10, 4, -8, -10, -5, -2, 6, -2, -7, -9, 1, 3, -9, -1, -9, -2, 3, -10, 2, -1}, + []int{-5, 9, 7, 2, -6, 4, 3, -6, 3, 8, 3, -2, 4, -5, 7, 2, 7, 4, 3, -1, 2, 3, 2, -6, 1, -5, -2, 7, 8, 7, 3, -9, -3, -7, -5, 3, -5, -1, -9, -7, 0, 0, 8, -4, 3, -3, 8, -5, 1, 8, 1, 2, 9, -5, 6, -8, -5, 1, -7, 0, 3, 2, -3, 7, 5, -3, 6, 2, -10, 7, 1, -4, 8, 1, 4, 9, -5, 8, 1, 5, 5, 0, -10, -1, 7, 7, 5, -2, 0, 0, 1, -3, -10, 4, -8, 0, 2, -9, 2, -6}, + []int{-3, -6, 3, -2, 0, 8, 0, -1, 3, 2, -8, -1, -6, -4, 4, -7, 0, -8, 7, -10, 1, -7, 8, 9, -7, 8, 1, 6, 9, 5, 9, -7, 6, -10, -1, 2, -1, -4, 5, 4, -8, -5, 4, -6, 1, 6, 5, 6, -1, 1, 5, 4, 5, -10, 7, -7, 9, -1, -2, 9, -6, 7, 6, 1, 1, -2, 3, -3, 3, 5, -3, -7, -7, -7, 4, -10, 5, -4, 0, 4, -3, 7, 5, -6, 5, 9, -9, 1, 6, 7, -4, -4, -9, 3, 8, 3, 3, 7, -10, -9}, + []int{-7, 4, -10, 6, -1, -2, 6, -5, -5, 5, 5, 0, -7, 4, 0, -10, -4, 6, 7, 1, -1, 6, 4, 1, -1, -5, 9, 3, 0, -8, 4, 0, 7, 4, 2, -5, -6, 5, 5, -7, -2, -2, -1, -2, 0, -6, -9, -3, 7, -1, -2, -4, 9, -8, 0, 2, 0, -6, 8, 5, 3, -7, 5, 0, -7, -3, -5, -1, -7, -9, -3, 8, 3, 2, -8, 2, 1, -3, -8, -1, 6, -6, -6, 8, -9, -1, -2, -8, 7, 1, 1, -7, 0, 3, 1, 6, -2, 4, 0, -8}, + []int{0, -5, 2, -5, 1, -3, -5, -9, 9, 3, -3, 8, 4, 6, -6, -5, -10, -7, -4, -1, 7, -9, 0, 2, 9, 8, -4, 7, -1, -8, -3, -8, 0, -3, 8, -5, -7, 7, -8, 3, 8, 6, 4, -8, -10, 4, 9, -10, 9, 6, -4, -10, -3, 0, 5, -3, 3, -6, -10, 7, 8, 5, -7, -8, -7, -3, -8, -4, 7, -3, 0, 0, -3, -10, 3, -10, 7, -9, -7, 5, 9, 4, -4, -6, 0, -4, -8, -2, -7, -3, 0, 6, -8, 7, -6, 3, -6, 8, -8, -10}, + []int{-10, 6, 1, 3, -4, 9, -7, 3, 3, 7, 1, -8, -6, 5, -2, -4, -3, 4, 2, 5, 1, 4, 8, 0, 3, 7, -1, -1, 0, 5, -7, -3, 3, 7, -4, -9, 7, 9, -6, -8, -4, 5, 5, 2, -1, -4, 1, 6, -4, -9, -7, -10, -1, -1, 3, 8, -10, 8, -8, 2, -6, 8, -5, -4, 5, 2, 1, -10, 3, -3, 1, -6, 4, -1, 5, 0, -4, -2, -3, 8, -4, 9, 2, 4, 0, -6, -6, -5, 9, -9, 9, 5, 1, -2, -5, 8, -3, 9, -7, -2}, + []int{-5, 6, -4, 4, 7, 0, -10, -2, 3, -10, -10, 8, 1, 7, 2, -3, 8, -2, 3, 5, -9, -5, -1, -8, -7, -10, -9, 5, 2, 8, -10, -3, 9, -1, -10, -7, -6, -7, 2, 0, 9, -8, 4, -3, 0, -8, 7, 7, 2, -10, 0, 2, -3, 8, 8, -5, 1, 0, -3, 7, -7, 1, -2, -7, 9, 0, -5, 8, -7, -4, -2, -10, -3, 0, -1, -2, 9, -3, -5, -1, 3, 6, -1, -2, -6, 2, 9, -2, 6, 9, 3, -10, -10, 6, -9, -6, 8, 1, 8, 6}, + []int{-9, 4, -2, -8, 5, -5, 3, 8, -9, 4, 8, -7, -10, 7, -2, -7, 7, 6, 3, -4, -1, 8, -5, 9, 8, -9, -1, 6, -6, 3, -9, 7, 5, 5, -9, 9, 5, 4, 4, -9, -1, 3, 4, -4, 8, -4, 0, 2, -8, 3, -8, -5, 0, 5, 8, 2, 3, 2, 8, -8, 6, -7, 5, 3, -2, -8, -1, 6, -6, -8, -5, -10, 5, -7, 6, -3, 8, -7, -8, -10, 4, -3, 1, -3, -5, 5, -10, -1, 0, 9, -8, -5, -4, -4, 6, -3, 7, 0, 8, 7}, + []int{0, -3, -2, -5, 4, 7, 5, 5, 3, -10, 0, -3, 0, 9, -9, -1, 2, 3, 9, 5, 3, 7, -10, 0, 6, -6, -1, -9, 3, -3, 0, -8, -10, 5, -10, 8, -8, 0, -9, -10, 1, -4, -9, -9, 7, -10, 5, 4, 5, -1, -4, -1, 3, -3, -2, -1, 1, 1, -10, -9, -9, -8, 1, 0, 1, -8, -4, -6, 2, -8, 7, 8, -7, 2, 9, -5, 5, 4, 6, 2, -7, -7, -7, -9, -7, -2, 8, -1, 8, -7, 9, -10, -1, 8, 2, -7, 4, 0, 2, -7}, + []int{-10, 4, 5, 1, 4, 9, -2, -1, -4, -4, 4, 3, -2, -6, -4, -9, 5, -2, 0, -6, 9, 8, -2, 0, 2, 1, -10, -7, -4, 7, 2, -3, -5, -2, 1, -9, -3, -8, -6, -3, -6, 1, 2, 0, 3, -7, 7, 4, 6, -6, -2, -2, 0, 8, 3, -4, 4, 3, -5, -3, 8, -7, -5, -10, 6, 4, -1, -4, -7, -9, 5, -2, -5, -5, 4, 5, -8, 7, 3, 2, 4, -4, 6, 0, 2, 8, -5, -4, -1, -9, 4, 5, -7, 4, 0, -1, 6, -10, -9, 6}, + []int{-9, 6, -8, -2, 8, -2, -2, -2, 7, 2, -4, 5, 1, -10, 4, -8, -5, -3, -7, -10, 0, -7, 9, 1, 3, 2, 7, 1, 0, -9, 6, -6, 4, -10, 5, 5, 5, -1, 7, 2, 6, 1, 2, 5, -10, -8, 4, 2, 6, -6, -1, -5, -2, -9, -6, -8, 5, -2, -1, 8, 4, 7, 2, -1, 7, 2, -7, -6, 1, -3, 6, -9, 9, 5, -6, -3, 1, 9, 3, 6, 8, -9, 4, 7, -5, 3, -1, -1, -9, 9, -8, -8, 9, 2, 4, -5, 9, -2, 5, -10}, + []int{8, 5, -8, 7, -3, 4, 6, -2, 6, -3, -5, -9, -8, -3, -4, -7, -9, 4, 4, -2, -1, -10, -2, 9, -9, 5, -3, -8, 6, -5, 3, 5, 0, 2, -2, 3, 5, 5, -8, 4, -7, 8, -2, -6, -1, -1, -1, 7, 3, 6, 5, -3, 6, -7, -7, -2, -5, -1, -5, -5, 5, 4, 5, -9, -6, -4, 8, 3, 2, 0, 6, -1, 9, -9, -10, 3, 1, 5, -7, -1, -9, 2, -1, 8, 7, -10, -7, 8, -3, -8, 8, 4, -9, 5, 9, -4, -3, -9, -2, -10}, + []int{4, -6, -10, -5, 2, 5, -7, -6, 5, -5, -6, -10, -10, -1, -4, -5, 8, -10, -10, 0, -8, -7, 2, -9, 7, -9, -3, -9, -1, 0, -7, -10, -6, 5, -2, -5, 9, -6, 1, 7, -9, -6, 6, -8, 9, 6, -7, 1, 5, 0, 0, -1, 1, -7, -9, -9, 6, 1, 0, -6, -4, -6, 3, 5, -3, -4, -4, -3, 6, 7, -4, 9, 8, 1, -10, 1, -9, 1, -5, 3, -1, 5, 7, -8, -8, 0, -6, -10, -1, 3, 9, 7, 9, 9, -2, 4, 4, -4, -5, -1}, + []int{-4, -2, -7, -10, 0, 0, 0, 5, 1, 6, 4, -7, -6, -5, 4, 6, 0, -1, 6, 6, -9, -2, -6, -1, -10, -6, 0, -5, -8, 3, 7, -10, -8, -6, -1, -4, -6, -4, 1, -1, 2, -7, 6, 3, -7, -8, 5, 0, 1, -7, -7, 8, -2, 5, 6, -10, -10, -8, -9, 2, 9, -4, 8, 5, 9, -4, 4, 0, 3, 0, -6, 8, -5, 4, -4, 8, -7, 4, -4, 7, 0, -6, 2, 8, -9, -8, -3, -9, 6, -5, 5, 4, -6, 0, -2, -2, 8, -6, 7, 9}, + []int{-5, 8, -7, 4, -5, 1, -7, -6, -3, -7, 7, 7, 9, -2, 9, 1, 7, 3, 3, 8, 9, -8, -8, -9, 7, -6, -7, -9, 8, -5, -8, -7, -3, 9, -8, -1, 0, 3, 7, -9, 2, 9, -4, -8, 3, 6, -2, -7, 5, 3, 8, -5, 4, 9, 7, -3, 9, -2, -7, 9, -10, -4, -1, -6, -7, 6, 9, -7, -9, 7, -3, 0, -1, 8, -7, 5, 3, 9, -3, -2, 2, -9, -8, 1, 2, 5, -2, -9, 4, -8, 2, 0, -6, 0, 4, 1, -4, 3, 2, 5}, + []int{-6, 4, -1, 1, 1, 0, -8, 8, 0, -8, -10, -7, 1, 8, 4, 2, -8, 9, 1, -4, -9, 1, 0, 4, 7, 7, 4, -2, 6, 9, -6, -8, 1, -2, 5, -10, -4, 3, 8, 3, 3, 1, 1, 2, 7, -4, -6, -3, 6, -5, 4, -6, -5, 8, -4, 9, 6, -3, -3, 1, -2, -9, 1, -10, 4, 9, -1, 6, 7, 4, 5, -9, -8, -2, -9, 5, -4, -7, -9, 4, 3, -10, 3, -1, -1, -7, 4, -2, -6, 7, -8, -6, 5, 5, -9, 3, -7, -6, -7, -6}, + []int{2, 0, 3, 8, 6, -1, -10, -7, -1, -9, 8, 9, 8, -1, 2, -8, 8, -3, -7, 0, -8, -8, -10, 0, -10, 4, 3, -1, -1, -4, -9, -2, -9, -2, -6, 5, 9, -5, 3, -1, -4, 8, -9, -7, -8, 0, 1, 9, 6, -5, 4, 8, -1, -8, -7, 8, -6, 2, -9, -7, 0, 4, 9, -2, -1, -10, -2, 8, -9, -2, -9, 7, -8, 2, -6, -8, -4, -8, -4, 2, -8, 3, 3, -9, 4, -8, 6, -6, -4, -7, 7, -9, 4, -7, -5, -10, 5, -3, -1, -1}, + []int{-3, -4, -8, -7, 3, 9, -1, -2, -1, -4, -1, -5, -1, 2, 8, 4, 3, 3, 6, -2, -3, 1, -7, -9, 9, -5, 6, -2, -1, -3, 5, -5, -2, -2, 4, 9, 8, 3, 4, -10, -6, -2, 3, -1, 6, -5, 2, 5, -9, 9, 0, 4, -3, -7, -2, -2, 0, -6, -8, 5, 1, 8, 8, 8, -1, -2, 2, -9, 8, 2, -8, -2, -7, -3, -10, 4, 1, 6, 0, -8, -4, 7, 3, -5, 7, -3, -2, -9, -8, -1, -6, -4, -8, 6, 0, 6, 3, -9, 1, -2}, + []int{-1, 9, -6, 8, -1, -7, -6, -8, 6, 4, 0, -9, -8, 4, 9, 4, -8, 9, 1, 8, 2, -3, 9, -1, 8, -10, -6, 0, -8, 2, 3, 7, -4, -3, 0, -3, 4, -1, 5, 8, 3, 0, 1, -1, 0, 4, 1, 7, -9, 2, -8, 7, 1, -8, 8, -6, 4, 4, -8, 0, -6, 5, 7, -2, 3, 5, 1, 1, 9, -6, -3, 7, 0, -10, 3, 8, 7, -1, -9, 8, -7, -1, -3, 6, -9, 9, -10, 0, -4, 0, 3, 8, -6, -9, 5, 3, -3, 1, -3, -9}, + []int{-10, 2, -7, 7, -6, 6, -10, -7, 3, -2, 3, -1, -3, 4, -6, 3, 4, -5, -7, -5, 2, -1, 4, 5, 4, 9, -3, -2, -10, -2, 8, -7, -2, -8, -8, 2, 9, -7, 2, 7, -4, -8, 5, 8, 4, -2, -3, 6, 1, -6, -4, 1, -8, 0, 6, 2, 7, -2, 3, 6, -7, -10, 6, -7, 2, 2, 0, 9, -4, 2, -1, -5, -1, -6, 5, -2, 6, -8, 4, 9, 2, 6, 6, -5, -10, -1, -4, -7, 8, 6, 7, 4, -9, 7, -1, -4, 6, -5, 8, -4}, + []int{-1, 6, -7, -1, 8, -1, -5, 6, 2, -10, -6, 6, -6, -8, -7, -3, 1, -8, -8, -4, 2, 1, -3, -4, -9, 1, 0, -6, -3, 8, 4, 7, 0, -4, -3, -5, 6, -5, -9, -4, -3, 1, 2, 3, 6, 7, 8, -9, 1, 8, 5, 9, -6, 0, -7, 2, -6, -5, -5, -2, -1, -1, 4, -7, -4, 0, -3, 1, -7, -6, 1, 8, 2, -4, 6, -6, 5, -4, 7, 4, 5, -9, -10, -10, 0, 6, 0, 2, 8, 5, 9, -6, 5, 7, 0, 8, -6, 2, 6, -1}, + []int{3, -7, -2, -7, -7, 7, 5, 4, -4, -6, -6, -3, -3, 3, 5, 3, -9, 8, 4, -1, -8, -9, -5, -8, -1, 9, 8, 2, -4, -9, 9, 7, -7, 3, 8, 1, -8, -2, 7, 0, 3, -3, 6, 6, -2, -6, 1, -6, -9, 4, 2, -5, -10, 6, -1, -3, 4, 7, -4, 4, -10, -6, 8, -1, -6, -8, 8, -10, 1, -10, 4, 8, -7, 5, 5, -9, -4, 3, -2, 5, -10, -8, 3, -8, -8, -7, 7, -7, 9, -5, -8, -10, -3, 3, 1, 3, -4, 5, -1, 5}, + []int{8, -6, 8, 6, -6, -5, 8, 8, -1, 7, 4, 2, 9, -4, 1, 3, -1, -8, 9, 4, 5, -3, -3, -9, 1, -5, 2, 5, -9, 5, -1, -6, 2, 7, -5, -5, 3, -10, 7, 9, 6, 8, 8, -5, -5, -2, -6, 7, -2, 4, -5, 5, 1, -8, -7, 5, 5, 5, 5, 4, 0, -8, 2, -4, -5, -8, 9, -9, 0, 2, 7, 1, -3, 8, 0, -7, -10, -4, 9, -6, -2, -8, -4, -10, 5, 4, -7, 2, 6, 5, 1, -5, -5, 7, 3, 1, 2, 9, -9, -6}, + []int{4, -8, 6, 5, -7, 7, 1, 7, -2, 1, 9, 2, -6, -8, -5, -7, 4, -3, 2, 3, 3, -1, -2, -5, -5, 5, 5, 3, 0, -6, -5, -5, 4, 3, 2, 1, -10, -8, -5, 7, 0, 6, -4, -4, 8, -8, -2, -9, 7, -8, 6, -4, -7, 4, 3, 4, 1, -2, 6, -5, 4, -8, 6, -8, 0, 3, 5, 9, -5, -1, 7, -5, -5, -6, 1, -8, -4, -3, -8, -1, -7, -8, 7, -7, 4, -4, -10, -10, 4, 3, 5, 5, -9, -10, -7, 3, -1, 5, 5, 8}, + []int{0, 8, 3, 0, 5, -3, -8, -6, -8, -10, -7, -5, 2, 5, 8, -7, 7, -3, -10, -8, 9, -6, 2, -7, -8, 8, 2, 5, -7, 8, -3, -8, 7, 4, 1, -6, 7, 4, -3, -6, 1, 8, -7, 1, 8, 3, -4, -10, -10, 5, 7, -4, 4, -2, 9, -2, 0, 3, 7, 2, -5, -8, 4, -9, -6, 2, -9, 9, -1, 9, -4, -1, 1, -6, 0, -9, 9, -5, -7, 2, -6, -5, -7, -4, 0, 0, -2, -10, -1, 2, -2, -3, 5, -6, 4, 6, -3, -10, -9, -3}, + []int{1, 3, 1, 6, 0, 8, -2, 3, 9, 5, 2, -6, -5, -5, 1, -3, 5, -10, 5, -9, 8, 1, -3, 4, -2, 5, -8, -3, -7, 0, 8, 9, -7, -9, 4, -1, 2, -2, 4, -10, 1, -5, 7, -7, 0, -6, -7, 2, 8, 7, -6, 2, 7, -3, -9, 1, -5, 9, 0, 0, 1, -3, 1, -2, 5, 7, 1, 2, 2, -7, 8, 7, 9, 7, -8, -3, -6, 3, -6, 9, -3, -9, -10, -10, -3, -8, 8, 9, -9, -6, 8, 6, -5, 1, 4, 8, 8, -2, 9, -5}, + []int{-8, -4, 3, -4, 8, 0, 9, -4, -8, -9, 1, 1, -5, 7, 3, -7, -6, 5, -8, -4, 3, 1, 8, -4, -4, 6, 4, -9, 8, 0, 2, -6, -3, 7, 6, -1, -10, -1, 2, 3, 7, -8, -8, 5, -9, 2, -10, -3, -2, -3, 7, -2, -5, 1, 4, -5, 2, -2, 9, -9, -6, 6, -7, 2, 9, -1, -5, 1, 9, -2, 3, 2, 3, 8, -4, 6, 4, -3, 4, 8, -9, -6, 1, 2, 2, 3, 0, -4, 1, 4, 3, -9, 1, 7, -9, -8, 7, 7, -4, 6}, + []int{-6, -1, 9, -3, -1, 7, -6, 4, 3, -6, -5, -4, -8, -1, -2, 1, 4, 1, -3, -6, 9, 1, 2, 4, -7, -5, -10, -4, 0, 7, -1, 6, 4, 6, -2, 0, -1, -1, 1, -10, -4, 7, -7, -7, -5, -7, 2, 8, 6, -10, 9, 0, 0, -9, 6, -2, -4, 3, 4, 6, -1, -4, 2, -4, -7, 2, 3, 6, -7, 6, 0, 6, -2, 7, -8, -3, 0, -2, 9, -8, 0, -9, 1, 1, 1, -3, -4, -7, 4, -10, 8, 9, -7, 9, -8, 1, 1, 3, 1, 9}, + []int{6, -5, 5, 6, 6, 3, 2, -5, -7, 8, 7, 8, -7, 2, 2, -10, -6, 8, -10, 9, -3, 4, -3, 2, 5, -10, 4, -10, -7, 5, 2, -5, 1, 3, 7, -1, -9, -10, 6, 6, -5, 3, -3, -1, 6, 6, -6, 3, 0, 2, -7, -2, 0, -2, 5, 6, -4, -8, 0, -7, -7, 5, -4, 9, -8, -7, 2, -7, -10, -4, 4, -1, -3, -6, -3, 4, -1, -1, -5, -4, 6, -10, 2, 7, 1, -9, 7, -1, -2, 2, 3, -2, 4, 6, -3, -6, 7, 5, 2, 8}, + []int{-6, -10, 8, 2, -4, 1, 8, -8, 7, -6, 0, -7, 4, 0, -9, 1, -9, 7, 7, 9, -6, 0, -7, -9, 3, 4, -9, 0, -1, -8, 7, -1, -4, 3, -7, -1, 3, -8, 7, 3, 6, 1, -4, 9, 4, 1, -2, 8, -2, 2, 9, -10, 0, -2, 6, -2, 1, -9, 5, 9, -4, -4, 5, 0, -5, -9, 1, -7, -4, 8, 8, -7, 1, -1, 5, -7, -4, -8, -7, -8, 0, -3, -3, -4, -2, -7, -2, -3, 3, -8, -6, -10, -3, -4, 8, 5, -8, 2, -4, 1}, + []int{-9, 7, 9, 6, -8, 5, 6, 9, 4, -3, -2, -8, 2, -1, 7, -7, 9, 4, -3, 2, 0, 7, 0, -1, 6, -7, -8, -5, 7, -3, -4, 8, -7, -4, 5, 5, 6, 1, -5, -3, 9, 5, 3, -6, 3, 9, -1, -1, -8, 0, 4, 1, 1, -10, 2, 4, 5, -3, 9, 2, 7, -9, 6, -1, -10, -8, -1, 3, 0, 2, 0, 1, -6, -10, -6, -4, -3, 9, 1, -5, 9, 3, 5, -4, -10, 3, 4, 0, -5, -1, -5, -7, -3, 9, -2, -7, 5, -3, -7, -8}, + []int{1, -7, 5, 0, 9, -9, 6, -5, -4, -6, -3, -8, 8, -5, 5, -10, -10, -3, -2, -3, -5, 3, 7, 2, 4, 1, -4, -7, -1, 2, -2, -8, -2, -3, -10, -9, -9, 9, -1, -9, 5, 5, -4, 4, 6, -8, 9, 2, -6, 1, 4, 9, -5, -6, -9, 7, 5, 9, -3, 6, -5, 4, 2, 3, 2, -6, 7, -5, -10, 2, -3, -1, 8, 0, 4, 1, -1, -4, -9, 1, 5, -3, -6, 9, -1, -9, -3, 9, 3, -3, 7, -7, 6, -10, -3, -4, -2, 4, -4, 5}, + []int{2, 1, 4, -7, -8, 2, 7, 4, -6, 5, 9, -1, -8, 3, 1, -7, 8, -2, 7, -8, -1, -5, 8, 6, -8, 4, 3, -7, -10, 0, -7, 4, 7, -9, -8, 7, -10, -9, 3, -3, -4, -5, 9, -1, 6, -9, 3, -8, 6, 8, 3, -5, 1, 1, 6, -3, 0, -10, 0, 4, 9, -3, -5, -9, 3, 7, -7, -6, 1, -4, 2, 4, 8, -4, -3, -5, -4, -5, -7, -8, 8, -8, -8, 4, 4, -9, -1, 2, -10, -7, 8, -6, 8, 7, -8, -7, -7, -3, -9, 2}, + []int{2, -4, -10, -4, 3, -6, 8, 5, 2, 6, 4, -5, 7, 6, 5, 5, -8, 7, 6, 0, -1, 4, 0, -5, -6, -9, 9, -1, 3, 5, 7, 3, -8, -1, 5, -1, 4, 4, -10, -10, -1, 1, -10, -10, -2, 7, -4, 7, -6, 3, 6, 9, 7, 8, -10, 6, 8, -8, 7, -7, 2, -4, -5, -8, 8, 1, -2, -5, 0, 3, 6, -10, 3, -2, 1, -3, 2, -3, -4, -2, -10, -2, -7, -1, -7, 7, -9, -4, 9, -2, 1, 3, -3, -3, -4, 6, -6, 7, -7, -3}, + []int{-5, -2, 2, -3, -9, -1, -9, -4, -10, -9, -7, 6, 3, 9, -10, -1, -2, 3, -4, -6, -6, 2, 6, 9, 0, -4, 3, 2, 5, 5, -2, 1, -4, 9, -3, -1, 7, 7, 2, -2, 3, 6, 3, -10, 6, -1, 1, -4, -6, -4, -1, 6, -1, -5, -8, 2, -7, -10, 6, -6, -7, 5, 1, 2, 0, -4, -9, -9, -6, -9, -3, 5, 1, 8, 6, 8, -1, -8, -6, 4, -1, 8, 2, -8, -9, -7, -2, -5, -10, 2, -9, -2, 8, 5, 6, 6, -6, 0, 4, -10}, + []int{5, 9, -4, -1, -1, 4, -10, -10, 9, 0, -3, 9, -8, -3, 8, -6, -9, -7, 7, 8, 3, 4, 5, 4, -9, -4, -3, -5, -1, -8, 9, -8, 0, -4, -6, 9, -2, 7, -1, 5, 0, 0, -10, -4, -9, -5, 8, -1, 6, 2, -3, -7, 9, -7, -5, -2, -7, -6, -6, -2, -6, 1, 0, 9, -6, 5, -3, -2, -7, -5, 5, 5, -2, 7, -7, -7, 5, -8, 8, 6, -3, 8, -1, 2, -9, 8, -1, -3, -4, 8, -3, -1, 0, 6, 2, -7, -1, -5, 4, 0}, + []int{1, -2, 5, 5, 8, -2, -9, -8, -7, 2, -5, 8, 7, -9, -7, -2, -1, -7, 8, 9, 4, 5, 6, 6, -4, -5, -5, 3, -8, -2, -9, 5, -7, 4, -7, 3, 8, 4, -2, 5, 4, 8, -3, -7, -3, -8, -1, -6, 2, 0, 6, -10, -6, -6, 6, 2, 8, 4, -4, 1, -3, 6, 2, -2, 6, 3, -1, 1, -6, -7, 7, -9, -3, 7, -6, -8, -6, -6, 6, 3, -6, 2, 5, 4, -6, -7, 7, 8, -7, 2, -5, 1, 1, 8, -2, -9, -8, 1, 1, 8}, + []int{6, -7, -9, -5, 5, 2, 6, -1, -9, -10, 4, 6, -9, -6, -7, -6, -5, -4, -9, 0, 5, 8, 6, -8, 1, 3, -7, 0, -6, -6, 1, -8, 3, 9, 4, 9, 3, -7, -3, 4, 4, 2, -6, 2, 1, 5, 2, 2, -10, -5, 0, 6, -4, -6, -9, -3, 1, 4, -8, -3, 8, 0, 9, 5, -7, -4, 0, 5, 0, -4, -9, 8, 8, 8, -8, -10, -6, -6, -4, 6, -2, -8, -4, 2, 1, 9, -4, 2, 3, 5, 3, -7, 0, -3, -5, 6, 9, -6, 1, -5}, + []int{-4, 8, -4, 3, 4, 4, 3, 5, 1, 9, -9, -1, 4, 5, 9, 8, 9, 7, 8, 9, 6, -8, 3, -10, -5, 5, 2, 4, -9, -1, 1, -6, -6, 8, -4, -7, -9, -4, 1, 4, -8, -6, -9, 4, -9, 6, 1, -9, 8, 3, 3, -5, -4, 1, 2, 6, 4, 6, 5, -5, -2, -8, 3, 7, -5, 8, -8, -10, -10, -6, -4, -9, -8, -10, 9, -9, 0, 5, -5, -8, 5, -10, 4, -4, -10, -10, 2, -10, 1, -10, -2, 7, -9, 5, 7, -6, -10, -3, -6, -3}, + []int{0, 2, -10, 2, 8, 8, -1, 2, -9, 0, -1, 7, 0, 6, 9, -4, 3, 9, -2, 5, -6, 0, 8, 0, 5, 8, 0, 3, 0, -2, -5, 7, -6, -6, 1, 1, -4, -4, -1, 2, -5, -2, -3, 0, -6, -10, 5, -9, 0, -2, 1, -3, 8, -7, 7, 2, -3, -5, 4, 6, -8, 8, 8, -8, 4, -4, 4, -5, 2, -9, -5, -9, 8, -8, -3, -5, 7, 3, 4, 8, -8, 7, -7, 4, 7, 0, -9, 0, -6, -7, 6, -1, 3, -3, -1, 0, 1, 4, 2, 9}, + []int{8, -8, -3, -7, -8, 5, -9, -5, -10, 4, -6, 4, 4, -10, 5, 3, 6, -7, -8, 3, 9, -5, 6, -3, 5, -5, -6, 2, -7, 8, -7, -9, 6, 7, -5, 8, 9, 5, -9, 1, 8, -3, 0, 7, 7, 6, -7, 6, -7, -4, -9, -5, -2, -5, 4, 5, -3, -3, 4, -4, -10, 6, 4, -3, 1, 9, -5, 7, -9, 0, -3, 5, 8, -2, -8, 1, 2, -4, 0, 5, 6, -10, -6, 0, -8, 8, 9, -9, -1, -8, 5, 4, 9, 5, 7, -5, -8, 9, 8, 3}, + []int{-5, -5, -3, 3, -9, -4, 3, -2, 9, 3, 8, -5, -2, 2, -10, -7, -4, -1, -5, -1, -7, -1, 0, -9, 9, -10, 6, 0, -7, -1, -10, -8, -8, -7, -5, -9, -3, 2, -7, 1, -5, 3, 5, -6, -4, 8, -9, -8, -3, 6, -5, -4, -8, -10, -5, 5, -8, -5, 1, -7, 5, 3, 9, -6, 3, -6, -8, 8, 1, -8, 7, -8, 0, 4, 9, 0, -6, -7, 2, -1, 8, 4, -10, 0, -9, 6, 1, -10, -6, -1, 0, -9, -6, 2, 4, -7, 0, 7, 2, 8}, + []int{-1, -9, -1, -3, -10, -9, 5, 2, -8, 8, -3, 3, -4, -7, 2, 5, -4, 9, 6, 1, 0, -9, -9, -9, 4, 3, 5, -8, 2, -1, -9, 1, -7, 2, -1, -3, -9, -5, 5, -4, -5, 5, -10, 0, 2, -2, 5, 0, -9, -6, -2, 0, -6, -3, 3, 4, -9, 3, 4, 8, 2, -6, 9, -8, 0, 5, -7, -1, 7, -7, 5, -7, -1, -3, -9, 6, 2, -6, 5, 5, 5, 6, -3, -3, -5, 8, 2, 9, 1, 5, -5, 1, -1, -7, -10, 0, -1, 9, -9, 5}, + []int{-5, -1, 2, 3, -9, -5, -2, -4, 3, 5, 0, -5, -2, -9, -8, -7, 8, 0, -3, 1, 9, 1, 3, -9, -10, 7, 0, 3, -9, 9, 8, -7, -6, -9, 6, -8, 4, -5, -6, -9, -3, 0, -4, 0, -7, 8, -3, 3, 0, -2, 5, 5, 9, -1, -4, -2, 2, 4, -3, -9, -1, 9, 4, 4, 9, 1, -5, 5, 9, -6, -1, -4, 2, 6, 7, 6, -2, 1, -7, 9, -8, -7, 4, 9, 2, 0, -1, 1, -4, -3, 8, 9, -7, 2, -6, 6, -8, -9, -9, 6}, + []int{-1, 7, -3, -8, -9, -5, 4, 6, 3, 7, 1, -7, -9, 9, 4, -7, -1, -5, -6, -6, 4, 1, -3, 1, 5, 6, -4, -5, 2, -1, -4, -9, -3, 2, -5, -6, 7, -9, -1, -4, -2, -7, -5, 0, 6, 7, -4, 9, -8, 8, -10, 3, 9, 8, 0, -9, -8, 0, -3, -5, -4, -7, 8, -1, 4, 3, -1, -7, 0, 3, 0, 8, -1, -1, 4, 2, 1, -10, -9, 4, -9, -8, 4, -7, 8, -6, 4, 7, 2, 9, -3, -7, 9, -5, 1, 0, -4, 3, 9, -4}, + []int{2, -10, -1, 9, 7, 2, -3, -5, -5, -6, 7, 3, 5, 2, -2, -8, 4, 8, -5, 8, 6, 3, 8, -2, 2, -9, -6, 4, -8, 9, -5, 4, 2, -3, 0, -7, 5, -3, 9, 3, 8, 8, -1, -2, 1, -2, -2, 7, 6, -7, -3, 3, -3, -3, 3, -6, -6, -4, -5, -4, -7, -6, -2, 5, 0, 7, -1, -2, -5, -8, -9, -3, -10, -6, -5, -3, -3, 9, -9, 8, -3, -6, 0, 9, -9, -5, -8, 9, -10, 7, 8, 7, -10, 8, 2, -9, 3, 0, 8, 5}, + []int{-6, 4, 1, -1, 6, -5, -9, -4, -3, -6, 9, 5, -6, -2, -7, -1, -6, -2, -4, -9, -2, -1, 1, -1, -8, -2, -9, -10, -1, 0, -9, -7, 4, 4, 2, 7, 3, 0, 3, 6, -10, 5, -1, 3, 0, 5, -4, -8, -3, -3, 7, -1, 9, 4, -10, -6, -6, -7, 2, -7, 2, -4, -7, 0, -7, -8, -6, 9, -9, 7, -9, 8, -4, 6, -5, -2, -8, -1, -6, 3, 6, 9, -10, -2, -4, 6, 3, 6, -3, 3, 5, 1, 9, -9, 8, 0, -4, 0, -3, 3}, + []int{-10, -9, -1, -1, -10, -10, -8, 5, -2, 5, 9, 7, -10, 4, -9, 1, -10, 2, 4, -3, -3, 3, 6, 6, -5, 9, 5, -9, -10, 9, -1, 4, -3, -3, -9, 8, -7, 0, -6, -2, 9, 2, -2, 5, -8, 0, -4, -7, 4, 3, -7, -9, -7, 1, -1, -4, -10, -1, 1, 3, 3, -2, 8, 7, -8, 3, 7, -6, 8, 5, -3, 3, -2, 2, -10, -7, 8, -3, 3, 5, -3, -10, 2, 2, -3, -2, 6, -1, -2, -8, -10, 9, 6, 4, 4, 1, 2, -9, 4, -4}, + []int{-4, 8, -7, 1, -8, 2, 4, -1, -8, 9, 2, -4, -2, -3, -8, -4, -1, -8, 1, -10, 4, 8, -6, 0, 3, 2, 7, -10, -9, 5, -8, 1, 5, -7, -1, 0, 0, 5, -5, -10, -10, 6, 0, -3, 7, -6, 5, -5, 8, -6, -10, 7, -8, 8, -4, -6, 8, -4, 1, 6, -3, -1, -8, 2, -6, -4, -3, -8, 1, -5, -7, -4, 6, -9, 1, 5, -1, -7, 7, 5, 3, 9, 0, 0, 5, -5, 0, 9, -10, 2, 7, -8, -6, 7, -7, -5, -1, 6, -8, -4}, + []int{8, 1, -3, -5, 9, -3, -4, 4, -2, -8, -4, -9, -3, -9, -9, 2, -8, 9, -7, -6, 3, -7, 3, -10, 2, 9, 2, -4, -10, 6, -3, 1, 1, 1, -5, 8, -5, -9, -9, 2, 6, 5, -2, -4, -7, -1, 3, 4, 0, 7, -3, 9, -5, 0, 6, -6, -2, -9, -10, 1, 8, 4, -2, -9, -9, -6, -10, -10, 7, 1, -7, 2, 0, 4, 4, 2, 1, 6, 0, -4, -6, -1, -1, 2, -6, -9, 5, 9, 9, -9, 3, -7, 4, 5, 5, 6, 7, 1, 4, -5}, + []int{-3, 3, -10, -6, -9, 7, -7, 7, 5, 7, 2, -4, 2, 8, 3, -4, -1, -5, -1, -1, 1, -8, 4, 9, -5, 0, -4, -2, 4, 4, -4, 2, -9, -10, -2, 0, -4, 4, 3, 4, 3, 6, 5, -7, 7, 3, 9, -4, 6, -5, 3, 3, 7, 3, 8, 9, 0, 5, -7, 7, -1, -6, -2, 2, 6, 1, 6, 1, -10, -2, -7, -3, -8, 7, 9, -5, 5, -6, 5, -9, -8, 3, -5, -5, 9, 7, 5, 5, 5, -3, 7, 8, -9, -4, -9, -8, 5, -3, 8, -7}, + []int{-1, -6, 3, 2, -1, -9, -10, -6, 5, -4, 7, -10, 1, 8, 6, 1, 7, -4, -6, 9, 6, 3, -7, 2, -7, 8, -7, 8, -2, -7, 9, 4, 7, -1, -3, -2, 9, -3, 9, 2, -5, 1, 0, -4, 8, 1, 7, -10, 4, -9, 3, 4, -8, -5, -3, -7, 0, 0, 5, -3, 1, 5, 1, 9, -8, -3, 7, 3, 5, -3, 4, -6, 2, 6, -2, 4, 6, 2, -8, -2, -3, -2, 8, -9, -9, -10, 6, 1, 1, -4, -9, -7, -5, 1, 9, 1, -9, 0, -7, 3}, + []int{5, 0, 4, -5, 7, -6, -2, -3, 6, -9, -4, -7, 2, -8, 2, 7, -10, 6, 0, -6, -4, -10, -4, -2, 4, 6, 3, 4, -10, 5, 7, -1, -3, 5, -2, -7, -3, 2, 5, 4, 9, -7, 3, -6, -10, -2, -9, 9, -10, 2, -1, -9, 8, 4, -6, -7, -5, 3, -3, -10, 9, -9, 1, -5, -2, 4, -4, -8, 5, 4, -7, 5, -1, 3, -7, 6, -3, -6, 8, 8, -6, 3, 3, 2, -6, -2, -5, 2, -7, 0, 6, 7, 0, 3, 4, -6, -8, -10, -4, 4}, + []int{-5, -10, 8, 4, -9, -6, 6, 9, 5, 3, -3, 3, -1, -5, -4, 5, 9, -6, -7, -3, 1, -10, 1, -5, 6, 3, -10, 6, 6, -6, -7, 0, -6, -1, 5, -7, 5, -8, -9, -5, 3, -3, -5, 1, 9, -3, 6, 8, 2, -6, 6, 1, -8, 3, -8, 1, -9, 1, 0, 5, -7, 4, 2, 2, 7, -8, -5, -5, -2, 0, -10, 0, -6, -3, 4, 3, 7, 9, -2, 5, -7, 6, 9, 8, 9, -10, 6, -10, 0, 5, -9, -4, 4, -7, 5, 4, 9, -8, 8, 4}, + []int{-10, 7, 8, 0, -5, 6, -10, 9, -3, 0, -2, 3, 5, -8, 2, -8, -7, -4, 3, -2, 1, -7, -3, -1, -4, 0, -7, -5, -7, -5, 7, 6, 0, -1, 2, -6, 5, -8, -5, -9, 1, -7, -1, 5, 6, -2, 4, 6, 4, -5, -6, 1, 5, 7, 0, -10, -4, 1, 6, -6, -6, -6, 4, 2, 9, -1, -2, -9, 2, 8, 5, -3, -4, -8, -10, 0, 1, -5, -3, 6, 1, 2, -7, 2, -7, -9, 7, 4, -3, 0, -4, -9, 9, 8, -5, 7, 8, 3, 6, -1}, + []int{-10, -7, 3, -2, -3, -2, 5, -8, -10, 0, -4, 3, -7, -6, 3, -9, -8, 3, 9, -9, 7, -10, 7, -8, -7, -7, -4, 7, -10, 8, 4, -2, -2, 7, 0, 7, -3, -10, -10, 9, 0, -8, 5, -1, -5, 2, 5, 2, -1, 1, 0, 1, 5, -10, -5, -1, -5, 9, -5, 0, 7, 9, -6, -4, -2, 6, 6, 4, -1, -8, 8, 6, -8, 3, 0, -8, -4, -10, 9, -8, 1, 8, -5, -1, 8, 9, 4, -3, 3, -7, 4, -5, -10, 6, 2, -8, 5, 3, 0, 1}, + []int{-3, 9, -2, -7, 5, -3, 2, 3, -9, 2, -8, 1, -5, 1, -2, -8, -9, -10, -1, -7, 4, 4, -9, 4, 0, 3, 2, -1, -8, 2, 6, 2, -1, 4, -10, 4, 0, -5, -3, -4, -7, 7, 6, 4, -3, 7, 1, 6, -9, 9, 2, -10, 7, -5, -8, 7, 4, 5, 9, 5, -2, 1, 8, 6, -2, -3, -5, 0, 9, -8, 6, 7, -3, 0, 4, -9, 6, 6, -4, 3, -9, -6, -2, 3, 7, 4, -9, 8, -9, 0, 3, -10, 8, -2, -2, -10, -10, 5, -7, 9}, + []int{3, -4, 5, -9, -4, 1, 8, -4, -1, 6, -9, 5, 8, -2, 0, 2, 1, -3, -7, -2, 8, -2, 4, -2, -10, -4, 0, -5, 6, -10, 0, 6, 6, 0, -5, 9, -10, -9, -5, 4, -5, 0, 2, 6, -6, -4, -6, -3, 8, -2, -4, 6, -8, -7, 0, -4, -9, 3, -10, 2, -9, -9, 8, -7, -9, -5, 6, 5, 2, -3, -6, -1, 7, -1, -2, -10, 8, -8, -6, 8, -3, 1, -10, 8, -2, -8, -1, -2, -9, 8, 5, -10, -4, 5, 9, 8, -6, 1, -8, 7}, + []int{1, -5, 8, 1, -6, 4, 1, -9, -6, -1, -2, 1, 8, -8, -7, -4, -1, 4, 9, 6, -5, -2, -9, -2, -2, -6, 7, 0, -2, -5, 3, -5, -6, -2, 4, 9, -3, 1, 8, -9, -10, -4, -4, 7, -8, -9, -9, 2, 3, -9, 2, 1, -5, -10, -7, -7, 1, 1, 6, 1, 0, 0, 9, 5, 2, -3, -4, -3, -9, 0, 0, -4, -7, 3, -9, 5, 9, -4, 7, 9, -3, -1, 2, -6, -2, -10, 8, 0, 0, 2, -5, -1, 8, 0, 5, -4, 8, 4, 7, -1}, + []int{-3, 1, -5, -8, -2, -4, -1, 0, -8, -7, 4, 2, -6, -4, 2, 3, -3, 0, -6, 3, -5, -10, 8, -7, -3, -4, -9, -3, -7, 0, -7, 0, 7, -6, -5, -8, -6, -4, -9, 4, 5, -3, -8, 5, -3, 0, -4, 6, 8, 0, 1, 6, -8, -4, -10, -3, -5, -5, -6, -4, 1, 3, 5, 8, 0, 9, -6, 3, -8, 7, 9, 1, 7, -7, -2, 2, 3, -3, 2, 9, 6, -4, 0, 9, 4, 4, -2, 9, -5, -7, 0, 5, 3, 4, -3, 6, 9, -7, 6, -1}, + []int{6, 7, -8, 6, 7, -4, -6, -3, -9, 3, 2, -6, -9, -6, 6, -9, -10, -5, -2, 2, 1, -6, 0, -8, -4, -4, -4, -8, 9, 3, -2, -2, 0, -6, -4, 0, 9, 6, 8, -6, 2, 4, -10, 5, 8, 1, 1, 5, -9, 8, 0, -5, -4, -9, 2, -4, -1, -7, 7, -8, 9, -2, 5, -3, 0, 3, 6, -8, -4, -1, -4, 0, 0, -2, 4, 8, -7, -6, -8, 3, 2, -5, 6, -6, 1, 3, -2, -10, 5, 2, 4, -5, -7, -10, -7, 0, 3, -6, -4, 0}, + []int{4, 8, 2, 0, 0, 5, 2, 5, 5, 4, 7, 5, -7, -3, -10, 9, 7, 7, 0, 2, 5, 7, 0, 5, -8, -4, 5, -5, -5, -8, -1, 4, 7, 4, 2, -10, -2, -9, 7, -6, 1, -1, 6, -5, 4, 1, 3, 2, 7, -2, 5, 4, 0, -7, -5, -7, -6, -9, 9, 9, -4, -8, -1, 6, -6, 8, -3, 6, -8, 2, -5, 1, 8, -9, -3, 4, 8, -1, 1, 7, -3, 8, -5, 0, 6, 3, 2, -7, 8, -9, -3, -8, -6, 3, 5, 4, 7, 3, -7, 3}, + []int{7, 5, -7, -5, 3, 5, -4, 5, 5, 8, 4, -4, 4, 9, 3, -3, -10, -2, 3, 7, 6, 4, 5, -10, 8, -5, 3, -8, -2, -3, -9, -9, -6, 1, -5, -1, -6, 8, -5, 3, -2, 3, 8, 3, 8, -10, 6, 1, 0, 0, -5, -8, -1, 3, 9, 0, 6, 2, 2, 8, -5, -10, -4, 4, -1, -3, 8, 7, 8, -7, -10, -1, 0, -4, 5, 3, -6, 6, -6, -10, -7, -5, -5, 8, -4, 3, 2, -6, 5, -4, 7, 5, -3, 3, -10, -9, 2, -7, 8, -7}, + []int{1, 3, -3, -4, -6, -9, 7, 7, 6, 1, 1, 1, -7, -9, -10, -9, -8, 0, -10, 7, -7, -1, -3, 2, 8, -5, -9, 0, 4, 5, 8, 6, 6, 2, 9, 5, -3, 5, 6, -8, -9, 8, 9, -7, 3, -2, 3, -8, 0, 7, 6, 1, 1, 1, 7, -3, 9, 2, 5, 6, 5, -10, -6, -6, -5, 2, 0, 9, 1, 5, -10, 2, -10, -2, -4, -8, -4, -10, 4, -7, -4, -9, -5, -6, 6, 1, 3, -4, -8, -4, -10, 3, 0, 7, -9, -7, -5, -8, -5, -7}, + []int{-7, -5, -9, -8, -1, -5, 9, 0, -4, 2, -4, -8, -1, 5, -9, 7, 7, -4, -4, -4, 4, -10, 9, -7, 5, 1, 3, 2, 7, -1, -1, 5, 1, 8, -6, 8, 5, 8, 3, -10, 2, 7, 3, -2, 9, 3, 0, 0, 1, -3, -2, 9, 6, 4, 2, 1, -2, -6, 7, 7, -9, -1, 3, 5, 3, 3, 1, 4, 0, 7, 4, -10, -6, -8, 5, -5, -8, 7, -8, -7, 7, 8, 5, 7, -7, 4, -8, -9, -8, 8, -3, -2, 1, 5, 6, 5, -8, 1, -10, -3}, + []int{5, 7, -9, 0, -7, 5, -3, -10, -7, -8, 5, 5, 6, 6, -3, -7, 6, 4, 5, 7, -6, 3, -5, -8, -4, -4, 6, 4, -5, -8, -9, 3, 0, -7, 8, 8, 7, -6, -10, 1, 3, 7, 2, 2, 6, 9, -10, 5, 4, 7, 0, -4, 2, 1, -1, 1, -10, -8, -10, 3, -3, -6, -2, -2, 8, -5, 7, 5, -9, 8, -7, 2, -5, 7, 3, -10, 6, 4, 4, -7, 8, 6, 1, 0, 8, -8, -9, 0, 0, -3, -7, 6, -3, 6, -3, 2, -10, 4, 8, 1}, + []int{6, -10, -9, -10, -8, 0, 3, 2, 3, 0, 3, 2, -10, 7, 1, 9, 9, -4, -3, 3, -3, 0, 5, 5, 1, 1, -2, -2, 9, -3, 7, -10, 3, 9, -4, 5, -4, 7, -8, 1, 4, -1, 7, 0, 1, 9, 2, -8, 9, -9, -1, 8, -6, 8, -7, 0, -7, 2, -4, -5, -6, 8, 9, -4, 7, -1, -4, -10, -9, -9, -7, 1, -6, 0, 5, -2, 6, 1, -7, -7, -1, 7, -4, 4, -6, 2, 9, 2, -6, 5, 7, 1, 5, -1, -4, -3, -6, 7, 8, -1}, + []int{3, 8, -2, -8, 0, -9, -9, -6, 4, 9, 2, -9, 8, -1, -4, 3, 6, 1, -7, 8, 4, -9, -2, 4, -3, 6, 9, 0, 7, 2, -10, -6, -7, 6, 7, 8, -9, 1, -6, -6, 4, -8, 2, -1, -9, -8, -5, 9, -7, 9, -6, -1, 6, 3, 7, -4, -10, -8, -3, -8, -6, 6, 3, 8, 3, -2, 1, 3, -5, -3, -5, 3, 9, 6, -5, -10, -3, 5, 9, 5, 0, -2, 2, 8, 5, 9, -3, 8, -10, 5, -10, -2, 9, -2, 0, -3, -3, -1, 6, -3}, + []int{-9, 3, 0, 9, -8, 8, 7, 6, -10, 6, -2, 0, -1, -7, -2, -10, 0, -7, 5, -3, -10, 9, 2, -10, 9, -10, 4, -7, 3, 5, 3, 8, -1, 4, -1, -5, -3, 9, 8, 8, 5, 7, -2, 3, -7, 9, -2, 8, 0, 8, 1, 7, 9, 8, -5, -8, -3, 6, -2, 3, 8, -3, 4, -2, 0, 7, -9, 3, -5, -7, 4, -1, 2, -3, -7, 8, 3, 2, -5, -3, 9, 1, -6, -10, -4, -1, 7, -9, 7, -1, -8, 9, -8, -2, 6, -7, -6, 0, -9, 7}, + []int{-6, 5, 5, 5, -2, -9, 4, 3, 8, 1, 7, -10, 2, -3, -4, 6, -6, -6, -7, 1, 7, 9, 1, -3, 4, -8, -1, 7, -3, 4, -7, -4, 8, 4, 9, 8, -7, 9, 5, 6, 9, 5, -8, -5, 7, -6, -9, -5, -3, -1, 4, -4, 6, -2, 9, -8, 8, -8, 1, 5, 7, 5, 0, 6, -2, -6, 3, 1, -2, 0, 1, -5, -7, -6, 0, 4, 2, 6, 4, 8, 1, 0, 6, 5, -5, 4, 4, 1, -1, 5, 3, 2, 3, 2, 4, 1, -9, 7, -5, 0}, + []int{2, -1, -7, 7, -3, 5, 1, 5, -8, 9, -3, -6, 3, 8, -2, -9, -8, -2, -10, -10, -6, 7, 0, 4, -5, 8, -3, 0, -3, -8, -7, 1, -7, -10, 3, -6, 1, -3, 2, -7, -8, 1, 4, -3, -5, 8, -4, -8, -2, -7, -9, 5, 4, -5, -2, -3, -9, 5, -5, -7, 4, 8, 1, 3, -10, -6, 1, -8, -4, -10, 2, -7, 3, -8, -9, -3, 8, -9, 8, 7, -5, -8, -5, 0, 2, 0, -4, -10, 5, 4, 2, -10, 5, 0, 3, 7, 9, 2, -3, -7}, + []int{-1, 9, 3, 5, 4, 6, 0, -3, 7, -3, 2, -1, -5, 3, -2, -3, -1, 2, 2, -5, -6, -10, 2, -4, 8, 3, 3, -2, 7, -10, 5, 4, -7, 9, 8, 1, 1, 1, 2, -1, -1, 2, 6, 5, -10, -10, 8, 8, 8, -2, -1, 4, -4, 1, 7, 7, -8, 5, -3, -2, 0, 3, -8, 6, -9, -10, 9, -7, -2, -5, 5, -7, 9, -5, -3, 9, 7, -2, 9, 7, 9, 6, 5, 8, 7, -9, 6, 6, 1, 6, 1, -5, -1, 4, 2, -1, 4, 4, 6, -4}, + []int{4, -9, 0, 4, -7, -5, -3, -10, 6, -2, -6, 5, -3, 1, -9, -7, -9, 0, 1, -5, 5, -5, 0, -1, 9, -7, 6, -5, -7, 4, -9, 7, -1, -6, -3, -4, -10, 7, -1, 2, 4, -6, 1, 5, -7, 0, -2, 9, -9, 6, -6, 0, 5, -5, 8, -8, -7, 7, -10, 2, 9, -7, 8, 7, -10, 3, -5, -8, 4, -7, -8, -5, 1, 7, -8, -8, -8, 5, -4, 9, -1, 7, -1, 6, 8, -2, 3, -9, 0, -4, 1, -4, 1, 8, -7, 1, 6, 6, -6, -6}, + []int{-3, -5, -6, 2, -4, 4, 1, -2, -9, -9, -2, 9, 0, -1, -6, -7, -4, 5, 7, 8, 1, 3, -5, -8, 5, 3, -5, 0, 2, 7, 6, 8, -2, 5, 7, -5, -10, 9, 6, -9, 5, 6, -8, 0, 2, 0, 5, 0, -7, -5, -2, 7, -3, 9, 1, -5, 8, 5, 8, 3, 3, -5, 3, -5, -2, 5, 9, -2, -6, 7, 9, -10, -1, -9, 3, 0, 8, 4, 2, 5, 8, -8, -2, 8, -4, -8, -7, 9, -1, 3, 5, -3, 5, -3, -6, -5, -5, 5, -6, -6}, + []int{-7, -3, 0, 4, 4, -3, -7, -1, -9, -9, -4, 6, 5, 1, -7, 6, -7, 3, 0, -6, -7, 7, -9, 3, -9, 6, 1, 0, -7, -8, -4, -3, 6, -9, -6, 6, 5, 0, -4, 6, 6, -1, -10, 8, -1, -7, -2, -5, 9, -6, -2, -7, -1, -4, -8, -7, -7, -4, -7, 5, -7, 3, 9, -3, -2, -6, -5, -6, -10, 9, -10, -7, 6, -10, -2, -9, -9, 8, 8, 9, -5, -10, -8, -8, 8, 2, -10, -5, -7, -7, 3, 8, -2, 9, 0, 3, 5, 8, -1, 8}, + []int{2, 7, 5, 8, -2, -1, -5, -9, 8, 3, 5, 9, 8, 2, 0, 9, 5, -10, -4, 1, -8, 1, 1, 3, 6, -6, 1, -1, -2, -8, 6, 2, -10, 6, -5, 2, 7, 3, -3, 0, 7, 0, -4, -6, -9, -10, 0, -7, -2, -2, 1, -10, 9, -10, 9, -5, 6, -5, -4, 4, -3, 7, -8, -6, 1, 7, 6, 9, 9, 1, -4, 5, 4, -2, -7, 6, -3, 7, -6, 4, -6, 9, -5, -5, -7, -2, 1, -9, 4, -2, 9, 0, 8, -9, 1, -3, 4, -7, 1, 7}, + []int{-5, -7, 8, -5, -6, -10, 0, 3, -10, 0, -8, -3, -7, 4, 9, -4, 3, -7, -5, 1, -8, -2, 0, 9, 5, -9, 5, -4, 7, -8, -8, 9, -10, 7, -2, -2, 9, -10, 5, -2, 9, 9, -3, -2, -7, -7, 3, -3, 5, -3, 6, -9, -10, 8, 1, 8, 8, -5, 8, 8, 1, 9, 7, -2, 1, 0, 8, -10, 6, -7, 9, -1, 3, 7, 4, -7, 3, 3, -7, -2, -5, 4, 5, -5, 4, -10, 8, 1, -2, -4, -6, 0, -6, -10, 2, 4, 5, -5, -5, 2}, + []int{1, 3, 2, -2, -9, 9, 3, -5, -2, -5, -5, 2, -2, 1, -6, 7, 1, 7, -2, -4, -10, 9, -4, 2, -9, -2, -3, 1, 5, 0, -9, 4, 1, 9, -7, 7, -7, 3, 9, 0, 8, 8, -3, -6, -2, 9, -8, 7, 3, 7, -3, 0, -3, 3, -4, 0, -8, 6, 4, -5, 6, 0, 9, -10, -9, -6, 6, -3, 7, 9, 2, 3, 1, 6, 7, 3, -2, -9, -5, -7, -9, 7, 6, -2, -1, 4, 0, 4, 0, -8, -9, -8, 0, 6, -5, -7, -6, 7, -10, 1}, + []int{7, 4, -6, -6, -2, -7, -3, 6, 3, -9, 7, -5, -4, 2, -6, -2, -1, 2, 6, -9, -4, 3, -2, -8, -2, -2, 3, 5, 7, -2, 3, 3, 9, -9, 9, 3, 7, -10, -5, 6, 0, -3, 8, -1, -2, -4, -5, 8, 6, 1, 0, 0, -9, -5, -7, 5, -8, -7, 4, -2, -2, -7, 7, -9, 6, -9, 7, 3, 3, 4, 2, -6, 2, -6, 2, -1, -9, 6, -9, -4, -1, -5, -4, -7, 2, 1, 1, 9, -9, -6, -7, 3, 2, 3, 1, -7, 6, 7, 0, -2}, + []int{-5, 3, -4, 9, 9, 5, -7, 8, -3, 3, -7, -10, -5, -6, -8, 0, 9, 8, 4, 6, 7, 9, -4, -7, -4, 5, -8, 8, -4, -9, 1, 8, -6, 0, 6, -8, 8, -5, 2, 5, -4, 3, 0, 9, 1, -3, -5, -2, -9, 0, -4, -10, 3, 3, 0, 0, -9, -2, -6, -7, 1, 3, 0, -3, 1, -10, -7, -9, 7, -6, -1, 0, 5, -5, -2, -10, 6, -7, 5, -1, 8, -2, -5, -2, 0, -9, -7, 8, 4, 6, 6, 0, 8, 4, -2, -4, 3, 1, -4, -2}, + []int{3, -4, -7, 3, -8, -2, -6, 5, 2, 5, -6, -5, 2, 9, -1, -7, -6, -7, -1, 1, 6, -10, 4, 5, 2, -3, 0, 2, 5, -6, 2, 1, -8, -3, 9, -1, -4, -4, 0, -10, 4, -7, 6, 6, 2, -7, 7, -7, 8, 9, 6, -9, 2, 1, -8, -8, -2, 6, 4, 3, -1, 8, 9, -5, -3, -9, -7, 4, 5, 5, 8, -3, 5, 1, -7, -9, 7, -9, -10, 4, -2, -4, -10, 1, 7, 3, 6, 5, 5, 4, 0, -9, 4, 3, 0, -3, -5, 4, 7, 2}, + []int{1, -2, 6, 5, 8, 6, 3, -5, -5, -2, -6, 3, -3, 9, -5, 8, 6, 8, -6, -1, -9, 2, 2, 2, 8, 8, -10, 3, 6, 8, -10, 5, 5, -10, -10, -5, 6, 3, 4, -2, -10, -6, -2, -6, -3, 1, 9, -8, -5, 5, 8, -1, -1, 0, -8, 7, -3, -10, 9, 9, 1, 9, -3, -4, 8, -6, -4, -1, 6, 5, -8, 4, 1, -4, -6, -3, 9, 2, 0, 5, -7, 5, -4, -7, 5, 3, -3, 7, 8, 9, 4, 3, 4, 5, -10, 4, 0, 0, 4, 5}, + []int{9, -6, 3, -7, -9, -2, 6, 8, 6, -10, 8, 7, -3, 9, 6, -3, -6, -7, 9, -2, 8, -3, -1, -8, -4, -9, -4, 5, 9, 3, -1, -3, 7, 1, 6, -8, -6, -2, -6, 2, -4, -7, -6, -7, 2, 3, 7, 6, -10, 1, -8, 8, -5, -1, 2, 5, -7, 4, -9, -9, -4, 4, -1, -6, -9, -1, -5, -9, 3, 4, -2, -8, 6, -6, -8, -8, 5, -7, 9, -2, 5, 8, 1, 1, 9, 6, 2, -9, 2, -5, -5, -2, -3, 1, 1, 2, -7, 6, -4, 4}, + []int{1, -1, 2, 2, -4, -7, -4, 8, 9, -1, -3, -1, -3, -4, -10, 0, -9, 3, 1, 3, -4, -8, -4, 5, 7, 1, 2, -1, 6, 5, -5, 4, -7, -5, 6, 4, -9, 2, -8, -3, -5, -9, 4, 6, 9, -8, -9, -1, -3, -4, 4, -4, 6, 3, -10, 1, -9, 8, -4, -2, 6, 4, -6, 6, -10, 0, -9, -6, -9, -2, -10, -1, -9, -9, -4, -1, -9, 5, -2, 8, -6, -9, 7, -3, 9, -3, 9, 6, -4, 3, -7, -6, 8, 3, -1, -4, -10, -5, -1, 3}, + []int{-5, -5, 4, 5, -8, 3, -1, -7, -1, 9, -4, 8, -2, -8, 3, -7, -7, -7, -3, 8, 3, -3, -4, 9, -7, 7, 4, -4, 9, 3, -9, 0, -8, -4, 0, 1, -6, -3, 4, -10, 3, 6, 5, -6, 7, 1, -2, -3, 5, -8, -10, -1, -5, 6, 4, -3, -7, -8, -8, 3, 0, 0, -4, -7, 1, -6, 9, 5, 2, -1, -2, -4, 8, 8, 1, -4, -9, -8, 2, -3, 1, 0, 1, -2, -7, 6, 3, -9, -9, -4, -1, 5, -9, -5, -4, 6, 7, 7, -5, -6}, + []int{8, 8, 7, 0, 1, -10, 1, 0, -2, -3, -7, -7, -6, -5, -8, 7, 9, -6, 8, 7, -5, -7, 9, -10, -3, -1, 5, 7, 1, -10, -6, 7, -4, 9, 2, 2, 3, -8, -1, -4, 5, -2, -3, -3, -8, 5, -7, -4, 2, 5, -5, -3, 6, 6, -10, 2, 3, 4, 6, -5, -8, 8, -10, 2, -4, 9, -9, -10, -7, -6, 5, 9, -1, 9, 1, 8, -2, 4, -2, 6, 0, -8, -8, -3, -8, -4, -6, -8, 0, -9, 6, -4, 0, 4, 7, 1, 3, 0, -2, 7}, + []int{1, 1, 9, 6, 5, 6, 4, -9, -3, -10, 9, 9, -7, -10, 3, 2, 0, -3, 1, 1, -7, -5, -5, -4, -8, -6, 9, -3, -9, -10, 3, -9, -1, 8, -7, -2, -1, -5, 0, 2, 9, -9, 8, 8, 6, -5, 4, -2, -5, 0, 3, 1, -7, 4, 0, 0, -3, 2, 4, -2, 4, -8, 2, 4, 8, 7, -8, 8, -8, 2, 8, 9, 1, 5, 5, -7, -6, 7, -9, -1, -4, 6, 4, 4, 1, -10, -7, -1, 2, 9, 0, 4, -4, 9, -9, 3, 0, -2, -3, -2}, + []int{9, 6, -4, 0, 9, 2, 7, -2, 3, 7, -4, 1, 4, 5, -8, 6, -3, -6, -6, -5, -8, -10, -2, -5, -4, -2, 3, 4, -10, -10, -10, -6, 1, 0, -4, 6, -2, 5, 6, 4, -3, -6, -8, 2, 3, 0, 4, -6, 8, 3, 3, 2, -10, 5, 8, 2, -10, 5, 8, 6, -1, -2, 6, 9, 9, -9, 8, 5, -8, 7, -6, 7, 1, -7, 9, 9, 8, 3, 6, 6, -5, 6, 8, -6, 1, 7, 3, 6, -6, -3, -5, 3, -6, 3, 5, -6, -7, -9, 0, 7}, + []int{2, -1, 3, -2, -5, 6, 0, 5, -1, 3, 0, 0, 1, 6, -7, 9, -4, 7, 0, -1, 8, 7, 5, -7, 0, 0, 7, -1, -8, -4, 4, 5, 5, 9, -7, 3, -10, 7, 6, -9, 6, -9, 0, -4, -5, -5, 2, -5, -7, -7, 9, 9, -9, 1, 8, 1, 5, 5, 8, 6, 2, 7, 1, -6, 8, 1, -4, 4, 7, 4, 9, -5, -10, 7, 8, -4, 0, 1, 0, -6, 5, 6, 8, 0, -9, 2, 6, -9, 0, -2, 0, 8, -7, 3, -7, 8, 4, -8, -8, 6}, + []int{5, -5, -9, -7, 2, 0, -2, -5, 1, 5, 5, -8, -6, 9, -4, -5, 1, 2, 1, 2, 9, 0, -9, 5, -10, 8, -3, 1, -7, 1, -7, 5, 1, 2, 3, -8, -5, 9, 8, 4, 1, 2, 3, 3, 4, -6, 1, -4, 1, -3, -5, -8, 5, -2, 6, 1, 8, -1, 2, 6, -10, 9, -1, 5, 6, 0, -4, -6, -8, -10, -3, 4, -6, 4, -4, 1, 6, -6, -10, -7, 2, -4, -1, -9, -8, -3, -5, -1, -8, -1, -10, -9, -5, -5, -5, 9, 5, -10, 4, -7}, + []int{3, 3, -7, -5, 9, -8, -6, -9, -7, 8, -7, -9, 1, -5, 1, 4, 9, -1, -1, 1, -7, 4, -1, 0, 5, -1, 3, 6, -6, 7, 2, -6, 8, -7, 0, -3, -4, 5, 3, 8, -3, -8, 1, -7, -3, -8, 1, 7, 5, -2, -9, 1, -3, 7, 4, -3, 4, -3, 0, 1, 4, -9, -2, 1, 8, 0, -2, -6, 7, -9, 5, -2, 5, -2, -6, 5, 3, 9, 6, -8, 8, -10, 1, -8, 0, -1, 0, 1, -1, -10, -5, -8, 4, 3, 0, -3, -1, 6, -5, 1}, + []int{9, 3, 7, -1, 1, -1, -4, 5, -10, -7, -10, 6, -4, -7, -9, -2, -1, -4, 1, 5, -9, 5, -1, -9, -7, 5, -4, -8, 0, -3, 3, 7, -1, -4, -4, -4, -2, -2, 3, -6, -1, 1, -3, 2, 0, 1, -9, -6, -10, -9, 6, -3, -4, -10, -1, 8, -4, 8, -10, 4, -4, -8, -6, 8, 5, 6, 6, -3, 0, 0, 3, -8, 6, -5, 9, 9, -10, -2, -5, 6, 4, -2, -9, 5, 5, 9, 1, 1, 8, 9, -6, 6, 7, -1, 4, -8, 2, -7, -8, 6}, + []int{6, -8, -7, 7, 2, -2, -5, 9, -5, -2, -2, 4, -6, 8, 4, 5, -2, -9, 8, -5, -2, 2, 4, -2, 7, -5, 5, -5, 2, 6, -10, 3, 9, -6, 3, -9, -8, -5, -9, -10, -2, -5, -4, 9, -9, -6, -3, 4, 4, -8, -5, -10, 5, -10, -8, -9, 3, 7, -10, -4, -6, 4, -8, 3, 9, -10, -6, 3, 3, 8, -3, -2, 0, -8, 1, -7, 8, -2, -6, -8, -5, 2, 0, -6, 6, -7, 3, -1, -3, 4, 1, 4, 6, 0, -2, 7, 0, 9, -9, 4}, + }, + 292, + 287, + }, + + { + [][]int{ + []int{27, 5, -20, -9, 1, 26, 1, 12, 7, -4, 8, 7, -1, 5, 8}, + []int{16, 28, 8, 3, 16, 28, -10, -7, -5, -13, 7, 9, 20, -9, 26}, + []int{24, -14, 20, 23, 25, -16, -15, 8, 8, -6, -14, -6, 12, -19, -13}, + []int{28, 13, -17, 20, -3, -18, 12, 5, 1, 25, 25, -14, 22, 17, 12}, + []int{7, 29, -12, 5, -5, 26, -5, 10, -5, 24, -9, -19, 20, 0, 18}, + []int{-7, -11, -8, 12, 19, 18, -15, 17, 7, -1, -11, -10, -1, 25, 17}, + []int{-3, -20, -20, -7, 14, -12, 22, 1, -9, 11, 14, -16, -5, -12, 14}, + []int{-20, -4, -17, 3, 3, -18, 22, -13, -1, 16, -11, 29, 17, -2, 22}, + []int{23, -15, 24, 26, 28, -13, 10, 18, -6, 29, 27, -19, -19, -8, 0}, + []int{5, 9, 23, 11, -4, -20, 18, 29, -6, -4, -11, 21, -6, 24, 12}, + []int{13, 16, 0, -20, 22, 21, 26, -3, 15, 14, 26, 17, 19, 20, -5}, + []int{15, 1, 22, -6, 1, -9, 0, 21, 12, 27, 5, 8, 8, 18, -1}, + []int{15, 29, 13, 6, -11, 7, -6, 27, 22, 18, 22, -3, -9, 20, 14}, + []int{26, -6, 12, -10, 0, 26, 10, 1, 11, -10, -16, -18, 29, 8, -8}, + []int{-19, 14, 15, 18, -10, 24, -9, -7, -19, -14, 23, 23, 17, -5, 6}, + }, + -100, + -101, + }, + + { + [][]int{ + []int{28, 4, -19, 18, -7, -10, 27, 19, 1, 16, 0, 10, -17, 11, 11, 27, -1, 10, 12, -1}, + []int{-2, -19, 17, 4, 25, -20, 4, 3, 4, 28, -10, 7, 16, -14, -3, -19, 6, 17, -4, -7}, + []int{2, 8, 18, -17, -2, 10, -6, -5, 11, 10, 22, -6, 19, -16, 6, -4, 18, 5, 22, -17}, + []int{-14, -7, -20, 13, -19, -20, -15, 21, -11, -10, -8, -9, 10, 13, 6, -10, 15, 9, -15, -2}, + []int{-18, 26, 12, 8, 2, 16, -17, 12, 0, -5, 9, -3, -12, -11, 3, -6, -18, 16, -7, -14}, + []int{5, 29, 25, 22, 11, -3, -2, -15, 4, 13, -17, -2, 0, -2, 20, 10, -18, 6, 25, -20}, + []int{5, -7, 8, 5, 15, 22, 8, -5, 22, -18, -5, -14, 23, 2, -8, 12, -16, -18, 12, -12}, + []int{27, 18, 4, 11, -3, 12, -4, -8, -3, 25, -9, 24, -14, 5, 11, -9, -17, 0, 25, -15}, + []int{26, -7, 18, 4, 4, 18, -17, 9, -19, -9, -19, -8, -4, -13, 10, -11, 6, -16, -12, 12}, + []int{28, 22, 7, 11, -6, 13, 8, 22, 7, -14, 17, 14, 10, 29, 16, 9, -3, 18, -9, 10}, + []int{27, 19, -10, -9, 1, 3, 14, 1, 7, 3, -3, 16, -2, 9, 14, -7, -19, -5, 23, 19}, + []int{-17, 7, -20, 8, -5, -6, -2, 25, 29, 16, 23, 4, 4, 27, 16, 17, 9, 20, -6, 22}, + []int{2, 9, -13, 1, -18, 25, 4, 7, 25, 26, -4, 8, -19, 18, 6, -7, -5, 7, 21, -8}, + []int{-2, 11, 1, 29, 6, -16, -8, 3, 7, 11, 10, -2, -1, -20, 20, 4, 19, 5, 29, -7}, + []int{29, -12, -3, 17, 6, 19, 23, 12, -19, 13, 19, 5, 27, 22, -17, 27, 10, -12, 12, 23}, + []int{24, 16, 4, 25, 15, 13, 24, -19, 1, -7, -19, 13, -13, 14, 13, 26, 9, 18, -9, -18}, + []int{-17, 4, -18, -18, -19, 3, -13, 12, 23, -17, -10, -20, 14, 2, 18, 21, -12, 27, -3, 4}, + []int{27, 13, 12, 14, 16, -9, -2, -15, -20, 8, -2, 24, 18, 15, 26, 21, 27, 17, -15, -3}, + []int{25, -8, 17, -10, -16, 13, 26, -11, -15, 6, -5, -13, 23, 2, 24, -4, 5, 8, -15, -1}, + []int{15, -12, 18, 5, -3, 7, 5, 11, -4, -13, 28, 20, 0, -4, -13, -5, -13, -8, -16, 3}, + }, + -123, + -128, + }, + + { + [][]int{ + []int{2, -9, 2, -6, -3, -8, 6, -6, 3, 7, -10, -2, 9, 1, 3, -9, -3, 4, 0, -10, 7, -9, -8, 6, -10, -3, 4, -5, -7, 0, 2, 3, -1, -9, -3, 5, -6, -4, 1, -1, 8, -4, 5, -4, -1, 0, -9, -1, -10, -3}, + []int{-8, 7, 7, -10, -7, 7, 0, 4, 1, 0, 1, -2, 8, 4, -10, -1, 8, 5, -8, 5, 6, -1, 1, 3, -10, 2, 6, 1, -10, -1, 5, 6, 8, 0, 2, 2, 3, -2, 5, 2, 4, -1, 0, 8, -2, 5, 2, 3, -6, -2}, + []int{9, 7, 3, -8, 0, -8, 5, -2, -3, -7, -4, 3, 1, -9, 4, 6, -9, -1, 2, -1, 9, -7, 1, 2, -8, 9, 6, 5, 0, 7, -3, -1, 0, 5, -3, -2, 7, 0, -6, 8, -4, -8, -4, -2, -2, 8, -1, 8, -2, -6}, + []int{1, -7, 5, -10, -4, 6, 4, -3, 1, 5, 7, -1, 3, 4, 6, -7, 0, -6, -6, 1, -8, 5, -5, 7, 8, 1, -8, 9, -2, 3, 0, 9, -3, 5, -8, 9, 8, -2, 5, -8, -6, -3, -1, 7, 1, -5, -10, -10, 3, 0}, + []int{8, 8, -4, -7, -5, -4, -6, -9, 8, 6, 5, -1, -4, 6, 6, -9, -2, 3, -6, 4, -2, 6, -5, 0, 0, 4, -1, 1, -4, -4, 4, 7, -3, 2, -1, -1, 3, 5, 7, -7, 9, -4, -8, -9, -2, -5, -4, -6, 8, 2}, + []int{2, 0, 3, -9, 6, -2, -9, 0, -3, 9, 4, 3, 5, 8, 1, -7, -10, -4, 3, -4, 2, 2, -9, -3, -5, 8, -9, -10, 3, -6, -7, -4, -4, -1, -4, -9, 0, -8, 3, 8, -10, -3, 7, -5, -1, -2, 9, 7, 4, -1}, + []int{0, 3, 5, -9, -5, 2, 5, -7, 2, -7, 2, -4, -3, -8, 0, -3, 2, 2, 9, -2, 9, 4, 4, -7, -4, 1, -6, -10, -8, -1, -4, 1, 4, 5, -2, 7, -4, 8, -1, -9, 3, -6, -5, 8, -3, -7, 5, 5, 4, -8}, + []int{-7, -1, 3, 5, 1, -2, 0, -1, -6, 7, 6, -4, -7, 5, 6, -10, -2, 7, 7, 5, 1, 1, 7, 8, 4, 9, 0, 9, -4, 3, -10, 2, -1, -8, -9, 9, -2, 8, -3, -6, -10, -2, -9, 8, -4, 8, -1, 5, -3, 7}, + []int{-2, 3, -5, 4, 9, -5, -10, 8, -10, -5, -10, -3, -7, -2, -3, 9, 1, -2, -1, -2, 1, 3, 3, -9, 4, 2, 5, -2, 1, 4, 7, -6, -1, 8, 9, -9, 9, -5, -8, -4, -1, 7, -4, 1, -8, -3, 1, 1, -9, -9}, + []int{-9, 9, 8, 0, -2, 5, -8, -6, 8, 6, 3, -10, 8, 9, -3, -6, -2, -1, -1, 8, -4, -6, 8, 9, 1, -5, 8, 0, -8, 0, 7, -9, 0, 0, 4, 3, 1, 8, 8, 4, 5, 5, 6, 7, -9, -9, -3, -4, -4, 4}, + []int{0, -10, 4, 1, 4, 9, -8, 8, 7, -6, -10, -1, 0, 4, 0, 8, 3, 2, 4, 2, -5, 0, -5, -10, -3, -9, 9, 5, 2, 2, 1, 9, 7, -3, -7, 2, -8, 3, 0, -5, -9, -6, -6, -6, -5, 5, 8, 4, 5, -9}, + []int{-7, 8, 1, 6, -9, -10, 0, -1, -10, -9, 8, 3, -10, -5, -7, -7, -5, 1, 7, -5, 2, 5, -5, -10, -6, 8, -1, 2, 4, -7, 0, -3, 6, -3, -6, 2, 9, 8, -9, 1, 2, -8, 8, -3, -10, -7, 4, -10, 6, 9}, + []int{9, 1, 6, 2, 8, -7, 8, -6, 0, -5, -1, -5, 6, 7, -4, -9, -1, -4, 5, 1, 3, -10, -7, 4, 5, -9, 7, 4, 6, 5, -10, -9, -2, 9, -4, -3, 1, -10, 5, -9, -10, 4, -1, -3, -6, 7, -1, -6, -1, -7}, + []int{-1, 8, -9, -6, -2, 0, 3, 5, -1, -1, -1, -8, -6, -6, -1, -8, -1, -1, 2, -1, 1, 4, -6, -7, -6, -9, -7, 4, -5, -1, -5, -1, -10, -2, -5, -10, -10, 4, -6, 7, -4, 7, 9, 0, -9, 3, -1, 4, -7, 3}, + []int{-8, 3, -8, 1, 3, 2, -3, -5, 6, 6, 0, 2, 5, 3, 4, 7, 0, -8, -6, 7, 7, -6, 4, 3, -2, -2, 2, 1, -2, -6, -8, 6, -3, -2, -7, 1, -6, 3, 4, -6, -3, 5, -7, -2, 7, 2, -1, 2, -3, -2}, + []int{-1, -10, 9, -4, -9, -4, 6, 0, 8, -7, 9, 3, -3, 8, 0, -8, 1, 0, -6, -4, -5, -1, -2, 1, -4, -8, -7, -10, 0, 4, 6, 6, -4, 4, 4, -2, 7, 2, -1, 4, 0, -9, 7, 9, -8, 4, -6, -7, -7, -1}, + []int{-5, -6, -3, -8, 6, -10, -5, -9, 5, -3, -10, -8, 8, -2, 4, 6, -3, 8, 2, 4, -5, 1, -7, 6, 0, 6, 9, 6, 9, 6, -6, 2, 9, 7, -8, -3, 0, 4, -1, -4, -7, 6, 3, -5, 6, -7, -10, 8, 7, 7}, + []int{6, 7, -6, -2, 6, -2, 1, -3, 3, -9, -8, 9, -5, -4, 5, 5, -2, -1, -7, 4, 3, -10, -4, -4, 9, -4, -4, -5, -1, -7, 2, 1, -3, 6, 6, 1, 4, -3, -7, -3, -5, -5, 7, -1, 3, -10, 2, 2, 4, -10}, + []int{7, 4, -7, -6, -1, 5, -6, 8, -1, -1, -5, 9, -1, 4, -4, -10, -7, -7, 7, -8, -8, 4, 1, -7, -1, 1, -7, 4, 4, -4, -6, 1, -8, 5, -1, -8, 5, -8, 4, -9, 5, 3, 6, 2, 1, -2, 2, -9, 2, -2}, + []int{-9, -2, -1, -3, 5, 2, 7, 9, 6, -4, 4, -3, -5, 5, 8, 0, 6, 7, -6, 9, -1, 0, 1, -6, 7, 5, 0, 1, -3, -8, -6, -4, -1, -4, 4, 4, 3, -6, 3, 8, -10, 9, -7, -1, 9, 9, -3, -1, 2, 4}, + []int{7, -8, -3, 8, 0, 0, -8, -7, -3, 4, 3, -3, -8, -5, 4, 9, 6, 9, -6, -8, 0, 3, 5, -7, 7, -3, -2, -6, -3, 0, -9, -2, -2, -7, -8, -10, 0, 5, 3, 7, 7, -1, 9, -1, -4, 3, 3, 3, 2, 4}, + []int{-8, -4, 5, 9, -1, 1, 6, 7, 3, 7, -4, 6, -8, 6, -6, 0, 2, -5, 8, -10, 1, 2, 6, 2, -1, -6, -6, 4, 6, -1, -10, -3, -5, -9, 6, -3, -9, 4, -9, -4, -4, 5, 4, -4, -1, -5, -4, 1, -3, -6}, + []int{0, 9, -2, 4, -1, 8, 5, -3, 3, -9, 1, 4, -3, 8, 4, 5, 0, 5, 2, 7, -3, 6, 8, 4, 7, 8, 6, -2, -6, -4, -3, -4, 1, 7, -10, 5, 4, 7, 7, -3, 6, 6, -6, 6, 7, 2, -1, -3, -2, -4}, + []int{4, -7, -7, 4, -7, -1, -8, 5, 2, -10, 7, 6, 0, 1, 6, 5, 4, -5, -8, -6, 0, 5, -1, -10, -5, -9, -7, 1, 3, 4, 0, 2, 5, -1, -6, -5, -7, 2, 0, -1, 3, -4, -1, -7, 9, 4, 4, -3, -3, 7}, + []int{8, -6, 5, 6, -1, 0, -2, 4, 2, -6, -10, 5, 6, -9, -3, 0, -4, -7, 1, -9, 2, 2, 1, 4, -5, -10, -9, 5, 9, -4, -7, -5, 6, 5, 6, 4, -3, -6, -7, 0, -5, -2, -2, 5, 1, 3, -9, 9, 3, -9}, + []int{1, -5, -6, -10, 3, 9, 6, -2, -5, -3, -5, 7, 4, -1, 9, 4, 7, -2, 1, -6, 1, 9, -6, -1, -8, -1, 0, -10, 9, -10, 8, 9, -3, 5, -4, -1, 6, 0, 0, -1, -3, 8, 2, 9, -6, -1, 5, 3, 4, -7}, + []int{-8, -6, 1, 7, -7, 3, 4, 4, 4, 0, 9, 6, 6, 3, -8, 3, 9, 1, 2, -4, 6, 7, -3, 9, -4, -3, -9, 6, -5, -5, -4, 4, 9, -4, -1, 3, 4, -4, 5, -8, -4, -3, 0, -6, -3, 6, -8, 9, -4, -8}, + []int{3, 6, -1, 8, 2, 5, -5, 1, -6, -8, -10, 2, -8, 3, -8, 7, -3, 9, -7, 0, 1, -6, -4, 9, -2, 9, -6, 8, -1, 8, -6, -3, -7, -3, -1, -4, -10, -4, 2, 8, -8, 2, -2, -2, 4, 8, 6, -5, 4, 4}, + []int{-10, 2, 6, 3, 8, -3, -10, 8, 8, 3, -10, -8, -7, 6, 7, -6, 7, 6, -9, -3, 2, -2, 1, -4, 8, -7, 8, -3, -6, 7, 8, 5, -2, 6, 1, -10, 9, 7, -2, -10, -1, 5, 9, 4, 7, -4, 3, -3, -6, 2}, + []int{2, 0, -10, -10, 5, 5, -1, 1, -8, 2, 0, 5, 9, 3, -10, -4, -6, -8, -6, 5, 4, -8, 8, -8, 3, -7, -8, 4, 3, 5, 4, 0, -5, -6, 6, 2, 7, -2, 7, -4, 7, -8, 0, -8, 2, -9, -7, -5, -3, -8}, + []int{7, 1, 1, -10, -2, -9, -2, -10, 2, -4, 8, 7, 9, -8, -3, -9, -6, 5, 1, 2, 9, -4, 3, -9, 3, -8, 9, -3, 7, 1, -7, -5, 9, 5, -4, -9, 1, 1, 8, 4, -9, 2, 2, -10, -6, 2, 2, -10, -1, -4}, + []int{-3, -2, 4, -4, 6, 2, -8, -3, 8, -4, -4, 1, -8, 9, 3, -9, 3, 8, -6, -4, 2, 2, 3, 4, -8, 3, -2, -2, -4, 8, 8, 1, -4, 9, -4, 8, 9, 5, 4, 8, 8, 0, -3, 0, 8, -3, 1, 9, 5, 4}, + []int{0, -5, -4, 9, -8, 4, -4, 1, 6, 8, -8, 0, -6, 1, 2, 4, -10, 0, 4, 6, 5, -1, 1, 2, -3, -8, -6, 0, -8, -2, -3, -4, -1, -6, 5, -3, -8, 5, 0, -3, -3, 0, 2, -9, 0, 8, -6, -5, 0, 8}, + []int{-6, 3, -2, -5, -6, -2, 9, -6, 9, -3, -5, -3, 4, -1, 3, 9, -9, -7, -10, -5, -7, 6, -1, -2, -7, 5, 2, 3, -10, -3, 5, 4, 0, 4, -8, -7, 9, 3, -5, -2, -1, 1, -6, 4, 2, -10, 9, -4, 8, 9}, + []int{7, -10, 3, -7, -4, 3, 3, 1, 0, 8, 0, 3, -6, -4, 7, -10, 9, 7, 8, -6, -7, 5, -10, 7, 5, 2, -2, 4, 4, 7, 5, 3, -6, -2, -3, -10, 5, 9, -2, 7, 7, 0, 9, 4, 5, 8, -3, 8, 4, -6}, + []int{-8, 2, -5, 9, -8, -4, 9, 7, -2, -6, 9, -9, 2, 0, 7, -9, 9, 4, 5, -6, 3, 9, 6, 8, 9, -7, -3, 0, -6, 7, -7, 7, 1, -8, -9, 0, 7, 7, -7, 7, 8, -4, -6, -2, 7, -1, -2, 9, 9, 0}, + []int{-4, -8, -10, 8, 9, -1, -4, -3, 2, -8, -8, -1, -3, -3, -6, 0, -1, -4, 7, 9, -6, -9, -7, 9, 1, -7, 7, -6, 4, 8, 6, 5, -5, 5, 3, 3, -7, -8, -7, -3, -3, 1, 6, -9, 7, -9, 1, 9, 7, -5}, + []int{-2, 2, -2, 9, -7, 6, 6, 4, 4, -3, -8, -8, -8, 0, -3, 3, 6, -8, -8, 1, -2, 0, 9, -7, 7, 8, -9, -9, -4, 8, -7, -4, -2, -7, 8, 6, -8, -6, 0, 4, -4, -3, -5, -3, 3, 8, 2, 8, -2, -9}, + []int{5, 9, 1, -5, 6, 6, 4, 9, -7, 8, 8, 0, -5, 6, 9, 7, -7, -6, -6, 6, -1, 3, -8, -6, 7, -8, -6, -2, 6, 3, -4, 9, 9, 8, -9, -2, 9, -2, 9, -9, -10, -2, 5, 9, 8, -9, -3, -9, 3, -10}, + []int{-10, -3, -1, -9, -4, 7, -1, 7, -10, -2, -10, 4, 4, -3, -2, -3, -8, 4, 5, 7, 9, -6, 1, 5, -5, -3, -7, -6, -9, 2, 1, 8, 1, 8, -8, -1, -5, 1, 8, 3, -1, -1, -2, -1, 6, -3, 3, -6, -9, 6}, + []int{2, -1, -10, 5, -1, -3, -3, 6, 1, -1, -10, -1, -9, 2, 7, 3, 3, -10, 3, 3, 8, -7, 5, 6, -4, 4, -3, -10, -3, -2, 6, -1, 5, 0, -2, -4, -5, -6, 9, 8, -4, -6, 8, 7, -2, -2, -4, 9, 4, -2}, + []int{-2, -6, 6, -8, 8, 2, -6, -9, 3, -10, -5, -10, -1, -4, 5, 1, -2, -4, 9, -8, 1, 0, -1, -5, -9, -10, -3, 2, 7, -2, 5, -10, 5, 9, -2, 3, 0, -4, -9, 8, 6, 1, 5, 4, -9, -3, -6, 6, -10, 1}, + []int{1, 7, 2, -6, 8, -6, -8, -5, 8, -8, 2, 8, 0, 6, -8, -3, 8, 8, -8, -5, -5, -5, -5, -1, -1, 1, -10, 5, -3, -9, 6, -2, -8, -9, -8, 5, 1, -9, -9, -6, -5, -2, -5, -4, 0, -10, -6, -6, 1, -6}, + []int{9, 4, 3, 0, 6, -1, -2, 9, 7, 4, 4, -4, -2, -8, 1, 8, 2, -6, -10, -10, 8, -4, -9, -5, 3, 1, 6, -2, 1, 3, -7, 1, -9, 2, 6, -9, 3, 1, 5, -3, 8, -9, -6, 5, 9, -2, -3, -5, 2, -8}, + []int{6, -4, 7, 1, 8, -1, 2, 5, 5, -2, -1, 0, -6, -8, -6, -9, 5, 9, 5, 2, -8, -9, 7, -2, -8, -6, 4, 1, 6, 2, 2, 8, 1, -9, 7, 5, -8, 2, 8, -4, 1, -2, 9, -10, 6, -7, -2, 4, 6, 0}, + []int{5, 2, 8, 4, -7, 4, -4, 3, 3, 1, -2, -5, -5, -7, 3, 9, 1, -10, 1, -4, 4, 7, 6, -10, -5, 1, 8, -5, -10, -1, -9, -6, -4, -8, -8, 5, -6, 6, -7, -4, -10, 1, 9, 8, 9, 4, -7, 4, -7, 7}, + []int{-2, 1, 0, -10, 5, -6, 1, 9, -3, -10, 4, 4, 0, -3, -9, 1, -4, 1, -6, 7, 7, -2, -7, -7, 5, -5, -9, 0, -10, -10, 3, -2, -5, -7, 2, 0, 5, 7, -10, 1, -9, 3, 2, 6, 7, -9, 1, 0, 9, 3}, + []int{4, 0, 3, -5, -1, 7, 4, 7, 7, -5, -2, -3, 7, 8, -7, 0, -5, -6, 2, -1, 8, 5, 8, 4, 0, -2, -2, 2, 1, -6, -2, -7, 2, -7, 0, 8, 9, 0, 9, -1, -5, 6, 2, -9, -4, 8, 7, -6, -10, 7}, + []int{1, 4, -3, -6, 4, 6, 4, 4, 9, 8, 2, 2, -5, 6, 2, 5, 6, 6, -5, -9, 9, -7, -8, 7, -4, 7, -5, -2, 6, -8, 1, 4, 5, -8, -6, 4, -10, -7, -3, -1, -6, -4, 1, 1, 1, 2, 9, -4, -2, -1}, + []int{1, -2, 3, -4, 6, 2, 3, 0, -3, -8, 8, -4, -10, 4, 2, 1, -5, -10, 6, -2, 6, 3, -5, 6, -2, -5, 6, -7, -9, 8, -1, -7, 7, 5, -1, 8, -3, -6, 8, 0, 7, 7, -1, -4, -10, -4, 1, 5, 3, 0}, + }, + 300, + 194, + }, + + // 可以有多个 testcase +} + +func Test_maxSumSubmatrix(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxSumSubmatrix(tc.matrix, tc.k)) + } +} + +func Benchmark_maxSumSubmatrix(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSumSubmatrix(tc.matrix, tc.k) + } + } +} diff --git a/Algorithms/0365.water-and-jug-problem/README.md b/Algorithms/0365.water-and-jug-problem/README.md new file mode 100755 index 000000000..7390699ff --- /dev/null +++ b/Algorithms/0365.water-and-jug-problem/README.md @@ -0,0 +1,34 @@ +# [365. Water and Jug Problem](https://leetcode.com/problems/water-and-jug-problem/) + +## 题目 + +You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. +You need to determine whether it is possible to measure exactly z litres using these two jugs. + +If z liters of water is measurable, you must have z liters of water contained within one or both buckets by the end. + +Operations allowed: + +1. Fill any of the jugs completely with water. +1. Empty any of the jugs. +1. Pour water from one jug into another till the other jug is completely full or the first jug itself is empty. + +Example 1: (From the famous "Die Hard" example) + +```text +Input: x = 3, y = 5, z = 4 +Output: True +``` + +Example 2: + +```text +Input: x = 2, y = 6, z = 5 +Output: False +``` + +Credits:Special thanks to @vinod23 for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0365.water-and-jug-problem/water-and-jug-problem.go b/Algorithms/0365.water-and-jug-problem/water-and-jug-problem.go new file mode 100755 index 000000000..3ef456389 --- /dev/null +++ b/Algorithms/0365.water-and-jug-problem/water-and-jug-problem.go @@ -0,0 +1,33 @@ +package problem0365 + +func canMeasureWater(x int, y int, z int) bool { + // 不需要水壶就能实现 + if z == 0 { + return true + } + + // 两个水壶都不够装 + if x+y < z { + return false + } + + // 此段以后,需要 x <= y + if x > y { + x, y = y, x + } + + // 只有一个水壶的话, + // 只能提供另一个水壶的容量 + if x == 0 { + return y == z + } + + // y%x == 0 时, + // x 是初始 x 和 y 的最大公约数 + // z%x == 0 的容量都可以提供 + for y%x != 0 { + x, y = y%x, x + } + + return z%x == 0 +} diff --git a/Algorithms/0365.water-and-jug-problem/water-and-jug-problem_test.go b/Algorithms/0365.water-and-jug-problem/water-and-jug-problem_test.go new file mode 100755 index 000000000..ecdb50a75 --- /dev/null +++ b/Algorithms/0365.water-and-jug-problem/water-and-jug-problem_test.go @@ -0,0 +1,45 @@ +package problem0365 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + x int + y int + z int + ans bool +}{ + + {11, 3, 13, true}, + {0, 0, 0, true}, + {3, 5, 4, true}, + {4, 6, 8, true}, + {3, 5, 1, true}, + {2, 6, 5, false}, + {2, 6, 15, false}, + {0, 2, 1, false}, + + // 可以有多个 testcase +} + +func Test_canMeasureWater(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canMeasureWater(tc.x, tc.y, tc.z), "输入:%v", tc) + } +} + +func Benchmark_canMeasureWater(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canMeasureWater(tc.x, tc.y, tc.z) + } + } +} diff --git a/Algorithms/0367.valid-perfect-square/README.md b/Algorithms/0367.valid-perfect-square/README.md new file mode 100755 index 000000000..d2d637b71 --- /dev/null +++ b/Algorithms/0367.valid-perfect-square/README.md @@ -0,0 +1,27 @@ +# [367. Valid Perfect Square](https://leetcode.com/problems/valid-perfect-square/) + +## 题目 + +Given a positive integer num, write a function which returns True if num is a perfect square else False. + +Note: Do not use any built-in library function such as sqrt. + +Example 1: + +```text +Input: 16 +Returns: True +``` + +Example 2: + +```text +Input: 14 +Returns: False +``` + +Credits:Special thanks to @elmirap for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0367.valid-perfect-square/valid-perfect-square.go b/Algorithms/0367.valid-perfect-square/valid-perfect-square.go new file mode 100755 index 000000000..b812323d7 --- /dev/null +++ b/Algorithms/0367.valid-perfect-square/valid-perfect-square.go @@ -0,0 +1,16 @@ +package problem0367 + +func isPerfectSquare(num int) bool { + r := intSqrt(num) + return r*r == num +} + +func intSqrt(n int) int { + r := n + + for r*r > n { + r = (r + n/r) / 2 + } + + return r +} diff --git a/Algorithms/0367.valid-perfect-square/valid-perfect-square_test.go b/Algorithms/0367.valid-perfect-square/valid-perfect-square_test.go new file mode 100755 index 000000000..c5249ea68 --- /dev/null +++ b/Algorithms/0367.valid-perfect-square/valid-perfect-square_test.go @@ -0,0 +1,39 @@ +package problem0367 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans bool +}{ + + {16, true}, + {64, true}, + {256, true}, + {14, false}, + + // 可以有多个 testcase +} + +func Test_isPerfectSquare(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isPerfectSquare(tc.num), "输入:%v", tc) + } +} + +func Benchmark_isPerfectSquare(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isPerfectSquare(tc.num) + } + } +} diff --git a/Algorithms/0368.largest-divisible-subset/README.md b/Algorithms/0368.largest-divisible-subset/README.md new file mode 100755 index 000000000..d63cca6a9 --- /dev/null +++ b/Algorithms/0368.largest-divisible-subset/README.md @@ -0,0 +1,29 @@ +# [368. Largest Divisible Subset](https://leetcode.com/problems/largest-divisible-subset/) + +## 题目 + +Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0. + +If there are multiple solutions, return any subset is fine. + +Example 1: + +```text +nums: [1,2,3] + +Result: [1,2] (of course, [1,3] will also be ok) +``` + +Example 2: + +```text +nums: [1,2,4,8] + +Result: [1,2,4,8] +``` + +Credits:Special thanks to @Stomach_ache for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0368.largest-divisible-subset/largest-divisible-subset.go b/Algorithms/0368.largest-divisible-subset/largest-divisible-subset.go new file mode 100755 index 000000000..59ba427a1 --- /dev/null +++ b/Algorithms/0368.largest-divisible-subset/largest-divisible-subset.go @@ -0,0 +1,57 @@ +package problem0368 + +import "sort" + +func largestDivisibleSubset(a []int) []int { + size := len(a) + if size == 0 { + return []int{} + } + + sort.Ints(a) + // 注意:下面的 a 是升序的啦 + + // max 是符合题意的 largest subset 的长度 + // largest subset 中最小值是 a[idx] + max := 1 + idx := 0 + + // dp[i] 是 a[i:] 中包含 a[i] 的 largest subset 的长度 + dp := make([]int, size) + for i := range dp { + dp[i] = 1 + } + + // next 用来记录符合题意的 largest subset 的元素的索引值 + // largest subset 中 a[i] 的下一个元素是 a[next[i]] + // 这样的话,由 idx 就可以得出 result 了 + next := make([]int, size) + + // 从大往小,可以检查,因为 + // 如果 a[j]%a[i]==0的话,a[next[j]]%a[i]==0 肯定成立,就无需再检查了 + for i := size - 2; 0 <= i; i-- { + for j := size - 1; i < j; j-- { + if a[j]%a[i] != 0 { + continue + } + if dp[i] < dp[j]+1 { + // a[i] 指向 a[j] 可以让符合题意的 subset 变大 + next[i] = j + dp[i] = dp[j] + 1 + } + // 出现了更大的 subset + if max < dp[i] { + max = dp[i] + idx = i + } + } + } + + res := make([]int, max) + for i := range res { + res[i] = a[idx] + idx = next[idx] + } + + return res +} diff --git a/Algorithms/0368.largest-divisible-subset/largest-divisible-subset_test.go b/Algorithms/0368.largest-divisible-subset/largest-divisible-subset_test.go new file mode 100755 index 000000000..854a08ee1 --- /dev/null +++ b/Algorithms/0368.largest-divisible-subset/largest-divisible-subset_test.go @@ -0,0 +1,59 @@ +package problem0368 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{1, 2, 3,4,5,6,7,8,9}, + []int{1, 2,4,8}, + }, + + { + []int{1, 2, 3}, + []int{1, 3}, + }, + + { + []int{}, + []int{}, + }, + + { + []int{1, 2, 4, 8}, + []int{1, 2, 4, 8}, + }, + + { + []int{832, 33, 531, 416, 335, 298, 365, 352, 582, 936, 366, 305, 930, 530, 97, 349, 71, 295, 840, 108, 299, 804, 925, 627, 953, 571, 658, 732, 429, 136, 563, 462, 666, 330, 796, 315, 695, 500, 896, 982, 217, 200, 912, 98, 297, 612, 169, 943, 628, 593, 959, 904, 219, 240, 857, 789, 897, 940, 569, 384, 502, 382, 401, 184, 716, 230, 29, 963, 211, 597, 515, 122, 163, 86, 215, 105, 889, 842, 49, 847, 267, 87, 954, 407, 245, 975, 719, 746, 709, 471, 281, 238, 186, 510, 618, 149, 73, 214, 663, 194, 260, 825, 631, 474, 519, 668, 329, 718, 765, 947, 156, 353, 490, 962, 679, 560, 59, 387, 31, 692, 976, 568, 201, 273, 159, 730, 819, 418, 906, 801, 892, 672, 559, 866, 389, 675, 812, 744, 164, 737, 57, 195, 115, 933, 158, 909, 598, 359, 853, 314, 983, 11, 395, 153, 781, 301, 838, 625, 704, 256, 351, 996, 225, 644, 521, 509, 674, 417, 272, 622, 937, 723, 632, 331, 228, 412, 181, 435, 469, 157, 368, 524, 38, 132, 325, 420, 127, 731, 771, 604, 505, 634, 67, 374, 894, 3, 448, 878, 686, 641, 316, 207, 76, 363, 795, 235, 770, 446, 820, 493, 177, 816, 615, 410, 117, 944, 829, 190, 831, 289, 516, 964, 170, 134, 671, 885, 682, 119, 402, 82, 485, 901, 375, 68, 858, 739, 56, 974, 683, 884, 815, 872, 715, 104, 290, 348, 588, 834, 788, 472, 466, 867, 550, 779, 65, 802, 459, 440, 870, 753, 608, 808, 623, 642, 44, 437, 865, 758, 540, 506, 691, 958, 854, 546, 39, 595, 369, 504, 63, 311, 722, 441, 786, 899, 338, 651, 874, 946, 811, 848, 939, 284, 824, 309, 653, 133, 514, 460, 678, 54, 399, 759, 468, 61, 480, 783, 266, 900, 400, 237, 403, 534, 213, 914, 473, 198, 380, 373, 288, 154, 844, 535, 409, 249, 285, 168, 69, 345, 647, 851, 846, 264, 102, 246, 106, 648, 576, 212, 438, 981, 987, 379, 360, 667, 95, 172, 101, 580, 891, 385, 747, 161, 927, 361, 818, 657, 171, 342, 232, 734, 714, 362, 425, 475, 28, 41, 551, 142, 131, 51, 229, 9, 607, 326, 522, 687, 792, 845, 665, 358, 91, 720, 155, 565, 99, 26, 650, 539, 780, 589, 950, 935, 372, 227, 424, 750, 833, 554, 841, 552, 60, 757, 430, 916, 140, 790, 426, 776, 96, 199, 923, 806, 949, 755, 711, 659, 911, 611, 310, 774, 265, 880, 690, 706, 761, 286, 255, 756, 204, 444, 478, 601, 529, 669, 241, 784, 566, 528, 208, 270, 511, 236, 271, 378, 58, 453, 467, 233, 250, 567, 296, 932, 989, 367, 626, 35, 162, 887, 572, 603, 564, 797, 280, 406, 970, 689, 408, 431, 638, 489, 85, 50, 357, 803, 47, 555, 793, 422, 763, 110, 869, 861, 253, 320, 538, 347, 405, 769, 64, 875, 630, 537, 328, 553, 166, 948, 303, 160, 800, 507, 920, 922, 90, 693, 636, 17, 455, 183, 210, 856, 762, 656, 174, 873, 579, 176, 688, 640, 1, 938, 902, 341, 740, 581, 427, 111, 972, 443, 22, 791, 304, 574, 575, 725, 477, 700, 817, 381, 479, 248, 121, 411, 547, 182, 871, 599, 203, 13, 224, 541, 724, 178, 775, 388, 4, 251, 321, 52, 88, 100, 279, 614, 839, 84, 151, 735, 40, 752, 773, 376, 77, 476, 708, 396, 988, 961, 24, 231, 445, 609, 952, 965, 986, 414, 451, 881, 42, 257, 32, 334, 130, 596, 527, 94, 333, 317, 244, 960, 710, 852, 862, 421, 81, 37, 452, 274, 187, 268, 520, 491, 778, 18, 743, 620, 145, 72, 370, 118, 748, 633, 997, 436, 143, 573, 495, 180, 34}, + []int{1, 13, 26, 52, 104, 208, 416, 832}, + }, + + // 可以有多个 testcase +} + +func Test_largestDivisibleSubset(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largestDivisibleSubset(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_largestDivisibleSubset(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestDivisibleSubset(tc.nums) + } + } +} diff --git a/Algorithms/0371.sum-of-two-integers/README.md b/Algorithms/0371.sum-of-two-integers/README.md new file mode 100755 index 000000000..3aa20550b --- /dev/null +++ b/Algorithms/0371.sum-of-two-integers/README.md @@ -0,0 +1,14 @@ +# [371. Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) + +## 题目 + +Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. + +Example: +Given a = 1 and b = 2, return 3. + +Credits:Special thanks to @fujiaozhu for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0371.sum-of-two-integers/sum-of-two-integers.go b/Algorithms/0371.sum-of-two-integers/sum-of-two-integers.go new file mode 100755 index 000000000..15f238189 --- /dev/null +++ b/Algorithms/0371.sum-of-two-integers/sum-of-two-integers.go @@ -0,0 +1,8 @@ +package problem0371 + +func getSum(a int, b int) int { + for a != 0 { + a, b = (a&b)<<1, a^b + } + return b +} diff --git a/Algorithms/0371.sum-of-two-integers/sum-of-two-integers_test.go b/Algorithms/0371.sum-of-two-integers/sum-of-two-integers_test.go new file mode 100755 index 000000000..e24e926cc --- /dev/null +++ b/Algorithms/0371.sum-of-two-integers/sum-of-two-integers_test.go @@ -0,0 +1,41 @@ +package problem0371 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a int + b int + ans int +}{ + + {0, 2, 2}, + + {1, 0, 1}, + + {1, 2, 3}, + + // 可以有多个 testcase +} + +func Test_getSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, getSum(tc.a, tc.b), "输入:%v", tc) + } +} + +func Benchmark_getSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + getSum(tc.a, tc.b) + } + } +} diff --git a/Algorithms/0372.super-pow/README.md b/Algorithms/0372.super-pow/README.md new file mode 100755 index 000000000..81f485a25 --- /dev/null +++ b/Algorithms/0372.super-pow/README.md @@ -0,0 +1,25 @@ +# [372. Super Pow](https://leetcode.com/problems/super-pow/) + +## 题目 + +Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. + +```text +Example1: +a = 2 +b = [3] + +Result: 8 + +Example2: +a = 2 +b = [1,0] + +Result: 1024 +``` + +Credits:Special thanks to @Stomach_ache for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0372.super-pow/super-pow.go b/Algorithms/0372.super-pow/super-pow.go new file mode 100755 index 000000000..ff484b1cd --- /dev/null +++ b/Algorithms/0372.super-pow/super-pow.go @@ -0,0 +1,27 @@ +package problem0372 + +// (a*b) % k = ((a%k)*(b%k)) % k +func superPow(a int, b []int) int { + base := 1337 + + // return a^k mod base + powmod := func(a, k int) int { + a %= base + res := 1 + + for i := 0; i < k; i++ { + res = (res * a) % base + } + return res + } + + n := len(b) + if n == 0 { + return 1 + } + + lastB := b[n-1] + newB := b[:n-1] + + return (powmod(superPow(a, newB), 10) * powmod(a, lastB)) % base +} diff --git a/Algorithms/0372.super-pow/super-pow_test.go b/Algorithms/0372.super-pow/super-pow_test.go new file mode 100755 index 000000000..206c3db53 --- /dev/null +++ b/Algorithms/0372.super-pow/super-pow_test.go @@ -0,0 +1,53 @@ +package problem0372 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a int + b []int + ans int +}{ + + { + 2, + []int{3, 4, 5}, + 694, + }, + + { + 2, + []int{3}, + 8, + }, + + { + 2, + []int{1, 0}, + 1024, + }, + + // 可以有多个 testcase +} + +func Test_superPow(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, superPow(tc.a, tc.b), "输入:%v", tc) + } +} + +func Benchmark_superPow(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + superPow(tc.a, tc.b) + } + } +} diff --git a/Algorithms/0373.find-k-pairs-with-smallest-sums/README.md b/Algorithms/0373.find-k-pairs-with-smallest-sums/README.md new file mode 100755 index 000000000..a508ea947 --- /dev/null +++ b/Algorithms/0373.find-k-pairs-with-smallest-sums/README.md @@ -0,0 +1,41 @@ +# [373. Find K Pairs with Smallest Sums](https://leetcode.com/problems/find-k-pairs-with-smallest-sums/) + +## 题目 + +You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. + +Define a pair (u,v) which consists of one element from the first array and one element from the second array. + +Find the k pairs (u1,v1),(u2,v2) ...(uk,vk) with the smallest sums. + +```text +Example 1: +Given nums1 = [1,7,11], nums2 = [2,4,6], k = 3 + +Return: [1,2],[1,4],[1,6] + +The first 3 pairs are returned from the sequence: +[1,2],[1,4],[1,6],[7,2],[7,4],[11,2],[7,6],[11,4],[11,6] + +Example 2: +Given nums1 = [1,1,2], nums2 = [1,2,3], k = 2 + +Return: [1,1],[1,1] + +The first 2 pairs are returned from the sequence: +[1,1],[1,1],[1,2],[2,1],[1,2],[2,2],[1,3],[1,3],[2,3] + +Example 3: +Given nums1 = [1,2], nums2 = [3], k = 3 + +Return: [1,3],[2,3] + +All possible pairs are returned from the sequence: +[1,3],[2,3] +``` + +Credits:Special thanks to @elmirap and @StefanPochmann for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums.go b/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums.go new file mode 100755 index 000000000..c1b2cffd2 --- /dev/null +++ b/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums.go @@ -0,0 +1,79 @@ +package problem0373 + +import "container/heap" + +type pair struct { + i int + j int + sum int +} + +type priorityQueue []*pair + +func (pq priorityQueue) Len() int { return len(pq) } + +func (pq priorityQueue) Less(i, j int) bool { + return pq[i].sum < pq[j].sum +} + +func (pq priorityQueue) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +func (pq *priorityQueue) Push(x interface{}) { + p := x.(*pair) + *pq = append(*pq, p) +} + +func (pq *priorityQueue) Pop() interface{} { + old := *pq + n := len(old) + p := old[n-1] + *pq = old[0 : n-1] + return p +} + +func kSmallestPairs(a, b []int, k int) [][]int { + var res [][]int + if len(a) == 0 || len(b) == 0 { + return res + } + + // 可以想象一下,存在一个 len(a) * len(b) 的矩阵 mat + // mat[i][j] == a[i]+b[j] + // res 就是 mat 中前 k 项值的坐标对 + // 由题意可知,a,b 递增,那么 mat 中的每一行和每一列也是递增的。 + + pqLen := min(k, len(a)) + // 先把 mat[:][0] 的值放入 pq + pq := make(priorityQueue, pqLen) + for l := 0; l < k && l < len(a); l++ { + pq[l] = &pair{i: l, j: 0, sum: a[l] + b[0]} + } + // 初始化 pq + heap.Init(&pq) + + var min *pair + + for ; k > 0 && len(pq) > 0; k-- { + // 获取 heap 中 sum 值最小的 pair + min = heap.Pop(&pq).(*pair) + // 加入到 res + res = append(res, []int{a[min.i], b[min.j]}) + // mat[i][j] 被 pop 出去了,就把 mat[i][j+1] push 到 pq + // 保证 mat 中每一行都有一个最小的在 pq 中, + // 就可以保证 pq 中的 min 就是下一个 sum值最小的元素 + if min.j+1 < len(b) { + heap.Push(&pq, &pair{i: min.i, j: min.j + 1, sum: a[min.i] + b[min.j+1]}) + } + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums_test.go b/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums_test.go new file mode 100755 index 000000000..ae4b02461 --- /dev/null +++ b/Algorithms/0373.find-k-pairs-with-smallest-sums/find-k-pairs-with-smallest-sums_test.go @@ -0,0 +1,85 @@ +package problem0373 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums1 []int + nums2 []int + k int + ans [][]int +}{ + + { + []int{1, 7, 11}, + []int{}, + 3, + nil, + }, + + { + []int{1, 7, 11}, + []int{2, 4, 6}, + 3, + [][]int{ + []int{1, 2}, + []int{1, 4}, + []int{1, 6}, + }, + }, + + { + []int{1, 1, 2}, + []int{1, 2, 3}, + 2, + [][]int{ + []int{1, 1}, + []int{1, 1}, + }, + }, + + { + []int{3}, + []int{1, 2}, + 3, + [][]int{ + []int{3, 1}, + []int{3, 2}, + }, + }, + + { + []int{1, 2, 3, 4}, + []int{2, 6, 8}, + 3, + [][]int{ + []int{1, 2}, + []int{2, 2}, + []int{3, 2}, + }, + }, + + // 可以有多个 testcase +} + +func Test_kSmallestPairs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kSmallestPairs(tc.nums1, tc.nums2, tc.k), "输入:%v", tc) + } +} + +func Benchmark_kSmallestPairs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kSmallestPairs(tc.nums1, tc.nums2, tc.k) + } + } +} diff --git a/Algorithms/0375.guess-number-higher-or-lower-ii/README.md b/Algorithms/0375.guess-number-higher-or-lower-ii/README.md new file mode 100755 index 000000000..05ef0a2de --- /dev/null +++ b/Algorithms/0375.guess-number-higher-or-lower-ii/README.md @@ -0,0 +1,33 @@ +# [375. Guess Number Higher or Lower II](https://leetcode.com/problems/guess-number-higher-or-lower-ii/) + +## 题目 + +We are playing the Guess Game. The game is as follows: + +I pick a number from 1 to n. You have to guess which number I picked. + +Every time you guess wrong, I'll tell you whether the number I picked is higher or lower. + +However, when you guess a particular number x, and you guess wrong, you pay $x. You win the game when you guess the number I picked. + +Example: + +```text +n = 10, I pick 8. + +First round : You guess 5, I tell you that it's higher. You pay $5. +Second round: You guess 7, I tell you that it's higher. You pay $7. +Third round : You guess 9, I tell you that it's lower. You pay $9. + +Game over. 8 is the number I picked. + +You end up paying $5 + $7 + $9 = $21. + +Given a particular n ≥ 1, find out how much money you need to have to guarantee a win. +``` + +Credits:Special thanks to @agave and @StefanPochmann for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii.go b/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii.go new file mode 100755 index 000000000..ca68ccb96 --- /dev/null +++ b/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii.go @@ -0,0 +1,39 @@ +package problem0375 + +func getMoneyAmount(n int) int { + // dp[i][j] 保证能猜出 i<=x<=j 中 x 的具体值的最小金额 + // dp[1][n] 是答案 + dp := make([][]int, n+1) + for i := range dp { + dp[i] = make([]int, n+1) + } + + for j := 2; j <= n; j++ { + for i := j - 1; 0 < i; i-- { + // 为了确保可以猜出 i<=x<=j 中的 x + // 第一次,我们可以猜 x 为,i,i+1,...,j-1 + // 所有这些可能性中的最小值就是 dp[i][j] 的值 + dp[i][j] = i + dp[i+1][j] + for k := i + 1; k < j; k++ { + // k+max(dp[i][k-1], dp[k+1][j])) 猜 x 为 k 所花费的最小费用 + dp[i][j] = min(dp[i][j], k+max(dp[i][k-1], dp[k+1][j])) + } + } + } + + return dp[1][n] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii_test.go b/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii_test.go new file mode 100755 index 000000000..06312211d --- /dev/null +++ b/Algorithms/0375.guess-number-higher-or-lower-ii/guess-number-higher-or-lower-ii_test.go @@ -0,0 +1,50 @@ +package problem0375 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {12, 21}, + {5, 6}, + {1, 0}, + {2, 1}, + {3, 2}, + {5, 6}, + {6, 8}, + {7, 10}, + {8, 12}, + {9, 14}, + {10, 16}, + {12, 21}, + {20, 49}, + {100, 400}, + {300, 1640}, + + // 可以有多个 testcase +} + +func Test_getMoneyAmount(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, getMoneyAmount(tc.n), "输入:%v", tc) + } +} + +func Benchmark_getMoneyAmount(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + getMoneyAmount(tc.n) + } + } +} diff --git a/Algorithms/0376.wiggle-subsequence/README.md b/Algorithms/0376.wiggle-subsequence/README.md new file mode 100755 index 000000000..0d39675ea --- /dev/null +++ b/Algorithms/0376.wiggle-subsequence/README.md @@ -0,0 +1,33 @@ +# [376. Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) + +## 题目 + +A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wiggle sequence. + +For example, [1,7,4,9,2,5] is a wiggle sequence because the differences (6,-3,5,-7,3) are alternately positive and negative. In contrast, [1,4,7,2,5] and [1,7,4,5,5] are not wiggle sequences, the first because its first two differences are positive and the second because its last difference is zero. + +Given a sequence of integers, return the length of the longest subsequence that is a wiggle sequence. A subsequence is obtained by deleting some number of elements (eventually, also zero) from the original sequence, leaving the remaining elements in their original order. + +Examples: + +```text +Input: [1,7,4,9,2,5] +Output: 6 +The entire sequence is a wiggle sequence. + +Input: [1,17,5,10,13,15,10,5,16,8] +Output: 7 +There are several subsequences that achieve this length. One is [1,17,10,13,10,16,8]. + +Input: [1,2,3,4,5,6,7,8,9] +Output: 2 +``` + +Follow up: +Can you do it in O(n) time? + +Credits:Special thanks to @agave and @StefanPochmann for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0376.wiggle-subsequence/wiggle-subsequence.go b/Algorithms/0376.wiggle-subsequence/wiggle-subsequence.go new file mode 100755 index 000000000..d69a6dc57 --- /dev/null +++ b/Algorithms/0376.wiggle-subsequence/wiggle-subsequence.go @@ -0,0 +1,54 @@ +package problem0376 + +func wiggleMaxLength(nums []int) int { + var res int + size := len(nums) + + checkFunc := func(n int) func(int) { + init := 1 + if n < 0 { + init = -1 + } + res = 2 + + // 当 x 与 init 不同号的时候 + // res++ + return func(x int) { + var new int + + switch { + case x < 0: + new = -1 + case x > 0: + new = 1 + default: + // 跳过 0 + return + } + + if init*new < 0 { + res++ + init = new + } + } + } + + var check func(int) + var i = 1 + for i < size && nums[i]-nums[i-1] == 0 { + i++ + } + + if i == size { + return 1 + } + + check = checkFunc(nums[i] - nums[i-1]) + + for i < size { + check(nums[i] - nums[i-1]) + i++ + } + + return res +} diff --git a/Algorithms/0376.wiggle-subsequence/wiggle-subsequence_test.go b/Algorithms/0376.wiggle-subsequence/wiggle-subsequence_test.go new file mode 100755 index 000000000..b88438c2e --- /dev/null +++ b/Algorithms/0376.wiggle-subsequence/wiggle-subsequence_test.go @@ -0,0 +1,73 @@ +package problem0376 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + { + []int{1}, + 1, + }, + + { + []int{1, 2}, + 2, + }, + + { + []int{1, 7, 4, 9, 2, 5}, + 6, + }, + + { + []int{1, 1, 1, 1}, + 1, + }, + + { + []int{1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2}, + 2, + }, + + { + []int{7, 4, 9, 2, 5}, + 5, + }, + + { + []int{1, 17, 5, 10, 13, 15, 10, 5, 16, 8}, + 7, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_wiggleMaxLength(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, wiggleMaxLength(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_wiggleMaxLength(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wiggleMaxLength(tc.nums) + } + } +} diff --git a/Algorithms/0377.combination-sum-iv/README.md b/Algorithms/0377.combination-sum-iv/README.md new file mode 100755 index 000000000..973eff441 --- /dev/null +++ b/Algorithms/0377.combination-sum-iv/README.md @@ -0,0 +1,37 @@ +# [377. Combination Sum IV](https://leetcode.com/problems/combination-sum-iv/) + +## 题目 + +Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. + +Example: + +```text +nums = [1, 2, 3] +target = 4 + +The possible combination ways are: +(1, 1, 1, 1) +(1, 1, 2) +(1, 2, 1) +(1, 3) +(2, 1, 1) +(2, 2) +(3, 1) + +Note that different sequences are counted as different combinations. + +Therefore the output is 7. +``` + +Follow up: + +- What if negative numbers are allowed in the given array? +- How does it change the problem? +- What limitation we need to add to the question to allow negative numbers? + +Credits:Special thanks to @pbrother for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0377.combination-sum-iv/combination-sum-iv.go b/Algorithms/0377.combination-sum-iv/combination-sum-iv.go new file mode 100755 index 000000000..359e2bee2 --- /dev/null +++ b/Algorithms/0377.combination-sum-iv/combination-sum-iv.go @@ -0,0 +1,18 @@ +package problem0377 + +func combinationSum4(nums []int, target int) int { + // dp[i] 是 i 能用 nums 中的数所组合的种类数 + // dp[target] 是答案 + dp := make([]int, target+1) + dp[0] = 1 + + for i := 1; i <= target; i++ { + for j := range nums { + if nums[j] <= i { + dp[i] += dp[i-nums[j]] + } + } + } + + return dp[target] +} diff --git a/Algorithms/0377.combination-sum-iv/combination-sum-iv_test.go b/Algorithms/0377.combination-sum-iv/combination-sum-iv_test.go new file mode 100755 index 000000000..4374525c6 --- /dev/null +++ b/Algorithms/0377.combination-sum-iv/combination-sum-iv_test.go @@ -0,0 +1,41 @@ +package problem0377 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + target int + ans int +}{ + + { + []int{1, 2, 3}, + 4, + 7, + }, + + // 可以有多个 testcase +} + +func Test_combinationSum4(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, combinationSum4(tc.nums, tc.target), "输入:%v", tc) + } +} + +func Benchmark_combinationSum4(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + combinationSum4(tc.nums, tc.target) + } + } +} diff --git a/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/README.md b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/README.md new file mode 100755 index 000000000..5a38803dd --- /dev/null +++ b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/README.md @@ -0,0 +1,26 @@ +# [378. Kth Smallest Element in a Sorted Matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/) + +## 题目 + +Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. + +Note that it is the kth smallest element in the sorted order, not the kth distinct element. + +```text +Example: +matrix = [ + [ 1, 5, 9], + [10, 11, 13], + [12, 13, 15] +], +k = 8, + +return 13. +``` + +Note: +You may assume k is always valid, 1 ≤ k ≤ n2. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.go b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.go new file mode 100755 index 000000000..58afe028a --- /dev/null +++ b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.go @@ -0,0 +1,30 @@ +package problem0378 + +func kthSmallest(mat [][]int, k int) int { + // 题目中说了 1 <= n + n := len(mat) + + lo, hi := mat[0][0], mat[n-1][n-1] + + for lo < hi { + mid := lo + (hi-lo)>>1 + count := 0 + j := n - 1 + for i := 0; i < n; i++ { + for j >= 0 && mat[i][j] > mid { + j-- + } + count += j + 1 + } + + // 移动 lo 或 hi + if count < k { + lo = mid + 1 + } else { + // 没有 -1 + hi = mid + } + } + + return lo +} diff --git a/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix_test.go b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix_test.go new file mode 100755 index 000000000..a0ddaad07 --- /dev/null +++ b/Algorithms/0378.kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix_test.go @@ -0,0 +1,44 @@ +package problem0378 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var mat = [][]int{ + []int{1, 5, 9}, + []int{10, 11, 13}, + []int{12, 13, 15}, +} + +// tcs is testcase slice +var tcs = []struct { + k int + ans int +}{ + + {3, 9}, + + {8, 13}, + + // 可以有多个 testcase +} + +func Test_kthSmallest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kthSmallest(mat, tc.k), "输入:%v", tc) + } +} + +func Benchmark_kthSmallest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kthSmallest(mat, tc.k) + } + } +} diff --git a/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1.go b/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1.go index 7ba7faa98..ae0069941 100755 --- a/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1.go +++ b/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1.go @@ -1,4 +1,4 @@ -package Problem0380 +package problem0380 import "math/rand" diff --git a/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1_test.go b/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1_test.go index 2374590e0..8a4935048 100755 --- a/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1_test.go +++ b/Algorithms/0380.insert-delete-getrandom-o1/insert-delete-getrandom-o1_test.go @@ -1,4 +1,4 @@ -package Problem0380 +package problem0380 import ( "testing" diff --git a/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.go b/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.go index 2ad67f5e3..8e3a9669f 100755 --- a/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.go +++ b/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.go @@ -1,4 +1,4 @@ -package Problem0381 +package problem0381 import ( "math/rand" diff --git a/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed_test.go b/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed_test.go index d97299b03..0de003ec0 100755 --- a/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed_test.go +++ b/Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed_test.go @@ -1,4 +1,4 @@ -package Problem0381 +package problem0381 import ( "fmt" diff --git a/Algorithms/0382.linked-list-random-node/382.100.png b/Algorithms/0382.linked-list-random-node/382.100.png new file mode 100644 index 000000000..bb00da64d Binary files /dev/null and b/Algorithms/0382.linked-list-random-node/382.100.png differ diff --git a/Algorithms/0382.linked-list-random-node/README.md b/Algorithms/0382.linked-list-random-node/README.md new file mode 100755 index 000000000..e066827c6 --- /dev/null +++ b/Algorithms/0382.linked-list-random-node/README.md @@ -0,0 +1,31 @@ +# [382. Linked List Random Node](https://leetcode.com/problems/linked-list-random-node/) + +## 题目 + +Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. + +Follow up: + +1. What if the linked list is extremely large and its length is unknown to you? +1. Could you solve this efficiently without using extra space? + +Example: + +```text +// Init a singly linked list [1,2,3]. +ListNode head = new ListNode(1); +head.next = new ListNode(2); +head.next.next = new ListNode(3); +Solution solution = new Solution(head); + +// getRandom() should return either 1, 2, or 3 randomly. Each element should have equal probability of returning. +solution.getRandom(); +``` + +## 解题思路 + +见程序注释 + +运气好 + +![100](382.100.png) \ No newline at end of file diff --git a/Algorithms/0382.linked-list-random-node/linked-list-random-node.go b/Algorithms/0382.linked-list-random-node/linked-list-random-node.go new file mode 100755 index 000000000..52974004d --- /dev/null +++ b/Algorithms/0382.linked-list-random-node/linked-list-random-node.go @@ -0,0 +1,52 @@ +package problem0382 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "math/rand" +) + +type ListNode = kit.ListNode + +// Solution 是需要设计的数据结构 +// Definition for singly-linked list. +// type ListNode struct { +// Val int +// Next *ListNode +// } +type Solution struct { + head *ListNode + n int +} + +// Constructor 构建 Solution +// head is The linked list's head. +// Note that the head is guaranteed to be not null, so it contains at least one node. */ +func Constructor(head *ListNode) Solution { + count := 1 + temp := head + for temp.Next != nil { + count++ + temp = temp.Next + } + return Solution{ + head: head, + n: count, + } +} + +// GetRandom returns a random node's value. */ +func (s *Solution) GetRandom() int { + count := rand.Intn(s.n) + temp := s.head + for count > 0 { + temp = temp.Next + count-- + } + return temp.Val +} + +/** + * Your Solution object will be instantiated and called as such: + * obj := Constructor(head); + * param_1 := obj.GetRandom(); + */ diff --git a/Algorithms/0382.linked-list-random-node/linked-list-random-node_test.go b/Algorithms/0382.linked-list-random-node/linked-list-random-node_test.go new file mode 100755 index 000000000..07eeedd12 --- /dev/null +++ b/Algorithms/0382.linked-list-random-node/linked-list-random-node_test.go @@ -0,0 +1,21 @@ +package problem0382 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + ints := []int{1, 2, 3, 4, 5, 6} + head := kit.Ints2List(ints) + sol := Constructor(head) + + for i := 0; i < 200; i++ { + ast.Contains(ints, sol.GetRandom(), "从 %v 中随机获取一个数", ints) + } +} diff --git a/Algorithms/0383.ransom-note/README.md b/Algorithms/0383.ransom-note/README.md new file mode 100755 index 000000000..12af4bcb9 --- /dev/null +++ b/Algorithms/0383.ransom-note/README.md @@ -0,0 +1,20 @@ +# [383. Ransom Note](https://leetcode.com/problems/ransom-note/) + +## 题目 + +Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false. + +Each letter in the magazine string can only be used once in your ransom note. + +Note: +You may assume that both strings contain only lowercase letters. + +```text +canConstruct("a", "b") -> false +canConstruct("aa", "ab") -> false +canConstruct("aa", "aab") -> true +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0383.ransom-note/ransom-note.go b/Algorithms/0383.ransom-note/ransom-note.go new file mode 100755 index 000000000..5ec3e9222 --- /dev/null +++ b/Algorithms/0383.ransom-note/ransom-note.go @@ -0,0 +1,22 @@ +package problem0383 + +func canConstruct(ransomNote string, magazine string) bool { + mc := getCount(magazine) + + for _, b := range ransomNote { + mc[b-'a']-- + if mc[b-'a'] < 0 { + return false + } + } + + return true +} + +func getCount(s string) []int { + res := make([]int, 26) + for i := range s { + res[s[i]-'a']++ + } + return res +} diff --git a/Algorithms/0383.ransom-note/ransom-note_test.go b/Algorithms/0383.ransom-note/ransom-note_test.go new file mode 100755 index 000000000..19b24da4e --- /dev/null +++ b/Algorithms/0383.ransom-note/ransom-note_test.go @@ -0,0 +1,39 @@ +package problem0383 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ransomNote string + magazine string + ans bool +}{ + + {"a", "b", false}, + {"aa", "ab", false}, + {"aa", "aab", true}, + + // 可以有多个 testcase +} + +func Test_canConstruct(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canConstruct(tc.ransomNote, tc.magazine), "输入:%v", tc) + } +} + +func Benchmark_canConstruct(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canConstruct(tc.ransomNote, tc.magazine) + } + } +} diff --git a/Algorithms/0384.shuffle-an-array/384.100.png b/Algorithms/0384.shuffle-an-array/384.100.png new file mode 100644 index 000000000..8554b6098 Binary files /dev/null and b/Algorithms/0384.shuffle-an-array/384.100.png differ diff --git a/Algorithms/0384.shuffle-an-array/README.md b/Algorithms/0384.shuffle-an-array/README.md new file mode 100755 index 000000000..7c95666ef --- /dev/null +++ b/Algorithms/0384.shuffle-an-array/README.md @@ -0,0 +1,28 @@ +# [384. Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) + +## 题目 + +Shuffle a set of numbers without duplicates. + +Example: + +```text +// Init an array with set 1, 2, and 3. +int[] nums = {1,2,3}; +Solution solution = new Solution(nums); + +// Shuffle the array [1,2,3] and return its result. Any permutation of [1,2,3] must equally likely to be returned. +solution.shuffle(); + +// Resets the array back to its original configuration [1,2,3]. +solution.reset(); + +// Returns the random shuffling of array [1,2,3]. +solution.shuffle(); +``` + +## 解题思路 + +见程序注释 + +![100](384.100.png) \ No newline at end of file diff --git a/Algorithms/0384.shuffle-an-array/shuffle-an-array.go b/Algorithms/0384.shuffle-an-array/shuffle-an-array.go new file mode 100755 index 000000000..a4a2fefe4 --- /dev/null +++ b/Algorithms/0384.shuffle-an-array/shuffle-an-array.go @@ -0,0 +1,43 @@ +package problem0384 + +import ( + "math/rand" +) + +// Solution 是答案 +type Solution struct { + origNums, nums []int +} + +// Constructor 构建 Solution +func Constructor(nums []int) Solution { + o := make([]int, len(nums)) + n := make([]int, len(nums)) + copy(o, nums) + copy(n, nums) + return Solution{origNums: o, nums: n} +} + +// Reset the array to its original configuration and return it. +func (s Solution) Reset() []int { + return s.origNums +} + +// Shuffle returns a random shuffling of the array. +func (s Solution) Shuffle() []int { + i, j := len(s.nums), 0 + for 1 < i { + j = rand.Intn(i) + s.nums[i-1], s.nums[j] = s.nums[j], s.nums[i-1] + i-- + } + + return s.nums +} + +/** + * Your Solution object will be instantiated and called as such: + * obj := Constructor(nums); + * param_1 := obj.Reset(); + * param_2 := obj.Shuffle(); + */ diff --git a/Algorithms/0384.shuffle-an-array/shuffle-an-array_test.go b/Algorithms/0384.shuffle-an-array/shuffle-an-array_test.go new file mode 100755 index 000000000..7c872959d --- /dev/null +++ b/Algorithms/0384.shuffle-an-array/shuffle-an-array_test.go @@ -0,0 +1,24 @@ +package problem0384 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + original := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18} + + s := Constructor(original) + + ans := s.Shuffle() + sort.Ints(ans) + ast.Equal(original, ans) + + ans = s.Reset() + ast.Equal(original, ans) + +} diff --git a/Algorithms/0385.mini-parser/README.md b/Algorithms/0385.mini-parser/README.md new file mode 100755 index 000000000..f9e24741b --- /dev/null +++ b/Algorithms/0385.mini-parser/README.md @@ -0,0 +1,40 @@ +# [385. Mini Parser](https://leetcode.com/problems/mini-parser/) + +## 题目 + +Given a nested list of integers represented as a string, implement a parser to deserialize it. + +Each element is either an integer, or a list -- whose elements may also be integers or other lists. + +Note: +You may assume that the string is well-formed: + +- String is non-empty. +- String does not contain white spaces. +- String contains only digits `0-9`,`[`, `-`, `,`, `]`. + +Example 1: + +```text +Given s = "324", + +You should return a NestedInteger object which contains a single integer 324. +``` + +Example 2: + +```text +Given s = "[123,[456,[789]]]", + +Return a NestedInteger object containing a nested list with 2 elements: + +1. An integer containing value 123. +2. A nested list containing two elements: + i. An integer containing value 456. + ii. A nested list with one element: + a. An integer containing value 789. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0385.mini-parser/mini-parser.go b/Algorithms/0385.mini-parser/mini-parser.go new file mode 100755 index 000000000..eb89abfe3 --- /dev/null +++ b/Algorithms/0385.mini-parser/mini-parser.go @@ -0,0 +1,110 @@ +package problem0385 + +import ( + "strconv" + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/** + * // This is the interface that allows for creating nested lists. + * // You should not implement it, or speculate about its implementation + * type NestedInteger struct { + * } + * + * // Return true if this NestedInteger holds a single integer, rather than a nested list. + * func (n NestedInteger) IsInteger() bool {} + * + * // Return the single integer that this NestedInteger holds, if it holds a single integer + * // The result is undefined if this NestedInteger holds a nested list + * // So before calling this method, you should have a check + * func (n NestedInteger) GetInteger() int {} + * + * // Set this NestedInteger to hold a single integer. + * func (n *NestedInteger) SetInteger(value int) {} + * + * // Set this NestedInteger to hold a nested list and adds a nested integer to it. + * func (n *NestedInteger) Add(elem NestedInteger) {} + * + * // Return the nested list that this NestedInteger holds, if it holds a nested list + * // The list length is zero if this NestedInteger holds a single integer + * // You can access NestedInteger's List element directly if you want to modify it + * func (n NestedInteger) GetList() []*NestedInteger {} + */ + +type NestedInteger = kit.NestedInteger + +func deserialize(s string) *NestedInteger { + if len(s) == 0 { + return nil + } + + if s[0] != '[' { + return getValue(s) + } + + stack := new(stackChars) + + var cur *NestedInteger + + si, ci := 0, 0 + for ; ci < len(s); ci++ { + switch s[ci] { + case '[': + if cur != nil { + stack.Push(cur) + } + + cur = new(NestedInteger) + si = ci + 1 + case ']': + if ci > si { + cur.Add(*getValue(s[si:ci])) + } + + if !stack.Empty() { + tmp := stack.Pop() + tmp.Add(*cur) + cur = tmp + } + + si = ci + 1 + case ',': + if s[ci-1] != ']' { + cur.Add(*getValue(s[si:ci])) + } + si = ci + 1 + } + } + + return cur +} + +func getValue(s string) *NestedInteger { + val, _ := strconv.Atoi(s) + item := new(NestedInteger) + item.SetInteger(val) + return item +} + +type stackChars struct { + chars []*NestedInteger +} + +func (s *stackChars) Push(nb *NestedInteger) { + s.chars = append(s.chars, nb) +} + +func (s *stackChars) Pop() *NestedInteger { + slen := len(s.chars) + rb := s.chars[slen-1] + s.chars = s.chars[:slen-1] + return rb +} + +func (s *stackChars) Empty() bool { + return len(s.chars) == 0 +} + +// func (s *stackChars) Peek() *NestedInteger { +// return s.chars[len(s.chars)-1] +// } diff --git a/Algorithms/0385.mini-parser/mini-parser_test.go b/Algorithms/0385.mini-parser/mini-parser_test.go new file mode 100755 index 000000000..3a67c6259 --- /dev/null +++ b/Algorithms/0385.mini-parser/mini-parser_test.go @@ -0,0 +1,48 @@ +package problem0385 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans *NestedInteger +}{ + + {"", nil}, + + {"324", &NestedInteger{Num: 324}}, + + {"[123,[456,[789]]]", + &NestedInteger{ + Ns: []*NestedInteger{ + &NestedInteger{Num: 123}, + &NestedInteger{ + Ns: []*NestedInteger{ + &NestedInteger{Num: 456}, + &NestedInteger{ + Ns: []*NestedInteger{ + &NestedInteger{Num: 789}, + }, + }, + }, + }, + }, + }, + }, + + // 可以有多个 testcase +} + +func Test_deserialize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, deserialize(tc.s), "输入:%v", tc) + } +} diff --git a/Algorithms/0386.lexicographical-numbers/README.md b/Algorithms/0386.lexicographical-numbers/README.md new file mode 100755 index 000000000..e8a9886a9 --- /dev/null +++ b/Algorithms/0386.lexicographical-numbers/README.md @@ -0,0 +1,7 @@ +# [386. Lexicographical Numbers](https://leetcode.com/problems/lexicographical-numbers/) + +Given an integer n, return 1 - n in lexicographical order. + +For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. + +Please optimize your algorithm to use less time and space. The input size may be as large as 5,000,000. \ No newline at end of file diff --git a/Algorithms/0386.lexicographical-numbers/lexicographical-numbers.go b/Algorithms/0386.lexicographical-numbers/lexicographical-numbers.go new file mode 100755 index 000000000..185a51cb2 --- /dev/null +++ b/Algorithms/0386.lexicographical-numbers/lexicographical-numbers.go @@ -0,0 +1,20 @@ +package problem0386 + +func lexicalOrder(max int) []int { + res := make([]int, 0, max) + + var dfs func(int) + dfs = func(x int) { + limit := (x + 10) / 10 * 10 + for x <= max && x < limit { + res = append(res, x) + if x*10 <= max { + dfs(x * 10) + } + x++ + } + } + + dfs(1) + return res +} diff --git a/Algorithms/0386.lexicographical-numbers/lexicographical-numbers_test.go b/Algorithms/0386.lexicographical-numbers/lexicographical-numbers_test.go new file mode 100755 index 000000000..ba54ba7a0 --- /dev/null +++ b/Algorithms/0386.lexicographical-numbers/lexicographical-numbers_test.go @@ -0,0 +1,42 @@ +package problem0386 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + max int + ans []int +}{ + + { + 120, + []int{1, 10, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 11, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 12, 120, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 7, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 8, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 9, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99}, + }, + + { + 13, + []int{1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9}, + }, + + // 可以有多个 testcase +} + +func Test_lexicalOrder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, lexicalOrder(tc.max), "输入:%v", tc) + } +} + +func Benchmark_lexicalOrder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lexicalOrder(tc.max) + } + } +} diff --git a/Algorithms/0387.first-unique-character-in-a-string/README.md b/Algorithms/0387.first-unique-character-in-a-string/README.md new file mode 100755 index 000000000..7d72be019 --- /dev/null +++ b/Algorithms/0387.first-unique-character-in-a-string/README.md @@ -0,0 +1,21 @@ +# [387. First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/) + +## 题目 + +Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. + +Examples: + +```text +s = "leetcode" +return 0. + +s = "loveleetcode", +return 2. +``` + +Note: You may assume the string contain only lowercase letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string.go b/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string.go new file mode 100755 index 000000000..2b24346a4 --- /dev/null +++ b/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string.go @@ -0,0 +1,16 @@ +package problem0387 + +func firstUniqChar(s string) int { + rec := make([]int, 26) + for _, b := range s { + rec[b-'a']++ + } + + for i, b := range s { + if rec[b-'a'] == 1 { + return i + } + } + + return -1 +} diff --git a/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string_test.go b/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string_test.go new file mode 100755 index 000000000..397a02d33 --- /dev/null +++ b/Algorithms/0387.first-unique-character-in-a-string/first-unique-character-in-a-string_test.go @@ -0,0 +1,46 @@ +package problem0387 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "leetcode", + 0, + }, + + { + "loveleetcode", + 2, + }, + + {"aabbcc", -1}, + + // 可以有多个 testcase +} + +func Test_firstUniqChar(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, firstUniqChar(tc.s), "输入:%v", tc) + } +} + +func Benchmark_firstUniqChar(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + firstUniqChar(tc.s) + } + } +} diff --git a/Algorithms/0388.longest-absolute-file-path/README.md b/Algorithms/0388.longest-absolute-file-path/README.md new file mode 100755 index 000000000..ea67dda44 --- /dev/null +++ b/Algorithms/0388.longest-absolute-file-path/README.md @@ -0,0 +1,53 @@ +# [388. Longest Absolute File Path](https://leetcode.com/problems/longest-absolute-file-path/) + +## 题目 + +Suppose we abstract our file system by a string in the following manner: + +The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: + +```text +dir + subdir1 + subdir2 + file.ext +``` + +The directory dir contains an empty sub-directory subdir1 and a sub-directory subdir2 containing a file file.ext. + +The string "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext" represents: + +```text +dir + subdir1 + file1.ext + subsubdir1 + subdir2 + subsubdir2 + file2.ext +``` + +The directory dir contains two sub-directories subdir1 and subdir2. subdir1 contains a file file1.ext and an empty second-level sub-directory subsubdir1. subdir2 contains a second-level sub-directory subsubdir2 containing a file file2.ext. + +We are interested in finding the longest (number of characters) absolute path to a file within our file system. For example, in the second example above, the longest absolute path is "dir/subdir2/subsubdir2/file2.ext", and its length is 32 (not including the double quotes). + +Given a string representing the file system in the above format, return the length of the longest absolute path to file in the abstracted file system. If there is no file in the system, return 0. + +Note: + +- The name of a file contains at least a . and an extension. +- The name of a directory or sub-directory will not contain a .. + +Time complexity required: O(n) where n is the size of the input string. + +Notice that a/aa/aaa/file1.txt is not the longest file path, if there is another path aaaaaaaaaaaaaaaaaaaaa/sth.png. + +## 解题思路 + +见程序注释 + +请注意 + +```go +len("\n") == 1 +``` \ No newline at end of file diff --git a/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path.go b/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path.go new file mode 100755 index 000000000..92a7eb719 --- /dev/null +++ b/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path.go @@ -0,0 +1,70 @@ +package problem0388 + +import ( + "strings" +) + +func lengthLongestPath(path string) int { + if !hasFile(path) { + return 0 + } + + // 添加了 "\n" 这个字符,所以,最后的答案需要 -1 + return llp("\n"+path) - 1 +} + +func llp(path string) int { + if !hasFile(path) { + // 按照题意,最长的路径中,必须包含文件 + return 0 + } + + if !hasSub(path) { + // 没有子文件夹,又是一个文件 + return len(path) + } + + var i = nextCR(path, -1) + // path[:i] 是 父目录 + dirLen := i + + var j, maxSub int + for i < len(path) { + j = nextCR(path, i) + // path[i:j] 是 子目录 + // 替换缩进层级后,可以递归处理 + maxSub = max(maxSub, llp(strings.Replace(path[i+1:j], "\n\t", "\n", -1))) + i = j + } + + // +1 是路径分隔符 "/" 的长度 + return dirLen + 1 + maxSub +} + +func hasFile(path string) bool { + return strings.Contains(path, ".") +} + +// 有下级,返回 true +func hasSub(path string) bool { + return strings.Contains(path, "\n") +} + +func nextCR(path string, idx int) int { + var i int + for i = idx + 1; i < len(path); i++ { + if path[i:i+1] == "\n" && + (i+1 == len(path) || // 防止路径末尾存在换行的情况,比如 "a.txt\n" + path[i+1:i+2] != "\t") { + break + } + } + return i +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path_test.go b/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path_test.go new file mode 100755 index 000000000..f03371f98 --- /dev/null +++ b/Algorithms/0388.longest-absolute-file-path/longest-absolute-file-path_test.go @@ -0,0 +1,44 @@ +package problem0388 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + input string + ans int +}{ + + {"dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext", 20}, + + {"dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext\ndirasubdir2asubsubdir2aafile2.ext\n", 33}, + + {"a\n\tb.c\n\tddddddddddddddddddddddddd", 5}, + + {"dir\n\tsubdir1\n\tsubdir2", 0}, + + {"dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext", 32}, + + // 可以有多个 testcase +} + +func Test_lengthLongestPath(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, lengthLongestPath(tc.input), "输入:%v", tc) + } +} + +func Benchmark_lengthLongestPath(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lengthLongestPath(tc.input) + } + } +} diff --git a/Algorithms/0389.find-the-difference/README.md b/Algorithms/0389.find-the-difference/README.md new file mode 100755 index 000000000..82e1e9da0 --- /dev/null +++ b/Algorithms/0389.find-the-difference/README.md @@ -0,0 +1,26 @@ +# [389. Find the Difference](https://leetcode.com/problems/find-the-difference/) + +## 题目 + +Given two strings s and t which consist of only lowercase letters. + +String t is generated by random shuffling string s and then add one more letter at a random position. + +Find the letter that was added in t. + +```text +Example: +Input: +s = "abcd" +t = "abcde" + +Output: +e + +Explanation: +'e' is the letter that was added. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0389.find-the-difference/find-the-difference.go b/Algorithms/0389.find-the-difference/find-the-difference.go new file mode 100755 index 000000000..5cff592ef --- /dev/null +++ b/Algorithms/0389.find-the-difference/find-the-difference.go @@ -0,0 +1,19 @@ +package problem0389 + +func findTheDifference(s string, t string) byte { + rec := make([]int, 26) + for i := range s { + rec[s[i]-'a']-- + rec[t[i]-'a']++ + } + rec[t[len(t)-1]-'a']++ + + var i int + for i = 0; i < 26; i++ { + if rec[i] == 1 { + break + } + } + + return byte('a' + i) +} diff --git a/Algorithms/0389.find-the-difference/find-the-difference_test.go b/Algorithms/0389.find-the-difference/find-the-difference_test.go new file mode 100755 index 000000000..cf653981c --- /dev/null +++ b/Algorithms/0389.find-the-difference/find-the-difference_test.go @@ -0,0 +1,41 @@ +package problem0389 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + t string + ans byte +}{ + + { + "abcd", + "abcde", + 'e', + }, + + // 可以有多个 testcase +} + +func Test_findTheDifference(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findTheDifference(tc.s, tc.t), "输入:%v", tc) + } +} + +func Benchmark_findTheDifference(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findTheDifference(tc.s, tc.t) + } + } +} diff --git a/Algorithms/0390.elimination-game/README.md b/Algorithms/0390.elimination-game/README.md new file mode 100755 index 000000000..59b686b0a --- /dev/null +++ b/Algorithms/0390.elimination-game/README.md @@ -0,0 +1,29 @@ +# [390. Elimination Game](https://leetcode.com/problems/elimination-game/) + +## 题目 + +There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other number afterward until you reach the end of the list. + +Repeat the previous step again, but this time from right to left, remove the right most number and every other number from the remaining numbers. + +We keep repeating the steps again, alternating left to right and right to left, until a single number remains. + +Find the last number that remains starting with a list of length n. + +Example: + +```text +Input: +n = 9, +1 2 3 4 5 6 7 8 9 +2 4 6 8 +2 6 +6 + +Output: +6 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0390.elimination-game/elimination-game.go b/Algorithms/0390.elimination-game/elimination-game.go new file mode 100755 index 000000000..140bc8479 --- /dev/null +++ b/Algorithms/0390.elimination-game/elimination-game.go @@ -0,0 +1,25 @@ +package problem0390 + +func lastRemaining(n int) int { + isLeftStart := true + // remain 是剩余数字的个数 + remain := n + + // 剩余数字中,最小的数 + min := 1 + // min + step == 第二小的数字 + step := 1 + for remain > 1 { + if isLeftStart || remain%2 == 1 { + // 最小的数字被删除 + // 原先第二小的数字,变成了最小的啦 + min += step + } + + isLeftStart = !isLeftStart + step *= 2 + remain /= 2 + } + + return min +} diff --git a/Algorithms/0390.elimination-game/elimination-game_test.go b/Algorithms/0390.elimination-game/elimination-game_test.go new file mode 100755 index 000000000..73fe9ba8e --- /dev/null +++ b/Algorithms/0390.elimination-game/elimination-game_test.go @@ -0,0 +1,38 @@ +package problem0390 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {9, 6}, + + {123456789, 56614230}, + + // 可以有多个 testcase +} + +func Test_lastRemaining(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, lastRemaining(tc.n), "输入:%v", tc) + } +} + +func Benchmark_lastRemaining(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lastRemaining(tc.n) + } + } +} diff --git a/Algorithms/0391.perfect-rectangle/README.md b/Algorithms/0391.perfect-rectangle/README.md new file mode 100755 index 000000000..d3eabd096 --- /dev/null +++ b/Algorithms/0391.perfect-rectangle/README.md @@ -0,0 +1,63 @@ +# [391. Perfect Rectangle](https://leetcode.com/problems/perfect-rectangle/) + +## 题目 + +Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover of a rectangular region. + +Each rectangle is represented as a bottom-left point and a top-right point. For example, a unit square is represented as [1,1,2,2]. (coordinate of bottom-left point is (1, 1) and top-right point is (2, 2)). + +Example 1: + +```text +rectangles = [ + [1,1,3,3], + [3,1,4,2], + [3,2,4,4], + [1,3,2,4], + [2,3,3,4] +] +Return true. All 5 rectangles together form an exact cover of a rectangular region. +``` + +Example 2: + +```text +rectangles = [ + [1,1,2,3], + [1,3,2,4], + [3,1,4,2], + [3,2,4,4] +] + +Return false. Because there is a gap between the two rectangular regions. +``` + +Example 3: + +```text +rectangles = [ + [1,1,3,3], + [3,1,4,2], + [1,3,2,4], + [3,2,4,4] +] + +Return false. Because there is a gap in the top center. +``` + +Example 4: + +```text +rectangles = [ + [1,1,3,3], + [3,1,4,2], + [1,3,2,4], + [2,2,4,4] +] + +Return false. Because two of the rectangles overlap with each other. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0391.perfect-rectangle/perfect-rectangle.go b/Algorithms/0391.perfect-rectangle/perfect-rectangle.go new file mode 100755 index 000000000..088348257 --- /dev/null +++ b/Algorithms/0391.perfect-rectangle/perfect-rectangle.go @@ -0,0 +1,79 @@ +package problem0391 + +type point struct { + x, y int +} + +func isRectangleCover(rects [][]int) bool { + if len(rects) == 0 || len(rects[0]) == 0 { + return false + } + + // 记录最后合成的正方形的 四个顶点 的坐标 + minX, maxX := 1<<63-1, -1<<63 + minY, maxY := minX, maxX + // 最后合成正方形的面积 + area := 0 + + // 记录添加的正方形的 四个顶点 位置 + isCorner := make(map[point]bool) + + var p, p1, p2, p3, p4 point + var x, y, x1, x2, y1, y2 int + + for _, r := range rects { + x1, y1, x2, y2 = r[0], r[1], r[2], r[3] + + minX = min(x1, minX) + minY = min(y1, minY) + maxX = max(x2, maxX) + maxY = max(y2, maxY) + + area += (x2 - x1) * (y2 - y1) + + for _, x = range []int{x1, x2} { + for _, y = range []int{y1, y2} { + p = point{x, y} + + // 如果想要最后能够合成一个矩形 + // 除了大矩形的四个顶点外,其余的小矩形的四个顶点会出现两次 + if isCorner[p] { + delete(isCorner, p) + } else { + isCorner[p] = true + } + + } + } + + } + + p1 = point{minX, minY} + p2 = point{minX, maxY} + p3 = point{maxX, minY} + p4 = point{maxX, maxY} + + if !isCorner[p1] || + !isCorner[p2] || + !isCorner[p3] || + !isCorner[p4] || + len(isCorner) != 4 { + return false + } + + return area == (maxX-minX)*(maxY-minY) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0391.perfect-rectangle/perfect-rectangle_test.go b/Algorithms/0391.perfect-rectangle/perfect-rectangle_test.go new file mode 100755 index 000000000..89b45a3b4 --- /dev/null +++ b/Algorithms/0391.perfect-rectangle/perfect-rectangle_test.go @@ -0,0 +1,4067 @@ +package problem0391 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + rectangles [][]int + ans bool +}{ + + { + [][]int{ + []int{1, 1, 3, 3}, + []int{3, 1, 4, 2}, + []int{3, 2, 4, 4}, + []int{1, 3, 2, 4}, + []int{2, 3, 3, 4}, + }, + true, + }, + + { + [][]int{ + []int{-9573, 13095, -7899, 14471}, + []int{-12809, 12998, -12160, 14710}, + []int{4393, -19141, 4881, -18539}, + []int{13398, 17732, 14668, 20666}, + []int{-7786, -1346, -5208, -1090}, + []int{17684, 17536, 19299, 18654}, + []int{-12160, -718, -10867, 640}, + []int{-5354, -3895, -5208, -1346}, + []int{14100, -19878, 16099, -19142}, + []int{-7538, 11785, -5354, 12998}, + []int{13108, -14568, 14668, -11264}, + []int{19299, 17536, 19584, 19886}, + []int{6403, 2113, 7328, 3953}, + []int{-7538, -18539, -5208, -16655}, + []int{15348, 9733, 18000, 10728}, + []int{-9828, 4548, -9161, 4785}, + []int{-18464, -4715, -16393, -3649}, + []int{-17318, 8466, -16326, 10359}, + []int{-13424, 6233, -12748, 7825}, + []int{569, -2909, 3505, -1090}, + []int{-2015, -5235, -594, -3895}, + []int{-9161, -17630, -7786, -15085}, + []int{14100, -16734, 15348, -16501}, + []int{-16326, -5000, -14784, -3895}, + []int{13398, 13095, 15689, 15784}, + []int{3505, 4771, 4881, 6122}, + []int{-16326, 15308, -14835, 16478}, + []int{-10309, 11103, -9840, 12755}, + []int{19084, 9733, 19992, 10728}, + []int{-9890, 5618, -9803, 6634}, + []int{-2015, 8466, -494, 10212}, + []int{16099, -6552, 19084, -4197}, + []int{-12130, -17980, -10309, -16147}, + []int{13398, 1384, 15241, 3970}, + []int{-4918, -19515, -3933, -19431}, + []int{-18809, -14568, -17318, -11595}, + []int{-594, -8111, 518, -5235}, + []int{-5144, -13457, -3707, -9406}, + []int{5183, -14389, 5757, -13365}, + []int{518, -16655, 3621, -15085}, + []int{-19421, 8466, -17442, 10359}, + []int{1603, -6552, 1972, -4715}, + []int{15689, 2113, 19009, 3970}, + []int{-13921, 11137, -12809, 11785}, + []int{-19523, 3970, -18486, 5618}, + []int{-9803, 7721, -9573, 10359}, + []int{-5144, -9194, -4485, -6569}, + []int{-16900, 20150, -14992, 20990}, + []int{17021, 3970, 19159, 4771}, + []int{-5354, 13271, -4918, 15061}, + []int{15689, 7038, 15884, 7061}, + []int{15241, 2535, 15689, 4263}, + []int{9781, 4263, 11901, 5618}, + []int{15689, 11137, 17021, 14471}, + []int{13398, 214, 14120, 1118}, + []int{2714, -9404, 4881, -6714}, + []int{-11919, 17169, -10309, 19870}, + []int{-2139, -18767, -1445, -18539}, + []int{-17442, 17732, -16326, 19808}, + []int{1972, -4197, 4819, -3052}, + []int{-6999, -19431, -5144, -19142}, + []int{-18015, 4263, -16900, 5618}, + []int{300, 253, 3832, 803}, + []int{-19623, 16478, -18464, 18166}, + []int{4819, -6569, 5266, -5235}, + []int{4819, 18654, 5757, 20150}, + []int{-19421, -11138, -17318, -7636}, + []int{-17182, -8111, -15236, -6552}, + []int{15348, -13413, 18000, -11138}, + []int{-19527, -17791, -18795, -17630}, + []int{-19523, 6233, -18486, 7199}, + []int{-13095, -19709, -12748, -19431}, + []int{7468, 3283, 8139, 4771}, + []int{-1445, -18539, 1080, -17630}, + []int{7081, -18767, 7468, -18539}, + []int{-19800, -1346, -18809, -1044}, + []int{7328, -7020, 10246, -5000}, + []int{-2015, 4793, -145, 7038}, + []int{-3883, 10212, -2802, 11137}, + []int{19084, -4004, 19992, -2767}, + []int{-17318, 10865, -16326, 13095}, + []int{-14784, 16862, -13417, 19112}, + []int{-13095, 12140, -12809, 13595}, + []int{-2139, 18654, -494, 20990}, + []int{19009, 9585, 19084, 10400}, + []int{-5354, 10728, -4681, 12140}, + []int{-3883, 13095, -3707, 14710}, + []int{-9828, -4004, -7899, -1977}, + []int{-7899, -18801, -7538, -17791}, + []int{15884, -18539, 18000, -16734}, + []int{-13921, 8466, -13417, 9585}, + []int{-494, 9733, 569, 10359}, + []int{-5069, 1384, -3883, 1771}, + []int{8968, -5000, 11022, -3649}, + []int{9781, -14828, 11901, -13457}, + []int{-12160, -16147, -10193, -14389}, + []int{6728, 16423, 8935, 17536}, + []int{5266, 4164, 7328, 5618}, + []int{-1733, -13365, 518, -9654}, + []int{-14470, 10369, -12748, 10865}, + []int{-5208, -19878, -4485, -19515}, + []int{-12160, 10369, -11919, 11103}, + []int{-2796, -6714, -1696, -6552}, + []int{-13417, -13413, -12089, -11138}, + []int{2714, -1090, 4819, -390}, + []int{5757, -17980, 7029, -16734}, + []int{-14835, 16423, -14784, 18439}, + []int{-3065, -14279, -2015, -11264}, + []int{-19527, 2113, -18015, 3262}, + []int{15884, -16147, 19084, -14568}, + []int{-17318, 13095, -17180, 14710}, + []int{14213, 10728, 16099, 11137}, + []int{13398, 3970, 14804, 4771}, + []int{-3933, 12755, -2802, 12998}, + []int{-9840, -16655, -9161, -16113}, + []int{-3707, 7825, -2015, 9733}, + []int{-12951, 803, -11919, 1494}, + []int{-13095, 4785, -12809, 6233}, + []int{-18809, -19878, -18464, -19142}, + []int{-19800, 15784, -18795, 16478}, + []int{-17182, 1665, -16900, 2535}, + []int{19084, -14568, 19584, -11595}, + []int{-10921, -14279, -10193, -13365}, + []int{-11610, 3970, -10309, 4548}, + []int{-5069, -1977, -3758, 253}, + []int{-1733, 7038, 300, 7721}, + []int{-19523, -4715, -18464, -3649}, + []int{-9573, 15013, -5354, 16423}, + []int{-3933, -16113, -3065, -14704}, + []int{-5208, -3895, -4485, -1977}, + []int{-19523, -718, -17442, 253}, + []int{-9161, -1044, -5208, 529}, + []int{6403, -8859, 6801, -5468}, + []int{6403, 18439, 7468, 19870}, + []int{-11610, 19886, -9828, 20990}, + []int{-145, 10359, 1603, 12140}, + []int{-2015, 2535, -1445, 4164}, + []int{2714, 18166, 4819, 19870}, + []int{10246, 15683, 11012, 17732}, + []int{-10309, -5468, -9890, -4197}, + []int{-1781, 253, -1609, 1494}, + []int{-3883, -19539, -3217, -18801}, + []int{14668, 19886, 15348, 20666}, + []int{-13417, -4004, -12130, -2909}, + []int{14804, 19112, 16099, 19886}, + []int{7601, -13457, 8968, -11138}, + []int{13108, -11264, 14804, -8859}, + []int{-18015, -3052, -16326, -1090}, + []int{-14784, 13271, -13417, 14710}, + []int{-15236, -2909, -13424, -718}, + []int{4881, 1494, 5757, 1771}, + []int{-11610, 11137, -10309, 14471}, + []int{-9448, -18801, -9161, -17630}, + []int{11901, -19623, 13398, -19515}, + []int{-6145, 7199, -4681, 9729}, + []int{15884, 16862, 17684, 18166}, + []int{-16326, 8909, -14835, 9729}, + []int{-14535, -11595, -13417, -9654}, + []int{6403, 17536, 8139, 17732}, + []int{14213, -6569, 15241, -6552}, + []int{-15428, 13271, -15236, 15308}, + []int{5330, 14471, 7081, 15683}, + []int{2714, -5462, 4819, -4197}, + []int{-15861, -11730, -14535, -9654}, + []int{-14535, -654, -12951, 640}, + []int{14100, -16113, 14213, -14568}, + []int{14213, 4771, 16316, 5977}, + []int{-17442, 529, -14992, 1384}, + []int{-15236, 13271, -14835, 15061}, + []int{-14835, -13457, -13417, -11730}, + []int{-9573, -1346, -9161, -390}, + []int{4881, -9406, 5757, -6714}, + []int{-2802, 6634, -2015, 7825}, + []int{5183, -1977, 7328, 214}, + []int{18082, -18767, 19992, -16734}, + []int{7328, 214, 10303, 529}, + []int{-15428, -18801, -13921, -17679}, + []int{4393, 803, 5183, 1494}, + []int{-2015, -654, -1696, 214}, + []int{518, 9585, 569, 9733}, + []int{8139, 1494, 8968, 3858}, + []int{10303, 11785, 13108, 13595}, + []int{-1781, -16501, -594, -14568}, + []int{-3758, -9194, -3065, -6552}, + []int{-1445, -19878, 518, -19623}, + []int{4969, -16501, 6801, -14568}, + []int{-1781, -3895, -594, -2767}, + []int{-5208, -17630, -3758, -16501}, + []int{-10867, 253, -9840, 1384}, + []int{300, 13271, 3007, 15061}, + []int{14668, 7721, 15689, 9005}, + []int{5330, 12998, 7468, 13595}, + []int{5757, 11137, 7081, 12755}, + []int{11022, 7721, 13108, 9005}, + []int{10246, -7020, 10646, -5235}, + []int{-12951, 3283, -12130, 3953}, + []int{17684, -1346, 19992, 640}, + []int{6403, -9654, 7328, -8859}, + []int{1603, -1090, 2714, 214}, + []int{-9890, 10853, -9448, 11103}, + []int{15884, -4004, 16316, -3052}, + []int{8968, 10369, 10646, 11785}, + []int{518, -13365, 1603, -8859}, + []int{-2015, -19539, -145, -19141}, + []int{-13424, -4004, -13417, -2767}, + []int{12689, 4771, 13398, 6122}, + []int{11526, -13365, 12654, -11138}, + []int{6728, 1384, 7468, 1494}, + []int{1080, -19515, 3621, -18801}, + []int{8035, 12140, 10303, 13095}, + []int{16517, -9469, 19299, -9406}, + []int{-9840, -9469, -9161, -7636}, + []int{15241, -16501, 15884, -15085}, + []int{-19523, 9005, -19421, 9733}, + []int{6728, 13595, 7601, 14471}, + []int{-3707, 15013, -2015, 15308}, + []int{3007, 1494, 4881, 1665}, + []int{-7899, 13095, -6145, 13271}, + []int{4881, 16478, 6403, 18166}, + []int{-12748, -19141, -11610, -17980}, + []int{-13417, -19431, -12951, -18801}, + []int{-19800, 4785, -19623, 4793}, + []int{-19800, 10853, -19421, 13095}, + []int{-4681, -14389, -3065, -14279}, + []int{-9840, -4715, -9803, -4004}, + []int{-13921, -16655, -12748, -14568}, + []int{15884, 14471, 16316, 15061}, + []int{17684, 7721, 19299, 9585}, + []int{7468, 18439, 9781, 19112}, + []int{-4485, -19431, -3933, -17679}, + []int{-19527, 3283, -18809, 3970}, + []int{3007, 1665, 3505, 3858}, + []int{11526, -18801, 12654, -16655}, + []int{17021, -8111, 19299, -7636}, + []int{10246, 3262, 11901, 3970}, + []int{-19623, -16734, -19523, -15085}, + []int{6728, 3953, 7328, 4164}, + []int{1080, -6714, 2714, -6569}, + []int{-12130, 9585, -9890, 10039}, + []int{4881, 15683, 7029, 16423}, + []int{-12960, -9654, -11919, -7020}, + []int{-14835, -19515, -13417, -18801}, + []int{18082, 11103, 19992, 12998}, + []int{5757, 1494, 7328, 2113}, + []int{18000, 640, 19159, 2113}, + []int{11022, 6122, 12654, 7721}, + []int{-3217, -11264, -1781, -9469}, + []int{-9828, 14471, -6927, 15013}, + []int{-1696, -7636, -1445, -5235}, + []int{5266, 18166, 6801, 18439}, + []int{518, 19112, 1972, 20666}, + []int{-17318, -11264, -16900, -8859}, + []int{15241, 1118, 15884, 1771}, + []int{-5069, -16501, -3933, -14828}, + []int{-3883, 9005, -3707, 9733}, + []int{7468, 15061, 8035, 15784}, + []int{-3596, -6552, -1781, -5299}, + []int{-2802, 11785, -2344, 13271}, + []int{7468, 9585, 8139, 10359}, + []int{-14835, -8859, -13424, -6552}, + []int{-14835, 3953, -14470, 4548}, + []int{-5208, 2535, -4485, 4164}, + []int{15884, -9406, 19009, -8111}, + []int{-11919, 6634, -10309, 9005}, + []int{6403, -5235, 7081, -4715}, + []int{7328, 19886, 8139, 20990}, + []int{13830, 5977, 14100, 7038}, + []int{12654, 7038, 13398, 7721}, + []int{1603, 9585, 3621, 10369}, + []int{18082, -19878, 19584, -19623}, + []int{-17318, 14710, -16326, 15308}, + []int{-10193, 18166, -9828, 18654}, + []int{-3707, 16423, -2139, 19112}, + []int{11012, -2909, 12689, -1977}, + []int{5330, 7825, 6801, 10212}, + []int{7081, 10369, 7468, 11785}, + []int{-12960, 11785, -12160, 12140}, + []int{16517, 18654, 18000, 19886}, + []int{6728, 5977, 7468, 7061}, + []int{-14470, -19878, -12809, -19709}, + []int{-3217, 19343, -2344, 20990}, + []int{6403, -14568, 7328, -14389}, + []int{-7899, 5977, -6145, 7721}, + []int{17684, 13095, 19159, 14710}, + []int{14213, -15085, 15689, -14704}, + []int{-15236, -14568, -13921, -14279}, + []int{-7786, -8111, -5354, -5468}, + []int{-19421, 10369, -18739, 11103}, + []int{14213, -17791, 15884, -16734}, + []int{-13095, -17679, -12951, -17630}, + []int{19299, 10728, 19584, 11103}, + []int{3832, -2909, 5266, -1977}, + []int{300, -3101, 569, -1346}, + []int{14120, -2909, 15884, -718}, + []int{6801, -3101, 7029, -2909}, + []int{-14784, 803, -13095, 1665}, + []int{300, 19808, 518, 20990}, + []int{-1609, 16862, -594, 18439}, + []int{-10193, -19431, -9448, -17791}, + []int{-13095, 1118, -12960, 1384}, + []int{-9840, 1665, -9828, 3283}, + []int{-1445, 253, 300, 1118}, + []int{-19800, -11138, -19623, -7020}, + []int{5266, -2909, 7328, -1977}, + []int{-10193, 4771, -9890, 5977}, + []int{-2139, 12755, -1696, 13595}, + []int{-18809, 3858, -18015, 3970}, + []int{-19800, 8909, -19623, 9733}, + []int{10646, 10039, 11526, 10853}, + []int{-9448, 18654, -5208, 19886}, + []int{-1696, 1494, -494, 2535}, + []int{-7786, -4197, -5354, -2909}, + []int{-18486, 5977, -17182, 7061}, + []int{518, 1258, 3007, 1665}, + []int{-3883, -16501, -3596, -16147}, + []int{-1781, -8111, -594, -7636}, + []int{7081, -5000, 7468, -4197}, + []int{3621, 10039, 4881, 10865}, + []int{-494, -1044, 1080, -390}, + []int{4969, 6233, 6728, 7721}, + []int{-14784, -6552, -13095, -5000}, + []int{12654, -19142, 14100, -16734}, + []int{-2796, 3858, -2139, 4164}, + []int{18000, 9585, 19009, 10212}, + []int{10646, -5299, 12654, -5000}, + []int{-7786, -11730, -6999, -11595}, + []int{15689, -19142, 18000, -18767}, + []int{-19421, 11103, -18464, 13095}, + []int{-19800, -3052, -19523, -1944}, + []int{-16900, -19141, -16326, -17679}, + []int{569, -3052, 3007, -2909}, + []int{10303, -19623, 11022, -19141}, + []int{-13921, 2113, -13057, 3283}, + []int{-17180, -14828, -15236, -14389}, + []int{-4485, 11103, -3933, 12140}, + []int{1603, -14704, 3621, -11730}, + []int{10246, -1944, 11526, -1090}, + []int{14120, -19141, 15348, -17980}, + []int{-13424, 15308, -13057, 16862}, + []int{-3707, -4197, -3596, -2767}, + []int{13830, -5000, 14804, -4197}, + []int{-17442, 7061, -15861, 8466}, + []int{5183, -3052, 6801, -2909}, + []int{6728, -19709, 7601, -19431}, + []int{-19800, 19808, -19527, 20990}, + []int{-4918, 803, -3758, 1258}, + []int{5266, 214, 7029, 529}, + []int{-15236, -654, -14535, 529}, + []int{-2796, 9733, -2139, 11103}, + []int{-12951, -17630, -12130, -16655}, + []int{-9573, -19623, -7538, -19431}, + []int{8935, 15061, 9781, 16478}, + []int{-14535, -11730, -13921, -11595}, + []int{4881, -18539, 5757, -16734}, + []int{18000, 15061, 19992, 16478}, + []int{1972, 3858, 3832, 4548}, + []int{17021, 4771, 18082, 5977}, + []int{-11919, 640, -10921, 2535}, + []int{-12809, 4793, -11919, 6122}, + []int{-2802, 10359, -2796, 11103}, + []int{7601, 640, 8968, 1494}, + []int{-1696, 13271, -1445, 14471}, + []int{-19523, 14471, -17318, 15683}, + []int{-10309, -16734, -9840, -16147}, + []int{-3596, -5299, -3065, -4004}, + []int{2714, -19878, 3505, -19515}, + []int{-5208, 640, -4918, 1384}, + []int{-3065, -8111, -2015, -6714}, + []int{11526, 16862, 13108, 17732}, + []int{-10867, -1044, -9840, -654}, + []int{13398, -654, 14100, 214}, + []int{-15236, 16862, -14992, 18166}, + []int{-1781, -14389, -494, -13365}, + []int{-18015, 3262, -16326, 4164}, + []int{-11610, 2535, -10193, 3970}, + []int{300, 4263, 1972, 6122}, + []int{-3596, 6233, -2802, 7825}, + []int{-18809, -5462, -18795, -4871}, + []int{4969, 12755, 7081, 12998}, + []int{3832, -1346, 4969, -1090}, + []int{-13057, 3262, -12130, 3283}, + []int{-13057, 15308, -12809, 17536}, + []int{7328, 1494, 7468, 3858}, + []int{-17180, -17679, -14992, -14828}, + []int{2714, -18539, 4393, -17630}, + []int{11526, 16423, 11901, 16862}, + []int{-12089, -3895, -10921, -1346}, + []int{-14470, 3953, -13921, 4164}, + []int{-9840, -16113, -9828, -15085}, + []int{-13424, -2767, -13095, -1090}, + []int{-17442, -1044, -17182, 529}, + []int{-3217, -390, -2015, 803}, + []int{-18015, -19515, -16900, -19142}, + []int{13108, 16478, 14668, 17536}, + []int{7601, 5076, 9781, 6122}, + []int{-10867, 10400, -9803, 10853}, + []int{-18464, 11103, -17442, 12998}, + []int{-1781, -6552, -1696, -5462}, + []int{16099, 5977, 16517, 7199}, + []int{-19623, -19515, -19421, -18539}, + []int{-9573, 7825, -7538, 10039}, + []int{8035, 19808, 9781, 19870}, + []int{8035, 15683, 8935, 16423}, + []int{11022, -718, 13398, -654}, + []int{17021, -19539, 19299, -19142}, + []int{5757, -14389, 6801, -13365}, + []int{-1609, 12998, 569, 13271}, + []int{3621, -16147, 4393, -14704}, + []int{11022, 11103, 12689, 11785}, + []int{-9840, 11103, -9573, 11785}, + []int{5757, 19886, 7081, 20150}, + []int{17684, 7061, 19299, 7721}, + []int{14100, 6122, 15689, 7061}, + []int{10246, -1090, 11526, -1044}, + []int{13108, -6569, 14120, -5462}, + []int{1080, 16423, 3007, 17169}, + []int{-494, 19808, 300, 20990}, + []int{11901, 3262, 12654, 3970}, + []int{11022, 15061, 12654, 15784}, + []int{-18809, 18654, -17442, 19870}, + []int{-594, -4004, -494, -3649}, + []int{-18795, 7199, -18739, 7825}, + []int{-12960, 9005, -12130, 10359}, + []int{7081, 7061, 8035, 8466}, + []int{-2344, 11785, -2015, 12140}, + []int{569, -6552, 1080, -3895}, + []int{3621, 13271, 5183, 15013}, + []int{-3883, -18801, -2802, -17679}, + []int{-1696, -654, -1445, 253}, + []int{-2139, 15683, -1609, 17536}, + []int{-16900, -9654, -14835, -9194}, + []int{-3758, 1384, -2802, 1494}, + []int{2714, 15308, 4393, 15683}, + []int{-16326, 10853, -15861, 12755}, + []int{15348, -9654, 16517, -9406}, + []int{-18464, -5468, -16900, -5000}, + []int{-1445, -17630, 518, -16655}, + []int{-19623, 529, -19527, 1384}, + []int{7081, 14471, 7328, 15061}, + []int{-5069, -18539, -4485, -17630}, + []int{-14835, 9729, -14535, 10400}, + []int{7328, -718, 9781, 214}, + []int{-4485, 14710, -3758, 16423}, + []int{9781, 3970, 12654, 4263}, + []int{-19421, -7020, -17442, -6552}, + []int{-4681, 10728, -3982, 11103}, + []int{8935, 9005, 12654, 9733}, + []int{-2139, 9733, -2015, 10359}, + []int{-5144, 17536, -3933, 19343}, + []int{16099, 10728, 18000, 11103}, + []int{3832, 7199, 4881, 9729}, + []int{-3933, 6122, -3758, 8466}, + []int{-9573, -13457, -9161, -9654}, + []int{-13417, 11103, -12748, 11137}, + []int{12689, -2767, 13830, -718}, + []int{-9890, -5299, -9573, -5235}, + []int{-19421, -19878, -18809, -18801}, + []int{-19800, -13457, -19527, -11595}, + []int{-18486, 4548, -18015, 5076}, + []int{16316, 14471, 17684, 14710}, + []int{11901, -16655, 14100, -16501}, + []int{-3596, 2535, -2139, 3858}, + []int{-6145, 9729, -5069, 10728}, + []int{-16326, 3858, -15428, 4793}, + []int{18082, -3895, 19084, -1346}, + []int{15689, -654, 17684, 253}, + []int{-2015, -2767, -494, -1977}, + []int{-10193, -14828, -9840, -14389}, + []int{7029, 15784, 7468, 16423}, + []int{12654, 17732, 13398, 19343}, + []int{-19800, 10359, -18486, 10369}, + []int{5330, -5468, 7029, -5462}, + []int{-13417, 18439, -12809, 20666}, + []int{19009, -9406, 19159, -8111}, + []int{4881, -13365, 5757, -11264}, + []int{-16326, 1384, -15428, 1771}, + []int{4393, 1665, 4881, 3858}, + []int{3621, -19878, 5266, -19515}, + []int{4819, -4715, 4881, -4197}, + []int{-9890, 7199, -9828, 9005}, + []int{9781, -13457, 10646, -13413}, + []int{-16326, 2113, -14470, 3283}, + []int{10646, -384, 11901, 1258}, + []int{8139, 3858, 9781, 4785}, + []int{-5069, 12140, -4485, 13271}, + []int{518, 18166, 1972, 19112}, + []int{-13095, -9654, -12960, -8111}, + []int{6801, -8111, 7029, -6569}, + []int{-3982, 9733, -3758, 10212}, + []int{7328, -4004, 8139, -1977}, + []int{-11919, -1090, -10867, -718}, + []int{-19800, -6552, -18809, -5468}, + []int{-18015, -18801, -17180, -16655}, + []int{-5354, 12140, -5144, 13271}, + []int{14804, -14568, 15348, -13365}, + []int{-10193, 1771, -9890, 3858}, + []int{-12951, -1977, -12160, -1044}, + []int{-6999, 3262, -6145, 4771}, + []int{518, 1665, 2714, 3283}, + []int{-14784, 11785, -14470, 12998}, + []int{-10867, -19431, -10193, -17980}, + []int{11901, -390, 13398, 1118}, + []int{-10867, 4548, -10193, 5618}, + []int{-2802, -18539, -1781, -16734}, + []int{13108, 9005, 14120, 10728}, + []int{-10867, 9005, -9840, 9585}, + []int{18000, 12998, 19992, 13095}, + []int{8139, -19539, 10303, -18801}, + []int{7468, -18767, 8968, -17791}, + []int{10303, 2535, 11901, 3262}, + []int{-2802, -16655, -1781, -16113}, + []int{-12160, 16478, -12089, 18439}, + []int{-494, 214, 569, 253}, + []int{-18795, 18166, -18464, 18654}, + []int{-18464, 10400, -17182, 10865}, + []int{-10867, 10359, -9803, 10369}, + []int{-10867, -13365, -10193, -9469}, + []int{-5354, 4164, -3933, 4548}, + []int{6728, 17732, 7328, 18166}, + []int{-9803, 18439, -9448, 19886}, + []int{-2344, 19886, -2139, 20990}, + []int{4969, 5618, 6728, 5977}, + []int{-1781, -13365, -1733, -9654}, + []int{-17180, 13271, -16326, 13595}, + []int{15689, 7199, 16517, 9005}, + []int{-10867, -9406, -9890, -6569}, + []int{8139, 11785, 10303, 12140}, + []int{-2015, 4548, -1445, 4793}, + []int{13108, 20666, 14100, 20990}, + []int{-16900, -19431, -16326, -19142}, + []int{-19623, -15085, -18809, -14568}, + []int{-10309, -6569, -9828, -5468}, + []int{-18015, 7061, -17442, 7825}, + []int{4881, -1090, 5183, -718}, + []int{-5144, 12755, -5069, 13095}, + []int{15241, 1771, 16517, 2113}, + []int{-3707, -14279, -3217, -11138}, + []int{19299, 8909, 19584, 9585}, + []int{-3933, 2113, -3707, 4164}, + []int{-4681, 6233, -3933, 8909}, + []int{-9890, 6634, -9803, 7199}, + []int{13398, 10728, 14100, 11785}, + []int{-3596, -3052, -2139, -654}, + []int{-3596, -19878, -1781, -19539}, + []int{-1445, -7636, -594, -6569}, + []int{-6145, 6233, -5354, 7061}, + []int{-3217, 4164, -2344, 4548}, + []int{3621, -14389, 4819, -11595}, + []int{-12089, 7199, -11919, 9585}, + []int{-5144, 19870, -3883, 20990}, + []int{-5069, 5076, -4918, 6634}, + []int{-11610, -13365, -10921, -9469}, + []int{-10309, 10039, -9890, 10359}, + []int{-13921, -17630, -13057, -16655}, + []int{5757, -9194, 6403, -6569}, + []int{-1609, 10853, -494, 12998}, + []int{5266, 10039, 5330, 10369}, + []int{-17318, -14279, -16900, -13365}, + []int{11526, -1977, 12654, -1044}, + []int{-7786, 10369, -6999, 11103}, + []int{-19527, 6634, -19523, 7199}, + []int{-2802, -9194, -1445, -8111}, + []int{-18486, -1977, -18015, -1090}, + []int{1603, -9469, 2714, -7636}, + []int{13398, -3895, 15241, -3052}, + []int{-13417, 8909, -12951, 9005}, + []int{19299, 13271, 19992, 15061}, + []int{-9448, 19886, -7538, 20150}, + []int{-13921, 3970, -13417, 4771}, + []int{19084, -2767, 19584, -1346}, + []int{-4918, -6552, -3883, -5462}, + []int{-18486, -2909, -18015, -1977}, + []int{4393, 3858, 5266, 3970}, + []int{8035, 6634, 8968, 8466}, + []int{-3758, -1944, -3596, -718}, + []int{-2796, -16734, -2015, -16655}, + []int{-9448, 1665, -7538, 3970}, + []int{-18464, -19878, -18015, -19141}, + []int{-17182, -11595, -16326, -11264}, + []int{-9890, 1384, -9840, 3283}, + []int{8935, 8909, 10303, 9005}, + []int{10646, -19878, 12689, -19623}, + []int{9781, 3262, 10246, 3970}, + []int{-13424, -18801, -13095, -17791}, + []int{-19421, -4871, -18464, -4715}, + []int{-3883, 1494, -2796, 2113}, + []int{-15236, 18439, -14835, 19886}, + []int{-9890, 4785, -9161, 5076}, + []int{11901, 10400, 12689, 10865}, + []int{-3758, 18439, -3707, 19343}, + []int{15348, -6569, 15884, -4715}, + []int{-14835, -3649, -14470, -3052}, + []int{13108, 11785, 14100, 12755}, + []int{-7899, -6714, -7786, -5299}, + []int{6801, -16734, 7081, -14704}, + []int{5266, 3970, 6728, 4164}, + []int{1603, 11137, 3505, 13271}, + []int{11022, -6552, 11901, -5299}, + []int{-7899, -5235, -6145, -4197}, + []int{-13057, 4164, -12748, 4771}, + []int{17684, 16478, 19584, 17536}, + []int{4881, 8909, 5330, 9729}, + []int{14804, -4715, 15348, -4004}, + []int{18082, 4785, 19584, 5618}, + []int{6801, 9005, 7328, 10212}, + []int{-3758, 4548, -2344, 5076}, + []int{11526, 1384, 12654, 1771}, + []int{-9840, -19709, -7899, -19623}, + []int{15884, 6634, 16099, 7061}, + []int{-12809, 16478, -12160, 18166}, + []int{-19527, 253, -18795, 1384}, + []int{4393, -17980, 4881, -16734}, + []int{-15428, 1384, -14835, 1771}, + []int{-11919, -19709, -10193, -19431}, + []int{4969, 18439, 6403, 18654}, + []int{-7899, 17169, -5208, 18654}, + []int{16099, 253, 17684, 803}, + []int{-5208, -19142, -4485, -18801}, + []int{-7786, -16655, -6145, -15085}, + []int{19159, 1384, 19992, 3262}, + []int{-12748, -17679, -12130, -17630}, + []int{8968, 7038, 11012, 8466}, + []int{-14784, -17679, -14470, -16501}, + []int{-494, -16655, 300, -14828}, + []int{-12748, -16655, -12160, -16501}, + []int{-10309, 12998, -9573, 14471}, + []int{14120, 9005, 15348, 10359}, + []int{-12960, 1665, -12130, 1771}, + []int{12654, -1944, 12689, -1044}, + []int{-18739, 10865, -18015, 11103}, + []int{-2015, -5299, -1733, -5235}, + []int{-14470, 9585, -13057, 10369}, + []int{3007, 6634, 3832, 9585}, + []int{7601, 19112, 9781, 19808}, + []int{12654, 1118, 14120, 1384}, + []int{-14470, -19623, -13417, -19515}, + []int{10246, -18801, 11022, -16501}, + []int{16316, 11103, 18082, 11137}, + []int{-14784, -5000, -12809, -4715}, + []int{-9161, 4785, -7899, 7038}, + []int{18000, 10400, 19084, 11103}, + []int{-12748, -6569, -10921, -5462}, + []int{569, -19623, 1080, -19142}, + []int{1080, -1090, 1603, -654}, + []int{17684, 20666, 19584, 20990}, + []int{3505, -15085, 3621, -14704}, + []int{-12130, -7020, -10921, -6714}, + []int{-5208, -5462, -4681, -5235}, + []int{-9828, -14279, -9573, -13365}, + []int{-14784, 15061, -12960, 15308}, + []int{-12960, -14389, -12130, -13457}, + []int{-16326, -18801, -15428, -17679}, + []int{-13424, -8111, -13057, -7636}, + []int{19084, -19141, 19992, -18801}, + []int{8035, 13595, 8139, 15013}, + []int{-18795, -5462, -18739, -5000}, + []int{16316, -11138, 19084, -9654}, + []int{7029, -8111, 7328, -5462}, + []int{-1445, -6569, -594, -5462}, + []int{-4485, 12998, -3883, 13595}, + []int{-9161, 7038, -7899, 7061}, + []int{-16900, 4164, -16393, 4771}, + []int{19584, 18166, 19992, 19870}, + []int{-12809, 4785, -12130, 4793}, + []int{-10309, 17536, -9890, 17732}, + []int{-3596, 12998, -2802, 14710}, + []int{-9840, 16423, -7538, 16862}, + []int{-13057, 18166, -12951, 18439}, + []int{15241, 15784, 15689, 16423}, + []int{-4485, 13595, -3883, 14471}, + []int{-2796, -654, -2344, -390}, + []int{15348, 20150, 16099, 20990}, + []int{-14992, -16501, -13921, -16147}, + []int{-13417, -6714, -12951, -6569}, + []int{-1781, -17679, -1445, -16655}, + []int{-9828, 1258, -9448, 2535}, + []int{11901, -14279, 13108, -13365}, + []int{12654, -5299, 13398, -3101}, + []int{5757, 10359, 7081, 10400}, + []int{9781, 6233, 10246, 7038}, + []int{-4918, 13271, -4485, 15061}, + []int{-19800, 214, -19623, 1771}, + []int{-14470, 20666, -12748, 20990}, + []int{-9161, 10359, -7786, 11785}, + []int{19159, 3283, 19584, 4164}, + []int{-12130, 1494, -11919, 3283}, + []int{-16393, -1090, -15428, -654}, + []int{19584, 19870, 19992, 20990}, + []int{-10921, 15013, -9890, 16862}, + []int{7328, 9005, 8935, 9585}, + []int{-14835, -19878, -14470, -19539}, + []int{-12089, 15061, -10921, 16862}, + []int{7081, -16147, 7601, -14828}, + []int{-17442, 9005, -17318, 9733}, + []int{-9890, -2767, -9828, -1346}, + []int{-9161, -13365, -7786, -9654}, + []int{-18486, 10728, -18464, 10865}, + []int{-9828, -5468, -9161, -5299}, + []int{4819, -14828, 4969, -13457}, + []int{5266, -19623, 6403, -19515}, + []int{11012, -9469, 11526, -6569}, + []int{11012, 16862, 11526, 18654}, + []int{-18464, -7636, -17442, -7020}, + []int{1080, 1118, 3505, 1258}, + []int{3832, 253, 4969, 803}, + []int{18082, 6233, 19159, 7038}, + []int{-15236, 4785, -14784, 6233}, + []int{-3982, 10369, -3883, 10865}, + []int{-18739, -11264, -17318, -11138}, + []int{-19523, 10039, -19421, 10359}, + []int{-5208, -1944, -5069, -1346}, + []int{-3707, -14704, -3217, -14389}, + []int{-6999, 9729, -6927, 10212}, + []int{14100, -19142, 14120, -18539}, + []int{-3758, 4263, -3596, 4548}, + []int{16517, 15061, 17684, 16862}, + []int{-3883, -9194, -3758, -7020}, + []int{-16900, -11264, -16326, -9654}, + []int{12689, 10853, 13398, 10865}, + []int{5757, -13365, 7468, -11264}, + []int{-13424, 11785, -13095, 13095}, + []int{-3982, 5076, -3596, 6122}, + []int{-3933, 4263, -3883, 5076}, + []int{16316, -19878, 17021, -19431}, + []int{11526, 14710, 11901, 15061}, + []int{16316, -4197, 18000, -3052}, + []int{11901, -14389, 12654, -14279}, + []int{-18809, -11595, -17442, -11264}, + []int{10646, -6569, 11022, -5299}, + []int{16099, -14389, 18082, -13413}, + []int{-16326, -2909, -15236, -1977}, + []int{-5208, -1346, -5069, -384}, + []int{7601, -14279, 9781, -13457}, + []int{-13057, -14389, -12960, -13413}, + []int{2714, 4548, 3007, 5618}, + []int{-19623, -9194, -19523, -6569}, + []int{-16900, 5076, -15861, 6122}, + []int{18000, 10212, 18082, 10400}, + []int{10246, -13365, 10303, -8859}, + []int{-11610, -5462, -10867, -4871}, + []int{-4485, -5000, -3883, -3895}, + []int{11022, -16147, 13108, -14828}, + []int{-4681, 8909, -4485, 9733}, + []int{7328, -17679, 7601, -16501}, + []int{14213, -718, 15348, -390}, + []int{4881, 3970, 5183, 5076}, + []int{-18795, -18801, -18015, -16655}, + []int{13108, -7020, 15689, -6714}, + []int{-17442, 19870, -16900, 20990}, + []int{-3596, 11137, -2802, 12140}, + []int{16517, 7825, 17684, 9005}, + []int{-14992, 16478, -14835, 18166}, + []int{-19800, -5468, -19421, -4871}, + []int{-3217, -14704, -3065, -14568}, + []int{10646, -3052, 11526, -2909}, + []int{5183, 10728, 6801, 10853}, + []int{-3596, 5076, -3217, 6122}, + []int{-7538, 529, -6145, 1384}, + []int{16099, 4164, 16316, 4548}, + []int{1080, 17536, 3832, 18166}, + []int{-3758, 15013, -3707, 15683}, + []int{11012, 14710, 11022, 16423}, + []int{-17180, -1044, -16900, -384}, + []int{-5208, -9406, -4918, -9194}, + []int{-6999, -19141, -5208, -18539}, + []int{15689, -14568, 19009, -14389}, + []int{8968, -13413, 10246, -11264}, + []int{-5069, -14704, -3883, -14389}, + []int{-14784, 4548, -13921, 5977}, + []int{-2015, 15013, -1733, 15308}, + []int{-145, 1494, 300, 3953}, + []int{-594, 16862, 300, 18166}, + []int{-9828, 529, -7786, 1258}, + []int{-3065, 3858, -2796, 3953}, + []int{-12951, -17791, -12809, -17630}, + []int{12689, 6233, 13830, 7038}, + []int{1080, -19878, 2714, -19709}, + []int{16316, 803, 18000, 1665}, + []int{19159, -5468, 19299, -5299}, + []int{-16393, 1494, -16326, 1771}, + []int{-14470, 4164, -13921, 4263}, + []int{-2796, 1118, -2139, 1665}, + []int{3621, 11137, 4969, 11785}, + []int{-9573, 10359, -9161, 10400}, + []int{12654, 1494, 13108, 3283}, + []int{-18809, -16655, -17442, -14828}, + []int{-1609, 10369, -145, 10853}, + []int{-9161, -19878, -6999, -19709}, + []int{-7786, -14828, -6999, -13457}, + []int{-11919, -9406, -10921, -7636}, + []int{4969, 10853, 5757, 11137}, + []int{-15861, 12140, -15428, 14471}, + []int{1603, -3895, 1972, -3052}, + []int{-18464, 4164, -16900, 4263}, + []int{-9890, 5076, -9448, 5618}, + []int{13830, -1977, 14100, -1044}, + []int{14100, 11785, 15241, 13095}, + []int{10246, -1977, 11022, -1944}, + []int{-1696, -1346, -594, -1090}, + []int{19584, 3858, 19992, 4785}, + []int{-10193, -11138, -9573, -9469}, + []int{-17318, -14389, -15236, -14279}, + []int{-2802, -9406, -2015, -9194}, + []int{17684, -7636, 19299, -6569}, + []int{-7899, 4263, -6999, 5076}, + []int{15241, -4004, 15689, -3649}, + []int{-16900, -13413, -15861, -11595}, + []int{-11919, 10212, -10867, 10369}, + []int{-16393, -9194, -14992, -8111}, + []int{-12809, 7825, -12089, 8909}, + []int{-10309, -17791, -9448, -17679}, + []int{1972, -6569, 3505, -5462}, + []int{4969, -19515, 6728, -18767}, + []int{-13921, -17791, -13095, -17630}, + []int{2714, -9469, 3832, -9406}, + []int{11526, 13595, 12689, 14710}, + []int{-18486, -6552, -18464, -5299}, + []int{4969, 2113, 5330, 2535}, + []int{-18739, 529, -18015, 640}, + []int{-4918, 4785, -4681, 6122}, + []int{8035, -19709, 8139, -19539}, + []int{-1445, 13595, -145, 15308}, + []int{-7538, -5299, -5354, -5235}, + []int{-18739, 640, -17442, 803}, + []int{-19623, -18539, -19527, -16734}, + []int{-5208, 2113, -4681, 2535}, + []int{12689, -9194, 13108, -7020}, + []int{-10867, -6569, -10309, -5299}, + []int{13830, 5076, 14100, 5618}, + []int{-3883, -6552, -3758, -5299}, + []int{10646, -9654, 11901, -9469}, + []int{-9840, -1090, -9573, -384}, + []int{-16900, 6233, -15236, 7038}, + []int{4819, -13413, 4881, -11730}, + []int{13108, -16113, 14100, -15085}, + []int{1603, -11264, 3505, -9469}, + []int{-145, 12755, 1080, 12998}, + []int{-3883, -5299, -3596, -4715}, + []int{5757, 19343, 6403, 19886}, + []int{-15428, -5235, -14992, -5000}, + []int{4393, -384, 4969, 253}, + []int{5266, 5977, 6728, 6233}, + []int{-12748, 10359, -12160, 10853}, + []int{-145, 5977, 300, 7038}, + []int{-145, 15683, 300, 16478}, + []int{-16900, 4771, -16326, 5076}, + []int{-10867, 5977, -10309, 6233}, + []int{15884, -16734, 19159, -16147}, + []int{-13095, -6552, -13057, -5235}, + []int{-5069, -5000, -4681, -3895}, + []int{-19421, 5977, -18486, 6233}, + []int{-17182, 5618, -16900, 6122}, + []int{5330, -5000, 6403, -3895}, + []int{14668, 17732, 15241, 19112}, + []int{19159, 13595, 19299, 15013}, + []int{11901, 4548, 12689, 5618}, + []int{1972, 6233, 2714, 7038}, + []int{-9890, -13365, -9573, -11138}, + []int{19159, -5235, 19584, -4197}, + []int{-12951, -718, -12748, -384}, + []int{-10309, 17169, -9840, 17536}, + []int{-13424, -19709, -13095, -19623}, + []int{-3758, 214, -3707, 803}, + []int{-2802, 5618, -2015, 6634}, + []int{6728, 7061, 7081, 7721}, + []int{4881, -3649, 6403, -3052}, + []int{-1733, 17732, -1696, 18654}, + []int{-9803, 20150, -7786, 20990}, + []int{-19623, 8466, -19523, 9585}, + []int{-14835, -3052, -13424, -2909}, + []int{-2802, 11137, -1733, 11785}, + []int{-11919, -19878, -9573, -19709}, + []int{-19623, -3649, -18795, -3052}, + []int{-18486, -5000, -17182, -4871}, + []int{13108, -16147, 13830, -16113}, + []int{3505, 11785, 4881, 13271}, + []int{-17180, 14471, -15428, 14710}, + []int{-15428, -19623, -14835, -19142}, + []int{17684, -19878, 18000, -19539}, + []int{-12960, -4715, -11919, -4004}, + []int{3832, -11264, 4881, -9404}, + []int{9781, 1494, 11012, 2113}, + []int{-14535, -4197, -13095, -4004}, + []int{1080, -654, 1603, -390}, + []int{4881, -18767, 5266, -18539}, + []int{-7538, -11138, -5208, -8859}, + []int{11526, -16655, 11901, -16147}, + []int{15241, 16862, 15884, 19112}, + []int{-2344, 19343, -2139, 19808}, + []int{4819, 17169, 4881, 18654}, + []int{-17442, -16147, -17182, -14568}, + []int{-14535, 15013, -13417, 15061}, + []int{-19421, -3052, -18015, -2909}, + []int{-6145, 4164, -5354, 4785}, + []int{-10309, 10369, -9828, 10400}, + []int{-2139, -19141, -1609, -18801}, + []int{-4681, -5462, -4485, -4197}, + []int{7468, 10359, 8935, 10400}, + []int{-13417, 17169, -13095, 18166}, + []int{16099, 1665, 18000, 1771}, + []int{8139, -5000, 8968, -3895}, + []int{-4485, 2113, -3933, 3970}, + []int{-18015, 1384, -16393, 1665}, + []int{15689, 4548, 16316, 4771}, + []int{-10193, -19623, -9803, -19539}, + []int{14213, 5977, 15884, 6122}, + []int{12689, 13595, 13108, 16423}, + []int{14120, 10400, 15241, 10728}, + []int{-3596, 3858, -3217, 4548}, + []int{-5208, -1977, -5069, -1944}, + []int{4393, 10865, 4969, 11137}, + []int{15689, -8111, 17021, -6569}, + []int{-2139, -1346, -2015, -390}, + []int{14213, -16501, 14804, -15085}, + []int{-19800, -6714, -19623, -6552}, + []int{300, -16655, 518, -14828}, + []int{-2802, -5299, -2796, -4871}, + []int{-4485, 8909, -3982, 10039}, + []int{-10309, 14710, -9840, 15013}, + []int{-9890, 15061, -9803, 16423}, + []int{-7538, -13457, -5208, -13413}, + []int{11526, 10212, 12654, 10369}, + []int{15348, 2113, 15689, 2535}, + []int{5266, 10400, 7029, 10728}, + []int{1603, -11730, 3621, -11264}, + []int{19584, 17536, 19992, 18166}, + []int{-1609, 253, -1445, 803}, + []int{-494, 11137, -145, 11785}, + []int{-13095, -1977, -12960, -1090}, + []int{5330, -5462, 6728, -5235}, + []int{-9840, 19343, -9803, 19808}, + []int{-1609, 18439, -145, 18654}, + []int{-5208, 17732, -5144, 19112}, + []int{14668, 7061, 16099, 7199}, + []int{-4918, 10212, -3883, 10369}, + []int{-15428, 12140, -14784, 12998}, + []int{-1445, 3262, -145, 3953}, + []int{-11610, -19431, -10867, -17980}, + []int{-1445, -19141, -494, -18539}, + []int{-15861, 7061, -15236, 8466}, + []int{13830, -16147, 14120, -16113}, + []int{3505, 15683, 4881, 17169}, + []int{-145, -390, 1080, 214}, + []int{-9890, 19808, -9803, 19886}, + []int{-18809, 1494, -18015, 2113}, + []int{-19527, 20150, -18464, 20990}, + []int{-3758, 15683, -2344, 15784}, + []int{-17182, -16501, -17180, -14828}, + []int{-17442, 16423, -17182, 17732}, + []int{-18486, 7061, -18015, 7721}, + []int{7328, -9406, 8035, -7636}, + []int{15348, -14704, 15689, -13413}, + []int{11901, -6714, 14213, -6569}, + []int{7081, -17980, 7328, -17791}, + []int{8139, -14828, 9781, -14389}, + []int{-3596, -16655, -3217, -16147}, + []int{-16326, -5299, -14784, -5235}, + []int{-9573, -15085, -7786, -14389}, + []int{11526, 17732, 12654, 18166}, + []int{3832, -16655, 4969, -16147}, + []int{-10921, 640, -10867, 2535}, + []int{8968, -16501, 10246, -14828}, + []int{12654, -14828, 13830, -14568}, + []int{-12748, 12140, -12130, 12755}, + []int{-3065, -19515, -2344, -19431}, + []int{-18795, 19870, -17442, 19886}, + []int{-19527, -17980, -19421, -17791}, + []int{-16393, -5000, -16326, -4197}, + []int{13830, -8111, 15348, -7020}, + []int{-17442, -19539, -16393, -19515}, + []int{-18486, -19141, -17442, -18801}, + []int{19584, -5299, 19992, -4004}, + []int{-19421, -14568, -18809, -11138}, + []int{-16393, 19870, -15236, 19886}, + []int{-11610, -13457, -10921, -13413}, + []int{-6927, 13271, -5354, 14710}, + []int{-17182, 7038, -15236, 7061}, + []int{-1445, -9406, -145, -8111}, + []int{4881, 3283, 5757, 3858}, + []int{-14835, 6233, -13424, 7199}, + []int{-14992, -16147, -14784, -16113}, + []int{4969, -654, 5183, -384}, + []int{-9573, 3858, -9448, 3970}, + []int{-16900, -9194, -16393, -8111}, + []int{-9448, 10039, -7786, 10359}, + []int{-16326, 17732, -15236, 19870}, + []int{-3758, 19343, -3707, 19870}, + []int{-19623, 10369, -19527, 10853}, + []int{-12809, 19112, -11919, 19886}, + []int{4881, -16147, 4969, -16113}, + []int{17684, 11137, 18000, 13095}, + []int{-19623, -4004, -19523, -3895}, + []int{-2802, -19142, -2015, -19141}, + []int{9781, 13595, 11526, 14710}, + []int{-3758, 7199, -3707, 9005}, + []int{-15861, -3895, -14992, -2909}, + []int{-9448, -19142, -7538, -18801}, + []int{-13417, -2909, -12960, -2767}, + []int{-4485, 3970, -3982, 4164}, + []int{-2015, -1346, -1781, -654}, + []int{-16393, -654, -15236, 529}, + []int{14213, 214, 15348, 1118}, + []int{4969, -16734, 6403, -16501}, + []int{19009, 2113, 19084, 3970}, + []int{-13424, -1090, -13095, -654}, + []int{-15236, 3970, -14835, 4785}, + []int{-12130, 11785, -12089, 14471}, + []int{19159, 803, 19992, 1258}, + []int{-10309, -17679, -9573, -16734}, + []int{4969, 9733, 5183, 10359}, + []int{-7899, 13271, -6927, 13595}, + []int{-17180, 2535, -16326, 3262}, + []int{-6999, -1977, -6145, -1346}, + []int{10246, 5977, 10646, 7038}, + []int{300, 15784, 569, 16423}, + []int{-18486, 10359, -16900, 10400}, + []int{8935, 4785, 8968, 5076}, + []int{-9803, 15013, -9573, 15683}, + []int{18082, 5618, 19159, 6233}, + []int{-9890, -5000, -9840, -3895}, + []int{-17318, 15308, -16393, 15683}, + []int{3007, 15013, 4393, 15061}, + []int{-594, -390, -145, 214}, + []int{16517, 6634, 17684, 7199}, + []int{-4681, 16423, -3758, 16862}, + []int{-1696, 7825, -1609, 8466}, + []int{-594, -5235, -494, -4197}, + []int{-3217, -16501, -2802, -16147}, + []int{3832, 4263, 4819, 4771}, + []int{19084, -16147, 19299, -14568}, + []int{-6999, 19886, -5144, 20990}, + []int{7468, 2535, 8035, 3283}, + []int{11526, -8859, 12689, -6714}, + []int{16517, 7721, 17021, 7825}, + []int{-13417, 3953, -13095, 4793}, + []int{1603, -19623, 1972, -19515}, + []int{19584, -2767, 19992, -1346}, + []int{-494, -14828, 518, -14389}, + []int{-1445, 4263, -594, 4785}, + []int{-6999, -13365, -5208, -11138}, + []int{-13921, 4793, -13417, 6233}, + []int{518, 7038, 2714, 7825}, + []int{3505, 15061, 4393, 15308}, + []int{11012, 5977, 11022, 7825}, + []int{-18464, -1090, -17182, -1044}, + []int{-14535, 7721, -14470, 9005}, + []int{-9161, -5000, -7899, -4004}, + []int{7601, 6122, 9781, 6634}, + []int{-12160, 3970, -12089, 4263}, + []int{-4485, 12140, -3933, 12755}, + []int{-7786, -15085, -5354, -14828}, + []int{-14992, -16734, -14784, -16501}, + []int{4881, 5076, 5183, 5618}, + []int{8935, 16478, 8968, 17169}, + []int{-10921, -9194, -10867, -7636}, + []int{16517, -1977, 18082, -1346}, + []int{-12809, 12140, -12748, 12755}, + []int{-9803, 3970, -6999, 4263}, + []int{-3707, -17630, -2802, -16734}, + []int{-9840, 9005, -9803, 9729}, + []int{-16326, 8466, -15428, 8909}, + []int{-14835, -9654, -14470, -9406}, + []int{15348, 9005, 17684, 9729}, + []int{-19523, 1494, -18809, 1665}, + []int{-19523, -9654, -19421, -7020}, + []int{13398, 7061, 14213, 8466}, + []int{10246, 803, 10303, 1258}, + []int{-145, -18767, 1603, -18539}, + []int{-19800, -19878, -19527, -19709}, + []int{-2796, 13595, -1733, 15013}, + []int{9781, -654, 10646, 214}, + []int{7601, 529, 10246, 640}, + []int{8935, 14471, 8968, 14710}, + []int{-19523, 18166, -18809, 18439}, + []int{5183, -14568, 5266, -14389}, + []int{-14992, 1118, -14835, 1258}, + []int{-9573, 5618, -9448, 7199}, + []int{-9840, 14471, -9828, 15061}, + []int{-10921, -5468, -10867, -5462}, + []int{-19421, -16734, -18809, -16147}, + []int{-13424, -14568, -13095, -14279}, + []int{-9828, -1346, -9803, -1090}, + []int{10303, -11138, 10646, -9404}, + []int{-4681, 5076, -4485, 6233}, + []int{-13095, -5235, -11919, -5000}, + []int{-12951, -19431, -12748, -19141}, + []int{-10867, 214, -9840, 253}, + []int{7601, -5000, 8139, -4197}, + []int{1080, -19539, 1603, -19515}, + []int{-9840, -384, -9828, 1118}, + []int{-9828, -7636, -7899, -5468}, + []int{-12089, 11785, -11610, 13595}, + []int{-1781, -1977, -1445, -1346}, + []int{-15236, 7038, -14835, 8466}, + []int{-2015, 10212, -1696, 10853}, + []int{-19800, 7038, -19623, 8466}, + []int{14120, 10359, 15348, 10369}, + []int{16099, -19709, 16316, -19142}, + []int{-10309, 17732, -9161, 18166}, + []int{10646, 5977, 11012, 6233}, + []int{7328, -1090, 8139, -718}, + []int{-11610, -4871, -10309, -3895}, + []int{8035, 2535, 8139, 3283}, + []int{-5354, -8859, -5208, -6569}, + []int{-19623, 6233, -19523, 6634}, + []int{-18015, -19142, -17318, -19141}, + []int{-19421, -5462, -18809, -4871}, + []int{2714, 9005, 3007, 9585}, + []int{-14470, 7825, -13417, 8466}, + []int{-5354, -14279, -3982, -13457}, + []int{-9840, 3858, -9803, 4263}, + []int{-13095, -14568, -13057, -14279}, + []int{-13095, -1044, -12960, -654}, + []int{-19527, -19878, -19523, -19623}, + []int{-12951, 8909, -12089, 9005}, + []int{15241, 11137, 15348, 12755}, + []int{-15861, 10728, -14992, 12140}, + []int{-16326, -1977, -15236, -1346}, + []int{-9828, 15013, -9803, 15061}, + []int{-19623, -11595, -19421, -11264}, + []int{-16326, 16862, -15861, 17536}, + []int{16099, 18654, 16316, 20666}, + []int{-3982, -9404, -3883, -7636}, + []int{13398, 17536, 14213, 17732}, + []int{7601, 10400, 8935, 11103}, + []int{-494, -14279, 1603, -13365}, + []int{19084, 3262, 19159, 3970}, + []int{-16326, 1771, -15428, 2113}, + []int{-13095, 640, -12951, 1118}, + []int{-17182, -1090, -17180, -384}, + []int{3832, 3262, 4393, 4263}, + []int{569, -8859, 1603, -7020}, + []int{-12160, -1977, -12089, -1944}, + []int{-1696, 10359, -145, 10369}, + []int{-12160, 14471, -10309, 14710}, + []int{10646, -11595, 11526, -11138}, + []int{10246, 2113, 12654, 2535}, + []int{-6999, 16478, -5069, 17169}, + []int{-3758, 6634, -3596, 7061}, + []int{8139, -19878, 10646, -19709}, + []int{1972, -5000, 2714, -4197}, + []int{-6145, -19623, -5354, -19431}, + []int{-14835, 529, -14535, 803}, + []int{-2139, -14828, -1781, -14568}, + []int{-13424, 3283, -12960, 3858}, + []int{-14470, -718, -13424, -654}, + []int{15689, 14471, 15884, 15683}, + []int{-5069, 9733, -4918, 10728}, + []int{-18486, 13095, -18015, 14471}, + []int{-2344, 4793, -2015, 5618}, + []int{3505, -6569, 4819, -5468}, + []int{5757, -18767, 6801, -18539}, + []int{-5354, 4771, -5144, 5618}, + []int{-2796, -16113, -2139, -14279}, + []int{-1696, 10212, -494, 10359}, + []int{18000, 19112, 19159, 19886}, + []int{-7899, -9406, -7538, -8859}, + []int{-16393, 19886, -16326, 20150}, + []int{-3065, 2113, -2015, 2535}, + []int{-12809, 20150, -11919, 20666}, + []int{4881, -13457, 5183, -13365}, + []int{-12748, 14710, -12130, 15784}, + []int{-3596, 15784, -2344, 16423}, + []int{-5144, 4548, -4918, 5076}, + []int{3505, -1977, 4393, -1944}, + []int{300, 15061, 1603, 15308}, + []int{13830, -3052, 14100, -1977}, + []int{3621, -3052, 4969, -2909}, + []int{-10193, 7038, -9890, 7825}, + []int{-13095, 1494, -12130, 1665}, + []int{15348, -718, 15689, 214}, + []int{-3758, -14704, -3707, -14389}, + []int{-19800, 2113, -19527, 3262}, + []int{-3883, 19112, -3758, 20150}, + []int{-4485, -7020, -3758, -6569}, + []int{-18486, -1044, -17442, -718}, + []int{-3758, 803, -3217, 1258}, + []int{14804, -11138, 15348, -9469}, + []int{-15861, 9729, -14992, 10039}, + []int{-12748, 6122, -12130, 7825}, + []int{1603, 10400, 3505, 11137}, + []int{-16393, -19878, -15861, -19623}, + []int{-1609, 15683, -594, 16862}, + []int{-15861, -6552, -14992, -5468}, + []int{-19527, 19870, -18809, 20150}, + []int{-19800, 5618, -19623, 7038}, + []int{-10193, -4197, -9890, -3101}, + []int{-9890, -16147, -9840, -14828}, + []int{18082, -14279, 19084, -13365}, + []int{-3982, -3649, -3707, -3052}, + []int{-1445, -5462, -594, -5299}, + []int{-16900, 10359, -15861, 10853}, + []int{-494, -4715, -145, -3052}, + []int{-14784, 10865, -13057, 11103}, + []int{-9803, 5618, -9573, 7038}, + []int{19584, -11264, 19992, -8859}, + []int{-594, 3953, 300, 4771}, + []int{1972, -15085, 2714, -14704}, + []int{11022, -5000, 11526, -3052}, + []int{-19523, -2767, -18486, -1977}, + []int{19299, 9585, 19584, 9729}, + []int{-3217, -19431, -2802, -19141}, + []int{-18464, 17536, -17442, 18654}, + []int{6728, -5462, 7029, -5235}, + []int{1972, 4771, 2714, 5977}, + []int{11901, -11138, 12689, -8859}, + []int{-17442, 11785, -17318, 12140}, + []int{4969, -11264, 5266, -9406}, + []int{-6927, 11103, -6145, 11785}, + []int{-14992, 11785, -14835, 12140}, + []int{-18809, 5618, -18486, 5977}, + []int{17021, -3052, 18000, -2909}, + []int{17684, 20150, 19084, 20666}, + []int{-9448, -5235, -7899, -5000}, + []int{-494, 7825, 518, 9733}, + []int{-18486, 1118, -17442, 1384}, + []int{5757, 803, 6728, 1494}, + []int{-19800, -4004, -19623, -3649}, + []int{-1445, 1258, 300, 1494}, + []int{-3065, -14704, -2796, -14389}, + []int{18000, -19878, 18082, -19539}, + []int{-19527, 13271, -18739, 13595}, + []int{7601, 19870, 8935, 19886}, + []int{16316, -1346, 17684, -718}, + []int{-15428, 4771, -15236, 6122}, + []int{10303, 18166, 11012, 19343}, + []int{5266, 529, 7081, 640}, + []int{-14835, 19886, -14470, 20990}, + []int{-7786, 10212, -7538, 10369}, + []int{-15861, 15013, -15428, 15308}, + []int{-13921, 1771, -12809, 2113}, + []int{-19421, -7636, -18795, -7020}, + []int{4393, 15013, 5266, 15683}, + []int{-12960, -16734, -12951, -16655}, + []int{-9828, -1977, -6999, -1346}, + []int{9781, 15308, 10646, 15683}, + []int{-19527, 3970, -19523, 4793}, + []int{-3217, 3953, -2796, 3970}, + []int{-10309, 14471, -9890, 14710}, + []int{-19527, 214, -19523, 253}, + []int{-7538, 7721, -6145, 9005}, + []int{-14992, 3283, -14535, 3953}, + []int{-9573, -384, -9161, 214}, + []int{12689, -7020, 13108, -6714}, + []int{17684, 15013, 18000, 16478}, + []int{-19523, -16655, -19421, -15085}, + []int{-2344, 12140, -2015, 12755}, + []int{-5208, 15061, -4918, 16478}, + []int{-14784, -9406, -13921, -8859}, + []int{-14992, -5235, -14835, -5000}, + []int{5266, -19878, 6403, -19623}, + []int{10246, 5618, 12654, 5977}, + []int{4969, 7721, 7081, 7825}, + []int{14100, -17980, 14804, -17791}, + []int{-15428, -14279, -14992, -11730}, + []int{8968, -18801, 9781, -17980}, + []int{14100, -3052, 14120, -654}, + []int{-18795, 253, -18739, 1494}, + []int{7029, 15683, 7468, 15784}, + []int{-2802, -15085, -2796, -14704}, + []int{-12748, 4263, -12160, 4771}, + []int{-9890, 18654, -9828, 19343}, + []int{3505, 10853, 3621, 10865}, + []int{10646, 19808, 11022, 20990}, + []int{4819, 9729, 5330, 9733}, + []int{-3933, 17732, -3707, 18166}, + []int{-14992, -14279, -14784, -13457}, + []int{4819, -5000, 4969, -4715}, + []int{300, 803, 1080, 1118}, + []int{15884, 15308, 16517, 16862}, + []int{-594, -1944, -494, -1044}, + []int{-18464, -3101, -17182, -3052}, + []int{5183, 3262, 5757, 3283}, + []int{19584, 10728, 19992, 11103}, + []int{13108, -8111, 13830, -7020}, + []int{-13921, -9404, -13417, -9194}, + []int{11526, 19870, 12689, 20990}, + []int{1080, 803, 3621, 1118}, + []int{-15236, -7636, -14992, -6569}, + []int{-3758, -19878, -3596, -19623}, + []int{7328, -17980, 7468, -17679}, + []int{-1781, -9654, -1733, -9194}, + []int{4881, 1771, 4969, 2535}, + []int{18082, -19623, 19159, -19539}, + []int{7601, 8466, 10246, 8909}, + []int{14120, -384, 14213, 640}, + []int{-12130, 6122, -12089, 7721}, + []int{-9840, -19539, -9573, -19431}, + []int{-14784, -4715, -13417, -4197}, + []int{-5208, 214, -5069, 529}, + []int{-1445, 1118, -494, 1258}, + []int{7029, 253, 7081, 529}, + []int{7081, -11138, 7468, -9654}, + []int{14120, 20666, 15348, 20990}, + []int{15884, -1944, 16316, -718}, + []int{4881, 12140, 4969, 13271}, + []int{-17318, -19142, -17182, -18801}, + []int{-19623, 9585, -19523, 10212}, + []int{16517, 19886, 17684, 20150}, + []int{11022, -19623, 11901, -19431}, + []int{13398, -4197, 14213, -4004}, + []int{8035, -17791, 8968, -16113}, + []int{-10921, -2909, -10193, -1090}, + []int{18000, -3101, 18082, -2767}, + []int{-18795, -1944, -18739, -1090}, + []int{-7786, 5076, -6145, 5977}, + []int{-5208, -13413, -5144, -9406}, + []int{6728, -18801, 7029, -18767}, + []int{13108, -8859, 14213, -8111}, + []int{13398, -16501, 14120, -16147}, + []int{3505, 1665, 4393, 3262}, + []int{3505, -3052, 3621, -1977}, + []int{-10309, 3970, -9840, 4164}, + []int{-18464, -4871, -17182, -4715}, + []int{-9448, 5076, -9161, 6634}, + []int{13830, 4771, 14213, 5076}, + []int{-18486, 5076, -18015, 5977}, + []int{-3758, -654, -3217, 214}, + []int{11526, 1771, 11901, 2113}, + []int{-18739, -1977, -18486, -1346}, + []int{7029, -19431, 7468, -18801}, + []int{8935, -19623, 10303, -19539}, + []int{16316, 3970, 17021, 5076}, + []int{-3883, 17169, -3707, 17732}, + []int{-5354, -5235, -4681, -5000}, + []int{15884, -2909, 17021, -1977}, + []int{-9161, -13457, -7538, -13413}, + []int{-3933, 18439, -3883, 19870}, + []int{-4681, 16862, -3982, 17536}, + []int{-14535, 13095, -13424, 13271}, + []int{-3707, 14710, -3065, 15013}, + []int{-14470, 19886, -13424, 20150}, + []int{-11919, 3953, -11610, 4793}, + []int{-14470, 2113, -13921, 3858}, + []int{-4485, 4785, -3982, 6122}, + []int{13398, -5462, 14120, -5235}, + []int{-7786, 529, -7538, 640}, + []int{-5208, -17791, -5069, -17630}, + []int{-17180, 6122, -15428, 6233}, + []int{-19623, -9654, -19523, -9469}, + []int{-12960, -6552, -12748, -5235}, + []int{8035, -9404, 10246, -7636}, + []int{-14835, -17679, -14784, -16734}, + []int{19084, 4771, 19584, 4785}, + []int{-594, -3052, -494, -2767}, + []int{3505, 4548, 3832, 4771}, + []int{-17182, 16423, -17180, 17536}, + []int{-7899, 5076, -7786, 5977}, + []int{-5069, -6552, -4918, -5468}, + []int{-18809, -1090, -18464, -1044}, + []int{12689, -3101, 13398, -2767}, + []int{3621, 9729, 3832, 10039}, + []int{3505, 19886, 4819, 20666}, + []int{-145, 13271, 300, 15308}, + []int{13398, -4004, 14213, -3895}, + []int{-12160, -1944, -12130, -1044}, + []int{-11919, 4793, -11610, 6634}, + []int{8935, -9469, 9781, -9404}, + []int{-15236, 15061, -14784, 15308}, + []int{-12748, -11138, -11919, -9654}, + []int{-12960, -2909, -12130, -2767}, + []int{-7538, -19539, -6999, -19431}, + []int{7601, -15085, 8968, -14828}, + []int{-16900, -5468, -15236, -5299}, + []int{-19800, 3262, -19527, 4548}, + []int{6728, -4715, 6801, -3052}, + []int{-7786, 11103, -7538, 11785}, + []int{19084, -4197, 19159, -4004}, + []int{14668, -14704, 14804, -13413}, + []int{-18015, 2535, -17180, 3262}, + []int{-5208, 7038, -4681, 7061}, + []int{-2015, 1494, -1696, 2535}, + []int{8935, 9733, 10646, 10039}, + []int{-9828, 18654, -9803, 19343}, + []int{8935, -19709, 10646, -19623}, + []int{-9890, 16423, -9840, 17169}, + []int{-12130, 10039, -12089, 10359}, + []int{-16393, -19539, -15861, -19431}, + []int{-145, 12140, 569, 12755}, + []int{11022, -19141, 11901, -18801}, + []int{-3217, 15308, -2802, 15683}, + []int{-3065, -16113, -2802, -14704}, + []int{5266, -11138, 5330, -9406}, + []int{-9828, 214, -9161, 529}, + []int{-4681, 15308, -4485, 16423}, + []int{4969, 5977, 5183, 6233}, + []int{-19421, -1944, -18795, -1346}, + []int{-15861, -19878, -14992, -19623}, + []int{-12089, -14279, -11610, -11264}, + []int{19159, 19808, 19299, 20666}, + []int{19159, 5977, 19992, 7061}, + []int{-5208, -16147, -5069, -14704}, + []int{14668, 15784, 14804, 16478}, + []int{-3707, 6122, -3065, 6233}, + []int{-13095, 4771, -12960, 4785}, + []int{14120, -16501, 14213, -16113}, + []int{-9890, -3649, -9828, -2909}, + []int{-12089, 13595, -11610, 14471}, + []int{-16900, -5299, -16393, -4871}, + []int{6801, -8859, 7029, -8111}, + []int{-1445, -1090, -594, -718}, + []int{7029, -17791, 7081, -17679}, + []int{1603, -6569, 1972, -6552}, + []int{-18739, 1258, -18486, 1494}, + []int{11901, -16501, 13398, -16147}, + []int{6801, 640, 7601, 1384}, + []int{-14470, 11103, -13417, 11137}, + []int{-13095, -18801, -12951, -18539}, + []int{5757, -11264, 7029, -9654}, + []int{-19421, -5468, -18809, -5462}, + []int{-3982, -3052, -3933, -2909}, + []int{-13417, -7636, -12960, -7020}, + []int{10646, 6233, 11012, 7038}, + []int{19299, -16501, 19584, -14828}, + []int{-2015, 4263, -1445, 4548}, + []int{17021, 14710, 19159, 15013}, + []int{-16326, -19142, -15236, -19141}, + []int{8139, -3052, 9781, -1977}, + []int{-16393, -19623, -15861, -19539}, + []int{4969, -5235, 5330, -4197}, + []int{7081, -18801, 8935, -18767}, + []int{-9448, -19431, -7538, -19142}, + []int{-15428, 3858, -15236, 4771}, + []int{-9448, -17630, -9161, -16655}, + []int{-5354, 15308, -5208, 16423}, + []int{-19800, -1044, -19623, -390}, + []int{-12089, 10039, -11919, 10369}, + []int{-12809, 15784, -12130, 16478}, + []int{-5144, -4197, -5069, -3895}, + []int{-6927, -19623, -6145, -19515}, + []int{15348, 11785, 15689, 13095}, + []int{15884, -1977, 16316, -1944}, + []int{3505, 1118, 4393, 1494}, + []int{8968, 640, 10246, 1384}, + []int{8139, -1346, 9781, -718}, + []int{300, 15308, 1603, 15683}, + []int{12689, 20666, 13108, 20990}, + []int{-10309, 5618, -10193, 7721}, + []int{7328, 9585, 7468, 10369}, + []int{-15428, 12998, -14992, 13095}, + []int{-6145, -5000, -5144, -4197}, + []int{-3933, 11137, -3596, 12140}, + []int{7081, -4197, 7328, -3101}, + []int{16517, 5618, 17021, 6233}, + []int{-15428, 13095, -14784, 13271}, + []int{19084, 9585, 19299, 9729}, + []int{-14535, 3858, -13921, 3953}, + []int{10646, 10865, 11012, 11785}, + []int{4969, -1944, 5183, -1090}, + []int{-12748, -5462, -11919, -5235}, + []int{-15236, 6233, -14992, 7038}, + []int{-13424, 3858, -13095, 3953}, + []int{16099, -19878, 16316, -19709}, + []int{-10921, -11264, -10867, -9194}, + []int{-3758, 20150, -3596, 20990}, + []int{-2015, 7038, -1781, 7825}, + []int{-1781, -19878, -1445, -19623}, + []int{-4918, 529, -3883, 803}, + []int{-14992, 529, -14835, 1118}, + []int{5266, -18767, 5330, -18539}, + []int{18082, -19141, 19084, -18767}, + []int{-3982, -19623, -3933, -19515}, + []int{5183, 12998, 5330, 13095}, + []int{-12809, 1771, -12130, 2113}, + []int{-18739, -5299, -18486, -4871}, + []int{19584, 3262, 19992, 3858}, + []int{-10309, 1384, -9890, 1771}, + []int{-14535, 6122, -13921, 6233}, + []int{-7899, -19709, -5354, -19623}, + []int{7601, 13095, 10246, 13595}, + []int{8139, 9729, 8935, 10359}, + []int{19299, -6714, 19584, -5462}, + []int{9781, 18439, 10303, 19870}, + []int{12654, 9585, 13108, 10039}, + []int{-10309, 18654, -9890, 19886}, + []int{1972, -19709, 2714, -19515}, + []int{-9803, 16862, -6999, 17169}, + []int{-19623, 5618, -18809, 5977}, + []int{10246, 14710, 11012, 15308}, + []int{-11610, 4548, -10921, 6233}, + []int{-11919, -9469, -10921, -9406}, + []int{-4485, -19878, -3982, -19515}, + []int{-2344, 4164, -1781, 4263}, + []int{14100, 11103, 14213, 11785}, + []int{11022, -6569, 12654, -6552}, + []int{5330, 10212, 5757, 10400}, + []int{-7538, -11595, -6999, -11138}, + []int{-17182, -14704, -17180, -14389}, + []int{-9161, 11785, -7786, 12998}, + []int{7328, -16501, 7601, -16147}, + []int{4393, -1944, 4819, -1346}, + []int{-17180, -3649, -16900, -3052}, + []int{-9161, -9404, -7899, -8859}, + []int{-7538, 1494, -5208, 3262}, + []int{-9803, 11785, -9448, 12755}, + []int{-19523, -2909, -19421, -2767}, + []int{-2344, -654, -2139, -390}, + []int{-13095, 8466, -13057, 8909}, + []int{11526, 18654, 12654, 19112}, + []int{-12951, 13595, -12809, 15308}, + []int{12689, 19870, 13398, 20666}, + []int{11022, 19870, 11526, 20150}, + []int{-3883, 4263, -3758, 4785}, + []int{-15236, 1771, -14835, 2113}, + []int{-10921, -7020, -10867, -6552}, + []int{7328, -14389, 8968, -14279}, + []int{-9573, -5000, -9161, -4715}, + []int{-1696, 11103, -1609, 12140}, + []int{-19623, 13595, -18795, 14471}, + []int{-2344, 4548, -2139, 4785}, + []int{-145, -5235, 569, -4004}, + []int{-3596, 12140, -2802, 12755}, + []int{-6145, 11103, -5354, 11785}, + []int{-3758, -5462, -3596, -5299}, + []int{-14470, -16147, -13921, -15085}, + []int{-18015, 1771, -17182, 2535}, + []int{19299, -19515, 19992, -19142}, + []int{-12160, -5000, -11610, -4715}, + []int{-18486, 253, -17442, 529}, + []int{-5354, 15061, -5208, 15308}, + []int{-2139, 10359, -2015, 10400}, + []int{-7538, 3262, -6999, 3953}, + []int{-13424, -6569, -12809, -6552}, + []int{3007, 16423, 3505, 17536}, + []int{11526, 19343, 12689, 19870}, + []int{-6927, 14710, -6145, 15013}, + []int{13108, 7721, 13398, 9005}, + []int{-13921, -9194, -13424, -8859}, + []int{4393, 20666, 6801, 20990}, + []int{18000, -18767, 18082, -18539}, + []int{-145, 18166, 300, 18654}, + []int{-2802, -18801, -1696, -18767}, + []int{6801, 18166, 7468, 18439}, + []int{-10193, -2767, -9890, -1044}, + []int{-3758, 6122, -3707, 6634}, + []int{-12130, 14710, -12089, 16478}, + []int{7468, 19112, 7601, 19343}, + []int{3832, -19431, 4393, -18539}, + []int{11022, 20150, 11526, 20990}, + []int{-14835, 13595, -14784, 14710}, + []int{5330, -5235, 6403, -5000}, + []int{12654, -14389, 12689, -14279}, + []int{15689, -14389, 16099, -13413}, + []int{-9573, -16734, -9448, -16655}, + []int{-17182, 17536, -16900, 17732}, + []int{-14535, -4004, -13921, -3649}, + []int{-7538, 9005, -6145, 9729}, + []int{-145, -9404, 518, -8859}, + []int{-10867, 1494, -10309, 2535}, + []int{12654, 5618, 12689, 6233}, + []int{-14992, 19886, -14835, 20990}, + []int{-3065, -6714, -2796, -6552}, + []int{-1445, 4785, -494, 4793}, + []int{-9161, -8859, -7786, -7636}, + []int{-14835, 10853, -14784, 12140}, + []int{-3707, -11138, -3596, -9469}, + []int{-19527, 10369, -19421, 10853}, + []int{13108, 12755, 13398, 13271}, + []int{-9803, -4197, -9161, -4004}, + []int{-494, -18801, -145, -18539}, + []int{7468, 1665, 8139, 2113}, + []int{-18015, -19878, -16393, -19539}, + []int{3007, 1258, 3505, 1494}, + []int{-3982, 9005, -3883, 9733}, + []int{-16326, 10212, -15861, 10359}, + []int{-9803, -15085, -9573, -14389}, + []int{-3707, 2113, -3065, 2535}, + []int{-15861, 16478, -15428, 17536}, + []int{-14835, 7825, -14535, 9729}, + []int{7328, 14471, 8035, 15013}, + []int{15884, -5235, 16099, -4004}, + []int{-12809, -19878, -11919, -19709}, + []int{4819, -4004, 5183, -3649}, + []int{-15861, 10359, -15428, 10728}, + []int{-2796, 803, -2015, 1118}, + []int{18000, -19142, 19584, -19141}, + []int{-6927, 9733, -6145, 10212}, + []int{569, 10039, 1080, 10212}, + []int{-3758, 19870, -3596, 20150}, + []int{2714, 20150, 3007, 20990}, + []int{16099, 11103, 16316, 11137}, + []int{1080, -6552, 1603, -4715}, + []int{-14470, 15308, -13424, 16862}, + []int{-18795, -3649, -17318, -3101}, + []int{3007, 6122, 3505, 6233}, + []int{-19800, 15013, -19523, 15784}, + []int{11012, 19112, 11526, 19343}, + []int{6728, 640, 6801, 1384}, + []int{-9840, -14279, -9828, -13365}, + []int{-13921, 14710, -13095, 15013}, + []int{-9803, 18166, -7899, 18439}, + []int{-4485, -17679, -3933, -17630}, + []int{-16393, 1384, -16326, 1494}, + []int{7081, 529, 7468, 640}, + []int{15884, 1494, 16099, 1771}, + []int{-145, -3895, 1080, -3101}, + []int{7328, -14828, 7601, -14389}, + []int{1080, 15784, 3505, 16423}, + []int{-3707, -9469, -2796, -9406}, + []int{13398, 5618, 13830, 5977}, + []int{-3596, 214, -3217, 529}, + []int{7328, 3858, 7468, 4263}, + []int{12654, -14568, 13108, -14389}, + []int{-9448, 6634, -9161, 7199}, + []int{-4485, -5462, -3933, -5000}, + []int{3007, 6233, 3621, 6634}, + []int{1603, 10369, 3007, 10400}, + []int{5757, 10865, 7029, 11137}, + []int{-14470, 1665, -13057, 1771}, + []int{-12951, 18166, -12809, 18439}, + []int{8935, 20150, 10646, 20990}, + []int{-18795, -11264, -18739, -11138}, + []int{18082, -11264, 19299, -11138}, + []int{7328, 15013, 7468, 15683}, + []int{-14992, 10728, -14470, 10853}, + []int{-12089, -1346, -11919, -1090}, + []int{1080, -19623, 1603, -19539}, + []int{-14535, 9585, -14470, 10039}, + []int{-11610, -14279, -10921, -13457}, + []int{-594, 15308, -494, 16423}, + []int{-3933, 4164, -3758, 4263}, + []int{14213, -390, 14668, 214}, + []int{7601, 13595, 8035, 14471}, + []int{11901, 15784, 12689, 16423}, + []int{300, 16862, 518, 19112}, + []int{-3217, 5076, -3065, 5977}, + []int{14804, -6714, 15689, -6569}, + []int{-10309, 4263, -7899, 4548}, + []int{-12748, -16113, -12160, -14568}, + []int{-3933, -17679, -2802, -17630}, + []int{-15236, 16478, -14992, 16862}, + []int{-5208, 1384, -5069, 2113}, + []int{-3933, -19431, -3883, -17791}, + []int{-19800, -7020, -19623, -6714}, + []int{-13057, 10865, -12160, 11103}, + []int{-494, -14389, 300, -14279}, + []int{13398, 12755, 13830, 13095}, + []int{19299, -16655, 19992, -16501}, + []int{-19623, 4548, -19527, 4771}, + []int{4881, 10359, 5266, 10400}, + []int{-594, 16423, -145, 16862}, + []int{-3707, 19112, -3217, 19870}, + []int{3832, -6714, 4969, -6569}, + []int{8139, -1977, 9781, -1346}, + []int{9781, 5618, 10246, 6233}, + []int{-1733, 14710, -1609, 15308}, + []int{15689, -4715, 15884, -3101}, + []int{11526, -9404, 11901, -9194}, + []int{10303, 19343, 10646, 19886}, + []int{5183, -3895, 6728, -3649}, + []int{-3883, -9404, -3217, -9194}, + []int{-18795, 19886, -18015, 20150}, + []int{-9448, 10728, -9161, 10865}, + []int{-16326, -3052, -15861, -2909}, + []int{14120, -5468, 14804, -5000}, + []int{10246, 10359, 10303, 10369}, + []int{-14535, 10039, -14470, 10728}, + []int{-12951, 214, -12748, 253}, + []int{-7538, -2909, -6927, -1977}, + []int{-594, -1044, -494, -654}, + []int{300, 1258, 518, 2113}, + []int{-3933, -16147, -3065, -16113}, + []int{1603, 6122, 1972, 7038}, + []int{-13417, 9005, -13057, 9585}, + []int{6801, -13457, 7081, -13365}, + []int{18082, -9654, 19159, -9469}, + []int{-14835, 15308, -14535, 15784}, + []int{7468, -1977, 7601, -1090}, + []int{10646, -11138, 11022, -9654}, + []int{-12130, 18654, -11919, 19112}, + []int{14213, 11137, 15241, 11785}, + []int{4393, 17536, 4819, 18166}, + []int{1080, 15683, 2714, 15784}, + []int{-5208, -6569, -3933, -6552}, + []int{1080, -4715, 1972, -3895}, + []int{10646, -9469, 11012, -7636}, + []int{-12089, 15013, -11919, 15061}, + []int{-17182, -19142, -16393, -19141}, + []int{-13095, 3970, -13057, 4771}, + []int{13830, 15784, 14120, 16423}, + []int{-9161, 1258, -7899, 1665}, + []int{-3883, 4785, -3758, 5076}, + []int{-5144, -6552, -5069, -5462}, + []int{-13424, -7020, -12130, -6714}, + []int{-2802, 1258, -2796, 1494}, + []int{19009, -6569, 19299, -6552}, + []int{19299, -18801, 19992, -18767}, + []int{5266, -14568, 5757, -14389}, + []int{-13417, -19623, -13095, -19431}, + []int{9781, -3649, 10246, -1044}, + []int{-1696, -9654, -594, -9469}, + []int{19084, -5462, 19159, -4715}, + []int{-1781, -18539, -1445, -17791}, + []int{-13057, 3858, -12960, 3970}, + []int{6801, -14389, 7328, -14279}, + []int{12689, 16423, 14120, 16478}, + []int{-11919, 10400, -11610, 11137}, + []int{-3982, 10865, -3933, 11103}, + []int{-10921, -3895, -10193, -3101}, + []int{-9890, -9404, -9840, -7020}, + []int{18000, -6569, 19009, -6552}, + []int{-1696, 12998, -1609, 13271}, + []int{-9890, 3858, -9840, 3970}, + []int{-10309, 1771, -10193, 2535}, + []int{-10921, 5977, -10867, 6634}, + []int{13830, -19878, 14100, -19709}, + []int{-13095, -14279, -13057, -13413}, + []int{10646, -19141, 11022, -18801}, + []int{18082, 19886, 19159, 20150}, + []int{-1445, 2535, -145, 3262}, + []int{518, -14828, 1603, -14279}, + []int{518, 8466, 2714, 9585}, + []int{12654, -11595, 13108, -11138}, + []int{16316, 19112, 16517, 20666}, + []int{-19800, -19141, -19623, -16655}, + []int{7081, 8909, 8139, 9005}, + []int{-12748, -17980, -12130, -17791}, + []int{-14784, -16147, -14470, -16113}, + []int{11012, 19343, 11022, 19808}, + []int{15689, 15784, 15884, 16423}, + []int{-17442, 9733, -17318, 10359}, + []int{11901, -19515, 13398, -19142}, + []int{17684, 6634, 18082, 7061}, + []int{-9840, -7636, -9828, -6714}, + []int{7601, -14828, 8035, -14704}, + []int{16099, 1258, 16316, 1665}, + []int{-14535, -14279, -14470, -13457}, + []int{-9828, 2535, -9803, 3858}, + []int{-2139, 17536, -1609, 17732}, + []int{-5144, -18801, -4681, -18767}, + []int{5757, 640, 6403, 803}, + []int{-594, 4771, -494, 4785}, + []int{-3982, 16862, -3883, 17536}, + []int{-18809, 3262, -18015, 3858}, + []int{-10309, -384, -9840, 214}, + []int{-12089, 6122, -11919, 7199}, + []int{3505, -11264, 3832, -11138}, + []int{-14784, 5977, -14535, 6122}, + []int{-9828, 18166, -9803, 18654}, + []int{11012, -3649, 11022, -3052}, + []int{-145, -19515, 569, -18801}, + []int{-6927, -14568, -5354, -13457}, + []int{7328, -9654, 8139, -9469}, + []int{-13057, 1665, -12960, 1771}, + []int{-15428, 10039, -15236, 10212}, + []int{6801, 5618, 7029, 5977}, + []int{-19527, 7199, -18795, 8466}, + []int{-13057, -11138, -12809, -9654}, + []int{569, 16478, 1080, 18166}, + []int{7601, -17630, 8035, -16113}, + []int{-2802, 19112, -2796, 19343}, + []int{-2139, -4197, -2015, -2909}, + []int{10246, 529, 10303, 640}, + []int{-15861, 4793, -15428, 6122}, + []int{14100, 5977, 14213, 6122}, + []int{7081, -5235, 7328, -5000}, + []int{19084, 10728, 19159, 10865}, + []int{518, 7825, 1080, 8466}, + []int{5330, 2535, 5757, 3262}, + []int{-16900, 15784, -16326, 16423}, + []int{-13921, -18767, -13424, -17791}, + []int{-17318, -14568, -17182, -14389}, + []int{15884, -6552, 16099, -5235}, + []int{-14835, 19112, -14470, 19870}, + []int{-15236, -6569, -14992, -6552}, + []int{-2802, 13271, -2796, 14710}, + []int{-5354, -16655, -5208, -16147}, + []int{14120, 10865, 14213, 11103}, + []int{-19800, 14710, -19527, 15013}, + []int{14213, -14704, 14668, -14568}, + []int{3007, 4548, 3505, 5618}, + []int{-3883, -19709, -3758, -19539}, + []int{-1696, 18439, -1609, 18654}, + []int{7081, 10212, 7328, 10369}, + []int{-594, 13271, -145, 13595}, + []int{-19623, 7038, -19527, 8466}, + []int{8968, 14710, 10246, 15061}, + []int{-13057, 3970, -12160, 4164}, + []int{3832, 6233, 4969, 7061}, + []int{-14470, 5977, -13921, 6122}, + []int{-1445, -390, -594, 214}, + []int{5266, 1258, 5757, 1494}, + []int{-3707, 7199, -3596, 7825}, + []int{-145, -18801, 1080, -18767}, + []int{10646, -13457, 11022, -11595}, + []int{-10309, 4164, -9840, 4263}, + []int{-14835, -19539, -14535, -19515}, + []int{1080, -17791, 2714, -16655}, + []int{5330, 640, 5757, 1118}, + []int{14804, -16147, 15241, -15085}, + []int{-4681, 1258, -3933, 1384}, + []int{-13057, -14568, -12160, -14389}, + []int{11022, -19431, 11526, -19141}, + []int{-12951, 640, -12130, 803}, + []int{-5208, 17169, -5144, 17732}, + []int{11526, -5000, 12654, -3101}, + []int{-13095, 13595, -12951, 14471}, + []int{3621, -2909, 3832, -2767}, + []int{-13057, 2535, -12160, 3262}, + []int{-1609, 15061, -1445, 15308}, + []int{-12130, -1944, -12089, -1346}, + []int{-5069, 253, -3883, 529}, + []int{-3217, -19539, -2015, -19515}, + []int{10303, -3649, 10646, -3052}, + []int{18082, 10359, 19009, 10400}, + []int{14804, 3970, 15241, 4263}, + []int{7468, 19808, 8035, 19870}, + []int{2714, -17630, 3007, -16655}, + []int{10646, 1258, 12654, 1384}, + []int{-18809, -6552, -18486, -5462}, + []int{-2015, 529, -1781, 1494}, + []int{-14470, 11137, -13921, 13095}, + []int{4393, -11595, 4819, -11264}, + []int{-494, 11785, -145, 12755}, + []int{-10921, -14389, -9840, -14279}, + []int{518, -8111, 569, -5468}, + []int{-2015, 10853, -1696, 11103}, + []int{2714, -15085, 3505, -14704}, + []int{7601, -19878, 8035, -19142}, + []int{13830, 5618, 14213, 5977}, + []int{1972, 19870, 3621, 19886}, + []int{13398, -19709, 14100, -19623}, + []int{8139, -3895, 8935, -3649}, + []int{-19800, -4715, -19527, -4004}, + []int{2714, -384, 3621, 253}, + []int{1972, 18166, 2714, 19343}, + []int{12689, 6122, 13108, 6233}, + []int{14668, -13365, 15241, -11264}, + []int{2714, -9406, 3621, -9404}, + []int{-12960, 14710, -12951, 15308}, + []int{15689, 16423, 15884, 16862}, + []int{4881, -718, 4969, -390}, + []int{-3883, -6569, -3758, -6552}, + []int{-10921, 4785, -10867, 5618}, + []int{-1781, -19623, -145, -19539}, + []int{-17442, 19808, -17182, 19870}, + []int{3007, 5618, 3505, 6122}, + []int{-494, -3052, 300, -2767}, + []int{4969, -6714, 5183, -6569}, + []int{4393, -18539, 4819, -17980}, + []int{-10867, 1384, -10309, 1494}, + []int{-14835, -9404, -14784, -8859}, + []int{4819, -4197, 5330, -4004}, + []int{-5144, -5000, -5069, -4715}, + []int{-5208, -4004, -5144, -3895}, + []int{18000, -3895, 18082, -3101}, + []int{-10309, -4004, -10193, -3895}, + []int{19084, 20150, 19159, 20666}, + []int{-13921, -4004, -13424, -3052}, + []int{4969, 253, 5266, 803}, + []int{-1733, -14568, -494, -14389}, + []int{6403, 10853, 6801, 10865}, + []int{19084, -11595, 19299, -11264}, + []int{-7786, 13595, -6927, 14471}, + []int{-12130, -3649, -12089, -1977}, + []int{17021, 13271, 17684, 14471}, + []int{-7786, 20150, -7538, 20990}, + []int{13830, -1044, 14100, -654}, + []int{-9573, 11103, -9161, 11785}, + []int{-13424, -6714, -13417, -6569}, + []int{-9803, -14389, -7786, -14279}, + []int{8935, 17169, 8968, 18166}, + []int{-19523, 19343, -18809, 19870}, + []int{-13424, 4785, -13417, 4793}, + []int{-19623, 5977, -19421, 6233}, + []int{1972, 19343, 2714, 19808}, + []int{-10921, -3052, -9890, -2909}, + []int{8935, 10039, 9781, 10359}, + []int{6728, -19141, 7029, -18801}, + []int{-19800, 5076, -19523, 5618}, + []int{-19800, 16862, -19623, 17169}, + []int{-19800, -3101, -19623, -3052}, + []int{-5208, -7636, -5144, -6569}, + []int{-10867, 6233, -10309, 6634}, + []int{8139, -11138, 9781, -9654}, + []int{-19623, 10212, -19523, 10359}, + []int{-19800, 8466, -19623, 8909}, + []int{-2139, 3858, -2015, 4164}, + []int{-3883, 20150, -3758, 20990}, + []int{15348, -9406, 15884, -9404}, + []int{8035, -14828, 8139, -14389}, + []int{8968, 16478, 10246, 18166}, + []int{-5354, -4197, -5208, -3895}, + []int{-1696, -9469, 300, -9406}, + []int{-19800, -19142, -19623, -19141}, + []int{-11919, 3262, -11610, 3858}, + []int{-18486, 15683, -17442, 16478}, + []int{-13417, -13457, -13095, -13413}, + []int{-19800, -19623, -19623, -19142}, + []int{-2139, -5235, -2015, -4197}, + []int{-10193, -2909, -9828, -2767}, + []int{4393, -390, 4969, -384}, + []int{13398, -19539, 14100, -19142}, + []int{-3758, 1258, -3065, 1384}, + []int{-19527, -718, -19523, -384}, + []int{-13095, 17169, -13057, 18166}, + []int{19009, -14568, 19084, -14389}, + []int{10246, -16501, 10646, -15085}, + []int{3007, 13595, 3505, 15013}, + []int{-5208, -14704, -5069, -14568}, + []int{-5144, 12140, -5069, 12755}, + []int{-17182, 10400, -16900, 10865}, + []int{-3217, -19141, -2139, -18801}, + []int{7081, 15061, 7328, 15308}, + []int{-19523, -4871, -19421, -4715}, + []int{5757, 19112, 6403, 19343}, + []int{-18015, 12998, -17442, 14471}, + []int{-2139, -16113, -1781, -14828}, + []int{17021, 5977, 18082, 6634}, + []int{-7786, -8859, -5354, -8111}, + []int{17021, 12755, 17684, 12998}, + []int{-12160, -16501, -12130, -16147}, + []int{6403, -16734, 6801, -16501}, + []int{19159, -9404, 19299, -8111}, + []int{19299, -8859, 19584, -6714}, + []int{15241, 10400, 15348, 10728}, + []int{-14992, -3052, -14835, -2909}, + []int{-19421, -18801, -18795, -17791}, + []int{-19800, -16655, -19623, -14828}, + []int{5757, -9654, 6403, -9404}, + []int{-594, -16147, -494, -14568}, + []int{-5069, 6634, -4918, 7038}, + []int{-17442, -6714, -17182, -5468}, + []int{7328, -9469, 8935, -9406}, + []int{19299, -5462, 19584, -5235}, + []int{4881, -11264, 4969, -9406}, + []int{-12809, -6714, -12748, -6552}, + []int{18000, -18539, 18082, -17630}, + []int{-1781, 214, -1733, 253}, + []int{-17442, 8909, -17318, 9005}, + []int{11526, -9194, 11901, -8859}, + []int{-10193, -19539, -9890, -19431}, + []int{-18486, 1384, -18015, 1494}, + []int{5183, 13271, 5266, 14710}, + []int{-19527, -14389, -19421, -11595}, + []int{-4485, -7636, -3883, -7020}, + []int{-12960, -2767, -12130, -1977}, + []int{8935, 10359, 8968, 11137}, + []int{-2796, -9469, -1781, -9406}, + []int{-5144, -17980, -5069, -17791}, + []int{-12130, 4263, -12089, 4548}, + []int{-1733, -9406, -1445, -9194}, + []int{-3883, 12998, -3707, 13095}, + []int{-9448, 11785, -9161, 12998}, + []int{-1733, 7721, 300, 7825}, + []int{3505, 3283, 3832, 3858}, + []int{-6145, 3858, -5208, 4164}, + []int{6801, 7825, 7029, 8466}, + []int{6801, -4197, 7081, -3895}, + []int{-7786, -11595, -7538, -9469}, + []int{-18464, 3970, -18015, 4164}, + []int{-3933, -16501, -3883, -16147}, + []int{4819, -3101, 4881, -3052}, + []int{-14992, 9733, -14835, 10400}, + []int{-14470, -19709, -13424, -19623}, + []int{-16326, 19886, -14992, 20150}, + []int{-3758, -19623, -3596, -19539}, + []int{1080, -3895, 1603, -3101}, + []int{-2796, 1665, -2015, 2113}, + []int{5757, 2535, 6403, 3858}, + []int{1080, -18539, 2714, -17791}, + []int{-14784, 14710, -13921, 15013}, + []int{-19623, -11264, -19421, -11138}, + []int{-18809, -11264, -18795, -11138}, + []int{7029, -5462, 7081, -5235}, + []int{-494, 18654, -145, 19343}, + []int{-12809, -384, -12748, 214}, + []int{-2796, -19431, -2015, -19142}, + []int{-16393, -14279, -15428, -13457}, + []int{6728, -19878, 7468, -19709}, + []int{6403, 10212, 7081, 10359}, + []int{-12951, -19141, -12748, -18539}, + []int{-494, 2113, -145, 2535}, + []int{-18739, 7721, -18015, 8466}, + []int{-9840, 1118, -9828, 1494}, + []int{7468, 529, 7601, 640}, + []int{14213, 7721, 14668, 8909}, + []int{-3982, 4771, -3933, 5076}, + []int{-2796, -5235, -2139, -4715}, + []int{19299, -11595, 19584, -9194}, + []int{-10867, -654, -10309, -384}, + []int{-13417, 13271, -13095, 14471}, + []int{-19623, 19112, -18809, 19343}, + []int{11526, -3101, 12689, -2909}, + []int{-13424, 19112, -13417, 20666}, + []int{-14835, -14704, -14784, -14568}, + []int{10303, -13413, 10646, -11595}, + []int{9781, -1044, 10646, -654}, + []int{-6927, 4771, -6145, 5076}, + []int{14668, -4197, 14804, -3895}, + []int{15348, 214, 15689, 1118}, + []int{-2139, 1118, -2015, 1258}, + []int{17021, -19709, 17684, -19539}, + []int{-2802, 3970, -2796, 4164}, + []int{13108, 15061, 13398, 16423}, + []int{-2802, -18767, -2796, -18539}, + []int{18000, -11264, 18082, -11138}, + []int{13108, 11103, 13398, 11785}, + []int{-10193, -654, -9890, -390}, + []int{-18795, -14828, -18739, -14568}, + []int{-1781, 7721, -1733, 8466}, + []int{18082, -14389, 19084, -14279}, + []int{-9573, -5299, -9448, -5235}, + []int{-12160, -19431, -12089, -19141}, + []int{19159, -6552, 19299, -5468}, + []int{6728, -19431, 7029, -19141}, + []int{-10921, -13365, -10867, -11730}, + []int{14100, -390, 14213, -384}, + []int{-18739, 253, -18486, 529}, + []int{-9161, -9469, -7899, -9404}, + []int{12689, -19878, 13398, -19623}, + []int{4969, 11137, 5330, 11785}, + []int{-16900, -13457, -15428, -13413}, + []int{-19623, 1384, -19523, 2113}, + []int{1603, 3283, 1972, 3970}, + []int{-18464, 16478, -17442, 17169}, + []int{-9840, 16862, -9803, 17732}, + []int{-3065, 803, -2802, 1118}, + []int{15241, -5468, 15348, -4715}, + []int{-5208, -9194, -5144, -8111}, + []int{19584, -14568, 19992, -13413}, + []int{-5208, -384, -5069, 214}, + []int{-2139, 2535, -2015, 3283}, + []int{-3707, -2767, -3596, -1944}, + []int{-5354, -19878, -5208, -19515}, + []int{-12960, 14471, -12951, 14710}, + []int{-7538, -13413, -6999, -11730}, + []int{8968, 1494, 9781, 2113}, + []int{-6927, -13413, -5208, -13365}, + []int{-4485, -3895, -3883, -3649}, + []int{8935, -18801, 8968, -18767}, + []int{13398, 8909, 14668, 9005}, + []int{-594, -654, -494, -390}, + []int{9781, 1384, 11012, 1494}, + []int{5757, -6552, 6403, -5468}, + []int{-10921, 10039, -10309, 10212}, + []int{-3065, 14710, -2796, 15013}, + []int{8968, 1384, 9781, 1494}, + []int{-12130, -19709, -11919, -19431}, + []int{-7786, 803, -7538, 1494}, + []int{-7538, 3953, -6999, 3970}, + []int{14120, -3052, 14804, -2909}, + []int{8139, 14471, 8935, 15683}, + []int{-5354, -6552, -5208, -5299}, + []int{-1445, 3953, -594, 4263}, + []int{-12748, -19142, -12160, -19141}, + []int{-19800, -1944, -19421, -1346}, + []int{19009, -13365, 19084, -11595}, + []int{3505, 10865, 4393, 11137}, + []int{-3758, -6552, -3596, -5468}, + []int{-12748, 11103, -11919, 11137}, + []int{-2802, 15308, -1733, 15683}, + []int{-10867, 10865, -9890, 11103}, + []int{-10921, 10400, -10867, 11103}, + []int{-16900, -6552, -16393, -5468}, + []int{-1733, 15308, -594, 15683}, + []int{-494, -2767, 300, -1044}, + []int{-145, -8859, 569, -8111}, + []int{10646, -7020, 11012, -6569}, + []int{-16900, -14279, -16393, -13457}, + []int{14668, 10369, 15241, 10400}, + []int{-18486, -5299, -18464, -5235}, + []int{18082, 18654, 19299, 19112}, + []int{13108, -654, 13398, -390}, + []int{-9573, 12755, -9448, 13095}, + []int{12654, 10212, 13108, 10400}, + []int{-13921, -11730, -13417, -11595}, + []int{-12809, 18439, -12130, 18654}, + []int{-10867, 5618, -10309, 5977}, + []int{7328, -1944, 7468, -1090}, + []int{-12089, 3283, -11919, 4164}, + []int{-5354, 529, -4918, 640}, + []int{-19623, 6634, -19527, 7038}, + []int{-12748, -16501, -12160, -16113}, + []int{3832, 7061, 4969, 7199}, + []int{1080, -390, 1603, 253}, + []int{-9803, 2535, -9448, 3858}, + []int{10646, -2909, 11012, -1977}, + []int{8935, 13595, 9781, 14471}, + []int{6403, -4197, 6728, -3895}, + []int{-3596, 9733, -3065, 10039}, + []int{14100, 5076, 14213, 5618}, + []int{-2344, 4785, -2015, 4793}, + []int{-13417, -4715, -12960, -4197}, + []int{-10921, -3101, -9890, -3052}, + []int{7468, -11138, 7601, -9654}, + []int{-9890, -7020, -9840, -6569}, + []int{-2015, -16734, -1781, -16655}, + []int{14213, 17536, 14668, 17732}, + []int{-494, 4771, -145, 4785}, + []int{-14835, 4548, -14784, 4771}, + []int{15348, -18767, 18000, -18539}, + []int{11022, 15784, 11526, 16423}, + []int{8968, -9654, 10246, -9469}, + []int{-3596, -3649, -2139, -3052}, + []int{7468, 4771, 8035, 5076}, + []int{-17442, -11595, -17182, -11264}, + []int{10646, -390, 11901, -384}, + []int{15348, -3052, 16517, -2909}, + []int{4393, -16113, 4819, -14828}, + []int{-5354, 3283, -5208, 3858}, + []int{7468, 17732, 8139, 18166}, + []int{-18464, -6552, -17442, -5468}, + []int{2714, 5618, 3007, 7721}, + []int{2714, 1665, 3007, 1771}, + []int{-19800, 17732, -19623, 18166}, + []int{-7899, -3895, -7786, -3052}, + []int{-7786, -5468, -7538, -5299}, + []int{5183, 4263, 5266, 5618}, + []int{-9840, -15085, -9803, -14279}, + []int{1972, 17169, 2714, 17536}, + []int{-6999, 4785, -6927, 4793}, + []int{-19623, 4793, -19523, 5076}, + []int{-19421, 3262, -18809, 3283}, + []int{-5069, 16478, -4681, 16862}, + []int{-18015, 1665, -17182, 1771}, + []int{-13921, 4771, -13417, 4785}, + []int{-12748, -19709, -12160, -19142}, + []int{15348, -3101, 15884, -3052}, + []int{-12160, -19539, -12130, -19515}, + []int{-9161, -1090, -5208, -1044}, + []int{7328, 4548, 7468, 5076}, + []int{6801, 10728, 7029, 10853}, + []int{8968, -14389, 9781, -14279}, + []int{-6927, -5468, -6145, -5462}, + []int{-11919, -5299, -11610, -5000}, + []int{-7538, 10039, -6999, 10359}, + []int{5266, 3953, 5757, 3970}, + []int{3832, 17169, 4393, 18166}, + []int{19299, 7825, 19992, 8466}, + []int{-12960, 3858, -12951, 3953}, + []int{7029, -11264, 7081, -9654}, + []int{5266, -5468, 5330, -5235}, + []int{-2139, 1258, -2015, 1494}, + []int{-18739, 15683, -18486, 16478}, + []int{10646, -3649, 11012, -3052}, + []int{-3217, -19515, -3065, -19431}, + []int{15689, -718, 16316, -654}, + []int{15689, -16734, 15884, -16501}, + []int{14668, 16862, 15241, 17732}, + []int{19584, 5076, 19992, 5977}, + []int{-15236, -8111, -14992, -7636}, + []int{-7786, -17679, -7538, -16655}, + []int{19159, -16734, 19584, -16655}, + []int{-6999, -14568, -6927, -14279}, + []int{9781, 15784, 10246, 16478}, + []int{7468, 10728, 7601, 12755}, + []int{8968, 19870, 10303, 20150}, + []int{-11610, 16862, -10193, 17169}, + []int{-19800, 13095, -19421, 13271}, + []int{-6145, 529, -5354, 640}, + []int{3832, 6122, 4819, 6233}, + []int{-13095, 14471, -12960, 15061}, + []int{-3933, -14279, -3758, -13457}, + []int{7081, 11785, 7468, 12998}, + []int{4881, -19515, 4969, -19141}, + []int{-16326, 12755, -15861, 13271}, + []int{-9828, -5235, -9448, -5000}, + []int{-11919, 9005, -10867, 9585}, + []int{-19800, -390, -19623, 214}, + []int{4881, 9733, 4969, 10359}, + []int{-14784, 7199, -13424, 7721}, + []int{1972, -18801, 3832, -18767}, + []int{10246, 8466, 10303, 8909}, + []int{-10193, 16862, -9890, 17169}, + []int{-2139, 10400, -2015, 10853}, + []int{-14535, 15308, -14470, 16423}, + []int{14120, 15784, 14668, 16478}, + []int{-3883, 529, -3758, 803}, + []int{-15236, -19142, -14992, -18801}, + []int{7468, -7636, 10303, -7020}, + []int{-4918, 15308, -4681, 16478}, + []int{-6999, 12998, -5354, 13095}, + []int{518, 16423, 569, 17732}, + []int{7029, -4715, 7081, -4197}, + []int{15884, 18439, 17684, 18654}, + []int{12689, -14389, 13108, -14279}, + []int{-16900, -3649, -16326, -3052}, + []int{-3217, 803, -3065, 1118}, + []int{11526, -13457, 11901, -13365}, + []int{-16393, -4197, -16326, -4004}, + []int{4881, 10400, 4969, 10853}, + []int{5266, 14710, 5330, 15061}, + []int{10303, -11595, 10646, -11138}, + []int{-18809, 15683, -18739, 15784}, + []int{-9448, -390, -9161, -384}, + []int{-1781, -1346, -1696, -654}, + []int{-11919, -4715, -11610, -3895}, + []int{-3707, 12140, -3596, 12755}, + []int{-15861, -19539, -15428, -19515}, + []int{19299, 4263, 19584, 4771}, + []int{-5144, -19431, -4485, -19142}, + []int{-6927, 10212, -6145, 11103}, + []int{18000, -13365, 18082, -11730}, + []int{-2015, -14279, -1781, -11264}, + []int{19159, -19623, 19992, -19539}, + []int{-13921, 640, -13417, 803}, + []int{-13921, -14568, -13424, -14279}, + []int{12654, -16734, 13398, -16655}, + []int{-9840, -6714, -9828, -6569}, + []int{-12160, 10359, -12130, 10369}, + []int{14804, -5299, 15241, -4871}, + []int{-9161, -18539, -7899, -17630}, + []int{-16393, -5235, -15428, -5000}, + []int{-13057, -17630, -12960, -16655}, + []int{1972, 19808, 2714, 19870}, + []int{-3065, 5076, -2802, 5977}, + []int{-11610, 10369, -10867, 10400}, + []int{-5144, -14389, -4681, -14279}, + []int{6403, 16862, 6728, 17536}, + []int{4969, 7825, 5330, 8909}, + []int{569, 15683, 1080, 16423}, + []int{7468, 5618, 7601, 6233}, + []int{3505, -16734, 4393, -16655}, + []int{8139, -3649, 9781, -3101}, + []int{10646, 10853, 11022, 10865}, + []int{-12951, -6714, -12809, -6569}, + []int{-2802, 5076, -2344, 5618}, + []int{-14470, -3101, -13921, -3052}, + []int{2714, -6714, 3832, -6569}, + []int{4881, 16423, 5757, 16478}, + []int{7029, 7825, 7081, 8909}, + []int{19584, -16501, 19992, -14828}, + []int{7601, 11785, 8035, 13095}, + []int{-19623, -11138, -19523, -9654}, + []int{-5144, 19343, -5069, 19870}, + []int{19159, 13095, 19992, 13271}, + []int{-4485, -9406, -3982, -8859}, + []int{-12160, 2535, -12130, 3262}, + []int{-9803, -1346, -9573, -1090}, + []int{-14784, -4197, -14535, -3649}, + []int{-9448, -14279, -7899, -13457}, + []int{10246, -15085, 11022, -14828}, + []int{4393, 3970, 4881, 4263}, + []int{-6999, 16423, -5208, 16478}, + []int{-9828, 10369, -9803, 10400}, + []int{10646, -654, 11526, -390}, + []int{-9890, -5468, -9828, -5299}, + []int{-19623, 18439, -19523, 18654}, + []int{-12130, -4004, -12089, -3649}, + []int{15884, -6569, 18000, -6552}, + []int{14120, 1118, 14804, 1384}, + []int{14804, 16423, 15689, 16862}, + []int{-1733, 11103, -1696, 11785}, + []int{-9890, -1090, -9840, -1044}, + []int{-12748, -718, -12160, 529}, + []int{-18015, 10865, -17318, 11103}, + []int{-5144, -14568, -5069, -14389}, + []int{-19421, 1665, -18809, 2113}, + []int{-16326, 3283, -15236, 3858}, + []int{-5069, 19343, -4485, 19870}, + []int{19584, 640, 19992, 803}, + []int{-9840, -4004, -9828, -3649}, + []int{19159, 3262, 19299, 3283}, + []int{-3758, -3052, -3707, -2767}, + []int{-3707, 3262, -3596, 4263}, + []int{-3933, 8466, -3758, 9005}, + []int{-3707, -16734, -2796, -16655}, + []int{4819, 20150, 5183, 20666}, + []int{-6927, -2767, -5354, -1977}, + []int{518, 20666, 1080, 20990}, + []int{7328, 8466, 7601, 8909}, + []int{11012, 18654, 11526, 19112}, + []int{8968, -16655, 9781, -16501}, + []int{-9448, 12998, -9161, 13095}, + []int{-9840, 10212, -9803, 10359}, + []int{-9840, -5000, -9573, -4715}, + []int{7029, -3101, 7328, -2909}, + []int{10246, -3052, 10646, -1977}, + []int{-5354, 5618, -5208, 6233}, + []int{9781, 10039, 10646, 10212}, + []int{-7538, 9729, -6999, 9733}, + []int{-14835, 803, -14784, 1258}, + []int{569, 6122, 1603, 6233}, + []int{11526, -19142, 12654, -19141}, + []int{-12160, 4771, -12089, 4785}, + []int{-9840, 4548, -9828, 4771}, + []int{-14784, -14704, -14535, -14568}, + []int{8968, 2535, 9781, 3858}, + []int{-4918, -9406, -4681, -9194}, + []int{19299, 19886, 19584, 20150}, + []int{-7786, 12140, -7538, 13095}, + []int{-5354, -6569, -5208, -6552}, + []int{10246, 13095, 10303, 13595}, + []int{6801, -6552, 7029, -5468}, + []int{8035, 4785, 8935, 5076}, + []int{19299, 7721, 19992, 7825}, + []int{-16900, 1771, -16326, 2113}, + []int{8139, 8909, 8935, 9005}, + []int{-14992, -3895, -14835, -3101}, + []int{19584, -8859, 19992, -7020}, + []int{-12960, 4771, -12748, 4785}, + []int{-4485, -2909, -3933, -2767}, + []int{-5354, -19515, -4918, -19431}, + []int{8035, -19515, 8139, -19141}, + []int{3505, -1944, 3621, -1090}, + []int{-9573, 17169, -7899, 17732}, + []int{-14992, -7020, -14835, -5462}, + []int{4969, -3052, 5183, -2909}, + []int{-14470, -9469, -13095, -9406}, + []int{-2139, 10865, -2015, 11137}, + []int{-12089, 16862, -11919, 18166}, + []int{13398, -19623, 13830, -19539}, + []int{5266, -6569, 5757, -6552}, + []int{12689, 10400, 13108, 10853}, + []int{4819, -718, 4881, -390}, + []int{-18809, -19142, -18464, -19141}, + []int{-13921, 19343, -13424, 19886}, + []int{11012, 9733, 11901, 10039}, + []int{-4918, 1771, -3982, 2113}, + []int{-3065, 9733, -2802, 10212}, + []int{-3217, -654, -2796, -390}, + []int{1080, 7825, 3007, 8466}, + []int{7468, 18166, 8968, 18439}, + []int{5183, 1384, 5266, 1494}, + []int{-13921, 3283, -13424, 3970}, + []int{13108, -15085, 13830, -14828}, + []int{16517, -9654, 17684, -9469}, + []int{7468, -4871, 7601, -4004}, + []int{-18015, 7825, -17442, 8466}, + []int{1972, 6122, 2714, 6233}, + []int{-11919, 19870, -10921, 19886}, + []int{-14535, -14704, -13921, -14568}, + []int{9781, 2113, 10246, 3262}, + []int{-14535, 640, -13921, 803}, + []int{-15861, -13413, -15428, -11730}, + []int{8968, -17679, 10246, -16655}, + []int{17021, -7636, 17684, -6714}, + []int{-19523, 3262, -19421, 3283}, + []int{-16393, -6552, -16326, -5468}, + []int{2714, 1771, 3007, 3262}, + []int{11012, 8466, 11022, 9005}, + []int{1080, 9585, 1603, 10039}, + []int{300, 15683, 569, 15784}, + []int{15689, 640, 16099, 803}, + []int{300, -14389, 518, -14279}, + []int{5183, 5977, 5266, 6233}, + []int{-2015, -7020, -1696, -6714}, + []int{11901, 9733, 12654, 10212}, + []int{-18739, 10369, -18486, 10728}, + []int{-6999, 1384, -6927, 1494}, + []int{7468, -19431, 7601, -19141}, + []int{-5069, 7061, -4681, 7199}, + []int{-1696, 12755, -1609, 12998}, + []int{-1445, -654, -594, -390}, + []int{8139, 17536, 8935, 17732}, + []int{-3065, -4715, -2139, -3895}, + []int{-19523, -17630, -19421, -16655}, + []int{1603, -18801, 1972, -18767}, + []int{15884, 9729, 18000, 9733}, + []int{-14784, -718, -14470, -654}, + []int{-3933, -5462, -3883, -5000}, + []int{3832, -14568, 4819, -14389}, + []int{-12089, -19142, -11610, -19141}, + []int{-14992, -16113, -14470, -14704}, + []int{4969, 11785, 5266, 12755}, + []int{11012, 1494, 11526, 1771}, + []int{8139, 19886, 8968, 20150}, + []int{-18809, 18166, -18795, 18439}, + []int{-5208, -14568, -5144, -14389}, + []int{569, -7020, 1080, -6569}, + []int{-14470, 7721, -13921, 7825}, + []int{-1445, -16655, -494, -16501}, + []int{-13057, 2113, -12160, 2535}, + []int{11022, -13457, 11526, -13365}, + []int{-5144, 6634, -5069, 7038}, + []int{-3982, 8909, -3933, 9005}, + []int{6801, -14279, 7081, -13457}, + []int{-3707, 214, -3596, 640}, + []int{-9573, -390, -9448, -384}, + []int{13830, 7038, 14100, 7061}, + []int{11012, 16423, 11526, 16478}, + []int{-10193, -16147, -9890, -16113}, + []int{5183, 1118, 5266, 1384}, + []int{-12809, -5000, -12160, -4871}, + []int{-18464, 20666, -18015, 20990}, + []int{5757, -14568, 6403, -14389}, + []int{-12130, 18439, -11919, 18654}, + []int{-2139, -2909, -1781, -2767}, + []int{-6145, -16147, -5208, -15085}, + []int{10303, 214, 10646, 640}, + []int{19159, 19112, 19299, 19808}, + []int{-14535, 3283, -14470, 3858}, + []int{-9890, 19343, -9840, 19808}, + []int{13398, -5000, 13830, -4197}, + []int{19084, 2113, 19159, 3262}, + []int{16316, 18166, 17684, 18439}, + []int{-9573, 7721, -7538, 7825}, + []int{-17182, -16655, -17180, -16501}, + []int{11022, -18801, 11526, -16734}, + []int{4969, -1977, 5183, -1944}, + []int{-12960, 3953, -12748, 3970}, + []int{11526, 18439, 12654, 18654}, + []int{-19623, -390, -19527, 214}, + []int{-14470, -16734, -13921, -16655}, + []int{-5208, -18801, -5144, -17980}, + []int{17021, 7721, 17684, 7825}, + []int{-2139, 17732, -1733, 18654}, + []int{7328, 17732, 7468, 18166}, + []int{-12809, -18539, -12748, -17630}, + []int{15241, -3649, 15689, -3101}, + []int{-16326, -11595, -15861, -11138}, + []int{-1609, 14710, -1445, 15013}, + []int{-12960, -18539, -12809, -17980}, + []int{-9573, 10400, -9161, 10728}, + []int{-18464, 20150, -18015, 20666}, + []int{-19523, 18654, -18809, 19112}, + []int{-17318, -11730, -16900, -11595}, + []int{12689, 3283, 13398, 4164}, + []int{4819, -18539, 4881, -17980}, + []int{-13417, 7825, -13057, 8466}, + []int{-13095, 1384, -12960, 1494}, + []int{-9803, 10359, -9573, 10728}, + []int{7081, -17791, 7328, -16147}, + []int{-4918, 1258, -4681, 1384}, + []int{10646, -16501, 11526, -16147}, + []int{3621, -5468, 3832, -5462}, + []int{14804, -11264, 15241, -11138}, + []int{-14992, -14704, -14835, -14568}, + []int{-17318, -13365, -16900, -11730}, + []int{16316, -1944, 16517, -1346}, + []int{-9828, -384, -9573, 214}, + []int{3621, -19431, 3832, -19141}, + []int{-15428, 10212, -14992, 10728}, + []int{-14992, 1258, -14835, 1384}, + []int{14100, -384, 14120, 214}, + []int{15348, -9404, 15884, -8111}, + []int{19584, -7020, 19992, -6569}, + []int{1603, 3970, 1972, 4164}, + []int{-13057, -17980, -12809, -17791}, + []int{-11919, 2535, -11610, 3262}, + []int{-1781, 11103, -1733, 11137}, + []int{6728, 19870, 7601, 19886}, + []int{-19523, -6714, -19421, -6569}, + []int{-17442, 13271, -17318, 13595}, + []int{-1696, 14471, -1445, 14710}, + []int{-7786, -9469, -7538, -9406}, + []int{6801, -18767, 7081, -17980}, + []int{3505, -19878, 3621, -19539}, + []int{-12809, 15061, -12748, 15308}, + []int{-18795, -1044, -18486, -718}, + []int{7468, -5000, 7601, -4871}, + []int{-1609, -718, -594, -654}, + []int{16316, 14710, 17021, 15013}, + []int{7029, 214, 7328, 253}, + []int{15348, -18801, 15689, -18767}, + []int{-3883, -9406, -3707, -9404}, + []int{11526, -6714, 11901, -6569}, + []int{-9803, 19886, -9448, 20150}, + []int{-1609, 15013, -1445, 15061}, + []int{-12089, 4164, -11919, 4548}, + []int{-3065, -9406, -2802, -8111}, + []int{-7538, -5462, -5354, -5299}, + []int{-5208, 5618, -5069, 6122}, + []int{-494, 10853, -145, 11103}, + []int{3007, -3052, 3505, -2909}, + []int{-14835, 14710, -14784, 15061}, + []int{4393, 9729, 4819, 10039}, + []int{10646, -1044, 11012, -654}, + []int{8139, 11103, 8935, 11137}, + []int{-12160, 4548, -12089, 4771}, + []int{4969, 18166, 5266, 18439}, + []int{-3707, 640, -3596, 803}, + []int{-5354, -14704, -5208, -14389}, + []int{300, 3283, 1603, 3953}, + []int{-5354, 7038, -5208, 7061}, + []int{6801, -3895, 7081, -3649}, + []int{-19527, -18539, -19523, -17980}, + []int{1603, -7020, 1972, -6714}, + []int{-9890, 9729, -9840, 9733}, + []int{11526, 10853, 11901, 11103}, + []int{6801, 20150, 7328, 20990}, + []int{-9840, -5235, -9828, -5000}, + []int{-14535, 9005, -13921, 9585}, + []int{2714, 8466, 3007, 9005}, + []int{-12089, 4548, -11919, 4771}, + []int{-16900, 19808, -16393, 19886}, + []int{6801, -3649, 7081, -3101}, + []int{-7786, 1494, -7538, 1665}, + []int{-15861, -19623, -15428, -19539}, + []int{-15428, -1346, -15236, -654}, + []int{-18795, -7636, -18739, -7020}, + []int{14804, -9469, 15348, -8111}, + []int{15241, 10369, 15348, 10400}, + []int{10246, 17732, 11012, 18166}, + []int{-19800, 1771, -19623, 2113}, + []int{-17182, 6122, -17180, 6634}, + []int{5266, 11785, 5757, 12140}, + []int{3621, -16655, 3832, -16501}, + []int{-16326, -3101, -15861, -3052}, + []int{-1696, 10369, -1609, 11103}, + []int{-2802, -19431, -2796, -19142}, + []int{-10309, 18166, -10193, 18654}, + []int{4969, 10400, 5183, 10853}, + []int{-16393, -3895, -15861, -3649}, + []int{-19800, 17169, -19623, 17732}, + []int{-3596, -11138, -3217, -9469}, + []int{-19523, 1665, -19421, 1771}, + []int{17684, 9585, 18000, 9729}, + []int{-13921, 11785, -13424, 12998}, + []int{-145, -4004, 518, -3895}, + []int{13398, -3052, 13830, -2767}, + []int{14100, 20666, 14120, 20990}, + []int{15348, 19886, 15884, 20150}, + []int{-6145, 4793, -5354, 6233}, + []int{-6999, -19515, -6145, -19431}, + []int{19159, 10865, 19299, 11103}, + []int{-7538, -19431, -6999, -18539}, + []int{10303, 8466, 11012, 8909}, + []int{-14470, 8466, -13921, 9005}, + []int{-19421, 13095, -18486, 13271}, + []int{-7899, 12998, -7786, 13095}, + []int{-9573, -9654, -7899, -9469}, + []int{-14784, -14279, -14535, -13457}, + []int{12689, 4548, 13398, 4771}, + []int{10303, 19886, 10646, 20150}, + []int{-9573, 10728, -9448, 10853}, + []int{-19800, 18166, -19523, 18439}, + []int{15348, -16734, 15689, -16655}, + []int{-2015, 214, -1781, 253}, + []int{-15236, -5468, -14992, -5299}, + []int{-9828, 7721, -9803, 9005}, + []int{-9573, 10039, -9448, 10359}, + []int{7468, 2113, 8139, 2535}, + []int{-3217, -14279, -3065, -11264}, + []int{13830, 8466, 14120, 8909}, + []int{15241, 2113, 15348, 2535}, + []int{-5144, 17169, -5069, 17536}, + []int{14100, -17791, 14120, -17630}, + []int{13108, 13271, 13398, 15061}, + []int{14804, -4871, 15241, -4715}, + []int{-17180, -1090, -16900, -1044}, + []int{5330, -6552, 5757, -5468}, + []int{-12960, -1044, -12160, -718}, + []int{4819, -5235, 4881, -5000}, + []int{-14835, 1384, -14784, 2113}, + []int{-3707, 9733, -3596, 10039}, + []int{569, 9729, 1080, 10039}, + []int{-13057, -2767, -12960, -1977}, + []int{3832, 9729, 4393, 10039}, + []int{1603, -18767, 3832, -18539}, + []int{-12809, -11138, -12748, -9654}, + []int{7081, -5462, 7328, -5299}, + []int{-3217, 1118, -2796, 1258}, + []int{17021, 11137, 17684, 11785}, + []int{18082, -13365, 19009, -11264}, + []int{-13921, -9406, -13424, -9404}, + []int{-9161, 17732, -7899, 18166}, + []int{-16326, -19431, -15428, -19142}, + []int{1972, 19886, 2714, 20990}, + []int{-3596, 19886, -3217, 20990}, + []int{-9890, 9733, -9840, 10212}, + []int{13830, -14828, 14100, -14568}, + []int{-9161, -5299, -7538, -5235}, + []int{7029, -8859, 7328, -8111}, + []int{-17318, 15683, -16393, 15784}, + []int{14804, -19142, 15689, -19141}, + []int{-6999, -19878, -6145, -19709}, + []int{19299, 7199, 19992, 7721}, + []int{10303, 8909, 10646, 9005}, + []int{-19421, -1977, -18795, -1944}, + []int{-1781, -17791, -1696, -17679}, + []int{18000, -4004, 19084, -3895}, + []int{-14992, 10400, -14535, 10728}, + []int{14120, 10369, 14668, 10400}, + []int{-14992, -13457, -14835, -11730}, + []int{15884, 19886, 16099, 20150}, + []int{11012, -16147, 11022, -15085}, + []int{-19523, 15683, -18809, 15784}, + []int{-19623, -19709, -19527, -19623}, + []int{5757, 3953, 6728, 3970}, + []int{-13095, -4197, -13057, -4004}, + []int{-16393, 16423, -16326, 17169}, + []int{-7899, -7636, -7786, -7020}, + []int{5266, 13095, 5330, 14710}, + []int{-12960, 7825, -12809, 8466}, + []int{19159, 640, 19299, 803}, + []int{-1609, 7825, -494, 8466}, + []int{5330, 13595, 6403, 14471}, + []int{12689, -6569, 13108, -5468}, + []int{-14784, 16423, -14470, 16862}, + []int{-13057, 9585, -12960, 10212}, + []int{-16900, -654, -16393, 253}, + []int{3621, 6122, 3832, 6634}, + []int{569, -19878, 1080, -19623}, + []int{4969, 1771, 5757, 2113}, + []int{-145, 15308, 300, 15683}, + []int{14668, 19112, 14804, 19886}, + []int{2714, 15061, 3505, 15308}, + []int{-5354, 6233, -5144, 6634}, + []int{6728, 5618, 6801, 5977}, + []int{10303, -9194, 10646, -7636}, + []int{-15428, 6122, -15236, 6233}, + []int{300, 6122, 569, 6634}, + []int{4393, -1977, 4819, -1944}, + []int{4969, -718, 5183, -654}, + []int{518, 3953, 1603, 4164}, + []int{11012, 10865, 11022, 11785}, + []int{-9840, 3283, -9828, 3858}, + []int{8139, -3101, 9781, -3052}, + []int{18000, -13413, 18082, -13365}, + []int{-18464, 12998, -18015, 13095}, + []int{-17182, -384, -17180, 253}, + []int{-17442, -16655, -17182, -16501}, + []int{-2802, 9733, -2796, 10212}, + []int{14120, -19142, 14804, -19141}, + []int{5183, 3970, 5266, 4263}, + []int{-6145, 4785, -5354, 4793}, + []int{-12809, 12755, -12748, 12998}, + []int{12654, 15013, 12689, 15308}, + []int{-18464, 4263, -18015, 4548}, + []int{19584, 9729, 19992, 9733}, + []int{9781, -11264, 10246, -11138}, + []int{-3596, -4004, -3217, -3895}, + []int{7468, 12755, 7601, 13595}, + []int{12654, 3953, 12689, 4164}, + []int{1972, -5299, 2714, -5235}, + []int{-17180, -384, -16900, 253}, + []int{11901, 16423, 12654, 16862}, + []int{-13057, -8111, -12960, -7636}, + []int{-12160, -19709, -12130, -19539}, + []int{10246, -5235, 10303, -5000}, + []int{-5354, -14389, -5144, -14279}, + []int{-6145, -5468, -5354, -5462}, + []int{-2796, -3895, -2139, -3649}, + []int{-12960, -13457, -12089, -13413}, + []int{-9840, 10039, -9803, 10212}, + []int{300, 7061, 518, 7721}, + []int{-13095, -1090, -13057, -1044}, + []int{-6927, -19142, -5354, -19141}, + []int{300, 6634, 1603, 7038}, + []int{-6145, -14828, -5208, -14704}, + []int{-7899, -17679, -7786, -17630}, + []int{-5208, 6634, -5144, 7038}, + []int{-10309, -654, -10193, -384}, + []int{-12960, 17536, -12809, 18166}, + []int{13398, 4771, 13830, 4793}, + []int{-5208, -4197, -5144, -4004}, + []int{3007, -17630, 4393, -16734}, + []int{-1733, -9654, -1696, -9469}, + []int{-9448, 18439, -7899, 18654}, + []int{17021, -2909, 17684, -1977}, + []int{5183, 10400, 5266, 10728}, + []int{-12960, 3283, -12951, 3858}, + []int{7328, 5076, 7468, 5977}, + []int{-3065, -5000, -2802, -4715}, + []int{8035, -11138, 8139, -9654}, + []int{4819, -11595, 4881, -11264}, + []int{7468, -14279, 7601, -11595}, + []int{14668, -390, 15241, 214}, + []int{-145, 4771, 300, 5977}, + []int{-2344, -19515, -2015, -19431}, + []int{-1696, 18166, -1609, 18439}, + []int{-14784, 1665, -14470, 1771}, + []int{-18795, -5000, -18739, -4871}, + []int{-15428, -19141, -15236, -18801}, + []int{-6999, -5468, -6927, -5462}, + []int{-18809, -19141, -18486, -18801}, + []int{7468, 1384, 7601, 1665}, + []int{-9448, -5299, -9161, -5235}, + []int{19299, 8466, 19584, 8909}, + []int{-19523, -14568, -19421, -14389}, + []int{3505, -19539, 3621, -19515}, + []int{5266, 1118, 5757, 1258}, + []int{-12160, -6714, -10921, -6569}, + []int{5330, -11264, 5757, -9654}, + []int{19584, -19142, 19992, -19141}, + []int{-9161, -1346, -7786, -1090}, + []int{7601, -4197, 8035, -4004}, + []int{4393, -19431, 4881, -19141}, + []int{-11919, 16862, -11610, 17169}, + []int{11022, -11138, 11526, -9654}, + []int{7081, -11264, 7601, -11138}, + []int{-18739, -7636, -18464, -7020}, + []int{-3933, -17791, -3883, -17679}, + []int{-19623, -3895, -19523, -3649}, + []int{-14835, -5235, -14784, -5000}, + []int{9781, -9469, 10246, -9406}, + []int{-494, 15784, -145, 16423}, + []int{-3933, 18166, -3758, 18439}, + []int{-18015, 20150, -17442, 20990}, + []int{-11919, -11264, -11610, -9654}, + []int{-4918, 4548, -4485, 4771}, + []int{-17180, -19141, -16900, -17679}, + []int{-4681, 9733, -4485, 10039}, + []int{-17180, 16423, -16393, 17169}, + []int{-3065, 1258, -2802, 1384}, + []int{7081, -14279, 7468, -13365}, + []int{-1609, -1090, -1445, -718}, + []int{-3883, 1258, -3758, 1384}, + []int{-17318, -8859, -17182, -8111}, + []int{-11610, 6233, -10921, 6634}, + []int{-7899, -14279, -7786, -13457}, + []int{-4485, 19343, -3933, 19870}, + []int{-19527, -17630, -19523, -16734}, + []int{-3758, 7061, -3596, 7199}, + []int{12689, -9469, 13108, -9406}, + []int{3505, -390, 3621, -384}, + []int{-12130, -1346, -12089, -1090}, + []int{1080, 6233, 1603, 6634}, + []int{-9890, 3283, -9840, 3858}, + []int{-9828, 7199, -9803, 7721}, + []int{11012, 1771, 11526, 2113}, + []int{11526, 15784, 11901, 16423}, + []int{300, 3953, 518, 3970}, + []int{-14470, -14279, -13095, -13457}, + []int{9781, -18767, 10246, -17679}, + []int{-9890, 4548, -9840, 4785}, + []int{-13057, -6552, -12960, -5235}, + []int{-2139, -1944, -1781, -1346}, + []int{-18739, -5462, -18486, -5299}, + []int{11901, 14710, 12654, 15013}, + []int{569, 12140, 1603, 12755}, + []int{-3217, -9406, -3065, -9194}, + []int{4393, -16734, 4969, -16655}, + []int{-2015, -9406, -1781, -9194}, + []int{6801, 8466, 7029, 9005}, + []int{11526, 10369, 12654, 10400}, + []int{-4681, -4197, -4485, -3895}, + []int{3832, -14704, 4393, -14568}, + []int{5757, 10853, 6403, 10865}, + []int{300, 7038, 518, 7061}, + []int{-12130, 4785, -12089, 4793}, + []int{-13424, -9406, -13417, -9404}, + []int{569, 10212, 1603, 10359}, + []int{-14470, -9654, -13095, -9469}, + []int{12654, 6634, 12689, 7038}, + []int{-19623, -9406, -19527, -9404}, + []int{9781, 10212, 10646, 10359}, + []int{-9840, 9729, -9828, 10039}, + []int{-19623, -9404, -19527, -9194}, + []int{-13417, -11138, -13057, -9654}, + []int{-3065, -14389, -2802, -14279}, + []int{6403, -3101, 6728, -3052}, + []int{-5354, 803, -5208, 1494}, + []int{-13095, 3953, -13057, 3970}, + []int{-11919, 15013, -10921, 15061}, + []int{11526, -1044, 12654, -718}, + []int{-1733, -5299, -1696, -5235}, + []int{-16326, 9729, -15861, 10039}, + []int{-145, -19623, 518, -19515}, + []int{-4681, 11137, -4485, 12140}, + []int{-17442, -19141, -17318, -18801}, + []int{-11919, -9654, -11610, -9469}, + []int{-19523, -1977, -19421, -1944}, + []int{3505, 3262, 3832, 3283}, + []int{-16900, 17536, -15236, 17732}, + []int{-5354, -5299, -5208, -5235}, + []int{-14784, 11103, -14470, 11785}, + []int{15884, 18166, 16316, 18439}, + []int{12689, 19343, 13108, 19808}, + []int{-19523, 8466, -19421, 9005}, + []int{3505, 14471, 3621, 15013}, + []int{4969, 2535, 5266, 3262}, + []int{-13095, -17791, -12951, -17679}, + []int{-2015, 253, -1781, 529}, + []int{19584, -13413, 19992, -11264}, + []int{-2015, 11785, -1733, 12755}, + []int{-5208, -8111, -5144, -7636}, + []int{19299, 20150, 19584, 20666}, + []int{-1781, -16655, -1733, -16501}, + []int{-13417, 4793, -13095, 5977}, + []int{-3758, 15784, -3707, 16862}, + []int{-19800, 18439, -19623, 19808}, + []int{-12089, 18166, -11919, 18439}, + []int{-13417, 18166, -13095, 18439}, + []int{-12089, -19431, -11610, -19142}, + []int{5183, 14710, 5266, 15013}, + []int{11022, 5977, 12654, 6122}, + []int{-594, -4197, -494, -4004}, + []int{13398, -16734, 14100, -16655}, + []int{-7538, 16478, -6999, 16862}, + []int{18000, -17630, 18082, -16734}, + []int{5757, 10212, 6403, 10359}, + []int{3505, -5468, 3621, -5462}, + []int{-3933, -6569, -3883, -6552}, + []int{-2796, -5299, -2344, -5235}, + []int{-16326, 13271, -15861, 14471}, + []int{-5354, 4548, -5144, 4771}, + []int{2714, 3283, 3007, 3858}, + []int{-12160, 20666, -12089, 20990}, + []int{-7899, -3052, -7786, -2909}, + []int{-16900, 10853, -16326, 10865}, + []int{-10193, -13413, -9890, -11264}, + []int{569, -6569, 1603, -6552}, + []int{-13921, -18801, -13424, -18767}, + []int{-4918, 4771, -4485, 4785}, + []int{-12809, 14710, -12748, 15061}, + []int{6801, 10853, 7081, 10865}, + []int{3505, 10369, 3621, 10853}, + []int{-17442, 15683, -17318, 15784}, + []int{-14784, 10853, -14535, 10865}, + []int{18082, 15013, 19084, 15061}, + []int{19159, 15013, 19299, 15061}, + []int{-3758, -2767, -3707, -1977}, + []int{7029, 5618, 7328, 5977}, + []int{-7899, 1494, -7786, 1665}, + []int{-11919, 10039, -10921, 10212}, + []int{11526, -654, 13108, -390}, + []int{15241, -11595, 15348, -11138}, + []int{7468, 5076, 7601, 5618}, + []int{4969, -14568, 5183, -14389}, + []int{-18464, -14828, -17442, -14704}, + []int{-14835, 7199, -14784, 7825}, + []int{14213, 7199, 15689, 7721}, + []int{8968, 6634, 9781, 7038}, + []int{1080, 20666, 1972, 20990}, + []int{16517, 6233, 17021, 6634}, + []int{-17180, 6233, -16900, 7038}, + []int{15884, 4164, 16099, 4263}, + []int{-145, 19112, 518, 19808}, + []int{14100, 10728, 14120, 11103}, + []int{-16326, 14710, -15861, 15308}, + []int{-10193, 3858, -9890, 3970}, + []int{-12089, -4004, -11919, -3895}, + []int{-12809, 6122, -12748, 6233}, + []int{7468, 15013, 8139, 15061}, + []int{17021, -19878, 17684, -19709}, + []int{-12089, 4771, -11919, 4793}, + []int{-19623, -14568, -19527, -13457}, + []int{-18739, 7199, -18486, 7721}, + []int{19584, -19539, 19992, -19515}, + []int{11526, -19431, 11901, -19142}, + []int{7081, -14828, 7328, -14704}, + []int{7601, -14704, 8035, -14389}, + []int{-1445, -1944, -594, -1346}, + []int{-7538, 9733, -6999, 10039}, + []int{18000, -19141, 18082, -18801}, + []int{7029, 8909, 7081, 9005}, + []int{-17180, 17169, -16326, 17536}, + []int{15884, 18654, 16099, 19112}, + []int{-2344, 15683, -2139, 16423}, + []int{-1733, 14471, -1696, 14710}, + []int{-10193, -19709, -9840, -19623}, + []int{-13057, 17536, -12960, 18166}, + []int{-6927, -14828, -6145, -14704}, + []int{-6999, -19539, -6927, -19515}, + []int{14213, -4197, 14668, -3895}, + []int{569, 12998, 1603, 13271}, + []int{-594, 214, -494, 253}, + []int{-12960, 8466, -12809, 8909}, + []int{-17442, 12140, -17318, 13271}, + []int{-14835, -6552, -14784, -5462}, + []int{-4918, 10400, -4485, 10728}, + []int{300, 16423, 518, 16862}, + []int{-5208, -17980, -5144, -17791}, + []int{-17442, 11103, -17318, 11137}, + []int{1972, -7636, 2714, -6714}, + []int{-5069, -14828, -3982, -14704}, + []int{-18809, -1346, -18795, -1090}, + []int{7601, 6634, 8035, 7038}, + []int{12654, 10865, 12689, 11103}, + []int{-3707, 15308, -3217, 15683}, + []int{300, 3970, 518, 4164}, + []int{7601, -11138, 8035, -9654}, + []int{-4485, 10369, -3982, 10728}, + []int{-5069, 1771, -4918, 2113}, + []int{-16326, 16478, -15861, 16862}, + []int{-12748, 4771, -12160, 4785}, + []int{-19623, -19623, -19527, -19539}, + []int{6403, -19623, 6728, -19515}, + []int{4881, 5618, 4969, 6233}, + []int{-17182, -5000, -16900, -4871}, + []int{-7899, -17791, -7538, -17679}, + []int{13108, 1771, 13398, 3262}, + []int{-9890, -654, -9840, -390}, + []int{-13417, 16862, -13095, 17169}, + []int{-9890, 10212, -9840, 10359}, + []int{-594, -3101, -494, -3052}, + []int{-15428, 16478, -15236, 17536}, + []int{3832, -1944, 4393, -1346}, + []int{-5069, 9729, -4681, 9733}, + []int{-13921, 7721, -13424, 7825}, + []int{17684, 640, 18000, 803}, + []int{-3758, -1977, -3707, -1944}, + []int{-17182, -8859, -16900, -8111}, + []int{7029, 10400, 7081, 10728}, + []int{-14992, 11103, -14835, 11785}, + []int{14213, 7061, 14668, 7199}, + []int{-19527, -1044, -18809, -718}, + []int{-19527, -14568, -19523, -14389}, + []int{15689, 6122, 16099, 6233}, + []int{16316, 15013, 16517, 15308}, + []int{3621, -14568, 3832, -14389}, + []int{-13057, -4197, -12960, -4004}, + []int{14120, 640, 14213, 1118}, + []int{-13417, 8466, -13095, 8909}, + []int{14804, -17980, 15884, -17791}, + []int{-4485, -3649, -3982, -3052}, + []int{14120, 8466, 14213, 8909}, + []int{12654, 1384, 13398, 1494}, + []int{10303, -5235, 10646, -5000}, + []int{-18486, 10400, -18464, 10728}, + []int{-3217, 3858, -3065, 3953}, + []int{15348, 4548, 15689, 4771}, + []int{-14992, -9194, -14835, -8111}, + []int{-9828, 19886, -9803, 20990}, + []int{-3758, 14710, -3707, 15013}, + []int{-7538, 20150, -6999, 20990}, + []int{-15236, 10039, -14992, 10212}, + []int{-494, 1771, -145, 2113}, + []int{10646, 15308, 11012, 15683}, + []int{-4485, 12755, -3933, 12998}, + []int{-12748, 12755, -12160, 12998}, + []int{-12809, 19886, -11919, 20150}, + []int{15241, -13365, 15348, -11595}, + []int{14100, -18539, 14120, -17980}, + []int{16316, 5076, 16517, 5977}, + []int{4819, 4263, 4881, 4548}, + []int{-18015, 5618, -17318, 5977}, + []int{-6999, -14279, -6927, -13457}, + []int{19159, 4548, 19299, 4771}, + []int{-19800, 13271, -19623, 14710}, + []int{19584, 16478, 19992, 17536}, + []int{2714, 7721, 3007, 7825}, + []int{19584, 8909, 19992, 9729}, + []int{-2802, -14389, -2796, -14279}, + []int{-14835, 18439, -14784, 19112}, + []int{-14992, -7636, -14835, -7020}, + []int{-1733, -16655, -1609, -16501}, + []int{5266, 640, 5330, 1118}, + []int{-19527, -9469, -19523, -9406}, + []int{-16900, -1090, -16393, -718}, + []int{14804, -14704, 15241, -14568}, + []int{-19623, -19539, -19421, -19515}, + []int{-2796, 13271, -2344, 13595}, + []int{-10867, 11103, -10309, 11137}, + []int{8035, -1977, 8139, -1090}, + []int{10303, 1258, 10646, 1384}, + []int{13108, 6122, 13830, 6233}, + []int{-2139, -1977, -1781, -1944}, + []int{-13921, 12998, -13424, 13095}, + []int{4819, -1090, 4881, -718}, + []int{11526, 10728, 11901, 10853}, + []int{16517, 15013, 17021, 15061}, + []int{-6927, 9729, -6145, 9733}, + []int{-19623, -6569, -19527, -6552}, + []int{-17442, 8466, -17318, 8909}, + []int{17021, 15013, 17684, 15061}, + []int{5183, 803, 5266, 1118}, + []int{14668, 16478, 14804, 16862}, + []int{16517, 5076, 17021, 5618}, + []int{8968, -13457, 9781, -13413}, + []int{14804, 4263, 16099, 4548}, + []int{-11919, 19886, -11610, 20990}, + []int{15348, -18539, 15689, -17980}, + []int{8968, 10359, 10246, 10369}, + []int{14213, -6714, 14804, -6569}, + []int{-15236, -14704, -14992, -14568}, + []int{-1609, 803, -1445, 1384}, + []int{-18486, -5235, -18464, -5000}, + []int{-2015, -3101, -1781, -3052}, + []int{2714, 3262, 3007, 3283}, + []int{-13417, -9406, -13095, -9194}, + []int{-3933, -19623, -3883, -19515}, + []int{10303, -7636, 11012, -7020}, + []int{-16326, 4793, -15861, 5076}, + []int{-2796, 19112, -2139, 19343}, + []int{-17442, -7020, -17182, -6714}, + []int{-18809, -14828, -18795, -14568}, + []int{-6145, 640, -5354, 1384}, + []int{300, 2113, 518, 3262}, + []int{-13095, 3858, -13057, 3953}, + []int{-5069, -5468, -4918, -5462}, + []int{19009, -11595, 19084, -11264}, + []int{-19421, 1384, -18795, 1494}, + []int{-2139, 10853, -2015, 10865}, + []int{-19623, 19343, -19527, 19808}, + []int{-12130, -14389, -10921, -14279}, + []int{-12160, 12998, -12130, 13595}, + []int{-13057, 8466, -12960, 8909}, + []int{-17180, 13595, -16393, 14471}, + []int{-19523, -3052, -19421, -2909}, + []int{-3982, -14279, -3933, -13457}, + []int{7029, 10865, 7081, 11137}, + []int{-12960, -17630, -12951, -16734}, + []int{4969, 214, 5183, 253}, + []int{-11610, 10400, -10921, 10728}, + []int{11901, -5462, 13398, -5299}, + []int{-6145, 1384, -5354, 1494}, + []int{-6999, 10369, -6927, 11103}, + []int{-18739, 1118, -18486, 1258}, + []int{-5208, -6552, -5144, -5468}, + []int{-7538, 1384, -6999, 1494}, + []int{-9803, 17169, -9573, 17732}, + []int{300, 1118, 1080, 1258}, + []int{15884, 1118, 16099, 1494}, + []int{569, -19142, 1080, -18801}, + []int{12689, 4164, 13108, 4548}, + []int{-9890, 17536, -9840, 17732}, + []int{-3758, 9733, -3707, 10212}, + []int{-9573, -17630, -9448, -16734}, + []int{-494, 12755, -145, 12998}, + []int{-2796, -18767, -2139, -18539}, + []int{-14835, -5462, -14784, -5299}, + []int{-14784, 15013, -14535, 15061}, + []int{-3707, 2535, -3596, 3262}, + []int{6403, -19878, 6728, -19623}, + []int{4819, -1977, 4969, -1944}, + []int{-9573, -4715, -9161, -4197}, + []int{13398, 15784, 13830, 16423}, + []int{12654, -13365, 13108, -11730}, + []int{19584, -6552, 19992, -5299}, + []int{-3883, 1384, -3758, 1494}, + []int{-4918, 6122, -4681, 7038}, + []int{3505, 20666, 3832, 20990}, + []int{-3933, -3052, -3883, -2767}, + []int{-16900, 13095, -16326, 13271}, + []int{-594, -9654, 518, -9469}, + []int{-10867, -5235, -10309, -4871}, + []int{-16393, -4004, -16326, -3895}, + []int{569, -3101, 1603, -3052}, + []int{15884, 15061, 16099, 15308}, + []int{-19800, 10039, -19623, 10212}, + []int{-16393, 15308, -16326, 15683}, + []int{518, -4004, 569, -3895}, + []int{-12748, -17791, -12130, -17679}, + []int{11022, -1044, 11526, -718}, + []int{11022, -11730, 11526, -11595}, + []int{14668, -6552, 15348, -5468}, + []int{-17182, 19808, -17180, 19870}, + []int{-16900, 2113, -16393, 2535}, + []int{518, -19709, 569, -19515}, + []int{10646, 19343, 11012, 19808}, + []int{11526, 10039, 11901, 10212}, + []int{-5144, -18539, -5069, -17980}, + []int{-2344, 19808, -2139, 19886}, + []int{-3065, -5299, -2802, -5000}, + []int{-14992, 3953, -14835, 3970}, + []int{18082, 4771, 19084, 4785}, + []int{-9803, 15683, -9573, 15784}, + []int{4881, -19141, 4969, -18801}, + []int{4393, -14828, 4819, -14568}, + []int{5757, -9404, 6403, -9194}, + []int{15689, 6233, 16099, 6634}, + []int{4393, -16147, 4819, -16113}, + []int{13108, 1494, 13398, 1771}, + []int{10246, -8859, 10303, -8111}, + []int{-3065, -16147, -2802, -16113}, + []int{19084, 15013, 19159, 15061}, + []int{4969, -14389, 5183, -13457}, + []int{-14992, -5462, -14835, -5299}, + []int{-15428, 1771, -15236, 2113}, + []int{1080, -7020, 1603, -6714}, + []int{-14535, 5977, -14470, 6122}, + []int{-13057, 9005, -12960, 9585}, + []int{-16326, -6552, -15861, -5468}, + []int{-4485, -8859, -3982, -8111}, + []int{-18809, -1044, -18795, -718}, + []int{14100, -17630, 14213, -16734}, + []int{11526, -9469, 11901, -9404}, + []int{-3883, -4004, -3707, -3895}, + []int{-10193, 5977, -9890, 7038}, + []int{14120, 10728, 14213, 10865}, + []int{-12130, -1090, -11919, -718}, + []int{18082, 7038, 19159, 7061}, + []int{-16393, 13595, -16326, 14471}, + []int{16316, -19431, 17021, -19142}, + []int{-16326, -1346, -15428, -1090}, + []int{14120, -718, 14213, -654}, + []int{3621, -390, 4393, -384}, + []int{10646, -16113, 11012, -15085}, + []int{-14470, 19343, -13921, 19870}, + []int{-1445, -5299, -594, -5235}, + []int{19299, 4164, 19584, 4263}, + []int{7601, -1346, 8035, -1090}, + []int{4881, 7721, 4969, 8909}, + []int{7601, -16113, 8139, -15085}, + []int{-15861, 10039, -15428, 10212}, + []int{-14470, -17679, -13921, -17630}, + []int{11022, 14710, 11526, 15061}, + []int{-12951, 529, -12809, 640}, + []int{13108, 17536, 13398, 17732}, + []int{-3758, 18166, -3707, 18439}, + []int{18082, 10212, 19009, 10359}, + []int{19084, -18801, 19299, -18767}, + []int{4819, -1944, 4969, -1346}, + []int{5266, 10369, 5330, 10400}, + []int{-12809, 253, -12748, 529}, + []int{10246, -3649, 10303, -3052}, + []int{12689, 10865, 13108, 11137}, + []int{5757, 16423, 6728, 16478}, + []int{518, -19878, 569, -19709}, + []int{13398, 5076, 13830, 5618}, + []int{-7538, 16423, -6999, 16478}, + []int{8968, 18166, 10303, 18439}, + []int{5757, -18539, 6801, -17980}, + []int{-12089, 640, -11919, 803}, + []int{-9573, -17679, -9448, -17630}, + []int{6801, -14704, 7328, -14568}, + []int{-14992, 12998, -14535, 13095}, + []int{-10867, -9469, -9890, -9406}, + []int{12654, 16423, 12689, 16862}, + []int{14213, -8859, 14668, -8111}, + []int{11901, 18166, 12654, 18439}, + []int{-2139, -14568, -1781, -14389}, + []int{5266, 20150, 6801, 20666}, + []int{-9840, 4771, -9828, 4785}, + []int{5330, -9469, 5757, -9406}, + []int{-5069, 16862, -4681, 17536}, + []int{-3933, 1258, -3883, 1384}, + []int{-3707, -9406, -3217, -9404}, + []int{-18795, 16423, -18739, 16478}, + []int{-4485, -3052, -3982, -2909}, + []int{1603, -7636, 1972, -7020}, + []int{-19623, 4771, -19527, 4793}, + []int{-18486, 803, -17442, 1118}, + []int{4969, 13095, 5266, 13271}, + []int{-10309, -4197, -10193, -4004}, + []int{-3933, 14471, -3883, 14710}, + []int{-13057, -1090, -12951, -1044}, + []int{15241, 12755, 15348, 13095}, + []int{7468, -17791, 8035, -17679}, + []int{14120, -6569, 14213, -5468}, + []int{-4485, 6122, -3982, 6233}, + []int{-3982, -2767, -3933, -1977}, + []int{-19523, 18439, -18795, 18654}, + []int{-17318, -8111, -17182, -7636}, + []int{-17182, -4871, -16900, -4715}, + []int{-3883, -4715, -3707, -4004}, + []int{-19800, 4771, -19623, 4785}, + []int{-7538, 10359, -6927, 10369}, + []int{-3933, 1771, -3883, 2113}, + []int{-5144, -18767, -4681, -18539}, + []int{4881, 11785, 4969, 12140}, + []int{-9573, -19878, -9161, -19709}, + []int{-14535, 12998, -14470, 13095}, + []int{-3758, 16862, -3707, 17169}, + []int{8139, -9406, 8935, -9404}, + []int{-9161, -18801, -7899, -18539}, + []int{-18464, 17169, -17442, 17536}, + []int{-10921, 4548, -10867, 4785}, + []int{-14535, 10853, -14470, 10865}, + []int{6403, -3649, 6728, -3101}, + []int{19159, -5299, 19299, -5235}, + []int{-494, 19343, -145, 19808}, + []int{14804, -3052, 15241, -2909}, + []int{11022, -16734, 11526, -16655}, + []int{-9828, 9729, -9803, 10039}, + []int{-14835, 15784, -14535, 16423}, + []int{-5144, 5076, -5069, 5618}, + []int{-12748, -4871, -12160, -4715}, + []int{-5208, -13457, -5144, -13413}, + []int{3505, 6122, 3621, 6233}, + []int{-3707, -4715, -3596, -4197}, + []int{8139, 13595, 8935, 14471}, + []int{3621, 17169, 3832, 17536}, + []int{-4681, 11103, -4485, 11137}, + []int{8035, -19878, 8139, -19709}, + []int{19159, 4263, 19299, 4548}, + []int{-2015, 7825, -1781, 8466}, + []int{7081, 253, 7328, 529}, + []int{17684, -2909, 18000, -1977}, + []int{-12160, 2113, -12130, 2535}, + []int{-9890, -19539, -9840, -19515}, + []int{15689, 803, 16316, 1118}, + []int{-494, 1494, -145, 1665}, + []int{-11919, -1346, -10921, -1090}, + []int{-5208, -5468, -5144, -5462}, + []int{-3933, -2767, -3883, -1977}, + []int{-14470, -3649, -13921, -3101}, + []int{-17180, 253, -16900, 529}, + []int{-5144, 13095, -5069, 13271}, + []int{-12951, 10359, -12748, 10369}, + []int{-10309, 7825, -9890, 9005}, + []int{-10193, -11264, -9890, -11138}, + []int{-4681, -9406, -4485, -9194}, + []int{7601, -17679, 8035, -17630}, + []int{11901, -19141, 12654, -18801}, + []int{14120, -654, 14213, -390}, + []int{8935, 14710, 8968, 15061}, + []int{-18809, -17630, -18795, -16655}, + []int{15348, -16655, 15689, -16501}, + []int{19159, 4164, 19299, 4263}, + []int{-3758, -14279, -3707, -13457}, + []int{3621, 19870, 4393, 19886}, + []int{11526, 18166, 11901, 18439}, + []int{14213, -6552, 14668, -5468}, + []int{15348, -11138, 15689, -9654}, + []int{-1696, -1090, -1609, -1044}, + []int{-12160, -1044, -12130, -718}, + []int{4819, -3649, 4881, -3101}, + []int{-19421, -16147, -18809, -15085}, + []int{-17318, -7636, -17182, -7020}, + []int{-3758, -16734, -3707, -16501}, + []int{15348, 9729, 15884, 9733}, + []int{-17318, 5618, -17182, 5977}, + []int{5266, 15061, 5330, 15683}, + []int{-6145, -5235, -5354, -5000}, + []int{19084, -11138, 19299, -9654}, + []int{-11919, -5462, -11610, -5299}, + []int{3621, -11595, 4393, -11264}, + []int{-4918, 10369, -4681, 10400}, + []int{1603, 17169, 1972, 17536}, + []int{-9828, -16113, -9803, -15085}, + []int{-10193, -13457, -9840, -13413}, + []int{19584, -16734, 19992, -16655}, + []int{7601, 11103, 8139, 11137}, + []int{5330, 2113, 5757, 2535}, + []int{19159, 13271, 19299, 13595}, + []int{-18739, -14828, -18486, -14568}, + []int{-2344, 12998, -2139, 13095}, + []int{16517, 7199, 17021, 7721}, + []int{5183, 9733, 5330, 10039}, + []int{-19527, -19623, -19421, -19539}, + []int{3007, 19886, 3505, 20990}, + []int{-2802, -4871, -2796, -4715}, + []int{-6145, 7061, -5144, 7199}, + []int{-9803, 10728, -9573, 10853}, + []int{-13417, 5977, -13095, 6233}, + []int{-6145, -16655, -5354, -16147}, + []int{-12748, 3953, -12089, 3970}, + []int{-18739, 10728, -18486, 10853}, + []int{8139, -19623, 8935, -19539}, + []int{-3933, 10865, -3883, 11137}, + []int{518, -15085, 1972, -14828}, + []int{518, -17630, 1080, -16655}, + []int{19299, 640, 19584, 803}, + []int{-5208, 6122, -5144, 6233}, + []int{-3707, 13595, -3596, 14710}, + []int{17021, 12998, 17684, 13271}, + []int{19159, -9406, 19299, -9404}, + []int{4969, 12998, 5183, 13095}, + []int{-2344, 11103, -2139, 11137}, + []int{15689, -18539, 15884, -17980}, + []int{-19800, -14704, -19623, -13457}, + []int{-16393, 2113, -16326, 2535}, + []int{15348, -8111, 15689, -7020}, + []int{5266, -6714, 5330, -6569}, + []int{-12809, 11137, -11919, 11785}, + []int{-12809, 18166, -12160, 18439}, + []int{-3707, 12998, -3596, 13095}, + []int{-3707, 15784, -3596, 16423}, + []int{17684, 1771, 18000, 2113}, + []int{-9803, 3858, -9573, 3970}, + []int{-3933, 12140, -3758, 12755}, + []int{-1609, -16655, -1445, -16501}, + []int{15884, 529, 16099, 640}, + []int{-19623, -9469, -19527, -9406}, + []int{-14835, -3895, -14784, -3649}, + []int{-9803, -4715, -9573, -4197}, + []int{7601, 11137, 8935, 11785}, + []int{-9890, 14471, -9840, 14710}, + []int{-3707, 13095, -3596, 13271}, + []int{3621, -1944, 3832, -1090}, + []int{-14992, 10865, -14835, 11103}, + []int{-2015, 11103, -1781, 11137}, + []int{4881, 2535, 4969, 3283}, + []int{-3596, 19870, -3217, 19886}, + []int{-19527, 14710, -19523, 15013}, + []int{6403, 13595, 6728, 14471}, + []int{-10193, -14279, -9840, -13457}, + []int{-11610, -13413, -10921, -13365}, + []int{-9840, 11785, -9803, 12998}, + []int{-16393, 15683, -16326, 15784}, + []int{-19800, 10369, -19623, 10728}, + []int{-17182, 253, -17180, 529}, + []int{-16326, 10039, -15861, 10212}, + []int{-16900, 253, -16393, 529}, + []int{12689, -9406, 13108, -9194}, + []int{-2802, 10212, -2796, 10359}, + []int{-10867, -5299, -10309, -5235}, + []int{3621, 9585, 3832, 9729}, + []int{-2344, -5299, -2139, -5235}, + []int{9781, -9406, 10246, -9404}, + []int{-13424, 3953, -13417, 3970}, + []int{-14835, 13271, -14784, 13595}, + []int{11012, 1384, 11022, 1494}, + []int{11901, 1118, 12654, 1258}, + []int{-3933, 17536, -3883, 17732}, + []int{-6999, 11103, -6927, 11785}, + []int{-14992, 8466, -14835, 8909}, + []int{-10867, 10369, -10309, 10400}, + []int{-18015, -19539, -17442, -19515}, + []int{17021, 11785, 17684, 12755}, + []int{-12160, 18654, -12130, 19112}, + []int{3832, -384, 4393, 253}, + []int{5266, -6552, 5330, -5468}, + []int{-12748, 10853, -12160, 10865}, + []int{-17180, 19808, -16900, 19870}, + []int{-12130, -14279, -12089, -13457}, + []int{3505, 13271, 3621, 13595}, + []int{-9803, -19623, -9573, -19539}, + []int{-14784, 13095, -14535, 13271}, + []int{13830, 12755, 14100, 12998}, + []int{7029, 10728, 7081, 10853}, + []int{-14992, 6233, -14835, 6634}, + []int{-13095, 16862, -13057, 17169}, + []int{3007, -16734, 3505, -16655}, + []int{-1733, -9469, -1696, -9406}, + []int{-14992, -8111, -14835, -7636}, + []int{-3758, -718, -3596, -654}, + []int{-1696, -18801, -1445, -18767}, + []int{7601, -1977, 8035, -1346}, + []int{-11919, 10369, -11610, 10400}, + []int{8139, 20666, 8935, 20990}, + []int{-12160, 13595, -12130, 14471}, + []int{18082, -4197, 19009, -4004}, + []int{-10921, 19870, -10309, 19886}, + []int{-10309, 10853, -9890, 10865}, + []int{-19800, -11595, -19623, -11264}, + []int{-18795, -3101, -18486, -3052}, + []int{16099, 20666, 17021, 20990}, + []int{-3982, -19709, -3933, -19623}, + []int{18000, -18801, 18082, -18767}, + []int{-1733, 12140, -1609, 12755}, + []int{-10867, -384, -10309, 214}, + []int{16517, 20150, 17021, 20666}, + []int{10646, 9733, 11012, 10039}, + []int{-19527, -6569, -19523, -6552}, + []int{19299, -14828, 19584, -14568}, + []int{-13095, 11785, -13057, 12140}, + []int{19299, 9729, 19584, 9733}, + []int{-17442, -7636, -17318, -7020}, + []int{-594, 18166, -145, 18439}, + []int{-6145, -1977, -5354, -1346}, + []int{-7899, -7020, -7786, -6714}, + []int{-19800, 10212, -19623, 10359}, + []int{-17182, -14828, -17180, -14704}, + []int{-4681, 4785, -4485, 5076}, + []int{-19523, 1771, -19421, 2113}, + []int{-11610, 10728, -10921, 11137}, + []int{-14992, 10853, -14835, 10865}, + []int{-9448, 1258, -9161, 1384}, + []int{-6999, 10212, -6927, 10359}, + []int{-9890, -5235, -9840, -5000}, + []int{-2139, 4771, -2015, 4785}, + []int{569, 214, 1080, 253}, + []int{11022, -16655, 11526, -16501}, + []int{-7899, 13595, -7786, 14471}, + []int{-145, 18654, 300, 19112}, + []int{-13057, 7825, -12960, 8466}, + []int{5183, 10039, 5266, 10212}, + []int{-3982, 14471, -3933, 14710}, + []int{3505, -11138, 3832, -9469}, + []int{-13424, -8859, -13095, -8111}, + []int{15689, -11138, 16099, -9654}, + []int{-3596, -3895, -2802, -3649}, + []int{-12748, 529, -12160, 640}, + []int{-3982, 6122, -3933, 6233}, + []int{-19800, -11264, -19623, -11138}, + []int{-3883, -14704, -3758, -14389}, + []int{3832, -5468, 4819, -5462}, + []int{12654, -6552, 12689, -5462}, + []int{-6145, 3262, -5354, 3283}, + []int{-4918, 10039, -3982, 10212}, + []int{-18795, -2909, -18739, -2767}, + []int{-7786, -13413, -7538, -13365}, + []int{-14992, -17679, -14835, -16734}, + []int{-17442, 11137, -17318, 11785}, + []int{14804, 4548, 15348, 4771}, + []int{15689, 6634, 15884, 7038}, + []int{8035, -19539, 8139, -19515}, + []int{-3883, -3052, -3758, -2767}, + []int{7601, 1494, 8139, 1665}, + []int{-17182, 15784, -16900, 16423}, + []int{7468, 6634, 7601, 7038}, + []int{14804, 1118, 15241, 1384}, + []int{13398, -19878, 13830, -19709}, + []int{19584, 4785, 19992, 5076}, + []int{2714, 15683, 3007, 15784}, + []int{-5354, 640, -5208, 803}, + []int{-15861, 14710, -15428, 15013}, + []int{-3758, 4164, -3707, 4263}, + []int{-14835, 19870, -13921, 19886}, + []int{-15861, -19515, -15428, -19431}, + []int{-9803, 15784, -9573, 16423}, + []int{1080, -19709, 1972, -19623}, + []int{-9890, 15013, -9840, 15061}, + []int{4393, -19515, 4881, -19431}, + []int{9781, -11138, 10246, -9654}, + []int{-19623, 13271, -19527, 13595}, + []int{-14470, -15085, -13921, -14704}, + []int{-13424, -9194, -13095, -8859}, + []int{-4485, 4548, -3982, 4785}, + []int{-10921, 14710, -10309, 15013}, + []int{13830, -19623, 14100, -19539}, + []int{-7899, -9469, -7786, -9406}, + []int{11901, -14704, 12654, -14568}, + []int{-15236, 3858, -14992, 3970}, + []int{-7899, -4197, -7786, -4004}, + []int{-594, -16501, -494, -16147}, + []int{-6927, -14704, -6145, -14568}, + []int{-494, -5235, -145, -5000}, + []int{-16326, -3649, -15861, -3101}, + []int{-16900, -4871, -16393, -4715}, + []int{4819, 4548, 4881, 4771}, + []int{300, 4164, 1972, 4263}, + []int{-3707, 6233, -3596, 6634}, + []int{15689, 15683, 15884, 15784}, + []int{-145, -9406, 518, -9404}, + []int{-17442, 15784, -17182, 16423}, + []int{-3933, -9406, -3883, -9404}, + []int{-7786, 11785, -7538, 12140}, + []int{-3217, -14568, -3065, -14389}, + []int{7468, 19343, 7601, 19808}, + []int{-19800, 4548, -19623, 4771}, + []int{-6145, 14710, -5354, 15013}, + []int{19159, 10728, 19299, 10865}, + []int{7081, -5299, 7328, -5235}, + []int{-6145, 10728, -5354, 11103}, + []int{16316, -718, 17684, -654}, + []int{11901, 2535, 12654, 3262}, + []int{4393, 17169, 4819, 17536}, + []int{5183, -4004, 5330, -3895}, + []int{-13424, 13095, -13095, 13271}, + []int{-9448, 10865, -9161, 11103}, + []int{7601, -19142, 8035, -18801}, + []int{8968, -17980, 9781, -17791}, + []int{-12130, 3858, -12089, 3953}, + []int{4819, -16147, 4881, -15085}, + []int{8968, -11264, 9781, -11138}, + []int{19299, -4197, 19584, -4004}, + []int{8139, 17732, 8935, 18166}, + []int{-494, 4785, -145, 4793}, + []int{-12089, 14710, -11919, 15013}, + []int{-3065, 3970, -2802, 4164}, + []int{-3883, 253, -3758, 529}, + []int{11012, 16478, 11526, 16862}, + []int{-1781, 4164, -1609, 4263}, + []int{-19527, -384, -19523, 214}, + []int{-12130, 640, -12089, 803}, + []int{5757, 18654, 6403, 19112}, + []int{15689, -15085, 15884, -14568}, + []int{518, -5468, 569, -5299}, + []int{-1733, 11785, -1696, 12140}, + []int{-16326, -19141, -15861, -18801}, + []int{19299, 7061, 19584, 7199}, + []int{7081, 19886, 7328, 20150}, + []int{-6927, -2909, -5354, -2767}, + []int{16099, 15061, 16316, 15308}, + []int{15241, -3101, 15348, -3052}, + []int{-7786, 10039, -7538, 10212}, + []int{5266, 2535, 5330, 3262}, + []int{300, -1090, 569, -1044}, + []int{19159, 9729, 19299, 9733}, + []int{-10921, 5618, -10867, 5977}, + []int{-12960, 1258, -12951, 1384}, + []int{-9161, -5462, -7899, -5299}, + []int{-12130, 7721, -12089, 7825}, + []int{-19623, -1044, -19527, -390}, + []int{-15236, 18166, -14835, 18439}, + []int{-1696, 17732, -1609, 18166}, + []int{-1733, 13595, -1696, 14471}, + []int{-1445, 214, -594, 253}, + []int{-17182, -6552, -16900, -5468}, + []int{-19623, -4871, -19523, -4715}, + []int{13108, 10728, 13398, 10853}, + []int{-494, 1118, -145, 1258}, + []int{-9161, 7061, -7899, 7199}, + []int{-14835, 1258, -14784, 1384}, + []int{11526, 10400, 11901, 10728}, + []int{-14992, -19142, -14835, -18801}, + []int{-12960, -1944, -12951, -1090}, + []int{-12089, 20666, -11919, 20990}, + []int{12654, 15308, 12689, 15683}, + []int{-19800, 9733, -19623, 10039}, + []int{8035, -9406, 8139, -9404}, + []int{1080, -18801, 1603, -18767}, + []int{-12130, 10359, -12089, 10369}, + []int{7468, 6233, 7601, 6634}, + []int{12654, 3283, 12689, 3953}, + []int{11012, 7825, 11022, 8466}, + []int{12654, 14710, 12689, 15013}, + []int{19159, 5618, 19584, 5977}, + []int{-3707, -16655, -3596, -16501}, + []int{13108, 4164, 13398, 4548}, + []int{-17180, 13095, -16900, 13271}, + []int{-1445, -1977, -494, -1944}, + []int{-2015, -7636, -1696, -7020}, + []int{-14535, 1771, -13921, 2113}, + []int{-14784, 6122, -14535, 6233}, + []int{5183, 10212, 5266, 10359}, + []int{13398, -5235, 14120, -5000}, + []int{-18739, 13271, -18486, 13595}, + []int{-3707, 10039, -3065, 10212}, + []int{14100, -654, 14120, -390}, + []int{-18795, -1977, -18739, -1944}, + []int{-12160, 11785, -12130, 12140}, + []int{-3217, 19112, -3065, 19343}, + []int{-3933, -19878, -3883, -19623}, + []int{4881, 18166, 4969, 18654}, + []int{-2344, 12755, -2139, 12998}, + []int{16099, -11138, 16316, -9654}, + []int{18000, 11137, 18082, 11785}, + []int{-2015, -3895, -1781, -3649}, + []int{-14784, 1771, -14535, 2113}, + []int{13398, 7038, 13830, 7061}, + []int{12689, 11137, 13108, 11785}, + []int{-9161, -13413, -7786, -13365}, + []int{11901, -14828, 12654, -14704}, + []int{-14992, -19878, -14835, -19623}, + []int{-7899, -2909, -7538, -2767}, + []int{11022, 10853, 11526, 10865}, + []int{-7538, -5468, -6999, -5462}, + []int{-3982, -9406, -3933, -9404}, + []int{14804, -5462, 15241, -5299}, + []int{-10921, -11730, -10867, -11264}, + []int{-145, 16478, 300, 16862}, + []int{11526, 19112, 12654, 19343}, + []int{518, -5299, 569, -5235}, + []int{-3596, 529, -3217, 803}, + []int{-17182, -3101, -17180, -3052}, + []int{15241, -390, 15348, -384}, + []int{-12160, 12755, -12130, 12998}, + []int{17021, 1771, 17684, 2113}, + []int{-19523, -18539, -19421, -17980}, + []int{1080, 17169, 1603, 17536}, + []int{-3217, -4004, -3065, -3895}, + []int{-18486, -14704, -18015, -14568}, + []int{19584, -14828, 19992, -14568}, + []int{-2139, 4548, -2015, 4771}, + []int{11022, -13365, 11526, -11730}, + []int{-2344, 4263, -2139, 4548}, + []int{5183, -6714, 5266, -6569}, + []int{15241, -14704, 15348, -14568}, + []int{-19623, 214, -19527, 253}, + []int{18000, 19886, 18082, 20150}, + []int{-7899, 1384, -7786, 1494}, + []int{15689, 529, 15884, 640}, + []int{-19800, 4793, -19623, 5076}, + []int{-12130, 3283, -12089, 3858}, + []int{3621, -9406, 3832, -9404}, + []int{10303, 803, 10646, 1258}, + []int{-6999, -14828, -6927, -14568}, + []int{-12748, 4164, -12160, 4263}, + []int{-5354, -19142, -5208, -19141}, + []int{-2139, 4263, -2015, 4548}, + []int{13398, -718, 13830, -654}, + []int{8035, 4771, 8139, 4785}, + []int{-17442, 13595, -17318, 14471}, + []int{10303, -9404, 10646, -9194}, + []int{10303, -19141, 10646, -18801}, + []int{12654, 6233, 12689, 6634}, + []int{-494, 1665, -145, 1771}, + []int{-9448, 1384, -9161, 1494}, + []int{-9161, 4548, -7899, 4771}, + []int{16099, -4197, 16316, -4004}, + []int{17021, 7199, 17684, 7721}, + []int{5330, -9654, 5757, -9469}, + []int{-2139, -14389, -1781, -14279}, + []int{11022, 1384, 11526, 1494}, + []int{3505, 11137, 3621, 11785}, + []int{-3883, 18439, -3758, 19112}, + []int{5183, 20150, 5266, 20666}, + []int{-10867, -1090, -10309, -1044}, + []int{16316, 18654, 16517, 19112}, + []int{-1733, 214, -1696, 253}, + []int{10646, -16147, 11012, -16113}, + []int{-2802, -16113, -2796, -15085}, + []int{-19523, 1384, -19421, 1494}, + []int{3007, 15683, 3505, 15784}, + []int{-9161, 12998, -7899, 13095}, + []int{19299, 1258, 19584, 1384}, + []int{-12809, 18654, -12160, 19112}, + []int{-16393, 4164, -16326, 4771}, + []int{4881, 7199, 4969, 7721}, + []int{-19800, -19709, -19623, -19623}, + []int{7328, -7636, 7468, -7020}, + []int{18000, 18654, 18082, 19112}, + []int{-14470, 19112, -13424, 19343}, + []int{-10193, -390, -9840, -384}, + []int{-9448, 1494, -9161, 1665}, + []int{11012, -1044, 11022, -654}, + []int{-13057, 11785, -12960, 12140}, + []int{-7538, -19623, -6927, -19539}, + []int{-9890, 9585, -9840, 9729}, + []int{4881, -4715, 4969, -4197}, + []int{-16393, 19808, -16326, 19870}, + []int{17021, -6714, 17684, -6569}, + []int{19084, -4715, 19159, -4197}, + []int{-6999, 4771, -6927, 4785}, + []int{-3217, -16655, -2802, -16501}, + []int{-3883, -19878, -3758, -19709}, + []int{13108, 10865, 13398, 11103}, + []int{-9803, 7038, -9573, 7721}, + []int{-3065, 19112, -2802, 19343}, + []int{19084, 9729, 19159, 9733}, + []int{8035, -19141, 8139, -18801}, + []int{-2802, 803, -2796, 1118}, + []int{4819, 9733, 4881, 10039}, + []int{5757, 2113, 6403, 2535}, + []int{-19623, 14471, -19523, 14710}, + []int{-19523, -11138, -19421, -9654}, + []int{18000, 11785, 18082, 12998}, + []int{19299, 3262, 19584, 3283}, + []int{13398, 4793, 13830, 5076}, + []int{-3933, -19515, -3883, -19431}, + []int{300, -1346, 569, -1090}, + []int{15689, 3970, 15884, 4164}, + []int{-5208, 19343, -5144, 19870}, + []int{-7538, 11103, -6999, 11785}, + []int{5330, 11137, 5757, 11785}, + []int{-19623, 18654, -19527, 19112}, + []int{-19523, -19709, -19421, -19623}, + []int{5266, 12140, 5757, 12755}, + []int{-5354, 3262, -5208, 3283}, + []int{-7899, -9654, -7786, -9469}, + []int{-1609, 1384, -1445, 1494}, + []int{-11919, -7636, -10921, -7020}, + []int{2714, -390, 3505, -384}, + []int{-14835, -718, -14784, -654}, + []int{3621, -19141, 3832, -18801}, + []int{6801, -4715, 7029, -4197}, + []int{-1445, 13271, -594, 13595}, + []int{3007, 13271, 3505, 13595}, + []int{-5144, -16501, -5069, -16147}, + []int{12654, 4164, 12689, 4263}, + []int{-12951, 253, -12809, 529}, + []int{18000, -11595, 18082, -11264}, + []int{19159, 1258, 19299, 1384}, + []int{15348, -4715, 15689, -4004}, + []int{1080, 10039, 1603, 10212}, + []int{-7538, 12998, -6999, 13095}, + []int{-2344, 13095, -2139, 13595}, + []int{7468, 15784, 7601, 16423}, + []int{13830, -15085, 14100, -14828}, + []int{-13095, -18539, -13057, -17791}, + []int{-1781, 7038, -1733, 7199}, + []int{-14784, 7721, -14535, 7825}, + []int{-5144, 7061, -5069, 7199}, + []int{-10193, -16113, -9890, -14828}, + []int{-19523, -6569, -19421, -6552}, + []int{10246, 1258, 10303, 1384}, + []int{-12809, 15308, -12748, 15784}, + []int{3007, 10369, 3505, 10400}, + []int{-9573, 7199, -7899, 7721}, + []int{1972, 5977, 2714, 6122}, + []int{8139, 20150, 8935, 20666}, + []int{6403, 16478, 6728, 16862}, + []int{-1696, -17791, -1445, -17679}, + []int{17684, -9654, 18082, -9469}, + []int{7328, -1977, 7468, -1944}, + []int{-18795, 13595, -18739, 14471}, + []int{-18809, 19870, -18795, 20150}, + []int{-19527, 19343, -19523, 19870}, + []int{15884, 253, 16099, 529}, + []int{10646, 8909, 11012, 9005}, + []int{-11919, 14710, -10921, 15013}, + []int{16316, -1977, 16517, -1944}, + []int{-12748, 20666, -12160, 20990}, + []int{7328, -18539, 7468, -17980}, + []int{-5208, -16501, -5144, -16147}, + []int{-3982, 4548, -3933, 4771}, + []int{10303, 10359, 10646, 10369}, + []int{-12809, 529, -12748, 640}, + []int{-12160, -16655, -12130, -16501}, + []int{19084, -5468, 19159, -5462}, + []int{7029, -18801, 7081, -18767}, + []int{-18739, -1346, -18486, -1090}, + []int{7468, -19878, 7601, -19709}, + []int{-2139, -2767, -2015, -1977}, + []int{19584, 8466, 19992, 8909}, + []int{8968, -17791, 9781, -17679}, + []int{-2139, 1494, -2015, 1665}, + []int{-19623, 253, -19527, 529}, + []int{6801, -6569, 7029, -6552}, + []int{17021, 20150, 17684, 20990}, + []int{-9890, -13413, -9840, -13365}, + []int{11901, 4263, 12689, 4548}, + []int{-13095, -2767, -13057, -1977}, + []int{14804, -4004, 15241, -3895}, + []int{-18739, 803, -18486, 1118}, + []int{-3217, 3970, -3065, 4164}, + []int{16517, 1771, 17021, 2113}, + []int{-15861, 10212, -15428, 10359}, + []int{8035, 15061, 8139, 15683}, + []int{-3883, -2767, -3758, -1977}, + []int{4969, 3262, 5183, 3283}, + []int{8935, -9654, 8968, -9469}, + []int{8139, -19709, 8935, -19623}, + []int{-15861, -19141, -15428, -18801}, + []int{6403, 640, 6728, 803}, + []int{10246, 2535, 10303, 3262}, + []int{-15236, -14828, -14992, -14704}, + []int{-10309, 12755, -9840, 12998}, + []int{5266, 3858, 6403, 3953}, + []int{-13417, 14471, -13095, 14710}, + []int{11022, 19343, 11526, 19870}, + []int{-11919, 11137, -11610, 11785}, + []int{-16900, -718, -16393, -654}, + []int{-7786, -13365, -7538, -11730}, + []int{-15236, -718, -14835, -654}, + []int{1603, -14828, 1972, -14704}, + []int{-9890, -19515, -9840, -19431}, + []int{12689, -5468, 13108, -5462}, + []int{-19527, -4715, -19523, -4197}, + []int{-9840, -16734, -9573, -16655}, + []int{-4485, 14471, -3982, 14710}, + []int{12654, -11730, 13108, -11595}, + []int{-10921, -6552, -10867, -5468}, + []int{-4485, -2767, -3982, -1977}, + []int{1972, 4548, 2714, 4771}, + []int{-13417, 15013, -13095, 15061}, + []int{12689, -9654, 13108, -9469}, + []int{7029, -17679, 7081, -17630}, + []int{-9840, -1346, -9828, -1090}, + []int{-13921, 20150, -13424, 20666}, + []int{-19800, 16478, -19623, 16862}, + []int{300, 3262, 518, 3283}, + []int{12689, -11138, 13108, -9654}, + []int{-13921, 4785, -13424, 4793}, + []int{8139, -16113, 8968, -15085}, + []int{7081, 8466, 7328, 8909}, + []int{-18015, 19886, -17442, 20150}, + []int{-6145, 13095, -5354, 13271}, + []int{9781, 15683, 10246, 15784}, + []int{-19800, -3649, -19623, -3101}, + []int{-19527, -4197, -19523, -4004}, + []int{-1609, -19141, -1445, -18801}, + []int{3832, -19515, 4393, -19431}, + []int{-9840, 1494, -9828, 1665}, + []int{-6999, -19142, -6927, -19141}, + []int{9781, -18801, 10246, -18767}, + []int{8968, 4785, 9781, 5076}, + []int{14804, 15784, 15241, 16423}, + []int{2714, 19886, 3007, 20150}, + []int{518, 17732, 569, 18166}, + []int{-13424, -7636, -13417, -7020}, + []int{-3758, 12140, -3707, 12755}, + []int{-17318, -3649, -17182, -3101}, + []int{-4918, 9733, -4681, 10039}, + []int{-6999, 4793, -6927, 5076}, + []int{-14535, -19539, -14470, -19515}, + []int{-5144, 6122, -5069, 6634}, + []int{-3982, 1771, -3933, 2113}, + []int{-5354, -15085, -5208, -14828}, + []int{-14835, 4771, -14784, 4785}, + []int{-9890, -3895, -9840, -3649}, + []int{-17182, -19141, -17180, -18801}, + []int{10246, -8111, 10303, -7636}, + []int{4881, -5235, 4969, -5000}, + []int{-4681, 10369, -4485, 10400}, + []int{-18739, 13595, -18486, 14471}, + []int{-17442, -16501, -17318, -16147}, + []int{-1781, 7199, -1733, 7721}, + []int{15241, -384, 15348, 214}, + []int{9781, -16655, 10246, -16501}, + []int{-11919, 3858, -11610, 3953}, + []int{-14470, -16655, -13921, -16501}, + []int{-12089, -11264, -11919, -11138}, + []int{-4681, 15061, -4485, 15308}, + []int{7029, -17980, 7081, -17791}, + []int{2714, 17169, 3007, 17536}, + []int{1972, 15061, 2714, 15683}, + []int{-3217, 5977, -2802, 6122}, + []int{-17318, -16501, -17182, -16147}, + []int{-18739, 10853, -18486, 10865}, + []int{-15428, 8466, -14992, 8909}, + []int{-19527, 3262, -19523, 3283}, + []int{-494, 11103, -145, 11137}, + []int{-10921, -7636, -10867, -7020}, + []int{4819, -13457, 4881, -13413}, + []int{-18486, 3970, -18464, 4263}, + []int{18000, -2767, 18082, -1977}, + []int{-12960, -718, -12951, -654}, + []int{19159, -9654, 19299, -9469}, + []int{-18486, -3101, -18464, -3052}, + []int{-10193, 4548, -9890, 4771}, + []int{-10309, -17980, -10193, -17791}, + []int{-17182, -3649, -17180, -3101}, + []int{-19527, 18654, -19523, 19112}, + []int{7081, 15308, 7328, 15683}, + []int{4819, 6122, 4881, 6233}, + []int{4881, -18801, 4969, -18767}, + []int{12654, 9005, 13108, 9585}, + []int{-6999, -13413, -6927, -13365}, + []int{4881, -16113, 4969, -14828}, + []int{-2015, -3649, -1781, -3101}, + []int{-1733, 7825, -1696, 8466}, + []int{-16393, -19142, -16326, -19141}, + []int{-18486, 4263, -18464, 4548}, + []int{14120, -17791, 14213, -17679}, + []int{11901, 10865, 12654, 11103}, + []int{19299, -9194, 19584, -8859}, + []int{8935, 11137, 8968, 11785}, + []int{1972, 3283, 2714, 3858}, + []int{12689, 19808, 13398, 19870}, + []int{12654, 10039, 12689, 10212}, + []int{-9803, -16113, -9161, -15085}, + []int{-16900, 1665, -16393, 1771}, + []int{15241, -6569, 15348, -6552}, + []int{-3065, 6122, -2802, 6233}, + []int{-3883, -3895, -3707, -3649}, + []int{-494, -19141, -145, -18801}, + []int{-15236, 3283, -14992, 3858}, + []int{-7899, 1258, -7786, 1384}, + []int{7601, 15784, 8035, 16423}, + []int{19009, -4197, 19084, -4004}, + []int{19584, -19878, 19992, -19623}, + []int{3621, -16501, 3832, -16147}, + []int{-16900, 19886, -16393, 20150}, + []int{-9890, -9469, -9840, -9404}, + []int{-16326, -11138, -15861, -9654}, + []int{1972, -5235, 2714, -5000}, + []int{-17182, 6634, -17180, 7038}, + []int{1972, -5462, 2714, -5299}, + []int{11022, 10865, 11526, 11103}, + []int{-7899, -2767, -7786, -1977}, + []int{6403, -4715, 6728, -4197}, + []int{3505, 17169, 3621, 17536}, + []int{-18486, -14828, -18464, -14704}, + []int{-3707, 13271, -3596, 13595}, + []int{569, 16423, 1080, 16478}, + []int{-3982, -19878, -3933, -19709}, + []int{15884, 3970, 16316, 4164}, + []int{11901, 1771, 12654, 2113}, + []int{1603, 15061, 1972, 15683}, + []int{-12960, -1977, -12951, -1944}, + []int{-16393, -5299, -16326, -5235}, + []int{7468, -19141, 7601, -18801}, + []int{6403, 17732, 6728, 18166}, + []int{16099, 1118, 16316, 1258}, + []int{11022, -1977, 11526, -1944}, + []int{-9161, -5468, -7899, -5462}, + []int{17684, 19886, 18000, 20150}, + []int{-14992, -3101, -14835, -3052}, + []int{-7538, 19886, -6999, 20150}, + []int{8035, -4197, 8139, -4004}, + []int{-6927, 1384, -6145, 1494}, + []int{19159, -16655, 19299, -16501}, + []int{13398, 8466, 13830, 8909}, + []int{300, -9469, 518, -9406}, + []int{-19800, -14828, -19623, -14704}, + []int{14804, -16501, 15241, -16147}, + []int{5183, 214, 5266, 253}, + []int{14120, -17679, 14213, -17630}, + []int{569, -1090, 1080, -1044}, + []int{10246, 640, 10303, 803}, + []int{13830, 12998, 14100, 13095}, + []int{19584, 1258, 19992, 1384}, + []int{-4681, -18801, -4485, -18539}, + []int{-3982, -14828, -3933, -14704}, + []int{-145, 1118, 300, 1258}, + []int{19084, -6552, 19159, -5468}, + []int{-19800, -4871, -19623, -4715}, + []int{-145, -3101, 300, -3052}, + []int{19084, 10865, 19159, 11103}, + []int{-12130, 9005, -12089, 9585}, + []int{-9890, -1346, -9840, -1090}, + []int{5266, -11264, 5330, -11138}, + []int{12654, 15683, 12689, 15784}, + []int{-19523, -19878, -19421, -19709}, + []int{12654, -1977, 12689, -1944}, + []int{8139, -9654, 8935, -9469}, + []int{-2139, 3283, -2015, 3858}, + []int{-5144, -4715, -5069, -4197}, + []int{8035, 11785, 8139, 12140}, + []int{-494, 15308, -145, 15784}, + []int{18000, -11730, 18082, -11595}, + []int{19159, -16501, 19299, -16147}, + []int{10303, 640, 10646, 803}, + []int{-10867, 10853, -10309, 10865}, + []int{15241, -3052, 15348, -2909}, + []int{3505, 13595, 3621, 14471}, + []int{1080, 12755, 1603, 12998}, + []int{1603, 214, 2714, 253}, + []int{5330, -6714, 5757, -6569}, + []int{-1781, -5462, -1696, -5299}, + []int{-2802, 11103, -2344, 11137}, + []int{8935, -3895, 8968, -3649}, + []int{-1781, -14568, -1733, -14389}, + []int{-13057, 10359, -12960, 10369}, + []int{5330, -18767, 5757, -18539}, + []int{14668, -8859, 14804, -8111}, + []int{8968, 14471, 9781, 14710}, + []int{-14992, 6634, -14835, 7038}, + []int{-5208, 19112, -5144, 19343}, + []int{-18795, 7825, -18739, 8466}, + []int{-12160, 4263, -12130, 4548}, + []int{13108, 19343, 13398, 19808}, + []int{-18015, 529, -17442, 640}, + []int{3621, 803, 3832, 1118}, + []int{19299, -19539, 19584, -19515}, + []int{-19527, -9406, -19523, -9194}, + []int{-12809, -4871, -12748, -4715}, + []int{7468, 10400, 7601, 10728}, + []int{-1696, -1044, -1609, -654}, + []int{8968, 2113, 9781, 2535}, + []int{-12748, -6714, -12160, -6569}, + []int{-12960, 1118, -12951, 1258}, + []int{-12951, -384, -12809, 214}, + []int{-19421, -2909, -18795, -2767}, + []int{4969, -384, 5183, 214}, + []int{-2015, -3052, -1781, -2909}, + []int{-3982, 3970, -3933, 4164}, + []int{-10309, -1090, -10193, -1044}, + []int{-10867, 10212, -10309, 10359}, + []int{19584, 7061, 19992, 7199}, + []int{-18015, -14704, -17442, -14568}, + []int{-9161, 4771, -7899, 4785}, + []int{3621, -2767, 3832, -1977}, + []int{4819, -15085, 4881, -14828}, + []int{-12960, 10359, -12951, 10369}, + []int{15689, 4164, 15884, 4263}, + []int{-13095, 18166, -13057, 18439}, + []int{-3758, -17630, -3707, -16734}, + []int{-4485, -8111, -3982, -7636}, + []int{8935, 19870, 8968, 19886}, + []int{6403, 19870, 6728, 19886}, + []int{19159, -4197, 19299, -4004}, + []int{3832, 20666, 4393, 20990}, + []int{-9573, -14279, -9448, -13457}, + []int{18000, -4197, 18082, -4004}, + []int{19584, -6569, 19992, -6552}, + []int{-494, -5000, -145, -4715}, + []int{12689, 16478, 13108, 16862}, + []int{7468, -11595, 7601, -11264}, + []int{11901, -14568, 12654, -14389}, + []int{-13417, 640, -13095, 803}, + []int{-9803, 12755, -9573, 12998}, + []int{-7786, -2767, -7538, -1977}, + []int{-2802, -3895, -2796, -3649}, + []int{-18795, 15784, -18739, 16423}, + []int{11901, -6552, 12654, -5468}, + []int{13398, 5977, 13830, 6122}, + []int{-14470, 20150, -13921, 20666}, + []int{-19523, 9733, -19421, 10039}, + []int{-3758, -5468, -3596, -5462}, + []int{-13057, 10212, -12960, 10359}, + []int{-10921, 11103, -10867, 11137}, + []int{-14835, -9406, -14784, -9404}, + []int{569, 9585, 1080, 9729}, + []int{569, 6233, 1080, 6634}, + []int{-4918, 15061, -4681, 15308}, + []int{-14470, -17630, -13921, -16734}, + []int{3621, -384, 3832, 253}, + []int{4881, 10853, 4969, 10865}, + []int{11901, -5468, 12654, -5462}, + []int{15348, -19141, 15689, -18801}, + []int{-5208, 19870, -5144, 19886}, + []int{-18739, -2909, -18486, -2767}, + []int{-1609, 4164, -1445, 4263}, + []int{4819, -11730, 4881, -11595}, + []int{7328, -4197, 7468, -4004}, + []int{-19523, -7020, -19421, -6714}, + []int{14668, -13413, 14804, -13365}, + []int{12654, -6569, 12689, -6552}, + []int{-6145, 3283, -5354, 3858}, + []int{3621, -19515, 3832, -19431}, + []int{3621, -14704, 3832, -14568}, + []int{-13057, -18539, -12960, -17980}, + []int{15884, 5977, 16099, 6122}, + []int{-7786, 640, -7538, 803}, + []int{8139, 9585, 8935, 9729}, + []int{-7899, -4004, -7786, -3895}, + []int{-4681, 2113, -4485, 2535}, + []int{-12960, 1384, -12951, 1494}, + []int{7029, -17630, 7081, -16734}, + []int{3832, 803, 4393, 1118}, + []int{7468, 7038, 8035, 7061}, + []int{4393, 19870, 4819, 19886}, + []int{14804, -5468, 15241, -5462}, + []int{300, 7721, 518, 7825}, + []int{-5354, 6634, -5208, 7038}, + []int{-10309, 7721, -10193, 7825}, + []int{16517, -3052, 17021, -2909}, + []int{13108, 3262, 13398, 3283}, + []int{-14992, 9729, -14835, 9733}, + []int{-19421, -17630, -18809, -16734}, + []int{18000, 15013, 18082, 15061}, + []int{-2015, -8111, -1781, -7636}, + []int{-2139, -5299, -2015, -5235}, + []int{10246, -13413, 10303, -13365}, + []int{-3883, 16862, -3758, 17169}, + []int{-6145, -19878, -5354, -19709}, + []int{12654, -1044, 12689, -718}, + []int{-12160, -19515, -12130, -19431}, + []int{-16900, -19515, -16393, -19431}, + []int{15348, 11137, 15689, 11785}, + []int{15689, 253, 15884, 529}, + []int{-6145, -14704, -5354, -14568}, + []int{5757, -6569, 6403, -6552}, + []int{9781, 15061, 10246, 15308}, + []int{-594, -3649, -494, -3101}, + []int{11526, -11138, 11901, -9654}, + []int{11901, 15013, 12654, 15061}, + []int{12689, 10039, 13108, 10212}, + []int{-14470, 4263, -13921, 4548}, + []int{7081, -18539, 7328, -17980}, + []int{7328, 4263, 7468, 4548}, + []int{-19800, 10728, -19623, 10853}, + }, + true, + }, + + { + [][]int{ + []int{1, 1, 2, 3}, + []int{1, 3, 2, 4}, + []int{3, 1, 4, 2}, + []int{3, 2, 4, 4}, + }, + false, + }, + + { + [][]int{ + []int{1, 1, 3, 3}, + []int{3, 1, 4, 2}, + []int{1, 3, 2, 4}, + []int{3, 2, 4, 4}, + }, + false, + }, + + { + [][]int{}, + false, + }, + + { + [][]int{ + []int{1, 1, 3, 3}, + []int{3, 1, 4, 2}, + []int{1, 3, 2, 4}, + []int{2, 2, 4, 4}, + }, + false, + }, + + // 可以有多个 testcase +} + +func Test_isRectangleCover(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isRectangleCover(tc.rectangles), "输入:%v", tc) + } +} + +func Benchmark_isRectangleCover(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isRectangleCover(tc.rectangles) + } + } +} diff --git a/Algorithms/0392.is-subsequence/README.md b/Algorithms/0392.is-subsequence/README.md new file mode 100755 index 000000000..5dac72ff6 --- /dev/null +++ b/Algorithms/0392.is-subsequence/README.md @@ -0,0 +1,32 @@ +# [392. Is Subsequence](https://leetcode.com/problems/is-subsequence/) + +## 题目 + +Given a string s and a string t, check if s is subsequence of t. + +You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) string, and s is a short string (<=100). + +A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "ace" is a subsequence of "abcde" while "aec" is not). + +Example 1: + +```text +s = "abc", t = "ahbgdc" +Return true. +``` + +Example 2: + +```text +s = "axc", t = "ahbgdc" +Return false. +``` + +Follow up: +If there are lots of incoming S, say S1, S2, ... , Sk where k >= 1B, and you want to check one by one to see if T has its subsequence. In this scenario, how would you change your code? + +Credits:Special thanks to @pbrother for adding this problem and creating all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0392.is-subsequence/is-subsequence.go b/Algorithms/0392.is-subsequence/is-subsequence.go new file mode 100755 index 000000000..bc03f2940 --- /dev/null +++ b/Algorithms/0392.is-subsequence/is-subsequence.go @@ -0,0 +1,13 @@ +package problem0392 + +func isSubsequence(s string, t string) bool { + var i, j = 0, 0 + + for i < len(s) && j < len(t) { + if s[i] == t[j] { + i++ + } + j++ + } + return i == len(s) +} diff --git a/Algorithms/0392.is-subsequence/is-subsequence_test.go b/Algorithms/0392.is-subsequence/is-subsequence_test.go new file mode 100755 index 000000000..7ae8e58de --- /dev/null +++ b/Algorithms/0392.is-subsequence/is-subsequence_test.go @@ -0,0 +1,47 @@ +package problem0392 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + t string + ans bool +}{ + + { + "abc", + "ahbgdc", + true, + }, + + { + "axc", + "ahbgdc", + false, + }, + + // 可以有多个 testcase +} + +func Test_isSubsequence(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isSubsequence(tc.s, tc.t), "输入:%v", tc) + } +} + +func Benchmark_isSubsequence(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isSubsequence(tc.s, tc.t) + } + } +} diff --git a/Algorithms/0393.utf-8-validation/README.md b/Algorithms/0393.utf-8-validation/README.md new file mode 100755 index 000000000..7c4ffc7bc --- /dev/null +++ b/Algorithms/0393.utf-8-validation/README.md @@ -0,0 +1,45 @@ +# [393. UTF-8 Validation](https://leetcode.com/problems/utf-8-validation/) + +## 题目 + +A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: + +For 1-byte character, the first bit is a 0, followed by its unicode code. +For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 bytes with most significant 2 bits being 10. + +This is how the UTF-8 encoding would work: + +```text + Char. number range | UTF-8 octet sequence + (hexadecimal) | (binary) + --------------------+--------------------------------------------- + 0000 0000-0000 007F | 0xxxxxxx + 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx +``` + +Given an array of integers representing the data, return whether it is a valid utf-8 encoding. + +Note: +The input is an array of integers. Only the least significant 8 bits of each integer is used to store the data. This means each integer represents only 1 byte of data. + +```text +Example 1: +data = [197, 130, 1], which represents the octet sequence: 11000101 10000010 00000001. + +Return true. +It is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character. + +Example 2: +data = [235, 140, 4], which represented the octet sequence: 11101011 10001100 00000100. + +Return false. +The first 3 bits are all one's and the 4th bit is 0 means it is a 3-bytes character. +The next byte is a continuation byte which starts with 10 and that's correct. +But the second continuation byte does not start with 10, so it is invalid. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0393.utf-8-validation/utf-8-validation.go b/Algorithms/0393.utf-8-validation/utf-8-validation.go new file mode 100755 index 000000000..ac2b79e61 --- /dev/null +++ b/Algorithms/0393.utf-8-validation/utf-8-validation.go @@ -0,0 +1,30 @@ +package problem0393 + +func validUtf8(data []int) bool { + // cnt 是还需检查的 byte 的个数 + cnt := 0 + var d int + for _, d = range data { + if cnt == 0 { + switch { + case d>>3 == 30: //0b11110 + cnt = 3 + case d>>4 == 14: //0b1110 + cnt = 2 + case d>>5 == 6: //0b110 + cnt = 1 + case d>>7 > 0: + // data[0] 和 data[len(data)-1] 都会到此处来检查 + return false + } + } else { + // 非首尾的 byte 必须以 0b10 开头 + if d>>6 != 2 { //0b10 + return false + } + cnt-- + } + } + + return 0 == cnt +} diff --git a/Algorithms/0393.utf-8-validation/utf-8-validation_test.go b/Algorithms/0393.utf-8-validation/utf-8-validation_test.go new file mode 100755 index 000000000..bd6f19f33 --- /dev/null +++ b/Algorithms/0393.utf-8-validation/utf-8-validation_test.go @@ -0,0 +1,54 @@ +package problem0393 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + data []int + ans bool +}{ + + { + []int{241, 130, 130, 130, 1}, + true, + }, + + { + []int{197, 130, 1}, + true, + }, + + { + []int{129}, + false, + }, + + { + []int{235, 140, 4}, + false, + }, + + // 可以有多个 testcase +} + +func Test_validUtf8(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, validUtf8(tc.data), "输入:%v", tc) + } +} + +func Benchmark_validUtf8(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validUtf8(tc.data) + } + } +} diff --git a/Algorithms/0394.decode-string/README.md b/Algorithms/0394.decode-string/README.md new file mode 100755 index 000000000..2d0a4d7eb --- /dev/null +++ b/Algorithms/0394.decode-string/README.md @@ -0,0 +1,23 @@ +# [394. Decode String](https://leetcode.com/problems/decode-string/) + +## 题目 + +Given an encoded string, return it's decoded string. + +The encoding rule is: `k[encoded_string]`, where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. + +You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc. + +Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there won't be input like 3a or 2[4]. + +Examples: + +```text +s = "3[a]2[bc]", return "aaabcbc". +s = "3[a2[c]]", return "accaccacc". +s = "2[abc]3[cd]ef", return "abcabccdcdcdef". +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0394.decode-string/decode-string.go b/Algorithms/0394.decode-string/decode-string.go new file mode 100755 index 000000000..362f8800b --- /dev/null +++ b/Algorithms/0394.decode-string/decode-string.go @@ -0,0 +1,59 @@ +package problem0394 + +import ( + "strconv" +) + +func decodeString(s string) string { + n := len(s) + + // i 是第一个数字的位置 + i := 0 + for i < n && (s[i] < '0' || '9' < s[i]) { + i++ + } + if i == n { + // 没有数字,直接返回 s + return s + } + + // j 是第一个 '[' 的位置 + j := i + 1 + // 由题意可知,s 很规范 + // 存在数字的话,必定存在 '[' 和 ']' + for s[j] != '[' { + j++ + } + + // k 是与 j 的 '[' 对应的 ']' 的位置 + k := j + count := 1 + for count > 0 { + k++ + + if s[k] == '[' { + count++ + } else if s[k] == ']' { + count-- + } + } + + // i:第一个数字的位置 + // | j:第一个 '[' 的位置 + // | | k:与 j 的 '[' 对应的 ']' 的位置 + // ↓ ↓ ↓ + // "abcd234[*******]efg" + + // 题目说了, s 很规范 + num, _ := strconv.Atoi(s[i:j]) + + return s[:i] + times(num, decodeString(s[j+1:k])) + decodeString(s[k+1:]) +} + +func times(n int, s string) string { + res := "" + for i := 0; i < n; i++ { + res += s + } + return res +} diff --git a/Algorithms/0394.decode-string/decode-string_test.go b/Algorithms/0394.decode-string/decode-string_test.go new file mode 100755 index 000000000..22e419ee5 --- /dev/null +++ b/Algorithms/0394.decode-string/decode-string_test.go @@ -0,0 +1,59 @@ +package problem0394 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "aaabcbc", + "aaabcbc", + }, + + { + "10[a]2[bc]", + "aaaaaaaaaabcbc", + }, + + { + "3[a]2[bc]", + "aaabcbc", + }, + + { + "3[a2[c]]", + "accaccacc", + }, + + { + "2[abc]3[cd]ef", + "abcabccdcdcdef", + }, + + // 可以有多个 testcase +} + +func Test_decodeString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, decodeString(tc.s), "输入:%v", tc) + } +} + +func Benchmark_decodeString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + decodeString(tc.s) + } + } +} diff --git a/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/README.md b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/README.md new file mode 100755 index 000000000..058069ff2 --- /dev/null +++ b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/README.md @@ -0,0 +1,33 @@ +# [395. Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) + +## 题目 + +Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times. + +Example 1: + +```text +Input: +s = "aaabb", k = 3 + +Output: +3 + +The longest substring is "aaa", as 'a' is repeated 3 times. +``` + +Example 2: + +```text +Input: +s = "ababbc", k = 2 + +Output: +5 + +The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters.go b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters.go new file mode 100755 index 000000000..53bd7fce9 --- /dev/null +++ b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters.go @@ -0,0 +1,62 @@ +package problem0395 + +import ( + "strings" +) + +func longestSubstring(s string, k int) int { + if len(s) < k { + return 0 + } + + // count 中,记录了每个字母出现的次数 + count := make(map[byte]int, len(s)) + // maxCount 出现最多字母的出现次数 + maxCount := 0 + for i := range s { + count[s[i]]++ + maxCount = max(maxCount, count[s[i]]) + } + if maxCount < k { + // 没有字母达到 k 次 + return 0 + } + + var b byte + var c int + + // useless 收集了没有达到 k 次的字母 + useless := make([]string, 0, len(count)) + for b, c = range count { + if c < k { + useless = append(useless, string(b)) + } + } + + if len(useless) == 0 { + // 所有的字母都达到了 k 次 + return len(s) + } + + var u string + for _, u = range useless { + s = strings.Replace(s, u, ",", -1) + } + + ss := strings.Split(s, ",") + + // 递归求解 + maxLen := 0 + for _, s = range ss { + maxLen = max(maxLen, longestSubstring(s, k)) + } + + return maxLen +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters_test.go b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters_test.go new file mode 100755 index 000000000..91d0dbef8 --- /dev/null +++ b/Algorithms/0395.longest-substring-with-at-least-k-repeating-characters/longest-substring-with-at-least-k-repeating-characters_test.go @@ -0,0 +1,65 @@ +package problem0395 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + k int + ans int +}{ + + { + "abcdedghijklmnopqrstuvwxyz", + 2, + 0, + }, + + { + "aaabb", + 4, + 0, + }, + + { + "acabb", + 2, + 2, + }, + + { + "aaabb", + 3, + 3, + }, + + { + "ababbc", + 2, + 5, + }, + + // 可以有多个 testcase +} + +func Test_longestSubstring(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestSubstring(tc.s, tc.k), "输入:%v", tc) + } +} + +func Benchmark_longestSubstring(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestSubstring(tc.s, tc.k) + } + } +} diff --git a/Algorithms/0396.rotate-function/README.md b/Algorithms/0396.rotate-function/README.md new file mode 100755 index 000000000..6c51e347d --- /dev/null +++ b/Algorithms/0396.rotate-function/README.md @@ -0,0 +1,55 @@ +# [396. Rotate Function](https://leetcode.com/problems/rotate-function/) + +## 题目 + +Given an array of integers A and let n to be its length. + +Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a "rotation function" F on A as follow: + +```text +F(k) = 0 * Bk[0] + 1 * Bk[1] + ... + (n-1) * Bk[n-1]. +``` + +Calculate the maximum value of F(0), F(1), ..., F(n-1). + +Note: +n is guaranteed to be less than 105. + +Example: + +```text +A = [4, 3, 2, 6] + +F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25 +F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16 +F(2) = (0 * 2) + (1 * 6) + (2 * 4) + (3 * 3) = 0 + 6 + 8 + 9 = 23 +F(3) = (0 * 3) + (1 * 2) + (2 * 6) + (3 * 4) = 0 + 2 + 12 + 12 = 26 + +So the maximum value of F(0), F(1), F(2), F(3) is F(3) = 26. +``` + +## 解题思路 + +见程序注释 + +```text +F(k) = 0 * Bk[0] + 1 * Bk[1] + ... + (n-1) * Bk[n-1] +F(k-1) = 0 * Bk-1[0] + 1 * Bk-1[1] + ... + (n-1) * Bk-1[n-1] + = 0 * Bk[1] + 1 * Bk[2] + ... + (n-2) * Bk[n-1] + (n-1) * Bk[0] + +Then, + +F(k) - F(k-1) = Bk[1] + Bk[2] + ... + Bk[n-1] + (1-n)Bk[0] + = (Bk[0] + ... + Bk[n-1]) - nBk[0] + = sum - nBk[0] +Thus, + +F(k) = F(k-1) + sum - nBk[0] + +What is Bk[0]? + +k = 0; B[0] = A[0]; +k = 1; B[0] = A[len-1]; +k = 2; B[0] = A[len-2]; +... +``` \ No newline at end of file diff --git a/Algorithms/0396.rotate-function/rotate-function.go b/Algorithms/0396.rotate-function/rotate-function.go new file mode 100755 index 000000000..b997138c0 --- /dev/null +++ b/Algorithms/0396.rotate-function/rotate-function.go @@ -0,0 +1,26 @@ +package problem0396 + +func maxRotateFunction(a []int) int { + n := len(a) + + var F, sum int + for i := 0; i < n; i++ { + F += i * a[i] + sum += a[i] + } + + maxF := F + for i := n - 1; 1 <= i; i-- { + F += sum - n*a[i] + maxF = max(F, maxF) + } + + return maxF +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0396.rotate-function/rotate-function_test.go b/Algorithms/0396.rotate-function/rotate-function_test.go new file mode 100755 index 000000000..9e779d090 --- /dev/null +++ b/Algorithms/0396.rotate-function/rotate-function_test.go @@ -0,0 +1,36 @@ +package problem0396 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + {[]int{4, 3, 2, 6}, 26}, + + // 可以有多个 testcase +} + +func Test_maxRotateFunction(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxRotateFunction(tc.A), "输入:%v", tc) + } +} + +func Benchmark_maxRotateFunction(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxRotateFunction(tc.A) + } + } +} diff --git a/Algorithms/0397.integer-replacement/README.md b/Algorithms/0397.integer-replacement/README.md new file mode 100755 index 000000000..6e941631e --- /dev/null +++ b/Algorithms/0397.integer-replacement/README.md @@ -0,0 +1,42 @@ +# [397. Integer Replacement](https://leetcode.com/problems/integer-replacement/) + +## 题目 + +Given a positive integer n and you can do operations as follow: + +1. If n is even, replace n with n/2. +1. If n is odd, you can replace n with either n + 1 or n - 1. + +What is the minimum number of replacements needed for n to become 1? + +Example 1: + +```text +Input: +8 + +Output: +3 + +Explanation: +8 -> 4 -> 2 -> 1 +``` + +Example 2: + +```text +Input: +7 + +Output: +4 + +Explanation: +7 -> 8 -> 4 -> 2 -> 1 +or +7 -> 6 -> 3 -> 2 -> 1 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0397.integer-replacement/integer-replacement.go b/Algorithms/0397.integer-replacement/integer-replacement.go new file mode 100755 index 000000000..dfbde916e --- /dev/null +++ b/Algorithms/0397.integer-replacement/integer-replacement.go @@ -0,0 +1,32 @@ +package problem0397 + +func integerReplacement(n int) int { + // rec[i] == integerReplacement(i) + rec := make(map[int]int) + rec[1] = 0 + + var ir func(int) int + ir = func(i int) int { + // 已经计算过的 i,可以直接从 rec 中读取出来 + if n, ok := rec[i]; ok { + return n + } + + if i%2 == 0 { + rec[i] = ir(i/2) + 1 + return rec[i] + } + + rec[i] = min(ir(i+1), ir(i-1)) + 1 + return rec[i] + } + + return ir(n) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0397.integer-replacement/integer-replacement_test.go b/Algorithms/0397.integer-replacement/integer-replacement_test.go new file mode 100755 index 000000000..b5d79d516 --- /dev/null +++ b/Algorithms/0397.integer-replacement/integer-replacement_test.go @@ -0,0 +1,40 @@ +package problem0397 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {8, 3}, + + {1234567891, 42}, + + {7, 4}, + + // 可以有多个 testcase +} + +func Test_integerReplacement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, integerReplacement(tc.n), "输入:%v", tc) + } +} + +func Benchmark_integerReplacement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + integerReplacement(tc.n) + } + } +} diff --git a/Algorithms/0398.random-pick-index/README.md b/Algorithms/0398.random-pick-index/README.md new file mode 100755 index 000000000..5de3424ef --- /dev/null +++ b/Algorithms/0398.random-pick-index/README.md @@ -0,0 +1,25 @@ +# [398. Random Pick Index](https://leetcode.com/problems/random-pick-index/) + +## 题目 + +Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array. + +Note: +The array size can be very large. Solution that uses too much extra space will not pass the judge. + +Example: + +```text +int[] nums = new int[] {1,2,3,3,3}; +Solution solution = new Solution(nums); + +// pick(3) should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning. +solution.pick(3); + +// pick(1) should return 0. Since in the array only nums[0] is equal to 1. +solution.pick(1); +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0398.random-pick-index/random-pick-index.go b/Algorithms/0398.random-pick-index/random-pick-index.go new file mode 100755 index 000000000..0b9d0143d --- /dev/null +++ b/Algorithms/0398.random-pick-index/random-pick-index.go @@ -0,0 +1,28 @@ +package problem0398 + +import "math/rand" + +// Solution 是答案所需的数据结构 +type Solution struct { + m map[int][]int +} + +// Constructor 构建了 Solution +func Constructor(nums []int) Solution { + m := make(map[int][]int, len(nums)) + for i, v := range nums { + m[v] = append(m[v], i) + } + return Solution{m: m} +} + +// Pick 随机出现 target 在 nums 中的索引号 +func (s *Solution) Pick(target int) int { + return s.m[target][rand.Intn(len(s.m[target]))] +} + +/** + * Your Solution object will be instantiated and called as such: + * obj := Constructor(nums); + * param_1 := obj.Pick(target); + */ diff --git a/Algorithms/0398.random-pick-index/random-pick-index_test.go b/Algorithms/0398.random-pick-index/random-pick-index_test.go new file mode 100755 index 000000000..724dba668 --- /dev/null +++ b/Algorithms/0398.random-pick-index/random-pick-index_test.go @@ -0,0 +1,28 @@ +package problem0398 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Constructor(t *testing.T) { + ast := assert.New(t) + + nums := []int{1, 2, 2, 3, 3, 3} + // all index of 1 + is1 := []int{0} + // all index of 2 + is2 := []int{1, 2} + // all index of 3 + is3 := []int{3, 4, 5} + + s := Constructor(nums) + + ast.Contains(is1, s.Pick(1), "无法正确第返回 1 的索引号") + + ast.Contains(is2, s.Pick(2), "无法正确第返回 2 的索引号") + + ast.Contains(is3, s.Pick(3), "无法正确第返回 3 的索引号") + +} diff --git a/Algorithms/0399.evaluate-division/README.md b/Algorithms/0399.evaluate-division/README.md new file mode 100755 index 000000000..e5ff4cd9f --- /dev/null +++ b/Algorithms/0399.evaluate-division/README.md @@ -0,0 +1,24 @@ +# [399. Evaluate Division](https://leetcode.com/problems/evaluate-division/) + +## 题目 + +Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return -1.0. + +Example: + +```text +Given a / b = 2.0, b / c = 3.0. queries are: a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ? . return [6.0, 0.5, -1.0, 1.0, -1.0 ]. + +The input is: vector> equations, vector& values, vector> queries , where equations.size() == values.size(), and the values are positive. This represents the equations. Return vector. + +According to the example above: +equations = [ ["a", "b"], ["b", "c"] ], +values = [2.0, 3.0], +queries = [ ["a", "c"], ["b", "a"], ["a", "e"], ["a", "a"], ["x", "x"] ]. + +The input is always valid. You may assume that evaluating the queries will result in no division by zero and there is no contradiction. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0399.evaluate-division/evaluate-division.go b/Algorithms/0399.evaluate-division/evaluate-division.go new file mode 100755 index 000000000..3e8101201 --- /dev/null +++ b/Algorithms/0399.evaluate-division/evaluate-division.go @@ -0,0 +1,72 @@ +package problem0399 + +func calcEquation(equations [][]string, values []float64, queries [][]string) []float64 { + // 建立变量之间的转换关系 + m := make(map[string]map[string]float64) + for i, e := range equations { + a, b := e[0], e[1] + v := values[i] + // 添加 a / b 的记录 + if _, ok := m[a]; !ok { + m[a] = make(map[string]float64) + } + m[a][b] = 1.0 / v + // 添加 b / a 的记录 + if _, ok := m[b]; !ok { + m[b] = make(map[string]float64) + } + m[b][a] = v + } + + // 逐个搜索 queries 的结果 + res := make([]float64, len(queries)) + for i, q := range queries { + res[i] = bfs(m, q[0], q[1]) + } + + return res +} + +type entry struct { + s string + f float64 +} + +func bfs(m map[string]map[string]float64, a, b string) float64 { + _, ok := m[a] + if !ok { + return -1.0 + } + _, ok = m[b] + if !ok { + return -1.0 + } + + if a == b { + return 1.0 + } + + isVisited := make(map[string]bool) + queue := []entry{{a, 1.0}} + + for len(queue) > 0 { + e := queue[0] + queue = queue[1:] + if e.s == b { + // 找到了 b + return 1.0 / e.f + } + + if isVisited[e.s] { + continue + } + + isVisited[e.s] = true + + for k, v := range m[e.s] { + queue = append(queue, entry{k, v * e.f}) + } + } + //没有找到 b + return -1.0 +} diff --git a/Algorithms/0399.evaluate-division/evaluate-division_test.go b/Algorithms/0399.evaluate-division/evaluate-division_test.go new file mode 100755 index 000000000..077a6ebea --- /dev/null +++ b/Algorithms/0399.evaluate-division/evaluate-division_test.go @@ -0,0 +1,67 @@ +package problem0399 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + equations [][]string + values []float64 + queries [][]string + ans []float64 +}{ + + { + [][]string{[]string{"x1", "x2"}, []string{"x2", "x3"}, []string{"x1", "x4"}, []string{"x2", "x5"}}, + []float64{3.0, 0.5, 3.4, 5.6}, + [][]string{[]string{"x2", "x4"}, []string{"x1", "x5"}, []string{"x1", "x3"}, []string{"x5", "x5"}, []string{"x5", "x1"}, []string{"x3", "x4"}, []string{"x4", "x3"}, []string{"x6", "x6"}, []string{"x0", "x0"}}, + []float64{1.13333, 16.80000, 1.50000, 1.00000, 0.05952, 2.26667, 0.44118, -1.00000, -1.00000}, + }, + + { + [][]string{[]string{"a", "b"}, []string{"b", "c"}}, + []float64{2.0, 3.0}, + [][]string{[]string{"a", "c"}, []string{"b", "a"}, []string{"a", "e"}, []string{"a", "a"}, []string{"x", "x"}}, + []float64{6.0, 0.5, -1.0, 1.0, -1.0}, + }, + + { + [][]string{[]string{"a", "b"}, []string{"e", "f"}, []string{"b", "e"}}, + []float64{3.4, 1.4, 2.3}, + [][]string{[]string{"b", "a"}, []string{"a", "f"}, []string{"f", "f"}, []string{"e", "e"}, []string{"c", "c"}, []string{"a", "c"}, []string{"f", "e"}}, + []float64{0.29412, 10.94800, 1.00000, 1.00000, -1.00000, -1.00000, 0.71429}, + }, + + { + [][]string{[]string{"a", "b"}, []string{"c", "d"}}, + []float64{1.0, 1.0}, + [][]string{[]string{"a", "c"}, []string{"b", "d"}, []string{"b", "a"}, []string{"d", "c"}}, + []float64{-1.00000, -1.00000, 1.00000, 1.00000}, + }, + + // 可以有多个 testcase +} + +func Test_calcEquation(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := calcEquation(tc.equations, tc.values, tc.queries) + for i := range ans { + ast.InDelta(tc.ans[i], ans[i], 0.0001) + } + } +} + +func Benchmark_calcEquation(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + calcEquation(tc.equations, tc.values, tc.queries) + } + } +} diff --git a/Algorithms/0400.nth-digit/README.md b/Algorithms/0400.nth-digit/README.md new file mode 100755 index 000000000..403a6268d --- /dev/null +++ b/Algorithms/0400.nth-digit/README.md @@ -0,0 +1,35 @@ +# [400. Nth Digit](https://leetcode.com/problems/nth-digit/) + +## 题目 + +Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... + +Note: +n is positive and will fit within the range of a 32-bit signed integer (n < 231). + +Example 1: + +```text +Input: +3 + +Output: +3 +``` + +Example 2: + +```text +Input: +11 + +Output: +0 + +Explanation: +The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0400.nth-digit/nth-digit.go b/Algorithms/0400.nth-digit/nth-digit.go new file mode 100755 index 000000000..7c286bbc9 --- /dev/null +++ b/Algorithms/0400.nth-digit/nth-digit.go @@ -0,0 +1,33 @@ +package problem0400 + +func findNthDigit(n int) int { + // step 1: 寻找拥有 NthDigit 的数的位数 digits + // 有 count 个数 是 digits 位数 + count, digits := 9, 1 + // num 是最小的 digits 位数 + num := 1 + for n-count*digits > 0 { + n -= count * digits + count *= 10 + digits++ + num *= 10 + } + + // step 2: 找到拥有 NthDigit 的数 + // index 是 NthDigit 是目标数中的 索引号 + index := n % digits + if index == 0 { + index = digits + } + // 让 num 成为拥有 NthDigit 的数 + num += n / digits + if index == digits { + num-- + } + + // step 3: 找到 NthDigit + for i := index; i < digits; i++ { + num /= 10 + } + return num % 10 +} diff --git a/Algorithms/0400.nth-digit/nth-digit_test.go b/Algorithms/0400.nth-digit/nth-digit_test.go new file mode 100755 index 000000000..43ec2188d --- /dev/null +++ b/Algorithms/0400.nth-digit/nth-digit_test.go @@ -0,0 +1,49 @@ +package problem0400 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 2147483647, + 2, + }, + + { + 3, + 3, + }, + + { + 11, + 0, + }, + + // 可以有多个 testcase +} + +func Test_findNthDigit(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findNthDigit(tc.n), "输入:%v", tc) + } +} + +func Benchmark_findNthDigit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findNthDigit(tc.n) + } + } +} diff --git a/Algorithms/0401.binary-watch/README.md b/Algorithms/0401.binary-watch/README.md new file mode 100755 index 000000000..de340b495 --- /dev/null +++ b/Algorithms/0401.binary-watch/README.md @@ -0,0 +1,28 @@ +# [401. Binary Watch](https://leetcode.com/problems/binary-watch/) + +## 题目 + +A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). + +Each LED represents a zero or one, with the least significant bit on the right. + +![p](https://upload.wikimedia.org/wikipedia/commons/8/8b/Binary_clock_samui_moon.jpg) +For example, the above binary watch reads "3:25". + +Given a non-negative integer n which represents the number of LEDs that are currently on, return all possible times the watch could represent. + +Example: + +```text +Input: n = 1Return: ["1:00", "2:00", "4:00", "8:00", "0:01", "0:02", "0:04", "0:08", "0:16", "0:32"] +``` + +Note: + +- The order of output does not matter. +- The hour must not contain a leading zero, for example "01:00" is not valid, it should be "1:00". +- The minute must be consist of two digits and may contain a leading zero, for example "10:2" is not valid, it should be "10:02". + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0401.binary-watch/binary-watch.go b/Algorithms/0401.binary-watch/binary-watch.go new file mode 100755 index 000000000..4f15057ad --- /dev/null +++ b/Algorithms/0401.binary-watch/binary-watch.go @@ -0,0 +1,49 @@ +package problem0401 + +import ( + "fmt" + "sort" +) + +func readBinaryWatch(n int) []string { + res := make([]string, 0, 8) + leds := make([]bool, 10) + + var dfs func(int, int) + dfs = func(idx, n int) { + var h, m int + if n == 0 { + m, h = get(leds[:6]), get(leds[6:]) + if h < 12 && m < 60 { + res = append(res, fmt.Sprintf("%d:%02d", h, m)) + } + return + } + + for i := idx; i < len(leds)-n+1; i++ { + leds[i] = true + dfs(i+1, n-1) + leds[i] = false + } + } + + dfs(0, n) + + sort.Strings(res) + + return res +} + +var bs = []int{1, 2, 4, 8, 16, 32} + +func get(leds []bool) int { + var sum int + size := len(leds) + for i := 0; i < size; i++ { + if leds[i] { + sum += bs[i] + } + } + + return sum +} diff --git a/Algorithms/0401.binary-watch/binary-watch_test.go b/Algorithms/0401.binary-watch/binary-watch_test.go new file mode 100755 index 000000000..25309ee4b --- /dev/null +++ b/Algorithms/0401.binary-watch/binary-watch_test.go @@ -0,0 +1,46 @@ +package problem0401 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans []string +}{ + + { + 1, + []string{"0:01", "0:02", "0:04", "0:08", "0:16", "0:32", "1:00", "2:00", "4:00", "8:00"}, + }, + + { + 2, + []string{"0:03", "0:05", "0:06", "0:09", "0:10", "0:12", "0:17", "0:18", "0:20", "0:24", "0:33", "0:34", "0:36", "0:40", "0:48", "1:01", "1:02", "1:04", "1:08", "1:16", "1:32", "2:01", "2:02", "2:04", "2:08", "2:16", "2:32", "3:00", "4:01", "4:02", "4:04", "4:08", "4:16", "4:32", "5:00", "6:00", "8:01", "8:02", "8:04", "8:08", "8:16", "8:32", "9:00", "10:00"}, + }, + // 可以有多个 testcase +} + +func Test_readBinaryWatch(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := readBinaryWatch(tc.num) + sort.Strings(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_readBinaryWatch(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + readBinaryWatch(tc.num) + } + } +} diff --git a/Algorithms/0402.remove-k-digits/README.md b/Algorithms/0402.remove-k-digits/README.md new file mode 100755 index 000000000..ac295cbff --- /dev/null +++ b/Algorithms/0402.remove-k-digits/README.md @@ -0,0 +1,38 @@ +# [402. Remove K Digits](https://leetcode.com/problems/remove-k-digits/) + +## 题目 + +Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. + +Note: + +- The length of num is less than 10002 and will be ≥ k. +- The given num does not contain any leading zero. + +Example 1: + +```text +Input: num = "1432219", k = 3 +Output: "1219" +Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest. +``` + +Example 2: + +```text +Input: num = "10200", k = 1 +Output: "200" +Explanation: Remove the leading 1 and the number is 200. Note that the output must not contain leading zeroes. +``` + +Example 3: + +```text +Input: num = "10", k = 2 +Output: "0" +Explanation: Remove all the digits from the number and it is left with nothing which is 0. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0402.remove-k-digits/remove-k-digits.go b/Algorithms/0402.remove-k-digits/remove-k-digits.go new file mode 100755 index 000000000..94385a57f --- /dev/null +++ b/Algorithms/0402.remove-k-digits/remove-k-digits.go @@ -0,0 +1,30 @@ +package problem0402 + +func removeKdigits(num string, k int) string { + // 返回值的长度 + digits := len(num) - k + stack := make([]byte, len(num)) + top := 0 + + for i := range num { + // 在还能删除的前提下 + // 从上往下,删除 stack 中所有比 num[i] 大的数 + for top > 0 && stack[top-1] > num[i] && k > 0 { + top-- + k-- + } + stack[top] = num[i] + top++ + } + + // 处理开头的 '0' + i := 0 + for i < digits && stack[i] == '0' { + i++ + } + + if i == digits { + return "0" + } + return string(stack[i:digits]) +} diff --git a/Algorithms/0402.remove-k-digits/remove-k-digits_test.go b/Algorithms/0402.remove-k-digits/remove-k-digits_test.go new file mode 100755 index 000000000..fb516c68e --- /dev/null +++ b/Algorithms/0402.remove-k-digits/remove-k-digits_test.go @@ -0,0 +1,71 @@ +package problem0402 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num string + k int + ans string +}{ + + { + "10200", + 1, + "200", + }, + + { + "1234567890", + 9, + "0", + }, + + { + "1111111", + 3, + "1111", + }, + + { + "102030", + 3, + "0", + }, + + { + "1432219", + 3, + "1219", + }, + + { + "10", + 2, + "0", + }, + + // 可以有多个 testcase +} + +func Test_removeKdigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, removeKdigits(tc.num, tc.k), "输入:%v", tc) + } +} + +func Benchmark_removeKdigits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeKdigits(tc.num, tc.k) + } + } +} diff --git a/Algorithms/0403.frog-jump/README.md b/Algorithms/0403.frog-jump/README.md new file mode 100755 index 000000000..838774cf0 --- /dev/null +++ b/Algorithms/0403.frog-jump/README.md @@ -0,0 +1,44 @@ +# [403. Frog Jump](https://leetcode.com/problems/frog-jump/) + +## 题目 + +A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water. + +Given a list of stones' positions (in units) in sorted ascending order, determine if the frog is able to cross the river by landing on the last stone. Initially, the frog is on the first stone and assume the first jump must be 1 unit. + +If the frog's last jump was k units, then its next jump must be either k - 1, k, or k + 1 units. Note that the frog can only jump in the forward direction. + +Note: + +1. The number of stones is ≥ 2 and is < 1,100. +1. Each stone's position will be a non-negative integer < 231. +1. The first stone's position is always 0. + +Example 1: + +```text +[0,1,3,5,6,8,12,17] + +There are a total of 8 stones. +The first stone at the 0th unit, second stone at the 1st unit, +third stone at the 3rd unit, and so on... +The last stone at the 17th unit. + +Return true. The frog can jump to the last stone by jumping +1 unit to the 2nd stone, then 2 units to the 3rd stone, then +2 units to the 4th stone, then 3 units to the 6th stone, +4 units to the 7th stone, and 5 units to the 8th stone. +``` + +Example 2: + +```text +[0,1,2,3,4,8,9,11] + +Return false. There is no way to jump to the last stone as +the gap between the 5th and 6th stone is too large. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0403.frog-jump/frog-jump.go b/Algorithms/0403.frog-jump/frog-jump.go new file mode 100755 index 000000000..df9c5c9f1 --- /dev/null +++ b/Algorithms/0403.frog-jump/frog-jump.go @@ -0,0 +1,43 @@ +package problem0403 + +func canCross(stones []int) bool { + n := len(stones) + if n == 0 || stones[1] != 1 { + return false + } + + if n == 1 || n == 2 { + return true + } + + last := stones[n-1] + + hs := make(map[int]bool, n) + + for i := 0; i < n; i++ { + if i > 3 && stones[i] > stones[i-1]*2 { + return false + } + hs[stones[i]] = true + } + + var dfs func(map[int]bool, int, int) bool + dfs = func(hs map[int]bool, pos, jump int) bool { + if pos+jump-1 == last || pos+jump == last || pos+jump+1 == last { + return true + } + // i-- + // 先跨大步 + for i := 1; -1 <= i; i-- { + if jump+i > 0 && hs[pos+jump+i] { + if dfs(hs, pos+jump+i, jump+i) { + return true + } + } + } + + return false + } + + return dfs(hs, 1, 1) +} diff --git a/Algorithms/0403.frog-jump/frog-jump_test.go b/Algorithms/0403.frog-jump/frog-jump_test.go new file mode 100755 index 000000000..2e90d3504 --- /dev/null +++ b/Algorithms/0403.frog-jump/frog-jump_test.go @@ -0,0 +1,44 @@ +package problem0403 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones []int + ans bool +}{ + + // 这个 test case 很耗时 + {[]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 1035}, true}, + {[]int{0, 1, 3, 5, 6, 8, 12, 17}, true}, + {[]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15}, true}, + {[]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16}, false}, + {[]int{0, 1}, true}, + {[]int{0, 1, 2, 3, 4, 8, 9, 11}, false}, + {[]int{0, 1, 2, 3, 4, 18, 9, 11}, false}, + {[]int{0, 2, 2, 3, 4, 8, 9, 11}, false}, + + // 可以有多个 testcase +} + +func Test_canCross(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canCross(tc.stones), "输入:%v", tc) + } +} + +func Benchmark_canCross(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canCross(tc.stones) + } + } +} diff --git a/Algorithms/0404.sum-of-left-leaves/README.md b/Algorithms/0404.sum-of-left-leaves/README.md new file mode 100755 index 000000000..d2a6dc302 --- /dev/null +++ b/Algorithms/0404.sum-of-left-leaves/README.md @@ -0,0 +1,20 @@ +# [404. Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) + +## 题目 + +Find the sum of all left leaves in a given binary tree. + +Example: + +```text + 3 + / \ + 9 20 + / \ + 15 7 +There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves.go b/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves.go new file mode 100755 index 000000000..febd701dc --- /dev/null +++ b/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves.go @@ -0,0 +1,23 @@ +package problem0404 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func sumOfLeftLeaves(root *TreeNode) int { + if root==nil { + return 0 + } + + if root.Left == nil{ + return sumOfLeftLeaves(root.Right) + } + + if root.Left.Left == nil && root.Left.Right==nil { + return root.Left.Val + sumOfLeftLeaves(root.Right) + } + + return sumOfLeftLeaves(root.Left)+ sumOfLeftLeaves(root.Right) +} diff --git a/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves_test.go b/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves_test.go new file mode 100755 index 000000000..386517725 --- /dev/null +++ b/Algorithms/0404.sum-of-left-leaves/sum-of-left-leaves_test.go @@ -0,0 +1,50 @@ +package problem0404 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{3, 7, 9, 8, 20, 15, 7}, + []int{9, 7, 8, 3, 15, 20, 7}, + 24, + }, + + { + []int{3, 9, 20, 15, 7}, + []int{9, 3, 15, 20, 7}, + 24, + }, + + // 可以有多个 testcase +} + +func Test_sumOfLeftLeaves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, sumOfLeftLeaves(root), "输入:%v", tc) + } +} + +func Benchmark_sumOfLeftLeaves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + sumOfLeftLeaves(root) + } + } +} diff --git a/Algorithms/0405.convert-a-number-to-hexadecimal/README.md b/Algorithms/0405.convert-a-number-to-hexadecimal/README.md new file mode 100755 index 000000000..ecbc3c291 --- /dev/null +++ b/Algorithms/0405.convert-a-number-to-hexadecimal/README.md @@ -0,0 +1,36 @@ +# [405. Convert a Number to Hexadecimal](https://leetcode.com/problems/convert-a-number-to-hexadecimal/) + +## 题目 + +Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. + +Note: + +1. All letters in hexadecimal (a-f) must be in lowercase. +1. The hexadecimal string must not contain extra leading 0s. If the number is zero, it is represented by a single zero character '0'; otherwise, the first character in the hexadecimal string will not be the zero character. +1. The given number is guaranteed to fit within the range of a 32-bit signed integer. +1. You must not use any method provided by the library which converts/formats the number to hex directly. + +Example 1: + +```text +Input: +26 + +Output: +"1a" +``` + +Example 2: + +```text +Input: +-1 + +Output: +"ffffffff" +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.go b/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.go new file mode 100755 index 000000000..6ecabdb8c --- /dev/null +++ b/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal.go @@ -0,0 +1,34 @@ +package problem0405 + +var h = []string{ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "a", + "b", + "c", + "d", + "e", + "f", +} + +func toHex(num int) string { + if num == 0 { + return "0" + } + + hex := "" + for i := 0; i < 8 && num != 0; i++ { + hex = h[num&15] + hex + num >>= 4 + } + + return hex +} diff --git a/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal_test.go b/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal_test.go new file mode 100755 index 000000000..5ef1dc5bc --- /dev/null +++ b/Algorithms/0405.convert-a-number-to-hexadecimal/convert-a-number-to-hexadecimal_test.go @@ -0,0 +1,49 @@ +package problem0405 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans string +}{ + + { + 0, + "0", + }, + + { + 26, + "1a", + }, + + { + -1, + "ffffffff", + }, + + // 可以有多个 testcase +} + +func Test_toHex(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, toHex(tc.num), "输入:%v", tc) + } +} + +func Benchmark_toHex(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + toHex(tc.num) + } + } +} diff --git a/Algorithms/0406.queue-reconstruction-by-height/README.md b/Algorithms/0406.queue-reconstruction-by-height/README.md new file mode 100755 index 000000000..95b08bb17 --- /dev/null +++ b/Algorithms/0406.queue-reconstruction-by-height/README.md @@ -0,0 +1,22 @@ +# [406. Queue Reconstruction by Height](https://leetcode.com/problems/queue-reconstruction-by-height/) + +## 题目 + +Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue. + +Note: +The number of people is less than 1,100. + +Example + +```text +Input: +[[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]] + +Output: +[[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height.go b/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height.go new file mode 100755 index 000000000..70ac95e52 --- /dev/null +++ b/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height.go @@ -0,0 +1,54 @@ +package problem0406 + +import "sort" + +func reconstructQueue(people [][]int) [][]int { + res := make([][]int, 0, len(people)) + + // 按照 persons 的排序方式,对 people 进行排序 + sort.Sort(persons(people)) + + // 把 person 插入到 res[idx] 上 + insert := func(idx int, person []int) { + res = append(res, person) + // 插入到末尾 + if len(res)-1 == idx { + return + } + // 插入到中间位置 + copy(res[idx+1:], res[idx:]) + res[idx] = person + } + + // 对于 res[i] 来说, + // 如果把 res[:i] 中所有 h < res[i] 的元素全部删除后,得到的 res' + // len(res') == res[i][1] + // + // 0 1 2 3 4 5 + // [4,k] 的 k 在 [[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]] 中与其索引号一致 + // [5,k] 的 k 在 [[5,0], [7,0], [5,2], [6,1], [7,1]] 中与其索引号一致 + // [6,k] 的 k 在 [[7,0], [6,1], [7,1]] 中与其索引号一致 + // [7,k] 的 k 在 [[7,0], [7,1]] 中与其索引号一致 + // 下面的 for 循环,就是上面的删除的逆过程 + for _, p := range people { + insert(p[1], p) + } + + return res +} + +// persons 实现了 sort.Interface 接口 +type persons [][]int + +func (p persons) Len() int { return len(p) } + +// 以 h 的降序为主 +// 以 k 的升序为辅 +func (p persons) Less(i, j int) bool { + if p[i][0] == p[j][0] { + return p[i][1] < p[j][1] + } + return p[i][0] > p[j][0] +} + +func (p persons) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height_test.go b/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height_test.go new file mode 100755 index 000000000..e8cf82aba --- /dev/null +++ b/Algorithms/0406.queue-reconstruction-by-height/queue-reconstruction-by-height_test.go @@ -0,0 +1,39 @@ +package problem0406 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + people [][]int + ans [][]int +}{ + + { + [][]int{{7, 0}, {4, 4}, {7, 1}, {5, 0}, {6, 1}, {5, 2}}, + [][]int{{5, 0}, {7, 0}, {5, 2}, {6, 1}, {4, 4}, {7, 1}}, + }, + + // 可以有多个 testcase +} + +func Test_reconstructQueue(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reconstructQueue(tc.people), "输入:%v", tc) + } +} + +func Benchmark_reconstructQueue(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reconstructQueue(tc.people) + } + } +} diff --git a/Algorithms/0407.trapping-rain-water-ii/README.md b/Algorithms/0407.trapping-rain-water-ii/README.md new file mode 100755 index 000000000..915be05ee --- /dev/null +++ b/Algorithms/0407.trapping-rain-water-ii/README.md @@ -0,0 +1,33 @@ +# [407. Trapping Rain Water II](https://leetcode.com/problems/trapping-rain-water-ii/) + +## 题目 + +Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining. + +Note: +Both m and n are less than 110. The height of each unit cell is greater than 0 and is less than 20,000. + +Example: + +```text +Given the following 3x6 height map: +[ + [1,4,3,1,3,2], + [3,2,1,3,2,4], + [2,3,3,2,3,1] +] + +Return 4. +``` + +![p1](https://leetcode.com/static/images/problemset/rainwater_empty.png) + +The above image represents the elevation map [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]] before the rain. + +![p2](https://leetcode.com/static/images/problemset/rainwater_fill.png) + +After the rain, water are trapped between the blocks. The total volume of water trapped is 4. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii.go b/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii.go new file mode 100755 index 000000000..ece80ddae --- /dev/null +++ b/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii.go @@ -0,0 +1,101 @@ +package problem0407 + +import ( + "container/heap" +) + +func trapRainWater(hs [][]int) int { + if len(hs) < 3 || len(hs[0]) < 3 { + return 0 + } + m, n := len(hs), len(hs[0]) + + pq := make(priorityQueue, 0, m*2+n*2) + + isVisited := make([][]bool, m) + for i := range isVisited { + isVisited[i] = make([]bool, n) + } + + // 把四周的格子先放入 pq + for i := 0; i < m; i++ { + isVisited[i][0] = true + isVisited[i][n-1] = true + pq = append(pq, cell{row: i, col: 0, height: hs[i][0]}) + pq = append(pq, cell{row: i, col: n - 1, height: hs[i][n-1]}) + } + for j := 0; j < n; j++ { + isVisited[0][j] = true + isVisited[m-1][j] = true + pq = append(pq, cell{row: 0, col: j, height: hs[0][j]}) + pq = append(pq, cell{row: m - 1, col: j, height: hs[m-1][j]}) + } + // 放入后,再初始化 pq,更节约时间 + heap.Init(&pq) + + dirs := [][]int{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} + vol := 0 + + // 此刻,pq 中的 cell 实际上把整个区域围了起来 + // 从围墙 pq 中,挑选最矮的木板 c + // 统计 c 周围的 cell 能装多少水 + // 然后把 c 周围的 cell 更新高度后,放入 pq,变成新的木板 + // 不断重复上述过程,围墙不断变小,直到统计完成所有的 cell + for len(pq) > 0 { + // 最矮的木板是 c + c := heap.Pop(&pq).(cell) + // 依次检查 c 周围的 4 个方向的 cell + for _, d := range dirs { + i := c.row + d[0] + j := c.col + d[1] + + if 0 <= i && i < m && 0 <= j && j < n && !isVisited[i][j] { + isVisited[i][j] = true + // 统计容量 + vol += max(0, c.height-hs[i][j]) + // 给 pq 添加新的木板 + heap.Push(&pq, cell{row: i, col: j, height: max(hs[i][j], c.height)}) + } + } + } + + return vol +} + +type cell struct { + row, col, height int +} + +type priorityQueue []cell + +func (pq priorityQueue) Len() int { return len(pq) } + +func (pq priorityQueue) Less(i, j int) bool { + return pq[i].height < pq[j].height +} + +func (pq priorityQueue) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 item +func (pq *priorityQueue) Push(x interface{}) { + item := x.(cell) + *pq = append(*pq, item) +} + +// Pop 从 pq 中取出最优先的 item +func (pq *priorityQueue) Pop() interface{} { + old := *pq + n := len(old) + item := old[n-1] + *pq = old[0 : n-1] + return item +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii_test.go b/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii_test.go new file mode 100755 index 000000000..d21c3d2bc --- /dev/null +++ b/Algorithms/0407.trapping-rain-water-ii/trapping-rain-water-ii_test.go @@ -0,0 +1,83 @@ +package problem0407 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + heightMap [][]int + ans int +}{ + + { + [][]int{ + []int{5, 5, 5, 1}, + []int{5, 1, 1, 5}, + }, + 0, + }, + + { + [][]int{ + []int{5, 5, 5, 1}, + []int{5, 1, 1, 5}, + []int{5, 1, 5, 5}, + []int{5, 2, 5, 8}, + }, + 3, + }, + + { + [][]int{ + []int{1, 4, 3, 1, 3, 2}, + []int{3, 2, 1, 3, 2, 4}, + []int{2, 3, 3, 2, 3, 1}, + }, + 4, + }, + + { + [][]int{ + []int{12, 13, 1, 12}, + []int{13, 4, 13, 12}, + []int{13, 8, 10, 12}, + []int{12, 13, 12, 12}, + []int{13, 13, 13, 13}, + }, + 14, + }, + + { + [][]int{ + []int{5, 5, 5, 5, 5}, + []int{5, 1, 1, 1, 5}, + []int{5, 1, 5, 5, 5}, + []int{5, 1, 1, 1, 5}, + // 水会从这一行的 1 这里全部流出去,现有方法无法克服这种情况 + []int{5, 5, 5, 1, 5}, + }, + 0, + }, + // 可以有多个 testcase +} + +func Test_trapRainWater(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, trapRainWater(tc.heightMap), "输入:%v", tc) + } +} + +func Benchmark_trapRainWater(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + trapRainWater(tc.heightMap) + } + } +} diff --git a/Algorithms/0409.longest-palindrome/README.md b/Algorithms/0409.longest-palindrome/README.md new file mode 100755 index 000000000..2c3c518aa --- /dev/null +++ b/Algorithms/0409.longest-palindrome/README.md @@ -0,0 +1,25 @@ +# [409. Longest Palindrome](https://leetcode.com/problems/longest-palindrome/) + +## 题目 + +Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. + +This is case sensitive, for example "Aa" is not considered a palindrome here. + +Note: +Assume the length of given string will not exceed 1,010. + +Example: + +```text +Input:"abccccdd" + +Output:7 + +Explanation: +One longest palindrome that can be built is "dccaccd", whose length is 7. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0409.longest-palindrome/longest-palindrome.go b/Algorithms/0409.longest-palindrome/longest-palindrome.go new file mode 100755 index 000000000..877ab0cf4 --- /dev/null +++ b/Algorithms/0409.longest-palindrome/longest-palindrome.go @@ -0,0 +1,25 @@ +package problem0409 + +func longestPalindrome(s string) int { + res := 0 + a := [123]int{} // 'z' 的 ASCII 码为 122 + for i := range s { + a[s[i]]++ + } + + // hasOdd 表示存在数目为奇数的元素,可以放在中间 + hasOdd := 0 + for i := range a { + if a[i] == 0 { + continue + } + if a[i]&1 == 0 { + res += a[i] + } else { + res += a[i] - 1 + hasOdd = 1 + } + } + + return res + hasOdd +} diff --git a/Algorithms/0409.longest-palindrome/longest-palindrome_test.go b/Algorithms/0409.longest-palindrome/longest-palindrome_test.go new file mode 100755 index 000000000..7cb31a51c --- /dev/null +++ b/Algorithms/0409.longest-palindrome/longest-palindrome_test.go @@ -0,0 +1,49 @@ +package problem0409 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "zzzzzz", + 6, + }, + + { + "AAAAAA", + 6, + }, + + { + "abccccdd", + 7, + }, + + // 可以有多个 testcase +} + +func Test_longestPalindrome(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestPalindrome(tc.s), "输入:%v", tc) + } +} + +func Benchmark_longestPalindrome(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestPalindrome(tc.s) + } + } +} diff --git a/Algorithms/0410.split-array-largest-sum/README.md b/Algorithms/0410.split-array-largest-sum/README.md new file mode 100755 index 000000000..7ac7df23e --- /dev/null +++ b/Algorithms/0410.split-array-largest-sum/README.md @@ -0,0 +1,31 @@ +# [410. Split Array Largest Sum](https://leetcode.com/problems/split-array-largest-sum/) + +## 题目 + +Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays. + +Note: +If n is the length of array, assume the following constraints are satisfied: + +1. 1 ≤ n ≤ 1000 +1. 1 ≤ m ≤ min(50, n) + +Examples: + +```text +Input: +nums = [7,2,5,10,8] +m = 2 + +Output: +18 + +Explanation: +There are four ways to split nums into two subarrays. +The best way is to split it into [7,2,5] and [10,8], +where the largest sum among the two subarrays is only 18. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0410.split-array-largest-sum/split-array-largest-sum.go b/Algorithms/0410.split-array-largest-sum/split-array-largest-sum.go new file mode 100755 index 000000000..dc188901a --- /dev/null +++ b/Algorithms/0410.split-array-largest-sum/split-array-largest-sum.go @@ -0,0 +1,56 @@ +package problem0410 + +func splitArray(nums []int, m int) int { + var max, n, sum int + for _, n = range nums { + sum += n + if max < n { + max = n + } + } + + if m == 1 { + return sum + } + + // guess 是我们猜想的答案 + // isBigger 用来判断是否 guess >= 实际结果 + isBigger := func(guess int) bool { + // nums 会被切分成连续的 子数组 + // 切分标准是,这段连续子数组的和是 不超过 guess 的最大值 + count, subSum := 1, 0 + for _, n = range nums { + subSum += n + if subSum > guess { + subSum = n + // n 已经是第 count+1 个子数组的成员了 + // 所以,count++ + count++ + if count > m { + // 导致 nums 被切分的段数超过了 m + // 可知 guess < 实际结果 + return false + } + } + } + // guess >= 实际结果 + // 才能导致 nums 被切分的段数,不超过 m + return true + } + + // 二分查找 + // 可知, max<= res <= sum + // 那就在 max 和 sum 之间,进行二分查找 + l, r := max, sum + var mid int + for l <= r { + mid = l + (r-l)>>1 + if isBigger(mid) { + r = mid - 1 + } else { + l = mid + 1 + } + } + + return l +} diff --git a/Algorithms/0410.split-array-largest-sum/split-array-largest-sum_test.go b/Algorithms/0410.split-array-largest-sum/split-array-largest-sum_test.go new file mode 100755 index 000000000..2de753628 --- /dev/null +++ b/Algorithms/0410.split-array-largest-sum/split-array-largest-sum_test.go @@ -0,0 +1,65 @@ +package problem0410 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + m int + ans int +}{ + + { + []int{1, 3, 5, 7, 9, 11}, + 3, + 16, + }, + + { + []int{1, 2, 2, 2}, + 3, + 3, + }, + + { + []int{1, 2, 2, 2}, + 1, + 7, + }, + + { + []int{7, 2, 5, 10, 8}, + 2, + 18, + }, + + { + []int{10, 5, 13, 4, 8, 4, 5, 11, 14, 9, 16, 10, 20, 8}, + 8, + 25, + }, + + // 可以有多个 testcase +} + +func Test_splitArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, splitArray(tc.nums, tc.m), "输入:%v", tc) + } +} + +func Benchmark_splitArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + splitArray(tc.nums, tc.m) + } + } +} diff --git a/Algorithms/0412.fizz-buzz/README.md b/Algorithms/0412.fizz-buzz/README.md new file mode 100755 index 000000000..cb1c26ea9 --- /dev/null +++ b/Algorithms/0412.fizz-buzz/README.md @@ -0,0 +1,36 @@ +# [412. Fizz Buzz](https://leetcode.com/problems/fizz-buzz/) + +## 题目 + +Write a program that outputs the string representation of numbers from 1 to n. + +But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”. + +Example: + +```text +n = 15, + +Return: +[ + "1", + "2", + "Fizz", + "4", + "Buzz", + "Fizz", + "7", + "8", + "Fizz", + "Buzz", + "11", + "Fizz", + "13", + "14", + "FizzBuzz" +] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0412.fizz-buzz/fizz-buzz.go b/Algorithms/0412.fizz-buzz/fizz-buzz.go new file mode 100755 index 000000000..3ceb41186 --- /dev/null +++ b/Algorithms/0412.fizz-buzz/fizz-buzz.go @@ -0,0 +1,23 @@ +package problem0412 + +import "strconv" + +func fizzBuzz(n int) []string { + res := make([]string, n) + + for i := range res { + x := i + 1 + switch { + case x%15 == 0: + res[i] = "FizzBuzz" + case x%5 == 0: + res[i] = "Buzz" + case x%3 == 0: + res[i] = "Fizz" + default: + res[i] = strconv.Itoa(x) + } + } + + return res +} diff --git a/Algorithms/0412.fizz-buzz/fizz-buzz_test.go b/Algorithms/0412.fizz-buzz/fizz-buzz_test.go new file mode 100755 index 000000000..68f341da1 --- /dev/null +++ b/Algorithms/0412.fizz-buzz/fizz-buzz_test.go @@ -0,0 +1,55 @@ +package problem0412 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans []string +}{ + + { + 15, + []string{ + "1", + "2", + "Fizz", + "4", + "Buzz", + "Fizz", + "7", + "8", + "Fizz", + "Buzz", + "11", + "Fizz", + "13", + "14", + "FizzBuzz", + }, + }, + + // 可以有多个 testcase +} + +func Test_fizzBuzz(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fizzBuzz(tc.n), "输入:%v", tc) + } +} + +func Benchmark_fizzBuzz(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fizzBuzz(tc.n) + } + } +} diff --git a/Algorithms/0413.arithmetic-slices/README.md b/Algorithms/0413.arithmetic-slices/README.md new file mode 100755 index 000000000..262ec1dce --- /dev/null +++ b/Algorithms/0413.arithmetic-slices/README.md @@ -0,0 +1,39 @@ +# [413. Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) + +## 题目 + +A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. + +For example, these are arithmetic sequence: + +```text +1, 3, 5, 7, 9 +7, 7, 7, 7 +3, -1, -5, -9 +``` + +The following sequence is not arithmetic. + +```text +1, 1, 2, 5, 7 +``` + +A zero-indexed array A consisting of N numbers is given. A slice of that array is any pair of integers (P, Q) such that 0 <= P < Q < N. + +A slice (P, Q) of array A is called arithmetic if the sequence: + +A[P], A[p + 1], ..., A[Q - 1], A[Q] is arithmetic. In particular, this means that P + 1 < Q. + +The function should return the number of arithmetic slices in the array A. + +Example: + +```text +A = [1, 2, 3, 4] + +return: 3, for 3 arithmetic slices in A: [1, 2, 3], [2, 3, 4] and [1, 2, 3, 4] itself. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0413.arithmetic-slices/arithmetic-slices.go b/Algorithms/0413.arithmetic-slices/arithmetic-slices.go new file mode 100755 index 000000000..4f56d4528 --- /dev/null +++ b/Algorithms/0413.arithmetic-slices/arithmetic-slices.go @@ -0,0 +1,21 @@ +package problem0413 + +func numberOfArithmeticSlices(a []int) int { + if len(a) < 3 { + return 0 + } + res := 0 + + var i, j = 0, 0 + for i < len(a) { + j = i + 2 + for j < len(a) && a[j]-a[j-1] == a[j-1]-a[j-2] { + j++ + } + j-- + res += (j - i - 1) * (j - i) / 2 + i = j + } + + return res +} diff --git a/Algorithms/0413.arithmetic-slices/arithmetic-slices_test.go b/Algorithms/0413.arithmetic-slices/arithmetic-slices_test.go new file mode 100755 index 000000000..d086ce8a7 --- /dev/null +++ b/Algorithms/0413.arithmetic-slices/arithmetic-slices_test.go @@ -0,0 +1,40 @@ +package problem0413 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + {[]int{}, 0}, + {[]int{1, 2, 3, 4}, 3}, + {[]int{2, 1, 2, 3, 4}, 3}, + {[]int{1, 2, 3, 4, 4}, 3}, + {[]int{1, 1, 1, 2, 2, 2}, 2}, + + // 可以有多个 testcase +} + +func Test_numberOfArithmeticSlices(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numberOfArithmeticSlices(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numberOfArithmeticSlices(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numberOfArithmeticSlices(tc.A) + } + } +} diff --git a/Algorithms/0414.third-maximum-number/third-maximum-number.go b/Algorithms/0414.third-maximum-number/third-maximum-number.go index 233ed9e9e..a9b87ee5a 100755 --- a/Algorithms/0414.third-maximum-number/third-maximum-number.go +++ b/Algorithms/0414.third-maximum-number/third-maximum-number.go @@ -1,4 +1,4 @@ -package Problem0414 +package problem0414 import ( "math" diff --git a/Algorithms/0414.third-maximum-number/third-maximum-number_test.go b/Algorithms/0414.third-maximum-number/third-maximum-number_test.go index bce476dd8..33bd3ece9 100755 --- a/Algorithms/0414.third-maximum-number/third-maximum-number_test.go +++ b/Algorithms/0414.third-maximum-number/third-maximum-number_test.go @@ -1,4 +1,4 @@ -package Problem0414 +package problem0414 import ( "fmt" diff --git a/Algorithms/0415.add-strings/README.md b/Algorithms/0415.add-strings/README.md new file mode 100755 index 000000000..baef3047c --- /dev/null +++ b/Algorithms/0415.add-strings/README.md @@ -0,0 +1,16 @@ +# [415. Add Strings](https://leetcode.com/problems/add-strings/) + +## 题目 + +Given two non-negative integers `num1` and `num2` represented as string, return the sum of `num1` and `num2`. + +Note: + +1. The length of both `num1` and `num2` is < 5100. +1. Both `num1` and `num2` contains only digits 0-9. +1. Both `num1` and `num2` does not contain any leading zero. +1. You must not use any built-in BigInteger library or convert the inputs to integer directly. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0415.add-strings/add-strings.go b/Algorithms/0415.add-strings/add-strings.go new file mode 100755 index 000000000..9f372ba18 --- /dev/null +++ b/Algorithms/0415.add-strings/add-strings.go @@ -0,0 +1,41 @@ +package problem0415 + +func addStrings(s1, s2 string) string { + // 确保 n1 <= n2 + if len(s1) > len(s2) { + s1, s2 = s2, s1 + } + + n1, n2 := len(s1), len(s2) + a1, a2 := []byte(s1), []byte(s2) + + carry := byte(0) + + // buf 保存 []byte 格式的答案 + buf := make([]byte, n2+1) + buf[0] = '1' + + i := 1 + for i <= n2 { + // a1 和 a2 相加 + if i <= n1 { + buf[n2+1-i] = a1[n1-i] - '0' + } + buf[n2+1-i] += a2[n2-i] + carry + + // 处理进位问题 + if buf[n2+1-i] > '9' { + buf[n2+1-i] -= 10 + carry = byte(1) + } else { + carry = byte(0) + } + + i++ + } + + if carry == 1 { + return string(buf) + } + return string(buf[1:]) +} diff --git a/Algorithms/0415.add-strings/add-strings_test.go b/Algorithms/0415.add-strings/add-strings_test.go new file mode 100755 index 000000000..76e9e8db7 --- /dev/null +++ b/Algorithms/0415.add-strings/add-strings_test.go @@ -0,0 +1,53 @@ +package problem0415 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num1 string + num2 string + ans string +}{ + + { + "12", + "3", + "15", + }, + + { + "2", + "3", + "5", + }, + + { + "7", + "8", + "15", + }, + + // 可以有多个 testcase +} + +func Test_addStrings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, addStrings(tc.num1, tc.num2), "输入:%v", tc) + } +} + +func Benchmark_addStrings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + addStrings(tc.num1, tc.num2) + } + } +} diff --git a/Algorithms/0416.partition-equal-subset-sum/README.md b/Algorithms/0416.partition-equal-subset-sum/README.md new file mode 100755 index 000000000..5befb8099 --- /dev/null +++ b/Algorithms/0416.partition-equal-subset-sum/README.md @@ -0,0 +1,34 @@ +# [416. Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) + +## 题目 + +Given a `non-empty` array containing `only positive integers`, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. + +Note: + +1. Each of the array element will not exceed 100. +1. The array size will not exceed 200. + +Example 1: + +```text +Input: [1, 5, 11, 5] + +Output: true + +Explanation: The array can be partitioned as [1, 5, 5] and [11]. +``` + +Example 2: + +```text +Input: [1, 2, 3, 5] + +Output: false + +Explanation: The array cannot be partitioned into equal sum subsets. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum.go b/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum.go new file mode 100755 index 000000000..a238faf32 --- /dev/null +++ b/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum.go @@ -0,0 +1,47 @@ +package problem0416 + +// 01背包问题 +func canPartition(nums []int) bool { + sum := 0 + for _, n := range nums { + sum += n + } + + if sum&1 == 1 { + return false + } + + sum = sum >> 1 + n := len(nums) + + // dp[i][j] 表示 nums[:i] 中的元素,可以找出一些,他们的和为 j + dp := make([][]bool, n+1) + for i := range dp { + dp[i] = make([]bool, sum+1) + } + + for i := 0; i < n+1; i++ { + // 从任意多个元素中,挑选 0 个元素出来,其和是 0 + dp[i][0] = true + } + + for j := 1; j < sum+1; j++ { + // 从包含 0 个元素的 nums 中,挑不出来元素,使得其和为 j + dp[0][j] = false + } + + for i := 1; i < n+1; i++ { + for j := 1; j < sum+1; j++ { + dp[i][j] = dp[i-1][j] + if j >= nums[i-1] { + // nums[:i] 比 nums[:i-1] 多了 nums[i-1],所以 + // 要么,nums[:i-1] 中有元素可以合成 j-nums[i-1] + // 要么,nums[:i-1] 中有元素可以合成 j + // nums[:i] 中才可能有元素合成 j + dp[i][j] = dp[i][j] || dp[i-1][j-nums[i-1]] + } + } + } + + return dp[n][sum] +} diff --git a/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum_test.go b/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum_test.go new file mode 100755 index 000000000..fdb0269c0 --- /dev/null +++ b/Algorithms/0416.partition-equal-subset-sum/partition-equal-subset-sum_test.go @@ -0,0 +1,43 @@ +package problem0416 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + {[]int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100}, false}, + + {[]int{1, 2, 5}, false}, + + {[]int{1, 5, 11, 5}, true}, + + {[]int{1, 3, 5, 7, 9, 11}, true}, + + {[]int{1, 2, 3, 5}, false}, + + // 可以有多个 testcase +} + +func Test_canPartition(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canPartition(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_canPartition(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canPartition(tc.nums) + } + } +} diff --git a/Algorithms/0417.pacific-atlantic-water-flow/README.md b/Algorithms/0417.pacific-atlantic-water-flow/README.md new file mode 100755 index 000000000..6faf00908 --- /dev/null +++ b/Algorithms/0417.pacific-atlantic-water-flow/README.md @@ -0,0 +1,38 @@ +# [417. Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/) + +## 题目 + +Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges. + +Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower. + +Find the list of grid coordinates where water can flow to both the Pacific and Atlantic ocean. + +Note: + +1. The order of returned grid coordinates does not matter. +1. Both m and n are less than 150. + +Example: + +```text +Given the following 5x5 matrix: + + Pacific ~ ~ ~ ~ ~ + ~ 1 2 2 3 (5) * + ~ 3 2 3 (4) (4) * + ~ 2 4 (5) 3 1 * + ~ (6) (7) 1 4 5 * + ~ (5) 1 1 2 4 * + * * * * * Atlantic + +Return: + +[[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix). +``` + +## 解题思路 + +见程序注释 + +![100](417.100.png) \ No newline at end of file diff --git a/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow.go b/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow.go new file mode 100755 index 000000000..1f54afeae --- /dev/null +++ b/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow.go @@ -0,0 +1,68 @@ +package problem0417 + +func pacificAtlantic(mat [][]int) [][]int { + res := [][]int{} + if len(mat) == 0 || len(mat[0]) == 0 { + return res + } + + m, n := len(mat), len(mat[0]) + + // p[i][j] 表示,[i][j] 可以让水流到 Pacific 的点 + // a[i][j] 表示,[i][j] 可以让水流到 Atlantic 的点 + p, a := make([][]bool, m), make([][]bool, m) + for i := 0; i < m; i++ { + p[i] = make([]bool, n) + a[i] = make([]bool, n) + } + + // pQueue 是所有能够让水流到 Pacific 的点的队列 + // aQueue 是所有能够让水流到 Atlantic 的点的队列 + // 初始化 pQueue 和 aQueue + pQueue := [][]int{} + aQueue := [][]int{} + for i := 0; i < m; i++ { + p[i][0] = true + pQueue = append(pQueue, []int{i, 0}) + a[i][n-1] = true + aQueue = append(aQueue, []int{i, n - 1}) + } + for j := 0; j < n; j++ { + p[0][j] = true + pQueue = append(pQueue, []int{0, j}) + a[m-1][j] = true + aQueue = append(aQueue, []int{m - 1, j}) + } + + ds := [][]int{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} + + bfs := func(queue [][]int, rec [][]bool) { + for len(queue) > 0 { + c := queue[0] + queue = queue[1:] + for _, d := range ds { + i, j := c[0]+d[0], c[1]+d[1] + if 0 <= i && i < m && + 0 <= j && j < n && + !rec[i][j] && + mat[c[0]][c[1]] <= mat[i][j] { + rec[i][j] = true + queue = append(queue, []int{i, j}) + } + } + } + } + + bfs(pQueue, p) + bfs(aQueue, a) + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if p[i][j] && a[i][j] { + res = append(res, []int{i, j}) + } + } + } + + return res +} diff --git a/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow_test.go b/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow_test.go new file mode 100755 index 000000000..0a75a553a --- /dev/null +++ b/Algorithms/0417.pacific-atlantic-water-flow/pacific-atlantic-water-flow_test.go @@ -0,0 +1,58 @@ +package problem0417 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans [][]int +}{ + + { + [][]int{}, + [][]int{}, + }, + + { + [][]int{ + {1, 2, 2, 3, 5}, + {3, 2, 3, 4, 4}, + {2, 4, 5, 3, 1}, + {6, 7, 1, 4, 5}, + {5, 1, 1, 2, 4}, + }, + [][]int{ + {0, 4}, + {1, 3}, + {1, 4}, + {2, 2}, + {3, 0}, + {3, 1}, + {4, 0}, + }, + }, + + // 可以有多个 testcase +} + +func Test_pacificAtlantic(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, pacificAtlantic(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_pacificAtlantic(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pacificAtlantic(tc.matrix) + } + } +} diff --git a/Algorithms/0419.battleships-in-a-board/README.md b/Algorithms/0419.battleships-in-a-board/README.md new file mode 100755 index 000000000..fd208d43d --- /dev/null +++ b/Algorithms/0419.battleships-in-a-board/README.md @@ -0,0 +1,35 @@ +# [419. Battleships in a Board](https://leetcode.com/problems/battleships-in-a-board/) + +## 题目 + +Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may assume the following rules: + +1. You receive a valid board, made of only battleships or empty slots. +1. Battleships can only be placed horizontally or vertically. In other words, they can only be made of the shape 1xN (1 row, N columns) or Nx1 (N rows, 1 column), where N can be of any size. +1. At least one horizontal or vertical cell separates between two battleships - there are no adjacent battleships. + +Example: + +```text +X..X +...X +...X +``` + +In the above board there are 2 battleships. + +Invalid Example: + +```text +...X +XXXX +...X +``` + +This is an invalid board that you will not receive - as battleships will always have a cell separating between them. + +Follow up:Could you do it in one-pass, using only O(1) extra memory and without modifying the value of the board? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0419.battleships-in-a-board/battleships-in-a-board.go b/Algorithms/0419.battleships-in-a-board/battleships-in-a-board.go new file mode 100755 index 000000000..a917142a3 --- /dev/null +++ b/Algorithms/0419.battleships-in-a-board/battleships-in-a-board.go @@ -0,0 +1,21 @@ +package problem0419 + +func countBattleships(board [][]byte) int { + if len(board) == 0 { + return 0 + } + + m, n := len(board), len(board[0]) + + count := 0 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if board[i][j] == 'X' && (i == 0 || board[i-1][j] == '.') && (j == 0 || board[i][j-1] == '.') { + // count 只有在遇到的 battleship 的左上角的 'X' 后,才会 ++ + count++ + } + } + } + + return count +} diff --git a/Algorithms/0419.battleships-in-a-board/battleships-in-a-board_test.go b/Algorithms/0419.battleships-in-a-board/battleships-in-a-board_test.go new file mode 100755 index 000000000..7394d5953 --- /dev/null +++ b/Algorithms/0419.battleships-in-a-board/battleships-in-a-board_test.go @@ -0,0 +1,64 @@ +package problem0419 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]byte + ans int +}{ + + { + [][]byte{}, + 0, + }, + + { + [][]byte{ + []byte("X.X.X"), + }, + 3, + }, + + { + [][]byte{ + []byte("X..X"), + []byte("...X"), + []byte("X..X"), + }, + 3, + }, + + { + [][]byte{ + []byte("X..X"), + []byte("...X"), + []byte("...X"), + }, + 2, + }, + + // 可以有多个 testcase +} + +func Test_countBattleships(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countBattleships(tc.board), "输入:%v", tc) + } +} + +func Benchmark_countBattleships(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countBattleships(tc.board) + } + } +} diff --git a/Algorithms/0420.strong-password-checker/README.md b/Algorithms/0420.strong-password-checker/README.md new file mode 100755 index 000000000..8a28965ba --- /dev/null +++ b/Algorithms/0420.strong-password-checker/README.md @@ -0,0 +1,17 @@ +# [420. Strong Password Checker](https://leetcode.com/problems/strong-password-checker/) + +## 题目 + +A password is considered strong if below conditions are all met: + + 1. It has at least 6 characters and at most 20 characters. + 1. It must contain at least one lowercase letter, at least one uppercase letter, and at least one digit. + 1. It must NOT contain three repeating characters in a row ("...aaa..." is weak, but "...aa...a..." is strong, assuming other conditions are met). + +Write a function strongPasswordChecker(s), that takes a string s as input, and return the MINIMUM change required to make s a strong password. If s is already strong, return 0. + +Insertion, deletion or replace of any one character are all considered as one change. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0420.strong-password-checker/strong-password-checker.go b/Algorithms/0420.strong-password-checker/strong-password-checker.go new file mode 100755 index 000000000..ebb8df95e --- /dev/null +++ b/Algorithms/0420.strong-password-checker/strong-password-checker.go @@ -0,0 +1,100 @@ +package problem0420 + +func strongPasswordChecker(s string) int { + // 统计缺少的字符类型 + l, u, d, missingType := 1, 1, 1, 3 + for i := range s { + if 0 < l && 'a' <= s[i] && s[i] <= 'z' { + l-- + missingType-- + } + if 0 < u && 'A' <= s[i] && s[i] <= 'Z' { + u-- + missingType-- + } + if 0 < d && '0' <= s[i] && s[i] <= '9' { + d-- + missingType-- + } + + if missingType == 0 { + break + } + } + + var replace, ones, twos int + + for p := 0; p+2 < len(s); p++ { + if s[p] != s[p+1] || s[p+1] != s[p+2] { + continue + } + + // 出现连续重复的情况 + // 统计连续重复的长度 + repeatingLen := 2 + for p+2 < len(s) && s[p] == s[p+2] { + repeatingLen++ + p++ + } + + // 对于重复的字符串 + // 每3个字符,都需要替换为另外的字符 + replace += repeatingLen / 3 + if repeatingLen%3 == 0 { + // 但是,如果字符串的长度超过了 20 的话 + // 对于 此种情况 + // 也可以通过 删除 1 个重复的字符,来减少替换的次数 + ones++ + } else if repeatingLen%3 == 1 { + // 但是,如果字符串的长度超过了 20 的话 + // 对于 此种情况 + // 也可以通过 删除 2 个连续的重复的字符,来减少替换的次数 + twos++ + } + } + + // 长度不够 + // 使用缺失的类型来凑 + if len(s) < 6 { + return max(missingType, 6-len(s)) + } + + // 长度足够 + // 替换的时候,优先替换为缺失的类型 + if len(s) <= 20 { + return max(missingType, replace) + } + + // 长度太长了 + // + // 需要删除的数量 + delete := len(s) - 20 + + // 删除工作一定是要完成的,要不然长度要求就不能被满足了 + // 但是,删除那些连续重复的字符,可以减少 replace 的次数 + // 所以 + // 删除的时候,优先删除那些可以减少替换的连续重复字符 + + // 通过删除 1 个重复的字符,可以减少 1 个 replace 的个数 + replace -= min(delete, ones) + // 通过删除 2 个重复的字符,可以减少 1 个 replace 的个数 + replace -= min(max(delete-ones, 0), twos*2) / 2 + // 通过删除 3 个连续重复的字符,可以减少 1 个 replace 的个数 + replace -= max(delete-ones-2*twos, 0) / 3 + + return delete + max(missingType, replace) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0420.strong-password-checker/strong-password-checker_test.go b/Algorithms/0420.strong-password-checker/strong-password-checker_test.go new file mode 100755 index 000000000..2f1a86331 --- /dev/null +++ b/Algorithms/0420.strong-password-checker/strong-password-checker_test.go @@ -0,0 +1,46 @@ +package problem0420 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + {"", 6}, + + {"aB3aB3", 0}, + + {"aaaaaaaaaaaaaaaaaaaaa", 7}, + + {"aaaaaaaaaaaaaaaaaaaaaa", 8}, + + {"aaaAaaaAaaaAaaaAaaaAa", 5}, + + {"aadssfasfASDaaaaaaaaaaASDfA235234ADFadfASDFa234324", 30}, + + // 可以有多个 testcase +} + +func Test_strongPasswordChecker(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, strongPasswordChecker(tc.s), "输入:%v", tc) + } +} + +func Benchmark_strongPasswordChecker(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + strongPasswordChecker(tc.s) + } + } +} diff --git a/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/README.md b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/README.md new file mode 100755 index 000000000..57c69e2be --- /dev/null +++ b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/README.md @@ -0,0 +1,23 @@ +# [421. Maximum XOR of Two Numbers in an Array](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/) + +## 题目 + +Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. + +Find the maximum result of ai XOR aj, where 0 ≤ i, j < n. + +Could you do this in O(n) runtime? + +Example: + +```text +Input: [3, 10, 5, 25, 2, 8] + +Output: 28 + +Explanation: The maximum result is 5 ^ 25 = 28. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array.go b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array.go new file mode 100755 index 000000000..affac0214 --- /dev/null +++ b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array.go @@ -0,0 +1,29 @@ +package problem0421 + +func findMaximumXOR(nums []int) int { + var max, mask int + + // Basically we use the fact that Num1 ^ Num2 = Result ==> Num1 ^ Result = Num2 + // We start with the highest bit since we try to find the max to build the possible + // result. All numbers with higher bits (have been processd or to be processed) are + // hashed, then we use Num1 ^ Result to look up hash, if Num2 exists, then it is a + // valid result, save it and go on to the next bit. + for i := 31; i >= 0; i-- { + mask |= 1 << uint(i) + + nMap := make(map[int]bool) + for _, num := range nums { + nMap[num&mask] = true + } + + tmp := max | (1 << uint32(i)) + for key := range nMap { + if nMap[tmp^key] { + max = tmp + break + } + } + } + + return max +} diff --git a/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array_test.go b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array_test.go new file mode 100755 index 000000000..3abff02d4 --- /dev/null +++ b/Algorithms/0421.maximum-xor-of-two-numbers-in-an-array/maximum-xor-of-two-numbers-in-an-array_test.go @@ -0,0 +1,44 @@ +package problem0421 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{0}, + 0, + }, + + { + []int{3, 10, 5, 25, 2, 8}, + 28, + }, + + // 可以有多个 testcase +} + +func Test_findMaximumXOR(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMaximumXOR(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_findMaximumXOR(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMaximumXOR(tc.nums) + } + } +} diff --git a/Algorithms/0423.reconstruct-original-digits-from-english/423.100.png b/Algorithms/0423.reconstruct-original-digits-from-english/423.100.png new file mode 100644 index 000000000..6f11a0d15 Binary files /dev/null and b/Algorithms/0423.reconstruct-original-digits-from-english/423.100.png differ diff --git a/Algorithms/0423.reconstruct-original-digits-from-english/README.md b/Algorithms/0423.reconstruct-original-digits-from-english/README.md new file mode 100755 index 000000000..604757d83 --- /dev/null +++ b/Algorithms/0423.reconstruct-original-digits-from-english/README.md @@ -0,0 +1,33 @@ +# [423. Reconstruct Original Digits from English](https://leetcode.com/problems/reconstruct-original-digits-from-english/) + +## 题目 + +Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order. + +Note: + +1. Input contains only lowercase English letters. +1. Input is guaranteed to be valid and can be transformed to its original digits. That means invalid inputs such as "abc" or "zerone" are not permitted. +1. Input length is less than 50,000. + +Example 1: + +```text +Input: "owoztneoer" + +Output: "012" +``` + +Example 2: + +```text +Input: "fviefuro" + +Output: "45" +``` + +## 解题思路 + +见程序注释 + +![100](423.100.png) \ No newline at end of file diff --git a/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english.go b/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english.go new file mode 100755 index 000000000..b889f060e --- /dev/null +++ b/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english.go @@ -0,0 +1,52 @@ +package problem0423 + +func originalDigits(s string) string { + if len(s) == 0 { + return "" + } + + var counts [10]int + + for i := 0; i < len(s); i++ { + c := s[i] + switch c { + case 'z': + counts[0]++ // 0 + case 'w': + counts[2]++ // 2 + case 'x': + counts[6]++ // 6 + case 'u': + counts[4]++ // 4 + case 'g': + counts[8]++ // 8 + case 's': + counts[7]++ // 7 & 6 + case 'v': + counts[5]++ // 5 & 7 + case 'h': + counts[3]++ // 3 & 8 + case 'i': + counts[9]++ // 5 & 6 & 8 & 9 + case 'o': + counts[1]++ // 1 & 2 & 4 & 0 + } + } + + counts[3] -= counts[8] + counts[7] -= counts[6] + counts[5] -= counts[7] + counts[1] -= counts[2] + counts[0] + counts[4] + counts[9] -= counts[5] + counts[6] + counts[8] + + res := make([]byte, 0, len(s)/3) + + for b := byte(0); b < 10; b++ { + for counts[b] > 0 { + res = append(res, b+'0') + counts[b]-- + } + } + + return string(res) +} diff --git a/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english_test.go b/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english_test.go new file mode 100755 index 000000000..b49d72128 --- /dev/null +++ b/Algorithms/0423.reconstruct-original-digits-from-english/reconstruct-original-digits-from-english_test.go @@ -0,0 +1,52 @@ +package problem0423 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "", + "", + }, + + { + "owoztneoer", + "012", + }, + + { + "zeroonetwothreefourfivesixseveneightnien", + "0123456789", + }, + + { + "fviefuro", + "45", + }, + + // 可以有多个 testcase +} + +func Test_originalDigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, originalDigits(tc.s), "输入:%v", tc) + } +} + +func Benchmark_originalDigits(b *testing.B) { + for i := 0; i < b.N; i++ { + originalDigits("zeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnienzeroonetwothreefourfivesixseveneightnien") + } +} diff --git a/Algorithms/0424.longest-repeating-character-replacement/README.md b/Algorithms/0424.longest-repeating-character-replacement/README.md new file mode 100755 index 000000000..c704fa69a --- /dev/null +++ b/Algorithms/0424.longest-repeating-character-replacement/README.md @@ -0,0 +1,39 @@ +# [424. Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) + +## 题目 + +Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Find the length of a longest substring containing all repeating letters you can get after performing the above operations. + +Note: +Both the string's length and k will not exceed 104. + +Example 1: + +```text +Input: +s = "ABAB", k = 2 + +Output: +4 + +Explanation: +Replace the two 'A's with two 'B's or vice versa. +``` + +Example 2: + +```text +Input: +s = "AABABBA", k = 1 + +Output: +4 + +Explanation: +Replace the one 'A' in the middle with 'B' and form "AABBBBA". +The substring "BBBB" has the longest repeating letters, which is 4. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement.go b/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement.go new file mode 100755 index 000000000..f6b44db47 --- /dev/null +++ b/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement.go @@ -0,0 +1,51 @@ +package problem0424 + +func characterReplacement(s string, k int) int { + // count 在 for 循环中,记录了 + // s[left:right+1] 中的各个字母出现的次数 + // max 保存着整个 for 循环中, count 中每次创下的新高 + var max, left int + count := [128]int{} + + // 在 for 循环中, s[left:right+1] + // 要么,由于 max 变大, 向右 扩张 一格 + // 要么,由于 max 不变, 向右 移动 一格 + // 但是,s[left:right+1] 的长度,始终是 characterReplacement(s[:right+1], k) 的解 + // 虽然,s[left:right+1] 不一定是那个符合题意的 subString + for right := 0; right < len(s); right++ { + count[s[right]]++ + max = Max(max, count[s[right]]) + + // right - left + 1 - max == k 的含义是 + // 在 s[left:right+1] 中有 max 个相同的字母 X 和 k 个不同于 X 的字母 + // 通过 k 次修改后, s[left:right+1] 就全是 X 了 + // 此时 s[left:right+1] 就是满足 characterReplacement(s[:right+1], k) 的解的那个 subString + + // right - left + 1 - max > k 的含义是 + // s[left:right+1] 中,不同于 X 的字母,多于 k 个 + // 无法通过 k 次修改,把 s[left:right+1] 中的字母全部变成 X + // 只好把 s[left:right+1] 向右移动一格 + // 以便让 len(s[left:right+1]) 始终是 characterReplacement(s[:right+1], k) 的解 + if right-left+1-max > k { + // 减去 s[left] 的统计值 + count[s[left]]-- + left++ + } + } + + // len(s) == right + 1 + // 所以,最终解是 len(s) - left + return len(s) - left + + // 其实,这个答案更直观 + // return min(len(s), max + k) + // 使用 min 是因为有可能不用修改 k 次,s 就变成全部一样的字母了 +} + +// Max 返回 a 和 b 中的较大值 +func Max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement_test.go b/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement_test.go new file mode 100755 index 000000000..333cb7f9f --- /dev/null +++ b/Algorithms/0424.longest-repeating-character-replacement/longest-repeating-character-replacement_test.go @@ -0,0 +1,65 @@ +package problem0424 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + k int + ans int +}{ + + { + "BBBABBBCDEFGHIJKLMNOPQ", + 1, + 7, + }, + + { + "AABABBA", + 1, + 4, + }, + + { + "AAAA", + 2, + 4, + }, + + { + "ABAA", + 0, + 2, + }, + + { + "ABAB", + 2, + 4, + }, + + // 可以有多个 testcase +} + +func Test_characterReplacement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, characterReplacement(tc.s, tc.k), "输入:%v", tc) + } +} + +func Benchmark_characterReplacement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + characterReplacement(tc.s, tc.k) + } + } +} diff --git a/Algorithms/0432.all-oone-data-structure/432.100.png b/Algorithms/0432.all-oone-data-structure/432.100.png new file mode 100644 index 000000000..9f5e679d5 Binary files /dev/null and b/Algorithms/0432.all-oone-data-structure/432.100.png differ diff --git a/Algorithms/0432.all-oone-data-structure/README.md b/Algorithms/0432.all-oone-data-structure/README.md new file mode 100755 index 000000000..cabeb17ad --- /dev/null +++ b/Algorithms/0432.all-oone-data-structure/README.md @@ -0,0 +1,17 @@ +# [432. All O`one Data Structure](https://leetcode.com/problems/all-oone-data-structure/) + +## 题目 + +Implement a data structure supporting the following operations: + +1. Inc(Key) - Inserts a new key with value 1. Or increments an existing key by 1. Key is guaranteed to be a non-empty string. +1. Dec(Key) - If Key's value is 1, remove it from the data structure. Otherwise decrements an existing key by 1. If the key does not exist, this function does nothing. Key is guaranteed to be a non-empty string. +1. GetMaxKey() - Returns one of the keys with maximal value. If no element exists, return an empty string "". +1. GetMinKey() - Returns one of the keys with minimal value. If no element exists, return an empty string "". + +Challenge: Perform all these in O(1) time complexity. + +## 解题思路 + +见程序注释 +![100](432.100.png) \ No newline at end of file diff --git a/Algorithms/0432.all-oone-data-structure/all-oone-data-structure.go b/Algorithms/0432.all-oone-data-structure/all-oone-data-structure.go new file mode 100755 index 000000000..84338705a --- /dev/null +++ b/Algorithms/0432.all-oone-data-structure/all-oone-data-structure.go @@ -0,0 +1,146 @@ +package problem0432 + +import "container/heap" + +// AllOne 是解题所需的结构 +type AllOne struct { + m map[string]*entry + // 利用优先队列来维护 拥有极值的 key + max maxPQ + min minPQ +} + +// Constructor initialize your data structure here. +func Constructor() AllOne { + return AllOne{m: make(map[string]*entry), + max: maxPQ{}, + min: minPQ{}, + } +} + +// Inc inserts a new key with value 1. Or increments an existing key by 1. +func (a *AllOne) Inc(key string) { + if ep, ok := a.m[key]; ok { + ep.value++ + heap.Fix(&a.max, ep.maxIndex) + heap.Fix(&a.min, ep.maxIndex) + } else { + ep = &entry{key: key, value: 1} + a.m[key] = ep + heap.Push(&a.max, ep) + heap.Push(&a.min, ep) + } +} + +// Dec decrements an existing key by 1. If Key's value is 1, remove it from the data structure. +func (a *AllOne) Dec(key string) { + if ep, ok := a.m[key]; !ok { + return + } else if ep.value == 1 { + heap.Remove(&a.max, ep.maxIndex) + heap.Remove(&a.min, ep.minIndex) + } else { + ep.value-- + heap.Fix(&a.max, ep.maxIndex) + heap.Fix(&a.min, ep.minIndex) + } +} + +// GetMaxKey returns one of the keys with maximal value. +func (a *AllOne) GetMaxKey() string { + if len(a.max) == 0 { + return "" + } + return a.max[0].key +} + +// GetMinKey returns one of the keys with Minimal value. +func (a *AllOne) GetMinKey() string { + if len(a.min) == 0 { + return "" + } + return a.min[0].key +} + +/** + * Your AllOne object will be instantiated and called as such: + * obj := Constructor(); + * obj.Inc(key); + * obj.Dec(key); + * param_3 := obj.GetMaxKey(); + * param_4 := obj.GetMinKey(); + */ + +// entry 是 priorityQueue 中的元素 +type entry struct { + key string + value int + maxIndex int + minIndex int +} + +// priorityQueue implements heap.Interface and holds entrys. +type minPQ []*entry + +func (pq minPQ) Len() int { return len(pq) } + +func (pq minPQ) Less(i, j int) bool { + return pq[i].value < pq[j].value +} + +func (pq minPQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].minIndex = i + pq[j].minIndex = j +} + +// Push 往 pq 中放 entry +func (pq *minPQ) Push(x interface{}) { + n := len(*pq) + entry := x.(*entry) + entry.minIndex = n + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *minPQ) Pop() interface{} { + old := *pq + n := len(old) + entry := old[n-1] + entry.minIndex = -1 // for safety + *pq = old[0 : n-1] + return entry +} + +// priorityQueue implements heap.Interface and holds entrys. +type maxPQ []*entry + +func (pq maxPQ) Len() int { return len(pq) } + +func (pq maxPQ) Less(i, j int) bool { + return pq[i].value > pq[j].value +} + +func (pq maxPQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].maxIndex = i + pq[j].maxIndex = j +} + +// Push 往 pq 中放 entry +func (pq *maxPQ) Push(x interface{}) { + n := len(*pq) + entry := x.(*entry) + entry.maxIndex = n + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *maxPQ) Pop() interface{} { + old := *pq + n := len(old) + entry := old[n-1] + entry.maxIndex = -1 // for safety + *pq = old[0 : n-1] + return entry +} diff --git a/Algorithms/0432.all-oone-data-structure/all-oone-data-structure_test.go b/Algorithms/0432.all-oone-data-structure/all-oone-data-structure_test.go new file mode 100755 index 000000000..4887fd41a --- /dev/null +++ b/Algorithms/0432.all-oone-data-structure/all-oone-data-structure_test.go @@ -0,0 +1,53 @@ +package problem0432 + +import ( + "strconv" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_AllOne(t *testing.T) { + ast := assert.New(t) + + a := Constructor() + + ast.Equal("", a.GetMaxKey()) + ast.Equal("", a.GetMinKey()) + + a.Inc("6") + + ast.Equal("6", a.GetMaxKey()) + ast.Equal("6", a.GetMinKey()) + + a.Dec("6") + + ast.Equal("", a.GetMaxKey()) + ast.Equal("", a.GetMinKey()) + + maxKeys := []string{"7", "8", "9"} + minKeys := []string{"1", "2", "3"} + + for i := 0; i < 3; i++ { + for j := 1; j < 10; j++ { + a.Inc(strconv.Itoa(j)) + } + } + + for _, key := range maxKeys { + a.Inc(key) + a.Inc(key) + } + + for _, key := range minKeys { + a.Dec(key) + a.Dec(key) + } + + ast.Contains(maxKeys, a.GetMaxKey(), "无法获取正确的 max key") + + ast.Contains(minKeys, a.GetMinKey(), "无法获取正确的 min key") + + // 以下是为了单元覆盖率 + a.Dec("100") +} diff --git a/Algorithms/0433.minimum-genetic-mutation/README.md b/Algorithms/0433.minimum-genetic-mutation/README.md new file mode 100755 index 000000000..e1cb213f1 --- /dev/null +++ b/Algorithms/0433.minimum-genetic-mutation/README.md @@ -0,0 +1,53 @@ +# [433. Minimum Genetic Mutation](https://leetcode.com/problems/minimum-genetic-mutation/) + +## 题目 + +A gene string can be represented by an 8-character long string, with choices from "A", "C", "G", "T". + +Suppose we need to investigate about a mutation (mutation from "start" to "end"), where ONE mutation is defined as ONE single character changed in the gene string. + +For example, "AACCGGTT" -> "AACCGGTA" is 1 mutation. + +Also, there is a given gene "bank", which records all the valid gene mutations. A gene must be in the bank to make it a valid gene string. + +Now, given 3 things - start, end, bank, your task is to determine what is the minimum number of mutations needed to mutate from "start" to "end". If there is no such a mutation, return -1. + +Note: + +1. Starting point is assumed to be valid, so it might not be included in the bank. +1. If multiple mutations are needed, all mutations during in the sequence must be valid. +1. You may assume start and end string is not the same. + +Example 1: + +```text +start: "AACCGGTT" +end: "AACCGGTA" +bank: ["AACCGGTA"] + +return: 1 +``` + +Example 2: + +```text +start: "AACCGGTT" +end: "AAACGGTA" +bank: ["AACCGGTA", "AACCGCTA", "AAACGGTA"] + +return: 2 +``` + +Example 3: + +```text +start: "AAAAACCC" +end: "AACCCCCC" +bank: ["AAAACCCC", "AAACCCCC", "AACCCCCC"] + +return: 3 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation.go b/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation.go new file mode 100644 index 000000000..806bb7902 --- /dev/null +++ b/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation.go @@ -0,0 +1,48 @@ +package problem0433 + +func minMutation(start string, end string, bank []string) int { + if start == end { + return 1 + } + + cands := make([]string, 1, 1024) + cands[0] = start + res := 0 + + // 记录 bank 中的 gene 是否已经添加到 cands 中。 + // 避免重复添加 + isAdded := make([]bool, len(bank)) + + for len(cands) > 0 { + res++ + size := len(cands) + for i := 0; i < size; i++ { + cand := cands[i] + for i, gene := range bank { + if isAdded[i] || !isMutation(cand, gene) { + continue + } + if gene == end { + return res + } + cands = append(cands, gene) + isAdded[i] = true + } + } + cands = cands[size:] + } + return -1 +} + +func isMutation(cand, g string) bool { + count := 0 + size := len(g) + i := 0 + for count < 2 && i < size { + if cand[i] != g[i] { + count++ + } + i++ + } + return count == 1 +} diff --git a/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation_test.go b/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation_test.go new file mode 100644 index 000000000..f26ceb4d0 --- /dev/null +++ b/Algorithms/0433.minimum-genetic-mutation/minimum-genetic-mutation_test.go @@ -0,0 +1,78 @@ +package problem0433 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + start string + end string + bank []string + ans int +}{ + + { + "AACCGGTT", + "AAACGGTA", + []string{"AACCGATT", "AACCGATA", "AAACGATA", "AAACGGTA"}, + 4, + }, + + { + "AACCGGTT", + "AACCGGTA", + []string{}, + -1, + }, + + { + "AACCGGTT", + "AACCGGTT", + []string{"AACCGGTT"}, + 1, + }, + + { + "AACCGGTT", + "AACCGGTA", + []string{"AACCGGTA"}, + 1, + }, + + { + "AACCGGTT", + "AAACGGTA", + []string{"AACCGGTA", "AACCGCTA", "AAACGGTA"}, + 2, + }, + + { + "AAAAACCC", + "AACCCCCC", + []string{"AAAACCCC", "AAACCCCC", "AACCCCCC"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_countSegments(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minMutation(tc.start, tc.end, tc.bank), "输入:%v", tc) + } +} + +func Benchmark_countSegments(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minMutation(tc.start, tc.end, tc.bank) + } + } +} diff --git a/Algorithms/0434.number-of-segments-in-a-string/README.md b/Algorithms/0434.number-of-segments-in-a-string/README.md new file mode 100755 index 000000000..63fb121fb --- /dev/null +++ b/Algorithms/0434.number-of-segments-in-a-string/README.md @@ -0,0 +1,18 @@ +# [434. Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) + +## 题目 + +Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. + +Please note that the string does not contain any non-printable characters. + +Example: + +```test +Input: "Hello, my name is John" +Output: 5 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string.go b/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string.go new file mode 100755 index 000000000..4b7637a44 --- /dev/null +++ b/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string.go @@ -0,0 +1,14 @@ +package problem0434 + +import ( + "strings" +) + +func countSegments(s string) int { + if len(s) == 0 { + return 0 + } + + strs := strings.Fields(s) + return len(strs) +} diff --git a/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string_test.go b/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string_test.go new file mode 100755 index 000000000..16cc329f6 --- /dev/null +++ b/Algorithms/0434.number-of-segments-in-a-string/number-of-segments-in-a-string_test.go @@ -0,0 +1,40 @@ +package problem0434 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + {"", 0}, + + {" Hello, my name is John", 5}, + + {"Hello, my name is John", 5}, + + // 可以有多个 testcase +} + +func Test_countSegments(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countSegments(tc.s), "输入:%v", tc) + } +} + +func Benchmark_countSegments(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countSegments(tc.s) + } + } +} diff --git a/Algorithms/0435.non-overlapping-intervals/README.md b/Algorithms/0435.non-overlapping-intervals/README.md new file mode 100755 index 000000000..1bd73b949 --- /dev/null +++ b/Algorithms/0435.non-overlapping-intervals/README.md @@ -0,0 +1,44 @@ +# [435. Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/) + +## 题目 + +Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. + +Note: + +1. You may assume the interval's end point is always bigger than its start point. +1. Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other. + +Example 1: + +```text +Input: [ [1,2], [2,3], [3,4], [1,3] ] + +Output: 1 + +Explanation: [1,3] can be removed and the rest of intervals are non-overlapping. +``` + +Example 2: + +```text +Input: [ [1,2], [1,2], [1,2] ] + +Output: 2 + +Explanation: You need to remove two [1,2] to make the rest of intervals non-overlapping. +``` + +Example 3: + +```text +Input: [ [1,2], [2,3] ] + +Output: 0 + +Explanation: You don't need to remove any of the intervals since they're already non-overlapping. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals.go b/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals.go new file mode 100755 index 000000000..31112a83e --- /dev/null +++ b/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals.go @@ -0,0 +1,35 @@ +package problem0435 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "sort" +) + +type Interval = kit.Interval + +func eraseOverlapIntervals(intervals []Interval) int { + end := -1 << 31 + res:=0 + if len(intervals) == 1 { + return 0 + } + + sort.Sort(B(intervals)) + + for _,v := range intervals { + if end <= v.Start { + end = v.End + } else { + res++ + } + } + + return res +} + +// B 经过排序后, End 小的排在前面 +type B []Interval + +func (a B) Len() int { return len(a) } +func (a B) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a B) Less(i, j int) bool { return a[i].End < a[j].End } \ No newline at end of file diff --git a/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals_test.go b/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals_test.go new file mode 100755 index 000000000..26b14c6b0 --- /dev/null +++ b/Algorithms/0435.non-overlapping-intervals/non-overlapping-intervals_test.go @@ -0,0 +1,51 @@ +package problem0435 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + intervals [][]int + ans int +}{ + + { + [][]int{{1, 2}, {2, 3}, {3, 4}, {1, 3}}, + 1, + }, + + { + [][]int{{1, 2}, {1, 2}, {1, 2}}, + 2, + }, + + { + [][]int{{2, 3}}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_eraseOverlapIntervals(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, eraseOverlapIntervals(kit.Intss2IntervalSlice(tc.intervals)), "输入:%v", tc) + } +} + +func Benchmark_eraseOverlapIntervals(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + eraseOverlapIntervals(kit.Intss2IntervalSlice(tc.intervals)) + } + } +} diff --git a/Algorithms/0436.find-right-interval/README.md b/Algorithms/0436.find-right-interval/README.md new file mode 100755 index 000000000..de15e11ff --- /dev/null +++ b/Algorithms/0436.find-right-interval/README.md @@ -0,0 +1,49 @@ +# [436. Find Right Interval](https://leetcode.com/problems/find-right-interval/) + +## 题目 + +Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interval i, which can be called that j is on the "right" of i. + +For any interval i, you need to store the minimum interval j's index, which means that the interval j has the minimum start point to build the "right" relationship for interval i. If the interval j doesn't exist, store -1 for the interval i. Finally, you need output the stored value of each interval as an array. + +Note: + +1. You may assume the interval's end point is always bigger than its start point. +1. You may assume none of these intervals have the same start point. + +Example 1: + +```text +Input: [ [1,2] ] + +Output: [-1] + +Explanation: There is only one interval in the collection, so it outputs -1. +``` + +Example 2: + +```text +Input: [ [3,4], [2,3], [1,2] ] + +Output: [-1, 0, 1] + +Explanation: There is no satisfied "right" interval for [3,4]. +For [2,3], the interval [3,4] has minimum-"right" start point; +For [1,2], the interval [2,3] has minimum-"right" start point. +``` + +Example 3: + +```text +Input: [ [1,4], [2,3], [3,4] ] + +Output: [-1, 2, -1] + +Explanation: There is no satisfied "right" interval for [1,4] and [3,4]. +For [2,3], the interval [3,4] has minimum-"right" start point. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0436.find-right-interval/find-right-interval.go b/Algorithms/0436.find-right-interval/find-right-interval.go new file mode 100755 index 000000000..be07ae683 --- /dev/null +++ b/Algorithms/0436.find-right-interval/find-right-interval.go @@ -0,0 +1,34 @@ +package problem0436 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "sort" +) + +type Interval = kit.Interval + +func findRightInterval(intervals []Interval) []int { + size := len(intervals) + + starts := make([]int, size) + idxs := make(map[int]int, size) + res := make([]int, size) + + for i, v := range intervals { + starts[i] = v.Start + idxs[v.Start] = i + } + + sort.Ints(starts) + + for i, v := range intervals { + idx := sort.SearchInts(starts, v.End) + if idx < size { + res[i] = idxs[starts[idx]] + } else { + res[i] = -1 + } + } + + return res +} diff --git a/Algorithms/0436.find-right-interval/find-right-interval_test.go b/Algorithms/0436.find-right-interval/find-right-interval_test.go new file mode 100755 index 000000000..bded5f57a --- /dev/null +++ b/Algorithms/0436.find-right-interval/find-right-interval_test.go @@ -0,0 +1,61 @@ +package problem0436 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + intervals []Interval + ans []int +}{ + + { + kit.Intss2IntervalSlice([][]int{ + {3, 4}, + {2, 3}, + {1, 2}, + }), + []int{-1, 0, 1}, + }, + + { + kit.Intss2IntervalSlice([][]int{ + {1, 2}, + }), + []int{-1}, + }, + + { + kit.Intss2IntervalSlice([][]int{ + {1, 4}, + {2, 3}, + {3, 4}, + }), + []int{-1, 2, -1}, + }, + + // 可以有多个 testcase +} + +func Test_findRightInterval(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRightInterval(tc.intervals), "输入:%v", tc) + } +} + +func Benchmark_findRightInterval(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRightInterval(tc.intervals) + } + } +} diff --git a/Algorithms/0437.path-sum-iii/path-sum-iii.go b/Algorithms/0437.path-sum-iii/path-sum-iii.go index 7033f939f..46bb827d6 100755 --- a/Algorithms/0437.path-sum-iii/path-sum-iii.go +++ b/Algorithms/0437.path-sum-iii/path-sum-iii.go @@ -1,7 +1,7 @@ -package Problem0437 +package problem0437 import ( - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" ) type TreeNode = kit.TreeNode diff --git a/Algorithms/0437.path-sum-iii/path-sum-iii_test.go b/Algorithms/0437.path-sum-iii/path-sum-iii_test.go index 708168b1f..958dd17e4 100755 --- a/Algorithms/0437.path-sum-iii/path-sum-iii_test.go +++ b/Algorithms/0437.path-sum-iii/path-sum-iii_test.go @@ -1,10 +1,10 @@ -package Problem0437 +package problem0437 import ( "fmt" "testing" - "github.com/aQuaYi/LeetCode-in-Golang/kit" + "github.com/aQuaYi/LeetCode-in-Go/kit" "github.com/stretchr/testify/assert" ) diff --git a/Algorithms/0438.find-all-anagrams-in-a-string/README.md b/Algorithms/0438.find-all-anagrams-in-a-string/README.md new file mode 100755 index 000000000..8ae948522 --- /dev/null +++ b/Algorithms/0438.find-all-anagrams-in-a-string/README.md @@ -0,0 +1,42 @@ +# [438. Find All Anagrams in a String](https://leetcode.com/problems/find-all-anagrams-in-a-string/) + +## 题目 + +Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. + +Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100. + +The order of output does not matter. + +Example 1: + +```text +Input: +s: "cbaebabacd" p: "abc" + +Output: +[0, 6] + +Explanation: +The substring with start index = 0 is "cba", which is an anagram of "abc". +The substring with start index = 6 is "bac", which is an anagram of "abc". +``` + +Example 2: + +```text +Input: +s: "abab" p: "ab" + +Output: +[0, 1, 2] + +Explanation: +The substring with start index = 0 is "ab", which is an anagram of "ab". +The substring with start index = 1 is "ba", which is an anagram of "ab". +The substring with start index = 2 is "ab", which is an anagram of "ab". +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.go b/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.go new file mode 100755 index 000000000..d6430ed92 --- /dev/null +++ b/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string.go @@ -0,0 +1,28 @@ +package problem0438 + +func findAnagrams(s string, p string) []int { + var res = []int{} + + var target, window [26]int + for i := 0; i < len(p); i++ { + target[p[i]-'a']++ + } + + check := func(i int) { + if window == target { + res = append(res, i) + } + } + + for i := 0; i < len(s); i++ { + window[s[i]-'a']++ + if i == len(p)-1 { + check(0) + } else if len(p) <= i { + window[s[i-len(p)]-'a']-- + check(i - len(p) + 1) + } + } + + return res +} diff --git a/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string_test.go b/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string_test.go new file mode 100755 index 000000000..761f4c1fe --- /dev/null +++ b/Algorithms/0438.find-all-anagrams-in-a-string/find-all-anagrams-in-a-string_test.go @@ -0,0 +1,53 @@ +package problem0438 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + p string + ans []int +}{ + + { + "abc", + "cbaebabacd", + []int{}, + }, + + { + "cbaebabacd", + "abc", + []int{0, 6}, + }, + + { + "abab", + "ab", + []int{0, 1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_findAnagrams(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findAnagrams(tc.s, tc.p), "输入:%v", tc) + } +} + +func Benchmark_findAnagrams(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findAnagrams(tc.s, tc.p) + } + } +} diff --git a/Algorithms/0440.k-th-smallest-in-lexicographical-order/README.md b/Algorithms/0440.k-th-smallest-in-lexicographical-order/README.md new file mode 100755 index 000000000..377c6909a --- /dev/null +++ b/Algorithms/0440.k-th-smallest-in-lexicographical-order/README.md @@ -0,0 +1,24 @@ +# [440. K-th Smallest in Lexicographical Order](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/) + +## 题目 + +Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n. + +Note: 1 ≤ k ≤ n ≤ 109. + +Example: + +```text +Input: +n: 13 k: 2 + +Output: +10 + +Explanation: +The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order.go b/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order.go new file mode 100755 index 000000000..dcf9ff203 --- /dev/null +++ b/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order.go @@ -0,0 +1,56 @@ +package problem0440 + +func findKthNumber(n int, k int) int { + /* + [1,n] 经过 lexicographical 排序后,其顺序集合 s + for res:=1; res<=9; res++ { + s += [res, res+1) + + [res*10, (res+1)*10 ) + + [res*100, (res+1)*100 ) + + ... + } + */ + res := 1 + // k 与 res 总是同时更新 + // 当 k == 0 时, res 就是所求的答案 + k-- + for k > 0 { + // count 统计了在 [1, n] 内,以 res 开头的数的个数 + count := 0 + begin, end := res, res+1 + for begin <= n { + count += min(n+1, end) - begin + begin *= 10 + end *= 10 + } + + if count <= k { + // 答案不在以 res 开头的数中 + // 排除以 res 开头的 count 个数 + k -= count + // 去下一个开头中查找 + res++ + } else { + // 答案在以 res 开头的数中 + // 但是不在 [res, res+1) 中, + // 因为在的话,k 在上一个 for 循环结束时,就是 0 了 + // 排除了 [res, res+1) 中只有一个数字 + k-- + // 在 res*10 + [0, 9] 这些开头中,重新开始查找 + res *= 10 + } + + // 每个 for 循环都可以 + // 在 if 中排除一部分范围 + // 在 else 中获取 res 的前缀的更多细节 + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order_test.go b/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order_test.go new file mode 100755 index 000000000..6e8d41297 --- /dev/null +++ b/Algorithms/0440.k-th-smallest-in-lexicographical-order/k-th-smallest-in-lexicographical-order_test.go @@ -0,0 +1,43 @@ +package problem0440 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + k int + ans int +}{ + + {13, 2, 10}, + + {987654321, 987654321, 99999999}, + + {100, 10, 17}, + + {1000000000, 1000000000, 999999999}, + + // 可以有多个 testcase +} + +func Test_findKthNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findKthNumber(tc.n, tc.k), "输入:%v", tc) + } +} + +func Benchmark_findKthNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findKthNumber(tc.n, tc.k) + } + } +} diff --git a/Algorithms/0441.arranging-coins/README.md b/Algorithms/0441.arranging-coins/README.md new file mode 100755 index 000000000..c616af613 --- /dev/null +++ b/Algorithms/0441.arranging-coins/README.md @@ -0,0 +1,40 @@ +# [441. Arranging Coins](https://leetcode.com/problems/arranging-coins/) + +## 题目 + +You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. + +Given n, find the total number of full staircase rows that can be formed. + +n is a non-negative integer and fits within the range of a 32-bit signed integer. + +Example 1: + +```text +n = 5 + +The coins can form the following rows: +¤ +¤ ¤ +¤ ¤ + +Because the 3rd row is incomplete, we return 2. +``` + +Example 2: + +```text +n = 8 + +The coins can form the following rows: +¤ +¤ ¤ +¤ ¤ ¤ +¤ ¤ + +Because the 4th row is incomplete, we return 3. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0441.arranging-coins/arranging-coins.go b/Algorithms/0441.arranging-coins/arranging-coins.go new file mode 100755 index 000000000..fa22256ba --- /dev/null +++ b/Algorithms/0441.arranging-coins/arranging-coins.go @@ -0,0 +1,10 @@ +package problem0441 + +func arrangeCoins(n int) int { + n *= 2 + x := n + for !(x*(x+1) <= n && n < (x+1)*(x+2)) { + x = (x + n/(x+1)) / 2 + } + return x +} diff --git a/Algorithms/0441.arranging-coins/arranging-coins_test.go b/Algorithms/0441.arranging-coins/arranging-coins_test.go new file mode 100755 index 000000000..70c8b3ed8 --- /dev/null +++ b/Algorithms/0441.arranging-coins/arranging-coins_test.go @@ -0,0 +1,54 @@ +package problem0441 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 1804289383, + 60070, + }, + + { + 10, + 4, + }, + + { + 5, + 2, + }, + + { + 8, + 3, + }, + + // 可以有多个 testcase +} + +func Test_arrangeCoins(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, arrangeCoins(tc.n), "输入:%v", tc) + } +} + +func Benchmark_arrangeCoins(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + arrangeCoins(tc.n) + } + } +} diff --git a/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.go b/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.go index 0c8d789f5..82234f86b 100755 --- a/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.go +++ b/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.go @@ -1,4 +1,4 @@ -package Problem0442 +package problem0442 import ( "sort" diff --git a/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array_test.go b/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array_test.go index cdc232a5e..30468a75e 100755 --- a/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array_test.go +++ b/Algorithms/0442.find-all-duplicates-in-an-array/find-all-duplicates-in-an-array_test.go @@ -1,4 +1,4 @@ -package Problem0442 +package problem0442 import ( "fmt" diff --git a/Algorithms/0443.string-compression/README.md b/Algorithms/0443.string-compression/README.md new file mode 100755 index 000000000..ffb0e547c --- /dev/null +++ b/Algorithms/0443.string-compression/README.md @@ -0,0 +1,63 @@ +# [443. String Compression](https://leetcode.com/problems/string-compression/) + +## 题目 + +Given an array of characters, compress it in-place. + +The length after compression must always be smaller than or equal to the original array. + +Every element of the array should be a character (not int) of length 1. + +After you are done modifying the input array in-place, return the new length of the array. + +Follow up: +Could you solve it using only O(1) extra space? + +Example 1: + +```text +Input: +["a","a","b","b","c","c","c"] + +Output: +Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"] + +Explanation: +"aa" is replaced by "a2". "bb" is replaced by "b2". "ccc" is replaced by "c3". +``` + +Example 2: + +```text +Input: +["a"] + +Output: +Return 1, and the first 1 characters of the input array should be: ["a"] + +Explanation: +Nothing is replaced. +``` + +Example 3: + +```text +Input: +["a","b","b","b","b","b","b","b","b","b","b","b","b"] + +Output: +Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"]. + +Explanation: +Since the character "a" does not repeat, it is not compressed. "bbbbbbbbbbbb" is replaced by "b12". +Notice each digit has it's own entry in the array. +``` + +Note: + +1. All characters have an ASCII value in [35, 126]. +1. 1 <= len(chars) <= 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0443.string-compression/string-compression.go b/Algorithms/0443.string-compression/string-compression.go new file mode 100755 index 000000000..71e74ba22 --- /dev/null +++ b/Algorithms/0443.string-compression/string-compression.go @@ -0,0 +1,31 @@ +package problem0443 + +import "strconv" + +func compress(chars []byte) int { + end, count := 0, 1 + + for i, char := range chars { + if i+1 < len(chars) && char == chars[i+1] { + // 统计相同字符的个数 + count++ + } else { // 出现不同的字符 + // 在 end 处填写被压缩的字符 + chars[end] = char + end++ + + // 从 end 处填写被压缩字符的个数 + if count > 1 { + for _, num := range strconv.Itoa(count) { + chars[end] = byte(num) + end++ + } + } + + // 把 count 重置为 1 + count = 1 + } + } + + return end +} diff --git a/Algorithms/0443.string-compression/string-compression_test.go b/Algorithms/0443.string-compression/string-compression_test.go new file mode 100755 index 000000000..4791fa396 --- /dev/null +++ b/Algorithms/0443.string-compression/string-compression_test.go @@ -0,0 +1,62 @@ +package problem0443 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + chars []byte + ans int + ansInPlace []byte +}{ + + { + []byte("abaa2"), + 5, + []byte("aba22"), + }, + + { + []byte("a"), + 1, + []byte("a"), + }, + + { + []byte("abbbbbbbbbbbb"), + 4, + []byte("ab12"), + }, + + { + []byte("aabbccc"), + 6, + []byte("a2b2c3"), + }, + + // 可以有多个 testcase +} + +func Test_compress(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, compress(tc.chars)) + + // 检查 inPlace 修改的情况 + ast.Equal(string(tc.ansInPlace), string(tc.chars)[:len(tc.ansInPlace)]) + } +} + +func Benchmark_compress(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + compress(tc.chars) + } + } +} diff --git a/Algorithms/0445.add-two-numbers-ii/README.md b/Algorithms/0445.add-two-numbers-ii/README.md new file mode 100755 index 000000000..0c71c745b --- /dev/null +++ b/Algorithms/0445.add-two-numbers-ii/README.md @@ -0,0 +1,21 @@ +# [445. Add Two Numbers II](https://leetcode.com/problems/add-two-numbers-ii/) + +## 题目 + +You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. + +You may assume the two numbers do not contain any leading zero, except the number 0 itself. + +Follow up: +What if you cannot modify the input lists? In other words, reversing the lists is not allowed. + +Example: + +```text +Input: (7 -> 2 -> 4 -> 3) + (5 -> 6 -> 4) +Output: 7 -> 8 -> 0 -> 7 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii.go b/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii.go new file mode 100755 index 000000000..d8c74f616 --- /dev/null +++ b/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii.go @@ -0,0 +1,52 @@ +package problem0445 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode { + // 把 l1 中的值,放入 stack s1 + s1 := make([]int, 0, 128) + for l1 != nil { + s1 = append(s1, l1.Val) + l1 = l1.Next + } + + // 把 l2 中的值,放入 stack s2 + s2 := make([]int, 0, 128) + for l2 != nil { + s2 = append(s2, l2.Val) + l2 = l2.Next + } + + sum := 0 + head := &ListNode{Val: 0} + + for len(s1) > 0 || len(s2) > 0 { + // s1.pop() + if len(s1) > 0 { + sum += s1[len(s1)-1] + s1 = s1[:len(s1)-1] + } + + // s2.pop() + if len(s2) > 0 { + sum += s2[len(s2)-1] + s2 = s2[:len(s2)-1] + } + + head.Val = sum % 10 + ln := &ListNode{Val: sum / 10} + ln.Next = head + head = ln + + sum /= 10 + } + + if head.Val == 0 { + return head.Next + } + return head +} diff --git a/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii_test.go b/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii_test.go new file mode 100755 index 000000000..33049154f --- /dev/null +++ b/Algorithms/0445.add-two-numbers-ii/add-two-numbers-ii_test.go @@ -0,0 +1,59 @@ +package problem0445 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + l1 []int + l2 []int + ans []int +}{ + + { + []int{7, 2, 4, 3}, + []int{4, 5, 6, 4}, + []int{1, 1, 8, 0, 7}, + }, + + { + []int{7, 2, 4, 3}, + []int{1, 5, 6, 4}, + []int{8, 8, 0, 7}, + }, + + { + []int{7, 2, 4, 3}, + []int{5, 6, 4}, + []int{7, 8, 0, 7}, + }, + + // 可以有多个 testcase +} + +func Test_addTwoNumbers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + l1 := kit.Ints2List(tc.l1) + l2 := kit.Ints2List(tc.l2) + ast.Equal(tc.ans, kit.List2Ints(addTwoNumbers(l1, l2)), "输入:%v", tc) + } +} + +func Benchmark_addTwoNumbers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + l1 := kit.Ints2List(tc.l1) + l2 := kit.Ints2List(tc.l2) + addTwoNumbers(l1, l2) + } + } +} diff --git a/Algorithms/0446.arithmetic-slices-ii-subsequence/README.md b/Algorithms/0446.arithmetic-slices-ii-subsequence/README.md new file mode 100755 index 000000000..de3777ba4 --- /dev/null +++ b/Algorithms/0446.arithmetic-slices-ii-subsequence/README.md @@ -0,0 +1,48 @@ +# [446. Arithmetic Slices II - Subsequence](https://leetcode.com/problems/arithmetic-slices-ii-subsequence/) + +## 题目 + +A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. + +For example, these are arithmetic sequences: + +```text +1, 3, 5, 7, 9 +7, 7, 7, 7 +3, -1, -5, -9 +``` + +The following sequence is not arithmetic. + +```text +1, 1, 2, 5, 7 +``` + +A zero-indexed array A consisting of N numbers is given. A subsequence slice of that array is any sequence of integers (P0, P1, ..., Pk) such that 0 ≤ P0 < P1 < ... < Pk < N. + +A subsequence slice (P0, P1, ..., Pk) of array A is called arithmetic if the sequence A[P0], A[P1], ..., A[Pk-1], A[Pk] is arithmetic. In particular, this means that k ≥ 2. + +The function should return the number of arithmetic subsequence slices in the array A. +The input contains N integers. Every integer is in the range of -2^31 and 2^31-1 and 0 ≤ N ≤ 1000. The output is guaranteed to be less than 2^31-1. + +Example: + +```text +Input: [2, 4, 6, 8, 10] + +Output: 7 + +Explanation: +All arithmetic subsequence slices are: +[2,4,6] +[4,6,8] +[6,8,10] +[2,4,6,8] +[4,6,8,10] +[2,4,6,8,10] +[2,6,10] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence.go b/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence.go new file mode 100755 index 000000000..f8588e1be --- /dev/null +++ b/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence.go @@ -0,0 +1,41 @@ +package problem0446 + +func numberOfArithmeticSlices(a []int) int { + n := len(a) + if n < 3 { + return 0 + } + + min, max := -1<<31, 1<<31-1 + + // dp[j][d] == x 表示 + // 如果存在 a[i] - a[j] == d, j < i < n, 那么, {a[:j+1]..., a[i]} 中 + // 可以构成形如 [..., a[j], a[i]] 的差值为 d 的等差数组的个数 + dp := make([]map[int]int, n) + + res := 0 + for i := 1; i < n; i++ { + dp[i] = make(map[int]int) + for j := 0; j < i; j++ { + d := a[i] - a[j] + + // 存在一个特殊的 test case,用于加速 + if d <= min || max <= d { + continue + } + + // + 1 是因为 [a[j], a[i]] 无法构成等差数列 + // 但是如果存在 a[k] == a[i] + d 的话, + // [a[j], a[i], a[k]] 就能构成 **1** 个等差数列了 + // 这里再次强调一下,d[i][d] 的含义是 + // 再加一个 a[i] + d 可以构成形如 + // [..., a[i], a[i]+d] 的等差数列子数组的个数 + dp[i][d] += dp[j][d] + 1 + // a[j] 已经遇到了 a[j] + d == a[i] + // 所以,res 加上的是 dp[j][d] + res += dp[j][d] + } + } + + return res +} diff --git a/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence_test.go b/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence_test.go new file mode 100755 index 000000000..f0de7112c --- /dev/null +++ b/Algorithms/0446.arithmetic-slices-ii-subsequence/arithmetic-slices-ii-subsequence_test.go @@ -0,0 +1,59 @@ +package problem0446 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{2, 4, 6, 8, 10}, + 7, + }, + + { + []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + 134217349, + }, + + { + []int{2, 4, 4, 6}, + 2, + }, + + { + []int{2147483638, 2147483639, 2147483640, 2147483641, 2147483642, 2147483643, 2147483644, 2147483645, 2147483646, 2147483647, -2147483648, -2147483647, -2147483646, -2147483645, -2147483644, -2147483643, -2147483642, -2147483641, -2147483640, -2147483639}, + 110, + }, + + { + []int{8, 10}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_numberOfArithmeticSlices(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numberOfArithmeticSlices(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numberOfArithmeticSlices(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numberOfArithmeticSlices(tc.A) + } + } +} diff --git a/Algorithms/0447.number-of-boomerangs/447.100.png b/Algorithms/0447.number-of-boomerangs/447.100.png new file mode 100644 index 000000000..301940e70 Binary files /dev/null and b/Algorithms/0447.number-of-boomerangs/447.100.png differ diff --git a/Algorithms/0447.number-of-boomerangs/README.md b/Algorithms/0447.number-of-boomerangs/README.md new file mode 100755 index 000000000..89d2b5480 --- /dev/null +++ b/Algorithms/0447.number-of-boomerangs/README.md @@ -0,0 +1,27 @@ +# [447. Number of Boomerangs](https://leetcode.com/problems/number-of-boomerangs/) + +## 题目 + +Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tuple matters). + +Find the number of boomerangs. You may assume that n will be at most 500 and coordinates of points are all in the range [-10000, 10000] (inclusive). + +Example: + +```text +Input: +[[0,0],[1,0],[2,0]] + +Output: +2 + +Explanation: +The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]] +``` + +## 解题思路 + +见程序注释 + +只是预先指定了 map 的 cap 而已。 +![100](447.100.png) \ No newline at end of file diff --git a/Algorithms/0447.number-of-boomerangs/number-of-boomerangs.go b/Algorithms/0447.number-of-boomerangs/number-of-boomerangs.go new file mode 100755 index 000000000..e5858a29a --- /dev/null +++ b/Algorithms/0447.number-of-boomerangs/number-of-boomerangs.go @@ -0,0 +1,43 @@ +package problem0447 + +func numberOfBoomerangs(points [][]int) int { + res := 0 + + size := len(points) + if size < 3 { + return 0 + } + + for i := 0; i < size; i++ { + // dMap[9]6 表示, points 中与 points[i] 距离为 3 的点,共有 6 个。 + dMap := make(map[int]int, size) + + for j := 0; j < size; j++ { + if i == j { + continue + } + + d := dSquare(points[i], points[j]) + + if _, ok := dMap[d]; ok { + dMap[d]++ + } else { + dMap[d] = 1 + } + } + + for _, v := range dMap { + // 相同距离的 v 个点 + // 总共有 v * (v - 1) 种排列 + res += v * (v - 1) + } + } + + return res +} + +func dSquare(p1, p2 []int) int { + x := p2[0] - p1[0] + y := p2[1] - p1[1] + return x*x + y*y +} diff --git a/Algorithms/0447.number-of-boomerangs/number-of-boomerangs_test.go b/Algorithms/0447.number-of-boomerangs/number-of-boomerangs_test.go new file mode 100755 index 000000000..4c15cb7da --- /dev/null +++ b/Algorithms/0447.number-of-boomerangs/number-of-boomerangs_test.go @@ -0,0 +1,44 @@ +package problem0447 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans int +}{ + + { + [][]int{{1, 0}, {2, 0}}, + 0, + }, + + { + [][]int{{0, 0}, {1, 0}, {2, 0}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_numberOfBoomerangs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numberOfBoomerangs(tc.points), "输入:%v", tc) + } +} + +func Benchmark_numberOfBoomerangs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numberOfBoomerangs(tc.points) + } + } +} diff --git a/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.go b/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.go index 30f8c927c..a36bac030 100755 --- a/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.go +++ b/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array.go @@ -1,4 +1,4 @@ -package Problem0448 +package problem0448 func findDisappearedNumbers(nums []int) []int { for i := 0; i < len(nums); i++ { diff --git a/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array_test.go b/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array_test.go index 61a06cf3c..307ab3341 100755 --- a/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array_test.go +++ b/Algorithms/0448.find-all-numbers-disappeared-in-an-array/find-all-numbers-disappeared-in-an-array_test.go @@ -1,4 +1,4 @@ -package Problem0448 +package problem0448 import ( "fmt" diff --git a/Algorithms/0450.delete-node-in-a-bst/README.md b/Algorithms/0450.delete-node-in-a-bst/README.md new file mode 100755 index 000000000..8bff7960f --- /dev/null +++ b/Algorithms/0450.delete-node-in-a-bst/README.md @@ -0,0 +1,47 @@ +# [450. Delete Node in a BST](https://leetcode.com/problems/delete-node-in-a-bst/) + +## 题目 + +Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. + +Basically, the deletion can be divided into two stages: + +1. Search for a node to remove. +1. If the node is found, delete the node. + +Note: Time complexity should be O(height of tree). + +Example: + +```text +root = [5,3,6,2,4,null,7] +key = 3 + + 5 + / \ + 3 6 + / \ \ +2 4 7 + +Given key to delete is 3. So we find the node with value 3 and delete it. + +One valid answer is [5,4,6,2,null,null,7], shown in the following BST. + + 5 + / \ + 4 6 + / \ +2 7 + +Another valid answer is [5,2,6,null,4,null,7]. + + 5 + / \ + 2 6 + \ \ + 4 7 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst.go b/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst.go new file mode 100755 index 000000000..24349c7db --- /dev/null +++ b/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst.go @@ -0,0 +1,40 @@ +package problem0450 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode +func deleteNode(root *TreeNode, key int) *TreeNode { + if root == nil { + return root + } + + if root.Val == key { + if root.Left == nil && root.Right == nil { + return nil + } else if root.Left == nil { + return root.Right + } else if root.Right == nil { + return root.Left + } else { + max := findMax(root.Left) + root.Val = max + root.Left = deleteNode(root.Left, max) + } + } else if root.Val > key { + root.Left = deleteNode(root.Left, key) + } else { + root.Right = deleteNode(root.Right, key) + } + + return root +} + +func findMax(node *TreeNode)int { + if node.Right == nil { + return node.Val + } + return findMax(node.Right) +} + diff --git a/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst_test.go b/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst_test.go new file mode 100755 index 000000000..4f7f7b62d --- /dev/null +++ b/Algorithms/0450.delete-node-in-a-bst/delete-node-in-a-bst_test.go @@ -0,0 +1,81 @@ +package problem0450 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + key int + ans []int +}{ + + { + []int{2, 0, 1, 33, 25, 11, 10, 4, 3, 9, 18, 12, 14, 24, 22, 31, 29, 26, 27, 30, 32, 40, 34, 36, 35, 39, 45, 43, 42, 44, 46, 48}, + []int{0, 1, 2, 3, 4, 9, 10, 11, 12, 14, 18, 22, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 39, 40, 42, 43, 44, 45, 46, 48}, + 33, + []int{0, 1, 2, 3, 4, 9, 10, 11, 12, 14, 18, 22, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 39, 40, 42, 43, 44, 45, 46, 48}, + }, + + { + []int{1, 2}, + []int{2, 1}, + 1, + []int{2}, + }, + + { + []int{1, 2}, + []int{1, 2}, + 1, + []int{2}, + }, + + { + []int{}, + []int{}, + 0, + nil, + }, + + { + []int{0}, + []int{0}, + 0, + nil, + }, + + { + []int{5, 3, 2, 4, 6, 7}, + []int{2, 3, 4, 5, 6, 7}, + 3, + []int{2, 4, 5, 6, 7}, + }, + + // 可以有多个 testcase +} + +func Test_deleteNode(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, kit.Tree2Inorder(deleteNode(root, tc.key)), "输入:%v", tc) + } +} + +func Benchmark_deleteNode(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + deleteNode(root, tc.key) + } + } +} diff --git a/Algorithms/0451.sort-characters-by-frequency/451.100.png b/Algorithms/0451.sort-characters-by-frequency/451.100.png new file mode 100644 index 000000000..8dd0f8fd8 Binary files /dev/null and b/Algorithms/0451.sort-characters-by-frequency/451.100.png differ diff --git a/Algorithms/0451.sort-characters-by-frequency/README.md b/Algorithms/0451.sort-characters-by-frequency/README.md new file mode 100755 index 000000000..4cf5ab1b3 --- /dev/null +++ b/Algorithms/0451.sort-characters-by-frequency/README.md @@ -0,0 +1,53 @@ +# [451. Sort Characters By Frequency](https://leetcode.com/problems/sort-characters-by-frequency/) + +## 题目 + +Given a string, sort it in decreasing order based on the frequency of characters. + +Example 1: + +```text +Input: +"tree" + +Output: +"eert" + +Explanation: +'e' appears twice while 'r' and 't' both appear once. +So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer. +``` + +Example 2: + +```text +Input: +"cccaaa" + +Output: +"cccaaa" + +Explanation: +Both 'c' and 'a' appear three times, so "aaaccc" is also a valid answer. +Note that "cacaca" is incorrect, as the same characters must be together. +``` + +Example 3: + +```text +Input: +"Aabb" + +Output: +"bbAa" + +Explanation: +"bbaA" is also a valid answer, but "Aabb" is incorrect. +Note that 'A' and 'a' are treated as two different characters. +``` + +## 解题思路 + +见程序注释 + +![100](451.100.png) \ No newline at end of file diff --git a/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency.go b/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency.go new file mode 100755 index 000000000..5e13f6179 --- /dev/null +++ b/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency.go @@ -0,0 +1,56 @@ +package problem0451 + +import "sort" + +func frequencySort(s string) string { + // r 记录了各个字符出现的次数 + r := ['z' + 1]int{} + for i := range s { + r[s[i]]++ + } + + // ss 中是由相同字符组成的 string 片段 + ss := make([]string, 0, len(s)) + for i := range r { + if r[i] == 0 { + continue + } + ss = append(ss, makeString(byte(i), r[i])) + } + + // 按照题目中的规则,对 ss 进行排序 + sort.Sort(segments(ss)) + + // 按顺序把 ss 中的片段拼接成 答案 + res := "" + for _, s := range ss { + res += s + } + + return res +} + +// 返回由 n 个 b 组成的字符串 +func makeString(b byte, n int) string { + bytes := make([]byte, n) + for i := range bytes { + bytes[i] = b + } + return string(bytes) +} + +// segments 实现了 sort.Interface 接口 +type segments []string + +func (s segments) Len() int { return len(s) } + +func (s segments) Less(i, j int) bool { + // 按照题意,这个 if 不是必须的 + // 但是,添加以后,可以保证答案的唯一性 + if len(s[i]) == len(s[j]) { + return s[i] < s[j] + } + return len(s[i]) > len(s[j]) +} + +func (s segments) Swap(i, j int) { s[i], s[j] = s[j], s[i] } diff --git a/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency_test.go b/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency_test.go new file mode 100755 index 000000000..1b9fed3d9 --- /dev/null +++ b/Algorithms/0451.sort-characters-by-frequency/sort-characters-by-frequency_test.go @@ -0,0 +1,49 @@ +package problem0451 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "tree", + "eert", + }, + + { + "cccaaa", + "aaaccc", + }, + + { + "Aabb", + "bbAa", + }, + + // 可以有多个 testcase +} + +func Test_frequencySort(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, frequencySort(tc.s), "输入:%v", tc) + } +} + +func Benchmark_frequencySort(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + frequencySort(tc.s) + } + } +} diff --git a/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/452.100.png b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/452.100.png new file mode 100644 index 000000000..f13fccde5 Binary files /dev/null and b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/452.100.png differ diff --git a/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/README.md b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/README.md new file mode 100755 index 000000000..64a069763 --- /dev/null +++ b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/README.md @@ -0,0 +1,26 @@ +# [452. Minimum Number of Arrows to Burst Balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/) + +## 题目 + +There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordinates don't matter and hence the x-coordinates of start and end of the diameter suffice. Start is always smaller than end. There will be at most 104 balloons. + +An arrow can be shot up exactly vertically from different points along the x-axis. A balloon with xstart and xend bursts by an arrow shot at x if xstart ≤ x ≤ xend. There is no limit to the number of arrows that can be shot. An arrow once shot keeps travelling up infinitely. The problem is to find the minimum number of arrows that must be shot to burst all balloons. + +Example: + +```text +Input: +[[10,16], [2,8], [1,6], [7,12]] + +Output: +2 + +Explanation: +One way is to shoot one arrow for example at x = 6 (bursting the balloons [2,8] and [1,6]) and another arrow at x = 11 (bursting the other two balloons). +``` + +## 解题思路 + +见程序注释 + +![100](452.100.png) \ No newline at end of file diff --git a/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons.go b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons.go new file mode 100755 index 000000000..335c36098 --- /dev/null +++ b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons.go @@ -0,0 +1,37 @@ +package problem0452 + +import "sort" + +func findMinArrowShots(bs [][]int) int { + size := len(bs) + if size == 0 { + return 0 + } + + sort.Sort(balloons(bs)) + + res := 0 + end := bs[0][1] + + for i := 1; i < size; i++ { + if bs[i][0] <= end { + continue + } + res++ + end = bs[i][1] + } + + res++ + + return res +} + +// balloons 实现了 sort.Interface 接口 +type balloons [][]int + +func (b balloons) Len() int { return len(b) } + +// 以 end 的大小来排序 +func (b balloons) Less(i, j int) bool { return b[i][1] < b[j][1] } + +func (b balloons) Swap(i, j int) { b[i], b[j] = b[j], b[i] } diff --git a/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons_test.go b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons_test.go new file mode 100755 index 000000000..8052ea95f --- /dev/null +++ b/Algorithms/0452.minimum-number-of-arrows-to-burst-balloons/minimum-number-of-arrows-to-burst-balloons_test.go @@ -0,0 +1,44 @@ +package problem0452 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans int +}{ + + { + [][]int{}, + 0, + }, + + { + [][]int{{10, 16}, {2, 8}, {1, 6}, {7, 12}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_findMinArrowShots(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMinArrowShots(tc.points), "输入:%v", tc) + } +} + +func Benchmark_findMinArrowShots(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMinArrowShots(tc.points) + } + } +} diff --git a/Algorithms/0453.minimum-moves-to-equal-array-elements/README.md b/Algorithms/0453.minimum-moves-to-equal-array-elements/README.md new file mode 100755 index 000000000..0c3b823f9 --- /dev/null +++ b/Algorithms/0453.minimum-moves-to-equal-array-elements/README.md @@ -0,0 +1,42 @@ +# [453. Minimum Moves to Equal Array Elements](https://leetcode.com/problems/minimum-moves-to-equal-array-elements/) + +## 题目 + +Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1. + +Example: + +```text +Input: +[1,2,3] + +Output: +3 + +Explanation: +Only three moves are needed (remember each move increments two elements): + +[1,2,3] => [2,3,3] => [3,4,3] => [4,4,4] +``` + +## 解题思路 + +n = len(nums) + +经过 m 次移动后,每个数字都是 x,可得 + +```text +sum + m * (n - 1) = x * n +``` + +实际上,每次移动都会往最小的数字 min 上加一,所以 + +```text +x = min + m +``` + +通过以上两个等式,可得 + +```text +m = sum - min * n +``` \ No newline at end of file diff --git a/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements.go b/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements.go new file mode 100755 index 000000000..691f50c1f --- /dev/null +++ b/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements.go @@ -0,0 +1,13 @@ +package problem0453 + +func minMoves(nums []int) int { + sum, min := 0, nums[0] + for _, n := range nums { + sum += n + if min > n { + min = n + } + } + + return sum - min*len(nums) +} diff --git a/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements_test.go b/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements_test.go new file mode 100755 index 000000000..6daf3e181 --- /dev/null +++ b/Algorithms/0453.minimum-moves-to-equal-array-elements/minimum-moves-to-equal-array-elements_test.go @@ -0,0 +1,49 @@ +package problem0453 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 2, 3, 4}, + 6, + }, + + { + []int{10, 0, 0, 0}, + 10, + }, + + { + []int{1, 2, 3}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_minMoves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minMoves(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_minMoves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minMoves(tc.nums) + } + } +} diff --git a/Algorithms/0454.4sum-ii/454.100 b/Algorithms/0454.4sum-ii/454.100 new file mode 100644 index 000000000..6da49d9d4 Binary files /dev/null and b/Algorithms/0454.4sum-ii/454.100 differ diff --git a/Algorithms/0454.4sum-ii/4sum-ii.go b/Algorithms/0454.4sum-ii/4sum-ii.go new file mode 100755 index 000000000..ca1c607b4 --- /dev/null +++ b/Algorithms/0454.4sum-ii/4sum-ii.go @@ -0,0 +1,20 @@ +package problem0454 + +func fourSumCount(A []int, B []int, C []int, D []int) int { + res := 0 + n := len(A) + sum := make(map[int]int, n*n) + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + sum[C[i]+D[j]]++ + } + } + + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + res += sum[-(A[i] + B[j])] + } + } + + return res +} diff --git a/Algorithms/0454.4sum-ii/4sum-ii_test.go b/Algorithms/0454.4sum-ii/4sum-ii_test.go new file mode 100755 index 000000000..5ff37f656 --- /dev/null +++ b/Algorithms/0454.4sum-ii/4sum-ii_test.go @@ -0,0 +1,61 @@ +package problem0454 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + C []int + D []int + ans int +}{ + + { + []int{-71978474, -28407390, 6487156, -5835667, -11819338, 10343068, 10768673, -245171709, 19738959, -46339242, 181229419, -176760610, -10337980, -207358751, -185412148, 102500358, 107833574, 250545333, -58873985, 106821619, 268124880, 55520158, 256155403, 200249464, 256954749, -41670481, -172102420, -161776521, 176941695, -53603760, -67111857, -27713855, -55333948, -215813542, -107067147, 98930659, 253393156, -196098380, -33056959, 174630496, -29395310, 105695498, -222391169, -139701651, -123000784, 38165534, -98009887, 82676096, -209663935, 91254707, 243440023, 96495216, -186156509, 192203188, 217929656, 222248651, 162150902, 95296092, 182504655, 964973, 223447285, 16336100, -202534131, 198076772, -218094374, 43698098, 176419657, -148324200, -143785502, -157834380, 265043122, 122589079, -184038991, -162395984, -246936037, -77713118, 241047628, 215897753, 112046993, -134358912, -195563478, 210843289, 205546356, 258601177, 214037482, -88343952, -252950129, 56615227, -206466635, 121363993, -234468310, 125536942, -76584060, 16648767, -81242925, -119529825, 70623988, -61229934, 129414837, -5096734, -40036154, 99473856, -81540983, 227618848, -63177608, -153233801, -254525992, -108570246, -218677661, 77101181, -10142928, -23455146, 100846160, -173243052, 195294601, 179435745, -106211022, -256863196, 185126002, 100063761, -211947235, 198846854, -224442102, 214832407, -235152963, -114218832, -225653215, 203844095, -28374131, -131535960, 207302351, 198551632, 12362543, -42252426, -5110144, -1789655, 203227705, 185485671, 104327543, 93708391, 101223013, -51029034, -207913967, -250224501, -228013159, -219084267, -192101482, -178470730, 84930559, -15283080, -166920501, 92936679, 80915963, -132773370, -133859950, -36263212, 267807924, 73630132, 15867083, -83446998, -87419351, -202169796, 249183800, -65641424, 221675154, -175181347, 149568254, 179970382, 8015104, -241178848, 49545775, 136594625, -93384496, -38634998, -208655366, -135319651, 50195804, 228747965, -83675970, -96147725, 50665760, -153907495, -200217502, 16274063, -79716485, 190120424, 108481017, -239673713, 231901658, -245547888, 188374954, -189583147, -161627305, 245629491, 84335290, 65342172, -138397675, 160380509, -139787131, -158188197, 153383613, -220425884, 265449800, 235879513, 227390973, -180258075, -157783358, 200421237, 5682905, 155361188, 139927984, -249721376, 81964010, 182928983, 73667135, 236833082, -7416994, 42913702, -84934068, 135699857, -171589203, -24517849, -153423339, 190200187, 35125846, 267263376, 7607854, -114818353, -143022046, 179542204, 55480768, 139176926, 4631172, 113365477, -159102158, -118792670, 86128035, 167355185, -188646772, -134765529, 217231322, 115685324, 117085598, 75612768, -189686865, -148646852, -122676312, -168795673, -188332159, -54052978, -204498215, -183024514, 233929464, -29242844, -30931217, 215016680, 208749496, -222588396, 173035066, -111620399, -251216657, 156383227, 120258522, 45251368, 184645641, 61014150, -18884643, 251838243, -216782609, 234246156, -114830713, 28272783, -70332034, 98318871, -41710077, 88812694, -7789083, 61765530, -36942919, 193942083, -119950274, -55040628, 101532610, -29739951, 105619704, 11194244, 262307985, 239168852, -29135197, -67190368, -107324830, 10327279, 183279704, 118119599, -204831134, 89274172, -13070967, 93154980, -140484935, 221452698, -177427697, 255348621, 12414766, 74289242, -143266337, 50477067, -263039481, 20530117, -178891218, -118880010, 11322215, 158847538, 176069352, 31547720, 164037790, -89074299, -197851703, -220012320, 131375916, 90414199, 36534830, 158741256, 98382412, -160839664, 4229156, 136064408, 33815093, 48992247, -35601728, -80793679, -166798858, -116719762, 217032017, -196304518, 48472, -190969983, 86320098, -135207520, 101506102, -951898, 94677427, 204431686, 111374413, 25984981, -173631664, 38809665, 147513898, 197698679, -60025105, 6839710, 209521930, 180150863, -95373339, 103651204, 235365610, 158822217, 48959157, -70488557, -222864214, 149263390, -17611706, -112935290, 55407761, -120478586, -20814580, -105294046, 245777863, 122519018, -75137248, 125259002, -4727500, -48612560, -40872923, -57918776, 137751972, 31668941, -53277529, -5992164, 12164456, 191655983, 109329293, 214082292, 69402972, -126962488, 88665691, -224411577, 106563677, -56350640, -224368618, -97218676, -5075836, 5479942, 97924441, -137524642, -236052868, -7425213, -258058308, -139479528, -54233917, 148657069, 226304313, 198846866, -51420353, -209286358, -244166187, -15174806, 158879379, 32219592, -70958555, -188643686, -21796585, -11255939, 211190902, -166480907, -71303129, -77842441, -252170083, -54623637, -152463366, 237990638, 142622889, -131257085, 34628835, -210654417, -251871806, 187775081, 185944120, 220538189, -175287939, 103168192, 56470314, -142901453, -172686551, -75780769, -15583119, 212971291, -19186971, -141006980, -109128195, -167889285, 55823372, 263092680, 127279051, 243913001, 21920020, 210028266, 239101125, 57884442, -72707532, -7185886, 75958947, 72074049, 49647288, -53465877, -4099345, 180748212, 16745602, -25658487, 234928676, -192758764, -226603250, 16426570, -109741689, 138282536, 180669336, -227834299, 81387163, -85728455, 266691672, 102161048, 32459504, -156181377, -196224757, 46743100, -173383827, 69940363, 157293941, 93796662, -131557188, 182464799, 207279738, -52250959, 170970028, -204517521, 153368453, 19096102, 154853650, -252096392, -9453068, 145651704, -121374777, 31516469, -245369030, -15984516, 112390793, 125003184, 127939456, 106765930, -198822613, -153099924}, + []int{-30451425, -70958332, 210992111, 205315439, -40697451, 249064743, 136919380, 141811620, 217809708, 84862193, 124181888, 190073003, 217255261, -146099934, -98347381, -188970320, -189520835, -196693669, -127181028, -37092694, 23240047, 165035085, -234215571, -68334211, -154429032, -97395972, -33804361, -133637989, 211888049, -30348379, 147378248, -35110616, -66967243, -63716249, 235688198, 194876519, 8766406, -101004212, -119560841, 161953247, 235889818, -69837369, 120219758, 54359594, -230930108, -94345364, -176514522, -177207433, -239072452, -175277854, -257945724, 42134263, 139262048, 192910401, -251072472, -93121657, 14338273, -135463675, 22787668, 202112183, 85360562, -233308782, -141664407, 123027502, -167152407, 237952051, -245273877, 200776728, 28170793, -7854067, 250290131, 56039764, 35303236, 3451395, -171190144, 126658080, 216820051, 195727076, 218034224, -54821190, -181431716, 67427047, 200230427, 184601460, 263219567, -197804478, 29571019, -178614705, -253928825, -32169910, 69544559, -130814412, -251036718, 53157593, 149486805, 9340434, -108565593, 1418302, 57992949, -111315079, -176909156, 104420276, 45614511, 59331062, 132365569, 232949255, 175578196, -115767402, 246317266, 71725944, 223166677, 50970983, -162127345, 121084648, 115236452, -257622251, 146066129, -15280743, -144450156, 79843044, -256194873, -124418950, 61773304, -49031784, -253396422, -188153248, 50462170, 47677294, -148742635, 183124152, -210159290, 73276704, 124806669, 180494883, 199918344, 255045227, -96500088, -31180300, -107195086, -49398457, 261665424, -193237237, -24904944, 235561863, 212219644, -102096038, 263189676, 218079117, 264914873, 52993357, -187302189, -219945042, -225212214, -191236848, 241668903, -202710145, 105387298, -210371115, -235813098, -76906406, -91699487, -10050149, 158820510, -43333539, 25338076, 11192914, 36701770, -67163999, -182841306, 249047762, 13571745, -102886503, 175667591, -10773602, 165132507, -79257461, 56544, 40631171, -217091370, 133876298, -151275187, 101049112, 28233468, 93705613, -135040534, -233525880, 209310642, -194008823, -266236147, 66000076, 52044668, -152794016, 254167487, -162250538, 191278397, 102915355, 110651913, 257060775, -75325508, 226370899, 169296998, 81292377, 2557680, 57415693, 120811175, -92167563, -69263413, -217921181, -215555766, 164576085, -224390071, 197131082, 181646324, 248077551, -244041961, -231521812, -125937358, -91931721, 250021613, -88867984, 46634085, -180213094, 192226644, 57629116, 5065104, 120608203, 197253481, -159497563, 146974152, 19544027, 19292064, 133328694, -148468341, 113802884, 186273091, -154393012, -203041589, -48038925, -125003749, 49115370, -256703681, -164229110, -197537865, -211431360, 167988568, -131687295, 158096089, -201591825, -26700045, -234274651, -70224787, 53182290, 75679069, 148310273, -241645636, -241250566, 365430, 63381941, -70658955, -21247397, -114924681, 115306674, -113340140, -13254917, -33707798, -146361368, -15873105, 55831951, 110534116, -134644064, -255146142, -206519430, 101723373, 146586720, -204084621, 227813322, 67977916, -66046128, -180855702, 255120451, -194480400, -233164602, 193669200, -246812697, 20116150, -1421651, -109827628, -224149912, 140676465, 122599270, -154274125, 41675729, 164587592, -32772115, 11020721, 246003484, 136208186, -120762214, -176174343, -154389843, 17824726, -55259089, -185523922, -50324009, 133355345, 70137398, -165607040, 19583668, 31327086, -126844213, -188561381, 252147803, -38619528, 114497569, -99196393, -12644807, 207539172, 248233133, 221445456, 22990223, 66186562, 212899743, -232437359, 106746400, -229228106, 131868633, 178240275, 148198410, 102974520, -32194377, -11295581, -211101505, -8317382, -21317664, -201220231, -129751454, -28852740, 70921956, 97587813, -264635837, 107165299, 28601534, 57314207, 257900815, 61080815, -10054077, 78384672, -170413569, 38894877, 246827167, -147575253, 202463359, 74429581, -146820842, -106734676, 136182356, -68033918, -112531275, 66306445, 117298766, -39829863, -24992654, 243343844, 209715486, -198146058, -172138761, -181717201, 209315469, -245633438, 116838408, -219094956, 49475010, -240872751, 97033580, 226123610, 255048115, 157533443, -102483971, 6434696, 32208271, -169591865, -59173976, -119688864, 57042718, 44909198, 187893548, 53853134, -233243389, 148381709, 154793157, 201666422, -248683684, 142947651, 185474272, 76318393, 224198501, -6973945, 158841981, -6681155, 7318011, -161135137, -12995329, -167416609, 266104273, 118717328, -32268271, 22037913, 123282950, 65960040, 53580139, 63571186, 41710206, -268425574, 54509459, -117809970, 53536329, -168306954, -5725650, 54225688, 91869843, -185888817, -95209429, -260979469, -262221754, 249407018, 144025279, -232720568, -13765995, 117553741, -145074483, -247635080, -264222388, -162640717, -239131606, -262100058, 110799953, -17794563, 168946223, -82146032, 40517936, -47440652, 38638915, 64223762, 167890580, 48329207, 252787568, -198528041, -5487646, -31395708, 225031422, 126427701, -166826170, -135199429, 212159976, -217062047, 33293856, 199564451, 37566001, 106753211, 66518914, 159050413, 11833256, 15246463, 197865196, 167954014, -245541241, -159678290, 25538325, 116468048, 144570090, 171328698, -137520520, 199346673, 23540399, -85340050, -223242047, 223727765, 225686457, 218723093, 231048021, -50284858, 237644762, -190776495, -135093982, 64484007, -48799159, -154532055, 136850661, -10280042, 148645472, -61103802, -68335508, 224037836, 4909000, -43173144, -112751199, 124662709, -117688301, -201806416, -654482}, + []int{221669372, -198001620, 15244180, -85651914, 187512073, 183505647, -240495316, 33170893, 131048656, -184341503, -110422027, -116580036, 83528072, -44275735, -245936274, -190744927, -174915154, 139891567, -211574228, 233659572, 131414598, 124377872, -245383956, -196554724, 212256846, 157139407, -232406115, -50504444, 84387077, 256372616, -204508328, 235560486, 163405342, -219350391, -151874466, -221399919, -90022570, -63892624, -80441153, 143952693, 22150513, -17877846, 208084922, 209533876, 199282852, 28946431, 46895507, -109841246, 208817335, 254839546, -54788427, 138210737, -94182109, -160046898, -243841335, 97943949, 106437630, 32443000, -32273081, -115665080, -257611236, -89503963, 6858125, -91171476, -157980323, -106139384, -150994306, 175237808, 164280223, -127483402, 173787699, -94584308, -116134557, -210457779, -33000660, -109983682, 136658341, 89750297, -165637581, 104488287, -159182529, 47355696, -104681840, -148765655, 12703836, 210946062, 226838746, -11560240, 153753586, 30612560, -171344239, 158232960, -35044863, -10186681, 232338329, 75475309, 37740825, 11228185, 214982269, -32284475, -225050622, 62137910, 54306519, -161991699, 168994569, -36866088, 203279711, -172862596, 80903027, -233280519, 12026443, 11422825, -189187142, 82263523, -238573131, 176583387, -51488018, -51450707, -233094742, 123672453, -173518850, 233686254, -155274811, -251303749, -892420, 179534093, -17944084, -202090547, -133644271, -93833713, -100693677, -20694153, 105044126, 157421899, 36866654, -85670870, 254210531, -176743174, 27316992, -26703029, 207534002, -160884471, -13122417, 168156929, 78313276, 136625629, 52372217, -210148564, 166615958, -181785163, -159870059, 263188892, -67992616, -247149664, 225105347, -74322183, -210625022, 247857120, 221045263, -154900286, -125185375, 85880297, -239919076, 212790757, 185113358, 201667436, 165765082, 34275491, -256567158, 25243601, 215621158, -232884132, 86394229, -64531264, -182723134, -153400015, -264382050, -141629726, -146900939, -185884301, 193251325, -151956563, 85202519, -16068920, 181089617, 62436083, 60440272, -165243795, 222533663, 209114403, 89720897, 175728941, 13779904, -244786127, 138586888, -196924214, -45259073, 127306014, 80717567, 50166089, -61470373, -45450175, -44729827, -184000601, 161923069, -80593594, -182980300, -13590319, -229206348, 184479234, -143779158, 144100230, 1342408, 238446627, -5145335, 253577528, 81101868, 247252369, -205768945, 179094444, 160203477, 35038008, -152252784, 115112023, -165190199, -267002764, -199232771, -30241881, 140042559, 215754142, 46294663, -197513772, 125471385, -115638628, -83744931, -116240781, 267370000, -128321304, -43871568, 220144787, 216528954, 445123, -253232621, -125566344, -185812074, -21764766, 92534859, -40262974, 246756537, -227431258, 193661963, 90992628, 45820279, 260152393, -250828276, -83148257, -3005878, 138655731, -16558697, -65468202, -83527016, 255379775, 146977521, 245276519, 160537713, -120477764, -207457664, 149740721, 41457501, 165774690, -24084874, -124643368, -19332118, 48580230, 108236652, 117992657, -173991930, 58087819, -168723250, 240285917, -86244832, -256846973, -63475278, -76112833, 124776283, -23844807, -116555825, -10406229, 229770025, -172837101, 147646415, -237943558, 150034578, 202842918, 104677142, -158558140, -255552348, 146165742, -140218784, -233012494, 239990650, -21022269, -78922249, 44866796, 115575522, 155307217, -116537894, -18560995, -195957344, -203714106, -247328094, -12154432, 118994200, -204323063, 124462593, 123732606, 231537108, -50939482, -5227291, 19074077, -86032517, -204182772, 160510162, 99175573, 111604151, -112292900, -184524068, -138326884, -37792063, -132864024, 91333570, 219790087, 36935079, 209785739, -263045323, 223825784, 118649884, 185006767, 82113430, 159733379, 165769118, 238143375, -227919079, 244573309, -13652678, -149367440, -135162752, -131148257, -174611766, -179563101, -243916504, 236388979, -28313506, -190638280, 51249159, 172647597, 228345519, 7708245, -191595229, 237371355, -182414099, 136120002, 135033083, 17929913, -47018671, -104742732, 252703376, 263987708, 10363790, -198035899, -112274788, -156194191, 210773650, 15924424, -11332211, 201291167, -127798303, 200110171, 47667091, -116679265, -251051562, 245418091, 87243182, 243365228, -100823208, 232974260, 1492806, -61781783, -107623787, -8062336, 51148075, 262607595, 186735124, 103880595, -62679594, 242596408, 45020163, -140377462, -215808343, -107791913, 82616657, -265927240, -254875266, -4314957, -154747839, 203820486, -197128691, 137943698, 200925393, 265318871, 267580496, -267050038, 50792788, -126766506, -47675391, 22792125, -39284840, -92203735, -85996567, 102243375, -22442292, 165867206, -121069865, -87037879, 14018735, -212794937, -7724372, -63636460, -35676956, -63072566, 212517102, -219844562, -242573336, 70319461, -146081225, 58120660, 233338033, 138831839, 112550296, 207235860, 231654548, -173064259, -186475501, -68652286, 14473444, 243139933, 68551319, -10921957, 178351987, 88132890, -250924296, 135194388, -37560504, 242450499, 252410035, 138116604, -36066615, 147455700, -168152674, -129998708, 43352483, 83655691, 19737357, -123458139, -163176150, 124742912, 238247489, 130077719, 235670866, -213295050, 96486380, -41571261, 257355669, 265070603, 85013326, -151952866, 123096459, -226757040, 17553415, 67495052, -102603546, -178808789, -245714555, -240487063, -169017755, -108206082, 228001852, 110848884, -39844662, -39766857, 39152151, -203957629, 150476211, 266783243, -139428382, 200605399, -58436094, -14310842, -203232885, -130405719}, + []int{-17546607, 214071333, -93657289, -165621387, -11839282, 198176602, -64912029, -192474743, -2493976, 99990929, 167486438, -106329152, 184859425, -264773630, 169472755, 41413055, -251096373, -80110364, 30069861, 75320581, 185695928, 195317818, -115725122, -7487907, -158784107, -196023923, -66900235, 161414843, -25937463, 145835332, -202898499, 259829266, -74026668, -157319850, 149881225, 43799905, -123466453, 147330916, -152436728, 221835577, -248543497, 20714983, -12614768, 239832417, -110657465, 43561912, 165071752, -7463783, 78065931, 155976364, 213922644, -217800666, 117615362, 24707363, -185565434, -2496567, 234450588, 210298310, 4529768, -113829319, 147184434, 19829806, -65480417, -223367800, -236359076, 163678294, 125913316, -188623095, 59555496, -111797935, 58175523, -259346726, -33248128, -229144880, -160843897, 27494232, -104453818, 89063257, 249059089, 69323436, 247770901, 1155380, -148019049, -160968762, -52326738, 82325533, -150756244, -104804188, -46356628, 94794403, -261182860, -10420423, 233904773, -80564795, -217303247, 248709484, -217368590, 203569371, 266588872, -160038154, 174084116, -63090368, 130359158, 249120753, 211923649, 64898419, -16491279, -89473178, -179116762, -148644676, -123831028, -78479822, -117028195, -205007240, 147474634, -124632210, 122766610, -31483259, 177986551, 212416299, -173880456, -26259615, 65689126, 262056512, -201886928, -114707242, 177214697, 183136502, 169681484, 89300445, 52105394, -12498419, 127903356, -6374306, 36194910, 255462688, 109178711, 155722896, 74164781, 19458415, 43518348, 29768689, 198946521, 140845308, -265036965, -165240223, -3153151, 151242831, 41276761, -237471486, 37519318, 107074694, -215030646, -3464147, -58802258, 99020863, 213032313, 31235751, -218555771, -37863554, 231126167, -89091450, 17873457, -22810759, 152036250, -258089843, -249909549, -105830340, -121030135, 56984466, 229745302, -43266151, 16449460, 84946278, 78838144, 47264065, -522967, -221520615, -66270632, -253257746, 124993931, 71698073, -179800345, -9879068, -181841274, -216733333, -83486022, 39389160, 92493349, 172404528, 5487456, -196500341, 25118152, -63318215, -71012827, -191687271, 258789989, -47316455, -213910836, -183284934, 96759535, -19262915, -52873957, 106041491, -224910509, -26592332, -152873756, -28605706, 108877934, 42922751, 38500181, 56118455, -242432922, -261959354, -11426682, 132493451, -258308301, -241520608, -235879247, -258549261, 160320330, 204144168, -229333790, -230664067, -254209559, 245681349, -179049065, 261790654, -193316272, 72210889, -229236212, 74540895, 221674964, -40018913, -32341342, -69965461, 123731637, 233836230, 119726263, 246933358, -94021658, -52097607, -10406239, 125734260, -115737123, 5941163, 139255932, -145105600, -193829821, 167740251, -108769677, -42292263, 131405275, -94488790, -182243652, -219764992, 206682974, 43057961, -251186524, -24177736, 30807576, 123925822, -977312, -161625270, 163423897, -118946809, 19676996, 16864825, -247513003, -263782933, 91126968, -197930072, -244550529, -2232143, -231713709, -230791141, -76840135, 22234414, 116549448, 40267838, 166826417, -162653607, 168746048, 146221577, 216339796, -57845269, 13985766, 174960381, 244713552, 132250866, 194165912, 56375268, -192391098, 217736317, -23138312, -40837897, 148109686, -81886357, -213245628, 161819698, 174481764, 200320434, 160713218, 28837628, -36336967, 117182586, -248569392, 253775604, 221105316, 213851844, -150058155, 214073046, 7350551, -120571007, -80617979, -189898994, 51227111, -13466954, 114952286, 132672517, -179105217, 70138185, 88385738, 114926708, -85116697, -95296319, -168266889, 195999185, -84003749, -249418120, -235726658, -207886816, -11693793, 105923530, -90358551, 205189091, 181805713, -5135867, 69330620, -94613491, 10345172, 177136406, 223881958, 205791751, -97769871, -236909138, -1162165, -37959289, 236831358, 135801885, 45942224, 159536698, 160991221, -196495165, -112683826, 234114694, 246786698, -32832684, 85453732, 237587729, 210417625, 97701187, -171891608, -33268255, -71278052, 33950735, 113434539, -163579667, 16482549, 139208106, -133924314, -174985148, 147699372, 242136973, -51223728, 99706118, -249667889, -119022096, 191440014, -124643812, -65369045, -243195741, 101199849, -215324961, -5495160, -102313901, 106679578, 67972208, 150048782, 192562611, -23641643, -196714110, -59965162, -51256959, 145536405, -19500260, 124767517, 95632286, 79251420, -224446048, 85667827, -201627018, 30475498, -260024174, 165039410, -188173717, 161585950, 113560906, -60572913, 54902978, 135580726, -166465510, 147514020, 122455481, 221939011, 49788676, -161920213, -198705087, 56824728, 53677114, -21824892, 211734581, 150254300, 22269437, 15062651, 15872581, 50474197, -103200689, -211868690, 229323751, 134820280, 45454789, -151927405, 224375201, -53443176, -249438829, 49785112, 34597275, 21695084, -103764484, -87614995, -26960575, 92718417, 203227761, 191816676, 57188734, -94058815, 232706170, 230018388, 36657423, 35382336, 233232562, 226830557, 197380490, -51987969, 92219691, -47334803, 131019592, -200679779, -93026917, -265656762, 1901277, -266155336, -43263344, 192736280, 239702174, 228229959, -231427435, 227698144, 145615607, -184131263, -266440106, 149770275, -249784065, 252301281, -174830881, 226987272, 162903342, 239228597, 112318589, -245478676, 121457133, -102744522, 21392804, 80376678, -231685657, 180250745, -264247701, -123596852, -215638565, -252775380, -233211704, -48529937, -120976856, 195556696, 118389478, -6534319, -18057851, 241975837, -187149680}, + 80, + }, + + { + []int{-1, -1}, + []int{-1, 1}, + []int{-1, 1}, + []int{-1, 1}, + 6, + }, + + { + []int{1, 2}, + []int{-2, -1}, + []int{-1, 2}, + []int{0, 2}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_fourSumCount(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fourSumCount(tc.A, tc.B, tc.C, tc.D), "输入:%v", tc) + } +} + +func Benchmark_fourSumCount(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fourSumCount(tc.A, tc.B, tc.C, tc.D) + } + } +} diff --git a/Algorithms/0454.4sum-ii/README.md b/Algorithms/0454.4sum-ii/README.md new file mode 100755 index 000000000..c611099b5 --- /dev/null +++ b/Algorithms/0454.4sum-ii/README.md @@ -0,0 +1,31 @@ +# [454. 4Sum II](https://leetcode.com/problems/4sum-ii/) + +## 题目 + +Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. + +To make problem a bit easier, all A, B, C, D have same length of N where 0 ≤ N ≤ 500. All integers are in the range of -228 to 228 - 1 and the result is guaranteed to be at most 231 - 1. + +Example: + +```text +Input: +A = [ 1, 2] +B = [-2,-1] +C = [-1, 2] +D = [ 0, 2] + +Output: +2 + +Explanation: +The two tuples are: +1. (0, 0, 0, 1) -> A[0] + B[0] + C[0] + D[1] = 1 + (-2) + (-1) + 2 = 0 +2. (1, 1, 0, 0) -> A[1] + B[1] + C[0] + D[0] = 2 + (-1) + (-1) + 0 = 0 +``` + +## 解题思路 + +见程序注释 + +![100](454.100.png) \ No newline at end of file diff --git a/Algorithms/0455.assign-cookies/README.md b/Algorithms/0455.assign-cookies/README.md new file mode 100755 index 000000000..5f2a08fde --- /dev/null +++ b/Algorithms/0455.assign-cookies/README.md @@ -0,0 +1,38 @@ +# [455. Assign Cookies](https://leetcode.com/problems/assign-cookies/) + +## 题目 + +Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a cookie that the child will be content with; and each cookie j has a size sj. If sj >= gi, we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number. + +Note: + +1. You may assume the greed factor is always positive. +1. You cannot assign more than one cookie to one child. + +Example 1: + +```text +Input: [1,2,3], [1,1] + +Output: 1 + +Explanation: You have 3 children and 2 cookies. The greed factors of 3 children are 1, 2, 3. +And even though you have 2 cookies, since their size is both 1, you could only make the child whose greed factor is 1 content. +You need to output 1. +``` + +Example 2: + +```text +Input: [1,2], [1,2,3] + +Output: 2 + +Explanation: You have 2 children and 3 cookies. The greed factors of 2 children are 1, 2. +You have 3 cookies and their sizes are big enough to gratify all of the children, +You need to output 2. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0455.assign-cookies/assign-cookies.go b/Algorithms/0455.assign-cookies/assign-cookies.go new file mode 100755 index 000000000..01520229d --- /dev/null +++ b/Algorithms/0455.assign-cookies/assign-cookies.go @@ -0,0 +1,21 @@ +package problem0455 + +import ( + "sort" +) + +func findContentChildren(g []int, s []int) int { + sort.Ints(g) + sort.Ints(s) + + var i, j, res int + for i < len(g) && j < len(s) { + if g[i] <= s[j] { + res++ + i++ + } + j++ + } + + return res +} diff --git a/Algorithms/0455.assign-cookies/assign-cookies_test.go b/Algorithms/0455.assign-cookies/assign-cookies_test.go new file mode 100755 index 000000000..515c39616 --- /dev/null +++ b/Algorithms/0455.assign-cookies/assign-cookies_test.go @@ -0,0 +1,53 @@ +package problem0455 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + g []int + s []int + ans int +}{ + + { + []int{1, 2, 3}, + []int{3}, + 1, + }, + + { + []int{1, 2, 3}, + []int{1, 1}, + 1, + }, + + { + []int{1, 2}, + []int{1, 2, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_findContentChildren(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findContentChildren(tc.g, tc.s), "输入:%v", tc) + } +} + +func Benchmark_findContentChildren(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findContentChildren(tc.g, tc.s) + } + } +} diff --git a/Algorithms/0456.132-pattern/132-pattern.go b/Algorithms/0456.132-pattern/132-pattern.go new file mode 100755 index 000000000..d7ebf08c5 --- /dev/null +++ b/Algorithms/0456.132-pattern/132-pattern.go @@ -0,0 +1,35 @@ +package problem0456 + +func find132pattern(a []int) bool { + // 题目要求找到 i < j < k + // 使得 ai < ak < aj + ak := -1 << 31 + // ajStack 存放了所有符合 ai < ak < aj 的 aj + ajStack := make([]int, 0, len(a)) + + for i := len(a) - 1; 0 <= i; i-- { + + if a[i] < ak { + // 找到了题目要求的 ai < aj < ak + return true + } + + // ajStack 中的数字的 index 都比 i 大 + // 从 ajStack 中挑选一个仅次于 a[i] 的数字作为新的 ak + // 然后,把 a[i] 当做下一轮 for 的 aj 放入 ajStack + for len(ajStack) > 0 && + ajStack[len(ajStack)-1] < a[i] { + ak = ajStack[len(ajStack)-1] + ajStack = ajStack[:len(ajStack)-1] + + // 根据 stack 的进出栈规则 + // ajStack 中的 ax 及其 ax 在 a 中的索引号 x,都是递减的 + // 理解这一点很关键 + // 始终维持了 ak < ax ∈ ajStack 且 ak 尽可能地大 这样的关系 + } + + ajStack = append(ajStack, a[i]) + } + + return false +} diff --git a/Algorithms/0456.132-pattern/132-pattern_test.go b/Algorithms/0456.132-pattern/132-pattern_test.go new file mode 100755 index 000000000..90637bbde --- /dev/null +++ b/Algorithms/0456.132-pattern/132-pattern_test.go @@ -0,0 +1,74 @@ +package problem0456 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{9, 8, 7, 6, 5, 4, 3, 2, 1}, + false, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, + false, + }, + + { + []int{9, 11, 8, 9, 10, 7, 9}, + true, + }, + + { + []int{1, 0, 1, -4, -3}, + false, + }, + + { + []int{3, 4}, + false, + }, + + { + []int{1, 2, 3, 4}, + false, + }, + + { + []int{3, 1, 4, 2}, + true, + }, + + { + []int{-1, 3, 2, 0}, + true, + }, + + // 可以有多个 testcase +} + +func Test_find132pattern(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, find132pattern(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_find132pattern(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + find132pattern(tc.nums) + } + } +} diff --git a/Algorithms/0456.132-pattern/README.md b/Algorithms/0456.132-pattern/README.md new file mode 100755 index 000000000..b5c05be7c --- /dev/null +++ b/Algorithms/0456.132-pattern/README.md @@ -0,0 +1,42 @@ +# [456. 132 Pattern](https://leetcode.com/problems/132-pattern/) + +## 题目 + +Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such +that i < j < k and ai < ak < aj. Design an algorithm that takes a list of n numbers as input and checks whether there is a 132 pattern in the list. + +Note: n will be less than 15,000. + +Example 1: + +```text +Input: [1, 2, 3, 4] + +Output: False + +Explanation: There is no 132 pattern in the sequence. +``` + +Example 2: + +```text +Input: [3, 1, 4, 2] + +Output: True + +Explanation: There is a 132 pattern in the sequence: [1, 4, 2]. +``` + +Example 3: + +```text +Input: [-1, 3, 2, 0] + +Output: True + +Explanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0]. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0457.circular-array-loop/README.md b/Algorithms/0457.circular-array-loop/README.md new file mode 100755 index 000000000..83b64635f --- /dev/null +++ b/Algorithms/0457.circular-array-loop/README.md @@ -0,0 +1,17 @@ +# [457. Circular Array Loop](https://leetcode.com/problems/circular-array-loop/) + +## 题目 + +You are given an array of positive and negative integers. If a number n at an index is positive, then move forward n steps. Conversely, if it's negative (-n), move backward n steps. Assume the first element of the array is forward next to the last element, and the last element is backward next to the first element. Determine if there is a loop in this array. A loop starts and ends at a particular index with more than 1 element along the loop. The loop must be "forward" or "backward'. + +Example 1: Given the array [2, -1, 1, 2, 2], there is a loop, from index 0 -> 2 -> 3 -> 0. + +Example 2: Given the array [-1, 2], there is no loop. + +Note: The given array is guaranteed to contain no element "0". + +Can you do it in O(n) time complexity and O(1) space complexity? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0457.circular-array-loop/circular-array-loop.go b/Algorithms/0457.circular-array-loop/circular-array-loop.go new file mode 100644 index 000000000..590264048 --- /dev/null +++ b/Algorithms/0457.circular-array-loop/circular-array-loop.go @@ -0,0 +1,49 @@ +package problem0457 + +import ( + "unsafe" +) + +func circularArrayLoop(nums []int) bool { + size := len(nums) + + // 缩小 nums[i] 的范围 + for i := 0; i < size; i++ { + nums[i] %= size + } + + // 获取 int 型变量的位数 - 1 + bits := uint(unsafe.Sizeof(size) - 1) + + for i, n := range nums { + // 用于标记 nums[i] + // 每个外层 for 循环的 mark 必须不一样,才能检查此次路径是否闭合 + // mark 还需要与 n 同符号 + mark := (i + size) * (n>>bits | 1) + + // 每次内层 for 循环只需要检查未检查过的节点即可。 + // 他们的特点是 -size < n && n != 0 && n < size + for -size < n && n < size && n != 0 { + // nums[i] 通过了 for 的检查条件 + // 现在标记 i 节点 + nums[i] = mark + + // 跳转到下一个节点 + // 更新 i 和 n + i = (n + i + size) % size + n = nums[i] + + if n == mark { + // 发现闭环 + return true + } + + if n*mark < 0 { + // 出现转向 + break + } + } + } + + return false +} diff --git a/Algorithms/0457.circular-array-loop/circular-array-loop_test.go b/Algorithms/0457.circular-array-loop/circular-array-loop_test.go new file mode 100644 index 000000000..785ce5ff3 --- /dev/null +++ b/Algorithms/0457.circular-array-loop/circular-array-loop_test.go @@ -0,0 +1,59 @@ +package problem0457 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{-1, 2}, + false, + }, + + { + []int{2, -1, 1, -2, -2}, + false, + }, + + { + []int{-2, 1, -1, -2, -2}, + false, + }, + + { + []int{2, -1, 1, 2, 2}, + true, + }, + + { + []int{-1, -1}, + true, + }, + + // 可以有多个 testcase +} + +func Test_find132pattern(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, circularArrayLoop(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_find132pattern(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + circularArrayLoop(tc.nums) + } + } +} diff --git a/Algorithms/0458.poor-pigs/README.md b/Algorithms/0458.poor-pigs/README.md new file mode 100755 index 000000000..ef110f8c8 --- /dev/null +++ b/Algorithms/0458.poor-pigs/README.md @@ -0,0 +1,15 @@ +# [458. Poor Pigs](https://leetcode.com/problems/poor-pigs/) + +## 题目 + +There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison it will die within 15 minutes. What is the minimum amount of pigs you need to figure out which bucket contains the poison within one hour. + +Answer this question, and write an algorithm for the follow-up general case. + +Follow-up: + +If there are n buckets and a pig drinking poison will die within m minutes, how many pigs (x) you need to figure out the "poison" bucket within p minutes? There is exact one bucket with poison. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0458.poor-pigs/poor-pigs.go b/Algorithms/0458.poor-pigs/poor-pigs.go new file mode 100755 index 000000000..97aa0aec6 --- /dev/null +++ b/Algorithms/0458.poor-pigs/poor-pigs.go @@ -0,0 +1,20 @@ +package problem0458 + +func poorPigs(buckets int, minutesToDie int, minutesToTest int) int { + // 15 分钟中毒身亡,总共 60 分钟的测试时间的话 + // 一只猪可以测试 5 组样品,从 0 分钟的时候喝一组,每过 15分钟没死就继续喝下一组 + // 猪在 60 分钟内死亡的话,就是刚刚喝的那一组有毒,没死的话,就是第 5 组有毒。 + base := minutesToTest/minutesToDie + 1 + // 然后,可以把猪的个数看成是空间的维度 + // 把 buckets 看成是多维空间中正立方体的体积 + // 正立方体的边长就是 base + power := 1 + res := 0 + + for power < buckets { + power *= base + res++ + } + + return res +} diff --git a/Algorithms/0458.poor-pigs/poor-pigs_test.go b/Algorithms/0458.poor-pigs/poor-pigs_test.go new file mode 100755 index 000000000..89a2d5bf5 --- /dev/null +++ b/Algorithms/0458.poor-pigs/poor-pigs_test.go @@ -0,0 +1,57 @@ +package problem0458 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + buckets int + minutesToDie int + minutesToTest int + ans int +}{ + + { + 1, + 1, + 1, + 0, + }, + + { + 1000, + 12, + 60, + 4, + }, + + { + 1000, + 15, + 60, + 5, + }, + + // 可以有多个 testcase +} + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, poorPigs(tc.buckets, tc.minutesToDie, tc.minutesToTest), "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + poorPigs(tc.buckets, tc.minutesToDie, tc.minutesToTest) + } + } +} diff --git a/Algorithms/0459.repeated-substring-pattern/README.md b/Algorithms/0459.repeated-substring-pattern/README.md new file mode 100755 index 000000000..5ab15b354 --- /dev/null +++ b/Algorithms/0459.repeated-substring-pattern/README.md @@ -0,0 +1,36 @@ +# [459. Repeated Substring Pattern](https://leetcode.com/problems/repeated-substring-pattern/) + +## 题目 + +Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 10000. + +Example 1: + +```text +Input: "abab" + +Output: Tru +Explanation: It's the substring "ab" twice. +``` + +Example 2: + +```text +Input: "aba" + +Output: False +``` + +Example 3: + +```text +Input: "abcabcabcabc" + +Output: True + +Explanation: It's the substring "abc" four times. (And the substring "abcabc" twice.) +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern.go b/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern.go new file mode 100755 index 000000000..496168d88 --- /dev/null +++ b/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern.go @@ -0,0 +1,17 @@ +package problem0459 + +import ( + "strings" +) + +func repeatedSubstringPattern(s string) bool { + if len(s) == 0 { + return false + } + + size := len(s) + + ss := (s + s)[1 : size*2-1] + + return strings.Contains(ss, s) +} diff --git a/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern_test.go b/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern_test.go new file mode 100755 index 000000000..2b2f8c6a8 --- /dev/null +++ b/Algorithms/0459.repeated-substring-pattern/repeated-substring-pattern_test.go @@ -0,0 +1,59 @@ +package problem0459 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans bool +}{ + + { + "bb", + true, + }, + + { + "abab", + true, + }, + + { + "", + false, + }, + + { + "aba", + false, + }, + + { + "abcabcabcabc", + true, + }, + + // 可以有多个 testcase +} + +func Test_repeatedSubstringPattern(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, repeatedSubstringPattern(tc.s), "输入:%v", tc) + } +} + +func Benchmark_repeatedSubstringPattern(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + repeatedSubstringPattern(tc.s) + } + } +} diff --git a/Algorithms/0460.lfu-cache/460.100.png b/Algorithms/0460.lfu-cache/460.100.png new file mode 100644 index 000000000..e824e6bf0 Binary files /dev/null and b/Algorithms/0460.lfu-cache/460.100.png differ diff --git a/Algorithms/0460.lfu-cache/README.md b/Algorithms/0460.lfu-cache/README.md new file mode 100755 index 000000000..e8a8e5929 --- /dev/null +++ b/Algorithms/0460.lfu-cache/README.md @@ -0,0 +1,37 @@ +# [460. LFU Cache](https://leetcode.com/problems/lfu-cache/) + +## 题目 + +Design and implement a data structure for [Least Frequently Used (LFU)](https://en.wikipedia.org/wiki/Least_frequently_used) cache. + +It should support the following operations: `get` and `put`. + +- `get(key)` - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. + +- `put(key, value)` - Set or insert the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least frequently used item before inserting a new item. For the purpose of this problem, when there is a tie (i.e., two or more keys that have the same frequency), the least recently used key would be evicted. + +Follow up: +Could you do both operations in O(1) time complexity? + +Example: + +```text +LFUCache cache = new LFUCache( 2 /* capacity */ ); + +cache.put(1, 1); +cache.put(2, 2); +cache.get(1); // returns 1 +cache.put(3, 3); // evicts key 2 +cache.get(2); // returns -1 (not found) +cache.get(3); // returns 3. +cache.put(4, 4); // evicts key 1. +cache.get(1); // returns -1 (not found) +cache.get(3); // returns 3 +cache.get(4); // returns 4 +``` + +## 解题思路 + +见程序注释 + +![100](460.100.png) \ No newline at end of file diff --git a/Algorithms/0460.lfu-cache/lfu-cache.go b/Algorithms/0460.lfu-cache/lfu-cache.go new file mode 100755 index 000000000..1af2cc336 --- /dev/null +++ b/Algorithms/0460.lfu-cache/lfu-cache.go @@ -0,0 +1,115 @@ +package problem0460 + +import "container/heap" +import "time" + +// LFUCache 实现了 Least Frequently Used (LFU) cache +type LFUCache struct { + // 用于检查 key 的存在性 + m map[int]*entry + pq PQ + cap int +} + +// Constructor 构建了 LFUCache +func Constructor(capacity int) LFUCache { + return LFUCache{ + m: make(map[int]*entry, capacity), + pq: make(PQ, 0, capacity), + cap: capacity, + } +} + +// Get 获取 key 的值 +func (c *LFUCache) Get(key int) int { + ep, ok := c.m[key] + if ok { + c.pq.update(ep) + return ep.value + } + return -1 +} + +// Put 把 key, value 成对地放入 LFUCache +// 如果 LFUCache 已满的话,会删除掉 LFUCache 中使用最少的 key +func (c *LFUCache) Put(key int, value int) { + if c.cap <= 0 { + return + } + ep, ok := c.m[key] + // key 已存在,就更新 value + if ok { + c.m[key].value = value + c.pq.update(ep) + return + } + + ep = &entry{key: key, value: value} + // pq 已满的话,需要先删除,再插入 + if len(c.pq) == c.cap { + temp := heap.Pop(&c.pq).(*entry) + delete(c.m, temp.key) + } + c.m[key] = ep + heap.Push(&c.pq, ep) +} + +/** + * Your LFUCache object will be instantiated and called as such: + * obj := Constructor(capacity); + * param_1 := obj.Get(key); + * obj.Put(key,value); + */ + +// entry 是 priorityQueue 中的元素 +type entry struct { + key, value int + // 以下是辅助参数,由 heap.Interface 实现的函数自动处理 + frequence, index int + date time.Time +} + +// PQ implements heap.Interface and holds entries. +type PQ []*entry + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + if pq[i].frequence == pq[j].frequence { + return pq[i].date.Before(pq[j].date) + } + + return pq[i].frequence < pq[j].frequence +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + n := len(*pq) + entry := x.(*entry) + entry.index = n + entry.date = time.Now() + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + old := *pq + n := len(old) + entry := old[n-1] + entry.index = -1 // for safety + *pq = old[0 : n-1] + return entry +} + +// update modifies the priority of an entry in the queue. +func (pq *PQ) update(entry *entry) { + entry.frequence++ + entry.date = time.Now() + heap.Fix(pq, entry.index) +} diff --git a/Algorithms/0460.lfu-cache/lfu-cache_test.go b/Algorithms/0460.lfu-cache/lfu-cache_test.go new file mode 100755 index 000000000..f1c75cc96 --- /dev/null +++ b/Algorithms/0460.lfu-cache/lfu-cache_test.go @@ -0,0 +1,56 @@ +package problem0460 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_LFUCache(t *testing.T) { + ast := assert.New(t) + + cache := Constructor(2) + + cache.Put(1, 1) + cache.Put(2, 2) + + ast.Equal(1, cache.Get(1)) + + cache.Put(3, 3) + + ast.Equal(-1, cache.Get(2)) + + ast.Equal(3, cache.Get(3)) + + cache.Put(4, 4) + + ast.Equal(-1, cache.Get(1)) + + ast.Equal(3, cache.Get(3)) + + ast.Equal(4, cache.Get(4)) + +} + +func Test_LFUCache2(t *testing.T) { + ast := assert.New(t) + + cache := Constructor(0) + + cache.Put(0, 0) + + ast.Equal(-1, cache.Get(0), "没能正确处理好, cap <= 0 的情况") +} + +func Test_LFUCache3(t *testing.T) { + ast := assert.New(t) + + cache := Constructor(2) + + cache.Put(3, 1) + cache.Put(2, 1) + cache.Put(2, 2) + cache.Put(4, 4) + + ast.Equal(2, cache.Get(2), "更新 2 的值后,其 frequence 没有增加") +} diff --git a/Algorithms/0461.hamming-distance/README.md b/Algorithms/0461.hamming-distance/README.md new file mode 100755 index 000000000..fc3b53cc9 --- /dev/null +++ b/Algorithms/0461.hamming-distance/README.md @@ -0,0 +1,29 @@ +# [461. Hamming Distance](https://leetcode.com/problems/hamming-distance/) + +## 题目 + +The Hamming distance between two integers is the number of positions at which the corresponding bits are different. + +Given two integers x and y, calculate the Hamming distance. + +Note: +0 ≤ x, y < 231. + +Example: + +```text +Input: x = 1, y = 4 + +Output: 2 + +Explanation: +1 (0 0 0 1) +4 (0 1 0 0) + ↑ ↑ + +The above arrows point to positions where the corresponding bits are different. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0461.hamming-distance/hamming-distance.go b/Algorithms/0461.hamming-distance/hamming-distance.go new file mode 100755 index 000000000..9231cd8a0 --- /dev/null +++ b/Algorithms/0461.hamming-distance/hamming-distance.go @@ -0,0 +1,13 @@ +package problem0461 + +func hammingDistance(x int, y int) int { + x ^= y + + res := 0 + for x > 0 { + res += x & 1 + x >>= 1 + } + + return res +} diff --git a/Algorithms/0461.hamming-distance/hamming-distance_test.go b/Algorithms/0461.hamming-distance/hamming-distance_test.go new file mode 100755 index 000000000..13cc08688 --- /dev/null +++ b/Algorithms/0461.hamming-distance/hamming-distance_test.go @@ -0,0 +1,47 @@ +package problem0461 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + x int + y int + ans int +}{ + + { + 3, + 1, + 1, + }, + + { + 1, + 4, + 2, + }, + + // 可以有多个 testcase +} + +func Test_hammingDistance(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hammingDistance(tc.x, tc.y), "输入:%v", tc) + } +} + +func Benchmark_hammingDistance(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hammingDistance(tc.x, tc.y) + } + } +} diff --git a/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/README.md b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/README.md new file mode 100755 index 000000000..9a541c968 --- /dev/null +++ b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/README.md @@ -0,0 +1,26 @@ +# [462. Minimum Moves to Equal Array Elements II](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/) + +## 题目 + +Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected element by 1. + +You may assume the array's length is at most 10,000. + +Example: + +```text +Input: +[1,2,3] + +Output: +2 + +Explanation: +Only two moves are needed (remember each move increments or decrements one element): + +[1,2,3] => [2,2,3] => [2,2,2] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii.go b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii.go new file mode 100755 index 000000000..14659b32c --- /dev/null +++ b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii.go @@ -0,0 +1,28 @@ +package problem0462 + +import "sort" + +func minMoves2(nums []int) int { + sort.Ints(nums) + size := len(nums) + + median := nums[size/2] + if size&1 == 0 { + median += (nums[size/2-1] - median) / 2 + } + + res := 0 + for _, n := range nums { + // 把所有的元素都调整到 中位数 才是最优解 + res += diff(median, n) + } + + return res +} + +func diff(a, b int) int { + if a > b { + return a - b + } + return b - a +} diff --git a/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii_test.go b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii_test.go new file mode 100755 index 000000000..d9b70b092 --- /dev/null +++ b/Algorithms/0462.minimum-moves-to-equal-array-elements-ii/minimum-moves-to-equal-array-elements-ii_test.go @@ -0,0 +1,64 @@ +package problem0462 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1334, 1500, 4169, 724, -3522, 4358, 1962, -536, 705, 3145, -1719, 1827, 4961, -4509, -2005, -3058, -173, 436, -2609, -396, -1098, -4847, -4708, -2618, 2421, 3716, 4718, 4895, 447, -3274, -229, -3462, -3131, 4912, 667, 1299, 2035, 4894, 3703, -1189, -3678, -4667, 2673, -336, 141, 2711, 3253, 1868, 547, 2644, -2338, -2243, -4963, -2141, 3723, 4741, 2529, -4222, -2684, -1965, -2810, -3158, -4712, -4894, 4040, 3942, 4264, -2352, 2446, -1195, 890, 1729, -630, 350, 6, -3899, -607, -1452, 4629, -2377, -916, 4954, 3756, -3160, -34, 2376, -1069, 1308, 1944, -2561, -374, -3677, 537, -3462, 1118, -2918, -2071, 1541, -167, -3885, -361, 4658, -2296, 4930, -1023, -2694, -3327, -2614, 21, 3745, 1924, 4072, 1270, 829, 1777, 573, 97, 1512, -1014, -1710, 4161, 3636, -2645, -233, -1345, 574, -969, -2948, 2350, -3850, 1941, -3276, -1034, -1570, -3893, -4809, 3007, -3663, 457, -2713, 2753, -4617, -55, 3909, -2791, 4758, -779, 3588, 1422, -54, 2506, -1970, 1413, 4168, -4100, -2409, 3762, -3345, 2410, 1359, 2624, -4463, -3452, 1483, 2595, -959, -1398, -650, -4709, -4164, 4374, -3980, -404, -979, 2348, -1801, 4668, -516, 3281, -266, -4947, -3001, 1418, 2938, 1900, -1212, 3127, -4533, -1272, -107, -352, -2517, 2807, -2579, -690, 1617, -2187, 4514, -691, 2616, 3935, 2451, -4400, 249, 1519, -3444, -2202, -4697, 1224, -3992, 844, -2391, -11, -2298, -1805, -4515, -1907, -657, -4477, -3413, 4314, 4503, 2448, 200, -1542, 1618, -4420, 4796, -202, 281, 4589, -4202, 3009, 2157, -4528, -1378, 3538, -2708, 1038, -821, 3190, 4657, 2958, 1191, 4815, -2112, 4156, -3489, 1202, -2366, -728, -4945, -4672, -2354, 1362, -114, 3875, 3433, 4869, -4858, -1156, -3584, -3119, -3002, -4678, 3651, -4979, 699, -1443, 3476, 2892, -611, 75, -4288, -2400, -2490, -3997, 1869, 2861, -312, -1599, 4789, 255, 1423, 2, -4415, -818, -4715, 2088, -3574, 3617, -1243, 4832, -4068, -831, -2846, 721, 2189, 4976, -3671, -2632, 3692, -3575, -4445, -1566, 1549, 2441, 4512, -4855, 3060, -3282, -1247, 1139, -2577, 1279, 996, 1687, -2471, -2451, 2437, 4866, -2051, -4807, -1805, -1703, -4584, 3286, 1105, -512, 1282, -2545, 734, 3114, -3299, -3684, -4329, 786, -2737, -687, -645, -3815, -4947, -4088, -4192, -3168, -4055, -687, 2756, 3321, 4558, -1354, 2982, -4519, -856, -1804, -4778, 2129, -2839, 535, -4550, -3827, -4534, -2956, -3341, 1292, 1439, 2253, -4976, 1154, 4510, -255, -4351, -1814, 3313, -526, 3022, -2832, -982, 3787, 4905, 2958, 2391, -4798, -1375, 1477, -586, 4314, 824, 4334, 874, -628, -4841, -3167, 3070, 2487, 3297, 2518, 3177, 2773, -2730, -3237, -2332, 2192, -1015, -1898, 3480, 4213, 2627, -198, -901, -4473, -2375, -3457, -3076, -3977, 4972, -1939, -819, -3997, 2432, 2505, 2593, -2275, -1969, 3492, -4858, 2222, -3714, -1936, 2900, 4187, 3360, -2587, -4026, -730, 4170, -4765, -4167, 4711, 760, 3896, -333, 2285, -2450, -4860, -1306, -2305, -3376, 3019, -2875, 1576, -3306, -2342, 1302, 2371, -2534, -322, -2407, -1149, 484, -3982, 3464, -3881, -1848, -2200, 3087, -3940, -3074, 4010, -243, -2830, -4685, 4576, -4773, -2957, -2242, 2164, 109, 2882, 2086, 4565, -1513, 4577, -526, -2375, 627, 629, -3072, 423, 3520, 1902, -38, -4877, -404, -1263, -1739, -4805, -2475, -3736, 3260, 1202, 3116, 30, -4674, 4011, -4229, 1411, 547, -3847, -3480, 4790, -76, -4812, -3237, -60, -4149, 3662, -1171, -4100, 2713, 3958, 2578, 3365, -1993, -3523, -3800, 1058, 1439, -2697, -2240, 4357, -2676, 1477, 108, -3887, -113, 4801, -2150, -540, -2572, -2007, 2384, 4405, 1540, -3889, 3704, -2165, -2644, 1072, 4350, 3823, -515, -4444, -1784, -3374, 4357, 3526, -1643, 4337, -1729, -1131, 4361, -2104, -1978, 4617, -4888, -2283, 3696, -3415, -959, -577, -871, -771, -435, 1559, 3932, -2704, 4855, -2947, 1962, -1416, 4734, 1654, 1972, -3543, -631, -2468, -2037, -2393, -2517, -4089, -3365, -4933, -2152, -325, -2062, -2777, -2858, -1246, 1511, -2259, -4825, -3541, 2825, -1779, 2870, -3374, -3066, 205, -3217, -1150, 2398, -2721, -2299, -2807, -2266, -3363, 1534, 556, -3007, -4824, 705, 1962, -4452, 881, -4700, -587, 1641, 4855, -145, -1858, -3538, 2611, -4123, -4576, -2322, -3248, 3443, 3296, -2327, -4960, 4313, -4125, -4928, -2182, -4390, -3983, -68, 3112, -4305, -1831, -1169, -4960, 1488, 3685, 4090, 4497, -2411, 990, 145, 4353, 4314, 3651, 1740, -2956, -3742, -4665, 3759, -3808, 2605, 264, -2819, 3503, -1171, -1225, -4392, 4292, 997, 2549, 4556, 561, -3373, 1467, 4541, 1129, -3760, 2813, 4174, -4399, 1077, -4785, 3683, 3213, -1008, 824, 601, -1608, 759, -2330, 1428, 3027, -916, -4925, 3786, 498, -30, 1287, -1153, -2396, -4497, -3779, -2337, 706, -2637, 4010, -2829, 2489, 3240, -2836, 542, 2619, -4087, 2591, 1704, -3182, 4232, -4250, 205, -25, -3461, -4697, -3578, -3902, -3753, -1416, -1352, -2029, 2864, -2087, -3925, -3455, 3712, 2546, 3678, -3231, 262, 3519, -1015, 3289, 944, -2135, 3540, -1755, 508, 3318, 2870, 4601, 3323, -3868, -528, 2152, 87, 3570, 4763, 4901, 2103, -577, -1473, -3400, 1969, -985, 565, -4972, -3457, 347, -2912, -2057, -2363, -2591, 1463, 49, -319, -3412, -3658, -4392, -2940, -3779, -3242, 4954, -4112, -854, -4310, 2949, -2157, -3570, 620, -4252, 2067, -464, -4217, 3035, -2774, 185, 2038, 4853, 629, -3776, 748, 4923, -1641, -2743, -234, -56, -45, -1682, -2274, 411, -3975, -4645, -3999, -2451, 4496, 3584, 4515, 2964, -1658, 3075, 2913, 1142, -3804, -3052, 72, -4574, -394, 1173, -571, -2596, 1705, -4374, 4812, 4375, -4907, 1565, 1036, -264, 4141, -4186, 994, 3256, 1652, -1064, -4162, -4518, -3645, -3985, -3869, 3230, 2841, -375, -2989, -2363, -814, 4690, -3350, 662, -3366, -4107, -4647, -3584, -1548, -992, 2262, -2767, 454, 1303, 1634, 1303, -744, -4852, -3876, -2683, -787, 2109, -972, 4200, -3920, -3682, 1858, -950, -845, -3639, 264, -3097, -1324, 4643, 1909, -98, -1439, 3489, -52, -3718, -1347, -4326, -2780, 402, 1923, -1169, 4369, -1122, -4741, 4008, -2381, -1029, -4997, -3055, 4781, 1504, -2608, -2315, 313, 1698, 589, -2278, 938, 4037, 1410, -3539, 1234, -2492, 4961, -1041, 1493, -3485, 269, -63, 3869, -4942, -300, -1029, 1264, 117, 1215, -445, 2815, 3330, -1961, -4788, 4288, 3082, -3046, 1085, -4290, -516, -226, 3380, 4815, 951, 1541, 3115, -3321, 2110, 898, -1927, -4212, -1023, 3132, 4956, 3689, 1113, -4992, -2059, 790, -3277, -3637, -4972, 184, -222, 2200, 71, -3115, -3026, -3929, -3667, -2133, 1153, -705, -2832, -4175, 4676, 629, 3650, -2402, -1691, -307, -314, -4920, -4884, -2751, 1667, -3472, 1679, 2864, 4421, 3405, 3826, 1816, 2516, 2726, 3666, 4087, 2681, 4964, -3660, 686, 1021, -3338, -279, 1064, 4309, -4585, 2902, 4873, 2124, -1059, -2255, -3238, 3423, 2531, -194, -2732, 4318, 602, -3093, -693, -1519, -3988, -3864, 1630, -886, 1809, -916, -1444, -2710, -3707, 4996, 4152, -3946, 345, -292, -4752, 2491, -1288, 131, -4886, 1439, 2958, -278, 4704, 1995, -3948, 269, 2479, 3238, 1423, 2918, -4134, 2659, -2502, 3486, -3804, 2462, 1633, -2842, -2978, -3854, 3392, -1963, -1075, -4353, 4458, 1602, -4193, -902, 2830, 4292, -400, 2278, -4201, 3352, -4552, -1118, -4460, 3315, -425, 3762, 4567, -2664, 3397, -3582, 4897, 828, -1149, 1816, -770, -551, 1925, -4342, -4771, -480, -4060, 4560, 147, 162, -3345, -4325, -4208, -2639, -3246, 1398, -1854, 3714, 1946, -3812, 4569, 3638, 2663, 75, -485, -3479, -4525, 615, -4472, -1766, -2430, -4095, 4464, 4557, 3962, -839, -4476, -2451, 2469, -4670, -3077, 3350, -667, -2075, -4090, 4737, 1336, 3337, -3722, -2607, 2636, -4286, 3164, -3409, 4949, 4135, -2495, -1663, -4996, 1337, -2377, 3664, 4970, 608, -4432, 4281, 2085, 4152, 3373, 3652, 3194, 4876, -1174, 3396, 2572, 1249, -360, 4174, 3819, -4057, -2389, -3059, -4711, 3419, 565, -1195, 2585, 1216, -3550, -3385, -2391, -3936, 4166, 1893, 1074, -1491, -4700, 4695, 4573, 589, -1839, -3828, 2968, 2358, 1031, 1268, 4426, 3510, -4578, -4226, 3779, -4090, -1448, -818, 391, 495, 764, -4126, -3636, -98, 3255, -540, -4526, 1972, 1821, 1122, 547, -3423, 4789, 605, -4805, 2594, 2950, 1343, -4246, -2519, -3988, -3328, -1561, -1572, 912, 4762, 967, -592, -585, -3092, 2223, -3241, 1434, 204, 4486, -681, -4042, 945, 1806, 3166, 3700, -3633, 2692, -3213, 3532, -4444, -4026, -1553, 21, 3283, 1222, 4331, -2624, 3583, 1948, -2277, 2982, -2982, -224, 4220, -3889, -2818, -1144, 4490, 3925, -676, 1486, 4677, 969, -3357, 2534, 677, -2332, -3932, -3009, -2804, 2783, 1828, 2727, 4426, 871, -4303, 2612, 3703, -3973, -3592, 545, 4508, 2185, -4762, -763, 1443, -3687, -2499, 3850, 128, -2889, -1350, 3149, -3808, -3546, 869, -4319, 2465, -4733, 2713, 4793, 3634, 472, -4028, -2170, -99, 3442, 177, -1123, 770, -4298, -636, -3619, 1590, 3823, -2763, 3023, -2821, 1595, -4831, -2673, -2958, -3690, 3182, -3942, 2926, 4487, -3330, -2472, 651, -2742, 2213, 4860, 783, -3714, -2258, 3610, -528, 2128, 3434, 841, -4282, -1497, -133, -135, -4062, -3119, 4257, -2250, 3614, 3598, 3458, -2339, 1063, -2244, -4193, -4722, 4489, 4435, 1365, -2925, 2586, -3614, 2833, 3360, -1670, 1048, 3928, 4492, -2567, -1160, 1766, -3265, 4810, -3401, -3163, -3108, -3018, 2328, 4352, -3631, -3756, -3206, 1608, 4252, -3353, 2432, 4535, 2208, -1736, -1503, -1757, 2649, -2985, 1841, -4811, 1100, 4812, -4352, 4523, 4851, -526, 3633, 4891, 2200, 4854, 4990, 697, -81, 2780, -2422, -2069, -2456, -1660, -1513, -4101, -2475, 3483, 538, 2492, 1193, 3252, 11, -3440, 834, -3160, -3503, -2215, 3529, -3460, 3805, 3791, -1608, -1790, -1451, -3422, 1979, -4029, 4277, -4927, -4807, -3380, -3503, -1174, -3724, 4790, 1582, -1422, -3841, -4582, 1489, -4841, -1551, -2076, 4072, -4620, 2008, 2967, -4792, 1477, 3503, 370, -2393, -804, -2926, -1278, -2389, 4019, 3761, -3944, -2110, -3837, 1683, -1284, 4932, 452, -2259, -46, 1813, -2138, -4604, 460, -4385, -4096, -2401, -4864, -320, 4198, 2032, -613, -2416, 2240, -1483, 2006, 3670, -4759, 3882, 249, -1477, -3242, -2895, 4621, 2095, 2296, 4916, 678, -4822, -1421, 58, 2577, -2250, -993, -1271, -919, -2005, -2322, -324, 2753, -4101, -3216, 565, -1907, -1392, 1172, -3757, 4929, 2514, -4832, 55, -3809, 973, 3922, 1748, 651, -4014, -2856, 1446, -3423, 1517, -371, 4916, 874, 791, 469, -2088, 3146, -4307, 4091, 4815, 1949, 1857, -4360, 1052, -4764, 3551, 4487, -3774, 3162, 1955, -1817, 3394, -4820, 1097, -1935, 2065, -2487, 4261, -2422, -3922, 1878, -860, -389, -3053, -2555, -4830, 4975, -1511, -250, 1149, -1667, -1135, -2786, 2282, 2007, 2432, 3896, 1367, 3522, -118, -3190, 2641, 2231, -2813, 1705, 1479, 1321, 1538, -3649, 4447, -792, 4646, -2724, 759, -4811, -4578, 2666, 3486, -1545, -2972, 4614, -140, 4253, -3223, -3652, -2497, -4139, -2569, 4082, -2545, -803, -2894, 3752, 821, 2296, 1281, 1021, -545, 947, 2124, 3318, 4135, -3624, -3226, 4859, -2, -2926, 4253, 1922, -4365, -3357, 3888, 3153, -1768, -253, 3680, 4926, 678, 1450, -199, -39, -801, -4145, 1363, 716, -4427, -3439, -1755, 1473, 3274, -3450, -647, -3819, -713, -2301, 3110, 3643, 2465, 2172, -2471, 4981, -2888, -1524, -619, 3247, 1890, 1671, 3805, -2628, -4968, -1011, 4320, -1835, 431, 4658, -3707, 2206, 1578, 1948, -2794, 2171, 3166, -1604, 1697, -3980, -1306, 529, -212, -4891, 2984, -3031, 3978, -3383, -985, 1626, -1316, 4168, 2906, 928, -2903, 3118, -610, 199, -3215, -514, 4199, -2580, -4290, 3271, 813, 2415, 1085, -4682, -1420, -3669, 2267, 3387, -1556, -1814, -493, -640, 2827, 3074, 1431, 2152, -4729, -4732, -307, 4885, -4663, -3689, 2604, -2323, -4594, 2768, 4022, 4413, 0, -4458, 2537, -4962, -3612, 2355, -1711, -3353, -1819, -1907, 1584, -4013, -4239, -4507, 3217, 4501, 2482, 4447, 665, -4247, -2896, 84, 4095, -1475, -4779, -1036, -3219, -128, 3106, -1344, -1657, -2407, 2080, 1080, -132, -3589, -1287, -4032, -1749, 2216, -2921, 3768, 2040, -3469, -2067, -1221, -4337, -2741, 1653, 2936, -2905, -635, -3126, 2720, 1835, 680, 3976, 3455, 725, -929, -192, -1441, 4156, 602, 2832, 2905, -4560, 2375, -3438, -2115, -3038, -3920, -3164, -4203, -3798, -4492, -4920, 340, -2924, 4058, -3507, 2740, 3546, -4526, -227, 4097, 3880, -1665, -3928, -1600, -4293, -2045, -4334, -859, -1412, -2519, 2168, 3315, 4396, 1225, -3991, -2988, 3136, -3545, 3762, 43, -4258, -4979, 2922, -488, 4248, 1018, 2368, -1283, 4714, 2650, -1710, -1665, -2241, -1831, -3105, 303, -2360, -3021, -801, 4105, -209, 3661, 3681, -1348, 3753, -967, -2971, 987, 2042, 1253, -4917, -3580, 814, -2282, -2756, -3937, 2229, -4348, 3864, -231, -4530, 5, -3953, -3406, -3513, -674, -1724, -3677, 1540, 2679, -1010, -2412, -290, 4271, 2945, 4221, 3470, -4817, -1411, -1045, -22, -221, 6, -1738, -4865, -1513, 2196, 4033, -2912, -2065, 4779, 993, -210, -38, 3965, -3999, 4105, -3193, -433, -2331, -1866, -2329, -3543, -2002, -1455, -1403, -782, 3838, -156, 2372, 3563, -3972, 4264, 3801, -277, -1510, 2604, -3399, -773, -3803, -1308, 4771, -4637, 4301, -2637, 2721, -1435, 2421, -1555, 3610, -4505, 1741, 22, -3188, 4151, -1985, 3055, -1607, 3738, 279, 4882, -3392, -2346, -1178, -2293, -755, -3662, -4856, -2710, -3661, -1846, -396, -377, -2775, -4922, -3276, -3019, -2670, 4733, 3223, -4406, 4130, 3846, -13, 4445, 3805, 3616, 750, -4511, 2338, -3037, 3135, -303, -2791, -3370, -1776, -3092, 1737, -526, -3080, 2372, -4707, -1145, 1734, 4561, -3944, 2606, 3184, 2075, 3382, -881, 1741, -4568, -316, -2221, -2721, 3283, -4333, -4164, -875, -882, -2263, 3028, -2881, -4423, -4263, -909, -4444, -2205, 1060, -3099, 3793, -1568, -2864, -420, -125, 907, -3816, 3074, 3719, 1790, -4524, -4959, -1649, 3329, 1290, -2026, -1928, -1409, -2811, 787, -3510, -1761, -107, -1947, 2063, -4319, 903, 2005, -824, 3479, -3305, 1139, -2532, -1002, -3917, -1361, 4515, 2621, 4993, 826, 722, -1162, -172, -2419, -601, 3978, -3109, -3977, 1943, -166, -757, 2349, -2298, 3707, -4498, 141, -4313, 3346, 891, -363, 3413, -3600, -2184, -3310, -1838, 3935, 4126, 4410, 4877, -3618, 1260, 2189, 1705, -1126, -2337, -4278, -2805, -2434, 1360, 1038, 3588, 2811, 3245, 4467, -2575, 1867, -1811, -4458, -1937, -3453, -4498, 4617, 4099, 23, 2226, -3797, -4952, -3949, -3430, 3636, 4458, 967, 3456, 4405, -3469, 4962, 1819, 2975, -4444, 2531, -3505, 3044, -4409, 1803, -1612, 3915, 2450, -2681, 1272, 791, 4383, -4867, -3225, -358, -1431, 3300, 2954, -2922, -1415, -2743, 333, -4107, -4510, -4897, -250, 2233, -4278, -729, 4611, 3990, -4662, -3359, -1742, 4047, -2648, 4658, -4521, 302, -2317, 3990, -4998, 568, -578, 1895, 1135, 3008, -2639, 1742, -2806, -1301, -1812, -4822, -958, -3643, -1059, -3153, 2469, 1345, -620, -3087, -36, 710, -4939, 385, -4927, 2504, 4462, -2297, 3102, -3931, 154, -1471, -3448, -2926, 4149, -1270, -2756, -4156, -1951, -882, -935, 1363, 4552, 3773, 3470, 4731, 1747, 2511, 869, -602, -4502, 2103, 2352, 679, 3053, -1957, -478, -3912, -3437, 834, 4850, 2022, 2240, -3089, 4492, 651, 3580, 477, 2616, 4876, 4178, 220, -385, -2652, 1798, -2821, -3365, 1857, -2117, -3338, 3902, 3262, 4420, 4770, 4022, 4273, 841, -2314, 3888, -1083, -3283, -3108, -1302, -3733, -3251, -4935, -4611, 1932, 619, 1081, -2997, 4130, -1972, 3631, -411, -1848, 3630, 4172, 4864, 1407, -2705, 428, 4681, 3490, 1610, 1177, -3929, 236, 1459, -4357, 1840, 2633, 2037, -1107, -2370, -4726, -2007, 3782, -2797, 2461, 3290, 4662, -2693, -4003, -3849, 3423, 3890, 1717, 1640, 3703, 566, -117, -1339, -2341, 3245, -4614, -2349, -2235, 4601, 1840, 2209, -3503, 2283, 4250, 3058, 3421, -4825, -4419, 1787, -1729, -713, 2999, -2496, -21, -2862, -4300, -4470, -2539, -2882, -4795, 2540, 3828, -541, -3378, -602, -1240, 2098, -2065, -4519, -4386, 4567, 3493, 3596, 4161, 2746, -4462, 2670, -4462, -3524, -3445, -83, 1371, 1760, 752, -1242, 433, -2745, 4065, -4274, -2599, -1966, -2241, -4607, -4452, 2273, 3792, 1193, -2067, -4863, 2103, -1310, 3211, -1306, -332, -2373, 2498, -4011, 248, -1121, -3353, -3851, -4069, -4331, -4125, 598, 449, 436, -401, -4877, -3557, -3269, 3154, -2139, -566, 4385, -1033, -4184, -3607, 1704, 4866, -4047, -4692, 3223, 3684, -4208, -2333, -4952, -2531, -1070, -4189, 4814, 1090, 427, -1257, -3396, -4401, 1474, 2195, -4494, 158, 2589, 4858, 2809, 2889, -3553, -4960, -1182, 4364, 2975, -4974, 89, -2497, -4934, 1412, 1840, -2430, -324, 395, 3641, 4986, 2651, -3891, 3187, -4917, -3915, -1610, -3750, 3686, -245, -3619, 3128, 502, -723, -4138, 1424, -1435, -1128, -4168, -4115, -572, 1646, -4111, 1478, -4117, -75, -3735, -3740, 45, -4222, 821, -1145, -2480, -2073, -227, 134, 2251, -2325, -1664, 1334, -3999, -2263, 4310, 974, 2590, -4644, -3929, -2920, -4065, -2855, 2282, -3175, 3718, -1427, -288, -1963, -2, 4905, 2162, -3283, 3692, 4539, 3047, -4054, 4103, -4769, -885, -4161, 858, -4171, -2355, -1606, 2199, 4645, -728, -4325, -3138, -2928, -1227, -2520, -3762, 1897, -1458, 4608, 4203, -1723, 1125, -4866, -3599, 4078, 3382, -4831, -4264, 2478, 2939, -3862, 3721, -3574, -4337, -3323, -3425, 1724, 981, 2700, 2961, 3862, 1002, 3448, 95, -4316, -984, 137, 4507, -1007, -3716, -2056, -4741, -4179, 2058, -357, 2668, -4323, -4881, 4857, -1959, 3891, 264, -3377, 1915, 3072, 2929, -4159, -285, 2615, -2464, -43, 2759, -4300, -1548, 93, -759, -3171, -2552, 227, -3202, 1224, -4676, -2726, 3133, -2115, 38, -2830, 1862, -2371, 84, -3091, -122, 1923, 2085, 4400, -1976, -807, -1895, 4412, 765, 767, 407, -4323, -1216, -4296, -210, 4834, -4109, -4379, 3085, 2734, 190, -4458, 2998, -2914, -2982, 621, -4576, -2403, -3624, -746, 4669, 3108, -2073, -2507, 1068, 1366, 4102, -2562, -2400, -4181, -682, -2710, -16, 1339, -2444, 808, -368, -3522, 1814, -1213, 2239, 3074, 20, -4173, -2446, -3012, 2441, 1798, -1358, 4002, 1321, -4896, -1054, 2056, 3509, 4833, 2708, 4761, 1533, -4314, -196, 1385, -4858, 3842, 2260, -2839, -3380, -657, 4578, -3813, -4887, -1937, -409, 934, -4585, -4344, 4761, 12, 3411, -3041, 1251, 3738, -1630, 1124, 507, 3007, 2584, -4049, -1899, -511, -42, 441, -3210, 2013, -4588, -145, -3940, 2093, 3472, 402, -2324, -1457, 2373, 1266, 2651, 275, -3472, -4468, -4239, 469, -2497, -2271, 2107, 2892, -2549, 2953, 3392, -2430, -1481, 4472, -1593, -2506, 4505, 3440, -4617, -738, -3591, 3607, 3038, -640, 471, -3829, -4346, 4947, -3486, -477, -3771, -4511, 1766, 2887, 4756, 1632, 2470, 739, -4334, 3522, 2283, 3160, 2553, -295, 2091, -3741, 386, -3313, -371, -4958, 3317, -2955, -2644, -1612, 452, -1846, -4534, -3167, 2760, 1919, 631, 1738, -3733, 776, -3902, -686, 1320, -1947, -993, 1469, -784, 4722, 4842, 4007, 463, 1260, -4053, -1207, 3630, 3717, -1957, -3624, 314, 1626, 2117, -3666, -4380, -829, 1792, 3964, 4154, 3866, -307, -4336, -1225, -2000, -2788, -3900, 2551, 476, 1379, -4057, 2877, -1211, -4639, -3615, 3272, -3566, 144, 4561, 563, -496, -2054, -1112, -4692, -2843, -3570, 123, 1464, -926, -654, -1163, -3019, 318, 1611, 1292, 2591, -1168, 2123, 1461, 1991, -3539, 2330, 3498, 2369, 2291, 3400, -821, -883, -2683, 4914, -3405, -3559, 936, -3133, 2028, -3547, 2909, -1027, 2981, -3497, 1569, 1816, -3117, 367, 385, 3402, 230, 2157, 3681, 567, 3310, -3134, -1313, -1829, -1523, -3755, -2236, 1238, 2671, -2953, 1115, -408, 2311, -2343, -3595, -4947, 2171, -4420, -2260, -2470, -1325, -680, 790, -1623, -4002, 1586, -3396, -511, 4631, 4744, 3388, 1610, 3718, 1919, 3259, 927, -391, 3119, -3521, -2284, 1300, -3604, 1853, -3542, -4170, -407, -4194, 4849, -146, -728, 1160, -2706, -2946, 1333, -4854, -771, -4529, -4572, -4441, -2759, 4421, -2312, 1366, -2967, 1685, -2730, 329, -2739, -2140, -2792, 3982, -2838, -2494, 1878, -3021, -3103, 2887, 1538, -531, -4217, 2540, -2205, 2266, 3633, -1491, -443, -2683, 1134, -2947, 3135, -2742, -2407, 2843, -3307, 1466, -2049, 3140, -3906, -2063, 174, -2488, 1097, 4551, -2305, -3183, -1508, -3708, -4763, 2530, -4387, 296, -3290, -2611, 628, 809, 3786, -3256, 3840, 3182, 3569, 1120, 2393, 1292, -38, -786, -2473, 1807, -1806, 3705, -287, 2011, 3913, 1693, 4664, 1203, 3995, 2762, -619, 1946, 4909, -3952, -3232, 1624, -2489, 2954, -765, -3873, -367, 3240, -3138, 127, 2577, -1183, -2660, -4858, 100, 3400, 1558, -3524, -1846, -4065, 1430, 831, -3705, -1463, 623, 2922, -2073, 3029, -4789, 1211, -3246, 1880, -2747, -1707, -3679, -4215, 1528, -4557, -4000, -4445, -329, 4270, 2452, 4375, -369, -1360, 3934, 3040, 2986, 3834, -752, -3461, 3765, -2204, -4688, 2262, 52, -4269, -1013, -536, -2443, -752, 4556, -4830, 450, 2182, 2301, -1707, -901, -1668, 4044, -2669, -4925, -3996, 4050, 26, -934, -3262, 4801, 4623, -1157, -4559, -1620, 4695, 2918, -1341, -3637, -2372, 1329, -3912, 3854, 3613, -21, 3569, -4334, 2679, 2577, 2837, -1598, -1885, -1708, -3277, -2128, 4448, -4677, -3847, 948, -605, 197, -492, -2092, 2411, -1007, 2665, 1781, -1798, 2610, -172, 2256, 2705, 3965, 3023, -4231, -3285, -4747, -3195, -1316, 4478, -2855, -3160, -4167, 4285, 1900, -4032, -1006, 1633, -1115, -4652, 3281, 3032, 1256, 4910, -4128, 3982, -1099, -2694, -4365, 2860, -2529, 4527, 2137, 3343, 4768, 3233, -1005, 4171, 2603, 3942, 3011, 2879, -3966, -488, -407, -4470, -839, -1766, -4742, -3074, 906, 191, -557, 1188, -4773, -2281, 1484, 224, 4093, -4565, -1776, 3094, -1418, 3867, 3627, -2995, -3854, -2314, 1589, -4460, 3237, -2150, 3759, 4578, 3956, -2323, -2597, 3042, 1300, 811, 225, -3857, -3405, -3984, 1615, 3804, -3994, 3368, -3359, -4665, -4302, -3675, 3313, 3023, -2688, -382, 3457, 3396, 3339, -3914, -2906, 2846, 2043, -3478, -2089, 1280, -1545, 1358, 1847, 3870, -4010, -1127, -673, -1587, -1546, -3104, -2528, -550, 2241, -359, 646, -1475, 3213, 1824, 2929, 3695, 403, -2406, 2993, 1067, -2813, -360, 79, -4959, 3125, -2466, -140, -2000, -93, -2379, 2692, 293, 117, 2717, -4597, -1057, 2893, -4361, 4011, 1925, -972, 4978, -4252, -2150, -2108, 1444, -4346, -1377, -647, -2964, -3453, -3654, -4174, 1061, -1096, -4762, 2571, 1886, 1405, 299, -2944, -3272, -3733, -1249, -2981, 4991, 3166, 717, 846, 2093, -1813, -3579, -2088, 1867, 3299, -2556, 4897, -3799, -1672, -58, 2104, -3232, 4768, 1641, 1296, -3738, -4280, -3756, 2918, 4625, -3781, 2584, 3174, -4016, -4541, -1851, 2014, 695, -2497, 32, -1149, -3463, 1814, 3363, -349, -3781, -710, 917, -3317, -3082, 1584, 2252, -1414, -3731, 1248, -2863, -2603, -4576, -1832, -4973, 3148, -3007, -4618, 4271, 2669, -4107, -4123, -3986, 4104, -4516, -2057, -3505, 1811, -3707, 3892, 1798, -3010, -3701, -110, 3493, 4074, -3451, -1226, 4314, -4827, -931, 4218, 1865, 1833, 238, 4911, -1748, 1463, 1508, 149, -1912, -2755, 1231, -3080, -4894, 4271, -2632, 1421, 258, -843, 4647, -18, 3238, -878, 2723, -4094, 3706, -4811, -3844, -4655, -2649, 1923, 2118, -3450, -2903, -3164, -4409, -1594, -490, 813, -349, 880, 2844, -257, 2741, -3755, -422, -51, -3295, -486, 4785, 4227, 3624, 2204, 3356, -1083, 1227, -4445, -4898, -714, 4468, -3302, 3979, -3589, -2511, -4242, -1510, -4225, 3410, 2132, 2089, 2296, -3050, -1888, -4878, -2471, 2672, 836, 3277, 553, -1024, -4330, 4085, -2348, -3249, -4603, 4751, 4001, -4565, 1693, 72, 2916, 1716, 328, -3489, -2875, -3162, 2296, 3939, -3456, -3944, -2174, -2098, 1758, -412, -2979, -2414, -892, 4777, -2372, -3021, 1947, -2451, -3720, -1755, 128, -938, -4574, -281, -4323, 4091, -953, -1215, -1769, 2406, 3684, -3046, 1769, -291, 2956, -2579, 945, -1535, 1016, -3140, 1497, 3335, 190, 677, 3049, -3995, 2886, -1612, 3675, -1857, 2377, -4870, 3487, 1555, -2518, 253, 0, 2754, -4711, -2512, 215, -2992, -3690, -4060, 2799, -2003, 4707, 3454, -4696, 3237, -4515, -2501, -4208, 4613, -2388, 3682, -2017, 351, 1129, 2137, 33, 1600, -3136, -1317, -3143, 3968, -3290, -3032, -3292, -2359, 2732, -2563, -3316, -2501, -2299, 4869, 3583, 4256, 4692, 2640, -2913, 12, -1190, 820, -165, -3337, -4385, 897, 3677, -2226, -4866, 2553, 4533, 3878, -2714, 624, -2266, 3075, 349, -4288, 1984, -4376, 2792, 1504, 3822, -945, 3913, -4538, -527, -4916, -840, -3878, 1053, 4397, -3178, 4750, -3663, -1083, -994, -69, -2803, 2505, 4236, -4643, 1599, 3290, -3102, -4015, -3553, -3916, -4408, 3725, 3996, 4855, -172, 338, 2342, -572, 4795, -4258, -4963, 506, 1767, 53, 4793, 3505, -854, -1391, -1076, 4854, 4465, -2761, 1206, -791, 492, 1499, 3175, -3964, -1939, -1353, 618, 13, 1727, 712, 2896, -3091, 2841, -4870, 4090, 4034, 2915, 1286, -1477, -4334, -3656, -2264, -2963, 416, 893, -3051, -4029, -4156, -2223, 4285, 1200, -410, -4715, 3325, 2118, 668, -4994, 4729, -992, -459, -4775, 536, -3020, -4284, -4530, 384, 3747, -4672, 2936, 1204, -4300, 2523, 1364, -3589, 1040, -4750, -3496, -1517, -3234, 1141, -2330, -4155, -4494, 4088, -1744, 107, 3266, 857, -2322, -801, -2326, -845, 191, 3990, 4832, -4142, -4004, 3917, 3290, -1033, -3293, 3234, 3246, -3538, 4402, 3239, -1574, 4095, -4094, 3314, -4650, -414, 279, 2776, 822, 1879, -2699, 812, 676, -1836, 2357, -2430, 1038, -688, -4856, 1561, 3180, 3200, -4357, -3144, 3061, -2353, 939, 4808, 4290, 2452, -4021, -2382, -3581, -993, -2716, -453, 4977, 675, 3613, 3709, -1629, 3642, 1339, 1336, -2379, -3499, 1034, 3129, -3642, -3564, 3469, -2103, 3504, -202, -798, -1895, -3762, 32, -4935, -2484, -519, 579, 4023, -3273, -3229, -3687, -4618, 1140, -184, 3488, 319, 589, 513, 3259, -4149, -2729, -1717, -636, 2038, -1988, -1816, -3241, -1499, 4574, 3733, 59, 2714, 2649, 1595, 3522, -459, -4584, 377, -3948, -4435, 4891, -4862, -1690, -4033, 55, -1213, 2224, 3222, 1439, 2441, 1648, 1804, 2834, 4368, -3559, 3872, -2332, 4974, 4176, 137, -4367, -1759, 745, 3018, -3985, -2026, 4252, -4154, 3956, 524, 1966, 581, 3144, -2760, 4334, 296, -3124, 27, -3795, -2982, -709, -3359, -1535, 1191, -2529, 1259, -1300, -4783, -2984, -3057, -376, 2064, -3495, -3843, -3498, 2666, 4275, -2954, 2632, 4789, 1046, -2855, 1003, -1848, -3099, 3326, 4153, -3816, 4649, -4650, -4595, -654, -3975, 3970, -664, -205, 4793, -3677, 532, 3856, 896, -1790, 2776, 692, -450, 290, -1205, -1148, 2350, 3315, -4964, 4361, -1240, 4984, 3729, -2466, 1050, 3082, 1806, -3064, 584, -4210, -3383, 4182, 4066, -1884, 1388, 4425, -1899, 610, 1450, 4982, 3621, 193, 2038, 1754, -407, -105, -4720, 638, 167, 2420, -655, 1883, -1135, -304, -4167, -4610, -2368, -4811, 2839, -4817, -1183, -2871, 1753, -4321, 3613, -4400, 3252, 145, 4861, -2849, 3318, 3963, 2813, -93, 4554, -3524, -4383, -3789, 429, -2736, 966, 4531, 4942, -4302, 4522, -3845, 2587, 257, -1842, -536, -1238, 3510, -4054, -3935, 3380, -1835, 946, -1460, 2297, 3042, -536, -1806, -2416, -4730, -2285, -2800, -3794, -2894, -3698, -304, 3833, 2611, 4067, -4585, 1645, -4825, 1354, -1552, -81, -1921, 2988, 1321, 2592, -3403, -2803, -1491, 3652, -4929, -4342, -878, 1859, 2997, -4001, -3101, -880, -3680, -2964, 1984, -88, -3085, -1047, 4485, -4259, -4801, -3433, -792, 1844, -4831, 4681, -121, -3892, 2207, 259, 706, -1151, -925, 3026, -4876, 2607, 2774, -2116, -4872, -454, -1855, -4519, -3286, -4851, -832, -1662, -4693, 1793, -1496, -3895, -3303, 3217, 955, 1641, -2657, 1133, -2903, -4321, -4264, 4555, 633, -3046, -4070, -4748, 4904, -4721, -2512, -130, -3246, 1072, -2824, 1701, 415, 3086, -769, 2480, 4975, -4740, -4486, 3938, 1657, -10, 4438, 3981, 447, 242, -382, 1070, 631, -939, 2219, 3781, -4010, -2167, 3672, -3437, -3698, -4498, 1928, -4279, -102, -3553, -4055, 3406, -2778, 3686, 794, -1423, -2156, 3683, -3453, -1760, -4515, 1464, -3277, -4663, 1653, 2168, 3130, 255, -3534, -142, -2488, 4656, -1682, -1799, -4858, -3724, -3494, -2298, -4316, 23, -4730, 1312, 3250, -1525, -4689, 1850, 4195, 488, -3480, 1101, -4817, -202, 2892, 3848, 1784, -4755, -2813, -538, 3343, 3258, 1859, 3871, -984, 3172, -2168, -559, 2683, 1088, -2985, -1024, 3516, 3298, -4961, -3717, -1795, 4997, 4146, 769, -1325, -4083, 4387, 20, 1030, 2442, -3265, -2611, -4627, -1520, -2927, -4223, -4214, 3381, -3215, -4478, 3345, -4021, 1085, 713, -4065, 4735, -4117, -2814, 1096, -4352, -2915, -248, -4479, 4260, -3018, 1636, 2688, 4919, 2236, 1792, 2065, 4278, -802, -3504, 1386, -3989, -4024, 2547, -2879, -1798, 2245, 1702, 3564, -3461, -2428, -2743, -2630, -3080, -3346, 4359, -3920, 2298, -1609, -1040, -4490, 4591, 867, -2967, -3325, -2864, -4501, 2775, 790, -624, -3744, -4728, -4297, 86, -4033, 4515, -1458, -1505, -1434, 3456, -814, 3437, 4198, -2374, 3364, -3915, -3335, 3908, -4660, -3640, -2186, -3846, 3012, 4752, -1662, 3706, -2475, -4370, 4249, -1821, -1921, 3313, 3838, -2483, 3421, -855, 991, -3031, -3161, -692, 1565, -1238, 4473, -1319, -3030, -1853, 2053, -2292, 1508, 1715, -571, -3934, 2689, -337, -3229, 541, 1259, 3631, -1428, -2486, -4034, 988, 3170, 3168, -2801, -4345, -1150, -1556, -2064, 1278, 4406, 4427, -4687, 2523, -2629, -1673, 2073, -1539, -2827, 4934, -3898, 587, -3583, -3537, 1153, 1126, -4405, -3505, 4213, -2594, 2370, -1141, -1695, -2504, -167, -777, -148, 2879, -4481, 1126, 2793, -3415, -3535, -3629, 444, 2107, 2271, -913, 3099, 1519, 3596, 715, 2552, -2508, -247, 3257, 2590, -41, -1643, -4114, 2809, 865, 686, -2981, -4741, -2687, -2565, -3972, -899, -4532, -2131, -4544, 1731, 2578, 1074, -3605, -4157, -3726, -1684, 24, -4489, 3585, 722, 3971, -4943, -905, 3174, 38, -2817, 1658, 2295, 722, 1983, 1231, 4503, -2768, -700, 590, -3520, 2408, 505, -2298, -2142, 4818, -4443, 561, -880, 28, -1344, 713, -1668, -1908, 2182, 1467, -3680, 2358, -3926, -1013, 4094, -17, -3636, 2264, 4714, 1746, -610, -4575, 1255, -1837, -3533, 792, -769, -2381, -2120, -282, 1128, 4948, -280, 4079, -2909, -1234, 2587, 808, -2874, -175, -3841, 2518, -1780, -4965, -3686, 456, -853, 4156, -4866, -1640, -4249, 1208, -3522, -2706, -2411, 2524, 2976, 4694, -910, -4811, 4372, 2419, -4699, -3298, -156, -4477, 1539, -4391, -3173, 1637, 3186, 2416, -3173, 169, 2623, -101, -2486, -4585, -1356, 436, -1331, -4622, -3324, 2858, 2952, 4846, 2137, 915, -2012, -384, 2288, -2618, 3074, -4667, -1085, -3944, 656, -4938, 4616, -476, -2871, 2442, -3016, -128, 2049, -1604, 3026, 3582, -4798, 3775, 416, -4335, -448, 3759, -2245, -3583, -2156, -1446, 4443, 1824, -3001, 3422, -4879, 733, -3587, 4917, 793, -3127, -2940, -3825, 4074, 985, -2499, -3378, -1792, 2395, -3974, 1720, 1291, -3012, -4071, 4072, -4023, -4807, -4992, -2746, -4078, -4124, 137, -4184, -1197, -3910, 2912, -2711, 2253, 4979, 2299, -2678, -2098, 2602, 1369, -4346, -2271, 4734, -2562, -2726, 226, 1463, 3134, -2028, -652, 1453, 4503, -2693, 518, 3333, 2437, -4305, -1821, -4339, -1856, 2659, -4039, -3093, 1576, -1528, -4355, -1408, -2028, -4372, -804, 1811, 535, 835, -3771, -1284, -1468, -44, 1158, 4749, -380, -1704, 4724, -1880, -474, 1406, 3983, -1555, -4426, -3309, 1588, -4462, -4336, 3104, -4123, -4647, -2058, 2004, -4377, -148, 625, 2611, 2842, 3724, -3851, -4865, -1410, -4854, 2328, -1145, 2804, -3259, 1909, 4381, -2221, 4102, -4917, -4308, -4468, 2312, 1099, 1161, -3953, -2595, 290, 2569, 4959, -2372, -2861, -3772, 2580, -2529, -3222, 2440, 3456, -2852, 4444, -255, 1125, 2210, -302, 616, -3820, -185, 1064, 1226, 4472, 2479, 4593, -2518, -1995, 3536, 333, -3895, 2587, -4268, 638, -3835, -3936, -482, 3399, 32, 2508, -1104, -1562, -1022, -2362, 3245, -941, -831, -4256, 2362, -231, -3951, 1518, 1467, -4442, -2857, -1939, 603, 4190, -2814, -3774, -1397, 2004, -3700, -3232, -4577, -3653, 396, -434, 230, -3335, 1152, -3000, -1383, 4173, -4214, -4332, -3403, -3421, 1224, 2728, 1260, -2842, -1575, -1733, 4312, -4266, -4548, 169, 4562, -3430, 3211, 4235, 1890, -3289, -2936, -250, 3960, 2545, -233, -3246, -4213, 3217, -435, 4942, -2912, -4727, -2185, 2579, -4163, 4388, 4269, -3114, -1170, -4191, -360, 2321, 3319, 4881, -3374, -1980, -3589, -4546, 893, -3016, -2643, -2001, -4664, 3829, 950, -3543, -2595, -4635, -2666, -4951, 4094, 3592, -3730, -4881, -1983, 4313, 253, 1117, -23, 4160, -3495, -4847, -409, 1562, -1424, -146, -4928, -3866, -1984, 50, 4193, -3055, -3148, -4253, -2479, 3061, 1344, -4741, 3366, -2115, -561, -2282, 4107, 268, -1446, -2950, 2432, -1201, -2980, 1735, -3902, -2208, -1084, 1182, 4029, 316, -1941, -1242, -417, -2601, -3865, 3357, -4930, 271, -2658, 2780, -1123, -4594, 3295, 2686, -2597, 3252, 718, -1965, 2285, 3428, 1678, 960, -4899, -4051, -2636, 1385, 2626, 2157, -2263, -159, 3938, -3407, 2096, -3967, -507, 4768, 2873, 4935, 4109, -4904, -4619, -3439, 739, 584, 923, 3499, 1731, -3151, 442, 3606, 1850, 3287, 1040, -2231, 4223, -3412, 1467, -2917, -1600, -3842, 606, 1938, 4463, -4080, 3366, 758, 4685, 4023, -4771, 4298, 4356, 470, -1825, -804, -3317, 4988, 2619, -2054, -2810, 3275, -2531, 519, -659, 1197}, + 12987535, + }, + + { + []int{1, 0, 0, 8, 6}, + 14, + }, + + { + []int{3, 2, 2, 2, 2, 3, 3, 3, 3}, + 4, + }, + + { + []int{2, 2, 2, 2, 2, 3, 3, 3, 3}, + 4, + }, + + { + []int{1, 1, 2, 3}, + 3, + }, + + { + []int{1, 2, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_minMoves2(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minMoves2(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_minMoves2(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minMoves2(tc.nums) + } + } +} diff --git a/Algorithms/0463.island-perimeter/README.md b/Algorithms/0463.island-perimeter/README.md new file mode 100755 index 000000000..f043f55e3 --- /dev/null +++ b/Algorithms/0463.island-perimeter/README.md @@ -0,0 +1,23 @@ +# [463. Island Perimeter](https://leetcode.com/problems/island-perimeter/) + +## 题目 + +You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island. + +Example: + +```text +[[0,1,0,0], + [1,1,1,0], + [0,1,0,0], + [1,1,0,0]] + +Answer: 16 +Explanation: The perimeter is the 16 yellow stripes in the image below: +``` + +![pic](https://leetcode.com/static/images/problemset/island.png) + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0463.island-perimeter/island-perimeter.go b/Algorithms/0463.island-perimeter/island-perimeter.go new file mode 100755 index 000000000..0510bed45 --- /dev/null +++ b/Algorithms/0463.island-perimeter/island-perimeter.go @@ -0,0 +1,27 @@ +package problem0463 + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +func islandPerimeter(grid [][]int) int { + m, n := len(grid), len(grid[0]) + + res := 0 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] == 0 { + continue + } + res += 4 + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && 0 <= y && y < n && grid[x][y] == 1 { + res-- + } + } + } + } + + return res +} diff --git a/Algorithms/0463.island-perimeter/island-perimeter_test.go b/Algorithms/0463.island-perimeter/island-perimeter_test.go new file mode 100755 index 000000000..495a19e09 --- /dev/null +++ b/Algorithms/0463.island-perimeter/island-perimeter_test.go @@ -0,0 +1,44 @@ +package problem0463 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{ + {0, 1, 0, 0}, + {1, 1, 1, 0}, + {0, 1, 0, 0}, + {1, 1, 0, 0}, + }, + 16, + }, + + // 可以有多个 testcase +} + +func Test_islandPerimeter(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, islandPerimeter(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_islandPerimeter(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + islandPerimeter(tc.grid) + } + } +} diff --git a/Algorithms/0464.can-i-win/464.100.png b/Algorithms/0464.can-i-win/464.100.png new file mode 100644 index 000000000..23b22ea01 Binary files /dev/null and b/Algorithms/0464.can-i-win/464.100.png differ diff --git a/Algorithms/0464.can-i-win/README.md b/Algorithms/0464.can-i-win/README.md new file mode 100755 index 000000000..1dfbda216 --- /dev/null +++ b/Algorithms/0464.can-i-win/README.md @@ -0,0 +1,37 @@ +# [464. Can I Win](https://leetcode.com/problems/can-i-win/) + +## 题目 + +In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins. + +What if we change the game so that players cannot re-use integers? + +For example, two players might take turns drawing from a common pool of numbers of 1..15 without replacement until they reach a total >= 100. + +Given an integer maxChoosableInteger and another integer desiredTotal, determine if the first player to move can force a win, assuming both players play optimally. + +You can always assume that maxChoosableInteger will not be larger than 20 and desiredTotal will not be larger than 300. + +Example + +```text +Input: +maxChoosableInteger = 10 +desiredTotal = 11 + +Output: +false + +Explanation: +No matter which integer the first player choose, the first player will lose. +The first player can choose an integer from 1 up to 10. +If the first player choose 1, the second player can only choose integers from 2 up to 10. +The second player will win by choosing 10 and get a total = 11, which is >= desiredTotal. +Same with other integers chosen by the first player, the second player will always win. +``` + +## 解题思路 + +见程序注释 + +![100](464.100.png) \ No newline at end of file diff --git a/Algorithms/0464.can-i-win/can-i-win.go b/Algorithms/0464.can-i-win/can-i-win.go new file mode 100755 index 000000000..35f316de8 --- /dev/null +++ b/Algorithms/0464.can-i-win/can-i-win.go @@ -0,0 +1,81 @@ +package problem0464 + +// 影响成败的关键因素有两个 +// 1. 还能选择的数字 +// 2. 还需要累加的值 +// 这两个又其实只是一个因素 -- 已经使用过的数,因为 +// 1. 还能选择的数字 == 全部可选的数 - 已经使用过的数 +// 2. 还需要累加的值 == desiredTotal - sum(已经使用过的数) +// 题目想要求解的是 "已经使用过的数" == nil 时,能不能赢 +// +// 相同的 “已经使用过的数” 会导致相同的结果 +// 利用暴力算法 dfs 计算结果的时候,会多次遇到同样的 "已经使用过的数" 状态 +// 把各个 “已经使用过的数” 状态导致的结果,保存起来,就可以加快程序速度了 +// +// 使用 int 这个可比较的变量 表征 “已经使用过的数” 的状态 +// 42 表示 数字 1,3,5 都被使用过了,因为 42 = 2^1 + 2^3 + 2^5 +// 42 的第 1,3,5 个 bit 位上的数字为 1 + +func canIWin(maxChoosableInteger int, desiredTotal int) bool { + // sum 是所有能选数之和 + sum := (1 + maxChoosableInteger) * maxChoosableInteger / 2 + // 这种情况下,双方都不能赢 + if sum < desiredTotal { + return false + } + + // bit[i] 等于,仅在第 i 个 bit 位为 1 的整数值 + bit := make([]int, maxChoosableInteger+1) + for i := maxChoosableInteger; i > 0; i-- { + bit[i] = 1 << uint8(i) + } + + // dp[42] == true 表示 + // 面临 1,3,5 被选择的人,有机会赢 + dp := make(map[int]bool, maxChoosableInteger*maxChoosableInteger) + + return dfs(0, desiredTotal, maxChoosableInteger, dp, bit) +} + +func dfs(usedBit, remains, max int, dp map[int]bool, bit []int) bool { + // 已经计算过 usedBit 这种状态了,直接返回结果 + if res, ok := dp[usedBit]; ok { + return res + } + + if remains <= max { + for i := max; i >= remains; i-- { + if usedBit&bit[i] == 0 { + dp[usedBit] = true + return true + } + } + } + + for i := max; i > 0; i-- { + if usedBit&bit[i] > 0 { + // i 已经被使用过了 + continue + } + + old := usedBit + // 暂时选择 i ,往 usedBit 中添加 i + usedBit |= bit[i] + isOpponentWin := dfs(usedBit, remains-i, max, dp, bit) + // 在 usedBit 中删除 i + usedBit = old + // usedBit &= (^bit[i]) + + if isOpponentWin == false { // 对手输了 + // 所以,是我赢了 + // 请注意,下面的 usedBit 是删除了 i 的 + // 此时的 dp[usedBit] = true 表示 + // 我在面临 usedBit 这种状态下能赢,因为可以选择 i + dp[usedBit] = true + return true + } + } + + dp[usedBit] = false + return false +} diff --git a/Algorithms/0464.can-i-win/can-i-win_test.go b/Algorithms/0464.can-i-win/can-i-win_test.go new file mode 100755 index 000000000..4d4a34bf5 --- /dev/null +++ b/Algorithms/0464.can-i-win/can-i-win_test.go @@ -0,0 +1,77 @@ +package problem0464 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + maxChoosableInteger int + desiredTotal int + ans bool +}{ + + { + 11, + 25, + true, + }, + + { + 10, + 0, + true, + }, + + { + 20, + 160, + true, + }, + + { + 20, + 300, + false, + }, + + { + 20, + 209, + false, + }, + + { + 10, + 20, + true, + }, + + { + 10, + 11, + false, + }, + + // 可以有多个 testcase +} + +func Test_canIWin(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canIWin(tc.maxChoosableInteger, tc.desiredTotal), "输入:%v", tc) + } +} + +func Benchmark_canIWin(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canIWin(tc.maxChoosableInteger, tc.desiredTotal) + } + } +} diff --git a/Algorithms/0466.count-the-repetitions/466.100.png b/Algorithms/0466.count-the-repetitions/466.100.png new file mode 100644 index 000000000..04e2edffd Binary files /dev/null and b/Algorithms/0466.count-the-repetitions/466.100.png differ diff --git a/Algorithms/0466.count-the-repetitions/README.md b/Algorithms/0466.count-the-repetitions/README.md new file mode 100755 index 000000000..b2e95ed12 --- /dev/null +++ b/Algorithms/0466.count-the-repetitions/README.md @@ -0,0 +1,26 @@ +# [466. Count The Repetitions](https://leetcode.com/problems/count-the-repetitions/) + +## 题目 + +Define `S = [s,n]` as the string S which consists of n connected strings s. For example, `["abc", 3]` ="abcabcabc". + +On the other hand, we define that string s1 can be obtained from string s2 if we can remove some characters from s2 such that it becomes s1. For example, “abc” can be obtained from “abdbec” based on our definition, but it can not be obtained from “acbbe”. + +You are given two non-empty strings s1 and s2 (each at most 100 characters long) and two integers 0 ≤ n1 ≤ 106 and 1 ≤ n2 ≤ 106. Now consider the strings S1 and S2, where S1=[s1,n1] and S2=[s2,n2]. Find the maximum integer M such that [S2,M] can be obtained from S1. + +Example: + +```text +Input: +s1="acb", n1=4 +s2="ab", n2=2 + +Return: +2 +``` + +## 解题思路 + +见程序注释 + +![100](466.100.png) \ No newline at end of file diff --git a/Algorithms/0466.count-the-repetitions/count-the-repetitions.go b/Algorithms/0466.count-the-repetitions/count-the-repetitions.go new file mode 100755 index 000000000..27f0f8531 --- /dev/null +++ b/Algorithms/0466.count-the-repetitions/count-the-repetitions.go @@ -0,0 +1,50 @@ +package problem0466 + +func getMaxRepetitions(s1 string, n1 int, s2 string, n2 int) int { + // count[k] == cnt 表示 k 个 s1 可以得到 cnt 个 s2 + count := make([]int, n1+1) + // last[j] == k (k ∈ [1,2,...n1] ) 表示在第 k + 1 个 s1 中,首先需要匹配的是 s2[j] + last := make([]int, len(s2)) + + // j 是 s2 中下一个需要被匹配的字符在 s2 中的索引号 + // cnt 是 已经完整匹配了的 s2 的个数 + j, cnt := 0, 0 + for k := 1; k <= n1; k++ { + for i := 0; i < len(s1); i++ { + if s1[i] == s2[j] { + j++ + if j == len(s2) { + j = 0 + cnt++ + } + } + } + + if last[j] == 0 { + // 还没有出现重复 + // 更新各项记录 + count[k] = cnt + last[j] = k + } else { // 出现重复的模式了 + // 第 start 个和第 k 个 s1 都需要首先匹配 s[j] + // p := k - start 的话,以此类推 + // 第 start + p, start + p * 2, start + p * 3,... 个 s1 都需要首先匹配 s[j] + // 所以 s[start:k] 构成了一个重复块, 每个重复块中需要 p 个 s1 + start := last[j] + p := k - start + // 每个重复块可以匹配 t 个 s2 + // 此时的 cnt 相当于 count[k] + t := cnt - count[start] + + // (n1-start)/p 是 n1 个 s1 可以组成的重复块的个数 + // (n1-start)/p*t 是所有完整的重复块可以匹配 s2 的个数 + // count[start+(n1-start)%p] 是剩下的,不能构成完整重复块的 s1 能够匹配的 s2 的个数 + ans := (n1-start)/p*t + count[start+(n1-start)%p] + // 题目所求的 S2 的匹配数 = s2 的匹配数 / n2 + return ans / n2 + } + } + + // 由于重复块不是一定存在 + return cnt / n2 +} diff --git a/Algorithms/0466.count-the-repetitions/count-the-repetitions_test.go b/Algorithms/0466.count-the-repetitions/count-the-repetitions_test.go new file mode 100755 index 000000000..21df5e934 --- /dev/null +++ b/Algorithms/0466.count-the-repetitions/count-the-repetitions_test.go @@ -0,0 +1,149 @@ +package problem0466 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s1 string + n1 int + s2 string + n2 int + ans int +}{ + + { + "abc", + 1, + "abc", + 1, + 1, + }, + + { + "ba", + 2, + "bababa", + 1, + 0, + }, + + { + "dcba", + 5, + "eabcd", + 1, + 0, + }, + + { + "dcba", + 5, + "abcde", + 1, + 0, + }, + + { + "aaa", + 3, + "aa", + 1, + 4, + }, + + { + "phqghumeaylnlfdxfircvscxggbwkfnqduxwfnfozvsrtkjprepggxrpnrvystmwcysyycqpevikeffmznimkkasvwsrenzkycxf", + 1000000, + "xtlsgypsfadpooefxzbcoejuvpvaboygpoeylfpbnpljvrvipyamyehwqnqrqpmxujjloovaowuxwhmsncbxcoksfzkvatxdknly", + 100, + 303, + }, + + { + "phqghumeaylnlfdxfircvscxggbwkfnqduxwfnfozvsrtkjprepggxrpnrvystmwcysyycqpevikeffmznimkkasvwsrenzkycxf", + 100, + "xtlsgypsfa", + 1, + 49, + }, + + { + "lovelive", + 100000, + "lovelive", + 100000, + 1, + }, + + { + "aaa", + 20, + "aaaaa", + 1, + 12, + }, + + { + "aaaaa", + 8, + "ab", + 2, + 0, + }, + + { + "aaaaa", + 8, + "aa", + 2, + 10, + }, + + { + "acb", + 6, + "abc", + 1, + 3, + }, + + { + "acb", + 6, + "ab", + 2, + 3, + }, + + { + "acb", + 4, + "ab", + 2, + 2, + }, + + // 可以有多个 testcase +} + +func Test_getMaxRepetitions(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, getMaxRepetitions(tc.s1, tc.n1, tc.s2, tc.n2), "输入:%v", tc) + } +} + +func Benchmark_getMaxRepetitions(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + getMaxRepetitions(tc.s1, tc.n1, tc.s2, tc.n2) + } + } +} diff --git a/Algorithms/0467.unique-substrings-in-wraparound-string/467.100.png b/Algorithms/0467.unique-substrings-in-wraparound-string/467.100.png new file mode 100644 index 000000000..8940781e9 Binary files /dev/null and b/Algorithms/0467.unique-substrings-in-wraparound-string/467.100.png differ diff --git a/Algorithms/0467.unique-substrings-in-wraparound-string/README.md b/Algorithms/0467.unique-substrings-in-wraparound-string/README.md new file mode 100755 index 000000000..e8cecfb01 --- /dev/null +++ b/Algorithms/0467.unique-substrings-in-wraparound-string/README.md @@ -0,0 +1,40 @@ +# [467. Unique Substrings in Wraparound String](https://leetcode.com/problems/unique-substrings-in-wraparound-string/) + +## 题目 + +Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....". + +Now we have another string p. Your job is to find out how many unique non-empty substrings of p are present in s. In particular, your input is the string p and you need to output the number of different non-empty substrings of p in the string s. + +Note: p consists of only lowercase English letters and the size of p might be over 10000. + +Example 1: + +```text +Input: "a" +Output: 1 + +Explanation: Only the substring "a" of string "a" is in the string s. +``` + +Example 2: + +```text +Input: "cac" +Output: 2 +Explanation: There are two substrings "a", "c" of string "cac" in the string s. +``` + +Example 3: + +```text +Input: "zab" +Output: 6 +Explanation: There are six substrings "z", "a", "b", "za", "ab", "zab" of string "zab" in the string s. +``` + +## 解题思路 + +见程序注释 + +![100](467.100.png) \ No newline at end of file diff --git a/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string.go b/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string.go new file mode 100755 index 000000000..6fe5de22d --- /dev/null +++ b/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string.go @@ -0,0 +1,37 @@ +package problem0467 + +func findSubstringInWraproundString(p string) int { + // count[0] = 4 表示,以 'a' 结尾的连续字符串的最大长度为 4 + // 那么,在符合题意的 subString 中以 'a' 结尾的个数为 4 + // 这样统计起来,既不会遗漏也不会重复 + // + count := [26]int{} + + length := 0 + + for i := 0; i < len(p); i++ { + if 0 < i && + (p[i-1]+1 == p[i] || p[i-1] == p[i]+25) { + length++ + } else { + length = 1 + } + + b := p[i] - 'a' + count[b] = max(count[b], length) + } + + res := 0 + for i := 0; i < 26; i++ { + res += count[i] + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string_test.go b/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string_test.go new file mode 100755 index 000000000..76b4df147 --- /dev/null +++ b/Algorithms/0467.unique-substrings-in-wraparound-string/unique-substrings-in-wraparound-string_test.go @@ -0,0 +1,89 @@ +package problem0467 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + p string + ans int +}{ + + { + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", + 259259, + }, + + { + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", + 33475, + }, + + { + "abce", + 7, + }, + + { + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", + 2379, + }, + + { + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", + 1027, + }, + + { + "abcdcde", + 13, + }, + + { + "abcdabc", + 10, + }, + + { + "abcd", + 10, + }, + + { + "a", + 1, + }, + + { + "cac", + 2, + }, + + { + "zab", + 6, + }, + + // 可以有多个 testcase +} + +func Test_findSubstringInWraproundString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findSubstringInWraproundString(tc.p), "输入:%v", tc) + } +} + +func Benchmark_findSubstringInWraproundString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findSubstringInWraproundString(tc.p) + } + } +} diff --git a/Algorithms/0468.validate-ip-address/README.md b/Algorithms/0468.validate-ip-address/README.md new file mode 100755 index 000000000..cbc4591ee --- /dev/null +++ b/Algorithms/0468.validate-ip-address/README.md @@ -0,0 +1,52 @@ +# [468. Validate IP Address](https://leetcode.com/problems/validate-ip-address/) + +## 题目 + +Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. + +IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots ("."), e.g.,172.16.254.1; + +Besides, leading zeros in the IPv4 is invalid. For example, the address 172.16.254.01 is invalid. + +IPv6 addresses are represented as eight groups of four hexadecimal digits, each group representing 16 bits. The groups are separated by colons (":"). For example, the address 2001:0db8:85a3:0000:0000:8a2e:0370:7334 is a valid one. Also, we could omit some leading zeros among four hexadecimal digits and some low-case characters in the address to upper-case ones, so 2001:db8:85a3:0:0:8A2E:0370:7334 is also a valid IPv6 address(Omit leading zeros and using upper cases). + +However, we don't replace a consecutive group of zero value with a single empty group using two consecutive colons (::) to pursue simplicity. For example, 2001:0db8:85a3::8A2E:0370:7334 is an invalid IPv6 address. + +Besides, extra leading zeros in the IPv6 is also invalid. For example, the address 02001:0db8:85a3:0000:0000:8a2e:0370:7334 is invalid. + +Note: +You may assume there is no extra space or special characters in the input string. + +Example 1: + +```text +Input: "172.16.254.1" + +Output: "IPv4" + +Explanation: This is a valid IPv4 address, return "IPv4". +``` + +Example 2: + +```text +Input: "2001:0db8:85a3:0:0:8A2E:0370:7334" + +Output: "IPv6" + +Explanation: This is a valid IPv6 address, return "IPv6". +``` + +Example 3: + +```text +Input: "256.256.256.256" + +Output: "Neither" + +Explanation: This is neither a IPv4 address nor a IPv6 address. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0468.validate-ip-address/validate-ip-address.go b/Algorithms/0468.validate-ip-address/validate-ip-address.go new file mode 100755 index 000000000..1c93647ef --- /dev/null +++ b/Algorithms/0468.validate-ip-address/validate-ip-address.go @@ -0,0 +1,88 @@ +package problem0468 + +import ( + "strconv" + "strings" +) + +func validIPAddress(IP string) string { + switch { + case isIPv4(IP): + return "IPv4" + case isIPv6(IP): + return "IPv6" + default: + return "Neither" + } +} + +func isIPv4(IP string) bool { + if !strings.Contains(IP, ".") { + return false + } + + ss := strings.Split(IP, ".") + + if len(ss) != 4 { + return false + } + + for _, s := range ss { + if !isV4Num(s) { + return false + } + } + + return true +} + +func isV4Num(s string) bool { + if len(s) == 0 { + return false + } + + if len(s) > 1 && + (s[0] < '1' || '9' < s[0]) { + return false + } + + n, err := strconv.Atoi(s) + + return err == nil && 0 <= n && n < 256 +} + +func isIPv6(IP string) bool { + if !strings.Contains(IP, ":") { + return false + } + + ss := strings.Split(IP, ":") + + if len(ss) != 8 { + return false + } + + for _, s := range ss { + if !isV6Num(s) { + return false + } + } + + return true +} + +func isV6Num(s string) bool { + if len(s) == 0 || len(s) > 4 { + return false + } + + if !('0' <= s[0] && s[0] <= '9') && + !('a' <= s[0] && s[0] <= 'z') && + !('A' <= s[0] && s[0] <= 'Z') { + return false + } + + n, err := strconv.ParseInt(s, 16, 64) + + return err == nil && 0 <= n && n < 1<<16 +} diff --git a/Algorithms/0468.validate-ip-address/validate-ip-address_test.go b/Algorithms/0468.validate-ip-address/validate-ip-address_test.go new file mode 100755 index 000000000..81e1dba65 --- /dev/null +++ b/Algorithms/0468.validate-ip-address/validate-ip-address_test.go @@ -0,0 +1,84 @@ +package problem0468 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + IP string + ans string +}{ + + { + "1081:db8:85a3:01:-0:8A2E:0370:7334", + "Neither", + }, + + { + "2001:0db8:85a3:0000:0:8A2E:0370:733a", + "IPv6", + }, + + { + "0.0.0.-0", + "Neither", + }, + + { + "2001:0db8:85a3:0:0:8A2E:0370:7334", + "IPv6", + }, + + { + "172.16.254.1", + "IPv4", + }, + + { + "0db8:85a3:00000:0:8A2E:0370:7334", + "Neither", + }, + + { + "2001:0db8:85a3:00000:0:8A2E:0370:7334", + "Neither", + }, + + { + "56.256.256", + "Neither", + }, + + { + "25.25..25", + "Neither", + }, + + { + "256.256.256.256", + "Neither", + }, + + // 可以有多个 testcase +} + +func Test_validIPAddress(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, validIPAddress(tc.IP), "输入:%v", tc) + } +} + +func Benchmark_validIPAddress(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validIPAddress(tc.IP) + } + } +} diff --git a/Algorithms/0470.implement-rand10-using-rand7/README.md b/Algorithms/0470.implement-rand10-using-rand7/README.md new file mode 100755 index 000000000..586702b80 --- /dev/null +++ b/Algorithms/0470.implement-rand10-using-rand7/README.md @@ -0,0 +1,42 @@ +# [470. Implement Rand10() Using Rand7()](https://leetcode.com/problems/implement-rand10-using-rand7/) + +## 题目 + +Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10which generates a uniform random integer in the range 1 to 10. + +Do NOT use system's Math.random(). + +Example 1: + +```text +Input: 1 +Output: [7] +``` + +Example 2: + +```text +Input: 2 +Output: [8,4] +``` + +Example 3: + +```text +Input: 3 +Output: [8,1,10] +``` + +Note: + +1. rand7 is predefined. +1. Each testcase has one argument:n, the number of times that rand10 is called. + +Follow up: + +1. What is the expected valuefor the number of calls torand7()function? +1. Could you minimize the number of calls to rand7()? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7.go b/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7.go new file mode 100755 index 000000000..3efb88a8f --- /dev/null +++ b/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7.go @@ -0,0 +1,21 @@ +package problem0470 + +import "math/rand" + +func rand10() int { + t := 50 + for t > 39 { + t = 7*(rand7()-1) + (rand7() - 1) + // t 的取值范围为 [0,48],每个数字出现的概率都是为 1/49 + } + // t 的范围是 [0,39],t 出现在这个范围内的概率是 40/49 + // 当 t 为 3, 13, 23 或 33 的时候, t%10+1 == 4 + // 返回 4 的概率 = (4 * 1/49) / (40/49) == 1/10 + // 同理可知,返回 [1,10] 中每个数字的概率都是 1/10 + // 符合题意 + return t%10 + 1 +} + +func rand7() int { + return rand.Intn(7) + 1 +} diff --git a/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7_test.go b/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7_test.go new file mode 100755 index 000000000..a34dab804 --- /dev/null +++ b/Algorithms/0470.implement-rand10-using-rand7/implement-rand10-using-rand7_test.go @@ -0,0 +1,21 @@ +package problem0470 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_rand10(t *testing.T) { + ast := assert.New(t) + for i := 0; i < 100; i++ { + r := rand10() + ast.True(1 <= r && r <= 10) + } +} + +func Benchmark_rand10(b *testing.B) { + for i := 0; i < b.N; i++ { + rand10() + } +} diff --git a/Algorithms/0472.concatenated-words/472.100.png b/Algorithms/0472.concatenated-words/472.100.png new file mode 100644 index 000000000..841e791ee Binary files /dev/null and b/Algorithms/0472.concatenated-words/472.100.png differ diff --git a/Algorithms/0472.concatenated-words/README.md b/Algorithms/0472.concatenated-words/README.md new file mode 100755 index 000000000..1da9997d2 --- /dev/null +++ b/Algorithms/0472.concatenated-words/README.md @@ -0,0 +1,30 @@ +# [472. Concatenated Words](https://leetcode.com/problems/concatenated-words/) + +## 题目 + +Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. + +A concatenated word is defined as a string that is comprised entirely of at least two shorter words in the given array. + +Example: + +```text +Input: ["cat","cats","catsdogcats","dog","dogcatsdog","hippopotamuses","rat","ratcatdogcat"] + +Output: ["catsdogcats","dogcatsdog","ratcatdogcat"] + +Explanation: "catsdogcats" can be concatenated by "cats", "dog" and "cats"; "dogcatsdog" can be concatenated by "dog", "cats" and "dog"; "ratcatdogcat" can be concatenated by "rat", "cat", "dog" and "cat". +``` + +Note: + +1. The number of elements of the given array will not exceed 10,000 +1. The length sum of elements in the given array will not exceed 600,000. +1. All the input string will only include lower case letters. +1. The returned elements order does not matter. + +## 解题思路 + +见程序注释 + +![100](472.100.png) \ No newline at end of file diff --git a/Algorithms/0472.concatenated-words/concatenated-words.go b/Algorithms/0472.concatenated-words/concatenated-words.go new file mode 100755 index 000000000..f0f5e37f3 --- /dev/null +++ b/Algorithms/0472.concatenated-words/concatenated-words.go @@ -0,0 +1,40 @@ +package problem0472 + +func findAllConcatenatedWordsInADict(words []string) []string { + // hasLen[3] == true 表示,words 中存在长度为 3 的单词 + hasLen := make(map[int]bool, len(words)) + // hasWord["dog"] == true 表示, words 中存在单词 "dog" + hasWord := make(map[string]bool, len(words)) + for _, word := range words { + hasLen[len(word)] = true + hasWord[word] = true + } + + res := make([]string, 0, len(words)) + for _, word := range words { + if isConcatenated(word, hasLen, hasWord, false) { + res = append(res, word) + } + } + + return res +} + +func isConcatenated(word string, hasLen map[int]bool, hasWord map[string]bool, isCutted bool) bool { + for wLen := 1; wLen < len(word); wLen++ { + if hasLen[wLen] && + // word[:wLen] 非常耗时, + // 只有当 wrods 存在长度为 wLen 的单词时 + // 才检查 word[:wLen] 是否存在 + hasWord[word[:wLen]] && + isConcatenated(word[wLen:], hasLen, hasWord, true) { + return true + } + } + + // 单词是完整的时候,会匹配到自己, 需要剔除这种情况 + // 只能对被切除过的部分,进行全单词匹配 + return isCutted && + hasLen[len(word)] && + hasWord[word] +} diff --git a/Algorithms/0472.concatenated-words/concatenated-words_test.go b/Algorithms/0472.concatenated-words/concatenated-words_test.go new file mode 100755 index 000000000..df9f27d31 --- /dev/null +++ b/Algorithms/0472.concatenated-words/concatenated-words_test.go @@ -0,0 +1,63 @@ +package problem0472 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans []string +}{ + + { + []string{"a", "abc", "e"}, + []string{}, + }, + + { + []string{"rfkqyuqfjkx", "", "vnrtysfrzrmzl", "gfve", "qfpd", "lqdqrrcrwdnxeuo", "q", "klaitgdphcspij", "hbsfyfv", "adzpbfudkklrw", "aozmixr", "ife", "feclhbvfuk", "yeqfqojwtw", "sileeztxwjl", "ngbqqmbxqcqp", "khhqr", "dwfcayssyoqc", "omwufbdfxu", "zhift", "kczvhsybloet", "crfhpxprbsshsjxd", "ilebxwbcto", "yaxzfbjbkrxi", "imqpzwmshlpj", "ta", "hbuxhwadlpto", "eziwkmg", "ovqzgdixrpddzp", "c", "wnqwqecyjyib", "jy", "mjfqwltvzk", "tpvo", "phckcyufdqml", "lim", "lfz", "tgygdt", "nhcvpf", "fbrpzlk", "shwywshtdgmb", "bkkxcvg", "monmwvytby", "nuqhmfj", "qtg", "cwkuzyamnerp", "fmwevhwlezo", "ye", "hbrcewjxvcezi", "tiq", "tfsrptug", "iznorvonzjfea", "gama", "apwlmbzit", "s", "hzkosvn", "nberblt", "kggdgpljfisylt", "mf", "h", "bljvkypcflsaqe", "cijcyrgmqirz", "iaxakholawoydvch", "e", "gttxwpuk", "jf", "xbrtspfttota", "sngqvoijxuv", "bztvaal", "zxbshnrvbykjql", "zz", "mlvyoshiktodnsjj", "qplci", "lzqrxl", "qxru", "ygjtyzleizme", "inx", "lwhhjwsl", "endjvxjyghrveu", "phknqtsdtwxcktmw", "wsdthzmlmbhjkm", "u", "pbqurqfxgqlojmws", "mowsjvpvhznbsi", "hdkbdxqg", "ge", "pzchrgef", "ukmcowoe", "nwhpiid", "xdnnl", "n", "yjyssbsoc", "cdzcuunkrf", "uvouaghhcyvmlk", "aajpfpyljt", "jpyntsefxi", "wjute", "y", "pbcnmhf", "qmmidmvkn", "xmywegmtuno", "vuzygv", "uxtrdsdfzfssmel", "odjgdgzfmrazvnd", "a", "rdkugsbdpawxi", "ivd", "bbqeonycaegxfj", "lrfkraoheucsvpi", "eqrswgkaaaohxx", "hqjtkqaqh", "berbpmglbjipnuj", "wogwczlkyrde", "aqufowbig", "snjniegvdvotu", "ocedkt", "bbufnxorixibbd", "rzuqsyr", "qghoy", "evcuanuujszitaoa", "wsx", "glafbwzdd", "znrvjqeyqi", "npitruijvyllsi", "objltu", "ryp", "nvybsfrxtlfmp", "id", "zoolzslgd", "owijatklvjzscizr", "upmsoxftumyxifyu", "xucubv", "fctkqlroq", "zjv", "wzi", "ppvs", "mflvioemycnphfjt", "nwedtubynsb", "repgcx", "gsfomhvpmy", "kdohe", "tyycsibbeaxn", "wjkfvabn", "llkmagl", "thkglauzgkeuly", "paeurdvexqlw", "akdt", "ihmfrj", "janxk", "rqdll", "cyhbsuxnlftmjc", "yybwsjmajbwtuhkk", "ovytgaufpjl", "iwbnzhybsx", "mumbh", "jqmdabmyu", "br", "lwstjkoxbczkj", "vhsgzvwiixxaob", "fso", "qnebmfl", "ooetjiz", "lq", "msxphqdgz", "mqhoggvrvjqrp", "xbhkkfg", "zxjegsyovdrmw", "jav", "mshoj", "ax", "biztkfomz", "hujdmcyxdqteqja", "gqgsomonv", "reqqzzpw", "lihdnvud", "lznfhbaokxvce", "fhxbldylqqewdnj", "rlbskqgfvn", "lfvobeyolyy", "v", "iwh", "fpbuiujlolnjl", "gvwxljbo", "ypaotdzjxxrsc", "mwrvel", "umzpnoiei", "ogwilaswn", "yw", "egdgye", "hsrznlzrf", "mwdgxaigmxpy", "yaqgault", "dtlg", "cyvfiykmkllf", "zxqyhvizqmamj", "lvvgoifltzywueyp", "abinmy", "ppzaecvmx", "qsmzc", "iddymnl", "uskihek", "evxtehxtbthq", "jvtfzddlgch", "czohpyewf", "ufzazyxtqxcu", "brxpfymuvfvs", "xrrcfuusicc", "aqhlswbzievij", "rv", "udvmara", "upityz", "fecd", "suxteeitxtg", "dfuydrtbfypbn", "cypqodxr", "wikfuxwjht", "jrliuaifpp", "vkmxys", "wvpfyfpkvgthq", "rmajxis", "jncxgviyu", "av", "nmhskodmidaj", "lkfrimprrhen", "uip", "hstyopbvuiqc", "p", "vwduwmjpblqo", "fnxwgqtvwztje", "xwnbcuggl", "iehimvoymyjasin", "spsqiu", "flhyfac", "mqrbq", "pstsxhplrrmbeddv", "hnegtuxx", "alsyxezjwtlwmxv", "jtxytykkcku", "bhhlovgcx", "xhhivxnutkx", "had", "aysulvk", "m", "anhsyxli", "jdkgfc", "potn", "lcibpxkidmwexp", "gwoxjicdkv", "tltienw", "ngiutnuqbzi", "o", "tzlyb", "vumnwehj", "os", "np", "lhv", "uzvgyeette", "ipfvr", "lpprjjalchhhcmh", "k", "pciulccqssaqgd", "tp", "dmzdzveslyjad", "wtsbhgkd", "eouxbldsxzm", "vhtonlampljgzyve", "xhnlcrldtfthul", "xhflc", "upgei", "rlaks", "yfqvnvtnqspyjbxr", "phouoyhvls", "voibuvbhhjcdflvl", "rgorfbjrofokggaf", "dqhqats", "zchpicyuawpovm", "yzwfor", "koat", "pybf", "fhdzsbiyjld", "gznfnqydisn", "xz", "po", "tcjup", "wygsnxk", "kqlima", "fgxnuohrnhg", "publurhztntgmimc", "zuufzphd", "iucrmmmjqtcey", "wnnbq", "rghzyz", "ukjqsjbmp", "mdtrgv", "vyeikgjdnml", "kxwldnmi", "apzuhsbssaxj", "tkbkoljyodlipof", "nkq", "ktwtj", "vgmkgjwle", "t", "agylw", "vomtuy", "jbtvitkqn", "vtdxwrclpspcn", "rdrls", "yxfeoh", "upj", "myctacn", "fdnor", "ahqghzhoqprgkym", "phiuvdv", "jp", "fdgpouzjwbq", "hqoyefmugjvewhxu", "qfzwuwe", "fnsbijkeepyxry", "oja", "qthkcij", "zpmqfbmnr", "ybaibmzonzqlnmd", "svo", "gjftyfehik", "jfrfgznuaytvaegm", "aljhrx", "odjq", "ogwaxrssjxgvnka", "zaqswwofedxj", "lugpktauixp", "dc", "odknlbvxrs", "jeobu", "vqythyvzxbcgrlbg", "hwc", "erpbaxq", "ujxcxck", "rrklkb", "wlrwyuy", "zmg", "yyhga", "xwdbycdu", "htedgvsrhchox", "wr", "suhesetv", "jonqwhkwezjvjgg", "sqqyrxtjkcalswq", "hvyimhe", "pjzdkmoue", "zbphmgoxq", "lbdlcumdgixjbcq", "ztzdjqmadthtdmv", "qcagsyqggcf", "if", "jpjxcjyi", "chyicqibxdgkqtg", "iwpdklhum", "wljmg", "micmun", "npdbamofynykqv", "ijsnfkpfy", "lmq", "oyjmeqvhcrvgm", "mqopusqktdthpvz", "fz", "r", "qbsqtipq", "nxtsnason", "xbpipyhh", "topsuqomfjrd", "islif", "gbndakaq", "bwnkxnwpzeoohlx", "hrtbfnq", "fguvomeepxoffg", "mat", "dzfpfnwbfuj", "onlvy", "cwcchvsasdylb", "rxfcztzqopdi", "ybrhodjn", "oqkijy", "ncvrjo", "dphbfaal", "xgtpdtkz", "sebevsopjvciwljf", "rcumyacqdapwczen", "mabkapuoud", "pbozezeygljfftvy", "bvazmzbndl", "vl", "qiaixdtbhqvlzd", "ffjfb", "svthrfmkoxbho", "cvet", "ucgqyvopafyttrh", "lbgihet", "naiqyufxffdw", "vruh", "uz", "ukffmudygjavem", "dccamymhp", "wofwgjkykm", "fbuujzxhln", "kmm", "lzandlltowjpwsal", "fapfvrmezbsjxs", "wiw", "sc", "soqlh", "hzaplclkwl", "gcdqbcdwbwa", "gadgt", "pgowefka", "juffuguqepwnfh", "nbuinl", "cpdxf", "sox", "fq", "lfnrhgsxkhx", "xrcorfygjxpi", "mwtqjwbhgh", "loc", "fkglorkkvx", "nlzdhucvayrz", "azefobxutitrf", "rlrstkcbtikklmh", "ggk", "sbphcejuylh", "nraoenhd", "zngyodiqlchxyycx", "rrbhfwohfv", "krzolrglgn", "cpjesdzy", "yoifoyg", "hqqevqjugi", "ahmv", "xgaujnyclcjq", "evhyfnlohavrj", "byyvhgh", "hyw", "kedhvwy", "ysljsqminajfipds", "rglnpxfqwu", "cibpynkxg", "su", "mbntqrlwyampdg", "nig", "ldhlhqdyjcfhu", "jfymrbafmyoc", "tyjmnhlfnrtz", "dlazixtlxyvm", "fbiguhsfuqo", "rhymsno", "rkbdlchs", "ocbbwwd", "astaiamnepwkya", "mplirup", "edkxjq", "g", "exlwulswtvot", "tlnc", "vnrrzerz", "ygeraoozbtt", "yyifkin", "eo", "ua", "qgztvqdolf", "rlzddjzcshvd", "khxkdxflwxme", "kk", "zylbhoaac", "cw", "iizic", "gcdxstpz", "kjwdqeg", "earjrncmmkdel", "kbesuhquepj", "nrzbllldgdmyrpgl", "hllwnqozf", "djpchowhwevbqvjj", "zsmhylnjpktb", "pxnktxkm", "fxwiaqqb", "qjwufmwresfsfaok", "aa", "d", "iobioqm", "svjgzk", "khbzp", "euexyudhrioi", "yqsj", "ngrwqpoh", "rwuvd", "eruffmlg", "bxzovyew", "faz", "pmvfvyguqdi", "jlxnoixsy", "hyfrdngjf", "ly", "eibcapetpmeaid", "tpnwwiif", "pfgsp", "kvhhwkzvtvlhhb", "pjxurgqbtldims", "rncplkeweoirje", "akyprzzphew", "wyvfpjyglzrmhfqp", "ubheeqt", "rmbxlcmn", "taqakgim", "apsbu", "khwnykughmwrlk", "vtdlzwpbhcsbvjno", "tffmjggrmyil", "schgwrrzt", "mvndmua", "nlwpw", "glvbtkegzjs", "piwllpgnlpcnezqs", "xkelind", "urtxsezrwz", "zechoc", "vfaimxrqnyiq", "ybugjsblhzfravzn", "btgcpqwovwp", "zgxgodlhmix", "sfzdknoxzassc", "wgzvqkxuqrsqxs", "dwneyqisozq", "fg", "vhfsf", "uspujvqhydw", "eadosqafyxbmzgr", "tyff", "blolplosqnfcwx", "uwkl", "puenodlvotb", "iizudxqjvfnky", "cjcywjkfvukvveq", "jrxd", "igwb", "dftdyelydzyummmt", "uvfmaicednym", "oai", "higfkfavgeemcgo", "naefganqo", "iqebfibigljbc", "ulicojzjfrc", "igxprunj", "cymbrl", "fqmwciqtynca", "zjyagi", "mzuejrttefhdwqc", "zyiurxvf", "wrjxffzbjexsh", "wrxw", "mhrbdxjwi", "htknfa", "wfrvxqdkhbwwef", "vqsghhhutdget", "cwupzrts", "hbjnb", "wpccoa", "nx", "howbzhaoscgyk", "bilt", "wqqatye", "zceuuwg", "jxzon", "kkfj", "bwsezd", "ifdegsyjtswselk", "xweimxlnzoh", "tqthlftjblnpht", "ww", "ss", "b", "jmruuqscwjp", "nxbk", "wd", "cqkrtbxgzg", "xhppcjnq", "cfq", "tkkolzcfi", "wblxki", "ijeglxsvc", "kcqjjwcwuhvzydm", "gubqavlqffhrzz", "hiwxrgftittd", "caybc", "ncsyjlzlxyyklc", "poxcgnexmaajzuha", "dhaccuualacyl", "mtkewbprs", "oncggqvr", "sqqoffmwkplsgbrp", "ioajuppvqluhbdet", "dzwwzaelmo", "afumtqugec", "wglucmugwqi", "zveswrjevfz", "nxlbkak", "pzcejvxzeoybb", "fd", "vewj", "ivws", "zjhudtpqsfc", "zcmukotirrxx", "zksmx", "umofzhhowyftz", "zbotrokaxaryxlk", "ueolqk", "dxmzhoq", "zvu", "cjl", "esfmqgvxwfy", "npbep", "vbgjtbv", "poeugoqynkbfiv", "fewjjscjrei", "yqssxzsydgllfzmo", "urxkwcypctjkabi", "wqtldwhjouas", "tovdtkr", "onzgeyddkqwuhnim", "ffxviyvsktqrfa", "qujhd", "pvcz", "hiyjlkxmeplnrvxg", "hdykehkefp", "vepcxhozpjxtreyn", "liguhuxudbnh", "f", "ordxzm", "klgohcmmbukz", "yrmooliaobbnlap", "dutnbetocxylcey", "ywdsjegd", "cr", "blbxhjsgcuoxmqft", "ngzdc", "srfyjjumcbxole", "dazwzwtdjoyuqeqj", "xazjarqgfm", "fxyfqbeoktcc", "qrsjchxp", "iltaqzawhgu", "sgenjcfxr", "yfikp", "dvwhbyumthkiktb", "walsx", "jyajrkcvysicisab", "brdeumb", "tviihjwxdcz", "dnrrgmem", "ydgxlrjzucxyid", "cdvdpvjlagwmg", "ngnpxjkxims", "gvyhnchlimsxc", "w", "jtizpezjl", "qe", "rjzv", "vhnqvi", "qm", "iedzqswrsnfmnn", "lt", "utqfcqyrrwm", "wtelvsqrru", "fjwrhjcrtbcytn", "qmqxceuohpiffaq", "rmoybqjjgdyo", "pmxttqftypfexlv", "tg", "qa", "iqbqjlnpbf", "kgaynkddbzllecd", "tccvslp", "curkxfoimnw", "fvnyqkzlheruxr", "iiygnzfov", "coqs", "oa", "eiu", "vzemmxtklis", "lxu", "nrwsjaxzwmh", "tdayz", "oxbbemejgosgcynf", "ykbcn", "hesvnctfvdsp", "ku", "rjhykpadahbhj", "at", "sxlngbtxmqr", "wqrom", "qzyabzrco", "rbbyklndcqdj", "cnsmgmwmpbgjq", "krvnaf", "qrwfajnfahyqocdb", "fnlaozmff", "vmoymbmytjvfcgt", "cijyy", "jdgwjbztl", "swmalgbgpaplqgz", "hfl", "typttkrpfvx", "tkzpzrscwbx", "bwfqqvjcukjbsg", "nxqmxr", "x", "eyavnz", "il", "dhthp", "eyelg", "npsoqsw", "reogbmveofvusdsx", "jvdrjkhxkq", "qzjbrpljwuzpl", "czqeevvbvcwh", "vzuszqvhlmapty", "yu", "yldwwgezlqur", "vorxwgdtgjilgydq", "pknt", "bgihl", "ckorgrm", "ixylxjmlfv", "bpoaboylced", "zea", "igfagitkrext", "ipvqq", "dmoerc", "oqxbypihdv", "dtjrrkxro", "rexuhucxpi", "bvmuyarjwqpcoywa", "qwdmfpwvamisns", "bhopoqdsref", "tmnm", "cre", "ktrniqwoofoeenbz", "vlrfcsftapyujmw", "updqikocrdyex", "bcxw", "eaum", "oklsqebuzeziisw", "fzgyhvnwjcns", "dybjywyaodsyw", "lmu", "eocfru", "ztlbggsuzctoc", "ilfzpszgrgj", "imqypqo", "fump", "sjvmsbrcfwretbie", "oxpmplpcg", "wmqigymr", "qevdyd", "gmuyytguexnyc", "hwialkbjgzc", "lmg", "gijjy", "lplrsxznfkoklxlv", "xrbasbznvxas", "twn", "bhqultkyfq", "saeq", "xbuw", "zd", "kng", "uoay", "kfykd", "armuwp", "gtghfxf", "gpucqwbihemixqmy", "jedyedimaa", "pbdrx", "toxmxzimgfao", "zlteob", "adoshnx", "ufgmypupei", "rqyex", "ljhqsaneicvaerqx", "ng", "sid", "zagpiuiia", "re", "oadojxmvgqgdodw", "jszyeruwnupqgmy", "jxigaskpj", "zpsbhgokwtfcisj", "vep", "ebwrcpafxzhb", "gjykhz", "mfomgxjphcscuxj", "iwbdvusywqlsc", "opvrnx", "mkgiwfvqfkotpdz", "inpobubzbvstk", "vubuucilxyh", "bci", "dibmye", "rlcnvnuuqfvhw", "oorbyyiigppuft", "swpksfdxicemjbf", "goabwrqdoudf", "yjutkeqakoarru", "wuznnlyd", "vfelxvtggkkk", "mxlwbkbklbwfsvr", "advraqovan", "smkln", "jxxvzdjlpyurxpj", "ssebtpznwoytjefo", "dynaiukctgrzjx", "irzosjuncvh", "hcnhhrajahitn", "vwtifcoqepqyzwya", "kddxywvgqxo", "syxngevs", "batvzmziq", "mjewiyo", "pzsupxoflq", "byzhtvvpj", "cqnlvlzr", "akvmxzbaei", "mwo", "vg", "ekfkuajjogbxhjii", "isdbplotyak", "jvkmxhtmyznha", "lqjnqzrwrmgt", "mbbhfli", "bpeohsufree", "ajrcsfogh", "lucidbnlysamvy", "tutjdfnvhahxy", "urbrmmadea", "hghv", "acnjx", "athltizloasimp", "gu", "rjfozvgmdakdhao", "iephs", "uztnpqhdl", "rfuyp", "crcszmgplszwfn", "zihegt", "xbspa", "cjbmsamjyqqrasz", "ghzlgnfoas", "ljxl", "cnumquohlcgt", "jm", "mfccj", "hfedli", "vtpieworwhyiucs", "tdtuquartspkotm", "pnkeluekvelj", "ugrloq", "zljmwt", "fkyvqguqq", "tpjidglpxqfxv", "l", "tvvimvroz", "yy", "opwyfovdz", "pwlumocnyuoume", "vjqpzkcfc", "ihicd", "dtttiixlhpikbv", "goblttgvmndkqgg", "gwsibcqahmyyeagk", "prtvoju", "lcblwidhjpu", "kbu", "pey", "gkzrpc", "bqajopjjlfthe", "bc", "lqs", "zkndgojnjnxqsoqi", "zyesldujjlp", "drswybwlfyzph", "xzluwbtmoxokk", "bedrqfui", "opajzeahv", "lehdfnr", "mnlpimduzgmwszc", "velbhj", "miwdn", "wruqc", "kscfodjxg", "wcbm"}, + []string{"gfve", "qfpd", "lqdqrrcrwdnxeuo", "hbsfyfv", "ife", "feclhbvfuk", "ngbqqmbxqcqp", "khhqr", "dwfcayssyoqc", "omwufbdfxu", "ilebxwbcto", "ta", "hbuxhwadlpto", "tpvo", "phckcyufdqml", "lfz", "tgygdt", "nhcvpf", "shwywshtdgmb", "bkkxcvg", "monmwvytby", "qtg", "cwkuzyamnerp", "ye", "tfsrptug", "gama", "nberblt", "mf", "gttxwpuk", "xbrtspfttota", "qxru", "phknqtsdtwxcktmw", "pbqurqfxgqlojmws", "hdkbdxqg", "ge", "ukmcowoe", "xdnnl", "yjyssbsoc", "uvouaghhcyvmlk", "pbcnmhf", "qmmidmvkn", "xmywegmtuno", "vuzygv", "uxtrdsdfzfssmel", "eqrswgkaaaohxx", "ocedkt", "qghoy", "wsx", "glafbwzdd", "ryp", "nvybsfrxtlfmp", "upmsoxftumyxifyu", "xucubv", "fctkqlroq", "ppvs", "nwedtubynsb", "repgcx", "gsfomhvpmy", "kdohe", "llkmagl", "thkglauzgkeuly", "paeurdvexqlw", "akdt", "rqdll", "mumbh", "br", "fso", "qnebmfl", "lq", "xbhkkfg", "ax", "gqgsomonv", "reqqzzpw", "rlbskqgfvn", "lfvobeyolyy", "mwrvel", "ogwilaswn", "yw", "egdgye", "yaqgault", "dtlg", "iddymnl", "evxtehxtbthq", "brxpfymuvfvs", "rv", "udvmara", "fecd", "dfuydrtbfypbn", "cypqodxr", "vkmxys", "wvpfyfpkvgthq", "av", "vwduwmjpblqo", "xwnbcuggl", "flhyfac", "mqrbq", "pstsxhplrrmbeddv", "hnegtuxx", "bhhlovgcx", "had", "aysulvk", "potn", "os", "np", "lhv", "uzvgyeette", "tp", "wtsbhgkd", "eouxbldsxzm", "xhnlcrldtfthul", "xhflc", "rlaks", "phouoyhvls", "dqhqats", "koat", "pybf", "po", "wygsnxk", "kqlima", "fgxnuohrnhg", "wnnbq", "mdtrgv", "nkq", "agylw", "vomtuy", "vtdxwrclpspcn", "rdrls", "yxfeoh", "myctacn", "fdnor", "qfzwuwe", "svo", "dc", "odknlbvxrs", "hwc", "erpbaxq", "rrklkb", "wlrwyuy", "yyhga", "xwdbycdu", "htedgvsrhchox", "wr", "suhesetv", "qcagsyqggcf", "wljmg", "npdbamofynykqv", "lmq", "oyjmeqvhcrvgm", "nxtsnason", "gbndakaq", "hrtbfnq", "fguvomeepxoffg", "mat", "onlvy", "cwcchvsasdylb", "dphbfaal", "mabkapuoud", "vl", "ffjfb", "svthrfmkoxbho", "cvet", "ucgqyvopafyttrh", "vruh", "ukffmudygjavem", "dccamymhp", "kmm", "sc", "soqlh", "gcdqbcdwbwa", "gadgt", "pgowefka", "cpdxf", "sox", "fq", "lfnrhgsxkhx", "loc", "fkglorkkvx", "ggk", "nraoenhd", "rrbhfwohfv", "yoifoyg", "ahmv", "byyvhgh", "hyw", "kedhvwy", "rglnpxfqwu", "su", "mbntqrlwyampdg", "jfymrbafmyoc", "rhymsno", "rkbdlchs", "ocbbwwd", "exlwulswtvot", "tlnc", "eo", "ua", "khxkdxflwxme", "kk", "cw", "pxnktxkm", "aa", "ngrwqpoh", "rwuvd", "eruffmlg", "bxzovyew", "hyfrdngjf", "ly", "pfgsp", "akyprzzphew", "ubheeqt", "rmbxlcmn", "apsbu", "khwnykughmwrlk", "mvndmua", "nlwpw", "btgcpqwovwp", "sfzdknoxzassc", "fg", "vhfsf", "tyff", "blolplosqnfcwx", "uwkl", "puenodlvotb", "naefganqo", "cymbrl", "wrxw", "htknfa", "wfrvxqdkhbwwef", "vqsghhhutdget", "wpccoa", "nx", "bilt", "wqqatye", "bwsezd", "ww", "ss", "jmruuqscwjp", "nxbk", "wd", "cfq", "gubqavlqffhrzz", "caybc", "dhaccuualacyl", "mtkewbprs", "oncggqvr", "sqqoffmwkplsgbrp", "afumtqugec", "nxlbkak", "fd", "ueolqk", "esfmqgvxwfy", "npbep", "yqssxzsydgllfzmo", "tovdtkr", "hdykehkefp", "ordxzm", "dutnbetocxylcey", "cr", "ngzdc", "fxyfqbeoktcc", "walsx", "brdeumb", "dnrrgmem", "gvyhnchlimsxc", "qe", "qm", "lt", "utqfcqyrrwm", "wtelvsqrru", "qmqxceuohpiffaq", "pmxttqftypfexlv", "tg", "qa", "tccvslp", "coqs", "oa", "lxu", "ykbcn", "hesvnctfvdsp", "ku", "at", "sxlngbtxmqr", "wqrom", "krvnaf", "hfl", "typttkrpfvx", "nxqmxr", "dhthp", "eyelg", "npsoqsw", "reogbmveofvusdsx", "yu", "pknt", "ckorgrm", "bpoaboylced", "dmoerc", "bhopoqdsref", "tmnm", "cre", "vlrfcsftapyujmw", "bcxw", "eaum", "dybjywyaodsyw", "lmu", "eocfru", "fump", "oxpmplpcg", "qevdyd", "gmuyytguexnyc", "lmg", "lplrsxznfkoklxlv", "twn", "bhqultkyfq", "saeq", "xbuw", "kng", "uoay", "kfykd", "armuwp", "gtghfxf", "pbdrx", "adoshnx", "rqyex", "ng", "sid", "re", "vep", "ebwrcpafxzhb", "opvrnx", "vubuucilxyh", "rlcnvnuuqfvhw", "goabwrqdoudf", "wuznnlyd", "vfelxvtggkkk", "mxlwbkbklbwfsvr", "advraqovan", "smkln", "kddxywvgqxo", "syxngevs", "mwo", "vg", "bpeohsufree", "lucidbnlysamvy", "urbrmmadea", "hghv", "gu", "uztnpqhdl", "rfuyp", "xbspa", "cnumquohlcgt", "tdtuquartspkotm", "ugrloq", "fkyvqguqq", "yy", "pwlumocnyuoume", "goblttgvmndkqgg", "lcblwidhjpu", "kbu", "pey", "bc", "lqs", "xzluwbtmoxokk", "lehdfnr", "wruqc", "wcbm"}, + }, + + { + []string{"a", "b", "ab", "abc"}, + []string{"ab"}, + }, + + { + []string{}, + []string{}, + }, + + { + []string{"cat", "cats", "catsdogcats", "dog", "dogcatsdog", "hippopotamuses", "rat", "ratcatdogcat"}, + []string{"catsdogcats", "dogcatsdog", "ratcatdogcat"}, + }, + + // 可以有多个 testcase +} + +func Test_findAllConcatenatedWordsInADict(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := findAllConcatenatedWordsInADict(tc.words) + sort.Strings(ans) + sort.Strings(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_findAllConcatenatedWordsInADict(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findAllConcatenatedWordsInADict(tc.words) + } + } +} diff --git a/Algorithms/0473.matchsticks-to-square/README.md b/Algorithms/0473.matchsticks-to-square/README.md new file mode 100755 index 000000000..0b7e93ae1 --- /dev/null +++ b/Algorithms/0473.matchsticks-to-square/README.md @@ -0,0 +1,34 @@ +# [473. Matchsticks to Square](https://leetcode.com/problems/matchsticks-to-square/) + +## 题目 + +Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchsticks. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time. + +Your input will be several matchsticks the girl has, represented with their stick length. Your output will either be true or false, to represent whether you could make one square using all the matchsticks the little match girl has. + +Example 1: + +```text +Input: [1,1,2,2,2] +Output: true + +Explanation: You can form a square with length 2, one side of the square came two sticks with length 1. +``` + +Example 2: + +```text +Input: [3,3,3,3,4] +Output: false +``` + +Explanation: You cannot find a way to form a square with all the matchsticks. + +Note: + +1. The length sum of the given matchsticks is in the range of 0 to 10^9. +1. The length of the given matchstick array will not exceed 15. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0473.matchsticks-to-square/matchsticks-to-square.go b/Algorithms/0473.matchsticks-to-square/matchsticks-to-square.go new file mode 100755 index 000000000..8299c5ab8 --- /dev/null +++ b/Algorithms/0473.matchsticks-to-square/matchsticks-to-square.go @@ -0,0 +1,58 @@ +package problem0473 + +import "sort" + +func makesquare(nums []int) bool { + if len(nums) < 4 { + return false + } + + // 先对nums中的数做一个基本的分析 + ok, avg := analyze(nums) + if !ok { + return false + } + + // 降序排列可以加快 dfs 的速度 + sort.Sort(sort.Reverse(sort.IntSlice(nums))) + + edges := make([]int, 4) + return dfs(nums, edges, 0, avg) +} + +func dfs(nums, edges []int, index, target int) bool { + if index == len(nums) { + if edges[0] == target && + edges[1] == target && + edges[2] == target { + return true + } + // TODO: 重新组织程序,达到完整的覆盖率 + return false + } + + for i := 0; i < 4; i++ { + if edges[i]+nums[index] > target { + continue + } + edges[i] += nums[index] + if dfs(nums, edges, index+1, target) { + return true + } + edges[i] -= nums[index] + } + + return false +} + +// analyze 统计了 nums 中数的总和,能否被 4 整除 +func analyze(nums []int) (ok bool, avg int) { + sum := 0 + for _, n := range nums { + sum += n + } + if sum%4 != 0 { + return false, 0 + } + return true, sum / 4 +} diff --git a/Algorithms/0473.matchsticks-to-square/matchsticks-to-square_test.go b/Algorithms/0473.matchsticks-to-square/matchsticks-to-square_test.go new file mode 100755 index 000000000..232bed5ed --- /dev/null +++ b/Algorithms/0473.matchsticks-to-square/matchsticks-to-square_test.go @@ -0,0 +1,85 @@ +package problem0473 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{2, 2, 2, 3, 4, 4, 4, 5, 6}, + true, + }, + + { + []int{10, 6, 5, 5, 5, 3, 3, 3, 2, 2, 2, 2}, + true, + }, + + { + []int{2, 4, 4, 4}, + false, + }, + + { + []int{1, 1, 2, 2, 2}, + true, + }, + + { + []int{}, + false, + }, + + { + []int{3, 3, 3, 5, 4}, + false, + }, + + { + []int{3, 3, 3, 3, 4}, + false, + }, + + // 可以有多个 testcase +} + +func Test_makesquare(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, makesquare(tc.nums), "输入:%v", tc) + } +} + +// 由于 analyze 提前了处理了一些情况 +// 导致 dfs 中的一处 return false 无法覆盖 +// 只好添加以下单元测试覆盖掉 +// 这样是不对滴 +func Test_dfs(t *testing.T) { + ast := assert.New(t) + + nums := []int{1, 1, 1, 1} + edges := []int{2, 2, 2, 2} + + actual := dfs(nums, edges, 4, 1) + expected := false + ast.Equal(expected, actual) + +} + +func Benchmark_makesquare(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + makesquare(tc.nums) + } + } +} diff --git a/Algorithms/0474.ones-and-zeroes/README.md b/Algorithms/0474.ones-and-zeroes/README.md new file mode 100755 index 000000000..4ecade5b5 --- /dev/null +++ b/Algorithms/0474.ones-and-zeroes/README.md @@ -0,0 +1,35 @@ +# [474. Ones and Zeroes](https://leetcode.com/problems/ones-and-zeroes/) + +## 题目 + +In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. +For now, suppose you are a dominator of m 0s and n 1s respectively. On the other hand, there is an array with strings consisting of only 0s and 1s. + +Now your task is to find the maximum number of strings that you can form with given m 0s and n 1s. Each 0 and 1 can be used at most once. + +Note: + +1. The given numbers of 0s and 1s will both not exceed 100 +1. The size of given string array won't exceed 600. + +Example 1: + +```text +Input: Array = {"10", "0001", "111001", "1", "0"}, m = 5, n = 3 +Output: 4 + +Explanation: This are totally 4 strings can be formed by the using of 5 0s and 3 1s, which are “10,”0001”,”1”,”0” +``` + +Example 2: + +```text +Input: Array = {"10", "0", "1"}, m = 1, n = 1 +Output: 2 + +Explanation: You could form "10", but then you'd have nothing left. Better form "0" and "1". +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0474.ones-and-zeroes/ones-and-zeroes.go b/Algorithms/0474.ones-and-zeroes/ones-and-zeroes.go new file mode 100755 index 000000000..70d2c3b53 --- /dev/null +++ b/Algorithms/0474.ones-and-zeroes/ones-and-zeroes.go @@ -0,0 +1,33 @@ +package problem0474 + +import ( + "strings" +) + +func findMaxForm(strs []string, m int, n int) int { + // dp[i][j] 为 i 个 '0' 和 j 个 '1' 所能形成的最多的 s 的个数 + dp := make([][]int, m+1) + for i := range dp { + dp[i] = make([]int, n+1) + } + + for _, s := range strs { + zeros := strings.Count(s, "0") + ones := len(s) - zeros + for i := m; i-zeros >= 0; i-- { + for j := n; j-ones >= 0; j-- { + // 更新 dp[i][j] + dp[i][j] = max(dp[i][j], dp[i-zeros][j-ones]+1) + } + } + } + + return dp[m][n] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0474.ones-and-zeroes/ones-and-zeroes_test.go b/Algorithms/0474.ones-and-zeroes/ones-and-zeroes_test.go new file mode 100755 index 000000000..e50e6fb24 --- /dev/null +++ b/Algorithms/0474.ones-and-zeroes/ones-and-zeroes_test.go @@ -0,0 +1,64 @@ +package problem0474 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + strs []string + m int + n int + ans int +}{ + + { + []string{"111001", "10", "0001"}, + 5, + 3, + 2, + }, + + { + []string{"1", "0", "10", "0001", "111001"}, + 5, + 3, + 4, + }, + + { + []string{"10", "0001", "111001", "1", "0"}, + 5, + 3, + 4, + }, + + { + []string{"10", "0", "1"}, + 1, + 1, + 2, + }, + + // 可以有多个 testcase +} + +func Test_findMaxForm(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMaxForm(tc.strs, tc.m, tc.n), "输入:%v", tc) + } +} + +func Benchmark_findMaxForm(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMaxForm(tc.strs, tc.m, tc.n) + } + } +} diff --git a/Algorithms/0475.heaters/README.md b/Algorithms/0475.heaters/README.md new file mode 100755 index 000000000..210403741 --- /dev/null +++ b/Algorithms/0475.heaters/README.md @@ -0,0 +1,36 @@ +# [475. Heaters](https://leetcode.com/problems/heaters/) + +## 题目 + +Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. + +Now, you are given positions of houses and heaters on a horizontal line, find out minimum radius of heaters so that all houses could be covered by those heaters. + +So, your input will be the positions of houses and heaters seperately, and your expected output will be the minimum radius standard of heaters. + +Note: + +1. Numbers of houses and heaters you are given are non-negative and will not exceed 25000. +1. Positions of houses and heaters you are given are non-negative and will not exceed 10^9. +1. As long as a house is in the heaters' warm radius range, it can be warmed. +1. All the heaters follow your radius standard and the warm radius will the same. + +Example 1: + +```text +Input: [1,2,3],[2] +Output: 1 +Explanation: The only heater was placed in the position 2, and if we use the radius 1 standard, then all the houses can be warmed. +``` + +Example 2: + +```text +Input: [1,2,3,4],[1,4] +Output: 1 +Explanation: The two heater was placed in the position 1 and 4. We need to use radius 1 standard, then all the houses can be warmed. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0475.heaters/heaters.go b/Algorithms/0475.heaters/heaters.go new file mode 100755 index 000000000..aa9e0055f --- /dev/null +++ b/Algorithms/0475.heaters/heaters.go @@ -0,0 +1,53 @@ +package problem0475 + +import ( + "sort" +) + +func findRadius(houses []int, heaters []int) int { + if len(houses) == 0 { + return 0 + } + + res := 0 + + sort.Ints(houses) + sort.Ints(heaters) + + iHeater := sort.SearchInts(heaters, houses[0]) + + for iHouse := 0; iHouse < len(houses); iHouse++ { + for iHeater < len(heaters) && houses[iHouse] > heaters[iHeater] { + iHeater++ + } + + if iHeater == len(heaters) { + return max(res, houses[len(houses)-1]-heaters[iHeater-1]) + } + + left := 1<<31 - 1 + if 0 <= iHeater-1 { + left = houses[iHouse] - heaters[iHeater-1] + } + + right := heaters[iHeater] - houses[iHouse] + + res = max(res, min(left, right)) + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0475.heaters/heaters_test.go b/Algorithms/0475.heaters/heaters_test.go new file mode 100755 index 000000000..d5cfa16d3 --- /dev/null +++ b/Algorithms/0475.heaters/heaters_test.go @@ -0,0 +1,83 @@ +package problem0475 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + houses []int + heaters []int + ans int +}{ + + { + []int{1, 2, 3, 5, 15}, + []int{2, 30}, + 13, + }, + + { + []int{}, + []int{3}, + 0, + }, + + { + []int{3}, + []int{3}, + 0, + }, + + { + []int{1, 2, 3}, + []int{2}, + 1, + }, + + { + []int{3, 2, 4}, + []int{3}, + 1, + }, + + { + []int{3, 5, 7, 9}, + []int{8, 4}, + 1, + }, + + { + []int{3, 5, 6, 7, 9}, + []int{8, 4}, + 2, + }, + + { + []int{1, 2, 3, 4}, + []int{1, 4}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_findRadius(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRadius(tc.houses, tc.heaters), "输入:%v", tc) + } +} + +func Benchmark_findRadius(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRadius(tc.houses, tc.heaters) + } + } +} diff --git a/Algorithms/0476.number-complement/README.md b/Algorithms/0476.number-complement/README.md new file mode 100755 index 000000000..c2aa35564 --- /dev/null +++ b/Algorithms/0476.number-complement/README.md @@ -0,0 +1,30 @@ +# [476. Number Complement](https://leetcode.com/problems/number-complement/) + +## 题目 + +Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. + +Note: + +The given integer is guaranteed to fit within the range of a 32-bit signed integer. +You could assume no leading zero bit in the integer’s binary representation. + +Example 1: + +```text +Input: 5 +Output: 2 +Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2. +``` + +Example 2: + +```text +Input: 1 +Output: 0 +Explanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0476.number-complement/number-complement.go b/Algorithms/0476.number-complement/number-complement.go new file mode 100755 index 000000000..958d12d90 --- /dev/null +++ b/Algorithms/0476.number-complement/number-complement.go @@ -0,0 +1,13 @@ +package problem0476 + +func findComplement(num int) int { + temp := num + res := 0 + for temp > 0 { + temp >>= 1 + res <<= 1 + res++ + } + + return res ^ num +} diff --git a/Algorithms/0476.number-complement/number-complement_test.go b/Algorithms/0476.number-complement/number-complement_test.go new file mode 100755 index 000000000..d724d508e --- /dev/null +++ b/Algorithms/0476.number-complement/number-complement_test.go @@ -0,0 +1,44 @@ +package problem0476 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans int +}{ + + { + 1, + 0, + }, + + { + 5, + 2, + }, + + // 可以有多个 testcase +} + +func Test_findComplement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findComplement(tc.num), "输入:%v", tc) + } +} + +func Benchmark_findComplement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findComplement(tc.num) + } + } +} diff --git a/Algorithms/0477.total-hamming-distance/README.md b/Algorithms/0477.total-hamming-distance/README.md new file mode 100755 index 000000000..abbf67c39 --- /dev/null +++ b/Algorithms/0477.total-hamming-distance/README.md @@ -0,0 +1,28 @@ +# [477. Total Hamming Distance](https://leetcode.com/problems/total-hamming-distance/) + +## 题目 + +The Hamming distance between two integers is the number of positions at which the corresponding bits are different. + +Now your job is to find the total Hamming distance between all pairs of the given numbers. + +Example: + +```text +Input: 4, 14, 2 + +Output: 6 + +Explanation: In binary representation, the 4 is 0100, 14 is 1110, and 2 is 0010 (just +showing the four bits relevant in this case). So the answer will be: +HammingDistance(4, 14) + HammingDistance(4, 2) + HammingDistance(14, 2) = 2 + 2 + 2 = 6. +``` + +Note: + +1. Elements of the given array are in the range of 0 to 10^9 +1. Length of the array will not exceed 10^4. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0477.total-hamming-distance/total-hamming-distance.go b/Algorithms/0477.total-hamming-distance/total-hamming-distance.go new file mode 100755 index 000000000..2ba4c8cb1 --- /dev/null +++ b/Algorithms/0477.total-hamming-distance/total-hamming-distance.go @@ -0,0 +1,19 @@ +package problem0477 + +func totalHammingDistance(nums []int) int { + res := 0 + n := len(nums) + + for j := 0; j < 32; j++ { + k := 0 + for i := 0; i < n; i++ { + k += (nums[i] >> uint(j)) & 1 + } + // 在第 j 个 bit 位上, + // 共有 k 个数是 1 , (n-k) 个位是 0 + // 那么,在第 j 个 bit 位上,会产生 k*(n-k) 个 hamming distance + res += k * (n - k) + } + + return res +} diff --git a/Algorithms/0477.total-hamming-distance/total-hamming-distance_test.go b/Algorithms/0477.total-hamming-distance/total-hamming-distance_test.go new file mode 100755 index 000000000..21399173a --- /dev/null +++ b/Algorithms/0477.total-hamming-distance/total-hamming-distance_test.go @@ -0,0 +1,44 @@ +package problem0477 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + +{ + []int{346450570,966562973,457581303,222998192,364627507,169160189,954431542,221061882,240341464,2245441,231904888,735611889,365662644,741343641,855432971,6410579,954376059,436042748,1757003,612662010,619293283,756454019,412485671,362438559,34216799,142080553,739017385,767259094,477271201,645653662,266228943,301408300,648353405,543652957,779813961,33523464,581122512,963411206,25440862,235321881,537459840,564290176,530181458,643091781,951346494,264772743,242353595,253371384,100262534,923703199,520381430,497283426,629165236,170643624,116719823,850474028,58812742,416255752,301680516,135541845,719123095,56870927,992425752,194127615,675165512,203169436,169712122,493351238,319895999,340486752,309900187,844598934,307377068,388210841,397263679,76973008,693168540,777845383,514392792,423470900,514610142,136010125,792549045,323715552,111204613,498136379,79844425,353928756,743878480,863304173,946695057,190460954,119598426,632009346,519938738,292388501,523930549,810762921,501651610,30789726,732344533,285785174,63479657,750706287,447118062,460965759,123491715,56051003,96864966,216879136,807889793,812134617,933426165,725513820,298625074,322335679,541999219,548221737,257888129,496763035,472888287,143945709,667418150,989758769,467300921,578882168,171676666,92166119,138726055,549049390,928845149,41789200,916910409,170593191,269092392,35271762,107017362,196990595,194125069,632374890,428207227,661163092,87697666,553869198,330979619,791810803,8005562,405494420,972083587,546238911,144786252,323565313,733621387,271033882,246618065,59358323,995901031,414061877,83929037,284525936,374303061,931944164,587326777,11794358,659279382,640438401,453145421,831057063,135396331,66447875,97938685,83005193,144370426,363185828,708665000,381327316,669975942,821874551,423739731,530864043,230395994,352455617,961656493,598750529,91771061,502963681,814951975,247143259,503380715,381591472,814678540,739467086,735449213,926534406,652815823,174563216,214288088,2797575,567181369,84843397,619788927,142303070,538398379,158445973,121745931,779430373,29010889,900202132,674939409,698023609,127116549,287567434,100636066,759204582,751062847,997371041,705221252,484313149,681051691,140910705,404734872,298283655,819536065,775511175,938064582,373977047,540572738,550180756,616360688,860453735,284023825,525258072,854626934,137227180,565734538,35769828,35561683,123225824,882188260,710986932,958354216,931955812,783094713,338547506,283752439,259040864,750448779,621169822,83190287,960277990,52570725,733374736,66032750,710867398,889808503,728370791,71096437,709887505,453132381,818915205,285156812,594522827,696722476,733810688,950627073,58365878,141242023,678229204,948011930,55330417,870877946,744584117,631021928,104273588,765494720,888208441,960437590,587484278,511430018,374757232,768240151,140532093,483853929,759897161,299314796,970053676,789263086,138198883,278804174,845413242,108549742,974876069,234843651,89782818,884775441,244065059,100659421,358753489,583292494,927076681,383918582,124227017,529369835,94067324,441550276,579488347,415287462,207499662,726355084,552847240,334800689,588024883,214465087,37157543,382062502,348366584,956755566,980732673,30022964,523256059,212027726,667599087,528778212,888077798,912204336,532519219,486156684,453089731,102096655,99046632,376917599,924811390,611373322,789655606,85810160,42810561,696034138,695310735,274494749,638372687,301449997,556176306,806343198,233811147,916357266,256831956,132554022,894905815,854052764,77086578,454455883,233671780,721499744,199021377,320244860,554321216,485595204,753713606,451520967,653167518,643050140,605991276,173416589,477302344,169074063,299890438,907450535,92280751,479388923,878468964,270783401,331751192,667714910,327931726,105480680,932758563,35523819,841350645,547958667,924416511,417092910,693914562,785840324,386874996,420553234,869521561,422657892,882770215,547464960,423638972,984891177,55039341,273730908,685398882,396727266,5919374,141144565,394757667,908102264,101450397,767785239,84760697,229850027,913806483,335495015,520143730,442721751,941115849,909992566,659501406,77028475,477918762,791793154,858862466,309369506,515377955,155741334,555013423,589121440,109924341,662462767,456498921,211273094,76422367,28479841,564812984,934102348,352703266,621904520,339336269,301085229,867971471,140099026,2252870,2259022,460160755,626175016,99118543,585525776,954625256,329329433,767400690,709591526,128085691,750572921,353119347,25043299,143415128,339877871,20876877,837837278,480857967,798887708,837947312,182715758,2129496,430700920,415966981,97778682,334296997,505386605,527824928,691597717,501332055,102479782,681768336,300661338,186086375,817514593,367391045,725808190,951134370,994571969,551353313,203194786,595769572,530434290,597471911,869853383,704622952,18619637,555110244,861886918,749210389,75364140,215706406,218148084,453240937,288910828,56738907,921049259,12768437,643734537,223749773,318568914,511005627,684468636,941951920,929452334,509329260,427055878,637793272,300640327,625933076,682305326,735917680,210124687,895477319,514880835,36075013,722355037,896050368,763202212,12732131,33539595,59257651,303906727,44248123,441839977,799020691,925508946,804800201,424969401,723091263,384898868,774529712,622485117,360011813,257107492,261498858,52743222,130543099,102556237,380790365,235375073,76952715,352104089,141471269,443220854,739605382,705285016,408511050,339997891,38053017,192887069,93123938,204404459,244885791,216821685,635289414,20488214,748029178,757125108,161081681,115912278,369988517,431847154,353368996,280431817,283921732,163886090,359479176,687990599,799020523,715663948,901045767,969010972,444406134,185769872,940499613,142848702,118900815,644679504,73424613,37352244,713939984,198175299,778092374,370603235,818972923,48201816,112543749,175653592,212884697,245346577,371317399,144046811,780682308,949951033,79074764,864664702,190785843,137556908,19527162,213970899,114252993,985630089,589031443,99333478,341444536,582011768,83772691,365828852,32812781,374091566,672314993,332115415,553781352,209056966,337181070,940382704,325442786,76055393,510220186,368463631,572891916,70737642,329092303,76924074,663713380,793693720,234915454,149092192,472033473,661988693,78671791,972821941,425357776,808058947,360138601,240549761,1104404,381848852,845496906,160185521,86536687,575669390,861607995,563340244,951564932,434071493,230612570,490459733,114495345,970894281,239430861,523104927,26457271,138238768,949151369,671507445,792041708,386837181,139501598,344193640,689046109,211624270,536186458,844416794,541117382,759572807,497369481,75491621,210795926,292089310,144899775,670019883,412907291,213176380,645674042,401734181,50772477,574991658,1363084,80011249,424298921,546257207,245265702,952513499,196767886,100527269,78137050,929869611,873031436,76563479,459687000,460730741,468511483,597444879,415526559,138057069,42819923,60402694,221291605,953812278,550510069,63178407,775543409,125316351,657937197,350150154,661424076,972067038,268099868,533790070,370512971,301905875,775666911,53530818,44293680,853011407,109373724,584134592,47832238,757540088,693199600,299870803,577445090,641026837,960076107,599985369,518374118,765623925,119294651,382956706,137846261,440232092,899606329,398696623,538142699,156199507,20097515,416980604,746849845,56406778,781408097,56363452,846206593,202993048,500126300,164708320,939291835,525581748,852198525,332167832,80248802,121884898,967565095,913355159,340027135,175051856,836925980,197058010,534190396,656341112,294553323,607893326,283421303,136089053,971608294,354945470,6426571,75669956,474631468,376817718,39090001,648629403,887384049,137266775,83724056,548420407,301967525,664334814,707738145,43082282,381924535,177038862,227302539,693343538,778574544,884499837,906955925,369305069,682554853,989255744,395872912,324672156,801957443,891375929,509317231,224884475,62152605,921779793,405951493,271196332,36452990,425542113,758727259,964124705,279800320,407769888,768190039,298299709,296377065,987732640,566867748,901761122,900059153,212353581,701793131,56963393,399018167,854386835,249366934,369464441,6614988,94910828,378915053,136282416,73976588,517440059,99279841,1493968,486800059,528875121,369343714,332061368,438392001,37967950,324692491,350749210,199361455,593484865,786069387,941769543,366230811,346086753,87320173,297290219,509747811,812170172,530999050,351974996,473793934,978264240,552280248,749805802,552073618,571942686,296898208,9164806,561555505,665722548,409063366,32838315,803241504,997752686,677077826,924154707,666425445,130729941,302347506,608224540,407684060,473162490,103003167,95386865,937217971,822866430,121402330,299495660,69372699,449288928,439488622,81986499,848544475,48091598,821636314,921679188,862566905,647355085,737736471,359268897,655820162,128881261,443837451,10827857,595166251,773331409,809959419,89116800,989955641,628644978,809580584,164487896,736614383,34710126,405019345,429949003,17904913,866119367,17020381,32175572,194916716,845662715,799453737,406757058,925425405,548210261,857989575,671075998,190184342,972569258,473481889,28691219,176980805,44517118,667871648,814743645,40708243,76618933,830175887,564878250,31028010,235195005,198033486,896629999,560620772,135534193,28989440,539708789,62175442,744074761,867231646,590762133,122269250,630413149,816964592,506437404,215755967,51119811,763161833,334082278,398593088,945513601,661082785,885461564,683811016,626750815,186637748,140000947,501322764,946325945,429246511,741518682,649863411,945498613,763684538,529250625,237988501,258185593,53789542,97700654,815858979,458773958,147619376,488218725,750074466,772542172,430155042,185835092,682147084,223828033,633884734,827330149,128683565,854601582,711136116,111184635,955344711,536307736,735252493,767745013,408682315,863943677,957420550,65195457,316364407,760057055,46191029,884006414,996908730,170589794,4977591,699488282,974071896,958514991,486617590,757085932,295629227,156237609,660477829,100879238,905734161,102932569,701824857,590182275,759509010,425133302,537313145,453292380,360534751,101686801,800565042,904591017,69980537,489330450,107483718,445101299,131989792,794805371,945586057,85872199,938016387,563963682,692269163,694401673,382780313,320692757,846696576,995686388,101524270,654863681,440195692,287831529,451334859,465712587,446534972,605411786,171346394,836251909,752848595,945666619,292394086,824819066,727100877,202488309,252407446,931742097,338670355,200991935,872653392,519733981,146004896,916435707,782211265,877327568,414693652,964753227,898929917,560636952,259987806,633317444,30305354,974417495,117525021,351051285,981368686,189096642,664443112,380418984,643046969,552696279,92566456,424739073,353957283,430353191,221158041,856485777,166546776,773450769,461537870,149026704,518860304,347017439,903995668,801368129,724193766,380292544,665453536,182745976,510003422,20278377,161760944,1888706,678710684,450311702,656403486,549894563,455787300,135960829,964031173,855291643,424089461,173346634,449052306,757549962,504646849,186669140,667606291,4360909,865310721,311008941,945053167,719524557,568813242,594445497,544520813,126462802,37459840,167800887,376457876,433676448,33542196,895951236,890069266,23068660,167912160,99139540,583917286,45042659,556199578,49992055,550362408,728923627,772676501,333317476,74962687,472463267,88580441,565304516,605346084,421597949,41155968,804576998,614058805,827411800,146486853,426752418,979991993,318832439,645103008,748805400,711164958,448448482,553519651,898594131,566554013,923784271,882958534,565058746,562635566,638438599,54727912,689016068,61230252,245157029,126046388,42767174,173850251,323408637,40830080,976849745,194161478,37279531,77809749,723888998,907529131,413243723,218116641,924778436,412020513,134462641,199284152,441736991,215618636,890481341,299340822,259989011,653569879,963080526,910153043,416176120,317810561,650268638,520719283,733127856,566192953,297899792,810401565,870792259,97421286,769993366,335024118,841207370,287419389,759927398,807508055,484209923,300637378,576369233,886451061,134417919,9167989,615052186,136275669,606074690,782377109,369700382,884129503,125203328,551338214,96909540,404507863,777910686,257435244,327575781,565564006,464605798,172085072,366311173,903752309,6200710,929096492,764122285,444013513,822418244,178674816,598472584,508295318,229461860,832334655,133048605,410406286,773953216,523251433,341299966,299707425,333539760,663406228,926357350,31540700,823567738,963846229,687400060,463766138,299326403,17648878,271949260,806012004,316905952,478890704,94836819,75508015,486329884,216578484,842777501,906807342,812532813,390476818,33854894,63520650,878149147,190586376,287103755,750034054,93337688,63459906,64246161,748437133,964152430,391269326,468634968,525373627,294771103,120638139,926596561,549971261,597366939,460094048,859535536,884238761,814018887,744602419,938623642,825658810,955776403,349304239,329032553,279727246,534120239,477212413,805087393,602332982,172516516,382160962,3183804,409059809,766034394,368574771,86316827,613923173,695328423,571776965,13614077,616999066,852254546,919207710,126625452,37677587,887012491,980437341,568366756,532806236,15084109,701506773,332090359,925643738,922765698,943671299,909767776,176423170,262280261,507902983,870917034,254052486,662641966,173329220,156375208,471115506,266102853,329697317,507976137,100416312,360766398,847494283,370362408,273382250,60933395,343827302,619949215,43284908,78449579,740093573,527397987,312956340,462733455,915870976,673690514,182681814,224611266,912779883,261297991,31276622,680176086,457002999,93377452,731773454,70573587,512282143,457015156,297700151,957023994,842729706,103516777,137695547,54665541,788230318,753314861,546769762,269842999,558800307,810771418,851482111,28815969,126170408,772666245,160944884,111732393,424095182,269499481,434765644,366811614,370224539,103701614,96767359,162355443,403698811,858054182,756925847,752564279,816639970,492966391,87201989,812960447,928249093,406789174,465199017,404898570,902072294,687476016,947380052,172775106,226294376,929017173,785512921,179180069,707346589,52135178,648565826,611823988,774064480,245781834,244230857,739742760,866713415,263766882,516716944,830787918,113865032,321663347,979533530,410400808,36389539,152099734,627667986,569145216,524460152,121865954,87646796,698897108,775628713,559020679,12574906,686026314,997537233,203442902,470887890,735528035,103812113,806440405,867569196,614492620,528605917,139799380,261069842,491743673,218838455,171404452,19054137,60795734,384663944,121129338,799264988,736441331,421192456,668486058,403714280,325063087,929883819,318846714,678001511,416142973,553687510,779338119,833002980,835190067,86339277,198261745,438011718,881981088,524014422,72932785,361133636,784233830,510839171,827304869,703802605,263433137,202432023,660913713,191352107,64821368,116996456,411898987,91975159,785755120,102335015,396153014,737379176,796662773,98170413,121163904,587237172,7791839,546892762,189620352,876502494,787081885,778954253,823818059,83045404,672713056,934414384,947619955,909857533,891990491,893821108,803251391,163923495,633639942,215099721,966032946,139352102,126581662,887656213,269076182,910313939,765850123,419015721,798344334,295395082,870434957,534697513,235016874,706174485,679936073,718071802,567658652,516604190,83215087,377091590,347089411,759124003,189750172,910903587,145667246,98045942,738189945,745376896,277378121,500060588,414791805,466927051,530678597,408572366,16030834,994771163,958744646,51461881,276902804,308363779,791993442,930135588,255361003,973029293,408334124,306864834,369028591,123734979,642600335,281548160,866429357,784571370,741423010,396409176,747726616,759911446,746424213,699765764,135723154,57373320,639188893,927500935,717399550,361042592,47035900,258389204,535417394,803660028,589434613,78455658,842263326,855002705,10359436,750822601,254523813,787278845,148798748,982571106,716311690,257248748,695126225,675423895,250845223,445263900,717341152,172525984,334268216,21664338,980771001,526718013,622051557,870124903,973092298,319775512,462945390,182895227,663959910,642156136,258346508,965309369,508590276,891853672,96292891,777906355,391665549,685503988,15760161,740537346,543439857,138704486,979517785,938753171,62190488,558479374,504796359,552000063,128682379,41689902,395492570,374715103,60178048,95138646,705863463,747556613,404659741,828535516,912450264,370863821,110695953,539022347,55541561,917586438,795194359,40856432,272264162,803602624,417624163,825727723,759492125,934325685,811360931,22008867,535840385,470418824,87365292,617131743,580168169,310659003,506096142,568111405,536089273,358512146,467502918,826362100,684048129,109920290,32851119,225459754,140932170,765497127,135684312,966082317,614625430,613259940,285789627,138321228,187572942,825420976,105984012,9346321,110289394,148436175,183773989,607948737,67230333,363808409,641987054,918574050,214120067,680857344,22004323,459469377,98108274,224277378,389070139,807099636,416867800,998436664,80772768,131225450,833411259,254684279,336747260,884767553,904470021,183884412,316344451,779161632,807248196,766232073,395998430,493790957,267802291,620359303,345699336,225475017,42952342,345506602,133678326,463730320,697333277,262124860,836540601,955422676,53686913,165793629,211022,837636616,403299027,581335435,247040773,928382160,850267665,885437095,272560533,342259080,387150894,762603626,896736886,416608356,139950072,439245217,138562311,944487629,951945626,389944610,471948204,376356257,873249562,595123514,55050650,818306340,582359570,279808542,900462111,542417746,139954085,506691708,987854579,468812874,13451053,379043414,939140674,925481046,335884901,630506791,36300617,805071327,332311720,705595840,337562724,557885472,467525102,51724941,757689999,710765061,524335613,28738981,979716739,135089402,143321691,916965859,102541341,923411871,711977606,428742958,75259421,810199242,972338314,532468306,630461893,488721353,962313743,700711622,852889384,58533163,219360215,705195253,47347956,1125680,177908093,597061005,406207182,273594061,532895000,359457010,315446637,367482194,110265786,106161588,284856015,626973520,634673389,404374274,680164010,254041667,273785611,250287134,802880312,15144614,132457152,59790303,20759372,448887899,348866582,770287364,188302632,204418924,842504115,252471065,986630,988378390,889591185,577895881,775020233,69715554,769201972,125988464,69238506,902917315,4842081,362433937,956534845,211537051,10758950,23003458,658019302,582605242,468355621,918334470,275444879,220316999,605994765,586561281,31004968,409454602,958869404,793764518,424817440,316566383,214205462,761586040,767016738,698961203,705389731,375477477,135979631,73014965,387827827,609419744,168124865,379105181,36796418,109590637,934824089,598102371,83081437,71298265,600021985,779274161,905544521,63136736,75178912,604568126,24338303,470439100,782649093,438946754,564745611,594742915,455279267,187384786,958050378,913296418,707272217,595143552,391829316,290452310,194623117,206111616,19786079,477643046,452801636,702534931,432472689,129317506,185872578,519195708,689185173,401389271,903342470,914992647,944000540,207891744,80647739,384368116,444115436,742459527,282776150,237442239,667094747,996775489,78691954,518722904,539724355,969288135,14738803,754442616,173595224,125115720,19372783,766806693,670723604,709949325,699162543,941827464,985203989,224524753,251734470,151431278,130346229,88729441,715042447,192896695,107424473,596854231,225923858,144172088,531707778,526148257,429075631,224043591,961800746,875727053,639146880,221388444,79396635,831899658,619010036,83867562,251315611,908624075,281593286,477378392,299729152,698705449,494878125,5460622,227855711,607592176,516960547,984561314,953482841,456113351,173449045,22790336,578066564,141700698,797245341,151972554,637637373,620908059,771685418,856054671,363399175,206442157,487242794,527471325,191043037,165249172,439456811,547339022,99977584,991042334,565341406,225356314,195394668,495688813,952813378,148888367,548335414,20973821,112670017,357377643,81768889,486140499,181068436,232876053,232617937,982408197,125783774,923980970,893911333,172179319,157341924,686325789,735846264,802814553,264438170,268657547,109745013,381937874,194206013,638295629,153819838,472684856,872364539,959948904,964073264,208210011,927772492,986490755,376364445,10865278,662574507,980008032,588399912,75126549,79008254,185304641,563813137,309542995,76702509,87354072,428557203,893737361,543199209,389100844,323158571,132938112,700834082,763590957,310939827,137959238,191552884,351334535,446984142,357655966,110071187,775998420,330235287,959703339,777324534,350418237,872127763,68400544,142665372,185157152,25427739,807742198,478989099,246572868,654237413,444906229,793910527,938328478,514309825,176528178,27149717,477233964,19811403,110284936,280531991,174567572,287499380,956852488,462217080,827090939,48743320,830688311,380232408,447726362,154267046,753480193,30537392,140839358,146068068,978167511,867018170,90816873,84268650,904455755,91599397,351247636,779451227,586525489,783953893,100905306,196375390,946297938,958532862,786975487,138206714,55914722,308378915,839362772,143010439,335225858,84367903,70612210,368440326,974183359,477368563,927511727,105802116,99703896,686135412,38168741,990376690,115280933,496391337,22716011,121864867,276399009,431015802,620242883,536512043,21556595,962912978,241657454,645252901,120573404,838595416,337981451,360000642,69356495,383969722,190758419,31146809,84366151,395671415,85595724,940773425,449839692,313266004,224805362,879984061,172236338,115660257,15196020,434911303,312913711,100772921,911842920,900651448,784142480,768498299,184258235,949715249,765725439,470935380,533692465,523044314,155218227,353088662,863825573,326951691,459396542,873970429,32854723,286032182,274480888,198389438,82159253,18580150,891452235,791792173,487869730,533987864,399869435,129262582,55743488,577932724,246756887,452077452,268592678,226513152,665523180,146231262,426001775,101353327,490834818,976097999,651489760,716763914,60821506,24835370,796236072,369057647,612079171,560936445,998599363,874792636,966785890,909180028,242582191,947900709,126501295,684411691,777855883,336361223,46116057,623952010,598783769,650435741,181735757,504100443,386136664,896309192,818289886,305817192,734157251,332860473,191069276,813269467,34002361,832988381,382803252,706228530,440786741,631657484,48645045,971958964,953688866,623808232,329790570,134817083,275466396,936458287,939759324,940218430,859456962,711129190,994779353,889372554,991310536,571023704,883953263,310621295,79359208,202864069,479859894,997122551,469312047,20138498,312803307,38191471,579421222,641622656,29566383,291950133,953235583,595415439,666466831,33325865,762064835,224189715,63201745,813280106,65328387,610056692,135891666,949092279,678381815,572482782,991378514,920551372,27694794,48408515,498587970,286821196,650537304,534200029,463737874,824293355,481410688,498534967,188978353,30864958,203790179,658100066,147027212,125652965,872957754,192695174,222449742,91268014,76660849,96184590,105175095,91758762,89232966,587852534,258257669,472192296,183843207,416790594,55340491,833170242,144373785,981167032,740360089,711765105,152205945,265272616,53784518,658757217,454345834,531561884,428612868,36320438,345224296,476907256,971280988,296364469,776031668,889034423,603310113,562771704,779026318,680509445,971821840,442024376,957752459,555644148,97793211,785507322,439582745,516428113,271372595,851421584,952000905,171535116,67640338,605290081,273334106,251777187,869375897,914945269,502223563,53669209,661221079,707780106,748320809,363600031,80240233,125349362,651226583,234010300,968554443,568479241,275857984,75426862,122391413,890628112,618637372,115471008,543498215,119527392,438140908,112815193,4372097,53347437,548166369,327318153,530577504,856985962,983221483,116801116,276303254,969145164,906792500,563083319,928393751,690572533,450933743,166606916,636740102,779881313,372529950,989017223,682017759,197746405,366626926,561140617,135150873,590507632,932816815,14565183,569852079,519804711,394301781,42982272,287013621,589656985,875399637,224212040,290934373,61226439,974050516,392159909,197256498,368189496,260472265,978663847,619002734,961142848,348832180,985071528,145736373,52842009,643372561,582470082,344205148,527955996,101479015,41746543,992952788,462087079,996669201,646814607,450878735,596592529,122465638,783622618,621112253,115628104,36327040,101679041,670142722,329978717,149520065,220844043,667067263,180346832,989779507,815844487,215206914,620142050,989295459,270384339,67167099,94013149,678514698,451342294,590672632,411004521,445575695,308207354,103420692,670278599,466179809,63705607,46259221,675604289,928222112,100803154,419968951,432390346,99883774,561861311,510436696,505358485,262233510,722158926,894980085,747803585,53529429,459422266,99292275,796429362,115693961,788680570,878249284,873588935,856514584,857727447,914963065,446815866,31429950,548149644,839199656,903508543,204192842,983206166,6851944,782463026,813707401,597403089,860645676,215008918,587390572,83996923,632507360,300125448,562296311,586052177,64428628,520192708,472916419,469276586,571629118,321728126,68274183,166399692,655915050,930685299,904419192,477085056,457576872,355547797,392318225,710589863,520245052,145640605,236247811,712674752,408257545,167285228,299711651,50061073,710347934,749111643,415740118,579859535,211393237,741160699,75694071,318405782,64213397,636246094,67023445,974587665,830088564,37702814,749476189,100213799,666140545,991888004,893615214,283253158,812064754,906722371,531908863,610816558,22057646,1163969,235474160,949329346,367799590,149773064,178030942,514300501,19819710,42879263,57730074,192702430,137379912,192239037,939068349,857398418,472918534,297801969,166290404,966595281,581859,627843134,572395427,316181607,189726171,507518780,63089576,637065861,605440463,860342155,763203834,247014507,486929498,911377816,319078039,477934914,63259818,996334439,462920614,766484995,706396259,905302975,298440408,159116442,652900179,799355930,910398456,245865117,496484591,442552342,34321011,746087990,343833097,71850849,149883038,85901735,641449361,471502387,325960879,193709856,96340940,146992389,333361382,19912251,805237272,973865688,787744429,176913026,52839112,594682682,442943236,368646950,151945633,185176126,344323757,373933812,168427162,164843566,64887710,439027872,135117259,464030643,449894644,882339199,100335058,349635489,601384009,48491412,98859271,168403497,121610980,97266072,308795315,247862984,862380555,455832860,901687749,666879142,520585901,638860229,53117450,977742154,367515434,668930466,637450017,974004483,618483278,27601866,841072688,171302662,101248185,871196871,662305651,963333956,874583759,751157445,439795980,12322886,952314890,360735139,529145692,621863217,999661817,197082769,950314909,106792824,363642654,3626416,819631596,588122114,494121435,379695096,361563235,207548213,749373163,870644533,762074051,586104449,149985554,808888147,57096050,835605788,276406114,550429537,857160730,773063612,397041112,631256733,755673929,186414923,689948466,699657909,323004169,39892414,42861390,402833494,554078314,698108584,53302658,357092207,579413331,154493550,265365627,824041817,341757394,190743811,785630153,2014646,647900617,169074560,515264939,403765069,824168741,534506837,532314058,185499404,689711231,652911489,989443100,249797910,22943485,211579582,578093820,806813712,906310426,257821611,733300078,958739391,963141096,928153033,939792401,348659922,591920038,48804340,501746382,476139083,945499259,774541860,472151484,497915923,876629149,413783754,911504492,655142993,632603760,772836601,83655951,196758250,938575017,8418435,902199990,686179041,623957697,694365178,769408848,455469749,93848466,58171164,370672541,836315218,669399311,74876991,618127751,140205449,643420584,389592643,998889776,460796633,575958327,68299791,158319839,942274018,255007548,327478402,76398800,425367850,977372665,599964752,171864199,949065956,590476223,404925752,4415099,983103473,73869271,68268309,422180443,93714391,745234864,830708522,719918685,543450175,312119112,276344341,659694373,818236128,756811555,979142282,277146613,111094348,999417593,741882364,319815844,786300245,881337724,93908840,72876982,216231193,655330027,835621973,548427409,419650139,723589425,167573014,48585081,318649085,503934555,100045764,575417103,709366258,282468640,511572610,269312260,583109591,509607,122513908,240391439,635153844,682425449,961846363,287906903,570662030,454770708,436989683,91529441,737023635,470557549,625937789,407011648,909352241,989482435,910901255,106473322,643244903,584405723,664268730,390042935,331517901,41760367,225292756,274659009,44585438,461620819,395666900,364217188,862863344,980132995,895674475,533514433,32849206,986286541,91623394,168608059,264717220,309178534,600678845,81701946,715534567,874022947,915524749,504125688,17450801,30814993,949985580,659706193,223916290,969736486,107723119,966725190,36478775,504405539,425939264,991193175,746021024,11314113,177736255,856463386,144726308,902043661,560746254,97026520,223107076,254178670,635932807,96576130,804863425,133070100,771672751,643160402,104659641,811436550,85915978,319304971,144497391,349602936,54265738,156687169,626298161,375837980,752502611,573164472,356619040,69346503,570539247,331619052,594321577,609281020,777052822,871700525,330262419,268227216,526644259,529951726,76953351,8288272,862034096,75347388,934155542,99251177,667221767,629611913,235493022,911837911,816465185,57343612,139886537,371412472,741938722,119541103,230108176,603044363,391278748,419969100,434894589,386506582,671070077,90670095,326380942,604236334,742877453,71428913,62382118,484237490,763955947,795854394,396646442,440488984,715201457,717894118,876290958,172258558,134606728,827975783,887930899,590756490,27427349,55449116,72873461,157053746,344906859,791215960,747897496,691429381,819592550,931875992,441559973,742465826,388643443,432575974,865228501,76621048,865722692,999576019,109580852,331894085,921833914,108541718,485511632,703624071,410295846,272293205,144244678,958749330,923164447,848489732,275509644,308822354,702307457,111305887,52764850,701066317,726302377,459979269,723423461,673183360,41857702,713718454,769887883,709654984,840119228,178885971,59408797,51238971,618400306,426070040,248683182,408041390,829335437,117315560,332628974,595232877,100136013,151769821,732292558,205219927,65554585,909777762,551279294,106641100,108584680,207573966,975182412,88583158,403947713,746382802,796749665,56575541,677345613,129883522,901947480,737210765,468167812,909312254,317420926,337102712,416398376,551278437,92237501,545464751,18381014,839540777,987256827,12329598,65123474,106546126,866861731,609030247,857278305,601662990,442357785,118906581,303115157,418211593,961245498,133608505,437732420,482786896,6142706,954223264,222522252,162459937,805424400,971442337,506168396,989505805,510702267,28348057,290381521,4872394,285947372,996562865,800087680,324018824,913329823,914204983,945138643,801614620,572000709,124607122,475343629,461205763,216776718,27012692,321738436,94070706,498391550,280557550,249632616,539814521,337224450,521986717,560054624,417240767,31463514,319281214,390708423,778956482,654259440,815114018,616094891,333665781,840978950,743331743,57208580,17887360,778127518,961268443,312223698,34121243,683554508,256083084,431164200,966884422,417723705,558267892,452407101,514036127,871453186,675224562,195622786,827679323,554800042,943289198,137268632,469439724,811500768,224765679,213031880,571567611,642485046,698391006,859506987,404415718,229229671,77417779,933005218,886087110,814449472,184488504,524879038,926653437,505886193,334465856,48432524,109128655,174270047,936469068,120955591,26582806,100621866,82071673,487085315,28205419,247569724,228527029,945994145,147651205,230190150,980781381,701174673,399958022,263639222,518618971,585901002,25619119,876782211,838813141,849801879,499422734,431797862,672401999,794425257,792439578,631387330,10155483,824973246,963899068,427981486,162101399,74443528,336892542,31554833,61101069,14440573,623015456,683484798,438972183,199152236,17603357,654361460,382280511,510455131,22216952,885641333,557704952,373987687,73904287,302277152,573268509,105168899,780601168,379209631,437782499,531486071,301907424,447195885,975958342,244736786,652956875,397740533,501523598,233797111,680454214,836533001,827689476,725441513,23823550,408920017,771055319,210420435,423663014,595986493,674236821,420023906,563040453,207944889,766834332,928230855,100263108,494876908,985006503,52861198,527408575,136403787,173396760,937014919,912160182,937906588,659034114,458681350,738640367,518663440,540312907,478168433,486024935,386267935,162118664,719121452,29257026,742059397,354747250,615405256,627872218,706705146,8820912,662653497,160109315,953226092,642921624,593506511,795368640,822513552,426011303,54469001,425444763,122565809,526734390,897299796,287502138,3206194,992389961,740071925,956538629,482156161,142797796,56302251,817601386,826120996,926780495,493866352,180460987,553877523,470897894,903665263,897723657,968883024,441467745,192389830,532984075,502035466,39806577,954704000,505296194,362792320,537426985,12096191,82714250,756480141,58539547,119634681,448368553,3131526,884928532,315076780,948251605,581559426,864173863,531189358,402997905,815345275,414885418,99818517,465086912,22738551,500694647,126981761,169669165,564351517,768161067,604345883,791088918,553164827,377518104,73059268,132428348,723165122,271742012,617762162,438202067,140714506,402185573,47383233,801047641,425697822,80761128,142613392,311529292,307679258,24667230,117790739,876511486,583705360,630686024,108207423,309466508,791185500,235956276,462318370,381988322,42085549,248175689,675562549,433719354,961684760,73833998,475434998,996844546,91849306,818027396,189115056,973927210,674261036,34026833,658332129,752342759,241036977,954314197,750833183,432375487,643127139,752629822,770737524,164207164,313318953,321740627,130894843,926371773,273948061,40122059,21580455,925454489,682519980,403145233,144003324,842774877,862705774,479337652,16757267,112007290,103826836,699384797,382283148,554775190,880106703,878975363,398918228,174712062,775480585,423938452,930305665,611856426,319249946,12670794,943110861,80420898,659797301,400663377,588143894,860177895,149969661,541774496,66269570,41628775,722636150,118727843,32506394,312591129,974104541,507179506,596340977,189598468,508698106,556668835,494343513,610171326,915061657,310873032,808314251,356065635,505686903,132482473,839865419,1063980,495421262,544029593,312979203,54013318,209231523,123476922,600403630,751130735,345386079,48510490,64998148,502180760,334279188,206070742,332816761,603885339,286155429,991388148,727964941,692426428,397092303,698645292,483819426,180005240,336588635,573262247,206944887,139669894,818239443,458021691,389169789,334433539,859785774,2042955,123689980,679280720,440972166,246106743,55504057,641761779,72839350,145276660,123401628,127915950,45219581,589265407,736599132,571365147,534639892,414064374,125896116,103102826,977377100,467482375,126590830,603269280,669470051,909299102,889353840,676784338,286469185,29255721,74631331,784287425,57105267,636010838,408043147,858865336,357605596,618007666,269420501,254832431,679254277,996544665,701221702,42890778,458284101,150022296,278927294,121712504,656096293,829352753,408345572,853776439,727859597,69393467,5358126,652689086,398999526,541087548,258152769,856621643,509584413,420445055,198840755,224993131,533828928,23599377,936211700,297360331,540636548,475151779,531750107,90088113,134944056,262017960,394377370,958901526,186155325,976357243,506614952,697816487,793500742,493522924,57938954,762886365,146742543,429166954,758909252,875397409,186766044,148788172,11841696,100384079,380552858,538562218,764604399,163990345,964209314,554340136,10605066,791180139,145853949,88479616,811200966,273939337,40981438,18734935,138418661,116119235,700831169,714632166,94259938,969803636,88829522,456641589,816115592,269679933,113117339,78562487,844759751,655723318,648707800,57518781,350511117,492699698,106881454,60268486,113141396,44414977,98671508,100616628,432510116,112858164,17575556,187110053,635580141,404748187,167563791,893574120,947091369,615847219,820514840,45913424,720287895,513333126,148038683,93060533,138756624,62822573,882987243,254592331,938860871,517799319,49416789,264779912,569864400,81388827,540889406,222947469,512126046,187997946,733033685,130944603,201161602,576763014,707772318,617427893,469615347,822734304,48244295,240531146,835725746,145056573,571883066,649369937,241615683,736186282,429551207,420093413,731244602,772092611,464317903,628401101,212728561,916136119,834981621,877954649,216625784,637748601,342833408,95441933,715262200,945823141,568554271,182382125,837210606,685799898,694152237,485476755,910424910,483456073,161077241,395794267,2885641,254328053,792107819,497964758,342893925,112551152,300075813,875564513,847799325,202236008,306951833,683737137,385066462,443798423,502367908,184708330,279032395,386156295,433268831,979679287,505633638,384741265,66158316,319266444,496974102,872807709,611351084,415901540,790890373,718207728,704683287,239691404,961588903,255743977,174243792,140696214,301773351,695819690,238566846,241011773,530710569,152947192,838509063,34130227,41570018,528085829,781593530,84990011,350489622,131433233,385157915,626343925,790488459,405690071,965422650,619525465,9264530,90133126,684456125,377174474,947142221,116011714,41209369,554603958,149694126,998803623,805801740,77966198,205843694,811788319,762668042,979376598,713306909,295502009,165568330,715599445,964427493,719285873,852218548,668694393,757716978,164201114,4615181,50914353,812017943,119969894,639842503,382327392,298384098,360197919,883002318,507957856,793167545,128910464,373125781,265730605,161271053,358225257,295231858,67591414,576002991,818967639,166415050,707015534,576039665,435347557,202583748,856450719,577326970,803267644,437087666,383824653,47551030,912201682,280892019,576085805,63338890,532318965,60949931,828769276,546287290,957892105,755190823,656786969,345620981,701541110,116213740,934671635,976270218,398490846,227132307,334243030,598363236,24988551,223265492,562171313,278189369,456825264,608174023,706128488,699843072,287555063,892716669,213792872,476658273,81591001,998365599,33866960,704787421,635366473,315618827,113995877,166270193,419887582,212305210,36305381,885139875,719634934,69414412,357380741,779331906,728581089,310607629,997158393,71708541,260101198,37108072,905108474,531450817,502372024,253885942,11020605,539714593,12239623,700397296,12463243,602284851,511062446,284920500,917794337,787364136,434800938,959997872,432573371,821479880,232955175,207916322,286708763,553854451,437631859,940141816,926310533,37665959,691580695,8221879,184640454,138240463,977639234,578201219,257363636,271543772,226404707,635866643,132041429,662668430,411088246,498236701,618472632,641653122,394124798,215912638,389322014,99900536,282053754,774013127,175670541,852251609,869845551,572990528,728109526,767961454,544417486,389845913,167652794,241963894,500622687,917550041,183469980,940920415,772816975,753801769,140297930,843243682,151976821,709352842,56985928,132268981,985146178,45873854,848213483,927559995,917042392,241347825,883769239,158192152,150743678,665776333,106006439,824750419,720834395,901402616,169616105,27077166,612374376,434501008,7020234,463429409,727867972,210152092,208589507,70532245,817447149,381343384,940030818,853745725,566154468,651082397,312664914,859703967,774596353,595036757,98914467,889061247,54141081,209060617,398543427,317882596,860960883,217725673,796230201,270383750,57267776,219815954,567844616,140112422,20378020,481955776,69894395,627499012,876682845,523273848,718028871,200622404,104396816,896125491,878310826,114946751,760718913,432620200,461051236,767125076,726819391,559498979,461428418,663972009,52525451,972454618,694211056,119542619,48566166,793723258,731360620,929028559,622372354,966792788,818093292,149145481,574683118,465203667,483051120,151988180,900263555,352770701,962305987,570356530,408178080,186222042,743164793,398763577,515954930,115541924,587899780,259342613,526976928,471647246,406101023,429841973,12030281,122448527,496038041,172816011,913784711,117056658,862187510,358809192,372009168,33190159,274232671,528595035,104389253,561992728,571678568,152834276,88213498,633523034,190689190,660593584,898889876,94689287,157464182,800653770,455380288,92266155,820031107,505747481,357638341,20869234,709381377,891078742,602441194,991235600,311574352,65002678,223811401,354350710,393208417,639661278,276941042,744008423,545267458,997444857,798363117,611080963,170945187,535616801,7609830,635351146,58017938,942886806,816717229,998479826,806196502,63258769,771682474,806574863,979921155,275741820,916037092,525139901,16010584,92902922,198798685,872427710,667158832,926368437,217879909,448012428,667211014,803391311,13570219,441404151,271049119,502706324,577498748,188351774,237369940,599449101,888231008,132699737,634927682,383309431,978149464,563702241,238692501,205411711,348406048,265521945,156311149,748980962,721373267,220806085,236128579,63247597,145441161,31676150,952592241,520184680,130968401,808156010,991476442,64438552,686985376,291128160,816215832,806929966,712707757,962972580,36366846,770698483,655528724,673133736,207827134,935209694,429493243,593376112,751236294,972032545,42881086,88369235,749006077,143481072,448198679,295542855,59088474,962537604,375197577,933689047,848804300,120003079,404604220,249899138,369777412,31289066,889322394,148271416,709636770,533996530,545518897,928412836,218355550,999659774,162746068,526482245,747444653,315926599,198774009,103193109,347279834,664596070,803700443,121205871,292576541,389351535,448576336,554878182,109104531,916301626,469174123,642512055,152331269,224109437,713969399,692553204,173311466,650962308,87307669,648661982,434939302,783492904,942997771,327200915,353137016,676511251,139146917,618499592,94769842,949825576,472507681,835046539,821547828,581978633,319851324,589634027,489544531,558059438,36866595,580045338,393722033,682070802,89240106,707854514,644390996,519437951,672617402,326757606,699398663,615329010,346405696,212365655,111742271,151641219,363857322,464067845,720643589,49031243,581864300,545740240,353557343,151012552,889774357,154478969,20302760,926071094,308381980,97897649,186291719,766742485,739063395,186044095,899893211,925355103,159623125,371765350,23286905,126945737,564213797,600984674,926802655,866309472,917147822,13309835,946054713,165617581,188855933,913814243,820422404,639825219,91835204,226510013,612766007,219687215,758633312,739662545,873044979,304180680,353608900,810509629,539540260,22687117,197769900,407002322,752610159,440261483,393580866,456960680,529605666,555690225,79230772,191723864,77511748,10353485,64846988,109118287,792993649,560745461,290719991,398570390,564028315,424050925,318650660,884910649,14517199,324911482,529342231,777610543,507899137,13298734,173523050,119108724,405565264,222296470,662709157,95586935,797805745,626242925,447486528,418344302,251223436,359438850,217252939,647945873,136713574,85019575,285845279,280685814,612387086,293612909,982224404,331742117,515191385,960521569,851435684,396001027,330417314,724063834,698514136,426964181,244125440,115482888,181638884,23439579,397970361,423780569,69744662,819946619,233241312,722053587,917526090,928409170,949719666,839961958,476111306,478651220,217312878,655340646,659590437,425888845,350822464,430541433,30436266,27171832,848920769,77497562,564907961,382897140,491225568,893960886,797995168,662391639,54029203,476210718,1985057,150598294,15286023,361634568,406441944,717250279,999728542,525551266,339887551,183568637,451564967,38170449,226104468,239222133,309980725,843696031,164671876,681282596,726763746,978778533,399046689,979251020,104706179,446117069,24167006,93439137,414008180,181443558,888079144,934826558,639598854,582285943,189843200,326941536,643226526,68522062,392039820,326404322,997183994,501984548,184027751,577959377,694713858,187222667,587821414,89728898,333047070,972699986,168638669,779179490,107387602,770141912,684153093,726566591,605656673,992194909,609316608,582201760,922463166,946961847,379433190,47654965,511553580,96958697,230689562,784464277,881973184,36666825,79004733,126127194,253389969,265136982,128688949,359133314,524560328,658040339,936174101,812917585,207867459,465468322,990645480,130845747,894193879,625962647,31821476,100119029,220824802,343683776,355191380,844468647,58105684,270150181,633662309,591021890,193037855,332416946,326645575,756955871,257177647,293110296,124742301,38286944,391057355,993984243,410860666,968266935,824278157,225977902,259511018,855371047,965653911,211361798,212765426,181221105,444278867,987255628,346683074,372268985,897945762,52329396,179346949,10110033,268116518,813626620,594221891,81342065,754960472,287266428,336595518,481923406,171346736,49021325,415172474,422379993,152583947,382922711,920997365,933564557,903984517,968458341,893755152,487707477,101968987,686771359,634606666,430444460,400611055,708768040,172658371,618834300,484777679,105494235,367598870,716734249,916746920,717800862,308937366,842335563,714584895,92754819,443072367,36962951,613543474,756178271,72956329,756837644,624641527,450077753,812368515,569582557,639420820,530530730,70855344,952804748,796822535,488323053,710536584,624784899,712247310,459669370,957401909,751896170,325150242,247214257,696644101,209540641,669350785,259300509,612313578,205647600,811003755,254381354,540454079,703362590,310551973,61748001,357029884,324929248,827935393,563601238,688618727,825571006,480054575,181180246,112066723,748212198,331153532,567282947,290076127,521587799,297890739,865269216,967939475,763108878,591551240,145383648,774065297,52491731,405722578,718789221,94922972,583019261,984322013,79034581,189309021,86413318,88163763,4648311,814751685,175836523,139922367,973607282,739682081,846881462,15119518,710668680,51943793,579441778,987107348,795003339,770845517,979245515,657678575,505478916,138833680,210419118,401528195,90754491,390319445,329349108,305099837,414990001,857544998,789004947,887602582,515183612,829880758,47096088,708442429,142565235,295133171,763464074,118879471,640455965,748343569,391622282,105799166,636080402,222700226,651680239,623177173,461000192,56712215,265415393,305953910,884493030,585529254,13080002,230735129,757330268,107217085,51746340,762837923,539599271,221506416,269173461,43293376,782297746,976308666,690181313,318150144,708167756,821103418,555230704,945995913,531871050,122777114,369127387,636715704,369824127,816428071,433568614,368659805,367999618,9654944,2348861,261074690,573224009,564278821,546359395,22277193,750628173,488761133,276391134,91639255,228162464,113717484,136791405,684115054,294266540,82898739,709703117,649090559,841076931,242614763,347854666,942884328,775069483,104481726,968702792,914297237,348167974,559179521,741770175,788760390,279321799,162223451,332792914,996067388,62540329,434279629,788292097,791634514,133062211,284577259,443910144,439600530,22362030,821978563,231407190,167757613,3656827,769222782,475742134,716428357,70587370,950954446,118072948,970125786,208237278,238565314,215263449,570325795,39098582,585828848,605905419,84923059,372711005,737041314,767688502,458901938,151095589,930872147,542784812,866781406,613513041,37669418,188189617,452459466,246651035,820506535,260836358,655523957,593014767,120561820,998408197,602327899,87086535,227030138,410067225,724827352,646059280,433978306,811902308,323976096,988178905,477309015,281193560,201634451,141022991,498947096,673179515,184256209,915664267,701521067,779351039,50149420,840690894,989920423,829714630,47961370,780377965,129825526,927208708,455412724,282912938,181933086,525641652,859005053,558345568,757907633,73572405,728313810,906395348,685105665,556575019,65061648,7898769,196581625,910500867,612581725,624448357,350953210,480505808,115580914,681678219,140569988,327776616,646030557,158252267,161096483,364689492,417963506,293636005,222915229,324773435,356669949,924974066,405006629,570736260,347849249,851840809,762485961,859603456,25770201,914028669,129312892,901303658,8417715,328572459,929840554,384670437,23235767,267469371,467423804,289671680,959476589,468326000,627515745,364935798,262661154,467120693,490252397,924766487,4172248,841968941,202241304,395961705,24037529,857781423,467632628,504409354,490057969,597477316,960695218,622470780,119049854,563620821,17750208,620497501,520909475,782201153,352870115,485673438,921108797,13423603,710669842,716968458,558130289,287197127,526358680,818171345,460982252,400689566,28302417,523310041,326324622,657666094,295710749,733399285,833132862,663611772,85968064,756240864,124956880,497232550,921575951,67924871,737963849,240348718,917141997,915409060,500202890,304472803,968352867,121053634,881412929,564900697,260811092,437899717,354085350,435291613,616838009,85831772,51538376,562554269,272079920,854530977,878982950,319411515,433193683,716666851,931472381,893499415,839008081,624169743,756233584,209623342,59306492,917755992,142899721,828893501,486653218,562907150,907983593,254430547,367240830,141606910,368434072,869072381,108719151,881670907,398748227,257967480,37436714,572100783,806550840,576166594,421159613,116493757,198466413,582899500,118982533,18113930,84100792,230749996,652694868,496177600,577921899,64821112,674220355,497784913,467722657,224548179,645455252,19497945,722920780,814558381,867438420,918529104,251691223,779084018,650273345,392808410,359194570,199584851,846112721,127275060,804178164,353306708,233557401,946615538,1468768,501737168,675784454,661287973,39088986,631570298,937815012,119916282,93290688,66509484,926379726,200592710,605329758,147206867,997630903,777754592,781447033,917782226,583814559,318509970,667817466,51590418,82719094,630871827,729009728,865270939,642392867,296622200,812749291,526833848,421406755,182263479,990610931,904685773,662544629,477848486,403643000,127060127,900809371,143387047,429446995,23107398,818981726,48670190,956097470,303026367,280423132,137952937,440157046,431286785,879686870,619798142,297179575,797637750,97718254,111662179,598513553,403882723,8600941,113084547,88953834,398469726,226673536,859108352,501513283,853411484,243533275,107405390,714599759,549595489,517196454,299977900,584445791,983186537,676947341,878576959,145393141,933614148,382955385,322665636,645135577,148708936,827605891,113606996,72798167,246092557,24101377,344917603,764768946,575026705,590398013,90450282,926951145,67013608,16278628,657456205,856052198,321835464,724820302,173064861,8260789,45622246,121426543,706443551,907161041,314700965,74379841,852462289,115777017,244140537,576239589,500502931,259316018,79994763,940197297,711296053,858783569,130831274,650946168,170547758,298478539,7005581,778682929,351621463,619910675,395543128,76959762,677564440,867246686,636517991,134807608,702177227,862992502,3407854,86722287,547564943,749548184,310233764,801555210,573496839,854765337,522904176,740381086,857640262,242623348,492142761,483859530,499528099,55183770,553665464,408810997,86239826,674272435,225609826,515708627,63873275,569288003,983819036,569939799,994114751,456824975,396295378,982607277,324237687,89771548,695360551,318773683,805074563,386699172,967467982,635682037,969830612,542215154,236979057,117824392,294633810,960638335,459416777,7038652,772980735,4127373,649281307,106516342,11776974,367106494,238326827,501979734,457623922,939295725,383939556,476737035,257860288,235860770,4632675,137914589,234115719,592847929,818504270,614001786,869093467,817616622,727687379,322409188,629981335,1917635,810415318,308960352,874156196,7557045,102698720,273513430,325213430,309214973,858604049,615627350,65638782,177393094,738428822,465215341,33761107,73199697,345134904,121979559,56543806,143975468,374599085,612252238,174706220,677294091,618458337,401397057,827180350,403990350,670004283,150718091,235735624,694282431,526163666,688054694,83286610,224673582,605619826,372907380,97053714,34661703,29647493,69208747,402757802,74901448,236197972,22514326,27112366,996959354,21427362,938377594,192318790,339014795,547544074,605824323,869426234,967980650,662158525,431049499,979566940,764901256,651277228,85200815,391483734,924706577,997264878,68423358,526100270,977063191,841086175,43473602,516388834,965715511,99189351,628112185,799368290,118132976,979016382,101607538,261370379,40880316,466661128,356278030,573420952,372311106,812894831,825440981,442208047,897227309,862191707,783853240,202208913,206071237,341136226,842696539,339057586,59710989,126202483,518772192,13602702,780324510,24385919,477742634,126577152,811856643,910989510,235270038,666134539,890945162,859350850,75188453,410418644,188675544,384005036,577259395,460513197,314238191,738988164,276141747,195159240,626796289,950919266,319781266,205147799,207804358,552413462,634228431,161394687,288658248,313615563,11897603,40013028,129558663,737009561,234015831,61513960,718470091,819250934,632786821,702059181,26477027,56235016,835066388,948128549,660840881,760243261,28271624,5772090,374752515,43466601,984680183,803830477,952182240,278770236,629522345,523102224,128511597,111819053,87611224,101038504,642055598,716087989,792473335,405762651,392296132,339272812,382047077,882097187,327806668,944093099,409025788,401264869,960001703,703982410,344953547,221396107,562693745,468769405,637372639,466491015,644672486,955473087,900944590,61507711,613443148,862977767,110261778,477272641,462834320,463625384,874136150,463622501,825681569,983781847,944904276,364597167,13740878,955164895,809107518,596580800,925336335,51210771,705969397,173484282,260513526,879158896,129052290,609311716,145476847,192977243,461194709,823970718,146796501,897565551,104574060,934603174,180151260,643263128,890713298,109896249,190320523,113879678,360797247,218489779,108162930,561672657,841717634,66470427,62927305,495734320,717649527,60417315,260005330,573338243,336726012,734673839,779725470,693738874,773514333,382374371,294981573,8535066,714933560,510316533,633262591,315412405,146650039,228957295,942045288,351204663,411709085,195259539,165037935,36680199,156297904,526372247,253213336,236928376,620533894,132566626,899719821,951651598,743183308,916966604,115062556,914074970,552988730,919844541,885404412,77762421,75930949,4647034,793289146,232196246,337498501,625973158,1458431,682508278,999448297,903419423,60858071,432361903,414820851,162124595,464298700,660161349,76767172,735671604,14787580,574237655,213736545,322948962,112028365,310550714,40587988,55493148,665435638,29417937,91985505,398113851,333428283,144317358,825777021,440559964,115183739,448808935,169202281,307366717,7220162,528652011,914501238,481845487,216267172,260029080,972504493,384976534,79862174,652236199,22757236,228776286,47310672,374493492,630529265,621042557,884709657,931411949,232323860,334823352,761900502,609728631,64621380,50765434,456619957,98041499,663516444,985779084,945706761,967060680,232608264,819834086,489382828,987800764,918849238,337216067,174072214,551952062,321929572,159009811,801215187,94159797,434217496,537001344,300798845,349682877,604855547,412572109,22223447,433276307,750823350,474133678,600395776,619128557,135387784,70282093,701088357,742223588,966821740,157205909,754826753,187334842,118641570,937021152,809896791,976990229,407792419,939847134,61536031,734912319,492891536,976597651,252184914,132108998,5322035,839086227,144590987,775187261,936492925,521920190,234913913,123192605,116855105,976674955,403949595,985034998,531776663,890919874,79830365,679148827,371730162,431882189,942202241,48651509,642125903,897704124,286086824,45365335,98490660,770114430,222263119,895157478,434280442,801956188,663261722,645128655,32370882,744051083,469275500,553376716,643769233,806885445,111926957,546648683,382351893,710172405,946479387,67683980,191297528,354533537,525519581,600336334,974591932,108825455,166333519,691229086,393696710,463488563,929090672,873326967,103090771,213242224,604830503,346162670,215773545,199069610,130896891,399266018,725051298,907930986,370264698,778653927,864184849,922852482,254766340,568462840,206377,321094592,803381411,201685988,800183928,941658960,300640908,990203012,136737012,331458394,248647640,17708418,272638040,290414160,907941136,540855748,11762532,710336956,564604397,368842864,504210006,80078358,197694815,499553796,487073249,825412157,105246726,941155910,790319215,501668388,312777572,605663326,311033302,561509916,254013294,796920600,136501508,106783469,560918238,692594314,71268658,309438558,675934919,42669581,681088347,964009519,491352865,885957918,436098106,139180331,594131534,917217035,822067657,374304979,964179990,61491668,550829869,143089713,313078907,375233377,180874578,269671941,978795795,689169123,131636921,513574837,915508166,225415207,392230741,594751344,242440401,919341248,223514971,667218994,937511171,455711536,10078928,331291939,391500680,62034352,81785269,968460581,138424254,564625855,729487470,511767567,605492334,732138052,755921232,254890572,863451486,127617354,676188972,17571058,904490745,532192680,292983005,132846111,947551853,912750866,921092919,392056988,821968320,59253089,581738262,574903221,869507494,186233823,148189482,332572032,785692330,47023485,842708877,753443774,565926906,121415157,308057627,734442650,41615594,501103083,401631025,671534654,456364793,104467445,290208516,392144653,940848906,925470281,154957546,621295458,840249470,13358196,965879462,500208739,402776946,603676078,271094518,118243670,898988215,747472860,790001648,813792182,874833709,657099801,160937464,194045875,94339910,727935884,204065429,196280944,358944016,490512489,1165437,846103992,626061688,696403563,461785769,20497903,703850779,73093555,708689957,800779615,215952134,53131286,417305228,114859541,442464090,551069647,878071265,29107249,372241005,634707324,974719819,110738617,108592548,901337933,229972571,471414775,949642,721226143,43060311,598615094,755977241,196233835,360161631,627614971,678122111,502604948,228177385,364494731,439582673,515218009,407991137,984733266,903017880,547554389,572167106,773757854,534769593,446465434,229665198,747847705,647570622,272320958,610689349,31539630,451079179,670487543,37439392,824131351,53576754,107329894,7264978,843401014,294267029,91117362,253662823,556026866,442188765,218649666,500416445,953229463,699578021,334831622,107915814,57866408,336584321,293735427,539395714,95291211,329561193,574645138,826873807,901394512,387917246,757779808,427206346,812203879,97512599,950185888,878799102,376961826,520650932,731836246,125918731,483193131,391283410,498323334,927029816,596258527,158366387,724606254,870527419,148244122,457927934,960879537,218331497,240895934,731288143,710907620,772841079,951896275,560502353,499771129,637800264,63649802,315366008,366855660,317527083,180821186,372312597,837954068,89242428,746880368,569406839,626590619,641707223,510421727,608279571,125568655,41916740,912991542,878188579,60341422,545998170,393619559,314295353,345204829,504230456,423781508,85526435,776233202,188270489,18696592,493987860,75162296,325303014,667369614,174014217,931701552,450209118,79757845,253283765,420628579,781339907,117315544,332360062,370596187,907538609,572540469,606418854,124290516,596597528,206483831,833152643,203092461,816455522,540432502,340717951,48178133,714503568,725891930,211068903,939551524,388186055,980685377,442140514,762200178,558437291,152012447,160635377,411836960,403992439,705114106,830993974,75059508,952250167,420419325,559375223,528944973,543346278,713405880,604402537,388767627,17747746,933623736,544100901,718474181,95012986,302905981,50074208,931107879,209765242,149252498,225834190,991627081,803249647,927590665,78008013,115649821,46819590,710812906,973961459,249883979,115000099,71381593,414558525,841157385,240300072,99548675,224819712,121164511,390417599,979023386,219323766,885575488,451048037,147083949,286253146,693255542,447109419,315702858,378821247,707168621,1489227,845591581,958409668,509432507,14844560,384416868,263490300,163170564,864030507,476310135,672886576,348776308,46030824,545946048,665088752,287250807,74053371,14953362,651525591,964470462,648487278,646172821,401799668,358433908,300040499,282042115,578396454,243710987,799243680,378317775,835249305,727447274,581931747,886343391,826796945,402553456,142446942,454466367,764381437,504613883,425588156,385088313,811048180,1032329,756441483,201793119,453250998,458006055,919354115,232749218,41364317,11331347,112883024,996924067,635380175,545908341,824325781,819373048,183168103,162240970,272729678,37595448,299480896,466729082,705402330,232723801,821202220,68312271,368071199,65233164,157127378,227934814,937076297,589235159,228220996,97464808,353983973,878932021,817952881,84225098,965455869,823332129,505954482,334715432,302594131,251262199,803907169,93661037,55535608,379060858,84838335,96238384,9290853,971017296,159460319,782968555,720198716,954963898,578434586,91616933,60018032,553233381,382221535,873750568,632618190,222383033,970089851,604277733,645691868,908357185,297961772,59120847,945104124,575958856,77190694,263871270,330703835,451676409,118197565,710058636,181847451,233857854,346856746,143690642,675474375,99262583,504417340,624278671,439502833,527852198,149924607,577530496,721940410,369865320,508758822,222617578,617120372,743560841,612691372,112780417,65386796,591736755,115850606,126445791,313082454,434847806,393203279,553306912,618057052,99451003,523708633,228504356,771950456,222602465,156094759,52576457,36733882,851526663,570580011,16739600,608056599,525561898,518579575,278277499,583521105,828879533,44871620,183535821,693005033,177266881,764650578,940120798,573061007,765166432,20144388,57291468,825028820,104952708,294562678,765122811,287006241,465621325,267199607,435488972,638883428,295539396,953061,985710698,150848328,70123814,188376851,451817657,990163985,835315292,43512205,958168033,743240356,875772340,45780420,425351892,709166559,428116263,279814791,650983985,806138077,81309794,567086844,289140300,618507517,434986739,580766563,423427304,574870748,323733783,417613030,638615392,878604216,603501540,485117999,530285181,238880595,12202500,514944544,313853598,717584554,175437526,83452151,273480366,769506782,953962840,140543378,28025993,172419167,893499966,848268738,501725711,483226655,600216209,103134704,158645577,121985290,945843301,114404813,596806604,425456869,680536420,70685596,247333759,203125499,578746610,833815585,253235351,961439550,40535400,112108857,308874689,788923224,868589190,932167671,841820210,642981612,247219758,434594339,635172126,196712445,168730382,966094812,824628895,825864174,905340435,928030628,30015213,600006424,872245503,899773077,699241543,122096817,27299012,838951382,25734719,317682695,648708423,67989542,238932190,86381087,693940993,875561072,996987860,707549126,954185821,386196329,106120269,944912651,298334370,524419423,644355073,63163737,174479650,164299395,508940301,332272906,53248942,247265973,418351266,368267384,422052234,293410797,732811667,546971724,723756108,614509126,599000837,796708901,725960062,356163427,794771978,177328484,445507130,510340468,35538136,81976464,34391299,927418406,477818294,43689703,439388203,394244366,78008367,914578077,418773491,22152018,587274173,275162577,918118226,935999265,814911158,354110518,858290189,635549624,98870390,709785599,887881886,914478646,895120321,164287812,314264820,186541767,674331927,225491870,326200713,77116247,598597697,818090931,109464154,518034446,499207562,755864283,445232376,980495862,197424134,245185523,959450115,816356060,223279737,8608450,593793379,321791822,784307786,399312594,153349061,150270405,946906541,804410317,107618532,1910059,37590555,10222823,602251557,744468766,839801318,71202120,131596617,422142665,458779545,241520085,276954343,967558330,799655804,655413480,883711475,334836251,978693995,125700170,104805698,325754324,810085843,859419899,295232771,289957627,470420524,115937192,788718115,716289521,677632943,871092960,63357121,484222313,508876108,46359733,778952317,584258285,126740489,409577955,884579628,893498193,818469927,36798985,5250559,199315586,970048229,697715357,241292479,746547595,271458322,144751626,534584709,841108762,423093311,610922760,659511013,238493324,945789744,7250892,252152543,942554670,676958418,64748098,240052635,590347379,386928291,316282299,527551546,391833737,364756057,182216392,199219722,358861981,259233891,492664852,668708379,992779680,493123148,781354663,365319636,271375479,899892972,566833161,527478835,524285029,533078762,152977650,557438091,538327223,110010728,759864007,96600587,654385733,790236822,116889237,757352901,487609916,255239838,84092785,889154925,481103580,631938105,677096320,234983365,935967300,484696825,894064704,602402069,333661725,565788336,939952814,897237566,241602528,869595266,306912758,27003612,730657367,846873623,30853092,442831826,643662727,957301328,208914950,890780383,237393844,646698560,647960453,381759634,700515049,844054267,536071965,67616590,206157445,790034082,4405351,819268837,579177473,839900507,590787996,202443622,855858106,561719936,488852140,12967205,482439597,611539354,78166714,280948812,737627178,669865093,313340477,476473073,909396826,591338883,78288265,530877891,463139330,501982582,150985189,429884416,725369782,818240633,832527090,72336356,281391090,581058936,249394443,477303135,182368400,399513109,228437372,793634015,378937166,153430538,726675766,293077251,214849917,62544412,857407679,628568161,666000912,585538398,19279563,909068291,157597010,885610319,243474076,112447797,917493397,378937919,166086209,829657210,230387077,995566176,435626255,591693740,392897501,63568429,533687153,788270599,430317628,416429278,277669773,313909880,663516128,625963003,37804768,877059911,211149747,943791563,783561177,735957013,516689349,721503822,267560323,55591843,176718856,143928991,947965215,270191412,326631726,524195728,972659080,628615174,308664756,555546587,605569131,875381584,127816691,731478637,765056631,115181206,406236804,771451015,418432166,373448615,603655771,722773347,129630528,151866038,994906608,880663692,650354898,615986034,6094898,943692786,477921207,625864847,328559101,705332648,209062074,216009804,22390976,101452563,597167779,53274153,25492319,538633189,164435418,647595215,685655509,414889961,176172718,702405860,410660039,743812593,755941364,593249096,118467098,945132473,697915430,308952096,89902673,751694779,87855352,263635575,457323842,190818459,685734020,379919269,834271552,681243201,419157050,819155768,826310437,22769510,435065404,109910640,18147216,643538594,18481644,821819049,845422686,60253628,656401568,517658737,834138762,596925318,627704489,35167490,502001505,823529119,314776696,992685689,60900058,138037412,150918233,304554924,201076867,152621869,20277765,151475060,73211725,754310922,107697813,541407248,543404797,903956135,136936998,545139449,786459819,61309226,424989400,266235878,417964845,109119156,807598932,218601084,476877349,468634039,509759924,15753363,64756869,741971901,677180556,857759239,94786140,430767484,741729551,105992822,157415991,783686211,896941226,703467089,66866666,132581590,358241191,208529527,62448385,597986959,936330531,147069301,40064210,196795959,217845111,656141020,433595795,32512294,766257498,823316405,241681214,837565799,6056286,649245971,305602768,277816730,636332532,372303264,681094337,857662027,608427703,320255885,946639813,616480115,365674608,942422589,250051629,139715071,430045635,494515290,349743718,272905165,485016741,975925622,694811746,832426283,525556754,432124367,72025662,940481482,192626054,1212127,483339175,698361271,5245773,118877284,810720478,142817178,27550456,124508465,403172586,810746617,434651704,599305681,625254715,811488812,816799765,238178731,953392487,292038742,87981977,682811812,12998363,6112103,439878643,401639927,614129146,655127918,379238235,918529927,620028453,20532905,937624324,417011782,477879913,931836589,926797399,777971880,138439155,22088384,517777535,683293101,512087998,341503788,577860132,967165368,637594411,898845725,500127077,177767359,379228314,751787680,649242459,246576584,362187156,310875294,846331685,512435714,890599306,134494930,96470444,614555979,238975561,667833837,533759237,645281318,243672854,951320927,835068174,185167273,195531386,439003170,365445676,242246112,948893319,629428389,91467379,486926179,855595383,234080347,791329303,505369650,449883665,52320215,463515391,379988868,649516876,770757231,495422713,775437972,855225408,458361463,450245430,335548560,272590898,852603635,698400661,667273503,706160287,441310287,486455449,386487214,700057170,590932855,844110257,477095895,639747945,940574733,405390542,226206041,798875897,639439835,57137257,173666768,180072081,459985322,825156232,98882545,352548193,163076256,426479598,335168478,327003665,539944982,736903899,398616822,196927292,484696617,890568848,977092393,977379120,708453937,335980191,877540752,702709846,431806869,823782648,280871305,227945607,763969179,225266040,32664619,385921548,575821874,69901514,747148045,773286884,854606322,997822718,706622003,611436511,704189482,530245357,924063696,929782146,757512250,18304912,146451619,982058227,686288925,323294438,475992556,630303617,123543915,371849912,297036792,190862447,632061758,253343575,632876671,64684484,318375784,205531942,221644818,93307159,550359003,671695792,17127512,685242642,711263811,316892275,41999943,163900716,605298358,412445645,689721577,33818133,445678523,888953903,604515542,347580437,628884819,900126046,189140585,610014535,427358967,436842801,563345892,46490868,273928124,498019478,469594387,263438162,286887198,612349271,12561273,456896483,450646687,991529087,949243067,272213506,952227232,34950780,947702407,941123228,241032841,677779023,971754451,456901100,528244606,509696344,154185725,534201793,493385422,894426487,240438009,624877256,909986340,554861024,175235094,769123399,745874278,839921385,941684542,730597582,989550775,59491635,734487099,788669937,906561875,188957660,830561354,393949756,214443969,475205895,86772650,39510815,278799360,764504344,629849607,935448786,359966615,497464706,735475971,228772465,983091125,73357857,269889221,542674883,373709772,697954176,753134696,459198832,491520684,766029626,288438995,716576264,201955250,30703068,68862105,19196649,101489849,76349934,165603479,951843619,30018030,647351743,888588899,912344255,736654205,703998480,615042037,965701426,655441334,558875075,712892125,766678262,659667434,719977424,383192901,19629754,352277487,908287808,279426180,562049849,738732637,69445330,522514498,840535303,729407555,316119809,944065763,304094705,701605653,53504294,598504812,49951314,658606999,77115555,941472322,458783336,98214000,853730613,312167084,82609745,940526831,600301628,391288190,785682216,84058909,881327484,69288807,39316084,507944159,562962066,683473158,243338703,984717433,636912649,177890026,500430358,187065254,882643348,917200007,535878061,749134287,3339248,288166314,635615413,204586113,150460922,1442113,53746583,375688741,391726385,353469571,823312195,170923744,175224300,794730063,827368148,412827689,668284144,512134398,328370010,29268927,735058082,440741561,872317224,164725699,438402110,207869913,861217769,240241381,260612685,43735493,623023577,26995867,600487152,361906411,680339951,63598407,37527399,155781353,434634178,304746199,913847076,224762988,167804243,639883590,72876601,209827726,406442508,81234496,94531936,453328150,961721141,330784396,805665136,722524995,250545758,854606586,795238344,425607258,60640696,719402503,664935311,62872989,144371799,947788330,237747442,501674274,411703574,102636162,369584771,881517651,970458282,354046609,931655273,819881612,140668663,986207341,700971219,920968869,809137354,98034452,131034671,567450831,171240290,407467050,120842714,69921292,286578313,508864948,213298682,553720109,120208090,141213959,206557556,72248718,394416380,821564018,499578894,908895335,545692812,349413525,372823777,484916671,294049132,723889777,920621784,270647053,394655425,544226039,467163478,209339892,590329636,88721690,584771390,13077989,758429129,602926158,197585891,816351775,151261742,782943393,90279560,643583647,982708837,883672960,42019715,289187298,408402903,462833487,449625153,647971256,563325655,706367609,423782425,100938454,107998895,99703706,121415591,522373287,614685673,625764041,781796306,138541174,27711579,892040501,734339178,243023915,782021389,833565283,695882000,285811016,497806151,31691145,57129559,251307904,779092526,793267301,658025909,693649091,619036521,381517310,922742875,205580069,30515307,208130272,587599119,648584127,919408895,360458100,960897091,720382997,111712440,88745111,185429559,308804894,408857237,863395506,334245141,633842813,477268971,401152630,14063055,720521371,935375542,276438354,885265795,688488727,581123231,975495439,261682075,837104047,42346432,692374045,309669800,267451919,174108040,6595997,337255582,838200819,941419191,920315688,214037453,292363846,316575386,365518883,118131092,154373416,186735714,786515509,997291056,153891935,684419135,902967191,695624366,457745094,35371304,425514687,504799899,611496843,363684337,704192597,582599162,366169061,308254503,102875357,94767842,123232998,2761678,111344137,341127531,696559674,938059699,84887044,205880409,635878746,335456550,666641053,606969950,589604978,794296566,777013588,212294687,859445320,515462096,215394052,263381700,692435433,548439338,620140842,968992603,490183420,558448626,135498370,426912279,371808526,955967359,263734437,178435251,74092345,522505733,693221948,882495061,572424045,797164333,937954745,320925166,457827345,63258792,979090457,553607485,227336522,471517241,575612057,45495911,731555001,694001310,889308891,921326495,377306595,665711152,217530794,22887564,64693913,476848987,784932483,368198260,407768813,543101092,887532072,123100620,718346857,895540743,787869425,130237151,402939142,975199181,370419741,882472912,200165802,20221590,320413,90213997,896171375,649483214,997978575,178626955,794072757,517444441,172928115,857454414,621064728,109854007,627842876,213554152,759458527,724149168,778217605,120855583,286210575,770743323,261670957,4748890,943656447,660150212,37071260,872366346,783297731,603187385,293060786,292627731,249701865,349177395,344649092,753893285,530923695,439988580,101867439,334559192,617130676,562235100,557278900,10287733,900215349,690056106,6774673,45295820,77635702,93648363,428480846,757888909,906361784,913974095,5066252,42130062,557832171,364673773,153774273,61378970,597176808,205024556,283942904,312702472,490941273,410782115,648060278,59518409,184477717,343581929,145437567,118755439,348828719,133923923,296511805,311845595,121795063,43665406,31028524,450855225,201459959,148798172,179911696,911878274,494846126,467653429,61033183,435007062,922335224,944124300,933420995,638621630,190467704,440067098,67014396,822501122,217100293,22886776,51449997,77168416,36928571,621675970,793063713,383806040,734722339,240359901,105094678,887673890,359152099,485774754,830948231,453740554,96039159,15421347,488541389,878121020,865339534,795269032,941380474,269599069,754036091,783580490,267572026,45262742,314672334,238673555,34469936,101586818,913129339,46659111,161126000,860781711,708370585,728061705,171255329,660227523,395975012,100204631,512053969,124083454,56968719,488532249,931526462,9460204,876837328,972185982,474213098,580702647,349191092,929359640,891883427,241880107,885393156,888582829,810325765,951326728,725544159,601511225,39127077,478787157,354522390,338171952,59762233,548986882,25756840,689470342,106278782,668578417,955991993,677758075,826702837,175385369,354333099,97220340,540177591,351396068,126664204,481961029,803676497,866229096,713752037,979812295,800636869,171325181,834230087,777319524,266215167,862853646,817138709,492359598,833271695,56515778,465887450,237973766,803513026,59234224,703147716,201153371,645446019,71340336,514130704,313525178,640280555,947711346,298382423,539067616,23399066,864552017,444372695,416739177,191174972,235197070,232739941,92467200,111048550,229690607,381918190,863377025,230656396,434064737,324085900,893192508,975789426,907754290,695502320,346980197,71047952,687978688,598832346,112364311,868849264,8264095,894164766,136660456,192265349,233810486,905247839,371769656,302679269,534692918,512293778,652564601,247242356,814398925,689450144,559789574,257512711,836585072,909868195,71186725,872852852,370069485,438171261,415936642,380849687,84916280,258776352,392741467,234083569,52502879,947592083,234391407,724347429,815422938,720167459,429627499,702333057,187060018,1663318,38098215,366572699,4252497,43230237,721120573,623250390,337053242,939461155,16837919,113020385,951045325,290971232,326210583,888496268,502978685,860102781,827990888,141800634,329386046,925916803,10180437,889870055,969896677,652569609,331411812,258722544,842895480,387691679,468663955,12558136,49667855,543983949,693324142,245564550,532800894,925301115,252246809,379399685,691557852,831321000,483439618,239023125,112736916,688770558,229910976,583671257,850495481,626394735,851473551,32431696,204625490,812270161,64030526,64721913,947444987,909632582,258722681,845198039,432095146,580908315,658369521,26285034,538418803,501712141,255155665,669397174,38960432,411425445,723089353,352797498,265199519,179748308,313299805,147403838,806133784,216178765,921656278,270497113,815076070,185324277,893835389,43272158,71181751,203297678,177591769,930075900,45163365,791926742,602087266,337734998,512832365,321683144,105240287,832935637,850839913,765790996,779773301,704655913,572595164,732699141,803230889,819346381,89480903,459962399,439889371,581945423,909174501,942668480,87774372,50088362,607467666,364783202,638442407,473234037,158009949,383425151,421066788,910889051,48844341,26559542,857107465,877838757,623334009,949459197,757226769,515193039,988320347,61546131,904663019,487139573,147141047,38877810,22797491,905342071,162548302,143091308,546907494,644242498,171115712,461168251,586312534,499786502,896174275,343718445,144894685,145998744,813039043,308749840,838069728,92677823,710527086,819657082,661960247,600579869,565695961,534889836,319905888,152186106,138859965,652191113,412480481,275210229,571521743,19065217,39995872,634196349,769676160,298710170,752544151,123843605,527815292,884150534,124166276,655979495,659307345,110412542,863679542,813070899,637132210,720568106,720850687,27738613,198917292,718371912,316640128,99132608,467411162,284219008,865236528,418552259,244368019,104562269,529410415,569073962,326894174,847213392,298899734,436557583,64654260,17422438,761139474,58537986,886377532,46099663,348418052,821778242,952558015,944948298,104474921,61352579,360644693,156503417,478440522,971078886,47119802,668530118,144230700,369316015,866524275,586879618,86327633,2561037,93675919,305657382,402735650,57097853,304382318,240550050,5961627,412817227,492449310,193577632,21535819,175257237,141280800,975449174,484106220,705184704,870050913,729542368,434438253,952296949,59200752,702110303,92705903,620941155,534951312,205649373,47823988,411860916,599599509,121170970,705995434,818109563,777117247,807007853,21754566,142727928,675009353,519067348,886343722,832360062,560064054,368709355,53302821,359831748,378238684,505966868,897392003,482720118,676783438,625847954,44638450,559614925,262649193,266092166,943059486,216961273,40882705,68339542,264888405,38801182,89415764,719676295,764568739,357631303,50065215,218436037,997899714,646188706,668778863,236942043,850235163,546197403,594644943,601642441,451495811,23349204,26521383,8747730,432683623,734023019,578811965,784753423,653704134,72020664,63501518,118124114,475567679,79330466,305754431,679333124,528747616,166829404,81128624,24151370,623623463,164840212,215538454,897367536,71503249,104725848,776693952,489644798,95763260,820837795,178850815,261520483,623216019,906863492,756245863,61491426,546762575,356072512,621268642,389552958,331903981,295177408,152450264,76574755,442181310,93353481,328892857,872318799,191196724,807804356,376194958,516802338,473026298,961507870,248327415,78137784,942205949,903950443,395776623,853826580,570579384,6201611,589734530,31214805,434196345,181516487,113796847,761635208,800404736,357811722,580378632,345921928,464590045,907324401,119830260,795002581,758105811,463887826,197052972,242495308,487658128,272560344,132061135,993867172,590732016,409071409,960995594,21417849,132997672,347353933,909977963,414068785,407053215,253463741,505022986,858931336,466867596,531418412,164762611,58782094,901154816,654313868,582401767,196034943,519372503,720116513,573378077,6216050,39432225,312442299,413180956,163191672,425814085,241814791,935110791,914714169,558588088,538973979,242620585,445705020,541310404,63231336,517637465,476620258,442672896,120009864,311618293,449013996,320695214,887991375,252671553,75621152,447361218,459742779,250724747,567907415,402596637,513684940,618525640,739580000,278689742,69638265,824710818,55260388,841384190,757244413,18757169,364621852,428621673,977284651,61175679,120927196,696831688,67348056,194895223,691451286,187749885,651818330,589567541,165092907,960594603,78918122,817939764,70789101,839458647,961402986,426004252,935962844,409804833,609772302,651116230,881296145,542574234,622564254,690067372,196122335,988169847,325071209,273411695,762836932,315922112,916339578,107033387,904796279,579356746,557974524,964222066,561641578,112351459,91319209,498621705,646783919,728084097,547597673,506662716,500586035,301539877,66789466,982564837,965453676,786474378,513023761,243508422,689701019,481278405,422738233,878556333,591710537,29709749,554018848,53168591,837268941,311731174,553226385,264639763,361863804,171265524,831574888,455567940,951166025,379113907,183454300,677386655,819676416,986906785,926129714,293608320,550592012,292910761,918641203,342760538,18199490,374624065,32091098,922645845,722280506,790891498,382610534,969205820,778754245,757250897,920712335,438032641,440655371,571205541,792604075,248604762,90036450,414127662,42093885,742783910,439713937,573888410,786426771,505871490,294373957,888256258,409592840,341773245,457151568,797398057,216681650,783709885,87808722,65882321,768564351,146910552,666937061,139525465,99831378,119715248,9479544,994863286,152550838,619438326,46708073,629525265,926683733,15071065,482276265,806880655,676916358,712350747,50651382,687231640,928098492,23121814,61271438,582865062,540183067,88926131,80349052,245260157,859318684,534574491,314869767,616467761,512545999,596675654,372063866,952499445,108045955,743157479,482858601,63804994,776194305,682012257,105274291,965967356,829959550,223869585,977744129,400709259,211799021,325742868,617544851,80823384,981928562,654492917,651216085,412075483,910859784,556953872,635488009,210790732,204793752,699787370,351371549,69078440,798645209,57233913,650680513,651467,4766212,441808723,273734713,749349517,473226211,26478367,492799240,779883848,60630626,111682504,940115828,489530217,317484040,250376063,150026368,140343976,617138804,698842396,856084129,65521203,703231557,255763989,510585476,858420298,674807940,635907773,823313339,983129530,511809270,99373233,9606821,193545600,276152573,584133244,379681471,925546438,80423176,905105069,474222982,746823035,605811108,647321729,384143601,965659125,298993496,864931870,593132547,159628055,661645282,601930408,996389886,40313274,880825891,81466197,255289840,776992752,69125457,2902772,542248770,447458100,88038553,633684644,759384813,278216548,706601295,56375733,259634782,787988948,198597987,646780071,17915830,49601386,12796622,910418410,374210573,170476926,462510184,665343995,282152614,288069500,948924740,10037489,196353157,218122838,235952837,404519097,612215455,910999408,756130793,274993583,432341137,420311758,898980301,259957193,118804753,384670539,231971503,855210194,202659765,986584791,809343850,480666852,881785197,172136610,232510339,174008611,837481510,736894710,244177299,839593454,79620588,886867591,692586688,943098476,79287625,147252235,760130879,932445928,430539737,1931594,838002809,908432415,207847313,481379569,768496512,947202704,132549495,611799104,148817670,153109513,626175885,468228895,935934235,721951948,563784486,828005638,596725306,413586452,890417072,219171739,684962768,656893856,994587143,13404153,945300183,369133753,743709066,163446722,210450719,932646202,501577561,140753252,53389595,256715875,122042880,120779853,367921534,844780803,9544282,935431205,64482748,429787548,97309306,242450575,883314244,101025775,73614226,283715710,996241630,50563398,1463130,761484371,58265855,21681953,483847728,301171885,176915216,296667864,432740492,689820302,338584139,899443270,598626235,943224028,41956442,787284478,243472579,880266296,413771267,494614061,862304268,528182320,255834120,541793546,593464342,441139326,908081216,747696661,610962830,125946081,942864581,443181654,80770982,101208148,991273590,157093704,16480965,763166870,773244206,137317176,492340154,299454965,30906765,906440428,88260156,270220393,813715393,731724633,250039040,928131748,582055406,817196557,464610934,258405824,607728312,450493230,205355866,409819133,850112402,630436923,69050563,891642961,702356761,939958215,780990751,484480171,193223151,506224593,934008784,573151696,496397877,778128722,981504071,110007268,494690365,144745596,226217077,777336527,197479519,176041218,285263938,247505862,948176973,681724471,710905930,389932180,617542263,37326868,80424130,714117525,680118170,838113856,627315697,90674934,846183524,169777434,236544953,618794474,962905744,913054194,931180743,286906843,942522786,141084030,170324500,841148627,300125788,922515760,683425558,590809150,557978900,37769498,722750530,100650278,205087088,187434581,1976365,442985359,76608211,649971233,964684389,741969651,993869875,636161337,435491124,675052092,444403143,135500135,18103125,109522579,352499774,703803192,273298846,659162367,821250943,680178310,494381767,253106304,585525199,151949039,242420768,382347995,644658719,517069696,317039841,581679480,941459216,445532216,931960870,513599450,329178857,384153505,925094231,70114715,242471380,440005301,28392217,446621485,911952130,588660271,156012968,32420189,572753832,44927148,762289848,65520981,137973912,438178802,749699651,915477408,855949148,737357761,791245937,44699513,231395697,767573340,670857851,818755007,887676320,399993109,853346431,90649729,422563089,289416194,167512103,24853904,107737010,200191227,300055918,748210670,659977505,281868358,805546202,78106326,413491343,84898687,756069379,390292132,17783164,967367571,741052938,619060013,776347354,106823153,666360735,190632618,709787980,134920775,18217840,683032515,427386390,543236093,216031654,242140279,170158088,546250859,138574866,948478092,93159141,3082702,64343564,30984285,500308930,293708505,86917660,536231660,604126808,49557618,484209268,289628793,238674780,55058511,388899676,89611642,716830547,387743759,343972515,913060459,36476598,467816700,657645233,92583569,712357264,367204023,877496730,110315739,236711521,270819203,933475406,198602238,718226628,229357009,70103898,415175130,467019385,935052488,141837070,148787320,997522132,97124042,862159330,32671579,941371777,123428590,788087706,858423693,524846283,21635083,696103638,70418657,848835858,443376963,861340629,364687176,379038494,63471656,261728411,822894621,595208467,689877143,500932248,32395896,957439959,391402520,352721457,927640657,918223557,765835157,521987228,361621579,188135821,695793741,949925650,799946330,95833021,52848697,317304268,523915353,555363749,827578159,647515272,489537155,434091006,558567561,986955268,386478426,197852185,996987739,705515479,134419044,614033020,39538236,946685529,237345280,184988481,338057889,644694108,111852619,297249917,832392097,305497721,659775448,387885075,217081811,66764871,569196672,596302566,544024791,586777058,510085360,42905274,347413304,114847782,244830577,81818565,528066453,455941098,780381590,190750901,550286714,604218216,438368227,785881979,86970581,864148416,310523051,575655947,635671494,147139480,658036172,73160754,252146394,632187005,210886257,17303849,708476376,358607395,275374283,181293674,516462403,54706047,321531013,902879639,578642971,446459981,138016627,156089807,116831840,231155031,224688594,64947932,451179026,994111003,600853761,81052933,544991311,444188100,609218306,723018624,311538842,261164686,731281712,602821803,945680122,312317585,464596405,14216921,366085008,43059379,789972392,322086590,296022621,680064695,732338109,970795584,373608960,3606892,491491728,279366134,700340374,55775189,903710009,295264610,825075700,538359799,657515560,706148036,235407730,625818914,556563170,865915505,738195394,836958239,739235023,130133666,811150394,571459380,763908854,4362343,303454803,38696043,262806816,413273211,920742879,158407071,615403664,601115474,977674608,25248390,295412271,804825411,848673871,868345101,124731142,998221278,755747560,276447493,245886390,646998480,39243530,288529081,290189441,278572550,454497390,138301351,853500203,734633508,894860931,892665954,508909514,607814375,103975493,50379349,410140303,598544229,919454255,122823620,3270082,273176999,758763485,779996509,161145475,188098036,60741246,616367775,625059875,38801648,890226404,516603379,276606032,762967716,366525153,998125453,145216785,117082503,503585847,327256280,283656571,795271035,182066317,971876491,360543733,252647275,667580806,576034514,348774700,19005168,592278820,636402473,193296582,740379410,829471730,260508364,792401162,133213265,675858190,107590347,882709833,887129755,10831164,650747000,763593407,352116977,712584954,692001137,839161054,47703307,176553927,666934582,97860912,923358029,954538759,23058001,427239856,582427871,427743449,101875765,681515696,704013221,508288955,122518919,886137807,312008882,571192378,778394956,13647968,748131594,123925751,553938045,695112570,445924310,79433787,894786831,1772323,308618759,575453586,175052392,52955954,972489020,124921823,469556042,618973747,680979761,286488264,142895052,543400196,472122059,3369948,804141214,86793127,383667754,203528115,903062781,154721849,954903273,706993858,211731133,977727830,126771966,352654738,13315846,461124434,997363862,230058730,126510510,46309618,729648090,856802838,52940062,705392176,416570592,298229102,902663794,245903350,932045200,930933760,430830856,806822755,851274705,630889199,20980932,25163172,449110501,588149680,164444619,9257844,977761524,693067024,426171040,798706535,87939995,124703985,541793579,386997551,332851472,39789469,874191266,596978535,167617539,442411687,24837495,624929525,640987776,303577880,605262466,16230223,50934792,362557638,888093905,975893263,150954033,906245524,314497344,592583919,321750425,295569829,512440492,177924574,874057172,136239255,555591083,560434825,364828033,598938446,102608433,903543468,998198739,583956009,548376473,711052434,704741261,214060422,471382407,249919244,707698954,531882792,172641261,331266530,318956686,378817268,285788499,473868001,75624662,860858857,650458338,207018467,435866729,545394386,983240106,429797877,625413878,191574059,707222760,118424822,234599741,930849673,372085716,172248748,176751480,692240559,568159314,134274414,330720257,520659541,522022640,163812485,915378519,193921725,509739576,673764527,72113236,619359122,508505023,251985079,275470869,11635998,731163665,559268099,875995552,856842279,715824949,666527349,50451891,481870050,629097513,179906810,829759272,5280886,709021475,137173122,218708223,130078875,97299479,77288186,547914245,384837379,888567736,349636292,614880030,390333424,564294161,804178775,718080854,719795616,829534561,523530403,734981462,507494290,798969793,863044838,90040428,126480839,902134190,727762088,223538282,59006971,385695261,274604981,136536842,55147076,729927984,473035424,114888552,137073389,335474270,171482515,976553909,871518189,413224914,109015200,414915509,605557954,687529745,850403355,18495278,50965687,527304834,894817516,162990049,125082196,455934915,469442487,857938509,167314805,796812290,109113916,719530252,664529107,825736949,914553507,5825501,272431192,108887118,202703560,722647356,159583438,59251010,985270018,186790509,914476496,858985271,580374563,277534245,976553009,856391889,736054807,12829460,876369520,699671514,551663404,119926929,65213395,263343304,47113861,568679731,143504698,259323705,209190172,221469243,437385428,93343293,950641719,950016131,380198272,228507679,620778695,744948317,309680387,90882559,602296096,700057161,590781592,449316663,905630767,365189611,233528951,468456388,464441792,563119877,395340410,171867052,204037749,878546831,432010423,156968854,65610662,852263901,76437195,277694037,514693506,182603804,60980843,348307260,752675676,541405702,310399753,443848686,199654502,223758500,258222181,668724058,463318055,3824941,654252555,906419245,86742544,326497851,421642250,638239228,205888231,767343100,96181465,259674642,664937390,97814742,147378839,740480660,383696833,692258868,875878677,685502732,142134216,286426357,456929172,50710,645261548,911398464,20614044,153843850,83275962,607239137,818863593,210692506,55898086,467251172,890234372,443500133,783975172,458541459,180470908,927641192,134236724,258790918,637552229,189892851,368447315,298668904,851965067,348901451,356330647,310271224,638166852,136948446,383040916,760185153,844629046,606448030,407630126,359672330,639362583,906246540,124551834,132075369,85614363,106555451,23587006,728292303,899432268,413715621,559371739,824894454,639641924,158679786,903957375,157777678,774613748,680373100,473250003,780855580,360144821,138067879,662977102,510992678,259813371,642050624,632489971,214889947,735328622,692740047,373119542,160871732,882266729,29815415,182463663,60136125,390538785,868312841,228032253,427249923,397118871,145173668,978372240,12931179,231455684,775774849,867644784,884900136,985308855,632502546,219216550,83596176,546624894,189551592,75358243,323616949,601467639,454060822,36332494,754870910,929481541,793189887,356928811,980700406,694732917,507547280,542089076,265469758,72182818,995845218,476012786,970309227,143846518,147798660,206477619,83252628,653538108,783610398,415730713,421789700,968947731,736019716,777560092,14474249,396029410,807450395,662601950,293758886,140692549,240175696,511149959,755751491,342515810,407044710,110520206,87231234,949976093,854763253,133373319,779928612,812979174,450015204,761107472,520680372,872129257,300531624,946445402,496498085,669346000,971857592,42908240,397262866,270330339,514094168,846948273,930990573,385686947,927850161,144389991,106057627,99109979,441590628,903179342,320783998,25678994,528596267,770590408,986595846,788123813,110768973,618785840,817794106,563177320,6279842,318605791,130797366,81054412,776870286,158323042,203128261,625167544,346405815,214365688,514042197,973471676,608035686,174077107,841210135,333890744,119943375,194137670,844159897,518416797,482929878,54736111,265290170,555836018,382090076,811802802,6083823,112060330,640765047,500633802,311381268,114807184,562499991,714334643,388758171,6304401,169842413,535668428,727821172,423584492,276267239,363841059,190735604,293190035,317432027,523677219,848012905,496907774,112538082,80408323,448449276,212359340,5606066,879354441,120609811,657509287,955222794,634732364,395567099,479840359,875819228,40848458,138245144,56312801,994915236,232695910,145416761,976090419,524092700,595572553,159598182,952548349,136996905,990469907,327473983,2128667,855241426,934597411,83292519,531007567,849625284,826357863,612836870,410681656,107129512,727390576,421987039,345162079,578709784,214881003,230501745,129812674,504183722,638323170,616701425,937748131,143330962,279804978,840561963,970460753,188555284,155773794,307590065,673084126,728536933,361456315,912532489,398314327,762366190,201117328,832649896,343358220,326022629,24520684,388232920,768345432,555484791,714447406,929460843,445318601,282195790,13728532,393160604,43089609,505069424,846436224,914917618,830471784,36030413,558719993,253912598,459027997,122285555,904451284,223476722,817346629,839387391,556781972,41332003,468229949,160670235,790673944,21147750,888411073,864084898,390459672,538660650,625972445,989475040,141118559,396148334,865743838,354976841,179173899,396625977,96533729,885208396,723783734,285840730,997209349,135147455,178556237,960020400,18222889,122396127,408329819,234510699,788825848,379474405,592871823,72607081,536498871,800174791,788093401,599634489,63584899,810498443,558558580,43033023,347007100,730228095,867528638,287339383,415266556,63153942,571381576,810762095,487769028,781951575,453179963,618625879,69791804,50735722,750228951,14466498,58736931,935078853,584953625,135439409,144964890,616924041,591309371,729763728,652847057,699513054,35909831,93624810,594152066,907793290,557996742,983134923,809470843,467554556,546758319,284541920,997451218,698251022,299774477,312999077,388035636,600076891,909100725,57220317,215151119,475374063,972710001,691465843,77904315,520281182,605393868,77219990,756249142,471106648,910205025,289837594,600509540,383676458,704321312,391407098,429663903,166691438,264322778,122242781,540053735,62726854,983248148,357938349,561114974,851652619,540038856,960139148,659515456,106145403,12834720,757752918,768244694,9864872,28620041,566649315,378041338,484139940,917411675,5436265,172992681,588110107,646824855,416095449,902435289,345882040,1213851,73840934,592008350,592601899,978445354,94274530,776577871,331650009,321637298,334706565,946545040,816608882,177491797,249846496,839528387,986039519,234891934,753791552,968580811,11646217,109935820,648368898,597022386,904621296,578879690,130028920,50684372,448715992,400087858,505330649,941877505,826243076,831095408,779860746,819838959,571283339,952671414,57866713,341710456,549340492,526429169,855396321,390434029,107678749,575503669,16797373,786068832,932441658,358773847,570944331,904436321,971993581,388013138,576458074,25096679,331562650,878232,314016851,106872656,350874009,149374601,130535664,332101261,108873652,976380498,104483159,199808645,666956254,462102216,251076760,834717543,734562997,709782554,43725993,463357077,866689117,62411818,983405390,60242418,822500167,201049608,841963503,903823416,53812412,334593097,393993433,948523308,853104453,171209130,31244577,580069280,796115227,130994310,450629995,710986643,746475571,208434601,407489328,140763991,86396321,364021675,78865069,73761640,52292670,562093067,317613916,640223417,134876627,714695913,18172120,269121544,318208004,680620776,340973241,250891291,12507354,343658428,76651191,372336093,878346271,563187219,527157404,209940084,147359767,626958978,744771064,478072863,234285014,83683925,459895846,468816747,78544564,189022821,778238634,681311408,211007030,692630591,326471128,179530211,149732242,846440657,989423049,60284400,173586572,979701556,879908721,846459183,153305884,779099635,912748264,877361105,978350011,639328376,331329491,22637144,150852267,136326587,461853516,11638085,180282718,59699156,74808899,473705507,846576720,335771665,520327917,597890435,668556732,798553620,665381237,908078908,708906105,345633179,113574318,878084090,244657024,312396941,5354119,378322015,552005916,434075172,499466945,27368492,420744586,938090978,463109550,1470122,878998915,587735270,434885268,229848535,534225370,96665483,159135649,768690806,917734668,139012322,710866496,81670011,178803022,605747179,365845604,521385067,185541309,39503497,155805734,637384223,661183303,72878874,809556528,907662351,150283547,374805557,787459848,43432522}, + 748425216, +}, + +{ + []int{4,14,2}, + 6, +}, + + // 可以有多个 testcase +} + +func Test_totalHammingDistance(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, totalHammingDistance(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_totalHammingDistance(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + totalHammingDistance(tc.nums) + } + } +} diff --git a/Algorithms/0478.generate-random-point-in-a-circle/README.md b/Algorithms/0478.generate-random-point-in-a-circle/README.md new file mode 100755 index 000000000..2e8bc9426 --- /dev/null +++ b/Algorithms/0478.generate-random-point-in-a-circle/README.md @@ -0,0 +1,38 @@ +# [478. Generate Random Point in a Circle](https://leetcode.com/problems/generate-random-point-in-a-circle/) + +## 题目 + +Given the radius and x-y positions of the center of a circle, write a function `randPoint` which generates a uniform randompoint in the circle. + +Note: + +1. input and output values are in [floating-point](https://www.webopedia.com/TERM/F/floating_point_number.html). +1. radius and x-y position of the center of the circle is passed into the class constructor. +1. a point on the circumference of the circle is considered to bein the circle. +1. randPointreturnsa size 2 array containing x-position and y-position of the random point, in that order. + +Example 1: + +```text +Input: +["Solution","randPoint","randPoint","randPoint"] +[[1,0,0],[],[],[]] +Output: [null,[-0.72939,-0.65505],[-0.78502,-0.28626],[-0.83119,-0.19803]] +``` + +Example 2: + +```text +Input: +["Solution","randPoint","randPoint","randPoint"] +[[10,5,-7.5],[],[],[]] +Output: [null,[11.52438,-8.33273],[2.46992,-16.21705],[11.13430,-12.42337]] +``` + +Explanation of Input Syntax: + +The input is two lists:the subroutines calledand theirarguments.Solution'sconstructor has three arguments, the radius, x-position of the center, and y-position of the center of the circle. randPoint has no arguments.Argumentsarealways wrapped with a list, even if there aren't any. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle.go b/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle.go new file mode 100755 index 000000000..fc4c1adb2 --- /dev/null +++ b/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle.go @@ -0,0 +1,33 @@ +package problem0478 + +import ( + "math/rand" +) + +// Solution object will be instantiated and called as such: +// obj := Constructor(radius, x_center, y_center); +// param_1 := obj.RandPoint(); +type Solution struct { + r, a, b float64 +} + +// Constructor 构建 Solution +func Constructor(radius, xCenter, yCenter float64) Solution { + return Solution{ + r: radius, + a: xCenter, + b: yCenter, + } +} + +// RandPoint 返回圆内的随机点 +func (s *Solution) RandPoint() []float64 { + xFactor, yFactor := 1., 1. + for xFactor*xFactor+yFactor*yFactor > 1 { + xFactor = 2*rand.Float64() - 1 + yFactor = 2*rand.Float64() - 1 + } + x := s.a + s.r*xFactor + y := s.b + s.r*yFactor + return []float64{x, y} +} diff --git a/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle_test.go b/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle_test.go new file mode 100755 index 000000000..c21ddc3ca --- /dev/null +++ b/Algorithms/0478.generate-random-point-in-a-circle/generate-random-point-in-a-circle_test.go @@ -0,0 +1,32 @@ +package problem0478 + +import ( + "math" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_RandPoint(t *testing.T) { + ast := assert.New(t) + r, a, b := 3., 2., 1. + s := Constructor(r, a, b) + for i := 0; i < 100; i++ { + p := s.RandPoint() + x, y := p[0], p[1] + actual := math.Sqrt((x-a)*(x-a) + (y-b)*(y-b)) + ast.True(actual <= r) + } +} + +func Test_RandPoint_2(t *testing.T) { + ast := assert.New(t) + r, a, b := 0.01, -73839.1, -3289891. + s := Constructor(r, a, b) + for i := 0; i < 100; i++ { + p := s.RandPoint() + x, y := p[0], p[1] + actual := math.Sqrt((x-a)*(x-a) + (y-b)*(y-b)) + ast.True(actual <= r) + } +} diff --git a/Algorithms/0479.largest-palindrome-product/README.md b/Algorithms/0479.largest-palindrome-product/README.md new file mode 100755 index 000000000..93e88f1c5 --- /dev/null +++ b/Algorithms/0479.largest-palindrome-product/README.md @@ -0,0 +1,20 @@ +# [479. Largest Palindrome Product](https://leetcode.com/problems/largest-palindrome-product/) + +## 题目 + +Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindrome mod 1337. + +Example: + +```text +Input: 2 +Output: 987 +Explanation: 99 x 91 = 9009, 9009 % 1337 = 987 +``` + +Note: +The range of n is [1,8]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0479.largest-palindrome-product/largest-palindrome-product.go b/Algorithms/0479.largest-palindrome-product/largest-palindrome-product.go new file mode 100755 index 000000000..24059dc8b --- /dev/null +++ b/Algorithms/0479.largest-palindrome-product/largest-palindrome-product.go @@ -0,0 +1,9 @@ +package problem0479 + +// 题目说了 1 <= n <=8 +// 利用题目的 run 功能,把这 8 个答案都找出来,直接返回就好了 +var res = []int{9, 987, 123, 597, 677, 1218, 877, 475} + +func largestPalindrome(n int) int { + return res[n-1] +} diff --git a/Algorithms/0479.largest-palindrome-product/largest-palindrome-product_test.go b/Algorithms/0479.largest-palindrome-product/largest-palindrome-product_test.go new file mode 100755 index 000000000..589a298d4 --- /dev/null +++ b/Algorithms/0479.largest-palindrome-product/largest-palindrome-product_test.go @@ -0,0 +1,74 @@ +package problem0479 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 1, + 9, + }, + + { + 2, + 987, + }, + + { + 3, + 123, + }, + + { + 4, + 597, + }, + + { + 5, + 677, + }, + + { + 6, + 1218, + }, + + { + 7, + 877, + }, + + { + 8, + 475, + }, + + // 可以有多个 testcase +} + +func Test_largestPalindrome(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largestPalindrome(tc.n), "输入:%v", tc) + } +} + +func Benchmark_largestPalindrome(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestPalindrome(tc.n) + } + } +} diff --git a/Algorithms/0480.sliding-window-median/README.md b/Algorithms/0480.sliding-window-median/README.md new file mode 100755 index 000000000..e46870da8 --- /dev/null +++ b/Algorithms/0480.sliding-window-median/README.md @@ -0,0 +1,37 @@ +# [480. Sliding Window Median](https://leetcode.com/problems/sliding-window-median/) + +## 题目 + +Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. + +Examples: + +[2,3,4] , the median is 3 + +[2,3], the median is (2 + 3) / 2 = 2.5 + +Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Your job is to output the median array for each window in the original array. + +For example, + +Given nums = [1,3,-1,-3,5,3,6,7], and k = 3. + +```text +Window position Median +--------------- ----- +[1 3 -1] -3 5 3 6 7 1 + 1 [3 -1 -3] 5 3 6 7 -1 + 1 3 [-1 -3 5] 3 6 7 -1 + 1 3 -1 [-3 5 3] 6 7 3 + 1 3 -1 -3 [5 3 6] 7 5 + 1 3 -1 -3 5 [3 6 7] 6 +``` + +Therefore, return the median sliding window as [1,-1,-1,3,5,6]. + +Note: +You may assume k is always valid, ie: k is always smaller than input array's size for non-empty array. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0480.sliding-window-median/sliding-window-median.go b/Algorithms/0480.sliding-window-median/sliding-window-median.go new file mode 100755 index 000000000..2e226baa8 --- /dev/null +++ b/Algorithms/0480.sliding-window-median/sliding-window-median.go @@ -0,0 +1,166 @@ +package problem0480 + +import "container/heap" +import "time" + +func medianSlidingWindow(nums []int, k int) []float64 { + res := make([]float64, len(nums)-k+1) + w := newWindow(nums, k) + + for i := 0; i+k < len(nums); i++ { + res[i] = w.median() + w.update(i, i+k, nums) + } + + res[len(nums)-k] = w.median() + + return res +} + +type window struct { + k int + medX2 int + m map[int]*entry + max maxPQ + min minPQ +} + +func newWindow(nums []int, k int) window { + max := make(maxPQ, 0, k) + min := make(minPQ, 0, k) + m := make(map[int]*entry, len(nums)) + + for i := 0; i < k; i++ { + ep := &entry{ + idx: i, + val: nums[i], + } + + m[i] = ep + + if min.Len() == max.Len() { + heap.Push(&min, ep) + } else { + heap.Push(&max, ep) + } + } + + for len(max) > 0 && max[0].val > min[0].val { + max[0], min[0] = min[0], max[0] + heap.Fix(&max, 0) + heap.Fix(&min, 0) + } + + return window{ + k: k, + m: m, + max: max, + min: min, + } +} + +func (w window) median() float64 { + if w.k&1 == 1 { + return float64(w.min[0].val) + } + return float64(w.max[0].val+w.min[0].val) / 2 +} + +func (w *window) update(popIdx, pushIdx int, nums []int) { + ep := w.m[popIdx] + + ep.idx = pushIdx + ep.val = nums[pushIdx] + w.m[pushIdx] = ep + + if ep.index < len(w.max) { + heap.Fix(&w.max, ep.index) + } + + if ep.index < len(w.min) { + heap.Fix(&w.min, ep.index) + } + + time.Sleep(time.Millisecond * 10) + if len(w.max) > 0 && w.max[0].val > w.min[0].val { + w.max[0], w.min[0] = w.min[0], w.max[0] + heap.Fix(&w.max, 0) + heap.Fix(&w.min, 0) + } +} + +// entry 是 priorityQueue 中的元素 +type entry struct { + idx int + val int + // index 是 entry 在 heap 中的索引号 + // entry 加入 Priority Queue 后, Priority 会变化时,很有用 + // 如果 entry.priority 一直不变的话,可以删除 index + index int +} + +// minPQ implements heap.Interface and holds entries. +type minPQ []*entry + +func (pq minPQ) Len() int { return len(pq) } + +func (pq minPQ) Less(i, j int) bool { + return pq[i].val < pq[j].val +} + +func (pq minPQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +// Push 往 pq 中放 entry +func (pq *minPQ) Push(x interface{}) { + n := len(*pq) + entry := x.(*entry) + entry.index = n + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *minPQ) Pop() interface{} { + old := *pq + n := len(old) + entry := old[n-1] + entry.index = -1 // for safety + *pq = old[0 : n-1] + return entry +} + +// maxPQ implements heap.Interface and holds entries. +type maxPQ []*entry + +func (pq maxPQ) Len() int { return len(pq) } + +func (pq maxPQ) Less(i, j int) bool { + return pq[i].val > pq[j].val +} + +func (pq maxPQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +// Push 往 pq 中放 entry +func (pq *maxPQ) Push(x interface{}) { + n := len(*pq) + entry := x.(*entry) + entry.index = n + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *maxPQ) Pop() interface{} { + old := *pq + n := len(old) + entry := old[n-1] + entry.index = -1 // for safety + *pq = old[0 : n-1] + return entry +} diff --git a/Algorithms/0480.sliding-window-median/sliding-window-median_test.go b/Algorithms/0480.sliding-window-median/sliding-window-median_test.go new file mode 100755 index 000000000..56e53d130 --- /dev/null +++ b/Algorithms/0480.sliding-window-median/sliding-window-median_test.go @@ -0,0 +1,74 @@ +package problem0480 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans []float64 +}{ + + { + []int{1, 2}, + 1, + []float64{1, 2}, + }, + + { + []int{1, 2}, + 2, + []float64{1.5}, + }, + + { + []int{1, 3, -1, -3, 5, 3, 6, 7}, + 3, + []float64{1, -1, -1, 3, 5, 6}, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, + 14, + []float64{7.5}, + }, + + { + []int{9, 8, 7, 6, 5, 4, 3, 2, 1}, + 3, + []float64{8, 7, 6, 5, 4, 3, 2}, + }, + + // 可以有多个 testcase +} + +func Test_medianSlidingWindow(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, medianSlidingWindow(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_medianSlidingWindow(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + medianSlidingWindow(tc.nums, tc.k) + } + } +} + +// 这个是为了覆盖率 +func Test_pop(t *testing.T) { + nums := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14} + k := 14 + w := newWindow(nums, k) + w.min.Pop() + w.max.Pop() +} diff --git a/Algorithms/0481.magical-string/README.md b/Algorithms/0481.magical-string/README.md new file mode 100755 index 000000000..b3d75ca5c --- /dev/null +++ b/Algorithms/0481.magical-string/README.md @@ -0,0 +1,37 @@ +# [481. Magical String](https://leetcode.com/problems/magical-string/) + +## 题目 + +A magical string S consists of only '1' and '2' and obeys the following rules: + +The string S is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string S itself. + +The first few elements of string S is the following: +S = "1221121221221121122……" + +If we group the consecutive '1's and '2's in S, it will be: + +1 22 11 2 1 22 1 22 11 2 11 22 ...... + +and the occurrences of '1's or '2's in each group are: + +1 2 2 1 1 2 1 2 2 1 2 2 ...... + +You can see that the occurrence sequence above is the S itself. + +Given an integer N as input, return the number of '1's in the first N number in the magical string S. + +Note: +N will not exceed 100,000. + +Example 1: + +```text +Input: 6 +Output: 3 +Explanation: The first 6 elements of magical string S is "12211" and it contains three 1's, so return 3. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0481.magical-string/magical-string.go b/Algorithms/0481.magical-string/magical-string.go new file mode 100755 index 000000000..5ea87fd81 --- /dev/null +++ b/Algorithms/0481.magical-string/magical-string.go @@ -0,0 +1,35 @@ +package problem0481 + +import ( + "strings" +) + +// 解题思路 +// 1. 构造出完美字符串 s +// 2. 统计 s 中 1 的个数 +func magicalString(n int) int { + // n+2 是为了防止添加字符时溢出 + bytes := make([]byte, n+2) + + copy(bytes, "122") + + // i 指向下一个要添加字符的数量 + // j 始终指向 bytes 中最后一个字符,以便确定下一个需要添加的字符 + i, j := 2, 2 + for j < n { + // b 是下一个要填写的字符 + b := (bytes[j] - '0') ^ 3 + '0' + // c 是下一个要填写字符的数量 + c := bytes[i] - '0' + i++ + + // 在bytes中添加 c 个字符 b + for c > 0 { + j++ + bytes[j] = b + c-- + } + } + + return strings.Count(string(bytes[:n]), "1") +} diff --git a/Algorithms/0481.magical-string/magical-string_test.go b/Algorithms/0481.magical-string/magical-string_test.go new file mode 100755 index 000000000..c55f76969 --- /dev/null +++ b/Algorithms/0481.magical-string/magical-string_test.go @@ -0,0 +1,46 @@ +package problem0481 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + // {100000, 49972}, + + // {10000, 4996}, + + // {1000, 502}, + + // {100, 49}, + + {10, 5}, + + {1, 1}, + + // 可以有多个 testcase +} + +func Test_magicalString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, magicalString(tc.n), "输入:%v", tc) + } +} + +func Benchmark_magicalString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + magicalString(tc.n) + } + } +} diff --git a/Algorithms/0482.license-key-formatting/482.100.png b/Algorithms/0482.license-key-formatting/482.100.png new file mode 100644 index 000000000..9534675b0 Binary files /dev/null and b/Algorithms/0482.license-key-formatting/482.100.png differ diff --git a/Algorithms/0482.license-key-formatting/README.md b/Algorithms/0482.license-key-formatting/README.md new file mode 100755 index 000000000..d99f04e60 --- /dev/null +++ b/Algorithms/0482.license-key-formatting/README.md @@ -0,0 +1,41 @@ +# [482. License Key Formatting](https://leetcode.com/problems/license-key-formatting/) + +## 题目 + +Now you are given a string S, which represents a software license key which we would like to format. The string S is composed of alphanumerical characters and dashes. The dashes split the alphanumerical characters within the string into groups. (i.e. if there are M dashes, the string is split into M+1 groups). The dashes in the given string are possibly misplaced. + +We want each group of characters to be of length K (except for possibly the first group, which could be shorter, but still must contain at least one character). To satisfy this requirement, we will reinsert dashes. Additionally, all the lower case letters in the string must be converted to upper case. + +So, you are given a non-empty string S, representing a license key to format, and an integer K. And you need to return the license key formatted according to the description above. + +Example 1: + +```text +Input: S = "2-4A0r7-4k", K = 4 + +Output: "24A0-R74K" + +Explanation: The string S has been split into two parts, each part has 4 characters. +``` + +Example 2: + +```text +Input: S = "2-4A0r7-4k", K = 3 + +Output: "24-A0R-74K" + +Explanation: The string S has been split into three parts, each part has 3 characters except the first part as it could be shorter as said above. +``` + +Note: + +1. The length of string S will not exceed 12,000, and K is a positive integer. +1. String S consists only of alphanumerical characters (a-z and/or A-Z and/or 0-9) and dashes(-). +1. String S is non-empty. + +## 解题思路 + +见程序注释 + +![100](482.100.png) \ No newline at end of file diff --git a/Algorithms/0482.license-key-formatting/license-key-formatting.go b/Algorithms/0482.license-key-formatting/license-key-formatting.go new file mode 100755 index 000000000..5758837fd --- /dev/null +++ b/Algorithms/0482.license-key-formatting/license-key-formatting.go @@ -0,0 +1,42 @@ +package problem0482 + +import ( + "strings" +) + +func licenseKeyFormatting(s string, k int) string { + // 统计 s 中的 "-" 的个数 + countDashs := strings.Count(s, "-") + // 统计 s 中字母和数字的个数 + countAN := len(s) - countDashs + + if countAN == 0 { + return "" + } + + // 删除 '-' ,并把所有的字母改成大写 + s = strings.Replace(s, "-", "", -1) + s = strings.ToUpper(s) + + // (countAN+k-1)/k-1 是 res 中 '-' 的个数 + res := make([]byte, (countAN+k-1)/k-1+countAN) + + i, j := len(res), len(s) + for 0 <= j-k { + copy(res[i-k:i], s[j-k:j]) + + if 0 <= i-k-1 { + res[i-k-1] = '-' + } + + i -= k + 1 + j -= k + } + + // 处理头部不完整的字符 + if j > 0 { + copy(res[:j], s[:j]) + } + + return string(res) +} diff --git a/Algorithms/0482.license-key-formatting/license-key-formatting_test.go b/Algorithms/0482.license-key-formatting/license-key-formatting_test.go new file mode 100755 index 000000000..b2a9d4652 --- /dev/null +++ b/Algorithms/0482.license-key-formatting/license-key-formatting_test.go @@ -0,0 +1,59 @@ +package problem0482 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + K int + ans string +}{ + + { + "---", + 3, + "", + }, + + { + "24A0r7-4k", + 3, + "24-A0R-74K", + }, + + { + "2-4A0r7-4k", + 4, + "24A0-R74K", + }, + + { + "2-4A0r7-4k", + 3, + "24-A0R-74K", + }, + + // 可以有多个 testcase +} + +func Test_licenseKeyFormatting(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, licenseKeyFormatting(tc.S, tc.K), "输入:%v", tc) + } +} + +func Benchmark_licenseKeyFormatting(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + licenseKeyFormatting(tc.S, tc.K) + } + } +} diff --git a/Algorithms/0483.smallest-good-base/README.md b/Algorithms/0483.smallest-good-base/README.md new file mode 100755 index 000000000..3b293eca9 --- /dev/null +++ b/Algorithms/0483.smallest-good-base/README.md @@ -0,0 +1,64 @@ +# [483. Smallest Good Base](https://leetcode.com/problems/smallest-good-base/) + +## 题目 + +For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1. +Now given a string representing n, you should return the smallest good base of n in string format. + +把 n 转换成 k 进制后,新的数全是 1 + +Example 1: + +```text +Input: "13" +Output: "3" +Explanation: 13 base 3 is 111. +``` + +Example 2: + +```text +Input: "4681" +Output: "8" +Explanation: 4681 base 8 is 11111. +``` + +Example 3: + +```text +Input: "1000000000000000000" +Output: "999999999999999999" +Explanation: 1000000000000000000 base 999999999999999999 is 11. +``` + +Note: + +1. The range of n is [3, 10^18]. +1. The string representing n is always valid and will not have leading zeros. + +## 解题思路 + +见程序注释 + +```golang +func smallestGoodBase(n string) string { + num, _ := strconv.Atoi(n) + + mMax := int(math.Log2(float64(num))) + + for m := mMax; 1 < m; m-- { + k := int(math.Pow(float64(num), 1.0/float64(m))) + + tmp := int(math.Pow(float64(k), float64(m)+1)-1) / (k - 1) + + if tmp == num { + return strconv.Itoa(k) + } + } + + return strconv.Itoa(num - 1) +} +``` + +以上程序在逻辑和数学上都是完全正确的,但是无法得出正确的解。 +例如,当输入"16035713712910627",其解为"502",但是当 for 循环中的 k == 502 时,temp == 16035713712910626 与 num 不相等。这是由于精度不够引起的错误。 diff --git a/Algorithms/0483.smallest-good-base/smallest-good-base.go b/Algorithms/0483.smallest-good-base/smallest-good-base.go new file mode 100755 index 000000000..db2ee20de --- /dev/null +++ b/Algorithms/0483.smallest-good-base/smallest-good-base.go @@ -0,0 +1,47 @@ +package problem0483 + +import ( + "math" + "strconv" +) + +func smallestGoodBase(n string) string { + num, _ := strconv.ParseUint(n, 10, 64) + // num = k^m + k^(m-1) + ... + k + 1 + // 想要找到最小的 k + // 可知 k 变小的时候,m 会变大 + // k 最小可以是 2,即是 二进制 + // k == 2 时,m == mMax + mMax := int(math.Log2(float64(num))) + + // 从 mMax 开始往下检查,对应的 k 能否满足题意 + for m := mMax; m >= 1; m-- { + // k^m < num = k^m + k^(m-1) + ... + k + 1 + // 展开 (k+1)^m 后,可知 + // (k+1)^m > num = k^m + k^(m-1) + ... + k + 1 + // 综上所示 + // k^m < num < (k+1)^m,即 + // k < num^(1/m) < k+1,即 + // k == int(num^(1/m)) + k := uint64(math.Pow(float64(num), 1.0/float64(m))) + // 这样就确定了 k 的取值,只需要验证 k 是否满足题意即可 + if isFound(num, k, m) { + return strconv.FormatUint(k, 10) + } + } + + return strconv.FormatUint(num-1, 10) +} + +// 返回 num == k^m + k^(m-1) + ... + k + 1 +func isFound(num, k uint64, m int) bool { + sum := uint64(1) + a := uint64(1) + + for i := 1; i <= m; i++ { + a *= k + sum += a + } + + return sum == num +} diff --git a/Algorithms/0483.smallest-good-base/smallest-good-base_test.go b/Algorithms/0483.smallest-good-base/smallest-good-base_test.go new file mode 100755 index 000000000..1c67e3163 --- /dev/null +++ b/Algorithms/0483.smallest-good-base/smallest-good-base_test.go @@ -0,0 +1,64 @@ +package problem0483 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n string + ans string +}{ + + { + "2251799813685247", + "2", + }, + + { + "4681", + "8", + }, + + { + "16035713712910627", + "502", + }, + + { + "14919921443713777", + "496", + }, + + { + "13", + "3", + }, + + { + "1000000000000000000", + "999999999999999999", + }, + + // 可以有多个 testcase +} + +func Test_smallestGoodBase(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, smallestGoodBase(tc.n), "输入:%v", tc) + } +} + +func Benchmark_smallestGoodBase(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestGoodBase(tc.n) + } + } +} diff --git a/Algorithms/0485.max-consecutive-ones/max-consecutive-ones.go b/Algorithms/0485.max-consecutive-ones/max-consecutive-ones.go index 16b71d594..6e1dd8951 100755 --- a/Algorithms/0485.max-consecutive-ones/max-consecutive-ones.go +++ b/Algorithms/0485.max-consecutive-ones/max-consecutive-ones.go @@ -1,4 +1,4 @@ -package Problem0485 +package problem0485 func findMaxConsecutiveOnes(nums []int) int { max := 0 diff --git a/Algorithms/0485.max-consecutive-ones/max-consecutive-ones_test.go b/Algorithms/0485.max-consecutive-ones/max-consecutive-ones_test.go index 179cb3546..565e69827 100755 --- a/Algorithms/0485.max-consecutive-ones/max-consecutive-ones_test.go +++ b/Algorithms/0485.max-consecutive-ones/max-consecutive-ones_test.go @@ -1,4 +1,4 @@ -package Problem0485 +package problem0485 import ( "fmt" diff --git a/Algorithms/0486.predict-the-winner/README.md b/Algorithms/0486.predict-the-winner/README.md new file mode 100755 index 000000000..e14361c3f --- /dev/null +++ b/Algorithms/0486.predict-the-winner/README.md @@ -0,0 +1,33 @@ +# [486. Predict the Winner](https://leetcode.com/problems/predict-the-winner/) + +## 题目 + +Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a number, that number will not be available for the next player. This continues until all the scores have been chosen. The player with the maximum score wins. + +Given an array of scores, predict whether player 1 is the winner. You can assume each player plays to maximize his score. + +Example 1: + +```text +Input: [1, 5, 2] +Output: False +Explanation: Initially, player 1 can choose between 1 and 2. If he chooses 2 (or 1), then player 2 can choose from 1 (or 2) and 5. If player 2 chooses 5, then player 1 will be left with 1 (or 2). So, final score of player 1 is 1 + 2 = 3, and player 2 is 5. Hence, player 1 will never be the winner and you need to return False. +``` + +Example 2: + +```text +Input: [1, 5, 233, 7] +Output: True +Explanation: Player 1 first chooses 1. Then player 2 have to choose between 5 and 7. No matter which number player 2 choose, player 1 can choose 233.Finally, player 1 has more score (234) than player 2 (12), so you need to return True representing player1 can win. +``` + +Note: + +1. 1 <= length of the array <= 20. +1. Any scores in the given array are non-negative integers and will not exceed 10,000,000. +1. If the scores of both players are equal, then player 1 is still the winner. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0486.predict-the-winner/predict-the-winner.go b/Algorithms/0486.predict-the-winner/predict-the-winner.go new file mode 100755 index 000000000..7f58f3ee9 --- /dev/null +++ b/Algorithms/0486.predict-the-winner/predict-the-winner.go @@ -0,0 +1,41 @@ +package problem0486 + +// PredictTheWinner 在 play1 能赢的时候,返回 true +func PredictTheWinner(nums []int) bool { + n := len(nums) + + // dp[i][j] 表示 nums[i:j+1] 中 play1 比 play2 多的得分 + // dp[0][n-1] >=0 表示 play1 获胜 + dp := make([][]int, n) + for i := range dp { + dp[i] = make([]int, n) + // 只有 nums[i] 时,play1 比 play2 多 nums[i] 分 + // 因为 play1 选了 nums[i],而 play2 无数可选了 + dp[i][i] = nums[i] + } + + for Len := 2; Len <= n; Len++ { + for i := 0; i <= n-Len; i++ { + // Len == j - i + 1 + j := i + Len - 1 + + // dp[i][j] 表示 nums[i:j+1] 中 play1 比 play2 多的得分 + // 那么 -dp[i][j] 表示什么呢? + // -dp[i][j] 表示 nums[i:j+1] 中 play2 比 play1 多的得分 + // 所以, + // nums[i]-dp[i+1][j] 等于 play1 选择 左端 的数后比 play2 多的得分 + // nums[j]-dp[i][j-1] 等于 play1 选择 右端 的数后比 play2 多的得分 + // 从以上两者之间,选择一个大的,作为 dp[i][j] + dp[i][j] = max(nums[i]-dp[i+1][j], nums[j]-dp[i][j-1]) + } + } + + return dp[0][n-1] >= 0 +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0486.predict-the-winner/predict-the-winner_test.go b/Algorithms/0486.predict-the-winner/predict-the-winner_test.go new file mode 100755 index 000000000..0d445983b --- /dev/null +++ b/Algorithms/0486.predict-the-winner/predict-the-winner_test.go @@ -0,0 +1,59 @@ +package problem0486 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{0}, + true, + }, + + { + []int{2}, + true, + }, + + { + []int{1, 1}, + true, + }, + + { + []int{1, 5, 2}, + false, + }, + + { + []int{1, 5, 233, 7}, + true, + }, + + // 可以有多个 testcase +} + +func Test_PredictTheWinner(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, PredictTheWinner(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_PredictTheWinner(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + PredictTheWinner(tc.nums) + } + } +} diff --git a/Algorithms/0488.zuma-game/README.md b/Algorithms/0488.zuma-game/README.md new file mode 100755 index 000000000..f0153fbaf --- /dev/null +++ b/Algorithms/0488.zuma-game/README.md @@ -0,0 +1,40 @@ +# [488. Zuma Game](https://leetcode.com/problems/zuma-game/) + +## 题目 + +Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls in your hand. + +Each time, you may choose a ball in your hand, and insert it into the row (including the leftmost place and rightmost place). Then, if there is a group of 3 or more balls in the same color touching, remove these balls. Keep doing this until no more balls can be removed. + +Find the minimal balls you have to insert to remove all the balls on the table. If you cannot remove all the balls, output -1. + +Examples: + +```text +Input: "WRRBBW", "RB" +Output: -1 +Explanation: WRRBBW -> WRR[R]BBW -> WBBW -> WBB[B]W -> WW + +Input: "WWRRBBWW", "WRBRW" +Output: 2 +Explanation: WWRRBBWW -> WWRR[R]BBWW -> WWBBWW -> WWBB[B]WW -> WWWW -> empty + +Input:"G", "GGGGG" +Output: 2 +Explanation: G -> G[G] -> GG[G] -> empty + +Input: "RBYYBBRRB", "YRBGB" +Output: 3 +Explanation: RBYYBBRRB -> RBYY[Y]BBRRB -> RBBBRRB -> RRRB -> B -> B[B] -> BB[B] -> empty +``` + +Note: + +1. You may assume that the initial row of balls on the table won’t have any 3 or more consecutive balls with the same color. +1. The number of balls on the table won't exceed 20, and the string represents these balls is called "board" in the input. +1. The number of balls in your hand won't exceed 5, and the string represents these balls is called "hand" in the input. +1. Both input strings will be non-empty and only contain characters 'R','Y','B','G','W'. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0488.zuma-game/zuma-game.go b/Algorithms/0488.zuma-game/zuma-game.go new file mode 100755 index 000000000..27b1c4689 --- /dev/null +++ b/Algorithms/0488.zuma-game/zuma-game.go @@ -0,0 +1,61 @@ +package problem0488 + +var maxCount = 6 + +func findMinStep(board, hand string) int { + // ball[i] = j 表示, 手上拥有 i+'A' 颜色的球的个数 + ball := make([]int, 26) + for i := 0; i < len(hand); i++ { + ball[hand[i]-'A']++ + } + + res := dfs(board+"#", ball) + if res == maxCount { + return -1 + } + return res +} + +func dfs(s string, ball []int) int { + s = removeBalls(s) + if s == "#" { + return 0 + } + res, need := maxCount, 0 + + for i, j := 0, 0; j < len(s); j++ { + if s[j] == s[i] { + continue + } + need = 3 - (j - i) + if ball[s[i]-'A'] >= need { + ball[s[i]-'A'] -= need + res = min(res, need+dfs(s[:i]+s[j:], ball)) + ball[s[i]-'A'] += need + } + i = j + } + + return res +} + +// 删除 board 中 3 个及以上同色的球 +func removeBalls(board string) string { + for i, j := 0, 0; j < len(board); j++ { + if board[i] == board[j] { + continue + } + if i+3 <= j { + return removeBalls(board[:i] + board[j:]) + } + i = j + } + return board +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0488.zuma-game/zuma-game_test.go b/Algorithms/0488.zuma-game/zuma-game_test.go new file mode 100755 index 000000000..578c08fcd --- /dev/null +++ b/Algorithms/0488.zuma-game/zuma-game_test.go @@ -0,0 +1,70 @@ +package problem0488 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board string + hand string + ans int +}{ + + { + // TODO: 这个 test case 官方程序会返回 -1 + // 实际上正确答案是 2 + // RRWWRRBBRR -> RRWWRRBBR[W]R -> RRWWRRBB[B]RWR -> RRWWRRRWR -> RRWWWR -> RRR -> + // 这也是我暂时没有做这个题目的原因 + + "RRWWRRBBRR", + "WB", + -1, + }, + + { + "WRRBBW", + "RB", + -1, + }, + + { + "WWRRBBWW", + "WRBRW", + 2, + }, + + { + "G", + "GGGGG", + 2, + }, + + { + "RBYYBBRRB", + "YRBGB", + 3, + }, + + // 可以有多个 testcase +} + +func Test_findMinStep(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMinStep(tc.board, tc.hand), "输入:%v", tc) + } +} + +func Benchmark_findMinStep(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMinStep(tc.board, tc.hand) + } + } +} diff --git a/Algorithms/0491.increasing-subsequences/README.md b/Algorithms/0491.increasing-subsequences/README.md new file mode 100755 index 000000000..58a8d3819 --- /dev/null +++ b/Algorithms/0491.increasing-subsequences/README.md @@ -0,0 +1,22 @@ +# [491. Increasing Subsequences](https://leetcode.com/problems/increasing-subsequences/) + +## 题目 + +Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 . + +Example: + +```text +Input: [4, 6, 7, 7] +Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]] +``` + +Note: + +1. The length of the given array will not exceed 15. +1. The range of integer in the given array is [-100,100]. +1. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0491.increasing-subsequences/increasing-subsequences.go b/Algorithms/0491.increasing-subsequences/increasing-subsequences.go new file mode 100755 index 000000000..e868517f0 --- /dev/null +++ b/Algorithms/0491.increasing-subsequences/increasing-subsequences.go @@ -0,0 +1,33 @@ +package problem0491 + +// TODO: 让这个题目 accepted +func findSubsequences(nums []int) [][]int { + size := len(nums) + res := [][]int{} + list := make([]int, 0, size) + helper(nums, 0, &res, list) + return res +} + +func helper(nums []int, index int, res *[][]int, list []int) { + if index == len(nums) { + if len(list) > 1 { + temp := make([]int, len(list)) + copy(temp, list) + *res = append(*res, temp) + } + return + } + + if len(list) == 0 || + list[len(list)-1] <= nums[index] { + list = append(list, nums[index]) + helper(nums, index+1, res, list) + list = list[:len(list)-1] + } + + if len(list) == 0 || + list[len(list)-1] != nums[index] { + helper(nums, index+1, res, list) + } +} diff --git a/Algorithms/0491.increasing-subsequences/increasing-subsequences_test.go b/Algorithms/0491.increasing-subsequences/increasing-subsequences_test.go new file mode 100755 index 000000000..60341c7be --- /dev/null +++ b/Algorithms/0491.increasing-subsequences/increasing-subsequences_test.go @@ -0,0 +1,76 @@ +package problem0491 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans [][]int +}{ + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + [][]int{{1,2},{1,2,3},{1,2,3,4},{1,2,3,4,5},{1,2,3,4,5,6},{1,2,3,4,5,6,7},{1,2,3,4,5,6,7,8},{1,2,3,4,5,6,7,8,9},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10,11},{1,2,3,4,5,6,7,8,9,10,11,12},{1,2,3,4,5,6,7,8,9,10,11,12,13},{1,2,3,4,5,6,7,8,9,10,11,12,13,14},{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},{1,2,3,4,5,6,7,8,9,10,11,12,13,15},{1,2,3,4,5,6,7,8,9,10,11,12,14},{1,2,3,4,5,6,7,8,9,10,11,12,14,15},{1,2,3,4,5,6,7,8,9,10,11,12,15},{1,2,3,4,5,6,7,8,9,10,11,13},{1,2,3,4,5,6,7,8,9,10,11,13,14},{1,2,3,4,5,6,7,8,9,10,11,13,14,15},{1,2,3,4,5,6,7,8,9,10,11,13,15},{1,2,3,4,5,6,7,8,9,10,11,14},{1,2,3,4,5,6,7,8,9,10,11,14,15},{1,2,3,4,5,6,7,8,9,10,11,15},{1,2,3,4,5,6,7,8,9,10,12},{1,2,3,4,5,6,7,8,9,10,12,13},{1,2,3,4,5,6,7,8,9,10,12,13,14},{1,2,3,4,5,6,7,8,9,10,12,13,14,15},{1,2,3,4,5,6,7,8,9,10,12,13,15},{1,2,3,4,5,6,7,8,9,10,12,14},{1,2,3,4,5,6,7,8,9,10,12,14,15},{1,2,3,4,5,6,7,8,9,10,12,15},{1,2,3,4,5,6,7,8,9,10,13},{1,2,3,4,5,6,7,8,9,10,13,14},{1,2,3,4,5,6,7,8,9,10,13,14,15},{1,2,3,4,5,6,7,8,9,10,13,15},{1,2,3,4,5,6,7,8,9,10,14},{1,2,3,4,5,6,7,8,9,10,14,15},{1,2,3,4,5,6,7,8,9,10,15},{1,2,3,4,5,6,7,8,9,11},{1,2,3,4,5,6,7,8,9,11,12},{1,2,3,4,5,6,7,8,9,11,12,13},{1,2,3,4,5,6,7,8,9,11,12,13,14},{1,2,3,4,5,6,7,8,9,11,12,13,14,15},{1,2,3,4,5,6,7,8,9,11,12,13,15},{1,2,3,4,5,6,7,8,9,11,12,14},{1,2,3,4,5,6,7,8,9,11,12,14,15},{1,2,3,4,5,6,7,8,9,11,12,15},{1,2,3,4,5,6,7,8,9,11,13},{1,2,3,4,5,6,7,8,9,11,13,14},{1,2,3,4,5,6,7,8,9,11,13,14,15},{1,2,3,4,5,6,7,8,9,11,13,15},{1,2,3,4,5,6,7,8,9,11,14},{1,2,3,4,5,6,7,8,9,11,14,15},{1,2,3,4,5,6,7,8,9,11,15},{1,2,3,4,5,6,7,8,9,12},{1,2,3,4,5,6,7,8,9,12,13},{1,2,3,4,5,6,7,8,9,12,13,14},{1,2,3,4,5,6,7,8,9,12,13,14,15},{1,2,3,4,5,6,7,8,9,12,13,15},{1,2,3,4,5,6,7,8,9,12,14},{1,2,3,4,5,6,7,8,9,12,14,15},{1,2,3,4,5,6,7,8,9,12,15},{1,2,3,4,5,6,7,8,9,13},{1,2,3,4,5,6,7,8,9,13,14},{1,2,3,4,5,6,7,8,9,13,14,15},{1,2,3,4,5,6,7,8,9,13,15},{1,2,3,4,5,6,7,8,9,14},{1,2,3,4,5,6,7,8,9,14,15},{1,2,3,4,5,6,7,8,9,15},{1,2,3,4,5,6,7,8,10},{1,2,3,4,5,6,7,8,10,11},{1,2,3,4,5,6,7,8,10,11,12},{1,2,3,4,5,6,7,8,10,11,12,13},{1,2,3,4,5,6,7,8,10,11,12,13,14},{1,2,3,4,5,6,7,8,10,11,12,13,14,15},{1,2,3,4,5,6,7,8,10,11,12,13,15},{1,2,3,4,5,6,7,8,10,11,12,14},{1,2,3,4,5,6,7,8,10,11,12,14,15},{1,2,3,4,5,6,7,8,10,11,12,15},{1,2,3,4,5,6,7,8,10,11,13},{1,2,3,4,5,6,7,8,10,11,13,14},{1,2,3,4,5,6,7,8,10,11,13,14,15},{1,2,3,4,5,6,7,8,10,11,13,15},{1,2,3,4,5,6,7,8,10,11,14},{1,2,3,4,5,6,7,8,10,11,14,15},{1,2,3,4,5,6,7,8,10,11,15},{1,2,3,4,5,6,7,8,10,12},{1,2,3,4,5,6,7,8,10,12,13},{1,2,3,4,5,6,7,8,10,12,13,14},{1,2,3,4,5,6,7,8,10,12,13,14,15},{1,2,3,4,5,6,7,8,10,12,13,15},{1,2,3,4,5,6,7,8,10,12,14},{1,2,3,4,5,6,7,8,10,12,14,15},{1,2,3,4,5,6,7,8,10,12,15},{1,2,3,4,5,6,7,8,10,13},{1,2,3,4,5,6,7,8,10,13,14},{1,2,3,4,5,6,7,8,10,13,14,15},{1,2,3,4,5,6,7,8,10,13,15},{1,2,3,4,5,6,7,8,10,14},{1,2,3,4,5,6,7,8,10,14,15},{1,2,3,4,5,6,7,8,10,15},{1,2,3,4,5,6,7,8,11},{1,2,3,4,5,6,7,8,11,12},{1,2,3,4,5,6,7,8,11,12,13},{1,2,3,4,5,6,7,8,11,12,13,14},{1,2,3,4,5,6,7,8,11,12,13,14,15},{1,2,3,4,5,6,7,8,11,12,13,15},{1,2,3,4,5,6,7,8,11,12,14},{1,2,3,4,5,6,7,8,11,12,14,15},{1,2,3,4,5,6,7,8,11,12,15},{1,2,3,4,5,6,7,8,11,13},{1,2,3,4,5,6,7,8,11,13,14},{1,2,3,4,5,6,7,8,11,13,14,15},{1,2,3,4,5,6,7,8,11,13,15},{1,2,3,4,5,6,7,8,11,14},{1,2,3,4,5,6,7,8,11,14,15},{1,2,3,4,5,6,7,8,11,15},{1,2,3,4,5,6,7,8,12},{1,2,3,4,5,6,7,8,12,13},{1,2,3,4,5,6,7,8,12,13,14},{1,2,3,4,5,6,7,8,12,13,14,15},{1,2,3,4,5,6,7,8,12,13,15},{1,2,3,4,5,6,7,8,12,14},{1,2,3,4,5,6,7,8,12,14,15},{1,2,3,4,5,6,7,8,12,15},{1,2,3,4,5,6,7,8,13},{1,2,3,4,5,6,7,8,13,14},{1,2,3,4,5,6,7,8,13,14,15},{1,2,3,4,5,6,7,8,13,15},{1,2,3,4,5,6,7,8,14},{1,2,3,4,5,6,7,8,14,15},{1,2,3,4,5,6,7,8,15},{1,2,3,4,5,6,7,9},{1,2,3,4,5,6,7,9,10},{1,2,3,4,5,6,7,9,10,11},{1,2,3,4,5,6,7,9,10,11,12},{1,2,3,4,5,6,7,9,10,11,12,13},{1,2,3,4,5,6,7,9,10,11,12,13,14},{1,2,3,4,5,6,7,9,10,11,12,13,14,15},{1,2,3,4,5,6,7,9,10,11,12,13,15},{1,2,3,4,5,6,7,9,10,11,12,14},{1,2,3,4,5,6,7,9,10,11,12,14,15},{1,2,3,4,5,6,7,9,10,11,12,15},{1,2,3,4,5,6,7,9,10,11,13},{1,2,3,4,5,6,7,9,10,11,13,14},{1,2,3,4,5,6,7,9,10,11,13,14,15},{1,2,3,4,5,6,7,9,10,11,13,15},{1,2,3,4,5,6,7,9,10,11,14},{1,2,3,4,5,6,7,9,10,11,14,15},{1,2,3,4,5,6,7,9,10,11,15},{1,2,3,4,5,6,7,9,10,12},{1,2,3,4,5,6,7,9,10,12,13},{1,2,3,4,5,6,7,9,10,12,13,14},{1,2,3,4,5,6,7,9,10,12,13,14,15},{1,2,3,4,5,6,7,9,10,12,13,15},{1,2,3,4,5,6,7,9,10,12,14},{1,2,3,4,5,6,7,9,10,12,14,15},{1,2,3,4,5,6,7,9,10,12,15},{1,2,3,4,5,6,7,9,10,13},{1,2,3,4,5,6,7,9,10,13,14},{1,2,3,4,5,6,7,9,10,13,14,15},{1,2,3,4,5,6,7,9,10,13,15},{1,2,3,4,5,6,7,9,10,14},{1,2,3,4,5,6,7,9,10,14,15},{1,2,3,4,5,6,7,9,10,15},{1,2,3,4,5,6,7,9,11},{1,2,3,4,5,6,7,9,11,12},{1,2,3,4,5,6,7,9,11,12,13},{1,2,3,4,5,6,7,9,11,12,13,14},{1,2,3,4,5,6,7,9,11,12,13,14,15},{1,2,3,4,5,6,7,9,11,12,13,15},{1,2,3,4,5,6,7,9,11,12,14},{1,2,3,4,5,6,7,9,11,12,14,15},{1,2,3,4,5,6,7,9,11,12,15},{1,2,3,4,5,6,7,9,11,13},{1,2,3,4,5,6,7,9,11,13,14},{1,2,3,4,5,6,7,9,11,13,14,15},{1,2,3,4,5,6,7,9,11,13,15},{1,2,3,4,5,6,7,9,11,14},{1,2,3,4,5,6,7,9,11,14,15},{1,2,3,4,5,6,7,9,11,15},{1,2,3,4,5,6,7,9,12},{1,2,3,4,5,6,7,9,12,13},{1,2,3,4,5,6,7,9,12,13,14},{1,2,3,4,5,6,7,9,12,13,14,15},{1,2,3,4,5,6,7,9,12,13,15},{1,2,3,4,5,6,7,9,12,14},{1,2,3,4,5,6,7,9,12,14,15},{1,2,3,4,5,6,7,9,12,15},{1,2,3,4,5,6,7,9,13},{1,2,3,4,5,6,7,9,13,14},{1,2,3,4,5,6,7,9,13,14,15},{1,2,3,4,5,6,7,9,13,15},{1,2,3,4,5,6,7,9,14},{1,2,3,4,5,6,7,9,14,15},{1,2,3,4,5,6,7,9,15},{1,2,3,4,5,6,7,10},{1,2,3,4,5,6,7,10,11},{1,2,3,4,5,6,7,10,11,12},{1,2,3,4,5,6,7,10,11,12,13},{1,2,3,4,5,6,7,10,11,12,13,14},{1,2,3,4,5,6,7,10,11,12,13,14,15},{1,2,3,4,5,6,7,10,11,12,13,15},{1,2,3,4,5,6,7,10,11,12,14},{1,2,3,4,5,6,7,10,11,12,14,15},{1,2,3,4,5,6,7,10,11,12,15},{1,2,3,4,5,6,7,10,11,13},{1,2,3,4,5,6,7,10,11,13,14},{1,2,3,4,5,6,7,10,11,13,14,15},{1,2,3,4,5,6,7,10,11,13,15},{1,2,3,4,5,6,7,10,11,14},{1,2,3,4,5,6,7,10,11,14,15},{1,2,3,4,5,6,7,10,11,15},{1,2,3,4,5,6,7,10,12},{1,2,3,4,5,6,7,10,12,13},{1,2,3,4,5,6,7,10,12,13,14},{1,2,3,4,5,6,7,10,12,13,14,15},{1,2,3,4,5,6,7,10,12,13,15},{1,2,3,4,5,6,7,10,12,14},{1,2,3,4,5,6,7,10,12,14,15},{1,2,3,4,5,6,7,10,12,15},{1,2,3,4,5,6,7,10,13},{1,2,3,4,5,6,7,10,13,14},{1,2,3,4,5,6,7,10,13,14,15},{1,2,3,4,5,6,7,10,13,15},{1,2,3,4,5,6,7,10,14},{1,2,3,4,5,6,7,10,14,15},{1,2,3,4,5,6,7,10,15},{1,2,3,4,5,6,7,11},{1,2,3,4,5,6,7,11,12},{1,2,3,4,5,6,7,11,12,13},{1,2,3,4,5,6,7,11,12,13,14},{1,2,3,4,5,6,7,11,12,13,14,15},{1,2,3,4,5,6,7,11,12,13,15},{1,2,3,4,5,6,7,11,12,14},{1,2,3,4,5,6,7,11,12,14,15},{1,2,3,4,5,6,7,11,12,15},{1,2,3,4,5,6,7,11,13},{1,2,3,4,5,6,7,11,13,14},{1,2,3,4,5,6,7,11,13,14,15},{1,2,3,4,5,6,7,11,13,15},{1,2,3,4,5,6,7,11,14},{1,2,3,4,5,6,7,11,14,15},{1,2,3,4,5,6,7,11,15},{1,2,3,4,5,6,7,12},{1,2,3,4,5,6,7,12,13},{1,2,3,4,5,6,7,12,13,14},{1,2,3,4,5,6,7,12,13,14,15},{1,2,3,4,5,6,7,12,13,15},{1,2,3,4,5,6,7,12,14},{1,2,3,4,5,6,7,12,14,15},{1,2,3,4,5,6,7,12,15},{1,2,3,4,5,6,7,13},{1,2,3,4,5,6,7,13,14},{1,2,3,4,5,6,7,13,14,15},{1,2,3,4,5,6,7,13,15},{1,2,3,4,5,6,7,14},{1,2,3,4,5,6,7,14,15},{1,2,3,4,5,6,7,15},{1,2,3,4,5,6,8},{1,2,3,4,5,6,8,9},{1,2,3,4,5,6,8,9,10},{1,2,3,4,5,6,8,9,10,11},{1,2,3,4,5,6,8,9,10,11,12},{1,2,3,4,5,6,8,9,10,11,12,13},{1,2,3,4,5,6,8,9,10,11,12,13,14},{1,2,3,4,5,6,8,9,10,11,12,13,14,15},{1,2,3,4,5,6,8,9,10,11,12,13,15},{1,2,3,4,5,6,8,9,10,11,12,14},{1,2,3,4,5,6,8,9,10,11,12,14,15},{1,2,3,4,5,6,8,9,10,11,12,15},{1,2,3,4,5,6,8,9,10,11,13},{1,2,3,4,5,6,8,9,10,11,13,14},{1,2,3,4,5,6,8,9,10,11,13,14,15},{1,2,3,4,5,6,8,9,10,11,13,15},{1,2,3,4,5,6,8,9,10,11,14},{1,2,3,4,5,6,8,9,10,11,14,15},{1,2,3,4,5,6,8,9,10,11,15},{1,2,3,4,5,6,8,9,10,12},{1,2,3,4,5,6,8,9,10,12,13},{1,2,3,4,5,6,8,9,10,12,13,14},{1,2,3,4,5,6,8,9,10,12,13,14,15},{1,2,3,4,5,6,8,9,10,12,13,15},{1,2,3,4,5,6,8,9,10,12,14},{1,2,3,4,5,6,8,9,10,12,14,15},{1,2,3,4,5,6,8,9,10,12,15},{1,2,3,4,5,6,8,9,10,13},{1,2,3,4,5,6,8,9,10,13,14},{1,2,3,4,5,6,8,9,10,13,14,15},{1,2,3,4,5,6,8,9,10,13,15},{1,2,3,4,5,6,8,9,10,14},{1,2,3,4,5,6,8,9,10,14,15},{1,2,3,4,5,6,8,9,10,15},{1,2,3,4,5,6,8,9,11},{1,2,3,4,5,6,8,9,11,12},{1,2,3,4,5,6,8,9,11,12,13},{1,2,3,4,5,6,8,9,11,12,13,14},{1,2,3,4,5,6,8,9,11,12,13,14,15},{1,2,3,4,5,6,8,9,11,12,13,15},{1,2,3,4,5,6,8,9,11,12,14},{1,2,3,4,5,6,8,9,11,12,14,15},{1,2,3,4,5,6,8,9,11,12,15},{1,2,3,4,5,6,8,9,11,13},{1,2,3,4,5,6,8,9,11,13,14},{1,2,3,4,5,6,8,9,11,13,14,15},{1,2,3,4,5,6,8,9,11,13,15},{1,2,3,4,5,6,8,9,11,14},{1,2,3,4,5,6,8,9,11,14,15},{1,2,3,4,5,6,8,9,11,15},{1,2,3,4,5,6,8,9,12},{1,2,3,4,5,6,8,9,12,13},{1,2,3,4,5,6,8,9,12,13,14},{1,2,3,4,5,6,8,9,12,13,14,15},{1,2,3,4,5,6,8,9,12,13,15},{1,2,3,4,5,6,8,9,12,14},{1,2,3,4,5,6,8,9,12,14,15},{1,2,3,4,5,6,8,9,12,15},{1,2,3,4,5,6,8,9,13},{1,2,3,4,5,6,8,9,13,14},{1,2,3,4,5,6,8,9,13,14,15},{1,2,3,4,5,6,8,9,13,15},{1,2,3,4,5,6,8,9,14},{1,2,3,4,5,6,8,9,14,15},{1,2,3,4,5,6,8,9,15},{1,2,3,4,5,6,8,10},{1,2,3,4,5,6,8,10,11},{1,2,3,4,5,6,8,10,11,12},{1,2,3,4,5,6,8,10,11,12,13},{1,2,3,4,5,6,8,10,11,12,13,14},{1,2,3,4,5,6,8,10,11,12,13,14,15},{1,2,3,4,5,6,8,10,11,12,13,15},{1,2,3,4,5,6,8,10,11,12,14},{1,2,3,4,5,6,8,10,11,12,14,15},{1,2,3,4,5,6,8,10,11,12,15},{1,2,3,4,5,6,8,10,11,13},{1,2,3,4,5,6,8,10,11,13,14},{1,2,3,4,5,6,8,10,11,13,14,15},{1,2,3,4,5,6,8,10,11,13,15},{1,2,3,4,5,6,8,10,11,14},{1,2,3,4,5,6,8,10,11,14,15},{1,2,3,4,5,6,8,10,11,15},{1,2,3,4,5,6,8,10,12},{1,2,3,4,5,6,8,10,12,13},{1,2,3,4,5,6,8,10,12,13,14},{1,2,3,4,5,6,8,10,12,13,14,15},{1,2,3,4,5,6,8,10,12,13,15},{1,2,3,4,5,6,8,10,12,14},{1,2,3,4,5,6,8,10,12,14,15},{1,2,3,4,5,6,8,10,12,15},{1,2,3,4,5,6,8,10,13},{1,2,3,4,5,6,8,10,13,14},{1,2,3,4,5,6,8,10,13,14,15},{1,2,3,4,5,6,8,10,13,15},{1,2,3,4,5,6,8,10,14},{1,2,3,4,5,6,8,10,14,15},{1,2,3,4,5,6,8,10,15},{1,2,3,4,5,6,8,11},{1,2,3,4,5,6,8,11,12},{1,2,3,4,5,6,8,11,12,13},{1,2,3,4,5,6,8,11,12,13,14},{1,2,3,4,5,6,8,11,12,13,14,15},{1,2,3,4,5,6,8,11,12,13,15},{1,2,3,4,5,6,8,11,12,14},{1,2,3,4,5,6,8,11,12,14,15},{1,2,3,4,5,6,8,11,12,15},{1,2,3,4,5,6,8,11,13},{1,2,3,4,5,6,8,11,13,14},{1,2,3,4,5,6,8,11,13,14,15},{1,2,3,4,5,6,8,11,13,15},{1,2,3,4,5,6,8,11,14},{1,2,3,4,5,6,8,11,14,15},{1,2,3,4,5,6,8,11,15},{1,2,3,4,5,6,8,12},{1,2,3,4,5,6,8,12,13},{1,2,3,4,5,6,8,12,13,14},{1,2,3,4,5,6,8,12,13,14,15},{1,2,3,4,5,6,8,12,13,15},{1,2,3,4,5,6,8,12,14},{1,2,3,4,5,6,8,12,14,15},{1,2,3,4,5,6,8,12,15},{1,2,3,4,5,6,8,13},{1,2,3,4,5,6,8,13,14},{1,2,3,4,5,6,8,13,14,15},{1,2,3,4,5,6,8,13,15},{1,2,3,4,5,6,8,14},{1,2,3,4,5,6,8,14,15},{1,2,3,4,5,6,8,15},{1,2,3,4,5,6,9},{1,2,3,4,5,6,9,10},{1,2,3,4,5,6,9,10,11},{1,2,3,4,5,6,9,10,11,12},{1,2,3,4,5,6,9,10,11,12,13},{1,2,3,4,5,6,9,10,11,12,13,14},{1,2,3,4,5,6,9,10,11,12,13,14,15},{1,2,3,4,5,6,9,10,11,12,13,15},{1,2,3,4,5,6,9,10,11,12,14},{1,2,3,4,5,6,9,10,11,12,14,15},{1,2,3,4,5,6,9,10,11,12,15},{1,2,3,4,5,6,9,10,11,13},{1,2,3,4,5,6,9,10,11,13,14},{1,2,3,4,5,6,9,10,11,13,14,15},{1,2,3,4,5,6,9,10,11,13,15},{1,2,3,4,5,6,9,10,11,14},{1,2,3,4,5,6,9,10,11,14,15},{1,2,3,4,5,6,9,10,11,15},{1,2,3,4,5,6,9,10,12},{1,2,3,4,5,6,9,10,12,13},{1,2,3,4,5,6,9,10,12,13,14},{1,2,3,4,5,6,9,10,12,13,14,15},{1,2,3,4,5,6,9,10,12,13,15},{1,2,3,4,5,6,9,10,12,14},{1,2,3,4,5,6,9,10,12,14,15},{1,2,3,4,5,6,9,10,12,15},{1,2,3,4,5,6,9,10,13},{1,2,3,4,5,6,9,10,13,14},{1,2,3,4,5,6,9,10,13,14,15},{1,2,3,4,5,6,9,10,13,15},{1,2,3,4,5,6,9,10,14},{1,2,3,4,5,6,9,10,14,15},{1,2,3,4,5,6,9,10,15},{1,2,3,4,5,6,9,11},{1,2,3,4,5,6,9,11,12},{1,2,3,4,5,6,9,11,12,13},{1,2,3,4,5,6,9,11,12,13,14},{1,2,3,4,5,6,9,11,12,13,14,15},{1,2,3,4,5,6,9,11,12,13,15},{1,2,3,4,5,6,9,11,12,14},{1,2,3,4,5,6,9,11,12,14,15},{1,2,3,4,5,6,9,11,12,15},{1,2,3,4,5,6,9,11,13},{1,2,3,4,5,6,9,11,13,14},{1,2,3,4,5,6,9,11,13,14,15},{1,2,3,4,5,6,9,11,13,15},{1,2,3,4,5,6,9,11,14},{1,2,3,4,5,6,9,11,14,15},{1,2,3,4,5,6,9,11,15},{1,2,3,4,5,6,9,12},{1,2,3,4,5,6,9,12,13},{1,2,3,4,5,6,9,12,13,14},{1,2,3,4,5,6,9,12,13,14,15},{1,2,3,4,5,6,9,12,13,15},{1,2,3,4,5,6,9,12,14},{1,2,3,4,5,6,9,12,14,15},{1,2,3,4,5,6,9,12,15},{1,2,3,4,5,6,9,13},{1,2,3,4,5,6,9,13,14},{1,2,3,4,5,6,9,13,14,15},{1,2,3,4,5,6,9,13,15},{1,2,3,4,5,6,9,14},{1,2,3,4,5,6,9,14,15},{1,2,3,4,5,6,9,15},{1,2,3,4,5,6,10},{1,2,3,4,5,6,10,11},{1,2,3,4,5,6,10,11,12},{1,2,3,4,5,6,10,11,12,13},{1,2,3,4,5,6,10,11,12,13,14},{1,2,3,4,5,6,10,11,12,13,14,15},{1,2,3,4,5,6,10,11,12,13,15},{1,2,3,4,5,6,10,11,12,14},{1,2,3,4,5,6,10,11,12,14,15},{1,2,3,4,5,6,10,11,12,15},{1,2,3,4,5,6,10,11,13},{1,2,3,4,5,6,10,11,13,14},{1,2,3,4,5,6,10,11,13,14,15},{1,2,3,4,5,6,10,11,13,15},{1,2,3,4,5,6,10,11,14},{1,2,3,4,5,6,10,11,14,15},{1,2,3,4,5,6,10,11,15},{1,2,3,4,5,6,10,12},{1,2,3,4,5,6,10,12,13},{1,2,3,4,5,6,10,12,13,14},{1,2,3,4,5,6,10,12,13,14,15},{1,2,3,4,5,6,10,12,13,15},{1,2,3,4,5,6,10,12,14},{1,2,3,4,5,6,10,12,14,15},{1,2,3,4,5,6,10,12,15},{1,2,3,4,5,6,10,13},{1,2,3,4,5,6,10,13,14},{1,2,3,4,5,6,10,13,14,15},{1,2,3,4,5,6,10,13,15},{1,2,3,4,5,6,10,14},{1,2,3,4,5,6,10,14,15},{1,2,3,4,5,6,10,15},{1,2,3,4,5,6,11},{1,2,3,4,5,6,11,12},{1,2,3,4,5,6,11,12,13},{1,2,3,4,5,6,11,12,13,14},{1,2,3,4,5,6,11,12,13,14,15},{1,2,3,4,5,6,11,12,13,15},{1,2,3,4,5,6,11,12,14},{1,2,3,4,5,6,11,12,14,15},{1,2,3,4,5,6,11,12,15},{1,2,3,4,5,6,11,13},{1,2,3,4,5,6,11,13,14},{1,2,3,4,5,6,11,13,14,15},{1,2,3,4,5,6,11,13,15},{1,2,3,4,5,6,11,14},{1,2,3,4,5,6,11,14,15},{1,2,3,4,5,6,11,15},{1,2,3,4,5,6,12},{1,2,3,4,5,6,12,13},{1,2,3,4,5,6,12,13,14},{1,2,3,4,5,6,12,13,14,15},{1,2,3,4,5,6,12,13,15},{1,2,3,4,5,6,12,14},{1,2,3,4,5,6,12,14,15},{1,2,3,4,5,6,12,15},{1,2,3,4,5,6,13},{1,2,3,4,5,6,13,14},{1,2,3,4,5,6,13,14,15},{1,2,3,4,5,6,13,15},{1,2,3,4,5,6,14},{1,2,3,4,5,6,14,15},{1,2,3,4,5,6,15},{1,2,3,4,5,7},{1,2,3,4,5,7,8},{1,2,3,4,5,7,8,9},{1,2,3,4,5,7,8,9,10},{1,2,3,4,5,7,8,9,10,11},{1,2,3,4,5,7,8,9,10,11,12},{1,2,3,4,5,7,8,9,10,11,12,13},{1,2,3,4,5,7,8,9,10,11,12,13,14},{1,2,3,4,5,7,8,9,10,11,12,13,14,15},{1,2,3,4,5,7,8,9,10,11,12,13,15},{1,2,3,4,5,7,8,9,10,11,12,14},{1,2,3,4,5,7,8,9,10,11,12,14,15},{1,2,3,4,5,7,8,9,10,11,12,15},{1,2,3,4,5,7,8,9,10,11,13},{1,2,3,4,5,7,8,9,10,11,13,14},{1,2,3,4,5,7,8,9,10,11,13,14,15},{1,2,3,4,5,7,8,9,10,11,13,15},{1,2,3,4,5,7,8,9,10,11,14},{1,2,3,4,5,7,8,9,10,11,14,15},{1,2,3,4,5,7,8,9,10,11,15},{1,2,3,4,5,7,8,9,10,12},{1,2,3,4,5,7,8,9,10,12,13},{1,2,3,4,5,7,8,9,10,12,13,14},{1,2,3,4,5,7,8,9,10,12,13,14,15},{1,2,3,4,5,7,8,9,10,12,13,15},{1,2,3,4,5,7,8,9,10,12,14},{1,2,3,4,5,7,8,9,10,12,14,15},{1,2,3,4,5,7,8,9,10,12,15},{1,2,3,4,5,7,8,9,10,13},{1,2,3,4,5,7,8,9,10,13,14},{1,2,3,4,5,7,8,9,10,13,14,15},{1,2,3,4,5,7,8,9,10,13,15},{1,2,3,4,5,7,8,9,10,14},{1,2,3,4,5,7,8,9,10,14,15},{1,2,3,4,5,7,8,9,10,15},{1,2,3,4,5,7,8,9,11},{1,2,3,4,5,7,8,9,11,12},{1,2,3,4,5,7,8,9,11,12,13},{1,2,3,4,5,7,8,9,11,12,13,14},{1,2,3,4,5,7,8,9,11,12,13,14,15},{1,2,3,4,5,7,8,9,11,12,13,15},{1,2,3,4,5,7,8,9,11,12,14},{1,2,3,4,5,7,8,9,11,12,14,15},{1,2,3,4,5,7,8,9,11,12,15},{1,2,3,4,5,7,8,9,11,13},{1,2,3,4,5,7,8,9,11,13,14},{1,2,3,4,5,7,8,9,11,13,14,15},{1,2,3,4,5,7,8,9,11,13,15},{1,2,3,4,5,7,8,9,11,14},{1,2,3,4,5,7,8,9,11,14,15},{1,2,3,4,5,7,8,9,11,15},{1,2,3,4,5,7,8,9,12},{1,2,3,4,5,7,8,9,12,13},{1,2,3,4,5,7,8,9,12,13,14},{1,2,3,4,5,7,8,9,12,13,14,15},{1,2,3,4,5,7,8,9,12,13,15},{1,2,3,4,5,7,8,9,12,14},{1,2,3,4,5,7,8,9,12,14,15},{1,2,3,4,5,7,8,9,12,15},{1,2,3,4,5,7,8,9,13},{1,2,3,4,5,7,8,9,13,14},{1,2,3,4,5,7,8,9,13,14,15},{1,2,3,4,5,7,8,9,13,15},{1,2,3,4,5,7,8,9,14},{1,2,3,4,5,7,8,9,14,15},{1,2,3,4,5,7,8,9,15},{1,2,3,4,5,7,8,10},{1,2,3,4,5,7,8,10,11},{1,2,3,4,5,7,8,10,11,12},{1,2,3,4,5,7,8,10,11,12,13},{1,2,3,4,5,7,8,10,11,12,13,14},{1,2,3,4,5,7,8,10,11,12,13,14,15},{1,2,3,4,5,7,8,10,11,12,13,15},{1,2,3,4,5,7,8,10,11,12,14},{1,2,3,4,5,7,8,10,11,12,14,15},{1,2,3,4,5,7,8,10,11,12,15},{1,2,3,4,5,7,8,10,11,13},{1,2,3,4,5,7,8,10,11,13,14},{1,2,3,4,5,7,8,10,11,13,14,15},{1,2,3,4,5,7,8,10,11,13,15},{1,2,3,4,5,7,8,10,11,14},{1,2,3,4,5,7,8,10,11,14,15},{1,2,3,4,5,7,8,10,11,15},{1,2,3,4,5,7,8,10,12},{1,2,3,4,5,7,8,10,12,13},{1,2,3,4,5,7,8,10,12,13,14},{1,2,3,4,5,7,8,10,12,13,14,15},{1,2,3,4,5,7,8,10,12,13,15},{1,2,3,4,5,7,8,10,12,14},{1,2,3,4,5,7,8,10,12,14,15},{1,2,3,4,5,7,8,10,12,15},{1,2,3,4,5,7,8,10,13},{1,2,3,4,5,7,8,10,13,14},{1,2,3,4,5,7,8,10,13,14,15},{1,2,3,4,5,7,8,10,13,15},{1,2,3,4,5,7,8,10,14},{1,2,3,4,5,7,8,10,14,15},{1,2,3,4,5,7,8,10,15},{1,2,3,4,5,7,8,11},{1,2,3,4,5,7,8,11,12},{1,2,3,4,5,7,8,11,12,13},{1,2,3,4,5,7,8,11,12,13,14},{1,2,3,4,5,7,8,11,12,13,14,15},{1,2,3,4,5,7,8,11,12,13,15},{1,2,3,4,5,7,8,11,12,14},{1,2,3,4,5,7,8,11,12,14,15},{1,2,3,4,5,7,8,11,12,15},{1,2,3,4,5,7,8,11,13},{1,2,3,4,5,7,8,11,13,14},{1,2,3,4,5,7,8,11,13,14,15},{1,2,3,4,5,7,8,11,13,15},{1,2,3,4,5,7,8,11,14},{1,2,3,4,5,7,8,11,14,15},{1,2,3,4,5,7,8,11,15},{1,2,3,4,5,7,8,12},{1,2,3,4,5,7,8,12,13},{1,2,3,4,5,7,8,12,13,14},{1,2,3,4,5,7,8,12,13,14,15},{1,2,3,4,5,7,8,12,13,15},{1,2,3,4,5,7,8,12,14},{1,2,3,4,5,7,8,12,14,15},{1,2,3,4,5,7,8,12,15},{1,2,3,4,5,7,8,13},{1,2,3,4,5,7,8,13,14},{1,2,3,4,5,7,8,13,14,15},{1,2,3,4,5,7,8,13,15},{1,2,3,4,5,7,8,14},{1,2,3,4,5,7,8,14,15},{1,2,3,4,5,7,8,15},{1,2,3,4,5,7,9},{1,2,3,4,5,7,9,10},{1,2,3,4,5,7,9,10,11},{1,2,3,4,5,7,9,10,11,12},{1,2,3,4,5,7,9,10,11,12,13},{1,2,3,4,5,7,9,10,11,12,13,14},{1,2,3,4,5,7,9,10,11,12,13,14,15},{1,2,3,4,5,7,9,10,11,12,13,15},{1,2,3,4,5,7,9,10,11,12,14},{1,2,3,4,5,7,9,10,11,12,14,15},{1,2,3,4,5,7,9,10,11,12,15},{1,2,3,4,5,7,9,10,11,13},{1,2,3,4,5,7,9,10,11,13,14},{1,2,3,4,5,7,9,10,11,13,14,15},{1,2,3,4,5,7,9,10,11,13,15},{1,2,3,4,5,7,9,10,11,14},{1,2,3,4,5,7,9,10,11,14,15},{1,2,3,4,5,7,9,10,11,15},{1,2,3,4,5,7,9,10,12},{1,2,3,4,5,7,9,10,12,13},{1,2,3,4,5,7,9,10,12,13,14},{1,2,3,4,5,7,9,10,12,13,14,15},{1,2,3,4,5,7,9,10,12,13,15},{1,2,3,4,5,7,9,10,12,14},{1,2,3,4,5,7,9,10,12,14,15},{1,2,3,4,5,7,9,10,12,15},{1,2,3,4,5,7,9,10,13},{1,2,3,4,5,7,9,10,13,14},{1,2,3,4,5,7,9,10,13,14,15},{1,2,3,4,5,7,9,10,13,15},{1,2,3,4,5,7,9,10,14},{1,2,3,4,5,7,9,10,14,15},{1,2,3,4,5,7,9,10,15},{1,2,3,4,5,7,9,11},{1,2,3,4,5,7,9,11,12},{1,2,3,4,5,7,9,11,12,13},{1,2,3,4,5,7,9,11,12,13,14},{1,2,3,4,5,7,9,11,12,13,14,15},{1,2,3,4,5,7,9,11,12,13,15},{1,2,3,4,5,7,9,11,12,14},{1,2,3,4,5,7,9,11,12,14,15},{1,2,3,4,5,7,9,11,12,15},{1,2,3,4,5,7,9,11,13},{1,2,3,4,5,7,9,11,13,14},{1,2,3,4,5,7,9,11,13,14,15},{1,2,3,4,5,7,9,11,13,15},{1,2,3,4,5,7,9,11,14},{1,2,3,4,5,7,9,11,14,15},{1,2,3,4,5,7,9,11,15},{1,2,3,4,5,7,9,12},{1,2,3,4,5,7,9,12,13},{1,2,3,4,5,7,9,12,13,14},{1,2,3,4,5,7,9,12,13,14,15},{1,2,3,4,5,7,9,12,13,15},{1,2,3,4,5,7,9,12,14},{1,2,3,4,5,7,9,12,14,15},{1,2,3,4,5,7,9,12,15},{1,2,3,4,5,7,9,13},{1,2,3,4,5,7,9,13,14},{1,2,3,4,5,7,9,13,14,15},{1,2,3,4,5,7,9,13,15},{1,2,3,4,5,7,9,14},{1,2,3,4,5,7,9,14,15},{1,2,3,4,5,7,9,15},{1,2,3,4,5,7,10},{1,2,3,4,5,7,10,11},{1,2,3,4,5,7,10,11,12},{1,2,3,4,5,7,10,11,12,13},{1,2,3,4,5,7,10,11,12,13,14},{1,2,3,4,5,7,10,11,12,13,14,15},{1,2,3,4,5,7,10,11,12,13,15},{1,2,3,4,5,7,10,11,12,14},{1,2,3,4,5,7,10,11,12,14,15},{1,2,3,4,5,7,10,11,12,15},{1,2,3,4,5,7,10,11,13},{1,2,3,4,5,7,10,11,13,14},{1,2,3,4,5,7,10,11,13,14,15},{1,2,3,4,5,7,10,11,13,15},{1,2,3,4,5,7,10,11,14},{1,2,3,4,5,7,10,11,14,15},{1,2,3,4,5,7,10,11,15},{1,2,3,4,5,7,10,12},{1,2,3,4,5,7,10,12,13},{1,2,3,4,5,7,10,12,13,14},{1,2,3,4,5,7,10,12,13,14,15},{1,2,3,4,5,7,10,12,13,15},{1,2,3,4,5,7,10,12,14},{1,2,3,4,5,7,10,12,14,15},{1,2,3,4,5,7,10,12,15},{1,2,3,4,5,7,10,13},{1,2,3,4,5,7,10,13,14},{1,2,3,4,5,7,10,13,14,15},{1,2,3,4,5,7,10,13,15},{1,2,3,4,5,7,10,14},{1,2,3,4,5,7,10,14,15},{1,2,3,4,5,7,10,15},{1,2,3,4,5,7,11},{1,2,3,4,5,7,11,12},{1,2,3,4,5,7,11,12,13},{1,2,3,4,5,7,11,12,13,14},{1,2,3,4,5,7,11,12,13,14,15},{1,2,3,4,5,7,11,12,13,15},{1,2,3,4,5,7,11,12,14},{1,2,3,4,5,7,11,12,14,15},{1,2,3,4,5,7,11,12,15},{1,2,3,4,5,7,11,13},{1,2,3,4,5,7,11,13,14},{1,2,3,4,5,7,11,13,14,15},{1,2,3,4,5,7,11,13,15},{1,2,3,4,5,7,11,14},{1,2,3,4,5,7,11,14,15},{1,2,3,4,5,7,11,15},{1,2,3,4,5,7,12},{1,2,3,4,5,7,12,13},{1,2,3,4,5,7,12,13,14},{1,2,3,4,5,7,12,13,14,15},{1,2,3,4,5,7,12,13,15},{1,2,3,4,5,7,12,14},{1,2,3,4,5,7,12,14,15},{1,2,3,4,5,7,12,15},{1,2,3,4,5,7,13},{1,2,3,4,5,7,13,14},{1,2,3,4,5,7,13,14,15},{1,2,3,4,5,7,13,15},{1,2,3,4,5,7,14},{1,2,3,4,5,7,14,15},{1,2,3,4,5,7,15},{1,2,3,4,5,8},{1,2,3,4,5,8,9},{1,2,3,4,5,8,9,10},{1,2,3,4,5,8,9,10,11},{1,2,3,4,5,8,9,10,11,12},{1,2,3,4,5,8,9,10,11,12,13},{1,2,3,4,5,8,9,10,11,12,13,14},{1,2,3,4,5,8,9,10,11,12,13,14,15},{1,2,3,4,5,8,9,10,11,12,13,15},{1,2,3,4,5,8,9,10,11,12,14},{1,2,3,4,5,8,9,10,11,12,14,15},{1,2,3,4,5,8,9,10,11,12,15},{1,2,3,4,5,8,9,10,11,13},{1,2,3,4,5,8,9,10,11,13,14},{1,2,3,4,5,8,9,10,11,13,14,15},{1,2,3,4,5,8,9,10,11,13,15},{1,2,3,4,5,8,9,10,11,14},{1,2,3,4,5,8,9,10,11,14,15},{1,2,3,4,5,8,9,10,11,15},{1,2,3,4,5,8,9,10,12},{1,2,3,4,5,8,9,10,12,13},{1,2,3,4,5,8,9,10,12,13,14},{1,2,3,4,5,8,9,10,12,13,14,15},{1,2,3,4,5,8,9,10,12,13,15},{1,2,3,4,5,8,9,10,12,14},{1,2,3,4,5,8,9,10,12,14,15},{1,2,3,4,5,8,9,10,12,15},{1,2,3,4,5,8,9,10,13},{1,2,3,4,5,8,9,10,13,14},{1,2,3,4,5,8,9,10,13,14,15},{1,2,3,4,5,8,9,10,13,15},{1,2,3,4,5,8,9,10,14},{1,2,3,4,5,8,9,10,14,15},{1,2,3,4,5,8,9,10,15},{1,2,3,4,5,8,9,11},{1,2,3,4,5,8,9,11,12},{1,2,3,4,5,8,9,11,12,13},{1,2,3,4,5,8,9,11,12,13,14},{1,2,3,4,5,8,9,11,12,13,14,15},{1,2,3,4,5,8,9,11,12,13,15},{1,2,3,4,5,8,9,11,12,14},{1,2,3,4,5,8,9,11,12,14,15},{1,2,3,4,5,8,9,11,12,15},{1,2,3,4,5,8,9,11,13},{1,2,3,4,5,8,9,11,13,14},{1,2,3,4,5,8,9,11,13,14,15},{1,2,3,4,5,8,9,11,13,15},{1,2,3,4,5,8,9,11,14},{1,2,3,4,5,8,9,11,14,15},{1,2,3,4,5,8,9,11,15},{1,2,3,4,5,8,9,12},{1,2,3,4,5,8,9,12,13},{1,2,3,4,5,8,9,12,13,14},{1,2,3,4,5,8,9,12,13,14,15},{1,2,3,4,5,8,9,12,13,15},{1,2,3,4,5,8,9,12,14},{1,2,3,4,5,8,9,12,14,15},{1,2,3,4,5,8,9,12,15},{1,2,3,4,5,8,9,13},{1,2,3,4,5,8,9,13,14},{1,2,3,4,5,8,9,13,14,15},{1,2,3,4,5,8,9,13,15},{1,2,3,4,5,8,9,14},{1,2,3,4,5,8,9,14,15},{1,2,3,4,5,8,9,15},{1,2,3,4,5,8,10},{1,2,3,4,5,8,10,11},{1,2,3,4,5,8,10,11,12},{1,2,3,4,5,8,10,11,12,13},{1,2,3,4,5,8,10,11,12,13,14},{1,2,3,4,5,8,10,11,12,13,14,15},{1,2,3,4,5,8,10,11,12,13,15},{1,2,3,4,5,8,10,11,12,14},{1,2,3,4,5,8,10,11,12,14,15},{1,2,3,4,5,8,10,11,12,15},{1,2,3,4,5,8,10,11,13},{1,2,3,4,5,8,10,11,13,14},{1,2,3,4,5,8,10,11,13,14,15},{1,2,3,4,5,8,10,11,13,15},{1,2,3,4,5,8,10,11,14},{1,2,3,4,5,8,10,11,14,15},{1,2,3,4,5,8,10,11,15},{1,2,3,4,5,8,10,12},{1,2,3,4,5,8,10,12,13},{1,2,3,4,5,8,10,12,13,14},{1,2,3,4,5,8,10,12,13,14,15},{1,2,3,4,5,8,10,12,13,15},{1,2,3,4,5,8,10,12,14},{1,2,3,4,5,8,10,12,14,15},{1,2,3,4,5,8,10,12,15},{1,2,3,4,5,8,10,13},{1,2,3,4,5,8,10,13,14},{1,2,3,4,5,8,10,13,14,15},{1,2,3,4,5,8,10,13,15},{1,2,3,4,5,8,10,14},{1,2,3,4,5,8,10,14,15},{1,2,3,4,5,8,10,15},{1,2,3,4,5,8,11},{1,2,3,4,5,8,11,12},{1,2,3,4,5,8,11,12,13},{1,2,3,4,5,8,11,12,13,14},{1,2,3,4,5,8,11,12,13,14,15},{1,2,3,4,5,8,11,12,13,15},{1,2,3,4,5,8,11,12,14},{1,2,3,4,5,8,11,12,14,15},{1,2,3,4,5,8,11,12,15},{1,2,3,4,5,8,11,13},{1,2,3,4,5,8,11,13,14},{1,2,3,4,5,8,11,13,14,15},{1,2,3,4,5,8,11,13,15},{1,2,3,4,5,8,11,14},{1,2,3,4,5,8,11,14,15},{1,2,3,4,5,8,11,15},{1,2,3,4,5,8,12},{1,2,3,4,5,8,12,13},{1,2,3,4,5,8,12,13,14},{1,2,3,4,5,8,12,13,14,15},{1,2,3,4,5,8,12,13,15},{1,2,3,4,5,8,12,14},{1,2,3,4,5,8,12,14,15},{1,2,3,4,5,8,12,15},{1,2,3,4,5,8,13},{1,2,3,4,5,8,13,14},{1,2,3,4,5,8,13,14,15},{1,2,3,4,5,8,13,15},{1,2,3,4,5,8,14},{1,2,3,4,5,8,14,15},{1,2,3,4,5,8,15},{1,2,3,4,5,9},{1,2,3,4,5,9,10},{1,2,3,4,5,9,10,11},{1,2,3,4,5,9,10,11,12},{1,2,3,4,5,9,10,11,12,13},{1,2,3,4,5,9,10,11,12,13,14},{1,2,3,4,5,9,10,11,12,13,14,15},{1,2,3,4,5,9,10,11,12,13,15},{1,2,3,4,5,9,10,11,12,14},{1,2,3,4,5,9,10,11,12,14,15},{1,2,3,4,5,9,10,11,12,15},{1,2,3,4,5,9,10,11,13},{1,2,3,4,5,9,10,11,13,14},{1,2,3,4,5,9,10,11,13,14,15},{1,2,3,4,5,9,10,11,13,15},{1,2,3,4,5,9,10,11,14},{1,2,3,4,5,9,10,11,14,15},{1,2,3,4,5,9,10,11,15},{1,2,3,4,5,9,10,12},{1,2,3,4,5,9,10,12,13},{1,2,3,4,5,9,10,12,13,14},{1,2,3,4,5,9,10,12,13,14,15},{1,2,3,4,5,9,10,12,13,15},{1,2,3,4,5,9,10,12,14},{1,2,3,4,5,9,10,12,14,15},{1,2,3,4,5,9,10,12,15},{1,2,3,4,5,9,10,13},{1,2,3,4,5,9,10,13,14},{1,2,3,4,5,9,10,13,14,15},{1,2,3,4,5,9,10,13,15},{1,2,3,4,5,9,10,14},{1,2,3,4,5,9,10,14,15},{1,2,3,4,5,9,10,15},{1,2,3,4,5,9,11},{1,2,3,4,5,9,11,12},{1,2,3,4,5,9,11,12,13},{1,2,3,4,5,9,11,12,13,14},{1,2,3,4,5,9,11,12,13,14,15},{1,2,3,4,5,9,11,12,13,15},{1,2,3,4,5,9,11,12,14},{1,2,3,4,5,9,11,12,14,15},{1,2,3,4,5,9,11,12,15},{1,2,3,4,5,9,11,13},{1,2,3,4,5,9,11,13,14},{1,2,3,4,5,9,11,13,14,15},{1,2,3,4,5,9,11,13,15},{1,2,3,4,5,9,11,14},{1,2,3,4,5,9,11,14,15},{1,2,3,4,5,9,11,15},{1,2,3,4,5,9,12},{1,2,3,4,5,9,12,13},{1,2,3,4,5,9,12,13,14},{1,2,3,4,5,9,12,13,14,15},{1,2,3,4,5,9,12,13,15},{1,2,3,4,5,9,12,14},{1,2,3,4,5,9,12,14,15},{1,2,3,4,5,9,12,15},{1,2,3,4,5,9,13},{1,2,3,4,5,9,13,14},{1,2,3,4,5,9,13,14,15},{1,2,3,4,5,9,13,15},{1,2,3,4,5,9,14},{1,2,3,4,5,9,14,15},{1,2,3,4,5,9,15},{1,2,3,4,5,10},{1,2,3,4,5,10,11},{1,2,3,4,5,10,11,12},{1,2,3,4,5,10,11,12,13},{1,2,3,4,5,10,11,12,13,14},{1,2,3,4,5,10,11,12,13,14,15},{1,2,3,4,5,10,11,12,13,15},{1,2,3,4,5,10,11,12,14},{1,2,3,4,5,10,11,12,14,15},{1,2,3,4,5,10,11,12,15},{1,2,3,4,5,10,11,13},{1,2,3,4,5,10,11,13,14},{1,2,3,4,5,10,11,13,14,15},{1,2,3,4,5,10,11,13,15},{1,2,3,4,5,10,11,14},{1,2,3,4,5,10,11,14,15},{1,2,3,4,5,10,11,15},{1,2,3,4,5,10,12},{1,2,3,4,5,10,12,13},{1,2,3,4,5,10,12,13,14},{1,2,3,4,5,10,12,13,14,15},{1,2,3,4,5,10,12,13,15},{1,2,3,4,5,10,12,14},{1,2,3,4,5,10,12,14,15},{1,2,3,4,5,10,12,15},{1,2,3,4,5,10,13},{1,2,3,4,5,10,13,14},{1,2,3,4,5,10,13,14,15},{1,2,3,4,5,10,13,15},{1,2,3,4,5,10,14},{1,2,3,4,5,10,14,15},{1,2,3,4,5,10,15},{1,2,3,4,5,11},{1,2,3,4,5,11,12},{1,2,3,4,5,11,12,13},{1,2,3,4,5,11,12,13,14},{1,2,3,4,5,11,12,13,14,15},{1,2,3,4,5,11,12,13,15},{1,2,3,4,5,11,12,14},{1,2,3,4,5,11,12,14,15},{1,2,3,4,5,11,12,15},{1,2,3,4,5,11,13},{1,2,3,4,5,11,13,14},{1,2,3,4,5,11,13,14,15},{1,2,3,4,5,11,13,15},{1,2,3,4,5,11,14},{1,2,3,4,5,11,14,15},{1,2,3,4,5,11,15},{1,2,3,4,5,12},{1,2,3,4,5,12,13},{1,2,3,4,5,12,13,14},{1,2,3,4,5,12,13,14,15},{1,2,3,4,5,12,13,15},{1,2,3,4,5,12,14},{1,2,3,4,5,12,14,15},{1,2,3,4,5,12,15},{1,2,3,4,5,13},{1,2,3,4,5,13,14},{1,2,3,4,5,13,14,15},{1,2,3,4,5,13,15},{1,2,3,4,5,14},{1,2,3,4,5,14,15},{1,2,3,4,5,15},{1,2,3,4,6},{1,2,3,4,6,7},{1,2,3,4,6,7,8},{1,2,3,4,6,7,8,9},{1,2,3,4,6,7,8,9,10},{1,2,3,4,6,7,8,9,10,11},{1,2,3,4,6,7,8,9,10,11,12},{1,2,3,4,6,7,8,9,10,11,12,13},{1,2,3,4,6,7,8,9,10,11,12,13,14},{1,2,3,4,6,7,8,9,10,11,12,13,14,15},{1,2,3,4,6,7,8,9,10,11,12,13,15},{1,2,3,4,6,7,8,9,10,11,12,14},{1,2,3,4,6,7,8,9,10,11,12,14,15},{1,2,3,4,6,7,8,9,10,11,12,15},{1,2,3,4,6,7,8,9,10,11,13},{1,2,3,4,6,7,8,9,10,11,13,14},{1,2,3,4,6,7,8,9,10,11,13,14,15},{1,2,3,4,6,7,8,9,10,11,13,15},{1,2,3,4,6,7,8,9,10,11,14},{1,2,3,4,6,7,8,9,10,11,14,15},{1,2,3,4,6,7,8,9,10,11,15},{1,2,3,4,6,7,8,9,10,12},{1,2,3,4,6,7,8,9,10,12,13},{1,2,3,4,6,7,8,9,10,12,13,14},{1,2,3,4,6,7,8,9,10,12,13,14,15},{1,2,3,4,6,7,8,9,10,12,13,15},{1,2,3,4,6,7,8,9,10,12,14},{1,2,3,4,6,7,8,9,10,12,14,15},{1,2,3,4,6,7,8,9,10,12,15},{1,2,3,4,6,7,8,9,10,13},{1,2,3,4,6,7,8,9,10,13,14},{1,2,3,4,6,7,8,9,10,13,14,15},{1,2,3,4,6,7,8,9,10,13,15},{1,2,3,4,6,7,8,9,10,14},{1,2,3,4,6,7,8,9,10,14,15},{1,2,3,4,6,7,8,9,10,15},{1,2,3,4,6,7,8,9,11},{1,2,3,4,6,7,8,9,11,12},{1,2,3,4,6,7,8,9,11,12,13},{1,2,3,4,6,7,8,9,11,12,13,14},{1,2,3,4,6,7,8,9,11,12,13,14,15},{1,2,3,4,6,7,8,9,11,12,13,15},{1,2,3,4,6,7,8,9,11,12,14},{1,2,3,4,6,7,8,9,11,12,14,15},{1,2,3,4,6,7,8,9,11,12,15},{1,2,3,4,6,7,8,9,11,13},{1,2,3,4,6,7,8,9,11,13,14},{1,2,3,4,6,7,8,9,11,13,14,15},{1,2,3,4,6,7,8,9,11,13,15},{1,2,3,4,6,7,8,9,11,14},{1,2,3,4,6,7,8,9,11,14,15},{1,2,3,4,6,7,8,9,11,15},{1,2,3,4,6,7,8,9,12},{1,2,3,4,6,7,8,9,12,13},{1,2,3,4,6,7,8,9,12,13,14},{1,2,3,4,6,7,8,9,12,13,14,15},{1,2,3,4,6,7,8,9,12,13,15},{1,2,3,4,6,7,8,9,12,14},{1,2,3,4,6,7,8,9,12,14,15},{1,2,3,4,6,7,8,9,12,15},{1,2,3,4,6,7,8,9,13},{1,2,3,4,6,7,8,9,13,14},{1,2,3,4,6,7,8,9,13,14,15},{1,2,3,4,6,7,8,9,13,15},{1,2,3,4,6,7,8,9,14},{1,2,3,4,6,7,8,9,14,15},{1,2,3,4,6,7,8,9,15},{1,2,3,4,6,7,8,10},{1,2,3,4,6,7,8,10,11},{1,2,3,4,6,7,8,10,11,12},{1,2,3,4,6,7,8,10,11,12,13},{1,2,3,4,6,7,8,10,11,12,13,14},{1,2,3,4,6,7,8,10,11,12,13,14,15},{1,2,3,4,6,7,8,10,11,12,13,15},{1,2,3,4,6,7,8,10,11,12,14},{1,2,3,4,6,7,8,10,11,12,14,15},{1,2,3,4,6,7,8,10,11,12,15},{1,2,3,4,6,7,8,10,11,13},{1,2,3,4,6,7,8,10,11,13,14},{1,2,3,4,6,7,8,10,11,13,14,15},{1,2,3,4,6,7,8,10,11,13,15},{1,2,3,4,6,7,8,10,11,14},{1,2,3,4,6,7,8,10,11,14,15},{1,2,3,4,6,7,8,10,11,15},{1,2,3,4,6,7,8,10,12},{1,2,3,4,6,7,8,10,12,13},{1,2,3,4,6,7,8,10,12,13,14},{1,2,3,4,6,7,8,10,12,13,14,15},{1,2,3,4,6,7,8,10,12,13,15},{1,2,3,4,6,7,8,10,12,14},{1,2,3,4,6,7,8,10,12,14,15},{1,2,3,4,6,7,8,10,12,15},{1,2,3,4,6,7,8,10,13},{1,2,3,4,6,7,8,10,13,14},{1,2,3,4,6,7,8,10,13,14,15},{1,2,3,4,6,7,8,10,13,15},{1,2,3,4,6,7,8,10,14},{1,2,3,4,6,7,8,10,14,15},{1,2,3,4,6,7,8,10,15},{1,2,3,4,6,7,8,11},{1,2,3,4,6,7,8,11,12},{1,2,3,4,6,7,8,11,12,13},{1,2,3,4,6,7,8,11,12,13,14},{1,2,3,4,6,7,8,11,12,13,14,15},{1,2,3,4,6,7,8,11,12,13,15},{1,2,3,4,6,7,8,11,12,14},{1,2,3,4,6,7,8,11,12,14,15},{1,2,3,4,6,7,8,11,12,15},{1,2,3,4,6,7,8,11,13},{1,2,3,4,6,7,8,11,13,14},{1,2,3,4,6,7,8,11,13,14,15},{1,2,3,4,6,7,8,11,13,15},{1,2,3,4,6,7,8,11,14},{1,2,3,4,6,7,8,11,14,15},{1,2,3,4,6,7,8,11,15},{1,2,3,4,6,7,8,12},{1,2,3,4,6,7,8,12,13},{1,2,3,4,6,7,8,12,13,14},{1,2,3,4,6,7,8,12,13,14,15},{1,2,3,4,6,7,8,12,13,15},{1,2,3,4,6,7,8,12,14},{1,2,3,4,6,7,8,12,14,15},{1,2,3,4,6,7,8,12,15},{1,2,3,4,6,7,8,13},{1,2,3,4,6,7,8,13,14},{1,2,3,4,6,7,8,13,14,15},{1,2,3,4,6,7,8,13,15},{1,2,3,4,6,7,8,14},{1,2,3,4,6,7,8,14,15},{1,2,3,4,6,7,8,15},{1,2,3,4,6,7,9},{1,2,3,4,6,7,9,10},{1,2,3,4,6,7,9,10,11},{1,2,3,4,6,7,9,10,11,12},{1,2,3,4,6,7,9,10,11,12,13},{1,2,3,4,6,7,9,10,11,12,13,14},{1,2,3,4,6,7,9,10,11,12,13,14,15},{1,2,3,4,6,7,9,10,11,12,13,15},{1,2,3,4,6,7,9,10,11,12,14},{1,2,3,4,6,7,9,10,11,12,14,15},{1,2,3,4,6,7,9,10,11,12,15},{1,2,3,4,6,7,9,10,11,13},{1,2,3,4,6,7,9,10,11,13,14},{1,2,3,4,6,7,9,10,11,13,14,15},{1,2,3,4,6,7,9,10,11,13,15},{1,2,3,4,6,7,9,10,11,14},{1,2,3,4,6,7,9,10,11,14,15},{1,2,3,4,6,7,9,10,11,15},{1,2,3,4,6,7,9,10,12},{1,2,3,4,6,7,9,10,12,13},{1,2,3,4,6,7,9,10,12,13,14},{1,2,3,4,6,7,9,10,12,13,14,15},{1,2,3,4,6,7,9,10,12,13,15},{1,2,3,4,6,7,9,10,12,14},{1,2,3,4,6,7,9,10,12,14,15},{1,2,3,4,6,7,9,10,12,15},{1,2,3,4,6,7,9,10,13},{1,2,3,4,6,7,9,10,13,14},{1,2,3,4,6,7,9,10,13,14,15},{1,2,3,4,6,7,9,10,13,15},{1,2,3,4,6,7,9,10,14},{1,2,3,4,6,7,9,10,14,15},{1,2,3,4,6,7,9,10,15},{1,2,3,4,6,7,9,11},{1,2,3,4,6,7,9,11,12},{1,2,3,4,6,7,9,11,12,13},{1,2,3,4,6,7,9,11,12,13,14},{1,2,3,4,6,7,9,11,12,13,14,15},{1,2,3,4,6,7,9,11,12,13,15},{1,2,3,4,6,7,9,11,12,14},{1,2,3,4,6,7,9,11,12,14,15},{1,2,3,4,6,7,9,11,12,15},{1,2,3,4,6,7,9,11,13},{1,2,3,4,6,7,9,11,13,14},{1,2,3,4,6,7,9,11,13,14,15},{1,2,3,4,6,7,9,11,13,15},{1,2,3,4,6,7,9,11,14},{1,2,3,4,6,7,9,11,14,15},{1,2,3,4,6,7,9,11,15},{1,2,3,4,6,7,9,12},{1,2,3,4,6,7,9,12,13},{1,2,3,4,6,7,9,12,13,14},{1,2,3,4,6,7,9,12,13,14,15},{1,2,3,4,6,7,9,12,13,15},{1,2,3,4,6,7,9,12,14},{1,2,3,4,6,7,9,12,14,15},{1,2,3,4,6,7,9,12,15},{1,2,3,4,6,7,9,13},{1,2,3,4,6,7,9,13,14},{1,2,3,4,6,7,9,13,14,15},{1,2,3,4,6,7,9,13,15},{1,2,3,4,6,7,9,14},{1,2,3,4,6,7,9,14,15},{1,2,3,4,6,7,9,15},{1,2,3,4,6,7,10},{1,2,3,4,6,7,10,11},{1,2,3,4,6,7,10,11,12},{1,2,3,4,6,7,10,11,12,13},{1,2,3,4,6,7,10,11,12,13,14},{1,2,3,4,6,7,10,11,12,13,14,15},{1,2,3,4,6,7,10,11,12,13,15},{1,2,3,4,6,7,10,11,12,14},{1,2,3,4,6,7,10,11,12,14,15},{1,2,3,4,6,7,10,11,12,15},{1,2,3,4,6,7,10,11,13},{1,2,3,4,6,7,10,11,13,14},{1,2,3,4,6,7,10,11,13,14,15},{1,2,3,4,6,7,10,11,13,15},{1,2,3,4,6,7,10,11,14},{1,2,3,4,6,7,10,11,14,15},{1,2,3,4,6,7,10,11,15},{1,2,3,4,6,7,10,12},{1,2,3,4,6,7,10,12,13},{1,2,3,4,6,7,10,12,13,14},{1,2,3,4,6,7,10,12,13,14,15},{1,2,3,4,6,7,10,12,13,15},{1,2,3,4,6,7,10,12,14},{1,2,3,4,6,7,10,12,14,15},{1,2,3,4,6,7,10,12,15},{1,2,3,4,6,7,10,13},{1,2,3,4,6,7,10,13,14},{1,2,3,4,6,7,10,13,14,15},{1,2,3,4,6,7,10,13,15},{1,2,3,4,6,7,10,14},{1,2,3,4,6,7,10,14,15},{1,2,3,4,6,7,10,15},{1,2,3,4,6,7,11},{1,2,3,4,6,7,11,12},{1,2,3,4,6,7,11,12,13},{1,2,3,4,6,7,11,12,13,14},{1,2,3,4,6,7,11,12,13,14,15},{1,2,3,4,6,7,11,12,13,15},{1,2,3,4,6,7,11,12,14},{1,2,3,4,6,7,11,12,14,15},{1,2,3,4,6,7,11,12,15},{1,2,3,4,6,7,11,13},{1,2,3,4,6,7,11,13,14},{1,2,3,4,6,7,11,13,14,15},{1,2,3,4,6,7,11,13,15},{1,2,3,4,6,7,11,14},{1,2,3,4,6,7,11,14,15},{1,2,3,4,6,7,11,15},{1,2,3,4,6,7,12},{1,2,3,4,6,7,12,13},{1,2,3,4,6,7,12,13,14},{1,2,3,4,6,7,12,13,14,15},{1,2,3,4,6,7,12,13,15},{1,2,3,4,6,7,12,14},{1,2,3,4,6,7,12,14,15},{1,2,3,4,6,7,12,15},{1,2,3,4,6,7,13},{1,2,3,4,6,7,13,14},{1,2,3,4,6,7,13,14,15},{1,2,3,4,6,7,13,15},{1,2,3,4,6,7,14},{1,2,3,4,6,7,14,15},{1,2,3,4,6,7,15},{1,2,3,4,6,8},{1,2,3,4,6,8,9},{1,2,3,4,6,8,9,10},{1,2,3,4,6,8,9,10,11},{1,2,3,4,6,8,9,10,11,12},{1,2,3,4,6,8,9,10,11,12,13},{1,2,3,4,6,8,9,10,11,12,13,14},{1,2,3,4,6,8,9,10,11,12,13,14,15},{1,2,3,4,6,8,9,10,11,12,13,15},{1,2,3,4,6,8,9,10,11,12,14},{1,2,3,4,6,8,9,10,11,12,14,15},{1,2,3,4,6,8,9,10,11,12,15},{1,2,3,4,6,8,9,10,11,13},{1,2,3,4,6,8,9,10,11,13,14},{1,2,3,4,6,8,9,10,11,13,14,15},{1,2,3,4,6,8,9,10,11,13,15},{1,2,3,4,6,8,9,10,11,14},{1,2,3,4,6,8,9,10,11,14,15},{1,2,3,4,6,8,9,10,11,15},{1,2,3,4,6,8,9,10,12},{1,2,3,4,6,8,9,10,12,13},{1,2,3,4,6,8,9,10,12,13,14},{1,2,3,4,6,8,9,10,12,13,14,15},{1,2,3,4,6,8,9,10,12,13,15},{1,2,3,4,6,8,9,10,12,14},{1,2,3,4,6,8,9,10,12,14,15},{1,2,3,4,6,8,9,10,12,15},{1,2,3,4,6,8,9,10,13},{1,2,3,4,6,8,9,10,13,14},{1,2,3,4,6,8,9,10,13,14,15},{1,2,3,4,6,8,9,10,13,15},{1,2,3,4,6,8,9,10,14},{1,2,3,4,6,8,9,10,14,15},{1,2,3,4,6,8,9,10,15},{1,2,3,4,6,8,9,11},{1,2,3,4,6,8,9,11,12},{1,2,3,4,6,8,9,11,12,13},{1,2,3,4,6,8,9,11,12,13,14},{1,2,3,4,6,8,9,11,12,13,14,15},{1,2,3,4,6,8,9,11,12,13,15},{1,2,3,4,6,8,9,11,12,14},{1,2,3,4,6,8,9,11,12,14,15},{1,2,3,4,6,8,9,11,12,15},{1,2,3,4,6,8,9,11,13},{1,2,3,4,6,8,9,11,13,14},{1,2,3,4,6,8,9,11,13,14,15},{1,2,3,4,6,8,9,11,13,15},{1,2,3,4,6,8,9,11,14},{1,2,3,4,6,8,9,11,14,15},{1,2,3,4,6,8,9,11,15},{1,2,3,4,6,8,9,12},{1,2,3,4,6,8,9,12,13},{1,2,3,4,6,8,9,12,13,14},{1,2,3,4,6,8,9,12,13,14,15},{1,2,3,4,6,8,9,12,13,15},{1,2,3,4,6,8,9,12,14},{1,2,3,4,6,8,9,12,14,15},{1,2,3,4,6,8,9,12,15},{1,2,3,4,6,8,9,13},{1,2,3,4,6,8,9,13,14},{1,2,3,4,6,8,9,13,14,15},{1,2,3,4,6,8,9,13,15},{1,2,3,4,6,8,9,14},{1,2,3,4,6,8,9,14,15},{1,2,3,4,6,8,9,15},{1,2,3,4,6,8,10},{1,2,3,4,6,8,10,11},{1,2,3,4,6,8,10,11,12},{1,2,3,4,6,8,10,11,12,13},{1,2,3,4,6,8,10,11,12,13,14},{1,2,3,4,6,8,10,11,12,13,14,15},{1,2,3,4,6,8,10,11,12,13,15},{1,2,3,4,6,8,10,11,12,14},{1,2,3,4,6,8,10,11,12,14,15},{1,2,3,4,6,8,10,11,12,15},{1,2,3,4,6,8,10,11,13},{1,2,3,4,6,8,10,11,13,14},{1,2,3,4,6,8,10,11,13,14,15},{1,2,3,4,6,8,10,11,13,15},{1,2,3,4,6,8,10,11,14},{1,2,3,4,6,8,10,11,14,15},{1,2,3,4,6,8,10,11,15},{1,2,3,4,6,8,10,12},{1,2,3,4,6,8,10,12,13},{1,2,3,4,6,8,10,12,13,14},{1,2,3,4,6,8,10,12,13,14,15},{1,2,3,4,6,8,10,12,13,15},{1,2,3,4,6,8,10,12,14},{1,2,3,4,6,8,10,12,14,15},{1,2,3,4,6,8,10,12,15},{1,2,3,4,6,8,10,13},{1,2,3,4,6,8,10,13,14},{1,2,3,4,6,8,10,13,14,15},{1,2,3,4,6,8,10,13,15},{1,2,3,4,6,8,10,14},{1,2,3,4,6,8,10,14,15},{1,2,3,4,6,8,10,15},{1,2,3,4,6,8,11},{1,2,3,4,6,8,11,12},{1,2,3,4,6,8,11,12,13},{1,2,3,4,6,8,11,12,13,14},{1,2,3,4,6,8,11,12,13,14,15},{1,2,3,4,6,8,11,12,13,15},{1,2,3,4,6,8,11,12,14},{1,2,3,4,6,8,11,12,14,15},{1,2,3,4,6,8,11,12,15},{1,2,3,4,6,8,11,13},{1,2,3,4,6,8,11,13,14},{1,2,3,4,6,8,11,13,14,15},{1,2,3,4,6,8,11,13,15},{1,2,3,4,6,8,11,14},{1,2,3,4,6,8,11,14,15},{1,2,3,4,6,8,11,15},{1,2,3,4,6,8,12},{1,2,3,4,6,8,12,13},{1,2,3,4,6,8,12,13,14},{1,2,3,4,6,8,12,13,14,15},{1,2,3,4,6,8,12,13,15},{1,2,3,4,6,8,12,14},{1,2,3,4,6,8,12,14,15},{1,2,3,4,6,8,12,15},{1,2,3,4,6,8,13},{1,2,3,4,6,8,13,14},{1,2,3,4,6,8,13,14,15},{1,2,3,4,6,8,13,15},{1,2,3,4,6,8,14},{1,2,3,4,6,8,14,15},{1,2,3,4,6,8,15},{1,2,3,4,6,9},{1,2,3,4,6,9,10},{1,2,3,4,6,9,10,11},{1,2,3,4,6,9,10,11,12},{1,2,3,4,6,9,10,11,12,13},{1,2,3,4,6,9,10,11,12,13,14},{1,2,3,4,6,9,10,11,12,13,14,15},{1,2,3,4,6,9,10,11,12,13,15},{1,2,3,4,6,9,10,11,12,14},{1,2,3,4,6,9,10,11,12,14,15},{1,2,3,4,6,9,10,11,12,15},{1,2,3,4,6,9,10,11,13},{1,2,3,4,6,9,10,11,13,14},{1,2,3,4,6,9,10,11,13,14,15},{1,2,3,4,6,9,10,11,13,15},{1,2,3,4,6,9,10,11,14},{1,2,3,4,6,9,10,11,14,15},{1,2,3,4,6,9,10,11,15},{1,2,3,4,6,9,10,12},{1,2,3,4,6,9,10,12,13},{1,2,3,4,6,9,10,12,13,14},{1,2,3,4,6,9,10,12,13,14,15},{1,2,3,4,6,9,10,12,13,15},{1,2,3,4,6,9,10,12,14},{1,2,3,4,6,9,10,12,14,15},{1,2,3,4,6,9,10,12,15},{1,2,3,4,6,9,10,13},{1,2,3,4,6,9,10,13,14},{1,2,3,4,6,9,10,13,14,15},{1,2,3,4,6,9,10,13,15},{1,2,3,4,6,9,10,14},{1,2,3,4,6,9,10,14,15},{1,2,3,4,6,9,10,15},{1,2,3,4,6,9,11},{1,2,3,4,6,9,11,12},{1,2,3,4,6,9,11,12,13},{1,2,3,4,6,9,11,12,13,14},{1,2,3,4,6,9,11,12,13,14,15},{1,2,3,4,6,9,11,12,13,15},{1,2,3,4,6,9,11,12,14},{1,2,3,4,6,9,11,12,14,15},{1,2,3,4,6,9,11,12,15},{1,2,3,4,6,9,11,13},{1,2,3,4,6,9,11,13,14},{1,2,3,4,6,9,11,13,14,15},{1,2,3,4,6,9,11,13,15},{1,2,3,4,6,9,11,14},{1,2,3,4,6,9,11,14,15},{1,2,3,4,6,9,11,15},{1,2,3,4,6,9,12},{1,2,3,4,6,9,12,13},{1,2,3,4,6,9,12,13,14},{1,2,3,4,6,9,12,13,14,15},{1,2,3,4,6,9,12,13,15},{1,2,3,4,6,9,12,14},{1,2,3,4,6,9,12,14,15},{1,2,3,4,6,9,12,15},{1,2,3,4,6,9,13},{1,2,3,4,6,9,13,14},{1,2,3,4,6,9,13,14,15},{1,2,3,4,6,9,13,15},{1,2,3,4,6,9,14},{1,2,3,4,6,9,14,15},{1,2,3,4,6,9,15},{1,2,3,4,6,10},{1,2,3,4,6,10,11},{1,2,3,4,6,10,11,12},{1,2,3,4,6,10,11,12,13},{1,2,3,4,6,10,11,12,13,14},{1,2,3,4,6,10,11,12,13,14,15},{1,2,3,4,6,10,11,12,13,15},{1,2,3,4,6,10,11,12,14},{1,2,3,4,6,10,11,12,14,15},{1,2,3,4,6,10,11,12,15},{1,2,3,4,6,10,11,13},{1,2,3,4,6,10,11,13,14},{1,2,3,4,6,10,11,13,14,15},{1,2,3,4,6,10,11,13,15},{1,2,3,4,6,10,11,14},{1,2,3,4,6,10,11,14,15},{1,2,3,4,6,10,11,15},{1,2,3,4,6,10,12},{1,2,3,4,6,10,12,13},{1,2,3,4,6,10,12,13,14},{1,2,3,4,6,10,12,13,14,15},{1,2,3,4,6,10,12,13,15},{1,2,3,4,6,10,12,14},{1,2,3,4,6,10,12,14,15},{1,2,3,4,6,10,12,15},{1,2,3,4,6,10,13},{1,2,3,4,6,10,13,14},{1,2,3,4,6,10,13,14,15},{1,2,3,4,6,10,13,15},{1,2,3,4,6,10,14},{1,2,3,4,6,10,14,15},{1,2,3,4,6,10,15},{1,2,3,4,6,11},{1,2,3,4,6,11,12},{1,2,3,4,6,11,12,13},{1,2,3,4,6,11,12,13,14},{1,2,3,4,6,11,12,13,14,15},{1,2,3,4,6,11,12,13,15},{1,2,3,4,6,11,12,14},{1,2,3,4,6,11,12,14,15},{1,2,3,4,6,11,12,15},{1,2,3,4,6,11,13},{1,2,3,4,6,11,13,14},{1,2,3,4,6,11,13,14,15},{1,2,3,4,6,11,13,15},{1,2,3,4,6,11,14},{1,2,3,4,6,11,14,15},{1,2,3,4,6,11,15},{1,2,3,4,6,12},{1,2,3,4,6,12,13},{1,2,3,4,6,12,13,14},{1,2,3,4,6,12,13,14,15},{1,2,3,4,6,12,13,15},{1,2,3,4,6,12,14},{1,2,3,4,6,12,14,15},{1,2,3,4,6,12,15},{1,2,3,4,6,13},{1,2,3,4,6,13,14},{1,2,3,4,6,13,14,15},{1,2,3,4,6,13,15},{1,2,3,4,6,14},{1,2,3,4,6,14,15},{1,2,3,4,6,15},{1,2,3,4,7},{1,2,3,4,7,8},{1,2,3,4,7,8,9},{1,2,3,4,7,8,9,10},{1,2,3,4,7,8,9,10,11},{1,2,3,4,7,8,9,10,11,12},{1,2,3,4,7,8,9,10,11,12,13},{1,2,3,4,7,8,9,10,11,12,13,14},{1,2,3,4,7,8,9,10,11,12,13,14,15},{1,2,3,4,7,8,9,10,11,12,13,15},{1,2,3,4,7,8,9,10,11,12,14},{1,2,3,4,7,8,9,10,11,12,14,15},{1,2,3,4,7,8,9,10,11,12,15},{1,2,3,4,7,8,9,10,11,13},{1,2,3,4,7,8,9,10,11,13,14},{1,2,3,4,7,8,9,10,11,13,14,15},{1,2,3,4,7,8,9,10,11,13,15},{1,2,3,4,7,8,9,10,11,14},{1,2,3,4,7,8,9,10,11,14,15},{1,2,3,4,7,8,9,10,11,15},{1,2,3,4,7,8,9,10,12},{1,2,3,4,7,8,9,10,12,13},{1,2,3,4,7,8,9,10,12,13,14},{1,2,3,4,7,8,9,10,12,13,14,15},{1,2,3,4,7,8,9,10,12,13,15},{1,2,3,4,7,8,9,10,12,14},{1,2,3,4,7,8,9,10,12,14,15},{1,2,3,4,7,8,9,10,12,15},{1,2,3,4,7,8,9,10,13},{1,2,3,4,7,8,9,10,13,14},{1,2,3,4,7,8,9,10,13,14,15},{1,2,3,4,7,8,9,10,13,15},{1,2,3,4,7,8,9,10,14},{1,2,3,4,7,8,9,10,14,15},{1,2,3,4,7,8,9,10,15},{1,2,3,4,7,8,9,11},{1,2,3,4,7,8,9,11,12},{1,2,3,4,7,8,9,11,12,13},{1,2,3,4,7,8,9,11,12,13,14},{1,2,3,4,7,8,9,11,12,13,14,15},{1,2,3,4,7,8,9,11,12,13,15},{1,2,3,4,7,8,9,11,12,14},{1,2,3,4,7,8,9,11,12,14,15},{1,2,3,4,7,8,9,11,12,15},{1,2,3,4,7,8,9,11,13},{1,2,3,4,7,8,9,11,13,14},{1,2,3,4,7,8,9,11,13,14,15},{1,2,3,4,7,8,9,11,13,15},{1,2,3,4,7,8,9,11,14},{1,2,3,4,7,8,9,11,14,15},{1,2,3,4,7,8,9,11,15},{1,2,3,4,7,8,9,12},{1,2,3,4,7,8,9,12,13},{1,2,3,4,7,8,9,12,13,14},{1,2,3,4,7,8,9,12,13,14,15},{1,2,3,4,7,8,9,12,13,15},{1,2,3,4,7,8,9,12,14},{1,2,3,4,7,8,9,12,14,15},{1,2,3,4,7,8,9,12,15},{1,2,3,4,7,8,9,13},{1,2,3,4,7,8,9,13,14},{1,2,3,4,7,8,9,13,14,15},{1,2,3,4,7,8,9,13,15},{1,2,3,4,7,8,9,14},{1,2,3,4,7,8,9,14,15},{1,2,3,4,7,8,9,15},{1,2,3,4,7,8,10},{1,2,3,4,7,8,10,11},{1,2,3,4,7,8,10,11,12},{1,2,3,4,7,8,10,11,12,13},{1,2,3,4,7,8,10,11,12,13,14},{1,2,3,4,7,8,10,11,12,13,14,15},{1,2,3,4,7,8,10,11,12,13,15},{1,2,3,4,7,8,10,11,12,14},{1,2,3,4,7,8,10,11,12,14,15},{1,2,3,4,7,8,10,11,12,15},{1,2,3,4,7,8,10,11,13},{1,2,3,4,7,8,10,11,13,14},{1,2,3,4,7,8,10,11,13,14,15},{1,2,3,4,7,8,10,11,13,15},{1,2,3,4,7,8,10,11,14},{1,2,3,4,7,8,10,11,14,15},{1,2,3,4,7,8,10,11,15},{1,2,3,4,7,8,10,12},{1,2,3,4,7,8,10,12,13},{1,2,3,4,7,8,10,12,13,14},{1,2,3,4,7,8,10,12,13,14,15},{1,2,3,4,7,8,10,12,13,15},{1,2,3,4,7,8,10,12,14},{1,2,3,4,7,8,10,12,14,15},{1,2,3,4,7,8,10,12,15},{1,2,3,4,7,8,10,13},{1,2,3,4,7,8,10,13,14},{1,2,3,4,7,8,10,13,14,15},{1,2,3,4,7,8,10,13,15},{1,2,3,4,7,8,10,14},{1,2,3,4,7,8,10,14,15},{1,2,3,4,7,8,10,15},{1,2,3,4,7,8,11},{1,2,3,4,7,8,11,12},{1,2,3,4,7,8,11,12,13},{1,2,3,4,7,8,11,12,13,14},{1,2,3,4,7,8,11,12,13,14,15},{1,2,3,4,7,8,11,12,13,15},{1,2,3,4,7,8,11,12,14},{1,2,3,4,7,8,11,12,14,15},{1,2,3,4,7,8,11,12,15},{1,2,3,4,7,8,11,13},{1,2,3,4,7,8,11,13,14},{1,2,3,4,7,8,11,13,14,15},{1,2,3,4,7,8,11,13,15},{1,2,3,4,7,8,11,14},{1,2,3,4,7,8,11,14,15},{1,2,3,4,7,8,11,15},{1,2,3,4,7,8,12},{1,2,3,4,7,8,12,13},{1,2,3,4,7,8,12,13,14},{1,2,3,4,7,8,12,13,14,15},{1,2,3,4,7,8,12,13,15},{1,2,3,4,7,8,12,14},{1,2,3,4,7,8,12,14,15},{1,2,3,4,7,8,12,15},{1,2,3,4,7,8,13},{1,2,3,4,7,8,13,14},{1,2,3,4,7,8,13,14,15},{1,2,3,4,7,8,13,15},{1,2,3,4,7,8,14},{1,2,3,4,7,8,14,15},{1,2,3,4,7,8,15},{1,2,3,4,7,9},{1,2,3,4,7,9,10},{1,2,3,4,7,9,10,11},{1,2,3,4,7,9,10,11,12},{1,2,3,4,7,9,10,11,12,13},{1,2,3,4,7,9,10,11,12,13,14},{1,2,3,4,7,9,10,11,12,13,14,15},{1,2,3,4,7,9,10,11,12,13,15},{1,2,3,4,7,9,10,11,12,14},{1,2,3,4,7,9,10,11,12,14,15},{1,2,3,4,7,9,10,11,12,15},{1,2,3,4,7,9,10,11,13},{1,2,3,4,7,9,10,11,13,14},{1,2,3,4,7,9,10,11,13,14,15},{1,2,3,4,7,9,10,11,13,15},{1,2,3,4,7,9,10,11,14},{1,2,3,4,7,9,10,11,14,15},{1,2,3,4,7,9,10,11,15},{1,2,3,4,7,9,10,12},{1,2,3,4,7,9,10,12,13},{1,2,3,4,7,9,10,12,13,14},{1,2,3,4,7,9,10,12,13,14,15},{1,2,3,4,7,9,10,12,13,15},{1,2,3,4,7,9,10,12,14},{1,2,3,4,7,9,10,12,14,15},{1,2,3,4,7,9,10,12,15},{1,2,3,4,7,9,10,13},{1,2,3,4,7,9,10,13,14},{1,2,3,4,7,9,10,13,14,15},{1,2,3,4,7,9,10,13,15},{1,2,3,4,7,9,10,14},{1,2,3,4,7,9,10,14,15},{1,2,3,4,7,9,10,15},{1,2,3,4,7,9,11},{1,2,3,4,7,9,11,12},{1,2,3,4,7,9,11,12,13},{1,2,3,4,7,9,11,12,13,14},{1,2,3,4,7,9,11,12,13,14,15},{1,2,3,4,7,9,11,12,13,15},{1,2,3,4,7,9,11,12,14},{1,2,3,4,7,9,11,12,14,15},{1,2,3,4,7,9,11,12,15},{1,2,3,4,7,9,11,13},{1,2,3,4,7,9,11,13,14},{1,2,3,4,7,9,11,13,14,15},{1,2,3,4,7,9,11,13,15},{1,2,3,4,7,9,11,14},{1,2,3,4,7,9,11,14,15},{1,2,3,4,7,9,11,15},{1,2,3,4,7,9,12},{1,2,3,4,7,9,12,13},{1,2,3,4,7,9,12,13,14},{1,2,3,4,7,9,12,13,14,15},{1,2,3,4,7,9,12,13,15},{1,2,3,4,7,9,12,14},{1,2,3,4,7,9,12,14,15},{1,2,3,4,7,9,12,15},{1,2,3,4,7,9,13},{1,2,3,4,7,9,13,14},{1,2,3,4,7,9,13,14,15},{1,2,3,4,7,9,13,15},{1,2,3,4,7,9,14},{1,2,3,4,7,9,14,15},{1,2,3,4,7,9,15},{1,2,3,4,7,10},{1,2,3,4,7,10,11},{1,2,3,4,7,10,11,12},{1,2,3,4,7,10,11,12,13},{1,2,3,4,7,10,11,12,13,14},{1,2,3,4,7,10,11,12,13,14,15},{1,2,3,4,7,10,11,12,13,15},{1,2,3,4,7,10,11,12,14},{1,2,3,4,7,10,11,12,14,15},{1,2,3,4,7,10,11,12,15},{1,2,3,4,7,10,11,13},{1,2,3,4,7,10,11,13,14},{1,2,3,4,7,10,11,13,14,15},{1,2,3,4,7,10,11,13,15},{1,2,3,4,7,10,11,14},{1,2,3,4,7,10,11,14,15},{1,2,3,4,7,10,11,15},{1,2,3,4,7,10,12},{1,2,3,4,7,10,12,13},{1,2,3,4,7,10,12,13,14},{1,2,3,4,7,10,12,13,14,15},{1,2,3,4,7,10,12,13,15},{1,2,3,4,7,10,12,14},{1,2,3,4,7,10,12,14,15},{1,2,3,4,7,10,12,15},{1,2,3,4,7,10,13},{1,2,3,4,7,10,13,14},{1,2,3,4,7,10,13,14,15},{1,2,3,4,7,10,13,15},{1,2,3,4,7,10,14},{1,2,3,4,7,10,14,15},{1,2,3,4,7,10,15},{1,2,3,4,7,11},{1,2,3,4,7,11,12},{1,2,3,4,7,11,12,13},{1,2,3,4,7,11,12,13,14},{1,2,3,4,7,11,12,13,14,15},{1,2,3,4,7,11,12,13,15},{1,2,3,4,7,11,12,14},{1,2,3,4,7,11,12,14,15},{1,2,3,4,7,11,12,15},{1,2,3,4,7,11,13},{1,2,3,4,7,11,13,14},{1,2,3,4,7,11,13,14,15},{1,2,3,4,7,11,13,15},{1,2,3,4,7,11,14},{1,2,3,4,7,11,14,15},{1,2,3,4,7,11,15},{1,2,3,4,7,12},{1,2,3,4,7,12,13},{1,2,3,4,7,12,13,14},{1,2,3,4,7,12,13,14,15},{1,2,3,4,7,12,13,15},{1,2,3,4,7,12,14},{1,2,3,4,7,12,14,15},{1,2,3,4,7,12,15},{1,2,3,4,7,13},{1,2,3,4,7,13,14},{1,2,3,4,7,13,14,15},{1,2,3,4,7,13,15},{1,2,3,4,7,14},{1,2,3,4,7,14,15},{1,2,3,4,7,15},{1,2,3,4,8},{1,2,3,4,8,9},{1,2,3,4,8,9,10},{1,2,3,4,8,9,10,11},{1,2,3,4,8,9,10,11,12},{1,2,3,4,8,9,10,11,12,13},{1,2,3,4,8,9,10,11,12,13,14},{1,2,3,4,8,9,10,11,12,13,14,15},{1,2,3,4,8,9,10,11,12,13,15},{1,2,3,4,8,9,10,11,12,14},{1,2,3,4,8,9,10,11,12,14,15},{1,2,3,4,8,9,10,11,12,15},{1,2,3,4,8,9,10,11,13},{1,2,3,4,8,9,10,11,13,14},{1,2,3,4,8,9,10,11,13,14,15},{1,2,3,4,8,9,10,11,13,15},{1,2,3,4,8,9,10,11,14},{1,2,3,4,8,9,10,11,14,15},{1,2,3,4,8,9,10,11,15},{1,2,3,4,8,9,10,12},{1,2,3,4,8,9,10,12,13},{1,2,3,4,8,9,10,12,13,14},{1,2,3,4,8,9,10,12,13,14,15},{1,2,3,4,8,9,10,12,13,15},{1,2,3,4,8,9,10,12,14},{1,2,3,4,8,9,10,12,14,15},{1,2,3,4,8,9,10,12,15},{1,2,3,4,8,9,10,13},{1,2,3,4,8,9,10,13,14},{1,2,3,4,8,9,10,13,14,15},{1,2,3,4,8,9,10,13,15},{1,2,3,4,8,9,10,14},{1,2,3,4,8,9,10,14,15},{1,2,3,4,8,9,10,15},{1,2,3,4,8,9,11},{1,2,3,4,8,9,11,12},{1,2,3,4,8,9,11,12,13},{1,2,3,4,8,9,11,12,13,14},{1,2,3,4,8,9,11,12,13,14,15},{1,2,3,4,8,9,11,12,13,15},{1,2,3,4,8,9,11,12,14},{1,2,3,4,8,9,11,12,14,15},{1,2,3,4,8,9,11,12,15},{1,2,3,4,8,9,11,13},{1,2,3,4,8,9,11,13,14},{1,2,3,4,8,9,11,13,14,15},{1,2,3,4,8,9,11,13,15},{1,2,3,4,8,9,11,14},{1,2,3,4,8,9,11,14,15},{1,2,3,4,8,9,11,15},{1,2,3,4,8,9,12},{1,2,3,4,8,9,12,13},{1,2,3,4,8,9,12,13,14},{1,2,3,4,8,9,12,13,14,15},{1,2,3,4,8,9,12,13,15},{1,2,3,4,8,9,12,14},{1,2,3,4,8,9,12,14,15},{1,2,3,4,8,9,12,15},{1,2,3,4,8,9,13},{1,2,3,4,8,9,13,14},{1,2,3,4,8,9,13,14,15},{1,2,3,4,8,9,13,15},{1,2,3,4,8,9,14},{1,2,3,4,8,9,14,15},{1,2,3,4,8,9,15},{1,2,3,4,8,10},{1,2,3,4,8,10,11},{1,2,3,4,8,10,11,12},{1,2,3,4,8,10,11,12,13},{1,2,3,4,8,10,11,12,13,14},{1,2,3,4,8,10,11,12,13,14,15},{1,2,3,4,8,10,11,12,13,15},{1,2,3,4,8,10,11,12,14},{1,2,3,4,8,10,11,12,14,15},{1,2,3,4,8,10,11,12,15},{1,2,3,4,8,10,11,13},{1,2,3,4,8,10,11,13,14},{1,2,3,4,8,10,11,13,14,15},{1,2,3,4,8,10,11,13,15},{1,2,3,4,8,10,11,14},{1,2,3,4,8,10,11,14,15},{1,2,3,4,8,10,11,15},{1,2,3,4,8,10,12},{1,2,3,4,8,10,12,13},{1,2,3,4,8,10,12,13,14},{1,2,3,4,8,10,12,13,14,15},{1,2,3,4,8,10,12,13,15},{1,2,3,4,8,10,12,14},{1,2,3,4,8,10,12,14,15},{1,2,3,4,8,10,12,15},{1,2,3,4,8,10,13},{1,2,3,4,8,10,13,14},{1,2,3,4,8,10,13,14,15},{1,2,3,4,8,10,13,15},{1,2,3,4,8,10,14},{1,2,3,4,8,10,14,15},{1,2,3,4,8,10,15},{1,2,3,4,8,11},{1,2,3,4,8,11,12},{1,2,3,4,8,11,12,13},{1,2,3,4,8,11,12,13,14},{1,2,3,4,8,11,12,13,14,15},{1,2,3,4,8,11,12,13,15},{1,2,3,4,8,11,12,14},{1,2,3,4,8,11,12,14,15},{1,2,3,4,8,11,12,15},{1,2,3,4,8,11,13},{1,2,3,4,8,11,13,14},{1,2,3,4,8,11,13,14,15},{1,2,3,4,8,11,13,15},{1,2,3,4,8,11,14},{1,2,3,4,8,11,14,15},{1,2,3,4,8,11,15},{1,2,3,4,8,12},{1,2,3,4,8,12,13},{1,2,3,4,8,12,13,14},{1,2,3,4,8,12,13,14,15},{1,2,3,4,8,12,13,15},{1,2,3,4,8,12,14},{1,2,3,4,8,12,14,15},{1,2,3,4,8,12,15},{1,2,3,4,8,13},{1,2,3,4,8,13,14},{1,2,3,4,8,13,14,15},{1,2,3,4,8,13,15},{1,2,3,4,8,14},{1,2,3,4,8,14,15},{1,2,3,4,8,15},{1,2,3,4,9},{1,2,3,4,9,10},{1,2,3,4,9,10,11},{1,2,3,4,9,10,11,12},{1,2,3,4,9,10,11,12,13},{1,2,3,4,9,10,11,12,13,14},{1,2,3,4,9,10,11,12,13,14,15},{1,2,3,4,9,10,11,12,13,15},{1,2,3,4,9,10,11,12,14},{1,2,3,4,9,10,11,12,14,15},{1,2,3,4,9,10,11,12,15},{1,2,3,4,9,10,11,13},{1,2,3,4,9,10,11,13,14},{1,2,3,4,9,10,11,13,14,15},{1,2,3,4,9,10,11,13,15},{1,2,3,4,9,10,11,14},{1,2,3,4,9,10,11,14,15},{1,2,3,4,9,10,11,15},{1,2,3,4,9,10,12},{1,2,3,4,9,10,12,13},{1,2,3,4,9,10,12,13,14},{1,2,3,4,9,10,12,13,14,15},{1,2,3,4,9,10,12,13,15},{1,2,3,4,9,10,12,14},{1,2,3,4,9,10,12,14,15},{1,2,3,4,9,10,12,15},{1,2,3,4,9,10,13},{1,2,3,4,9,10,13,14},{1,2,3,4,9,10,13,14,15},{1,2,3,4,9,10,13,15},{1,2,3,4,9,10,14},{1,2,3,4,9,10,14,15},{1,2,3,4,9,10,15},{1,2,3,4,9,11},{1,2,3,4,9,11,12},{1,2,3,4,9,11,12,13},{1,2,3,4,9,11,12,13,14},{1,2,3,4,9,11,12,13,14,15},{1,2,3,4,9,11,12,13,15},{1,2,3,4,9,11,12,14},{1,2,3,4,9,11,12,14,15},{1,2,3,4,9,11,12,15},{1,2,3,4,9,11,13},{1,2,3,4,9,11,13,14},{1,2,3,4,9,11,13,14,15},{1,2,3,4,9,11,13,15},{1,2,3,4,9,11,14},{1,2,3,4,9,11,14,15},{1,2,3,4,9,11,15},{1,2,3,4,9,12},{1,2,3,4,9,12,13},{1,2,3,4,9,12,13,14},{1,2,3,4,9,12,13,14,15},{1,2,3,4,9,12,13,15},{1,2,3,4,9,12,14},{1,2,3,4,9,12,14,15},{1,2,3,4,9,12,15},{1,2,3,4,9,13},{1,2,3,4,9,13,14},{1,2,3,4,9,13,14,15},{1,2,3,4,9,13,15},{1,2,3,4,9,14},{1,2,3,4,9,14,15},{1,2,3,4,9,15},{1,2,3,4,10},{1,2,3,4,10,11},{1,2,3,4,10,11,12},{1,2,3,4,10,11,12,13},{1,2,3,4,10,11,12,13,14},{1,2,3,4,10,11,12,13,14,15},{1,2,3,4,10,11,12,13,15},{1,2,3,4,10,11,12,14},{1,2,3,4,10,11,12,14,15},{1,2,3,4,10,11,12,15},{1,2,3,4,10,11,13},{1,2,3,4,10,11,13,14},{1,2,3,4,10,11,13,14,15},{1,2,3,4,10,11,13,15},{1,2,3,4,10,11,14},{1,2,3,4,10,11,14,15},{1,2,3,4,10,11,15},{1,2,3,4,10,12},{1,2,3,4,10,12,13},{1,2,3,4,10,12,13,14},{1,2,3,4,10,12,13,14,15},{1,2,3,4,10,12,13,15},{1,2,3,4,10,12,14},{1,2,3,4,10,12,14,15},{1,2,3,4,10,12,15},{1,2,3,4,10,13},{1,2,3,4,10,13,14},{1,2,3,4,10,13,14,15},{1,2,3,4,10,13,15},{1,2,3,4,10,14},{1,2,3,4,10,14,15},{1,2,3,4,10,15},{1,2,3,4,11},{1,2,3,4,11,12},{1,2,3,4,11,12,13},{1,2,3,4,11,12,13,14},{1,2,3,4,11,12,13,14,15},{1,2,3,4,11,12,13,15},{1,2,3,4,11,12,14},{1,2,3,4,11,12,14,15},{1,2,3,4,11,12,15},{1,2,3,4,11,13},{1,2,3,4,11,13,14},{1,2,3,4,11,13,14,15},{1,2,3,4,11,13,15},{1,2,3,4,11,14},{1,2,3,4,11,14,15},{1,2,3,4,11,15},{1,2,3,4,12},{1,2,3,4,12,13},{1,2,3,4,12,13,14},{1,2,3,4,12,13,14,15},{1,2,3,4,12,13,15},{1,2,3,4,12,14},{1,2,3,4,12,14,15},{1,2,3,4,12,15},{1,2,3,4,13},{1,2,3,4,13,14},{1,2,3,4,13,14,15},{1,2,3,4,13,15},{1,2,3,4,14},{1,2,3,4,14,15},{1,2,3,4,15},{1,2,3,5},{1,2,3,5,6},{1,2,3,5,6,7},{1,2,3,5,6,7,8},{1,2,3,5,6,7,8,9},{1,2,3,5,6,7,8,9,10},{1,2,3,5,6,7,8,9,10,11},{1,2,3,5,6,7,8,9,10,11,12},{1,2,3,5,6,7,8,9,10,11,12,13},{1,2,3,5,6,7,8,9,10,11,12,13,14},{1,2,3,5,6,7,8,9,10,11,12,13,14,15},{1,2,3,5,6,7,8,9,10,11,12,13,15},{1,2,3,5,6,7,8,9,10,11,12,14},{1,2,3,5,6,7,8,9,10,11,12,14,15},{1,2,3,5,6,7,8,9,10,11,12,15},{1,2,3,5,6,7,8,9,10,11,13},{1,2,3,5,6,7,8,9,10,11,13,14},{1,2,3,5,6,7,8,9,10,11,13,14,15},{1,2,3,5,6,7,8,9,10,11,13,15},{1,2,3,5,6,7,8,9,10,11,14},{1,2,3,5,6,7,8,9,10,11,14,15},{1,2,3,5,6,7,8,9,10,11,15},{1,2,3,5,6,7,8,9,10,12},{1,2,3,5,6,7,8,9,10,12,13},{1,2,3,5,6,7,8,9,10,12,13,14},{1,2,3,5,6,7,8,9,10,12,13,14,15},{1,2,3,5,6,7,8,9,10,12,13,15},{1,2,3,5,6,7,8,9,10,12,14},{1,2,3,5,6,7,8,9,10,12,14,15},{1,2,3,5,6,7,8,9,10,12,15},{1,2,3,5,6,7,8,9,10,13},{1,2,3,5,6,7,8,9,10,13,14},{1,2,3,5,6,7,8,9,10,13,14,15},{1,2,3,5,6,7,8,9,10,13,15},{1,2,3,5,6,7,8,9,10,14},{1,2,3,5,6,7,8,9,10,14,15},{1,2,3,5,6,7,8,9,10,15},{1,2,3,5,6,7,8,9,11},{1,2,3,5,6,7,8,9,11,12},{1,2,3,5,6,7,8,9,11,12,13},{1,2,3,5,6,7,8,9,11,12,13,14},{1,2,3,5,6,7,8,9,11,12,13,14,15},{1,2,3,5,6,7,8,9,11,12,13,15},{1,2,3,5,6,7,8,9,11,12,14},{1,2,3,5,6,7,8,9,11,12,14,15},{1,2,3,5,6,7,8,9,11,12,15},{1,2,3,5,6,7,8,9,11,13},{1,2,3,5,6,7,8,9,11,13,14},{1,2,3,5,6,7,8,9,11,13,14,15},{1,2,3,5,6,7,8,9,11,13,15},{1,2,3,5,6,7,8,9,11,14},{1,2,3,5,6,7,8,9,11,14,15},{1,2,3,5,6,7,8,9,11,15},{1,2,3,5,6,7,8,9,12},{1,2,3,5,6,7,8,9,12,13},{1,2,3,5,6,7,8,9,12,13,14},{1,2,3,5,6,7,8,9,12,13,14,15},{1,2,3,5,6,7,8,9,12,13,15},{1,2,3,5,6,7,8,9,12,14},{1,2,3,5,6,7,8,9,12,14,15},{1,2,3,5,6,7,8,9,12,15},{1,2,3,5,6,7,8,9,13},{1,2,3,5,6,7,8,9,13,14},{1,2,3,5,6,7,8,9,13,14,15},{1,2,3,5,6,7,8,9,13,15},{1,2,3,5,6,7,8,9,14},{1,2,3,5,6,7,8,9,14,15},{1,2,3,5,6,7,8,9,15},{1,2,3,5,6,7,8,10},{1,2,3,5,6,7,8,10,11},{1,2,3,5,6,7,8,10,11,12},{1,2,3,5,6,7,8,10,11,12,13},{1,2,3,5,6,7,8,10,11,12,13,14},{1,2,3,5,6,7,8,10,11,12,13,14,15},{1,2,3,5,6,7,8,10,11,12,13,15},{1,2,3,5,6,7,8,10,11,12,14},{1,2,3,5,6,7,8,10,11,12,14,15},{1,2,3,5,6,7,8,10,11,12,15},{1,2,3,5,6,7,8,10,11,13},{1,2,3,5,6,7,8,10,11,13,14},{1,2,3,5,6,7,8,10,11,13,14,15},{1,2,3,5,6,7,8,10,11,13,15},{1,2,3,5,6,7,8,10,11,14},{1,2,3,5,6,7,8,10,11,14,15},{1,2,3,5,6,7,8,10,11,15},{1,2,3,5,6,7,8,10,12},{1,2,3,5,6,7,8,10,12,13},{1,2,3,5,6,7,8,10,12,13,14},{1,2,3,5,6,7,8,10,12,13,14,15},{1,2,3,5,6,7,8,10,12,13,15},{1,2,3,5,6,7,8,10,12,14},{1,2,3,5,6,7,8,10,12,14,15},{1,2,3,5,6,7,8,10,12,15},{1,2,3,5,6,7,8,10,13},{1,2,3,5,6,7,8,10,13,14},{1,2,3,5,6,7,8,10,13,14,15},{1,2,3,5,6,7,8,10,13,15},{1,2,3,5,6,7,8,10,14},{1,2,3,5,6,7,8,10,14,15},{1,2,3,5,6,7,8,10,15},{1,2,3,5,6,7,8,11},{1,2,3,5,6,7,8,11,12},{1,2,3,5,6,7,8,11,12,13},{1,2,3,5,6,7,8,11,12,13,14},{1,2,3,5,6,7,8,11,12,13,14,15},{1,2,3,5,6,7,8,11,12,13,15},{1,2,3,5,6,7,8,11,12,14},{1,2,3,5,6,7,8,11,12,14,15},{1,2,3,5,6,7,8,11,12,15},{1,2,3,5,6,7,8,11,13},{1,2,3,5,6,7,8,11,13,14},{1,2,3,5,6,7,8,11,13,14,15},{1,2,3,5,6,7,8,11,13,15},{1,2,3,5,6,7,8,11,14},{1,2,3,5,6,7,8,11,14,15},{1,2,3,5,6,7,8,11,15},{1,2,3,5,6,7,8,12},{1,2,3,5,6,7,8,12,13},{1,2,3,5,6,7,8,12,13,14},{1,2,3,5,6,7,8,12,13,14,15},{1,2,3,5,6,7,8,12,13,15},{1,2,3,5,6,7,8,12,14},{1,2,3,5,6,7,8,12,14,15},{1,2,3,5,6,7,8,12,15},{1,2,3,5,6,7,8,13},{1,2,3,5,6,7,8,13,14},{1,2,3,5,6,7,8,13,14,15},{1,2,3,5,6,7,8,13,15},{1,2,3,5,6,7,8,14},{1,2,3,5,6,7,8,14,15},{1,2,3,5,6,7,8,15},{1,2,3,5,6,7,9},{1,2,3,5,6,7,9,10},{1,2,3,5,6,7,9,10,11},{1,2,3,5,6,7,9,10,11,12},{1,2,3,5,6,7,9,10,11,12,13},{1,2,3,5,6,7,9,10,11,12,13,14},{1,2,3,5,6,7,9,10,11,12,13,14,15},{1,2,3,5,6,7,9,10,11,12,13,15},{1,2,3,5,6,7,9,10,11,12,14},{1,2,3,5,6,7,9,10,11,12,14,15},{1,2,3,5,6,7,9,10,11,12,15},{1,2,3,5,6,7,9,10,11,13},{1,2,3,5,6,7,9,10,11,13,14},{1,2,3,5,6,7,9,10,11,13,14,15},{1,2,3,5,6,7,9,10,11,13,15},{1,2,3,5,6,7,9,10,11,14},{1,2,3,5,6,7,9,10,11,14,15},{1,2,3,5,6,7,9,10,11,15},{1,2,3,5,6,7,9,10,12},{1,2,3,5,6,7,9,10,12,13},{1,2,3,5,6,7,9,10,12,13,14},{1,2,3,5,6,7,9,10,12,13,14,15},{1,2,3,5,6,7,9,10,12,13,15},{1,2,3,5,6,7,9,10,12,14},{1,2,3,5,6,7,9,10,12,14,15},{1,2,3,5,6,7,9,10,12,15},{1,2,3,5,6,7,9,10,13},{1,2,3,5,6,7,9,10,13,14},{1,2,3,5,6,7,9,10,13,14,15},{1,2,3,5,6,7,9,10,13,15},{1,2,3,5,6,7,9,10,14},{1,2,3,5,6,7,9,10,14,15},{1,2,3,5,6,7,9,10,15},{1,2,3,5,6,7,9,11},{1,2,3,5,6,7,9,11,12},{1,2,3,5,6,7,9,11,12,13},{1,2,3,5,6,7,9,11,12,13,14},{1,2,3,5,6,7,9,11,12,13,14,15},{1,2,3,5,6,7,9,11,12,13,15},{1,2,3,5,6,7,9,11,12,14},{1,2,3,5,6,7,9,11,12,14,15},{1,2,3,5,6,7,9,11,12,15},{1,2,3,5,6,7,9,11,13},{1,2,3,5,6,7,9,11,13,14},{1,2,3,5,6,7,9,11,13,14,15},{1,2,3,5,6,7,9,11,13,15},{1,2,3,5,6,7,9,11,14},{1,2,3,5,6,7,9,11,14,15},{1,2,3,5,6,7,9,11,15},{1,2,3,5,6,7,9,12},{1,2,3,5,6,7,9,12,13},{1,2,3,5,6,7,9,12,13,14},{1,2,3,5,6,7,9,12,13,14,15},{1,2,3,5,6,7,9,12,13,15},{1,2,3,5,6,7,9,12,14},{1,2,3,5,6,7,9,12,14,15},{1,2,3,5,6,7,9,12,15},{1,2,3,5,6,7,9,13},{1,2,3,5,6,7,9,13,14},{1,2,3,5,6,7,9,13,14,15},{1,2,3,5,6,7,9,13,15},{1,2,3,5,6,7,9,14},{1,2,3,5,6,7,9,14,15},{1,2,3,5,6,7,9,15},{1,2,3,5,6,7,10},{1,2,3,5,6,7,10,11},{1,2,3,5,6,7,10,11,12},{1,2,3,5,6,7,10,11,12,13},{1,2,3,5,6,7,10,11,12,13,14},{1,2,3,5,6,7,10,11,12,13,14,15},{1,2,3,5,6,7,10,11,12,13,15},{1,2,3,5,6,7,10,11,12,14},{1,2,3,5,6,7,10,11,12,14,15},{1,2,3,5,6,7,10,11,12,15},{1,2,3,5,6,7,10,11,13},{1,2,3,5,6,7,10,11,13,14},{1,2,3,5,6,7,10,11,13,14,15},{1,2,3,5,6,7,10,11,13,15},{1,2,3,5,6,7,10,11,14},{1,2,3,5,6,7,10,11,14,15},{1,2,3,5,6,7,10,11,15},{1,2,3,5,6,7,10,12},{1,2,3,5,6,7,10,12,13},{1,2,3,5,6,7,10,12,13,14},{1,2,3,5,6,7,10,12,13,14,15},{1,2,3,5,6,7,10,12,13,15},{1,2,3,5,6,7,10,12,14},{1,2,3,5,6,7,10,12,14,15},{1,2,3,5,6,7,10,12,15},{1,2,3,5,6,7,10,13},{1,2,3,5,6,7,10,13,14},{1,2,3,5,6,7,10,13,14,15},{1,2,3,5,6,7,10,13,15},{1,2,3,5,6,7,10,14},{1,2,3,5,6,7,10,14,15},{1,2,3,5,6,7,10,15},{1,2,3,5,6,7,11},{1,2,3,5,6,7,11,12},{1,2,3,5,6,7,11,12,13},{1,2,3,5,6,7,11,12,13,14},{1,2,3,5,6,7,11,12,13,14,15},{1,2,3,5,6,7,11,12,13,15},{1,2,3,5,6,7,11,12,14},{1,2,3,5,6,7,11,12,14,15},{1,2,3,5,6,7,11,12,15},{1,2,3,5,6,7,11,13},{1,2,3,5,6,7,11,13,14},{1,2,3,5,6,7,11,13,14,15},{1,2,3,5,6,7,11,13,15},{1,2,3,5,6,7,11,14},{1,2,3,5,6,7,11,14,15},{1,2,3,5,6,7,11,15},{1,2,3,5,6,7,12},{1,2,3,5,6,7,12,13},{1,2,3,5,6,7,12,13,14},{1,2,3,5,6,7,12,13,14,15},{1,2,3,5,6,7,12,13,15},{1,2,3,5,6,7,12,14},{1,2,3,5,6,7,12,14,15},{1,2,3,5,6,7,12,15},{1,2,3,5,6,7,13},{1,2,3,5,6,7,13,14},{1,2,3,5,6,7,13,14,15},{1,2,3,5,6,7,13,15},{1,2,3,5,6,7,14},{1,2,3,5,6,7,14,15},{1,2,3,5,6,7,15},{1,2,3,5,6,8},{1,2,3,5,6,8,9},{1,2,3,5,6,8,9,10},{1,2,3,5,6,8,9,10,11},{1,2,3,5,6,8,9,10,11,12},{1,2,3,5,6,8,9,10,11,12,13},{1,2,3,5,6,8,9,10,11,12,13,14},{1,2,3,5,6,8,9,10,11,12,13,14,15},{1,2,3,5,6,8,9,10,11,12,13,15},{1,2,3,5,6,8,9,10,11,12,14},{1,2,3,5,6,8,9,10,11,12,14,15},{1,2,3,5,6,8,9,10,11,12,15},{1,2,3,5,6,8,9,10,11,13},{1,2,3,5,6,8,9,10,11,13,14},{1,2,3,5,6,8,9,10,11,13,14,15},{1,2,3,5,6,8,9,10,11,13,15},{1,2,3,5,6,8,9,10,11,14},{1,2,3,5,6,8,9,10,11,14,15},{1,2,3,5,6,8,9,10,11,15},{1,2,3,5,6,8,9,10,12},{1,2,3,5,6,8,9,10,12,13},{1,2,3,5,6,8,9,10,12,13,14},{1,2,3,5,6,8,9,10,12,13,14,15},{1,2,3,5,6,8,9,10,12,13,15},{1,2,3,5,6,8,9,10,12,14},{1,2,3,5,6,8,9,10,12,14,15},{1,2,3,5,6,8,9,10,12,15},{1,2,3,5,6,8,9,10,13},{1,2,3,5,6,8,9,10,13,14},{1,2,3,5,6,8,9,10,13,14,15},{1,2,3,5,6,8,9,10,13,15},{1,2,3,5,6,8,9,10,14},{1,2,3,5,6,8,9,10,14,15},{1,2,3,5,6,8,9,10,15},{1,2,3,5,6,8,9,11},{1,2,3,5,6,8,9,11,12},{1,2,3,5,6,8,9,11,12,13},{1,2,3,5,6,8,9,11,12,13,14},{1,2,3,5,6,8,9,11,12,13,14,15},{1,2,3,5,6,8,9,11,12,13,15},{1,2,3,5,6,8,9,11,12,14},{1,2,3,5,6,8,9,11,12,14,15},{1,2,3,5,6,8,9,11,12,15},{1,2,3,5,6,8,9,11,13},{1,2,3,5,6,8,9,11,13,14},{1,2,3,5,6,8,9,11,13,14,15},{1,2,3,5,6,8,9,11,13,15},{1,2,3,5,6,8,9,11,14},{1,2,3,5,6,8,9,11,14,15},{1,2,3,5,6,8,9,11,15},{1,2,3,5,6,8,9,12},{1,2,3,5,6,8,9,12,13},{1,2,3,5,6,8,9,12,13,14},{1,2,3,5,6,8,9,12,13,14,15},{1,2,3,5,6,8,9,12,13,15},{1,2,3,5,6,8,9,12,14},{1,2,3,5,6,8,9,12,14,15},{1,2,3,5,6,8,9,12,15},{1,2,3,5,6,8,9,13},{1,2,3,5,6,8,9,13,14},{1,2,3,5,6,8,9,13,14,15},{1,2,3,5,6,8,9,13,15},{1,2,3,5,6,8,9,14},{1,2,3,5,6,8,9,14,15},{1,2,3,5,6,8,9,15},{1,2,3,5,6,8,10},{1,2,3,5,6,8,10,11},{1,2,3,5,6,8,10,11,12},{1,2,3,5,6,8,10,11,12,13},{1,2,3,5,6,8,10,11,12,13,14},{1,2,3,5,6,8,10,11,12,13,14,15},{1,2,3,5,6,8,10,11,12,13,15},{1,2,3,5,6,8,10,11,12,14},{1,2,3,5,6,8,10,11,12,14,15},{1,2,3,5,6,8,10,11,12,15},{1,2,3,5,6,8,10,11,13},{1,2,3,5,6,8,10,11,13,14},{1,2,3,5,6,8,10,11,13,14,15},{1,2,3,5,6,8,10,11,13,15},{1,2,3,5,6,8,10,11,14},{1,2,3,5,6,8,10,11,14,15},{1,2,3,5,6,8,10,11,15},{1,2,3,5,6,8,10,12},{1,2,3,5,6,8,10,12,13},{1,2,3,5,6,8,10,12,13,14},{1,2,3,5,6,8,10,12,13,14,15},{1,2,3,5,6,8,10,12,13,15},{1,2,3,5,6,8,10,12,14},{1,2,3,5,6,8,10,12,14,15},{1,2,3,5,6,8,10,12,15},{1,2,3,5,6,8,10,13},{1,2,3,5,6,8,10,13,14},{1,2,3,5,6,8,10,13,14,15},{1,2,3,5,6,8,10,13,15},{1,2,3,5,6,8,10,14},{1,2,3,5,6,8,10,14,15},{1,2,3,5,6,8,10,15},{1,2,3,5,6,8,11},{1,2,3,5,6,8,11,12},{1,2,3,5,6,8,11,12,13},{1,2,3,5,6,8,11,12,13,14},{1,2,3,5,6,8,11,12,13,14,15},{1,2,3,5,6,8,11,12,13,15},{1,2,3,5,6,8,11,12,14},{1,2,3,5,6,8,11,12,14,15},{1,2,3,5,6,8,11,12,15},{1,2,3,5,6,8,11,13},{1,2,3,5,6,8,11,13,14},{1,2,3,5,6,8,11,13,14,15},{1,2,3,5,6,8,11,13,15},{1,2,3,5,6,8,11,14},{1,2,3,5,6,8,11,14,15},{1,2,3,5,6,8,11,15},{1,2,3,5,6,8,12},{1,2,3,5,6,8,12,13},{1,2,3,5,6,8,12,13,14},{1,2,3,5,6,8,12,13,14,15},{1,2,3,5,6,8,12,13,15},{1,2,3,5,6,8,12,14},{1,2,3,5,6,8,12,14,15},{1,2,3,5,6,8,12,15},{1,2,3,5,6,8,13},{1,2,3,5,6,8,13,14},{1,2,3,5,6,8,13,14,15},{1,2,3,5,6,8,13,15},{1,2,3,5,6,8,14},{1,2,3,5,6,8,14,15},{1,2,3,5,6,8,15},{1,2,3,5,6,9},{1,2,3,5,6,9,10},{1,2,3,5,6,9,10,11},{1,2,3,5,6,9,10,11,12},{1,2,3,5,6,9,10,11,12,13},{1,2,3,5,6,9,10,11,12,13,14},{1,2,3,5,6,9,10,11,12,13,14,15},{1,2,3,5,6,9,10,11,12,13,15},{1,2,3,5,6,9,10,11,12,14},{1,2,3,5,6,9,10,11,12,14,15},{1,2,3,5,6,9,10,11,12,15},{1,2,3,5,6,9,10,11,13},{1,2,3,5,6,9,10,11,13,14},{1,2,3,5,6,9,10,11,13,14,15},{1,2,3,5,6,9,10,11,13,15},{1,2,3,5,6,9,10,11,14},{1,2,3,5,6,9,10,11,14,15},{1,2,3,5,6,9,10,11,15},{1,2,3,5,6,9,10,12},{1,2,3,5,6,9,10,12,13},{1,2,3,5,6,9,10,12,13,14},{1,2,3,5,6,9,10,12,13,14,15},{1,2,3,5,6,9,10,12,13,15},{1,2,3,5,6,9,10,12,14},{1,2,3,5,6,9,10,12,14,15},{1,2,3,5,6,9,10,12,15},{1,2,3,5,6,9,10,13},{1,2,3,5,6,9,10,13,14},{1,2,3,5,6,9,10,13,14,15},{1,2,3,5,6,9,10,13,15},{1,2,3,5,6,9,10,14},{1,2,3,5,6,9,10,14,15},{1,2,3,5,6,9,10,15},{1,2,3,5,6,9,11},{1,2,3,5,6,9,11,12},{1,2,3,5,6,9,11,12,13},{1,2,3,5,6,9,11,12,13,14},{1,2,3,5,6,9,11,12,13,14,15},{1,2,3,5,6,9,11,12,13,15},{1,2,3,5,6,9,11,12,14},{1,2,3,5,6,9,11,12,14,15},{1,2,3,5,6,9,11,12,15},{1,2,3,5,6,9,11,13},{1,2,3,5,6,9,11,13,14},{1,2,3,5,6,9,11,13,14,15},{1,2,3,5,6,9,11,13,15},{1,2,3,5,6,9,11,14},{1,2,3,5,6,9,11,14,15},{1,2,3,5,6,9,11,15},{1,2,3,5,6,9,12},{1,2,3,5,6,9,12,13},{1,2,3,5,6,9,12,13,14},{1,2,3,5,6,9,12,13,14,15},{1,2,3,5,6,9,12,13,15},{1,2,3,5,6,9,12,14},{1,2,3,5,6,9,12,14,15},{1,2,3,5,6,9,12,15},{1,2,3,5,6,9,13},{1,2,3,5,6,9,13,14},{1,2,3,5,6,9,13,14,15},{1,2,3,5,6,9,13,15},{1,2,3,5,6,9,14},{1,2,3,5,6,9,14,15},{1,2,3,5,6,9,15},{1,2,3,5,6,10},{1,2,3,5,6,10,11},{1,2,3,5,6,10,11,12},{1,2,3,5,6,10,11,12,13},{1,2,3,5,6,10,11,12,13,14},{1,2,3,5,6,10,11,12,13,14,15},{1,2,3,5,6,10,11,12,13,15},{1,2,3,5,6,10,11,12,14},{1,2,3,5,6,10,11,12,14,15},{1,2,3,5,6,10,11,12,15},{1,2,3,5,6,10,11,13},{1,2,3,5,6,10,11,13,14},{1,2,3,5,6,10,11,13,14,15},{1,2,3,5,6,10,11,13,15},{1,2,3,5,6,10,11,14},{1,2,3,5,6,10,11,14,15},{1,2,3,5,6,10,11,15},{1,2,3,5,6,10,12},{1,2,3,5,6,10,12,13},{1,2,3,5,6,10,12,13,14},{1,2,3,5,6,10,12,13,14,15},{1,2,3,5,6,10,12,13,15},{1,2,3,5,6,10,12,14},{1,2,3,5,6,10,12,14,15},{1,2,3,5,6,10,12,15},{1,2,3,5,6,10,13},{1,2,3,5,6,10,13,14},{1,2,3,5,6,10,13,14,15},{1,2,3,5,6,10,13,15},{1,2,3,5,6,10,14},{1,2,3,5,6,10,14,15},{1,2,3,5,6,10,15},{1,2,3,5,6,11},{1,2,3,5,6,11,12},{1,2,3,5,6,11,12,13},{1,2,3,5,6,11,12,13,14},{1,2,3,5,6,11,12,13,14,15},{1,2,3,5,6,11,12,13,15},{1,2,3,5,6,11,12,14},{1,2,3,5,6,11,12,14,15},{1,2,3,5,6,11,12,15},{1,2,3,5,6,11,13},{1,2,3,5,6,11,13,14},{1,2,3,5,6,11,13,14,15},{1,2,3,5,6,11,13,15},{1,2,3,5,6,11,14},{1,2,3,5,6,11,14,15},{1,2,3,5,6,11,15},{1,2,3,5,6,12},{1,2,3,5,6,12,13},{1,2,3,5,6,12,13,14},{1,2,3,5,6,12,13,14,15},{1,2,3,5,6,12,13,15},{1,2,3,5,6,12,14},{1,2,3,5,6,12,14,15},{1,2,3,5,6,12,15},{1,2,3,5,6,13},{1,2,3,5,6,13,14},{1,2,3,5,6,13,14,15},{1,2,3,5,6,13,15},{1,2,3,5,6,14},{1,2,3,5,6,14,15},{1,2,3,5,6,15},{1,2,3,5,7},{1,2,3,5,7,8},{1,2,3,5,7,8,9},{1,2,3,5,7,8,9,10},{1,2,3,5,7,8,9,10,11},{1,2,3,5,7,8,9,10,11,12},{1,2,3,5,7,8,9,10,11,12,13},{1,2,3,5,7,8,9,10,11,12,13,14},{1,2,3,5,7,8,9,10,11,12,13,14,15},{1,2,3,5,7,8,9,10,11,12,13,15},{1,2,3,5,7,8,9,10,11,12,14},{1,2,3,5,7,8,9,10,11,12,14,15},{1,2,3,5,7,8,9,10,11,12,15},{1,2,3,5,7,8,9,10,11,13},{1,2,3,5,7,8,9,10,11,13,14},{1,2,3,5,7,8,9,10,11,13,14,15},{1,2,3,5,7,8,9,10,11,13,15},{1,2,3,5,7,8,9,10,11,14},{1,2,3,5,7,8,9,10,11,14,15},{1,2,3,5,7,8,9,10,11,15},{1,2,3,5,7,8,9,10,12},{1,2,3,5,7,8,9,10,12,13},{1,2,3,5,7,8,9,10,12,13,14},{1,2,3,5,7,8,9,10,12,13,14,15},{1,2,3,5,7,8,9,10,12,13,15},{1,2,3,5,7,8,9,10,12,14},{1,2,3,5,7,8,9,10,12,14,15},{1,2,3,5,7,8,9,10,12,15},{1,2,3,5,7,8,9,10,13},{1,2,3,5,7,8,9,10,13,14},{1,2,3,5,7,8,9,10,13,14,15},{1,2,3,5,7,8,9,10,13,15},{1,2,3,5,7,8,9,10,14},{1,2,3,5,7,8,9,10,14,15},{1,2,3,5,7,8,9,10,15},{1,2,3,5,7,8,9,11},{1,2,3,5,7,8,9,11,12},{1,2,3,5,7,8,9,11,12,13},{1,2,3,5,7,8,9,11,12,13,14},{1,2,3,5,7,8,9,11,12,13,14,15},{1,2,3,5,7,8,9,11,12,13,15},{1,2,3,5,7,8,9,11,12,14},{1,2,3,5,7,8,9,11,12,14,15},{1,2,3,5,7,8,9,11,12,15},{1,2,3,5,7,8,9,11,13},{1,2,3,5,7,8,9,11,13,14},{1,2,3,5,7,8,9,11,13,14,15},{1,2,3,5,7,8,9,11,13,15},{1,2,3,5,7,8,9,11,14},{1,2,3,5,7,8,9,11,14,15},{1,2,3,5,7,8,9,11,15},{1,2,3,5,7,8,9,12},{1,2,3,5,7,8,9,12,13},{1,2,3,5,7,8,9,12,13,14},{1,2,3,5,7,8,9,12,13,14,15},{1,2,3,5,7,8,9,12,13,15},{1,2,3,5,7,8,9,12,14},{1,2,3,5,7,8,9,12,14,15},{1,2,3,5,7,8,9,12,15},{1,2,3,5,7,8,9,13},{1,2,3,5,7,8,9,13,14},{1,2,3,5,7,8,9,13,14,15},{1,2,3,5,7,8,9,13,15},{1,2,3,5,7,8,9,14},{1,2,3,5,7,8,9,14,15},{1,2,3,5,7,8,9,15},{1,2,3,5,7,8,10},{1,2,3,5,7,8,10,11},{1,2,3,5,7,8,10,11,12},{1,2,3,5,7,8,10,11,12,13},{1,2,3,5,7,8,10,11,12,13,14},{1,2,3,5,7,8,10,11,12,13,14,15},{1,2,3,5,7,8,10,11,12,13,15},{1,2,3,5,7,8,10,11,12,14},{1,2,3,5,7,8,10,11,12,14,15},{1,2,3,5,7,8,10,11,12,15},{1,2,3,5,7,8,10,11,13},{1,2,3,5,7,8,10,11,13,14},{1,2,3,5,7,8,10,11,13,14,15},{1,2,3,5,7,8,10,11,13,15},{1,2,3,5,7,8,10,11,14},{1,2,3,5,7,8,10,11,14,15},{1,2,3,5,7,8,10,11,15},{1,2,3,5,7,8,10,12},{1,2,3,5,7,8,10,12,13},{1,2,3,5,7,8,10,12,13,14},{1,2,3,5,7,8,10,12,13,14,15},{1,2,3,5,7,8,10,12,13,15},{1,2,3,5,7,8,10,12,14},{1,2,3,5,7,8,10,12,14,15},{1,2,3,5,7,8,10,12,15},{1,2,3,5,7,8,10,13},{1,2,3,5,7,8,10,13,14},{1,2,3,5,7,8,10,13,14,15},{1,2,3,5,7,8,10,13,15},{1,2,3,5,7,8,10,14},{1,2,3,5,7,8,10,14,15},{1,2,3,5,7,8,10,15},{1,2,3,5,7,8,11},{1,2,3,5,7,8,11,12},{1,2,3,5,7,8,11,12,13},{1,2,3,5,7,8,11,12,13,14},{1,2,3,5,7,8,11,12,13,14,15},{1,2,3,5,7,8,11,12,13,15},{1,2,3,5,7,8,11,12,14},{1,2,3,5,7,8,11,12,14,15},{1,2,3,5,7,8,11,12,15},{1,2,3,5,7,8,11,13},{1,2,3,5,7,8,11,13,14},{1,2,3,5,7,8,11,13,14,15},{1,2,3,5,7,8,11,13,15},{1,2,3,5,7,8,11,14},{1,2,3,5,7,8,11,14,15},{1,2,3,5,7,8,11,15},{1,2,3,5,7,8,12},{1,2,3,5,7,8,12,13},{1,2,3,5,7,8,12,13,14},{1,2,3,5,7,8,12,13,14,15},{1,2,3,5,7,8,12,13,15},{1,2,3,5,7,8,12,14},{1,2,3,5,7,8,12,14,15},{1,2,3,5,7,8,12,15},{1,2,3,5,7,8,13},{1,2,3,5,7,8,13,14},{1,2,3,5,7,8,13,14,15},{1,2,3,5,7,8,13,15},{1,2,3,5,7,8,14},{1,2,3,5,7,8,14,15},{1,2,3,5,7,8,15},{1,2,3,5,7,9},{1,2,3,5,7,9,10},{1,2,3,5,7,9,10,11},{1,2,3,5,7,9,10,11,12},{1,2,3,5,7,9,10,11,12,13},{1,2,3,5,7,9,10,11,12,13,14},{1,2,3,5,7,9,10,11,12,13,14,15},{1,2,3,5,7,9,10,11,12,13,15},{1,2,3,5,7,9,10,11,12,14},{1,2,3,5,7,9,10,11,12,14,15},{1,2,3,5,7,9,10,11,12,15},{1,2,3,5,7,9,10,11,13},{1,2,3,5,7,9,10,11,13,14},{1,2,3,5,7,9,10,11,13,14,15},{1,2,3,5,7,9,10,11,13,15},{1,2,3,5,7,9,10,11,14},{1,2,3,5,7,9,10,11,14,15},{1,2,3,5,7,9,10,11,15},{1,2,3,5,7,9,10,12},{1,2,3,5,7,9,10,12,13},{1,2,3,5,7,9,10,12,13,14},{1,2,3,5,7,9,10,12,13,14,15},{1,2,3,5,7,9,10,12,13,15},{1,2,3,5,7,9,10,12,14},{1,2,3,5,7,9,10,12,14,15},{1,2,3,5,7,9,10,12,15},{1,2,3,5,7,9,10,13},{1,2,3,5,7,9,10,13,14},{1,2,3,5,7,9,10,13,14,15},{1,2,3,5,7,9,10,13,15},{1,2,3,5,7,9,10,14},{1,2,3,5,7,9,10,14,15},{1,2,3,5,7,9,10,15},{1,2,3,5,7,9,11},{1,2,3,5,7,9,11,12},{1,2,3,5,7,9,11,12,13},{1,2,3,5,7,9,11,12,13,14},{1,2,3,5,7,9,11,12,13,14,15},{1,2,3,5,7,9,11,12,13,15},{1,2,3,5,7,9,11,12,14},{1,2,3,5,7,9,11,12,14,15},{1,2,3,5,7,9,11,12,15},{1,2,3,5,7,9,11,13},{1,2,3,5,7,9,11,13,14},{1,2,3,5,7,9,11,13,14,15},{1,2,3,5,7,9,11,13,15},{1,2,3,5,7,9,11,14},{1,2,3,5,7,9,11,14,15},{1,2,3,5,7,9,11,15},{1,2,3,5,7,9,12},{1,2,3,5,7,9,12,13},{1,2,3,5,7,9,12,13,14},{1,2,3,5,7,9,12,13,14,15},{1,2,3,5,7,9,12,13,15},{1,2,3,5,7,9,12,14},{1,2,3,5,7,9,12,14,15},{1,2,3,5,7,9,12,15},{1,2,3,5,7,9,13},{1,2,3,5,7,9,13,14},{1,2,3,5,7,9,13,14,15},{1,2,3,5,7,9,13,15},{1,2,3,5,7,9,14},{1,2,3,5,7,9,14,15},{1,2,3,5,7,9,15},{1,2,3,5,7,10},{1,2,3,5,7,10,11},{1,2,3,5,7,10,11,12},{1,2,3,5,7,10,11,12,13},{1,2,3,5,7,10,11,12,13,14},{1,2,3,5,7,10,11,12,13,14,15},{1,2,3,5,7,10,11,12,13,15},{1,2,3,5,7,10,11,12,14},{1,2,3,5,7,10,11,12,14,15},{1,2,3,5,7,10,11,12,15},{1,2,3,5,7,10,11,13},{1,2,3,5,7,10,11,13,14},{1,2,3,5,7,10,11,13,14,15},{1,2,3,5,7,10,11,13,15},{1,2,3,5,7,10,11,14},{1,2,3,5,7,10,11,14,15},{1,2,3,5,7,10,11,15},{1,2,3,5,7,10,12},{1,2,3,5,7,10,12,13},{1,2,3,5,7,10,12,13,14},{1,2,3,5,7,10,12,13,14,15},{1,2,3,5,7,10,12,13,15},{1,2,3,5,7,10,12,14},{1,2,3,5,7,10,12,14,15},{1,2,3,5,7,10,12,15},{1,2,3,5,7,10,13},{1,2,3,5,7,10,13,14},{1,2,3,5,7,10,13,14,15},{1,2,3,5,7,10,13,15},{1,2,3,5,7,10,14},{1,2,3,5,7,10,14,15},{1,2,3,5,7,10,15},{1,2,3,5,7,11},{1,2,3,5,7,11,12},{1,2,3,5,7,11,12,13},{1,2,3,5,7,11,12,13,14},{1,2,3,5,7,11,12,13,14,15},{1,2,3,5,7,11,12,13,15},{1,2,3,5,7,11,12,14},{1,2,3,5,7,11,12,14,15},{1,2,3,5,7,11,12,15},{1,2,3,5,7,11,13},{1,2,3,5,7,11,13,14},{1,2,3,5,7,11,13,14,15},{1,2,3,5,7,11,13,15},{1,2,3,5,7,11,14},{1,2,3,5,7,11,14,15},{1,2,3,5,7,11,15},{1,2,3,5,7,12},{1,2,3,5,7,12,13},{1,2,3,5,7,12,13,14},{1,2,3,5,7,12,13,14,15},{1,2,3,5,7,12,13,15},{1,2,3,5,7,12,14},{1,2,3,5,7,12,14,15},{1,2,3,5,7,12,15},{1,2,3,5,7,13},{1,2,3,5,7,13,14},{1,2,3,5,7,13,14,15},{1,2,3,5,7,13,15},{1,2,3,5,7,14},{1,2,3,5,7,14,15},{1,2,3,5,7,15},{1,2,3,5,8},{1,2,3,5,8,9},{1,2,3,5,8,9,10},{1,2,3,5,8,9,10,11},{1,2,3,5,8,9,10,11,12},{1,2,3,5,8,9,10,11,12,13},{1,2,3,5,8,9,10,11,12,13,14},{1,2,3,5,8,9,10,11,12,13,14,15},{1,2,3,5,8,9,10,11,12,13,15},{1,2,3,5,8,9,10,11,12,14},{1,2,3,5,8,9,10,11,12,14,15},{1,2,3,5,8,9,10,11,12,15},{1,2,3,5,8,9,10,11,13},{1,2,3,5,8,9,10,11,13,14},{1,2,3,5,8,9,10,11,13,14,15},{1,2,3,5,8,9,10,11,13,15},{1,2,3,5,8,9,10,11,14},{1,2,3,5,8,9,10,11,14,15},{1,2,3,5,8,9,10,11,15},{1,2,3,5,8,9,10,12},{1,2,3,5,8,9,10,12,13},{1,2,3,5,8,9,10,12,13,14},{1,2,3,5,8,9,10,12,13,14,15},{1,2,3,5,8,9,10,12,13,15},{1,2,3,5,8,9,10,12,14},{1,2,3,5,8,9,10,12,14,15},{1,2,3,5,8,9,10,12,15},{1,2,3,5,8,9,10,13},{1,2,3,5,8,9,10,13,14},{1,2,3,5,8,9,10,13,14,15},{1,2,3,5,8,9,10,13,15},{1,2,3,5,8,9,10,14},{1,2,3,5,8,9,10,14,15},{1,2,3,5,8,9,10,15},{1,2,3,5,8,9,11},{1,2,3,5,8,9,11,12},{1,2,3,5,8,9,11,12,13},{1,2,3,5,8,9,11,12,13,14},{1,2,3,5,8,9,11,12,13,14,15},{1,2,3,5,8,9,11,12,13,15},{1,2,3,5,8,9,11,12,14},{1,2,3,5,8,9,11,12,14,15},{1,2,3,5,8,9,11,12,15},{1,2,3,5,8,9,11,13},{1,2,3,5,8,9,11,13,14},{1,2,3,5,8,9,11,13,14,15},{1,2,3,5,8,9,11,13,15},{1,2,3,5,8,9,11,14},{1,2,3,5,8,9,11,14,15},{1,2,3,5,8,9,11,15},{1,2,3,5,8,9,12},{1,2,3,5,8,9,12,13},{1,2,3,5,8,9,12,13,14},{1,2,3,5,8,9,12,13,14,15},{1,2,3,5,8,9,12,13,15},{1,2,3,5,8,9,12,14},{1,2,3,5,8,9,12,14,15},{1,2,3,5,8,9,12,15},{1,2,3,5,8,9,13},{1,2,3,5,8,9,13,14},{1,2,3,5,8,9,13,14,15},{1,2,3,5,8,9,13,15},{1,2,3,5,8,9,14},{1,2,3,5,8,9,14,15},{1,2,3,5,8,9,15},{1,2,3,5,8,10},{1,2,3,5,8,10,11},{1,2,3,5,8,10,11,12},{1,2,3,5,8,10,11,12,13},{1,2,3,5,8,10,11,12,13,14},{1,2,3,5,8,10,11,12,13,14,15},{1,2,3,5,8,10,11,12,13,15},{1,2,3,5,8,10,11,12,14},{1,2,3,5,8,10,11,12,14,15},{1,2,3,5,8,10,11,12,15},{1,2,3,5,8,10,11,13},{1,2,3,5,8,10,11,13,14},{1,2,3,5,8,10,11,13,14,15},{1,2,3,5,8,10,11,13,15},{1,2,3,5,8,10,11,14},{1,2,3,5,8,10,11,14,15},{1,2,3,5,8,10,11,15},{1,2,3,5,8,10,12},{1,2,3,5,8,10,12,13},{1,2,3,5,8,10,12,13,14},{1,2,3,5,8,10,12,13,14,15},{1,2,3,5,8,10,12,13,15},{1,2,3,5,8,10,12,14},{1,2,3,5,8,10,12,14,15},{1,2,3,5,8,10,12,15},{1,2,3,5,8,10,13},{1,2,3,5,8,10,13,14},{1,2,3,5,8,10,13,14,15},{1,2,3,5,8,10,13,15},{1,2,3,5,8,10,14},{1,2,3,5,8,10,14,15},{1,2,3,5,8,10,15},{1,2,3,5,8,11},{1,2,3,5,8,11,12},{1,2,3,5,8,11,12,13},{1,2,3,5,8,11,12,13,14},{1,2,3,5,8,11,12,13,14,15},{1,2,3,5,8,11,12,13,15},{1,2,3,5,8,11,12,14},{1,2,3,5,8,11,12,14,15},{1,2,3,5,8,11,12,15},{1,2,3,5,8,11,13},{1,2,3,5,8,11,13,14},{1,2,3,5,8,11,13,14,15},{1,2,3,5,8,11,13,15},{1,2,3,5,8,11,14},{1,2,3,5,8,11,14,15},{1,2,3,5,8,11,15},{1,2,3,5,8,12},{1,2,3,5,8,12,13},{1,2,3,5,8,12,13,14},{1,2,3,5,8,12,13,14,15},{1,2,3,5,8,12,13,15},{1,2,3,5,8,12,14},{1,2,3,5,8,12,14,15},{1,2,3,5,8,12,15},{1,2,3,5,8,13},{1,2,3,5,8,13,14},{1,2,3,5,8,13,14,15},{1,2,3,5,8,13,15},{1,2,3,5,8,14},{1,2,3,5,8,14,15},{1,2,3,5,8,15},{1,2,3,5,9},{1,2,3,5,9,10},{1,2,3,5,9,10,11},{1,2,3,5,9,10,11,12},{1,2,3,5,9,10,11,12,13},{1,2,3,5,9,10,11,12,13,14},{1,2,3,5,9,10,11,12,13,14,15},{1,2,3,5,9,10,11,12,13,15},{1,2,3,5,9,10,11,12,14},{1,2,3,5,9,10,11,12,14,15},{1,2,3,5,9,10,11,12,15},{1,2,3,5,9,10,11,13},{1,2,3,5,9,10,11,13,14},{1,2,3,5,9,10,11,13,14,15},{1,2,3,5,9,10,11,13,15},{1,2,3,5,9,10,11,14},{1,2,3,5,9,10,11,14,15},{1,2,3,5,9,10,11,15},{1,2,3,5,9,10,12},{1,2,3,5,9,10,12,13},{1,2,3,5,9,10,12,13,14},{1,2,3,5,9,10,12,13,14,15},{1,2,3,5,9,10,12,13,15},{1,2,3,5,9,10,12,14},{1,2,3,5,9,10,12,14,15},{1,2,3,5,9,10,12,15},{1,2,3,5,9,10,13},{1,2,3,5,9,10,13,14},{1,2,3,5,9,10,13,14,15},{1,2,3,5,9,10,13,15},{1,2,3,5,9,10,14},{1,2,3,5,9,10,14,15},{1,2,3,5,9,10,15},{1,2,3,5,9,11},{1,2,3,5,9,11,12},{1,2,3,5,9,11,12,13},{1,2,3,5,9,11,12,13,14},{1,2,3,5,9,11,12,13,14,15},{1,2,3,5,9,11,12,13,15},{1,2,3,5,9,11,12,14},{1,2,3,5,9,11,12,14,15},{1,2,3,5,9,11,12,15},{1,2,3,5,9,11,13},{1,2,3,5,9,11,13,14},{1,2,3,5,9,11,13,14,15},{1,2,3,5,9,11,13,15},{1,2,3,5,9,11,14},{1,2,3,5,9,11,14,15},{1,2,3,5,9,11,15},{1,2,3,5,9,12},{1,2,3,5,9,12,13},{1,2,3,5,9,12,13,14},{1,2,3,5,9,12,13,14,15},{1,2,3,5,9,12,13,15},{1,2,3,5,9,12,14},{1,2,3,5,9,12,14,15},{1,2,3,5,9,12,15},{1,2,3,5,9,13},{1,2,3,5,9,13,14},{1,2,3,5,9,13,14,15},{1,2,3,5,9,13,15},{1,2,3,5,9,14},{1,2,3,5,9,14,15},{1,2,3,5,9,15},{1,2,3,5,10},{1,2,3,5,10,11},{1,2,3,5,10,11,12},{1,2,3,5,10,11,12,13},{1,2,3,5,10,11,12,13,14},{1,2,3,5,10,11,12,13,14,15},{1,2,3,5,10,11,12,13,15},{1,2,3,5,10,11,12,14},{1,2,3,5,10,11,12,14,15},{1,2,3,5,10,11,12,15},{1,2,3,5,10,11,13},{1,2,3,5,10,11,13,14},{1,2,3,5,10,11,13,14,15},{1,2,3,5,10,11,13,15},{1,2,3,5,10,11,14},{1,2,3,5,10,11,14,15},{1,2,3,5,10,11,15},{1,2,3,5,10,12},{1,2,3,5,10,12,13},{1,2,3,5,10,12,13,14},{1,2,3,5,10,12,13,14,15},{1,2,3,5,10,12,13,15},{1,2,3,5,10,12,14},{1,2,3,5,10,12,14,15},{1,2,3,5,10,12,15},{1,2,3,5,10,13},{1,2,3,5,10,13,14},{1,2,3,5,10,13,14,15},{1,2,3,5,10,13,15},{1,2,3,5,10,14},{1,2,3,5,10,14,15},{1,2,3,5,10,15},{1,2,3,5,11},{1,2,3,5,11,12},{1,2,3,5,11,12,13},{1,2,3,5,11,12,13,14},{1,2,3,5,11,12,13,14,15},{1,2,3,5,11,12,13,15},{1,2,3,5,11,12,14},{1,2,3,5,11,12,14,15},{1,2,3,5,11,12,15},{1,2,3,5,11,13},{1,2,3,5,11,13,14},{1,2,3,5,11,13,14,15},{1,2,3,5,11,13,15},{1,2,3,5,11,14},{1,2,3,5,11,14,15},{1,2,3,5,11,15},{1,2,3,5,12},{1,2,3,5,12,13},{1,2,3,5,12,13,14},{1,2,3,5,12,13,14,15},{1,2,3,5,12,13,15},{1,2,3,5,12,14},{1,2,3,5,12,14,15},{1,2,3,5,12,15},{1,2,3,5,13},{1,2,3,5,13,14},{1,2,3,5,13,14,15},{1,2,3,5,13,15},{1,2,3,5,14},{1,2,3,5,14,15},{1,2,3,5,15},{1,2,3,6},{1,2,3,6,7},{1,2,3,6,7,8},{1,2,3,6,7,8,9},{1,2,3,6,7,8,9,10},{1,2,3,6,7,8,9,10,11},{1,2,3,6,7,8,9,10,11,12},{1,2,3,6,7,8,9,10,11,12,13},{1,2,3,6,7,8,9,10,11,12,13,14},{1,2,3,6,7,8,9,10,11,12,13,14,15},{1,2,3,6,7,8,9,10,11,12,13,15},{1,2,3,6,7,8,9,10,11,12,14},{1,2,3,6,7,8,9,10,11,12,14,15},{1,2,3,6,7,8,9,10,11,12,15},{1,2,3,6,7,8,9,10,11,13},{1,2,3,6,7,8,9,10,11,13,14},{1,2,3,6,7,8,9,10,11,13,14,15},{1,2,3,6,7,8,9,10,11,13,15},{1,2,3,6,7,8,9,10,11,14},{1,2,3,6,7,8,9,10,11,14,15},{1,2,3,6,7,8,9,10,11,15},{1,2,3,6,7,8,9,10,12},{1,2,3,6,7,8,9,10,12,13},{1,2,3,6,7,8,9,10,12,13,14},{1,2,3,6,7,8,9,10,12,13,14,15},{1,2,3,6,7,8,9,10,12,13,15},{1,2,3,6,7,8,9,10,12,14},{1,2,3,6,7,8,9,10,12,14,15},{1,2,3,6,7,8,9,10,12,15},{1,2,3,6,7,8,9,10,13},{1,2,3,6,7,8,9,10,13,14},{1,2,3,6,7,8,9,10,13,14,15},{1,2,3,6,7,8,9,10,13,15},{1,2,3,6,7,8,9,10,14},{1,2,3,6,7,8,9,10,14,15},{1,2,3,6,7,8,9,10,15},{1,2,3,6,7,8,9,11},{1,2,3,6,7,8,9,11,12},{1,2,3,6,7,8,9,11,12,13},{1,2,3,6,7,8,9,11,12,13,14},{1,2,3,6,7,8,9,11,12,13,14,15},{1,2,3,6,7,8,9,11,12,13,15},{1,2,3,6,7,8,9,11,12,14},{1,2,3,6,7,8,9,11,12,14,15},{1,2,3,6,7,8,9,11,12,15},{1,2,3,6,7,8,9,11,13},{1,2,3,6,7,8,9,11,13,14},{1,2,3,6,7,8,9,11,13,14,15},{1,2,3,6,7,8,9,11,13,15},{1,2,3,6,7,8,9,11,14},{1,2,3,6,7,8,9,11,14,15},{1,2,3,6,7,8,9,11,15},{1,2,3,6,7,8,9,12},{1,2,3,6,7,8,9,12,13},{1,2,3,6,7,8,9,12,13,14},{1,2,3,6,7,8,9,12,13,14,15},{1,2,3,6,7,8,9,12,13,15},{1,2,3,6,7,8,9,12,14},{1,2,3,6,7,8,9,12,14,15},{1,2,3,6,7,8,9,12,15},{1,2,3,6,7,8,9,13},{1,2,3,6,7,8,9,13,14},{1,2,3,6,7,8,9,13,14,15},{1,2,3,6,7,8,9,13,15},{1,2,3,6,7,8,9,14},{1,2,3,6,7,8,9,14,15},{1,2,3,6,7,8,9,15},{1,2,3,6,7,8,10},{1,2,3,6,7,8,10,11},{1,2,3,6,7,8,10,11,12},{1,2,3,6,7,8,10,11,12,13},{1,2,3,6,7,8,10,11,12,13,14},{1,2,3,6,7,8,10,11,12,13,14,15},{1,2,3,6,7,8,10,11,12,13,15},{1,2,3,6,7,8,10,11,12,14},{1,2,3,6,7,8,10,11,12,14,15},{1,2,3,6,7,8,10,11,12,15},{1,2,3,6,7,8,10,11,13},{1,2,3,6,7,8,10,11,13,14},{1,2,3,6,7,8,10,11,13,14,15},{1,2,3,6,7,8,10,11,13,15},{1,2,3,6,7,8,10,11,14},{1,2,3,6,7,8,10,11,14,15},{1,2,3,6,7,8,10,11,15},{1,2,3,6,7,8,10,12},{1,2,3,6,7,8,10,12,13},{1,2,3,6,7,8,10,12,13,14},{1,2,3,6,7,8,10,12,13,14,15},{1,2,3,6,7,8,10,12,13,15},{1,2,3,6,7,8,10,12,14},{1,2,3,6,7,8,10,12,14,15},{1,2,3,6,7,8,10,12,15},{1,2,3,6,7,8,10,13},{1,2,3,6,7,8,10,13,14},{1,2,3,6,7,8,10,13,14,15},{1,2,3,6,7,8,10,13,15},{1,2,3,6,7,8,10,14},{1,2,3,6,7,8,10,14,15},{1,2,3,6,7,8,10,15},{1,2,3,6,7,8,11},{1,2,3,6,7,8,11,12},{1,2,3,6,7,8,11,12,13},{1,2,3,6,7,8,11,12,13,14},{1,2,3,6,7,8,11,12,13,14,15},{1,2,3,6,7,8,11,12,13,15},{1,2,3,6,7,8,11,12,14},{1,2,3,6,7,8,11,12,14,15},{1,2,3,6,7,8,11,12,15},{1,2,3,6,7,8,11,13},{1,2,3,6,7,8,11,13,14},{1,2,3,6,7,8,11,13,14,15},{1,2,3,6,7,8,11,13,15},{1,2,3,6,7,8,11,14},{1,2,3,6,7,8,11,14,15},{1,2,3,6,7,8,11,15},{1,2,3,6,7,8,12},{1,2,3,6,7,8,12,13},{1,2,3,6,7,8,12,13,14},{1,2,3,6,7,8,12,13,14,15},{1,2,3,6,7,8,12,13,15},{1,2,3,6,7,8,12,14},{1,2,3,6,7,8,12,14,15},{1,2,3,6,7,8,12,15},{1,2,3,6,7,8,13},{1,2,3,6,7,8,13,14},{1,2,3,6,7,8,13,14,15},{1,2,3,6,7,8,13,15},{1,2,3,6,7,8,14},{1,2,3,6,7,8,14,15},{1,2,3,6,7,8,15},{1,2,3,6,7,9},{1,2,3,6,7,9,10},{1,2,3,6,7,9,10,11},{1,2,3,6,7,9,10,11,12},{1,2,3,6,7,9,10,11,12,13},{1,2,3,6,7,9,10,11,12,13,14},{1,2,3,6,7,9,10,11,12,13,14,15},{1,2,3,6,7,9,10,11,12,13,15},{1,2,3,6,7,9,10,11,12,14},{1,2,3,6,7,9,10,11,12,14,15},{1,2,3,6,7,9,10,11,12,15},{1,2,3,6,7,9,10,11,13},{1,2,3,6,7,9,10,11,13,14},{1,2,3,6,7,9,10,11,13,14,15},{1,2,3,6,7,9,10,11,13,15},{1,2,3,6,7,9,10,11,14},{1,2,3,6,7,9,10,11,14,15},{1,2,3,6,7,9,10,11,15},{1,2,3,6,7,9,10,12},{1,2,3,6,7,9,10,12,13},{1,2,3,6,7,9,10,12,13,14},{1,2,3,6,7,9,10,12,13,14,15},{1,2,3,6,7,9,10,12,13,15},{1,2,3,6,7,9,10,12,14},{1,2,3,6,7,9,10,12,14,15},{1,2,3,6,7,9,10,12,15},{1,2,3,6,7,9,10,13},{1,2,3,6,7,9,10,13,14},{1,2,3,6,7,9,10,13,14,15},{1,2,3,6,7,9,10,13,15},{1,2,3,6,7,9,10,14},{1,2,3,6,7,9,10,14,15},{1,2,3,6,7,9,10,15},{1,2,3,6,7,9,11},{1,2,3,6,7,9,11,12},{1,2,3,6,7,9,11,12,13},{1,2,3,6,7,9,11,12,13,14},{1,2,3,6,7,9,11,12,13,14,15},{1,2,3,6,7,9,11,12,13,15},{1,2,3,6,7,9,11,12,14},{1,2,3,6,7,9,11,12,14,15},{1,2,3,6,7,9,11,12,15},{1,2,3,6,7,9,11,13},{1,2,3,6,7,9,11,13,14},{1,2,3,6,7,9,11,13,14,15},{1,2,3,6,7,9,11,13,15},{1,2,3,6,7,9,11,14},{1,2,3,6,7,9,11,14,15},{1,2,3,6,7,9,11,15},{1,2,3,6,7,9,12},{1,2,3,6,7,9,12,13},{1,2,3,6,7,9,12,13,14},{1,2,3,6,7,9,12,13,14,15},{1,2,3,6,7,9,12,13,15},{1,2,3,6,7,9,12,14},{1,2,3,6,7,9,12,14,15},{1,2,3,6,7,9,12,15},{1,2,3,6,7,9,13},{1,2,3,6,7,9,13,14},{1,2,3,6,7,9,13,14,15},{1,2,3,6,7,9,13,15},{1,2,3,6,7,9,14},{1,2,3,6,7,9,14,15},{1,2,3,6,7,9,15},{1,2,3,6,7,10},{1,2,3,6,7,10,11},{1,2,3,6,7,10,11,12},{1,2,3,6,7,10,11,12,13},{1,2,3,6,7,10,11,12,13,14},{1,2,3,6,7,10,11,12,13,14,15},{1,2,3,6,7,10,11,12,13,15},{1,2,3,6,7,10,11,12,14},{1,2,3,6,7,10,11,12,14,15},{1,2,3,6,7,10,11,12,15},{1,2,3,6,7,10,11,13},{1,2,3,6,7,10,11,13,14},{1,2,3,6,7,10,11,13,14,15},{1,2,3,6,7,10,11,13,15},{1,2,3,6,7,10,11,14},{1,2,3,6,7,10,11,14,15},{1,2,3,6,7,10,11,15},{1,2,3,6,7,10,12},{1,2,3,6,7,10,12,13},{1,2,3,6,7,10,12,13,14},{1,2,3,6,7,10,12,13,14,15},{1,2,3,6,7,10,12,13,15},{1,2,3,6,7,10,12,14},{1,2,3,6,7,10,12,14,15},{1,2,3,6,7,10,12,15},{1,2,3,6,7,10,13},{1,2,3,6,7,10,13,14},{1,2,3,6,7,10,13,14,15},{1,2,3,6,7,10,13,15},{1,2,3,6,7,10,14},{1,2,3,6,7,10,14,15},{1,2,3,6,7,10,15},{1,2,3,6,7,11},{1,2,3,6,7,11,12},{1,2,3,6,7,11,12,13},{1,2,3,6,7,11,12,13,14},{1,2,3,6,7,11,12,13,14,15},{1,2,3,6,7,11,12,13,15},{1,2,3,6,7,11,12,14},{1,2,3,6,7,11,12,14,15},{1,2,3,6,7,11,12,15},{1,2,3,6,7,11,13},{1,2,3,6,7,11,13,14},{1,2,3,6,7,11,13,14,15},{1,2,3,6,7,11,13,15},{1,2,3,6,7,11,14},{1,2,3,6,7,11,14,15},{1,2,3,6,7,11,15},{1,2,3,6,7,12},{1,2,3,6,7,12,13},{1,2,3,6,7,12,13,14},{1,2,3,6,7,12,13,14,15},{1,2,3,6,7,12,13,15},{1,2,3,6,7,12,14},{1,2,3,6,7,12,14,15},{1,2,3,6,7,12,15},{1,2,3,6,7,13},{1,2,3,6,7,13,14},{1,2,3,6,7,13,14,15},{1,2,3,6,7,13,15},{1,2,3,6,7,14},{1,2,3,6,7,14,15},{1,2,3,6,7,15},{1,2,3,6,8},{1,2,3,6,8,9},{1,2,3,6,8,9,10},{1,2,3,6,8,9,10,11},{1,2,3,6,8,9,10,11,12},{1,2,3,6,8,9,10,11,12,13},{1,2,3,6,8,9,10,11,12,13,14},{1,2,3,6,8,9,10,11,12,13,14,15},{1,2,3,6,8,9,10,11,12,13,15},{1,2,3,6,8,9,10,11,12,14},{1,2,3,6,8,9,10,11,12,14,15},{1,2,3,6,8,9,10,11,12,15},{1,2,3,6,8,9,10,11,13},{1,2,3,6,8,9,10,11,13,14},{1,2,3,6,8,9,10,11,13,14,15},{1,2,3,6,8,9,10,11,13,15},{1,2,3,6,8,9,10,11,14},{1,2,3,6,8,9,10,11,14,15},{1,2,3,6,8,9,10,11,15},{1,2,3,6,8,9,10,12},{1,2,3,6,8,9,10,12,13},{1,2,3,6,8,9,10,12,13,14},{1,2,3,6,8,9,10,12,13,14,15},{1,2,3,6,8,9,10,12,13,15},{1,2,3,6,8,9,10,12,14},{1,2,3,6,8,9,10,12,14,15},{1,2,3,6,8,9,10,12,15},{1,2,3,6,8,9,10,13},{1,2,3,6,8,9,10,13,14},{1,2,3,6,8,9,10,13,14,15},{1,2,3,6,8,9,10,13,15},{1,2,3,6,8,9,10,14},{1,2,3,6,8,9,10,14,15},{1,2,3,6,8,9,10,15},{1,2,3,6,8,9,11},{1,2,3,6,8,9,11,12},{1,2,3,6,8,9,11,12,13},{1,2,3,6,8,9,11,12,13,14},{1,2,3,6,8,9,11,12,13,14,15},{1,2,3,6,8,9,11,12,13,15},{1,2,3,6,8,9,11,12,14},{1,2,3,6,8,9,11,12,14,15},{1,2,3,6,8,9,11,12,15},{1,2,3,6,8,9,11,13},{1,2,3,6,8,9,11,13,14},{1,2,3,6,8,9,11,13,14,15},{1,2,3,6,8,9,11,13,15},{1,2,3,6,8,9,11,14},{1,2,3,6,8,9,11,14,15},{1,2,3,6,8,9,11,15},{1,2,3,6,8,9,12},{1,2,3,6,8,9,12,13},{1,2,3,6,8,9,12,13,14},{1,2,3,6,8,9,12,13,14,15},{1,2,3,6,8,9,12,13,15},{1,2,3,6,8,9,12,14},{1,2,3,6,8,9,12,14,15},{1,2,3,6,8,9,12,15},{1,2,3,6,8,9,13},{1,2,3,6,8,9,13,14},{1,2,3,6,8,9,13,14,15},{1,2,3,6,8,9,13,15},{1,2,3,6,8,9,14},{1,2,3,6,8,9,14,15},{1,2,3,6,8,9,15},{1,2,3,6,8,10},{1,2,3,6,8,10,11},{1,2,3,6,8,10,11,12},{1,2,3,6,8,10,11,12,13},{1,2,3,6,8,10,11,12,13,14},{1,2,3,6,8,10,11,12,13,14,15},{1,2,3,6,8,10,11,12,13,15},{1,2,3,6,8,10,11,12,14},{1,2,3,6,8,10,11,12,14,15},{1,2,3,6,8,10,11,12,15},{1,2,3,6,8,10,11,13},{1,2,3,6,8,10,11,13,14},{1,2,3,6,8,10,11,13,14,15},{1,2,3,6,8,10,11,13,15},{1,2,3,6,8,10,11,14},{1,2,3,6,8,10,11,14,15},{1,2,3,6,8,10,11,15},{1,2,3,6,8,10,12},{1,2,3,6,8,10,12,13},{1,2,3,6,8,10,12,13,14},{1,2,3,6,8,10,12,13,14,15},{1,2,3,6,8,10,12,13,15},{1,2,3,6,8,10,12,14},{1,2,3,6,8,10,12,14,15},{1,2,3,6,8,10,12,15},{1,2,3,6,8,10,13},{1,2,3,6,8,10,13,14},{1,2,3,6,8,10,13,14,15},{1,2,3,6,8,10,13,15},{1,2,3,6,8,10,14},{1,2,3,6,8,10,14,15},{1,2,3,6,8,10,15},{1,2,3,6,8,11},{1,2,3,6,8,11,12},{1,2,3,6,8,11,12,13},{1,2,3,6,8,11,12,13,14},{1,2,3,6,8,11,12,13,14,15},{1,2,3,6,8,11,12,13,15},{1,2,3,6,8,11,12,14},{1,2,3,6,8,11,12,14,15},{1,2,3,6,8,11,12,15},{1,2,3,6,8,11,13},{1,2,3,6,8,11,13,14},{1,2,3,6,8,11,13,14,15},{1,2,3,6,8,11,13,15},{1,2,3,6,8,11,14},{1,2,3,6,8,11,14,15},{1,2,3,6,8,11,15},{1,2,3,6,8,12},{1,2,3,6,8,12,13},{1,2,3,6,8,12,13,14},{1,2,3,6,8,12,13,14,15},{1,2,3,6,8,12,13,15},{1,2,3,6,8,12,14},{1,2,3,6,8,12,14,15},{1,2,3,6,8,12,15},{1,2,3,6,8,13},{1,2,3,6,8,13,14},{1,2,3,6,8,13,14,15},{1,2,3,6,8,13,15},{1,2,3,6,8,14},{1,2,3,6,8,14,15},{1,2,3,6,8,15},{1,2,3,6,9},{1,2,3,6,9,10},{1,2,3,6,9,10,11},{1,2,3,6,9,10,11,12},{1,2,3,6,9,10,11,12,13},{1,2,3,6,9,10,11,12,13,14},{1,2,3,6,9,10,11,12,13,14,15},{1,2,3,6,9,10,11,12,13,15},{1,2,3,6,9,10,11,12,14},{1,2,3,6,9,10,11,12,14,15},{1,2,3,6,9,10,11,12,15},{1,2,3,6,9,10,11,13},{1,2,3,6,9,10,11,13,14},{1,2,3,6,9,10,11,13,14,15},{1,2,3,6,9,10,11,13,15},{1,2,3,6,9,10,11,14},{1,2,3,6,9,10,11,14,15},{1,2,3,6,9,10,11,15},{1,2,3,6,9,10,12},{1,2,3,6,9,10,12,13},{1,2,3,6,9,10,12,13,14},{1,2,3,6,9,10,12,13,14,15},{1,2,3,6,9,10,12,13,15},{1,2,3,6,9,10,12,14},{1,2,3,6,9,10,12,14,15},{1,2,3,6,9,10,12,15},{1,2,3,6,9,10,13},{1,2,3,6,9,10,13,14},{1,2,3,6,9,10,13,14,15},{1,2,3,6,9,10,13,15},{1,2,3,6,9,10,14},{1,2,3,6,9,10,14,15},{1,2,3,6,9,10,15},{1,2,3,6,9,11},{1,2,3,6,9,11,12},{1,2,3,6,9,11,12,13},{1,2,3,6,9,11,12,13,14},{1,2,3,6,9,11,12,13,14,15},{1,2,3,6,9,11,12,13,15},{1,2,3,6,9,11,12,14},{1,2,3,6,9,11,12,14,15},{1,2,3,6,9,11,12,15},{1,2,3,6,9,11,13},{1,2,3,6,9,11,13,14},{1,2,3,6,9,11,13,14,15},{1,2,3,6,9,11,13,15},{1,2,3,6,9,11,14},{1,2,3,6,9,11,14,15},{1,2,3,6,9,11,15},{1,2,3,6,9,12},{1,2,3,6,9,12,13},{1,2,3,6,9,12,13,14},{1,2,3,6,9,12,13,14,15},{1,2,3,6,9,12,13,15},{1,2,3,6,9,12,14},{1,2,3,6,9,12,14,15},{1,2,3,6,9,12,15},{1,2,3,6,9,13},{1,2,3,6,9,13,14},{1,2,3,6,9,13,14,15},{1,2,3,6,9,13,15},{1,2,3,6,9,14},{1,2,3,6,9,14,15},{1,2,3,6,9,15},{1,2,3,6,10},{1,2,3,6,10,11},{1,2,3,6,10,11,12},{1,2,3,6,10,11,12,13},{1,2,3,6,10,11,12,13,14},{1,2,3,6,10,11,12,13,14,15},{1,2,3,6,10,11,12,13,15},{1,2,3,6,10,11,12,14},{1,2,3,6,10,11,12,14,15},{1,2,3,6,10,11,12,15},{1,2,3,6,10,11,13},{1,2,3,6,10,11,13,14},{1,2,3,6,10,11,13,14,15},{1,2,3,6,10,11,13,15},{1,2,3,6,10,11,14},{1,2,3,6,10,11,14,15},{1,2,3,6,10,11,15},{1,2,3,6,10,12},{1,2,3,6,10,12,13},{1,2,3,6,10,12,13,14},{1,2,3,6,10,12,13,14,15},{1,2,3,6,10,12,13,15},{1,2,3,6,10,12,14},{1,2,3,6,10,12,14,15},{1,2,3,6,10,12,15},{1,2,3,6,10,13},{1,2,3,6,10,13,14},{1,2,3,6,10,13,14,15},{1,2,3,6,10,13,15},{1,2,3,6,10,14},{1,2,3,6,10,14,15},{1,2,3,6,10,15},{1,2,3,6,11},{1,2,3,6,11,12},{1,2,3,6,11,12,13},{1,2,3,6,11,12,13,14},{1,2,3,6,11,12,13,14,15},{1,2,3,6,11,12,13,15},{1,2,3,6,11,12,14},{1,2,3,6,11,12,14,15},{1,2,3,6,11,12,15},{1,2,3,6,11,13},{1,2,3,6,11,13,14},{1,2,3,6,11,13,14,15},{1,2,3,6,11,13,15},{1,2,3,6,11,14},{1,2,3,6,11,14,15},{1,2,3,6,11,15},{1,2,3,6,12},{1,2,3,6,12,13},{1,2,3,6,12,13,14},{1,2,3,6,12,13,14,15},{1,2,3,6,12,13,15},{1,2,3,6,12,14},{1,2,3,6,12,14,15},{1,2,3,6,12,15},{1,2,3,6,13},{1,2,3,6,13,14},{1,2,3,6,13,14,15},{1,2,3,6,13,15},{1,2,3,6,14},{1,2,3,6,14,15},{1,2,3,6,15},{1,2,3,7},{1,2,3,7,8},{1,2,3,7,8,9},{1,2,3,7,8,9,10},{1,2,3,7,8,9,10,11},{1,2,3,7,8,9,10,11,12},{1,2,3,7,8,9,10,11,12,13},{1,2,3,7,8,9,10,11,12,13,14},{1,2,3,7,8,9,10,11,12,13,14,15},{1,2,3,7,8,9,10,11,12,13,15},{1,2,3,7,8,9,10,11,12,14},{1,2,3,7,8,9,10,11,12,14,15},{1,2,3,7,8,9,10,11,12,15},{1,2,3,7,8,9,10,11,13},{1,2,3,7,8,9,10,11,13,14},{1,2,3,7,8,9,10,11,13,14,15},{1,2,3,7,8,9,10,11,13,15},{1,2,3,7,8,9,10,11,14},{1,2,3,7,8,9,10,11,14,15},{1,2,3,7,8,9,10,11,15},{1,2,3,7,8,9,10,12},{1,2,3,7,8,9,10,12,13},{1,2,3,7,8,9,10,12,13,14},{1,2,3,7,8,9,10,12,13,14,15},{1,2,3,7,8,9,10,12,13,15},{1,2,3,7,8,9,10,12,14},{1,2,3,7,8,9,10,12,14,15},{1,2,3,7,8,9,10,12,15},{1,2,3,7,8,9,10,13},{1,2,3,7,8,9,10,13,14},{1,2,3,7,8,9,10,13,14,15},{1,2,3,7,8,9,10,13,15},{1,2,3,7,8,9,10,14},{1,2,3,7,8,9,10,14,15},{1,2,3,7,8,9,10,15},{1,2,3,7,8,9,11},{1,2,3,7,8,9,11,12},{1,2,3,7,8,9,11,12,13},{1,2,3,7,8,9,11,12,13,14},{1,2,3,7,8,9,11,12,13,14,15},{1,2,3,7,8,9,11,12,13,15},{1,2,3,7,8,9,11,12,14},{1,2,3,7,8,9,11,12,14,15},{1,2,3,7,8,9,11,12,15},{1,2,3,7,8,9,11,13},{1,2,3,7,8,9,11,13,14},{1,2,3,7,8,9,11,13,14,15},{1,2,3,7,8,9,11,13,15},{1,2,3,7,8,9,11,14},{1,2,3,7,8,9,11,14,15},{1,2,3,7,8,9,11,15},{1,2,3,7,8,9,12},{1,2,3,7,8,9,12,13},{1,2,3,7,8,9,12,13,14},{1,2,3,7,8,9,12,13,14,15},{1,2,3,7,8,9,12,13,15},{1,2,3,7,8,9,12,14},{1,2,3,7,8,9,12,14,15},{1,2,3,7,8,9,12,15},{1,2,3,7,8,9,13},{1,2,3,7,8,9,13,14},{1,2,3,7,8,9,13,14,15},{1,2,3,7,8,9,13,15},{1,2,3,7,8,9,14},{1,2,3,7,8,9,14,15},{1,2,3,7,8,9,15},{1,2,3,7,8,10},{1,2,3,7,8,10,11},{1,2,3,7,8,10,11,12},{1,2,3,7,8,10,11,12,13},{1,2,3,7,8,10,11,12,13,14},{1,2,3,7,8,10,11,12,13,14,15},{1,2,3,7,8,10,11,12,13,15},{1,2,3,7,8,10,11,12,14},{1,2,3,7,8,10,11,12,14,15},{1,2,3,7,8,10,11,12,15},{1,2,3,7,8,10,11,13},{1,2,3,7,8,10,11,13,14},{1,2,3,7,8,10,11,13,14,15},{1,2,3,7,8,10,11,13,15},{1,2,3,7,8,10,11,14},{1,2,3,7,8,10,11,14,15},{1,2,3,7,8,10,11,15},{1,2,3,7,8,10,12},{1,2,3,7,8,10,12,13},{1,2,3,7,8,10,12,13,14},{1,2,3,7,8,10,12,13,14,15},{1,2,3,7,8,10,12,13,15},{1,2,3,7,8,10,12,14},{1,2,3,7,8,10,12,14,15},{1,2,3,7,8,10,12,15},{1,2,3,7,8,10,13},{1,2,3,7,8,10,13,14},{1,2,3,7,8,10,13,14,15},{1,2,3,7,8,10,13,15},{1,2,3,7,8,10,14},{1,2,3,7,8,10,14,15},{1,2,3,7,8,10,15},{1,2,3,7,8,11},{1,2,3,7,8,11,12},{1,2,3,7,8,11,12,13},{1,2,3,7,8,11,12,13,14},{1,2,3,7,8,11,12,13,14,15},{1,2,3,7,8,11,12,13,15},{1,2,3,7,8,11,12,14},{1,2,3,7,8,11,12,14,15},{1,2,3,7,8,11,12,15},{1,2,3,7,8,11,13},{1,2,3,7,8,11,13,14},{1,2,3,7,8,11,13,14,15},{1,2,3,7,8,11,13,15},{1,2,3,7,8,11,14},{1,2,3,7,8,11,14,15},{1,2,3,7,8,11,15},{1,2,3,7,8,12},{1,2,3,7,8,12,13},{1,2,3,7,8,12,13,14},{1,2,3,7,8,12,13,14,15},{1,2,3,7,8,12,13,15},{1,2,3,7,8,12,14},{1,2,3,7,8,12,14,15},{1,2,3,7,8,12,15},{1,2,3,7,8,13},{1,2,3,7,8,13,14},{1,2,3,7,8,13,14,15},{1,2,3,7,8,13,15},{1,2,3,7,8,14},{1,2,3,7,8,14,15},{1,2,3,7,8,15},{1,2,3,7,9},{1,2,3,7,9,10},{1,2,3,7,9,10,11},{1,2,3,7,9,10,11,12},{1,2,3,7,9,10,11,12,13},{1,2,3,7,9,10,11,12,13,14},{1,2,3,7,9,10,11,12,13,14,15},{1,2,3,7,9,10,11,12,13,15},{1,2,3,7,9,10,11,12,14},{1,2,3,7,9,10,11,12,14,15},{1,2,3,7,9,10,11,12,15},{1,2,3,7,9,10,11,13},{1,2,3,7,9,10,11,13,14},{1,2,3,7,9,10,11,13,14,15},{1,2,3,7,9,10,11,13,15},{1,2,3,7,9,10,11,14},{1,2,3,7,9,10,11,14,15},{1,2,3,7,9,10,11,15},{1,2,3,7,9,10,12},{1,2,3,7,9,10,12,13},{1,2,3,7,9,10,12,13,14},{1,2,3,7,9,10,12,13,14,15},{1,2,3,7,9,10,12,13,15},{1,2,3,7,9,10,12,14},{1,2,3,7,9,10,12,14,15},{1,2,3,7,9,10,12,15},{1,2,3,7,9,10,13},{1,2,3,7,9,10,13,14},{1,2,3,7,9,10,13,14,15},{1,2,3,7,9,10,13,15},{1,2,3,7,9,10,14},{1,2,3,7,9,10,14,15},{1,2,3,7,9,10,15},{1,2,3,7,9,11},{1,2,3,7,9,11,12},{1,2,3,7,9,11,12,13},{1,2,3,7,9,11,12,13,14},{1,2,3,7,9,11,12,13,14,15},{1,2,3,7,9,11,12,13,15},{1,2,3,7,9,11,12,14},{1,2,3,7,9,11,12,14,15},{1,2,3,7,9,11,12,15},{1,2,3,7,9,11,13},{1,2,3,7,9,11,13,14},{1,2,3,7,9,11,13,14,15},{1,2,3,7,9,11,13,15},{1,2,3,7,9,11,14},{1,2,3,7,9,11,14,15},{1,2,3,7,9,11,15},{1,2,3,7,9,12},{1,2,3,7,9,12,13},{1,2,3,7,9,12,13,14},{1,2,3,7,9,12,13,14,15},{1,2,3,7,9,12,13,15},{1,2,3,7,9,12,14},{1,2,3,7,9,12,14,15},{1,2,3,7,9,12,15},{1,2,3,7,9,13},{1,2,3,7,9,13,14},{1,2,3,7,9,13,14,15},{1,2,3,7,9,13,15},{1,2,3,7,9,14},{1,2,3,7,9,14,15},{1,2,3,7,9,15},{1,2,3,7,10},{1,2,3,7,10,11},{1,2,3,7,10,11,12},{1,2,3,7,10,11,12,13},{1,2,3,7,10,11,12,13,14},{1,2,3,7,10,11,12,13,14,15},{1,2,3,7,10,11,12,13,15},{1,2,3,7,10,11,12,14},{1,2,3,7,10,11,12,14,15},{1,2,3,7,10,11,12,15},{1,2,3,7,10,11,13},{1,2,3,7,10,11,13,14},{1,2,3,7,10,11,13,14,15},{1,2,3,7,10,11,13,15},{1,2,3,7,10,11,14},{1,2,3,7,10,11,14,15},{1,2,3,7,10,11,15},{1,2,3,7,10,12},{1,2,3,7,10,12,13},{1,2,3,7,10,12,13,14},{1,2,3,7,10,12,13,14,15},{1,2,3,7,10,12,13,15},{1,2,3,7,10,12,14},{1,2,3,7,10,12,14,15},{1,2,3,7,10,12,15},{1,2,3,7,10,13},{1,2,3,7,10,13,14},{1,2,3,7,10,13,14,15},{1,2,3,7,10,13,15},{1,2,3,7,10,14},{1,2,3,7,10,14,15},{1,2,3,7,10,15},{1,2,3,7,11},{1,2,3,7,11,12},{1,2,3,7,11,12,13},{1,2,3,7,11,12,13,14},{1,2,3,7,11,12,13,14,15},{1,2,3,7,11,12,13,15},{1,2,3,7,11,12,14},{1,2,3,7,11,12,14,15},{1,2,3,7,11,12,15},{1,2,3,7,11,13},{1,2,3,7,11,13,14},{1,2,3,7,11,13,14,15},{1,2,3,7,11,13,15},{1,2,3,7,11,14},{1,2,3,7,11,14,15},{1,2,3,7,11,15},{1,2,3,7,12},{1,2,3,7,12,13},{1,2,3,7,12,13,14},{1,2,3,7,12,13,14,15},{1,2,3,7,12,13,15},{1,2,3,7,12,14},{1,2,3,7,12,14,15},{1,2,3,7,12,15},{1,2,3,7,13},{1,2,3,7,13,14},{1,2,3,7,13,14,15},{1,2,3,7,13,15},{1,2,3,7,14},{1,2,3,7,14,15},{1,2,3,7,15},{1,2,3,8},{1,2,3,8,9},{1,2,3,8,9,10},{1,2,3,8,9,10,11},{1,2,3,8,9,10,11,12},{1,2,3,8,9,10,11,12,13},{1,2,3,8,9,10,11,12,13,14},{1,2,3,8,9,10,11,12,13,14,15},{1,2,3,8,9,10,11,12,13,15},{1,2,3,8,9,10,11,12,14},{1,2,3,8,9,10,11,12,14,15},{1,2,3,8,9,10,11,12,15},{1,2,3,8,9,10,11,13},{1,2,3,8,9,10,11,13,14},{1,2,3,8,9,10,11,13,14,15},{1,2,3,8,9,10,11,13,15},{1,2,3,8,9,10,11,14},{1,2,3,8,9,10,11,14,15},{1,2,3,8,9,10,11,15},{1,2,3,8,9,10,12},{1,2,3,8,9,10,12,13},{1,2,3,8,9,10,12,13,14},{1,2,3,8,9,10,12,13,14,15},{1,2,3,8,9,10,12,13,15},{1,2,3,8,9,10,12,14},{1,2,3,8,9,10,12,14,15},{1,2,3,8,9,10,12,15},{1,2,3,8,9,10,13},{1,2,3,8,9,10,13,14},{1,2,3,8,9,10,13,14,15},{1,2,3,8,9,10,13,15},{1,2,3,8,9,10,14},{1,2,3,8,9,10,14,15},{1,2,3,8,9,10,15},{1,2,3,8,9,11},{1,2,3,8,9,11,12},{1,2,3,8,9,11,12,13},{1,2,3,8,9,11,12,13,14},{1,2,3,8,9,11,12,13,14,15},{1,2,3,8,9,11,12,13,15},{1,2,3,8,9,11,12,14},{1,2,3,8,9,11,12,14,15},{1,2,3,8,9,11,12,15},{1,2,3,8,9,11,13},{1,2,3,8,9,11,13,14},{1,2,3,8,9,11,13,14,15},{1,2,3,8,9,11,13,15},{1,2,3,8,9,11,14},{1,2,3,8,9,11,14,15},{1,2,3,8,9,11,15},{1,2,3,8,9,12},{1,2,3,8,9,12,13},{1,2,3,8,9,12,13,14},{1,2,3,8,9,12,13,14,15},{1,2,3,8,9,12,13,15},{1,2,3,8,9,12,14},{1,2,3,8,9,12,14,15},{1,2,3,8,9,12,15},{1,2,3,8,9,13},{1,2,3,8,9,13,14},{1,2,3,8,9,13,14,15},{1,2,3,8,9,13,15},{1,2,3,8,9,14},{1,2,3,8,9,14,15},{1,2,3,8,9,15},{1,2,3,8,10},{1,2,3,8,10,11},{1,2,3,8,10,11,12},{1,2,3,8,10,11,12,13},{1,2,3,8,10,11,12,13,14},{1,2,3,8,10,11,12,13,14,15},{1,2,3,8,10,11,12,13,15},{1,2,3,8,10,11,12,14},{1,2,3,8,10,11,12,14,15},{1,2,3,8,10,11,12,15},{1,2,3,8,10,11,13},{1,2,3,8,10,11,13,14},{1,2,3,8,10,11,13,14,15},{1,2,3,8,10,11,13,15},{1,2,3,8,10,11,14},{1,2,3,8,10,11,14,15},{1,2,3,8,10,11,15},{1,2,3,8,10,12},{1,2,3,8,10,12,13},{1,2,3,8,10,12,13,14},{1,2,3,8,10,12,13,14,15},{1,2,3,8,10,12,13,15},{1,2,3,8,10,12,14},{1,2,3,8,10,12,14,15},{1,2,3,8,10,12,15},{1,2,3,8,10,13},{1,2,3,8,10,13,14},{1,2,3,8,10,13,14,15},{1,2,3,8,10,13,15},{1,2,3,8,10,14},{1,2,3,8,10,14,15},{1,2,3,8,10,15},{1,2,3,8,11},{1,2,3,8,11,12},{1,2,3,8,11,12,13},{1,2,3,8,11,12,13,14},{1,2,3,8,11,12,13,14,15},{1,2,3,8,11,12,13,15},{1,2,3,8,11,12,14},{1,2,3,8,11,12,14,15},{1,2,3,8,11,12,15},{1,2,3,8,11,13},{1,2,3,8,11,13,14},{1,2,3,8,11,13,14,15},{1,2,3,8,11,13,15},{1,2,3,8,11,14},{1,2,3,8,11,14,15},{1,2,3,8,11,15},{1,2,3,8,12},{1,2,3,8,12,13},{1,2,3,8,12,13,14},{1,2,3,8,12,13,14,15},{1,2,3,8,12,13,15},{1,2,3,8,12,14},{1,2,3,8,12,14,15},{1,2,3,8,12,15},{1,2,3,8,13},{1,2,3,8,13,14},{1,2,3,8,13,14,15},{1,2,3,8,13,15},{1,2,3,8,14},{1,2,3,8,14,15},{1,2,3,8,15},{1,2,3,9},{1,2,3,9,10},{1,2,3,9,10,11},{1,2,3,9,10,11,12},{1,2,3,9,10,11,12,13},{1,2,3,9,10,11,12,13,14},{1,2,3,9,10,11,12,13,14,15},{1,2,3,9,10,11,12,13,15},{1,2,3,9,10,11,12,14},{1,2,3,9,10,11,12,14,15},{1,2,3,9,10,11,12,15},{1,2,3,9,10,11,13},{1,2,3,9,10,11,13,14},{1,2,3,9,10,11,13,14,15},{1,2,3,9,10,11,13,15},{1,2,3,9,10,11,14},{1,2,3,9,10,11,14,15},{1,2,3,9,10,11,15},{1,2,3,9,10,12},{1,2,3,9,10,12,13},{1,2,3,9,10,12,13,14},{1,2,3,9,10,12,13,14,15},{1,2,3,9,10,12,13,15},{1,2,3,9,10,12,14},{1,2,3,9,10,12,14,15},{1,2,3,9,10,12,15},{1,2,3,9,10,13},{1,2,3,9,10,13,14},{1,2,3,9,10,13,14,15},{1,2,3,9,10,13,15},{1,2,3,9,10,14},{1,2,3,9,10,14,15},{1,2,3,9,10,15},{1,2,3,9,11},{1,2,3,9,11,12},{1,2,3,9,11,12,13},{1,2,3,9,11,12,13,14},{1,2,3,9,11,12,13,14,15},{1,2,3,9,11,12,13,15},{1,2,3,9,11,12,14},{1,2,3,9,11,12,14,15},{1,2,3,9,11,12,15},{1,2,3,9,11,13},{1,2,3,9,11,13,14},{1,2,3,9,11,13,14,15},{1,2,3,9,11,13,15},{1,2,3,9,11,14},{1,2,3,9,11,14,15},{1,2,3,9,11,15},{1,2,3,9,12},{1,2,3,9,12,13},{1,2,3,9,12,13,14},{1,2,3,9,12,13,14,15},{1,2,3,9,12,13,15},{1,2,3,9,12,14},{1,2,3,9,12,14,15},{1,2,3,9,12,15},{1,2,3,9,13},{1,2,3,9,13,14},{1,2,3,9,13,14,15},{1,2,3,9,13,15},{1,2,3,9,14},{1,2,3,9,14,15},{1,2,3,9,15},{1,2,3,10},{1,2,3,10,11},{1,2,3,10,11,12},{1,2,3,10,11,12,13},{1,2,3,10,11,12,13,14},{1,2,3,10,11,12,13,14,15},{1,2,3,10,11,12,13,15},{1,2,3,10,11,12,14},{1,2,3,10,11,12,14,15},{1,2,3,10,11,12,15},{1,2,3,10,11,13},{1,2,3,10,11,13,14},{1,2,3,10,11,13,14,15},{1,2,3,10,11,13,15},{1,2,3,10,11,14},{1,2,3,10,11,14,15},{1,2,3,10,11,15},{1,2,3,10,12},{1,2,3,10,12,13},{1,2,3,10,12,13,14},{1,2,3,10,12,13,14,15},{1,2,3,10,12,13,15},{1,2,3,10,12,14},{1,2,3,10,12,14,15},{1,2,3,10,12,15},{1,2,3,10,13},{1,2,3,10,13,14},{1,2,3,10,13,14,15},{1,2,3,10,13,15},{1,2,3,10,14},{1,2,3,10,14,15},{1,2,3,10,15},{1,2,3,11},{1,2,3,11,12},{1,2,3,11,12,13},{1,2,3,11,12,13,14},{1,2,3,11,12,13,14,15},{1,2,3,11,12,13,15},{1,2,3,11,12,14},{1,2,3,11,12,14,15},{1,2,3,11,12,15},{1,2,3,11,13},{1,2,3,11,13,14},{1,2,3,11,13,14,15},{1,2,3,11,13,15},{1,2,3,11,14},{1,2,3,11,14,15},{1,2,3,11,15},{1,2,3,12},{1,2,3,12,13},{1,2,3,12,13,14},{1,2,3,12,13,14,15},{1,2,3,12,13,15},{1,2,3,12,14},{1,2,3,12,14,15},{1,2,3,12,15},{1,2,3,13},{1,2,3,13,14},{1,2,3,13,14,15},{1,2,3,13,15},{1,2,3,14},{1,2,3,14,15},{1,2,3,15},{1,2,4},{1,2,4,5},{1,2,4,5,6},{1,2,4,5,6,7},{1,2,4,5,6,7,8},{1,2,4,5,6,7,8,9},{1,2,4,5,6,7,8,9,10},{1,2,4,5,6,7,8,9,10,11},{1,2,4,5,6,7,8,9,10,11,12},{1,2,4,5,6,7,8,9,10,11,12,13},{1,2,4,5,6,7,8,9,10,11,12,13,14},{1,2,4,5,6,7,8,9,10,11,12,13,14,15},{1,2,4,5,6,7,8,9,10,11,12,13,15},{1,2,4,5,6,7,8,9,10,11,12,14},{1,2,4,5,6,7,8,9,10,11,12,14,15},{1,2,4,5,6,7,8,9,10,11,12,15},{1,2,4,5,6,7,8,9,10,11,13},{1,2,4,5,6,7,8,9,10,11,13,14},{1,2,4,5,6,7,8,9,10,11,13,14,15},{1,2,4,5,6,7,8,9,10,11,13,15},{1,2,4,5,6,7,8,9,10,11,14},{1,2,4,5,6,7,8,9,10,11,14,15},{1,2,4,5,6,7,8,9,10,11,15},{1,2,4,5,6,7,8,9,10,12},{1,2,4,5,6,7,8,9,10,12,13},{1,2,4,5,6,7,8,9,10,12,13,14},{1,2,4,5,6,7,8,9,10,12,13,14,15},{1,2,4,5,6,7,8,9,10,12,13,15},{1,2,4,5,6,7,8,9,10,12,14},{1,2,4,5,6,7,8,9,10,12,14,15},{1,2,4,5,6,7,8,9,10,12,15},{1,2,4,5,6,7,8,9,10,13},{1,2,4,5,6,7,8,9,10,13,14},{1,2,4,5,6,7,8,9,10,13,14,15},{1,2,4,5,6,7,8,9,10,13,15},{1,2,4,5,6,7,8,9,10,14},{1,2,4,5,6,7,8,9,10,14,15},{1,2,4,5,6,7,8,9,10,15},{1,2,4,5,6,7,8,9,11},{1,2,4,5,6,7,8,9,11,12},{1,2,4,5,6,7,8,9,11,12,13},{1,2,4,5,6,7,8,9,11,12,13,14},{1,2,4,5,6,7,8,9,11,12,13,14,15},{1,2,4,5,6,7,8,9,11,12,13,15},{1,2,4,5,6,7,8,9,11,12,14},{1,2,4,5,6,7,8,9,11,12,14,15},{1,2,4,5,6,7,8,9,11,12,15},{1,2,4,5,6,7,8,9,11,13},{1,2,4,5,6,7,8,9,11,13,14},{1,2,4,5,6,7,8,9,11,13,14,15},{1,2,4,5,6,7,8,9,11,13,15},{1,2,4,5,6,7,8,9,11,14},{1,2,4,5,6,7,8,9,11,14,15},{1,2,4,5,6,7,8,9,11,15},{1,2,4,5,6,7,8,9,12},{1,2,4,5,6,7,8,9,12,13},{1,2,4,5,6,7,8,9,12,13,14},{1,2,4,5,6,7,8,9,12,13,14,15},{1,2,4,5,6,7,8,9,12,13,15},{1,2,4,5,6,7,8,9,12,14},{1,2,4,5,6,7,8,9,12,14,15},{1,2,4,5,6,7,8,9,12,15},{1,2,4,5,6,7,8,9,13},{1,2,4,5,6,7,8,9,13,14},{1,2,4,5,6,7,8,9,13,14,15},{1,2,4,5,6,7,8,9,13,15},{1,2,4,5,6,7,8,9,14},{1,2,4,5,6,7,8,9,14,15},{1,2,4,5,6,7,8,9,15},{1,2,4,5,6,7,8,10},{1,2,4,5,6,7,8,10,11},{1,2,4,5,6,7,8,10,11,12},{1,2,4,5,6,7,8,10,11,12,13},{1,2,4,5,6,7,8,10,11,12,13,14},{1,2,4,5,6,7,8,10,11,12,13,14,15},{1,2,4,5,6,7,8,10,11,12,13,15},{1,2,4,5,6,7,8,10,11,12,14},{1,2,4,5,6,7,8,10,11,12,14,15},{1,2,4,5,6,7,8,10,11,12,15},{1,2,4,5,6,7,8,10,11,13},{1,2,4,5,6,7,8,10,11,13,14},{1,2,4,5,6,7,8,10,11,13,14,15},{1,2,4,5,6,7,8,10,11,13,15},{1,2,4,5,6,7,8,10,11,14},{1,2,4,5,6,7,8,10,11,14,15},{1,2,4,5,6,7,8,10,11,15},{1,2,4,5,6,7,8,10,12},{1,2,4,5,6,7,8,10,12,13},{1,2,4,5,6,7,8,10,12,13,14},{1,2,4,5,6,7,8,10,12,13,14,15},{1,2,4,5,6,7,8,10,12,13,15},{1,2,4,5,6,7,8,10,12,14},{1,2,4,5,6,7,8,10,12,14,15},{1,2,4,5,6,7,8,10,12,15},{1,2,4,5,6,7,8,10,13},{1,2,4,5,6,7,8,10,13,14},{1,2,4,5,6,7,8,10,13,14,15},{1,2,4,5,6,7,8,10,13,15},{1,2,4,5,6,7,8,10,14},{1,2,4,5,6,7,8,10,14,15},{1,2,4,5,6,7,8,10,15},{1,2,4,5,6,7,8,11},{1,2,4,5,6,7,8,11,12},{1,2,4,5,6,7,8,11,12,13},{1,2,4,5,6,7,8,11,12,13,14},{1,2,4,5,6,7,8,11,12,13,14,15},{1,2,4,5,6,7,8,11,12,13,15},{1,2,4,5,6,7,8,11,12,14},{1,2,4,5,6,7,8,11,12,14,15},{1,2,4,5,6,7,8,11,12,15},{1,2,4,5,6,7,8,11,13},{1,2,4,5,6,7,8,11,13,14},{1,2,4,5,6,7,8,11,13,14,15},{1,2,4,5,6,7,8,11,13,15},{1,2,4,5,6,7,8,11,14},{1,2,4,5,6,7,8,11,14,15},{1,2,4,5,6,7,8,11,15},{1,2,4,5,6,7,8,12},{1,2,4,5,6,7,8,12,13},{1,2,4,5,6,7,8,12,13,14},{1,2,4,5,6,7,8,12,13,14,15},{1,2,4,5,6,7,8,12,13,15},{1,2,4,5,6,7,8,12,14},{1,2,4,5,6,7,8,12,14,15},{1,2,4,5,6,7,8,12,15},{1,2,4,5,6,7,8,13},{1,2,4,5,6,7,8,13,14},{1,2,4,5,6,7,8,13,14,15},{1,2,4,5,6,7,8,13,15},{1,2,4,5,6,7,8,14},{1,2,4,5,6,7,8,14,15},{1,2,4,5,6,7,8,15},{1,2,4,5,6,7,9},{1,2,4,5,6,7,9,10},{1,2,4,5,6,7,9,10,11},{1,2,4,5,6,7,9,10,11,12},{1,2,4,5,6,7,9,10,11,12,13},{1,2,4,5,6,7,9,10,11,12,13,14},{1,2,4,5,6,7,9,10,11,12,13,14,15},{1,2,4,5,6,7,9,10,11,12,13,15},{1,2,4,5,6,7,9,10,11,12,14},{1,2,4,5,6,7,9,10,11,12,14,15},{1,2,4,5,6,7,9,10,11,12,15},{1,2,4,5,6,7,9,10,11,13},{1,2,4,5,6,7,9,10,11,13,14},{1,2,4,5,6,7,9,10,11,13,14,15},{1,2,4,5,6,7,9,10,11,13,15},{1,2,4,5,6,7,9,10,11,14},{1,2,4,5,6,7,9,10,11,14,15},{1,2,4,5,6,7,9,10,11,15},{1,2,4,5,6,7,9,10,12},{1,2,4,5,6,7,9,10,12,13},{1,2,4,5,6,7,9,10,12,13,14},{1,2,4,5,6,7,9,10,12,13,14,15},{1,2,4,5,6,7,9,10,12,13,15},{1,2,4,5,6,7,9,10,12,14},{1,2,4,5,6,7,9,10,12,14,15},{1,2,4,5,6,7,9,10,12,15},{1,2,4,5,6,7,9,10,13},{1,2,4,5,6,7,9,10,13,14},{1,2,4,5,6,7,9,10,13,14,15},{1,2,4,5,6,7,9,10,13,15},{1,2,4,5,6,7,9,10,14},{1,2,4,5,6,7,9,10,14,15},{1,2,4,5,6,7,9,10,15},{1,2,4,5,6,7,9,11},{1,2,4,5,6,7,9,11,12},{1,2,4,5,6,7,9,11,12,13},{1,2,4,5,6,7,9,11,12,13,14},{1,2,4,5,6,7,9,11,12,13,14,15},{1,2,4,5,6,7,9,11,12,13,15},{1,2,4,5,6,7,9,11,12,14},{1,2,4,5,6,7,9,11,12,14,15},{1,2,4,5,6,7,9,11,12,15},{1,2,4,5,6,7,9,11,13},{1,2,4,5,6,7,9,11,13,14},{1,2,4,5,6,7,9,11,13,14,15},{1,2,4,5,6,7,9,11,13,15},{1,2,4,5,6,7,9,11,14},{1,2,4,5,6,7,9,11,14,15},{1,2,4,5,6,7,9,11,15},{1,2,4,5,6,7,9,12},{1,2,4,5,6,7,9,12,13},{1,2,4,5,6,7,9,12,13,14},{1,2,4,5,6,7,9,12,13,14,15},{1,2,4,5,6,7,9,12,13,15},{1,2,4,5,6,7,9,12,14},{1,2,4,5,6,7,9,12,14,15},{1,2,4,5,6,7,9,12,15},{1,2,4,5,6,7,9,13},{1,2,4,5,6,7,9,13,14},{1,2,4,5,6,7,9,13,14,15},{1,2,4,5,6,7,9,13,15},{1,2,4,5,6,7,9,14},{1,2,4,5,6,7,9,14,15},{1,2,4,5,6,7,9,15},{1,2,4,5,6,7,10},{1,2,4,5,6,7,10,11},{1,2,4,5,6,7,10,11,12},{1,2,4,5,6,7,10,11,12,13},{1,2,4,5,6,7,10,11,12,13,14},{1,2,4,5,6,7,10,11,12,13,14,15},{1,2,4,5,6,7,10,11,12,13,15},{1,2,4,5,6,7,10,11,12,14},{1,2,4,5,6,7,10,11,12,14,15},{1,2,4,5,6,7,10,11,12,15},{1,2,4,5,6,7,10,11,13},{1,2,4,5,6,7,10,11,13,14},{1,2,4,5,6,7,10,11,13,14,15},{1,2,4,5,6,7,10,11,13,15},{1,2,4,5,6,7,10,11,14},{1,2,4,5,6,7,10,11,14,15},{1,2,4,5,6,7,10,11,15},{1,2,4,5,6,7,10,12},{1,2,4,5,6,7,10,12,13},{1,2,4,5,6,7,10,12,13,14},{1,2,4,5,6,7,10,12,13,14,15},{1,2,4,5,6,7,10,12,13,15},{1,2,4,5,6,7,10,12,14},{1,2,4,5,6,7,10,12,14,15},{1,2,4,5,6,7,10,12,15},{1,2,4,5,6,7,10,13},{1,2,4,5,6,7,10,13,14},{1,2,4,5,6,7,10,13,14,15},{1,2,4,5,6,7,10,13,15},{1,2,4,5,6,7,10,14},{1,2,4,5,6,7,10,14,15},{1,2,4,5,6,7,10,15},{1,2,4,5,6,7,11},{1,2,4,5,6,7,11,12},{1,2,4,5,6,7,11,12,13},{1,2,4,5,6,7,11,12,13,14},{1,2,4,5,6,7,11,12,13,14,15},{1,2,4,5,6,7,11,12,13,15},{1,2,4,5,6,7,11,12,14},{1,2,4,5,6,7,11,12,14,15},{1,2,4,5,6,7,11,12,15},{1,2,4,5,6,7,11,13},{1,2,4,5,6,7,11,13,14},{1,2,4,5,6,7,11,13,14,15},{1,2,4,5,6,7,11,13,15},{1,2,4,5,6,7,11,14},{1,2,4,5,6,7,11,14,15},{1,2,4,5,6,7,11,15},{1,2,4,5,6,7,12},{1,2,4,5,6,7,12,13},{1,2,4,5,6,7,12,13,14},{1,2,4,5,6,7,12,13,14,15},{1,2,4,5,6,7,12,13,15},{1,2,4,5,6,7,12,14},{1,2,4,5,6,7,12,14,15},{1,2,4,5,6,7,12,15},{1,2,4,5,6,7,13},{1,2,4,5,6,7,13,14},{1,2,4,5,6,7,13,14,15},{1,2,4,5,6,7,13,15},{1,2,4,5,6,7,14},{1,2,4,5,6,7,14,15},{1,2,4,5,6,7,15},{1,2,4,5,6,8},{1,2,4,5,6,8,9},{1,2,4,5,6,8,9,10},{1,2,4,5,6,8,9,10,11},{1,2,4,5,6,8,9,10,11,12},{1,2,4,5,6,8,9,10,11,12,13},{1,2,4,5,6,8,9,10,11,12,13,14},{1,2,4,5,6,8,9,10,11,12,13,14,15},{1,2,4,5,6,8,9,10,11,12,13,15},{1,2,4,5,6,8,9,10,11,12,14},{1,2,4,5,6,8,9,10,11,12,14,15},{1,2,4,5,6,8,9,10,11,12,15},{1,2,4,5,6,8,9,10,11,13},{1,2,4,5,6,8,9,10,11,13,14},{1,2,4,5,6,8,9,10,11,13,14,15},{1,2,4,5,6,8,9,10,11,13,15},{1,2,4,5,6,8,9,10,11,14},{1,2,4,5,6,8,9,10,11,14,15},{1,2,4,5,6,8,9,10,11,15},{1,2,4,5,6,8,9,10,12},{1,2,4,5,6,8,9,10,12,13},{1,2,4,5,6,8,9,10,12,13,14},{1,2,4,5,6,8,9,10,12,13,14,15},{1,2,4,5,6,8,9,10,12,13,15},{1,2,4,5,6,8,9,10,12,14},{1,2,4,5,6,8,9,10,12,14,15},{1,2,4,5,6,8,9,10,12,15},{1,2,4,5,6,8,9,10,13},{1,2,4,5,6,8,9,10,13,14},{1,2,4,5,6,8,9,10,13,14,15},{1,2,4,5,6,8,9,10,13,15},{1,2,4,5,6,8,9,10,14},{1,2,4,5,6,8,9,10,14,15},{1,2,4,5,6,8,9,10,15},{1,2,4,5,6,8,9,11},{1,2,4,5,6,8,9,11,12},{1,2,4,5,6,8,9,11,12,13},{1,2,4,5,6,8,9,11,12,13,14},{1,2,4,5,6,8,9,11,12,13,14,15},{1,2,4,5,6,8,9,11,12,13,15},{1,2,4,5,6,8,9,11,12,14},{1,2,4,5,6,8,9,11,12,14,15},{1,2,4,5,6,8,9,11,12,15},{1,2,4,5,6,8,9,11,13},{1,2,4,5,6,8,9,11,13,14},{1,2,4,5,6,8,9,11,13,14,15},{1,2,4,5,6,8,9,11,13,15},{1,2,4,5,6,8,9,11,14},{1,2,4,5,6,8,9,11,14,15},{1,2,4,5,6,8,9,11,15},{1,2,4,5,6,8,9,12},{1,2,4,5,6,8,9,12,13},{1,2,4,5,6,8,9,12,13,14},{1,2,4,5,6,8,9,12,13,14,15},{1,2,4,5,6,8,9,12,13,15},{1,2,4,5,6,8,9,12,14},{1,2,4,5,6,8,9,12,14,15},{1,2,4,5,6,8,9,12,15},{1,2,4,5,6,8,9,13},{1,2,4,5,6,8,9,13,14},{1,2,4,5,6,8,9,13,14,15},{1,2,4,5,6,8,9,13,15},{1,2,4,5,6,8,9,14},{1,2,4,5,6,8,9,14,15},{1,2,4,5,6,8,9,15},{1,2,4,5,6,8,10},{1,2,4,5,6,8,10,11},{1,2,4,5,6,8,10,11,12},{1,2,4,5,6,8,10,11,12,13},{1,2,4,5,6,8,10,11,12,13,14},{1,2,4,5,6,8,10,11,12,13,14,15},{1,2,4,5,6,8,10,11,12,13,15},{1,2,4,5,6,8,10,11,12,14},{1,2,4,5,6,8,10,11,12,14,15},{1,2,4,5,6,8,10,11,12,15},{1,2,4,5,6,8,10,11,13},{1,2,4,5,6,8,10,11,13,14},{1,2,4,5,6,8,10,11,13,14,15},{1,2,4,5,6,8,10,11,13,15},{1,2,4,5,6,8,10,11,14},{1,2,4,5,6,8,10,11,14,15},{1,2,4,5,6,8,10,11,15},{1,2,4,5,6,8,10,12},{1,2,4,5,6,8,10,12,13},{1,2,4,5,6,8,10,12,13,14},{1,2,4,5,6,8,10,12,13,14,15},{1,2,4,5,6,8,10,12,13,15},{1,2,4,5,6,8,10,12,14},{1,2,4,5,6,8,10,12,14,15},{1,2,4,5,6,8,10,12,15},{1,2,4,5,6,8,10,13},{1,2,4,5,6,8,10,13,14},{1,2,4,5,6,8,10,13,14,15},{1,2,4,5,6,8,10,13,15},{1,2,4,5,6,8,10,14},{1,2,4,5,6,8,10,14,15},{1,2,4,5,6,8,10,15},{1,2,4,5,6,8,11},{1,2,4,5,6,8,11,12},{1,2,4,5,6,8,11,12,13},{1,2,4,5,6,8,11,12,13,14},{1,2,4,5,6,8,11,12,13,14,15},{1,2,4,5,6,8,11,12,13,15},{1,2,4,5,6,8,11,12,14},{1,2,4,5,6,8,11,12,14,15},{1,2,4,5,6,8,11,12,15},{1,2,4,5,6,8,11,13},{1,2,4,5,6,8,11,13,14},{1,2,4,5,6,8,11,13,14,15},{1,2,4,5,6,8,11,13,15},{1,2,4,5,6,8,11,14},{1,2,4,5,6,8,11,14,15},{1,2,4,5,6,8,11,15},{1,2,4,5,6,8,12},{1,2,4,5,6,8,12,13},{1,2,4,5,6,8,12,13,14},{1,2,4,5,6,8,12,13,14,15},{1,2,4,5,6,8,12,13,15},{1,2,4,5,6,8,12,14},{1,2,4,5,6,8,12,14,15},{1,2,4,5,6,8,12,15},{1,2,4,5,6,8,13},{1,2,4,5,6,8,13,14},{1,2,4,5,6,8,13,14,15},{1,2,4,5,6,8,13,15},{1,2,4,5,6,8,14},{1,2,4,5,6,8,14,15},{1,2,4,5,6,8,15},{1,2,4,5,6,9},{1,2,4,5,6,9,10},{1,2,4,5,6,9,10,11},{1,2,4,5,6,9,10,11,12},{1,2,4,5,6,9,10,11,12,13},{1,2,4,5,6,9,10,11,12,13,14},{1,2,4,5,6,9,10,11,12,13,14,15},{1,2,4,5,6,9,10,11,12,13,15},{1,2,4,5,6,9,10,11,12,14},{1,2,4,5,6,9,10,11,12,14,15},{1,2,4,5,6,9,10,11,12,15},{1,2,4,5,6,9,10,11,13},{1,2,4,5,6,9,10,11,13,14},{1,2,4,5,6,9,10,11,13,14,15},{1,2,4,5,6,9,10,11,13,15},{1,2,4,5,6,9,10,11,14},{1,2,4,5,6,9,10,11,14,15},{1,2,4,5,6,9,10,11,15},{1,2,4,5,6,9,10,12},{1,2,4,5,6,9,10,12,13},{1,2,4,5,6,9,10,12,13,14},{1,2,4,5,6,9,10,12,13,14,15},{1,2,4,5,6,9,10,12,13,15},{1,2,4,5,6,9,10,12,14},{1,2,4,5,6,9,10,12,14,15},{1,2,4,5,6,9,10,12,15},{1,2,4,5,6,9,10,13},{1,2,4,5,6,9,10,13,14},{1,2,4,5,6,9,10,13,14,15},{1,2,4,5,6,9,10,13,15},{1,2,4,5,6,9,10,14},{1,2,4,5,6,9,10,14,15},{1,2,4,5,6,9,10,15},{1,2,4,5,6,9,11},{1,2,4,5,6,9,11,12},{1,2,4,5,6,9,11,12,13},{1,2,4,5,6,9,11,12,13,14},{1,2,4,5,6,9,11,12,13,14,15},{1,2,4,5,6,9,11,12,13,15},{1,2,4,5,6,9,11,12,14},{1,2,4,5,6,9,11,12,14,15},{1,2,4,5,6,9,11,12,15},{1,2,4,5,6,9,11,13},{1,2,4,5,6,9,11,13,14},{1,2,4,5,6,9,11,13,14,15},{1,2,4,5,6,9,11,13,15},{1,2,4,5,6,9,11,14},{1,2,4,5,6,9,11,14,15},{1,2,4,5,6,9,11,15},{1,2,4,5,6,9,12},{1,2,4,5,6,9,12,13},{1,2,4,5,6,9,12,13,14},{1,2,4,5,6,9,12,13,14,15},{1,2,4,5,6,9,12,13,15},{1,2,4,5,6,9,12,14},{1,2,4,5,6,9,12,14,15},{1,2,4,5,6,9,12,15},{1,2,4,5,6,9,13},{1,2,4,5,6,9,13,14},{1,2,4,5,6,9,13,14,15},{1,2,4,5,6,9,13,15},{1,2,4,5,6,9,14},{1,2,4,5,6,9,14,15},{1,2,4,5,6,9,15},{1,2,4,5,6,10},{1,2,4,5,6,10,11},{1,2,4,5,6,10,11,12},{1,2,4,5,6,10,11,12,13},{1,2,4,5,6,10,11,12,13,14},{1,2,4,5,6,10,11,12,13,14,15},{1,2,4,5,6,10,11,12,13,15},{1,2,4,5,6,10,11,12,14},{1,2,4,5,6,10,11,12,14,15},{1,2,4,5,6,10,11,12,15},{1,2,4,5,6,10,11,13},{1,2,4,5,6,10,11,13,14},{1,2,4,5,6,10,11,13,14,15},{1,2,4,5,6,10,11,13,15},{1,2,4,5,6,10,11,14},{1,2,4,5,6,10,11,14,15},{1,2,4,5,6,10,11,15},{1,2,4,5,6,10,12},{1,2,4,5,6,10,12,13},{1,2,4,5,6,10,12,13,14},{1,2,4,5,6,10,12,13,14,15},{1,2,4,5,6,10,12,13,15},{1,2,4,5,6,10,12,14},{1,2,4,5,6,10,12,14,15},{1,2,4,5,6,10,12,15},{1,2,4,5,6,10,13},{1,2,4,5,6,10,13,14},{1,2,4,5,6,10,13,14,15},{1,2,4,5,6,10,13,15},{1,2,4,5,6,10,14},{1,2,4,5,6,10,14,15},{1,2,4,5,6,10,15},{1,2,4,5,6,11},{1,2,4,5,6,11,12},{1,2,4,5,6,11,12,13},{1,2,4,5,6,11,12,13,14},{1,2,4,5,6,11,12,13,14,15},{1,2,4,5,6,11,12,13,15},{1,2,4,5,6,11,12,14},{1,2,4,5,6,11,12,14,15},{1,2,4,5,6,11,12,15},{1,2,4,5,6,11,13},{1,2,4,5,6,11,13,14},{1,2,4,5,6,11,13,14,15},{1,2,4,5,6,11,13,15},{1,2,4,5,6,11,14},{1,2,4,5,6,11,14,15},{1,2,4,5,6,11,15},{1,2,4,5,6,12},{1,2,4,5,6,12,13},{1,2,4,5,6,12,13,14},{1,2,4,5,6,12,13,14,15},{1,2,4,5,6,12,13,15},{1,2,4,5,6,12,14},{1,2,4,5,6,12,14,15},{1,2,4,5,6,12,15},{1,2,4,5,6,13},{1,2,4,5,6,13,14},{1,2,4,5,6,13,14,15},{1,2,4,5,6,13,15},{1,2,4,5,6,14},{1,2,4,5,6,14,15},{1,2,4,5,6,15},{1,2,4,5,7},{1,2,4,5,7,8},{1,2,4,5,7,8,9},{1,2,4,5,7,8,9,10},{1,2,4,5,7,8,9,10,11},{1,2,4,5,7,8,9,10,11,12},{1,2,4,5,7,8,9,10,11,12,13},{1,2,4,5,7,8,9,10,11,12,13,14},{1,2,4,5,7,8,9,10,11,12,13,14,15},{1,2,4,5,7,8,9,10,11,12,13,15},{1,2,4,5,7,8,9,10,11,12,14},{1,2,4,5,7,8,9,10,11,12,14,15},{1,2,4,5,7,8,9,10,11,12,15},{1,2,4,5,7,8,9,10,11,13},{1,2,4,5,7,8,9,10,11,13,14},{1,2,4,5,7,8,9,10,11,13,14,15},{1,2,4,5,7,8,9,10,11,13,15},{1,2,4,5,7,8,9,10,11,14},{1,2,4,5,7,8,9,10,11,14,15},{1,2,4,5,7,8,9,10,11,15},{1,2,4,5,7,8,9,10,12},{1,2,4,5,7,8,9,10,12,13},{1,2,4,5,7,8,9,10,12,13,14},{1,2,4,5,7,8,9,10,12,13,14,15},{1,2,4,5,7,8,9,10,12,13,15},{1,2,4,5,7,8,9,10,12,14},{1,2,4,5,7,8,9,10,12,14,15},{1,2,4,5,7,8,9,10,12,15},{1,2,4,5,7,8,9,10,13},{1,2,4,5,7,8,9,10,13,14},{1,2,4,5,7,8,9,10,13,14,15},{1,2,4,5,7,8,9,10,13,15},{1,2,4,5,7,8,9,10,14},{1,2,4,5,7,8,9,10,14,15},{1,2,4,5,7,8,9,10,15},{1,2,4,5,7,8,9,11},{1,2,4,5,7,8,9,11,12},{1,2,4,5,7,8,9,11,12,13},{1,2,4,5,7,8,9,11,12,13,14},{1,2,4,5,7,8,9,11,12,13,14,15},{1,2,4,5,7,8,9,11,12,13,15},{1,2,4,5,7,8,9,11,12,14},{1,2,4,5,7,8,9,11,12,14,15},{1,2,4,5,7,8,9,11,12,15},{1,2,4,5,7,8,9,11,13},{1,2,4,5,7,8,9,11,13,14},{1,2,4,5,7,8,9,11,13,14,15},{1,2,4,5,7,8,9,11,13,15},{1,2,4,5,7,8,9,11,14},{1,2,4,5,7,8,9,11,14,15},{1,2,4,5,7,8,9,11,15},{1,2,4,5,7,8,9,12},{1,2,4,5,7,8,9,12,13},{1,2,4,5,7,8,9,12,13,14},{1,2,4,5,7,8,9,12,13,14,15},{1,2,4,5,7,8,9,12,13,15},{1,2,4,5,7,8,9,12,14},{1,2,4,5,7,8,9,12,14,15},{1,2,4,5,7,8,9,12,15},{1,2,4,5,7,8,9,13},{1,2,4,5,7,8,9,13,14},{1,2,4,5,7,8,9,13,14,15},{1,2,4,5,7,8,9,13,15},{1,2,4,5,7,8,9,14},{1,2,4,5,7,8,9,14,15},{1,2,4,5,7,8,9,15},{1,2,4,5,7,8,10},{1,2,4,5,7,8,10,11},{1,2,4,5,7,8,10,11,12},{1,2,4,5,7,8,10,11,12,13},{1,2,4,5,7,8,10,11,12,13,14},{1,2,4,5,7,8,10,11,12,13,14,15},{1,2,4,5,7,8,10,11,12,13,15},{1,2,4,5,7,8,10,11,12,14},{1,2,4,5,7,8,10,11,12,14,15},{1,2,4,5,7,8,10,11,12,15},{1,2,4,5,7,8,10,11,13},{1,2,4,5,7,8,10,11,13,14},{1,2,4,5,7,8,10,11,13,14,15},{1,2,4,5,7,8,10,11,13,15},{1,2,4,5,7,8,10,11,14},{1,2,4,5,7,8,10,11,14,15},{1,2,4,5,7,8,10,11,15},{1,2,4,5,7,8,10,12},{1,2,4,5,7,8,10,12,13},{1,2,4,5,7,8,10,12,13,14},{1,2,4,5,7,8,10,12,13,14,15},{1,2,4,5,7,8,10,12,13,15},{1,2,4,5,7,8,10,12,14},{1,2,4,5,7,8,10,12,14,15},{1,2,4,5,7,8,10,12,15},{1,2,4,5,7,8,10,13},{1,2,4,5,7,8,10,13,14},{1,2,4,5,7,8,10,13,14,15},{1,2,4,5,7,8,10,13,15},{1,2,4,5,7,8,10,14},{1,2,4,5,7,8,10,14,15},{1,2,4,5,7,8,10,15},{1,2,4,5,7,8,11},{1,2,4,5,7,8,11,12},{1,2,4,5,7,8,11,12,13},{1,2,4,5,7,8,11,12,13,14},{1,2,4,5,7,8,11,12,13,14,15},{1,2,4,5,7,8,11,12,13,15},{1,2,4,5,7,8,11,12,14},{1,2,4,5,7,8,11,12,14,15},{1,2,4,5,7,8,11,12,15},{1,2,4,5,7,8,11,13},{1,2,4,5,7,8,11,13,14},{1,2,4,5,7,8,11,13,14,15},{1,2,4,5,7,8,11,13,15},{1,2,4,5,7,8,11,14},{1,2,4,5,7,8,11,14,15},{1,2,4,5,7,8,11,15},{1,2,4,5,7,8,12},{1,2,4,5,7,8,12,13},{1,2,4,5,7,8,12,13,14},{1,2,4,5,7,8,12,13,14,15},{1,2,4,5,7,8,12,13,15},{1,2,4,5,7,8,12,14},{1,2,4,5,7,8,12,14,15},{1,2,4,5,7,8,12,15},{1,2,4,5,7,8,13},{1,2,4,5,7,8,13,14},{1,2,4,5,7,8,13,14,15},{1,2,4,5,7,8,13,15},{1,2,4,5,7,8,14},{1,2,4,5,7,8,14,15},{1,2,4,5,7,8,15},{1,2,4,5,7,9},{1,2,4,5,7,9,10},{1,2,4,5,7,9,10,11},{1,2,4,5,7,9,10,11,12},{1,2,4,5,7,9,10,11,12,13},{1,2,4,5,7,9,10,11,12,13,14},{1,2,4,5,7,9,10,11,12,13,14,15},{1,2,4,5,7,9,10,11,12,13,15},{1,2,4,5,7,9,10,11,12,14},{1,2,4,5,7,9,10,11,12,14,15},{1,2,4,5,7,9,10,11,12,15},{1,2,4,5,7,9,10,11,13},{1,2,4,5,7,9,10,11,13,14},{1,2,4,5,7,9,10,11,13,14,15},{1,2,4,5,7,9,10,11,13,15},{1,2,4,5,7,9,10,11,14},{1,2,4,5,7,9,10,11,14,15},{1,2,4,5,7,9,10,11,15},{1,2,4,5,7,9,10,12},{1,2,4,5,7,9,10,12,13},{1,2,4,5,7,9,10,12,13,14},{1,2,4,5,7,9,10,12,13,14,15},{1,2,4,5,7,9,10,12,13,15},{1,2,4,5,7,9,10,12,14},{1,2,4,5,7,9,10,12,14,15},{1,2,4,5,7,9,10,12,15},{1,2,4,5,7,9,10,13},{1,2,4,5,7,9,10,13,14},{1,2,4,5,7,9,10,13,14,15},{1,2,4,5,7,9,10,13,15},{1,2,4,5,7,9,10,14},{1,2,4,5,7,9,10,14,15},{1,2,4,5,7,9,10,15},{1,2,4,5,7,9,11},{1,2,4,5,7,9,11,12},{1,2,4,5,7,9,11,12,13},{1,2,4,5,7,9,11,12,13,14},{1,2,4,5,7,9,11,12,13,14,15},{1,2,4,5,7,9,11,12,13,15},{1,2,4,5,7,9,11,12,14},{1,2,4,5,7,9,11,12,14,15},{1,2,4,5,7,9,11,12,15},{1,2,4,5,7,9,11,13},{1,2,4,5,7,9,11,13,14},{1,2,4,5,7,9,11,13,14,15},{1,2,4,5,7,9,11,13,15},{1,2,4,5,7,9,11,14},{1,2,4,5,7,9,11,14,15},{1,2,4,5,7,9,11,15},{1,2,4,5,7,9,12},{1,2,4,5,7,9,12,13},{1,2,4,5,7,9,12,13,14},{1,2,4,5,7,9,12,13,14,15},{1,2,4,5,7,9,12,13,15},{1,2,4,5,7,9,12,14},{1,2,4,5,7,9,12,14,15},{1,2,4,5,7,9,12,15},{1,2,4,5,7,9,13},{1,2,4,5,7,9,13,14},{1,2,4,5,7,9,13,14,15},{1,2,4,5,7,9,13,15},{1,2,4,5,7,9,14},{1,2,4,5,7,9,14,15},{1,2,4,5,7,9,15},{1,2,4,5,7,10},{1,2,4,5,7,10,11},{1,2,4,5,7,10,11,12},{1,2,4,5,7,10,11,12,13},{1,2,4,5,7,10,11,12,13,14},{1,2,4,5,7,10,11,12,13,14,15},{1,2,4,5,7,10,11,12,13,15},{1,2,4,5,7,10,11,12,14},{1,2,4,5,7,10,11,12,14,15},{1,2,4,5,7,10,11,12,15},{1,2,4,5,7,10,11,13},{1,2,4,5,7,10,11,13,14},{1,2,4,5,7,10,11,13,14,15},{1,2,4,5,7,10,11,13,15},{1,2,4,5,7,10,11,14},{1,2,4,5,7,10,11,14,15},{1,2,4,5,7,10,11,15},{1,2,4,5,7,10,12},{1,2,4,5,7,10,12,13},{1,2,4,5,7,10,12,13,14},{1,2,4,5,7,10,12,13,14,15},{1,2,4,5,7,10,12,13,15},{1,2,4,5,7,10,12,14},{1,2,4,5,7,10,12,14,15},{1,2,4,5,7,10,12,15},{1,2,4,5,7,10,13},{1,2,4,5,7,10,13,14},{1,2,4,5,7,10,13,14,15},{1,2,4,5,7,10,13,15},{1,2,4,5,7,10,14},{1,2,4,5,7,10,14,15},{1,2,4,5,7,10,15},{1,2,4,5,7,11},{1,2,4,5,7,11,12},{1,2,4,5,7,11,12,13},{1,2,4,5,7,11,12,13,14},{1,2,4,5,7,11,12,13,14,15},{1,2,4,5,7,11,12,13,15},{1,2,4,5,7,11,12,14},{1,2,4,5,7,11,12,14,15},{1,2,4,5,7,11,12,15},{1,2,4,5,7,11,13},{1,2,4,5,7,11,13,14},{1,2,4,5,7,11,13,14,15},{1,2,4,5,7,11,13,15},{1,2,4,5,7,11,14},{1,2,4,5,7,11,14,15},{1,2,4,5,7,11,15},{1,2,4,5,7,12},{1,2,4,5,7,12,13},{1,2,4,5,7,12,13,14},{1,2,4,5,7,12,13,14,15},{1,2,4,5,7,12,13,15},{1,2,4,5,7,12,14},{1,2,4,5,7,12,14,15},{1,2,4,5,7,12,15},{1,2,4,5,7,13},{1,2,4,5,7,13,14},{1,2,4,5,7,13,14,15},{1,2,4,5,7,13,15},{1,2,4,5,7,14},{1,2,4,5,7,14,15},{1,2,4,5,7,15},{1,2,4,5,8},{1,2,4,5,8,9},{1,2,4,5,8,9,10},{1,2,4,5,8,9,10,11},{1,2,4,5,8,9,10,11,12},{1,2,4,5,8,9,10,11,12,13},{1,2,4,5,8,9,10,11,12,13,14},{1,2,4,5,8,9,10,11,12,13,14,15},{1,2,4,5,8,9,10,11,12,13,15},{1,2,4,5,8,9,10,11,12,14},{1,2,4,5,8,9,10,11,12,14,15},{1,2,4,5,8,9,10,11,12,15},{1,2,4,5,8,9,10,11,13},{1,2,4,5,8,9,10,11,13,14},{1,2,4,5,8,9,10,11,13,14,15},{1,2,4,5,8,9,10,11,13,15},{1,2,4,5,8,9,10,11,14},{1,2,4,5,8,9,10,11,14,15},{1,2,4,5,8,9,10,11,15},{1,2,4,5,8,9,10,12},{1,2,4,5,8,9,10,12,13},{1,2,4,5,8,9,10,12,13,14},{1,2,4,5,8,9,10,12,13,14,15},{1,2,4,5,8,9,10,12,13,15},{1,2,4,5,8,9,10,12,14},{1,2,4,5,8,9,10,12,14,15},{1,2,4,5,8,9,10,12,15},{1,2,4,5,8,9,10,13},{1,2,4,5,8,9,10,13,14},{1,2,4,5,8,9,10,13,14,15},{1,2,4,5,8,9,10,13,15},{1,2,4,5,8,9,10,14},{1,2,4,5,8,9,10,14,15},{1,2,4,5,8,9,10,15},{1,2,4,5,8,9,11},{1,2,4,5,8,9,11,12},{1,2,4,5,8,9,11,12,13},{1,2,4,5,8,9,11,12,13,14},{1,2,4,5,8,9,11,12,13,14,15},{1,2,4,5,8,9,11,12,13,15},{1,2,4,5,8,9,11,12,14},{1,2,4,5,8,9,11,12,14,15},{1,2,4,5,8,9,11,12,15},{1,2,4,5,8,9,11,13},{1,2,4,5,8,9,11,13,14},{1,2,4,5,8,9,11,13,14,15},{1,2,4,5,8,9,11,13,15},{1,2,4,5,8,9,11,14},{1,2,4,5,8,9,11,14,15},{1,2,4,5,8,9,11,15},{1,2,4,5,8,9,12},{1,2,4,5,8,9,12,13},{1,2,4,5,8,9,12,13,14},{1,2,4,5,8,9,12,13,14,15},{1,2,4,5,8,9,12,13,15},{1,2,4,5,8,9,12,14},{1,2,4,5,8,9,12,14,15},{1,2,4,5,8,9,12,15},{1,2,4,5,8,9,13},{1,2,4,5,8,9,13,14},{1,2,4,5,8,9,13,14,15},{1,2,4,5,8,9,13,15},{1,2,4,5,8,9,14},{1,2,4,5,8,9,14,15},{1,2,4,5,8,9,15},{1,2,4,5,8,10},{1,2,4,5,8,10,11},{1,2,4,5,8,10,11,12},{1,2,4,5,8,10,11,12,13},{1,2,4,5,8,10,11,12,13,14},{1,2,4,5,8,10,11,12,13,14,15},{1,2,4,5,8,10,11,12,13,15},{1,2,4,5,8,10,11,12,14},{1,2,4,5,8,10,11,12,14,15},{1,2,4,5,8,10,11,12,15},{1,2,4,5,8,10,11,13},{1,2,4,5,8,10,11,13,14},{1,2,4,5,8,10,11,13,14,15},{1,2,4,5,8,10,11,13,15},{1,2,4,5,8,10,11,14},{1,2,4,5,8,10,11,14,15},{1,2,4,5,8,10,11,15},{1,2,4,5,8,10,12},{1,2,4,5,8,10,12,13},{1,2,4,5,8,10,12,13,14},{1,2,4,5,8,10,12,13,14,15},{1,2,4,5,8,10,12,13,15},{1,2,4,5,8,10,12,14},{1,2,4,5,8,10,12,14,15},{1,2,4,5,8,10,12,15},{1,2,4,5,8,10,13},{1,2,4,5,8,10,13,14},{1,2,4,5,8,10,13,14,15},{1,2,4,5,8,10,13,15},{1,2,4,5,8,10,14},{1,2,4,5,8,10,14,15},{1,2,4,5,8,10,15},{1,2,4,5,8,11},{1,2,4,5,8,11,12},{1,2,4,5,8,11,12,13},{1,2,4,5,8,11,12,13,14},{1,2,4,5,8,11,12,13,14,15},{1,2,4,5,8,11,12,13,15},{1,2,4,5,8,11,12,14},{1,2,4,5,8,11,12,14,15},{1,2,4,5,8,11,12,15},{1,2,4,5,8,11,13},{1,2,4,5,8,11,13,14},{1,2,4,5,8,11,13,14,15},{1,2,4,5,8,11,13,15},{1,2,4,5,8,11,14},{1,2,4,5,8,11,14,15},{1,2,4,5,8,11,15},{1,2,4,5,8,12},{1,2,4,5,8,12,13},{1,2,4,5,8,12,13,14},{1,2,4,5,8,12,13,14,15},{1,2,4,5,8,12,13,15},{1,2,4,5,8,12,14},{1,2,4,5,8,12,14,15},{1,2,4,5,8,12,15},{1,2,4,5,8,13},{1,2,4,5,8,13,14},{1,2,4,5,8,13,14,15},{1,2,4,5,8,13,15},{1,2,4,5,8,14},{1,2,4,5,8,14,15},{1,2,4,5,8,15},{1,2,4,5,9},{1,2,4,5,9,10},{1,2,4,5,9,10,11},{1,2,4,5,9,10,11,12},{1,2,4,5,9,10,11,12,13},{1,2,4,5,9,10,11,12,13,14},{1,2,4,5,9,10,11,12,13,14,15},{1,2,4,5,9,10,11,12,13,15},{1,2,4,5,9,10,11,12,14},{1,2,4,5,9,10,11,12,14,15},{1,2,4,5,9,10,11,12,15},{1,2,4,5,9,10,11,13},{1,2,4,5,9,10,11,13,14},{1,2,4,5,9,10,11,13,14,15},{1,2,4,5,9,10,11,13,15},{1,2,4,5,9,10,11,14},{1,2,4,5,9,10,11,14,15},{1,2,4,5,9,10,11,15},{1,2,4,5,9,10,12},{1,2,4,5,9,10,12,13},{1,2,4,5,9,10,12,13,14},{1,2,4,5,9,10,12,13,14,15},{1,2,4,5,9,10,12,13,15},{1,2,4,5,9,10,12,14},{1,2,4,5,9,10,12,14,15},{1,2,4,5,9,10,12,15},{1,2,4,5,9,10,13},{1,2,4,5,9,10,13,14},{1,2,4,5,9,10,13,14,15},{1,2,4,5,9,10,13,15},{1,2,4,5,9,10,14},{1,2,4,5,9,10,14,15},{1,2,4,5,9,10,15},{1,2,4,5,9,11},{1,2,4,5,9,11,12},{1,2,4,5,9,11,12,13},{1,2,4,5,9,11,12,13,14},{1,2,4,5,9,11,12,13,14,15},{1,2,4,5,9,11,12,13,15},{1,2,4,5,9,11,12,14},{1,2,4,5,9,11,12,14,15},{1,2,4,5,9,11,12,15},{1,2,4,5,9,11,13},{1,2,4,5,9,11,13,14},{1,2,4,5,9,11,13,14,15},{1,2,4,5,9,11,13,15},{1,2,4,5,9,11,14},{1,2,4,5,9,11,14,15},{1,2,4,5,9,11,15},{1,2,4,5,9,12},{1,2,4,5,9,12,13},{1,2,4,5,9,12,13,14},{1,2,4,5,9,12,13,14,15},{1,2,4,5,9,12,13,15},{1,2,4,5,9,12,14},{1,2,4,5,9,12,14,15},{1,2,4,5,9,12,15},{1,2,4,5,9,13},{1,2,4,5,9,13,14},{1,2,4,5,9,13,14,15},{1,2,4,5,9,13,15},{1,2,4,5,9,14},{1,2,4,5,9,14,15},{1,2,4,5,9,15},{1,2,4,5,10},{1,2,4,5,10,11},{1,2,4,5,10,11,12},{1,2,4,5,10,11,12,13},{1,2,4,5,10,11,12,13,14},{1,2,4,5,10,11,12,13,14,15},{1,2,4,5,10,11,12,13,15},{1,2,4,5,10,11,12,14},{1,2,4,5,10,11,12,14,15},{1,2,4,5,10,11,12,15},{1,2,4,5,10,11,13},{1,2,4,5,10,11,13,14},{1,2,4,5,10,11,13,14,15},{1,2,4,5,10,11,13,15},{1,2,4,5,10,11,14},{1,2,4,5,10,11,14,15},{1,2,4,5,10,11,15},{1,2,4,5,10,12},{1,2,4,5,10,12,13},{1,2,4,5,10,12,13,14},{1,2,4,5,10,12,13,14,15},{1,2,4,5,10,12,13,15},{1,2,4,5,10,12,14},{1,2,4,5,10,12,14,15},{1,2,4,5,10,12,15},{1,2,4,5,10,13},{1,2,4,5,10,13,14},{1,2,4,5,10,13,14,15},{1,2,4,5,10,13,15},{1,2,4,5,10,14},{1,2,4,5,10,14,15},{1,2,4,5,10,15},{1,2,4,5,11},{1,2,4,5,11,12},{1,2,4,5,11,12,13},{1,2,4,5,11,12,13,14},{1,2,4,5,11,12,13,14,15},{1,2,4,5,11,12,13,15},{1,2,4,5,11,12,14},{1,2,4,5,11,12,14,15},{1,2,4,5,11,12,15},{1,2,4,5,11,13},{1,2,4,5,11,13,14},{1,2,4,5,11,13,14,15},{1,2,4,5,11,13,15},{1,2,4,5,11,14},{1,2,4,5,11,14,15},{1,2,4,5,11,15},{1,2,4,5,12},{1,2,4,5,12,13},{1,2,4,5,12,13,14},{1,2,4,5,12,13,14,15},{1,2,4,5,12,13,15},{1,2,4,5,12,14},{1,2,4,5,12,14,15},{1,2,4,5,12,15},{1,2,4,5,13},{1,2,4,5,13,14},{1,2,4,5,13,14,15},{1,2,4,5,13,15},{1,2,4,5,14},{1,2,4,5,14,15},{1,2,4,5,15},{1,2,4,6},{1,2,4,6,7},{1,2,4,6,7,8},{1,2,4,6,7,8,9},{1,2,4,6,7,8,9,10},{1,2,4,6,7,8,9,10,11},{1,2,4,6,7,8,9,10,11,12},{1,2,4,6,7,8,9,10,11,12,13},{1,2,4,6,7,8,9,10,11,12,13,14},{1,2,4,6,7,8,9,10,11,12,13,14,15},{1,2,4,6,7,8,9,10,11,12,13,15},{1,2,4,6,7,8,9,10,11,12,14},{1,2,4,6,7,8,9,10,11,12,14,15},{1,2,4,6,7,8,9,10,11,12,15},{1,2,4,6,7,8,9,10,11,13},{1,2,4,6,7,8,9,10,11,13,14},{1,2,4,6,7,8,9,10,11,13,14,15},{1,2,4,6,7,8,9,10,11,13,15},{1,2,4,6,7,8,9,10,11,14},{1,2,4,6,7,8,9,10,11,14,15},{1,2,4,6,7,8,9,10,11,15},{1,2,4,6,7,8,9,10,12},{1,2,4,6,7,8,9,10,12,13},{1,2,4,6,7,8,9,10,12,13,14},{1,2,4,6,7,8,9,10,12,13,14,15},{1,2,4,6,7,8,9,10,12,13,15},{1,2,4,6,7,8,9,10,12,14},{1,2,4,6,7,8,9,10,12,14,15},{1,2,4,6,7,8,9,10,12,15},{1,2,4,6,7,8,9,10,13},{1,2,4,6,7,8,9,10,13,14},{1,2,4,6,7,8,9,10,13,14,15},{1,2,4,6,7,8,9,10,13,15},{1,2,4,6,7,8,9,10,14},{1,2,4,6,7,8,9,10,14,15},{1,2,4,6,7,8,9,10,15},{1,2,4,6,7,8,9,11},{1,2,4,6,7,8,9,11,12},{1,2,4,6,7,8,9,11,12,13},{1,2,4,6,7,8,9,11,12,13,14},{1,2,4,6,7,8,9,11,12,13,14,15},{1,2,4,6,7,8,9,11,12,13,15},{1,2,4,6,7,8,9,11,12,14},{1,2,4,6,7,8,9,11,12,14,15},{1,2,4,6,7,8,9,11,12,15},{1,2,4,6,7,8,9,11,13},{1,2,4,6,7,8,9,11,13,14},{1,2,4,6,7,8,9,11,13,14,15},{1,2,4,6,7,8,9,11,13,15},{1,2,4,6,7,8,9,11,14},{1,2,4,6,7,8,9,11,14,15},{1,2,4,6,7,8,9,11,15},{1,2,4,6,7,8,9,12},{1,2,4,6,7,8,9,12,13},{1,2,4,6,7,8,9,12,13,14},{1,2,4,6,7,8,9,12,13,14,15},{1,2,4,6,7,8,9,12,13,15},{1,2,4,6,7,8,9,12,14},{1,2,4,6,7,8,9,12,14,15},{1,2,4,6,7,8,9,12,15},{1,2,4,6,7,8,9,13},{1,2,4,6,7,8,9,13,14},{1,2,4,6,7,8,9,13,14,15},{1,2,4,6,7,8,9,13,15},{1,2,4,6,7,8,9,14},{1,2,4,6,7,8,9,14,15},{1,2,4,6,7,8,9,15},{1,2,4,6,7,8,10},{1,2,4,6,7,8,10,11},{1,2,4,6,7,8,10,11,12},{1,2,4,6,7,8,10,11,12,13},{1,2,4,6,7,8,10,11,12,13,14},{1,2,4,6,7,8,10,11,12,13,14,15},{1,2,4,6,7,8,10,11,12,13,15},{1,2,4,6,7,8,10,11,12,14},{1,2,4,6,7,8,10,11,12,14,15},{1,2,4,6,7,8,10,11,12,15},{1,2,4,6,7,8,10,11,13},{1,2,4,6,7,8,10,11,13,14},{1,2,4,6,7,8,10,11,13,14,15},{1,2,4,6,7,8,10,11,13,15},{1,2,4,6,7,8,10,11,14},{1,2,4,6,7,8,10,11,14,15},{1,2,4,6,7,8,10,11,15},{1,2,4,6,7,8,10,12},{1,2,4,6,7,8,10,12,13},{1,2,4,6,7,8,10,12,13,14},{1,2,4,6,7,8,10,12,13,14,15},{1,2,4,6,7,8,10,12,13,15},{1,2,4,6,7,8,10,12,14},{1,2,4,6,7,8,10,12,14,15},{1,2,4,6,7,8,10,12,15},{1,2,4,6,7,8,10,13},{1,2,4,6,7,8,10,13,14},{1,2,4,6,7,8,10,13,14,15},{1,2,4,6,7,8,10,13,15},{1,2,4,6,7,8,10,14},{1,2,4,6,7,8,10,14,15},{1,2,4,6,7,8,10,15},{1,2,4,6,7,8,11},{1,2,4,6,7,8,11,12},{1,2,4,6,7,8,11,12,13},{1,2,4,6,7,8,11,12,13,14},{1,2,4,6,7,8,11,12,13,14,15},{1,2,4,6,7,8,11,12,13,15},{1,2,4,6,7,8,11,12,14},{1,2,4,6,7,8,11,12,14,15},{1,2,4,6,7,8,11,12,15},{1,2,4,6,7,8,11,13},{1,2,4,6,7,8,11,13,14},{1,2,4,6,7,8,11,13,14,15},{1,2,4,6,7,8,11,13,15},{1,2,4,6,7,8,11,14},{1,2,4,6,7,8,11,14,15},{1,2,4,6,7,8,11,15},{1,2,4,6,7,8,12},{1,2,4,6,7,8,12,13},{1,2,4,6,7,8,12,13,14},{1,2,4,6,7,8,12,13,14,15},{1,2,4,6,7,8,12,13,15},{1,2,4,6,7,8,12,14},{1,2,4,6,7,8,12,14,15},{1,2,4,6,7,8,12,15},{1,2,4,6,7,8,13},{1,2,4,6,7,8,13,14},{1,2,4,6,7,8,13,14,15},{1,2,4,6,7,8,13,15},{1,2,4,6,7,8,14},{1,2,4,6,7,8,14,15},{1,2,4,6,7,8,15},{1,2,4,6,7,9},{1,2,4,6,7,9,10},{1,2,4,6,7,9,10,11},{1,2,4,6,7,9,10,11,12},{1,2,4,6,7,9,10,11,12,13},{1,2,4,6,7,9,10,11,12,13,14},{1,2,4,6,7,9,10,11,12,13,14,15},{1,2,4,6,7,9,10,11,12,13,15},{1,2,4,6,7,9,10,11,12,14},{1,2,4,6,7,9,10,11,12,14,15},{1,2,4,6,7,9,10,11,12,15},{1,2,4,6,7,9,10,11,13},{1,2,4,6,7,9,10,11,13,14},{1,2,4,6,7,9,10,11,13,14,15},{1,2,4,6,7,9,10,11,13,15},{1,2,4,6,7,9,10,11,14},{1,2,4,6,7,9,10,11,14,15},{1,2,4,6,7,9,10,11,15},{1,2,4,6,7,9,10,12},{1,2,4,6,7,9,10,12,13},{1,2,4,6,7,9,10,12,13,14},{1,2,4,6,7,9,10,12,13,14,15},{1,2,4,6,7,9,10,12,13,15},{1,2,4,6,7,9,10,12,14},{1,2,4,6,7,9,10,12,14,15},{1,2,4,6,7,9,10,12,15},{1,2,4,6,7,9,10,13},{1,2,4,6,7,9,10,13,14},{1,2,4,6,7,9,10,13,14,15},{1,2,4,6,7,9,10,13,15},{1,2,4,6,7,9,10,14},{1,2,4,6,7,9,10,14,15},{1,2,4,6,7,9,10,15},{1,2,4,6,7,9,11},{1,2,4,6,7,9,11,12},{1,2,4,6,7,9,11,12,13},{1,2,4,6,7,9,11,12,13,14},{1,2,4,6,7,9,11,12,13,14,15},{1,2,4,6,7,9,11,12,13,15},{1,2,4,6,7,9,11,12,14},{1,2,4,6,7,9,11,12,14,15},{1,2,4,6,7,9,11,12,15},{1,2,4,6,7,9,11,13},{1,2,4,6,7,9,11,13,14},{1,2,4,6,7,9,11,13,14,15},{1,2,4,6,7,9,11,13,15},{1,2,4,6,7,9,11,14},{1,2,4,6,7,9,11,14,15},{1,2,4,6,7,9,11,15},{1,2,4,6,7,9,12},{1,2,4,6,7,9,12,13},{1,2,4,6,7,9,12,13,14},{1,2,4,6,7,9,12,13,14,15},{1,2,4,6,7,9,12,13,15},{1,2,4,6,7,9,12,14},{1,2,4,6,7,9,12,14,15},{1,2,4,6,7,9,12,15},{1,2,4,6,7,9,13},{1,2,4,6,7,9,13,14},{1,2,4,6,7,9,13,14,15},{1,2,4,6,7,9,13,15},{1,2,4,6,7,9,14},{1,2,4,6,7,9,14,15},{1,2,4,6,7,9,15},{1,2,4,6,7,10},{1,2,4,6,7,10,11},{1,2,4,6,7,10,11,12},{1,2,4,6,7,10,11,12,13},{1,2,4,6,7,10,11,12,13,14},{1,2,4,6,7,10,11,12,13,14,15},{1,2,4,6,7,10,11,12,13,15},{1,2,4,6,7,10,11,12,14},{1,2,4,6,7,10,11,12,14,15},{1,2,4,6,7,10,11,12,15},{1,2,4,6,7,10,11,13},{1,2,4,6,7,10,11,13,14},{1,2,4,6,7,10,11,13,14,15},{1,2,4,6,7,10,11,13,15},{1,2,4,6,7,10,11,14},{1,2,4,6,7,10,11,14,15},{1,2,4,6,7,10,11,15},{1,2,4,6,7,10,12},{1,2,4,6,7,10,12,13},{1,2,4,6,7,10,12,13,14},{1,2,4,6,7,10,12,13,14,15},{1,2,4,6,7,10,12,13,15},{1,2,4,6,7,10,12,14},{1,2,4,6,7,10,12,14,15},{1,2,4,6,7,10,12,15},{1,2,4,6,7,10,13},{1,2,4,6,7,10,13,14},{1,2,4,6,7,10,13,14,15},{1,2,4,6,7,10,13,15},{1,2,4,6,7,10,14},{1,2,4,6,7,10,14,15},{1,2,4,6,7,10,15},{1,2,4,6,7,11},{1,2,4,6,7,11,12},{1,2,4,6,7,11,12,13},{1,2,4,6,7,11,12,13,14},{1,2,4,6,7,11,12,13,14,15},{1,2,4,6,7,11,12,13,15},{1,2,4,6,7,11,12,14},{1,2,4,6,7,11,12,14,15},{1,2,4,6,7,11,12,15},{1,2,4,6,7,11,13},{1,2,4,6,7,11,13,14},{1,2,4,6,7,11,13,14,15},{1,2,4,6,7,11,13,15},{1,2,4,6,7,11,14},{1,2,4,6,7,11,14,15},{1,2,4,6,7,11,15},{1,2,4,6,7,12},{1,2,4,6,7,12,13},{1,2,4,6,7,12,13,14},{1,2,4,6,7,12,13,14,15},{1,2,4,6,7,12,13,15},{1,2,4,6,7,12,14},{1,2,4,6,7,12,14,15},{1,2,4,6,7,12,15},{1,2,4,6,7,13},{1,2,4,6,7,13,14},{1,2,4,6,7,13,14,15},{1,2,4,6,7,13,15},{1,2,4,6,7,14},{1,2,4,6,7,14,15},{1,2,4,6,7,15},{1,2,4,6,8},{1,2,4,6,8,9},{1,2,4,6,8,9,10},{1,2,4,6,8,9,10,11},{1,2,4,6,8,9,10,11,12},{1,2,4,6,8,9,10,11,12,13},{1,2,4,6,8,9,10,11,12,13,14},{1,2,4,6,8,9,10,11,12,13,14,15},{1,2,4,6,8,9,10,11,12,13,15},{1,2,4,6,8,9,10,11,12,14},{1,2,4,6,8,9,10,11,12,14,15},{1,2,4,6,8,9,10,11,12,15},{1,2,4,6,8,9,10,11,13},{1,2,4,6,8,9,10,11,13,14},{1,2,4,6,8,9,10,11,13,14,15},{1,2,4,6,8,9,10,11,13,15},{1,2,4,6,8,9,10,11,14},{1,2,4,6,8,9,10,11,14,15},{1,2,4,6,8,9,10,11,15},{1,2,4,6,8,9,10,12},{1,2,4,6,8,9,10,12,13},{1,2,4,6,8,9,10,12,13,14},{1,2,4,6,8,9,10,12,13,14,15},{1,2,4,6,8,9,10,12,13,15},{1,2,4,6,8,9,10,12,14},{1,2,4,6,8,9,10,12,14,15},{1,2,4,6,8,9,10,12,15},{1,2,4,6,8,9,10,13},{1,2,4,6,8,9,10,13,14},{1,2,4,6,8,9,10,13,14,15},{1,2,4,6,8,9,10,13,15},{1,2,4,6,8,9,10,14},{1,2,4,6,8,9,10,14,15},{1,2,4,6,8,9,10,15},{1,2,4,6,8,9,11},{1,2,4,6,8,9,11,12},{1,2,4,6,8,9,11,12,13},{1,2,4,6,8,9,11,12,13,14},{1,2,4,6,8,9,11,12,13,14,15},{1,2,4,6,8,9,11,12,13,15},{1,2,4,6,8,9,11,12,14},{1,2,4,6,8,9,11,12,14,15},{1,2,4,6,8,9,11,12,15},{1,2,4,6,8,9,11,13},{1,2,4,6,8,9,11,13,14},{1,2,4,6,8,9,11,13,14,15},{1,2,4,6,8,9,11,13,15},{1,2,4,6,8,9,11,14},{1,2,4,6,8,9,11,14,15},{1,2,4,6,8,9,11,15},{1,2,4,6,8,9,12},{1,2,4,6,8,9,12,13},{1,2,4,6,8,9,12,13,14},{1,2,4,6,8,9,12,13,14,15},{1,2,4,6,8,9,12,13,15},{1,2,4,6,8,9,12,14},{1,2,4,6,8,9,12,14,15},{1,2,4,6,8,9,12,15},{1,2,4,6,8,9,13},{1,2,4,6,8,9,13,14},{1,2,4,6,8,9,13,14,15},{1,2,4,6,8,9,13,15},{1,2,4,6,8,9,14},{1,2,4,6,8,9,14,15},{1,2,4,6,8,9,15},{1,2,4,6,8,10},{1,2,4,6,8,10,11},{1,2,4,6,8,10,11,12},{1,2,4,6,8,10,11,12,13},{1,2,4,6,8,10,11,12,13,14},{1,2,4,6,8,10,11,12,13,14,15},{1,2,4,6,8,10,11,12,13,15},{1,2,4,6,8,10,11,12,14},{1,2,4,6,8,10,11,12,14,15},{1,2,4,6,8,10,11,12,15},{1,2,4,6,8,10,11,13},{1,2,4,6,8,10,11,13,14},{1,2,4,6,8,10,11,13,14,15},{1,2,4,6,8,10,11,13,15},{1,2,4,6,8,10,11,14},{1,2,4,6,8,10,11,14,15},{1,2,4,6,8,10,11,15},{1,2,4,6,8,10,12},{1,2,4,6,8,10,12,13},{1,2,4,6,8,10,12,13,14},{1,2,4,6,8,10,12,13,14,15},{1,2,4,6,8,10,12,13,15},{1,2,4,6,8,10,12,14},{1,2,4,6,8,10,12,14,15},{1,2,4,6,8,10,12,15},{1,2,4,6,8,10,13},{1,2,4,6,8,10,13,14},{1,2,4,6,8,10,13,14,15},{1,2,4,6,8,10,13,15},{1,2,4,6,8,10,14},{1,2,4,6,8,10,14,15},{1,2,4,6,8,10,15},{1,2,4,6,8,11},{1,2,4,6,8,11,12},{1,2,4,6,8,11,12,13},{1,2,4,6,8,11,12,13,14},{1,2,4,6,8,11,12,13,14,15},{1,2,4,6,8,11,12,13,15},{1,2,4,6,8,11,12,14},{1,2,4,6,8,11,12,14,15},{1,2,4,6,8,11,12,15},{1,2,4,6,8,11,13},{1,2,4,6,8,11,13,14},{1,2,4,6,8,11,13,14,15},{1,2,4,6,8,11,13,15},{1,2,4,6,8,11,14},{1,2,4,6,8,11,14,15},{1,2,4,6,8,11,15},{1,2,4,6,8,12},{1,2,4,6,8,12,13},{1,2,4,6,8,12,13,14},{1,2,4,6,8,12,13,14,15},{1,2,4,6,8,12,13,15},{1,2,4,6,8,12,14},{1,2,4,6,8,12,14,15},{1,2,4,6,8,12,15},{1,2,4,6,8,13},{1,2,4,6,8,13,14},{1,2,4,6,8,13,14,15},{1,2,4,6,8,13,15},{1,2,4,6,8,14},{1,2,4,6,8,14,15},{1,2,4,6,8,15},{1,2,4,6,9},{1,2,4,6,9,10},{1,2,4,6,9,10,11},{1,2,4,6,9,10,11,12},{1,2,4,6,9,10,11,12,13},{1,2,4,6,9,10,11,12,13,14},{1,2,4,6,9,10,11,12,13,14,15},{1,2,4,6,9,10,11,12,13,15},{1,2,4,6,9,10,11,12,14},{1,2,4,6,9,10,11,12,14,15},{1,2,4,6,9,10,11,12,15},{1,2,4,6,9,10,11,13},{1,2,4,6,9,10,11,13,14},{1,2,4,6,9,10,11,13,14,15},{1,2,4,6,9,10,11,13,15},{1,2,4,6,9,10,11,14},{1,2,4,6,9,10,11,14,15},{1,2,4,6,9,10,11,15},{1,2,4,6,9,10,12},{1,2,4,6,9,10,12,13},{1,2,4,6,9,10,12,13,14},{1,2,4,6,9,10,12,13,14,15},{1,2,4,6,9,10,12,13,15},{1,2,4,6,9,10,12,14},{1,2,4,6,9,10,12,14,15},{1,2,4,6,9,10,12,15},{1,2,4,6,9,10,13},{1,2,4,6,9,10,13,14},{1,2,4,6,9,10,13,14,15},{1,2,4,6,9,10,13,15},{1,2,4,6,9,10,14},{1,2,4,6,9,10,14,15},{1,2,4,6,9,10,15},{1,2,4,6,9,11},{1,2,4,6,9,11,12},{1,2,4,6,9,11,12,13},{1,2,4,6,9,11,12,13,14},{1,2,4,6,9,11,12,13,14,15},{1,2,4,6,9,11,12,13,15},{1,2,4,6,9,11,12,14},{1,2,4,6,9,11,12,14,15},{1,2,4,6,9,11,12,15},{1,2,4,6,9,11,13},{1,2,4,6,9,11,13,14},{1,2,4,6,9,11,13,14,15},{1,2,4,6,9,11,13,15},{1,2,4,6,9,11,14},{1,2,4,6,9,11,14,15},{1,2,4,6,9,11,15},{1,2,4,6,9,12},{1,2,4,6,9,12,13},{1,2,4,6,9,12,13,14},{1,2,4,6,9,12,13,14,15},{1,2,4,6,9,12,13,15},{1,2,4,6,9,12,14},{1,2,4,6,9,12,14,15},{1,2,4,6,9,12,15},{1,2,4,6,9,13},{1,2,4,6,9,13,14},{1,2,4,6,9,13,14,15},{1,2,4,6,9,13,15},{1,2,4,6,9,14},{1,2,4,6,9,14,15},{1,2,4,6,9,15},{1,2,4,6,10},{1,2,4,6,10,11},{1,2,4,6,10,11,12},{1,2,4,6,10,11,12,13},{1,2,4,6,10,11,12,13,14},{1,2,4,6,10,11,12,13,14,15},{1,2,4,6,10,11,12,13,15},{1,2,4,6,10,11,12,14},{1,2,4,6,10,11,12,14,15},{1,2,4,6,10,11,12,15},{1,2,4,6,10,11,13},{1,2,4,6,10,11,13,14},{1,2,4,6,10,11,13,14,15},{1,2,4,6,10,11,13,15},{1,2,4,6,10,11,14},{1,2,4,6,10,11,14,15},{1,2,4,6,10,11,15},{1,2,4,6,10,12},{1,2,4,6,10,12,13},{1,2,4,6,10,12,13,14},{1,2,4,6,10,12,13,14,15},{1,2,4,6,10,12,13,15},{1,2,4,6,10,12,14},{1,2,4,6,10,12,14,15},{1,2,4,6,10,12,15},{1,2,4,6,10,13},{1,2,4,6,10,13,14},{1,2,4,6,10,13,14,15},{1,2,4,6,10,13,15},{1,2,4,6,10,14},{1,2,4,6,10,14,15},{1,2,4,6,10,15},{1,2,4,6,11},{1,2,4,6,11,12},{1,2,4,6,11,12,13},{1,2,4,6,11,12,13,14},{1,2,4,6,11,12,13,14,15},{1,2,4,6,11,12,13,15},{1,2,4,6,11,12,14},{1,2,4,6,11,12,14,15},{1,2,4,6,11,12,15},{1,2,4,6,11,13},{1,2,4,6,11,13,14},{1,2,4,6,11,13,14,15},{1,2,4,6,11,13,15},{1,2,4,6,11,14},{1,2,4,6,11,14,15},{1,2,4,6,11,15},{1,2,4,6,12},{1,2,4,6,12,13},{1,2,4,6,12,13,14},{1,2,4,6,12,13,14,15},{1,2,4,6,12,13,15},{1,2,4,6,12,14},{1,2,4,6,12,14,15},{1,2,4,6,12,15},{1,2,4,6,13},{1,2,4,6,13,14},{1,2,4,6,13,14,15},{1,2,4,6,13,15},{1,2,4,6,14},{1,2,4,6,14,15},{1,2,4,6,15},{1,2,4,7},{1,2,4,7,8},{1,2,4,7,8,9},{1,2,4,7,8,9,10},{1,2,4,7,8,9,10,11},{1,2,4,7,8,9,10,11,12},{1,2,4,7,8,9,10,11,12,13},{1,2,4,7,8,9,10,11,12,13,14},{1,2,4,7,8,9,10,11,12,13,14,15},{1,2,4,7,8,9,10,11,12,13,15},{1,2,4,7,8,9,10,11,12,14},{1,2,4,7,8,9,10,11,12,14,15},{1,2,4,7,8,9,10,11,12,15},{1,2,4,7,8,9,10,11,13},{1,2,4,7,8,9,10,11,13,14},{1,2,4,7,8,9,10,11,13,14,15},{1,2,4,7,8,9,10,11,13,15},{1,2,4,7,8,9,10,11,14},{1,2,4,7,8,9,10,11,14,15},{1,2,4,7,8,9,10,11,15},{1,2,4,7,8,9,10,12},{1,2,4,7,8,9,10,12,13},{1,2,4,7,8,9,10,12,13,14},{1,2,4,7,8,9,10,12,13,14,15},{1,2,4,7,8,9,10,12,13,15},{1,2,4,7,8,9,10,12,14},{1,2,4,7,8,9,10,12,14,15},{1,2,4,7,8,9,10,12,15},{1,2,4,7,8,9,10,13},{1,2,4,7,8,9,10,13,14},{1,2,4,7,8,9,10,13,14,15},{1,2,4,7,8,9,10,13,15},{1,2,4,7,8,9,10,14},{1,2,4,7,8,9,10,14,15},{1,2,4,7,8,9,10,15},{1,2,4,7,8,9,11},{1,2,4,7,8,9,11,12},{1,2,4,7,8,9,11,12,13},{1,2,4,7,8,9,11,12,13,14},{1,2,4,7,8,9,11,12,13,14,15},{1,2,4,7,8,9,11,12,13,15},{1,2,4,7,8,9,11,12,14},{1,2,4,7,8,9,11,12,14,15},{1,2,4,7,8,9,11,12,15},{1,2,4,7,8,9,11,13},{1,2,4,7,8,9,11,13,14},{1,2,4,7,8,9,11,13,14,15},{1,2,4,7,8,9,11,13,15},{1,2,4,7,8,9,11,14},{1,2,4,7,8,9,11,14,15},{1,2,4,7,8,9,11,15},{1,2,4,7,8,9,12},{1,2,4,7,8,9,12,13},{1,2,4,7,8,9,12,13,14},{1,2,4,7,8,9,12,13,14,15},{1,2,4,7,8,9,12,13,15},{1,2,4,7,8,9,12,14},{1,2,4,7,8,9,12,14,15},{1,2,4,7,8,9,12,15},{1,2,4,7,8,9,13},{1,2,4,7,8,9,13,14},{1,2,4,7,8,9,13,14,15},{1,2,4,7,8,9,13,15},{1,2,4,7,8,9,14},{1,2,4,7,8,9,14,15},{1,2,4,7,8,9,15},{1,2,4,7,8,10},{1,2,4,7,8,10,11},{1,2,4,7,8,10,11,12},{1,2,4,7,8,10,11,12,13},{1,2,4,7,8,10,11,12,13,14},{1,2,4,7,8,10,11,12,13,14,15},{1,2,4,7,8,10,11,12,13,15},{1,2,4,7,8,10,11,12,14},{1,2,4,7,8,10,11,12,14,15},{1,2,4,7,8,10,11,12,15},{1,2,4,7,8,10,11,13},{1,2,4,7,8,10,11,13,14},{1,2,4,7,8,10,11,13,14,15},{1,2,4,7,8,10,11,13,15},{1,2,4,7,8,10,11,14},{1,2,4,7,8,10,11,14,15},{1,2,4,7,8,10,11,15},{1,2,4,7,8,10,12},{1,2,4,7,8,10,12,13},{1,2,4,7,8,10,12,13,14},{1,2,4,7,8,10,12,13,14,15},{1,2,4,7,8,10,12,13,15},{1,2,4,7,8,10,12,14},{1,2,4,7,8,10,12,14,15},{1,2,4,7,8,10,12,15},{1,2,4,7,8,10,13},{1,2,4,7,8,10,13,14},{1,2,4,7,8,10,13,14,15},{1,2,4,7,8,10,13,15},{1,2,4,7,8,10,14},{1,2,4,7,8,10,14,15},{1,2,4,7,8,10,15},{1,2,4,7,8,11},{1,2,4,7,8,11,12},{1,2,4,7,8,11,12,13},{1,2,4,7,8,11,12,13,14},{1,2,4,7,8,11,12,13,14,15},{1,2,4,7,8,11,12,13,15},{1,2,4,7,8,11,12,14},{1,2,4,7,8,11,12,14,15},{1,2,4,7,8,11,12,15},{1,2,4,7,8,11,13},{1,2,4,7,8,11,13,14},{1,2,4,7,8,11,13,14,15},{1,2,4,7,8,11,13,15},{1,2,4,7,8,11,14},{1,2,4,7,8,11,14,15},{1,2,4,7,8,11,15},{1,2,4,7,8,12},{1,2,4,7,8,12,13},{1,2,4,7,8,12,13,14},{1,2,4,7,8,12,13,14,15},{1,2,4,7,8,12,13,15},{1,2,4,7,8,12,14},{1,2,4,7,8,12,14,15},{1,2,4,7,8,12,15},{1,2,4,7,8,13},{1,2,4,7,8,13,14},{1,2,4,7,8,13,14,15},{1,2,4,7,8,13,15},{1,2,4,7,8,14},{1,2,4,7,8,14,15},{1,2,4,7,8,15},{1,2,4,7,9},{1,2,4,7,9,10},{1,2,4,7,9,10,11},{1,2,4,7,9,10,11,12},{1,2,4,7,9,10,11,12,13},{1,2,4,7,9,10,11,12,13,14},{1,2,4,7,9,10,11,12,13,14,15},{1,2,4,7,9,10,11,12,13,15},{1,2,4,7,9,10,11,12,14},{1,2,4,7,9,10,11,12,14,15},{1,2,4,7,9,10,11,12,15},{1,2,4,7,9,10,11,13},{1,2,4,7,9,10,11,13,14},{1,2,4,7,9,10,11,13,14,15},{1,2,4,7,9,10,11,13,15},{1,2,4,7,9,10,11,14},{1,2,4,7,9,10,11,14,15},{1,2,4,7,9,10,11,15},{1,2,4,7,9,10,12},{1,2,4,7,9,10,12,13},{1,2,4,7,9,10,12,13,14},{1,2,4,7,9,10,12,13,14,15},{1,2,4,7,9,10,12,13,15},{1,2,4,7,9,10,12,14},{1,2,4,7,9,10,12,14,15},{1,2,4,7,9,10,12,15},{1,2,4,7,9,10,13},{1,2,4,7,9,10,13,14},{1,2,4,7,9,10,13,14,15},{1,2,4,7,9,10,13,15},{1,2,4,7,9,10,14},{1,2,4,7,9,10,14,15},{1,2,4,7,9,10,15},{1,2,4,7,9,11},{1,2,4,7,9,11,12},{1,2,4,7,9,11,12,13},{1,2,4,7,9,11,12,13,14},{1,2,4,7,9,11,12,13,14,15},{1,2,4,7,9,11,12,13,15},{1,2,4,7,9,11,12,14},{1,2,4,7,9,11,12,14,15},{1,2,4,7,9,11,12,15},{1,2,4,7,9,11,13},{1,2,4,7,9,11,13,14},{1,2,4,7,9,11,13,14,15},{1,2,4,7,9,11,13,15},{1,2,4,7,9,11,14},{1,2,4,7,9,11,14,15},{1,2,4,7,9,11,15},{1,2,4,7,9,12},{1,2,4,7,9,12,13},{1,2,4,7,9,12,13,14},{1,2,4,7,9,12,13,14,15},{1,2,4,7,9,12,13,15},{1,2,4,7,9,12,14},{1,2,4,7,9,12,14,15},{1,2,4,7,9,12,15},{1,2,4,7,9,13},{1,2,4,7,9,13,14},{1,2,4,7,9,13,14,15},{1,2,4,7,9,13,15},{1,2,4,7,9,14},{1,2,4,7,9,14,15},{1,2,4,7,9,15},{1,2,4,7,10},{1,2,4,7,10,11},{1,2,4,7,10,11,12},{1,2,4,7,10,11,12,13},{1,2,4,7,10,11,12,13,14},{1,2,4,7,10,11,12,13,14,15},{1,2,4,7,10,11,12,13,15},{1,2,4,7,10,11,12,14},{1,2,4,7,10,11,12,14,15},{1,2,4,7,10,11,12,15},{1,2,4,7,10,11,13},{1,2,4,7,10,11,13,14},{1,2,4,7,10,11,13,14,15},{1,2,4,7,10,11,13,15},{1,2,4,7,10,11,14},{1,2,4,7,10,11,14,15},{1,2,4,7,10,11,15},{1,2,4,7,10,12},{1,2,4,7,10,12,13},{1,2,4,7,10,12,13,14},{1,2,4,7,10,12,13,14,15},{1,2,4,7,10,12,13,15},{1,2,4,7,10,12,14},{1,2,4,7,10,12,14,15},{1,2,4,7,10,12,15},{1,2,4,7,10,13},{1,2,4,7,10,13,14},{1,2,4,7,10,13,14,15},{1,2,4,7,10,13,15},{1,2,4,7,10,14},{1,2,4,7,10,14,15},{1,2,4,7,10,15},{1,2,4,7,11},{1,2,4,7,11,12},{1,2,4,7,11,12,13},{1,2,4,7,11,12,13,14},{1,2,4,7,11,12,13,14,15},{1,2,4,7,11,12,13,15},{1,2,4,7,11,12,14},{1,2,4,7,11,12,14,15},{1,2,4,7,11,12,15},{1,2,4,7,11,13},{1,2,4,7,11,13,14},{1,2,4,7,11,13,14,15},{1,2,4,7,11,13,15},{1,2,4,7,11,14},{1,2,4,7,11,14,15},{1,2,4,7,11,15},{1,2,4,7,12},{1,2,4,7,12,13},{1,2,4,7,12,13,14},{1,2,4,7,12,13,14,15},{1,2,4,7,12,13,15},{1,2,4,7,12,14},{1,2,4,7,12,14,15},{1,2,4,7,12,15},{1,2,4,7,13},{1,2,4,7,13,14},{1,2,4,7,13,14,15},{1,2,4,7,13,15},{1,2,4,7,14},{1,2,4,7,14,15},{1,2,4,7,15},{1,2,4,8},{1,2,4,8,9},{1,2,4,8,9,10},{1,2,4,8,9,10,11},{1,2,4,8,9,10,11,12},{1,2,4,8,9,10,11,12,13},{1,2,4,8,9,10,11,12,13,14},{1,2,4,8,9,10,11,12,13,14,15},{1,2,4,8,9,10,11,12,13,15},{1,2,4,8,9,10,11,12,14},{1,2,4,8,9,10,11,12,14,15},{1,2,4,8,9,10,11,12,15},{1,2,4,8,9,10,11,13},{1,2,4,8,9,10,11,13,14},{1,2,4,8,9,10,11,13,14,15},{1,2,4,8,9,10,11,13,15},{1,2,4,8,9,10,11,14},{1,2,4,8,9,10,11,14,15},{1,2,4,8,9,10,11,15},{1,2,4,8,9,10,12},{1,2,4,8,9,10,12,13},{1,2,4,8,9,10,12,13,14},{1,2,4,8,9,10,12,13,14,15},{1,2,4,8,9,10,12,13,15},{1,2,4,8,9,10,12,14},{1,2,4,8,9,10,12,14,15},{1,2,4,8,9,10,12,15},{1,2,4,8,9,10,13},{1,2,4,8,9,10,13,14},{1,2,4,8,9,10,13,14,15},{1,2,4,8,9,10,13,15},{1,2,4,8,9,10,14},{1,2,4,8,9,10,14,15},{1,2,4,8,9,10,15},{1,2,4,8,9,11},{1,2,4,8,9,11,12},{1,2,4,8,9,11,12,13},{1,2,4,8,9,11,12,13,14},{1,2,4,8,9,11,12,13,14,15},{1,2,4,8,9,11,12,13,15},{1,2,4,8,9,11,12,14},{1,2,4,8,9,11,12,14,15},{1,2,4,8,9,11,12,15},{1,2,4,8,9,11,13},{1,2,4,8,9,11,13,14},{1,2,4,8,9,11,13,14,15},{1,2,4,8,9,11,13,15},{1,2,4,8,9,11,14},{1,2,4,8,9,11,14,15},{1,2,4,8,9,11,15},{1,2,4,8,9,12},{1,2,4,8,9,12,13},{1,2,4,8,9,12,13,14},{1,2,4,8,9,12,13,14,15},{1,2,4,8,9,12,13,15},{1,2,4,8,9,12,14},{1,2,4,8,9,12,14,15},{1,2,4,8,9,12,15},{1,2,4,8,9,13},{1,2,4,8,9,13,14},{1,2,4,8,9,13,14,15},{1,2,4,8,9,13,15},{1,2,4,8,9,14},{1,2,4,8,9,14,15},{1,2,4,8,9,15},{1,2,4,8,10},{1,2,4,8,10,11},{1,2,4,8,10,11,12},{1,2,4,8,10,11,12,13},{1,2,4,8,10,11,12,13,14},{1,2,4,8,10,11,12,13,14,15},{1,2,4,8,10,11,12,13,15},{1,2,4,8,10,11,12,14},{1,2,4,8,10,11,12,14,15},{1,2,4,8,10,11,12,15},{1,2,4,8,10,11,13},{1,2,4,8,10,11,13,14},{1,2,4,8,10,11,13,14,15},{1,2,4,8,10,11,13,15},{1,2,4,8,10,11,14},{1,2,4,8,10,11,14,15},{1,2,4,8,10,11,15},{1,2,4,8,10,12},{1,2,4,8,10,12,13},{1,2,4,8,10,12,13,14},{1,2,4,8,10,12,13,14,15},{1,2,4,8,10,12,13,15},{1,2,4,8,10,12,14},{1,2,4,8,10,12,14,15},{1,2,4,8,10,12,15},{1,2,4,8,10,13},{1,2,4,8,10,13,14},{1,2,4,8,10,13,14,15},{1,2,4,8,10,13,15},{1,2,4,8,10,14},{1,2,4,8,10,14,15},{1,2,4,8,10,15},{1,2,4,8,11},{1,2,4,8,11,12},{1,2,4,8,11,12,13},{1,2,4,8,11,12,13,14},{1,2,4,8,11,12,13,14,15},{1,2,4,8,11,12,13,15},{1,2,4,8,11,12,14},{1,2,4,8,11,12,14,15},{1,2,4,8,11,12,15},{1,2,4,8,11,13},{1,2,4,8,11,13,14},{1,2,4,8,11,13,14,15},{1,2,4,8,11,13,15},{1,2,4,8,11,14},{1,2,4,8,11,14,15},{1,2,4,8,11,15},{1,2,4,8,12},{1,2,4,8,12,13},{1,2,4,8,12,13,14},{1,2,4,8,12,13,14,15},{1,2,4,8,12,13,15},{1,2,4,8,12,14},{1,2,4,8,12,14,15},{1,2,4,8,12,15},{1,2,4,8,13},{1,2,4,8,13,14},{1,2,4,8,13,14,15},{1,2,4,8,13,15},{1,2,4,8,14},{1,2,4,8,14,15},{1,2,4,8,15},{1,2,4,9},{1,2,4,9,10},{1,2,4,9,10,11},{1,2,4,9,10,11,12},{1,2,4,9,10,11,12,13},{1,2,4,9,10,11,12,13,14},{1,2,4,9,10,11,12,13,14,15},{1,2,4,9,10,11,12,13,15},{1,2,4,9,10,11,12,14},{1,2,4,9,10,11,12,14,15},{1,2,4,9,10,11,12,15},{1,2,4,9,10,11,13},{1,2,4,9,10,11,13,14},{1,2,4,9,10,11,13,14,15},{1,2,4,9,10,11,13,15},{1,2,4,9,10,11,14},{1,2,4,9,10,11,14,15},{1,2,4,9,10,11,15},{1,2,4,9,10,12},{1,2,4,9,10,12,13},{1,2,4,9,10,12,13,14},{1,2,4,9,10,12,13,14,15},{1,2,4,9,10,12,13,15},{1,2,4,9,10,12,14},{1,2,4,9,10,12,14,15},{1,2,4,9,10,12,15},{1,2,4,9,10,13},{1,2,4,9,10,13,14},{1,2,4,9,10,13,14,15},{1,2,4,9,10,13,15},{1,2,4,9,10,14},{1,2,4,9,10,14,15},{1,2,4,9,10,15},{1,2,4,9,11},{1,2,4,9,11,12},{1,2,4,9,11,12,13},{1,2,4,9,11,12,13,14},{1,2,4,9,11,12,13,14,15},{1,2,4,9,11,12,13,15},{1,2,4,9,11,12,14},{1,2,4,9,11,12,14,15},{1,2,4,9,11,12,15},{1,2,4,9,11,13},{1,2,4,9,11,13,14},{1,2,4,9,11,13,14,15},{1,2,4,9,11,13,15},{1,2,4,9,11,14},{1,2,4,9,11,14,15},{1,2,4,9,11,15},{1,2,4,9,12},{1,2,4,9,12,13},{1,2,4,9,12,13,14},{1,2,4,9,12,13,14,15},{1,2,4,9,12,13,15},{1,2,4,9,12,14},{1,2,4,9,12,14,15},{1,2,4,9,12,15},{1,2,4,9,13},{1,2,4,9,13,14},{1,2,4,9,13,14,15},{1,2,4,9,13,15},{1,2,4,9,14},{1,2,4,9,14,15},{1,2,4,9,15},{1,2,4,10},{1,2,4,10,11},{1,2,4,10,11,12},{1,2,4,10,11,12,13},{1,2,4,10,11,12,13,14},{1,2,4,10,11,12,13,14,15},{1,2,4,10,11,12,13,15},{1,2,4,10,11,12,14},{1,2,4,10,11,12,14,15},{1,2,4,10,11,12,15},{1,2,4,10,11,13},{1,2,4,10,11,13,14},{1,2,4,10,11,13,14,15},{1,2,4,10,11,13,15},{1,2,4,10,11,14},{1,2,4,10,11,14,15},{1,2,4,10,11,15},{1,2,4,10,12},{1,2,4,10,12,13},{1,2,4,10,12,13,14},{1,2,4,10,12,13,14,15},{1,2,4,10,12,13,15},{1,2,4,10,12,14},{1,2,4,10,12,14,15},{1,2,4,10,12,15},{1,2,4,10,13},{1,2,4,10,13,14},{1,2,4,10,13,14,15},{1,2,4,10,13,15},{1,2,4,10,14},{1,2,4,10,14,15},{1,2,4,10,15},{1,2,4,11},{1,2,4,11,12},{1,2,4,11,12,13},{1,2,4,11,12,13,14},{1,2,4,11,12,13,14,15},{1,2,4,11,12,13,15},{1,2,4,11,12,14},{1,2,4,11,12,14,15},{1,2,4,11,12,15},{1,2,4,11,13},{1,2,4,11,13,14},{1,2,4,11,13,14,15},{1,2,4,11,13,15},{1,2,4,11,14},{1,2,4,11,14,15},{1,2,4,11,15},{1,2,4,12},{1,2,4,12,13},{1,2,4,12,13,14},{1,2,4,12,13,14,15},{1,2,4,12,13,15},{1,2,4,12,14},{1,2,4,12,14,15},{1,2,4,12,15},{1,2,4,13},{1,2,4,13,14},{1,2,4,13,14,15},{1,2,4,13,15},{1,2,4,14},{1,2,4,14,15},{1,2,4,15},{1,2,5},{1,2,5,6},{1,2,5,6,7},{1,2,5,6,7,8},{1,2,5,6,7,8,9},{1,2,5,6,7,8,9,10},{1,2,5,6,7,8,9,10,11},{1,2,5,6,7,8,9,10,11,12},{1,2,5,6,7,8,9,10,11,12,13},{1,2,5,6,7,8,9,10,11,12,13,14},{1,2,5,6,7,8,9,10,11,12,13,14,15},{1,2,5,6,7,8,9,10,11,12,13,15},{1,2,5,6,7,8,9,10,11,12,14},{1,2,5,6,7,8,9,10,11,12,14,15},{1,2,5,6,7,8,9,10,11,12,15},{1,2,5,6,7,8,9,10,11,13},{1,2,5,6,7,8,9,10,11,13,14},{1,2,5,6,7,8,9,10,11,13,14,15},{1,2,5,6,7,8,9,10,11,13,15},{1,2,5,6,7,8,9,10,11,14},{1,2,5,6,7,8,9,10,11,14,15},{1,2,5,6,7,8,9,10,11,15},{1,2,5,6,7,8,9,10,12},{1,2,5,6,7,8,9,10,12,13},{1,2,5,6,7,8,9,10,12,13,14},{1,2,5,6,7,8,9,10,12,13,14,15},{1,2,5,6,7,8,9,10,12,13,15},{1,2,5,6,7,8,9,10,12,14},{1,2,5,6,7,8,9,10,12,14,15},{1,2,5,6,7,8,9,10,12,15},{1,2,5,6,7,8,9,10,13},{1,2,5,6,7,8,9,10,13,14},{1,2,5,6,7,8,9,10,13,14,15},{1,2,5,6,7,8,9,10,13,15},{1,2,5,6,7,8,9,10,14},{1,2,5,6,7,8,9,10,14,15},{1,2,5,6,7,8,9,10,15},{1,2,5,6,7,8,9,11},{1,2,5,6,7,8,9,11,12},{1,2,5,6,7,8,9,11,12,13},{1,2,5,6,7,8,9,11,12,13,14},{1,2,5,6,7,8,9,11,12,13,14,15},{1,2,5,6,7,8,9,11,12,13,15},{1,2,5,6,7,8,9,11,12,14},{1,2,5,6,7,8,9,11,12,14,15},{1,2,5,6,7,8,9,11,12,15},{1,2,5,6,7,8,9,11,13},{1,2,5,6,7,8,9,11,13,14},{1,2,5,6,7,8,9,11,13,14,15},{1,2,5,6,7,8,9,11,13,15},{1,2,5,6,7,8,9,11,14},{1,2,5,6,7,8,9,11,14,15},{1,2,5,6,7,8,9,11,15},{1,2,5,6,7,8,9,12},{1,2,5,6,7,8,9,12,13},{1,2,5,6,7,8,9,12,13,14},{1,2,5,6,7,8,9,12,13,14,15},{1,2,5,6,7,8,9,12,13,15},{1,2,5,6,7,8,9,12,14},{1,2,5,6,7,8,9,12,14,15},{1,2,5,6,7,8,9,12,15},{1,2,5,6,7,8,9,13},{1,2,5,6,7,8,9,13,14},{1,2,5,6,7,8,9,13,14,15},{1,2,5,6,7,8,9,13,15},{1,2,5,6,7,8,9,14},{1,2,5,6,7,8,9,14,15},{1,2,5,6,7,8,9,15},{1,2,5,6,7,8,10},{1,2,5,6,7,8,10,11},{1,2,5,6,7,8,10,11,12},{1,2,5,6,7,8,10,11,12,13},{1,2,5,6,7,8,10,11,12,13,14},{1,2,5,6,7,8,10,11,12,13,14,15},{1,2,5,6,7,8,10,11,12,13,15},{1,2,5,6,7,8,10,11,12,14},{1,2,5,6,7,8,10,11,12,14,15},{1,2,5,6,7,8,10,11,12,15},{1,2,5,6,7,8,10,11,13},{1,2,5,6,7,8,10,11,13,14},{1,2,5,6,7,8,10,11,13,14,15},{1,2,5,6,7,8,10,11,13,15},{1,2,5,6,7,8,10,11,14},{1,2,5,6,7,8,10,11,14,15},{1,2,5,6,7,8,10,11,15},{1,2,5,6,7,8,10,12},{1,2,5,6,7,8,10,12,13},{1,2,5,6,7,8,10,12,13,14},{1,2,5,6,7,8,10,12,13,14,15},{1,2,5,6,7,8,10,12,13,15},{1,2,5,6,7,8,10,12,14},{1,2,5,6,7,8,10,12,14,15},{1,2,5,6,7,8,10,12,15},{1,2,5,6,7,8,10,13},{1,2,5,6,7,8,10,13,14},{1,2,5,6,7,8,10,13,14,15},{1,2,5,6,7,8,10,13,15},{1,2,5,6,7,8,10,14},{1,2,5,6,7,8,10,14,15},{1,2,5,6,7,8,10,15},{1,2,5,6,7,8,11},{1,2,5,6,7,8,11,12},{1,2,5,6,7,8,11,12,13},{1,2,5,6,7,8,11,12,13,14},{1,2,5,6,7,8,11,12,13,14,15},{1,2,5,6,7,8,11,12,13,15},{1,2,5,6,7,8,11,12,14},{1,2,5,6,7,8,11,12,14,15},{1,2,5,6,7,8,11,12,15},{1,2,5,6,7,8,11,13},{1,2,5,6,7,8,11,13,14},{1,2,5,6,7,8,11,13,14,15},{1,2,5,6,7,8,11,13,15},{1,2,5,6,7,8,11,14},{1,2,5,6,7,8,11,14,15},{1,2,5,6,7,8,11,15},{1,2,5,6,7,8,12},{1,2,5,6,7,8,12,13},{1,2,5,6,7,8,12,13,14},{1,2,5,6,7,8,12,13,14,15},{1,2,5,6,7,8,12,13,15},{1,2,5,6,7,8,12,14},{1,2,5,6,7,8,12,14,15},{1,2,5,6,7,8,12,15},{1,2,5,6,7,8,13},{1,2,5,6,7,8,13,14},{1,2,5,6,7,8,13,14,15},{1,2,5,6,7,8,13,15},{1,2,5,6,7,8,14},{1,2,5,6,7,8,14,15},{1,2,5,6,7,8,15},{1,2,5,6,7,9},{1,2,5,6,7,9,10},{1,2,5,6,7,9,10,11},{1,2,5,6,7,9,10,11,12},{1,2,5,6,7,9,10,11,12,13},{1,2,5,6,7,9,10,11,12,13,14},{1,2,5,6,7,9,10,11,12,13,14,15},{1,2,5,6,7,9,10,11,12,13,15},{1,2,5,6,7,9,10,11,12,14},{1,2,5,6,7,9,10,11,12,14,15},{1,2,5,6,7,9,10,11,12,15},{1,2,5,6,7,9,10,11,13},{1,2,5,6,7,9,10,11,13,14},{1,2,5,6,7,9,10,11,13,14,15},{1,2,5,6,7,9,10,11,13,15},{1,2,5,6,7,9,10,11,14},{1,2,5,6,7,9,10,11,14,15},{1,2,5,6,7,9,10,11,15},{1,2,5,6,7,9,10,12},{1,2,5,6,7,9,10,12,13},{1,2,5,6,7,9,10,12,13,14},{1,2,5,6,7,9,10,12,13,14,15},{1,2,5,6,7,9,10,12,13,15},{1,2,5,6,7,9,10,12,14},{1,2,5,6,7,9,10,12,14,15},{1,2,5,6,7,9,10,12,15},{1,2,5,6,7,9,10,13},{1,2,5,6,7,9,10,13,14},{1,2,5,6,7,9,10,13,14,15},{1,2,5,6,7,9,10,13,15},{1,2,5,6,7,9,10,14},{1,2,5,6,7,9,10,14,15},{1,2,5,6,7,9,10,15},{1,2,5,6,7,9,11},{1,2,5,6,7,9,11,12},{1,2,5,6,7,9,11,12,13},{1,2,5,6,7,9,11,12,13,14},{1,2,5,6,7,9,11,12,13,14,15},{1,2,5,6,7,9,11,12,13,15},{1,2,5,6,7,9,11,12,14},{1,2,5,6,7,9,11,12,14,15},{1,2,5,6,7,9,11,12,15},{1,2,5,6,7,9,11,13},{1,2,5,6,7,9,11,13,14},{1,2,5,6,7,9,11,13,14,15},{1,2,5,6,7,9,11,13,15},{1,2,5,6,7,9,11,14},{1,2,5,6,7,9,11,14,15},{1,2,5,6,7,9,11,15},{1,2,5,6,7,9,12},{1,2,5,6,7,9,12,13},{1,2,5,6,7,9,12,13,14},{1,2,5,6,7,9,12,13,14,15},{1,2,5,6,7,9,12,13,15},{1,2,5,6,7,9,12,14},{1,2,5,6,7,9,12,14,15},{1,2,5,6,7,9,12,15},{1,2,5,6,7,9,13},{1,2,5,6,7,9,13,14},{1,2,5,6,7,9,13,14,15},{1,2,5,6,7,9,13,15},{1,2,5,6,7,9,14},{1,2,5,6,7,9,14,15},{1,2,5,6,7,9,15},{1,2,5,6,7,10},{1,2,5,6,7,10,11},{1,2,5,6,7,10,11,12},{1,2,5,6,7,10,11,12,13},{1,2,5,6,7,10,11,12,13,14},{1,2,5,6,7,10,11,12,13,14,15},{1,2,5,6,7,10,11,12,13,15},{1,2,5,6,7,10,11,12,14},{1,2,5,6,7,10,11,12,14,15},{1,2,5,6,7,10,11,12,15},{1,2,5,6,7,10,11,13},{1,2,5,6,7,10,11,13,14},{1,2,5,6,7,10,11,13,14,15},{1,2,5,6,7,10,11,13,15},{1,2,5,6,7,10,11,14},{1,2,5,6,7,10,11,14,15},{1,2,5,6,7,10,11,15},{1,2,5,6,7,10,12},{1,2,5,6,7,10,12,13},{1,2,5,6,7,10,12,13,14},{1,2,5,6,7,10,12,13,14,15},{1,2,5,6,7,10,12,13,15},{1,2,5,6,7,10,12,14},{1,2,5,6,7,10,12,14,15},{1,2,5,6,7,10,12,15},{1,2,5,6,7,10,13},{1,2,5,6,7,10,13,14},{1,2,5,6,7,10,13,14,15},{1,2,5,6,7,10,13,15},{1,2,5,6,7,10,14},{1,2,5,6,7,10,14,15},{1,2,5,6,7,10,15},{1,2,5,6,7,11},{1,2,5,6,7,11,12},{1,2,5,6,7,11,12,13},{1,2,5,6,7,11,12,13,14},{1,2,5,6,7,11,12,13,14,15},{1,2,5,6,7,11,12,13,15},{1,2,5,6,7,11,12,14},{1,2,5,6,7,11,12,14,15},{1,2,5,6,7,11,12,15},{1,2,5,6,7,11,13},{1,2,5,6,7,11,13,14},{1,2,5,6,7,11,13,14,15},{1,2,5,6,7,11,13,15},{1,2,5,6,7,11,14},{1,2,5,6,7,11,14,15},{1,2,5,6,7,11,15},{1,2,5,6,7,12},{1,2,5,6,7,12,13},{1,2,5,6,7,12,13,14},{1,2,5,6,7,12,13,14,15},{1,2,5,6,7,12,13,15},{1,2,5,6,7,12,14},{1,2,5,6,7,12,14,15},{1,2,5,6,7,12,15},{1,2,5,6,7,13},{1,2,5,6,7,13,14},{1,2,5,6,7,13,14,15},{1,2,5,6,7,13,15},{1,2,5,6,7,14},{1,2,5,6,7,14,15},{1,2,5,6,7,15},{1,2,5,6,8},{1,2,5,6,8,9},{1,2,5,6,8,9,10},{1,2,5,6,8,9,10,11},{1,2,5,6,8,9,10,11,12},{1,2,5,6,8,9,10,11,12,13},{1,2,5,6,8,9,10,11,12,13,14},{1,2,5,6,8,9,10,11,12,13,14,15},{1,2,5,6,8,9,10,11,12,13,15},{1,2,5,6,8,9,10,11,12,14},{1,2,5,6,8,9,10,11,12,14,15},{1,2,5,6,8,9,10,11,12,15},{1,2,5,6,8,9,10,11,13},{1,2,5,6,8,9,10,11,13,14},{1,2,5,6,8,9,10,11,13,14,15},{1,2,5,6,8,9,10,11,13,15},{1,2,5,6,8,9,10,11,14},{1,2,5,6,8,9,10,11,14,15},{1,2,5,6,8,9,10,11,15},{1,2,5,6,8,9,10,12},{1,2,5,6,8,9,10,12,13},{1,2,5,6,8,9,10,12,13,14},{1,2,5,6,8,9,10,12,13,14,15},{1,2,5,6,8,9,10,12,13,15},{1,2,5,6,8,9,10,12,14},{1,2,5,6,8,9,10,12,14,15},{1,2,5,6,8,9,10,12,15},{1,2,5,6,8,9,10,13},{1,2,5,6,8,9,10,13,14},{1,2,5,6,8,9,10,13,14,15},{1,2,5,6,8,9,10,13,15},{1,2,5,6,8,9,10,14},{1,2,5,6,8,9,10,14,15},{1,2,5,6,8,9,10,15},{1,2,5,6,8,9,11},{1,2,5,6,8,9,11,12},{1,2,5,6,8,9,11,12,13},{1,2,5,6,8,9,11,12,13,14},{1,2,5,6,8,9,11,12,13,14,15},{1,2,5,6,8,9,11,12,13,15},{1,2,5,6,8,9,11,12,14},{1,2,5,6,8,9,11,12,14,15},{1,2,5,6,8,9,11,12,15},{1,2,5,6,8,9,11,13},{1,2,5,6,8,9,11,13,14},{1,2,5,6,8,9,11,13,14,15},{1,2,5,6,8,9,11,13,15},{1,2,5,6,8,9,11,14},{1,2,5,6,8,9,11,14,15},{1,2,5,6,8,9,11,15},{1,2,5,6,8,9,12},{1,2,5,6,8,9,12,13},{1,2,5,6,8,9,12,13,14},{1,2,5,6,8,9,12,13,14,15},{1,2,5,6,8,9,12,13,15},{1,2,5,6,8,9,12,14},{1,2,5,6,8,9,12,14,15},{1,2,5,6,8,9,12,15},{1,2,5,6,8,9,13},{1,2,5,6,8,9,13,14},{1,2,5,6,8,9,13,14,15},{1,2,5,6,8,9,13,15},{1,2,5,6,8,9,14},{1,2,5,6,8,9,14,15},{1,2,5,6,8,9,15},{1,2,5,6,8,10},{1,2,5,6,8,10,11},{1,2,5,6,8,10,11,12},{1,2,5,6,8,10,11,12,13},{1,2,5,6,8,10,11,12,13,14},{1,2,5,6,8,10,11,12,13,14,15},{1,2,5,6,8,10,11,12,13,15},{1,2,5,6,8,10,11,12,14},{1,2,5,6,8,10,11,12,14,15},{1,2,5,6,8,10,11,12,15},{1,2,5,6,8,10,11,13},{1,2,5,6,8,10,11,13,14},{1,2,5,6,8,10,11,13,14,15},{1,2,5,6,8,10,11,13,15},{1,2,5,6,8,10,11,14},{1,2,5,6,8,10,11,14,15},{1,2,5,6,8,10,11,15},{1,2,5,6,8,10,12},{1,2,5,6,8,10,12,13},{1,2,5,6,8,10,12,13,14},{1,2,5,6,8,10,12,13,14,15},{1,2,5,6,8,10,12,13,15},{1,2,5,6,8,10,12,14},{1,2,5,6,8,10,12,14,15},{1,2,5,6,8,10,12,15},{1,2,5,6,8,10,13},{1,2,5,6,8,10,13,14},{1,2,5,6,8,10,13,14,15},{1,2,5,6,8,10,13,15},{1,2,5,6,8,10,14},{1,2,5,6,8,10,14,15},{1,2,5,6,8,10,15},{1,2,5,6,8,11},{1,2,5,6,8,11,12},{1,2,5,6,8,11,12,13},{1,2,5,6,8,11,12,13,14},{1,2,5,6,8,11,12,13,14,15},{1,2,5,6,8,11,12,13,15},{1,2,5,6,8,11,12,14},{1,2,5,6,8,11,12,14,15},{1,2,5,6,8,11,12,15},{1,2,5,6,8,11,13},{1,2,5,6,8,11,13,14},{1,2,5,6,8,11,13,14,15},{1,2,5,6,8,11,13,15},{1,2,5,6,8,11,14},{1,2,5,6,8,11,14,15},{1,2,5,6,8,11,15},{1,2,5,6,8,12},{1,2,5,6,8,12,13},{1,2,5,6,8,12,13,14},{1,2,5,6,8,12,13,14,15},{1,2,5,6,8,12,13,15},{1,2,5,6,8,12,14},{1,2,5,6,8,12,14,15},{1,2,5,6,8,12,15},{1,2,5,6,8,13},{1,2,5,6,8,13,14},{1,2,5,6,8,13,14,15},{1,2,5,6,8,13,15},{1,2,5,6,8,14},{1,2,5,6,8,14,15},{1,2,5,6,8,15},{1,2,5,6,9},{1,2,5,6,9,10},{1,2,5,6,9,10,11},{1,2,5,6,9,10,11,12},{1,2,5,6,9,10,11,12,13},{1,2,5,6,9,10,11,12,13,14},{1,2,5,6,9,10,11,12,13,14,15},{1,2,5,6,9,10,11,12,13,15},{1,2,5,6,9,10,11,12,14},{1,2,5,6,9,10,11,12,14,15},{1,2,5,6,9,10,11,12,15},{1,2,5,6,9,10,11,13},{1,2,5,6,9,10,11,13,14},{1,2,5,6,9,10,11,13,14,15},{1,2,5,6,9,10,11,13,15},{1,2,5,6,9,10,11,14},{1,2,5,6,9,10,11,14,15},{1,2,5,6,9,10,11,15},{1,2,5,6,9,10,12},{1,2,5,6,9,10,12,13},{1,2,5,6,9,10,12,13,14},{1,2,5,6,9,10,12,13,14,15},{1,2,5,6,9,10,12,13,15},{1,2,5,6,9,10,12,14},{1,2,5,6,9,10,12,14,15},{1,2,5,6,9,10,12,15},{1,2,5,6,9,10,13},{1,2,5,6,9,10,13,14},{1,2,5,6,9,10,13,14,15},{1,2,5,6,9,10,13,15},{1,2,5,6,9,10,14},{1,2,5,6,9,10,14,15},{1,2,5,6,9,10,15},{1,2,5,6,9,11},{1,2,5,6,9,11,12},{1,2,5,6,9,11,12,13},{1,2,5,6,9,11,12,13,14},{1,2,5,6,9,11,12,13,14,15},{1,2,5,6,9,11,12,13,15},{1,2,5,6,9,11,12,14},{1,2,5,6,9,11,12,14,15},{1,2,5,6,9,11,12,15},{1,2,5,6,9,11,13},{1,2,5,6,9,11,13,14},{1,2,5,6,9,11,13,14,15},{1,2,5,6,9,11,13,15},{1,2,5,6,9,11,14},{1,2,5,6,9,11,14,15},{1,2,5,6,9,11,15},{1,2,5,6,9,12},{1,2,5,6,9,12,13},{1,2,5,6,9,12,13,14},{1,2,5,6,9,12,13,14,15},{1,2,5,6,9,12,13,15},{1,2,5,6,9,12,14},{1,2,5,6,9,12,14,15},{1,2,5,6,9,12,15},{1,2,5,6,9,13},{1,2,5,6,9,13,14},{1,2,5,6,9,13,14,15},{1,2,5,6,9,13,15},{1,2,5,6,9,14},{1,2,5,6,9,14,15},{1,2,5,6,9,15},{1,2,5,6,10},{1,2,5,6,10,11},{1,2,5,6,10,11,12},{1,2,5,6,10,11,12,13},{1,2,5,6,10,11,12,13,14},{1,2,5,6,10,11,12,13,14,15},{1,2,5,6,10,11,12,13,15},{1,2,5,6,10,11,12,14},{1,2,5,6,10,11,12,14,15},{1,2,5,6,10,11,12,15},{1,2,5,6,10,11,13},{1,2,5,6,10,11,13,14},{1,2,5,6,10,11,13,14,15},{1,2,5,6,10,11,13,15},{1,2,5,6,10,11,14},{1,2,5,6,10,11,14,15},{1,2,5,6,10,11,15},{1,2,5,6,10,12},{1,2,5,6,10,12,13},{1,2,5,6,10,12,13,14},{1,2,5,6,10,12,13,14,15},{1,2,5,6,10,12,13,15},{1,2,5,6,10,12,14},{1,2,5,6,10,12,14,15},{1,2,5,6,10,12,15},{1,2,5,6,10,13},{1,2,5,6,10,13,14},{1,2,5,6,10,13,14,15},{1,2,5,6,10,13,15},{1,2,5,6,10,14},{1,2,5,6,10,14,15},{1,2,5,6,10,15},{1,2,5,6,11},{1,2,5,6,11,12},{1,2,5,6,11,12,13},{1,2,5,6,11,12,13,14},{1,2,5,6,11,12,13,14,15},{1,2,5,6,11,12,13,15},{1,2,5,6,11,12,14},{1,2,5,6,11,12,14,15},{1,2,5,6,11,12,15},{1,2,5,6,11,13},{1,2,5,6,11,13,14},{1,2,5,6,11,13,14,15},{1,2,5,6,11,13,15},{1,2,5,6,11,14},{1,2,5,6,11,14,15},{1,2,5,6,11,15},{1,2,5,6,12},{1,2,5,6,12,13},{1,2,5,6,12,13,14},{1,2,5,6,12,13,14,15},{1,2,5,6,12,13,15},{1,2,5,6,12,14},{1,2,5,6,12,14,15},{1,2,5,6,12,15},{1,2,5,6,13},{1,2,5,6,13,14},{1,2,5,6,13,14,15},{1,2,5,6,13,15},{1,2,5,6,14},{1,2,5,6,14,15},{1,2,5,6,15},{1,2,5,7},{1,2,5,7,8},{1,2,5,7,8,9},{1,2,5,7,8,9,10},{1,2,5,7,8,9,10,11},{1,2,5,7,8,9,10,11,12},{1,2,5,7,8,9,10,11,12,13},{1,2,5,7,8,9,10,11,12,13,14},{1,2,5,7,8,9,10,11,12,13,14,15},{1,2,5,7,8,9,10,11,12,13,15},{1,2,5,7,8,9,10,11,12,14},{1,2,5,7,8,9,10,11,12,14,15},{1,2,5,7,8,9,10,11,12,15},{1,2,5,7,8,9,10,11,13},{1,2,5,7,8,9,10,11,13,14},{1,2,5,7,8,9,10,11,13,14,15},{1,2,5,7,8,9,10,11,13,15},{1,2,5,7,8,9,10,11,14},{1,2,5,7,8,9,10,11,14,15},{1,2,5,7,8,9,10,11,15},{1,2,5,7,8,9,10,12},{1,2,5,7,8,9,10,12,13},{1,2,5,7,8,9,10,12,13,14},{1,2,5,7,8,9,10,12,13,14,15},{1,2,5,7,8,9,10,12,13,15},{1,2,5,7,8,9,10,12,14},{1,2,5,7,8,9,10,12,14,15},{1,2,5,7,8,9,10,12,15},{1,2,5,7,8,9,10,13},{1,2,5,7,8,9,10,13,14},{1,2,5,7,8,9,10,13,14,15},{1,2,5,7,8,9,10,13,15},{1,2,5,7,8,9,10,14},{1,2,5,7,8,9,10,14,15},{1,2,5,7,8,9,10,15},{1,2,5,7,8,9,11},{1,2,5,7,8,9,11,12},{1,2,5,7,8,9,11,12,13},{1,2,5,7,8,9,11,12,13,14},{1,2,5,7,8,9,11,12,13,14,15},{1,2,5,7,8,9,11,12,13,15},{1,2,5,7,8,9,11,12,14},{1,2,5,7,8,9,11,12,14,15},{1,2,5,7,8,9,11,12,15},{1,2,5,7,8,9,11,13},{1,2,5,7,8,9,11,13,14},{1,2,5,7,8,9,11,13,14,15},{1,2,5,7,8,9,11,13,15},{1,2,5,7,8,9,11,14},{1,2,5,7,8,9,11,14,15},{1,2,5,7,8,9,11,15},{1,2,5,7,8,9,12},{1,2,5,7,8,9,12,13},{1,2,5,7,8,9,12,13,14},{1,2,5,7,8,9,12,13,14,15},{1,2,5,7,8,9,12,13,15},{1,2,5,7,8,9,12,14},{1,2,5,7,8,9,12,14,15},{1,2,5,7,8,9,12,15},{1,2,5,7,8,9,13},{1,2,5,7,8,9,13,14},{1,2,5,7,8,9,13,14,15},{1,2,5,7,8,9,13,15},{1,2,5,7,8,9,14},{1,2,5,7,8,9,14,15},{1,2,5,7,8,9,15},{1,2,5,7,8,10},{1,2,5,7,8,10,11},{1,2,5,7,8,10,11,12},{1,2,5,7,8,10,11,12,13},{1,2,5,7,8,10,11,12,13,14},{1,2,5,7,8,10,11,12,13,14,15},{1,2,5,7,8,10,11,12,13,15},{1,2,5,7,8,10,11,12,14},{1,2,5,7,8,10,11,12,14,15},{1,2,5,7,8,10,11,12,15},{1,2,5,7,8,10,11,13},{1,2,5,7,8,10,11,13,14},{1,2,5,7,8,10,11,13,14,15},{1,2,5,7,8,10,11,13,15},{1,2,5,7,8,10,11,14},{1,2,5,7,8,10,11,14,15},{1,2,5,7,8,10,11,15},{1,2,5,7,8,10,12},{1,2,5,7,8,10,12,13},{1,2,5,7,8,10,12,13,14},{1,2,5,7,8,10,12,13,14,15},{1,2,5,7,8,10,12,13,15},{1,2,5,7,8,10,12,14},{1,2,5,7,8,10,12,14,15},{1,2,5,7,8,10,12,15},{1,2,5,7,8,10,13},{1,2,5,7,8,10,13,14},{1,2,5,7,8,10,13,14,15},{1,2,5,7,8,10,13,15},{1,2,5,7,8,10,14},{1,2,5,7,8,10,14,15},{1,2,5,7,8,10,15},{1,2,5,7,8,11},{1,2,5,7,8,11,12},{1,2,5,7,8,11,12,13},{1,2,5,7,8,11,12,13,14},{1,2,5,7,8,11,12,13,14,15},{1,2,5,7,8,11,12,13,15},{1,2,5,7,8,11,12,14},{1,2,5,7,8,11,12,14,15},{1,2,5,7,8,11,12,15},{1,2,5,7,8,11,13},{1,2,5,7,8,11,13,14},{1,2,5,7,8,11,13,14,15},{1,2,5,7,8,11,13,15},{1,2,5,7,8,11,14},{1,2,5,7,8,11,14,15},{1,2,5,7,8,11,15},{1,2,5,7,8,12},{1,2,5,7,8,12,13},{1,2,5,7,8,12,13,14},{1,2,5,7,8,12,13,14,15},{1,2,5,7,8,12,13,15},{1,2,5,7,8,12,14},{1,2,5,7,8,12,14,15},{1,2,5,7,8,12,15},{1,2,5,7,8,13},{1,2,5,7,8,13,14},{1,2,5,7,8,13,14,15},{1,2,5,7,8,13,15},{1,2,5,7,8,14},{1,2,5,7,8,14,15},{1,2,5,7,8,15},{1,2,5,7,9},{1,2,5,7,9,10},{1,2,5,7,9,10,11},{1,2,5,7,9,10,11,12},{1,2,5,7,9,10,11,12,13},{1,2,5,7,9,10,11,12,13,14},{1,2,5,7,9,10,11,12,13,14,15},{1,2,5,7,9,10,11,12,13,15},{1,2,5,7,9,10,11,12,14},{1,2,5,7,9,10,11,12,14,15},{1,2,5,7,9,10,11,12,15},{1,2,5,7,9,10,11,13},{1,2,5,7,9,10,11,13,14},{1,2,5,7,9,10,11,13,14,15},{1,2,5,7,9,10,11,13,15},{1,2,5,7,9,10,11,14},{1,2,5,7,9,10,11,14,15},{1,2,5,7,9,10,11,15},{1,2,5,7,9,10,12},{1,2,5,7,9,10,12,13},{1,2,5,7,9,10,12,13,14},{1,2,5,7,9,10,12,13,14,15},{1,2,5,7,9,10,12,13,15},{1,2,5,7,9,10,12,14},{1,2,5,7,9,10,12,14,15},{1,2,5,7,9,10,12,15},{1,2,5,7,9,10,13},{1,2,5,7,9,10,13,14},{1,2,5,7,9,10,13,14,15},{1,2,5,7,9,10,13,15},{1,2,5,7,9,10,14},{1,2,5,7,9,10,14,15},{1,2,5,7,9,10,15},{1,2,5,7,9,11},{1,2,5,7,9,11,12},{1,2,5,7,9,11,12,13},{1,2,5,7,9,11,12,13,14},{1,2,5,7,9,11,12,13,14,15},{1,2,5,7,9,11,12,13,15},{1,2,5,7,9,11,12,14},{1,2,5,7,9,11,12,14,15},{1,2,5,7,9,11,12,15},{1,2,5,7,9,11,13},{1,2,5,7,9,11,13,14},{1,2,5,7,9,11,13,14,15},{1,2,5,7,9,11,13,15},{1,2,5,7,9,11,14},{1,2,5,7,9,11,14,15},{1,2,5,7,9,11,15},{1,2,5,7,9,12},{1,2,5,7,9,12,13},{1,2,5,7,9,12,13,14},{1,2,5,7,9,12,13,14,15},{1,2,5,7,9,12,13,15},{1,2,5,7,9,12,14},{1,2,5,7,9,12,14,15},{1,2,5,7,9,12,15},{1,2,5,7,9,13},{1,2,5,7,9,13,14},{1,2,5,7,9,13,14,15},{1,2,5,7,9,13,15},{1,2,5,7,9,14},{1,2,5,7,9,14,15},{1,2,5,7,9,15},{1,2,5,7,10},{1,2,5,7,10,11},{1,2,5,7,10,11,12},{1,2,5,7,10,11,12,13},{1,2,5,7,10,11,12,13,14},{1,2,5,7,10,11,12,13,14,15},{1,2,5,7,10,11,12,13,15},{1,2,5,7,10,11,12,14},{1,2,5,7,10,11,12,14,15},{1,2,5,7,10,11,12,15},{1,2,5,7,10,11,13},{1,2,5,7,10,11,13,14},{1,2,5,7,10,11,13,14,15},{1,2,5,7,10,11,13,15},{1,2,5,7,10,11,14},{1,2,5,7,10,11,14,15},{1,2,5,7,10,11,15},{1,2,5,7,10,12},{1,2,5,7,10,12,13},{1,2,5,7,10,12,13,14},{1,2,5,7,10,12,13,14,15},{1,2,5,7,10,12,13,15},{1,2,5,7,10,12,14},{1,2,5,7,10,12,14,15},{1,2,5,7,10,12,15},{1,2,5,7,10,13},{1,2,5,7,10,13,14},{1,2,5,7,10,13,14,15},{1,2,5,7,10,13,15},{1,2,5,7,10,14},{1,2,5,7,10,14,15},{1,2,5,7,10,15},{1,2,5,7,11},{1,2,5,7,11,12},{1,2,5,7,11,12,13},{1,2,5,7,11,12,13,14},{1,2,5,7,11,12,13,14,15},{1,2,5,7,11,12,13,15},{1,2,5,7,11,12,14},{1,2,5,7,11,12,14,15},{1,2,5,7,11,12,15},{1,2,5,7,11,13},{1,2,5,7,11,13,14},{1,2,5,7,11,13,14,15},{1,2,5,7,11,13,15},{1,2,5,7,11,14},{1,2,5,7,11,14,15},{1,2,5,7,11,15},{1,2,5,7,12},{1,2,5,7,12,13},{1,2,5,7,12,13,14},{1,2,5,7,12,13,14,15},{1,2,5,7,12,13,15},{1,2,5,7,12,14},{1,2,5,7,12,14,15},{1,2,5,7,12,15},{1,2,5,7,13},{1,2,5,7,13,14},{1,2,5,7,13,14,15},{1,2,5,7,13,15},{1,2,5,7,14},{1,2,5,7,14,15},{1,2,5,7,15},{1,2,5,8},{1,2,5,8,9},{1,2,5,8,9,10},{1,2,5,8,9,10,11},{1,2,5,8,9,10,11,12},{1,2,5,8,9,10,11,12,13},{1,2,5,8,9,10,11,12,13,14},{1,2,5,8,9,10,11,12,13,14,15},{1,2,5,8,9,10,11,12,13,15},{1,2,5,8,9,10,11,12,14},{1,2,5,8,9,10,11,12,14,15},{1,2,5,8,9,10,11,12,15},{1,2,5,8,9,10,11,13},{1,2,5,8,9,10,11,13,14},{1,2,5,8,9,10,11,13,14,15},{1,2,5,8,9,10,11,13,15},{1,2,5,8,9,10,11,14},{1,2,5,8,9,10,11,14,15},{1,2,5,8,9,10,11,15},{1,2,5,8,9,10,12},{1,2,5,8,9,10,12,13},{1,2,5,8,9,10,12,13,14},{1,2,5,8,9,10,12,13,14,15},{1,2,5,8,9,10,12,13,15},{1,2,5,8,9,10,12,14},{1,2,5,8,9,10,12,14,15},{1,2,5,8,9,10,12,15},{1,2,5,8,9,10,13},{1,2,5,8,9,10,13,14},{1,2,5,8,9,10,13,14,15},{1,2,5,8,9,10,13,15},{1,2,5,8,9,10,14},{1,2,5,8,9,10,14,15},{1,2,5,8,9,10,15},{1,2,5,8,9,11},{1,2,5,8,9,11,12},{1,2,5,8,9,11,12,13},{1,2,5,8,9,11,12,13,14},{1,2,5,8,9,11,12,13,14,15},{1,2,5,8,9,11,12,13,15},{1,2,5,8,9,11,12,14},{1,2,5,8,9,11,12,14,15},{1,2,5,8,9,11,12,15},{1,2,5,8,9,11,13},{1,2,5,8,9,11,13,14},{1,2,5,8,9,11,13,14,15},{1,2,5,8,9,11,13,15},{1,2,5,8,9,11,14},{1,2,5,8,9,11,14,15},{1,2,5,8,9,11,15},{1,2,5,8,9,12},{1,2,5,8,9,12,13},{1,2,5,8,9,12,13,14},{1,2,5,8,9,12,13,14,15},{1,2,5,8,9,12,13,15},{1,2,5,8,9,12,14},{1,2,5,8,9,12,14,15},{1,2,5,8,9,12,15},{1,2,5,8,9,13},{1,2,5,8,9,13,14},{1,2,5,8,9,13,14,15},{1,2,5,8,9,13,15},{1,2,5,8,9,14},{1,2,5,8,9,14,15},{1,2,5,8,9,15},{1,2,5,8,10},{1,2,5,8,10,11},{1,2,5,8,10,11,12},{1,2,5,8,10,11,12,13},{1,2,5,8,10,11,12,13,14},{1,2,5,8,10,11,12,13,14,15},{1,2,5,8,10,11,12,13,15},{1,2,5,8,10,11,12,14},{1,2,5,8,10,11,12,14,15},{1,2,5,8,10,11,12,15},{1,2,5,8,10,11,13},{1,2,5,8,10,11,13,14},{1,2,5,8,10,11,13,14,15},{1,2,5,8,10,11,13,15},{1,2,5,8,10,11,14},{1,2,5,8,10,11,14,15},{1,2,5,8,10,11,15},{1,2,5,8,10,12},{1,2,5,8,10,12,13},{1,2,5,8,10,12,13,14},{1,2,5,8,10,12,13,14,15},{1,2,5,8,10,12,13,15},{1,2,5,8,10,12,14},{1,2,5,8,10,12,14,15},{1,2,5,8,10,12,15},{1,2,5,8,10,13},{1,2,5,8,10,13,14},{1,2,5,8,10,13,14,15},{1,2,5,8,10,13,15},{1,2,5,8,10,14},{1,2,5,8,10,14,15},{1,2,5,8,10,15},{1,2,5,8,11},{1,2,5,8,11,12},{1,2,5,8,11,12,13},{1,2,5,8,11,12,13,14},{1,2,5,8,11,12,13,14,15},{1,2,5,8,11,12,13,15},{1,2,5,8,11,12,14},{1,2,5,8,11,12,14,15},{1,2,5,8,11,12,15},{1,2,5,8,11,13},{1,2,5,8,11,13,14},{1,2,5,8,11,13,14,15},{1,2,5,8,11,13,15},{1,2,5,8,11,14},{1,2,5,8,11,14,15},{1,2,5,8,11,15},{1,2,5,8,12},{1,2,5,8,12,13},{1,2,5,8,12,13,14},{1,2,5,8,12,13,14,15},{1,2,5,8,12,13,15},{1,2,5,8,12,14},{1,2,5,8,12,14,15},{1,2,5,8,12,15},{1,2,5,8,13},{1,2,5,8,13,14},{1,2,5,8,13,14,15},{1,2,5,8,13,15},{1,2,5,8,14},{1,2,5,8,14,15},{1,2,5,8,15},{1,2,5,9},{1,2,5,9,10},{1,2,5,9,10,11},{1,2,5,9,10,11,12},{1,2,5,9,10,11,12,13},{1,2,5,9,10,11,12,13,14},{1,2,5,9,10,11,12,13,14,15},{1,2,5,9,10,11,12,13,15},{1,2,5,9,10,11,12,14},{1,2,5,9,10,11,12,14,15},{1,2,5,9,10,11,12,15},{1,2,5,9,10,11,13},{1,2,5,9,10,11,13,14},{1,2,5,9,10,11,13,14,15},{1,2,5,9,10,11,13,15},{1,2,5,9,10,11,14},{1,2,5,9,10,11,14,15},{1,2,5,9,10,11,15},{1,2,5,9,10,12},{1,2,5,9,10,12,13},{1,2,5,9,10,12,13,14},{1,2,5,9,10,12,13,14,15},{1,2,5,9,10,12,13,15},{1,2,5,9,10,12,14},{1,2,5,9,10,12,14,15},{1,2,5,9,10,12,15},{1,2,5,9,10,13},{1,2,5,9,10,13,14},{1,2,5,9,10,13,14,15},{1,2,5,9,10,13,15},{1,2,5,9,10,14},{1,2,5,9,10,14,15},{1,2,5,9,10,15},{1,2,5,9,11},{1,2,5,9,11,12},{1,2,5,9,11,12,13},{1,2,5,9,11,12,13,14},{1,2,5,9,11,12,13,14,15},{1,2,5,9,11,12,13,15},{1,2,5,9,11,12,14},{1,2,5,9,11,12,14,15},{1,2,5,9,11,12,15},{1,2,5,9,11,13},{1,2,5,9,11,13,14},{1,2,5,9,11,13,14,15},{1,2,5,9,11,13,15},{1,2,5,9,11,14},{1,2,5,9,11,14,15},{1,2,5,9,11,15},{1,2,5,9,12},{1,2,5,9,12,13},{1,2,5,9,12,13,14},{1,2,5,9,12,13,14,15},{1,2,5,9,12,13,15},{1,2,5,9,12,14},{1,2,5,9,12,14,15},{1,2,5,9,12,15},{1,2,5,9,13},{1,2,5,9,13,14},{1,2,5,9,13,14,15},{1,2,5,9,13,15},{1,2,5,9,14},{1,2,5,9,14,15},{1,2,5,9,15},{1,2,5,10},{1,2,5,10,11},{1,2,5,10,11,12},{1,2,5,10,11,12,13},{1,2,5,10,11,12,13,14},{1,2,5,10,11,12,13,14,15},{1,2,5,10,11,12,13,15},{1,2,5,10,11,12,14},{1,2,5,10,11,12,14,15},{1,2,5,10,11,12,15},{1,2,5,10,11,13},{1,2,5,10,11,13,14},{1,2,5,10,11,13,14,15},{1,2,5,10,11,13,15},{1,2,5,10,11,14},{1,2,5,10,11,14,15},{1,2,5,10,11,15},{1,2,5,10,12},{1,2,5,10,12,13},{1,2,5,10,12,13,14},{1,2,5,10,12,13,14,15},{1,2,5,10,12,13,15},{1,2,5,10,12,14},{1,2,5,10,12,14,15},{1,2,5,10,12,15},{1,2,5,10,13},{1,2,5,10,13,14},{1,2,5,10,13,14,15},{1,2,5,10,13,15},{1,2,5,10,14},{1,2,5,10,14,15},{1,2,5,10,15},{1,2,5,11},{1,2,5,11,12},{1,2,5,11,12,13},{1,2,5,11,12,13,14},{1,2,5,11,12,13,14,15},{1,2,5,11,12,13,15},{1,2,5,11,12,14},{1,2,5,11,12,14,15},{1,2,5,11,12,15},{1,2,5,11,13},{1,2,5,11,13,14},{1,2,5,11,13,14,15},{1,2,5,11,13,15},{1,2,5,11,14},{1,2,5,11,14,15},{1,2,5,11,15},{1,2,5,12},{1,2,5,12,13},{1,2,5,12,13,14},{1,2,5,12,13,14,15},{1,2,5,12,13,15},{1,2,5,12,14},{1,2,5,12,14,15},{1,2,5,12,15},{1,2,5,13},{1,2,5,13,14},{1,2,5,13,14,15},{1,2,5,13,15},{1,2,5,14},{1,2,5,14,15},{1,2,5,15},{1,2,6},{1,2,6,7},{1,2,6,7,8},{1,2,6,7,8,9},{1,2,6,7,8,9,10},{1,2,6,7,8,9,10,11},{1,2,6,7,8,9,10,11,12},{1,2,6,7,8,9,10,11,12,13},{1,2,6,7,8,9,10,11,12,13,14},{1,2,6,7,8,9,10,11,12,13,14,15},{1,2,6,7,8,9,10,11,12,13,15},{1,2,6,7,8,9,10,11,12,14},{1,2,6,7,8,9,10,11,12,14,15},{1,2,6,7,8,9,10,11,12,15},{1,2,6,7,8,9,10,11,13},{1,2,6,7,8,9,10,11,13,14},{1,2,6,7,8,9,10,11,13,14,15},{1,2,6,7,8,9,10,11,13,15},{1,2,6,7,8,9,10,11,14},{1,2,6,7,8,9,10,11,14,15},{1,2,6,7,8,9,10,11,15},{1,2,6,7,8,9,10,12},{1,2,6,7,8,9,10,12,13},{1,2,6,7,8,9,10,12,13,14},{1,2,6,7,8,9,10,12,13,14,15},{1,2,6,7,8,9,10,12,13,15},{1,2,6,7,8,9,10,12,14},{1,2,6,7,8,9,10,12,14,15},{1,2,6,7,8,9,10,12,15},{1,2,6,7,8,9,10,13},{1,2,6,7,8,9,10,13,14},{1,2,6,7,8,9,10,13,14,15},{1,2,6,7,8,9,10,13,15},{1,2,6,7,8,9,10,14},{1,2,6,7,8,9,10,14,15},{1,2,6,7,8,9,10,15},{1,2,6,7,8,9,11},{1,2,6,7,8,9,11,12},{1,2,6,7,8,9,11,12,13},{1,2,6,7,8,9,11,12,13,14},{1,2,6,7,8,9,11,12,13,14,15},{1,2,6,7,8,9,11,12,13,15},{1,2,6,7,8,9,11,12,14},{1,2,6,7,8,9,11,12,14,15},{1,2,6,7,8,9,11,12,15},{1,2,6,7,8,9,11,13},{1,2,6,7,8,9,11,13,14},{1,2,6,7,8,9,11,13,14,15},{1,2,6,7,8,9,11,13,15},{1,2,6,7,8,9,11,14},{1,2,6,7,8,9,11,14,15},{1,2,6,7,8,9,11,15},{1,2,6,7,8,9,12},{1,2,6,7,8,9,12,13},{1,2,6,7,8,9,12,13,14},{1,2,6,7,8,9,12,13,14,15},{1,2,6,7,8,9,12,13,15},{1,2,6,7,8,9,12,14},{1,2,6,7,8,9,12,14,15},{1,2,6,7,8,9,12,15},{1,2,6,7,8,9,13},{1,2,6,7,8,9,13,14},{1,2,6,7,8,9,13,14,15},{1,2,6,7,8,9,13,15},{1,2,6,7,8,9,14},{1,2,6,7,8,9,14,15},{1,2,6,7,8,9,15},{1,2,6,7,8,10},{1,2,6,7,8,10,11},{1,2,6,7,8,10,11,12},{1,2,6,7,8,10,11,12,13},{1,2,6,7,8,10,11,12,13,14},{1,2,6,7,8,10,11,12,13,14,15},{1,2,6,7,8,10,11,12,13,15},{1,2,6,7,8,10,11,12,14},{1,2,6,7,8,10,11,12,14,15},{1,2,6,7,8,10,11,12,15},{1,2,6,7,8,10,11,13},{1,2,6,7,8,10,11,13,14},{1,2,6,7,8,10,11,13,14,15},{1,2,6,7,8,10,11,13,15},{1,2,6,7,8,10,11,14},{1,2,6,7,8,10,11,14,15},{1,2,6,7,8,10,11,15},{1,2,6,7,8,10,12},{1,2,6,7,8,10,12,13},{1,2,6,7,8,10,12,13,14},{1,2,6,7,8,10,12,13,14,15},{1,2,6,7,8,10,12,13,15},{1,2,6,7,8,10,12,14},{1,2,6,7,8,10,12,14,15},{1,2,6,7,8,10,12,15},{1,2,6,7,8,10,13},{1,2,6,7,8,10,13,14},{1,2,6,7,8,10,13,14,15},{1,2,6,7,8,10,13,15},{1,2,6,7,8,10,14},{1,2,6,7,8,10,14,15},{1,2,6,7,8,10,15},{1,2,6,7,8,11},{1,2,6,7,8,11,12},{1,2,6,7,8,11,12,13},{1,2,6,7,8,11,12,13,14},{1,2,6,7,8,11,12,13,14,15},{1,2,6,7,8,11,12,13,15},{1,2,6,7,8,11,12,14},{1,2,6,7,8,11,12,14,15},{1,2,6,7,8,11,12,15},{1,2,6,7,8,11,13},{1,2,6,7,8,11,13,14},{1,2,6,7,8,11,13,14,15},{1,2,6,7,8,11,13,15},{1,2,6,7,8,11,14},{1,2,6,7,8,11,14,15},{1,2,6,7,8,11,15},{1,2,6,7,8,12},{1,2,6,7,8,12,13},{1,2,6,7,8,12,13,14},{1,2,6,7,8,12,13,14,15},{1,2,6,7,8,12,13,15},{1,2,6,7,8,12,14},{1,2,6,7,8,12,14,15},{1,2,6,7,8,12,15},{1,2,6,7,8,13},{1,2,6,7,8,13,14},{1,2,6,7,8,13,14,15},{1,2,6,7,8,13,15},{1,2,6,7,8,14},{1,2,6,7,8,14,15},{1,2,6,7,8,15},{1,2,6,7,9},{1,2,6,7,9,10},{1,2,6,7,9,10,11},{1,2,6,7,9,10,11,12},{1,2,6,7,9,10,11,12,13},{1,2,6,7,9,10,11,12,13,14},{1,2,6,7,9,10,11,12,13,14,15},{1,2,6,7,9,10,11,12,13,15},{1,2,6,7,9,10,11,12,14},{1,2,6,7,9,10,11,12,14,15},{1,2,6,7,9,10,11,12,15},{1,2,6,7,9,10,11,13},{1,2,6,7,9,10,11,13,14},{1,2,6,7,9,10,11,13,14,15},{1,2,6,7,9,10,11,13,15},{1,2,6,7,9,10,11,14},{1,2,6,7,9,10,11,14,15},{1,2,6,7,9,10,11,15},{1,2,6,7,9,10,12},{1,2,6,7,9,10,12,13},{1,2,6,7,9,10,12,13,14},{1,2,6,7,9,10,12,13,14,15},{1,2,6,7,9,10,12,13,15},{1,2,6,7,9,10,12,14},{1,2,6,7,9,10,12,14,15},{1,2,6,7,9,10,12,15},{1,2,6,7,9,10,13},{1,2,6,7,9,10,13,14},{1,2,6,7,9,10,13,14,15},{1,2,6,7,9,10,13,15},{1,2,6,7,9,10,14},{1,2,6,7,9,10,14,15},{1,2,6,7,9,10,15},{1,2,6,7,9,11},{1,2,6,7,9,11,12},{1,2,6,7,9,11,12,13},{1,2,6,7,9,11,12,13,14},{1,2,6,7,9,11,12,13,14,15},{1,2,6,7,9,11,12,13,15},{1,2,6,7,9,11,12,14},{1,2,6,7,9,11,12,14,15},{1,2,6,7,9,11,12,15},{1,2,6,7,9,11,13},{1,2,6,7,9,11,13,14},{1,2,6,7,9,11,13,14,15},{1,2,6,7,9,11,13,15},{1,2,6,7,9,11,14},{1,2,6,7,9,11,14,15},{1,2,6,7,9,11,15},{1,2,6,7,9,12},{1,2,6,7,9,12,13},{1,2,6,7,9,12,13,14},{1,2,6,7,9,12,13,14,15},{1,2,6,7,9,12,13,15},{1,2,6,7,9,12,14},{1,2,6,7,9,12,14,15},{1,2,6,7,9,12,15},{1,2,6,7,9,13},{1,2,6,7,9,13,14},{1,2,6,7,9,13,14,15},{1,2,6,7,9,13,15},{1,2,6,7,9,14},{1,2,6,7,9,14,15},{1,2,6,7,9,15},{1,2,6,7,10},{1,2,6,7,10,11},{1,2,6,7,10,11,12},{1,2,6,7,10,11,12,13},{1,2,6,7,10,11,12,13,14},{1,2,6,7,10,11,12,13,14,15},{1,2,6,7,10,11,12,13,15},{1,2,6,7,10,11,12,14},{1,2,6,7,10,11,12,14,15},{1,2,6,7,10,11,12,15},{1,2,6,7,10,11,13},{1,2,6,7,10,11,13,14},{1,2,6,7,10,11,13,14,15},{1,2,6,7,10,11,13,15},{1,2,6,7,10,11,14},{1,2,6,7,10,11,14,15},{1,2,6,7,10,11,15},{1,2,6,7,10,12},{1,2,6,7,10,12,13},{1,2,6,7,10,12,13,14},{1,2,6,7,10,12,13,14,15},{1,2,6,7,10,12,13,15},{1,2,6,7,10,12,14},{1,2,6,7,10,12,14,15},{1,2,6,7,10,12,15},{1,2,6,7,10,13},{1,2,6,7,10,13,14},{1,2,6,7,10,13,14,15},{1,2,6,7,10,13,15},{1,2,6,7,10,14},{1,2,6,7,10,14,15},{1,2,6,7,10,15},{1,2,6,7,11},{1,2,6,7,11,12},{1,2,6,7,11,12,13},{1,2,6,7,11,12,13,14},{1,2,6,7,11,12,13,14,15},{1,2,6,7,11,12,13,15},{1,2,6,7,11,12,14},{1,2,6,7,11,12,14,15},{1,2,6,7,11,12,15},{1,2,6,7,11,13},{1,2,6,7,11,13,14},{1,2,6,7,11,13,14,15},{1,2,6,7,11,13,15},{1,2,6,7,11,14},{1,2,6,7,11,14,15},{1,2,6,7,11,15},{1,2,6,7,12},{1,2,6,7,12,13},{1,2,6,7,12,13,14},{1,2,6,7,12,13,14,15},{1,2,6,7,12,13,15},{1,2,6,7,12,14},{1,2,6,7,12,14,15},{1,2,6,7,12,15},{1,2,6,7,13},{1,2,6,7,13,14},{1,2,6,7,13,14,15},{1,2,6,7,13,15},{1,2,6,7,14},{1,2,6,7,14,15},{1,2,6,7,15},{1,2,6,8},{1,2,6,8,9},{1,2,6,8,9,10},{1,2,6,8,9,10,11},{1,2,6,8,9,10,11,12},{1,2,6,8,9,10,11,12,13},{1,2,6,8,9,10,11,12,13,14},{1,2,6,8,9,10,11,12,13,14,15},{1,2,6,8,9,10,11,12,13,15},{1,2,6,8,9,10,11,12,14},{1,2,6,8,9,10,11,12,14,15},{1,2,6,8,9,10,11,12,15},{1,2,6,8,9,10,11,13},{1,2,6,8,9,10,11,13,14},{1,2,6,8,9,10,11,13,14,15},{1,2,6,8,9,10,11,13,15},{1,2,6,8,9,10,11,14},{1,2,6,8,9,10,11,14,15},{1,2,6,8,9,10,11,15},{1,2,6,8,9,10,12},{1,2,6,8,9,10,12,13},{1,2,6,8,9,10,12,13,14},{1,2,6,8,9,10,12,13,14,15},{1,2,6,8,9,10,12,13,15},{1,2,6,8,9,10,12,14},{1,2,6,8,9,10,12,14,15},{1,2,6,8,9,10,12,15},{1,2,6,8,9,10,13},{1,2,6,8,9,10,13,14},{1,2,6,8,9,10,13,14,15},{1,2,6,8,9,10,13,15},{1,2,6,8,9,10,14},{1,2,6,8,9,10,14,15},{1,2,6,8,9,10,15},{1,2,6,8,9,11},{1,2,6,8,9,11,12},{1,2,6,8,9,11,12,13},{1,2,6,8,9,11,12,13,14},{1,2,6,8,9,11,12,13,14,15},{1,2,6,8,9,11,12,13,15},{1,2,6,8,9,11,12,14},{1,2,6,8,9,11,12,14,15},{1,2,6,8,9,11,12,15},{1,2,6,8,9,11,13},{1,2,6,8,9,11,13,14},{1,2,6,8,9,11,13,14,15},{1,2,6,8,9,11,13,15},{1,2,6,8,9,11,14},{1,2,6,8,9,11,14,15},{1,2,6,8,9,11,15},{1,2,6,8,9,12},{1,2,6,8,9,12,13},{1,2,6,8,9,12,13,14},{1,2,6,8,9,12,13,14,15},{1,2,6,8,9,12,13,15},{1,2,6,8,9,12,14},{1,2,6,8,9,12,14,15},{1,2,6,8,9,12,15},{1,2,6,8,9,13},{1,2,6,8,9,13,14},{1,2,6,8,9,13,14,15},{1,2,6,8,9,13,15},{1,2,6,8,9,14},{1,2,6,8,9,14,15},{1,2,6,8,9,15},{1,2,6,8,10},{1,2,6,8,10,11},{1,2,6,8,10,11,12},{1,2,6,8,10,11,12,13},{1,2,6,8,10,11,12,13,14},{1,2,6,8,10,11,12,13,14,15},{1,2,6,8,10,11,12,13,15},{1,2,6,8,10,11,12,14},{1,2,6,8,10,11,12,14,15},{1,2,6,8,10,11,12,15},{1,2,6,8,10,11,13},{1,2,6,8,10,11,13,14},{1,2,6,8,10,11,13,14,15},{1,2,6,8,10,11,13,15},{1,2,6,8,10,11,14},{1,2,6,8,10,11,14,15},{1,2,6,8,10,11,15},{1,2,6,8,10,12},{1,2,6,8,10,12,13},{1,2,6,8,10,12,13,14},{1,2,6,8,10,12,13,14,15},{1,2,6,8,10,12,13,15},{1,2,6,8,10,12,14},{1,2,6,8,10,12,14,15},{1,2,6,8,10,12,15},{1,2,6,8,10,13},{1,2,6,8,10,13,14},{1,2,6,8,10,13,14,15},{1,2,6,8,10,13,15},{1,2,6,8,10,14},{1,2,6,8,10,14,15},{1,2,6,8,10,15},{1,2,6,8,11},{1,2,6,8,11,12},{1,2,6,8,11,12,13},{1,2,6,8,11,12,13,14},{1,2,6,8,11,12,13,14,15},{1,2,6,8,11,12,13,15},{1,2,6,8,11,12,14},{1,2,6,8,11,12,14,15},{1,2,6,8,11,12,15},{1,2,6,8,11,13},{1,2,6,8,11,13,14},{1,2,6,8,11,13,14,15},{1,2,6,8,11,13,15},{1,2,6,8,11,14},{1,2,6,8,11,14,15},{1,2,6,8,11,15},{1,2,6,8,12},{1,2,6,8,12,13},{1,2,6,8,12,13,14},{1,2,6,8,12,13,14,15},{1,2,6,8,12,13,15},{1,2,6,8,12,14},{1,2,6,8,12,14,15},{1,2,6,8,12,15},{1,2,6,8,13},{1,2,6,8,13,14},{1,2,6,8,13,14,15},{1,2,6,8,13,15},{1,2,6,8,14},{1,2,6,8,14,15},{1,2,6,8,15},{1,2,6,9},{1,2,6,9,10},{1,2,6,9,10,11},{1,2,6,9,10,11,12},{1,2,6,9,10,11,12,13},{1,2,6,9,10,11,12,13,14},{1,2,6,9,10,11,12,13,14,15},{1,2,6,9,10,11,12,13,15},{1,2,6,9,10,11,12,14},{1,2,6,9,10,11,12,14,15},{1,2,6,9,10,11,12,15},{1,2,6,9,10,11,13},{1,2,6,9,10,11,13,14},{1,2,6,9,10,11,13,14,15},{1,2,6,9,10,11,13,15},{1,2,6,9,10,11,14},{1,2,6,9,10,11,14,15},{1,2,6,9,10,11,15},{1,2,6,9,10,12},{1,2,6,9,10,12,13},{1,2,6,9,10,12,13,14},{1,2,6,9,10,12,13,14,15},{1,2,6,9,10,12,13,15},{1,2,6,9,10,12,14},{1,2,6,9,10,12,14,15},{1,2,6,9,10,12,15},{1,2,6,9,10,13},{1,2,6,9,10,13,14},{1,2,6,9,10,13,14,15},{1,2,6,9,10,13,15},{1,2,6,9,10,14},{1,2,6,9,10,14,15},{1,2,6,9,10,15},{1,2,6,9,11},{1,2,6,9,11,12},{1,2,6,9,11,12,13},{1,2,6,9,11,12,13,14},{1,2,6,9,11,12,13,14,15},{1,2,6,9,11,12,13,15},{1,2,6,9,11,12,14},{1,2,6,9,11,12,14,15},{1,2,6,9,11,12,15},{1,2,6,9,11,13},{1,2,6,9,11,13,14},{1,2,6,9,11,13,14,15},{1,2,6,9,11,13,15},{1,2,6,9,11,14},{1,2,6,9,11,14,15},{1,2,6,9,11,15},{1,2,6,9,12},{1,2,6,9,12,13},{1,2,6,9,12,13,14},{1,2,6,9,12,13,14,15},{1,2,6,9,12,13,15},{1,2,6,9,12,14},{1,2,6,9,12,14,15},{1,2,6,9,12,15},{1,2,6,9,13},{1,2,6,9,13,14},{1,2,6,9,13,14,15},{1,2,6,9,13,15},{1,2,6,9,14},{1,2,6,9,14,15},{1,2,6,9,15},{1,2,6,10},{1,2,6,10,11},{1,2,6,10,11,12},{1,2,6,10,11,12,13},{1,2,6,10,11,12,13,14},{1,2,6,10,11,12,13,14,15},{1,2,6,10,11,12,13,15},{1,2,6,10,11,12,14},{1,2,6,10,11,12,14,15},{1,2,6,10,11,12,15},{1,2,6,10,11,13},{1,2,6,10,11,13,14},{1,2,6,10,11,13,14,15},{1,2,6,10,11,13,15},{1,2,6,10,11,14},{1,2,6,10,11,14,15},{1,2,6,10,11,15},{1,2,6,10,12},{1,2,6,10,12,13},{1,2,6,10,12,13,14},{1,2,6,10,12,13,14,15},{1,2,6,10,12,13,15},{1,2,6,10,12,14},{1,2,6,10,12,14,15},{1,2,6,10,12,15},{1,2,6,10,13},{1,2,6,10,13,14},{1,2,6,10,13,14,15},{1,2,6,10,13,15},{1,2,6,10,14},{1,2,6,10,14,15},{1,2,6,10,15},{1,2,6,11},{1,2,6,11,12},{1,2,6,11,12,13},{1,2,6,11,12,13,14},{1,2,6,11,12,13,14,15},{1,2,6,11,12,13,15},{1,2,6,11,12,14},{1,2,6,11,12,14,15},{1,2,6,11,12,15},{1,2,6,11,13},{1,2,6,11,13,14},{1,2,6,11,13,14,15},{1,2,6,11,13,15},{1,2,6,11,14},{1,2,6,11,14,15},{1,2,6,11,15},{1,2,6,12},{1,2,6,12,13},{1,2,6,12,13,14},{1,2,6,12,13,14,15},{1,2,6,12,13,15},{1,2,6,12,14},{1,2,6,12,14,15},{1,2,6,12,15},{1,2,6,13},{1,2,6,13,14},{1,2,6,13,14,15},{1,2,6,13,15},{1,2,6,14},{1,2,6,14,15},{1,2,6,15},{1,2,7},{1,2,7,8},{1,2,7,8,9},{1,2,7,8,9,10},{1,2,7,8,9,10,11},{1,2,7,8,9,10,11,12},{1,2,7,8,9,10,11,12,13},{1,2,7,8,9,10,11,12,13,14},{1,2,7,8,9,10,11,12,13,14,15},{1,2,7,8,9,10,11,12,13,15},{1,2,7,8,9,10,11,12,14},{1,2,7,8,9,10,11,12,14,15},{1,2,7,8,9,10,11,12,15},{1,2,7,8,9,10,11,13},{1,2,7,8,9,10,11,13,14},{1,2,7,8,9,10,11,13,14,15},{1,2,7,8,9,10,11,13,15},{1,2,7,8,9,10,11,14},{1,2,7,8,9,10,11,14,15},{1,2,7,8,9,10,11,15},{1,2,7,8,9,10,12},{1,2,7,8,9,10,12,13},{1,2,7,8,9,10,12,13,14},{1,2,7,8,9,10,12,13,14,15},{1,2,7,8,9,10,12,13,15},{1,2,7,8,9,10,12,14},{1,2,7,8,9,10,12,14,15},{1,2,7,8,9,10,12,15},{1,2,7,8,9,10,13},{1,2,7,8,9,10,13,14},{1,2,7,8,9,10,13,14,15},{1,2,7,8,9,10,13,15},{1,2,7,8,9,10,14},{1,2,7,8,9,10,14,15},{1,2,7,8,9,10,15},{1,2,7,8,9,11},{1,2,7,8,9,11,12},{1,2,7,8,9,11,12,13},{1,2,7,8,9,11,12,13,14},{1,2,7,8,9,11,12,13,14,15},{1,2,7,8,9,11,12,13,15},{1,2,7,8,9,11,12,14},{1,2,7,8,9,11,12,14,15},{1,2,7,8,9,11,12,15},{1,2,7,8,9,11,13},{1,2,7,8,9,11,13,14},{1,2,7,8,9,11,13,14,15},{1,2,7,8,9,11,13,15},{1,2,7,8,9,11,14},{1,2,7,8,9,11,14,15},{1,2,7,8,9,11,15},{1,2,7,8,9,12},{1,2,7,8,9,12,13},{1,2,7,8,9,12,13,14},{1,2,7,8,9,12,13,14,15},{1,2,7,8,9,12,13,15},{1,2,7,8,9,12,14},{1,2,7,8,9,12,14,15},{1,2,7,8,9,12,15},{1,2,7,8,9,13},{1,2,7,8,9,13,14},{1,2,7,8,9,13,14,15},{1,2,7,8,9,13,15},{1,2,7,8,9,14},{1,2,7,8,9,14,15},{1,2,7,8,9,15},{1,2,7,8,10},{1,2,7,8,10,11},{1,2,7,8,10,11,12},{1,2,7,8,10,11,12,13},{1,2,7,8,10,11,12,13,14},{1,2,7,8,10,11,12,13,14,15},{1,2,7,8,10,11,12,13,15},{1,2,7,8,10,11,12,14},{1,2,7,8,10,11,12,14,15},{1,2,7,8,10,11,12,15},{1,2,7,8,10,11,13},{1,2,7,8,10,11,13,14},{1,2,7,8,10,11,13,14,15},{1,2,7,8,10,11,13,15},{1,2,7,8,10,11,14},{1,2,7,8,10,11,14,15},{1,2,7,8,10,11,15},{1,2,7,8,10,12},{1,2,7,8,10,12,13},{1,2,7,8,10,12,13,14},{1,2,7,8,10,12,13,14,15},{1,2,7,8,10,12,13,15},{1,2,7,8,10,12,14},{1,2,7,8,10,12,14,15},{1,2,7,8,10,12,15},{1,2,7,8,10,13},{1,2,7,8,10,13,14},{1,2,7,8,10,13,14,15},{1,2,7,8,10,13,15},{1,2,7,8,10,14},{1,2,7,8,10,14,15},{1,2,7,8,10,15},{1,2,7,8,11},{1,2,7,8,11,12},{1,2,7,8,11,12,13},{1,2,7,8,11,12,13,14},{1,2,7,8,11,12,13,14,15},{1,2,7,8,11,12,13,15},{1,2,7,8,11,12,14},{1,2,7,8,11,12,14,15},{1,2,7,8,11,12,15},{1,2,7,8,11,13},{1,2,7,8,11,13,14},{1,2,7,8,11,13,14,15},{1,2,7,8,11,13,15},{1,2,7,8,11,14},{1,2,7,8,11,14,15},{1,2,7,8,11,15},{1,2,7,8,12},{1,2,7,8,12,13},{1,2,7,8,12,13,14},{1,2,7,8,12,13,14,15},{1,2,7,8,12,13,15},{1,2,7,8,12,14},{1,2,7,8,12,14,15},{1,2,7,8,12,15},{1,2,7,8,13},{1,2,7,8,13,14},{1,2,7,8,13,14,15},{1,2,7,8,13,15},{1,2,7,8,14},{1,2,7,8,14,15},{1,2,7,8,15},{1,2,7,9},{1,2,7,9,10},{1,2,7,9,10,11},{1,2,7,9,10,11,12},{1,2,7,9,10,11,12,13},{1,2,7,9,10,11,12,13,14},{1,2,7,9,10,11,12,13,14,15},{1,2,7,9,10,11,12,13,15},{1,2,7,9,10,11,12,14},{1,2,7,9,10,11,12,14,15},{1,2,7,9,10,11,12,15},{1,2,7,9,10,11,13},{1,2,7,9,10,11,13,14},{1,2,7,9,10,11,13,14,15},{1,2,7,9,10,11,13,15},{1,2,7,9,10,11,14},{1,2,7,9,10,11,14,15},{1,2,7,9,10,11,15},{1,2,7,9,10,12},{1,2,7,9,10,12,13},{1,2,7,9,10,12,13,14},{1,2,7,9,10,12,13,14,15},{1,2,7,9,10,12,13,15},{1,2,7,9,10,12,14},{1,2,7,9,10,12,14,15},{1,2,7,9,10,12,15},{1,2,7,9,10,13},{1,2,7,9,10,13,14},{1,2,7,9,10,13,14,15},{1,2,7,9,10,13,15},{1,2,7,9,10,14},{1,2,7,9,10,14,15},{1,2,7,9,10,15},{1,2,7,9,11},{1,2,7,9,11,12},{1,2,7,9,11,12,13},{1,2,7,9,11,12,13,14},{1,2,7,9,11,12,13,14,15},{1,2,7,9,11,12,13,15},{1,2,7,9,11,12,14},{1,2,7,9,11,12,14,15},{1,2,7,9,11,12,15},{1,2,7,9,11,13},{1,2,7,9,11,13,14},{1,2,7,9,11,13,14,15},{1,2,7,9,11,13,15},{1,2,7,9,11,14},{1,2,7,9,11,14,15},{1,2,7,9,11,15},{1,2,7,9,12},{1,2,7,9,12,13},{1,2,7,9,12,13,14},{1,2,7,9,12,13,14,15},{1,2,7,9,12,13,15},{1,2,7,9,12,14},{1,2,7,9,12,14,15},{1,2,7,9,12,15},{1,2,7,9,13},{1,2,7,9,13,14},{1,2,7,9,13,14,15},{1,2,7,9,13,15},{1,2,7,9,14},{1,2,7,9,14,15},{1,2,7,9,15},{1,2,7,10},{1,2,7,10,11},{1,2,7,10,11,12},{1,2,7,10,11,12,13},{1,2,7,10,11,12,13,14},{1,2,7,10,11,12,13,14,15},{1,2,7,10,11,12,13,15},{1,2,7,10,11,12,14},{1,2,7,10,11,12,14,15},{1,2,7,10,11,12,15},{1,2,7,10,11,13},{1,2,7,10,11,13,14},{1,2,7,10,11,13,14,15},{1,2,7,10,11,13,15},{1,2,7,10,11,14},{1,2,7,10,11,14,15},{1,2,7,10,11,15},{1,2,7,10,12},{1,2,7,10,12,13},{1,2,7,10,12,13,14},{1,2,7,10,12,13,14,15},{1,2,7,10,12,13,15},{1,2,7,10,12,14},{1,2,7,10,12,14,15},{1,2,7,10,12,15},{1,2,7,10,13},{1,2,7,10,13,14},{1,2,7,10,13,14,15},{1,2,7,10,13,15},{1,2,7,10,14},{1,2,7,10,14,15},{1,2,7,10,15},{1,2,7,11},{1,2,7,11,12},{1,2,7,11,12,13},{1,2,7,11,12,13,14},{1,2,7,11,12,13,14,15},{1,2,7,11,12,13,15},{1,2,7,11,12,14},{1,2,7,11,12,14,15},{1,2,7,11,12,15},{1,2,7,11,13},{1,2,7,11,13,14},{1,2,7,11,13,14,15},{1,2,7,11,13,15},{1,2,7,11,14},{1,2,7,11,14,15},{1,2,7,11,15},{1,2,7,12},{1,2,7,12,13},{1,2,7,12,13,14},{1,2,7,12,13,14,15},{1,2,7,12,13,15},{1,2,7,12,14},{1,2,7,12,14,15},{1,2,7,12,15},{1,2,7,13},{1,2,7,13,14},{1,2,7,13,14,15},{1,2,7,13,15},{1,2,7,14},{1,2,7,14,15},{1,2,7,15},{1,2,8},{1,2,8,9},{1,2,8,9,10},{1,2,8,9,10,11},{1,2,8,9,10,11,12},{1,2,8,9,10,11,12,13},{1,2,8,9,10,11,12,13,14},{1,2,8,9,10,11,12,13,14,15},{1,2,8,9,10,11,12,13,15},{1,2,8,9,10,11,12,14},{1,2,8,9,10,11,12,14,15},{1,2,8,9,10,11,12,15},{1,2,8,9,10,11,13},{1,2,8,9,10,11,13,14},{1,2,8,9,10,11,13,14,15},{1,2,8,9,10,11,13,15},{1,2,8,9,10,11,14},{1,2,8,9,10,11,14,15},{1,2,8,9,10,11,15},{1,2,8,9,10,12},{1,2,8,9,10,12,13},{1,2,8,9,10,12,13,14},{1,2,8,9,10,12,13,14,15},{1,2,8,9,10,12,13,15},{1,2,8,9,10,12,14},{1,2,8,9,10,12,14,15},{1,2,8,9,10,12,15},{1,2,8,9,10,13},{1,2,8,9,10,13,14},{1,2,8,9,10,13,14,15},{1,2,8,9,10,13,15},{1,2,8,9,10,14},{1,2,8,9,10,14,15},{1,2,8,9,10,15},{1,2,8,9,11},{1,2,8,9,11,12},{1,2,8,9,11,12,13},{1,2,8,9,11,12,13,14},{1,2,8,9,11,12,13,14,15},{1,2,8,9,11,12,13,15},{1,2,8,9,11,12,14},{1,2,8,9,11,12,14,15},{1,2,8,9,11,12,15},{1,2,8,9,11,13},{1,2,8,9,11,13,14},{1,2,8,9,11,13,14,15},{1,2,8,9,11,13,15},{1,2,8,9,11,14},{1,2,8,9,11,14,15},{1,2,8,9,11,15},{1,2,8,9,12},{1,2,8,9,12,13},{1,2,8,9,12,13,14},{1,2,8,9,12,13,14,15},{1,2,8,9,12,13,15},{1,2,8,9,12,14},{1,2,8,9,12,14,15},{1,2,8,9,12,15},{1,2,8,9,13},{1,2,8,9,13,14},{1,2,8,9,13,14,15},{1,2,8,9,13,15},{1,2,8,9,14},{1,2,8,9,14,15},{1,2,8,9,15},{1,2,8,10},{1,2,8,10,11},{1,2,8,10,11,12},{1,2,8,10,11,12,13},{1,2,8,10,11,12,13,14},{1,2,8,10,11,12,13,14,15},{1,2,8,10,11,12,13,15},{1,2,8,10,11,12,14},{1,2,8,10,11,12,14,15},{1,2,8,10,11,12,15},{1,2,8,10,11,13},{1,2,8,10,11,13,14},{1,2,8,10,11,13,14,15},{1,2,8,10,11,13,15},{1,2,8,10,11,14},{1,2,8,10,11,14,15},{1,2,8,10,11,15},{1,2,8,10,12},{1,2,8,10,12,13},{1,2,8,10,12,13,14},{1,2,8,10,12,13,14,15},{1,2,8,10,12,13,15},{1,2,8,10,12,14},{1,2,8,10,12,14,15},{1,2,8,10,12,15},{1,2,8,10,13},{1,2,8,10,13,14},{1,2,8,10,13,14,15},{1,2,8,10,13,15},{1,2,8,10,14},{1,2,8,10,14,15},{1,2,8,10,15},{1,2,8,11},{1,2,8,11,12},{1,2,8,11,12,13},{1,2,8,11,12,13,14},{1,2,8,11,12,13,14,15},{1,2,8,11,12,13,15},{1,2,8,11,12,14},{1,2,8,11,12,14,15},{1,2,8,11,12,15},{1,2,8,11,13},{1,2,8,11,13,14},{1,2,8,11,13,14,15},{1,2,8,11,13,15},{1,2,8,11,14},{1,2,8,11,14,15},{1,2,8,11,15},{1,2,8,12},{1,2,8,12,13},{1,2,8,12,13,14},{1,2,8,12,13,14,15},{1,2,8,12,13,15},{1,2,8,12,14},{1,2,8,12,14,15},{1,2,8,12,15},{1,2,8,13},{1,2,8,13,14},{1,2,8,13,14,15},{1,2,8,13,15},{1,2,8,14},{1,2,8,14,15},{1,2,8,15},{1,2,9},{1,2,9,10},{1,2,9,10,11},{1,2,9,10,11,12},{1,2,9,10,11,12,13},{1,2,9,10,11,12,13,14},{1,2,9,10,11,12,13,14,15},{1,2,9,10,11,12,13,15},{1,2,9,10,11,12,14},{1,2,9,10,11,12,14,15},{1,2,9,10,11,12,15},{1,2,9,10,11,13},{1,2,9,10,11,13,14},{1,2,9,10,11,13,14,15},{1,2,9,10,11,13,15},{1,2,9,10,11,14},{1,2,9,10,11,14,15},{1,2,9,10,11,15},{1,2,9,10,12},{1,2,9,10,12,13},{1,2,9,10,12,13,14},{1,2,9,10,12,13,14,15},{1,2,9,10,12,13,15},{1,2,9,10,12,14},{1,2,9,10,12,14,15},{1,2,9,10,12,15},{1,2,9,10,13},{1,2,9,10,13,14},{1,2,9,10,13,14,15},{1,2,9,10,13,15},{1,2,9,10,14},{1,2,9,10,14,15},{1,2,9,10,15},{1,2,9,11},{1,2,9,11,12},{1,2,9,11,12,13},{1,2,9,11,12,13,14},{1,2,9,11,12,13,14,15},{1,2,9,11,12,13,15},{1,2,9,11,12,14},{1,2,9,11,12,14,15},{1,2,9,11,12,15},{1,2,9,11,13},{1,2,9,11,13,14},{1,2,9,11,13,14,15},{1,2,9,11,13,15},{1,2,9,11,14},{1,2,9,11,14,15},{1,2,9,11,15},{1,2,9,12},{1,2,9,12,13},{1,2,9,12,13,14},{1,2,9,12,13,14,15},{1,2,9,12,13,15},{1,2,9,12,14},{1,2,9,12,14,15},{1,2,9,12,15},{1,2,9,13},{1,2,9,13,14},{1,2,9,13,14,15},{1,2,9,13,15},{1,2,9,14},{1,2,9,14,15},{1,2,9,15},{1,2,10},{1,2,10,11},{1,2,10,11,12},{1,2,10,11,12,13},{1,2,10,11,12,13,14},{1,2,10,11,12,13,14,15},{1,2,10,11,12,13,15},{1,2,10,11,12,14},{1,2,10,11,12,14,15},{1,2,10,11,12,15},{1,2,10,11,13},{1,2,10,11,13,14},{1,2,10,11,13,14,15},{1,2,10,11,13,15},{1,2,10,11,14},{1,2,10,11,14,15},{1,2,10,11,15},{1,2,10,12},{1,2,10,12,13},{1,2,10,12,13,14},{1,2,10,12,13,14,15},{1,2,10,12,13,15},{1,2,10,12,14},{1,2,10,12,14,15},{1,2,10,12,15},{1,2,10,13},{1,2,10,13,14},{1,2,10,13,14,15},{1,2,10,13,15},{1,2,10,14},{1,2,10,14,15},{1,2,10,15},{1,2,11},{1,2,11,12},{1,2,11,12,13},{1,2,11,12,13,14},{1,2,11,12,13,14,15},{1,2,11,12,13,15},{1,2,11,12,14},{1,2,11,12,14,15},{1,2,11,12,15},{1,2,11,13},{1,2,11,13,14},{1,2,11,13,14,15},{1,2,11,13,15},{1,2,11,14},{1,2,11,14,15},{1,2,11,15},{1,2,12},{1,2,12,13},{1,2,12,13,14},{1,2,12,13,14,15},{1,2,12,13,15},{1,2,12,14},{1,2,12,14,15},{1,2,12,15},{1,2,13},{1,2,13,14},{1,2,13,14,15},{1,2,13,15},{1,2,14},{1,2,14,15},{1,2,15},{1,3},{1,3,4},{1,3,4,5},{1,3,4,5,6},{1,3,4,5,6,7},{1,3,4,5,6,7,8},{1,3,4,5,6,7,8,9},{1,3,4,5,6,7,8,9,10},{1,3,4,5,6,7,8,9,10,11},{1,3,4,5,6,7,8,9,10,11,12},{1,3,4,5,6,7,8,9,10,11,12,13},{1,3,4,5,6,7,8,9,10,11,12,13,14},{1,3,4,5,6,7,8,9,10,11,12,13,14,15},{1,3,4,5,6,7,8,9,10,11,12,13,15},{1,3,4,5,6,7,8,9,10,11,12,14},{1,3,4,5,6,7,8,9,10,11,12,14,15},{1,3,4,5,6,7,8,9,10,11,12,15},{1,3,4,5,6,7,8,9,10,11,13},{1,3,4,5,6,7,8,9,10,11,13,14},{1,3,4,5,6,7,8,9,10,11,13,14,15},{1,3,4,5,6,7,8,9,10,11,13,15},{1,3,4,5,6,7,8,9,10,11,14},{1,3,4,5,6,7,8,9,10,11,14,15},{1,3,4,5,6,7,8,9,10,11,15},{1,3,4,5,6,7,8,9,10,12},{1,3,4,5,6,7,8,9,10,12,13},{1,3,4,5,6,7,8,9,10,12,13,14},{1,3,4,5,6,7,8,9,10,12,13,14,15},{1,3,4,5,6,7,8,9,10,12,13,15},{1,3,4,5,6,7,8,9,10,12,14},{1,3,4,5,6,7,8,9,10,12,14,15},{1,3,4,5,6,7,8,9,10,12,15},{1,3,4,5,6,7,8,9,10,13},{1,3,4,5,6,7,8,9,10,13,14},{1,3,4,5,6,7,8,9,10,13,14,15},{1,3,4,5,6,7,8,9,10,13,15},{1,3,4,5,6,7,8,9,10,14},{1,3,4,5,6,7,8,9,10,14,15},{1,3,4,5,6,7,8,9,10,15},{1,3,4,5,6,7,8,9,11},{1,3,4,5,6,7,8,9,11,12},{1,3,4,5,6,7,8,9,11,12,13},{1,3,4,5,6,7,8,9,11,12,13,14},{1,3,4,5,6,7,8,9,11,12,13,14,15},{1,3,4,5,6,7,8,9,11,12,13,15},{1,3,4,5,6,7,8,9,11,12,14},{1,3,4,5,6,7,8,9,11,12,14,15},{1,3,4,5,6,7,8,9,11,12,15},{1,3,4,5,6,7,8,9,11,13},{1,3,4,5,6,7,8,9,11,13,14},{1,3,4,5,6,7,8,9,11,13,14,15},{1,3,4,5,6,7,8,9,11,13,15},{1,3,4,5,6,7,8,9,11,14},{1,3,4,5,6,7,8,9,11,14,15},{1,3,4,5,6,7,8,9,11,15},{1,3,4,5,6,7,8,9,12},{1,3,4,5,6,7,8,9,12,13},{1,3,4,5,6,7,8,9,12,13,14},{1,3,4,5,6,7,8,9,12,13,14,15},{1,3,4,5,6,7,8,9,12,13,15},{1,3,4,5,6,7,8,9,12,14},{1,3,4,5,6,7,8,9,12,14,15},{1,3,4,5,6,7,8,9,12,15},{1,3,4,5,6,7,8,9,13},{1,3,4,5,6,7,8,9,13,14},{1,3,4,5,6,7,8,9,13,14,15},{1,3,4,5,6,7,8,9,13,15},{1,3,4,5,6,7,8,9,14},{1,3,4,5,6,7,8,9,14,15},{1,3,4,5,6,7,8,9,15},{1,3,4,5,6,7,8,10},{1,3,4,5,6,7,8,10,11},{1,3,4,5,6,7,8,10,11,12},{1,3,4,5,6,7,8,10,11,12,13},{1,3,4,5,6,7,8,10,11,12,13,14},{1,3,4,5,6,7,8,10,11,12,13,14,15},{1,3,4,5,6,7,8,10,11,12,13,15},{1,3,4,5,6,7,8,10,11,12,14},{1,3,4,5,6,7,8,10,11,12,14,15},{1,3,4,5,6,7,8,10,11,12,15},{1,3,4,5,6,7,8,10,11,13},{1,3,4,5,6,7,8,10,11,13,14},{1,3,4,5,6,7,8,10,11,13,14,15},{1,3,4,5,6,7,8,10,11,13,15},{1,3,4,5,6,7,8,10,11,14},{1,3,4,5,6,7,8,10,11,14,15},{1,3,4,5,6,7,8,10,11,15},{1,3,4,5,6,7,8,10,12},{1,3,4,5,6,7,8,10,12,13},{1,3,4,5,6,7,8,10,12,13,14},{1,3,4,5,6,7,8,10,12,13,14,15},{1,3,4,5,6,7,8,10,12,13,15},{1,3,4,5,6,7,8,10,12,14},{1,3,4,5,6,7,8,10,12,14,15},{1,3,4,5,6,7,8,10,12,15},{1,3,4,5,6,7,8,10,13},{1,3,4,5,6,7,8,10,13,14},{1,3,4,5,6,7,8,10,13,14,15},{1,3,4,5,6,7,8,10,13,15},{1,3,4,5,6,7,8,10,14},{1,3,4,5,6,7,8,10,14,15},{1,3,4,5,6,7,8,10,15},{1,3,4,5,6,7,8,11},{1,3,4,5,6,7,8,11,12},{1,3,4,5,6,7,8,11,12,13},{1,3,4,5,6,7,8,11,12,13,14},{1,3,4,5,6,7,8,11,12,13,14,15},{1,3,4,5,6,7,8,11,12,13,15},{1,3,4,5,6,7,8,11,12,14},{1,3,4,5,6,7,8,11,12,14,15},{1,3,4,5,6,7,8,11,12,15},{1,3,4,5,6,7,8,11,13},{1,3,4,5,6,7,8,11,13,14},{1,3,4,5,6,7,8,11,13,14,15},{1,3,4,5,6,7,8,11,13,15},{1,3,4,5,6,7,8,11,14},{1,3,4,5,6,7,8,11,14,15},{1,3,4,5,6,7,8,11,15},{1,3,4,5,6,7,8,12},{1,3,4,5,6,7,8,12,13},{1,3,4,5,6,7,8,12,13,14},{1,3,4,5,6,7,8,12,13,14,15},{1,3,4,5,6,7,8,12,13,15},{1,3,4,5,6,7,8,12,14},{1,3,4,5,6,7,8,12,14,15},{1,3,4,5,6,7,8,12,15},{1,3,4,5,6,7,8,13},{1,3,4,5,6,7,8,13,14},{1,3,4,5,6,7,8,13,14,15},{1,3,4,5,6,7,8,13,15},{1,3,4,5,6,7,8,14},{1,3,4,5,6,7,8,14,15},{1,3,4,5,6,7,8,15},{1,3,4,5,6,7,9},{1,3,4,5,6,7,9,10},{1,3,4,5,6,7,9,10,11},{1,3,4,5,6,7,9,10,11,12},{1,3,4,5,6,7,9,10,11,12,13},{1,3,4,5,6,7,9,10,11,12,13,14},{1,3,4,5,6,7,9,10,11,12,13,14,15},{1,3,4,5,6,7,9,10,11,12,13,15},{1,3,4,5,6,7,9,10,11,12,14},{1,3,4,5,6,7,9,10,11,12,14,15},{1,3,4,5,6,7,9,10,11,12,15},{1,3,4,5,6,7,9,10,11,13},{1,3,4,5,6,7,9,10,11,13,14},{1,3,4,5,6,7,9,10,11,13,14,15},{1,3,4,5,6,7,9,10,11,13,15},{1,3,4,5,6,7,9,10,11,14},{1,3,4,5,6,7,9,10,11,14,15},{1,3,4,5,6,7,9,10,11,15},{1,3,4,5,6,7,9,10,12},{1,3,4,5,6,7,9,10,12,13},{1,3,4,5,6,7,9,10,12,13,14},{1,3,4,5,6,7,9,10,12,13,14,15},{1,3,4,5,6,7,9,10,12,13,15},{1,3,4,5,6,7,9,10,12,14},{1,3,4,5,6,7,9,10,12,14,15},{1,3,4,5,6,7,9,10,12,15},{1,3,4,5,6,7,9,10,13},{1,3,4,5,6,7,9,10,13,14},{1,3,4,5,6,7,9,10,13,14,15},{1,3,4,5,6,7,9,10,13,15},{1,3,4,5,6,7,9,10,14},{1,3,4,5,6,7,9,10,14,15},{1,3,4,5,6,7,9,10,15},{1,3,4,5,6,7,9,11},{1,3,4,5,6,7,9,11,12},{1,3,4,5,6,7,9,11,12,13},{1,3,4,5,6,7,9,11,12,13,14},{1,3,4,5,6,7,9,11,12,13,14,15},{1,3,4,5,6,7,9,11,12,13,15},{1,3,4,5,6,7,9,11,12,14},{1,3,4,5,6,7,9,11,12,14,15},{1,3,4,5,6,7,9,11,12,15},{1,3,4,5,6,7,9,11,13},{1,3,4,5,6,7,9,11,13,14},{1,3,4,5,6,7,9,11,13,14,15},{1,3,4,5,6,7,9,11,13,15},{1,3,4,5,6,7,9,11,14},{1,3,4,5,6,7,9,11,14,15},{1,3,4,5,6,7,9,11,15},{1,3,4,5,6,7,9,12},{1,3,4,5,6,7,9,12,13},{1,3,4,5,6,7,9,12,13,14},{1,3,4,5,6,7,9,12,13,14,15},{1,3,4,5,6,7,9,12,13,15},{1,3,4,5,6,7,9,12,14},{1,3,4,5,6,7,9,12,14,15},{1,3,4,5,6,7,9,12,15},{1,3,4,5,6,7,9,13},{1,3,4,5,6,7,9,13,14},{1,3,4,5,6,7,9,13,14,15},{1,3,4,5,6,7,9,13,15},{1,3,4,5,6,7,9,14},{1,3,4,5,6,7,9,14,15},{1,3,4,5,6,7,9,15},{1,3,4,5,6,7,10},{1,3,4,5,6,7,10,11},{1,3,4,5,6,7,10,11,12},{1,3,4,5,6,7,10,11,12,13},{1,3,4,5,6,7,10,11,12,13,14},{1,3,4,5,6,7,10,11,12,13,14,15},{1,3,4,5,6,7,10,11,12,13,15},{1,3,4,5,6,7,10,11,12,14},{1,3,4,5,6,7,10,11,12,14,15},{1,3,4,5,6,7,10,11,12,15},{1,3,4,5,6,7,10,11,13},{1,3,4,5,6,7,10,11,13,14},{1,3,4,5,6,7,10,11,13,14,15},{1,3,4,5,6,7,10,11,13,15},{1,3,4,5,6,7,10,11,14},{1,3,4,5,6,7,10,11,14,15},{1,3,4,5,6,7,10,11,15},{1,3,4,5,6,7,10,12},{1,3,4,5,6,7,10,12,13},{1,3,4,5,6,7,10,12,13,14},{1,3,4,5,6,7,10,12,13,14,15},{1,3,4,5,6,7,10,12,13,15},{1,3,4,5,6,7,10,12,14},{1,3,4,5,6,7,10,12,14,15},{1,3,4,5,6,7,10,12,15},{1,3,4,5,6,7,10,13},{1,3,4,5,6,7,10,13,14},{1,3,4,5,6,7,10,13,14,15},{1,3,4,5,6,7,10,13,15},{1,3,4,5,6,7,10,14},{1,3,4,5,6,7,10,14,15},{1,3,4,5,6,7,10,15},{1,3,4,5,6,7,11},{1,3,4,5,6,7,11,12},{1,3,4,5,6,7,11,12,13},{1,3,4,5,6,7,11,12,13,14},{1,3,4,5,6,7,11,12,13,14,15},{1,3,4,5,6,7,11,12,13,15},{1,3,4,5,6,7,11,12,14},{1,3,4,5,6,7,11,12,14,15},{1,3,4,5,6,7,11,12,15},{1,3,4,5,6,7,11,13},{1,3,4,5,6,7,11,13,14},{1,3,4,5,6,7,11,13,14,15},{1,3,4,5,6,7,11,13,15},{1,3,4,5,6,7,11,14},{1,3,4,5,6,7,11,14,15},{1,3,4,5,6,7,11,15},{1,3,4,5,6,7,12},{1,3,4,5,6,7,12,13},{1,3,4,5,6,7,12,13,14},{1,3,4,5,6,7,12,13,14,15},{1,3,4,5,6,7,12,13,15},{1,3,4,5,6,7,12,14},{1,3,4,5,6,7,12,14,15},{1,3,4,5,6,7,12,15},{1,3,4,5,6,7,13},{1,3,4,5,6,7,13,14},{1,3,4,5,6,7,13,14,15},{1,3,4,5,6,7,13,15},{1,3,4,5,6,7,14},{1,3,4,5,6,7,14,15},{1,3,4,5,6,7,15},{1,3,4,5,6,8},{1,3,4,5,6,8,9},{1,3,4,5,6,8,9,10},{1,3,4,5,6,8,9,10,11},{1,3,4,5,6,8,9,10,11,12},{1,3,4,5,6,8,9,10,11,12,13},{1,3,4,5,6,8,9,10,11,12,13,14},{1,3,4,5,6,8,9,10,11,12,13,14,15},{1,3,4,5,6,8,9,10,11,12,13,15},{1,3,4,5,6,8,9,10,11,12,14},{1,3,4,5,6,8,9,10,11,12,14,15},{1,3,4,5,6,8,9,10,11,12,15},{1,3,4,5,6,8,9,10,11,13},{1,3,4,5,6,8,9,10,11,13,14},{1,3,4,5,6,8,9,10,11,13,14,15},{1,3,4,5,6,8,9,10,11,13,15},{1,3,4,5,6,8,9,10,11,14},{1,3,4,5,6,8,9,10,11,14,15},{1,3,4,5,6,8,9,10,11,15},{1,3,4,5,6,8,9,10,12},{1,3,4,5,6,8,9,10,12,13},{1,3,4,5,6,8,9,10,12,13,14},{1,3,4,5,6,8,9,10,12,13,14,15},{1,3,4,5,6,8,9,10,12,13,15},{1,3,4,5,6,8,9,10,12,14},{1,3,4,5,6,8,9,10,12,14,15},{1,3,4,5,6,8,9,10,12,15},{1,3,4,5,6,8,9,10,13},{1,3,4,5,6,8,9,10,13,14},{1,3,4,5,6,8,9,10,13,14,15},{1,3,4,5,6,8,9,10,13,15},{1,3,4,5,6,8,9,10,14},{1,3,4,5,6,8,9,10,14,15},{1,3,4,5,6,8,9,10,15},{1,3,4,5,6,8,9,11},{1,3,4,5,6,8,9,11,12},{1,3,4,5,6,8,9,11,12,13},{1,3,4,5,6,8,9,11,12,13,14},{1,3,4,5,6,8,9,11,12,13,14,15},{1,3,4,5,6,8,9,11,12,13,15},{1,3,4,5,6,8,9,11,12,14},{1,3,4,5,6,8,9,11,12,14,15},{1,3,4,5,6,8,9,11,12,15},{1,3,4,5,6,8,9,11,13},{1,3,4,5,6,8,9,11,13,14},{1,3,4,5,6,8,9,11,13,14,15},{1,3,4,5,6,8,9,11,13,15},{1,3,4,5,6,8,9,11,14},{1,3,4,5,6,8,9,11,14,15},{1,3,4,5,6,8,9,11,15},{1,3,4,5,6,8,9,12},{1,3,4,5,6,8,9,12,13},{1,3,4,5,6,8,9,12,13,14},{1,3,4,5,6,8,9,12,13,14,15},{1,3,4,5,6,8,9,12,13,15},{1,3,4,5,6,8,9,12,14},{1,3,4,5,6,8,9,12,14,15},{1,3,4,5,6,8,9,12,15},{1,3,4,5,6,8,9,13},{1,3,4,5,6,8,9,13,14},{1,3,4,5,6,8,9,13,14,15},{1,3,4,5,6,8,9,13,15},{1,3,4,5,6,8,9,14},{1,3,4,5,6,8,9,14,15},{1,3,4,5,6,8,9,15},{1,3,4,5,6,8,10},{1,3,4,5,6,8,10,11},{1,3,4,5,6,8,10,11,12},{1,3,4,5,6,8,10,11,12,13},{1,3,4,5,6,8,10,11,12,13,14},{1,3,4,5,6,8,10,11,12,13,14,15},{1,3,4,5,6,8,10,11,12,13,15},{1,3,4,5,6,8,10,11,12,14},{1,3,4,5,6,8,10,11,12,14,15},{1,3,4,5,6,8,10,11,12,15},{1,3,4,5,6,8,10,11,13},{1,3,4,5,6,8,10,11,13,14},{1,3,4,5,6,8,10,11,13,14,15},{1,3,4,5,6,8,10,11,13,15},{1,3,4,5,6,8,10,11,14},{1,3,4,5,6,8,10,11,14,15},{1,3,4,5,6,8,10,11,15},{1,3,4,5,6,8,10,12},{1,3,4,5,6,8,10,12,13},{1,3,4,5,6,8,10,12,13,14},{1,3,4,5,6,8,10,12,13,14,15},{1,3,4,5,6,8,10,12,13,15},{1,3,4,5,6,8,10,12,14},{1,3,4,5,6,8,10,12,14,15},{1,3,4,5,6,8,10,12,15},{1,3,4,5,6,8,10,13},{1,3,4,5,6,8,10,13,14},{1,3,4,5,6,8,10,13,14,15},{1,3,4,5,6,8,10,13,15},{1,3,4,5,6,8,10,14},{1,3,4,5,6,8,10,14,15},{1,3,4,5,6,8,10,15},{1,3,4,5,6,8,11},{1,3,4,5,6,8,11,12},{1,3,4,5,6,8,11,12,13},{1,3,4,5,6,8,11,12,13,14},{1,3,4,5,6,8,11,12,13,14,15},{1,3,4,5,6,8,11,12,13,15},{1,3,4,5,6,8,11,12,14},{1,3,4,5,6,8,11,12,14,15},{1,3,4,5,6,8,11,12,15},{1,3,4,5,6,8,11,13},{1,3,4,5,6,8,11,13,14},{1,3,4,5,6,8,11,13,14,15},{1,3,4,5,6,8,11,13,15},{1,3,4,5,6,8,11,14},{1,3,4,5,6,8,11,14,15},{1,3,4,5,6,8,11,15},{1,3,4,5,6,8,12},{1,3,4,5,6,8,12,13},{1,3,4,5,6,8,12,13,14},{1,3,4,5,6,8,12,13,14,15},{1,3,4,5,6,8,12,13,15},{1,3,4,5,6,8,12,14},{1,3,4,5,6,8,12,14,15},{1,3,4,5,6,8,12,15},{1,3,4,5,6,8,13},{1,3,4,5,6,8,13,14},{1,3,4,5,6,8,13,14,15},{1,3,4,5,6,8,13,15},{1,3,4,5,6,8,14},{1,3,4,5,6,8,14,15},{1,3,4,5,6,8,15},{1,3,4,5,6,9},{1,3,4,5,6,9,10},{1,3,4,5,6,9,10,11},{1,3,4,5,6,9,10,11,12},{1,3,4,5,6,9,10,11,12,13},{1,3,4,5,6,9,10,11,12,13,14},{1,3,4,5,6,9,10,11,12,13,14,15},{1,3,4,5,6,9,10,11,12,13,15},{1,3,4,5,6,9,10,11,12,14},{1,3,4,5,6,9,10,11,12,14,15},{1,3,4,5,6,9,10,11,12,15},{1,3,4,5,6,9,10,11,13},{1,3,4,5,6,9,10,11,13,14},{1,3,4,5,6,9,10,11,13,14,15},{1,3,4,5,6,9,10,11,13,15},{1,3,4,5,6,9,10,11,14},{1,3,4,5,6,9,10,11,14,15},{1,3,4,5,6,9,10,11,15},{1,3,4,5,6,9,10,12},{1,3,4,5,6,9,10,12,13},{1,3,4,5,6,9,10,12,13,14},{1,3,4,5,6,9,10,12,13,14,15},{1,3,4,5,6,9,10,12,13,15},{1,3,4,5,6,9,10,12,14},{1,3,4,5,6,9,10,12,14,15},{1,3,4,5,6,9,10,12,15},{1,3,4,5,6,9,10,13},{1,3,4,5,6,9,10,13,14},{1,3,4,5,6,9,10,13,14,15},{1,3,4,5,6,9,10,13,15},{1,3,4,5,6,9,10,14},{1,3,4,5,6,9,10,14,15},{1,3,4,5,6,9,10,15},{1,3,4,5,6,9,11},{1,3,4,5,6,9,11,12},{1,3,4,5,6,9,11,12,13},{1,3,4,5,6,9,11,12,13,14},{1,3,4,5,6,9,11,12,13,14,15},{1,3,4,5,6,9,11,12,13,15},{1,3,4,5,6,9,11,12,14},{1,3,4,5,6,9,11,12,14,15},{1,3,4,5,6,9,11,12,15},{1,3,4,5,6,9,11,13},{1,3,4,5,6,9,11,13,14},{1,3,4,5,6,9,11,13,14,15},{1,3,4,5,6,9,11,13,15},{1,3,4,5,6,9,11,14},{1,3,4,5,6,9,11,14,15},{1,3,4,5,6,9,11,15},{1,3,4,5,6,9,12},{1,3,4,5,6,9,12,13},{1,3,4,5,6,9,12,13,14},{1,3,4,5,6,9,12,13,14,15},{1,3,4,5,6,9,12,13,15},{1,3,4,5,6,9,12,14},{1,3,4,5,6,9,12,14,15},{1,3,4,5,6,9,12,15},{1,3,4,5,6,9,13},{1,3,4,5,6,9,13,14},{1,3,4,5,6,9,13,14,15},{1,3,4,5,6,9,13,15},{1,3,4,5,6,9,14},{1,3,4,5,6,9,14,15},{1,3,4,5,6,9,15},{1,3,4,5,6,10},{1,3,4,5,6,10,11},{1,3,4,5,6,10,11,12},{1,3,4,5,6,10,11,12,13},{1,3,4,5,6,10,11,12,13,14},{1,3,4,5,6,10,11,12,13,14,15},{1,3,4,5,6,10,11,12,13,15},{1,3,4,5,6,10,11,12,14},{1,3,4,5,6,10,11,12,14,15},{1,3,4,5,6,10,11,12,15},{1,3,4,5,6,10,11,13},{1,3,4,5,6,10,11,13,14},{1,3,4,5,6,10,11,13,14,15},{1,3,4,5,6,10,11,13,15},{1,3,4,5,6,10,11,14},{1,3,4,5,6,10,11,14,15},{1,3,4,5,6,10,11,15},{1,3,4,5,6,10,12},{1,3,4,5,6,10,12,13},{1,3,4,5,6,10,12,13,14},{1,3,4,5,6,10,12,13,14,15},{1,3,4,5,6,10,12,13,15},{1,3,4,5,6,10,12,14},{1,3,4,5,6,10,12,14,15},{1,3,4,5,6,10,12,15},{1,3,4,5,6,10,13},{1,3,4,5,6,10,13,14},{1,3,4,5,6,10,13,14,15},{1,3,4,5,6,10,13,15},{1,3,4,5,6,10,14},{1,3,4,5,6,10,14,15},{1,3,4,5,6,10,15},{1,3,4,5,6,11},{1,3,4,5,6,11,12},{1,3,4,5,6,11,12,13},{1,3,4,5,6,11,12,13,14},{1,3,4,5,6,11,12,13,14,15},{1,3,4,5,6,11,12,13,15},{1,3,4,5,6,11,12,14},{1,3,4,5,6,11,12,14,15},{1,3,4,5,6,11,12,15},{1,3,4,5,6,11,13},{1,3,4,5,6,11,13,14},{1,3,4,5,6,11,13,14,15},{1,3,4,5,6,11,13,15},{1,3,4,5,6,11,14},{1,3,4,5,6,11,14,15},{1,3,4,5,6,11,15},{1,3,4,5,6,12},{1,3,4,5,6,12,13},{1,3,4,5,6,12,13,14},{1,3,4,5,6,12,13,14,15},{1,3,4,5,6,12,13,15},{1,3,4,5,6,12,14},{1,3,4,5,6,12,14,15},{1,3,4,5,6,12,15},{1,3,4,5,6,13},{1,3,4,5,6,13,14},{1,3,4,5,6,13,14,15},{1,3,4,5,6,13,15},{1,3,4,5,6,14},{1,3,4,5,6,14,15},{1,3,4,5,6,15},{1,3,4,5,7},{1,3,4,5,7,8},{1,3,4,5,7,8,9},{1,3,4,5,7,8,9,10},{1,3,4,5,7,8,9,10,11},{1,3,4,5,7,8,9,10,11,12},{1,3,4,5,7,8,9,10,11,12,13},{1,3,4,5,7,8,9,10,11,12,13,14},{1,3,4,5,7,8,9,10,11,12,13,14,15},{1,3,4,5,7,8,9,10,11,12,13,15},{1,3,4,5,7,8,9,10,11,12,14},{1,3,4,5,7,8,9,10,11,12,14,15},{1,3,4,5,7,8,9,10,11,12,15},{1,3,4,5,7,8,9,10,11,13},{1,3,4,5,7,8,9,10,11,13,14},{1,3,4,5,7,8,9,10,11,13,14,15},{1,3,4,5,7,8,9,10,11,13,15},{1,3,4,5,7,8,9,10,11,14},{1,3,4,5,7,8,9,10,11,14,15},{1,3,4,5,7,8,9,10,11,15},{1,3,4,5,7,8,9,10,12},{1,3,4,5,7,8,9,10,12,13},{1,3,4,5,7,8,9,10,12,13,14},{1,3,4,5,7,8,9,10,12,13,14,15},{1,3,4,5,7,8,9,10,12,13,15},{1,3,4,5,7,8,9,10,12,14},{1,3,4,5,7,8,9,10,12,14,15},{1,3,4,5,7,8,9,10,12,15},{1,3,4,5,7,8,9,10,13},{1,3,4,5,7,8,9,10,13,14},{1,3,4,5,7,8,9,10,13,14,15},{1,3,4,5,7,8,9,10,13,15},{1,3,4,5,7,8,9,10,14},{1,3,4,5,7,8,9,10,14,15},{1,3,4,5,7,8,9,10,15},{1,3,4,5,7,8,9,11},{1,3,4,5,7,8,9,11,12},{1,3,4,5,7,8,9,11,12,13},{1,3,4,5,7,8,9,11,12,13,14},{1,3,4,5,7,8,9,11,12,13,14,15},{1,3,4,5,7,8,9,11,12,13,15},{1,3,4,5,7,8,9,11,12,14},{1,3,4,5,7,8,9,11,12,14,15},{1,3,4,5,7,8,9,11,12,15},{1,3,4,5,7,8,9,11,13},{1,3,4,5,7,8,9,11,13,14},{1,3,4,5,7,8,9,11,13,14,15},{1,3,4,5,7,8,9,11,13,15},{1,3,4,5,7,8,9,11,14},{1,3,4,5,7,8,9,11,14,15},{1,3,4,5,7,8,9,11,15},{1,3,4,5,7,8,9,12},{1,3,4,5,7,8,9,12,13},{1,3,4,5,7,8,9,12,13,14},{1,3,4,5,7,8,9,12,13,14,15},{1,3,4,5,7,8,9,12,13,15},{1,3,4,5,7,8,9,12,14},{1,3,4,5,7,8,9,12,14,15},{1,3,4,5,7,8,9,12,15},{1,3,4,5,7,8,9,13},{1,3,4,5,7,8,9,13,14},{1,3,4,5,7,8,9,13,14,15},{1,3,4,5,7,8,9,13,15},{1,3,4,5,7,8,9,14},{1,3,4,5,7,8,9,14,15},{1,3,4,5,7,8,9,15},{1,3,4,5,7,8,10},{1,3,4,5,7,8,10,11},{1,3,4,5,7,8,10,11,12},{1,3,4,5,7,8,10,11,12,13},{1,3,4,5,7,8,10,11,12,13,14},{1,3,4,5,7,8,10,11,12,13,14,15},{1,3,4,5,7,8,10,11,12,13,15},{1,3,4,5,7,8,10,11,12,14},{1,3,4,5,7,8,10,11,12,14,15},{1,3,4,5,7,8,10,11,12,15},{1,3,4,5,7,8,10,11,13},{1,3,4,5,7,8,10,11,13,14},{1,3,4,5,7,8,10,11,13,14,15},{1,3,4,5,7,8,10,11,13,15},{1,3,4,5,7,8,10,11,14},{1,3,4,5,7,8,10,11,14,15},{1,3,4,5,7,8,10,11,15},{1,3,4,5,7,8,10,12},{1,3,4,5,7,8,10,12,13},{1,3,4,5,7,8,10,12,13,14},{1,3,4,5,7,8,10,12,13,14,15},{1,3,4,5,7,8,10,12,13,15},{1,3,4,5,7,8,10,12,14},{1,3,4,5,7,8,10,12,14,15},{1,3,4,5,7,8,10,12,15},{1,3,4,5,7,8,10,13},{1,3,4,5,7,8,10,13,14},{1,3,4,5,7,8,10,13,14,15},{1,3,4,5,7,8,10,13,15},{1,3,4,5,7,8,10,14},{1,3,4,5,7,8,10,14,15},{1,3,4,5,7,8,10,15},{1,3,4,5,7,8,11},{1,3,4,5,7,8,11,12},{1,3,4,5,7,8,11,12,13},{1,3,4,5,7,8,11,12,13,14},{1,3,4,5,7,8,11,12,13,14,15},{1,3,4,5,7,8,11,12,13,15},{1,3,4,5,7,8,11,12,14},{1,3,4,5,7,8,11,12,14,15},{1,3,4,5,7,8,11,12,15},{1,3,4,5,7,8,11,13},{1,3,4,5,7,8,11,13,14},{1,3,4,5,7,8,11,13,14,15},{1,3,4,5,7,8,11,13,15},{1,3,4,5,7,8,11,14},{1,3,4,5,7,8,11,14,15},{1,3,4,5,7,8,11,15},{1,3,4,5,7,8,12},{1,3,4,5,7,8,12,13},{1,3,4,5,7,8,12,13,14},{1,3,4,5,7,8,12,13,14,15},{1,3,4,5,7,8,12,13,15},{1,3,4,5,7,8,12,14},{1,3,4,5,7,8,12,14,15},{1,3,4,5,7,8,12,15},{1,3,4,5,7,8,13},{1,3,4,5,7,8,13,14},{1,3,4,5,7,8,13,14,15},{1,3,4,5,7,8,13,15},{1,3,4,5,7,8,14},{1,3,4,5,7,8,14,15},{1,3,4,5,7,8,15},{1,3,4,5,7,9},{1,3,4,5,7,9,10},{1,3,4,5,7,9,10,11},{1,3,4,5,7,9,10,11,12},{1,3,4,5,7,9,10,11,12,13},{1,3,4,5,7,9,10,11,12,13,14},{1,3,4,5,7,9,10,11,12,13,14,15},{1,3,4,5,7,9,10,11,12,13,15},{1,3,4,5,7,9,10,11,12,14},{1,3,4,5,7,9,10,11,12,14,15},{1,3,4,5,7,9,10,11,12,15},{1,3,4,5,7,9,10,11,13},{1,3,4,5,7,9,10,11,13,14},{1,3,4,5,7,9,10,11,13,14,15},{1,3,4,5,7,9,10,11,13,15},{1,3,4,5,7,9,10,11,14},{1,3,4,5,7,9,10,11,14,15},{1,3,4,5,7,9,10,11,15},{1,3,4,5,7,9,10,12},{1,3,4,5,7,9,10,12,13},{1,3,4,5,7,9,10,12,13,14},{1,3,4,5,7,9,10,12,13,14,15},{1,3,4,5,7,9,10,12,13,15},{1,3,4,5,7,9,10,12,14},{1,3,4,5,7,9,10,12,14,15},{1,3,4,5,7,9,10,12,15},{1,3,4,5,7,9,10,13},{1,3,4,5,7,9,10,13,14},{1,3,4,5,7,9,10,13,14,15},{1,3,4,5,7,9,10,13,15},{1,3,4,5,7,9,10,14},{1,3,4,5,7,9,10,14,15},{1,3,4,5,7,9,10,15},{1,3,4,5,7,9,11},{1,3,4,5,7,9,11,12},{1,3,4,5,7,9,11,12,13},{1,3,4,5,7,9,11,12,13,14},{1,3,4,5,7,9,11,12,13,14,15},{1,3,4,5,7,9,11,12,13,15},{1,3,4,5,7,9,11,12,14},{1,3,4,5,7,9,11,12,14,15},{1,3,4,5,7,9,11,12,15},{1,3,4,5,7,9,11,13},{1,3,4,5,7,9,11,13,14},{1,3,4,5,7,9,11,13,14,15},{1,3,4,5,7,9,11,13,15},{1,3,4,5,7,9,11,14},{1,3,4,5,7,9,11,14,15},{1,3,4,5,7,9,11,15},{1,3,4,5,7,9,12},{1,3,4,5,7,9,12,13},{1,3,4,5,7,9,12,13,14},{1,3,4,5,7,9,12,13,14,15},{1,3,4,5,7,9,12,13,15},{1,3,4,5,7,9,12,14},{1,3,4,5,7,9,12,14,15},{1,3,4,5,7,9,12,15},{1,3,4,5,7,9,13},{1,3,4,5,7,9,13,14},{1,3,4,5,7,9,13,14,15},{1,3,4,5,7,9,13,15},{1,3,4,5,7,9,14},{1,3,4,5,7,9,14,15},{1,3,4,5,7,9,15},{1,3,4,5,7,10},{1,3,4,5,7,10,11},{1,3,4,5,7,10,11,12},{1,3,4,5,7,10,11,12,13},{1,3,4,5,7,10,11,12,13,14},{1,3,4,5,7,10,11,12,13,14,15},{1,3,4,5,7,10,11,12,13,15},{1,3,4,5,7,10,11,12,14},{1,3,4,5,7,10,11,12,14,15},{1,3,4,5,7,10,11,12,15},{1,3,4,5,7,10,11,13},{1,3,4,5,7,10,11,13,14},{1,3,4,5,7,10,11,13,14,15},{1,3,4,5,7,10,11,13,15},{1,3,4,5,7,10,11,14},{1,3,4,5,7,10,11,14,15},{1,3,4,5,7,10,11,15},{1,3,4,5,7,10,12},{1,3,4,5,7,10,12,13},{1,3,4,5,7,10,12,13,14},{1,3,4,5,7,10,12,13,14,15},{1,3,4,5,7,10,12,13,15},{1,3,4,5,7,10,12,14},{1,3,4,5,7,10,12,14,15},{1,3,4,5,7,10,12,15},{1,3,4,5,7,10,13},{1,3,4,5,7,10,13,14},{1,3,4,5,7,10,13,14,15},{1,3,4,5,7,10,13,15},{1,3,4,5,7,10,14},{1,3,4,5,7,10,14,15},{1,3,4,5,7,10,15},{1,3,4,5,7,11},{1,3,4,5,7,11,12},{1,3,4,5,7,11,12,13},{1,3,4,5,7,11,12,13,14},{1,3,4,5,7,11,12,13,14,15},{1,3,4,5,7,11,12,13,15},{1,3,4,5,7,11,12,14},{1,3,4,5,7,11,12,14,15},{1,3,4,5,7,11,12,15},{1,3,4,5,7,11,13},{1,3,4,5,7,11,13,14},{1,3,4,5,7,11,13,14,15},{1,3,4,5,7,11,13,15},{1,3,4,5,7,11,14},{1,3,4,5,7,11,14,15},{1,3,4,5,7,11,15},{1,3,4,5,7,12},{1,3,4,5,7,12,13},{1,3,4,5,7,12,13,14},{1,3,4,5,7,12,13,14,15},{1,3,4,5,7,12,13,15},{1,3,4,5,7,12,14},{1,3,4,5,7,12,14,15},{1,3,4,5,7,12,15},{1,3,4,5,7,13},{1,3,4,5,7,13,14},{1,3,4,5,7,13,14,15},{1,3,4,5,7,13,15},{1,3,4,5,7,14},{1,3,4,5,7,14,15},{1,3,4,5,7,15},{1,3,4,5,8},{1,3,4,5,8,9},{1,3,4,5,8,9,10},{1,3,4,5,8,9,10,11},{1,3,4,5,8,9,10,11,12},{1,3,4,5,8,9,10,11,12,13},{1,3,4,5,8,9,10,11,12,13,14},{1,3,4,5,8,9,10,11,12,13,14,15},{1,3,4,5,8,9,10,11,12,13,15},{1,3,4,5,8,9,10,11,12,14},{1,3,4,5,8,9,10,11,12,14,15},{1,3,4,5,8,9,10,11,12,15},{1,3,4,5,8,9,10,11,13},{1,3,4,5,8,9,10,11,13,14},{1,3,4,5,8,9,10,11,13,14,15},{1,3,4,5,8,9,10,11,13,15},{1,3,4,5,8,9,10,11,14},{1,3,4,5,8,9,10,11,14,15},{1,3,4,5,8,9,10,11,15},{1,3,4,5,8,9,10,12},{1,3,4,5,8,9,10,12,13},{1,3,4,5,8,9,10,12,13,14},{1,3,4,5,8,9,10,12,13,14,15},{1,3,4,5,8,9,10,12,13,15},{1,3,4,5,8,9,10,12,14},{1,3,4,5,8,9,10,12,14,15},{1,3,4,5,8,9,10,12,15},{1,3,4,5,8,9,10,13},{1,3,4,5,8,9,10,13,14},{1,3,4,5,8,9,10,13,14,15},{1,3,4,5,8,9,10,13,15},{1,3,4,5,8,9,10,14},{1,3,4,5,8,9,10,14,15},{1,3,4,5,8,9,10,15},{1,3,4,5,8,9,11},{1,3,4,5,8,9,11,12},{1,3,4,5,8,9,11,12,13},{1,3,4,5,8,9,11,12,13,14},{1,3,4,5,8,9,11,12,13,14,15},{1,3,4,5,8,9,11,12,13,15},{1,3,4,5,8,9,11,12,14},{1,3,4,5,8,9,11,12,14,15},{1,3,4,5,8,9,11,12,15},{1,3,4,5,8,9,11,13},{1,3,4,5,8,9,11,13,14},{1,3,4,5,8,9,11,13,14,15},{1,3,4,5,8,9,11,13,15},{1,3,4,5,8,9,11,14},{1,3,4,5,8,9,11,14,15},{1,3,4,5,8,9,11,15},{1,3,4,5,8,9,12},{1,3,4,5,8,9,12,13},{1,3,4,5,8,9,12,13,14},{1,3,4,5,8,9,12,13,14,15},{1,3,4,5,8,9,12,13,15},{1,3,4,5,8,9,12,14},{1,3,4,5,8,9,12,14,15},{1,3,4,5,8,9,12,15},{1,3,4,5,8,9,13},{1,3,4,5,8,9,13,14},{1,3,4,5,8,9,13,14,15},{1,3,4,5,8,9,13,15},{1,3,4,5,8,9,14},{1,3,4,5,8,9,14,15},{1,3,4,5,8,9,15},{1,3,4,5,8,10},{1,3,4,5,8,10,11},{1,3,4,5,8,10,11,12},{1,3,4,5,8,10,11,12,13},{1,3,4,5,8,10,11,12,13,14},{1,3,4,5,8,10,11,12,13,14,15},{1,3,4,5,8,10,11,12,13,15},{1,3,4,5,8,10,11,12,14},{1,3,4,5,8,10,11,12,14,15},{1,3,4,5,8,10,11,12,15},{1,3,4,5,8,10,11,13},{1,3,4,5,8,10,11,13,14},{1,3,4,5,8,10,11,13,14,15},{1,3,4,5,8,10,11,13,15},{1,3,4,5,8,10,11,14},{1,3,4,5,8,10,11,14,15},{1,3,4,5,8,10,11,15},{1,3,4,5,8,10,12},{1,3,4,5,8,10,12,13},{1,3,4,5,8,10,12,13,14},{1,3,4,5,8,10,12,13,14,15},{1,3,4,5,8,10,12,13,15},{1,3,4,5,8,10,12,14},{1,3,4,5,8,10,12,14,15},{1,3,4,5,8,10,12,15},{1,3,4,5,8,10,13},{1,3,4,5,8,10,13,14},{1,3,4,5,8,10,13,14,15},{1,3,4,5,8,10,13,15},{1,3,4,5,8,10,14},{1,3,4,5,8,10,14,15},{1,3,4,5,8,10,15},{1,3,4,5,8,11},{1,3,4,5,8,11,12},{1,3,4,5,8,11,12,13},{1,3,4,5,8,11,12,13,14},{1,3,4,5,8,11,12,13,14,15},{1,3,4,5,8,11,12,13,15},{1,3,4,5,8,11,12,14},{1,3,4,5,8,11,12,14,15},{1,3,4,5,8,11,12,15},{1,3,4,5,8,11,13},{1,3,4,5,8,11,13,14},{1,3,4,5,8,11,13,14,15},{1,3,4,5,8,11,13,15},{1,3,4,5,8,11,14},{1,3,4,5,8,11,14,15},{1,3,4,5,8,11,15},{1,3,4,5,8,12},{1,3,4,5,8,12,13},{1,3,4,5,8,12,13,14},{1,3,4,5,8,12,13,14,15},{1,3,4,5,8,12,13,15},{1,3,4,5,8,12,14},{1,3,4,5,8,12,14,15},{1,3,4,5,8,12,15},{1,3,4,5,8,13},{1,3,4,5,8,13,14},{1,3,4,5,8,13,14,15},{1,3,4,5,8,13,15},{1,3,4,5,8,14},{1,3,4,5,8,14,15},{1,3,4,5,8,15},{1,3,4,5,9},{1,3,4,5,9,10},{1,3,4,5,9,10,11},{1,3,4,5,9,10,11,12},{1,3,4,5,9,10,11,12,13},{1,3,4,5,9,10,11,12,13,14},{1,3,4,5,9,10,11,12,13,14,15},{1,3,4,5,9,10,11,12,13,15},{1,3,4,5,9,10,11,12,14},{1,3,4,5,9,10,11,12,14,15},{1,3,4,5,9,10,11,12,15},{1,3,4,5,9,10,11,13},{1,3,4,5,9,10,11,13,14},{1,3,4,5,9,10,11,13,14,15},{1,3,4,5,9,10,11,13,15},{1,3,4,5,9,10,11,14},{1,3,4,5,9,10,11,14,15},{1,3,4,5,9,10,11,15},{1,3,4,5,9,10,12},{1,3,4,5,9,10,12,13},{1,3,4,5,9,10,12,13,14},{1,3,4,5,9,10,12,13,14,15},{1,3,4,5,9,10,12,13,15},{1,3,4,5,9,10,12,14},{1,3,4,5,9,10,12,14,15},{1,3,4,5,9,10,12,15},{1,3,4,5,9,10,13},{1,3,4,5,9,10,13,14},{1,3,4,5,9,10,13,14,15},{1,3,4,5,9,10,13,15},{1,3,4,5,9,10,14},{1,3,4,5,9,10,14,15},{1,3,4,5,9,10,15},{1,3,4,5,9,11},{1,3,4,5,9,11,12},{1,3,4,5,9,11,12,13},{1,3,4,5,9,11,12,13,14},{1,3,4,5,9,11,12,13,14,15},{1,3,4,5,9,11,12,13,15},{1,3,4,5,9,11,12,14},{1,3,4,5,9,11,12,14,15},{1,3,4,5,9,11,12,15},{1,3,4,5,9,11,13},{1,3,4,5,9,11,13,14},{1,3,4,5,9,11,13,14,15},{1,3,4,5,9,11,13,15},{1,3,4,5,9,11,14},{1,3,4,5,9,11,14,15},{1,3,4,5,9,11,15},{1,3,4,5,9,12},{1,3,4,5,9,12,13},{1,3,4,5,9,12,13,14},{1,3,4,5,9,12,13,14,15},{1,3,4,5,9,12,13,15},{1,3,4,5,9,12,14},{1,3,4,5,9,12,14,15},{1,3,4,5,9,12,15},{1,3,4,5,9,13},{1,3,4,5,9,13,14},{1,3,4,5,9,13,14,15},{1,3,4,5,9,13,15},{1,3,4,5,9,14},{1,3,4,5,9,14,15},{1,3,4,5,9,15},{1,3,4,5,10},{1,3,4,5,10,11},{1,3,4,5,10,11,12},{1,3,4,5,10,11,12,13},{1,3,4,5,10,11,12,13,14},{1,3,4,5,10,11,12,13,14,15},{1,3,4,5,10,11,12,13,15},{1,3,4,5,10,11,12,14},{1,3,4,5,10,11,12,14,15},{1,3,4,5,10,11,12,15},{1,3,4,5,10,11,13},{1,3,4,5,10,11,13,14},{1,3,4,5,10,11,13,14,15},{1,3,4,5,10,11,13,15},{1,3,4,5,10,11,14},{1,3,4,5,10,11,14,15},{1,3,4,5,10,11,15},{1,3,4,5,10,12},{1,3,4,5,10,12,13},{1,3,4,5,10,12,13,14},{1,3,4,5,10,12,13,14,15},{1,3,4,5,10,12,13,15},{1,3,4,5,10,12,14},{1,3,4,5,10,12,14,15},{1,3,4,5,10,12,15},{1,3,4,5,10,13},{1,3,4,5,10,13,14},{1,3,4,5,10,13,14,15},{1,3,4,5,10,13,15},{1,3,4,5,10,14},{1,3,4,5,10,14,15},{1,3,4,5,10,15},{1,3,4,5,11},{1,3,4,5,11,12},{1,3,4,5,11,12,13},{1,3,4,5,11,12,13,14},{1,3,4,5,11,12,13,14,15},{1,3,4,5,11,12,13,15},{1,3,4,5,11,12,14},{1,3,4,5,11,12,14,15},{1,3,4,5,11,12,15},{1,3,4,5,11,13},{1,3,4,5,11,13,14},{1,3,4,5,11,13,14,15},{1,3,4,5,11,13,15},{1,3,4,5,11,14},{1,3,4,5,11,14,15},{1,3,4,5,11,15},{1,3,4,5,12},{1,3,4,5,12,13},{1,3,4,5,12,13,14},{1,3,4,5,12,13,14,15},{1,3,4,5,12,13,15},{1,3,4,5,12,14},{1,3,4,5,12,14,15},{1,3,4,5,12,15},{1,3,4,5,13},{1,3,4,5,13,14},{1,3,4,5,13,14,15},{1,3,4,5,13,15},{1,3,4,5,14},{1,3,4,5,14,15},{1,3,4,5,15},{1,3,4,6},{1,3,4,6,7},{1,3,4,6,7,8},{1,3,4,6,7,8,9},{1,3,4,6,7,8,9,10},{1,3,4,6,7,8,9,10,11},{1,3,4,6,7,8,9,10,11,12},{1,3,4,6,7,8,9,10,11,12,13},{1,3,4,6,7,8,9,10,11,12,13,14},{1,3,4,6,7,8,9,10,11,12,13,14,15},{1,3,4,6,7,8,9,10,11,12,13,15},{1,3,4,6,7,8,9,10,11,12,14},{1,3,4,6,7,8,9,10,11,12,14,15},{1,3,4,6,7,8,9,10,11,12,15},{1,3,4,6,7,8,9,10,11,13},{1,3,4,6,7,8,9,10,11,13,14},{1,3,4,6,7,8,9,10,11,13,14,15},{1,3,4,6,7,8,9,10,11,13,15},{1,3,4,6,7,8,9,10,11,14},{1,3,4,6,7,8,9,10,11,14,15},{1,3,4,6,7,8,9,10,11,15},{1,3,4,6,7,8,9,10,12},{1,3,4,6,7,8,9,10,12,13},{1,3,4,6,7,8,9,10,12,13,14},{1,3,4,6,7,8,9,10,12,13,14,15},{1,3,4,6,7,8,9,10,12,13,15},{1,3,4,6,7,8,9,10,12,14},{1,3,4,6,7,8,9,10,12,14,15},{1,3,4,6,7,8,9,10,12,15},{1,3,4,6,7,8,9,10,13},{1,3,4,6,7,8,9,10,13,14},{1,3,4,6,7,8,9,10,13,14,15},{1,3,4,6,7,8,9,10,13,15},{1,3,4,6,7,8,9,10,14},{1,3,4,6,7,8,9,10,14,15},{1,3,4,6,7,8,9,10,15},{1,3,4,6,7,8,9,11},{1,3,4,6,7,8,9,11,12},{1,3,4,6,7,8,9,11,12,13},{1,3,4,6,7,8,9,11,12,13,14},{1,3,4,6,7,8,9,11,12,13,14,15},{1,3,4,6,7,8,9,11,12,13,15},{1,3,4,6,7,8,9,11,12,14},{1,3,4,6,7,8,9,11,12,14,15},{1,3,4,6,7,8,9,11,12,15},{1,3,4,6,7,8,9,11,13},{1,3,4,6,7,8,9,11,13,14},{1,3,4,6,7,8,9,11,13,14,15},{1,3,4,6,7,8,9,11,13,15},{1,3,4,6,7,8,9,11,14},{1,3,4,6,7,8,9,11,14,15},{1,3,4,6,7,8,9,11,15},{1,3,4,6,7,8,9,12},{1,3,4,6,7,8,9,12,13},{1,3,4,6,7,8,9,12,13,14},{1,3,4,6,7,8,9,12,13,14,15},{1,3,4,6,7,8,9,12,13,15},{1,3,4,6,7,8,9,12,14},{1,3,4,6,7,8,9,12,14,15},{1,3,4,6,7,8,9,12,15},{1,3,4,6,7,8,9,13},{1,3,4,6,7,8,9,13,14},{1,3,4,6,7,8,9,13,14,15},{1,3,4,6,7,8,9,13,15},{1,3,4,6,7,8,9,14},{1,3,4,6,7,8,9,14,15},{1,3,4,6,7,8,9,15},{1,3,4,6,7,8,10},{1,3,4,6,7,8,10,11},{1,3,4,6,7,8,10,11,12},{1,3,4,6,7,8,10,11,12,13},{1,3,4,6,7,8,10,11,12,13,14},{1,3,4,6,7,8,10,11,12,13,14,15},{1,3,4,6,7,8,10,11,12,13,15},{1,3,4,6,7,8,10,11,12,14},{1,3,4,6,7,8,10,11,12,14,15},{1,3,4,6,7,8,10,11,12,15},{1,3,4,6,7,8,10,11,13},{1,3,4,6,7,8,10,11,13,14},{1,3,4,6,7,8,10,11,13,14,15},{1,3,4,6,7,8,10,11,13,15},{1,3,4,6,7,8,10,11,14},{1,3,4,6,7,8,10,11,14,15},{1,3,4,6,7,8,10,11,15},{1,3,4,6,7,8,10,12},{1,3,4,6,7,8,10,12,13},{1,3,4,6,7,8,10,12,13,14},{1,3,4,6,7,8,10,12,13,14,15},{1,3,4,6,7,8,10,12,13,15},{1,3,4,6,7,8,10,12,14},{1,3,4,6,7,8,10,12,14,15},{1,3,4,6,7,8,10,12,15},{1,3,4,6,7,8,10,13},{1,3,4,6,7,8,10,13,14},{1,3,4,6,7,8,10,13,14,15},{1,3,4,6,7,8,10,13,15},{1,3,4,6,7,8,10,14},{1,3,4,6,7,8,10,14,15},{1,3,4,6,7,8,10,15},{1,3,4,6,7,8,11},{1,3,4,6,7,8,11,12},{1,3,4,6,7,8,11,12,13},{1,3,4,6,7,8,11,12,13,14},{1,3,4,6,7,8,11,12,13,14,15},{1,3,4,6,7,8,11,12,13,15},{1,3,4,6,7,8,11,12,14},{1,3,4,6,7,8,11,12,14,15},{1,3,4,6,7,8,11,12,15},{1,3,4,6,7,8,11,13},{1,3,4,6,7,8,11,13,14},{1,3,4,6,7,8,11,13,14,15},{1,3,4,6,7,8,11,13,15},{1,3,4,6,7,8,11,14},{1,3,4,6,7,8,11,14,15},{1,3,4,6,7,8,11,15},{1,3,4,6,7,8,12},{1,3,4,6,7,8,12,13},{1,3,4,6,7,8,12,13,14},{1,3,4,6,7,8,12,13,14,15},{1,3,4,6,7,8,12,13,15},{1,3,4,6,7,8,12,14},{1,3,4,6,7,8,12,14,15},{1,3,4,6,7,8,12,15},{1,3,4,6,7,8,13},{1,3,4,6,7,8,13,14},{1,3,4,6,7,8,13,14,15},{1,3,4,6,7,8,13,15},{1,3,4,6,7,8,14},{1,3,4,6,7,8,14,15},{1,3,4,6,7,8,15},{1,3,4,6,7,9},{1,3,4,6,7,9,10},{1,3,4,6,7,9,10,11},{1,3,4,6,7,9,10,11,12},{1,3,4,6,7,9,10,11,12,13},{1,3,4,6,7,9,10,11,12,13,14},{1,3,4,6,7,9,10,11,12,13,14,15},{1,3,4,6,7,9,10,11,12,13,15},{1,3,4,6,7,9,10,11,12,14},{1,3,4,6,7,9,10,11,12,14,15},{1,3,4,6,7,9,10,11,12,15},{1,3,4,6,7,9,10,11,13},{1,3,4,6,7,9,10,11,13,14},{1,3,4,6,7,9,10,11,13,14,15},{1,3,4,6,7,9,10,11,13,15},{1,3,4,6,7,9,10,11,14},{1,3,4,6,7,9,10,11,14,15},{1,3,4,6,7,9,10,11,15},{1,3,4,6,7,9,10,12},{1,3,4,6,7,9,10,12,13},{1,3,4,6,7,9,10,12,13,14},{1,3,4,6,7,9,10,12,13,14,15},{1,3,4,6,7,9,10,12,13,15},{1,3,4,6,7,9,10,12,14},{1,3,4,6,7,9,10,12,14,15},{1,3,4,6,7,9,10,12,15},{1,3,4,6,7,9,10,13},{1,3,4,6,7,9,10,13,14},{1,3,4,6,7,9,10,13,14,15},{1,3,4,6,7,9,10,13,15},{1,3,4,6,7,9,10,14},{1,3,4,6,7,9,10,14,15},{1,3,4,6,7,9,10,15},{1,3,4,6,7,9,11},{1,3,4,6,7,9,11,12},{1,3,4,6,7,9,11,12,13},{1,3,4,6,7,9,11,12,13,14},{1,3,4,6,7,9,11,12,13,14,15},{1,3,4,6,7,9,11,12,13,15},{1,3,4,6,7,9,11,12,14},{1,3,4,6,7,9,11,12,14,15},{1,3,4,6,7,9,11,12,15},{1,3,4,6,7,9,11,13},{1,3,4,6,7,9,11,13,14},{1,3,4,6,7,9,11,13,14,15},{1,3,4,6,7,9,11,13,15},{1,3,4,6,7,9,11,14},{1,3,4,6,7,9,11,14,15},{1,3,4,6,7,9,11,15},{1,3,4,6,7,9,12},{1,3,4,6,7,9,12,13},{1,3,4,6,7,9,12,13,14},{1,3,4,6,7,9,12,13,14,15},{1,3,4,6,7,9,12,13,15},{1,3,4,6,7,9,12,14},{1,3,4,6,7,9,12,14,15},{1,3,4,6,7,9,12,15},{1,3,4,6,7,9,13},{1,3,4,6,7,9,13,14},{1,3,4,6,7,9,13,14,15},{1,3,4,6,7,9,13,15},{1,3,4,6,7,9,14},{1,3,4,6,7,9,14,15},{1,3,4,6,7,9,15},{1,3,4,6,7,10},{1,3,4,6,7,10,11},{1,3,4,6,7,10,11,12},{1,3,4,6,7,10,11,12,13},{1,3,4,6,7,10,11,12,13,14},{1,3,4,6,7,10,11,12,13,14,15},{1,3,4,6,7,10,11,12,13,15},{1,3,4,6,7,10,11,12,14},{1,3,4,6,7,10,11,12,14,15},{1,3,4,6,7,10,11,12,15},{1,3,4,6,7,10,11,13},{1,3,4,6,7,10,11,13,14},{1,3,4,6,7,10,11,13,14,15},{1,3,4,6,7,10,11,13,15},{1,3,4,6,7,10,11,14},{1,3,4,6,7,10,11,14,15},{1,3,4,6,7,10,11,15},{1,3,4,6,7,10,12},{1,3,4,6,7,10,12,13},{1,3,4,6,7,10,12,13,14},{1,3,4,6,7,10,12,13,14,15},{1,3,4,6,7,10,12,13,15},{1,3,4,6,7,10,12,14},{1,3,4,6,7,10,12,14,15},{1,3,4,6,7,10,12,15},{1,3,4,6,7,10,13},{1,3,4,6,7,10,13,14},{1,3,4,6,7,10,13,14,15},{1,3,4,6,7,10,13,15},{1,3,4,6,7,10,14},{1,3,4,6,7,10,14,15},{1,3,4,6,7,10,15},{1,3,4,6,7,11},{1,3,4,6,7,11,12},{1,3,4,6,7,11,12,13},{1,3,4,6,7,11,12,13,14},{1,3,4,6,7,11,12,13,14,15},{1,3,4,6,7,11,12,13,15},{1,3,4,6,7,11,12,14},{1,3,4,6,7,11,12,14,15},{1,3,4,6,7,11,12,15},{1,3,4,6,7,11,13},{1,3,4,6,7,11,13,14},{1,3,4,6,7,11,13,14,15},{1,3,4,6,7,11,13,15},{1,3,4,6,7,11,14},{1,3,4,6,7,11,14,15},{1,3,4,6,7,11,15},{1,3,4,6,7,12},{1,3,4,6,7,12,13},{1,3,4,6,7,12,13,14},{1,3,4,6,7,12,13,14,15},{1,3,4,6,7,12,13,15},{1,3,4,6,7,12,14},{1,3,4,6,7,12,14,15},{1,3,4,6,7,12,15},{1,3,4,6,7,13},{1,3,4,6,7,13,14},{1,3,4,6,7,13,14,15},{1,3,4,6,7,13,15},{1,3,4,6,7,14},{1,3,4,6,7,14,15},{1,3,4,6,7,15},{1,3,4,6,8},{1,3,4,6,8,9},{1,3,4,6,8,9,10},{1,3,4,6,8,9,10,11},{1,3,4,6,8,9,10,11,12},{1,3,4,6,8,9,10,11,12,13},{1,3,4,6,8,9,10,11,12,13,14},{1,3,4,6,8,9,10,11,12,13,14,15},{1,3,4,6,8,9,10,11,12,13,15},{1,3,4,6,8,9,10,11,12,14},{1,3,4,6,8,9,10,11,12,14,15},{1,3,4,6,8,9,10,11,12,15},{1,3,4,6,8,9,10,11,13},{1,3,4,6,8,9,10,11,13,14},{1,3,4,6,8,9,10,11,13,14,15},{1,3,4,6,8,9,10,11,13,15},{1,3,4,6,8,9,10,11,14},{1,3,4,6,8,9,10,11,14,15},{1,3,4,6,8,9,10,11,15},{1,3,4,6,8,9,10,12},{1,3,4,6,8,9,10,12,13},{1,3,4,6,8,9,10,12,13,14},{1,3,4,6,8,9,10,12,13,14,15},{1,3,4,6,8,9,10,12,13,15},{1,3,4,6,8,9,10,12,14},{1,3,4,6,8,9,10,12,14,15},{1,3,4,6,8,9,10,12,15},{1,3,4,6,8,9,10,13},{1,3,4,6,8,9,10,13,14},{1,3,4,6,8,9,10,13,14,15},{1,3,4,6,8,9,10,13,15},{1,3,4,6,8,9,10,14},{1,3,4,6,8,9,10,14,15},{1,3,4,6,8,9,10,15},{1,3,4,6,8,9,11},{1,3,4,6,8,9,11,12},{1,3,4,6,8,9,11,12,13},{1,3,4,6,8,9,11,12,13,14},{1,3,4,6,8,9,11,12,13,14,15},{1,3,4,6,8,9,11,12,13,15},{1,3,4,6,8,9,11,12,14},{1,3,4,6,8,9,11,12,14,15},{1,3,4,6,8,9,11,12,15},{1,3,4,6,8,9,11,13},{1,3,4,6,8,9,11,13,14},{1,3,4,6,8,9,11,13,14,15},{1,3,4,6,8,9,11,13,15},{1,3,4,6,8,9,11,14},{1,3,4,6,8,9,11,14,15},{1,3,4,6,8,9,11,15},{1,3,4,6,8,9,12},{1,3,4,6,8,9,12,13},{1,3,4,6,8,9,12,13,14},{1,3,4,6,8,9,12,13,14,15},{1,3,4,6,8,9,12,13,15},{1,3,4,6,8,9,12,14},{1,3,4,6,8,9,12,14,15},{1,3,4,6,8,9,12,15},{1,3,4,6,8,9,13},{1,3,4,6,8,9,13,14},{1,3,4,6,8,9,13,14,15},{1,3,4,6,8,9,13,15},{1,3,4,6,8,9,14},{1,3,4,6,8,9,14,15},{1,3,4,6,8,9,15},{1,3,4,6,8,10},{1,3,4,6,8,10,11},{1,3,4,6,8,10,11,12},{1,3,4,6,8,10,11,12,13},{1,3,4,6,8,10,11,12,13,14},{1,3,4,6,8,10,11,12,13,14,15},{1,3,4,6,8,10,11,12,13,15},{1,3,4,6,8,10,11,12,14},{1,3,4,6,8,10,11,12,14,15},{1,3,4,6,8,10,11,12,15},{1,3,4,6,8,10,11,13},{1,3,4,6,8,10,11,13,14},{1,3,4,6,8,10,11,13,14,15},{1,3,4,6,8,10,11,13,15},{1,3,4,6,8,10,11,14},{1,3,4,6,8,10,11,14,15},{1,3,4,6,8,10,11,15},{1,3,4,6,8,10,12},{1,3,4,6,8,10,12,13},{1,3,4,6,8,10,12,13,14},{1,3,4,6,8,10,12,13,14,15},{1,3,4,6,8,10,12,13,15},{1,3,4,6,8,10,12,14},{1,3,4,6,8,10,12,14,15},{1,3,4,6,8,10,12,15},{1,3,4,6,8,10,13},{1,3,4,6,8,10,13,14},{1,3,4,6,8,10,13,14,15},{1,3,4,6,8,10,13,15},{1,3,4,6,8,10,14},{1,3,4,6,8,10,14,15},{1,3,4,6,8,10,15},{1,3,4,6,8,11},{1,3,4,6,8,11,12},{1,3,4,6,8,11,12,13},{1,3,4,6,8,11,12,13,14},{1,3,4,6,8,11,12,13,14,15},{1,3,4,6,8,11,12,13,15},{1,3,4,6,8,11,12,14},{1,3,4,6,8,11,12,14,15},{1,3,4,6,8,11,12,15},{1,3,4,6,8,11,13},{1,3,4,6,8,11,13,14},{1,3,4,6,8,11,13,14,15},{1,3,4,6,8,11,13,15},{1,3,4,6,8,11,14},{1,3,4,6,8,11,14,15},{1,3,4,6,8,11,15},{1,3,4,6,8,12},{1,3,4,6,8,12,13},{1,3,4,6,8,12,13,14},{1,3,4,6,8,12,13,14,15},{1,3,4,6,8,12,13,15},{1,3,4,6,8,12,14},{1,3,4,6,8,12,14,15},{1,3,4,6,8,12,15},{1,3,4,6,8,13},{1,3,4,6,8,13,14},{1,3,4,6,8,13,14,15},{1,3,4,6,8,13,15},{1,3,4,6,8,14},{1,3,4,6,8,14,15},{1,3,4,6,8,15},{1,3,4,6,9},{1,3,4,6,9,10},{1,3,4,6,9,10,11},{1,3,4,6,9,10,11,12},{1,3,4,6,9,10,11,12,13},{1,3,4,6,9,10,11,12,13,14},{1,3,4,6,9,10,11,12,13,14,15},{1,3,4,6,9,10,11,12,13,15},{1,3,4,6,9,10,11,12,14},{1,3,4,6,9,10,11,12,14,15},{1,3,4,6,9,10,11,12,15},{1,3,4,6,9,10,11,13},{1,3,4,6,9,10,11,13,14},{1,3,4,6,9,10,11,13,14,15},{1,3,4,6,9,10,11,13,15},{1,3,4,6,9,10,11,14},{1,3,4,6,9,10,11,14,15},{1,3,4,6,9,10,11,15},{1,3,4,6,9,10,12},{1,3,4,6,9,10,12,13},{1,3,4,6,9,10,12,13,14},{1,3,4,6,9,10,12,13,14,15},{1,3,4,6,9,10,12,13,15},{1,3,4,6,9,10,12,14},{1,3,4,6,9,10,12,14,15},{1,3,4,6,9,10,12,15},{1,3,4,6,9,10,13},{1,3,4,6,9,10,13,14},{1,3,4,6,9,10,13,14,15},{1,3,4,6,9,10,13,15},{1,3,4,6,9,10,14},{1,3,4,6,9,10,14,15},{1,3,4,6,9,10,15},{1,3,4,6,9,11},{1,3,4,6,9,11,12},{1,3,4,6,9,11,12,13},{1,3,4,6,9,11,12,13,14},{1,3,4,6,9,11,12,13,14,15},{1,3,4,6,9,11,12,13,15},{1,3,4,6,9,11,12,14},{1,3,4,6,9,11,12,14,15},{1,3,4,6,9,11,12,15},{1,3,4,6,9,11,13},{1,3,4,6,9,11,13,14},{1,3,4,6,9,11,13,14,15},{1,3,4,6,9,11,13,15},{1,3,4,6,9,11,14},{1,3,4,6,9,11,14,15},{1,3,4,6,9,11,15},{1,3,4,6,9,12},{1,3,4,6,9,12,13},{1,3,4,6,9,12,13,14},{1,3,4,6,9,12,13,14,15},{1,3,4,6,9,12,13,15},{1,3,4,6,9,12,14},{1,3,4,6,9,12,14,15},{1,3,4,6,9,12,15},{1,3,4,6,9,13},{1,3,4,6,9,13,14},{1,3,4,6,9,13,14,15},{1,3,4,6,9,13,15},{1,3,4,6,9,14},{1,3,4,6,9,14,15},{1,3,4,6,9,15},{1,3,4,6,10},{1,3,4,6,10,11},{1,3,4,6,10,11,12},{1,3,4,6,10,11,12,13},{1,3,4,6,10,11,12,13,14},{1,3,4,6,10,11,12,13,14,15},{1,3,4,6,10,11,12,13,15},{1,3,4,6,10,11,12,14},{1,3,4,6,10,11,12,14,15},{1,3,4,6,10,11,12,15},{1,3,4,6,10,11,13},{1,3,4,6,10,11,13,14},{1,3,4,6,10,11,13,14,15},{1,3,4,6,10,11,13,15},{1,3,4,6,10,11,14},{1,3,4,6,10,11,14,15},{1,3,4,6,10,11,15},{1,3,4,6,10,12},{1,3,4,6,10,12,13},{1,3,4,6,10,12,13,14},{1,3,4,6,10,12,13,14,15},{1,3,4,6,10,12,13,15},{1,3,4,6,10,12,14},{1,3,4,6,10,12,14,15},{1,3,4,6,10,12,15},{1,3,4,6,10,13},{1,3,4,6,10,13,14},{1,3,4,6,10,13,14,15},{1,3,4,6,10,13,15},{1,3,4,6,10,14},{1,3,4,6,10,14,15},{1,3,4,6,10,15},{1,3,4,6,11},{1,3,4,6,11,12},{1,3,4,6,11,12,13},{1,3,4,6,11,12,13,14},{1,3,4,6,11,12,13,14,15},{1,3,4,6,11,12,13,15},{1,3,4,6,11,12,14},{1,3,4,6,11,12,14,15},{1,3,4,6,11,12,15},{1,3,4,6,11,13},{1,3,4,6,11,13,14},{1,3,4,6,11,13,14,15},{1,3,4,6,11,13,15},{1,3,4,6,11,14},{1,3,4,6,11,14,15},{1,3,4,6,11,15},{1,3,4,6,12},{1,3,4,6,12,13},{1,3,4,6,12,13,14},{1,3,4,6,12,13,14,15},{1,3,4,6,12,13,15},{1,3,4,6,12,14},{1,3,4,6,12,14,15},{1,3,4,6,12,15},{1,3,4,6,13},{1,3,4,6,13,14},{1,3,4,6,13,14,15},{1,3,4,6,13,15},{1,3,4,6,14},{1,3,4,6,14,15},{1,3,4,6,15},{1,3,4,7},{1,3,4,7,8},{1,3,4,7,8,9},{1,3,4,7,8,9,10},{1,3,4,7,8,9,10,11},{1,3,4,7,8,9,10,11,12},{1,3,4,7,8,9,10,11,12,13},{1,3,4,7,8,9,10,11,12,13,14},{1,3,4,7,8,9,10,11,12,13,14,15},{1,3,4,7,8,9,10,11,12,13,15},{1,3,4,7,8,9,10,11,12,14},{1,3,4,7,8,9,10,11,12,14,15},{1,3,4,7,8,9,10,11,12,15},{1,3,4,7,8,9,10,11,13},{1,3,4,7,8,9,10,11,13,14},{1,3,4,7,8,9,10,11,13,14,15},{1,3,4,7,8,9,10,11,13,15},{1,3,4,7,8,9,10,11,14},{1,3,4,7,8,9,10,11,14,15},{1,3,4,7,8,9,10,11,15},{1,3,4,7,8,9,10,12},{1,3,4,7,8,9,10,12,13},{1,3,4,7,8,9,10,12,13,14},{1,3,4,7,8,9,10,12,13,14,15},{1,3,4,7,8,9,10,12,13,15},{1,3,4,7,8,9,10,12,14},{1,3,4,7,8,9,10,12,14,15},{1,3,4,7,8,9,10,12,15},{1,3,4,7,8,9,10,13},{1,3,4,7,8,9,10,13,14},{1,3,4,7,8,9,10,13,14,15},{1,3,4,7,8,9,10,13,15},{1,3,4,7,8,9,10,14},{1,3,4,7,8,9,10,14,15},{1,3,4,7,8,9,10,15},{1,3,4,7,8,9,11},{1,3,4,7,8,9,11,12},{1,3,4,7,8,9,11,12,13},{1,3,4,7,8,9,11,12,13,14},{1,3,4,7,8,9,11,12,13,14,15},{1,3,4,7,8,9,11,12,13,15},{1,3,4,7,8,9,11,12,14},{1,3,4,7,8,9,11,12,14,15},{1,3,4,7,8,9,11,12,15},{1,3,4,7,8,9,11,13},{1,3,4,7,8,9,11,13,14},{1,3,4,7,8,9,11,13,14,15},{1,3,4,7,8,9,11,13,15},{1,3,4,7,8,9,11,14},{1,3,4,7,8,9,11,14,15},{1,3,4,7,8,9,11,15},{1,3,4,7,8,9,12},{1,3,4,7,8,9,12,13},{1,3,4,7,8,9,12,13,14},{1,3,4,7,8,9,12,13,14,15},{1,3,4,7,8,9,12,13,15},{1,3,4,7,8,9,12,14},{1,3,4,7,8,9,12,14,15},{1,3,4,7,8,9,12,15},{1,3,4,7,8,9,13},{1,3,4,7,8,9,13,14},{1,3,4,7,8,9,13,14,15},{1,3,4,7,8,9,13,15},{1,3,4,7,8,9,14},{1,3,4,7,8,9,14,15},{1,3,4,7,8,9,15},{1,3,4,7,8,10},{1,3,4,7,8,10,11},{1,3,4,7,8,10,11,12},{1,3,4,7,8,10,11,12,13},{1,3,4,7,8,10,11,12,13,14},{1,3,4,7,8,10,11,12,13,14,15},{1,3,4,7,8,10,11,12,13,15},{1,3,4,7,8,10,11,12,14},{1,3,4,7,8,10,11,12,14,15},{1,3,4,7,8,10,11,12,15},{1,3,4,7,8,10,11,13},{1,3,4,7,8,10,11,13,14},{1,3,4,7,8,10,11,13,14,15},{1,3,4,7,8,10,11,13,15},{1,3,4,7,8,10,11,14},{1,3,4,7,8,10,11,14,15},{1,3,4,7,8,10,11,15},{1,3,4,7,8,10,12},{1,3,4,7,8,10,12,13},{1,3,4,7,8,10,12,13,14},{1,3,4,7,8,10,12,13,14,15},{1,3,4,7,8,10,12,13,15},{1,3,4,7,8,10,12,14},{1,3,4,7,8,10,12,14,15},{1,3,4,7,8,10,12,15},{1,3,4,7,8,10,13},{1,3,4,7,8,10,13,14},{1,3,4,7,8,10,13,14,15},{1,3,4,7,8,10,13,15},{1,3,4,7,8,10,14},{1,3,4,7,8,10,14,15},{1,3,4,7,8,10,15},{1,3,4,7,8,11},{1,3,4,7,8,11,12},{1,3,4,7,8,11,12,13},{1,3,4,7,8,11,12,13,14},{1,3,4,7,8,11,12,13,14,15},{1,3,4,7,8,11,12,13,15},{1,3,4,7,8,11,12,14},{1,3,4,7,8,11,12,14,15},{1,3,4,7,8,11,12,15},{1,3,4,7,8,11,13},{1,3,4,7,8,11,13,14},{1,3,4,7,8,11,13,14,15},{1,3,4,7,8,11,13,15},{1,3,4,7,8,11,14},{1,3,4,7,8,11,14,15},{1,3,4,7,8,11,15},{1,3,4,7,8,12},{1,3,4,7,8,12,13},{1,3,4,7,8,12,13,14},{1,3,4,7,8,12,13,14,15},{1,3,4,7,8,12,13,15},{1,3,4,7,8,12,14},{1,3,4,7,8,12,14,15},{1,3,4,7,8,12,15},{1,3,4,7,8,13},{1,3,4,7,8,13,14},{1,3,4,7,8,13,14,15},{1,3,4,7,8,13,15},{1,3,4,7,8,14},{1,3,4,7,8,14,15},{1,3,4,7,8,15},{1,3,4,7,9},{1,3,4,7,9,10},{1,3,4,7,9,10,11},{1,3,4,7,9,10,11,12},{1,3,4,7,9,10,11,12,13},{1,3,4,7,9,10,11,12,13,14},{1,3,4,7,9,10,11,12,13,14,15},{1,3,4,7,9,10,11,12,13,15},{1,3,4,7,9,10,11,12,14},{1,3,4,7,9,10,11,12,14,15},{1,3,4,7,9,10,11,12,15},{1,3,4,7,9,10,11,13},{1,3,4,7,9,10,11,13,14},{1,3,4,7,9,10,11,13,14,15},{1,3,4,7,9,10,11,13,15},{1,3,4,7,9,10,11,14},{1,3,4,7,9,10,11,14,15},{1,3,4,7,9,10,11,15},{1,3,4,7,9,10,12},{1,3,4,7,9,10,12,13},{1,3,4,7,9,10,12,13,14},{1,3,4,7,9,10,12,13,14,15},{1,3,4,7,9,10,12,13,15},{1,3,4,7,9,10,12,14},{1,3,4,7,9,10,12,14,15},{1,3,4,7,9,10,12,15},{1,3,4,7,9,10,13},{1,3,4,7,9,10,13,14},{1,3,4,7,9,10,13,14,15},{1,3,4,7,9,10,13,15},{1,3,4,7,9,10,14},{1,3,4,7,9,10,14,15},{1,3,4,7,9,10,15},{1,3,4,7,9,11},{1,3,4,7,9,11,12},{1,3,4,7,9,11,12,13},{1,3,4,7,9,11,12,13,14},{1,3,4,7,9,11,12,13,14,15},{1,3,4,7,9,11,12,13,15},{1,3,4,7,9,11,12,14},{1,3,4,7,9,11,12,14,15},{1,3,4,7,9,11,12,15},{1,3,4,7,9,11,13},{1,3,4,7,9,11,13,14},{1,3,4,7,9,11,13,14,15},{1,3,4,7,9,11,13,15},{1,3,4,7,9,11,14},{1,3,4,7,9,11,14,15},{1,3,4,7,9,11,15},{1,3,4,7,9,12},{1,3,4,7,9,12,13},{1,3,4,7,9,12,13,14},{1,3,4,7,9,12,13,14,15},{1,3,4,7,9,12,13,15},{1,3,4,7,9,12,14},{1,3,4,7,9,12,14,15},{1,3,4,7,9,12,15},{1,3,4,7,9,13},{1,3,4,7,9,13,14},{1,3,4,7,9,13,14,15},{1,3,4,7,9,13,15},{1,3,4,7,9,14},{1,3,4,7,9,14,15},{1,3,4,7,9,15},{1,3,4,7,10},{1,3,4,7,10,11},{1,3,4,7,10,11,12},{1,3,4,7,10,11,12,13},{1,3,4,7,10,11,12,13,14},{1,3,4,7,10,11,12,13,14,15},{1,3,4,7,10,11,12,13,15},{1,3,4,7,10,11,12,14},{1,3,4,7,10,11,12,14,15},{1,3,4,7,10,11,12,15},{1,3,4,7,10,11,13},{1,3,4,7,10,11,13,14},{1,3,4,7,10,11,13,14,15},{1,3,4,7,10,11,13,15},{1,3,4,7,10,11,14},{1,3,4,7,10,11,14,15},{1,3,4,7,10,11,15},{1,3,4,7,10,12},{1,3,4,7,10,12,13},{1,3,4,7,10,12,13,14},{1,3,4,7,10,12,13,14,15},{1,3,4,7,10,12,13,15},{1,3,4,7,10,12,14},{1,3,4,7,10,12,14,15},{1,3,4,7,10,12,15},{1,3,4,7,10,13},{1,3,4,7,10,13,14},{1,3,4,7,10,13,14,15},{1,3,4,7,10,13,15},{1,3,4,7,10,14},{1,3,4,7,10,14,15},{1,3,4,7,10,15},{1,3,4,7,11},{1,3,4,7,11,12},{1,3,4,7,11,12,13},{1,3,4,7,11,12,13,14},{1,3,4,7,11,12,13,14,15},{1,3,4,7,11,12,13,15},{1,3,4,7,11,12,14},{1,3,4,7,11,12,14,15},{1,3,4,7,11,12,15},{1,3,4,7,11,13},{1,3,4,7,11,13,14},{1,3,4,7,11,13,14,15},{1,3,4,7,11,13,15},{1,3,4,7,11,14},{1,3,4,7,11,14,15},{1,3,4,7,11,15},{1,3,4,7,12},{1,3,4,7,12,13},{1,3,4,7,12,13,14},{1,3,4,7,12,13,14,15},{1,3,4,7,12,13,15},{1,3,4,7,12,14},{1,3,4,7,12,14,15},{1,3,4,7,12,15},{1,3,4,7,13},{1,3,4,7,13,14},{1,3,4,7,13,14,15},{1,3,4,7,13,15},{1,3,4,7,14},{1,3,4,7,14,15},{1,3,4,7,15},{1,3,4,8},{1,3,4,8,9},{1,3,4,8,9,10},{1,3,4,8,9,10,11},{1,3,4,8,9,10,11,12},{1,3,4,8,9,10,11,12,13},{1,3,4,8,9,10,11,12,13,14},{1,3,4,8,9,10,11,12,13,14,15},{1,3,4,8,9,10,11,12,13,15},{1,3,4,8,9,10,11,12,14},{1,3,4,8,9,10,11,12,14,15},{1,3,4,8,9,10,11,12,15},{1,3,4,8,9,10,11,13},{1,3,4,8,9,10,11,13,14},{1,3,4,8,9,10,11,13,14,15},{1,3,4,8,9,10,11,13,15},{1,3,4,8,9,10,11,14},{1,3,4,8,9,10,11,14,15},{1,3,4,8,9,10,11,15},{1,3,4,8,9,10,12},{1,3,4,8,9,10,12,13},{1,3,4,8,9,10,12,13,14},{1,3,4,8,9,10,12,13,14,15},{1,3,4,8,9,10,12,13,15},{1,3,4,8,9,10,12,14},{1,3,4,8,9,10,12,14,15},{1,3,4,8,9,10,12,15},{1,3,4,8,9,10,13},{1,3,4,8,9,10,13,14},{1,3,4,8,9,10,13,14,15},{1,3,4,8,9,10,13,15},{1,3,4,8,9,10,14},{1,3,4,8,9,10,14,15},{1,3,4,8,9,10,15},{1,3,4,8,9,11},{1,3,4,8,9,11,12},{1,3,4,8,9,11,12,13},{1,3,4,8,9,11,12,13,14},{1,3,4,8,9,11,12,13,14,15},{1,3,4,8,9,11,12,13,15},{1,3,4,8,9,11,12,14},{1,3,4,8,9,11,12,14,15},{1,3,4,8,9,11,12,15},{1,3,4,8,9,11,13},{1,3,4,8,9,11,13,14},{1,3,4,8,9,11,13,14,15},{1,3,4,8,9,11,13,15},{1,3,4,8,9,11,14},{1,3,4,8,9,11,14,15},{1,3,4,8,9,11,15},{1,3,4,8,9,12},{1,3,4,8,9,12,13},{1,3,4,8,9,12,13,14},{1,3,4,8,9,12,13,14,15},{1,3,4,8,9,12,13,15},{1,3,4,8,9,12,14},{1,3,4,8,9,12,14,15},{1,3,4,8,9,12,15},{1,3,4,8,9,13},{1,3,4,8,9,13,14},{1,3,4,8,9,13,14,15},{1,3,4,8,9,13,15},{1,3,4,8,9,14},{1,3,4,8,9,14,15},{1,3,4,8,9,15},{1,3,4,8,10},{1,3,4,8,10,11},{1,3,4,8,10,11,12},{1,3,4,8,10,11,12,13},{1,3,4,8,10,11,12,13,14},{1,3,4,8,10,11,12,13,14,15},{1,3,4,8,10,11,12,13,15},{1,3,4,8,10,11,12,14},{1,3,4,8,10,11,12,14,15},{1,3,4,8,10,11,12,15},{1,3,4,8,10,11,13},{1,3,4,8,10,11,13,14},{1,3,4,8,10,11,13,14,15},{1,3,4,8,10,11,13,15},{1,3,4,8,10,11,14},{1,3,4,8,10,11,14,15},{1,3,4,8,10,11,15},{1,3,4,8,10,12},{1,3,4,8,10,12,13},{1,3,4,8,10,12,13,14},{1,3,4,8,10,12,13,14,15},{1,3,4,8,10,12,13,15},{1,3,4,8,10,12,14},{1,3,4,8,10,12,14,15},{1,3,4,8,10,12,15},{1,3,4,8,10,13},{1,3,4,8,10,13,14},{1,3,4,8,10,13,14,15},{1,3,4,8,10,13,15},{1,3,4,8,10,14},{1,3,4,8,10,14,15},{1,3,4,8,10,15},{1,3,4,8,11},{1,3,4,8,11,12},{1,3,4,8,11,12,13},{1,3,4,8,11,12,13,14},{1,3,4,8,11,12,13,14,15},{1,3,4,8,11,12,13,15},{1,3,4,8,11,12,14},{1,3,4,8,11,12,14,15},{1,3,4,8,11,12,15},{1,3,4,8,11,13},{1,3,4,8,11,13,14},{1,3,4,8,11,13,14,15},{1,3,4,8,11,13,15},{1,3,4,8,11,14},{1,3,4,8,11,14,15},{1,3,4,8,11,15},{1,3,4,8,12},{1,3,4,8,12,13},{1,3,4,8,12,13,14},{1,3,4,8,12,13,14,15},{1,3,4,8,12,13,15},{1,3,4,8,12,14},{1,3,4,8,12,14,15},{1,3,4,8,12,15},{1,3,4,8,13},{1,3,4,8,13,14},{1,3,4,8,13,14,15},{1,3,4,8,13,15},{1,3,4,8,14},{1,3,4,8,14,15},{1,3,4,8,15},{1,3,4,9},{1,3,4,9,10},{1,3,4,9,10,11},{1,3,4,9,10,11,12},{1,3,4,9,10,11,12,13},{1,3,4,9,10,11,12,13,14},{1,3,4,9,10,11,12,13,14,15},{1,3,4,9,10,11,12,13,15},{1,3,4,9,10,11,12,14},{1,3,4,9,10,11,12,14,15},{1,3,4,9,10,11,12,15},{1,3,4,9,10,11,13},{1,3,4,9,10,11,13,14},{1,3,4,9,10,11,13,14,15},{1,3,4,9,10,11,13,15},{1,3,4,9,10,11,14},{1,3,4,9,10,11,14,15},{1,3,4,9,10,11,15},{1,3,4,9,10,12},{1,3,4,9,10,12,13},{1,3,4,9,10,12,13,14},{1,3,4,9,10,12,13,14,15},{1,3,4,9,10,12,13,15},{1,3,4,9,10,12,14},{1,3,4,9,10,12,14,15},{1,3,4,9,10,12,15},{1,3,4,9,10,13},{1,3,4,9,10,13,14},{1,3,4,9,10,13,14,15},{1,3,4,9,10,13,15},{1,3,4,9,10,14},{1,3,4,9,10,14,15},{1,3,4,9,10,15},{1,3,4,9,11},{1,3,4,9,11,12},{1,3,4,9,11,12,13},{1,3,4,9,11,12,13,14},{1,3,4,9,11,12,13,14,15},{1,3,4,9,11,12,13,15},{1,3,4,9,11,12,14},{1,3,4,9,11,12,14,15},{1,3,4,9,11,12,15},{1,3,4,9,11,13},{1,3,4,9,11,13,14},{1,3,4,9,11,13,14,15},{1,3,4,9,11,13,15},{1,3,4,9,11,14},{1,3,4,9,11,14,15},{1,3,4,9,11,15},{1,3,4,9,12},{1,3,4,9,12,13},{1,3,4,9,12,13,14},{1,3,4,9,12,13,14,15},{1,3,4,9,12,13,15},{1,3,4,9,12,14},{1,3,4,9,12,14,15},{1,3,4,9,12,15},{1,3,4,9,13},{1,3,4,9,13,14},{1,3,4,9,13,14,15},{1,3,4,9,13,15},{1,3,4,9,14},{1,3,4,9,14,15},{1,3,4,9,15},{1,3,4,10},{1,3,4,10,11},{1,3,4,10,11,12},{1,3,4,10,11,12,13},{1,3,4,10,11,12,13,14},{1,3,4,10,11,12,13,14,15},{1,3,4,10,11,12,13,15},{1,3,4,10,11,12,14},{1,3,4,10,11,12,14,15},{1,3,4,10,11,12,15},{1,3,4,10,11,13},{1,3,4,10,11,13,14},{1,3,4,10,11,13,14,15},{1,3,4,10,11,13,15},{1,3,4,10,11,14},{1,3,4,10,11,14,15},{1,3,4,10,11,15},{1,3,4,10,12},{1,3,4,10,12,13},{1,3,4,10,12,13,14},{1,3,4,10,12,13,14,15},{1,3,4,10,12,13,15},{1,3,4,10,12,14},{1,3,4,10,12,14,15},{1,3,4,10,12,15},{1,3,4,10,13},{1,3,4,10,13,14},{1,3,4,10,13,14,15},{1,3,4,10,13,15},{1,3,4,10,14},{1,3,4,10,14,15},{1,3,4,10,15},{1,3,4,11},{1,3,4,11,12},{1,3,4,11,12,13},{1,3,4,11,12,13,14},{1,3,4,11,12,13,14,15},{1,3,4,11,12,13,15},{1,3,4,11,12,14},{1,3,4,11,12,14,15},{1,3,4,11,12,15},{1,3,4,11,13},{1,3,4,11,13,14},{1,3,4,11,13,14,15},{1,3,4,11,13,15},{1,3,4,11,14},{1,3,4,11,14,15},{1,3,4,11,15},{1,3,4,12},{1,3,4,12,13},{1,3,4,12,13,14},{1,3,4,12,13,14,15},{1,3,4,12,13,15},{1,3,4,12,14},{1,3,4,12,14,15},{1,3,4,12,15},{1,3,4,13},{1,3,4,13,14},{1,3,4,13,14,15},{1,3,4,13,15},{1,3,4,14},{1,3,4,14,15},{1,3,4,15},{1,3,5},{1,3,5,6},{1,3,5,6,7},{1,3,5,6,7,8},{1,3,5,6,7,8,9},{1,3,5,6,7,8,9,10},{1,3,5,6,7,8,9,10,11},{1,3,5,6,7,8,9,10,11,12},{1,3,5,6,7,8,9,10,11,12,13},{1,3,5,6,7,8,9,10,11,12,13,14},{1,3,5,6,7,8,9,10,11,12,13,14,15},{1,3,5,6,7,8,9,10,11,12,13,15},{1,3,5,6,7,8,9,10,11,12,14},{1,3,5,6,7,8,9,10,11,12,14,15},{1,3,5,6,7,8,9,10,11,12,15},{1,3,5,6,7,8,9,10,11,13},{1,3,5,6,7,8,9,10,11,13,14},{1,3,5,6,7,8,9,10,11,13,14,15},{1,3,5,6,7,8,9,10,11,13,15},{1,3,5,6,7,8,9,10,11,14},{1,3,5,6,7,8,9,10,11,14,15},{1,3,5,6,7,8,9,10,11,15},{1,3,5,6,7,8,9,10,12},{1,3,5,6,7,8,9,10,12,13},{1,3,5,6,7,8,9,10,12,13,14},{1,3,5,6,7,8,9,10,12,13,14,15},{1,3,5,6,7,8,9,10,12,13,15},{1,3,5,6,7,8,9,10,12,14},{1,3,5,6,7,8,9,10,12,14,15},{1,3,5,6,7,8,9,10,12,15},{1,3,5,6,7,8,9,10,13},{1,3,5,6,7,8,9,10,13,14},{1,3,5,6,7,8,9,10,13,14,15},{1,3,5,6,7,8,9,10,13,15},{1,3,5,6,7,8,9,10,14},{1,3,5,6,7,8,9,10,14,15},{1,3,5,6,7,8,9,10,15},{1,3,5,6,7,8,9,11},{1,3,5,6,7,8,9,11,12},{1,3,5,6,7,8,9,11,12,13},{1,3,5,6,7,8,9,11,12,13,14},{1,3,5,6,7,8,9,11,12,13,14,15},{1,3,5,6,7,8,9,11,12,13,15},{1,3,5,6,7,8,9,11,12,14},{1,3,5,6,7,8,9,11,12,14,15},{1,3,5,6,7,8,9,11,12,15},{1,3,5,6,7,8,9,11,13},{1,3,5,6,7,8,9,11,13,14},{1,3,5,6,7,8,9,11,13,14,15},{1,3,5,6,7,8,9,11,13,15},{1,3,5,6,7,8,9,11,14},{1,3,5,6,7,8,9,11,14,15},{1,3,5,6,7,8,9,11,15},{1,3,5,6,7,8,9,12},{1,3,5,6,7,8,9,12,13},{1,3,5,6,7,8,9,12,13,14},{1,3,5,6,7,8,9,12,13,14,15},{1,3,5,6,7,8,9,12,13,15},{1,3,5,6,7,8,9,12,14},{1,3,5,6,7,8,9,12,14,15},{1,3,5,6,7,8,9,12,15},{1,3,5,6,7,8,9,13},{1,3,5,6,7,8,9,13,14},{1,3,5,6,7,8,9,13,14,15},{1,3,5,6,7,8,9,13,15},{1,3,5,6,7,8,9,14},{1,3,5,6,7,8,9,14,15},{1,3,5,6,7,8,9,15},{1,3,5,6,7,8,10},{1,3,5,6,7,8,10,11},{1,3,5,6,7,8,10,11,12},{1,3,5,6,7,8,10,11,12,13},{1,3,5,6,7,8,10,11,12,13,14},{1,3,5,6,7,8,10,11,12,13,14,15},{1,3,5,6,7,8,10,11,12,13,15},{1,3,5,6,7,8,10,11,12,14},{1,3,5,6,7,8,10,11,12,14,15},{1,3,5,6,7,8,10,11,12,15},{1,3,5,6,7,8,10,11,13},{1,3,5,6,7,8,10,11,13,14},{1,3,5,6,7,8,10,11,13,14,15},{1,3,5,6,7,8,10,11,13,15},{1,3,5,6,7,8,10,11,14},{1,3,5,6,7,8,10,11,14,15},{1,3,5,6,7,8,10,11,15},{1,3,5,6,7,8,10,12},{1,3,5,6,7,8,10,12,13},{1,3,5,6,7,8,10,12,13,14},{1,3,5,6,7,8,10,12,13,14,15},{1,3,5,6,7,8,10,12,13,15},{1,3,5,6,7,8,10,12,14},{1,3,5,6,7,8,10,12,14,15},{1,3,5,6,7,8,10,12,15},{1,3,5,6,7,8,10,13},{1,3,5,6,7,8,10,13,14},{1,3,5,6,7,8,10,13,14,15},{1,3,5,6,7,8,10,13,15},{1,3,5,6,7,8,10,14},{1,3,5,6,7,8,10,14,15},{1,3,5,6,7,8,10,15},{1,3,5,6,7,8,11},{1,3,5,6,7,8,11,12},{1,3,5,6,7,8,11,12,13},{1,3,5,6,7,8,11,12,13,14},{1,3,5,6,7,8,11,12,13,14,15},{1,3,5,6,7,8,11,12,13,15},{1,3,5,6,7,8,11,12,14},{1,3,5,6,7,8,11,12,14,15},{1,3,5,6,7,8,11,12,15},{1,3,5,6,7,8,11,13},{1,3,5,6,7,8,11,13,14},{1,3,5,6,7,8,11,13,14,15},{1,3,5,6,7,8,11,13,15},{1,3,5,6,7,8,11,14},{1,3,5,6,7,8,11,14,15},{1,3,5,6,7,8,11,15},{1,3,5,6,7,8,12},{1,3,5,6,7,8,12,13},{1,3,5,6,7,8,12,13,14},{1,3,5,6,7,8,12,13,14,15},{1,3,5,6,7,8,12,13,15},{1,3,5,6,7,8,12,14},{1,3,5,6,7,8,12,14,15},{1,3,5,6,7,8,12,15},{1,3,5,6,7,8,13},{1,3,5,6,7,8,13,14},{1,3,5,6,7,8,13,14,15},{1,3,5,6,7,8,13,15},{1,3,5,6,7,8,14},{1,3,5,6,7,8,14,15},{1,3,5,6,7,8,15},{1,3,5,6,7,9},{1,3,5,6,7,9,10},{1,3,5,6,7,9,10,11},{1,3,5,6,7,9,10,11,12},{1,3,5,6,7,9,10,11,12,13},{1,3,5,6,7,9,10,11,12,13,14},{1,3,5,6,7,9,10,11,12,13,14,15},{1,3,5,6,7,9,10,11,12,13,15},{1,3,5,6,7,9,10,11,12,14},{1,3,5,6,7,9,10,11,12,14,15},{1,3,5,6,7,9,10,11,12,15},{1,3,5,6,7,9,10,11,13},{1,3,5,6,7,9,10,11,13,14},{1,3,5,6,7,9,10,11,13,14,15},{1,3,5,6,7,9,10,11,13,15},{1,3,5,6,7,9,10,11,14},{1,3,5,6,7,9,10,11,14,15},{1,3,5,6,7,9,10,11,15},{1,3,5,6,7,9,10,12},{1,3,5,6,7,9,10,12,13},{1,3,5,6,7,9,10,12,13,14},{1,3,5,6,7,9,10,12,13,14,15},{1,3,5,6,7,9,10,12,13,15},{1,3,5,6,7,9,10,12,14},{1,3,5,6,7,9,10,12,14,15},{1,3,5,6,7,9,10,12,15},{1,3,5,6,7,9,10,13},{1,3,5,6,7,9,10,13,14},{1,3,5,6,7,9,10,13,14,15},{1,3,5,6,7,9,10,13,15},{1,3,5,6,7,9,10,14},{1,3,5,6,7,9,10,14,15},{1,3,5,6,7,9,10,15},{1,3,5,6,7,9,11},{1,3,5,6,7,9,11,12},{1,3,5,6,7,9,11,12,13},{1,3,5,6,7,9,11,12,13,14},{1,3,5,6,7,9,11,12,13,14,15},{1,3,5,6,7,9,11,12,13,15},{1,3,5,6,7,9,11,12,14},{1,3,5,6,7,9,11,12,14,15},{1,3,5,6,7,9,11,12,15},{1,3,5,6,7,9,11,13},{1,3,5,6,7,9,11,13,14},{1,3,5,6,7,9,11,13,14,15},{1,3,5,6,7,9,11,13,15},{1,3,5,6,7,9,11,14},{1,3,5,6,7,9,11,14,15},{1,3,5,6,7,9,11,15},{1,3,5,6,7,9,12},{1,3,5,6,7,9,12,13},{1,3,5,6,7,9,12,13,14},{1,3,5,6,7,9,12,13,14,15},{1,3,5,6,7,9,12,13,15},{1,3,5,6,7,9,12,14},{1,3,5,6,7,9,12,14,15},{1,3,5,6,7,9,12,15},{1,3,5,6,7,9,13},{1,3,5,6,7,9,13,14},{1,3,5,6,7,9,13,14,15},{1,3,5,6,7,9,13,15},{1,3,5,6,7,9,14},{1,3,5,6,7,9,14,15},{1,3,5,6,7,9,15},{1,3,5,6,7,10},{1,3,5,6,7,10,11},{1,3,5,6,7,10,11,12},{1,3,5,6,7,10,11,12,13},{1,3,5,6,7,10,11,12,13,14},{1,3,5,6,7,10,11,12,13,14,15},{1,3,5,6,7,10,11,12,13,15},{1,3,5,6,7,10,11,12,14},{1,3,5,6,7,10,11,12,14,15},{1,3,5,6,7,10,11,12,15},{1,3,5,6,7,10,11,13},{1,3,5,6,7,10,11,13,14},{1,3,5,6,7,10,11,13,14,15},{1,3,5,6,7,10,11,13,15},{1,3,5,6,7,10,11,14},{1,3,5,6,7,10,11,14,15},{1,3,5,6,7,10,11,15},{1,3,5,6,7,10,12},{1,3,5,6,7,10,12,13},{1,3,5,6,7,10,12,13,14},{1,3,5,6,7,10,12,13,14,15},{1,3,5,6,7,10,12,13,15},{1,3,5,6,7,10,12,14},{1,3,5,6,7,10,12,14,15},{1,3,5,6,7,10,12,15},{1,3,5,6,7,10,13},{1,3,5,6,7,10,13,14},{1,3,5,6,7,10,13,14,15},{1,3,5,6,7,10,13,15},{1,3,5,6,7,10,14},{1,3,5,6,7,10,14,15},{1,3,5,6,7,10,15},{1,3,5,6,7,11},{1,3,5,6,7,11,12},{1,3,5,6,7,11,12,13},{1,3,5,6,7,11,12,13,14},{1,3,5,6,7,11,12,13,14,15},{1,3,5,6,7,11,12,13,15},{1,3,5,6,7,11,12,14},{1,3,5,6,7,11,12,14,15},{1,3,5,6,7,11,12,15},{1,3,5,6,7,11,13},{1,3,5,6,7,11,13,14},{1,3,5,6,7,11,13,14,15},{1,3,5,6,7,11,13,15},{1,3,5,6,7,11,14},{1,3,5,6,7,11,14,15},{1,3,5,6,7,11,15},{1,3,5,6,7,12},{1,3,5,6,7,12,13},{1,3,5,6,7,12,13,14},{1,3,5,6,7,12,13,14,15},{1,3,5,6,7,12,13,15},{1,3,5,6,7,12,14},{1,3,5,6,7,12,14,15},{1,3,5,6,7,12,15},{1,3,5,6,7,13},{1,3,5,6,7,13,14},{1,3,5,6,7,13,14,15},{1,3,5,6,7,13,15},{1,3,5,6,7,14},{1,3,5,6,7,14,15},{1,3,5,6,7,15},{1,3,5,6,8},{1,3,5,6,8,9},{1,3,5,6,8,9,10},{1,3,5,6,8,9,10,11},{1,3,5,6,8,9,10,11,12},{1,3,5,6,8,9,10,11,12,13},{1,3,5,6,8,9,10,11,12,13,14},{1,3,5,6,8,9,10,11,12,13,14,15},{1,3,5,6,8,9,10,11,12,13,15},{1,3,5,6,8,9,10,11,12,14},{1,3,5,6,8,9,10,11,12,14,15},{1,3,5,6,8,9,10,11,12,15},{1,3,5,6,8,9,10,11,13},{1,3,5,6,8,9,10,11,13,14},{1,3,5,6,8,9,10,11,13,14,15},{1,3,5,6,8,9,10,11,13,15},{1,3,5,6,8,9,10,11,14},{1,3,5,6,8,9,10,11,14,15},{1,3,5,6,8,9,10,11,15},{1,3,5,6,8,9,10,12},{1,3,5,6,8,9,10,12,13},{1,3,5,6,8,9,10,12,13,14},{1,3,5,6,8,9,10,12,13,14,15},{1,3,5,6,8,9,10,12,13,15},{1,3,5,6,8,9,10,12,14},{1,3,5,6,8,9,10,12,14,15},{1,3,5,6,8,9,10,12,15},{1,3,5,6,8,9,10,13},{1,3,5,6,8,9,10,13,14},{1,3,5,6,8,9,10,13,14,15},{1,3,5,6,8,9,10,13,15},{1,3,5,6,8,9,10,14},{1,3,5,6,8,9,10,14,15},{1,3,5,6,8,9,10,15},{1,3,5,6,8,9,11},{1,3,5,6,8,9,11,12},{1,3,5,6,8,9,11,12,13},{1,3,5,6,8,9,11,12,13,14},{1,3,5,6,8,9,11,12,13,14,15},{1,3,5,6,8,9,11,12,13,15},{1,3,5,6,8,9,11,12,14},{1,3,5,6,8,9,11,12,14,15},{1,3,5,6,8,9,11,12,15},{1,3,5,6,8,9,11,13},{1,3,5,6,8,9,11,13,14},{1,3,5,6,8,9,11,13,14,15},{1,3,5,6,8,9,11,13,15},{1,3,5,6,8,9,11,14},{1,3,5,6,8,9,11,14,15},{1,3,5,6,8,9,11,15},{1,3,5,6,8,9,12},{1,3,5,6,8,9,12,13},{1,3,5,6,8,9,12,13,14},{1,3,5,6,8,9,12,13,14,15},{1,3,5,6,8,9,12,13,15},{1,3,5,6,8,9,12,14},{1,3,5,6,8,9,12,14,15},{1,3,5,6,8,9,12,15},{1,3,5,6,8,9,13},{1,3,5,6,8,9,13,14},{1,3,5,6,8,9,13,14,15},{1,3,5,6,8,9,13,15},{1,3,5,6,8,9,14},{1,3,5,6,8,9,14,15},{1,3,5,6,8,9,15},{1,3,5,6,8,10},{1,3,5,6,8,10,11},{1,3,5,6,8,10,11,12},{1,3,5,6,8,10,11,12,13},{1,3,5,6,8,10,11,12,13,14},{1,3,5,6,8,10,11,12,13,14,15},{1,3,5,6,8,10,11,12,13,15},{1,3,5,6,8,10,11,12,14},{1,3,5,6,8,10,11,12,14,15},{1,3,5,6,8,10,11,12,15},{1,3,5,6,8,10,11,13},{1,3,5,6,8,10,11,13,14},{1,3,5,6,8,10,11,13,14,15},{1,3,5,6,8,10,11,13,15},{1,3,5,6,8,10,11,14},{1,3,5,6,8,10,11,14,15},{1,3,5,6,8,10,11,15},{1,3,5,6,8,10,12},{1,3,5,6,8,10,12,13},{1,3,5,6,8,10,12,13,14},{1,3,5,6,8,10,12,13,14,15},{1,3,5,6,8,10,12,13,15},{1,3,5,6,8,10,12,14},{1,3,5,6,8,10,12,14,15},{1,3,5,6,8,10,12,15},{1,3,5,6,8,10,13},{1,3,5,6,8,10,13,14},{1,3,5,6,8,10,13,14,15},{1,3,5,6,8,10,13,15},{1,3,5,6,8,10,14},{1,3,5,6,8,10,14,15},{1,3,5,6,8,10,15},{1,3,5,6,8,11},{1,3,5,6,8,11,12},{1,3,5,6,8,11,12,13},{1,3,5,6,8,11,12,13,14},{1,3,5,6,8,11,12,13,14,15},{1,3,5,6,8,11,12,13,15},{1,3,5,6,8,11,12,14},{1,3,5,6,8,11,12,14,15},{1,3,5,6,8,11,12,15},{1,3,5,6,8,11,13},{1,3,5,6,8,11,13,14},{1,3,5,6,8,11,13,14,15},{1,3,5,6,8,11,13,15},{1,3,5,6,8,11,14},{1,3,5,6,8,11,14,15},{1,3,5,6,8,11,15},{1,3,5,6,8,12},{1,3,5,6,8,12,13},{1,3,5,6,8,12,13,14},{1,3,5,6,8,12,13,14,15},{1,3,5,6,8,12,13,15},{1,3,5,6,8,12,14},{1,3,5,6,8,12,14,15},{1,3,5,6,8,12,15},{1,3,5,6,8,13},{1,3,5,6,8,13,14},{1,3,5,6,8,13,14,15},{1,3,5,6,8,13,15},{1,3,5,6,8,14},{1,3,5,6,8,14,15},{1,3,5,6,8,15},{1,3,5,6,9},{1,3,5,6,9,10},{1,3,5,6,9,10,11},{1,3,5,6,9,10,11,12},{1,3,5,6,9,10,11,12,13},{1,3,5,6,9,10,11,12,13,14},{1,3,5,6,9,10,11,12,13,14,15},{1,3,5,6,9,10,11,12,13,15},{1,3,5,6,9,10,11,12,14},{1,3,5,6,9,10,11,12,14,15},{1,3,5,6,9,10,11,12,15},{1,3,5,6,9,10,11,13},{1,3,5,6,9,10,11,13,14},{1,3,5,6,9,10,11,13,14,15},{1,3,5,6,9,10,11,13,15},{1,3,5,6,9,10,11,14},{1,3,5,6,9,10,11,14,15},{1,3,5,6,9,10,11,15},{1,3,5,6,9,10,12},{1,3,5,6,9,10,12,13},{1,3,5,6,9,10,12,13,14},{1,3,5,6,9,10,12,13,14,15},{1,3,5,6,9,10,12,13,15},{1,3,5,6,9,10,12,14},{1,3,5,6,9,10,12,14,15},{1,3,5,6,9,10,12,15},{1,3,5,6,9,10,13},{1,3,5,6,9,10,13,14},{1,3,5,6,9,10,13,14,15},{1,3,5,6,9,10,13,15},{1,3,5,6,9,10,14},{1,3,5,6,9,10,14,15},{1,3,5,6,9,10,15},{1,3,5,6,9,11},{1,3,5,6,9,11,12},{1,3,5,6,9,11,12,13},{1,3,5,6,9,11,12,13,14},{1,3,5,6,9,11,12,13,14,15},{1,3,5,6,9,11,12,13,15},{1,3,5,6,9,11,12,14},{1,3,5,6,9,11,12,14,15},{1,3,5,6,9,11,12,15},{1,3,5,6,9,11,13},{1,3,5,6,9,11,13,14},{1,3,5,6,9,11,13,14,15},{1,3,5,6,9,11,13,15},{1,3,5,6,9,11,14},{1,3,5,6,9,11,14,15},{1,3,5,6,9,11,15},{1,3,5,6,9,12},{1,3,5,6,9,12,13},{1,3,5,6,9,12,13,14},{1,3,5,6,9,12,13,14,15},{1,3,5,6,9,12,13,15},{1,3,5,6,9,12,14},{1,3,5,6,9,12,14,15},{1,3,5,6,9,12,15},{1,3,5,6,9,13},{1,3,5,6,9,13,14},{1,3,5,6,9,13,14,15},{1,3,5,6,9,13,15},{1,3,5,6,9,14},{1,3,5,6,9,14,15},{1,3,5,6,9,15},{1,3,5,6,10},{1,3,5,6,10,11},{1,3,5,6,10,11,12},{1,3,5,6,10,11,12,13},{1,3,5,6,10,11,12,13,14},{1,3,5,6,10,11,12,13,14,15},{1,3,5,6,10,11,12,13,15},{1,3,5,6,10,11,12,14},{1,3,5,6,10,11,12,14,15},{1,3,5,6,10,11,12,15},{1,3,5,6,10,11,13},{1,3,5,6,10,11,13,14},{1,3,5,6,10,11,13,14,15},{1,3,5,6,10,11,13,15},{1,3,5,6,10,11,14},{1,3,5,6,10,11,14,15},{1,3,5,6,10,11,15},{1,3,5,6,10,12},{1,3,5,6,10,12,13},{1,3,5,6,10,12,13,14},{1,3,5,6,10,12,13,14,15},{1,3,5,6,10,12,13,15},{1,3,5,6,10,12,14},{1,3,5,6,10,12,14,15},{1,3,5,6,10,12,15},{1,3,5,6,10,13},{1,3,5,6,10,13,14},{1,3,5,6,10,13,14,15},{1,3,5,6,10,13,15},{1,3,5,6,10,14},{1,3,5,6,10,14,15},{1,3,5,6,10,15},{1,3,5,6,11},{1,3,5,6,11,12},{1,3,5,6,11,12,13},{1,3,5,6,11,12,13,14},{1,3,5,6,11,12,13,14,15},{1,3,5,6,11,12,13,15},{1,3,5,6,11,12,14},{1,3,5,6,11,12,14,15},{1,3,5,6,11,12,15},{1,3,5,6,11,13},{1,3,5,6,11,13,14},{1,3,5,6,11,13,14,15},{1,3,5,6,11,13,15},{1,3,5,6,11,14},{1,3,5,6,11,14,15},{1,3,5,6,11,15},{1,3,5,6,12},{1,3,5,6,12,13},{1,3,5,6,12,13,14},{1,3,5,6,12,13,14,15},{1,3,5,6,12,13,15},{1,3,5,6,12,14},{1,3,5,6,12,14,15},{1,3,5,6,12,15},{1,3,5,6,13},{1,3,5,6,13,14},{1,3,5,6,13,14,15},{1,3,5,6,13,15},{1,3,5,6,14},{1,3,5,6,14,15},{1,3,5,6,15},{1,3,5,7},{1,3,5,7,8},{1,3,5,7,8,9},{1,3,5,7,8,9,10},{1,3,5,7,8,9,10,11},{1,3,5,7,8,9,10,11,12},{1,3,5,7,8,9,10,11,12,13},{1,3,5,7,8,9,10,11,12,13,14},{1,3,5,7,8,9,10,11,12,13,14,15},{1,3,5,7,8,9,10,11,12,13,15},{1,3,5,7,8,9,10,11,12,14},{1,3,5,7,8,9,10,11,12,14,15},{1,3,5,7,8,9,10,11,12,15},{1,3,5,7,8,9,10,11,13},{1,3,5,7,8,9,10,11,13,14},{1,3,5,7,8,9,10,11,13,14,15},{1,3,5,7,8,9,10,11,13,15},{1,3,5,7,8,9,10,11,14},{1,3,5,7,8,9,10,11,14,15},{1,3,5,7,8,9,10,11,15},{1,3,5,7,8,9,10,12},{1,3,5,7,8,9,10,12,13},{1,3,5,7,8,9,10,12,13,14},{1,3,5,7,8,9,10,12,13,14,15},{1,3,5,7,8,9,10,12,13,15},{1,3,5,7,8,9,10,12,14},{1,3,5,7,8,9,10,12,14,15},{1,3,5,7,8,9,10,12,15},{1,3,5,7,8,9,10,13},{1,3,5,7,8,9,10,13,14},{1,3,5,7,8,9,10,13,14,15},{1,3,5,7,8,9,10,13,15},{1,3,5,7,8,9,10,14},{1,3,5,7,8,9,10,14,15},{1,3,5,7,8,9,10,15},{1,3,5,7,8,9,11},{1,3,5,7,8,9,11,12},{1,3,5,7,8,9,11,12,13},{1,3,5,7,8,9,11,12,13,14},{1,3,5,7,8,9,11,12,13,14,15},{1,3,5,7,8,9,11,12,13,15},{1,3,5,7,8,9,11,12,14},{1,3,5,7,8,9,11,12,14,15},{1,3,5,7,8,9,11,12,15},{1,3,5,7,8,9,11,13},{1,3,5,7,8,9,11,13,14},{1,3,5,7,8,9,11,13,14,15},{1,3,5,7,8,9,11,13,15},{1,3,5,7,8,9,11,14},{1,3,5,7,8,9,11,14,15},{1,3,5,7,8,9,11,15},{1,3,5,7,8,9,12},{1,3,5,7,8,9,12,13},{1,3,5,7,8,9,12,13,14},{1,3,5,7,8,9,12,13,14,15},{1,3,5,7,8,9,12,13,15},{1,3,5,7,8,9,12,14},{1,3,5,7,8,9,12,14,15},{1,3,5,7,8,9,12,15},{1,3,5,7,8,9,13},{1,3,5,7,8,9,13,14},{1,3,5,7,8,9,13,14,15},{1,3,5,7,8,9,13,15},{1,3,5,7,8,9,14},{1,3,5,7,8,9,14,15},{1,3,5,7,8,9,15},{1,3,5,7,8,10},{1,3,5,7,8,10,11},{1,3,5,7,8,10,11,12},{1,3,5,7,8,10,11,12,13},{1,3,5,7,8,10,11,12,13,14},{1,3,5,7,8,10,11,12,13,14,15},{1,3,5,7,8,10,11,12,13,15},{1,3,5,7,8,10,11,12,14},{1,3,5,7,8,10,11,12,14,15},{1,3,5,7,8,10,11,12,15},{1,3,5,7,8,10,11,13},{1,3,5,7,8,10,11,13,14},{1,3,5,7,8,10,11,13,14,15},{1,3,5,7,8,10,11,13,15},{1,3,5,7,8,10,11,14},{1,3,5,7,8,10,11,14,15},{1,3,5,7,8,10,11,15},{1,3,5,7,8,10,12},{1,3,5,7,8,10,12,13},{1,3,5,7,8,10,12,13,14},{1,3,5,7,8,10,12,13,14,15},{1,3,5,7,8,10,12,13,15},{1,3,5,7,8,10,12,14},{1,3,5,7,8,10,12,14,15},{1,3,5,7,8,10,12,15},{1,3,5,7,8,10,13},{1,3,5,7,8,10,13,14},{1,3,5,7,8,10,13,14,15},{1,3,5,7,8,10,13,15},{1,3,5,7,8,10,14},{1,3,5,7,8,10,14,15},{1,3,5,7,8,10,15},{1,3,5,7,8,11},{1,3,5,7,8,11,12},{1,3,5,7,8,11,12,13},{1,3,5,7,8,11,12,13,14},{1,3,5,7,8,11,12,13,14,15},{1,3,5,7,8,11,12,13,15},{1,3,5,7,8,11,12,14},{1,3,5,7,8,11,12,14,15},{1,3,5,7,8,11,12,15},{1,3,5,7,8,11,13},{1,3,5,7,8,11,13,14},{1,3,5,7,8,11,13,14,15},{1,3,5,7,8,11,13,15},{1,3,5,7,8,11,14},{1,3,5,7,8,11,14,15},{1,3,5,7,8,11,15},{1,3,5,7,8,12},{1,3,5,7,8,12,13},{1,3,5,7,8,12,13,14},{1,3,5,7,8,12,13,14,15},{1,3,5,7,8,12,13,15},{1,3,5,7,8,12,14},{1,3,5,7,8,12,14,15},{1,3,5,7,8,12,15},{1,3,5,7,8,13},{1,3,5,7,8,13,14},{1,3,5,7,8,13,14,15},{1,3,5,7,8,13,15},{1,3,5,7,8,14},{1,3,5,7,8,14,15},{1,3,5,7,8,15},{1,3,5,7,9},{1,3,5,7,9,10},{1,3,5,7,9,10,11},{1,3,5,7,9,10,11,12},{1,3,5,7,9,10,11,12,13},{1,3,5,7,9,10,11,12,13,14},{1,3,5,7,9,10,11,12,13,14,15},{1,3,5,7,9,10,11,12,13,15},{1,3,5,7,9,10,11,12,14},{1,3,5,7,9,10,11,12,14,15},{1,3,5,7,9,10,11,12,15},{1,3,5,7,9,10,11,13},{1,3,5,7,9,10,11,13,14},{1,3,5,7,9,10,11,13,14,15},{1,3,5,7,9,10,11,13,15},{1,3,5,7,9,10,11,14},{1,3,5,7,9,10,11,14,15},{1,3,5,7,9,10,11,15},{1,3,5,7,9,10,12},{1,3,5,7,9,10,12,13},{1,3,5,7,9,10,12,13,14},{1,3,5,7,9,10,12,13,14,15},{1,3,5,7,9,10,12,13,15},{1,3,5,7,9,10,12,14},{1,3,5,7,9,10,12,14,15},{1,3,5,7,9,10,12,15},{1,3,5,7,9,10,13},{1,3,5,7,9,10,13,14},{1,3,5,7,9,10,13,14,15},{1,3,5,7,9,10,13,15},{1,3,5,7,9,10,14},{1,3,5,7,9,10,14,15},{1,3,5,7,9,10,15},{1,3,5,7,9,11},{1,3,5,7,9,11,12},{1,3,5,7,9,11,12,13},{1,3,5,7,9,11,12,13,14},{1,3,5,7,9,11,12,13,14,15},{1,3,5,7,9,11,12,13,15},{1,3,5,7,9,11,12,14},{1,3,5,7,9,11,12,14,15},{1,3,5,7,9,11,12,15},{1,3,5,7,9,11,13},{1,3,5,7,9,11,13,14},{1,3,5,7,9,11,13,14,15},{1,3,5,7,9,11,13,15},{1,3,5,7,9,11,14},{1,3,5,7,9,11,14,15},{1,3,5,7,9,11,15},{1,3,5,7,9,12},{1,3,5,7,9,12,13},{1,3,5,7,9,12,13,14},{1,3,5,7,9,12,13,14,15},{1,3,5,7,9,12,13,15},{1,3,5,7,9,12,14},{1,3,5,7,9,12,14,15},{1,3,5,7,9,12,15},{1,3,5,7,9,13},{1,3,5,7,9,13,14},{1,3,5,7,9,13,14,15},{1,3,5,7,9,13,15},{1,3,5,7,9,14},{1,3,5,7,9,14,15},{1,3,5,7,9,15},{1,3,5,7,10},{1,3,5,7,10,11},{1,3,5,7,10,11,12},{1,3,5,7,10,11,12,13},{1,3,5,7,10,11,12,13,14},{1,3,5,7,10,11,12,13,14,15},{1,3,5,7,10,11,12,13,15},{1,3,5,7,10,11,12,14},{1,3,5,7,10,11,12,14,15},{1,3,5,7,10,11,12,15},{1,3,5,7,10,11,13},{1,3,5,7,10,11,13,14},{1,3,5,7,10,11,13,14,15},{1,3,5,7,10,11,13,15},{1,3,5,7,10,11,14},{1,3,5,7,10,11,14,15},{1,3,5,7,10,11,15},{1,3,5,7,10,12},{1,3,5,7,10,12,13},{1,3,5,7,10,12,13,14},{1,3,5,7,10,12,13,14,15},{1,3,5,7,10,12,13,15},{1,3,5,7,10,12,14},{1,3,5,7,10,12,14,15},{1,3,5,7,10,12,15},{1,3,5,7,10,13},{1,3,5,7,10,13,14},{1,3,5,7,10,13,14,15},{1,3,5,7,10,13,15},{1,3,5,7,10,14},{1,3,5,7,10,14,15},{1,3,5,7,10,15},{1,3,5,7,11},{1,3,5,7,11,12},{1,3,5,7,11,12,13},{1,3,5,7,11,12,13,14},{1,3,5,7,11,12,13,14,15},{1,3,5,7,11,12,13,15},{1,3,5,7,11,12,14},{1,3,5,7,11,12,14,15},{1,3,5,7,11,12,15},{1,3,5,7,11,13},{1,3,5,7,11,13,14},{1,3,5,7,11,13,14,15},{1,3,5,7,11,13,15},{1,3,5,7,11,14},{1,3,5,7,11,14,15},{1,3,5,7,11,15},{1,3,5,7,12},{1,3,5,7,12,13},{1,3,5,7,12,13,14},{1,3,5,7,12,13,14,15},{1,3,5,7,12,13,15},{1,3,5,7,12,14},{1,3,5,7,12,14,15},{1,3,5,7,12,15},{1,3,5,7,13},{1,3,5,7,13,14},{1,3,5,7,13,14,15},{1,3,5,7,13,15},{1,3,5,7,14},{1,3,5,7,14,15},{1,3,5,7,15},{1,3,5,8},{1,3,5,8,9},{1,3,5,8,9,10},{1,3,5,8,9,10,11},{1,3,5,8,9,10,11,12},{1,3,5,8,9,10,11,12,13},{1,3,5,8,9,10,11,12,13,14},{1,3,5,8,9,10,11,12,13,14,15},{1,3,5,8,9,10,11,12,13,15},{1,3,5,8,9,10,11,12,14},{1,3,5,8,9,10,11,12,14,15},{1,3,5,8,9,10,11,12,15},{1,3,5,8,9,10,11,13},{1,3,5,8,9,10,11,13,14},{1,3,5,8,9,10,11,13,14,15},{1,3,5,8,9,10,11,13,15},{1,3,5,8,9,10,11,14},{1,3,5,8,9,10,11,14,15},{1,3,5,8,9,10,11,15},{1,3,5,8,9,10,12},{1,3,5,8,9,10,12,13},{1,3,5,8,9,10,12,13,14},{1,3,5,8,9,10,12,13,14,15},{1,3,5,8,9,10,12,13,15},{1,3,5,8,9,10,12,14},{1,3,5,8,9,10,12,14,15},{1,3,5,8,9,10,12,15},{1,3,5,8,9,10,13},{1,3,5,8,9,10,13,14},{1,3,5,8,9,10,13,14,15},{1,3,5,8,9,10,13,15},{1,3,5,8,9,10,14},{1,3,5,8,9,10,14,15},{1,3,5,8,9,10,15},{1,3,5,8,9,11},{1,3,5,8,9,11,12},{1,3,5,8,9,11,12,13},{1,3,5,8,9,11,12,13,14},{1,3,5,8,9,11,12,13,14,15},{1,3,5,8,9,11,12,13,15},{1,3,5,8,9,11,12,14},{1,3,5,8,9,11,12,14,15},{1,3,5,8,9,11,12,15},{1,3,5,8,9,11,13},{1,3,5,8,9,11,13,14},{1,3,5,8,9,11,13,14,15},{1,3,5,8,9,11,13,15},{1,3,5,8,9,11,14},{1,3,5,8,9,11,14,15},{1,3,5,8,9,11,15},{1,3,5,8,9,12},{1,3,5,8,9,12,13},{1,3,5,8,9,12,13,14},{1,3,5,8,9,12,13,14,15},{1,3,5,8,9,12,13,15},{1,3,5,8,9,12,14},{1,3,5,8,9,12,14,15},{1,3,5,8,9,12,15},{1,3,5,8,9,13},{1,3,5,8,9,13,14},{1,3,5,8,9,13,14,15},{1,3,5,8,9,13,15},{1,3,5,8,9,14},{1,3,5,8,9,14,15},{1,3,5,8,9,15},{1,3,5,8,10},{1,3,5,8,10,11},{1,3,5,8,10,11,12},{1,3,5,8,10,11,12,13},{1,3,5,8,10,11,12,13,14},{1,3,5,8,10,11,12,13,14,15},{1,3,5,8,10,11,12,13,15},{1,3,5,8,10,11,12,14},{1,3,5,8,10,11,12,14,15},{1,3,5,8,10,11,12,15},{1,3,5,8,10,11,13},{1,3,5,8,10,11,13,14},{1,3,5,8,10,11,13,14,15},{1,3,5,8,10,11,13,15},{1,3,5,8,10,11,14},{1,3,5,8,10,11,14,15},{1,3,5,8,10,11,15},{1,3,5,8,10,12},{1,3,5,8,10,12,13},{1,3,5,8,10,12,13,14},{1,3,5,8,10,12,13,14,15},{1,3,5,8,10,12,13,15},{1,3,5,8,10,12,14},{1,3,5,8,10,12,14,15},{1,3,5,8,10,12,15},{1,3,5,8,10,13},{1,3,5,8,10,13,14},{1,3,5,8,10,13,14,15},{1,3,5,8,10,13,15},{1,3,5,8,10,14},{1,3,5,8,10,14,15},{1,3,5,8,10,15},{1,3,5,8,11},{1,3,5,8,11,12},{1,3,5,8,11,12,13},{1,3,5,8,11,12,13,14},{1,3,5,8,11,12,13,14,15},{1,3,5,8,11,12,13,15},{1,3,5,8,11,12,14},{1,3,5,8,11,12,14,15},{1,3,5,8,11,12,15},{1,3,5,8,11,13},{1,3,5,8,11,13,14},{1,3,5,8,11,13,14,15},{1,3,5,8,11,13,15},{1,3,5,8,11,14},{1,3,5,8,11,14,15},{1,3,5,8,11,15},{1,3,5,8,12},{1,3,5,8,12,13},{1,3,5,8,12,13,14},{1,3,5,8,12,13,14,15},{1,3,5,8,12,13,15},{1,3,5,8,12,14},{1,3,5,8,12,14,15},{1,3,5,8,12,15},{1,3,5,8,13},{1,3,5,8,13,14},{1,3,5,8,13,14,15},{1,3,5,8,13,15},{1,3,5,8,14},{1,3,5,8,14,15},{1,3,5,8,15},{1,3,5,9},{1,3,5,9,10},{1,3,5,9,10,11},{1,3,5,9,10,11,12},{1,3,5,9,10,11,12,13},{1,3,5,9,10,11,12,13,14},{1,3,5,9,10,11,12,13,14,15},{1,3,5,9,10,11,12,13,15},{1,3,5,9,10,11,12,14},{1,3,5,9,10,11,12,14,15},{1,3,5,9,10,11,12,15},{1,3,5,9,10,11,13},{1,3,5,9,10,11,13,14},{1,3,5,9,10,11,13,14,15},{1,3,5,9,10,11,13,15},{1,3,5,9,10,11,14},{1,3,5,9,10,11,14,15},{1,3,5,9,10,11,15},{1,3,5,9,10,12},{1,3,5,9,10,12,13},{1,3,5,9,10,12,13,14},{1,3,5,9,10,12,13,14,15},{1,3,5,9,10,12,13,15},{1,3,5,9,10,12,14},{1,3,5,9,10,12,14,15},{1,3,5,9,10,12,15},{1,3,5,9,10,13},{1,3,5,9,10,13,14},{1,3,5,9,10,13,14,15},{1,3,5,9,10,13,15},{1,3,5,9,10,14},{1,3,5,9,10,14,15},{1,3,5,9,10,15},{1,3,5,9,11},{1,3,5,9,11,12},{1,3,5,9,11,12,13},{1,3,5,9,11,12,13,14},{1,3,5,9,11,12,13,14,15},{1,3,5,9,11,12,13,15},{1,3,5,9,11,12,14},{1,3,5,9,11,12,14,15},{1,3,5,9,11,12,15},{1,3,5,9,11,13},{1,3,5,9,11,13,14},{1,3,5,9,11,13,14,15},{1,3,5,9,11,13,15},{1,3,5,9,11,14},{1,3,5,9,11,14,15},{1,3,5,9,11,15},{1,3,5,9,12},{1,3,5,9,12,13},{1,3,5,9,12,13,14},{1,3,5,9,12,13,14,15},{1,3,5,9,12,13,15},{1,3,5,9,12,14},{1,3,5,9,12,14,15},{1,3,5,9,12,15},{1,3,5,9,13},{1,3,5,9,13,14},{1,3,5,9,13,14,15},{1,3,5,9,13,15},{1,3,5,9,14},{1,3,5,9,14,15},{1,3,5,9,15},{1,3,5,10},{1,3,5,10,11},{1,3,5,10,11,12},{1,3,5,10,11,12,13},{1,3,5,10,11,12,13,14},{1,3,5,10,11,12,13,14,15},{1,3,5,10,11,12,13,15},{1,3,5,10,11,12,14},{1,3,5,10,11,12,14,15},{1,3,5,10,11,12,15},{1,3,5,10,11,13},{1,3,5,10,11,13,14},{1,3,5,10,11,13,14,15},{1,3,5,10,11,13,15},{1,3,5,10,11,14},{1,3,5,10,11,14,15},{1,3,5,10,11,15},{1,3,5,10,12},{1,3,5,10,12,13},{1,3,5,10,12,13,14},{1,3,5,10,12,13,14,15},{1,3,5,10,12,13,15},{1,3,5,10,12,14},{1,3,5,10,12,14,15},{1,3,5,10,12,15},{1,3,5,10,13},{1,3,5,10,13,14},{1,3,5,10,13,14,15},{1,3,5,10,13,15},{1,3,5,10,14},{1,3,5,10,14,15},{1,3,5,10,15},{1,3,5,11},{1,3,5,11,12},{1,3,5,11,12,13},{1,3,5,11,12,13,14},{1,3,5,11,12,13,14,15},{1,3,5,11,12,13,15},{1,3,5,11,12,14},{1,3,5,11,12,14,15},{1,3,5,11,12,15},{1,3,5,11,13},{1,3,5,11,13,14},{1,3,5,11,13,14,15},{1,3,5,11,13,15},{1,3,5,11,14},{1,3,5,11,14,15},{1,3,5,11,15},{1,3,5,12},{1,3,5,12,13},{1,3,5,12,13,14},{1,3,5,12,13,14,15},{1,3,5,12,13,15},{1,3,5,12,14},{1,3,5,12,14,15},{1,3,5,12,15},{1,3,5,13},{1,3,5,13,14},{1,3,5,13,14,15},{1,3,5,13,15},{1,3,5,14},{1,3,5,14,15},{1,3,5,15},{1,3,6},{1,3,6,7},{1,3,6,7,8},{1,3,6,7,8,9},{1,3,6,7,8,9,10},{1,3,6,7,8,9,10,11},{1,3,6,7,8,9,10,11,12},{1,3,6,7,8,9,10,11,12,13},{1,3,6,7,8,9,10,11,12,13,14},{1,3,6,7,8,9,10,11,12,13,14,15},{1,3,6,7,8,9,10,11,12,13,15},{1,3,6,7,8,9,10,11,12,14},{1,3,6,7,8,9,10,11,12,14,15},{1,3,6,7,8,9,10,11,12,15},{1,3,6,7,8,9,10,11,13},{1,3,6,7,8,9,10,11,13,14},{1,3,6,7,8,9,10,11,13,14,15},{1,3,6,7,8,9,10,11,13,15},{1,3,6,7,8,9,10,11,14},{1,3,6,7,8,9,10,11,14,15},{1,3,6,7,8,9,10,11,15},{1,3,6,7,8,9,10,12},{1,3,6,7,8,9,10,12,13},{1,3,6,7,8,9,10,12,13,14},{1,3,6,7,8,9,10,12,13,14,15},{1,3,6,7,8,9,10,12,13,15},{1,3,6,7,8,9,10,12,14},{1,3,6,7,8,9,10,12,14,15},{1,3,6,7,8,9,10,12,15},{1,3,6,7,8,9,10,13},{1,3,6,7,8,9,10,13,14},{1,3,6,7,8,9,10,13,14,15},{1,3,6,7,8,9,10,13,15},{1,3,6,7,8,9,10,14},{1,3,6,7,8,9,10,14,15},{1,3,6,7,8,9,10,15},{1,3,6,7,8,9,11},{1,3,6,7,8,9,11,12},{1,3,6,7,8,9,11,12,13},{1,3,6,7,8,9,11,12,13,14},{1,3,6,7,8,9,11,12,13,14,15},{1,3,6,7,8,9,11,12,13,15},{1,3,6,7,8,9,11,12,14},{1,3,6,7,8,9,11,12,14,15},{1,3,6,7,8,9,11,12,15},{1,3,6,7,8,9,11,13},{1,3,6,7,8,9,11,13,14},{1,3,6,7,8,9,11,13,14,15},{1,3,6,7,8,9,11,13,15},{1,3,6,7,8,9,11,14},{1,3,6,7,8,9,11,14,15},{1,3,6,7,8,9,11,15},{1,3,6,7,8,9,12},{1,3,6,7,8,9,12,13},{1,3,6,7,8,9,12,13,14},{1,3,6,7,8,9,12,13,14,15},{1,3,6,7,8,9,12,13,15},{1,3,6,7,8,9,12,14},{1,3,6,7,8,9,12,14,15},{1,3,6,7,8,9,12,15},{1,3,6,7,8,9,13},{1,3,6,7,8,9,13,14},{1,3,6,7,8,9,13,14,15},{1,3,6,7,8,9,13,15},{1,3,6,7,8,9,14},{1,3,6,7,8,9,14,15},{1,3,6,7,8,9,15},{1,3,6,7,8,10},{1,3,6,7,8,10,11},{1,3,6,7,8,10,11,12},{1,3,6,7,8,10,11,12,13},{1,3,6,7,8,10,11,12,13,14},{1,3,6,7,8,10,11,12,13,14,15},{1,3,6,7,8,10,11,12,13,15},{1,3,6,7,8,10,11,12,14},{1,3,6,7,8,10,11,12,14,15},{1,3,6,7,8,10,11,12,15},{1,3,6,7,8,10,11,13},{1,3,6,7,8,10,11,13,14},{1,3,6,7,8,10,11,13,14,15},{1,3,6,7,8,10,11,13,15},{1,3,6,7,8,10,11,14},{1,3,6,7,8,10,11,14,15},{1,3,6,7,8,10,11,15},{1,3,6,7,8,10,12},{1,3,6,7,8,10,12,13},{1,3,6,7,8,10,12,13,14},{1,3,6,7,8,10,12,13,14,15},{1,3,6,7,8,10,12,13,15},{1,3,6,7,8,10,12,14},{1,3,6,7,8,10,12,14,15},{1,3,6,7,8,10,12,15},{1,3,6,7,8,10,13},{1,3,6,7,8,10,13,14},{1,3,6,7,8,10,13,14,15},{1,3,6,7,8,10,13,15},{1,3,6,7,8,10,14},{1,3,6,7,8,10,14,15},{1,3,6,7,8,10,15},{1,3,6,7,8,11},{1,3,6,7,8,11,12},{1,3,6,7,8,11,12,13},{1,3,6,7,8,11,12,13,14},{1,3,6,7,8,11,12,13,14,15},{1,3,6,7,8,11,12,13,15},{1,3,6,7,8,11,12,14},{1,3,6,7,8,11,12,14,15},{1,3,6,7,8,11,12,15},{1,3,6,7,8,11,13},{1,3,6,7,8,11,13,14},{1,3,6,7,8,11,13,14,15},{1,3,6,7,8,11,13,15},{1,3,6,7,8,11,14},{1,3,6,7,8,11,14,15},{1,3,6,7,8,11,15},{1,3,6,7,8,12},{1,3,6,7,8,12,13},{1,3,6,7,8,12,13,14},{1,3,6,7,8,12,13,14,15},{1,3,6,7,8,12,13,15},{1,3,6,7,8,12,14},{1,3,6,7,8,12,14,15},{1,3,6,7,8,12,15},{1,3,6,7,8,13},{1,3,6,7,8,13,14},{1,3,6,7,8,13,14,15},{1,3,6,7,8,13,15},{1,3,6,7,8,14},{1,3,6,7,8,14,15},{1,3,6,7,8,15},{1,3,6,7,9},{1,3,6,7,9,10},{1,3,6,7,9,10,11},{1,3,6,7,9,10,11,12},{1,3,6,7,9,10,11,12,13},{1,3,6,7,9,10,11,12,13,14},{1,3,6,7,9,10,11,12,13,14,15},{1,3,6,7,9,10,11,12,13,15},{1,3,6,7,9,10,11,12,14},{1,3,6,7,9,10,11,12,14,15},{1,3,6,7,9,10,11,12,15},{1,3,6,7,9,10,11,13},{1,3,6,7,9,10,11,13,14},{1,3,6,7,9,10,11,13,14,15},{1,3,6,7,9,10,11,13,15},{1,3,6,7,9,10,11,14},{1,3,6,7,9,10,11,14,15},{1,3,6,7,9,10,11,15},{1,3,6,7,9,10,12},{1,3,6,7,9,10,12,13},{1,3,6,7,9,10,12,13,14},{1,3,6,7,9,10,12,13,14,15},{1,3,6,7,9,10,12,13,15},{1,3,6,7,9,10,12,14},{1,3,6,7,9,10,12,14,15},{1,3,6,7,9,10,12,15},{1,3,6,7,9,10,13},{1,3,6,7,9,10,13,14},{1,3,6,7,9,10,13,14,15},{1,3,6,7,9,10,13,15},{1,3,6,7,9,10,14},{1,3,6,7,9,10,14,15},{1,3,6,7,9,10,15},{1,3,6,7,9,11},{1,3,6,7,9,11,12},{1,3,6,7,9,11,12,13},{1,3,6,7,9,11,12,13,14},{1,3,6,7,9,11,12,13,14,15},{1,3,6,7,9,11,12,13,15},{1,3,6,7,9,11,12,14},{1,3,6,7,9,11,12,14,15},{1,3,6,7,9,11,12,15},{1,3,6,7,9,11,13},{1,3,6,7,9,11,13,14},{1,3,6,7,9,11,13,14,15},{1,3,6,7,9,11,13,15},{1,3,6,7,9,11,14},{1,3,6,7,9,11,14,15},{1,3,6,7,9,11,15},{1,3,6,7,9,12},{1,3,6,7,9,12,13},{1,3,6,7,9,12,13,14},{1,3,6,7,9,12,13,14,15},{1,3,6,7,9,12,13,15},{1,3,6,7,9,12,14},{1,3,6,7,9,12,14,15},{1,3,6,7,9,12,15},{1,3,6,7,9,13},{1,3,6,7,9,13,14},{1,3,6,7,9,13,14,15},{1,3,6,7,9,13,15},{1,3,6,7,9,14},{1,3,6,7,9,14,15},{1,3,6,7,9,15},{1,3,6,7,10},{1,3,6,7,10,11},{1,3,6,7,10,11,12},{1,3,6,7,10,11,12,13},{1,3,6,7,10,11,12,13,14},{1,3,6,7,10,11,12,13,14,15},{1,3,6,7,10,11,12,13,15},{1,3,6,7,10,11,12,14},{1,3,6,7,10,11,12,14,15},{1,3,6,7,10,11,12,15},{1,3,6,7,10,11,13},{1,3,6,7,10,11,13,14},{1,3,6,7,10,11,13,14,15},{1,3,6,7,10,11,13,15},{1,3,6,7,10,11,14},{1,3,6,7,10,11,14,15},{1,3,6,7,10,11,15},{1,3,6,7,10,12},{1,3,6,7,10,12,13},{1,3,6,7,10,12,13,14},{1,3,6,7,10,12,13,14,15},{1,3,6,7,10,12,13,15},{1,3,6,7,10,12,14},{1,3,6,7,10,12,14,15},{1,3,6,7,10,12,15},{1,3,6,7,10,13},{1,3,6,7,10,13,14},{1,3,6,7,10,13,14,15},{1,3,6,7,10,13,15},{1,3,6,7,10,14},{1,3,6,7,10,14,15},{1,3,6,7,10,15},{1,3,6,7,11},{1,3,6,7,11,12},{1,3,6,7,11,12,13},{1,3,6,7,11,12,13,14},{1,3,6,7,11,12,13,14,15},{1,3,6,7,11,12,13,15},{1,3,6,7,11,12,14},{1,3,6,7,11,12,14,15},{1,3,6,7,11,12,15},{1,3,6,7,11,13},{1,3,6,7,11,13,14},{1,3,6,7,11,13,14,15},{1,3,6,7,11,13,15},{1,3,6,7,11,14},{1,3,6,7,11,14,15},{1,3,6,7,11,15},{1,3,6,7,12},{1,3,6,7,12,13},{1,3,6,7,12,13,14},{1,3,6,7,12,13,14,15},{1,3,6,7,12,13,15},{1,3,6,7,12,14},{1,3,6,7,12,14,15},{1,3,6,7,12,15},{1,3,6,7,13},{1,3,6,7,13,14},{1,3,6,7,13,14,15},{1,3,6,7,13,15},{1,3,6,7,14},{1,3,6,7,14,15},{1,3,6,7,15},{1,3,6,8},{1,3,6,8,9},{1,3,6,8,9,10},{1,3,6,8,9,10,11},{1,3,6,8,9,10,11,12},{1,3,6,8,9,10,11,12,13},{1,3,6,8,9,10,11,12,13,14},{1,3,6,8,9,10,11,12,13,14,15},{1,3,6,8,9,10,11,12,13,15},{1,3,6,8,9,10,11,12,14},{1,3,6,8,9,10,11,12,14,15},{1,3,6,8,9,10,11,12,15},{1,3,6,8,9,10,11,13},{1,3,6,8,9,10,11,13,14},{1,3,6,8,9,10,11,13,14,15},{1,3,6,8,9,10,11,13,15},{1,3,6,8,9,10,11,14},{1,3,6,8,9,10,11,14,15},{1,3,6,8,9,10,11,15},{1,3,6,8,9,10,12},{1,3,6,8,9,10,12,13},{1,3,6,8,9,10,12,13,14},{1,3,6,8,9,10,12,13,14,15},{1,3,6,8,9,10,12,13,15},{1,3,6,8,9,10,12,14},{1,3,6,8,9,10,12,14,15},{1,3,6,8,9,10,12,15},{1,3,6,8,9,10,13},{1,3,6,8,9,10,13,14},{1,3,6,8,9,10,13,14,15},{1,3,6,8,9,10,13,15},{1,3,6,8,9,10,14},{1,3,6,8,9,10,14,15},{1,3,6,8,9,10,15},{1,3,6,8,9,11},{1,3,6,8,9,11,12},{1,3,6,8,9,11,12,13},{1,3,6,8,9,11,12,13,14},{1,3,6,8,9,11,12,13,14,15},{1,3,6,8,9,11,12,13,15},{1,3,6,8,9,11,12,14},{1,3,6,8,9,11,12,14,15},{1,3,6,8,9,11,12,15},{1,3,6,8,9,11,13},{1,3,6,8,9,11,13,14},{1,3,6,8,9,11,13,14,15},{1,3,6,8,9,11,13,15},{1,3,6,8,9,11,14},{1,3,6,8,9,11,14,15},{1,3,6,8,9,11,15},{1,3,6,8,9,12},{1,3,6,8,9,12,13},{1,3,6,8,9,12,13,14},{1,3,6,8,9,12,13,14,15},{1,3,6,8,9,12,13,15},{1,3,6,8,9,12,14},{1,3,6,8,9,12,14,15},{1,3,6,8,9,12,15},{1,3,6,8,9,13},{1,3,6,8,9,13,14},{1,3,6,8,9,13,14,15},{1,3,6,8,9,13,15},{1,3,6,8,9,14},{1,3,6,8,9,14,15},{1,3,6,8,9,15},{1,3,6,8,10},{1,3,6,8,10,11},{1,3,6,8,10,11,12},{1,3,6,8,10,11,12,13},{1,3,6,8,10,11,12,13,14},{1,3,6,8,10,11,12,13,14,15},{1,3,6,8,10,11,12,13,15},{1,3,6,8,10,11,12,14},{1,3,6,8,10,11,12,14,15},{1,3,6,8,10,11,12,15},{1,3,6,8,10,11,13},{1,3,6,8,10,11,13,14},{1,3,6,8,10,11,13,14,15},{1,3,6,8,10,11,13,15},{1,3,6,8,10,11,14},{1,3,6,8,10,11,14,15},{1,3,6,8,10,11,15},{1,3,6,8,10,12},{1,3,6,8,10,12,13},{1,3,6,8,10,12,13,14},{1,3,6,8,10,12,13,14,15},{1,3,6,8,10,12,13,15},{1,3,6,8,10,12,14},{1,3,6,8,10,12,14,15},{1,3,6,8,10,12,15},{1,3,6,8,10,13},{1,3,6,8,10,13,14},{1,3,6,8,10,13,14,15},{1,3,6,8,10,13,15},{1,3,6,8,10,14},{1,3,6,8,10,14,15},{1,3,6,8,10,15},{1,3,6,8,11},{1,3,6,8,11,12},{1,3,6,8,11,12,13},{1,3,6,8,11,12,13,14},{1,3,6,8,11,12,13,14,15},{1,3,6,8,11,12,13,15},{1,3,6,8,11,12,14},{1,3,6,8,11,12,14,15},{1,3,6,8,11,12,15},{1,3,6,8,11,13},{1,3,6,8,11,13,14},{1,3,6,8,11,13,14,15},{1,3,6,8,11,13,15},{1,3,6,8,11,14},{1,3,6,8,11,14,15},{1,3,6,8,11,15},{1,3,6,8,12},{1,3,6,8,12,13},{1,3,6,8,12,13,14},{1,3,6,8,12,13,14,15},{1,3,6,8,12,13,15},{1,3,6,8,12,14},{1,3,6,8,12,14,15},{1,3,6,8,12,15},{1,3,6,8,13},{1,3,6,8,13,14},{1,3,6,8,13,14,15},{1,3,6,8,13,15},{1,3,6,8,14},{1,3,6,8,14,15},{1,3,6,8,15},{1,3,6,9},{1,3,6,9,10},{1,3,6,9,10,11},{1,3,6,9,10,11,12},{1,3,6,9,10,11,12,13},{1,3,6,9,10,11,12,13,14},{1,3,6,9,10,11,12,13,14,15},{1,3,6,9,10,11,12,13,15},{1,3,6,9,10,11,12,14},{1,3,6,9,10,11,12,14,15},{1,3,6,9,10,11,12,15},{1,3,6,9,10,11,13},{1,3,6,9,10,11,13,14},{1,3,6,9,10,11,13,14,15},{1,3,6,9,10,11,13,15},{1,3,6,9,10,11,14},{1,3,6,9,10,11,14,15},{1,3,6,9,10,11,15},{1,3,6,9,10,12},{1,3,6,9,10,12,13},{1,3,6,9,10,12,13,14},{1,3,6,9,10,12,13,14,15},{1,3,6,9,10,12,13,15},{1,3,6,9,10,12,14},{1,3,6,9,10,12,14,15},{1,3,6,9,10,12,15},{1,3,6,9,10,13},{1,3,6,9,10,13,14},{1,3,6,9,10,13,14,15},{1,3,6,9,10,13,15},{1,3,6,9,10,14},{1,3,6,9,10,14,15},{1,3,6,9,10,15},{1,3,6,9,11},{1,3,6,9,11,12},{1,3,6,9,11,12,13},{1,3,6,9,11,12,13,14},{1,3,6,9,11,12,13,14,15},{1,3,6,9,11,12,13,15},{1,3,6,9,11,12,14},{1,3,6,9,11,12,14,15},{1,3,6,9,11,12,15},{1,3,6,9,11,13},{1,3,6,9,11,13,14},{1,3,6,9,11,13,14,15},{1,3,6,9,11,13,15},{1,3,6,9,11,14},{1,3,6,9,11,14,15},{1,3,6,9,11,15},{1,3,6,9,12},{1,3,6,9,12,13},{1,3,6,9,12,13,14},{1,3,6,9,12,13,14,15},{1,3,6,9,12,13,15},{1,3,6,9,12,14},{1,3,6,9,12,14,15},{1,3,6,9,12,15},{1,3,6,9,13},{1,3,6,9,13,14},{1,3,6,9,13,14,15},{1,3,6,9,13,15},{1,3,6,9,14},{1,3,6,9,14,15},{1,3,6,9,15},{1,3,6,10},{1,3,6,10,11},{1,3,6,10,11,12},{1,3,6,10,11,12,13},{1,3,6,10,11,12,13,14},{1,3,6,10,11,12,13,14,15},{1,3,6,10,11,12,13,15},{1,3,6,10,11,12,14},{1,3,6,10,11,12,14,15},{1,3,6,10,11,12,15},{1,3,6,10,11,13},{1,3,6,10,11,13,14},{1,3,6,10,11,13,14,15},{1,3,6,10,11,13,15},{1,3,6,10,11,14},{1,3,6,10,11,14,15},{1,3,6,10,11,15},{1,3,6,10,12},{1,3,6,10,12,13},{1,3,6,10,12,13,14},{1,3,6,10,12,13,14,15},{1,3,6,10,12,13,15},{1,3,6,10,12,14},{1,3,6,10,12,14,15},{1,3,6,10,12,15},{1,3,6,10,13},{1,3,6,10,13,14},{1,3,6,10,13,14,15},{1,3,6,10,13,15},{1,3,6,10,14},{1,3,6,10,14,15},{1,3,6,10,15},{1,3,6,11},{1,3,6,11,12},{1,3,6,11,12,13},{1,3,6,11,12,13,14},{1,3,6,11,12,13,14,15},{1,3,6,11,12,13,15},{1,3,6,11,12,14},{1,3,6,11,12,14,15},{1,3,6,11,12,15},{1,3,6,11,13},{1,3,6,11,13,14},{1,3,6,11,13,14,15},{1,3,6,11,13,15},{1,3,6,11,14},{1,3,6,11,14,15},{1,3,6,11,15},{1,3,6,12},{1,3,6,12,13},{1,3,6,12,13,14},{1,3,6,12,13,14,15},{1,3,6,12,13,15},{1,3,6,12,14},{1,3,6,12,14,15},{1,3,6,12,15},{1,3,6,13},{1,3,6,13,14},{1,3,6,13,14,15},{1,3,6,13,15},{1,3,6,14},{1,3,6,14,15},{1,3,6,15},{1,3,7},{1,3,7,8},{1,3,7,8,9},{1,3,7,8,9,10},{1,3,7,8,9,10,11},{1,3,7,8,9,10,11,12},{1,3,7,8,9,10,11,12,13},{1,3,7,8,9,10,11,12,13,14},{1,3,7,8,9,10,11,12,13,14,15},{1,3,7,8,9,10,11,12,13,15},{1,3,7,8,9,10,11,12,14},{1,3,7,8,9,10,11,12,14,15},{1,3,7,8,9,10,11,12,15},{1,3,7,8,9,10,11,13},{1,3,7,8,9,10,11,13,14},{1,3,7,8,9,10,11,13,14,15},{1,3,7,8,9,10,11,13,15},{1,3,7,8,9,10,11,14},{1,3,7,8,9,10,11,14,15},{1,3,7,8,9,10,11,15},{1,3,7,8,9,10,12},{1,3,7,8,9,10,12,13},{1,3,7,8,9,10,12,13,14},{1,3,7,8,9,10,12,13,14,15},{1,3,7,8,9,10,12,13,15},{1,3,7,8,9,10,12,14},{1,3,7,8,9,10,12,14,15},{1,3,7,8,9,10,12,15},{1,3,7,8,9,10,13},{1,3,7,8,9,10,13,14},{1,3,7,8,9,10,13,14,15},{1,3,7,8,9,10,13,15},{1,3,7,8,9,10,14},{1,3,7,8,9,10,14,15},{1,3,7,8,9,10,15},{1,3,7,8,9,11},{1,3,7,8,9,11,12},{1,3,7,8,9,11,12,13},{1,3,7,8,9,11,12,13,14},{1,3,7,8,9,11,12,13,14,15},{1,3,7,8,9,11,12,13,15},{1,3,7,8,9,11,12,14},{1,3,7,8,9,11,12,14,15},{1,3,7,8,9,11,12,15},{1,3,7,8,9,11,13},{1,3,7,8,9,11,13,14},{1,3,7,8,9,11,13,14,15},{1,3,7,8,9,11,13,15},{1,3,7,8,9,11,14},{1,3,7,8,9,11,14,15},{1,3,7,8,9,11,15},{1,3,7,8,9,12},{1,3,7,8,9,12,13},{1,3,7,8,9,12,13,14},{1,3,7,8,9,12,13,14,15},{1,3,7,8,9,12,13,15},{1,3,7,8,9,12,14},{1,3,7,8,9,12,14,15},{1,3,7,8,9,12,15},{1,3,7,8,9,13},{1,3,7,8,9,13,14},{1,3,7,8,9,13,14,15},{1,3,7,8,9,13,15},{1,3,7,8,9,14},{1,3,7,8,9,14,15},{1,3,7,8,9,15},{1,3,7,8,10},{1,3,7,8,10,11},{1,3,7,8,10,11,12},{1,3,7,8,10,11,12,13},{1,3,7,8,10,11,12,13,14},{1,3,7,8,10,11,12,13,14,15},{1,3,7,8,10,11,12,13,15},{1,3,7,8,10,11,12,14},{1,3,7,8,10,11,12,14,15},{1,3,7,8,10,11,12,15},{1,3,7,8,10,11,13},{1,3,7,8,10,11,13,14},{1,3,7,8,10,11,13,14,15},{1,3,7,8,10,11,13,15},{1,3,7,8,10,11,14},{1,3,7,8,10,11,14,15},{1,3,7,8,10,11,15},{1,3,7,8,10,12},{1,3,7,8,10,12,13},{1,3,7,8,10,12,13,14},{1,3,7,8,10,12,13,14,15},{1,3,7,8,10,12,13,15},{1,3,7,8,10,12,14},{1,3,7,8,10,12,14,15},{1,3,7,8,10,12,15},{1,3,7,8,10,13},{1,3,7,8,10,13,14},{1,3,7,8,10,13,14,15},{1,3,7,8,10,13,15},{1,3,7,8,10,14},{1,3,7,8,10,14,15},{1,3,7,8,10,15},{1,3,7,8,11},{1,3,7,8,11,12},{1,3,7,8,11,12,13},{1,3,7,8,11,12,13,14},{1,3,7,8,11,12,13,14,15},{1,3,7,8,11,12,13,15},{1,3,7,8,11,12,14},{1,3,7,8,11,12,14,15},{1,3,7,8,11,12,15},{1,3,7,8,11,13},{1,3,7,8,11,13,14},{1,3,7,8,11,13,14,15},{1,3,7,8,11,13,15},{1,3,7,8,11,14},{1,3,7,8,11,14,15},{1,3,7,8,11,15},{1,3,7,8,12},{1,3,7,8,12,13},{1,3,7,8,12,13,14},{1,3,7,8,12,13,14,15},{1,3,7,8,12,13,15},{1,3,7,8,12,14},{1,3,7,8,12,14,15},{1,3,7,8,12,15},{1,3,7,8,13},{1,3,7,8,13,14},{1,3,7,8,13,14,15},{1,3,7,8,13,15},{1,3,7,8,14},{1,3,7,8,14,15},{1,3,7,8,15},{1,3,7,9},{1,3,7,9,10},{1,3,7,9,10,11},{1,3,7,9,10,11,12},{1,3,7,9,10,11,12,13},{1,3,7,9,10,11,12,13,14},{1,3,7,9,10,11,12,13,14,15},{1,3,7,9,10,11,12,13,15},{1,3,7,9,10,11,12,14},{1,3,7,9,10,11,12,14,15},{1,3,7,9,10,11,12,15},{1,3,7,9,10,11,13},{1,3,7,9,10,11,13,14},{1,3,7,9,10,11,13,14,15},{1,3,7,9,10,11,13,15},{1,3,7,9,10,11,14},{1,3,7,9,10,11,14,15},{1,3,7,9,10,11,15},{1,3,7,9,10,12},{1,3,7,9,10,12,13},{1,3,7,9,10,12,13,14},{1,3,7,9,10,12,13,14,15},{1,3,7,9,10,12,13,15},{1,3,7,9,10,12,14},{1,3,7,9,10,12,14,15},{1,3,7,9,10,12,15},{1,3,7,9,10,13},{1,3,7,9,10,13,14},{1,3,7,9,10,13,14,15},{1,3,7,9,10,13,15},{1,3,7,9,10,14},{1,3,7,9,10,14,15},{1,3,7,9,10,15},{1,3,7,9,11},{1,3,7,9,11,12},{1,3,7,9,11,12,13},{1,3,7,9,11,12,13,14},{1,3,7,9,11,12,13,14,15},{1,3,7,9,11,12,13,15},{1,3,7,9,11,12,14},{1,3,7,9,11,12,14,15},{1,3,7,9,11,12,15},{1,3,7,9,11,13},{1,3,7,9,11,13,14},{1,3,7,9,11,13,14,15},{1,3,7,9,11,13,15},{1,3,7,9,11,14},{1,3,7,9,11,14,15},{1,3,7,9,11,15},{1,3,7,9,12},{1,3,7,9,12,13},{1,3,7,9,12,13,14},{1,3,7,9,12,13,14,15},{1,3,7,9,12,13,15},{1,3,7,9,12,14},{1,3,7,9,12,14,15},{1,3,7,9,12,15},{1,3,7,9,13},{1,3,7,9,13,14},{1,3,7,9,13,14,15},{1,3,7,9,13,15},{1,3,7,9,14},{1,3,7,9,14,15},{1,3,7,9,15},{1,3,7,10},{1,3,7,10,11},{1,3,7,10,11,12},{1,3,7,10,11,12,13},{1,3,7,10,11,12,13,14},{1,3,7,10,11,12,13,14,15},{1,3,7,10,11,12,13,15},{1,3,7,10,11,12,14},{1,3,7,10,11,12,14,15},{1,3,7,10,11,12,15},{1,3,7,10,11,13},{1,3,7,10,11,13,14},{1,3,7,10,11,13,14,15},{1,3,7,10,11,13,15},{1,3,7,10,11,14},{1,3,7,10,11,14,15},{1,3,7,10,11,15},{1,3,7,10,12},{1,3,7,10,12,13},{1,3,7,10,12,13,14},{1,3,7,10,12,13,14,15},{1,3,7,10,12,13,15},{1,3,7,10,12,14},{1,3,7,10,12,14,15},{1,3,7,10,12,15},{1,3,7,10,13},{1,3,7,10,13,14},{1,3,7,10,13,14,15},{1,3,7,10,13,15},{1,3,7,10,14},{1,3,7,10,14,15},{1,3,7,10,15},{1,3,7,11},{1,3,7,11,12},{1,3,7,11,12,13},{1,3,7,11,12,13,14},{1,3,7,11,12,13,14,15},{1,3,7,11,12,13,15},{1,3,7,11,12,14},{1,3,7,11,12,14,15},{1,3,7,11,12,15},{1,3,7,11,13},{1,3,7,11,13,14},{1,3,7,11,13,14,15},{1,3,7,11,13,15},{1,3,7,11,14},{1,3,7,11,14,15},{1,3,7,11,15},{1,3,7,12},{1,3,7,12,13},{1,3,7,12,13,14},{1,3,7,12,13,14,15},{1,3,7,12,13,15},{1,3,7,12,14},{1,3,7,12,14,15},{1,3,7,12,15},{1,3,7,13},{1,3,7,13,14},{1,3,7,13,14,15},{1,3,7,13,15},{1,3,7,14},{1,3,7,14,15},{1,3,7,15},{1,3,8},{1,3,8,9},{1,3,8,9,10},{1,3,8,9,10,11},{1,3,8,9,10,11,12},{1,3,8,9,10,11,12,13},{1,3,8,9,10,11,12,13,14},{1,3,8,9,10,11,12,13,14,15},{1,3,8,9,10,11,12,13,15},{1,3,8,9,10,11,12,14},{1,3,8,9,10,11,12,14,15},{1,3,8,9,10,11,12,15},{1,3,8,9,10,11,13},{1,3,8,9,10,11,13,14},{1,3,8,9,10,11,13,14,15},{1,3,8,9,10,11,13,15},{1,3,8,9,10,11,14},{1,3,8,9,10,11,14,15},{1,3,8,9,10,11,15},{1,3,8,9,10,12},{1,3,8,9,10,12,13},{1,3,8,9,10,12,13,14},{1,3,8,9,10,12,13,14,15},{1,3,8,9,10,12,13,15},{1,3,8,9,10,12,14},{1,3,8,9,10,12,14,15},{1,3,8,9,10,12,15},{1,3,8,9,10,13},{1,3,8,9,10,13,14},{1,3,8,9,10,13,14,15},{1,3,8,9,10,13,15},{1,3,8,9,10,14},{1,3,8,9,10,14,15},{1,3,8,9,10,15},{1,3,8,9,11},{1,3,8,9,11,12},{1,3,8,9,11,12,13},{1,3,8,9,11,12,13,14},{1,3,8,9,11,12,13,14,15},{1,3,8,9,11,12,13,15},{1,3,8,9,11,12,14},{1,3,8,9,11,12,14,15},{1,3,8,9,11,12,15},{1,3,8,9,11,13},{1,3,8,9,11,13,14},{1,3,8,9,11,13,14,15},{1,3,8,9,11,13,15},{1,3,8,9,11,14},{1,3,8,9,11,14,15},{1,3,8,9,11,15},{1,3,8,9,12},{1,3,8,9,12,13},{1,3,8,9,12,13,14},{1,3,8,9,12,13,14,15},{1,3,8,9,12,13,15},{1,3,8,9,12,14},{1,3,8,9,12,14,15},{1,3,8,9,12,15},{1,3,8,9,13},{1,3,8,9,13,14},{1,3,8,9,13,14,15},{1,3,8,9,13,15},{1,3,8,9,14},{1,3,8,9,14,15},{1,3,8,9,15},{1,3,8,10},{1,3,8,10,11},{1,3,8,10,11,12},{1,3,8,10,11,12,13},{1,3,8,10,11,12,13,14},{1,3,8,10,11,12,13,14,15},{1,3,8,10,11,12,13,15},{1,3,8,10,11,12,14},{1,3,8,10,11,12,14,15},{1,3,8,10,11,12,15},{1,3,8,10,11,13},{1,3,8,10,11,13,14},{1,3,8,10,11,13,14,15},{1,3,8,10,11,13,15},{1,3,8,10,11,14},{1,3,8,10,11,14,15},{1,3,8,10,11,15},{1,3,8,10,12},{1,3,8,10,12,13},{1,3,8,10,12,13,14},{1,3,8,10,12,13,14,15},{1,3,8,10,12,13,15},{1,3,8,10,12,14},{1,3,8,10,12,14,15},{1,3,8,10,12,15},{1,3,8,10,13},{1,3,8,10,13,14},{1,3,8,10,13,14,15},{1,3,8,10,13,15},{1,3,8,10,14},{1,3,8,10,14,15},{1,3,8,10,15},{1,3,8,11},{1,3,8,11,12},{1,3,8,11,12,13},{1,3,8,11,12,13,14},{1,3,8,11,12,13,14,15},{1,3,8,11,12,13,15},{1,3,8,11,12,14},{1,3,8,11,12,14,15},{1,3,8,11,12,15},{1,3,8,11,13},{1,3,8,11,13,14},{1,3,8,11,13,14,15},{1,3,8,11,13,15},{1,3,8,11,14},{1,3,8,11,14,15},{1,3,8,11,15},{1,3,8,12},{1,3,8,12,13},{1,3,8,12,13,14},{1,3,8,12,13,14,15},{1,3,8,12,13,15},{1,3,8,12,14},{1,3,8,12,14,15},{1,3,8,12,15},{1,3,8,13},{1,3,8,13,14},{1,3,8,13,14,15},{1,3,8,13,15},{1,3,8,14},{1,3,8,14,15},{1,3,8,15},{1,3,9},{1,3,9,10},{1,3,9,10,11},{1,3,9,10,11,12},{1,3,9,10,11,12,13},{1,3,9,10,11,12,13,14},{1,3,9,10,11,12,13,14,15},{1,3,9,10,11,12,13,15},{1,3,9,10,11,12,14},{1,3,9,10,11,12,14,15},{1,3,9,10,11,12,15},{1,3,9,10,11,13},{1,3,9,10,11,13,14},{1,3,9,10,11,13,14,15},{1,3,9,10,11,13,15},{1,3,9,10,11,14},{1,3,9,10,11,14,15},{1,3,9,10,11,15},{1,3,9,10,12},{1,3,9,10,12,13},{1,3,9,10,12,13,14},{1,3,9,10,12,13,14,15},{1,3,9,10,12,13,15},{1,3,9,10,12,14},{1,3,9,10,12,14,15},{1,3,9,10,12,15},{1,3,9,10,13},{1,3,9,10,13,14},{1,3,9,10,13,14,15},{1,3,9,10,13,15},{1,3,9,10,14},{1,3,9,10,14,15},{1,3,9,10,15},{1,3,9,11},{1,3,9,11,12},{1,3,9,11,12,13},{1,3,9,11,12,13,14},{1,3,9,11,12,13,14,15},{1,3,9,11,12,13,15},{1,3,9,11,12,14},{1,3,9,11,12,14,15},{1,3,9,11,12,15},{1,3,9,11,13},{1,3,9,11,13,14},{1,3,9,11,13,14,15},{1,3,9,11,13,15},{1,3,9,11,14},{1,3,9,11,14,15},{1,3,9,11,15},{1,3,9,12},{1,3,9,12,13},{1,3,9,12,13,14},{1,3,9,12,13,14,15},{1,3,9,12,13,15},{1,3,9,12,14},{1,3,9,12,14,15},{1,3,9,12,15},{1,3,9,13},{1,3,9,13,14},{1,3,9,13,14,15},{1,3,9,13,15},{1,3,9,14},{1,3,9,14,15},{1,3,9,15},{1,3,10},{1,3,10,11},{1,3,10,11,12},{1,3,10,11,12,13},{1,3,10,11,12,13,14},{1,3,10,11,12,13,14,15},{1,3,10,11,12,13,15},{1,3,10,11,12,14},{1,3,10,11,12,14,15},{1,3,10,11,12,15},{1,3,10,11,13},{1,3,10,11,13,14},{1,3,10,11,13,14,15},{1,3,10,11,13,15},{1,3,10,11,14},{1,3,10,11,14,15},{1,3,10,11,15},{1,3,10,12},{1,3,10,12,13},{1,3,10,12,13,14},{1,3,10,12,13,14,15},{1,3,10,12,13,15},{1,3,10,12,14},{1,3,10,12,14,15},{1,3,10,12,15},{1,3,10,13},{1,3,10,13,14},{1,3,10,13,14,15},{1,3,10,13,15},{1,3,10,14},{1,3,10,14,15},{1,3,10,15},{1,3,11},{1,3,11,12},{1,3,11,12,13},{1,3,11,12,13,14},{1,3,11,12,13,14,15},{1,3,11,12,13,15},{1,3,11,12,14},{1,3,11,12,14,15},{1,3,11,12,15},{1,3,11,13},{1,3,11,13,14},{1,3,11,13,14,15},{1,3,11,13,15},{1,3,11,14},{1,3,11,14,15},{1,3,11,15},{1,3,12},{1,3,12,13},{1,3,12,13,14},{1,3,12,13,14,15},{1,3,12,13,15},{1,3,12,14},{1,3,12,14,15},{1,3,12,15},{1,3,13},{1,3,13,14},{1,3,13,14,15},{1,3,13,15},{1,3,14},{1,3,14,15},{1,3,15},{1,4},{1,4,5},{1,4,5,6},{1,4,5,6,7},{1,4,5,6,7,8},{1,4,5,6,7,8,9},{1,4,5,6,7,8,9,10},{1,4,5,6,7,8,9,10,11},{1,4,5,6,7,8,9,10,11,12},{1,4,5,6,7,8,9,10,11,12,13},{1,4,5,6,7,8,9,10,11,12,13,14},{1,4,5,6,7,8,9,10,11,12,13,14,15},{1,4,5,6,7,8,9,10,11,12,13,15},{1,4,5,6,7,8,9,10,11,12,14},{1,4,5,6,7,8,9,10,11,12,14,15},{1,4,5,6,7,8,9,10,11,12,15},{1,4,5,6,7,8,9,10,11,13},{1,4,5,6,7,8,9,10,11,13,14},{1,4,5,6,7,8,9,10,11,13,14,15},{1,4,5,6,7,8,9,10,11,13,15},{1,4,5,6,7,8,9,10,11,14},{1,4,5,6,7,8,9,10,11,14,15},{1,4,5,6,7,8,9,10,11,15},{1,4,5,6,7,8,9,10,12},{1,4,5,6,7,8,9,10,12,13},{1,4,5,6,7,8,9,10,12,13,14},{1,4,5,6,7,8,9,10,12,13,14,15},{1,4,5,6,7,8,9,10,12,13,15},{1,4,5,6,7,8,9,10,12,14},{1,4,5,6,7,8,9,10,12,14,15},{1,4,5,6,7,8,9,10,12,15},{1,4,5,6,7,8,9,10,13},{1,4,5,6,7,8,9,10,13,14},{1,4,5,6,7,8,9,10,13,14,15},{1,4,5,6,7,8,9,10,13,15},{1,4,5,6,7,8,9,10,14},{1,4,5,6,7,8,9,10,14,15},{1,4,5,6,7,8,9,10,15},{1,4,5,6,7,8,9,11},{1,4,5,6,7,8,9,11,12},{1,4,5,6,7,8,9,11,12,13},{1,4,5,6,7,8,9,11,12,13,14},{1,4,5,6,7,8,9,11,12,13,14,15},{1,4,5,6,7,8,9,11,12,13,15},{1,4,5,6,7,8,9,11,12,14},{1,4,5,6,7,8,9,11,12,14,15},{1,4,5,6,7,8,9,11,12,15},{1,4,5,6,7,8,9,11,13},{1,4,5,6,7,8,9,11,13,14},{1,4,5,6,7,8,9,11,13,14,15},{1,4,5,6,7,8,9,11,13,15},{1,4,5,6,7,8,9,11,14},{1,4,5,6,7,8,9,11,14,15},{1,4,5,6,7,8,9,11,15},{1,4,5,6,7,8,9,12},{1,4,5,6,7,8,9,12,13},{1,4,5,6,7,8,9,12,13,14},{1,4,5,6,7,8,9,12,13,14,15},{1,4,5,6,7,8,9,12,13,15},{1,4,5,6,7,8,9,12,14},{1,4,5,6,7,8,9,12,14,15},{1,4,5,6,7,8,9,12,15},{1,4,5,6,7,8,9,13},{1,4,5,6,7,8,9,13,14},{1,4,5,6,7,8,9,13,14,15},{1,4,5,6,7,8,9,13,15},{1,4,5,6,7,8,9,14},{1,4,5,6,7,8,9,14,15},{1,4,5,6,7,8,9,15},{1,4,5,6,7,8,10},{1,4,5,6,7,8,10,11},{1,4,5,6,7,8,10,11,12},{1,4,5,6,7,8,10,11,12,13},{1,4,5,6,7,8,10,11,12,13,14},{1,4,5,6,7,8,10,11,12,13,14,15},{1,4,5,6,7,8,10,11,12,13,15},{1,4,5,6,7,8,10,11,12,14},{1,4,5,6,7,8,10,11,12,14,15},{1,4,5,6,7,8,10,11,12,15},{1,4,5,6,7,8,10,11,13},{1,4,5,6,7,8,10,11,13,14},{1,4,5,6,7,8,10,11,13,14,15},{1,4,5,6,7,8,10,11,13,15},{1,4,5,6,7,8,10,11,14},{1,4,5,6,7,8,10,11,14,15},{1,4,5,6,7,8,10,11,15},{1,4,5,6,7,8,10,12},{1,4,5,6,7,8,10,12,13},{1,4,5,6,7,8,10,12,13,14},{1,4,5,6,7,8,10,12,13,14,15},{1,4,5,6,7,8,10,12,13,15},{1,4,5,6,7,8,10,12,14},{1,4,5,6,7,8,10,12,14,15},{1,4,5,6,7,8,10,12,15},{1,4,5,6,7,8,10,13},{1,4,5,6,7,8,10,13,14},{1,4,5,6,7,8,10,13,14,15},{1,4,5,6,7,8,10,13,15},{1,4,5,6,7,8,10,14},{1,4,5,6,7,8,10,14,15},{1,4,5,6,7,8,10,15},{1,4,5,6,7,8,11},{1,4,5,6,7,8,11,12},{1,4,5,6,7,8,11,12,13},{1,4,5,6,7,8,11,12,13,14},{1,4,5,6,7,8,11,12,13,14,15},{1,4,5,6,7,8,11,12,13,15},{1,4,5,6,7,8,11,12,14},{1,4,5,6,7,8,11,12,14,15},{1,4,5,6,7,8,11,12,15},{1,4,5,6,7,8,11,13},{1,4,5,6,7,8,11,13,14},{1,4,5,6,7,8,11,13,14,15},{1,4,5,6,7,8,11,13,15},{1,4,5,6,7,8,11,14},{1,4,5,6,7,8,11,14,15},{1,4,5,6,7,8,11,15},{1,4,5,6,7,8,12},{1,4,5,6,7,8,12,13},{1,4,5,6,7,8,12,13,14},{1,4,5,6,7,8,12,13,14,15},{1,4,5,6,7,8,12,13,15},{1,4,5,6,7,8,12,14},{1,4,5,6,7,8,12,14,15},{1,4,5,6,7,8,12,15},{1,4,5,6,7,8,13},{1,4,5,6,7,8,13,14},{1,4,5,6,7,8,13,14,15},{1,4,5,6,7,8,13,15},{1,4,5,6,7,8,14},{1,4,5,6,7,8,14,15},{1,4,5,6,7,8,15},{1,4,5,6,7,9},{1,4,5,6,7,9,10},{1,4,5,6,7,9,10,11},{1,4,5,6,7,9,10,11,12},{1,4,5,6,7,9,10,11,12,13},{1,4,5,6,7,9,10,11,12,13,14},{1,4,5,6,7,9,10,11,12,13,14,15},{1,4,5,6,7,9,10,11,12,13,15},{1,4,5,6,7,9,10,11,12,14},{1,4,5,6,7,9,10,11,12,14,15},{1,4,5,6,7,9,10,11,12,15},{1,4,5,6,7,9,10,11,13},{1,4,5,6,7,9,10,11,13,14},{1,4,5,6,7,9,10,11,13,14,15},{1,4,5,6,7,9,10,11,13,15},{1,4,5,6,7,9,10,11,14},{1,4,5,6,7,9,10,11,14,15},{1,4,5,6,7,9,10,11,15},{1,4,5,6,7,9,10,12},{1,4,5,6,7,9,10,12,13},{1,4,5,6,7,9,10,12,13,14},{1,4,5,6,7,9,10,12,13,14,15},{1,4,5,6,7,9,10,12,13,15},{1,4,5,6,7,9,10,12,14},{1,4,5,6,7,9,10,12,14,15},{1,4,5,6,7,9,10,12,15},{1,4,5,6,7,9,10,13},{1,4,5,6,7,9,10,13,14},{1,4,5,6,7,9,10,13,14,15},{1,4,5,6,7,9,10,13,15},{1,4,5,6,7,9,10,14},{1,4,5,6,7,9,10,14,15},{1,4,5,6,7,9,10,15},{1,4,5,6,7,9,11},{1,4,5,6,7,9,11,12},{1,4,5,6,7,9,11,12,13},{1,4,5,6,7,9,11,12,13,14},{1,4,5,6,7,9,11,12,13,14,15},{1,4,5,6,7,9,11,12,13,15},{1,4,5,6,7,9,11,12,14},{1,4,5,6,7,9,11,12,14,15},{1,4,5,6,7,9,11,12,15},{1,4,5,6,7,9,11,13},{1,4,5,6,7,9,11,13,14},{1,4,5,6,7,9,11,13,14,15},{1,4,5,6,7,9,11,13,15},{1,4,5,6,7,9,11,14},{1,4,5,6,7,9,11,14,15},{1,4,5,6,7,9,11,15},{1,4,5,6,7,9,12},{1,4,5,6,7,9,12,13},{1,4,5,6,7,9,12,13,14},{1,4,5,6,7,9,12,13,14,15},{1,4,5,6,7,9,12,13,15},{1,4,5,6,7,9,12,14},{1,4,5,6,7,9,12,14,15},{1,4,5,6,7,9,12,15},{1,4,5,6,7,9,13},{1,4,5,6,7,9,13,14},{1,4,5,6,7,9,13,14,15},{1,4,5,6,7,9,13,15},{1,4,5,6,7,9,14},{1,4,5,6,7,9,14,15},{1,4,5,6,7,9,15},{1,4,5,6,7,10},{1,4,5,6,7,10,11},{1,4,5,6,7,10,11,12},{1,4,5,6,7,10,11,12,13},{1,4,5,6,7,10,11,12,13,14},{1,4,5,6,7,10,11,12,13,14,15},{1,4,5,6,7,10,11,12,13,15},{1,4,5,6,7,10,11,12,14},{1,4,5,6,7,10,11,12,14,15},{1,4,5,6,7,10,11,12,15},{1,4,5,6,7,10,11,13},{1,4,5,6,7,10,11,13,14},{1,4,5,6,7,10,11,13,14,15},{1,4,5,6,7,10,11,13,15},{1,4,5,6,7,10,11,14},{1,4,5,6,7,10,11,14,15},{1,4,5,6,7,10,11,15},{1,4,5,6,7,10,12},{1,4,5,6,7,10,12,13},{1,4,5,6,7,10,12,13,14},{1,4,5,6,7,10,12,13,14,15},{1,4,5,6,7,10,12,13,15},{1,4,5,6,7,10,12,14},{1,4,5,6,7,10,12,14,15},{1,4,5,6,7,10,12,15},{1,4,5,6,7,10,13},{1,4,5,6,7,10,13,14},{1,4,5,6,7,10,13,14,15},{1,4,5,6,7,10,13,15},{1,4,5,6,7,10,14},{1,4,5,6,7,10,14,15},{1,4,5,6,7,10,15},{1,4,5,6,7,11},{1,4,5,6,7,11,12},{1,4,5,6,7,11,12,13},{1,4,5,6,7,11,12,13,14},{1,4,5,6,7,11,12,13,14,15},{1,4,5,6,7,11,12,13,15},{1,4,5,6,7,11,12,14},{1,4,5,6,7,11,12,14,15},{1,4,5,6,7,11,12,15},{1,4,5,6,7,11,13},{1,4,5,6,7,11,13,14},{1,4,5,6,7,11,13,14,15},{1,4,5,6,7,11,13,15},{1,4,5,6,7,11,14},{1,4,5,6,7,11,14,15},{1,4,5,6,7,11,15},{1,4,5,6,7,12},{1,4,5,6,7,12,13},{1,4,5,6,7,12,13,14},{1,4,5,6,7,12,13,14,15},{1,4,5,6,7,12,13,15},{1,4,5,6,7,12,14},{1,4,5,6,7,12,14,15},{1,4,5,6,7,12,15},{1,4,5,6,7,13},{1,4,5,6,7,13,14},{1,4,5,6,7,13,14,15},{1,4,5,6,7,13,15},{1,4,5,6,7,14},{1,4,5,6,7,14,15},{1,4,5,6,7,15},{1,4,5,6,8},{1,4,5,6,8,9},{1,4,5,6,8,9,10},{1,4,5,6,8,9,10,11},{1,4,5,6,8,9,10,11,12},{1,4,5,6,8,9,10,11,12,13},{1,4,5,6,8,9,10,11,12,13,14},{1,4,5,6,8,9,10,11,12,13,14,15},{1,4,5,6,8,9,10,11,12,13,15},{1,4,5,6,8,9,10,11,12,14},{1,4,5,6,8,9,10,11,12,14,15},{1,4,5,6,8,9,10,11,12,15},{1,4,5,6,8,9,10,11,13},{1,4,5,6,8,9,10,11,13,14},{1,4,5,6,8,9,10,11,13,14,15},{1,4,5,6,8,9,10,11,13,15},{1,4,5,6,8,9,10,11,14},{1,4,5,6,8,9,10,11,14,15},{1,4,5,6,8,9,10,11,15},{1,4,5,6,8,9,10,12},{1,4,5,6,8,9,10,12,13},{1,4,5,6,8,9,10,12,13,14},{1,4,5,6,8,9,10,12,13,14,15},{1,4,5,6,8,9,10,12,13,15},{1,4,5,6,8,9,10,12,14},{1,4,5,6,8,9,10,12,14,15},{1,4,5,6,8,9,10,12,15},{1,4,5,6,8,9,10,13},{1,4,5,6,8,9,10,13,14},{1,4,5,6,8,9,10,13,14,15},{1,4,5,6,8,9,10,13,15},{1,4,5,6,8,9,10,14},{1,4,5,6,8,9,10,14,15},{1,4,5,6,8,9,10,15},{1,4,5,6,8,9,11},{1,4,5,6,8,9,11,12},{1,4,5,6,8,9,11,12,13},{1,4,5,6,8,9,11,12,13,14},{1,4,5,6,8,9,11,12,13,14,15},{1,4,5,6,8,9,11,12,13,15},{1,4,5,6,8,9,11,12,14},{1,4,5,6,8,9,11,12,14,15},{1,4,5,6,8,9,11,12,15},{1,4,5,6,8,9,11,13},{1,4,5,6,8,9,11,13,14},{1,4,5,6,8,9,11,13,14,15},{1,4,5,6,8,9,11,13,15},{1,4,5,6,8,9,11,14},{1,4,5,6,8,9,11,14,15},{1,4,5,6,8,9,11,15},{1,4,5,6,8,9,12},{1,4,5,6,8,9,12,13},{1,4,5,6,8,9,12,13,14},{1,4,5,6,8,9,12,13,14,15},{1,4,5,6,8,9,12,13,15},{1,4,5,6,8,9,12,14},{1,4,5,6,8,9,12,14,15},{1,4,5,6,8,9,12,15},{1,4,5,6,8,9,13},{1,4,5,6,8,9,13,14},{1,4,5,6,8,9,13,14,15},{1,4,5,6,8,9,13,15},{1,4,5,6,8,9,14},{1,4,5,6,8,9,14,15},{1,4,5,6,8,9,15},{1,4,5,6,8,10},{1,4,5,6,8,10,11},{1,4,5,6,8,10,11,12},{1,4,5,6,8,10,11,12,13},{1,4,5,6,8,10,11,12,13,14},{1,4,5,6,8,10,11,12,13,14,15},{1,4,5,6,8,10,11,12,13,15},{1,4,5,6,8,10,11,12,14},{1,4,5,6,8,10,11,12,14,15},{1,4,5,6,8,10,11,12,15},{1,4,5,6,8,10,11,13},{1,4,5,6,8,10,11,13,14},{1,4,5,6,8,10,11,13,14,15},{1,4,5,6,8,10,11,13,15},{1,4,5,6,8,10,11,14},{1,4,5,6,8,10,11,14,15},{1,4,5,6,8,10,11,15},{1,4,5,6,8,10,12},{1,4,5,6,8,10,12,13},{1,4,5,6,8,10,12,13,14},{1,4,5,6,8,10,12,13,14,15},{1,4,5,6,8,10,12,13,15},{1,4,5,6,8,10,12,14},{1,4,5,6,8,10,12,14,15},{1,4,5,6,8,10,12,15},{1,4,5,6,8,10,13},{1,4,5,6,8,10,13,14},{1,4,5,6,8,10,13,14,15},{1,4,5,6,8,10,13,15},{1,4,5,6,8,10,14},{1,4,5,6,8,10,14,15},{1,4,5,6,8,10,15},{1,4,5,6,8,11},{1,4,5,6,8,11,12},{1,4,5,6,8,11,12,13},{1,4,5,6,8,11,12,13,14},{1,4,5,6,8,11,12,13,14,15},{1,4,5,6,8,11,12,13,15},{1,4,5,6,8,11,12,14},{1,4,5,6,8,11,12,14,15},{1,4,5,6,8,11,12,15},{1,4,5,6,8,11,13},{1,4,5,6,8,11,13,14},{1,4,5,6,8,11,13,14,15},{1,4,5,6,8,11,13,15},{1,4,5,6,8,11,14},{1,4,5,6,8,11,14,15},{1,4,5,6,8,11,15},{1,4,5,6,8,12},{1,4,5,6,8,12,13},{1,4,5,6,8,12,13,14},{1,4,5,6,8,12,13,14,15},{1,4,5,6,8,12,13,15},{1,4,5,6,8,12,14},{1,4,5,6,8,12,14,15},{1,4,5,6,8,12,15},{1,4,5,6,8,13},{1,4,5,6,8,13,14},{1,4,5,6,8,13,14,15},{1,4,5,6,8,13,15},{1,4,5,6,8,14},{1,4,5,6,8,14,15},{1,4,5,6,8,15},{1,4,5,6,9},{1,4,5,6,9,10},{1,4,5,6,9,10,11},{1,4,5,6,9,10,11,12},{1,4,5,6,9,10,11,12,13},{1,4,5,6,9,10,11,12,13,14},{1,4,5,6,9,10,11,12,13,14,15},{1,4,5,6,9,10,11,12,13,15},{1,4,5,6,9,10,11,12,14},{1,4,5,6,9,10,11,12,14,15},{1,4,5,6,9,10,11,12,15},{1,4,5,6,9,10,11,13},{1,4,5,6,9,10,11,13,14},{1,4,5,6,9,10,11,13,14,15},{1,4,5,6,9,10,11,13,15},{1,4,5,6,9,10,11,14},{1,4,5,6,9,10,11,14,15},{1,4,5,6,9,10,11,15},{1,4,5,6,9,10,12},{1,4,5,6,9,10,12,13},{1,4,5,6,9,10,12,13,14},{1,4,5,6,9,10,12,13,14,15},{1,4,5,6,9,10,12,13,15},{1,4,5,6,9,10,12,14},{1,4,5,6,9,10,12,14,15},{1,4,5,6,9,10,12,15},{1,4,5,6,9,10,13},{1,4,5,6,9,10,13,14},{1,4,5,6,9,10,13,14,15},{1,4,5,6,9,10,13,15},{1,4,5,6,9,10,14},{1,4,5,6,9,10,14,15},{1,4,5,6,9,10,15},{1,4,5,6,9,11},{1,4,5,6,9,11,12},{1,4,5,6,9,11,12,13},{1,4,5,6,9,11,12,13,14},{1,4,5,6,9,11,12,13,14,15},{1,4,5,6,9,11,12,13,15},{1,4,5,6,9,11,12,14},{1,4,5,6,9,11,12,14,15},{1,4,5,6,9,11,12,15},{1,4,5,6,9,11,13},{1,4,5,6,9,11,13,14},{1,4,5,6,9,11,13,14,15},{1,4,5,6,9,11,13,15},{1,4,5,6,9,11,14},{1,4,5,6,9,11,14,15},{1,4,5,6,9,11,15},{1,4,5,6,9,12},{1,4,5,6,9,12,13},{1,4,5,6,9,12,13,14},{1,4,5,6,9,12,13,14,15},{1,4,5,6,9,12,13,15},{1,4,5,6,9,12,14},{1,4,5,6,9,12,14,15},{1,4,5,6,9,12,15},{1,4,5,6,9,13},{1,4,5,6,9,13,14},{1,4,5,6,9,13,14,15},{1,4,5,6,9,13,15},{1,4,5,6,9,14},{1,4,5,6,9,14,15},{1,4,5,6,9,15},{1,4,5,6,10},{1,4,5,6,10,11},{1,4,5,6,10,11,12},{1,4,5,6,10,11,12,13},{1,4,5,6,10,11,12,13,14},{1,4,5,6,10,11,12,13,14,15},{1,4,5,6,10,11,12,13,15},{1,4,5,6,10,11,12,14},{1,4,5,6,10,11,12,14,15},{1,4,5,6,10,11,12,15},{1,4,5,6,10,11,13},{1,4,5,6,10,11,13,14},{1,4,5,6,10,11,13,14,15},{1,4,5,6,10,11,13,15},{1,4,5,6,10,11,14},{1,4,5,6,10,11,14,15},{1,4,5,6,10,11,15},{1,4,5,6,10,12},{1,4,5,6,10,12,13},{1,4,5,6,10,12,13,14},{1,4,5,6,10,12,13,14,15},{1,4,5,6,10,12,13,15},{1,4,5,6,10,12,14},{1,4,5,6,10,12,14,15},{1,4,5,6,10,12,15},{1,4,5,6,10,13},{1,4,5,6,10,13,14},{1,4,5,6,10,13,14,15},{1,4,5,6,10,13,15},{1,4,5,6,10,14},{1,4,5,6,10,14,15},{1,4,5,6,10,15},{1,4,5,6,11},{1,4,5,6,11,12},{1,4,5,6,11,12,13},{1,4,5,6,11,12,13,14},{1,4,5,6,11,12,13,14,15},{1,4,5,6,11,12,13,15},{1,4,5,6,11,12,14},{1,4,5,6,11,12,14,15},{1,4,5,6,11,12,15},{1,4,5,6,11,13},{1,4,5,6,11,13,14},{1,4,5,6,11,13,14,15},{1,4,5,6,11,13,15},{1,4,5,6,11,14},{1,4,5,6,11,14,15},{1,4,5,6,11,15},{1,4,5,6,12},{1,4,5,6,12,13},{1,4,5,6,12,13,14},{1,4,5,6,12,13,14,15},{1,4,5,6,12,13,15},{1,4,5,6,12,14},{1,4,5,6,12,14,15},{1,4,5,6,12,15},{1,4,5,6,13},{1,4,5,6,13,14},{1,4,5,6,13,14,15},{1,4,5,6,13,15},{1,4,5,6,14},{1,4,5,6,14,15},{1,4,5,6,15},{1,4,5,7},{1,4,5,7,8},{1,4,5,7,8,9},{1,4,5,7,8,9,10},{1,4,5,7,8,9,10,11},{1,4,5,7,8,9,10,11,12},{1,4,5,7,8,9,10,11,12,13},{1,4,5,7,8,9,10,11,12,13,14},{1,4,5,7,8,9,10,11,12,13,14,15},{1,4,5,7,8,9,10,11,12,13,15},{1,4,5,7,8,9,10,11,12,14},{1,4,5,7,8,9,10,11,12,14,15},{1,4,5,7,8,9,10,11,12,15},{1,4,5,7,8,9,10,11,13},{1,4,5,7,8,9,10,11,13,14},{1,4,5,7,8,9,10,11,13,14,15},{1,4,5,7,8,9,10,11,13,15},{1,4,5,7,8,9,10,11,14},{1,4,5,7,8,9,10,11,14,15},{1,4,5,7,8,9,10,11,15},{1,4,5,7,8,9,10,12},{1,4,5,7,8,9,10,12,13},{1,4,5,7,8,9,10,12,13,14},{1,4,5,7,8,9,10,12,13,14,15},{1,4,5,7,8,9,10,12,13,15},{1,4,5,7,8,9,10,12,14},{1,4,5,7,8,9,10,12,14,15},{1,4,5,7,8,9,10,12,15},{1,4,5,7,8,9,10,13},{1,4,5,7,8,9,10,13,14},{1,4,5,7,8,9,10,13,14,15},{1,4,5,7,8,9,10,13,15},{1,4,5,7,8,9,10,14},{1,4,5,7,8,9,10,14,15},{1,4,5,7,8,9,10,15},{1,4,5,7,8,9,11},{1,4,5,7,8,9,11,12},{1,4,5,7,8,9,11,12,13},{1,4,5,7,8,9,11,12,13,14},{1,4,5,7,8,9,11,12,13,14,15},{1,4,5,7,8,9,11,12,13,15},{1,4,5,7,8,9,11,12,14},{1,4,5,7,8,9,11,12,14,15},{1,4,5,7,8,9,11,12,15},{1,4,5,7,8,9,11,13},{1,4,5,7,8,9,11,13,14},{1,4,5,7,8,9,11,13,14,15},{1,4,5,7,8,9,11,13,15},{1,4,5,7,8,9,11,14},{1,4,5,7,8,9,11,14,15},{1,4,5,7,8,9,11,15},{1,4,5,7,8,9,12},{1,4,5,7,8,9,12,13},{1,4,5,7,8,9,12,13,14},{1,4,5,7,8,9,12,13,14,15},{1,4,5,7,8,9,12,13,15},{1,4,5,7,8,9,12,14},{1,4,5,7,8,9,12,14,15},{1,4,5,7,8,9,12,15},{1,4,5,7,8,9,13},{1,4,5,7,8,9,13,14},{1,4,5,7,8,9,13,14,15},{1,4,5,7,8,9,13,15},{1,4,5,7,8,9,14},{1,4,5,7,8,9,14,15},{1,4,5,7,8,9,15},{1,4,5,7,8,10},{1,4,5,7,8,10,11},{1,4,5,7,8,10,11,12},{1,4,5,7,8,10,11,12,13},{1,4,5,7,8,10,11,12,13,14},{1,4,5,7,8,10,11,12,13,14,15},{1,4,5,7,8,10,11,12,13,15},{1,4,5,7,8,10,11,12,14},{1,4,5,7,8,10,11,12,14,15},{1,4,5,7,8,10,11,12,15},{1,4,5,7,8,10,11,13},{1,4,5,7,8,10,11,13,14},{1,4,5,7,8,10,11,13,14,15},{1,4,5,7,8,10,11,13,15},{1,4,5,7,8,10,11,14},{1,4,5,7,8,10,11,14,15},{1,4,5,7,8,10,11,15},{1,4,5,7,8,10,12},{1,4,5,7,8,10,12,13},{1,4,5,7,8,10,12,13,14},{1,4,5,7,8,10,12,13,14,15},{1,4,5,7,8,10,12,13,15},{1,4,5,7,8,10,12,14},{1,4,5,7,8,10,12,14,15},{1,4,5,7,8,10,12,15},{1,4,5,7,8,10,13},{1,4,5,7,8,10,13,14},{1,4,5,7,8,10,13,14,15},{1,4,5,7,8,10,13,15},{1,4,5,7,8,10,14},{1,4,5,7,8,10,14,15},{1,4,5,7,8,10,15},{1,4,5,7,8,11},{1,4,5,7,8,11,12},{1,4,5,7,8,11,12,13},{1,4,5,7,8,11,12,13,14},{1,4,5,7,8,11,12,13,14,15},{1,4,5,7,8,11,12,13,15},{1,4,5,7,8,11,12,14},{1,4,5,7,8,11,12,14,15},{1,4,5,7,8,11,12,15},{1,4,5,7,8,11,13},{1,4,5,7,8,11,13,14},{1,4,5,7,8,11,13,14,15},{1,4,5,7,8,11,13,15},{1,4,5,7,8,11,14},{1,4,5,7,8,11,14,15},{1,4,5,7,8,11,15},{1,4,5,7,8,12},{1,4,5,7,8,12,13},{1,4,5,7,8,12,13,14},{1,4,5,7,8,12,13,14,15},{1,4,5,7,8,12,13,15},{1,4,5,7,8,12,14},{1,4,5,7,8,12,14,15},{1,4,5,7,8,12,15},{1,4,5,7,8,13},{1,4,5,7,8,13,14},{1,4,5,7,8,13,14,15},{1,4,5,7,8,13,15},{1,4,5,7,8,14},{1,4,5,7,8,14,15},{1,4,5,7,8,15},{1,4,5,7,9},{1,4,5,7,9,10},{1,4,5,7,9,10,11},{1,4,5,7,9,10,11,12},{1,4,5,7,9,10,11,12,13},{1,4,5,7,9,10,11,12,13,14},{1,4,5,7,9,10,11,12,13,14,15},{1,4,5,7,9,10,11,12,13,15},{1,4,5,7,9,10,11,12,14},{1,4,5,7,9,10,11,12,14,15},{1,4,5,7,9,10,11,12,15},{1,4,5,7,9,10,11,13},{1,4,5,7,9,10,11,13,14},{1,4,5,7,9,10,11,13,14,15},{1,4,5,7,9,10,11,13,15},{1,4,5,7,9,10,11,14},{1,4,5,7,9,10,11,14,15},{1,4,5,7,9,10,11,15},{1,4,5,7,9,10,12},{1,4,5,7,9,10,12,13},{1,4,5,7,9,10,12,13,14},{1,4,5,7,9,10,12,13,14,15},{1,4,5,7,9,10,12,13,15},{1,4,5,7,9,10,12,14},{1,4,5,7,9,10,12,14,15},{1,4,5,7,9,10,12,15},{1,4,5,7,9,10,13},{1,4,5,7,9,10,13,14},{1,4,5,7,9,10,13,14,15},{1,4,5,7,9,10,13,15},{1,4,5,7,9,10,14},{1,4,5,7,9,10,14,15},{1,4,5,7,9,10,15},{1,4,5,7,9,11},{1,4,5,7,9,11,12},{1,4,5,7,9,11,12,13},{1,4,5,7,9,11,12,13,14},{1,4,5,7,9,11,12,13,14,15},{1,4,5,7,9,11,12,13,15},{1,4,5,7,9,11,12,14},{1,4,5,7,9,11,12,14,15},{1,4,5,7,9,11,12,15},{1,4,5,7,9,11,13},{1,4,5,7,9,11,13,14},{1,4,5,7,9,11,13,14,15},{1,4,5,7,9,11,13,15},{1,4,5,7,9,11,14},{1,4,5,7,9,11,14,15},{1,4,5,7,9,11,15},{1,4,5,7,9,12},{1,4,5,7,9,12,13},{1,4,5,7,9,12,13,14},{1,4,5,7,9,12,13,14,15},{1,4,5,7,9,12,13,15},{1,4,5,7,9,12,14},{1,4,5,7,9,12,14,15},{1,4,5,7,9,12,15},{1,4,5,7,9,13},{1,4,5,7,9,13,14},{1,4,5,7,9,13,14,15},{1,4,5,7,9,13,15},{1,4,5,7,9,14},{1,4,5,7,9,14,15},{1,4,5,7,9,15},{1,4,5,7,10},{1,4,5,7,10,11},{1,4,5,7,10,11,12},{1,4,5,7,10,11,12,13},{1,4,5,7,10,11,12,13,14},{1,4,5,7,10,11,12,13,14,15},{1,4,5,7,10,11,12,13,15},{1,4,5,7,10,11,12,14},{1,4,5,7,10,11,12,14,15},{1,4,5,7,10,11,12,15},{1,4,5,7,10,11,13},{1,4,5,7,10,11,13,14},{1,4,5,7,10,11,13,14,15},{1,4,5,7,10,11,13,15},{1,4,5,7,10,11,14},{1,4,5,7,10,11,14,15},{1,4,5,7,10,11,15},{1,4,5,7,10,12},{1,4,5,7,10,12,13},{1,4,5,7,10,12,13,14},{1,4,5,7,10,12,13,14,15},{1,4,5,7,10,12,13,15},{1,4,5,7,10,12,14},{1,4,5,7,10,12,14,15},{1,4,5,7,10,12,15},{1,4,5,7,10,13},{1,4,5,7,10,13,14},{1,4,5,7,10,13,14,15},{1,4,5,7,10,13,15},{1,4,5,7,10,14},{1,4,5,7,10,14,15},{1,4,5,7,10,15},{1,4,5,7,11},{1,4,5,7,11,12},{1,4,5,7,11,12,13},{1,4,5,7,11,12,13,14},{1,4,5,7,11,12,13,14,15},{1,4,5,7,11,12,13,15},{1,4,5,7,11,12,14},{1,4,5,7,11,12,14,15},{1,4,5,7,11,12,15},{1,4,5,7,11,13},{1,4,5,7,11,13,14},{1,4,5,7,11,13,14,15},{1,4,5,7,11,13,15},{1,4,5,7,11,14},{1,4,5,7,11,14,15},{1,4,5,7,11,15},{1,4,5,7,12},{1,4,5,7,12,13},{1,4,5,7,12,13,14},{1,4,5,7,12,13,14,15},{1,4,5,7,12,13,15},{1,4,5,7,12,14},{1,4,5,7,12,14,15},{1,4,5,7,12,15},{1,4,5,7,13},{1,4,5,7,13,14},{1,4,5,7,13,14,15},{1,4,5,7,13,15},{1,4,5,7,14},{1,4,5,7,14,15},{1,4,5,7,15},{1,4,5,8},{1,4,5,8,9},{1,4,5,8,9,10},{1,4,5,8,9,10,11},{1,4,5,8,9,10,11,12},{1,4,5,8,9,10,11,12,13},{1,4,5,8,9,10,11,12,13,14},{1,4,5,8,9,10,11,12,13,14,15},{1,4,5,8,9,10,11,12,13,15},{1,4,5,8,9,10,11,12,14},{1,4,5,8,9,10,11,12,14,15},{1,4,5,8,9,10,11,12,15},{1,4,5,8,9,10,11,13},{1,4,5,8,9,10,11,13,14},{1,4,5,8,9,10,11,13,14,15},{1,4,5,8,9,10,11,13,15},{1,4,5,8,9,10,11,14},{1,4,5,8,9,10,11,14,15},{1,4,5,8,9,10,11,15},{1,4,5,8,9,10,12},{1,4,5,8,9,10,12,13},{1,4,5,8,9,10,12,13,14},{1,4,5,8,9,10,12,13,14,15},{1,4,5,8,9,10,12,13,15},{1,4,5,8,9,10,12,14},{1,4,5,8,9,10,12,14,15},{1,4,5,8,9,10,12,15},{1,4,5,8,9,10,13},{1,4,5,8,9,10,13,14},{1,4,5,8,9,10,13,14,15},{1,4,5,8,9,10,13,15},{1,4,5,8,9,10,14},{1,4,5,8,9,10,14,15},{1,4,5,8,9,10,15},{1,4,5,8,9,11},{1,4,5,8,9,11,12},{1,4,5,8,9,11,12,13},{1,4,5,8,9,11,12,13,14},{1,4,5,8,9,11,12,13,14,15},{1,4,5,8,9,11,12,13,15},{1,4,5,8,9,11,12,14},{1,4,5,8,9,11,12,14,15},{1,4,5,8,9,11,12,15},{1,4,5,8,9,11,13},{1,4,5,8,9,11,13,14},{1,4,5,8,9,11,13,14,15},{1,4,5,8,9,11,13,15},{1,4,5,8,9,11,14},{1,4,5,8,9,11,14,15},{1,4,5,8,9,11,15},{1,4,5,8,9,12},{1,4,5,8,9,12,13},{1,4,5,8,9,12,13,14},{1,4,5,8,9,12,13,14,15},{1,4,5,8,9,12,13,15},{1,4,5,8,9,12,14},{1,4,5,8,9,12,14,15},{1,4,5,8,9,12,15},{1,4,5,8,9,13},{1,4,5,8,9,13,14},{1,4,5,8,9,13,14,15},{1,4,5,8,9,13,15},{1,4,5,8,9,14},{1,4,5,8,9,14,15},{1,4,5,8,9,15},{1,4,5,8,10},{1,4,5,8,10,11},{1,4,5,8,10,11,12},{1,4,5,8,10,11,12,13},{1,4,5,8,10,11,12,13,14},{1,4,5,8,10,11,12,13,14,15},{1,4,5,8,10,11,12,13,15},{1,4,5,8,10,11,12,14},{1,4,5,8,10,11,12,14,15},{1,4,5,8,10,11,12,15},{1,4,5,8,10,11,13},{1,4,5,8,10,11,13,14},{1,4,5,8,10,11,13,14,15},{1,4,5,8,10,11,13,15},{1,4,5,8,10,11,14},{1,4,5,8,10,11,14,15},{1,4,5,8,10,11,15},{1,4,5,8,10,12},{1,4,5,8,10,12,13},{1,4,5,8,10,12,13,14},{1,4,5,8,10,12,13,14,15},{1,4,5,8,10,12,13,15},{1,4,5,8,10,12,14},{1,4,5,8,10,12,14,15},{1,4,5,8,10,12,15},{1,4,5,8,10,13},{1,4,5,8,10,13,14},{1,4,5,8,10,13,14,15},{1,4,5,8,10,13,15},{1,4,5,8,10,14},{1,4,5,8,10,14,15},{1,4,5,8,10,15},{1,4,5,8,11},{1,4,5,8,11,12},{1,4,5,8,11,12,13},{1,4,5,8,11,12,13,14},{1,4,5,8,11,12,13,14,15},{1,4,5,8,11,12,13,15},{1,4,5,8,11,12,14},{1,4,5,8,11,12,14,15},{1,4,5,8,11,12,15},{1,4,5,8,11,13},{1,4,5,8,11,13,14},{1,4,5,8,11,13,14,15},{1,4,5,8,11,13,15},{1,4,5,8,11,14},{1,4,5,8,11,14,15},{1,4,5,8,11,15},{1,4,5,8,12},{1,4,5,8,12,13},{1,4,5,8,12,13,14},{1,4,5,8,12,13,14,15},{1,4,5,8,12,13,15},{1,4,5,8,12,14},{1,4,5,8,12,14,15},{1,4,5,8,12,15},{1,4,5,8,13},{1,4,5,8,13,14},{1,4,5,8,13,14,15},{1,4,5,8,13,15},{1,4,5,8,14},{1,4,5,8,14,15},{1,4,5,8,15},{1,4,5,9},{1,4,5,9,10},{1,4,5,9,10,11},{1,4,5,9,10,11,12},{1,4,5,9,10,11,12,13},{1,4,5,9,10,11,12,13,14},{1,4,5,9,10,11,12,13,14,15},{1,4,5,9,10,11,12,13,15},{1,4,5,9,10,11,12,14},{1,4,5,9,10,11,12,14,15},{1,4,5,9,10,11,12,15},{1,4,5,9,10,11,13},{1,4,5,9,10,11,13,14},{1,4,5,9,10,11,13,14,15},{1,4,5,9,10,11,13,15},{1,4,5,9,10,11,14},{1,4,5,9,10,11,14,15},{1,4,5,9,10,11,15},{1,4,5,9,10,12},{1,4,5,9,10,12,13},{1,4,5,9,10,12,13,14},{1,4,5,9,10,12,13,14,15},{1,4,5,9,10,12,13,15},{1,4,5,9,10,12,14},{1,4,5,9,10,12,14,15},{1,4,5,9,10,12,15},{1,4,5,9,10,13},{1,4,5,9,10,13,14},{1,4,5,9,10,13,14,15},{1,4,5,9,10,13,15},{1,4,5,9,10,14},{1,4,5,9,10,14,15},{1,4,5,9,10,15},{1,4,5,9,11},{1,4,5,9,11,12},{1,4,5,9,11,12,13},{1,4,5,9,11,12,13,14},{1,4,5,9,11,12,13,14,15},{1,4,5,9,11,12,13,15},{1,4,5,9,11,12,14},{1,4,5,9,11,12,14,15},{1,4,5,9,11,12,15},{1,4,5,9,11,13},{1,4,5,9,11,13,14},{1,4,5,9,11,13,14,15},{1,4,5,9,11,13,15},{1,4,5,9,11,14},{1,4,5,9,11,14,15},{1,4,5,9,11,15},{1,4,5,9,12},{1,4,5,9,12,13},{1,4,5,9,12,13,14},{1,4,5,9,12,13,14,15},{1,4,5,9,12,13,15},{1,4,5,9,12,14},{1,4,5,9,12,14,15},{1,4,5,9,12,15},{1,4,5,9,13},{1,4,5,9,13,14},{1,4,5,9,13,14,15},{1,4,5,9,13,15},{1,4,5,9,14},{1,4,5,9,14,15},{1,4,5,9,15},{1,4,5,10},{1,4,5,10,11},{1,4,5,10,11,12},{1,4,5,10,11,12,13},{1,4,5,10,11,12,13,14},{1,4,5,10,11,12,13,14,15},{1,4,5,10,11,12,13,15},{1,4,5,10,11,12,14},{1,4,5,10,11,12,14,15},{1,4,5,10,11,12,15},{1,4,5,10,11,13},{1,4,5,10,11,13,14},{1,4,5,10,11,13,14,15},{1,4,5,10,11,13,15},{1,4,5,10,11,14},{1,4,5,10,11,14,15},{1,4,5,10,11,15},{1,4,5,10,12},{1,4,5,10,12,13},{1,4,5,10,12,13,14},{1,4,5,10,12,13,14,15},{1,4,5,10,12,13,15},{1,4,5,10,12,14},{1,4,5,10,12,14,15},{1,4,5,10,12,15},{1,4,5,10,13},{1,4,5,10,13,14},{1,4,5,10,13,14,15},{1,4,5,10,13,15},{1,4,5,10,14},{1,4,5,10,14,15},{1,4,5,10,15},{1,4,5,11},{1,4,5,11,12},{1,4,5,11,12,13},{1,4,5,11,12,13,14},{1,4,5,11,12,13,14,15},{1,4,5,11,12,13,15},{1,4,5,11,12,14},{1,4,5,11,12,14,15},{1,4,5,11,12,15},{1,4,5,11,13},{1,4,5,11,13,14},{1,4,5,11,13,14,15},{1,4,5,11,13,15},{1,4,5,11,14},{1,4,5,11,14,15},{1,4,5,11,15},{1,4,5,12},{1,4,5,12,13},{1,4,5,12,13,14},{1,4,5,12,13,14,15},{1,4,5,12,13,15},{1,4,5,12,14},{1,4,5,12,14,15},{1,4,5,12,15},{1,4,5,13},{1,4,5,13,14},{1,4,5,13,14,15},{1,4,5,13,15},{1,4,5,14},{1,4,5,14,15},{1,4,5,15},{1,4,6},{1,4,6,7},{1,4,6,7,8},{1,4,6,7,8,9},{1,4,6,7,8,9,10},{1,4,6,7,8,9,10,11},{1,4,6,7,8,9,10,11,12},{1,4,6,7,8,9,10,11,12,13},{1,4,6,7,8,9,10,11,12,13,14},{1,4,6,7,8,9,10,11,12,13,14,15},{1,4,6,7,8,9,10,11,12,13,15},{1,4,6,7,8,9,10,11,12,14},{1,4,6,7,8,9,10,11,12,14,15},{1,4,6,7,8,9,10,11,12,15},{1,4,6,7,8,9,10,11,13},{1,4,6,7,8,9,10,11,13,14},{1,4,6,7,8,9,10,11,13,14,15},{1,4,6,7,8,9,10,11,13,15},{1,4,6,7,8,9,10,11,14},{1,4,6,7,8,9,10,11,14,15},{1,4,6,7,8,9,10,11,15},{1,4,6,7,8,9,10,12},{1,4,6,7,8,9,10,12,13},{1,4,6,7,8,9,10,12,13,14},{1,4,6,7,8,9,10,12,13,14,15},{1,4,6,7,8,9,10,12,13,15},{1,4,6,7,8,9,10,12,14},{1,4,6,7,8,9,10,12,14,15},{1,4,6,7,8,9,10,12,15},{1,4,6,7,8,9,10,13},{1,4,6,7,8,9,10,13,14},{1,4,6,7,8,9,10,13,14,15},{1,4,6,7,8,9,10,13,15},{1,4,6,7,8,9,10,14},{1,4,6,7,8,9,10,14,15},{1,4,6,7,8,9,10,15},{1,4,6,7,8,9,11},{1,4,6,7,8,9,11,12},{1,4,6,7,8,9,11,12,13},{1,4,6,7,8,9,11,12,13,14},{1,4,6,7,8,9,11,12,13,14,15},{1,4,6,7,8,9,11,12,13,15},{1,4,6,7,8,9,11,12,14},{1,4,6,7,8,9,11,12,14,15},{1,4,6,7,8,9,11,12,15},{1,4,6,7,8,9,11,13},{1,4,6,7,8,9,11,13,14},{1,4,6,7,8,9,11,13,14,15},{1,4,6,7,8,9,11,13,15},{1,4,6,7,8,9,11,14},{1,4,6,7,8,9,11,14,15},{1,4,6,7,8,9,11,15},{1,4,6,7,8,9,12},{1,4,6,7,8,9,12,13},{1,4,6,7,8,9,12,13,14},{1,4,6,7,8,9,12,13,14,15},{1,4,6,7,8,9,12,13,15},{1,4,6,7,8,9,12,14},{1,4,6,7,8,9,12,14,15},{1,4,6,7,8,9,12,15},{1,4,6,7,8,9,13},{1,4,6,7,8,9,13,14},{1,4,6,7,8,9,13,14,15},{1,4,6,7,8,9,13,15},{1,4,6,7,8,9,14},{1,4,6,7,8,9,14,15},{1,4,6,7,8,9,15},{1,4,6,7,8,10},{1,4,6,7,8,10,11},{1,4,6,7,8,10,11,12},{1,4,6,7,8,10,11,12,13},{1,4,6,7,8,10,11,12,13,14},{1,4,6,7,8,10,11,12,13,14,15},{1,4,6,7,8,10,11,12,13,15},{1,4,6,7,8,10,11,12,14},{1,4,6,7,8,10,11,12,14,15},{1,4,6,7,8,10,11,12,15},{1,4,6,7,8,10,11,13},{1,4,6,7,8,10,11,13,14},{1,4,6,7,8,10,11,13,14,15},{1,4,6,7,8,10,11,13,15},{1,4,6,7,8,10,11,14},{1,4,6,7,8,10,11,14,15},{1,4,6,7,8,10,11,15},{1,4,6,7,8,10,12},{1,4,6,7,8,10,12,13},{1,4,6,7,8,10,12,13,14},{1,4,6,7,8,10,12,13,14,15},{1,4,6,7,8,10,12,13,15},{1,4,6,7,8,10,12,14},{1,4,6,7,8,10,12,14,15},{1,4,6,7,8,10,12,15},{1,4,6,7,8,10,13},{1,4,6,7,8,10,13,14},{1,4,6,7,8,10,13,14,15},{1,4,6,7,8,10,13,15},{1,4,6,7,8,10,14},{1,4,6,7,8,10,14,15},{1,4,6,7,8,10,15},{1,4,6,7,8,11},{1,4,6,7,8,11,12},{1,4,6,7,8,11,12,13},{1,4,6,7,8,11,12,13,14},{1,4,6,7,8,11,12,13,14,15},{1,4,6,7,8,11,12,13,15},{1,4,6,7,8,11,12,14},{1,4,6,7,8,11,12,14,15},{1,4,6,7,8,11,12,15},{1,4,6,7,8,11,13},{1,4,6,7,8,11,13,14},{1,4,6,7,8,11,13,14,15},{1,4,6,7,8,11,13,15},{1,4,6,7,8,11,14},{1,4,6,7,8,11,14,15},{1,4,6,7,8,11,15},{1,4,6,7,8,12},{1,4,6,7,8,12,13},{1,4,6,7,8,12,13,14},{1,4,6,7,8,12,13,14,15},{1,4,6,7,8,12,13,15},{1,4,6,7,8,12,14},{1,4,6,7,8,12,14,15},{1,4,6,7,8,12,15},{1,4,6,7,8,13},{1,4,6,7,8,13,14},{1,4,6,7,8,13,14,15},{1,4,6,7,8,13,15},{1,4,6,7,8,14},{1,4,6,7,8,14,15},{1,4,6,7,8,15},{1,4,6,7,9},{1,4,6,7,9,10},{1,4,6,7,9,10,11},{1,4,6,7,9,10,11,12},{1,4,6,7,9,10,11,12,13},{1,4,6,7,9,10,11,12,13,14},{1,4,6,7,9,10,11,12,13,14,15},{1,4,6,7,9,10,11,12,13,15},{1,4,6,7,9,10,11,12,14},{1,4,6,7,9,10,11,12,14,15},{1,4,6,7,9,10,11,12,15},{1,4,6,7,9,10,11,13},{1,4,6,7,9,10,11,13,14},{1,4,6,7,9,10,11,13,14,15},{1,4,6,7,9,10,11,13,15},{1,4,6,7,9,10,11,14},{1,4,6,7,9,10,11,14,15},{1,4,6,7,9,10,11,15},{1,4,6,7,9,10,12},{1,4,6,7,9,10,12,13},{1,4,6,7,9,10,12,13,14},{1,4,6,7,9,10,12,13,14,15},{1,4,6,7,9,10,12,13,15},{1,4,6,7,9,10,12,14},{1,4,6,7,9,10,12,14,15},{1,4,6,7,9,10,12,15},{1,4,6,7,9,10,13},{1,4,6,7,9,10,13,14},{1,4,6,7,9,10,13,14,15},{1,4,6,7,9,10,13,15},{1,4,6,7,9,10,14},{1,4,6,7,9,10,14,15},{1,4,6,7,9,10,15},{1,4,6,7,9,11},{1,4,6,7,9,11,12},{1,4,6,7,9,11,12,13},{1,4,6,7,9,11,12,13,14},{1,4,6,7,9,11,12,13,14,15},{1,4,6,7,9,11,12,13,15},{1,4,6,7,9,11,12,14},{1,4,6,7,9,11,12,14,15},{1,4,6,7,9,11,12,15},{1,4,6,7,9,11,13},{1,4,6,7,9,11,13,14},{1,4,6,7,9,11,13,14,15},{1,4,6,7,9,11,13,15},{1,4,6,7,9,11,14},{1,4,6,7,9,11,14,15},{1,4,6,7,9,11,15},{1,4,6,7,9,12},{1,4,6,7,9,12,13},{1,4,6,7,9,12,13,14},{1,4,6,7,9,12,13,14,15},{1,4,6,7,9,12,13,15},{1,4,6,7,9,12,14},{1,4,6,7,9,12,14,15},{1,4,6,7,9,12,15},{1,4,6,7,9,13},{1,4,6,7,9,13,14},{1,4,6,7,9,13,14,15},{1,4,6,7,9,13,15},{1,4,6,7,9,14},{1,4,6,7,9,14,15},{1,4,6,7,9,15},{1,4,6,7,10},{1,4,6,7,10,11},{1,4,6,7,10,11,12},{1,4,6,7,10,11,12,13},{1,4,6,7,10,11,12,13,14},{1,4,6,7,10,11,12,13,14,15},{1,4,6,7,10,11,12,13,15},{1,4,6,7,10,11,12,14},{1,4,6,7,10,11,12,14,15},{1,4,6,7,10,11,12,15},{1,4,6,7,10,11,13},{1,4,6,7,10,11,13,14},{1,4,6,7,10,11,13,14,15},{1,4,6,7,10,11,13,15},{1,4,6,7,10,11,14},{1,4,6,7,10,11,14,15},{1,4,6,7,10,11,15},{1,4,6,7,10,12},{1,4,6,7,10,12,13},{1,4,6,7,10,12,13,14},{1,4,6,7,10,12,13,14,15},{1,4,6,7,10,12,13,15},{1,4,6,7,10,12,14},{1,4,6,7,10,12,14,15},{1,4,6,7,10,12,15},{1,4,6,7,10,13},{1,4,6,7,10,13,14},{1,4,6,7,10,13,14,15},{1,4,6,7,10,13,15},{1,4,6,7,10,14},{1,4,6,7,10,14,15},{1,4,6,7,10,15},{1,4,6,7,11},{1,4,6,7,11,12},{1,4,6,7,11,12,13},{1,4,6,7,11,12,13,14},{1,4,6,7,11,12,13,14,15},{1,4,6,7,11,12,13,15},{1,4,6,7,11,12,14},{1,4,6,7,11,12,14,15},{1,4,6,7,11,12,15},{1,4,6,7,11,13},{1,4,6,7,11,13,14},{1,4,6,7,11,13,14,15},{1,4,6,7,11,13,15},{1,4,6,7,11,14},{1,4,6,7,11,14,15},{1,4,6,7,11,15},{1,4,6,7,12},{1,4,6,7,12,13},{1,4,6,7,12,13,14},{1,4,6,7,12,13,14,15},{1,4,6,7,12,13,15},{1,4,6,7,12,14},{1,4,6,7,12,14,15},{1,4,6,7,12,15},{1,4,6,7,13},{1,4,6,7,13,14},{1,4,6,7,13,14,15},{1,4,6,7,13,15},{1,4,6,7,14},{1,4,6,7,14,15},{1,4,6,7,15},{1,4,6,8},{1,4,6,8,9},{1,4,6,8,9,10},{1,4,6,8,9,10,11},{1,4,6,8,9,10,11,12},{1,4,6,8,9,10,11,12,13},{1,4,6,8,9,10,11,12,13,14},{1,4,6,8,9,10,11,12,13,14,15},{1,4,6,8,9,10,11,12,13,15},{1,4,6,8,9,10,11,12,14},{1,4,6,8,9,10,11,12,14,15},{1,4,6,8,9,10,11,12,15},{1,4,6,8,9,10,11,13},{1,4,6,8,9,10,11,13,14},{1,4,6,8,9,10,11,13,14,15},{1,4,6,8,9,10,11,13,15},{1,4,6,8,9,10,11,14},{1,4,6,8,9,10,11,14,15},{1,4,6,8,9,10,11,15},{1,4,6,8,9,10,12},{1,4,6,8,9,10,12,13},{1,4,6,8,9,10,12,13,14},{1,4,6,8,9,10,12,13,14,15},{1,4,6,8,9,10,12,13,15},{1,4,6,8,9,10,12,14},{1,4,6,8,9,10,12,14,15},{1,4,6,8,9,10,12,15},{1,4,6,8,9,10,13},{1,4,6,8,9,10,13,14},{1,4,6,8,9,10,13,14,15},{1,4,6,8,9,10,13,15},{1,4,6,8,9,10,14},{1,4,6,8,9,10,14,15},{1,4,6,8,9,10,15},{1,4,6,8,9,11},{1,4,6,8,9,11,12},{1,4,6,8,9,11,12,13},{1,4,6,8,9,11,12,13,14},{1,4,6,8,9,11,12,13,14,15},{1,4,6,8,9,11,12,13,15},{1,4,6,8,9,11,12,14},{1,4,6,8,9,11,12,14,15},{1,4,6,8,9,11,12,15},{1,4,6,8,9,11,13},{1,4,6,8,9,11,13,14},{1,4,6,8,9,11,13,14,15},{1,4,6,8,9,11,13,15},{1,4,6,8,9,11,14},{1,4,6,8,9,11,14,15},{1,4,6,8,9,11,15},{1,4,6,8,9,12},{1,4,6,8,9,12,13},{1,4,6,8,9,12,13,14},{1,4,6,8,9,12,13,14,15},{1,4,6,8,9,12,13,15},{1,4,6,8,9,12,14},{1,4,6,8,9,12,14,15},{1,4,6,8,9,12,15},{1,4,6,8,9,13},{1,4,6,8,9,13,14},{1,4,6,8,9,13,14,15},{1,4,6,8,9,13,15},{1,4,6,8,9,14},{1,4,6,8,9,14,15},{1,4,6,8,9,15},{1,4,6,8,10},{1,4,6,8,10,11},{1,4,6,8,10,11,12},{1,4,6,8,10,11,12,13},{1,4,6,8,10,11,12,13,14},{1,4,6,8,10,11,12,13,14,15},{1,4,6,8,10,11,12,13,15},{1,4,6,8,10,11,12,14},{1,4,6,8,10,11,12,14,15},{1,4,6,8,10,11,12,15},{1,4,6,8,10,11,13},{1,4,6,8,10,11,13,14},{1,4,6,8,10,11,13,14,15},{1,4,6,8,10,11,13,15},{1,4,6,8,10,11,14},{1,4,6,8,10,11,14,15},{1,4,6,8,10,11,15},{1,4,6,8,10,12},{1,4,6,8,10,12,13},{1,4,6,8,10,12,13,14},{1,4,6,8,10,12,13,14,15},{1,4,6,8,10,12,13,15},{1,4,6,8,10,12,14},{1,4,6,8,10,12,14,15},{1,4,6,8,10,12,15},{1,4,6,8,10,13},{1,4,6,8,10,13,14},{1,4,6,8,10,13,14,15},{1,4,6,8,10,13,15},{1,4,6,8,10,14},{1,4,6,8,10,14,15},{1,4,6,8,10,15},{1,4,6,8,11},{1,4,6,8,11,12},{1,4,6,8,11,12,13},{1,4,6,8,11,12,13,14},{1,4,6,8,11,12,13,14,15},{1,4,6,8,11,12,13,15},{1,4,6,8,11,12,14},{1,4,6,8,11,12,14,15},{1,4,6,8,11,12,15},{1,4,6,8,11,13},{1,4,6,8,11,13,14},{1,4,6,8,11,13,14,15},{1,4,6,8,11,13,15},{1,4,6,8,11,14},{1,4,6,8,11,14,15},{1,4,6,8,11,15},{1,4,6,8,12},{1,4,6,8,12,13},{1,4,6,8,12,13,14},{1,4,6,8,12,13,14,15},{1,4,6,8,12,13,15},{1,4,6,8,12,14},{1,4,6,8,12,14,15},{1,4,6,8,12,15},{1,4,6,8,13},{1,4,6,8,13,14},{1,4,6,8,13,14,15},{1,4,6,8,13,15},{1,4,6,8,14},{1,4,6,8,14,15},{1,4,6,8,15},{1,4,6,9},{1,4,6,9,10},{1,4,6,9,10,11},{1,4,6,9,10,11,12},{1,4,6,9,10,11,12,13},{1,4,6,9,10,11,12,13,14},{1,4,6,9,10,11,12,13,14,15},{1,4,6,9,10,11,12,13,15},{1,4,6,9,10,11,12,14},{1,4,6,9,10,11,12,14,15},{1,4,6,9,10,11,12,15},{1,4,6,9,10,11,13},{1,4,6,9,10,11,13,14},{1,4,6,9,10,11,13,14,15},{1,4,6,9,10,11,13,15},{1,4,6,9,10,11,14},{1,4,6,9,10,11,14,15},{1,4,6,9,10,11,15},{1,4,6,9,10,12},{1,4,6,9,10,12,13},{1,4,6,9,10,12,13,14},{1,4,6,9,10,12,13,14,15},{1,4,6,9,10,12,13,15},{1,4,6,9,10,12,14},{1,4,6,9,10,12,14,15},{1,4,6,9,10,12,15},{1,4,6,9,10,13},{1,4,6,9,10,13,14},{1,4,6,9,10,13,14,15},{1,4,6,9,10,13,15},{1,4,6,9,10,14},{1,4,6,9,10,14,15},{1,4,6,9,10,15},{1,4,6,9,11},{1,4,6,9,11,12},{1,4,6,9,11,12,13},{1,4,6,9,11,12,13,14},{1,4,6,9,11,12,13,14,15},{1,4,6,9,11,12,13,15},{1,4,6,9,11,12,14},{1,4,6,9,11,12,14,15},{1,4,6,9,11,12,15},{1,4,6,9,11,13},{1,4,6,9,11,13,14},{1,4,6,9,11,13,14,15},{1,4,6,9,11,13,15},{1,4,6,9,11,14},{1,4,6,9,11,14,15},{1,4,6,9,11,15},{1,4,6,9,12},{1,4,6,9,12,13},{1,4,6,9,12,13,14},{1,4,6,9,12,13,14,15},{1,4,6,9,12,13,15},{1,4,6,9,12,14},{1,4,6,9,12,14,15},{1,4,6,9,12,15},{1,4,6,9,13},{1,4,6,9,13,14},{1,4,6,9,13,14,15},{1,4,6,9,13,15},{1,4,6,9,14},{1,4,6,9,14,15},{1,4,6,9,15},{1,4,6,10},{1,4,6,10,11},{1,4,6,10,11,12},{1,4,6,10,11,12,13},{1,4,6,10,11,12,13,14},{1,4,6,10,11,12,13,14,15},{1,4,6,10,11,12,13,15},{1,4,6,10,11,12,14},{1,4,6,10,11,12,14,15},{1,4,6,10,11,12,15},{1,4,6,10,11,13},{1,4,6,10,11,13,14},{1,4,6,10,11,13,14,15},{1,4,6,10,11,13,15},{1,4,6,10,11,14},{1,4,6,10,11,14,15},{1,4,6,10,11,15},{1,4,6,10,12},{1,4,6,10,12,13},{1,4,6,10,12,13,14},{1,4,6,10,12,13,14,15},{1,4,6,10,12,13,15},{1,4,6,10,12,14},{1,4,6,10,12,14,15},{1,4,6,10,12,15},{1,4,6,10,13},{1,4,6,10,13,14},{1,4,6,10,13,14,15},{1,4,6,10,13,15},{1,4,6,10,14},{1,4,6,10,14,15},{1,4,6,10,15},{1,4,6,11},{1,4,6,11,12},{1,4,6,11,12,13},{1,4,6,11,12,13,14},{1,4,6,11,12,13,14,15},{1,4,6,11,12,13,15},{1,4,6,11,12,14},{1,4,6,11,12,14,15},{1,4,6,11,12,15},{1,4,6,11,13},{1,4,6,11,13,14},{1,4,6,11,13,14,15},{1,4,6,11,13,15},{1,4,6,11,14},{1,4,6,11,14,15},{1,4,6,11,15},{1,4,6,12},{1,4,6,12,13},{1,4,6,12,13,14},{1,4,6,12,13,14,15},{1,4,6,12,13,15},{1,4,6,12,14},{1,4,6,12,14,15},{1,4,6,12,15},{1,4,6,13},{1,4,6,13,14},{1,4,6,13,14,15},{1,4,6,13,15},{1,4,6,14},{1,4,6,14,15},{1,4,6,15},{1,4,7},{1,4,7,8},{1,4,7,8,9},{1,4,7,8,9,10},{1,4,7,8,9,10,11},{1,4,7,8,9,10,11,12},{1,4,7,8,9,10,11,12,13},{1,4,7,8,9,10,11,12,13,14},{1,4,7,8,9,10,11,12,13,14,15},{1,4,7,8,9,10,11,12,13,15},{1,4,7,8,9,10,11,12,14},{1,4,7,8,9,10,11,12,14,15},{1,4,7,8,9,10,11,12,15},{1,4,7,8,9,10,11,13},{1,4,7,8,9,10,11,13,14},{1,4,7,8,9,10,11,13,14,15},{1,4,7,8,9,10,11,13,15},{1,4,7,8,9,10,11,14},{1,4,7,8,9,10,11,14,15},{1,4,7,8,9,10,11,15},{1,4,7,8,9,10,12},{1,4,7,8,9,10,12,13},{1,4,7,8,9,10,12,13,14},{1,4,7,8,9,10,12,13,14,15},{1,4,7,8,9,10,12,13,15},{1,4,7,8,9,10,12,14},{1,4,7,8,9,10,12,14,15},{1,4,7,8,9,10,12,15},{1,4,7,8,9,10,13},{1,4,7,8,9,10,13,14},{1,4,7,8,9,10,13,14,15},{1,4,7,8,9,10,13,15},{1,4,7,8,9,10,14},{1,4,7,8,9,10,14,15},{1,4,7,8,9,10,15},{1,4,7,8,9,11},{1,4,7,8,9,11,12},{1,4,7,8,9,11,12,13},{1,4,7,8,9,11,12,13,14},{1,4,7,8,9,11,12,13,14,15},{1,4,7,8,9,11,12,13,15},{1,4,7,8,9,11,12,14},{1,4,7,8,9,11,12,14,15},{1,4,7,8,9,11,12,15},{1,4,7,8,9,11,13},{1,4,7,8,9,11,13,14},{1,4,7,8,9,11,13,14,15},{1,4,7,8,9,11,13,15},{1,4,7,8,9,11,14},{1,4,7,8,9,11,14,15},{1,4,7,8,9,11,15},{1,4,7,8,9,12},{1,4,7,8,9,12,13},{1,4,7,8,9,12,13,14},{1,4,7,8,9,12,13,14,15},{1,4,7,8,9,12,13,15},{1,4,7,8,9,12,14},{1,4,7,8,9,12,14,15},{1,4,7,8,9,12,15},{1,4,7,8,9,13},{1,4,7,8,9,13,14},{1,4,7,8,9,13,14,15},{1,4,7,8,9,13,15},{1,4,7,8,9,14},{1,4,7,8,9,14,15},{1,4,7,8,9,15},{1,4,7,8,10},{1,4,7,8,10,11},{1,4,7,8,10,11,12},{1,4,7,8,10,11,12,13},{1,4,7,8,10,11,12,13,14},{1,4,7,8,10,11,12,13,14,15},{1,4,7,8,10,11,12,13,15},{1,4,7,8,10,11,12,14},{1,4,7,8,10,11,12,14,15},{1,4,7,8,10,11,12,15},{1,4,7,8,10,11,13},{1,4,7,8,10,11,13,14},{1,4,7,8,10,11,13,14,15},{1,4,7,8,10,11,13,15},{1,4,7,8,10,11,14},{1,4,7,8,10,11,14,15},{1,4,7,8,10,11,15},{1,4,7,8,10,12},{1,4,7,8,10,12,13},{1,4,7,8,10,12,13,14},{1,4,7,8,10,12,13,14,15},{1,4,7,8,10,12,13,15},{1,4,7,8,10,12,14},{1,4,7,8,10,12,14,15},{1,4,7,8,10,12,15},{1,4,7,8,10,13},{1,4,7,8,10,13,14},{1,4,7,8,10,13,14,15},{1,4,7,8,10,13,15},{1,4,7,8,10,14},{1,4,7,8,10,14,15},{1,4,7,8,10,15},{1,4,7,8,11},{1,4,7,8,11,12},{1,4,7,8,11,12,13},{1,4,7,8,11,12,13,14},{1,4,7,8,11,12,13,14,15},{1,4,7,8,11,12,13,15},{1,4,7,8,11,12,14},{1,4,7,8,11,12,14,15},{1,4,7,8,11,12,15},{1,4,7,8,11,13},{1,4,7,8,11,13,14},{1,4,7,8,11,13,14,15},{1,4,7,8,11,13,15},{1,4,7,8,11,14},{1,4,7,8,11,14,15},{1,4,7,8,11,15},{1,4,7,8,12},{1,4,7,8,12,13},{1,4,7,8,12,13,14},{1,4,7,8,12,13,14,15},{1,4,7,8,12,13,15},{1,4,7,8,12,14},{1,4,7,8,12,14,15},{1,4,7,8,12,15},{1,4,7,8,13},{1,4,7,8,13,14},{1,4,7,8,13,14,15},{1,4,7,8,13,15},{1,4,7,8,14},{1,4,7,8,14,15},{1,4,7,8,15},{1,4,7,9},{1,4,7,9,10},{1,4,7,9,10,11},{1,4,7,9,10,11,12},{1,4,7,9,10,11,12,13},{1,4,7,9,10,11,12,13,14},{1,4,7,9,10,11,12,13,14,15},{1,4,7,9,10,11,12,13,15},{1,4,7,9,10,11,12,14},{1,4,7,9,10,11,12,14,15},{1,4,7,9,10,11,12,15},{1,4,7,9,10,11,13},{1,4,7,9,10,11,13,14},{1,4,7,9,10,11,13,14,15},{1,4,7,9,10,11,13,15},{1,4,7,9,10,11,14},{1,4,7,9,10,11,14,15},{1,4,7,9,10,11,15},{1,4,7,9,10,12},{1,4,7,9,10,12,13},{1,4,7,9,10,12,13,14},{1,4,7,9,10,12,13,14,15},{1,4,7,9,10,12,13,15},{1,4,7,9,10,12,14},{1,4,7,9,10,12,14,15},{1,4,7,9,10,12,15},{1,4,7,9,10,13},{1,4,7,9,10,13,14},{1,4,7,9,10,13,14,15},{1,4,7,9,10,13,15},{1,4,7,9,10,14},{1,4,7,9,10,14,15},{1,4,7,9,10,15},{1,4,7,9,11},{1,4,7,9,11,12},{1,4,7,9,11,12,13},{1,4,7,9,11,12,13,14},{1,4,7,9,11,12,13,14,15},{1,4,7,9,11,12,13,15},{1,4,7,9,11,12,14},{1,4,7,9,11,12,14,15},{1,4,7,9,11,12,15},{1,4,7,9,11,13},{1,4,7,9,11,13,14},{1,4,7,9,11,13,14,15},{1,4,7,9,11,13,15},{1,4,7,9,11,14},{1,4,7,9,11,14,15},{1,4,7,9,11,15},{1,4,7,9,12},{1,4,7,9,12,13},{1,4,7,9,12,13,14},{1,4,7,9,12,13,14,15},{1,4,7,9,12,13,15},{1,4,7,9,12,14},{1,4,7,9,12,14,15},{1,4,7,9,12,15},{1,4,7,9,13},{1,4,7,9,13,14},{1,4,7,9,13,14,15},{1,4,7,9,13,15},{1,4,7,9,14},{1,4,7,9,14,15},{1,4,7,9,15},{1,4,7,10},{1,4,7,10,11},{1,4,7,10,11,12},{1,4,7,10,11,12,13},{1,4,7,10,11,12,13,14},{1,4,7,10,11,12,13,14,15},{1,4,7,10,11,12,13,15},{1,4,7,10,11,12,14},{1,4,7,10,11,12,14,15},{1,4,7,10,11,12,15},{1,4,7,10,11,13},{1,4,7,10,11,13,14},{1,4,7,10,11,13,14,15},{1,4,7,10,11,13,15},{1,4,7,10,11,14},{1,4,7,10,11,14,15},{1,4,7,10,11,15},{1,4,7,10,12},{1,4,7,10,12,13},{1,4,7,10,12,13,14},{1,4,7,10,12,13,14,15},{1,4,7,10,12,13,15},{1,4,7,10,12,14},{1,4,7,10,12,14,15},{1,4,7,10,12,15},{1,4,7,10,13},{1,4,7,10,13,14},{1,4,7,10,13,14,15},{1,4,7,10,13,15},{1,4,7,10,14},{1,4,7,10,14,15},{1,4,7,10,15},{1,4,7,11},{1,4,7,11,12},{1,4,7,11,12,13},{1,4,7,11,12,13,14},{1,4,7,11,12,13,14,15},{1,4,7,11,12,13,15},{1,4,7,11,12,14},{1,4,7,11,12,14,15},{1,4,7,11,12,15},{1,4,7,11,13},{1,4,7,11,13,14},{1,4,7,11,13,14,15},{1,4,7,11,13,15},{1,4,7,11,14},{1,4,7,11,14,15},{1,4,7,11,15},{1,4,7,12},{1,4,7,12,13},{1,4,7,12,13,14},{1,4,7,12,13,14,15},{1,4,7,12,13,15},{1,4,7,12,14},{1,4,7,12,14,15},{1,4,7,12,15},{1,4,7,13},{1,4,7,13,14},{1,4,7,13,14,15},{1,4,7,13,15},{1,4,7,14},{1,4,7,14,15},{1,4,7,15},{1,4,8},{1,4,8,9},{1,4,8,9,10},{1,4,8,9,10,11},{1,4,8,9,10,11,12},{1,4,8,9,10,11,12,13},{1,4,8,9,10,11,12,13,14},{1,4,8,9,10,11,12,13,14,15},{1,4,8,9,10,11,12,13,15},{1,4,8,9,10,11,12,14},{1,4,8,9,10,11,12,14,15},{1,4,8,9,10,11,12,15},{1,4,8,9,10,11,13},{1,4,8,9,10,11,13,14},{1,4,8,9,10,11,13,14,15},{1,4,8,9,10,11,13,15},{1,4,8,9,10,11,14},{1,4,8,9,10,11,14,15},{1,4,8,9,10,11,15},{1,4,8,9,10,12},{1,4,8,9,10,12,13},{1,4,8,9,10,12,13,14},{1,4,8,9,10,12,13,14,15},{1,4,8,9,10,12,13,15},{1,4,8,9,10,12,14},{1,4,8,9,10,12,14,15},{1,4,8,9,10,12,15},{1,4,8,9,10,13},{1,4,8,9,10,13,14},{1,4,8,9,10,13,14,15},{1,4,8,9,10,13,15},{1,4,8,9,10,14},{1,4,8,9,10,14,15},{1,4,8,9,10,15},{1,4,8,9,11},{1,4,8,9,11,12},{1,4,8,9,11,12,13},{1,4,8,9,11,12,13,14},{1,4,8,9,11,12,13,14,15},{1,4,8,9,11,12,13,15},{1,4,8,9,11,12,14},{1,4,8,9,11,12,14,15},{1,4,8,9,11,12,15},{1,4,8,9,11,13},{1,4,8,9,11,13,14},{1,4,8,9,11,13,14,15},{1,4,8,9,11,13,15},{1,4,8,9,11,14},{1,4,8,9,11,14,15},{1,4,8,9,11,15},{1,4,8,9,12},{1,4,8,9,12,13},{1,4,8,9,12,13,14},{1,4,8,9,12,13,14,15},{1,4,8,9,12,13,15},{1,4,8,9,12,14},{1,4,8,9,12,14,15},{1,4,8,9,12,15},{1,4,8,9,13},{1,4,8,9,13,14},{1,4,8,9,13,14,15},{1,4,8,9,13,15},{1,4,8,9,14},{1,4,8,9,14,15},{1,4,8,9,15},{1,4,8,10},{1,4,8,10,11},{1,4,8,10,11,12},{1,4,8,10,11,12,13},{1,4,8,10,11,12,13,14},{1,4,8,10,11,12,13,14,15},{1,4,8,10,11,12,13,15},{1,4,8,10,11,12,14},{1,4,8,10,11,12,14,15},{1,4,8,10,11,12,15},{1,4,8,10,11,13},{1,4,8,10,11,13,14},{1,4,8,10,11,13,14,15},{1,4,8,10,11,13,15},{1,4,8,10,11,14},{1,4,8,10,11,14,15},{1,4,8,10,11,15},{1,4,8,10,12},{1,4,8,10,12,13},{1,4,8,10,12,13,14},{1,4,8,10,12,13,14,15},{1,4,8,10,12,13,15},{1,4,8,10,12,14},{1,4,8,10,12,14,15},{1,4,8,10,12,15},{1,4,8,10,13},{1,4,8,10,13,14},{1,4,8,10,13,14,15},{1,4,8,10,13,15},{1,4,8,10,14},{1,4,8,10,14,15},{1,4,8,10,15},{1,4,8,11},{1,4,8,11,12},{1,4,8,11,12,13},{1,4,8,11,12,13,14},{1,4,8,11,12,13,14,15},{1,4,8,11,12,13,15},{1,4,8,11,12,14},{1,4,8,11,12,14,15},{1,4,8,11,12,15},{1,4,8,11,13},{1,4,8,11,13,14},{1,4,8,11,13,14,15},{1,4,8,11,13,15},{1,4,8,11,14},{1,4,8,11,14,15},{1,4,8,11,15},{1,4,8,12},{1,4,8,12,13},{1,4,8,12,13,14},{1,4,8,12,13,14,15},{1,4,8,12,13,15},{1,4,8,12,14},{1,4,8,12,14,15},{1,4,8,12,15},{1,4,8,13},{1,4,8,13,14},{1,4,8,13,14,15},{1,4,8,13,15},{1,4,8,14},{1,4,8,14,15},{1,4,8,15},{1,4,9},{1,4,9,10},{1,4,9,10,11},{1,4,9,10,11,12},{1,4,9,10,11,12,13},{1,4,9,10,11,12,13,14},{1,4,9,10,11,12,13,14,15},{1,4,9,10,11,12,13,15},{1,4,9,10,11,12,14},{1,4,9,10,11,12,14,15},{1,4,9,10,11,12,15},{1,4,9,10,11,13},{1,4,9,10,11,13,14},{1,4,9,10,11,13,14,15},{1,4,9,10,11,13,15},{1,4,9,10,11,14},{1,4,9,10,11,14,15},{1,4,9,10,11,15},{1,4,9,10,12},{1,4,9,10,12,13},{1,4,9,10,12,13,14},{1,4,9,10,12,13,14,15},{1,4,9,10,12,13,15},{1,4,9,10,12,14},{1,4,9,10,12,14,15},{1,4,9,10,12,15},{1,4,9,10,13},{1,4,9,10,13,14},{1,4,9,10,13,14,15},{1,4,9,10,13,15},{1,4,9,10,14},{1,4,9,10,14,15},{1,4,9,10,15},{1,4,9,11},{1,4,9,11,12},{1,4,9,11,12,13},{1,4,9,11,12,13,14},{1,4,9,11,12,13,14,15},{1,4,9,11,12,13,15},{1,4,9,11,12,14},{1,4,9,11,12,14,15},{1,4,9,11,12,15},{1,4,9,11,13},{1,4,9,11,13,14},{1,4,9,11,13,14,15},{1,4,9,11,13,15},{1,4,9,11,14},{1,4,9,11,14,15},{1,4,9,11,15},{1,4,9,12},{1,4,9,12,13},{1,4,9,12,13,14},{1,4,9,12,13,14,15},{1,4,9,12,13,15},{1,4,9,12,14},{1,4,9,12,14,15},{1,4,9,12,15},{1,4,9,13},{1,4,9,13,14},{1,4,9,13,14,15},{1,4,9,13,15},{1,4,9,14},{1,4,9,14,15},{1,4,9,15},{1,4,10},{1,4,10,11},{1,4,10,11,12},{1,4,10,11,12,13},{1,4,10,11,12,13,14},{1,4,10,11,12,13,14,15},{1,4,10,11,12,13,15},{1,4,10,11,12,14},{1,4,10,11,12,14,15},{1,4,10,11,12,15},{1,4,10,11,13},{1,4,10,11,13,14},{1,4,10,11,13,14,15},{1,4,10,11,13,15},{1,4,10,11,14},{1,4,10,11,14,15},{1,4,10,11,15},{1,4,10,12},{1,4,10,12,13},{1,4,10,12,13,14},{1,4,10,12,13,14,15},{1,4,10,12,13,15},{1,4,10,12,14},{1,4,10,12,14,15},{1,4,10,12,15},{1,4,10,13},{1,4,10,13,14},{1,4,10,13,14,15},{1,4,10,13,15},{1,4,10,14},{1,4,10,14,15},{1,4,10,15},{1,4,11},{1,4,11,12},{1,4,11,12,13},{1,4,11,12,13,14},{1,4,11,12,13,14,15},{1,4,11,12,13,15},{1,4,11,12,14},{1,4,11,12,14,15},{1,4,11,12,15},{1,4,11,13},{1,4,11,13,14},{1,4,11,13,14,15},{1,4,11,13,15},{1,4,11,14},{1,4,11,14,15},{1,4,11,15},{1,4,12},{1,4,12,13},{1,4,12,13,14},{1,4,12,13,14,15},{1,4,12,13,15},{1,4,12,14},{1,4,12,14,15},{1,4,12,15},{1,4,13},{1,4,13,14},{1,4,13,14,15},{1,4,13,15},{1,4,14},{1,4,14,15},{1,4,15},{1,5},{1,5,6},{1,5,6,7},{1,5,6,7,8},{1,5,6,7,8,9},{1,5,6,7,8,9,10},{1,5,6,7,8,9,10,11},{1,5,6,7,8,9,10,11,12},{1,5,6,7,8,9,10,11,12,13},{1,5,6,7,8,9,10,11,12,13,14},{1,5,6,7,8,9,10,11,12,13,14,15},{1,5,6,7,8,9,10,11,12,13,15},{1,5,6,7,8,9,10,11,12,14},{1,5,6,7,8,9,10,11,12,14,15},{1,5,6,7,8,9,10,11,12,15},{1,5,6,7,8,9,10,11,13},{1,5,6,7,8,9,10,11,13,14},{1,5,6,7,8,9,10,11,13,14,15},{1,5,6,7,8,9,10,11,13,15},{1,5,6,7,8,9,10,11,14},{1,5,6,7,8,9,10,11,14,15},{1,5,6,7,8,9,10,11,15},{1,5,6,7,8,9,10,12},{1,5,6,7,8,9,10,12,13},{1,5,6,7,8,9,10,12,13,14},{1,5,6,7,8,9,10,12,13,14,15},{1,5,6,7,8,9,10,12,13,15},{1,5,6,7,8,9,10,12,14},{1,5,6,7,8,9,10,12,14,15},{1,5,6,7,8,9,10,12,15},{1,5,6,7,8,9,10,13},{1,5,6,7,8,9,10,13,14},{1,5,6,7,8,9,10,13,14,15},{1,5,6,7,8,9,10,13,15},{1,5,6,7,8,9,10,14},{1,5,6,7,8,9,10,14,15},{1,5,6,7,8,9,10,15},{1,5,6,7,8,9,11},{1,5,6,7,8,9,11,12},{1,5,6,7,8,9,11,12,13},{1,5,6,7,8,9,11,12,13,14},{1,5,6,7,8,9,11,12,13,14,15},{1,5,6,7,8,9,11,12,13,15},{1,5,6,7,8,9,11,12,14},{1,5,6,7,8,9,11,12,14,15},{1,5,6,7,8,9,11,12,15},{1,5,6,7,8,9,11,13},{1,5,6,7,8,9,11,13,14},{1,5,6,7,8,9,11,13,14,15},{1,5,6,7,8,9,11,13,15},{1,5,6,7,8,9,11,14},{1,5,6,7,8,9,11,14,15},{1,5,6,7,8,9,11,15},{1,5,6,7,8,9,12},{1,5,6,7,8,9,12,13},{1,5,6,7,8,9,12,13,14},{1,5,6,7,8,9,12,13,14,15},{1,5,6,7,8,9,12,13,15},{1,5,6,7,8,9,12,14},{1,5,6,7,8,9,12,14,15},{1,5,6,7,8,9,12,15},{1,5,6,7,8,9,13},{1,5,6,7,8,9,13,14},{1,5,6,7,8,9,13,14,15},{1,5,6,7,8,9,13,15},{1,5,6,7,8,9,14},{1,5,6,7,8,9,14,15},{1,5,6,7,8,9,15},{1,5,6,7,8,10},{1,5,6,7,8,10,11},{1,5,6,7,8,10,11,12},{1,5,6,7,8,10,11,12,13},{1,5,6,7,8,10,11,12,13,14},{1,5,6,7,8,10,11,12,13,14,15},{1,5,6,7,8,10,11,12,13,15},{1,5,6,7,8,10,11,12,14},{1,5,6,7,8,10,11,12,14,15},{1,5,6,7,8,10,11,12,15},{1,5,6,7,8,10,11,13},{1,5,6,7,8,10,11,13,14},{1,5,6,7,8,10,11,13,14,15},{1,5,6,7,8,10,11,13,15},{1,5,6,7,8,10,11,14},{1,5,6,7,8,10,11,14,15},{1,5,6,7,8,10,11,15},{1,5,6,7,8,10,12},{1,5,6,7,8,10,12,13},{1,5,6,7,8,10,12,13,14},{1,5,6,7,8,10,12,13,14,15},{1,5,6,7,8,10,12,13,15},{1,5,6,7,8,10,12,14},{1,5,6,7,8,10,12,14,15},{1,5,6,7,8,10,12,15},{1,5,6,7,8,10,13},{1,5,6,7,8,10,13,14},{1,5,6,7,8,10,13,14,15},{1,5,6,7,8,10,13,15},{1,5,6,7,8,10,14},{1,5,6,7,8,10,14,15},{1,5,6,7,8,10,15},{1,5,6,7,8,11},{1,5,6,7,8,11,12},{1,5,6,7,8,11,12,13},{1,5,6,7,8,11,12,13,14},{1,5,6,7,8,11,12,13,14,15},{1,5,6,7,8,11,12,13,15},{1,5,6,7,8,11,12,14},{1,5,6,7,8,11,12,14,15},{1,5,6,7,8,11,12,15},{1,5,6,7,8,11,13},{1,5,6,7,8,11,13,14},{1,5,6,7,8,11,13,14,15},{1,5,6,7,8,11,13,15},{1,5,6,7,8,11,14},{1,5,6,7,8,11,14,15},{1,5,6,7,8,11,15},{1,5,6,7,8,12},{1,5,6,7,8,12,13},{1,5,6,7,8,12,13,14},{1,5,6,7,8,12,13,14,15},{1,5,6,7,8,12,13,15},{1,5,6,7,8,12,14},{1,5,6,7,8,12,14,15},{1,5,6,7,8,12,15},{1,5,6,7,8,13},{1,5,6,7,8,13,14},{1,5,6,7,8,13,14,15},{1,5,6,7,8,13,15},{1,5,6,7,8,14},{1,5,6,7,8,14,15},{1,5,6,7,8,15},{1,5,6,7,9},{1,5,6,7,9,10},{1,5,6,7,9,10,11},{1,5,6,7,9,10,11,12},{1,5,6,7,9,10,11,12,13},{1,5,6,7,9,10,11,12,13,14},{1,5,6,7,9,10,11,12,13,14,15},{1,5,6,7,9,10,11,12,13,15},{1,5,6,7,9,10,11,12,14},{1,5,6,7,9,10,11,12,14,15},{1,5,6,7,9,10,11,12,15},{1,5,6,7,9,10,11,13},{1,5,6,7,9,10,11,13,14},{1,5,6,7,9,10,11,13,14,15},{1,5,6,7,9,10,11,13,15},{1,5,6,7,9,10,11,14},{1,5,6,7,9,10,11,14,15},{1,5,6,7,9,10,11,15},{1,5,6,7,9,10,12},{1,5,6,7,9,10,12,13},{1,5,6,7,9,10,12,13,14},{1,5,6,7,9,10,12,13,14,15},{1,5,6,7,9,10,12,13,15},{1,5,6,7,9,10,12,14},{1,5,6,7,9,10,12,14,15},{1,5,6,7,9,10,12,15},{1,5,6,7,9,10,13},{1,5,6,7,9,10,13,14},{1,5,6,7,9,10,13,14,15},{1,5,6,7,9,10,13,15},{1,5,6,7,9,10,14},{1,5,6,7,9,10,14,15},{1,5,6,7,9,10,15},{1,5,6,7,9,11},{1,5,6,7,9,11,12},{1,5,6,7,9,11,12,13},{1,5,6,7,9,11,12,13,14},{1,5,6,7,9,11,12,13,14,15},{1,5,6,7,9,11,12,13,15},{1,5,6,7,9,11,12,14},{1,5,6,7,9,11,12,14,15},{1,5,6,7,9,11,12,15},{1,5,6,7,9,11,13},{1,5,6,7,9,11,13,14},{1,5,6,7,9,11,13,14,15},{1,5,6,7,9,11,13,15},{1,5,6,7,9,11,14},{1,5,6,7,9,11,14,15},{1,5,6,7,9,11,15},{1,5,6,7,9,12},{1,5,6,7,9,12,13},{1,5,6,7,9,12,13,14},{1,5,6,7,9,12,13,14,15},{1,5,6,7,9,12,13,15},{1,5,6,7,9,12,14},{1,5,6,7,9,12,14,15},{1,5,6,7,9,12,15},{1,5,6,7,9,13},{1,5,6,7,9,13,14},{1,5,6,7,9,13,14,15},{1,5,6,7,9,13,15},{1,5,6,7,9,14},{1,5,6,7,9,14,15},{1,5,6,7,9,15},{1,5,6,7,10},{1,5,6,7,10,11},{1,5,6,7,10,11,12},{1,5,6,7,10,11,12,13},{1,5,6,7,10,11,12,13,14},{1,5,6,7,10,11,12,13,14,15},{1,5,6,7,10,11,12,13,15},{1,5,6,7,10,11,12,14},{1,5,6,7,10,11,12,14,15},{1,5,6,7,10,11,12,15},{1,5,6,7,10,11,13},{1,5,6,7,10,11,13,14},{1,5,6,7,10,11,13,14,15},{1,5,6,7,10,11,13,15},{1,5,6,7,10,11,14},{1,5,6,7,10,11,14,15},{1,5,6,7,10,11,15},{1,5,6,7,10,12},{1,5,6,7,10,12,13},{1,5,6,7,10,12,13,14},{1,5,6,7,10,12,13,14,15},{1,5,6,7,10,12,13,15},{1,5,6,7,10,12,14},{1,5,6,7,10,12,14,15},{1,5,6,7,10,12,15},{1,5,6,7,10,13},{1,5,6,7,10,13,14},{1,5,6,7,10,13,14,15},{1,5,6,7,10,13,15},{1,5,6,7,10,14},{1,5,6,7,10,14,15},{1,5,6,7,10,15},{1,5,6,7,11},{1,5,6,7,11,12},{1,5,6,7,11,12,13},{1,5,6,7,11,12,13,14},{1,5,6,7,11,12,13,14,15},{1,5,6,7,11,12,13,15},{1,5,6,7,11,12,14},{1,5,6,7,11,12,14,15},{1,5,6,7,11,12,15},{1,5,6,7,11,13},{1,5,6,7,11,13,14},{1,5,6,7,11,13,14,15},{1,5,6,7,11,13,15},{1,5,6,7,11,14},{1,5,6,7,11,14,15},{1,5,6,7,11,15},{1,5,6,7,12},{1,5,6,7,12,13},{1,5,6,7,12,13,14},{1,5,6,7,12,13,14,15},{1,5,6,7,12,13,15},{1,5,6,7,12,14},{1,5,6,7,12,14,15},{1,5,6,7,12,15},{1,5,6,7,13},{1,5,6,7,13,14},{1,5,6,7,13,14,15},{1,5,6,7,13,15},{1,5,6,7,14},{1,5,6,7,14,15},{1,5,6,7,15},{1,5,6,8},{1,5,6,8,9},{1,5,6,8,9,10},{1,5,6,8,9,10,11},{1,5,6,8,9,10,11,12},{1,5,6,8,9,10,11,12,13},{1,5,6,8,9,10,11,12,13,14},{1,5,6,8,9,10,11,12,13,14,15},{1,5,6,8,9,10,11,12,13,15},{1,5,6,8,9,10,11,12,14},{1,5,6,8,9,10,11,12,14,15},{1,5,6,8,9,10,11,12,15},{1,5,6,8,9,10,11,13},{1,5,6,8,9,10,11,13,14},{1,5,6,8,9,10,11,13,14,15},{1,5,6,8,9,10,11,13,15},{1,5,6,8,9,10,11,14},{1,5,6,8,9,10,11,14,15},{1,5,6,8,9,10,11,15},{1,5,6,8,9,10,12},{1,5,6,8,9,10,12,13},{1,5,6,8,9,10,12,13,14},{1,5,6,8,9,10,12,13,14,15},{1,5,6,8,9,10,12,13,15},{1,5,6,8,9,10,12,14},{1,5,6,8,9,10,12,14,15},{1,5,6,8,9,10,12,15},{1,5,6,8,9,10,13},{1,5,6,8,9,10,13,14},{1,5,6,8,9,10,13,14,15},{1,5,6,8,9,10,13,15},{1,5,6,8,9,10,14},{1,5,6,8,9,10,14,15},{1,5,6,8,9,10,15},{1,5,6,8,9,11},{1,5,6,8,9,11,12},{1,5,6,8,9,11,12,13},{1,5,6,8,9,11,12,13,14},{1,5,6,8,9,11,12,13,14,15},{1,5,6,8,9,11,12,13,15},{1,5,6,8,9,11,12,14},{1,5,6,8,9,11,12,14,15},{1,5,6,8,9,11,12,15},{1,5,6,8,9,11,13},{1,5,6,8,9,11,13,14},{1,5,6,8,9,11,13,14,15},{1,5,6,8,9,11,13,15},{1,5,6,8,9,11,14},{1,5,6,8,9,11,14,15},{1,5,6,8,9,11,15},{1,5,6,8,9,12},{1,5,6,8,9,12,13},{1,5,6,8,9,12,13,14},{1,5,6,8,9,12,13,14,15},{1,5,6,8,9,12,13,15},{1,5,6,8,9,12,14},{1,5,6,8,9,12,14,15},{1,5,6,8,9,12,15},{1,5,6,8,9,13},{1,5,6,8,9,13,14},{1,5,6,8,9,13,14,15},{1,5,6,8,9,13,15},{1,5,6,8,9,14},{1,5,6,8,9,14,15},{1,5,6,8,9,15},{1,5,6,8,10},{1,5,6,8,10,11},{1,5,6,8,10,11,12},{1,5,6,8,10,11,12,13},{1,5,6,8,10,11,12,13,14},{1,5,6,8,10,11,12,13,14,15},{1,5,6,8,10,11,12,13,15},{1,5,6,8,10,11,12,14},{1,5,6,8,10,11,12,14,15},{1,5,6,8,10,11,12,15},{1,5,6,8,10,11,13},{1,5,6,8,10,11,13,14},{1,5,6,8,10,11,13,14,15},{1,5,6,8,10,11,13,15},{1,5,6,8,10,11,14},{1,5,6,8,10,11,14,15},{1,5,6,8,10,11,15},{1,5,6,8,10,12},{1,5,6,8,10,12,13},{1,5,6,8,10,12,13,14},{1,5,6,8,10,12,13,14,15},{1,5,6,8,10,12,13,15},{1,5,6,8,10,12,14},{1,5,6,8,10,12,14,15},{1,5,6,8,10,12,15},{1,5,6,8,10,13},{1,5,6,8,10,13,14},{1,5,6,8,10,13,14,15},{1,5,6,8,10,13,15},{1,5,6,8,10,14},{1,5,6,8,10,14,15},{1,5,6,8,10,15},{1,5,6,8,11},{1,5,6,8,11,12},{1,5,6,8,11,12,13},{1,5,6,8,11,12,13,14},{1,5,6,8,11,12,13,14,15},{1,5,6,8,11,12,13,15},{1,5,6,8,11,12,14},{1,5,6,8,11,12,14,15},{1,5,6,8,11,12,15},{1,5,6,8,11,13},{1,5,6,8,11,13,14},{1,5,6,8,11,13,14,15},{1,5,6,8,11,13,15},{1,5,6,8,11,14},{1,5,6,8,11,14,15},{1,5,6,8,11,15},{1,5,6,8,12},{1,5,6,8,12,13},{1,5,6,8,12,13,14},{1,5,6,8,12,13,14,15},{1,5,6,8,12,13,15},{1,5,6,8,12,14},{1,5,6,8,12,14,15},{1,5,6,8,12,15},{1,5,6,8,13},{1,5,6,8,13,14},{1,5,6,8,13,14,15},{1,5,6,8,13,15},{1,5,6,8,14},{1,5,6,8,14,15},{1,5,6,8,15},{1,5,6,9},{1,5,6,9,10},{1,5,6,9,10,11},{1,5,6,9,10,11,12},{1,5,6,9,10,11,12,13},{1,5,6,9,10,11,12,13,14},{1,5,6,9,10,11,12,13,14,15},{1,5,6,9,10,11,12,13,15},{1,5,6,9,10,11,12,14},{1,5,6,9,10,11,12,14,15},{1,5,6,9,10,11,12,15},{1,5,6,9,10,11,13},{1,5,6,9,10,11,13,14},{1,5,6,9,10,11,13,14,15},{1,5,6,9,10,11,13,15},{1,5,6,9,10,11,14},{1,5,6,9,10,11,14,15},{1,5,6,9,10,11,15},{1,5,6,9,10,12},{1,5,6,9,10,12,13},{1,5,6,9,10,12,13,14},{1,5,6,9,10,12,13,14,15},{1,5,6,9,10,12,13,15},{1,5,6,9,10,12,14},{1,5,6,9,10,12,14,15},{1,5,6,9,10,12,15},{1,5,6,9,10,13},{1,5,6,9,10,13,14},{1,5,6,9,10,13,14,15},{1,5,6,9,10,13,15},{1,5,6,9,10,14},{1,5,6,9,10,14,15},{1,5,6,9,10,15},{1,5,6,9,11},{1,5,6,9,11,12},{1,5,6,9,11,12,13},{1,5,6,9,11,12,13,14},{1,5,6,9,11,12,13,14,15},{1,5,6,9,11,12,13,15},{1,5,6,9,11,12,14},{1,5,6,9,11,12,14,15},{1,5,6,9,11,12,15},{1,5,6,9,11,13},{1,5,6,9,11,13,14},{1,5,6,9,11,13,14,15},{1,5,6,9,11,13,15},{1,5,6,9,11,14},{1,5,6,9,11,14,15},{1,5,6,9,11,15},{1,5,6,9,12},{1,5,6,9,12,13},{1,5,6,9,12,13,14},{1,5,6,9,12,13,14,15},{1,5,6,9,12,13,15},{1,5,6,9,12,14},{1,5,6,9,12,14,15},{1,5,6,9,12,15},{1,5,6,9,13},{1,5,6,9,13,14},{1,5,6,9,13,14,15},{1,5,6,9,13,15},{1,5,6,9,14},{1,5,6,9,14,15},{1,5,6,9,15},{1,5,6,10},{1,5,6,10,11},{1,5,6,10,11,12},{1,5,6,10,11,12,13},{1,5,6,10,11,12,13,14},{1,5,6,10,11,12,13,14,15},{1,5,6,10,11,12,13,15},{1,5,6,10,11,12,14},{1,5,6,10,11,12,14,15},{1,5,6,10,11,12,15},{1,5,6,10,11,13},{1,5,6,10,11,13,14},{1,5,6,10,11,13,14,15},{1,5,6,10,11,13,15},{1,5,6,10,11,14},{1,5,6,10,11,14,15},{1,5,6,10,11,15},{1,5,6,10,12},{1,5,6,10,12,13},{1,5,6,10,12,13,14},{1,5,6,10,12,13,14,15},{1,5,6,10,12,13,15},{1,5,6,10,12,14},{1,5,6,10,12,14,15},{1,5,6,10,12,15},{1,5,6,10,13},{1,5,6,10,13,14},{1,5,6,10,13,14,15},{1,5,6,10,13,15},{1,5,6,10,14},{1,5,6,10,14,15},{1,5,6,10,15},{1,5,6,11},{1,5,6,11,12},{1,5,6,11,12,13},{1,5,6,11,12,13,14},{1,5,6,11,12,13,14,15},{1,5,6,11,12,13,15},{1,5,6,11,12,14},{1,5,6,11,12,14,15},{1,5,6,11,12,15},{1,5,6,11,13},{1,5,6,11,13,14},{1,5,6,11,13,14,15},{1,5,6,11,13,15},{1,5,6,11,14},{1,5,6,11,14,15},{1,5,6,11,15},{1,5,6,12},{1,5,6,12,13},{1,5,6,12,13,14},{1,5,6,12,13,14,15},{1,5,6,12,13,15},{1,5,6,12,14},{1,5,6,12,14,15},{1,5,6,12,15},{1,5,6,13},{1,5,6,13,14},{1,5,6,13,14,15},{1,5,6,13,15},{1,5,6,14},{1,5,6,14,15},{1,5,6,15},{1,5,7},{1,5,7,8},{1,5,7,8,9},{1,5,7,8,9,10},{1,5,7,8,9,10,11},{1,5,7,8,9,10,11,12},{1,5,7,8,9,10,11,12,13},{1,5,7,8,9,10,11,12,13,14},{1,5,7,8,9,10,11,12,13,14,15},{1,5,7,8,9,10,11,12,13,15},{1,5,7,8,9,10,11,12,14},{1,5,7,8,9,10,11,12,14,15},{1,5,7,8,9,10,11,12,15},{1,5,7,8,9,10,11,13},{1,5,7,8,9,10,11,13,14},{1,5,7,8,9,10,11,13,14,15},{1,5,7,8,9,10,11,13,15},{1,5,7,8,9,10,11,14},{1,5,7,8,9,10,11,14,15},{1,5,7,8,9,10,11,15},{1,5,7,8,9,10,12},{1,5,7,8,9,10,12,13},{1,5,7,8,9,10,12,13,14},{1,5,7,8,9,10,12,13,14,15},{1,5,7,8,9,10,12,13,15},{1,5,7,8,9,10,12,14},{1,5,7,8,9,10,12,14,15},{1,5,7,8,9,10,12,15},{1,5,7,8,9,10,13},{1,5,7,8,9,10,13,14},{1,5,7,8,9,10,13,14,15},{1,5,7,8,9,10,13,15},{1,5,7,8,9,10,14},{1,5,7,8,9,10,14,15},{1,5,7,8,9,10,15},{1,5,7,8,9,11},{1,5,7,8,9,11,12},{1,5,7,8,9,11,12,13},{1,5,7,8,9,11,12,13,14},{1,5,7,8,9,11,12,13,14,15},{1,5,7,8,9,11,12,13,15},{1,5,7,8,9,11,12,14},{1,5,7,8,9,11,12,14,15},{1,5,7,8,9,11,12,15},{1,5,7,8,9,11,13},{1,5,7,8,9,11,13,14},{1,5,7,8,9,11,13,14,15},{1,5,7,8,9,11,13,15},{1,5,7,8,9,11,14},{1,5,7,8,9,11,14,15},{1,5,7,8,9,11,15},{1,5,7,8,9,12},{1,5,7,8,9,12,13},{1,5,7,8,9,12,13,14},{1,5,7,8,9,12,13,14,15},{1,5,7,8,9,12,13,15},{1,5,7,8,9,12,14},{1,5,7,8,9,12,14,15},{1,5,7,8,9,12,15},{1,5,7,8,9,13},{1,5,7,8,9,13,14},{1,5,7,8,9,13,14,15},{1,5,7,8,9,13,15},{1,5,7,8,9,14},{1,5,7,8,9,14,15},{1,5,7,8,9,15},{1,5,7,8,10},{1,5,7,8,10,11},{1,5,7,8,10,11,12},{1,5,7,8,10,11,12,13},{1,5,7,8,10,11,12,13,14},{1,5,7,8,10,11,12,13,14,15},{1,5,7,8,10,11,12,13,15},{1,5,7,8,10,11,12,14},{1,5,7,8,10,11,12,14,15},{1,5,7,8,10,11,12,15},{1,5,7,8,10,11,13},{1,5,7,8,10,11,13,14},{1,5,7,8,10,11,13,14,15},{1,5,7,8,10,11,13,15},{1,5,7,8,10,11,14},{1,5,7,8,10,11,14,15},{1,5,7,8,10,11,15},{1,5,7,8,10,12},{1,5,7,8,10,12,13},{1,5,7,8,10,12,13,14},{1,5,7,8,10,12,13,14,15},{1,5,7,8,10,12,13,15},{1,5,7,8,10,12,14},{1,5,7,8,10,12,14,15},{1,5,7,8,10,12,15},{1,5,7,8,10,13},{1,5,7,8,10,13,14},{1,5,7,8,10,13,14,15},{1,5,7,8,10,13,15},{1,5,7,8,10,14},{1,5,7,8,10,14,15},{1,5,7,8,10,15},{1,5,7,8,11},{1,5,7,8,11,12},{1,5,7,8,11,12,13},{1,5,7,8,11,12,13,14},{1,5,7,8,11,12,13,14,15},{1,5,7,8,11,12,13,15},{1,5,7,8,11,12,14},{1,5,7,8,11,12,14,15},{1,5,7,8,11,12,15},{1,5,7,8,11,13},{1,5,7,8,11,13,14},{1,5,7,8,11,13,14,15},{1,5,7,8,11,13,15},{1,5,7,8,11,14},{1,5,7,8,11,14,15},{1,5,7,8,11,15},{1,5,7,8,12},{1,5,7,8,12,13},{1,5,7,8,12,13,14},{1,5,7,8,12,13,14,15},{1,5,7,8,12,13,15},{1,5,7,8,12,14},{1,5,7,8,12,14,15},{1,5,7,8,12,15},{1,5,7,8,13},{1,5,7,8,13,14},{1,5,7,8,13,14,15},{1,5,7,8,13,15},{1,5,7,8,14},{1,5,7,8,14,15},{1,5,7,8,15},{1,5,7,9},{1,5,7,9,10},{1,5,7,9,10,11},{1,5,7,9,10,11,12},{1,5,7,9,10,11,12,13},{1,5,7,9,10,11,12,13,14},{1,5,7,9,10,11,12,13,14,15},{1,5,7,9,10,11,12,13,15},{1,5,7,9,10,11,12,14},{1,5,7,9,10,11,12,14,15},{1,5,7,9,10,11,12,15},{1,5,7,9,10,11,13},{1,5,7,9,10,11,13,14},{1,5,7,9,10,11,13,14,15},{1,5,7,9,10,11,13,15},{1,5,7,9,10,11,14},{1,5,7,9,10,11,14,15},{1,5,7,9,10,11,15},{1,5,7,9,10,12},{1,5,7,9,10,12,13},{1,5,7,9,10,12,13,14},{1,5,7,9,10,12,13,14,15},{1,5,7,9,10,12,13,15},{1,5,7,9,10,12,14},{1,5,7,9,10,12,14,15},{1,5,7,9,10,12,15},{1,5,7,9,10,13},{1,5,7,9,10,13,14},{1,5,7,9,10,13,14,15},{1,5,7,9,10,13,15},{1,5,7,9,10,14},{1,5,7,9,10,14,15},{1,5,7,9,10,15},{1,5,7,9,11},{1,5,7,9,11,12},{1,5,7,9,11,12,13},{1,5,7,9,11,12,13,14},{1,5,7,9,11,12,13,14,15},{1,5,7,9,11,12,13,15},{1,5,7,9,11,12,14},{1,5,7,9,11,12,14,15},{1,5,7,9,11,12,15},{1,5,7,9,11,13},{1,5,7,9,11,13,14},{1,5,7,9,11,13,14,15},{1,5,7,9,11,13,15},{1,5,7,9,11,14},{1,5,7,9,11,14,15},{1,5,7,9,11,15},{1,5,7,9,12},{1,5,7,9,12,13},{1,5,7,9,12,13,14},{1,5,7,9,12,13,14,15},{1,5,7,9,12,13,15},{1,5,7,9,12,14},{1,5,7,9,12,14,15},{1,5,7,9,12,15},{1,5,7,9,13},{1,5,7,9,13,14},{1,5,7,9,13,14,15},{1,5,7,9,13,15},{1,5,7,9,14},{1,5,7,9,14,15},{1,5,7,9,15},{1,5,7,10},{1,5,7,10,11},{1,5,7,10,11,12},{1,5,7,10,11,12,13},{1,5,7,10,11,12,13,14},{1,5,7,10,11,12,13,14,15},{1,5,7,10,11,12,13,15},{1,5,7,10,11,12,14},{1,5,7,10,11,12,14,15},{1,5,7,10,11,12,15},{1,5,7,10,11,13},{1,5,7,10,11,13,14},{1,5,7,10,11,13,14,15},{1,5,7,10,11,13,15},{1,5,7,10,11,14},{1,5,7,10,11,14,15},{1,5,7,10,11,15},{1,5,7,10,12},{1,5,7,10,12,13},{1,5,7,10,12,13,14},{1,5,7,10,12,13,14,15},{1,5,7,10,12,13,15},{1,5,7,10,12,14},{1,5,7,10,12,14,15},{1,5,7,10,12,15},{1,5,7,10,13},{1,5,7,10,13,14},{1,5,7,10,13,14,15},{1,5,7,10,13,15},{1,5,7,10,14},{1,5,7,10,14,15},{1,5,7,10,15},{1,5,7,11},{1,5,7,11,12},{1,5,7,11,12,13},{1,5,7,11,12,13,14},{1,5,7,11,12,13,14,15},{1,5,7,11,12,13,15},{1,5,7,11,12,14},{1,5,7,11,12,14,15},{1,5,7,11,12,15},{1,5,7,11,13},{1,5,7,11,13,14},{1,5,7,11,13,14,15},{1,5,7,11,13,15},{1,5,7,11,14},{1,5,7,11,14,15},{1,5,7,11,15},{1,5,7,12},{1,5,7,12,13},{1,5,7,12,13,14},{1,5,7,12,13,14,15},{1,5,7,12,13,15},{1,5,7,12,14},{1,5,7,12,14,15},{1,5,7,12,15},{1,5,7,13},{1,5,7,13,14},{1,5,7,13,14,15},{1,5,7,13,15},{1,5,7,14},{1,5,7,14,15},{1,5,7,15},{1,5,8},{1,5,8,9},{1,5,8,9,10},{1,5,8,9,10,11},{1,5,8,9,10,11,12},{1,5,8,9,10,11,12,13},{1,5,8,9,10,11,12,13,14},{1,5,8,9,10,11,12,13,14,15},{1,5,8,9,10,11,12,13,15},{1,5,8,9,10,11,12,14},{1,5,8,9,10,11,12,14,15},{1,5,8,9,10,11,12,15},{1,5,8,9,10,11,13},{1,5,8,9,10,11,13,14},{1,5,8,9,10,11,13,14,15},{1,5,8,9,10,11,13,15},{1,5,8,9,10,11,14},{1,5,8,9,10,11,14,15},{1,5,8,9,10,11,15},{1,5,8,9,10,12},{1,5,8,9,10,12,13},{1,5,8,9,10,12,13,14},{1,5,8,9,10,12,13,14,15},{1,5,8,9,10,12,13,15},{1,5,8,9,10,12,14},{1,5,8,9,10,12,14,15},{1,5,8,9,10,12,15},{1,5,8,9,10,13},{1,5,8,9,10,13,14},{1,5,8,9,10,13,14,15},{1,5,8,9,10,13,15},{1,5,8,9,10,14},{1,5,8,9,10,14,15},{1,5,8,9,10,15},{1,5,8,9,11},{1,5,8,9,11,12},{1,5,8,9,11,12,13},{1,5,8,9,11,12,13,14},{1,5,8,9,11,12,13,14,15},{1,5,8,9,11,12,13,15},{1,5,8,9,11,12,14},{1,5,8,9,11,12,14,15},{1,5,8,9,11,12,15},{1,5,8,9,11,13},{1,5,8,9,11,13,14},{1,5,8,9,11,13,14,15},{1,5,8,9,11,13,15},{1,5,8,9,11,14},{1,5,8,9,11,14,15},{1,5,8,9,11,15},{1,5,8,9,12},{1,5,8,9,12,13},{1,5,8,9,12,13,14},{1,5,8,9,12,13,14,15},{1,5,8,9,12,13,15},{1,5,8,9,12,14},{1,5,8,9,12,14,15},{1,5,8,9,12,15},{1,5,8,9,13},{1,5,8,9,13,14},{1,5,8,9,13,14,15},{1,5,8,9,13,15},{1,5,8,9,14},{1,5,8,9,14,15},{1,5,8,9,15},{1,5,8,10},{1,5,8,10,11},{1,5,8,10,11,12},{1,5,8,10,11,12,13},{1,5,8,10,11,12,13,14},{1,5,8,10,11,12,13,14,15},{1,5,8,10,11,12,13,15},{1,5,8,10,11,12,14},{1,5,8,10,11,12,14,15},{1,5,8,10,11,12,15},{1,5,8,10,11,13},{1,5,8,10,11,13,14},{1,5,8,10,11,13,14,15},{1,5,8,10,11,13,15},{1,5,8,10,11,14},{1,5,8,10,11,14,15},{1,5,8,10,11,15},{1,5,8,10,12},{1,5,8,10,12,13},{1,5,8,10,12,13,14},{1,5,8,10,12,13,14,15},{1,5,8,10,12,13,15},{1,5,8,10,12,14},{1,5,8,10,12,14,15},{1,5,8,10,12,15},{1,5,8,10,13},{1,5,8,10,13,14},{1,5,8,10,13,14,15},{1,5,8,10,13,15},{1,5,8,10,14},{1,5,8,10,14,15},{1,5,8,10,15},{1,5,8,11},{1,5,8,11,12},{1,5,8,11,12,13},{1,5,8,11,12,13,14},{1,5,8,11,12,13,14,15},{1,5,8,11,12,13,15},{1,5,8,11,12,14},{1,5,8,11,12,14,15},{1,5,8,11,12,15},{1,5,8,11,13},{1,5,8,11,13,14},{1,5,8,11,13,14,15},{1,5,8,11,13,15},{1,5,8,11,14},{1,5,8,11,14,15},{1,5,8,11,15},{1,5,8,12},{1,5,8,12,13},{1,5,8,12,13,14},{1,5,8,12,13,14,15},{1,5,8,12,13,15},{1,5,8,12,14},{1,5,8,12,14,15},{1,5,8,12,15},{1,5,8,13},{1,5,8,13,14},{1,5,8,13,14,15},{1,5,8,13,15},{1,5,8,14},{1,5,8,14,15},{1,5,8,15},{1,5,9},{1,5,9,10},{1,5,9,10,11},{1,5,9,10,11,12},{1,5,9,10,11,12,13},{1,5,9,10,11,12,13,14},{1,5,9,10,11,12,13,14,15},{1,5,9,10,11,12,13,15},{1,5,9,10,11,12,14},{1,5,9,10,11,12,14,15},{1,5,9,10,11,12,15},{1,5,9,10,11,13},{1,5,9,10,11,13,14},{1,5,9,10,11,13,14,15},{1,5,9,10,11,13,15},{1,5,9,10,11,14},{1,5,9,10,11,14,15},{1,5,9,10,11,15},{1,5,9,10,12},{1,5,9,10,12,13},{1,5,9,10,12,13,14},{1,5,9,10,12,13,14,15},{1,5,9,10,12,13,15},{1,5,9,10,12,14},{1,5,9,10,12,14,15},{1,5,9,10,12,15},{1,5,9,10,13},{1,5,9,10,13,14},{1,5,9,10,13,14,15},{1,5,9,10,13,15},{1,5,9,10,14},{1,5,9,10,14,15},{1,5,9,10,15},{1,5,9,11},{1,5,9,11,12},{1,5,9,11,12,13},{1,5,9,11,12,13,14},{1,5,9,11,12,13,14,15},{1,5,9,11,12,13,15},{1,5,9,11,12,14},{1,5,9,11,12,14,15},{1,5,9,11,12,15},{1,5,9,11,13},{1,5,9,11,13,14},{1,5,9,11,13,14,15},{1,5,9,11,13,15},{1,5,9,11,14},{1,5,9,11,14,15},{1,5,9,11,15},{1,5,9,12},{1,5,9,12,13},{1,5,9,12,13,14},{1,5,9,12,13,14,15},{1,5,9,12,13,15},{1,5,9,12,14},{1,5,9,12,14,15},{1,5,9,12,15},{1,5,9,13},{1,5,9,13,14},{1,5,9,13,14,15},{1,5,9,13,15},{1,5,9,14},{1,5,9,14,15},{1,5,9,15},{1,5,10},{1,5,10,11},{1,5,10,11,12},{1,5,10,11,12,13},{1,5,10,11,12,13,14},{1,5,10,11,12,13,14,15},{1,5,10,11,12,13,15},{1,5,10,11,12,14},{1,5,10,11,12,14,15},{1,5,10,11,12,15},{1,5,10,11,13},{1,5,10,11,13,14},{1,5,10,11,13,14,15},{1,5,10,11,13,15},{1,5,10,11,14},{1,5,10,11,14,15},{1,5,10,11,15},{1,5,10,12},{1,5,10,12,13},{1,5,10,12,13,14},{1,5,10,12,13,14,15},{1,5,10,12,13,15},{1,5,10,12,14},{1,5,10,12,14,15},{1,5,10,12,15},{1,5,10,13},{1,5,10,13,14},{1,5,10,13,14,15},{1,5,10,13,15},{1,5,10,14},{1,5,10,14,15},{1,5,10,15},{1,5,11},{1,5,11,12},{1,5,11,12,13},{1,5,11,12,13,14},{1,5,11,12,13,14,15},{1,5,11,12,13,15},{1,5,11,12,14},{1,5,11,12,14,15},{1,5,11,12,15},{1,5,11,13},{1,5,11,13,14},{1,5,11,13,14,15},{1,5,11,13,15},{1,5,11,14},{1,5,11,14,15},{1,5,11,15},{1,5,12},{1,5,12,13},{1,5,12,13,14},{1,5,12,13,14,15},{1,5,12,13,15},{1,5,12,14},{1,5,12,14,15},{1,5,12,15},{1,5,13},{1,5,13,14},{1,5,13,14,15},{1,5,13,15},{1,5,14},{1,5,14,15},{1,5,15},{1,6},{1,6,7},{1,6,7,8},{1,6,7,8,9},{1,6,7,8,9,10},{1,6,7,8,9,10,11},{1,6,7,8,9,10,11,12},{1,6,7,8,9,10,11,12,13},{1,6,7,8,9,10,11,12,13,14},{1,6,7,8,9,10,11,12,13,14,15},{1,6,7,8,9,10,11,12,13,15},{1,6,7,8,9,10,11,12,14},{1,6,7,8,9,10,11,12,14,15},{1,6,7,8,9,10,11,12,15},{1,6,7,8,9,10,11,13},{1,6,7,8,9,10,11,13,14},{1,6,7,8,9,10,11,13,14,15},{1,6,7,8,9,10,11,13,15},{1,6,7,8,9,10,11,14},{1,6,7,8,9,10,11,14,15},{1,6,7,8,9,10,11,15},{1,6,7,8,9,10,12},{1,6,7,8,9,10,12,13},{1,6,7,8,9,10,12,13,14},{1,6,7,8,9,10,12,13,14,15},{1,6,7,8,9,10,12,13,15},{1,6,7,8,9,10,12,14},{1,6,7,8,9,10,12,14,15},{1,6,7,8,9,10,12,15},{1,6,7,8,9,10,13},{1,6,7,8,9,10,13,14},{1,6,7,8,9,10,13,14,15},{1,6,7,8,9,10,13,15},{1,6,7,8,9,10,14},{1,6,7,8,9,10,14,15},{1,6,7,8,9,10,15},{1,6,7,8,9,11},{1,6,7,8,9,11,12},{1,6,7,8,9,11,12,13},{1,6,7,8,9,11,12,13,14},{1,6,7,8,9,11,12,13,14,15},{1,6,7,8,9,11,12,13,15},{1,6,7,8,9,11,12,14},{1,6,7,8,9,11,12,14,15},{1,6,7,8,9,11,12,15},{1,6,7,8,9,11,13},{1,6,7,8,9,11,13,14},{1,6,7,8,9,11,13,14,15},{1,6,7,8,9,11,13,15},{1,6,7,8,9,11,14},{1,6,7,8,9,11,14,15},{1,6,7,8,9,11,15},{1,6,7,8,9,12},{1,6,7,8,9,12,13},{1,6,7,8,9,12,13,14},{1,6,7,8,9,12,13,14,15},{1,6,7,8,9,12,13,15},{1,6,7,8,9,12,14},{1,6,7,8,9,12,14,15},{1,6,7,8,9,12,15},{1,6,7,8,9,13},{1,6,7,8,9,13,14},{1,6,7,8,9,13,14,15},{1,6,7,8,9,13,15},{1,6,7,8,9,14},{1,6,7,8,9,14,15},{1,6,7,8,9,15},{1,6,7,8,10},{1,6,7,8,10,11},{1,6,7,8,10,11,12},{1,6,7,8,10,11,12,13},{1,6,7,8,10,11,12,13,14},{1,6,7,8,10,11,12,13,14,15},{1,6,7,8,10,11,12,13,15},{1,6,7,8,10,11,12,14},{1,6,7,8,10,11,12,14,15},{1,6,7,8,10,11,12,15},{1,6,7,8,10,11,13},{1,6,7,8,10,11,13,14},{1,6,7,8,10,11,13,14,15},{1,6,7,8,10,11,13,15},{1,6,7,8,10,11,14},{1,6,7,8,10,11,14,15},{1,6,7,8,10,11,15},{1,6,7,8,10,12},{1,6,7,8,10,12,13},{1,6,7,8,10,12,13,14},{1,6,7,8,10,12,13,14,15},{1,6,7,8,10,12,13,15},{1,6,7,8,10,12,14},{1,6,7,8,10,12,14,15},{1,6,7,8,10,12,15},{1,6,7,8,10,13},{1,6,7,8,10,13,14},{1,6,7,8,10,13,14,15},{1,6,7,8,10,13,15},{1,6,7,8,10,14},{1,6,7,8,10,14,15},{1,6,7,8,10,15},{1,6,7,8,11},{1,6,7,8,11,12},{1,6,7,8,11,12,13},{1,6,7,8,11,12,13,14},{1,6,7,8,11,12,13,14,15},{1,6,7,8,11,12,13,15},{1,6,7,8,11,12,14},{1,6,7,8,11,12,14,15},{1,6,7,8,11,12,15},{1,6,7,8,11,13},{1,6,7,8,11,13,14},{1,6,7,8,11,13,14,15},{1,6,7,8,11,13,15},{1,6,7,8,11,14},{1,6,7,8,11,14,15},{1,6,7,8,11,15},{1,6,7,8,12},{1,6,7,8,12,13},{1,6,7,8,12,13,14},{1,6,7,8,12,13,14,15},{1,6,7,8,12,13,15},{1,6,7,8,12,14},{1,6,7,8,12,14,15},{1,6,7,8,12,15},{1,6,7,8,13},{1,6,7,8,13,14},{1,6,7,8,13,14,15},{1,6,7,8,13,15},{1,6,7,8,14},{1,6,7,8,14,15},{1,6,7,8,15},{1,6,7,9},{1,6,7,9,10},{1,6,7,9,10,11},{1,6,7,9,10,11,12},{1,6,7,9,10,11,12,13},{1,6,7,9,10,11,12,13,14},{1,6,7,9,10,11,12,13,14,15},{1,6,7,9,10,11,12,13,15},{1,6,7,9,10,11,12,14},{1,6,7,9,10,11,12,14,15},{1,6,7,9,10,11,12,15},{1,6,7,9,10,11,13},{1,6,7,9,10,11,13,14},{1,6,7,9,10,11,13,14,15},{1,6,7,9,10,11,13,15},{1,6,7,9,10,11,14},{1,6,7,9,10,11,14,15},{1,6,7,9,10,11,15},{1,6,7,9,10,12},{1,6,7,9,10,12,13},{1,6,7,9,10,12,13,14},{1,6,7,9,10,12,13,14,15},{1,6,7,9,10,12,13,15},{1,6,7,9,10,12,14},{1,6,7,9,10,12,14,15},{1,6,7,9,10,12,15},{1,6,7,9,10,13},{1,6,7,9,10,13,14},{1,6,7,9,10,13,14,15},{1,6,7,9,10,13,15},{1,6,7,9,10,14},{1,6,7,9,10,14,15},{1,6,7,9,10,15},{1,6,7,9,11},{1,6,7,9,11,12},{1,6,7,9,11,12,13},{1,6,7,9,11,12,13,14},{1,6,7,9,11,12,13,14,15},{1,6,7,9,11,12,13,15},{1,6,7,9,11,12,14},{1,6,7,9,11,12,14,15},{1,6,7,9,11,12,15},{1,6,7,9,11,13},{1,6,7,9,11,13,14},{1,6,7,9,11,13,14,15},{1,6,7,9,11,13,15},{1,6,7,9,11,14},{1,6,7,9,11,14,15},{1,6,7,9,11,15},{1,6,7,9,12},{1,6,7,9,12,13},{1,6,7,9,12,13,14},{1,6,7,9,12,13,14,15},{1,6,7,9,12,13,15},{1,6,7,9,12,14},{1,6,7,9,12,14,15},{1,6,7,9,12,15},{1,6,7,9,13},{1,6,7,9,13,14},{1,6,7,9,13,14,15},{1,6,7,9,13,15},{1,6,7,9,14},{1,6,7,9,14,15},{1,6,7,9,15},{1,6,7,10},{1,6,7,10,11},{1,6,7,10,11,12},{1,6,7,10,11,12,13},{1,6,7,10,11,12,13,14},{1,6,7,10,11,12,13,14,15},{1,6,7,10,11,12,13,15},{1,6,7,10,11,12,14},{1,6,7,10,11,12,14,15},{1,6,7,10,11,12,15},{1,6,7,10,11,13},{1,6,7,10,11,13,14},{1,6,7,10,11,13,14,15},{1,6,7,10,11,13,15},{1,6,7,10,11,14},{1,6,7,10,11,14,15},{1,6,7,10,11,15},{1,6,7,10,12},{1,6,7,10,12,13},{1,6,7,10,12,13,14},{1,6,7,10,12,13,14,15},{1,6,7,10,12,13,15},{1,6,7,10,12,14},{1,6,7,10,12,14,15},{1,6,7,10,12,15},{1,6,7,10,13},{1,6,7,10,13,14},{1,6,7,10,13,14,15},{1,6,7,10,13,15},{1,6,7,10,14},{1,6,7,10,14,15},{1,6,7,10,15},{1,6,7,11},{1,6,7,11,12},{1,6,7,11,12,13},{1,6,7,11,12,13,14},{1,6,7,11,12,13,14,15},{1,6,7,11,12,13,15},{1,6,7,11,12,14},{1,6,7,11,12,14,15},{1,6,7,11,12,15},{1,6,7,11,13},{1,6,7,11,13,14},{1,6,7,11,13,14,15},{1,6,7,11,13,15},{1,6,7,11,14},{1,6,7,11,14,15},{1,6,7,11,15},{1,6,7,12},{1,6,7,12,13},{1,6,7,12,13,14},{1,6,7,12,13,14,15},{1,6,7,12,13,15},{1,6,7,12,14},{1,6,7,12,14,15},{1,6,7,12,15},{1,6,7,13},{1,6,7,13,14},{1,6,7,13,14,15},{1,6,7,13,15},{1,6,7,14},{1,6,7,14,15},{1,6,7,15},{1,6,8},{1,6,8,9},{1,6,8,9,10},{1,6,8,9,10,11},{1,6,8,9,10,11,12},{1,6,8,9,10,11,12,13},{1,6,8,9,10,11,12,13,14},{1,6,8,9,10,11,12,13,14,15},{1,6,8,9,10,11,12,13,15},{1,6,8,9,10,11,12,14},{1,6,8,9,10,11,12,14,15},{1,6,8,9,10,11,12,15},{1,6,8,9,10,11,13},{1,6,8,9,10,11,13,14},{1,6,8,9,10,11,13,14,15},{1,6,8,9,10,11,13,15},{1,6,8,9,10,11,14},{1,6,8,9,10,11,14,15},{1,6,8,9,10,11,15},{1,6,8,9,10,12},{1,6,8,9,10,12,13},{1,6,8,9,10,12,13,14},{1,6,8,9,10,12,13,14,15},{1,6,8,9,10,12,13,15},{1,6,8,9,10,12,14},{1,6,8,9,10,12,14,15},{1,6,8,9,10,12,15},{1,6,8,9,10,13},{1,6,8,9,10,13,14},{1,6,8,9,10,13,14,15},{1,6,8,9,10,13,15},{1,6,8,9,10,14},{1,6,8,9,10,14,15},{1,6,8,9,10,15},{1,6,8,9,11},{1,6,8,9,11,12},{1,6,8,9,11,12,13},{1,6,8,9,11,12,13,14},{1,6,8,9,11,12,13,14,15},{1,6,8,9,11,12,13,15},{1,6,8,9,11,12,14},{1,6,8,9,11,12,14,15},{1,6,8,9,11,12,15},{1,6,8,9,11,13},{1,6,8,9,11,13,14},{1,6,8,9,11,13,14,15},{1,6,8,9,11,13,15},{1,6,8,9,11,14},{1,6,8,9,11,14,15},{1,6,8,9,11,15},{1,6,8,9,12},{1,6,8,9,12,13},{1,6,8,9,12,13,14},{1,6,8,9,12,13,14,15},{1,6,8,9,12,13,15},{1,6,8,9,12,14},{1,6,8,9,12,14,15},{1,6,8,9,12,15},{1,6,8,9,13},{1,6,8,9,13,14},{1,6,8,9,13,14,15},{1,6,8,9,13,15},{1,6,8,9,14},{1,6,8,9,14,15},{1,6,8,9,15},{1,6,8,10},{1,6,8,10,11},{1,6,8,10,11,12},{1,6,8,10,11,12,13},{1,6,8,10,11,12,13,14},{1,6,8,10,11,12,13,14,15},{1,6,8,10,11,12,13,15},{1,6,8,10,11,12,14},{1,6,8,10,11,12,14,15},{1,6,8,10,11,12,15},{1,6,8,10,11,13},{1,6,8,10,11,13,14},{1,6,8,10,11,13,14,15},{1,6,8,10,11,13,15},{1,6,8,10,11,14},{1,6,8,10,11,14,15},{1,6,8,10,11,15},{1,6,8,10,12},{1,6,8,10,12,13},{1,6,8,10,12,13,14},{1,6,8,10,12,13,14,15},{1,6,8,10,12,13,15},{1,6,8,10,12,14},{1,6,8,10,12,14,15},{1,6,8,10,12,15},{1,6,8,10,13},{1,6,8,10,13,14},{1,6,8,10,13,14,15},{1,6,8,10,13,15},{1,6,8,10,14},{1,6,8,10,14,15},{1,6,8,10,15},{1,6,8,11},{1,6,8,11,12},{1,6,8,11,12,13},{1,6,8,11,12,13,14},{1,6,8,11,12,13,14,15},{1,6,8,11,12,13,15},{1,6,8,11,12,14},{1,6,8,11,12,14,15},{1,6,8,11,12,15},{1,6,8,11,13},{1,6,8,11,13,14},{1,6,8,11,13,14,15},{1,6,8,11,13,15},{1,6,8,11,14},{1,6,8,11,14,15},{1,6,8,11,15},{1,6,8,12},{1,6,8,12,13},{1,6,8,12,13,14},{1,6,8,12,13,14,15},{1,6,8,12,13,15},{1,6,8,12,14},{1,6,8,12,14,15},{1,6,8,12,15},{1,6,8,13},{1,6,8,13,14},{1,6,8,13,14,15},{1,6,8,13,15},{1,6,8,14},{1,6,8,14,15},{1,6,8,15},{1,6,9},{1,6,9,10},{1,6,9,10,11},{1,6,9,10,11,12},{1,6,9,10,11,12,13},{1,6,9,10,11,12,13,14},{1,6,9,10,11,12,13,14,15},{1,6,9,10,11,12,13,15},{1,6,9,10,11,12,14},{1,6,9,10,11,12,14,15},{1,6,9,10,11,12,15},{1,6,9,10,11,13},{1,6,9,10,11,13,14},{1,6,9,10,11,13,14,15},{1,6,9,10,11,13,15},{1,6,9,10,11,14},{1,6,9,10,11,14,15},{1,6,9,10,11,15},{1,6,9,10,12},{1,6,9,10,12,13},{1,6,9,10,12,13,14},{1,6,9,10,12,13,14,15},{1,6,9,10,12,13,15},{1,6,9,10,12,14},{1,6,9,10,12,14,15},{1,6,9,10,12,15},{1,6,9,10,13},{1,6,9,10,13,14},{1,6,9,10,13,14,15},{1,6,9,10,13,15},{1,6,9,10,14},{1,6,9,10,14,15},{1,6,9,10,15},{1,6,9,11},{1,6,9,11,12},{1,6,9,11,12,13},{1,6,9,11,12,13,14},{1,6,9,11,12,13,14,15},{1,6,9,11,12,13,15},{1,6,9,11,12,14},{1,6,9,11,12,14,15},{1,6,9,11,12,15},{1,6,9,11,13},{1,6,9,11,13,14},{1,6,9,11,13,14,15},{1,6,9,11,13,15},{1,6,9,11,14},{1,6,9,11,14,15},{1,6,9,11,15},{1,6,9,12},{1,6,9,12,13},{1,6,9,12,13,14},{1,6,9,12,13,14,15},{1,6,9,12,13,15},{1,6,9,12,14},{1,6,9,12,14,15},{1,6,9,12,15},{1,6,9,13},{1,6,9,13,14},{1,6,9,13,14,15},{1,6,9,13,15},{1,6,9,14},{1,6,9,14,15},{1,6,9,15},{1,6,10},{1,6,10,11},{1,6,10,11,12},{1,6,10,11,12,13},{1,6,10,11,12,13,14},{1,6,10,11,12,13,14,15},{1,6,10,11,12,13,15},{1,6,10,11,12,14},{1,6,10,11,12,14,15},{1,6,10,11,12,15},{1,6,10,11,13},{1,6,10,11,13,14},{1,6,10,11,13,14,15},{1,6,10,11,13,15},{1,6,10,11,14},{1,6,10,11,14,15},{1,6,10,11,15},{1,6,10,12},{1,6,10,12,13},{1,6,10,12,13,14},{1,6,10,12,13,14,15},{1,6,10,12,13,15},{1,6,10,12,14},{1,6,10,12,14,15},{1,6,10,12,15},{1,6,10,13},{1,6,10,13,14},{1,6,10,13,14,15},{1,6,10,13,15},{1,6,10,14},{1,6,10,14,15},{1,6,10,15},{1,6,11},{1,6,11,12},{1,6,11,12,13},{1,6,11,12,13,14},{1,6,11,12,13,14,15},{1,6,11,12,13,15},{1,6,11,12,14},{1,6,11,12,14,15},{1,6,11,12,15},{1,6,11,13},{1,6,11,13,14},{1,6,11,13,14,15},{1,6,11,13,15},{1,6,11,14},{1,6,11,14,15},{1,6,11,15},{1,6,12},{1,6,12,13},{1,6,12,13,14},{1,6,12,13,14,15},{1,6,12,13,15},{1,6,12,14},{1,6,12,14,15},{1,6,12,15},{1,6,13},{1,6,13,14},{1,6,13,14,15},{1,6,13,15},{1,6,14},{1,6,14,15},{1,6,15},{1,7},{1,7,8},{1,7,8,9},{1,7,8,9,10},{1,7,8,9,10,11},{1,7,8,9,10,11,12},{1,7,8,9,10,11,12,13},{1,7,8,9,10,11,12,13,14},{1,7,8,9,10,11,12,13,14,15},{1,7,8,9,10,11,12,13,15},{1,7,8,9,10,11,12,14},{1,7,8,9,10,11,12,14,15},{1,7,8,9,10,11,12,15},{1,7,8,9,10,11,13},{1,7,8,9,10,11,13,14},{1,7,8,9,10,11,13,14,15},{1,7,8,9,10,11,13,15},{1,7,8,9,10,11,14},{1,7,8,9,10,11,14,15},{1,7,8,9,10,11,15},{1,7,8,9,10,12},{1,7,8,9,10,12,13},{1,7,8,9,10,12,13,14},{1,7,8,9,10,12,13,14,15},{1,7,8,9,10,12,13,15},{1,7,8,9,10,12,14},{1,7,8,9,10,12,14,15},{1,7,8,9,10,12,15},{1,7,8,9,10,13},{1,7,8,9,10,13,14},{1,7,8,9,10,13,14,15},{1,7,8,9,10,13,15},{1,7,8,9,10,14},{1,7,8,9,10,14,15},{1,7,8,9,10,15},{1,7,8,9,11},{1,7,8,9,11,12},{1,7,8,9,11,12,13},{1,7,8,9,11,12,13,14},{1,7,8,9,11,12,13,14,15},{1,7,8,9,11,12,13,15},{1,7,8,9,11,12,14},{1,7,8,9,11,12,14,15},{1,7,8,9,11,12,15},{1,7,8,9,11,13},{1,7,8,9,11,13,14},{1,7,8,9,11,13,14,15},{1,7,8,9,11,13,15},{1,7,8,9,11,14},{1,7,8,9,11,14,15},{1,7,8,9,11,15},{1,7,8,9,12},{1,7,8,9,12,13},{1,7,8,9,12,13,14},{1,7,8,9,12,13,14,15},{1,7,8,9,12,13,15},{1,7,8,9,12,14},{1,7,8,9,12,14,15},{1,7,8,9,12,15},{1,7,8,9,13},{1,7,8,9,13,14},{1,7,8,9,13,14,15},{1,7,8,9,13,15},{1,7,8,9,14},{1,7,8,9,14,15},{1,7,8,9,15},{1,7,8,10},{1,7,8,10,11},{1,7,8,10,11,12},{1,7,8,10,11,12,13},{1,7,8,10,11,12,13,14},{1,7,8,10,11,12,13,14,15},{1,7,8,10,11,12,13,15},{1,7,8,10,11,12,14},{1,7,8,10,11,12,14,15},{1,7,8,10,11,12,15},{1,7,8,10,11,13},{1,7,8,10,11,13,14},{1,7,8,10,11,13,14,15},{1,7,8,10,11,13,15},{1,7,8,10,11,14},{1,7,8,10,11,14,15},{1,7,8,10,11,15},{1,7,8,10,12},{1,7,8,10,12,13},{1,7,8,10,12,13,14},{1,7,8,10,12,13,14,15},{1,7,8,10,12,13,15},{1,7,8,10,12,14},{1,7,8,10,12,14,15},{1,7,8,10,12,15},{1,7,8,10,13},{1,7,8,10,13,14},{1,7,8,10,13,14,15},{1,7,8,10,13,15},{1,7,8,10,14},{1,7,8,10,14,15},{1,7,8,10,15},{1,7,8,11},{1,7,8,11,12},{1,7,8,11,12,13},{1,7,8,11,12,13,14},{1,7,8,11,12,13,14,15},{1,7,8,11,12,13,15},{1,7,8,11,12,14},{1,7,8,11,12,14,15},{1,7,8,11,12,15},{1,7,8,11,13},{1,7,8,11,13,14},{1,7,8,11,13,14,15},{1,7,8,11,13,15},{1,7,8,11,14},{1,7,8,11,14,15},{1,7,8,11,15},{1,7,8,12},{1,7,8,12,13},{1,7,8,12,13,14},{1,7,8,12,13,14,15},{1,7,8,12,13,15},{1,7,8,12,14},{1,7,8,12,14,15},{1,7,8,12,15},{1,7,8,13},{1,7,8,13,14},{1,7,8,13,14,15},{1,7,8,13,15},{1,7,8,14},{1,7,8,14,15},{1,7,8,15},{1,7,9},{1,7,9,10},{1,7,9,10,11},{1,7,9,10,11,12},{1,7,9,10,11,12,13},{1,7,9,10,11,12,13,14},{1,7,9,10,11,12,13,14,15},{1,7,9,10,11,12,13,15},{1,7,9,10,11,12,14},{1,7,9,10,11,12,14,15},{1,7,9,10,11,12,15},{1,7,9,10,11,13},{1,7,9,10,11,13,14},{1,7,9,10,11,13,14,15},{1,7,9,10,11,13,15},{1,7,9,10,11,14},{1,7,9,10,11,14,15},{1,7,9,10,11,15},{1,7,9,10,12},{1,7,9,10,12,13},{1,7,9,10,12,13,14},{1,7,9,10,12,13,14,15},{1,7,9,10,12,13,15},{1,7,9,10,12,14},{1,7,9,10,12,14,15},{1,7,9,10,12,15},{1,7,9,10,13},{1,7,9,10,13,14},{1,7,9,10,13,14,15},{1,7,9,10,13,15},{1,7,9,10,14},{1,7,9,10,14,15},{1,7,9,10,15},{1,7,9,11},{1,7,9,11,12},{1,7,9,11,12,13},{1,7,9,11,12,13,14},{1,7,9,11,12,13,14,15},{1,7,9,11,12,13,15},{1,7,9,11,12,14},{1,7,9,11,12,14,15},{1,7,9,11,12,15},{1,7,9,11,13},{1,7,9,11,13,14},{1,7,9,11,13,14,15},{1,7,9,11,13,15},{1,7,9,11,14},{1,7,9,11,14,15},{1,7,9,11,15},{1,7,9,12},{1,7,9,12,13},{1,7,9,12,13,14},{1,7,9,12,13,14,15},{1,7,9,12,13,15},{1,7,9,12,14},{1,7,9,12,14,15},{1,7,9,12,15},{1,7,9,13},{1,7,9,13,14},{1,7,9,13,14,15},{1,7,9,13,15},{1,7,9,14},{1,7,9,14,15},{1,7,9,15},{1,7,10},{1,7,10,11},{1,7,10,11,12},{1,7,10,11,12,13},{1,7,10,11,12,13,14},{1,7,10,11,12,13,14,15},{1,7,10,11,12,13,15},{1,7,10,11,12,14},{1,7,10,11,12,14,15},{1,7,10,11,12,15},{1,7,10,11,13},{1,7,10,11,13,14},{1,7,10,11,13,14,15},{1,7,10,11,13,15},{1,7,10,11,14},{1,7,10,11,14,15},{1,7,10,11,15},{1,7,10,12},{1,7,10,12,13},{1,7,10,12,13,14},{1,7,10,12,13,14,15},{1,7,10,12,13,15},{1,7,10,12,14},{1,7,10,12,14,15},{1,7,10,12,15},{1,7,10,13},{1,7,10,13,14},{1,7,10,13,14,15},{1,7,10,13,15},{1,7,10,14},{1,7,10,14,15},{1,7,10,15},{1,7,11},{1,7,11,12},{1,7,11,12,13},{1,7,11,12,13,14},{1,7,11,12,13,14,15},{1,7,11,12,13,15},{1,7,11,12,14},{1,7,11,12,14,15},{1,7,11,12,15},{1,7,11,13},{1,7,11,13,14},{1,7,11,13,14,15},{1,7,11,13,15},{1,7,11,14},{1,7,11,14,15},{1,7,11,15},{1,7,12},{1,7,12,13},{1,7,12,13,14},{1,7,12,13,14,15},{1,7,12,13,15},{1,7,12,14},{1,7,12,14,15},{1,7,12,15},{1,7,13},{1,7,13,14},{1,7,13,14,15},{1,7,13,15},{1,7,14},{1,7,14,15},{1,7,15},{1,8},{1,8,9},{1,8,9,10},{1,8,9,10,11},{1,8,9,10,11,12},{1,8,9,10,11,12,13},{1,8,9,10,11,12,13,14},{1,8,9,10,11,12,13,14,15},{1,8,9,10,11,12,13,15},{1,8,9,10,11,12,14},{1,8,9,10,11,12,14,15},{1,8,9,10,11,12,15},{1,8,9,10,11,13},{1,8,9,10,11,13,14},{1,8,9,10,11,13,14,15},{1,8,9,10,11,13,15},{1,8,9,10,11,14},{1,8,9,10,11,14,15},{1,8,9,10,11,15},{1,8,9,10,12},{1,8,9,10,12,13},{1,8,9,10,12,13,14},{1,8,9,10,12,13,14,15},{1,8,9,10,12,13,15},{1,8,9,10,12,14},{1,8,9,10,12,14,15},{1,8,9,10,12,15},{1,8,9,10,13},{1,8,9,10,13,14},{1,8,9,10,13,14,15},{1,8,9,10,13,15},{1,8,9,10,14},{1,8,9,10,14,15},{1,8,9,10,15},{1,8,9,11},{1,8,9,11,12},{1,8,9,11,12,13},{1,8,9,11,12,13,14},{1,8,9,11,12,13,14,15},{1,8,9,11,12,13,15},{1,8,9,11,12,14},{1,8,9,11,12,14,15},{1,8,9,11,12,15},{1,8,9,11,13},{1,8,9,11,13,14},{1,8,9,11,13,14,15},{1,8,9,11,13,15},{1,8,9,11,14},{1,8,9,11,14,15},{1,8,9,11,15},{1,8,9,12},{1,8,9,12,13},{1,8,9,12,13,14},{1,8,9,12,13,14,15},{1,8,9,12,13,15},{1,8,9,12,14},{1,8,9,12,14,15},{1,8,9,12,15},{1,8,9,13},{1,8,9,13,14},{1,8,9,13,14,15},{1,8,9,13,15},{1,8,9,14},{1,8,9,14,15},{1,8,9,15},{1,8,10},{1,8,10,11},{1,8,10,11,12},{1,8,10,11,12,13},{1,8,10,11,12,13,14},{1,8,10,11,12,13,14,15},{1,8,10,11,12,13,15},{1,8,10,11,12,14},{1,8,10,11,12,14,15},{1,8,10,11,12,15},{1,8,10,11,13},{1,8,10,11,13,14},{1,8,10,11,13,14,15},{1,8,10,11,13,15},{1,8,10,11,14},{1,8,10,11,14,15},{1,8,10,11,15},{1,8,10,12},{1,8,10,12,13},{1,8,10,12,13,14},{1,8,10,12,13,14,15},{1,8,10,12,13,15},{1,8,10,12,14},{1,8,10,12,14,15},{1,8,10,12,15},{1,8,10,13},{1,8,10,13,14},{1,8,10,13,14,15},{1,8,10,13,15},{1,8,10,14},{1,8,10,14,15},{1,8,10,15},{1,8,11},{1,8,11,12},{1,8,11,12,13},{1,8,11,12,13,14},{1,8,11,12,13,14,15},{1,8,11,12,13,15},{1,8,11,12,14},{1,8,11,12,14,15},{1,8,11,12,15},{1,8,11,13},{1,8,11,13,14},{1,8,11,13,14,15},{1,8,11,13,15},{1,8,11,14},{1,8,11,14,15},{1,8,11,15},{1,8,12},{1,8,12,13},{1,8,12,13,14},{1,8,12,13,14,15},{1,8,12,13,15},{1,8,12,14},{1,8,12,14,15},{1,8,12,15},{1,8,13},{1,8,13,14},{1,8,13,14,15},{1,8,13,15},{1,8,14},{1,8,14,15},{1,8,15},{1,9},{1,9,10},{1,9,10,11},{1,9,10,11,12},{1,9,10,11,12,13},{1,9,10,11,12,13,14},{1,9,10,11,12,13,14,15},{1,9,10,11,12,13,15},{1,9,10,11,12,14},{1,9,10,11,12,14,15},{1,9,10,11,12,15},{1,9,10,11,13},{1,9,10,11,13,14},{1,9,10,11,13,14,15},{1,9,10,11,13,15},{1,9,10,11,14},{1,9,10,11,14,15},{1,9,10,11,15},{1,9,10,12},{1,9,10,12,13},{1,9,10,12,13,14},{1,9,10,12,13,14,15},{1,9,10,12,13,15},{1,9,10,12,14},{1,9,10,12,14,15},{1,9,10,12,15},{1,9,10,13},{1,9,10,13,14},{1,9,10,13,14,15},{1,9,10,13,15},{1,9,10,14},{1,9,10,14,15},{1,9,10,15},{1,9,11},{1,9,11,12},{1,9,11,12,13},{1,9,11,12,13,14},{1,9,11,12,13,14,15},{1,9,11,12,13,15},{1,9,11,12,14},{1,9,11,12,14,15},{1,9,11,12,15},{1,9,11,13},{1,9,11,13,14},{1,9,11,13,14,15},{1,9,11,13,15},{1,9,11,14},{1,9,11,14,15},{1,9,11,15},{1,9,12},{1,9,12,13},{1,9,12,13,14},{1,9,12,13,14,15},{1,9,12,13,15},{1,9,12,14},{1,9,12,14,15},{1,9,12,15},{1,9,13},{1,9,13,14},{1,9,13,14,15},{1,9,13,15},{1,9,14},{1,9,14,15},{1,9,15},{1,10},{1,10,11},{1,10,11,12},{1,10,11,12,13},{1,10,11,12,13,14},{1,10,11,12,13,14,15},{1,10,11,12,13,15},{1,10,11,12,14},{1,10,11,12,14,15},{1,10,11,12,15},{1,10,11,13},{1,10,11,13,14},{1,10,11,13,14,15},{1,10,11,13,15},{1,10,11,14},{1,10,11,14,15},{1,10,11,15},{1,10,12},{1,10,12,13},{1,10,12,13,14},{1,10,12,13,14,15},{1,10,12,13,15},{1,10,12,14},{1,10,12,14,15},{1,10,12,15},{1,10,13},{1,10,13,14},{1,10,13,14,15},{1,10,13,15},{1,10,14},{1,10,14,15},{1,10,15},{1,11},{1,11,12},{1,11,12,13},{1,11,12,13,14},{1,11,12,13,14,15},{1,11,12,13,15},{1,11,12,14},{1,11,12,14,15},{1,11,12,15},{1,11,13},{1,11,13,14},{1,11,13,14,15},{1,11,13,15},{1,11,14},{1,11,14,15},{1,11,15},{1,12},{1,12,13},{1,12,13,14},{1,12,13,14,15},{1,12,13,15},{1,12,14},{1,12,14,15},{1,12,15},{1,13},{1,13,14},{1,13,14,15},{1,13,15},{1,14},{1,14,15},{1,15},{2,3},{2,3,4},{2,3,4,5},{2,3,4,5,6},{2,3,4,5,6,7},{2,3,4,5,6,7,8},{2,3,4,5,6,7,8,9},{2,3,4,5,6,7,8,9,10},{2,3,4,5,6,7,8,9,10,11},{2,3,4,5,6,7,8,9,10,11,12},{2,3,4,5,6,7,8,9,10,11,12,13},{2,3,4,5,6,7,8,9,10,11,12,13,14},{2,3,4,5,6,7,8,9,10,11,12,13,14,15},{2,3,4,5,6,7,8,9,10,11,12,13,15},{2,3,4,5,6,7,8,9,10,11,12,14},{2,3,4,5,6,7,8,9,10,11,12,14,15},{2,3,4,5,6,7,8,9,10,11,12,15},{2,3,4,5,6,7,8,9,10,11,13},{2,3,4,5,6,7,8,9,10,11,13,14},{2,3,4,5,6,7,8,9,10,11,13,14,15},{2,3,4,5,6,7,8,9,10,11,13,15},{2,3,4,5,6,7,8,9,10,11,14},{2,3,4,5,6,7,8,9,10,11,14,15},{2,3,4,5,6,7,8,9,10,11,15},{2,3,4,5,6,7,8,9,10,12},{2,3,4,5,6,7,8,9,10,12,13},{2,3,4,5,6,7,8,9,10,12,13,14},{2,3,4,5,6,7,8,9,10,12,13,14,15},{2,3,4,5,6,7,8,9,10,12,13,15},{2,3,4,5,6,7,8,9,10,12,14},{2,3,4,5,6,7,8,9,10,12,14,15},{2,3,4,5,6,7,8,9,10,12,15},{2,3,4,5,6,7,8,9,10,13},{2,3,4,5,6,7,8,9,10,13,14},{2,3,4,5,6,7,8,9,10,13,14,15},{2,3,4,5,6,7,8,9,10,13,15},{2,3,4,5,6,7,8,9,10,14},{2,3,4,5,6,7,8,9,10,14,15},{2,3,4,5,6,7,8,9,10,15},{2,3,4,5,6,7,8,9,11},{2,3,4,5,6,7,8,9,11,12},{2,3,4,5,6,7,8,9,11,12,13},{2,3,4,5,6,7,8,9,11,12,13,14},{2,3,4,5,6,7,8,9,11,12,13,14,15},{2,3,4,5,6,7,8,9,11,12,13,15},{2,3,4,5,6,7,8,9,11,12,14},{2,3,4,5,6,7,8,9,11,12,14,15},{2,3,4,5,6,7,8,9,11,12,15},{2,3,4,5,6,7,8,9,11,13},{2,3,4,5,6,7,8,9,11,13,14},{2,3,4,5,6,7,8,9,11,13,14,15},{2,3,4,5,6,7,8,9,11,13,15},{2,3,4,5,6,7,8,9,11,14},{2,3,4,5,6,7,8,9,11,14,15},{2,3,4,5,6,7,8,9,11,15},{2,3,4,5,6,7,8,9,12},{2,3,4,5,6,7,8,9,12,13},{2,3,4,5,6,7,8,9,12,13,14},{2,3,4,5,6,7,8,9,12,13,14,15},{2,3,4,5,6,7,8,9,12,13,15},{2,3,4,5,6,7,8,9,12,14},{2,3,4,5,6,7,8,9,12,14,15},{2,3,4,5,6,7,8,9,12,15},{2,3,4,5,6,7,8,9,13},{2,3,4,5,6,7,8,9,13,14},{2,3,4,5,6,7,8,9,13,14,15},{2,3,4,5,6,7,8,9,13,15},{2,3,4,5,6,7,8,9,14},{2,3,4,5,6,7,8,9,14,15},{2,3,4,5,6,7,8,9,15},{2,3,4,5,6,7,8,10},{2,3,4,5,6,7,8,10,11},{2,3,4,5,6,7,8,10,11,12},{2,3,4,5,6,7,8,10,11,12,13},{2,3,4,5,6,7,8,10,11,12,13,14},{2,3,4,5,6,7,8,10,11,12,13,14,15},{2,3,4,5,6,7,8,10,11,12,13,15},{2,3,4,5,6,7,8,10,11,12,14},{2,3,4,5,6,7,8,10,11,12,14,15},{2,3,4,5,6,7,8,10,11,12,15},{2,3,4,5,6,7,8,10,11,13},{2,3,4,5,6,7,8,10,11,13,14},{2,3,4,5,6,7,8,10,11,13,14,15},{2,3,4,5,6,7,8,10,11,13,15},{2,3,4,5,6,7,8,10,11,14},{2,3,4,5,6,7,8,10,11,14,15},{2,3,4,5,6,7,8,10,11,15},{2,3,4,5,6,7,8,10,12},{2,3,4,5,6,7,8,10,12,13},{2,3,4,5,6,7,8,10,12,13,14},{2,3,4,5,6,7,8,10,12,13,14,15},{2,3,4,5,6,7,8,10,12,13,15},{2,3,4,5,6,7,8,10,12,14},{2,3,4,5,6,7,8,10,12,14,15},{2,3,4,5,6,7,8,10,12,15},{2,3,4,5,6,7,8,10,13},{2,3,4,5,6,7,8,10,13,14},{2,3,4,5,6,7,8,10,13,14,15},{2,3,4,5,6,7,8,10,13,15},{2,3,4,5,6,7,8,10,14},{2,3,4,5,6,7,8,10,14,15},{2,3,4,5,6,7,8,10,15},{2,3,4,5,6,7,8,11},{2,3,4,5,6,7,8,11,12},{2,3,4,5,6,7,8,11,12,13},{2,3,4,5,6,7,8,11,12,13,14},{2,3,4,5,6,7,8,11,12,13,14,15},{2,3,4,5,6,7,8,11,12,13,15},{2,3,4,5,6,7,8,11,12,14},{2,3,4,5,6,7,8,11,12,14,15},{2,3,4,5,6,7,8,11,12,15},{2,3,4,5,6,7,8,11,13},{2,3,4,5,6,7,8,11,13,14},{2,3,4,5,6,7,8,11,13,14,15},{2,3,4,5,6,7,8,11,13,15},{2,3,4,5,6,7,8,11,14},{2,3,4,5,6,7,8,11,14,15},{2,3,4,5,6,7,8,11,15},{2,3,4,5,6,7,8,12},{2,3,4,5,6,7,8,12,13},{2,3,4,5,6,7,8,12,13,14},{2,3,4,5,6,7,8,12,13,14,15},{2,3,4,5,6,7,8,12,13,15},{2,3,4,5,6,7,8,12,14},{2,3,4,5,6,7,8,12,14,15},{2,3,4,5,6,7,8,12,15},{2,3,4,5,6,7,8,13},{2,3,4,5,6,7,8,13,14},{2,3,4,5,6,7,8,13,14,15},{2,3,4,5,6,7,8,13,15},{2,3,4,5,6,7,8,14},{2,3,4,5,6,7,8,14,15},{2,3,4,5,6,7,8,15},{2,3,4,5,6,7,9},{2,3,4,5,6,7,9,10},{2,3,4,5,6,7,9,10,11},{2,3,4,5,6,7,9,10,11,12},{2,3,4,5,6,7,9,10,11,12,13},{2,3,4,5,6,7,9,10,11,12,13,14},{2,3,4,5,6,7,9,10,11,12,13,14,15},{2,3,4,5,6,7,9,10,11,12,13,15},{2,3,4,5,6,7,9,10,11,12,14},{2,3,4,5,6,7,9,10,11,12,14,15},{2,3,4,5,6,7,9,10,11,12,15},{2,3,4,5,6,7,9,10,11,13},{2,3,4,5,6,7,9,10,11,13,14},{2,3,4,5,6,7,9,10,11,13,14,15},{2,3,4,5,6,7,9,10,11,13,15},{2,3,4,5,6,7,9,10,11,14},{2,3,4,5,6,7,9,10,11,14,15},{2,3,4,5,6,7,9,10,11,15},{2,3,4,5,6,7,9,10,12},{2,3,4,5,6,7,9,10,12,13},{2,3,4,5,6,7,9,10,12,13,14},{2,3,4,5,6,7,9,10,12,13,14,15},{2,3,4,5,6,7,9,10,12,13,15},{2,3,4,5,6,7,9,10,12,14},{2,3,4,5,6,7,9,10,12,14,15},{2,3,4,5,6,7,9,10,12,15},{2,3,4,5,6,7,9,10,13},{2,3,4,5,6,7,9,10,13,14},{2,3,4,5,6,7,9,10,13,14,15},{2,3,4,5,6,7,9,10,13,15},{2,3,4,5,6,7,9,10,14},{2,3,4,5,6,7,9,10,14,15},{2,3,4,5,6,7,9,10,15},{2,3,4,5,6,7,9,11},{2,3,4,5,6,7,9,11,12},{2,3,4,5,6,7,9,11,12,13},{2,3,4,5,6,7,9,11,12,13,14},{2,3,4,5,6,7,9,11,12,13,14,15},{2,3,4,5,6,7,9,11,12,13,15},{2,3,4,5,6,7,9,11,12,14},{2,3,4,5,6,7,9,11,12,14,15},{2,3,4,5,6,7,9,11,12,15},{2,3,4,5,6,7,9,11,13},{2,3,4,5,6,7,9,11,13,14},{2,3,4,5,6,7,9,11,13,14,15},{2,3,4,5,6,7,9,11,13,15},{2,3,4,5,6,7,9,11,14},{2,3,4,5,6,7,9,11,14,15},{2,3,4,5,6,7,9,11,15},{2,3,4,5,6,7,9,12},{2,3,4,5,6,7,9,12,13},{2,3,4,5,6,7,9,12,13,14},{2,3,4,5,6,7,9,12,13,14,15},{2,3,4,5,6,7,9,12,13,15},{2,3,4,5,6,7,9,12,14},{2,3,4,5,6,7,9,12,14,15},{2,3,4,5,6,7,9,12,15},{2,3,4,5,6,7,9,13},{2,3,4,5,6,7,9,13,14},{2,3,4,5,6,7,9,13,14,15},{2,3,4,5,6,7,9,13,15},{2,3,4,5,6,7,9,14},{2,3,4,5,6,7,9,14,15},{2,3,4,5,6,7,9,15},{2,3,4,5,6,7,10},{2,3,4,5,6,7,10,11},{2,3,4,5,6,7,10,11,12},{2,3,4,5,6,7,10,11,12,13},{2,3,4,5,6,7,10,11,12,13,14},{2,3,4,5,6,7,10,11,12,13,14,15},{2,3,4,5,6,7,10,11,12,13,15},{2,3,4,5,6,7,10,11,12,14},{2,3,4,5,6,7,10,11,12,14,15},{2,3,4,5,6,7,10,11,12,15},{2,3,4,5,6,7,10,11,13},{2,3,4,5,6,7,10,11,13,14},{2,3,4,5,6,7,10,11,13,14,15},{2,3,4,5,6,7,10,11,13,15},{2,3,4,5,6,7,10,11,14},{2,3,4,5,6,7,10,11,14,15},{2,3,4,5,6,7,10,11,15},{2,3,4,5,6,7,10,12},{2,3,4,5,6,7,10,12,13},{2,3,4,5,6,7,10,12,13,14},{2,3,4,5,6,7,10,12,13,14,15},{2,3,4,5,6,7,10,12,13,15},{2,3,4,5,6,7,10,12,14},{2,3,4,5,6,7,10,12,14,15},{2,3,4,5,6,7,10,12,15},{2,3,4,5,6,7,10,13},{2,3,4,5,6,7,10,13,14},{2,3,4,5,6,7,10,13,14,15},{2,3,4,5,6,7,10,13,15},{2,3,4,5,6,7,10,14},{2,3,4,5,6,7,10,14,15},{2,3,4,5,6,7,10,15},{2,3,4,5,6,7,11},{2,3,4,5,6,7,11,12},{2,3,4,5,6,7,11,12,13},{2,3,4,5,6,7,11,12,13,14},{2,3,4,5,6,7,11,12,13,14,15},{2,3,4,5,6,7,11,12,13,15},{2,3,4,5,6,7,11,12,14},{2,3,4,5,6,7,11,12,14,15},{2,3,4,5,6,7,11,12,15},{2,3,4,5,6,7,11,13},{2,3,4,5,6,7,11,13,14},{2,3,4,5,6,7,11,13,14,15},{2,3,4,5,6,7,11,13,15},{2,3,4,5,6,7,11,14},{2,3,4,5,6,7,11,14,15},{2,3,4,5,6,7,11,15},{2,3,4,5,6,7,12},{2,3,4,5,6,7,12,13},{2,3,4,5,6,7,12,13,14},{2,3,4,5,6,7,12,13,14,15},{2,3,4,5,6,7,12,13,15},{2,3,4,5,6,7,12,14},{2,3,4,5,6,7,12,14,15},{2,3,4,5,6,7,12,15},{2,3,4,5,6,7,13},{2,3,4,5,6,7,13,14},{2,3,4,5,6,7,13,14,15},{2,3,4,5,6,7,13,15},{2,3,4,5,6,7,14},{2,3,4,5,6,7,14,15},{2,3,4,5,6,7,15},{2,3,4,5,6,8},{2,3,4,5,6,8,9},{2,3,4,5,6,8,9,10},{2,3,4,5,6,8,9,10,11},{2,3,4,5,6,8,9,10,11,12},{2,3,4,5,6,8,9,10,11,12,13},{2,3,4,5,6,8,9,10,11,12,13,14},{2,3,4,5,6,8,9,10,11,12,13,14,15},{2,3,4,5,6,8,9,10,11,12,13,15},{2,3,4,5,6,8,9,10,11,12,14},{2,3,4,5,6,8,9,10,11,12,14,15},{2,3,4,5,6,8,9,10,11,12,15},{2,3,4,5,6,8,9,10,11,13},{2,3,4,5,6,8,9,10,11,13,14},{2,3,4,5,6,8,9,10,11,13,14,15},{2,3,4,5,6,8,9,10,11,13,15},{2,3,4,5,6,8,9,10,11,14},{2,3,4,5,6,8,9,10,11,14,15},{2,3,4,5,6,8,9,10,11,15},{2,3,4,5,6,8,9,10,12},{2,3,4,5,6,8,9,10,12,13},{2,3,4,5,6,8,9,10,12,13,14},{2,3,4,5,6,8,9,10,12,13,14,15},{2,3,4,5,6,8,9,10,12,13,15},{2,3,4,5,6,8,9,10,12,14},{2,3,4,5,6,8,9,10,12,14,15},{2,3,4,5,6,8,9,10,12,15},{2,3,4,5,6,8,9,10,13},{2,3,4,5,6,8,9,10,13,14},{2,3,4,5,6,8,9,10,13,14,15},{2,3,4,5,6,8,9,10,13,15},{2,3,4,5,6,8,9,10,14},{2,3,4,5,6,8,9,10,14,15},{2,3,4,5,6,8,9,10,15},{2,3,4,5,6,8,9,11},{2,3,4,5,6,8,9,11,12},{2,3,4,5,6,8,9,11,12,13},{2,3,4,5,6,8,9,11,12,13,14},{2,3,4,5,6,8,9,11,12,13,14,15},{2,3,4,5,6,8,9,11,12,13,15},{2,3,4,5,6,8,9,11,12,14},{2,3,4,5,6,8,9,11,12,14,15},{2,3,4,5,6,8,9,11,12,15},{2,3,4,5,6,8,9,11,13},{2,3,4,5,6,8,9,11,13,14},{2,3,4,5,6,8,9,11,13,14,15},{2,3,4,5,6,8,9,11,13,15},{2,3,4,5,6,8,9,11,14},{2,3,4,5,6,8,9,11,14,15},{2,3,4,5,6,8,9,11,15},{2,3,4,5,6,8,9,12},{2,3,4,5,6,8,9,12,13},{2,3,4,5,6,8,9,12,13,14},{2,3,4,5,6,8,9,12,13,14,15},{2,3,4,5,6,8,9,12,13,15},{2,3,4,5,6,8,9,12,14},{2,3,4,5,6,8,9,12,14,15},{2,3,4,5,6,8,9,12,15},{2,3,4,5,6,8,9,13},{2,3,4,5,6,8,9,13,14},{2,3,4,5,6,8,9,13,14,15},{2,3,4,5,6,8,9,13,15},{2,3,4,5,6,8,9,14},{2,3,4,5,6,8,9,14,15},{2,3,4,5,6,8,9,15},{2,3,4,5,6,8,10},{2,3,4,5,6,8,10,11},{2,3,4,5,6,8,10,11,12},{2,3,4,5,6,8,10,11,12,13},{2,3,4,5,6,8,10,11,12,13,14},{2,3,4,5,6,8,10,11,12,13,14,15},{2,3,4,5,6,8,10,11,12,13,15},{2,3,4,5,6,8,10,11,12,14},{2,3,4,5,6,8,10,11,12,14,15},{2,3,4,5,6,8,10,11,12,15},{2,3,4,5,6,8,10,11,13},{2,3,4,5,6,8,10,11,13,14},{2,3,4,5,6,8,10,11,13,14,15},{2,3,4,5,6,8,10,11,13,15},{2,3,4,5,6,8,10,11,14},{2,3,4,5,6,8,10,11,14,15},{2,3,4,5,6,8,10,11,15},{2,3,4,5,6,8,10,12},{2,3,4,5,6,8,10,12,13},{2,3,4,5,6,8,10,12,13,14},{2,3,4,5,6,8,10,12,13,14,15},{2,3,4,5,6,8,10,12,13,15},{2,3,4,5,6,8,10,12,14},{2,3,4,5,6,8,10,12,14,15},{2,3,4,5,6,8,10,12,15},{2,3,4,5,6,8,10,13},{2,3,4,5,6,8,10,13,14},{2,3,4,5,6,8,10,13,14,15},{2,3,4,5,6,8,10,13,15},{2,3,4,5,6,8,10,14},{2,3,4,5,6,8,10,14,15},{2,3,4,5,6,8,10,15},{2,3,4,5,6,8,11},{2,3,4,5,6,8,11,12},{2,3,4,5,6,8,11,12,13},{2,3,4,5,6,8,11,12,13,14},{2,3,4,5,6,8,11,12,13,14,15},{2,3,4,5,6,8,11,12,13,15},{2,3,4,5,6,8,11,12,14},{2,3,4,5,6,8,11,12,14,15},{2,3,4,5,6,8,11,12,15},{2,3,4,5,6,8,11,13},{2,3,4,5,6,8,11,13,14},{2,3,4,5,6,8,11,13,14,15},{2,3,4,5,6,8,11,13,15},{2,3,4,5,6,8,11,14},{2,3,4,5,6,8,11,14,15},{2,3,4,5,6,8,11,15},{2,3,4,5,6,8,12},{2,3,4,5,6,8,12,13},{2,3,4,5,6,8,12,13,14},{2,3,4,5,6,8,12,13,14,15},{2,3,4,5,6,8,12,13,15},{2,3,4,5,6,8,12,14},{2,3,4,5,6,8,12,14,15},{2,3,4,5,6,8,12,15},{2,3,4,5,6,8,13},{2,3,4,5,6,8,13,14},{2,3,4,5,6,8,13,14,15},{2,3,4,5,6,8,13,15},{2,3,4,5,6,8,14},{2,3,4,5,6,8,14,15},{2,3,4,5,6,8,15},{2,3,4,5,6,9},{2,3,4,5,6,9,10},{2,3,4,5,6,9,10,11},{2,3,4,5,6,9,10,11,12},{2,3,4,5,6,9,10,11,12,13},{2,3,4,5,6,9,10,11,12,13,14},{2,3,4,5,6,9,10,11,12,13,14,15},{2,3,4,5,6,9,10,11,12,13,15},{2,3,4,5,6,9,10,11,12,14},{2,3,4,5,6,9,10,11,12,14,15},{2,3,4,5,6,9,10,11,12,15},{2,3,4,5,6,9,10,11,13},{2,3,4,5,6,9,10,11,13,14},{2,3,4,5,6,9,10,11,13,14,15},{2,3,4,5,6,9,10,11,13,15},{2,3,4,5,6,9,10,11,14},{2,3,4,5,6,9,10,11,14,15},{2,3,4,5,6,9,10,11,15},{2,3,4,5,6,9,10,12},{2,3,4,5,6,9,10,12,13},{2,3,4,5,6,9,10,12,13,14},{2,3,4,5,6,9,10,12,13,14,15},{2,3,4,5,6,9,10,12,13,15},{2,3,4,5,6,9,10,12,14},{2,3,4,5,6,9,10,12,14,15},{2,3,4,5,6,9,10,12,15},{2,3,4,5,6,9,10,13},{2,3,4,5,6,9,10,13,14},{2,3,4,5,6,9,10,13,14,15},{2,3,4,5,6,9,10,13,15},{2,3,4,5,6,9,10,14},{2,3,4,5,6,9,10,14,15},{2,3,4,5,6,9,10,15},{2,3,4,5,6,9,11},{2,3,4,5,6,9,11,12},{2,3,4,5,6,9,11,12,13},{2,3,4,5,6,9,11,12,13,14},{2,3,4,5,6,9,11,12,13,14,15},{2,3,4,5,6,9,11,12,13,15},{2,3,4,5,6,9,11,12,14},{2,3,4,5,6,9,11,12,14,15},{2,3,4,5,6,9,11,12,15},{2,3,4,5,6,9,11,13},{2,3,4,5,6,9,11,13,14},{2,3,4,5,6,9,11,13,14,15},{2,3,4,5,6,9,11,13,15},{2,3,4,5,6,9,11,14},{2,3,4,5,6,9,11,14,15},{2,3,4,5,6,9,11,15},{2,3,4,5,6,9,12},{2,3,4,5,6,9,12,13},{2,3,4,5,6,9,12,13,14},{2,3,4,5,6,9,12,13,14,15},{2,3,4,5,6,9,12,13,15},{2,3,4,5,6,9,12,14},{2,3,4,5,6,9,12,14,15},{2,3,4,5,6,9,12,15},{2,3,4,5,6,9,13},{2,3,4,5,6,9,13,14},{2,3,4,5,6,9,13,14,15},{2,3,4,5,6,9,13,15},{2,3,4,5,6,9,14},{2,3,4,5,6,9,14,15},{2,3,4,5,6,9,15},{2,3,4,5,6,10},{2,3,4,5,6,10,11},{2,3,4,5,6,10,11,12},{2,3,4,5,6,10,11,12,13},{2,3,4,5,6,10,11,12,13,14},{2,3,4,5,6,10,11,12,13,14,15},{2,3,4,5,6,10,11,12,13,15},{2,3,4,5,6,10,11,12,14},{2,3,4,5,6,10,11,12,14,15},{2,3,4,5,6,10,11,12,15},{2,3,4,5,6,10,11,13},{2,3,4,5,6,10,11,13,14},{2,3,4,5,6,10,11,13,14,15},{2,3,4,5,6,10,11,13,15},{2,3,4,5,6,10,11,14},{2,3,4,5,6,10,11,14,15},{2,3,4,5,6,10,11,15},{2,3,4,5,6,10,12},{2,3,4,5,6,10,12,13},{2,3,4,5,6,10,12,13,14},{2,3,4,5,6,10,12,13,14,15},{2,3,4,5,6,10,12,13,15},{2,3,4,5,6,10,12,14},{2,3,4,5,6,10,12,14,15},{2,3,4,5,6,10,12,15},{2,3,4,5,6,10,13},{2,3,4,5,6,10,13,14},{2,3,4,5,6,10,13,14,15},{2,3,4,5,6,10,13,15},{2,3,4,5,6,10,14},{2,3,4,5,6,10,14,15},{2,3,4,5,6,10,15},{2,3,4,5,6,11},{2,3,4,5,6,11,12},{2,3,4,5,6,11,12,13},{2,3,4,5,6,11,12,13,14},{2,3,4,5,6,11,12,13,14,15},{2,3,4,5,6,11,12,13,15},{2,3,4,5,6,11,12,14},{2,3,4,5,6,11,12,14,15},{2,3,4,5,6,11,12,15},{2,3,4,5,6,11,13},{2,3,4,5,6,11,13,14},{2,3,4,5,6,11,13,14,15},{2,3,4,5,6,11,13,15},{2,3,4,5,6,11,14},{2,3,4,5,6,11,14,15},{2,3,4,5,6,11,15},{2,3,4,5,6,12},{2,3,4,5,6,12,13},{2,3,4,5,6,12,13,14},{2,3,4,5,6,12,13,14,15},{2,3,4,5,6,12,13,15},{2,3,4,5,6,12,14},{2,3,4,5,6,12,14,15},{2,3,4,5,6,12,15},{2,3,4,5,6,13},{2,3,4,5,6,13,14},{2,3,4,5,6,13,14,15},{2,3,4,5,6,13,15},{2,3,4,5,6,14},{2,3,4,5,6,14,15},{2,3,4,5,6,15},{2,3,4,5,7},{2,3,4,5,7,8},{2,3,4,5,7,8,9},{2,3,4,5,7,8,9,10},{2,3,4,5,7,8,9,10,11},{2,3,4,5,7,8,9,10,11,12},{2,3,4,5,7,8,9,10,11,12,13},{2,3,4,5,7,8,9,10,11,12,13,14},{2,3,4,5,7,8,9,10,11,12,13,14,15},{2,3,4,5,7,8,9,10,11,12,13,15},{2,3,4,5,7,8,9,10,11,12,14},{2,3,4,5,7,8,9,10,11,12,14,15},{2,3,4,5,7,8,9,10,11,12,15},{2,3,4,5,7,8,9,10,11,13},{2,3,4,5,7,8,9,10,11,13,14},{2,3,4,5,7,8,9,10,11,13,14,15},{2,3,4,5,7,8,9,10,11,13,15},{2,3,4,5,7,8,9,10,11,14},{2,3,4,5,7,8,9,10,11,14,15},{2,3,4,5,7,8,9,10,11,15},{2,3,4,5,7,8,9,10,12},{2,3,4,5,7,8,9,10,12,13},{2,3,4,5,7,8,9,10,12,13,14},{2,3,4,5,7,8,9,10,12,13,14,15},{2,3,4,5,7,8,9,10,12,13,15},{2,3,4,5,7,8,9,10,12,14},{2,3,4,5,7,8,9,10,12,14,15},{2,3,4,5,7,8,9,10,12,15},{2,3,4,5,7,8,9,10,13},{2,3,4,5,7,8,9,10,13,14},{2,3,4,5,7,8,9,10,13,14,15},{2,3,4,5,7,8,9,10,13,15},{2,3,4,5,7,8,9,10,14},{2,3,4,5,7,8,9,10,14,15},{2,3,4,5,7,8,9,10,15},{2,3,4,5,7,8,9,11},{2,3,4,5,7,8,9,11,12},{2,3,4,5,7,8,9,11,12,13},{2,3,4,5,7,8,9,11,12,13,14},{2,3,4,5,7,8,9,11,12,13,14,15},{2,3,4,5,7,8,9,11,12,13,15},{2,3,4,5,7,8,9,11,12,14},{2,3,4,5,7,8,9,11,12,14,15},{2,3,4,5,7,8,9,11,12,15},{2,3,4,5,7,8,9,11,13},{2,3,4,5,7,8,9,11,13,14},{2,3,4,5,7,8,9,11,13,14,15},{2,3,4,5,7,8,9,11,13,15},{2,3,4,5,7,8,9,11,14},{2,3,4,5,7,8,9,11,14,15},{2,3,4,5,7,8,9,11,15},{2,3,4,5,7,8,9,12},{2,3,4,5,7,8,9,12,13},{2,3,4,5,7,8,9,12,13,14},{2,3,4,5,7,8,9,12,13,14,15},{2,3,4,5,7,8,9,12,13,15},{2,3,4,5,7,8,9,12,14},{2,3,4,5,7,8,9,12,14,15},{2,3,4,5,7,8,9,12,15},{2,3,4,5,7,8,9,13},{2,3,4,5,7,8,9,13,14},{2,3,4,5,7,8,9,13,14,15},{2,3,4,5,7,8,9,13,15},{2,3,4,5,7,8,9,14},{2,3,4,5,7,8,9,14,15},{2,3,4,5,7,8,9,15},{2,3,4,5,7,8,10},{2,3,4,5,7,8,10,11},{2,3,4,5,7,8,10,11,12},{2,3,4,5,7,8,10,11,12,13},{2,3,4,5,7,8,10,11,12,13,14},{2,3,4,5,7,8,10,11,12,13,14,15},{2,3,4,5,7,8,10,11,12,13,15},{2,3,4,5,7,8,10,11,12,14},{2,3,4,5,7,8,10,11,12,14,15},{2,3,4,5,7,8,10,11,12,15},{2,3,4,5,7,8,10,11,13},{2,3,4,5,7,8,10,11,13,14},{2,3,4,5,7,8,10,11,13,14,15},{2,3,4,5,7,8,10,11,13,15},{2,3,4,5,7,8,10,11,14},{2,3,4,5,7,8,10,11,14,15},{2,3,4,5,7,8,10,11,15},{2,3,4,5,7,8,10,12},{2,3,4,5,7,8,10,12,13},{2,3,4,5,7,8,10,12,13,14},{2,3,4,5,7,8,10,12,13,14,15},{2,3,4,5,7,8,10,12,13,15},{2,3,4,5,7,8,10,12,14},{2,3,4,5,7,8,10,12,14,15},{2,3,4,5,7,8,10,12,15},{2,3,4,5,7,8,10,13},{2,3,4,5,7,8,10,13,14},{2,3,4,5,7,8,10,13,14,15},{2,3,4,5,7,8,10,13,15},{2,3,4,5,7,8,10,14},{2,3,4,5,7,8,10,14,15},{2,3,4,5,7,8,10,15},{2,3,4,5,7,8,11},{2,3,4,5,7,8,11,12},{2,3,4,5,7,8,11,12,13},{2,3,4,5,7,8,11,12,13,14},{2,3,4,5,7,8,11,12,13,14,15},{2,3,4,5,7,8,11,12,13,15},{2,3,4,5,7,8,11,12,14},{2,3,4,5,7,8,11,12,14,15},{2,3,4,5,7,8,11,12,15},{2,3,4,5,7,8,11,13},{2,3,4,5,7,8,11,13,14},{2,3,4,5,7,8,11,13,14,15},{2,3,4,5,7,8,11,13,15},{2,3,4,5,7,8,11,14},{2,3,4,5,7,8,11,14,15},{2,3,4,5,7,8,11,15},{2,3,4,5,7,8,12},{2,3,4,5,7,8,12,13},{2,3,4,5,7,8,12,13,14},{2,3,4,5,7,8,12,13,14,15},{2,3,4,5,7,8,12,13,15},{2,3,4,5,7,8,12,14},{2,3,4,5,7,8,12,14,15},{2,3,4,5,7,8,12,15},{2,3,4,5,7,8,13},{2,3,4,5,7,8,13,14},{2,3,4,5,7,8,13,14,15},{2,3,4,5,7,8,13,15},{2,3,4,5,7,8,14},{2,3,4,5,7,8,14,15},{2,3,4,5,7,8,15},{2,3,4,5,7,9},{2,3,4,5,7,9,10},{2,3,4,5,7,9,10,11},{2,3,4,5,7,9,10,11,12},{2,3,4,5,7,9,10,11,12,13},{2,3,4,5,7,9,10,11,12,13,14},{2,3,4,5,7,9,10,11,12,13,14,15},{2,3,4,5,7,9,10,11,12,13,15},{2,3,4,5,7,9,10,11,12,14},{2,3,4,5,7,9,10,11,12,14,15},{2,3,4,5,7,9,10,11,12,15},{2,3,4,5,7,9,10,11,13},{2,3,4,5,7,9,10,11,13,14},{2,3,4,5,7,9,10,11,13,14,15},{2,3,4,5,7,9,10,11,13,15},{2,3,4,5,7,9,10,11,14},{2,3,4,5,7,9,10,11,14,15},{2,3,4,5,7,9,10,11,15},{2,3,4,5,7,9,10,12},{2,3,4,5,7,9,10,12,13},{2,3,4,5,7,9,10,12,13,14},{2,3,4,5,7,9,10,12,13,14,15},{2,3,4,5,7,9,10,12,13,15},{2,3,4,5,7,9,10,12,14},{2,3,4,5,7,9,10,12,14,15},{2,3,4,5,7,9,10,12,15},{2,3,4,5,7,9,10,13},{2,3,4,5,7,9,10,13,14},{2,3,4,5,7,9,10,13,14,15},{2,3,4,5,7,9,10,13,15},{2,3,4,5,7,9,10,14},{2,3,4,5,7,9,10,14,15},{2,3,4,5,7,9,10,15},{2,3,4,5,7,9,11},{2,3,4,5,7,9,11,12},{2,3,4,5,7,9,11,12,13},{2,3,4,5,7,9,11,12,13,14},{2,3,4,5,7,9,11,12,13,14,15},{2,3,4,5,7,9,11,12,13,15},{2,3,4,5,7,9,11,12,14},{2,3,4,5,7,9,11,12,14,15},{2,3,4,5,7,9,11,12,15},{2,3,4,5,7,9,11,13},{2,3,4,5,7,9,11,13,14},{2,3,4,5,7,9,11,13,14,15},{2,3,4,5,7,9,11,13,15},{2,3,4,5,7,9,11,14},{2,3,4,5,7,9,11,14,15},{2,3,4,5,7,9,11,15},{2,3,4,5,7,9,12},{2,3,4,5,7,9,12,13},{2,3,4,5,7,9,12,13,14},{2,3,4,5,7,9,12,13,14,15},{2,3,4,5,7,9,12,13,15},{2,3,4,5,7,9,12,14},{2,3,4,5,7,9,12,14,15},{2,3,4,5,7,9,12,15},{2,3,4,5,7,9,13},{2,3,4,5,7,9,13,14},{2,3,4,5,7,9,13,14,15},{2,3,4,5,7,9,13,15},{2,3,4,5,7,9,14},{2,3,4,5,7,9,14,15},{2,3,4,5,7,9,15},{2,3,4,5,7,10},{2,3,4,5,7,10,11},{2,3,4,5,7,10,11,12},{2,3,4,5,7,10,11,12,13},{2,3,4,5,7,10,11,12,13,14},{2,3,4,5,7,10,11,12,13,14,15},{2,3,4,5,7,10,11,12,13,15},{2,3,4,5,7,10,11,12,14},{2,3,4,5,7,10,11,12,14,15},{2,3,4,5,7,10,11,12,15},{2,3,4,5,7,10,11,13},{2,3,4,5,7,10,11,13,14},{2,3,4,5,7,10,11,13,14,15},{2,3,4,5,7,10,11,13,15},{2,3,4,5,7,10,11,14},{2,3,4,5,7,10,11,14,15},{2,3,4,5,7,10,11,15},{2,3,4,5,7,10,12},{2,3,4,5,7,10,12,13},{2,3,4,5,7,10,12,13,14},{2,3,4,5,7,10,12,13,14,15},{2,3,4,5,7,10,12,13,15},{2,3,4,5,7,10,12,14},{2,3,4,5,7,10,12,14,15},{2,3,4,5,7,10,12,15},{2,3,4,5,7,10,13},{2,3,4,5,7,10,13,14},{2,3,4,5,7,10,13,14,15},{2,3,4,5,7,10,13,15},{2,3,4,5,7,10,14},{2,3,4,5,7,10,14,15},{2,3,4,5,7,10,15},{2,3,4,5,7,11},{2,3,4,5,7,11,12},{2,3,4,5,7,11,12,13},{2,3,4,5,7,11,12,13,14},{2,3,4,5,7,11,12,13,14,15},{2,3,4,5,7,11,12,13,15},{2,3,4,5,7,11,12,14},{2,3,4,5,7,11,12,14,15},{2,3,4,5,7,11,12,15},{2,3,4,5,7,11,13},{2,3,4,5,7,11,13,14},{2,3,4,5,7,11,13,14,15},{2,3,4,5,7,11,13,15},{2,3,4,5,7,11,14},{2,3,4,5,7,11,14,15},{2,3,4,5,7,11,15},{2,3,4,5,7,12},{2,3,4,5,7,12,13},{2,3,4,5,7,12,13,14},{2,3,4,5,7,12,13,14,15},{2,3,4,5,7,12,13,15},{2,3,4,5,7,12,14},{2,3,4,5,7,12,14,15},{2,3,4,5,7,12,15},{2,3,4,5,7,13},{2,3,4,5,7,13,14},{2,3,4,5,7,13,14,15},{2,3,4,5,7,13,15},{2,3,4,5,7,14},{2,3,4,5,7,14,15},{2,3,4,5,7,15},{2,3,4,5,8},{2,3,4,5,8,9},{2,3,4,5,8,9,10},{2,3,4,5,8,9,10,11},{2,3,4,5,8,9,10,11,12},{2,3,4,5,8,9,10,11,12,13},{2,3,4,5,8,9,10,11,12,13,14},{2,3,4,5,8,9,10,11,12,13,14,15},{2,3,4,5,8,9,10,11,12,13,15},{2,3,4,5,8,9,10,11,12,14},{2,3,4,5,8,9,10,11,12,14,15},{2,3,4,5,8,9,10,11,12,15},{2,3,4,5,8,9,10,11,13},{2,3,4,5,8,9,10,11,13,14},{2,3,4,5,8,9,10,11,13,14,15},{2,3,4,5,8,9,10,11,13,15},{2,3,4,5,8,9,10,11,14},{2,3,4,5,8,9,10,11,14,15},{2,3,4,5,8,9,10,11,15},{2,3,4,5,8,9,10,12},{2,3,4,5,8,9,10,12,13},{2,3,4,5,8,9,10,12,13,14},{2,3,4,5,8,9,10,12,13,14,15},{2,3,4,5,8,9,10,12,13,15},{2,3,4,5,8,9,10,12,14},{2,3,4,5,8,9,10,12,14,15},{2,3,4,5,8,9,10,12,15},{2,3,4,5,8,9,10,13},{2,3,4,5,8,9,10,13,14},{2,3,4,5,8,9,10,13,14,15},{2,3,4,5,8,9,10,13,15},{2,3,4,5,8,9,10,14},{2,3,4,5,8,9,10,14,15},{2,3,4,5,8,9,10,15},{2,3,4,5,8,9,11},{2,3,4,5,8,9,11,12},{2,3,4,5,8,9,11,12,13},{2,3,4,5,8,9,11,12,13,14},{2,3,4,5,8,9,11,12,13,14,15},{2,3,4,5,8,9,11,12,13,15},{2,3,4,5,8,9,11,12,14},{2,3,4,5,8,9,11,12,14,15},{2,3,4,5,8,9,11,12,15},{2,3,4,5,8,9,11,13},{2,3,4,5,8,9,11,13,14},{2,3,4,5,8,9,11,13,14,15},{2,3,4,5,8,9,11,13,15},{2,3,4,5,8,9,11,14},{2,3,4,5,8,9,11,14,15},{2,3,4,5,8,9,11,15},{2,3,4,5,8,9,12},{2,3,4,5,8,9,12,13},{2,3,4,5,8,9,12,13,14},{2,3,4,5,8,9,12,13,14,15},{2,3,4,5,8,9,12,13,15},{2,3,4,5,8,9,12,14},{2,3,4,5,8,9,12,14,15},{2,3,4,5,8,9,12,15},{2,3,4,5,8,9,13},{2,3,4,5,8,9,13,14},{2,3,4,5,8,9,13,14,15},{2,3,4,5,8,9,13,15},{2,3,4,5,8,9,14},{2,3,4,5,8,9,14,15},{2,3,4,5,8,9,15},{2,3,4,5,8,10},{2,3,4,5,8,10,11},{2,3,4,5,8,10,11,12},{2,3,4,5,8,10,11,12,13},{2,3,4,5,8,10,11,12,13,14},{2,3,4,5,8,10,11,12,13,14,15},{2,3,4,5,8,10,11,12,13,15},{2,3,4,5,8,10,11,12,14},{2,3,4,5,8,10,11,12,14,15},{2,3,4,5,8,10,11,12,15},{2,3,4,5,8,10,11,13},{2,3,4,5,8,10,11,13,14},{2,3,4,5,8,10,11,13,14,15},{2,3,4,5,8,10,11,13,15},{2,3,4,5,8,10,11,14},{2,3,4,5,8,10,11,14,15},{2,3,4,5,8,10,11,15},{2,3,4,5,8,10,12},{2,3,4,5,8,10,12,13},{2,3,4,5,8,10,12,13,14},{2,3,4,5,8,10,12,13,14,15},{2,3,4,5,8,10,12,13,15},{2,3,4,5,8,10,12,14},{2,3,4,5,8,10,12,14,15},{2,3,4,5,8,10,12,15},{2,3,4,5,8,10,13},{2,3,4,5,8,10,13,14},{2,3,4,5,8,10,13,14,15},{2,3,4,5,8,10,13,15},{2,3,4,5,8,10,14},{2,3,4,5,8,10,14,15},{2,3,4,5,8,10,15},{2,3,4,5,8,11},{2,3,4,5,8,11,12},{2,3,4,5,8,11,12,13},{2,3,4,5,8,11,12,13,14},{2,3,4,5,8,11,12,13,14,15},{2,3,4,5,8,11,12,13,15},{2,3,4,5,8,11,12,14},{2,3,4,5,8,11,12,14,15},{2,3,4,5,8,11,12,15},{2,3,4,5,8,11,13},{2,3,4,5,8,11,13,14},{2,3,4,5,8,11,13,14,15},{2,3,4,5,8,11,13,15},{2,3,4,5,8,11,14},{2,3,4,5,8,11,14,15},{2,3,4,5,8,11,15},{2,3,4,5,8,12},{2,3,4,5,8,12,13},{2,3,4,5,8,12,13,14},{2,3,4,5,8,12,13,14,15},{2,3,4,5,8,12,13,15},{2,3,4,5,8,12,14},{2,3,4,5,8,12,14,15},{2,3,4,5,8,12,15},{2,3,4,5,8,13},{2,3,4,5,8,13,14},{2,3,4,5,8,13,14,15},{2,3,4,5,8,13,15},{2,3,4,5,8,14},{2,3,4,5,8,14,15},{2,3,4,5,8,15},{2,3,4,5,9},{2,3,4,5,9,10},{2,3,4,5,9,10,11},{2,3,4,5,9,10,11,12},{2,3,4,5,9,10,11,12,13},{2,3,4,5,9,10,11,12,13,14},{2,3,4,5,9,10,11,12,13,14,15},{2,3,4,5,9,10,11,12,13,15},{2,3,4,5,9,10,11,12,14},{2,3,4,5,9,10,11,12,14,15},{2,3,4,5,9,10,11,12,15},{2,3,4,5,9,10,11,13},{2,3,4,5,9,10,11,13,14},{2,3,4,5,9,10,11,13,14,15},{2,3,4,5,9,10,11,13,15},{2,3,4,5,9,10,11,14},{2,3,4,5,9,10,11,14,15},{2,3,4,5,9,10,11,15},{2,3,4,5,9,10,12},{2,3,4,5,9,10,12,13},{2,3,4,5,9,10,12,13,14},{2,3,4,5,9,10,12,13,14,15},{2,3,4,5,9,10,12,13,15},{2,3,4,5,9,10,12,14},{2,3,4,5,9,10,12,14,15},{2,3,4,5,9,10,12,15},{2,3,4,5,9,10,13},{2,3,4,5,9,10,13,14},{2,3,4,5,9,10,13,14,15},{2,3,4,5,9,10,13,15},{2,3,4,5,9,10,14},{2,3,4,5,9,10,14,15},{2,3,4,5,9,10,15},{2,3,4,5,9,11},{2,3,4,5,9,11,12},{2,3,4,5,9,11,12,13},{2,3,4,5,9,11,12,13,14},{2,3,4,5,9,11,12,13,14,15},{2,3,4,5,9,11,12,13,15},{2,3,4,5,9,11,12,14},{2,3,4,5,9,11,12,14,15},{2,3,4,5,9,11,12,15},{2,3,4,5,9,11,13},{2,3,4,5,9,11,13,14},{2,3,4,5,9,11,13,14,15},{2,3,4,5,9,11,13,15},{2,3,4,5,9,11,14},{2,3,4,5,9,11,14,15},{2,3,4,5,9,11,15},{2,3,4,5,9,12},{2,3,4,5,9,12,13},{2,3,4,5,9,12,13,14},{2,3,4,5,9,12,13,14,15},{2,3,4,5,9,12,13,15},{2,3,4,5,9,12,14},{2,3,4,5,9,12,14,15},{2,3,4,5,9,12,15},{2,3,4,5,9,13},{2,3,4,5,9,13,14},{2,3,4,5,9,13,14,15},{2,3,4,5,9,13,15},{2,3,4,5,9,14},{2,3,4,5,9,14,15},{2,3,4,5,9,15},{2,3,4,5,10},{2,3,4,5,10,11},{2,3,4,5,10,11,12},{2,3,4,5,10,11,12,13},{2,3,4,5,10,11,12,13,14},{2,3,4,5,10,11,12,13,14,15},{2,3,4,5,10,11,12,13,15},{2,3,4,5,10,11,12,14},{2,3,4,5,10,11,12,14,15},{2,3,4,5,10,11,12,15},{2,3,4,5,10,11,13},{2,3,4,5,10,11,13,14},{2,3,4,5,10,11,13,14,15},{2,3,4,5,10,11,13,15},{2,3,4,5,10,11,14},{2,3,4,5,10,11,14,15},{2,3,4,5,10,11,15},{2,3,4,5,10,12},{2,3,4,5,10,12,13},{2,3,4,5,10,12,13,14},{2,3,4,5,10,12,13,14,15},{2,3,4,5,10,12,13,15},{2,3,4,5,10,12,14},{2,3,4,5,10,12,14,15},{2,3,4,5,10,12,15},{2,3,4,5,10,13},{2,3,4,5,10,13,14},{2,3,4,5,10,13,14,15},{2,3,4,5,10,13,15},{2,3,4,5,10,14},{2,3,4,5,10,14,15},{2,3,4,5,10,15},{2,3,4,5,11},{2,3,4,5,11,12},{2,3,4,5,11,12,13},{2,3,4,5,11,12,13,14},{2,3,4,5,11,12,13,14,15},{2,3,4,5,11,12,13,15},{2,3,4,5,11,12,14},{2,3,4,5,11,12,14,15},{2,3,4,5,11,12,15},{2,3,4,5,11,13},{2,3,4,5,11,13,14},{2,3,4,5,11,13,14,15},{2,3,4,5,11,13,15},{2,3,4,5,11,14},{2,3,4,5,11,14,15},{2,3,4,5,11,15},{2,3,4,5,12},{2,3,4,5,12,13},{2,3,4,5,12,13,14},{2,3,4,5,12,13,14,15},{2,3,4,5,12,13,15},{2,3,4,5,12,14},{2,3,4,5,12,14,15},{2,3,4,5,12,15},{2,3,4,5,13},{2,3,4,5,13,14},{2,3,4,5,13,14,15},{2,3,4,5,13,15},{2,3,4,5,14},{2,3,4,5,14,15},{2,3,4,5,15},{2,3,4,6},{2,3,4,6,7},{2,3,4,6,7,8},{2,3,4,6,7,8,9},{2,3,4,6,7,8,9,10},{2,3,4,6,7,8,9,10,11},{2,3,4,6,7,8,9,10,11,12},{2,3,4,6,7,8,9,10,11,12,13},{2,3,4,6,7,8,9,10,11,12,13,14},{2,3,4,6,7,8,9,10,11,12,13,14,15},{2,3,4,6,7,8,9,10,11,12,13,15},{2,3,4,6,7,8,9,10,11,12,14},{2,3,4,6,7,8,9,10,11,12,14,15},{2,3,4,6,7,8,9,10,11,12,15},{2,3,4,6,7,8,9,10,11,13},{2,3,4,6,7,8,9,10,11,13,14},{2,3,4,6,7,8,9,10,11,13,14,15},{2,3,4,6,7,8,9,10,11,13,15},{2,3,4,6,7,8,9,10,11,14},{2,3,4,6,7,8,9,10,11,14,15},{2,3,4,6,7,8,9,10,11,15},{2,3,4,6,7,8,9,10,12},{2,3,4,6,7,8,9,10,12,13},{2,3,4,6,7,8,9,10,12,13,14},{2,3,4,6,7,8,9,10,12,13,14,15},{2,3,4,6,7,8,9,10,12,13,15},{2,3,4,6,7,8,9,10,12,14},{2,3,4,6,7,8,9,10,12,14,15},{2,3,4,6,7,8,9,10,12,15},{2,3,4,6,7,8,9,10,13},{2,3,4,6,7,8,9,10,13,14},{2,3,4,6,7,8,9,10,13,14,15},{2,3,4,6,7,8,9,10,13,15},{2,3,4,6,7,8,9,10,14},{2,3,4,6,7,8,9,10,14,15},{2,3,4,6,7,8,9,10,15},{2,3,4,6,7,8,9,11},{2,3,4,6,7,8,9,11,12},{2,3,4,6,7,8,9,11,12,13},{2,3,4,6,7,8,9,11,12,13,14},{2,3,4,6,7,8,9,11,12,13,14,15},{2,3,4,6,7,8,9,11,12,13,15},{2,3,4,6,7,8,9,11,12,14},{2,3,4,6,7,8,9,11,12,14,15},{2,3,4,6,7,8,9,11,12,15},{2,3,4,6,7,8,9,11,13},{2,3,4,6,7,8,9,11,13,14},{2,3,4,6,7,8,9,11,13,14,15},{2,3,4,6,7,8,9,11,13,15},{2,3,4,6,7,8,9,11,14},{2,3,4,6,7,8,9,11,14,15},{2,3,4,6,7,8,9,11,15},{2,3,4,6,7,8,9,12},{2,3,4,6,7,8,9,12,13},{2,3,4,6,7,8,9,12,13,14},{2,3,4,6,7,8,9,12,13,14,15},{2,3,4,6,7,8,9,12,13,15},{2,3,4,6,7,8,9,12,14},{2,3,4,6,7,8,9,12,14,15},{2,3,4,6,7,8,9,12,15},{2,3,4,6,7,8,9,13},{2,3,4,6,7,8,9,13,14},{2,3,4,6,7,8,9,13,14,15},{2,3,4,6,7,8,9,13,15},{2,3,4,6,7,8,9,14},{2,3,4,6,7,8,9,14,15},{2,3,4,6,7,8,9,15},{2,3,4,6,7,8,10},{2,3,4,6,7,8,10,11},{2,3,4,6,7,8,10,11,12},{2,3,4,6,7,8,10,11,12,13},{2,3,4,6,7,8,10,11,12,13,14},{2,3,4,6,7,8,10,11,12,13,14,15},{2,3,4,6,7,8,10,11,12,13,15},{2,3,4,6,7,8,10,11,12,14},{2,3,4,6,7,8,10,11,12,14,15},{2,3,4,6,7,8,10,11,12,15},{2,3,4,6,7,8,10,11,13},{2,3,4,6,7,8,10,11,13,14},{2,3,4,6,7,8,10,11,13,14,15},{2,3,4,6,7,8,10,11,13,15},{2,3,4,6,7,8,10,11,14},{2,3,4,6,7,8,10,11,14,15},{2,3,4,6,7,8,10,11,15},{2,3,4,6,7,8,10,12},{2,3,4,6,7,8,10,12,13},{2,3,4,6,7,8,10,12,13,14},{2,3,4,6,7,8,10,12,13,14,15},{2,3,4,6,7,8,10,12,13,15},{2,3,4,6,7,8,10,12,14},{2,3,4,6,7,8,10,12,14,15},{2,3,4,6,7,8,10,12,15},{2,3,4,6,7,8,10,13},{2,3,4,6,7,8,10,13,14},{2,3,4,6,7,8,10,13,14,15},{2,3,4,6,7,8,10,13,15},{2,3,4,6,7,8,10,14},{2,3,4,6,7,8,10,14,15},{2,3,4,6,7,8,10,15},{2,3,4,6,7,8,11},{2,3,4,6,7,8,11,12},{2,3,4,6,7,8,11,12,13},{2,3,4,6,7,8,11,12,13,14},{2,3,4,6,7,8,11,12,13,14,15},{2,3,4,6,7,8,11,12,13,15},{2,3,4,6,7,8,11,12,14},{2,3,4,6,7,8,11,12,14,15},{2,3,4,6,7,8,11,12,15},{2,3,4,6,7,8,11,13},{2,3,4,6,7,8,11,13,14},{2,3,4,6,7,8,11,13,14,15},{2,3,4,6,7,8,11,13,15},{2,3,4,6,7,8,11,14},{2,3,4,6,7,8,11,14,15},{2,3,4,6,7,8,11,15},{2,3,4,6,7,8,12},{2,3,4,6,7,8,12,13},{2,3,4,6,7,8,12,13,14},{2,3,4,6,7,8,12,13,14,15},{2,3,4,6,7,8,12,13,15},{2,3,4,6,7,8,12,14},{2,3,4,6,7,8,12,14,15},{2,3,4,6,7,8,12,15},{2,3,4,6,7,8,13},{2,3,4,6,7,8,13,14},{2,3,4,6,7,8,13,14,15},{2,3,4,6,7,8,13,15},{2,3,4,6,7,8,14},{2,3,4,6,7,8,14,15},{2,3,4,6,7,8,15},{2,3,4,6,7,9},{2,3,4,6,7,9,10},{2,3,4,6,7,9,10,11},{2,3,4,6,7,9,10,11,12},{2,3,4,6,7,9,10,11,12,13},{2,3,4,6,7,9,10,11,12,13,14},{2,3,4,6,7,9,10,11,12,13,14,15},{2,3,4,6,7,9,10,11,12,13,15},{2,3,4,6,7,9,10,11,12,14},{2,3,4,6,7,9,10,11,12,14,15},{2,3,4,6,7,9,10,11,12,15},{2,3,4,6,7,9,10,11,13},{2,3,4,6,7,9,10,11,13,14},{2,3,4,6,7,9,10,11,13,14,15},{2,3,4,6,7,9,10,11,13,15},{2,3,4,6,7,9,10,11,14},{2,3,4,6,7,9,10,11,14,15},{2,3,4,6,7,9,10,11,15},{2,3,4,6,7,9,10,12},{2,3,4,6,7,9,10,12,13},{2,3,4,6,7,9,10,12,13,14},{2,3,4,6,7,9,10,12,13,14,15},{2,3,4,6,7,9,10,12,13,15},{2,3,4,6,7,9,10,12,14},{2,3,4,6,7,9,10,12,14,15},{2,3,4,6,7,9,10,12,15},{2,3,4,6,7,9,10,13},{2,3,4,6,7,9,10,13,14},{2,3,4,6,7,9,10,13,14,15},{2,3,4,6,7,9,10,13,15},{2,3,4,6,7,9,10,14},{2,3,4,6,7,9,10,14,15},{2,3,4,6,7,9,10,15},{2,3,4,6,7,9,11},{2,3,4,6,7,9,11,12},{2,3,4,6,7,9,11,12,13},{2,3,4,6,7,9,11,12,13,14},{2,3,4,6,7,9,11,12,13,14,15},{2,3,4,6,7,9,11,12,13,15},{2,3,4,6,7,9,11,12,14},{2,3,4,6,7,9,11,12,14,15},{2,3,4,6,7,9,11,12,15},{2,3,4,6,7,9,11,13},{2,3,4,6,7,9,11,13,14},{2,3,4,6,7,9,11,13,14,15},{2,3,4,6,7,9,11,13,15},{2,3,4,6,7,9,11,14},{2,3,4,6,7,9,11,14,15},{2,3,4,6,7,9,11,15},{2,3,4,6,7,9,12},{2,3,4,6,7,9,12,13},{2,3,4,6,7,9,12,13,14},{2,3,4,6,7,9,12,13,14,15},{2,3,4,6,7,9,12,13,15},{2,3,4,6,7,9,12,14},{2,3,4,6,7,9,12,14,15},{2,3,4,6,7,9,12,15},{2,3,4,6,7,9,13},{2,3,4,6,7,9,13,14},{2,3,4,6,7,9,13,14,15},{2,3,4,6,7,9,13,15},{2,3,4,6,7,9,14},{2,3,4,6,7,9,14,15},{2,3,4,6,7,9,15},{2,3,4,6,7,10},{2,3,4,6,7,10,11},{2,3,4,6,7,10,11,12},{2,3,4,6,7,10,11,12,13},{2,3,4,6,7,10,11,12,13,14},{2,3,4,6,7,10,11,12,13,14,15},{2,3,4,6,7,10,11,12,13,15},{2,3,4,6,7,10,11,12,14},{2,3,4,6,7,10,11,12,14,15},{2,3,4,6,7,10,11,12,15},{2,3,4,6,7,10,11,13},{2,3,4,6,7,10,11,13,14},{2,3,4,6,7,10,11,13,14,15},{2,3,4,6,7,10,11,13,15},{2,3,4,6,7,10,11,14},{2,3,4,6,7,10,11,14,15},{2,3,4,6,7,10,11,15},{2,3,4,6,7,10,12},{2,3,4,6,7,10,12,13},{2,3,4,6,7,10,12,13,14},{2,3,4,6,7,10,12,13,14,15},{2,3,4,6,7,10,12,13,15},{2,3,4,6,7,10,12,14},{2,3,4,6,7,10,12,14,15},{2,3,4,6,7,10,12,15},{2,3,4,6,7,10,13},{2,3,4,6,7,10,13,14},{2,3,4,6,7,10,13,14,15},{2,3,4,6,7,10,13,15},{2,3,4,6,7,10,14},{2,3,4,6,7,10,14,15},{2,3,4,6,7,10,15},{2,3,4,6,7,11},{2,3,4,6,7,11,12},{2,3,4,6,7,11,12,13},{2,3,4,6,7,11,12,13,14},{2,3,4,6,7,11,12,13,14,15},{2,3,4,6,7,11,12,13,15},{2,3,4,6,7,11,12,14},{2,3,4,6,7,11,12,14,15},{2,3,4,6,7,11,12,15},{2,3,4,6,7,11,13},{2,3,4,6,7,11,13,14},{2,3,4,6,7,11,13,14,15},{2,3,4,6,7,11,13,15},{2,3,4,6,7,11,14},{2,3,4,6,7,11,14,15},{2,3,4,6,7,11,15},{2,3,4,6,7,12},{2,3,4,6,7,12,13},{2,3,4,6,7,12,13,14},{2,3,4,6,7,12,13,14,15},{2,3,4,6,7,12,13,15},{2,3,4,6,7,12,14},{2,3,4,6,7,12,14,15},{2,3,4,6,7,12,15},{2,3,4,6,7,13},{2,3,4,6,7,13,14},{2,3,4,6,7,13,14,15},{2,3,4,6,7,13,15},{2,3,4,6,7,14},{2,3,4,6,7,14,15},{2,3,4,6,7,15},{2,3,4,6,8},{2,3,4,6,8,9},{2,3,4,6,8,9,10},{2,3,4,6,8,9,10,11},{2,3,4,6,8,9,10,11,12},{2,3,4,6,8,9,10,11,12,13},{2,3,4,6,8,9,10,11,12,13,14},{2,3,4,6,8,9,10,11,12,13,14,15},{2,3,4,6,8,9,10,11,12,13,15},{2,3,4,6,8,9,10,11,12,14},{2,3,4,6,8,9,10,11,12,14,15},{2,3,4,6,8,9,10,11,12,15},{2,3,4,6,8,9,10,11,13},{2,3,4,6,8,9,10,11,13,14},{2,3,4,6,8,9,10,11,13,14,15},{2,3,4,6,8,9,10,11,13,15},{2,3,4,6,8,9,10,11,14},{2,3,4,6,8,9,10,11,14,15},{2,3,4,6,8,9,10,11,15},{2,3,4,6,8,9,10,12},{2,3,4,6,8,9,10,12,13},{2,3,4,6,8,9,10,12,13,14},{2,3,4,6,8,9,10,12,13,14,15},{2,3,4,6,8,9,10,12,13,15},{2,3,4,6,8,9,10,12,14},{2,3,4,6,8,9,10,12,14,15},{2,3,4,6,8,9,10,12,15},{2,3,4,6,8,9,10,13},{2,3,4,6,8,9,10,13,14},{2,3,4,6,8,9,10,13,14,15},{2,3,4,6,8,9,10,13,15},{2,3,4,6,8,9,10,14},{2,3,4,6,8,9,10,14,15},{2,3,4,6,8,9,10,15},{2,3,4,6,8,9,11},{2,3,4,6,8,9,11,12},{2,3,4,6,8,9,11,12,13},{2,3,4,6,8,9,11,12,13,14},{2,3,4,6,8,9,11,12,13,14,15},{2,3,4,6,8,9,11,12,13,15},{2,3,4,6,8,9,11,12,14},{2,3,4,6,8,9,11,12,14,15},{2,3,4,6,8,9,11,12,15},{2,3,4,6,8,9,11,13},{2,3,4,6,8,9,11,13,14},{2,3,4,6,8,9,11,13,14,15},{2,3,4,6,8,9,11,13,15},{2,3,4,6,8,9,11,14},{2,3,4,6,8,9,11,14,15},{2,3,4,6,8,9,11,15},{2,3,4,6,8,9,12},{2,3,4,6,8,9,12,13},{2,3,4,6,8,9,12,13,14},{2,3,4,6,8,9,12,13,14,15},{2,3,4,6,8,9,12,13,15},{2,3,4,6,8,9,12,14},{2,3,4,6,8,9,12,14,15},{2,3,4,6,8,9,12,15},{2,3,4,6,8,9,13},{2,3,4,6,8,9,13,14},{2,3,4,6,8,9,13,14,15},{2,3,4,6,8,9,13,15},{2,3,4,6,8,9,14},{2,3,4,6,8,9,14,15},{2,3,4,6,8,9,15},{2,3,4,6,8,10},{2,3,4,6,8,10,11},{2,3,4,6,8,10,11,12},{2,3,4,6,8,10,11,12,13},{2,3,4,6,8,10,11,12,13,14},{2,3,4,6,8,10,11,12,13,14,15},{2,3,4,6,8,10,11,12,13,15},{2,3,4,6,8,10,11,12,14},{2,3,4,6,8,10,11,12,14,15},{2,3,4,6,8,10,11,12,15},{2,3,4,6,8,10,11,13},{2,3,4,6,8,10,11,13,14},{2,3,4,6,8,10,11,13,14,15},{2,3,4,6,8,10,11,13,15},{2,3,4,6,8,10,11,14},{2,3,4,6,8,10,11,14,15},{2,3,4,6,8,10,11,15},{2,3,4,6,8,10,12},{2,3,4,6,8,10,12,13},{2,3,4,6,8,10,12,13,14},{2,3,4,6,8,10,12,13,14,15},{2,3,4,6,8,10,12,13,15},{2,3,4,6,8,10,12,14},{2,3,4,6,8,10,12,14,15},{2,3,4,6,8,10,12,15},{2,3,4,6,8,10,13},{2,3,4,6,8,10,13,14},{2,3,4,6,8,10,13,14,15},{2,3,4,6,8,10,13,15},{2,3,4,6,8,10,14},{2,3,4,6,8,10,14,15},{2,3,4,6,8,10,15},{2,3,4,6,8,11},{2,3,4,6,8,11,12},{2,3,4,6,8,11,12,13},{2,3,4,6,8,11,12,13,14},{2,3,4,6,8,11,12,13,14,15},{2,3,4,6,8,11,12,13,15},{2,3,4,6,8,11,12,14},{2,3,4,6,8,11,12,14,15},{2,3,4,6,8,11,12,15},{2,3,4,6,8,11,13},{2,3,4,6,8,11,13,14},{2,3,4,6,8,11,13,14,15},{2,3,4,6,8,11,13,15},{2,3,4,6,8,11,14},{2,3,4,6,8,11,14,15},{2,3,4,6,8,11,15},{2,3,4,6,8,12},{2,3,4,6,8,12,13},{2,3,4,6,8,12,13,14},{2,3,4,6,8,12,13,14,15},{2,3,4,6,8,12,13,15},{2,3,4,6,8,12,14},{2,3,4,6,8,12,14,15},{2,3,4,6,8,12,15},{2,3,4,6,8,13},{2,3,4,6,8,13,14},{2,3,4,6,8,13,14,15},{2,3,4,6,8,13,15},{2,3,4,6,8,14},{2,3,4,6,8,14,15},{2,3,4,6,8,15},{2,3,4,6,9},{2,3,4,6,9,10},{2,3,4,6,9,10,11},{2,3,4,6,9,10,11,12},{2,3,4,6,9,10,11,12,13},{2,3,4,6,9,10,11,12,13,14},{2,3,4,6,9,10,11,12,13,14,15},{2,3,4,6,9,10,11,12,13,15},{2,3,4,6,9,10,11,12,14},{2,3,4,6,9,10,11,12,14,15},{2,3,4,6,9,10,11,12,15},{2,3,4,6,9,10,11,13},{2,3,4,6,9,10,11,13,14},{2,3,4,6,9,10,11,13,14,15},{2,3,4,6,9,10,11,13,15},{2,3,4,6,9,10,11,14},{2,3,4,6,9,10,11,14,15},{2,3,4,6,9,10,11,15},{2,3,4,6,9,10,12},{2,3,4,6,9,10,12,13},{2,3,4,6,9,10,12,13,14},{2,3,4,6,9,10,12,13,14,15},{2,3,4,6,9,10,12,13,15},{2,3,4,6,9,10,12,14},{2,3,4,6,9,10,12,14,15},{2,3,4,6,9,10,12,15},{2,3,4,6,9,10,13},{2,3,4,6,9,10,13,14},{2,3,4,6,9,10,13,14,15},{2,3,4,6,9,10,13,15},{2,3,4,6,9,10,14},{2,3,4,6,9,10,14,15},{2,3,4,6,9,10,15},{2,3,4,6,9,11},{2,3,4,6,9,11,12},{2,3,4,6,9,11,12,13},{2,3,4,6,9,11,12,13,14},{2,3,4,6,9,11,12,13,14,15},{2,3,4,6,9,11,12,13,15},{2,3,4,6,9,11,12,14},{2,3,4,6,9,11,12,14,15},{2,3,4,6,9,11,12,15},{2,3,4,6,9,11,13},{2,3,4,6,9,11,13,14},{2,3,4,6,9,11,13,14,15},{2,3,4,6,9,11,13,15},{2,3,4,6,9,11,14},{2,3,4,6,9,11,14,15},{2,3,4,6,9,11,15},{2,3,4,6,9,12},{2,3,4,6,9,12,13},{2,3,4,6,9,12,13,14},{2,3,4,6,9,12,13,14,15},{2,3,4,6,9,12,13,15},{2,3,4,6,9,12,14},{2,3,4,6,9,12,14,15},{2,3,4,6,9,12,15},{2,3,4,6,9,13},{2,3,4,6,9,13,14},{2,3,4,6,9,13,14,15},{2,3,4,6,9,13,15},{2,3,4,6,9,14},{2,3,4,6,9,14,15},{2,3,4,6,9,15},{2,3,4,6,10},{2,3,4,6,10,11},{2,3,4,6,10,11,12},{2,3,4,6,10,11,12,13},{2,3,4,6,10,11,12,13,14},{2,3,4,6,10,11,12,13,14,15},{2,3,4,6,10,11,12,13,15},{2,3,4,6,10,11,12,14},{2,3,4,6,10,11,12,14,15},{2,3,4,6,10,11,12,15},{2,3,4,6,10,11,13},{2,3,4,6,10,11,13,14},{2,3,4,6,10,11,13,14,15},{2,3,4,6,10,11,13,15},{2,3,4,6,10,11,14},{2,3,4,6,10,11,14,15},{2,3,4,6,10,11,15},{2,3,4,6,10,12},{2,3,4,6,10,12,13},{2,3,4,6,10,12,13,14},{2,3,4,6,10,12,13,14,15},{2,3,4,6,10,12,13,15},{2,3,4,6,10,12,14},{2,3,4,6,10,12,14,15},{2,3,4,6,10,12,15},{2,3,4,6,10,13},{2,3,4,6,10,13,14},{2,3,4,6,10,13,14,15},{2,3,4,6,10,13,15},{2,3,4,6,10,14},{2,3,4,6,10,14,15},{2,3,4,6,10,15},{2,3,4,6,11},{2,3,4,6,11,12},{2,3,4,6,11,12,13},{2,3,4,6,11,12,13,14},{2,3,4,6,11,12,13,14,15},{2,3,4,6,11,12,13,15},{2,3,4,6,11,12,14},{2,3,4,6,11,12,14,15},{2,3,4,6,11,12,15},{2,3,4,6,11,13},{2,3,4,6,11,13,14},{2,3,4,6,11,13,14,15},{2,3,4,6,11,13,15},{2,3,4,6,11,14},{2,3,4,6,11,14,15},{2,3,4,6,11,15},{2,3,4,6,12},{2,3,4,6,12,13},{2,3,4,6,12,13,14},{2,3,4,6,12,13,14,15},{2,3,4,6,12,13,15},{2,3,4,6,12,14},{2,3,4,6,12,14,15},{2,3,4,6,12,15},{2,3,4,6,13},{2,3,4,6,13,14},{2,3,4,6,13,14,15},{2,3,4,6,13,15},{2,3,4,6,14},{2,3,4,6,14,15},{2,3,4,6,15},{2,3,4,7},{2,3,4,7,8},{2,3,4,7,8,9},{2,3,4,7,8,9,10},{2,3,4,7,8,9,10,11},{2,3,4,7,8,9,10,11,12},{2,3,4,7,8,9,10,11,12,13},{2,3,4,7,8,9,10,11,12,13,14},{2,3,4,7,8,9,10,11,12,13,14,15},{2,3,4,7,8,9,10,11,12,13,15},{2,3,4,7,8,9,10,11,12,14},{2,3,4,7,8,9,10,11,12,14,15},{2,3,4,7,8,9,10,11,12,15},{2,3,4,7,8,9,10,11,13},{2,3,4,7,8,9,10,11,13,14},{2,3,4,7,8,9,10,11,13,14,15},{2,3,4,7,8,9,10,11,13,15},{2,3,4,7,8,9,10,11,14},{2,3,4,7,8,9,10,11,14,15},{2,3,4,7,8,9,10,11,15},{2,3,4,7,8,9,10,12},{2,3,4,7,8,9,10,12,13},{2,3,4,7,8,9,10,12,13,14},{2,3,4,7,8,9,10,12,13,14,15},{2,3,4,7,8,9,10,12,13,15},{2,3,4,7,8,9,10,12,14},{2,3,4,7,8,9,10,12,14,15},{2,3,4,7,8,9,10,12,15},{2,3,4,7,8,9,10,13},{2,3,4,7,8,9,10,13,14},{2,3,4,7,8,9,10,13,14,15},{2,3,4,7,8,9,10,13,15},{2,3,4,7,8,9,10,14},{2,3,4,7,8,9,10,14,15},{2,3,4,7,8,9,10,15},{2,3,4,7,8,9,11},{2,3,4,7,8,9,11,12},{2,3,4,7,8,9,11,12,13},{2,3,4,7,8,9,11,12,13,14},{2,3,4,7,8,9,11,12,13,14,15},{2,3,4,7,8,9,11,12,13,15},{2,3,4,7,8,9,11,12,14},{2,3,4,7,8,9,11,12,14,15},{2,3,4,7,8,9,11,12,15},{2,3,4,7,8,9,11,13},{2,3,4,7,8,9,11,13,14},{2,3,4,7,8,9,11,13,14,15},{2,3,4,7,8,9,11,13,15},{2,3,4,7,8,9,11,14},{2,3,4,7,8,9,11,14,15},{2,3,4,7,8,9,11,15},{2,3,4,7,8,9,12},{2,3,4,7,8,9,12,13},{2,3,4,7,8,9,12,13,14},{2,3,4,7,8,9,12,13,14,15},{2,3,4,7,8,9,12,13,15},{2,3,4,7,8,9,12,14},{2,3,4,7,8,9,12,14,15},{2,3,4,7,8,9,12,15},{2,3,4,7,8,9,13},{2,3,4,7,8,9,13,14},{2,3,4,7,8,9,13,14,15},{2,3,4,7,8,9,13,15},{2,3,4,7,8,9,14},{2,3,4,7,8,9,14,15},{2,3,4,7,8,9,15},{2,3,4,7,8,10},{2,3,4,7,8,10,11},{2,3,4,7,8,10,11,12},{2,3,4,7,8,10,11,12,13},{2,3,4,7,8,10,11,12,13,14},{2,3,4,7,8,10,11,12,13,14,15},{2,3,4,7,8,10,11,12,13,15},{2,3,4,7,8,10,11,12,14},{2,3,4,7,8,10,11,12,14,15},{2,3,4,7,8,10,11,12,15},{2,3,4,7,8,10,11,13},{2,3,4,7,8,10,11,13,14},{2,3,4,7,8,10,11,13,14,15},{2,3,4,7,8,10,11,13,15},{2,3,4,7,8,10,11,14},{2,3,4,7,8,10,11,14,15},{2,3,4,7,8,10,11,15},{2,3,4,7,8,10,12},{2,3,4,7,8,10,12,13},{2,3,4,7,8,10,12,13,14},{2,3,4,7,8,10,12,13,14,15},{2,3,4,7,8,10,12,13,15},{2,3,4,7,8,10,12,14},{2,3,4,7,8,10,12,14,15},{2,3,4,7,8,10,12,15},{2,3,4,7,8,10,13},{2,3,4,7,8,10,13,14},{2,3,4,7,8,10,13,14,15},{2,3,4,7,8,10,13,15},{2,3,4,7,8,10,14},{2,3,4,7,8,10,14,15},{2,3,4,7,8,10,15},{2,3,4,7,8,11},{2,3,4,7,8,11,12},{2,3,4,7,8,11,12,13},{2,3,4,7,8,11,12,13,14},{2,3,4,7,8,11,12,13,14,15},{2,3,4,7,8,11,12,13,15},{2,3,4,7,8,11,12,14},{2,3,4,7,8,11,12,14,15},{2,3,4,7,8,11,12,15},{2,3,4,7,8,11,13},{2,3,4,7,8,11,13,14},{2,3,4,7,8,11,13,14,15},{2,3,4,7,8,11,13,15},{2,3,4,7,8,11,14},{2,3,4,7,8,11,14,15},{2,3,4,7,8,11,15},{2,3,4,7,8,12},{2,3,4,7,8,12,13},{2,3,4,7,8,12,13,14},{2,3,4,7,8,12,13,14,15},{2,3,4,7,8,12,13,15},{2,3,4,7,8,12,14},{2,3,4,7,8,12,14,15},{2,3,4,7,8,12,15},{2,3,4,7,8,13},{2,3,4,7,8,13,14},{2,3,4,7,8,13,14,15},{2,3,4,7,8,13,15},{2,3,4,7,8,14},{2,3,4,7,8,14,15},{2,3,4,7,8,15},{2,3,4,7,9},{2,3,4,7,9,10},{2,3,4,7,9,10,11},{2,3,4,7,9,10,11,12},{2,3,4,7,9,10,11,12,13},{2,3,4,7,9,10,11,12,13,14},{2,3,4,7,9,10,11,12,13,14,15},{2,3,4,7,9,10,11,12,13,15},{2,3,4,7,9,10,11,12,14},{2,3,4,7,9,10,11,12,14,15},{2,3,4,7,9,10,11,12,15},{2,3,4,7,9,10,11,13},{2,3,4,7,9,10,11,13,14},{2,3,4,7,9,10,11,13,14,15},{2,3,4,7,9,10,11,13,15},{2,3,4,7,9,10,11,14},{2,3,4,7,9,10,11,14,15},{2,3,4,7,9,10,11,15},{2,3,4,7,9,10,12},{2,3,4,7,9,10,12,13},{2,3,4,7,9,10,12,13,14},{2,3,4,7,9,10,12,13,14,15},{2,3,4,7,9,10,12,13,15},{2,3,4,7,9,10,12,14},{2,3,4,7,9,10,12,14,15},{2,3,4,7,9,10,12,15},{2,3,4,7,9,10,13},{2,3,4,7,9,10,13,14},{2,3,4,7,9,10,13,14,15},{2,3,4,7,9,10,13,15},{2,3,4,7,9,10,14},{2,3,4,7,9,10,14,15},{2,3,4,7,9,10,15},{2,3,4,7,9,11},{2,3,4,7,9,11,12},{2,3,4,7,9,11,12,13},{2,3,4,7,9,11,12,13,14},{2,3,4,7,9,11,12,13,14,15},{2,3,4,7,9,11,12,13,15},{2,3,4,7,9,11,12,14},{2,3,4,7,9,11,12,14,15},{2,3,4,7,9,11,12,15},{2,3,4,7,9,11,13},{2,3,4,7,9,11,13,14},{2,3,4,7,9,11,13,14,15},{2,3,4,7,9,11,13,15},{2,3,4,7,9,11,14},{2,3,4,7,9,11,14,15},{2,3,4,7,9,11,15},{2,3,4,7,9,12},{2,3,4,7,9,12,13},{2,3,4,7,9,12,13,14},{2,3,4,7,9,12,13,14,15},{2,3,4,7,9,12,13,15},{2,3,4,7,9,12,14},{2,3,4,7,9,12,14,15},{2,3,4,7,9,12,15},{2,3,4,7,9,13},{2,3,4,7,9,13,14},{2,3,4,7,9,13,14,15},{2,3,4,7,9,13,15},{2,3,4,7,9,14},{2,3,4,7,9,14,15},{2,3,4,7,9,15},{2,3,4,7,10},{2,3,4,7,10,11},{2,3,4,7,10,11,12},{2,3,4,7,10,11,12,13},{2,3,4,7,10,11,12,13,14},{2,3,4,7,10,11,12,13,14,15},{2,3,4,7,10,11,12,13,15},{2,3,4,7,10,11,12,14},{2,3,4,7,10,11,12,14,15},{2,3,4,7,10,11,12,15},{2,3,4,7,10,11,13},{2,3,4,7,10,11,13,14},{2,3,4,7,10,11,13,14,15},{2,3,4,7,10,11,13,15},{2,3,4,7,10,11,14},{2,3,4,7,10,11,14,15},{2,3,4,7,10,11,15},{2,3,4,7,10,12},{2,3,4,7,10,12,13},{2,3,4,7,10,12,13,14},{2,3,4,7,10,12,13,14,15},{2,3,4,7,10,12,13,15},{2,3,4,7,10,12,14},{2,3,4,7,10,12,14,15},{2,3,4,7,10,12,15},{2,3,4,7,10,13},{2,3,4,7,10,13,14},{2,3,4,7,10,13,14,15},{2,3,4,7,10,13,15},{2,3,4,7,10,14},{2,3,4,7,10,14,15},{2,3,4,7,10,15},{2,3,4,7,11},{2,3,4,7,11,12},{2,3,4,7,11,12,13},{2,3,4,7,11,12,13,14},{2,3,4,7,11,12,13,14,15},{2,3,4,7,11,12,13,15},{2,3,4,7,11,12,14},{2,3,4,7,11,12,14,15},{2,3,4,7,11,12,15},{2,3,4,7,11,13},{2,3,4,7,11,13,14},{2,3,4,7,11,13,14,15},{2,3,4,7,11,13,15},{2,3,4,7,11,14},{2,3,4,7,11,14,15},{2,3,4,7,11,15},{2,3,4,7,12},{2,3,4,7,12,13},{2,3,4,7,12,13,14},{2,3,4,7,12,13,14,15},{2,3,4,7,12,13,15},{2,3,4,7,12,14},{2,3,4,7,12,14,15},{2,3,4,7,12,15},{2,3,4,7,13},{2,3,4,7,13,14},{2,3,4,7,13,14,15},{2,3,4,7,13,15},{2,3,4,7,14},{2,3,4,7,14,15},{2,3,4,7,15},{2,3,4,8},{2,3,4,8,9},{2,3,4,8,9,10},{2,3,4,8,9,10,11},{2,3,4,8,9,10,11,12},{2,3,4,8,9,10,11,12,13},{2,3,4,8,9,10,11,12,13,14},{2,3,4,8,9,10,11,12,13,14,15},{2,3,4,8,9,10,11,12,13,15},{2,3,4,8,9,10,11,12,14},{2,3,4,8,9,10,11,12,14,15},{2,3,4,8,9,10,11,12,15},{2,3,4,8,9,10,11,13},{2,3,4,8,9,10,11,13,14},{2,3,4,8,9,10,11,13,14,15},{2,3,4,8,9,10,11,13,15},{2,3,4,8,9,10,11,14},{2,3,4,8,9,10,11,14,15},{2,3,4,8,9,10,11,15},{2,3,4,8,9,10,12},{2,3,4,8,9,10,12,13},{2,3,4,8,9,10,12,13,14},{2,3,4,8,9,10,12,13,14,15},{2,3,4,8,9,10,12,13,15},{2,3,4,8,9,10,12,14},{2,3,4,8,9,10,12,14,15},{2,3,4,8,9,10,12,15},{2,3,4,8,9,10,13},{2,3,4,8,9,10,13,14},{2,3,4,8,9,10,13,14,15},{2,3,4,8,9,10,13,15},{2,3,4,8,9,10,14},{2,3,4,8,9,10,14,15},{2,3,4,8,9,10,15},{2,3,4,8,9,11},{2,3,4,8,9,11,12},{2,3,4,8,9,11,12,13},{2,3,4,8,9,11,12,13,14},{2,3,4,8,9,11,12,13,14,15},{2,3,4,8,9,11,12,13,15},{2,3,4,8,9,11,12,14},{2,3,4,8,9,11,12,14,15},{2,3,4,8,9,11,12,15},{2,3,4,8,9,11,13},{2,3,4,8,9,11,13,14},{2,3,4,8,9,11,13,14,15},{2,3,4,8,9,11,13,15},{2,3,4,8,9,11,14},{2,3,4,8,9,11,14,15},{2,3,4,8,9,11,15},{2,3,4,8,9,12},{2,3,4,8,9,12,13},{2,3,4,8,9,12,13,14},{2,3,4,8,9,12,13,14,15},{2,3,4,8,9,12,13,15},{2,3,4,8,9,12,14},{2,3,4,8,9,12,14,15},{2,3,4,8,9,12,15},{2,3,4,8,9,13},{2,3,4,8,9,13,14},{2,3,4,8,9,13,14,15},{2,3,4,8,9,13,15},{2,3,4,8,9,14},{2,3,4,8,9,14,15},{2,3,4,8,9,15},{2,3,4,8,10},{2,3,4,8,10,11},{2,3,4,8,10,11,12},{2,3,4,8,10,11,12,13},{2,3,4,8,10,11,12,13,14},{2,3,4,8,10,11,12,13,14,15},{2,3,4,8,10,11,12,13,15},{2,3,4,8,10,11,12,14},{2,3,4,8,10,11,12,14,15},{2,3,4,8,10,11,12,15},{2,3,4,8,10,11,13},{2,3,4,8,10,11,13,14},{2,3,4,8,10,11,13,14,15},{2,3,4,8,10,11,13,15},{2,3,4,8,10,11,14},{2,3,4,8,10,11,14,15},{2,3,4,8,10,11,15},{2,3,4,8,10,12},{2,3,4,8,10,12,13},{2,3,4,8,10,12,13,14},{2,3,4,8,10,12,13,14,15},{2,3,4,8,10,12,13,15},{2,3,4,8,10,12,14},{2,3,4,8,10,12,14,15},{2,3,4,8,10,12,15},{2,3,4,8,10,13},{2,3,4,8,10,13,14},{2,3,4,8,10,13,14,15},{2,3,4,8,10,13,15},{2,3,4,8,10,14},{2,3,4,8,10,14,15},{2,3,4,8,10,15},{2,3,4,8,11},{2,3,4,8,11,12},{2,3,4,8,11,12,13},{2,3,4,8,11,12,13,14},{2,3,4,8,11,12,13,14,15},{2,3,4,8,11,12,13,15},{2,3,4,8,11,12,14},{2,3,4,8,11,12,14,15},{2,3,4,8,11,12,15},{2,3,4,8,11,13},{2,3,4,8,11,13,14},{2,3,4,8,11,13,14,15},{2,3,4,8,11,13,15},{2,3,4,8,11,14},{2,3,4,8,11,14,15},{2,3,4,8,11,15},{2,3,4,8,12},{2,3,4,8,12,13},{2,3,4,8,12,13,14},{2,3,4,8,12,13,14,15},{2,3,4,8,12,13,15},{2,3,4,8,12,14},{2,3,4,8,12,14,15},{2,3,4,8,12,15},{2,3,4,8,13},{2,3,4,8,13,14},{2,3,4,8,13,14,15},{2,3,4,8,13,15},{2,3,4,8,14},{2,3,4,8,14,15},{2,3,4,8,15},{2,3,4,9},{2,3,4,9,10},{2,3,4,9,10,11},{2,3,4,9,10,11,12},{2,3,4,9,10,11,12,13},{2,3,4,9,10,11,12,13,14},{2,3,4,9,10,11,12,13,14,15},{2,3,4,9,10,11,12,13,15},{2,3,4,9,10,11,12,14},{2,3,4,9,10,11,12,14,15},{2,3,4,9,10,11,12,15},{2,3,4,9,10,11,13},{2,3,4,9,10,11,13,14},{2,3,4,9,10,11,13,14,15},{2,3,4,9,10,11,13,15},{2,3,4,9,10,11,14},{2,3,4,9,10,11,14,15},{2,3,4,9,10,11,15},{2,3,4,9,10,12},{2,3,4,9,10,12,13},{2,3,4,9,10,12,13,14},{2,3,4,9,10,12,13,14,15},{2,3,4,9,10,12,13,15},{2,3,4,9,10,12,14},{2,3,4,9,10,12,14,15},{2,3,4,9,10,12,15},{2,3,4,9,10,13},{2,3,4,9,10,13,14},{2,3,4,9,10,13,14,15},{2,3,4,9,10,13,15},{2,3,4,9,10,14},{2,3,4,9,10,14,15},{2,3,4,9,10,15},{2,3,4,9,11},{2,3,4,9,11,12},{2,3,4,9,11,12,13},{2,3,4,9,11,12,13,14},{2,3,4,9,11,12,13,14,15},{2,3,4,9,11,12,13,15},{2,3,4,9,11,12,14},{2,3,4,9,11,12,14,15},{2,3,4,9,11,12,15},{2,3,4,9,11,13},{2,3,4,9,11,13,14},{2,3,4,9,11,13,14,15},{2,3,4,9,11,13,15},{2,3,4,9,11,14},{2,3,4,9,11,14,15},{2,3,4,9,11,15},{2,3,4,9,12},{2,3,4,9,12,13},{2,3,4,9,12,13,14},{2,3,4,9,12,13,14,15},{2,3,4,9,12,13,15},{2,3,4,9,12,14},{2,3,4,9,12,14,15},{2,3,4,9,12,15},{2,3,4,9,13},{2,3,4,9,13,14},{2,3,4,9,13,14,15},{2,3,4,9,13,15},{2,3,4,9,14},{2,3,4,9,14,15},{2,3,4,9,15},{2,3,4,10},{2,3,4,10,11},{2,3,4,10,11,12},{2,3,4,10,11,12,13},{2,3,4,10,11,12,13,14},{2,3,4,10,11,12,13,14,15},{2,3,4,10,11,12,13,15},{2,3,4,10,11,12,14},{2,3,4,10,11,12,14,15},{2,3,4,10,11,12,15},{2,3,4,10,11,13},{2,3,4,10,11,13,14},{2,3,4,10,11,13,14,15},{2,3,4,10,11,13,15},{2,3,4,10,11,14},{2,3,4,10,11,14,15},{2,3,4,10,11,15},{2,3,4,10,12},{2,3,4,10,12,13},{2,3,4,10,12,13,14},{2,3,4,10,12,13,14,15},{2,3,4,10,12,13,15},{2,3,4,10,12,14},{2,3,4,10,12,14,15},{2,3,4,10,12,15},{2,3,4,10,13},{2,3,4,10,13,14},{2,3,4,10,13,14,15},{2,3,4,10,13,15},{2,3,4,10,14},{2,3,4,10,14,15},{2,3,4,10,15},{2,3,4,11},{2,3,4,11,12},{2,3,4,11,12,13},{2,3,4,11,12,13,14},{2,3,4,11,12,13,14,15},{2,3,4,11,12,13,15},{2,3,4,11,12,14},{2,3,4,11,12,14,15},{2,3,4,11,12,15},{2,3,4,11,13},{2,3,4,11,13,14},{2,3,4,11,13,14,15},{2,3,4,11,13,15},{2,3,4,11,14},{2,3,4,11,14,15},{2,3,4,11,15},{2,3,4,12},{2,3,4,12,13},{2,3,4,12,13,14},{2,3,4,12,13,14,15},{2,3,4,12,13,15},{2,3,4,12,14},{2,3,4,12,14,15},{2,3,4,12,15},{2,3,4,13},{2,3,4,13,14},{2,3,4,13,14,15},{2,3,4,13,15},{2,3,4,14},{2,3,4,14,15},{2,3,4,15},{2,3,5},{2,3,5,6},{2,3,5,6,7},{2,3,5,6,7,8},{2,3,5,6,7,8,9},{2,3,5,6,7,8,9,10},{2,3,5,6,7,8,9,10,11},{2,3,5,6,7,8,9,10,11,12},{2,3,5,6,7,8,9,10,11,12,13},{2,3,5,6,7,8,9,10,11,12,13,14},{2,3,5,6,7,8,9,10,11,12,13,14,15},{2,3,5,6,7,8,9,10,11,12,13,15},{2,3,5,6,7,8,9,10,11,12,14},{2,3,5,6,7,8,9,10,11,12,14,15},{2,3,5,6,7,8,9,10,11,12,15},{2,3,5,6,7,8,9,10,11,13},{2,3,5,6,7,8,9,10,11,13,14},{2,3,5,6,7,8,9,10,11,13,14,15},{2,3,5,6,7,8,9,10,11,13,15},{2,3,5,6,7,8,9,10,11,14},{2,3,5,6,7,8,9,10,11,14,15},{2,3,5,6,7,8,9,10,11,15},{2,3,5,6,7,8,9,10,12},{2,3,5,6,7,8,9,10,12,13},{2,3,5,6,7,8,9,10,12,13,14},{2,3,5,6,7,8,9,10,12,13,14,15},{2,3,5,6,7,8,9,10,12,13,15},{2,3,5,6,7,8,9,10,12,14},{2,3,5,6,7,8,9,10,12,14,15},{2,3,5,6,7,8,9,10,12,15},{2,3,5,6,7,8,9,10,13},{2,3,5,6,7,8,9,10,13,14},{2,3,5,6,7,8,9,10,13,14,15},{2,3,5,6,7,8,9,10,13,15},{2,3,5,6,7,8,9,10,14},{2,3,5,6,7,8,9,10,14,15},{2,3,5,6,7,8,9,10,15},{2,3,5,6,7,8,9,11},{2,3,5,6,7,8,9,11,12},{2,3,5,6,7,8,9,11,12,13},{2,3,5,6,7,8,9,11,12,13,14},{2,3,5,6,7,8,9,11,12,13,14,15},{2,3,5,6,7,8,9,11,12,13,15},{2,3,5,6,7,8,9,11,12,14},{2,3,5,6,7,8,9,11,12,14,15},{2,3,5,6,7,8,9,11,12,15},{2,3,5,6,7,8,9,11,13},{2,3,5,6,7,8,9,11,13,14},{2,3,5,6,7,8,9,11,13,14,15},{2,3,5,6,7,8,9,11,13,15},{2,3,5,6,7,8,9,11,14},{2,3,5,6,7,8,9,11,14,15},{2,3,5,6,7,8,9,11,15},{2,3,5,6,7,8,9,12},{2,3,5,6,7,8,9,12,13},{2,3,5,6,7,8,9,12,13,14},{2,3,5,6,7,8,9,12,13,14,15},{2,3,5,6,7,8,9,12,13,15},{2,3,5,6,7,8,9,12,14},{2,3,5,6,7,8,9,12,14,15},{2,3,5,6,7,8,9,12,15},{2,3,5,6,7,8,9,13},{2,3,5,6,7,8,9,13,14},{2,3,5,6,7,8,9,13,14,15},{2,3,5,6,7,8,9,13,15},{2,3,5,6,7,8,9,14},{2,3,5,6,7,8,9,14,15},{2,3,5,6,7,8,9,15},{2,3,5,6,7,8,10},{2,3,5,6,7,8,10,11},{2,3,5,6,7,8,10,11,12},{2,3,5,6,7,8,10,11,12,13},{2,3,5,6,7,8,10,11,12,13,14},{2,3,5,6,7,8,10,11,12,13,14,15},{2,3,5,6,7,8,10,11,12,13,15},{2,3,5,6,7,8,10,11,12,14},{2,3,5,6,7,8,10,11,12,14,15},{2,3,5,6,7,8,10,11,12,15},{2,3,5,6,7,8,10,11,13},{2,3,5,6,7,8,10,11,13,14},{2,3,5,6,7,8,10,11,13,14,15},{2,3,5,6,7,8,10,11,13,15},{2,3,5,6,7,8,10,11,14},{2,3,5,6,7,8,10,11,14,15},{2,3,5,6,7,8,10,11,15},{2,3,5,6,7,8,10,12},{2,3,5,6,7,8,10,12,13},{2,3,5,6,7,8,10,12,13,14},{2,3,5,6,7,8,10,12,13,14,15},{2,3,5,6,7,8,10,12,13,15},{2,3,5,6,7,8,10,12,14},{2,3,5,6,7,8,10,12,14,15},{2,3,5,6,7,8,10,12,15},{2,3,5,6,7,8,10,13},{2,3,5,6,7,8,10,13,14},{2,3,5,6,7,8,10,13,14,15},{2,3,5,6,7,8,10,13,15},{2,3,5,6,7,8,10,14},{2,3,5,6,7,8,10,14,15},{2,3,5,6,7,8,10,15},{2,3,5,6,7,8,11},{2,3,5,6,7,8,11,12},{2,3,5,6,7,8,11,12,13},{2,3,5,6,7,8,11,12,13,14},{2,3,5,6,7,8,11,12,13,14,15},{2,3,5,6,7,8,11,12,13,15},{2,3,5,6,7,8,11,12,14},{2,3,5,6,7,8,11,12,14,15},{2,3,5,6,7,8,11,12,15},{2,3,5,6,7,8,11,13},{2,3,5,6,7,8,11,13,14},{2,3,5,6,7,8,11,13,14,15},{2,3,5,6,7,8,11,13,15},{2,3,5,6,7,8,11,14},{2,3,5,6,7,8,11,14,15},{2,3,5,6,7,8,11,15},{2,3,5,6,7,8,12},{2,3,5,6,7,8,12,13},{2,3,5,6,7,8,12,13,14},{2,3,5,6,7,8,12,13,14,15},{2,3,5,6,7,8,12,13,15},{2,3,5,6,7,8,12,14},{2,3,5,6,7,8,12,14,15},{2,3,5,6,7,8,12,15},{2,3,5,6,7,8,13},{2,3,5,6,7,8,13,14},{2,3,5,6,7,8,13,14,15},{2,3,5,6,7,8,13,15},{2,3,5,6,7,8,14},{2,3,5,6,7,8,14,15},{2,3,5,6,7,8,15},{2,3,5,6,7,9},{2,3,5,6,7,9,10},{2,3,5,6,7,9,10,11},{2,3,5,6,7,9,10,11,12},{2,3,5,6,7,9,10,11,12,13},{2,3,5,6,7,9,10,11,12,13,14},{2,3,5,6,7,9,10,11,12,13,14,15},{2,3,5,6,7,9,10,11,12,13,15},{2,3,5,6,7,9,10,11,12,14},{2,3,5,6,7,9,10,11,12,14,15},{2,3,5,6,7,9,10,11,12,15},{2,3,5,6,7,9,10,11,13},{2,3,5,6,7,9,10,11,13,14},{2,3,5,6,7,9,10,11,13,14,15},{2,3,5,6,7,9,10,11,13,15},{2,3,5,6,7,9,10,11,14},{2,3,5,6,7,9,10,11,14,15},{2,3,5,6,7,9,10,11,15},{2,3,5,6,7,9,10,12},{2,3,5,6,7,9,10,12,13},{2,3,5,6,7,9,10,12,13,14},{2,3,5,6,7,9,10,12,13,14,15},{2,3,5,6,7,9,10,12,13,15},{2,3,5,6,7,9,10,12,14},{2,3,5,6,7,9,10,12,14,15},{2,3,5,6,7,9,10,12,15},{2,3,5,6,7,9,10,13},{2,3,5,6,7,9,10,13,14},{2,3,5,6,7,9,10,13,14,15},{2,3,5,6,7,9,10,13,15},{2,3,5,6,7,9,10,14},{2,3,5,6,7,9,10,14,15},{2,3,5,6,7,9,10,15},{2,3,5,6,7,9,11},{2,3,5,6,7,9,11,12},{2,3,5,6,7,9,11,12,13},{2,3,5,6,7,9,11,12,13,14},{2,3,5,6,7,9,11,12,13,14,15},{2,3,5,6,7,9,11,12,13,15},{2,3,5,6,7,9,11,12,14},{2,3,5,6,7,9,11,12,14,15},{2,3,5,6,7,9,11,12,15},{2,3,5,6,7,9,11,13},{2,3,5,6,7,9,11,13,14},{2,3,5,6,7,9,11,13,14,15},{2,3,5,6,7,9,11,13,15},{2,3,5,6,7,9,11,14},{2,3,5,6,7,9,11,14,15},{2,3,5,6,7,9,11,15},{2,3,5,6,7,9,12},{2,3,5,6,7,9,12,13},{2,3,5,6,7,9,12,13,14},{2,3,5,6,7,9,12,13,14,15},{2,3,5,6,7,9,12,13,15},{2,3,5,6,7,9,12,14},{2,3,5,6,7,9,12,14,15},{2,3,5,6,7,9,12,15},{2,3,5,6,7,9,13},{2,3,5,6,7,9,13,14},{2,3,5,6,7,9,13,14,15},{2,3,5,6,7,9,13,15},{2,3,5,6,7,9,14},{2,3,5,6,7,9,14,15},{2,3,5,6,7,9,15},{2,3,5,6,7,10},{2,3,5,6,7,10,11},{2,3,5,6,7,10,11,12},{2,3,5,6,7,10,11,12,13},{2,3,5,6,7,10,11,12,13,14},{2,3,5,6,7,10,11,12,13,14,15},{2,3,5,6,7,10,11,12,13,15},{2,3,5,6,7,10,11,12,14},{2,3,5,6,7,10,11,12,14,15},{2,3,5,6,7,10,11,12,15},{2,3,5,6,7,10,11,13},{2,3,5,6,7,10,11,13,14},{2,3,5,6,7,10,11,13,14,15},{2,3,5,6,7,10,11,13,15},{2,3,5,6,7,10,11,14},{2,3,5,6,7,10,11,14,15},{2,3,5,6,7,10,11,15},{2,3,5,6,7,10,12},{2,3,5,6,7,10,12,13},{2,3,5,6,7,10,12,13,14},{2,3,5,6,7,10,12,13,14,15},{2,3,5,6,7,10,12,13,15},{2,3,5,6,7,10,12,14},{2,3,5,6,7,10,12,14,15},{2,3,5,6,7,10,12,15},{2,3,5,6,7,10,13},{2,3,5,6,7,10,13,14},{2,3,5,6,7,10,13,14,15},{2,3,5,6,7,10,13,15},{2,3,5,6,7,10,14},{2,3,5,6,7,10,14,15},{2,3,5,6,7,10,15},{2,3,5,6,7,11},{2,3,5,6,7,11,12},{2,3,5,6,7,11,12,13},{2,3,5,6,7,11,12,13,14},{2,3,5,6,7,11,12,13,14,15},{2,3,5,6,7,11,12,13,15},{2,3,5,6,7,11,12,14},{2,3,5,6,7,11,12,14,15},{2,3,5,6,7,11,12,15},{2,3,5,6,7,11,13},{2,3,5,6,7,11,13,14},{2,3,5,6,7,11,13,14,15},{2,3,5,6,7,11,13,15},{2,3,5,6,7,11,14},{2,3,5,6,7,11,14,15},{2,3,5,6,7,11,15},{2,3,5,6,7,12},{2,3,5,6,7,12,13},{2,3,5,6,7,12,13,14},{2,3,5,6,7,12,13,14,15},{2,3,5,6,7,12,13,15},{2,3,5,6,7,12,14},{2,3,5,6,7,12,14,15},{2,3,5,6,7,12,15},{2,3,5,6,7,13},{2,3,5,6,7,13,14},{2,3,5,6,7,13,14,15},{2,3,5,6,7,13,15},{2,3,5,6,7,14},{2,3,5,6,7,14,15},{2,3,5,6,7,15},{2,3,5,6,8},{2,3,5,6,8,9},{2,3,5,6,8,9,10},{2,3,5,6,8,9,10,11},{2,3,5,6,8,9,10,11,12},{2,3,5,6,8,9,10,11,12,13},{2,3,5,6,8,9,10,11,12,13,14},{2,3,5,6,8,9,10,11,12,13,14,15},{2,3,5,6,8,9,10,11,12,13,15},{2,3,5,6,8,9,10,11,12,14},{2,3,5,6,8,9,10,11,12,14,15},{2,3,5,6,8,9,10,11,12,15},{2,3,5,6,8,9,10,11,13},{2,3,5,6,8,9,10,11,13,14},{2,3,5,6,8,9,10,11,13,14,15},{2,3,5,6,8,9,10,11,13,15},{2,3,5,6,8,9,10,11,14},{2,3,5,6,8,9,10,11,14,15},{2,3,5,6,8,9,10,11,15},{2,3,5,6,8,9,10,12},{2,3,5,6,8,9,10,12,13},{2,3,5,6,8,9,10,12,13,14},{2,3,5,6,8,9,10,12,13,14,15},{2,3,5,6,8,9,10,12,13,15},{2,3,5,6,8,9,10,12,14},{2,3,5,6,8,9,10,12,14,15},{2,3,5,6,8,9,10,12,15},{2,3,5,6,8,9,10,13},{2,3,5,6,8,9,10,13,14},{2,3,5,6,8,9,10,13,14,15},{2,3,5,6,8,9,10,13,15},{2,3,5,6,8,9,10,14},{2,3,5,6,8,9,10,14,15},{2,3,5,6,8,9,10,15},{2,3,5,6,8,9,11},{2,3,5,6,8,9,11,12},{2,3,5,6,8,9,11,12,13},{2,3,5,6,8,9,11,12,13,14},{2,3,5,6,8,9,11,12,13,14,15},{2,3,5,6,8,9,11,12,13,15},{2,3,5,6,8,9,11,12,14},{2,3,5,6,8,9,11,12,14,15},{2,3,5,6,8,9,11,12,15},{2,3,5,6,8,9,11,13},{2,3,5,6,8,9,11,13,14},{2,3,5,6,8,9,11,13,14,15},{2,3,5,6,8,9,11,13,15},{2,3,5,6,8,9,11,14},{2,3,5,6,8,9,11,14,15},{2,3,5,6,8,9,11,15},{2,3,5,6,8,9,12},{2,3,5,6,8,9,12,13},{2,3,5,6,8,9,12,13,14},{2,3,5,6,8,9,12,13,14,15},{2,3,5,6,8,9,12,13,15},{2,3,5,6,8,9,12,14},{2,3,5,6,8,9,12,14,15},{2,3,5,6,8,9,12,15},{2,3,5,6,8,9,13},{2,3,5,6,8,9,13,14},{2,3,5,6,8,9,13,14,15},{2,3,5,6,8,9,13,15},{2,3,5,6,8,9,14},{2,3,5,6,8,9,14,15},{2,3,5,6,8,9,15},{2,3,5,6,8,10},{2,3,5,6,8,10,11},{2,3,5,6,8,10,11,12},{2,3,5,6,8,10,11,12,13},{2,3,5,6,8,10,11,12,13,14},{2,3,5,6,8,10,11,12,13,14,15},{2,3,5,6,8,10,11,12,13,15},{2,3,5,6,8,10,11,12,14},{2,3,5,6,8,10,11,12,14,15},{2,3,5,6,8,10,11,12,15},{2,3,5,6,8,10,11,13},{2,3,5,6,8,10,11,13,14},{2,3,5,6,8,10,11,13,14,15},{2,3,5,6,8,10,11,13,15},{2,3,5,6,8,10,11,14},{2,3,5,6,8,10,11,14,15},{2,3,5,6,8,10,11,15},{2,3,5,6,8,10,12},{2,3,5,6,8,10,12,13},{2,3,5,6,8,10,12,13,14},{2,3,5,6,8,10,12,13,14,15},{2,3,5,6,8,10,12,13,15},{2,3,5,6,8,10,12,14},{2,3,5,6,8,10,12,14,15},{2,3,5,6,8,10,12,15},{2,3,5,6,8,10,13},{2,3,5,6,8,10,13,14},{2,3,5,6,8,10,13,14,15},{2,3,5,6,8,10,13,15},{2,3,5,6,8,10,14},{2,3,5,6,8,10,14,15},{2,3,5,6,8,10,15},{2,3,5,6,8,11},{2,3,5,6,8,11,12},{2,3,5,6,8,11,12,13},{2,3,5,6,8,11,12,13,14},{2,3,5,6,8,11,12,13,14,15},{2,3,5,6,8,11,12,13,15},{2,3,5,6,8,11,12,14},{2,3,5,6,8,11,12,14,15},{2,3,5,6,8,11,12,15},{2,3,5,6,8,11,13},{2,3,5,6,8,11,13,14},{2,3,5,6,8,11,13,14,15},{2,3,5,6,8,11,13,15},{2,3,5,6,8,11,14},{2,3,5,6,8,11,14,15},{2,3,5,6,8,11,15},{2,3,5,6,8,12},{2,3,5,6,8,12,13},{2,3,5,6,8,12,13,14},{2,3,5,6,8,12,13,14,15},{2,3,5,6,8,12,13,15},{2,3,5,6,8,12,14},{2,3,5,6,8,12,14,15},{2,3,5,6,8,12,15},{2,3,5,6,8,13},{2,3,5,6,8,13,14},{2,3,5,6,8,13,14,15},{2,3,5,6,8,13,15},{2,3,5,6,8,14},{2,3,5,6,8,14,15},{2,3,5,6,8,15},{2,3,5,6,9},{2,3,5,6,9,10},{2,3,5,6,9,10,11},{2,3,5,6,9,10,11,12},{2,3,5,6,9,10,11,12,13},{2,3,5,6,9,10,11,12,13,14},{2,3,5,6,9,10,11,12,13,14,15},{2,3,5,6,9,10,11,12,13,15},{2,3,5,6,9,10,11,12,14},{2,3,5,6,9,10,11,12,14,15},{2,3,5,6,9,10,11,12,15},{2,3,5,6,9,10,11,13},{2,3,5,6,9,10,11,13,14},{2,3,5,6,9,10,11,13,14,15},{2,3,5,6,9,10,11,13,15},{2,3,5,6,9,10,11,14},{2,3,5,6,9,10,11,14,15},{2,3,5,6,9,10,11,15},{2,3,5,6,9,10,12},{2,3,5,6,9,10,12,13},{2,3,5,6,9,10,12,13,14},{2,3,5,6,9,10,12,13,14,15},{2,3,5,6,9,10,12,13,15},{2,3,5,6,9,10,12,14},{2,3,5,6,9,10,12,14,15},{2,3,5,6,9,10,12,15},{2,3,5,6,9,10,13},{2,3,5,6,9,10,13,14},{2,3,5,6,9,10,13,14,15},{2,3,5,6,9,10,13,15},{2,3,5,6,9,10,14},{2,3,5,6,9,10,14,15},{2,3,5,6,9,10,15},{2,3,5,6,9,11},{2,3,5,6,9,11,12},{2,3,5,6,9,11,12,13},{2,3,5,6,9,11,12,13,14},{2,3,5,6,9,11,12,13,14,15},{2,3,5,6,9,11,12,13,15},{2,3,5,6,9,11,12,14},{2,3,5,6,9,11,12,14,15},{2,3,5,6,9,11,12,15},{2,3,5,6,9,11,13},{2,3,5,6,9,11,13,14},{2,3,5,6,9,11,13,14,15},{2,3,5,6,9,11,13,15},{2,3,5,6,9,11,14},{2,3,5,6,9,11,14,15},{2,3,5,6,9,11,15},{2,3,5,6,9,12},{2,3,5,6,9,12,13},{2,3,5,6,9,12,13,14},{2,3,5,6,9,12,13,14,15},{2,3,5,6,9,12,13,15},{2,3,5,6,9,12,14},{2,3,5,6,9,12,14,15},{2,3,5,6,9,12,15},{2,3,5,6,9,13},{2,3,5,6,9,13,14},{2,3,5,6,9,13,14,15},{2,3,5,6,9,13,15},{2,3,5,6,9,14},{2,3,5,6,9,14,15},{2,3,5,6,9,15},{2,3,5,6,10},{2,3,5,6,10,11},{2,3,5,6,10,11,12},{2,3,5,6,10,11,12,13},{2,3,5,6,10,11,12,13,14},{2,3,5,6,10,11,12,13,14,15},{2,3,5,6,10,11,12,13,15},{2,3,5,6,10,11,12,14},{2,3,5,6,10,11,12,14,15},{2,3,5,6,10,11,12,15},{2,3,5,6,10,11,13},{2,3,5,6,10,11,13,14},{2,3,5,6,10,11,13,14,15},{2,3,5,6,10,11,13,15},{2,3,5,6,10,11,14},{2,3,5,6,10,11,14,15},{2,3,5,6,10,11,15},{2,3,5,6,10,12},{2,3,5,6,10,12,13},{2,3,5,6,10,12,13,14},{2,3,5,6,10,12,13,14,15},{2,3,5,6,10,12,13,15},{2,3,5,6,10,12,14},{2,3,5,6,10,12,14,15},{2,3,5,6,10,12,15},{2,3,5,6,10,13},{2,3,5,6,10,13,14},{2,3,5,6,10,13,14,15},{2,3,5,6,10,13,15},{2,3,5,6,10,14},{2,3,5,6,10,14,15},{2,3,5,6,10,15},{2,3,5,6,11},{2,3,5,6,11,12},{2,3,5,6,11,12,13},{2,3,5,6,11,12,13,14},{2,3,5,6,11,12,13,14,15},{2,3,5,6,11,12,13,15},{2,3,5,6,11,12,14},{2,3,5,6,11,12,14,15},{2,3,5,6,11,12,15},{2,3,5,6,11,13},{2,3,5,6,11,13,14},{2,3,5,6,11,13,14,15},{2,3,5,6,11,13,15},{2,3,5,6,11,14},{2,3,5,6,11,14,15},{2,3,5,6,11,15},{2,3,5,6,12},{2,3,5,6,12,13},{2,3,5,6,12,13,14},{2,3,5,6,12,13,14,15},{2,3,5,6,12,13,15},{2,3,5,6,12,14},{2,3,5,6,12,14,15},{2,3,5,6,12,15},{2,3,5,6,13},{2,3,5,6,13,14},{2,3,5,6,13,14,15},{2,3,5,6,13,15},{2,3,5,6,14},{2,3,5,6,14,15},{2,3,5,6,15},{2,3,5,7},{2,3,5,7,8},{2,3,5,7,8,9},{2,3,5,7,8,9,10},{2,3,5,7,8,9,10,11},{2,3,5,7,8,9,10,11,12},{2,3,5,7,8,9,10,11,12,13},{2,3,5,7,8,9,10,11,12,13,14},{2,3,5,7,8,9,10,11,12,13,14,15},{2,3,5,7,8,9,10,11,12,13,15},{2,3,5,7,8,9,10,11,12,14},{2,3,5,7,8,9,10,11,12,14,15},{2,3,5,7,8,9,10,11,12,15},{2,3,5,7,8,9,10,11,13},{2,3,5,7,8,9,10,11,13,14},{2,3,5,7,8,9,10,11,13,14,15},{2,3,5,7,8,9,10,11,13,15},{2,3,5,7,8,9,10,11,14},{2,3,5,7,8,9,10,11,14,15},{2,3,5,7,8,9,10,11,15},{2,3,5,7,8,9,10,12},{2,3,5,7,8,9,10,12,13},{2,3,5,7,8,9,10,12,13,14},{2,3,5,7,8,9,10,12,13,14,15},{2,3,5,7,8,9,10,12,13,15},{2,3,5,7,8,9,10,12,14},{2,3,5,7,8,9,10,12,14,15},{2,3,5,7,8,9,10,12,15},{2,3,5,7,8,9,10,13},{2,3,5,7,8,9,10,13,14},{2,3,5,7,8,9,10,13,14,15},{2,3,5,7,8,9,10,13,15},{2,3,5,7,8,9,10,14},{2,3,5,7,8,9,10,14,15},{2,3,5,7,8,9,10,15},{2,3,5,7,8,9,11},{2,3,5,7,8,9,11,12},{2,3,5,7,8,9,11,12,13},{2,3,5,7,8,9,11,12,13,14},{2,3,5,7,8,9,11,12,13,14,15},{2,3,5,7,8,9,11,12,13,15},{2,3,5,7,8,9,11,12,14},{2,3,5,7,8,9,11,12,14,15},{2,3,5,7,8,9,11,12,15},{2,3,5,7,8,9,11,13},{2,3,5,7,8,9,11,13,14},{2,3,5,7,8,9,11,13,14,15},{2,3,5,7,8,9,11,13,15},{2,3,5,7,8,9,11,14},{2,3,5,7,8,9,11,14,15},{2,3,5,7,8,9,11,15},{2,3,5,7,8,9,12},{2,3,5,7,8,9,12,13},{2,3,5,7,8,9,12,13,14},{2,3,5,7,8,9,12,13,14,15},{2,3,5,7,8,9,12,13,15},{2,3,5,7,8,9,12,14},{2,3,5,7,8,9,12,14,15},{2,3,5,7,8,9,12,15},{2,3,5,7,8,9,13},{2,3,5,7,8,9,13,14},{2,3,5,7,8,9,13,14,15},{2,3,5,7,8,9,13,15},{2,3,5,7,8,9,14},{2,3,5,7,8,9,14,15},{2,3,5,7,8,9,15},{2,3,5,7,8,10},{2,3,5,7,8,10,11},{2,3,5,7,8,10,11,12},{2,3,5,7,8,10,11,12,13},{2,3,5,7,8,10,11,12,13,14},{2,3,5,7,8,10,11,12,13,14,15},{2,3,5,7,8,10,11,12,13,15},{2,3,5,7,8,10,11,12,14},{2,3,5,7,8,10,11,12,14,15},{2,3,5,7,8,10,11,12,15},{2,3,5,7,8,10,11,13},{2,3,5,7,8,10,11,13,14},{2,3,5,7,8,10,11,13,14,15},{2,3,5,7,8,10,11,13,15},{2,3,5,7,8,10,11,14},{2,3,5,7,8,10,11,14,15},{2,3,5,7,8,10,11,15},{2,3,5,7,8,10,12},{2,3,5,7,8,10,12,13},{2,3,5,7,8,10,12,13,14},{2,3,5,7,8,10,12,13,14,15},{2,3,5,7,8,10,12,13,15},{2,3,5,7,8,10,12,14},{2,3,5,7,8,10,12,14,15},{2,3,5,7,8,10,12,15},{2,3,5,7,8,10,13},{2,3,5,7,8,10,13,14},{2,3,5,7,8,10,13,14,15},{2,3,5,7,8,10,13,15},{2,3,5,7,8,10,14},{2,3,5,7,8,10,14,15},{2,3,5,7,8,10,15},{2,3,5,7,8,11},{2,3,5,7,8,11,12},{2,3,5,7,8,11,12,13},{2,3,5,7,8,11,12,13,14},{2,3,5,7,8,11,12,13,14,15},{2,3,5,7,8,11,12,13,15},{2,3,5,7,8,11,12,14},{2,3,5,7,8,11,12,14,15},{2,3,5,7,8,11,12,15},{2,3,5,7,8,11,13},{2,3,5,7,8,11,13,14},{2,3,5,7,8,11,13,14,15},{2,3,5,7,8,11,13,15},{2,3,5,7,8,11,14},{2,3,5,7,8,11,14,15},{2,3,5,7,8,11,15},{2,3,5,7,8,12},{2,3,5,7,8,12,13},{2,3,5,7,8,12,13,14},{2,3,5,7,8,12,13,14,15},{2,3,5,7,8,12,13,15},{2,3,5,7,8,12,14},{2,3,5,7,8,12,14,15},{2,3,5,7,8,12,15},{2,3,5,7,8,13},{2,3,5,7,8,13,14},{2,3,5,7,8,13,14,15},{2,3,5,7,8,13,15},{2,3,5,7,8,14},{2,3,5,7,8,14,15},{2,3,5,7,8,15},{2,3,5,7,9},{2,3,5,7,9,10},{2,3,5,7,9,10,11},{2,3,5,7,9,10,11,12},{2,3,5,7,9,10,11,12,13},{2,3,5,7,9,10,11,12,13,14},{2,3,5,7,9,10,11,12,13,14,15},{2,3,5,7,9,10,11,12,13,15},{2,3,5,7,9,10,11,12,14},{2,3,5,7,9,10,11,12,14,15},{2,3,5,7,9,10,11,12,15},{2,3,5,7,9,10,11,13},{2,3,5,7,9,10,11,13,14},{2,3,5,7,9,10,11,13,14,15},{2,3,5,7,9,10,11,13,15},{2,3,5,7,9,10,11,14},{2,3,5,7,9,10,11,14,15},{2,3,5,7,9,10,11,15},{2,3,5,7,9,10,12},{2,3,5,7,9,10,12,13},{2,3,5,7,9,10,12,13,14},{2,3,5,7,9,10,12,13,14,15},{2,3,5,7,9,10,12,13,15},{2,3,5,7,9,10,12,14},{2,3,5,7,9,10,12,14,15},{2,3,5,7,9,10,12,15},{2,3,5,7,9,10,13},{2,3,5,7,9,10,13,14},{2,3,5,7,9,10,13,14,15},{2,3,5,7,9,10,13,15},{2,3,5,7,9,10,14},{2,3,5,7,9,10,14,15},{2,3,5,7,9,10,15},{2,3,5,7,9,11},{2,3,5,7,9,11,12},{2,3,5,7,9,11,12,13},{2,3,5,7,9,11,12,13,14},{2,3,5,7,9,11,12,13,14,15},{2,3,5,7,9,11,12,13,15},{2,3,5,7,9,11,12,14},{2,3,5,7,9,11,12,14,15},{2,3,5,7,9,11,12,15},{2,3,5,7,9,11,13},{2,3,5,7,9,11,13,14},{2,3,5,7,9,11,13,14,15},{2,3,5,7,9,11,13,15},{2,3,5,7,9,11,14},{2,3,5,7,9,11,14,15},{2,3,5,7,9,11,15},{2,3,5,7,9,12},{2,3,5,7,9,12,13},{2,3,5,7,9,12,13,14},{2,3,5,7,9,12,13,14,15},{2,3,5,7,9,12,13,15},{2,3,5,7,9,12,14},{2,3,5,7,9,12,14,15},{2,3,5,7,9,12,15},{2,3,5,7,9,13},{2,3,5,7,9,13,14},{2,3,5,7,9,13,14,15},{2,3,5,7,9,13,15},{2,3,5,7,9,14},{2,3,5,7,9,14,15},{2,3,5,7,9,15},{2,3,5,7,10},{2,3,5,7,10,11},{2,3,5,7,10,11,12},{2,3,5,7,10,11,12,13},{2,3,5,7,10,11,12,13,14},{2,3,5,7,10,11,12,13,14,15},{2,3,5,7,10,11,12,13,15},{2,3,5,7,10,11,12,14},{2,3,5,7,10,11,12,14,15},{2,3,5,7,10,11,12,15},{2,3,5,7,10,11,13},{2,3,5,7,10,11,13,14},{2,3,5,7,10,11,13,14,15},{2,3,5,7,10,11,13,15},{2,3,5,7,10,11,14},{2,3,5,7,10,11,14,15},{2,3,5,7,10,11,15},{2,3,5,7,10,12},{2,3,5,7,10,12,13},{2,3,5,7,10,12,13,14},{2,3,5,7,10,12,13,14,15},{2,3,5,7,10,12,13,15},{2,3,5,7,10,12,14},{2,3,5,7,10,12,14,15},{2,3,5,7,10,12,15},{2,3,5,7,10,13},{2,3,5,7,10,13,14},{2,3,5,7,10,13,14,15},{2,3,5,7,10,13,15},{2,3,5,7,10,14},{2,3,5,7,10,14,15},{2,3,5,7,10,15},{2,3,5,7,11},{2,3,5,7,11,12},{2,3,5,7,11,12,13},{2,3,5,7,11,12,13,14},{2,3,5,7,11,12,13,14,15},{2,3,5,7,11,12,13,15},{2,3,5,7,11,12,14},{2,3,5,7,11,12,14,15},{2,3,5,7,11,12,15},{2,3,5,7,11,13},{2,3,5,7,11,13,14},{2,3,5,7,11,13,14,15},{2,3,5,7,11,13,15},{2,3,5,7,11,14},{2,3,5,7,11,14,15},{2,3,5,7,11,15},{2,3,5,7,12},{2,3,5,7,12,13},{2,3,5,7,12,13,14},{2,3,5,7,12,13,14,15},{2,3,5,7,12,13,15},{2,3,5,7,12,14},{2,3,5,7,12,14,15},{2,3,5,7,12,15},{2,3,5,7,13},{2,3,5,7,13,14},{2,3,5,7,13,14,15},{2,3,5,7,13,15},{2,3,5,7,14},{2,3,5,7,14,15},{2,3,5,7,15},{2,3,5,8},{2,3,5,8,9},{2,3,5,8,9,10},{2,3,5,8,9,10,11},{2,3,5,8,9,10,11,12},{2,3,5,8,9,10,11,12,13},{2,3,5,8,9,10,11,12,13,14},{2,3,5,8,9,10,11,12,13,14,15},{2,3,5,8,9,10,11,12,13,15},{2,3,5,8,9,10,11,12,14},{2,3,5,8,9,10,11,12,14,15},{2,3,5,8,9,10,11,12,15},{2,3,5,8,9,10,11,13},{2,3,5,8,9,10,11,13,14},{2,3,5,8,9,10,11,13,14,15},{2,3,5,8,9,10,11,13,15},{2,3,5,8,9,10,11,14},{2,3,5,8,9,10,11,14,15},{2,3,5,8,9,10,11,15},{2,3,5,8,9,10,12},{2,3,5,8,9,10,12,13},{2,3,5,8,9,10,12,13,14},{2,3,5,8,9,10,12,13,14,15},{2,3,5,8,9,10,12,13,15},{2,3,5,8,9,10,12,14},{2,3,5,8,9,10,12,14,15},{2,3,5,8,9,10,12,15},{2,3,5,8,9,10,13},{2,3,5,8,9,10,13,14},{2,3,5,8,9,10,13,14,15},{2,3,5,8,9,10,13,15},{2,3,5,8,9,10,14},{2,3,5,8,9,10,14,15},{2,3,5,8,9,10,15},{2,3,5,8,9,11},{2,3,5,8,9,11,12},{2,3,5,8,9,11,12,13},{2,3,5,8,9,11,12,13,14},{2,3,5,8,9,11,12,13,14,15},{2,3,5,8,9,11,12,13,15},{2,3,5,8,9,11,12,14},{2,3,5,8,9,11,12,14,15},{2,3,5,8,9,11,12,15},{2,3,5,8,9,11,13},{2,3,5,8,9,11,13,14},{2,3,5,8,9,11,13,14,15},{2,3,5,8,9,11,13,15},{2,3,5,8,9,11,14},{2,3,5,8,9,11,14,15},{2,3,5,8,9,11,15},{2,3,5,8,9,12},{2,3,5,8,9,12,13},{2,3,5,8,9,12,13,14},{2,3,5,8,9,12,13,14,15},{2,3,5,8,9,12,13,15},{2,3,5,8,9,12,14},{2,3,5,8,9,12,14,15},{2,3,5,8,9,12,15},{2,3,5,8,9,13},{2,3,5,8,9,13,14},{2,3,5,8,9,13,14,15},{2,3,5,8,9,13,15},{2,3,5,8,9,14},{2,3,5,8,9,14,15},{2,3,5,8,9,15},{2,3,5,8,10},{2,3,5,8,10,11},{2,3,5,8,10,11,12},{2,3,5,8,10,11,12,13},{2,3,5,8,10,11,12,13,14},{2,3,5,8,10,11,12,13,14,15},{2,3,5,8,10,11,12,13,15},{2,3,5,8,10,11,12,14},{2,3,5,8,10,11,12,14,15},{2,3,5,8,10,11,12,15},{2,3,5,8,10,11,13},{2,3,5,8,10,11,13,14},{2,3,5,8,10,11,13,14,15},{2,3,5,8,10,11,13,15},{2,3,5,8,10,11,14},{2,3,5,8,10,11,14,15},{2,3,5,8,10,11,15},{2,3,5,8,10,12},{2,3,5,8,10,12,13},{2,3,5,8,10,12,13,14},{2,3,5,8,10,12,13,14,15},{2,3,5,8,10,12,13,15},{2,3,5,8,10,12,14},{2,3,5,8,10,12,14,15},{2,3,5,8,10,12,15},{2,3,5,8,10,13},{2,3,5,8,10,13,14},{2,3,5,8,10,13,14,15},{2,3,5,8,10,13,15},{2,3,5,8,10,14},{2,3,5,8,10,14,15},{2,3,5,8,10,15},{2,3,5,8,11},{2,3,5,8,11,12},{2,3,5,8,11,12,13},{2,3,5,8,11,12,13,14},{2,3,5,8,11,12,13,14,15},{2,3,5,8,11,12,13,15},{2,3,5,8,11,12,14},{2,3,5,8,11,12,14,15},{2,3,5,8,11,12,15},{2,3,5,8,11,13},{2,3,5,8,11,13,14},{2,3,5,8,11,13,14,15},{2,3,5,8,11,13,15},{2,3,5,8,11,14},{2,3,5,8,11,14,15},{2,3,5,8,11,15},{2,3,5,8,12},{2,3,5,8,12,13},{2,3,5,8,12,13,14},{2,3,5,8,12,13,14,15},{2,3,5,8,12,13,15},{2,3,5,8,12,14},{2,3,5,8,12,14,15},{2,3,5,8,12,15},{2,3,5,8,13},{2,3,5,8,13,14},{2,3,5,8,13,14,15},{2,3,5,8,13,15},{2,3,5,8,14},{2,3,5,8,14,15},{2,3,5,8,15},{2,3,5,9},{2,3,5,9,10},{2,3,5,9,10,11},{2,3,5,9,10,11,12},{2,3,5,9,10,11,12,13},{2,3,5,9,10,11,12,13,14},{2,3,5,9,10,11,12,13,14,15},{2,3,5,9,10,11,12,13,15},{2,3,5,9,10,11,12,14},{2,3,5,9,10,11,12,14,15},{2,3,5,9,10,11,12,15},{2,3,5,9,10,11,13},{2,3,5,9,10,11,13,14},{2,3,5,9,10,11,13,14,15},{2,3,5,9,10,11,13,15},{2,3,5,9,10,11,14},{2,3,5,9,10,11,14,15},{2,3,5,9,10,11,15},{2,3,5,9,10,12},{2,3,5,9,10,12,13},{2,3,5,9,10,12,13,14},{2,3,5,9,10,12,13,14,15},{2,3,5,9,10,12,13,15},{2,3,5,9,10,12,14},{2,3,5,9,10,12,14,15},{2,3,5,9,10,12,15},{2,3,5,9,10,13},{2,3,5,9,10,13,14},{2,3,5,9,10,13,14,15},{2,3,5,9,10,13,15},{2,3,5,9,10,14},{2,3,5,9,10,14,15},{2,3,5,9,10,15},{2,3,5,9,11},{2,3,5,9,11,12},{2,3,5,9,11,12,13},{2,3,5,9,11,12,13,14},{2,3,5,9,11,12,13,14,15},{2,3,5,9,11,12,13,15},{2,3,5,9,11,12,14},{2,3,5,9,11,12,14,15},{2,3,5,9,11,12,15},{2,3,5,9,11,13},{2,3,5,9,11,13,14},{2,3,5,9,11,13,14,15},{2,3,5,9,11,13,15},{2,3,5,9,11,14},{2,3,5,9,11,14,15},{2,3,5,9,11,15},{2,3,5,9,12},{2,3,5,9,12,13},{2,3,5,9,12,13,14},{2,3,5,9,12,13,14,15},{2,3,5,9,12,13,15},{2,3,5,9,12,14},{2,3,5,9,12,14,15},{2,3,5,9,12,15},{2,3,5,9,13},{2,3,5,9,13,14},{2,3,5,9,13,14,15},{2,3,5,9,13,15},{2,3,5,9,14},{2,3,5,9,14,15},{2,3,5,9,15},{2,3,5,10},{2,3,5,10,11},{2,3,5,10,11,12},{2,3,5,10,11,12,13},{2,3,5,10,11,12,13,14},{2,3,5,10,11,12,13,14,15},{2,3,5,10,11,12,13,15},{2,3,5,10,11,12,14},{2,3,5,10,11,12,14,15},{2,3,5,10,11,12,15},{2,3,5,10,11,13},{2,3,5,10,11,13,14},{2,3,5,10,11,13,14,15},{2,3,5,10,11,13,15},{2,3,5,10,11,14},{2,3,5,10,11,14,15},{2,3,5,10,11,15},{2,3,5,10,12},{2,3,5,10,12,13},{2,3,5,10,12,13,14},{2,3,5,10,12,13,14,15},{2,3,5,10,12,13,15},{2,3,5,10,12,14},{2,3,5,10,12,14,15},{2,3,5,10,12,15},{2,3,5,10,13},{2,3,5,10,13,14},{2,3,5,10,13,14,15},{2,3,5,10,13,15},{2,3,5,10,14},{2,3,5,10,14,15},{2,3,5,10,15},{2,3,5,11},{2,3,5,11,12},{2,3,5,11,12,13},{2,3,5,11,12,13,14},{2,3,5,11,12,13,14,15},{2,3,5,11,12,13,15},{2,3,5,11,12,14},{2,3,5,11,12,14,15},{2,3,5,11,12,15},{2,3,5,11,13},{2,3,5,11,13,14},{2,3,5,11,13,14,15},{2,3,5,11,13,15},{2,3,5,11,14},{2,3,5,11,14,15},{2,3,5,11,15},{2,3,5,12},{2,3,5,12,13},{2,3,5,12,13,14},{2,3,5,12,13,14,15},{2,3,5,12,13,15},{2,3,5,12,14},{2,3,5,12,14,15},{2,3,5,12,15},{2,3,5,13},{2,3,5,13,14},{2,3,5,13,14,15},{2,3,5,13,15},{2,3,5,14},{2,3,5,14,15},{2,3,5,15},{2,3,6},{2,3,6,7},{2,3,6,7,8},{2,3,6,7,8,9},{2,3,6,7,8,9,10},{2,3,6,7,8,9,10,11},{2,3,6,7,8,9,10,11,12},{2,3,6,7,8,9,10,11,12,13},{2,3,6,7,8,9,10,11,12,13,14},{2,3,6,7,8,9,10,11,12,13,14,15},{2,3,6,7,8,9,10,11,12,13,15},{2,3,6,7,8,9,10,11,12,14},{2,3,6,7,8,9,10,11,12,14,15},{2,3,6,7,8,9,10,11,12,15},{2,3,6,7,8,9,10,11,13},{2,3,6,7,8,9,10,11,13,14},{2,3,6,7,8,9,10,11,13,14,15},{2,3,6,7,8,9,10,11,13,15},{2,3,6,7,8,9,10,11,14},{2,3,6,7,8,9,10,11,14,15},{2,3,6,7,8,9,10,11,15},{2,3,6,7,8,9,10,12},{2,3,6,7,8,9,10,12,13},{2,3,6,7,8,9,10,12,13,14},{2,3,6,7,8,9,10,12,13,14,15},{2,3,6,7,8,9,10,12,13,15},{2,3,6,7,8,9,10,12,14},{2,3,6,7,8,9,10,12,14,15},{2,3,6,7,8,9,10,12,15},{2,3,6,7,8,9,10,13},{2,3,6,7,8,9,10,13,14},{2,3,6,7,8,9,10,13,14,15},{2,3,6,7,8,9,10,13,15},{2,3,6,7,8,9,10,14},{2,3,6,7,8,9,10,14,15},{2,3,6,7,8,9,10,15},{2,3,6,7,8,9,11},{2,3,6,7,8,9,11,12},{2,3,6,7,8,9,11,12,13},{2,3,6,7,8,9,11,12,13,14},{2,3,6,7,8,9,11,12,13,14,15},{2,3,6,7,8,9,11,12,13,15},{2,3,6,7,8,9,11,12,14},{2,3,6,7,8,9,11,12,14,15},{2,3,6,7,8,9,11,12,15},{2,3,6,7,8,9,11,13},{2,3,6,7,8,9,11,13,14},{2,3,6,7,8,9,11,13,14,15},{2,3,6,7,8,9,11,13,15},{2,3,6,7,8,9,11,14},{2,3,6,7,8,9,11,14,15},{2,3,6,7,8,9,11,15},{2,3,6,7,8,9,12},{2,3,6,7,8,9,12,13},{2,3,6,7,8,9,12,13,14},{2,3,6,7,8,9,12,13,14,15},{2,3,6,7,8,9,12,13,15},{2,3,6,7,8,9,12,14},{2,3,6,7,8,9,12,14,15},{2,3,6,7,8,9,12,15},{2,3,6,7,8,9,13},{2,3,6,7,8,9,13,14},{2,3,6,7,8,9,13,14,15},{2,3,6,7,8,9,13,15},{2,3,6,7,8,9,14},{2,3,6,7,8,9,14,15},{2,3,6,7,8,9,15},{2,3,6,7,8,10},{2,3,6,7,8,10,11},{2,3,6,7,8,10,11,12},{2,3,6,7,8,10,11,12,13},{2,3,6,7,8,10,11,12,13,14},{2,3,6,7,8,10,11,12,13,14,15},{2,3,6,7,8,10,11,12,13,15},{2,3,6,7,8,10,11,12,14},{2,3,6,7,8,10,11,12,14,15},{2,3,6,7,8,10,11,12,15},{2,3,6,7,8,10,11,13},{2,3,6,7,8,10,11,13,14},{2,3,6,7,8,10,11,13,14,15},{2,3,6,7,8,10,11,13,15},{2,3,6,7,8,10,11,14},{2,3,6,7,8,10,11,14,15},{2,3,6,7,8,10,11,15},{2,3,6,7,8,10,12},{2,3,6,7,8,10,12,13},{2,3,6,7,8,10,12,13,14},{2,3,6,7,8,10,12,13,14,15},{2,3,6,7,8,10,12,13,15},{2,3,6,7,8,10,12,14},{2,3,6,7,8,10,12,14,15},{2,3,6,7,8,10,12,15},{2,3,6,7,8,10,13},{2,3,6,7,8,10,13,14},{2,3,6,7,8,10,13,14,15},{2,3,6,7,8,10,13,15},{2,3,6,7,8,10,14},{2,3,6,7,8,10,14,15},{2,3,6,7,8,10,15},{2,3,6,7,8,11},{2,3,6,7,8,11,12},{2,3,6,7,8,11,12,13},{2,3,6,7,8,11,12,13,14},{2,3,6,7,8,11,12,13,14,15},{2,3,6,7,8,11,12,13,15},{2,3,6,7,8,11,12,14},{2,3,6,7,8,11,12,14,15},{2,3,6,7,8,11,12,15},{2,3,6,7,8,11,13},{2,3,6,7,8,11,13,14},{2,3,6,7,8,11,13,14,15},{2,3,6,7,8,11,13,15},{2,3,6,7,8,11,14},{2,3,6,7,8,11,14,15},{2,3,6,7,8,11,15},{2,3,6,7,8,12},{2,3,6,7,8,12,13},{2,3,6,7,8,12,13,14},{2,3,6,7,8,12,13,14,15},{2,3,6,7,8,12,13,15},{2,3,6,7,8,12,14},{2,3,6,7,8,12,14,15},{2,3,6,7,8,12,15},{2,3,6,7,8,13},{2,3,6,7,8,13,14},{2,3,6,7,8,13,14,15},{2,3,6,7,8,13,15},{2,3,6,7,8,14},{2,3,6,7,8,14,15},{2,3,6,7,8,15},{2,3,6,7,9},{2,3,6,7,9,10},{2,3,6,7,9,10,11},{2,3,6,7,9,10,11,12},{2,3,6,7,9,10,11,12,13},{2,3,6,7,9,10,11,12,13,14},{2,3,6,7,9,10,11,12,13,14,15},{2,3,6,7,9,10,11,12,13,15},{2,3,6,7,9,10,11,12,14},{2,3,6,7,9,10,11,12,14,15},{2,3,6,7,9,10,11,12,15},{2,3,6,7,9,10,11,13},{2,3,6,7,9,10,11,13,14},{2,3,6,7,9,10,11,13,14,15},{2,3,6,7,9,10,11,13,15},{2,3,6,7,9,10,11,14},{2,3,6,7,9,10,11,14,15},{2,3,6,7,9,10,11,15},{2,3,6,7,9,10,12},{2,3,6,7,9,10,12,13},{2,3,6,7,9,10,12,13,14},{2,3,6,7,9,10,12,13,14,15},{2,3,6,7,9,10,12,13,15},{2,3,6,7,9,10,12,14},{2,3,6,7,9,10,12,14,15},{2,3,6,7,9,10,12,15},{2,3,6,7,9,10,13},{2,3,6,7,9,10,13,14},{2,3,6,7,9,10,13,14,15},{2,3,6,7,9,10,13,15},{2,3,6,7,9,10,14},{2,3,6,7,9,10,14,15},{2,3,6,7,9,10,15},{2,3,6,7,9,11},{2,3,6,7,9,11,12},{2,3,6,7,9,11,12,13},{2,3,6,7,9,11,12,13,14},{2,3,6,7,9,11,12,13,14,15},{2,3,6,7,9,11,12,13,15},{2,3,6,7,9,11,12,14},{2,3,6,7,9,11,12,14,15},{2,3,6,7,9,11,12,15},{2,3,6,7,9,11,13},{2,3,6,7,9,11,13,14},{2,3,6,7,9,11,13,14,15},{2,3,6,7,9,11,13,15},{2,3,6,7,9,11,14},{2,3,6,7,9,11,14,15},{2,3,6,7,9,11,15},{2,3,6,7,9,12},{2,3,6,7,9,12,13},{2,3,6,7,9,12,13,14},{2,3,6,7,9,12,13,14,15},{2,3,6,7,9,12,13,15},{2,3,6,7,9,12,14},{2,3,6,7,9,12,14,15},{2,3,6,7,9,12,15},{2,3,6,7,9,13},{2,3,6,7,9,13,14},{2,3,6,7,9,13,14,15},{2,3,6,7,9,13,15},{2,3,6,7,9,14},{2,3,6,7,9,14,15},{2,3,6,7,9,15},{2,3,6,7,10},{2,3,6,7,10,11},{2,3,6,7,10,11,12},{2,3,6,7,10,11,12,13},{2,3,6,7,10,11,12,13,14},{2,3,6,7,10,11,12,13,14,15},{2,3,6,7,10,11,12,13,15},{2,3,6,7,10,11,12,14},{2,3,6,7,10,11,12,14,15},{2,3,6,7,10,11,12,15},{2,3,6,7,10,11,13},{2,3,6,7,10,11,13,14},{2,3,6,7,10,11,13,14,15},{2,3,6,7,10,11,13,15},{2,3,6,7,10,11,14},{2,3,6,7,10,11,14,15},{2,3,6,7,10,11,15},{2,3,6,7,10,12},{2,3,6,7,10,12,13},{2,3,6,7,10,12,13,14},{2,3,6,7,10,12,13,14,15},{2,3,6,7,10,12,13,15},{2,3,6,7,10,12,14},{2,3,6,7,10,12,14,15},{2,3,6,7,10,12,15},{2,3,6,7,10,13},{2,3,6,7,10,13,14},{2,3,6,7,10,13,14,15},{2,3,6,7,10,13,15},{2,3,6,7,10,14},{2,3,6,7,10,14,15},{2,3,6,7,10,15},{2,3,6,7,11},{2,3,6,7,11,12},{2,3,6,7,11,12,13},{2,3,6,7,11,12,13,14},{2,3,6,7,11,12,13,14,15},{2,3,6,7,11,12,13,15},{2,3,6,7,11,12,14},{2,3,6,7,11,12,14,15},{2,3,6,7,11,12,15},{2,3,6,7,11,13},{2,3,6,7,11,13,14},{2,3,6,7,11,13,14,15},{2,3,6,7,11,13,15},{2,3,6,7,11,14},{2,3,6,7,11,14,15},{2,3,6,7,11,15},{2,3,6,7,12},{2,3,6,7,12,13},{2,3,6,7,12,13,14},{2,3,6,7,12,13,14,15},{2,3,6,7,12,13,15},{2,3,6,7,12,14},{2,3,6,7,12,14,15},{2,3,6,7,12,15},{2,3,6,7,13},{2,3,6,7,13,14},{2,3,6,7,13,14,15},{2,3,6,7,13,15},{2,3,6,7,14},{2,3,6,7,14,15},{2,3,6,7,15},{2,3,6,8},{2,3,6,8,9},{2,3,6,8,9,10},{2,3,6,8,9,10,11},{2,3,6,8,9,10,11,12},{2,3,6,8,9,10,11,12,13},{2,3,6,8,9,10,11,12,13,14},{2,3,6,8,9,10,11,12,13,14,15},{2,3,6,8,9,10,11,12,13,15},{2,3,6,8,9,10,11,12,14},{2,3,6,8,9,10,11,12,14,15},{2,3,6,8,9,10,11,12,15},{2,3,6,8,9,10,11,13},{2,3,6,8,9,10,11,13,14},{2,3,6,8,9,10,11,13,14,15},{2,3,6,8,9,10,11,13,15},{2,3,6,8,9,10,11,14},{2,3,6,8,9,10,11,14,15},{2,3,6,8,9,10,11,15},{2,3,6,8,9,10,12},{2,3,6,8,9,10,12,13},{2,3,6,8,9,10,12,13,14},{2,3,6,8,9,10,12,13,14,15},{2,3,6,8,9,10,12,13,15},{2,3,6,8,9,10,12,14},{2,3,6,8,9,10,12,14,15},{2,3,6,8,9,10,12,15},{2,3,6,8,9,10,13},{2,3,6,8,9,10,13,14},{2,3,6,8,9,10,13,14,15},{2,3,6,8,9,10,13,15},{2,3,6,8,9,10,14},{2,3,6,8,9,10,14,15},{2,3,6,8,9,10,15},{2,3,6,8,9,11},{2,3,6,8,9,11,12},{2,3,6,8,9,11,12,13},{2,3,6,8,9,11,12,13,14},{2,3,6,8,9,11,12,13,14,15},{2,3,6,8,9,11,12,13,15},{2,3,6,8,9,11,12,14},{2,3,6,8,9,11,12,14,15},{2,3,6,8,9,11,12,15},{2,3,6,8,9,11,13},{2,3,6,8,9,11,13,14},{2,3,6,8,9,11,13,14,15},{2,3,6,8,9,11,13,15},{2,3,6,8,9,11,14},{2,3,6,8,9,11,14,15},{2,3,6,8,9,11,15},{2,3,6,8,9,12},{2,3,6,8,9,12,13},{2,3,6,8,9,12,13,14},{2,3,6,8,9,12,13,14,15},{2,3,6,8,9,12,13,15},{2,3,6,8,9,12,14},{2,3,6,8,9,12,14,15},{2,3,6,8,9,12,15},{2,3,6,8,9,13},{2,3,6,8,9,13,14},{2,3,6,8,9,13,14,15},{2,3,6,8,9,13,15},{2,3,6,8,9,14},{2,3,6,8,9,14,15},{2,3,6,8,9,15},{2,3,6,8,10},{2,3,6,8,10,11},{2,3,6,8,10,11,12},{2,3,6,8,10,11,12,13},{2,3,6,8,10,11,12,13,14},{2,3,6,8,10,11,12,13,14,15},{2,3,6,8,10,11,12,13,15},{2,3,6,8,10,11,12,14},{2,3,6,8,10,11,12,14,15},{2,3,6,8,10,11,12,15},{2,3,6,8,10,11,13},{2,3,6,8,10,11,13,14},{2,3,6,8,10,11,13,14,15},{2,3,6,8,10,11,13,15},{2,3,6,8,10,11,14},{2,3,6,8,10,11,14,15},{2,3,6,8,10,11,15},{2,3,6,8,10,12},{2,3,6,8,10,12,13},{2,3,6,8,10,12,13,14},{2,3,6,8,10,12,13,14,15},{2,3,6,8,10,12,13,15},{2,3,6,8,10,12,14},{2,3,6,8,10,12,14,15},{2,3,6,8,10,12,15},{2,3,6,8,10,13},{2,3,6,8,10,13,14},{2,3,6,8,10,13,14,15},{2,3,6,8,10,13,15},{2,3,6,8,10,14},{2,3,6,8,10,14,15},{2,3,6,8,10,15},{2,3,6,8,11},{2,3,6,8,11,12},{2,3,6,8,11,12,13},{2,3,6,8,11,12,13,14},{2,3,6,8,11,12,13,14,15},{2,3,6,8,11,12,13,15},{2,3,6,8,11,12,14},{2,3,6,8,11,12,14,15},{2,3,6,8,11,12,15},{2,3,6,8,11,13},{2,3,6,8,11,13,14},{2,3,6,8,11,13,14,15},{2,3,6,8,11,13,15},{2,3,6,8,11,14},{2,3,6,8,11,14,15},{2,3,6,8,11,15},{2,3,6,8,12},{2,3,6,8,12,13},{2,3,6,8,12,13,14},{2,3,6,8,12,13,14,15},{2,3,6,8,12,13,15},{2,3,6,8,12,14},{2,3,6,8,12,14,15},{2,3,6,8,12,15},{2,3,6,8,13},{2,3,6,8,13,14},{2,3,6,8,13,14,15},{2,3,6,8,13,15},{2,3,6,8,14},{2,3,6,8,14,15},{2,3,6,8,15},{2,3,6,9},{2,3,6,9,10},{2,3,6,9,10,11},{2,3,6,9,10,11,12},{2,3,6,9,10,11,12,13},{2,3,6,9,10,11,12,13,14},{2,3,6,9,10,11,12,13,14,15},{2,3,6,9,10,11,12,13,15},{2,3,6,9,10,11,12,14},{2,3,6,9,10,11,12,14,15},{2,3,6,9,10,11,12,15},{2,3,6,9,10,11,13},{2,3,6,9,10,11,13,14},{2,3,6,9,10,11,13,14,15},{2,3,6,9,10,11,13,15},{2,3,6,9,10,11,14},{2,3,6,9,10,11,14,15},{2,3,6,9,10,11,15},{2,3,6,9,10,12},{2,3,6,9,10,12,13},{2,3,6,9,10,12,13,14},{2,3,6,9,10,12,13,14,15},{2,3,6,9,10,12,13,15},{2,3,6,9,10,12,14},{2,3,6,9,10,12,14,15},{2,3,6,9,10,12,15},{2,3,6,9,10,13},{2,3,6,9,10,13,14},{2,3,6,9,10,13,14,15},{2,3,6,9,10,13,15},{2,3,6,9,10,14},{2,3,6,9,10,14,15},{2,3,6,9,10,15},{2,3,6,9,11},{2,3,6,9,11,12},{2,3,6,9,11,12,13},{2,3,6,9,11,12,13,14},{2,3,6,9,11,12,13,14,15},{2,3,6,9,11,12,13,15},{2,3,6,9,11,12,14},{2,3,6,9,11,12,14,15},{2,3,6,9,11,12,15},{2,3,6,9,11,13},{2,3,6,9,11,13,14},{2,3,6,9,11,13,14,15},{2,3,6,9,11,13,15},{2,3,6,9,11,14},{2,3,6,9,11,14,15},{2,3,6,9,11,15},{2,3,6,9,12},{2,3,6,9,12,13},{2,3,6,9,12,13,14},{2,3,6,9,12,13,14,15},{2,3,6,9,12,13,15},{2,3,6,9,12,14},{2,3,6,9,12,14,15},{2,3,6,9,12,15},{2,3,6,9,13},{2,3,6,9,13,14},{2,3,6,9,13,14,15},{2,3,6,9,13,15},{2,3,6,9,14},{2,3,6,9,14,15},{2,3,6,9,15},{2,3,6,10},{2,3,6,10,11},{2,3,6,10,11,12},{2,3,6,10,11,12,13},{2,3,6,10,11,12,13,14},{2,3,6,10,11,12,13,14,15},{2,3,6,10,11,12,13,15},{2,3,6,10,11,12,14},{2,3,6,10,11,12,14,15},{2,3,6,10,11,12,15},{2,3,6,10,11,13},{2,3,6,10,11,13,14},{2,3,6,10,11,13,14,15},{2,3,6,10,11,13,15},{2,3,6,10,11,14},{2,3,6,10,11,14,15},{2,3,6,10,11,15},{2,3,6,10,12},{2,3,6,10,12,13},{2,3,6,10,12,13,14},{2,3,6,10,12,13,14,15},{2,3,6,10,12,13,15},{2,3,6,10,12,14},{2,3,6,10,12,14,15},{2,3,6,10,12,15},{2,3,6,10,13},{2,3,6,10,13,14},{2,3,6,10,13,14,15},{2,3,6,10,13,15},{2,3,6,10,14},{2,3,6,10,14,15},{2,3,6,10,15},{2,3,6,11},{2,3,6,11,12},{2,3,6,11,12,13},{2,3,6,11,12,13,14},{2,3,6,11,12,13,14,15},{2,3,6,11,12,13,15},{2,3,6,11,12,14},{2,3,6,11,12,14,15},{2,3,6,11,12,15},{2,3,6,11,13},{2,3,6,11,13,14},{2,3,6,11,13,14,15},{2,3,6,11,13,15},{2,3,6,11,14},{2,3,6,11,14,15},{2,3,6,11,15},{2,3,6,12},{2,3,6,12,13},{2,3,6,12,13,14},{2,3,6,12,13,14,15},{2,3,6,12,13,15},{2,3,6,12,14},{2,3,6,12,14,15},{2,3,6,12,15},{2,3,6,13},{2,3,6,13,14},{2,3,6,13,14,15},{2,3,6,13,15},{2,3,6,14},{2,3,6,14,15},{2,3,6,15},{2,3,7},{2,3,7,8},{2,3,7,8,9},{2,3,7,8,9,10},{2,3,7,8,9,10,11},{2,3,7,8,9,10,11,12},{2,3,7,8,9,10,11,12,13},{2,3,7,8,9,10,11,12,13,14},{2,3,7,8,9,10,11,12,13,14,15},{2,3,7,8,9,10,11,12,13,15},{2,3,7,8,9,10,11,12,14},{2,3,7,8,9,10,11,12,14,15},{2,3,7,8,9,10,11,12,15},{2,3,7,8,9,10,11,13},{2,3,7,8,9,10,11,13,14},{2,3,7,8,9,10,11,13,14,15},{2,3,7,8,9,10,11,13,15},{2,3,7,8,9,10,11,14},{2,3,7,8,9,10,11,14,15},{2,3,7,8,9,10,11,15},{2,3,7,8,9,10,12},{2,3,7,8,9,10,12,13},{2,3,7,8,9,10,12,13,14},{2,3,7,8,9,10,12,13,14,15},{2,3,7,8,9,10,12,13,15},{2,3,7,8,9,10,12,14},{2,3,7,8,9,10,12,14,15},{2,3,7,8,9,10,12,15},{2,3,7,8,9,10,13},{2,3,7,8,9,10,13,14},{2,3,7,8,9,10,13,14,15},{2,3,7,8,9,10,13,15},{2,3,7,8,9,10,14},{2,3,7,8,9,10,14,15},{2,3,7,8,9,10,15},{2,3,7,8,9,11},{2,3,7,8,9,11,12},{2,3,7,8,9,11,12,13},{2,3,7,8,9,11,12,13,14},{2,3,7,8,9,11,12,13,14,15},{2,3,7,8,9,11,12,13,15},{2,3,7,8,9,11,12,14},{2,3,7,8,9,11,12,14,15},{2,3,7,8,9,11,12,15},{2,3,7,8,9,11,13},{2,3,7,8,9,11,13,14},{2,3,7,8,9,11,13,14,15},{2,3,7,8,9,11,13,15},{2,3,7,8,9,11,14},{2,3,7,8,9,11,14,15},{2,3,7,8,9,11,15},{2,3,7,8,9,12},{2,3,7,8,9,12,13},{2,3,7,8,9,12,13,14},{2,3,7,8,9,12,13,14,15},{2,3,7,8,9,12,13,15},{2,3,7,8,9,12,14},{2,3,7,8,9,12,14,15},{2,3,7,8,9,12,15},{2,3,7,8,9,13},{2,3,7,8,9,13,14},{2,3,7,8,9,13,14,15},{2,3,7,8,9,13,15},{2,3,7,8,9,14},{2,3,7,8,9,14,15},{2,3,7,8,9,15},{2,3,7,8,10},{2,3,7,8,10,11},{2,3,7,8,10,11,12},{2,3,7,8,10,11,12,13},{2,3,7,8,10,11,12,13,14},{2,3,7,8,10,11,12,13,14,15},{2,3,7,8,10,11,12,13,15},{2,3,7,8,10,11,12,14},{2,3,7,8,10,11,12,14,15},{2,3,7,8,10,11,12,15},{2,3,7,8,10,11,13},{2,3,7,8,10,11,13,14},{2,3,7,8,10,11,13,14,15},{2,3,7,8,10,11,13,15},{2,3,7,8,10,11,14},{2,3,7,8,10,11,14,15},{2,3,7,8,10,11,15},{2,3,7,8,10,12},{2,3,7,8,10,12,13},{2,3,7,8,10,12,13,14},{2,3,7,8,10,12,13,14,15},{2,3,7,8,10,12,13,15},{2,3,7,8,10,12,14},{2,3,7,8,10,12,14,15},{2,3,7,8,10,12,15},{2,3,7,8,10,13},{2,3,7,8,10,13,14},{2,3,7,8,10,13,14,15},{2,3,7,8,10,13,15},{2,3,7,8,10,14},{2,3,7,8,10,14,15},{2,3,7,8,10,15},{2,3,7,8,11},{2,3,7,8,11,12},{2,3,7,8,11,12,13},{2,3,7,8,11,12,13,14},{2,3,7,8,11,12,13,14,15},{2,3,7,8,11,12,13,15},{2,3,7,8,11,12,14},{2,3,7,8,11,12,14,15},{2,3,7,8,11,12,15},{2,3,7,8,11,13},{2,3,7,8,11,13,14},{2,3,7,8,11,13,14,15},{2,3,7,8,11,13,15},{2,3,7,8,11,14},{2,3,7,8,11,14,15},{2,3,7,8,11,15},{2,3,7,8,12},{2,3,7,8,12,13},{2,3,7,8,12,13,14},{2,3,7,8,12,13,14,15},{2,3,7,8,12,13,15},{2,3,7,8,12,14},{2,3,7,8,12,14,15},{2,3,7,8,12,15},{2,3,7,8,13},{2,3,7,8,13,14},{2,3,7,8,13,14,15},{2,3,7,8,13,15},{2,3,7,8,14},{2,3,7,8,14,15},{2,3,7,8,15},{2,3,7,9},{2,3,7,9,10},{2,3,7,9,10,11},{2,3,7,9,10,11,12},{2,3,7,9,10,11,12,13},{2,3,7,9,10,11,12,13,14},{2,3,7,9,10,11,12,13,14,15},{2,3,7,9,10,11,12,13,15},{2,3,7,9,10,11,12,14},{2,3,7,9,10,11,12,14,15},{2,3,7,9,10,11,12,15},{2,3,7,9,10,11,13},{2,3,7,9,10,11,13,14},{2,3,7,9,10,11,13,14,15},{2,3,7,9,10,11,13,15},{2,3,7,9,10,11,14},{2,3,7,9,10,11,14,15},{2,3,7,9,10,11,15},{2,3,7,9,10,12},{2,3,7,9,10,12,13},{2,3,7,9,10,12,13,14},{2,3,7,9,10,12,13,14,15},{2,3,7,9,10,12,13,15},{2,3,7,9,10,12,14},{2,3,7,9,10,12,14,15},{2,3,7,9,10,12,15},{2,3,7,9,10,13},{2,3,7,9,10,13,14},{2,3,7,9,10,13,14,15},{2,3,7,9,10,13,15},{2,3,7,9,10,14},{2,3,7,9,10,14,15},{2,3,7,9,10,15},{2,3,7,9,11},{2,3,7,9,11,12},{2,3,7,9,11,12,13},{2,3,7,9,11,12,13,14},{2,3,7,9,11,12,13,14,15},{2,3,7,9,11,12,13,15},{2,3,7,9,11,12,14},{2,3,7,9,11,12,14,15},{2,3,7,9,11,12,15},{2,3,7,9,11,13},{2,3,7,9,11,13,14},{2,3,7,9,11,13,14,15},{2,3,7,9,11,13,15},{2,3,7,9,11,14},{2,3,7,9,11,14,15},{2,3,7,9,11,15},{2,3,7,9,12},{2,3,7,9,12,13},{2,3,7,9,12,13,14},{2,3,7,9,12,13,14,15},{2,3,7,9,12,13,15},{2,3,7,9,12,14},{2,3,7,9,12,14,15},{2,3,7,9,12,15},{2,3,7,9,13},{2,3,7,9,13,14},{2,3,7,9,13,14,15},{2,3,7,9,13,15},{2,3,7,9,14},{2,3,7,9,14,15},{2,3,7,9,15},{2,3,7,10},{2,3,7,10,11},{2,3,7,10,11,12},{2,3,7,10,11,12,13},{2,3,7,10,11,12,13,14},{2,3,7,10,11,12,13,14,15},{2,3,7,10,11,12,13,15},{2,3,7,10,11,12,14},{2,3,7,10,11,12,14,15},{2,3,7,10,11,12,15},{2,3,7,10,11,13},{2,3,7,10,11,13,14},{2,3,7,10,11,13,14,15},{2,3,7,10,11,13,15},{2,3,7,10,11,14},{2,3,7,10,11,14,15},{2,3,7,10,11,15},{2,3,7,10,12},{2,3,7,10,12,13},{2,3,7,10,12,13,14},{2,3,7,10,12,13,14,15},{2,3,7,10,12,13,15},{2,3,7,10,12,14},{2,3,7,10,12,14,15},{2,3,7,10,12,15},{2,3,7,10,13},{2,3,7,10,13,14},{2,3,7,10,13,14,15},{2,3,7,10,13,15},{2,3,7,10,14},{2,3,7,10,14,15},{2,3,7,10,15},{2,3,7,11},{2,3,7,11,12},{2,3,7,11,12,13},{2,3,7,11,12,13,14},{2,3,7,11,12,13,14,15},{2,3,7,11,12,13,15},{2,3,7,11,12,14},{2,3,7,11,12,14,15},{2,3,7,11,12,15},{2,3,7,11,13},{2,3,7,11,13,14},{2,3,7,11,13,14,15},{2,3,7,11,13,15},{2,3,7,11,14},{2,3,7,11,14,15},{2,3,7,11,15},{2,3,7,12},{2,3,7,12,13},{2,3,7,12,13,14},{2,3,7,12,13,14,15},{2,3,7,12,13,15},{2,3,7,12,14},{2,3,7,12,14,15},{2,3,7,12,15},{2,3,7,13},{2,3,7,13,14},{2,3,7,13,14,15},{2,3,7,13,15},{2,3,7,14},{2,3,7,14,15},{2,3,7,15},{2,3,8},{2,3,8,9},{2,3,8,9,10},{2,3,8,9,10,11},{2,3,8,9,10,11,12},{2,3,8,9,10,11,12,13},{2,3,8,9,10,11,12,13,14},{2,3,8,9,10,11,12,13,14,15},{2,3,8,9,10,11,12,13,15},{2,3,8,9,10,11,12,14},{2,3,8,9,10,11,12,14,15},{2,3,8,9,10,11,12,15},{2,3,8,9,10,11,13},{2,3,8,9,10,11,13,14},{2,3,8,9,10,11,13,14,15},{2,3,8,9,10,11,13,15},{2,3,8,9,10,11,14},{2,3,8,9,10,11,14,15},{2,3,8,9,10,11,15},{2,3,8,9,10,12},{2,3,8,9,10,12,13},{2,3,8,9,10,12,13,14},{2,3,8,9,10,12,13,14,15},{2,3,8,9,10,12,13,15},{2,3,8,9,10,12,14},{2,3,8,9,10,12,14,15},{2,3,8,9,10,12,15},{2,3,8,9,10,13},{2,3,8,9,10,13,14},{2,3,8,9,10,13,14,15},{2,3,8,9,10,13,15},{2,3,8,9,10,14},{2,3,8,9,10,14,15},{2,3,8,9,10,15},{2,3,8,9,11},{2,3,8,9,11,12},{2,3,8,9,11,12,13},{2,3,8,9,11,12,13,14},{2,3,8,9,11,12,13,14,15},{2,3,8,9,11,12,13,15},{2,3,8,9,11,12,14},{2,3,8,9,11,12,14,15},{2,3,8,9,11,12,15},{2,3,8,9,11,13},{2,3,8,9,11,13,14},{2,3,8,9,11,13,14,15},{2,3,8,9,11,13,15},{2,3,8,9,11,14},{2,3,8,9,11,14,15},{2,3,8,9,11,15},{2,3,8,9,12},{2,3,8,9,12,13},{2,3,8,9,12,13,14},{2,3,8,9,12,13,14,15},{2,3,8,9,12,13,15},{2,3,8,9,12,14},{2,3,8,9,12,14,15},{2,3,8,9,12,15},{2,3,8,9,13},{2,3,8,9,13,14},{2,3,8,9,13,14,15},{2,3,8,9,13,15},{2,3,8,9,14},{2,3,8,9,14,15},{2,3,8,9,15},{2,3,8,10},{2,3,8,10,11},{2,3,8,10,11,12},{2,3,8,10,11,12,13},{2,3,8,10,11,12,13,14},{2,3,8,10,11,12,13,14,15},{2,3,8,10,11,12,13,15},{2,3,8,10,11,12,14},{2,3,8,10,11,12,14,15},{2,3,8,10,11,12,15},{2,3,8,10,11,13},{2,3,8,10,11,13,14},{2,3,8,10,11,13,14,15},{2,3,8,10,11,13,15},{2,3,8,10,11,14},{2,3,8,10,11,14,15},{2,3,8,10,11,15},{2,3,8,10,12},{2,3,8,10,12,13},{2,3,8,10,12,13,14},{2,3,8,10,12,13,14,15},{2,3,8,10,12,13,15},{2,3,8,10,12,14},{2,3,8,10,12,14,15},{2,3,8,10,12,15},{2,3,8,10,13},{2,3,8,10,13,14},{2,3,8,10,13,14,15},{2,3,8,10,13,15},{2,3,8,10,14},{2,3,8,10,14,15},{2,3,8,10,15},{2,3,8,11},{2,3,8,11,12},{2,3,8,11,12,13},{2,3,8,11,12,13,14},{2,3,8,11,12,13,14,15},{2,3,8,11,12,13,15},{2,3,8,11,12,14},{2,3,8,11,12,14,15},{2,3,8,11,12,15},{2,3,8,11,13},{2,3,8,11,13,14},{2,3,8,11,13,14,15},{2,3,8,11,13,15},{2,3,8,11,14},{2,3,8,11,14,15},{2,3,8,11,15},{2,3,8,12},{2,3,8,12,13},{2,3,8,12,13,14},{2,3,8,12,13,14,15},{2,3,8,12,13,15},{2,3,8,12,14},{2,3,8,12,14,15},{2,3,8,12,15},{2,3,8,13},{2,3,8,13,14},{2,3,8,13,14,15},{2,3,8,13,15},{2,3,8,14},{2,3,8,14,15},{2,3,8,15},{2,3,9},{2,3,9,10},{2,3,9,10,11},{2,3,9,10,11,12},{2,3,9,10,11,12,13},{2,3,9,10,11,12,13,14},{2,3,9,10,11,12,13,14,15},{2,3,9,10,11,12,13,15},{2,3,9,10,11,12,14},{2,3,9,10,11,12,14,15},{2,3,9,10,11,12,15},{2,3,9,10,11,13},{2,3,9,10,11,13,14},{2,3,9,10,11,13,14,15},{2,3,9,10,11,13,15},{2,3,9,10,11,14},{2,3,9,10,11,14,15},{2,3,9,10,11,15},{2,3,9,10,12},{2,3,9,10,12,13},{2,3,9,10,12,13,14},{2,3,9,10,12,13,14,15},{2,3,9,10,12,13,15},{2,3,9,10,12,14},{2,3,9,10,12,14,15},{2,3,9,10,12,15},{2,3,9,10,13},{2,3,9,10,13,14},{2,3,9,10,13,14,15},{2,3,9,10,13,15},{2,3,9,10,14},{2,3,9,10,14,15},{2,3,9,10,15},{2,3,9,11},{2,3,9,11,12},{2,3,9,11,12,13},{2,3,9,11,12,13,14},{2,3,9,11,12,13,14,15},{2,3,9,11,12,13,15},{2,3,9,11,12,14},{2,3,9,11,12,14,15},{2,3,9,11,12,15},{2,3,9,11,13},{2,3,9,11,13,14},{2,3,9,11,13,14,15},{2,3,9,11,13,15},{2,3,9,11,14},{2,3,9,11,14,15},{2,3,9,11,15},{2,3,9,12},{2,3,9,12,13},{2,3,9,12,13,14},{2,3,9,12,13,14,15},{2,3,9,12,13,15},{2,3,9,12,14},{2,3,9,12,14,15},{2,3,9,12,15},{2,3,9,13},{2,3,9,13,14},{2,3,9,13,14,15},{2,3,9,13,15},{2,3,9,14},{2,3,9,14,15},{2,3,9,15},{2,3,10},{2,3,10,11},{2,3,10,11,12},{2,3,10,11,12,13},{2,3,10,11,12,13,14},{2,3,10,11,12,13,14,15},{2,3,10,11,12,13,15},{2,3,10,11,12,14},{2,3,10,11,12,14,15},{2,3,10,11,12,15},{2,3,10,11,13},{2,3,10,11,13,14},{2,3,10,11,13,14,15},{2,3,10,11,13,15},{2,3,10,11,14},{2,3,10,11,14,15},{2,3,10,11,15},{2,3,10,12},{2,3,10,12,13},{2,3,10,12,13,14},{2,3,10,12,13,14,15},{2,3,10,12,13,15},{2,3,10,12,14},{2,3,10,12,14,15},{2,3,10,12,15},{2,3,10,13},{2,3,10,13,14},{2,3,10,13,14,15},{2,3,10,13,15},{2,3,10,14},{2,3,10,14,15},{2,3,10,15},{2,3,11},{2,3,11,12},{2,3,11,12,13},{2,3,11,12,13,14},{2,3,11,12,13,14,15},{2,3,11,12,13,15},{2,3,11,12,14},{2,3,11,12,14,15},{2,3,11,12,15},{2,3,11,13},{2,3,11,13,14},{2,3,11,13,14,15},{2,3,11,13,15},{2,3,11,14},{2,3,11,14,15},{2,3,11,15},{2,3,12},{2,3,12,13},{2,3,12,13,14},{2,3,12,13,14,15},{2,3,12,13,15},{2,3,12,14},{2,3,12,14,15},{2,3,12,15},{2,3,13},{2,3,13,14},{2,3,13,14,15},{2,3,13,15},{2,3,14},{2,3,14,15},{2,3,15},{2,4},{2,4,5},{2,4,5,6},{2,4,5,6,7},{2,4,5,6,7,8},{2,4,5,6,7,8,9},{2,4,5,6,7,8,9,10},{2,4,5,6,7,8,9,10,11},{2,4,5,6,7,8,9,10,11,12},{2,4,5,6,7,8,9,10,11,12,13},{2,4,5,6,7,8,9,10,11,12,13,14},{2,4,5,6,7,8,9,10,11,12,13,14,15},{2,4,5,6,7,8,9,10,11,12,13,15},{2,4,5,6,7,8,9,10,11,12,14},{2,4,5,6,7,8,9,10,11,12,14,15},{2,4,5,6,7,8,9,10,11,12,15},{2,4,5,6,7,8,9,10,11,13},{2,4,5,6,7,8,9,10,11,13,14},{2,4,5,6,7,8,9,10,11,13,14,15},{2,4,5,6,7,8,9,10,11,13,15},{2,4,5,6,7,8,9,10,11,14},{2,4,5,6,7,8,9,10,11,14,15},{2,4,5,6,7,8,9,10,11,15},{2,4,5,6,7,8,9,10,12},{2,4,5,6,7,8,9,10,12,13},{2,4,5,6,7,8,9,10,12,13,14},{2,4,5,6,7,8,9,10,12,13,14,15},{2,4,5,6,7,8,9,10,12,13,15},{2,4,5,6,7,8,9,10,12,14},{2,4,5,6,7,8,9,10,12,14,15},{2,4,5,6,7,8,9,10,12,15},{2,4,5,6,7,8,9,10,13},{2,4,5,6,7,8,9,10,13,14},{2,4,5,6,7,8,9,10,13,14,15},{2,4,5,6,7,8,9,10,13,15},{2,4,5,6,7,8,9,10,14},{2,4,5,6,7,8,9,10,14,15},{2,4,5,6,7,8,9,10,15},{2,4,5,6,7,8,9,11},{2,4,5,6,7,8,9,11,12},{2,4,5,6,7,8,9,11,12,13},{2,4,5,6,7,8,9,11,12,13,14},{2,4,5,6,7,8,9,11,12,13,14,15},{2,4,5,6,7,8,9,11,12,13,15},{2,4,5,6,7,8,9,11,12,14},{2,4,5,6,7,8,9,11,12,14,15},{2,4,5,6,7,8,9,11,12,15},{2,4,5,6,7,8,9,11,13},{2,4,5,6,7,8,9,11,13,14},{2,4,5,6,7,8,9,11,13,14,15},{2,4,5,6,7,8,9,11,13,15},{2,4,5,6,7,8,9,11,14},{2,4,5,6,7,8,9,11,14,15},{2,4,5,6,7,8,9,11,15},{2,4,5,6,7,8,9,12},{2,4,5,6,7,8,9,12,13},{2,4,5,6,7,8,9,12,13,14},{2,4,5,6,7,8,9,12,13,14,15},{2,4,5,6,7,8,9,12,13,15},{2,4,5,6,7,8,9,12,14},{2,4,5,6,7,8,9,12,14,15},{2,4,5,6,7,8,9,12,15},{2,4,5,6,7,8,9,13},{2,4,5,6,7,8,9,13,14},{2,4,5,6,7,8,9,13,14,15},{2,4,5,6,7,8,9,13,15},{2,4,5,6,7,8,9,14},{2,4,5,6,7,8,9,14,15},{2,4,5,6,7,8,9,15},{2,4,5,6,7,8,10},{2,4,5,6,7,8,10,11},{2,4,5,6,7,8,10,11,12},{2,4,5,6,7,8,10,11,12,13},{2,4,5,6,7,8,10,11,12,13,14},{2,4,5,6,7,8,10,11,12,13,14,15},{2,4,5,6,7,8,10,11,12,13,15},{2,4,5,6,7,8,10,11,12,14},{2,4,5,6,7,8,10,11,12,14,15},{2,4,5,6,7,8,10,11,12,15},{2,4,5,6,7,8,10,11,13},{2,4,5,6,7,8,10,11,13,14},{2,4,5,6,7,8,10,11,13,14,15},{2,4,5,6,7,8,10,11,13,15},{2,4,5,6,7,8,10,11,14},{2,4,5,6,7,8,10,11,14,15},{2,4,5,6,7,8,10,11,15},{2,4,5,6,7,8,10,12},{2,4,5,6,7,8,10,12,13},{2,4,5,6,7,8,10,12,13,14},{2,4,5,6,7,8,10,12,13,14,15},{2,4,5,6,7,8,10,12,13,15},{2,4,5,6,7,8,10,12,14},{2,4,5,6,7,8,10,12,14,15},{2,4,5,6,7,8,10,12,15},{2,4,5,6,7,8,10,13},{2,4,5,6,7,8,10,13,14},{2,4,5,6,7,8,10,13,14,15},{2,4,5,6,7,8,10,13,15},{2,4,5,6,7,8,10,14},{2,4,5,6,7,8,10,14,15},{2,4,5,6,7,8,10,15},{2,4,5,6,7,8,11},{2,4,5,6,7,8,11,12},{2,4,5,6,7,8,11,12,13},{2,4,5,6,7,8,11,12,13,14},{2,4,5,6,7,8,11,12,13,14,15},{2,4,5,6,7,8,11,12,13,15},{2,4,5,6,7,8,11,12,14},{2,4,5,6,7,8,11,12,14,15},{2,4,5,6,7,8,11,12,15},{2,4,5,6,7,8,11,13},{2,4,5,6,7,8,11,13,14},{2,4,5,6,7,8,11,13,14,15},{2,4,5,6,7,8,11,13,15},{2,4,5,6,7,8,11,14},{2,4,5,6,7,8,11,14,15},{2,4,5,6,7,8,11,15},{2,4,5,6,7,8,12},{2,4,5,6,7,8,12,13},{2,4,5,6,7,8,12,13,14},{2,4,5,6,7,8,12,13,14,15},{2,4,5,6,7,8,12,13,15},{2,4,5,6,7,8,12,14},{2,4,5,6,7,8,12,14,15},{2,4,5,6,7,8,12,15},{2,4,5,6,7,8,13},{2,4,5,6,7,8,13,14},{2,4,5,6,7,8,13,14,15},{2,4,5,6,7,8,13,15},{2,4,5,6,7,8,14},{2,4,5,6,7,8,14,15},{2,4,5,6,7,8,15},{2,4,5,6,7,9},{2,4,5,6,7,9,10},{2,4,5,6,7,9,10,11},{2,4,5,6,7,9,10,11,12},{2,4,5,6,7,9,10,11,12,13},{2,4,5,6,7,9,10,11,12,13,14},{2,4,5,6,7,9,10,11,12,13,14,15},{2,4,5,6,7,9,10,11,12,13,15},{2,4,5,6,7,9,10,11,12,14},{2,4,5,6,7,9,10,11,12,14,15},{2,4,5,6,7,9,10,11,12,15},{2,4,5,6,7,9,10,11,13},{2,4,5,6,7,9,10,11,13,14},{2,4,5,6,7,9,10,11,13,14,15},{2,4,5,6,7,9,10,11,13,15},{2,4,5,6,7,9,10,11,14},{2,4,5,6,7,9,10,11,14,15},{2,4,5,6,7,9,10,11,15},{2,4,5,6,7,9,10,12},{2,4,5,6,7,9,10,12,13},{2,4,5,6,7,9,10,12,13,14},{2,4,5,6,7,9,10,12,13,14,15},{2,4,5,6,7,9,10,12,13,15},{2,4,5,6,7,9,10,12,14},{2,4,5,6,7,9,10,12,14,15},{2,4,5,6,7,9,10,12,15},{2,4,5,6,7,9,10,13},{2,4,5,6,7,9,10,13,14},{2,4,5,6,7,9,10,13,14,15},{2,4,5,6,7,9,10,13,15},{2,4,5,6,7,9,10,14},{2,4,5,6,7,9,10,14,15},{2,4,5,6,7,9,10,15},{2,4,5,6,7,9,11},{2,4,5,6,7,9,11,12},{2,4,5,6,7,9,11,12,13},{2,4,5,6,7,9,11,12,13,14},{2,4,5,6,7,9,11,12,13,14,15},{2,4,5,6,7,9,11,12,13,15},{2,4,5,6,7,9,11,12,14},{2,4,5,6,7,9,11,12,14,15},{2,4,5,6,7,9,11,12,15},{2,4,5,6,7,9,11,13},{2,4,5,6,7,9,11,13,14},{2,4,5,6,7,9,11,13,14,15},{2,4,5,6,7,9,11,13,15},{2,4,5,6,7,9,11,14},{2,4,5,6,7,9,11,14,15},{2,4,5,6,7,9,11,15},{2,4,5,6,7,9,12},{2,4,5,6,7,9,12,13},{2,4,5,6,7,9,12,13,14},{2,4,5,6,7,9,12,13,14,15},{2,4,5,6,7,9,12,13,15},{2,4,5,6,7,9,12,14},{2,4,5,6,7,9,12,14,15},{2,4,5,6,7,9,12,15},{2,4,5,6,7,9,13},{2,4,5,6,7,9,13,14},{2,4,5,6,7,9,13,14,15},{2,4,5,6,7,9,13,15},{2,4,5,6,7,9,14},{2,4,5,6,7,9,14,15},{2,4,5,6,7,9,15},{2,4,5,6,7,10},{2,4,5,6,7,10,11},{2,4,5,6,7,10,11,12},{2,4,5,6,7,10,11,12,13},{2,4,5,6,7,10,11,12,13,14},{2,4,5,6,7,10,11,12,13,14,15},{2,4,5,6,7,10,11,12,13,15},{2,4,5,6,7,10,11,12,14},{2,4,5,6,7,10,11,12,14,15},{2,4,5,6,7,10,11,12,15},{2,4,5,6,7,10,11,13},{2,4,5,6,7,10,11,13,14},{2,4,5,6,7,10,11,13,14,15},{2,4,5,6,7,10,11,13,15},{2,4,5,6,7,10,11,14},{2,4,5,6,7,10,11,14,15},{2,4,5,6,7,10,11,15},{2,4,5,6,7,10,12},{2,4,5,6,7,10,12,13},{2,4,5,6,7,10,12,13,14},{2,4,5,6,7,10,12,13,14,15},{2,4,5,6,7,10,12,13,15},{2,4,5,6,7,10,12,14},{2,4,5,6,7,10,12,14,15},{2,4,5,6,7,10,12,15},{2,4,5,6,7,10,13},{2,4,5,6,7,10,13,14},{2,4,5,6,7,10,13,14,15},{2,4,5,6,7,10,13,15},{2,4,5,6,7,10,14},{2,4,5,6,7,10,14,15},{2,4,5,6,7,10,15},{2,4,5,6,7,11},{2,4,5,6,7,11,12},{2,4,5,6,7,11,12,13},{2,4,5,6,7,11,12,13,14},{2,4,5,6,7,11,12,13,14,15},{2,4,5,6,7,11,12,13,15},{2,4,5,6,7,11,12,14},{2,4,5,6,7,11,12,14,15},{2,4,5,6,7,11,12,15},{2,4,5,6,7,11,13},{2,4,5,6,7,11,13,14},{2,4,5,6,7,11,13,14,15},{2,4,5,6,7,11,13,15},{2,4,5,6,7,11,14},{2,4,5,6,7,11,14,15},{2,4,5,6,7,11,15},{2,4,5,6,7,12},{2,4,5,6,7,12,13},{2,4,5,6,7,12,13,14},{2,4,5,6,7,12,13,14,15},{2,4,5,6,7,12,13,15},{2,4,5,6,7,12,14},{2,4,5,6,7,12,14,15},{2,4,5,6,7,12,15},{2,4,5,6,7,13},{2,4,5,6,7,13,14},{2,4,5,6,7,13,14,15},{2,4,5,6,7,13,15},{2,4,5,6,7,14},{2,4,5,6,7,14,15},{2,4,5,6,7,15},{2,4,5,6,8},{2,4,5,6,8,9},{2,4,5,6,8,9,10},{2,4,5,6,8,9,10,11},{2,4,5,6,8,9,10,11,12},{2,4,5,6,8,9,10,11,12,13},{2,4,5,6,8,9,10,11,12,13,14},{2,4,5,6,8,9,10,11,12,13,14,15},{2,4,5,6,8,9,10,11,12,13,15},{2,4,5,6,8,9,10,11,12,14},{2,4,5,6,8,9,10,11,12,14,15},{2,4,5,6,8,9,10,11,12,15},{2,4,5,6,8,9,10,11,13},{2,4,5,6,8,9,10,11,13,14},{2,4,5,6,8,9,10,11,13,14,15},{2,4,5,6,8,9,10,11,13,15},{2,4,5,6,8,9,10,11,14},{2,4,5,6,8,9,10,11,14,15},{2,4,5,6,8,9,10,11,15},{2,4,5,6,8,9,10,12},{2,4,5,6,8,9,10,12,13},{2,4,5,6,8,9,10,12,13,14},{2,4,5,6,8,9,10,12,13,14,15},{2,4,5,6,8,9,10,12,13,15},{2,4,5,6,8,9,10,12,14},{2,4,5,6,8,9,10,12,14,15},{2,4,5,6,8,9,10,12,15},{2,4,5,6,8,9,10,13},{2,4,5,6,8,9,10,13,14},{2,4,5,6,8,9,10,13,14,15},{2,4,5,6,8,9,10,13,15},{2,4,5,6,8,9,10,14},{2,4,5,6,8,9,10,14,15},{2,4,5,6,8,9,10,15},{2,4,5,6,8,9,11},{2,4,5,6,8,9,11,12},{2,4,5,6,8,9,11,12,13},{2,4,5,6,8,9,11,12,13,14},{2,4,5,6,8,9,11,12,13,14,15},{2,4,5,6,8,9,11,12,13,15},{2,4,5,6,8,9,11,12,14},{2,4,5,6,8,9,11,12,14,15},{2,4,5,6,8,9,11,12,15},{2,4,5,6,8,9,11,13},{2,4,5,6,8,9,11,13,14},{2,4,5,6,8,9,11,13,14,15},{2,4,5,6,8,9,11,13,15},{2,4,5,6,8,9,11,14},{2,4,5,6,8,9,11,14,15},{2,4,5,6,8,9,11,15},{2,4,5,6,8,9,12},{2,4,5,6,8,9,12,13},{2,4,5,6,8,9,12,13,14},{2,4,5,6,8,9,12,13,14,15},{2,4,5,6,8,9,12,13,15},{2,4,5,6,8,9,12,14},{2,4,5,6,8,9,12,14,15},{2,4,5,6,8,9,12,15},{2,4,5,6,8,9,13},{2,4,5,6,8,9,13,14},{2,4,5,6,8,9,13,14,15},{2,4,5,6,8,9,13,15},{2,4,5,6,8,9,14},{2,4,5,6,8,9,14,15},{2,4,5,6,8,9,15},{2,4,5,6,8,10},{2,4,5,6,8,10,11},{2,4,5,6,8,10,11,12},{2,4,5,6,8,10,11,12,13},{2,4,5,6,8,10,11,12,13,14},{2,4,5,6,8,10,11,12,13,14,15},{2,4,5,6,8,10,11,12,13,15},{2,4,5,6,8,10,11,12,14},{2,4,5,6,8,10,11,12,14,15},{2,4,5,6,8,10,11,12,15},{2,4,5,6,8,10,11,13},{2,4,5,6,8,10,11,13,14},{2,4,5,6,8,10,11,13,14,15},{2,4,5,6,8,10,11,13,15},{2,4,5,6,8,10,11,14},{2,4,5,6,8,10,11,14,15},{2,4,5,6,8,10,11,15},{2,4,5,6,8,10,12},{2,4,5,6,8,10,12,13},{2,4,5,6,8,10,12,13,14},{2,4,5,6,8,10,12,13,14,15},{2,4,5,6,8,10,12,13,15},{2,4,5,6,8,10,12,14},{2,4,5,6,8,10,12,14,15},{2,4,5,6,8,10,12,15},{2,4,5,6,8,10,13},{2,4,5,6,8,10,13,14},{2,4,5,6,8,10,13,14,15},{2,4,5,6,8,10,13,15},{2,4,5,6,8,10,14},{2,4,5,6,8,10,14,15},{2,4,5,6,8,10,15},{2,4,5,6,8,11},{2,4,5,6,8,11,12},{2,4,5,6,8,11,12,13},{2,4,5,6,8,11,12,13,14},{2,4,5,6,8,11,12,13,14,15},{2,4,5,6,8,11,12,13,15},{2,4,5,6,8,11,12,14},{2,4,5,6,8,11,12,14,15},{2,4,5,6,8,11,12,15},{2,4,5,6,8,11,13},{2,4,5,6,8,11,13,14},{2,4,5,6,8,11,13,14,15},{2,4,5,6,8,11,13,15},{2,4,5,6,8,11,14},{2,4,5,6,8,11,14,15},{2,4,5,6,8,11,15},{2,4,5,6,8,12},{2,4,5,6,8,12,13},{2,4,5,6,8,12,13,14},{2,4,5,6,8,12,13,14,15},{2,4,5,6,8,12,13,15},{2,4,5,6,8,12,14},{2,4,5,6,8,12,14,15},{2,4,5,6,8,12,15},{2,4,5,6,8,13},{2,4,5,6,8,13,14},{2,4,5,6,8,13,14,15},{2,4,5,6,8,13,15},{2,4,5,6,8,14},{2,4,5,6,8,14,15},{2,4,5,6,8,15},{2,4,5,6,9},{2,4,5,6,9,10},{2,4,5,6,9,10,11},{2,4,5,6,9,10,11,12},{2,4,5,6,9,10,11,12,13},{2,4,5,6,9,10,11,12,13,14},{2,4,5,6,9,10,11,12,13,14,15},{2,4,5,6,9,10,11,12,13,15},{2,4,5,6,9,10,11,12,14},{2,4,5,6,9,10,11,12,14,15},{2,4,5,6,9,10,11,12,15},{2,4,5,6,9,10,11,13},{2,4,5,6,9,10,11,13,14},{2,4,5,6,9,10,11,13,14,15},{2,4,5,6,9,10,11,13,15},{2,4,5,6,9,10,11,14},{2,4,5,6,9,10,11,14,15},{2,4,5,6,9,10,11,15},{2,4,5,6,9,10,12},{2,4,5,6,9,10,12,13},{2,4,5,6,9,10,12,13,14},{2,4,5,6,9,10,12,13,14,15},{2,4,5,6,9,10,12,13,15},{2,4,5,6,9,10,12,14},{2,4,5,6,9,10,12,14,15},{2,4,5,6,9,10,12,15},{2,4,5,6,9,10,13},{2,4,5,6,9,10,13,14},{2,4,5,6,9,10,13,14,15},{2,4,5,6,9,10,13,15},{2,4,5,6,9,10,14},{2,4,5,6,9,10,14,15},{2,4,5,6,9,10,15},{2,4,5,6,9,11},{2,4,5,6,9,11,12},{2,4,5,6,9,11,12,13},{2,4,5,6,9,11,12,13,14},{2,4,5,6,9,11,12,13,14,15},{2,4,5,6,9,11,12,13,15},{2,4,5,6,9,11,12,14},{2,4,5,6,9,11,12,14,15},{2,4,5,6,9,11,12,15},{2,4,5,6,9,11,13},{2,4,5,6,9,11,13,14},{2,4,5,6,9,11,13,14,15},{2,4,5,6,9,11,13,15},{2,4,5,6,9,11,14},{2,4,5,6,9,11,14,15},{2,4,5,6,9,11,15},{2,4,5,6,9,12},{2,4,5,6,9,12,13},{2,4,5,6,9,12,13,14},{2,4,5,6,9,12,13,14,15},{2,4,5,6,9,12,13,15},{2,4,5,6,9,12,14},{2,4,5,6,9,12,14,15},{2,4,5,6,9,12,15},{2,4,5,6,9,13},{2,4,5,6,9,13,14},{2,4,5,6,9,13,14,15},{2,4,5,6,9,13,15},{2,4,5,6,9,14},{2,4,5,6,9,14,15},{2,4,5,6,9,15},{2,4,5,6,10},{2,4,5,6,10,11},{2,4,5,6,10,11,12},{2,4,5,6,10,11,12,13},{2,4,5,6,10,11,12,13,14},{2,4,5,6,10,11,12,13,14,15},{2,4,5,6,10,11,12,13,15},{2,4,5,6,10,11,12,14},{2,4,5,6,10,11,12,14,15},{2,4,5,6,10,11,12,15},{2,4,5,6,10,11,13},{2,4,5,6,10,11,13,14},{2,4,5,6,10,11,13,14,15},{2,4,5,6,10,11,13,15},{2,4,5,6,10,11,14},{2,4,5,6,10,11,14,15},{2,4,5,6,10,11,15},{2,4,5,6,10,12},{2,4,5,6,10,12,13},{2,4,5,6,10,12,13,14},{2,4,5,6,10,12,13,14,15},{2,4,5,6,10,12,13,15},{2,4,5,6,10,12,14},{2,4,5,6,10,12,14,15},{2,4,5,6,10,12,15},{2,4,5,6,10,13},{2,4,5,6,10,13,14},{2,4,5,6,10,13,14,15},{2,4,5,6,10,13,15},{2,4,5,6,10,14},{2,4,5,6,10,14,15},{2,4,5,6,10,15},{2,4,5,6,11},{2,4,5,6,11,12},{2,4,5,6,11,12,13},{2,4,5,6,11,12,13,14},{2,4,5,6,11,12,13,14,15},{2,4,5,6,11,12,13,15},{2,4,5,6,11,12,14},{2,4,5,6,11,12,14,15},{2,4,5,6,11,12,15},{2,4,5,6,11,13},{2,4,5,6,11,13,14},{2,4,5,6,11,13,14,15},{2,4,5,6,11,13,15},{2,4,5,6,11,14},{2,4,5,6,11,14,15},{2,4,5,6,11,15},{2,4,5,6,12},{2,4,5,6,12,13},{2,4,5,6,12,13,14},{2,4,5,6,12,13,14,15},{2,4,5,6,12,13,15},{2,4,5,6,12,14},{2,4,5,6,12,14,15},{2,4,5,6,12,15},{2,4,5,6,13},{2,4,5,6,13,14},{2,4,5,6,13,14,15},{2,4,5,6,13,15},{2,4,5,6,14},{2,4,5,6,14,15},{2,4,5,6,15},{2,4,5,7},{2,4,5,7,8},{2,4,5,7,8,9},{2,4,5,7,8,9,10},{2,4,5,7,8,9,10,11},{2,4,5,7,8,9,10,11,12},{2,4,5,7,8,9,10,11,12,13},{2,4,5,7,8,9,10,11,12,13,14},{2,4,5,7,8,9,10,11,12,13,14,15},{2,4,5,7,8,9,10,11,12,13,15},{2,4,5,7,8,9,10,11,12,14},{2,4,5,7,8,9,10,11,12,14,15},{2,4,5,7,8,9,10,11,12,15},{2,4,5,7,8,9,10,11,13},{2,4,5,7,8,9,10,11,13,14},{2,4,5,7,8,9,10,11,13,14,15},{2,4,5,7,8,9,10,11,13,15},{2,4,5,7,8,9,10,11,14},{2,4,5,7,8,9,10,11,14,15},{2,4,5,7,8,9,10,11,15},{2,4,5,7,8,9,10,12},{2,4,5,7,8,9,10,12,13},{2,4,5,7,8,9,10,12,13,14},{2,4,5,7,8,9,10,12,13,14,15},{2,4,5,7,8,9,10,12,13,15},{2,4,5,7,8,9,10,12,14},{2,4,5,7,8,9,10,12,14,15},{2,4,5,7,8,9,10,12,15},{2,4,5,7,8,9,10,13},{2,4,5,7,8,9,10,13,14},{2,4,5,7,8,9,10,13,14,15},{2,4,5,7,8,9,10,13,15},{2,4,5,7,8,9,10,14},{2,4,5,7,8,9,10,14,15},{2,4,5,7,8,9,10,15},{2,4,5,7,8,9,11},{2,4,5,7,8,9,11,12},{2,4,5,7,8,9,11,12,13},{2,4,5,7,8,9,11,12,13,14},{2,4,5,7,8,9,11,12,13,14,15},{2,4,5,7,8,9,11,12,13,15},{2,4,5,7,8,9,11,12,14},{2,4,5,7,8,9,11,12,14,15},{2,4,5,7,8,9,11,12,15},{2,4,5,7,8,9,11,13},{2,4,5,7,8,9,11,13,14},{2,4,5,7,8,9,11,13,14,15},{2,4,5,7,8,9,11,13,15},{2,4,5,7,8,9,11,14},{2,4,5,7,8,9,11,14,15},{2,4,5,7,8,9,11,15},{2,4,5,7,8,9,12},{2,4,5,7,8,9,12,13},{2,4,5,7,8,9,12,13,14},{2,4,5,7,8,9,12,13,14,15},{2,4,5,7,8,9,12,13,15},{2,4,5,7,8,9,12,14},{2,4,5,7,8,9,12,14,15},{2,4,5,7,8,9,12,15},{2,4,5,7,8,9,13},{2,4,5,7,8,9,13,14},{2,4,5,7,8,9,13,14,15},{2,4,5,7,8,9,13,15},{2,4,5,7,8,9,14},{2,4,5,7,8,9,14,15},{2,4,5,7,8,9,15},{2,4,5,7,8,10},{2,4,5,7,8,10,11},{2,4,5,7,8,10,11,12},{2,4,5,7,8,10,11,12,13},{2,4,5,7,8,10,11,12,13,14},{2,4,5,7,8,10,11,12,13,14,15},{2,4,5,7,8,10,11,12,13,15},{2,4,5,7,8,10,11,12,14},{2,4,5,7,8,10,11,12,14,15},{2,4,5,7,8,10,11,12,15},{2,4,5,7,8,10,11,13},{2,4,5,7,8,10,11,13,14},{2,4,5,7,8,10,11,13,14,15},{2,4,5,7,8,10,11,13,15},{2,4,5,7,8,10,11,14},{2,4,5,7,8,10,11,14,15},{2,4,5,7,8,10,11,15},{2,4,5,7,8,10,12},{2,4,5,7,8,10,12,13},{2,4,5,7,8,10,12,13,14},{2,4,5,7,8,10,12,13,14,15},{2,4,5,7,8,10,12,13,15},{2,4,5,7,8,10,12,14},{2,4,5,7,8,10,12,14,15},{2,4,5,7,8,10,12,15},{2,4,5,7,8,10,13},{2,4,5,7,8,10,13,14},{2,4,5,7,8,10,13,14,15},{2,4,5,7,8,10,13,15},{2,4,5,7,8,10,14},{2,4,5,7,8,10,14,15},{2,4,5,7,8,10,15},{2,4,5,7,8,11},{2,4,5,7,8,11,12},{2,4,5,7,8,11,12,13},{2,4,5,7,8,11,12,13,14},{2,4,5,7,8,11,12,13,14,15},{2,4,5,7,8,11,12,13,15},{2,4,5,7,8,11,12,14},{2,4,5,7,8,11,12,14,15},{2,4,5,7,8,11,12,15},{2,4,5,7,8,11,13},{2,4,5,7,8,11,13,14},{2,4,5,7,8,11,13,14,15},{2,4,5,7,8,11,13,15},{2,4,5,7,8,11,14},{2,4,5,7,8,11,14,15},{2,4,5,7,8,11,15},{2,4,5,7,8,12},{2,4,5,7,8,12,13},{2,4,5,7,8,12,13,14},{2,4,5,7,8,12,13,14,15},{2,4,5,7,8,12,13,15},{2,4,5,7,8,12,14},{2,4,5,7,8,12,14,15},{2,4,5,7,8,12,15},{2,4,5,7,8,13},{2,4,5,7,8,13,14},{2,4,5,7,8,13,14,15},{2,4,5,7,8,13,15},{2,4,5,7,8,14},{2,4,5,7,8,14,15},{2,4,5,7,8,15},{2,4,5,7,9},{2,4,5,7,9,10},{2,4,5,7,9,10,11},{2,4,5,7,9,10,11,12},{2,4,5,7,9,10,11,12,13},{2,4,5,7,9,10,11,12,13,14},{2,4,5,7,9,10,11,12,13,14,15},{2,4,5,7,9,10,11,12,13,15},{2,4,5,7,9,10,11,12,14},{2,4,5,7,9,10,11,12,14,15},{2,4,5,7,9,10,11,12,15},{2,4,5,7,9,10,11,13},{2,4,5,7,9,10,11,13,14},{2,4,5,7,9,10,11,13,14,15},{2,4,5,7,9,10,11,13,15},{2,4,5,7,9,10,11,14},{2,4,5,7,9,10,11,14,15},{2,4,5,7,9,10,11,15},{2,4,5,7,9,10,12},{2,4,5,7,9,10,12,13},{2,4,5,7,9,10,12,13,14},{2,4,5,7,9,10,12,13,14,15},{2,4,5,7,9,10,12,13,15},{2,4,5,7,9,10,12,14},{2,4,5,7,9,10,12,14,15},{2,4,5,7,9,10,12,15},{2,4,5,7,9,10,13},{2,4,5,7,9,10,13,14},{2,4,5,7,9,10,13,14,15},{2,4,5,7,9,10,13,15},{2,4,5,7,9,10,14},{2,4,5,7,9,10,14,15},{2,4,5,7,9,10,15},{2,4,5,7,9,11},{2,4,5,7,9,11,12},{2,4,5,7,9,11,12,13},{2,4,5,7,9,11,12,13,14},{2,4,5,7,9,11,12,13,14,15},{2,4,5,7,9,11,12,13,15},{2,4,5,7,9,11,12,14},{2,4,5,7,9,11,12,14,15},{2,4,5,7,9,11,12,15},{2,4,5,7,9,11,13},{2,4,5,7,9,11,13,14},{2,4,5,7,9,11,13,14,15},{2,4,5,7,9,11,13,15},{2,4,5,7,9,11,14},{2,4,5,7,9,11,14,15},{2,4,5,7,9,11,15},{2,4,5,7,9,12},{2,4,5,7,9,12,13},{2,4,5,7,9,12,13,14},{2,4,5,7,9,12,13,14,15},{2,4,5,7,9,12,13,15},{2,4,5,7,9,12,14},{2,4,5,7,9,12,14,15},{2,4,5,7,9,12,15},{2,4,5,7,9,13},{2,4,5,7,9,13,14},{2,4,5,7,9,13,14,15},{2,4,5,7,9,13,15},{2,4,5,7,9,14},{2,4,5,7,9,14,15},{2,4,5,7,9,15},{2,4,5,7,10},{2,4,5,7,10,11},{2,4,5,7,10,11,12},{2,4,5,7,10,11,12,13},{2,4,5,7,10,11,12,13,14},{2,4,5,7,10,11,12,13,14,15},{2,4,5,7,10,11,12,13,15},{2,4,5,7,10,11,12,14},{2,4,5,7,10,11,12,14,15},{2,4,5,7,10,11,12,15},{2,4,5,7,10,11,13},{2,4,5,7,10,11,13,14},{2,4,5,7,10,11,13,14,15},{2,4,5,7,10,11,13,15},{2,4,5,7,10,11,14},{2,4,5,7,10,11,14,15},{2,4,5,7,10,11,15},{2,4,5,7,10,12},{2,4,5,7,10,12,13},{2,4,5,7,10,12,13,14},{2,4,5,7,10,12,13,14,15},{2,4,5,7,10,12,13,15},{2,4,5,7,10,12,14},{2,4,5,7,10,12,14,15},{2,4,5,7,10,12,15},{2,4,5,7,10,13},{2,4,5,7,10,13,14},{2,4,5,7,10,13,14,15},{2,4,5,7,10,13,15},{2,4,5,7,10,14},{2,4,5,7,10,14,15},{2,4,5,7,10,15},{2,4,5,7,11},{2,4,5,7,11,12},{2,4,5,7,11,12,13},{2,4,5,7,11,12,13,14},{2,4,5,7,11,12,13,14,15},{2,4,5,7,11,12,13,15},{2,4,5,7,11,12,14},{2,4,5,7,11,12,14,15},{2,4,5,7,11,12,15},{2,4,5,7,11,13},{2,4,5,7,11,13,14},{2,4,5,7,11,13,14,15},{2,4,5,7,11,13,15},{2,4,5,7,11,14},{2,4,5,7,11,14,15},{2,4,5,7,11,15},{2,4,5,7,12},{2,4,5,7,12,13},{2,4,5,7,12,13,14},{2,4,5,7,12,13,14,15},{2,4,5,7,12,13,15},{2,4,5,7,12,14},{2,4,5,7,12,14,15},{2,4,5,7,12,15},{2,4,5,7,13},{2,4,5,7,13,14},{2,4,5,7,13,14,15},{2,4,5,7,13,15},{2,4,5,7,14},{2,4,5,7,14,15},{2,4,5,7,15},{2,4,5,8},{2,4,5,8,9},{2,4,5,8,9,10},{2,4,5,8,9,10,11},{2,4,5,8,9,10,11,12},{2,4,5,8,9,10,11,12,13},{2,4,5,8,9,10,11,12,13,14},{2,4,5,8,9,10,11,12,13,14,15},{2,4,5,8,9,10,11,12,13,15},{2,4,5,8,9,10,11,12,14},{2,4,5,8,9,10,11,12,14,15},{2,4,5,8,9,10,11,12,15},{2,4,5,8,9,10,11,13},{2,4,5,8,9,10,11,13,14},{2,4,5,8,9,10,11,13,14,15},{2,4,5,8,9,10,11,13,15},{2,4,5,8,9,10,11,14},{2,4,5,8,9,10,11,14,15},{2,4,5,8,9,10,11,15},{2,4,5,8,9,10,12},{2,4,5,8,9,10,12,13},{2,4,5,8,9,10,12,13,14},{2,4,5,8,9,10,12,13,14,15},{2,4,5,8,9,10,12,13,15},{2,4,5,8,9,10,12,14},{2,4,5,8,9,10,12,14,15},{2,4,5,8,9,10,12,15},{2,4,5,8,9,10,13},{2,4,5,8,9,10,13,14},{2,4,5,8,9,10,13,14,15},{2,4,5,8,9,10,13,15},{2,4,5,8,9,10,14},{2,4,5,8,9,10,14,15},{2,4,5,8,9,10,15},{2,4,5,8,9,11},{2,4,5,8,9,11,12},{2,4,5,8,9,11,12,13},{2,4,5,8,9,11,12,13,14},{2,4,5,8,9,11,12,13,14,15},{2,4,5,8,9,11,12,13,15},{2,4,5,8,9,11,12,14},{2,4,5,8,9,11,12,14,15},{2,4,5,8,9,11,12,15},{2,4,5,8,9,11,13},{2,4,5,8,9,11,13,14},{2,4,5,8,9,11,13,14,15},{2,4,5,8,9,11,13,15},{2,4,5,8,9,11,14},{2,4,5,8,9,11,14,15},{2,4,5,8,9,11,15},{2,4,5,8,9,12},{2,4,5,8,9,12,13},{2,4,5,8,9,12,13,14},{2,4,5,8,9,12,13,14,15},{2,4,5,8,9,12,13,15},{2,4,5,8,9,12,14},{2,4,5,8,9,12,14,15},{2,4,5,8,9,12,15},{2,4,5,8,9,13},{2,4,5,8,9,13,14},{2,4,5,8,9,13,14,15},{2,4,5,8,9,13,15},{2,4,5,8,9,14},{2,4,5,8,9,14,15},{2,4,5,8,9,15},{2,4,5,8,10},{2,4,5,8,10,11},{2,4,5,8,10,11,12},{2,4,5,8,10,11,12,13},{2,4,5,8,10,11,12,13,14},{2,4,5,8,10,11,12,13,14,15},{2,4,5,8,10,11,12,13,15},{2,4,5,8,10,11,12,14},{2,4,5,8,10,11,12,14,15},{2,4,5,8,10,11,12,15},{2,4,5,8,10,11,13},{2,4,5,8,10,11,13,14},{2,4,5,8,10,11,13,14,15},{2,4,5,8,10,11,13,15},{2,4,5,8,10,11,14},{2,4,5,8,10,11,14,15},{2,4,5,8,10,11,15},{2,4,5,8,10,12},{2,4,5,8,10,12,13},{2,4,5,8,10,12,13,14},{2,4,5,8,10,12,13,14,15},{2,4,5,8,10,12,13,15},{2,4,5,8,10,12,14},{2,4,5,8,10,12,14,15},{2,4,5,8,10,12,15},{2,4,5,8,10,13},{2,4,5,8,10,13,14},{2,4,5,8,10,13,14,15},{2,4,5,8,10,13,15},{2,4,5,8,10,14},{2,4,5,8,10,14,15},{2,4,5,8,10,15},{2,4,5,8,11},{2,4,5,8,11,12},{2,4,5,8,11,12,13},{2,4,5,8,11,12,13,14},{2,4,5,8,11,12,13,14,15},{2,4,5,8,11,12,13,15},{2,4,5,8,11,12,14},{2,4,5,8,11,12,14,15},{2,4,5,8,11,12,15},{2,4,5,8,11,13},{2,4,5,8,11,13,14},{2,4,5,8,11,13,14,15},{2,4,5,8,11,13,15},{2,4,5,8,11,14},{2,4,5,8,11,14,15},{2,4,5,8,11,15},{2,4,5,8,12},{2,4,5,8,12,13},{2,4,5,8,12,13,14},{2,4,5,8,12,13,14,15},{2,4,5,8,12,13,15},{2,4,5,8,12,14},{2,4,5,8,12,14,15},{2,4,5,8,12,15},{2,4,5,8,13},{2,4,5,8,13,14},{2,4,5,8,13,14,15},{2,4,5,8,13,15},{2,4,5,8,14},{2,4,5,8,14,15},{2,4,5,8,15},{2,4,5,9},{2,4,5,9,10},{2,4,5,9,10,11},{2,4,5,9,10,11,12},{2,4,5,9,10,11,12,13},{2,4,5,9,10,11,12,13,14},{2,4,5,9,10,11,12,13,14,15},{2,4,5,9,10,11,12,13,15},{2,4,5,9,10,11,12,14},{2,4,5,9,10,11,12,14,15},{2,4,5,9,10,11,12,15},{2,4,5,9,10,11,13},{2,4,5,9,10,11,13,14},{2,4,5,9,10,11,13,14,15},{2,4,5,9,10,11,13,15},{2,4,5,9,10,11,14},{2,4,5,9,10,11,14,15},{2,4,5,9,10,11,15},{2,4,5,9,10,12},{2,4,5,9,10,12,13},{2,4,5,9,10,12,13,14},{2,4,5,9,10,12,13,14,15},{2,4,5,9,10,12,13,15},{2,4,5,9,10,12,14},{2,4,5,9,10,12,14,15},{2,4,5,9,10,12,15},{2,4,5,9,10,13},{2,4,5,9,10,13,14},{2,4,5,9,10,13,14,15},{2,4,5,9,10,13,15},{2,4,5,9,10,14},{2,4,5,9,10,14,15},{2,4,5,9,10,15},{2,4,5,9,11},{2,4,5,9,11,12},{2,4,5,9,11,12,13},{2,4,5,9,11,12,13,14},{2,4,5,9,11,12,13,14,15},{2,4,5,9,11,12,13,15},{2,4,5,9,11,12,14},{2,4,5,9,11,12,14,15},{2,4,5,9,11,12,15},{2,4,5,9,11,13},{2,4,5,9,11,13,14},{2,4,5,9,11,13,14,15},{2,4,5,9,11,13,15},{2,4,5,9,11,14},{2,4,5,9,11,14,15},{2,4,5,9,11,15},{2,4,5,9,12},{2,4,5,9,12,13},{2,4,5,9,12,13,14},{2,4,5,9,12,13,14,15},{2,4,5,9,12,13,15},{2,4,5,9,12,14},{2,4,5,9,12,14,15},{2,4,5,9,12,15},{2,4,5,9,13},{2,4,5,9,13,14},{2,4,5,9,13,14,15},{2,4,5,9,13,15},{2,4,5,9,14},{2,4,5,9,14,15},{2,4,5,9,15},{2,4,5,10},{2,4,5,10,11},{2,4,5,10,11,12},{2,4,5,10,11,12,13},{2,4,5,10,11,12,13,14},{2,4,5,10,11,12,13,14,15},{2,4,5,10,11,12,13,15},{2,4,5,10,11,12,14},{2,4,5,10,11,12,14,15},{2,4,5,10,11,12,15},{2,4,5,10,11,13},{2,4,5,10,11,13,14},{2,4,5,10,11,13,14,15},{2,4,5,10,11,13,15},{2,4,5,10,11,14},{2,4,5,10,11,14,15},{2,4,5,10,11,15},{2,4,5,10,12},{2,4,5,10,12,13},{2,4,5,10,12,13,14},{2,4,5,10,12,13,14,15},{2,4,5,10,12,13,15},{2,4,5,10,12,14},{2,4,5,10,12,14,15},{2,4,5,10,12,15},{2,4,5,10,13},{2,4,5,10,13,14},{2,4,5,10,13,14,15},{2,4,5,10,13,15},{2,4,5,10,14},{2,4,5,10,14,15},{2,4,5,10,15},{2,4,5,11},{2,4,5,11,12},{2,4,5,11,12,13},{2,4,5,11,12,13,14},{2,4,5,11,12,13,14,15},{2,4,5,11,12,13,15},{2,4,5,11,12,14},{2,4,5,11,12,14,15},{2,4,5,11,12,15},{2,4,5,11,13},{2,4,5,11,13,14},{2,4,5,11,13,14,15},{2,4,5,11,13,15},{2,4,5,11,14},{2,4,5,11,14,15},{2,4,5,11,15},{2,4,5,12},{2,4,5,12,13},{2,4,5,12,13,14},{2,4,5,12,13,14,15},{2,4,5,12,13,15},{2,4,5,12,14},{2,4,5,12,14,15},{2,4,5,12,15},{2,4,5,13},{2,4,5,13,14},{2,4,5,13,14,15},{2,4,5,13,15},{2,4,5,14},{2,4,5,14,15},{2,4,5,15},{2,4,6},{2,4,6,7},{2,4,6,7,8},{2,4,6,7,8,9},{2,4,6,7,8,9,10},{2,4,6,7,8,9,10,11},{2,4,6,7,8,9,10,11,12},{2,4,6,7,8,9,10,11,12,13},{2,4,6,7,8,9,10,11,12,13,14},{2,4,6,7,8,9,10,11,12,13,14,15},{2,4,6,7,8,9,10,11,12,13,15},{2,4,6,7,8,9,10,11,12,14},{2,4,6,7,8,9,10,11,12,14,15},{2,4,6,7,8,9,10,11,12,15},{2,4,6,7,8,9,10,11,13},{2,4,6,7,8,9,10,11,13,14},{2,4,6,7,8,9,10,11,13,14,15},{2,4,6,7,8,9,10,11,13,15},{2,4,6,7,8,9,10,11,14},{2,4,6,7,8,9,10,11,14,15},{2,4,6,7,8,9,10,11,15},{2,4,6,7,8,9,10,12},{2,4,6,7,8,9,10,12,13},{2,4,6,7,8,9,10,12,13,14},{2,4,6,7,8,9,10,12,13,14,15},{2,4,6,7,8,9,10,12,13,15},{2,4,6,7,8,9,10,12,14},{2,4,6,7,8,9,10,12,14,15},{2,4,6,7,8,9,10,12,15},{2,4,6,7,8,9,10,13},{2,4,6,7,8,9,10,13,14},{2,4,6,7,8,9,10,13,14,15},{2,4,6,7,8,9,10,13,15},{2,4,6,7,8,9,10,14},{2,4,6,7,8,9,10,14,15},{2,4,6,7,8,9,10,15},{2,4,6,7,8,9,11},{2,4,6,7,8,9,11,12},{2,4,6,7,8,9,11,12,13},{2,4,6,7,8,9,11,12,13,14},{2,4,6,7,8,9,11,12,13,14,15},{2,4,6,7,8,9,11,12,13,15},{2,4,6,7,8,9,11,12,14},{2,4,6,7,8,9,11,12,14,15},{2,4,6,7,8,9,11,12,15},{2,4,6,7,8,9,11,13},{2,4,6,7,8,9,11,13,14},{2,4,6,7,8,9,11,13,14,15},{2,4,6,7,8,9,11,13,15},{2,4,6,7,8,9,11,14},{2,4,6,7,8,9,11,14,15},{2,4,6,7,8,9,11,15},{2,4,6,7,8,9,12},{2,4,6,7,8,9,12,13},{2,4,6,7,8,9,12,13,14},{2,4,6,7,8,9,12,13,14,15},{2,4,6,7,8,9,12,13,15},{2,4,6,7,8,9,12,14},{2,4,6,7,8,9,12,14,15},{2,4,6,7,8,9,12,15},{2,4,6,7,8,9,13},{2,4,6,7,8,9,13,14},{2,4,6,7,8,9,13,14,15},{2,4,6,7,8,9,13,15},{2,4,6,7,8,9,14},{2,4,6,7,8,9,14,15},{2,4,6,7,8,9,15},{2,4,6,7,8,10},{2,4,6,7,8,10,11},{2,4,6,7,8,10,11,12},{2,4,6,7,8,10,11,12,13},{2,4,6,7,8,10,11,12,13,14},{2,4,6,7,8,10,11,12,13,14,15},{2,4,6,7,8,10,11,12,13,15},{2,4,6,7,8,10,11,12,14},{2,4,6,7,8,10,11,12,14,15},{2,4,6,7,8,10,11,12,15},{2,4,6,7,8,10,11,13},{2,4,6,7,8,10,11,13,14},{2,4,6,7,8,10,11,13,14,15},{2,4,6,7,8,10,11,13,15},{2,4,6,7,8,10,11,14},{2,4,6,7,8,10,11,14,15},{2,4,6,7,8,10,11,15},{2,4,6,7,8,10,12},{2,4,6,7,8,10,12,13},{2,4,6,7,8,10,12,13,14},{2,4,6,7,8,10,12,13,14,15},{2,4,6,7,8,10,12,13,15},{2,4,6,7,8,10,12,14},{2,4,6,7,8,10,12,14,15},{2,4,6,7,8,10,12,15},{2,4,6,7,8,10,13},{2,4,6,7,8,10,13,14},{2,4,6,7,8,10,13,14,15},{2,4,6,7,8,10,13,15},{2,4,6,7,8,10,14},{2,4,6,7,8,10,14,15},{2,4,6,7,8,10,15},{2,4,6,7,8,11},{2,4,6,7,8,11,12},{2,4,6,7,8,11,12,13},{2,4,6,7,8,11,12,13,14},{2,4,6,7,8,11,12,13,14,15},{2,4,6,7,8,11,12,13,15},{2,4,6,7,8,11,12,14},{2,4,6,7,8,11,12,14,15},{2,4,6,7,8,11,12,15},{2,4,6,7,8,11,13},{2,4,6,7,8,11,13,14},{2,4,6,7,8,11,13,14,15},{2,4,6,7,8,11,13,15},{2,4,6,7,8,11,14},{2,4,6,7,8,11,14,15},{2,4,6,7,8,11,15},{2,4,6,7,8,12},{2,4,6,7,8,12,13},{2,4,6,7,8,12,13,14},{2,4,6,7,8,12,13,14,15},{2,4,6,7,8,12,13,15},{2,4,6,7,8,12,14},{2,4,6,7,8,12,14,15},{2,4,6,7,8,12,15},{2,4,6,7,8,13},{2,4,6,7,8,13,14},{2,4,6,7,8,13,14,15},{2,4,6,7,8,13,15},{2,4,6,7,8,14},{2,4,6,7,8,14,15},{2,4,6,7,8,15},{2,4,6,7,9},{2,4,6,7,9,10},{2,4,6,7,9,10,11},{2,4,6,7,9,10,11,12},{2,4,6,7,9,10,11,12,13},{2,4,6,7,9,10,11,12,13,14},{2,4,6,7,9,10,11,12,13,14,15},{2,4,6,7,9,10,11,12,13,15},{2,4,6,7,9,10,11,12,14},{2,4,6,7,9,10,11,12,14,15},{2,4,6,7,9,10,11,12,15},{2,4,6,7,9,10,11,13},{2,4,6,7,9,10,11,13,14},{2,4,6,7,9,10,11,13,14,15},{2,4,6,7,9,10,11,13,15},{2,4,6,7,9,10,11,14},{2,4,6,7,9,10,11,14,15},{2,4,6,7,9,10,11,15},{2,4,6,7,9,10,12},{2,4,6,7,9,10,12,13},{2,4,6,7,9,10,12,13,14},{2,4,6,7,9,10,12,13,14,15},{2,4,6,7,9,10,12,13,15},{2,4,6,7,9,10,12,14},{2,4,6,7,9,10,12,14,15},{2,4,6,7,9,10,12,15},{2,4,6,7,9,10,13},{2,4,6,7,9,10,13,14},{2,4,6,7,9,10,13,14,15},{2,4,6,7,9,10,13,15},{2,4,6,7,9,10,14},{2,4,6,7,9,10,14,15},{2,4,6,7,9,10,15},{2,4,6,7,9,11},{2,4,6,7,9,11,12},{2,4,6,7,9,11,12,13},{2,4,6,7,9,11,12,13,14},{2,4,6,7,9,11,12,13,14,15},{2,4,6,7,9,11,12,13,15},{2,4,6,7,9,11,12,14},{2,4,6,7,9,11,12,14,15},{2,4,6,7,9,11,12,15},{2,4,6,7,9,11,13},{2,4,6,7,9,11,13,14},{2,4,6,7,9,11,13,14,15},{2,4,6,7,9,11,13,15},{2,4,6,7,9,11,14},{2,4,6,7,9,11,14,15},{2,4,6,7,9,11,15},{2,4,6,7,9,12},{2,4,6,7,9,12,13},{2,4,6,7,9,12,13,14},{2,4,6,7,9,12,13,14,15},{2,4,6,7,9,12,13,15},{2,4,6,7,9,12,14},{2,4,6,7,9,12,14,15},{2,4,6,7,9,12,15},{2,4,6,7,9,13},{2,4,6,7,9,13,14},{2,4,6,7,9,13,14,15},{2,4,6,7,9,13,15},{2,4,6,7,9,14},{2,4,6,7,9,14,15},{2,4,6,7,9,15},{2,4,6,7,10},{2,4,6,7,10,11},{2,4,6,7,10,11,12},{2,4,6,7,10,11,12,13},{2,4,6,7,10,11,12,13,14},{2,4,6,7,10,11,12,13,14,15},{2,4,6,7,10,11,12,13,15},{2,4,6,7,10,11,12,14},{2,4,6,7,10,11,12,14,15},{2,4,6,7,10,11,12,15},{2,4,6,7,10,11,13},{2,4,6,7,10,11,13,14},{2,4,6,7,10,11,13,14,15},{2,4,6,7,10,11,13,15},{2,4,6,7,10,11,14},{2,4,6,7,10,11,14,15},{2,4,6,7,10,11,15},{2,4,6,7,10,12},{2,4,6,7,10,12,13},{2,4,6,7,10,12,13,14},{2,4,6,7,10,12,13,14,15},{2,4,6,7,10,12,13,15},{2,4,6,7,10,12,14},{2,4,6,7,10,12,14,15},{2,4,6,7,10,12,15},{2,4,6,7,10,13},{2,4,6,7,10,13,14},{2,4,6,7,10,13,14,15},{2,4,6,7,10,13,15},{2,4,6,7,10,14},{2,4,6,7,10,14,15},{2,4,6,7,10,15},{2,4,6,7,11},{2,4,6,7,11,12},{2,4,6,7,11,12,13},{2,4,6,7,11,12,13,14},{2,4,6,7,11,12,13,14,15},{2,4,6,7,11,12,13,15},{2,4,6,7,11,12,14},{2,4,6,7,11,12,14,15},{2,4,6,7,11,12,15},{2,4,6,7,11,13},{2,4,6,7,11,13,14},{2,4,6,7,11,13,14,15},{2,4,6,7,11,13,15},{2,4,6,7,11,14},{2,4,6,7,11,14,15},{2,4,6,7,11,15},{2,4,6,7,12},{2,4,6,7,12,13},{2,4,6,7,12,13,14},{2,4,6,7,12,13,14,15},{2,4,6,7,12,13,15},{2,4,6,7,12,14},{2,4,6,7,12,14,15},{2,4,6,7,12,15},{2,4,6,7,13},{2,4,6,7,13,14},{2,4,6,7,13,14,15},{2,4,6,7,13,15},{2,4,6,7,14},{2,4,6,7,14,15},{2,4,6,7,15},{2,4,6,8},{2,4,6,8,9},{2,4,6,8,9,10},{2,4,6,8,9,10,11},{2,4,6,8,9,10,11,12},{2,4,6,8,9,10,11,12,13},{2,4,6,8,9,10,11,12,13,14},{2,4,6,8,9,10,11,12,13,14,15},{2,4,6,8,9,10,11,12,13,15},{2,4,6,8,9,10,11,12,14},{2,4,6,8,9,10,11,12,14,15},{2,4,6,8,9,10,11,12,15},{2,4,6,8,9,10,11,13},{2,4,6,8,9,10,11,13,14},{2,4,6,8,9,10,11,13,14,15},{2,4,6,8,9,10,11,13,15},{2,4,6,8,9,10,11,14},{2,4,6,8,9,10,11,14,15},{2,4,6,8,9,10,11,15},{2,4,6,8,9,10,12},{2,4,6,8,9,10,12,13},{2,4,6,8,9,10,12,13,14},{2,4,6,8,9,10,12,13,14,15},{2,4,6,8,9,10,12,13,15},{2,4,6,8,9,10,12,14},{2,4,6,8,9,10,12,14,15},{2,4,6,8,9,10,12,15},{2,4,6,8,9,10,13},{2,4,6,8,9,10,13,14},{2,4,6,8,9,10,13,14,15},{2,4,6,8,9,10,13,15},{2,4,6,8,9,10,14},{2,4,6,8,9,10,14,15},{2,4,6,8,9,10,15},{2,4,6,8,9,11},{2,4,6,8,9,11,12},{2,4,6,8,9,11,12,13},{2,4,6,8,9,11,12,13,14},{2,4,6,8,9,11,12,13,14,15},{2,4,6,8,9,11,12,13,15},{2,4,6,8,9,11,12,14},{2,4,6,8,9,11,12,14,15},{2,4,6,8,9,11,12,15},{2,4,6,8,9,11,13},{2,4,6,8,9,11,13,14},{2,4,6,8,9,11,13,14,15},{2,4,6,8,9,11,13,15},{2,4,6,8,9,11,14},{2,4,6,8,9,11,14,15},{2,4,6,8,9,11,15},{2,4,6,8,9,12},{2,4,6,8,9,12,13},{2,4,6,8,9,12,13,14},{2,4,6,8,9,12,13,14,15},{2,4,6,8,9,12,13,15},{2,4,6,8,9,12,14},{2,4,6,8,9,12,14,15},{2,4,6,8,9,12,15},{2,4,6,8,9,13},{2,4,6,8,9,13,14},{2,4,6,8,9,13,14,15},{2,4,6,8,9,13,15},{2,4,6,8,9,14},{2,4,6,8,9,14,15},{2,4,6,8,9,15},{2,4,6,8,10},{2,4,6,8,10,11},{2,4,6,8,10,11,12},{2,4,6,8,10,11,12,13},{2,4,6,8,10,11,12,13,14},{2,4,6,8,10,11,12,13,14,15},{2,4,6,8,10,11,12,13,15},{2,4,6,8,10,11,12,14},{2,4,6,8,10,11,12,14,15},{2,4,6,8,10,11,12,15},{2,4,6,8,10,11,13},{2,4,6,8,10,11,13,14},{2,4,6,8,10,11,13,14,15},{2,4,6,8,10,11,13,15},{2,4,6,8,10,11,14},{2,4,6,8,10,11,14,15},{2,4,6,8,10,11,15},{2,4,6,8,10,12},{2,4,6,8,10,12,13},{2,4,6,8,10,12,13,14},{2,4,6,8,10,12,13,14,15},{2,4,6,8,10,12,13,15},{2,4,6,8,10,12,14},{2,4,6,8,10,12,14,15},{2,4,6,8,10,12,15},{2,4,6,8,10,13},{2,4,6,8,10,13,14},{2,4,6,8,10,13,14,15},{2,4,6,8,10,13,15},{2,4,6,8,10,14},{2,4,6,8,10,14,15},{2,4,6,8,10,15},{2,4,6,8,11},{2,4,6,8,11,12},{2,4,6,8,11,12,13},{2,4,6,8,11,12,13,14},{2,4,6,8,11,12,13,14,15},{2,4,6,8,11,12,13,15},{2,4,6,8,11,12,14},{2,4,6,8,11,12,14,15},{2,4,6,8,11,12,15},{2,4,6,8,11,13},{2,4,6,8,11,13,14},{2,4,6,8,11,13,14,15},{2,4,6,8,11,13,15},{2,4,6,8,11,14},{2,4,6,8,11,14,15},{2,4,6,8,11,15},{2,4,6,8,12},{2,4,6,8,12,13},{2,4,6,8,12,13,14},{2,4,6,8,12,13,14,15},{2,4,6,8,12,13,15},{2,4,6,8,12,14},{2,4,6,8,12,14,15},{2,4,6,8,12,15},{2,4,6,8,13},{2,4,6,8,13,14},{2,4,6,8,13,14,15},{2,4,6,8,13,15},{2,4,6,8,14},{2,4,6,8,14,15},{2,4,6,8,15},{2,4,6,9},{2,4,6,9,10},{2,4,6,9,10,11},{2,4,6,9,10,11,12},{2,4,6,9,10,11,12,13},{2,4,6,9,10,11,12,13,14},{2,4,6,9,10,11,12,13,14,15},{2,4,6,9,10,11,12,13,15},{2,4,6,9,10,11,12,14},{2,4,6,9,10,11,12,14,15},{2,4,6,9,10,11,12,15},{2,4,6,9,10,11,13},{2,4,6,9,10,11,13,14},{2,4,6,9,10,11,13,14,15},{2,4,6,9,10,11,13,15},{2,4,6,9,10,11,14},{2,4,6,9,10,11,14,15},{2,4,6,9,10,11,15},{2,4,6,9,10,12},{2,4,6,9,10,12,13},{2,4,6,9,10,12,13,14},{2,4,6,9,10,12,13,14,15},{2,4,6,9,10,12,13,15},{2,4,6,9,10,12,14},{2,4,6,9,10,12,14,15},{2,4,6,9,10,12,15},{2,4,6,9,10,13},{2,4,6,9,10,13,14},{2,4,6,9,10,13,14,15},{2,4,6,9,10,13,15},{2,4,6,9,10,14},{2,4,6,9,10,14,15},{2,4,6,9,10,15},{2,4,6,9,11},{2,4,6,9,11,12},{2,4,6,9,11,12,13},{2,4,6,9,11,12,13,14},{2,4,6,9,11,12,13,14,15},{2,4,6,9,11,12,13,15},{2,4,6,9,11,12,14},{2,4,6,9,11,12,14,15},{2,4,6,9,11,12,15},{2,4,6,9,11,13},{2,4,6,9,11,13,14},{2,4,6,9,11,13,14,15},{2,4,6,9,11,13,15},{2,4,6,9,11,14},{2,4,6,9,11,14,15},{2,4,6,9,11,15},{2,4,6,9,12},{2,4,6,9,12,13},{2,4,6,9,12,13,14},{2,4,6,9,12,13,14,15},{2,4,6,9,12,13,15},{2,4,6,9,12,14},{2,4,6,9,12,14,15},{2,4,6,9,12,15},{2,4,6,9,13},{2,4,6,9,13,14},{2,4,6,9,13,14,15},{2,4,6,9,13,15},{2,4,6,9,14},{2,4,6,9,14,15},{2,4,6,9,15},{2,4,6,10},{2,4,6,10,11},{2,4,6,10,11,12},{2,4,6,10,11,12,13},{2,4,6,10,11,12,13,14},{2,4,6,10,11,12,13,14,15},{2,4,6,10,11,12,13,15},{2,4,6,10,11,12,14},{2,4,6,10,11,12,14,15},{2,4,6,10,11,12,15},{2,4,6,10,11,13},{2,4,6,10,11,13,14},{2,4,6,10,11,13,14,15},{2,4,6,10,11,13,15},{2,4,6,10,11,14},{2,4,6,10,11,14,15},{2,4,6,10,11,15},{2,4,6,10,12},{2,4,6,10,12,13},{2,4,6,10,12,13,14},{2,4,6,10,12,13,14,15},{2,4,6,10,12,13,15},{2,4,6,10,12,14},{2,4,6,10,12,14,15},{2,4,6,10,12,15},{2,4,6,10,13},{2,4,6,10,13,14},{2,4,6,10,13,14,15},{2,4,6,10,13,15},{2,4,6,10,14},{2,4,6,10,14,15},{2,4,6,10,15},{2,4,6,11},{2,4,6,11,12},{2,4,6,11,12,13},{2,4,6,11,12,13,14},{2,4,6,11,12,13,14,15},{2,4,6,11,12,13,15},{2,4,6,11,12,14},{2,4,6,11,12,14,15},{2,4,6,11,12,15},{2,4,6,11,13},{2,4,6,11,13,14},{2,4,6,11,13,14,15},{2,4,6,11,13,15},{2,4,6,11,14},{2,4,6,11,14,15},{2,4,6,11,15},{2,4,6,12},{2,4,6,12,13},{2,4,6,12,13,14},{2,4,6,12,13,14,15},{2,4,6,12,13,15},{2,4,6,12,14},{2,4,6,12,14,15},{2,4,6,12,15},{2,4,6,13},{2,4,6,13,14},{2,4,6,13,14,15},{2,4,6,13,15},{2,4,6,14},{2,4,6,14,15},{2,4,6,15},{2,4,7},{2,4,7,8},{2,4,7,8,9},{2,4,7,8,9,10},{2,4,7,8,9,10,11},{2,4,7,8,9,10,11,12},{2,4,7,8,9,10,11,12,13},{2,4,7,8,9,10,11,12,13,14},{2,4,7,8,9,10,11,12,13,14,15},{2,4,7,8,9,10,11,12,13,15},{2,4,7,8,9,10,11,12,14},{2,4,7,8,9,10,11,12,14,15},{2,4,7,8,9,10,11,12,15},{2,4,7,8,9,10,11,13},{2,4,7,8,9,10,11,13,14},{2,4,7,8,9,10,11,13,14,15},{2,4,7,8,9,10,11,13,15},{2,4,7,8,9,10,11,14},{2,4,7,8,9,10,11,14,15},{2,4,7,8,9,10,11,15},{2,4,7,8,9,10,12},{2,4,7,8,9,10,12,13},{2,4,7,8,9,10,12,13,14},{2,4,7,8,9,10,12,13,14,15},{2,4,7,8,9,10,12,13,15},{2,4,7,8,9,10,12,14},{2,4,7,8,9,10,12,14,15},{2,4,7,8,9,10,12,15},{2,4,7,8,9,10,13},{2,4,7,8,9,10,13,14},{2,4,7,8,9,10,13,14,15},{2,4,7,8,9,10,13,15},{2,4,7,8,9,10,14},{2,4,7,8,9,10,14,15},{2,4,7,8,9,10,15},{2,4,7,8,9,11},{2,4,7,8,9,11,12},{2,4,7,8,9,11,12,13},{2,4,7,8,9,11,12,13,14},{2,4,7,8,9,11,12,13,14,15},{2,4,7,8,9,11,12,13,15},{2,4,7,8,9,11,12,14},{2,4,7,8,9,11,12,14,15},{2,4,7,8,9,11,12,15},{2,4,7,8,9,11,13},{2,4,7,8,9,11,13,14},{2,4,7,8,9,11,13,14,15},{2,4,7,8,9,11,13,15},{2,4,7,8,9,11,14},{2,4,7,8,9,11,14,15},{2,4,7,8,9,11,15},{2,4,7,8,9,12},{2,4,7,8,9,12,13},{2,4,7,8,9,12,13,14},{2,4,7,8,9,12,13,14,15},{2,4,7,8,9,12,13,15},{2,4,7,8,9,12,14},{2,4,7,8,9,12,14,15},{2,4,7,8,9,12,15},{2,4,7,8,9,13},{2,4,7,8,9,13,14},{2,4,7,8,9,13,14,15},{2,4,7,8,9,13,15},{2,4,7,8,9,14},{2,4,7,8,9,14,15},{2,4,7,8,9,15},{2,4,7,8,10},{2,4,7,8,10,11},{2,4,7,8,10,11,12},{2,4,7,8,10,11,12,13},{2,4,7,8,10,11,12,13,14},{2,4,7,8,10,11,12,13,14,15},{2,4,7,8,10,11,12,13,15},{2,4,7,8,10,11,12,14},{2,4,7,8,10,11,12,14,15},{2,4,7,8,10,11,12,15},{2,4,7,8,10,11,13},{2,4,7,8,10,11,13,14},{2,4,7,8,10,11,13,14,15},{2,4,7,8,10,11,13,15},{2,4,7,8,10,11,14},{2,4,7,8,10,11,14,15},{2,4,7,8,10,11,15},{2,4,7,8,10,12},{2,4,7,8,10,12,13},{2,4,7,8,10,12,13,14},{2,4,7,8,10,12,13,14,15},{2,4,7,8,10,12,13,15},{2,4,7,8,10,12,14},{2,4,7,8,10,12,14,15},{2,4,7,8,10,12,15},{2,4,7,8,10,13},{2,4,7,8,10,13,14},{2,4,7,8,10,13,14,15},{2,4,7,8,10,13,15},{2,4,7,8,10,14},{2,4,7,8,10,14,15},{2,4,7,8,10,15},{2,4,7,8,11},{2,4,7,8,11,12},{2,4,7,8,11,12,13},{2,4,7,8,11,12,13,14},{2,4,7,8,11,12,13,14,15},{2,4,7,8,11,12,13,15},{2,4,7,8,11,12,14},{2,4,7,8,11,12,14,15},{2,4,7,8,11,12,15},{2,4,7,8,11,13},{2,4,7,8,11,13,14},{2,4,7,8,11,13,14,15},{2,4,7,8,11,13,15},{2,4,7,8,11,14},{2,4,7,8,11,14,15},{2,4,7,8,11,15},{2,4,7,8,12},{2,4,7,8,12,13},{2,4,7,8,12,13,14},{2,4,7,8,12,13,14,15},{2,4,7,8,12,13,15},{2,4,7,8,12,14},{2,4,7,8,12,14,15},{2,4,7,8,12,15},{2,4,7,8,13},{2,4,7,8,13,14},{2,4,7,8,13,14,15},{2,4,7,8,13,15},{2,4,7,8,14},{2,4,7,8,14,15},{2,4,7,8,15},{2,4,7,9},{2,4,7,9,10},{2,4,7,9,10,11},{2,4,7,9,10,11,12},{2,4,7,9,10,11,12,13},{2,4,7,9,10,11,12,13,14},{2,4,7,9,10,11,12,13,14,15},{2,4,7,9,10,11,12,13,15},{2,4,7,9,10,11,12,14},{2,4,7,9,10,11,12,14,15},{2,4,7,9,10,11,12,15},{2,4,7,9,10,11,13},{2,4,7,9,10,11,13,14},{2,4,7,9,10,11,13,14,15},{2,4,7,9,10,11,13,15},{2,4,7,9,10,11,14},{2,4,7,9,10,11,14,15},{2,4,7,9,10,11,15},{2,4,7,9,10,12},{2,4,7,9,10,12,13},{2,4,7,9,10,12,13,14},{2,4,7,9,10,12,13,14,15},{2,4,7,9,10,12,13,15},{2,4,7,9,10,12,14},{2,4,7,9,10,12,14,15},{2,4,7,9,10,12,15},{2,4,7,9,10,13},{2,4,7,9,10,13,14},{2,4,7,9,10,13,14,15},{2,4,7,9,10,13,15},{2,4,7,9,10,14},{2,4,7,9,10,14,15},{2,4,7,9,10,15},{2,4,7,9,11},{2,4,7,9,11,12},{2,4,7,9,11,12,13},{2,4,7,9,11,12,13,14},{2,4,7,9,11,12,13,14,15},{2,4,7,9,11,12,13,15},{2,4,7,9,11,12,14},{2,4,7,9,11,12,14,15},{2,4,7,9,11,12,15},{2,4,7,9,11,13},{2,4,7,9,11,13,14},{2,4,7,9,11,13,14,15},{2,4,7,9,11,13,15},{2,4,7,9,11,14},{2,4,7,9,11,14,15},{2,4,7,9,11,15},{2,4,7,9,12},{2,4,7,9,12,13},{2,4,7,9,12,13,14},{2,4,7,9,12,13,14,15},{2,4,7,9,12,13,15},{2,4,7,9,12,14},{2,4,7,9,12,14,15},{2,4,7,9,12,15},{2,4,7,9,13},{2,4,7,9,13,14},{2,4,7,9,13,14,15},{2,4,7,9,13,15},{2,4,7,9,14},{2,4,7,9,14,15},{2,4,7,9,15},{2,4,7,10},{2,4,7,10,11},{2,4,7,10,11,12},{2,4,7,10,11,12,13},{2,4,7,10,11,12,13,14},{2,4,7,10,11,12,13,14,15},{2,4,7,10,11,12,13,15},{2,4,7,10,11,12,14},{2,4,7,10,11,12,14,15},{2,4,7,10,11,12,15},{2,4,7,10,11,13},{2,4,7,10,11,13,14},{2,4,7,10,11,13,14,15},{2,4,7,10,11,13,15},{2,4,7,10,11,14},{2,4,7,10,11,14,15},{2,4,7,10,11,15},{2,4,7,10,12},{2,4,7,10,12,13},{2,4,7,10,12,13,14},{2,4,7,10,12,13,14,15},{2,4,7,10,12,13,15},{2,4,7,10,12,14},{2,4,7,10,12,14,15},{2,4,7,10,12,15},{2,4,7,10,13},{2,4,7,10,13,14},{2,4,7,10,13,14,15},{2,4,7,10,13,15},{2,4,7,10,14},{2,4,7,10,14,15},{2,4,7,10,15},{2,4,7,11},{2,4,7,11,12},{2,4,7,11,12,13},{2,4,7,11,12,13,14},{2,4,7,11,12,13,14,15},{2,4,7,11,12,13,15},{2,4,7,11,12,14},{2,4,7,11,12,14,15},{2,4,7,11,12,15},{2,4,7,11,13},{2,4,7,11,13,14},{2,4,7,11,13,14,15},{2,4,7,11,13,15},{2,4,7,11,14},{2,4,7,11,14,15},{2,4,7,11,15},{2,4,7,12},{2,4,7,12,13},{2,4,7,12,13,14},{2,4,7,12,13,14,15},{2,4,7,12,13,15},{2,4,7,12,14},{2,4,7,12,14,15},{2,4,7,12,15},{2,4,7,13},{2,4,7,13,14},{2,4,7,13,14,15},{2,4,7,13,15},{2,4,7,14},{2,4,7,14,15},{2,4,7,15},{2,4,8},{2,4,8,9},{2,4,8,9,10},{2,4,8,9,10,11},{2,4,8,9,10,11,12},{2,4,8,9,10,11,12,13},{2,4,8,9,10,11,12,13,14},{2,4,8,9,10,11,12,13,14,15},{2,4,8,9,10,11,12,13,15},{2,4,8,9,10,11,12,14},{2,4,8,9,10,11,12,14,15},{2,4,8,9,10,11,12,15},{2,4,8,9,10,11,13},{2,4,8,9,10,11,13,14},{2,4,8,9,10,11,13,14,15},{2,4,8,9,10,11,13,15},{2,4,8,9,10,11,14},{2,4,8,9,10,11,14,15},{2,4,8,9,10,11,15},{2,4,8,9,10,12},{2,4,8,9,10,12,13},{2,4,8,9,10,12,13,14},{2,4,8,9,10,12,13,14,15},{2,4,8,9,10,12,13,15},{2,4,8,9,10,12,14},{2,4,8,9,10,12,14,15},{2,4,8,9,10,12,15},{2,4,8,9,10,13},{2,4,8,9,10,13,14},{2,4,8,9,10,13,14,15},{2,4,8,9,10,13,15},{2,4,8,9,10,14},{2,4,8,9,10,14,15},{2,4,8,9,10,15},{2,4,8,9,11},{2,4,8,9,11,12},{2,4,8,9,11,12,13},{2,4,8,9,11,12,13,14},{2,4,8,9,11,12,13,14,15},{2,4,8,9,11,12,13,15},{2,4,8,9,11,12,14},{2,4,8,9,11,12,14,15},{2,4,8,9,11,12,15},{2,4,8,9,11,13},{2,4,8,9,11,13,14},{2,4,8,9,11,13,14,15},{2,4,8,9,11,13,15},{2,4,8,9,11,14},{2,4,8,9,11,14,15},{2,4,8,9,11,15},{2,4,8,9,12},{2,4,8,9,12,13},{2,4,8,9,12,13,14},{2,4,8,9,12,13,14,15},{2,4,8,9,12,13,15},{2,4,8,9,12,14},{2,4,8,9,12,14,15},{2,4,8,9,12,15},{2,4,8,9,13},{2,4,8,9,13,14},{2,4,8,9,13,14,15},{2,4,8,9,13,15},{2,4,8,9,14},{2,4,8,9,14,15},{2,4,8,9,15},{2,4,8,10},{2,4,8,10,11},{2,4,8,10,11,12},{2,4,8,10,11,12,13},{2,4,8,10,11,12,13,14},{2,4,8,10,11,12,13,14,15},{2,4,8,10,11,12,13,15},{2,4,8,10,11,12,14},{2,4,8,10,11,12,14,15},{2,4,8,10,11,12,15},{2,4,8,10,11,13},{2,4,8,10,11,13,14},{2,4,8,10,11,13,14,15},{2,4,8,10,11,13,15},{2,4,8,10,11,14},{2,4,8,10,11,14,15},{2,4,8,10,11,15},{2,4,8,10,12},{2,4,8,10,12,13},{2,4,8,10,12,13,14},{2,4,8,10,12,13,14,15},{2,4,8,10,12,13,15},{2,4,8,10,12,14},{2,4,8,10,12,14,15},{2,4,8,10,12,15},{2,4,8,10,13},{2,4,8,10,13,14},{2,4,8,10,13,14,15},{2,4,8,10,13,15},{2,4,8,10,14},{2,4,8,10,14,15},{2,4,8,10,15},{2,4,8,11},{2,4,8,11,12},{2,4,8,11,12,13},{2,4,8,11,12,13,14},{2,4,8,11,12,13,14,15},{2,4,8,11,12,13,15},{2,4,8,11,12,14},{2,4,8,11,12,14,15},{2,4,8,11,12,15},{2,4,8,11,13},{2,4,8,11,13,14},{2,4,8,11,13,14,15},{2,4,8,11,13,15},{2,4,8,11,14},{2,4,8,11,14,15},{2,4,8,11,15},{2,4,8,12},{2,4,8,12,13},{2,4,8,12,13,14},{2,4,8,12,13,14,15},{2,4,8,12,13,15},{2,4,8,12,14},{2,4,8,12,14,15},{2,4,8,12,15},{2,4,8,13},{2,4,8,13,14},{2,4,8,13,14,15},{2,4,8,13,15},{2,4,8,14},{2,4,8,14,15},{2,4,8,15},{2,4,9},{2,4,9,10},{2,4,9,10,11},{2,4,9,10,11,12},{2,4,9,10,11,12,13},{2,4,9,10,11,12,13,14},{2,4,9,10,11,12,13,14,15},{2,4,9,10,11,12,13,15},{2,4,9,10,11,12,14},{2,4,9,10,11,12,14,15},{2,4,9,10,11,12,15},{2,4,9,10,11,13},{2,4,9,10,11,13,14},{2,4,9,10,11,13,14,15},{2,4,9,10,11,13,15},{2,4,9,10,11,14},{2,4,9,10,11,14,15},{2,4,9,10,11,15},{2,4,9,10,12},{2,4,9,10,12,13},{2,4,9,10,12,13,14},{2,4,9,10,12,13,14,15},{2,4,9,10,12,13,15},{2,4,9,10,12,14},{2,4,9,10,12,14,15},{2,4,9,10,12,15},{2,4,9,10,13},{2,4,9,10,13,14},{2,4,9,10,13,14,15},{2,4,9,10,13,15},{2,4,9,10,14},{2,4,9,10,14,15},{2,4,9,10,15},{2,4,9,11},{2,4,9,11,12},{2,4,9,11,12,13},{2,4,9,11,12,13,14},{2,4,9,11,12,13,14,15},{2,4,9,11,12,13,15},{2,4,9,11,12,14},{2,4,9,11,12,14,15},{2,4,9,11,12,15},{2,4,9,11,13},{2,4,9,11,13,14},{2,4,9,11,13,14,15},{2,4,9,11,13,15},{2,4,9,11,14},{2,4,9,11,14,15},{2,4,9,11,15},{2,4,9,12},{2,4,9,12,13},{2,4,9,12,13,14},{2,4,9,12,13,14,15},{2,4,9,12,13,15},{2,4,9,12,14},{2,4,9,12,14,15},{2,4,9,12,15},{2,4,9,13},{2,4,9,13,14},{2,4,9,13,14,15},{2,4,9,13,15},{2,4,9,14},{2,4,9,14,15},{2,4,9,15},{2,4,10},{2,4,10,11},{2,4,10,11,12},{2,4,10,11,12,13},{2,4,10,11,12,13,14},{2,4,10,11,12,13,14,15},{2,4,10,11,12,13,15},{2,4,10,11,12,14},{2,4,10,11,12,14,15},{2,4,10,11,12,15},{2,4,10,11,13},{2,4,10,11,13,14},{2,4,10,11,13,14,15},{2,4,10,11,13,15},{2,4,10,11,14},{2,4,10,11,14,15},{2,4,10,11,15},{2,4,10,12},{2,4,10,12,13},{2,4,10,12,13,14},{2,4,10,12,13,14,15},{2,4,10,12,13,15},{2,4,10,12,14},{2,4,10,12,14,15},{2,4,10,12,15},{2,4,10,13},{2,4,10,13,14},{2,4,10,13,14,15},{2,4,10,13,15},{2,4,10,14},{2,4,10,14,15},{2,4,10,15},{2,4,11},{2,4,11,12},{2,4,11,12,13},{2,4,11,12,13,14},{2,4,11,12,13,14,15},{2,4,11,12,13,15},{2,4,11,12,14},{2,4,11,12,14,15},{2,4,11,12,15},{2,4,11,13},{2,4,11,13,14},{2,4,11,13,14,15},{2,4,11,13,15},{2,4,11,14},{2,4,11,14,15},{2,4,11,15},{2,4,12},{2,4,12,13},{2,4,12,13,14},{2,4,12,13,14,15},{2,4,12,13,15},{2,4,12,14},{2,4,12,14,15},{2,4,12,15},{2,4,13},{2,4,13,14},{2,4,13,14,15},{2,4,13,15},{2,4,14},{2,4,14,15},{2,4,15},{2,5},{2,5,6},{2,5,6,7},{2,5,6,7,8},{2,5,6,7,8,9},{2,5,6,7,8,9,10},{2,5,6,7,8,9,10,11},{2,5,6,7,8,9,10,11,12},{2,5,6,7,8,9,10,11,12,13},{2,5,6,7,8,9,10,11,12,13,14},{2,5,6,7,8,9,10,11,12,13,14,15},{2,5,6,7,8,9,10,11,12,13,15},{2,5,6,7,8,9,10,11,12,14},{2,5,6,7,8,9,10,11,12,14,15},{2,5,6,7,8,9,10,11,12,15},{2,5,6,7,8,9,10,11,13},{2,5,6,7,8,9,10,11,13,14},{2,5,6,7,8,9,10,11,13,14,15},{2,5,6,7,8,9,10,11,13,15},{2,5,6,7,8,9,10,11,14},{2,5,6,7,8,9,10,11,14,15},{2,5,6,7,8,9,10,11,15},{2,5,6,7,8,9,10,12},{2,5,6,7,8,9,10,12,13},{2,5,6,7,8,9,10,12,13,14},{2,5,6,7,8,9,10,12,13,14,15},{2,5,6,7,8,9,10,12,13,15},{2,5,6,7,8,9,10,12,14},{2,5,6,7,8,9,10,12,14,15},{2,5,6,7,8,9,10,12,15},{2,5,6,7,8,9,10,13},{2,5,6,7,8,9,10,13,14},{2,5,6,7,8,9,10,13,14,15},{2,5,6,7,8,9,10,13,15},{2,5,6,7,8,9,10,14},{2,5,6,7,8,9,10,14,15},{2,5,6,7,8,9,10,15},{2,5,6,7,8,9,11},{2,5,6,7,8,9,11,12},{2,5,6,7,8,9,11,12,13},{2,5,6,7,8,9,11,12,13,14},{2,5,6,7,8,9,11,12,13,14,15},{2,5,6,7,8,9,11,12,13,15},{2,5,6,7,8,9,11,12,14},{2,5,6,7,8,9,11,12,14,15},{2,5,6,7,8,9,11,12,15},{2,5,6,7,8,9,11,13},{2,5,6,7,8,9,11,13,14},{2,5,6,7,8,9,11,13,14,15},{2,5,6,7,8,9,11,13,15},{2,5,6,7,8,9,11,14},{2,5,6,7,8,9,11,14,15},{2,5,6,7,8,9,11,15},{2,5,6,7,8,9,12},{2,5,6,7,8,9,12,13},{2,5,6,7,8,9,12,13,14},{2,5,6,7,8,9,12,13,14,15},{2,5,6,7,8,9,12,13,15},{2,5,6,7,8,9,12,14},{2,5,6,7,8,9,12,14,15},{2,5,6,7,8,9,12,15},{2,5,6,7,8,9,13},{2,5,6,7,8,9,13,14},{2,5,6,7,8,9,13,14,15},{2,5,6,7,8,9,13,15},{2,5,6,7,8,9,14},{2,5,6,7,8,9,14,15},{2,5,6,7,8,9,15},{2,5,6,7,8,10},{2,5,6,7,8,10,11},{2,5,6,7,8,10,11,12},{2,5,6,7,8,10,11,12,13},{2,5,6,7,8,10,11,12,13,14},{2,5,6,7,8,10,11,12,13,14,15},{2,5,6,7,8,10,11,12,13,15},{2,5,6,7,8,10,11,12,14},{2,5,6,7,8,10,11,12,14,15},{2,5,6,7,8,10,11,12,15},{2,5,6,7,8,10,11,13},{2,5,6,7,8,10,11,13,14},{2,5,6,7,8,10,11,13,14,15},{2,5,6,7,8,10,11,13,15},{2,5,6,7,8,10,11,14},{2,5,6,7,8,10,11,14,15},{2,5,6,7,8,10,11,15},{2,5,6,7,8,10,12},{2,5,6,7,8,10,12,13},{2,5,6,7,8,10,12,13,14},{2,5,6,7,8,10,12,13,14,15},{2,5,6,7,8,10,12,13,15},{2,5,6,7,8,10,12,14},{2,5,6,7,8,10,12,14,15},{2,5,6,7,8,10,12,15},{2,5,6,7,8,10,13},{2,5,6,7,8,10,13,14},{2,5,6,7,8,10,13,14,15},{2,5,6,7,8,10,13,15},{2,5,6,7,8,10,14},{2,5,6,7,8,10,14,15},{2,5,6,7,8,10,15},{2,5,6,7,8,11},{2,5,6,7,8,11,12},{2,5,6,7,8,11,12,13},{2,5,6,7,8,11,12,13,14},{2,5,6,7,8,11,12,13,14,15},{2,5,6,7,8,11,12,13,15},{2,5,6,7,8,11,12,14},{2,5,6,7,8,11,12,14,15},{2,5,6,7,8,11,12,15},{2,5,6,7,8,11,13},{2,5,6,7,8,11,13,14},{2,5,6,7,8,11,13,14,15},{2,5,6,7,8,11,13,15},{2,5,6,7,8,11,14},{2,5,6,7,8,11,14,15},{2,5,6,7,8,11,15},{2,5,6,7,8,12},{2,5,6,7,8,12,13},{2,5,6,7,8,12,13,14},{2,5,6,7,8,12,13,14,15},{2,5,6,7,8,12,13,15},{2,5,6,7,8,12,14},{2,5,6,7,8,12,14,15},{2,5,6,7,8,12,15},{2,5,6,7,8,13},{2,5,6,7,8,13,14},{2,5,6,7,8,13,14,15},{2,5,6,7,8,13,15},{2,5,6,7,8,14},{2,5,6,7,8,14,15},{2,5,6,7,8,15},{2,5,6,7,9},{2,5,6,7,9,10},{2,5,6,7,9,10,11},{2,5,6,7,9,10,11,12},{2,5,6,7,9,10,11,12,13},{2,5,6,7,9,10,11,12,13,14},{2,5,6,7,9,10,11,12,13,14,15},{2,5,6,7,9,10,11,12,13,15},{2,5,6,7,9,10,11,12,14},{2,5,6,7,9,10,11,12,14,15},{2,5,6,7,9,10,11,12,15},{2,5,6,7,9,10,11,13},{2,5,6,7,9,10,11,13,14},{2,5,6,7,9,10,11,13,14,15},{2,5,6,7,9,10,11,13,15},{2,5,6,7,9,10,11,14},{2,5,6,7,9,10,11,14,15},{2,5,6,7,9,10,11,15},{2,5,6,7,9,10,12},{2,5,6,7,9,10,12,13},{2,5,6,7,9,10,12,13,14},{2,5,6,7,9,10,12,13,14,15},{2,5,6,7,9,10,12,13,15},{2,5,6,7,9,10,12,14},{2,5,6,7,9,10,12,14,15},{2,5,6,7,9,10,12,15},{2,5,6,7,9,10,13},{2,5,6,7,9,10,13,14},{2,5,6,7,9,10,13,14,15},{2,5,6,7,9,10,13,15},{2,5,6,7,9,10,14},{2,5,6,7,9,10,14,15},{2,5,6,7,9,10,15},{2,5,6,7,9,11},{2,5,6,7,9,11,12},{2,5,6,7,9,11,12,13},{2,5,6,7,9,11,12,13,14},{2,5,6,7,9,11,12,13,14,15},{2,5,6,7,9,11,12,13,15},{2,5,6,7,9,11,12,14},{2,5,6,7,9,11,12,14,15},{2,5,6,7,9,11,12,15},{2,5,6,7,9,11,13},{2,5,6,7,9,11,13,14},{2,5,6,7,9,11,13,14,15},{2,5,6,7,9,11,13,15},{2,5,6,7,9,11,14},{2,5,6,7,9,11,14,15},{2,5,6,7,9,11,15},{2,5,6,7,9,12},{2,5,6,7,9,12,13},{2,5,6,7,9,12,13,14},{2,5,6,7,9,12,13,14,15},{2,5,6,7,9,12,13,15},{2,5,6,7,9,12,14},{2,5,6,7,9,12,14,15},{2,5,6,7,9,12,15},{2,5,6,7,9,13},{2,5,6,7,9,13,14},{2,5,6,7,9,13,14,15},{2,5,6,7,9,13,15},{2,5,6,7,9,14},{2,5,6,7,9,14,15},{2,5,6,7,9,15},{2,5,6,7,10},{2,5,6,7,10,11},{2,5,6,7,10,11,12},{2,5,6,7,10,11,12,13},{2,5,6,7,10,11,12,13,14},{2,5,6,7,10,11,12,13,14,15},{2,5,6,7,10,11,12,13,15},{2,5,6,7,10,11,12,14},{2,5,6,7,10,11,12,14,15},{2,5,6,7,10,11,12,15},{2,5,6,7,10,11,13},{2,5,6,7,10,11,13,14},{2,5,6,7,10,11,13,14,15},{2,5,6,7,10,11,13,15},{2,5,6,7,10,11,14},{2,5,6,7,10,11,14,15},{2,5,6,7,10,11,15},{2,5,6,7,10,12},{2,5,6,7,10,12,13},{2,5,6,7,10,12,13,14},{2,5,6,7,10,12,13,14,15},{2,5,6,7,10,12,13,15},{2,5,6,7,10,12,14},{2,5,6,7,10,12,14,15},{2,5,6,7,10,12,15},{2,5,6,7,10,13},{2,5,6,7,10,13,14},{2,5,6,7,10,13,14,15},{2,5,6,7,10,13,15},{2,5,6,7,10,14},{2,5,6,7,10,14,15},{2,5,6,7,10,15},{2,5,6,7,11},{2,5,6,7,11,12},{2,5,6,7,11,12,13},{2,5,6,7,11,12,13,14},{2,5,6,7,11,12,13,14,15},{2,5,6,7,11,12,13,15},{2,5,6,7,11,12,14},{2,5,6,7,11,12,14,15},{2,5,6,7,11,12,15},{2,5,6,7,11,13},{2,5,6,7,11,13,14},{2,5,6,7,11,13,14,15},{2,5,6,7,11,13,15},{2,5,6,7,11,14},{2,5,6,7,11,14,15},{2,5,6,7,11,15},{2,5,6,7,12},{2,5,6,7,12,13},{2,5,6,7,12,13,14},{2,5,6,7,12,13,14,15},{2,5,6,7,12,13,15},{2,5,6,7,12,14},{2,5,6,7,12,14,15},{2,5,6,7,12,15},{2,5,6,7,13},{2,5,6,7,13,14},{2,5,6,7,13,14,15},{2,5,6,7,13,15},{2,5,6,7,14},{2,5,6,7,14,15},{2,5,6,7,15},{2,5,6,8},{2,5,6,8,9},{2,5,6,8,9,10},{2,5,6,8,9,10,11},{2,5,6,8,9,10,11,12},{2,5,6,8,9,10,11,12,13},{2,5,6,8,9,10,11,12,13,14},{2,5,6,8,9,10,11,12,13,14,15},{2,5,6,8,9,10,11,12,13,15},{2,5,6,8,9,10,11,12,14},{2,5,6,8,9,10,11,12,14,15},{2,5,6,8,9,10,11,12,15},{2,5,6,8,9,10,11,13},{2,5,6,8,9,10,11,13,14},{2,5,6,8,9,10,11,13,14,15},{2,5,6,8,9,10,11,13,15},{2,5,6,8,9,10,11,14},{2,5,6,8,9,10,11,14,15},{2,5,6,8,9,10,11,15},{2,5,6,8,9,10,12},{2,5,6,8,9,10,12,13},{2,5,6,8,9,10,12,13,14},{2,5,6,8,9,10,12,13,14,15},{2,5,6,8,9,10,12,13,15},{2,5,6,8,9,10,12,14},{2,5,6,8,9,10,12,14,15},{2,5,6,8,9,10,12,15},{2,5,6,8,9,10,13},{2,5,6,8,9,10,13,14},{2,5,6,8,9,10,13,14,15},{2,5,6,8,9,10,13,15},{2,5,6,8,9,10,14},{2,5,6,8,9,10,14,15},{2,5,6,8,9,10,15},{2,5,6,8,9,11},{2,5,6,8,9,11,12},{2,5,6,8,9,11,12,13},{2,5,6,8,9,11,12,13,14},{2,5,6,8,9,11,12,13,14,15},{2,5,6,8,9,11,12,13,15},{2,5,6,8,9,11,12,14},{2,5,6,8,9,11,12,14,15},{2,5,6,8,9,11,12,15},{2,5,6,8,9,11,13},{2,5,6,8,9,11,13,14},{2,5,6,8,9,11,13,14,15},{2,5,6,8,9,11,13,15},{2,5,6,8,9,11,14},{2,5,6,8,9,11,14,15},{2,5,6,8,9,11,15},{2,5,6,8,9,12},{2,5,6,8,9,12,13},{2,5,6,8,9,12,13,14},{2,5,6,8,9,12,13,14,15},{2,5,6,8,9,12,13,15},{2,5,6,8,9,12,14},{2,5,6,8,9,12,14,15},{2,5,6,8,9,12,15},{2,5,6,8,9,13},{2,5,6,8,9,13,14},{2,5,6,8,9,13,14,15},{2,5,6,8,9,13,15},{2,5,6,8,9,14},{2,5,6,8,9,14,15},{2,5,6,8,9,15},{2,5,6,8,10},{2,5,6,8,10,11},{2,5,6,8,10,11,12},{2,5,6,8,10,11,12,13},{2,5,6,8,10,11,12,13,14},{2,5,6,8,10,11,12,13,14,15},{2,5,6,8,10,11,12,13,15},{2,5,6,8,10,11,12,14},{2,5,6,8,10,11,12,14,15},{2,5,6,8,10,11,12,15},{2,5,6,8,10,11,13},{2,5,6,8,10,11,13,14},{2,5,6,8,10,11,13,14,15},{2,5,6,8,10,11,13,15},{2,5,6,8,10,11,14},{2,5,6,8,10,11,14,15},{2,5,6,8,10,11,15},{2,5,6,8,10,12},{2,5,6,8,10,12,13},{2,5,6,8,10,12,13,14},{2,5,6,8,10,12,13,14,15},{2,5,6,8,10,12,13,15},{2,5,6,8,10,12,14},{2,5,6,8,10,12,14,15},{2,5,6,8,10,12,15},{2,5,6,8,10,13},{2,5,6,8,10,13,14},{2,5,6,8,10,13,14,15},{2,5,6,8,10,13,15},{2,5,6,8,10,14},{2,5,6,8,10,14,15},{2,5,6,8,10,15},{2,5,6,8,11},{2,5,6,8,11,12},{2,5,6,8,11,12,13},{2,5,6,8,11,12,13,14},{2,5,6,8,11,12,13,14,15},{2,5,6,8,11,12,13,15},{2,5,6,8,11,12,14},{2,5,6,8,11,12,14,15},{2,5,6,8,11,12,15},{2,5,6,8,11,13},{2,5,6,8,11,13,14},{2,5,6,8,11,13,14,15},{2,5,6,8,11,13,15},{2,5,6,8,11,14},{2,5,6,8,11,14,15},{2,5,6,8,11,15},{2,5,6,8,12},{2,5,6,8,12,13},{2,5,6,8,12,13,14},{2,5,6,8,12,13,14,15},{2,5,6,8,12,13,15},{2,5,6,8,12,14},{2,5,6,8,12,14,15},{2,5,6,8,12,15},{2,5,6,8,13},{2,5,6,8,13,14},{2,5,6,8,13,14,15},{2,5,6,8,13,15},{2,5,6,8,14},{2,5,6,8,14,15},{2,5,6,8,15},{2,5,6,9},{2,5,6,9,10},{2,5,6,9,10,11},{2,5,6,9,10,11,12},{2,5,6,9,10,11,12,13},{2,5,6,9,10,11,12,13,14},{2,5,6,9,10,11,12,13,14,15},{2,5,6,9,10,11,12,13,15},{2,5,6,9,10,11,12,14},{2,5,6,9,10,11,12,14,15},{2,5,6,9,10,11,12,15},{2,5,6,9,10,11,13},{2,5,6,9,10,11,13,14},{2,5,6,9,10,11,13,14,15},{2,5,6,9,10,11,13,15},{2,5,6,9,10,11,14},{2,5,6,9,10,11,14,15},{2,5,6,9,10,11,15},{2,5,6,9,10,12},{2,5,6,9,10,12,13},{2,5,6,9,10,12,13,14},{2,5,6,9,10,12,13,14,15},{2,5,6,9,10,12,13,15},{2,5,6,9,10,12,14},{2,5,6,9,10,12,14,15},{2,5,6,9,10,12,15},{2,5,6,9,10,13},{2,5,6,9,10,13,14},{2,5,6,9,10,13,14,15},{2,5,6,9,10,13,15},{2,5,6,9,10,14},{2,5,6,9,10,14,15},{2,5,6,9,10,15},{2,5,6,9,11},{2,5,6,9,11,12},{2,5,6,9,11,12,13},{2,5,6,9,11,12,13,14},{2,5,6,9,11,12,13,14,15},{2,5,6,9,11,12,13,15},{2,5,6,9,11,12,14},{2,5,6,9,11,12,14,15},{2,5,6,9,11,12,15},{2,5,6,9,11,13},{2,5,6,9,11,13,14},{2,5,6,9,11,13,14,15},{2,5,6,9,11,13,15},{2,5,6,9,11,14},{2,5,6,9,11,14,15},{2,5,6,9,11,15},{2,5,6,9,12},{2,5,6,9,12,13},{2,5,6,9,12,13,14},{2,5,6,9,12,13,14,15},{2,5,6,9,12,13,15},{2,5,6,9,12,14},{2,5,6,9,12,14,15},{2,5,6,9,12,15},{2,5,6,9,13},{2,5,6,9,13,14},{2,5,6,9,13,14,15},{2,5,6,9,13,15},{2,5,6,9,14},{2,5,6,9,14,15},{2,5,6,9,15},{2,5,6,10},{2,5,6,10,11},{2,5,6,10,11,12},{2,5,6,10,11,12,13},{2,5,6,10,11,12,13,14},{2,5,6,10,11,12,13,14,15},{2,5,6,10,11,12,13,15},{2,5,6,10,11,12,14},{2,5,6,10,11,12,14,15},{2,5,6,10,11,12,15},{2,5,6,10,11,13},{2,5,6,10,11,13,14},{2,5,6,10,11,13,14,15},{2,5,6,10,11,13,15},{2,5,6,10,11,14},{2,5,6,10,11,14,15},{2,5,6,10,11,15},{2,5,6,10,12},{2,5,6,10,12,13},{2,5,6,10,12,13,14},{2,5,6,10,12,13,14,15},{2,5,6,10,12,13,15},{2,5,6,10,12,14},{2,5,6,10,12,14,15},{2,5,6,10,12,15},{2,5,6,10,13},{2,5,6,10,13,14},{2,5,6,10,13,14,15},{2,5,6,10,13,15},{2,5,6,10,14},{2,5,6,10,14,15},{2,5,6,10,15},{2,5,6,11},{2,5,6,11,12},{2,5,6,11,12,13},{2,5,6,11,12,13,14},{2,5,6,11,12,13,14,15},{2,5,6,11,12,13,15},{2,5,6,11,12,14},{2,5,6,11,12,14,15},{2,5,6,11,12,15},{2,5,6,11,13},{2,5,6,11,13,14},{2,5,6,11,13,14,15},{2,5,6,11,13,15},{2,5,6,11,14},{2,5,6,11,14,15},{2,5,6,11,15},{2,5,6,12},{2,5,6,12,13},{2,5,6,12,13,14},{2,5,6,12,13,14,15},{2,5,6,12,13,15},{2,5,6,12,14},{2,5,6,12,14,15},{2,5,6,12,15},{2,5,6,13},{2,5,6,13,14},{2,5,6,13,14,15},{2,5,6,13,15},{2,5,6,14},{2,5,6,14,15},{2,5,6,15},{2,5,7},{2,5,7,8},{2,5,7,8,9},{2,5,7,8,9,10},{2,5,7,8,9,10,11},{2,5,7,8,9,10,11,12},{2,5,7,8,9,10,11,12,13},{2,5,7,8,9,10,11,12,13,14},{2,5,7,8,9,10,11,12,13,14,15},{2,5,7,8,9,10,11,12,13,15},{2,5,7,8,9,10,11,12,14},{2,5,7,8,9,10,11,12,14,15},{2,5,7,8,9,10,11,12,15},{2,5,7,8,9,10,11,13},{2,5,7,8,9,10,11,13,14},{2,5,7,8,9,10,11,13,14,15},{2,5,7,8,9,10,11,13,15},{2,5,7,8,9,10,11,14},{2,5,7,8,9,10,11,14,15},{2,5,7,8,9,10,11,15},{2,5,7,8,9,10,12},{2,5,7,8,9,10,12,13},{2,5,7,8,9,10,12,13,14},{2,5,7,8,9,10,12,13,14,15},{2,5,7,8,9,10,12,13,15},{2,5,7,8,9,10,12,14},{2,5,7,8,9,10,12,14,15},{2,5,7,8,9,10,12,15},{2,5,7,8,9,10,13},{2,5,7,8,9,10,13,14},{2,5,7,8,9,10,13,14,15},{2,5,7,8,9,10,13,15},{2,5,7,8,9,10,14},{2,5,7,8,9,10,14,15},{2,5,7,8,9,10,15},{2,5,7,8,9,11},{2,5,7,8,9,11,12},{2,5,7,8,9,11,12,13},{2,5,7,8,9,11,12,13,14},{2,5,7,8,9,11,12,13,14,15},{2,5,7,8,9,11,12,13,15},{2,5,7,8,9,11,12,14},{2,5,7,8,9,11,12,14,15},{2,5,7,8,9,11,12,15},{2,5,7,8,9,11,13},{2,5,7,8,9,11,13,14},{2,5,7,8,9,11,13,14,15},{2,5,7,8,9,11,13,15},{2,5,7,8,9,11,14},{2,5,7,8,9,11,14,15},{2,5,7,8,9,11,15},{2,5,7,8,9,12},{2,5,7,8,9,12,13},{2,5,7,8,9,12,13,14},{2,5,7,8,9,12,13,14,15},{2,5,7,8,9,12,13,15},{2,5,7,8,9,12,14},{2,5,7,8,9,12,14,15},{2,5,7,8,9,12,15},{2,5,7,8,9,13},{2,5,7,8,9,13,14},{2,5,7,8,9,13,14,15},{2,5,7,8,9,13,15},{2,5,7,8,9,14},{2,5,7,8,9,14,15},{2,5,7,8,9,15},{2,5,7,8,10},{2,5,7,8,10,11},{2,5,7,8,10,11,12},{2,5,7,8,10,11,12,13},{2,5,7,8,10,11,12,13,14},{2,5,7,8,10,11,12,13,14,15},{2,5,7,8,10,11,12,13,15},{2,5,7,8,10,11,12,14},{2,5,7,8,10,11,12,14,15},{2,5,7,8,10,11,12,15},{2,5,7,8,10,11,13},{2,5,7,8,10,11,13,14},{2,5,7,8,10,11,13,14,15},{2,5,7,8,10,11,13,15},{2,5,7,8,10,11,14},{2,5,7,8,10,11,14,15},{2,5,7,8,10,11,15},{2,5,7,8,10,12},{2,5,7,8,10,12,13},{2,5,7,8,10,12,13,14},{2,5,7,8,10,12,13,14,15},{2,5,7,8,10,12,13,15},{2,5,7,8,10,12,14},{2,5,7,8,10,12,14,15},{2,5,7,8,10,12,15},{2,5,7,8,10,13},{2,5,7,8,10,13,14},{2,5,7,8,10,13,14,15},{2,5,7,8,10,13,15},{2,5,7,8,10,14},{2,5,7,8,10,14,15},{2,5,7,8,10,15},{2,5,7,8,11},{2,5,7,8,11,12},{2,5,7,8,11,12,13},{2,5,7,8,11,12,13,14},{2,5,7,8,11,12,13,14,15},{2,5,7,8,11,12,13,15},{2,5,7,8,11,12,14},{2,5,7,8,11,12,14,15},{2,5,7,8,11,12,15},{2,5,7,8,11,13},{2,5,7,8,11,13,14},{2,5,7,8,11,13,14,15},{2,5,7,8,11,13,15},{2,5,7,8,11,14},{2,5,7,8,11,14,15},{2,5,7,8,11,15},{2,5,7,8,12},{2,5,7,8,12,13},{2,5,7,8,12,13,14},{2,5,7,8,12,13,14,15},{2,5,7,8,12,13,15},{2,5,7,8,12,14},{2,5,7,8,12,14,15},{2,5,7,8,12,15},{2,5,7,8,13},{2,5,7,8,13,14},{2,5,7,8,13,14,15},{2,5,7,8,13,15},{2,5,7,8,14},{2,5,7,8,14,15},{2,5,7,8,15},{2,5,7,9},{2,5,7,9,10},{2,5,7,9,10,11},{2,5,7,9,10,11,12},{2,5,7,9,10,11,12,13},{2,5,7,9,10,11,12,13,14},{2,5,7,9,10,11,12,13,14,15},{2,5,7,9,10,11,12,13,15},{2,5,7,9,10,11,12,14},{2,5,7,9,10,11,12,14,15},{2,5,7,9,10,11,12,15},{2,5,7,9,10,11,13},{2,5,7,9,10,11,13,14},{2,5,7,9,10,11,13,14,15},{2,5,7,9,10,11,13,15},{2,5,7,9,10,11,14},{2,5,7,9,10,11,14,15},{2,5,7,9,10,11,15},{2,5,7,9,10,12},{2,5,7,9,10,12,13},{2,5,7,9,10,12,13,14},{2,5,7,9,10,12,13,14,15},{2,5,7,9,10,12,13,15},{2,5,7,9,10,12,14},{2,5,7,9,10,12,14,15},{2,5,7,9,10,12,15},{2,5,7,9,10,13},{2,5,7,9,10,13,14},{2,5,7,9,10,13,14,15},{2,5,7,9,10,13,15},{2,5,7,9,10,14},{2,5,7,9,10,14,15},{2,5,7,9,10,15},{2,5,7,9,11},{2,5,7,9,11,12},{2,5,7,9,11,12,13},{2,5,7,9,11,12,13,14},{2,5,7,9,11,12,13,14,15},{2,5,7,9,11,12,13,15},{2,5,7,9,11,12,14},{2,5,7,9,11,12,14,15},{2,5,7,9,11,12,15},{2,5,7,9,11,13},{2,5,7,9,11,13,14},{2,5,7,9,11,13,14,15},{2,5,7,9,11,13,15},{2,5,7,9,11,14},{2,5,7,9,11,14,15},{2,5,7,9,11,15},{2,5,7,9,12},{2,5,7,9,12,13},{2,5,7,9,12,13,14},{2,5,7,9,12,13,14,15},{2,5,7,9,12,13,15},{2,5,7,9,12,14},{2,5,7,9,12,14,15},{2,5,7,9,12,15},{2,5,7,9,13},{2,5,7,9,13,14},{2,5,7,9,13,14,15},{2,5,7,9,13,15},{2,5,7,9,14},{2,5,7,9,14,15},{2,5,7,9,15},{2,5,7,10},{2,5,7,10,11},{2,5,7,10,11,12},{2,5,7,10,11,12,13},{2,5,7,10,11,12,13,14},{2,5,7,10,11,12,13,14,15},{2,5,7,10,11,12,13,15},{2,5,7,10,11,12,14},{2,5,7,10,11,12,14,15},{2,5,7,10,11,12,15},{2,5,7,10,11,13},{2,5,7,10,11,13,14},{2,5,7,10,11,13,14,15},{2,5,7,10,11,13,15},{2,5,7,10,11,14},{2,5,7,10,11,14,15},{2,5,7,10,11,15},{2,5,7,10,12},{2,5,7,10,12,13},{2,5,7,10,12,13,14},{2,5,7,10,12,13,14,15},{2,5,7,10,12,13,15},{2,5,7,10,12,14},{2,5,7,10,12,14,15},{2,5,7,10,12,15},{2,5,7,10,13},{2,5,7,10,13,14},{2,5,7,10,13,14,15},{2,5,7,10,13,15},{2,5,7,10,14},{2,5,7,10,14,15},{2,5,7,10,15},{2,5,7,11},{2,5,7,11,12},{2,5,7,11,12,13},{2,5,7,11,12,13,14},{2,5,7,11,12,13,14,15},{2,5,7,11,12,13,15},{2,5,7,11,12,14},{2,5,7,11,12,14,15},{2,5,7,11,12,15},{2,5,7,11,13},{2,5,7,11,13,14},{2,5,7,11,13,14,15},{2,5,7,11,13,15},{2,5,7,11,14},{2,5,7,11,14,15},{2,5,7,11,15},{2,5,7,12},{2,5,7,12,13},{2,5,7,12,13,14},{2,5,7,12,13,14,15},{2,5,7,12,13,15},{2,5,7,12,14},{2,5,7,12,14,15},{2,5,7,12,15},{2,5,7,13},{2,5,7,13,14},{2,5,7,13,14,15},{2,5,7,13,15},{2,5,7,14},{2,5,7,14,15},{2,5,7,15},{2,5,8},{2,5,8,9},{2,5,8,9,10},{2,5,8,9,10,11},{2,5,8,9,10,11,12},{2,5,8,9,10,11,12,13},{2,5,8,9,10,11,12,13,14},{2,5,8,9,10,11,12,13,14,15},{2,5,8,9,10,11,12,13,15},{2,5,8,9,10,11,12,14},{2,5,8,9,10,11,12,14,15},{2,5,8,9,10,11,12,15},{2,5,8,9,10,11,13},{2,5,8,9,10,11,13,14},{2,5,8,9,10,11,13,14,15},{2,5,8,9,10,11,13,15},{2,5,8,9,10,11,14},{2,5,8,9,10,11,14,15},{2,5,8,9,10,11,15},{2,5,8,9,10,12},{2,5,8,9,10,12,13},{2,5,8,9,10,12,13,14},{2,5,8,9,10,12,13,14,15},{2,5,8,9,10,12,13,15},{2,5,8,9,10,12,14},{2,5,8,9,10,12,14,15},{2,5,8,9,10,12,15},{2,5,8,9,10,13},{2,5,8,9,10,13,14},{2,5,8,9,10,13,14,15},{2,5,8,9,10,13,15},{2,5,8,9,10,14},{2,5,8,9,10,14,15},{2,5,8,9,10,15},{2,5,8,9,11},{2,5,8,9,11,12},{2,5,8,9,11,12,13},{2,5,8,9,11,12,13,14},{2,5,8,9,11,12,13,14,15},{2,5,8,9,11,12,13,15},{2,5,8,9,11,12,14},{2,5,8,9,11,12,14,15},{2,5,8,9,11,12,15},{2,5,8,9,11,13},{2,5,8,9,11,13,14},{2,5,8,9,11,13,14,15},{2,5,8,9,11,13,15},{2,5,8,9,11,14},{2,5,8,9,11,14,15},{2,5,8,9,11,15},{2,5,8,9,12},{2,5,8,9,12,13},{2,5,8,9,12,13,14},{2,5,8,9,12,13,14,15},{2,5,8,9,12,13,15},{2,5,8,9,12,14},{2,5,8,9,12,14,15},{2,5,8,9,12,15},{2,5,8,9,13},{2,5,8,9,13,14},{2,5,8,9,13,14,15},{2,5,8,9,13,15},{2,5,8,9,14},{2,5,8,9,14,15},{2,5,8,9,15},{2,5,8,10},{2,5,8,10,11},{2,5,8,10,11,12},{2,5,8,10,11,12,13},{2,5,8,10,11,12,13,14},{2,5,8,10,11,12,13,14,15},{2,5,8,10,11,12,13,15},{2,5,8,10,11,12,14},{2,5,8,10,11,12,14,15},{2,5,8,10,11,12,15},{2,5,8,10,11,13},{2,5,8,10,11,13,14},{2,5,8,10,11,13,14,15},{2,5,8,10,11,13,15},{2,5,8,10,11,14},{2,5,8,10,11,14,15},{2,5,8,10,11,15},{2,5,8,10,12},{2,5,8,10,12,13},{2,5,8,10,12,13,14},{2,5,8,10,12,13,14,15},{2,5,8,10,12,13,15},{2,5,8,10,12,14},{2,5,8,10,12,14,15},{2,5,8,10,12,15},{2,5,8,10,13},{2,5,8,10,13,14},{2,5,8,10,13,14,15},{2,5,8,10,13,15},{2,5,8,10,14},{2,5,8,10,14,15},{2,5,8,10,15},{2,5,8,11},{2,5,8,11,12},{2,5,8,11,12,13},{2,5,8,11,12,13,14},{2,5,8,11,12,13,14,15},{2,5,8,11,12,13,15},{2,5,8,11,12,14},{2,5,8,11,12,14,15},{2,5,8,11,12,15},{2,5,8,11,13},{2,5,8,11,13,14},{2,5,8,11,13,14,15},{2,5,8,11,13,15},{2,5,8,11,14},{2,5,8,11,14,15},{2,5,8,11,15},{2,5,8,12},{2,5,8,12,13},{2,5,8,12,13,14},{2,5,8,12,13,14,15},{2,5,8,12,13,15},{2,5,8,12,14},{2,5,8,12,14,15},{2,5,8,12,15},{2,5,8,13},{2,5,8,13,14},{2,5,8,13,14,15},{2,5,8,13,15},{2,5,8,14},{2,5,8,14,15},{2,5,8,15},{2,5,9},{2,5,9,10},{2,5,9,10,11},{2,5,9,10,11,12},{2,5,9,10,11,12,13},{2,5,9,10,11,12,13,14},{2,5,9,10,11,12,13,14,15},{2,5,9,10,11,12,13,15},{2,5,9,10,11,12,14},{2,5,9,10,11,12,14,15},{2,5,9,10,11,12,15},{2,5,9,10,11,13},{2,5,9,10,11,13,14},{2,5,9,10,11,13,14,15},{2,5,9,10,11,13,15},{2,5,9,10,11,14},{2,5,9,10,11,14,15},{2,5,9,10,11,15},{2,5,9,10,12},{2,5,9,10,12,13},{2,5,9,10,12,13,14},{2,5,9,10,12,13,14,15},{2,5,9,10,12,13,15},{2,5,9,10,12,14},{2,5,9,10,12,14,15},{2,5,9,10,12,15},{2,5,9,10,13},{2,5,9,10,13,14},{2,5,9,10,13,14,15},{2,5,9,10,13,15},{2,5,9,10,14},{2,5,9,10,14,15},{2,5,9,10,15},{2,5,9,11},{2,5,9,11,12},{2,5,9,11,12,13},{2,5,9,11,12,13,14},{2,5,9,11,12,13,14,15},{2,5,9,11,12,13,15},{2,5,9,11,12,14},{2,5,9,11,12,14,15},{2,5,9,11,12,15},{2,5,9,11,13},{2,5,9,11,13,14},{2,5,9,11,13,14,15},{2,5,9,11,13,15},{2,5,9,11,14},{2,5,9,11,14,15},{2,5,9,11,15},{2,5,9,12},{2,5,9,12,13},{2,5,9,12,13,14},{2,5,9,12,13,14,15},{2,5,9,12,13,15},{2,5,9,12,14},{2,5,9,12,14,15},{2,5,9,12,15},{2,5,9,13},{2,5,9,13,14},{2,5,9,13,14,15},{2,5,9,13,15},{2,5,9,14},{2,5,9,14,15},{2,5,9,15},{2,5,10},{2,5,10,11},{2,5,10,11,12},{2,5,10,11,12,13},{2,5,10,11,12,13,14},{2,5,10,11,12,13,14,15},{2,5,10,11,12,13,15},{2,5,10,11,12,14},{2,5,10,11,12,14,15},{2,5,10,11,12,15},{2,5,10,11,13},{2,5,10,11,13,14},{2,5,10,11,13,14,15},{2,5,10,11,13,15},{2,5,10,11,14},{2,5,10,11,14,15},{2,5,10,11,15},{2,5,10,12},{2,5,10,12,13},{2,5,10,12,13,14},{2,5,10,12,13,14,15},{2,5,10,12,13,15},{2,5,10,12,14},{2,5,10,12,14,15},{2,5,10,12,15},{2,5,10,13},{2,5,10,13,14},{2,5,10,13,14,15},{2,5,10,13,15},{2,5,10,14},{2,5,10,14,15},{2,5,10,15},{2,5,11},{2,5,11,12},{2,5,11,12,13},{2,5,11,12,13,14},{2,5,11,12,13,14,15},{2,5,11,12,13,15},{2,5,11,12,14},{2,5,11,12,14,15},{2,5,11,12,15},{2,5,11,13},{2,5,11,13,14},{2,5,11,13,14,15},{2,5,11,13,15},{2,5,11,14},{2,5,11,14,15},{2,5,11,15},{2,5,12},{2,5,12,13},{2,5,12,13,14},{2,5,12,13,14,15},{2,5,12,13,15},{2,5,12,14},{2,5,12,14,15},{2,5,12,15},{2,5,13},{2,5,13,14},{2,5,13,14,15},{2,5,13,15},{2,5,14},{2,5,14,15},{2,5,15},{2,6},{2,6,7},{2,6,7,8},{2,6,7,8,9},{2,6,7,8,9,10},{2,6,7,8,9,10,11},{2,6,7,8,9,10,11,12},{2,6,7,8,9,10,11,12,13},{2,6,7,8,9,10,11,12,13,14},{2,6,7,8,9,10,11,12,13,14,15},{2,6,7,8,9,10,11,12,13,15},{2,6,7,8,9,10,11,12,14},{2,6,7,8,9,10,11,12,14,15},{2,6,7,8,9,10,11,12,15},{2,6,7,8,9,10,11,13},{2,6,7,8,9,10,11,13,14},{2,6,7,8,9,10,11,13,14,15},{2,6,7,8,9,10,11,13,15},{2,6,7,8,9,10,11,14},{2,6,7,8,9,10,11,14,15},{2,6,7,8,9,10,11,15},{2,6,7,8,9,10,12},{2,6,7,8,9,10,12,13},{2,6,7,8,9,10,12,13,14},{2,6,7,8,9,10,12,13,14,15},{2,6,7,8,9,10,12,13,15},{2,6,7,8,9,10,12,14},{2,6,7,8,9,10,12,14,15},{2,6,7,8,9,10,12,15},{2,6,7,8,9,10,13},{2,6,7,8,9,10,13,14},{2,6,7,8,9,10,13,14,15},{2,6,7,8,9,10,13,15},{2,6,7,8,9,10,14},{2,6,7,8,9,10,14,15},{2,6,7,8,9,10,15},{2,6,7,8,9,11},{2,6,7,8,9,11,12},{2,6,7,8,9,11,12,13},{2,6,7,8,9,11,12,13,14},{2,6,7,8,9,11,12,13,14,15},{2,6,7,8,9,11,12,13,15},{2,6,7,8,9,11,12,14},{2,6,7,8,9,11,12,14,15},{2,6,7,8,9,11,12,15},{2,6,7,8,9,11,13},{2,6,7,8,9,11,13,14},{2,6,7,8,9,11,13,14,15},{2,6,7,8,9,11,13,15},{2,6,7,8,9,11,14},{2,6,7,8,9,11,14,15},{2,6,7,8,9,11,15},{2,6,7,8,9,12},{2,6,7,8,9,12,13},{2,6,7,8,9,12,13,14},{2,6,7,8,9,12,13,14,15},{2,6,7,8,9,12,13,15},{2,6,7,8,9,12,14},{2,6,7,8,9,12,14,15},{2,6,7,8,9,12,15},{2,6,7,8,9,13},{2,6,7,8,9,13,14},{2,6,7,8,9,13,14,15},{2,6,7,8,9,13,15},{2,6,7,8,9,14},{2,6,7,8,9,14,15},{2,6,7,8,9,15},{2,6,7,8,10},{2,6,7,8,10,11},{2,6,7,8,10,11,12},{2,6,7,8,10,11,12,13},{2,6,7,8,10,11,12,13,14},{2,6,7,8,10,11,12,13,14,15},{2,6,7,8,10,11,12,13,15},{2,6,7,8,10,11,12,14},{2,6,7,8,10,11,12,14,15},{2,6,7,8,10,11,12,15},{2,6,7,8,10,11,13},{2,6,7,8,10,11,13,14},{2,6,7,8,10,11,13,14,15},{2,6,7,8,10,11,13,15},{2,6,7,8,10,11,14},{2,6,7,8,10,11,14,15},{2,6,7,8,10,11,15},{2,6,7,8,10,12},{2,6,7,8,10,12,13},{2,6,7,8,10,12,13,14},{2,6,7,8,10,12,13,14,15},{2,6,7,8,10,12,13,15},{2,6,7,8,10,12,14},{2,6,7,8,10,12,14,15},{2,6,7,8,10,12,15},{2,6,7,8,10,13},{2,6,7,8,10,13,14},{2,6,7,8,10,13,14,15},{2,6,7,8,10,13,15},{2,6,7,8,10,14},{2,6,7,8,10,14,15},{2,6,7,8,10,15},{2,6,7,8,11},{2,6,7,8,11,12},{2,6,7,8,11,12,13},{2,6,7,8,11,12,13,14},{2,6,7,8,11,12,13,14,15},{2,6,7,8,11,12,13,15},{2,6,7,8,11,12,14},{2,6,7,8,11,12,14,15},{2,6,7,8,11,12,15},{2,6,7,8,11,13},{2,6,7,8,11,13,14},{2,6,7,8,11,13,14,15},{2,6,7,8,11,13,15},{2,6,7,8,11,14},{2,6,7,8,11,14,15},{2,6,7,8,11,15},{2,6,7,8,12},{2,6,7,8,12,13},{2,6,7,8,12,13,14},{2,6,7,8,12,13,14,15},{2,6,7,8,12,13,15},{2,6,7,8,12,14},{2,6,7,8,12,14,15},{2,6,7,8,12,15},{2,6,7,8,13},{2,6,7,8,13,14},{2,6,7,8,13,14,15},{2,6,7,8,13,15},{2,6,7,8,14},{2,6,7,8,14,15},{2,6,7,8,15},{2,6,7,9},{2,6,7,9,10},{2,6,7,9,10,11},{2,6,7,9,10,11,12},{2,6,7,9,10,11,12,13},{2,6,7,9,10,11,12,13,14},{2,6,7,9,10,11,12,13,14,15},{2,6,7,9,10,11,12,13,15},{2,6,7,9,10,11,12,14},{2,6,7,9,10,11,12,14,15},{2,6,7,9,10,11,12,15},{2,6,7,9,10,11,13},{2,6,7,9,10,11,13,14},{2,6,7,9,10,11,13,14,15},{2,6,7,9,10,11,13,15},{2,6,7,9,10,11,14},{2,6,7,9,10,11,14,15},{2,6,7,9,10,11,15},{2,6,7,9,10,12},{2,6,7,9,10,12,13},{2,6,7,9,10,12,13,14},{2,6,7,9,10,12,13,14,15},{2,6,7,9,10,12,13,15},{2,6,7,9,10,12,14},{2,6,7,9,10,12,14,15},{2,6,7,9,10,12,15},{2,6,7,9,10,13},{2,6,7,9,10,13,14},{2,6,7,9,10,13,14,15},{2,6,7,9,10,13,15},{2,6,7,9,10,14},{2,6,7,9,10,14,15},{2,6,7,9,10,15},{2,6,7,9,11},{2,6,7,9,11,12},{2,6,7,9,11,12,13},{2,6,7,9,11,12,13,14},{2,6,7,9,11,12,13,14,15},{2,6,7,9,11,12,13,15},{2,6,7,9,11,12,14},{2,6,7,9,11,12,14,15},{2,6,7,9,11,12,15},{2,6,7,9,11,13},{2,6,7,9,11,13,14},{2,6,7,9,11,13,14,15},{2,6,7,9,11,13,15},{2,6,7,9,11,14},{2,6,7,9,11,14,15},{2,6,7,9,11,15},{2,6,7,9,12},{2,6,7,9,12,13},{2,6,7,9,12,13,14},{2,6,7,9,12,13,14,15},{2,6,7,9,12,13,15},{2,6,7,9,12,14},{2,6,7,9,12,14,15},{2,6,7,9,12,15},{2,6,7,9,13},{2,6,7,9,13,14},{2,6,7,9,13,14,15},{2,6,7,9,13,15},{2,6,7,9,14},{2,6,7,9,14,15},{2,6,7,9,15},{2,6,7,10},{2,6,7,10,11},{2,6,7,10,11,12},{2,6,7,10,11,12,13},{2,6,7,10,11,12,13,14},{2,6,7,10,11,12,13,14,15},{2,6,7,10,11,12,13,15},{2,6,7,10,11,12,14},{2,6,7,10,11,12,14,15},{2,6,7,10,11,12,15},{2,6,7,10,11,13},{2,6,7,10,11,13,14},{2,6,7,10,11,13,14,15},{2,6,7,10,11,13,15},{2,6,7,10,11,14},{2,6,7,10,11,14,15},{2,6,7,10,11,15},{2,6,7,10,12},{2,6,7,10,12,13},{2,6,7,10,12,13,14},{2,6,7,10,12,13,14,15},{2,6,7,10,12,13,15},{2,6,7,10,12,14},{2,6,7,10,12,14,15},{2,6,7,10,12,15},{2,6,7,10,13},{2,6,7,10,13,14},{2,6,7,10,13,14,15},{2,6,7,10,13,15},{2,6,7,10,14},{2,6,7,10,14,15},{2,6,7,10,15},{2,6,7,11},{2,6,7,11,12},{2,6,7,11,12,13},{2,6,7,11,12,13,14},{2,6,7,11,12,13,14,15},{2,6,7,11,12,13,15},{2,6,7,11,12,14},{2,6,7,11,12,14,15},{2,6,7,11,12,15},{2,6,7,11,13},{2,6,7,11,13,14},{2,6,7,11,13,14,15},{2,6,7,11,13,15},{2,6,7,11,14},{2,6,7,11,14,15},{2,6,7,11,15},{2,6,7,12},{2,6,7,12,13},{2,6,7,12,13,14},{2,6,7,12,13,14,15},{2,6,7,12,13,15},{2,6,7,12,14},{2,6,7,12,14,15},{2,6,7,12,15},{2,6,7,13},{2,6,7,13,14},{2,6,7,13,14,15},{2,6,7,13,15},{2,6,7,14},{2,6,7,14,15},{2,6,7,15},{2,6,8},{2,6,8,9},{2,6,8,9,10},{2,6,8,9,10,11},{2,6,8,9,10,11,12},{2,6,8,9,10,11,12,13},{2,6,8,9,10,11,12,13,14},{2,6,8,9,10,11,12,13,14,15},{2,6,8,9,10,11,12,13,15},{2,6,8,9,10,11,12,14},{2,6,8,9,10,11,12,14,15},{2,6,8,9,10,11,12,15},{2,6,8,9,10,11,13},{2,6,8,9,10,11,13,14},{2,6,8,9,10,11,13,14,15},{2,6,8,9,10,11,13,15},{2,6,8,9,10,11,14},{2,6,8,9,10,11,14,15},{2,6,8,9,10,11,15},{2,6,8,9,10,12},{2,6,8,9,10,12,13},{2,6,8,9,10,12,13,14},{2,6,8,9,10,12,13,14,15},{2,6,8,9,10,12,13,15},{2,6,8,9,10,12,14},{2,6,8,9,10,12,14,15},{2,6,8,9,10,12,15},{2,6,8,9,10,13},{2,6,8,9,10,13,14},{2,6,8,9,10,13,14,15},{2,6,8,9,10,13,15},{2,6,8,9,10,14},{2,6,8,9,10,14,15},{2,6,8,9,10,15},{2,6,8,9,11},{2,6,8,9,11,12},{2,6,8,9,11,12,13},{2,6,8,9,11,12,13,14},{2,6,8,9,11,12,13,14,15},{2,6,8,9,11,12,13,15},{2,6,8,9,11,12,14},{2,6,8,9,11,12,14,15},{2,6,8,9,11,12,15},{2,6,8,9,11,13},{2,6,8,9,11,13,14},{2,6,8,9,11,13,14,15},{2,6,8,9,11,13,15},{2,6,8,9,11,14},{2,6,8,9,11,14,15},{2,6,8,9,11,15},{2,6,8,9,12},{2,6,8,9,12,13},{2,6,8,9,12,13,14},{2,6,8,9,12,13,14,15},{2,6,8,9,12,13,15},{2,6,8,9,12,14},{2,6,8,9,12,14,15},{2,6,8,9,12,15},{2,6,8,9,13},{2,6,8,9,13,14},{2,6,8,9,13,14,15},{2,6,8,9,13,15},{2,6,8,9,14},{2,6,8,9,14,15},{2,6,8,9,15},{2,6,8,10},{2,6,8,10,11},{2,6,8,10,11,12},{2,6,8,10,11,12,13},{2,6,8,10,11,12,13,14},{2,6,8,10,11,12,13,14,15},{2,6,8,10,11,12,13,15},{2,6,8,10,11,12,14},{2,6,8,10,11,12,14,15},{2,6,8,10,11,12,15},{2,6,8,10,11,13},{2,6,8,10,11,13,14},{2,6,8,10,11,13,14,15},{2,6,8,10,11,13,15},{2,6,8,10,11,14},{2,6,8,10,11,14,15},{2,6,8,10,11,15},{2,6,8,10,12},{2,6,8,10,12,13},{2,6,8,10,12,13,14},{2,6,8,10,12,13,14,15},{2,6,8,10,12,13,15},{2,6,8,10,12,14},{2,6,8,10,12,14,15},{2,6,8,10,12,15},{2,6,8,10,13},{2,6,8,10,13,14},{2,6,8,10,13,14,15},{2,6,8,10,13,15},{2,6,8,10,14},{2,6,8,10,14,15},{2,6,8,10,15},{2,6,8,11},{2,6,8,11,12},{2,6,8,11,12,13},{2,6,8,11,12,13,14},{2,6,8,11,12,13,14,15},{2,6,8,11,12,13,15},{2,6,8,11,12,14},{2,6,8,11,12,14,15},{2,6,8,11,12,15},{2,6,8,11,13},{2,6,8,11,13,14},{2,6,8,11,13,14,15},{2,6,8,11,13,15},{2,6,8,11,14},{2,6,8,11,14,15},{2,6,8,11,15},{2,6,8,12},{2,6,8,12,13},{2,6,8,12,13,14},{2,6,8,12,13,14,15},{2,6,8,12,13,15},{2,6,8,12,14},{2,6,8,12,14,15},{2,6,8,12,15},{2,6,8,13},{2,6,8,13,14},{2,6,8,13,14,15},{2,6,8,13,15},{2,6,8,14},{2,6,8,14,15},{2,6,8,15},{2,6,9},{2,6,9,10},{2,6,9,10,11},{2,6,9,10,11,12},{2,6,9,10,11,12,13},{2,6,9,10,11,12,13,14},{2,6,9,10,11,12,13,14,15},{2,6,9,10,11,12,13,15},{2,6,9,10,11,12,14},{2,6,9,10,11,12,14,15},{2,6,9,10,11,12,15},{2,6,9,10,11,13},{2,6,9,10,11,13,14},{2,6,9,10,11,13,14,15},{2,6,9,10,11,13,15},{2,6,9,10,11,14},{2,6,9,10,11,14,15},{2,6,9,10,11,15},{2,6,9,10,12},{2,6,9,10,12,13},{2,6,9,10,12,13,14},{2,6,9,10,12,13,14,15},{2,6,9,10,12,13,15},{2,6,9,10,12,14},{2,6,9,10,12,14,15},{2,6,9,10,12,15},{2,6,9,10,13},{2,6,9,10,13,14},{2,6,9,10,13,14,15},{2,6,9,10,13,15},{2,6,9,10,14},{2,6,9,10,14,15},{2,6,9,10,15},{2,6,9,11},{2,6,9,11,12},{2,6,9,11,12,13},{2,6,9,11,12,13,14},{2,6,9,11,12,13,14,15},{2,6,9,11,12,13,15},{2,6,9,11,12,14},{2,6,9,11,12,14,15},{2,6,9,11,12,15},{2,6,9,11,13},{2,6,9,11,13,14},{2,6,9,11,13,14,15},{2,6,9,11,13,15},{2,6,9,11,14},{2,6,9,11,14,15},{2,6,9,11,15},{2,6,9,12},{2,6,9,12,13},{2,6,9,12,13,14},{2,6,9,12,13,14,15},{2,6,9,12,13,15},{2,6,9,12,14},{2,6,9,12,14,15},{2,6,9,12,15},{2,6,9,13},{2,6,9,13,14},{2,6,9,13,14,15},{2,6,9,13,15},{2,6,9,14},{2,6,9,14,15},{2,6,9,15},{2,6,10},{2,6,10,11},{2,6,10,11,12},{2,6,10,11,12,13},{2,6,10,11,12,13,14},{2,6,10,11,12,13,14,15},{2,6,10,11,12,13,15},{2,6,10,11,12,14},{2,6,10,11,12,14,15},{2,6,10,11,12,15},{2,6,10,11,13},{2,6,10,11,13,14},{2,6,10,11,13,14,15},{2,6,10,11,13,15},{2,6,10,11,14},{2,6,10,11,14,15},{2,6,10,11,15},{2,6,10,12},{2,6,10,12,13},{2,6,10,12,13,14},{2,6,10,12,13,14,15},{2,6,10,12,13,15},{2,6,10,12,14},{2,6,10,12,14,15},{2,6,10,12,15},{2,6,10,13},{2,6,10,13,14},{2,6,10,13,14,15},{2,6,10,13,15},{2,6,10,14},{2,6,10,14,15},{2,6,10,15},{2,6,11},{2,6,11,12},{2,6,11,12,13},{2,6,11,12,13,14},{2,6,11,12,13,14,15},{2,6,11,12,13,15},{2,6,11,12,14},{2,6,11,12,14,15},{2,6,11,12,15},{2,6,11,13},{2,6,11,13,14},{2,6,11,13,14,15},{2,6,11,13,15},{2,6,11,14},{2,6,11,14,15},{2,6,11,15},{2,6,12},{2,6,12,13},{2,6,12,13,14},{2,6,12,13,14,15},{2,6,12,13,15},{2,6,12,14},{2,6,12,14,15},{2,6,12,15},{2,6,13},{2,6,13,14},{2,6,13,14,15},{2,6,13,15},{2,6,14},{2,6,14,15},{2,6,15},{2,7},{2,7,8},{2,7,8,9},{2,7,8,9,10},{2,7,8,9,10,11},{2,7,8,9,10,11,12},{2,7,8,9,10,11,12,13},{2,7,8,9,10,11,12,13,14},{2,7,8,9,10,11,12,13,14,15},{2,7,8,9,10,11,12,13,15},{2,7,8,9,10,11,12,14},{2,7,8,9,10,11,12,14,15},{2,7,8,9,10,11,12,15},{2,7,8,9,10,11,13},{2,7,8,9,10,11,13,14},{2,7,8,9,10,11,13,14,15},{2,7,8,9,10,11,13,15},{2,7,8,9,10,11,14},{2,7,8,9,10,11,14,15},{2,7,8,9,10,11,15},{2,7,8,9,10,12},{2,7,8,9,10,12,13},{2,7,8,9,10,12,13,14},{2,7,8,9,10,12,13,14,15},{2,7,8,9,10,12,13,15},{2,7,8,9,10,12,14},{2,7,8,9,10,12,14,15},{2,7,8,9,10,12,15},{2,7,8,9,10,13},{2,7,8,9,10,13,14},{2,7,8,9,10,13,14,15},{2,7,8,9,10,13,15},{2,7,8,9,10,14},{2,7,8,9,10,14,15},{2,7,8,9,10,15},{2,7,8,9,11},{2,7,8,9,11,12},{2,7,8,9,11,12,13},{2,7,8,9,11,12,13,14},{2,7,8,9,11,12,13,14,15},{2,7,8,9,11,12,13,15},{2,7,8,9,11,12,14},{2,7,8,9,11,12,14,15},{2,7,8,9,11,12,15},{2,7,8,9,11,13},{2,7,8,9,11,13,14},{2,7,8,9,11,13,14,15},{2,7,8,9,11,13,15},{2,7,8,9,11,14},{2,7,8,9,11,14,15},{2,7,8,9,11,15},{2,7,8,9,12},{2,7,8,9,12,13},{2,7,8,9,12,13,14},{2,7,8,9,12,13,14,15},{2,7,8,9,12,13,15},{2,7,8,9,12,14},{2,7,8,9,12,14,15},{2,7,8,9,12,15},{2,7,8,9,13},{2,7,8,9,13,14},{2,7,8,9,13,14,15},{2,7,8,9,13,15},{2,7,8,9,14},{2,7,8,9,14,15},{2,7,8,9,15},{2,7,8,10},{2,7,8,10,11},{2,7,8,10,11,12},{2,7,8,10,11,12,13},{2,7,8,10,11,12,13,14},{2,7,8,10,11,12,13,14,15},{2,7,8,10,11,12,13,15},{2,7,8,10,11,12,14},{2,7,8,10,11,12,14,15},{2,7,8,10,11,12,15},{2,7,8,10,11,13},{2,7,8,10,11,13,14},{2,7,8,10,11,13,14,15},{2,7,8,10,11,13,15},{2,7,8,10,11,14},{2,7,8,10,11,14,15},{2,7,8,10,11,15},{2,7,8,10,12},{2,7,8,10,12,13},{2,7,8,10,12,13,14},{2,7,8,10,12,13,14,15},{2,7,8,10,12,13,15},{2,7,8,10,12,14},{2,7,8,10,12,14,15},{2,7,8,10,12,15},{2,7,8,10,13},{2,7,8,10,13,14},{2,7,8,10,13,14,15},{2,7,8,10,13,15},{2,7,8,10,14},{2,7,8,10,14,15},{2,7,8,10,15},{2,7,8,11},{2,7,8,11,12},{2,7,8,11,12,13},{2,7,8,11,12,13,14},{2,7,8,11,12,13,14,15},{2,7,8,11,12,13,15},{2,7,8,11,12,14},{2,7,8,11,12,14,15},{2,7,8,11,12,15},{2,7,8,11,13},{2,7,8,11,13,14},{2,7,8,11,13,14,15},{2,7,8,11,13,15},{2,7,8,11,14},{2,7,8,11,14,15},{2,7,8,11,15},{2,7,8,12},{2,7,8,12,13},{2,7,8,12,13,14},{2,7,8,12,13,14,15},{2,7,8,12,13,15},{2,7,8,12,14},{2,7,8,12,14,15},{2,7,8,12,15},{2,7,8,13},{2,7,8,13,14},{2,7,8,13,14,15},{2,7,8,13,15},{2,7,8,14},{2,7,8,14,15},{2,7,8,15},{2,7,9},{2,7,9,10},{2,7,9,10,11},{2,7,9,10,11,12},{2,7,9,10,11,12,13},{2,7,9,10,11,12,13,14},{2,7,9,10,11,12,13,14,15},{2,7,9,10,11,12,13,15},{2,7,9,10,11,12,14},{2,7,9,10,11,12,14,15},{2,7,9,10,11,12,15},{2,7,9,10,11,13},{2,7,9,10,11,13,14},{2,7,9,10,11,13,14,15},{2,7,9,10,11,13,15},{2,7,9,10,11,14},{2,7,9,10,11,14,15},{2,7,9,10,11,15},{2,7,9,10,12},{2,7,9,10,12,13},{2,7,9,10,12,13,14},{2,7,9,10,12,13,14,15},{2,7,9,10,12,13,15},{2,7,9,10,12,14},{2,7,9,10,12,14,15},{2,7,9,10,12,15},{2,7,9,10,13},{2,7,9,10,13,14},{2,7,9,10,13,14,15},{2,7,9,10,13,15},{2,7,9,10,14},{2,7,9,10,14,15},{2,7,9,10,15},{2,7,9,11},{2,7,9,11,12},{2,7,9,11,12,13},{2,7,9,11,12,13,14},{2,7,9,11,12,13,14,15},{2,7,9,11,12,13,15},{2,7,9,11,12,14},{2,7,9,11,12,14,15},{2,7,9,11,12,15},{2,7,9,11,13},{2,7,9,11,13,14},{2,7,9,11,13,14,15},{2,7,9,11,13,15},{2,7,9,11,14},{2,7,9,11,14,15},{2,7,9,11,15},{2,7,9,12},{2,7,9,12,13},{2,7,9,12,13,14},{2,7,9,12,13,14,15},{2,7,9,12,13,15},{2,7,9,12,14},{2,7,9,12,14,15},{2,7,9,12,15},{2,7,9,13},{2,7,9,13,14},{2,7,9,13,14,15},{2,7,9,13,15},{2,7,9,14},{2,7,9,14,15},{2,7,9,15},{2,7,10},{2,7,10,11},{2,7,10,11,12},{2,7,10,11,12,13},{2,7,10,11,12,13,14},{2,7,10,11,12,13,14,15},{2,7,10,11,12,13,15},{2,7,10,11,12,14},{2,7,10,11,12,14,15},{2,7,10,11,12,15},{2,7,10,11,13},{2,7,10,11,13,14},{2,7,10,11,13,14,15},{2,7,10,11,13,15},{2,7,10,11,14},{2,7,10,11,14,15},{2,7,10,11,15},{2,7,10,12},{2,7,10,12,13},{2,7,10,12,13,14},{2,7,10,12,13,14,15},{2,7,10,12,13,15},{2,7,10,12,14},{2,7,10,12,14,15},{2,7,10,12,15},{2,7,10,13},{2,7,10,13,14},{2,7,10,13,14,15},{2,7,10,13,15},{2,7,10,14},{2,7,10,14,15},{2,7,10,15},{2,7,11},{2,7,11,12},{2,7,11,12,13},{2,7,11,12,13,14},{2,7,11,12,13,14,15},{2,7,11,12,13,15},{2,7,11,12,14},{2,7,11,12,14,15},{2,7,11,12,15},{2,7,11,13},{2,7,11,13,14},{2,7,11,13,14,15},{2,7,11,13,15},{2,7,11,14},{2,7,11,14,15},{2,7,11,15},{2,7,12},{2,7,12,13},{2,7,12,13,14},{2,7,12,13,14,15},{2,7,12,13,15},{2,7,12,14},{2,7,12,14,15},{2,7,12,15},{2,7,13},{2,7,13,14},{2,7,13,14,15},{2,7,13,15},{2,7,14},{2,7,14,15},{2,7,15},{2,8},{2,8,9},{2,8,9,10},{2,8,9,10,11},{2,8,9,10,11,12},{2,8,9,10,11,12,13},{2,8,9,10,11,12,13,14},{2,8,9,10,11,12,13,14,15},{2,8,9,10,11,12,13,15},{2,8,9,10,11,12,14},{2,8,9,10,11,12,14,15},{2,8,9,10,11,12,15},{2,8,9,10,11,13},{2,8,9,10,11,13,14},{2,8,9,10,11,13,14,15},{2,8,9,10,11,13,15},{2,8,9,10,11,14},{2,8,9,10,11,14,15},{2,8,9,10,11,15},{2,8,9,10,12},{2,8,9,10,12,13},{2,8,9,10,12,13,14},{2,8,9,10,12,13,14,15},{2,8,9,10,12,13,15},{2,8,9,10,12,14},{2,8,9,10,12,14,15},{2,8,9,10,12,15},{2,8,9,10,13},{2,8,9,10,13,14},{2,8,9,10,13,14,15},{2,8,9,10,13,15},{2,8,9,10,14},{2,8,9,10,14,15},{2,8,9,10,15},{2,8,9,11},{2,8,9,11,12},{2,8,9,11,12,13},{2,8,9,11,12,13,14},{2,8,9,11,12,13,14,15},{2,8,9,11,12,13,15},{2,8,9,11,12,14},{2,8,9,11,12,14,15},{2,8,9,11,12,15},{2,8,9,11,13},{2,8,9,11,13,14},{2,8,9,11,13,14,15},{2,8,9,11,13,15},{2,8,9,11,14},{2,8,9,11,14,15},{2,8,9,11,15},{2,8,9,12},{2,8,9,12,13},{2,8,9,12,13,14},{2,8,9,12,13,14,15},{2,8,9,12,13,15},{2,8,9,12,14},{2,8,9,12,14,15},{2,8,9,12,15},{2,8,9,13},{2,8,9,13,14},{2,8,9,13,14,15},{2,8,9,13,15},{2,8,9,14},{2,8,9,14,15},{2,8,9,15},{2,8,10},{2,8,10,11},{2,8,10,11,12},{2,8,10,11,12,13},{2,8,10,11,12,13,14},{2,8,10,11,12,13,14,15},{2,8,10,11,12,13,15},{2,8,10,11,12,14},{2,8,10,11,12,14,15},{2,8,10,11,12,15},{2,8,10,11,13},{2,8,10,11,13,14},{2,8,10,11,13,14,15},{2,8,10,11,13,15},{2,8,10,11,14},{2,8,10,11,14,15},{2,8,10,11,15},{2,8,10,12},{2,8,10,12,13},{2,8,10,12,13,14},{2,8,10,12,13,14,15},{2,8,10,12,13,15},{2,8,10,12,14},{2,8,10,12,14,15},{2,8,10,12,15},{2,8,10,13},{2,8,10,13,14},{2,8,10,13,14,15},{2,8,10,13,15},{2,8,10,14},{2,8,10,14,15},{2,8,10,15},{2,8,11},{2,8,11,12},{2,8,11,12,13},{2,8,11,12,13,14},{2,8,11,12,13,14,15},{2,8,11,12,13,15},{2,8,11,12,14},{2,8,11,12,14,15},{2,8,11,12,15},{2,8,11,13},{2,8,11,13,14},{2,8,11,13,14,15},{2,8,11,13,15},{2,8,11,14},{2,8,11,14,15},{2,8,11,15},{2,8,12},{2,8,12,13},{2,8,12,13,14},{2,8,12,13,14,15},{2,8,12,13,15},{2,8,12,14},{2,8,12,14,15},{2,8,12,15},{2,8,13},{2,8,13,14},{2,8,13,14,15},{2,8,13,15},{2,8,14},{2,8,14,15},{2,8,15},{2,9},{2,9,10},{2,9,10,11},{2,9,10,11,12},{2,9,10,11,12,13},{2,9,10,11,12,13,14},{2,9,10,11,12,13,14,15},{2,9,10,11,12,13,15},{2,9,10,11,12,14},{2,9,10,11,12,14,15},{2,9,10,11,12,15},{2,9,10,11,13},{2,9,10,11,13,14},{2,9,10,11,13,14,15},{2,9,10,11,13,15},{2,9,10,11,14},{2,9,10,11,14,15},{2,9,10,11,15},{2,9,10,12},{2,9,10,12,13},{2,9,10,12,13,14},{2,9,10,12,13,14,15},{2,9,10,12,13,15},{2,9,10,12,14},{2,9,10,12,14,15},{2,9,10,12,15},{2,9,10,13},{2,9,10,13,14},{2,9,10,13,14,15},{2,9,10,13,15},{2,9,10,14},{2,9,10,14,15},{2,9,10,15},{2,9,11},{2,9,11,12},{2,9,11,12,13},{2,9,11,12,13,14},{2,9,11,12,13,14,15},{2,9,11,12,13,15},{2,9,11,12,14},{2,9,11,12,14,15},{2,9,11,12,15},{2,9,11,13},{2,9,11,13,14},{2,9,11,13,14,15},{2,9,11,13,15},{2,9,11,14},{2,9,11,14,15},{2,9,11,15},{2,9,12},{2,9,12,13},{2,9,12,13,14},{2,9,12,13,14,15},{2,9,12,13,15},{2,9,12,14},{2,9,12,14,15},{2,9,12,15},{2,9,13},{2,9,13,14},{2,9,13,14,15},{2,9,13,15},{2,9,14},{2,9,14,15},{2,9,15},{2,10},{2,10,11},{2,10,11,12},{2,10,11,12,13},{2,10,11,12,13,14},{2,10,11,12,13,14,15},{2,10,11,12,13,15},{2,10,11,12,14},{2,10,11,12,14,15},{2,10,11,12,15},{2,10,11,13},{2,10,11,13,14},{2,10,11,13,14,15},{2,10,11,13,15},{2,10,11,14},{2,10,11,14,15},{2,10,11,15},{2,10,12},{2,10,12,13},{2,10,12,13,14},{2,10,12,13,14,15},{2,10,12,13,15},{2,10,12,14},{2,10,12,14,15},{2,10,12,15},{2,10,13},{2,10,13,14},{2,10,13,14,15},{2,10,13,15},{2,10,14},{2,10,14,15},{2,10,15},{2,11},{2,11,12},{2,11,12,13},{2,11,12,13,14},{2,11,12,13,14,15},{2,11,12,13,15},{2,11,12,14},{2,11,12,14,15},{2,11,12,15},{2,11,13},{2,11,13,14},{2,11,13,14,15},{2,11,13,15},{2,11,14},{2,11,14,15},{2,11,15},{2,12},{2,12,13},{2,12,13,14},{2,12,13,14,15},{2,12,13,15},{2,12,14},{2,12,14,15},{2,12,15},{2,13},{2,13,14},{2,13,14,15},{2,13,15},{2,14},{2,14,15},{2,15},{3,4},{3,4,5},{3,4,5,6},{3,4,5,6,7},{3,4,5,6,7,8},{3,4,5,6,7,8,9},{3,4,5,6,7,8,9,10},{3,4,5,6,7,8,9,10,11},{3,4,5,6,7,8,9,10,11,12},{3,4,5,6,7,8,9,10,11,12,13},{3,4,5,6,7,8,9,10,11,12,13,14},{3,4,5,6,7,8,9,10,11,12,13,14,15},{3,4,5,6,7,8,9,10,11,12,13,15},{3,4,5,6,7,8,9,10,11,12,14},{3,4,5,6,7,8,9,10,11,12,14,15},{3,4,5,6,7,8,9,10,11,12,15},{3,4,5,6,7,8,9,10,11,13},{3,4,5,6,7,8,9,10,11,13,14},{3,4,5,6,7,8,9,10,11,13,14,15},{3,4,5,6,7,8,9,10,11,13,15},{3,4,5,6,7,8,9,10,11,14},{3,4,5,6,7,8,9,10,11,14,15},{3,4,5,6,7,8,9,10,11,15},{3,4,5,6,7,8,9,10,12},{3,4,5,6,7,8,9,10,12,13},{3,4,5,6,7,8,9,10,12,13,14},{3,4,5,6,7,8,9,10,12,13,14,15},{3,4,5,6,7,8,9,10,12,13,15},{3,4,5,6,7,8,9,10,12,14},{3,4,5,6,7,8,9,10,12,14,15},{3,4,5,6,7,8,9,10,12,15},{3,4,5,6,7,8,9,10,13},{3,4,5,6,7,8,9,10,13,14},{3,4,5,6,7,8,9,10,13,14,15},{3,4,5,6,7,8,9,10,13,15},{3,4,5,6,7,8,9,10,14},{3,4,5,6,7,8,9,10,14,15},{3,4,5,6,7,8,9,10,15},{3,4,5,6,7,8,9,11},{3,4,5,6,7,8,9,11,12},{3,4,5,6,7,8,9,11,12,13},{3,4,5,6,7,8,9,11,12,13,14},{3,4,5,6,7,8,9,11,12,13,14,15},{3,4,5,6,7,8,9,11,12,13,15},{3,4,5,6,7,8,9,11,12,14},{3,4,5,6,7,8,9,11,12,14,15},{3,4,5,6,7,8,9,11,12,15},{3,4,5,6,7,8,9,11,13},{3,4,5,6,7,8,9,11,13,14},{3,4,5,6,7,8,9,11,13,14,15},{3,4,5,6,7,8,9,11,13,15},{3,4,5,6,7,8,9,11,14},{3,4,5,6,7,8,9,11,14,15},{3,4,5,6,7,8,9,11,15},{3,4,5,6,7,8,9,12},{3,4,5,6,7,8,9,12,13},{3,4,5,6,7,8,9,12,13,14},{3,4,5,6,7,8,9,12,13,14,15},{3,4,5,6,7,8,9,12,13,15},{3,4,5,6,7,8,9,12,14},{3,4,5,6,7,8,9,12,14,15},{3,4,5,6,7,8,9,12,15},{3,4,5,6,7,8,9,13},{3,4,5,6,7,8,9,13,14},{3,4,5,6,7,8,9,13,14,15},{3,4,5,6,7,8,9,13,15},{3,4,5,6,7,8,9,14},{3,4,5,6,7,8,9,14,15},{3,4,5,6,7,8,9,15},{3,4,5,6,7,8,10},{3,4,5,6,7,8,10,11},{3,4,5,6,7,8,10,11,12},{3,4,5,6,7,8,10,11,12,13},{3,4,5,6,7,8,10,11,12,13,14},{3,4,5,6,7,8,10,11,12,13,14,15},{3,4,5,6,7,8,10,11,12,13,15},{3,4,5,6,7,8,10,11,12,14},{3,4,5,6,7,8,10,11,12,14,15},{3,4,5,6,7,8,10,11,12,15},{3,4,5,6,7,8,10,11,13},{3,4,5,6,7,8,10,11,13,14},{3,4,5,6,7,8,10,11,13,14,15},{3,4,5,6,7,8,10,11,13,15},{3,4,5,6,7,8,10,11,14},{3,4,5,6,7,8,10,11,14,15},{3,4,5,6,7,8,10,11,15},{3,4,5,6,7,8,10,12},{3,4,5,6,7,8,10,12,13},{3,4,5,6,7,8,10,12,13,14},{3,4,5,6,7,8,10,12,13,14,15},{3,4,5,6,7,8,10,12,13,15},{3,4,5,6,7,8,10,12,14},{3,4,5,6,7,8,10,12,14,15},{3,4,5,6,7,8,10,12,15},{3,4,5,6,7,8,10,13},{3,4,5,6,7,8,10,13,14},{3,4,5,6,7,8,10,13,14,15},{3,4,5,6,7,8,10,13,15},{3,4,5,6,7,8,10,14},{3,4,5,6,7,8,10,14,15},{3,4,5,6,7,8,10,15},{3,4,5,6,7,8,11},{3,4,5,6,7,8,11,12},{3,4,5,6,7,8,11,12,13},{3,4,5,6,7,8,11,12,13,14},{3,4,5,6,7,8,11,12,13,14,15},{3,4,5,6,7,8,11,12,13,15},{3,4,5,6,7,8,11,12,14},{3,4,5,6,7,8,11,12,14,15},{3,4,5,6,7,8,11,12,15},{3,4,5,6,7,8,11,13},{3,4,5,6,7,8,11,13,14},{3,4,5,6,7,8,11,13,14,15},{3,4,5,6,7,8,11,13,15},{3,4,5,6,7,8,11,14},{3,4,5,6,7,8,11,14,15},{3,4,5,6,7,8,11,15},{3,4,5,6,7,8,12},{3,4,5,6,7,8,12,13},{3,4,5,6,7,8,12,13,14},{3,4,5,6,7,8,12,13,14,15},{3,4,5,6,7,8,12,13,15},{3,4,5,6,7,8,12,14},{3,4,5,6,7,8,12,14,15},{3,4,5,6,7,8,12,15},{3,4,5,6,7,8,13},{3,4,5,6,7,8,13,14},{3,4,5,6,7,8,13,14,15},{3,4,5,6,7,8,13,15},{3,4,5,6,7,8,14},{3,4,5,6,7,8,14,15},{3,4,5,6,7,8,15},{3,4,5,6,7,9},{3,4,5,6,7,9,10},{3,4,5,6,7,9,10,11},{3,4,5,6,7,9,10,11,12},{3,4,5,6,7,9,10,11,12,13},{3,4,5,6,7,9,10,11,12,13,14},{3,4,5,6,7,9,10,11,12,13,14,15},{3,4,5,6,7,9,10,11,12,13,15},{3,4,5,6,7,9,10,11,12,14},{3,4,5,6,7,9,10,11,12,14,15},{3,4,5,6,7,9,10,11,12,15},{3,4,5,6,7,9,10,11,13},{3,4,5,6,7,9,10,11,13,14},{3,4,5,6,7,9,10,11,13,14,15},{3,4,5,6,7,9,10,11,13,15},{3,4,5,6,7,9,10,11,14},{3,4,5,6,7,9,10,11,14,15},{3,4,5,6,7,9,10,11,15},{3,4,5,6,7,9,10,12},{3,4,5,6,7,9,10,12,13},{3,4,5,6,7,9,10,12,13,14},{3,4,5,6,7,9,10,12,13,14,15},{3,4,5,6,7,9,10,12,13,15},{3,4,5,6,7,9,10,12,14},{3,4,5,6,7,9,10,12,14,15},{3,4,5,6,7,9,10,12,15},{3,4,5,6,7,9,10,13},{3,4,5,6,7,9,10,13,14},{3,4,5,6,7,9,10,13,14,15},{3,4,5,6,7,9,10,13,15},{3,4,5,6,7,9,10,14},{3,4,5,6,7,9,10,14,15},{3,4,5,6,7,9,10,15},{3,4,5,6,7,9,11},{3,4,5,6,7,9,11,12},{3,4,5,6,7,9,11,12,13},{3,4,5,6,7,9,11,12,13,14},{3,4,5,6,7,9,11,12,13,14,15},{3,4,5,6,7,9,11,12,13,15},{3,4,5,6,7,9,11,12,14},{3,4,5,6,7,9,11,12,14,15},{3,4,5,6,7,9,11,12,15},{3,4,5,6,7,9,11,13},{3,4,5,6,7,9,11,13,14},{3,4,5,6,7,9,11,13,14,15},{3,4,5,6,7,9,11,13,15},{3,4,5,6,7,9,11,14},{3,4,5,6,7,9,11,14,15},{3,4,5,6,7,9,11,15},{3,4,5,6,7,9,12},{3,4,5,6,7,9,12,13},{3,4,5,6,7,9,12,13,14},{3,4,5,6,7,9,12,13,14,15},{3,4,5,6,7,9,12,13,15},{3,4,5,6,7,9,12,14},{3,4,5,6,7,9,12,14,15},{3,4,5,6,7,9,12,15},{3,4,5,6,7,9,13},{3,4,5,6,7,9,13,14},{3,4,5,6,7,9,13,14,15},{3,4,5,6,7,9,13,15},{3,4,5,6,7,9,14},{3,4,5,6,7,9,14,15},{3,4,5,6,7,9,15},{3,4,5,6,7,10},{3,4,5,6,7,10,11},{3,4,5,6,7,10,11,12},{3,4,5,6,7,10,11,12,13},{3,4,5,6,7,10,11,12,13,14},{3,4,5,6,7,10,11,12,13,14,15},{3,4,5,6,7,10,11,12,13,15},{3,4,5,6,7,10,11,12,14},{3,4,5,6,7,10,11,12,14,15},{3,4,5,6,7,10,11,12,15},{3,4,5,6,7,10,11,13},{3,4,5,6,7,10,11,13,14},{3,4,5,6,7,10,11,13,14,15},{3,4,5,6,7,10,11,13,15},{3,4,5,6,7,10,11,14},{3,4,5,6,7,10,11,14,15},{3,4,5,6,7,10,11,15},{3,4,5,6,7,10,12},{3,4,5,6,7,10,12,13},{3,4,5,6,7,10,12,13,14},{3,4,5,6,7,10,12,13,14,15},{3,4,5,6,7,10,12,13,15},{3,4,5,6,7,10,12,14},{3,4,5,6,7,10,12,14,15},{3,4,5,6,7,10,12,15},{3,4,5,6,7,10,13},{3,4,5,6,7,10,13,14},{3,4,5,6,7,10,13,14,15},{3,4,5,6,7,10,13,15},{3,4,5,6,7,10,14},{3,4,5,6,7,10,14,15},{3,4,5,6,7,10,15},{3,4,5,6,7,11},{3,4,5,6,7,11,12},{3,4,5,6,7,11,12,13},{3,4,5,6,7,11,12,13,14},{3,4,5,6,7,11,12,13,14,15},{3,4,5,6,7,11,12,13,15},{3,4,5,6,7,11,12,14},{3,4,5,6,7,11,12,14,15},{3,4,5,6,7,11,12,15},{3,4,5,6,7,11,13},{3,4,5,6,7,11,13,14},{3,4,5,6,7,11,13,14,15},{3,4,5,6,7,11,13,15},{3,4,5,6,7,11,14},{3,4,5,6,7,11,14,15},{3,4,5,6,7,11,15},{3,4,5,6,7,12},{3,4,5,6,7,12,13},{3,4,5,6,7,12,13,14},{3,4,5,6,7,12,13,14,15},{3,4,5,6,7,12,13,15},{3,4,5,6,7,12,14},{3,4,5,6,7,12,14,15},{3,4,5,6,7,12,15},{3,4,5,6,7,13},{3,4,5,6,7,13,14},{3,4,5,6,7,13,14,15},{3,4,5,6,7,13,15},{3,4,5,6,7,14},{3,4,5,6,7,14,15},{3,4,5,6,7,15},{3,4,5,6,8},{3,4,5,6,8,9},{3,4,5,6,8,9,10},{3,4,5,6,8,9,10,11},{3,4,5,6,8,9,10,11,12},{3,4,5,6,8,9,10,11,12,13},{3,4,5,6,8,9,10,11,12,13,14},{3,4,5,6,8,9,10,11,12,13,14,15},{3,4,5,6,8,9,10,11,12,13,15},{3,4,5,6,8,9,10,11,12,14},{3,4,5,6,8,9,10,11,12,14,15},{3,4,5,6,8,9,10,11,12,15},{3,4,5,6,8,9,10,11,13},{3,4,5,6,8,9,10,11,13,14},{3,4,5,6,8,9,10,11,13,14,15},{3,4,5,6,8,9,10,11,13,15},{3,4,5,6,8,9,10,11,14},{3,4,5,6,8,9,10,11,14,15},{3,4,5,6,8,9,10,11,15},{3,4,5,6,8,9,10,12},{3,4,5,6,8,9,10,12,13},{3,4,5,6,8,9,10,12,13,14},{3,4,5,6,8,9,10,12,13,14,15},{3,4,5,6,8,9,10,12,13,15},{3,4,5,6,8,9,10,12,14},{3,4,5,6,8,9,10,12,14,15},{3,4,5,6,8,9,10,12,15},{3,4,5,6,8,9,10,13},{3,4,5,6,8,9,10,13,14},{3,4,5,6,8,9,10,13,14,15},{3,4,5,6,8,9,10,13,15},{3,4,5,6,8,9,10,14},{3,4,5,6,8,9,10,14,15},{3,4,5,6,8,9,10,15},{3,4,5,6,8,9,11},{3,4,5,6,8,9,11,12},{3,4,5,6,8,9,11,12,13},{3,4,5,6,8,9,11,12,13,14},{3,4,5,6,8,9,11,12,13,14,15},{3,4,5,6,8,9,11,12,13,15},{3,4,5,6,8,9,11,12,14},{3,4,5,6,8,9,11,12,14,15},{3,4,5,6,8,9,11,12,15},{3,4,5,6,8,9,11,13},{3,4,5,6,8,9,11,13,14},{3,4,5,6,8,9,11,13,14,15},{3,4,5,6,8,9,11,13,15},{3,4,5,6,8,9,11,14},{3,4,5,6,8,9,11,14,15},{3,4,5,6,8,9,11,15},{3,4,5,6,8,9,12},{3,4,5,6,8,9,12,13},{3,4,5,6,8,9,12,13,14},{3,4,5,6,8,9,12,13,14,15},{3,4,5,6,8,9,12,13,15},{3,4,5,6,8,9,12,14},{3,4,5,6,8,9,12,14,15},{3,4,5,6,8,9,12,15},{3,4,5,6,8,9,13},{3,4,5,6,8,9,13,14},{3,4,5,6,8,9,13,14,15},{3,4,5,6,8,9,13,15},{3,4,5,6,8,9,14},{3,4,5,6,8,9,14,15},{3,4,5,6,8,9,15},{3,4,5,6,8,10},{3,4,5,6,8,10,11},{3,4,5,6,8,10,11,12},{3,4,5,6,8,10,11,12,13},{3,4,5,6,8,10,11,12,13,14},{3,4,5,6,8,10,11,12,13,14,15},{3,4,5,6,8,10,11,12,13,15},{3,4,5,6,8,10,11,12,14},{3,4,5,6,8,10,11,12,14,15},{3,4,5,6,8,10,11,12,15},{3,4,5,6,8,10,11,13},{3,4,5,6,8,10,11,13,14},{3,4,5,6,8,10,11,13,14,15},{3,4,5,6,8,10,11,13,15},{3,4,5,6,8,10,11,14},{3,4,5,6,8,10,11,14,15},{3,4,5,6,8,10,11,15},{3,4,5,6,8,10,12},{3,4,5,6,8,10,12,13},{3,4,5,6,8,10,12,13,14},{3,4,5,6,8,10,12,13,14,15},{3,4,5,6,8,10,12,13,15},{3,4,5,6,8,10,12,14},{3,4,5,6,8,10,12,14,15},{3,4,5,6,8,10,12,15},{3,4,5,6,8,10,13},{3,4,5,6,8,10,13,14},{3,4,5,6,8,10,13,14,15},{3,4,5,6,8,10,13,15},{3,4,5,6,8,10,14},{3,4,5,6,8,10,14,15},{3,4,5,6,8,10,15},{3,4,5,6,8,11},{3,4,5,6,8,11,12},{3,4,5,6,8,11,12,13},{3,4,5,6,8,11,12,13,14},{3,4,5,6,8,11,12,13,14,15},{3,4,5,6,8,11,12,13,15},{3,4,5,6,8,11,12,14},{3,4,5,6,8,11,12,14,15},{3,4,5,6,8,11,12,15},{3,4,5,6,8,11,13},{3,4,5,6,8,11,13,14},{3,4,5,6,8,11,13,14,15},{3,4,5,6,8,11,13,15},{3,4,5,6,8,11,14},{3,4,5,6,8,11,14,15},{3,4,5,6,8,11,15},{3,4,5,6,8,12},{3,4,5,6,8,12,13},{3,4,5,6,8,12,13,14},{3,4,5,6,8,12,13,14,15},{3,4,5,6,8,12,13,15},{3,4,5,6,8,12,14},{3,4,5,6,8,12,14,15},{3,4,5,6,8,12,15},{3,4,5,6,8,13},{3,4,5,6,8,13,14},{3,4,5,6,8,13,14,15},{3,4,5,6,8,13,15},{3,4,5,6,8,14},{3,4,5,6,8,14,15},{3,4,5,6,8,15},{3,4,5,6,9},{3,4,5,6,9,10},{3,4,5,6,9,10,11},{3,4,5,6,9,10,11,12},{3,4,5,6,9,10,11,12,13},{3,4,5,6,9,10,11,12,13,14},{3,4,5,6,9,10,11,12,13,14,15},{3,4,5,6,9,10,11,12,13,15},{3,4,5,6,9,10,11,12,14},{3,4,5,6,9,10,11,12,14,15},{3,4,5,6,9,10,11,12,15},{3,4,5,6,9,10,11,13},{3,4,5,6,9,10,11,13,14},{3,4,5,6,9,10,11,13,14,15},{3,4,5,6,9,10,11,13,15},{3,4,5,6,9,10,11,14},{3,4,5,6,9,10,11,14,15},{3,4,5,6,9,10,11,15},{3,4,5,6,9,10,12},{3,4,5,6,9,10,12,13},{3,4,5,6,9,10,12,13,14},{3,4,5,6,9,10,12,13,14,15},{3,4,5,6,9,10,12,13,15},{3,4,5,6,9,10,12,14},{3,4,5,6,9,10,12,14,15},{3,4,5,6,9,10,12,15},{3,4,5,6,9,10,13},{3,4,5,6,9,10,13,14},{3,4,5,6,9,10,13,14,15},{3,4,5,6,9,10,13,15},{3,4,5,6,9,10,14},{3,4,5,6,9,10,14,15},{3,4,5,6,9,10,15},{3,4,5,6,9,11},{3,4,5,6,9,11,12},{3,4,5,6,9,11,12,13},{3,4,5,6,9,11,12,13,14},{3,4,5,6,9,11,12,13,14,15},{3,4,5,6,9,11,12,13,15},{3,4,5,6,9,11,12,14},{3,4,5,6,9,11,12,14,15},{3,4,5,6,9,11,12,15},{3,4,5,6,9,11,13},{3,4,5,6,9,11,13,14},{3,4,5,6,9,11,13,14,15},{3,4,5,6,9,11,13,15},{3,4,5,6,9,11,14},{3,4,5,6,9,11,14,15},{3,4,5,6,9,11,15},{3,4,5,6,9,12},{3,4,5,6,9,12,13},{3,4,5,6,9,12,13,14},{3,4,5,6,9,12,13,14,15},{3,4,5,6,9,12,13,15},{3,4,5,6,9,12,14},{3,4,5,6,9,12,14,15},{3,4,5,6,9,12,15},{3,4,5,6,9,13},{3,4,5,6,9,13,14},{3,4,5,6,9,13,14,15},{3,4,5,6,9,13,15},{3,4,5,6,9,14},{3,4,5,6,9,14,15},{3,4,5,6,9,15},{3,4,5,6,10},{3,4,5,6,10,11},{3,4,5,6,10,11,12},{3,4,5,6,10,11,12,13},{3,4,5,6,10,11,12,13,14},{3,4,5,6,10,11,12,13,14,15},{3,4,5,6,10,11,12,13,15},{3,4,5,6,10,11,12,14},{3,4,5,6,10,11,12,14,15},{3,4,5,6,10,11,12,15},{3,4,5,6,10,11,13},{3,4,5,6,10,11,13,14},{3,4,5,6,10,11,13,14,15},{3,4,5,6,10,11,13,15},{3,4,5,6,10,11,14},{3,4,5,6,10,11,14,15},{3,4,5,6,10,11,15},{3,4,5,6,10,12},{3,4,5,6,10,12,13},{3,4,5,6,10,12,13,14},{3,4,5,6,10,12,13,14,15},{3,4,5,6,10,12,13,15},{3,4,5,6,10,12,14},{3,4,5,6,10,12,14,15},{3,4,5,6,10,12,15},{3,4,5,6,10,13},{3,4,5,6,10,13,14},{3,4,5,6,10,13,14,15},{3,4,5,6,10,13,15},{3,4,5,6,10,14},{3,4,5,6,10,14,15},{3,4,5,6,10,15},{3,4,5,6,11},{3,4,5,6,11,12},{3,4,5,6,11,12,13},{3,4,5,6,11,12,13,14},{3,4,5,6,11,12,13,14,15},{3,4,5,6,11,12,13,15},{3,4,5,6,11,12,14},{3,4,5,6,11,12,14,15},{3,4,5,6,11,12,15},{3,4,5,6,11,13},{3,4,5,6,11,13,14},{3,4,5,6,11,13,14,15},{3,4,5,6,11,13,15},{3,4,5,6,11,14},{3,4,5,6,11,14,15},{3,4,5,6,11,15},{3,4,5,6,12},{3,4,5,6,12,13},{3,4,5,6,12,13,14},{3,4,5,6,12,13,14,15},{3,4,5,6,12,13,15},{3,4,5,6,12,14},{3,4,5,6,12,14,15},{3,4,5,6,12,15},{3,4,5,6,13},{3,4,5,6,13,14},{3,4,5,6,13,14,15},{3,4,5,6,13,15},{3,4,5,6,14},{3,4,5,6,14,15},{3,4,5,6,15},{3,4,5,7},{3,4,5,7,8},{3,4,5,7,8,9},{3,4,5,7,8,9,10},{3,4,5,7,8,9,10,11},{3,4,5,7,8,9,10,11,12},{3,4,5,7,8,9,10,11,12,13},{3,4,5,7,8,9,10,11,12,13,14},{3,4,5,7,8,9,10,11,12,13,14,15},{3,4,5,7,8,9,10,11,12,13,15},{3,4,5,7,8,9,10,11,12,14},{3,4,5,7,8,9,10,11,12,14,15},{3,4,5,7,8,9,10,11,12,15},{3,4,5,7,8,9,10,11,13},{3,4,5,7,8,9,10,11,13,14},{3,4,5,7,8,9,10,11,13,14,15},{3,4,5,7,8,9,10,11,13,15},{3,4,5,7,8,9,10,11,14},{3,4,5,7,8,9,10,11,14,15},{3,4,5,7,8,9,10,11,15},{3,4,5,7,8,9,10,12},{3,4,5,7,8,9,10,12,13},{3,4,5,7,8,9,10,12,13,14},{3,4,5,7,8,9,10,12,13,14,15},{3,4,5,7,8,9,10,12,13,15},{3,4,5,7,8,9,10,12,14},{3,4,5,7,8,9,10,12,14,15},{3,4,5,7,8,9,10,12,15},{3,4,5,7,8,9,10,13},{3,4,5,7,8,9,10,13,14},{3,4,5,7,8,9,10,13,14,15},{3,4,5,7,8,9,10,13,15},{3,4,5,7,8,9,10,14},{3,4,5,7,8,9,10,14,15},{3,4,5,7,8,9,10,15},{3,4,5,7,8,9,11},{3,4,5,7,8,9,11,12},{3,4,5,7,8,9,11,12,13},{3,4,5,7,8,9,11,12,13,14},{3,4,5,7,8,9,11,12,13,14,15},{3,4,5,7,8,9,11,12,13,15},{3,4,5,7,8,9,11,12,14},{3,4,5,7,8,9,11,12,14,15},{3,4,5,7,8,9,11,12,15},{3,4,5,7,8,9,11,13},{3,4,5,7,8,9,11,13,14},{3,4,5,7,8,9,11,13,14,15},{3,4,5,7,8,9,11,13,15},{3,4,5,7,8,9,11,14},{3,4,5,7,8,9,11,14,15},{3,4,5,7,8,9,11,15},{3,4,5,7,8,9,12},{3,4,5,7,8,9,12,13},{3,4,5,7,8,9,12,13,14},{3,4,5,7,8,9,12,13,14,15},{3,4,5,7,8,9,12,13,15},{3,4,5,7,8,9,12,14},{3,4,5,7,8,9,12,14,15},{3,4,5,7,8,9,12,15},{3,4,5,7,8,9,13},{3,4,5,7,8,9,13,14},{3,4,5,7,8,9,13,14,15},{3,4,5,7,8,9,13,15},{3,4,5,7,8,9,14},{3,4,5,7,8,9,14,15},{3,4,5,7,8,9,15},{3,4,5,7,8,10},{3,4,5,7,8,10,11},{3,4,5,7,8,10,11,12},{3,4,5,7,8,10,11,12,13},{3,4,5,7,8,10,11,12,13,14},{3,4,5,7,8,10,11,12,13,14,15},{3,4,5,7,8,10,11,12,13,15},{3,4,5,7,8,10,11,12,14},{3,4,5,7,8,10,11,12,14,15},{3,4,5,7,8,10,11,12,15},{3,4,5,7,8,10,11,13},{3,4,5,7,8,10,11,13,14},{3,4,5,7,8,10,11,13,14,15},{3,4,5,7,8,10,11,13,15},{3,4,5,7,8,10,11,14},{3,4,5,7,8,10,11,14,15},{3,4,5,7,8,10,11,15},{3,4,5,7,8,10,12},{3,4,5,7,8,10,12,13},{3,4,5,7,8,10,12,13,14},{3,4,5,7,8,10,12,13,14,15},{3,4,5,7,8,10,12,13,15},{3,4,5,7,8,10,12,14},{3,4,5,7,8,10,12,14,15},{3,4,5,7,8,10,12,15},{3,4,5,7,8,10,13},{3,4,5,7,8,10,13,14},{3,4,5,7,8,10,13,14,15},{3,4,5,7,8,10,13,15},{3,4,5,7,8,10,14},{3,4,5,7,8,10,14,15},{3,4,5,7,8,10,15},{3,4,5,7,8,11},{3,4,5,7,8,11,12},{3,4,5,7,8,11,12,13},{3,4,5,7,8,11,12,13,14},{3,4,5,7,8,11,12,13,14,15},{3,4,5,7,8,11,12,13,15},{3,4,5,7,8,11,12,14},{3,4,5,7,8,11,12,14,15},{3,4,5,7,8,11,12,15},{3,4,5,7,8,11,13},{3,4,5,7,8,11,13,14},{3,4,5,7,8,11,13,14,15},{3,4,5,7,8,11,13,15},{3,4,5,7,8,11,14},{3,4,5,7,8,11,14,15},{3,4,5,7,8,11,15},{3,4,5,7,8,12},{3,4,5,7,8,12,13},{3,4,5,7,8,12,13,14},{3,4,5,7,8,12,13,14,15},{3,4,5,7,8,12,13,15},{3,4,5,7,8,12,14},{3,4,5,7,8,12,14,15},{3,4,5,7,8,12,15},{3,4,5,7,8,13},{3,4,5,7,8,13,14},{3,4,5,7,8,13,14,15},{3,4,5,7,8,13,15},{3,4,5,7,8,14},{3,4,5,7,8,14,15},{3,4,5,7,8,15},{3,4,5,7,9},{3,4,5,7,9,10},{3,4,5,7,9,10,11},{3,4,5,7,9,10,11,12},{3,4,5,7,9,10,11,12,13},{3,4,5,7,9,10,11,12,13,14},{3,4,5,7,9,10,11,12,13,14,15},{3,4,5,7,9,10,11,12,13,15},{3,4,5,7,9,10,11,12,14},{3,4,5,7,9,10,11,12,14,15},{3,4,5,7,9,10,11,12,15},{3,4,5,7,9,10,11,13},{3,4,5,7,9,10,11,13,14},{3,4,5,7,9,10,11,13,14,15},{3,4,5,7,9,10,11,13,15},{3,4,5,7,9,10,11,14},{3,4,5,7,9,10,11,14,15},{3,4,5,7,9,10,11,15},{3,4,5,7,9,10,12},{3,4,5,7,9,10,12,13},{3,4,5,7,9,10,12,13,14},{3,4,5,7,9,10,12,13,14,15},{3,4,5,7,9,10,12,13,15},{3,4,5,7,9,10,12,14},{3,4,5,7,9,10,12,14,15},{3,4,5,7,9,10,12,15},{3,4,5,7,9,10,13},{3,4,5,7,9,10,13,14},{3,4,5,7,9,10,13,14,15},{3,4,5,7,9,10,13,15},{3,4,5,7,9,10,14},{3,4,5,7,9,10,14,15},{3,4,5,7,9,10,15},{3,4,5,7,9,11},{3,4,5,7,9,11,12},{3,4,5,7,9,11,12,13},{3,4,5,7,9,11,12,13,14},{3,4,5,7,9,11,12,13,14,15},{3,4,5,7,9,11,12,13,15},{3,4,5,7,9,11,12,14},{3,4,5,7,9,11,12,14,15},{3,4,5,7,9,11,12,15},{3,4,5,7,9,11,13},{3,4,5,7,9,11,13,14},{3,4,5,7,9,11,13,14,15},{3,4,5,7,9,11,13,15},{3,4,5,7,9,11,14},{3,4,5,7,9,11,14,15},{3,4,5,7,9,11,15},{3,4,5,7,9,12},{3,4,5,7,9,12,13},{3,4,5,7,9,12,13,14},{3,4,5,7,9,12,13,14,15},{3,4,5,7,9,12,13,15},{3,4,5,7,9,12,14},{3,4,5,7,9,12,14,15},{3,4,5,7,9,12,15},{3,4,5,7,9,13},{3,4,5,7,9,13,14},{3,4,5,7,9,13,14,15},{3,4,5,7,9,13,15},{3,4,5,7,9,14},{3,4,5,7,9,14,15},{3,4,5,7,9,15},{3,4,5,7,10},{3,4,5,7,10,11},{3,4,5,7,10,11,12},{3,4,5,7,10,11,12,13},{3,4,5,7,10,11,12,13,14},{3,4,5,7,10,11,12,13,14,15},{3,4,5,7,10,11,12,13,15},{3,4,5,7,10,11,12,14},{3,4,5,7,10,11,12,14,15},{3,4,5,7,10,11,12,15},{3,4,5,7,10,11,13},{3,4,5,7,10,11,13,14},{3,4,5,7,10,11,13,14,15},{3,4,5,7,10,11,13,15},{3,4,5,7,10,11,14},{3,4,5,7,10,11,14,15},{3,4,5,7,10,11,15},{3,4,5,7,10,12},{3,4,5,7,10,12,13},{3,4,5,7,10,12,13,14},{3,4,5,7,10,12,13,14,15},{3,4,5,7,10,12,13,15},{3,4,5,7,10,12,14},{3,4,5,7,10,12,14,15},{3,4,5,7,10,12,15},{3,4,5,7,10,13},{3,4,5,7,10,13,14},{3,4,5,7,10,13,14,15},{3,4,5,7,10,13,15},{3,4,5,7,10,14},{3,4,5,7,10,14,15},{3,4,5,7,10,15},{3,4,5,7,11},{3,4,5,7,11,12},{3,4,5,7,11,12,13},{3,4,5,7,11,12,13,14},{3,4,5,7,11,12,13,14,15},{3,4,5,7,11,12,13,15},{3,4,5,7,11,12,14},{3,4,5,7,11,12,14,15},{3,4,5,7,11,12,15},{3,4,5,7,11,13},{3,4,5,7,11,13,14},{3,4,5,7,11,13,14,15},{3,4,5,7,11,13,15},{3,4,5,7,11,14},{3,4,5,7,11,14,15},{3,4,5,7,11,15},{3,4,5,7,12},{3,4,5,7,12,13},{3,4,5,7,12,13,14},{3,4,5,7,12,13,14,15},{3,4,5,7,12,13,15},{3,4,5,7,12,14},{3,4,5,7,12,14,15},{3,4,5,7,12,15},{3,4,5,7,13},{3,4,5,7,13,14},{3,4,5,7,13,14,15},{3,4,5,7,13,15},{3,4,5,7,14},{3,4,5,7,14,15},{3,4,5,7,15},{3,4,5,8},{3,4,5,8,9},{3,4,5,8,9,10},{3,4,5,8,9,10,11},{3,4,5,8,9,10,11,12},{3,4,5,8,9,10,11,12,13},{3,4,5,8,9,10,11,12,13,14},{3,4,5,8,9,10,11,12,13,14,15},{3,4,5,8,9,10,11,12,13,15},{3,4,5,8,9,10,11,12,14},{3,4,5,8,9,10,11,12,14,15},{3,4,5,8,9,10,11,12,15},{3,4,5,8,9,10,11,13},{3,4,5,8,9,10,11,13,14},{3,4,5,8,9,10,11,13,14,15},{3,4,5,8,9,10,11,13,15},{3,4,5,8,9,10,11,14},{3,4,5,8,9,10,11,14,15},{3,4,5,8,9,10,11,15},{3,4,5,8,9,10,12},{3,4,5,8,9,10,12,13},{3,4,5,8,9,10,12,13,14},{3,4,5,8,9,10,12,13,14,15},{3,4,5,8,9,10,12,13,15},{3,4,5,8,9,10,12,14},{3,4,5,8,9,10,12,14,15},{3,4,5,8,9,10,12,15},{3,4,5,8,9,10,13},{3,4,5,8,9,10,13,14},{3,4,5,8,9,10,13,14,15},{3,4,5,8,9,10,13,15},{3,4,5,8,9,10,14},{3,4,5,8,9,10,14,15},{3,4,5,8,9,10,15},{3,4,5,8,9,11},{3,4,5,8,9,11,12},{3,4,5,8,9,11,12,13},{3,4,5,8,9,11,12,13,14},{3,4,5,8,9,11,12,13,14,15},{3,4,5,8,9,11,12,13,15},{3,4,5,8,9,11,12,14},{3,4,5,8,9,11,12,14,15},{3,4,5,8,9,11,12,15},{3,4,5,8,9,11,13},{3,4,5,8,9,11,13,14},{3,4,5,8,9,11,13,14,15},{3,4,5,8,9,11,13,15},{3,4,5,8,9,11,14},{3,4,5,8,9,11,14,15},{3,4,5,8,9,11,15},{3,4,5,8,9,12},{3,4,5,8,9,12,13},{3,4,5,8,9,12,13,14},{3,4,5,8,9,12,13,14,15},{3,4,5,8,9,12,13,15},{3,4,5,8,9,12,14},{3,4,5,8,9,12,14,15},{3,4,5,8,9,12,15},{3,4,5,8,9,13},{3,4,5,8,9,13,14},{3,4,5,8,9,13,14,15},{3,4,5,8,9,13,15},{3,4,5,8,9,14},{3,4,5,8,9,14,15},{3,4,5,8,9,15},{3,4,5,8,10},{3,4,5,8,10,11},{3,4,5,8,10,11,12},{3,4,5,8,10,11,12,13},{3,4,5,8,10,11,12,13,14},{3,4,5,8,10,11,12,13,14,15},{3,4,5,8,10,11,12,13,15},{3,4,5,8,10,11,12,14},{3,4,5,8,10,11,12,14,15},{3,4,5,8,10,11,12,15},{3,4,5,8,10,11,13},{3,4,5,8,10,11,13,14},{3,4,5,8,10,11,13,14,15},{3,4,5,8,10,11,13,15},{3,4,5,8,10,11,14},{3,4,5,8,10,11,14,15},{3,4,5,8,10,11,15},{3,4,5,8,10,12},{3,4,5,8,10,12,13},{3,4,5,8,10,12,13,14},{3,4,5,8,10,12,13,14,15},{3,4,5,8,10,12,13,15},{3,4,5,8,10,12,14},{3,4,5,8,10,12,14,15},{3,4,5,8,10,12,15},{3,4,5,8,10,13},{3,4,5,8,10,13,14},{3,4,5,8,10,13,14,15},{3,4,5,8,10,13,15},{3,4,5,8,10,14},{3,4,5,8,10,14,15},{3,4,5,8,10,15},{3,4,5,8,11},{3,4,5,8,11,12},{3,4,5,8,11,12,13},{3,4,5,8,11,12,13,14},{3,4,5,8,11,12,13,14,15},{3,4,5,8,11,12,13,15},{3,4,5,8,11,12,14},{3,4,5,8,11,12,14,15},{3,4,5,8,11,12,15},{3,4,5,8,11,13},{3,4,5,8,11,13,14},{3,4,5,8,11,13,14,15},{3,4,5,8,11,13,15},{3,4,5,8,11,14},{3,4,5,8,11,14,15},{3,4,5,8,11,15},{3,4,5,8,12},{3,4,5,8,12,13},{3,4,5,8,12,13,14},{3,4,5,8,12,13,14,15},{3,4,5,8,12,13,15},{3,4,5,8,12,14},{3,4,5,8,12,14,15},{3,4,5,8,12,15},{3,4,5,8,13},{3,4,5,8,13,14},{3,4,5,8,13,14,15},{3,4,5,8,13,15},{3,4,5,8,14},{3,4,5,8,14,15},{3,4,5,8,15},{3,4,5,9},{3,4,5,9,10},{3,4,5,9,10,11},{3,4,5,9,10,11,12},{3,4,5,9,10,11,12,13},{3,4,5,9,10,11,12,13,14},{3,4,5,9,10,11,12,13,14,15},{3,4,5,9,10,11,12,13,15},{3,4,5,9,10,11,12,14},{3,4,5,9,10,11,12,14,15},{3,4,5,9,10,11,12,15},{3,4,5,9,10,11,13},{3,4,5,9,10,11,13,14},{3,4,5,9,10,11,13,14,15},{3,4,5,9,10,11,13,15},{3,4,5,9,10,11,14},{3,4,5,9,10,11,14,15},{3,4,5,9,10,11,15},{3,4,5,9,10,12},{3,4,5,9,10,12,13},{3,4,5,9,10,12,13,14},{3,4,5,9,10,12,13,14,15},{3,4,5,9,10,12,13,15},{3,4,5,9,10,12,14},{3,4,5,9,10,12,14,15},{3,4,5,9,10,12,15},{3,4,5,9,10,13},{3,4,5,9,10,13,14},{3,4,5,9,10,13,14,15},{3,4,5,9,10,13,15},{3,4,5,9,10,14},{3,4,5,9,10,14,15},{3,4,5,9,10,15},{3,4,5,9,11},{3,4,5,9,11,12},{3,4,5,9,11,12,13},{3,4,5,9,11,12,13,14},{3,4,5,9,11,12,13,14,15},{3,4,5,9,11,12,13,15},{3,4,5,9,11,12,14},{3,4,5,9,11,12,14,15},{3,4,5,9,11,12,15},{3,4,5,9,11,13},{3,4,5,9,11,13,14},{3,4,5,9,11,13,14,15},{3,4,5,9,11,13,15},{3,4,5,9,11,14},{3,4,5,9,11,14,15},{3,4,5,9,11,15},{3,4,5,9,12},{3,4,5,9,12,13},{3,4,5,9,12,13,14},{3,4,5,9,12,13,14,15},{3,4,5,9,12,13,15},{3,4,5,9,12,14},{3,4,5,9,12,14,15},{3,4,5,9,12,15},{3,4,5,9,13},{3,4,5,9,13,14},{3,4,5,9,13,14,15},{3,4,5,9,13,15},{3,4,5,9,14},{3,4,5,9,14,15},{3,4,5,9,15},{3,4,5,10},{3,4,5,10,11},{3,4,5,10,11,12},{3,4,5,10,11,12,13},{3,4,5,10,11,12,13,14},{3,4,5,10,11,12,13,14,15},{3,4,5,10,11,12,13,15},{3,4,5,10,11,12,14},{3,4,5,10,11,12,14,15},{3,4,5,10,11,12,15},{3,4,5,10,11,13},{3,4,5,10,11,13,14},{3,4,5,10,11,13,14,15},{3,4,5,10,11,13,15},{3,4,5,10,11,14},{3,4,5,10,11,14,15},{3,4,5,10,11,15},{3,4,5,10,12},{3,4,5,10,12,13},{3,4,5,10,12,13,14},{3,4,5,10,12,13,14,15},{3,4,5,10,12,13,15},{3,4,5,10,12,14},{3,4,5,10,12,14,15},{3,4,5,10,12,15},{3,4,5,10,13},{3,4,5,10,13,14},{3,4,5,10,13,14,15},{3,4,5,10,13,15},{3,4,5,10,14},{3,4,5,10,14,15},{3,4,5,10,15},{3,4,5,11},{3,4,5,11,12},{3,4,5,11,12,13},{3,4,5,11,12,13,14},{3,4,5,11,12,13,14,15},{3,4,5,11,12,13,15},{3,4,5,11,12,14},{3,4,5,11,12,14,15},{3,4,5,11,12,15},{3,4,5,11,13},{3,4,5,11,13,14},{3,4,5,11,13,14,15},{3,4,5,11,13,15},{3,4,5,11,14},{3,4,5,11,14,15},{3,4,5,11,15},{3,4,5,12},{3,4,5,12,13},{3,4,5,12,13,14},{3,4,5,12,13,14,15},{3,4,5,12,13,15},{3,4,5,12,14},{3,4,5,12,14,15},{3,4,5,12,15},{3,4,5,13},{3,4,5,13,14},{3,4,5,13,14,15},{3,4,5,13,15},{3,4,5,14},{3,4,5,14,15},{3,4,5,15},{3,4,6},{3,4,6,7},{3,4,6,7,8},{3,4,6,7,8,9},{3,4,6,7,8,9,10},{3,4,6,7,8,9,10,11},{3,4,6,7,8,9,10,11,12},{3,4,6,7,8,9,10,11,12,13},{3,4,6,7,8,9,10,11,12,13,14},{3,4,6,7,8,9,10,11,12,13,14,15},{3,4,6,7,8,9,10,11,12,13,15},{3,4,6,7,8,9,10,11,12,14},{3,4,6,7,8,9,10,11,12,14,15},{3,4,6,7,8,9,10,11,12,15},{3,4,6,7,8,9,10,11,13},{3,4,6,7,8,9,10,11,13,14},{3,4,6,7,8,9,10,11,13,14,15},{3,4,6,7,8,9,10,11,13,15},{3,4,6,7,8,9,10,11,14},{3,4,6,7,8,9,10,11,14,15},{3,4,6,7,8,9,10,11,15},{3,4,6,7,8,9,10,12},{3,4,6,7,8,9,10,12,13},{3,4,6,7,8,9,10,12,13,14},{3,4,6,7,8,9,10,12,13,14,15},{3,4,6,7,8,9,10,12,13,15},{3,4,6,7,8,9,10,12,14},{3,4,6,7,8,9,10,12,14,15},{3,4,6,7,8,9,10,12,15},{3,4,6,7,8,9,10,13},{3,4,6,7,8,9,10,13,14},{3,4,6,7,8,9,10,13,14,15},{3,4,6,7,8,9,10,13,15},{3,4,6,7,8,9,10,14},{3,4,6,7,8,9,10,14,15},{3,4,6,7,8,9,10,15},{3,4,6,7,8,9,11},{3,4,6,7,8,9,11,12},{3,4,6,7,8,9,11,12,13},{3,4,6,7,8,9,11,12,13,14},{3,4,6,7,8,9,11,12,13,14,15},{3,4,6,7,8,9,11,12,13,15},{3,4,6,7,8,9,11,12,14},{3,4,6,7,8,9,11,12,14,15},{3,4,6,7,8,9,11,12,15},{3,4,6,7,8,9,11,13},{3,4,6,7,8,9,11,13,14},{3,4,6,7,8,9,11,13,14,15},{3,4,6,7,8,9,11,13,15},{3,4,6,7,8,9,11,14},{3,4,6,7,8,9,11,14,15},{3,4,6,7,8,9,11,15},{3,4,6,7,8,9,12},{3,4,6,7,8,9,12,13},{3,4,6,7,8,9,12,13,14},{3,4,6,7,8,9,12,13,14,15},{3,4,6,7,8,9,12,13,15},{3,4,6,7,8,9,12,14},{3,4,6,7,8,9,12,14,15},{3,4,6,7,8,9,12,15},{3,4,6,7,8,9,13},{3,4,6,7,8,9,13,14},{3,4,6,7,8,9,13,14,15},{3,4,6,7,8,9,13,15},{3,4,6,7,8,9,14},{3,4,6,7,8,9,14,15},{3,4,6,7,8,9,15},{3,4,6,7,8,10},{3,4,6,7,8,10,11},{3,4,6,7,8,10,11,12},{3,4,6,7,8,10,11,12,13},{3,4,6,7,8,10,11,12,13,14},{3,4,6,7,8,10,11,12,13,14,15},{3,4,6,7,8,10,11,12,13,15},{3,4,6,7,8,10,11,12,14},{3,4,6,7,8,10,11,12,14,15},{3,4,6,7,8,10,11,12,15},{3,4,6,7,8,10,11,13},{3,4,6,7,8,10,11,13,14},{3,4,6,7,8,10,11,13,14,15},{3,4,6,7,8,10,11,13,15},{3,4,6,7,8,10,11,14},{3,4,6,7,8,10,11,14,15},{3,4,6,7,8,10,11,15},{3,4,6,7,8,10,12},{3,4,6,7,8,10,12,13},{3,4,6,7,8,10,12,13,14},{3,4,6,7,8,10,12,13,14,15},{3,4,6,7,8,10,12,13,15},{3,4,6,7,8,10,12,14},{3,4,6,7,8,10,12,14,15},{3,4,6,7,8,10,12,15},{3,4,6,7,8,10,13},{3,4,6,7,8,10,13,14},{3,4,6,7,8,10,13,14,15},{3,4,6,7,8,10,13,15},{3,4,6,7,8,10,14},{3,4,6,7,8,10,14,15},{3,4,6,7,8,10,15},{3,4,6,7,8,11},{3,4,6,7,8,11,12},{3,4,6,7,8,11,12,13},{3,4,6,7,8,11,12,13,14},{3,4,6,7,8,11,12,13,14,15},{3,4,6,7,8,11,12,13,15},{3,4,6,7,8,11,12,14},{3,4,6,7,8,11,12,14,15},{3,4,6,7,8,11,12,15},{3,4,6,7,8,11,13},{3,4,6,7,8,11,13,14},{3,4,6,7,8,11,13,14,15},{3,4,6,7,8,11,13,15},{3,4,6,7,8,11,14},{3,4,6,7,8,11,14,15},{3,4,6,7,8,11,15},{3,4,6,7,8,12},{3,4,6,7,8,12,13},{3,4,6,7,8,12,13,14},{3,4,6,7,8,12,13,14,15},{3,4,6,7,8,12,13,15},{3,4,6,7,8,12,14},{3,4,6,7,8,12,14,15},{3,4,6,7,8,12,15},{3,4,6,7,8,13},{3,4,6,7,8,13,14},{3,4,6,7,8,13,14,15},{3,4,6,7,8,13,15},{3,4,6,7,8,14},{3,4,6,7,8,14,15},{3,4,6,7,8,15},{3,4,6,7,9},{3,4,6,7,9,10},{3,4,6,7,9,10,11},{3,4,6,7,9,10,11,12},{3,4,6,7,9,10,11,12,13},{3,4,6,7,9,10,11,12,13,14},{3,4,6,7,9,10,11,12,13,14,15},{3,4,6,7,9,10,11,12,13,15},{3,4,6,7,9,10,11,12,14},{3,4,6,7,9,10,11,12,14,15},{3,4,6,7,9,10,11,12,15},{3,4,6,7,9,10,11,13},{3,4,6,7,9,10,11,13,14},{3,4,6,7,9,10,11,13,14,15},{3,4,6,7,9,10,11,13,15},{3,4,6,7,9,10,11,14},{3,4,6,7,9,10,11,14,15},{3,4,6,7,9,10,11,15},{3,4,6,7,9,10,12},{3,4,6,7,9,10,12,13},{3,4,6,7,9,10,12,13,14},{3,4,6,7,9,10,12,13,14,15},{3,4,6,7,9,10,12,13,15},{3,4,6,7,9,10,12,14},{3,4,6,7,9,10,12,14,15},{3,4,6,7,9,10,12,15},{3,4,6,7,9,10,13},{3,4,6,7,9,10,13,14},{3,4,6,7,9,10,13,14,15},{3,4,6,7,9,10,13,15},{3,4,6,7,9,10,14},{3,4,6,7,9,10,14,15},{3,4,6,7,9,10,15},{3,4,6,7,9,11},{3,4,6,7,9,11,12},{3,4,6,7,9,11,12,13},{3,4,6,7,9,11,12,13,14},{3,4,6,7,9,11,12,13,14,15},{3,4,6,7,9,11,12,13,15},{3,4,6,7,9,11,12,14},{3,4,6,7,9,11,12,14,15},{3,4,6,7,9,11,12,15},{3,4,6,7,9,11,13},{3,4,6,7,9,11,13,14},{3,4,6,7,9,11,13,14,15},{3,4,6,7,9,11,13,15},{3,4,6,7,9,11,14},{3,4,6,7,9,11,14,15},{3,4,6,7,9,11,15},{3,4,6,7,9,12},{3,4,6,7,9,12,13},{3,4,6,7,9,12,13,14},{3,4,6,7,9,12,13,14,15},{3,4,6,7,9,12,13,15},{3,4,6,7,9,12,14},{3,4,6,7,9,12,14,15},{3,4,6,7,9,12,15},{3,4,6,7,9,13},{3,4,6,7,9,13,14},{3,4,6,7,9,13,14,15},{3,4,6,7,9,13,15},{3,4,6,7,9,14},{3,4,6,7,9,14,15},{3,4,6,7,9,15},{3,4,6,7,10},{3,4,6,7,10,11},{3,4,6,7,10,11,12},{3,4,6,7,10,11,12,13},{3,4,6,7,10,11,12,13,14},{3,4,6,7,10,11,12,13,14,15},{3,4,6,7,10,11,12,13,15},{3,4,6,7,10,11,12,14},{3,4,6,7,10,11,12,14,15},{3,4,6,7,10,11,12,15},{3,4,6,7,10,11,13},{3,4,6,7,10,11,13,14},{3,4,6,7,10,11,13,14,15},{3,4,6,7,10,11,13,15},{3,4,6,7,10,11,14},{3,4,6,7,10,11,14,15},{3,4,6,7,10,11,15},{3,4,6,7,10,12},{3,4,6,7,10,12,13},{3,4,6,7,10,12,13,14},{3,4,6,7,10,12,13,14,15},{3,4,6,7,10,12,13,15},{3,4,6,7,10,12,14},{3,4,6,7,10,12,14,15},{3,4,6,7,10,12,15},{3,4,6,7,10,13},{3,4,6,7,10,13,14},{3,4,6,7,10,13,14,15},{3,4,6,7,10,13,15},{3,4,6,7,10,14},{3,4,6,7,10,14,15},{3,4,6,7,10,15},{3,4,6,7,11},{3,4,6,7,11,12},{3,4,6,7,11,12,13},{3,4,6,7,11,12,13,14},{3,4,6,7,11,12,13,14,15},{3,4,6,7,11,12,13,15},{3,4,6,7,11,12,14},{3,4,6,7,11,12,14,15},{3,4,6,7,11,12,15},{3,4,6,7,11,13},{3,4,6,7,11,13,14},{3,4,6,7,11,13,14,15},{3,4,6,7,11,13,15},{3,4,6,7,11,14},{3,4,6,7,11,14,15},{3,4,6,7,11,15},{3,4,6,7,12},{3,4,6,7,12,13},{3,4,6,7,12,13,14},{3,4,6,7,12,13,14,15},{3,4,6,7,12,13,15},{3,4,6,7,12,14},{3,4,6,7,12,14,15},{3,4,6,7,12,15},{3,4,6,7,13},{3,4,6,7,13,14},{3,4,6,7,13,14,15},{3,4,6,7,13,15},{3,4,6,7,14},{3,4,6,7,14,15},{3,4,6,7,15},{3,4,6,8},{3,4,6,8,9},{3,4,6,8,9,10},{3,4,6,8,9,10,11},{3,4,6,8,9,10,11,12},{3,4,6,8,9,10,11,12,13},{3,4,6,8,9,10,11,12,13,14},{3,4,6,8,9,10,11,12,13,14,15},{3,4,6,8,9,10,11,12,13,15},{3,4,6,8,9,10,11,12,14},{3,4,6,8,9,10,11,12,14,15},{3,4,6,8,9,10,11,12,15},{3,4,6,8,9,10,11,13},{3,4,6,8,9,10,11,13,14},{3,4,6,8,9,10,11,13,14,15},{3,4,6,8,9,10,11,13,15},{3,4,6,8,9,10,11,14},{3,4,6,8,9,10,11,14,15},{3,4,6,8,9,10,11,15},{3,4,6,8,9,10,12},{3,4,6,8,9,10,12,13},{3,4,6,8,9,10,12,13,14},{3,4,6,8,9,10,12,13,14,15},{3,4,6,8,9,10,12,13,15},{3,4,6,8,9,10,12,14},{3,4,6,8,9,10,12,14,15},{3,4,6,8,9,10,12,15},{3,4,6,8,9,10,13},{3,4,6,8,9,10,13,14},{3,4,6,8,9,10,13,14,15},{3,4,6,8,9,10,13,15},{3,4,6,8,9,10,14},{3,4,6,8,9,10,14,15},{3,4,6,8,9,10,15},{3,4,6,8,9,11},{3,4,6,8,9,11,12},{3,4,6,8,9,11,12,13},{3,4,6,8,9,11,12,13,14},{3,4,6,8,9,11,12,13,14,15},{3,4,6,8,9,11,12,13,15},{3,4,6,8,9,11,12,14},{3,4,6,8,9,11,12,14,15},{3,4,6,8,9,11,12,15},{3,4,6,8,9,11,13},{3,4,6,8,9,11,13,14},{3,4,6,8,9,11,13,14,15},{3,4,6,8,9,11,13,15},{3,4,6,8,9,11,14},{3,4,6,8,9,11,14,15},{3,4,6,8,9,11,15},{3,4,6,8,9,12},{3,4,6,8,9,12,13},{3,4,6,8,9,12,13,14},{3,4,6,8,9,12,13,14,15},{3,4,6,8,9,12,13,15},{3,4,6,8,9,12,14},{3,4,6,8,9,12,14,15},{3,4,6,8,9,12,15},{3,4,6,8,9,13},{3,4,6,8,9,13,14},{3,4,6,8,9,13,14,15},{3,4,6,8,9,13,15},{3,4,6,8,9,14},{3,4,6,8,9,14,15},{3,4,6,8,9,15},{3,4,6,8,10},{3,4,6,8,10,11},{3,4,6,8,10,11,12},{3,4,6,8,10,11,12,13},{3,4,6,8,10,11,12,13,14},{3,4,6,8,10,11,12,13,14,15},{3,4,6,8,10,11,12,13,15},{3,4,6,8,10,11,12,14},{3,4,6,8,10,11,12,14,15},{3,4,6,8,10,11,12,15},{3,4,6,8,10,11,13},{3,4,6,8,10,11,13,14},{3,4,6,8,10,11,13,14,15},{3,4,6,8,10,11,13,15},{3,4,6,8,10,11,14},{3,4,6,8,10,11,14,15},{3,4,6,8,10,11,15},{3,4,6,8,10,12},{3,4,6,8,10,12,13},{3,4,6,8,10,12,13,14},{3,4,6,8,10,12,13,14,15},{3,4,6,8,10,12,13,15},{3,4,6,8,10,12,14},{3,4,6,8,10,12,14,15},{3,4,6,8,10,12,15},{3,4,6,8,10,13},{3,4,6,8,10,13,14},{3,4,6,8,10,13,14,15},{3,4,6,8,10,13,15},{3,4,6,8,10,14},{3,4,6,8,10,14,15},{3,4,6,8,10,15},{3,4,6,8,11},{3,4,6,8,11,12},{3,4,6,8,11,12,13},{3,4,6,8,11,12,13,14},{3,4,6,8,11,12,13,14,15},{3,4,6,8,11,12,13,15},{3,4,6,8,11,12,14},{3,4,6,8,11,12,14,15},{3,4,6,8,11,12,15},{3,4,6,8,11,13},{3,4,6,8,11,13,14},{3,4,6,8,11,13,14,15},{3,4,6,8,11,13,15},{3,4,6,8,11,14},{3,4,6,8,11,14,15},{3,4,6,8,11,15},{3,4,6,8,12},{3,4,6,8,12,13},{3,4,6,8,12,13,14},{3,4,6,8,12,13,14,15},{3,4,6,8,12,13,15},{3,4,6,8,12,14},{3,4,6,8,12,14,15},{3,4,6,8,12,15},{3,4,6,8,13},{3,4,6,8,13,14},{3,4,6,8,13,14,15},{3,4,6,8,13,15},{3,4,6,8,14},{3,4,6,8,14,15},{3,4,6,8,15},{3,4,6,9},{3,4,6,9,10},{3,4,6,9,10,11},{3,4,6,9,10,11,12},{3,4,6,9,10,11,12,13},{3,4,6,9,10,11,12,13,14},{3,4,6,9,10,11,12,13,14,15},{3,4,6,9,10,11,12,13,15},{3,4,6,9,10,11,12,14},{3,4,6,9,10,11,12,14,15},{3,4,6,9,10,11,12,15},{3,4,6,9,10,11,13},{3,4,6,9,10,11,13,14},{3,4,6,9,10,11,13,14,15},{3,4,6,9,10,11,13,15},{3,4,6,9,10,11,14},{3,4,6,9,10,11,14,15},{3,4,6,9,10,11,15},{3,4,6,9,10,12},{3,4,6,9,10,12,13},{3,4,6,9,10,12,13,14},{3,4,6,9,10,12,13,14,15},{3,4,6,9,10,12,13,15},{3,4,6,9,10,12,14},{3,4,6,9,10,12,14,15},{3,4,6,9,10,12,15},{3,4,6,9,10,13},{3,4,6,9,10,13,14},{3,4,6,9,10,13,14,15},{3,4,6,9,10,13,15},{3,4,6,9,10,14},{3,4,6,9,10,14,15},{3,4,6,9,10,15},{3,4,6,9,11},{3,4,6,9,11,12},{3,4,6,9,11,12,13},{3,4,6,9,11,12,13,14},{3,4,6,9,11,12,13,14,15},{3,4,6,9,11,12,13,15},{3,4,6,9,11,12,14},{3,4,6,9,11,12,14,15},{3,4,6,9,11,12,15},{3,4,6,9,11,13},{3,4,6,9,11,13,14},{3,4,6,9,11,13,14,15},{3,4,6,9,11,13,15},{3,4,6,9,11,14},{3,4,6,9,11,14,15},{3,4,6,9,11,15},{3,4,6,9,12},{3,4,6,9,12,13},{3,4,6,9,12,13,14},{3,4,6,9,12,13,14,15},{3,4,6,9,12,13,15},{3,4,6,9,12,14},{3,4,6,9,12,14,15},{3,4,6,9,12,15},{3,4,6,9,13},{3,4,6,9,13,14},{3,4,6,9,13,14,15},{3,4,6,9,13,15},{3,4,6,9,14},{3,4,6,9,14,15},{3,4,6,9,15},{3,4,6,10},{3,4,6,10,11},{3,4,6,10,11,12},{3,4,6,10,11,12,13},{3,4,6,10,11,12,13,14},{3,4,6,10,11,12,13,14,15},{3,4,6,10,11,12,13,15},{3,4,6,10,11,12,14},{3,4,6,10,11,12,14,15},{3,4,6,10,11,12,15},{3,4,6,10,11,13},{3,4,6,10,11,13,14},{3,4,6,10,11,13,14,15},{3,4,6,10,11,13,15},{3,4,6,10,11,14},{3,4,6,10,11,14,15},{3,4,6,10,11,15},{3,4,6,10,12},{3,4,6,10,12,13},{3,4,6,10,12,13,14},{3,4,6,10,12,13,14,15},{3,4,6,10,12,13,15},{3,4,6,10,12,14},{3,4,6,10,12,14,15},{3,4,6,10,12,15},{3,4,6,10,13},{3,4,6,10,13,14},{3,4,6,10,13,14,15},{3,4,6,10,13,15},{3,4,6,10,14},{3,4,6,10,14,15},{3,4,6,10,15},{3,4,6,11},{3,4,6,11,12},{3,4,6,11,12,13},{3,4,6,11,12,13,14},{3,4,6,11,12,13,14,15},{3,4,6,11,12,13,15},{3,4,6,11,12,14},{3,4,6,11,12,14,15},{3,4,6,11,12,15},{3,4,6,11,13},{3,4,6,11,13,14},{3,4,6,11,13,14,15},{3,4,6,11,13,15},{3,4,6,11,14},{3,4,6,11,14,15},{3,4,6,11,15},{3,4,6,12},{3,4,6,12,13},{3,4,6,12,13,14},{3,4,6,12,13,14,15},{3,4,6,12,13,15},{3,4,6,12,14},{3,4,6,12,14,15},{3,4,6,12,15},{3,4,6,13},{3,4,6,13,14},{3,4,6,13,14,15},{3,4,6,13,15},{3,4,6,14},{3,4,6,14,15},{3,4,6,15},{3,4,7},{3,4,7,8},{3,4,7,8,9},{3,4,7,8,9,10},{3,4,7,8,9,10,11},{3,4,7,8,9,10,11,12},{3,4,7,8,9,10,11,12,13},{3,4,7,8,9,10,11,12,13,14},{3,4,7,8,9,10,11,12,13,14,15},{3,4,7,8,9,10,11,12,13,15},{3,4,7,8,9,10,11,12,14},{3,4,7,8,9,10,11,12,14,15},{3,4,7,8,9,10,11,12,15},{3,4,7,8,9,10,11,13},{3,4,7,8,9,10,11,13,14},{3,4,7,8,9,10,11,13,14,15},{3,4,7,8,9,10,11,13,15},{3,4,7,8,9,10,11,14},{3,4,7,8,9,10,11,14,15},{3,4,7,8,9,10,11,15},{3,4,7,8,9,10,12},{3,4,7,8,9,10,12,13},{3,4,7,8,9,10,12,13,14},{3,4,7,8,9,10,12,13,14,15},{3,4,7,8,9,10,12,13,15},{3,4,7,8,9,10,12,14},{3,4,7,8,9,10,12,14,15},{3,4,7,8,9,10,12,15},{3,4,7,8,9,10,13},{3,4,7,8,9,10,13,14},{3,4,7,8,9,10,13,14,15},{3,4,7,8,9,10,13,15},{3,4,7,8,9,10,14},{3,4,7,8,9,10,14,15},{3,4,7,8,9,10,15},{3,4,7,8,9,11},{3,4,7,8,9,11,12},{3,4,7,8,9,11,12,13},{3,4,7,8,9,11,12,13,14},{3,4,7,8,9,11,12,13,14,15},{3,4,7,8,9,11,12,13,15},{3,4,7,8,9,11,12,14},{3,4,7,8,9,11,12,14,15},{3,4,7,8,9,11,12,15},{3,4,7,8,9,11,13},{3,4,7,8,9,11,13,14},{3,4,7,8,9,11,13,14,15},{3,4,7,8,9,11,13,15},{3,4,7,8,9,11,14},{3,4,7,8,9,11,14,15},{3,4,7,8,9,11,15},{3,4,7,8,9,12},{3,4,7,8,9,12,13},{3,4,7,8,9,12,13,14},{3,4,7,8,9,12,13,14,15},{3,4,7,8,9,12,13,15},{3,4,7,8,9,12,14},{3,4,7,8,9,12,14,15},{3,4,7,8,9,12,15},{3,4,7,8,9,13},{3,4,7,8,9,13,14},{3,4,7,8,9,13,14,15},{3,4,7,8,9,13,15},{3,4,7,8,9,14},{3,4,7,8,9,14,15},{3,4,7,8,9,15},{3,4,7,8,10},{3,4,7,8,10,11},{3,4,7,8,10,11,12},{3,4,7,8,10,11,12,13},{3,4,7,8,10,11,12,13,14},{3,4,7,8,10,11,12,13,14,15},{3,4,7,8,10,11,12,13,15},{3,4,7,8,10,11,12,14},{3,4,7,8,10,11,12,14,15},{3,4,7,8,10,11,12,15},{3,4,7,8,10,11,13},{3,4,7,8,10,11,13,14},{3,4,7,8,10,11,13,14,15},{3,4,7,8,10,11,13,15},{3,4,7,8,10,11,14},{3,4,7,8,10,11,14,15},{3,4,7,8,10,11,15},{3,4,7,8,10,12},{3,4,7,8,10,12,13},{3,4,7,8,10,12,13,14},{3,4,7,8,10,12,13,14,15},{3,4,7,8,10,12,13,15},{3,4,7,8,10,12,14},{3,4,7,8,10,12,14,15},{3,4,7,8,10,12,15},{3,4,7,8,10,13},{3,4,7,8,10,13,14},{3,4,7,8,10,13,14,15},{3,4,7,8,10,13,15},{3,4,7,8,10,14},{3,4,7,8,10,14,15},{3,4,7,8,10,15},{3,4,7,8,11},{3,4,7,8,11,12},{3,4,7,8,11,12,13},{3,4,7,8,11,12,13,14},{3,4,7,8,11,12,13,14,15},{3,4,7,8,11,12,13,15},{3,4,7,8,11,12,14},{3,4,7,8,11,12,14,15},{3,4,7,8,11,12,15},{3,4,7,8,11,13},{3,4,7,8,11,13,14},{3,4,7,8,11,13,14,15},{3,4,7,8,11,13,15},{3,4,7,8,11,14},{3,4,7,8,11,14,15},{3,4,7,8,11,15},{3,4,7,8,12},{3,4,7,8,12,13},{3,4,7,8,12,13,14},{3,4,7,8,12,13,14,15},{3,4,7,8,12,13,15},{3,4,7,8,12,14},{3,4,7,8,12,14,15},{3,4,7,8,12,15},{3,4,7,8,13},{3,4,7,8,13,14},{3,4,7,8,13,14,15},{3,4,7,8,13,15},{3,4,7,8,14},{3,4,7,8,14,15},{3,4,7,8,15},{3,4,7,9},{3,4,7,9,10},{3,4,7,9,10,11},{3,4,7,9,10,11,12},{3,4,7,9,10,11,12,13},{3,4,7,9,10,11,12,13,14},{3,4,7,9,10,11,12,13,14,15},{3,4,7,9,10,11,12,13,15},{3,4,7,9,10,11,12,14},{3,4,7,9,10,11,12,14,15},{3,4,7,9,10,11,12,15},{3,4,7,9,10,11,13},{3,4,7,9,10,11,13,14},{3,4,7,9,10,11,13,14,15},{3,4,7,9,10,11,13,15},{3,4,7,9,10,11,14},{3,4,7,9,10,11,14,15},{3,4,7,9,10,11,15},{3,4,7,9,10,12},{3,4,7,9,10,12,13},{3,4,7,9,10,12,13,14},{3,4,7,9,10,12,13,14,15},{3,4,7,9,10,12,13,15},{3,4,7,9,10,12,14},{3,4,7,9,10,12,14,15},{3,4,7,9,10,12,15},{3,4,7,9,10,13},{3,4,7,9,10,13,14},{3,4,7,9,10,13,14,15},{3,4,7,9,10,13,15},{3,4,7,9,10,14},{3,4,7,9,10,14,15},{3,4,7,9,10,15},{3,4,7,9,11},{3,4,7,9,11,12},{3,4,7,9,11,12,13},{3,4,7,9,11,12,13,14},{3,4,7,9,11,12,13,14,15},{3,4,7,9,11,12,13,15},{3,4,7,9,11,12,14},{3,4,7,9,11,12,14,15},{3,4,7,9,11,12,15},{3,4,7,9,11,13},{3,4,7,9,11,13,14},{3,4,7,9,11,13,14,15},{3,4,7,9,11,13,15},{3,4,7,9,11,14},{3,4,7,9,11,14,15},{3,4,7,9,11,15},{3,4,7,9,12},{3,4,7,9,12,13},{3,4,7,9,12,13,14},{3,4,7,9,12,13,14,15},{3,4,7,9,12,13,15},{3,4,7,9,12,14},{3,4,7,9,12,14,15},{3,4,7,9,12,15},{3,4,7,9,13},{3,4,7,9,13,14},{3,4,7,9,13,14,15},{3,4,7,9,13,15},{3,4,7,9,14},{3,4,7,9,14,15},{3,4,7,9,15},{3,4,7,10},{3,4,7,10,11},{3,4,7,10,11,12},{3,4,7,10,11,12,13},{3,4,7,10,11,12,13,14},{3,4,7,10,11,12,13,14,15},{3,4,7,10,11,12,13,15},{3,4,7,10,11,12,14},{3,4,7,10,11,12,14,15},{3,4,7,10,11,12,15},{3,4,7,10,11,13},{3,4,7,10,11,13,14},{3,4,7,10,11,13,14,15},{3,4,7,10,11,13,15},{3,4,7,10,11,14},{3,4,7,10,11,14,15},{3,4,7,10,11,15},{3,4,7,10,12},{3,4,7,10,12,13},{3,4,7,10,12,13,14},{3,4,7,10,12,13,14,15},{3,4,7,10,12,13,15},{3,4,7,10,12,14},{3,4,7,10,12,14,15},{3,4,7,10,12,15},{3,4,7,10,13},{3,4,7,10,13,14},{3,4,7,10,13,14,15},{3,4,7,10,13,15},{3,4,7,10,14},{3,4,7,10,14,15},{3,4,7,10,15},{3,4,7,11},{3,4,7,11,12},{3,4,7,11,12,13},{3,4,7,11,12,13,14},{3,4,7,11,12,13,14,15},{3,4,7,11,12,13,15},{3,4,7,11,12,14},{3,4,7,11,12,14,15},{3,4,7,11,12,15},{3,4,7,11,13},{3,4,7,11,13,14},{3,4,7,11,13,14,15},{3,4,7,11,13,15},{3,4,7,11,14},{3,4,7,11,14,15},{3,4,7,11,15},{3,4,7,12},{3,4,7,12,13},{3,4,7,12,13,14},{3,4,7,12,13,14,15},{3,4,7,12,13,15},{3,4,7,12,14},{3,4,7,12,14,15},{3,4,7,12,15},{3,4,7,13},{3,4,7,13,14},{3,4,7,13,14,15},{3,4,7,13,15},{3,4,7,14},{3,4,7,14,15},{3,4,7,15},{3,4,8},{3,4,8,9},{3,4,8,9,10},{3,4,8,9,10,11},{3,4,8,9,10,11,12},{3,4,8,9,10,11,12,13},{3,4,8,9,10,11,12,13,14},{3,4,8,9,10,11,12,13,14,15},{3,4,8,9,10,11,12,13,15},{3,4,8,9,10,11,12,14},{3,4,8,9,10,11,12,14,15},{3,4,8,9,10,11,12,15},{3,4,8,9,10,11,13},{3,4,8,9,10,11,13,14},{3,4,8,9,10,11,13,14,15},{3,4,8,9,10,11,13,15},{3,4,8,9,10,11,14},{3,4,8,9,10,11,14,15},{3,4,8,9,10,11,15},{3,4,8,9,10,12},{3,4,8,9,10,12,13},{3,4,8,9,10,12,13,14},{3,4,8,9,10,12,13,14,15},{3,4,8,9,10,12,13,15},{3,4,8,9,10,12,14},{3,4,8,9,10,12,14,15},{3,4,8,9,10,12,15},{3,4,8,9,10,13},{3,4,8,9,10,13,14},{3,4,8,9,10,13,14,15},{3,4,8,9,10,13,15},{3,4,8,9,10,14},{3,4,8,9,10,14,15},{3,4,8,9,10,15},{3,4,8,9,11},{3,4,8,9,11,12},{3,4,8,9,11,12,13},{3,4,8,9,11,12,13,14},{3,4,8,9,11,12,13,14,15},{3,4,8,9,11,12,13,15},{3,4,8,9,11,12,14},{3,4,8,9,11,12,14,15},{3,4,8,9,11,12,15},{3,4,8,9,11,13},{3,4,8,9,11,13,14},{3,4,8,9,11,13,14,15},{3,4,8,9,11,13,15},{3,4,8,9,11,14},{3,4,8,9,11,14,15},{3,4,8,9,11,15},{3,4,8,9,12},{3,4,8,9,12,13},{3,4,8,9,12,13,14},{3,4,8,9,12,13,14,15},{3,4,8,9,12,13,15},{3,4,8,9,12,14},{3,4,8,9,12,14,15},{3,4,8,9,12,15},{3,4,8,9,13},{3,4,8,9,13,14},{3,4,8,9,13,14,15},{3,4,8,9,13,15},{3,4,8,9,14},{3,4,8,9,14,15},{3,4,8,9,15},{3,4,8,10},{3,4,8,10,11},{3,4,8,10,11,12},{3,4,8,10,11,12,13},{3,4,8,10,11,12,13,14},{3,4,8,10,11,12,13,14,15},{3,4,8,10,11,12,13,15},{3,4,8,10,11,12,14},{3,4,8,10,11,12,14,15},{3,4,8,10,11,12,15},{3,4,8,10,11,13},{3,4,8,10,11,13,14},{3,4,8,10,11,13,14,15},{3,4,8,10,11,13,15},{3,4,8,10,11,14},{3,4,8,10,11,14,15},{3,4,8,10,11,15},{3,4,8,10,12},{3,4,8,10,12,13},{3,4,8,10,12,13,14},{3,4,8,10,12,13,14,15},{3,4,8,10,12,13,15},{3,4,8,10,12,14},{3,4,8,10,12,14,15},{3,4,8,10,12,15},{3,4,8,10,13},{3,4,8,10,13,14},{3,4,8,10,13,14,15},{3,4,8,10,13,15},{3,4,8,10,14},{3,4,8,10,14,15},{3,4,8,10,15},{3,4,8,11},{3,4,8,11,12},{3,4,8,11,12,13},{3,4,8,11,12,13,14},{3,4,8,11,12,13,14,15},{3,4,8,11,12,13,15},{3,4,8,11,12,14},{3,4,8,11,12,14,15},{3,4,8,11,12,15},{3,4,8,11,13},{3,4,8,11,13,14},{3,4,8,11,13,14,15},{3,4,8,11,13,15},{3,4,8,11,14},{3,4,8,11,14,15},{3,4,8,11,15},{3,4,8,12},{3,4,8,12,13},{3,4,8,12,13,14},{3,4,8,12,13,14,15},{3,4,8,12,13,15},{3,4,8,12,14},{3,4,8,12,14,15},{3,4,8,12,15},{3,4,8,13},{3,4,8,13,14},{3,4,8,13,14,15},{3,4,8,13,15},{3,4,8,14},{3,4,8,14,15},{3,4,8,15},{3,4,9},{3,4,9,10},{3,4,9,10,11},{3,4,9,10,11,12},{3,4,9,10,11,12,13},{3,4,9,10,11,12,13,14},{3,4,9,10,11,12,13,14,15},{3,4,9,10,11,12,13,15},{3,4,9,10,11,12,14},{3,4,9,10,11,12,14,15},{3,4,9,10,11,12,15},{3,4,9,10,11,13},{3,4,9,10,11,13,14},{3,4,9,10,11,13,14,15},{3,4,9,10,11,13,15},{3,4,9,10,11,14},{3,4,9,10,11,14,15},{3,4,9,10,11,15},{3,4,9,10,12},{3,4,9,10,12,13},{3,4,9,10,12,13,14},{3,4,9,10,12,13,14,15},{3,4,9,10,12,13,15},{3,4,9,10,12,14},{3,4,9,10,12,14,15},{3,4,9,10,12,15},{3,4,9,10,13},{3,4,9,10,13,14},{3,4,9,10,13,14,15},{3,4,9,10,13,15},{3,4,9,10,14},{3,4,9,10,14,15},{3,4,9,10,15},{3,4,9,11},{3,4,9,11,12},{3,4,9,11,12,13},{3,4,9,11,12,13,14},{3,4,9,11,12,13,14,15},{3,4,9,11,12,13,15},{3,4,9,11,12,14},{3,4,9,11,12,14,15},{3,4,9,11,12,15},{3,4,9,11,13},{3,4,9,11,13,14},{3,4,9,11,13,14,15},{3,4,9,11,13,15},{3,4,9,11,14},{3,4,9,11,14,15},{3,4,9,11,15},{3,4,9,12},{3,4,9,12,13},{3,4,9,12,13,14},{3,4,9,12,13,14,15},{3,4,9,12,13,15},{3,4,9,12,14},{3,4,9,12,14,15},{3,4,9,12,15},{3,4,9,13},{3,4,9,13,14},{3,4,9,13,14,15},{3,4,9,13,15},{3,4,9,14},{3,4,9,14,15},{3,4,9,15},{3,4,10},{3,4,10,11},{3,4,10,11,12},{3,4,10,11,12,13},{3,4,10,11,12,13,14},{3,4,10,11,12,13,14,15},{3,4,10,11,12,13,15},{3,4,10,11,12,14},{3,4,10,11,12,14,15},{3,4,10,11,12,15},{3,4,10,11,13},{3,4,10,11,13,14},{3,4,10,11,13,14,15},{3,4,10,11,13,15},{3,4,10,11,14},{3,4,10,11,14,15},{3,4,10,11,15},{3,4,10,12},{3,4,10,12,13},{3,4,10,12,13,14},{3,4,10,12,13,14,15},{3,4,10,12,13,15},{3,4,10,12,14},{3,4,10,12,14,15},{3,4,10,12,15},{3,4,10,13},{3,4,10,13,14},{3,4,10,13,14,15},{3,4,10,13,15},{3,4,10,14},{3,4,10,14,15},{3,4,10,15},{3,4,11},{3,4,11,12},{3,4,11,12,13},{3,4,11,12,13,14},{3,4,11,12,13,14,15},{3,4,11,12,13,15},{3,4,11,12,14},{3,4,11,12,14,15},{3,4,11,12,15},{3,4,11,13},{3,4,11,13,14},{3,4,11,13,14,15},{3,4,11,13,15},{3,4,11,14},{3,4,11,14,15},{3,4,11,15},{3,4,12},{3,4,12,13},{3,4,12,13,14},{3,4,12,13,14,15},{3,4,12,13,15},{3,4,12,14},{3,4,12,14,15},{3,4,12,15},{3,4,13},{3,4,13,14},{3,4,13,14,15},{3,4,13,15},{3,4,14},{3,4,14,15},{3,4,15},{3,5},{3,5,6},{3,5,6,7},{3,5,6,7,8},{3,5,6,7,8,9},{3,5,6,7,8,9,10},{3,5,6,7,8,9,10,11},{3,5,6,7,8,9,10,11,12},{3,5,6,7,8,9,10,11,12,13},{3,5,6,7,8,9,10,11,12,13,14},{3,5,6,7,8,9,10,11,12,13,14,15},{3,5,6,7,8,9,10,11,12,13,15},{3,5,6,7,8,9,10,11,12,14},{3,5,6,7,8,9,10,11,12,14,15},{3,5,6,7,8,9,10,11,12,15},{3,5,6,7,8,9,10,11,13},{3,5,6,7,8,9,10,11,13,14},{3,5,6,7,8,9,10,11,13,14,15},{3,5,6,7,8,9,10,11,13,15},{3,5,6,7,8,9,10,11,14},{3,5,6,7,8,9,10,11,14,15},{3,5,6,7,8,9,10,11,15},{3,5,6,7,8,9,10,12},{3,5,6,7,8,9,10,12,13},{3,5,6,7,8,9,10,12,13,14},{3,5,6,7,8,9,10,12,13,14,15},{3,5,6,7,8,9,10,12,13,15},{3,5,6,7,8,9,10,12,14},{3,5,6,7,8,9,10,12,14,15},{3,5,6,7,8,9,10,12,15},{3,5,6,7,8,9,10,13},{3,5,6,7,8,9,10,13,14},{3,5,6,7,8,9,10,13,14,15},{3,5,6,7,8,9,10,13,15},{3,5,6,7,8,9,10,14},{3,5,6,7,8,9,10,14,15},{3,5,6,7,8,9,10,15},{3,5,6,7,8,9,11},{3,5,6,7,8,9,11,12},{3,5,6,7,8,9,11,12,13},{3,5,6,7,8,9,11,12,13,14},{3,5,6,7,8,9,11,12,13,14,15},{3,5,6,7,8,9,11,12,13,15},{3,5,6,7,8,9,11,12,14},{3,5,6,7,8,9,11,12,14,15},{3,5,6,7,8,9,11,12,15},{3,5,6,7,8,9,11,13},{3,5,6,7,8,9,11,13,14},{3,5,6,7,8,9,11,13,14,15},{3,5,6,7,8,9,11,13,15},{3,5,6,7,8,9,11,14},{3,5,6,7,8,9,11,14,15},{3,5,6,7,8,9,11,15},{3,5,6,7,8,9,12},{3,5,6,7,8,9,12,13},{3,5,6,7,8,9,12,13,14},{3,5,6,7,8,9,12,13,14,15},{3,5,6,7,8,9,12,13,15},{3,5,6,7,8,9,12,14},{3,5,6,7,8,9,12,14,15},{3,5,6,7,8,9,12,15},{3,5,6,7,8,9,13},{3,5,6,7,8,9,13,14},{3,5,6,7,8,9,13,14,15},{3,5,6,7,8,9,13,15},{3,5,6,7,8,9,14},{3,5,6,7,8,9,14,15},{3,5,6,7,8,9,15},{3,5,6,7,8,10},{3,5,6,7,8,10,11},{3,5,6,7,8,10,11,12},{3,5,6,7,8,10,11,12,13},{3,5,6,7,8,10,11,12,13,14},{3,5,6,7,8,10,11,12,13,14,15},{3,5,6,7,8,10,11,12,13,15},{3,5,6,7,8,10,11,12,14},{3,5,6,7,8,10,11,12,14,15},{3,5,6,7,8,10,11,12,15},{3,5,6,7,8,10,11,13},{3,5,6,7,8,10,11,13,14},{3,5,6,7,8,10,11,13,14,15},{3,5,6,7,8,10,11,13,15},{3,5,6,7,8,10,11,14},{3,5,6,7,8,10,11,14,15},{3,5,6,7,8,10,11,15},{3,5,6,7,8,10,12},{3,5,6,7,8,10,12,13},{3,5,6,7,8,10,12,13,14},{3,5,6,7,8,10,12,13,14,15},{3,5,6,7,8,10,12,13,15},{3,5,6,7,8,10,12,14},{3,5,6,7,8,10,12,14,15},{3,5,6,7,8,10,12,15},{3,5,6,7,8,10,13},{3,5,6,7,8,10,13,14},{3,5,6,7,8,10,13,14,15},{3,5,6,7,8,10,13,15},{3,5,6,7,8,10,14},{3,5,6,7,8,10,14,15},{3,5,6,7,8,10,15},{3,5,6,7,8,11},{3,5,6,7,8,11,12},{3,5,6,7,8,11,12,13},{3,5,6,7,8,11,12,13,14},{3,5,6,7,8,11,12,13,14,15},{3,5,6,7,8,11,12,13,15},{3,5,6,7,8,11,12,14},{3,5,6,7,8,11,12,14,15},{3,5,6,7,8,11,12,15},{3,5,6,7,8,11,13},{3,5,6,7,8,11,13,14},{3,5,6,7,8,11,13,14,15},{3,5,6,7,8,11,13,15},{3,5,6,7,8,11,14},{3,5,6,7,8,11,14,15},{3,5,6,7,8,11,15},{3,5,6,7,8,12},{3,5,6,7,8,12,13},{3,5,6,7,8,12,13,14},{3,5,6,7,8,12,13,14,15},{3,5,6,7,8,12,13,15},{3,5,6,7,8,12,14},{3,5,6,7,8,12,14,15},{3,5,6,7,8,12,15},{3,5,6,7,8,13},{3,5,6,7,8,13,14},{3,5,6,7,8,13,14,15},{3,5,6,7,8,13,15},{3,5,6,7,8,14},{3,5,6,7,8,14,15},{3,5,6,7,8,15},{3,5,6,7,9},{3,5,6,7,9,10},{3,5,6,7,9,10,11},{3,5,6,7,9,10,11,12},{3,5,6,7,9,10,11,12,13},{3,5,6,7,9,10,11,12,13,14},{3,5,6,7,9,10,11,12,13,14,15},{3,5,6,7,9,10,11,12,13,15},{3,5,6,7,9,10,11,12,14},{3,5,6,7,9,10,11,12,14,15},{3,5,6,7,9,10,11,12,15},{3,5,6,7,9,10,11,13},{3,5,6,7,9,10,11,13,14},{3,5,6,7,9,10,11,13,14,15},{3,5,6,7,9,10,11,13,15},{3,5,6,7,9,10,11,14},{3,5,6,7,9,10,11,14,15},{3,5,6,7,9,10,11,15},{3,5,6,7,9,10,12},{3,5,6,7,9,10,12,13},{3,5,6,7,9,10,12,13,14},{3,5,6,7,9,10,12,13,14,15},{3,5,6,7,9,10,12,13,15},{3,5,6,7,9,10,12,14},{3,5,6,7,9,10,12,14,15},{3,5,6,7,9,10,12,15},{3,5,6,7,9,10,13},{3,5,6,7,9,10,13,14},{3,5,6,7,9,10,13,14,15},{3,5,6,7,9,10,13,15},{3,5,6,7,9,10,14},{3,5,6,7,9,10,14,15},{3,5,6,7,9,10,15},{3,5,6,7,9,11},{3,5,6,7,9,11,12},{3,5,6,7,9,11,12,13},{3,5,6,7,9,11,12,13,14},{3,5,6,7,9,11,12,13,14,15},{3,5,6,7,9,11,12,13,15},{3,5,6,7,9,11,12,14},{3,5,6,7,9,11,12,14,15},{3,5,6,7,9,11,12,15},{3,5,6,7,9,11,13},{3,5,6,7,9,11,13,14},{3,5,6,7,9,11,13,14,15},{3,5,6,7,9,11,13,15},{3,5,6,7,9,11,14},{3,5,6,7,9,11,14,15},{3,5,6,7,9,11,15},{3,5,6,7,9,12},{3,5,6,7,9,12,13},{3,5,6,7,9,12,13,14},{3,5,6,7,9,12,13,14,15},{3,5,6,7,9,12,13,15},{3,5,6,7,9,12,14},{3,5,6,7,9,12,14,15},{3,5,6,7,9,12,15},{3,5,6,7,9,13},{3,5,6,7,9,13,14},{3,5,6,7,9,13,14,15},{3,5,6,7,9,13,15},{3,5,6,7,9,14},{3,5,6,7,9,14,15},{3,5,6,7,9,15},{3,5,6,7,10},{3,5,6,7,10,11},{3,5,6,7,10,11,12},{3,5,6,7,10,11,12,13},{3,5,6,7,10,11,12,13,14},{3,5,6,7,10,11,12,13,14,15},{3,5,6,7,10,11,12,13,15},{3,5,6,7,10,11,12,14},{3,5,6,7,10,11,12,14,15},{3,5,6,7,10,11,12,15},{3,5,6,7,10,11,13},{3,5,6,7,10,11,13,14},{3,5,6,7,10,11,13,14,15},{3,5,6,7,10,11,13,15},{3,5,6,7,10,11,14},{3,5,6,7,10,11,14,15},{3,5,6,7,10,11,15},{3,5,6,7,10,12},{3,5,6,7,10,12,13},{3,5,6,7,10,12,13,14},{3,5,6,7,10,12,13,14,15},{3,5,6,7,10,12,13,15},{3,5,6,7,10,12,14},{3,5,6,7,10,12,14,15},{3,5,6,7,10,12,15},{3,5,6,7,10,13},{3,5,6,7,10,13,14},{3,5,6,7,10,13,14,15},{3,5,6,7,10,13,15},{3,5,6,7,10,14},{3,5,6,7,10,14,15},{3,5,6,7,10,15},{3,5,6,7,11},{3,5,6,7,11,12},{3,5,6,7,11,12,13},{3,5,6,7,11,12,13,14},{3,5,6,7,11,12,13,14,15},{3,5,6,7,11,12,13,15},{3,5,6,7,11,12,14},{3,5,6,7,11,12,14,15},{3,5,6,7,11,12,15},{3,5,6,7,11,13},{3,5,6,7,11,13,14},{3,5,6,7,11,13,14,15},{3,5,6,7,11,13,15},{3,5,6,7,11,14},{3,5,6,7,11,14,15},{3,5,6,7,11,15},{3,5,6,7,12},{3,5,6,7,12,13},{3,5,6,7,12,13,14},{3,5,6,7,12,13,14,15},{3,5,6,7,12,13,15},{3,5,6,7,12,14},{3,5,6,7,12,14,15},{3,5,6,7,12,15},{3,5,6,7,13},{3,5,6,7,13,14},{3,5,6,7,13,14,15},{3,5,6,7,13,15},{3,5,6,7,14},{3,5,6,7,14,15},{3,5,6,7,15},{3,5,6,8},{3,5,6,8,9},{3,5,6,8,9,10},{3,5,6,8,9,10,11},{3,5,6,8,9,10,11,12},{3,5,6,8,9,10,11,12,13},{3,5,6,8,9,10,11,12,13,14},{3,5,6,8,9,10,11,12,13,14,15},{3,5,6,8,9,10,11,12,13,15},{3,5,6,8,9,10,11,12,14},{3,5,6,8,9,10,11,12,14,15},{3,5,6,8,9,10,11,12,15},{3,5,6,8,9,10,11,13},{3,5,6,8,9,10,11,13,14},{3,5,6,8,9,10,11,13,14,15},{3,5,6,8,9,10,11,13,15},{3,5,6,8,9,10,11,14},{3,5,6,8,9,10,11,14,15},{3,5,6,8,9,10,11,15},{3,5,6,8,9,10,12},{3,5,6,8,9,10,12,13},{3,5,6,8,9,10,12,13,14},{3,5,6,8,9,10,12,13,14,15},{3,5,6,8,9,10,12,13,15},{3,5,6,8,9,10,12,14},{3,5,6,8,9,10,12,14,15},{3,5,6,8,9,10,12,15},{3,5,6,8,9,10,13},{3,5,6,8,9,10,13,14},{3,5,6,8,9,10,13,14,15},{3,5,6,8,9,10,13,15},{3,5,6,8,9,10,14},{3,5,6,8,9,10,14,15},{3,5,6,8,9,10,15},{3,5,6,8,9,11},{3,5,6,8,9,11,12},{3,5,6,8,9,11,12,13},{3,5,6,8,9,11,12,13,14},{3,5,6,8,9,11,12,13,14,15},{3,5,6,8,9,11,12,13,15},{3,5,6,8,9,11,12,14},{3,5,6,8,9,11,12,14,15},{3,5,6,8,9,11,12,15},{3,5,6,8,9,11,13},{3,5,6,8,9,11,13,14},{3,5,6,8,9,11,13,14,15},{3,5,6,8,9,11,13,15},{3,5,6,8,9,11,14},{3,5,6,8,9,11,14,15},{3,5,6,8,9,11,15},{3,5,6,8,9,12},{3,5,6,8,9,12,13},{3,5,6,8,9,12,13,14},{3,5,6,8,9,12,13,14,15},{3,5,6,8,9,12,13,15},{3,5,6,8,9,12,14},{3,5,6,8,9,12,14,15},{3,5,6,8,9,12,15},{3,5,6,8,9,13},{3,5,6,8,9,13,14},{3,5,6,8,9,13,14,15},{3,5,6,8,9,13,15},{3,5,6,8,9,14},{3,5,6,8,9,14,15},{3,5,6,8,9,15},{3,5,6,8,10},{3,5,6,8,10,11},{3,5,6,8,10,11,12},{3,5,6,8,10,11,12,13},{3,5,6,8,10,11,12,13,14},{3,5,6,8,10,11,12,13,14,15},{3,5,6,8,10,11,12,13,15},{3,5,6,8,10,11,12,14},{3,5,6,8,10,11,12,14,15},{3,5,6,8,10,11,12,15},{3,5,6,8,10,11,13},{3,5,6,8,10,11,13,14},{3,5,6,8,10,11,13,14,15},{3,5,6,8,10,11,13,15},{3,5,6,8,10,11,14},{3,5,6,8,10,11,14,15},{3,5,6,8,10,11,15},{3,5,6,8,10,12},{3,5,6,8,10,12,13},{3,5,6,8,10,12,13,14},{3,5,6,8,10,12,13,14,15},{3,5,6,8,10,12,13,15},{3,5,6,8,10,12,14},{3,5,6,8,10,12,14,15},{3,5,6,8,10,12,15},{3,5,6,8,10,13},{3,5,6,8,10,13,14},{3,5,6,8,10,13,14,15},{3,5,6,8,10,13,15},{3,5,6,8,10,14},{3,5,6,8,10,14,15},{3,5,6,8,10,15},{3,5,6,8,11},{3,5,6,8,11,12},{3,5,6,8,11,12,13},{3,5,6,8,11,12,13,14},{3,5,6,8,11,12,13,14,15},{3,5,6,8,11,12,13,15},{3,5,6,8,11,12,14},{3,5,6,8,11,12,14,15},{3,5,6,8,11,12,15},{3,5,6,8,11,13},{3,5,6,8,11,13,14},{3,5,6,8,11,13,14,15},{3,5,6,8,11,13,15},{3,5,6,8,11,14},{3,5,6,8,11,14,15},{3,5,6,8,11,15},{3,5,6,8,12},{3,5,6,8,12,13},{3,5,6,8,12,13,14},{3,5,6,8,12,13,14,15},{3,5,6,8,12,13,15},{3,5,6,8,12,14},{3,5,6,8,12,14,15},{3,5,6,8,12,15},{3,5,6,8,13},{3,5,6,8,13,14},{3,5,6,8,13,14,15},{3,5,6,8,13,15},{3,5,6,8,14},{3,5,6,8,14,15},{3,5,6,8,15},{3,5,6,9},{3,5,6,9,10},{3,5,6,9,10,11},{3,5,6,9,10,11,12},{3,5,6,9,10,11,12,13},{3,5,6,9,10,11,12,13,14},{3,5,6,9,10,11,12,13,14,15},{3,5,6,9,10,11,12,13,15},{3,5,6,9,10,11,12,14},{3,5,6,9,10,11,12,14,15},{3,5,6,9,10,11,12,15},{3,5,6,9,10,11,13},{3,5,6,9,10,11,13,14},{3,5,6,9,10,11,13,14,15},{3,5,6,9,10,11,13,15},{3,5,6,9,10,11,14},{3,5,6,9,10,11,14,15},{3,5,6,9,10,11,15},{3,5,6,9,10,12},{3,5,6,9,10,12,13},{3,5,6,9,10,12,13,14},{3,5,6,9,10,12,13,14,15},{3,5,6,9,10,12,13,15},{3,5,6,9,10,12,14},{3,5,6,9,10,12,14,15},{3,5,6,9,10,12,15},{3,5,6,9,10,13},{3,5,6,9,10,13,14},{3,5,6,9,10,13,14,15},{3,5,6,9,10,13,15},{3,5,6,9,10,14},{3,5,6,9,10,14,15},{3,5,6,9,10,15},{3,5,6,9,11},{3,5,6,9,11,12},{3,5,6,9,11,12,13},{3,5,6,9,11,12,13,14},{3,5,6,9,11,12,13,14,15},{3,5,6,9,11,12,13,15},{3,5,6,9,11,12,14},{3,5,6,9,11,12,14,15},{3,5,6,9,11,12,15},{3,5,6,9,11,13},{3,5,6,9,11,13,14},{3,5,6,9,11,13,14,15},{3,5,6,9,11,13,15},{3,5,6,9,11,14},{3,5,6,9,11,14,15},{3,5,6,9,11,15},{3,5,6,9,12},{3,5,6,9,12,13},{3,5,6,9,12,13,14},{3,5,6,9,12,13,14,15},{3,5,6,9,12,13,15},{3,5,6,9,12,14},{3,5,6,9,12,14,15},{3,5,6,9,12,15},{3,5,6,9,13},{3,5,6,9,13,14},{3,5,6,9,13,14,15},{3,5,6,9,13,15},{3,5,6,9,14},{3,5,6,9,14,15},{3,5,6,9,15},{3,5,6,10},{3,5,6,10,11},{3,5,6,10,11,12},{3,5,6,10,11,12,13},{3,5,6,10,11,12,13,14},{3,5,6,10,11,12,13,14,15},{3,5,6,10,11,12,13,15},{3,5,6,10,11,12,14},{3,5,6,10,11,12,14,15},{3,5,6,10,11,12,15},{3,5,6,10,11,13},{3,5,6,10,11,13,14},{3,5,6,10,11,13,14,15},{3,5,6,10,11,13,15},{3,5,6,10,11,14},{3,5,6,10,11,14,15},{3,5,6,10,11,15},{3,5,6,10,12},{3,5,6,10,12,13},{3,5,6,10,12,13,14},{3,5,6,10,12,13,14,15},{3,5,6,10,12,13,15},{3,5,6,10,12,14},{3,5,6,10,12,14,15},{3,5,6,10,12,15},{3,5,6,10,13},{3,5,6,10,13,14},{3,5,6,10,13,14,15},{3,5,6,10,13,15},{3,5,6,10,14},{3,5,6,10,14,15},{3,5,6,10,15},{3,5,6,11},{3,5,6,11,12},{3,5,6,11,12,13},{3,5,6,11,12,13,14},{3,5,6,11,12,13,14,15},{3,5,6,11,12,13,15},{3,5,6,11,12,14},{3,5,6,11,12,14,15},{3,5,6,11,12,15},{3,5,6,11,13},{3,5,6,11,13,14},{3,5,6,11,13,14,15},{3,5,6,11,13,15},{3,5,6,11,14},{3,5,6,11,14,15},{3,5,6,11,15},{3,5,6,12},{3,5,6,12,13},{3,5,6,12,13,14},{3,5,6,12,13,14,15},{3,5,6,12,13,15},{3,5,6,12,14},{3,5,6,12,14,15},{3,5,6,12,15},{3,5,6,13},{3,5,6,13,14},{3,5,6,13,14,15},{3,5,6,13,15},{3,5,6,14},{3,5,6,14,15},{3,5,6,15},{3,5,7},{3,5,7,8},{3,5,7,8,9},{3,5,7,8,9,10},{3,5,7,8,9,10,11},{3,5,7,8,9,10,11,12},{3,5,7,8,9,10,11,12,13},{3,5,7,8,9,10,11,12,13,14},{3,5,7,8,9,10,11,12,13,14,15},{3,5,7,8,9,10,11,12,13,15},{3,5,7,8,9,10,11,12,14},{3,5,7,8,9,10,11,12,14,15},{3,5,7,8,9,10,11,12,15},{3,5,7,8,9,10,11,13},{3,5,7,8,9,10,11,13,14},{3,5,7,8,9,10,11,13,14,15},{3,5,7,8,9,10,11,13,15},{3,5,7,8,9,10,11,14},{3,5,7,8,9,10,11,14,15},{3,5,7,8,9,10,11,15},{3,5,7,8,9,10,12},{3,5,7,8,9,10,12,13},{3,5,7,8,9,10,12,13,14},{3,5,7,8,9,10,12,13,14,15},{3,5,7,8,9,10,12,13,15},{3,5,7,8,9,10,12,14},{3,5,7,8,9,10,12,14,15},{3,5,7,8,9,10,12,15},{3,5,7,8,9,10,13},{3,5,7,8,9,10,13,14},{3,5,7,8,9,10,13,14,15},{3,5,7,8,9,10,13,15},{3,5,7,8,9,10,14},{3,5,7,8,9,10,14,15},{3,5,7,8,9,10,15},{3,5,7,8,9,11},{3,5,7,8,9,11,12},{3,5,7,8,9,11,12,13},{3,5,7,8,9,11,12,13,14},{3,5,7,8,9,11,12,13,14,15},{3,5,7,8,9,11,12,13,15},{3,5,7,8,9,11,12,14},{3,5,7,8,9,11,12,14,15},{3,5,7,8,9,11,12,15},{3,5,7,8,9,11,13},{3,5,7,8,9,11,13,14},{3,5,7,8,9,11,13,14,15},{3,5,7,8,9,11,13,15},{3,5,7,8,9,11,14},{3,5,7,8,9,11,14,15},{3,5,7,8,9,11,15},{3,5,7,8,9,12},{3,5,7,8,9,12,13},{3,5,7,8,9,12,13,14},{3,5,7,8,9,12,13,14,15},{3,5,7,8,9,12,13,15},{3,5,7,8,9,12,14},{3,5,7,8,9,12,14,15},{3,5,7,8,9,12,15},{3,5,7,8,9,13},{3,5,7,8,9,13,14},{3,5,7,8,9,13,14,15},{3,5,7,8,9,13,15},{3,5,7,8,9,14},{3,5,7,8,9,14,15},{3,5,7,8,9,15},{3,5,7,8,10},{3,5,7,8,10,11},{3,5,7,8,10,11,12},{3,5,7,8,10,11,12,13},{3,5,7,8,10,11,12,13,14},{3,5,7,8,10,11,12,13,14,15},{3,5,7,8,10,11,12,13,15},{3,5,7,8,10,11,12,14},{3,5,7,8,10,11,12,14,15},{3,5,7,8,10,11,12,15},{3,5,7,8,10,11,13},{3,5,7,8,10,11,13,14},{3,5,7,8,10,11,13,14,15},{3,5,7,8,10,11,13,15},{3,5,7,8,10,11,14},{3,5,7,8,10,11,14,15},{3,5,7,8,10,11,15},{3,5,7,8,10,12},{3,5,7,8,10,12,13},{3,5,7,8,10,12,13,14},{3,5,7,8,10,12,13,14,15},{3,5,7,8,10,12,13,15},{3,5,7,8,10,12,14},{3,5,7,8,10,12,14,15},{3,5,7,8,10,12,15},{3,5,7,8,10,13},{3,5,7,8,10,13,14},{3,5,7,8,10,13,14,15},{3,5,7,8,10,13,15},{3,5,7,8,10,14},{3,5,7,8,10,14,15},{3,5,7,8,10,15},{3,5,7,8,11},{3,5,7,8,11,12},{3,5,7,8,11,12,13},{3,5,7,8,11,12,13,14},{3,5,7,8,11,12,13,14,15},{3,5,7,8,11,12,13,15},{3,5,7,8,11,12,14},{3,5,7,8,11,12,14,15},{3,5,7,8,11,12,15},{3,5,7,8,11,13},{3,5,7,8,11,13,14},{3,5,7,8,11,13,14,15},{3,5,7,8,11,13,15},{3,5,7,8,11,14},{3,5,7,8,11,14,15},{3,5,7,8,11,15},{3,5,7,8,12},{3,5,7,8,12,13},{3,5,7,8,12,13,14},{3,5,7,8,12,13,14,15},{3,5,7,8,12,13,15},{3,5,7,8,12,14},{3,5,7,8,12,14,15},{3,5,7,8,12,15},{3,5,7,8,13},{3,5,7,8,13,14},{3,5,7,8,13,14,15},{3,5,7,8,13,15},{3,5,7,8,14},{3,5,7,8,14,15},{3,5,7,8,15},{3,5,7,9},{3,5,7,9,10},{3,5,7,9,10,11},{3,5,7,9,10,11,12},{3,5,7,9,10,11,12,13},{3,5,7,9,10,11,12,13,14},{3,5,7,9,10,11,12,13,14,15},{3,5,7,9,10,11,12,13,15},{3,5,7,9,10,11,12,14},{3,5,7,9,10,11,12,14,15},{3,5,7,9,10,11,12,15},{3,5,7,9,10,11,13},{3,5,7,9,10,11,13,14},{3,5,7,9,10,11,13,14,15},{3,5,7,9,10,11,13,15},{3,5,7,9,10,11,14},{3,5,7,9,10,11,14,15},{3,5,7,9,10,11,15},{3,5,7,9,10,12},{3,5,7,9,10,12,13},{3,5,7,9,10,12,13,14},{3,5,7,9,10,12,13,14,15},{3,5,7,9,10,12,13,15},{3,5,7,9,10,12,14},{3,5,7,9,10,12,14,15},{3,5,7,9,10,12,15},{3,5,7,9,10,13},{3,5,7,9,10,13,14},{3,5,7,9,10,13,14,15},{3,5,7,9,10,13,15},{3,5,7,9,10,14},{3,5,7,9,10,14,15},{3,5,7,9,10,15},{3,5,7,9,11},{3,5,7,9,11,12},{3,5,7,9,11,12,13},{3,5,7,9,11,12,13,14},{3,5,7,9,11,12,13,14,15},{3,5,7,9,11,12,13,15},{3,5,7,9,11,12,14},{3,5,7,9,11,12,14,15},{3,5,7,9,11,12,15},{3,5,7,9,11,13},{3,5,7,9,11,13,14},{3,5,7,9,11,13,14,15},{3,5,7,9,11,13,15},{3,5,7,9,11,14},{3,5,7,9,11,14,15},{3,5,7,9,11,15},{3,5,7,9,12},{3,5,7,9,12,13},{3,5,7,9,12,13,14},{3,5,7,9,12,13,14,15},{3,5,7,9,12,13,15},{3,5,7,9,12,14},{3,5,7,9,12,14,15},{3,5,7,9,12,15},{3,5,7,9,13},{3,5,7,9,13,14},{3,5,7,9,13,14,15},{3,5,7,9,13,15},{3,5,7,9,14},{3,5,7,9,14,15},{3,5,7,9,15},{3,5,7,10},{3,5,7,10,11},{3,5,7,10,11,12},{3,5,7,10,11,12,13},{3,5,7,10,11,12,13,14},{3,5,7,10,11,12,13,14,15},{3,5,7,10,11,12,13,15},{3,5,7,10,11,12,14},{3,5,7,10,11,12,14,15},{3,5,7,10,11,12,15},{3,5,7,10,11,13},{3,5,7,10,11,13,14},{3,5,7,10,11,13,14,15},{3,5,7,10,11,13,15},{3,5,7,10,11,14},{3,5,7,10,11,14,15},{3,5,7,10,11,15},{3,5,7,10,12},{3,5,7,10,12,13},{3,5,7,10,12,13,14},{3,5,7,10,12,13,14,15},{3,5,7,10,12,13,15},{3,5,7,10,12,14},{3,5,7,10,12,14,15},{3,5,7,10,12,15},{3,5,7,10,13},{3,5,7,10,13,14},{3,5,7,10,13,14,15},{3,5,7,10,13,15},{3,5,7,10,14},{3,5,7,10,14,15},{3,5,7,10,15},{3,5,7,11},{3,5,7,11,12},{3,5,7,11,12,13},{3,5,7,11,12,13,14},{3,5,7,11,12,13,14,15},{3,5,7,11,12,13,15},{3,5,7,11,12,14},{3,5,7,11,12,14,15},{3,5,7,11,12,15},{3,5,7,11,13},{3,5,7,11,13,14},{3,5,7,11,13,14,15},{3,5,7,11,13,15},{3,5,7,11,14},{3,5,7,11,14,15},{3,5,7,11,15},{3,5,7,12},{3,5,7,12,13},{3,5,7,12,13,14},{3,5,7,12,13,14,15},{3,5,7,12,13,15},{3,5,7,12,14},{3,5,7,12,14,15},{3,5,7,12,15},{3,5,7,13},{3,5,7,13,14},{3,5,7,13,14,15},{3,5,7,13,15},{3,5,7,14},{3,5,7,14,15},{3,5,7,15},{3,5,8},{3,5,8,9},{3,5,8,9,10},{3,5,8,9,10,11},{3,5,8,9,10,11,12},{3,5,8,9,10,11,12,13},{3,5,8,9,10,11,12,13,14},{3,5,8,9,10,11,12,13,14,15},{3,5,8,9,10,11,12,13,15},{3,5,8,9,10,11,12,14},{3,5,8,9,10,11,12,14,15},{3,5,8,9,10,11,12,15},{3,5,8,9,10,11,13},{3,5,8,9,10,11,13,14},{3,5,8,9,10,11,13,14,15},{3,5,8,9,10,11,13,15},{3,5,8,9,10,11,14},{3,5,8,9,10,11,14,15},{3,5,8,9,10,11,15},{3,5,8,9,10,12},{3,5,8,9,10,12,13},{3,5,8,9,10,12,13,14},{3,5,8,9,10,12,13,14,15},{3,5,8,9,10,12,13,15},{3,5,8,9,10,12,14},{3,5,8,9,10,12,14,15},{3,5,8,9,10,12,15},{3,5,8,9,10,13},{3,5,8,9,10,13,14},{3,5,8,9,10,13,14,15},{3,5,8,9,10,13,15},{3,5,8,9,10,14},{3,5,8,9,10,14,15},{3,5,8,9,10,15},{3,5,8,9,11},{3,5,8,9,11,12},{3,5,8,9,11,12,13},{3,5,8,9,11,12,13,14},{3,5,8,9,11,12,13,14,15},{3,5,8,9,11,12,13,15},{3,5,8,9,11,12,14},{3,5,8,9,11,12,14,15},{3,5,8,9,11,12,15},{3,5,8,9,11,13},{3,5,8,9,11,13,14},{3,5,8,9,11,13,14,15},{3,5,8,9,11,13,15},{3,5,8,9,11,14},{3,5,8,9,11,14,15},{3,5,8,9,11,15},{3,5,8,9,12},{3,5,8,9,12,13},{3,5,8,9,12,13,14},{3,5,8,9,12,13,14,15},{3,5,8,9,12,13,15},{3,5,8,9,12,14},{3,5,8,9,12,14,15},{3,5,8,9,12,15},{3,5,8,9,13},{3,5,8,9,13,14},{3,5,8,9,13,14,15},{3,5,8,9,13,15},{3,5,8,9,14},{3,5,8,9,14,15},{3,5,8,9,15},{3,5,8,10},{3,5,8,10,11},{3,5,8,10,11,12},{3,5,8,10,11,12,13},{3,5,8,10,11,12,13,14},{3,5,8,10,11,12,13,14,15},{3,5,8,10,11,12,13,15},{3,5,8,10,11,12,14},{3,5,8,10,11,12,14,15},{3,5,8,10,11,12,15},{3,5,8,10,11,13},{3,5,8,10,11,13,14},{3,5,8,10,11,13,14,15},{3,5,8,10,11,13,15},{3,5,8,10,11,14},{3,5,8,10,11,14,15},{3,5,8,10,11,15},{3,5,8,10,12},{3,5,8,10,12,13},{3,5,8,10,12,13,14},{3,5,8,10,12,13,14,15},{3,5,8,10,12,13,15},{3,5,8,10,12,14},{3,5,8,10,12,14,15},{3,5,8,10,12,15},{3,5,8,10,13},{3,5,8,10,13,14},{3,5,8,10,13,14,15},{3,5,8,10,13,15},{3,5,8,10,14},{3,5,8,10,14,15},{3,5,8,10,15},{3,5,8,11},{3,5,8,11,12},{3,5,8,11,12,13},{3,5,8,11,12,13,14},{3,5,8,11,12,13,14,15},{3,5,8,11,12,13,15},{3,5,8,11,12,14},{3,5,8,11,12,14,15},{3,5,8,11,12,15},{3,5,8,11,13},{3,5,8,11,13,14},{3,5,8,11,13,14,15},{3,5,8,11,13,15},{3,5,8,11,14},{3,5,8,11,14,15},{3,5,8,11,15},{3,5,8,12},{3,5,8,12,13},{3,5,8,12,13,14},{3,5,8,12,13,14,15},{3,5,8,12,13,15},{3,5,8,12,14},{3,5,8,12,14,15},{3,5,8,12,15},{3,5,8,13},{3,5,8,13,14},{3,5,8,13,14,15},{3,5,8,13,15},{3,5,8,14},{3,5,8,14,15},{3,5,8,15},{3,5,9},{3,5,9,10},{3,5,9,10,11},{3,5,9,10,11,12},{3,5,9,10,11,12,13},{3,5,9,10,11,12,13,14},{3,5,9,10,11,12,13,14,15},{3,5,9,10,11,12,13,15},{3,5,9,10,11,12,14},{3,5,9,10,11,12,14,15},{3,5,9,10,11,12,15},{3,5,9,10,11,13},{3,5,9,10,11,13,14},{3,5,9,10,11,13,14,15},{3,5,9,10,11,13,15},{3,5,9,10,11,14},{3,5,9,10,11,14,15},{3,5,9,10,11,15},{3,5,9,10,12},{3,5,9,10,12,13},{3,5,9,10,12,13,14},{3,5,9,10,12,13,14,15},{3,5,9,10,12,13,15},{3,5,9,10,12,14},{3,5,9,10,12,14,15},{3,5,9,10,12,15},{3,5,9,10,13},{3,5,9,10,13,14},{3,5,9,10,13,14,15},{3,5,9,10,13,15},{3,5,9,10,14},{3,5,9,10,14,15},{3,5,9,10,15},{3,5,9,11},{3,5,9,11,12},{3,5,9,11,12,13},{3,5,9,11,12,13,14},{3,5,9,11,12,13,14,15},{3,5,9,11,12,13,15},{3,5,9,11,12,14},{3,5,9,11,12,14,15},{3,5,9,11,12,15},{3,5,9,11,13},{3,5,9,11,13,14},{3,5,9,11,13,14,15},{3,5,9,11,13,15},{3,5,9,11,14},{3,5,9,11,14,15},{3,5,9,11,15},{3,5,9,12},{3,5,9,12,13},{3,5,9,12,13,14},{3,5,9,12,13,14,15},{3,5,9,12,13,15},{3,5,9,12,14},{3,5,9,12,14,15},{3,5,9,12,15},{3,5,9,13},{3,5,9,13,14},{3,5,9,13,14,15},{3,5,9,13,15},{3,5,9,14},{3,5,9,14,15},{3,5,9,15},{3,5,10},{3,5,10,11},{3,5,10,11,12},{3,5,10,11,12,13},{3,5,10,11,12,13,14},{3,5,10,11,12,13,14,15},{3,5,10,11,12,13,15},{3,5,10,11,12,14},{3,5,10,11,12,14,15},{3,5,10,11,12,15},{3,5,10,11,13},{3,5,10,11,13,14},{3,5,10,11,13,14,15},{3,5,10,11,13,15},{3,5,10,11,14},{3,5,10,11,14,15},{3,5,10,11,15},{3,5,10,12},{3,5,10,12,13},{3,5,10,12,13,14},{3,5,10,12,13,14,15},{3,5,10,12,13,15},{3,5,10,12,14},{3,5,10,12,14,15},{3,5,10,12,15},{3,5,10,13},{3,5,10,13,14},{3,5,10,13,14,15},{3,5,10,13,15},{3,5,10,14},{3,5,10,14,15},{3,5,10,15},{3,5,11},{3,5,11,12},{3,5,11,12,13},{3,5,11,12,13,14},{3,5,11,12,13,14,15},{3,5,11,12,13,15},{3,5,11,12,14},{3,5,11,12,14,15},{3,5,11,12,15},{3,5,11,13},{3,5,11,13,14},{3,5,11,13,14,15},{3,5,11,13,15},{3,5,11,14},{3,5,11,14,15},{3,5,11,15},{3,5,12},{3,5,12,13},{3,5,12,13,14},{3,5,12,13,14,15},{3,5,12,13,15},{3,5,12,14},{3,5,12,14,15},{3,5,12,15},{3,5,13},{3,5,13,14},{3,5,13,14,15},{3,5,13,15},{3,5,14},{3,5,14,15},{3,5,15},{3,6},{3,6,7},{3,6,7,8},{3,6,7,8,9},{3,6,7,8,9,10},{3,6,7,8,9,10,11},{3,6,7,8,9,10,11,12},{3,6,7,8,9,10,11,12,13},{3,6,7,8,9,10,11,12,13,14},{3,6,7,8,9,10,11,12,13,14,15},{3,6,7,8,9,10,11,12,13,15},{3,6,7,8,9,10,11,12,14},{3,6,7,8,9,10,11,12,14,15},{3,6,7,8,9,10,11,12,15},{3,6,7,8,9,10,11,13},{3,6,7,8,9,10,11,13,14},{3,6,7,8,9,10,11,13,14,15},{3,6,7,8,9,10,11,13,15},{3,6,7,8,9,10,11,14},{3,6,7,8,9,10,11,14,15},{3,6,7,8,9,10,11,15},{3,6,7,8,9,10,12},{3,6,7,8,9,10,12,13},{3,6,7,8,9,10,12,13,14},{3,6,7,8,9,10,12,13,14,15},{3,6,7,8,9,10,12,13,15},{3,6,7,8,9,10,12,14},{3,6,7,8,9,10,12,14,15},{3,6,7,8,9,10,12,15},{3,6,7,8,9,10,13},{3,6,7,8,9,10,13,14},{3,6,7,8,9,10,13,14,15},{3,6,7,8,9,10,13,15},{3,6,7,8,9,10,14},{3,6,7,8,9,10,14,15},{3,6,7,8,9,10,15},{3,6,7,8,9,11},{3,6,7,8,9,11,12},{3,6,7,8,9,11,12,13},{3,6,7,8,9,11,12,13,14},{3,6,7,8,9,11,12,13,14,15},{3,6,7,8,9,11,12,13,15},{3,6,7,8,9,11,12,14},{3,6,7,8,9,11,12,14,15},{3,6,7,8,9,11,12,15},{3,6,7,8,9,11,13},{3,6,7,8,9,11,13,14},{3,6,7,8,9,11,13,14,15},{3,6,7,8,9,11,13,15},{3,6,7,8,9,11,14},{3,6,7,8,9,11,14,15},{3,6,7,8,9,11,15},{3,6,7,8,9,12},{3,6,7,8,9,12,13},{3,6,7,8,9,12,13,14},{3,6,7,8,9,12,13,14,15},{3,6,7,8,9,12,13,15},{3,6,7,8,9,12,14},{3,6,7,8,9,12,14,15},{3,6,7,8,9,12,15},{3,6,7,8,9,13},{3,6,7,8,9,13,14},{3,6,7,8,9,13,14,15},{3,6,7,8,9,13,15},{3,6,7,8,9,14},{3,6,7,8,9,14,15},{3,6,7,8,9,15},{3,6,7,8,10},{3,6,7,8,10,11},{3,6,7,8,10,11,12},{3,6,7,8,10,11,12,13},{3,6,7,8,10,11,12,13,14},{3,6,7,8,10,11,12,13,14,15},{3,6,7,8,10,11,12,13,15},{3,6,7,8,10,11,12,14},{3,6,7,8,10,11,12,14,15},{3,6,7,8,10,11,12,15},{3,6,7,8,10,11,13},{3,6,7,8,10,11,13,14},{3,6,7,8,10,11,13,14,15},{3,6,7,8,10,11,13,15},{3,6,7,8,10,11,14},{3,6,7,8,10,11,14,15},{3,6,7,8,10,11,15},{3,6,7,8,10,12},{3,6,7,8,10,12,13},{3,6,7,8,10,12,13,14},{3,6,7,8,10,12,13,14,15},{3,6,7,8,10,12,13,15},{3,6,7,8,10,12,14},{3,6,7,8,10,12,14,15},{3,6,7,8,10,12,15},{3,6,7,8,10,13},{3,6,7,8,10,13,14},{3,6,7,8,10,13,14,15},{3,6,7,8,10,13,15},{3,6,7,8,10,14},{3,6,7,8,10,14,15},{3,6,7,8,10,15},{3,6,7,8,11},{3,6,7,8,11,12},{3,6,7,8,11,12,13},{3,6,7,8,11,12,13,14},{3,6,7,8,11,12,13,14,15},{3,6,7,8,11,12,13,15},{3,6,7,8,11,12,14},{3,6,7,8,11,12,14,15},{3,6,7,8,11,12,15},{3,6,7,8,11,13},{3,6,7,8,11,13,14},{3,6,7,8,11,13,14,15},{3,6,7,8,11,13,15},{3,6,7,8,11,14},{3,6,7,8,11,14,15},{3,6,7,8,11,15},{3,6,7,8,12},{3,6,7,8,12,13},{3,6,7,8,12,13,14},{3,6,7,8,12,13,14,15},{3,6,7,8,12,13,15},{3,6,7,8,12,14},{3,6,7,8,12,14,15},{3,6,7,8,12,15},{3,6,7,8,13},{3,6,7,8,13,14},{3,6,7,8,13,14,15},{3,6,7,8,13,15},{3,6,7,8,14},{3,6,7,8,14,15},{3,6,7,8,15},{3,6,7,9},{3,6,7,9,10},{3,6,7,9,10,11},{3,6,7,9,10,11,12},{3,6,7,9,10,11,12,13},{3,6,7,9,10,11,12,13,14},{3,6,7,9,10,11,12,13,14,15},{3,6,7,9,10,11,12,13,15},{3,6,7,9,10,11,12,14},{3,6,7,9,10,11,12,14,15},{3,6,7,9,10,11,12,15},{3,6,7,9,10,11,13},{3,6,7,9,10,11,13,14},{3,6,7,9,10,11,13,14,15},{3,6,7,9,10,11,13,15},{3,6,7,9,10,11,14},{3,6,7,9,10,11,14,15},{3,6,7,9,10,11,15},{3,6,7,9,10,12},{3,6,7,9,10,12,13},{3,6,7,9,10,12,13,14},{3,6,7,9,10,12,13,14,15},{3,6,7,9,10,12,13,15},{3,6,7,9,10,12,14},{3,6,7,9,10,12,14,15},{3,6,7,9,10,12,15},{3,6,7,9,10,13},{3,6,7,9,10,13,14},{3,6,7,9,10,13,14,15},{3,6,7,9,10,13,15},{3,6,7,9,10,14},{3,6,7,9,10,14,15},{3,6,7,9,10,15},{3,6,7,9,11},{3,6,7,9,11,12},{3,6,7,9,11,12,13},{3,6,7,9,11,12,13,14},{3,6,7,9,11,12,13,14,15},{3,6,7,9,11,12,13,15},{3,6,7,9,11,12,14},{3,6,7,9,11,12,14,15},{3,6,7,9,11,12,15},{3,6,7,9,11,13},{3,6,7,9,11,13,14},{3,6,7,9,11,13,14,15},{3,6,7,9,11,13,15},{3,6,7,9,11,14},{3,6,7,9,11,14,15},{3,6,7,9,11,15},{3,6,7,9,12},{3,6,7,9,12,13},{3,6,7,9,12,13,14},{3,6,7,9,12,13,14,15},{3,6,7,9,12,13,15},{3,6,7,9,12,14},{3,6,7,9,12,14,15},{3,6,7,9,12,15},{3,6,7,9,13},{3,6,7,9,13,14},{3,6,7,9,13,14,15},{3,6,7,9,13,15},{3,6,7,9,14},{3,6,7,9,14,15},{3,6,7,9,15},{3,6,7,10},{3,6,7,10,11},{3,6,7,10,11,12},{3,6,7,10,11,12,13},{3,6,7,10,11,12,13,14},{3,6,7,10,11,12,13,14,15},{3,6,7,10,11,12,13,15},{3,6,7,10,11,12,14},{3,6,7,10,11,12,14,15},{3,6,7,10,11,12,15},{3,6,7,10,11,13},{3,6,7,10,11,13,14},{3,6,7,10,11,13,14,15},{3,6,7,10,11,13,15},{3,6,7,10,11,14},{3,6,7,10,11,14,15},{3,6,7,10,11,15},{3,6,7,10,12},{3,6,7,10,12,13},{3,6,7,10,12,13,14},{3,6,7,10,12,13,14,15},{3,6,7,10,12,13,15},{3,6,7,10,12,14},{3,6,7,10,12,14,15},{3,6,7,10,12,15},{3,6,7,10,13},{3,6,7,10,13,14},{3,6,7,10,13,14,15},{3,6,7,10,13,15},{3,6,7,10,14},{3,6,7,10,14,15},{3,6,7,10,15},{3,6,7,11},{3,6,7,11,12},{3,6,7,11,12,13},{3,6,7,11,12,13,14},{3,6,7,11,12,13,14,15},{3,6,7,11,12,13,15},{3,6,7,11,12,14},{3,6,7,11,12,14,15},{3,6,7,11,12,15},{3,6,7,11,13},{3,6,7,11,13,14},{3,6,7,11,13,14,15},{3,6,7,11,13,15},{3,6,7,11,14},{3,6,7,11,14,15},{3,6,7,11,15},{3,6,7,12},{3,6,7,12,13},{3,6,7,12,13,14},{3,6,7,12,13,14,15},{3,6,7,12,13,15},{3,6,7,12,14},{3,6,7,12,14,15},{3,6,7,12,15},{3,6,7,13},{3,6,7,13,14},{3,6,7,13,14,15},{3,6,7,13,15},{3,6,7,14},{3,6,7,14,15},{3,6,7,15},{3,6,8},{3,6,8,9},{3,6,8,9,10},{3,6,8,9,10,11},{3,6,8,9,10,11,12},{3,6,8,9,10,11,12,13},{3,6,8,9,10,11,12,13,14},{3,6,8,9,10,11,12,13,14,15},{3,6,8,9,10,11,12,13,15},{3,6,8,9,10,11,12,14},{3,6,8,9,10,11,12,14,15},{3,6,8,9,10,11,12,15},{3,6,8,9,10,11,13},{3,6,8,9,10,11,13,14},{3,6,8,9,10,11,13,14,15},{3,6,8,9,10,11,13,15},{3,6,8,9,10,11,14},{3,6,8,9,10,11,14,15},{3,6,8,9,10,11,15},{3,6,8,9,10,12},{3,6,8,9,10,12,13},{3,6,8,9,10,12,13,14},{3,6,8,9,10,12,13,14,15},{3,6,8,9,10,12,13,15},{3,6,8,9,10,12,14},{3,6,8,9,10,12,14,15},{3,6,8,9,10,12,15},{3,6,8,9,10,13},{3,6,8,9,10,13,14},{3,6,8,9,10,13,14,15},{3,6,8,9,10,13,15},{3,6,8,9,10,14},{3,6,8,9,10,14,15},{3,6,8,9,10,15},{3,6,8,9,11},{3,6,8,9,11,12},{3,6,8,9,11,12,13},{3,6,8,9,11,12,13,14},{3,6,8,9,11,12,13,14,15},{3,6,8,9,11,12,13,15},{3,6,8,9,11,12,14},{3,6,8,9,11,12,14,15},{3,6,8,9,11,12,15},{3,6,8,9,11,13},{3,6,8,9,11,13,14},{3,6,8,9,11,13,14,15},{3,6,8,9,11,13,15},{3,6,8,9,11,14},{3,6,8,9,11,14,15},{3,6,8,9,11,15},{3,6,8,9,12},{3,6,8,9,12,13},{3,6,8,9,12,13,14},{3,6,8,9,12,13,14,15},{3,6,8,9,12,13,15},{3,6,8,9,12,14},{3,6,8,9,12,14,15},{3,6,8,9,12,15},{3,6,8,9,13},{3,6,8,9,13,14},{3,6,8,9,13,14,15},{3,6,8,9,13,15},{3,6,8,9,14},{3,6,8,9,14,15},{3,6,8,9,15},{3,6,8,10},{3,6,8,10,11},{3,6,8,10,11,12},{3,6,8,10,11,12,13},{3,6,8,10,11,12,13,14},{3,6,8,10,11,12,13,14,15},{3,6,8,10,11,12,13,15},{3,6,8,10,11,12,14},{3,6,8,10,11,12,14,15},{3,6,8,10,11,12,15},{3,6,8,10,11,13},{3,6,8,10,11,13,14},{3,6,8,10,11,13,14,15},{3,6,8,10,11,13,15},{3,6,8,10,11,14},{3,6,8,10,11,14,15},{3,6,8,10,11,15},{3,6,8,10,12},{3,6,8,10,12,13},{3,6,8,10,12,13,14},{3,6,8,10,12,13,14,15},{3,6,8,10,12,13,15},{3,6,8,10,12,14},{3,6,8,10,12,14,15},{3,6,8,10,12,15},{3,6,8,10,13},{3,6,8,10,13,14},{3,6,8,10,13,14,15},{3,6,8,10,13,15},{3,6,8,10,14},{3,6,8,10,14,15},{3,6,8,10,15},{3,6,8,11},{3,6,8,11,12},{3,6,8,11,12,13},{3,6,8,11,12,13,14},{3,6,8,11,12,13,14,15},{3,6,8,11,12,13,15},{3,6,8,11,12,14},{3,6,8,11,12,14,15},{3,6,8,11,12,15},{3,6,8,11,13},{3,6,8,11,13,14},{3,6,8,11,13,14,15},{3,6,8,11,13,15},{3,6,8,11,14},{3,6,8,11,14,15},{3,6,8,11,15},{3,6,8,12},{3,6,8,12,13},{3,6,8,12,13,14},{3,6,8,12,13,14,15},{3,6,8,12,13,15},{3,6,8,12,14},{3,6,8,12,14,15},{3,6,8,12,15},{3,6,8,13},{3,6,8,13,14},{3,6,8,13,14,15},{3,6,8,13,15},{3,6,8,14},{3,6,8,14,15},{3,6,8,15},{3,6,9},{3,6,9,10},{3,6,9,10,11},{3,6,9,10,11,12},{3,6,9,10,11,12,13},{3,6,9,10,11,12,13,14},{3,6,9,10,11,12,13,14,15},{3,6,9,10,11,12,13,15},{3,6,9,10,11,12,14},{3,6,9,10,11,12,14,15},{3,6,9,10,11,12,15},{3,6,9,10,11,13},{3,6,9,10,11,13,14},{3,6,9,10,11,13,14,15},{3,6,9,10,11,13,15},{3,6,9,10,11,14},{3,6,9,10,11,14,15},{3,6,9,10,11,15},{3,6,9,10,12},{3,6,9,10,12,13},{3,6,9,10,12,13,14},{3,6,9,10,12,13,14,15},{3,6,9,10,12,13,15},{3,6,9,10,12,14},{3,6,9,10,12,14,15},{3,6,9,10,12,15},{3,6,9,10,13},{3,6,9,10,13,14},{3,6,9,10,13,14,15},{3,6,9,10,13,15},{3,6,9,10,14},{3,6,9,10,14,15},{3,6,9,10,15},{3,6,9,11},{3,6,9,11,12},{3,6,9,11,12,13},{3,6,9,11,12,13,14},{3,6,9,11,12,13,14,15},{3,6,9,11,12,13,15},{3,6,9,11,12,14},{3,6,9,11,12,14,15},{3,6,9,11,12,15},{3,6,9,11,13},{3,6,9,11,13,14},{3,6,9,11,13,14,15},{3,6,9,11,13,15},{3,6,9,11,14},{3,6,9,11,14,15},{3,6,9,11,15},{3,6,9,12},{3,6,9,12,13},{3,6,9,12,13,14},{3,6,9,12,13,14,15},{3,6,9,12,13,15},{3,6,9,12,14},{3,6,9,12,14,15},{3,6,9,12,15},{3,6,9,13},{3,6,9,13,14},{3,6,9,13,14,15},{3,6,9,13,15},{3,6,9,14},{3,6,9,14,15},{3,6,9,15},{3,6,10},{3,6,10,11},{3,6,10,11,12},{3,6,10,11,12,13},{3,6,10,11,12,13,14},{3,6,10,11,12,13,14,15},{3,6,10,11,12,13,15},{3,6,10,11,12,14},{3,6,10,11,12,14,15},{3,6,10,11,12,15},{3,6,10,11,13},{3,6,10,11,13,14},{3,6,10,11,13,14,15},{3,6,10,11,13,15},{3,6,10,11,14},{3,6,10,11,14,15},{3,6,10,11,15},{3,6,10,12},{3,6,10,12,13},{3,6,10,12,13,14},{3,6,10,12,13,14,15},{3,6,10,12,13,15},{3,6,10,12,14},{3,6,10,12,14,15},{3,6,10,12,15},{3,6,10,13},{3,6,10,13,14},{3,6,10,13,14,15},{3,6,10,13,15},{3,6,10,14},{3,6,10,14,15},{3,6,10,15},{3,6,11},{3,6,11,12},{3,6,11,12,13},{3,6,11,12,13,14},{3,6,11,12,13,14,15},{3,6,11,12,13,15},{3,6,11,12,14},{3,6,11,12,14,15},{3,6,11,12,15},{3,6,11,13},{3,6,11,13,14},{3,6,11,13,14,15},{3,6,11,13,15},{3,6,11,14},{3,6,11,14,15},{3,6,11,15},{3,6,12},{3,6,12,13},{3,6,12,13,14},{3,6,12,13,14,15},{3,6,12,13,15},{3,6,12,14},{3,6,12,14,15},{3,6,12,15},{3,6,13},{3,6,13,14},{3,6,13,14,15},{3,6,13,15},{3,6,14},{3,6,14,15},{3,6,15},{3,7},{3,7,8},{3,7,8,9},{3,7,8,9,10},{3,7,8,9,10,11},{3,7,8,9,10,11,12},{3,7,8,9,10,11,12,13},{3,7,8,9,10,11,12,13,14},{3,7,8,9,10,11,12,13,14,15},{3,7,8,9,10,11,12,13,15},{3,7,8,9,10,11,12,14},{3,7,8,9,10,11,12,14,15},{3,7,8,9,10,11,12,15},{3,7,8,9,10,11,13},{3,7,8,9,10,11,13,14},{3,7,8,9,10,11,13,14,15},{3,7,8,9,10,11,13,15},{3,7,8,9,10,11,14},{3,7,8,9,10,11,14,15},{3,7,8,9,10,11,15},{3,7,8,9,10,12},{3,7,8,9,10,12,13},{3,7,8,9,10,12,13,14},{3,7,8,9,10,12,13,14,15},{3,7,8,9,10,12,13,15},{3,7,8,9,10,12,14},{3,7,8,9,10,12,14,15},{3,7,8,9,10,12,15},{3,7,8,9,10,13},{3,7,8,9,10,13,14},{3,7,8,9,10,13,14,15},{3,7,8,9,10,13,15},{3,7,8,9,10,14},{3,7,8,9,10,14,15},{3,7,8,9,10,15},{3,7,8,9,11},{3,7,8,9,11,12},{3,7,8,9,11,12,13},{3,7,8,9,11,12,13,14},{3,7,8,9,11,12,13,14,15},{3,7,8,9,11,12,13,15},{3,7,8,9,11,12,14},{3,7,8,9,11,12,14,15},{3,7,8,9,11,12,15},{3,7,8,9,11,13},{3,7,8,9,11,13,14},{3,7,8,9,11,13,14,15},{3,7,8,9,11,13,15},{3,7,8,9,11,14},{3,7,8,9,11,14,15},{3,7,8,9,11,15},{3,7,8,9,12},{3,7,8,9,12,13},{3,7,8,9,12,13,14},{3,7,8,9,12,13,14,15},{3,7,8,9,12,13,15},{3,7,8,9,12,14},{3,7,8,9,12,14,15},{3,7,8,9,12,15},{3,7,8,9,13},{3,7,8,9,13,14},{3,7,8,9,13,14,15},{3,7,8,9,13,15},{3,7,8,9,14},{3,7,8,9,14,15},{3,7,8,9,15},{3,7,8,10},{3,7,8,10,11},{3,7,8,10,11,12},{3,7,8,10,11,12,13},{3,7,8,10,11,12,13,14},{3,7,8,10,11,12,13,14,15},{3,7,8,10,11,12,13,15},{3,7,8,10,11,12,14},{3,7,8,10,11,12,14,15},{3,7,8,10,11,12,15},{3,7,8,10,11,13},{3,7,8,10,11,13,14},{3,7,8,10,11,13,14,15},{3,7,8,10,11,13,15},{3,7,8,10,11,14},{3,7,8,10,11,14,15},{3,7,8,10,11,15},{3,7,8,10,12},{3,7,8,10,12,13},{3,7,8,10,12,13,14},{3,7,8,10,12,13,14,15},{3,7,8,10,12,13,15},{3,7,8,10,12,14},{3,7,8,10,12,14,15},{3,7,8,10,12,15},{3,7,8,10,13},{3,7,8,10,13,14},{3,7,8,10,13,14,15},{3,7,8,10,13,15},{3,7,8,10,14},{3,7,8,10,14,15},{3,7,8,10,15},{3,7,8,11},{3,7,8,11,12},{3,7,8,11,12,13},{3,7,8,11,12,13,14},{3,7,8,11,12,13,14,15},{3,7,8,11,12,13,15},{3,7,8,11,12,14},{3,7,8,11,12,14,15},{3,7,8,11,12,15},{3,7,8,11,13},{3,7,8,11,13,14},{3,7,8,11,13,14,15},{3,7,8,11,13,15},{3,7,8,11,14},{3,7,8,11,14,15},{3,7,8,11,15},{3,7,8,12},{3,7,8,12,13},{3,7,8,12,13,14},{3,7,8,12,13,14,15},{3,7,8,12,13,15},{3,7,8,12,14},{3,7,8,12,14,15},{3,7,8,12,15},{3,7,8,13},{3,7,8,13,14},{3,7,8,13,14,15},{3,7,8,13,15},{3,7,8,14},{3,7,8,14,15},{3,7,8,15},{3,7,9},{3,7,9,10},{3,7,9,10,11},{3,7,9,10,11,12},{3,7,9,10,11,12,13},{3,7,9,10,11,12,13,14},{3,7,9,10,11,12,13,14,15},{3,7,9,10,11,12,13,15},{3,7,9,10,11,12,14},{3,7,9,10,11,12,14,15},{3,7,9,10,11,12,15},{3,7,9,10,11,13},{3,7,9,10,11,13,14},{3,7,9,10,11,13,14,15},{3,7,9,10,11,13,15},{3,7,9,10,11,14},{3,7,9,10,11,14,15},{3,7,9,10,11,15},{3,7,9,10,12},{3,7,9,10,12,13},{3,7,9,10,12,13,14},{3,7,9,10,12,13,14,15},{3,7,9,10,12,13,15},{3,7,9,10,12,14},{3,7,9,10,12,14,15},{3,7,9,10,12,15},{3,7,9,10,13},{3,7,9,10,13,14},{3,7,9,10,13,14,15},{3,7,9,10,13,15},{3,7,9,10,14},{3,7,9,10,14,15},{3,7,9,10,15},{3,7,9,11},{3,7,9,11,12},{3,7,9,11,12,13},{3,7,9,11,12,13,14},{3,7,9,11,12,13,14,15},{3,7,9,11,12,13,15},{3,7,9,11,12,14},{3,7,9,11,12,14,15},{3,7,9,11,12,15},{3,7,9,11,13},{3,7,9,11,13,14},{3,7,9,11,13,14,15},{3,7,9,11,13,15},{3,7,9,11,14},{3,7,9,11,14,15},{3,7,9,11,15},{3,7,9,12},{3,7,9,12,13},{3,7,9,12,13,14},{3,7,9,12,13,14,15},{3,7,9,12,13,15},{3,7,9,12,14},{3,7,9,12,14,15},{3,7,9,12,15},{3,7,9,13},{3,7,9,13,14},{3,7,9,13,14,15},{3,7,9,13,15},{3,7,9,14},{3,7,9,14,15},{3,7,9,15},{3,7,10},{3,7,10,11},{3,7,10,11,12},{3,7,10,11,12,13},{3,7,10,11,12,13,14},{3,7,10,11,12,13,14,15},{3,7,10,11,12,13,15},{3,7,10,11,12,14},{3,7,10,11,12,14,15},{3,7,10,11,12,15},{3,7,10,11,13},{3,7,10,11,13,14},{3,7,10,11,13,14,15},{3,7,10,11,13,15},{3,7,10,11,14},{3,7,10,11,14,15},{3,7,10,11,15},{3,7,10,12},{3,7,10,12,13},{3,7,10,12,13,14},{3,7,10,12,13,14,15},{3,7,10,12,13,15},{3,7,10,12,14},{3,7,10,12,14,15},{3,7,10,12,15},{3,7,10,13},{3,7,10,13,14},{3,7,10,13,14,15},{3,7,10,13,15},{3,7,10,14},{3,7,10,14,15},{3,7,10,15},{3,7,11},{3,7,11,12},{3,7,11,12,13},{3,7,11,12,13,14},{3,7,11,12,13,14,15},{3,7,11,12,13,15},{3,7,11,12,14},{3,7,11,12,14,15},{3,7,11,12,15},{3,7,11,13},{3,7,11,13,14},{3,7,11,13,14,15},{3,7,11,13,15},{3,7,11,14},{3,7,11,14,15},{3,7,11,15},{3,7,12},{3,7,12,13},{3,7,12,13,14},{3,7,12,13,14,15},{3,7,12,13,15},{3,7,12,14},{3,7,12,14,15},{3,7,12,15},{3,7,13},{3,7,13,14},{3,7,13,14,15},{3,7,13,15},{3,7,14},{3,7,14,15},{3,7,15},{3,8},{3,8,9},{3,8,9,10},{3,8,9,10,11},{3,8,9,10,11,12},{3,8,9,10,11,12,13},{3,8,9,10,11,12,13,14},{3,8,9,10,11,12,13,14,15},{3,8,9,10,11,12,13,15},{3,8,9,10,11,12,14},{3,8,9,10,11,12,14,15},{3,8,9,10,11,12,15},{3,8,9,10,11,13},{3,8,9,10,11,13,14},{3,8,9,10,11,13,14,15},{3,8,9,10,11,13,15},{3,8,9,10,11,14},{3,8,9,10,11,14,15},{3,8,9,10,11,15},{3,8,9,10,12},{3,8,9,10,12,13},{3,8,9,10,12,13,14},{3,8,9,10,12,13,14,15},{3,8,9,10,12,13,15},{3,8,9,10,12,14},{3,8,9,10,12,14,15},{3,8,9,10,12,15},{3,8,9,10,13},{3,8,9,10,13,14},{3,8,9,10,13,14,15},{3,8,9,10,13,15},{3,8,9,10,14},{3,8,9,10,14,15},{3,8,9,10,15},{3,8,9,11},{3,8,9,11,12},{3,8,9,11,12,13},{3,8,9,11,12,13,14},{3,8,9,11,12,13,14,15},{3,8,9,11,12,13,15},{3,8,9,11,12,14},{3,8,9,11,12,14,15},{3,8,9,11,12,15},{3,8,9,11,13},{3,8,9,11,13,14},{3,8,9,11,13,14,15},{3,8,9,11,13,15},{3,8,9,11,14},{3,8,9,11,14,15},{3,8,9,11,15},{3,8,9,12},{3,8,9,12,13},{3,8,9,12,13,14},{3,8,9,12,13,14,15},{3,8,9,12,13,15},{3,8,9,12,14},{3,8,9,12,14,15},{3,8,9,12,15},{3,8,9,13},{3,8,9,13,14},{3,8,9,13,14,15},{3,8,9,13,15},{3,8,9,14},{3,8,9,14,15},{3,8,9,15},{3,8,10},{3,8,10,11},{3,8,10,11,12},{3,8,10,11,12,13},{3,8,10,11,12,13,14},{3,8,10,11,12,13,14,15},{3,8,10,11,12,13,15},{3,8,10,11,12,14},{3,8,10,11,12,14,15},{3,8,10,11,12,15},{3,8,10,11,13},{3,8,10,11,13,14},{3,8,10,11,13,14,15},{3,8,10,11,13,15},{3,8,10,11,14},{3,8,10,11,14,15},{3,8,10,11,15},{3,8,10,12},{3,8,10,12,13},{3,8,10,12,13,14},{3,8,10,12,13,14,15},{3,8,10,12,13,15},{3,8,10,12,14},{3,8,10,12,14,15},{3,8,10,12,15},{3,8,10,13},{3,8,10,13,14},{3,8,10,13,14,15},{3,8,10,13,15},{3,8,10,14},{3,8,10,14,15},{3,8,10,15},{3,8,11},{3,8,11,12},{3,8,11,12,13},{3,8,11,12,13,14},{3,8,11,12,13,14,15},{3,8,11,12,13,15},{3,8,11,12,14},{3,8,11,12,14,15},{3,8,11,12,15},{3,8,11,13},{3,8,11,13,14},{3,8,11,13,14,15},{3,8,11,13,15},{3,8,11,14},{3,8,11,14,15},{3,8,11,15},{3,8,12},{3,8,12,13},{3,8,12,13,14},{3,8,12,13,14,15},{3,8,12,13,15},{3,8,12,14},{3,8,12,14,15},{3,8,12,15},{3,8,13},{3,8,13,14},{3,8,13,14,15},{3,8,13,15},{3,8,14},{3,8,14,15},{3,8,15},{3,9},{3,9,10},{3,9,10,11},{3,9,10,11,12},{3,9,10,11,12,13},{3,9,10,11,12,13,14},{3,9,10,11,12,13,14,15},{3,9,10,11,12,13,15},{3,9,10,11,12,14},{3,9,10,11,12,14,15},{3,9,10,11,12,15},{3,9,10,11,13},{3,9,10,11,13,14},{3,9,10,11,13,14,15},{3,9,10,11,13,15},{3,9,10,11,14},{3,9,10,11,14,15},{3,9,10,11,15},{3,9,10,12},{3,9,10,12,13},{3,9,10,12,13,14},{3,9,10,12,13,14,15},{3,9,10,12,13,15},{3,9,10,12,14},{3,9,10,12,14,15},{3,9,10,12,15},{3,9,10,13},{3,9,10,13,14},{3,9,10,13,14,15},{3,9,10,13,15},{3,9,10,14},{3,9,10,14,15},{3,9,10,15},{3,9,11},{3,9,11,12},{3,9,11,12,13},{3,9,11,12,13,14},{3,9,11,12,13,14,15},{3,9,11,12,13,15},{3,9,11,12,14},{3,9,11,12,14,15},{3,9,11,12,15},{3,9,11,13},{3,9,11,13,14},{3,9,11,13,14,15},{3,9,11,13,15},{3,9,11,14},{3,9,11,14,15},{3,9,11,15},{3,9,12},{3,9,12,13},{3,9,12,13,14},{3,9,12,13,14,15},{3,9,12,13,15},{3,9,12,14},{3,9,12,14,15},{3,9,12,15},{3,9,13},{3,9,13,14},{3,9,13,14,15},{3,9,13,15},{3,9,14},{3,9,14,15},{3,9,15},{3,10},{3,10,11},{3,10,11,12},{3,10,11,12,13},{3,10,11,12,13,14},{3,10,11,12,13,14,15},{3,10,11,12,13,15},{3,10,11,12,14},{3,10,11,12,14,15},{3,10,11,12,15},{3,10,11,13},{3,10,11,13,14},{3,10,11,13,14,15},{3,10,11,13,15},{3,10,11,14},{3,10,11,14,15},{3,10,11,15},{3,10,12},{3,10,12,13},{3,10,12,13,14},{3,10,12,13,14,15},{3,10,12,13,15},{3,10,12,14},{3,10,12,14,15},{3,10,12,15},{3,10,13},{3,10,13,14},{3,10,13,14,15},{3,10,13,15},{3,10,14},{3,10,14,15},{3,10,15},{3,11},{3,11,12},{3,11,12,13},{3,11,12,13,14},{3,11,12,13,14,15},{3,11,12,13,15},{3,11,12,14},{3,11,12,14,15},{3,11,12,15},{3,11,13},{3,11,13,14},{3,11,13,14,15},{3,11,13,15},{3,11,14},{3,11,14,15},{3,11,15},{3,12},{3,12,13},{3,12,13,14},{3,12,13,14,15},{3,12,13,15},{3,12,14},{3,12,14,15},{3,12,15},{3,13},{3,13,14},{3,13,14,15},{3,13,15},{3,14},{3,14,15},{3,15},{4,5},{4,5,6},{4,5,6,7},{4,5,6,7,8},{4,5,6,7,8,9},{4,5,6,7,8,9,10},{4,5,6,7,8,9,10,11},{4,5,6,7,8,9,10,11,12},{4,5,6,7,8,9,10,11,12,13},{4,5,6,7,8,9,10,11,12,13,14},{4,5,6,7,8,9,10,11,12,13,14,15},{4,5,6,7,8,9,10,11,12,13,15},{4,5,6,7,8,9,10,11,12,14},{4,5,6,7,8,9,10,11,12,14,15},{4,5,6,7,8,9,10,11,12,15},{4,5,6,7,8,9,10,11,13},{4,5,6,7,8,9,10,11,13,14},{4,5,6,7,8,9,10,11,13,14,15},{4,5,6,7,8,9,10,11,13,15},{4,5,6,7,8,9,10,11,14},{4,5,6,7,8,9,10,11,14,15},{4,5,6,7,8,9,10,11,15},{4,5,6,7,8,9,10,12},{4,5,6,7,8,9,10,12,13},{4,5,6,7,8,9,10,12,13,14},{4,5,6,7,8,9,10,12,13,14,15},{4,5,6,7,8,9,10,12,13,15},{4,5,6,7,8,9,10,12,14},{4,5,6,7,8,9,10,12,14,15},{4,5,6,7,8,9,10,12,15},{4,5,6,7,8,9,10,13},{4,5,6,7,8,9,10,13,14},{4,5,6,7,8,9,10,13,14,15},{4,5,6,7,8,9,10,13,15},{4,5,6,7,8,9,10,14},{4,5,6,7,8,9,10,14,15},{4,5,6,7,8,9,10,15},{4,5,6,7,8,9,11},{4,5,6,7,8,9,11,12},{4,5,6,7,8,9,11,12,13},{4,5,6,7,8,9,11,12,13,14},{4,5,6,7,8,9,11,12,13,14,15},{4,5,6,7,8,9,11,12,13,15},{4,5,6,7,8,9,11,12,14},{4,5,6,7,8,9,11,12,14,15},{4,5,6,7,8,9,11,12,15},{4,5,6,7,8,9,11,13},{4,5,6,7,8,9,11,13,14},{4,5,6,7,8,9,11,13,14,15},{4,5,6,7,8,9,11,13,15},{4,5,6,7,8,9,11,14},{4,5,6,7,8,9,11,14,15},{4,5,6,7,8,9,11,15},{4,5,6,7,8,9,12},{4,5,6,7,8,9,12,13},{4,5,6,7,8,9,12,13,14},{4,5,6,7,8,9,12,13,14,15},{4,5,6,7,8,9,12,13,15},{4,5,6,7,8,9,12,14},{4,5,6,7,8,9,12,14,15},{4,5,6,7,8,9,12,15},{4,5,6,7,8,9,13},{4,5,6,7,8,9,13,14},{4,5,6,7,8,9,13,14,15},{4,5,6,7,8,9,13,15},{4,5,6,7,8,9,14},{4,5,6,7,8,9,14,15},{4,5,6,7,8,9,15},{4,5,6,7,8,10},{4,5,6,7,8,10,11},{4,5,6,7,8,10,11,12},{4,5,6,7,8,10,11,12,13},{4,5,6,7,8,10,11,12,13,14},{4,5,6,7,8,10,11,12,13,14,15},{4,5,6,7,8,10,11,12,13,15},{4,5,6,7,8,10,11,12,14},{4,5,6,7,8,10,11,12,14,15},{4,5,6,7,8,10,11,12,15},{4,5,6,7,8,10,11,13},{4,5,6,7,8,10,11,13,14},{4,5,6,7,8,10,11,13,14,15},{4,5,6,7,8,10,11,13,15},{4,5,6,7,8,10,11,14},{4,5,6,7,8,10,11,14,15},{4,5,6,7,8,10,11,15},{4,5,6,7,8,10,12},{4,5,6,7,8,10,12,13},{4,5,6,7,8,10,12,13,14},{4,5,6,7,8,10,12,13,14,15},{4,5,6,7,8,10,12,13,15},{4,5,6,7,8,10,12,14},{4,5,6,7,8,10,12,14,15},{4,5,6,7,8,10,12,15},{4,5,6,7,8,10,13},{4,5,6,7,8,10,13,14},{4,5,6,7,8,10,13,14,15},{4,5,6,7,8,10,13,15},{4,5,6,7,8,10,14},{4,5,6,7,8,10,14,15},{4,5,6,7,8,10,15},{4,5,6,7,8,11},{4,5,6,7,8,11,12},{4,5,6,7,8,11,12,13},{4,5,6,7,8,11,12,13,14},{4,5,6,7,8,11,12,13,14,15},{4,5,6,7,8,11,12,13,15},{4,5,6,7,8,11,12,14},{4,5,6,7,8,11,12,14,15},{4,5,6,7,8,11,12,15},{4,5,6,7,8,11,13},{4,5,6,7,8,11,13,14},{4,5,6,7,8,11,13,14,15},{4,5,6,7,8,11,13,15},{4,5,6,7,8,11,14},{4,5,6,7,8,11,14,15},{4,5,6,7,8,11,15},{4,5,6,7,8,12},{4,5,6,7,8,12,13},{4,5,6,7,8,12,13,14},{4,5,6,7,8,12,13,14,15},{4,5,6,7,8,12,13,15},{4,5,6,7,8,12,14},{4,5,6,7,8,12,14,15},{4,5,6,7,8,12,15},{4,5,6,7,8,13},{4,5,6,7,8,13,14},{4,5,6,7,8,13,14,15},{4,5,6,7,8,13,15},{4,5,6,7,8,14},{4,5,6,7,8,14,15},{4,5,6,7,8,15},{4,5,6,7,9},{4,5,6,7,9,10},{4,5,6,7,9,10,11},{4,5,6,7,9,10,11,12},{4,5,6,7,9,10,11,12,13},{4,5,6,7,9,10,11,12,13,14},{4,5,6,7,9,10,11,12,13,14,15},{4,5,6,7,9,10,11,12,13,15},{4,5,6,7,9,10,11,12,14},{4,5,6,7,9,10,11,12,14,15},{4,5,6,7,9,10,11,12,15},{4,5,6,7,9,10,11,13},{4,5,6,7,9,10,11,13,14},{4,5,6,7,9,10,11,13,14,15},{4,5,6,7,9,10,11,13,15},{4,5,6,7,9,10,11,14},{4,5,6,7,9,10,11,14,15},{4,5,6,7,9,10,11,15},{4,5,6,7,9,10,12},{4,5,6,7,9,10,12,13},{4,5,6,7,9,10,12,13,14},{4,5,6,7,9,10,12,13,14,15},{4,5,6,7,9,10,12,13,15},{4,5,6,7,9,10,12,14},{4,5,6,7,9,10,12,14,15},{4,5,6,7,9,10,12,15},{4,5,6,7,9,10,13},{4,5,6,7,9,10,13,14},{4,5,6,7,9,10,13,14,15},{4,5,6,7,9,10,13,15},{4,5,6,7,9,10,14},{4,5,6,7,9,10,14,15},{4,5,6,7,9,10,15},{4,5,6,7,9,11},{4,5,6,7,9,11,12},{4,5,6,7,9,11,12,13},{4,5,6,7,9,11,12,13,14},{4,5,6,7,9,11,12,13,14,15},{4,5,6,7,9,11,12,13,15},{4,5,6,7,9,11,12,14},{4,5,6,7,9,11,12,14,15},{4,5,6,7,9,11,12,15},{4,5,6,7,9,11,13},{4,5,6,7,9,11,13,14},{4,5,6,7,9,11,13,14,15},{4,5,6,7,9,11,13,15},{4,5,6,7,9,11,14},{4,5,6,7,9,11,14,15},{4,5,6,7,9,11,15},{4,5,6,7,9,12},{4,5,6,7,9,12,13},{4,5,6,7,9,12,13,14},{4,5,6,7,9,12,13,14,15},{4,5,6,7,9,12,13,15},{4,5,6,7,9,12,14},{4,5,6,7,9,12,14,15},{4,5,6,7,9,12,15},{4,5,6,7,9,13},{4,5,6,7,9,13,14},{4,5,6,7,9,13,14,15},{4,5,6,7,9,13,15},{4,5,6,7,9,14},{4,5,6,7,9,14,15},{4,5,6,7,9,15},{4,5,6,7,10},{4,5,6,7,10,11},{4,5,6,7,10,11,12},{4,5,6,7,10,11,12,13},{4,5,6,7,10,11,12,13,14},{4,5,6,7,10,11,12,13,14,15},{4,5,6,7,10,11,12,13,15},{4,5,6,7,10,11,12,14},{4,5,6,7,10,11,12,14,15},{4,5,6,7,10,11,12,15},{4,5,6,7,10,11,13},{4,5,6,7,10,11,13,14},{4,5,6,7,10,11,13,14,15},{4,5,6,7,10,11,13,15},{4,5,6,7,10,11,14},{4,5,6,7,10,11,14,15},{4,5,6,7,10,11,15},{4,5,6,7,10,12},{4,5,6,7,10,12,13},{4,5,6,7,10,12,13,14},{4,5,6,7,10,12,13,14,15},{4,5,6,7,10,12,13,15},{4,5,6,7,10,12,14},{4,5,6,7,10,12,14,15},{4,5,6,7,10,12,15},{4,5,6,7,10,13},{4,5,6,7,10,13,14},{4,5,6,7,10,13,14,15},{4,5,6,7,10,13,15},{4,5,6,7,10,14},{4,5,6,7,10,14,15},{4,5,6,7,10,15},{4,5,6,7,11},{4,5,6,7,11,12},{4,5,6,7,11,12,13},{4,5,6,7,11,12,13,14},{4,5,6,7,11,12,13,14,15},{4,5,6,7,11,12,13,15},{4,5,6,7,11,12,14},{4,5,6,7,11,12,14,15},{4,5,6,7,11,12,15},{4,5,6,7,11,13},{4,5,6,7,11,13,14},{4,5,6,7,11,13,14,15},{4,5,6,7,11,13,15},{4,5,6,7,11,14},{4,5,6,7,11,14,15},{4,5,6,7,11,15},{4,5,6,7,12},{4,5,6,7,12,13},{4,5,6,7,12,13,14},{4,5,6,7,12,13,14,15},{4,5,6,7,12,13,15},{4,5,6,7,12,14},{4,5,6,7,12,14,15},{4,5,6,7,12,15},{4,5,6,7,13},{4,5,6,7,13,14},{4,5,6,7,13,14,15},{4,5,6,7,13,15},{4,5,6,7,14},{4,5,6,7,14,15},{4,5,6,7,15},{4,5,6,8},{4,5,6,8,9},{4,5,6,8,9,10},{4,5,6,8,9,10,11},{4,5,6,8,9,10,11,12},{4,5,6,8,9,10,11,12,13},{4,5,6,8,9,10,11,12,13,14},{4,5,6,8,9,10,11,12,13,14,15},{4,5,6,8,9,10,11,12,13,15},{4,5,6,8,9,10,11,12,14},{4,5,6,8,9,10,11,12,14,15},{4,5,6,8,9,10,11,12,15},{4,5,6,8,9,10,11,13},{4,5,6,8,9,10,11,13,14},{4,5,6,8,9,10,11,13,14,15},{4,5,6,8,9,10,11,13,15},{4,5,6,8,9,10,11,14},{4,5,6,8,9,10,11,14,15},{4,5,6,8,9,10,11,15},{4,5,6,8,9,10,12},{4,5,6,8,9,10,12,13},{4,5,6,8,9,10,12,13,14},{4,5,6,8,9,10,12,13,14,15},{4,5,6,8,9,10,12,13,15},{4,5,6,8,9,10,12,14},{4,5,6,8,9,10,12,14,15},{4,5,6,8,9,10,12,15},{4,5,6,8,9,10,13},{4,5,6,8,9,10,13,14},{4,5,6,8,9,10,13,14,15},{4,5,6,8,9,10,13,15},{4,5,6,8,9,10,14},{4,5,6,8,9,10,14,15},{4,5,6,8,9,10,15},{4,5,6,8,9,11},{4,5,6,8,9,11,12},{4,5,6,8,9,11,12,13},{4,5,6,8,9,11,12,13,14},{4,5,6,8,9,11,12,13,14,15},{4,5,6,8,9,11,12,13,15},{4,5,6,8,9,11,12,14},{4,5,6,8,9,11,12,14,15},{4,5,6,8,9,11,12,15},{4,5,6,8,9,11,13},{4,5,6,8,9,11,13,14},{4,5,6,8,9,11,13,14,15},{4,5,6,8,9,11,13,15},{4,5,6,8,9,11,14},{4,5,6,8,9,11,14,15},{4,5,6,8,9,11,15},{4,5,6,8,9,12},{4,5,6,8,9,12,13},{4,5,6,8,9,12,13,14},{4,5,6,8,9,12,13,14,15},{4,5,6,8,9,12,13,15},{4,5,6,8,9,12,14},{4,5,6,8,9,12,14,15},{4,5,6,8,9,12,15},{4,5,6,8,9,13},{4,5,6,8,9,13,14},{4,5,6,8,9,13,14,15},{4,5,6,8,9,13,15},{4,5,6,8,9,14},{4,5,6,8,9,14,15},{4,5,6,8,9,15},{4,5,6,8,10},{4,5,6,8,10,11},{4,5,6,8,10,11,12},{4,5,6,8,10,11,12,13},{4,5,6,8,10,11,12,13,14},{4,5,6,8,10,11,12,13,14,15},{4,5,6,8,10,11,12,13,15},{4,5,6,8,10,11,12,14},{4,5,6,8,10,11,12,14,15},{4,5,6,8,10,11,12,15},{4,5,6,8,10,11,13},{4,5,6,8,10,11,13,14},{4,5,6,8,10,11,13,14,15},{4,5,6,8,10,11,13,15},{4,5,6,8,10,11,14},{4,5,6,8,10,11,14,15},{4,5,6,8,10,11,15},{4,5,6,8,10,12},{4,5,6,8,10,12,13},{4,5,6,8,10,12,13,14},{4,5,6,8,10,12,13,14,15},{4,5,6,8,10,12,13,15},{4,5,6,8,10,12,14},{4,5,6,8,10,12,14,15},{4,5,6,8,10,12,15},{4,5,6,8,10,13},{4,5,6,8,10,13,14},{4,5,6,8,10,13,14,15},{4,5,6,8,10,13,15},{4,5,6,8,10,14},{4,5,6,8,10,14,15},{4,5,6,8,10,15},{4,5,6,8,11},{4,5,6,8,11,12},{4,5,6,8,11,12,13},{4,5,6,8,11,12,13,14},{4,5,6,8,11,12,13,14,15},{4,5,6,8,11,12,13,15},{4,5,6,8,11,12,14},{4,5,6,8,11,12,14,15},{4,5,6,8,11,12,15},{4,5,6,8,11,13},{4,5,6,8,11,13,14},{4,5,6,8,11,13,14,15},{4,5,6,8,11,13,15},{4,5,6,8,11,14},{4,5,6,8,11,14,15},{4,5,6,8,11,15},{4,5,6,8,12},{4,5,6,8,12,13},{4,5,6,8,12,13,14},{4,5,6,8,12,13,14,15},{4,5,6,8,12,13,15},{4,5,6,8,12,14},{4,5,6,8,12,14,15},{4,5,6,8,12,15},{4,5,6,8,13},{4,5,6,8,13,14},{4,5,6,8,13,14,15},{4,5,6,8,13,15},{4,5,6,8,14},{4,5,6,8,14,15},{4,5,6,8,15},{4,5,6,9},{4,5,6,9,10},{4,5,6,9,10,11},{4,5,6,9,10,11,12},{4,5,6,9,10,11,12,13},{4,5,6,9,10,11,12,13,14},{4,5,6,9,10,11,12,13,14,15},{4,5,6,9,10,11,12,13,15},{4,5,6,9,10,11,12,14},{4,5,6,9,10,11,12,14,15},{4,5,6,9,10,11,12,15},{4,5,6,9,10,11,13},{4,5,6,9,10,11,13,14},{4,5,6,9,10,11,13,14,15},{4,5,6,9,10,11,13,15},{4,5,6,9,10,11,14},{4,5,6,9,10,11,14,15},{4,5,6,9,10,11,15},{4,5,6,9,10,12},{4,5,6,9,10,12,13},{4,5,6,9,10,12,13,14},{4,5,6,9,10,12,13,14,15},{4,5,6,9,10,12,13,15},{4,5,6,9,10,12,14},{4,5,6,9,10,12,14,15},{4,5,6,9,10,12,15},{4,5,6,9,10,13},{4,5,6,9,10,13,14},{4,5,6,9,10,13,14,15},{4,5,6,9,10,13,15},{4,5,6,9,10,14},{4,5,6,9,10,14,15},{4,5,6,9,10,15},{4,5,6,9,11},{4,5,6,9,11,12},{4,5,6,9,11,12,13},{4,5,6,9,11,12,13,14},{4,5,6,9,11,12,13,14,15},{4,5,6,9,11,12,13,15},{4,5,6,9,11,12,14},{4,5,6,9,11,12,14,15},{4,5,6,9,11,12,15},{4,5,6,9,11,13},{4,5,6,9,11,13,14},{4,5,6,9,11,13,14,15},{4,5,6,9,11,13,15},{4,5,6,9,11,14},{4,5,6,9,11,14,15},{4,5,6,9,11,15},{4,5,6,9,12},{4,5,6,9,12,13},{4,5,6,9,12,13,14},{4,5,6,9,12,13,14,15},{4,5,6,9,12,13,15},{4,5,6,9,12,14},{4,5,6,9,12,14,15},{4,5,6,9,12,15},{4,5,6,9,13},{4,5,6,9,13,14},{4,5,6,9,13,14,15},{4,5,6,9,13,15},{4,5,6,9,14},{4,5,6,9,14,15},{4,5,6,9,15},{4,5,6,10},{4,5,6,10,11},{4,5,6,10,11,12},{4,5,6,10,11,12,13},{4,5,6,10,11,12,13,14},{4,5,6,10,11,12,13,14,15},{4,5,6,10,11,12,13,15},{4,5,6,10,11,12,14},{4,5,6,10,11,12,14,15},{4,5,6,10,11,12,15},{4,5,6,10,11,13},{4,5,6,10,11,13,14},{4,5,6,10,11,13,14,15},{4,5,6,10,11,13,15},{4,5,6,10,11,14},{4,5,6,10,11,14,15},{4,5,6,10,11,15},{4,5,6,10,12},{4,5,6,10,12,13},{4,5,6,10,12,13,14},{4,5,6,10,12,13,14,15},{4,5,6,10,12,13,15},{4,5,6,10,12,14},{4,5,6,10,12,14,15},{4,5,6,10,12,15},{4,5,6,10,13},{4,5,6,10,13,14},{4,5,6,10,13,14,15},{4,5,6,10,13,15},{4,5,6,10,14},{4,5,6,10,14,15},{4,5,6,10,15},{4,5,6,11},{4,5,6,11,12},{4,5,6,11,12,13},{4,5,6,11,12,13,14},{4,5,6,11,12,13,14,15},{4,5,6,11,12,13,15},{4,5,6,11,12,14},{4,5,6,11,12,14,15},{4,5,6,11,12,15},{4,5,6,11,13},{4,5,6,11,13,14},{4,5,6,11,13,14,15},{4,5,6,11,13,15},{4,5,6,11,14},{4,5,6,11,14,15},{4,5,6,11,15},{4,5,6,12},{4,5,6,12,13},{4,5,6,12,13,14},{4,5,6,12,13,14,15},{4,5,6,12,13,15},{4,5,6,12,14},{4,5,6,12,14,15},{4,5,6,12,15},{4,5,6,13},{4,5,6,13,14},{4,5,6,13,14,15},{4,5,6,13,15},{4,5,6,14},{4,5,6,14,15},{4,5,6,15},{4,5,7},{4,5,7,8},{4,5,7,8,9},{4,5,7,8,9,10},{4,5,7,8,9,10,11},{4,5,7,8,9,10,11,12},{4,5,7,8,9,10,11,12,13},{4,5,7,8,9,10,11,12,13,14},{4,5,7,8,9,10,11,12,13,14,15},{4,5,7,8,9,10,11,12,13,15},{4,5,7,8,9,10,11,12,14},{4,5,7,8,9,10,11,12,14,15},{4,5,7,8,9,10,11,12,15},{4,5,7,8,9,10,11,13},{4,5,7,8,9,10,11,13,14},{4,5,7,8,9,10,11,13,14,15},{4,5,7,8,9,10,11,13,15},{4,5,7,8,9,10,11,14},{4,5,7,8,9,10,11,14,15},{4,5,7,8,9,10,11,15},{4,5,7,8,9,10,12},{4,5,7,8,9,10,12,13},{4,5,7,8,9,10,12,13,14},{4,5,7,8,9,10,12,13,14,15},{4,5,7,8,9,10,12,13,15},{4,5,7,8,9,10,12,14},{4,5,7,8,9,10,12,14,15},{4,5,7,8,9,10,12,15},{4,5,7,8,9,10,13},{4,5,7,8,9,10,13,14},{4,5,7,8,9,10,13,14,15},{4,5,7,8,9,10,13,15},{4,5,7,8,9,10,14},{4,5,7,8,9,10,14,15},{4,5,7,8,9,10,15},{4,5,7,8,9,11},{4,5,7,8,9,11,12},{4,5,7,8,9,11,12,13},{4,5,7,8,9,11,12,13,14},{4,5,7,8,9,11,12,13,14,15},{4,5,7,8,9,11,12,13,15},{4,5,7,8,9,11,12,14},{4,5,7,8,9,11,12,14,15},{4,5,7,8,9,11,12,15},{4,5,7,8,9,11,13},{4,5,7,8,9,11,13,14},{4,5,7,8,9,11,13,14,15},{4,5,7,8,9,11,13,15},{4,5,7,8,9,11,14},{4,5,7,8,9,11,14,15},{4,5,7,8,9,11,15},{4,5,7,8,9,12},{4,5,7,8,9,12,13},{4,5,7,8,9,12,13,14},{4,5,7,8,9,12,13,14,15},{4,5,7,8,9,12,13,15},{4,5,7,8,9,12,14},{4,5,7,8,9,12,14,15},{4,5,7,8,9,12,15},{4,5,7,8,9,13},{4,5,7,8,9,13,14},{4,5,7,8,9,13,14,15},{4,5,7,8,9,13,15},{4,5,7,8,9,14},{4,5,7,8,9,14,15},{4,5,7,8,9,15},{4,5,7,8,10},{4,5,7,8,10,11},{4,5,7,8,10,11,12},{4,5,7,8,10,11,12,13},{4,5,7,8,10,11,12,13,14},{4,5,7,8,10,11,12,13,14,15},{4,5,7,8,10,11,12,13,15},{4,5,7,8,10,11,12,14},{4,5,7,8,10,11,12,14,15},{4,5,7,8,10,11,12,15},{4,5,7,8,10,11,13},{4,5,7,8,10,11,13,14},{4,5,7,8,10,11,13,14,15},{4,5,7,8,10,11,13,15},{4,5,7,8,10,11,14},{4,5,7,8,10,11,14,15},{4,5,7,8,10,11,15},{4,5,7,8,10,12},{4,5,7,8,10,12,13},{4,5,7,8,10,12,13,14},{4,5,7,8,10,12,13,14,15},{4,5,7,8,10,12,13,15},{4,5,7,8,10,12,14},{4,5,7,8,10,12,14,15},{4,5,7,8,10,12,15},{4,5,7,8,10,13},{4,5,7,8,10,13,14},{4,5,7,8,10,13,14,15},{4,5,7,8,10,13,15},{4,5,7,8,10,14},{4,5,7,8,10,14,15},{4,5,7,8,10,15},{4,5,7,8,11},{4,5,7,8,11,12},{4,5,7,8,11,12,13},{4,5,7,8,11,12,13,14},{4,5,7,8,11,12,13,14,15},{4,5,7,8,11,12,13,15},{4,5,7,8,11,12,14},{4,5,7,8,11,12,14,15},{4,5,7,8,11,12,15},{4,5,7,8,11,13},{4,5,7,8,11,13,14},{4,5,7,8,11,13,14,15},{4,5,7,8,11,13,15},{4,5,7,8,11,14},{4,5,7,8,11,14,15},{4,5,7,8,11,15},{4,5,7,8,12},{4,5,7,8,12,13},{4,5,7,8,12,13,14},{4,5,7,8,12,13,14,15},{4,5,7,8,12,13,15},{4,5,7,8,12,14},{4,5,7,8,12,14,15},{4,5,7,8,12,15},{4,5,7,8,13},{4,5,7,8,13,14},{4,5,7,8,13,14,15},{4,5,7,8,13,15},{4,5,7,8,14},{4,5,7,8,14,15},{4,5,7,8,15},{4,5,7,9},{4,5,7,9,10},{4,5,7,9,10,11},{4,5,7,9,10,11,12},{4,5,7,9,10,11,12,13},{4,5,7,9,10,11,12,13,14},{4,5,7,9,10,11,12,13,14,15},{4,5,7,9,10,11,12,13,15},{4,5,7,9,10,11,12,14},{4,5,7,9,10,11,12,14,15},{4,5,7,9,10,11,12,15},{4,5,7,9,10,11,13},{4,5,7,9,10,11,13,14},{4,5,7,9,10,11,13,14,15},{4,5,7,9,10,11,13,15},{4,5,7,9,10,11,14},{4,5,7,9,10,11,14,15},{4,5,7,9,10,11,15},{4,5,7,9,10,12},{4,5,7,9,10,12,13},{4,5,7,9,10,12,13,14},{4,5,7,9,10,12,13,14,15},{4,5,7,9,10,12,13,15},{4,5,7,9,10,12,14},{4,5,7,9,10,12,14,15},{4,5,7,9,10,12,15},{4,5,7,9,10,13},{4,5,7,9,10,13,14},{4,5,7,9,10,13,14,15},{4,5,7,9,10,13,15},{4,5,7,9,10,14},{4,5,7,9,10,14,15},{4,5,7,9,10,15},{4,5,7,9,11},{4,5,7,9,11,12},{4,5,7,9,11,12,13},{4,5,7,9,11,12,13,14},{4,5,7,9,11,12,13,14,15},{4,5,7,9,11,12,13,15},{4,5,7,9,11,12,14},{4,5,7,9,11,12,14,15},{4,5,7,9,11,12,15},{4,5,7,9,11,13},{4,5,7,9,11,13,14},{4,5,7,9,11,13,14,15},{4,5,7,9,11,13,15},{4,5,7,9,11,14},{4,5,7,9,11,14,15},{4,5,7,9,11,15},{4,5,7,9,12},{4,5,7,9,12,13},{4,5,7,9,12,13,14},{4,5,7,9,12,13,14,15},{4,5,7,9,12,13,15},{4,5,7,9,12,14},{4,5,7,9,12,14,15},{4,5,7,9,12,15},{4,5,7,9,13},{4,5,7,9,13,14},{4,5,7,9,13,14,15},{4,5,7,9,13,15},{4,5,7,9,14},{4,5,7,9,14,15},{4,5,7,9,15},{4,5,7,10},{4,5,7,10,11},{4,5,7,10,11,12},{4,5,7,10,11,12,13},{4,5,7,10,11,12,13,14},{4,5,7,10,11,12,13,14,15},{4,5,7,10,11,12,13,15},{4,5,7,10,11,12,14},{4,5,7,10,11,12,14,15},{4,5,7,10,11,12,15},{4,5,7,10,11,13},{4,5,7,10,11,13,14},{4,5,7,10,11,13,14,15},{4,5,7,10,11,13,15},{4,5,7,10,11,14},{4,5,7,10,11,14,15},{4,5,7,10,11,15},{4,5,7,10,12},{4,5,7,10,12,13},{4,5,7,10,12,13,14},{4,5,7,10,12,13,14,15},{4,5,7,10,12,13,15},{4,5,7,10,12,14},{4,5,7,10,12,14,15},{4,5,7,10,12,15},{4,5,7,10,13},{4,5,7,10,13,14},{4,5,7,10,13,14,15},{4,5,7,10,13,15},{4,5,7,10,14},{4,5,7,10,14,15},{4,5,7,10,15},{4,5,7,11},{4,5,7,11,12},{4,5,7,11,12,13},{4,5,7,11,12,13,14},{4,5,7,11,12,13,14,15},{4,5,7,11,12,13,15},{4,5,7,11,12,14},{4,5,7,11,12,14,15},{4,5,7,11,12,15},{4,5,7,11,13},{4,5,7,11,13,14},{4,5,7,11,13,14,15},{4,5,7,11,13,15},{4,5,7,11,14},{4,5,7,11,14,15},{4,5,7,11,15},{4,5,7,12},{4,5,7,12,13},{4,5,7,12,13,14},{4,5,7,12,13,14,15},{4,5,7,12,13,15},{4,5,7,12,14},{4,5,7,12,14,15},{4,5,7,12,15},{4,5,7,13},{4,5,7,13,14},{4,5,7,13,14,15},{4,5,7,13,15},{4,5,7,14},{4,5,7,14,15},{4,5,7,15},{4,5,8},{4,5,8,9},{4,5,8,9,10},{4,5,8,9,10,11},{4,5,8,9,10,11,12},{4,5,8,9,10,11,12,13},{4,5,8,9,10,11,12,13,14},{4,5,8,9,10,11,12,13,14,15},{4,5,8,9,10,11,12,13,15},{4,5,8,9,10,11,12,14},{4,5,8,9,10,11,12,14,15},{4,5,8,9,10,11,12,15},{4,5,8,9,10,11,13},{4,5,8,9,10,11,13,14},{4,5,8,9,10,11,13,14,15},{4,5,8,9,10,11,13,15},{4,5,8,9,10,11,14},{4,5,8,9,10,11,14,15},{4,5,8,9,10,11,15},{4,5,8,9,10,12},{4,5,8,9,10,12,13},{4,5,8,9,10,12,13,14},{4,5,8,9,10,12,13,14,15},{4,5,8,9,10,12,13,15},{4,5,8,9,10,12,14},{4,5,8,9,10,12,14,15},{4,5,8,9,10,12,15},{4,5,8,9,10,13},{4,5,8,9,10,13,14},{4,5,8,9,10,13,14,15},{4,5,8,9,10,13,15},{4,5,8,9,10,14},{4,5,8,9,10,14,15},{4,5,8,9,10,15},{4,5,8,9,11},{4,5,8,9,11,12},{4,5,8,9,11,12,13},{4,5,8,9,11,12,13,14},{4,5,8,9,11,12,13,14,15},{4,5,8,9,11,12,13,15},{4,5,8,9,11,12,14},{4,5,8,9,11,12,14,15},{4,5,8,9,11,12,15},{4,5,8,9,11,13},{4,5,8,9,11,13,14},{4,5,8,9,11,13,14,15},{4,5,8,9,11,13,15},{4,5,8,9,11,14},{4,5,8,9,11,14,15},{4,5,8,9,11,15},{4,5,8,9,12},{4,5,8,9,12,13},{4,5,8,9,12,13,14},{4,5,8,9,12,13,14,15},{4,5,8,9,12,13,15},{4,5,8,9,12,14},{4,5,8,9,12,14,15},{4,5,8,9,12,15},{4,5,8,9,13},{4,5,8,9,13,14},{4,5,8,9,13,14,15},{4,5,8,9,13,15},{4,5,8,9,14},{4,5,8,9,14,15},{4,5,8,9,15},{4,5,8,10},{4,5,8,10,11},{4,5,8,10,11,12},{4,5,8,10,11,12,13},{4,5,8,10,11,12,13,14},{4,5,8,10,11,12,13,14,15},{4,5,8,10,11,12,13,15},{4,5,8,10,11,12,14},{4,5,8,10,11,12,14,15},{4,5,8,10,11,12,15},{4,5,8,10,11,13},{4,5,8,10,11,13,14},{4,5,8,10,11,13,14,15},{4,5,8,10,11,13,15},{4,5,8,10,11,14},{4,5,8,10,11,14,15},{4,5,8,10,11,15},{4,5,8,10,12},{4,5,8,10,12,13},{4,5,8,10,12,13,14},{4,5,8,10,12,13,14,15},{4,5,8,10,12,13,15},{4,5,8,10,12,14},{4,5,8,10,12,14,15},{4,5,8,10,12,15},{4,5,8,10,13},{4,5,8,10,13,14},{4,5,8,10,13,14,15},{4,5,8,10,13,15},{4,5,8,10,14},{4,5,8,10,14,15},{4,5,8,10,15},{4,5,8,11},{4,5,8,11,12},{4,5,8,11,12,13},{4,5,8,11,12,13,14},{4,5,8,11,12,13,14,15},{4,5,8,11,12,13,15},{4,5,8,11,12,14},{4,5,8,11,12,14,15},{4,5,8,11,12,15},{4,5,8,11,13},{4,5,8,11,13,14},{4,5,8,11,13,14,15},{4,5,8,11,13,15},{4,5,8,11,14},{4,5,8,11,14,15},{4,5,8,11,15},{4,5,8,12},{4,5,8,12,13},{4,5,8,12,13,14},{4,5,8,12,13,14,15},{4,5,8,12,13,15},{4,5,8,12,14},{4,5,8,12,14,15},{4,5,8,12,15},{4,5,8,13},{4,5,8,13,14},{4,5,8,13,14,15},{4,5,8,13,15},{4,5,8,14},{4,5,8,14,15},{4,5,8,15},{4,5,9},{4,5,9,10},{4,5,9,10,11},{4,5,9,10,11,12},{4,5,9,10,11,12,13},{4,5,9,10,11,12,13,14},{4,5,9,10,11,12,13,14,15},{4,5,9,10,11,12,13,15},{4,5,9,10,11,12,14},{4,5,9,10,11,12,14,15},{4,5,9,10,11,12,15},{4,5,9,10,11,13},{4,5,9,10,11,13,14},{4,5,9,10,11,13,14,15},{4,5,9,10,11,13,15},{4,5,9,10,11,14},{4,5,9,10,11,14,15},{4,5,9,10,11,15},{4,5,9,10,12},{4,5,9,10,12,13},{4,5,9,10,12,13,14},{4,5,9,10,12,13,14,15},{4,5,9,10,12,13,15},{4,5,9,10,12,14},{4,5,9,10,12,14,15},{4,5,9,10,12,15},{4,5,9,10,13},{4,5,9,10,13,14},{4,5,9,10,13,14,15},{4,5,9,10,13,15},{4,5,9,10,14},{4,5,9,10,14,15},{4,5,9,10,15},{4,5,9,11},{4,5,9,11,12},{4,5,9,11,12,13},{4,5,9,11,12,13,14},{4,5,9,11,12,13,14,15},{4,5,9,11,12,13,15},{4,5,9,11,12,14},{4,5,9,11,12,14,15},{4,5,9,11,12,15},{4,5,9,11,13},{4,5,9,11,13,14},{4,5,9,11,13,14,15},{4,5,9,11,13,15},{4,5,9,11,14},{4,5,9,11,14,15},{4,5,9,11,15},{4,5,9,12},{4,5,9,12,13},{4,5,9,12,13,14},{4,5,9,12,13,14,15},{4,5,9,12,13,15},{4,5,9,12,14},{4,5,9,12,14,15},{4,5,9,12,15},{4,5,9,13},{4,5,9,13,14},{4,5,9,13,14,15},{4,5,9,13,15},{4,5,9,14},{4,5,9,14,15},{4,5,9,15},{4,5,10},{4,5,10,11},{4,5,10,11,12},{4,5,10,11,12,13},{4,5,10,11,12,13,14},{4,5,10,11,12,13,14,15},{4,5,10,11,12,13,15},{4,5,10,11,12,14},{4,5,10,11,12,14,15},{4,5,10,11,12,15},{4,5,10,11,13},{4,5,10,11,13,14},{4,5,10,11,13,14,15},{4,5,10,11,13,15},{4,5,10,11,14},{4,5,10,11,14,15},{4,5,10,11,15},{4,5,10,12},{4,5,10,12,13},{4,5,10,12,13,14},{4,5,10,12,13,14,15},{4,5,10,12,13,15},{4,5,10,12,14},{4,5,10,12,14,15},{4,5,10,12,15},{4,5,10,13},{4,5,10,13,14},{4,5,10,13,14,15},{4,5,10,13,15},{4,5,10,14},{4,5,10,14,15},{4,5,10,15},{4,5,11},{4,5,11,12},{4,5,11,12,13},{4,5,11,12,13,14},{4,5,11,12,13,14,15},{4,5,11,12,13,15},{4,5,11,12,14},{4,5,11,12,14,15},{4,5,11,12,15},{4,5,11,13},{4,5,11,13,14},{4,5,11,13,14,15},{4,5,11,13,15},{4,5,11,14},{4,5,11,14,15},{4,5,11,15},{4,5,12},{4,5,12,13},{4,5,12,13,14},{4,5,12,13,14,15},{4,5,12,13,15},{4,5,12,14},{4,5,12,14,15},{4,5,12,15},{4,5,13},{4,5,13,14},{4,5,13,14,15},{4,5,13,15},{4,5,14},{4,5,14,15},{4,5,15},{4,6},{4,6,7},{4,6,7,8},{4,6,7,8,9},{4,6,7,8,9,10},{4,6,7,8,9,10,11},{4,6,7,8,9,10,11,12},{4,6,7,8,9,10,11,12,13},{4,6,7,8,9,10,11,12,13,14},{4,6,7,8,9,10,11,12,13,14,15},{4,6,7,8,9,10,11,12,13,15},{4,6,7,8,9,10,11,12,14},{4,6,7,8,9,10,11,12,14,15},{4,6,7,8,9,10,11,12,15},{4,6,7,8,9,10,11,13},{4,6,7,8,9,10,11,13,14},{4,6,7,8,9,10,11,13,14,15},{4,6,7,8,9,10,11,13,15},{4,6,7,8,9,10,11,14},{4,6,7,8,9,10,11,14,15},{4,6,7,8,9,10,11,15},{4,6,7,8,9,10,12},{4,6,7,8,9,10,12,13},{4,6,7,8,9,10,12,13,14},{4,6,7,8,9,10,12,13,14,15},{4,6,7,8,9,10,12,13,15},{4,6,7,8,9,10,12,14},{4,6,7,8,9,10,12,14,15},{4,6,7,8,9,10,12,15},{4,6,7,8,9,10,13},{4,6,7,8,9,10,13,14},{4,6,7,8,9,10,13,14,15},{4,6,7,8,9,10,13,15},{4,6,7,8,9,10,14},{4,6,7,8,9,10,14,15},{4,6,7,8,9,10,15},{4,6,7,8,9,11},{4,6,7,8,9,11,12},{4,6,7,8,9,11,12,13},{4,6,7,8,9,11,12,13,14},{4,6,7,8,9,11,12,13,14,15},{4,6,7,8,9,11,12,13,15},{4,6,7,8,9,11,12,14},{4,6,7,8,9,11,12,14,15},{4,6,7,8,9,11,12,15},{4,6,7,8,9,11,13},{4,6,7,8,9,11,13,14},{4,6,7,8,9,11,13,14,15},{4,6,7,8,9,11,13,15},{4,6,7,8,9,11,14},{4,6,7,8,9,11,14,15},{4,6,7,8,9,11,15},{4,6,7,8,9,12},{4,6,7,8,9,12,13},{4,6,7,8,9,12,13,14},{4,6,7,8,9,12,13,14,15},{4,6,7,8,9,12,13,15},{4,6,7,8,9,12,14},{4,6,7,8,9,12,14,15},{4,6,7,8,9,12,15},{4,6,7,8,9,13},{4,6,7,8,9,13,14},{4,6,7,8,9,13,14,15},{4,6,7,8,9,13,15},{4,6,7,8,9,14},{4,6,7,8,9,14,15},{4,6,7,8,9,15},{4,6,7,8,10},{4,6,7,8,10,11},{4,6,7,8,10,11,12},{4,6,7,8,10,11,12,13},{4,6,7,8,10,11,12,13,14},{4,6,7,8,10,11,12,13,14,15},{4,6,7,8,10,11,12,13,15},{4,6,7,8,10,11,12,14},{4,6,7,8,10,11,12,14,15},{4,6,7,8,10,11,12,15},{4,6,7,8,10,11,13},{4,6,7,8,10,11,13,14},{4,6,7,8,10,11,13,14,15},{4,6,7,8,10,11,13,15},{4,6,7,8,10,11,14},{4,6,7,8,10,11,14,15},{4,6,7,8,10,11,15},{4,6,7,8,10,12},{4,6,7,8,10,12,13},{4,6,7,8,10,12,13,14},{4,6,7,8,10,12,13,14,15},{4,6,7,8,10,12,13,15},{4,6,7,8,10,12,14},{4,6,7,8,10,12,14,15},{4,6,7,8,10,12,15},{4,6,7,8,10,13},{4,6,7,8,10,13,14},{4,6,7,8,10,13,14,15},{4,6,7,8,10,13,15},{4,6,7,8,10,14},{4,6,7,8,10,14,15},{4,6,7,8,10,15},{4,6,7,8,11},{4,6,7,8,11,12},{4,6,7,8,11,12,13},{4,6,7,8,11,12,13,14},{4,6,7,8,11,12,13,14,15},{4,6,7,8,11,12,13,15},{4,6,7,8,11,12,14},{4,6,7,8,11,12,14,15},{4,6,7,8,11,12,15},{4,6,7,8,11,13},{4,6,7,8,11,13,14},{4,6,7,8,11,13,14,15},{4,6,7,8,11,13,15},{4,6,7,8,11,14},{4,6,7,8,11,14,15},{4,6,7,8,11,15},{4,6,7,8,12},{4,6,7,8,12,13},{4,6,7,8,12,13,14},{4,6,7,8,12,13,14,15},{4,6,7,8,12,13,15},{4,6,7,8,12,14},{4,6,7,8,12,14,15},{4,6,7,8,12,15},{4,6,7,8,13},{4,6,7,8,13,14},{4,6,7,8,13,14,15},{4,6,7,8,13,15},{4,6,7,8,14},{4,6,7,8,14,15},{4,6,7,8,15},{4,6,7,9},{4,6,7,9,10},{4,6,7,9,10,11},{4,6,7,9,10,11,12},{4,6,7,9,10,11,12,13},{4,6,7,9,10,11,12,13,14},{4,6,7,9,10,11,12,13,14,15},{4,6,7,9,10,11,12,13,15},{4,6,7,9,10,11,12,14},{4,6,7,9,10,11,12,14,15},{4,6,7,9,10,11,12,15},{4,6,7,9,10,11,13},{4,6,7,9,10,11,13,14},{4,6,7,9,10,11,13,14,15},{4,6,7,9,10,11,13,15},{4,6,7,9,10,11,14},{4,6,7,9,10,11,14,15},{4,6,7,9,10,11,15},{4,6,7,9,10,12},{4,6,7,9,10,12,13},{4,6,7,9,10,12,13,14},{4,6,7,9,10,12,13,14,15},{4,6,7,9,10,12,13,15},{4,6,7,9,10,12,14},{4,6,7,9,10,12,14,15},{4,6,7,9,10,12,15},{4,6,7,9,10,13},{4,6,7,9,10,13,14},{4,6,7,9,10,13,14,15},{4,6,7,9,10,13,15},{4,6,7,9,10,14},{4,6,7,9,10,14,15},{4,6,7,9,10,15},{4,6,7,9,11},{4,6,7,9,11,12},{4,6,7,9,11,12,13},{4,6,7,9,11,12,13,14},{4,6,7,9,11,12,13,14,15},{4,6,7,9,11,12,13,15},{4,6,7,9,11,12,14},{4,6,7,9,11,12,14,15},{4,6,7,9,11,12,15},{4,6,7,9,11,13},{4,6,7,9,11,13,14},{4,6,7,9,11,13,14,15},{4,6,7,9,11,13,15},{4,6,7,9,11,14},{4,6,7,9,11,14,15},{4,6,7,9,11,15},{4,6,7,9,12},{4,6,7,9,12,13},{4,6,7,9,12,13,14},{4,6,7,9,12,13,14,15},{4,6,7,9,12,13,15},{4,6,7,9,12,14},{4,6,7,9,12,14,15},{4,6,7,9,12,15},{4,6,7,9,13},{4,6,7,9,13,14},{4,6,7,9,13,14,15},{4,6,7,9,13,15},{4,6,7,9,14},{4,6,7,9,14,15},{4,6,7,9,15},{4,6,7,10},{4,6,7,10,11},{4,6,7,10,11,12},{4,6,7,10,11,12,13},{4,6,7,10,11,12,13,14},{4,6,7,10,11,12,13,14,15},{4,6,7,10,11,12,13,15},{4,6,7,10,11,12,14},{4,6,7,10,11,12,14,15},{4,6,7,10,11,12,15},{4,6,7,10,11,13},{4,6,7,10,11,13,14},{4,6,7,10,11,13,14,15},{4,6,7,10,11,13,15},{4,6,7,10,11,14},{4,6,7,10,11,14,15},{4,6,7,10,11,15},{4,6,7,10,12},{4,6,7,10,12,13},{4,6,7,10,12,13,14},{4,6,7,10,12,13,14,15},{4,6,7,10,12,13,15},{4,6,7,10,12,14},{4,6,7,10,12,14,15},{4,6,7,10,12,15},{4,6,7,10,13},{4,6,7,10,13,14},{4,6,7,10,13,14,15},{4,6,7,10,13,15},{4,6,7,10,14},{4,6,7,10,14,15},{4,6,7,10,15},{4,6,7,11},{4,6,7,11,12},{4,6,7,11,12,13},{4,6,7,11,12,13,14},{4,6,7,11,12,13,14,15},{4,6,7,11,12,13,15},{4,6,7,11,12,14},{4,6,7,11,12,14,15},{4,6,7,11,12,15},{4,6,7,11,13},{4,6,7,11,13,14},{4,6,7,11,13,14,15},{4,6,7,11,13,15},{4,6,7,11,14},{4,6,7,11,14,15},{4,6,7,11,15},{4,6,7,12},{4,6,7,12,13},{4,6,7,12,13,14},{4,6,7,12,13,14,15},{4,6,7,12,13,15},{4,6,7,12,14},{4,6,7,12,14,15},{4,6,7,12,15},{4,6,7,13},{4,6,7,13,14},{4,6,7,13,14,15},{4,6,7,13,15},{4,6,7,14},{4,6,7,14,15},{4,6,7,15},{4,6,8},{4,6,8,9},{4,6,8,9,10},{4,6,8,9,10,11},{4,6,8,9,10,11,12},{4,6,8,9,10,11,12,13},{4,6,8,9,10,11,12,13,14},{4,6,8,9,10,11,12,13,14,15},{4,6,8,9,10,11,12,13,15},{4,6,8,9,10,11,12,14},{4,6,8,9,10,11,12,14,15},{4,6,8,9,10,11,12,15},{4,6,8,9,10,11,13},{4,6,8,9,10,11,13,14},{4,6,8,9,10,11,13,14,15},{4,6,8,9,10,11,13,15},{4,6,8,9,10,11,14},{4,6,8,9,10,11,14,15},{4,6,8,9,10,11,15},{4,6,8,9,10,12},{4,6,8,9,10,12,13},{4,6,8,9,10,12,13,14},{4,6,8,9,10,12,13,14,15},{4,6,8,9,10,12,13,15},{4,6,8,9,10,12,14},{4,6,8,9,10,12,14,15},{4,6,8,9,10,12,15},{4,6,8,9,10,13},{4,6,8,9,10,13,14},{4,6,8,9,10,13,14,15},{4,6,8,9,10,13,15},{4,6,8,9,10,14},{4,6,8,9,10,14,15},{4,6,8,9,10,15},{4,6,8,9,11},{4,6,8,9,11,12},{4,6,8,9,11,12,13},{4,6,8,9,11,12,13,14},{4,6,8,9,11,12,13,14,15},{4,6,8,9,11,12,13,15},{4,6,8,9,11,12,14},{4,6,8,9,11,12,14,15},{4,6,8,9,11,12,15},{4,6,8,9,11,13},{4,6,8,9,11,13,14},{4,6,8,9,11,13,14,15},{4,6,8,9,11,13,15},{4,6,8,9,11,14},{4,6,8,9,11,14,15},{4,6,8,9,11,15},{4,6,8,9,12},{4,6,8,9,12,13},{4,6,8,9,12,13,14},{4,6,8,9,12,13,14,15},{4,6,8,9,12,13,15},{4,6,8,9,12,14},{4,6,8,9,12,14,15},{4,6,8,9,12,15},{4,6,8,9,13},{4,6,8,9,13,14},{4,6,8,9,13,14,15},{4,6,8,9,13,15},{4,6,8,9,14},{4,6,8,9,14,15},{4,6,8,9,15},{4,6,8,10},{4,6,8,10,11},{4,6,8,10,11,12},{4,6,8,10,11,12,13},{4,6,8,10,11,12,13,14},{4,6,8,10,11,12,13,14,15},{4,6,8,10,11,12,13,15},{4,6,8,10,11,12,14},{4,6,8,10,11,12,14,15},{4,6,8,10,11,12,15},{4,6,8,10,11,13},{4,6,8,10,11,13,14},{4,6,8,10,11,13,14,15},{4,6,8,10,11,13,15},{4,6,8,10,11,14},{4,6,8,10,11,14,15},{4,6,8,10,11,15},{4,6,8,10,12},{4,6,8,10,12,13},{4,6,8,10,12,13,14},{4,6,8,10,12,13,14,15},{4,6,8,10,12,13,15},{4,6,8,10,12,14},{4,6,8,10,12,14,15},{4,6,8,10,12,15},{4,6,8,10,13},{4,6,8,10,13,14},{4,6,8,10,13,14,15},{4,6,8,10,13,15},{4,6,8,10,14},{4,6,8,10,14,15},{4,6,8,10,15},{4,6,8,11},{4,6,8,11,12},{4,6,8,11,12,13},{4,6,8,11,12,13,14},{4,6,8,11,12,13,14,15},{4,6,8,11,12,13,15},{4,6,8,11,12,14},{4,6,8,11,12,14,15},{4,6,8,11,12,15},{4,6,8,11,13},{4,6,8,11,13,14},{4,6,8,11,13,14,15},{4,6,8,11,13,15},{4,6,8,11,14},{4,6,8,11,14,15},{4,6,8,11,15},{4,6,8,12},{4,6,8,12,13},{4,6,8,12,13,14},{4,6,8,12,13,14,15},{4,6,8,12,13,15},{4,6,8,12,14},{4,6,8,12,14,15},{4,6,8,12,15},{4,6,8,13},{4,6,8,13,14},{4,6,8,13,14,15},{4,6,8,13,15},{4,6,8,14},{4,6,8,14,15},{4,6,8,15},{4,6,9},{4,6,9,10},{4,6,9,10,11},{4,6,9,10,11,12},{4,6,9,10,11,12,13},{4,6,9,10,11,12,13,14},{4,6,9,10,11,12,13,14,15},{4,6,9,10,11,12,13,15},{4,6,9,10,11,12,14},{4,6,9,10,11,12,14,15},{4,6,9,10,11,12,15},{4,6,9,10,11,13},{4,6,9,10,11,13,14},{4,6,9,10,11,13,14,15},{4,6,9,10,11,13,15},{4,6,9,10,11,14},{4,6,9,10,11,14,15},{4,6,9,10,11,15},{4,6,9,10,12},{4,6,9,10,12,13},{4,6,9,10,12,13,14},{4,6,9,10,12,13,14,15},{4,6,9,10,12,13,15},{4,6,9,10,12,14},{4,6,9,10,12,14,15},{4,6,9,10,12,15},{4,6,9,10,13},{4,6,9,10,13,14},{4,6,9,10,13,14,15},{4,6,9,10,13,15},{4,6,9,10,14},{4,6,9,10,14,15},{4,6,9,10,15},{4,6,9,11},{4,6,9,11,12},{4,6,9,11,12,13},{4,6,9,11,12,13,14},{4,6,9,11,12,13,14,15},{4,6,9,11,12,13,15},{4,6,9,11,12,14},{4,6,9,11,12,14,15},{4,6,9,11,12,15},{4,6,9,11,13},{4,6,9,11,13,14},{4,6,9,11,13,14,15},{4,6,9,11,13,15},{4,6,9,11,14},{4,6,9,11,14,15},{4,6,9,11,15},{4,6,9,12},{4,6,9,12,13},{4,6,9,12,13,14},{4,6,9,12,13,14,15},{4,6,9,12,13,15},{4,6,9,12,14},{4,6,9,12,14,15},{4,6,9,12,15},{4,6,9,13},{4,6,9,13,14},{4,6,9,13,14,15},{4,6,9,13,15},{4,6,9,14},{4,6,9,14,15},{4,6,9,15},{4,6,10},{4,6,10,11},{4,6,10,11,12},{4,6,10,11,12,13},{4,6,10,11,12,13,14},{4,6,10,11,12,13,14,15},{4,6,10,11,12,13,15},{4,6,10,11,12,14},{4,6,10,11,12,14,15},{4,6,10,11,12,15},{4,6,10,11,13},{4,6,10,11,13,14},{4,6,10,11,13,14,15},{4,6,10,11,13,15},{4,6,10,11,14},{4,6,10,11,14,15},{4,6,10,11,15},{4,6,10,12},{4,6,10,12,13},{4,6,10,12,13,14},{4,6,10,12,13,14,15},{4,6,10,12,13,15},{4,6,10,12,14},{4,6,10,12,14,15},{4,6,10,12,15},{4,6,10,13},{4,6,10,13,14},{4,6,10,13,14,15},{4,6,10,13,15},{4,6,10,14},{4,6,10,14,15},{4,6,10,15},{4,6,11},{4,6,11,12},{4,6,11,12,13},{4,6,11,12,13,14},{4,6,11,12,13,14,15},{4,6,11,12,13,15},{4,6,11,12,14},{4,6,11,12,14,15},{4,6,11,12,15},{4,6,11,13},{4,6,11,13,14},{4,6,11,13,14,15},{4,6,11,13,15},{4,6,11,14},{4,6,11,14,15},{4,6,11,15},{4,6,12},{4,6,12,13},{4,6,12,13,14},{4,6,12,13,14,15},{4,6,12,13,15},{4,6,12,14},{4,6,12,14,15},{4,6,12,15},{4,6,13},{4,6,13,14},{4,6,13,14,15},{4,6,13,15},{4,6,14},{4,6,14,15},{4,6,15},{4,7},{4,7,8},{4,7,8,9},{4,7,8,9,10},{4,7,8,9,10,11},{4,7,8,9,10,11,12},{4,7,8,9,10,11,12,13},{4,7,8,9,10,11,12,13,14},{4,7,8,9,10,11,12,13,14,15},{4,7,8,9,10,11,12,13,15},{4,7,8,9,10,11,12,14},{4,7,8,9,10,11,12,14,15},{4,7,8,9,10,11,12,15},{4,7,8,9,10,11,13},{4,7,8,9,10,11,13,14},{4,7,8,9,10,11,13,14,15},{4,7,8,9,10,11,13,15},{4,7,8,9,10,11,14},{4,7,8,9,10,11,14,15},{4,7,8,9,10,11,15},{4,7,8,9,10,12},{4,7,8,9,10,12,13},{4,7,8,9,10,12,13,14},{4,7,8,9,10,12,13,14,15},{4,7,8,9,10,12,13,15},{4,7,8,9,10,12,14},{4,7,8,9,10,12,14,15},{4,7,8,9,10,12,15},{4,7,8,9,10,13},{4,7,8,9,10,13,14},{4,7,8,9,10,13,14,15},{4,7,8,9,10,13,15},{4,7,8,9,10,14},{4,7,8,9,10,14,15},{4,7,8,9,10,15},{4,7,8,9,11},{4,7,8,9,11,12},{4,7,8,9,11,12,13},{4,7,8,9,11,12,13,14},{4,7,8,9,11,12,13,14,15},{4,7,8,9,11,12,13,15},{4,7,8,9,11,12,14},{4,7,8,9,11,12,14,15},{4,7,8,9,11,12,15},{4,7,8,9,11,13},{4,7,8,9,11,13,14},{4,7,8,9,11,13,14,15},{4,7,8,9,11,13,15},{4,7,8,9,11,14},{4,7,8,9,11,14,15},{4,7,8,9,11,15},{4,7,8,9,12},{4,7,8,9,12,13},{4,7,8,9,12,13,14},{4,7,8,9,12,13,14,15},{4,7,8,9,12,13,15},{4,7,8,9,12,14},{4,7,8,9,12,14,15},{4,7,8,9,12,15},{4,7,8,9,13},{4,7,8,9,13,14},{4,7,8,9,13,14,15},{4,7,8,9,13,15},{4,7,8,9,14},{4,7,8,9,14,15},{4,7,8,9,15},{4,7,8,10},{4,7,8,10,11},{4,7,8,10,11,12},{4,7,8,10,11,12,13},{4,7,8,10,11,12,13,14},{4,7,8,10,11,12,13,14,15},{4,7,8,10,11,12,13,15},{4,7,8,10,11,12,14},{4,7,8,10,11,12,14,15},{4,7,8,10,11,12,15},{4,7,8,10,11,13},{4,7,8,10,11,13,14},{4,7,8,10,11,13,14,15},{4,7,8,10,11,13,15},{4,7,8,10,11,14},{4,7,8,10,11,14,15},{4,7,8,10,11,15},{4,7,8,10,12},{4,7,8,10,12,13},{4,7,8,10,12,13,14},{4,7,8,10,12,13,14,15},{4,7,8,10,12,13,15},{4,7,8,10,12,14},{4,7,8,10,12,14,15},{4,7,8,10,12,15},{4,7,8,10,13},{4,7,8,10,13,14},{4,7,8,10,13,14,15},{4,7,8,10,13,15},{4,7,8,10,14},{4,7,8,10,14,15},{4,7,8,10,15},{4,7,8,11},{4,7,8,11,12},{4,7,8,11,12,13},{4,7,8,11,12,13,14},{4,7,8,11,12,13,14,15},{4,7,8,11,12,13,15},{4,7,8,11,12,14},{4,7,8,11,12,14,15},{4,7,8,11,12,15},{4,7,8,11,13},{4,7,8,11,13,14},{4,7,8,11,13,14,15},{4,7,8,11,13,15},{4,7,8,11,14},{4,7,8,11,14,15},{4,7,8,11,15},{4,7,8,12},{4,7,8,12,13},{4,7,8,12,13,14},{4,7,8,12,13,14,15},{4,7,8,12,13,15},{4,7,8,12,14},{4,7,8,12,14,15},{4,7,8,12,15},{4,7,8,13},{4,7,8,13,14},{4,7,8,13,14,15},{4,7,8,13,15},{4,7,8,14},{4,7,8,14,15},{4,7,8,15},{4,7,9},{4,7,9,10},{4,7,9,10,11},{4,7,9,10,11,12},{4,7,9,10,11,12,13},{4,7,9,10,11,12,13,14},{4,7,9,10,11,12,13,14,15},{4,7,9,10,11,12,13,15},{4,7,9,10,11,12,14},{4,7,9,10,11,12,14,15},{4,7,9,10,11,12,15},{4,7,9,10,11,13},{4,7,9,10,11,13,14},{4,7,9,10,11,13,14,15},{4,7,9,10,11,13,15},{4,7,9,10,11,14},{4,7,9,10,11,14,15},{4,7,9,10,11,15},{4,7,9,10,12},{4,7,9,10,12,13},{4,7,9,10,12,13,14},{4,7,9,10,12,13,14,15},{4,7,9,10,12,13,15},{4,7,9,10,12,14},{4,7,9,10,12,14,15},{4,7,9,10,12,15},{4,7,9,10,13},{4,7,9,10,13,14},{4,7,9,10,13,14,15},{4,7,9,10,13,15},{4,7,9,10,14},{4,7,9,10,14,15},{4,7,9,10,15},{4,7,9,11},{4,7,9,11,12},{4,7,9,11,12,13},{4,7,9,11,12,13,14},{4,7,9,11,12,13,14,15},{4,7,9,11,12,13,15},{4,7,9,11,12,14},{4,7,9,11,12,14,15},{4,7,9,11,12,15},{4,7,9,11,13},{4,7,9,11,13,14},{4,7,9,11,13,14,15},{4,7,9,11,13,15},{4,7,9,11,14},{4,7,9,11,14,15},{4,7,9,11,15},{4,7,9,12},{4,7,9,12,13},{4,7,9,12,13,14},{4,7,9,12,13,14,15},{4,7,9,12,13,15},{4,7,9,12,14},{4,7,9,12,14,15},{4,7,9,12,15},{4,7,9,13},{4,7,9,13,14},{4,7,9,13,14,15},{4,7,9,13,15},{4,7,9,14},{4,7,9,14,15},{4,7,9,15},{4,7,10},{4,7,10,11},{4,7,10,11,12},{4,7,10,11,12,13},{4,7,10,11,12,13,14},{4,7,10,11,12,13,14,15},{4,7,10,11,12,13,15},{4,7,10,11,12,14},{4,7,10,11,12,14,15},{4,7,10,11,12,15},{4,7,10,11,13},{4,7,10,11,13,14},{4,7,10,11,13,14,15},{4,7,10,11,13,15},{4,7,10,11,14},{4,7,10,11,14,15},{4,7,10,11,15},{4,7,10,12},{4,7,10,12,13},{4,7,10,12,13,14},{4,7,10,12,13,14,15},{4,7,10,12,13,15},{4,7,10,12,14},{4,7,10,12,14,15},{4,7,10,12,15},{4,7,10,13},{4,7,10,13,14},{4,7,10,13,14,15},{4,7,10,13,15},{4,7,10,14},{4,7,10,14,15},{4,7,10,15},{4,7,11},{4,7,11,12},{4,7,11,12,13},{4,7,11,12,13,14},{4,7,11,12,13,14,15},{4,7,11,12,13,15},{4,7,11,12,14},{4,7,11,12,14,15},{4,7,11,12,15},{4,7,11,13},{4,7,11,13,14},{4,7,11,13,14,15},{4,7,11,13,15},{4,7,11,14},{4,7,11,14,15},{4,7,11,15},{4,7,12},{4,7,12,13},{4,7,12,13,14},{4,7,12,13,14,15},{4,7,12,13,15},{4,7,12,14},{4,7,12,14,15},{4,7,12,15},{4,7,13},{4,7,13,14},{4,7,13,14,15},{4,7,13,15},{4,7,14},{4,7,14,15},{4,7,15},{4,8},{4,8,9},{4,8,9,10},{4,8,9,10,11},{4,8,9,10,11,12},{4,8,9,10,11,12,13},{4,8,9,10,11,12,13,14},{4,8,9,10,11,12,13,14,15},{4,8,9,10,11,12,13,15},{4,8,9,10,11,12,14},{4,8,9,10,11,12,14,15},{4,8,9,10,11,12,15},{4,8,9,10,11,13},{4,8,9,10,11,13,14},{4,8,9,10,11,13,14,15},{4,8,9,10,11,13,15},{4,8,9,10,11,14},{4,8,9,10,11,14,15},{4,8,9,10,11,15},{4,8,9,10,12},{4,8,9,10,12,13},{4,8,9,10,12,13,14},{4,8,9,10,12,13,14,15},{4,8,9,10,12,13,15},{4,8,9,10,12,14},{4,8,9,10,12,14,15},{4,8,9,10,12,15},{4,8,9,10,13},{4,8,9,10,13,14},{4,8,9,10,13,14,15},{4,8,9,10,13,15},{4,8,9,10,14},{4,8,9,10,14,15},{4,8,9,10,15},{4,8,9,11},{4,8,9,11,12},{4,8,9,11,12,13},{4,8,9,11,12,13,14},{4,8,9,11,12,13,14,15},{4,8,9,11,12,13,15},{4,8,9,11,12,14},{4,8,9,11,12,14,15},{4,8,9,11,12,15},{4,8,9,11,13},{4,8,9,11,13,14},{4,8,9,11,13,14,15},{4,8,9,11,13,15},{4,8,9,11,14},{4,8,9,11,14,15},{4,8,9,11,15},{4,8,9,12},{4,8,9,12,13},{4,8,9,12,13,14},{4,8,9,12,13,14,15},{4,8,9,12,13,15},{4,8,9,12,14},{4,8,9,12,14,15},{4,8,9,12,15},{4,8,9,13},{4,8,9,13,14},{4,8,9,13,14,15},{4,8,9,13,15},{4,8,9,14},{4,8,9,14,15},{4,8,9,15},{4,8,10},{4,8,10,11},{4,8,10,11,12},{4,8,10,11,12,13},{4,8,10,11,12,13,14},{4,8,10,11,12,13,14,15},{4,8,10,11,12,13,15},{4,8,10,11,12,14},{4,8,10,11,12,14,15},{4,8,10,11,12,15},{4,8,10,11,13},{4,8,10,11,13,14},{4,8,10,11,13,14,15},{4,8,10,11,13,15},{4,8,10,11,14},{4,8,10,11,14,15},{4,8,10,11,15},{4,8,10,12},{4,8,10,12,13},{4,8,10,12,13,14},{4,8,10,12,13,14,15},{4,8,10,12,13,15},{4,8,10,12,14},{4,8,10,12,14,15},{4,8,10,12,15},{4,8,10,13},{4,8,10,13,14},{4,8,10,13,14,15},{4,8,10,13,15},{4,8,10,14},{4,8,10,14,15},{4,8,10,15},{4,8,11},{4,8,11,12},{4,8,11,12,13},{4,8,11,12,13,14},{4,8,11,12,13,14,15},{4,8,11,12,13,15},{4,8,11,12,14},{4,8,11,12,14,15},{4,8,11,12,15},{4,8,11,13},{4,8,11,13,14},{4,8,11,13,14,15},{4,8,11,13,15},{4,8,11,14},{4,8,11,14,15},{4,8,11,15},{4,8,12},{4,8,12,13},{4,8,12,13,14},{4,8,12,13,14,15},{4,8,12,13,15},{4,8,12,14},{4,8,12,14,15},{4,8,12,15},{4,8,13},{4,8,13,14},{4,8,13,14,15},{4,8,13,15},{4,8,14},{4,8,14,15},{4,8,15},{4,9},{4,9,10},{4,9,10,11},{4,9,10,11,12},{4,9,10,11,12,13},{4,9,10,11,12,13,14},{4,9,10,11,12,13,14,15},{4,9,10,11,12,13,15},{4,9,10,11,12,14},{4,9,10,11,12,14,15},{4,9,10,11,12,15},{4,9,10,11,13},{4,9,10,11,13,14},{4,9,10,11,13,14,15},{4,9,10,11,13,15},{4,9,10,11,14},{4,9,10,11,14,15},{4,9,10,11,15},{4,9,10,12},{4,9,10,12,13},{4,9,10,12,13,14},{4,9,10,12,13,14,15},{4,9,10,12,13,15},{4,9,10,12,14},{4,9,10,12,14,15},{4,9,10,12,15},{4,9,10,13},{4,9,10,13,14},{4,9,10,13,14,15},{4,9,10,13,15},{4,9,10,14},{4,9,10,14,15},{4,9,10,15},{4,9,11},{4,9,11,12},{4,9,11,12,13},{4,9,11,12,13,14},{4,9,11,12,13,14,15},{4,9,11,12,13,15},{4,9,11,12,14},{4,9,11,12,14,15},{4,9,11,12,15},{4,9,11,13},{4,9,11,13,14},{4,9,11,13,14,15},{4,9,11,13,15},{4,9,11,14},{4,9,11,14,15},{4,9,11,15},{4,9,12},{4,9,12,13},{4,9,12,13,14},{4,9,12,13,14,15},{4,9,12,13,15},{4,9,12,14},{4,9,12,14,15},{4,9,12,15},{4,9,13},{4,9,13,14},{4,9,13,14,15},{4,9,13,15},{4,9,14},{4,9,14,15},{4,9,15},{4,10},{4,10,11},{4,10,11,12},{4,10,11,12,13},{4,10,11,12,13,14},{4,10,11,12,13,14,15},{4,10,11,12,13,15},{4,10,11,12,14},{4,10,11,12,14,15},{4,10,11,12,15},{4,10,11,13},{4,10,11,13,14},{4,10,11,13,14,15},{4,10,11,13,15},{4,10,11,14},{4,10,11,14,15},{4,10,11,15},{4,10,12},{4,10,12,13},{4,10,12,13,14},{4,10,12,13,14,15},{4,10,12,13,15},{4,10,12,14},{4,10,12,14,15},{4,10,12,15},{4,10,13},{4,10,13,14},{4,10,13,14,15},{4,10,13,15},{4,10,14},{4,10,14,15},{4,10,15},{4,11},{4,11,12},{4,11,12,13},{4,11,12,13,14},{4,11,12,13,14,15},{4,11,12,13,15},{4,11,12,14},{4,11,12,14,15},{4,11,12,15},{4,11,13},{4,11,13,14},{4,11,13,14,15},{4,11,13,15},{4,11,14},{4,11,14,15},{4,11,15},{4,12},{4,12,13},{4,12,13,14},{4,12,13,14,15},{4,12,13,15},{4,12,14},{4,12,14,15},{4,12,15},{4,13},{4,13,14},{4,13,14,15},{4,13,15},{4,14},{4,14,15},{4,15},{5,6},{5,6,7},{5,6,7,8},{5,6,7,8,9},{5,6,7,8,9,10},{5,6,7,8,9,10,11},{5,6,7,8,9,10,11,12},{5,6,7,8,9,10,11,12,13},{5,6,7,8,9,10,11,12,13,14},{5,6,7,8,9,10,11,12,13,14,15},{5,6,7,8,9,10,11,12,13,15},{5,6,7,8,9,10,11,12,14},{5,6,7,8,9,10,11,12,14,15},{5,6,7,8,9,10,11,12,15},{5,6,7,8,9,10,11,13},{5,6,7,8,9,10,11,13,14},{5,6,7,8,9,10,11,13,14,15},{5,6,7,8,9,10,11,13,15},{5,6,7,8,9,10,11,14},{5,6,7,8,9,10,11,14,15},{5,6,7,8,9,10,11,15},{5,6,7,8,9,10,12},{5,6,7,8,9,10,12,13},{5,6,7,8,9,10,12,13,14},{5,6,7,8,9,10,12,13,14,15},{5,6,7,8,9,10,12,13,15},{5,6,7,8,9,10,12,14},{5,6,7,8,9,10,12,14,15},{5,6,7,8,9,10,12,15},{5,6,7,8,9,10,13},{5,6,7,8,9,10,13,14},{5,6,7,8,9,10,13,14,15},{5,6,7,8,9,10,13,15},{5,6,7,8,9,10,14},{5,6,7,8,9,10,14,15},{5,6,7,8,9,10,15},{5,6,7,8,9,11},{5,6,7,8,9,11,12},{5,6,7,8,9,11,12,13},{5,6,7,8,9,11,12,13,14},{5,6,7,8,9,11,12,13,14,15},{5,6,7,8,9,11,12,13,15},{5,6,7,8,9,11,12,14},{5,6,7,8,9,11,12,14,15},{5,6,7,8,9,11,12,15},{5,6,7,8,9,11,13},{5,6,7,8,9,11,13,14},{5,6,7,8,9,11,13,14,15},{5,6,7,8,9,11,13,15},{5,6,7,8,9,11,14},{5,6,7,8,9,11,14,15},{5,6,7,8,9,11,15},{5,6,7,8,9,12},{5,6,7,8,9,12,13},{5,6,7,8,9,12,13,14},{5,6,7,8,9,12,13,14,15},{5,6,7,8,9,12,13,15},{5,6,7,8,9,12,14},{5,6,7,8,9,12,14,15},{5,6,7,8,9,12,15},{5,6,7,8,9,13},{5,6,7,8,9,13,14},{5,6,7,8,9,13,14,15},{5,6,7,8,9,13,15},{5,6,7,8,9,14},{5,6,7,8,9,14,15},{5,6,7,8,9,15},{5,6,7,8,10},{5,6,7,8,10,11},{5,6,7,8,10,11,12},{5,6,7,8,10,11,12,13},{5,6,7,8,10,11,12,13,14},{5,6,7,8,10,11,12,13,14,15},{5,6,7,8,10,11,12,13,15},{5,6,7,8,10,11,12,14},{5,6,7,8,10,11,12,14,15},{5,6,7,8,10,11,12,15},{5,6,7,8,10,11,13},{5,6,7,8,10,11,13,14},{5,6,7,8,10,11,13,14,15},{5,6,7,8,10,11,13,15},{5,6,7,8,10,11,14},{5,6,7,8,10,11,14,15},{5,6,7,8,10,11,15},{5,6,7,8,10,12},{5,6,7,8,10,12,13},{5,6,7,8,10,12,13,14},{5,6,7,8,10,12,13,14,15},{5,6,7,8,10,12,13,15},{5,6,7,8,10,12,14},{5,6,7,8,10,12,14,15},{5,6,7,8,10,12,15},{5,6,7,8,10,13},{5,6,7,8,10,13,14},{5,6,7,8,10,13,14,15},{5,6,7,8,10,13,15},{5,6,7,8,10,14},{5,6,7,8,10,14,15},{5,6,7,8,10,15},{5,6,7,8,11},{5,6,7,8,11,12},{5,6,7,8,11,12,13},{5,6,7,8,11,12,13,14},{5,6,7,8,11,12,13,14,15},{5,6,7,8,11,12,13,15},{5,6,7,8,11,12,14},{5,6,7,8,11,12,14,15},{5,6,7,8,11,12,15},{5,6,7,8,11,13},{5,6,7,8,11,13,14},{5,6,7,8,11,13,14,15},{5,6,7,8,11,13,15},{5,6,7,8,11,14},{5,6,7,8,11,14,15},{5,6,7,8,11,15},{5,6,7,8,12},{5,6,7,8,12,13},{5,6,7,8,12,13,14},{5,6,7,8,12,13,14,15},{5,6,7,8,12,13,15},{5,6,7,8,12,14},{5,6,7,8,12,14,15},{5,6,7,8,12,15},{5,6,7,8,13},{5,6,7,8,13,14},{5,6,7,8,13,14,15},{5,6,7,8,13,15},{5,6,7,8,14},{5,6,7,8,14,15},{5,6,7,8,15},{5,6,7,9},{5,6,7,9,10},{5,6,7,9,10,11},{5,6,7,9,10,11,12},{5,6,7,9,10,11,12,13},{5,6,7,9,10,11,12,13,14},{5,6,7,9,10,11,12,13,14,15},{5,6,7,9,10,11,12,13,15},{5,6,7,9,10,11,12,14},{5,6,7,9,10,11,12,14,15},{5,6,7,9,10,11,12,15},{5,6,7,9,10,11,13},{5,6,7,9,10,11,13,14},{5,6,7,9,10,11,13,14,15},{5,6,7,9,10,11,13,15},{5,6,7,9,10,11,14},{5,6,7,9,10,11,14,15},{5,6,7,9,10,11,15},{5,6,7,9,10,12},{5,6,7,9,10,12,13},{5,6,7,9,10,12,13,14},{5,6,7,9,10,12,13,14,15},{5,6,7,9,10,12,13,15},{5,6,7,9,10,12,14},{5,6,7,9,10,12,14,15},{5,6,7,9,10,12,15},{5,6,7,9,10,13},{5,6,7,9,10,13,14},{5,6,7,9,10,13,14,15},{5,6,7,9,10,13,15},{5,6,7,9,10,14},{5,6,7,9,10,14,15},{5,6,7,9,10,15},{5,6,7,9,11},{5,6,7,9,11,12},{5,6,7,9,11,12,13},{5,6,7,9,11,12,13,14},{5,6,7,9,11,12,13,14,15},{5,6,7,9,11,12,13,15},{5,6,7,9,11,12,14},{5,6,7,9,11,12,14,15},{5,6,7,9,11,12,15},{5,6,7,9,11,13},{5,6,7,9,11,13,14},{5,6,7,9,11,13,14,15},{5,6,7,9,11,13,15},{5,6,7,9,11,14},{5,6,7,9,11,14,15},{5,6,7,9,11,15},{5,6,7,9,12},{5,6,7,9,12,13},{5,6,7,9,12,13,14},{5,6,7,9,12,13,14,15},{5,6,7,9,12,13,15},{5,6,7,9,12,14},{5,6,7,9,12,14,15},{5,6,7,9,12,15},{5,6,7,9,13},{5,6,7,9,13,14},{5,6,7,9,13,14,15},{5,6,7,9,13,15},{5,6,7,9,14},{5,6,7,9,14,15},{5,6,7,9,15},{5,6,7,10},{5,6,7,10,11},{5,6,7,10,11,12},{5,6,7,10,11,12,13},{5,6,7,10,11,12,13,14},{5,6,7,10,11,12,13,14,15},{5,6,7,10,11,12,13,15},{5,6,7,10,11,12,14},{5,6,7,10,11,12,14,15},{5,6,7,10,11,12,15},{5,6,7,10,11,13},{5,6,7,10,11,13,14},{5,6,7,10,11,13,14,15},{5,6,7,10,11,13,15},{5,6,7,10,11,14},{5,6,7,10,11,14,15},{5,6,7,10,11,15},{5,6,7,10,12},{5,6,7,10,12,13},{5,6,7,10,12,13,14},{5,6,7,10,12,13,14,15},{5,6,7,10,12,13,15},{5,6,7,10,12,14},{5,6,7,10,12,14,15},{5,6,7,10,12,15},{5,6,7,10,13},{5,6,7,10,13,14},{5,6,7,10,13,14,15},{5,6,7,10,13,15},{5,6,7,10,14},{5,6,7,10,14,15},{5,6,7,10,15},{5,6,7,11},{5,6,7,11,12},{5,6,7,11,12,13},{5,6,7,11,12,13,14},{5,6,7,11,12,13,14,15},{5,6,7,11,12,13,15},{5,6,7,11,12,14},{5,6,7,11,12,14,15},{5,6,7,11,12,15},{5,6,7,11,13},{5,6,7,11,13,14},{5,6,7,11,13,14,15},{5,6,7,11,13,15},{5,6,7,11,14},{5,6,7,11,14,15},{5,6,7,11,15},{5,6,7,12},{5,6,7,12,13},{5,6,7,12,13,14},{5,6,7,12,13,14,15},{5,6,7,12,13,15},{5,6,7,12,14},{5,6,7,12,14,15},{5,6,7,12,15},{5,6,7,13},{5,6,7,13,14},{5,6,7,13,14,15},{5,6,7,13,15},{5,6,7,14},{5,6,7,14,15},{5,6,7,15},{5,6,8},{5,6,8,9},{5,6,8,9,10},{5,6,8,9,10,11},{5,6,8,9,10,11,12},{5,6,8,9,10,11,12,13},{5,6,8,9,10,11,12,13,14},{5,6,8,9,10,11,12,13,14,15},{5,6,8,9,10,11,12,13,15},{5,6,8,9,10,11,12,14},{5,6,8,9,10,11,12,14,15},{5,6,8,9,10,11,12,15},{5,6,8,9,10,11,13},{5,6,8,9,10,11,13,14},{5,6,8,9,10,11,13,14,15},{5,6,8,9,10,11,13,15},{5,6,8,9,10,11,14},{5,6,8,9,10,11,14,15},{5,6,8,9,10,11,15},{5,6,8,9,10,12},{5,6,8,9,10,12,13},{5,6,8,9,10,12,13,14},{5,6,8,9,10,12,13,14,15},{5,6,8,9,10,12,13,15},{5,6,8,9,10,12,14},{5,6,8,9,10,12,14,15},{5,6,8,9,10,12,15},{5,6,8,9,10,13},{5,6,8,9,10,13,14},{5,6,8,9,10,13,14,15},{5,6,8,9,10,13,15},{5,6,8,9,10,14},{5,6,8,9,10,14,15},{5,6,8,9,10,15},{5,6,8,9,11},{5,6,8,9,11,12},{5,6,8,9,11,12,13},{5,6,8,9,11,12,13,14},{5,6,8,9,11,12,13,14,15},{5,6,8,9,11,12,13,15},{5,6,8,9,11,12,14},{5,6,8,9,11,12,14,15},{5,6,8,9,11,12,15},{5,6,8,9,11,13},{5,6,8,9,11,13,14},{5,6,8,9,11,13,14,15},{5,6,8,9,11,13,15},{5,6,8,9,11,14},{5,6,8,9,11,14,15},{5,6,8,9,11,15},{5,6,8,9,12},{5,6,8,9,12,13},{5,6,8,9,12,13,14},{5,6,8,9,12,13,14,15},{5,6,8,9,12,13,15},{5,6,8,9,12,14},{5,6,8,9,12,14,15},{5,6,8,9,12,15},{5,6,8,9,13},{5,6,8,9,13,14},{5,6,8,9,13,14,15},{5,6,8,9,13,15},{5,6,8,9,14},{5,6,8,9,14,15},{5,6,8,9,15},{5,6,8,10},{5,6,8,10,11},{5,6,8,10,11,12},{5,6,8,10,11,12,13},{5,6,8,10,11,12,13,14},{5,6,8,10,11,12,13,14,15},{5,6,8,10,11,12,13,15},{5,6,8,10,11,12,14},{5,6,8,10,11,12,14,15},{5,6,8,10,11,12,15},{5,6,8,10,11,13},{5,6,8,10,11,13,14},{5,6,8,10,11,13,14,15},{5,6,8,10,11,13,15},{5,6,8,10,11,14},{5,6,8,10,11,14,15},{5,6,8,10,11,15},{5,6,8,10,12},{5,6,8,10,12,13},{5,6,8,10,12,13,14},{5,6,8,10,12,13,14,15},{5,6,8,10,12,13,15},{5,6,8,10,12,14},{5,6,8,10,12,14,15},{5,6,8,10,12,15},{5,6,8,10,13},{5,6,8,10,13,14},{5,6,8,10,13,14,15},{5,6,8,10,13,15},{5,6,8,10,14},{5,6,8,10,14,15},{5,6,8,10,15},{5,6,8,11},{5,6,8,11,12},{5,6,8,11,12,13},{5,6,8,11,12,13,14},{5,6,8,11,12,13,14,15},{5,6,8,11,12,13,15},{5,6,8,11,12,14},{5,6,8,11,12,14,15},{5,6,8,11,12,15},{5,6,8,11,13},{5,6,8,11,13,14},{5,6,8,11,13,14,15},{5,6,8,11,13,15},{5,6,8,11,14},{5,6,8,11,14,15},{5,6,8,11,15},{5,6,8,12},{5,6,8,12,13},{5,6,8,12,13,14},{5,6,8,12,13,14,15},{5,6,8,12,13,15},{5,6,8,12,14},{5,6,8,12,14,15},{5,6,8,12,15},{5,6,8,13},{5,6,8,13,14},{5,6,8,13,14,15},{5,6,8,13,15},{5,6,8,14},{5,6,8,14,15},{5,6,8,15},{5,6,9},{5,6,9,10},{5,6,9,10,11},{5,6,9,10,11,12},{5,6,9,10,11,12,13},{5,6,9,10,11,12,13,14},{5,6,9,10,11,12,13,14,15},{5,6,9,10,11,12,13,15},{5,6,9,10,11,12,14},{5,6,9,10,11,12,14,15},{5,6,9,10,11,12,15},{5,6,9,10,11,13},{5,6,9,10,11,13,14},{5,6,9,10,11,13,14,15},{5,6,9,10,11,13,15},{5,6,9,10,11,14},{5,6,9,10,11,14,15},{5,6,9,10,11,15},{5,6,9,10,12},{5,6,9,10,12,13},{5,6,9,10,12,13,14},{5,6,9,10,12,13,14,15},{5,6,9,10,12,13,15},{5,6,9,10,12,14},{5,6,9,10,12,14,15},{5,6,9,10,12,15},{5,6,9,10,13},{5,6,9,10,13,14},{5,6,9,10,13,14,15},{5,6,9,10,13,15},{5,6,9,10,14},{5,6,9,10,14,15},{5,6,9,10,15},{5,6,9,11},{5,6,9,11,12},{5,6,9,11,12,13},{5,6,9,11,12,13,14},{5,6,9,11,12,13,14,15},{5,6,9,11,12,13,15},{5,6,9,11,12,14},{5,6,9,11,12,14,15},{5,6,9,11,12,15},{5,6,9,11,13},{5,6,9,11,13,14},{5,6,9,11,13,14,15},{5,6,9,11,13,15},{5,6,9,11,14},{5,6,9,11,14,15},{5,6,9,11,15},{5,6,9,12},{5,6,9,12,13},{5,6,9,12,13,14},{5,6,9,12,13,14,15},{5,6,9,12,13,15},{5,6,9,12,14},{5,6,9,12,14,15},{5,6,9,12,15},{5,6,9,13},{5,6,9,13,14},{5,6,9,13,14,15},{5,6,9,13,15},{5,6,9,14},{5,6,9,14,15},{5,6,9,15},{5,6,10},{5,6,10,11},{5,6,10,11,12},{5,6,10,11,12,13},{5,6,10,11,12,13,14},{5,6,10,11,12,13,14,15},{5,6,10,11,12,13,15},{5,6,10,11,12,14},{5,6,10,11,12,14,15},{5,6,10,11,12,15},{5,6,10,11,13},{5,6,10,11,13,14},{5,6,10,11,13,14,15},{5,6,10,11,13,15},{5,6,10,11,14},{5,6,10,11,14,15},{5,6,10,11,15},{5,6,10,12},{5,6,10,12,13},{5,6,10,12,13,14},{5,6,10,12,13,14,15},{5,6,10,12,13,15},{5,6,10,12,14},{5,6,10,12,14,15},{5,6,10,12,15},{5,6,10,13},{5,6,10,13,14},{5,6,10,13,14,15},{5,6,10,13,15},{5,6,10,14},{5,6,10,14,15},{5,6,10,15},{5,6,11},{5,6,11,12},{5,6,11,12,13},{5,6,11,12,13,14},{5,6,11,12,13,14,15},{5,6,11,12,13,15},{5,6,11,12,14},{5,6,11,12,14,15},{5,6,11,12,15},{5,6,11,13},{5,6,11,13,14},{5,6,11,13,14,15},{5,6,11,13,15},{5,6,11,14},{5,6,11,14,15},{5,6,11,15},{5,6,12},{5,6,12,13},{5,6,12,13,14},{5,6,12,13,14,15},{5,6,12,13,15},{5,6,12,14},{5,6,12,14,15},{5,6,12,15},{5,6,13},{5,6,13,14},{5,6,13,14,15},{5,6,13,15},{5,6,14},{5,6,14,15},{5,6,15},{5,7},{5,7,8},{5,7,8,9},{5,7,8,9,10},{5,7,8,9,10,11},{5,7,8,9,10,11,12},{5,7,8,9,10,11,12,13},{5,7,8,9,10,11,12,13,14},{5,7,8,9,10,11,12,13,14,15},{5,7,8,9,10,11,12,13,15},{5,7,8,9,10,11,12,14},{5,7,8,9,10,11,12,14,15},{5,7,8,9,10,11,12,15},{5,7,8,9,10,11,13},{5,7,8,9,10,11,13,14},{5,7,8,9,10,11,13,14,15},{5,7,8,9,10,11,13,15},{5,7,8,9,10,11,14},{5,7,8,9,10,11,14,15},{5,7,8,9,10,11,15},{5,7,8,9,10,12},{5,7,8,9,10,12,13},{5,7,8,9,10,12,13,14},{5,7,8,9,10,12,13,14,15},{5,7,8,9,10,12,13,15},{5,7,8,9,10,12,14},{5,7,8,9,10,12,14,15},{5,7,8,9,10,12,15},{5,7,8,9,10,13},{5,7,8,9,10,13,14},{5,7,8,9,10,13,14,15},{5,7,8,9,10,13,15},{5,7,8,9,10,14},{5,7,8,9,10,14,15},{5,7,8,9,10,15},{5,7,8,9,11},{5,7,8,9,11,12},{5,7,8,9,11,12,13},{5,7,8,9,11,12,13,14},{5,7,8,9,11,12,13,14,15},{5,7,8,9,11,12,13,15},{5,7,8,9,11,12,14},{5,7,8,9,11,12,14,15},{5,7,8,9,11,12,15},{5,7,8,9,11,13},{5,7,8,9,11,13,14},{5,7,8,9,11,13,14,15},{5,7,8,9,11,13,15},{5,7,8,9,11,14},{5,7,8,9,11,14,15},{5,7,8,9,11,15},{5,7,8,9,12},{5,7,8,9,12,13},{5,7,8,9,12,13,14},{5,7,8,9,12,13,14,15},{5,7,8,9,12,13,15},{5,7,8,9,12,14},{5,7,8,9,12,14,15},{5,7,8,9,12,15},{5,7,8,9,13},{5,7,8,9,13,14},{5,7,8,9,13,14,15},{5,7,8,9,13,15},{5,7,8,9,14},{5,7,8,9,14,15},{5,7,8,9,15},{5,7,8,10},{5,7,8,10,11},{5,7,8,10,11,12},{5,7,8,10,11,12,13},{5,7,8,10,11,12,13,14},{5,7,8,10,11,12,13,14,15},{5,7,8,10,11,12,13,15},{5,7,8,10,11,12,14},{5,7,8,10,11,12,14,15},{5,7,8,10,11,12,15},{5,7,8,10,11,13},{5,7,8,10,11,13,14},{5,7,8,10,11,13,14,15},{5,7,8,10,11,13,15},{5,7,8,10,11,14},{5,7,8,10,11,14,15},{5,7,8,10,11,15},{5,7,8,10,12},{5,7,8,10,12,13},{5,7,8,10,12,13,14},{5,7,8,10,12,13,14,15},{5,7,8,10,12,13,15},{5,7,8,10,12,14},{5,7,8,10,12,14,15},{5,7,8,10,12,15},{5,7,8,10,13},{5,7,8,10,13,14},{5,7,8,10,13,14,15},{5,7,8,10,13,15},{5,7,8,10,14},{5,7,8,10,14,15},{5,7,8,10,15},{5,7,8,11},{5,7,8,11,12},{5,7,8,11,12,13},{5,7,8,11,12,13,14},{5,7,8,11,12,13,14,15},{5,7,8,11,12,13,15},{5,7,8,11,12,14},{5,7,8,11,12,14,15},{5,7,8,11,12,15},{5,7,8,11,13},{5,7,8,11,13,14},{5,7,8,11,13,14,15},{5,7,8,11,13,15},{5,7,8,11,14},{5,7,8,11,14,15},{5,7,8,11,15},{5,7,8,12},{5,7,8,12,13},{5,7,8,12,13,14},{5,7,8,12,13,14,15},{5,7,8,12,13,15},{5,7,8,12,14},{5,7,8,12,14,15},{5,7,8,12,15},{5,7,8,13},{5,7,8,13,14},{5,7,8,13,14,15},{5,7,8,13,15},{5,7,8,14},{5,7,8,14,15},{5,7,8,15},{5,7,9},{5,7,9,10},{5,7,9,10,11},{5,7,9,10,11,12},{5,7,9,10,11,12,13},{5,7,9,10,11,12,13,14},{5,7,9,10,11,12,13,14,15},{5,7,9,10,11,12,13,15},{5,7,9,10,11,12,14},{5,7,9,10,11,12,14,15},{5,7,9,10,11,12,15},{5,7,9,10,11,13},{5,7,9,10,11,13,14},{5,7,9,10,11,13,14,15},{5,7,9,10,11,13,15},{5,7,9,10,11,14},{5,7,9,10,11,14,15},{5,7,9,10,11,15},{5,7,9,10,12},{5,7,9,10,12,13},{5,7,9,10,12,13,14},{5,7,9,10,12,13,14,15},{5,7,9,10,12,13,15},{5,7,9,10,12,14},{5,7,9,10,12,14,15},{5,7,9,10,12,15},{5,7,9,10,13},{5,7,9,10,13,14},{5,7,9,10,13,14,15},{5,7,9,10,13,15},{5,7,9,10,14},{5,7,9,10,14,15},{5,7,9,10,15},{5,7,9,11},{5,7,9,11,12},{5,7,9,11,12,13},{5,7,9,11,12,13,14},{5,7,9,11,12,13,14,15},{5,7,9,11,12,13,15},{5,7,9,11,12,14},{5,7,9,11,12,14,15},{5,7,9,11,12,15},{5,7,9,11,13},{5,7,9,11,13,14},{5,7,9,11,13,14,15},{5,7,9,11,13,15},{5,7,9,11,14},{5,7,9,11,14,15},{5,7,9,11,15},{5,7,9,12},{5,7,9,12,13},{5,7,9,12,13,14},{5,7,9,12,13,14,15},{5,7,9,12,13,15},{5,7,9,12,14},{5,7,9,12,14,15},{5,7,9,12,15},{5,7,9,13},{5,7,9,13,14},{5,7,9,13,14,15},{5,7,9,13,15},{5,7,9,14},{5,7,9,14,15},{5,7,9,15},{5,7,10},{5,7,10,11},{5,7,10,11,12},{5,7,10,11,12,13},{5,7,10,11,12,13,14},{5,7,10,11,12,13,14,15},{5,7,10,11,12,13,15},{5,7,10,11,12,14},{5,7,10,11,12,14,15},{5,7,10,11,12,15},{5,7,10,11,13},{5,7,10,11,13,14},{5,7,10,11,13,14,15},{5,7,10,11,13,15},{5,7,10,11,14},{5,7,10,11,14,15},{5,7,10,11,15},{5,7,10,12},{5,7,10,12,13},{5,7,10,12,13,14},{5,7,10,12,13,14,15},{5,7,10,12,13,15},{5,7,10,12,14},{5,7,10,12,14,15},{5,7,10,12,15},{5,7,10,13},{5,7,10,13,14},{5,7,10,13,14,15},{5,7,10,13,15},{5,7,10,14},{5,7,10,14,15},{5,7,10,15},{5,7,11},{5,7,11,12},{5,7,11,12,13},{5,7,11,12,13,14},{5,7,11,12,13,14,15},{5,7,11,12,13,15},{5,7,11,12,14},{5,7,11,12,14,15},{5,7,11,12,15},{5,7,11,13},{5,7,11,13,14},{5,7,11,13,14,15},{5,7,11,13,15},{5,7,11,14},{5,7,11,14,15},{5,7,11,15},{5,7,12},{5,7,12,13},{5,7,12,13,14},{5,7,12,13,14,15},{5,7,12,13,15},{5,7,12,14},{5,7,12,14,15},{5,7,12,15},{5,7,13},{5,7,13,14},{5,7,13,14,15},{5,7,13,15},{5,7,14},{5,7,14,15},{5,7,15},{5,8},{5,8,9},{5,8,9,10},{5,8,9,10,11},{5,8,9,10,11,12},{5,8,9,10,11,12,13},{5,8,9,10,11,12,13,14},{5,8,9,10,11,12,13,14,15},{5,8,9,10,11,12,13,15},{5,8,9,10,11,12,14},{5,8,9,10,11,12,14,15},{5,8,9,10,11,12,15},{5,8,9,10,11,13},{5,8,9,10,11,13,14},{5,8,9,10,11,13,14,15},{5,8,9,10,11,13,15},{5,8,9,10,11,14},{5,8,9,10,11,14,15},{5,8,9,10,11,15},{5,8,9,10,12},{5,8,9,10,12,13},{5,8,9,10,12,13,14},{5,8,9,10,12,13,14,15},{5,8,9,10,12,13,15},{5,8,9,10,12,14},{5,8,9,10,12,14,15},{5,8,9,10,12,15},{5,8,9,10,13},{5,8,9,10,13,14},{5,8,9,10,13,14,15},{5,8,9,10,13,15},{5,8,9,10,14},{5,8,9,10,14,15},{5,8,9,10,15},{5,8,9,11},{5,8,9,11,12},{5,8,9,11,12,13},{5,8,9,11,12,13,14},{5,8,9,11,12,13,14,15},{5,8,9,11,12,13,15},{5,8,9,11,12,14},{5,8,9,11,12,14,15},{5,8,9,11,12,15},{5,8,9,11,13},{5,8,9,11,13,14},{5,8,9,11,13,14,15},{5,8,9,11,13,15},{5,8,9,11,14},{5,8,9,11,14,15},{5,8,9,11,15},{5,8,9,12},{5,8,9,12,13},{5,8,9,12,13,14},{5,8,9,12,13,14,15},{5,8,9,12,13,15},{5,8,9,12,14},{5,8,9,12,14,15},{5,8,9,12,15},{5,8,9,13},{5,8,9,13,14},{5,8,9,13,14,15},{5,8,9,13,15},{5,8,9,14},{5,8,9,14,15},{5,8,9,15},{5,8,10},{5,8,10,11},{5,8,10,11,12},{5,8,10,11,12,13},{5,8,10,11,12,13,14},{5,8,10,11,12,13,14,15},{5,8,10,11,12,13,15},{5,8,10,11,12,14},{5,8,10,11,12,14,15},{5,8,10,11,12,15},{5,8,10,11,13},{5,8,10,11,13,14},{5,8,10,11,13,14,15},{5,8,10,11,13,15},{5,8,10,11,14},{5,8,10,11,14,15},{5,8,10,11,15},{5,8,10,12},{5,8,10,12,13},{5,8,10,12,13,14},{5,8,10,12,13,14,15},{5,8,10,12,13,15},{5,8,10,12,14},{5,8,10,12,14,15},{5,8,10,12,15},{5,8,10,13},{5,8,10,13,14},{5,8,10,13,14,15},{5,8,10,13,15},{5,8,10,14},{5,8,10,14,15},{5,8,10,15},{5,8,11},{5,8,11,12},{5,8,11,12,13},{5,8,11,12,13,14},{5,8,11,12,13,14,15},{5,8,11,12,13,15},{5,8,11,12,14},{5,8,11,12,14,15},{5,8,11,12,15},{5,8,11,13},{5,8,11,13,14},{5,8,11,13,14,15},{5,8,11,13,15},{5,8,11,14},{5,8,11,14,15},{5,8,11,15},{5,8,12},{5,8,12,13},{5,8,12,13,14},{5,8,12,13,14,15},{5,8,12,13,15},{5,8,12,14},{5,8,12,14,15},{5,8,12,15},{5,8,13},{5,8,13,14},{5,8,13,14,15},{5,8,13,15},{5,8,14},{5,8,14,15},{5,8,15},{5,9},{5,9,10},{5,9,10,11},{5,9,10,11,12},{5,9,10,11,12,13},{5,9,10,11,12,13,14},{5,9,10,11,12,13,14,15},{5,9,10,11,12,13,15},{5,9,10,11,12,14},{5,9,10,11,12,14,15},{5,9,10,11,12,15},{5,9,10,11,13},{5,9,10,11,13,14},{5,9,10,11,13,14,15},{5,9,10,11,13,15},{5,9,10,11,14},{5,9,10,11,14,15},{5,9,10,11,15},{5,9,10,12},{5,9,10,12,13},{5,9,10,12,13,14},{5,9,10,12,13,14,15},{5,9,10,12,13,15},{5,9,10,12,14},{5,9,10,12,14,15},{5,9,10,12,15},{5,9,10,13},{5,9,10,13,14},{5,9,10,13,14,15},{5,9,10,13,15},{5,9,10,14},{5,9,10,14,15},{5,9,10,15},{5,9,11},{5,9,11,12},{5,9,11,12,13},{5,9,11,12,13,14},{5,9,11,12,13,14,15},{5,9,11,12,13,15},{5,9,11,12,14},{5,9,11,12,14,15},{5,9,11,12,15},{5,9,11,13},{5,9,11,13,14},{5,9,11,13,14,15},{5,9,11,13,15},{5,9,11,14},{5,9,11,14,15},{5,9,11,15},{5,9,12},{5,9,12,13},{5,9,12,13,14},{5,9,12,13,14,15},{5,9,12,13,15},{5,9,12,14},{5,9,12,14,15},{5,9,12,15},{5,9,13},{5,9,13,14},{5,9,13,14,15},{5,9,13,15},{5,9,14},{5,9,14,15},{5,9,15},{5,10},{5,10,11},{5,10,11,12},{5,10,11,12,13},{5,10,11,12,13,14},{5,10,11,12,13,14,15},{5,10,11,12,13,15},{5,10,11,12,14},{5,10,11,12,14,15},{5,10,11,12,15},{5,10,11,13},{5,10,11,13,14},{5,10,11,13,14,15},{5,10,11,13,15},{5,10,11,14},{5,10,11,14,15},{5,10,11,15},{5,10,12},{5,10,12,13},{5,10,12,13,14},{5,10,12,13,14,15},{5,10,12,13,15},{5,10,12,14},{5,10,12,14,15},{5,10,12,15},{5,10,13},{5,10,13,14},{5,10,13,14,15},{5,10,13,15},{5,10,14},{5,10,14,15},{5,10,15},{5,11},{5,11,12},{5,11,12,13},{5,11,12,13,14},{5,11,12,13,14,15},{5,11,12,13,15},{5,11,12,14},{5,11,12,14,15},{5,11,12,15},{5,11,13},{5,11,13,14},{5,11,13,14,15},{5,11,13,15},{5,11,14},{5,11,14,15},{5,11,15},{5,12},{5,12,13},{5,12,13,14},{5,12,13,14,15},{5,12,13,15},{5,12,14},{5,12,14,15},{5,12,15},{5,13},{5,13,14},{5,13,14,15},{5,13,15},{5,14},{5,14,15},{5,15},{6,7},{6,7,8},{6,7,8,9},{6,7,8,9,10},{6,7,8,9,10,11},{6,7,8,9,10,11,12},{6,7,8,9,10,11,12,13},{6,7,8,9,10,11,12,13,14},{6,7,8,9,10,11,12,13,14,15},{6,7,8,9,10,11,12,13,15},{6,7,8,9,10,11,12,14},{6,7,8,9,10,11,12,14,15},{6,7,8,9,10,11,12,15},{6,7,8,9,10,11,13},{6,7,8,9,10,11,13,14},{6,7,8,9,10,11,13,14,15},{6,7,8,9,10,11,13,15},{6,7,8,9,10,11,14},{6,7,8,9,10,11,14,15},{6,7,8,9,10,11,15},{6,7,8,9,10,12},{6,7,8,9,10,12,13},{6,7,8,9,10,12,13,14},{6,7,8,9,10,12,13,14,15},{6,7,8,9,10,12,13,15},{6,7,8,9,10,12,14},{6,7,8,9,10,12,14,15},{6,7,8,9,10,12,15},{6,7,8,9,10,13},{6,7,8,9,10,13,14},{6,7,8,9,10,13,14,15},{6,7,8,9,10,13,15},{6,7,8,9,10,14},{6,7,8,9,10,14,15},{6,7,8,9,10,15},{6,7,8,9,11},{6,7,8,9,11,12},{6,7,8,9,11,12,13},{6,7,8,9,11,12,13,14},{6,7,8,9,11,12,13,14,15},{6,7,8,9,11,12,13,15},{6,7,8,9,11,12,14},{6,7,8,9,11,12,14,15},{6,7,8,9,11,12,15},{6,7,8,9,11,13},{6,7,8,9,11,13,14},{6,7,8,9,11,13,14,15},{6,7,8,9,11,13,15},{6,7,8,9,11,14},{6,7,8,9,11,14,15},{6,7,8,9,11,15},{6,7,8,9,12},{6,7,8,9,12,13},{6,7,8,9,12,13,14},{6,7,8,9,12,13,14,15},{6,7,8,9,12,13,15},{6,7,8,9,12,14},{6,7,8,9,12,14,15},{6,7,8,9,12,15},{6,7,8,9,13},{6,7,8,9,13,14},{6,7,8,9,13,14,15},{6,7,8,9,13,15},{6,7,8,9,14},{6,7,8,9,14,15},{6,7,8,9,15},{6,7,8,10},{6,7,8,10,11},{6,7,8,10,11,12},{6,7,8,10,11,12,13},{6,7,8,10,11,12,13,14},{6,7,8,10,11,12,13,14,15},{6,7,8,10,11,12,13,15},{6,7,8,10,11,12,14},{6,7,8,10,11,12,14,15},{6,7,8,10,11,12,15},{6,7,8,10,11,13},{6,7,8,10,11,13,14},{6,7,8,10,11,13,14,15},{6,7,8,10,11,13,15},{6,7,8,10,11,14},{6,7,8,10,11,14,15},{6,7,8,10,11,15},{6,7,8,10,12},{6,7,8,10,12,13},{6,7,8,10,12,13,14},{6,7,8,10,12,13,14,15},{6,7,8,10,12,13,15},{6,7,8,10,12,14},{6,7,8,10,12,14,15},{6,7,8,10,12,15},{6,7,8,10,13},{6,7,8,10,13,14},{6,7,8,10,13,14,15},{6,7,8,10,13,15},{6,7,8,10,14},{6,7,8,10,14,15},{6,7,8,10,15},{6,7,8,11},{6,7,8,11,12},{6,7,8,11,12,13},{6,7,8,11,12,13,14},{6,7,8,11,12,13,14,15},{6,7,8,11,12,13,15},{6,7,8,11,12,14},{6,7,8,11,12,14,15},{6,7,8,11,12,15},{6,7,8,11,13},{6,7,8,11,13,14},{6,7,8,11,13,14,15},{6,7,8,11,13,15},{6,7,8,11,14},{6,7,8,11,14,15},{6,7,8,11,15},{6,7,8,12},{6,7,8,12,13},{6,7,8,12,13,14},{6,7,8,12,13,14,15},{6,7,8,12,13,15},{6,7,8,12,14},{6,7,8,12,14,15},{6,7,8,12,15},{6,7,8,13},{6,7,8,13,14},{6,7,8,13,14,15},{6,7,8,13,15},{6,7,8,14},{6,7,8,14,15},{6,7,8,15},{6,7,9},{6,7,9,10},{6,7,9,10,11},{6,7,9,10,11,12},{6,7,9,10,11,12,13},{6,7,9,10,11,12,13,14},{6,7,9,10,11,12,13,14,15},{6,7,9,10,11,12,13,15},{6,7,9,10,11,12,14},{6,7,9,10,11,12,14,15},{6,7,9,10,11,12,15},{6,7,9,10,11,13},{6,7,9,10,11,13,14},{6,7,9,10,11,13,14,15},{6,7,9,10,11,13,15},{6,7,9,10,11,14},{6,7,9,10,11,14,15},{6,7,9,10,11,15},{6,7,9,10,12},{6,7,9,10,12,13},{6,7,9,10,12,13,14},{6,7,9,10,12,13,14,15},{6,7,9,10,12,13,15},{6,7,9,10,12,14},{6,7,9,10,12,14,15},{6,7,9,10,12,15},{6,7,9,10,13},{6,7,9,10,13,14},{6,7,9,10,13,14,15},{6,7,9,10,13,15},{6,7,9,10,14},{6,7,9,10,14,15},{6,7,9,10,15},{6,7,9,11},{6,7,9,11,12},{6,7,9,11,12,13},{6,7,9,11,12,13,14},{6,7,9,11,12,13,14,15},{6,7,9,11,12,13,15},{6,7,9,11,12,14},{6,7,9,11,12,14,15},{6,7,9,11,12,15},{6,7,9,11,13},{6,7,9,11,13,14},{6,7,9,11,13,14,15},{6,7,9,11,13,15},{6,7,9,11,14},{6,7,9,11,14,15},{6,7,9,11,15},{6,7,9,12},{6,7,9,12,13},{6,7,9,12,13,14},{6,7,9,12,13,14,15},{6,7,9,12,13,15},{6,7,9,12,14},{6,7,9,12,14,15},{6,7,9,12,15},{6,7,9,13},{6,7,9,13,14},{6,7,9,13,14,15},{6,7,9,13,15},{6,7,9,14},{6,7,9,14,15},{6,7,9,15},{6,7,10},{6,7,10,11},{6,7,10,11,12},{6,7,10,11,12,13},{6,7,10,11,12,13,14},{6,7,10,11,12,13,14,15},{6,7,10,11,12,13,15},{6,7,10,11,12,14},{6,7,10,11,12,14,15},{6,7,10,11,12,15},{6,7,10,11,13},{6,7,10,11,13,14},{6,7,10,11,13,14,15},{6,7,10,11,13,15},{6,7,10,11,14},{6,7,10,11,14,15},{6,7,10,11,15},{6,7,10,12},{6,7,10,12,13},{6,7,10,12,13,14},{6,7,10,12,13,14,15},{6,7,10,12,13,15},{6,7,10,12,14},{6,7,10,12,14,15},{6,7,10,12,15},{6,7,10,13},{6,7,10,13,14},{6,7,10,13,14,15},{6,7,10,13,15},{6,7,10,14},{6,7,10,14,15},{6,7,10,15},{6,7,11},{6,7,11,12},{6,7,11,12,13},{6,7,11,12,13,14},{6,7,11,12,13,14,15},{6,7,11,12,13,15},{6,7,11,12,14},{6,7,11,12,14,15},{6,7,11,12,15},{6,7,11,13},{6,7,11,13,14},{6,7,11,13,14,15},{6,7,11,13,15},{6,7,11,14},{6,7,11,14,15},{6,7,11,15},{6,7,12},{6,7,12,13},{6,7,12,13,14},{6,7,12,13,14,15},{6,7,12,13,15},{6,7,12,14},{6,7,12,14,15},{6,7,12,15},{6,7,13},{6,7,13,14},{6,7,13,14,15},{6,7,13,15},{6,7,14},{6,7,14,15},{6,7,15},{6,8},{6,8,9},{6,8,9,10},{6,8,9,10,11},{6,8,9,10,11,12},{6,8,9,10,11,12,13},{6,8,9,10,11,12,13,14},{6,8,9,10,11,12,13,14,15},{6,8,9,10,11,12,13,15},{6,8,9,10,11,12,14},{6,8,9,10,11,12,14,15},{6,8,9,10,11,12,15},{6,8,9,10,11,13},{6,8,9,10,11,13,14},{6,8,9,10,11,13,14,15},{6,8,9,10,11,13,15},{6,8,9,10,11,14},{6,8,9,10,11,14,15},{6,8,9,10,11,15},{6,8,9,10,12},{6,8,9,10,12,13},{6,8,9,10,12,13,14},{6,8,9,10,12,13,14,15},{6,8,9,10,12,13,15},{6,8,9,10,12,14},{6,8,9,10,12,14,15},{6,8,9,10,12,15},{6,8,9,10,13},{6,8,9,10,13,14},{6,8,9,10,13,14,15},{6,8,9,10,13,15},{6,8,9,10,14},{6,8,9,10,14,15},{6,8,9,10,15},{6,8,9,11},{6,8,9,11,12},{6,8,9,11,12,13},{6,8,9,11,12,13,14},{6,8,9,11,12,13,14,15},{6,8,9,11,12,13,15},{6,8,9,11,12,14},{6,8,9,11,12,14,15},{6,8,9,11,12,15},{6,8,9,11,13},{6,8,9,11,13,14},{6,8,9,11,13,14,15},{6,8,9,11,13,15},{6,8,9,11,14},{6,8,9,11,14,15},{6,8,9,11,15},{6,8,9,12},{6,8,9,12,13},{6,8,9,12,13,14},{6,8,9,12,13,14,15},{6,8,9,12,13,15},{6,8,9,12,14},{6,8,9,12,14,15},{6,8,9,12,15},{6,8,9,13},{6,8,9,13,14},{6,8,9,13,14,15},{6,8,9,13,15},{6,8,9,14},{6,8,9,14,15},{6,8,9,15},{6,8,10},{6,8,10,11},{6,8,10,11,12},{6,8,10,11,12,13},{6,8,10,11,12,13,14},{6,8,10,11,12,13,14,15},{6,8,10,11,12,13,15},{6,8,10,11,12,14},{6,8,10,11,12,14,15},{6,8,10,11,12,15},{6,8,10,11,13},{6,8,10,11,13,14},{6,8,10,11,13,14,15},{6,8,10,11,13,15},{6,8,10,11,14},{6,8,10,11,14,15},{6,8,10,11,15},{6,8,10,12},{6,8,10,12,13},{6,8,10,12,13,14},{6,8,10,12,13,14,15},{6,8,10,12,13,15},{6,8,10,12,14},{6,8,10,12,14,15},{6,8,10,12,15},{6,8,10,13},{6,8,10,13,14},{6,8,10,13,14,15},{6,8,10,13,15},{6,8,10,14},{6,8,10,14,15},{6,8,10,15},{6,8,11},{6,8,11,12},{6,8,11,12,13},{6,8,11,12,13,14},{6,8,11,12,13,14,15},{6,8,11,12,13,15},{6,8,11,12,14},{6,8,11,12,14,15},{6,8,11,12,15},{6,8,11,13},{6,8,11,13,14},{6,8,11,13,14,15},{6,8,11,13,15},{6,8,11,14},{6,8,11,14,15},{6,8,11,15},{6,8,12},{6,8,12,13},{6,8,12,13,14},{6,8,12,13,14,15},{6,8,12,13,15},{6,8,12,14},{6,8,12,14,15},{6,8,12,15},{6,8,13},{6,8,13,14},{6,8,13,14,15},{6,8,13,15},{6,8,14},{6,8,14,15},{6,8,15},{6,9},{6,9,10},{6,9,10,11},{6,9,10,11,12},{6,9,10,11,12,13},{6,9,10,11,12,13,14},{6,9,10,11,12,13,14,15},{6,9,10,11,12,13,15},{6,9,10,11,12,14},{6,9,10,11,12,14,15},{6,9,10,11,12,15},{6,9,10,11,13},{6,9,10,11,13,14},{6,9,10,11,13,14,15},{6,9,10,11,13,15},{6,9,10,11,14},{6,9,10,11,14,15},{6,9,10,11,15},{6,9,10,12},{6,9,10,12,13},{6,9,10,12,13,14},{6,9,10,12,13,14,15},{6,9,10,12,13,15},{6,9,10,12,14},{6,9,10,12,14,15},{6,9,10,12,15},{6,9,10,13},{6,9,10,13,14},{6,9,10,13,14,15},{6,9,10,13,15},{6,9,10,14},{6,9,10,14,15},{6,9,10,15},{6,9,11},{6,9,11,12},{6,9,11,12,13},{6,9,11,12,13,14},{6,9,11,12,13,14,15},{6,9,11,12,13,15},{6,9,11,12,14},{6,9,11,12,14,15},{6,9,11,12,15},{6,9,11,13},{6,9,11,13,14},{6,9,11,13,14,15},{6,9,11,13,15},{6,9,11,14},{6,9,11,14,15},{6,9,11,15},{6,9,12},{6,9,12,13},{6,9,12,13,14},{6,9,12,13,14,15},{6,9,12,13,15},{6,9,12,14},{6,9,12,14,15},{6,9,12,15},{6,9,13},{6,9,13,14},{6,9,13,14,15},{6,9,13,15},{6,9,14},{6,9,14,15},{6,9,15},{6,10},{6,10,11},{6,10,11,12},{6,10,11,12,13},{6,10,11,12,13,14},{6,10,11,12,13,14,15},{6,10,11,12,13,15},{6,10,11,12,14},{6,10,11,12,14,15},{6,10,11,12,15},{6,10,11,13},{6,10,11,13,14},{6,10,11,13,14,15},{6,10,11,13,15},{6,10,11,14},{6,10,11,14,15},{6,10,11,15},{6,10,12},{6,10,12,13},{6,10,12,13,14},{6,10,12,13,14,15},{6,10,12,13,15},{6,10,12,14},{6,10,12,14,15},{6,10,12,15},{6,10,13},{6,10,13,14},{6,10,13,14,15},{6,10,13,15},{6,10,14},{6,10,14,15},{6,10,15},{6,11},{6,11,12},{6,11,12,13},{6,11,12,13,14},{6,11,12,13,14,15},{6,11,12,13,15},{6,11,12,14},{6,11,12,14,15},{6,11,12,15},{6,11,13},{6,11,13,14},{6,11,13,14,15},{6,11,13,15},{6,11,14},{6,11,14,15},{6,11,15},{6,12},{6,12,13},{6,12,13,14},{6,12,13,14,15},{6,12,13,15},{6,12,14},{6,12,14,15},{6,12,15},{6,13},{6,13,14},{6,13,14,15},{6,13,15},{6,14},{6,14,15},{6,15},{7,8},{7,8,9},{7,8,9,10},{7,8,9,10,11},{7,8,9,10,11,12},{7,8,9,10,11,12,13},{7,8,9,10,11,12,13,14},{7,8,9,10,11,12,13,14,15},{7,8,9,10,11,12,13,15},{7,8,9,10,11,12,14},{7,8,9,10,11,12,14,15},{7,8,9,10,11,12,15},{7,8,9,10,11,13},{7,8,9,10,11,13,14},{7,8,9,10,11,13,14,15},{7,8,9,10,11,13,15},{7,8,9,10,11,14},{7,8,9,10,11,14,15},{7,8,9,10,11,15},{7,8,9,10,12},{7,8,9,10,12,13},{7,8,9,10,12,13,14},{7,8,9,10,12,13,14,15},{7,8,9,10,12,13,15},{7,8,9,10,12,14},{7,8,9,10,12,14,15},{7,8,9,10,12,15},{7,8,9,10,13},{7,8,9,10,13,14},{7,8,9,10,13,14,15},{7,8,9,10,13,15},{7,8,9,10,14},{7,8,9,10,14,15},{7,8,9,10,15},{7,8,9,11},{7,8,9,11,12},{7,8,9,11,12,13},{7,8,9,11,12,13,14},{7,8,9,11,12,13,14,15},{7,8,9,11,12,13,15},{7,8,9,11,12,14},{7,8,9,11,12,14,15},{7,8,9,11,12,15},{7,8,9,11,13},{7,8,9,11,13,14},{7,8,9,11,13,14,15},{7,8,9,11,13,15},{7,8,9,11,14},{7,8,9,11,14,15},{7,8,9,11,15},{7,8,9,12},{7,8,9,12,13},{7,8,9,12,13,14},{7,8,9,12,13,14,15},{7,8,9,12,13,15},{7,8,9,12,14},{7,8,9,12,14,15},{7,8,9,12,15},{7,8,9,13},{7,8,9,13,14},{7,8,9,13,14,15},{7,8,9,13,15},{7,8,9,14},{7,8,9,14,15},{7,8,9,15},{7,8,10},{7,8,10,11},{7,8,10,11,12},{7,8,10,11,12,13},{7,8,10,11,12,13,14},{7,8,10,11,12,13,14,15},{7,8,10,11,12,13,15},{7,8,10,11,12,14},{7,8,10,11,12,14,15},{7,8,10,11,12,15},{7,8,10,11,13},{7,8,10,11,13,14},{7,8,10,11,13,14,15},{7,8,10,11,13,15},{7,8,10,11,14},{7,8,10,11,14,15},{7,8,10,11,15},{7,8,10,12},{7,8,10,12,13},{7,8,10,12,13,14},{7,8,10,12,13,14,15},{7,8,10,12,13,15},{7,8,10,12,14},{7,8,10,12,14,15},{7,8,10,12,15},{7,8,10,13},{7,8,10,13,14},{7,8,10,13,14,15},{7,8,10,13,15},{7,8,10,14},{7,8,10,14,15},{7,8,10,15},{7,8,11},{7,8,11,12},{7,8,11,12,13},{7,8,11,12,13,14},{7,8,11,12,13,14,15},{7,8,11,12,13,15},{7,8,11,12,14},{7,8,11,12,14,15},{7,8,11,12,15},{7,8,11,13},{7,8,11,13,14},{7,8,11,13,14,15},{7,8,11,13,15},{7,8,11,14},{7,8,11,14,15},{7,8,11,15},{7,8,12},{7,8,12,13},{7,8,12,13,14},{7,8,12,13,14,15},{7,8,12,13,15},{7,8,12,14},{7,8,12,14,15},{7,8,12,15},{7,8,13},{7,8,13,14},{7,8,13,14,15},{7,8,13,15},{7,8,14},{7,8,14,15},{7,8,15},{7,9},{7,9,10},{7,9,10,11},{7,9,10,11,12},{7,9,10,11,12,13},{7,9,10,11,12,13,14},{7,9,10,11,12,13,14,15},{7,9,10,11,12,13,15},{7,9,10,11,12,14},{7,9,10,11,12,14,15},{7,9,10,11,12,15},{7,9,10,11,13},{7,9,10,11,13,14},{7,9,10,11,13,14,15},{7,9,10,11,13,15},{7,9,10,11,14},{7,9,10,11,14,15},{7,9,10,11,15},{7,9,10,12},{7,9,10,12,13},{7,9,10,12,13,14},{7,9,10,12,13,14,15},{7,9,10,12,13,15},{7,9,10,12,14},{7,9,10,12,14,15},{7,9,10,12,15},{7,9,10,13},{7,9,10,13,14},{7,9,10,13,14,15},{7,9,10,13,15},{7,9,10,14},{7,9,10,14,15},{7,9,10,15},{7,9,11},{7,9,11,12},{7,9,11,12,13},{7,9,11,12,13,14},{7,9,11,12,13,14,15},{7,9,11,12,13,15},{7,9,11,12,14},{7,9,11,12,14,15},{7,9,11,12,15},{7,9,11,13},{7,9,11,13,14},{7,9,11,13,14,15},{7,9,11,13,15},{7,9,11,14},{7,9,11,14,15},{7,9,11,15},{7,9,12},{7,9,12,13},{7,9,12,13,14},{7,9,12,13,14,15},{7,9,12,13,15},{7,9,12,14},{7,9,12,14,15},{7,9,12,15},{7,9,13},{7,9,13,14},{7,9,13,14,15},{7,9,13,15},{7,9,14},{7,9,14,15},{7,9,15},{7,10},{7,10,11},{7,10,11,12},{7,10,11,12,13},{7,10,11,12,13,14},{7,10,11,12,13,14,15},{7,10,11,12,13,15},{7,10,11,12,14},{7,10,11,12,14,15},{7,10,11,12,15},{7,10,11,13},{7,10,11,13,14},{7,10,11,13,14,15},{7,10,11,13,15},{7,10,11,14},{7,10,11,14,15},{7,10,11,15},{7,10,12},{7,10,12,13},{7,10,12,13,14},{7,10,12,13,14,15},{7,10,12,13,15},{7,10,12,14},{7,10,12,14,15},{7,10,12,15},{7,10,13},{7,10,13,14},{7,10,13,14,15},{7,10,13,15},{7,10,14},{7,10,14,15},{7,10,15},{7,11},{7,11,12},{7,11,12,13},{7,11,12,13,14},{7,11,12,13,14,15},{7,11,12,13,15},{7,11,12,14},{7,11,12,14,15},{7,11,12,15},{7,11,13},{7,11,13,14},{7,11,13,14,15},{7,11,13,15},{7,11,14},{7,11,14,15},{7,11,15},{7,12},{7,12,13},{7,12,13,14},{7,12,13,14,15},{7,12,13,15},{7,12,14},{7,12,14,15},{7,12,15},{7,13},{7,13,14},{7,13,14,15},{7,13,15},{7,14},{7,14,15},{7,15},{8,9},{8,9,10},{8,9,10,11},{8,9,10,11,12},{8,9,10,11,12,13},{8,9,10,11,12,13,14},{8,9,10,11,12,13,14,15},{8,9,10,11,12,13,15},{8,9,10,11,12,14},{8,9,10,11,12,14,15},{8,9,10,11,12,15},{8,9,10,11,13},{8,9,10,11,13,14},{8,9,10,11,13,14,15},{8,9,10,11,13,15},{8,9,10,11,14},{8,9,10,11,14,15},{8,9,10,11,15},{8,9,10,12},{8,9,10,12,13},{8,9,10,12,13,14},{8,9,10,12,13,14,15},{8,9,10,12,13,15},{8,9,10,12,14},{8,9,10,12,14,15},{8,9,10,12,15},{8,9,10,13},{8,9,10,13,14},{8,9,10,13,14,15},{8,9,10,13,15},{8,9,10,14},{8,9,10,14,15},{8,9,10,15},{8,9,11},{8,9,11,12},{8,9,11,12,13},{8,9,11,12,13,14},{8,9,11,12,13,14,15},{8,9,11,12,13,15},{8,9,11,12,14},{8,9,11,12,14,15},{8,9,11,12,15},{8,9,11,13},{8,9,11,13,14},{8,9,11,13,14,15},{8,9,11,13,15},{8,9,11,14},{8,9,11,14,15},{8,9,11,15},{8,9,12},{8,9,12,13},{8,9,12,13,14},{8,9,12,13,14,15},{8,9,12,13,15},{8,9,12,14},{8,9,12,14,15},{8,9,12,15},{8,9,13},{8,9,13,14},{8,9,13,14,15},{8,9,13,15},{8,9,14},{8,9,14,15},{8,9,15},{8,10},{8,10,11},{8,10,11,12},{8,10,11,12,13},{8,10,11,12,13,14},{8,10,11,12,13,14,15},{8,10,11,12,13,15},{8,10,11,12,14},{8,10,11,12,14,15},{8,10,11,12,15},{8,10,11,13},{8,10,11,13,14},{8,10,11,13,14,15},{8,10,11,13,15},{8,10,11,14},{8,10,11,14,15},{8,10,11,15},{8,10,12},{8,10,12,13},{8,10,12,13,14},{8,10,12,13,14,15},{8,10,12,13,15},{8,10,12,14},{8,10,12,14,15},{8,10,12,15},{8,10,13},{8,10,13,14},{8,10,13,14,15},{8,10,13,15},{8,10,14},{8,10,14,15},{8,10,15},{8,11},{8,11,12},{8,11,12,13},{8,11,12,13,14},{8,11,12,13,14,15},{8,11,12,13,15},{8,11,12,14},{8,11,12,14,15},{8,11,12,15},{8,11,13},{8,11,13,14},{8,11,13,14,15},{8,11,13,15},{8,11,14},{8,11,14,15},{8,11,15},{8,12},{8,12,13},{8,12,13,14},{8,12,13,14,15},{8,12,13,15},{8,12,14},{8,12,14,15},{8,12,15},{8,13},{8,13,14},{8,13,14,15},{8,13,15},{8,14},{8,14,15},{8,15},{9,10},{9,10,11},{9,10,11,12},{9,10,11,12,13},{9,10,11,12,13,14},{9,10,11,12,13,14,15},{9,10,11,12,13,15},{9,10,11,12,14},{9,10,11,12,14,15},{9,10,11,12,15},{9,10,11,13},{9,10,11,13,14},{9,10,11,13,14,15},{9,10,11,13,15},{9,10,11,14},{9,10,11,14,15},{9,10,11,15},{9,10,12},{9,10,12,13},{9,10,12,13,14},{9,10,12,13,14,15},{9,10,12,13,15},{9,10,12,14},{9,10,12,14,15},{9,10,12,15},{9,10,13},{9,10,13,14},{9,10,13,14,15},{9,10,13,15},{9,10,14},{9,10,14,15},{9,10,15},{9,11},{9,11,12},{9,11,12,13},{9,11,12,13,14},{9,11,12,13,14,15},{9,11,12,13,15},{9,11,12,14},{9,11,12,14,15},{9,11,12,15},{9,11,13},{9,11,13,14},{9,11,13,14,15},{9,11,13,15},{9,11,14},{9,11,14,15},{9,11,15},{9,12},{9,12,13},{9,12,13,14},{9,12,13,14,15},{9,12,13,15},{9,12,14},{9,12,14,15},{9,12,15},{9,13},{9,13,14},{9,13,14,15},{9,13,15},{9,14},{9,14,15},{9,15},{10,11},{10,11,12},{10,11,12,13},{10,11,12,13,14},{10,11,12,13,14,15},{10,11,12,13,15},{10,11,12,14},{10,11,12,14,15},{10,11,12,15},{10,11,13},{10,11,13,14},{10,11,13,14,15},{10,11,13,15},{10,11,14},{10,11,14,15},{10,11,15},{10,12},{10,12,13},{10,12,13,14},{10,12,13,14,15},{10,12,13,15},{10,12,14},{10,12,14,15},{10,12,15},{10,13},{10,13,14},{10,13,14,15},{10,13,15},{10,14},{10,14,15},{10,15},{11,12},{11,12,13},{11,12,13,14},{11,12,13,14,15},{11,12,13,15},{11,12,14},{11,12,14,15},{11,12,15},{11,13},{11,13,14},{11,13,14,15},{11,13,15},{11,14},{11,14,15},{11,15},{12,13},{12,13,14},{12,13,14,15},{12,13,15},{12,14},{12,14,15},{12,15},{13,14},{13,14,15},{13,15},{14,15}}, + }, + + { + []int{4, 6, 4, 6}, + [][]int{{4, 6}, {4, 6, 6}, {4, 4}, {4, 4, 6}, {6, 6}}, + }, + + { + []int{4, 3, 2, 1}, + [][]int{}, + }, + + { + []int{4, 6, 7, 7}, + [][]int{{4, 6}, {4, 7}, {6, 7}, {4, 6, 7}, {7, 7}, {4, 7, 7}, {6, 7, 7}, {4, 6, 7, 7}}, + }, + + // 可以有多个 testcase +} + +func Test_findSubsequences(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + ans := findSubsequences(tc.nums) + sort.Sort(intss(ans)) + sort.Sort(intss(tc.ans)) + ast.Equal(tc.ans, ans) + } +} + +func Benchmark_findSubsequences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findSubsequences(tc.nums) + } + } +} + +// intss 实现了 sort.Interface 接口 +type intss [][]int + +func (iss intss) Len() int { return len(iss) } + +func (iss intss) Less(i, j int) bool { + if len(iss[i]) == len(iss[j]) { + for k := 0; k < len(iss[i]); k++ { + if iss[i][k] != iss[j][k] { + return iss[i][k] < iss[j][k] + } + } + } + return len(iss[i]) < len(iss[j]) +} + +func (iss intss) Swap(i, j int) { iss[i], iss[j] = iss[j], iss[i] } + diff --git a/Algorithms/0492.construct-the-rectangle/README.md b/Algorithms/0492.construct-the-rectangle/README.md new file mode 100755 index 000000000..fc9dd9a1b --- /dev/null +++ b/Algorithms/0492.construct-the-rectangle/README.md @@ -0,0 +1,29 @@ +# [492. Construct the Rectangle](https://leetcode.com/problems/construct-the-rectangle/) + +## 题目 + +For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements: + +1. The area of the rectangular web page you designed must equal to the given target area. +1. The width W should not be larger than the length L, which means L >= W. +1. The difference between length L and width W should be as small as possible. + +You need to output the length L and the width W of the web page you designed in sequence. + +Example: + +```text +Input: 4 +Output: [2, 2] +Explanation: The target area is 4, and all the possible ways to construct it are [1,4], [2,2], [4,1]. +But according to requirement 2, [1,4] is illegal; according to requirement 3, [4,1] is not optimal compared to [2,2]. So the length L is 2, and the width W is 2. +``` + +Note: + +1. The given area won't exceed 10,000,000 and is a positive integer +1. The web page's width and length you designed must be positive integers. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0492.construct-the-rectangle/construct-the-rectangle.go b/Algorithms/0492.construct-the-rectangle/construct-the-rectangle.go new file mode 100755 index 000000000..ed56e2a4b --- /dev/null +++ b/Algorithms/0492.construct-the-rectangle/construct-the-rectangle.go @@ -0,0 +1,15 @@ +package problem0492 + +import ( + "math" +) + +func constructRectangle(area int) []int { + for i := int(math.Sqrt(float64(area))); i > 1; i-- { + if area%i == 0 { + return []int{area / i, i} + } + } + + return []int{area, 1} +} diff --git a/Algorithms/0492.construct-the-rectangle/construct-the-rectangle_test.go b/Algorithms/0492.construct-the-rectangle/construct-the-rectangle_test.go new file mode 100755 index 000000000..921c47a8f --- /dev/null +++ b/Algorithms/0492.construct-the-rectangle/construct-the-rectangle_test.go @@ -0,0 +1,49 @@ +package problem0492 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + area int + ans []int +}{ + + { + 10000000, + []int{3200, 3125}, + }, + + { + 2, + []int{2, 1}, + }, + + { + 4, + []int{2, 2}, + }, + + // 可以有多个 testcase +} + +func Test_constructRectangle(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, constructRectangle(tc.area), "输入:%v", tc) + } +} + +func Benchmark_constructRectangle(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + constructRectangle(tc.area) + } + } +} diff --git a/Algorithms/0493.reverse-pairs/493.100.png b/Algorithms/0493.reverse-pairs/493.100.png new file mode 100644 index 000000000..a31739b52 Binary files /dev/null and b/Algorithms/0493.reverse-pairs/493.100.png differ diff --git a/Algorithms/0493.reverse-pairs/README.md b/Algorithms/0493.reverse-pairs/README.md new file mode 100755 index 000000000..d880523d0 --- /dev/null +++ b/Algorithms/0493.reverse-pairs/README.md @@ -0,0 +1,32 @@ +# [493. Reverse Pairs](https://leetcode.com/problems/reverse-pairs/) + +## 题目 + +Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. + +You need to return the number of important reverse pairs in the given array. + +Example1: + +```text +Input: [1,3,2,3,1] +Output: 2 +``` + +Example2: + +```text +Input: [2,4,3,5,1] +Output: 3 +``` + +Note: + +1. The length of the given array will not exceed 50,000. +1. All the numbers in the input array are in the range of 32-bit integer. + +## 解题思路 + +见程序注释 + +![100](493.100.png) \ No newline at end of file diff --git a/Algorithms/0493.reverse-pairs/reverse-pairs.go b/Algorithms/0493.reverse-pairs/reverse-pairs.go new file mode 100755 index 000000000..e45cf5e25 --- /dev/null +++ b/Algorithms/0493.reverse-pairs/reverse-pairs.go @@ -0,0 +1,63 @@ +package problem0493 + +func reversePairs(nums []int) int { + return count(nums, 0, len(nums)) +} + +func count(nums []int, beg, end int) int { + if beg+1 >= end { + // 当 nums[beg:end] 中只有 1 或 0 个 元素时 + // 直接返回 0 + return 0 + } + + // 把 nums[beg:end] 按照 mid 切分成两段 + // 分别统计两段中符合题意的元素对 + mid := beg + (end-beg)/2 + res := count(nums, beg, mid) + count(nums, mid, end) + + i, j := beg, mid + for i < mid && j < end { + if nums[i] > 2*nums[j] { + // nums[i] 是 nums[i:mid] 中最小的数 + // nums[i] > 2*nums[j] 的话, + // nums[i:mid] 中的任意一个数和 nums[j] 都是满足题意的 pair + // 所以,一次就找到了 mid - i 对 pair + res += mid - i + j++ + } else { + i++ + } + } + + copy(nums[beg:end], merge(nums[beg:mid], nums[mid:end])) + + return res +} + +// a, b 都是升序的切片 +// merge 把 a,b 合并起来,并保持升序 +func merge(a, b []int) []int { + lenA, lenB := len(a), len(b) + res := make([]int, lenA+lenB) + + var i, j, k int + for i < lenA && j < lenB { + if a[i] < b[j] { + res[k] = a[i] + i++ + } else { + res[k] = b[j] + j++ + } + k++ + } + + if i == lenA { + copy(res[k:], b[j:]) + } else { + copy(res[k:], a[i:]) + } + + return res +} diff --git a/Algorithms/0493.reverse-pairs/reverse-pairs_test.go b/Algorithms/0493.reverse-pairs/reverse-pairs_test.go new file mode 100755 index 000000000..8c1ea0025 --- /dev/null +++ b/Algorithms/0493.reverse-pairs/reverse-pairs_test.go @@ -0,0 +1,54 @@ +package problem0493 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{2566,5469,1898,127,2441,4612,2554,5269,2785,5093,3931,2532,1195,1101,1334,2124,1156,3400,747,5046,3325,4039,1858,3655,4904,2255,1822,972,5175,2880,2776,4900,2172,3808,3441,4153,3969,3116,1913,5129,4839,4586,752,1804,1970,4052,5016,3781,5000,4331,2762,4886,826,1888,1175,2729,1610,1634,2773,543,2617,4990,3225,2962,4963,3575,3742,3424,3246,5067,133,2713,2667,4043,663,3442,1714,386,3864,1978,1363,27,630,4652,1537,1770,893,2676,2608,3842,4852,5248,832,1689,1033,3849,1471,3373,2764,2453,5272,1313,1005,5083,2191,4525,2706,915,5230,3833,5011,4531,2864,1581,3300,1367,4668,5104,1005,2842,2654,2108,5046,1398,5278,3665,2488,4944,3173,2897,4970,2618,749,248,2707,4509,4603,2647,2957,2157,2997,829,2689,3513,3033,5177,3201,5463,369,2779,906,4386,3631,4773,3718,2782,2240,3210,5158,2737,4020,3453,3208,1344,4100,1183,704,3205,2798,3386,1970,4734,3055,2182,990,5189,2419,1860,3998,972,1687,441,2217,2254,4634,2791,2487,98,5358,4433,4023,4328,3953,2461,974,731,869,5382,3699,1748,3629,723,962,600,2736,1413,3146,2955,2386,4834,4467,2814,2822,5137,3101,111,1059,2144,2664,287,4904,1612,4336,1301,3691,1391,717,127,1128,2624,449,2349,2759,1592,369,2359,5064,4392,1137,1682,987,4092,1283,4272,846,4355,1495,1828,2190,1813,4226,3995,2809,1111,3692,5481,1538,509,3008,4781,5259,501,2086,4545,5250,2524,4374,3539,3973,4357,2018,3894,3958,102,3179,5146,823,4168,528,893,1756,113,3042,3235,2954,482,2707,3309,1038,3280,4185,559,4648,4346,192,3214,1263,3062,85,523,141,2822,5218,3192,5426,793,623,2340,3312,2513,5439,4042,5203,4931,2179,626,4858,115,1932,3298,3070,3043,888,918,5227,1828,843,4764,2843,645,4774,1946,3343,3061,5241,4715,4966,1423,3503,5365,3183,1824,624,2389,2860,5025,5102,3,3950,5321,4704,275,1581,3687,3342,4982,2391,2758,3092,4966,444,642,2481,4993,2493,1715,4007,2121,3267,3607,1372,1081,3215,1691,1625,406,2118,4982,3175,1821,5135,3722,3656,4059,189,5024,4553,527,4028,2012,1560,2609,2652,3384,1935,1590,5390,3622,3973,1892,2971,492,3960,3581,981,4313,4958,4455,5517,1320,488,3982,2004,3458,2513,3434,1077,3196,2103,2920,2027,4303,2020,2595,3067,5479,5381,530,3920,354,232,1679,3416,3344,355,3836,844,4041,4597,2924,4956,3060,681,1483,2820,5263,366,1135,4424,3273,2087,4718,2649,4412,2720,2330,5435,1747,3968,765,881,1112,2376,5469,3402,3491,4200,1135,512,3592,3811,5446,3343,2604,1855,2826,4035,1887,4406,4933,937,4165,2984,5225,2975,4334,963,3233,3772,4446,1552,2329,1277,4094,5334,2000,2018,948,3872,64,4593,3832,3677,1789,1288,4783,5063,1610,898,3875,1457,4816,2617,2550,1144,4939,180,929,5200,3627,3382,2675,151,5394,5344,4684,4329,577,3694,2435,978,4904,3740,4165,2908,1358,5058,3176,1306,3786,2239,10,324,3317,4250,129,3402,2458,3282,3123,2956,2870,3835,2228,2417,1278,3039,2713,4504,484,1717,1462,3586,4586,2376,4402,2060,4131,2567,4876,1852,4513,2055,809,1927,3280,1805,127,1612,1663,419,651,671,3310,2649,4032,1297,2654,4814,661,1709,1625,4860,3208,4753,1263,4660,5104,4686,2520,392,2548,447,878,652,638,3727,2050,5091,1609,1467,1101,3699,2328,3672,2390,2510,3772,153,3962,2508,1012,4370,258,77,3115,5294,2659,2464,4636,3437,2683,4394,1943,3055,2544,3604,3624,5482,2178,3014,1537,690,5097,4336,1376,2733,3714,423,4959,3211,3449,486,2017,3823,3364,3894,394,2235,5008,2832,972,860,535,776,2724,1417,3746,5449,3025,1779,3561,4562,5230,5308,315,645,2163,3180,438,3181,316,5167,3119,1569,3057,4787,4545,2235,748,308,1544,1279,2538,2567,1775,3964,2497,3044,3260,4630,4309,4361,1038,5438,928,515,2724,1149,5015,5492,1803,3381,313,3874,1240,3378,625,1355,3619,172,234,3404,294,17,2353,747,1935,2747,4466,353,4491,4339,1110,2267,968,310,4077,4755,3833,3910,4234,5253,614,4917,2079,1684,175,4519,3039,1638,1298,1881,4848,1232,4199,28,1695,4249,1227,1880,5139,4869,1070,4633,3815,1966,1046,3156,3279,4811,2348,2346,2039,2028,2697,4052,1976,1378,4336,4655,689,5480,1673,2859,4334,5224,1884,3534,4250,2058,957,3493,3100,979,376,2776,514,4795,3349,2256,3998,2586,5437,589,1390,4131,2243,837,5507,1167,2084,457,2943,261,2616,1787,776,986,5161,1794,3249,505,1208,1402,1797,222,1605,4625,5433,3965,1637,4910,2120,3334,4539,1835,377,22,232,3037,1884,410,3774,4753,4450,3712,3317,1787,3440,4832,4886,2413,425,1835,2655,4756,70,544,3623,2859,5031,3617,3945,317,2808,3637,1449,1051,419,1848,4259,2300,3179,1066,4689,2055,472,1750,743,296,5381,1288,85,3609,1036,156,3082,2645,3103,3499,4260,3789,636,329,4476,5390,992,244,1329,2150,118,2863,4647,4483,2961,3316,1440,3402,922,2274,416,874,5154,3097,2766,3665,2401,3415,500,4999,435,836,5473,1525,5258,3279,1190,1014,929,5349,4033,506,573,1611,5142,386,3446,4749,5165,2740,4599,2576,4868,4756,5233,2677,3735,3327,3077,1844,778,2368,4991,673,1030,2931,1967,4355,2822,4897,2405,2009,645,650,3202,4827,2649,2254,1939,1474,4498,4652,1439,1080,670,4055,801,3870,563,4710,750,2141,3667,2529,3193,1530,3847,2202,5009,3720,4397,1767,5286,2111,4038,2595,3041,4343,2364,4602,3066,4453,4653,2711,5430,4101,3788,4312,4176,2129,4965,3733,2788,2017,3957,4811,1356,2618,3418,5304,1360,4425,4573,567,759,3128,5343,2441,381,1983,4420,5159,3230,2740,4529,2912,31,3676,4813,3070,2152,5110,5107,1392,879,4509,1796,3138,2132,314,2309,3230,235,3172,3441,914,2097,2684,3186,2524,2851,5094,2195,1304,4458,4993,1012,1849,2546,5278,82,513,1800,232,783,4470,4722,1983,3312,4710,2269,4249,3816,3908,4916,5393,2181,4056,3322,4031,760,2245,512,1260,3666,645,3096,580,4491,1741,2372,4714,5379,5390,2945,5271,5224,1088,2532,725,985,702,3600,199,3600,5356,4484,77,5197,587,1108,4988,4401,5364,3892,2768,3497,2367,2464,4241,4943,1397,4692,2700,1712,4002,4083,4888,4968,435,4366,2642,1677,3976,737,98,4911,5073,2764,5312,4003,2824,482,1181,5313,2473,4748,4968,4624,1313,2510,3412,5357,3482,4361,2854,3285,3996,340,4730,3919,406,4989,1555,4183,3425,4218,2179,152,5126,2807,1319,2764,981,3486,244,1548,5200,1756,99,1746,1170,3808,4734,1746,1746,3687,5331,5170,5364,1118,561,429,2318,1391,4168,4967,5519,2553,3536,1307,2409,169,4045,686,2012,1586,1321,3467,1894,3287,5489,599,2428,2950,4113,862,2271,2648,1816,3051,2190,338,1249,2963,1804,3812,3513,4298,2288,4807,3383,5283,4524,5421,777,772,2387,1378,533,2630,3941,592,2069,3556,870,1304,795,268,842,20,5523,4782,263,2668,389,2496,3641,168,3261,662,1880,2784,5519,4084,3486,1113,3072,4877,400,3094,208,3990,1216,561,2644,1773,377,997,4691,3305,1291,3908,5181,1327,4767,409,4780,1255,144,323,4159,5070,4061,4612,2126,109,5081,3146,301,4994,1369,4318,689,2276,353,3543,1185,4906,14,3745,5135,3579,1105,1633,4292,1494,4075,2207,1269,4566,189,3038,4808,1077,3397,2168,857,1480,4975,4461,2501,90,5521,1928,4909,900,3703,1618,1327,3017,2606,2710,4810,495,4810,4306,2610,5239,4396,2479,962,5141,4481,4976,3747,3930,949,5092,4973,887,233,4277,4189,3648,4845,3085,2891,4278,4679,4079,1357,4256,3454,2019,4212,1121,4847,4071,3370,4349,2677,1490,1276,29,65,2329,3372,4134,4260,1829,3104,1122,4821,4033,3645,4042,3367,1730,5093,2117,4352,4352,1580,4766,4796,1935,4823,1020,4184,2203,3263,2782,4414,1423,1251,4269,1950,1275,3377,3684,3748,3029,1495,2467,4768,3396,1003,4537,3163,2836,1965,1581,5077,1093,1606,4437,4410,4966,4230,2738,3993,141,1182,3559,1925,2532,785,813,1836,661,59,2029,3547,4946,282,2774,4971,1926,2425,2270,3539,4243,5113,3685,5168,2912,4751,2475,2782,4741,3185,2336,4813,812,5222,2588,4480,2225,2334,5287,1790,1799,510,1161,2647,952,2490,4916,1856,3805,2627,4356,1642,4268,63,3833,5258,5353,3380,4267,5237,3740,3924,3735,3201,1269,2638,2207,2477,275,2219,848,3045,877,4305,5017,3535,5367,1033,4363,252,5502,4698,878,584,4087,5255,1862,3755,4579,1096,1793,2855,3976,4822,2664,3006,3304,4390,4606,4416,3980,5037,4901,2855,1578,3552,845,4246,2804,5096,2442,3871,1919,1577,2916,2468,379,2410,3588,3556,4934,716,2072,2186,4220,4972,4485,1823,2779,1551,133,3466,2967,1275,3040,2763,4424,4372,1369,996,3315,5000,2520,591,4822,1019,4253,937,2994,2157,2503,2139,3081,1147,700,958,3838,1927,111,4257,4258,2493,5397,5486,1933,663,2997,693,3569,5170,5075,4874,4164,4514,3016,2598,3057,5421,3759,3248,1715,4081,1331,4635,2603,1342,295,3627,2508,3439,3044,5197,5270,1057,2894,5044,3782,3267,1137,693,3183,2142,4932,3385,2822,2015,3510,4728,3773,4665,3331,1502,4120,1198,113,3706,4567,3940,802,2732,1082,488,3739,2482,1144,480,4894,1330,4954,3228,3591,5266,3999,41,348,4287,3185,278,1554,2168,5492,109,1263,1015,3837,3580,825,792,5287,2135,4236,2448,4272,5290,4650,5030,5088,5260,5385,2717,1501,1860,1056,4810,5311,5027,3776,4340,2184,192,2311,4756,2859,1780,972,2755,3725,458,246,2721,2461,3673,4907,2855,2211,1398,98,141,3610,3901,3548,4725,4911,4759,567,1680,1613,1274,497,4439,5420,3290,5523,4047,3758,1050,1657,5232,3378,672,1692,4415,4397,63,1707,333,1742,3922,2527,5355,3773,175,4089,214,4343,3056,3240,5310,2367,5403,681,2469,2857,581,4333,1988,4028,2279,4634,5031,4283,640,195,3494,375,3509,5414,4557,369,1533,3839,4898,2851,1495,1770,2115,4263,4994,3923,3303,299,1984,4643,2301,4417,3093,272,2795,3980,873,2241,2653,1569,1509,67,2682,20,1213,1363,805,5351,3300,4177,3939,5034,4746,530,1298,2438,1840,2394,2274,2010,2172,3840,3598,5435,3507,4724,526,704,5494,2100,580,1443,3910,1948,1094,85,843,2229,4646,5466,2197,1829,3,3552,4211,2250,3043,4443,4895,5299,1809,1944,3695,4238,288,5457,2225,4690,701,4917,1860,2417,1452,3021,2988,4022,2734,2297,300,1015,1961,2196,4718,2434,3814,175,4319,5504,3689,2015,4220,151,5027,1861,841,939,4719,245,1792,3775,1116,3188,2944,4172,3689,2857,268,2190,1009,1556,4672,5090,5131,996,2192,5482,1337,5521,988,643,373,2248,3424,5134,129,2749,3237,1617,21,4650,5343,5358,835,5510,428,3720,2626,4093,3082,13,158,1683,3170,2549,4592,2701,3203,3499,1246,1504,4165,2757,2073,3231,151,3614,5460,2957,5101,4615,3564,4817,2301,1806,2247,3033,820,1070,3986,5436,3471,1067,408,3331,4501,4815,4192,2162,5398,1363,1021,2883,2845,3711,3851,3680,2380,2487,4919,3524,531,1726,5269,3366,2654,2068,68,1519,2936,4965,2958,3655,2924,3352,16,781,3572,2439,2497,2714,2002,5347,4630,354,2338,5044,1409,1014,1538,834,5284,1210,1786,4022,957,1020,1700,391,3913,1599,3327,1885,3030,2706,2227,298,3242,2081,5389,209,3346,4441,3933,15,2949,1285,3360,727,5013,1527,250,38,4888,2499,3030,400,4573,2257,1784,4046,1632,3162,3165,4835,5496,3656,3538,2970,4503,5422,5256,1770,2322,5292,3902,5297,4812,5459,3674,3608,11,559,4982,3595,2900,1216,4554,1742,3356,3565,1798,5027,4448,5352,22,2998,5142,1320,1881,1754,3740,1615,4346,3299,530,1781,5006,1817,2467,1686,437,3139,283,3639,2858,2930,2133,5135,3154,4871,4982,2124,3796,1528,3145,921,3924,2301,3476,2685,378,1657,5288,3860,2847,3095,4699,4980,3496,1818,4487,5322,2774,1699,3041,5306,568,638,2477,1140,2165,313,692,4734,1640,2242,1360,3013,3007,1836,3592,176,2028,3865,3222,1589,3702,1377,2081,119,2719,2770,791,2545,3717,1872,3491,3843,4084,2698,879,1054,4287,1639,3168,5009,3020,279,474,1,2751,1561,3066,1418,2090,1042,2730,3698,22,3502,4945,1413,4672,803,4737,1107,4887,2170,310,861,341,4374,3519,5104,29,5195,1760,3341,2591,2381,3298,2739,4319,2951,5402,3634,4011,3173,4373,2534,1702,4687,3465,4079,3243,1634,2267,2960,4539,4596,4844,1127,94,5454,5027,3333,2020,2215,5286,1019,1255,4179,2246,3138,5131,609,2649,3294,3590,4536,533,2243,5138,3747,3328,2488,3091,1116,2462,784,4419,93,1875,4938,3170,2683,4222,437,4216,1606,2303,841,4443,1570,1475,1674,4432,856,4702,5283,4034,3993,3997,1884,476,4762,2094,1862,4286,5232,4170,3409,2278,2280,1195,5312,1496,4572,4669,1012,4778,1822,5247,4574,3156,3008,1177,4224,1751,1303,3978,3517,687,3765,4787,2027,2527,727,3660,3714,2818,5386,1696,2495,2341,67,5413,85,593,4591,5159,4609,3695,5040,4164,1938,1293,2774,2376,4382,2765,1739,2981,2678,3312,4783,3527,4107,4782,2553,5048,1805,3540,279,2711,658,1146,3210,1594,3327,2794,4813,1611,1830,2308,1403,3287,1379,1233,1650,645,1299,560,2020,4077,1880,1585,3548,4126,1922,2732,4390,423,964,5060,1386,4274,139,5520,1610,4844,756,2639,4102,5418,3639,309,4670,5145,4632,2302,1345,3226,5332,1205,3315,502,1462,4448,3297,2669,2472,1832,4214,5454,4067,516,4097,1165,4748,1907,4038,1854,2256,3548,2043,2822,2147,5290,1491,3010,410,868,3860,3810,2043,3048,1699,2720,3320,4807,2170,5118,299,4610,1620,918,1526,1586,5381,5088,4828,3766,2580,1925,2640,497,2281,312,304,223,1655,89,3278,275,1921,2908,924,807,4379,5311,4741,4833,377,4532,2337,4818,633,2518,4305,486,1089,493,4208,2183,1734,4425,2282,1742,2969,4633,1040,4624,3901,4299,4680,3165,1668,1823,4896,1960,3709,511,655,229,3945,1085,575,5320,1224,2455,4860,719,1172,2214,1461,351,3405,3166,3727,4676,47,1291,2179,901,3852,5006,3684,2884,3718,697,167,4919,2460,2252,484,56,1428,2575,3669,4637,1071,1987,5414,2351,5082,1286,1911,3697,2008,2897,2210,4708,1312,4942,5381,3095,1163,2450,5464,852,708,5399,4721,2486,897,1012,2948,1073,23,5125,352,3889,5202,5280,1724,3969,4332,2536,858,316,2200,1293,1172,2982,2126,463,5050,3925,4923,2753,1820,4537,2095,3546,2732,212,3296,1781,246,4321,3309,4348,4296,3934,3631,1543,988,935,3804,708,4514,4451,2425,3156,1087,963,2383,5268,5087,2695,226,4357,4782,4155,3413,331,2491,3098,1183,5047,620,323,2046,2719,599,2658,1437,1311,572,1569,1889,2053,2942,4345,3108,1720,3543,3541,657,5217,4474,624,399,4302,3928,5388,5094,2697,770,1497,4438,3102,93,1941,5319,718,1205,2844,4063,2577,1745,2797,4526,3406,2152,1471,4893,4915,509,5251,3241,536,4000,1661,3266,1713,1698,5118,2422,3851,3125,481,5183,619,937,5264,323,1320,5330,2156,3439,5232,61,2735,2827,2537,4989,1402,774,2201,3815,1102,1572,1745,1943,2490,1589,2669,2095,2066,4804,502,1667,3330,5377,2350,829,451,996,4322,3557,1392,3121,5417,3743,2223,4245,911,2970,3698,829,212,2771,2440,3141,934,651,1737,364,537,4456,1653,2240,1870,366,3774,2646,4758,303,3014,5258,4143,364,4818,2128,4453,4954,3244,2870,2802,5037,4325,3850,2545,1039,3626,4317,3556,1392,4040,4090,3534,4961,1014,4833,749,3973,1779,1498,615,2747,4221,4184,1570,2678,374,4540,1114,4360,3220,4021,324,814,547,1029,2105,521,3906,3336,3668,4372,2910,3910,32,1990,1804,404,1270,1995,352,4340,2953,1566,1048,4223,2224,368,1840,3309,2008,2380,358,328,676,2721,1012,1625,4227,3556,2151,5315,1673,781,3331,3007,3859,1869,3809,933,3851,1395,3716,2590,5339,3755,851,600,3923,4769,958,1309,3143,1718,2310,1966,556,5174,3796,985,5135,2865,3116,4775,143,2643,293,2639,2206,2322,361,5128,1063,5251,1678,1717,1757,1867,5053,1592,2237,1664,3499,118,2127,634,1745,2777,175,3813,3198,3323,1784,4985,2898,902,975,1494,2988,3043,5110,3709,448,2205,2461,3134,2479,2212,1928,4486,2461,368,2191,5185,1668,4056,2713,2394,1889,1894,3555,1729,1505,1095,4131,1448,4978,4508,1617,1970,1152,1249,85,2118,2970,1198,1618,2931,387,766,3888,3551,1156,4824,10,4990,4762,2599,3592,4227,2079,4215,2172,3272,5043,977,1406,3683,2866,3133,2552,1976,3003,3457,2554,1831,3780,308,2147,2137,4503,3795,5246,4979,814,4753,3823,3939,647,3273,5074,4558,3637,3839,594,5515,947,1373,3725,1243,1599,2098,2245,507,2267,1592,1701,1715,1504,1790,5208,3114,2777,571,4097,1812,1506,4121,1236,1403,3732,1549,5018,1175,4299,2794,1745,4985,2562,4340,5151,4642,4626,4659,3545,2427,5497,3769,1453,3383,1111,3187,2792,855,1801,1071,5273,2341,5187,2787,543,4433,4936,1297,5479,1589,2515,1941,4178,1287,5121,5132,3927,4140,3497,1475,1457,3019,2060,3274,554,5525,1444,3256,4271,933,607,486,2001,1524,2893,5023,1077,2323,3983,1133,1810,4973,3205,3742,1213,975,1948,327,4641,4692,2876,2638,1598,311,363,1064,549,1965,3573,2503,2147,5289,49,4994,3763,4754,4609,2713,1569,2857,3155,4771,5445,3503,2679,1537,3461,3430,4598,2560,864,4043,799,2547,1184,1567,492,614,1707,2075,3496,5136,5398,512,1993,755,755,1984,7,5043,3838,5286,3841,4778,3526,5399,4039,5461,4510,544,494,4282,4179,2207,1434,4710,3954,4131,5338,511,3241,711,2037,737,1698,37,2303,3723,3671,4656,3404,1124,5085,5285,2392,2302,4752,5152,2165,2339,2247,2231,1678,1430,3078,5026,2028,5110,4684,4041,5042,396,1499,282,660,5420,3400,4554,1376,704,1834,3237,4845,848,65,2525,4374,2535,596,3616,3787,4042,5146,4010,1939,5149,3286,1057,5116,1294,1267,4645,3524,5256,5040,2816,2996,2448,59,812,3840,1160,2540,1321,3821,1056,4717,442,726,2710,3229,1660,4689,3829,4977,588,1065,239,701,834,838,1170,4326,5215,2048,792,1003,1544,3421,4436,3362,2514,701,4171,2637,4368,1086,2086,4190,5057,2269,2182,1004,4645,1752,3579,2781,2869,5438,4742,5391,2152,2109,4863,5075,4556,1329,3585,733,4484,1016,5367,3434,4325,1693,1133,4131,105,2234,1073,2226,2867,3874,1589,2607,2592,4469,5317,2307,1055,5427,896,1511,2190,1210,2091,5408,5175,1484,4394,4741,579,1941,2473,4209,4420,743,3550,926,4036,4680,1985,3594,1677,383,5133,1211,2159,1632,368,1311,1269,2890,3128,5312,5362,798,1333,274,4670,3457,791,1639,4927,940,4504,4176,4505,2361,2680,729,1925,1218,3951,175,4453,5271,3945,1286,229,4066,217,3895,4253,1854,4139,2034,1678,4482,2335,1426,3401,2439,4416,2842,2663,4470,3279,4615,1620,616,5062,1571,2204,4050,5163,2390,3542,2819,4155,3072,4580,3991,3346,4246,3977,4998,5103,2738,2124,3421,3728,4520,4218,2788,238,5178,1867,790,979,3327,3117,3058,1954,4051,4729,5370,2304,4178,397,2779,2839,876,4434,5315,4601,3209,976,658,3554,4179,4756,2322,426,5270,2785,3900,218,3382,2653,4142,20,3676,2575,2107,3033,1134,3256,29,3825,1283,1805,3734,4234,534,907,5243,2112,2913,299,1488,3254,4501,655,3380,4556,2077,5377,3249,2643,3838,1990,2281,1519,5016,4444,1085,260,2695,1590,4466,2917,4349,1780,2101,4936,1072,999,1200,3711,2735,2126,3362,2845,921,5341,3100,4092,3464,3048,2323,1028,3830,5097,1790,2615,1873,1382,1662,4218,881,1431,1460,2010,1863,3867,908,3390,3315,1352,1269,4208,4864,2655,166,271,4304,2511,1792,3547,3318,1784,1182,1613,1288,619,1807,835,474,775,4480,855,4359,4865,3963,4607,2906,3052,1471,698,2670,5323,2577,4369,1324,5486,5396,1583,222,565,394,5348,3288,1638,1994,3429,5198,4105,2281,2532,3275,1172,3064,3685,2047,2209,245,3498,3579,5250,3494,3526,3054,1050,5477,168,2994,286,1174,613,886,3382,2187,1433,3343,801,3891,1300,2435,5192,453,1458,3356,2195,1106,5062,878,5167,503,4643,1206,5358,441,585,1053,2075,2591,5449,2141,4387,5483,616,4244,5093,4352,567,4627,254,119,544,724,4309,976,4733,2849,3177,5064,2268,654,1717,4504,1,2036,694,1382,791,1457,1016,3278,4432,802,734,3691,4986,2414,2373,347,368,2754,3415,632,568,1336,254,656,1350,3084,2718,3667,4593,4929,4750,1245,5395,660,753,5084,3558,3225,359,3490,1002,2657,1742,1173,3434,966,132,1287,836,375,5127,3717,1071,2082,4628,3877,4321,609,2702,1160,1914,2883,2922,2694,3544,206,245,1993,4832,5310,1213,2913,5459,1475,2314,5228,4856,2272,1688,4076,3728,4824,1112,3642,1624,2617,4109,3378,1609,2402,3702,4215,3314,4063,1437,1639,3243,3518,2665,3570,3478,4948,1188,3934,914,2004,3267,4453,4509,1616,734,5218,656,1338,3965,3756,5134,5452,259,3779,2810,3299,5376,4157,202,1733,5387,4205,1387,728,1010,2336,39,4852,4779,4786,644,2812,5177,1484,4347,499,1590,497,3000,4378,4007,4628,1782,2397,2425,4734,1966,5168,1015,2556,3159,3033,1989,5124,2801,1175,2838,1975,1415,3461,4815,4770,4621,4156,1055,4738,229,5108,2898,1637,2732,915,2361,4503,5183,287,1348,146,2444,1058,2906,675,3425,1368,4396,575,307,3467,5059,3428,246,1386,4790,1733,5355,4459,4822,4333,4160,1245,552,1096,1801,1288,1253,4448,4161,4275,4402,5414,1403,3327,2508,3231,2383,2047,2913,1418,2271,1542,1257,2508,5312,2841,4026,3923,4031,2463,1669,3685,5146,4401,1106,5303,5244,2885,4761,1876,2206,37,401,2413,1637,1639,2201,4213,2075,1506,3402,1179,3950,936,1403,626,5142,2681,4989,2379,2965,4435,1811,169,5155,1609,338,1681,5104,2556,4171,823,63,214,3114,4093,3498,5251,1188,2251,2987,1887,2543,971,2384,3240,3060,2497,2295,1166,1043,2125,836,3432,3695,754,1459,582,1134,352,2331,5272,5263,2010,3957,4216,193,4747,1453,5471,5063,599,367,4633,2456,1157,4328,3502,2345,568,1478,3088,5188,840,4622,4650,5285,5479,1204,2025,3076,4981,4222,2633,1817,3681,954,5180,1446,5440,90,4862,1347,1955,3246,3477,4251,57,3614,2441,617,2837,5354,2979,2054,3911,3201,1395,4994,2964,2609,2826,1789,2295,4565,2741,3238,766,2424,727,3931,3114,2123,4690,4946,2072,1706,3513,1787,3476,2240,4250,4111,4083,435,212,3823,3406,3084,2141,103,5347,884,4561,1875,2132,1339,3854,1050,5110,5509,234,3434,3008,3246,4964,739,1646,1238,334,4889,2658,617,5036,2610,2388,3265,803,4559,2812,2811,430,1892,4292,1990,408,2966,2980,2803,5071,3556,4328,2106,717,5351,4390,412,3439,5507,2904,2824,3505,4947,3553,2170,2894,73,1099,5123,4995,4340,4160,2181,601,3463,128,4170,2036,4848,4939,3066,1646,4141,4618,3697,3061,5253,2353,5254,2838,5345,3192,4150,505,1690,629,2784,523,3280,1302,3779,2706,3529,597,4437,3875,1140,2916,805,1277,4729,4661,1065,392,2270,2009,3814,2599,3842,2575,1493,2163,3061,4819,3354,4260,1958,2287,70,1599,4044,5247,1014,4017,4623,5365,1102,4279,1633,26,434,1989,4786,3266,4962,5231,4903,292,306,2271,412,2083,1710,233,2614,4539,4256,4357,3460,3495,5522,595,886,1893,4584,460,5008,419,2013,3944,2486,4798,1284,5256,3724,2454,2675,5411,3573,3445,4134,193,4461,3228,42,1098,3554,4373,3681,1197,2085,1409,2292,1723,611,3263,4680,848,2162,2099,433,2704,5021,4804,1246,64,3065,1168,2958,5455,2721,3801,1721,1788,5304,5434,3888,5299,165,4052,3330,4060,2097,4154,5375,3039,651,5252,2553,3845,4663,2677,1493,2948,4854,3563,4690,3320,2316,5140,1498,2162,2916,4478,4306,2084,1606,640,5107,5307,5145,5072,370,4992,3887,4698,175,5106,3678,309,224,4020,447,4534,3537,4328,2957,1355,1697,5260,1600,982,1985,2700,2202,1858,266,3405,2491,4674,692,2655,2622,1479,3996,2245,4462,2332,2072,2281,4848,2797,3914,730,4711,133,3728,3373,892,1629,2024,4762,169,2913,2233,2066,447,999,4444,3684,1188,230,3171,3500,75,3785,4450,3833,162,5265,530,1019,3691,596,135,2366,1741,4339,2883,4242,2661,462,3692,2331,5204,4452,940,4543,824,5042,5174,5248,2325,4804,3430,1652,3629,5013,3065,1414,1387,294,3495,629,3682,4248,5480,3165,5354,4254,4457,866,967,3839,5235,8,4799,5294,3279,5375,906,3317,671,398,1188,5262,4233,2631,4654,4692,5215,1099,3987,4483,2163,74,3302,247,916,4225,2544,2146,4814,1001,4820,1210,3970,1165,224,5524,769,2235,2594,2620,3533,4573,3228,2718,5125,3277,3427,5008,516,4877,3114,2860,5130,2942,5299,2204,1397,2880,3118,1423,1859,2691,2288,1637,2287,2233,359,4960,1237,3769,73,353,1855,94,3775,524,4700,1640,5435,1043,1918,5181,288,4443,511,1249,5117,2425,568,1785,1776,3302,4362,4175,1088,4146,5071,4389,290,3691,2376,1200,1007,2198,3957,1330,2896,5010,3115,2601,2164,3835,1576,4042,3441,1543,3758,4544,3494,701,4351,729,3711,4050,4118,2716,1211,5493,2444,129,5444,1867,5479,2691,423,2016,4205,1950,442,4787,3371,3959,1009,1633,2730,3584,2696,5488,185,3717,2120,2394,1413,936,2596,82,2307,1033,5047,2552,2977,2010,3183,3353,1173,2243,3139,1676,4990,91,1639,2554,1037,1783,4786,3301,3330,3956,2205,1414,1331,4276,3127,4690,1071,4820,1673,3138,1001,1082,4731,5457,1654,2090,2586,2793,5191,3083,5499,116,3757,5109,1796,5238,5140,5178,5317,2,1012,1641,4024,2913,5518,3677,1951,926,1604,4267,2603,983,3125,4644,198,2867,3919,3528,3562,3480,4802,5246,5057,854,1524,2840,3256,1530,2216,4730,308,4693,5073,414,1720,2201,3601,4773,5355,1503,1280,4675,4861,3563,2861,4964,2769,2077,1120,772,3737,3989,3218,1711,306,3675,369,3098,2403,3909,1035,3756,1230,3782,849,2515,4874,3148,5053,4262,3279,1321,1552,1915,1980,4870,672,435,4856,761,837,534,1378,2437,2530,4082,4391,25,1137,4597,2573,4979,4374,2130,911,410,2731,1104,2076,1986,5152,858,1393,25,4844,1099,71,4653,4533,2298,2591,4380,1546,4132,199,623,3013,1332,5518,1191,4295,3348,1108,1522,4100,4793,819,985,1837,1156,1641,4753,3843,3645,2230,476,3821,620,2138,1949,2884,4516,1922,1866,4453,3710,2025,564,2632,4746,2455,2871,723,1991,3982,3932,4501,2276,664,1762,2323,1358,968,2232,5063,4940,2290,4879,1931,188,841,3038,4790,2201,2624,2316,5057,744,4832,3169,5461,1912,3290,5071,2004,3504,2215,2880,4429,4543,1324,4485,1611,281,3234,5089,4191,1428,3600,1254,2992,4014,2642,3924,5291,3900,3843,2463,3204,4402,476,3776,1857,4305,3435,330,5369,2959,1228,4319,658,3671,4987,4212,558,1150,3349,1504,2175,2726,3592,312,1000,468,1604,252,634,2005,4374,3603,1448,3731,4922,1521,5021,1284,3647,2868,2920,4206,4622,2731,1285,1088,1413,3980,914,3964,4722,1499,2722,3078,5359,3325,3625,4656,3324,4640,5193,2400,1874,2299,3724,132,2233,747,4698,5408,3520,5523,2578,2822,3741,4778,877,5164,5095,5131,4055,1164,2422,1839,4061,3266,1626,2997,3572,2221,1167,3785,4600,103,3012,2502,4064,3086,4393,1915,2478,3032,2379,3768,929,751,238,1821,4822,1705,291,1370,2272,3565,4407,6,1663,2996,3353,1504,2870,3687,1454,4009,4363,2552,3954,2905,2599,4346,4766,503,1099,4418,5260,3651,1872,425,1710,938,5162,1796,1938,1606,1549,4810,4352,5336,3571,1192,188,549,140,3482,369,5135,5525,4355,3401,4623,1285,2755,2282,2209,4933,378,1972,5359,1881,2498,4517,1660,5212,2266,2333,1314,4786,3729,1902,3467,4090,5400,24,885,5520,2453,1327,4749,2610,1073,925,2137,4359,4995,1682,4535,548,1399,3302,1545,1521,1623,4163,2393,2966,4676,3996,1465,4467,3623,1161,1672,657,3579,2627,1183,1032,531,950,3132,2532,110,5461,2362,2619,5417,2666,1226,68,2438,2353,4226,161,2961,5150,1006,4560,599,2763,3922,1934,3260,5415,1746,3482,5128,1733,3039,5462,625,960,3696,871,722,3745,92,5277,3838,1932,1317,689,2570,5350,833,2861,3075,2042,1846,3816,908,1073,3398,2597,4715,194,3128,5334,3858,5410,1728,5189,599,1276,420,4088,128,5131,706,3751,4010,1940,987,2550,5144,2620,1122,1854,4698,4982,3679,3449,718,4480,4204,3719,5097,3310,724,2059,3041,518,4889,3411,2072,3612,5438,795,4644,3435,3232,920,1841,1081,962,2103,1464,5231,4995,873,3135,2128,94,3533,3399,2350,2504,889,19,2135,3919,2432,4401,2156,3500,4007,4049,3803,255,4243,3303,2490,2817,105,4643,1685,3324,1320,691,2282,4535,4369,209,1743,2872,3411,2393,135,1078,3415,5307,615,3535,4729,2873,1519,2769,490,2657,2753,760,3650,3092,5414,2075,4091,4611,1930,85,3595,3930,3227,4515,3240,3107,4170,3481,4652,1846,4989,4167,216,3609,5152,2181,3913,3758,4551,3302,4552,1026,1542,555,4504,2164,1540,3923,2889,717,1343,2147,4037,2292,3889,421,1969,132,3180,5002,2436,5351,1412,1609,5040,2825,1453,2488,531,3036,4789,517,2094,313,5382,3058,43,1608,238,4745,3969,1609,3302,2864,1723,5327,1024,15,3484,2768,1837,5207,3783,1500,3363,4208,2840,2185,4147,1864,415,3123,1470,4707,3591,1892,2151,4276,1397,4572,4332,972,4761,1414,2877,4265,274,5111,635,5222,5343,1650,167,4501,1026,2045,3158,4007,3512,3067,883,4481,799,5312,548,4223,3743,3083,4625,3578,157,1689,5397,2012,1467,2267,37,882,1801,1243,1209,1971,2570,102,292,2365,5040,5337,3998,2566,1982,4702,2988,4571,697,83,3700,3286,2127,1135,2382,1495,1643,1393,2192,1810,1186,4623,521,7,2954,1938,3334,3695,5298,2100,133,4844,4246,1018,2597,5397,861,257,4980,2678,103,2179,3501,4560,154,3141,4531,1127,2266,1457,871,1855,3255,2642,3381,86,5175,4083,3501,54,5490,3488,4764,2791,2074,407,3914,2819,4387,2981,505,482,1185,2227,463,3549,3776,2675,3211,5286,2368,3893,893,4057,5011,1333,820,4740,5206,3815,4186,379,5000,3964,5001,1645,4235,3224,1176,1651,4655,262,5126,1736,1767,1737,3536,3125,1012,4089,1429,2832,1798,4913,3839,5128,4762,3076,2435,4321,2145,4180,3983,1945,4649,4617,1956,3213,5171,274,3048,82,2380,2010,5125,3978,3409,3818,2297,785,2384,5206,1101,4435,2699,2825,713,3759,3497,3959,641,798,5113,873,2373,269,5184,785,1356,4428,2374,3992,4021,1170,986,278,5276,3036,2621,1221,1575,3527,2183,668,5339,3396,3603,2865,3527,2744,2410,1813,1014,5408,1414,2628,4701,258,1082,3211,4446,543,259,4438,4213,4475,1107,2847,822,3388,3954,4654,4349,3197,3463,610,29,4478,2647,366,2031,3829,5474,5299,2871,3176,4359,2312,4536,1072,4549,5137,2549,487,3194,4773,4453,4946,1199,1898,387,2021,3232,4777,4203,582,4195,2289,3896,1724,1407,4760,305,5163,1946,998,3214,3310,5213,2202,82,1253,3886,2117,1204,2759,2906,4554,4013,3097,1281,4283,2315,4893,5115,3100,3084,1892,5199,5057,3592,4687,3021,4892,280,4816,1392,4573,3537,1081,2545,1016,4158,3629,1772,2962,4250,2187,602,1267,1071,3774,668,1532,1825,2115,2904,4533,991,5483,819,1767,2639,352,3687,845,692,2760,4774,4506,4310,5469,3377,2657,2254,1023,3044,465,76,1089,1090,2192,2823,4967,4381,4198,3495,3835,894,5481,4425,2087,1967,4155,231,1538,3754,2872,5114,4245,4464,3519,4981,1566,2228,3933,3050,4279,15,1997,591,5161,3021,3418,248,2616,2002,3928,2461,1510,2246,716,1778,4462,3668,3017,3679,4561,1375,194,4214,5129,1595,3325,3614,450,5110,3024,1814,4414,5338,3074,1960,2509,4149,3407,5374,5049,1977,3661,5508,1528,634,1831,2190,5507,1037,3743,4546,4108,4656,2095,1839,3947,4733,4292,3321,1698,1225,146,4219,1705,1111,680,1183,191,288,869,3474,93,3372,415,489,3451,2386,1114,3418,5094,2575,788,3764,2762,1952,2572,1561,42,2380,4410,4119,3630,4162,4147,4343,14,751,3466,2648,2920,1570,4833,3070,2884,1227,4474,1422,5399,3924,2596,969,1630,4417,4021,3554,246,3994,1136,1389,609,314,2162,3561,610,5079,2643,4877,4298,5014,916,3956,5062,5463,858,4912,4588,124,2445,5179,3112,3835,186,380,3036,2658,1918,4796,2163,4172,1243,4394,4931,4137,1992,2794,4615,512,186,4611,994,3652,1034,1320,3193,4669,2534,3428,1588,5438,4215,4088,3216,5345,4953,85,1921,1033,997,1589,4971,784,2433,1092,4738,1615,3180,284,2968,1503,4161,2920,4442,2785,5058,2509,4172,317,1953,1984,5475,45,3745,3959,258,2407,2230,4363,3145,175,1951,4720,3499,1352,1404,3807,549,2636,1037,4212,2750,1082,375,2888,1431,3967,1221,1261,3214,3335,4626,1897,2666,2254,4895,2144,3980,2859,1653,1664,5352,731,5514,24,4062,4173,4588,4440,1457,5091,4790,284,4306,2093,1433,3296,2374,446,1518,2441,426,3563,1317,2895,1214,4922,1262,1046,2383,3547,5510,4810,82,3457,2459,2225,3733,1366,2910,2655,2224,3393,3271,3983,3526,1063,306,4051,3816,1065,1318,3860,3715,464,2928,5214,344,227,5000,594,3620,3957,3859,4704,2289,4032,3938,4467,335,5366,4405,1826,776,3617,172,4426,124,4013,4808,1629,3784,173,4342,1706,2977,2156,44,1140,4278,1446,88,2085,5465,3349,4475,989,1071,2260,4748,4126,3868,3369,777,2244,942,3579,1272,5379,3996,4708,4534,1163,4449,4704,133,3529,5211,1178,3590,2155,3948,620,4297,5264,698,1082,1965,3293,3976,447,5314,371,4314,3797,2334,5507,1296,4557,2041,4137,2224,2507,5464,1256,3674,1825,598,1955,134,1035,4709,279,1232,3132,3401,3333,171,1873,4740,4457,96,4665,2638,3865,1206,4652,2229,2684,916,1275,4063,5444,4783,3580,2780,2455,5043,5069,2425,4569,597,5280,3667,2753,5217,1889,2113,4047,2101,4944,419,255,4155,369,3427,3277,873,301,2987,3896,4473,3335,5016,1824,2785,249,138,5017,4723,734,4194,4828,322,109,581,3431,3836,393,342,4374,1982,4575,2873,5136,4772,1981,3309,2004,2823,1924,3937,231,1024,3241,2878,2919,3763,1944,1970,4238,852,4607,4116,5435,2874,4139,3644,3673,2342,2366,5057,3514,2959,4911,640,2892,2602,3938,559,1351,2469,5198,3902,4299,1407,5118,423,2453,5072,162,3250,1874,1682,1574,4124,161,4308,1033,1665,3618,1336,4012,3840,1513,160,1158,1717,375,2264,1446,4181,2540,1622,790,2032,5169,3935,2260,3813,463,5159,2321,742,1669,1439,4192,3234,1558,4903,479,2329,17,3862,713,712,3033,4551,1328,3644,5420,646,2782,488,1072,4056,2655,2800,992,4452,2902,2427,2118,4660,1479,3066,4755,1254,2403,1339,3041,785,4384,2127,3151,2280,2135,3523,3825,2380,5047,3865,1471,2270,975,3127,3351,4202,2978,513,3963,5188,4054,659,4524,3559,126,620,4997,3053,4279,3361,5022,4031,2601,4835,2673,5079,3953,3657,1632,5448,4770,1068,2863,2985,1167,3885,2799,5096,1756,4783,1664,2551,3419,3233,4005,1907,1859,3234,2104,2882,305,1940,841,5411,5507,1854,652,3561,2391,4680,2264,672,2252,3690,762,1663,3805,2843,2573,5258,778,3380,2874,1898,2035,2686,4709,604,1824,3561,1364,351,1548,4343,4199,3948,4680,4689,4912,3785,3097,827,326,1935,3486,4640,4106,4950,2464,4612,3941,3121,627,4140,5155,3346,3887,2343,4208,12,1810,4527,2126,4619,4299,192,1181,3276,4392,2470,5193,4401,2743,3132,231,2100,2970,2133,851,2059,4397,595,5223,3674,376,1452,2200,1007,267,1009,2723,3207,510,3899,5081,536,3595,1961,3870,1197,3454,1647,5319,3390,4202,1223,3521,4743,317,304,2460,5088,1635,2473,3771,971,4727,3264,1262,2680,5084,902,577,1842,1728,1187,3173,883,1105,3225,4960,5311,4117,4426,2180,4233,2571,2942,1617,1806,3131,3460,5373,5304,4912,5264,2862,2235,349,3878,3631,2441,523,3525,5088,3097,2254,462,436,3717,3669,2360,1780,5125,1198,967,3059,858,3423,3021,33,3876,495,4640,5236,4672,2130,2883,4145,145,604,5152,770,4729,3275,5295,1721,2402,304,3848,4319,457,5227,648,2014,402,2707,226,1882,4777,1061,1182,1569,4233,1709,2543,2828,1344,2445,2046,1292,1755,5338,5441,2113,1002,2241,2152,3630,1664,3745,3251,1427,3331,2792,1325,2250,4825,645,3920,243,1965,3109,801,2670,433,3420,1408,4346,363,3937,5221,3551,1264,2119,5068,703,4469,3369,5437,3865,631,3269,2197,3232,1346,2152,428,3454,4495,4641,564,4375,3289,2385,4042,2379,3883,848,4158,3794,306,4140,1037,3256,3654,267,3886,2777,5333,4525,80,766,3144,2652,307,2477,3973,730,4295,1894,82,3327,2634,4184,535,3147,1249,1777,1541,3729,824,1835,3929,528,3768,2331,852,3061,3801,2749,3103,836,3277,4331,2561,1260,1672,3222,5219,4315,1216,2846,1645,903,625,5400,3583,1728,53,4912,4450,267,1077,2050,2147,1087,1994,1935,4705,1472,1696,2391,217,1440,1396,1760,2471,4244,4445,3454,1304,2953,916,1674,841,4653,81,2915,3124,907,4999,2340,2870,2601,1811,2299,4326,4926,900,378,3438,5026,475,2426,4477,707,3522,116,5320,3380,2488,788,3376,2236,4468,2118,3323,2005,3797,1516,1223,4028,2095,2314,2782,5242,2401,4329,384,1925,4941,50,2301,5236,1135,2470,1723,383,4717,4852,3484,4106,2964,4810,4402,1197,2157,2036,5120,2953,2103,5426,4337,3847,4764,5129,1976,4336,2797,1342,500,3238,2342,808,423,4562,4165,680,1094,3777,2972,5519,4699,2774,999,1869,4147,1693,1713,3626,2904,5064,4268,2106,5106,1898,351,4065,2317,4361,568,4445,802,2044,3948,1341,1664,746,465,2036,3555,2220,2417,3060,1743,9,3161,4438,2516,5134,2601,2633,325,4484,4960,4276,2839,3037,2379,4454,2700,3849,4790,1318,4057,3605,794,3099,2594,3552,5084,1773,1909,849,2914,3325,5522,3131,4970,1751,3149,3255,4557,1010,4515,5325,4632,750,1935,2477,5002,5393,1926,2373,3514,473,3413,81,808,4968,2970,1001,5148,4488,2869,831,850,1506,2551,2828,4603,1909,4658,436,4812,1451,21,2218,2502,4820,5195,601,522,4905,339,400,1066,1532,591,2616,3559,3678,4894,4206,1308,4989,1999,1201,187,5063,2721,2530,3509,4900,1679,4624,2092,304,2919,1801,1765,5070,495,1681,1643,4679,4797,513,4978,5457,776,547,1987,3911,1591,3109,4565,4405,4111,791,4761,1468,1867,4725,3566,1141,2639,1543,3946,2953,4898,1430,3145,2622,4565,1852,1660,1053,4591,4508,5422,2711,4673,3859,1658,336,4222,5374,1141,4877,22,4440,1712,3572,540,3533,4830,984,646,606,3799,3543,3944,3776,4498,3024,5291,1892,3307,2795,3739,2303,4224,4978,3046,5071,1117,4233,2173,1214,2993,4366,303,1606,4526,628,4363,1150,1636,3228,2949,5006,3171,778,3634,387,1385,4880,4106,893,239,515,749,5003,3986,2061,3386,5218,2750,66,4286,5175,2916,47,4427,86,1355,4709,331,3963,4536,2940,5353,4575,2258,4763,844,4223,5140,2041,2526,3029,1214,1147,2946,2367,3405,2487,3729,4052,4009,4480,3815,1810,2313,3698,2981,5363,4390,1168,2302,1131,3333,4442,2714,4896,4208,3320,2000,3279,623,4030,1243,4240,4111,5,2096,3486,3673,1744,627,97,1013,3402,3900,2095,482,63,2263,4770,324,4988,3865,3316,1367,4431,906,3151,3371,3621,2207,144,3796,2628,3473,583,397,603,5406,1034,4331,1056,5152,2523,229,780,3686,1217,4705,3680,4264,1804,1140,1804,4604,3237,2535,5184,772,1987,4894,5493,1031,826,3792,331,557,5418,5262,2050,4395,2300,1937,3900,611,4041,1839,4371,576,1900,2060,1871,1276,5229,2336,4731,2440,3297,3435,1308,3679,4237,8,4629,2393,1420,1996,2716,4448,3637,3637,2318,221,3565,4564,2413,3233,2597,4003,2154,4930,3130,1989,1318,4630,5128,138,10,4847,4498,15,1329,2297,4480,4886,3505,236,1864,1788,956,2238,3857,2540,28,177,4734,1644,1988,130,496,920,640,1182,1279,677,2111,3606,3052,3111,3034,3875,3071,4724,5150,135,5449,83,384,4526,895,1911,3572,3267,484,1209,1384,3682,665,2232,3052,4309,395,3985,5053,2109,3223,3087,2663,2732,2892,1295,4539,1045,4118,890,4042,730,2627,5439,5487,3308,1279,3235,4021,3038,4496,39,1201,1201,2939,1975,506,4232,1997,822,3132,2721,1852,4405,3424,887,1267,2599,4843,516,1389,4606,4273,3324,3932,92,3854,2445,2250,4365,2064,4867,1079,694,5225,3412,3051,1853,2456,2687,2736,1555,3108,1625,624,3378,3766,1930,1352,1388,4606,1765,5210,3732,2976,5002,966,3969,246,5109,2514,2636,1535,616,2973,3376,873,4391,5353,3414,2948,1291,872,4718,1490,4188,1090,1707,251,5058,3336,240,3097,3875,3272,3168,3963,5176,2922,1369,3507,4148,3819,3576,3299,4693,2777,2811,3128,1106,5481,1792,5380,1094,88,2378,4534,1517,4399,2130,1315,4653,4148,1756,384,2349,2072,1869,4130,2460,1559,3232,763,4564,2036,3204,3053,3693,2162,1275,3117,4178,2243,3281,2685,2980,1614,4361,297,2765,2081,3761,1507,5228,3214,4995,3544,2062,920,2092,3414,5001,3492,4824,186,5435,3022,5246,5174,2802,3451,2067,4917,560,1819,3342,4431,4616,3146,4374,3615,763,612,1885,539,4932,1820,5013,4537,1109,533,4707,4498,4478,3156,4207,2019,931,3642,5168,3639,343,4302,3334,1503,1039,261,2595,3134,1865,5302,3320,2455,1942,4612,2606,4917,4378,2647,4931,3135,4434,3215,649,2002,1093,2826,2433,1708,4084,3807,197,3434,3173,1310,500,2420,4191,490,2377,1261,3782,4877,818,5120,1335,3589,1068,1891,2726,3558,10,3139,3398,3137,4025,2864,2100,5504,2308,2584,5116,3002,2171,3604,2238,1969,1127,2633,1102,527,4954,2710,4739,2535,4330,4347,4874,3678,1610,1287,3974,4941,3238,5219,984,510,1849,2942,4348,4636,916,3076,65,5139,4797,3023,1671,4544,2882,3466,2206,3967,1527,4951,1402,781,4555,5146,5045,1640,3940,1018,4306,1340,3868,1197,5514,691,1266,5104,838,2653,1831,5331,2777,2787,923,608,3779,2262,5149,5192,3393,3315,79,4537,1149,1947,2596,3065,2579,4207,4082,1769,5218,3652,2389,1495,1568,2884,5390,4045,865,5202,4927,3160,5106,1352,2157,2967,3519,4182,4947,445,3009,1093,461,2444,464,1438,4082,1069,286,2584,3992,2094,788,3669,4699,2117,2639,4070,5135,1900,988,3372,2921,934,4407,2222,5018,1743,2673,5523,4876,1455,2539,108,3150,5351,4872,3544,2619,344,1380,1029,2225,3604,118,2975,3242,5060,4853,3737,4836,735,316,1010,1136,579,391,110,4038,177,5304,1099,1715,1072,1988,4797,4749,1107,1934,759,2671,1683,3881,91,3800,5133,4492,3158,1249,3863,951,2287,3223,427,465,3364,2077,3444,1492,2321,3195,1605,1643,2413,1880,1353,2621,3691,3398,866,2389,1144,3001,844,518,3120,4128,4809,4670,4171,2966,4839,2992,331,2612,1416,2045,2499,1209,3704,5060,1927,4234,349,2142,3937,2777,2535,790,4821,2078,4680,476,2736,1690,3373,871,2510,5493,3905,5267,3771,106,1731,3817,3867,734,2209,5170,3514,1633,4768,1430,871,676,4872,4980,183,3364,1415,2886,3687,899,1088,3755,3291,4380,2505,2050,2730,429,233,4770,3236,5320,4910,3550,1348,204,299,3824,5432,5071,3071,2074,760,2426,3866,1690,951,4147,1682,1286,3148,4250,4322,1516,3347,188,4410,1097,62,4462,4085,877,1295,4432,2394,2224,364,262,3097,3694,3242,4757,2942,1093,1697,2088,1914,5351,2564,5486,1992,4138,462,5395,3513,4335,3851,93,3491,1353,3177,2602,4663,1932,884,4631,595,2417,18,531,3156,5374,3637,1688,4395,2064,2941,3971,2835,4281,3118,1545,1512,2481,2735,4945,2863,489,107,4503,1581,2706,5166,2068,166,2268,4084,1075,4057,1536,5399,2382,598,1721,2375,1294,916,78,5257,4141,4262,4009,3767,3019,5116,2269,2643,5102,946,2208,2646,4927,5404,2073,2799,2585,3410,5362,4861,5492,2781,4593,2516,143,3525,3022,2086,2382,5306,5454,1315,1387,3932,4636,4847,262,3405,2673,3207,94,2303,4793,4672,2987,525,2157,1004,947,1605,2135,1691,5159,4860,4211,3827,1499,2222,5378,1340,4193,4276,2498,2907,3933,188,900,4707,1749,1484,3070,4332,3584,5513,5092,2511,3952,3866,3803,4046,1553,784,1829,3093,425,4642,4322,1510,4937,670,827,781,2278,1998,3326,4745,4152,4338,5431,5281,3186,732,4503,2201,5173,5099,2094,4200,5332,3076,2186,123,3339,2401,5210,4421,2888,5398,4635,2793,4737,5259,4912,3125,5234,4404,4841,2957,4348,3297,4665,3090,1796,3285,994,590,4628,870,1629,1191,5461,215,5370,607,2161,5000,2586,4751,106,2503,5512,5323,1975,2129,1587,4193,1651,1374,5270,4845,31,1546,923,1785,207,1202,4099,1545,2908,3032,3569,5194,5063,309,2670,2631,367,4846,4194,5195,652,3836,3339,765,3645,1236,2154,4757,4812,1428,3181,3101,1531,1509,3124,2175,1099,562,4288,4350,3504,4996,1597,4579,255,2675,846,163,5171,3793,1082,937,1153,1240,5491,1092,33,4591,70,5143,4311,5474,629,2150,3330,1202,4941,1542,2349,2471,4051,5378,4486,3824,1119,1124,912,392,5027,738,3003,2488,1550,4428,3323,390,3846,3919,2195,5044,2914,4210,1569,3593,5421,2402,382,3755,1066,5044,3736,5353,3924,2986,4601,5053,56,1777,3351,135,2379,1769,1482,1488,3195,3920,2825,2094,5481,1237,1245,900,3047,4426,4873,1293,3123,1046,2735,3160,2565,2646,1564,5167,257,1362,166,3085,3280,5458,4183,477,2921,206,2835,614,5406,18,3260,2558,4370,1326,5504,935,4007,4878,1178,685,1638,4337,85,2012,4469,1665,1873,3803,638,2745,2084,4849,903,566,4342,2528,5315,2728,4981,3455,4635,1370,3307,1108,4586,240,5474,5141,4933,1685,4950,210,2509,5508,1710,1325,2688,2019,4273,992,3728,2575,3435,3972,4294,2411,1909,1828,660,2557,1329,1694,1401,4430,3470,2392,5065,5255,2751,4311,988,3968,1025,4440,5233,1762,2720,3839,4657,3737,1580,3679,3552,3073,1871,3294,486,4898,3149,1648,1092,1553,139,3743,2917,237,3076,4093,3716,1714,3252,4220,4223,4412,14,2518,5088,4640,4021,3629,1775,2872,5095,818,1925,1574,4794,3656,4295,4437,2756,2970,4483,2559,1920,2798,1039,1634,1039,2489,3725,4689,3541,3539,3168,5412,621,3693,1146,408,3828,4108,2189,3221,3264,3645,2774,2178,3635,4913,1487,5355,2656,3712,3117,2109,3069,4828,3253,4038,988,579,2154,3404,3372,4970,3445,4375,4026,5027,2702,973,4962,4054,1143,846,1303,1054,3748,4800,5087,509,3886,1664,606,3698,2610,5280,1467,746,4646,1701,2311,3635,1450,2051,4734,4464,1132,4079,1983,1950,4883,390,5,3053,2610,519,2899,2794,2514,3276,1328,1822,3496,4955,5505,1778,2073,2943,2388,1399,2853,2636,1413,5490,42,1341,2676,1190,3729,4243,3557,2505,3258,3980,4175,3029,1156,3437,3990,3064,860,5283,2418,4014,4683,3716,4962,4788,1169,3864,5210,1395,3979,2284,4013,5321,2251,1738,4329,670,3448,401,5187,5247,1786,1282,3815,4042,3659,4139,89,2720,1156,4198,158,4949,3367,4685,2215,2627,3039,371,3083,111,4692,250,1412,5129,5134,3552,5290,679,3210,4211,3390,1583,619,5152,2196,1517,2360,2890,444,772,2976,5389,524,2347,2979,1400,3370,4324,3127,4801,3117,1126,1724,3606,4366,2118,4000,3742,4257,844,1966,4033,2593,3683,3217,4939,4750,5005,2328,158,3956,839,2833,4256,961,1065,751,5333,974,346,3943,2981,2751,5122,5146,4348,1215,881,3837,474,924,2136,3973,2646,3084,852,3607,2920,5046,3545,5440,3094,4483,1357,494,395,2016,5148,5449,1876,4493,3432,5014,1104,4060,2545,396,292,744,1016,176,446,2681,2159,5438,2103,4874,5061,2611,3701,2846,5135,5023,392,4566,160,3957,5095,1779,410,1778,1067,3548,2116,2063,4707,5470,5455,4825,1769,2489,1285,5432,5008,3525,3887,5356,4026,4743,3204,4380,37,1664,3151,4833,1973,723,2642,2370,4174,164,3372,3042,3638,2798,4369,1827,4173,1960,1711,4053,4959,5513,3841,1225,2840,1596,2201,2860,3333,3921,443,3285,1320,5059,1812,5108,3527,1277,131,2143,4528,1047,4046,3810,4378,675,663,3043,2993,3837,4729,5403,1012,5313,259,3555,4765,3774,1278,1920,2948,5200,3078,3731,3550,2568,4892,1004,4551,2307,3289,100,5104,285,4944,2432,4288,5276,3817,1711,1841,543,661,3547,330,4995,1478,1203,5284,4814,1640,3175,511,3457,5116,4035,850,796,5174,2171,5095,578,441,1950,3677,4008,652,3152,1254,1719,5520,3812,1666,1351,1632,3483,4211,524,2700,1284,5308,3768,4205,3912,4811,1297,2167,4999,2255,461,2783,4757,4765,3530,3620,4123,2036,3818,1377,4286,4383,1378,2857,2199,3517,492,1307,447,3151,3025,2540,5314,1846,2383,1159,3547,2970,4537,3018,2794,5467,4217,4377,3211,1432,72,2741,832,5257,4575,4057,5132,4629,2814,791,292,1290,1364,1092,3814,3812,1638,344,1390,3856,4985,1673,2318,3575,1429,3401,2158,2889,3881,1886,3257,1215,1148,915,97,1923,868,1276,4750,5521,2860,1800,1217,1173,4882,5403,1031,1526,1459,425,1355,3036,3543,2584,2332,744,2497,349,4093,3963,1396,4140,549,2380,148,1069,812,143,671,748,4835,602,1115,5385,4942,3587,161,2890,1331,247,5070,2241,3103,2875,4264,1940,3480,5321,2805,2462,5388,4818,3316,1156,2979,3130,3914,4653,4212,4620,2764,4152,4480,74,3933,1172,2891,1133,5350,98,1230,4111,5295,76,1828,4084,2939,1540,994,5215,1885,4561,3385,5313,4175,4129,4708,1541,1843,4460,5036,4036,4291,476,3464,4050,3660,3869,2389,718,4326,5020,267,4759,2507,4181,679,4397,1489,2681,2917,4305,502,3592,173,3791,2643,4680,3031,1642,1086,200,2770,2848,165,1626,4195,52,3024,2057,571,4194,1641,5253,1524,4311,765,3190,4465,4239,3759,3195,2972,3420,194,4427,2144,502,5338,251,500,3368,5269,4856,3520,436,2772,1028,1615,1589,188,3465,1025,2646,4912,501,2954,1118,667,5459,1802,1026,805,126,3045,95,4780,5286,578,2748,2467,4828,2484,5003,5435,3106,1272,1944,5301,739,523,428,3496,58,1836,1557,3654,3840,4655,4968,4617,2112,3978,101,970,4927,5086,1955,4256,519,2763,5236,5053,5084,2249,3348,1144,825,1942,262,797,3773,1938,976,3084,2518,3441,2511,681,3140,5333,2965,3592,957,363,109,3724,657,4672,2222,1321,4552,4807,4523,2032,4753,2402,1851,3732,316,2745,3356,139,420,4153,2761,378,4593,2351,3219,4934,2172,478,4081,4147,1050,4649,2366,355,3702,1821,572,2474,1243,2188,2219,2916,2465,5336,3956,3233,715,1037,3060,1760,656,2457,5022,4241,4092,426,5224,4982,5428,2834,975,405,4101,347,130,1870,4296,3745,3680,1389,359,4016,1859,419,1568,69,3606,2103,643,3994,710,1822,732,3339,2307,4214,5152,4442,4621,3692,3180,1859,32,3827,1417,4927,3362,1709,1497,4976,5380,3901,1603,422,3314,66,3870,751,4344,960,4651,1734,247,2664,3508,3969,1982,5214,4052,3767,819,1088,2763,532,921,1104,4785,4603,1317,4956,5072,2769,427,5347,1930,3623,3298,2997,223,148,3029,5358,1133,2991,4496,4476,2240,4932,3701,4146,559,1399,1953,195,649,219,4867,1038,1277,3508,3239,73,3235,1094,5243,4179,869,1917,4851,4798,3895,243,3367,4898,4963,1516,4800,623,3147,2402,3332,3172,1030,2511,951,5310,3299,1746,2130,1221,3461,4277,2037,2413,639,2894,1586,2173,1313,2963,5039,5305,1603,3031,458,1845,4559,403,589,5114,1976,2488,4915,3322,5461,2220,3416,2407,3879,685,5000,3802,714,4318,4978,50,3942,4835,5492,2970,1853,1380,1333,2021,5383,4359,5232,710,308,1292,3152,3970,3329,4897,1163,1734,4029,2716,1662,3999,263,602,3764,153,2128,1406,5434,179,3115,1182,2845,2574,1505,2123,1944,4897,3780,3433,815,763,1025,3238,2386,2634,3326,2517,1423,4942,3450,269,3360,1559,3560,4093,1279,1853,713,1653,1072,672,4235,4872,1660,4242,4195,1521,2213,2628,412,2817,615,1450,3444,578,5050,3281,1135,2242,220,3884,2468,5466,4159,39,3993,2680,4255,33,1145,2162,3125,2269,2375,1711,1263,5301,1172,5283,5525,3277,4178,2265,2580,2326,3538,149,4872,4546,2472,1055,3785,2405,938,2396,2867,98,5192,1348,3922,5448,3863,5078,1341,5238,4138,3112,1879,912,3686,1042,5032,3764,748,4975,4505,3128,5123,5156,4483,4785,4186,1366,5417,1788,27,4654,1562,270,1598,1956,2558,4617,4239,2417,1508,4824,3837,2543,3000,1514,894,3563,1619,2820,3085,5464,5147,3773,3880,4088,4718,2820,2722,3696,1193,2481,2379,4624,2840,4113,4557,3581,660,2812,2660,553,1988,1837,495,4194,267,3546,1931,3448,4934,482,4113,2889,3543,722,1104,4231,2454,4579,2143,1882,4309,5417,4785,5100,5432,663,4751,2687,2863,3965,3675,1675,4275,706,4738,2739,1268,1990,1802,1140,1155,2712,1249,2362,4855,5498,476,5017,2089,3174,2769,1665,2160,1919,2421,2066,3283,1621,3137,5223,1768,5265,3812,1439,2389,4341,2722,3205,3716,1276,1354,4340,5228,4917,2657,2737,3924,3460,2912,110,3141,318,639,1510,4125,4512,5370,2481,4736,2235,5516,1970,644,3517,948,3055,875,636,1044,1619,5084,3370,3121,2876,348,4411,3982,2471,1121,5433,3464,1085,2527,4445,4090,3102,3764,4814,1349,1656,183,5172,437,4630,1340,4337,3898,4284,4111,5506,1269,4649,3582,1159,1160,4477,2757,3381,2414,5300,5234,4063,5518,3860,4065,4655,166,5355,295,5267,2542,3086,2172,2069,2771,3115,777,5003,4183,1033,100,923,3640,5421,4528,4363,5497,3649,198,3434,1158,4901,590,5414,3979,1474,4765,2396,4463,3984,646,3082,5113,4629,23,687,303,268,4650,2237,4898,4091,1477,67,2941,1778,3260,3793,2276,421,2718,4258,4922,4901,2866,4477,4395,1449,1436,1705,842,755,1628,3746,2536,4438,2377,2003,1775,2026,2021,2845,3032,1351,4785,2629,2038,1395,3553,1092,5359,4580,4786,82,2056,791,2931,1733,1340,798,4852,2205,2268,10,3925,1266,1716,5433,2024,259,3135,4689,2118,336,1343,1744,4012,2202,273,512,681,5424,3895,4030,1557,4072,3623,5149,593,1169,3597,2650,3824,3692,1852,1375,798,318,2755,1954,3180,1043,4306,5190,2725,3202,2655,1660,1145,5379,4476,2184,3325,3454,4055,170,106,3767,578,564,5343,3388,1420,2569,2422,4066,4863,5497,1342,1487,5472,2735,5414,982,1128,402,1434,3616,2310,3341,755,1012,4811,2218,2195,3985,4846,3582,5269,5426,2109,2732,4925,2913,1888,2046,445,811,4420,4746,1955,2488,2230,2859,1950,4617,4084,1569,1185,262,5156,3491,4254,2327,1636,2251,3105,1720,3765,4143,2129,4019,5095,4502,2531,4507,372,1564,5419,3484,4549,5010,5425,5475,4002,2785,641,3985,2481,2227,3745,1604,3880,965,2745,980,4842,2003,695,2999,4813,52,1946,2516,2333,2735,4265,3285,1808,394,3602,4846,2926,3510,1505,2246,5141,1163,5445,5473,4844,1167,3921,3642,5220,41,4035,835,3525,4168,680,206,2457,5121,5473,5197,5057,3228,4212,4393,4261,2231,350,2223,466,3449,2205,420,1399,2625,3013,4519,3078,1510,277,548,2141,5074,1956,160,1985,3777,775,3833,1321,1677,4435,4812,3307,1107,1508,4227,3743,2153,1283,3200,3561,60,666,2277,4468,1223,5175,5506,2651,1946,3994,1656,2622,126,4151,3815,3886,2235,3391,3195,2006,931,2321,165,600,2881,3839,1591,3688,5457,1166,3783,5252,1393,3630,259,3445,1196,1997,4602,3339,1903,4487,675,3879,3552,4259,4166,4375,730,1583,3028,1641,373,4528,549,5477,4549,4565,3856,4264,3747,3222,1089,5129,2184,1296,4280,1666,4481,5367,3051,1078,4008,4822,4633,2848,2928,1585,5422,1782,4476,4552,3561,2093,474,326,1596,2409,3991,1073,4227,4132,4865,4622,2975,450,1338,221,1705,897,117,621,1501,4982,4581,1405,3751,5144,4587,475,5240,829,4579,3402,1864,2832,5514,5476,2972,3360,229,3616,3982,2740,4051,3364,3808,4090,3336,5021,5194,355,3438,4120,1959,3691,4849,5213,4133,2697,4947,4044,469,2321,4701,5373,3305,1893,2721,2605,5312,449,4997,5383,3598,1639,3377,202,267,3699,1150,5062,4758,2533,1728,4196,4992,3582,2054,5371,3307,1463,4716,776,831,4372,5239,4385,1116,65,3525,3945,4147,1685,4705,2028,1943,1363,704,909,3918,2646,1786,2249,1791,5310,4174,466,4422,2825,2868,1262,4963,920,1377,2625,2069,951,118,2426,967,1334,4759,2527,3931,1471,2312,1379,4460,1842,2919,291,1094,4638,689,2927,1587,1715,1410,265,2215,3864,1501,762,1132,5051,743,1239,4775,4973,162,137,1366,3959,1564,1930,4263,3017,4245,3797,4446,1142,1271,4056,1862,5339,5360,2713,2284,4179,3239,884,927,4085,4169,889,3085,3872,4064,4654,5084,1308,5172,5346,5186,2812,1164,4031,604,4515,3848,3535,1727,780,1423,4950,3293,577,4882,1311,4857,1748,2211,3179,3682,5076,236,2792,3175,5455,112,5117,343,3809,852,1754,4387,1519,3567,1108,1720,554,58,5134,4676,2634,2915,2053,3994,4763,4183,4209,335,1245,867,2377,5281,3260,3799,2359,5088,864,1813,953,5271,1626,4204,4572,2712,2772,1877,750,5209,1629,2187,582,1439,1527,2247,2168,3013,5233,397,4382,1384,5195,3086,715,4442,4034,5348,115,4215,759,2322,3331,4251,5293,5447,3166,579,2476,1580,4872,4970,3774,4657,2913,2180,3656,225,2236,4858,4007,1452,4434,1284,3227,3395,1404,3852,3217,4188,5139,3567,3425,419,3612,378,1232,3195,1244,3991,4775,4053,4814,1144,2530,2181,2369,5257,1097,7,936,892,3321,4393,129,679,722,1491,3500,2445,2967,4481,4990,2474,2666,4980,2170,3441,5368,1096,3215,704,3640,3391,1106,58,5483,3161,5131,512,3897,4982,183,1937,417,1081,286,2200,384,5096,2963,1493,3024,1729,1679,5507,3827,847,1748,4328,2518,2249,5463,2700,3477,164,3605,3664,2668,931,4986,3839,2486,230,1865,4677,3829,4410,2061,3850,2804,1716,4127,3245,539,4472,3443,5169,559,981,2840,2056,2540,3397,693,767,5183,1839,2779,5356,2014,3932,3725,3785,2209,2216,3411,5510,3028,1045,3039,4271,492,4835,2116,1891,436,5383,5446,4977,1252,4803,1098,2626,5266,4124,2302,2699,2825,439,1562,4138,2629,3294,3406,4444,5410,4873,998,1799,3866,3952,4119,3764,4677,5510,4742,2732,1400,410,1680,592,4597,2682,5137,1490,3070,4251,2549,3855,2957,289,1249,5048,579,860,5039,4408,5268,800,5077,3648,4598,3755,269,2711,936,2430,3730,4209,2595,926,770,430,2759,3650,3310,5123,2040,1555,1130,2393,1154,1785,3404,5361,4488,1220,2536,1765,496,3332,5145,70,2037,5280,4062,4615,5048,1410,4761,3102,5175,1873,366,125,5257,452,1647,4089,4188,425,1291,4943,2313,2315,1858,2145,3877,1221,743,2341,1669,3034,4667,5079,2030,5327,754,4426,3285,1185,3217,2811,3996,4882,174,3118,5510,3508,2015,832,638,3193,1624,849,5146,4149,2505,2299,4237,628,2573,5120,4019,856,1190,2945,646,2245,2321,5029,4935,4347,2749,1331,5218,3696,799,4148,850,4026,5069,2625,2970,4346,3352,935,2,4914,3895,1926,1490,91,4117,4875,2166,1407,1069,4696,4598,3075,1838,4084,2235,2192,554,5219,1851,4210,1489,3271,4025,4752,778,2400,1232,1699,2031,4000,2488,3457,1888,1905,5034,904,2749,5223,5356,1162,1904,1653,3576,1790,5197,4116,3157,4410,1088,602,4471,1040,3827,4936,44,4259,3533,603,4349,3703,3885,4561,4964,2922,3328,889,994,2693,2964,2922,2826,346,1363,883,398,2749,2452,2241,370,3394,3376,4394,1289,826,5011,261,2517,4304,2184,237,2444,2522,1011,2775,3752,2413,4865,171,4693,2796,3751,3586,4324,179,469,195,838,5481,1066,2480,4367,329,1479,3685,4285,962,2936,1616,900,1707,1274,3560,3305,2870,3694,773,4391,2652,5363,1010,4078,3325,1532,5501,794,4032,3566,5359,4015,8,5045,5222,4647,1923,3863,3976,1823,5419,5331,2988,4650,573,305,1729,4719,1507,2154,3259,476,883,4763,5463,4054,3228,2190,4523,3221,2528,4747,3688,1534,3945,4238,5195,5331,4787,899,2210,2490,1384,1844,691,1239,2289,1917,3041,4950,1154,3541,5128,2390,2213,3036,3801,794,2724,3654,2456,4707,5226,4421,4350,4442,2122,5131,756,2651,515,4057,3113,2878,1146,4812,1980,788,3668,3642,5039,148,2618,915,187,275,95,3052,2733,5379,151,1398,1620,2378,2846,1240,3043,3961,2311,4987,164,3445,3027,2985,126,2661,4789,2724,5167,687,897,3194,5120,5495,1181,4552,4969,2473,3040,4408,2481,3288,1788,4671,2743,684,5395,5510,1805,5093,4299,3308,570,797,5208,3908,814,4997,1011,4463,927,605,3135,1520,4570,4467,2224,2795,3553,3484,265,3042,4251,2278,2242,3768,1617,2049,902,1014,3857,1018,4265,2463,5255,303,1247,3029,5041,3216,3650,1371,3472,70,1175,658,2831,4180,2245,3453,2490,1307,1388,3614,4191,2865,3361,1140,983,51,3749,3816,4468,1363,3474,3241,1460,3550,2624,244,654,1428,3674,993,4542,3966,1660,4806,3745,3223,2100,3138,592,4590,5306,4938,4355,342,1676,3164,3544,3911,1247,922,356,2485,5288,3827,4154,3676,1614,5036,4654,5051,2948,3349,1792,338,2069,2658,1653,120,5108,3035,3483,4508,316,26,2051,4032,3625,4800,4900,3146,3183,2268,5052,3935,1844,3675,4052,1988,5123,3481,4182,5439,4631,4432,4392,1887,5044,3970,1291,4286,1740,1789,3478,876,4109,3450,1677,1616,2213,4835,324,4628,1585,1796,2614,1283,2137,1757,3291,345,2851,3267,3173,2177,2168,3905,1439,579,3816,2726,3440,3338,640,297,339,944,1328,3951,1073,3337,3333,101,3423,5015,4000,737,1636,3573,2625,2666,5353,4811,2383,2417,3819,4025,39,4126,254,3756,2645,4303,2019,2963,1668,4496,1725,2384,2108,2320,26,4839,4770,1984,4924,3014,920,5232,1444,1030,4918,2510,402,519,169,2013,2538,4723,2019,5053,361,4817,1156,2774,151,2692,1939,745,4860,2180,1595,5069,1985,5224,3011,2687,5462,2657,1003,4989,2578,4362,2670,5239,2635,4660,3131,4976,3322,4073,4066,4503,2018,1952,1571,2095,5106,2107,4756,1263,5467,2706,3722,3114,355,3088,4926,3680,2746,1556,1307,396,3479,5333,1292,1278,2261,3685,3439,3551,1957,981,1422,4556,4469,216,2179,5180,2793,2000,3530,1457,4223,4175,1471,368,1753,2243,1868,4933,147,1369,5294,1497,1893,2034,262,3426,1859,4796,562,3129,4111,158,2070,3790,4646,4544,1319,2904,2878,5437,362,3901,4224,4687,1390,5066,1731,1652,5436,165,2095,1174,903,2488,3577,4338,71,5005,2325,5500,914,2849,180,3759,2689,3357,4344,4928,3615,1632,5445,4708,4356,3671,85,3127,3704,3173,2078,2816,5088,4854,3429,4,174,1935,31,1398,2625,712,3544,2626,5326,1439,3102,255,835,2670,5457,2344,4625,595,1495,3785,5142,2256,3977,1309,1925,5077,1524,2701,1805,3436,4562,548,3259,3260,724,2661,429,5106,4683,1297,3429,4154,5262,2062,1826,2766,3604,2127,3950,975,4125,31,1147,2383,1439,42,3672,1431,265,1954,4193,4128,773,2364,4596,4441,980,4726,357,2522,5114,3695,4848,2556,1358,2312,1643,884,3833,5296,3372,2469,3144,1658,5283,4496,968,395,3240,3989,5392,3318,4249,2961,748,963,3808,795,2359,2613,4723,3842,5317,4639,4368,1008,4078,48,912,5383,5502,3301,1972,499,1944,3764,2179,4486,2141,109,1196,3889,4099,1944,2373,1894,2695,4466,1035,3267,4627,2596,570,955,96,5417,3158,641,3024,4203,1845,1694,5327,547,1846,2715,4046,1539,1861,5174,472,627,2724,2959,399,900,1250,3947,4349,4315,2319,4576,46,2652,1287,5518,4441,4147,4416,2172,426,595,1210,362,1720,3094,3836,420,3416,3776,4176,4637,4156,3842,4952,1345,4682,1388,696,2773,2728,5251,569,34,783,3052,2329,1958,5325,1666,4619,2585,3628,2236,590,2395,3249,1797,4284,4115,3608,752,452,1724,4349,503,4409,3521,2732,4649,508,3388,4558,92,3940,1651,2074,1841,4520,3393,4896,3970,1699,994,1056,764,1070,1219,1223,2458,1044,2227,3369,4031,5225,3884,4248,2326,1474,297,910,5287,70,4819,4828,798,2473,2075,3146,4195,4855,2529,1337,3135,3164,2599,4509,660,4414,4871,4556,3512,5008,5429,2562,3848,3201,583,5120,1281,2656,425,288,1087,1547,4744,4121,1112,4922,4289,5187,3312,2253,5311,1028,1419,3337,1319,1214,5162,4982,877,1767,4086,5338,2073,1754,4913,2187,3836,5208,3148,3619,4219,3289,4516,4055,1502,5066,4485,4431,3245,672,2845,1003,1433,83,4266,4602,5058,1335,2950,3287,2394,2735,1311,1753,4827,1687,2801,2629,4797,2819,1281,1392,3353,2302,782,5270,356,4052,3179,2832,87,2818,2074,4706,5107,1719,335,5082,2583,3765,1686,893,5453,695,5302,2953,249,247,3154,2904,5277,3315,4694,4674,3809,4604,3563,4228,1900,4621,4443,2473,4574,1707,1093,4063,2046,1107,1439,2370,4815,4249,177,3076,1057,4815,76,2439,599,4396,4848,834,2149,185,3199,4537,3364,1554,132,455,3880,2569,2121,4728,114,1288,385,2023,3205,4673,552,2436,3373,3446,5067,4221,407,3920,896,3466,4190,199,167,5388,982,3475,1800,3322,1401,251,4013,2777,5334,859,396,3420,3742,3085,2924,425,1092,2739,4729,3113,4443,2471,2575,933,4502,2551,3136,2046,1928,3690,3143,4914,2373,4675,1993,630,385,2000,5155,97,2786,684,352,4325,2299,2982,2961,623,464,5437,4281,3460,970,2124,4379,874,3021,4893,941,1736,200,2099,2267,4628,1664,1546,2379,2212,1037,3052,4556,1139,223,4127,5436,3330,4516,3556,3512,1198,4422,4665,1499,2577,593,463,2420,3945,2206,296,3710,596,5358,3279,4113,603,2075,1483,1995,5487,4840,2360,2760,4124,3796,3381,2951,4959,4697,1460,2020,4475,5355,5316,3552,4317,333,2959,3707,2382,1183,3836,748,5469,1026,2061,464,4313,4324,4212,774,2528,162,3611,2439,4991,3574,850,4320,5280,5258,3652,5115,2530,2774,1111,1260,4853,884,4237,5101,3918,1118,2823,514,4807,2401,4529,77,4012,4405,2675,3760,2435,3222,446,440,3237,1421,2772,3049,139,4321,1264,3663,275,1868,2203,2253,3445,1927,488,5315,2006,3311,4785,4199,3681,5085,5079,3423,423,2916,5447,2001,1867,2576,1971,3605,2705,2851,269,4738,2153,4758,3831,508,578,435,5013,1543,3630,4738,4418,778,3301,1440,2431,5377,4201,3196,5390,3136,3194,1629,2291,1566,278,4553,5161,2022,2476,2767,5463,1534,214,1341,4746,533,3229,2218,2394,2410,2011,2505,47,1657,108,344,2576,1491,814,3549,4136,4215,4914,2350,2916,2669,1392,4552,3744,5225,3187,3764,3868,4121,2859,5428,5369,4354,1451,303,4473,598,1333,1649,1571,895,3477,5340,4274,2865,3465,2579,3748,4249,1512,4226,283,4509,735,750,1345,5363,3563,4423,2267,4355,5432,252,3332,627,1960,1292,2617,1288,4139,2097,2164,58,4529,2400,1595,3208,5504,2710,808,3132,4136,774,2368,3567,4641,5480,212,3384,3001,2560,3534,2583,2185,5096,2026,1786,1005,4484,4306,4087,4911,5057,4969,1537,1962,3837,3646,1010,3104,2536,880,4412,1244,4163,685,5430,4262,2258,5314,566,2812,463,4804,3327,3883,480,4659,1041,5225,1948,379,495,1307,3534,169,1040,2325,1813,4314,4693,1665,5067,2033,2586,4258,5293,5176,4055,5187,1991,492,360,759,1828,1221,5439,3117,2986,1460,1247,772,1843,1845,1394,5362,2242,1564,2233,2939,1454,4838,2530,4157,3037,4873,2686,2820,2009,4795,2977,4577,3010,2564,967,1,4142,4274,3330,3174,1995,295,1398,3778,1323,3466,209,427,3054,321,2937,2297,135,4983,4580,913,1761,4542,168,3469,3218,825,1755,4161,526,4006,4391,4621,4136,4858,3873,2088,2079,191,2501,261,4286,3987,2101,1164,2048,4152,3488,1127,3725,4970,142,1867,2814,642,5523,2907,3789,1173,4433,2393,2128,1375,660,2604,3809,2229,3504,2865,3660,2820,182,5455,5127,2216,4975,2610,1881,2941,3102,419,551,4907,2582,5324,2148,3155,2501,4940,1502,3020,3979,1358,4470,803,2776,4672,4718,4746,2528,3271,4440,3607,1443,44,803,4223,5239,2903,4409,2072,2705,221,3132,2021,5222,1122,5416,3771,311,1816,5404,3005,3332,3644,58,2309,1313,5430,2621,16,3196,2476,3888,1346,1263,1978,5158,1813,2438,1492,306,2655,167,1387,5150,2491,5219,2833,3217,3672,2116,191,3609,25,1176,2659,2252,2456,1000,2184,4909,3628,353,1771,2321,4741,987,4523,1101,5018,783,5112,5056,2769,5050,4391,1636,2157,1380,2014,4788,1661,3283,5136,1462,565,3589,5316,2065,1481,3205,4575,1824,3066,3660,3883,3933,4044,4896,211,4613,4167,3549,5337,5065,4049,3515,212,2612,4400,2978,5436,1895,3290,505,1590,2559,1704,3441,3161,1450,2311,5180,3358,2144,2620,3384,1861,226,2380,5430,1819,4227,385,4610,3208,2740,3707,148,1395,4345,5117,1947,2852,1478,178,367,427,1487,339,4852,2951,4796,5094,2801,4985,4730,3499,467,327,4397,1508,5079,1726,216,4136,918,1897,4885,5456,1925,1469,3175,3307,396,3041,977,2350,1965,2954,4202,199,4991,374,1230,3177,1926,1148,2683,803,1080,4234,1648,2301,1299,1767,2302,508,4272,4393,1042,3218,4300,1331,658,3846,3857,890,3911,1676,3771,2119,1578,1439,2347,1161,3604,4325,2714,4139,5184,2413,5310,3032,1559,4443,302,1822,3525,3240,2406,3777,2797,2411,1180,2671,3050,1820,4737,3213,1312,3704,473,5303,1724,5012,2525,5055,3914,4194,285,3151,618,3831,5122,1964,843,4936,4819,2283,818,1771,1557,1057,3923,1290,5234,2049,3489,2020,1875,1220,2329,4104,2816,1777,1515,831,2036,1040,2037,2303,5361,5048,1298,2139,3528,4423,2215,4037,1484,5182,2602,5396,3163,5284,5092,4945,2630,5049,4261,5521,4973,505,1441,121,899,5145,1953,3025,503,1226,232,818,1517,4773,2167,4292,4418,1427,4527,2710,699,4462,594,5342,1419,3722,584,1273,5261,2774,2014,939,156,3261,4473,2275,2456,3198,4564,2353,244,2900,1345,5347,3277,1597,354,5308,2683,3509,5056,412,4082,5073,5278,877,2979,4345,441,5385,4134,905,1161,4925,1848,824,4815,1826,4902,2395,2052,4890,3955,1193,2977,1395,2540,1708,2350,1230,4099,180,998,5506,3736,2838,769,4485,5240,670,754,5441,941,3578,1752,3304,4187,632,2828,3493,3018,4487,739,3460,1039,4510,4348,2425,1943,3883,4114,1916,1852,3734,889,261,1836,1655,5073,1817,3807,271,2492,305,5271,4419,1218,2619,1563,4800,2338,5254,1001,4000,3647,1797,4260,1706,3901,3864,5305,1142,2657,3464,5164,3248,4945,2151,3452,1860,2029,2747,2233,4890,588,4930,1885,2422,2870,5430,2429,2065,2391,2133,2798,3683,400,734,940,3731,2164,262,318,3908,85,3271,72,3085,139,2314,3121,1463,5405,4878,837,3094,3089,1632,657,4721,2826,5026,2264,4091,2897,5040,1127,4242,3720,4041,5447,1854,5222,1837,2848,1852,1508,1329,2016,1883,916,3227,3799,1531,2774,239,751,4,2570,4344,2319,1896,1988,1652,316,3746,742,3584,1281,296,69,3583,4038,5403,1242,3652,1243,1006,5266,910,1194,4068,2880,641,2702,3044,5421,1557,1781,427,3337,5232,1478,1606,4976,1782,199,2462,3700,2587,5240,3518,154,4210,2043,4254,39,430,1144,2944,4180,4946,2307,4823,1526,764,330,1084,811,2470,4104,791,3285,3841,221,5004,2571,3430,1157,2079,225,34,763,3831,2578,4847,3251,4119,837,697,2058,1005,4613,4303,5493,327,5109,4874,3721,4363,879,822,2098,3455,2172,5136,294,4708,4092,781,705,5012,3575,5410,1289,13,4291,1135,3649,4003,474,3012,2635,979,4978,2438,712,1588,3411,1188,5143,4768,2853,3182,1291,764,95,3948,4041,4665,2099,5346,3076,2725,604,5005,553,3553,3621,1837,2621,4293,4139,2283,2382,4286,1669,2630,2445,2597,618,186,5347,4278,267,3530,5439,2917,2760,2221,2525,4688,405,4941,1643,40,3047,3641,2732,3237,2636,532,1194,4124,3828,436,3752,1915,3124,284,3651,5292,4881,2166,4550,1319,4418,2714,3099,5065,3186,4443,3449,3028,1950,4003,4150,1232,184,3381,3508,2103,4569,96,2896,2685,4247,4748,3655,4246,4478,1053,2847,3764,3447,5442,691,1168,3215,2745,186,2478,973,2101,3420,4252,5481,1719,4514,5283,1668,804,410,1552,3536,5053,5053,1802,2377,3518,1643,3741,1483,4123,5198,4597,2366,5160,2556,3077,3369,4409,1736,5484,1262,1713,2141,3248,2781,861,5391,174,4472,738,5485,5506,741,4117,988,4433,1086,2122,2068,1694,4599,4364,561,2002,4419,4794,3043,229,1270,2079,2574,3465,125,1267,2341,818,1737,5186,5168,4850,4194,1974,4200,3161,3814,3353,887,1997,4301,1314,3726,4667,3915,3302,2249,2416,4072,1622,2659,3479,1881,3956,758,129,4612,5400,90,3757,2119,3530,9,3236,3069,122,4380,2675,1668,2379,2256,4406,801,4363,143,3534,2756,1591,4786,3686,2003,3095,2874,929,1897,31,3041,293,1601,3309,1567,2226,1429,4877,462,1790,3982,5020,4622,1004,607,2395,1090,4341,1383,1554,4187,107,4716,4148,2549,2431,592,5390,2756,3307,4582,3501,5343,1617,1940,2702,271,688,4119,2534,889,4648,548,3885,884,2008,5068,4244,4356,2635,3106,4994,917,1109,2554,1832,1595,4824,1919,2717,727,890,2948,285,2550,4702,691,1055,4699,5065,1175,1765,4366,2276,4492,4003,2004,3467,3402,1600,1089,662,4,3506,4682,3073,4568,4349,343,4239,498,3523,3902,2592,2500,626,5464,4240,1224,1658,2005,5513,309,1087,4795,265,444,5050,5035,516,4524,3188,2671,1951,5388,3359,2568,3133,4881,4961,965,2001,3653,4590,27,837,5011,933,102,5355,2316,3214,3387,4352,4925,1149,1864,2238,367,989,3590,1652,3984,4751,2237,2594,704,4592,4222,1825,1548,4980,4615,1461,2987,1247,1007,2680,3125,1392,3025,4550,1883,78,2413,5227,1397,4922,3604,3529,3792,3317,680,2986,5439,615,3508,1270,2533,5169,2519,4176,4567,2652,1799,919,3960,3168,4836,3903,4502,476,4789,1252,3851,5260,4755,1835,116,3712,1138,2686,1269,5059,1046,1327,3220,2209,2959,2905,1600,1050,5228,1896,1316,492,738,1364,4640,4915,1938,2419,3287,2920,2570,1295,1092,4053,4935,4792,2630,1203,3081,5188,1703,1810,4998,1204,4295,3607,2392,1816,4761,885,2188,4410,2746,3502,5105,3715,5371,2258,3035,1663,1696,3347,1471,867,909,3992,857,4680,5335,5421,4861,4117,957,1769,3261,3983,4156,3296,3797,3923,2697,2625,3891,5244,5108,617,5350,1106,4353,779,3852,524,4970,449,5282,186,2303,3184,1443,726,2688,5418,1119,4113,5002,1234,4458,4530,4527,2013,1688,545,920,1094,4987,266,1523,1009,4867,4728,5478,4230,587,1935,4620,3645,2852,253,4466,460,4297,2211,4770,5133,5479,732,1916,1732,3960,5140,269,849,770,1267,906,2557,2173,2062,756,1906,1061,1718,4831,818,669,3512,3988,112,2725,1529,3698,5132,285,2850,2768,3548,895,715,830,5262,4403,3526,925,2925,18,3622,2011,4082,4318,506,2253,4073,25,1820,1117,682,2646,1530,5261,5397,2449,99,3979,993,1461,2534,3673,3675,1354,2896,1895,5160,4489,1399,88,2939,1161,2708,2477,3167,2912,5368,161,5352,1349,1951,2003,721,630,1239,3429,4336,3373,3053,2539,1967,1659,3405,975,984,3494,1631,1345,2885,2230,4372,70,4749,1729,3410,1963,535,125,4721,2113,4922,4541,1204,4813,3007,1148,203,432,2265,3107,1797,1032,4451,3557,4370,2468,188,1315,3714,1124,5215,4218,1906,3250,1477,3561,2687,850,820,2127,2183,630,4281,862,770,1041,1217,2607,4929,2363,1664,4486,183,4528,3741,4654,491,4845,3145,3781,3605,1802,740,1314,2821,1149,2423,1381,853,1742,3135,1455,1937,851,1020,4195,1501,490,1763,2271,5314,751,4997,973,3949,1150,879,2642,4003,181,1700,1151,5290,697,5032,2435,4126,501,2298,3745,2484,4765,3274,4522,2453,3374,4228,3947,4633,2932,2448,2883,4680,2165,4255,4349,3988,309,5073,921,4187,2324,93,2797,2463,5266,2292,2607,1449,4164,1005,1006,2355,421,1183,2867,1898,1499,5291,4327,614,5426,5450,4399,2171,1480,4794,5449,3074,3945,2622,4883,212,4245,2080,4137,3304,1382,1279,3488,3183,2927,3749,2105,1359,3110,4847,2339,5446,3163,448,3359,4592,5350,3164,3089,2217,629,3355,754,1164,2360,4435,4151,945,3577,4081,268,1680,4143,4398,1720,4911,1789,3957,467,922,4479,3359,859,5280,1680,5104,3279,4925,4867,81,1742,4628,1624,4200,3296,2743,2209,3352,455,2722,4042,2877,2197,1265,2526,4127,3555,2842,2068,3248,4483,2478,5338,3727,367,4399,3087,1672,1755,997,4462,893,3928,4270,3140,5413,4834,4154,4439,3042,1626,1550,4763,2837,2543,5342,3653,2644,5327,3641,3650,187,1788,4400,793,2262,3212,1676,3973,5388,1511,2406,2854,5337,1909,2820,1672,3752,166,4279,3131,4162,1423,3523,1218,4389,4642,2136,4907,2110,1136,5461,4561,3251,4661,292,2629,1405,3560,677,3672,2765,5022,5465,901,2214,742,2307,754,171,3851,2973,87,253,3321,2227,260,3731,5098,5393,2751,3922,2240,2590,1484,3644,709,767,1700,5266,3904,5076,2200,3116,2180,1204,1668,169,1975,3697,1886,5065,1799,3774,1017,1916,5296,2837,3688,5177,618,3148,511,3022,837,3521,3032,5221,4132,2560,1466,2171,5204,1347,4513,2917,4772,2706,1991,247,20,1581,2868,777,2735,3353,3864,2867,4543,3720,3330,1909,2530,2158,2024,5075,4892,3758,1138,2081,1891,2449,3209,4133,4217,2986,1242,3481,990,2690,5409,938,555,1624,390,1952,2930,1875,3620,1253,768,4922,1919,3562,3092,238,1336,1902,5167,95,4167,691,1896,3950,1572,4944,2064,4941,1233,1088,1096,1599,5292,3584,519,3700,2182,5477,1560,1012,5345,5076,1720,2831,2932,1813,5055,3935,4931,693,4910,4456,1622,423,966,419,625,812,2441,3127,2017,996,1129,5096,3363,3692,1083,1737,5105,4940,5384,3359,67,1666,1440,1766,3136,2351,2644,27,565,2352,3886,2940,2915,4249,718,1818,2887,5203,2696,5524,3667,4632,2536,503,393,1646,158,30,2690,3459,3535,2392,578,401,1961,1467,4106,187,2489,1280,4648,1461,4148,1157,1163,1521,4856,2354,4994,2398,3451,1350,1770,1165,2378,2984,1645,3279,3125,410,2589,1509,3228,3496,4697,1573,784,3416,264,2789,701,4830,109,3732,1503,2248,791,4108,3942,1967,4036,3057,396,2579,5083,4655,1268,3929,1088,1673,1606,131,1192,2678,42,3937,2191,5433,1711,1414,3239,546,4886,4031,3321,4069,3285,5003,1854,273,282,2331,5220,2443,2634,2331,2531,2645,4910,4862,4518,525,3557,2918,721,3824,1435,357,3059,3237,529,3257,5247,3901,4392,3216,2591,4117,2459,5251,366,1175,2847,4948,1078,4022,1595,3966,1884,1711,3482,964,557,2124,4450,1036,1322,3062,4784,410,1561,3544,3912,1290,1512,1799,2690,3799,1727,1770,4104,2993,1247,1381,2888,2639,5158,4042,1042,308,2784,2427,4242,2319,2114,2989,5481,2015,2779,5415,4838,5078,616,634,2894,2232,3822,4860,2131,580,2173,1130,3865,1589,3591,1137,3438,2804,4432,2080,2847,1935,4499,2292,1041,2513,3937,149,3381,4596,4256,4295,3280,434,129,2944,4829,3000,108,4545,5452,2895,3035,5319,5285,3409,1117,212,5110,764,327,4005,1706,3415,4421,5432,5409,1862,4343,1219,2487,3842,4970,1909,4111,789,93,4840,1382,5375,1362,1134,1970,2729,3362,3165,4082,1735,1885,953,3485,4257,4158,722,2650,3528,630,2317,4262,3755,3541,2943,3191,4711,131,4257,593,1861,4437,2875,2631,2180,2461,5358,2490,1608,1921,3897,2892,4114,3374,3497,1399,4334,3642,2662,481,1481,2703,449,2376,5093,3860,3717,2504,828,4886,1732,2029,4213,3440,240,3332,1481,158,4448,1649,1578,88,3402,3686,1869,4679,2041,539,2168,1078,3379,2358,5061,2377,79,3872,3357,188,5205,2752,3605,2386,66,2061,4244,593,4030,4309,3819,2801,1886,3341,350,1508,3334,2975,1145,1281,4625,3369,393,864,2861,1899,4247,3148,4413,979,2724,5024,2341,2640,4653,4291,3700,174,4882,3650,4058,3954,2546,2053,2685,515,3629,4678,3044,3045,1411,619,32,188,2269,770,4039,2032,98,1728,796,5298,4593,539,3911,1316,2231,3259,4514,3734,3571,3505,3109,2909,4348,4615,3477,3751,2161,1676,2036,4074,5438,5372,2024,3002,2189,3620,116,5495,3390,4320,4972,2156,3609,3284,1858,968,3156,2377,3013,1001,246,2633,2766,2085,3524,2023,516,3709,2264,515,2536,3410,3283,4962,2739,4325,543,5492,4751,1506,4343,2645,5067,3834,2485,3539,404,154,4890,1425,2333,4005,4137,2638,316,62,410,5,5062,3718,4661,4611,71,1669,3326,2690,2546,781,3068,4394,1205,962,1371,154,3460,1653,5184,4502,5115,1424,2681,3714,4029,417,3464,491,3561,597,2764,2975,1586,902,876,5088,4305,4659,2869,3683,4715,5222,5362,1102,1525,2211,1542,1271,3589,3422,117,419,2603,862,480,4495,3749,2507,4924,2427,3183,1960,2690,3709,1702,2920,5082,2245,3142,3501,2446,4167,1079,2226,3515,3436,462,2177,1116,3879,4411,3319,4095,870,5203,1148,4505,3471,1767,4185,2895,5290,2287,3620,2571,4921,4201,5012,2971,2614,256,3571,1612,264,4888,3925,4059,4256,797,875,2287,3596,984,3436,5390,2803,2959,1307,2381,4610,2208,2973,4176,629,3112,5337,2125,5482,1059,5129,4521,278,5282,1842,2297,2961,2974,3958,2973,2861,4218,2347,632,5117,5134,553,3111,3924,5007,2748,5454,889,210,4311,672,5,4533,1737,3625,2848,1474,4612,4317,2637,2308,2375,3735,2007,3517,1621,4976,5103,3674,3687,2981,5498,628,1417,5328,3849,5013,945,4452,4500,3119,4151,5359,1961,4782,1080,1061,1534,2459,753,1477,181,2821,4248,832,2010,4237,833,1699,3122,1296,1562,1880,1435,1204,2408,3284,4747,4786,2254,3833,579,2877,2411,2309,2424,4767,1123,4860,36,4863,897,4527,1221,4125,1693,84,4356,125,2575,1720,3886,4630,3666,2970,491,3892,2638,2454,3103,189,3632,65,4651,3251,2688,2114,1740,2937,403,4535,2143,2055,4033,987,990,2264,2537,5078,5230,4511,2353,4710,4315,3900,309,2369,3230,3948,4854,5459,3866,1163,3501,2745,2146,4137,2754,3709,499,859,4012,2349,5331,460,516,2794,5283,3133,2997,4426,678,1961,5399,5388,1367,1104,3862,3863,688,5358,271,3458,455,2803,1161,4279,3112,265,1611,946,5190,5522,1383,1723,1208,3079,1236,2069,660,3655,1982,2050,974,1714,374,1029,2316,4020,1553,2591,2966,2859,5025,1787,2540,2450,2364,2840,1699,4967,2125,40,5446,3292,2055,1826,1471,4863,4977,3274,346,8,649,1098,1519,304,1032,2907,2295,5007,3930,3488,1758,4983,4541,2107,2612,1548,3688,5111,4871,4390,5265,63,2168,2121,721,3636,3422,1954,487,0,1283,3412,670,897,5020,4980,3339,3120,3191,4510,4574,4653,1790,5,659,16,670,2281,2140,912,2995,4557,3128,251,1244,773,4273,2075,1988,690,4479,4242,5148,1910,1690,5469,3441,1424,5492,5319,3185,3055,1443,1638,2501,2880,2199,1066,5209,1541,3251,3023,2350,1381,4783,4959,4753,4633,2802,2634,1379,5483,2158,1841,2413,4978,952,2916,1326,2823,4537,5472,1633,3790,207,4974,3249,4375,3246,2623,664,4947,2840,53,2000,228,2745,401,3417,5247,4608,5079,5359,3711,364,1976,4225,3967,2188,2390,4598,1639,5003,4344,5414,2040,2521,1828,4319,2140,4823,1434,4373,2637,4649,2998,1985,4649,932,4890,2190,4313,4921,723,1347,2556,4085,951,2204,833,2257,1160,2999,3653,1736,4042,3726,3819,4283,2694,2972,5188,4753,1118,5421,792,1959,3649,1406,435,4369,4103,4184,3898,5072,1721,80,4874,5385,4100,70,3465,3071,1553,1935,1814,4257,1369,622,2593,3478,2936,5433,4339,5213,2969,2862,2230,1586,4792,651,3930,4129,635,3194,4646,1999,2327,437,2630,25,625,4762,4679,2257,2579,2729,1262,4950,5193,5428,2079,1000,1184,4664,5374,3446,1015,89,1250,666,4242,382,1074,3587,2280,2515,3477,404,781,4511,2702,286,794,3835,1903,1829,3345,3378,106,4281,5203,4099,1822,4286,5482,316,5002,4859,2588,103,5048,4526,3310,1285,5137,2748,3083,2142,3678,4465,628,1791,2682,4143,4778,1067,1697,1300,1469,1015,1241,3173,898,3243,3939,4727,3156,1491,287,3593,4810,5347,1347,1168,2515,1788,299,2790,4086,5,4390,959,4559,4767,2720,339,4924,2549,3894,2973,4897,3881,5495,5413,2745,1976,3320,5235,3562,1623,442,972,3171,4592,149,3948,4467,3151,3273,4345,1126,1713,1573,3797,2986,3734,2919,3794,2199,1992,4419,94,3195,4993,1019,1727,1016,3443,1082,39,4908,3969,3097,3338,3265,1550,1889,4377,964,3896,2854,1958,3074,5043,714,3200,3949,1282,1441,3708,4163,4588,1546,4798,1539,4037,2607,314,3573,4140,2408,1085,1647,3971,972,4468,1523,961,738,3512,4297,540,1132,4586,1582,691,1420,4958,3802,3350,5047,2028,5241,851,3688,2124,319,334,4476,5073,2812,769,3,3554,5374,3339,5451,2486,3846,2078,3314,474,567,847,4844,340,221,2749,425,1724,3829,2572,262,4524,1391,508,2584,4320,1578,3078,913,4699,5307,513,3999,27,2772,1716,1303,2349,601,3039,1113,410,2068,3990,5100,4228,3526,2160,4155,1292,2786,4753,5201,2923,4784,1548,4842,1375,5358,3262,1571,2829,4877,3598,1692,2435,1496,5122,1065,2327,2632,2154,2016,569,25,3003,267,2237,4556,2504,3299,2377,4195,2984,1200,5337,940,5399,4086,4984,165,3288,3125,1599,1689,2181,485,1217,2588,4733,4218,3963,4116,2653,1379,57,3655,5234,5012,4951,4634,1576,3121,4545,895,2559,1254,2535,3060,1562,2533,3680,4598,1797,635,5323,2223,3064,155,4286,3980,2097,2237,4100,3462,351,3791,5431,1047,51,4900,1129,2169,782,3192,759,2370,539,5011,1363,2113,192,4603,1814,4622,3371,1970,3504,1503,1527,589,1707,3614,4962,2030,2146,2211,3418,4250,3410,3783,219,3886,5442,3755,3082,2314,122,894,2868,5455,4361,4383,3079,5160,4836,472,3413,4520,2262,5139,2321,1424,1851,2262,903,2698,419,2266,2569,2727,1125,1585,4281,4265,4697,4051,4589,3832,4411,4369,393,1502,399,1250,385,1301,2279,2790,2790,1758,772,1766,2647,3272,4123,2339,2620,3114,4662,2966,4700,4506,3041,3756,5356,1927,2000,3311,4866,2391,2496,1694,4618,3283,4767,3297,3107,4041,3769,4663,4264,1636,3699,2575,3550,3880,112,4649,2182,1899,1050,1166,3306,4925,4695,1884,523,3337,4436,1220,394,3894,4224,4136,2279,2381,909,4853,1194,2369,914,3741,724,5291,4961,5365,2976,2209,3541,1205,935,1006,1688,4727,635,866,2500,1913,5368,4489,4830,2676,2741,2145,4950,22,169,2292,2984,3843,2302,1244,4051,2786,5461,664,611,1720,1181,5342,562,887,2851,5471,14,4420,4436,455,5287,2588,2691,1770,3847,3275,5309,1466,2805,1002,2110,1281,5048,5502,2286,4986,461,925,3001,4825,4454,4433,3470,153,1639,2997,3742,2690,4900,4781,2022,2020,4343,4371,3156,4457,2466,875,1599,677,4039,4305,3156,5018,2202,130,5123,4621,716,4396,2425,625,5071,610,1551,778,2692,88,2294,2860,1260,419,5089,402,5525,3130,4602,425,2033,3813,1799,3465,2928,1167,4073,753,5257,1313,3202,3001,1527,1135,371,4828,1549,733,1407,3168,2128,3080,1776,1522,7,215,1741,2576,2809,4556,954,4086,1549,4231,3597,2726,5000,159,888,2609,3504,1152,4252,5256,1070,5203,4066,1822,4813,4068,5235,1549,4459,2820,5335,5427,3197,3677,2065,4644,2735,4973,2749,1613,5026,4793,3678,4528,4467,2565,2392,2004,283,237,2205,4904,4448,1249,5246,3758,2364,2148,2802,4925,1629,1635,2161,3940,3461,4202,1315,2884,823,1097,3122,3536,2540,311,4858,287,4989,3799,5299,1830,4987,1772,228,5204,2115,1684,4027,1289,370,1864,5090,4302,4850,2365,2796,3588,2021,2129,1393,4006,5027,86,72,1930,390,2734,512,1423,5423,3789,4853,2669,4798,395,3345,889,5090,308,3277,2066,1308,1814,3539,2017,1981,4843,2001,3151,2159,2344,2594,325,232,2616,4389,2765,1057,4679,4143,912,3490,2927,3157,2614,104,1800,1849,3307,2645,5363,4183,4114,4415,3992,1655,3492,1209,486,1978,2926,4975,3013,2191,4448,4552,5396,1276,4158,4209,4909,977,732,4591,1067,2587,15,4736,4508,5413,3854,1979,4245,1097,1112,4876,2385,2394,4593,325,3611,3731,1582,2702,800,115,3542,433,4491,2296,237,5438,2429,3488,4302,2777,2231,461,3207,4105,3438,346,2257,4744,1978,3942,2004,3641,1970,5416,417,3328,4969,1225,3948,527,1649,4980,3965,2713,2751,480,4833,3558,3760,4733,3672,4496,2507,377,847,1740,4637,920,1288,4445,1819,5123,4502,4353,2256,852,405,3092,1919,4033,3850,2646,754,3750,2183,4918,2079,3393,230,2858,3789,2588,853,4768,1241,4174,2396,4703,1767,1286,2006,3577,4252,1198,2777,4380,3666,487,2819,1591,405,1156,3217,3670,3374,691,2266,4538,2773,5484,2175,714,4665,2774,1227,748,1571,4114,391,860,5157,5370,4055,3645,4864,605,366,4424,4496,5475,3652,5212,4169,295,2387,5002,5160,2470,1384,1464,2680,4843,2199,2536,4211,2397,3045,1664,5362,1193,4154,847,526,2471,3274,1111,93,3087,3913,1225,3882,2511,2695,861,2870,1389,3891,2011,3008,1029,2036,1518,1515,3907,774,812,4874,4812,5275,5285,488,4493,3691,4766,406,1344,629,1963,700,3663,5284,960,2375,4018,4967,585,3180,2942,5154,2332,4565,485,3251,1817,1863,1596,5253,70,2545,5436,2718,3939,1119,4866,3022,1733,5173,4660,2492,4071,4045,1859,763,5239,882,1680,697,4273,5,5199,2803,4842,400,4652,2477,4348,81,1739,5414,1387,1020,747,4921,4643,5394,3872,2306,5183,1690,8,1429,4187,4945,1675,873,4620,444,350,3699,3497,4291,445,1662,4862,490,1552,956,4532,5298,4181,4422,5058,0,3151,3324,4424,1039,5119,4904,5276,4318,1878,443,4062,2400,1584,4543,797,554,1104,2704,2679,2380,3605,466,4344,901,1313,4106,4855,622,4358,3889,310,4960,357,4583,1166,2126,2191,2140,1686,3303,1600,4050,4548,3842,3473,2868,1959,1772,4173,158,3449,1388,306,4452,3559,4899,775,3482,1688,5333,1207,231,1086,1304,397,1438,647,1767,2050,5209,1305,2852,3172,16,249,4168,5482,830,74,1188,3050,4447,5125,965,5209,281,1805,4342,439,1335,3599,2740,3147,344,3989,1941,2520,571,1352,3416,865,545,1047,798,5391,4100,3076,1195,4535,4450,1784,3662,1603,4344,366,4090,5384,2444,3908,5349,5504,1246,3784,2578,1785,4217,4941,1143,4783,4583,2524,2363,2804,5073,4599,4643,3901,757,5435,1854,2375,3894,1128,5226,3304,2694,3909,3548,1636,3310,925,3930,4167,24,2216,3001,2387,4820,4547,3208,5167,3991,4991,2525,4591,1942,5016,2581,5129,3522,476,2063,2837,83,198,55,2005,2875,5087,2389,1855,3504,4745,611,150,2288,1184,1330,4640,5280,494,3627,3610,4456,4026,2461,3314,5353,4768,4901,3981,2683,2173,1146,1053,45,1216,1015,4828,4479,3968,2222,4797,2672,3574,5303,4168,3748,3583,531,2187,998,5193,427,1135,2214,4054,5097,3022,152,4913,651,507,433,4532,1310,1370,1907,4598,4008,2066,895,4018,573,2543,1348,4841,3940,4608,3320,1748,585,114,3970,3414,4867,5272,4593,1069,2900,1993,2466,4804,3152,5424,2993,1766,5273,2325,2947,558,4687,4408,90,1141,5115,2927,2494,3205,1996,5443,200,4989,191,5125,1420,85,5244,663,4273,233,4078,227,1737,4604,1886,4730,4654,5394,595,5172,2777,1035,1106,4417,2914,2952,1956,147,3434,129,3669,4925,385,338,3786,2841,1717,2909,5352,641,359,4175,3197,4508,921,2043,2609,3840,5202,769,1016,1676,5108,1534,2605,4506,3086,4470,1979,3717,3060,1889,790,857,1539,2195,1329,1306,1012,3940,4117,4899,4360,2685,4296,3331,2899,2878,5069,5523,874,2145,2888,2654,1496,2559,4293,2349,2811,3579,2303,1907,4547,2123,1647,2962,4032,1945,802,4545,2724,3332,5420,152,531,2346,5019,3756,5306,266,3900,265,4130,2640,458,1924,5027,4228,731,1981,1927,1398,1948,4623,3888,2096,1653,1048,695,5337,4841,4438,3455,3572,2057,2746,3342,2377,4952,1153,1053,4556,5318,106,1806,5087,2264,4794,1140,4014,2461,4427,4032,2137,4431,4060,945,473,816,2999,4362,269,1979,111,5174,3323,5193,5320,4318,3848,3141,844,4801,3624,5144,3509,4232,5402,382,2052,4673,4026,1684,546,1963,5171,2772,2780,4345,3451,5226,2962,1374,1976,2353,1811,1046,4720,42,4431,733,3301,1818,2107,2510,2271,2310,4909,40,5396,3911,3371,602,5452,4331,2024,4018,1302,3062,284,251,3233,1772,722,37,2552,159,5113,5325,1286,5146,5342,4334,2191,1957,5005,1789,2649,677,1506,3969,2804,9,5342,5083,1535,3169,2052,2073,2922,852,2932,1916,5115,194,2739,120,5091,1922,1041,1594,4,1265,3406,2525,940,3209,3418,2547,3590,452,1019,4751,2334,3222,5193,1173,3663,1772,2930,3290,510,901,513,719,4612,5461,4650,2700,243,1456,1504,1020,1152,2996,5262,2144,1823,625,997,66,1962,3204,437,2370,719,4202,4581,1549,4650,869,2197,887,1921,1315,5387,817,2766,2947,340,3838,4815,4478,3685,3701,3657,3967,4959,2992,2213,644,4113,4645,3250,1312,3417,4448,2600,2973,10,5182,4930,258,1605,1204,2622,4258,4500,3936,5161,3169,1579,4327,861,2676,2686,3871,2403,3107,1937,3325,3877,4515,5123,4139,4128,1357,1412,650,2677,4683,2306,1387,135,5333,5188,3860,213,1893,5215,5482,599,3043,1720,3037,21,3388,4363,1335,1267,2125,3756,2308,758,937,1635,3517,3617,1141,2480,1282,2449,3122,3400,1673,2387,4336,2621,1186,627,2253,239,5507,5257,2684,5410,940,1376,401,2977,228,2599,227,5514,4353,1355,1647,5150,5162,4753,4261,1422,5505,2007,2512,233,4643,2984,3365,2358,2020,782,226,4765,2697,5474,147,4944,1278,5507,4802,1612,775,1723,4558,3296,4516,1497,2549,2305,2400,464,5268,3581,3646,4741,3577,783,2734,3625,5240,766,603,108,1053,4226,1625,2084,708,3366,4106,2405,2469,2194,1120,2883,2797,2813,1503,3900,4193,569,2354,1824,5081,3663,147,1103,5068,3152,503,4736,127,3039,2572,4252,4808,2548,5344,1856,2266,2301,4407,3042,823,5115,4065,97,5169,38,3155,2526,1192,5317,2850,2507,4669,3998,5249,1545,4575,4593,769,3527,1765,1614,2599,5459,3230,4969,1442,2459,3924,2745,2208,4565,1550,5000,3119,2984,3593,4990,4453,5387,5180,268,497,3109,742,1671,303,4496,3375,5167,3080,4114,3171,674,4345,470,772,5289,3717,5373,2112,1434,2762,1680,4902,4866,2637,858,2527,255,2396,3709,4189,4535,663,2721,3788,1290,1378,152,146,4691,2021,5120,1449,1037,5412,2606,175,358,2036,4545,2484,4050,934,2771,4147,1182,5152,5190,343,608,3758,3350,231,1400,3897,1504,1985,3280,4399,2484,1010,3235,1042,3711,645,5176,2809,2150,3483,2701,3128,345,3591,4831,1600,1815,5050,1357,404,5289,3373,4393,5432,2799,2591,3160,4064,633,2425,713,1176,4798,3907,4810,3577,2502,2651,3920,5261,4163,3827,3091,388,2715,3035,5457,2710,3968,4706,409,5380,3413,1197,2558,1905,3885,2193,1415,1484,751,2209,4073,4251,1477,1851,3537,3443,4856,1969,5455,142,3993,2228,443,1758,2796,4072,1745,3487,5040,2480,4457,1372,1996,2057,3534,404,926,1470,2072,4034,3157,759,4931,2759,2416,3263,4227,2467,2798,4999,2572,355,1850,884,636,2096,3725,1972,2725,827,4754,1752,403,3016,5346,634,784,2752,372,4724,4032,3433,442,4788,1711,4337,600,92,2192,2368,649,2005,1277,342,423,4361,4581,4922,748,5367,735,4195,4740,3761,2464,1728,3828,796,5003,5231,1369,1353,4519,2268,3876,5118,5368,3785,4453,1189,4920,32,1332,1917,5411,4661,2226,2819,5256,4183,4649,3596,1770,4680,1121,626,3947,4971,5243,4655,879,1354,3112,2999,5302,1711,333,2163,2686,1030,2196,4263,2024,244,1878,3282,600,247,2448,4614,255,5092,5284,4040,3294,1299,4023,1404,1356,2764,1756,2811,3129,5124,1726,1944,2573,3815,3699,75,442,4170,5474,4597,825,4841,1895,1980,1799,1371,4600,817,4639,1308,3411,5343,2121,4371,1523,3875,382,5518,2820,4779,187,1377,2448,1581,2101,1554,639,1038,2062,3765,2037,2421,275,537,3360,3836,2596,2111,4050,1225,1377,1487,820,1275,4596,42,5111,1544,2238,5434,704,2863,1367,29,452,525,424,3985,3376,1319,4796,5151,4510,1221,910,542,3546,125,122,5204,43,3536,5308,662,2742,1691,3731,3427,452,4646,5524,1473,1320,2900,1732,3132,3981,3831,238,1750,2761,2430,4523,4113,1099,3523,3051,403,4492,3991,1264,5381,4931,4786,790,2908,4328,4292,3464,4508,1289,1468,2721,1972,1744,434,2303,1857,4026,3811,2275,3163,5232,3634,4052,3886,3382,2553,154,419,1365,5385,881,2275,3112,3939,1292,23,2177,5325,4229,2350,622,2627,2703,888,2981,5173,2194,2443,4863,743,398,4995,1899,3798,2022,1925,4333,33,3775,2871,3596,2414,2190,872,2956,3480,1184,5432,4229,4258,4313,181,1341,4984,3575,960,4812,4246,1962,2900,4420,3853,4966,1899,5190,1395,2518,2727,1432,743,2511,2893,2774,4129,3250,4341,2632,356,2693,168,5450,5066,4146,3561,5261,2913,3054,2685,193,5368,4000,2094,4380,3572,1316,1883,3795,3970,4402,811,1380,3816,4201,491,1716,2503,4785,5086,2138,2669,2581,4818,5140,4091,1049,2254,4616,4870,5486,3805,3304,445,1298,4798,3736,1381,2139,271,4900,2499,1713,2512,3649,1584,1354,2677,2828,467,5401,2554,4352,293,2763,4017,3846,976,1431,4744,1831,3196,2470,500,696,1924,1639,4911,2342,3017,4655,846,3786,4448,3968,5463,736,1162,2813,2170,5079,3462,3737,398,882,2823,1731,813,4520,2921,3029,1142,5165,3654,2888,1474,4688,2658,3237,3466,2032,3182,857,2427,2849,3988,4973,2113,2776,2523,1391,1136,2333,2522,1924,1091,2205,4963,5432,5189,4710,3642,3985,4352,1794,1291,4458,607,5363,2285,3320,4400,4753,2789,3337,577,4583,3813,1135,327,4279,794,4710,305,2715,4878,312,4919,3865,5380,823,2709,2008,1627,5329,1569,5063,1388,5152,2731,5139,4465,1428,2017,1519,4759,2013,4558,1265,948,4677,208,1177,5196,1192,343,2552,4650,2969,3662,13,3077,1867,4432,170,843,1035,3474,2562,5156,4327,389,2208,5493,2541,972,153,3161,4275,4919,3694,5186,3432,3024,1328,1740,1071,3097,4031,3008,5420,1308,2133,1816,4735,4668,2061,4066,5466,1103,5504,2074,4747,1097,1123,3360,2680,2737,5252,3070,3265,2708,3773,2946,4839,2412,81,3806,120,784,5068,153,2421,4280,4957,3843,3094,4677,2562,1628,1033,2872,1031,2357,100,2078,2042,5391,3715,2534,4514,2504,4976,5047,2067,3440,207,2266,4861,3231,185,3764,4611,4992,1991,3109,2033,4978,4623,4223,5030,167,5197,557,430,5093,3333,2214,4012,1654,3770,388,3476,2571,361,5036,1089,2215,3554,3987,1279,4200,83,4180,5122,3037,4500,2007,4571,1185,4316,1005,3828,2025,4917,1582,3850,475,3306,1187,2279,1497,3395,3288,3976,1630,3768,4161,5247,3314,570,1856,1118,398,5142,3726,2035,3139,2161,2658,4352,1194,1087,2808,3527,386,2724,3075,1316,4002,1447,517,1650,4435,39,361,438,181,2739,2989,5224,4988,5448,2096,495,182,3793,812,4826,3022,4400,3255,807,2166,930,3577,3865,3413,4916,4989,3782,4045,2741,2670,3621,2981,3357,5220,75,1165,753,4892,1950,2645,1378,2359,2353,2108,4273,2806,2922,1432,4004,1787,4488,2762,740,4404,12,2986,4406,2321,4571,3542,2519,1758,1115,1915,2741,5287,3092,1010,5259,4958,2553,5166,28,2175,4671,152,5055,5180,1278,2336,3867,2707,4088,5043,1332,448,2247,226,993,4365,4755,4958,2648,3640,1737,5251,1394,950,4306,5501,2247,2058,4500,3340,3089,4434,4908,4682,5292,301,4039,1357,3351,3782,478,4864,77,2266,2639,1784,643,932,66,57,2258,2438,2924,5049,1648,3449,4083,339,2710,5261,4727,2185,4506,2136,5405,2489,2540,938,4890,3438,559,5346,2519,2709,556,2434,2209,2710,2227,49,5177,3068,2500,3388,1268,1176,1861,2489,4447,3513,4281,4939,3911,1128,3933,3439,1265,955,4888,4643,1716,3975,4343,1712,5450,244,3572,70,3343,1557,5511,5091,5339,1408,815,2881,3494,1160,4495,4809,1910,4640,4405,4069,2467,3288,2389,1135,4751,786,5320,1668,3193,3959,4354,2376,4600,2278,3785,2015,2003,325,3444,4312,1165,1168,2955,2299,1292,1466,2432,700,3509,3383,3491,1820,222,3666,1802,4619,2679,1326,262,707,5480,3636,4898,1550,569,4336,1405,3461,644,437,4663,1721,5095,3849,5142,1601,3467,4483,2006,2120,4319,4952,5253,5483,1168,3957,3773,3810,1126,1481,3411,4610,3533,3258,4178,1162,3815,1886,587,2083,4528,1779,3661,1133,2464,1250,5357,1639,4939,4230,5249,5374,3354,3799,718,2176,4600,681,2299,3317,5210,592,4794,4737,1662,4706,2297,5198,5463,3795,2610,2614,241,4,2883,3530,1101,5009,1108,1006,2824,838,884,3480,4167,134,5511,5424,2387,4914,5402,1003,1375,2854,4646,4406,1932,4335,3064,2996,1254,2666,3853,1392,3452,3686,597,4936,5463,1015,1445,4003,3417,4324,1803,780,443,4600,1432,4808,3184,3300,5212,1893,1561,5440,3573,965,106,1603,1853,3336,470,4564,3593,4083,3211,536,4109,4569,2597,2264,70,1907,2431,1609,2447,2258,4909,2080,3002,570,2095,1960,929,5205,2483,2936,518,3630,1612,3823,2304,1671,1001,1999,694,4993,1678,3267,4712,2958,517,834,5259,4292,5462,5130,1185,1511,2807,3149,2166,3912,5039,1179,5068,4467,1285,4157,1698,3644,1568,3269,132,4055,854,3346,4157,1837,2600,4500,2757,2925,5130,1153,2161,874,4911,3716,5468,1035,1700,2154,2617,4195,30,5346,1540,2794,3332,5128,3313,4744,5138,3832,4101,4309,587,2828,4385,4702,2964,4002,3722,622,2675,4611,930,2672,595,339,1576,3036,3650,1113,739,2472,3681,3734,4935,5235,368,3041,3071,2014,2705,1809,1778,1080,4253,2040,3891,273,4857,599,539,5521,2282,4730,5465,3223,3263,5199,2915,3426,1757,2543,4686,2971,1315,4986,1000,1817,1015,594,2029,1155,1350,2484,1519,3356,1536,3549,3837,2194,1143,3502,2493,1220,4608,1205,396,2668,5287,1770,898,3553,3940,3608,4341,3739,4452,2828,774,721,2123,5372,4810,1489,3872,3187,2950,340,3157,3317,849,4571,4213,4447,2591,1656,907,4222,2807,844,2867,5122,2632,2435,4017,1283,2571,4069,4401,4540,4433,1820,5524,2238,2016,1242,4574,3276,1435,2842,3637,3712,1223,24,2170,442,1638,5362,1038,1755,1705,2882,778,2906,5233,987,1992,3875,2049,313,2181,4554,2150,3773,472,2245,2226,2869,3275,4224,2991,2440,936,4794,2814,700,620,4851,1739,1222,4319,3515,5174,4191,423,5447,4968,3419,776,4,4936,1071,2644,1949,4660,3444,2263,3973,4061,1403,1358,319,4659,3755,4325,3309,109,651,1226,2922,111,3646,2284,3251,4543,3361,2492,3931,3107,3333,5349,4778,5286,673,326,470,1826,3302,1395,5510,2097,1299,4883,3531,3604,2515,5479,3936,4309,3987,120,3154,2914,2637,1474,252,640,5001,3660,396,4716,2444,5103,3129,2712,3143,531,5498,3138,1552,75,2723,409,5395,2305,1327,1304,4467,478,2665,3502,2608,110,4285,4093,5011,4245,201,3650,2858,3010,4324,4073,2166,4434,2508,4955,5390,3558,4751,254,3029,5502,814,176,3189,2498,1230,4024,1068,4056,1627,1400,3599,133,1440,2082,607,518,622,2860,3443,1768,4301,4214,24,2654,2960,1737,3806,3896,4395,2140,4058,2356,4382,697,5232,4193,1674,2600,4759,4985,5088,5349,1148,3714,92,383,5261,214,3523,1392,2272,4387,1645,4168,994,5375,4476,3647,976,3090,2479,1778,1859,1166,2240,2086,800,1561,2352,3962,5067,1677,181,5421,159,2103,4681,2063,4514,5381,5167,4167,1657,366,4276,887,148,3493,3148,4834,4921,1915,2874,4060,463,1942,3120,992,4304,3394,1421,451,2117,1756,4948,4447,1581,957,5463,405,1327,5424,1389,17,1641,2159,2026,4508,5463,4090,4400,257,1354,3158,1487,2319,4440,619,4806,4576,954,4270,4324,4880,967,1340,1422,2464,2107,1581,856,4463,5052,4933,3957,152,385,3312,1378,3693,2990,628,4575,2053,4608,1795,3595,5038,3450,2301,1386,3570,4329,3291,1928,3522,4762,2610,55,2744,499,3338,2804,628,3184,3452,2519,5375,4106,4484,980,4058,2847,3710,3854,4842,2337,440,4076,4225,911,4074,2291,587,5419,4530,4540,4602,710,3195,2803,5422,3733,586,2915,3946,1313,2784,4606,1922,2239,1516,2153,4449,3721,824,275,5024,1626,907,2695,2192,3460,4913,4621,4716,1529,4499,2832,1909,1585,1538,214,1281,4174,5455,651,2504,135,1501,5489,3432,1722,4686,3003,3441,1861,5153,2552,4809,187,2760,2960,526,5270,1063,5479,2456,115,1777,2328,4786,5209,2454,4935,21,1876,5353,1987,1139,3167,552,241,4989,3926,3271,4369,3034,1268,4258,3254,5344,2264,1876,5385,3554,2609,1758,415,1565,2647,4489,2631,2729,2042,1495,4109,1923,3579,4219,4749,595,2443,5207,3481,1405,4669,3171,3648,1182,5315,3579,4942,2546,2442,419,5405,2122,1544,4702,2910,2177,1869,2295,2385,4874,2625,1482,2744,5099,3040,2279,2687,5369,764,2252,1196,4958,16,4200,986,2238,1461,2633,1537,709,3483,338,3413,5119,139,1444,677,4385,2528,3859,1013,5466,1198,4444,1403,4627,1933,4407,3431,4760,1734,95,4628,4955,3736,3916,1535,4372,271,2845,1230,3774,3508,3321,4382,4351,3390,4804,2930,580,1252,2234,3217,3233,2984,178,271,2858,710,2049,3395,5140,2418,878,3297,3133,3963,4517,2811,4057,959,2446,1883,2106,1970,2407,1089,5206,1049,1822,3145,947,2643,3382,2167,920,2411,2298,1986,5069,3994,3223,720,4479,5358,3889,4360,412,2922,5269,2748,2105,4757,916,4646,4743,4252,1085,5294,4557,3465,1790,5107,5164,4563,1082,3562,589,3064,2187,335,3582,1655,3885,5510,414,4068,5374,1101,1579,2875,2208,5503,423,5272,4703,2743,673,2055,4887,4504,4164,1548,4738,1013,5185,1429,1441,1665,4515,3882,4788,4566,3115,3359,2338,2288,1146,5343,3706,1275,3821,3604,1435,1363,1329,2754,1337,1298,1863,2263,2868,32,4621,198,3297,267,4214,2065,4178,496,2886,3189,4136,2333,3995,444,5130,775,938,4575,3852,1527,3104,3296,1580,729,2569,2574,3653,2235,4338,2420,3639,4967,3307,2382,5092,779,5421,2887,5367,3963,1054,4926,2255,4058,2878,1318,1795,3613,4299,2478,1835,57,4863,3856,4504,1408,375,1215,3840,4876,4380,5445,1302,3731,857,1729,1078,5464,3639,193,3235,1081,4797,2053,4466,4006,5253,915,2493,165,3869,94,4342,5321,4228,1749,4274,4423,4912,1872,4536,1437,3712,612,4605,1132,96,1592,979,515,2950,4669,3200,323,3705,3008,2159,2502,654,2460,1122,4471,664,4629,1978,1880,5469,5253,4315,3401,4266,3164,2615,2911,4228,2662,284,5207,2179,4204,2318,2822,1540,5360,81,5483,4219,5040,5334,5102,3735,4399,4626,2864,1978,3912,4831,2128,1662,3573,1107,5442,1723,2373,303,4879,4379,5062,943,3155,583,4096,245,3046,4849,5112,5291,3273,3208,2015,4203,840,595,3381,90,1016,1977,3765,1166,5449,3387,425,1241,728,5443,931,3284,2985,5362,108,2459,834,217,3390,3674,921,3915,1138,430,3314,4265,3566,4627,536,3088,3047,3674,1636,2291,1088,4028,3887,3904,3763,4983,5004,794,3112,3299,633,4069,2865,4139,1519,1311,4234,5315,3733,2320,5492,44,4567,2116,410,1529,4664,4938,3684,1586,4312,1169,2394,4901,3168,3173,2980,4599,4719,1968,4686,1708,181,1632,2509,4895,5465,4816,3293,1646,192,3774,1737,2823,2688,2850,1671,2723,5383,715,1713,1745,1617,4557,4782,3868,115,3733,4019,3416,1757,2699,5166,4693,1334,4640,1041,2375,919,2901,181,1158,967,2761,3662,772,99,5487,5317,4419,6,3448,63,2328,1329,2229,1948,2488,4988,4051,1595,5065,1562,3673,5148,5478,161,4077,2588,3055,572,2852,3817,593,5002,1385,4265,1446,5492,3321,3429,3433,2872,1159,4928,424,3915,1639,5257,4485,786,172,4586,1257,4748,1497,4205,3439,4648,143,1228,4817,4816,5494,583,4335,4348,3194,2710,5510,1848,4855,2151,3423,4456,4435,1840,1948,1058,3210,4157,2472,5499,1319,4345,586,4013,1490,3605,2277,1666,903,1500,1037,3221,4190,1123,3622,1861,3548,4743,3058,2252,2731,1141,1603,2147,1034,86,215,2512,4380,2385,4915,4929,5251,3629,851,1849,1222,635,1425,2794,1407,2744,500,4991,455,851,167,3871,3786,1402,4028,3298,1973,3632,1835,3951,168,2295,1859,3958,1095,1484,4556,4175,3717,433,2323,4103,563,743,1433,2675,4598,2290,3735,1402,4609,4653,5088,907,102,1421,2181,1110,423,1899,1254,2755,1485,2774,3405,2168,3816,3337,1924,3231,194,4790,2454,579,202,3868,1315,3863,5309,2758,5078,477,3758,2665,4839,1697,1124,2316,3936,2829,4105,1007,4739,642,2988,1616,1210,979,5084,1531,3848,763,816,1668,1055,2728,3875,2622,4738,5133,1637,3695,2628,4641,293,271,5049,1158,2099,529,2220,2092,2542,1272,1838,741,4054,1520,4998,3768,2332,2368,3718,2923,4513,3347,724,391,2337,5388,1276,3738,2249,1312,4579,2047,1289,1803,5314,4283,4080,1251,2556,306,3504,3155,5384,976,3974,1163,3720,1831,4666,3982,3760,959,2786,3869,3619,5235,2942,4219,819,3178,3022,4231,1263,5338,1702,2552,1297,14,3936,4257,697,3311,3739,2705,4132,4680,5427,4651,58,2250,1676,1100,1053,4684,2700,5189,1628,1109,4185,2861,2334,4762,2116,1572,275,3407,1937,4125,2615,1569,3074,1666,2642,3858,731,3279,374,184,3386,2749,2595,2094,3763,2514,548,4471,4530,2754,5142,1584,4301,3861,1223,3220,3995,4288,2416,1856,2794,2755,2723,1682,4970,5364,4244,4206,1568,853,2762,4614,5314,3965,3951,645,2015,4290,1288,4405,620,137,5122,2764,3486,183,2832,2137,860,4646,792,3885,4055,3191,5234,5038,639,3720,1116,5428,5395,5353,4791,3499,1899,4693,3742,4547,484,1308,1750,4513,3824,3312,1521,2465,2154,4615,2785,1771,2308,4721,5294,2514,571,3343,4645,4123,5358,2332,3807,267,63,1535,4945,980,2414,5029,460,625,4092,4870,2221,4591,1990,3,1308,5227,1521,4520,5244,4776,1302,2429,2586,5421,4071,5289,4022,4938,2284,2233,1051,152,3341,1095,4334,1188,4904,3704,624,1068,770,2131,3604,5253,4889,4634,3761,1987,4451,4269,4324,3356,5137,273,2497,191,492,2795,3729,4136,1190,5437,3922,3710,4964,698,4242,5375,2645,2181,4046,854,2646,317,2394,502,881,4307,2611,491,2583,3623,1876,773,2250,3728,3736,295,4306,3387,3210,2857,5290,4796,4245,4932,4293,1220,2721,2629,2332,2676,143,3958,1512,4870,2172,4046,4736,2463,3999,4762,4908,1112,1061,1456,2430,3202,3618,4602,1185,1404,166,3884,628,4995,2795,1456,1959,5416,5123,4003,4342,4979,4392,1946,1916,1526,3788,3754,4502,5112,633,5372,1308,4950,1631,1170,2953,4676,3800,2743,5482,740,4091,3051,5031,3928,3197,2155,3596,3924,4357,4377,4866,365,2958,3479,2675,168,4168,4602,2921,632,4893,5068,2093,2616,2994,114,3917,5152,3542,3242,3804,3497,3485,1257,2802,808,1793,4310,5104,4532,3062,269,8,997,1302,1880,1325,3709,5025,5326,3300,1278,4534,2768,2865,722,5327,5510,2476,1280,1017,4662,3050,5523,679,5009,2022,383,851,4181,2840,5503,4877,851,3347,3134,4344,2425,3613,4199,655,3955,3474,3994,3052,4646,1027,2079,4891,2756,4103,1017,5085,2751,3764,5261,4684,1253,3434,4793,1601,5307,971,899,2555,2573,3948,3501,4019,1882,1427,4775,2557,138,3715,1552,2046,3991,3240,508,148,4072,2611,3580,2100,3117,647,1815,5387,3266,3489,1533,176,3556,259,4471,3458,5258,1212,2705,3881,4971,3306,247,2932,3860,207,3142,1285,246,4081,4893,136,178,4474,545,5168,2090,2124,3516,4552,264,2237,4415,2937,642,184,3113,4492,3412,5513,2156,2894,2980,758,1362,3332,449,1633,1061,479,439,524,2506,1215,5008,141,274,5024,1542,5155,2596,4578,4819,3804,976,2449,1596,3505,2134,730,653,4187,1853,1563,1989,1873,3043,4720,1432,768,1058,2314,3886,5523,3498,3559,3057,5356,2070,1501,229,1015,2306,2960,1507,2613,849,2943,744,4832,815,3404,458,1132,4859,1445,3507,3853,2014,4217,5409,707,3772,3417,4484,5338,4418,435,3437,2763,3776,424,4967,5100,3045,3858,4310,2599,714,2446,3203,193,2126,530,5004,1947,4256,373,3000,998,4459,1063,1865,1910,2177,5436,3240,390,385,3155,929,4022,4003,3736,1650,2386,3728,5244,5504,5365,245,4753,4363,3871,4826,3438,2502,1698,2595,2522,3886,3687,3724,417,1696,4704,1928,3867,3283,1609,4629,2165,3422,1036,4070,3526,4882,2798,2511,1218,4287,1053,344,5328,3866,4246,1099,4846,1115,3619,857,1418,4014,2987,2112,3851,3417,2642,4604,2641,981,1885,3739,495,3377,2218,4743,2817,5170,971,765,2788,5160,4677,1966,104,1166,4919,1363,1642,718,1926,4349,1339,89,5002,51,4564,3345,2626,1185,2503,847,3114,4867,4335,3335,2914,1521,1608,5256,547,1917,1282,1476,3231,1549,2341,1754,4492,5033,2394,4304,4962,3678,3222,2879,5071,1103,1068,2566,3389,1760,4391,1269,480,726,4043,2902,887,2889,1066,5110,353,1355,1787,2646,5185,716,1193,996,506,5487,1763,459,2271,1449,2806,2260,3813,3224,3911,407,2195,1092,1949,4613,1967,1679,4443,452,4832,435,3783,1475,5105,3174,3390,270,4490,643,4333,4796,2484,432,2275,604,2476,374,3845,2081,4965,1057,2592,3372,5173,161,2572,4252,2306,4277,4314,3744,2632,4104,3824,2457,837,1373,821,5140,1074,2555,1079,5080,5171,1674,4877,3521,806,131,708,4305,3473,4697,5523,2596,1639,906,4458,68,2465,1526,2405,3438,3476,3216,3844,1299,5141,4302,3192,3784,159,3154,1825,3680,4159,4834,1297,641,5389,1450,2164,4168,234,1766,1282,1969,864,1396,4899,5318,4491,5366,5217,4128,772,2125,561,1725,3581,5448,49,4658,5113,4937,697,2417,3579,109,2289,3469,5364,3161,2974,2383,990,330,3169,2292,2684,1846,2999,564,1138,3002,1453,1132,787,298,1374,2835,2353,4655,1648,3398,4204,5508,4397,3136,5128,2137,4865,4943,1197,2175,1982,10,4989,1336,4431,2870,5311,5455,4021,3474,1475,1417,4777,4797,3253,295,1419,3693,3509,4305,2900,3174,653,159,2229,2643,1158,3355,4920,3421,3116,3258,393,4483,4183,2094,526,3700,5209,4766,4497,3745,2130,2442,3121,3972,5379,5394,607,2544,5001,2530,41,4321,4505,1220,2642,4852,5323,4656,1699,748,3301,5250,4323,4058,3253,62,4972,5400,3652,4725,1452,964,967,1342,4465,315,1669,3321,751,338,953,1252,1532,2737,5433,1431,3690,4777,734,1511,5250,4259,1727,708,200,1549,1648,871,994,4783,858,2501,396,1527,1504,2174,4234,4664,160,964,3273,3519,5238,4726,4878,616,3819,1938,3543,1649,1297,763,2262,3802,3920,2411,2675,2770,620,5453,1281,4769,3309,902,2139,4064,3521,126,353,5154,5025,4209,556,4299,2437,3428,4243,4601,3639,4956,2140,2087,1906,120,5359,390,864,4615,810,887,2801,1993,5031,163,3307,1465,4058,5169,3726,4928,3797,2993,3131,2053,2852,937,1314,576,1241,1797,3166,3693,4633,2667,1277,1367,4463,2869,2096,119,4567,652,4337,3110,4735,3481,1892,387,2435,1863,440,1434,3746,5159,3111,240,959,3995,4899,2295,3064,1941,1988,1622,2795,78,4126,2970,3471,701,5040,3084,1453,208,4605,3406,1372,4456,335,2262,485,3918,5402,3688,3526,2178,4641,4652,4101,2697,2319,1067,1804,3608,3138,179,5062,1792,2360,1665,1501,1997,2602,3453,4575,2318,4169,3567,2349,2030,858,3004,5079,890,4947,4529,4059,1214,5096,2306,2197,1963,5281,2092,4022,2953,1031,1871,572,3027,5359,734,1511,3699,5440,436,539,1727,4577,1729,4560,2268,1278,3915,1491,3576,308,2161,2885,2174,1540,1017,2877,2067,3609,5160,5111,2986,33,1126,3987,3915,965,3541,3611,412,2453,5255,3631,5196,3297,3062,2498,289,1932,5014,4354,1958,4210,4674,901,668,5072,3157,2574,4638,2322,2217,5333,3889,3201,162,356,3868,4046,2925,4578,3413,3554,1642,1965,4947,5365,3244,3760,492,685,78,4429,1072,2104,1798,2069,2767,808,5494,3475,3340,2003,601,745,1223,3114,4491,4804,2781,5219,2109,2546,2338,438,991,1669,1665,2941,269,381,2028,500,2992,4587,5294,3676,1875,669,3810,5022,1424,3255,687,926,2697,3244,3728,1612,1711,2472,4503,3585,3426,393,2560,4165,2560,5481,1301,1152,1083,5491,2821,2888,3704,1166,1389,293,267,240,2078,5067,4257,713,1713,4464,953,5071,2488,4094,3847,2473,2510,2051,576,551,2364,2795,4890,1011,397,1307,2870,5059,662,2982,562,3500,348,3130,5445,1094,457,3378,3545,1626,1997,5474,3359,3283,4255,5409,4190,767,3386,3699,2596,2003,5219,1747,3833,2443,4661,3063,344,5337,1853,1487,939,3020,1107,493,5020,2531,2327,621,1693,5313,3013,3980,517,5510,30,4220,76,115,5405,3129,2799,5290,2217,3604,2311,870,998,266,3486,624,2564,2655,2902,1890,4954,359,4931,2267,114,3781,1750,1832,2296,2252,1799,634,4323,3434,448,3282,2507,5176,1213,2043,239,3929,4574,1924,5208,3529,4071,2471,1462,4560,1959,95,3975,2651,4943,4355,2209,361,4648,700,1725,1518,968,3257,1630,1628,357,1507,4630,3018,247,212,1568,1641,5346,3510,847,2104,252,3109,3824,3738,2483,3657,1405,1893,1759,1390,2022,4431,4963,2371,883,2914,3441,776,3713,1383,419,3118,1836,521,405,3394,1877,3050,1103,1253,1742,3886,4238,1318,3826,1444,1484,1243,2094,4462,3965,2176,2959,134,4629,2114,4083,940,2353,2795,3396,5204,1269,2711,2166,888,5194,1467,4162,2209,1580,2816,4206,4113,2928,5040,4004,3537,4660,3079,942,1517,1824,4003,2168,5189,2858,1188,1930,57,4257,1674,2552,1359,1523,4278,681,5122,269,492,4348,4529,2402,859,3323,4787,1813,2786,3913,204,1346,1574,3702,1835,4551,1856,3232,619,497,1796,2659,3285,2971,3954,4245,4822,5506,2656,528,1351,140,4771,4523,5238,766,239,5159,2425,3595,3576,301,1539,2102,4018,686,3187,2577,5113,5110,18,2929,4289,1990,1296,4286,831,6,4573,4116,2099,5289,471,2783,3872,3688,4120,4579,1040,2725,5348,2763,1279,3222,692,1356,157,3765,2406,4243,3034,4249,4948,2224,2342,5431,1758,221,153,1691,4103,843,3989,3784,1350,1118,2801,3761,5489,3585,2566,2234,1067,259,1785,4906,3243,4478,4146,1103,5107,4512,1265,3385,2654,806,239,4713,2834,729,3801,4752,223,2118,1415,4569,4157,566,1675,1337,52,3134,2532,474,410,990,3250,3466,1606,395,1332,2526,4072,825,5304,1811,240,3785,4444,3339,4673,3976,3743,4783,1707,2254,346,3176,3073,2110,305,5465,2008,5229,4857,5097,5272,2395,2379,2377,3409,208,4477,1294,4627,1933,1050,4106,3416,4910,4473,1721,851,2832,2167,1886,3853,3694,2963,2435,3171,4953,3138,4093,1042,2222,2117,3004,5513,2869,2935,3667,5019,1668,817,3206,556,3091,2342,1026,4581,4618,2107,2249,5154,3867,415,1793,4350,4086,1612,4772,445,4107,5329,3477,863,348,3861,931,3431,3594,2376,2308,2988,1468,299,2894,4385,299,4914,468,1175,2381,3,4194,37,2020,4131,2465,2916,474,4311,2750,1815,573,1062,2922,3458,5222,51,3858,5525,3246,3594,4300,3853,2399,2479,2674,3759,4055,3618,1468,2827,5325,4635,1678,1764,458,1983,4194,2916,4510,4315,4309,4411,608,4298,561,2371,363,1078,3784,4560,45,3923,4804,1451,4183,1232,2030,4679,3483,1506,1169,64,5116,4427,5171,2696,1604,5035,1732,3992,256,540,479,4577,3921,2412,2117,567,2343,5393,721,1929,4319,5069,4255,4593,2194,2500,4703,4963,742,2079,598,3282,5024,2613,1727,1103,3765,4435,3021,5265,1781,4130,293,3516,553,2215,2694,1790,1569,276,1699,373,1448,1166,5299,1798,3083,3752,3652,3390,4262,3886,522,2365,4437,4675,5478,2611,3914,4454,4236,3110,5233,3679,1567,5103,876,1684,61,1545,4221,3606,1006,2398,2822,5352,5113,1798,4786,4342,4706,676,5138,2263,3160,4344,5071,5063,370,1042,509,414,1465,5119,5277,2254,3583,3352,5264,4697,3039,314,5016,4617,2164,2416,4444,4572,4803,2056,1656,342,2938,1246,769,4292,2594,839,5405,5019,5112,3640,5499,2736,2535,3843,1741,4284,5264,2334,959,3811,1635,3703,1622,2642,252,36,4256,4994,2114,2554,1805,1641,23,3646,931,4983,3185,4854,4451,688,3223,2914,259,2249,3040,1077,1731,3082,2373,1447,3720,4145,4384,3505,2864,1488,3624,4996,4071,688,2382,3552,5011,3683,3883,2818,3625,1708,1146,677,1258,132,468,5270,3721,925,3699,2739,964,1876,4143,2354,4794,4863,5502,2067,4109,4677,647,646,2458,5206,3595,4954,5344,145,2318,2771,3008,4613,5190,5227,2902,4543,2425,4038,2435,1257,4606,547,4457,2088,1218,309,3212,3011,815,3154,122,5455,4382,4794,791,1883,5095,1141,3042,4936,2581,3545,5369,3113,2385,2158,4065,2087,2458,3120,376,2545,903,5461,4220,3791,361,1751,559,5100,1603,263,3738,5483,3858,2658,2299,1891,1090,1001,4463,3833,617,4468,2097,4400,550,1530,3808,2848,1466,4691,5257,3029,1103,1655,2727,654,3458,4057,4696,3283,1734,4329,5320,758,3569,5128,4201,3425,5041,1747,4746,5060,1465,989,1638,3478,3253,1000,4119,2343,1752,288,4248,947,4753,1448,949,3549,926,987,5441,405,701,579,4026,3406,29,3444,2974,449,3439,5479,1834,20,5252,5260,154,1883,69,462,659,1323,5129,1332,2569,1221,1665,1383,3041,1034,228,2649,4390,1885,60,3046,3875,5385,2832,4929,459,3674,4539,827,3724,2380,1233,806,1769,5364,4203,5466,2632,1060,1923,4284,2259,990,3153,876,4633,4906,5173,1058,4104,3014,4667,4632,1804,951,2949,4869,44,5410,3999,1103,4400,1945,2360,2428,27,345,4852,3873,1029,3326,3701,3699,1532,3262,2468,867,4637,831,4478,1445,2786,5105,1853,3654,2276,4446,5208,2801,4668,4381,506,485,4081,2592,4891,4461,633,2850,5230,3311,1072,1729,141,1430,5016,3951,565,4047,4951,5092,1433,2320,1022,4457,4947,2999,4485,2437,2724,3951,5135,1242,1179,1605,1715,2618,771,965,1143,3559,5342,2610,4462,2028,1743,667,1349,1555,3784,251,5082,1581,4116,184,4566,5220,2173,4091,3391,625,5167,2147,3083,439,4254,4135,2268,3739,2221,1936,114,5356,4203,1796,3977,831,704,3705,1849,1302,2826,363,1806,970,3113,488,1059,2485,5300,5026,2976,4304,4266,1519,583,5497,5100,4682,4855,3812,4749,3805,4061,4936,3963,1316,2008,2536,857,5403,4135,1693,2567,1824,3217,4096,1875,738,3568,737,4845,4215,4641,3305,2211,2702,1471,3594,351,2265,969,2250,255,3109,3280,4760,2638,2445,4775,4062,4822,3,1450,1891,4634,4429,570,3519,1223,873,1116,1043,4670,1090,805,3572,4173,4604,1539,4624,629,5003,161,3846,2378,2535,1992,858,1475,4804,3233,4027,999,4361,4044,2550,3379,521,5252,5461,2240,1438,4288,5353,2530,844,145,3773,1090,5104,2385,2763,3846,5281,1156,1123,160,5366,4789,1655,2721,1163,5237,5341,2735,5140,4781,4568,2387,5294,4338,1441,426,1134,4989,3111,3727,1812,909,1407,725,3838,3196,3238,4263,2495,2331,4250,4783,1013,847,5131,2376,1913,1592,4783,425,4359,2450,3571,1375,4075,4795,2044,3820,2475,5503,4770,1989,1818,4558,2538,941,4510,923,194,636,3087,3440,592,2612,940,3989,5308,5260,3798,64,3872,987,4374,3719,4097,1855,5380,2831,1161,179,3386,2588,4895,1498,2616,729,319,2822,2395,3064,4179,3032,266,3893,328,1892,1460,3009,4489,1050,1999,3443,4404,1947,4136,3230,3909,855,3906,403,5305,399,5502,2189,3610,3074,3216,2377,2618,4161,756,5106,4127,158,3247,1417,4299,4657,3427,1279,1665,2230,3134,3394,4437,4032,5227,1692,3359,4418,4443,1690,4610,3911,1379,2839,5165,5506,1778,4222,5208,5122,4375,3958,3624,712,2129,3293,5489,3679,116,1363,4451,4547,67,2160,5449,4235,228,3752,1323,883,5023,2730,1896,2830,3163,5319,3945,2659,24,1,1118,2245,3910,3992,1255,4180,5202,1190,5221,1001,3842,3688,4214,245,911,5127,476,4473,457,822,5492,5346,4279,4801,3390,4361,2039,1469,630,1358,1258,3434,5287,2423,5434,57,3466,3888,700,4729,4766,4,4197,2522,3194,2573,4145,2251,4561,3905,553,1506,3687,2100,732,4594,3272,4564,5454,3399,4435,3300,2398,785,3781,803,3566,1405,2920,2705,1845,1755,930,1066,4368,2301,438,412,2946,53,4768,1667,5284,5328,3530,3368,5208,4789,1194,659,2830,638,3116,420,5508,4287,859,1689,4170,429,5425,669,5379,293,1286,492,3667,3949,5072,3368,325,3430,5052,5277,3405,1366,3852,2632,2939,4357,1024,79,2040,3688,5400,1796,2362,2697,2833,362,3258,1360,1230,5008,2374,4620,2726,4978,4047,3589,2900,960,830,5415,857,3892,4361,3586,2582,5439,3881,2832,5389,4029,3079,3460,333,3318,3927,4030,3241,2497,5413,119,4655,5044,1751,3552,1851,3789,4816,1165,2228,459,1041,2828,3412,440,2617,4961,2175,2130,3893,1461,3697,5142,2395,760,1070,4455,4917,2593,4244,40,1206,4101,3236,1849,438,217,1165,4020,746,4304,5385,5289,1657,692,1898,4923,1742,2566,1917,2343,1569,43,744,3747,941,2770,5188,5224,2809,2109,4136,1129,4445,397,4972,3280,1638,4065,520,4156,2241,3983,1328,2921,4177,4185,4218,1118,2613,4401,1950,3117,2986,4706,4514,4476,2652,2626,2309,2005,1695,4981,4088,2470,1403,727,1019,4144,2404,4655,4983,4982,2309,3246,4222,4982,1861,1145,657,4903,3717,2596,4503,1380,4732,943,3185,1217,1939,3444,5053,1695,3119,4514,4910,3535,2878,4011,3171,1389,82,5155,2239,1479,3547,3151,2972,558,4495,2552,1092,3579,1698,893,3940,4888,422,5086,1895,4839,4102,636,4608,4146,2981,1369,522,2580,2215,4860,5231,1797,4640,5028,4551,4767,5331,3217,3161,4922,3709,1380,99,2729,494,3252,4381,2130,4830,909,5235,5331,4796,5234,3199,407,865,5249,3476,4566,3686,1099,1171,791,1742,875,1867,2502,3187,3144,3629,262,1661,3702,1749,641,254,3833,2313,2541,3890,1390,1569,3415,919,4277,2651,4712,5096,3824,4203,597,2202,4318,413,5201,3934,4782,3638,4585,3206,3668,5448,2706,5380,3101,844,1590,3440,3846,400,1478,1506,4141,4980,1203,953,588,1629,2609,2080,1822,4776,4208,4795,3293,1926,3216,1744,1204,422,2784,1081,163,4344,2736,633,1941,4313,4680,258,4852,58,1033,3168,710,1631,777,410,706,2749,1396,5160,3179,5247,1482,3318,3478,3315,2627,785,1954,1918,1273,2899,5260,3307,1954,1938,294,411,2644,4175,304,4276,3679,1490,2289,105,2045,2836,4347,5408,1387,783,3059,982,4305,4392,550,2794,1550,506,1970,3541,1430,1499,3982,1955,711,4595,5001,504,2935,1389,2102,4399,4521,4543,29,3868,3810,905,237,1141,4749,2555,2862,940,1005,1062,5050,2480,4797,1944,4367,5132,4485,5076,3789,5436,3351,2381,3788,4019,2042,5106,2990,3671,4812,512,1805,1617,1597,3567,2191,5247,871,4046,2063,3058,2663,2858,4863,1114,4989,3408,288,2953,2958,154,202,4123,2846,4961,2780,1371,3983,3723,2989,1287,2922,3564,1421,3552,4983,4904,5241,2019,4024,5144,1569,199,2501,4934,2892,1263,829,5362,1963,2421,3514,5366,463,1922,1005,1606,3617,451,23,2025,4676,3138,764,2743,4473,5517,400,288,4314,4352,4030,1783,1459,2015,1090,543,2507,1421,1448,760,856,2530,186,3704,3394,5069,1824,1987,512,3065,5465,3181,3255,4024,2581,3109,1565,288,2762,1848,4090,3676,3572,3104,4190,170,1153,5207,4138,3729,1586,2417,2217,1344,4129,1970,4085,3391,1794,5331,4485,1063,1154,4035,5373,630,1329,5475,2121,4318,5337,74,4988,94,4276,4185,5147,4761,4743,403,2208,4000,2024,4923,1400,5510,5078,4202,3737,2580,2721,1440,3358,5144,5512,401,1706,4307,4347,5108,2107,1023,2596,3905,910,630,3778,1361,1748,2275,2871,5436,2807,4802,4052,3537,4164,5332,1041,5142,4003,663,531,1980,4751,1129,4588,5298,1433,5172,4546,918,3262,4911,1041,936,3034,5371,1055,4272,1676,2972,385,4512,975,2305,391,2121,2374,940,4916,3480,174,4526,3277,693,4744,4747,4199,801,2704,3015,697,2983,4847,1335,792,2957,2968,4668,4654,4152,2674,5087,771,1653,3333,5433,4102,3139,4184,672,5008,4741,3481,2881,4361,278,478,2013,2647,2257,60,639,2993,4865,466,3119,1547,3347,3272,844,4468,2715,5497,2255,4926,658,1421,5172,2376,2913,4605,4898,965,608,4922,4795,9,2638,4561,5082,3440,252,1037,1301,1184,4005,5178,4273,3043,51,1757,4306,1917,2657,3022,1362,460,5443,2622,2320,3495,2696,4129,4917,3189,1926,5135,414,671,4169,706,1167,745,1249,3443,5476,4958,477,3634,591,3181,198,1703,3218,537,2315,2670,2371,983,4145,401,612,779,1616,2386,4500,495,3344,4983,992,634,427,3621,5381,5442,607,4935,3780,3341,4809,4008,1429,2770,2458,5246,545,1036,1130,573,4897,337,2674,3573,1949,3322,5204,1869,4066,5507,117,1111,4069,1390,4460,1570,4161,1784,2849,4588,313,1985,776,3281,1522,4609,4581,3717,1292,4407,2918,4397,4261,1364,429,319,3099,3566,2849,1178,1908,2731,2139,1366,4429,2424,2032,2778,985,5192,4589,1068,415,861,597,696,4721,3377,177,2801,2981,3540,2630,4869,3330,3148,311,3936,1226,2947,2359,4734,5429,303,3285,5372,5012,3422,3415,2050,5326,5481,3696,4070,4145,4249,1893,4008,4549,5166,1049,4026,1537,4852,676,261,1805,2744,1205,3179,1119,142,2923,5402,6,230,5483,508,4869,175,1018,32,992,3451,3836,1776,3830,3343,5107,2049,1208,3427,2580,2058,2512,4586,2368,3282,2287,677,1133,5296,4617,4331,2724,2140,5322,2189,1120,4614,2962,5321,5096,954,2739,3782,1471,3717,3881,1653,2165,4912,2383,4617,2654,1127,1681,560,3721,2283,2692,3876,1359,3355,5461,3714,3765,2094,3342,515,1540,4932,51,2095,4115,327,2466,4267,2675,1007,287,5286,5201,2369,1377,3172,3537,1507,4603,5470,3688,701,1506,3201,3797,487,1483,731,3711,2393,132,4947,306,4112,4612,3988,4309,2824,2008,1076,2009,4130,2905,3402,1114,3060,5457,1778,2295,4019,2930,1970,3167,3058,2381,4867,3492,2129,5002,1713,940,3279,110,788,3008,4236,35,2811,4577,45,2571,4014,5376,4780,4663,4008,1750,3350,3210,120,5112,3003,3951,4042,2676,1928,1436,2361,5155,3606,5355,1858,181,1066,2818,741,662,1858,1127,2184,3618,4307,1960,1911,1392,4989,3523,4308,5155,5006,3686,1815,711,449,1491,3272,2137,4685,5093,3053,3698,1532,154,2304,1798,2452,1824,4409,3909,1104,2315,4601,674,4263,2083,2657,3833,5239,3743,3410,3533,2600,2226,5182,4571,2281,590,3120,1735,2121,208,3895,4615,4416,1915,2263,2430,880,1777,2512,1580,4775,1495,3174,1413,2143,3803,555,3660,2740,1211,3322,832,4418,213,1147,2635,5425,4415,5284,4457,4008,978,2369,635,2633,539,1405,4780,1105,4622,1423,5367,5402,4254,2821,648,235,1001,937,3993,142,470,2616,4902,4671,4428,2579,1719,1914,3243,257,228,569,736,338,2336,2238,2230,2149,4795,2815,1101,2002,226,888,1247,3403,2602,3332,320,5108,731,3746,1446,245,4751,1990,2849,2780,1428,5444,4224,3271,1570,2776,2674,4507,4041,102,2417,785,4799,390,213,494,3429,5476,3616,2284,4648,610,3099,94,5359,1101,4265,4262,90,2798,3242,257,1025,1281,1729,480,2174,2543,1927,666,4280,911,5250,90,3605,433,2945,4002,2012,2064,3345,2551,4575,3832,3524,4576,5262,4579,873,341,4127,2431,3681,2949,351,4307,1866,704,5331,2967,4720,2197,2689,1049,4254,3303,1485,3809,82,4756,2578,4698,465,4002,3550,3561,5133,331,667,5056,2384,729,4448,2169,46,3883,5325,4109,1617,1288,3457,2507,2101,2777,659,1427,2123,117,1900,3472,5117,2739,2506,4936,1584,4354,1875,1287,1143,5181,1318,1143,4427,1934,1380,2468,4300,3587,5349,4573,815,1557,2019,4335,4185,3772,2937,1919,1148,522,4631,5141,1108,2941,2901,2249,3935,2068,3756,4228,1943,4202,566,3618,1046,2136,1448,2686,192,1989,2801,3623,4344,3532,1713,4218,3472,702,5100,2737,541,2995,1581,687,3885,516,1976,2480,4539,336,1998,640,2140,2204,2440,222,1553,5310,4279,3099,1259,5089,5511,381,1187,3692,3831,4359,1132,4826,2929,3321,1436,1178,1904,413,2110,1363,2691,1304,3751,3610,3787,5278,1999,3276,477,514,1952,1043,1904,4241,4351,1044,1957,3738,3119,2479,5035,2992,626,501,3362,1398,3263,2122,1099,2115,32,5415,1122,1406,3419,2482,4520,3769,2739,3185,5371,2335,4313,2488,2347,1235,597,3313,4040,2696,1518,962,5043,31,2161,78,4490,4574,5350,3688,3131,1045,5407,136,475,4388,1358,4733,567,4438,2202,3622,3040,2745,2180,4894,1698,1951,4867,3168,977,2340,4605,4795,435,4233,956,1318,4397,2689,1382,3349,1154,564,2511,5410,5452,543,4476,116,3701,2469,3692,811,5418,4990,890,142,3595,100,1848,5176,4474,1260,3592,902,1893,5169,10,5231,4938,707,4428,2274,4797,2186,2717,762,5402,686,3321,993,3263,5500,5273,4725,1108,2608,3362,2535,2319,3886,2645,3279,39,4327,3691,5417,2902,5474,3326,855,783,2757,69,4199,3580,5514,5058,1153,4898,3221,4696,5509,1165,4187,3611,4861,4824,5149,4977,2458,1537,1400,5498,3879,5380,3109,5454,712,5511,69,2992,4179,21,915,1627,357,2700,2817,2168,4315,5380,2882,89,1084,1960,1244,3333,321,4276,1857,584,56,5021,1836,2331,501,4553,2686,3575,4153,4691,1070,5409,1229,512,1070,4435,2724,4455,2788,4013,385,5165,5374,1815,1659,1656,1401,3234,791,4266,4767,5350,1314,776,5457,3933,57,440,2473,361,4783,2327,2297,3443,258,2079,4963,4453,888,4431,4484,500,1811,2906,2568,4997,4244,1181,618,2358,3034,5350,2887,4350,3401,487,2404,767,1304,4423,1676,4174,1674,4395,4423,3732,1492,4038,2693,3124,1930,2095,1774,4749,2037,5361,315,3060,1648,3486,242,4638,1616,3927,311,140,3791,2211,5367,563,4506,101,1351,4239,3710,1980,520,155,472,1125,1604,3200,2945,466,2739,3836,4558,3319,4680,5476,2627,5035,4675,315,1755,584,3235,5029,483,5297,878,72,3767,3,1731,2604,1137,1042,1742,1754,5004,5353,4803,4435,587,1594,3276,87,646,75,537,427,1960,4477,1661,2599,1966,4060,796,1740,632,2507,141,4294,2000,4876,2823,1609,4473,2003,3106,3771,4206,1183,4823,1224,1535,4593,1519,1226,5071,3238,2174,69,5477,2336,4433,3227,1364,2418,2480,1318,4843,4908,293,3937,2874,5125,3289,3153,1080,622,444,547,2327,552,4833,5344,1462,2375,4370,2337,5376,5411,1124,1493,1403,2957,2690,5279,2612,834,5092,91,1832,3587,3194,4842,3275,2925,1658,3064,898,3780,2913,119,3577,114,507,351,2377,4679,953,4530,1455,3628,479,2450,959,956,836,2009,2979,3853,2044,4096,4402,2597,5030,5395,991,1302,1354,5250,3634,2525,1050,1981,266,2437,1193,2243,3845,2383,896,3920,985,2582,4859,1832,3946,4221,313,3790,4744,3809,337,2860,4206,2178,1907,4603,4078,1206,4887,349,4421,697,4154,4456,5517,5394,4663,2250,2964,4027,4412,2465,4508,1768,3065,2279,2621,3970,1549,4380,1390,5521,1545,4649,3318,305,2431,5062,2313,5449,4528,4164,4311,5049,3189,1677,2821,3549,2557,3504,5280,325,606,1728,641,3569,2280,3254,1948,1102,2071,3573,1629,161,441,3084,1679,5486,1591,4802,4375,2570,503,2730,4459,2238,3319,2709,1588,2358,3022,4610,4801,353,1061,2871,4650,2248,2090,3205,428,895,1476,1247,2156,4978,1246,5122,1958,4650,2272,1749,697,388,1170,1882,1371,3290,3114,4371,396,2716,1951,5299,2070,4254,4542,832,3439,2878,3789,1762,568,5506,4219,3718,2250,5009,1055,449,3210,3052,2755,3605,5062,736,5142,1954,2253,2201,1511,1420,5308,3544,497,4710,2455,4001,2055,4244,1033,914,3433,94,87,2397,1141,2,1241,3579,5160,782,5023,204,3048,3535,3308,3394,1963,2863,3563,3145,3307,3384,1025,4424,95,3787,2151,4459,3056,1692,4565,4368,1897,977,5051,2303,1891,3258,4872,4,880,347,3014,1102,4631,1120,2150,4013,3781,2885,3993,1333,2898,5399,2238,991,1651,3474,3396,2919,5303,4530,4889,4634,389,946,3647,927,5458,2687,2885,4737,3383,5438,4369,2950,2766,1944,3346,3462,3822,2189,4370,5195,4627,4073,3022,878,1269,1237,916,2831,4044,3958,5395,1084,523,2168,1992,2149,592,1145,2381,3813,560,4244,3755,997,2047,2337,932,4564,1911,1213,1262,3377,2226,1751,4415,605,4672,4329,1142,3505,3929,531,1920,4375,3970,3283,2778,2624,1145,2746,1418,2316,4828,1822,1292,4831,1052,3484,454,4466,1789,3269,720,1920,1051,1810,2862,1121,506,3958,2424,538,1630,3239,1025,2867,1100,2887,3447,620,4703,2971,33,4341,3572,2601,1602,5226,4791,4512,2053,5425,2335,4132,1181,1788,1125,3201,3805,5179,4536,4716,1324,2719,2323,3041,3873,638,4226,236,4035,2945,1110,3614,4202,4828,942,4308,1062,3718,4401,2296,952,1978,1983,2435,5164,1663,3596,1399,1699,5295,1017,4253,3260,2172,4514,1809,2401,278,3979,4813,628,3039,16,3697,1888,3800,3716,2253,5147,5028,2565,5022,3198,2586,3317,4219,2580,860,1176,612,4520,3383,4,3066,3838,4484,3518,2698,1549,4016,1596,259,2431,1699,936,1162,4943,808,192,4766,3449,4279,804,1463,4197,2066,4418,532,2796,868,547,4975,3372,4758,5044,5200,963,5336,2304,4417,4022,4204,629,4327,3293,3715,5214,3286,5068,4175,2166,585,2828,3266,2694,344,5305,5279,22,3090,1329,5330,3130,1267,1191,3489,1018,4195,837,5091,2998,4109,4584,4872,5498,3621,3180,2663,4375,90,4751,3672,1462,61,1080,2217,3058,3177,2383,936,3039,3268,5393,2937,3263,4131,5309,3895,4326,3190,2749,1086,1776,4037,4783,523,3883,4632,3426,358,605,444,2584,4505,1972,4798,2308,1173,29,188,5515,3101,1798,5405,1085,1883,2345,4918,1051,4025,992,4463,1915,3763,582,292,3090,3389,458,1664,4444,131,4144,12,3194,2791,2166,3560,2476,5036,5211,4064,3045,3347,5310,2928,3958,339,2081,3145,4467,705,3111,80,5049,887,4916,3604,586,3098,3162,1087,2159,813,16,1791,4282,5472,4789,5089,2195,81,356,1652,221,4062,4626,3713,591,4074,2806,2760,647,4286,1571,2832,749,700,2988,3466,4097,386,1276,1007,4190,1994,3814,1080,1060,3101,4456,773,733,895,2922,5043,5424,749,4599,4270,2330,1298,5044,5407,2677,106,3497,962,4211,4900,5371,3248,4317,2280,4446,33,1420,4524,1035,3840,2523,71,3449,4831,3541,4555,2625,1670,1638,2649,3861,3272,412,1102,314,514,2829,5127,4115,4624,4565,2718,2678,4838,1506,5123,4535,2254,4042,4940,866,2166,2194,5387,329,3015,196,5196,3712,2731,2938,2097,1544,315,1722,2612,280,193,3821,4934,2682,4558,2578,3965,4986,953,599,912,3646,1601,1690,5423,260,4692,2158,4552,359,492,5199,2998,3599,3073,4178,795,1198,3843,4195,3149,1840,4628,600,3497,4125,1172,4812,129,442,347,582,2177,1506,4017,3306,2199,1439,2187,3489,4725,2318,2985,2020,830,5432,364,717,4114,1531,3272,5063,609,3031,3937,1489,885,5105,3446,1952,3701,1462,816,3942,647,364,4819,4784,4898,4907,3262,4225,891,2488,3946,3547,292,4681,4100,1044,471,808,1378,4437,2612,2012,2307,1934,5059,2682,5050,5017,3124,195,5016,3959,2355,649,395,3413,3850,3482,3307,4841,81,1176,355,4865,1798,1398,3604,1223,1341,347,2436,3973,5271,155,4082,374,4636,3450,1108,2059,1949,4956,2712,2346,4190,3161,2545,5471,1101,4380,724,4137,4448,4343,3193,4742,1901,3762,1551,883,4115,2518,4920,1536,2272,1474,1833,3117,338,3315,5447,1743,4856,54,224,1032,2733,3631,4166,3899,113,2353,351,1488,677,1721,3753,2891,4908,2389,4838,3802,3489,424,1254,4177,5056,357,3247,3330,4318,2398,943,3329,2038,4438,285,1329,4479,3095,2218,3752,4316,610,4390,4556,2814,1279,5006,614,1013,409,2274,4437,1057,205,1315,1403,2275,4436,2923,1909,621,3154,3911,4852,1171,1048,927,2344,5367,757,4845,3644,3200,5488,4358,922,1919,2640,2395,199,3181,2832,4367,3549,4765,350,1248,5501,1093,4169,2553,3385,3647,4885,910,3963,4669,4019,3236,5264,1197,5190,3910,5469,2019,81,3983,1622,1648,1997,3187,2533,1999,679,4339,3094,5180,1112,1198,60,3275,5410,3254,5206,3625,1731,1173,4979,3078,2277,5411,3582,1295,1538,4458,4733,362,3746,822,2751,4016,338,3270,3586,5066,4897,3857,5244,4318,3355,3424,5026,1694,746,3850,3656,983,1921,5368,2348,2068,5071,4418,444,817,2894,1883,5015,3987,3478,1852,5176,705,414,1516,4243,4101,2101,4959,2557,969,3922,3740,801,4664,5129,878,237,2301,1181,4044,3673,1346,2885,4557,757,4143,2820,3058,3086,827,2556,2592,2607,3800,4564,4876,1969,3881,1433,3603,4023,3253,2701,3261,891,1479,736,4237,5106,2885,4939,989,2851,1552,2872,1241,1553,85,504,4605,1720,3202,372,4292,2361,5480,715,3159,4220,685,3210,5470,4382,483,627,235,1821,4222,1242,1003,4391,5006,4215,1849,5453,2764,1519,1892,322,542,3590,3768,2751,1687,377,1511,1329,3012,2504,3887,4132,869,1890,4083,3065,4141,3942,3794,1981,5118,3164,3191,5410,2263,4777,598,933,187,5399,3540,3022,551,3,4047,1782,1537,702,1251,2494,3794,4804,401,460,2469,866,2794,5104,4995,746,818,4712,433,2167,3212,2493,2947,2547,5112,5109,2804,4049,4237,1675,4143,2405,2578,3644,4943,5375,442,3636,2812,2991,569,1106,1588,4602,855,3648,4018,3246,982,4359,2020,5210,361,405,3827,978,4581,3763,3274,426,5249,2252,5384,4697,687,5053,896,4205,1599,2704,4238,4966,1224,133,1531,2372,4428,3034,3339,2574,3861,2578,556,2023,805,5209,3627,1051,4520,443,512,4937,4268,4651,726,3324,2478,3452,3188,2831,704,287,499,1259,85,3724,944,4343,2637,2918,3174,1206,26,2923,3867,3623,4613,5126,4780,5141,5503,5319,2384,3256,2132,2894,3585,4518,4531,4719,4978,4057,420,18,3923,4506,5058,4770,1316,3787,2333,2785,5319,4275,3121,2021,2381,2862,2866,3306,1325,937,2152,2678,1181,2338,752,3384,3220,2645,4368,1021,2214,4852,4782,5122,5079,1363,3881,5240,4763,794,71,2463,1966,1730,2891,2604,2467,394,933,3706,1686,4814,4757,2418,1129,4464,922,3743,5053,5376,4066,3110,2317,4878,3900,3792,4664,24,5501,1862,1516,2293,3992,3615,2171,3313,3836,1155,2201,4810,4730,1092,3638,2423,4352,822,4274,4937,4977,1049,3057,3953,3810,2872,471,991,1812,5434,3747,3452,3618,197,214,3666,2381,973,518,1268,4083,3400,1016,5304,476,15,232,3711,1579,5032,4908,3779,1508,1723,2033,3114,2769,3426,5505,2593,2586,3225,4186,4145,2564,4154,2225,298,2604,4935,4559,3774,5107,2583,1412,445,2518,455,693,1348,3233,3445,1544,839,3637,4161,1879,2396,3710,1926,1930,2349,1848,589,558,4185,5094,1761,2257,1759,2416,5083,2908,751,3629,763,5322,1466,4870,5475,5140,4123,3815,1594,4370,4962,2987,3376,2696,1920,3446,131,391,2820,2489,5021,1300,953,3174,3732,5351,4513,3461,648,4913,621,4748,745,1731,1734,3201,2297,5041,5077,1160,2089,3500,4547,3085,4276,5394,3083,1563,4955,2853,2455,506,2059,4600,2282,1443,2318,795,4513,2642,3402,1,4518,2239,3349,2801,3089,483,1213,3137,3097,4305,4254,5327,2899,4380,3573,4179,4993,813,2077,245,90,3435,634,1567,3205,4320,2984,415,102,3693,1769,1497,395,5041,4969,693,1931,3715,4155,2527,307,227,50,532,5142,4870,3926,44,1231,626,4075,606,2536,1913,2221,1192,4482,1343,1957,5261,5454,3577,3004,2047,3497,533,540,2072,2675,3107,2544,4728,5354,2404,2873,4543,4642,5089,141,3430,3555,4352,4838,1367,4298,4061,4247,1290,2168,253,5102,5152,4743,1316,2471,4273,4022,1376,2012,3508,4594,3494,2194,330,539,51,1061,3850,2333,1761,2114,3990,520,3669,5050,4652,5434,4787,3482,4873,4503,2975,684,2739,704,4676,307,5046,4219,4243,980,3367,4415,2669,893,4086,2541,4910,4353,2032,4280,3790,5042,4084,3146,1096,2678,3384,4518,5145,3087,4780,4307,1666,5475,5051,3441,2611,4736,2273,1729,3396,4994,3283,2659,535,4975,4289,5518,3983,2010,3118,1190,3199,4514,3063,581,1796,5349,1590,4022,3878,283,4538,23,3128,391,913,1124,2720,2120,1568,2816,330,5123,3383,3492,2533,3167,2625,4420,3124,4506,3888,1743,4077,3263,3511,1635,1959,3858,3187,4084,5008,4423,5247,753,434,422,2450,281,4162,5051,1959,637,4381,1352,4029,2170,4960,3638,2584,4143,498,3308,2919,4635,4807,3350,4006,60,4918,4014,4562,2407,2360,4917,1783,3904,1875,4284,3647,5473,5304,1428,180,233,613,5358,4762,1873,2406,1406,2647,3274,5145,1255,2942,3318,5127,4752,2608,1269,1485,3994,3981,2015,2050,2479,3966,1379,4230,1393,2185,4356,2235,1033,1866,3535,216,3889,2872,1849,2588,278,2219,3328,270,2,2138,3227,1981,2321,4587,1122,5022,4772,3590,1996,3706,5319,2380,3244,2455,2648,82,5108,2039,360,3266,3907,2001,2058,4526,2899,825,3819,3706,5145,1669,5215,5249,4219,4282,1474,1172,4275,63,3425,3627,3334,2310,3164,2029,616,62,4312,4750,4698,4850,1977,2755,2410,1819,564,1871,302,3881,753,923,4861,958,4145,1211,4324,5511,4868,656,3812,552,1763,556,1038,1477,2990,165,4330,2308,4228,4955,5187,1797,364,4661,2486,4131,4424,3984,2797,232,2490,2374,894,2738,4016,4939,1268,1387,478,1555,3123,654,431,3225,4230,1381,3203,2388,4803,2637,54,1260,854,3709,3575,3387,740,1097,320,381,2998,3490,1168,4798,5500,3178,2464,3691,3972,5060,3734,3154,578,3546,2352,3641,4295,2659,5019,3597,4105,4223,122,4562,2459,2282,338,4222,708,2668,4915,904,3094,2682,636,148,1681,205,900,457,2370,696,1629,5482,830,3250,4310,2581,5069,3224,2069,4370,4453,697,2207,1359,3921,4893,1861,3143,1871,193,3190,959,3568,5219,1683,473,1694,1448,244,1534,821,2563,4494,4978,1934,2256,1105,1199,1325,2428,4667,4570,3123,4419,4222,5138,2,2526,1525,548,1104,357,5241,5483,4909,1364,4798,1302,1767,3220,2377,3631,3845,4215,3067,5188,5424,3927,5401,5108,4233,3609,3023,1369,1484,3384,3631,418,3190,1761,3058,4171,1582,2337,1637,4640,1486,2471,2063,2634,3711,1660,678,717,1489,4475,4441,5073,5251,5028,1453,175,5031,1997,2721,1230,331,1398,3973,1161,2159,3237,390,263,4098,4395,3990,4435,4885,2948,795,830,1002,3833,818,3656,380,1063,3403,1120,4123,4056,3258,1578,254,3585,2862,3260,5477,1515,1986,1852,2835,1574,58,5519,5022,4239,3673,4333,5490,1267,2098,3247,3739,3586,5134,1851,2913,3610,937,3849,4710,3820,4834,2515,4555,2913,436,3804,2303,1691,2370,4568,3205,3489,3865,2882,4870,1708,1056,1048,5409,4793,803,4286,1324,2077,2448,3151,4292,4112,3726,503,189,2411,4036,3635,612,704,801,2389,4295,4782,5056,5231,967,1774,77,1116,2138,3122,1106,4285,3362,5106,4390,4027,2658,4102,3893,833,2619,4133,5492,1499,4403,3488,4782,1804,5367,1360,299,887,3226,503,2304,2856,1710,2118,486,2410,1314,718,1188,1594,4627,4088,848,1178,1659,143,394,3893,2434,1282,3798,1970,3158,2047,728,531,3430,1771,799,976,3255,4792,692,1608,4872,3209,1706,3448,4680,5386,3879,124,2059,3932,4776,2284,2043,1879,3156,2189,2435,1765,3544,663,2021,1295,4300,5385,3928,5504,3768,2483,5362,293,1894,1812,5277,3498,494,4198,4511,4695,2600,4,2070,1170,4325,2755,5048,4795,3705,956,2214,4550,3314,3039,2685,3941,4948,4627,1716,518,4457,3080,620,4443,3269,3452,3320,4885,2347,1566,417,4512,5361,4083,95,1935,5267,4456,4999,5298,5299,2886,2993,162,19,471,4704,1173,5384,1956,608,2324,3362,4196,939,229,3372,4277,2229,3281,1402,186,2800,3672,3650,847,1546,4827,1101,243,1012,37,1324,5355,2930,2130,4740,477,622,1460,3302,2511,5424,1481,3089,3521,4571,1768,3662,3724,5117,4568,1669,3832,3264,5207,3434,3089,5491,3712,2512,2309,2048,5373,3089,2740,4052,3133,2201,648,2211,499,176,2828,2877,2473,4425,2559,81,1974,2790,3654,810,3772,1484,1998,4419,561,1028,2053,1544,5411,4149,3120,2679,222,4093,468,3217,4222,326,619,955,961,2887,5288,719,2287,1552,3103,4283,2853,190,1603,2174,1410,3298,2949,1742,2419,3329,4264,4135,3733,5066,437,2273,4458,4941,3729,1693,4921,4488,1781,5144,1356,2429,2061,4455,2663,3662,3754,2701,5272,5120,2224,96,4707,3579,4846,2623,5134,3358,4633,1256,1290,489,5044,4985,3733,1336,4112,2365,3676,3940,1652,1965,1038,2559,2021,148,2569,5097,4874,874,3577,4685,1513,3894,4820,4065,1275,3857,4791,4061,497,2098,4797,2197,2881,1106,489,993,2447,3985,3659,5149,4634,958,4863,3187,2040,3089,1527,5375,3374,4055,1199,1808,2231,713,2729,3988,2269,173,2002,1459,2913,3331,3456,7,382,1856,3601,2637,1175,1255,4124,2440,2282,1996,1526,1197,1170,746,1070,3431,2604,835,1210,3182,1601,3404,2450,4421,5146,270,1070,3649,951,2157,1318,2526,3381,1634,394,4925,1481,5284,2908,4042,3454,1023,4716,1748,5313,1580,878,636,2040,5083,2529,1432,191,3235,1657,1711,1846,883,5028,3070,3580,5196,887,2677,511,1450,3620,2163,255,4076,971,4611,5319,4756,4145,2467,4192,3980,96,1564,3869,5385,1103,3821,927,5142,2973,1402,102,2936,2715,3543,4473,4421,2301,5366,231,5440,4550,5106,106,3617,729,5060,4871,3949,473,2691,5299,3464,1888,2456,1462,906,3571,2022,4072,4484,242,1769,1072,4513,3813,3089,252,1680,2555,2054,4450,40,5002,3968,2098,1224,2694,3618,5279,846,1657,3910,3736,1765,3989,3994,1686,3574,4901,4578,86,3956,741,944,637,4020,4555,1919,4657,4290,3675,3290,921,2320,2573,1622,4442,993,2354,2836,4378,1347,1342,3285,742,520,3194,3321,1825,1066,227,785,1160,4155,4570,5344,3939,1233,2862,708,4009,5282,4523,4828,3972,2426,3298,4423,3547,2453,535,1316,4099,2231,5353,5455,3939,4358,2763,5116,4594,5264,2438,4482,2547,3539,780,3327,3503,3824,954,969,3453,3667,759,2057,4377,5115,2746,4881,1204,1055,1296,3895,3489,868,3265,3787,3960,1914,120,4691,3221,938,2325,1002,4268,5171,1285,3516,2288,2755,5048,1549,3121,5461,1405,3769,2399,870,389,524,3093,5096,1767,4629,3285,3093,1253,4661,972,3973,177,908,1102,4004,4249,405,145,4707,3363,3613,4094,724,2262,1967,3512,5447,5220,184,701,1886,4639,2506,568,718,708,613,2088,3720,5461,5142,3984,741,4583,3638,185,3789,4357,2283,1423,1889,3984,3266,1034,286,2669,668,4773,3620,271,5481,2233,3021,2532,4243,3425,1058,1408,1591,3526,3591,5428,2908,4634,1864,3575,5367,2941,1303,4366,2359,3995,2964,597,5372,1635,3044,3721,1758,3562,21,4383,115,3977,8,3227,3717,5328,1524,5268,755,3153,1566,487,4254,3424,3249,1968,965,1834,3094,1702,345,4738,3401,482,798,1681,3850,3229,5282,1284,2623,418,4168,2914,1493,268,1892,1389,4912,1649,5516,835,4550,239,4525,5232,1517,1689,3590,1182,1044,1946,1627,3798,5261,3316,5429,5179,1435,4655,1663,1224,4504,3055,620,5297,664,527,2189,3346,4766,4810,1861,1429,3371,4174,5057,1288,5157,2624,4569,411,2086,4242,123,45,2137,3064,66,784,256,4138,2238,3535,2332,3056,2462,4657,5368,1861,3311,2362,4930,3992,3931,3162,1418,4877,3284,3207,2533,2457,2968,1664,4637,3984,452,1329,5111,5273,4716,4424,3085,706,2244,258,613,236,3479,3290,215,2557,3010,194,3473,3992,5377,33,1734,5444,2519,4298,2391,1773,3294,2631,4719,5397,4838,3452,3336,1403,1131,4518,3248,3065,3109,4199,4710,4577,1589,383,3584,5024,5054,405,1560,1186,1137,2898,659,369,5230,3943,226,2498,4526,3837,4746,2,2376,2431,1051,1781,4510,2005,4422,5519,2780,18,1610,1933,4853,5239,1637,4705,2583,615,4119,4580,4848,5444,2775,2652,4591,444,3030,1757,1654,2579,4900,5361,2742,3625,745,4156,4227,2470,4666,2217,1817,5436,2565,1474,1764,1338,162,654,268,1042,179,5230,1050,4158,1247,3934,816,5171,5058,1354,3949,1827,3101,4934,3423,280,3063,2054,2881,4695,2499,1573,1677,5417,1528,1328,2498,271,4618,2280,4268,1856,4037,445,1201,246,3227,4141,3736,5491,820,5187,1860,4751,4303,914,1969,309,3464,4643,3131,469,3833,3300,2847,290,1619,2877,3058,1499,2764,4348,4283,605,1949,2730,1871,4983,1320,3486,1262,524,417,3501,170,5115,5409,726,5056,3374,3025,1553,441,3505,4015,1743,4489,4314,1444,838,79,3062,5386,4937,1140,3837,1048,4378,981,4294,306,267,4474,4543,4070,1906,3858,3267,5287,2868,3165,5290,3270,4365,1583,4939,3895,1845,1218,4099,2570,4668,2124,2105,4043,1454,4878,2915,3842,936,895,470,960,674,549,1606,4704,2961,1813,2908,3029,3189,1550,3117,462,4249,1951,5094,3340,884,5422,1209,2553,5397,4665,1503,1253,5406,4131,2266,1637,4089,4070,4234,3654,949,1777,4964,4590,1060,3158,2945,204,2196,1699,2185,630,1484,5457,4853,1882,4411,1048,2925,5139,2908,601,5201,4827,5221,4020,3358,3779,4072,148,5188,3158,3693,3558,68,5150,705,3342,1771,4243,2111,4209,4580,1905,1778,1550,4080,4285,753,1751,1223,3519,2444,1936,733,574,3497,2952,2632,794,1301,255,2712,2609,3214,5006,1069,1615,4928,3542,48,48,1549,1972,3574,2475,3182,2698,3818,4297,1278,5031,739,2242,3036,2398,2201,973,1522,1810,3431,1070,4817,857,5476,1511,3681,5213,240,4489,1438,1722,3215,1852,1039,3277,909,1199,4383,4211,3080,2104,5196,1907,721,767,1205,2917,3900,184,2340,4975,5383,1636,4773,1067,2617,5146,4375,1513,5341,2959,3777,2383,2570,2901,3119,4288,5432,3220,3524,2338,2404,1456,3126,5013,1419,2833,5228,4851,196,5329,464,4010,1947,3948,3674,5294,4640,1606,4951,818,4368,1270,5213,262,2715,823,3743,1211,4271,446,1395,4903,4184,1854,2768,570,3369,1781,2923,2650,2350,2975,3790,5009,5117,1530,4178,4087,1669,4833,2937,2808,3455,832,152,382,363,2614,3789,1790,5080,1287,1923,1408,4354,3093,3454,1929,4446,69,2881,978,5054,3256,2073,3849,175,2380,4793,1951,56,796,2503,4810,1312,2174,1721,2065,2955,5121,507,4879,4502,1308,1530,3312,2144,4894,748,580,5025,4917,3303,788,412,4162,3230,2110,1008,736,5278,4901,37,1975,2688,2562,595,3235,2144,4713,5437,137,2704,519,4752,4410,3169,2396,3997,4154,4571,4163,780,1746,4516,2310,2599,1759,1069,1035,1458,2405,4035,2548,302,5074,5469,24,450,952,3552,1847,4169,977,3465,1322,5266,522,1808,3529,574,657,90,2662,21,276,4575,4300,397,2275,1814,2590,1581,3939,2076,500,3362,1588,4182,1382,2132,3664,1841,2439,2687,4499,4379,2326,260,241,171,751,2285,4187,5368,3134,3441,4715,3903,911,5072,3753,745,4833,2759,4998,3211,2027,3933,2328,5100,396,1273,2962,1800,3564,1165,3392,2437,3497,481,3061,3997,3777,2440,3476,1425,1819,5028,4089,4957,4697,3983,3597,1033,3184,1932,4876,2809,4777,4215,2795,5031,3965,2269,3916,3992,5460,2623,4986,1633,1247,1919,17,3252,2220,3593,4771,3380,3475,3629,3562,206,1453,2499,3582,2589,3271,4810,4254,3569,756,206,3431,4174,398,2197,2613,3104,3812,302,228,1483,2241,4597,4097,4651,213,2643,3599,1807,2042,497,2251,4290,482,2064,1644,977,2375,1722,2308,2109,2717,3346,3130,4840,2390,2698,1359,3175,1088,2838,2335,4839,4422,18,583,5495,2731,630,3954,1739,476,5311,1212,1152,2611,3906,162,3837,1110,431,4311,4891,4918,5433,3881,3668,2431,4153,3280,550,1853,5395,800,5411,3104,1762,1505,1649,1405,2714,1867,2424,4083,1266,4731,899,1538,5379,4769,798,250,2366,1978,5384,621,398,3330,4932,585,4542,1766,4239,4003,2293,847,2617,204,4234,4938,336,1388,2680,5016,3200,3097,2348,1243,1116,2976,5091,1022,4870,300,3093,418,1407,1001,2001,4270,5522,3181,3992,4586,4064,5134,1816,629,1946,5098,5031,67,5342,530,2085,2629,3268,4224,830,3425,4997,1668,4107,1300,4413,1493,1505,1627,4275,1065,2808,1539,2424,2479,920,1021,2448,4832,3014,2196,2496,4174,3771,875,4134,758,1159,2178,1381,2247,2470,240,2545,4162,4592,3710,561,2796,5291,2404,518,1614,3950,3390,4217,130,5367,266,3711,2824,3537,2480,2917,4723,951,4804,386,4270,166,34,2393,4499,4164,3271,770,4082,4829,1742,2131,4622,180,4653,5195,1194,5519,4188,4466,299,2270,2328,1943,3577,1427,996,1453,4157,4102,230,1031,5152,4399,928,3868,5068,4971,744,4591,957,1176,2376,32,2522,1130,4135,4851,3182,4586,3284,2715,3588,2300,4518,696,2600,1301,3783,2512,1124,4789,5047,5030,4432,22,1335,29,1807,2702,2590,683,2764,2535,1364,3822,3862,695,4201,3537,4628,372,5210,4778,3707,4411,783,1606,1883,3115,2508,937,276,5214,2140,819,5281,3353,4282,3605,1459,2912,3288,2866,4090,3020,3345,175,5021,747,5402,5230,187,1762,2305,5243,1630,3149,5190,944,2657,1165,3624,2131,993,628,4388,5223,1057,4340,4343,5254,2389,3886,3108,5290,2718,5185,55,1896,2321,2287,3292,115,4244,2612,2850,4716,4060,4353,1846,3192,5161,5285,4310,381,4761,3212,5431,851,1936,182,2662,4208,450,536,3781,5418,746,1868,692,2342,135,841,675,278,2046,2386,634,4880,2584,222,1538,3927,5098,1798,4163,2583,2941,4910,2628,1954,566,4854,2637,5406,4809,2580,203,4519,3025,1834,2653,1011,4611,835,4265,3944,2400,2568,5257,441,5066,879,2581,35,4841,163,4345,4526,3487,422,1881,5114,3064,2635,1896,4043,5138,635,420,5326,983,2990,3350,65,473,2408,2805,1333,2659,3077,1214,3068,1609,2546,1440,4060,3696,2002,3263,4469,195,2445,4723,3607,1197,1149,135,1119,4298,3982,1129,137,1420,791,3412,2198,3698,5416,5098,5334,4117,2386,3245,2084,4607,336,2556,229,5505,60,2465,1302,1047,1114,4272,5298,107,2283,1915,3266,4950,1256,2770,2118,895,438,3368,3068,667,4257,4747,5488,4174,1711,417,3519,1537,2256,2290,4795,653,89,544,4397,3681,1399,357,2383,4063,46,810,2237,2584,868,3572,2886,3948,370,4431,4177,3696,2955,206,1123,2448,776,669,759,1711,946,3135,3979,1247,3360,2233,161,1315,2113,4330,3092,3576,206,4620,1708,535,1386,4859,4804,3869,2986,4306,1035,813,1676,572,4770,5468,1199,750,3673,680,405,4198,3015,1381,971,1908,4636,1475,2304,5255,4159,2678,383,40,4483,2630,1431,4780,2289,2382,3916,5090,2153,831,5310,5444,5394,976,3544,4012,2639,3165,2139,1023,2533,66,2979,920,3074,330,2578,1767,4793,2457,2573,797,3467,2071,5259,943,843,1143,1176,4315,184,3329,3053,1161,2872,1464,2124,2349,3800,5307,273,4443,4396,506,4002,5475,5090,4209,5296,3955,997,4451,329,930,4515,4496,5329,4696,323,2192,4958,2172,3504,1843,1681,660,4141,2924,243,3373,3112,1036,983,2396,483,520,70,5417,253,4236,4271,635,5502,5284,2492,3175,3763,2847,287,3741,3030,2142,2607,1134,1865,1384,5210,1308,4016,2989,4183,4630,2186,4039,830,5216,3835,1123,1627,4654,36,4091,2759,1952,891,5078,95,913,4102,2071,2070,125,1401,1046,2881,3789,1551,4712,5192,786,5187,5523,1707,1157,1612,4061,960,4716,1743,4788,4040,4083,3930,3162,4891,2480,1413,3783,4237,2856,4773,632,5196,2526,2150,1449,2180,2134,1575,5313,4667,4366,3203,4226,5325,2498,5061,786,1271,3054,3286,1250,2044,176,4697,2284,5266,1766,203,3662,4184,3109,3474,439,3772,3083,2948,2788,4573,1070,4561,501,5011,1514,4570,5488,648,2874,2736,2094,5251,3694,390,748,1966,2686,429,4174,3010,610,424,744,5016,1240,1649,202,368,2063,2011,1204,4314,1101,5393,4446,2970,2427,170,3482,5512,30,3992,2474,4839,4916,607,1165,5460,1161,1822,4681,2503,4218,1499,2543,2038,2183,5071,158,5219,1906,1129,293,168,1965,3170,2478,2057,1673,140,3706,3529,5469,3637,4517,290,5068,1169,3007,3789,121,158,4830,1274,3336,5456,1264,869,4099,2378,3001,619,109,3620,2053,3300,1428,2292,1875,2767,1121,1319,3279,4124,4202,3179,4209,579,2501,197,1755,4729,5355,2061,1942,5453,3937,1284,2033,3774,2845,2576,358,364,3610,4768,2710,2600,2827,1113,3901,442,4213,4825,575,3323,1126,2485,2524,257,4236,3800,3715,1755,3474,5256,1985,429,577,2201,5168,2483,2631,3992,1377,4769,2728,4599,114,2337,2718,586,5030,4484,4981,4339,1239,3452,3867,1097,3463,4273,779,3467,3084,401,1000,3463,3238,3021,4859,3663,78,2100,2677,880,292,1176,2091,3941,5132,2021,3492,1111,2239,4627,2320,4831,2083,3439,475,1872,1599,689,3021,747,588,731,4014,2405,1802,2118,13,2858,4273,5332,1444,3557,4349,5499,979,1360,1458,2003,540,3376,613,114,5381,4815,4887,4881,2061,3416,2802,3454,674,2678,2007,2416,2875,3501,2744,2777,2872,5338,3171,453,340,4974,5508,2858,3898,4308,4377,2791,279,4033,4960,5305,2124,2408,2434,4000,4794,4949,4116,3814,2155,487,1285,1046,1209,4886,4833,3770,1080,2362,550,5225,2546,2444,5468,475,3987,1145,3626,3321,766,3272,4479,1161,4323,1033,4975,5030,4086,2398,4661,3485,4755,3182,1066,792,722,3111,808,1276,1381,3498,4374,365,5023,3085,3314,2051,1770,1601,1781,3881,2639,3694,3650,1943,981,139,4605,129,2210,6,3262,2258,383,441,1998,4864,4743,4777,818,920,2281,511,409,120,3531,41,1256,4295,952,860,1302,136,4497,1990,3450,1883,4227,4834,3006,4764,5377,3981,5230,5074,1738,2335,1278,1609,5047,5468,1171,2567,78,3139,1861,3833,2992,4586,4385,2812,1643,857,4538,3630,4140,5044,2621,729,4936,1039,3490,778,2169,4871,4586,2377,1987,3588,5256,2960,1261,4662,4733,4923,863,3412,1537,1558,1215,1353,3139,2469,645,3586,3485,3834,2136,3096,4377,4786,4814,29,1837,2322,3945,5517,3524,2041,3767,2791,5493,5375,231,3727,5408,80,3597,746,3117,4202,5122,3104,205,2177,3153,3170,3779,5415,2759,390,5276,4831,1815,2695,2873,3692,88,2961,734,1703,2394,3032,770,1483,537,5315,1716,2120,3781,5191,1432,3628,2486,1396,3714,1515,5181,2431,3042,4287,1707,3224,1863,1285,79,757,3600,4066,6,2287,3447,3602,2515,3779,388,3577,2542,3036,922,3160,185,4294,1231,4579,3995,1664,58,2661,3217,3964,754,1584,689,984,5372,4159,2698,363,3820,1045,2707,3209,3516,1068,295,417,2493,345,4004,5181,653,2470,678,768,3311,5015,1065,1755,4857,4021,4192,1034,2723,2275,4363,369,4759,5335,666,3822,3693,4159,3061,4426,3380,3619,1548,2293,5084,3963,1848,2689,4484,1613,1356,549,887,2000,584,290,5482,4930,4038,2863,4885,4001,1800,1710,5350,870,1785,3096,2862,4585,5503,3879,5463,2057,5121,3249,2347,5314,4220,4738,2273,5021,3049,1889,2250,3791,5417,2457,992,4653,1953,1033,523,4085,3737,1842,1524,3973,460,885,563,5426,1841,618,1864,2412,4779,685,146,3948,3804,126,5359,4062,2155,2458,4951,2460,4014,504,5458,534,534,5371,3212,3389,2978,2368,2445,1849,3134,1973,2745,4592,3270,3289,4804,4772,2458,2470,821,2960,4362,603,4929,4486,2526,2272,5210,332,1246,5362,3594,141,3950,2974,2073,974,5259,5207,1895,3644,2006,3361,5032,314,3694,3554,3689,4342,2030,2586,1763,826,3748,2547,1050,2940,2707,2174,3952,1954,3664,596,3601,1993,2987,3385,4999,1911,965,2707,2276,1682,3307,869,3744,5235,2568,858,4032,1623,3481,1256,195,1715,1126,3132,4216,4394,4847,2389,4620,1865,1924,1289,5110,4270,3182,2253,1494,1553,2557,1876,793,1726,2323,4975,4381,369,2077,1155,1657,2449,1781,601,2771,3796,2278,3879,5176,2993,1816,542,151,4361,1687,3677,2954,3035,106,4800,2977,2776,2700,1409,2713,265,259,896,3406,2282,4731,1011,2017,2531,1957,4693,218,458,452,4603,4485,4156,4799,175,5337,4077,1165,2739,799,5422,2825,2136,1710,1993,4143,4106,2479,3378,4121,983,4662,2749,3361,2825,1405,4677,5157,852,3425,830,4080,2986,2396,2399,3984,470,4247,3914,762,745,4020,2298,827,1399,2224,4695,4573,5129,5210,2692,3949,1015,4759,1560,1321,4256,1364,3703,696,1933,3379,1635,4366,4784,233,1636,2435,843,312,5207,3442,3865,79,3634,5112,1860,4923,4721,624,4910,239,5071,235,1319,4027,923,1027,3279,3333,2707,1053,581,4215,149,2904,5013,1502,5223,555,4156,3244,3753,2172,1460,542,3324,996,4243,4081,3824,4234,2321,2638,3876,4120,1685,5136,706,218,3152,3207,676,1132,5169,5432,2789,2222,4988,3630,928,3951,459,231,5053,554,331,896,3171,1049,450,173,3271,259,3472,5414,3523,3246,4275,2448,3057,350,4709,4396,2134,3829,4348,2162,569,5160,5121,868,1650,2833,3569,313,3627,1891,86,1144,977,3139,221,1101,4312,472,1155,4910,1823,2143,1578,338,218,4951,4649,4717,3786,4202,1775,869,4829,5372,3336,5221,375,1773,1267,5149,3601,2020,1664,3195,1340,4858,3952,3515,1120,5037,4103,3640,5120,4783,2919,4656,3397,4366,1216,5515,2511,5472,5488,818,3221,139,4292,77,3154,3630,4535,4826,2592,3681,1230,5438,554,3905,4743,1375,4747,1025,2195,1091,2317,371,3667,3549,771,4166,1272,2912,1417,5512,3745,5060,2568,346,155,3016,2439,4758,1934,153,1311,796,1909,2546,1907,5202,3902,4857,2691,4722,3535,275,2934,756,3987,2326,203,1615,1063,1030,736,2066,33,2635,2343,2948,5314,1322,2678,4407,2280,5297,4028,2617,1212,1890,5374,1908,1128,3731,2250,4035,4926,5049,3332,3895,4808,5441,5465,357,2496,1080,4932,4207,2347,493,4684,498,2249,2956,2686,3684,654,2032,3372,3182,5065,1950,3855,2973,2240,5091,2085,3968,5115,1672,3272,5466,3273,1229,1315,255,4665,2232,5070,5425,553,1934,4883,686,2445,1079,1373,304,986,3505,3299,1792,2957,1422,5341,203,1808,1574,5255,329,5148,1768,2883,2617,2811,1966,4862,5009,297,368,5225,1028,1056,321,919,1925,4973,1499,4604,640,5257,5293,326,1119,3237,428,2461,3577,5376,4068,5013,3223,766,4703,5419,5181,1114,3048,2567,3687,239,3507,5293,1078,5155,298,1641,4214,3010,1030,1107,2193,2165,3769,3825,2569,3917,5316,1441,227,2561,558,4612,4626,3476,5272,366,3534,614,740,3311,3389,3918,2548,367,4272,2639,1798,3456,5116,446,4033,2620,3570,2960,3601,3295,573,1148,5030,1524,187,4482,2976,2002,5014,568,591,3295,1688,1234,2253,3741,3501,3766,5289,4867,637,4687,5316,4414,4501,693,1551,2355,1515,3375,2525,5199,3658,1258,287,4477,1473,2828,2079,3132,1984,1164,2465,1616,3629,158,818,1510,809,1092,4412,2046,2850,4768,2483,4297,3145,2076,1730,4381,5091,2642,353,958,857,619,2128,4368,3770,5075,4914,1858,66,4319,2880,1257,2862,2168,3919,4748,289,5446,1427,4407,974,1414,5402,46,93,1710,3310,2801,2753,1078,5389,759,4735,395,2689,4045,2422,418,2565,4428,3625,1788,258,2140,4956,4138,3716,1566,3881,208,814,2454,306,413,3693,1357,4088,3204,5016,532,2074,4339,939,2014,2652,3136,1422,4116,4232,1420,2862,5481,4971,3116,4458,3514,1987,3101,4212,3252,5456,3767,4968,674,4675,495,5325,905,1659,3298,3190,4890,1757,2984,1790,1918,5227,1585,1917,3023,1225,319,4069,3258,2625,3060,4582,4520,3533,4302,4187,4788,604,5219,1597,3451,4261,4931,4639,2261,228,1540,1748,169,4910,3956,813,1023,4597,1006,544,3702,4004,585,4139,268,1239,2708,825,3352,395,1421,158,2611,3461,3786,5030,4167,246,1134,2088,5460,3013,2681,339,4795,3126,2292,1527,1023,4004,3008,1328,2780,2981,1114,2648,3940,3382,762,4629,1080,4477,555,689,2160,2775,1493,5081,378,3318,2972,2467,612,4299,603,3314,1374,3523,490,1070,770,5486,293,3457,1634,4788,339,1742,5255,3477,1204,3905,4620,2505,5085,1040,2609,885,0,4172,3991,2293,4196,1503,4209,1812,4045,102,2701,5398,2201,2172,3371,964,3354,5224,3725,1694,1304,630,1038,4582,4939,154,4771,3315,3455,5394,3711,1419,2245,5220,4915,3854,5335,4819,189,728,124,2782,574,2436,5335,3155,1851,4489,1054,401,533,3187,463,4481,5038,1488,3073,3938,5092,418,1488,3716,865,1149,4709,4948,622,860,4708,3448,4281,4174,5436,3960,5424,3194,2438,160,3511,2728,3971,3089,1261,2610,2449,3787,4212,2665,446,3757,3650,3147,4902,1525,1629,1221,3001,1710,5426,3382,1485,1393,2227,3483,1420,3118,4427,5248,3900,5314,368,5022,4808,3911,1505,4051,955,3662,612,1687,1265,1621,4773,3420,3565,654,3891,3550,4748,120,3669,4547,3130,1951,4098,3600,5429,83,1895,673,2659,2338,4423,2419,3272,3132,4260,4680,5468,3054,5287,1375,564,5061,1285,1874,3934,4702,3512,1108,3986,3941,2017,5280,4966,969,2396,2568,1797,3758,5290,1318,1324,3987,229,4452,2501,1725,3068,3342,5491,4348,3488,2055,2343,3741,3334,568,4453,371,155,585,2446,2771,1009,728,2373,655,846,3722,2735,3279,283,3003,472,153,5468,2986,38,4960,4673,3040,1784,2222,1780,2220,500,2470,711,5054,2262,5028,4250,773,509,4308,1748,4690,1231,2144,1240,628,4802,2018,4693,2446,2110,5465,1536,812,4736,310,371,405,2805,2907,4070,1294,2859,2419,5023,1722,3707,2559,5176,3751,2915,194,1525,4561,622,5087,1177,378,1652,2516,1367,3784,4603,4863,1659,1604,3970,1338,3590,4679,4361,1291,284,3433,2089,388,2257,4936,5059,4589,1507,3648,2512,5270,2910,4799,1243,4564,5415,4060,5291,3891,1407,2448,203,3861,2413,2355,3967,866,1919,4200,312,866,246,265,5335,4250,377,4463,1483,3158,2459,1764,5117,330,1742,2445,2570,3277,3449,2901,2305,1841,3331,1654,3433,1899,5121,3454,1003,517,3548,4237,2166,3711,2690,1490,2808,4667,3997,3343,2160,521,3154,2668,2469,2978,4562,4872,3384,2519,2992,3501,469,4308,5370,1877,3628,5224,3097,3048,3947,584,2545,4867,2358,437,3760,5425,4527,3594,3617,2540,4540,802,1634,5211,662,1492,2661,410,4651,3374,1014,5404,1309,2483,4066,2679,4531,5130,1678,5466,2623,3006,5150,4833,3527,822,4711,3491,5254,3919,2183,5263,2887,4917,1121,3879,1222,2120,685,4919,3974,3902,5468,1408,1317,2210,696,2347,474,2878,2609,242,3125,405,2534,1242,1539,2471,1250,1181,4335,3959,4261,2633,3171,2070,4337,3216,3828,1091,3910,3318,72,3301,1243,2456,343,3080,4797,4625,706,5425,4875,489,832,3914,421,3117,3845,1745,5508,1891,2906,5444,1488,316,3373,2824,4087,4069,3953,3046,661,3474,963,1978,1515,232,5384,3541,2779,4141,3192,2068,2521,1951,4192,4596,1855,4055,2672,1616,4955,5216,4124,661,4980,756,5302,5129,4085,5109,521,2139,2051,909,1256,2802,3337,3053,38,1777,3209,2142,1985,5303,2065,1844,5414,2783,5339,2780,1448,216,3884,5430,1437,4935,4592,1616,3125,3656,2581,1610,1924,3157,2198,325,1238,4513,249,3131,158,4322,3824,2160,2348,1765,2764,1616,4834,1087,1845,2532,2166,621,3271,736,1837,4102,835,738,2862,622,4333,5342,889,1165,1806,4335,1948,4544,2717,80,353,2998,2808,364,5149,2070,930,2230,1701,1221,4709,660,4982,2627,5429,3752,1314,5187,3735,344,3808,1304,4316,660,3686,1219,3088,1805,5298,3151,4639,4014,173,3025,5006,703,1328,1791,2227,2919,4276,1289,3302,936,1024,5223,4643,847,1703,716,1940,4115,5048,4524,2821,5047,1230,1529,2597,2744,751,1313,2662,4831,1328,311,1138,1803,2576,365,5209,3992,214,2838,2499,4000,1839,3930,1177,4504,5075,5249,739,1490,621,1618,3769,2419,561,256,3793,3691,757,2506,4591,5417,4729,4281,4024,1275,5359,49,2133,3595,5483,522,1716,2149,2529,4465,1199,3310,4777,82,5168,2885,3161,5203,2268,4450,3042,1717,278,2176,2744,1353,1810,5314,1862,2121,5117,3899,2040,4223,4977,2575,3544,1569,4897,2149,2319,898,5401,2492,3983,5105,4487,3372,5156,2264,2808,436,3822,5495,5374,5427,4610,2991,2937,4655,343,1653,5061,3252,5143,4733,2053,3648,1606,4400,4801,874,908,2120,4594,3690,2067,1006,45,1796,40,1985,1151,430,1145,1710,5305,4457,830,2208,5212,4656,2753,1237,3840,113,3376,3909,1341,5518,3794,5220,1527,632,3227,267,590,4174,4271,5374,455,3528,861,1506,2342,3949,1879,4285,787,2808,617,4581,1660,4083,2846,3738,4385,5285,2162,2138,5435,1525,2848,1014,2441,2338,4446,4237,838,5385,4911,845,741,3982,4809,2426,3758,1379,3823,534,1353,2417,3042,2608,1438,727,5457,1991,2678,1471,1919,2012,929,322,4877,3594,4637,2272,609,2949,1845,2753,1785,1431,4892,4104,2607,525,4433,3839,5058,1526,3168,824,4879,1792,3327,2328,2422,3497,1709,571,977,345,1084,5287,1923,254,4844,2022,3561,4814,899,4814,4761,554,2838,3327,4900,3322,4642,2542,3221,1238,602,3494,2158,4739,3744,5090,479,1646,3967,343,3678,4763,3542,5391,206,4155,2950,3254,4578,2810,3699,5154,3310,1828,5286,1589,3475,5154,2259,494,4059,1365,2153,5216,3551,30,4163,569,4543,4592,3824,5042,4067,3902,1722,3809,348,4771,3971,5355,2420,2969,924,1769,3103,1341,1047,4807,3002,2466,2152,1793,3206,3409,1610,799,855,3645,66,1688,4031,5490,10,5100,1650,189,2660,3722,4455,3439,724,4034,5280,3768,2109,3966,4972,3809,1461,3646,2102,3315,5219,1998,1632,4370,4622,3037,2514,3657,3753,147,4578,5455,4177,3425,2156,3475,1089,3289,3142,790,2664,48,3233,5116,3332,4354,1403,3721,4875,1340,4705,1624,3837,1376,2922,3039,2957,3258,1543,65,5481,521,4651,1376,4182,2464,2703,403,2896,1819,5402,1291,1015,3901,2528,3109,4058,4473,2248,4723,2414,5098,466,284,3411,2590,1191,2132,5195,5511,1739,3297,1500,3585,1642,5323,3578,2569,4384,4985,1580,5403,430,4444,3121,2958,4109,3816,4877,2215,5018,2151,4304,4699,420,2558,221,389,4329,2091,3323,2958,407,574,1102,4420,5468,3888,1292,3550,983,3798,4622,4243,2068,953,4883,2188,323,4958,3162,385,3215,2959,2977,1957,4177,2558,4678,4443,1737,5069,5511,1559,5264,399,3636,1585,4706,84,3363,4622,4569,2218,140,1354,55,4379,4923,4015,2267,356,2405,5103,4951,1919,1974,3117,1215,222,5262,3108,207,5297,2952,386,3686,2928,3280,5347,4306,4846,4369,71,1005,5040,4716,3672,4434,1472,4471,666,2694,4223,2843,4343,2,3183,3323,2723,1265,3742,834,1871,5308,4669,171,4535,4584,2906,4818,3735,3488,4830,5056,1563,2594,644,3017,824,2200,4325,1785,4201,832,4215,4722,4599,4350,1893,4191,3243,1482,2484,4986,1742,798,1925,2067,1957,3387,3538,3951,1798,3503,3706,4504,2851,5086,2633,3619,5159,3454,722,1492,2858,1647,4591,4124,263,1368,2874,1514,1510,133,3343,4974,1107,319,3839,4386,4489,3668,2253,1879,1229,1807,2435,3343,385,3109,3470,5209,4625,2846,2274,2231,4889,3494,3981,2446,110,1741,2864,1035,935,1329,3205,5217,3250,4618,4532,3421,2906,3592,3135,2582,413,4808,4082,4945,2026,1661,5151,1280,4017,4589,4789,1044,5007,1836,3609,5272,1415,4927,4471,1301,548,3221,855,1423,1932,4945,1831,2312,4401,5167,1896,1642,453,5115,4952,2196,812,4927,3759,5145,4291,1839,5303,2112,227,1281,1853,4190,1829,757,2696,1320,5067,2340,3961,4868,1591,4666,4330,185,3584,3528,3909,2294,4963,1402,2977,3496,1738,4102,1364,972,4317,5347,41,3159,3201,1051,3477,1110,3731,3733,2136,89,667,3541,14,743,3956,5462,3772,2440,4318,3676,1113,1390,397,1390,4472,4390,2107,2350,3174,2226,1394,2515,46,2339,1028,954,108,4648,4287,3031,1745,5473,4115,2258,2046,1486,5388,2102,1791,3800,1052,1398,1636,3985,4346,271,2072,5344,1741,3017,4092,3893,4287,1499,4184,3203,4392,3639,4132,2407,4468,4574,1504,2038,5525,2669,2662,2736,1758,4184,1941,1924,3359,1899,4840,2819,3252,1990,3829,5425,1738,2495,3262,902,3748,1293,4029,1720,2925,286,3023,1640,5503,2446,3908,1342,4640,325,3501,4822,5057,4554,5295,992,4703,3888,4013,2928,3468,995,1272,1963,4553,2541,4192,5264,3525,1888,2748,514,2103,2830,2002,5453,155,4530,4962,2073,2256,4901,5367,1221,2705,4807,1094,3094,5438,5396,458,4371,3211,4622,1854,4319,348,5402,1128,605,367,4193,2889,2033,2527,3533,4677,2768,1826,3355,2100,1338,2142,3751,4180,2957,3588,2264,5226,4917,2763,5061,3085,1353,2977,3653,4889,5142,956,1476,588,4599,3753,2562,3941,4957,5183,2286,999,4144,199,102,2411,550,4265,1683,3924,1204,3758,1446,1815,3389,1778,3319,2701,3166,1618,4554,1325,96,880,1710,1015,503,747,2129,262,3153,116,2375,3818,2376,2752,4529,3805,4097,401,3144,4703,2900,1129,2152,1212,3805,5223,1121,3510,2639,5045,3339,4414,2707,5165,899,921,1286,209,3098,3728,4220,1973,5067,977,5505,1541,1620,3282,2979,1850,1637,3634,3727,196,4968,310,2575,3090,3771,5246,3093,2840,5367,5150,5398,973,879,4335,2980,3587,4223,888,5171,4823,121,5194,989,1512,2662,2095,3684,842,4842,1178,2540,1071,450,4430,1269,3851,1080,155,5220,4388,4701,3721,588,3977,4128,3310,1979,4375,5497,5227,126,2661,2894,4246,3027,1684,2235,3493,4367,4705,430,629,504,1655,326,3512,4537,4001,482,1388,1623,3573,1896,1266,4427,100,5334,4091,5003,5237,2814,4503,21,2524,1273,2801,4374,2482,2060,2937,2398,4766,1858,1677,3377,1653,1790,3270,3460,3643,3946,2125,15,3002,4285,320,4897,1962,444,4892,4210,2659,4403,5469,3136,597,4888,2048,1363,3858,1186,1464,274,1372,4587,2346,632,3164,788,4618,2855,743,901,854,179,3386,4002,4037,4531,2200,4713,4121,985,2316,277,3864,2467,4158,1931,2814,1930,2513,4392,3953,3749,3490,2216,3716,2432,2756,1571,2534,4623,3058,5093,4144,3807,2700,2340,2870,295,1459,2542,565,533,2268,43,2426,5262,4673,5437,1253,4650,3584,1414,2796,2886,1800,2127,5105,2490,3796,3118,711,436,4232,3488,1057,82,2841,4742,3130,567,5364,3444,3173,3382,1620,2369,954,3123,3141,617,3474,2213,1611,4976,5122,4477,1625,2415,4977,1973,3062,3316,4643,2188,3440,4268,469,3846,2262,2843,539,5285,4178,485,1730,2114,2268,5412,3180,5098,2300,1734,3827,3089,5314,2210,1648,2697,4540,2578,5370,1492,3556,3133,1698,4781,2641,1472,5299,1292,1980,2893,2878,2870,4299,710,5089,365,746,2483,5236,2527,3401,4244,2932,485,3953,2845,1214,1867,4401,1470,2136,3130,4338,3601,231,2294,381,3815,1750,2289,1962,4647,2783,5194,569,4275,1353,2851,3170,1327,4674,3827,4757,3801,486,4748,957,4166,3015,2462,3794,2032,2847,673,3445,3837,1841,1687,3429,5472,4873,782,1369,206,5231,4852,154,4994,4219,3315,2695,2192,3597,4590,2879,2618,4387,3195,4588,3825,3098,2515,3248,3925,113,1505,5482,3583,3495,2478,4616,2871,4155,2601,5439,1753,2729,1585,1477,765,3494,4605,2834,3323,4126,469,1397,310,2955,3303,3514,703,3055,1466,3652,669,3563,2727,3524,2890,2717,5029,4136,5115,1111,4580,605,2560,196,2780,5187,4629,4264,787,5512,3160,5495,629,4576,629,2131,2046,3928,874,5327,800,2244,3473,872,3773,5460,4642,5386,1195,1188,3951,3926,2577,3780,3705,243,4468,4995,3018,2756,1977,874,4687,3302,2170,4232,4842,4287,4920,1058,1036,3912,2538,3569,958,2320,4703,4690,4662,2178,4955,431,997,2837,5218,3326,1033,4012,3913,2379,1497,5104,3291,4499,2229,5152,1258,4328,1790,2561,3113,3910,5386,2849,1559,2238,3022,1514,1657,2559,83,2859,2029,2875,429,1379,1891,3676,4792,175,289,3170,4514,3996,4584,232,3431,1279,132,1591,4851,4783,147,2468,2137,2066,155,4971,2133,552,253,1898,934,4155,4506,115,2965,5027,2927,201,2022,2217,1679,3088,2146,3999,739,886,5398,3299,1659,320,4294,3340,4212,4774,1630,3355,2064,3930,95,2053,3205,4357,505,514,1890,5060,4245,2291,5452,4086,2361,2095,2722,4757,4077,1477,1423,938,2252,4111,4112,5460,2225,3602,5351,4656,3451,1035,5134,1221,2157,2682,2572,938,511,5058,2106,1234,2765,5216,4571,1505,2843,1452,2180,3063,2664,304,2331,1260,4677,1261,1516,531,3643,270,1836,1826,5189,3139,5406,5024,273,1210,479,1192,5003,2811,3013,5303,1886,4709,3114,1748,4199,2188,3247,2147,2026,5473,2402,4726,2290,3757,4821,3715,1617,2462,5227,3931,378,4686,2360,29,5062,1684,2726,4475,3794,3807,4704,4337,245,2719,1614,3960,1542,9,2894,816,1226,4785,2685,3993,954,2635,2935,2309,4475,4395,1814,4241,765,1916,3452,1958,5332,5508,2207,984,3404,3882,2258,4540,736,1649,5138,2980,1270,1682,215,3263,101,4503,533,490,1625,4161,684,2869,4238,2991,2294,2872,1115,404,1331,3657,3549,3277,1524,3463,5152,2972,1766,5142,3475,457,3476,4764,47,4265,2254,2197,32,4202,1027,2852,3938,3512,1822,2719,429,3314,3985,4369,3255,3045,3680,2373,2624,2639,2136,3206,2601,2766,460,498,3248,4838,239,4784,853,2134,1249,1780,5219,247,3942,2057,223,3246,1810,4241,4519,1046,542,3311,5406,2445,4636,657,1799,2880,1816,62,5314,835,4210,85,4454,5481,2207,882,2247,216,2219,1538,798,1199,2998,3465,3898,4842,3637,3466,3342,4053,114,748,2900,3212,4883,3319,3608,2469,413,2933,2404,1826,1600,3968,5173,1966,1747,2187,5320,4170,313,455,3160,2861,2599,3035,2360,5445,216,3285,4118,4212,1623,3354,3051,954,4547,176,4487,3240,1148,3901,4743,5066,1315,2332,244,2143,4875,527,4925,1871,699,2198,242,2627,4079,3906,5403,2494,3234,3364,4998,1341,4050,617,3906,601,2880,3151,1682,4656,1161,3393,4879,5000,4522,4327,4876,1207,131,4156,2695,1463,2256,4589,1183,4861,3970,2565,4292,4257,4867,3719,2394,5377,5184,5355,3544,661,2472,2446,1657,1214,2513,2863,5358,3298,5523,3860,399,231,4312,102,5501,106,4696,912,2391,1698,5059,2500,3630,880,81,2407,4315,1861,888,2612,379,1048,2595,3796,1764,5498,175,201,1728,662,2892,863,1980,3519,435,4622,4412,4127,4163,4958,964,96,2168,1387,2153,4495,3260,2340,1748,1216,1024,4229,3545,1315,5506,3247,3348,374,811,2537,3910,5442,359,5347,4822,1144,4349,1567,4013,3090,3365,3823,375,611,4427,4104,4374,1477,4070,4581,1861,4000,4569,932,3417,95,4590,4101,3254,1795,854,5096,3241,3025,4805,242,550,4181,3155,3357,518,2832,513,5424,5396,2954,4839,4516,3727,441,178,5172,2375,1934,3596,493,966,4180,3719,4503,3674,47,374,501,3872,5419,835,4451,217,3353,79,1954,566,2637,257,2210,3396,5226,3866,3435,1053,5324,3418,4911,1112,1587,4804,4769,57,2574,5161,4420,3668,308,611,581,85,2995,4870,3861,1042,4663,125,3789,2735,5367,5501,660,1504,4558,2476,3870,2196,976,2767,2502,887,4903,5057,4960,4294,1508,3988,2483,4848,3422,5485,1478,4004,1723,869,1532,471,3930,1413,4366,5278,4497,2949,972,1413,350,971,3797,1473,5229,1849,3624,170,657,4762,2521,5051,2933,4202,2818,2830,338,1863,3430,4819,1228,4905,399,698,4999,4751,4501,4685,1550,5057,135,5031,4534,4235,4666,4512,4585,4715,2146,5125,3010,231,4625,87,2342,2397,2865,3694,1297,2553,1875,4778,2463,2855,1927,3451,5167,4876,4232,1699,4507,2471,3574,5062,4325,3236,5121,263,251,1288,1126,1583,2351,370,376,2004,3919,2432,4871,4955,4132,2531,2163,3603,1172,2122,3708,1332,4088,5335,4559,2382,2625,3926,255,4508,4944,1279,3666,608,4916,2872,3662,1539,4515,4461,5258,2916,3852,4850,2201,3894,3809,3534,2033,4856,3975,246,4132,3299,426,3495,5040,1094,385,2233,4422,3593,3744,1009,4658,2388,3741,872,2238,1245,304,2589,4389,5276,2438,2366,3917,754,3741,2312,210,4100,1585,823,5225,546,992,2079,3081,954,4642,4846,3025,989,284,4693,2395,4807,494,4045,5292,398,2776,3479,4455,2706,2876,2738,4098,3655,9,4072,2324,130,3949,4084,2231,4656,3738,5225,259,1943,490,5360,5116,4090,75,2795,1828,1189,5223,910,433,3403,4725,1485,2696,3831,3017,1603,2607,3527,5108,2297,1542,2045,2953,1439,1481,813,2174,2243,4512,2337,4042,2464,5282,289,1301,1250,2032,3352,1341,2350,622,2242,1765,4049,2793,1773,2810,5365,2423,2068,650,622,5509,2401,4090,16,304,3804,3829,3470,3850,4364,4996,1338,1274,1026,91,3218,4890,4974,2048,1863,1025,5370,1498,3321,3551,5299,5389,974,4186,2886,5214,3313,4078,4424,3564,1311,1071,2335,699,2505,4993,389,2318,5224,131,2723,2491,11,3499,3471,4456,5423,697,3727,4454,1003,1747,2006,175,2107,5278,3973,2300,5194,3271,1617,2961,2077,5328,5136,672,3155,5449,4294,609,2026,2882,4278,1140,5418,216,4778,989,5232,213,4702,3192,3610,1743,731,375,2591,2453,890,4618,5261,1660,2426,2706,3237,527,1413,5266,5502,198,2181,3103,4362,5412,3255,5158,764,790,4317,983,723,4502,1173,2009,853,249,2633,4439,5487,1349,5067,4083,5058,3568,1100,1317,105,1897,2310,1674,4391,3186,5249,2148,3945,1932,2015,1764,486,2864,3979,2760,3886,5081,4937,2037,2878,759,4184,4119,1397,3784,1674,4961,1227,308,57,327,4668,5005,3526,1220,207,4854,1402,823,1180,3217,574,563,493,3662,2305,3777,1689,5201,377,2337,3420,5463,5105,3681,1427,3655,1261,3987,4884,3653,646,5323,2758,3655,2948,3673,4099,4344,2311,3415,323,3012,3265,3815,3083,2898,4451,283,2657,3244,954,1555,4334,3165,1602,3533,3745,4008,1284,4523,4403,1091,1131,3739,5106,4246,1988,4462,2818,2544,3201,3932,2988,3619,884,3874,1560,2290,2010,2072,4845,1319,1023,4489,676,63,5018,1514,2885,4392,2223,122,507,1989,2877,4510,5267,3589,3468,807,783,699,1729,2919,2117,1083,869,4290,1045,1719,4496,4523,4320,2813,3819,4244,2474,1838,4687,480,4302,429,3351,22,2338,3363,4641,2333,2237,984,956,633,933,5506,5236,2063,437,1492,1130,323,5168,4453,3930,665,3048,5374,5272,1271,934,1346,3231,904,3492,1438,3716,1452,5030,1468,1067,3633,4455,4419,271,5500,3569,3637,3907,2867,4749,2408,5429,1522,1179,1155,2515,3502,1771,5405,3881,4681,549,4234,3173,3293,5402,129,4034,4225,3906,3335,5176,2601,75,3874,5520,3905,4107,4496,4143,3763,568,1987,2765,976,824,2808,3202,523,209,117,477,528,3773,4496,869,3234,341,1613,2402,2898,4173,2719,4474,3419,2188,748,5285,2844,1606,4694,2851,4122,5056,3822,1821,3609,2010,4391,3874,1639,1825,3346,1131,4390,333,3082,423,3085,4815,3921,2503,2929,5003,2799,3517,1167,3110,1120,2837,4935,3416,1104,2201,1353,2342,4189,3304,2984,4415,481,3668,2154,4670,4834,417,1048,4261,1065,522,4320,1037,4121,654,5124,3332,673,1725,3300,1752,413,2382,3567,1338,137,290,1121,4245,1235,3060,2641,3401,5082,1244,3469,3057,5268,898,3735,30,138,3131,4247,3077,1808,5332,1014,5044,1942,3951,3960,5244,235,3547,1763,2997,2266,4593,3138,4428,2503,669,3061,1307,1556,1133,5015,4848,1328,143,2028,1745,2570,2255,2969,4587,4721,2756,2671,4346,3572,1211,3166,1688,243,2298,2467,1629,2633,5096,4165,554,1307,823,3481,1638,4939,3935,4336,1699,2188,3990,4965,2978,2602,478,3787,760,821,1593,3658,235,3602,4234,54,2624,1577,1204,149,4664,4418,4683,639,448,1761,2667,3061,1245,2068,5252,4988,1959,1117,162,3904,1064,3979,3644,5194,572,1894,719,1185,1564,325,4844,4205,2004,1464,719,4218,2420,4533,1877,999,4910,4165,1791,4277,5073,2180,5394,2496,4814,2761,4369,4494,508,4052,1504,3549,5251,2613,3641,5018,5316,622,5194,3059,1140,3579,3430,2063,3027,2612,2045,2551,3015,3909,112,2365,1599,4582,4005,2041,3299,270,4307,1656,2467,562,876,4049,3770,5126,1288,1150,302,2454,1909,3603,3339,1760,4575,4566,1744,4405,3590,56,3955,259,4394,2650,1706,4036,498,186,2325,3775,2265,5519,3737,4613,27,3901,2139,5375,4694,454,2699,382,2549,4332,4742,864,1214,5511,2179,1846,4483,3353,427,4497,1268,2809,1417,4299,1015,5368,2101,5299,1645,1210,2474,2237,1650,1071,2398,1429,2372,4783,3712,2743,2175,226,421,723,2210,5481,1225,446,1889,4404,111,3822,5353,586,4175,125,475,4434,5150,2895,4088,117,4430,3557,212,1938,1681,2153,2489,3824,3023,691,3457,4660,2361,3063,2943,1753,1402,4116,1220,3044,1673,3417,1232,4456,301,5136,3063,853,2031,34,1334,1434,1734,5092,3102,5162,302,3011,5034,4558,304,3011,498,2653,1262,4912,3876,5256,4873,4204,1928,2214,2529,322,4213,526,607,546,1433,5183,4640,3800,2385,5031,3011,4117,3265,4213,1417,2041,1294,662,1625,172,2875,3111,385,1849,5337,1118,3346,4007,2047,5338,4200,2610,2730,595,2522,2059,4817,464,4214,2185,2864,2642,4881,2805,3845,3535,5169,3713,455,5517,2204,297,1153,504,1537,2122,21,742,352,3125,5204,2641,1064,85,2299,4747,1873,5203,1534,852,4953,122,3758,4042,464,4515,3814,883,4305,3241,3578,1296,1101,5359,1975,4434,3858,1370,194,5123,1386,500,2928,98,4137,790,4540,155,35,1542,3123,2505,4423,1415,1927,3389,901,4576,5333,2676,1030,1401,2608,1324,2320,3054,2098,494,4086,3495,5212,2326,2553,969,4393,660,4548,948,2365,4751,728,4571,2110,2617,4220,857,4183,4314,3379,2799,3431,1569,4765,1098,627,2192,309,2858,3738,644,2352,1137,1963,2111,5312,1039,4676,2129,1381,31,2894,1912,661,97,3346,1036,2152,2604,4873,4738,1928,2706,4598,3102,4886,5233,968,3210,4872,4538,5053,266,5207,4998,5378,2428,2097,3467,4771,4810,2503,3991,231,2057,1520,2942,3870,102,4954,2769,2825,5203,1924,4876,4214,1150,1268,2530,2326,3396,750,3943,4486,4737,2537,58,518,1457,4308,3068,1004,3553,5294,3222,1164,873,581,5356,3211,510,3428,2635,4998,1785,4725,2680,3389,1184,3561,1220,0,4691,5451,3764,2121,1661,2376,3949,3409,1364,4402,1488,3269,143,1247,5494,2297,2302,372,2069,3396,3942,1895,4305,393,2553,1067,1759,4230,1379,3336,2133,2089,4202,941,3646,4114,510,2209,4193,4821,2881,1985,3944,5250,4134,5066,998,4137,1736,1357,2604,2699,2113,4527,1387,3035,3900,3371,3409,2470,579,4155,4806,1357,3418,1715,2248,5117,1687,4016,2328,629,1287,934,2260,724,2356,3170,2603,798,4086,1141,4347,1159,4220,1260,4560,2670,4440,2648,4332,2388,2297,1792,1970,2282,4139,1583,3324,2530,5106,4683,2848,5091,2762,2748,3378,1641,5368,2598,853,4612,761,5135,5060,2366,1726,728,2102,1270,3257,1195,317,4103,1523,388,4256,5179,4451,4457,4354,3724,278,5109,19,671,1221,138,5317,3959,3968,1262,762,683,764,5218,1839,5137,3343,193,80,639,331,1501,2079,3543,3181,4369,1317,2525,4272,1433,3728,2764,2823,859,3902,4047,3073,1202,1437,1960,2257,892,2314,1450,3728,1823,3907,5244,3731,2157,1139,3381,4209,2677,4139,1307,2607,2526,4484,5244,4625,3516,4448,3544,123,4443,2016,63,1746,4317,1579,5082,3079,2530,3254,4827,4458,2529,4206,48,1056,1237,563,18,4646,2910,1172,1636,623,3400,3651,2648,4853,2039,944,3306,3535,1492,5058,952,1809,872,3430,266,3884,2478,1645,2721,5420,1829,2872,2275,4246,2078,5290,2063,1729,3095,3776,1772,4139,1407,1724,83,2008,4015,78,2070,3742,913,3486,978,297,544,888,1601,3694,1757,3484,489,4411,3112,2640,1055,3909,2258,1422,5088,5072,3412,4849,2523,5310,684,5385,1484,1175,3178,1870,3848,630,3627,262,3651,2601,4575,4851,5260,5452,298,5165,4668,5409,1421,1572,2782,4698,1195,41,3027,144,2140,2308,3683,5068,4478,3196,3922,4875,4157,5460,115,3378,5114,4529,5498,2741,685,610,3818,4682,1468,763,5325,4459,2843,565,4800,5388,2001,4911,5069,1064,1613,4208,3933,2424,178,2122,2534,4359,2067,3844,945,2618,1910,232,5504,299,932,1919,874,2171,5223,858,1270,3642,1737,5367,3451,997,5334,325,499,3062,2557,740,3194,2537,5253,3600,1183,476,3656,3019,766,3562,1980,5244,2456,150,1659,3772,2848,5083,5421,711,43,2844,1022,3140,504,3871,461,5454,3614,3412,1355,471,3043,3367,447,2710,5177,1280,1411,2710,319,2761,1751,4377,4592,2802,2389,2582,991,2367,460,1441,4330,4336,5391,2226,5357,1605,1406,1975,3935,1404,1221,193,5001,4011,2779,592,5283,1873,2843,1400,3002,4429,216,3354,5368,3347,3480,5351,4886,4962,5488,3814,5090,1764,4722,1880,5191,612,4470,4968,2488,1041,1068,2671,2395,5097,4254,2852,2098,4000,4043,471,287,3952,1251,3733,3126,2718,894,1344,1252,1657,1478,2320,5115,4331,5090,5011,1977,2450,1113,1099,2187,1525,2991,3824,2505,817,2948,4504,4154,5139,505,2511,4479,4081,3610,5496,92,4598,1860,969,2349,3856,5304,616,228,5324,2574,4347,3838,155,4493,4676,726,1237,4987,2314,3780,752,4495,3823,4075,4460,1331,954,2659,14,2778,2636,5105,3163,132,895,3577,3787,2159,190,2506,3404,3901,4123,3354,2915,772,2485,4999,4700,2675,2508,1106,4363,4942,1476,3540,5301,2767,3918,1795,796,4954,633,4182,1492,560,853,3725,4051,4289,4596,3860,4618,4459,1141,5270,2139,1977,0,4855,2939,1558,418,2173,455,178,4501,240,3962,3307,3412,4997,2627,4046,2766,616,249,4373,4486,871,4079,2141,4126,4846,2075,2213,4707,5178,2435,30,1139,5247,2037,1113,1214,4401,538,4986,5175,4286,2682,4575,4650,1623,4235,3157,2788,1481,3390,960,137,2852,153,689,3177,2719,3047,4712,4545,327,3989,606,3657,3870,818,4357,5433,1473,4172,4862,2837,1681,1986,5350,2823,468,2037,4860,1495,1225,4234,773,3170,5342,2546,3663,475,2575,3621,82,4474,3569,4343,4973,2831,518,4103,3204,309,210,2269,5508,4216,4731,5494,2199,3918,661,3205,5350,2837,4447,4102,1323,2769,5029,271,967,1119,1514,584,1667,1577,5021,4517,5480,3368,4213,2190,5404,2117,4429,4886,2935,5426,2830,5440,4551,5408,1177,2116,4115,3360,2241,1403,4575,4365,2834,2446,1745,3996,2866,1842,3013,1698,4920,3544,698,1392,5497,4175,4016,3046,4171,5064,2106,80,4317,2338,1897,1191,824,1045,3976,2838,40,1249,4078,2360,1151,836,610,2529,1394,1639,1468,839,3462,324,606,4605,1213,1131,3250,3114,2737,2810,3487,898,666,219,4910,4246,1952,1528,771,846,2226,5332,5431,1869,3074,4017,3042,2203,1694,2122,4229,2604,1699,4104,3797,64,3170,696,1384,3258,2394,3468,3075,3305,1703,5022,150,1839,665,1478,4201,1698,3060,2653,1713,4695,1160,4978,2032,3616,3683,2862,19,5237,4674,4528,4258,3275,477,1237,23,5087,1922,2926,3182,1258,2659,1783,4674,2437,2557,4243,805,3572,1012,355,1468,2151,2931,4504,1831,2515,3534,5300,2202,4223,1262,3554,478,394,4712,4344,47,2097,1966,947,4674,4389,5317,2059,3292,1959,4875,2550,3938,3684,156,3615,2821,1247,4297,3284,3860,2946,1566,1526,473,2890,1625,99,802,2614,1523,4306,2769,1384,555,4206,3558,4926,1796,3170,2011,445,1351,2179,228,5162,5172,4890,218,2736,593,4247,392,534,5502,3809,2617,5307,2497,520,5423,2188,3618,1745,3117,277,3385,115,224,2816,2522,421,1619,4443,440,4977,450,2015,3746,1555,3027,942,2758,4214,1484,1683,436,4780,1142,2872,2119,4843,2948,4793,202,934,3516,4619,5348,2784,2908,2157,4701,1162,1200,2105,3580,4910,1274,1885,2660,3865,3290,5165,3337,22,4020,1373,1782,1397,2521,2683,1346,3457,1992,868,2255,4850,4127,2964,5204,703,1728,5200,2902,2405,3300,1672,28,3950,1765,3956,5286,551,3712,1282,2652,2714,1586,1293,2597,4172,1918,1482,4606,742,4154,2150,4691,3884,4659,3530,2262,4856,4228,4064,1251,2778,105,4581,4477,1333,3115,2519,1290,3639,1393,2758,2578,5249,579,3955,1419,3395,1942,315,3112,2188,763,2889,4289,5471,4679,4597,546,3377,1108,2347,4424,1870,3838,5309,4049,5283,4316,3746,3822,2893,1501,572,1427,5377,333,3594,2227,2098,3783,4843,1559,1070,3382,4628,1384,4311,4543,946,3873,1216,2092,4326,2127,3984,4919,2728,1805,1506,2038,3816,867,2059,2265,602,2546,5200,2681,4533,2071,2615,2392,2420,1879,525,3595,5512,358,119,2596,739,5249,5332,1658,1285,3518,945,3077,5441,1543,1284,5063,3169,4546,5213,1186,4330,90,3356,2831,3622,4407,3989,2809,5500,661,2536,1283,2357,1474,2841,2609,3853,4012,2215,704,3765,3150,5186,3092,1782,2128,3992,3073,3797,84,5148,3088,970,2773,934,355,4286,2690,4374,223,5276,2844,1420,2862,4752,1691,5428,2753,2768,5400,5189,5502,2552,2447,3084,401,4435,1540,5351,1298,2747,1554,4603,4420,4547,2912,784,256,2391,5500,971,4969,3816,3082,4490,3958,230,235,4690,1135,1977,5167,445,1681,4447,5414,4752,3571,2660,5389,4254,4868,5242,5224,1418,3712,1256,2578,573,2877,2766,15,598,23,852,4955,5049,3550,1583,2995,982,3291,1390,3950,3960,4690,4367,2816,2942,3399,4200,2874,2992,1247,5350,4226,4861,459,825,788,8,256,3889,2126,1808,5111,129,1306,2390,2639,4154,2497,4586,65,1474,412,5263,5085,1649,604,4540,4016,4763,2777,2530,2826,3794,3802,5378,4667,1770,716,1596,155,322,4788,4748,3669,1696,1066,3152,3769,1106,2822,4212,1624,1983,4499,4890,5168,3072,1268,2693,1655,5384,3952,5201,3469,1142,2250,4515,1843,2909,2904,5472,647,3479,9,1648,3749,4581,1322,2090,2045,2970,4658,4719,3917,5041,3517,345,150,4565,2233,5362,1526,4922,3847,2377,3938,4006,2396,1585,3617,912,4776,4491,345,1103,5346,3074,2380,4469,2220,2488,1216,2825,1241,3617,1240,4867,1048,2005,212,3982,2127,4982,4682,2327,352,769,4601,5132,1679,4263,3944,1614,3682,2168,5209,1879,1383,2157,925,5450,4012,411,2438,1168,3051,2422,3682,3620,4410,763,2364,3416,1848,598,1088,976,4797,2404,2411,4537,3406,4582,3383,1457,3305,1973,4516,4068,3484,1612,5402,4362,3758,922,3335,5443,5135,4919,700,4065,1369,874,3925,2661,2957,3244,5189,1213,3501,4919,2543,5464,5245,121,257,1569,3079,1251,2793,2232,3232,3086,966,3925,4964,3873,1066,1036,1293,3896,367,162,238,71,1023,5045,531,3197,2959,3912,3873,622,1042,4507,252,1860,4289,2139,3749,1281,1430,2046,716,3686,1358,364,4688,1833,3613,3807,3818,3095,4967,3437,1256,3681,1555,171,544,5020,3982,1970,3430,4166,197,3940,1633,1725,3684,4146,508,5110,1839,909,850,4273,2937,4400,2650,1899,5198,1042,4907,293,3990,1273,601,894,4527,4193,4259,93,2127,2310,2888,3455,351,2844,3319,205,829,5454,1404,96,5223,4111,962,5410,2785,5407,254,1326,1751,3880,136,2683,897,3619,3715,1946,4824,3974,3179,4843,1277,118,161,5299,2813,1272,3297,4128,185,1749,4867,3683,1877,5266,3566,4316,1495,885,2992,4256,5422,4661,3246,2399,5458,243,3283,3405,909,4715,1278,76,296,801,2750,544,2498,3851,398,550,758,4804,5525,2347,511,55,3049,4024,132,2852,599,2782,4314,681,2234,136,43,3513,3534,2305,1201,2183,5074,2892,2711,2623,3134,4612,4250,2761,3038,1128,2042,250,2040,5204,3349,565,1516,1936,4672,2922,4480,5103,5388,4674,1081,2358,422,4587,2672,3558,2819,3174,4770,1209,4666,323,1627,3015,3002,4388,4433,1089,4934,3838,497,2371,2580,5153,3219,177,3565,2568,1462,147,3995,2315,4849,5240,1670,2879,457,3211,5188,4928,3208,4430,1545,4250,5204,706,2186,4913,251,3705,3987,2862,1248,1346,2353,3269,4542,4337,2072,2829,2713,1564,4001,758,1402,1966,4442,4200,3917,593,3006,767,4301,5058,4426,1272,4843,1134,5251,4716,4057,4247,399,3288,1118,4211,1022,3094,1561,245,4929,4793,415,5170,1345,3519,5308,2299,2266,1126,5359,4959,3017,4391,1587,3085,4193,4836,829,246,3132,1226,3226,4219,2996,3219,1604,2590,1617,1954,3916,1088,763,4003,235,279,5263,5439,178,3988,5351,3147,4425,5173,3269,3710,253,286,3325,2686,3649,3222,1043,3506,4697,4800,565,973,1639,4091,2954,5354,1574,829,657,4810,3767,4028,4547,1160,393,4261,4873,4486,433,2910,15,2819,4373,2781,1702,1455,5391,4709,5046,3188,1734,4872,2097,4084,3157,2115,1233,1468,3537,259,2420,3171,4115,107,458,3238,2957,2602,1076,2691,4327,2761,2416,4253,2322,3425,4699,2851,5175,3966,1142,4462,3120,5278,2686,1574,1037,4431,4978,1655,5060,4206,3074,1586,632,1123,689,2761,3214,4682,3892,134,1003,1702,4257,4356,4641,3971,2326,4467,4810,460,2581,3914,3275,2933,4877,524,4361,5360,4189,322,5016,3420,3954,4369,1655,372,1989,5017,5412,2556,4784,4571,4507,820,1037,4730,5433,2048,314,785,123,793,546,2476,1629,4895,4292,3374,3876,5489,713,2704,52,5368,162,1353,4069,2391,4662,3055,2143,26,4585,1927,416,3352,4314,5503,5162,3001,3415,4184,1289,3301,4261,4505,3599,2317,2891,126,3351,2723,4775,5513,3706,1626,1629,1615,1330,1602,4887,5350,1860,1261,3207,33,1773,2777,1601,1404,2838,1081,2336,2411,3631,5364,2074,2681,2973,3303,547,3315,686,551,5146,937,3774,801,4632,4169,4727,536,4390,829,2039,2940,4464,3760,2685,4835,1114,6,4253,5263,4322,4744,4063,5071,3952,3938,1395,399,5338,5019,4379,4848,5177,1996,1362,4242,528,4390,5069,5331,554,250,1471,4100,377,3215,4904,5137,3815,5306,3492,877,4006,450,2284,2094,4038,2929,2164,1068,3266,2677,978,2444,4929,5442,886,4907,1147,1855,1307,102,3405,2377,4394,1094,415,3385,1243,3595,2512,157,1709,2190,607,23,3510,1626,2415,5272,2886,3894,4482,4452,3467,5321,740,672,5041,1976,4549,5064,895,3154,4071,2202,1674,1999,3772,2928,2033,250,3083,4674,5333,2870,1550,1147,3427,1618,3334,3799,71,2394,657,1670,862,1475,2723,3726,1500,2411,2374,2170,805,1615,2317,4580,4750,4421,2273,1657,2162,2373,3163,4741,83,1296,4143,438,4561,3331,2707,3909,5280,304,4126,3145,1915,1998,104,703,3952,1447,3595,4582,3749,1744,3759,3288,1645,5366,3744,282,5357,287,1717,4503,780,2511,2854,2484,2850,4102,2564,451,1079,2404,2950,5140,3033,1532,1479,431,3188,2804,3089,1353,4220,3482,4152,3290,2016,3870,1433,1021,718,3285,2734,4064,2325,3591,4083,5064,2441,308,5351,4745,2504,4668,2615,4379,4651,4791,614,5307,3768,4924,346,4875,2829,5265,4794,4214,3088,2147,3313,3575,4641,1055,3747,2972,2707,3329,1336,2940,818,3109,1281,738,2827,5141,2134,3226,910,3174,225,2124,5049,1001,4463,2952,4153,693,4341,395,1979,1031,3024,587,2376,5370,3147,1401,4207,4439,5253,1902,3987,3424,3943,736,915,3346,5397,2411,4500,4756,4075,1922,48,1808,1920,795,3715,1143,5032,3951,1938,5119,351,5082,1465,260,57,823,2415,4906,5427,4567,864,965,4611,4456,1239,559,3542,3387,5364,1668,2746,2038,1056,4841,4563,5098,1384,3230,5362,1564,4840,3910,4379,4825,5365,1649,4255,1452,3392,5284,1303,2524,1429,4299,5080,1851,2898,1472,223,4082,1339,920,3447,3785,3978,2980,4874,4253,4437,3034,5,1625,1580,2870,4739,2102,2546,2816,5057,1657,2926,2767,434,3558,5050,450,2941,857,2421,2962,2766,2574,1752,1986,4561,196,3825,5061,990,4000,3704,4809,897,596,1670,2191,1387,4147,2140,5518,3339,1261,3209,863,5266,128,1865,2256,1196,3425,4903,391,2375,631,5423,2226,1911,3031,4036,3554,5118,3605,969,999,1993,3726,5506,5046,1818,3185,1803,4774,5188,5525,1466,1741,4137,10,1784,5377,3721,5006,5035,5460,2715,3135,810,4247,833,1832,1029,3919,3705,134,4917,2146,968,1368,3653,929,5507,4884,4825,4155,3900,4325,1287,924,999,1342,5198,4814,3720,3031,969,305,3969,563,3985,2597,4939,1748,3371,285,4496,1545,3152,3137,1208,5266,5362,4889,3949,3047,1493,2390,698,940,486,2504,1821,2044,1088,1686,3099,4260,880,4767,767,2063,2678,2709,753,936,1650,626,1910,1764,93,1339,4519,1059,3723,3253,1960,5448,4009,2820,1118,3909,1097,1223,3702,1886,2202,3296,2557,436,3335,3722,5069,882,2010,2480,2101,5029,4242,4741,1399,170,5364,176,1339,1247,5346,4547,97,5270,627,2160,1303,3427,823,3711,1254,5388,3318,993,5487,1684,2545,59,5171,934,4401,1380,4691,4146,4432,2418,1183,278,3786,4661,461,3755,4809,5235,2131,5191,281,2148,5498,2980,4225,2857,658,4271,2770,1430,2099,888,5205,4988,988,4006,1554,407,1736,3087,638,624,2729,4968,1816,1639,291,1328,1868,4915,3233,1289,4350,5258,2678,477,1154,2759,4263,3475,1541,957,5087,4457,590,3892,1894,948,2461,4478,2960,359,162,2716,4909,4822,2476,4127,4627,3029,1762,1566,3326,792,1271,4113,2039,3266,846,4431,195,3803,3657,1136,1420,3336,701,4293,4777,3556,260,2674,3999,3748,1769,4835,3969,1168,3433,5352,4106,4655,5056,4845,3695,1776,5444,5487,5164,3427,718,282,1605,299,3938,952,2739,2252,3115,3480,3269,162,2794,219,4405,1635,2864,906,2970,3604,5344,2070,2022,831,1797,3559,2468,1878,4757,3725,3019,3029,710,5382,1070,5120,1965,4882,1644,499,1876,521,2983,2689,824,5163,3237,4423,3858,698,2609,4072,4097,3049,1985,3794,2906,2416,902,330,4533,3567,1543,3649,1347,250,4014,3817,666,179,1949,3649,548,4427,5043,192,812,2809,5376,4302,3897,1036,404,5009,4787,4451,2442,3829,1319,2325,3152,3874,5142,2264,2665,2956,313,217,1469,4393,4412,2989,2244,2927,5243,825,3475,353,212,3666,3568,4843,3181,3649,1824,1432,1766,351,1797,1801,3419,5104,5075,2952,1472,501,3671,2937,3805,2235,2452,4361,5075,5344,904,5151,2282,1727,2878,1107,1131,1833,2922,4757,3764,2769,4047,3422,2922,2455,4786,1172,3414,5233,2383,4608,2853,4933,5192,4465,1470,1618,5140,3087,1584,2815,942,1545,810,5310,5398,2879,2279,4798,4329,4220,2810,4217,5361,4258,1515,4115,295,1491,874,671,4947,5060,2676,3637,5329,4887,670,959,3579,708,3268,3098,776,3777,3440,767,3621,3929,1400,268,930,3083,130,3141,1657,2075,2610,3424,1795,598,3111,5045,968,1229,5304,3316,2226,1200,4882,5035,4915,1877,2974,2470,4336,5412,2278,1694,3545,4682,4897,230,155,5112,2052,1475,5417,237,4565,5371,5420,4147,248,4944,2142,3952,5326,5123,1017,1898,2500,4838,4314,3535,3479,4709,3998,2782,3019,5312,599,264,5439,945,2138,4508,1399,3005,3500,933,3420,2802,4619,1751,3855,1545,4053,1916,3925,3276,5147,4055,1475,5301,2703,1724,1770,2035,4959,5265,2780,4883,2964,2260,710,3296,1312,1724,415,1993,1082,4323,732,3287,3403,2251,2063,3296,2322,328,2652,1412,902,2003,3804,5390,1337,4639,5166,349,3676,1443,4054,3058,4663,1271,4807,2761,2619,4670,5029,3001,319,237,257,2160,2420,145,639,3261,1697,4975,3899,1005,4096,5279,4923,231,4739,104,4489,1070,1827,2987,405,447,2655,2665,2944,4903,1529,1725,2176,503,2827,3477,4140,1120,2689,2310,213,78,1011,4123,4149,369,2642,4038,3742,5512,4448,264,3623,407,463,2561,3653,3494,1884,1180,3059,878,3114,2888,459,4474,1682,2536,5198,1278,3766,3228,665,3131,1990,2181,1995,1696,4754,1568,189,1563,3652,2267,1905,5199,911,3994,5215,2458,421,209,3966,157,5060,3786,4867,315,3735,505,4025,1887,3270,1549,3950,1670,1111,2238,3452,549,1996,4890,718,2390,1332,165,719,4789,3806,1078,543,3424,2181,387,3096,168,3910,1081,3801,2435,1446,2991,166,1492,3372,1446,178,5408,5398,3543,2915,5176,3672,5471,781,3036,1213,1037,2454,718,1175,556,4424,2729,4660,3692,2728,5268,3522,5208,1124,3012,154,1098,2725,1809,2484,1787,2842,3026,394,301,3153,648,5225,915,1948,4564,2478,92,4952,3783,1151,914,5436,5009,4248,3722,2358,1570,3533,2583,3515,2960,4960,3756,3505,4494,1667,1741,2191,905,3706,4250,4594,603,5323,5188,5145,3944,445,2593,1314,2742,2265,2932,1924,4403,4051,2679,329,2348,4887,60,4076,3521,1226,1558,1627,1445,330,2494,5082,2205,3760,3767,4277,2971,4231,748,748,1855,2716,4330,5233,590,1639,892,1645,4253,4928,3076,2043,2306,597,1981,2197,4175,2550,5137,4378,649,404,5046,4329,802,3470,3889,542,5417,3519,5318,4508,487,4513,4712,5180,3766,3912,4316,2712,866,766,1357,2679,475,1508,776,2749,556,1244,3148,2696,5441,670,1143,1498,1029,3680,4125,35,4483,1396,792,281,603,5348,1688,1852,5038,1259,920,1530,2510,4401,2680,570,4448,4322,3948,2228,1261,801,4324,4368,3697,1596,1039,4928,4205,34,43,559,1066,4905,2215,4271,2097,4143,2187,3809,3911,374,3061,4576,4850,930,4801,2088,1660,3467,4581,3092,5184,1097,2316,2346,2572,457,4103,2286,3637,4892,4423,3042,4698,1775,3178,1042,2152,4544,2773,2320,1329,5440,4193,2277,1378,4021,1275,5048,3499,4507,569,599,4695,658,3217,1178,46,4253,2315,934,3691,650,4362,4439,3371,890,4296,2566,5290,3301,5349,2202,2808,4842,1179,4208,438,133,4928,2089,3040,781,235,4082,485,2722,3134,4753,3688,1505,3569,2731,2626,2884,364,5524,5463,4613,4070,552,617,1892,226,2836,3136,4377,709,3701,4829,1065,5435,2330,760,4554,3832,291,2402,190,4316,1161,4719,2938,5396,468,1413,2647,2792,873,2287,4431,3905,3128,2305,3614,3089,967,389,101,5183,119,3304,3460,3485,5212,3348,624,1480,1336,1075,5398,1174,2895,902,183,82,3412,598,22,3774,2326,2404,415,2846,503,1448,1778,4159,5403,928,3546,5060,4712,5439,194,3878,2493,1377,5072,2592,1686,3235,404,2042,5452,262,4922,3911,3150,1712,5239,398,361,3994,4149,2902,4262,1438,5338,937,4281,655,2217,2151,95,3009,2438,4849,778,4053,846,3198,1616,1859,1509,220,1505,4159,2880,5014,3982,2806,472,1447,398,3873,3153,959,557,2844,3214,4375,3457,2439,3126,4786,3053,589,4882,4902,5113,3459,4217,5213,2192,4769,282,5503,1205,4616,2705,3887,4247,255,5302,2855,5248,797,3569,3569,5128,5478,2890,1447,3429,346,4640,715,4520,2864,2186,5180,2248,692,570,2485,262,2271,4960,2799,3500,2815,2263,1818,1295,71,5281,18,3775,2566,3243,720,688,1586,303,2059,3025,4685,4650,278,5329,2771,1170,930,3923,149,3586,902,2581,471,558,3792,5449,4589,393,2450,4375,4045,715,2514,3550,3673,2921,1559,1259,5002,2768,965,2666,3462,2788,1039,5432,5104,3389,270,4928,5506,5017,2589,4575,246,2990,2693,5414,105,2185,5462,1369,371,2762,3236,2577,3028,3492,127,1403,4179,4536,5303,2592,5309,5458,3556,4624,160,1214,4945,5112,2293,5034,1103,352,1323,3519,159,248,1950,2024,1840,223,5229,31,3289,1228,169,3402,3896,2949,3922,4132,3893,595,1324,3140,5462,5379,1408,1979,3034,2091,3689,2645,4177,337,1531,37,1612,3303,1001,2009,4043,2842,3213,3557,3201,1908,375,5178,4599,4222,2968,1579,1569,1031,1674,5120,3568,1665,1983,5336,1764,721,1140,537,4239,4145,4320,504,3490,4110,471,3933,2889,3063,4660,1455,2130,5115,2045,446,2650,494,401,2717,3302,3643,2278,3586,3923,5277,3616,3762,654,4270,2717,3950,2613,3074,3726,1327,1273,2136,249,1374,3369,2309,412,3005,2192,1843,1582,1571,2775,4540,3528,504,4536,4053,3884,3047,5055,519,2527,2202,1381,1764,2197,4078,3754,2090,259,2433,97,777,1656,4439,4708,3007,1166,3395,4115,5322,3149,1583,3163,5241,3701,1153,295,2384,2727,3038,3910,2534,1538,4982,3291,2586,1318,3358,4175,3627,1008,157,1107,2041,2793,2143,1488,846,4046,2344,2886,1065,85,4267,5283,2794,3608,5116,2720,2152,2872,1309,3563,1868,1081,2700,4100,4688,3775,4027,3725,1817,4227,2908,3344,5292,3252,3166,4315,5413,3263,847,1035,2818,4260,4137,692,4476,395,901,3848,271,4562,2801,2044,3026,4105,3481,2799,4242,4298,4287,4321,4861,1937,140,2068,1956,2699,3629,4919,3028,204,4802,4252,454,257,1724,4064,1251,87,1498,5142,528,4592,5099,2263,3364,5200,3000,1396,121,2269,26,501,392,3989,1308,5096,2412,1549,54,4355,5521,1448,1178,4355,3724,2990,5115,3774,4456,3107,4724,1259,51,5110,4422,1296,2241,5339,1072,133,2066,4710,3959,2302,821,1378,3315,4743,1510,789,672,3948,3932,3230,2835,5157,3580,2303,2583,3902,4335,3064,5017,189,4589,5389,3665,224,4522,2996,1384,4967,4755,2159,739,5333,2968,1015,2404,267,4152,4798,1262,4802,5422,4288,5054,3548,518,2570,544,3091,5202,4812,4514,1511,4269,5417,3621,2104,1309,3660,1075,3319,4436,1548,2517,4132,3439,2993,5118,5357,3177,2246,3565,5133,5123,770,425,139,2550,4808,2682,2620,3061,1825,1093,2409,4503,1104,40,2601,3854,1947,5032,1684,1132,4328,1273,2612,4027,2010,591,4935,3332,3468,161,2917,2910,982,1583,1637,1156,4552,1600,269,142,4003,1716,4834,1260,4745,4067,585,3933,1158,3572,1477,1889,4743,2191,1739,5433,4344,3443,2060,3901,1596,3527,2451,2038,561,3906,858,396,1108,3547,1315,3002,2340,4704,4706,183,3537,4504,1914,3358,1679,1608,3567,2604,5034,4866,3680,5251,1688,4655,3258,259,585,2559,5099,1940,4938,3128,1809,2773,1314,1449,3336,4765,4775,11,4975,1705,3212,1351,3644,2410,4432,2980,2420,1317,4129,4011,5350,446,3044,4216,2253,5057,3171,5116,5169,3908,2158,2798,2614,4576,4472,2716,2989,539,3210,3751,5357,4241,173,1015,1849,1595,4079,3605,6,3276,5293,3422,29,4895,2798,4987,4882,2251,3127,5002,3034,6,4444,5481,4702,1703,3120,1561,1684,4376,3205,4833,3280,1199,4748,4651,3546,3249,1997,5461,2806,2069,305,3051,2536,4924,4733,4864,1681,3008,3824,3918,3958,3261,3648,2636,3924,2681,802,536,649,476,880,1881,705,1078,2426,1292,2803,4682,437,4294,173,4533,2179,2201,560,1113,4515,5287,624,1971,2607,4415,636,2084,4351,4166,2747,2517,1408,3030,545,847,3082,187,321,844,1658,3844,2695,499,2732,289,1080,3604,1295,1957,1112,5191,1727,2661,1030,2725,5352,4533,2440,4507,5296,2096,3654,1595,3152,788,4399,3640,5362,2237,369,2338,3102,5018,3123,1254,4688,1965,3631,2116,3714,3328,2863,284,5474,2958,5494,2667,2738,180,2048,1930,1982,660,3404,3976,141,1265,808,1033,1519,1338,2637,2928,3558,1094,2763,3460,2742,4482,3546,5029,5338,1881,3788,2392,5067,4597,1618,4523,1544,5369,5159,929,1695,1089,5238,1006,3548,273,1349,4902,356,1476,3629,653,1890,4892,3769,4796,1427,4789,325,3658,359,4947,2612,1022,340,2772,2490,5434,1863,5197,2747,4662,3994,3683,2806,4597,2599,3624,131,1029,4548,1450,4581,4005,2627,4376,3213,897,326,5285,4706,5188,581,4348,4733,4535,3779,4431,694,1323,1883,567,2662,1442,1839,2945,1912,2164,239,780,3075,5180,4654,443,1371,5411,3339,1496,1940,4030,2391,3445,1660,2544,2735,5061,4972,3878,1286,1576,2451,1990,1140,3262,2737,2254,2196,2006,2894,522,4246,1020,721,3041,4839,3949,3164,2575,1360,3819,311,1438,1298,765,15,1641,1299,499,4470,1738,5436,3430,3193,4429,5010,3269,5246,4629,4381,5226,964,2099,1690,2889,751,3677,3689,1505,3190,4319,4957,4383,4551,3896,3240,3024,5207,2098,5338,4178,4869,2334,1509,1199,998,2972,4094,3783,2496,4865,3643,1994,5380,2985,4587,3740,1771,4826,5021,3392,4118,2204,5218,2371,3993,1432,3142,2743,1073,2318,346,696,1547,4634,1570,3845,2070,1366,2636,5392,4788,2633,4804,3177,2283,1075,486,227,1242,3654,4834,3251,703,5310,1469,253,2802,4624,803,1328,661,4726,1744,4812,3827,2062,4701,4877,1446,3977,3853,4368,430,5457,5477,4354,3595,1299,5370,3953,1803,5336,747,2328,1248,5040,3084,2926,275,2284,4965,3265,918,5359,2683,4616,2197,5215,2195,5454,3476,3222,2391,494,1456,2520,3834,2261,5357,1202,3324,2068,4156,1578,2783,1747,3288,1179,910,1960,3052,941,2923,4422,185,4936,4992,4835,198,3882,572,444,5050,3621,1374,1491,3604,1530,3675,1699,3438,5355,3448,5446,3752,84,5041,3615,3537,4170,4216,4995,4968,1329,3360,1831,1911,2363,201,1157,4680,17,556,2485,3791,596,2392,1237,982,4915,4647,1649,3080,3759,3526,1970,871,3438,1824,151,3773,872,4392,2469,2726,4292,3882,3425,1509,3830,2349,2536,5133,1806,4399,2095,1855,1620,5021,4852,5238,1603,462,1430,2398,4108,1320,2156,1640,1632,2934,5426,1673,3906,389,4572,4444,4534,1724,587,2426,2508,1198,1494,2452,5126,1270,253,434,679,4733,3437,3581,5158,2293,1731,9,3808,2654,398,551,194,2758,5235,600,733,4985,835,1974,5119,1927,4073,954,2624,217,3195,5524,3567,3279,4772,1869,3574,4482,2783,566,5116,2014,4136,2890,2445,5483,4107,3484,64,2866,4890,2502,2712,3643,2402,3091,2252,609,1684,207,1445,5453,2458,2929,114,2956,549,2418,2013,109,2262,2442,307,825,649,3021,3969,647,3986,3231,3304,1550,3354,1507,1987,790,2920,5127,3303,2107,3297,2340,2934,5258,1526,4354,3119,3117,4879,2695,4890,2415,95,1841,981,2711,4820,5412,541,2094,285,3509,2542,1627,2775,3309,3554,3909,5473,722,5040,2349,29,3909,2080,2568,4924,3456,4122,3127,4920,3859,369,5128,480,1734,2702,3289,5032,2981,210,1849,5295,2883,5371,1489,980,4034,3555,3357,799,5499,4788,4349,4863,443,981,2715,3178,450,4138,4993,3122,2210,2460,3663,1463,1665,4945,2599,3721,3983,1277,2509,1142,1248,265,1540,2860,1570,2937,3957,2077,1351,1804,2639,646,993,4623,4849,4608,854,4390,2667,4460,3775,4387,2226,75,2861,736,1353,540,3499,5009,5302,5366,1558,5093,1672,3786,3092,1215,29,654,5267,3107,5314,2759,4545,2406,3144,3889,2122,2540,5064,5400,3183,1284,2865,1381,5179,2341,2442,5327,3164,3819,4541,1452,2232,1290,4689,330,1338,2588,4208,1794,4204,4270,1658,493,1662,5032,3461,873,2982,2909,1323,3709,4191,2052,4040,4966,2,1185,2779,1579,4834,2266,1923,1959,5094,666,970,350,1058,3716,1559,4347,1397,655,288,3652,34,790,839,1719,5079,4602,1763,2775,2478,53,2974,1165,5137,3749,1764,4538,2284,68,4652,581,3625,5056,400,3283,3379,1109,2088,4771,2879,3430,2988,1524,3746,347,1903,3179,5271,1992,4894,2767,5048,710,1113,4608,3205,1037,1529,396,4551,1604,3573,3902,565,1224,56,2348,3123,2649,1280,1953,1217,3572,1405,3309,1786,3662,827,5191,3689,941,2482,500,57,4998,3196,5234,1490,3591,2684,2656,3609,4815,1808,3457,976,1559,2211,566,3968,5037,2661,4705,4274,3352,3613,4107,4527,3713,5240,3773,667,3641,164,1683,450,3566,3646,4392,1172,3903,89,1305,2323,4367,4945,3543,667,998,2925,4708,5122,3536,2979,975,3180,4319,3007,1224,3400,4203,381,3034,3933,4164,3941,3732,1391,3449,1005,1504,5221,1063,913,476,4161,3198,4571,4644,4539,8,952,2994,2447,1140,1530,908,32,2748,4391,1839,2626,4586,1581,2817,1505,2171,1247,3691,1557,308,1226,406,5145,2035,379,3444,1029,2220,710,2347,5114,4997,2767,3441,920,5230,1647,3763,3694,1579,3971,33,911,2304,2854,3993,4711,1357,4990,2222,716,1258,4784,5466,4299,2132,3863,4071,3802,5350,958,3701,3175,3052,5316,299,2467,2636,1730,4229,448,5386,4987,1087,5188,924,5156,5279,65,4266,1166,2952,3757,520,4468,2535,1183,5147,3668,2535,410,2861,2754,1133,3151,4870,1182,2161,1296,1808,2615,2152,4578,314,4112,313,5297,997,5063,862,1475,2449,1529,2141,1081,5027,4778,2979,3309,4817,2626,4208,4659,4869,1348,3552,3058,4652,104,4512,2418,4803,4608,2532,4024,971,2676,4587,2706,3038,2298,2167,4773,2392,4734,1064,213,3441,4213,1217,4384,5384,5424,4211,4070,3053,2691,2283,2311,2617,3758,3882,2259,2958,2549,4852,2207,4708,564,56,991,4476,1792,2779,2320,1233,6,3075,1993,1438,3556,1626,1666,265,4680,3063,770,1321,1913,4982,3560,2374,3879,1545,4025,43,3409,4860,788,4443,284,2398,1041,4670,3946,2661,2344,5307,4845,3967,5120,1036,5151,2640,4732,2220,2102,4281,4903,4593,1570,635,5312,919,3092,4237,199,3903,3747,1504,2836,1705,861,3986,722,1735,2846,1581,3428,1251,5339,430,665,4397,4444,1202,3696,3722,3482,3152,4241,1019,721,3960,3512,897,376,2027,5282,1598,3269,2388,5267,1452,322,5404,4549,4261,5411,4591,3913,2771,3057,2726,1635,384,4969,2530,652,1502,3997,3590,3726,667,305,4459,3146,2109,1936,3253,2559,616,4904,3241,5035,4938,464,4355,479,5010,1197,84,1284,3772,2364,4023,3673,486,3438,4379,1970,3474,1872,952,5489,2735,2178,3617,1388,2891,5450,1992,301,5408,4841,4119,3627,2035,922,5359,2804,247,3406,1682,2847,2155,1984,3272,3332,3953,4084,4932,2836,1220,4100,5494,194,2,4728,638,2622,3077,2667,5343,395,1278,4358,4677,1136,5055,377,4464,1663,742,2160,5397,3643,5135,3797,4789,5462,465,527,539,3461,2383,4886,754,2349,3002,5022,4332,3490,194,2647,3522,4733,213,5139,3778,2042,5011,5131,362,2908,1481,1563,1561,4045,3002,2826,5509,3222,4324,1507,4991,3172,1682,1752,4588,69,4704,5310,2612,1905,1198,978,4215,4616,5291,5468,848,4748,3325,838,2347,3315,668,5043,75,3587,327,460,3495,3128,529,1714,4361,2724,1302,1817,2327,1547,2813,4060,4557,3102,3775,3479,3373,969,5413,2757,4737,3024,2786,1912,1352,3337,3010,4784,4941,3744,5441,5379,3035,4613,4426,584,5096,2132,1823,3167,534,2771,4751,2142,3106,2507,468,726,3687,1167,4405,797,3249,3047,1156,455,4886,3918,4639,850,4764,551,5282,1933,2768,142,4460,3037,3053,5082,4445,700,3981,2156,4445,737,3856,1629,5004,1419,1178,2982,1849,4352,4962,4596,4617,485,2754,1740,1530,1935,101,866,1334,3362,1404,1466,1658,4934,1499,3328,3846,2643,3184,2893,3135,5364,705,3857,4614,1826,4909,970,121,345,1386,5471,1432,3378,858,4538,1845,2350,3781,276,3199,205,3592,5432,3141,5266,467,2594,3593,2395,5377,4735,1272,1702,4656,1134,3850,4795,4344,1968,3262,3259,2695,4359,3990,1464,4579,3866,3851,3726,2678,4330,469,1794,1436,2901,2107,5265,1736,1384,5515,1328,5271,2117,2847,815,5346,3037,88,377,4424,1870,4660,848,2126,1064,2043,1448,303,3177,2370,3751,3213,1820,914,4521,900,203,4842,2336,2007,3230,4245,3010,4788,2392,1382,4485,426,4902,5196,1341,4054,3868,3741,1687,4783,5208,2500,4923,94,2508,2916,2723,374,879,2071,2832,2924,2069,2215,1972,3625,3964,600,2474,2721,278,4693,3083,109,1042,2606,277,4280,1424,3655,4033,4565,874,4490,2246,3959,2452,4638,320,2475,4287,3007,3789,5510,481,1046,3372,478,1234,2351,4479,2586,1401,2650,3501,4170,4887,2748,5064,751,1315,5431,3328,4214,721,3686,286,3334,1221,5284,1780,2037,3878,1881,1932,973,2655,498,2073,1097,5284,3530,5014,4999,3564,1641,2399,4606,1868,1173,849,3277,4845,6,316,1502,3516,4339,3797,4881,3963,3434,972,2236,4889,3588,2149,588,859,3350,4208,3936,4644,3871,1495,2029,4687,3242,536,5435,5045,2246,3816,5301,4598,4640,1938,198,4933,3790,929,3413,208,3410,3801,3148,1909,2089,3362,4768,469,1916,356,2441,1038,1405,412,1390,5350,2310,2474,5494,1517,3129,2728,4761,1251,3004,379,2182,1130,2426,1961,3450,3275,757,2584,1400,637,5028,3621,4527,5434,3677,4713,5506,3604,4219,2729,5319,916,3514,4421,4081,4110,5013,3837,2258,4285,5049,1957,4895,4157,2746,4461,2157,446,862,2714,186,4098,3474,3336,4986,2647,4083,4032,4867,4742,3920,1549,4101,4997,808,3583,4056,578,348,4154,4068,405,2616,2790,1060,1155,2201,509,3536,190,2911,3774,126,2155,4171,3697,4485,2366,4975,3106,383,1532,3469,4515,4285,5361,3524,5449,3245,1163,5515,1769,84,5271,3779,11,2271,3533,3637,4774,1222,3275,4550,4151,2004,2844,5422,3097,76,789,455,1532,2342,2072,3280,3029,1526,2981,5271,3476,743,2914,827,3784,1649,1436,674,757,4166,3302,234,3235,504,5212,99,2950,2134,2997,2399,1508,5030,2473,1300,5305,597,116,248,4972,4274,4949,798,1611,418,2719,2398,4648,1503,2683,2265,3818,279,472,2621,1894,3100,2071,1538,4911,4054,5484,2110,3940,1488,3944,3249,2321,5207,2090,1109,815,4178,836,1163,4428,3086,3261,3521,774,4908,1349,2654,3588,5513,1005,259,1805,4734,2787,479,2646,5148,4542,704,2630,1008,3976,3203,343,2038,1439,4102,1847,4225,156,5239,15,4824,3174,588,1886,732,2673,2577,3387,1495,4921,2948,1427,795,3616,5137,794,1866,3560,3208,1764,482,1438,2477,5007,799,1687,1326,5041,1245,713,554,3881,791,4139,481,1289,5407,283,2772,58,3107,650,5375,188,3221,5243,5500,2700,4330,1084,4576,3167,4143,4472,2355,4641,2293,4406,2912,1395,5132,2558,3843,2388,2319,1417,4307,5033,887,4742,3245,3506,494,1990,4900,1953,1036,970,4578,2611,4930,121,3538,2690,3500,861,2186,181,1656,1150,3403,3392,3907,2362,4503,4597,4736,3931,713,1091,923,1605,1889,4210,790,1946,2854,521,4864,1293,1331,4649,4158,3888,4866,2556,3258,1789,233,3977,1737,419,310,5323,2551,1075,2378,1008,5104,711,806,4531,776,2618,714,3549,1968,3316,2234,1439,5348,4714,3067,295,1638,2153,2883,1820,5319,621,2120,1410,1125,4882,847,531,3196,370,316,3531,3845,5389,2620,1549,505,4423,4222,4530,3405,3204,1813,454,1218,953,3898,358,5359,466,5486,1222,434,4136,2642,2343,1674,3409,3357,4684,5226,3789,2505,5066,981,1458,4285,375,3974,2221,3048,2270,2233,5353,1126,4699,5064,2753,2982,2861,5270,4453,3046,4472,2840,2431,1832,5442,4041,97,2284,1766,5024,755,2869,5118,3876,4603,4649,2588,4462,3556,1383,5183,1396,1077,4400,1790,5487,3286,5226,1495,4484,5312,4766,2231,3663,1680,3489,2932,4327,2156,14,5440,2832,1660,5330,1825,4041,5127,3201,4318,3702,4803,494,189,82,2465,4815,5101,4715,2026,4418,1929,4522,3473,3791,4368,387,5406,3712,2577,3073,2596,5215,4413,252,4049,543,5330,2015,315,3694,2483,780,1307,3241,2558,4066,3303,4242,2719,1000,932,4857,4074,1255,1646,907,5518,232,714,1140,201,3557,3330,10,3303,3980,122,5465,5451,3227,3347,2982,4365,1006,5069,524,5338,2487,2406,5037,1341,2850,2919,742,799,3170,2325,1476,1576,2960,4480,4548,4166,4625,4,4593,600,4174,1561,3281,395,145,1798,4988,3284,5192,2646,3191,5299,535,1668,3301,2938,2729,2179,2601,542,2318,1327,1774,5386,4348,1352,762,4147,4614,4925,3866,467,2223,2096,330,1922,4812,3384,5087,160,5475,1109,110,527,2734,3181,4976,577,4263,4283,3420,4928,2889,2111,957,3243,2231,5307,801,1614,502,3120,397,43,1153,3537,1449,4461,179,2002,2914,4507,3504,658,1383,5258,2126,4739,3655,2010,692,2622,1412,2073,3104,3197,59,3920,1802,5091,3832,2590,1411,2700,620,4261,1516,4402,3429,949,864,1207,2472,4986,3610,1010,603,2346,2430,3149,5097,113,2099,2960,2805,2156,2897,4500,1347,1456,4116,2664,514,4880,3600,3462,3554,682,3945,901,1101,3684,1219,1162,448,4061,1456,501,3634,4938,2300,376,4138,1344,1099,1957,3371,3389,3645,986,5201,3815,931,3488,4104,742,2851,5328,161,1027,5316,3283,5210,4873,3606,4482,2524,4334,3069,5110,2665,4977,3027,5402,3124,934,1944,1602,4476,648,433,1489,3834,1663,2796,703,2746,1204,2575,5331,3892,1607,3587,4894,3623,2510,1138,2271,1318,3815,3123,4645,5462,3907,1380,2394,4616,3309,4584,2067,5057,2309,2030,3884,5144,1535,230,5079,1869,5047,3135,1320,1935,4582,2861,2515,4988,3972,3866,4235,2556,783,3283,985,203,3578,3702,3139,476,1218,3585,436,2867,2674,3950,368,279,1208,2400,2970,1993,2200,692,5300,4577,1454,4341,1254,428,2213,5018,4622,5222,1106,1366,4925,3265,3807,2296,3564,528,4997,3859,4270,5459,3713,4557,1742,4274,5434,3840,4479,2095,5201,910,4408,2885,2875,3132,5097,3438,2962,4787,2664,2336,1130,3077,1163,624,3102,4737,3265,279,20,2188,4227,3045,2755,5486,1234,3117,5088,4950,4766,1980,2951,4974,4881,5454,2318,1342,3475,447,194,3604,966,4373,3941,4815,1605,967,1518,2752,2646,1292,5465,5407,3559,4582,5208,1019,1715,3707,3781,3739,4408,4026,5126,4419,3910,1476,4257,4414,2899,4478,347,4146,2394,2081,3957,2535,1882,328,300,3875,4529,3749,5377,4889,3765,5457,4641,524,3039,4152,1904,4551,3434,1835,1519,1287,3905,2625,731,2315,5092,1519,4013,2927,660,4683,3441,368,5465,2468,4154,726,2267,2534,3151,2497,2830,3785,3197,3616,2057,3243,447,1480,2951,1300,5192,5087,366,273,3888,4647,3367,604,1060,4318,258,3683,1256,2704,5227,2696,3216,5061,5137,2086,2451,1696,5307,5077,4468,1965,2483,4110,4035,4635,2453,412,562,2496,4107,4976,3151,3546,3553,5287,716,1123,4578,4462,5428,4835,1633,4446,5401,4289,5225,243,4896,665,1604,4469,3988,1658,427,1677,4959,3096,3334,2003,2714,5461,3279,2154,2707,378,4108,97,4716,1117,687,621,4620,4855,68,3031,2690,1100,3077,2467,1749,5294,54,4869,1,5226,2210,2053,387,1538,2489,3133,4780,5512,4431,4055,5198,1826,2893,2427,3224,4009,2089,306,3811,370,3431,4136,1968,1234,593,1925,4747,3642,570,1384,1257,315,2702,1404,2896,2859,2941,3495,2766,1076,4685,4052,4879,2827,1751,1654,3748,5064,5016,722,1657,526,5394,2589,60,2394,2402,495,5417,3962,1823,564,4783,3643,4939,3180,1800,3282,1549,3244,5212,3057,2003,2424,2238,1277,65,3553,244,2958,3930,2458,2978,3890,4604,2333,2387,2858,2558,4165,3077,4153,922,3803,1513,5122,4151,5091,3034,1380,1428,5469,202,4889,2041,2657,3112,1117,2292,3408,1977,4072,2963,1627,1303,202,3811,1808,2765,4496,3453,4478,4780,5443,3466,3654,1175,4897,495,2962,4625,4510,4802,3606,1855,4901,2304,1086,1714,1910,2585,3891,2137,1929,3709,2738,2949,3197,1937,3295,356,1937,4055,3832,4248,243,4528,1514,3689,3013,567,2183,4901,4848,4347,1162,92,3888,330,3701,4198,3438,4543,1068,3855,1632,3768,2793,5174,1681,4670,1066,1283,231,2471,2231,3991,3196,1251,3257,1232,1340,1811,2352,3273,4796,5432,1729,4248,3447,1462,3301,2303,4268,3388,173,1510,4942,3912,3436,3319,4820,2791,921,4711,2562,2366,479,4647,228,2398,4696,4163,3485,4069,360,1838,179,2636,1595,159,5373,2603,1191,540,4527,4377,1697,3761,3432,3918,1943,2736,1243,4683,1967,3693,5273,1579,3176,3641,2760,813,912,1866,629,3517,2672,2927,543,4619,772,2123,4595,10,2627,1194,1470,3072,3605,2086,1848,494,1000,3000,5006,3604,1437,1567,1676,458,171,2347,4927,165,4564,2891,5283,5460,4619,1743,2613,3811,1801,729,4571,5107,1357,2966,1341,2823,5234,1663,3030,2363,3710,1231,5166,4523,1594,1504,416,1132,5274,3683,1750,776,296,2171,5385,692,1536,4119,5450,693,2266,4432,3132,3480,4282,649,1122,3869,1929,431,1605,4968,304,2477,5076,3322,1333,3978,1865,250,5265,5173,1923,3939,3738,1991,4105,1455,4553,4365,1064,3686,2406,3668,4675,420,4466,1699,742,3599,1868,4874,4071,3942,96,1449,2736,2392,5293,1432,2348,3292,3031,2371,954,134,1261,4572,4375,2951,4993,4725,2650,2574,1612,1392,168,2788,4881,1285,5395,4463,4540,286,4944,3867,2146,4256,394,2471,4004,2761,4274,620,4782,3602,1788,836,228,2375,1438,993,264,2107,563,3216,4110,5411,2993,5149,4731,1209,4178,5051,5242,1903,1381,4020,3124,3259,53,3795,851,5077,4192,3998,2011,3099,2311,1062,2606,846,2467,1755,4056,521,371,257,2623,5419,1059,1767,4671,1394,3294,1145,512,4191,2021,2190,4073,3344,631,2684,3306,618,4077,4976,691,3125,2243,1642,1961,830,5256,526,2250,357,4744,2826,4870,2587,81,3041,4532,142,1745,3894,1102,1066,4084,2270,1167,4598,4254,4925,3524,4673,3133,901,505,5184,238,2179,2508,3712,3877,2609,5356,1060,458,5126,4718,4835,4668,2826,5043,905,642,3861,3378,1056,3057,3623,931,1782,3537,4837,4640,2731,4144,1307,4707,756,2246,3854,2580,3870,4511,3968,1748,1767,1438,1789,4394,1523,4996,170,3440,1803,5397,4308,3656,627,2551,1954,185,4461,5310,4722,4057,5428,2639,4102,2516,5397,137,5378,1710,3763,967,3688,1834,1212,827,3174,4981,2650,379,3928,4976,3177,1647,95,3770,1630,2937,2255,2500,3692,3614,2072,3455,2487,2853,1784,62,3356,213,3061,1102,2885,4214,3384,4517,3877,848,4239,1986,4647,749,3259,433,2472,3491,4229,4817,1709,3929,2373,1640,1455,5059,3588,1619,4775,621,2646,442,554,4058,927,2040,1600,293,2880,1653,2676,3509,1470,352,3952,1468,3340,4259,4093,759,2704,3552,3739,24,4366,2074,2363,3858,4711,1054,3020,1496,2931,3319,2947,3412,4392,3856,4072,1136,5374,2218,3646,2599,1242,5387,3600,3086,3553,12,92,2965,1082,966,193,2357,3113,2725,5421,2200,1758,1832,1850,3938,3924,108,4930,3244,44,5455,1552,1846,593,532,557,3379,163,3583,983,3349,4788,2936,1448,3459,5161,220,4203,882,2335,5104,685,547,1008,2112,5109,4981,4878,1498,737,5494,3202,2248,1427,776,3087,3870,719,3717,2405,1798,4445,3520,1763,4779,3050,1749,3890,3524,641,4825,1404,4936,28,2156,981,3005,4909,4558,2425,3110,5375,4414,43,1741,2268,4763,4397,1174,4890,4312,950,3797,324,1869,9,2675,4436,4555,1156,934,3885,5497,712,1412,3436,3044,3128,1710,2392,4293,4356,4107,369,488,2947,1344,1082,2920,1136,4268,4224,1253,2534,5161,1294,2662,5486,1364,910,2131,2224,3237,2121,2589,465,4522,2954,5092,4492,3231,1175,2285,950,1287,2750,792,5180,4683,212,3085,721,3834,2104,1662,947,473,4367,3133,3839,2417,2900,1780,2494,3700,1780,4614,2753,590,2359,3820,815,663,1604,52,3580,709,4198,2678,2481,3425,2331,520,4960,3149,4852,5232,3389,1706,1963,4802,4248,3947,1645,5081,4551,2411,823,4672,3714,1247,3826,3399,4835,2338,4577,722,1891,2538,1781,2904,5434,1199,3532,4165,1968,3347,2285,2252,2134,2813,4147,3591,5087,3507,1259,812,3480,1445,4696,4907,4932,3786,1425,535,4819,570,795,281,1273,430,5149,4544,4986,420,960,2416,408,4342,5435,4641,1371,3787,4468,1326,1989,4024,4964,564,3394,890,5398,1684,5298,123,1610,3999,475,4788,3420,3115,5000,1593,4303,3640,1113,4674,688,2839,3707,2506,370,759,1535,3747,2616,2353,474,40,4459,4478,3549,5399,3883,3101,500,3371,5512,3297,1682,2381,1178,329,658,3862,4668,2261,2800,1285,4232,3394,2948,2865,5107,5108,5221,4061,2990,1242,3432,2481,561,1043,3314,5447,2388,4175,3169,1632,3137,3737,3424,609,4506,2128,2338,896,2321,935,4030,2536,1707,1431,3476,298,2759,4284,1036,4353,342,94,1466,3156,3733,5507,3271,3272,873,2683,2154,480,109,1712,5165,2528,1879,5404,5090,1034,3279,364,1880,3358,2107,43,558,3388,66,3544,1593,3205,3061,3398,4893,845,1402,1018,1895,2263,3397,5322,3277,4291,481,2653,1200,3877,2444,5075,301,1107,3851,2426,3612,4529,5256,4273,362,2032,1415,3806,1330,1024,4049,190,4949,743,4333,2922,5513,4792,2957,1995,4044,2553,461,3082,3343,4933,2948,2923,5001,929,5483,5088,2130,251,197,3904,2467,877,947,2070,3421,3705,3775,1382,4598,126,1579,3067,1451,1963,5001,667,1050,3791,1998,4436,1400,1273,2925,3209,1139,5402,1275,1532,4313,3621,3208,365,3108,4050,3876,3833,60,5318,5006,618,4656,4291,3223,728,4648,153,4921,2325,1674,1775,4787,488,5040,3808,1232,332,4033,3955,2903,5303,4767,878,2488,2703,2822,3548,3146,3060,5337,3077,3959,2404,5165,1860,4203,1053,1637,3968,3646,2576,486,3331,4092,4762,707,5113,1763,3642,5149,1489,2795,1446,1986,1876,3,15,306,208,2198,2265,371,5034,3553,3561,688,2813,4588,1454,2537,1504,1227,434,2483,4072,3447,2217,252,5321,4735,1999,2017,562,1523,1466,3593,4208,5198,690,3288,3176,1008,1930,5388,1403,5385,5519,3457,3532,2240,62,1940,2603,2725,5060,2061,2039,2595,5188,3228,5171,4665,3323,3491,5254,3190,4429,4732,1182,1488,1851,441,5355,1420,3202,1393,4933,4820,2333,738,2816,1209,591,969,1704,2535,3764,725,1591,878,2807,628,4591,3264,3107,2669,1541,931,1871,4263,2567,5053,445,4885,1322,750,351,2851,2046,5193,2371,1779,3415,3378,1424,4503,2670,986,2543,2632,2896,131,4048,26,3324,4421,933,3672,2317,4076,561,1273,3156,862,4959,1082,2959,1959,2699,2630,2015,2011,4143,2090,4543,748,3992,795,3312,781,183,2350,2921,4619,2820,2855,929,1808,3280,3649,4115,875,4095,1737,738,5523,20,4291,4917,1628,2723,3956,191,1661,2796,5454,397,4959,2712,4234,3338,2856,2101,267,4499,2335,4641,4552,1660,3121,162,34,3464,3629,1254,4624,844,3862,4575,4258,526,777,2581,175,4247,380,4591,1293,4967,1255,4262,2630,4089,1973,270,2044,3309,3878,890,3509,691,1477,2899,4365,569,508,911,518,1099,892,4535,2232,4014,4702,2620,1926,3780,4551,2710,5331,4998,1289,4476,4508,3301,5251,587,1386,1734,473,2723,2680,1435,1037,4462,251,892,131,3488,888,1110,3922,2263,1177,182,1653,1383,2078,5032,2173,4131,2758,1326,1033,2511,5056,1312,664,2715,2649,3799,2500,1957,1805,4386,3886,519,4335,3197,355,2326,565,2130,4494,4084,908,2069,3316,381,341,129,2389,4077,224,2346,5304,1061,2282,2841,2921,3266,4748,4942,1012,3644,3487,647,3944,884,4471,4748,4554,4187,5144,5226,910,4401,2411,3832,1709,3200,2187,300,2893,862,4523,5321,121,143,1493,7,2406,1856,5030,412,1014,2529,4646,363,4130,4166,1715,2789,1357,2403,3374,1310,1237,632,587,4889,3250,5227,1387,1762,3248,403,970,1935,4232,5484,3962,2571,1072,1882,2532,3670,3386,3844,3334,4635,877,1221,1517,3248,5424,724,4124,856,5210,3496,2507,5006,5511,2650,2475,295,1109,113,922,2568,4747,129,2242,22,387,5084,2760,3292,5367,5508,5109,4411,4690,4204,3805,2360,2951,2732,1589,1560,5390,2224,1745,644,1653,582,4041,1332,2770,727,1354,3643,2841,3848,1042,2187,1987,299,661,709,2269,1677,1306,3019,5303,439,2695,3115,5184,2140,3352,2182,2945,1652,2188,1461,3083,215,4736,4543,491,2786,391,3415,3833,1778,2235,5357,2520,992,605,5388,1778,4403,2684,4603,4215,4677,2597,3516,5222,554,4292,4353,3095,2105,5251,2826,1059,4509,5507,3594,499,2232,28,548,427,4542,2256,1629,2566,1163,5309,4210,1236,5331,2329,2718,1039,3770,5223,5233,1866,1335,4431,3926,978,3504,4661,258,4093,3635,4125,4577,5516,1173,4370,712,2809,1846,2077,3861,107,1470,1532,3373,1224,2906,2955,2190,1345,3985,2225,912,2538,5272,34,655,3912,3971,1097,5519,1258,2704,2234,3846,3343,499,4721,962,3042,4899,3646,4304,548,5005,4134,3088,685,3121,5010,2033,2833,294,2943,4025,383,4710,2302,4234,4416,176,1848,2919,4659,150,3458,3604,4302,3431,2150,672,2965,4197,4595,2728,2698,2974,624,414,836,3047,1543,1486,648,4330,2489,3599,231,1641,1519,3525,4483,3649,5025,3978,3055,4715,4635,478,1549,5516,1691,5380,2055,2659,2504,5365,2781,1431,1933,5282,3924,2043,1154,1435,501,1282,2071,3846,552,62,1610,409,3023,2419,943,2579,4424,310,2294,90,1900,1264,321,1726,5438,4947,4458,2072,1897,3594,5173,4860,3395,565,3147,2765,3172,3133,3471,2078,809,479,5265,4612,440,2420,3176,3367,5345,4667,5117,4665,2090,130,97,1033,3367,3121,1880,2410,1440,394,5401,762,4124,638,3221,4115,3221,3770,303,5179,3611,3117,5235,4678,5316,3088,198,4446,3549,4459,2245,3985,2701,456,4355,3886,2491,2259,1877,2021,334,2595,7,1886,3847,4814,646,3746,1648,686,874,2417,1505,1831,338,4770,657,2932,2708,246,920,1192,4459,1949,1227,426,1622,2097,2575,1281,3144,2030,1548,3499,800,5281,5370,118,4403,5153,4699,1262,2185,440,5292,5455,1959,3967,1857,2100,3283,2529,5092,4810,4641,899,3060,1268,2940,60,1281,1032,1676,922,2617,1294,1565,2174,3771,2183,208,5000,2859,3400,3336,4313,1507,951,1516,812,1058,3899,120,2623,2868,2199,4274,5464,3308,1598,842,4384,2683,1984,4793,5115,3408,2363,4990,673,1949,1604,1758,1567,2274,3293,2867,4967,1595,1936,1046,5134,886,5504,175,2415,1825,286,780,944,4493,680,759,910,1147,981,5235,2331,2315,4565,971,1084,1946,4342,87,2466,3331,4895,1519,5307,3383,1547,4955,2283,4621,5269,3898,781,5086,2486,2477,5467,4839,3891,879,3071,1796,4743,1425,1352,1924,3030,351,3025,2209,4354,3702,231,1518,1176,3796,3976,2504,243,5199,4515,1935,2091,2781,1756,4420,4189,1184,3590,1193,923,3556,4406,4563,4950,1765,800,689,163,1907,3800,4819,1018,61,5136,3474,5366,439,1397,3239,14,3735,4810,1933,4066,388,3326,1504,3634,2804,2103,894,4965,580,329,1391,2454,2751,591,2767,4532,1318,4785,5495,3808,2782,1266,663,179,609,3369,2254,2005,5101,2630,4195,870,5487,5472,3520,3591,5446,4064,2140,695,1249,5322,2169,426,1953,2646,4371,2973,3553,1353,4634,4478,3935,3293,5390,1610,1756,1878,4308,4346,112,3421,908,3373,980,3560,3819,4412,4575,3636,4269,2913,3121,155,2273,2327,1286,1021,4175,4918,3630,406,3858,3134,81,5254,3206,5103,900,1813,3195,4980,177,4969,930,1606,4363,673,4755,1144,4634,1759,198,3534,3529,4332,4100,3417,5163,1642,3641,2670,4156,3450,2663,3126,3124,955,53,599,5422,1158,505,1522,2170,4571,119,2739,3068,451,4704,741,4031,2726,3635,485,726,1043,4722,4095,4406,2470,4840,3672,4842,2633,848,1104,5273,3791,3484,4605,4389,1229,1052,4766,1791,3548,845,2970,2986,753,1363,4550,886,4744,3776,4449,1402,2602,4830,2839,401,621,991,5210,4861,5353,268,97,2117,4686,4948,3898,664,4430,4423,1959,794,1810,1790,2348,5480,3147,3165,522,3973,3859,4800,1213,3026,5089,690,4221,5151,2766,751,1132,2632,3737,3150,1754,2756,2522,3666,1568,3954,376,4433,2283,184,1058,2224,4316,5073,5488,3186,2665,1145,1714,750,2033,254,4920,5367,3546,5189,2466,846,5,3473,5236,2151,3885,5406,4697,1905,5292,3215,1936,3942,4836,2289,293,2275,776,4589,4532,830,5334,3194,3275,3030,1863,1428,1764,66,708,2463,2406,5324,1012,3265,1833,4890,2724,1356,533,590,5480,196,348,643,1036,1246,5184,3874,2546,3545,4077,2273,2562,4140,1583,2268,1337,1531,4043,538,5156,544,557,915,4904,4490,5173,3834,2629,3220,432,4373,2912,415,1425,1372,4047,1023,3160,4391,348,3479,4082,4984,4141,1273,4949,1873,5021,3756,2983,1088,1543,959,1025,5443,469,3337,5357,2344,2642,3921,1613,1856,3568,2241,4227,4527,2434,1866,3716,794,1168,5294,223,1350,5395,5150,1420,2051,4843,1846,3306,4630,355,4265,4892,3674,2010,2147,2336,1980,4964,783,4286,3916,2453,2188,5223,5502,3279,2673,858,1386,5229,4511,237,2434,1135,3855,148,180,5445,4501,5340,5091,4038,4731,3916,3082,1010,4053,4112,1393,5327,999,4903,4983,3929,1563,2847,5139,2917,683,4018,3539,5055,4595,4004,5418,2716,4718,1710,5304,909,4701,2688,1017,49,4468,4457,285,3391,3986,5396,1535,5246,3901,4297,2718,1334,82,4571,2517,574,4127,5307,1401,2147,2778,4272,3376,2075,3522,3781,1155,4937,2787,1795,5288,4885,558,4750,4742,5325,2774,1829,3388,3962,4549,2473,2027,2781,1682,4333,3327,4924,3118,1811,3603,1398,1659,4948,3541,2210,1168,2678,673,424,612,338,3205,542,5102,550,499,144,2553,5271,5274,1550,5445,2608,1492,4436,1042,1140,1076,3306,3826,4965,4789,1549,4783,5057,3670,1496,924,5191,5146,2636,25,2891,2675,1611,5237,5278,839,4549,3382,3947,1363,5069,4245,4346,4826,3547,2068,737,4105,2059,2611,1394,3735,1836,4615,5411,4000,4254,2471,2457,1907,2629,3522,3706,1436,5359,18,350,2234,227,366,4480,2761,5270,4702,4083,1872,4548,4257,1658,1178,4930,1613,1177,4965,249,2256,2456,1014,4253,1254,1174,1632,986,3578,3351,671,2739,112,2953,482,3763,4502,4613,3920,969,494,1340,1011,2655,2634,4984,487,5313,5349,3208,4842,379,5329,1211,96,4036,2406,2863,548,1365,2271,404,3920,1451,1664,2510,5149,1570,4844,5118,5169,2662,2889,5489,941,717,2728,3474,4759,509,5513,186,1140,5224,758,3225,2915,1739,3570,1648,5135,1909,4764,3430,3645,2386,5342,3072,5334,3538,1039,2558,4083,5297,3148,1199,1751,855,2073,3397,4724,5498,1479,5438,1935,1315,4912,2127,541,2535,1183,4751,3510,4378,4853,214,1745,2382,404,379,1564,2398,4841,4020,4127,1478,2078,1043,2413,2900,3998,1678,4485,3796,1090,3323,1248,513,854,2464,4408,2067,682,4944,3205,5434,3719,4388,3559,1564,3914,4822,3787,3679,3148,5437,2000,618,3823,4894,718,5165,4996,2965,5244,2808,3531,5439,569,3229,5463,2054,851,285,5325,1289,4512,1446,5232,791,3038,1872,5017,1306,5497,4815,3794,2536,2391,285,811,2388,206,4392,4132,3512,1675,4064,2818,743,1751,2989,1060,103,4259,2295,1299,5309,2350,5057,1045,1468,1023,856,2100,1199,5070,77,5514,955,1928,41,2808,3157,2833,5315,2823,3988,4999,1443,2604,1241,2907,5414,346,148,3686,2837,5311,911,1007,4039,3923,4416,4204,1746,4036,4849,2841,1771,2295,444,2090,315,3300,3210,1862,4971,213,4682,196,2234,2807,32,498,68,4513,4331,1016,4467,2388,4876,1541,3381,3455,184,786,4954,2066,1284,5146,2261,4316,3346,3859,5041,2603,3563,3705,2641,3517,2797,2971,514,5487,4822,3210,2473,4913,3983,2455,5416,2998,3825,256,3361,1550,5,2147,1755,1443,1277,3291,471,3060,4632,4282,659,4223,457,2040,1278,5078,3230,1997,3614,1728,1638,3026,3838,5000,571,1528,4194,2247,2723,408,315,2341,1113,1784,218,2019,5052,1869,363,1004,55,2956,4607,4242,4837,4890,3948,1811,33,4640,1951,2787,1272,914,129,4898,4480,3730,2510,559,3881,2828,2490,2460,2121,1497,3415,3245,1907,1976,1747,3271,2679,1006,399,5396,5024,4467,5433,5062,4346,2363,2942,3242,4628,2697,3952,2174,2433,1467,2479,4841,2394,2128,4279,1615,961,4851,3728,3309,5423,2317,1583,4996,3661,3424,4613,1059,2959,2678,2960,2135,5523,3300,517,1230,3822,1578,1859,3622,687,183,2448,2778,1714,2206,2460,1084,1244,2981,3140,2504,3561,5396,824,83,274,150,2452,3935,1833,4736,2674,473,4089,180,5333,850,2036,3831,2141,2292,857,1762,2836,3738,3249,1901,5175,2486,3562,1381,3325,2755,3474,3995,1392,2181,618,538,4353,1540,4739,3060,651,4902,4910,1702,2326,5239,1586,4552,29,260,664,2108,4725,5134,4593,3627,2323,4870,2340,4452,2086,2315,3109,4116,3534,3310,2907,1239,4421,148,1738,4083,3337,819,2589,2627,4046,2629,939,4674,945,1628,2175,5166,225,5296,3869,4567,5095,3242,3602,3130,4477,3305,4270,67,1674,4307,3803,3628,1148,4307,5011,914,3093,4186,2621,1678,3203,1089,2075,1946,3106,2823,4009,1650,1929,5331,3707,1487,1221,2858,110,2452,4381,1424,2076,5132,4231,2722,164,2410,5336,1066,316,53,539,823,1557,1910,5254,1452,2354,73,4552,1003,2259,1249,5518,2716,427,5486,4058,1655,4015,949,926,5414,4530,3713,658,1052,804,2137,2985,3762,3842,5441,1727,3604,1786,2210,2785,1079,1453,97,1341,351,2404,1598,4805,5358,458,5285,2965,4980,5440,2514,661,1954,1510,112,3839,1979,3411,5229,4140,2875,1550,4598,920,3787,3750,3873,4322,3873,5270,3278,1644,4332,3580,5075,1825,2345,3068,1007,4618,4800,4987,1573,2532,3110,880,3085,333,5403,670,2923,4369,176,1347,398,1157,3386,5087,2512,2213,4949,4712,2588,5333,4355,3238,1585,1706,764,1417,2465,2193,997,5258,4664,1969,2868,428,4313,3418,4893,4327,5420,5522,5166,1433,4540,4870,2217,3620,4414,579,4122,2389,2631,4767,4015,2244,1410,5175,1259,4611,2861,3677,4545,4560,467,2245,4908,5169,5522,234,3889,2211,4813,5502,441,2580,4911,816,1771,3010,308,980,1052,3581,2300,4652,130,2417,1041,2013,2802,736,4819,1444,4210,461,3574,4161,2285,1062,3787,4363,2746,5085,4081,762,5078,5182,4146,2683,4188,5113,1961,292,3859,4234,837,327,3310,5379,4343,1157,3258,2916,1999,5044,3689,3121,1807,4990,243,5405,316,1982,992,3130,562,1804,4955,3407,1210,3129,4275,5341,3382,743,2808,1475,167,2575,850,3248,2532,3525,4132,3342,3830,4932,4333,4029,1925,789,3382,3354,4339,2785,1961,3364,3658,4585,1965,2555,4589,5123,763,2305,470,5424,4909,4486,3360,1164,3911,4146,3969,681,3544,4305,383,163,3960,2085,306,792,3467,352,2788,4561,2484,2751,1226,4855,2349,3304,2034,372,2542,3892,2692,5208,2266,4140,4150,2428,3670,856,2423,5166,3332,728,5129,2846,510,3088,4228,1665,1915,2778,1113,1426,385,3303,5286,2247,5290,4140,402,2197,1198,1632,3190,2958,5491,4500,4504,285,3677,2552,1502,4470,1336,261,1526,3394,5347,332,2039,2738,48,3773,706,822,3379,911,4846,5141,704,1585,3536,2309,1244,4739,4417,878,4914,268,4658,3416,70,2191,4886,3082,1205,452,3091,3854,3001,1890,3544,3661,5227,5312,401,1867,1622,1162,3890,3704,3378,4861,593,3686,2918,5265,1023,2483,1773,3424,3219,2900,974,2229,4931,3730,2758,739,916,4455,4070,2789,271,3019,4828,1012,4109,50,373,40,4761,3914,1951,4712,1557,514,5399,3909,3082,4856,1691,1754,529,1298,3024,2917,5337,4390,680,4990,2458,2384,4650,4085,4331,930,3333,4097,340,5520,5249,3981,2850,3487,41,4727,2419,3220,2966,4548,4645,3472,2873,2948,2428,5113,4753,4066,781,3574,4342,3403,4128,2805,1448,5147,1444,5411,223,737,4486,3736,2512,4191,369,3774,4508,127,4746,3526,406,2468,1341,2744,4888,1325,4369,2566,690,412,689,2137,4632,1975,4243,4710,3316,5419,1290,482,3841,2662,4622,417,2115,3116,3870,3428,456,3147,82,5341,1125,4970,2411,5187,3098,3844,3708,4217,2771,2657,1264,5463,346,4514,584,1907,5367,2314,2548,680,3195,1287,4027,2141,3527,4504,4972,2080,3573,3762,3813,3514,1401,5270,1853,4840,2069,4413,1739,4057,2070,3334,2047,32,1822,584,596,2780,2844,12,3185,4530,45,4361,129,4854,5419,4758,3626,4691,2879,5488,51,3339,434,253,4966,3145,4348,5489,3868,5045,5492,3519,4332,4315,2139,4374,3796,1204,897,523,3854,836,2715,3505,713,4060,1554,1381,1933,136,5140,4580,2027,4432,2746,4598,4540,4553,506,2144,1550,1632,3634,250,1767,4704,850,2853,4978,2471,168,1147,4401,3147,1120,1051,5064,5099,1750,1184,5158,215,5173,1772,5124,2027,5124,4937,4086,2228,4847,3234,1655,4658,1585,2783,125,2071,1380,1462,1596,169,3683,2314,1003,4779,2438,2508,1843,1616,596,1171,5204,313,3974,2726,4708,4749,3116,5211,2733,356,2136,4571,77,1058,2270,28,1622,2302,3870,2801,4603,386,1090,1925,97,1857,1901,187,892,3640,375,1715,4767,600,1093,3442,5410,5422,1804,2428,1740,3540,4285,2703,2341,4571,2571,3950,4799,4925,4703,3200,898,2538,221,1567,37,4324,3128,184,3981,1358,1536,195,3075,4928,5054,1808,4454,4131,4171,4271,3427,382,818,2013,3275,3601,4659,2988,2478,2138,3652,824,2716,4128,2830,3774,4987,5518,1073,3914,575,4744,4643,258,2448,3002,1454,653,3445,3801,3489,614,4856,3437,563,1906,5056,354,357,5491,1903,3173,3304,910,400,4421,1393,4947,590,4398,2727,1247,5013,2154,3846,5179,4233,1802,4255,5376,3324,3703,500,3485,3908,3637,3100,827,4842,5337,3994,2158,2147,773,1085,2514,2722,2499,4767,1488,4090,3412,1004,2100,4448,5294,4925,3897,4349,1271,4678,632,3537,1482,4583,456,4897,3274,2208,1995,1191,3435,818,3802,750,2411,2887,1567,5479,1147,2055,4971,874,3276,2053,3543,2341,3425,5199,4319,2184,4902,2073,5290,5215,4145,3131,3836,3627,867,675,311,3641,2730,1208,1273,4861,701,4412,3557,4789,1913,2830,2529,220,1557,4066,4954,2467,5480,3198,498,3399,544,3886,1731,2640,1580,1355,885,5512,3217,812,2117,4810,3591,4449,1035,5511,1261,921,4150,776,3840,4992,1699,1488,3033,5078,3290,189,3908,2074,2993,5425,4641,1864,3500,1332,3296,3538,1362,255,32,3274,66,4786,458,2316,1942,1157,2850,1148,3146,2873,1841,2581,2830,4898,4430,5441,5451,1160,3644,4626,1121,2099,3592,1556,5184,3578,572,3139,4961,1075,4278,1566,2557,4463,3198,13,3255,4474,4079,1287,883,3869,2150,1342,753,2455,660,4774,4527,1475,2597,4605,4790,4825,5263,4134,1331,591,5125,3248,2777,1304,4114,3783,1344,4567,2188,1233,4959,4324,781,1088,3651,4876,3344,2803,3332,2686,891,2030,4241,3058,1693,2696,4971,4126,1108,3505,4620,4626,5321,2911,5471,411,2530,1260,2411,890,2679,5442,1132,34,3459,472,506,353,2164,626,1870,2445,238,1796,3784,3233,4993,2759,1637,2249,2389,254,2750,474,3563,2294,2532,1835,1897,5334,5220,3087,3442,3165,347,2553,1679,4246,4178,4308,4190,1042,4730,5468,4817,3810,2242,3823,3951,4955,3002,96,4591,726,1987,4296,5364,4184,2631,1013,1228,2696,1419,2217,493,5179,1437,81,3117,2899,4521,838,2595,197,2146,5498,1280,3360,4808,4739,4504,3221,4519,5173,3708,658,3401,5508,2010,1216,3878,2509,4631,3789,5022,275,5421,1690,2660,1437,1616,122,25,3228,2193,1013,2179,4032,416,982,2445,133,177,752,4860,3597,980,1017,5257,2784,2536,151,4426,4986,2485,3220,36,1039,1633,2484,3682,2264,4192,1798,2706,355,2720,578,3708,5362,1503,4303,1468,3970,833,4018,667,5012,684,966,750,1918,2078,4124,3390,2487,1274,851,1573,4806,4508,1705,4082,4676,5395,853,3207,3966,1462,3707,2101,0,4534,3503,247,4677,1323,3436,64,3210,3927,4525,3036,888,915,2141,3387,2681,2819,4437,1344,205,2356,4389,4265,623,550,120,1373,3509,935,4269,2175,2731,2037,3518,3909,4715,3143,2643,1355,1968,259,1660,4340,5340,2827,4689,4810,3623,775,1239,4779,666,4525,3668,838,1813,1142,2531,490,5394,225,5073,5045,1884,4363,63,4289,1269,620,132,4260,465,497,4369,4742,1965,552,5063,3968,3863,3186,1570,1753,1466,1532,5195,250,2851,1045,1545,3589,366,315,4507,4569,3728,1359,654,4105,3110,5359,4606,1466,5425,168,5238,2627,1228,480,5278,1966,3565,2074,762,824,3707,5027,447,5204,4497,3212,3094,4086,471,3202,3576,1285,2390,4266,1262,3889,3079,4155,961,3584,2567,4088,4383,3743,3379,595,2578,2045,414,3300,1404,5006,4267,4858,5165,2799,672,4916,2661,2332,1884,4076,5496,2780,737,1871,1438,5518,1002,854,1002,4705,1445,4829,1881,2223,2003,5040,3080,541,714,2670,5512,1969,3752,4760,1533,2188,2620,3000,2502,3763,2623,1572,1861,1416,3018,2516,3517,136,5383,2699,1576,4750,2757,5134,3288,1412,3064,1982,1879,5092,4737,2909,4814,325,87,738,2129,3433,646,518,2294,5338,4214,2277,1698,3207,2174,5124,529,318,1593,5036,3383,3730,5153,5330,3601,3302,381,2156,4548,5020,5240,2253,3705,826,2200,3490,4390,1826,3917,561,4592,4939,816,3719,1216,571,5197,2336,1770,1867,5101,4100,1646,224,3990,3944,5376,3588,4898,958,1870,3397,1935,2789,1380,2337,1682,5424,3780,2908,3310,1211,4972,291,3211,217,2190,3792,3575,3154,103,3194,2567,4458,585,1889,4750,4486,2145,3678,2437,5046,266,1699,847,3334,2959,5108,1833,3623,5483,2044,4541,2492,996,5143,12,5147,4846,2148,836,2728,5150,3552,1626,5220,5365,4886,3210,4490,5183,3156,4324,3212,1325,4403,3397,5118,1129,5181,5439,388,1289,1332,2276,2459,157,212,795,1924,2235,5432,4941,3923,1288,3468,3663,3176,4645,3106,4925,152,264,941,583,1077,1277,1823,866,5026,1394,26,4012,2225,5278,3263,3783,2066,2932,4875,3319,5390,1173,3235,1590,832,2625,5272,300,377,2598,1829,5087,5465,4442,1157,982,418,3506,113,3215,398,4854,3694,2467,28,861,1841,2241,1514,214,4207,1793,5158,3948,3618,4479,4869,3355,4045,2136,2674,1998,5096,3316,3155,731,3471,1227,4757,3901,3131,3693,3826,816,4389,2705,3339,612,40,4936,478,960,5465,3848,2069,4699,2977,3626,3847,1212,4686,3845,825,4290,3239,3221,4832,4947,914,4899,3544,1596,746,3675,963,4677,3263,1062,3658,409,5331,1247,2136,2237,4240,4948,428,3449,3026,2549,1368,1083,4227,3717,3904,3001,5141,1007,4510,5351,3653,1138,3324,3889,5230,2856,0,2620,3767,4612,2385,2807,4517,3997,1503,1978,3070,707,113,2953,4526,4506,1007,1066,3687,1658,546,1612,2170,2357,5259,4728,3518,891,1600,2900,5050,2448,983,3730,665,3483,4886,1446,1383,2721,1093,639,4107,3768,154,3062,876,3169,1275,3073,731,216,2545,5071,246,2475,5102,108,3474,4094,4205,11,94,535,175,4213,2221,943,4944,4946,4232,1355,4326,1007,4117,4100,864,4322,4491,2251,5171,4093,2120,2181,2655,2261,1847,3176,4171,5058,4636,3477,4841,4596,501,1010,4742,3354,2117,428,93,1031,1206,1381,3842,4555,1829,4480,4047,1249,965,5083,5139,2387,1076,4328,3096,3346,52,2193,4493,4353,3029,5288,4167,2553,193,4888,3034,3954,789,808,155,2130,5224,108,1512,4718,5017,4800,69,2153,4325,3653,1911,3922,3464,1557,4727,2186,2998,1064,31,5208,5261,4549,2587,2029,3212,3578,2303,2219,3427,181,2433,1442,1249,5420,1282,3577,1348,2397,3379,2534,1668,4659,5118,3525,580,71,1889,3724,3975,801,2408,3214,3462,825,3919,214,5343,4511,4110,1695,1564,216,2184,3292,34,2695,4472,4897,2827,209,5471,2887,1945,1372,891,4387,1511,4005,580,2421,4541,2611,1934,2305,1846,1898,2821,2457,373,748,3936,5332,4921,898,2641,1436,4856,3822,2837,4661,4665,1885,1459,3178,2085,3036,144,2585,4621,1681,5314,3895,1052,2813,3915,3956,2990,849,1907,3021,4386,3563,1486,2470,273,5306,5230,1249,2927,754,3706,2637,1431,260,5326,713,2430,5128,2747,1396,4052,3234,1102,997,4122,1820,2560,2495,2792,4965,3506,2190,1203,955,5300,2992,3806,2573,4377,5047,5381,1108,2378,5204,3280,3838,2430,349,5166,151,3810,55,2051,3188,3120,242,3640,2127,999,3806,5050,4101,1130,5224,2191,3170,3886,757,1507,1269,4943,5344,5454,3133,49,568,2192,3442,3483,4918,1000,2525,4354,686,2117,3009,3751,567,3413,4299,1018,2869,5143,446,4298,1707,3589,5471,3583,4159,5283,143,3713,213,4950,4194,1710,4130,775,1274,1126,3139,5430,3254,2433,1520,338,2739,3403,2108,1070,115,5054,2219,4307,2813,1480,257,85,3192,204,4153,1549,2147,3325,1143,4784,980,2719,800,1180,4528,4438,2181,2278,2839,2096,4599,3288,5218,3119,2813,2718,5165,3403,2631,3168,1566,2872,4467,1687,53,4119,1259,5426,4152,2972,3708,1784,3240,3884,1697,79,4766,3517,2784,1522,3963,985,3876,2676,1928,4930,1363,4757,1175,3835,618,515,3886,554,1367,1532,1079,2474,2555,3526,3941,5503,3177,3828,70,3117,2149,2658,1701,3853,640,3376,564,1316,4865,4313,2258,3656,4828,175,29,1765,4878,3806,1308,929,1596,2333,1468,2153,4612,1029,3877,1554,4746,3862,540,4415,1407,2811,4018,5003,880,1753,2509,1746,3966,5229,2739,4086,175,3871,3614,5285,5512,4102,2770,3517,2100,4430,2239,919,4624,2209,4343,1243,1598,2466,3529,2207,1294,3446,2732,3681,3981,4950,3719,1754,1820,5275,4173,3003,3879,2227,1198,853,3453,585,5210,608,3788,856,4866,1239,836,4439,975,3004,4740,5021,2892,1425,863,5184,4850,1814,720,99,2401,51,220,5276,3081,1055,3954,4386,5396,1542,3033,448,1892,4678,1431,1081,1781,4468,4155,1859,5366,1901,4957,349,5284,2519,449,3651,2999,4545,1991,1661,1653,3665,5007,1978,4241,3614,2695,358,1081,4344,4024,3208,4351,4649,3705,5433,18,2981,5273,1130,3797,3417,469,1011,1746,4619,1752,5371,2202,3175,3680,1486,321,2261,2061,1459,5317,4769,751,546,2299,264,3708,255,3768,3939,940,3904,4124,1565,316,4646,4427,981,721,2431,3237,3240,4982,4023,58,1585,723,3461,908,4741,3185,2869,1965,70,1524,2567,4185,5415,1471,239,2385,1913,2292,414,5394,931,3226,2021,4532,3188,3365,582,2818,3770,1443,3827,4814,3223,5249,4611,1926,1683,3822,2464,4711,1487,4275,2,4635,766,2806,1207,3900,427,4223,3387,3517,3292,142,2673,4004,610,2534,979,1790,2525,3340,3269,916,4347,657,2337,5128,2192,644,4119,5472,1861,4975,3509,1626,162,476,1288,3264,1463,724,1243,3958,5239,4853,4862,2900,3499,3825,3137,1991,2069,4435,1849,2700,2230,4964,1038,3041,4546,5061,1199,4304,2107,3941,2404,1455,3083,4423,5502,2628,1191,4268,2580,2058,1768,2273,5220,3428,3983,3485,2390,902,3869,692,3594,2674,5159,4026,3209,5376,2044,3984,3590,5166,5468,3561,2924,2106,3719,4542,3561,3585,1344,1469,2589,3781,1798,4899,5319,3531,3162,4087,3981,3873,3203,5122,2454,4077,4905,3760,3692,109,3302,984,5305,5149,3702,588,1734,49,2039,3617,2515,1426,2123,5226,3026,3842,4198,473,3136,4973,671,3,3016,2352,61,272,4846,103,499,702,2075,3578,3519,3860,823,534,4074,477,3410,318,2056,2798,2684,994,3199,92,2600,4891,3878,5325,3874,1276,1060,4869,2412,398,4488,709,297,1936,57,142,1376,2013,101,5391,521,447,552,5469,3363,4537,3311,1408,2392,286,2300,2899,4630,4912,2650,5200,499,203,1720,3959,3527,3884,2301,95,152,1268,3241,1415,5312,653,4232,1505,5519,3717,606,93,270,5508,5138,1967,3677,146,141,1082,2473,3249,393,2887,179,4790,3974,1242,4684,1182,692,3943,1633,1899,3240,3514,106,4453,4496,3054,549,4111,853,3838,1001,1434,2856,729,5034,1181,4845,681,1316,4463,3039,1577,91,2610,1397,3036,15,3328,3032,2428,2336,3983,2606,5523,364,4927,1938,2257,4060,2447,983,5060,4055,891,1330,1263,1393,82,4273,3445,2798,2505,2867,168,485,4846,2610,2271,4822,2624,726,5141,4351,4055,5287,3296,2936,5514,792,3054,1979,3461,5117,1723,5262,353,5461,1348,3729,4149,3642,4782,2788,2165,3591,748,123,2168,4069,3176,1751,2864,4399,393,2670,2482,3851,4199,4055,2387,2031,3037,3662,386,3967,2434,3306,1518,3983,1954,2695,5466,1968,679,3072,860,3020,4378,2085,1081,5084,2738,4052,3968,5122,3023,1809,1310,306,5331,885,3490,1874,5231,4735,2122,480,3529,4876,4440,1905,1048,3816,2838,2446,3106,2992,2633,1257,2574,304,66,3649,3290,4989,5046,721,569,4818,4341,2039,5260,4402,4944,876,3504,3524,3042,5061,5042,5452,791,1573,23,660,186,3063,4498,3505,1122,5460,1966,4535,4594,1665,403,2706,889,4079,1783,1254,2,1036,5397,658,380,5377,5224,351,223,5187,1922,3088,4019,4318,183,3005,936,757,1890,1740,2160,1266,2667,3249,3766,1487,2948,1515,5394,3695,5327,1525,2188,2148,3224,4280,5116,4163,5516,4680,509,4820,5503,5176,3475,4415,2570,1256,1009,5439,9,1104,463,433,1870,5167,1905,4744,4029,1812,1211,1983,4281,3982,4650,4445,4520,527,1516,2839,5206,4805,4328,4051,4076,2396,1156,1575,4024,1457,446,4837,3876,3751,489,5523,4850,2743,1724,4281,1798,1452,4137,4738,959,3649,3489,4776,3537,5369,3574,2415,5179,5423,1881,3253,1512,1204,3548,4863,4368,3473,4554,4308,3403,5163,1033,3015,2357,291,5268,809,1169,5094,5141,243,4442,2567,4346,2593,4135,763,554,1410,3178,3715,728,1706,3736,4175,2623,1221,5185,4586,1832,4791,4169,3251,4941,899,1506,3475,1223,4222,1279,4513,1497,1879,1697,4465,615,2637,4420,3606,1172,153,842,5505,2397,2791,1301,83,1010,325,1003,985,362,1011,4072,5273,2806,1376,4948,5079,2286,3388,87,298,2373,3973,436,238,1993,2353,4889,2520,157,3528,1576,4934,539,252,5442,4537,4991,3992,3605,3201,2567,1289,202,1784,5070,1117,1110,2976,5368,5502,4958,5155,556,2686,473,955,2566,3198,2627,2527,3271,3005,223,5306,3467,43,2060,3021,4816,4493,303,4098,5437,656,1551,2135,1324,2072,1175,1661,843,697,2588,4243,299,2606,2673,682,4376,5046,3977,5301,4430,3020,5002,5249,1919,5175,2628,4238,4458,5317,4855,3118,4619,2529,5193,5458,4571,5374,1744,209,4670,2825,2340,4587,4383,5242,5393,3136,5193,5044,2309,5506,3810,4417,2368,1864,1223,616,5229,657,5025,527,2386,4950,4688,5308,4725,2933,3443,2283,2381,1937,727,1430,1162,5219,1403,2235,3907,3135,45,4288,1695,1643,3856,3952,1980,3112,5117,5506,4776,240,3296,5135,1830,5495,318,1823,2905,4251,549,1604,1509,874,4533,5117,5401,2487,3062,1881,1326,2740,948,3906,4008,3196,80,1353,4127,982,82,607,5287,1235,4467,2464,526,851,5100,4689,2890,1620,925,5368,4700,3780,4864,3791,5434,4725,2095,2492,1351,1146,657,1234,5512,511,4050,1752,1925,4416,1801,436,3666,3860,4991,4957,3187,1598,3573,3583,4472,897,1171,3612,311,3558,4589,890,36,131,1151,281,1331,2663,1311,1274,1653,2214,2766,1030,2718,4223,4851,3121,3712,1609,1638,488,1741,713,1194,4951,4145,1068,3742,1521,5217,1779,306,724,4766,4558,4541,5053,5433,2085,5108,3148,4475,5049,5105,2650,4170,5350,632,2326,2339,1957,2650,418,3885,3133,2794,2802,1494,1943,2758,1349,3673,3825,5386,427,2925,1216,2741,3605,1577,2804,5435,684,284,4391,723,3515,2914,2797,482,2204,2068,178,4814,2516,2282,3052,4510,719,5086,1562,436,5453,5306,2207,3605,2417,1472,3774,3731,4510,133,5012,1413,893,4292,581,3094,3400,2901,1777,3604,1869,684,699,1847,1279,429,1050,4581,3176,3775,4226,1628,1050,2527,5122,4369,5211,4873,4830,2705,3454,2885,5504,4420,3804,3333,2673,1284,2715,3560,3510,1130,1422,4787,5490,2581,361,4743,932,4918,2790,4318,2542,1886,3789,360,467,2683,2239,265,852,4464,4674,3916,1371,673,1089,2046,2839,2457,2747,1978,1612,5435,4895,383,4277,244,3349,2397,2351,131,1481,3293,3304,2244,2407,2874,1333,5318,383,2773,2820,1394,5370,571,4679,312,3939,3652,3196,629,4439,1329,678,4387,5518,3311,5099,4075,2402,5415,4719,4140,3454,4326,617,1414,3513,5323,4111,1794,393,518,2661,4313,4198,5017,1423,5150,84,1739,4174,1801,198,761,280,655,1007,967,2088,3414,1693,2676,2926,2202,1911,749,378,3328,5362,5100,286,2697,1190,3183,3155,141,2974,5053,4508,5,4157,474,2523,4892,5,3868,5307,3192,130,1179,1478,2492,4393,4253,4357,1161,2473,2684,1807,3042,2407,1521,1847,2737,2959,2342,1886,2799,4193,659,2316,795,2794,3950,1913,4604,394,366,4509,4799,1654,3359,2874,5135,1730,2858,5506,1076,1995,5144,3688,4998,855,2120,4189,3920,2526,4526,4297,1169,3126,1359,4264,5016,1019,1697,1796,4742,916,3142,3677,4238,2037,1622,151,3215,4359,3255,3734,1312,510,4471,4955,1882,1428,1642,25,2050,3298,1964,4368,2446,2179,2995,1177,5405,545,4820,1945,2688,2667,3850,4264,75,1931,3246,988,611,83,243,1239,1427,5297,4671,1924,262,2887,4350,1517,1229,1582,2659,4732,821,2596,848,4056,342,3717,2819,695,3698,671,4991,3666,3248,1349,822,5333,1658,3312,4979,4881,3457,4089,1597,2501,5470,2112,5504,1469,576,1580,2119,2282,2734,4607,605,2207,270,2591,4851,1549,2324,3994,4405,2318,1812,171,4718,4274,1590,436,2478,3652,375,1468,836,4703,4013,4124,2431,3947,2760,5378,4252,2678,2163,2441,3514,5191,4706,2262,4235,2473,5074,3774,2131,4450,980,3483,1331,3654,4446,1781,1510,5298,5014,1872,217,1641,1391,4918,434,4729,4204,3549,3688,2188,3990,2063,2053,2430,1186,352,5417,5012,3936,2266,1641,3224,1410,4533,3812,3034,1835,2456,5369,4233,564,4481,3537,4182,3668,4396,189,1092,3286,1063,2190,422,5429,3987,5116,4428,5214,3286,3047,5240,243,1892,3398,968,4701,3471,648,2932,1808,5059,1910,3414,4486,2055,5093,982,1466,829,1700,3473,876,2190,1423,2885,2051,4624,758,2361,776,5500,3573,5474,1757,3763,1542,3324,2285,3626,3034,3057,867,1790,4783,1236,4116,3585,5132,3447,546,1103,5280,731,4139,4196,1354,24,4269,3185,4374,2193,1367,923,3162,3097,4994,4388,4578,250,2125,2953,3441,4617,4183,810,1261,2050,3448,4093,4814,1897,809,3161,140,359,4377,4378,448,3037,616,4336,962,1430,1745,1667,2850,1494,1569,289,246,1525,252,137,2398,1474,4574,346,5484,3511,3047,4269,4742,3028,1364,1101,191,3992,15,4583,5000,2729,5211,3292,3356,4636,3689,869,3887,4196,4751,3254,5236,1131,3683,3695,1918,487,3950,2292,3923,3832,3420,5491,4554,4678,2425,2986,662,1965,4782,3463,678,4471,1544,2764,4755,1363,3701,926,2129,2379,1948,1452,5181,2108,1111,1150,5122,3294,2486,80,1542,1894,1588,2435,4570,2453,983,2477,4749,3729,3766,2090,3336,3364,464,3116,2542,2885,297,2149,2128,4459,2757,2969,4720,1166,1849,84,1936,1725,1790,3901,2501,3677,2715,4140,1395,1342,2789,2995,619,1293,5500,4011,2272,2544,2678,3944,1287,1602,2520,4594,544,5264,2447,4642,116,337,2067,3325,4659,3041,1014,134,5041,2943,478,3618,4235,4427,957,3305,46,4408,3422,1738,5309,2512,520,5498,5079,3822,3060,5247,276,4641,2993,4815,3931,2365,4885,4274,5246,4343,3946,3369,2193,3367,3633,5346,1826,2022,3186,614,710,1674,69,989,3032,2585,4077,4835,3145,4929,4816,2096,216,5340,742,4141,1719,4281,4258,4897,4333,4510,4285,4308,1771,2603,3287,1652,2247,3474,5227,3030,4016,3905,4430,2863,2447,4782,2742,202,5399,1857,4429,2559,217,4847,3459,3796,1863,3921,823,5049,2725,1807,4786,2207,1627,2241,133,2623,2309,4914,4793,2072,2827,1402,4261,4860,1075,346,2183,2351,764,2399,454,2709,492,2923,2184,3949,2232,4681,1092,3776,2221,4795,3779,3264,1567,2300,1002,888,3747,2595,4899,2276,5359,2847,3999,1312,2809,4553,4878,4932,5067,2057,805,4355,1602,1297,3512,1962,2458,3768,3251,4217,1105,5192,4587,5368,2290,5353,4776,2723,2511,2282,389,3013,1936,2984,143,2010,378,5429,5374,4426,3464,2480,2554,5353,1106,152,4869,5369,4797,4511,2932,1068,4650,4827,1384,690,3272,2091,2966,3682,4449,752,4035,797,1042,3272,4548,586,2442,4923,2630,2676,2678,2751,2630,5179,3346,902,3799,4333,266,2787,1997,266,727,5137,1184,2815,1457,1690,2203,279,1327,862,2797,892,2566,1524,1273,509,2197,956,2475,2685,3424,4040,4799,3481,2040,3115,246,3773,2065,2290,3232,5132,4455,4605,3876,4116,3816,5198,1181,3530,2786,1104,761,734,89,4181,4947,2915,501,4858,685,3212,1358,4662,3351,745,4917,2897,2626,2677,5257,1248,2246,1504,4240,2554,403,1403,3049,565,5102,727,3944,1191,476,2862,5393,3740,1582,4087,502,2060,676,4447,1947,178,3244,3364,3169,1238,2239,516,3322,2654,4321,5178,2027,2652,4994,3230,4715,3459,3016,447,118,5067,2447,1942,1564,4601,3190,1809,717,835,3205,4967,3591,3353,1752,3383,1161,2612,685,2791,4489,4637,281,4784,4413,3760,1715,1845,95,5321,1204,235,3733,4565,3901,2350,4325,1356,1504,462,2840,4622,3812,3801,4552,3554,4443,3604,989,221,5170,1688,2776,4192,2064,2584,2071,2276,1948,5343,4040,798,3200,965,3373,233,1992,939,1140,3686,3047,5125,2752,5167,3923,3314,1181,862,4469,3418,2199,3730,5276,3530,3591,3088,2920,2208,95,4642,1180,4201,4234,3184,363,1029,282,5109,3146,5284,4149,1920,2949,1586,1210,1010,3714,2776,263,2395,5304,1256,2923,1929,586,5218,3696,1254,2548,4705,4401,2782,4503,3056,4750,3709,1990,2826,4193,2730,1909,3550,1960,1081,343,2447,1299,2072,2185,2086,2459,5155,5421,4999,4385,1516,5358,3458,1570,1279,4166,2350,4122,3167,397,5400,1319,3997,4009,5521,2870,4671,3186,5480,2699,668,2325,3054,4472,921,4050,3435,3357,72,602,5225,835,5464,1829,2436,5100,2266,2755,4500,3825,3844,1934,4742,38,925,3753,1329,4296,3183,4679,557,3809,31,4207,2549,660,4136,4409,5101,4500,4204,2341,4307,4193,2556,110,866,1231,1281,3367,1735,3538,5323,4578,3073,3119,4474,5517,4581,708,4603,1550,3812,1168,3267,4203,1079,1222,2640,3809,418,597,1938,3301,1071,1224,3701,4344,4826,2032,2585,5486,1642,969,1002,3058,3232,1745,5455,3477,188,2853,1965,5011,1974,5027,2349,1195,987,451,2386,1011,4831,3376,2446,2920,2633,4601,4714,1822,3811,318,4938,1204,4705,4846,1342,3018,3801,3417,3296,2491,4537,3184,5072,693,4480,1309,425,3968,5441,4872,5124,1685,4755,5299,5313,346,3744,5411,3957,3670,3554,1422,2400,1264,3662,976,748,751,1902,555,1219,4458,3755,4058,5213,1662,302,1310,4282,740,1797,259,1284,653,4719,1927,3718,3855,4243,1168,5418,1035,2576,4422,3881,5319,3632,4095,2751,3607,2099,1581,3186,2035,1066,724,5448,1261,2552,1622,5477,2867,4316,3052,5054,2943,5515,3795,3401,1222,3158,237,3630,2848,813,1247,3993,5320,3523,4902,3377,1015,2338,2088,1742,4326,378,972,110,1559,848,1851,160,2484,779,3565,783,4410,2888,947,3788,1463,4811,1522,3349,1462,5413,2135,4279,804,4272,4654,1849,1425,1300,2550,951,2156,3355,1796,1350,4940,4748,1983,3193,4912,2052,3246,5319,1358,2808,667,2933,2140,1956,2312,3686,77,613,3725,546,3180,1784,4684,2905,3723,1553,1639,3771,2980,250,3638,5485,3508,804,2766,3447,2226,3147,706,4367,169,4473,2841,1340,2477,5224,2153,5084,5265,2269,1845,5076,5486,3837,4468,1331,1711,3852,1596,967,533,178,5369,5178,2409,2414,903,1330,479,657,3942,5428,2994,1134,4208,4835,2882,1482,3816,3872,3592,407,1946,2542,1104,1632,264,1086,3616,4841,3743,4163,3696,2838,819,3918,1740,4728,1865,222,2174,3434,1747,2716,909,2089,3287,4971,2139,1061,2984,5490,1396,792,1569,4814,229,4265,2225,3560,2182,2075,3046,3771,1718,1150,4586,3071,977,2393,450,4184,5228,2403,1977,109,20,2733,1756,60,4291,1284,5221,4534,5507,1770,299,1978,1055,4938,2668,1548,988,4723,530,862,4038,3737,3973,4894,2421,144,1346,1984,2258,785,227,3579,2921,1727,1261,3587,2341,3252,2632,380,453,2212,2285,3558,4736,5004,3641,3091,2987,1485,4641,1331,5149,1521,3148,3330,5480,678,2066,3524,3892,138,4931,4318,197,2872,2143,2936,5431,4002,4842,5149,3220,5003,1489,4452,5099,4842,3250,762,5274,869,2182,2595,4001,4121,2368,4379,884,2798,4988,4788,321,786,4462,4213,4736,304,3993,1885,5146,2339,4963,2753,4609,3467,1775,3685,3191,869,3808,3850,4413,4593,2596,3637,2864,4744,2375,3525,4421,593,4658,1874,2473,2188,4260,2697,2916,2223,387,2544,3779,1883,3413,2661,259,2557,1090,889,2496,2215,3447,865,2678,872,1747,1732,3974,2864,1737,2307,3022,4325,3199,1996,1412,377,1311,1910,279,2399,2592,20,1062,3155,4413,1848,558,2254,110,5346,3868,417,3369,4660,5139,3480,4835,3140,3734,2078,2259,3780,3625,2149,4672,647,3039,845,265,126,2578,1592,2522,4562,7,4987,4389,3811,1248,3827,1838,5364,1488,4165,4752,2389,2124,3566,1294,3683,4173,4420,977,3859,2627,2339,2782,4584,2925,158,4235,4231,2087,5423,3113,172,2696,265,5072,3542,2372,4532,4362,1837,923,2766,5304,5431,3234,4984,4386,2875,1876,462,3472,1659,4565,1312,666,4207,1681,4753,1228,3379,3391,3211,1211,4894,732,250,2990,5135,3113,531,562,5382,2833,2888,1299,4149,2468,3775,4187,1793,3697,4391,1037,5427,5129,1827,2490,69,2476,412,5384,3951,1379,5143,2263,2251,5244,640,5460,3886,2881,4829,1581,441,3972,3547,2205,355,4281,2472,651,5024,1779,2417}, + 312836170, + }, + + { + []int{5, 4, 3, 2, 1}, + 4, + }, + + { + []int{1, 3, 2, 3, 1}, + 2, + }, + + { + []int{2, 4, 3, 5, 1}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_reversePairs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reversePairs(tc.nums)) + } +} + +func Benchmark_reversePairs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reversePairs(tc.nums) + } + } +} diff --git a/Algorithms/0494.target-sum/README.md b/Algorithms/0494.target-sum/README.md new file mode 100755 index 000000000..6ca627770 --- /dev/null +++ b/Algorithms/0494.target-sum/README.md @@ -0,0 +1,33 @@ +# [494. Target Sum](https://leetcode.com/problems/target-sum/) + +## 题目 + +You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. + +Find out how many ways to assign symbols to make sum of integers equal to target S. + +Example 1: + +```text +Input: nums is [1, 1, 1, 1, 1], S is 3. +Output: 5 +Explanation: + +-1+1+1+1+1 = 3 ++1-1+1+1+1 = 3 ++1+1-1+1+1 = 3 ++1+1+1-1+1 = 3 ++1+1+1+1-1 = 3 + +There are 5 ways to assign symbols to make the sum of nums be target 3. +``` + +Note: + +1. The length of the given array is positive and will not exceed 20. +1. The sum of elements in the given array will not exceed 1000. +1. Your output answer is guaranteed to be fitted in a 32-bit integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0494.target-sum/target-sum.go b/Algorithms/0494.target-sum/target-sum.go new file mode 100755 index 000000000..eb47be547 --- /dev/null +++ b/Algorithms/0494.target-sum/target-sum.go @@ -0,0 +1,40 @@ +package problem0494 + +func findTargetSumWays(nums []int, S int) int { + sum := 0 + + for i := 0; i < len(nums); i++ { + sum += nums[i] + } + + if sum < S { + return 0 + } + // sum 和 S 必须同为奇数或者偶数 + if (sum+S)%2 == 1 { + return 0 + } + + return calcSumWays(nums, (sum+S)/2) +} + +// nums 被分为两个部分 P 和 N +// P 中的元素前面放的是 + +// N 中的元素前面放的是 - +// 可得 +// sum(P) - sum(N) = target +// sum(P) + sum(N) + sum(P) - sum(N) = target + sum(P) + sum(N) +// 2 * sum(P) = target + sum(nums) +// 于是,题目就被转换成了 +// nums 有多少个子集,其和为 (target + sum(nums))/2 +func calcSumWays(nums []int, target int) int { + // dp[i] 表示 nums 中和为 i 的子集个数 + dp := make([]int, target+1) + dp[0] = 1 + for i := 0; i < len(nums); i++ { + for j := target; j >= nums[i]; j-- { + dp[j] += dp[j-nums[i]] + } + } + return dp[target] +} diff --git a/Algorithms/0494.target-sum/target-sum_test.go b/Algorithms/0494.target-sum/target-sum_test.go new file mode 100755 index 000000000..db0ad56d6 --- /dev/null +++ b/Algorithms/0494.target-sum/target-sum_test.go @@ -0,0 +1,53 @@ +package problem0494 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + S int + ans int +}{ + + { + []int{1, 1, 1, 1, 1}, + 8, + 0, + }, + + { + []int{1, 1, 1, 1, 1}, + 4, + 0, + }, + + { + []int{1, 1, 1, 1, 1}, + 3, + 5, + }, + + // 可以有多个 testcase +} + +func Test_findTargetSumWays(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findTargetSumWays(tc.nums, tc.S), "输入:%v", tc) + } +} + +func Benchmark_findTargetSumWays(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findTargetSumWays(tc.nums, tc.S) + } + } +} diff --git a/Algorithms/0495.teemo-attacking/teemo-attacking.go b/Algorithms/0495.teemo-attacking/teemo-attacking.go index d534f694f..059db17a7 100755 --- a/Algorithms/0495.teemo-attacking/teemo-attacking.go +++ b/Algorithms/0495.teemo-attacking/teemo-attacking.go @@ -1,4 +1,4 @@ -package Problem0495 +package problem0495 func findPoisonedDuration(time []int, duration int) int { res := 0 diff --git a/Algorithms/0495.teemo-attacking/teemo-attacking_test.go b/Algorithms/0495.teemo-attacking/teemo-attacking_test.go index 26f73d07a..21ff849b9 100755 --- a/Algorithms/0495.teemo-attacking/teemo-attacking_test.go +++ b/Algorithms/0495.teemo-attacking/teemo-attacking_test.go @@ -1,4 +1,4 @@ -package Problem0495 +package problem0495 import ( "fmt" diff --git a/Algorithms/0496.next-greater-element-i/README.md b/Algorithms/0496.next-greater-element-i/README.md new file mode 100755 index 000000000..08c295af5 --- /dev/null +++ b/Algorithms/0496.next-greater-element-i/README.md @@ -0,0 +1,37 @@ +# [496. Next Greater Element I](https://leetcode.com/problems/next-greater-element-i/) + +## 题目 + +You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2. + +The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not exist, output -1 for this number. + +Example 1: + +```text +Input: nums1 = [4,1,2], nums2 = [1,3,4,2]. +Output: [-1,3,-1] +Explanation: + For number 4 in the first array, you cannot find the next greater number for it in the second array, so output -1. + For number 1 in the first array, the next greater number for it in the second array is 3. + For number 2 in the first array, there is no next greater number for it in the second array, so output -1. +``` + +Example 2: + +```text +Input: nums1 = [2,4], nums2 = [1,2,3,4]. +Output: [3,-1] +Explanation: + For number 2 in the first array, the next greater number for it in the second array is 3. + For number 4 in the first array, there is no next greater number for it in the second array, so output -1. +``` + +Note: + +1. All elements in nums1 and nums2 are unique. +1. The length of both nums1 and nums2 would not exceed 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0496.next-greater-element-i/next-greater-element-i.go b/Algorithms/0496.next-greater-element-i/next-greater-element-i.go new file mode 100755 index 000000000..ee73d3e4e --- /dev/null +++ b/Algorithms/0496.next-greater-element-i/next-greater-element-i.go @@ -0,0 +1,21 @@ +package problem0496 + +func nextGreaterElement(findNums []int, nums []int) []int { + indexOf := make(map[int]int) + for i, n := range nums { + indexOf[n] = i + } + + res := make([]int, len(findNums)) + for i, n := range findNums { + res[i] = -1 + for j := indexOf[n] + 1; j < len(nums); j++ { + if n < nums[j] { + res[i] = nums[j] + break + } + } + } + + return res +} diff --git a/Algorithms/0496.next-greater-element-i/next-greater-element-i_test.go b/Algorithms/0496.next-greater-element-i/next-greater-element-i_test.go new file mode 100755 index 000000000..4bd25d25a --- /dev/null +++ b/Algorithms/0496.next-greater-element-i/next-greater-element-i_test.go @@ -0,0 +1,47 @@ +package problem0496 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + findNums []int + nums []int + ans []int +}{ + + { + []int{4, 1, 2}, + []int{1, 3, 4, 2}, + []int{-1, 3, -1}, + }, + + { + []int{2, 4}, + []int{1, 2, 3, 4}, + []int{3, -1}, + }, + + // 可以有多个 testcase +} + +func Test_nextGreaterElement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nextGreaterElement(tc.findNums, tc.nums), "输入:%v", tc) + } +} + +func Benchmark_nextGreaterElement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nextGreaterElement(tc.findNums, tc.nums) + } + } +} diff --git a/Algorithms/0497.random-point-in-non-overlapping-rectangles/README.md b/Algorithms/0497.random-point-in-non-overlapping-rectangles/README.md new file mode 100755 index 000000000..f87e20c3b --- /dev/null +++ b/Algorithms/0497.random-point-in-non-overlapping-rectangles/README.md @@ -0,0 +1,43 @@ +# [497. Random Point in Non-overlapping Rectangles](https://leetcode.com/problems/random-point-in-non-overlapping-rectangles/) + +## 题目 + +Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the spacecovered by the rectangles. + +Note: + +1. An integer pointis a point that has integer coordinates. +1. A pointon the perimeterof a rectangle isincluded in the space covered by the rectangles. +1. ith rectangle = rects[i] =[x1,y1,x2,y2], where [x1, y1]are the integer coordinates of the bottom-left corner, and [x2, y2]are the integer coordinates of the top-right corner. +1. length and width of each rectangle does not exceed 2000. +1. 1 <= rects.length<= 100 +1. pick return a point as an array of integer coordinates[p_x, p_y] +1. pick is called at most 10000times. + +Example 1: + +```text +Input: +["Solution","pick","pick","pick"] +[[[[1,1,5,5]]],[],[],[]] +Output: +[null,[4,1],[4,1],[3,3]] +``` + +Example 2: + +```text +Input: +["Solution","pick","pick","pick","pick","pick"] +[[[[-2,-2,-1,-1],[1,0,3,0]]],[],[],[],[],[]] +Output: +[null,[-1,-2],[2,0],[-2,-1],[3,0],[-2,-2]] +``` + +Explanation of Input Syntax: + +The input is two lists:the subroutines calledand theirarguments.Solution'sconstructor has one argument, the array of rectangles rects. pickhas no arguments.Argumentsarealways wrapped with a list, even if there aren't any. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles.go b/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles.go new file mode 100755 index 000000000..07f5a7c76 --- /dev/null +++ b/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles.go @@ -0,0 +1,52 @@ +package problem0497 + +import ( + "math/rand" + "sort" +) + +// Solution object will be instantiated and called as such: +// obj := Constructor(rects); +// param_1 := obj.Pick(); +type Solution struct { + total int // 所有可能离散的点的个数 + counts []int // count[i] 记录了前 i 个矩形中所有点的个数 + rects [][]int +} + +// Constructor 创建 Solution +func Constructor(rects [][]int) Solution { + size := len(rects) + + total := 0 + counts := make([]int, size) + tmp := make([][]int, size) + + for i, r := range rects { + x1, y1, x2, y2 := r[0], r[1], r[2], r[3] + w, h := x2-x1+1, y2-y1+1 // +1 是因为 [a,b] 之间一共有 b-a+1 个离散的点 + total += w * h + counts[i] = total + tmp[i] = []int{x1, y1, w, h} // 修改 rect 的表达方式 + } + + return Solution{ + counts: counts, + rects: tmp, + total: total, + } +} + +// Pick 返回正方形内的点 +func (s *Solution) Pick() []int { + cand := rand.Intn(s.total) + 1 + // 根据 cand 找到需要返回那个矩形下的点 + i := sort.SearchInts(s.counts, cand) + + x1, y1, w, h := s.rects[i][0], s.rects[i][1], s.rects[i][2], s.rects[i][3] + + x := x1 + rand.Intn(w) + y := y1 + rand.Intn(h) + + return []int{x, y} +} diff --git a/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles_test.go b/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles_test.go new file mode 100755 index 000000000..2a3a9cd94 --- /dev/null +++ b/Algorithms/0497.random-point-in-non-overlapping-rectangles/random-point-in-non-overlapping-rectangles_test.go @@ -0,0 +1,90 @@ +package problem0497 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Solution(t *testing.T) { + ast := assert.New(t) + + rects := [][]int{ + []int{1, 1, 5, 5}, + } + + s := Constructor(rects) + + for i := 0; i < 10000; i++ { + p := s.Pick() + actual := 0 + for _, r := range rects { + if isWithin(r, p) { + actual++ + } + } + ast.Equal(1, actual) + } +} + +func Test_Solution_2(t *testing.T) { + ast := assert.New(t) + + rects := [][]int{ + {-2, -2, -1, -1}, + {1, 0, 3, 0}, + } + + s := Constructor(rects) + + for i := 0; i < 10000; i++ { + p := s.Pick() + actual := 0 + for _, r := range rects { + if isWithin(r, p) { + actual++ + } + } + ast.Equal(1, actual) + } +} + +func Test_Solution_3(t *testing.T) { + ast := assert.New(t) + + rects := [][]int{ + {0, 0, 1, 1}, + {2, 0, 3, 1}, + } + + s := Constructor(rects) + + counts := make([]int, len(rects)) + picks := 1000000 + + for i := 0; i < picks; i++ { + p := s.Pick() + for i, r := range rects { + if isWithin(r, p) { + counts[i]++ + } + } + } + + delta := 0.001 + for i, c := range counts { + w, h := s.rects[i][2], s.rects[i][3] + expected := float64(w*h) / float64(s.total) + actual := float64(c) / float64(picks) + ast.InDelta(expected, actual, delta) + } + +} + +func isWithin(rect, point []int) bool { + x1, y1, x2, y2 := rect[0], rect[1], rect[2], rect[3] + x, y := point[0], point[1] + + return x1 <= x && x <= x2 && + y1 <= y && y <= y2 +} diff --git a/Algorithms/0498.diagonal-traverse/README.md b/Algorithms/0498.diagonal-traverse/README.md new file mode 100755 index 000000000..4549458cb --- /dev/null +++ b/Algorithms/0498.diagonal-traverse/README.md @@ -0,0 +1,29 @@ +# [498. Diagonal Traverse](https://leetcode.com/problems/diagonal-traverse/) + +## 题目 + +Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. + +Example: + +```text +Input: +[ + [ 1, 2, 3 ], + [ 4, 5, 6 ], + [ 7, 8, 9 ] +] +Output: [1,2,4,7,5,3,6,8,9] +``` + +Explanation: + +![pic](https://leetcode.com/static/images/problemset/diagonal_traverse.png) + +Note: + +1. The total number of elements of the given matrix will not exceed 10,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0498.diagonal-traverse/diagonal-traverse.go b/Algorithms/0498.diagonal-traverse/diagonal-traverse.go new file mode 100755 index 000000000..7c7a7cc28 --- /dev/null +++ b/Algorithms/0498.diagonal-traverse/diagonal-traverse.go @@ -0,0 +1,50 @@ +package problem0498 + +func findDiagonalOrder(mat [][]int) []int { + if len(mat) == 0 || len(mat[0]) == 0 { + return []int{} + } + m, n := len(mat), len(mat[0]) + + isUpping := true + next := func(i, j int) (int, int) { + if isUpping { + i-- + j++ + if 0 <= i && j < n { + return i, j + } + + isUpping = false + + if i < 0 && j < n { + return 0, j + } + return i + 2, j - 1 + } + + i++ + j-- + if i < m && 0 <= j { + return i, j + } + + isUpping = true + + if i < m && j < 0 { + return i, 0 + } + return i - 1, j + 2 + } + + mn := m * n + res := make([]int, mn) + + i, j := 0, 0 + for k := 0; k < mn; k++ { + res[k] = mat[i][j] + i, j = next(i, j) + } + + return res +} diff --git a/Algorithms/0498.diagonal-traverse/diagonal-traverse_test.go b/Algorithms/0498.diagonal-traverse/diagonal-traverse_test.go new file mode 100755 index 000000000..d418968dd --- /dev/null +++ b/Algorithms/0498.diagonal-traverse/diagonal-traverse_test.go @@ -0,0 +1,48 @@ +package problem0498 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans []int +}{ + + { + [][]int{}, + []int{}, + }, + + { + [][]int{ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }, + []int{1, 2, 4, 7, 5, 3, 6, 8, 9}, + }, + + // 可以有多个 testcase +} + +func Test_findDiagonalOrder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findDiagonalOrder(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_findDiagonalOrder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findDiagonalOrder(tc.matrix) + } + } +} diff --git a/Algorithms/0500.keyboard-row/README.md b/Algorithms/0500.keyboard-row/README.md new file mode 100755 index 000000000..3795bab01 --- /dev/null +++ b/Algorithms/0500.keyboard-row/README.md @@ -0,0 +1,23 @@ +# [500. Keyboard Row](https://leetcode.com/problems/keyboard-row/) + +## 题目 + +Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. + +![pic](https://leetcode.com/static/images/problemset/keyboard.png) + +Example 1: + +```text +Input: ["Hello", "Alaska", "Dad", "Peace"] +Output: ["Alaska", "Dad"] +``` + +Note: + +1. You may use one character in the keyboard more than once. +1. You may assume the input string will only contain letters of alphabet. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0500.keyboard-row/keyboard-row.go b/Algorithms/0500.keyboard-row/keyboard-row.go new file mode 100755 index 000000000..ba881940d --- /dev/null +++ b/Algorithms/0500.keyboard-row/keyboard-row.go @@ -0,0 +1,62 @@ +package problem0500 + +import ( + "strings" +) + +var qRow = map[byte]bool{ + 'q': true, + 'w': true, + 'e': true, + 'r': true, + 't': true, + 'y': true, + 'u': true, + 'i': true, + 'o': true, + 'p': true, +} + +var aRow = map[byte]bool{ + 'a': true, + 's': true, + 'd': true, + 'f': true, + 'g': true, + 'h': true, + 'j': true, + 'k': true, + 'l': true, +} + +var zRow = map[byte]bool{ + 'z': true, + 'x': true, + 'c': true, + 'v': true, + 'b': true, + 'n': true, + 'm': true, +} + +func isAllIn(s string, isInRow map[byte]bool) bool { + for i := range s { + if !isInRow[s[i]] { + return false + } + } + return true +} + +func findWords(words []string) []string { + res := make([]string, 0, len(words)) + + for _, word := range words { + w := strings.ToLower(word) + if isAllIn(w, qRow) || isAllIn(w, aRow) || isAllIn(w, zRow) { + res = append(res, word) + } + } + + return res +} diff --git a/Algorithms/0500.keyboard-row/keyboard-row_test.go b/Algorithms/0500.keyboard-row/keyboard-row_test.go new file mode 100755 index 000000000..ab813d649 --- /dev/null +++ b/Algorithms/0500.keyboard-row/keyboard-row_test.go @@ -0,0 +1,39 @@ +package problem0500 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans []string +}{ + + { + []string{"Hello", "Alaska", "Dad", "Peace"}, + []string{"Alaska", "Dad"}, + }, + + // 可以有多个 testcase +} + +func Test_findWords(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findWords(tc.words), "输入:%v", tc) + } +} + +func Benchmark_findWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findWords(tc.words) + } + } +} diff --git a/Algorithms/0501.find-mode-in-binary-search-tree/README.md b/Algorithms/0501.find-mode-in-binary-search-tree/README.md new file mode 100755 index 000000000..e2914e50d --- /dev/null +++ b/Algorithms/0501.find-mode-in-binary-search-tree/README.md @@ -0,0 +1,34 @@ +# [501. Find Mode in Binary Search Tree](https://leetcode.com/problems/find-mode-in-binary-search-tree/) + +## 题目 + +Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. + +Assume a BST is defined as follows: + +1. The left subtree of a node contains only nodes with keys less than or equal to the node's key. +1. The right subtree of a node contains only nodes with keys greater than or equal to the node's key. +1. Both the left and right subtrees must also be binary search trees. + +For example: + +```text +Given BST [1,null,2,2], + 1 + \ + 2 + / + 2 + +return [2]. +``` + +Note: +If a tree has more than one mode, you can return them in any order. + +Follow up: +Could you do that without using any extra space? (Assume that the implicit stack space incurred due to recursion does not count). + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree.go b/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree.go new file mode 100755 index 000000000..3cfedaaf6 --- /dev/null +++ b/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree.go @@ -0,0 +1,37 @@ +package problem0501 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func findMode(root *TreeNode) []int { + r := map[int]int{} + search(root, r) + + max := -1 + res := []int{} + for n, v := range r { + if max <= v { + if max < v { + max = v + res = res[0:0] + } + res = append(res, n) + } + } + + return res +} + +func search(root *TreeNode, rec map[int]int) { + if root == nil { + return + } + + rec[root.Val]++ + + search(root.Left, rec) + search(root.Right, rec) +} diff --git a/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree_test.go b/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree_test.go new file mode 100755 index 000000000..f31d91756 --- /dev/null +++ b/Algorithms/0501.find-mode-in-binary-search-tree/find-mode-in-binary-search-tree_test.go @@ -0,0 +1,47 @@ +package problem0501 + +import ( + "fmt" + "sort" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []int +}{ + + { + []int{1, 2, 1, 2}, + []int{1, 1, 2, 2}, + []int{1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_findMode(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ans := findMode(root) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_findMode(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findMode(root) + } + } +} diff --git a/Algorithms/0502.ipo/README.md b/Algorithms/0502.ipo/README.md new file mode 100755 index 000000000..4c256a977 --- /dev/null +++ b/Algorithms/0502.ipo/README.md @@ -0,0 +1,33 @@ +# [502. IPO](https://leetcode.com/problems/ipo/) + +## 题目 + +Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCode design the best way to maximize its total capital after finishing at most k distinct projects. + +You are given several projects. For each project i, it has a pure profit Pi and a minimum capital of Ci is needed to start the corresponding project. Initially, you have W capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital. + +To sum up, pick a list of at most k distinct projects from given projects to maximize your final capital, and output your final maximized capital. + +Example 1: + +```text +Input: k=2, W=0, Profits=[1,2,3], Capital=[0,1,1]. + +Output: 4 + +Explanation: Since your initial capital is 0, you can only start the project indexed 0. + After finishing it you will obtain profit 1 and your capital becomes 1. + With capital 1, you can either start the project indexed 1 or the project indexed 2. + Since you can choose at most 2 projects, you need to finish the project indexed 2 to get the maximum capital. + Therefore, output the final maximized capital, which is 0 + 1 + 3 = 4. +``` + +Note: + +1. You may assume all numbers in the input are non-negative integers. +1. The length of Profits array and Capital array will not exceed 50,000. +1. The answer is guaranteed to fit in a 32-bit signed integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0502.ipo/ipo.go b/Algorithms/0502.ipo/ipo.go new file mode 100755 index 000000000..9f6cc7a32 --- /dev/null +++ b/Algorithms/0502.ipo/ipo.go @@ -0,0 +1,90 @@ +package problem0502 + +import ( + "container/heap" + "sort" +) + +func findMaximizedCapital(k int, W int, Profits []int, Capital []int) int { + size := len(Profits) + + // caps 按照 capital 的升序排列 project + caps := make(capQueue, size) + for i := range Profits { + p := &project{ + profit: Profits[i], + capital: Capital[i], + } + caps[i] = p + } + sort.Sort(caps) + + // pros 是高 profit 优先的队列 + pros := make(proPQ, 0, size) + var i int + for { + // 把所有可以做的 project 存入 pros + for i < len(caps) && caps[i].capital <= W { + heap.Push(&pros, caps[i]) + i++ + } + + // 无 project 可做了 + // 或 + // 已经达到工作量的上限 + if len(pros) == 0 || k == 0 { + break + } + + // 从 pros 中挑选一件 profit 最大的工作来做 + // 并更新 W + W += heap.Pop(&pros).(*project).profit + k-- + } + + return W +} + +// entry 是 priorityQueue 中的元素 +type project struct { + profit, capital int +} + +// PQ implements heap.Interface and holds entries. +type capQueue []*project + +func (q capQueue) Len() int { return len(q) } + +func (q capQueue) Less(i, j int) bool { + return q[i].capital < q[j].capital +} + +func (q capQueue) Swap(i, j int) { + q[i], q[j] = q[j], q[i] +} + +// PQ implements heap.Interface and holds entries. +type proPQ []*project + +func (pq proPQ) Len() int { return len(pq) } + +func (pq proPQ) Less(i, j int) bool { + return pq[i].profit > pq[j].profit +} + +func (pq proPQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 entry +func (pq *proPQ) Push(x interface{}) { + entry := x.(*project) + *pq = append(*pq, entry) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *proPQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[:len(*pq)-1] + return temp +} diff --git a/Algorithms/0502.ipo/ipo_test.go b/Algorithms/0502.ipo/ipo_test.go new file mode 100755 index 000000000..446a2d741 --- /dev/null +++ b/Algorithms/0502.ipo/ipo_test.go @@ -0,0 +1,61 @@ +package problem0502 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + k int + W int + Profits []int + Capital []int + ans int +}{ + + { + 111, + 12, + []int{319, 178, 37, 756, 152, 763, 481, 1055, 594, 825, 759, 494, 1087, 696, 717, 358, 1091, 1145, 1043, 245, 779, 957, 3, 1060, 1141, 926, 226, 657, 869, 740, 1170, 746, 889, 416, 634, 209, 1189, 1076, 819, 1144, 40, 807, 561, 400, 283, 133, 186, 839, 1043, 491, 936, 559, 70, 9, 854, 1172, 9, 739, 871, 436, 1087, 1029, 66, 561, 798, 1141, 701, 1020, 1072, 92, 636, 509, 392, 77, 84, 202, 843, 563, 329, 906, 101, 997, 1162, 105, 876, 460, 285, 446, 753, 516, 60, 932, 323, 659, 9, 639, 1041, 861, 1199, 343, 792, 1114, 536, 405, 542, 805, 929, 589, 538, 410, 143, 114, 24, 1064, 682, 536, 1016, 1141, 843, 472, 817, 196, 673, 189, 915, 196, 755, 203, 956, 283, 833, 836, 22, 899, 232, 655, 572, 207, 819, 639, 1024, 887, 407, 385, 251, 896, 165, 290, 193, 357, 870, 678, 411, 697, 998, 344, 628, 866, 1004, 894, 547, 574, 36, 847, 691, 601, 896, 363, 21, 1133, 115, 658, 855, 1042, 2, 189, 230, 215, 747, 971, 581, 809, 832, 311, 35, 639, 1127, 701, 167, 672, 763, 997, 1061, 1170, 289, 806, 91, 198, 720, 67, 273, 863, 437, 152, 671, 635, 968, 107, 58, 453, 392, 236, 875, 719, 44, 850, 176, 580, 937, 227, 125, 851, 1188, 915, 747, 1175, 69, 743, 250, 275, 290, 787, 780, 516, 775, 279, 256, 649, 83, 1180, 372, 655, 813, 750, 381, 807, 988, 977, 430, 282, 1067, 551, 726, 756, 372, 17, 1016, 550, 1128, 223, 174, 85, 1039, 1, 27, 178, 822, 243, 440, 79, 772, 211, 640, 454, 1141, 654, 351, 54, 794, 711, 157, 492, 307, 1156, 937, 212, 461, 417, 741, 1104, 642, 1147, 833, 1194, 1066, 1070, 876, 1045, 341, 854, 1014, 787, 518, 404, 1068, 385, 756, 998, 298, 439, 917, 183, 71, 363, 38, 828, 372, 1071, 195, 481, 1153, 871, 712, 803, 849, 145, 1144, 410, 420, 561, 678, 241, 498, 548, 436, 871, 810, 180, 635, 119, 665, 551, 1132, 807, 408, 685, 489, 274, 459, 28, 987, 935, 310, 284, 1163, 924, 812, 267, 1123, 782, 1065, 1075, 1199, 1047, 289, 280, 1044, 931, 1056, 625, 672, 150, 41, 1084, 998, 151, 483, 226, 548, 277, 1187, 1010, 262, 1048, 493, 1084, 845, 1127, 1009, 773, 129, 547, 798, 118, 559, 463, 972, 666, 1155, 519, 381, 405, 819, 201, 790, 729, 1100, 614, 691, 3, 386, 206, 514, 387, 612, 1073, 158, 67, 1116, 164, 496, 1056, 1159, 348, 530, 28, 1177, 774, 1139, 559, 563, 310, 916, 897, 36, 1060, 173, 952, 123, 635, 911, 711, 304, 611, 481, 645, 532, 1033, 385, 402, 797, 117, 307, 969, 1147, 1127, 434, 1099, 1043, 104, 74, 257, 778, 934, 901, 106, 84, 525, 138, 698, 877, 1009, 487, 450, 649, 736, 802, 1032, 456, 757, 10, 2, 720, 1155, 234, 844, 880, 1053, 1134, 821, 1094, 970, 1095, 976, 101, 1163, 104, 38, 198, 350, 896, 345, 867, 1129, 1064, 403, 228, 1103, 416, 561, 722, 915, 1161, 252, 45, 632, 1163, 232, 174, 964, 876, 1126, 479, 432, 984, 815, 544, 1005, 620, 497, 1021, 763, 169, 1028, 706, 1112, 150, 368, 483, 251, 721, 492, 686, 1105, 38, 1140, 1085, 153, 366, 428, 296, 28, 648, 873, 21, 236, 393, 581, 1043, 1086, 747, 402, 201, 1196, 416, 788, 318, 257, 815, 735, 1023, 1143, 1100, 922, 1033, 884, 824, 963, 159, 904, 21, 1168, 511, 723, 400, 239, 338, 89, 1099, 572, 674, 54, 891, 426, 277, 91, 504, 302, 616, 468, 506, 917, 491, 744, 1091, 1051, 594, 465, 850, 338, 417, 320, 1160, 364, 480, 855, 86, 305, 225, 833, 637, 760, 1147, 613, 236, 460, 664, 1183, 38, 806, 100, 654, 852, 975, 816, 506, 1092, 275, 6, 229, 972, 53, 554, 370, 63, 651, 701, 304, 1011, 672, 353, 118, 1111, 448, 549, 151, 1087, 909, 420, 1095, 663, 1119, 1124, 729, 578, 733, 861, 1154, 1195, 387, 1182, 850, 189, 463, 1129, 1185, 541, 546, 1159, 314, 137, 479, 59, 841, 514, 548, 496, 642, 341, 151, 999, 1036, 1186, 704, 550, 1039, 723, 779, 584, 382, 371, 712, 176, 665, 180, 440, 697, 1102, 408, 728, 157, 1050, 558, 692, 336, 384, 107, 839, 477, 204, 862, 345, 429, 1144, 1069, 207, 449, 594, 963, 988, 843, 334, 200, 865, 281, 296, 1040, 914, 995, 743, 1134, 1050, 484, 602, 1001, 570, 1052, 1106, 922, 77, 1099, 681, 360, 955, 1184, 669, 411, 760, 46, 599, 815, 231, 86, 694, 469, 1079, 1161, 1105, 519, 1010, 681, 603, 376, 534, 145, 361, 448, 1006, 91, 397, 671, 597, 238, 119, 467, 587, 723, 162, 804, 638, 568, 195, 460, 610, 868, 806, 995, 1178, 490, 406, 933, 232, 17, 37, 2, 114, 1004, 871, 531, 209, 267, 37, 750, 1196, 940, 89, 725, 377, 898, 6, 685, 210, 1127, 1160, 432, 391, 931, 681, 937, 275, 1190, 137, 743, 652, 430, 566, 180, 1192, 718, 253, 133, 998, 1067, 764, 747, 1159, 827, 143, 506, 641, 327, 468, 731, 50, 15, 569, 80, 310, 1086, 1092, 989, 245, 520, 711, 788, 1144, 938, 1152, 1169, 563, 1053, 1182, 331, 838, 112, 361, 1049, 717, 979, 956, 434, 534, 1083, 117, 280, 1104, 293, 1137, 592, 1019, 606, 526, 216, 924, 197, 137, 1041, 2, 910, 274, 1178, 267, 521, 626, 764, 691, 124, 446, 337, 676, 325, 288, 1120, 924, 512, 777, 1063, 979, 86, 677, 1183, 777, 418, 41, 852, 929, 712, 1132, 1030, 339, 943, 475, 851, 340, 894, 1091, 230, 654, 229, 945, 69, 182, 110, 255, 895, 645, 1061, 793, 1016, 807, 440, 330, 519, 73, 108, 660, 209, 1077, 1191, 938, 415, 1162, 579, 258, 14, 273, 561, 834, 371, 134, 1118, 1139, 1163, 667, 979, 483, 436, 42, 593, 139, 846, 875, 571, 808, 76, 713, 1198, 352, 299, 156, 793, 509, 245, 697, 1106, 236, 287, 236, 644, 683}, + []int{487, 13, 943, 31, 661, 656, 690, 175, 1147, 760, 96, 290, 755, 504, 1111, 219, 187, 641, 380, 886, 781, 214, 714, 594, 41, 1154, 908, 977, 1183, 28, 464, 524, 895, 1177, 28, 225, 1180, 206, 387, 25, 166, 207, 394, 418, 771, 719, 153, 836, 970, 589, 114, 67, 1180, 1136, 863, 1144, 21, 9, 957, 861, 981, 849, 1031, 361, 541, 649, 220, 718, 263, 390, 24, 830, 103, 955, 233, 1174, 521, 580, 83, 869, 321, 712, 1011, 130, 297, 835, 406, 543, 849, 681, 337, 355, 867, 863, 552, 883, 155, 762, 982, 129, 605, 125, 1111, 442, 89, 1139, 1084, 870, 183, 1142, 78, 12, 893, 677, 817, 348, 1036, 482, 76, 619, 563, 435, 529, 311, 1148, 629, 786, 288, 112, 995, 854, 844, 1002, 948, 570, 736, 1088, 354, 618, 876, 926, 150, 1108, 412, 707, 233, 137, 775, 751, 1137, 481, 349, 150, 518, 1165, 191, 223, 754, 419, 1025, 817, 1001, 278, 692, 403, 1023, 106, 78, 124, 679, 598, 727, 1026, 966, 564, 726, 1148, 643, 806, 1182, 645, 300, 867, 613, 458, 844, 679, 907, 437, 1012, 902, 18, 843, 190, 43, 705, 818, 957, 146, 1175, 130, 744, 941, 975, 692, 1066, 541, 335, 20, 311, 606, 377, 558, 113, 545, 1115, 228, 29, 2, 1180, 331, 1072, 151, 692, 1156, 347, 293, 1135, 959, 865, 1031, 40, 425, 1191, 1178, 87, 989, 92, 1186, 1072, 105, 1058, 369, 401, 1117, 220, 484, 181, 901, 321, 923, 263, 72, 685, 820, 1123, 736, 942, 37, 419, 631, 545, 761, 227, 230, 25, 636, 1048, 834, 736, 899, 530, 217, 669, 278, 653, 657, 857, 724, 782, 146, 780, 615, 1156, 751, 463, 625, 707, 355, 92, 718, 855, 624, 504, 359, 744, 793, 868, 462, 985, 1087, 517, 886, 83, 221, 383, 601, 709, 683, 1097, 544, 411, 28, 1129, 781, 13, 752, 347, 1150, 1030, 269, 701, 658, 658, 1188, 222, 1160, 480, 953, 203, 132, 17, 723, 927, 911, 448, 977, 1126, 219, 118, 1033, 919, 1041, 712, 930, 963, 772, 264, 523, 479, 735, 919, 72, 1019, 131, 15, 628, 331, 408, 578, 37, 1123, 125, 527, 887, 54, 1043, 259, 654, 557, 872, 505, 700, 1077, 202, 368, 628, 29, 66, 199, 611, 730, 1108, 682, 705, 628, 1001, 705, 21, 266, 428, 1093, 800, 742, 701, 715, 845, 1151, 300, 460, 1134, 708, 443, 706, 819, 296, 199, 671, 452, 626, 386, 569, 999, 326, 1081, 202, 384, 783, 541, 811, 1058, 684, 146, 288, 1149, 480, 0, 658, 547, 773, 588, 758, 189, 489, 257, 436, 362, 417, 180, 671, 141, 657, 864, 808, 1026, 504, 827, 1125, 977, 1161, 699, 360, 689, 520, 796, 147, 746, 978, 833, 82, 102, 254, 736, 88, 525, 1037, 659, 1061, 333, 663, 520, 6, 439, 823, 1151, 395, 188, 32, 513, 34, 805, 1017, 1193, 157, 942, 87, 630, 915, 807, 215, 482, 1132, 23, 1008, 1175, 724, 1070, 339, 1139, 22, 455, 306, 369, 151, 1031, 1119, 846, 1195, 49, 1169, 773, 706, 45, 747, 875, 944, 1161, 1025, 258, 765, 1039, 459, 641, 1169, 211, 894, 556, 253, 831, 1115, 458, 351, 1138, 58, 1169, 1190, 743, 611, 392, 1015, 54, 831, 330, 1138, 681, 1012, 750, 967, 1179, 398, 564, 5, 2, 143, 787, 197, 590, 144, 589, 588, 493, 524, 748, 1123, 707, 585, 641, 293, 871, 331, 1173, 280, 218, 931, 11, 663, 1005, 1118, 555, 1000, 699, 720, 81, 527, 71, 458, 462, 1056, 447, 491, 1068, 1078, 842, 455, 497, 959, 745, 654, 1011, 939, 787, 430, 535, 594, 940, 1176, 656, 207, 815, 1133, 610, 1113, 596, 1018, 961, 840, 555, 582, 1187, 828, 161, 983, 686, 870, 800, 525, 34, 1013, 385, 870, 953, 59, 518, 521, 151, 633, 561, 848, 310, 712, 108, 1148, 446, 480, 983, 110, 442, 182, 119, 463, 909, 690, 48, 1040, 631, 17, 1027, 158, 353, 108, 524, 335, 1046, 514, 1027, 746, 917, 378, 437, 606, 829, 743, 462, 1013, 525, 290, 477, 749, 896, 12, 351, 13, 42, 819, 334, 912, 30, 1041, 815, 307, 1138, 168, 209, 1134, 100, 276, 292, 283, 1074, 123, 561, 857, 92, 879, 58, 706, 532, 75, 49, 385, 342, 887, 646, 301, 54, 483, 589, 1084, 1092, 178, 845, 243, 873, 611, 340, 712, 115, 157, 63, 773, 800, 844, 167, 384, 522, 877, 183, 368, 709, 501, 905, 512, 756, 246, 197, 463, 47, 232, 256, 37, 883, 1048, 774, 431, 943, 868, 111, 163, 336, 648, 313, 858, 536, 416, 680, 951, 320, 499, 199, 234, 482, 529, 676, 26, 1180, 721, 877, 586, 628, 1152, 835, 1145, 447, 763, 750, 188, 1169, 596, 1125, 310, 519, 1165, 488, 1063, 59, 292, 701, 1078, 1088, 663, 512, 172, 477, 187, 215, 1192, 22, 827, 279, 607, 286, 179, 744, 569, 500, 510, 1038, 570, 1159, 520, 1070, 759, 831, 906, 644, 753, 574, 257, 983, 1023, 227, 460, 710, 169, 595, 249, 111, 73, 991, 933, 448, 655, 559, 183, 244, 44, 644, 935, 466, 97, 605, 460, 800, 229, 977, 675, 236, 946, 73, 456, 623, 499, 423, 162, 342, 914, 386, 1082, 407, 954, 1081, 1099, 142, 539, 416, 791, 1195, 1099, 885, 965, 971, 796, 1198, 449, 768, 792, 541, 18, 476, 303, 137, 319, 1008, 343, 733, 128, 641, 709, 175, 691, 227, 307, 1177, 1198, 1075, 747, 944, 1038, 933, 643, 613, 1166, 1153, 120, 288, 1167, 246, 1103, 185, 85, 1008, 1060, 1051, 421, 150, 601, 376, 183, 1028, 146, 297, 515, 688, 886, 1090, 552, 969, 903, 1086, 931, 946, 1099, 546, 17, 851, 908, 1170, 418, 94, 61, 233, 1069, 510, 783, 302, 701, 564, 1195, 57, 1007, 994, 205, 1019, 694, 1020, 137, 1041, 803, 673, 1162, 14, 904, 418, 1076, 514, 79, 944, 242, 491, 867, 934, 40, 1059, 776, 817, 468, 516, 550, 906, 790, 459, 273, 924, 185, 1183, 337, 435, 699, 316, 768}, + 126981, + }, + + { + 2, + 1, + []int{1, 2, 3}, + []int{1, 1, 1}, + 6, + }, + + { + 2, + 0, + []int{1, 2, 3}, + []int{0, 1, 1}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_findMaximizedCapital(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMaximizedCapital(tc.k, tc.W, tc.Profits, tc.Capital), "输入:%v", tc) + } +} + +func Benchmark_findMaximizedCapital(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMaximizedCapital(tc.k, tc.W, tc.Profits, tc.Capital) + } + } +} diff --git a/Algorithms/0503.next-greater-element-ii/README.md b/Algorithms/0503.next-greater-element-ii/README.md new file mode 100755 index 000000000..583cbbd49 --- /dev/null +++ b/Algorithms/0503.next-greater-element-ii/README.md @@ -0,0 +1,20 @@ +# [503. Next Greater Element II](https://leetcode.com/problems/next-greater-element-ii/) + +## 题目 + +Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The Next Greater Number of a number x is the first greater number to its traversing-order next in the array, which means you could search circularly to find its next greater number. If it doesn't exist, output -1 for this number. + +Example 1: + +```text +Input: [1,2,1] +Output: [2,-1,2] +Explanation: The first 1's next greater number is 2; The number 2 can't find next greater number; The second 1's next greater number needs to search circularly, which is also 2. +``` + +Note: +The length of given array won't exceed 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0503.next-greater-element-ii/next-greater-element-ii.go b/Algorithms/0503.next-greater-element-ii/next-greater-element-ii.go new file mode 100755 index 000000000..147613258 --- /dev/null +++ b/Algorithms/0503.next-greater-element-ii/next-greater-element-ii.go @@ -0,0 +1,30 @@ +package problem0503 + +func nextGreaterElements(nums []int) []int { + size := len(nums) + + res := make([]int, size) + for i := range res { + res[i] = -1 + } + + // stack 中存放的是 nums 的递减子序列的索引号,例如 + // nums = {9,8,7,3,2,1,6} + // 在遇到 6 以前,stack = {9,8,7,3,2,1} 的索引号 + // 在遇到 6 以后,stack = {9,8,7,6} 的索引号, + // 此次已经得知了,{3,2,1} 的 nextGreater 是 6 + stack := make([]int, 0, size) + + // i < size*2 是为了避免 stack 中留有的最大值无法取出导致的无限循环。因为 + // 当 i < size 时,如果存在 nums[i] < nums[j%size], 定有 j < i+size < size*2 + // size*2 内找不到,就永远也找不到了 + for i := 0; i < size*2; i++ { + for len(stack) > 0 && nums[stack[len(stack)-1]] < nums[i%size] { + res[stack[len(stack)-1]] = nums[i%size] + stack = stack[:len(stack)-1] + } + stack = append(stack, i%size) + } + + return res +} diff --git a/Algorithms/0503.next-greater-element-ii/next-greater-element-ii_test.go b/Algorithms/0503.next-greater-element-ii/next-greater-element-ii_test.go new file mode 100755 index 000000000..ae601dbe2 --- /dev/null +++ b/Algorithms/0503.next-greater-element-ii/next-greater-element-ii_test.go @@ -0,0 +1,64 @@ +package problem0503 + +import ( + // "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{5,4,3,2,4,3,2}, + []int{-1,5,4,4,5,5,5}, + }, + + { + []int{100000, 99999, 99998, 99997, 99996, 99995, 99994, 99993, 99992, 99991, 99990, 99989, 99988, 99987, 99986, 99985, 99984, 99983, 99982, 99981, 99980, 99979, 99978, 99977, 99976, 99975, 99974, 99973, 99972, 99971, 99970, 99969, 99968, 99967, 99966, 99965, 99964, 99963, 99962, 99961, 99960, 99959, 99958, 99957, 99956, 99955, 99954, 99953, 99952, 99951, 99950, 99949, 99948, 99947, 99946, 99945, 99944, 99943, 99942, 99941, 99940, 99939, 99938, 99937, 99936, 99935, 99934, 99933, 99932, 99931, 99930, 99929, 99928, 99927, 99926, 99925, 99924, 99923, 99922, 99921, 99920, 99919, 99918, 99917, 99916, 99915, 99914, 99913, 99912, 99911, 99910, 99909, 99908, 99907, 99906, 99905, 99904, 99903, 99902, 99901, 99900, 99899, 99898, 99897, 99896, 99895, 99894, 99893, 99892, 99891, 99890, 99889, 99888, 99887, 99886, 99885, 99884, 99883, 99882, 99881, 99880, 99879, 99878, 99877, 99876, 99875, 99874, 99873, 99872, 99871, 99870, 99869, 99868, 99867, 99866, 99865, 99864, 99863, 99862, 99861, 99860, 99859, 99858, 99857, 99856, 99855, 99854, 99853, 99852, 99851, 99850, 99849, 99848, 99847, 99846, 99845, 99844, 99843, 99842, 99841, 99840, 99839, 99838, 99837, 99836, 99835, 99834, 99833, 99832, 99831, 99830, 99829, 99828, 99827, 99826, 99825, 99824, 99823, 99822, 99821, 99820, 99819, 99818, 99817, 99816, 99815, 99814, 99813, 99812, 99811, 99810, 99809, 99808, 99807, 99806, 99805, 99804, 99803, 99802, 99801, 99800, 99799, 99798, 99797, 99796, 99795, 99794, 99793, 99792, 99791, 99790, 99789, 99788, 99787, 99786, 99785, 99784, 99783, 99782, 99781, 99780, 99779, 99778, 99777, 99776, 99775, 99774, 99773, 99772, 99771, 99770, 99769, 99768, 99767, 99766, 99765, 99764, 99763, 99762, 99761, 99760, 99759, 99758, 99757, 99756, 99755, 99754, 99753, 99752, 99751, 99750, 99749, 99748, 99747, 99746, 99745, 99744, 99743, 99742, 99741, 99740, 99739, 99738, 99737, 99736, 99735, 99734, 99733, 99732, 99731, 99730, 99729, 99728, 99727, 99726, 99725, 99724, 99723, 99722, 99721, 99720, 99719, 99718, 99717, 99716, 99715, 99714, 99713, 99712, 99711, 99710, 99709, 99708, 99707, 99706, 99705, 99704, 99703, 99702, 99701, 99700, 99699, 99698, 99697, 99696, 99695, 99694, 99693, 99692, 99691, 99690, 99689, 99688, 99687, 99686, 99685, 99684, 99683, 99682, 99681, 99680, 99679, 99678, 99677, 99676, 99675, 99674, 99673, 99672, 99671, 99670, 99669, 99668, 99667, 99666, 99665, 99664, 99663, 99662, 99661, 99660, 99659, 99658, 99657, 99656, 99655, 99654, 99653, 99652, 99651, 99650, 99649, 99648, 99647, 99646, 99645, 99644, 99643, 99642, 99641, 99640, 99639, 99638, 99637, 99636, 99635, 99634, 99633, 99632, 99631, 99630, 99629, 99628, 99627, 99626, 99625, 99624, 99623, 99622, 99621, 99620, 99619, 99618, 99617, 99616, 99615, 99614, 99613, 99612, 99611, 99610, 99609, 99608, 99607, 99606, 99605, 99604, 99603, 99602, 99601, 99600, 99599, 99598, 99597, 99596, 99595, 99594, 99593, 99592, 99591, 99590, 99589, 99588, 99587, 99586, 99585, 99584, 99583, 99582, 99581, 99580, 99579, 99578, 99577, 99576, 99575, 99574, 99573, 99572, 99571, 99570, 99569, 99568, 99567, 99566, 99565, 99564, 99563, 99562, 99561, 99560, 99559, 99558, 99557, 99556, 99555, 99554, 99553, 99552, 99551, 99550, 99549, 99548, 99547, 99546, 99545, 99544, 99543, 99542, 99541, 99540, 99539, 99538, 99537, 99536, 99535, 99534, 99533, 99532, 99531, 99530, 99529, 99528, 99527, 99526, 99525, 99524, 99523, 99522, 99521, 99520, 99519, 99518, 99517, 99516, 99515, 99514, 99513, 99512, 99511, 99510, 99509, 99508, 99507, 99506, 99505, 99504, 99503, 99502, 99501, 99500, 99499, 99498, 99497, 99496, 99495, 99494, 99493, 99492, 99491, 99490, 99489, 99488, 99487, 99486, 99485, 99484, 99483, 99482, 99481, 99480, 99479, 99478, 99477, 99476, 99475, 99474, 99473, 99472, 99471, 99470, 99469, 99468, 99467, 99466, 99465, 99464, 99463, 99462, 99461, 99460, 99459, 99458, 99457, 99456, 99455, 99454, 99453, 99452, 99451, 99450, 99449, 99448, 99447, 99446, 99445, 99444, 99443, 99442, 99441, 99440, 99439, 99438, 99437, 99436, 99435, 99434, 99433, 99432, 99431, 99430, 99429, 99428, 99427, 99426, 99425, 99424, 99423, 99422, 99421, 99420, 99419, 99418, 99417, 99416, 99415, 99414, 99413, 99412, 99411, 99410, 99409, 99408, 99407, 99406, 99405, 99404, 99403, 99402, 99401, 99400, 99399, 99398, 99397, 99396, 99395, 99394, 99393, 99392, 99391, 99390, 99389, 99388, 99387, 99386, 99385, 99384, 99383, 99382, 99381, 99380, 99379, 99378, 99377, 99376, 99375, 99374, 99373, 99372, 99371, 99370, 99369, 99368, 99367, 99366, 99365, 99364, 99363, 99362, 99361, 99360, 99359, 99358, 99357, 99356, 99355, 99354, 99353, 99352, 99351, 99350, 99349, 99348, 99347, 99346, 99345, 99344, 99343, 99342, 99341, 99340, 99339, 99338, 99337, 99336, 99335, 99334, 99333, 99332, 99331, 99330, 99329, 99328, 99327, 99326, 99325, 99324, 99323, 99322, 99321, 99320, 99319, 99318, 99317, 99316, 99315, 99314, 99313, 99312, 99311, 99310, 99309, 99308, 99307, 99306, 99305, 99304, 99303, 99302, 99301, 99300, 99299, 99298, 99297, 99296, 99295, 99294, 99293, 99292, 99291, 99290, 99289, 99288, 99287, 99286, 99285, 99284, 99283, 99282, 99281, 99280, 99279, 99278, 99277, 99276, 99275, 99274, 99273, 99272, 99271, 99270, 99269, 99268, 99267, 99266, 99265, 99264, 99263, 99262, 99261, 99260, 99259, 99258, 99257, 99256, 99255, 99254, 99253, 99252, 99251, 99250, 99249, 99248, 99247, 99246, 99245, 99244, 99243, 99242, 99241, 99240, 99239, 99238, 99237, 99236, 99235, 99234, 99233, 99232, 99231, 99230, 99229, 99228, 99227, 99226, 99225, 99224, 99223, 99222, 99221, 99220, 99219, 99218, 99217, 99216, 99215, 99214, 99213, 99212, 99211, 99210, 99209, 99208, 99207, 99206, 99205, 99204, 99203, 99202, 99201, 99200, 99199, 99198, 99197, 99196, 99195, 99194, 99193, 99192, 99191, 99190, 99189, 99188, 99187, 99186, 99185, 99184, 99183, 99182, 99181, 99180, 99179, 99178, 99177, 99176, 99175, 99174, 99173, 99172, 99171, 99170, 99169, 99168, 99167, 99166, 99165, 99164, 99163, 99162, 99161, 99160, 99159, 99158, 99157, 99156, 99155, 99154, 99153, 99152, 99151, 99150, 99149, 99148, 99147, 99146, 99145, 99144, 99143, 99142, 99141, 99140, 99139, 99138, 99137, 99136, 99135, 99134, 99133, 99132, 99131, 99130, 99129, 99128, 99127, 99126, 99125, 99124, 99123, 99122, 99121, 99120, 99119, 99118, 99117, 99116, 99115, 99114, 99113, 99112, 99111, 99110, 99109, 99108, 99107, 99106, 99105, 99104, 99103, 99102, 99101, 99100, 99099, 99098, 99097, 99096, 99095, 99094, 99093, 99092, 99091, 99090, 99089, 99088, 99087, 99086, 99085, 99084, 99083, 99082, 99081, 99080, 99079, 99078, 99077, 99076, 99075, 99074, 99073, 99072, 99071, 99070, 99069, 99068, 99067, 99066, 99065, 99064, 99063, 99062, 99061, 99060, 99059, 99058, 99057, 99056, 99055, 99054, 99053, 99052, 99051, 99050, 99049, 99048, 99047, 99046, 99045, 99044, 99043, 99042, 99041, 99040, 99039, 99038, 99037, 99036, 99035, 99034, 99033, 99032, 99031, 99030, 99029, 99028, 99027, 99026, 99025, 99024, 99023, 99022, 99021, 99020, 99019, 99018, 99017, 99016, 99015, 99014, 99013, 99012, 99011, 99010, 99009, 99008, 99007, 99006, 99005, 99004, 99003, 99002, 99001, 99000, 98999, 98998, 98997, 98996, 98995, 98994, 98993, 98992, 98991, 98990, 98989, 98988, 98987, 98986, 98985, 98984, 98983, 98982, 98981, 98980, 98979, 98978, 98977, 98976, 98975, 98974, 98973, 98972, 98971, 98970, 98969, 98968, 98967, 98966, 98965, 98964, 98963, 98962, 98961, 98960, 98959, 98958, 98957, 98956, 98955, 98954, 98953, 98952, 98951, 98950, 98949, 98948, 98947, 98946, 98945, 98944, 98943, 98942, 98941, 98940, 98939, 98938, 98937, 98936, 98935, 98934, 98933, 98932, 98931, 98930, 98929, 98928, 98927, 98926, 98925, 98924, 98923, 98922, 98921, 98920, 98919, 98918, 98917, 98916, 98915, 98914, 98913, 98912, 98911, 98910, 98909, 98908, 98907, 98906, 98905, 98904, 98903, 98902, 98901, 98900, 98899, 98898, 98897, 98896, 98895, 98894, 98893, 98892, 98891, 98890, 98889, 98888, 98887, 98886, 98885, 98884, 98883, 98882, 98881, 98880, 98879, 98878, 98877, 98876, 98875, 98874, 98873, 98872, 98871, 98870, 98869, 98868, 98867, 98866, 98865, 98864, 98863, 98862, 98861, 98860, 98859, 98858, 98857, 98856, 98855, 98854, 98853, 98852, 98851, 98850, 98849, 98848, 98847, 98846, 98845, 98844, 98843, 98842, 98841, 98840, 98839, 98838, 98837, 98836, 98835, 98834, 98833, 98832, 98831, 98830, 98829, 98828, 98827, 98826, 98825, 98824, 98823, 98822, 98821, 98820, 98819, 98818, 98817, 98816, 98815, 98814, 98813, 98812, 98811, 98810, 98809, 98808, 98807, 98806, 98805, 98804, 98803, 98802, 98801, 98800, 98799, 98798, 98797, 98796, 98795, 98794, 98793, 98792, 98791, 98790, 98789, 98788, 98787, 98786, 98785, 98784, 98783, 98782, 98781, 98780, 98779, 98778, 98777, 98776, 98775, 98774, 98773, 98772, 98771, 98770, 98769, 98768, 98767, 98766, 98765, 98764, 98763, 98762, 98761, 98760, 98759, 98758, 98757, 98756, 98755, 98754, 98753, 98752, 98751, 98750, 98749, 98748, 98747, 98746, 98745, 98744, 98743, 98742, 98741, 98740, 98739, 98738, 98737, 98736, 98735, 98734, 98733, 98732, 98731, 98730, 98729, 98728, 98727, 98726, 98725, 98724, 98723, 98722, 98721, 98720, 98719, 98718, 98717, 98716, 98715, 98714, 98713, 98712, 98711, 98710, 98709, 98708, 98707, 98706, 98705, 98704, 98703, 98702, 98701, 98700, 98699, 98698, 98697, 98696, 98695, 98694, 98693, 98692, 98691, 98690, 98689, 98688, 98687, 98686, 98685, 98684, 98683, 98682, 98681, 98680, 98679, 98678, 98677, 98676, 98675, 98674, 98673, 98672, 98671, 98670, 98669, 98668, 98667, 98666, 98665, 98664, 98663, 98662, 98661, 98660, 98659, 98658, 98657, 98656, 98655, 98654, 98653, 98652, 98651, 98650, 98649, 98648, 98647, 98646, 98645, 98644, 98643, 98642, 98641, 98640, 98639, 98638, 98637, 98636, 98635, 98634, 98633, 98632, 98631, 98630, 98629, 98628, 98627, 98626, 98625, 98624, 98623, 98622, 98621, 98620, 98619, 98618, 98617, 98616, 98615, 98614, 98613, 98612, 98611, 98610, 98609, 98608, 98607, 98606, 98605, 98604, 98603, 98602, 98601, 98600, 98599, 98598, 98597, 98596, 98595, 98594, 98593, 98592, 98591, 98590, 98589, 98588, 98587, 98586, 98585, 98584, 98583, 98582, 98581, 98580, 98579, 98578, 98577, 98576, 98575, 98574, 98573, 98572, 98571, 98570, 98569, 98568, 98567, 98566, 98565, 98564, 98563, 98562, 98561, 98560, 98559, 98558, 98557, 98556, 98555, 98554, 98553, 98552, 98551, 98550, 98549, 98548, 98547, 98546, 98545, 98544, 98543, 98542, 98541, 98540, 98539, 98538, 98537, 98536, 98535, 98534, 98533, 98532, 98531, 98530, 98529, 98528, 98527, 98526, 98525, 98524, 98523, 98522, 98521, 98520, 98519, 98518, 98517, 98516, 98515, 98514, 98513, 98512, 98511, 98510, 98509, 98508, 98507, 98506, 98505, 98504, 98503, 98502, 98501, 98500, 98499, 98498, 98497, 98496, 98495, 98494, 98493, 98492, 98491, 98490, 98489, 98488, 98487, 98486, 98485, 98484, 98483, 98482, 98481, 98480, 98479, 98478, 98477, 98476, 98475, 98474, 98473, 98472, 98471, 98470, 98469, 98468, 98467, 98466, 98465, 98464, 98463, 98462, 98461, 98460, 98459, 98458, 98457, 98456, 98455, 98454, 98453, 98452, 98451, 98450, 98449, 98448, 98447, 98446, 98445, 98444, 98443, 98442, 98441, 98440, 98439, 98438, 98437, 98436, 98435, 98434, 98433, 98432, 98431, 98430, 98429, 98428, 98427, 98426, 98425, 98424, 98423, 98422, 98421, 98420, 98419, 98418, 98417, 98416, 98415, 98414, 98413, 98412, 98411, 98410, 98409, 98408, 98407, 98406, 98405, 98404, 98403, 98402, 98401, 98400, 98399, 98398, 98397, 98396, 98395, 98394, 98393, 98392, 98391, 98390, 98389, 98388, 98387, 98386, 98385, 98384, 98383, 98382, 98381, 98380, 98379, 98378, 98377, 98376, 98375, 98374, 98373, 98372, 98371, 98370, 98369, 98368, 98367, 98366, 98365, 98364, 98363, 98362, 98361, 98360, 98359, 98358, 98357, 98356, 98355, 98354, 98353, 98352, 98351, 98350, 98349, 98348, 98347, 98346, 98345, 98344, 98343, 98342, 98341, 98340, 98339, 98338, 98337, 98336, 98335, 98334, 98333, 98332, 98331, 98330, 98329, 98328, 98327, 98326, 98325, 98324, 98323, 98322, 98321, 98320, 98319, 98318, 98317, 98316, 98315, 98314, 98313, 98312, 98311, 98310, 98309, 98308, 98307, 98306, 98305, 98304, 98303, 98302, 98301, 98300, 98299, 98298, 98297, 98296, 98295, 98294, 98293, 98292, 98291, 98290, 98289, 98288, 98287, 98286, 98285, 98284, 98283, 98282, 98281, 98280, 98279, 98278, 98277, 98276, 98275, 98274, 98273, 98272, 98271, 98270, 98269, 98268, 98267, 98266, 98265, 98264, 98263, 98262, 98261, 98260, 98259, 98258, 98257, 98256, 98255, 98254, 98253, 98252, 98251, 98250, 98249, 98248, 98247, 98246, 98245, 98244, 98243, 98242, 98241, 98240, 98239, 98238, 98237, 98236, 98235, 98234, 98233, 98232, 98231, 98230, 98229, 98228, 98227, 98226, 98225, 98224, 98223, 98222, 98221, 98220, 98219, 98218, 98217, 98216, 98215, 98214, 98213, 98212, 98211, 98210, 98209, 98208, 98207, 98206, 98205, 98204, 98203, 98202, 98201, 98200, 98199, 98198, 98197, 98196, 98195, 98194, 98193, 98192, 98191, 98190, 98189, 98188, 98187, 98186, 98185, 98184, 98183, 98182, 98181, 98180, 98179, 98178, 98177, 98176, 98175, 98174, 98173, 98172, 98171, 98170, 98169, 98168, 98167, 98166, 98165, 98164, 98163, 98162, 98161, 98160, 98159, 98158, 98157, 98156, 98155, 98154, 98153, 98152, 98151, 98150, 98149, 98148, 98147, 98146, 98145, 98144, 98143, 98142, 98141, 98140, 98139, 98138, 98137, 98136, 98135, 98134, 98133, 98132, 98131, 98130, 98129, 98128, 98127, 98126, 98125, 98124, 98123, 98122, 98121, 98120, 98119, 98118, 98117, 98116, 98115, 98114, 98113, 98112, 98111, 98110, 98109, 98108, 98107, 98106, 98105, 98104, 98103, 98102, 98101, 98100, 98099, 98098, 98097, 98096, 98095, 98094, 98093, 98092, 98091, 98090, 98089, 98088, 98087, 98086, 98085, 98084, 98083, 98082, 98081, 98080, 98079, 98078, 98077, 98076, 98075, 98074, 98073, 98072, 98071, 98070, 98069, 98068, 98067, 98066, 98065, 98064, 98063, 98062, 98061, 98060, 98059, 98058, 98057, 98056, 98055, 98054, 98053, 98052, 98051, 98050, 98049, 98048, 98047, 98046, 98045, 98044, 98043, 98042, 98041, 98040, 98039, 98038, 98037, 98036, 98035, 98034, 98033, 98032, 98031, 98030, 98029, 98028, 98027, 98026, 98025, 98024, 98023, 98022, 98021, 98020, 98019, 98018, 98017, 98016, 98015, 98014, 98013, 98012, 98011, 98010, 98009, 98008, 98007, 98006, 98005, 98004, 98003, 98002, 98001, 98000, 97999, 97998, 97997, 97996, 97995, 97994, 97993, 97992, 97991, 97990, 97989, 97988, 97987, 97986, 97985, 97984, 97983, 97982, 97981, 97980, 97979, 97978, 97977, 97976, 97975, 97974, 97973, 97972, 97971, 97970, 97969, 97968, 97967, 97966, 97965, 97964, 97963, 97962, 97961, 97960, 97959, 97958, 97957, 97956, 97955, 97954, 97953, 97952, 97951, 97950, 97949, 97948, 97947, 97946, 97945, 97944, 97943, 97942, 97941, 97940, 97939, 97938, 97937, 97936, 97935, 97934, 97933, 97932, 97931, 97930, 97929, 97928, 97927, 97926, 97925, 97924, 97923, 97922, 97921, 97920, 97919, 97918, 97917, 97916, 97915, 97914, 97913, 97912, 97911, 97910, 97909, 97908, 97907, 97906, 97905, 97904, 97903, 97902, 97901, 97900, 97899, 97898, 97897, 97896, 97895, 97894, 97893, 97892, 97891, 97890, 97889, 97888, 97887, 97886, 97885, 97884, 97883, 97882, 97881, 97880, 97879, 97878, 97877, 97876, 97875, 97874, 97873, 97872, 97871, 97870, 97869, 97868, 97867, 97866, 97865, 97864, 97863, 97862, 97861, 97860, 97859, 97858, 97857, 97856, 97855, 97854, 97853, 97852, 97851, 97850, 97849, 97848, 97847, 97846, 97845, 97844, 97843, 97842, 97841, 97840, 97839, 97838, 97837, 97836, 97835, 97834, 97833, 97832, 97831, 97830, 97829, 97828, 97827, 97826, 97825, 97824, 97823, 97822, 97821, 97820, 97819, 97818, 97817, 97816, 97815, 97814, 97813, 97812, 97811, 97810, 97809, 97808, 97807, 97806, 97805, 97804, 97803, 97802, 97801, 97800, 97799, 97798, 97797, 97796, 97795, 97794, 97793, 97792, 97791, 97790, 97789, 97788, 97787, 97786, 97785, 97784, 97783, 97782, 97781, 97780, 97779, 97778, 97777, 97776, 97775, 97774, 97773, 97772, 97771, 97770, 97769, 97768, 97767, 97766, 97765, 97764, 97763, 97762, 97761, 97760, 97759, 97758, 97757, 97756, 97755, 97754, 97753, 97752, 97751, 97750, 97749, 97748, 97747, 97746, 97745, 97744, 97743, 97742, 97741, 97740, 97739, 97738, 97737, 97736, 97735, 97734, 97733, 97732, 97731, 97730, 97729, 97728, 97727, 97726, 97725, 97724, 97723, 97722, 97721, 97720, 97719, 97718, 97717, 97716, 97715, 97714, 97713, 97712, 97711, 97710, 97709, 97708, 97707, 97706, 97705, 97704, 97703, 97702, 97701, 97700, 97699, 97698, 97697, 97696, 97695, 97694, 97693, 97692, 97691, 97690, 97689, 97688, 97687, 97686, 97685, 97684, 97683, 97682, 97681, 97680, 97679, 97678, 97677, 97676, 97675, 97674, 97673, 97672, 97671, 97670, 97669, 97668, 97667, 97666, 97665, 97664, 97663, 97662, 97661, 97660, 97659, 97658, 97657, 97656, 97655, 97654, 97653, 97652, 97651, 97650, 97649, 97648, 97647, 97646, 97645, 97644, 97643, 97642, 97641, 97640, 97639, 97638, 97637, 97636, 97635, 97634, 97633, 97632, 97631, 97630, 97629, 97628, 97627, 97626, 97625, 97624, 97623, 97622, 97621, 97620, 97619, 97618, 97617, 97616, 97615, 97614, 97613, 97612, 97611, 97610, 97609, 97608, 97607, 97606, 97605, 97604, 97603, 97602, 97601, 97600, 97599, 97598, 97597, 97596, 97595, 97594, 97593, 97592, 97591, 97590, 97589, 97588, 97587, 97586, 97585, 97584, 97583, 97582, 97581, 97580, 97579, 97578, 97577, 97576, 97575, 97574, 97573, 97572, 97571, 97570, 97569, 97568, 97567, 97566, 97565, 97564, 97563, 97562, 97561, 97560, 97559, 97558, 97557, 97556, 97555, 97554, 97553, 97552, 97551, 97550, 97549, 97548, 97547, 97546, 97545, 97544, 97543, 97542, 97541, 97540, 97539, 97538, 97537, 97536, 97535, 97534, 97533, 97532, 97531, 97530, 97529, 97528, 97527, 97526, 97525, 97524, 97523, 97522, 97521, 97520, 97519, 97518, 97517, 97516, 97515, 97514, 97513, 97512, 97511, 97510, 97509, 97508, 97507, 97506, 97505, 97504, 97503, 97502, 97501, 97500, 97499, 97498, 97497, 97496, 97495, 97494, 97493, 97492, 97491, 97490, 97489, 97488, 97487, 97486, 97485, 97484, 97483, 97482, 97481, 97480, 97479, 97478, 97477, 97476, 97475, 97474, 97473, 97472, 97471, 97470, 97469, 97468, 97467, 97466, 97465, 97464, 97463, 97462, 97461, 97460, 97459, 97458, 97457, 97456, 97455, 97454, 97453, 97452, 97451, 97450, 97449, 97448, 97447, 97446, 97445, 97444, 97443, 97442, 97441, 97440, 97439, 97438, 97437, 97436, 97435, 97434, 97433, 97432, 97431, 97430, 97429, 97428, 97427, 97426, 97425, 97424, 97423, 97422, 97421, 97420, 97419, 97418, 97417, 97416, 97415, 97414, 97413, 97412, 97411, 97410, 97409, 97408, 97407, 97406, 97405, 97404, 97403, 97402, 97401, 97400, 97399, 97398, 97397, 97396, 97395, 97394, 97393, 97392, 97391, 97390, 97389, 97388, 97387, 97386, 97385, 97384, 97383, 97382, 97381, 97380, 97379, 97378, 97377, 97376, 97375, 97374, 97373, 97372, 97371, 97370, 97369, 97368, 97367, 97366, 97365, 97364, 97363, 97362, 97361, 97360, 97359, 97358, 97357, 97356, 97355, 97354, 97353, 97352, 97351, 97350, 97349, 97348, 97347, 97346, 97345, 97344, 97343, 97342, 97341, 97340, 97339, 97338, 97337, 97336, 97335, 97334, 97333, 97332, 97331, 97330, 97329, 97328, 97327, 97326, 97325, 97324, 97323, 97322, 97321, 97320, 97319, 97318, 97317, 97316, 97315, 97314, 97313, 97312, 97311, 97310, 97309, 97308, 97307, 97306, 97305, 97304, 97303, 97302, 97301, 97300, 97299, 97298, 97297, 97296, 97295, 97294, 97293, 97292, 97291, 97290, 97289, 97288, 97287, 97286, 97285, 97284, 97283, 97282, 97281, 97280, 97279, 97278, 97277, 97276, 97275, 97274, 97273, 97272, 97271, 97270, 97269, 97268, 97267, 97266, 97265, 97264, 97263, 97262, 97261, 97260, 97259, 97258, 97257, 97256, 97255, 97254, 97253, 97252, 97251, 97250, 97249, 97248, 97247, 97246, 97245, 97244, 97243, 97242, 97241, 97240, 97239, 97238, 97237, 97236, 97235, 97234, 97233, 97232, 97231, 97230, 97229, 97228, 97227, 97226, 97225, 97224, 97223, 97222, 97221, 97220, 97219, 97218, 97217, 97216, 97215, 97214, 97213, 97212, 97211, 97210, 97209, 97208, 97207, 97206, 97205, 97204, 97203, 97202, 97201, 97200, 97199, 97198, 97197, 97196, 97195, 97194, 97193, 97192, 97191, 97190, 97189, 97188, 97187, 97186, 97185, 97184, 97183, 97182, 97181, 97180, 97179, 97178, 97177, 97176, 97175, 97174, 97173, 97172, 97171, 97170, 97169, 97168, 97167, 97166, 97165, 97164, 97163, 97162, 97161, 97160, 97159, 97158, 97157, 97156, 97155, 97154, 97153, 97152, 97151, 97150, 97149, 97148, 97147, 97146, 97145, 97144, 97143, 97142, 97141, 97140, 97139, 97138, 97137, 97136, 97135, 97134, 97133, 97132, 97131, 97130, 97129, 97128, 97127, 97126, 97125, 97124, 97123, 97122, 97121, 97120, 97119, 97118, 97117, 97116, 97115, 97114, 97113, 97112, 97111, 97110, 97109, 97108, 97107, 97106, 97105, 97104, 97103, 97102, 97101, 97100, 97099, 97098, 97097, 97096, 97095, 97094, 97093, 97092, 97091, 97090, 97089, 97088, 97087, 97086, 97085, 97084, 97083, 97082, 97081, 97080, 97079, 97078, 97077, 97076, 97075, 97074, 97073, 97072, 97071, 97070, 97069, 97068, 97067, 97066, 97065, 97064, 97063, 97062, 97061, 97060, 97059, 97058, 97057, 97056, 97055, 97054, 97053, 97052, 97051, 97050, 97049, 97048, 97047, 97046, 97045, 97044, 97043, 97042, 97041, 97040, 97039, 97038, 97037, 97036, 97035, 97034, 97033, 97032, 97031, 97030, 97029, 97028, 97027, 97026, 97025, 97024, 97023, 97022, 97021, 97020, 97019, 97018, 97017, 97016, 97015, 97014, 97013, 97012, 97011, 97010, 97009, 97008, 97007, 97006, 97005, 97004, 97003, 97002, 97001, 97000, 96999, 96998, 96997, 96996, 96995, 96994, 96993, 96992, 96991, 96990, 96989, 96988, 96987, 96986, 96985, 96984, 96983, 96982, 96981, 96980, 96979, 96978, 96977, 96976, 96975, 96974, 96973, 96972, 96971, 96970, 96969, 96968, 96967, 96966, 96965, 96964, 96963, 96962, 96961, 96960, 96959, 96958, 96957, 96956, 96955, 96954, 96953, 96952, 96951, 96950, 96949, 96948, 96947, 96946, 96945, 96944, 96943, 96942, 96941, 96940, 96939, 96938, 96937, 96936, 96935, 96934, 96933, 96932, 96931, 96930, 96929, 96928, 96927, 96926, 96925, 96924, 96923, 96922, 96921, 96920, 96919, 96918, 96917, 96916, 96915, 96914, 96913, 96912, 96911, 96910, 96909, 96908, 96907, 96906, 96905, 96904, 96903, 96902, 96901, 96900, 96899, 96898, 96897, 96896, 96895, 96894, 96893, 96892, 96891, 96890, 96889, 96888, 96887, 96886, 96885, 96884, 96883, 96882, 96881, 96880, 96879, 96878, 96877, 96876, 96875, 96874, 96873, 96872, 96871, 96870, 96869, 96868, 96867, 96866, 96865, 96864, 96863, 96862, 96861, 96860, 96859, 96858, 96857, 96856, 96855, 96854, 96853, 96852, 96851, 96850, 96849, 96848, 96847, 96846, 96845, 96844, 96843, 96842, 96841, 96840, 96839, 96838, 96837, 96836, 96835, 96834, 96833, 96832, 96831, 96830, 96829, 96828, 96827, 96826, 96825, 96824, 96823, 96822, 96821, 96820, 96819, 96818, 96817, 96816, 96815, 96814, 96813, 96812, 96811, 96810, 96809, 96808, 96807, 96806, 96805, 96804, 96803, 96802, 96801, 96800, 96799, 96798, 96797, 96796, 96795, 96794, 96793, 96792, 96791, 96790, 96789, 96788, 96787, 96786, 96785, 96784, 96783, 96782, 96781, 96780, 96779, 96778, 96777, 96776, 96775, 96774, 96773, 96772, 96771, 96770, 96769, 96768, 96767, 96766, 96765, 96764, 96763, 96762, 96761, 96760, 96759, 96758, 96757, 96756, 96755, 96754, 96753, 96752, 96751, 96750, 96749, 96748, 96747, 96746, 96745, 96744, 96743, 96742, 96741, 96740, 96739, 96738, 96737, 96736, 96735, 96734, 96733, 96732, 96731, 96730, 96729, 96728, 96727, 96726, 96725, 96724, 96723, 96722, 96721, 96720, 96719, 96718, 96717, 96716, 96715, 96714, 96713, 96712, 96711, 96710, 96709, 96708, 96707, 96706, 96705, 96704, 96703, 96702, 96701, 96700, 96699, 96698, 96697, 96696, 96695, 96694, 96693, 96692, 96691, 96690, 96689, 96688, 96687, 96686, 96685, 96684, 96683, 96682, 96681, 96680, 96679, 96678, 96677, 96676, 96675, 96674, 96673, 96672, 96671, 96670, 96669, 96668, 96667, 96666, 96665, 96664, 96663, 96662, 96661, 96660, 96659, 96658, 96657, 96656, 96655, 96654, 96653, 96652, 96651, 96650, 96649, 96648, 96647, 96646, 96645, 96644, 96643, 96642, 96641, 96640, 96639, 96638, 96637, 96636, 96635, 96634, 96633, 96632, 96631, 96630, 96629, 96628, 96627, 96626, 96625, 96624, 96623, 96622, 96621, 96620, 96619, 96618, 96617, 96616, 96615, 96614, 96613, 96612, 96611, 96610, 96609, 96608, 96607, 96606, 96605, 96604, 96603, 96602, 96601, 96600, 96599, 96598, 96597, 96596, 96595, 96594, 96593, 96592, 96591, 96590, 96589, 96588, 96587, 96586, 96585, 96584, 96583, 96582, 96581, 96580, 96579, 96578, 96577, 96576, 96575, 96574, 96573, 96572, 96571, 96570, 96569, 96568, 96567, 96566, 96565, 96564, 96563, 96562, 96561, 96560, 96559, 96558, 96557, 96556, 96555, 96554, 96553, 96552, 96551, 96550, 96549, 96548, 96547, 96546, 96545, 96544, 96543, 96542, 96541, 96540, 96539, 96538, 96537, 96536, 96535, 96534, 96533, 96532, 96531, 96530, 96529, 96528, 96527, 96526, 96525, 96524, 96523, 96522, 96521, 96520, 96519, 96518, 96517, 96516, 96515, 96514, 96513, 96512, 96511, 96510, 96509, 96508, 96507, 96506, 96505, 96504, 96503, 96502, 96501, 96500, 96499, 96498, 96497, 96496, 96495, 96494, 96493, 96492, 96491, 96490, 96489, 96488, 96487, 96486, 96485, 96484, 96483, 96482, 96481, 96480, 96479, 96478, 96477, 96476, 96475, 96474, 96473, 96472, 96471, 96470, 96469, 96468, 96467, 96466, 96465, 96464, 96463, 96462, 96461, 96460, 96459, 96458, 96457, 96456, 96455, 96454, 96453, 96452, 96451, 96450, 96449, 96448, 96447, 96446, 96445, 96444, 96443, 96442, 96441, 96440, 96439, 96438, 96437, 96436, 96435, 96434, 96433, 96432, 96431, 96430, 96429, 96428, 96427, 96426, 96425, 96424, 96423, 96422, 96421, 96420, 96419, 96418, 96417, 96416, 96415, 96414, 96413, 96412, 96411, 96410, 96409, 96408, 96407, 96406, 96405, 96404, 96403, 96402, 96401, 96400, 96399, 96398, 96397, 96396, 96395, 96394, 96393, 96392, 96391, 96390, 96389, 96388, 96387, 96386, 96385, 96384, 96383, 96382, 96381, 96380, 96379, 96378, 96377, 96376, 96375, 96374, 96373, 96372, 96371, 96370, 96369, 96368, 96367, 96366, 96365, 96364, 96363, 96362, 96361, 96360, 96359, 96358, 96357, 96356, 96355, 96354, 96353, 96352, 96351, 96350, 96349, 96348, 96347, 96346, 96345, 96344, 96343, 96342, 96341, 96340, 96339, 96338, 96337, 96336, 96335, 96334, 96333, 96332, 96331, 96330, 96329, 96328, 96327, 96326, 96325, 96324, 96323, 96322, 96321, 96320, 96319, 96318, 96317, 96316, 96315, 96314, 96313, 96312, 96311, 96310, 96309, 96308, 96307, 96306, 96305, 96304, 96303, 96302, 96301, 96300, 96299, 96298, 96297, 96296, 96295, 96294, 96293, 96292, 96291, 96290, 96289, 96288, 96287, 96286, 96285, 96284, 96283, 96282, 96281, 96280, 96279, 96278, 96277, 96276, 96275, 96274, 96273, 96272, 96271, 96270, 96269, 96268, 96267, 96266, 96265, 96264, 96263, 96262, 96261, 96260, 96259, 96258, 96257, 96256, 96255, 96254, 96253, 96252, 96251, 96250, 96249, 96248, 96247, 96246, 96245, 96244, 96243, 96242, 96241, 96240, 96239, 96238, 96237, 96236, 96235, 96234, 96233, 96232, 96231, 96230, 96229, 96228, 96227, 96226, 96225, 96224, 96223, 96222, 96221, 96220, 96219, 96218, 96217, 96216, 96215, 96214, 96213, 96212, 96211, 96210, 96209, 96208, 96207, 96206, 96205, 96204, 96203, 96202, 96201, 96200, 96199, 96198, 96197, 96196, 96195, 96194, 96193, 96192, 96191, 96190, 96189, 96188, 96187, 96186, 96185, 96184, 96183, 96182, 96181, 96180, 96179, 96178, 96177, 96176, 96175, 96174, 96173, 96172, 96171, 96170, 96169, 96168, 96167, 96166, 96165, 96164, 96163, 96162, 96161, 96160, 96159, 96158, 96157, 96156, 96155, 96154, 96153, 96152, 96151, 96150, 96149, 96148, 96147, 96146, 96145, 96144, 96143, 96142, 96141, 96140, 96139, 96138, 96137, 96136, 96135, 96134, 96133, 96132, 96131, 96130, 96129, 96128, 96127, 96126, 96125, 96124, 96123, 96122, 96121, 96120, 96119, 96118, 96117, 96116, 96115, 96114, 96113, 96112, 96111, 96110, 96109, 96108, 96107, 96106, 96105, 96104, 96103, 96102, 96101, 96100, 96099, 96098, 96097, 96096, 96095, 96094, 96093, 96092, 96091, 96090, 96089, 96088, 96087, 96086, 96085, 96084, 96083, 96082, 96081, 96080, 96079, 96078, 96077, 96076, 96075, 96074, 96073, 96072, 96071, 96070, 96069, 96068, 96067, 96066, 96065, 96064, 96063, 96062, 96061, 96060, 96059, 96058, 96057, 96056, 96055, 96054, 96053, 96052, 96051, 96050, 96049, 96048, 96047, 96046, 96045, 96044, 96043, 96042, 96041, 96040, 96039, 96038, 96037, 96036, 96035, 96034, 96033, 96032, 96031, 96030, 96029, 96028, 96027, 96026, 96025, 96024, 96023, 96022, 96021, 96020, 96019, 96018, 96017, 96016, 96015, 96014, 96013, 96012, 96011, 96010, 96009, 96008, 96007, 96006, 96005, 96004, 96003, 96002, 96001, 96000, 95999, 95998, 95997, 95996, 95995, 95994, 95993, 95992, 95991, 95990, 95989, 95988, 95987, 95986, 95985, 95984, 95983, 95982, 95981, 95980, 95979, 95978, 95977, 95976, 95975, 95974, 95973, 95972, 95971, 95970, 95969, 95968, 95967, 95966, 95965, 95964, 95963, 95962, 95961, 95960, 95959, 95958, 95957, 95956, 95955, 95954, 95953, 95952, 95951, 95950, 95949, 95948, 95947, 95946, 95945, 95944, 95943, 95942, 95941, 95940, 95939, 95938, 95937, 95936, 95935, 95934, 95933, 95932, 95931, 95930, 95929, 95928, 95927, 95926, 95925, 95924, 95923, 95922, 95921, 95920, 95919, 95918, 95917, 95916, 95915, 95914, 95913, 95912, 95911, 95910, 95909, 95908, 95907, 95906, 95905, 95904, 95903, 95902, 95901, 95900, 95899, 95898, 95897, 95896, 95895, 95894, 95893, 95892, 95891, 95890, 95889, 95888, 95887, 95886, 95885, 95884, 95883, 95882, 95881, 95880, 95879, 95878, 95877, 95876, 95875, 95874, 95873, 95872, 95871, 95870, 95869, 95868, 95867, 95866, 95865, 95864, 95863, 95862, 95861, 95860, 95859, 95858, 95857, 95856, 95855, 95854, 95853, 95852, 95851, 95850, 95849, 95848, 95847, 95846, 95845, 95844, 95843, 95842, 95841, 95840, 95839, 95838, 95837, 95836, 95835, 95834, 95833, 95832, 95831, 95830, 95829, 95828, 95827, 95826, 95825, 95824, 95823, 95822, 95821, 95820, 95819, 95818, 95817, 95816, 95815, 95814, 95813, 95812, 95811, 95810, 95809, 95808, 95807, 95806, 95805, 95804, 95803, 95802, 95801, 95800, 95799, 95798, 95797, 95796, 95795, 95794, 95793, 95792, 95791, 95790, 95789, 95788, 95787, 95786, 95785, 95784, 95783, 95782, 95781, 95780, 95779, 95778, 95777, 95776, 95775, 95774, 95773, 95772, 95771, 95770, 95769, 95768, 95767, 95766, 95765, 95764, 95763, 95762, 95761, 95760, 95759, 95758, 95757, 95756, 95755, 95754, 95753, 95752, 95751, 95750, 95749, 95748, 95747, 95746, 95745, 95744, 95743, 95742, 95741, 95740, 95739, 95738, 95737, 95736, 95735, 95734, 95733, 95732, 95731, 95730, 95729, 95728, 95727, 95726, 95725, 95724, 95723, 95722, 95721, 95720, 95719, 95718, 95717, 95716, 95715, 95714, 95713, 95712, 95711, 95710, 95709, 95708, 95707, 95706, 95705, 95704, 95703, 95702, 95701, 95700, 95699, 95698, 95697, 95696, 95695, 95694, 95693, 95692, 95691, 95690, 95689, 95688, 95687, 95686, 95685, 95684, 95683, 95682, 95681, 95680, 95679, 95678, 95677, 95676, 95675, 95674, 95673, 95672, 95671, 95670, 95669, 95668, 95667, 95666, 95665, 95664, 95663, 95662, 95661, 95660, 95659, 95658, 95657, 95656, 95655, 95654, 95653, 95652, 95651, 95650, 95649, 95648, 95647, 95646, 95645, 95644, 95643, 95642, 95641, 95640, 95639, 95638, 95637, 95636, 95635, 95634, 95633, 95632, 95631, 95630, 95629, 95628, 95627, 95626, 95625, 95624, 95623, 95622, 95621, 95620, 95619, 95618, 95617, 95616, 95615, 95614, 95613, 95612, 95611, 95610, 95609, 95608, 95607, 95606, 95605, 95604, 95603, 95602, 95601, 95600, 95599, 95598, 95597, 95596, 95595, 95594, 95593, 95592, 95591, 95590, 95589, 95588, 95587, 95586, 95585, 95584, 95583, 95582, 95581, 95580, 95579, 95578, 95577, 95576, 95575, 95574, 95573, 95572, 95571, 95570, 95569, 95568, 95567, 95566, 95565, 95564, 95563, 95562, 95561, 95560, 95559, 95558, 95557, 95556, 95555, 95554, 95553, 95552, 95551, 95550, 95549, 95548, 95547, 95546, 95545, 95544, 95543, 95542, 95541, 95540, 95539, 95538, 95537, 95536, 95535, 95534, 95533, 95532, 95531, 95530, 95529, 95528, 95527, 95526, 95525, 95524, 95523, 95522, 95521, 95520, 95519, 95518, 95517, 95516, 95515, 95514, 95513, 95512, 95511, 95510, 95509, 95508, 95507, 95506, 95505, 95504, 95503, 95502, 95501, 95500, 95499, 95498, 95497, 95496, 95495, 95494, 95493, 95492, 95491, 95490, 95489, 95488, 95487, 95486, 95485, 95484, 95483, 95482, 95481, 95480, 95479, 95478, 95477, 95476, 95475, 95474, 95473, 95472, 95471, 95470, 95469, 95468, 95467, 95466, 95465, 95464, 95463, 95462, 95461, 95460, 95459, 95458, 95457, 95456, 95455, 95454, 95453, 95452, 95451, 95450, 95449, 95448, 95447, 95446, 95445, 95444, 95443, 95442, 95441, 95440, 95439, 95438, 95437, 95436, 95435, 95434, 95433, 95432, 95431, 95430, 95429, 95428, 95427, 95426, 95425, 95424, 95423, 95422, 95421, 95420, 95419, 95418, 95417, 95416, 95415, 95414, 95413, 95412, 95411, 95410, 95409, 95408, 95407, 95406, 95405, 95404, 95403, 95402, 95401, 95400, 95399, 95398, 95397, 95396, 95395, 95394, 95393, 95392, 95391, 95390, 95389, 95388, 95387, 95386, 95385, 95384, 95383, 95382, 95381, 95380, 95379, 95378, 95377, 95376, 95375, 95374, 95373, 95372, 95371, 95370, 95369, 95368, 95367, 95366, 95365, 95364, 95363, 95362, 95361, 95360, 95359, 95358, 95357, 95356, 95355, 95354, 95353, 95352, 95351, 95350, 95349, 95348, 95347, 95346, 95345, 95344, 95343, 95342, 95341, 95340, 95339, 95338, 95337, 95336, 95335, 95334, 95333, 95332, 95331, 95330, 95329, 95328, 95327, 95326, 95325, 95324, 95323, 95322, 95321, 95320, 95319, 95318, 95317, 95316, 95315, 95314, 95313, 95312, 95311, 95310, 95309, 95308, 95307, 95306, 95305, 95304, 95303, 95302, 95301, 95300, 95299, 95298, 95297, 95296, 95295, 95294, 95293, 95292, 95291, 95290, 95289, 95288, 95287, 95286, 95285, 95284, 95283, 95282, 95281, 95280, 95279, 95278, 95277, 95276, 95275, 95274, 95273, 95272, 95271, 95270, 95269, 95268, 95267, 95266, 95265, 95264, 95263, 95262, 95261, 95260, 95259, 95258, 95257, 95256, 95255, 95254, 95253, 95252, 95251, 95250, 95249, 95248, 95247, 95246, 95245, 95244, 95243, 95242, 95241, 95240, 95239, 95238, 95237, 95236, 95235, 95234, 95233, 95232, 95231, 95230, 95229, 95228, 95227, 95226, 95225, 95224, 95223, 95222, 95221, 95220, 95219, 95218, 95217, 95216, 95215, 95214, 95213, 95212, 95211, 95210, 95209, 95208, 95207, 95206, 95205, 95204, 95203, 95202, 95201, 95200, 95199, 95198, 95197, 95196, 95195, 95194, 95193, 95192, 95191, 95190, 95189, 95188, 95187, 95186, 95185, 95184, 95183, 95182, 95181, 95180, 95179, 95178, 95177, 95176, 95175, 95174, 95173, 95172, 95171, 95170, 95169, 95168, 95167, 95166, 95165, 95164, 95163, 95162, 95161, 95160, 95159, 95158, 95157, 95156, 95155, 95154, 95153, 95152, 95151, 95150, 95149, 95148, 95147, 95146, 95145, 95144, 95143, 95142, 95141, 95140, 95139, 95138, 95137, 95136, 95135, 95134, 95133, 95132, 95131, 95130, 95129, 95128, 95127, 95126, 95125, 95124, 95123, 95122, 95121, 95120, 95119, 95118, 95117, 95116, 95115, 95114, 95113, 95112, 95111, 95110, 95109, 95108, 95107, 95106, 95105, 95104, 95103, 95102, 95101, 95100, 95099, 95098, 95097, 95096, 95095, 95094, 95093, 95092, 95091, 95090, 95089, 95088, 95087, 95086, 95085, 95084, 95083, 95082, 95081, 95080, 95079, 95078, 95077, 95076, 95075, 95074, 95073, 95072, 95071, 95070, 95069, 95068, 95067, 95066, 95065, 95064, 95063, 95062, 95061, 95060, 95059, 95058, 95057, 95056, 95055, 95054, 95053, 95052, 95051, 95050, 95049, 95048, 95047, 95046, 95045, 95044, 95043, 95042, 95041, 95040, 95039, 95038, 95037, 95036, 95035, 95034, 95033, 95032, 95031, 95030, 95029, 95028, 95027, 95026, 95025, 95024, 95023, 95022, 95021, 95020, 95019, 95018, 95017, 95016, 95015, 95014, 95013, 95012, 95011, 95010, 95009, 95008, 95007, 95006, 95005, 95004, 95003, 95002, 95001, 95000, 94999, 94998, 94997, 94996, 94995, 94994, 94993, 94992, 94991, 94990, 94989, 94988, 94987, 94986, 94985, 94984, 94983, 94982, 94981, 94980, 94979, 94978, 94977, 94976, 94975, 94974, 94973, 94972, 94971, 94970, 94969, 94968, 94967, 94966, 94965, 94964, 94963, 94962, 94961, 94960, 94959, 94958, 94957, 94956, 94955, 94954, 94953, 94952, 94951, 94950, 94949, 94948, 94947, 94946, 94945, 94944, 94943, 94942, 94941, 94940, 94939, 94938, 94937, 94936, 94935, 94934, 94933, 94932, 94931, 94930, 94929, 94928, 94927, 94926, 94925, 94924, 94923, 94922, 94921, 94920, 94919, 94918, 94917, 94916, 94915, 94914, 94913, 94912, 94911, 94910, 94909, 94908, 94907, 94906, 94905, 94904, 94903, 94902, 94901, 94900, 94899, 94898, 94897, 94896, 94895, 94894, 94893, 94892, 94891, 94890, 94889, 94888, 94887, 94886, 94885, 94884, 94883, 94882, 94881, 94880, 94879, 94878, 94877, 94876, 94875, 94874, 94873, 94872, 94871, 94870, 94869, 94868, 94867, 94866, 94865, 94864, 94863, 94862, 94861, 94860, 94859, 94858, 94857, 94856, 94855, 94854, 94853, 94852, 94851, 94850, 94849, 94848, 94847, 94846, 94845, 94844, 94843, 94842, 94841, 94840, 94839, 94838, 94837, 94836, 94835, 94834, 94833, 94832, 94831, 94830, 94829, 94828, 94827, 94826, 94825, 94824, 94823, 94822, 94821, 94820, 94819, 94818, 94817, 94816, 94815, 94814, 94813, 94812, 94811, 94810, 94809, 94808, 94807, 94806, 94805, 94804, 94803, 94802, 94801, 94800, 94799, 94798, 94797, 94796, 94795, 94794, 94793, 94792, 94791, 94790, 94789, 94788, 94787, 94786, 94785, 94784, 94783, 94782, 94781, 94780, 94779, 94778, 94777, 94776, 94775, 94774, 94773, 94772, 94771, 94770, 94769, 94768, 94767, 94766, 94765, 94764, 94763, 94762, 94761, 94760, 94759, 94758, 94757, 94756, 94755, 94754, 94753, 94752, 94751, 94750, 94749, 94748, 94747, 94746, 94745, 94744, 94743, 94742, 94741, 94740, 94739, 94738, 94737, 94736, 94735, 94734, 94733, 94732, 94731, 94730, 94729, 94728, 94727, 94726, 94725, 94724, 94723, 94722, 94721, 94720, 94719, 94718, 94717, 94716, 94715, 94714, 94713, 94712, 94711, 94710, 94709, 94708, 94707, 94706, 94705, 94704, 94703, 94702, 94701, 94700, 94699, 94698, 94697, 94696, 94695, 94694, 94693, 94692, 94691, 94690, 94689, 94688, 94687, 94686, 94685, 94684, 94683, 94682, 94681, 94680, 94679, 94678, 94677, 94676, 94675, 94674, 94673, 94672, 94671, 94670, 94669, 94668, 94667, 94666, 94665, 94664, 94663, 94662, 94661, 94660, 94659, 94658, 94657, 94656, 94655, 94654, 94653, 94652, 94651, 94650, 94649, 94648, 94647, 94646, 94645, 94644, 94643, 94642, 94641, 94640, 94639, 94638, 94637, 94636, 94635, 94634, 94633, 94632, 94631, 94630, 94629, 94628, 94627, 94626, 94625, 94624, 94623, 94622, 94621, 94620, 94619, 94618, 94617, 94616, 94615, 94614, 94613, 94612, 94611, 94610, 94609, 94608, 94607, 94606, 94605, 94604, 94603, 94602, 94601, 94600, 94599, 94598, 94597, 94596, 94595, 94594, 94593, 94592, 94591, 94590, 94589, 94588, 94587, 94586, 94585, 94584, 94583, 94582, 94581, 94580, 94579, 94578, 94577, 94576, 94575, 94574, 94573, 94572, 94571, 94570, 94569, 94568, 94567, 94566, 94565, 94564, 94563, 94562, 94561, 94560, 94559, 94558, 94557, 94556, 94555, 94554, 94553, 94552, 94551, 94550, 94549, 94548, 94547, 94546, 94545, 94544, 94543, 94542, 94541, 94540, 94539, 94538, 94537, 94536, 94535, 94534, 94533, 94532, 94531, 94530, 94529, 94528, 94527, 94526, 94525, 94524, 94523, 94522, 94521, 94520, 94519, 94518, 94517, 94516, 94515, 94514, 94513, 94512, 94511, 94510, 94509, 94508, 94507, 94506, 94505, 94504, 94503, 94502, 94501, 94500, 94499, 94498, 94497, 94496, 94495, 94494, 94493, 94492, 94491, 94490, 94489, 94488, 94487, 94486, 94485, 94484, 94483, 94482, 94481, 94480, 94479, 94478, 94477, 94476, 94475, 94474, 94473, 94472, 94471, 94470, 94469, 94468, 94467, 94466, 94465, 94464, 94463, 94462, 94461, 94460, 94459, 94458, 94457, 94456, 94455, 94454, 94453, 94452, 94451, 94450, 94449, 94448, 94447, 94446, 94445, 94444, 94443, 94442, 94441, 94440, 94439, 94438, 94437, 94436, 94435, 94434, 94433, 94432, 94431, 94430, 94429, 94428, 94427, 94426, 94425, 94424, 94423, 94422, 94421, 94420, 94419, 94418, 94417, 94416, 94415, 94414, 94413, 94412, 94411, 94410, 94409, 94408, 94407, 94406, 94405, 94404, 94403, 94402, 94401, 94400, 94399, 94398, 94397, 94396, 94395, 94394, 94393, 94392, 94391, 94390, 94389, 94388, 94387, 94386, 94385, 94384, 94383, 94382, 94381, 94380, 94379, 94378, 94377, 94376, 94375, 94374, 94373, 94372, 94371, 94370, 94369, 94368, 94367, 94366, 94365, 94364, 94363, 94362, 94361, 94360, 94359, 94358, 94357, 94356, 94355, 94354, 94353, 94352, 94351, 94350, 94349, 94348, 94347, 94346, 94345, 94344, 94343, 94342, 94341, 94340, 94339, 94338, 94337, 94336, 94335, 94334, 94333, 94332, 94331, 94330, 94329, 94328, 94327, 94326, 94325, 94324, 94323, 94322, 94321, 94320, 94319, 94318, 94317, 94316, 94315, 94314, 94313, 94312, 94311, 94310, 94309, 94308, 94307, 94306, 94305, 94304, 94303, 94302, 94301, 94300, 94299, 94298, 94297, 94296, 94295, 94294, 94293, 94292, 94291, 94290, 94289, 94288, 94287, 94286, 94285, 94284, 94283, 94282, 94281, 94280, 94279, 94278, 94277, 94276, 94275, 94274, 94273, 94272, 94271, 94270, 94269, 94268, 94267, 94266, 94265, 94264, 94263, 94262, 94261, 94260, 94259, 94258, 94257, 94256, 94255, 94254, 94253, 94252, 94251, 94250, 94249, 94248, 94247, 94246, 94245, 94244, 94243, 94242, 94241, 94240, 94239, 94238, 94237, 94236, 94235, 94234, 94233, 94232, 94231, 94230, 94229, 94228, 94227, 94226, 94225, 94224, 94223, 94222, 94221, 94220, 94219, 94218, 94217, 94216, 94215, 94214, 94213, 94212, 94211, 94210, 94209, 94208, 94207, 94206, 94205, 94204, 94203, 94202, 94201, 94200, 94199, 94198, 94197, 94196, 94195, 94194, 94193, 94192, 94191, 94190, 94189, 94188, 94187, 94186, 94185, 94184, 94183, 94182, 94181, 94180, 94179, 94178, 94177, 94176, 94175, 94174, 94173, 94172, 94171, 94170, 94169, 94168, 94167, 94166, 94165, 94164, 94163, 94162, 94161, 94160, 94159, 94158, 94157, 94156, 94155, 94154, 94153, 94152, 94151, 94150, 94149, 94148, 94147, 94146, 94145, 94144, 94143, 94142, 94141, 94140, 94139, 94138, 94137, 94136, 94135, 94134, 94133, 94132, 94131, 94130, 94129, 94128, 94127, 94126, 94125, 94124, 94123, 94122, 94121, 94120, 94119, 94118, 94117, 94116, 94115, 94114, 94113, 94112, 94111, 94110, 94109, 94108, 94107, 94106, 94105, 94104, 94103, 94102, 94101, 94100, 94099, 94098, 94097, 94096, 94095, 94094, 94093, 94092, 94091, 94090, 94089, 94088, 94087, 94086, 94085, 94084, 94083, 94082, 94081, 94080, 94079, 94078, 94077, 94076, 94075, 94074, 94073, 94072, 94071, 94070, 94069, 94068, 94067, 94066, 94065, 94064, 94063, 94062, 94061, 94060, 94059, 94058, 94057, 94056, 94055, 94054, 94053, 94052, 94051, 94050, 94049, 94048, 94047, 94046, 94045, 94044, 94043, 94042, 94041, 94040, 94039, 94038, 94037, 94036, 94035, 94034, 94033, 94032, 94031, 94030, 94029, 94028, 94027, 94026, 94025, 94024, 94023, 94022, 94021, 94020, 94019, 94018, 94017, 94016, 94015, 94014, 94013, 94012, 94011, 94010, 94009, 94008, 94007, 94006, 94005, 94004, 94003, 94002, 94001, 94000, 93999, 93998, 93997, 93996, 93995, 93994, 93993, 93992, 93991, 93990, 93989, 93988, 93987, 93986, 93985, 93984, 93983, 93982, 93981, 93980, 93979, 93978, 93977, 93976, 93975, 93974, 93973, 93972, 93971, 93970, 93969, 93968, 93967, 93966, 93965, 93964, 93963, 93962, 93961, 93960, 93959, 93958, 93957, 93956, 93955, 93954, 93953, 93952, 93951, 93950, 93949, 93948, 93947, 93946, 93945, 93944, 93943, 93942, 93941, 93940, 93939, 93938, 93937, 93936, 93935, 93934, 93933, 93932, 93931, 93930, 93929, 93928, 93927, 93926, 93925, 93924, 93923, 93922, 93921, 93920, 93919, 93918, 93917, 93916, 93915, 93914, 93913, 93912, 93911, 93910, 93909, 93908, 93907, 93906, 93905, 93904, 93903, 93902, 93901, 93900, 93899, 93898, 93897, 93896, 93895, 93894, 93893, 93892, 93891, 93890, 93889, 93888, 93887, 93886, 93885, 93884, 93883, 93882, 93881, 93880, 93879, 93878, 93877, 93876, 93875, 93874, 93873, 93872, 93871, 93870, 93869, 93868, 93867, 93866, 93865, 93864, 93863, 93862, 93861, 93860, 93859, 93858, 93857, 93856, 93855, 93854, 93853, 93852, 93851, 93850, 93849, 93848, 93847, 93846, 93845, 93844, 93843, 93842, 93841, 93840, 93839, 93838, 93837, 93836, 93835, 93834, 93833, 93832, 93831, 93830, 93829, 93828, 93827, 93826, 93825, 93824, 93823, 93822, 93821, 93820, 93819, 93818, 93817, 93816, 93815, 93814, 93813, 93812, 93811, 93810, 93809, 93808, 93807, 93806, 93805, 93804, 93803, 93802, 93801, 93800, 93799, 93798, 93797, 93796, 93795, 93794, 93793, 93792, 93791, 93790, 93789, 93788, 93787, 93786, 93785, 93784, 93783, 93782, 93781, 93780, 93779, 93778, 93777, 93776, 93775, 93774, 93773, 93772, 93771, 93770, 93769, 93768, 93767, 93766, 93765, 93764, 93763, 93762, 93761, 93760, 93759, 93758, 93757, 93756, 93755, 93754, 93753, 93752, 93751, 93750, 93749, 93748, 93747, 93746, 93745, 93744, 93743, 93742, 93741, 93740, 93739, 93738, 93737, 93736, 93735, 93734, 93733, 93732, 93731, 93730, 93729, 93728, 93727, 93726, 93725, 93724, 93723, 93722, 93721, 93720, 93719, 93718, 93717, 93716, 93715, 93714, 93713, 93712, 93711, 93710, 93709, 93708, 93707, 93706, 93705, 93704, 93703, 93702, 93701, 93700, 93699, 93698, 93697, 93696, 93695, 93694, 93693, 93692, 93691, 93690, 93689, 93688, 93687, 93686, 93685, 93684, 93683, 93682, 93681, 93680, 93679, 93678, 93677, 93676, 93675, 93674, 93673, 93672, 93671, 93670, 93669, 93668, 93667, 93666, 93665, 93664, 93663, 93662, 93661, 93660, 93659, 93658, 93657, 93656, 93655, 93654, 93653, 93652, 93651, 93650, 93649, 93648, 93647, 93646, 93645, 93644, 93643, 93642, 93641, 93640, 93639, 93638, 93637, 93636, 93635, 93634, 93633, 93632, 93631, 93630, 93629, 93628, 93627, 93626, 93625, 93624, 93623, 93622, 93621, 93620, 93619, 93618, 93617, 93616, 93615, 93614, 93613, 93612, 93611, 93610, 93609, 93608, 93607, 93606, 93605, 93604, 93603, 93602, 93601, 93600, 93599, 93598, 93597, 93596, 93595, 93594, 93593, 93592, 93591, 93590, 93589, 93588, 93587, 93586, 93585, 93584, 93583, 93582, 93581, 93580, 93579, 93578, 93577, 93576, 93575, 93574, 93573, 93572, 93571, 93570, 93569, 93568, 93567, 93566, 93565, 93564, 93563, 93562, 93561, 93560, 93559, 93558, 93557, 93556, 93555, 93554, 93553, 93552, 93551, 93550, 93549, 93548, 93547, 93546, 93545, 93544, 93543, 93542, 93541, 93540, 93539, 93538, 93537, 93536, 93535, 93534, 93533, 93532, 93531, 93530, 93529, 93528, 93527, 93526, 93525, 93524, 93523, 93522, 93521, 93520, 93519, 93518, 93517, 93516, 93515, 93514, 93513, 93512, 93511, 93510, 93509, 93508, 93507, 93506, 93505, 93504, 93503, 93502, 93501, 93500, 93499, 93498, 93497, 93496, 93495, 93494, 93493, 93492, 93491, 93490, 93489, 93488, 93487, 93486, 93485, 93484, 93483, 93482, 93481, 93480, 93479, 93478, 93477, 93476, 93475, 93474, 93473, 93472, 93471, 93470, 93469, 93468, 93467, 93466, 93465, 93464, 93463, 93462, 93461, 93460, 93459, 93458, 93457, 93456, 93455, 93454, 93453, 93452, 93451, 93450, 93449, 93448, 93447, 93446, 93445, 93444, 93443, 93442, 93441, 93440, 93439, 93438, 93437, 93436, 93435, 93434, 93433, 93432, 93431, 93430, 93429, 93428, 93427, 93426, 93425, 93424, 93423, 93422, 93421, 93420, 93419, 93418, 93417, 93416, 93415, 93414, 93413, 93412, 93411, 93410, 93409, 93408, 93407, 93406, 93405, 93404, 93403, 93402, 93401, 93400, 93399, 93398, 93397, 93396, 93395, 93394, 93393, 93392, 93391, 93390, 93389, 93388, 93387, 93386, 93385, 93384, 93383, 93382, 93381, 93380, 93379, 93378, 93377, 93376, 93375, 93374, 93373, 93372, 93371, 93370, 93369, 93368, 93367, 93366, 93365, 93364, 93363, 93362, 93361, 93360, 93359, 93358, 93357, 93356, 93355, 93354, 93353, 93352, 93351, 93350, 93349, 93348, 93347, 93346, 93345, 93344, 93343, 93342, 93341, 93340, 93339, 93338, 93337, 93336, 93335, 93334, 93333, 93332, 93331, 93330, 93329, 93328, 93327, 93326, 93325, 93324, 93323, 93322, 93321, 93320, 93319, 93318, 93317, 93316, 93315, 93314, 93313, 93312, 93311, 93310, 93309, 93308, 93307, 93306, 93305, 93304, 93303, 93302, 93301, 93300, 93299, 93298, 93297, 93296, 93295, 93294, 93293, 93292, 93291, 93290, 93289, 93288, 93287, 93286, 93285, 93284, 93283, 93282, 93281, 93280, 93279, 93278, 93277, 93276, 93275, 93274, 93273, 93272, 93271, 93270, 93269, 93268, 93267, 93266, 93265, 93264, 93263, 93262, 93261, 93260, 93259, 93258, 93257, 93256, 93255, 93254, 93253, 93252, 93251, 93250, 93249, 93248, 93247, 93246, 93245, 93244, 93243, 93242, 93241, 93240, 93239, 93238, 93237, 93236, 93235, 93234, 93233, 93232, 93231, 93230, 93229, 93228, 93227, 93226, 93225, 93224, 93223, 93222, 93221, 93220, 93219, 93218, 93217, 93216, 93215, 93214, 93213, 93212, 93211, 93210, 93209, 93208, 93207, 93206, 93205, 93204, 93203, 93202, 93201, 93200, 93199, 93198, 93197, 93196, 93195, 93194, 93193, 93192, 93191, 93190, 93189, 93188, 93187, 93186, 93185, 93184, 93183, 93182, 93181, 93180, 93179, 93178, 93177, 93176, 93175, 93174, 93173, 93172, 93171, 93170, 93169, 93168, 93167, 93166, 93165, 93164, 93163, 93162, 93161, 93160, 93159, 93158, 93157, 93156, 93155, 93154, 93153, 93152, 93151, 93150, 93149, 93148, 93147, 93146, 93145, 93144, 93143, 93142, 93141, 93140, 93139, 93138, 93137, 93136, 93135, 93134, 93133, 93132, 93131, 93130, 93129, 93128, 93127, 93126, 93125, 93124, 93123, 93122, 93121, 93120, 93119, 93118, 93117, 93116, 93115, 93114, 93113, 93112, 93111, 93110, 93109, 93108, 93107, 93106, 93105, 93104, 93103, 93102, 93101, 93100, 93099, 93098, 93097, 93096, 93095, 93094, 93093, 93092, 93091, 93090, 93089, 93088, 93087, 93086, 93085, 93084, 93083, 93082, 93081, 93080, 93079, 93078, 93077, 93076, 93075, 93074, 93073, 93072, 93071, 93070, 93069, 93068, 93067, 93066, 93065, 93064, 93063, 93062, 93061, 93060, 93059, 93058, 93057, 93056, 93055, 93054, 93053, 93052, 93051, 93050, 93049, 93048, 93047, 93046, 93045, 93044, 93043, 93042, 93041, 93040, 93039, 93038, 93037, 93036, 93035, 93034, 93033, 93032, 93031, 93030, 93029, 93028, 93027, 93026, 93025, 93024, 93023, 93022, 93021, 93020, 93019, 93018, 93017, 93016, 93015, 93014, 93013, 93012, 93011, 93010, 93009, 93008, 93007, 93006, 93005, 93004, 93003, 93002, 93001, 93000, 92999, 92998, 92997, 92996, 92995, 92994, 92993, 92992, 92991, 92990, 92989, 92988, 92987, 92986, 92985, 92984, 92983, 92982, 92981, 92980, 92979, 92978, 92977, 92976, 92975, 92974, 92973, 92972, 92971, 92970, 92969, 92968, 92967, 92966, 92965, 92964, 92963, 92962, 92961, 92960, 92959, 92958, 92957, 92956, 92955, 92954, 92953, 92952, 92951, 92950, 92949, 92948, 92947, 92946, 92945, 92944, 92943, 92942, 92941, 92940, 92939, 92938, 92937, 92936, 92935, 92934, 92933, 92932, 92931, 92930, 92929, 92928, 92927, 92926, 92925, 92924, 92923, 92922, 92921, 92920, 92919, 92918, 92917, 92916, 92915, 92914, 92913, 92912, 92911, 92910, 92909, 92908, 92907, 92906, 92905, 92904, 92903, 92902, 92901, 92900, 92899, 92898, 92897, 92896, 92895, 92894, 92893, 92892, 92891, 92890, 92889, 92888, 92887, 92886, 92885, 92884, 92883, 92882, 92881, 92880, 92879, 92878, 92877, 92876, 92875, 92874, 92873, 92872, 92871, 92870, 92869, 92868, 92867, 92866, 92865, 92864, 92863, 92862, 92861, 92860, 92859, 92858, 92857, 92856, 92855, 92854, 92853, 92852, 92851, 92850, 92849, 92848, 92847, 92846, 92845, 92844, 92843, 92842, 92841, 92840, 92839, 92838, 92837, 92836, 92835, 92834, 92833, 92832, 92831, 92830, 92829, 92828, 92827, 92826, 92825, 92824, 92823, 92822, 92821, 92820, 92819, 92818, 92817, 92816, 92815, 92814, 92813, 92812, 92811, 92810, 92809, 92808, 92807, 92806, 92805, 92804, 92803, 92802, 92801, 92800, 92799, 92798, 92797, 92796, 92795, 92794, 92793, 92792, 92791, 92790, 92789, 92788, 92787, 92786, 92785, 92784, 92783, 92782, 92781, 92780, 92779, 92778, 92777, 92776, 92775, 92774, 92773, 92772, 92771, 92770, 92769, 92768, 92767, 92766, 92765, 92764, 92763, 92762, 92761, 92760, 92759, 92758, 92757, 92756, 92755, 92754, 92753, 92752, 92751, 92750, 92749, 92748, 92747, 92746, 92745, 92744, 92743, 92742, 92741, 92740, 92739, 92738, 92737, 92736, 92735, 92734, 92733, 92732, 92731, 92730, 92729, 92728, 92727, 92726, 92725, 92724, 92723, 92722, 92721, 92720, 92719, 92718, 92717, 92716, 92715, 92714, 92713, 92712, 92711, 92710, 92709, 92708, 92707, 92706, 92705, 92704, 92703, 92702, 92701, 92700, 92699, 92698, 92697, 92696, 92695, 92694, 92693, 92692, 92691, 92690, 92689, 92688, 92687, 92686, 92685, 92684, 92683, 92682, 92681, 92680, 92679, 92678, 92677, 92676, 92675, 92674, 92673, 92672, 92671, 92670, 92669, 92668, 92667, 92666, 92665, 92664, 92663, 92662, 92661, 92660, 92659, 92658, 92657, 92656, 92655, 92654, 92653, 92652, 92651, 92650, 92649, 92648, 92647, 92646, 92645, 92644, 92643, 92642, 92641, 92640, 92639, 92638, 92637, 92636, 92635, 92634, 92633, 92632, 92631, 92630, 92629, 92628, 92627, 92626, 92625, 92624, 92623, 92622, 92621, 92620, 92619, 92618, 92617, 92616, 92615, 92614, 92613, 92612, 92611, 92610, 92609, 92608, 92607, 92606, 92605, 92604, 92603, 92602, 92601, 92600, 92599, 92598, 92597, 92596, 92595, 92594, 92593, 92592, 92591, 92590, 92589, 92588, 92587, 92586, 92585, 92584, 92583, 92582, 92581, 92580, 92579, 92578, 92577, 92576, 92575, 92574, 92573, 92572, 92571, 92570, 92569, 92568, 92567, 92566, 92565, 92564, 92563, 92562, 92561, 92560, 92559, 92558, 92557, 92556, 92555, 92554, 92553, 92552, 92551, 92550, 92549, 92548, 92547, 92546, 92545, 92544, 92543, 92542, 92541, 92540, 92539, 92538, 92537, 92536, 92535, 92534, 92533, 92532, 92531, 92530, 92529, 92528, 92527, 92526, 92525, 92524, 92523, 92522, 92521, 92520, 92519, 92518, 92517, 92516, 92515, 92514, 92513, 92512, 92511, 92510, 92509, 92508, 92507, 92506, 92505, 92504, 92503, 92502, 92501, 92500, 92499, 92498, 92497, 92496, 92495, 92494, 92493, 92492, 92491, 92490, 92489, 92488, 92487, 92486, 92485, 92484, 92483, 92482, 92481, 92480, 92479, 92478, 92477, 92476, 92475, 92474, 92473, 92472, 92471, 92470, 92469, 92468, 92467, 92466, 92465, 92464, 92463, 92462, 92461, 92460, 92459, 92458, 92457, 92456, 92455, 92454, 92453, 92452, 92451, 92450, 92449, 92448, 92447, 92446, 92445, 92444, 92443, 92442, 92441, 92440, 92439, 92438, 92437, 92436, 92435, 92434, 92433, 92432, 92431, 92430, 92429, 92428, 92427, 92426, 92425, 92424, 92423, 92422, 92421, 92420, 92419, 92418, 92417, 92416, 92415, 92414, 92413, 92412, 92411, 92410, 92409, 92408, 92407, 92406, 92405, 92404, 92403, 92402, 92401, 92400, 92399, 92398, 92397, 92396, 92395, 92394, 92393, 92392, 92391, 92390, 92389, 92388, 92387, 92386, 92385, 92384, 92383, 92382, 92381, 92380, 92379, 92378, 92377, 92376, 92375, 92374, 92373, 92372, 92371, 92370, 92369, 92368, 92367, 92366, 92365, 92364, 92363, 92362, 92361, 92360, 92359, 92358, 92357, 92356, 92355, 92354, 92353, 92352, 92351, 92350, 92349, 92348, 92347, 92346, 92345, 92344, 92343, 92342, 92341, 92340, 92339, 92338, 92337, 92336, 92335, 92334, 92333, 92332, 92331, 92330, 92329, 92328, 92327, 92326, 92325, 92324, 92323, 92322, 92321, 92320, 92319, 92318, 92317, 92316, 92315, 92314, 92313, 92312, 92311, 92310, 92309, 92308, 92307, 92306, 92305, 92304, 92303, 92302, 92301, 92300, 92299, 92298, 92297, 92296, 92295, 92294, 92293, 92292, 92291, 92290, 92289, 92288, 92287, 92286, 92285, 92284, 92283, 92282, 92281, 92280, 92279, 92278, 92277, 92276, 92275, 92274, 92273, 92272, 92271, 92270, 92269, 92268, 92267, 92266, 92265, 92264, 92263, 92262, 92261, 92260, 92259, 92258, 92257, 92256, 92255, 92254, 92253, 92252, 92251, 92250, 92249, 92248, 92247, 92246, 92245, 92244, 92243, 92242, 92241, 92240, 92239, 92238, 92237, 92236, 92235, 92234, 92233, 92232, 92231, 92230, 92229, 92228, 92227, 92226, 92225, 92224, 92223, 92222, 92221, 92220, 92219, 92218, 92217, 92216, 92215, 92214, 92213, 92212, 92211, 92210, 92209, 92208, 92207, 92206, 92205, 92204, 92203, 92202, 92201, 92200, 92199, 92198, 92197, 92196, 92195, 92194, 92193, 92192, 92191, 92190, 92189, 92188, 92187, 92186, 92185, 92184, 92183, 92182, 92181, 92180, 92179, 92178, 92177, 92176, 92175, 92174, 92173, 92172, 92171, 92170, 92169, 92168, 92167, 92166, 92165, 92164, 92163, 92162, 92161, 92160, 92159, 92158, 92157, 92156, 92155, 92154, 92153, 92152, 92151, 92150, 92149, 92148, 92147, 92146, 92145, 92144, 92143, 92142, 92141, 92140, 92139, 92138, 92137, 92136, 92135, 92134, 92133, 92132, 92131, 92130, 92129, 92128, 92127, 92126, 92125, 92124, 92123, 92122, 92121, 92120, 92119, 92118, 92117, 92116, 92115, 92114, 92113, 92112, 92111, 92110, 92109, 92108, 92107, 92106, 92105, 92104, 92103, 92102, 92101, 92100, 92099, 92098, 92097, 92096, 92095, 92094, 92093, 92092, 92091, 92090, 92089, 92088, 92087, 92086, 92085, 92084, 92083, 92082, 92081, 92080, 92079, 92078, 92077, 92076, 92075, 92074, 92073, 92072, 92071, 92070, 92069, 92068, 92067, 92066, 92065, 92064, 92063, 92062, 92061, 92060, 92059, 92058, 92057, 92056, 92055, 92054, 92053, 92052, 92051, 92050, 92049, 92048, 92047, 92046, 92045, 92044, 92043, 92042, 92041, 92040, 92039, 92038, 92037, 92036, 92035, 92034, 92033, 92032, 92031, 92030, 92029, 92028, 92027, 92026, 92025, 92024, 92023, 92022, 92021, 92020, 92019, 92018, 92017, 92016, 92015, 92014, 92013, 92012, 92011, 92010, 92009, 92008, 92007, 92006, 92005, 92004, 92003, 92002, 92001, 92000, 91999, 91998, 91997, 91996, 91995, 91994, 91993, 91992, 91991, 91990, 91989, 91988, 91987, 91986, 91985, 91984, 91983, 91982, 91981, 91980, 91979, 91978, 91977, 91976, 91975, 91974, 91973, 91972, 91971, 91970, 91969, 91968, 91967, 91966, 91965, 91964, 91963, 91962, 91961, 91960, 91959, 91958, 91957, 91956, 91955, 91954, 91953, 91952, 91951, 91950, 91949, 91948, 91947, 91946, 91945, 91944, 91943, 91942, 91941, 91940, 91939, 91938, 91937, 91936, 91935, 91934, 91933, 91932, 91931, 91930, 91929, 91928, 91927, 91926, 91925, 91924, 91923, 91922, 91921, 91920, 91919, 91918, 91917, 91916, 91915, 91914, 91913, 91912, 91911, 91910, 91909, 91908, 91907, 91906, 91905, 91904, 91903, 91902, 91901, 91900, 91899, 91898, 91897, 91896, 91895, 91894, 91893, 91892, 91891, 91890, 91889, 91888, 91887, 91886, 91885, 91884, 91883, 91882, 91881, 91880, 91879, 91878, 91877, 91876, 91875, 91874, 91873, 91872, 91871, 91870, 91869, 91868, 91867, 91866, 91865, 91864, 91863, 91862, 91861, 91860, 91859, 91858, 91857, 91856, 91855, 91854, 91853, 91852, 91851, 91850, 91849, 91848, 91847, 91846, 91845, 91844, 91843, 91842, 91841, 91840, 91839, 91838, 91837, 91836, 91835, 91834, 91833, 91832, 91831, 91830, 91829, 91828, 91827, 91826, 91825, 91824, 91823, 91822, 91821, 91820, 91819, 91818, 91817, 91816, 91815, 91814, 91813, 91812, 91811, 91810, 91809, 91808, 91807, 91806, 91805, 91804, 91803, 91802, 91801, 91800, 91799, 91798, 91797, 91796, 91795, 91794, 91793, 91792, 91791, 91790, 91789, 91788, 91787, 91786, 91785, 91784, 91783, 91782, 91781, 91780, 91779, 91778, 91777, 91776, 91775, 91774, 91773, 91772, 91771, 91770, 91769, 91768, 91767, 91766, 91765, 91764, 91763, 91762, 91761, 91760, 91759, 91758, 91757, 91756, 91755, 91754, 91753, 91752, 91751, 91750, 91749, 91748, 91747, 91746, 91745, 91744, 91743, 91742, 91741, 91740, 91739, 91738, 91737, 91736, 91735, 91734, 91733, 91732, 91731, 91730, 91729, 91728, 91727, 91726, 91725, 91724, 91723, 91722, 91721, 91720, 91719, 91718, 91717, 91716, 91715, 91714, 91713, 91712, 91711, 91710, 91709, 91708, 91707, 91706, 91705, 91704, 91703, 91702, 91701, 91700, 91699, 91698, 91697, 91696, 91695, 91694, 91693, 91692, 91691, 91690, 91689, 91688, 91687, 91686, 91685, 91684, 91683, 91682, 91681, 91680, 91679, 91678, 91677, 91676, 91675, 91674, 91673, 91672, 91671, 91670, 91669, 91668, 91667, 91666, 91665, 91664, 91663, 91662, 91661, 91660, 91659, 91658, 91657, 91656, 91655, 91654, 91653, 91652, 91651, 91650, 91649, 91648, 91647, 91646, 91645, 91644, 91643, 91642, 91641, 91640, 91639, 91638, 91637, 91636, 91635, 91634, 91633, 91632, 91631, 91630, 91629, 91628, 91627, 91626, 91625, 91624, 91623, 91622, 91621, 91620, 91619, 91618, 91617, 91616, 91615, 91614, 91613, 91612, 91611, 91610, 91609, 91608, 91607, 91606, 91605, 91604, 91603, 91602, 91601, 91600, 91599, 91598, 91597, 91596, 91595, 91594, 91593, 91592, 91591, 91590, 91589, 91588, 91587, 91586, 91585, 91584, 91583, 91582, 91581, 91580, 91579, 91578, 91577, 91576, 91575, 91574, 91573, 91572, 91571, 91570, 91569, 91568, 91567, 91566, 91565, 91564, 91563, 91562, 91561, 91560, 91559, 91558, 91557, 91556, 91555, 91554, 91553, 91552, 91551, 91550, 91549, 91548, 91547, 91546, 91545, 91544, 91543, 91542, 91541, 91540, 91539, 91538, 91537, 91536, 91535, 91534, 91533, 91532, 91531, 91530, 91529, 91528, 91527, 91526, 91525, 91524, 91523, 91522, 91521, 91520, 91519, 91518, 91517, 91516, 91515, 91514, 91513, 91512, 91511, 91510, 91509, 91508, 91507, 91506, 91505, 91504, 91503, 91502, 91501, 91500, 91499, 91498, 91497, 91496, 91495, 91494, 91493, 91492, 91491, 91490, 91489, 91488, 91487, 91486, 91485, 91484, 91483, 91482, 91481, 91480, 91479, 91478, 91477, 91476, 91475, 91474, 91473, 91472, 91471, 91470, 91469, 91468, 91467, 91466, 91465, 91464, 91463, 91462, 91461, 91460, 91459, 91458, 91457, 91456, 91455, 91454, 91453, 91452, 91451, 91450, 91449, 91448, 91447, 91446, 91445, 91444, 91443, 91442, 91441, 91440, 91439, 91438, 91437, 91436, 91435, 91434, 91433, 91432, 91431, 91430, 91429, 91428, 91427, 91426, 91425, 91424, 91423, 91422, 91421, 91420, 91419, 91418, 91417, 91416, 91415, 91414, 91413, 91412, 91411, 91410, 91409, 91408, 91407, 91406, 91405, 91404, 91403, 91402, 91401, 91400, 91399, 91398, 91397, 91396, 91395, 91394, 91393, 91392, 91391, 91390, 91389, 91388, 91387, 91386, 91385, 91384, 91383, 91382, 91381, 91380, 91379, 91378, 91377, 91376, 91375, 91374, 91373, 91372, 91371, 91370, 91369, 91368, 91367, 91366, 91365, 91364, 91363, 91362, 91361, 91360, 91359, 91358, 91357, 91356, 91355, 91354, 91353, 91352, 91351, 91350, 91349, 91348, 91347, 91346, 91345, 91344, 91343, 91342, 91341, 91340, 91339, 91338, 91337, 91336, 91335, 91334, 91333, 91332, 91331, 91330, 91329, 91328, 91327, 91326, 91325, 91324, 91323, 91322, 91321, 91320, 91319, 91318, 91317, 91316, 91315, 91314, 91313, 91312, 91311, 91310, 91309, 91308, 91307, 91306, 91305, 91304, 91303, 91302, 91301, 91300, 91299, 91298, 91297, 91296, 91295, 91294, 91293, 91292, 91291, 91290, 91289, 91288, 91287, 91286, 91285, 91284, 91283, 91282, 91281, 91280, 91279, 91278, 91277, 91276, 91275, 91274, 91273, 91272, 91271, 91270, 91269, 91268, 91267, 91266, 91265, 91264, 91263, 91262, 91261, 91260, 91259, 91258, 91257, 91256, 91255, 91254, 91253, 91252, 91251, 91250, 91249, 91248, 91247, 91246, 91245, 91244, 91243, 91242, 91241, 91240, 91239, 91238, 91237, 91236, 91235, 91234, 91233, 91232, 91231, 91230, 91229, 91228, 91227, 91226, 91225, 91224, 91223, 91222, 91221, 91220, 91219, 91218, 91217, 91216, 91215, 91214, 91213, 91212, 91211, 91210, 91209, 91208, 91207, 91206, 91205, 91204, 91203, 91202, 91201, 91200, 91199, 91198, 91197, 91196, 91195, 91194, 91193, 91192, 91191, 91190, 91189, 91188, 91187, 91186, 91185, 91184, 91183, 91182, 91181, 91180, 91179, 91178, 91177, 91176, 91175, 91174, 91173, 91172, 91171, 91170, 91169, 91168, 91167, 91166, 91165, 91164, 91163, 91162, 91161, 91160, 91159, 91158, 91157, 91156, 91155, 91154, 91153, 91152, 91151, 91150, 91149, 91148, 91147, 91146, 91145, 91144, 91143, 91142, 91141, 91140, 91139, 91138, 91137, 91136, 91135, 91134, 91133, 91132, 91131, 91130, 91129, 91128, 91127, 91126, 91125, 91124, 91123, 91122, 91121, 91120, 91119, 91118, 91117, 91116, 91115, 91114, 91113, 91112, 91111, 91110, 91109, 91108, 91107, 91106, 91105, 91104, 91103, 91102, 91101, 91100, 91099, 91098, 91097, 91096, 91095, 91094, 91093, 91092, 91091, 91090, 91089, 91088, 91087, 91086, 91085, 91084, 91083, 91082, 91081, 91080, 91079, 91078, 91077, 91076, 91075, 91074, 91073, 91072, 91071, 91070, 91069, 91068, 91067, 91066, 91065, 91064, 91063, 91062, 91061, 91060, 91059, 91058, 91057, 91056, 91055, 91054, 91053, 91052, 91051, 91050, 91049, 91048, 91047, 91046, 91045, 91044, 91043, 91042, 91041, 91040, 91039, 91038, 91037, 91036, 91035, 91034, 91033, 91032, 91031, 91030, 91029, 91028, 91027, 91026, 91025, 91024, 91023, 91022, 91021, 91020, 91019, 91018, 91017, 91016, 91015, 91014, 91013, 91012, 91011, 91010, 91009, 91008, 91007, 91006, 91005, 91004, 91003, 91002, 91001, 91000, 90999, 90998, 90997, 90996, 90995, 90994, 90993, 90992, 90991, 90990, 90989, 90988, 90987, 90986, 90985, 90984, 90983, 90982, 90981, 90980, 90979, 90978, 90977, 90976, 90975, 90974, 90973, 90972, 90971, 90970, 90969, 90968, 90967, 90966, 90965, 90964, 90963, 90962, 90961, 90960, 90959, 90958, 90957, 90956, 90955, 90954, 90953, 90952, 90951, 90950, 90949, 90948, 90947, 90946, 90945, 90944, 90943, 90942, 90941, 90940, 90939, 90938, 90937, 90936, 90935, 90934, 90933, 90932, 90931, 90930, 90929, 90928, 90927, 90926, 90925, 90924, 90923, 90922, 90921, 90920, 90919, 90918, 90917, 90916, 90915, 90914, 90913, 90912, 90911, 90910, 90909, 90908, 90907, 90906, 90905, 90904, 90903, 90902, 90901, 90900, 90899, 90898, 90897, 90896, 90895, 90894, 90893, 90892, 90891, 90890, 90889, 90888, 90887, 90886, 90885, 90884, 90883, 90882, 90881, 90880, 90879, 90878, 90877, 90876, 90875, 90874, 90873, 90872, 90871, 90870, 90869, 90868, 90867, 90866, 90865, 90864, 90863, 90862, 90861, 90860, 90859, 90858, 90857, 90856, 90855, 90854, 90853, 90852, 90851, 90850, 90849, 90848, 90847, 90846, 90845, 90844, 90843, 90842, 90841, 90840, 90839, 90838, 90837, 90836, 90835, 90834, 90833, 90832, 90831, 90830, 90829, 90828, 90827, 90826, 90825, 90824, 90823, 90822, 90821, 90820, 90819, 90818, 90817, 90816, 90815, 90814, 90813, 90812, 90811, 90810, 90809, 90808, 90807, 90806, 90805, 90804, 90803, 90802, 90801, 90800, 90799, 90798, 90797, 90796, 90795, 90794, 90793, 90792, 90791, 90790, 90789, 90788, 90787, 90786, 90785, 90784, 90783, 90782, 90781, 90780, 90779, 90778, 90777, 90776, 90775, 90774, 90773, 90772, 90771, 90770, 90769, 90768, 90767, 90766, 90765, 90764, 90763, 90762, 90761, 90760, 90759, 90758, 90757, 90756, 90755, 90754, 90753, 90752, 90751, 90750, 90749, 90748, 90747, 90746, 90745, 90744, 90743, 90742, 90741, 90740, 90739, 90738, 90737, 90736, 90735, 90734, 90733, 90732, 90731, 90730, 90729, 90728, 90727, 90726, 90725, 90724, 90723, 90722, 90721, 90720, 90719, 90718, 90717, 90716, 90715, 90714, 90713, 90712, 90711, 90710, 90709, 90708, 90707, 90706, 90705, 90704, 90703, 90702, 90701, 90700, 90699, 90698, 90697, 90696, 90695, 90694, 90693, 90692, 90691, 90690, 90689, 90688, 90687, 90686, 90685, 90684, 90683, 90682, 90681, 90680, 90679, 90678, 90677, 90676, 90675, 90674, 90673, 90672, 90671, 90670, 90669, 90668, 90667, 90666, 90665, 90664, 90663, 90662, 90661, 90660, 90659, 90658, 90657, 90656, 90655, 90654, 90653, 90652, 90651, 90650, 90649, 90648, 90647, 90646, 90645, 90644, 90643, 90642, 90641, 90640, 90639, 90638, 90637, 90636, 90635, 90634, 90633, 90632, 90631, 90630, 90629, 90628, 90627, 90626, 90625, 90624, 90623, 90622, 90621, 90620, 90619, 90618, 90617, 90616, 90615, 90614, 90613, 90612, 90611, 90610, 90609, 90608, 90607, 90606, 90605, 90604, 90603, 90602, 90601, 90600, 90599, 90598, 90597, 90596, 90595, 90594, 90593, 90592, 90591, 90590, 90589, 90588, 90587, 90586, 90585, 90584, 90583, 90582, 90581, 90580, 90579, 90578, 90577, 90576, 90575, 90574, 90573, 90572, 90571, 90570, 90569, 90568, 90567, 90566, 90565, 90564, 90563, 90562, 90561, 90560, 90559, 90558, 90557, 90556, 90555, 90554, 90553, 90552, 90551, 90550, 90549, 90548, 90547, 90546, 90545, 90544, 90543, 90542, 90541, 90540, 90539, 90538, 90537, 90536, 90535, 90534, 90533, 90532, 90531, 90530, 90529, 90528, 90527, 90526, 90525, 90524, 90523, 90522, 90521, 90520, 90519, 90518, 90517, 90516, 90515, 90514, 90513, 90512, 90511, 90510, 90509, 90508, 90507, 90506, 90505, 90504, 90503, 90502, 90501, 90500, 90499, 90498, 90497, 90496, 90495, 90494, 90493, 90492, 90491, 90490, 90489, 90488, 90487, 90486, 90485, 90484, 90483, 90482, 90481, 90480, 90479, 90478, 90477, 90476, 90475, 90474, 90473, 90472, 90471, 90470, 90469, 90468, 90467, 90466, 90465, 90464, 90463, 90462, 90461, 90460, 90459, 90458, 90457, 90456, 90455, 90454, 90453, 90452, 90451, 90450, 90449, 90448, 90447, 90446, 90445, 90444, 90443, 90442, 90441, 90440, 90439, 90438, 90437, 90436, 90435, 90434, 90433, 90432, 90431, 90430, 90429, 90428, 90427, 90426, 90425, 90424, 90423, 90422, 90421, 90420, 90419, 90418, 90417, 90416, 90415, 90414, 90413, 90412, 90411, 90410, 90409, 90408, 90407, 90406, 90405, 90404, 90403, 90402, 90401, 90400, 90399, 90398, 90397, 90396, 90395, 90394, 90393, 90392, 90391, 90390, 90389, 90388, 90387, 90386, 90385, 90384, 90383, 90382, 90381, 90380, 90379, 90378, 90377, 90376, 90375, 90374, 90373, 90372, 90371, 90370, 90369, 90368, 90367, 90366, 90365, 90364, 90363, 90362, 90361, 90360, 90359, 90358, 90357, 90356, 90355, 90354, 90353, 90352, 90351, 90350, 90349, 90348, 90347, 90346, 90345, 90344, 90343, 90342, 90341, 90340, 90339, 90338, 90337, 90336, 90335, 90334, 90333, 90332, 90331, 90330, 90329, 90328, 90327, 90326, 90325, 90324, 90323, 90322, 90321, 90320, 90319, 90318, 90317, 90316, 90315, 90314, 90313, 90312, 90311, 90310, 90309, 90308, 90307, 90306, 90305, 90304, 90303, 90302, 90301, 90300, 90299, 90298, 90297, 90296, 90295, 90294, 90293, 90292, 90291, 90290, 90289, 90288, 90287, 90286, 90285, 90284, 90283, 90282, 90281, 90280, 90279, 90278, 90277, 90276, 90275, 90274, 90273, 90272, 90271, 90270, 90269, 90268, 90267, 90266, 90265, 90264, 90263, 90262, 90261, 90260, 90259, 90258, 90257, 90256, 90255, 90254, 90253, 90252, 90251, 90250, 90249, 90248, 90247, 90246, 90245, 90244, 90243, 90242, 90241, 90240, 90239, 90238, 90237, 90236, 90235, 90234, 90233, 90232, 90231, 90230, 90229, 90228, 90227, 90226, 90225, 90224, 90223, 90222, 90221, 90220, 90219, 90218, 90217, 90216, 90215, 90214, 90213, 90212, 90211, 90210, 90209, 90208, 90207, 90206, 90205, 90204, 90203, 90202, 90201, 90200, 90199, 90198, 90197, 90196, 90195, 90194, 90193, 90192, 90191, 90190, 90189, 90188, 90187, 90186, 90185, 90184, 90183, 90182, 90181, 90180, 90179, 90178, 90177, 90176, 90175, 90174, 90173, 90172, 90171, 90170, 90169, 90168, 90167, 90166, 90165, 90164, 90163, 90162, 90161, 90160, 90159, 90158, 90157, 90156, 90155, 90154, 90153, 90152, 90151, 90150, 90149, 90148, 90147, 90146, 90145, 90144, 90143, 90142, 90141, 90140, 90139, 90138, 90137, 90136, 90135, 90134, 90133, 90132, 90131, 90130, 90129, 90128, 90127, 90126, 90125, 90124, 90123, 90122, 90121, 90120, 90119, 90118, 90117, 90116, 90115, 90114, 90113, 90112, 90111, 90110, 90109, 90108, 90107, 90106, 90105, 90104, 90103, 90102, 90101, 90100, 90099, 90098, 90097, 90096, 90095, 90094, 90093, 90092, 90091, 90090, 90089, 90088, 90087, 90086, 90085, 90084, 90083, 90082, 90081, 90080, 90079, 90078, 90077, 90076, 90075, 90074, 90073, 90072, 90071, 90070, 90069, 90068, 90067, 90066, 90065, 90064, 90063, 90062, 90061, 90060, 90059, 90058, 90057, 90056, 90055, 90054, 90053, 90052, 90051, 90050, 90049, 90048, 90047, 90046, 90045, 90044, 90043, 90042, 90041, 90040, 90039, 90038, 90037, 90036, 90035, 90034, 90033, 90032, 90031, 90030, 90029, 90028, 90027, 90026, 90025, 90024, 90023, 90022, 90021, 90020, 90019, 90018, 90017, 90016, 90015, 90014, 90013, 90012, 90011, 90010, 90009, 90008, 90007, 90006, 90005, 90004, 90003, 90002, 90001}, + []int{-1,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000}, + }, + + { + []int{}, + []int{}, + }, + + { + []int{1, 1, 1, 1, 1}, + []int{-1, -1, -1, -1, -1}, + }, + + { + []int{4, 3, 2, 1}, + []int{-1, 4, 4, 4}, + }, + + { + []int{1, 2, 1}, + []int{2, -1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_nextGreaterElements(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nextGreaterElements(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_nextGreaterElements(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nextGreaterElements(tc.nums) + } + } +} diff --git a/Algorithms/0504.base-7/README.md b/Algorithms/0504.base-7/README.md new file mode 100755 index 000000000..34ba10fb2 --- /dev/null +++ b/Algorithms/0504.base-7/README.md @@ -0,0 +1,26 @@ +# [504. Base 7](https://leetcode.com/problems/base-7/) + +## 题目 + +Given an integer, return its base 7 string representation. + +Example 1: + +```text +Input: 100 +Output: "202" +``` + +Example 2: + +```text +Input: -7 +Output: "-10" +``` + +Note: +The input will be in range of [-1e7, 1e7]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0504.base-7/base-7.go b/Algorithms/0504.base-7/base-7.go new file mode 100755 index 000000000..0067e90b0 --- /dev/null +++ b/Algorithms/0504.base-7/base-7.go @@ -0,0 +1,24 @@ +package problem0504 + +import "fmt" + +func convertToBase7(num int) string { + if num == 0 { + return "0" + } + + minus := "" + if num < 0 { + minus = "-" + num *= -1 + } + + s := "" + + for num > 0 { + s = fmt.Sprintf("%d", num%7) + s + num /= 7 + } + + return minus + s +} diff --git a/Algorithms/0504.base-7/base-7_test.go b/Algorithms/0504.base-7/base-7_test.go new file mode 100755 index 000000000..8e72e43e9 --- /dev/null +++ b/Algorithms/0504.base-7/base-7_test.go @@ -0,0 +1,49 @@ +package problem0504 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans string +}{ + + { + 0, + "0", + }, + + { + 100, + "202", + }, + + { + -7, + "-10", + }, + + // 可以有多个 testcase +} + +func Test_convertToBase7(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, convertToBase7(tc.num), "输入:%v", tc) + } +} + +func Benchmark_convertToBase7(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + convertToBase7(tc.num) + } + } +} diff --git a/Algorithms/0506.relative-ranks/README.md b/Algorithms/0506.relative-ranks/README.md new file mode 100755 index 000000000..970bc5171 --- /dev/null +++ b/Algorithms/0506.relative-ranks/README.md @@ -0,0 +1,22 @@ +# [506. Relative Ranks](https://leetcode.com/problems/relative-ranks/) + +## 题目 + +Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". + +Example 1: + +```text +Input: [5, 4, 3, 2, 1] +Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"] +Explanation: The first three athletes got the top three highest scores, so they got "Gold Medal", "Silver Medal" and "Bronze Medal". For the left two athletes, you just need to output their relative ranks according to their scores. +``` + +Note: + +1. N is a positive integer and won't exceed 10,000. +1. All the scores of athletes are guaranteed to be unique. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0506.relative-ranks/relative-ranks.go b/Algorithms/0506.relative-ranks/relative-ranks.go new file mode 100755 index 000000000..d74a9ba7f --- /dev/null +++ b/Algorithms/0506.relative-ranks/relative-ranks.go @@ -0,0 +1,48 @@ +package problem0506 + +import ( + "sort" + "strconv" +) + +func findRelativeRanks(nums []int) []string { + res := make([]string, len(nums)) + as := make(athletes, len(nums)) + + for i := range nums { + as[i] = athlete{ + sorce: nums[i], + index: i, + } + } + + sort.Sort(as) + + for i, a := range as { + switch i { + case 0: + res[a.index] = "Gold Medal" + case 1: + res[a.index] = "Silver Medal" + case 2: + res[a.index] = "Bronze Medal" + default: + res[a.index] = strconv.Itoa(i + 1) + } + } + + return res +} + +// athlete 实现了 sort.Interface 接口 +type athlete struct { + sorce, index int +} + +type athletes []athlete + +func (a athletes) Len() int { return len(a) } + +func (a athletes) Less(i, j int) bool { return a[i].sorce > a[j].sorce } + +func (a athletes) Swap(i, j int) { a[i], a[j] = a[j], a[i] } diff --git a/Algorithms/0506.relative-ranks/relative-ranks_test.go b/Algorithms/0506.relative-ranks/relative-ranks_test.go new file mode 100755 index 000000000..9fd711fc3 --- /dev/null +++ b/Algorithms/0506.relative-ranks/relative-ranks_test.go @@ -0,0 +1,44 @@ +package problem0506 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []string +}{ + + { + []int{0, 4, 3, 2, 1}, + []string{"5", "Gold Medal", "Silver Medal", "Bronze Medal", "4"}, + }, + + { + []int{5, 4, 3, 2, 1}, + []string{"Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"}, + }, + + // 可以有多个 testcase +} + +func Test_findRelativeRanks(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRelativeRanks(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_findRelativeRanks(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRelativeRanks(tc.nums) + } + } +} diff --git a/Algorithms/0507.perfect-number/README.md b/Algorithms/0507.perfect-number/README.md new file mode 100755 index 000000000..6170f8944 --- /dev/null +++ b/Algorithms/0507.perfect-number/README.md @@ -0,0 +1,22 @@ +# [507. Perfect Number](https://leetcode.com/problems/perfect-number/) + +## 题目 + +We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. + +Now, given an integer n, write a function that returns true when it is a perfect number and false when it is not. + +Example: + +```text +Input: 28 +Output: True +Explanation: 28 = 1 + 2 + 4 + 7 + 14 +``` + +Note: +The input number n will not exceed 100,000,000. (1e8) + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0507.perfect-number/perfect-number.go b/Algorithms/0507.perfect-number/perfect-number.go new file mode 100755 index 000000000..20dee562d --- /dev/null +++ b/Algorithms/0507.perfect-number/perfect-number.go @@ -0,0 +1,22 @@ +package problem0507 + +import ( + "math" +) + +func checkPerfectNumber(num int) bool { + if num == 1 { + return false + } + + sum := 1 + root := int(math.Sqrt(float64(num))) + + for i := 2; i <= root; i++ { + if num%i == 0 { + sum += i + (num / i) + } + } + + return sum == num +} diff --git a/Algorithms/0507.perfect-number/perfect-number_test.go b/Algorithms/0507.perfect-number/perfect-number_test.go new file mode 100755 index 000000000..68e101a7e --- /dev/null +++ b/Algorithms/0507.perfect-number/perfect-number_test.go @@ -0,0 +1,54 @@ +package problem0507 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans bool +}{ + + { + 100000000, + false, + }, + + { + 1, + false, + }, + + { + 132049, + false, + }, + + { + 28, + true, + }, + + // 可以有多个 testcase +} + +func Test_checkPerfectNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkPerfectNumber(tc.num), "输入:%v", tc) + } +} + +func Benchmark_checkPerfectNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkPerfectNumber(tc.num) + } + } +} diff --git a/Algorithms/0508.most-frequent-subtree-sum/README.md b/Algorithms/0508.most-frequent-subtree-sum/README.md new file mode 100755 index 000000000..930e651a3 --- /dev/null +++ b/Algorithms/0508.most-frequent-subtree-sum/README.md @@ -0,0 +1,34 @@ +# [508. Most Frequent Subtree Sum](https://leetcode.com/problems/most-frequent-subtree-sum/) + +## 题目 + +Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself). So what is the most frequent subtree sum value? If there is a tie, return all the values with the highest frequency in any order. + +Examples 1 + +```text +Input: + 5 + / \ +2 -3 + +return [2, -3, 4], since all the values happen only once, return all of them in any order. +``` + +Examples 2 + +```text +Input: + 5 + / \ +2 -5 + +return [2], since 2 happens twice, however -5 only occur once. +``` + +Note: +You may assume the sum of values in any subtree is in the range of 32-bit signed integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum.go b/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum.go new file mode 100755 index 000000000..d6159ece1 --- /dev/null +++ b/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum.go @@ -0,0 +1,38 @@ +package problem0508 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func findFrequentTreeSum(root *TreeNode) []int { + rec := make(map[int]int) + sum(root, rec) + + res := make([]int, 0, len(rec)) + max := -1 + for s, c := range rec { + if max <= c { + if max < c { + max = c + res = res[0:0] + } + res = append(res , s) + } + } + + return res +} + +// 递归求子树的和,并统计各个和出现的次数 +func sum(root *TreeNode, r map[int]int) int { + if root == nil { + return 0 + } + + s := root.Val + sum(root.Left, r) + sum(root.Right, r) + r[s]++ + + return s +} diff --git a/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum_test.go b/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum_test.go new file mode 100755 index 000000000..448cbe1da --- /dev/null +++ b/Algorithms/0508.most-frequent-subtree-sum/most-frequent-subtree-sum_test.go @@ -0,0 +1,54 @@ +package problem0508 + +import ( + "fmt" + "sort" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []int +}{ + + { + []int{5, 2, -5}, + []int{2, 5, -5}, + []int{2}, + }, + + { + []int{5, 2, -3}, + []int{2, 5, -3}, + []int{2, -3, 4}, + }, + + // 可以有多个 testcase +} + +func Test_findFrequentTreeSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ans := findFrequentTreeSum(root) + sort.Ints(ans) + sort.Ints(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_findFrequentTreeSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findFrequentTreeSum(root) + } + } +} diff --git a/Algorithms/0509.fibonacci-number/README.md b/Algorithms/0509.fibonacci-number/README.md new file mode 100755 index 000000000..f93838e4f --- /dev/null +++ b/Algorithms/0509.fibonacci-number/README.md @@ -0,0 +1,38 @@ +# [509. Fibonacci Number](https://leetcode.com/problems/fibonacci-number/) + +The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, + +```text +F(0) = 0, F(1) = 1 +F(N) = F(N - 1) + F(N - 2), for N > 1. +``` + +Given N, calculate F(N). + +Example 1: + +```text +Input: 2 +Output: 1 +Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1. +``` + +Example 2: + +```text +Input: 3 +Output: 2 +Explanation: F(3) = F(2) + F(1) = 1 + 1 = 2. +``` + +Example 3: + +```text +Input: 4 +Output: 3 +Explanation: F(4) = F(3) + F(2) = 2 + 1 = 3. +``` + +Note: + +- 0 ≤ N ≤ 30. \ No newline at end of file diff --git a/Algorithms/0509.fibonacci-number/fibonacci-number.go b/Algorithms/0509.fibonacci-number/fibonacci-number.go new file mode 100755 index 000000000..863c1d97c --- /dev/null +++ b/Algorithms/0509.fibonacci-number/fibonacci-number.go @@ -0,0 +1,15 @@ +package problem0509 + +var fibs = make([]int, 31) + +func fib(N int) int { + if N == 0 || N == 1 { + return N + } + res := fibs[N] + if res == 0 { + res = fib(N-1) + fib(N-2) + fibs[N] = res + } + return res +} diff --git a/Algorithms/0509.fibonacci-number/fibonacci-number_test.go b/Algorithms/0509.fibonacci-number/fibonacci-number_test.go new file mode 100755 index 000000000..c52d13805 --- /dev/null +++ b/Algorithms/0509.fibonacci-number/fibonacci-number_test.go @@ -0,0 +1,57 @@ +package problem0509 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 30, + 832040, + }, + + { + 2, + 1, + }, + + { + 3, + 2, + }, + + { + 0, + 0, + }, + + { + 4, + 3, + }, + + // 可以有多个 testcase +} + +func Test_fib(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, fib(tc.N), "输入:%v", tc) + } +} + +func Benchmark_fib(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fib(tc.N) + } + } +} diff --git a/Algorithms/0513.find-bottom-left-tree-value/README.md b/Algorithms/0513.find-bottom-left-tree-value/README.md new file mode 100755 index 000000000..d8b01bcc6 --- /dev/null +++ b/Algorithms/0513.find-bottom-left-tree-value/README.md @@ -0,0 +1,41 @@ +# [513. Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value/) + +## 题目 + +Given a binary tree, find the leftmost value in the last row of the tree. + +Example 1: + +```text +Input: + + 2 + / \ + 1 3 + +Output: +1 +``` + +Example 2: + +```text +Input: + 1 + / \ + 2 3 + / / \ + 4 5 6 + / + 7 + +Output: +7 +``` + +Note: +You may assume the tree (i.e., the given root node) is not NULL. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value.go b/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value.go new file mode 100755 index 000000000..1d884ed1d --- /dev/null +++ b/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value.go @@ -0,0 +1,27 @@ +package problem0513 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func findBottomLeftValue(root *TreeNode) int { + queue := []*TreeNode{root} + + for len(queue) > 0 { + root = queue[0] + queue = queue[1:] + + // 先把 Right 边的节点放入 queue 才能保证 + // 最后剩下的 root 是 bottom left + if root.Right != nil { + queue = append(queue, root.Right) + } + if root.Left != nil { + queue = append(queue, root.Left) + } + } + + return root.Val +} diff --git a/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value_test.go b/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value_test.go new file mode 100755 index 000000000..d593ad61b --- /dev/null +++ b/Algorithms/0513.find-bottom-left-tree-value/find-bottom-left-tree-value_test.go @@ -0,0 +1,68 @@ +package problem0513 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{0, -1}, + []int{0, -1}, + -1, + }, + + { + []int{1}, + []int{1}, + 1, + }, + + { + []int{2, 1, 3}, + []int{1, 2, 3}, + 1, + }, + + { + []int{1, 2, 4, 3, 5, 6}, + []int{4, 2, 1, 5, 3, 6}, + 4, + }, + + { + []int{1, 2, 4, 3, 5, 7, 6}, + []int{4, 2, 1, 7, 5, 3, 6}, + 7, + }, + + // 可以有多个 testcase +} + +func Test_findBottomLeftValue(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, findBottomLeftValue(root), "输入:%v", tc) + } +} + +func Benchmark_findBottomLeftValue(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findBottomLeftValue(root) + } + } +} diff --git a/Algorithms/0514.freedom-trail/514.100.png b/Algorithms/0514.freedom-trail/514.100.png new file mode 100644 index 000000000..d398b2112 Binary files /dev/null and b/Algorithms/0514.freedom-trail/514.100.png differ diff --git a/Algorithms/0514.freedom-trail/README.md b/Algorithms/0514.freedom-trail/README.md new file mode 100755 index 000000000..3ae7e2310 --- /dev/null +++ b/Algorithms/0514.freedom-trail/README.md @@ -0,0 +1,36 @@ +# [514. Freedom Trail](https://leetcode.com/problems/freedom-trail/) + +## 题目 + +In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to spell a specific keyword in order to open the door. + +Given a string ring, which represents the code engraved on the outer ring and another string key, which represents the keyword needs to be spelled. You need to find the minimum number of steps in order to spell all the characters in the keyword. + +Initially, the first character of the ring is aligned at 12:00 direction. You need to spell all the characters in the string key one by one by rotating the ring clockwise or anticlockwise to make each character of the string key aligned at 12:00 direction and then by pressing the center button. + +At the stage of rotating the ring to spell the key character key[i]: + +1. You can rotate the ring clockwise or anticlockwise one place, which counts as 1 step. The final purpose of the rotation is to align one of the string ring's characters at the 12:00 direction, where this character must equal to the character key[i]. +1. If the character key[i] has been aligned at the 11:00 direction, you need to press the center button to spell, which also counts as 1 step. After the pressing, you could begin to spell the next character in the key (next stage), otherwise, you've finished all the spelling. + +Example: + +![pic](https://leetcode.com/static/images/problemset/ring.jpg) + +```text +Input: ring = "godding", key = "gd" +Output: 4 +Explanation: For the first key character 'g', since it is already in place, we just need 1 step to spell this character. For the second key character 'd', we need to rotate the ring "godding" anticlockwise by two steps to make it become "ddinggo". Also, we need 1 more step for spelling. So the final output is 4. +``` + +Note: + +1. Length of both ring and key will be in range 1 to 100. +1. There are only lowercase letters in both strings and might be some duplcate characters in both strings. +1. It's guaranteed that string key could always be spelled by rotating the string ring. + +## 解题思路 + +见程序注释 + +![100](514.100.png) \ No newline at end of file diff --git a/Algorithms/0514.freedom-trail/freedom-trail.go b/Algorithms/0514.freedom-trail/freedom-trail.go new file mode 100755 index 000000000..10b63cd1d --- /dev/null +++ b/Algorithms/0514.freedom-trail/freedom-trail.go @@ -0,0 +1,76 @@ +package problem0514 + +func findRotateSteps(ring string, key string) int { + // m 中记录了每个字符所有出现过的位置 + m := make(map[rune][]int, 26) + for i, r := range ring { + m[r] = append(m[r], i) + } + + // ss 记录了到达同一个字符的各个位置的最佳状态 + // 0123456789 + // 例如, ring = "acbcccccbd", + // key = "ab" 时,0 → 2 是最优解 + // key = "abd" 时,0 → 8 → 9 才是最优解 + // 所以,需要记录达到同一个字符的各个位置的状态 + ss := make([]status, 1, len(ring)) + ss[0] = status{ + index: 0, + steps: 0, + } + + size := len(ring) + + for _, r := range key { + temp := make([]status, len(m[r])) + for i, d := range m[r] { + // 寻找到达 r 字符的 d 位置的 steps 最小的解 + s := fromTo(ss[0], d, size) + for i := 1; i < len(ss); i++ { + // s.d 都是一样的,更新 s.steps即可 + s.steps = min(s.steps, fromTo(ss[i], d, size).steps) + } + temp[i] = s + } + ss = temp + } + + res := ss[0].steps + for i := 1; i < len(ss); i++ { + res = min(res, ss[i].steps) + } + + return res +} + +// status 记录了当前的 12:00 方向对应的 ring 中字符的 index +// 和 +// 已经操作的 steps +type status struct { + index, steps int +} + +// 从 s 状态到转动到 ring 的 d 位置,所生成的新状态 +func fromTo(s status, d, size int) status { + a := min(s.index, d) + b := max(s.index, d) + + return status{ + index: d, + steps: s.steps + min(b-a, size-(b-a)) + 1, // +1 表示按下 + } +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0514.freedom-trail/freedom-trail_test.go b/Algorithms/0514.freedom-trail/freedom-trail_test.go new file mode 100755 index 000000000..be481d395 --- /dev/null +++ b/Algorithms/0514.freedom-trail/freedom-trail_test.go @@ -0,0 +1,47 @@ +package problem0514 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ring string + key string + ans int +}{ + + { + "acbcccccbd", + "abd", + 6, + }, + + { + "godding", + "gd", + 4, + }, + + // 可以有多个 testcase +} + +func Test_findRotateSteps(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRotateSteps(tc.ring, tc.key), "输入:%v", tc) + } +} + +func Benchmark_findRotateSteps(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRotateSteps(tc.ring, tc.key) + } + } +} diff --git a/Algorithms/0515.find-largest-value-in-each-tree-row/README.md b/Algorithms/0515.find-largest-value-in-each-tree-row/README.md new file mode 100755 index 000000000..aca5d09fe --- /dev/null +++ b/Algorithms/0515.find-largest-value-in-each-tree-row/README.md @@ -0,0 +1,23 @@ +# [515. Find Largest Value in Each Tree Row](https://leetcode.com/problems/find-largest-value-in-each-tree-row/) + +## 题目 + +You need to find the largest value in each row of a binary tree. + +Example: + +```text +Input: + + 1 + / \ + 3 2 + / \ \ + 5 3 9 + +Output: [1, 3, 9] +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row.go b/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row.go new file mode 100755 index 000000000..aa17156d5 --- /dev/null +++ b/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row.go @@ -0,0 +1,47 @@ +package problem0515 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "math" +) + +type TreeNode = kit.TreeNode + +func largestValues(root *TreeNode) []int { + res := []int{} + if root == nil { + return res + } + + // 进行 BFS + queue := make([]*TreeNode, 1, 1024) + queue[0] = root + n := 1 // 同一个 row 剩余的 node 个数 + max := math.MinInt64 + for len(queue) > 0 { + // 取出当前 row 的 node + node := queue[0] + queue = queue[1:] + n-- + // 更新当前行的 max + if max < node.Val { + max = node.Val + } + // 把下一个 row 的节点,添加入 queue + if node.Left != nil { + queue = append(queue, node.Left) + } + if node.Right != nil { + queue = append(queue, node.Right) + } + // 当同一个 row 的 node 检查完毕后, + // 保存数据,并开启新的一轮检查 + if n == 0 { + n = len(queue) + res = append(res, max) + max = math.MinInt64 + } + } + + return res +} diff --git a/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row_test.go b/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row_test.go new file mode 100755 index 000000000..1404a9ef3 --- /dev/null +++ b/Algorithms/0515.find-largest-value-in-each-tree-row/find-largest-value-in-each-tree-row_test.go @@ -0,0 +1,50 @@ +package problem0515 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []int +}{ + + { + []int{}, + []int{}, + []int{}, + }, + + { + []int{1, 3, 5, 6, 2, 9}, + []int{5, 3, 6, 1, 2, 9}, + []int{1, 3, 9}, + }, + + // 可以有多个 testcase +} + +func Test_largestValues(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, largestValues(root), "输入:%v", tc) + } +} + +func Benchmark_largestValues(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + largestValues(root) + } + } +} diff --git a/Algorithms/0516.longest-palindromic-subsequence/README.md b/Algorithms/0516.longest-palindromic-subsequence/README.md new file mode 100755 index 000000000..49aede2a1 --- /dev/null +++ b/Algorithms/0516.longest-palindromic-subsequence/README.md @@ -0,0 +1,33 @@ +# [516. Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) + +## 题目 + +Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. + +Example 1: + +```text +Input: +"bbbab" + +Output: +4 + +One possible longest palindromic subsequence is "bbbb". +``` + +Example 2: + +```text +Input: +"cbbd" + +Output: +2 + +One possible longest palindromic subsequence is "bb". +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence.go b/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence.go new file mode 100755 index 000000000..d89799adf --- /dev/null +++ b/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence.go @@ -0,0 +1,34 @@ +package problem0516 + +func longestPalindromeSubseq(s string) int { + n := len(s) + + // dp[i][j] 表示 s[i:j+1] 中最长的回文子字符串 + dp := make([][]int, n) + for i := range dp { + dp[i] = make([]int, n) + dp[i][i] = 1 + } + + for Len := 2; Len <= n; Len++ { + for i := 0; i+Len-1 < n; i++ { + j := i + Len - 1 + if s[i] == s[j] { + // 首位相等,则在原先的长度长 +2 + dp[i][j] = dp[i+1][j-1] + 2 + } else { + // 首位不等,则在等于去除首尾后的较长者 + dp[i][j] = max(dp[i+1][j], dp[i][j-1]) + } + } + } + + return dp[0][n-1] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence_test.go b/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence_test.go new file mode 100755 index 000000000..f0721c35a --- /dev/null +++ b/Algorithms/0516.longest-palindromic-subsequence/longest-palindromic-subsequence_test.go @@ -0,0 +1,44 @@ +package problem0516 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "bbbab", + 4, + }, + + { + "cbbd", + 2, + }, + + // 可以有多个 testcase +} + +func Test_longestPalindromeSubseq(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestPalindromeSubseq(tc.s), "输入:%v", tc) + } +} + +func Benchmark_longestPalindromeSubseq(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestPalindromeSubseq(tc.s) + } + } +} diff --git a/Algorithms/0517.super-washing-machines/README.md b/Algorithms/0517.super-washing-machines/README.md new file mode 100755 index 000000000..4bcca1af9 --- /dev/null +++ b/Algorithms/0517.super-washing-machines/README.md @@ -0,0 +1,54 @@ +# [517. Super Washing Machines](https://leetcode.com/problems/super-washing-machines/) + +## 题目 + +You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. + +For each move, you could choose any m (1 ≤ m ≤ n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time . + +Given an integer array representing the number of dresses in each washing machine from left to right on the line, you should find the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1. + +Example1 + +```text +Input: [1,0,5] + +Output: 3 + +Explanation: +1st move: 1 0 <-- 5 => 1 1 4 +2nd move: 1 <-- 1 <-- 4 => 2 1 3 +3rd move: 2 1 <-- 3 => 2 2 2 +``` + +Example2 + +```text +Input: [0,3,0] + +Output: 2 + +Explanation: +1st move: 0 <-- 3 0 => 1 2 0 +2nd move: 1 2 --> 0 => 1 1 1 +``` + +Example3 + +```text +Input: [0,2,0] + +Output: -1 + +Explanation: +It's impossible to make all the three washing machines have the same number of dresses. +``` + +Note: + +1. The range of n is [1, 10000]. +1. The range of dresses number in a super washing machine is [0, 1e5]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0517.super-washing-machines/super-washing-machines.go b/Algorithms/0517.super-washing-machines/super-washing-machines.go new file mode 100755 index 000000000..be82d754f --- /dev/null +++ b/Algorithms/0517.super-washing-machines/super-washing-machines.go @@ -0,0 +1,42 @@ +package problem0517 + +func findMinMoves(machines []int) int { + ok, avg := isOK(machines) + if !ok { + return -1 + } + + cnt := 0 + res := 0 + + for _, m := range machines { + cnt += m - avg + res = max(max(res, abs(cnt)), m-avg) + } + // 解题思路 + // https://leetcode.com/problems/super-washing-machines/discuss/ + + return res +} + +func abs(a int) int { + if a < 0 { + return -a + } + return a +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func isOK(machines []int) (bool, int) { + sum := 0 + for _, m := range machines { + sum += m + } + return sum%len(machines) == 0, sum / len(machines) +} diff --git a/Algorithms/0517.super-washing-machines/super-washing-machines_test.go b/Algorithms/0517.super-washing-machines/super-washing-machines_test.go new file mode 100755 index 000000000..52ff0c2d0 --- /dev/null +++ b/Algorithms/0517.super-washing-machines/super-washing-machines_test.go @@ -0,0 +1,64 @@ +package problem0517 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + machines []int + ans int +}{ + + { + []int{6, 3, 6}, + 1, + }, + + { + []int{4, 0, 0, 4}, + 2, + }, + + { + []int{1, 0, 5, 7, 8, 9}, + 9, + }, + + { + []int{1, 0, 5}, + 3, + }, + + { + []int{0, 3, 0}, + 2, + }, + + { + []int{0, 2, 0}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_findMinMoves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMinMoves(tc.machines), "输入:%v", tc) + } +} + +func Benchmark_findMinMoves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMinMoves(tc.machines) + } + } +} diff --git a/Algorithms/0518.coin-change-2/README.md b/Algorithms/0518.coin-change-2/README.md new file mode 100755 index 000000000..447a90352 --- /dev/null +++ b/Algorithms/0518.coin-change-2/README.md @@ -0,0 +1,43 @@ +# [518. Coin Change 2](https://leetcode.com/problems/coin-change-2/) + +## 题目 + +You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may assume that you have infinite number of each kind of coin. + +Note: You can assume that + +- 0 <= amount <= 5000 +- 1 <= coin <= 5000 +- the number of coins is less than 500 +- the answer is guaranteed to fit into signed 32-bit integer + +Example 1: + +```text +Input: amount = 5, coins = [1, 2, 5] +Output: 4 +Explanation: there are four ways to make up the amount: +5=5 +5=2+2+1 +5=2+1+1+1 +5=1+1+1+1+1 +``` + +Example 2: + +```text +Input: amount = 3, coins = [2] +Output: 0 +Explanation: the amount of 3 cannot be made up just with coins of 2. +``` + +Example 3: + +```text +Input: amount = 10, coins = [10] +Output: 1 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0518.coin-change-2/coin-change-2.go b/Algorithms/0518.coin-change-2/coin-change-2.go new file mode 100755 index 000000000..1010802c2 --- /dev/null +++ b/Algorithms/0518.coin-change-2/coin-change-2.go @@ -0,0 +1,17 @@ +package problem0518 + +func change(amount int, coins []int) int { + // dp[i]表示总额为i时的方案数. + // 转移方程: dp[i] = Σdp[i - coins[j]]; 表示 总额为i时的方案数 = 总额为i-coins[j]的方案数的加和. + dp := make([]int, amount+1) + // 记得初始化dp[0] = 1; 表示总额为0时方案数为1. + dp[0] = 1 + + for _, coin := range coins { + for i := coin; i <= amount; i++ { // 从coin开始遍历,小于coin的值没有意义 + dp[i] += dp[i-coin] + } + } + + return dp[amount] +} diff --git a/Algorithms/0518.coin-change-2/coin-change-2_test.go b/Algorithms/0518.coin-change-2/coin-change-2_test.go new file mode 100755 index 000000000..9e2f60add --- /dev/null +++ b/Algorithms/0518.coin-change-2/coin-change-2_test.go @@ -0,0 +1,59 @@ +package problem0518 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + amount int + coins []int + ans int +}{ + + { + 5, + []int{1, 2, 5}, + 4, + }, + + { + 3, + []int{2}, + 0, + }, + + { + 10, + []int{10}, + 1, + }, + + { + 500, + []int{3, 5, 7, 8, 9, 10, 11}, + 35502874, + }, + + // 可以有多个 testcase +} + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, change(tc.amount, tc.coins), "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + change(tc.amount, tc.coins) + } + } +} diff --git a/Algorithms/0519.random-flip-matrix/README.md b/Algorithms/0519.random-flip-matrix/README.md new file mode 100755 index 000000000..40d2ac102 --- /dev/null +++ b/Algorithms/0519.random-flip-matrix/README.md @@ -0,0 +1,38 @@ +# [519. Random Flip Matrix](https://leetcode.com/problems/random-flip-matrix/) + +## 题目 + +You are given the number of rows n_rowsand number of columns n_colsof a2Dbinary matrixwhere all values are initially 0.Write a function flipwhich choosesa 0 valueuniformly at random,changes it to 1,and then returns the position [row.id, col.id] of that value. Also, write a function reset which sets all values back to 0.Try to minimize the number of calls to system's Math.random() and optimize the time andspace complexity. + +Note: + +1. 1 <= n_rows, n_cols<= 10000 +1. 0 <= row.id < n_rows and 0 <= col.id < n_cols +1. flipwill not be called when the matrix has no0 values left. +1. the total number of calls toflipand resetwill not exceed1000. + +Example 1: + +```text +Input: +["Solution","flip","flip","flip","flip"] +[[2,3],[],[],[],[]] +Output: [null,[0,1],[1,2],[1,0],[1,1]] +``` + +Example 2: + +```text +Input: +["Solution","flip","flip","reset","flip"] +[[1,2],[],[],[],[]] +Output: [null,[0,0],[0,1],null,[0,0]] +``` + +Explanation of Input Syntax: + +The input is two lists:the subroutines calledand theirarguments. Solution's constructorhas two arguments, n_rows and n_cols.flipand reset havenoarguments.Argumentsarealways wrapped with a list, even if there aren't any. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0519.random-flip-matrix/random-flip-matrix.go b/Algorithms/0519.random-flip-matrix/random-flip-matrix.go new file mode 100755 index 000000000..4594b7578 --- /dev/null +++ b/Algorithms/0519.random-flip-matrix/random-flip-matrix.go @@ -0,0 +1,54 @@ +package problem0519 + +import "math/rand" + +// Solution object will be instantiated and called as such: +// obj := Constructor(n_rows, n_cols); +// param_1 := obj.Flip(); +// obj.Reset(); +type Solution struct { + rows, cols int + total int // 矩阵中剩余的 0 的个数 + rec map[int]int +} + +// Constructor 构建 Solution +func Constructor(rows, cols int) Solution { + r := make(map[int]int) + return Solution{ + rows: rows, + cols: cols, + total: rows * cols, + rec: r, + } +} + +// Flip 选择 rows * cols 矩阵中的某个 0 进行翻转 +func (s *Solution) Flip() []int { + if s.total == 0 { + return nil + } + + index := rand.Intn(s.total) + + cand := index + if change, isFound := s.rec[index]; isFound { + cand = change + } + r, c := cand/s.cols, cand%s.cols + + s.total-- + if change, isFound := s.rec[s.total]; isFound { + s.rec[index] = change + } else { + s.rec[index] = s.total + } + + return []int{r, c} +} + +// Reset 把 rows * cols 中的元素全部变成 0 +func (s *Solution) Reset() { + s.total = s.rows * s.cols + s.rec = make(map[int]int) +} diff --git a/Algorithms/0519.random-flip-matrix/random-flip-matrix_test.go b/Algorithms/0519.random-flip-matrix/random-flip-matrix_test.go new file mode 100755 index 000000000..d52b8d79b --- /dev/null +++ b/Algorithms/0519.random-flip-matrix/random-flip-matrix_test.go @@ -0,0 +1,71 @@ +package problem0519 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Solution(t *testing.T) { + ast := assert.New(t) + + rows, cols := 2, 3 + s := Constructor(rows, cols) + + recorder := make([]bool, rows*cols) + for i := 0; i < rows*cols; i++ { + f := s.Flip() + r, c := f[0], f[1] + old := recorder[r*cols+c] + recorder[r*cols+c] = true + ast.False(old) + } + + s.Reset() + + recorder = make([]bool, rows*cols) + for i := 0; i < rows*cols; i++ { + f := s.Flip() + r, c := f[0], f[1] + old := recorder[r*cols+c] + recorder[r*cols+c] = true + ast.False(old) + } + +} +func Test_Solution_2(t *testing.T) { + ast := assert.New(t) + + rows, cols := 1, 2 + s := Constructor(rows, cols) + + recorder := make([]bool, rows*cols) + for i := 0; i < rows*cols; i++ { + f := s.Flip() + r, c := f[0], f[1] + old := recorder[r*cols+c] + recorder[r*cols+c] = true + ast.False(old) + } + + ast.Nil(s.Flip()) +} +func Test_Solution_3(t *testing.T) { + ast := assert.New(t) + + rows, cols := 10000, 10000 + s := Constructor(rows, cols) + + for times := 0; times < 200; times++ { + recorder := make([]bool, rows*cols) + s.Reset() + for i := 0; i < 4; i++ { + f := s.Flip() + r, c := f[0], f[1] + old := recorder[r*cols+c] + recorder[r*cols+c] = true + ast.False(old) + } + } + +} diff --git a/Algorithms/0520.detect-capital/README.md b/Algorithms/0520.detect-capital/README.md new file mode 100755 index 000000000..1aa1eed46 --- /dev/null +++ b/Algorithms/0520.detect-capital/README.md @@ -0,0 +1,34 @@ +# [520. Detect Capital](https://leetcode.com/problems/detect-capital/) + +## 题目 + +Given a word, you need to judge whether the usage of capitals in it is right or not. + +We define the usage of capitals in a word to be right when one of the following cases holds: + +1. All letters in this word are capitals, like "USA". +1. All letters in this word are not capitals, like "leetcode". +1. Only the first letter in this word is capital if it has more than one letter, like "Google". + +Otherwise, we define that this word doesn't use capitals in a right way. + +Example 1: + +```text +Input: "USA" +Output: True +``` + +Example 2: + +```text +Input: "FlaG" +Output: False +``` + +Note: +The input will be a non-empty word consisting of uppercase and lowercase latin letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0520.detect-capital/detect-capital.go b/Algorithms/0520.detect-capital/detect-capital.go new file mode 100755 index 000000000..b0ab6c0a0 --- /dev/null +++ b/Algorithms/0520.detect-capital/detect-capital.go @@ -0,0 +1,19 @@ +package problem0520 + +func detectCapitalUse(word string) bool { + head := word[:1] + tail := word[1:] + if isIn(head, 'A', 'Z') { + return isIn(tail, 'A', 'Z') || isIn(tail, 'a', 'z') + } + return isIn(tail, 'a', 'z') +} + +func isIn(s string, first, last byte) bool { + for i := range s { + if !(first <= s[i] && s[i] <= last) { + return false + } + } + return true +} diff --git a/Algorithms/0520.detect-capital/detect-capital_test.go b/Algorithms/0520.detect-capital/detect-capital_test.go new file mode 100755 index 000000000..653c4cca5 --- /dev/null +++ b/Algorithms/0520.detect-capital/detect-capital_test.go @@ -0,0 +1,54 @@ +package problem0520 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + word string + ans bool +}{ + + { + "leetcode", + true, + }, + + { + "USA", + true, + }, + + { + "aG", + false, + }, + + { + "FlaG", + false, + }, + + // 可以有多个 testcase +} + +func Test_detectCapitalUse(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, detectCapitalUse(tc.word), "输入:%v", tc) + } +} + +func Benchmark_detectCapitalUse(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + detectCapitalUse(tc.word) + } + } +} diff --git a/Algorithms/0521.longest-uncommon-subsequence-i/README.md b/Algorithms/0521.longest-uncommon-subsequence-i/README.md new file mode 100755 index 000000000..01aaf8fde --- /dev/null +++ b/Algorithms/0521.longest-uncommon-subsequence-i/README.md @@ -0,0 +1,28 @@ +# [521. Longest Uncommon Subsequence I](https://leetcode.com/problems/longest-uncommon-subsequence-i/) + +## 题目 + +Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. + +The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this subsequence should not be any subsequence of the other strings. + +A subsequence is a sequence that can be derived from one sequence by deleting some characters without changing the order of the remaining elements. Trivially, any string is a subsequence of itself and an empty string is a subsequence of any string. + +The input will be two strings, and the output needs to be the length of the longest uncommon subsequence. If the longest uncommon subsequence doesn't exist, return -1. + +Example 1: + +```text +Input: "aba", "cdc" +Output: 3 +Explanation: The longest uncommon subsequence is "aba" (or "cdc"), because "aba" is a subsequence of "aba", but not a subsequence of any other strings in the group of two strings. +``` + +Note: + +1. Both strings' lengths will not exceed 100. +1. Only letters from a ~ z will appear in input strings. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i.go b/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i.go new file mode 100755 index 000000000..2d928a3fe --- /dev/null +++ b/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i.go @@ -0,0 +1,15 @@ +package problem0521 + +func findLUSlength(a string, b string) int { + if a == b { + return -1 + } + return max(len(a), len(b)) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i_test.go b/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i_test.go new file mode 100755 index 000000000..4905e97b4 --- /dev/null +++ b/Algorithms/0521.longest-uncommon-subsequence-i/longest-uncommon-subsequence-i_test.go @@ -0,0 +1,59 @@ +package problem0521 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a string + b string + ans int +}{ + + { + "cdc", + "cdc", + -1, + }, + + { + "cdc", + "abba", + 4, + }, + + { + "abba", + "cdc", + 4, + }, + + { + "aba", + "cdc", + 3, + }, + + // 可以有多个 testcase +} + +func Test_findLUSlength(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLUSlength(tc.a, tc.b), "输入:%v", tc) + } +} + +func Benchmark_findLUSlength(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLUSlength(tc.a, tc.b) + } + } +} diff --git a/Algorithms/0522.longest-uncommon-subsequence-ii/README.md b/Algorithms/0522.longest-uncommon-subsequence-ii/README.md new file mode 100755 index 000000000..56a619953 --- /dev/null +++ b/Algorithms/0522.longest-uncommon-subsequence-ii/README.md @@ -0,0 +1,25 @@ +# [522. Longest Uncommon Subsequence II](https://leetcode.com/problems/longest-uncommon-subsequence-ii/) + +## 题目 + +Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this subsequence should not be any subsequence of the other strings. + +A subsequence is a sequence that can be derived from one sequence by deleting some characters without changing the order of the remaining elements. Trivially, any string is a subsequence of itself and an empty string is a subsequence of any string. + +The input will be a list of strings, and the output needs to be the length of the longest uncommon subsequence. If the longest uncommon subsequence doesn't exist, return -1. + +Example 1: + +```text +Input: "aba", "cdc", "eae" +Output: 3 +``` + +Note: + +1. All the given strings' lengths will not exceed 10. +1. The length of the given list will be in the range of [2, 50]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii.go b/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii.go new file mode 100755 index 000000000..9eb173152 --- /dev/null +++ b/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii.go @@ -0,0 +1,72 @@ +package problem0522 + +import ( + "sort" +) + +func findLUSlength(strs []string) int { + // 统计每个单词出现的次数 + count := make(map[string]int, len(strs)) + for _, s := range strs { + count[s]++ + } + + // 让 strs 中的每个单词只出现一次 + // 这样的话,后面检查是否为子字符串的时候,可以避免重复检查 + strs = strs[:0] + for s := range count { + strs = append(strs, s) + } + + // 按照字符串的长度进行降序排列 + // 后面检查是否为子字符串的时候,不用每个都检查一遍 + sort.Sort(stringSlice(strs)) + + for i, s := range strs { + // 筛掉重复的字符串 + if count[s] > 1 { + continue + } + // s 必须不是比 Ta 长的字符串的子字符串才能是要找的解答 + if !isSubOf(s, strs[:i]) { + return len(s) + } + } + + return -1 +} + +// 如果 s 是 ss 中某一个比 s 长的字符串的子字符串,返回 true +// ss 是排序过的 +func isSubOf(s string, ss []string) bool { + for i := range ss { + if isSub(s, ss[i]) { + return true + } + } + return false +} + +// 如果 a 是 b 的子字符串,返回 true +func isSub(a, b string) bool { + aLen, bLen := len(a), len(b) + i, j := 0, 0 + + for i < aLen && j < bLen { + if a[i] == b[j] { + i++ + } + j++ + } + + return i == aLen +} + +// stringSlice 实现了 sort.Interface 接口 +type stringSlice []string + +func (ss stringSlice) Len() int { return len(ss) } + +func (ss stringSlice) Less(i, j int) bool { return len(ss[i]) > len(ss[j]) } + +func (ss stringSlice) Swap(i, j int) { ss[i], ss[j] = ss[j], ss[i] } diff --git a/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii_test.go b/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii_test.go new file mode 100755 index 000000000..6f98d412f --- /dev/null +++ b/Algorithms/0522.longest-uncommon-subsequence-ii/longest-uncommon-subsequence-ii_test.go @@ -0,0 +1,69 @@ +package problem0522 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + strs []string + ans int +}{ + + { + []string{"aabbcc", "aabbcc", "c", "e", "aabbcd"}, + 6, + }, + + { + []string{"aaa", "aaa", "bb", "c", "c", "d", "d"}, + 2, + }, + + { + []string{"a", "b", "c", "d", "e", "f", "a", "b", "c", "d", "e", "f"}, + -1, + }, + + { + []string{"aabbcc", "aabbcc", "bc", "bcc", "aabbccc"}, + 7, + }, + + { + []string{"abcd", "abcd", "abc", "bc"}, + -1, + }, + + { + []string{"abcd", "abcd", "abc", "cde"}, + 3, + }, + + { + []string{"aba", "cdc", "eae"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_findLUSlength(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLUSlength(tc.strs), "输入:%v", tc) + } +} + +func Benchmark_findLUSlength(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLUSlength(tc.strs) + } + } +} diff --git a/Algorithms/0523.continuous-subarray-sum/README.md b/Algorithms/0523.continuous-subarray-sum/README.md new file mode 100755 index 000000000..b8ca023ae --- /dev/null +++ b/Algorithms/0523.continuous-subarray-sum/README.md @@ -0,0 +1,49 @@ +# [523. Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) + +## 题目 + +Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums up to n*k where n is also an integer. + +Example 1: + +```text +Input: [23, 2, 4, 6, 7], k=6 +Output: True +Explanation: Because [2, 4] is a continuous subarray of size 2 and sums up to 6. +``` + +Example 2: + +```text +Input: [23, 2, 6, 4, 7], k=6 +Output: True +Explanation: Because [23, 2, 6, 4, 7] is an continuous subarray of size 5 and sums up to 42. +``` + +Note: + +1. The length of the array won't exceed 10,000. +1. You may assume the sum of all the numbers is in the range of a signed 32-bit integer. + +## 解题思路 + +[来源:LeetCode 523. Continuous Subarray Sum 解题报告](http://blog.csdn.net/camellhf/article/details/58590647) +在讨论里有个大神给出了时间复杂度是O(n)的解法,他的思路非常巧妙,用了数学上的知识,下面给出他的解法的原理: +假设: + +a[i]+a[i+1]+...+a[j]=n1k+q; + +如果存在一个n + +n>j且a[i]+a[i+1]+...+a[j]+...+a[n]=n2k+q; + +那么 + +a[j+1]+...+a[n]=(n2−n1)k + +因此利用这一结果,可以从序列第一个元素开始遍历,不断累加上当前的元素,并求出当前和除以k后的余数,用一个映射记录该余数出现时的下标,如果同一个余数出现了两次,并且两次出现的下标之差大于1,那么就表示在这两个坐标之间的元素之和是k的倍数,因此就可以返回true,否则最后返回false。 + +需要注意的两个地方: + +1. k可能取0,所以只有当k不为0时才对当前的和求余,同时针对于nums = [0, 0], k = 0的情况,需要添加一个初始映射(0, -1)来确保结果的正确。 +1. 下标之差至少为2才算是正确的情况,因为题目要求子序列长度至少为2,以上面的例子就是n至少等于j+2。 \ No newline at end of file diff --git a/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum.go b/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum.go new file mode 100755 index 000000000..bdf7d880f --- /dev/null +++ b/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum.go @@ -0,0 +1,37 @@ +package problem0523 + +func checkSubarraySum(nums []int, k int) bool { + n := len(nums) + + // index 中记录了,每个不同的余数,最早出现的位置 + index := make(map[int]int, n) + // index[0] = -1 是为了以下情况准备的 + // { + // []int{0, 0}, + // 0, + // true, + // }, + index[0] = -1 + + sum := 0 + + for i := 0; i < n; i++ { + sum += nums[i] + if k != 0 { + sum %= k + } + + idx, ok := index[sum] + if ok { + if i-idx > 1 { + return true + } + } else { + // 这个 if - else 结构确保了 index 中记录的值是最早出现的 + index[sum] = i + } + + } + + return false +} diff --git a/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum_test.go b/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum_test.go new file mode 100755 index 000000000..f42a61b13 --- /dev/null +++ b/Algorithms/0523.continuous-subarray-sum/continuous-subarray-sum_test.go @@ -0,0 +1,71 @@ +package problem0523 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans bool +}{ + + { + []int{1, 2}, + 4, + false, + }, + + { + []int{0, 0}, + 0, + true, + }, + + { + []int{23, 2, 4, 6, 7}, + 6, + true, + }, + + { + []int{1, 2, 3, 4}, + 5, + true, + }, + + { + []int{23, 2, 6, 4, 7}, + 6, + true, + }, + + { + []int{23, 2, 6, 4, 7}, + 42, + true, + }, + + // 可以有多个 testcase +} + +func Test_checkSubarraySum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkSubarraySum(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_checkSubarraySum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkSubarraySum(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0524.longest-word-in-dictionary-through-deleting/README.md b/Algorithms/0524.longest-word-in-dictionary-through-deleting/README.md new file mode 100755 index 000000000..ed86ea45e --- /dev/null +++ b/Algorithms/0524.longest-word-in-dictionary-through-deleting/README.md @@ -0,0 +1,35 @@ +# [524. Longest Word in Dictionary through Deleting](https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/) + +## 题目 + +Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string. + +Example 1: + +```text +Input: +s = "abpcplea", d = ["ale","apple","monkey","plea"] + +Output: +"apple" +``` + +Example 2: + +```text +Input: +s = "abpcplea", d = ["a","b","c"] + +Output: +"a" +``` + +Note: + +1. All the strings in the input will only contain lower-case letters. +1. The size of the dictionary won't exceed 1,000. +1. The length of all the strings in the input won't exceed 1,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting.go b/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting.go new file mode 100755 index 000000000..5785e7489 --- /dev/null +++ b/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting.go @@ -0,0 +1,45 @@ +package problem0524 + +import ( + "sort" +) + +func findLongestWord(s string, d []string) string { + // 排序后,第一个符合条件的字符串,就是答案 + sort.Sort(stringSlice(d)) + for i := range d { + if isSub(s, d[i]) { + return d[i] + } + } + return "" +} + +// stringSlice 实现了 sort.Interface 接口 +type stringSlice []string + +func (s stringSlice) Len() int { return len(s) } + +func (s stringSlice) Less(i, j int) bool { + if len(s[i]) == len(s[j]) { + return s[i] < s[j] + } + return len(s[i]) > len(s[j]) +} + +func (s stringSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// return true if sub is sub of s +func isSub(s, sub string) bool { + if len(s) < len(sub) { + return false + } + i, j := 0, 0 + for i < len(s) && j < len(sub) { + if s[i] == sub[j] { + j++ + } + i++ + } + return j == len(sub) +} diff --git a/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting_test.go b/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting_test.go new file mode 100755 index 000000000..02feae9db --- /dev/null +++ b/Algorithms/0524.longest-word-in-dictionary-through-deleting/longest-word-in-dictionary-through-deleting_test.go @@ -0,0 +1,59 @@ +package problem0524 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + d []string + ans string +}{ + + { + "abpcplea", + []string{"ale", "apple", "monkey", "plea"}, + "apple", + }, + + { + "a", + []string{"bc", "c"}, + "", + }, + + { + "a", + []string{"a", "bc", "c"}, + "a", + }, + + { + "abpcplea", + []string{"a", "b", "c"}, + "a", + }, + + // 可以有多个 testcase +} + +func Test_findLongestWord(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLongestWord(tc.s, tc.d), "输入:%v", tc) + } +} + +func Benchmark_findLongestWord(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLongestWord(tc.s, tc.d) + } + } +} diff --git a/Algorithms/0525.contiguous-array/README.md b/Algorithms/0525.contiguous-array/README.md new file mode 100755 index 000000000..c216f2a24 --- /dev/null +++ b/Algorithms/0525.contiguous-array/README.md @@ -0,0 +1,27 @@ +# [525. Contiguous Array](https://leetcode.com/problems/contiguous-array/) + +## 题目 + +Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. + +Example 1: + +```text +Input: [0,1] +Output: 2 +Explanation: [0, 1] is the longest contiguous subarray with equal number of 0 and 1. +``` + +Example 2: + +```text +Input: [0,1,0] +Output: 2 +Explanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1. +``` + +Note: The length of the given binary array will not exceed 50,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0525.contiguous-array/contiguous-array.go b/Algorithms/0525.contiguous-array/contiguous-array.go new file mode 100755 index 000000000..d06de3870 --- /dev/null +++ b/Algorithms/0525.contiguous-array/contiguous-array.go @@ -0,0 +1,31 @@ +package problem0525 + +func findMaxLength(nums []int) int { + delta := make(map[int]int, len(nums)/2) + delta[0] = -1 + + ones, zeros, res := 0, 0, 0 + + for i := range nums { + if nums[i] == 1 { + ones++ + } else { + zeros++ + } + + if j, ok := delta[ones-zeros]; ok { + res = max(res, i-j) + } else { + delta[ones-zeros] = i + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0525.contiguous-array/contiguous-array_test.go b/Algorithms/0525.contiguous-array/contiguous-array_test.go new file mode 100755 index 000000000..5158fe04c --- /dev/null +++ b/Algorithms/0525.contiguous-array/contiguous-array_test.go @@ -0,0 +1,48 @@ +package problem0525 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { +[]int { 0,1,0,1,0,1,0,1,0,0,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,1,0,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,1,1,0,1,0,1,0,0,0,1,1,0,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,1,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,1,0,1,1,1,1,0,1,0,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,0,0,1,1,1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,1,1,1,1,1,0 }, + 17698, + }, + + { + []int{0, 1}, + 2, + }, + + { + []int{0, 1, 0}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMaxLength(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMaxLength(tc.nums) + } + } +} diff --git a/Algorithms/0526.beautiful-arrangement/beautiful-arrangement.go b/Algorithms/0526.beautiful-arrangement/beautiful-arrangement.go index c156c393e..5dbffbafb 100755 --- a/Algorithms/0526.beautiful-arrangement/beautiful-arrangement.go +++ b/Algorithms/0526.beautiful-arrangement/beautiful-arrangement.go @@ -1,4 +1,4 @@ -package Problem0526 +package problem0526 func countArrangement(N int) int { count := 0 diff --git a/Algorithms/0526.beautiful-arrangement/beautiful-arrangement_test.go b/Algorithms/0526.beautiful-arrangement/beautiful-arrangement_test.go index 59880889b..f267219b3 100755 --- a/Algorithms/0526.beautiful-arrangement/beautiful-arrangement_test.go +++ b/Algorithms/0526.beautiful-arrangement/beautiful-arrangement_test.go @@ -1,4 +1,4 @@ -package Problem0526 +package problem0526 import ( "fmt" diff --git a/Algorithms/0528.random-pick-with-weight/README.md b/Algorithms/0528.random-pick-with-weight/README.md new file mode 100755 index 000000000..3535345a2 --- /dev/null +++ b/Algorithms/0528.random-pick-with-weight/README.md @@ -0,0 +1,37 @@ +# [528. Random Pick with Weight](https://leetcode.com/problems/random-pick-with-weight/) + +## 题目 + +Given an array w of positive integers, where w[i] describes the weight of index i,write a function pickIndexwhich randomlypicks an indexin proportionto its weight. + +Note: + +1. 1 <= w.length <= 10000 +1. 1 <= w[i] <= 10^5 +1. pickIndex will be called at most 10000 times. + +Example 1: + +```text +Input: +["Solution","pickIndex"] +[[[1]],[]] +Output: [null,0] +``` + +Example 2: + +```text +Input: +["Solution","pickIndex","pickIndex","pickIndex","pickIndex","pickIndex"] +[[[1,3]],[],[],[],[],[]] +Output: [null,0,1,1,1,0] +``` + +Explanation of Input Syntax: + +The input is two lists:the subroutines calledand theirarguments.Solution'sconstructor has one argument, thearray w. pickIndex has no arguments.Argumentsarealways wrapped with a list, even if there aren't any. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0528.random-pick-with-weight/random-pick-with-weight.go b/Algorithms/0528.random-pick-with-weight/random-pick-with-weight.go new file mode 100755 index 000000000..def74a565 --- /dev/null +++ b/Algorithms/0528.random-pick-with-weight/random-pick-with-weight.go @@ -0,0 +1,38 @@ +package problem0528 + +import ( + "math/rand" + "sort" +) + +// Solution object will be instantiated and called as such: +// obj := Constructor(w); +// param_1 := obj.PickIndex(); +type Solution struct { + counts []int + total int +} + +// Constructor 返回 Solution +func Constructor(w []int) Solution { + total := 0 + counts := make([]int, len(w)) + for i := range w { + total += w[i] + counts[i] = total + } + + return Solution{ + counts: counts, + total: total, + } +} + +// PickIndex 根据权重返回 索引号 +func (s *Solution) PickIndex() int { + cand := rand.Intn(s.total) + index := sort.Search(len(s.counts), func(i int) bool { + return s.counts[i] > cand + }) + return index +} diff --git a/Algorithms/0528.random-pick-with-weight/random-pick-with-weight_test.go b/Algorithms/0528.random-pick-with-weight/random-pick-with-weight_test.go new file mode 100755 index 000000000..6ccb4ead0 --- /dev/null +++ b/Algorithms/0528.random-pick-with-weight/random-pick-with-weight_test.go @@ -0,0 +1,60 @@ +package problem0528 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Solution(t *testing.T) { + ast := assert.New(t) + + w := []int{1, 3} + total := 0. + for i := range w { + total += float64(w[i]) + } + + s := Constructor(w) + count := make([]int, len(w)) + + picks := 10000 + for i := 0; i < picks; i++ { + index := s.PickIndex() + count[index]++ + } + + for i, c := range count { + expected := float64(w[i]) / total + actual := float64(c) / float64(picks) + delta := 0.001 + ast.InDelta(expected, actual, delta) + } + +} +func Test_Solution_2(t *testing.T) { + ast := assert.New(t) + + w := []int{1, 3, 5, 7, 9, 11, 13, 15} + total := 0. + for i := range w { + total += float64(w[i]) + } + + s := Constructor(w) + count := make([]int, len(w)) + + picks := 1000000 + for i := 0; i < picks; i++ { + index := s.PickIndex() + count[index]++ + } + + for i, c := range count { + expected := float64(w[i]) / total + actual := float64(c) / float64(picks) + delta := 0.001 + ast.InDelta(expected, actual, delta) + } + +} diff --git a/Algorithms/0529.minesweeper/README.md b/Algorithms/0529.minesweeper/README.md new file mode 100755 index 000000000..8e57bcf38 --- /dev/null +++ b/Algorithms/0529.minesweeper/README.md @@ -0,0 +1,73 @@ +# [529. Minesweeper](https://leetcode.com/problems/minesweeper/) + +## 题目 + +Let's play the minesweeper game (Wikipedia, online game)! + +You are given a 2D char matrix representing the game board. 'M' represents an unrevealed mine, 'E' represents an unrevealed empty square, 'B' represents a revealed blank square that has no adjacent (above, below, left, right, and all 4 diagonals) mines, digit ('1' to '8') represents how many mines are adjacent to this revealed square, and finally 'X' represents a revealed mine. + +Now given the next click position (row and column indices) among all the unrevealed squares ('M' or 'E'), return the board after revealing this position according to the following rules: + +1. If a mine ('M') is revealed, then the game is over - change it to 'X'. +1. If an empty square ('E') with no adjacent mines is revealed, then change it to revealed blank ('B') and all of its adjacent unrevealed squares should be revealed recursively. +1. If an empty square ('E') with at least one adjacent mine is revealed, then change it to a digit ('1' to '8') representing the number of adjacent mines. +1. Return the board when no more squares will be revealed. + +Example 1: + +```text +Input: + +[['E', 'E', 'E', 'E', 'E'], + ['E', 'E', 'M', 'E', 'E'], + ['E', 'E', 'E', 'E', 'E'], + ['E', 'E', 'E', 'E', 'E']] + +Click : [3,0] + +Output: + +[['B', '1', 'E', '1', 'B'], + ['B', '1', 'M', '1', 'B'], + ['B', '1', '1', '1', 'B'], + ['B', 'B', 'B', 'B', 'B']] +``` + +Explanation: + +![p1](https://leetcode.com/static/images/problemset/minesweeper_example_1.png) + +Example 2: + +```text +Input: + +[['B', '1', 'E', '1', 'B'], + ['B', '1', 'M', '1', 'B'], + ['B', '1', '1', '1', 'B'], + ['B', 'B', 'B', 'B', 'B']] + +Click : [1,2] + +Output: + +[['B', '1', 'E', '1', 'B'], + ['B', '1', 'X', '1', 'B'], + ['B', '1', '1', '1', 'B'], + ['B', 'B', 'B', 'B', 'B']] +``` + +Explanation: + +![p2](https://leetcode.com/static/images/problemset/minesweeper_example_2.png) + +Note: + +1. The range of the input matrix's height and width is [1,50]. +1. The click position will only be an unrevealed square ('M' or 'E'), which also means the input board contains at least one clickable square. +1. The input board won't be a stage when game is over (some mines have been revealed). +1. For simplicity, not mentioned rules should be ignored in this problem. For example, you don't need to reveal all the unrevealed mines when the game is over, consider any cases that you will win the game or flag any squares. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0529.minesweeper/minesweeper.go b/Algorithms/0529.minesweeper/minesweeper.go new file mode 100755 index 000000000..d3a6a02bf --- /dev/null +++ b/Algorithms/0529.minesweeper/minesweeper.go @@ -0,0 +1,77 @@ +package problem0529 + +var dx = []int{-1, -1, -1, 0, 0, 1, 1, 1} +var dy = []int{-1, 0, 1, -1, 1, -1, 0, 1} + +func updateBoard(board [][]byte, click []int) [][]byte { + x, y := click[0], click[1] + + // 如果点击的是 'M' 点,修改后,可以直接返回 + if board[x][y] == 'M' { + board[x][y] = 'X' + return board + } + + return bfs(board, x, y) +} + +// 如果 (x,y) 点是 'E' 点,则修改所有与 (x,y) 相邻的 'E',并返回修改后的 board +// 使用 bfs 搜索 +func bfs(board [][]byte, x, y int) [][]byte { + m, n := len(board), len(board[0]) + isAdded := make([]bool, m*n) + + xs := make([]int, 1, m*n) + ys := make([]int, 1, m*n) + xs[0] = x + ys[0] = y + isAdded[x*n+y] = true + + for len(xs) > 0 { + x = xs[0] + y = ys[0] + xs = xs[1:] + ys = ys[1:] + + bombs := getBumbs(board, x, y) + + if bombs > 0 { + board[x][y] = byte(bombs) + '0' + continue + } + + board[x][y] = 'B' + + // 把 (x,y) 周围的 'E' 点,放入队列 + for k := 0; k < 8; k++ { + i := x + dx[k] + j := y + dy[k] + if 0 <= i && i < m && + 0 <= j && j < n && + board[i][j] == 'E' && + !isAdded[i*n+j] { + xs = append(xs, i) + ys = append(ys, j) + isAdded[i*n+j] = true + } + } + } + + return board +} + +// 获取 (x,y) 点周围的炸弹个数 +func getBumbs(board [][]byte, x, y int) int { + m, n := len(board), len(board[0]) + bombs := 0 + for k := 0; k < 8; k++ { + i := x + dx[k] + j := y + dy[k] + if 0 <= i && i < m && + 0 <= j && j < n && + board[i][j] == 'M' { + bombs++ + } + } + return bombs +} diff --git a/Algorithms/0529.minesweeper/minesweeper_test.go b/Algorithms/0529.minesweeper/minesweeper_test.go new file mode 100755 index 000000000..c22d38689 --- /dev/null +++ b/Algorithms/0529.minesweeper/minesweeper_test.go @@ -0,0 +1,63 @@ +package problem0529 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]byte + click []int + ans [][]byte +}{ + + { + [][]byte{ + {'E', 'E', 'E', 'E', 'E'}, + {'E', 'E', 'M', 'E', 'E'}, + {'E', 'E', 'E', 'E', 'E'}, + {'E', 'E', 'E', 'E', 'E'}}, + []int{3, 0}, + [][]byte{ + {'B', '1', 'E', '1', 'B'}, + {'B', '1', 'M', '1', 'B'}, + {'B', '1', '1', '1', 'B'}, + {'B', 'B', 'B', 'B', 'B'}}, + }, + + { + [][]byte{ + {'B', '1', 'E', '1', 'B'}, + {'B', '1', 'M', '1', 'B'}, + {'B', '1', '1', '1', 'B'}, + {'B', 'B', 'B', 'B', 'B'}}, + []int{1, 2}, + [][]byte{ + {'B', '1', 'E', '1', 'B'}, + {'B', '1', 'X', '1', 'B'}, + {'B', '1', '1', '1', 'B'}, + {'B', 'B', 'B', 'B', 'B'}}, + }, + + // 可以有多个 testcase +} + +func Test_updateBoard(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, updateBoard(tc.board, tc.click), "输入:%v", tc) + } +} + +func Benchmark_updateBoard(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + updateBoard(tc.board, tc.click) + } + } +} diff --git a/Algorithms/0530.minimum-absolute-difference-in-bst/README.md b/Algorithms/0530.minimum-absolute-difference-in-bst/README.md new file mode 100755 index 000000000..3cc70c3e4 --- /dev/null +++ b/Algorithms/0530.minimum-absolute-difference-in-bst/README.md @@ -0,0 +1,30 @@ +# [530. Minimum Absolute Difference in BST](https://leetcode.com/problems/minimum-absolute-difference-in-bst/) + +## 题目 + +Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. + +Example: + +```text +Input: + + 1 + \ + 3 + / + 2 + +Output: +1 + +Explanation: +The minimum absolute difference is 1, which is the difference between 2 and 1 (or between 2 and 3). +``` + +Note: +There are at least two nodes in this BST. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst.go b/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst.go new file mode 100755 index 000000000..1e0e8fc47 --- /dev/null +++ b/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst.go @@ -0,0 +1,42 @@ +package problem0530 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) +type TreeNode = kit.TreeNode + +type state struct{ + minDiff , previous int +} + +func getMinimumDifference(root *TreeNode) int { + st:=state{1024,1024} + search(root, &st) + return st.minDiff +} + +// NOTICE: BST 的递归遍历方法 +// 特别好 +func search(root *TreeNode, st *state){ + if root == nil{ + return + } + + search(root.Left, st) + + newDiff:=diff(st.previous, root.Val) + if st.minDiff> newDiff{ + st.minDiff = newDiff + } + + st.previous = root.Val + + search(root.Right, st) +} + +func diff(a, b int) int{ + if a > b{ + return a - b + } + return b - a +} diff --git a/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst_test.go b/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst_test.go new file mode 100755 index 000000000..37bb9518c --- /dev/null +++ b/Algorithms/0530.minimum-absolute-difference-in-bst/minimum-absolute-difference-in-bst_test.go @@ -0,0 +1,44 @@ +package problem0530 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{1, 3, 2}, + []int{1, 2, 3}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_getMinimumDifference(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, getMinimumDifference(root), "输入:%v", tc) + } +} + +func Benchmark_getMinimumDifference(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + getMinimumDifference(root) + } + } +} diff --git a/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array.go b/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array.go index 1bbac7e57..42048379c 100755 --- a/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array.go +++ b/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array.go @@ -1,4 +1,4 @@ -package Problem0532 +package problem0532 func findPairs(nums []int, k int) int { if k < 0 { diff --git a/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array_test.go b/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array_test.go index a0804ea27..3dd805819 100755 --- a/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array_test.go +++ b/Algorithms/0532.k-diff-pairs-in-an-array/k-diff-pairs-in-an-array_test.go @@ -1,4 +1,4 @@ -package Problem0532 +package problem0532 import ( "fmt" diff --git a/Algorithms/0537.complex-number-multiplication/README.md b/Algorithms/0537.complex-number-multiplication/README.md new file mode 100755 index 000000000..6977ff379 --- /dev/null +++ b/Algorithms/0537.complex-number-multiplication/README.md @@ -0,0 +1,32 @@ +# [537. Complex Number Multiplication](https://leetcode.com/problems/complex-number-multiplication/) + +## 题目 + +Given two strings representing two complex numbers. + +You need to return a string representing their multiplication. Note i2 = -1 according to the definition. + +Example 1: + +```text +Input: "1+1i", "1+1i" +Output: "0+2i" +Explanation: (1 + i) * (1 + i) = 1 + i2 + 2 * i = 2i, and you need convert it to the form of 0+2i. +``` + +Example 2: + +```text +Input: "1+-1i", "1+-1i" +Output: "0+-2i" +Explanation: (1 - i) * (1 - i) = 1 + i2 - 2 * i = -2i, and you need convert it to the form of 0+-2i. +``` + +Note: + +1. The input strings will not have extra blank. +1. The input strings will be given in the form of a+bi, where the integer a and b will both belong to the range of [-100, 100]. And the output should be also in this form. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0537.complex-number-multiplication/complex-number-multiplication.go b/Algorithms/0537.complex-number-multiplication/complex-number-multiplication.go new file mode 100755 index 000000000..6ec4888e6 --- /dev/null +++ b/Algorithms/0537.complex-number-multiplication/complex-number-multiplication.go @@ -0,0 +1,26 @@ +package problem0537 + +import ( + "fmt" + "strconv" + "strings" +) + +// c1 = a + b*i +// c2 = c + d*i +// res = (a*c-b*d) + (a*d+b*c)*i +func complexNumberMultiply(c1 string, c2 string) string { + a, b := analyze(c1) + c, d := analyze(c2) + + return fmt.Sprintf("%d+%di", a*c-b*d, a*d+b*c) +} + +// c == re + im*i +// 返回 re 和 im +func analyze(c string) (re, im int) { + ss := strings.Split(c, "+") + re, _ = strconv.Atoi(ss[0]) + im, _ = strconv.Atoi(ss[1][:len(ss[1])-1]) + return +} diff --git a/Algorithms/0537.complex-number-multiplication/complex-number-multiplication_test.go b/Algorithms/0537.complex-number-multiplication/complex-number-multiplication_test.go new file mode 100755 index 000000000..078682586 --- /dev/null +++ b/Algorithms/0537.complex-number-multiplication/complex-number-multiplication_test.go @@ -0,0 +1,47 @@ +package problem0537 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a string + b string + ans string +}{ + + { + "1+1i", + "1+1i", + "0+2i", + }, + + { + "1+-1i", + "1+-1i", + "0+-2i", + }, + + // 可以有多个 testcase +} + +func Test_complexNumberMultiply(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, complexNumberMultiply(tc.a, tc.b), "输入:%v", tc) + } +} + +func Benchmark_complexNumberMultiply(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + complexNumberMultiply(tc.a, tc.b) + } + } +} diff --git a/Algorithms/0538.convert-bst-to-greater-tree/README.md b/Algorithms/0538.convert-bst-to-greater-tree/README.md new file mode 100755 index 000000000..2662663cf --- /dev/null +++ b/Algorithms/0538.convert-bst-to-greater-tree/README.md @@ -0,0 +1,23 @@ +# [538. Convert BST to Greater Tree](https://leetcode.com/problems/convert-bst-to-greater-tree/) + +## 题目 + +Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST. + +Example: + +```text +Input: The root of a Binary Search Tree like this: + 5 + / \ + 2 13 + +Output: The root of a Greater Tree like this: + 18 + / \ + 20 13 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree.go b/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree.go new file mode 100755 index 000000000..6d6412da6 --- /dev/null +++ b/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree.go @@ -0,0 +1,24 @@ +package problem0538 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func convertBST(root *TreeNode) *TreeNode { + sum :=0 + travel(root, &sum) + return root +} + +// 从大到小遍历 BST 并沿路更新 sum 和 节点值 +func travel(root *TreeNode, sum *int) { + if root == nil { + return + } + travel(root.Right, sum) + *sum += root.Val + root.Val= *sum + travel(root.Left, sum) +} \ No newline at end of file diff --git a/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree_test.go b/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree_test.go new file mode 100755 index 000000000..004bbf410 --- /dev/null +++ b/Algorithms/0538.convert-bst-to-greater-tree/convert-bst-to-greater-tree_test.go @@ -0,0 +1,45 @@ +package problem0538 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ansPost []int +}{ + + { + []int{5, 2, 13}, + []int{2, 5, 13}, + []int{20, 13, 18}, + }, + + // 可以有多个 testcase +} + +func Test_convertBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ans := kit.Tree2Postorder(convertBST(root)) + ast.Equal(tc.ansPost, ans) + } +} + +func Benchmark_convertBST(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + convertBST(root) + } + } +} diff --git a/Algorithms/0539.minimum-time-difference/539.100.png b/Algorithms/0539.minimum-time-difference/539.100.png new file mode 100644 index 000000000..2a6b6c02d Binary files /dev/null and b/Algorithms/0539.minimum-time-difference/539.100.png differ diff --git a/Algorithms/0539.minimum-time-difference/README.md b/Algorithms/0539.minimum-time-difference/README.md new file mode 100755 index 000000000..7aa511f46 --- /dev/null +++ b/Algorithms/0539.minimum-time-difference/README.md @@ -0,0 +1,23 @@ +# [539. Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) + +## 题目 + +Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. + +Example 1: + +```text +Input: ["23:59","00:00"] +Output: 1 +``` + +Note: + +1. The number of time points in the given list is at least 2 and won't exceed 20000. +1. The input time is legal and ranges from 00:00 to 23:59. + +## 解题思路 + +见程序注释 + +![100](539.100.png) \ No newline at end of file diff --git a/Algorithms/0539.minimum-time-difference/minimum-time-difference.go b/Algorithms/0539.minimum-time-difference/minimum-time-difference.go new file mode 100755 index 000000000..b2918470d --- /dev/null +++ b/Algorithms/0539.minimum-time-difference/minimum-time-difference.go @@ -0,0 +1,41 @@ +package problem0539 + +import ( + "sort" + "strconv" +) + +func findMinDifference(timePoints []string) int { + n := len(timePoints) + // 把时间按升序排列 + sort.Strings(timePoints) + + // 把 minDiff 设置为 timePoints[n-1] 到 timePoints[0] 的分钟数 + minDiff := 24*60 - diff(timePoints[0], timePoints[n-1]) + + for i := 1; i < n; i++ { + minDiff = min(minDiff, diff(timePoints[i-1], timePoints[i])) + } + + return minDiff +} + +// 返回从 a 到 b 的分钟数 +func diff(a, b string) int { + ha, ma := getHourAndMintueOf(a) + hb, mb := getHourAndMintueOf(b) + return (hb-ha)*60 + (mb - ma) +} + +func getHourAndMintueOf(s string) (hour, minute int) { + hour, _ = strconv.Atoi(s[:2]) + minute, _ = strconv.Atoi(s[3:]) + return +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0539.minimum-time-difference/minimum-time-difference_test.go b/Algorithms/0539.minimum-time-difference/minimum-time-difference_test.go new file mode 100755 index 000000000..02afff644 --- /dev/null +++ b/Algorithms/0539.minimum-time-difference/minimum-time-difference_test.go @@ -0,0 +1,44 @@ +package problem0539 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + timePoints []string + ans int +}{ + + { + []string{"12:08", "13:15", "23:59"}, + 67, + }, + + { + []string{"23:59", "00:00"}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_findMinDifference(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findMinDifference(tc.timePoints), "输入:%v", tc) + } +} + +func Benchmark_findMinDifference(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findMinDifference(tc.timePoints) + } + } +} diff --git a/Algorithms/0540.single-element-in-a-sorted-array/README.md b/Algorithms/0540.single-element-in-a-sorted-array/README.md new file mode 100755 index 000000000..1b3772057 --- /dev/null +++ b/Algorithms/0540.single-element-in-a-sorted-array/README.md @@ -0,0 +1,26 @@ +# [540. Single Element in a Sorted Array](https://leetcode.com/problems/single-element-in-a-sorted-array/) + +## 题目 + +Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once. + +Example 1: + +```text +Input: [1,1,2,3,3,4,4,8,8] +Output: 2 +``` + +Example 2: + +```text +Input: [3,3,7,7,10,11,11] +Output: 10 +``` + +Note: +Your solution should run in O(log n) time and O(1) space. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array.go b/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array.go new file mode 100755 index 000000000..c418393ef --- /dev/null +++ b/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array.go @@ -0,0 +1,31 @@ +package problem0540 + +func singleNonDuplicate(nums []int) int { + n := len(nums) - 1 + lo, hi := 0, n-1 + + // 二分查找 + for lo < hi { + mid := lo + (hi-lo)/2 + // 为了简化后面的判断 + // 让 mid 总是落在偶数位上 + // 这样的话,在遇到单独的数之前,总有 nums[mid] == nums[mid+1] + if mid%2 == 1 { + mid-- + } + + if nums[mid] != nums[mid+1] { + // 单独的数,在 mid 之前 + hi = mid + // hi 没有 -1 是因为 + // 此时的 mid 可能就是答案,-1 的话,有可能会漏掉答案 + } else { + // 单独的数,在 mid 之后 + lo = mid + 2 + // nums[:mid+2] 中肯定没有包含答案,所以,把 mid + 2 放入 lo + } + + } + + return nums[lo] +} diff --git a/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array_test.go b/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array_test.go new file mode 100755 index 000000000..85f262505 --- /dev/null +++ b/Algorithms/0540.single-element-in-a-sorted-array/single-element-in-a-sorted-array_test.go @@ -0,0 +1,49 @@ +package problem0540 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 1, 2}, + 2, + }, + + { + []int{1, 1, 2, 3, 3, 4, 4, 8, 8}, + 2, + }, + + { + []int{3, 3, 7, 7, 10, 11, 11}, + 10, + }, + + // 可以有多个 testcase +} + +func Test_singleNonDuplicate(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, singleNonDuplicate(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_singleNonDuplicate(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + singleNonDuplicate(tc.nums) + } + } +} diff --git a/Algorithms/0541.reverse-string-ii/README.md b/Algorithms/0541.reverse-string-ii/README.md new file mode 100755 index 000000000..4b8cff902 --- /dev/null +++ b/Algorithms/0541.reverse-string-ii/README.md @@ -0,0 +1,21 @@ +# [541. Reverse String II](https://leetcode.com/problems/reverse-string-ii/) + +## 题目 + +Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse all of them. If there are less than 2k but greater than or equal to k characters, then reverse the first k characters and left the other as original. + +Example: + +```text +Input: s = "abcdefg", k = 2 +Output: "bacdfeg" +``` + +Restrictions: + +1. The string consists of lower English letters only. +1. Length of the given string and k will in the range [1, 10000] + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0541.reverse-string-ii/reverse-string-ii.go b/Algorithms/0541.reverse-string-ii/reverse-string-ii.go new file mode 100755 index 000000000..e4b91e037 --- /dev/null +++ b/Algorithms/0541.reverse-string-ii/reverse-string-ii.go @@ -0,0 +1,28 @@ +package problem0541 + +func reverseStr(s string, k int) string { + bytes := []byte(s) + + for i := 0; i < len(s); i += 2 * k { + j := min(i+k, len(s)) + reverse(bytes[i:j]) + } + + return string(bytes) +} + +func reverse(bytes []byte) { + i, j := 0, len(bytes)-1 + for i < j { + bytes[i], bytes[j] = bytes[j], bytes[i] + i++ + j-- + } +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0541.reverse-string-ii/reverse-string-ii_test.go b/Algorithms/0541.reverse-string-ii/reverse-string-ii_test.go new file mode 100755 index 000000000..99276c30e --- /dev/null +++ b/Algorithms/0541.reverse-string-ii/reverse-string-ii_test.go @@ -0,0 +1,47 @@ +package problem0541 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + k int + ans string +}{ + + { + "abcdefg", + 3, + "cbadefg", + }, + + { + "abcdefg", + 2, + "bacdfeg", + }, + + // 可以有多个 testcase +} + +func Test_reverseStr(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reverseStr(tc.s, tc.k), "输入:%v", tc) + } +} + +func Benchmark_reverseStr(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseStr(tc.s, tc.k) + } + } +} diff --git a/Algorithms/0542.01-matrix/01-matrix.go b/Algorithms/0542.01-matrix/01-matrix.go new file mode 100755 index 000000000..f655a9427 --- /dev/null +++ b/Algorithms/0542.01-matrix/01-matrix.go @@ -0,0 +1,49 @@ +package problem0542 + +func updateMatrix(matrix [][]int) [][]int { + m, n := len(matrix), len(matrix[0]) + MIN := m * n + + // 根据 左方 和 上方 的格子,更新 (i,j) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if matrix[i][j] == 0 { + continue + } + + matrix[i][j] = MIN + + if 0 <= i-1 { + matrix[i][j] = min(matrix[i][j], matrix[i-1][j]+1) + } + if 0 <= j-1 { + matrix[i][j] = min(matrix[i][j], matrix[i][j-1]+1) + } + } + } + + // 根据 右方 和 下方 的格子,更新 (i,j) + for i := m - 1; 0 <= i; i-- { + for j := n - 1; 0 <= j; j-- { + if matrix[i][j] == 0 { + continue + } + + if i+1 < m { + matrix[i][j] = min(matrix[i][j], matrix[i+1][j]+1) + } + if j+1 < n { + matrix[i][j] = min(matrix[i][j], matrix[i][j+1]+1) + } + } + } + + return matrix +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0542.01-matrix/01-matrix_test.go b/Algorithms/0542.01-matrix/01-matrix_test.go new file mode 100755 index 000000000..d4f73ba95 --- /dev/null +++ b/Algorithms/0542.01-matrix/01-matrix_test.go @@ -0,0 +1,60 @@ +package problem0542 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans [][]int +}{ + + { + [][]int{ + {0, 0, 0}, + {0, 1, 0}, + {0, 0, 0}, + }, + [][]int{ + {0, 0, 0}, + {0, 1, 0}, + {0, 0, 0}, + }, + }, + + { + [][]int{ + {0, 0, 0}, + {0, 1, 0}, + {1, 1, 1}, + }, + [][]int{ + {0, 0, 0}, + {0, 1, 0}, + {1, 2, 1}, + }, + }, + + // 可以有多个 testcase +} + +func Test_updateMatrix(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, updateMatrix(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_updateMatrix(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + updateMatrix(tc.matrix) + } + } +} diff --git a/Algorithms/0542.01-matrix/README.md b/Algorithms/0542.01-matrix/README.md new file mode 100755 index 000000000..bb45a4c8d --- /dev/null +++ b/Algorithms/0542.01-matrix/README.md @@ -0,0 +1,45 @@ +# [542. 01 Matrix](https://leetcode.com/problems/01-matrix/) + +## 题目 + +Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. + +The distance between two adjacent cells is 1. + +Example 1: + +```text +Input: +0 0 0 +0 1 0 +0 0 0 + +Output: +0 0 0 +0 1 0 +0 0 0 +``` + +Example 2: + +```text +Input: +0 0 0 +0 1 0 +1 1 1 + +Output: +0 0 0 +0 1 0 +1 2 1 +``` + +Note: + +1. The number of elements of the given matrix will not exceed 10,000. +1. There are at least one 0 in the given matrix. +1. The cells are adjacent in only four directions: up, down, left and right. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0543.diameter-of-binary-tree/README.md b/Algorithms/0543.diameter-of-binary-tree/README.md new file mode 100755 index 000000000..f53bc106b --- /dev/null +++ b/Algorithms/0543.diameter-of-binary-tree/README.md @@ -0,0 +1,27 @@ +# [543. Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) + +## 题目 + +Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. + +Example: + +```text +Given a binary tree + 1 + / \ + 2 3 + / \ + 4 5 + + + +Return 3, which is the length of the path [4,2,1,3] or [5,2,1,3]. +``` + +Note: +The length of path between two nodes is represented by the number of edges between them. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree.go b/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree.go new file mode 100755 index 000000000..1f7d39e7d --- /dev/null +++ b/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree.go @@ -0,0 +1,32 @@ +package problem0543 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func diameterOfBinaryTree(root *TreeNode) int { + _, res := helper(root) + return res +} + +func helper(root *TreeNode) (length, diameter int) { + if root == nil { + return + } + + leftLen, leftDia := helper(root.Left) + rightLen, rightDia := helper(root.Right) + + length = max(leftLen, rightLen) + 1 + diameter = max(leftLen+rightLen, max(leftDia, rightDia)) + return +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree_test.go b/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree_test.go new file mode 100755 index 000000000..9667d40ed --- /dev/null +++ b/Algorithms/0543.diameter-of-binary-tree/diameter-of-binary-tree_test.go @@ -0,0 +1,50 @@ +package problem0543 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{}, + []int{}, + 0, + }, + + { + []int{1, 2, 4, 5, 3}, + []int{4, 2, 5, 1, 3}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_diameterOfBinaryTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, diameterOfBinaryTree(root), "输入:%v", tc) + } +} + +func Benchmark_diameterOfBinaryTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + diameterOfBinaryTree(root) + } + } +} diff --git a/Algorithms/0546.remove-boxes/546.100.png b/Algorithms/0546.remove-boxes/546.100.png new file mode 100644 index 000000000..f34d97675 Binary files /dev/null and b/Algorithms/0546.remove-boxes/546.100.png differ diff --git a/Algorithms/0546.remove-boxes/README.md b/Algorithms/0546.remove-boxes/README.md new file mode 100755 index 000000000..30d8b8937 --- /dev/null +++ b/Algorithms/0546.remove-boxes/README.md @@ -0,0 +1,33 @@ +# [546. Remove Boxes](https://leetcode.com/problems/remove-boxes/) + +## 题目 + +Given several boxes with different colors represented by different positive numbers. +You may experience several rounds to remove boxes until there is no box left. Each time you can choose some continuous boxes with the same color (composed of k boxes, k >= 1), remove them and get k*k points. +Find the maximum points you can get. + +Example 1: + +```text +Input: +[1, 3, 2, 2, 2, 3, 4, 3, 1] + +Output: +23 + +Explanation: +[1, 3, 2, 2, 2, 3, 4, 3, 1] +----> [1, 3, 3, 4, 3, 1] (3*3=9 points) +----> [1, 3, 3, 3, 1] (1*1=1 points) +----> [1, 1] (3*3=9 points) +----> [] (2*2=4 points) +``` + +Note: +The number of boxes n would not exceed 100. + +## 解题思路 + +见程序注释 + +![100](546.100.png) \ No newline at end of file diff --git a/Algorithms/0546.remove-boxes/remove-boxes.go b/Algorithms/0546.remove-boxes/remove-boxes.go new file mode 100755 index 000000000..0e437d6fd --- /dev/null +++ b/Algorithms/0546.remove-boxes/remove-boxes.go @@ -0,0 +1,62 @@ +package problem0546 + +func removeBoxes(boxes []int) int { + n := len(boxes) + + // dp[l][r][k] 的值是, + // 在 boxes[l:r+1] 右侧有 k 个和 boxes[r] 一样颜色的 box 再加上 boxes[l:r+1] 可以获取的最大值 + // 所以,题目要求的是 dp[0][n-1][0] 的值 + dp := make([][][]int, n) + for i := 0; i < n; i++ { + dp[i] = make([][]int, n) + for j := 0; j < n; j++ { + dp[i][j] = make([]int, n) + } + } + + return remove(boxes, dp, 0, n-1, 0) +} + +func remove(boxes []int, dp [][][]int, l, r, k int) int { + if l > r { + return 0 + } + + // 已经计算过的情况,直接返回 + if dp[l][r][k] > 0 { + return dp[l][r][k] + } + + // 缩短 boxes[l:r+1] 直到 boxes[r-1] != boxes[r] + // 这是一种优化行为,因为 + // 4*4 > 3*3 + 1*1,同时消除尽可能多的元素,肯定比分开消除好 + // 把下列 for 循环注释掉,也可以得到正确的解答,只是慢一些 + for l < r && boxes[r-1] == boxes[r] { + r-- + k++ + } + + // 第一种选择,把右侧的 k 个元素和 boxes[r] 现在就清除掉 + res := (k+1)*(k+1) + remove(boxes, dp, l, r-1, 0) + + // 第二种选择,把右侧的 k 个元素 和 boxes[r] 留着,等着与 boxes[l:r] 中和 boxes[r]相同颜色的 box 汇合,变得更多了以后,再消除 + for m := r - 1; l <= m; m-- { + if boxes[r] == boxes[m] { + // 此时,boxes[m] 与 boxes[r] 的颜色相同 + // remove(boxes, dp, m+1, r-1, 0)+remove(boxes, dp, l, m, k+1) 的含义是 + // 先把 boxes[m+1:r] 清除掉 → remove(boxes, dp, m+1, r-1, 0) + // boxes[l:m+1] 右侧就有了 k+1 个和 boxes[m] 一样颜色的盒子了,继续递归搜索 + res = max(res, remove(boxes, dp, m+1, r-1, 0)+remove(boxes, dp, l, m, k+1)) + } + } + + dp[l][r][k] = res + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0546.remove-boxes/remove-boxes_test.go b/Algorithms/0546.remove-boxes/remove-boxes_test.go new file mode 100755 index 000000000..6ea0c2ce3 --- /dev/null +++ b/Algorithms/0546.remove-boxes/remove-boxes_test.go @@ -0,0 +1,49 @@ +package problem0546 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + boxes []int + ans int +}{ + + { + []int{}, + 0, + }, + + { + []int{1, 3, 2, 2, 2, 3, 4, 3, 1}, + 23, + }, + + { + []int{3, 8, 8, 5, 5, 3, 9, 2, 4, 4, 6, 5, 8, 4, 8, 6, 9, 6, 2, 8, 6, 4, 1, 9, 5, 3, 10, 5, 3, 3, 9, 8, 8, 6, 5, 3, 7, 4, 9, 6, 3, 9, 4, 3, 5, 10, 7, 6, 10, 7}, + 136, + }, + + // 可以有多个 testcase +} + +func Test_removeBoxes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, removeBoxes(tc.boxes), "输入:%v", tc) + } +} + +func Benchmark_removeBoxes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeBoxes(tc.boxes) + } + } +} diff --git a/Algorithms/0547.friend-circles/README.md b/Algorithms/0547.friend-circles/README.md new file mode 100755 index 000000000..5051ea8e3 --- /dev/null +++ b/Algorithms/0547.friend-circles/README.md @@ -0,0 +1,39 @@ +# [547. Friend Circles](https://leetcode.com/problems/friend-circles/) + +## 题目 + +There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C, then A is an indirect friend of C. And we defined a friend circle is a group of students who are direct or indirect friends. + +Given a N*N matrix M representing the friend relationship between students in the class. If `M[i][j] = 1`, then the ith and jth students are direct friends with each other, otherwise not. And you have to output the total number of friend circles among all the students. + +Example 1: + +```text +Input: +[[1,1,0], + [1,1,0], + [0,0,1]] +Output: 2 +Explanation:The 0th and 1st students are direct friends, so they are in a friend circle. The 2nd student himself is in a friend circle. So return 2. +``` + +Example 2: + +```text +Input: +[[1,1,0], + [1,1,1], + [0,1,1]] +Output: 1 +Explanation:The 0th and 1st students are direct friends, the 1st and 2nd students are direct friends, so the 0th and 2nd students are indirect friends. All of them are in the same friend circle, so return 1. +``` + +Note: + +1. N is in range [1,200]. +1. `M[i][i] = 1` for all students. +1. If `M[i][j] = 1`, then `M[j][i] = 1`. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0547.friend-circles/friend-circles.go b/Algorithms/0547.friend-circles/friend-circles.go new file mode 100755 index 000000000..18754719c --- /dev/null +++ b/Algorithms/0547.friend-circles/friend-circles.go @@ -0,0 +1,34 @@ +package problem0547 + +func findCircleNum(M [][]int) int { + N := len(M) + res := N + + friend := make([]int, res) + for i := 0; i < res; i++ { + friend[i] = i + } + + // s 和 d 是朋友关系 + // 所以,s 的所有朋友都是 d 的朋友 + union := func(s, d int) { + for i := range friend { + if friend[i] == s { + friend[i] = d + } + } + } + + for i := 0; i < N; i++ { + for j := i + 1; j < N; j++ { + if M[i][j] == 1 { + if friend[i] != friend[j] { + res-- + union(friend[i], friend[j]) + } + } + } + } + + return res +} diff --git a/Algorithms/0547.friend-circles/friend-circles_test.go b/Algorithms/0547.friend-circles/friend-circles_test.go new file mode 100755 index 000000000..6e8a83c36 --- /dev/null +++ b/Algorithms/0547.friend-circles/friend-circles_test.go @@ -0,0 +1,79 @@ +package problem0547 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + M [][]int + ans int +}{ + + { + [][]int{ + {1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + {1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1}, + {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}}, + 3, + }, + + { + [][]int{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, + 1, + }, + + { + [][]int{{1, 0, 0, 1}, {0, 1, 1, 0}, {0, 1, 1, 1}, {1, 0, 1, 1}}, + 1, + }, + + { + [][]int{{1, 0, 0, 1}, {0, 1, 1, 0}, {0, 1, 1, 1}, {1, 0, 1, 1}}, + 1, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}, + 2, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 1}, {0, 1, 1}}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_findCircleNum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findCircleNum(tc.M), "输入:%v", tc) + } +} + +func Benchmark_findCircleNum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findCircleNum(tc.M) + } + } +} diff --git a/Algorithms/0551.student-attendance-record-i/README.md b/Algorithms/0551.student-attendance-record-i/README.md new file mode 100755 index 000000000..1ff49927d --- /dev/null +++ b/Algorithms/0551.student-attendance-record-i/README.md @@ -0,0 +1,31 @@ +# [551. Student Attendance Record I](https://leetcode.com/problems/student-attendance-record-i/) + +## 题目 + +You are given a string representing an attendance record for a student. The record only contains the following three characters: + +1. 'A' : Absent. +1. 'L' : Late. +1. 'P' : Present. + +A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late). + +You need to return whether the student could be rewarded according to his attendance record. + +Example 1: + +```text +Input: "PPALLP" +Output: True +``` + +Example 2: + +```text +Input: "PPALLL" +Output: False +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0551.student-attendance-record-i/student-attendance-record-i.go b/Algorithms/0551.student-attendance-record-i/student-attendance-record-i.go new file mode 100755 index 000000000..4d2f05335 --- /dev/null +++ b/Algorithms/0551.student-attendance-record-i/student-attendance-record-i.go @@ -0,0 +1,9 @@ +package problem0551 + +import ( + "strings" +) + +func checkRecord(s string) bool { + return !(strings.Count(s, "A") > 1 || strings.Contains(s, "LLL")) +} diff --git a/Algorithms/0551.student-attendance-record-i/student-attendance-record-i_test.go b/Algorithms/0551.student-attendance-record-i/student-attendance-record-i_test.go new file mode 100755 index 000000000..3322178fa --- /dev/null +++ b/Algorithms/0551.student-attendance-record-i/student-attendance-record-i_test.go @@ -0,0 +1,44 @@ +package problem0551 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans bool +}{ + + { + "PPALLP", + true, + }, + + { + "PPALLL", + false, + }, + + // 可以有多个 testcase +} + +func Test_checkRecord(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkRecord(tc.s), "输入:%v", tc) + } +} + +func Benchmark_checkRecord(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkRecord(tc.s) + } + } +} diff --git a/Algorithms/0552.student-attendance-record-ii/552.100.png b/Algorithms/0552.student-attendance-record-ii/552.100.png new file mode 100644 index 000000000..31f00d889 Binary files /dev/null and b/Algorithms/0552.student-attendance-record-ii/552.100.png differ diff --git a/Algorithms/0552.student-attendance-record-ii/README.md b/Algorithms/0552.student-attendance-record-ii/README.md new file mode 100755 index 000000000..c9de67be3 --- /dev/null +++ b/Algorithms/0552.student-attendance-record-ii/README.md @@ -0,0 +1,33 @@ +# [552. Student Attendance Record II](https://leetcode.com/problems/student-attendance-record-ii/) + +## 题目 + +Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may be very large, return it after mod 109 + 7. + +A student attendance record is a string that only contains the following three characters: + +1. 'A' : Absent. +1. 'L' : Late. +1. 'P' : Present. + +A record is regarded as rewardable if it doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late). + +Example 1: + +```text +Input: n = 2 +Output: 8 +Explanation: +There are 8 records with length 2 will be regarded as rewardable: +"PP" , "AP", "PA", "LP", "PL", "AL", "LA", "LL" +Only "AA" won't be regarded as rewardable owing to more than one absent times. +``` + +Note: +The value of n won't exceed 100,000. + +## 解题思路 + +见程序注释 + +![100](552.100.png) \ No newline at end of file diff --git a/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii.go b/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii.go new file mode 100755 index 000000000..0002d5135 --- /dev/null +++ b/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii.go @@ -0,0 +1,56 @@ +package problem0552 + +var m = 1000000007 + +func checkRecord(n int) int { + // 为了后面的迭代,先分类讨论一下 n + switch n { + case 0: + return 1 + case 1: + return 3 + case 2: // 后面初始化 A 的时候,会有 A[2] + return 8 + } + + // P[i] 表示,共有 i 个记录,且第 i 个记录为 P 的排列数 + P := make([]int, n) + P[0] = 1 + // L[i] 表示,共有 i 个记录,且第 i 个记录为 L 的排列数 + L := make([]int, n) + L[0], L[1] = 1, 3 + // A[i] 表示,共有 i 个记录,且第 i 个记录为 A 的排列数 + A := make([]int, n) + A[0], A[1], A[2] = 1, 2, 4 + // 由以上 P,L,A 的定义可知 + // 所求的答案 T[n-1] == P[n-1] + L[n-1] + A[n-1] + + for i := 1; i < n; i++ { + // 为了避免 P, L, A 中的数字累计过大 + // 对 i-1 上的数进行求余运算 + P[i-1] %= m + L[i-1] %= m + A[i-1] %= m + + // 当第 i 个为 'P' 时 + P[i] = P[i-1] + // i-1 可以为 P + L[i-1] + // i-1 可以为 L + A[i-1] // i-1 可以为 A + + if i > 1 { + // 当第 i 个为 'L' 时 + L[i] = P[i-1] + // i-1 可以为 P + P[i-2] + A[i-2] + // i-1 可以为 L,但是 i-2 必须为 P 或 A + A[i-1] // i-1 可以为 A + } + + if i > 2 { + // 关于下面的表达式,我没有想到数学上的合理解释 + // 具体来源请参考 + // https://discuss.leetcode.com/topic/86696/share-my-o-n-c-dp-solution-with-thinking-process-and-explanation/3 + A[i] = A[i-1] + A[i-2] + A[i-3] + } + } + + return (P[n-1] + L[n-1] + A[n-1]) % m +} diff --git a/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii_test.go b/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii_test.go new file mode 100755 index 000000000..0f0b6ba42 --- /dev/null +++ b/Algorithms/0552.student-attendance-record-ii/student-attendance-record-ii_test.go @@ -0,0 +1,56 @@ +package problem0552 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {0, 1}, + + {1, 3}, + + {3, 19}, + + {2, 8}, + + {4, 43}, + + {5, 94}, + + {10, 3536}, + + {100, 985598218}, + + {1000, 250434094}, + + {10000, 67802379}, + + {100000, 749184020}, + + // 可以有多个 testcase +} + +func Test_checkRecord(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkRecord(tc.n), "输入:%v", tc) + } +} + +func Benchmark_checkRecord(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkRecord(tc.n) + } + } +} diff --git a/Algorithms/0553.optimal-division/README.md b/Algorithms/0553.optimal-division/README.md new file mode 100755 index 000000000..52a216cda --- /dev/null +++ b/Algorithms/0553.optimal-division/README.md @@ -0,0 +1,33 @@ +# [553. Optimal Division](https://leetcode.com/problems/optimal-division/) + +## 题目 + +Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. + +However, you can add any number of parenthesis at any position to change the priority of operations. You should find out how to add parenthesis to get the maximum result, and return the corresponding expression in string format. Your expression should NOT contain redundant parenthesis. + +Example: + +```text +Input: [1000,100,10,2] +Output: "1000/(100/10/2)" +Explanation: +1000/(100/10/2) = 1000/((100/10)/2) = 200 +However, the bold parenthesis in "1000/((100/10)/2)" are redundant, since they don't influence the operation priority. So you should return "1000/(100/10/2)". + +Other cases: +1000/(100/10)/2 = 50 +1000/(100/(10/2)) = 50 +1000/100/10/2 = 0.5 +1000/100/(10/2) = 2 +``` + +Note: + +1. The length of the input array is [1, 10]. +1. Elements in the given array will be in range [2, 1000]. +1. There is only one optimal division for each test case. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0553.optimal-division/optimal-division.go b/Algorithms/0553.optimal-division/optimal-division.go new file mode 100755 index 000000000..5fc1a7440 --- /dev/null +++ b/Algorithms/0553.optimal-division/optimal-division.go @@ -0,0 +1,22 @@ +package problem0553 + +import ( + "strconv" + "strings" +) + +func optimalDivision(nums []int) string { + strs := make([]string, len(nums)) + for i, n := range nums { + strs[i] = strconv.Itoa(n) + } + + switch len(strs) { + case 1: + return strs[0] + case 2: + return strings.Join(strs, "/") + default: + return strs[0] + "/(" + strings.Join(strs[1:], "/") + ")" + } +} diff --git a/Algorithms/0553.optimal-division/optimal-division_test.go b/Algorithms/0553.optimal-division/optimal-division_test.go new file mode 100755 index 000000000..692725841 --- /dev/null +++ b/Algorithms/0553.optimal-division/optimal-division_test.go @@ -0,0 +1,42 @@ +package problem0553 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans string +}{ + + {[]int{1000, 100, 10, 2}, "1000/(100/10/2)"}, + + {[]int{2}, "2"}, + + {[]int{2, 1}, "2/1"}, + + {[]int{5, 2, 1}, "5/(2/1)"}, + + // 可以有多个 testcase +} + +func Test_optimalDivision(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, optimalDivision(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_optimalDivision(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + optimalDivision(tc.nums) + } + } +} diff --git a/Algorithms/0554.brick-wall/README.md b/Algorithms/0554.brick-wall/README.md new file mode 100755 index 000000000..000bd57f5 --- /dev/null +++ b/Algorithms/0554.brick-wall/README.md @@ -0,0 +1,35 @@ +# [554. Brick Wall](https://leetcode.com/problems/brick-wall/) + +## 题目 + +There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. You want to draw a vertical line from the top to the bottom and cross the least bricks. + +The brick wall is represented by a list of rows. Each row is a list of integers representing the width of each brick in this row from left to right. + +If your line go through the edge of a brick, then the brick is not considered as crossed. You need to find out how to draw the line to cross the least bricks and return the number of crossed bricks. + +You cannot draw a line just along one of the two vertical edges of the wall, in which case the line will obviously cross no bricks. + +Example: + +```text +Input: +[[1,2,2,1], + [3,1,2], + [1,3,2], + [2,4], + [3,1,2], + [1,3,1,1]] +Output: 2 +``` + +Explanation: +![](https://leetcode.com/static/images/problemset/brick_wall.png) +Note: + +1. The width sum of bricks in different rows are the same and won't exceed INT_MAX. +1. The number of bricks in each row is in range [1,10,000]. The height of wall is in range [1,10,000]. Total number of bricks of the wall won't exceed 20,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0554.brick-wall/brick-wall.go b/Algorithms/0554.brick-wall/brick-wall.go new file mode 100755 index 000000000..a69169970 --- /dev/null +++ b/Algorithms/0554.brick-wall/brick-wall.go @@ -0,0 +1,25 @@ +package problem0554 + +func leastBricks(wall [][]int) int { + m := len(wall) + + // 统计坐标相同的 edge 出现的次数 + count := make(map[int]int, m) + + for i := 0; i < m; i++ { + sum := wall[i][0] + for j := 1; j < len(wall[i]); j++ { + count[sum]++ + sum += wall[i][j] + } + } + + max := 0 + for _, edges := range count { + if max < edges { + max = edges + } + } + + return m - max +} diff --git a/Algorithms/0554.brick-wall/brick-wall_test.go b/Algorithms/0554.brick-wall/brick-wall_test.go new file mode 100755 index 000000000..a0b954345 --- /dev/null +++ b/Algorithms/0554.brick-wall/brick-wall_test.go @@ -0,0 +1,44 @@ +package problem0554 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + wall [][]int + ans int +}{ + + { + [][]int{{1, 2, 2, 1}, + {3, 1, 2}, + {1, 3, 2}, + {2, 4}, + {3, 1, 2}, + {1, 3, 1, 1}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_leastBricks(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, leastBricks(tc.wall), "输入:%v", tc) + } +} + +func Benchmark_leastBricks(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + leastBricks(tc.wall) + } + } +} diff --git a/Algorithms/0556.next-greater-element-iii/README.md b/Algorithms/0556.next-greater-element-iii/README.md new file mode 100755 index 000000000..6ee58dba0 --- /dev/null +++ b/Algorithms/0556.next-greater-element-iii/README.md @@ -0,0 +1,23 @@ +# [556. Next Greater Element III](https://leetcode.com/problems/next-greater-element-iii/) + +## 题目 + +Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive 32-bit integer exists, you need to return -1. + +Example 1: + +```text +Input: 12 +Output: 21 +``` + +Example 2: + +```text +Input: 21 +Output: -1 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0556.next-greater-element-iii/next-greater-element-iii.go b/Algorithms/0556.next-greater-element-iii/next-greater-element-iii.go new file mode 100755 index 000000000..3b852e4d9 --- /dev/null +++ b/Algorithms/0556.next-greater-element-iii/next-greater-element-iii.go @@ -0,0 +1,90 @@ +package problem0556 + +import "sort" + +func nextGreaterElement(n int) int { + nums := make([]int, 0, 10) + + lastTail := n % 10 + // 用于标记 n 已经为其能表现的最大值 + // 例如, n == 4321,就不可能变得更大了 + isMax := true + for n > 0 { + tail := n % 10 + if tail < lastTail { + // 较高位上存在较小的值 + // n 还可以变大 + isMax = false + } + lastTail = tail + nums = append(nums, tail) + n /= 10 + } + + // 由于 n 不可能再变大了,所以,提前结束 + if isMax { + return -1 + } + + // nums 中 digit 的存入顺序与实际顺序相反 + // 需要逆转一下 nums + reverse(nums) + + // 按照题意,交换 nums 中,两个数的位子 + beg := exchange(nums) + + // 重新排列 nums 尾部的数字,使得 nums 更小 + sort.Ints(nums[beg:]) + + res := combine(nums) + + if res > 1<<31-1 { + return -1 + } + return res +} + +func reverse(ss []int) { + i, j := 0, len(ss)-1 + for i < j { + ss[i], ss[j] = ss[j], ss[i] + i++ + j-- + } +} + +// 找到最大的 i 使得 +// s[j] 是 s[i+1:] 中大于 s[i] 的最小值 +// s[i], s[j] 互换后 +// 返回 i+1 +func exchange(a []int) int { + var i, j int + + for i = len(a) - 2; 0 <= i; i-- { + n := a[i] + min := 10 + index := i + for j = i + 1; j < len(a); j++ { + if n < a[j] && a[j] < min { + min = a[j] + index = j + } + } + + if i < index { + a[i], a[index] = a[index], a[i] + break + } + } + + return i + 1 +} + +// 把 a 整合成一个 int +func combine(a []int) int { + num := 0 + for i := range a { + num = num*10 + a[i] + } + return num +} diff --git a/Algorithms/0556.next-greater-element-iii/next-greater-element-iii_test.go b/Algorithms/0556.next-greater-element-iii/next-greater-element-iii_test.go new file mode 100755 index 000000000..7581cdced --- /dev/null +++ b/Algorithms/0556.next-greater-element-iii/next-greater-element-iii_test.go @@ -0,0 +1,64 @@ +package problem0556 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 12443322, + 13222344, + }, + + { + 2321, + 3122, + }, + + { + 2147483467, + 2147483476, + }, + + { + 2147483647, + -1, + }, + + { + 12, + 21, + }, + + { + 21, + -1, + }, + + // 可以有多个 testcase +} + +func Test_nextGreaterElement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nextGreaterElement(tc.n), "输入:%v", tc) + } +} + +func Benchmark_nextGreaterElement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nextGreaterElement(tc.n) + } + } +} diff --git a/Algorithms/0557.reverse-words-in-a-string-iii/README.md b/Algorithms/0557.reverse-words-in-a-string-iii/README.md new file mode 100755 index 000000000..78fb8bad4 --- /dev/null +++ b/Algorithms/0557.reverse-words-in-a-string-iii/README.md @@ -0,0 +1,19 @@ +# [557. Reverse Words in a String III](https://leetcode.com/problems/reverse-words-in-a-string-iii/) + +## 题目 + +Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. + +Example 1: + +```text +Input: "Let's take LeetCode contest" +Output: "s'teL ekat edoCteeL tsetnoc" +``` + +Note: +In the string, each word is separated by single space and there will not be any extra space in the string. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii.go b/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii.go new file mode 100755 index 000000000..19e84cd36 --- /dev/null +++ b/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii.go @@ -0,0 +1,24 @@ +package problem0557 + +import ( + "strings" +) + +func reverseWords(s string) string { + ss := strings.Split(s, " ") + for i, s := range ss { + ss[i] = revers(s) + } + return strings.Join(ss, " ") +} + +func revers(s string) string { + bytes := []byte(s) + i, j := 0, len(bytes)-1 + for i < j { + bytes[i], bytes[j] = bytes[j], bytes[i] + i++ + j-- + } + return string(bytes) +} diff --git a/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii_test.go b/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii_test.go new file mode 100755 index 000000000..403702152 --- /dev/null +++ b/Algorithms/0557.reverse-words-in-a-string-iii/reverse-words-in-a-string-iii_test.go @@ -0,0 +1,39 @@ +package problem0557 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "Let's take LeetCode contest", + "s'teL ekat edoCteeL tsetnoc", + }, + + // 可以有多个 testcase +} + +func Test_reverseWords(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reverseWords(tc.s), "输入:%v", tc) + } +} + +func Benchmark_reverseWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseWords(tc.s) + } + } +} diff --git a/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k.go b/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k.go index c2a3d1296..47709e5f8 100755 --- a/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k.go +++ b/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k.go @@ -1,4 +1,4 @@ -package Problem0560 +package problem0560 func subarraySum(a []int, k int) int { res, sum := 0, 0 diff --git a/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k_test.go b/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k_test.go index 05bab83cf..2483eb201 100755 --- a/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k_test.go +++ b/Algorithms/0560.subarray-sum-equals-k/subarray-sum-equals-k_test.go @@ -1,4 +1,4 @@ -package Problem0560 +package problem0560 import ( "fmt" diff --git a/Algorithms/0561.array-partition-i/array-partition-i.go b/Algorithms/0561.array-partition-i/array-partition-i.go index b57722dcc..8b48544a4 100755 --- a/Algorithms/0561.array-partition-i/array-partition-i.go +++ b/Algorithms/0561.array-partition-i/array-partition-i.go @@ -1,4 +1,4 @@ -package Problem0561 +package problem0561 func arrayPairSum(nums []int) int { var buckets [20001]int8 diff --git a/Algorithms/0561.array-partition-i/array-partition-i_test.go b/Algorithms/0561.array-partition-i/array-partition-i_test.go index 992444114..ed01be553 100755 --- a/Algorithms/0561.array-partition-i/array-partition-i_test.go +++ b/Algorithms/0561.array-partition-i/array-partition-i_test.go @@ -1,4 +1,4 @@ -package Problem0561 +package problem0561 import ( "fmt" diff --git a/Algorithms/0563.binary-tree-tilt/README.md b/Algorithms/0563.binary-tree-tilt/README.md new file mode 100755 index 000000000..424cf7545 --- /dev/null +++ b/Algorithms/0563.binary-tree-tilt/README.md @@ -0,0 +1,33 @@ +# [563. Binary Tree Tilt](https://leetcode.com/problems/binary-tree-tilt/) + +## 题目 + +Given a binary tree, return the tilt of the whole tree. + +The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and the sum of all right subtree node values. Null node has tilt 0. + +The tilt of the whole tree is defined as the sum of all nodes' tilt. + +Example: + +```text +Input: + 1 + / \ + 2 3 +Output: 1 +Explanation: +Tilt of node 2 : 0 +Tilt of node 3 : 0 +Tilt of node 1 : |2-3| = 1 +Tilt of binary tree : 0 + 0 + 1 = 1 +``` + +Note: + +1. The sum of node values in any subtree won't exceed the range of 32-bit integer. +1. All the tilt values won't exceed the range of 32-bit integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0563.binary-tree-tilt/binary-tree-tilt.go b/Algorithms/0563.binary-tree-tilt/binary-tree-tilt.go new file mode 100755 index 000000000..1bf8b1420 --- /dev/null +++ b/Algorithms/0563.binary-tree-tilt/binary-tree-tilt.go @@ -0,0 +1,30 @@ +package problem0563 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func findTilt(root *TreeNode) int { + var tilt int + helper(root, &tilt) + return tilt +} + +func helper(root *TreeNode, tilt *int) int { + if root == nil { + return 0 + } + + l := helper(root.Left, tilt) + r := helper(root.Right, tilt) + + if l > r { + *tilt += l - r + } else { + *tilt += r - l + } + + return l + r+root.Val +} diff --git a/Algorithms/0563.binary-tree-tilt/binary-tree-tilt_test.go b/Algorithms/0563.binary-tree-tilt/binary-tree-tilt_test.go new file mode 100755 index 000000000..5608b2798 --- /dev/null +++ b/Algorithms/0563.binary-tree-tilt/binary-tree-tilt_test.go @@ -0,0 +1,50 @@ +package problem0563 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{1, 2, 4, 3, 5}, + []int{4, 2, 1, 5, 3}, + 11, + }, + + { + []int{1, 2, 3}, + []int{2, 1, 3}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_findTilt(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, findTilt(root), "输入:%v", tc) + } +} + +func Benchmark_findTilt(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findTilt(root) + } + } +} diff --git a/Algorithms/0564.find-the-closest-palindrome/README.md b/Algorithms/0564.find-the-closest-palindrome/README.md new file mode 100755 index 000000000..65dfc6b20 --- /dev/null +++ b/Algorithms/0564.find-the-closest-palindrome/README.md @@ -0,0 +1,23 @@ +# [564. Find the Closest Palindrome](https://leetcode.com/problems/find-the-closest-palindrome/) + +## 题目 + +Given an integer n, find the closest integer (not including itself), which is a palindrome. + +The 'closest' is defined as absolute difference minimized between two integers. + +Example 1: + +```text +Input: "123" +Output: "121" +``` + +Note: + +1. The input n is a positive integer represented by string, whose length will not exceed 18. +1. If there is a tie, return the smaller one as answer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome.go b/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome.go new file mode 100755 index 000000000..0df25d8b5 --- /dev/null +++ b/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome.go @@ -0,0 +1,81 @@ +package problem0564 + +import ( + "strconv" +) + +func nearestPalindromic(n string) string { + size := len(n) + + // 收集所有可能的数 + candidates := getBitChangeCandidates(size) + candidates = append(candidates, getCanidates(n)...) + + num, _ := strconv.Atoi(n) + delta := func(x int) int { + if x > num { + return x - num + } + return num - x + } + + // 从中挑选符合题意的那一个 + res := 1<<63 - 1 + for _, cand := range candidates { + if cand == num { + continue + } + + if delta(cand) < delta(res) || + (delta(cand) == delta(res) && cand < res) { + res = cand + } + } + + return strconv.Itoa(res) +} + +func getCanidates(n string) []int { + size := len(n) + prefix := n[:(size+1)/2] + p, _ := strconv.Atoi(prefix) + + res := make([]int, 3) + ps := make([]int, 3) + res[0], ps[0] = p-1, p-1 + res[1], ps[1] = p, p + res[2], ps[2] = p+1, p+1 + + if size%2 == 1 { + for i := range ps { + ps[i] /= 10 + } + } + + for i := range res { + for ps[i] > 0 { + res[i] = res[i]*10 + ps[i]%10 + ps[i] /= 10 + } + } + + return res +} + +func getBitChangeCandidates(size int) []int { + base := 1 + for i := 1; i < size; i++ { + base *= 10 + } + + res := make([]int, 4) + res[0] = base - 1 + res[1] = base + 1 + + base *= 10 + + res[2] = base - 1 + res[3] = base + 1 + + return res +} diff --git a/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome_test.go b/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome_test.go new file mode 100755 index 000000000..6f802e299 --- /dev/null +++ b/Algorithms/0564.find-the-closest-palindrome/find-the-closest-palindrome_test.go @@ -0,0 +1,94 @@ +package problem0564 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n string + ans string +}{ + + { + "9", + "8", + }, + + { + "99999999999999999", + "100000000000000001", + }, + + { + "8888", + "8778", + }, + + { + "100000000000000001", + "99999999999999999", + }, + + { + "77777", + "77677", + }, + + { + "9999", + "10001", + }, + + { + "121", + "111", + }, + + { + "2", + "1", + }, + + { + "10", + "9", + }, + + { + "1", + "0", + }, + + { + "4321", + "4334", + }, + + { + "123", + "121", + }, + + // 可以有多个 testcase +} + +func Test_nearestPalindromic(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nearestPalindromic(tc.n), "输入:%v", tc) + } +} + +func Benchmark_nearestPalindromic(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nearestPalindromic(tc.n) + } + } +} diff --git a/Algorithms/0565.array-nesting/array-nesting.go b/Algorithms/0565.array-nesting/array-nesting.go index a1bf3b470..d3d9b9c09 100755 --- a/Algorithms/0565.array-nesting/array-nesting.go +++ b/Algorithms/0565.array-nesting/array-nesting.go @@ -1,4 +1,4 @@ -package Problem0565 +package problem0565 func arrayNesting(a []int) int { max := 0 diff --git a/Algorithms/0565.array-nesting/array-nesting_test.go b/Algorithms/0565.array-nesting/array-nesting_test.go index 08c03fdbe..4801e43f6 100755 --- a/Algorithms/0565.array-nesting/array-nesting_test.go +++ b/Algorithms/0565.array-nesting/array-nesting_test.go @@ -1,4 +1,4 @@ -package Problem0565 +package problem0565 import ( "fmt" diff --git a/Algorithms/0566.reshape-the-matrix/reshape-the-matrix.go b/Algorithms/0566.reshape-the-matrix/reshape-the-matrix.go index 445b04d8e..35f856812 100755 --- a/Algorithms/0566.reshape-the-matrix/reshape-the-matrix.go +++ b/Algorithms/0566.reshape-the-matrix/reshape-the-matrix.go @@ -1,4 +1,4 @@ -package Problem0566 +package problem0566 func matrixReshape(nums [][]int, r int, c int) [][]int { if len(nums) == 0 || len(nums[0]) == 0 || len(nums)*len(nums[0]) != r*c || len(nums) == r && len(nums[0]) == c { diff --git a/Algorithms/0566.reshape-the-matrix/reshape-the-matrix_test.go b/Algorithms/0566.reshape-the-matrix/reshape-the-matrix_test.go index 040d60e4f..fc97b27d8 100755 --- a/Algorithms/0566.reshape-the-matrix/reshape-the-matrix_test.go +++ b/Algorithms/0566.reshape-the-matrix/reshape-the-matrix_test.go @@ -1,4 +1,4 @@ -package Problem0566 +package problem0566 import ( "fmt" diff --git a/Algorithms/0567.permutation-in-string/README.md b/Algorithms/0567.permutation-in-string/README.md new file mode 100755 index 000000000..76558cfbc --- /dev/null +++ b/Algorithms/0567.permutation-in-string/README.md @@ -0,0 +1,29 @@ +# [567. Permutation in String](https://leetcode.com/problems/permutation-in-string/) + +## 题目 + +Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string. + +Example 1: + +```text +Input:s1 = "ab" s2 = "eidbaooo" +Output:True +Explanation: s2 contains one permutation of s1 ("ba"). +``` + +Example 2: + +```text +Input:s1= "ab" s2 = "eidboaoo" +Output: False +``` + +Note: + +1. The input strings only contain lower case letters. +1. The length of both given strings is in range [1, 10,000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0567.permutation-in-string/permutation-in-string.go b/Algorithms/0567.permutation-in-string/permutation-in-string.go new file mode 100755 index 000000000..94f8a83e0 --- /dev/null +++ b/Algorithms/0567.permutation-in-string/permutation-in-string.go @@ -0,0 +1,34 @@ +package problem0567 + +func checkInclusion(s1 string, s2 string) bool { + n1 := len(s1) + n2 := len(s2) + if n1 > n2 { + return false + } + + h1 := 0 + h2 := 0 + for i := 0; i < n1; i++ { + c1 := s1[i] - 'a' + c2 := s2[i] - 'a' + h1 += 1 << c1 + h2 += 1 << c2 + } + + if h1 == h2 { + return true + } + + for i := n1; i < n2; i++ { + cb := s2[i-n1] - 'a' + ce := s2[i] - 'a' + // 利用 cb 和 ce 更新 h2 + h2 += (1 << ce) - (1 << cb) + if h1 == h2 { + return true + } + } + + return false +} diff --git a/Algorithms/0567.permutation-in-string/permutation-in-string_test.go b/Algorithms/0567.permutation-in-string/permutation-in-string_test.go new file mode 100755 index 000000000..b8b09a5af --- /dev/null +++ b/Algorithms/0567.permutation-in-string/permutation-in-string_test.go @@ -0,0 +1,70 @@ +package problem0567 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s1, s2 string + ans bool +}{ + + { + "xuumbjffxuzovdwrnolopeingppzgorotzdqfprokkmucxwsub", + "jpdojwinknmyeorfdhpsysyealozhgbapagzjsivbxmcyijlbdafupblrawguoazuzcqupobxayrkpqxawytdsdznljnxulaugewrbjmkslsrllixpkuvorhnnhkzikovsajrbhjdybocvjloqiikidsnwcubhliajwwqkpqaugidhfxqfxrkluvadcdmekdhckszpojvwpiquazmaecaxxwsnswzxbctqeqhjsrgnjsjmaqbexexuwgfglixsthifevokdgexxkdmzaxrcilmthzemuomexwzipzivdyxqnvgzpjavonrkobmgkormdmfiwwalgdzwlngkrjmdwkknajqatghoddybqfkorhpmrkfcfwsaproaenfedvfendprnlpmuqklsqrsjuejyxulfuhdsyolthhhfhmxorojnjsvqyworupkdzhyqkzikvhltfsrhrecmyyddtinphjsmmbdtrouyifvsvvlamwhkffrrywdiawpvxwcwfkcunbjaelbcmdwczikkfelahowtbwqbdcjggnmknfhjdtusfjotsbjgtlnuonlxjlcwyqiffktonvtrkcogosfbcvcosktnvbeitxuqpexxejnklndzbtzlzeebwufoiwqqcoemnshcpovntjgidophekyntcsrwzvovwmostqudxgeaowehcmqmdrllovmmbgqhaxrqluizhhhslystwkhckjtosnomfvyibkasycxnnmvkbwkbhzeayezughsmqovogrnihjgetsdvhymjmnijzwvpasurcaybmyzfbqepjsdqwmkmomzkociaqtnkwiguylhwxrfamyxjvfxwonwblidvcsenvwigjjqdsnnydlgdhlsdtonvuapzaozkdtyiartimmpwgotnwpiwimbdunqfickerusbvrqwazvnwgdczvnqtigjmkjgsridfulxjekazzqkdynyuutyoffhntfbcruhrmnhhjyyzfszbaqykgnroepiovqqlhdtkizvpivukdutitwzhapvcyfghqvtjyyrdbctvdccoxjtsovdosbyqaiffumnrfokrbgvedxbcytvbcaeoviutdmxwfhxgchnusazcztitxgyjrkjdmajbndlemsnpjwzgvpitrfrjoxivhisgkzncmkewphusvaycteennpltuevohegzvafwxuebmovgkpwlgyoutsbbgxoxdzyisersgaqcnnjnjtjwufqscjzccudbkdcnmorpmraqapvirijlpretmezlrbdvnfixvmalzmgrhwpkhisaztpsgvlooqxezzscjrtnmmctoyinjermwrrmjlfbizryripnarkvnabdizzereczdnbkojpfmxhlfvlztmzpskwttzyusxaudprxpbpihorlipzpdiucpvrqlscmoipvdzsrowjrwmxzomtcxxehrmcaxmtifcvftywjkzgdsohvomcthhylzpijujfyysbientozyirurugevubxpdpbihrudvgdmhwyxuhyorvufffqzifwzszmfswhkesywfyozffzarrklnxppymoaslqctlfbtrykccmgmhrdacuelfrbflsjxhdagaevscxerljtxnwodtfioyxjoaxyhzjmttvflfhqvvcbwvmnulcsubtwngjvomqkqrjtntkzuclolcjmiypjilgvezphjqrjetqnaccrjmxydmmkbmuyxwotfynptdotuaxpxzgjulwgwfbprzolxablskvidnmnzcofemsodetsiubqrvtbkshuokkuomjezwbmtcjvapnlsmutehyfxaqjqlibfzitcfhuivmmclulnrwyknbymyfcwbgyxtavcaebvfwlkikylkrpcfappcamnjenpggoxcrpxdbqjqzrdvnfzxuxuaixbpiqmitzhefcgyhzayemxgrtdoiryqguiexsrysetobkqnfphdechsgoqvmdhurzhvflsbxsdjemmvlzpthrjizfcayxemztvszhhpfvvjgoejrjnmyvxstpejfmiukuocmrgvinqifpdcqvwfddoiyopbzverxwcqdyoqzeqcjcwmojbhcnrksebanfpdhhpiaguxracnxzttbjgruczuhwwjbmznzgdijyemrwcawodqftjtlyozqwwchxtlvlnjqwklmbzirfhaquiltdijijeglroopaagmyrkhqbnkhbxvguodmmszfoomhfvwjsnrmmzjuyxhotehlezyyiptzububvazwzziskqagtpthflchvvanpugjpeoipecmvgkocylsqduwbreeifhjdomajmnbwrmxuhvvjnfblyvtveqalkqlbxkxvmxfefvijptnpvhmgmotrvsxmarhkspdlybniuoxycahgisvnrlrukendhsxvvcqzinnbkryzwbnktsgfwxjklrcgvtrzvkqfbhctljoijsvxbnwiunrasctvuetwvzdulmlnxeivsvujihlmjroxntmgkecjkimcsvfesfeursbuchaexgpyqakllumehlfdkuzbnulwfdacxjalozmrneqtjvdpgkcwnrkuhhqbnpedmysjqcrdqaawiwcucuzlbkwozlgrgcroyebklrwzkqicuqezkswayknmcytcsrtkxkfwxmimpolrqzjwfdzmlkpinifykobpvqlzqrcliorfqygytfgpdociwflhwpuuumrwnhrkpnteqacxejyulkccgxtnsfhuuahifvsshkwrkhptqvcmylyvvykwjhgknmsuolomginxdfwvqpfwlpwvommjjymsunxmbjxlcznmefzvuckeqfpighnxzxdpdlcifxbzldjctrswxmrxcjbbtivfnwqelhkmbunsroodysywhjsysajsrngtsvimguuwaicmuqzmafocvdzudgkmmvhydmafxqrrpkvvnnjyzohjwtjgqbrptggknxpuatfycatgimywhbafhjazjklgzxaiecmqbqgwgdepfspuxakrowawfolujdcyqsmakrkiqiduitooygdduztcquxqyraxhwjkvybbyiksqyqxqfmyzjyxxrxktmfklcjsjeijjflvtjayqlfuqtacxrfbrsdqtuwmflpdtxtjezsgeoeeyhcpncbknslbexvicfxslnqbelcfjonoakbitkizdlmusmydyajmiiouvqhhpmjspwoprvajocrloqydqbrgzxqafbfonuvecxjcrpoiorfqxofionzmomccxkhjqzkvpdevkwpsikonjxfthvtorexdyntvhttbtygzmtrrzprsgqnvbzhxuiruhugtaogfrjqdxnilxatjyltpbchjlkajaxefdjjwhqzjeejznbjkhdjqoltccfgosuuxodgyhvufwdrdxtpuvxlthxibekzkdoufkbstuxhwukrfaqsbratipaaxjawndpognykgltxofqbypomdpdsgncggpoddzbobloikifupdfgytydhxoxtcyerqpgezsddndikvcwufcefpdkdgvrlmvoiadawofsuyezliebpixyqboteavtvqeojxmemrdbptsxdckszxjgveaqngboxfdxqdgddczdzpyhlztthvbzgutaioqswwpzupddayzktwvqyvxcflmolxyewseqrrvpovpeftwgiywoyflwejpffxpubejlwmazjzfcldadgnkkjtmxktuzlocvqhjajqrfrfaloychnmokakwsfkrtacwjgsieptnujtgbbwzllvkpeuewegmkchhaaaptmbmoybtdotctkfyumafregkthibmufiudjrcohdhuhlpjeishhekicdfiiostjmofwhreoegrnbqgkhmiezgtasdaqdcixsrdfdsfcrgjaryeqtkussultserwmyealuvxckhcgojsxzsfxmrtcfhqpowalbbzvpcltiwdhexbvcjojdptxeplgestsnpmpibymzaolqaybmeezyagvvftcuqgqrpjauxjnmudeasbpeormqofrbmmgorysyztkbloyfjikxdrytsdfdrjagghbbjqkujemzvvtioluzitrmaxjphducstlearfirqknijfdurdztizvwoeqzamxkbbvmnbxomhsxfmwdhocdyabcygzojqebxferyieqfislcpwiaadbarnsgnuvhkaidexxcgxhmvsiwqhoxkjwvycbyaqiddlrgsvqvzkvqzeewbxnfqlhavmqyucnnlskzyhwlnpglakbstcsnmsipeekjbwvokjjasfcruinzkcmjtkuztnglqakavnjmvccjgquzfftcqzwnrvywoqxhzbkbjufjuyqqqtaoakzbykeraqalcqzuhjndgusnvdanqrwemqsmcwxelogrfxxsdyzlbfuvopxsyzuizshrtauculajiapoentvnkxpvyfxfecjolvlezsmfmibhptmgdkiucnsralqhtutgvnpzicjwcgrtcgyueuqsxnyspxmnzhupjwalphkutczrptfxsvgeikwqqhesezmkoliizhceciotrcrjhunyfnpeyrnmucyhkozbipsmuqfgujshzhzuxextaapmrbhvexaqyifwrodhftkwbpyndylvfukebddabmjperimjtzeeqwmjzjxjrqglwcsuxinztzxpzfdlirmyroecjkimmgnybedfhssjfzzdnqlzihfgobikowitiqdyzlhxbxifamfkeienxqvcmvhzixicqlylurlfnzbrfoztfjxswwlxkvrhueccohddaazuluirluhzliuqeqiajvmvtbpibfhiulyagqfowibqjkjewqminwsuupmxnijyrbiodfknndgpfiannwlkillxmirfqmmoktexmoqxqujogmxjmkenfphffmdfablsaqxufjwvmufogrzjarlopjhidbfbhoivkknzgqresjprfknjetohwtqurxyngxilywmbgpsctswswwkasyisochqeslbiunnbgxsgzwkopnhgdjyuherwtrkypbjrdesztgkxzueqrhhicwndmidmqahdwcycqpgtuildbowqhjaqnmblbnvvsxahycecvfnbvqzcjburykyjkgazgauobvieoerphnehdjxfianvcaasrctenrcwcgzcqbzufwsqllzbxnjzktgermrodlzuvkdblqcwbfjevjkygbgoalqyibexruhsxsowmchcogiffedbuddithpwocmovwbpvxzhwmyzpuwdhrorlqxxtqtwswmdcszbxwyirhpwjjulqoovmgqydxctjrnncsfevitouvdvsgdftpyjztxrxhuggdtyfandnuvufixthdxidrlzzkssngvrmtkwzifwjoqyawcohqxrucjixdcrhgybujxpbjfwxunbbotjlijfagrdsbeemkvgaebuagweegcgpoleicaakefhgvgjislsamatuqmmjisifffwmigqwxaywwmoyzarwtpiimekzofbycyoqznbnqwnncmzoiwpjgpymvynrgasxpekunmzksdrfxlyxewqmfoeufccrwevhhxxjqzkptkctaqerwotatqgkbnjqbpfyglucttnmxpxrrjhglbmzzjtyupaexfismwrvfgtunlriabhhyklpmevgmltnkdttjmemegytzzikcykidlasvugyzfaozknksednbsdcfnfwtozioavvipvsrkztslcxqgrccocxtwnxobbhidcublbnpwhohqjcxwfftmptlwtpjugbchgxahplumbjqjfvljhqzmbdsdeemxevugsthrveucyqxdktkdymznwdvkuoytvfrrfzrmlnedhckhngadcpugwzfupcudmukkpzrtdqvpcpzspuhdfoeojybisjmcjmcyhiiqjnfkcpepbflwfwmorpgwumlzynzpbbvvrgtxpsgzdelmlohavhyqhrfztmncnllnfdgdotoiojwtwilwwdszhcqbkdwtyrurxkzgcwrcvqlhynujihfdbwnnhkwdmfwciurvrqkmyghvhftbfhjogfrrslmuzussufwkkiewfevkvgalhyutnfxzgxbifjhbqolbsanvwkhyfxywfbvxvoiwcqhvdypwpgquutrugldizlvqaeeboriznjxovvmbwqyrxmxqilplplszubphmeszzrfjoliuskludoukazpiezpzucrsiiiichlxthowlcbmmfnyjyylgrcseraqtwodnxvugpysbosancqgzmxinonoeqmvyumsdwjncgztbepamqupqvxzudrniawehxilhybtdsupswxzjfhhchdeqoidvigjhkonfrdskxvoskgezzhhcpcfodahrlnkoldcdomllfcywrtqofedeychinhsvcssmgbadabdgyvmscucbckahgjawopdwlixbkmlxcpxtaqoempcldkefcerzeiowhgyhreveztowuigsgwcvdjahrfvrvvubliwretdwqslwgusqoqcczbzdalaocaarmtqhgjtzjjwnntuezwioelmwxnvnfeeggjljuybgshzeqsongxutyjovbklauknymkkkmnnwqxixaiwaxfbysglyvazrrcqcbgepgegwlmtycljiaqivlscezkquxkgzubqnbdsfxditryyagiihyoqdhtudnfmkwaohttygtwesumjjivazppjzkbdywdfudbjkubytrfasxkxqmdgnirqronvypulppeaqbjimtvffglxvihsvesvhbagtuikytbocsjnxfoxmtwpfwcdadliexyisjopbkqbjhlflqyxnjdkqndjpbdehwfsljapruwbslzchkyvsmcvocictzqxcktfmoathqnxmlqirfjezhqbboupnzlyqmiqiqkkbhwhpcyibipmizzxhlbjffxdzigymhjgyowmrjouvfjwgyzdovyslmfbplvjnqvfdbfeqvugoqdzvtggrpueutlljsfgudmgrzjqiaghatyzwjbkxxadrwjohhqmnwrswodapavdwyvwicbignxagbqodjeihgvwbdlexjcrltkidjdzjjteihgwedogtxafmajjgfgprbtbktqvirgxvvakqhbvgizxdgmabszclfbkrchaubgcobhpqrtfjbjzhpllxyvuqinnnkzdwqxzjjbniytymygnjzmklhpvazfqcdhafvoxlkxnvsmzfhjcqwdzqmlblhduduwbpbwonfmfwwbvhbgoyhwlmlxfnhlfpzwiybgeqghufeqilmdxzcdwrdwiculhnhzxybxvkwpjbwyprvtphhhqsnukanpnzoxtumxwlgostwbgqmtvdzsecquyrircmlckkzviczrvtkzyazlihddrlohyrovhprvcsmjrbxjaivvgolidxbyvxgkflallznsylhuzrkhrvfakpbhwhrgtwnlczewkyxhcturbfbfvlwvhaykumdftqbkmdxutbnphdsgplxxsdkcfouaprhecugnzdsjdyjkkuvtjtberlrwxhddmshcoyzlrgwugpnozubiglbcjwxjnvnmnbdtvlfbqqijwmdkrzslhsvnxnrsdbkbyxfkluvtofyesakxclxvodsuxwlyqkoyhynxfmpvmecqxxasvmsdrandljnyeepxaiwdvmmrzxstnzzfkxjsflkkrabqkicjutpyrbaewqzwfwdhzjqibmqhhzbnoaucsbpjtvvumkpaehnxxsjgkfpbfannzznhylowtsnilprqrbohrmcucboxzqwnbkbkgldydkqqqgjbtxavejjlxfqweybeaczszapiqiqoqwzhrvnjlmjmdmyyziqcusbpyxqwetclyrhfjrgzxbydajuqnbxhmjgenskqjikmgqlpbmsvuuxehfbydyqvgdfnkdqhlptgaollttiduybwqgaaatmcvdhagbusjrjigyhcphyhowixnezvioigsjdosikthzijrdvsfabprlcmjtjekculxcoyvypsozolqezlgunkhsftyjrffpfkuxbuoolragvarmtjozwqfiqdlaldxdauwzdrlhxlghtovdwesahmzklfoywukjufdiyiepnyjqzqbvomvefaahlnbgjhvumffksfvomrbnfstssvdgpubtmglxicclsijqumvibauoaxvgteljaajfcrqadkxbqrgbwaihxdsaisopmmwbzddapbczwnfnxspgtajjswcubnspwxglemattdgijkavsoanafyrkczcvmxzciuvtiwnraibtfrdqcntksioxjlzstxivizavgurmvwphdfxcvwqicctqicommgehtlunpbknkkklbzcjrxcxjchbszlqhtcdkzbdktkffbbwufcvscjsaraktaatyexzjxvxvoyyzivxpmwuxxkjdkrrmfegzkevmaeotwvpcrjtbfsblfdebacvomgtudrlcrjktvwdaerlafaqfcopbqxujngvxmjelcuesauyxuazrhiztlapgvsdenyqpafckjzohjjbdosjyvombptrppmanummqvahchtqkjdppwwskbygzaqpjlxkiposgfwltwlkvowynkcytprknckyppzvjjqaqibhakstpgkpbhviuqdrnsazdfptdmheqeusmkskdldaqnxthokukmhcpssjrtjnemyvlsaeryoeiclipnrjmbiyzpzfprjeyhphuqtdgqsgmicalezpyoakygeorrhzuyzhqqddhrygeybtoanobkvbfgpchrbtqbampimgefkyrkdfqgwyulvqbzljzbrisjugfjpruwilxneypgflzfldsbkpymcmxfpedmwogtxqrifposbwmohakknpkdbdycsgetahejtlqjaoumqyjbxywbmpbtcgquedhtfbbptomabbnahguvzsayqgvqxolvuflfjfhvmilqdzwqusvlcgemlaouwlgluuqtrqlhwooretsjjtnpnvrpnicakqcfuxotzmvqhsvoptvqiletevbhfbrolhijwidauovqlnqwmwvfoxljrbjtbwuazkhpnxntigrbdlhwbtwtzlnginyooppgpilsuzzjvfhanrggtxcjfxmvgbfsipktduomcoukthptkxahkkivmbnikapysfahapdembxvuakdniziuslabaotlifsolqboplhuasrlawpjsjaheapmubdtysalursciiukkgtrkzmqaltyksvdmomgydqqswpkqmewzzyxifqiivisommszulngjdsovkgsahicjhnlxqutcsyhfhxxyamenvwbruzzkywgmcmnqzvkindlsworliooqshsbxvoctrjionbzsihjhfitybhqyajludzdmitakuritzrgpdkvqptsmrqojcagmrhjppgsovqgrgjzdpzmjcrjbqprzbuufhwjlfgjwokimhvihgkgnkuajkpfsbiragdwbggbjesipyihpinhcrhpobdiaasfdivbsjpqeobgbzszqdkoixnhihncdutlggytzukcbtrdvxgbdllkswarjqehcdddgqdvwxgjtyymecyvqsutnpnwygxvlxxrpggidpmoygidulrdnixkuuiwmigcsntnlvomivajdmmopbyqljbmkqueawblhaicmshjhwnxieiftzjwwrwameuuzcoqiuibpcsaajzdciyxsqaeubgixinvwlecbkrctrwtoskgbdjbyjlgvmydlqrymdhyfdqawurvxprrnfnymfuvenrfdwpnxfqsbylqfokjnmpvnrtoqnhzpgzsebieouetuuruwenrjbuwondepkkuvxfzyswbnlykxglazitalhyhtksszzhglorprfobxkihnwxghhybaaspqmucv", + false, + }, + + { + "sitting", + "kitten", + false, + }, + + { + "kitten", + "sitting", + false, + }, + + { + "ab", + "ab", + true, + }, + + { + "ab", + "eidbaooo", + true, + }, + + { + "ab", + "eidboaoo", + false, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkInclusion(tc.s1, tc.s2), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkInclusion(tc.s1, tc.s2) + } + } +} diff --git a/Algorithms/0572.subtree-of-another-tree/README.md b/Algorithms/0572.subtree-of-another-tree/README.md new file mode 100755 index 000000000..26d0d5aa2 --- /dev/null +++ b/Algorithms/0572.subtree-of-another-tree/README.md @@ -0,0 +1,47 @@ +# [572. Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/) + +## 题目 + +Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node's descendants. The tree s could also be considered as a subtree of itself. + +Example 1: + +```text +Given tree s: + 3 + / \ + 4 5 + / \ + 1 2 + +Given tree t: + 4 + / \ + 1 2 + +Return true, because t has the same structure and node values with a subtree of s. +``` + +Example 2: + +```text +Given tree s: + 3 + / \ + 4 5 + / \ + 1 2 + / + 0 + +Given tree t: + 4 + / \ + 1 2 + +Return false. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree.go b/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree.go new file mode 100755 index 000000000..f3c05ad1f --- /dev/null +++ b/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree.go @@ -0,0 +1,25 @@ +package problem0572 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func isSubtree(s *TreeNode, t *TreeNode) bool { + if isSame(s, t) { return true } + + if s == nil {return false} + return isSubtree(s.Left, t) || isSubtree(s.Right, t) +} + +func isSame(s *TreeNode, t *TreeNode) bool { + if s == nil {return t == nil} + if t == nil {return false} + + if s.Val != t.Val { + return false + } + + return isSame(s.Left, t.Left) && isSame(s.Right, t.Right) +} diff --git a/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree_test.go b/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree_test.go new file mode 100755 index 000000000..357261c60 --- /dev/null +++ b/Algorithms/0572.subtree-of-another-tree/subtree-of-another-tree_test.go @@ -0,0 +1,73 @@ +package problem0572 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + spre, sin []int + tpre, tin []int + ans bool +}{ + + { + []int{1, 1}, + []int{1, 1}, + []int{1}, + []int{1}, + true, + }, + + { + []int{3, 4, 1, 2, 5}, + []int{1, 4, 2, 3, 5}, + []int{4, 1, 2}, + []int{1, 4, 2}, + true, + }, + + { + []int{3, 4, 1, 5, 2}, + []int{1, 4, 3, 2, 5}, + []int{3, 1, 2}, + []int{1, 3, 2}, + false, + }, + + { + []int{3, 4, 1, 2, 0, 5}, + []int{1, 4, 0, 2, 3, 5}, + []int{4, 1, 2}, + []int{1, 4, 2}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isSubtree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + s := kit.PreIn2Tree(tc.spre, tc.sin) + t := kit.PreIn2Tree(tc.tpre, tc.tin) + ast.Equal(tc.ans, isSubtree(s, t), "输入:%v", tc) + } +} + +func Benchmark_isSubtree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + s := kit.PreIn2Tree(tc.spre, tc.sin) + t := kit.PreIn2Tree(tc.tpre, tc.tin) + isSubtree(s, t) + } + } +} diff --git a/Algorithms/0575.distribute-candies/README.md b/Algorithms/0575.distribute-candies/README.md new file mode 100755 index 000000000..e6cbde5eb --- /dev/null +++ b/Algorithms/0575.distribute-candies/README.md @@ -0,0 +1,34 @@ +# [575. Distribute Candies](https://leetcode.com/problems/distribute-candies/) + +## 题目 + +Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these candies equally in number to brother and sister. Return the maximum number of kinds of candies the sister could gain. + +Example 1: + +```text +Input: candies = [1,1,2,2,3,3] +Output: 3 +Explanation: +There are three different kinds of candies (1, 2 and 3), and two candies for each kind. +Optimal distribution: The sister has candies [1,2,3] and the brother has candies [1,2,3], too. +The sister has three different kinds of candies. +``` + +Example 2: + +```text +Input: candies = [1,1,2,3] +Output: 2 +Explanation: For example, the sister has candies [2,3] and the brother has candies [1,1]. +The sister has two different kinds of candies, the brother has only one kind of candies. +``` + +Note: + +1. The length of the given array is in range [2, 10,000], and will be even. +1. The number in given array is in range [-100,000, 100,000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0575.distribute-candies/distribute-candies.go b/Algorithms/0575.distribute-candies/distribute-candies.go new file mode 100755 index 000000000..861a17266 --- /dev/null +++ b/Algorithms/0575.distribute-candies/distribute-candies.go @@ -0,0 +1,19 @@ +package problem0575 + +func distributeCandies(candies []int) int { + n := len(candies) + + r := make(map[int]bool, n) + for _, c := range candies { + r[c] = true + } + + return min(len(r), n/2) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0575.distribute-candies/distribute-candies_test.go b/Algorithms/0575.distribute-candies/distribute-candies_test.go new file mode 100755 index 000000000..1c608d64c --- /dev/null +++ b/Algorithms/0575.distribute-candies/distribute-candies_test.go @@ -0,0 +1,49 @@ +package problem0575 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + candies []int + ans int +}{ + + { + []int{1, 1, 1, 1, 1, 1}, + 1, + }, + + { + []int{1, 1, 2, 2, 3, 3}, + 3, + }, + + { + []int{1, 1, 2, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_distributeCandies(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, distributeCandies(tc.candies), "输入:%v", tc) + } +} + +func Benchmark_distributeCandies(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + distributeCandies(tc.candies) + } + } +} diff --git a/Algorithms/0576.out-of-boundary-paths/README.md b/Algorithms/0576.out-of-boundary-paths/README.md new file mode 100755 index 000000000..59b635fdc --- /dev/null +++ b/Algorithms/0576.out-of-boundary-paths/README.md @@ -0,0 +1,35 @@ +# [576. Out of Boundary Paths](https://leetcode.com/problems/out-of-boundary-paths/) + +## 题目 + +There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary in four directions (up, down, left, right). However, you can at most move N times. Find out the number of paths to move the ball out of grid boundary. The answer may be very large, return it after mod 109 + 7. + +Example 1: + +```text +Input:m = 2, n = 2, N = 2, i = 0, j = 0 +Output: 6 +``` + +Explanation: +![p1](https://leetcode.com/static/images/problemset/out_of_boundary_paths_1.png) + +Example 2: + +```text +Input:m = 1, n = 3, N = 3, i = 0, j = 1 +Output: 12 +``` + +Explanation: +![p2](https://leetcode.com/static/images/problemset/out_of_boundary_paths_2.png) + +Note: + +1. Once you move the ball out of boundary, you cannot move it back. +1. The length and height of the grid is in range [1,50]. +1. N is in range [0,50]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths.go b/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths.go new file mode 100755 index 000000000..01d2913c0 --- /dev/null +++ b/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths.go @@ -0,0 +1,46 @@ +package problem0576 + +const mod = 1e9 + 7 + +func findPaths(m, n, N, i, j int) int { + dp := [50][50]int{} + + for k := 0; k < N; k++ { + prior := make([]int, n) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + paths := 0 + + if i == 0 { + paths++ + } else { + paths += prior[j] + } + + if j == 0 { + paths++ + } else { + paths += prior[j-1] + } + + if i == m-1 { + paths++ + } else { + paths += dp[i+1][j] + } + + if j == n-1 { + paths++ + } else { + paths += dp[i][j+1] + } + + paths %= mod + prior[j] = dp[i][j] + dp[i][j] = paths + } + } + } + + return dp[i][j] +} diff --git a/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths_test.go b/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths_test.go new file mode 100755 index 000000000..3d0033f1d --- /dev/null +++ b/Algorithms/0576.out-of-boundary-paths/out-of-boundary-paths_test.go @@ -0,0 +1,61 @@ +package problem0576 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + m, n, N, i, j int + ans int +}{ + + { + 1, + 3, + 3, + 0, + 1, + 12, + }, + + { + 2, + 2, + 2, + 0, + 0, + 6, + }, + + { + 7, + 9, + 10, + 6, + 7, + 27982, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findPaths(tc.m, tc.n, tc.N, tc.i, tc.j), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findPaths(tc.m, tc.n, tc.N, tc.i, tc.j) + } + } +} diff --git a/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray.go b/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray.go index 4b2e03ca6..5aec88115 100755 --- a/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray.go +++ b/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray.go @@ -1,4 +1,4 @@ -package Problem0581 +package problem0581 func findUnsortedSubarray(nums []int) int { n := len(nums) diff --git a/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray_test.go b/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray_test.go index 884f64eb0..d547d3674 100755 --- a/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray_test.go +++ b/Algorithms/0581.shortest-unsorted-continuous-subarray/shortest-unsorted-continuous-subarray_test.go @@ -1,4 +1,4 @@ -package Problem0581 +package problem0581 import ( "fmt" diff --git a/Algorithms/0583.delete-operation-for-two-strings/README.md b/Algorithms/0583.delete-operation-for-two-strings/README.md new file mode 100755 index 000000000..e9c4f04fb --- /dev/null +++ b/Algorithms/0583.delete-operation-for-two-strings/README.md @@ -0,0 +1,22 @@ +# [583. Delete Operation for Two Strings](https://leetcode.com/problems/delete-operation-for-two-strings/) + +## 题目 + +Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either string. + +Example 1: + +```text +Input: "sea", "eat" +Output: 2 +Explanation: You need one step to make "sea" to "ea" and another step to make "eat" to "ea". +``` + +Note: + +1. The length of given words won't exceed 500. +1. Characters in given words can only be lower-case letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings.go b/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings.go new file mode 100755 index 000000000..72318b610 --- /dev/null +++ b/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings.go @@ -0,0 +1,29 @@ +package problem0583 + +func minDistance(word1, word2 string) int { + n1, n2 := len(word1), len(word2) + + // dp[i][j] == k 表示 word1[:i] 和 word2[:j] 的最大公共子序列的长度为 k + dp := make([][]int, n1+1) + for i := range dp { + dp[i] = make([]int, n2+1) + } + + for i := 1; i <= n1; i++ { + for j := 1; j <= n2; j++ { + dp[i][j] = max(dp[i-1][j], dp[i][j-1]) + if word1[i-1] == word2[j-1] { + dp[i][j] = dp[i-1][j-1] + 1 + } + } + } + + return n1 + n2 - dp[n1][n2]*2 +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings_test.go b/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings_test.go new file mode 100755 index 000000000..2e21c0409 --- /dev/null +++ b/Algorithms/0583.delete-operation-for-two-strings/delete-operation-for-two-strings_test.go @@ -0,0 +1,47 @@ +package problem0583 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + word1 string + word2 string + ans int +}{ + + { + "bgswdnrsnzdrnmmyxpjmyqztaroernkakadxrzxhabbhlhexrdntmffrdhjjvqxhmfeowsi", + "tegwdexzxrdvnziycqhdyswocagkthihuggxnaxvalbhhokbbceqmosxdhtjkgghharqnyl", + 96, + }, + + { + "sea", + "eat", + 2, + }, + + // 可以有多个 testcase +} + +func Test_minDistance(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minDistance(tc.word1, tc.word2), "输入:%v", tc) + } +} + +func Benchmark_minDistance(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minDistance(tc.word1, tc.word2) + } + } +} diff --git a/Algorithms/0587.erect-the-fence/README.md b/Algorithms/0587.erect-the-fence/README.md new file mode 100755 index 000000000..1610ea865 --- /dev/null +++ b/Algorithms/0587.erect-the-fence/README.md @@ -0,0 +1,38 @@ +# [587. Erect the Fence](https://leetcode.com/problems/erect-the-fence/) + +## 题目 + +There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Your job is to fence the entire garden using the minimum length of rope as it is expensive. The garden is well fenced only if all the trees are enclosed. Your task is to help find the coordinates of trees which are exactly located on the fence perimeter. + +Example 1: + +```text +Input: [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]] +Output: [[1,1],[2,0],[4,2],[3,3],[2,4]] +Explanation: +``` + +![e1](https://leetcode.com/static/images/problemset/erect_the_fence_1.png) + +Example 2: + +```text +Input: [[1,2],[2,2],[4,2]] +Output: [[1,2],[2,2],[4,2]] +Explanation: +Even you only have trees in a line, you need to use rope to enclose them. +``` + +![e2](https://leetcode.com/static/images/problemset/erect_the_fence_2.png) + +Note: + +1. All trees should be enclosed together. You cannot cut the rope to enclose trees that will separate them in more than one group. +1. All input integers will range from 0 to 100. +1. The garden has at least one tree. +1. All coordinates are distinct. +1. Input points have NO order. No order required for output. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0587.erect-the-fence/erect-the-fence.go b/Algorithms/0587.erect-the-fence/erect-the-fence.go new file mode 100755 index 000000000..e79c2f4c6 --- /dev/null +++ b/Algorithms/0587.erect-the-fence/erect-the-fence.go @@ -0,0 +1,77 @@ +package problem0587 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type Point = kit.Point + +func outerTrees(points []Point) []Point { + n := len(points) + if n < 4 { + return points + } + + // 选择最左边的点,作为起始点 + // 如果最左边的点,不止一个,选择其中最下面的那个 + first := 0 + for i := 1; i < n; i++ { + if points[i].X < points[first].X|| + (points[i].X == points[first].X && points[i].Y< points[first].Y) { + first = i + } + } + + res := append([]Point{}, points[first]) + + cur := first + for { + // 寻找以 cur 为圆心,顺时针方向角度最大的点 + next := (cur + 1) % n + for i := 0; i < n; i++ { + if i == cur { + continue + } + cross := crossProductLength(points[cur], points[next], points[i]) + if cross < 0 || + (cross == 0 && isFurther(points[cur], points[next], points[i])) { + next = i + } + } + + // 把与 cur→next 共线的点都放入 res + for i := 0; i < n; i++ { + if i == cur || i == first { + // 这是已经放入过的点 + continue + } + if crossProductLength(points[cur], points[next], points[i]) == 0 { + // next 也会被放入 + res = append(res, points[i]) + } + } + + cur = next + // cur == first 说明围栏已经封闭了 + if cur == first { + break + } + } + + return res +} + +// 返回 oa×ob 的长度 +// 当返回值 <0 时,说明以 o 点圆心,b 点在 a 点的顺时针方向 +// 当返回值 =0 时,说明以 o 点,b 点和 a 点在同一条直线长 +func crossProductLength(o, a, b Point) int { + return (a.X-o.X)*(b.Y-o.Y) - (a.Y-o.Y)*(b.X-o.X) +} + +func isFurther(o, a, b Point) bool { + return distance(o, a) < distance(o, b) +} + +func distance(a, b Point) int { + return (a.X-b.X)*(a.X-b.X) + (a.Y-b.Y)*(a.Y-b.Y) +} diff --git a/Algorithms/0587.erect-the-fence/erect-the-fence_test.go b/Algorithms/0587.erect-the-fence/erect-the-fence_test.go new file mode 100755 index 000000000..5dc1a7093 --- /dev/null +++ b/Algorithms/0587.erect-the-fence/erect-the-fence_test.go @@ -0,0 +1,2175 @@ +package problem0587 + +import ( + "sort" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans [][]int +}{ + + { + [][]int{ + {0, 0}, + {0, 4}, + {0, 19}, + {0, 22}, + {0, 25}, + {0, 26}, + {0, 32}, + {0, 39}, + {0, 40}, + {0, 49}, + {0, 54}, + {0, 55}, + {0, 63}, + {0, 67}, + {0, 72}, + {0, 85}, + {0, 89}, + {0, 96}, + {0, 99}, + {1, 9}, + {1, 13}, + {1, 21}, + {1, 23}, + {1, 25}, + {1, 28}, + {1, 31}, + {1, 32}, + {1, 35}, + {1, 41}, + {1, 50}, + {1, 56}, + {1, 59}, + {1, 61}, + {1, 63}, + {1, 65}, + {1, 66}, + {1, 68}, + {1, 89}, + {1, 97}, + {2, 1}, + {2, 6}, + {2, 7}, + {2, 16}, + {2, 26}, + {2, 38}, + {2, 41}, + {2, 43}, + {2, 46}, + {2, 52}, + {2, 56}, + {2, 59}, + {2, 68}, + {2, 87}, + {2, 88}, + {2, 91}, + {2, 92}, + {2, 95}, + {2, 99}, + {3, 7}, + {3, 25}, + {3, 27}, + {3, 28}, + {3, 29}, + {3, 32}, + {3, 40}, + {3, 45}, + {3, 46}, + {3, 48}, + {3, 51}, + {3, 52}, + {3, 63}, + {3, 64}, + {3, 66}, + {3, 70}, + {3, 71}, + {3, 75}, + {3, 81}, + {3, 88}, + {3, 97}, + {4, 2}, + {4, 3}, + {4, 7}, + {4, 24}, + {4, 28}, + {4, 30}, + {4, 34}, + {4, 43}, + {4, 45}, + {4, 46}, + {4, 56}, + {4, 59}, + {4, 61}, + {4, 63}, + {4, 70}, + {4, 71}, + {4, 78}, + {4, 83}, + {4, 91}, + {4, 92}, + {4, 93}, + {4, 95}, + {4, 98}, + {5, 2}, + {5, 3}, + {5, 21}, + {5, 26}, + {5, 36}, + {5, 44}, + {5, 49}, + {5, 54}, + {5, 64}, + {5, 72}, + {5, 73}, + {5, 80}, + {5, 86}, + {5, 87}, + {5, 91}, + {5, 98}, + {6, 0}, + {6, 8}, + {6, 20}, + {6, 22}, + {6, 23}, + {6, 29}, + {6, 37}, + {6, 46}, + {6, 50}, + {6, 57}, + {6, 58}, + {6, 59}, + {6, 65}, + {6, 68}, + {6, 70}, + {6, 73}, + {6, 77}, + {6, 79}, + {6, 82}, + {6, 84}, + {6, 87}, + {6, 98}, + {7, 0}, + {7, 6}, + {7, 8}, + {7, 13}, + {7, 15}, + {7, 18}, + {7, 19}, + {7, 28}, + {7, 35}, + {7, 36}, + {7, 38}, + {7, 44}, + {7, 46}, + {7, 59}, + {7, 60}, + {7, 61}, + {7, 67}, + {7, 89}, + {7, 92}, + {7, 96}, + {7, 99}, + {8, 0}, + {8, 1}, + {8, 4}, + {8, 9}, + {8, 15}, + {8, 28}, + {8, 35}, + {8, 45}, + {8, 54}, + {8, 57}, + {8, 58}, + {8, 59}, + {8, 72}, + {8, 73}, + {8, 81}, + {8, 83}, + {8, 84}, + {8, 85}, + {8, 89}, + {8, 93}, + {8, 96}, + {9, 4}, + {9, 8}, + {9, 15}, + {9, 24}, + {9, 30}, + {9, 36}, + {9, 71}, + {9, 75}, + {9, 76}, + {9, 77}, + {9, 79}, + {9, 80}, + {9, 81}, + {9, 84}, + {9, 85}, + {9, 86}, + {9, 87}, + {9, 89}, + {9, 94}, + {10, 0}, + {10, 6}, + {10, 7}, + {10, 13}, + {10, 16}, + {10, 17}, + {10, 19}, + {10, 22}, + {10, 53}, + {10, 54}, + {10, 56}, + {10, 58}, + {10, 64}, + {10, 66}, + {10, 67}, + {10, 74}, + {10, 84}, + {10, 87}, + {10, 91}, + {10, 92}, + {11, 0}, + {11, 3}, + {11, 4}, + {11, 7}, + {11, 18}, + {11, 25}, + {11, 27}, + {11, 28}, + {11, 30}, + {11, 32}, + {11, 41}, + {11, 44}, + {11, 52}, + {11, 57}, + {11, 62}, + {11, 63}, + {11, 66}, + {11, 72}, + {11, 78}, + {11, 80}, + {11, 96}, + {12, 10}, + {12, 12}, + {12, 22}, + {12, 25}, + {12, 29}, + {12, 34}, + {12, 38}, + {12, 45}, + {12, 55}, + {12, 57}, + {12, 64}, + {12, 65}, + {12, 68}, + {12, 71}, + {12, 79}, + {12, 82}, + {12, 91}, + {12, 98}, + {13, 0}, + {13, 7}, + {13, 8}, + {13, 10}, + {13, 13}, + {13, 15}, + {13, 33}, + {13, 34}, + {13, 36}, + {13, 38}, + {13, 40}, + {13, 42}, + {13, 63}, + {13, 66}, + {13, 70}, + {13, 73}, + {13, 81}, + {13, 84}, + {13, 88}, + {14, 10}, + {14, 15}, + {14, 21}, + {14, 22}, + {14, 24}, + {14, 41}, + {14, 46}, + {14, 47}, + {14, 52}, + {14, 55}, + {14, 61}, + {14, 67}, + {14, 73}, + {14, 88}, + {14, 92}, + {14, 97}, + {15, 0}, + {15, 5}, + {15, 12}, + {15, 32}, + {15, 45}, + {15, 48}, + {15, 49}, + {15, 51}, + {15, 54}, + {15, 55}, + {15, 62}, + {15, 64}, + {15, 65}, + {15, 66}, + {15, 74}, + {15, 76}, + {15, 84}, + {15, 97}, + {16, 8}, + {16, 9}, + {16, 14}, + {16, 16}, + {16, 18}, + {16, 23}, + {16, 28}, + {16, 38}, + {16, 41}, + {16, 43}, + {16, 48}, + {16, 49}, + {16, 53}, + {16, 61}, + {16, 63}, + {16, 64}, + {16, 70}, + {16, 73}, + {16, 84}, + {16, 88}, + {16, 92}, + {16, 93}, + {16, 97}, + {17, 0}, + {17, 1}, + {17, 15}, + {17, 21}, + {17, 27}, + {17, 30}, + {17, 34}, + {17, 39}, + {17, 42}, + {17, 43}, + {17, 50}, + {17, 52}, + {17, 57}, + {17, 58}, + {17, 62}, + {17, 63}, + {17, 64}, + {17, 65}, + {17, 66}, + {17, 77}, + {17, 79}, + {17, 81}, + {17, 82}, + {17, 83}, + {17, 86}, + {17, 90}, + {17, 93}, + {17, 96}, + {17, 98}, + {18, 0}, + {18, 4}, + {18, 5}, + {18, 8}, + {18, 14}, + {18, 16}, + {18, 17}, + {18, 21}, + {18, 29}, + {18, 34}, + {18, 37}, + {18, 46}, + {18, 47}, + {18, 63}, + {18, 65}, + {18, 67}, + {18, 72}, + {18, 73}, + {18, 77}, + {18, 79}, + {18, 82}, + {18, 84}, + {18, 85}, + {18, 91}, + {18, 98}, + {19, 3}, + {19, 4}, + {19, 8}, + {19, 13}, + {19, 17}, + {19, 26}, + {19, 36}, + {19, 38}, + {19, 48}, + {19, 49}, + {19, 52}, + {19, 57}, + {19, 61}, + {19, 64}, + {19, 69}, + {19, 71}, + {19, 76}, + {19, 80}, + {19, 82}, + {19, 83}, + {19, 84}, + {19, 86}, + {19, 94}, + {20, 4}, + {20, 6}, + {20, 13}, + {20, 23}, + {20, 36}, + {20, 45}, + {20, 46}, + {20, 47}, + {20, 55}, + {20, 57}, + {20, 62}, + {20, 65}, + {20, 67}, + {20, 71}, + {20, 77}, + {20, 78}, + {20, 82}, + {20, 86}, + {20, 87}, + {20, 89}, + {20, 94}, + {20, 97}, + {21, 2}, + {21, 12}, + {21, 16}, + {21, 20}, + {21, 27}, + {21, 30}, + {21, 32}, + {21, 34}, + {21, 52}, + {21, 63}, + {21, 65}, + {21, 69}, + {21, 75}, + {21, 88}, + {21, 91}, + {21, 93}, + {21, 94}, + {21, 95}, + {22, 2}, + {22, 4}, + {22, 6}, + {22, 7}, + {22, 10}, + {22, 12}, + {22, 38}, + {22, 42}, + {22, 49}, + {22, 50}, + {22, 70}, + {22, 72}, + {22, 76}, + {22, 79}, + {22, 80}, + {22, 88}, + {22, 89}, + {22, 90}, + {23, 9}, + {23, 11}, + {23, 21}, + {23, 23}, + {23, 24}, + {23, 35}, + {23, 38}, + {23, 41}, + {23, 43}, + {23, 48}, + {23, 51}, + {23, 61}, + {23, 62}, + {23, 68}, + {23, 70}, + {23, 71}, + {23, 72}, + {23, 84}, + {23, 85}, + {23, 98}, + {23, 99}, + {24, 1}, + {24, 2}, + {24, 6}, + {24, 19}, + {24, 41}, + {24, 49}, + {24, 51}, + {24, 68}, + {24, 72}, + {24, 77}, + {24, 79}, + {24, 82}, + {24, 83}, + {24, 84}, + {24, 99}, + {25, 8}, + {25, 15}, + {25, 24}, + {25, 28}, + {25, 41}, + {25, 46}, + {25, 47}, + {25, 48}, + {25, 60}, + {25, 61}, + {25, 62}, + {25, 65}, + {25, 69}, + {25, 72}, + {25, 76}, + {25, 78}, + {25, 80}, + {25, 98}, + {26, 11}, + {26, 31}, + {26, 32}, + {26, 35}, + {26, 42}, + {26, 51}, + {26, 56}, + {26, 73}, + {26, 74}, + {26, 75}, + {26, 80}, + {26, 82}, + {26, 90}, + {26, 99}, + {27, 0}, + {27, 1}, + {27, 9}, + {27, 14}, + {27, 22}, + {27, 23}, + {27, 26}, + {27, 30}, + {27, 43}, + {27, 47}, + {27, 58}, + {27, 60}, + {27, 61}, + {27, 67}, + {27, 70}, + {27, 79}, + {27, 83}, + {27, 85}, + {27, 89}, + {27, 91}, + {27, 94}, + {28, 3}, + {28, 22}, + {28, 26}, + {28, 31}, + {28, 32}, + {28, 43}, + {28, 48}, + {28, 59}, + {28, 62}, + {28, 64}, + {28, 67}, + {28, 72}, + {28, 89}, + {28, 94}, + {28, 97}, + {29, 5}, + {29, 8}, + {29, 22}, + {29, 23}, + {29, 29}, + {29, 31}, + {29, 38}, + {29, 48}, + {29, 58}, + {29, 72}, + {29, 73}, + {29, 80}, + {29, 82}, + {29, 83}, + {29, 84}, + {29, 87}, + {29, 88}, + {29, 92}, + {29, 95}, + {30, 0}, + {30, 6}, + {30, 7}, + {30, 10}, + {30, 12}, + {30, 23}, + {30, 38}, + {30, 44}, + {30, 49}, + {30, 50}, + {30, 62}, + {30, 69}, + {30, 70}, + {30, 77}, + {30, 78}, + {30, 81}, + {30, 87}, + {30, 89}, + {30, 93}, + {30, 97}, + {31, 3}, + {31, 4}, + {31, 20}, + {31, 22}, + {31, 23}, + {31, 28}, + {31, 29}, + {31, 38}, + {31, 40}, + {31, 50}, + {31, 58}, + {31, 67}, + {31, 70}, + {31, 73}, + {31, 81}, + {31, 89}, + {31, 90}, + {32, 1}, + {32, 10}, + {32, 12}, + {32, 17}, + {32, 18}, + {32, 29}, + {32, 39}, + {32, 41}, + {32, 43}, + {32, 44}, + {32, 54}, + {32, 55}, + {32, 56}, + {32, 58}, + {32, 66}, + {32, 68}, + {32, 70}, + {32, 73}, + {32, 82}, + {32, 84}, + {32, 93}, + {32, 96}, + {32, 97}, + {33, 4}, + {33, 5}, + {33, 6}, + {33, 8}, + {33, 13}, + {33, 26}, + {33, 31}, + {33, 47}, + {33, 51}, + {33, 59}, + {33, 60}, + {33, 66}, + {33, 67}, + {33, 71}, + {33, 86}, + {33, 94}, + {33, 95}, + {33, 98}, + {34, 11}, + {34, 13}, + {34, 29}, + {34, 36}, + {34, 38}, + {34, 47}, + {34, 50}, + {34, 59}, + {34, 62}, + {34, 63}, + {34, 67}, + {34, 73}, + {34, 77}, + {34, 86}, + {34, 88}, + {34, 94}, + {34, 96}, + {34, 97}, + {34, 98}, + {35, 16}, + {35, 17}, + {35, 28}, + {35, 37}, + {35, 38}, + {35, 39}, + {35, 42}, + {35, 45}, + {35, 53}, + {35, 55}, + {35, 64}, + {35, 68}, + {35, 71}, + {36, 5}, + {36, 14}, + {36, 22}, + {36, 28}, + {36, 29}, + {36, 31}, + {36, 35}, + {36, 45}, + {36, 50}, + {36, 61}, + {36, 70}, + {36, 71}, + {36, 77}, + {36, 84}, + {36, 85}, + {36, 86}, + {36, 96}, + {36, 99}, + {37, 7}, + {37, 21}, + {37, 23}, + {37, 45}, + {37, 50}, + {37, 52}, + {37, 53}, + {37, 57}, + {37, 59}, + {37, 63}, + {37, 65}, + {37, 68}, + {37, 72}, + {37, 73}, + {37, 74}, + {37, 80}, + {37, 84}, + {37, 96}, + {37, 98}, + {38, 1}, + {38, 2}, + {38, 5}, + {38, 10}, + {38, 11}, + {38, 19}, + {38, 36}, + {38, 45}, + {38, 48}, + {38, 49}, + {38, 51}, + {38, 52}, + {38, 55}, + {38, 56}, + {38, 64}, + {38, 78}, + {38, 80}, + {38, 82}, + {38, 88}, + {38, 93}, + {38, 95}, + {38, 96}, + {39, 0}, + {39, 1}, + {39, 5}, + {39, 15}, + {39, 17}, + {39, 22}, + {39, 23}, + {39, 30}, + {39, 42}, + {39, 48}, + {39, 54}, + {39, 65}, + {39, 68}, + {39, 72}, + {39, 90}, + {39, 92}, + {39, 94}, + {39, 97}, + {40, 5}, + {40, 8}, + {40, 10}, + {40, 13}, + {40, 19}, + {40, 26}, + {40, 27}, + {40, 42}, + {40, 45}, + {40, 55}, + {40, 56}, + {40, 62}, + {40, 63}, + {40, 77}, + {40, 83}, + {40, 85}, + {40, 88}, + {40, 92}, + {40, 93}, + {41, 3}, + {41, 8}, + {41, 11}, + {41, 15}, + {41, 24}, + {41, 28}, + {41, 29}, + {41, 40}, + {41, 48}, + {41, 55}, + {41, 59}, + {41, 63}, + {41, 79}, + {41, 80}, + {41, 87}, + {41, 91}, + {41, 99}, + {42, 2}, + {42, 12}, + {42, 14}, + {42, 19}, + {42, 25}, + {42, 42}, + {42, 47}, + {42, 52}, + {42, 62}, + {42, 64}, + {42, 73}, + {42, 74}, + {42, 90}, + {42, 91}, + {42, 95}, + {42, 96}, + {42, 97}, + {43, 2}, + {43, 16}, + {43, 17}, + {43, 21}, + {43, 33}, + {43, 39}, + {43, 40}, + {43, 43}, + {43, 49}, + {43, 57}, + {43, 70}, + {43, 77}, + {43, 79}, + {43, 86}, + {43, 89}, + {43, 92}, + {43, 96}, + {44, 6}, + {44, 8}, + {44, 10}, + {44, 27}, + {44, 30}, + {44, 34}, + {44, 35}, + {44, 39}, + {44, 41}, + {44, 45}, + {44, 46}, + {44, 48}, + {44, 54}, + {44, 56}, + {44, 65}, + {44, 69}, + {44, 71}, + {44, 72}, + {44, 74}, + {44, 80}, + {44, 85}, + {44, 86}, + {45, 1}, + {45, 3}, + {45, 5}, + {45, 21}, + {45, 22}, + {45, 34}, + {45, 36}, + {45, 46}, + {45, 47}, + {45, 48}, + {45, 55}, + {45, 60}, + {45, 61}, + {45, 63}, + {45, 64}, + {45, 68}, + {45, 72}, + {45, 77}, + {45, 78}, + {45, 82}, + {45, 84}, + {45, 88}, + {45, 90}, + {45, 92}, + {45, 94}, + {46, 13}, + {46, 15}, + {46, 19}, + {46, 20}, + {46, 25}, + {46, 32}, + {46, 37}, + {46, 40}, + {46, 41}, + {46, 46}, + {46, 50}, + {46, 51}, + {46, 55}, + {46, 59}, + {46, 69}, + {46, 74}, + {46, 77}, + {46, 86}, + {46, 97}, + {46, 98}, + {47, 2}, + {47, 3}, + {47, 5}, + {47, 7}, + {47, 8}, + {47, 12}, + {47, 14}, + {47, 23}, + {47, 26}, + {47, 28}, + {47, 33}, + {47, 45}, + {47, 46}, + {47, 49}, + {47, 59}, + {47, 62}, + {47, 73}, + {47, 76}, + {47, 79}, + {47, 89}, + {47, 95}, + {47, 96}, + {47, 99}, + {48, 2}, + {48, 6}, + {48, 9}, + {48, 10}, + {48, 12}, + {48, 16}, + {48, 17}, + {48, 21}, + {48, 24}, + {48, 26}, + {48, 28}, + {48, 30}, + {48, 32}, + {48, 35}, + {48, 40}, + {48, 42}, + {48, 44}, + {48, 48}, + {48, 53}, + {48, 65}, + {48, 67}, + {48, 70}, + {48, 72}, + {48, 79}, + {48, 87}, + {48, 91}, + {48, 94}, + {48, 99}, + {49, 0}, + {49, 2}, + {49, 13}, + {49, 15}, + {49, 19}, + {49, 25}, + {49, 28}, + {49, 44}, + {49, 49}, + {49, 52}, + {49, 65}, + {49, 68}, + {49, 69}, + {50, 6}, + {50, 20}, + {50, 21}, + {50, 31}, + {50, 37}, + {50, 39}, + {50, 52}, + {50, 60}, + {50, 61}, + {50, 63}, + {50, 66}, + {50, 74}, + {50, 85}, + {50, 93}, + {50, 97}, + {50, 99}, + {51, 1}, + {51, 11}, + {51, 14}, + {51, 22}, + {51, 24}, + {51, 25}, + {51, 27}, + {51, 30}, + {51, 38}, + {51, 46}, + {51, 49}, + {51, 50}, + {51, 54}, + {51, 60}, + {51, 61}, + {51, 62}, + {51, 75}, + {51, 85}, + {51, 86}, + {51, 88}, + {51, 90}, + {51, 91}, + {51, 93}, + {51, 95}, + {51, 96}, + {51, 97}, + {52, 2}, + {52, 3}, + {52, 7}, + {52, 14}, + {52, 16}, + {52, 19}, + {52, 21}, + {52, 22}, + {52, 27}, + {52, 28}, + {52, 29}, + {52, 30}, + {52, 32}, + {52, 39}, + {52, 42}, + {52, 49}, + {52, 54}, + {52, 55}, + {52, 61}, + {52, 65}, + {52, 66}, + {52, 68}, + {52, 71}, + {52, 72}, + {52, 76}, + {52, 78}, + {52, 80}, + {52, 85}, + {52, 86}, + {52, 90}, + {52, 99}, + {53, 2}, + {53, 5}, + {53, 10}, + {53, 14}, + {53, 25}, + {53, 27}, + {53, 30}, + {53, 41}, + {53, 44}, + {53, 49}, + {53, 73}, + {53, 74}, + {53, 78}, + {53, 80}, + {53, 86}, + {53, 88}, + {53, 90}, + {53, 97}, + {54, 3}, + {54, 9}, + {54, 12}, + {54, 14}, + {54, 20}, + {54, 23}, + {54, 25}, + {54, 38}, + {54, 41}, + {54, 42}, + {54, 43}, + {54, 45}, + {54, 48}, + {54, 52}, + {54, 54}, + {54, 57}, + {54, 65}, + {54, 67}, + {54, 70}, + {54, 83}, + {54, 90}, + {54, 97}, + {54, 98}, + {55, 0}, + {55, 1}, + {55, 8}, + {55, 9}, + {55, 19}, + {55, 28}, + {55, 29}, + {55, 32}, + {55, 33}, + {55, 42}, + {55, 44}, + {55, 48}, + {55, 58}, + {55, 72}, + {55, 74}, + {55, 88}, + {55, 89}, + {55, 92}, + {55, 94}, + {55, 97}, + {56, 1}, + {56, 2}, + {56, 6}, + {56, 7}, + {56, 9}, + {56, 13}, + {56, 14}, + {56, 15}, + {56, 18}, + {56, 23}, + {56, 26}, + {56, 37}, + {56, 44}, + {56, 45}, + {56, 46}, + {56, 48}, + {56, 50}, + {56, 54}, + {56, 56}, + {56, 58}, + {56, 59}, + {56, 78}, + {56, 83}, + {56, 86}, + {56, 96}, + {57, 6}, + {57, 9}, + {57, 10}, + {57, 13}, + {57, 25}, + {57, 27}, + {57, 36}, + {57, 39}, + {57, 40}, + {57, 41}, + {57, 53}, + {57, 69}, + {57, 75}, + {57, 81}, + {57, 87}, + {57, 89}, + {57, 94}, + {57, 97}, + {57, 99}, + {58, 2}, + {58, 7}, + {58, 8}, + {58, 12}, + {58, 18}, + {58, 19}, + {58, 22}, + {58, 24}, + {58, 25}, + {58, 47}, + {58, 59}, + {58, 60}, + {58, 78}, + {58, 85}, + {58, 92}, + {58, 94}, + {59, 4}, + {59, 6}, + {59, 8}, + {59, 13}, + {59, 15}, + {59, 16}, + {59, 17}, + {59, 18}, + {59, 25}, + {59, 31}, + {59, 32}, + {59, 34}, + {59, 39}, + {59, 43}, + {59, 63}, + {59, 68}, + {59, 72}, + {59, 85}, + {59, 87}, + {59, 88}, + {59, 99}, + {60, 1}, + {60, 3}, + {60, 11}, + {60, 14}, + {60, 24}, + {60, 41}, + {60, 43}, + {60, 45}, + {60, 52}, + {60, 57}, + {60, 58}, + {60, 60}, + {60, 61}, + {60, 65}, + {60, 69}, + {60, 72}, + {60, 74}, + {60, 79}, + {60, 80}, + {60, 82}, + {60, 90}, + {60, 97}, + {60, 99}, + {61, 11}, + {61, 18}, + {61, 21}, + {61, 31}, + {61, 39}, + {61, 41}, + {61, 47}, + {61, 48}, + {61, 55}, + {61, 57}, + {61, 65}, + {61, 70}, + {61, 74}, + {61, 77}, + {61, 82}, + {61, 87}, + {61, 89}, + {61, 95}, + {61, 98}, + {62, 6}, + {62, 17}, + {62, 20}, + {62, 23}, + {62, 25}, + {62, 36}, + {62, 38}, + {62, 46}, + {62, 51}, + {62, 55}, + {62, 57}, + {62, 60}, + {62, 70}, + {62, 73}, + {62, 76}, + {62, 85}, + {62, 90}, + {62, 97}, + {63, 2}, + {63, 7}, + {63, 11}, + {63, 20}, + {63, 21}, + {63, 23}, + {63, 38}, + {63, 47}, + {63, 54}, + {63, 59}, + {63, 62}, + {63, 65}, + {63, 70}, + {63, 81}, + {63, 87}, + {63, 93}, + {64, 0}, + {64, 3}, + {64, 11}, + {64, 15}, + {64, 18}, + {64, 25}, + {64, 26}, + {64, 34}, + {64, 48}, + {64, 49}, + {64, 50}, + {64, 51}, + {64, 53}, + {64, 54}, + {64, 55}, + {64, 56}, + {64, 58}, + {64, 59}, + {64, 65}, + {64, 75}, + {64, 78}, + {64, 79}, + {64, 83}, + {64, 93}, + {65, 4}, + {65, 11}, + {65, 15}, + {65, 24}, + {65, 26}, + {65, 43}, + {65, 52}, + {65, 61}, + {65, 64}, + {65, 81}, + {65, 84}, + {65, 86}, + {65, 92}, + {66, 2}, + {66, 7}, + {66, 13}, + {66, 31}, + {66, 34}, + {66, 35}, + {66, 42}, + {66, 44}, + {66, 46}, + {66, 48}, + {66, 49}, + {66, 58}, + {66, 59}, + {66, 64}, + {66, 79}, + {66, 88}, + {66, 90}, + {66, 92}, + {66, 96}, + {66, 98}, + {66, 99}, + {67, 1}, + {67, 3}, + {67, 4}, + {67, 9}, + {67, 11}, + {67, 14}, + {67, 18}, + {67, 20}, + {67, 21}, + {67, 24}, + {67, 27}, + {67, 29}, + {67, 40}, + {67, 41}, + {67, 47}, + {67, 53}, + {67, 55}, + {67, 58}, + {67, 59}, + {67, 67}, + {67, 72}, + {67, 75}, + {67, 76}, + {67, 81}, + {67, 84}, + {67, 93}, + {67, 95}, + {67, 97}, + {67, 98}, + {68, 3}, + {68, 12}, + {68, 18}, + {68, 25}, + {68, 27}, + {68, 33}, + {68, 34}, + {68, 35}, + {68, 40}, + {68, 42}, + {68, 43}, + {68, 50}, + {68, 51}, + {68, 53}, + {68, 60}, + {68, 74}, + {68, 81}, + {68, 82}, + {68, 96}, + {68, 98}, + {69, 3}, + {69, 8}, + {69, 20}, + {69, 24}, + {69, 28}, + {69, 30}, + {69, 35}, + {69, 44}, + {69, 59}, + {69, 60}, + {69, 67}, + {69, 75}, + {69, 76}, + {69, 85}, + {69, 86}, + {69, 88}, + {69, 95}, + {70, 4}, + {70, 6}, + {70, 16}, + {70, 18}, + {70, 20}, + {70, 22}, + {70, 24}, + {70, 29}, + {70, 31}, + {70, 36}, + {70, 37}, + {70, 39}, + {70, 53}, + {70, 54}, + {70, 55}, + {70, 63}, + {70, 71}, + {70, 83}, + {70, 85}, + {70, 90}, + {70, 91}, + {70, 94}, + {70, 96}, + {71, 14}, + {71, 18}, + {71, 25}, + {71, 29}, + {71, 30}, + {71, 32}, + {71, 37}, + {71, 38}, + {71, 41}, + {71, 43}, + {71, 46}, + {71, 50}, + {71, 51}, + {71, 54}, + {71, 70}, + {71, 78}, + {71, 86}, + {71, 88}, + {71, 90}, + {71, 91}, + {71, 94}, + {72, 3}, + {72, 13}, + {72, 21}, + {72, 34}, + {72, 43}, + {72, 45}, + {72, 48}, + {72, 52}, + {72, 55}, + {72, 58}, + {72, 61}, + {72, 71}, + {72, 77}, + {72, 78}, + {72, 92}, + {72, 93}, + {72, 94}, + {72, 96}, + {73, 1}, + {73, 5}, + {73, 22}, + {73, 25}, + {73, 50}, + {73, 63}, + {73, 69}, + {73, 77}, + {73, 79}, + {73, 82}, + {73, 86}, + {73, 88}, + {73, 94}, + {74, 1}, + {74, 5}, + {74, 8}, + {74, 11}, + {74, 17}, + {74, 19}, + {74, 20}, + {74, 25}, + {74, 32}, + {74, 36}, + {74, 43}, + {74, 44}, + {74, 50}, + {74, 54}, + {74, 55}, + {74, 58}, + {74, 72}, + {74, 74}, + {74, 75}, + {74, 78}, + {74, 87}, + {74, 91}, + {74, 98}, + {74, 99}, + {75, 4}, + {75, 14}, + {75, 32}, + {75, 33}, + {75, 36}, + {75, 43}, + {75, 45}, + {75, 47}, + {75, 60}, + {75, 61}, + {75, 62}, + {75, 66}, + {75, 78}, + {75, 79}, + {75, 82}, + {75, 92}, + {75, 93}, + {75, 99}, + {76, 1}, + {76, 10}, + {76, 19}, + {76, 20}, + {76, 37}, + {76, 38}, + {76, 43}, + {76, 44}, + {76, 48}, + {76, 51}, + {76, 52}, + {76, 56}, + {76, 61}, + {76, 69}, + {76, 71}, + {76, 80}, + {76, 84}, + {76, 89}, + {76, 92}, + {76, 93}, + {76, 94}, + {76, 97}, + {77, 12}, + {77, 21}, + {77, 23}, + {77, 24}, + {77, 25}, + {77, 31}, + {77, 33}, + {77, 40}, + {77, 41}, + {77, 45}, + {77, 47}, + {77, 55}, + {77, 57}, + {77, 58}, + {77, 61}, + {77, 84}, + {77, 95}, + {78, 3}, + {78, 5}, + {78, 7}, + {78, 10}, + {78, 11}, + {78, 15}, + {78, 16}, + {78, 17}, + {78, 55}, + {78, 59}, + {78, 70}, + {78, 71}, + {78, 72}, + {78, 75}, + {78, 81}, + {78, 86}, + {78, 88}, + {78, 91}, + {78, 94}, + {78, 99}, + {79, 1}, + {79, 9}, + {79, 13}, + {79, 20}, + {79, 23}, + {79, 34}, + {79, 36}, + {79, 37}, + {79, 44}, + {79, 45}, + {79, 46}, + {79, 48}, + {79, 54}, + {79, 57}, + {79, 59}, + {79, 60}, + {79, 92}, + {79, 95}, + {79, 97}, + {79, 98}, + {80, 3}, + {80, 17}, + {80, 20}, + {80, 21}, + {80, 23}, + {80, 26}, + {80, 34}, + {80, 38}, + {80, 39}, + {80, 44}, + {80, 48}, + {80, 55}, + {80, 63}, + {80, 66}, + {80, 67}, + {80, 71}, + {80, 78}, + {80, 84}, + {80, 93}, + {81, 2}, + {81, 5}, + {81, 27}, + {81, 28}, + {81, 30}, + {81, 37}, + {81, 42}, + {81, 44}, + {81, 46}, + {81, 47}, + {81, 48}, + {81, 50}, + {81, 55}, + {81, 57}, + {81, 61}, + {81, 67}, + {81, 68}, + {81, 77}, + {81, 78}, + {81, 85}, + {81, 86}, + {81, 90}, + {81, 96}, + {81, 98}, + {82, 6}, + {82, 9}, + {82, 12}, + {82, 15}, + {82, 19}, + {82, 31}, + {82, 35}, + {82, 41}, + {82, 46}, + {82, 51}, + {82, 54}, + {82, 58}, + {82, 69}, + {82, 78}, + {82, 80}, + {82, 82}, + {82, 89}, + {82, 94}, + {82, 96}, + {82, 97}, + {83, 11}, + {83, 14}, + {83, 26}, + {83, 30}, + {83, 32}, + {83, 36}, + {83, 37}, + {83, 44}, + {83, 47}, + {83, 59}, + {83, 60}, + {83, 64}, + {83, 77}, + {83, 79}, + {83, 93}, + {84, 1}, + {84, 5}, + {84, 11}, + {84, 19}, + {84, 20}, + {84, 22}, + {84, 27}, + {84, 33}, + {84, 38}, + {84, 42}, + {84, 44}, + {84, 48}, + {84, 54}, + {84, 67}, + {84, 72}, + {84, 73}, + {84, 75}, + {84, 76}, + {84, 84}, + {84, 89}, + {84, 95}, + {84, 99}, + {85, 12}, + {85, 15}, + {85, 16}, + {85, 20}, + {85, 21}, + {85, 23}, + {85, 24}, + {85, 35}, + {85, 37}, + {85, 44}, + {85, 54}, + {85, 60}, + {85, 62}, + {85, 63}, + {85, 64}, + {85, 66}, + {85, 67}, + {85, 68}, + {85, 69}, + {85, 71}, + {85, 81}, + {85, 88}, + {86, 0}, + {86, 3}, + {86, 5}, + {86, 6}, + {86, 7}, + {86, 8}, + {86, 20}, + {86, 32}, + {86, 34}, + {86, 35}, + {86, 38}, + {86, 39}, + {86, 42}, + {86, 43}, + {86, 44}, + {86, 62}, + {86, 67}, + {86, 74}, + {86, 79}, + {86, 83}, + {86, 94}, + {86, 98}, + {87, 8}, + {87, 12}, + {87, 19}, + {87, 26}, + {87, 28}, + {87, 31}, + {87, 39}, + {87, 41}, + {87, 43}, + {87, 47}, + {87, 48}, + {87, 50}, + {87, 51}, + {87, 55}, + {87, 57}, + {87, 63}, + {87, 67}, + {87, 68}, + {87, 69}, + {87, 72}, + {87, 81}, + {87, 83}, + {87, 92}, + {88, 0}, + {88, 5}, + {88, 6}, + {88, 14}, + {88, 17}, + {88, 21}, + {88, 28}, + {88, 29}, + {88, 30}, + {88, 31}, + {88, 50}, + {88, 51}, + {88, 54}, + {88, 58}, + {88, 63}, + {88, 65}, + {88, 75}, + {88, 80}, + {88, 83}, + {88, 86}, + {88, 88}, + {88, 92}, + {88, 93}, + {89, 1}, + {89, 2}, + {89, 7}, + {89, 11}, + {89, 15}, + {89, 16}, + {89, 24}, + {89, 27}, + {89, 33}, + {89, 36}, + {89, 39}, + {89, 40}, + {89, 41}, + {89, 42}, + {89, 44}, + {89, 45}, + {89, 46}, + {89, 50}, + {89, 53}, + {89, 54}, + {89, 57}, + {89, 58}, + {89, 60}, + {89, 61}, + {89, 65}, + {89, 84}, + {89, 85}, + {89, 86}, + {89, 93}, + {89, 97}, + {89, 98}, + {90, 5}, + {90, 6}, + {90, 8}, + {90, 9}, + {90, 10}, + {90, 11}, + {90, 13}, + {90, 17}, + {90, 19}, + {90, 26}, + {90, 29}, + {90, 30}, + {90, 34}, + {90, 44}, + {90, 50}, + {90, 61}, + {90, 63}, + {90, 64}, + {90, 75}, + {90, 78}, + {90, 85}, + {90, 88}, + {90, 89}, + {90, 92}, + {90, 94}, + {90, 96}, + {90, 98}, + {91, 0}, + {91, 17}, + {91, 23}, + {91, 24}, + {91, 34}, + {91, 40}, + {91, 44}, + {91, 45}, + {91, 49}, + {91, 52}, + {91, 57}, + {91, 58}, + {91, 61}, + {91, 73}, + {91, 96}, + {92, 0}, + {92, 16}, + {92, 22}, + {92, 29}, + {92, 36}, + {92, 39}, + {92, 42}, + {92, 44}, + {92, 46}, + {92, 54}, + {92, 60}, + {92, 65}, + {92, 73}, + {92, 78}, + {92, 86}, + {92, 88}, + {92, 91}, + {92, 94}, + {93, 11}, + {93, 12}, + {93, 14}, + {93, 16}, + {93, 19}, + {93, 38}, + {93, 43}, + {93, 48}, + {93, 53}, + {93, 57}, + {93, 61}, + {93, 62}, + {93, 64}, + {93, 78}, + {93, 89}, + {94, 0}, + {94, 1}, + {94, 2}, + {94, 3}, + {94, 9}, + {94, 12}, + {94, 22}, + {94, 27}, + {94, 35}, + {94, 42}, + {94, 62}, + {94, 68}, + {94, 73}, + {94, 75}, + {94, 83}, + {94, 85}, + {94, 87}, + {94, 88}, + {94, 92}, + {94, 93}, + {94, 96}, + {95, 0}, + {95, 15}, + {95, 17}, + {95, 20}, + {95, 28}, + {95, 36}, + {95, 38}, + {95, 41}, + {95, 45}, + {95, 47}, + {95, 53}, + {95, 56}, + {95, 79}, + {95, 82}, + {95, 84}, + {95, 89}, + {95, 97}, + {96, 14}, + {96, 16}, + {96, 22}, + {96, 23}, + {96, 39}, + {96, 44}, + {96, 45}, + {96, 46}, + {96, 59}, + {96, 61}, + {96, 67}, + {96, 68}, + {96, 69}, + {96, 70}, + {96, 90}, + {96, 92}, + {96, 95}, + {96, 99}, + {97, 8}, + {97, 13}, + {97, 17}, + {97, 29}, + {97, 42}, + {97, 43}, + {97, 44}, + {97, 47}, + {97, 50}, + {97, 55}, + {97, 58}, + {97, 67}, + {97, 71}, + {97, 78}, + {97, 80}, + {97, 87}, + {97, 92}, + {97, 94}, + {97, 96}, + {98, 3}, + {98, 4}, + {98, 5}, + {98, 8}, + {98, 9}, + {98, 17}, + {98, 19}, + {98, 22}, + {98, 26}, + {98, 30}, + {98, 32}, + {98, 37}, + {98, 38}, + {98, 39}, + {98, 46}, + {98, 53}, + {98, 56}, + {98, 59}, + {98, 66}, + {98, 77}, + {98, 85}, + {98, 89}, + {98, 96}, + {98, 97}, + {99, 8}, + {99, 9}, + {99, 10}, + {99, 13}, + {99, 15}, + {99, 21}, + {99, 24}, + {99, 29}, + {99, 35}, + {99, 61}, + {99, 73}, + {99, 81}, + {99, 84}, + {99, 89}, + {99, 90}, + {99, 91}, + {99, 97}, + }, + [][]int{ + {0, 0}, + {6, 0}, + {7, 0}, + {8, 0}, + {10, 0}, + {11, 0}, + {13, 0}, + {15, 0}, + {17, 0}, + {18, 0}, + {27, 0}, + {30, 0}, + {39, 0}, + {49, 0}, + {55, 0}, + {64, 0}, + {86, 0}, + {88, 0}, + {91, 0}, + {92, 0}, + {94, 0}, + {95, 0}, + {98, 3}, + {99, 8}, + {99, 9}, + {99, 10}, + {99, 13}, + {99, 15}, + {99, 21}, + {99, 24}, + {99, 29}, + {99, 35}, + {99, 61}, + {99, 73}, + {99, 81}, + {99, 84}, + {99, 89}, + {99, 90}, + {99, 91}, + {99, 97}, + {96, 99}, + {84, 99}, + {78, 99}, + {75, 99}, + {74, 99}, + {66, 99}, + {60, 99}, + {59, 99}, + {57, 99}, + {52, 99}, + {50, 99}, + {48, 99}, + {47, 99}, + {41, 99}, + {36, 99}, + {26, 99}, + {24, 99}, + {23, 99}, + {7, 99}, + {2, 99}, + {0, 99}, + {0, 96}, + {0, 89}, + {0, 85}, + {0, 72}, + {0, 67}, + {0, 63}, + {0, 55}, + {0, 54}, + {0, 49}, + {0, 40}, + {0, 39}, + {0, 32}, + {0, 26}, + {0, 25}, + {0, 22}, + {0, 19}, + {0, 4}, + }, + }, + + { + [][]int{{0, 0}, {1, 0}, {1, 3}, {1, 8}, {1, 9}, {2, 0}, {2, 6}, {3, 0}, {3, 1}, {3, 4}, {3, 6}, {4, 2}, {4, 6}, {5, 7}, {5, 8}, {6, 2}, {6, 4}, {7, 7}, {7, 9}, {8, 0}, {8, 1}, {8, 3}, {8, 5}, {9, 6}}, + [][]int{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {8, 0}, {9, 6}, {7, 9}, {1, 9}}, + }, + + { + [][]int{{0, 0}, {0, 1}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {3, 1}, {3, 0}, {2, 0}, {1, 0}, {1, 1}, {4, 3}}, + [][]int{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 3}, {0, 2}, {0, 1}}, + }, + + { + [][]int{{0, 0}, {0, 100}, {100, 100}, {100, 0}, {50, 50}}, + [][]int{{0, 0}, {0, 100}, {100, 100}, {100, 0}}, + }, + + { + [][]int{{4, 2}, {2, 2}, {2, 0}, {2, 4}, {3, 3}, {1, 1}}, + [][]int{{2, 0}, {4, 2}, {3, 3}, {2, 4}, {1, 1}}, + }, + + { + [][]int{{1, 2}, {2, 2}, {4, 2}}, + [][]int{{1, 2}, {2, 2}, {4, 2}}, + }, + + { + [][]int{{2, 2}, {4, 2}, {1, 2}}, + [][]int{{1, 2}, {2, 2}, {4, 2}}, + }, + + // 可以有多个 testcase +} + +func Test_outerTrees(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + // fmt.Printf("~~%v~~\n", tc) + points := kit.Intss2Points(tc.points) + expected := kit.Points2Intss(outerTrees(points)) + sort.Sort(intss(expected)) + sort.Sort(intss(tc.ans)) + ast.Equal(tc.ans, expected) + } +} + +func Benchmark_outerTrees(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + points := kit.Intss2Points(tc.points) + outerTrees(points) + } + } +} + +// intss 实现了 sort.Interface 接口 +type intss [][]int + +func (iss intss) Len() int { return len(iss) } + +func (iss intss) Less(i, j int) bool { + if iss[i][0] == iss[j][0] { + return iss[i][1] < iss[j][1] + } + return iss[i][0] < iss[j][0] +} + +func (iss intss) Swap(i, j int) { iss[i], iss[j] = iss[j], iss[i] } diff --git a/Algorithms/0591.tag-validator/README.md b/Algorithms/0591.tag-validator/README.md new file mode 100755 index 000000000..a51b4d24f --- /dev/null +++ b/Algorithms/0591.tag-validator/README.md @@ -0,0 +1,70 @@ +# [591. Tag Validator](https://leetcode.com/problems/tag-validator/) + +## 题目 + +Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is valid if all the following rules hold: + +1. The code must be wrapped in a valid closed tag. Otherwise, the code is invalid. +1. A closed tag (not necessarily valid) has exactly the following format : TAG_CONTENT. Among them, is the start tag, and is the end tag. The TAG_NAME in start and end tags should be the same. A closed tag is valid if and only if the TAG_NAME and TAG_CONTENT are valid. +1. A valid TAG_NAME only contain upper-case letters, and has length in range [1,9]. Otherwise, the TAG_NAME is invalid. +1. A valid TAG_CONTENT may contain other valid closed tags, cdata and any characters (see note1) EXCEPT unmatched <, unmatched start and end tag, and unmatched or closed tags with invalid TAG_NAME. Otherwise, the TAG_CONTENT is invalid. +1. A start tag is unmatched if no end tag exists with the same TAG_NAME, and vice versa. However, you also need to consider the issue of unbalanced when tags are nested. +1. A < is unmatched if you cannot find a subsequent >. And when you find a < or should be parsed as TAG_NAME (not necessarily valid). +1. The cdata has the following format : . The range of CDATA_CONTENT is defined as the characters between +1. CDATA_CONTENT may contain any characters. The function of cdata is to forbid the validator to parse CDATA_CONTENT, so even it has some characters that can be parsed as tag (no matter valid or invalid), you should treat it as regular characters. + +Valid Code Examples: + +```text +Input: "
This is the first line ]]>
" +Output: True +Explanation: +The code is wrapped in a closed tag :
and
. +The TAG_NAME is valid, the TAG_CONTENT consists of some characters and cdata. +Although CDATA_CONTENT has unmatched start tag with invalid TAG_NAME, it should be considered as plain text, not parsed as tag. +So TAG_CONTENT is valid, and then the code is valid. Thus return true. + +Input: "
>> ![cdata[]] ]>]]>]]>>]
" +Output: True +Explanation: +We first separate the code into : start_tag|tag_content|end_tag. +start_tag -> "
" +end_tag -> "
" +tag_content could also be separated into : text1|cdata|text2. +text1 -> ">> ![cdata[]] " +cdata -> "]>]]>", where the CDATA_CONTENT is "
]>" +text2 -> "]]>>]" + +The reason why start_tag is NOT "
>>" is because of the rule 6. +The reason why cdata is NOT "]>]]>]]>" is because of the rule 7. +``` + +Invalid Code Examples: + +```text +Input: " " +Output: False +Explanation: Unbalanced. If "" is closed, then "" must be unmatched, and vice versa. + +Input: "
div tag is not closed
" +Output: False + +Input: "
unmatched <
" +Output: False + +Input: "
closed tags with invalid tag name 123
" +Output: False + +Input: "
unmatched tags with invalid tag name and
" +Output: False + +Input: "
unmatched start tag and unmatched end tag
" +Output: False +``` + +Note: +For simplicity, you could assume the input code (including the any characters mentioned above) only contain letters, digits, '<','>','/','!','[',']' and ' '. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0591.tag-validator/tag-validator.go b/Algorithms/0591.tag-validator/tag-validator.go new file mode 100755 index 000000000..5a6b48842 --- /dev/null +++ b/Algorithms/0591.tag-validator/tag-validator.go @@ -0,0 +1,70 @@ +package problem0591 + +import ( + "strings" +) + +func isValid(code string) bool { + // isAvailbleTagName 返回 true, 当 code[i:j] 符合 TAG_NAME 的命名规范时 + isAvailbleTagName := func(i, j int) bool { + if i > j || // code[i:] 中没有 ">" + i == j || // TAG_NAME 为 "" + i+9 < j { // TAG_NAME 长度超过 9 + return false + } + for k := i; k < j; k++ { + if code[k] < 'A' || 'Z' < code[k] { + // TAG_NAME 中存在非大写字母 + return false + } + } + return true + } + + stack := make([]string, 0, 16) + for i := 0; i < len(code); { + // 所有的内容都应该在 tag 中 + // 所以,除非 i == 0 + // stack 中都应该至少有一个 TAG_NAME + if i > 0 && len(stack) == 0 { + return false + } + + switch { + case strings.HasPrefix(code[i:], "") + if i > j { + return false + } + i = j + 3 + case strings.HasPrefix(code[i:], "") + if !isAvailbleTagName(i, j) { + return false + } + tagName := code[i:j] + i = j + 1 + n := len(stack) + if n == 0 || stack[n-1] != tagName { + return false + } + stack = stack[:n-1] + case code[i] == '<': + i++ + j := i + strings.Index(code[i:], ">") + if !isAvailbleTagName(i, j) { + return false + } + tagName := code[i:j] + i = j + 1 + stack = append(stack, tagName) + default: + i++ + } + } + + // len(stack) != 0 说明, TAG 没有封闭 + return len(stack) == 0 +} diff --git a/Algorithms/0591.tag-validator/tag-validator_test.go b/Algorithms/0591.tag-validator/tag-validator_test.go new file mode 100755 index 000000000..201e7f781 --- /dev/null +++ b/Algorithms/0591.tag-validator/tag-validator_test.go @@ -0,0 +1,84 @@ +package problem0591 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + code string + ans bool +}{ + + { + "
This is the first line ]]>
", + true, + }, + + { + "
>> ![cdata[]] ]>]>]>>]
", + false, + }, + + { + "
>> ![cdata[]] ]>]]>]]>>]
", + true, + }, + + { + "BBB
", + false, + }, + + { + " ", + false, + }, + + { + "
div tag is not closed
", + false, + }, + + { + "
unmatched <
", + false, + }, + + { + "
closed tags with invalid tag name 123
", + false, + }, + + { + "
unmatched tags with invalid tag name and
", + false, + }, + + { + "
unmatched start tag and unmatched end tag
", + false, + }, + + // 可以有多个 testcase +} + +func Test_isValid(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isValid(tc.code), "输入:%v", tc) + } +} + +func Benchmark_isValid(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isValid(tc.code) + } + } +} diff --git a/Algorithms/0592.fraction-addition-and-subtraction/README.md b/Algorithms/0592.fraction-addition-and-subtraction/README.md new file mode 100755 index 000000000..af2e872f9 --- /dev/null +++ b/Algorithms/0592.fraction-addition-and-subtraction/README.md @@ -0,0 +1,45 @@ +# [592. Fraction Addition and Subtraction](https://leetcode.com/problems/fraction-addition-and-subtraction/) + +## 题目 + +Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irreducible fraction. If your final result is an integer, say 2, you need to change it to the format of fraction that has denominator 1. So in this case, 2 should be converted to 2/1. + +Example 1: + +```text +Input:"-1/2+1/2" +Output: "0/1" +``` + +Example 2: + +```text +Input:"-1/2+1/2+1/3" +Output: "1/3" +``` + +Example 3: + +```text +Input:"1/3-1/2" +Output: "-1/6" +``` + +Example 4: + +```text +Input:"5/3+1/3" +Output: "2/1" +``` + +Note: + +1. The input string only contains '0' to '9', '/', '+' and '-'. So does the output. +1. Each fraction (input and output) has format ±numerator/denominator. If the first input fraction or the output is positive, then '+' will be omitted. +1. The input only contains valid irreducible fractions, where the numerator and denominator of each fraction will always be in the range [1,10]. If the denominator is 1, it means this fraction is actually an integer in a fraction format defined above. +1. The number of given fractions will be in the range [1,10]. +1. The numerator and denominator of the final result are guaranteed to be valid and in the range of 32-bit int. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction.go b/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction.go new file mode 100755 index 000000000..c01e744f1 --- /dev/null +++ b/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction.go @@ -0,0 +1,75 @@ +package problem0592 + +import ( + "strconv" + "strings" +) + +func fractionAddition(expression string) string { + expression = insertPlus(expression) + es := strings.Split(expression, "+") + res := getFrac(es[0]) + for i := 1; i < len(es); i++ { + res = add(res, getFrac(es[i])) + } + return res.String() +} + +// 在 s[1:] 中的每一个 '-' 前,插入一个 '+' +func insertPlus(s string) string { + bytes := []byte(s) + res := make([]byte, 1, len(bytes)*5/4) + res[0] = bytes[0] + for i := 1; i < len(bytes); i++ { + if bytes[i] == '-' { + res = append(res, '+') + } + res = append(res, bytes[i]) + } + return string(res) +} + +type fraction struct { + num, den int +} + +func add(a, b fraction) fraction { + num := a.num*b.den + b.num*a.den + den := a.den * b.den + d := gcd(abs(num), den) + return fraction{ + num: num / d, + den: den / d, + } +} + +func getFrac(s string) fraction { + ss := strings.Split(s, "/") + n, _ := strconv.Atoi(ss[0]) + d, _ := strconv.Atoi(ss[1]) + return fraction{ + num: n, + den: d, + } +} + +func (f fraction) String() string { + return strconv.Itoa(f.num) + "/" + strconv.Itoa(f.den) +} + +func gcd(a, b int) int { + if a < b { + a, b = b, a + } + if b == 0 { + return a + } + return gcd(b, a%b) +} + +func abs(a int) int { + if a < 0 { + return -a + } + return a +} diff --git a/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction_test.go b/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction_test.go new file mode 100755 index 000000000..738443e95 --- /dev/null +++ b/Algorithms/0592.fraction-addition-and-subtraction/fraction-addition-and-subtraction_test.go @@ -0,0 +1,54 @@ +package problem0592 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + expression string + ans string +}{ + + { + "-1/2+1/2", + "0/1", + }, + + { + "-1/2+1/2+1/3", + "1/3", + }, + + { + "1/3-1/2", + "-1/6", + }, + + { + "5/3+1/3", + "2/1", + }, + + // 可以有多个 testcase +} + +func Test_fractionAddition(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fractionAddition(tc.expression), "输入:%v", tc) + } +} + +func Benchmark_fractionAddition(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fractionAddition(tc.expression) + } + } +} diff --git a/Algorithms/0593.valid-square/README.md b/Algorithms/0593.valid-square/README.md new file mode 100755 index 000000000..dc3a081ca --- /dev/null +++ b/Algorithms/0593.valid-square/README.md @@ -0,0 +1,24 @@ +# [593. Valid Square](https://leetcode.com/problems/valid-square/) + +## 题目 + +Given the coordinates of four points in 2D space, return whether the four points could construct a square. + +The coordinate (x,y) of a point is represented by an integer array with two integers. + +Example: + +```text +Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1] +Output: True +``` + +Note: + +1. All the input integers are in the range [-10000, 10000]. +1. A valid square has four equal sides with positive length and four equal angles (90-degree angles). +1. Input points have no order. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0593.valid-square/valid-square.go b/Algorithms/0593.valid-square/valid-square.go new file mode 100755 index 000000000..cc6037562 --- /dev/null +++ b/Algorithms/0593.valid-square/valid-square.go @@ -0,0 +1,67 @@ +package problem0593 + +func validSquare(p1, p2, p3, p4 []int) bool { + vs := getVectors([][]int{p1, p2, p3, p4}) + for i := 0; i < 3; i++ { + for j := i + 1; j < 4; j++ { + if !isOK(vs[i], vs[j]) { + return false + } + } + } + return true +} + +// 获取以 ps 构成的四边形的中心为起点,到 ps 中各个点的向量 +func getVectors(ps [][]int) [][]int { + vs := make([][]int, 4) + c := getCenter(ps) + for i := range vs { + vs[i] = vector(ps[i], c) + } + return vs +} + +// NOTICE: 为了避免中心坐标出现小数,将四边形变成原来的 4 倍进行处理 +func getCenter(ps [][]int) []int { + x, y := 0, 0 + for i := 0; i < len(ps); i++ { + ps[i][0] *= 4 + ps[i][1] *= 4 + x += ps[i][0] + y += ps[i][1] + } + return []int{x / 4, y / 4} +} + +func vector(p, c []int) []int { + return []int{p[0] - c[0], p[1] - c[1]} +} + +func isOK(v1, v2 []int) bool { + if isZero(v1) || isZero(v2) { + return false + } + return isInverse(v1, v2) || + (isVertical(v1, v2) && isLengthEqual(v1, v2)) +} + +func isZero(v []int) bool { + return v[0] == 0 && v[1] == 0 +} + +func isInverse(v1, v2 []int) bool { + return v1[0]+v2[0] == 0 && v1[1]+v2[1] == 0 +} + +func isVertical(v1, v2 []int) bool { + return v1[0]*v2[0]+v1[1]*v2[1] == 0 +} + +func isLengthEqual(v1, v2 []int) bool { + return lenSquare(v1) == lenSquare(v2) +} + +func lenSquare(v []int) int { + return v[0]*v[0] + v[1]*v[1] +} diff --git a/Algorithms/0593.valid-square/valid-square_test.go b/Algorithms/0593.valid-square/valid-square_test.go new file mode 100755 index 000000000..3a1a49b1d --- /dev/null +++ b/Algorithms/0593.valid-square/valid-square_test.go @@ -0,0 +1,74 @@ +package problem0593 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + p1, p2, p3, p4 []int + ans bool +}{ + + { + []int{0, 0}, + []int{0, 0}, + []int{0, 0}, + []int{0, 1}, + false, + }, + + { + []int{0, 0}, + []int{0, 0}, + []int{0, 0}, + []int{0, 0}, + false, + }, + + { + []int{1, 3}, + []int{3, 7}, + []int{7, 4}, + []int{4, 0}, + false, + }, + + { + []int{0, 3}, + []int{3, 7}, + []int{7, 4}, + []int{4, 0}, + true, + }, + + { + []int{0, 0}, + []int{1, 1}, + []int{1, 0}, + []int{0, 1}, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, validSquare(tc.p1, tc.p2, tc.p3, tc.p4), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validSquare(tc.p1, tc.p2, tc.p3, tc.p4) + } + } +} diff --git a/Algorithms/0594.longest-harmonious-subsequence/README.md b/Algorithms/0594.longest-harmonious-subsequence/README.md new file mode 100755 index 000000000..23aab55d0 --- /dev/null +++ b/Algorithms/0594.longest-harmonious-subsequence/README.md @@ -0,0 +1,22 @@ +# [594. Longest Harmonious Subsequence](https://leetcode.com/problems/longest-harmonious-subsequence/) + +## 题目 + +We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. + +Now, given an integer array, you need to find the length of its longest harmonious subsequence among all its possible [subsequences](https://en.wikipedia.org/wiki/Subsequence). + +Example 1: + +```text +Input: [1,3,2,2,5,2,3,7] +Output: 5 +Explanation: The longest harmonious subsequence is [3,2,2,2,3]. +``` + +Note: +The length of the input array will not exceed 20,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence.go b/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence.go new file mode 100755 index 000000000..f7f12667c --- /dev/null +++ b/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence.go @@ -0,0 +1,21 @@ +package problem0594 + +func findLHS(nums []int) int { + r := make(map[int]int, len(nums)) + for _, n := range nums { + r[n]++ + } + + max := 0 + for n, c1 := range r { + c2, ok := r[n+1] + if ok { + t := c1 + c2 + if max < t { + max = t + } + } + } + + return max +} diff --git a/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence_test.go b/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence_test.go new file mode 100755 index 000000000..562cdca7e --- /dev/null +++ b/Algorithms/0594.longest-harmonious-subsequence/longest-harmonious-subsequence_test.go @@ -0,0 +1,44 @@ +package problem0594 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 1, 1, 1}, + 0, + }, + + { + []int{1, 3, 2, 2, 5, 2, 3, 7}, + 5, + }, + + // 可以有多个 testcase +} + +func Test_findLHS(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLHS(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_findLHS(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLHS(tc.nums) + } + } +} diff --git a/Algorithms/0598.range-addition-ii/README.md b/Algorithms/0598.range-addition-ii/README.md new file mode 100755 index 000000000..bb6aedac2 --- /dev/null +++ b/Algorithms/0598.range-addition-ii/README.md @@ -0,0 +1,43 @@ +# [598. Range Addition II](https://leetcode.com/problems/range-addition-ii/) + +## 题目 + +Given an m * n matrix M initialized with all 0's and several update operations. +Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a and b, which means M[i][j] should be added by one for all 0 <= i < a and 0 <= j < b. +You need to count and return the number of maximum integers in the matrix after performing all the operations. + +Example 1: + +```text +Input: +m = 3, n = 3 +operations = [[2,2],[3,3]] +Output: 4 +Explanation: +Initially, M = +[[0, 0, 0], + [0, 0, 0], + [0, 0, 0]] + +After performing [2,2], M = +[[1, 1, 0], + [1, 1, 0], + [0, 0, 0]] + +After performing [3,3], M = +[[2, 2, 1], + [2, 2, 1], + [1, 1, 1]] + +So the maximum integer in M is 2, and there are four of it in M. So return 4. +``` + +Note: + +1. The range of m and n is [1,40000]. +1. The range of a is [1,m], and the range of b is [1,n]. +1. The range of operations size won't exceed 10,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0598.range-addition-ii/range-addition-ii.go b/Algorithms/0598.range-addition-ii/range-addition-ii.go new file mode 100755 index 000000000..b6f8092db --- /dev/null +++ b/Algorithms/0598.range-addition-ii/range-addition-ii.go @@ -0,0 +1,16 @@ +package problem0598 + +func maxCount(m int, n int, ops [][]int) int { + for _, o := range ops { + m = min(m, o[0]) + n = min(n, o[1]) + } + return m * n +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0598.range-addition-ii/range-addition-ii_test.go b/Algorithms/0598.range-addition-ii/range-addition-ii_test.go new file mode 100755 index 000000000..e85ec7a03 --- /dev/null +++ b/Algorithms/0598.range-addition-ii/range-addition-ii_test.go @@ -0,0 +1,43 @@ +package problem0598 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + m int + n int + ops [][]int + ans int +}{ + + { + 3, + 3, + [][]int{{2, 2}, {3, 3}}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_maxCount(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxCount(tc.m, tc.n, tc.ops), "输入:%v", tc) + } +} + +func Benchmark_maxCount(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxCount(tc.m, tc.n, tc.ops) + } + } +} diff --git a/Algorithms/0599.minimum-index-sum-of-two-lists/599.100.png b/Algorithms/0599.minimum-index-sum-of-two-lists/599.100.png new file mode 100644 index 000000000..29e7c551f Binary files /dev/null and b/Algorithms/0599.minimum-index-sum-of-two-lists/599.100.png differ diff --git a/Algorithms/0599.minimum-index-sum-of-two-lists/README.md b/Algorithms/0599.minimum-index-sum-of-two-lists/README.md new file mode 100755 index 000000000..07decf0c4 --- /dev/null +++ b/Algorithms/0599.minimum-index-sum-of-two-lists/README.md @@ -0,0 +1,40 @@ +# [599. Minimum Index Sum of Two Lists](https://leetcode.com/problems/minimum-index-sum-of-two-lists/) + +## 题目 + +Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. + +You need to help them find out their common interest with the least list index sum. If there is a choice tie between answers, output all of them with no order requirement. You could assume there always exists an answer. + +Example 1: + +```text +Input: +["Shogun", "Tapioca Express", "Burger King", "KFC"] +["Piatti", "The Grill at Torrey Pines", "Hungry Hunter Steakhouse", "Shogun"] +Output: ["Shogun"] +Explanation: The only restaurant they both like is "Shogun". +``` + +Example 2: + +```text +Input: +["Shogun", "Tapioca Express", "Burger King", "KFC"] +["KFC", "Shogun", "Burger King"] +Output: ["Shogun"] +Explanation: The restaurant they both like and have the least index sum is "Shogun" with index sum 1 (0+1). +``` + +Note: + +1. The length of both lists will be in the range of [1, 1000]. +1. The length of strings in both lists will be in the range of [1, 30]. +1. The index is starting from 0 to the list length minus 1. +1. No duplicates in both lists. + +## 解题思路 + +见程序注释 + +![](599.100.png) \ No newline at end of file diff --git a/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists.go b/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists.go new file mode 100755 index 000000000..72404ba72 --- /dev/null +++ b/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists.go @@ -0,0 +1,28 @@ +package problem0599 + +func findRestaurant(list1 []string, list2 []string) []string { + if len(list1) > len(list2) { + list1, list2 = list2, list1 + } + + m2 := make(map[string]int, len(list2)) + for i := range list2 { + m2[list2[i]] = i + } + + min := 2000 + res := make([]string, 0, 1000) + for i, r := range list1 { + if j, ok := m2[r]; ok { + if min == i+j { + res = append(res, r) + } + if min > i+j { + min = i + j + res = append(res[len(res):], r) + } + } + } + + return res +} diff --git a/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists_test.go b/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists_test.go new file mode 100755 index 000000000..c20927fac --- /dev/null +++ b/Algorithms/0599.minimum-index-sum-of-two-lists/minimum-index-sum-of-two-lists_test.go @@ -0,0 +1,51 @@ +package problem0599 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + list1, list2, ans []string +}{ + + { + []string{"Shogun", "Tapioca Express", "Burger King", "KFC"}, + []string{"Piatti", "The Grill at Torrey Pines", "Hungry Hunter Steakhouse", "Shogun"}, + []string{"Shogun"}, + }, + + { + []string{"Shogun", "Tapioca Express", "Burger King", "KFC"}, + []string{"KFC", "Shogun", "Burger King"}, + []string{"Shogun"}, + }, + + { + []string{"Shogun", "Tapioca Express", "Burger King", "KFC"}, + []string{"KFC", "Burger King", "Tapioca Express", "Shogun"}, + []string{"Shogun", "Tapioca Express", "Burger King", "KFC"}, + }, + + // 可以有多个 testcase +} + +func Test_fcName(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRestaurant(tc.list1, tc.list2), "输入:%v", tc) + } +} + +func Benchmark_fcName(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRestaurant(tc.list1, tc.list2) + } + } +} diff --git a/Algorithms/0600.non-negative-integers-without-consecutive-ones/README.md b/Algorithms/0600.non-negative-integers-without-consecutive-ones/README.md new file mode 100755 index 000000000..896406b1b --- /dev/null +++ b/Algorithms/0600.non-negative-integers-without-consecutive-ones/README.md @@ -0,0 +1,28 @@ +# [600. Non-negative Integers without Consecutive Ones](https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/) + +## 题目 + +Given a positive integer n, find the number of non-negative integers less than or equal to n, whose binary representations do NOT contain consecutive ones. + +Example 1: + +```text +Input: 5 +Output: 5 +Explanation: +Here are the non-negative integers <= 5 with their corresponding binary representations: +0 : 0 +1 : 1 +2 : 10 +3 : 11 +4 : 100 +5 : 101 +Among them, only integer 3 disobeys the rule (two consecutive ones) and the other 5 satisfy the rule. +``` + +Note: +1 <= n <= 109 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones.go b/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones.go new file mode 100755 index 000000000..b47b77713 --- /dev/null +++ b/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones.go @@ -0,0 +1,45 @@ +package problem0600 + +func findIntegers(num int) int { + // binary 是 num 的二进制表示,逆序 + binary := make([]byte, 0, 32) + for num > 0 { + binary = append(binary, byte(num%2)+'0') + num /= 2 + } + + n := len(binary) + // a[i] == 长度为 i+1 且以 0 结尾的 binary 中不包含连续 1 的个数 + a := make([]int, n) + // b[i] == 长度为 i+1 且以 1 结尾的 binary 中不包含连续 1 的个数 + b := make([]int, n) + a[0] = 1 + b[0] = 1 + + for i := 1; i < n; i++ { + // 在 a[i-1] 中的 binary 右边加 0 + // 和 + // 在 b[i-1] 中的 binary 右边加 0 + // 可以得到 a[i] 中的 binary + a[i] = a[i-1] + b[i-1] + // 在 a[i-1] 中的 binary 右边加 1,可以得到 b[i] 中的 binary + // 在 b[i-1] 中的 binary 右边加 1 会得到连续的 1,违反了题意 + b[i] = a[i-1] + } + + res := a[n-1] + b[n-1] + // 此时的 res 可能包含了 >num 的那一部分数,需要减去相关部分 + for i := n - 2; i >= 0; i-- { + // 注意,此时的 binary 是逆序 + // 出现连续的 `1` 说明已经清理干净了 + if binary[i] == '1' && binary[i+1] == '1' { + break + } + // 当初多加了 b[i] + if binary[i] == '0' && binary[i+1] == '0' { + res -= b[i] + } + } + + return res +} diff --git a/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones_test.go b/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones_test.go new file mode 100755 index 000000000..98c97d1c4 --- /dev/null +++ b/Algorithms/0600.non-negative-integers-without-consecutive-ones/non-negative-integers-without-consecutive-ones_test.go @@ -0,0 +1,42 @@ +package problem0600 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans int +}{ + + {1000, 144}, + + {8, 6}, + + {5, 5}, + + {4, 4}, + + // 可以有多个 testcase +} + +func Test_findIntegers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findIntegers(tc.num), "输入:%v", tc) + } +} + +func Benchmark_findIntegers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findIntegers(tc.num) + } + } +} diff --git a/Algorithms/0605.can-place-flowers/can-place-flowers.go b/Algorithms/0605.can-place-flowers/can-place-flowers.go index 93e2a87f5..de37cab27 100755 --- a/Algorithms/0605.can-place-flowers/can-place-flowers.go +++ b/Algorithms/0605.can-place-flowers/can-place-flowers.go @@ -1,4 +1,4 @@ -package Problem0605 +package problem0605 func canPlaceFlowers(bed []int, n int) bool { l := len(bed) diff --git a/Algorithms/0605.can-place-flowers/can-place-flowers_test.go b/Algorithms/0605.can-place-flowers/can-place-flowers_test.go index 237e03641..38e5f1b87 100755 --- a/Algorithms/0605.can-place-flowers/can-place-flowers_test.go +++ b/Algorithms/0605.can-place-flowers/can-place-flowers_test.go @@ -1,4 +1,4 @@ -package Problem0605 +package problem0605 import ( "testing" diff --git a/Algorithms/0606.construct-string-from-binary-tree/README.md b/Algorithms/0606.construct-string-from-binary-tree/README.md new file mode 100755 index 000000000..a0fe832ce --- /dev/null +++ b/Algorithms/0606.construct-string-from-binary-tree/README.md @@ -0,0 +1,42 @@ +# [606. Construct String from Binary Tree](https://leetcode.com/problems/construct-string-from-binary-tree/) + +## 题目 + +You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. + +The null node needs to be represented by empty parenthesis pair "()". And you need to omit all the empty parenthesis pairs that don't affect the one-to-one mapping relationship between the string and the original binary tree. + +Example 1: + +```text +Input: Binary tree: [1,2,3,4] + 1 + / \ + 2 3 + / + 4 + +Output: "1(2(4))(3)" + +Explanation: Originallay it needs to be "1(2(4)())(3()())", but you need to omit all the unnecessary empty parenthesis pairs. +And it will be "1(2(4))(3)". +``` + +Example 2: + +```text +Input: Binary tree: [1,2,3,null,4] + 1 + / \ + 2 3 + \ + 4 + +Output: "1(2()(4))(3)" + +Explanation: Almost the same as the first example, except we can't omit the first parenthesis pair to break the one-to-one mapping relationship between the input and the output. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree.go b/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree.go new file mode 100755 index 000000000..240678c0c --- /dev/null +++ b/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree.go @@ -0,0 +1,28 @@ +package problem0606 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "strconv" +) + +type TreeNode = kit.TreeNode + +func tree2str(t *TreeNode) string { + if t == nil { + return "" + } + + res := strconv.Itoa(t.Val) + + if t.Left == nil && t.Right == nil { + return res + } + + res += "("+ tree2str(t.Left)+")" + + if t.Right != nil { + res += "("+ tree2str(t.Right)+")" + } + + return res +} diff --git a/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree_test.go b/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree_test.go new file mode 100755 index 000000000..04ac17fa3 --- /dev/null +++ b/Algorithms/0606.construct-string-from-binary-tree/construct-string-from-binary-tree_test.go @@ -0,0 +1,50 @@ +package problem0606 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans string +}{ + + { + []int{1, 2, 4, 3}, + []int{4, 2, 1, 3}, + "1(2(4))(3)", + }, + + { + []int{1, 2, 4, 3}, + []int{2, 4, 1, 3}, + "1(2()(4))(3)", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, tree2str(root), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + tree2str(root) + } + } +} diff --git a/Algorithms/0609.find-duplicate-file-in-system/README.md b/Algorithms/0609.find-duplicate-file-in-system/README.md new file mode 100755 index 000000000..7b55de51f --- /dev/null +++ b/Algorithms/0609.find-duplicate-file-in-system/README.md @@ -0,0 +1,51 @@ +# [609. Find Duplicate File in System](https://leetcode.com/problems/find-duplicate-file-in-system/) + +## 题目 + +Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of duplicate files in the file system in terms of their paths. + +A group of duplicate files consists of at least two files that have exactly the same content. + +A single directory info string in the input list has the following format: + +`"root/d1/d2/.../dm f1.txt(f1_content) f2.txt(f2_content) ... fn.txt(fn_content)"` + +`It means there are n files (f1.txt, f2.txt ... fn.txt with content f1_content, f2_content ... fn_content, respectively) in directory root/d1/d2/.../dm. Note that n >= 1 and m >= 0. If m = 0, it means the directory is just the root directory.` + +The output is a list of group of duplicate file paths. For each group, it contains all the file paths of the files that have the same content. A file path is a string that has the following format: + +`"directory_path/file_name.txt"` + +Example 1: + +Input: + +```text +["root/a 1.txt(abcd) 2.txt(efgh)", "root/c 3.txt(abcd)", "root/c/d 4.txt(efgh)", "root 4.txt(efgh)"] +``` + +Output: + +```text +[["root/a/2.txt","root/c/d/4.txt","root/4.txt"],["root/a/1.txt","root/c/3.txt"]] +``` + +Note: + +1. No order is required for the final output. +1. You may assume the directory name, file name and file content only has letters and digits, and the length of file content is in the range of [1,50]. +1. The number of files given is in the range of [1,20000]. +1. You may assume no files or directories share the same name in the same directory. +1. You may assume each given directory info represents a unique directory. Directory path and file info are separated by a single blank space. + +Follow-up beyond contest: + +1. Imagine you are given a real file system, how will you search files? DFS or BFS? +1. If the file content is very large (GB level), how will you modify your solution? +1. If you can only read the file by 1kb each time, how will you modify your solution? +1. What is the time complexity of your modified solution? What is the most time-consuming part and memory consuming part of it? How to optimize? +1. How to make sure the duplicated files you find are not false positive? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system.go b/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system.go new file mode 100755 index 000000000..bbef91ffa --- /dev/null +++ b/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system.go @@ -0,0 +1,38 @@ +package problem0609 + +import ( + "strings" +) + +func findDuplicate(path []string) [][]string { + // m 用于记录拥有相同文件内容的各个文件的个数 + m := make(map[string][]string, len(path)*2) + for i := 0; i < len(path); i++ { + analyze(path[i], m) + } + + res := make([][]string, 0, len(m)) + for _, files := range m { + if len(files) > 1 { + res = append(res, files) + } + } + + return res +} + +// 把 path 中的文件,按照文件内容,归类记录 +func analyze(path string, m map[string][]string) { + fs := strings.Split(path, " ") + p := fs[0] + for i := 1; i < len(fs); i++ { + f, c := fileAndContent(fs[i]) + m[c] = append(m[c], p+"/"+f) + } +} + +// 形为 filename(fileContent) 的 s 分解为 filename 和 fileContent 返回 +func fileAndContent(s string) (string, string) { + i := strings.IndexByte(s, '(') + return s[:i], s[i+1 : len(s)-1] +} diff --git a/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system_test.go b/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system_test.go new file mode 100755 index 000000000..dbf1d571b --- /dev/null +++ b/Algorithms/0609.find-duplicate-file-in-system/find-duplicate-file-in-system_test.go @@ -0,0 +1,55 @@ +package problem0609 + +import ( + "fmt" + "sort" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + path []string + ans [][]string +}{ + + { + []string{"root/a 1.txt(abcd) 2.txt(efgh)", "root/c 3.txt(abcd)", "root/c/d 4.txt(efgh)", "root 4.txt(efgh)"}, + [][]string{{"root/a/2.txt", "root/c/d/4.txt", "root/4.txt"}, {"root/a/1.txt", "root/c/3.txt"}}, + }, + + // 可以有多个 testcase +} + +func Test_fcName(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := findDuplicate(tc.path) + ast.Equal(normal(tc.ans), normal(ans), "输入:%v", tc) + } +} + +func normal(sss [][]string) string { + ss := make([]string, len(sss)) + + for i := 0; i < len(sss); i++ { + sort.Strings(sss[i]) + ss[i] = strings.Join(sss[i], "☆") + } + + sort.Strings(ss) + + return strings.Join(ss, "★★") +} + +func Benchmark_fcName(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findDuplicate(tc.path) + } + } +} diff --git a/Algorithms/0611.valid-triangle-number/valid-triangle-number.go b/Algorithms/0611.valid-triangle-number/valid-triangle-number.go index e662a2ee4..efa79c438 100755 --- a/Algorithms/0611.valid-triangle-number/valid-triangle-number.go +++ b/Algorithms/0611.valid-triangle-number/valid-triangle-number.go @@ -1,4 +1,4 @@ -package Problem0611 +package problem0611 import ( "sort" diff --git a/Algorithms/0611.valid-triangle-number/valid-triangle-number_test.go b/Algorithms/0611.valid-triangle-number/valid-triangle-number_test.go index a1450975b..8a20e4040 100755 --- a/Algorithms/0611.valid-triangle-number/valid-triangle-number_test.go +++ b/Algorithms/0611.valid-triangle-number/valid-triangle-number_test.go @@ -1,4 +1,4 @@ -package Problem0611 +package problem0611 import ( "fmt" diff --git a/Algorithms/0617.merge-two-binary-trees/README.md b/Algorithms/0617.merge-two-binary-trees/README.md new file mode 100755 index 000000000..e634c0c11 --- /dev/null +++ b/Algorithms/0617.merge-two-binary-trees/README.md @@ -0,0 +1,32 @@ +# [617. Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/) + +## 题目 + +Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. + +You need to merge them into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of new tree. + +Example 1: + +```text +Input: +Tree 1 Tree 2 + 1 2 + / \ / \ + 3 2 1 3 + / \ \ + 5 4 7 +Output: +Merged tree: + 3 + / \ + 4 5 + / \ \ + 5 4 7 +``` + +Note: The merging process must start from the root nodes of both trees. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees.go b/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees.go new file mode 100755 index 000000000..4c8938ea8 --- /dev/null +++ b/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees.go @@ -0,0 +1,28 @@ +package problem0617 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func mergeTrees(t1 *TreeNode, t2 *TreeNode) *TreeNode { + if t1 == nil && t2 == nil { + return nil + } + + if t1 == nil { + return t2 + } + + if t2 == nil { + return t1 + } + + root := &TreeNode{Val: t1.Val + t2.Val} + + root.Left = mergeTrees(t1.Left, t2.Left) + root.Right = mergeTrees(t1.Right, t2.Right) + + return root +} diff --git a/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees_test.go b/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees_test.go new file mode 100755 index 000000000..b80a47e87 --- /dev/null +++ b/Algorithms/0617.merge-two-binary-trees/merge-two-binary-trees_test.go @@ -0,0 +1,50 @@ +package problem0617 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre1, in1 []int + pre2, in2 []int + ansPost []int +}{ + + { + []int{1, 3, 5, 2}, + []int{5, 3, 1, 2}, + []int{20, 10, 40, 30, 70}, + []int{10, 40, 20, 30, 70}, + []int{5, 40, 13, 70, 32, 21}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + t1 := kit.PreIn2Tree(tc.pre1, tc.in1) + t2 := kit.PreIn2Tree(tc.pre2, tc.in2) + ansPost := kit.Tree2Postorder(mergeTrees(t1, t2)) + ast.Equal(tc.ansPost, ansPost, "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + t1 := kit.PreIn2Tree(tc.pre1, tc.in1) + t2 := kit.PreIn2Tree(tc.pre2, tc.in2) + mergeTrees(t1, t2) + } + } +} diff --git a/Algorithms/0621.task-scheduler/task-scheduler.go b/Algorithms/0621.task-scheduler/task-scheduler.go index e0699b0c9..af23f0848 100755 --- a/Algorithms/0621.task-scheduler/task-scheduler.go +++ b/Algorithms/0621.task-scheduler/task-scheduler.go @@ -1,4 +1,4 @@ -package Problem0621 +package problem0621 func leastInterval(tasks []byte, n int) int { if n == 0 { diff --git a/Algorithms/0621.task-scheduler/task-scheduler_test.go b/Algorithms/0621.task-scheduler/task-scheduler_test.go index 658e1ecdb..2721faf85 100755 --- a/Algorithms/0621.task-scheduler/task-scheduler_test.go +++ b/Algorithms/0621.task-scheduler/task-scheduler_test.go @@ -1,4 +1,4 @@ -package Problem0621 +package problem0621 import ( "fmt" diff --git a/Algorithms/0622.design-circular-queue/README.md b/Algorithms/0622.design-circular-queue/README.md new file mode 100755 index 000000000..58e0e2182 --- /dev/null +++ b/Algorithms/0622.design-circular-queue/README.md @@ -0,0 +1,42 @@ +# [622. Design Circular Queue](https://leetcode.com/problems/design-circular-queue/) + +## 题目 + +Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called "Ring Buffer". + +One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values. + +Your implementation should support following operations: + +- MyCircularQueue(k): Constructor, set the size of the queue to be k. +- Front: Get the front item from the queue. If the queue is empty, return -1. +- Rear: Get the last item from the queue. If the queue is empty, return -1. +- enQueue(value): Insert an element into the circular queue. Return true if the operation is successful. +- deQueue(): Delete an element from the circular queue. Return true if the operation is successful. +- isEmpty(): Checks whether the circular queue is empty or not. +- isFull(): Checks whether the circular queue is full or not. + +Example: + +```text +MyCircularQueue circularQueue = new MycircularQueue(3); // set the size to be 3 +circularQueue.enQueue(1); // return true +circularQueue.enQueue(2); // return true +circularQueue.enQueue(3); // return true +circularQueue.enQueue(4); // return false, the queue is full +circularQueue.Rear(); // return 3 +circularQueue.isFull(); // return true +circularQueue.deQueue(); // return true +circularQueue.enQueue(4); // return true +circularQueue.Rear(); // return 4 +``` + +Note: + +1. All values will be in the range of [0, 1000]. +1. The number of operations will be in the range of[1, 1000]. +1. Please do not use the built-in Queue library. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0622.design-circular-queue/design-circular-queue.go b/Algorithms/0622.design-circular-queue/design-circular-queue.go new file mode 100755 index 000000000..bb4bef36e --- /dev/null +++ b/Algorithms/0622.design-circular-queue/design-circular-queue.go @@ -0,0 +1,72 @@ +package problem0622 + +// MyCircularQueue 结构体 +type MyCircularQueue struct { + queue []int + k int +} + +// Constructor initialize your data structure here. Set the size of the queue to be k. +func Constructor(k int) MyCircularQueue { + return MyCircularQueue{ + queue: make([]int, 0, k*3), + k: k, + } +} + +// EnQueue insert an element into the circular queue. Return true if the operation is successful. +func (m *MyCircularQueue) EnQueue(value int) bool { + if len(m.queue) == m.k { + return false + } + m.queue = append(m.queue, value) + return true +} + +// DeQueue delete an element from the circular queue. Return true if the operation is successful. +func (m *MyCircularQueue) DeQueue() bool { + if len(m.queue) == 0 { + return false + } + + m.queue = m.queue[1:] + return true +} + +// Front get the front item from the queue. +func (m *MyCircularQueue) Front() int { + if len(m.queue) == 0 { + return -1 + } + + return m.queue[0] +} + +// Rear get the last item from the queue. */ +func (m *MyCircularQueue) Rear() int { + if len(m.queue) == 0 { + return -1 + } + return m.queue[len(m.queue)-1] +} + +// IsEmpty checks whether the circular queue is empty or not. */ +func (m *MyCircularQueue) IsEmpty() bool { + return len(m.queue) == 0 +} + +// IsFull checks whether the circular queue is full or not. */ +func (m *MyCircularQueue) IsFull() bool { + return len(m.queue) == m.k +} + +/** + * Your MyCircularQueue object will be instantiated and called as such: + * obj := Constructor(k); + * param_1 := obj.EnQueue(value); + * param_2 := obj.DeQueue(); + * param_3 := obj.Front(); + * param_4 := obj.Rear(); + * param_5 := obj.IsEmpty(); + * param_6 := obj.IsFull(); + */ diff --git a/Algorithms/0622.design-circular-queue/design-circular-queue_test.go b/Algorithms/0622.design-circular-queue/design-circular-queue_test.go new file mode 100755 index 000000000..35d4653d0 --- /dev/null +++ b/Algorithms/0622.design-circular-queue/design-circular-queue_test.go @@ -0,0 +1,44 @@ +package problem0622 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + m := Constructor(3) + + ast.True(m.IsEmpty(), "检查空数组的 IsEmpty()") + ast.False(m.IsFull(), "检查空数组的 IsFull()") + + ast.False(m.DeQueue(), "从空数组中删除元素") + + ast.Equal(-1, m.Front(), "检查空数组的首部元素") + ast.Equal(-1, m.Rear(), "检查空数组的尾部元素") + + for i := 1; i <= 3; i++ { + ast.True(m.EnQueue(i), "往数组中添加 %d", i) + } + + ast.False(m.EnQueue(4), "往满数组添加元素") + + ast.False(m.IsEmpty(), "检查满数组的 IsEmpty()") + ast.True(m.IsFull(), "检查满数组的 IsFull()") + + ast.Equal(3, m.Rear(), "检查数组尾部的元素") + + ast.True(m.DeQueue(), "从非空数组中删除元素") + + ast.Equal([]int{2, 3}, m.queue, "DeQueue 后,检查数组中的元素") + + ast.True(m.EnQueue(4), "往数组中添加新的元素") + + ast.Equal([]int{2, 3, 4}, m.queue, "EnQueue 后,检查数组中的元素") + + ast.Equal(4, m.Rear(), "检查数组尾部的元素") + + ast.Equal(2, m.Front(), "检查数组首部的元素") +} diff --git a/Algorithms/0623.add-one-row-to-tree/README.md b/Algorithms/0623.add-one-row-to-tree/README.md new file mode 100755 index 000000000..943350e52 --- /dev/null +++ b/Algorithms/0623.add-one-row-to-tree/README.md @@ -0,0 +1,66 @@ +# [623. Add One Row to Tree](https://leetcode.com/problems/add-one-row-to-tree/) + +## 题目 + +Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 1. + +The adding rule is: given a positive integer depth d, for each NOT null tree nodes N in depth d-1, create two tree nodes with value v as N's left subtree root and right subtree root. And N's original left subtree should be the left subtree of the new left subtree root, its original right subtree should be the right subtree of the new right subtree root. If depth d is 1 that means there is no depth d-1 at all, then create a tree node with value v as the new root of the whole original tree, and the original tree is the new root's left subtree. + +Example 1: + +```text +Input: +A binary tree as following: + 4 + / \ + 2 6 + / \ / + 3 1 5 + +v = 1 + +d = 2 + +Output: + 4 + / \ + 1 1 + / \ + 2 6 + / \ / + 3 1 5 +``` + +Example 2: + +```text +Input: +A binary tree as following: + 4 + / + 2 + / \ + 3 1 + +v = 1 + +d = 3 + +Output: + 4 + / + 2 + / \ + 1 1 + / \ +3 1 +``` + +Note: + +1. The given d is in range [1, maximum depth of the given tree + 1]. +1. The given binary tree has at least one tree node. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree.go b/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree.go new file mode 100755 index 000000000..2f42c6f39 --- /dev/null +++ b/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree.go @@ -0,0 +1,29 @@ +package problem0623 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func addOneRow(root *TreeNode, v int, d int) *TreeNode { + switch d { + case 1: + newRoot := &TreeNode{Val: v, Left: root} + return newRoot + case 2: + left := &TreeNode{Val: v, Left: root.Left} + right := &TreeNode{Val: v, Right: root.Right} + root.Left = left + root.Right = right + default: + if root.Left != nil { + root.Left = addOneRow(root.Left, v, d-1) + } + if root.Right != nil { + root.Right = addOneRow(root.Right, v, d-1) + } + } + + return root +} diff --git a/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree_test.go b/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree_test.go new file mode 100755 index 000000000..85600e6db --- /dev/null +++ b/Algorithms/0623.add-one-row-to-tree/add-one-row-to-tree_test.go @@ -0,0 +1,71 @@ +package problem0623 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + v, d int + ans []int +}{ + + { + []int{4, 2, 3, 1, 6, 5}, + []int{3, 2, 1, 4, 5, 6}, + 1, + 2, + []int{3, 1, 2, 1, 5, 6, 1, 4}, + }, + + { + []int{1, 2, 3}, + []int{2, 1, 3}, + 1, + 1, + []int{2, 3, 1, 1}, + }, + + { + []int{1, 2, 3, 4, 6}, + []int{1, 3, 2, 4, 6}, + 5, + 4, + []int{5, 5, 3, 5, 6, 5, 4, 2, 1}, + }, + + { + []int{4, 2, 3, 1}, + []int{3, 2, 1, 4}, + 1, + 3, + []int{3, 1, 1, 1, 2, 4}, + }, + + // 可以有多个 testcase +} + +func Test_fcName(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, kit.Tree2Postorder(addOneRow(root, tc.v, tc.d)), "输入:%v", tc) + } +} + +func Benchmark_fcName(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + addOneRow(root, tc.v, tc.d) + } + } +} diff --git a/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers.go b/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers.go index 302fe9e08..8d68ee096 100755 --- a/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers.go +++ b/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers.go @@ -1,4 +1,4 @@ -package Problem0628 +package problem0628 func maximumProduct(nums []int) int { diff --git a/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers_test.go b/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers_test.go index c7f1f8fe6..c62bb3259 100755 --- a/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers_test.go +++ b/Algorithms/0628.maximum-product-of-three-numbers/maximum-product-of-three-numbers_test.go @@ -1,4 +1,4 @@ -package Problem0628 +package problem0628 import ( "fmt" diff --git a/Algorithms/0629.k-inverse-pairs-array/README.md b/Algorithms/0629.k-inverse-pairs-array/README.md new file mode 100755 index 000000000..94aa84c10 --- /dev/null +++ b/Algorithms/0629.k-inverse-pairs-array/README.md @@ -0,0 +1,35 @@ +# [629. K Inverse Pairs Array](https://leetcode.com/problems/k-inverse-pairs-array/) + +## 题目 + +Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. + +We define an inverse pair as following: +For ith and jth element in the array, if i < j and a[i] > a[j] then it's an inverse pair; Otherwise, it's not. + +Since the answer may be very large, the answer should be modulo 109 + 7. + +Example 1: + +```text +Input: n = 3, k = 0 +Output: 1 +Explanation: +Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pair. +``` + +Example 2: + +```text +Input: n = 3, k = 1 +Output: 2 +Explanation: +The array [1,3,2] and [2,1,3] have exactly 1 inverse pair. +``` + +Note: +The integer n is in the range [1, 1000] and k is in the range [0, 1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array.go b/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array.go new file mode 100755 index 000000000..0d945d620 --- /dev/null +++ b/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array.go @@ -0,0 +1,49 @@ +package problem0629 + +const m = 1000000007 + +func kInversePairs(n int, k int) int { + // dp[n][k] 表示 1~n 可以表示的有 k 个逆序对的个数 + // 想要得到 dp[n][k],我们可以 + // 把 n 放在 dp[n-1][k] 的 n-1 位上 + // 把 n 放在 dp[n-1][k-1] 的 n-2 位上 + // 把 n 放在 dp[n-1][k-2] 的 n-3 位上 + // ..... + // 把 n 放在 dp[n-1][k-(n-1)] 的 0 位上 + // 可得 + // dp[n][k] = dp[n-1][k]+dp[n-1][k-1]+dp[n-1][k-2]+...+dp[n-1][k+1-n+1]+dp[n-1][k-n+1] + // 还可得 + // dp[n][k+1] = dp[n-1][k+1]+dp[n-1][k]+dp[n-1][k-1]+dp[n-1][k-2]+...+dp[n-1][k+1-n+1] + // 以上两式相减,可得 + // dp[n][k+1] = dp[n][k]+dp[n-1][k+1]-dp[n-1][k+1-n] + // 最终得到, + // dp[n][k] = dp[n][k-1]+dp[n-1][k]-dp[n-1][k-n] + dp := make([][]int, n+1) + for i := range dp { + dp[i] = make([]int, k+1) + dp[i][0] = 1 + } + + for i := 1; i <= n; i++ { + // 1~i 最多只有 i*(i-1)/2 个逆序对 + maxJ := min(k, i*(i-1)/2) + for j := 1; j <= maxJ; j++ { + dp[i][j] = (dp[i][j-1] + dp[i-1][j]) % m + if j >= i { + dp[i][j] -= dp[i-1][j-i] + if dp[i][j] < 0 { + dp[i][j] += m + } + } + } + } + + return dp[n][k] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array_test.go b/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array_test.go new file mode 100755 index 000000000..f446ebfe5 --- /dev/null +++ b/Algorithms/0629.k-inverse-pairs-array/k-inverse-pairs-array_test.go @@ -0,0 +1,65 @@ +package problem0629 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + k int + ans int +}{ + + { + 1000, + 500, + 955735232, + }, + + { + 10, + 3, + 155, + }, + + { + 4, + 2, + 5, + }, + + { + 3, + 0, + 1, + }, + + { + 3, + 1, + 2, + }, + + // 可以有多个 testcase +} + +func Test_kInversePairs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kInversePairs(tc.n, tc.k), "输入:%v", tc) + } +} + +func Benchmark_kInversePairs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kInversePairs(tc.n, tc.k) + } + } +} diff --git a/Algorithms/0630.course-schedule-iii/630.100.png b/Algorithms/0630.course-schedule-iii/630.100.png new file mode 100644 index 000000000..b96392f46 Binary files /dev/null and b/Algorithms/0630.course-schedule-iii/630.100.png differ diff --git a/Algorithms/0630.course-schedule-iii/README.md b/Algorithms/0630.course-schedule-iii/README.md new file mode 100755 index 000000000..462848c8d --- /dev/null +++ b/Algorithms/0630.course-schedule-iii/README.md @@ -0,0 +1,29 @@ +# [630. Course Schedule III](https://leetcode.com/problems/course-schedule-iii/) + +## 题目 + +There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be taken continuously for t days and must be finished before or on the dth day. You will start at the 1st day. + +Given n online courses represented by pairs (t,d), your task is to find the maximal number of courses that can be taken. + +Example: + +```text +Input: [[100, 200], [200, 1300], [1000, 1250], [2000, 3200]] +Output: 3 +Explanation: +There're totally 4 courses, but you can take 3 courses at most: +First, take the 1st course, it costs 100 days so you will finish it on the 100th day, and ready to take the next course on the 101st day. +Second, take the 3rd course, it costs 1000 days so you will finish it on the 1100th day, and ready to take the next course on the 1101st day. +Third, take the 2nd course, it costs 200 days so you will finish it on the 1300th day. +The 4th course cannot be taken now, since you will finish it on the 3300th day, which exceeds the closed date. +``` + +Note: + +1. The integer 1 <= d, t, n <= 10,000. +1. You can't take two courses simultaneously. + +## 解题思路 + +![100](630.100.png) \ No newline at end of file diff --git a/Algorithms/0630.course-schedule-iii/course-schedule-iii.go b/Algorithms/0630.course-schedule-iii/course-schedule-iii.go new file mode 100755 index 000000000..52910c453 --- /dev/null +++ b/Algorithms/0630.course-schedule-iii/course-schedule-iii.go @@ -0,0 +1,82 @@ +package problem0630 + +import ( + "container/heap" + "sort" +) + +func scheduleCourse(courses [][]int) int { + // taken 已经上过的课程的时长队列 + taken := new(maxPQ) + heap.Init(taken) + + // myCs 具体课程表 + myCs := cs(courses) + sort.Sort(myCs) + + // date 已经上过的课程的总时长 + var date int + // for 循环始终保持以下最优状态 + // 1. c[1] 日期前,尽可能多的课程 + // 2. 如果必须舍弃一部分课程的话。舍弃时长最长的课程,让 date 最小。只有这样的话,才能让后面的有机会上更多的课程。 + for _, c := range myCs { + heap.Push(taken, c[0]) + date += c[0] + for date > c[1] { + date -= heap.Pop(taken).(int) + } + } + + return taken.Len() +} + +// maxPQ 是最大值优先的队列 +type maxPQ []int + +func (q maxPQ) Len() int { + return len(q) +} + +func (q maxPQ) Less(i, j int) bool { + return q[i] > q[j] +} + +func (q maxPQ) Swap(i, j int) { + q[i], q[j] = q[j], q[i] +} + +func (q *maxPQ) Push(x interface{}) { + // Push 使用 *q,是因为 + // Push 增加了 q 的长度 + *q = append(*q, x.(int)) +} + +func (q *maxPQ) Pop() interface{} { + // Pop 使用 *q ,是因为 + // Pop 减短了 q 的长度 + res := (*q)[len(*q)-1] + *q = (*q)[:len(*q)-1] + return res +} + +// cs 是课程的描述课程的数据结构 +// cs[i][0]: 第 i 个课程的持续时间 +// cs[i][1]: 第 i 个课程的结束截止日期 +type cs [][]int + +func (c cs) Len() int { + return len(c) +} + +func (c cs) Less(i, j int) bool { + if c[i][1] == c[j][1] { + // 相同截止日期时,持续时间短的课程靠前 + return c[i][0] < c[j][0] + } + // 结束时间早的靠前 + return c[i][1] < c[j][1] +} + +func (c cs) Swap(i, j int) { + c[i], c[j] = c[j], c[i] +} diff --git a/Algorithms/0630.course-schedule-iii/course-schedule-iii_test.go b/Algorithms/0630.course-schedule-iii/course-schedule-iii_test.go new file mode 100755 index 000000000..fef00753b --- /dev/null +++ b/Algorithms/0630.course-schedule-iii/course-schedule-iii_test.go @@ -0,0 +1,44 @@ +package problem0630 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + courses [][]int + ans int +}{ + + { + [][]int{[]int{5, 5}, []int{4, 6}, []int{2, 6}}, + 2, + }, + + { + [][]int{[]int{100, 200}, []int{200, 1300}, []int{1000, 1250}, []int{2000, 3200}}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_scheduleCourse(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, scheduleCourse(tc.courses), "输入:%v", tc) + } +} + +func Benchmark_scheduleCourse(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + scheduleCourse(tc.courses) + } + } +} diff --git a/Algorithms/0632.smallest-range/README.md b/Algorithms/0632.smallest-range/README.md new file mode 100755 index 000000000..f94a93f27 --- /dev/null +++ b/Algorithms/0632.smallest-range/README.md @@ -0,0 +1,29 @@ +# [632. Smallest Range](https://leetcode.com/problems/smallest-range/) + +## 题目 + +You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists. + +We define the range [a,b] is smaller than range [c,d] if b-a < d-c or a < c if b-a == d-c. + +Example 1: + +```text +Input:[[4,10,15,24,26], [0,9,12,20], [5,18,22,30]] +Output: [20,24] +Explanation: +List 1: [4, 10, 15, 24,26], 24 is in range [20,24]. +List 2: [0, 9, 12, 20], 20 is in range [20,24]. +List 3: [5, 18, 22, 30], 22 is in range [20,24]. +``` + +Note: + +1. The given list may contain duplicates, so ascending order means >= here. +1. 1 <= k <= 3500 +1. -105 <= value of elements <= 105. +1. For Java users, please note that the input type has been changed to `List>`. And after you reset the code template, you'll see this point. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0632.smallest-range/smallest-range.go b/Algorithms/0632.smallest-range/smallest-range.go new file mode 100755 index 000000000..676887ae3 --- /dev/null +++ b/Algorithms/0632.smallest-range/smallest-range.go @@ -0,0 +1,114 @@ +package problem0632 + +import ( + "sort" +) + +func smallestRange(intss [][]int) []int { + // 把 intss 中的数字连同其队伍信息,整合成 num 结构体放入 ns + ns := makeNums(intss) + // 让 ns 根据其数值排列 + sort.Sort(ns) + + s := newStatus(ns, len(intss)) + s.check() + + return s.res +} + +type status struct { + res []int + ns nums + i, j int + minDiff int + absentTeamCount int + teamCount []int +} + +func newStatus(ns nums, teams int) *status { + return &status{ + res: make([]int, 2), + ns: ns, + i: 0, + j: -1, + minDiff: 1<<31 - 1, + absentTeamCount: teams, + teamCount: make([]int, teams), + } +} + +func (s *status) check() { + for s.j < len(s.ns) { + for s.j < len(s.ns) && !s.hasAllTeam() { + s.expend() + } + for s.hasAllTeam() { + s.updateRes() + s.shrink() + } + } +} + +func (s status) hasAllTeam() bool { + return s.absentTeamCount == 0 +} + +// 让 s.j++ 并修改相关的状态值 +func (s *status) expend() { + s.j++ + if s.j >= len(s.ns) { + return + } + if s.teamCount[s.ns[s.j].team] == 0 { + s.absentTeamCount-- + } + s.teamCount[s.ns[s.j].team]++ +} + +// 让 s.i-- 并修改相关的状态值 +func (s *status) shrink() { + if s.teamCount[s.ns[s.i].team] == 1 { + s.absentTeamCount++ + } + s.teamCount[s.ns[s.i].team]-- + s.i++ +} + +// 更新 s.res +func (s *status) updateRes() { + beg, end := s.ns[s.i].n, s.ns[s.j].n + diff := end - beg + if s.minDiff > diff { + s.res[0] = beg + s.res[1] = end + s.minDiff = diff + } +} + +func makeNums(intss [][]int) nums { + ns := make(nums, 0, len(intss)*3) + for i := range intss { + temp := make(nums, len(intss[i])) + for idx, n := range intss[i] { + temp[idx] = num{ + n: n, + team: i, + } + } + ns = append(ns, temp...) + } + return ns +} + +// nums 实现了 sort.Interface 接口 +type nums []num + +type num struct { + n, team int +} + +func (n nums) Len() int { return len(n) } + +func (n nums) Less(i, j int) bool { return n[i].n < n[j].n } + +func (n nums) Swap(i, j int) { n[i], n[j] = n[j], n[i] } diff --git a/Algorithms/0632.smallest-range/smallest-range_test.go b/Algorithms/0632.smallest-range/smallest-range_test.go new file mode 100755 index 000000000..572e291e9 --- /dev/null +++ b/Algorithms/0632.smallest-range/smallest-range_test.go @@ -0,0 +1,44 @@ +package problem0632 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums [][]int + ans []int +}{ + + { + [][]int{{4, 10, 15, 24, 26}, {0, 9, 12, 20}, {5, 18, 22, 30}}, + []int{20, 24}, + }, + + { + [][]int{{1, 2, 3}, {1, 2, 3}, {1, 2, 3}}, + []int{1, 1}, + }, + + // 可以有多个 testcase +} + +func Test_smallestRange(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, smallestRange(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_smallestRange(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestRange(tc.nums) + } + } +} diff --git a/Algorithms/0633.sum-of-square-numbers/README.md b/Algorithms/0633.sum-of-square-numbers/README.md new file mode 100755 index 000000000..3582cef2c --- /dev/null +++ b/Algorithms/0633.sum-of-square-numbers/README.md @@ -0,0 +1,24 @@ +# [633. Sum of Square Numbers](https://leetcode.com/problems/sum-of-square-numbers/) + +## 题目 + +Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a^2 + b^2 = c. + +Example 1: + +```text +Input: 5 +Output: True +Explanation: 1 * 1 + 2 * 2 = 5 +``` + +Example 2: + +```text +Input: 3 +Output: False +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers.go b/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers.go new file mode 100755 index 000000000..549293054 --- /dev/null +++ b/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers.go @@ -0,0 +1,25 @@ +package problem0633 + +import ( + "math" +) + +func judgeSquareSum(c int) bool { + a := intSqrt(c) + for a >= 0 { + if isSquare(c - a*a) { + return true + } + a-- + } + return false +} + +func intSqrt(c int) int { + return int(math.Sqrt(float64(c))) +} + +func isSquare(b2 int) bool { + b := intSqrt(b2) + return b*b == b2 +} diff --git a/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers_test.go b/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers_test.go new file mode 100755 index 000000000..6175c47d1 --- /dev/null +++ b/Algorithms/0633.sum-of-square-numbers/sum-of-square-numbers_test.go @@ -0,0 +1,49 @@ +package problem0633 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + c int + ans bool +}{ + + { + 3, + false, + }, + + { + 0, + true, + }, + + { + 5, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, judgeSquareSum(tc.c), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + judgeSquareSum(tc.c) + } + } +} diff --git a/Algorithms/0636.exclusive-time-of-functions/README.md b/Algorithms/0636.exclusive-time-of-functions/README.md new file mode 100755 index 000000000..8cbe1248b --- /dev/null +++ b/Algorithms/0636.exclusive-time-of-functions/README.md @@ -0,0 +1,41 @@ +# [636. Exclusive Time of Functions](https://leetcode.com/problems/exclusive-time-of-functions/) + +## 题目 + +Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions. + +Each function has a unique id, start from 0 to n-1. A function may be called recursively or by another function. + +A log is a string has this format : `function_id:start_or_end:timestamp`. For example, "0:start:0" means function 0 starts from the very beginning of time 0. "0:end:0" means function 0 ends to the very end of time 0. + +Exclusive time of a function is defined as the time spent within this function, the time spent by calling other functions should not be considered as this function's exclusive time. You should return the exclusive time of each function sorted by their function id. + +Example 1: + +```text +Input: +n = 2 +logs = +["0:start:0", + "1:start:2", + "1:end:5", + "0:end:6"] +Output:[3, 4] +Explanation: +Function 0 starts at time 0, then it executes 2 units of time and reaches the end of time 1. +Now function 0 calls function 1, function 1 starts at time 2, executes 4 units of time and end at time 5. +Function 0 is running again at time 6, and also end at the time 6, thus executes 1 unit of time. +So function 0 totally execute 2 + 1 = 3 units of time, and function 1 totally execute 4 units of time. +``` + +Note: + +1. Input logs will be sorted by timestamp, NOT log id. +1. Your output should be sorted by function id, which means the 0th element of your output corresponds to the exclusive time of function 0. +1. Two functions won't start or end at the same time. +1. Functions could be called recursively, and will always end. +1. 1 <= n <= 100 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions.go b/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions.go new file mode 100755 index 000000000..dcbf8c3ba --- /dev/null +++ b/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions.go @@ -0,0 +1,52 @@ +package problem0636 + +import ( + "strconv" + "strings" +) + +func exclusiveTime(n int, logs []string) []int { + size := len(logs) + + res := make([]int, n) + // stack 用于存放 start 的 function ID + stack := make([]int, 0, size) + // 注意,题目中 start:2 和 end:2 相隔了一秒 + // endPoint = 3 相当于题目中的 end:2 + endPoint := 0 + lastEndPoint := 0 + + for _, log := range logs { + fid, soe, ts := analyze(log) + + if soe == "start" { + // start:ts 相当于 endPoint = ts + endPoint = ts + if len(stack) > 0 { + // 遇到了新的 start + // 上一个 start 的 function 就需要即使统计运行时间 + res[stack[len(stack)-1]] += endPoint - lastEndPoint + } + stack = append(stack, fid) + lastEndPoint = endPoint + } else { + // end:ts 相当于 endPoint = ts + 1 + endPoint = ts + 1 + res[fid] += endPoint - lastEndPoint + stack = stack[:len(stack)-1] + lastEndPoint = endPoint + } + + } + + return res +} + +// 把 "function_id:start_or_end:timestamp" 解析后 +// 返回 function_id, start_or_end, timestamp +func analyze(log string) (int, string, int) { + ss := strings.Split(log, ":") + funcID, _ := strconv.Atoi(ss[0]) + timeStamp, _ := strconv.Atoi(ss[2]) + return funcID, ss[1], timeStamp +} diff --git a/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions_test.go b/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions_test.go new file mode 100755 index 000000000..0000f4c85 --- /dev/null +++ b/Algorithms/0636.exclusive-time-of-functions/exclusive-time-of-functions_test.go @@ -0,0 +1,113 @@ +package problem0636 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + logs []string + ans []int +}{ + + { + 2, + []string{"0:start:0", "0:start:2", "0:end:5", "1:start:6", "1:end:6", "0:end:7"}, + []int{7, 1}, + }, + + { + 2, + []string{"0:start:0", "1:start:2", "1:end:5", "0:end:6"}, + []int{3, 4}, + }, + + { + 2, + []string{"0:start:0", "0:end:0", "1:start:1", "1:end:1"}, + []int{1, 1}, + }, + + { + 8, + []string{ + "0:start:0", + "1:start:5", + "2:start:6", + "3:start:9", + "4:start:11", + "5:start:12", + "6:start:14", + "7:start:15", + "1:start:24", + "1:end:29", + "7:end:34", + "6:end:37", + "5:end:39", + "4:end:40", + "3:end:45", + "0:start:49", + "0:end:54", + "5:start:55", + "5:end:59", + "4:start:63", + "4:end:66", + "2:start:69", + "2:end:70", + "2:start:74", + "6:start:78", + "0:start:79", + "0:end:80", + "6:end:85", + "1:start:89", + "1:end:93", + "2:end:96", + "2:end:100", + "1:end:102", + "2:start:105", + "2:end:109", + "0:end:114", + }, + []int{20, 14, 35, 7, 6, 9, 10, 14}, + }, + + { + 3, + []string{ + "0:start:0", + "1:start:2", + "1:end:5", + "0:end:6", + "2:start:8", + "2:start:10", + "2:start:12", + "2:end:14", + "2:end:16", + "2:end:18", + }, + []int{3, 4, 11}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, exclusiveTime(tc.n, tc.logs), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + exclusiveTime(tc.n, tc.logs) + } + } +} diff --git a/Algorithms/0637.average-of-levels-in-binary-tree/README.md b/Algorithms/0637.average-of-levels-in-binary-tree/README.md new file mode 100755 index 000000000..4c0c340f7 --- /dev/null +++ b/Algorithms/0637.average-of-levels-in-binary-tree/README.md @@ -0,0 +1,27 @@ +# [637. Average of Levels in Binary Tree](https://leetcode.com/problems/average-of-levels-in-binary-tree/) + +## 题目 + +Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. + +Example 1: + +```text +Input: + 3 + / \ + 9 20 + / \ + 15 7 +Output: [3, 14.5, 11] +Explanation: +The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11. Hence return [3, 14.5, 11]. +``` + +Note: + +1. The range of node's value is in the range of 32-bit signed integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.go b/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.go new file mode 100755 index 000000000..0fe672f99 --- /dev/null +++ b/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.go @@ -0,0 +1,34 @@ +package problem0637 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func averageOfLevels(root *TreeNode) []float64 { + res := make([]float64, 0, 128) + + nodes := make([]*TreeNode, 1, 1024) + nodes[0] = root + + for len(nodes) > 0 { + n := len(nodes) + + sum := 0 + for i := 0; i < n; i++ { + sum += nodes[i].Val + if nodes[i].Left != nil { + nodes = append(nodes, nodes[i].Left) + } + if nodes[i].Right != nil { + nodes = append(nodes, nodes[i].Right) + } + } + + res = append(res,float64( sum)/float64(n)) + nodes = nodes[n:] + } + + return res +} diff --git a/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree_test.go b/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree_test.go new file mode 100755 index 000000000..450fff193 --- /dev/null +++ b/Algorithms/0637.average-of-levels-in-binary-tree/average-of-levels-in-binary-tree_test.go @@ -0,0 +1,44 @@ +package problem0637 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans []float64 +}{ + + { + []int{3, 9, 20, 15, 7}, + []int{9, 3, 15, 20, 7}, + []float64{3, 14.5, 11}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, averageOfLevels(root), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + averageOfLevels(root) + } + } +} diff --git a/Algorithms/0638.shopping-offers/README.md b/Algorithms/0638.shopping-offers/README.md new file mode 100755 index 000000000..ca27af341 --- /dev/null +++ b/Algorithms/0638.shopping-offers/README.md @@ -0,0 +1,47 @@ +# [638. Shopping Offers](https://leetcode.com/problems/shopping-offers/) + +## 题目 + +In LeetCode Store, there are some kinds of items to sell. Each item has a price. + +However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale price. + +You are given the each item's price, a set of special offers, and the number we need to buy for each item. The job is to output the lowest price you have to pay for exactly certain items as given, where you could make optimal use of the special offers. + +Each special offer is represented in the form of an array, the last number represents the price you need to pay for this special offer, other numbers represents how many specific items you could get if you buy this offer. + +You could use any of special offers as many times as you want. + +Example 1: + +```text +Input: [2,5], [[3,0,5],[1,2,10]], [3,2] +Output: 14 +Explanation: +There are two kinds of items, A and B. Their prices are $2 and $5 respectively. +In special offer 1, you can pay $5 for 3A and 0B +In special offer 2, you can pay $10 for 1A and 2B. +You need to buy 3A and 2B, so you may pay $10 for 1A and 2B (special offer #2), and $4 for 2A. +``` + +Example 2: + +```text +Input: [2,3,4], [[1,1,0,4],[2,2,1,9]], [1,2,1] +Output: 11 +Explanation: +The price of A is $2, and $3 for B, $4 for C. +You may pay $4 for 1A and 1B, and $9 for 2A ,2B and 1C. +You need to buy 1A ,2B and 1C, so you may pay $4 for 1A and 1B (special offer #1), and $3 for 1B, $4 for 1C. +You cannot add more items, though only $9 for 2A ,2B and 1C. +``` + +Note: + +1. There are at most 6 kinds of items, 100 special offers. +1. For each item, you need to buy at most 6 of them. +1. You are not allowed to buy more items than you want, even if that would lower the overall price. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0638.shopping-offers/shopping-offers.go b/Algorithms/0638.shopping-offers/shopping-offers.go new file mode 100755 index 000000000..67bf3fedc --- /dev/null +++ b/Algorithms/0638.shopping-offers/shopping-offers.go @@ -0,0 +1,65 @@ +package problem0638 + +func shoppingOffers(price []int, specials [][]int, needs []int) int { + // 题目规定了 + // 最多买 6 种产品,每种产品最多买 6 个 + var dp [7][7][7][7][7][7]int + for len(needs) < 6 { + needs = append(needs, 0) + } + for len(price) < 6 { + price = append(price, 0) + } + + for i := 0; i <= needs[0]; i++ { + for j := 0; j <= needs[1]; j++ { + for k := 0; k <= needs[2]; k++ { + for l := 0; l <= needs[3]; l++ { + for m := 0; m <= needs[4]; m++ { + for n := 0; n <= needs[5]; n++ { + dp[i][j][k][l][m][n] = price[0]*i + price[1]*j + price[2]*k + price[3]*l + price[4]*m + price[5]*n + } + } + } + } + } + } + + for t := 0; t < len(specials); t++ { + p, s := extend(specials[t]) + + for i := s[0]; i <= needs[0]; i++ { + for j := s[1]; j <= needs[1]; j++ { + for k := s[2]; k <= needs[2]; k++ { + for l := s[3]; l <= needs[3]; l++ { + for m := s[4]; m <= needs[4]; m++ { + for n := s[5]; n <= needs[5]; n++ { + dp[i][j][k][l][m][n] = min(dp[i][j][k][l][m][n], dp[i-s[0]][j-s[1]][k-s[2]][l-s[3]][m-s[4]][n-s[5]]+p) + } + } + } + } + } + } + } + + return dp[needs[0]][needs[1]][needs[2]][needs[3]][needs[4]][needs[5]] +} + +// 获取 special 中的价格,并把 special 中的长度扩充为 6 +func extend(special []int) (int, []int) { + n := len(special) + prices := special[n-1] + special = special[:n-1] + for len(special) < 6 { + special = append(special, 0) + } + return prices, special +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0638.shopping-offers/shopping-offers_test.go b/Algorithms/0638.shopping-offers/shopping-offers_test.go new file mode 100755 index 000000000..3dec2a429 --- /dev/null +++ b/Algorithms/0638.shopping-offers/shopping-offers_test.go @@ -0,0 +1,57 @@ +package problem0638 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + price []int + special [][]int + needs []int + ans int +}{ + + { + []int{2, 5}, + [][]int{{3, 0, 100}, {1, 2, 100}}, + []int{3, 2}, + 16, + }, + + { + []int{2, 5}, + [][]int{{3, 0, 5}, {1, 2, 10}}, + []int{3, 2}, + 14, + }, + + { + []int{2, 3, 4}, + [][]int{{1, 1, 0, 4}, {2, 2, 1, 9}}, + []int{1, 2, 1}, + 11, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shoppingOffers(tc.price, tc.special, tc.needs), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shoppingOffers(tc.price, tc.special, tc.needs) + } + } +} diff --git a/Algorithms/0639.decode-ways-ii/decode-ways-ii.go b/Algorithms/0639.decode-ways-ii/decode-ways-ii.go index 2bc56c8f6..b40940ab1 100755 --- a/Algorithms/0639.decode-ways-ii/decode-ways-ii.go +++ b/Algorithms/0639.decode-ways-ii/decode-ways-ii.go @@ -1,4 +1,4 @@ -package Problem0639 +package problem0639 // MOD 题目要求,返回的结果需要对 MOD 取余 const MOD = 1000000007 diff --git a/Algorithms/0639.decode-ways-ii/decode-ways-ii_test.go b/Algorithms/0639.decode-ways-ii/decode-ways-ii_test.go index d9af4d661..d3cf132f0 100755 --- a/Algorithms/0639.decode-ways-ii/decode-ways-ii_test.go +++ b/Algorithms/0639.decode-ways-ii/decode-ways-ii_test.go @@ -1,4 +1,4 @@ -package Problem0639 +package problem0639 import ( "fmt" diff --git a/Algorithms/0640.solve-the-equation/README.md b/Algorithms/0640.solve-the-equation/README.md new file mode 100755 index 000000000..9df2b5dee --- /dev/null +++ b/Algorithms/0640.solve-the-equation/README.md @@ -0,0 +1,50 @@ +# [640. Solve the Equation](https://leetcode.com/problems/solve-the-equation/) + +## 题目 + +Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and its coefficient. + +If there is no solution for the equation, return "No solution". + +If there are infinite solutions for the equation, return "Infinite solutions". + +If there is exactly one solution for the equation, we ensure that the value of x is an integer. + +Example 1: + +```text +Input: "x+5-3+x=6+x-2" +Output: "x=2" +``` + +Example 2: + +```text +Input: "x=x" +Output: "Infinite solutions" +``` + +Example 3: + +```text +Input: "2x=x" +Output: "x=0" +``` + +Example 4: + +```text +Input: "2x+3x-6x=x+2" +Output: "x=-1" +``` + +Example 5: + +```text +Input: "x=x+2" +Output: "No solution" +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0640.solve-the-equation/solve-the-equation.go b/Algorithms/0640.solve-the-equation/solve-the-equation.go new file mode 100755 index 000000000..e88b08ac3 --- /dev/null +++ b/Algorithms/0640.solve-the-equation/solve-the-equation.go @@ -0,0 +1,51 @@ +package problem0640 + +import ( + "strconv" + "strings" +) + +func solveEquation(equation string) string { + a, b := analyze(equation) + + if a == 0 { + if b == 0 { + return "Infinite solutions" + } + return "No solution" + } + + return "x=" + strconv.Itoa(b/a) +} + +// 把 equation 整理成 a*x=b +func analyze(equation string) (a, b int) { + es := strings.Split(equation, "=") + l, r := es[0], es[1] + // la*x+lb=ra*x+rb + la, lb := sideAnalyze(l) + ra, rb := sideAnalyze(r) + return la - ra, rb - lb +} + +// 把 a1*x+b1+a2*x+b2 整理成 a*x+b +func sideAnalyze(s string) (a, b int) { + s = s[:1] + strings.Replace(s[1:], "-", "+-", -1) + ss := strings.Split(s, "+") + for _, n := range ss { + if n[len(n)-1] == 'x' { + if n == "x" { + a++ + } else if n == "-x" { + a-- + } else { + t, _ := strconv.Atoi(n[:len(n)-1]) + a += t + } + } else { + t, _ := strconv.Atoi(n) + b += t + } + } + return +} diff --git a/Algorithms/0640.solve-the-equation/solve-the-equation_test.go b/Algorithms/0640.solve-the-equation/solve-the-equation_test.go new file mode 100755 index 000000000..5e593dc74 --- /dev/null +++ b/Algorithms/0640.solve-the-equation/solve-the-equation_test.go @@ -0,0 +1,64 @@ +package problem0640 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + equation string + ans string +}{ + + { + "-x=-1", + "x=1", + }, + + { + "x+5-3+x=6+x-2", + "x=2", + }, + + { + "x=x", + "Infinite solutions", + }, + + { + "2x=x", + "x=0", + }, + + { + "2x+3x-6x=x+2", + "x=-1", + }, + + { + "x=x+2", + "No solution", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, solveEquation(tc.equation), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + solveEquation(tc.equation) + } + } +} diff --git a/Algorithms/0641.design-circular-deque/README.md b/Algorithms/0641.design-circular-deque/README.md new file mode 100755 index 000000000..b06e95256 --- /dev/null +++ b/Algorithms/0641.design-circular-deque/README.md @@ -0,0 +1,42 @@ +# [641. Design Circular Deque](https://leetcode.com/problems/design-circular-deque/) + +## 题目 + +Design your implementation of the circular double-ended queue (deque). + +Your implementation should support following operations: + +- MyCircularDeque(k): Constructor, set the size of the deque to be k. +- insertFront(): Adds an item at the front of Deque. Return true if the operation is successful. +- insertLast(): Adds an item at the rear of Deque. Return true if the operation is successful. +- deleteFront(): Deletes an item from the front of Deque. Return true if the operation is successful. +- deleteLast(): Deletes an item from the rear of Deque. Return true if the operation is successful. +- getFront(): Gets the front item from the Deque. If the deque is empty, return -1. +- getRear(): Gets the last item from Deque. If the deque is empty, return -1. +- isEmpty(): Checks whether Deque is empty or not. +- isFull(): Checks whether Deque is full or not. + +Example: + +```text +MyCircularDeque circularDeque = new MycircularDeque(3); // set the size to be 3 +circularDeque.insertLast(1); // return true +circularDeque.insertLast(2); // return true +circularDeque.insertFront(3); // return true +circularDeque.insertFront(4); // return false, the queue is full +circularDeque.getRear(); // return 32 +circularDeque.isFull(); // return true +circularDeque.deleteLast(); // return true +circularDeque.insertFront(4); // return true +circularDeque.getFront(); // return 4 +``` + +Note: + +1. All values will be in the range of [0, 1000]. +1. The number of operations will be in the range of[1, 1000]. +1. Please do not use the built-in Deque library. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0641.design-circular-deque/design-circular-deque.go b/Algorithms/0641.design-circular-deque/design-circular-deque.go new file mode 100755 index 000000000..d0ab25572 --- /dev/null +++ b/Algorithms/0641.design-circular-deque/design-circular-deque.go @@ -0,0 +1,127 @@ +package problem0641 + +// MyCircularDeque 结构体 +type MyCircularDeque struct { + f, r *node + len, cap int +} +type node struct { + value int + pre, next *node +} + +// Constructor initialize your data structure here. Set the size of the deque to be k. +func Constructor(k int) MyCircularDeque { + return MyCircularDeque{ + cap: k, + } +} + +// InsertFront adds an item at the front of Deque. Return true if the operation is successful. +func (d *MyCircularDeque) InsertFront(value int) bool { + if d.len == d.cap { + return false + } + n := &node{ + value: value, + } + if d.len == 0 { + d.f = n + d.r = n + } else { + n.next = d.f + d.f.pre = n + d.f = n + } + d.len++ + return true +} + +// InsertLast adds an item at the rear of Deque. Return true if the operation is successful. +func (d *MyCircularDeque) InsertLast(value int) bool { + if d.len == d.cap { + return false + } + n := &node{ + value: value, + } + if d.len == 0 { + d.f = n + d.r = n + } else { + n.pre = d.r + d.r.next = n + d.r = n + } + d.len++ + return true +} + +// DeleteFront deletes an item from the front of Deque. Return true if the operation is successful. +func (d *MyCircularDeque) DeleteFront() bool { + if d.len == 0 { + return false + } + if d.len == 1 { + d.f, d.r = nil, nil + } else { + d.f = d.f.next + d.f.pre = nil + } + d.len-- + return true +} + +// DeleteLast deletes an item from the rear of Deque. Return true if the operation is successful. +func (d *MyCircularDeque) DeleteLast() bool { + if d.len == 0 { + return false + } + if d.len == 1 { + d.f, d.r = nil, nil + } else { + d.r = d.r.pre + d.r.next = nil + } + d.len-- + return true +} + +// GetFront get the front item from the deque. +func (d *MyCircularDeque) GetFront() int { + if d.len == 0 { + return -1 + } + return d.f.value +} + +// GetRear get the last item from the deque. +func (d *MyCircularDeque) GetRear() int { + if d.len == 0 { + return -1 + } + return d.r.value +} + +// IsEmpty checks whether the circular deque is empty or not. +func (d *MyCircularDeque) IsEmpty() bool { + return d.len == 0 +} + +// IsFull checks whether the circular deque is full or not. +func (d *MyCircularDeque) IsFull() bool { + return d.len == d.cap +} + +/** + * Your MyCircularDeque object will be instantiated and called as such: + * obj := Constructor(k); + * param_1 := obj.InsertFront(value); + * param_2 := obj.InsertLast(value); + * param_3 := obj.DeleteFront(); + * param_4 := obj.DeleteLast(); + * param_5 := obj.GetFront(); + * param_6 := obj.GetRear(); + * param_7 := obj.IsEmpty(); + * param_8 := obj.IsFull(); + */ diff --git a/Algorithms/0641.design-circular-deque/design-circular-deque_test.go b/Algorithms/0641.design-circular-deque/design-circular-deque_test.go new file mode 100755 index 000000000..71fff4af5 --- /dev/null +++ b/Algorithms/0641.design-circular-deque/design-circular-deque_test.go @@ -0,0 +1,57 @@ +package problem0641 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + d := Constructor(3) + + ast.False(d.IsFull(), "检查空数组") + ast.True(d.IsEmpty(), "检查空数组") + + ast.False(d.DeleteFront(), "从空数组中删除首部元素") + ast.False(d.DeleteLast(), "从空数组中删除尾部元素") + + ast.Equal(-1, d.GetFront(), "从空数组中获取首部元素") + ast.Equal(-1, d.GetRear(), "从空数组中获取尾部元素") + + for i := 0; i < 100; i++ { + ast.True(d.InsertFront(i), "在首部插入 %d", i) + ast.True(d.InsertFront(i), "在首部插入 %d", i) + ast.True(d.InsertFront(i), "在首部插入 %d", i) + ast.True(d.DeleteLast(), "删除尾部元素 %d", i) + ast.True(d.DeleteLast(), "删除尾部元素 %d", i) + ast.True(d.DeleteLast(), "删除尾部元素 %d", i) + } + + for i := 0; i < 100; i++ { + ast.True(d.InsertLast(i), "在尾部插入 %d", i) + ast.True(d.InsertLast(i), "在尾部插入 %d", i) + ast.True(d.InsertLast(i), "在尾部插入 %d", i) + ast.True(d.DeleteFront(), "删除首部元素 %d", i) + ast.True(d.DeleteFront(), "删除首部元素 %d", i) + ast.True(d.DeleteFront(), "删除首部元素 %d", i) + } + + ast.True(d.InsertLast(1), "往尾部插入 1") + ast.True(d.InsertLast(2), "往尾部插入 2") + ast.True(d.InsertFront(3), "往首部插入 3") + ast.False(d.InsertFront(4), "往首部插入 4") + ast.False(d.InsertLast(4), "往尾部插入 4") + + ast.Equal(2, d.GetRear(), "获取尾部元素") + ast.Equal(3, d.GetFront(), "获取首部元素") + + ast.True(d.IsFull(), "检查满数组") + ast.False(d.IsEmpty(), "检查满数组") + + ast.True(d.DeleteLast(), "删除尾部元素") + ast.True(d.InsertFront(4), "在首部添加 4") + + ast.Equal(4, d.GetFront(), "检查首部元素") +} diff --git a/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i.go b/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i.go index 2642f67bf..ea22a293f 100755 --- a/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i.go +++ b/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i.go @@ -1,4 +1,4 @@ -package Problem0643 +package problem0643 func findMaxAverage(nums []int, k int) float64 { temp := 0 diff --git a/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i_test.go b/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i_test.go index 46e88f15a..a98e18c92 100755 --- a/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i_test.go +++ b/Algorithms/0643.maximum-average-subarray-i/maximum-average-subarray-i_test.go @@ -1,4 +1,4 @@ -package Problem0643 +package problem0643 import ( "fmt" diff --git a/Algorithms/0645.set-mismatch/README.md b/Algorithms/0645.set-mismatch/README.md new file mode 100755 index 000000000..a88b6ccb6 --- /dev/null +++ b/Algorithms/0645.set-mismatch/README.md @@ -0,0 +1,23 @@ +# [645. Set Mismatch](https://leetcode.com/problems/set-mismatch/) + +## 题目 + +The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another number in the set, which results in repetition of one number and loss of another number. + +Given an array nums representing the data status of this set after the error. Your task is to firstly find the number occurs twice and then find the number that is missing. Return them in the form of an array. + +Example 1: + +```text +Input: nums = [1,2,2,4] +Output: [2,3] +``` + +Note: + +1. The given array size will in the range [2, 10000]. +1. The given array's numbers won't have any order. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0645.set-mismatch/set-mismatch.go b/Algorithms/0645.set-mismatch/set-mismatch.go new file mode 100755 index 000000000..f90786565 --- /dev/null +++ b/Algorithms/0645.set-mismatch/set-mismatch.go @@ -0,0 +1,39 @@ +package problem0645 + +func findErrorNums(nums []int) []int { + // n == len(nums) + // 而 nums 的数字属于 [1,n],那么 + // 对于每一个 nums[abs(nums[i])-1] 中的数取反 + // 操作过程中, + // 取反前,nums[abs(nums[i])-1] 已经是负数的话,说明 abs(nums[i]) 是重复的数 + // 操作结束后, + // nums[i] > 0,说明 nums[i] 没有被取反过, i+1 是丢失的数 + dup := 0 + for i := 0; i < len(nums); i++ { + n := abs(nums[i]) + + if nums[n-1] < 0 { + dup = n + // NOTICE: nums[n-1]<0 的时候,不能再取反为正数了 + } else { + nums[n-1] = -nums[n-1] + } + } + + mis := 0 + for i, v := range nums { + if v > 0 { + mis = i + 1 + break + } + } + + return []int{dup, mis} +} + +func abs(a int) int { + if a > 0 { + return a + } + return -a +} diff --git a/Algorithms/0645.set-mismatch/set-mismatch_test.go b/Algorithms/0645.set-mismatch/set-mismatch_test.go new file mode 100755 index 000000000..3a452dd45 --- /dev/null +++ b/Algorithms/0645.set-mismatch/set-mismatch_test.go @@ -0,0 +1,54 @@ +package problem0645 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{1, 1}, + []int{1, 2}, + }, + + { + []int{1, 3, 4, 5, 5, 6}, + []int{5, 2}, + }, + + { + []int{1, 1, 2, 3, 4, 6}, + []int{1, 5}, + }, + + { + []int{1, 2, 2, 4}, + []int{2, 3}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findErrorNums(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findErrorNums(tc.nums) + } + } +} diff --git a/Algorithms/0646.maximum-length-of-pair-chain/README.md b/Algorithms/0646.maximum-length-of-pair-chain/README.md new file mode 100755 index 000000000..b61571888 --- /dev/null +++ b/Algorithms/0646.maximum-length-of-pair-chain/README.md @@ -0,0 +1,24 @@ +# [646. Maximum Length of Pair Chain](https://leetcode.com/problems/maximum-length-of-pair-chain/) + +## 题目 + +You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. + +Now, we define a pair (c, d) can follow another pair (a, b) if and only if b < c. Chain of pairs can be formed in this fashion. + +Given a set of pairs, find the length longest chain which can be formed. You needn't use up all the given pairs. You can select pairs in any order. + +Example 1: + +```text +Input: [[1,2], [2,3], [3,4]] +Output: 2 +Explanation: The longest chain is [1,2] -> [3,4] +``` + +Note: +The number of given pairs will be in the range [1, 1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain.go b/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain.go new file mode 100755 index 000000000..4b5683405 --- /dev/null +++ b/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain.go @@ -0,0 +1,26 @@ +package problem0646 + +import ( + "sort" +) + +func findLongestChain(ps [][]int) int { + sort.Slice(ps, func(i, j int) bool { + if ps[i][1] == ps[j][1] { + return ps[i][0] > ps[j][0] + } + return ps[i][1] < ps[j][1] + }) + + res := 0 + b := -1 << 32 + for i := 0; i < len(ps); i++ { + c := ps[i][0] + if b < c { + res++ + b = ps[i][1] + } + } + + return res +} diff --git a/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain_test.go b/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain_test.go new file mode 100755 index 000000000..89401637b --- /dev/null +++ b/Algorithms/0646.maximum-length-of-pair-chain/maximum-length-of-pair-chain_test.go @@ -0,0 +1,44 @@ +package problem0646 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pairs [][]int + ans int +}{ + + { + [][]int{{-10, -8}, {8, 9}, {-5, 0}, {6, 10}, {-6, -4}, {1, 7}, {9, 10}, {-4, 7}}, + 4, + }, + + { + [][]int{{1, 2}, {2, 3}, {3, 4}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_fcName(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLongestChain(tc.pairs), "输入:%v", tc) + } +} + +func Benchmark_fcName(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLongestChain(tc.pairs) + } + } +} diff --git a/Algorithms/0647.palindromic-substrings/README.md b/Algorithms/0647.palindromic-substrings/README.md new file mode 100755 index 000000000..d582e35c2 --- /dev/null +++ b/Algorithms/0647.palindromic-substrings/README.md @@ -0,0 +1,30 @@ +# [647. Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings/) + +## 题目 + +Given a string, your task is to count how many palindromic substrings in this string. + +The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters. + +Example 1: + +```text +Input: "abc" +Output: 3 +Explanation: Three palindromic strings: "a", "b", "c". +``` + +Example 2: + +```text +Input: "aaa" +Output: 6 +Explanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa". +``` + +Note: +The input string length won't exceed 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0647.palindromic-substrings/palindromic-substrings.go b/Algorithms/0647.palindromic-substrings/palindromic-substrings.go new file mode 100755 index 000000000..0d5aec783 --- /dev/null +++ b/Algorithms/0647.palindromic-substrings/palindromic-substrings.go @@ -0,0 +1,24 @@ +package problem0647 + +func countSubstrings(s string) int { + count := 0 + // 换一个思路 + for i := 0; i < len(s); i++ { + // 统计所有以 i 为中心的回文 + count += extendPalindrome(s, i, i) + // 统计所有以 i 和 i+1 为中心的回文 + count += extendPalindrome(s, i, i+1) + } + return count +} + +// 同时向两边扩张,直到遇到不是回文的情况 +func extendPalindrome(s string, left, right int) int { + res := 0 + for left >= 0 && right < len(s) && s[left] == s[right] { + res++ + left-- + right++ + } + return res +} diff --git a/Algorithms/0647.palindromic-substrings/palindromic-substrings_test.go b/Algorithms/0647.palindromic-substrings/palindromic-substrings_test.go new file mode 100755 index 000000000..a17070223 --- /dev/null +++ b/Algorithms/0647.palindromic-substrings/palindromic-substrings_test.go @@ -0,0 +1,44 @@ +package problem0647 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "abc", + 3, + }, + + { + "aaa", + 6, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countSubstrings(tc.s), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countSubstrings(tc.s) + } + } +} diff --git a/Algorithms/0648.replace-words/README.md b/Algorithms/0648.replace-words/README.md new file mode 100755 index 000000000..abcade042 --- /dev/null +++ b/Algorithms/0648.replace-words/README.md @@ -0,0 +1,29 @@ +# [648. Replace Words](https://leetcode.com/problems/replace-words/) + +## 题目 + +In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successor. For example, the root an, followed by other, which can form another word another. + +Now, given a dictionary consisting of many roots and a sentence. You need to replace all the successor in the sentence with the root forming it. If a successor has many roots can form it, replace it with the root with the shortest length. + +You need to output the sentence after the replacement. + +Example 1: + +```text +Input: dict = ["cat", "bat", "rat"] +sentence = "the cattle was rattled by the battery" +Output: "the cat was rat by the bat" +``` + +Note: + +- The input will only have lower-case letters. +- 1 <= dict words number <= 1000 +- 1 <= sentence words number <= 1000 +- 1 <= root length <= 100 +- 1 <= sentence words length <= 1000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0648.replace-words/replace-words.go b/Algorithms/0648.replace-words/replace-words.go new file mode 100755 index 000000000..18e6a10d7 --- /dev/null +++ b/Algorithms/0648.replace-words/replace-words.go @@ -0,0 +1,38 @@ +package problem0648 + +import ( + "sort" + "strings" +) + +func replaceWords(dict []string, sentence string) string { + // hasRoot 收集了所有的 root + hasRoot := make(map[string]bool, len(dict)) + hasLen := make([]bool, 101) + for i := range dict { + hasRoot[dict[i]] = true + hasLen[len(dict[i])] = true + } + + // ls 收集了所有 root 的长度 + ls := make([]int, 0, 101) + for i, ok := range hasLen { + if ok { + ls = append(ls, i) + } + } + sort.Ints(ls) + + words := strings.Split(sentence, " ") + for i, w := range words { + for _, l := range ls { + // w 的前 l 个字符是字根就修改 w 并结束 for 循环 + if l < len(w) && hasRoot[w[:l]] { + words[i] = w[:l] + break + } + } + } + + return strings.Join(words, " ") +} diff --git a/Algorithms/0648.replace-words/replace-words_test.go b/Algorithms/0648.replace-words/replace-words_test.go new file mode 100755 index 000000000..8020e16e7 --- /dev/null +++ b/Algorithms/0648.replace-words/replace-words_test.go @@ -0,0 +1,41 @@ +package problem0648 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + dict []string + sentence string + ans string +}{ + + { + []string{"cat", "bat", "rat"}, + "the cattle was rattled by the battery", + "the cat was rat by the bat", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, replaceWords(tc.dict, tc.sentence), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + replaceWords(tc.dict, tc.sentence) + } + } +} diff --git a/Algorithms/0649.dota2-senate/README.md b/Algorithms/0649.dota2-senate/README.md new file mode 100755 index 000000000..3c67a9457 --- /dev/null +++ b/Algorithms/0649.dota2-senate/README.md @@ -0,0 +1,46 @@ +# [649. Dota2 Senate](https://leetcode.com/problems/dota2-senate/) + +## 题目 + +In the world of Dota2, there are two parties: the Radiant and the Dire. + +The Dota2 senate consists of senators coming from two parties. Now the senate wants to make a decision about a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise one of the two rights: + +1. Ban one senator's right: A senator can make another senator lose all his rights in this and all the following rounds. +1. Announce the victory: If this senator found the senators who still have rights to vote are all from the same party, he can announce the victory and make the decision about the change in the game. + +Given a string representing each senator's party belonging. The character 'R' and 'D' represent the Radiant party and the Dire party respectively. Then if there are n senators, the size of the given string will be n. + +The round-based procedure starts from the first senator to the last senator in the given order. This procedure will last until the end of voting. All the senators who have lost their rights will be skipped during the procedure. + +Suppose every senator is smart enough and will play the best strategy for his own party, you need to predict which party will finally announce the victory and make the change in the Dota2 game. The output should be Radiant or Dire. + +Example 1: + +```text +Input: "RD" +Output: "Radiant" +Explanation: The first senator comes from Radiant and he can just ban the next senator's right in the round 1. +And the second senator can't exercise any rights any more since his right has been banned. +And in the round 2, the first senator can just announce the victory since he is the only guy in the senate who can vote. +``` + +Example 2: + +```text +Input: "RDD" +Output: "Dire" +Explanation: +The first senator comes from Radiant and he can just ban the next senator's right in the round 1. +And the second senator can't exercise any rights anymore since his right has been banned. +And the third senator comes from Dire and he can ban the first senator's right in the round 1. +And in the round 2, the third senator can just announce the victory since he is the only guy in the senate who can vote. +``` + +Note: + +1. The length of the given string will in the range [1, 10,000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0649.dota2-senate/dota2-senate.go b/Algorithms/0649.dota2-senate/dota2-senate.go new file mode 100755 index 000000000..f6447950c --- /dev/null +++ b/Algorithms/0649.dota2-senate/dota2-senate.go @@ -0,0 +1,36 @@ +package problem0649 + +func predictPartyVictory(senate string) string { + n := len(senate) + + // qr 和 qd 按顺序保存了 r 和 d 的议员的索引号 + qr := make([]int, 0, n) + qd := make([]int, 0, n) + for i, b := range senate { + if b == 'R' { + qr = append(qr, i) + } else { + qd = append(qd, i) + } + } + + // 对议员来说,最优策略就是,把下一个对方党派的议员 ban 掉 + for len(qr) > 0 && len(qd) > 0 { + ri := qr[0] + qr = qr[1:] + di := qd[0] + qd = qd[1:] + if ri < di { + // ri ban 掉了 di + // ri 的索引号 +n + qr = append(qr, ri+n) + } else { + qd = append(qd, di+n) + } + } + + if len(qr) > 0 { + return "Radiant" + } + return "Dire" +} diff --git a/Algorithms/0649.dota2-senate/dota2-senate_test.go b/Algorithms/0649.dota2-senate/dota2-senate_test.go new file mode 100755 index 000000000..ac0986a89 --- /dev/null +++ b/Algorithms/0649.dota2-senate/dota2-senate_test.go @@ -0,0 +1,54 @@ +package problem0649 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + senate string + ans string +}{ + + { + "RRDDD", + "Radiant", + }, + + { + "DDRRR", + "Dire", + }, + + { + "RD", + "Radiant", + }, + + { + "RDD", + "Dire", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, predictPartyVictory(tc.senate), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + predictPartyVictory(tc.senate) + } + } +} diff --git a/Algorithms/0650.2-keys-keyboard/2-keys-keyboard.go b/Algorithms/0650.2-keys-keyboard/2-keys-keyboard.go new file mode 100755 index 000000000..cd55f0775 --- /dev/null +++ b/Algorithms/0650.2-keys-keyboard/2-keys-keyboard.go @@ -0,0 +1,15 @@ +package problem0650 + +func minSteps(n int) int { + if n == 1 { + return 0 + } + + for i := 2; i < n; i++ { + if n%i == 0 { + return i + minSteps(n/i) + } + } + + return n +} diff --git a/Algorithms/0650.2-keys-keyboard/2-keys-keyboard_test.go b/Algorithms/0650.2-keys-keyboard/2-keys-keyboard_test.go new file mode 100755 index 000000000..3ef147e84 --- /dev/null +++ b/Algorithms/0650.2-keys-keyboard/2-keys-keyboard_test.go @@ -0,0 +1,49 @@ +package problem0650 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 100, + 14, + }, + + { + 1, + 0, + }, + + { + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minSteps(tc.n), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minSteps(tc.n) + } + } +} diff --git a/Algorithms/0650.2-keys-keyboard/README.md b/Algorithms/0650.2-keys-keyboard/README.md new file mode 100755 index 000000000..b1790aaaf --- /dev/null +++ b/Algorithms/0650.2-keys-keyboard/README.md @@ -0,0 +1,31 @@ +# [650. 2 Keys Keyboard](https://leetcode.com/problems/2-keys-keyboard/) + +## 题目 + +Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: + +Copy All: You can copy all the characters present on the notepad (partial copy is not allowed). + +Paste: You can paste the characters which are copied last time. + +Given a number n. You have to get exactly n 'A' on the notepad by performing the minimum number of steps permitted. Output the minimum number of steps to get n 'A'. + +Example 1: + +```text +Input: 3 +Output: 3 +Explanation: +Intitally, we have one character 'A'. +In step 1, we use Copy All operation. +In step 2, we use Paste operation to get 'AA'. +In step 3, we use Paste operation to get 'AAA'. +``` + +Note: +The n will be in the range [1, 1000]. + + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0652.find-duplicate-subtrees/README.md b/Algorithms/0652.find-duplicate-subtrees/README.md new file mode 100755 index 000000000..a1539e2b7 --- /dev/null +++ b/Algorithms/0652.find-duplicate-subtrees/README.md @@ -0,0 +1,30 @@ +# [652. Find Duplicate Subtrees](https://leetcode.com/problems/find-duplicate-subtrees/) + +## 题目 + +Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one of them. + +Two trees are duplicate if they have the same structure with same node values. + +Example 1: + +```text + 1 + / \ + 2 3 + / / \ + 4 2 4 + / + 4 +The following are two duplicate subtrees: + 2 + / + 4 +and + 4 +Therefore, you need to return above trees' root in the form of a list. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees.go b/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees.go new file mode 100755 index 000000000..716bcd1bd --- /dev/null +++ b/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees.go @@ -0,0 +1,35 @@ +package problem0652 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "strconv" +) + +type TreeNode = kit.TreeNode + +func findDuplicateSubtrees(root *TreeNode) []*TreeNode { + count := make(map[string]int, 1024) + res := make([]*TreeNode, 0, 1024) + + helper(root, count, &res) + + return res +} + +func helper(root *TreeNode, count map[string]int, res *[]*TreeNode) string { + if root == nil { + return "*" + } + + l := helper(root.Left, count, res) + r := helper(root.Right, count, res) + + key := strconv.Itoa(root.Val) + l + r + + count[key]++ + if count[key] == 2 { + *res = append(*res, root) + } + + return key +} diff --git a/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees_test.go b/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees_test.go new file mode 100755 index 000000000..c7faa244e --- /dev/null +++ b/Algorithms/0652.find-duplicate-subtrees/find-duplicate-subtrees_test.go @@ -0,0 +1,75 @@ +package problem0652 + +import ( + "fmt" + "sort" + "strconv" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ansPost [][]int +}{ + + { + []int{1, 2, 4, 3, 2, 4, 4}, + []int{4, 2, 1, 4, 2, 3, 4}, + [][]int{{4, 2}, {4}}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ans := findDuplicateSubtrees(root) + ansPost := convert(ans) + ast.Equal(normalize(tc.ansPost), normalize(ansPost)) + } +} + +func convert(roots []*TreeNode) [][]int { + res := make([][]int, len(roots)) + for i := range res { + res[i] = kit.Tree2Postorder(roots[i]) + } + return res +} + +func normalize(intss [][]int) string { + ss := make([]string, len(intss)) + for _, ints := range intss { + s := "" + for _, n := range ints { + s += strconv.Itoa(n) + } + ss = append(ss, s) + } + sort.Strings(ss) + + res := "" + for _, s := range ss { + res += s + "+" + } + + return res +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findDuplicateSubtrees(root) + } + } +} diff --git a/Algorithms/0653.two-sum-iv-input-is-a-bst/README.md b/Algorithms/0653.two-sum-iv-input-is-a-bst/README.md new file mode 100755 index 000000000..3d62304d9 --- /dev/null +++ b/Algorithms/0653.two-sum-iv-input-is-a-bst/README.md @@ -0,0 +1,39 @@ +# [653. Two Sum IV - Input is a BST](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/) + +## 题目 + +Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. + +Example 1: + +```text +Input: + 5 + / \ + 3 6 + / \ \ +2 4 7 + +Target = 9 + +Output: True +``` + +Example 2: + +```text +Input: + 5 + / \ + 3 6 + / \ \ +2 4 7 + +Target = 28 + +Output: False +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst.go b/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst.go new file mode 100755 index 000000000..3c9e95293 --- /dev/null +++ b/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst.go @@ -0,0 +1,36 @@ +package problem0653 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func findTarget(root *TreeNode, k int) bool { + return helper(root, root, k) +} + +func helper(root, searchRoot *TreeNode, k int) bool { + if root == nil { + return false + } + + return (root.Val*2 != k && findNode(searchRoot, k-root.Val)) || + helper(root.Left, searchRoot, k) || + helper(root.Right, searchRoot, k) +} + +func findNode(root *TreeNode, target int) bool { + if root == nil { + return false + } + + if root.Val == target { + return true + } + + if root.Val < target { + return findNode(root.Right, target) + } + return findNode(root.Left, target) +} diff --git a/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst_test.go b/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst_test.go new file mode 100755 index 000000000..b13bacb5b --- /dev/null +++ b/Algorithms/0653.two-sum-iv-input-is-a-bst/two-sum-iv-input-is-a-bst_test.go @@ -0,0 +1,67 @@ +package problem0653 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + k int + ans bool +}{ + + { + []int{2, 1, 3}, + []int{1, 2, 3}, + 4, + true, + }, + + { + []int{1}, + []int{1}, + 2, + false, + }, + + { + []int{5, 3, 2, 4, 6, 7}, + []int{2, 3, 4, 5, 6, 7}, + 28, + false, + }, + + { + []int{5, 3, 2, 4, 6, 7}, + []int{2, 3, 4, 5, 6, 7}, + 9, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, findTarget(root, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + findTarget(root, tc.k) + } + } +} diff --git a/Algorithms/0654.maximum-binary-tree/README.md b/Algorithms/0654.maximum-binary-tree/README.md new file mode 100755 index 000000000..950cdd2f6 --- /dev/null +++ b/Algorithms/0654.maximum-binary-tree/README.md @@ -0,0 +1,34 @@ +# [654. Maximum Binary Tree](https://leetcode.com/problems/maximum-binary-tree/) + +## 题目 + +Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: + +1. The root is the maximum number in the array. +1. The left subtree is the maximum tree constructed from left part subarray divided by the maximum number. +1. The right subtree is the maximum tree constructed from right part subarray divided by the maximum number. + +Construct the maximum tree by the given array and output the root node of this tree. + +Example 1: + +```text +Input: [3,2,1,6,0,5] +Output: return the tree root node representing the following tree: + + 6 + / \ + 3 5 + \ / + 2 0 + \ + 1 +``` + +Note: + +1. The size of the given array will be in the range [1,1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0654.maximum-binary-tree/maximum-binary-tree.go b/Algorithms/0654.maximum-binary-tree/maximum-binary-tree.go new file mode 100755 index 000000000..fcea2c299 --- /dev/null +++ b/Algorithms/0654.maximum-binary-tree/maximum-binary-tree.go @@ -0,0 +1,46 @@ +package problem0654 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func constructMaximumBinaryTree(nums []int) *TreeNode { + // stack[i+1:] 中所有的节点都是 stack[i] 右边的节点 + // 即,stack 中的 Val 值应该始终是递减的 + // 在遍历 nums 后,stack[i].Right == stack[i+1] + stack := make([]*TreeNode, 1, len(nums)) + // 先放这个节点到 stack 可以简化后面的逻辑结构 + // nums 生成的 Tree 肯定是这个节点的右节点 + stack[0] = &TreeNode{Val: 1<<63 - 1} + + for _, n := range nums { + node := &TreeNode{Val: n} + + if stack[len(stack)-1].Val > n { + stack = append(stack, node) + continue + } + + for len(stack)-2 >= 0 && stack[len(stack)-2].Val < n { + // 此时可以确定,stack中,上一项是下一项的 Right 节点 + stack[len(stack)-2].Right = stack[len(stack)-1] + stack = stack[:len(stack)-1] + } + + // 此时,stack 中最后一项是 node 的 Left 节点 + node.Left = stack[len(stack)-1] + + // 把 node 放入 stack + stack[len(stack)-1] = node + + } + + // 连接父子关系 + for i := len(stack) - 1; 1 <= i; i-- { + stack[i-1].Right = stack[i] + } + + return stack[1] +} diff --git a/Algorithms/0654.maximum-binary-tree/maximum-binary-tree_test.go b/Algorithms/0654.maximum-binary-tree/maximum-binary-tree_test.go new file mode 100755 index 000000000..4d8c5a7bb --- /dev/null +++ b/Algorithms/0654.maximum-binary-tree/maximum-binary-tree_test.go @@ -0,0 +1,41 @@ +package problem0654 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + post []int +}{ + + { + []int{3, 2, 1, 6, 0, 5}, + []int{1, 2, 3, 0, 5, 6}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.post, kit.Tree2Postorder(constructMaximumBinaryTree(tc.nums)), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + constructMaximumBinaryTree(tc.nums) + } + } +} diff --git a/Algorithms/0655.print-binary-tree/655.100.png b/Algorithms/0655.print-binary-tree/655.100.png new file mode 100644 index 000000000..f9c420cfc Binary files /dev/null and b/Algorithms/0655.print-binary-tree/655.100.png differ diff --git a/Algorithms/0655.print-binary-tree/README.md b/Algorithms/0655.print-binary-tree/README.md new file mode 100755 index 000000000..ea66f17c4 --- /dev/null +++ b/Algorithms/0655.print-binary-tree/README.md @@ -0,0 +1,65 @@ +# [655. Print Binary Tree](https://leetcode.com/problems/print-binary-tree/) + +## 题目 + +Print a binary tree in an m*n 2D string array following these rules: + +1. The row number m should be equal to the height of the given binary tree. +1. The column number n should always be an odd number. +1. The root node's value (in string format) should be put in the exactly middle of the first row it can be put. The column and the row where the root node belongs will separate the rest space into two parts (left-bottom part and right-bottom part). You should print the left subtree in the left-bottom part and print the right subtree in the right-bottom part. The left-bottom part and the right-bottom part should have the same size. Even if one subtree is none while the other is not, you don't need to print anything for the none subtree but still need to leave the space as large as that for the other subtree. However, if two subtrees are none, then you don't need to leave space for both of them. +1. Each unused space should contain an empty string "". +1. Print the subtrees following the same rules. + +Example 1: + +```text +Input: + 1 + / + 2 +Output: +[["", "1", ""], + ["2", "", ""]] +``` + +Example 2: + +```text +Input: + 1 + / \ + 2 3 + \ + 4 +Output: +[["", "", "", "1", "", "", ""], + ["", "2", "", "", "", "3", ""], + ["", "", "4", "", "", "", ""]] +``` + +Example 3: + +```text +Input: + 1 + / \ + 2 5 + / + 3 + / +4 +Output: + +[["", "", "", "", "", "", "", "1", "", "", "", "", "", "", ""] + ["", "", "", "2", "", "", "", "", "", "", "", "5", "", "", ""] + ["", "3", "", "", "", "", "", "", "", "", "", "", "", "", ""] + ["4", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]] +``` + +Note: The height of binary tree is in the range of [1, 10]. + +## 解题思路 + +见程序注释 + +![100](655.100.png) \ No newline at end of file diff --git a/Algorithms/0655.print-binary-tree/print-binary-tree.go b/Algorithms/0655.print-binary-tree/print-binary-tree.go new file mode 100755 index 000000000..32b739816 --- /dev/null +++ b/Algorithms/0655.print-binary-tree/print-binary-tree.go @@ -0,0 +1,77 @@ +package problem0655 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" + "strconv" +) + +type TreeNode = kit.TreeNode + +func printTree(root *TreeNode) [][]string { + level := getLevel(root) + size := 1< 0 { + // 可以把 n 放入别的子序列末尾的时候,就放在末尾 + next[n]-- + next[n+1]++ + } else if count[n+1] > 0 && count[n+2] > 0 { + // 不能放在放在末尾的时候,就创建新的子序列 + count[n+1]-- + count[n+2]-- + next[n+3]++ + } else { + // 都不行的时候,就表示不可能满足题目要求,返回 false + return false + } + + } + + return true +} diff --git a/Algorithms/0659.split-array-into-consecutive-subsequences/split-array-into-consecutive-subsequences_test.go b/Algorithms/0659.split-array-into-consecutive-subsequences/split-array-into-consecutive-subsequences_test.go new file mode 100755 index 000000000..1a0492191 --- /dev/null +++ b/Algorithms/0659.split-array-into-consecutive-subsequences/split-array-into-consecutive-subsequences_test.go @@ -0,0 +1,54 @@ +package problem0659 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{1, 2, 3, 3, 4, 5}, + true, + }, + + { + []int{1, 2, 2, 3, 3, 3, 4, 4, 5}, + true, + }, + + { + []int{1, 2, 3, 3, 4, 4, 5, 5}, + true, + }, + + { + []int{1, 2, 3, 4, 4, 5}, + false, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isPossible(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isPossible(tc.nums) + } + } +} diff --git a/Algorithms/0660.remove-9/remove-9.go b/Algorithms/0660.remove-9/remove-9.go index 20a9c57b0..d9c9a8f03 100755 --- a/Algorithms/0660.remove-9/remove-9.go +++ b/Algorithms/0660.remove-9/remove-9.go @@ -1,4 +1,4 @@ -package Problem0660 +package problem0660 func newInteger(n int) int { res, base := 0, 1 diff --git a/Algorithms/0660.remove-9/remove-9_test.go b/Algorithms/0660.remove-9/remove-9_test.go index cb79733be..65302a17a 100755 --- a/Algorithms/0660.remove-9/remove-9_test.go +++ b/Algorithms/0660.remove-9/remove-9_test.go @@ -1,4 +1,4 @@ -package Problem0660 +package problem0660 import ( "fmt" diff --git a/Algorithms/0661.image-smoother/image-smoother.go b/Algorithms/0661.image-smoother/image-smoother.go index 27ae268d2..610b6af4e 100755 --- a/Algorithms/0661.image-smoother/image-smoother.go +++ b/Algorithms/0661.image-smoother/image-smoother.go @@ -1,4 +1,4 @@ -package Problem0661 +package problem0661 func imageSmoother(M [][]int) [][]int { res := make([][]int, len(M)) diff --git a/Algorithms/0661.image-smoother/image-smoother_test.go b/Algorithms/0661.image-smoother/image-smoother_test.go index da7189321..601cf2018 100755 --- a/Algorithms/0661.image-smoother/image-smoother_test.go +++ b/Algorithms/0661.image-smoother/image-smoother_test.go @@ -1,4 +1,4 @@ -package Problem0661 +package problem0661 import ( "fmt" diff --git a/Algorithms/0662.maximum-width-of-binary-tree/README.md b/Algorithms/0662.maximum-width-of-binary-tree/README.md new file mode 100755 index 000000000..df9dd2ebe --- /dev/null +++ b/Algorithms/0662.maximum-width-of-binary-tree/README.md @@ -0,0 +1,74 @@ +# [662. Maximum Width of Binary Tree](https://leetcode.com/problems/maximum-width-of-binary-tree/) + +## 题目 + +Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binary tree has the same structure as a full binary tree, but some nodes are null. + +The width of one level is defined as the length between the end-nodes (the leftmost and right most non-null nodes in the level, where the null nodes between the end-nodes are also counted into the length calculation. + +Example 1: + +```text +Input: + + 1 + / \ + 3 2 + / \ \ + 5 3 9 + +Output: 4 +Explanation: The maximum width existing in the third level with the length 4 (5,3,null,9). +``` + +Example 2: + +```text +Input: + + 1 + / + 3 + / \ + 5 3 + +Output: 2 +Explanation: The maximum width existing in the third level with the length 2 (5,3). +``` + +Example 3: + +```text +Input: + + 1 + / \ + 3 2 + / + 5 + +Output: 2 +Explanation: The maximum width existing in the second level with the length 2 (3,2). +``` + +Example 4: + +```text +Input: + + 1 + / \ + 3 2 + / \ + 5 9 + / \ + 6 7 +Output: 8 +Explanation:The maximum width existing in the fourth level with the length 8 (6,null,null,null,null,null,null,7). +``` + +Note: Answer will in the range of 32-bit signed integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree.go b/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree.go new file mode 100755 index 000000000..8ebf5d1cf --- /dev/null +++ b/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree.go @@ -0,0 +1,62 @@ +package problem0662 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func widthOfBinaryTree(root *TreeNode) int { + if root == nil { + return 0 + } + + // locQueue[i] = j 表示 + // 当 树 是满的时候, + // nodeQueue[i] 节点在其所在层的索引号为 j + locQueue := make([]int, 1, 1024) + nodeQueue := make([]*TreeNode, 1, 1024) + locQueue[0] = 0 + nodeQueue[0] = root + + res := 0 + + // 使用 BFS 来遍历树 + for len(locQueue) > 0 { + res = max(res, getWidth(locQueue)) + + n := len(locQueue) + + fLocQueue := locQueue[:n] + fNodeQueue := nodeQueue[:n] + locQueue = locQueue[n:] + nodeQueue = nodeQueue[n:] + + for i := 0; i < n; i++ { + if fNodeQueue[i].Left != nil { + nodeQueue = append(nodeQueue, fNodeQueue[i].Left) + locQueue = append(locQueue, fLocQueue[i]*2) + } + if fNodeQueue[i].Right != nil { + nodeQueue = append(nodeQueue, fNodeQueue[i].Right) + locQueue = append(locQueue, fLocQueue[i]*2+1) + } + } + + } + + return res +} +// 本题也可以使用 DFS 来做 + +func getWidth(locQueue []int) int { + n := len(locQueue) + return locQueue[n-1] - locQueue[0] + 1 +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree_test.go b/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree_test.go new file mode 100755 index 000000000..828bbae6f --- /dev/null +++ b/Algorithms/0662.maximum-width-of-binary-tree/maximum-width-of-binary-tree_test.go @@ -0,0 +1,68 @@ +package problem0662 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{}, + []int{}, + 0, + }, + + { + []int{1, 3, 5, 4, 2, 9}, + []int{5, 3, 4, 1, 2, 9}, + 4, + }, + + { + []int{1, 3, 5, 4}, + []int{5, 3, 4, 1}, + 2, + }, + + { + []int{1, 3, 5, 2}, + []int{5, 3, 1, 2}, + 2, + }, + + { + []int{1, 3, 5, 6, 2, 9, 7}, + []int{6, 5, 3, 1, 2, 9, 7}, + 8, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, widthOfBinaryTree(root), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + widthOfBinaryTree(root) + } + } +} diff --git a/Algorithms/0664.strange-printer/README.md b/Algorithms/0664.strange-printer/README.md new file mode 100755 index 000000000..6573d8730 --- /dev/null +++ b/Algorithms/0664.strange-printer/README.md @@ -0,0 +1,32 @@ +# [664. Strange Printer](https://leetcode.com/problems/strange-printer/) + +## 题目 + +There is a strange printer with the following two special requirements: + +1. The printer can only print a sequence of the same character each time. +1. At each turn, the printer can print new characters starting from and ending at any places, and will cover the original existing characters. + +Given a string consists of lower English letters only, your job is to count the minimum number of turns the printer needed in order to print it. + +Example 1: + +```text +Input: "aaabbb" +Output: 2 +Explanation: Print "aaa" first and then print "bbb". +``` + +Example 2: + +```text +Input: "aba" +Output: 2 +Explanation: Print "aaa" first and then print "b" from the second place of the string, which will cover the existing character 'a'. +``` + +Hint: Length of the given string will not exceed 100. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0664.strange-printer/strange-printer.go b/Algorithms/0664.strange-printer/strange-printer.go new file mode 100755 index 000000000..6dc93207c --- /dev/null +++ b/Algorithms/0664.strange-printer/strange-printer.go @@ -0,0 +1,43 @@ +package problem0664 + +func strangePrinter(s string) int { + n := len(s) + if n <= 1 { + return n + } + + // dp[i][j] 表示打印 s[i:j+1] 所需的最小次数 + dp := make([][]int, n) + for i := range dp { + dp[i] = make([]int, n) + dp[i][i] = 1 + } + + for Len := 2; Len <= n; Len++ { + for i := 0; i+Len-1 < n; i++ { + j := i + Len - 1 + // dp[i][j] 可以由 dp[i][j-1] 打印而来 + dp[i][j] = dp[i][j-1] + 1 + if s[j-1] == s[j] { + dp[i][j]-- + } + // + for k := i + 1; k <= j; k++ { + // 当 s[k-1] == s[j] 时,可以一次打印 s[k-1:j+1] 再修改 s[k:j] 上的内容 + // 这样也可以少打印一次 + if s[k-1] == s[j] { + dp[i][j] = min(dp[i][j], dp[i][k-1]+dp[k][j]-1) + } + } + } + } + + return dp[0][n-1] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0664.strange-printer/strange-printer_test.go b/Algorithms/0664.strange-printer/strange-printer_test.go new file mode 100755 index 000000000..81ad5a264 --- /dev/null +++ b/Algorithms/0664.strange-printer/strange-printer_test.go @@ -0,0 +1,64 @@ +package problem0664 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "ccdcadbddbaddcbccdcdabcbcddbccdcbad", + 17, + }, + + { + "tbgtgb", + 4, + }, + + { + "aaabbb", + 2, + }, + + { + "", + 0, + }, + + { + "abababa", + 4, + }, + + { + "aba", + 2, + }, + + // 可以有多个 testcase +} + +func Test_strangePrinter(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, strangePrinter(tc.s), "输入:%v", tc) + } +} + +func Benchmark_strangePrinter(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + strangePrinter(tc.s) + } + } +} diff --git a/Algorithms/0665.non-decreasing-array/README.md b/Algorithms/0665.non-decreasing-array/README.md new file mode 100755 index 000000000..94dd187c9 --- /dev/null +++ b/Algorithms/0665.non-decreasing-array/README.md @@ -0,0 +1,29 @@ +# [665. Non-decreasing Array](https://leetcode.com/problems/non-decreasing-array/) + +## 题目 + +Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. + +We define an array is non-decreasing if array[i] <= array[i + 1] holds for every i (1 <= i < n). + +Example 1: + +```text +Input: [4,2,3] +Output: True +Explanation: You could modify the first 4 to 1 to get a non-decreasing array. +``` + +Example 2: + +```text +Input: [4,2,1] +Output: False +Explanation: You can't get a non-decreasing array by modify at most one element. +``` + +Note: The n belongs to [1, 10,000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0665.non-decreasing-array/non-decreasing-array.go b/Algorithms/0665.non-decreasing-array/non-decreasing-array.go new file mode 100755 index 000000000..f18358b94 --- /dev/null +++ b/Algorithms/0665.non-decreasing-array/non-decreasing-array.go @@ -0,0 +1,28 @@ +package problem0665 + +import ( + "sort" +) + +func checkPossibility(nums []int) bool { + for i := 1; i < len(nums); i++ { + if nums[i-1] > nums[i] { + pre := deepCopy(nums) + // 把 nums[i-1] 修改成 nums[i] + pre[i-1] = pre[i] + next := deepCopy(nums) + // 把 nums[i] 修改成 nums[i-1] + next[i] = next[i-1] + // 修改完成后,查看修改完成后,能否满足题意 + return sort.IsSorted(sort.IntSlice(pre)) || sort.IsSorted(sort.IntSlice(next)) + } + } + + return true +} + +func deepCopy(nums []int) []int { + res := make([]int, len(nums)) + copy(res, nums) + return res +} diff --git a/Algorithms/0665.non-decreasing-array/non-decreasing-array_test.go b/Algorithms/0665.non-decreasing-array/non-decreasing-array_test.go new file mode 100755 index 000000000..0362d8ae5 --- /dev/null +++ b/Algorithms/0665.non-decreasing-array/non-decreasing-array_test.go @@ -0,0 +1,59 @@ +package problem0665 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{2, 3, 3, 2, 4}, + true, + }, + + { + []int{3, 4, 2, 3}, + false, + }, + + { + []int{1, 2, 3}, + true, + }, + + { + []int{4, 2, 3}, + true, + }, + + { + []int{4, 2, 1}, + false, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkPossibility(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkPossibility(tc.nums) + } + } +} diff --git a/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii.go b/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii.go index b7d5744af..502f8054b 100755 --- a/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii.go +++ b/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii.go @@ -1,4 +1,4 @@ -package Problem0667 +package problem0667 func constructArray(n int, k int) []int { res := make([]int, 0, n) diff --git a/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii_test.go b/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii_test.go index d28d35781..755b699a6 100755 --- a/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii_test.go +++ b/Algorithms/0667.beautiful-arrangement-ii/beautiful-arrangement-ii_test.go @@ -1,4 +1,4 @@ -package Problem0667 +package problem0667 import ( "fmt" diff --git a/Algorithms/0668.kth-smallest-number-in-multiplication-table/README.md b/Algorithms/0668.kth-smallest-number-in-multiplication-table/README.md new file mode 100755 index 000000000..1f2c16daa --- /dev/null +++ b/Algorithms/0668.kth-smallest-number-in-multiplication-table/README.md @@ -0,0 +1,43 @@ +# [668. Kth Smallest Number in Multiplication Table](https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/) + +## 题目 + +Nearly every one have used the Multiplication Table. But could you find out the k-th smallest number quickly from the multiplication table? + +Given the height m and the length n of a m * n Multiplication Table, and a positive integer k, you need to return the k-th smallest number in this table. + +Example 1: + +```text +Input: m = 3, n = 3, k = 5 +Output: +Explanation: +The Multiplication Table: +1 2 3 +2 4 6 +3 6 9 + +The 5-th smallest number is 3 (1, 2, 2, 3, 3). +``` + +Example 2: + +```text +Input: m = 2, n = 3, k = 6 +Output: +Explanation: +The Multiplication Table: +1 2 3 +2 4 6 + +The 6-th smallest number is 6 (1, 2, 2, 3, 4, 6). +``` + +Note: + +The m and n will be in the range [1, 30000]. +The k will be in the range [1, m * n] + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table.go b/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table.go new file mode 100755 index 000000000..3493ca048 --- /dev/null +++ b/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table.go @@ -0,0 +1,42 @@ +package problem0668 + +func findKthNumber(m int, n int, k int) int { + // 后面的 count 函数,m 较小比较有利 + if m > n { + m, n = n, m + } + + lo, hi := 1, m*n + for lo < hi { + mid := lo + (hi-lo)/2 + c := count(mid, m, n) + if c >= k { + // 说明 mid 大了 + // 需要降低 hi + hi = mid + } else { + // 与 hi 同理,提高 lo + // +1 是为了避免死循环 + lo = mid + 1 + } + } + + return hi +} + +// v >= a * b , 1<=a<=m, 1<=b<=n +// count 返回 a 和 b 的所有可能组合的个数 +func count(v, m, n int) int { + c := 0 + for i := 1; i <= m; i++ { + c += min(v/i, n) + } + return c +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table_test.go b/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table_test.go new file mode 100755 index 000000000..6e58a8233 --- /dev/null +++ b/Algorithms/0668.kth-smallest-number-in-multiplication-table/kth-smallest-number-in-multiplication-table_test.go @@ -0,0 +1,99 @@ +package problem0668 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + m int + n int + k int + ans int +}{ + + { + 11, + 13, + 57, + 24, + }, + + { + 30000, + 30000, + 900000000, + 900000000, + }, + + { + 30000, + 3, + 90000, + 90000, + }, + + { + 300, + 300, + 90000, + 90000, + }, + + { + 3000, + 3000, + 9000000, + 9000000, + }, + + { + 3, + 8, + 19, + 14, + }, + + { + 3, + 6, + 13, + 9, + }, + + { + 3, + 3, + 5, + 3, + }, + + { + 2, + 3, + 6, + 6, + }, + + // 可以有多个 testcase +} + +func Test_findKthNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findKthNumber(tc.m, tc.n, tc.k), "输入:%v", tc) + } +} + +func Benchmark_findKthNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findKthNumber(tc.m, tc.n, tc.k) + } + } +} diff --git a/Algorithms/0669.trim-a-binary-search-tree/README.md b/Algorithms/0669.trim-a-binary-search-tree/README.md new file mode 100755 index 000000000..766af44e4 --- /dev/null +++ b/Algorithms/0669.trim-a-binary-search-tree/README.md @@ -0,0 +1,49 @@ +# [669. Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree/) + +## 题目 + +Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the result should return the new root of the trimmed binary search tree. + +Example 1: + +```text +Input: + 1 + / \ + 0 2 + + L = 1 + R = 2 + +Output: + 1 + \ + 2 +``` + +Example 2: + +```text +Input: + 3 + / \ + 0 4 + \ + 2 + / + 1 + + L = 1 + R = 3 + +Output: + 3 + / + 2 + / + 1 + ``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.go b/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.go new file mode 100755 index 000000000..6434d4519 --- /dev/null +++ b/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree.go @@ -0,0 +1,23 @@ +package problem0669 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) +type TreeNode = kit.TreeNode +func trimBST(root *TreeNode, L int, R int) *TreeNode { + if root == nil { + return nil + } + + if root.Val < L { +return trimBST(root.Right, L, R) + } + + if R< root.Val { +return trimBST(root.Left, L, R) + } + + root.Left = trimBST(root.Left, L, R) + root.Right = trimBST(root.Right, L, R) + return root +} diff --git a/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree_test.go b/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree_test.go new file mode 100755 index 000000000..27f6a0c50 --- /dev/null +++ b/Algorithms/0669.trim-a-binary-search-tree/trim-a-binary-search-tree_test.go @@ -0,0 +1,56 @@ +package problem0669 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + L, R int + ansPost []int +}{ + + { + []int{1, 0, 2}, + []int{0, 1, 2}, + 1, + 2, + []int{2, 1}, + }, + + { + []int{3, 0, 2, 1, 4}, + []int{0, 1, 2, 3, 4}, + 1, + 3, + []int{1, 2, 3}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ansPost := kit.Tree2Postorder(trimBST(root, tc.L, tc.R)) + ast.Equal(tc.ansPost, ansPost, "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + trimBST(root, tc.L, tc.R) + } + } +} diff --git a/Algorithms/0670.maximum-swap/README.md b/Algorithms/0670.maximum-swap/README.md new file mode 100755 index 000000000..1550b7752 --- /dev/null +++ b/Algorithms/0670.maximum-swap/README.md @@ -0,0 +1,29 @@ +# [670. Maximum Swap](https://leetcode.com/problems/maximum-swap/) + +## 题目 + +Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. + +Example 1: + +```text +Input: 2736 +Output: 7236 +Explanation: Swap the number 2 and the number 7. +``` + +Example 2: + +```text +Input: 9973 +Output: 9973 +Explanation: No swap. +``` + +Note: + +1. The given number is in the range [0, 10^8] + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0670.maximum-swap/maximum-swap.go b/Algorithms/0670.maximum-swap/maximum-swap.go new file mode 100755 index 000000000..d65023d60 --- /dev/null +++ b/Algorithms/0670.maximum-swap/maximum-swap.go @@ -0,0 +1,33 @@ +package problem0670 + +import ( + "strconv" +) + +func maximumSwap(num int) int { + bs := []byte(strconv.Itoa(num)) + + // indexs 记录了每个数字最后出现的位置 + indexs := make(map[byte]int, len(bs)) + for i := range bs { + indexs[bs[i]] = i + } + + // 高位上的数字与低位上的更大的数字交换,才能使得 num 变大 + for i := 0; i < len(bs); i++ { + for bj := byte('9'); bs[i] < bj; bj-- { + j := indexs[bj] + if j > i { + bs[i], bs[j] = bs[j], bs[i] + return convert(bs) + } + } + } + + return convert(bs) +} + +func convert(bs []byte) int { + n, _ := strconv.Atoi(string(bs)) + return n +} diff --git a/Algorithms/0670.maximum-swap/maximum-swap_test.go b/Algorithms/0670.maximum-swap/maximum-swap_test.go new file mode 100755 index 000000000..a5ee14164 --- /dev/null +++ b/Algorithms/0670.maximum-swap/maximum-swap_test.go @@ -0,0 +1,54 @@ +package problem0670 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + num int + ans int +}{ + + { + 1234, + 4231, + }, + + { + 9973, + 9973, + }, + + { + 9919, + 9991, + }, + + { + 2736, + 7236, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maximumSwap(tc.num), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maximumSwap(tc.num) + } + } +} diff --git a/Algorithms/0671.second-minimum-node-in-a-binary-tree/README.md b/Algorithms/0671.second-minimum-node-in-a-binary-tree/README.md new file mode 100755 index 000000000..fceaf2776 --- /dev/null +++ b/Algorithms/0671.second-minimum-node-in-a-binary-tree/README.md @@ -0,0 +1,39 @@ +# [671. Second Minimum Node In a Binary Tree](https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/) + +## 题目 + +Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. + +Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree. + +If no such second minimum value exists, output -1 instead. + +Example 1: + +```text +Input: + 2 + / \ + 2 5 + / \ + 5 7 + +Output: 5 +Explanation: The smallest value is 2, the second smallest value is 5. +``` + +Example 2: + +```text +Input: + 2 + / \ + 2 2 + +Output: -1 +Explanation: The smallest value is 2, but there isn't any second smallest value. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree.go b/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree.go new file mode 100755 index 000000000..3d57afb2e --- /dev/null +++ b/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree.go @@ -0,0 +1,33 @@ +package problem0671 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +const intMax = 1<<63 - 1 + +func findSecondMinimumValue(root *TreeNode) int { + res := intMax + + helper(root, root.Val, &res) + + if res == intMax { + return -1 + } + return res +} + +func helper(root *TreeNode, lo int, hi *int) { + if root == nil { + return + } + + if lo < root.Val && root.Val < *hi { + *hi = root.Val + } + + helper(root.Left, lo, hi) + helper(root.Right, lo, hi) +} diff --git a/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree_test.go b/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree_test.go new file mode 100755 index 000000000..4f957bfab --- /dev/null +++ b/Algorithms/0671.second-minimum-node-in-a-binary-tree/second-minimum-node-in-a-binary-tree_test.go @@ -0,0 +1,50 @@ +package problem0671 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + in, post []int + ans int +}{ + + { + []int{2, 2, 2}, + []int{2, 2, 2}, + -1, + }, + + { + []int{4, 2, 5, 1, 6, 3, 7}, + []int{4, 5, 2, 6, 7, 3, 1}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.InPost2Tree(tc.in, tc.post) + ast.Equal(tc.ans, findSecondMinimumValue(root), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.in, tc.post) + findSecondMinimumValue(root) + } + } +} diff --git a/Algorithms/0672.bulb-switcher-ii/README.md b/Algorithms/0672.bulb-switcher-ii/README.md new file mode 100755 index 000000000..3a422f1e1 --- /dev/null +++ b/Algorithms/0672.bulb-switcher-ii/README.md @@ -0,0 +1,42 @@ +# [672. Bulb Switcher II](https://leetcode.com/problems/bulb-switcher-ii/) + +## 题目 + +There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, you need to return how many different kinds of status of the n lights could be. + +Suppose n lights are labeled as number [1, 2, 3 ..., n], function of these 4 buttons are given below: + +1. Flip all the lights. +1. Flip lights with even numbers. +1. Flip lights with odd numbers. +1. Flip lights with (3k + 1) numbers, k = 0, 1, 2, ... + +Example 1: + +```text +Input: n = 1, m = 1. +Output: 2 +Explanation: Status can be: [on], [off] +``` + +Example 2: + +```text +Input: n = 2, m = 1. +Output: 3 +Explanation: Status can be: [on, off], [off, on], [off, off] +``` + +Example 3: + +```text +Input: n = 3, m = 1. +Output: 4 +Explanation: Status can be: [off, on, off], [on, off, on], [off, off, off], [off, on, on]. +``` + +Note: n and m both fit in range [0, 1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii.go b/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii.go new file mode 100755 index 000000000..7df0c0839 --- /dev/null +++ b/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii.go @@ -0,0 +1,44 @@ +package problem0672 + +func flipLights(n, m int) int { + if m == 0 { + return 1 + } + + switch n { + // 当只有一盏灯的时候 + // 如果只按 1 次: + // 按键1,3,4,会让灯熄灭 + // 按键2,会让灯保持点亮 + // 所以,一共是 2 种状态 + // 如果可以按超过 1 次,那么灯的状态,只会比按 1 次多, + // 但是,一盏灯最多只会有 2 种状态 + // 所以,n == 1, m>0 时,返回 2 + case 1: + return 2 + // 与 n == 1 的情况类似 + case 2: + if m == 1 { + return 3 + } + return 4 + // 当 n >= 3 时 + // 根据 4 个按钮控制灯泡的位置不同,可以发现 + // 所有 3*k+1 (k=0,1,2,...) 位置上的灯泡状态总是相同的 + // 3*k+2, 3*k+3 (k=0,1,2,...) 也是如此 + // 所以, + // 可以把所有的灯泡,每 3 个分成一组 + // n >=3 被简化成了 n == 3 + // + // 在纸上演算一下,可能出现的各种情况即可 + default: + switch m { + case 1: + return 4 + case 2: + return 7 + default: + return 8 + } + } +} diff --git a/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii_test.go b/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii_test.go new file mode 100755 index 000000000..fac959137 --- /dev/null +++ b/Algorithms/0672.bulb-switcher-ii/bulb-switcher-ii_test.go @@ -0,0 +1,82 @@ +package problem0672 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n, m int + ans int +}{ + + { + 1, + 1, + 2, + }, + + { + 2, + 1, + 3, + }, + + { + 2, + 4, + 4, + }, + + { + 3, + 4, + 8, + }, + + { + 3, + 0, + 1, + }, + + { + 3, + 3, + 8, + }, + + { + 3, + 2, + 7, + }, + + { + 3, + 1, + 4, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, flipLights(tc.n, tc.m), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + flipLights(tc.n, tc.m) + } + } +} diff --git a/Algorithms/0673.number-of-longest-increasing-subsequence/README.md b/Algorithms/0673.number-of-longest-increasing-subsequence/README.md new file mode 100755 index 000000000..a106c2553 --- /dev/null +++ b/Algorithms/0673.number-of-longest-increasing-subsequence/README.md @@ -0,0 +1,27 @@ +# [673. Number of Longest Increasing Subsequence](https://leetcode.com/problems/number-of-longest-increasing-subsequence/) + +## 题目 + +Given an unsorted array of integers, find the number of longest increasing subsequence. + +Example 1: + +```text +Input: [1,3,5,4,7] +Output: 2 +Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7]. +``` + +Example 2: + +```text +Input: [2,2,2,2,2] +Output: 5 +Explanation: The length of longest continuous increasing subsequence is 1, and there are 5 subsequences' length is 1, so output 5. +``` + +Note: Length of the given array will be not exceed 2000 and the answer is guaranteed to be fit in 32-bit signed int. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence.go b/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence.go new file mode 100755 index 000000000..8730d990a --- /dev/null +++ b/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence.go @@ -0,0 +1,39 @@ +package problem0673 + +func findNumberOfLIS(a []int) int { + n := len(a) + res := 0 + maxLen := 0 + + // length[i] == m 表示,以 a[i] 结尾的最长子序列的长度为 m + length := make([]int, n) + // count[i] == n 表示,以 a[i] 结尾的最长子序列有 n 个 + count := make([]int, n) + + for j := 0; j < n; j++ { + length[j] = 1 + count[j] = 1 + for i := 0; i < j; i++ { + if a[i] < a[j] { + if length[j] == length[i]+1 { + // 出现相同的长度 + count[j] += count[i] + } else if length[j] < length[i]+1 { + // 出现了长度的子序列 + length[j] = length[i] + 1 + count[j] = count[i] + } + } + } + + // 对于每一个 j 都更新一次 res + if maxLen == length[j] { + res += count[j] + } else if maxLen < length[j] { + res = count[j] + maxLen = length[j] + } + } + + return res +} diff --git a/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence_test.go b/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence_test.go new file mode 100755 index 000000000..265f37748 --- /dev/null +++ b/Algorithms/0673.number-of-longest-increasing-subsequence/number-of-longest-increasing-subsequence_test.go @@ -0,0 +1,59 @@ +package problem0673 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{-51352, 15205, -65427, -83043, 76659, -8024, -85277, -44152, 36446, 93694, 50743, 12892, 27985, 32150, -63844, 55946, -4000, 14123, 63541, 74544, -42255, 97608, 76290, 27429, 44628, 15894, 87961, -18456, 7487, 96033, 56941, 10910, -1177, 8875, 30191, 82607, -43724, 38113, 94726, 29250, 74589, 77271, -19031, -89367, 59834, -92444, 18138, -10681, -48922, 49634, 36196, 55360, 35096, -65044, -36847, 69609, 96398, 63949, 51367, -4949, 69677, -55449, -81826, 59265, 19403, -85698, 76146, 19048, -50975, 88533, 89822, -93839, 29632, -52868, -35704, -13993, 97623, 47644, 76941, 41852, 12972, -738, -97741, -8150, 28516, 33046, 63634, 15042, 90687, -25488, 64622, -46530, -56385, 13007, 38522, 42333, -55614, 69245, -88282, 98610, -82087, -87454, 95891, -22632, 79349, 48546, -31268, -6520, 4055, 37809, 75194, -59844, 99284, -6329, 11295, 19556, -55531, 66976, 92077, 97764, 45497, -17626, 74660, -57832, 83829, 46739, 35576, 38315, 4126, 23089, 64671, 12780, -96665, -47985, 83770, 46694, 91307, 94410, 8820, -83994, -21045, 70822, 73097, -7177, 69717, 84186, -57132, -76130, 8738, 35818, -91206, -72574, 93176, -16995, -7734, 69773, 231, 47933, -2643, -34384, 80255, -76597, 24155, 41216, -44050, -82503, 24778, 21380, -56159, -54978, 22079, 1605, -28798, 85924, 45973, 52543, 45626, -85452, -32778, 75165, 42902, 22760, 17184, 96065, 88094, 81662, 20794, -13057, 33818, 62533, 9566, -52279, 20672, -43700, -67264, -59657, 23083, 64271, 7131, 30780, 66781, 40609, -18707, 20102, 77835, -40754, -24429, 85711, 59703, 91752, -76222, 55709, 19870, 96364, 67733, 24778, 1359, 14301, 14847, -55484, 89580, -79042, 460, -42022, 3700, 48167, -90309, 39300, -85033, -1761, 33443, -46567, 64901, -86117, -98418, 67997, -87866, -68567, -94327, 90278, 73166, 68448, 26448, 86239, 68834, 93342, -18409, 18979, 50063, 50526, 8531, -35692, 80641, 55008, -25146, 53, 44300, 73549, 72511}, + 6720, + }, + + { + []int{}, + 0, + }, + + { + []int{1, 3, 5, 4, 7}, + 2, + }, + + { + []int{1, 2, 4, 3, 5, 4, 7, 2}, + 3, + }, + + { + []int{2, 2, 2, 2, 2}, + 5, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findNumberOfLIS(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findNumberOfLIS(tc.nums) + } + } +} diff --git a/Algorithms/0674.longest-continuous-increasing-subsequence/README.md b/Algorithms/0674.longest-continuous-increasing-subsequence/README.md new file mode 100755 index 000000000..d099edbbe --- /dev/null +++ b/Algorithms/0674.longest-continuous-increasing-subsequence/README.md @@ -0,0 +1,28 @@ +# [674. Longest Continuous Increasing Subsequence](https://leetcode.com/problems/longest-continuous-increasing-subsequence/) + +## 题目 + +Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). + +Example 1: + +```text +Input: [1,3,5,4,7] +Output: 3 +Explanation: The longest continuous increasing subsequence is [1,3,5], its length is 3. +Even though [1,3,5,7] is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4. +``` + +Example 2: + +```text +Input: [2,2,2,2,2] +Output: 1 +Explanation: The longest continuous increasing subsequence is [2], its length is 1. +``` + +Note: Length of the array will not exceed 10,000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence.go b/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence.go new file mode 100755 index 000000000..2466bfc94 --- /dev/null +++ b/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence.go @@ -0,0 +1,25 @@ +package problem0674 + +func findLengthOfLCIS(a []int) int { + if len(a) == 0 { + return 0 + } + + res := 1 + + i, j := 0, 1 + for j < len(a) { + for j < len(a) && a[j-1] < a[j] { + j++ + } + + if res < j-i { + res = j - i + } + + i = j + j++ + } + + return res +} diff --git a/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence_test.go b/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence_test.go new file mode 100755 index 000000000..e065c2655 --- /dev/null +++ b/Algorithms/0674.longest-continuous-increasing-subsequence/longest-continuous-increasing-subsequence_test.go @@ -0,0 +1,54 @@ +package problem0674 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1}, + 1, + }, + + { + []int{}, + 0, + }, + + { + []int{1, 3, 5, 4, 7}, + 3, + }, + + { + []int{2, 2, 2, 2, 2}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLengthOfLCIS(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLengthOfLCIS(tc.nums) + } + } +} diff --git a/Algorithms/0675.cut-off-trees-for-golf-event/README.md b/Algorithms/0675.cut-off-trees-for-golf-event/README.md new file mode 100755 index 000000000..3835c5862 --- /dev/null +++ b/Algorithms/0675.cut-off-trees-for-golf-event/README.md @@ -0,0 +1,58 @@ +# [675. Cut Off Trees for Golf Event](https://leetcode.com/problems/cut-off-trees-for-golf-event/) + +## 题目 + +You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map: + +1. 0 represents the obstacle can't be reached. +1. 1 represents the ground can be walked through. +1. The place with number bigger than 1 represents a tree can be walked through, and this positive number represents the tree's height. + +You are asked to cut off all the trees in this forest in the order of tree's height - always cut off the tree with lowest height first. And after cutting, the original place has the tree will become a grass (value 1). + +You will start from the point (0, 0) and you should output the minimum steps you need to walk to cut off all the trees. If you can't cut off all the trees, output -1 in that situation. + +You are guaranteed that no two trees have the same height and there is at least one tree needs to be cut off. + +Example 1: + +```text +Input: +[ + [1,2,3], + [0,0,4], + [7,6,5] +] +Output: 6 +``` + +Example 2: + +```text +Input: +[ + [1,2,3], + [0,0,0], + [7,6,5] +] +Output: -1 +``` + +Example 3: + +```text +Input: +[ + [2,3,4], + [0,0,5], + [8,7,6] +] +Output: 6 +Explanation: You started from the point (0,0) and you can cut off the tree in (0,0) directly without walking. +``` + +Hint: size of the given matrix will not exceed 50x50. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event.go b/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event.go new file mode 100755 index 000000000..11cdaa9e3 --- /dev/null +++ b/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event.go @@ -0,0 +1,122 @@ +package problem0675 + +import "container/heap" + +func cutOffTree(forest [][]int) int { + // 题目保证了 m,n >0 + m, n := len(forest), len(forest[0]) + + // 构建砍树的优先队列 + // 根据题意,先砍矮的树 + pq := make(PQ, 0, m*n) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if forest[i][j] > 1 { + pq = append(pq, &tree{ + height: forest[i][j], + point: point{x: i, y: j}, + }, + ) + } + } + } + heap.Init(&pq) + + res := 0 + beg := point{x: 0, y: 0} + for len(pq) > 0 { + next := heap.Pop(&pq).(*tree) + end := next.point + // 利用 bfs 搜索从 beg 到 end 的步长 + steps, isAccessible := bfs(forest, beg, end) + if !isAccessible { + // 无法从 beg 到 end,直接返回 -1 + return -1 + } + res += steps + beg = end + } + + return res +} + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +// 在 forest 中, +// 如果可以从 beg 到 end 则返回 步数 和 true +// 如果无法到达,则返回 -1 和 false +func bfs(forest [][]int, beg, end point) (int, bool) { + m, n := len(forest), len(forest[0]) + isPassed := make([]bool, m*n) + + steps, cands := 0, 1 + ps := make([]point, 1, m*n) + ps[0] = beg + + for len(ps) > 0 { + if cands == 0 { + steps++ + cands = len(ps) + } + + tp := ps[0] + ps = ps[1:] + isPassed[tp.x*n+tp.y] = true + cands-- + + if tp == end { + return steps, true + } + + for i := 0; i < 4; i++ { + x := tp.x + dx[i] + y := tp.y + dy[i] + p := point{x: x, y: y} + if 0 <= x && x < m && + 0 <= y && y < n && + forest[x][y] > 0 && + !isPassed[x*n+y] { + ps = append(ps, p) + } + } + } + + return -1, false +} + +// tree 是 priorityQueue 中的元素 +type tree struct { + height int + point +} + +type point struct { + x, y int +} + +// PQ implements heap.Interface and holds entries. +type PQ []*tree + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i].height < pq[j].height +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 tree +func (pq *PQ) Push(x interface{}) { + temp := x.(*tree) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最矮的 tree +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} diff --git a/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event_test.go b/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event_test.go new file mode 100755 index 000000000..fba019529 --- /dev/null +++ b/Algorithms/0675.cut-off-trees-for-golf-event/cut-off-trees-for-golf-event_test.go @@ -0,0 +1,147 @@ +package problem0675 + +import ( + "container/heap" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + forest [][]int + ans int +}{ + + { + [][]int{ + {69438, 55243, 0, 43779, 5241, 93591, 73380}, + {847, 49990, 53242, 21837, 89404, 63929, 48214}, + {90332, 49751, 0, 3088, 16374, 70121, 25385}, + {14694, 4338, 87873, 86281, 5204, 84169, 5024}, + {31711, 47313, 1885, 28332, 11646, 42583, 31460}, + {59845, 94855, 29286, 53221, 9803, 41305, 60749}, + {95077, 50343, 27947, 92852, 0, 0, 19731}, + {86158, 63553, 56822, 90251, 0, 23826, 17478}, + {60387, 23279, 78048, 78835, 5310, 99720, 0}, + {74799, 48845, 60658, 29773, 96129, 90443, 14391}, + {65448, 63358, 78089, 93914, 7931, 68804, 72633}, + {93431, 90868, 55280, 30860, 59354, 62083, 47669}, + {81064, 93220, 22386, 22341, 95485, 20696, 13436}, + {50083, 0, 89399, 43882, 0, 13593, 27847}, + {0, 12256, 33652, 69301, 73395, 93440, 0}, + {42818, 87197, 81249, 33936, 7027, 5744, 64710}, + {35843, 0, 99746, 52442, 17494, 49407, 63016}, + {86042, 44524, 0, 0, 26787, 97651, 28572}, + {54183, 83466, 96754, 89861, 84143, 13413, 72921}, + {89405, 52305, 39907, 27366, 14603, 0, 14104}, + {70909, 61104, 70236, 30365, 0, 30944, 98378}, + {20124, 87188, 6515, 98319, 78146, 99325, 88919}, + {89669, 0, 64218, 85795, 2449, 48939, 12869}, + {93539, 28909, 90973, 77642, 0, 72170, 98359}, + {88628, 16422, 80512, 0, 38651, 50854, 55768}, + {13639, 2889, 74835, 80416, 26051, 78859, 25721}, + {90182, 23154, 16586, 0, 27459, 3272, 84893}, + {2480, 33654, 87321, 93272, 93079, 0, 38394}, + {34676, 72427, 95024, 12240, 72012, 0, 57763}, + {97957, 56, 83817, 45472, 0, 24087, 90245}, + {32056, 0, 92049, 21380, 4980, 38458, 3490}, + {21509, 76628, 0, 90430, 10113, 76264, 45840}, + {97192, 58807, 74165, 65921, 45726, 47265, 56084}, + {16276, 27751, 37985, 47944, 54895, 80706, 2372}, + {28438, 53073, 0, 67255, 38416, 63354, 69262}, + {23926, 75497, 91347, 58436, 73946, 39565, 10841}, + {34372, 69647, 44093, 62680, 32424, 69858, 68719}, + {24425, 4014, 94871, 1031, 99852, 88692, 31503}, + {24475, 12295, 33326, 37771, 37883, 74568, 25163}, + {0, 18411, 88185, 60924, 29028, 69789, 0}, + {34697, 75631, 7636, 16190, 60178, 39082, 7052}, + {24876, 9570, 53630, 98605, 22331, 79320, 88317}, + {27204, 89103, 15221, 91346, 35428, 94251, 62745}, + {26636, 28759, 12998, 58412, 38113, 14678, 0}, + {80871, 79706, 45325, 3861, 12504, 0, 4872}, + {79662, 15626, 995, 80546, 64775, 0, 68820}, + {25160, 82123, 81706, 21494, 92958, 33594, 5243}, + }, + 5637, + }, + + { + [][]int{{1, 2, 3}, {0, 0, 0}, {7, 6, 5}}, + -1, + }, + + { + [][]int{ + {1, 2, 3}, + {0, 0, 4}, + {7, 6, 5}, + }, + 6, + }, + + { + [][]int{{18, 17, 16, 15, 14, 13}, {7, 8, 9, 10, 11, 12}, {6, 5, 4, 3, 2, 1}}, + 22, + }, + + { + [][]int{{9, 8, 7}, {4, 5, 6}, {3, 2, 1}}, + 10, + }, + + { + [][]int{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, + 12, + }, + + { + [][]int{{1, 2, 3}, {0, 1, 0}, {7, 1, 1}}, + 6, + }, + + { + [][]int{{1, 2, 3}, {0, 1, 0}, {7, 6, 5}}, + 8, + }, + + { + [][]int{{2, 3, 4}, {0, 0, 5}, {8, 7, 6}}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_cutOffTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, cutOffTree(tc.forest), "输入:%v", tc) + } +} + +func Benchmark_cutOffTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + cutOffTree(tc.forest) + } + } +} + +// 为了 100% 覆盖率 +func Test_PQ_push(t *testing.T) { + ast := assert.New(t) + heights := []int{9, 8, 7, 4, 5, 6, 3, 2, 1} + pq := make(PQ, 0, 9) + for i := 0; i < len(heights); i++ { + heap.Push(&pq, &tree{height: heights[i]}) + } + + actual := heap.Pop(&pq).(*tree).height + expected := 1 + ast.Equal(expected, actual) + +} diff --git a/Algorithms/0676.implement-magic-dictionary/README.md b/Algorithms/0676.implement-magic-dictionary/README.md new file mode 100755 index 000000000..10db80ab5 --- /dev/null +++ b/Algorithms/0676.implement-magic-dictionary/README.md @@ -0,0 +1,29 @@ +# [676. Implement Magic Dictionary](https://leetcode.com/problems/implement-magic-dictionary/) + +## 题目 + +Implement a magic directory with buildDict, and search methods. + +For the method buildDict, you'll be given a list of non-repetitive words to build a dictionary. + +For the method search, you'll be given a word, and judge whether if you modify exactly one character into another character in this word, the modified word is in the dictionary you just built. + +Example 1: + +```text +Input: buildDict(["hello", "leetcode"]), Output: Null +Input: search("hello"), Output: False +Input: search("hhllo"), Output: True +Input: search("hell"), Output: False +Input: search("leetcoded"), Output: False +``` + +Note: + +1. You may assume that all the inputs are consist of lowercase letters a-z. +1. For contest purpose, the test data is rather small by now. You could think about highly efficient algorithm after the contest. +1. Please remember to RESET your class variables declared in class MagicDictionary, as static/class variables are persisted across multiple test cases. Please see here for more details. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary.go b/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary.go new file mode 100755 index 000000000..53ceba41c --- /dev/null +++ b/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary.go @@ -0,0 +1,45 @@ +package problem0676 + +// MagicDictionary 是一个神奇的字典 +type MagicDictionary struct { + keys []string +} + +// Constructor 构建了神奇字典 +func Constructor() MagicDictionary { + return MagicDictionary{ + keys: make([]string, 0, 1024), + } +} + +// BuildDict 往字典里面添加内容 +func (md *MagicDictionary) BuildDict(dict []string) { + for _, w := range dict { + md.keys = append(md.keys, w) + } +} + +// Search returns if there is any word in the trie that equals to the given word after modifying exactly one character +func (md *MagicDictionary) Search(word string) bool { + n := len(word) + + for _, w := range md.keys { + if len(w) != n || w == word { + continue + } + if isChanges(w, word) { + return true + } + } + return false +} + +func isChanges(w, word string) bool { + n := len(w) + for i := range w { + if w[i] == word[i] { + n-- + } + } + return n == 1 +} diff --git a/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary_test.go b/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary_test.go new file mode 100755 index 000000000..b2798e1b6 --- /dev/null +++ b/Algorithms/0676.implement-magic-dictionary/implement-magic-dictionary_test.go @@ -0,0 +1,35 @@ +package problem0676 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MagicDictionary(t *testing.T) { + ast := assert.New(t) + + md := Constructor() + + dict := []string{"hello", "leetcode"} + md.BuildDict(dict) + + ast.False(md.Search("hello")) + + ast.True(md.Search("hhllo")) + + ast.False(md.Search("hell")) + + ast.False(md.Search("leetcoded")) +} + +func Test_MagicDictionary_2(t *testing.T) { + ast := assert.New(t) + + md := Constructor() + + dict := []string{"hello", "hallo", "leetcode"} + md.BuildDict(dict) + + ast.True(md.Search("hello"), "hello 可以从 hallo 变化过来") +} diff --git a/Algorithms/0677.map-sum-pairs/README.md b/Algorithms/0677.map-sum-pairs/README.md new file mode 100755 index 000000000..ac191b79c --- /dev/null +++ b/Algorithms/0677.map-sum-pairs/README.md @@ -0,0 +1,22 @@ +# [677. Map Sum Pairs](https://leetcode.com/problems/map-sum-pairs/) + +## 题目 + +Implement a MapSum class with insert, and sum methods. + +For the method insert, you'll be given a pair of (string, integer). The string represents the key and the integer represents the value. If the key already existed, then the original key-value pair will be overridden to the new one. + +For the method sum, you'll be given a string representing the prefix, and you need to return the sum of all the pairs' value whose key starts with the prefix. + +Example 1: + +```text +Input: insert("apple", 3), Output: Null +Input: sum("ap"), Output: 3 +Input: insert("app", 2), Output: Null +Input: sum("ap"), Output: 5 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0677.map-sum-pairs/map-sum-pairs.go b/Algorithms/0677.map-sum-pairs/map-sum-pairs.go new file mode 100755 index 000000000..40cc4e6a5 --- /dev/null +++ b/Algorithms/0677.map-sum-pairs/map-sum-pairs.go @@ -0,0 +1,49 @@ +package problem0677 + +import "strings" +import "sort" + +// MapSum 可以返回 map 中具有相同前缀的 value 之和 +type MapSum struct { + m map[string]int + keys []string +} + +// Constructor 构建了 MapSum +func Constructor() MapSum { + return MapSum{m: make(map[string]int, 128), + keys: make([]string, 0, 128)} +} + +// Insert 插入 (key, val) +func (ms *MapSum) Insert(key string, val int) { + ms.m[key] = val + + i := sort.SearchStrings(ms.keys, key) + // 遇到重复的 key ,不操作 + if i < len(ms.keys) && ms.keys[i] == key { + return + } + + ms.keys = append(ms.keys, "") + copy(ms.keys[i+1:], ms.keys[i:]) + ms.keys[i] = key +} + +// Sum 返回所有具有 prefix 的 key 的 val 之和 +func (ms *MapSum) Sum(prefix string) int { + res := 0 + i := sort.SearchStrings(ms.keys, prefix) + for i < len(ms.keys) && strings.HasPrefix(ms.keys[i], prefix) { + res += ms.m[ms.keys[i]] + i++ + } + return res +} + +/** + * Your MapSum object will be instantiated and called as such: + * obj := Constructor(); + * obj.Insert(key,val); + * param_2 := obj.Sum(prefix); + */ diff --git a/Algorithms/0677.map-sum-pairs/map-sum-pairs_test.go b/Algorithms/0677.map-sum-pairs/map-sum-pairs_test.go new file mode 100755 index 000000000..20719ae83 --- /dev/null +++ b/Algorithms/0677.map-sum-pairs/map-sum-pairs_test.go @@ -0,0 +1,35 @@ +package problem0677 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MapSum(t *testing.T) { + ast := assert.New(t) + + ms := Constructor() + + ms.Insert("apple", 3) + + ast.Equal(3, ms.Sum("ap")) + + ms.Insert("app", 2) + + ast.Equal(5, ms.Sum("ap")) +} + +func Test_MapSum_duplicateKey(t *testing.T) { + ast := assert.New(t) + + ms := Constructor() + + ms.Insert("apple", 3) + + ast.Equal(3, ms.Sum("ap")) + + ms.Insert("apple", 2) + + ast.Equal(2, ms.Sum("ap")) +} diff --git a/Algorithms/0678.valid-parenthesis-string/README.md b/Algorithms/0678.valid-parenthesis-string/README.md new file mode 100755 index 000000000..9f4f8c0c0 --- /dev/null +++ b/Algorithms/0678.valid-parenthesis-string/README.md @@ -0,0 +1,40 @@ +# [678. Valid Parenthesis String](https://leetcode.com/problems/valid-parenthesis-string/) + +## 题目 + +Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of a string by these rules: + +1. Any left parenthesis '(' must have a corresponding right parenthesis ')'. +1. Any right parenthesis ')' must have a corresponding left parenthesis '('. +1. Left parenthesis '(' must go before the corresponding right parenthesis ')'. +1. '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string. +1. An empty string is also valid. + +Example 1: + +```text +Input: "()" +Output: True +``` + +Example 2: + +```text +Input: "(*)" +Output: True +``` + +Example 3: + +```text +Input: "(*))" +Output: True +``` + +Note: + +1. The string size will be in the range [1, 100]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string.go b/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string.go new file mode 100755 index 000000000..6e67834cc --- /dev/null +++ b/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string.go @@ -0,0 +1,36 @@ +package problem0678 + +func checkValidString(s string) bool { + l, r := 0, 0 + n := len(s) + for i := 0; i < n; i++ { + // 从左侧开始的扫描 + // 并认为所有的 '*' 是 '(' + if s[i] == ')' { + l-- + } else { + l++ + } + + // 从右侧开始的扫描 + // 并认为所有的 '*' 是 ')' + j := n - i - 1 + if s[j] == '(' { + r-- + } else { + r++ + } + + if l < 0 || r < 0 { + // l < 0 意味着 + // 就算所有的 '*' 变成的 '(' + // s[:i] 中也没有能与 s[i] == ')' 匹配的 '(' + // l < 0 意味着 + // 就算所有的 '*' 变成的 ')' + // s[j+1:] 中也没有能与 s[j] == '(' 匹配的 ')' + return false + } + } + + return true +} diff --git a/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string_test.go b/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string_test.go new file mode 100755 index 000000000..830e49efb --- /dev/null +++ b/Algorithms/0678.valid-parenthesis-string/valid-parenthesis-string_test.go @@ -0,0 +1,59 @@ +package problem0678 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans bool +}{ + + { + "(())((())()()(*)(*()(())())())()()((()())((()))(*", + false, + }, + + { + ")(", + false, + }, + + { + "()", + true, + }, + + { + "(*)", + true, + }, + + { + "(*))", + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, checkValidString(tc.s), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + checkValidString(tc.s) + } + } +} diff --git a/Algorithms/0679.24-game/24-game.go b/Algorithms/0679.24-game/24-game.go new file mode 100755 index 000000000..450c7225f --- /dev/null +++ b/Algorithms/0679.24-game/24-game.go @@ -0,0 +1,20 @@ +package problem0679 + +import ( + "sort" +) + +// 无法算出 24 的数字组合 +var bad = []int{1111, 1112, 1113, 1114, 1115, 1116, 1117, 1119, 1122, 1123, 1124, 1125, 1133, 1159, 1167, 1177, 1178, 1179, 1189, 1199, 1222, 1223, 1299, 1355, 1499, 1557, 1558, 1577, 1667, 1677, 1678, 1777, 1778, 1899, 1999, 2222, 2226, 2279, 2299, 2334, 2555, 2556, 2599, 2677, 2777, 2779, 2799, 2999, 3358, 3467, 3488, 3555, 3577, 4459, 4466, 4467, 4499, 4779, 4999, 5557, 5558, 5569, 5579, 5777, 5778, 5799, 5899, 5999, 6667, 6677, 6678, 6699, 6777, 6778, 6779, 6788, 6999, 7777, 7778, 7779, 7788, 7789, 7799, 7888, 7899, 7999, 8888, 8889, 8899, 8999, 9999} + +func judgePoint24(nums []int) bool { + sort.Ints(nums) + sum := 0 + for i := 0; i < 4; i++ { + sum = sum*10 + nums[i] + } + + i := sort.SearchInts(bad, sum) + + return bad[i] != sum +} diff --git a/Algorithms/0679.24-game/24-game_test.go b/Algorithms/0679.24-game/24-game_test.go new file mode 100755 index 000000000..484bc86f1 --- /dev/null +++ b/Algorithms/0679.24-game/24-game_test.go @@ -0,0 +1,54 @@ +package problem0679 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans bool +}{ + + { + []int{1, 2, 1, 2}, + false, + }, + + { + []int{4, 1, 8, 7}, + true, + }, + + { + []int{1, 5, 5, 5}, + true, + }, + + { + []int{3, 8, 8, 8}, + true, + }, + + // 可以有多个 testcase +} + +func Test_judgePoint24(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, judgePoint24(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_judgePoint24(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + judgePoint24(tc.nums) + } + } +} diff --git a/Algorithms/0679.24-game/README.md b/Algorithms/0679.24-game/README.md new file mode 100755 index 000000000..ae9e69f6e --- /dev/null +++ b/Algorithms/0679.24-game/README.md @@ -0,0 +1,30 @@ +# [679. 24 Game](https://leetcode.com/problems/24-game/) + +## 题目 + +You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get the value of 24. + +Example 1: + +```text +Input: [4, 1, 8, 7] +Output: True +Explanation: (8-4) * (7-1) = 24 +``` + +Example 2: + +```text +Input: [1, 2, 1, 2] +Output: False +``` + +Note: + +1. The division operator / represents real division, not integer division. For example, 4 / (1 - 2/3) = 12. +1. Every operation done is between two numbers. In particular, we cannot use - as a unary operator. For example, with [1, 1, 1, 1] as input, the expression -1 - 1 - 1 - 1 is not allowed. +1. You cannot concatenate numbers together. For example, if the input is [1, 2, 1, 2], we cannot write this as 12 + 12. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0680.valid-palindrome-ii/README.md b/Algorithms/0680.valid-palindrome-ii/README.md new file mode 100755 index 000000000..a2a98409f --- /dev/null +++ b/Algorithms/0680.valid-palindrome-ii/README.md @@ -0,0 +1,28 @@ +# [680. Valid Palindrome II](https://leetcode.com/problems/valid-palindrome-ii/) + +## 题目 + +Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. + +Example 1: + +```text +Input: "aba" +Output: True +``` + +Example 2: + +```text +Input: "abca" +Output: True +Explanation: You could delete the character 'c'. +``` + +Note: + +1. The string will only contain lowercase characters a-z. The maximum length of the string is 50000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii.go b/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii.go new file mode 100755 index 000000000..ac500a704 --- /dev/null +++ b/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii.go @@ -0,0 +1,21 @@ +package problem0680 + +func validPalindrome(s string) bool { + return helper([]byte(s), 0, len(s)-1, false) +} + +func helper(bs []byte, lo, hi int, hasDeleted bool) bool { + for lo < hi { + if bs[lo] != bs[hi] { + if hasDeleted { + return false + } + return helper(bs, lo+1, hi, true) || // 删除 s[lo] + helper(bs, lo, hi-1, true) // 删除 s[hi] + } + lo++ + hi-- + } + + return true +} diff --git a/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii_test.go b/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii_test.go new file mode 100755 index 000000000..552a775c7 --- /dev/null +++ b/Algorithms/0680.valid-palindrome-ii/valid-palindrome-ii_test.go @@ -0,0 +1,49 @@ +package problem0680 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans bool +}{ + + { + "acaaba", + false, + }, + + { + "aba", + true, + }, + + { + "abca", + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, validPalindrome(tc.s), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validPalindrome(tc.s) + } + } +} diff --git a/Algorithms/0682.baseball-game/README.md b/Algorithms/0682.baseball-game/README.md new file mode 100755 index 000000000..4bfcbabf4 --- /dev/null +++ b/Algorithms/0682.baseball-game/README.md @@ -0,0 +1,53 @@ +# [682. Baseball Game](https://leetcode.com/problems/baseball-game/) + +## 题目 + +You're now a baseball game point recorder. + +Given a list of strings, each string can be one of the 4 following types: + +1. Integer (one round's score): Directly represents the number of points you get in this round. +1. "+" (one round's score): Represents that the points you get in this round are the sum of the last two valid round's points. +1. "D" (one round's score): Represents that the points you get in this round are the doubled data of the last valid round's points. +1. "C" (an operation, which isn't a round's score): Represents the last valid round's points you get were invalid and should be removed. + +Each round's operation is permanent and could have an impact on the round before and the round after. + +You need to return the sum of the points you could get in all the rounds. + +Example 1: + +```text +Input: ["5","2","C","D","+"] +Output: 30 +Explanation: +Round 1: You could get 5 points. The sum is: 5. +Round 2: You could get 2 points. The sum is: 7. +Operation 1: The round 2's data was invalid. The sum is: 5. +Round 3: You could get 10 points (the round 2's data has been removed). The sum is: 15. +Round 4: You could get 5 + 10 = 15 points. The sum is: 30. +``` + +Example 2: + +```text +Input: ["5","-2","4","C","D","9","+","+"] +Output: 27 +Explanation: +Round 1: You could get 5 points. The sum is: 5. +Round 2: You could get -2 points. The sum is: 3. +Round 3: You could get 4 points. The sum is: 7. +Operation 1: The round 3's data is invalid. The sum is: 3. +Round 4: You could get -4 points (the round 3's data has been removed). The sum is: -1. +Round 5: You could get 9 points. The sum is: 8. +Round 6: You could get -4 + 9 = 5 points. The sum is 13. +Round 7: You could get 9 + 5 = 14 points. The sum is 27. + +Note: + +1. The size of the input list will be between 1 and 1000. +1. Every integer represented in the list will be between -30000 and 30000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0682.baseball-game/baseball-game.go b/Algorithms/0682.baseball-game/baseball-game.go new file mode 100755 index 000000000..1d79cd8c8 --- /dev/null +++ b/Algorithms/0682.baseball-game/baseball-game.go @@ -0,0 +1,32 @@ +package problem0682 + +import ( + "strconv" +) + +func calPoints(ops []string) int { + pointStack := make([]int, 0, len(ops)) + + for i := range ops { + switch ops[i] { + case "+": + r1 := pointStack[len(pointStack)-1] + r2 := pointStack[len(pointStack)-2] + pointStack = append(pointStack, r1+r2) + case "D": + r1 := pointStack[len(pointStack)-1] + pointStack = append(pointStack, 2*r1) + case "C": + pointStack = pointStack[:len(pointStack)-1] + default: + point, _ := strconv.Atoi(ops[i]) + pointStack = append(pointStack, point) + } + } + + res := 0 + for _, p := range pointStack { + res += p + } + return res +} diff --git a/Algorithms/0682.baseball-game/baseball-game_test.go b/Algorithms/0682.baseball-game/baseball-game_test.go new file mode 100755 index 000000000..c3c1e1d30 --- /dev/null +++ b/Algorithms/0682.baseball-game/baseball-game_test.go @@ -0,0 +1,44 @@ +package problem0682 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ops []string + ans int +}{ + + { + []string{"5", "2", "C", "D", "+"}, + 30, + }, + + { + []string{"5", "-2", "4", "C", "D", "9", "+", "+"}, + 27, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, calPoints(tc.ops), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + calPoints(tc.ops) + } + } +} diff --git a/Algorithms/0684.redundant-connection/README.md b/Algorithms/0684.redundant-connection/README.md new file mode 100755 index 000000000..69bfd3ebf --- /dev/null +++ b/Algorithms/0684.redundant-connection/README.md @@ -0,0 +1,42 @@ +# [684. Redundant Connection](https://leetcode.com/problems/redundant-connection/) + +## 题目 + +In this problem, a tree is an undirected graph that is connected and has no cycles. + +The given input is a graph that started as a tree with N nodes (with distinct values 1, 2, ..., N), with one additional edge added. The added edge has two different vertices chosen from 1 to N, and was not an edge that already existed. + +The resulting graph is given as a 2D-array of edges. Each element of edges is a pair [u, v] with u < v, that represents an undirected edge connecting nodes u and v. + +Return an edge that can be removed so that the resulting graph is a tree of N nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array. The answer edge [u, v] should be in the same format, with u < v. + +Example 1: + +```text +Input: [[1,2], [1,3], [2,3]] +Output: [2,3] +Explanation: The given undirected graph will be like this: + 1 + / \ +2 - 3 +``` + +Example 2: + +```text +Input: [[1,2], [2,3], [3,4], [1,4], [1,5]] +Output: [1,4] +Explanation: The given undirected graph will be like this: +5 - 1 - 2 + | | + 4 - 3 +``` + +Note: + +1. The size of the input 2D-array will be between 3 and 1000. +1. Every integer represented in the 2D-array will be between 1 and N, where N is the size of the input array. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0684.redundant-connection/redundant-connection.go b/Algorithms/0684.redundant-connection/redundant-connection.go new file mode 100755 index 000000000..311e504f1 --- /dev/null +++ b/Algorithms/0684.redundant-connection/redundant-connection.go @@ -0,0 +1,30 @@ +package problem0684 + +func findRedundantConnection(edges [][]int) []int { + n := len(edges) + parent := make([]int, n+1) + for i := 0; i < n; i++ { + parent[i] = i + } + + var i int + var e []int + for i, e = range edges { + f, t := e[0], e[1] + pf := find(parent, f) + pt := find(parent, t) + if pf == pt { + // 出现连通区域 + break + } + parent[pf] = pt + } + return edges[i] +} + +func find(parent []int, f int) int { + for f != parent[f] { + f = parent[f] + } + return f +} diff --git a/Algorithms/0684.redundant-connection/redundant-connection_test.go b/Algorithms/0684.redundant-connection/redundant-connection_test.go new file mode 100755 index 000000000..3a264f759 --- /dev/null +++ b/Algorithms/0684.redundant-connection/redundant-connection_test.go @@ -0,0 +1,69 @@ +package problem0684 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + edges [][]int + ans []int +}{ + + { + [][]int{{9, 10}, {5, 8}, {2, 6}, {1, 5}, {3, 8}, {4, 9}, {8, 10}, {4, 10}, {6, 8}, {7, 9}}, + []int{4, 10}, + }, + + { + [][]int{{3, 7}, {1, 4}, {2, 8}, {1, 6}, {7, 9}, {6, 10}, {1, 7}, {2, 3}, {8, 9}, {5, 9}}, + []int{8, 9}, + }, + + { + [][]int{{1, 2}, {2, 3}, {2, 4}, {4, 5}, {1, 5}}, + []int{1, 5}, + }, + + { + [][]int{{1, 3}, {3, 4}, {1, 5}, {3, 5}, {2, 3}}, + []int{3, 5}, + }, + + { + [][]int{{1, 4}, {3, 4}, {1, 3}, {1, 2}, {4, 5}}, + []int{1, 3}, + }, + + { + [][]int{{1, 2}, {1, 3}, {2, 3}}, + []int{2, 3}, + }, + + { + [][]int{{1, 2}, {2, 3}, {3, 4}, {1, 4}, {1, 5}}, + []int{1, 4}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRedundantConnection(tc.edges), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRedundantConnection(tc.edges) + } + } +} diff --git a/Algorithms/0685.redundant-connection-ii/README.md b/Algorithms/0685.redundant-connection-ii/README.md new file mode 100755 index 000000000..2dc09063c --- /dev/null +++ b/Algorithms/0685.redundant-connection-ii/README.md @@ -0,0 +1,44 @@ +# [685. Redundant Connection II](https://leetcode.com/problems/redundant-connection-ii/) + +## 题目 + +In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, except for the root node which has no parents. + +The given input is a directed graph that started as a rooted tree with N nodes (with distinct values 1, 2, ..., N), with one additional directed edge added. The added edge has two different vertices chosen from 1 to N, and was not an edge that already existed. + +The resulting graph is given as a 2D-array of edges. Each element of edges is a pair [u, v] that represents a directed edge connecting nodes u and v, where u is a parent of child v. + +Return an edge that can be removed so that the resulting graph is a rooted tree of N nodes. If there are multiple answers, return the answer that occurs last in the given 2D-array. + +Example 1: + +```text +Input: [[1,2], [1,3], [2,3]] +Output: [2,3] +Explanation: The given directed graph will be like this: + 1 + / \ +v v +2-->3 +``` + +Example 2: + +```text +Input: [[1,2], [2,3], [3,4], [4,1], [1,5]] +Output: [4,1] +Explanation: The given directed graph will be like this: +5 <- 1 -> 2 + ^ | + | v + 4 <- 3 +``` + +Note: + +1. The size of the input 2D-array will be between 3 and 1000. +1. Every integer represented in the 2D-array will be between 1 and N, where N is the size of the input array. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0685.redundant-connection-ii/redundant-connection-ii.go b/Algorithms/0685.redundant-connection-ii/redundant-connection-ii.go new file mode 100755 index 000000000..3f98a070d --- /dev/null +++ b/Algorithms/0685.redundant-connection-ii/redundant-connection-ii.go @@ -0,0 +1,77 @@ +package problem0685 + +// 本题存在 3 种情况需要处理 +// 1. 存在一个节点,有两个父节点,但没有环状结构 +// 2. 存在一个环状结构,且每个节点都只有一个父节点 +// 3. 存在一个环状结构,且环上有且仅有一个节点有两个父节点 + +func findRedundantDirectedConnection(edges [][]int) []int { + n := len(edges) + + parent := make([]int, n+1) + // first, last 用来保存指向同一个节点的两条 edge + var first, last []int + + for k := range edges { + p, c := edges[k][0], edges[k][1] + if parent[c] == 0 { + parent[c] = p + } else { + // c 是存在两个父节点的节点 + // 按照先后顺序保存这两个 edge 到 first 和 last + first = []int{parent[c], c} + last = edges[k] + // edges[k] = nil 的用意是 + // 在 edges 中删除 last 边,然后查找环状结构 + // 如果 依然 存在环状结构的话,说明 first 边在环状结构上,需要删除的是 first 边 + // 如果 不 存在环状结构的话,不管 last 原先在不在环状结构上,都需要删除 last ,因为题目要求删除 occurs last 的边 + edges[k] = nil + // 可以提前结束 for 循环了 + break + } + } + + // 以下是使用联通查找方法,查找环装结构 + root := parent + + for i := 0; i <= n; i++ { + root[i] = i + } + + rootOf := func(i int) int { + for i != root[i] { + i = root[i] + } + return i + } + + for _, edge := range edges { + if edge == nil { + continue + } + + p := edge[0] + c := edge[1] + r := rootOf(p) + + // r == c 说明,添加 edge 后,会形成一个封闭的环 + // edge 是让环封闭的边 + if r == c { + if first == nil { + // 不存在有两个父节点的节点 + // 返回让环封闭的 edge + return edge + } + // 第 3 种情况出现了,且 first 边在环状结构上 + return first + } + + // 按照 edge 出现的顺序,添加每个节点,目前的根节点 + root[c] = r + } + + // 程序运行到这里,说明 + // 不存在环状结构 + // 那就删除 last 吧 + return last +} diff --git a/Algorithms/0685.redundant-connection-ii/redundant-connection-ii_test.go b/Algorithms/0685.redundant-connection-ii/redundant-connection-ii_test.go new file mode 100755 index 000000000..2c136c48f --- /dev/null +++ b/Algorithms/0685.redundant-connection-ii/redundant-connection-ii_test.go @@ -0,0 +1,49 @@ +package problem0685 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + edges [][]int + ans []int +}{ + + { + [][]int{{2, 1}, {3, 1}, {4, 2}, {1, 4}}, + []int{2, 1}, + }, + + { + [][]int{{1, 2}, {1, 3}, {2, 3}}, + []int{2, 3}, + }, + + { + [][]int{{1, 2}, {2, 3}, {3, 4}, {4, 1}, {1, 5}}, + []int{4, 1}, + }, + + // 可以有多个 testcase +} + +func Test_findRedundantDirectedConnection(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findRedundantDirectedConnection(tc.edges), "输入:%v", tc) + } +} + +func Benchmark_findRedundantDirectedConnection(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findRedundantDirectedConnection(tc.edges) + } + } +} diff --git a/Algorithms/0686.repeated-string-match/README.md b/Algorithms/0686.repeated-string-match/README.md new file mode 100755 index 000000000..19b198b6a --- /dev/null +++ b/Algorithms/0686.repeated-string-match/README.md @@ -0,0 +1,16 @@ +# [686. Repeated String Match](https://leetcode.com/problems/repeated-string-match/) + +## 题目 + +Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. + +For example, with A = "abcd" and B = "cdabcdab". + +Return 3, because by repeating A three times (“abcdabcdabcd”), B is a substring of it; and B is not a substring of A repeated two times ("abcdabcd"). + +Note: +The length of A and B will be between 1 and 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0686.repeated-string-match/repeated-string-match.go b/Algorithms/0686.repeated-string-match/repeated-string-match.go new file mode 100755 index 000000000..3ef5c8bd7 --- /dev/null +++ b/Algorithms/0686.repeated-string-match/repeated-string-match.go @@ -0,0 +1,22 @@ +package problem0686 + +import "strings" + +func repeatedStringMatch(a string, b string) int { + times := max(len(b)/len(a), 1) + + if strings.Contains(strings.Repeat(a, times), b) { + return times + } + if strings.Contains(strings.Repeat(a, times+1), b) { + return times + 1 + } + return -1 +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0686.repeated-string-match/repeated-string-match_test.go b/Algorithms/0686.repeated-string-match/repeated-string-match_test.go new file mode 100755 index 000000000..6cd646464 --- /dev/null +++ b/Algorithms/0686.repeated-string-match/repeated-string-match_test.go @@ -0,0 +1,100 @@ +package problem0686 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a, b string + ans int +}{ + + { + "ba", + "ab", + 2, + }, + + { + "abc", + "aabcbabcc", + -1, + }, + + { + "abcd", + "cdabdab", + -1, + }, + + { + "aa", + "b", + -1, + }, + + { + "aa", + "a", + 1, + }, + + { + "abcd", + "bcabcdbc", + -1, + }, + + { + "abcd", + "abcdb", + -1, + }, + + { + "abababaaba", + "aabaaba", + 2, + }, + + { + "abcd", + "cdabcdab", + 3, + }, + + { + "bb", + "bbbbbbb", + 4, + }, + + { + "a", + "aa", + 2, + }, + + // 可以有多个 testcase +} + +func Test_repeatedStringMatch(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, repeatedStringMatch(tc.a, tc.b), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + repeatedStringMatch(tc.a, tc.b) + } + } +} diff --git a/Algorithms/0687.longest-univalue-path/README.md b/Algorithms/0687.longest-univalue-path/README.md new file mode 100755 index 000000000..a314066e1 --- /dev/null +++ b/Algorithms/0687.longest-univalue-path/README.md @@ -0,0 +1,45 @@ +# [687. Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) + +## 题目 + +Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root. + +Note: The length of path between two nodes is represented by the number of edges between them. + +Example 1: + +```text +Input: + + 5 + / \ + 4 5 + / \ \ + 1 1 5 +Output: + +2 +``` + +Example 2: + +```text +Input: + + 1 + / \ + 4 5 + / \ \ + 4 4 5 +Output: + +2 +``` + +Note: The given binary tree has not more than 10000 nodes. The height of the tree is not more than 1000. + + + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0687.longest-univalue-path/longest-univalue-path.go b/Algorithms/0687.longest-univalue-path/longest-univalue-path.go new file mode 100755 index 000000000..ca658149d --- /dev/null +++ b/Algorithms/0687.longest-univalue-path/longest-univalue-path.go @@ -0,0 +1,49 @@ +package problem0687 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type TreeNode = kit.TreeNode + +func longestUnivaluePath(root *TreeNode) int { + maxLen := 0 + helper(root, &maxLen) + return maxLen +} + +// 返回从 root 出发拥有相同 Val 值的线路上的 edge 数量 +func helper(n *TreeNode, maxLen *int) int { + if n == nil { + return 0 + } + + l := helper(n.Left, maxLen) + r := helper(n.Right, maxLen) + res := 0 + + // 左侧单边的最长距离 + if n.Left != nil && n.Val == n.Left.Val { + *maxLen = max(*maxLen, l+1) + res = max(res, l+1) + } + // 右侧单边的最长距离 + if n.Right != nil && n.Val == n.Right.Val { + *maxLen = max(*maxLen, r+1) + res = max(res, r+1) + } + // 通过根节点的最长边 + if n.Left != nil && n.Val == n.Left.Val && + n.Right != nil && n.Val == n.Right.Val { + *maxLen = max(*maxLen, l+r+2) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0687.longest-univalue-path/longest-univalue-path_test.go b/Algorithms/0687.longest-univalue-path/longest-univalue-path_test.go new file mode 100755 index 000000000..d145aabdf --- /dev/null +++ b/Algorithms/0687.longest-univalue-path/longest-univalue-path_test.go @@ -0,0 +1,54 @@ +package problem0687 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +const null = -1 << 63 + +// tcs is testcase slice +var tcs = []struct { + ints []int + ans int +}{ + + { + []int{}, + 0, + }, + + { + []int{1, 4, 5, 4, 4, null, 5}, + 2, + }, + + { + []int{5, 4, 5, 1, 1, null, 5}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2TreeNode(tc.ints) + ast.Equal(tc.ans, longestUnivaluePath(root), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.ints) + longestUnivaluePath(root) + } + } +} diff --git a/Algorithms/0688.knight-probability-in-chessboard/README.md b/Algorithms/0688.knight-probability-in-chessboard/README.md new file mode 100755 index 000000000..4d92960e6 --- /dev/null +++ b/Algorithms/0688.knight-probability-in-chessboard/README.md @@ -0,0 +1,31 @@ +# [688. Knight Probability in Chessboard](https://leetcode.com/problems/knight-probability-in-chessboard/) + +## 题目 + +On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the top-left square is (0, 0), and the bottom-right square is (N-1, N-1). + +A chess knight has 8 possible moves it can make, as illustrated below. Each move is two squares in a cardinal direction, then one square in an orthogonal direction. + +![](https://leetcode.com/static/images/problemset/knight.png) + +Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there. + +The knight continues moving until it has made exactly K moves or has moved off the chessboard. Return the probability that the knight remains on the board after it has stopped moving. + +Example: + +```text +Input: 3, 2, 0, 0 +Output: 0.0625 +Explanation: There are two moves (to (1,2), (2,1)) that will keep the knight on the board. From each of those positions, there are also two moves that will keep the knight on the board. The total probability the knight stays on the board is 0.0625. +``` + +Note: + +1. N will be between 1 and 25. +1. K will be between 0 and 100. +1. The knight always initially starts on the board. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard.go b/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard.go new file mode 100755 index 000000000..aea9dd094 --- /dev/null +++ b/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard.go @@ -0,0 +1,48 @@ +package problem0688 + +import ( + "math" +) + +var dx = []int{-2, -2, -1, 1, 2, 2, 1, -1} +var dy = []int{-1, 1, -2, -2, 1, -1, 2, 2} + +func knightProbability(N int, K int, r int, c int) float64 { + // 为了快速创建 pre 变量,使用数组,而不是切片 + // pre[i][j] = k 表示 + // 在某一步的时候,棋盘上的 (i,j) 位置,会有 k 个棋子落在此位置上 + pre := [25][25]float64{} + pre[r][c] = 1 + + for k := 0; k < K; k++ { + // 按照规则移动棋子后 + // next 记录了各个位置上可能落下的棋子数 + next := [25][25]float64{} + + for i := 0; i < N; i++ { + for j := 0; j < N; j++ { + if pre[i][j] == 0 { + continue + } + for m := 0; m < 8; m++ { + x := dx[m] + i + y := dy[m] + j + if 0 <= x && x < N && 0 <= y && y < N { + next[x][y] += pre[i][j] + } + } + } + } + + pre = next + } + + count := 0. + for i := 0; i < N; i++ { + for j := 0; j < N; j++ { + count += pre[i][j] + } + } + + return float64(count) / math.Pow(8., float64(K)) +} diff --git a/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard_test.go b/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard_test.go new file mode 100755 index 000000000..8e5572816 --- /dev/null +++ b/Algorithms/0688.knight-probability-in-chessboard/knight-probability-in-chessboard_test.go @@ -0,0 +1,49 @@ +package problem0688 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n, k, r, c int + ans float64 +}{ + + { + 8, 30, 6, 4, + 0.00019, + }, + + { + 3, 1, 1, 1, + 0.0, + }, + + { + 3, 2, 0, 0, + 0.0625, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.InDelta(tc.ans, knightProbability(tc.n, tc.k, tc.r, tc.c), 0.000001, "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + knightProbability(tc.n, tc.k, tc.r, tc.c) + } + } +} diff --git a/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/README.md b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/README.md new file mode 100755 index 000000000..cbf4af933 --- /dev/null +++ b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/README.md @@ -0,0 +1,28 @@ +# [689. Maximum Sum of 3 Non-Overlapping Subarrays](https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays/) + +## 题目 + +In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum. + +Each subarray will be of size k, and we want to maximize the sum of all 3*k entries. + +Return the result as a list of indices representing the starting position of each interval (0-indexed). If there are multiple answers, return the lexicographically smallest one. + +Example: + +```text +Input: [1,2,1,2,6,7,5,1], 2 +Output: [0, 3, 5] +Explanation: Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5]. +We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger. +``` + +Note: + +1. nums.length will be between 1 and 20000. +1. nums[i] will be between 1 and 65535. +1. k will be between 1 and floor(nums.length / 3). + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays.go b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays.go new file mode 100755 index 000000000..2a945c664 --- /dev/null +++ b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays.go @@ -0,0 +1,48 @@ +package problem0689 + +func maxSumOfThreeSubarrays(nums []int, k int) []int { + n := len(nums) - k + 1 + + // sum[i] = sum(nums[i:i+k]) + sum := make([]int, n) + sumK := 0 + for i := 0; i < len(nums); i++ { + sumK += nums[i] + if i >= k { + sumK -= nums[i-k] + } + if i >= k-1 { + sum[i-k+1] = sumK + } + } + + // left[i] == j 表示,在 sum[:i+1] 中,最大值的索引号为 j + left := make([]int, n) + indexOfMax := 0 + for i := 0; i < n; i++ { + if sum[indexOfMax] < sum[i] { + indexOfMax = i + } + left[i] = indexOfMax + } + + indexOfMax = n - 1 + // right[i] == j 表示,在 sum[i:] 中,最大值的索引号为 j + right := make([]int, n) + for i := n - 1; i >= 0; i-- { + if sum[indexOfMax] < sum[i] { + indexOfMax = i + } + right[i] = indexOfMax + } + + a := []int{0, k, k + k} + for y := k ; y < n-k; y++ { + x, z := left[y-k], right[y+k] + if sum[a[0]]+sum[a[1]]+sum[a[2]] < sum[x]+sum[y]+sum[z] { + a[0], a[1], a[2] = x, y, z + } + } + + return a +} diff --git a/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays_test.go b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays_test.go new file mode 100755 index 000000000..66857085f --- /dev/null +++ b/Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays/maximum-sum-of-3-non-overlapping-subarrays_test.go @@ -0,0 +1,47 @@ +package problem0689 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans []int +}{ + + { + []int{17, 7, 19, 11, 1, 19, 17, 6, 13, 18, 2, 7, 12, 16, 16, 18, 9, 3, 19, 5}, + 6, + []int{0, 6, 13}, + }, + + { + []int{1, 2, 1, 2, 6, 7, 5, 1}, + 2, + []int{0, 3, 5}, + }, + + // 可以有多个 testcase +} + +func Test_maxSumOfThreeSubarrays(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxSumOfThreeSubarrays(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_maxSumOfThreeSubarrays(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSumOfThreeSubarrays(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0691.stickers-to-spell-word/README.md b/Algorithms/0691.stickers-to-spell-word/README.md new file mode 100755 index 000000000..2cfb60f1f --- /dev/null +++ b/Algorithms/0691.stickers-to-spell-word/README.md @@ -0,0 +1,45 @@ +# [691. Stickers to Spell Word](https://leetcode.com/problems/stickers-to-spell-word/) + +## 题目 + +We are given N different types of stickers. Each sticker has a lowercase English word on it. + +You would like to spell out the given target string by cutting individual letters from your collection of stickers and rearranging them. + +You can use each sticker more than once if you want, and you have infinite quantities of each sticker. + +What is the minimum number of stickers that you need to spell out the target? If the task is impossible, return -1. + +Example 1: + +```text +Input:["with", "example", "science"], "thehat" + +Output:3 + +Explanation:We can use 2 "with" stickers, and 1 "example" sticker. +After cutting and rearrange the letters of those stickers, we can form the target "thehat". +Also, this is the minimum number of stickers necessary to form the target string. +``` + +Example 2: + +```text +Input:["notice", "possible"], "basicbasic" + +Output:-1 + +Explanation:We can't form the target "basicbasic" from cutting letters from the given stickers. +``` + +Note: + +1. stickers has length in the range [1, 50]. +1. stickers consists of lowercase English words (without apostrophes). +1. target has length in the range [1, 15], and consists of lowercase English letters. +1. In all test cases, all words were chosen randomly from the 1000 most common US English words, and the target was chosen as a concatenation of two random words. +1. The time limit may be more challenging than usual. It is expected that a 50 sticker test case can be solved within 35ms on average. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word.go b/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word.go new file mode 100755 index 000000000..92b1a80e5 --- /dev/null +++ b/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word.go @@ -0,0 +1,78 @@ +package problem0691 + +const intMax = 1<<63 - 1 + +func minStickers(stickers []string, target string) int { + size := len(stickers) + + // ss[i][j] == k 表示 stickers[i] 有 k 个字母('a'+j) + ss := make([][]int, size) + for i := range ss { + ss[i] = make([]int, 26) + for _, c := range stickers[i] { + ss[i][c-'a']++ + } + } + + // dp["abc"] == m 表示,最少需要 m 个 sticker,可以组成 "abc" + dp := make(map[string]int, size) + dp[""] = 0 + + helper(dp, ss, target) + + return dp[target] +} + +func helper(dp map[string]int, ss [][]int, target string) int { + // 如果曾经检查过 target ,直接返回答案 + if minimum, ok := dp[target]; ok { + return minimum + } + + // 获取 target 内各个字母的个数 + tar := make([]int, 26) + for _, c := range target { + tar[c-'a']++ + } + + res := intMax + + for _, s := range ss { + // 只有当 s 包含了 target 的首字母时 + // 才从 target 中减去 s + // 这样就确保了,每次递归时候,target 都在变小 + if s[target[0]-'a'] == 0 { + continue + } + + // t = target - s + t := make([]byte, 0, len(target)) + for i := 0; i < 26; i++ { + for j := tar[i] - s[i]; 0 < j; j-- { + t = append(t, byte('a'+i)) + } + } + + // 递归求解 t + temp := helper(dp, ss, string(t)) + if temp != -1 { + res = min(res, temp+1) + } + } + + // res 依然等于 intMax 说明无法组成 target + if res == intMax { + res = -1 + } + + dp[target] = res + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word_test.go b/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word_test.go new file mode 100755 index 000000000..6776f33b4 --- /dev/null +++ b/Algorithms/0691.stickers-to-spell-word/stickers-to-spell-word_test.go @@ -0,0 +1,65 @@ +package problem0691 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stickers []string + target string + ans int +}{ + + { + []string{"thethat", "with", "example", "science"}, + "thehat", + 1, + }, + + { + []string{"t", "example", "science", "with"}, + "thehat", + 3, + }, + + { + []string{"example", "science", "with"}, + "thehat", + 3, + }, + + { + []string{"with", "example", "science"}, + "thehat", + 3, + }, + + { + []string{"notice", "possible"}, + "basicbasic", + -1, + }, + + // 可以有多个 testcase +} + +func Test_minStickers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minStickers(tc.stickers, tc.target), "输入:%v", tc) + } +} + +func Benchmark_minStickers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minStickers(tc.stickers, tc.target) + } + } +} diff --git a/Algorithms/0692.top-k-frequent-words/README.md b/Algorithms/0692.top-k-frequent-words/README.md new file mode 100755 index 000000000..d7289a731 --- /dev/null +++ b/Algorithms/0692.top-k-frequent-words/README.md @@ -0,0 +1,36 @@ +# [692. Top K Frequent Words](https://leetcode.com/problems/top-k-frequent-words/) + +## 题目 + +Given a non-empty list of words, return the k most frequent elements. + +Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then the word with the lower alphabetical order comes first. + +Example 1: + +```text +Input: ["i", "love", "leetcode", "i", "love", "coding"], k = 2 +Output: ["i", "love"] +Explanation: "i" and "love" are the two most frequent words. Note that "i" comes before "love" due to a lower alphabetical order. +``` + +Example 2: + +```text +Input: ["the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"], k = 4 +Output: ["the", "is", "sunny", "day"] +Explanation: "the", "is", "sunny" and "day" are the four most frequent words, with the number of occurrence being 4, 3, 2 and 1 respectively. +``` + +Note: + +1. You may assume k is always valid, 1 ≤ k ≤ number of unique elements. +1. Input words contain only lowercase letters. + +Follow up: + +1. Try to solve it in O(n log k) time and O(n) extra space. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0692.top-k-frequent-words/top-k-frequent-words.go b/Algorithms/0692.top-k-frequent-words/top-k-frequent-words.go new file mode 100755 index 000000000..70046e636 --- /dev/null +++ b/Algorithms/0692.top-k-frequent-words/top-k-frequent-words.go @@ -0,0 +1,49 @@ +package problem0692 + +import "sort" + +func topKFrequent(words []string, k int) []string { + count := make(map[string]int, len(words)) + for _, w := range words { + count[w]++ + } + + fw := make(freWords, 0, len(count)) + for w, c := range count { + fw = append(fw, &entry{ + word: w, + frequence: c, + }) + } + + sort.Sort(fw) + + res := make([]string, k) + for i := 0; i < k; i++ { + res[i] = fw[i].word + } + + return res +} + +// entry 是 priorityQueue 中的元素 +type entry struct { + word string + frequence int +} + +// PQ implements heap.Interface and holds entries. +type freWords []*entry + +func (f freWords) Len() int { return len(f) } + +func (f freWords) Less(i, j int) bool { + if f[i].frequence == f[j].frequence { + return f[i].word < f[j].word + } + return f[i].frequence > f[j].frequence +} + +func (f freWords) Swap(i, j int) { + f[i], f[j] = f[j], f[i] +} diff --git a/Algorithms/0692.top-k-frequent-words/top-k-frequent-words_test.go b/Algorithms/0692.top-k-frequent-words/top-k-frequent-words_test.go new file mode 100755 index 000000000..268e03248 --- /dev/null +++ b/Algorithms/0692.top-k-frequent-words/top-k-frequent-words_test.go @@ -0,0 +1,47 @@ +package problem0692 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + k int + ans []string +}{ + + { + []string{"i", "love", "leetcode", "i", "love", "coding"}, + 2, + []string{"i", "love"}, + }, + + { + []string{"the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"}, + 4, + []string{"the", "is", "sunny", "day"}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, topKFrequent(tc.words, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + topKFrequent(tc.words, tc.k) + } + } +} diff --git a/Algorithms/0693.binary-number-with-alternating-bits/README.md b/Algorithms/0693.binary-number-with-alternating-bits/README.md new file mode 100755 index 000000000..fd63a25e4 --- /dev/null +++ b/Algorithms/0693.binary-number-with-alternating-bits/README.md @@ -0,0 +1,45 @@ +# [693. Binary Number with Alternating Bits](https://leetcode.com/problems/binary-number-with-alternating-bits/) + +## 题目 + +Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. + +Example 1: + +```text +Input: 5 +Output: True +Explanation: +The binary representation of 5 is: 101 +``` + +Example 2: + +```text +Input: 7 +Output: False +Explanation: +The binary representation of 7 is: 111. +``` + +Example 3: + +```text +Input: 11 +Output: False +Explanation: +The binary representation of 11 is: 1011. +``` + +Example 4: + +```text +Input: 10 +Output: True +Explanation: +The binary representation of 10 is: 1010. +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits.go b/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits.go new file mode 100755 index 000000000..e70bdb711 --- /dev/null +++ b/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits.go @@ -0,0 +1,17 @@ +package problem0693 + +func hasAlternatingBits(n int) bool { + std := n & 3 + if std != 1 && std != 2 { + return false + } + + for n > 0 { + if n&3 != std { + return false + } + n >>= 2 + } + + return true +} diff --git a/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits_test.go b/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits_test.go new file mode 100755 index 000000000..bae2cb2b7 --- /dev/null +++ b/Algorithms/0693.binary-number-with-alternating-bits/binary-number-with-alternating-bits_test.go @@ -0,0 +1,64 @@ +package problem0693 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans bool +}{ + + { + 5, + true, + }, + + { + 3, + false, + }, + + { + 213, + false, + }, + + { + 7, + false, + }, + + { + 11, + false, + }, + + { + 10, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hasAlternatingBits(tc.n), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hasAlternatingBits(tc.n) + } + } +} diff --git a/Algorithms/0695.max-area-of-island/README.md b/Algorithms/0695.max-area-of-island/README.md new file mode 100755 index 000000000..32317cceb --- /dev/null +++ b/Algorithms/0695.max-area-of-island/README.md @@ -0,0 +1,34 @@ +# [695. Max Area of Island](https://leetcode.com/problems/max-area-of-island/) + +## 题目 + +Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. + +Find the maximum area of an island in the given 2D array. (If there is no island, the maximum area is 0.) + +Example 1: + +```text +[[0,0,1,0,0,0,0,1,0,0,0,0,0], + [0,0,0,0,0,0,0,1,1,1,0,0,0], + [0,1,1,0,1,0,0,0,0,0,0,0,0], + [0,1,0,0,1,1,0,0,1,0,1,0,0], + [0,1,0,0,1,1,0,0,1,1,1,0,0], + [0,0,0,0,0,0,0,0,0,0,1,0,0], + [0,0,0,0,0,0,0,1,1,1,0,0,0], + [0,0,0,0,0,0,0,1,1,0,0,0,0]] +Given the above grid, return 6. Note the answer is not 11, because the island must be connected 4-directionally. +``` + +Example 2: + +```text +[[0,0,0,0,0,0,0,0]] +Given the above grid, return 0. +``` + +Note: The length of each dimension in the given grid does not exceed 50. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0695.max-area-of-island/max-area-of-island.go b/Algorithms/0695.max-area-of-island/max-area-of-island.go new file mode 100755 index 000000000..1d82bb977 --- /dev/null +++ b/Algorithms/0695.max-area-of-island/max-area-of-island.go @@ -0,0 +1,46 @@ +package problem0695 + +func maxAreaOfIsland(grid [][]int) int { + maxArea := 0 + for i := range grid { + for j := range grid[i] { + maxArea = max(maxArea, getArea(grid, i, j)) + } + } + return maxArea +} + +// 返回与 [i,j] 处联通的岛的面积 +func getArea(grid [][]int, i, j int) int { + if grid[i][j] == 0 { + return 0 + } + + grid[i][j] = 0 + area := 1 + + if i != 0 { + area += getArea(grid, i-1, j) + } + + if j != 0 { + area += getArea(grid, i, j-1) + } + + if i != len(grid)-1 { + area += getArea(grid, i+1, j) + } + + if j != len(grid[0])-1 { + area += getArea(grid, i, j+1) + } + + return area +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0695.max-area-of-island/max-area-of-island_test.go b/Algorithms/0695.max-area-of-island/max-area-of-island_test.go new file mode 100755 index 000000000..0f14a0009 --- /dev/null +++ b/Algorithms/0695.max-area-of-island/max-area-of-island_test.go @@ -0,0 +1,72 @@ +package problem0695 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{ + {1, 1, 0, 0, 0}, + {1, 1, 0, 0, 0}, + {0, 0, 0, 1, 1}, + {0, 0, 0, 1, 1}, + }, + 4, + }, + + { + [][]int{ + {1}, + }, + 1, + }, + + { + [][]int{ + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + 0, + }, + + { + [][]int{ + {0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}, + {0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0}, + {0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0}, + }, + 6, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxAreaOfIsland(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxAreaOfIsland(tc.grid) + } + } +} diff --git a/Algorithms/0696.count-binary-substrings/README.md b/Algorithms/0696.count-binary-substrings/README.md new file mode 100755 index 000000000..4bd0c019a --- /dev/null +++ b/Algorithms/0696.count-binary-substrings/README.md @@ -0,0 +1,36 @@ +# [696. Count Binary Substrings](https://leetcode.com/problems/count-binary-substrings/) + +## 题目 + +Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively. + +Substrings that occur multiple times are counted the number of times they occur. + +Example 1: + +```text +Input: "00110011" +Output: 6 +Explanation: There are 6 substrings that have equal number of consecutive 1's and 0's: "0011", "01", "1100", "10", "0011", and "01". + +Notice that some of these substrings repeat and are counted the number of times they occur. + +Also, "00110011" is not a valid substring because all the 0's (and 1's) are not grouped together. +``` + +Example 2: + +```text +Input: "10101" +Output: 4 +Explanation: There are 4 substrings: "10", "01", "10", "01" that have equal number of consecutive 1's and 0's. +``` + +Note: + +- s.length will be between 1 and 50,000. +- s will only consist of "0" or "1" characters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0696.count-binary-substrings/count-binary-substrings.go b/Algorithms/0696.count-binary-substrings/count-binary-substrings.go new file mode 100755 index 000000000..ef30873fb --- /dev/null +++ b/Algorithms/0696.count-binary-substrings/count-binary-substrings.go @@ -0,0 +1,35 @@ +package problem0696 + +func countBinarySubstrings(s string) int { + count, countZero, countOne := 0, 0, 0 + prev := rune(s[0]) + + for _, r := range s { + if prev == r { + if r == '0' { + countZero++ + } else { + countOne++ + } + } else { + // 较少的数字决定了符合题意的子字符串个数 + // 例如 "00011" 符合题意的子字符串为 "0011", "01",其中第一个 "0" 是无用的 + count += min(countZero, countOne) + if r == '0' { + countZero = 1 + } else { + countOne = 1 + } + } + prev = r + } + + return count + min(countZero, countOne) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0696.count-binary-substrings/count-binary-substrings_test.go b/Algorithms/0696.count-binary-substrings/count-binary-substrings_test.go new file mode 100755 index 000000000..9d67f4d16 --- /dev/null +++ b/Algorithms/0696.count-binary-substrings/count-binary-substrings_test.go @@ -0,0 +1,49 @@ +package problem0696 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "00110011", + 6, + }, + + { + "00110", + 3, + }, + + { + "10101", + 4, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countBinarySubstrings(tc.s), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countBinarySubstrings(tc.s) + } + } +} diff --git a/Algorithms/0697.degree-of-an-array/README.md b/Algorithms/0697.degree-of-an-array/README.md new file mode 100755 index 000000000..3718294d8 --- /dev/null +++ b/Algorithms/0697.degree-of-an-array/README.md @@ -0,0 +1,35 @@ +# [697. Degree of an Array](https://leetcode.com/problems/degree-of-an-array/) + +## 题目 + +Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. + +Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums. + +Example 1: + +```text +Input: [1, 2, 2, 3, 1] +Output: 2 +Explanation: +The input array has a degree of 2 because both elements 1 and 2 appear twice. +Of the subarrays that have the same degree: +[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2] +The shortest length is 2. So return 2. +``` + +Example 2: + +```text +Input: [1,2,2,3,1,4,2] +Output: 6 +``` + +Note: + +- nums.length will be between 1 and 50,000. +- nums[i] will be an integer between 0 and 49,999. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0697.degree-of-an-array/degree-of-an-array.go b/Algorithms/0697.degree-of-an-array/degree-of-an-array.go new file mode 100755 index 000000000..75be1f2cd --- /dev/null +++ b/Algorithms/0697.degree-of-an-array/degree-of-an-array.go @@ -0,0 +1,31 @@ +package problem0697 + +func findShortestSubArray(nums []int) int { + size := len(nums) + if size < 2 { + return size + } + + first := make(map[int]int, size) + count := make(map[int]int, size) + maxCount := 1 + minLen := size + for i, n := range nums { + count[n]++ + if count[n] == 1 { + first[n] = i + } else { + l := i - first[n] + 1 + if maxCount < count[n] || + (maxCount == count[n] && minLen > l) { + maxCount = count[n] + minLen = l + } + } + } + + if len(count) == size { + return 1 + } + return minLen +} diff --git a/Algorithms/0697.degree-of-an-array/degree-of-an-array_test.go b/Algorithms/0697.degree-of-an-array/degree-of-an-array_test.go new file mode 100755 index 000000000..c48635426 --- /dev/null +++ b/Algorithms/0697.degree-of-an-array/degree-of-an-array_test.go @@ -0,0 +1,54 @@ +package problem0697 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{4}, + 1, + }, + + { + []int{1, 2, 3, 4}, + 1, + }, + + { + []int{1, 2, 2, 3, 1}, + 2, + }, + + { + []int{1, 2, 2, 3, 1, 4, 2}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findShortestSubArray(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findShortestSubArray(tc.nums) + } + } +} diff --git a/Algorithms/0698.partition-to-k-equal-sum-subsets/README.md b/Algorithms/0698.partition-to-k-equal-sum-subsets/README.md new file mode 100755 index 000000000..a29a7f069 --- /dev/null +++ b/Algorithms/0698.partition-to-k-equal-sum-subsets/README.md @@ -0,0 +1,22 @@ +# [698. Partition to K Equal Sum Subsets](https://leetcode.com/problems/partition-to-k-equal-sum-subsets/) + +## 题目 + +Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal. + +Example 1: + +```text +Input: nums = [4, 3, 2, 3, 5, 2, 1], k = 4 +Output: True +Explanation: It's possible to divide it into 4 subsets (5), (1, 4), (2,3), (2,3) with equal sums. +``` + +Note: + +1. 1 <= k <= len(nums) <= 16. +1. 0 < nums[i] < 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets.go b/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets.go new file mode 100755 index 000000000..98516c7f4 --- /dev/null +++ b/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets.go @@ -0,0 +1,57 @@ +package problem0698 + +import ( + "sort" +) + +func canPartitionKSubsets(nums []int, k int) bool { + size := len(nums) + sum := 0 + max := nums[0] + for _, n := range nums { + sum += n + if max < n { + max = n + } + } + + if sum%k != 0 || sum/k < max { + // 提前结束 + return false + } + + // nums 降序排列可以加快 dfs 的速度 + sort.Sort(sort.Reverse(sort.IntSlice(nums))) + + // isUsed[i] == true 表示 nums[i] 已经被归类到某个小组,无法再使用了 + isUsed := make([]bool, size) + + return dfs(nums, isUsed, k, 0, 0, sum/k) +} + +func dfs(nums []int, isUsed []bool, k, start, sum, target int) bool { + if k == 1 { + // 已经找到了 k-1 组解 + // 剩下的自然就是第 k 组解 + return true + } + + if sum == target { + // 找到第 k 组的一种解 + // 开始搜索 k-1 组的解 + return dfs(nums, isUsed, k-1, 0, 0, target) + } + + for i := start; i < len(nums); i++ { + if !isUsed[i] && sum+nums[i] <= target { + isUsed[i] = true + // 试着 sum+nums[i] + if dfs(nums, isUsed, k, i+1, sum+nums[i], target) { + return true + } + isUsed[i] = false + } + } + + return false +} diff --git a/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets_test.go b/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets_test.go new file mode 100755 index 000000000..ee40eaef2 --- /dev/null +++ b/Algorithms/0698.partition-to-k-equal-sum-subsets/partition-to-k-equal-sum-subsets_test.go @@ -0,0 +1,53 @@ +package problem0698 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans bool +}{ + + { + []int{5, 4, 4, 4, 3}, + 4, + false, + }, + + { + []int{4, 1, 1, 1}, + 4, + false, + }, + + { + []int{4, 3, 2, 3, 5, 2, 1}, + 4, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canPartitionKSubsets(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canPartitionKSubsets(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0699.falling-squares/README.md b/Algorithms/0699.falling-squares/README.md new file mode 100755 index 000000000..3d17cf037 --- /dev/null +++ b/Algorithms/0699.falling-squares/README.md @@ -0,0 +1,64 @@ +# [699. Falling Squares](https://leetcode.com/problems/falling-squares/) + +## 题目 + +On an infinite number line (x-axis), we drop given squares in the order they are given. +The i-th square dropped (positions[i] = (left, side_length)) is a square with the left-most point being positions[i][0] and sidelength positions[i][1]. +The square is dropped with the bottom edge parallel to the number line, and from a higher height than all currently landed squares. We wait for each square to stick before dropping the next. +The squares are infinitely sticky on their bottom edge, and will remain fixed to any positive length surface they touch (either the number line or another square). Squares dropped adjacent to each other will not stick together prematurely. + +Return a list ans of heights. Each height ans[i] represents the current highest height of any square we have dropped, after dropping squares represented by positions[0], positions[1], ..., positions[i]. + +Example 1: + +```text +Input: [[1, 2], [2, 3], [6, 1]] +Output: [2, 5, 5] +Explanation: + +After the first drop of positions[0] = [1, 2]: +_aa +_aa +------- +The maximum height of any square is 2. + +After the second drop of positions[1] = [2, 3]: +__aaa +__aaa +__aaa +_aa__ +_aa__ +-------------- +The maximum height of any square is 5. +The larger square stays on top of the smaller square despite where its center +of gravity is, because squares are infinitely sticky on their bottom edge. + +After the third drop of positions[1] = [6, 1]: +__aaa +__aaa +__aaa +_aa +_aa___a +-------------- +The maximum height of any square is still 5. + +Thus, we return an answer of [2, 5, 5]. +``` + +Example 2: + +```text +Input: [[100, 100], [200, 100]] +Output: [100, 100] +Explanation: Adjacent squares don't get stuck prematurely - only their bottom edge can stick to surfaces. +``` + +Note: + +- 1 <= positions.length <= 1000. +- 1 <= positions[i][0] <= 10^8. +- 1 <= positions[i][1] <= 10^6. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0699.falling-squares/falling-squares.go b/Algorithms/0699.falling-squares/falling-squares.go new file mode 100755 index 000000000..c33792f1a --- /dev/null +++ b/Algorithms/0699.falling-squares/falling-squares.go @@ -0,0 +1,137 @@ +package problem0699 + +import "container/heap" + +func fallingSquares(positions [][]int) []int { + res := make([]int, 0, len(positions)) + pq := make(PQ, 0, len(positions)) + + for i := 0; i < len(positions); i++ { + sp := &segment{ + left: positions[i][0], + right: positions[i][0] + positions[i][1], + height: positions[i][1], + } + + height := 0 + removes := make([]*segment, 0, len(pq)) + + // TODO: 添加一个 []*segment 变量,按宽度维护好 + // 避免,遍历 pq + // + // l, r := getLeft(ss, sp), getRight(ss, sp) + // for j := l; j <= r; j++ { + // } + + for j := 0; j < len(pq); j++ { + if pq[j].right <= sp.left || sp.right <= pq[j].left { + continue + } + + height = max(height, pq[j].height) + + if sp.left <= pq[j].left && pq[j].right <= sp.right { + removes = append(removes, pq[j]) + } + + if pq[j].left < sp.left && sp.right < pq[j].right { + heap.Push(&pq, &segment{ + left: sp.right, + right: pq[j].right, + height: pq[j].height, + }) + pq[j].right = sp.left + break + } + + if pq[j].left < sp.left && sp.left < pq[j].right && pq[j].right <= sp.right { + pq[j].right = sp.left + } + + if sp.left <= pq[j].left && pq[j].left < sp.right && sp.right < pq[j].right { + pq[j].left = sp.right + } + } + + for j := 0; j < len(removes); j++ { + heap.Remove(&pq, removes[j].index) + } + + sp.height += height + heap.Push(&pq, sp) + res = append(res, pq[0].height) + } + + return res +} + +// entry 是 priorityQueue 中的元素 +type segment struct { + left, right int + height int + // index 是 entry 在 heap 中的索引号 + index int +} + +// PQ implements heap.Interface and holds entries. +type PQ []*segment + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i].height > pq[j].height +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + temp := x.(*segment) + temp.index = len(*pq) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + temp.index = -1 // for safety + *pq = (*pq)[0 : len(*pq)-1] + return temp +} + +// func getLeft(ss []*segment, s *segment) int { +// lo, hi := 0, len(ss)-1 +// for lo < hi { +// mid := lo + (hi-lo)/2 +// if ss[mid].right <= s.left { +// lo = mid + 1 +// } else { +// hi = mid - 1 +// } +// } +// return lo +// } + +// func getRight(ss []*segment, s *segment) int { +// lo, hi := 0, len(ss)-1 +// for lo < hi { +// mid := lo + (hi-lo)/2 +// if s.right <= ss[mid].left { +// hi = mid - 1 +// } else { +// lo = mid + 1 +// } +// } +// return hi +// } + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0699.falling-squares/falling-squares_test.go b/Algorithms/0699.falling-squares/falling-squares_test.go new file mode 100755 index 000000000..665821937 --- /dev/null +++ b/Algorithms/0699.falling-squares/falling-squares_test.go @@ -0,0 +1,59 @@ +package problem0699 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + positions [][]int + ans []int +}{ + + { + [][]int{{33, 34}, {47, 62}, {70, 16}, {90, 79}, {73, 86}, {55, 6}, {74, 2}, {40, 95}, {52, 16}, {50, 33}}, + []int{34, 96, 112, 175, 261, 261, 263, 358, 374, 407}, + }, + + { + [][]int{{1, 2}, {2, 3}, {6, 1}}, + []int{2, 5, 5}, + }, + + { + [][]int{{100, 100}, {200, 100}}, + []int{100, 100}, + }, + + { + [][]int{{1, 2}, {3, 3}, {2, 3}, {6, 1}}, + []int{2, 3, 6, 6}, + }, + + { + [][]int{{1, 2}, {4, 3}, {2, 4}, {6, 1}}, + []int{2, 3, 7, 7}, + }, + + // 可以有多个 testcase +} + +func Test_fallingSquares(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fallingSquares(tc.positions), "输入:%v", tc) + } +} + +func Benchmark_fallingSquares(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fallingSquares(tc.positions) + } + } +} diff --git a/Algorithms/0700.search-in-a-binary-search-tree/README.md b/Algorithms/0700.search-in-a-binary-search-tree/README.md new file mode 100755 index 000000000..bf35cf755 --- /dev/null +++ b/Algorithms/0700.search-in-a-binary-search-tree/README.md @@ -0,0 +1,34 @@ +# [700. Search in a Binary Search Tree](https://leetcode.com/problems/search-in-a-binary-search-tree/) + +## 题目 + +Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If such node doesn't exist, you should return NULL. + +For example, + +```text +Given the tree: + 4 + / \ + 2 7 + / \ + 1 3 + +And the value to search: 2 +``` + +```text +You should return this subtree: + + 2 + / \ + 1 3 +``` + +In the example above, if we want to search the value 5, since there is no node with value 5, we should return NULL. + +Note that an empty tree is represented by NULL, therefore you would see the expected output (serialized tree format) as[], not null. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree.go b/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree.go new file mode 100755 index 000000000..f2cafce0d --- /dev/null +++ b/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree.go @@ -0,0 +1,29 @@ +package problem0700 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ + +// TreeNode 是预定义的类型 +type TreeNode = kit.TreeNode + +func searchBST(root *TreeNode, val int) *TreeNode { + if root == nil { + return nil + } + switch { + case root.Val < val: + return searchBST(root.Right, val) + case val < root.Val: + return searchBST(root.Left, val) + default: + return root + } +} diff --git a/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree_test.go b/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree_test.go new file mode 100755 index 000000000..a96776929 --- /dev/null +++ b/Algorithms/0700.search-in-a-binary-search-tree/search-in-a-binary-search-tree_test.go @@ -0,0 +1,52 @@ +package problem0700 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + val int + ans []int +}{ + + { + []int{4, 2, 7, 1, 3}, + 6, + nil, + }, + + { + []int{4, 2, 7, 1, 3}, + 2, + []int{2, 1, 3}, + }, + + // 可以有多个 testcase +} + +func Test_searchBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2TreeNode(tc.root) + ans := kit.Tree2Preorder(searchBST(root, tc.val)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_searchBST(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + searchBST(root, tc.val) + } + } +} diff --git a/Algorithms/0701.insert-into-a-binary-search-tree/README.md b/Algorithms/0701.insert-into-a-binary-search-tree/README.md new file mode 100755 index 000000000..62835acce --- /dev/null +++ b/Algorithms/0701.insert-into-a-binary-search-tree/README.md @@ -0,0 +1,45 @@ +# [701. Insert into a Binary Search Tree](https://leetcode.com/problems/insert-into-a-binary-search-tree/) + +## 题目 + +Given the root node of a binary search tree (BST) and a value to be inserted into the tree,insert the value into the BST. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST. + +Note that there may existmultiple valid ways for theinsertion, as long as the tree remains a BST after insertion. You can return any of them. + +For example, + +```text +Given the tree: + 4 + / \ + 2 7 + / \ + 1 3 +And the value to insert: 5 +``` + +```text +You can return this binary search tree: + + 4 + / \ + 2 7 + / \ / + 1 3 5 +``` + +This tree is also valid: + +```text + 5 + / \ + 2 7 + / \ + 1 3 + \ + 4 +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree.go b/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree.go new file mode 100755 index 000000000..f1849e8ce --- /dev/null +++ b/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree.go @@ -0,0 +1,33 @@ +package problem0701 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ + +// TreeNode 是预定义的结构体 +type TreeNode = kit.TreeNode + +func insertIntoBST(root *TreeNode, val int) *TreeNode { + if root == nil { + return &TreeNode{ + Val: val, + } + } + + if root.Val <= val { + root.Right = insertIntoBST(root.Right, val) + } else { + root.Left = insertIntoBST(root.Left, val) + } + + return root +} diff --git a/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree_test.go b/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree_test.go new file mode 100755 index 000000000..68fa0cc1a --- /dev/null +++ b/Algorithms/0701.insert-into-a-binary-search-tree/insert-into-a-binary-search-tree_test.go @@ -0,0 +1,52 @@ +package problem0701 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + val int + ans []int +}{ + + { + nil, + 4, + []int{4}, + }, + + { + []int{4, 2, 7, 1, 3}, + 5, + []int{4, 2, 1, 3, 7, 5}, // preorder + }, + + // 可以有多个 testcase +} + +func Test_insertIntoBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2TreeNode(tc.root) + ans := kit.Tree2Preorder(insertIntoBST(root, tc.val)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_insertIntoBST(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + insertIntoBST(root, tc.val) + } + } +} diff --git a/Algorithms/0703.kth-largest-element-in-a-stream/README.md b/Algorithms/0703.kth-largest-element-in-a-stream/README.md new file mode 100755 index 000000000..8429d307e --- /dev/null +++ b/Algorithms/0703.kth-largest-element-in-a-stream/README.md @@ -0,0 +1,25 @@ +# [703. Kth Largest Element in a Stream](https://leetcode.com/problems/kth-largest-element-in-a-stream/) + +## 题目 + +Design a class to findthe kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. + +YourKthLargestclass will have a constructor which accepts an integer k and an integer array nums, which contains initial elements fromthe stream. For each call to the method KthLargest.add, return the element representing the kth largest element in the stream. + +Example: + +int k = 3; +int[] arr = [4,5,8,2]; +KthLargest kthLargest = new KthLargest(3, arr); +kthLargest.add(3); // returns 4 +kthLargest.add(5); // returns 5 +kthLargest.add(10); // returns 5 +kthLargest.add(9); // returns 8 +kthLargest.add(4); // returns 8 + +Note: +You may assume thatnums' length>=k-1and k >=1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream.go b/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream.go new file mode 100755 index 000000000..605ab91d5 --- /dev/null +++ b/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream.go @@ -0,0 +1,66 @@ +package problem0703 + +import ( + "container/heap" +) + +// KthLargest object will be instantiated and called as such: +// obj := Constructor(k, nums); +// param_1 := obj.Add(val); +type KthLargest struct { + k int + heap intHeap +} + +// Constructor 创建 KthLargest +func Constructor(k int, nums []int) KthLargest { + h := intHeap(nums) + heap.Init(&h) + + for len(h) > k { + heap.Pop(&h) + } + + return KthLargest{ + k: k, + heap: h, + } +} + +// Add 负责添加元素 +func (kl *KthLargest) Add(val int) int { + heap.Push(&kl.heap, val) + + if len(kl.heap) > kl.k { + heap.Pop(&kl.heap) + } + + return kl.heap[0] +} + +type intHeap []int + +func (h intHeap) Len() int { + return len(h) +} + +func (h intHeap) Less(i, j int) bool { + return h[i] < h[j] +} + +func (h intHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} +func (h *intHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *intHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[:len(*h)-1] + return res +} diff --git a/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream_test.go b/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream_test.go new file mode 100755 index 000000000..96e3fbd4e --- /dev/null +++ b/Algorithms/0703.kth-largest-element-in-a-stream/kth-largest-element-in-a-stream_test.go @@ -0,0 +1,41 @@ +package problem0703 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_kthLargest(t *testing.T) { + ast := assert.New(t) + k := 3 + nums := []int{4, 5, 8, 2} + + kl := Constructor(k, nums) + + adds := []int{3, 5, 10, 9, 4} + rets := []int{4, 5, 5, 8, 8} + + for i := range adds { + expected := rets[i] + actual := kl.Add(adds[i]) + ast.Equal(expected, actual, "kl.Add(%d) != %d\n", adds[i], expected) + } +} + +func Test_kthLargest_2(t *testing.T) { + ast := assert.New(t) + k := 1 + nums := []int{} + + kl := Constructor(k, nums) + + adds := []int{-3, -2, -4, 0, 4} + rets := []int{-3, -2, -2, 0, 4} + + for i := range adds { + expected := rets[i] + actual := kl.Add(adds[i]) + ast.Equal(expected, actual, "kl.Add(%d) != %d\n", adds[i], expected) + } +} diff --git a/Algorithms/0704.binary-search/README.md b/Algorithms/0704.binary-search/README.md new file mode 100755 index 000000000..9bacae75d --- /dev/null +++ b/Algorithms/0704.binary-search/README.md @@ -0,0 +1,31 @@ +# [704. Binary Search](https://leetcode.com/problems/binary-search/) + +## 题目 + +Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, then return its index, otherwise return -1. + +Example 1: + +```text +Input: nums = [-1,0,3,5,9,12], target = 9 +Output: 4 +Explanation: 9 exists in nums and its index is 4 +``` + +Example 2: + +```text +Input: nums = [-1,0,3,5,9,12], target = 2 +Output: -1 +Explanation: 2 does not exist in nums so return -1 +``` + +Note: + +1. You may assume that all elements in nums are unique. +1. n will be in the range [1, 10000]. +1. The value of each element in nums will be in the range [-9999, 9999]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0704.binary-search/binary-search.go b/Algorithms/0704.binary-search/binary-search.go new file mode 100755 index 000000000..ed0790e90 --- /dev/null +++ b/Algorithms/0704.binary-search/binary-search.go @@ -0,0 +1,19 @@ +package problem0704 + +func search(a []int, target int) int { + l, r := 0, len(a)-1 + + for l <= r { + m := (l + r) / 2 + switch { + case a[m] < target: + l = m + 1 + case target < a[m]: + r = m - 1 + default: + return m + } + } + + return -1 +} diff --git a/Algorithms/0704.binary-search/binary-search_test.go b/Algorithms/0704.binary-search/binary-search_test.go new file mode 100755 index 000000000..9f278e682 --- /dev/null +++ b/Algorithms/0704.binary-search/binary-search_test.go @@ -0,0 +1,47 @@ +package problem0704 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + target int + ans int +}{ + + { + []int{-1, 0, 3, 5, 9, 12}, + 9, + 4, + }, + + { + []int{-1, 0, 3, 5, 9, 12}, + 2, + -1, + }, + + // 可以有多个 testcase +} + +func Test_search(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, search(tc.nums, tc.target), "输入:%v", tc) + } +} + +func Benchmark_search(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + search(tc.nums, tc.target) + } + } +} diff --git a/Algorithms/0705.design-hashset/README.md b/Algorithms/0705.design-hashset/README.md new file mode 100755 index 000000000..6177a0369 --- /dev/null +++ b/Algorithms/0705.design-hashset/README.md @@ -0,0 +1,35 @@ +# [705. Design HashSet](https://leetcode.com/problems/design-hashset/) + +## 题目 + +Design a HashSetwithout using any built-in hash table libraries. + +To be specific, your design should include these functions: + +- add(value):Insert a value into the HashSet. +- contains(value) : Return whether the value exists in the HashSet or not. +- remove(value): Remove a value inthe HashSet. If the value does not exist in the HashSet, do nothing. + +Example: + +```text +MyHashSet hashSet = new MyHashSet(); +hashSet.add(1); +hashSet.add(2); +hashSet.contains(1); // returns true +hashSet.contains(3); // returns false (not found) +hashSet.add(2); +hashSet.contains(2); // returns true +hashSet.remove(2); +hashSet.contains(2); // returns false (already removed) +``` + +Note: + +- All values will be in the range of [0, 1000000]. +- The number of operations will be in the range of[1, 10000]. +- Please do not use the built-in HashSet library. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0705.design-hashset/design-hashset.go b/Algorithms/0705.design-hashset/design-hashset.go new file mode 100755 index 000000000..b604c9fe3 --- /dev/null +++ b/Algorithms/0705.design-hashset/design-hashset.go @@ -0,0 +1,30 @@ +package problem0705 + +// MyHashSet object will be instantiated and called as such: +// obj := Constructor(); +// obj.Add(key); +// obj.Remove(key); +// param_3 := obj.Contains(key); +type MyHashSet struct { + table []bool +} + +// Constructor initialize your data structure here. */ +func Constructor() MyHashSet { + return MyHashSet{table: make([]bool, 1000001)} +} + +// Add 添加 key +func (s *MyHashSet) Add(key int) { + s.table[key] = true +} + +// Remove 移除 key +func (s *MyHashSet) Remove(key int) { + s.table[key] = false +} + +// Contains returns true if this set contains the specified element */ +func (s *MyHashSet) Contains(key int) bool { + return s.table[key] +} diff --git a/Algorithms/0705.design-hashset/design-hashset_test.go b/Algorithms/0705.design-hashset/design-hashset_test.go new file mode 100755 index 000000000..859b44c43 --- /dev/null +++ b/Algorithms/0705.design-hashset/design-hashset_test.go @@ -0,0 +1,29 @@ +package problem0705 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + s := Constructor() + + s.Add(1) + s.Add(2) + + ast.True(s.Contains(1)) + + ast.False(s.Contains(3)) + + s.Add(2) + + ast.True(s.Contains(2)) + + s.Remove(2) + + ast.False(s.Contains(2)) + +} diff --git a/Algorithms/0706.design-hashmap/README.md b/Algorithms/0706.design-hashmap/README.md new file mode 100755 index 000000000..32248a9ed --- /dev/null +++ b/Algorithms/0706.design-hashmap/README.md @@ -0,0 +1,35 @@ +# [706. Design HashMap](https://leetcode.com/problems/design-hashmap/) + +## 题目 + +Design a HashMapwithout using any built-in hash table libraries. + +To be specific, your design should include these functions: + +- put(key, value) :Insert a (key, value) pair into the HashMap. If the value already exists in the HashMap, update the value. +- get(key): Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key. +- remove(key) :Remove the mapping for the value key if this map contains the mapping for the key. + +Example: + +```text +MyHashMap hashMap = new MyHashMap(); +hashMap.put(1, 1); +hashMap.put(2, 2); +hashMap.get(1); // returns 1 +hashMap.get(3); // returns -1 (not found) +hashMap.put(2, 1); // update the existing value +hashMap.get(2); // returns 1 +hashMap.remove(2); // remove the mapping for 2 +hashMap.get(2); // returns -1 (not found) +``` + +Note: + +- All keys and values will be in the range of [0, 1000000]. +- The number of operations will be in the range of[1, 10000]. +- Please do not use the built-in HashMap library. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0706.design-hashmap/design-hashmap.go b/Algorithms/0706.design-hashmap/design-hashmap.go new file mode 100755 index 000000000..52ed0910a --- /dev/null +++ b/Algorithms/0706.design-hashmap/design-hashmap.go @@ -0,0 +1,37 @@ +package problem0706 + +// NOTICE: 120 ms 的答案,使用了内置的数据结构 map,违反了题目的要求 + +// MyHashMap object will be instantiated and called as such: +// obj := Constructor(); +// obj.Put(key,value); +// param_2 := obj.Get(key); +// obj.Remove(key); +type MyHashMap struct { + table []int +} + +// Constructor initialize your data structure here. */ +func Constructor() MyHashMap { + return MyHashMap{ + table: make([]int, 1000001), + } +} + +// Put value will always be non-negative. */ +func (m *MyHashMap) Put(key int, value int) { + // value + 1 是为了让 m.table 的默认值 0 和 value+1 的取值范围区分开。 + // m.table[key] = 0 就表示了 key 没有对应值 + // m.table[key] = 1 表示,key 有对应的值是 1-1 = 0 + m.table[key] = value + 1 +} + +// Get returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key +func (m *MyHashMap) Get(key int) int { + return m.table[key] - 1 +} + +// Remove the mapping of the specified value key if this map contains a mapping for the key +func (m *MyHashMap) Remove(key int) { + m.table[key] = 0 +} diff --git a/Algorithms/0706.design-hashmap/design-hashmap_test.go b/Algorithms/0706.design-hashmap/design-hashmap_test.go new file mode 100755 index 000000000..2022f5585 --- /dev/null +++ b/Algorithms/0706.design-hashmap/design-hashmap_test.go @@ -0,0 +1,29 @@ +package problem0706 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + m := Constructor() + + m.Put(1, 1) + + m.Put(2, 2) + + ast.Equal(1, m.Get(1)) + + ast.Equal(-1, m.Get(3)) + + m.Put(2, 1) + + ast.Equal(1, m.Get(2)) + + m.Remove(2) + + ast.Equal(-1, m.Get(2)) +} diff --git a/Algorithms/0707.design-linked-list/README.md b/Algorithms/0707.design-linked-list/README.md new file mode 100755 index 000000000..cc5b34a4f --- /dev/null +++ b/Algorithms/0707.design-linked-list/README.md @@ -0,0 +1,35 @@ +# [707. Design Linked List](https://leetcode.com/problems/design-linked-list/) + +## 题目 + +Design yourimplementation of the linked list. You can choose to use the singly linked list or the doubly linked list. A node in a singlylinked list should have two attributes: valand next. val is the value of the current node, and nextisapointer/reference to the next node. If you want to use the doubly linked list,you will needone more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed. + +Implement these functions in your linked list class: + +- get(index) : Get the value ofthe index-thnode in the linked list. If the index is invalid, return -1. +- addAtHead(val) : Add a node of value valbefore the first element of the linked list. After the insertion, the new node will be the first node of the linked list. +- addAtTail(val) : Append a node of value valto the last element of the linked list. +- addAtIndex(index, val) : Add a node of value valbefore the index-thnode in the linked list.If indexequalsto the length oflinked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. +- deleteAtIndex(index) : Deletethe index-thnode in the linked list, if the index is valid. + +Example: + +```text +MyLinkedList linkedList = new MyLinkedList(); +linkedList.addAtHead(1); +linkedList.addAtTail(3); +linkedList.addAtIndex(1, 2); // linked list becomes 1->2->3 +linkedList.get(1); // returns 2 +linkedList.deleteAtIndex(1); // now the linked list is 1->3 +linkedList.get(1); // returns 3 +``` + +Note: + +- All values will be in the range of [1, 1000]. +- The number of operations will be in the range of[1, 1000]. +- Please do not use the built-in LinkedList library. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0707.design-linked-list/design-linked-list.go b/Algorithms/0707.design-linked-list/design-linked-list.go new file mode 100755 index 000000000..67cd7fc1f --- /dev/null +++ b/Algorithms/0707.design-linked-list/design-linked-list.go @@ -0,0 +1,161 @@ +package problem0707 + +// MyLinkedList object will be instantiated and called as such: +// obj := Constructor(); +// param_1 := obj.Get(index); +// obj.AddAtHead(val); +// obj.AddAtTail(val); +// obj.AddAtIndex(index,val); +// obj.DeleteAtIndex(index); +type MyLinkedList struct { + size int + head, tail *node +} + +type node struct { + val int + next *node +} + +// Constructor initialize your data structure here. */ +func Constructor() MyLinkedList { + t := &node{} + h := &node{next: t} + // 把 head 和 tail 分别用空 node 单独表示 + // 会让 AddAtHead 和 AddAtTail 的逻辑非常简单 + // 可以试着让 size = 0 的时候, head 与 tail 为 nil + // 看看程序的结构有多复杂 + return MyLinkedList{ + head: h, + tail: t, + } +} + +// Get the value of the index-th node in the linked list. If the index is invalid, return -1. */ +func (l *MyLinkedList) Get(index int) int { + if index < 0 || l.size <= index { + return -1 + } + i, cur := 0, l.head.next + for i < index { + i++ + cur = cur.next + } + return cur.val +} + +// AddAtHead a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. +func (l *MyLinkedList) AddAtHead(val int) { + nd := &node{val: val} + nd.next = l.head.next + l.head.next = nd + l.size++ +} + +// AddAtTail append a node of value val to the last element of the linked list. +func (l *MyLinkedList) AddAtTail(val int) { + l.tail.val = val + nd := &node{} + l.tail.next = nd + l.tail = nd + l.size++ +} + +// AddAtIndex add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. +func (l *MyLinkedList) AddAtIndex(index int, val int) { + switch { + case index < 0 || l.size < index: + return + case index == 0: + l.AddAtHead(val) + return + case index == l.size: + l.AddAtTail(val) + return + } + + i, cur := -1, l.head + for i+1 < index { + i++ + cur = cur.next + } + + nd := &node{val: val} + nd.next = cur.next + cur.next = nd + + l.size++ +} + +// DeleteAtIndex delete the index-th node in the linked list, if the index is valid. +func (l *MyLinkedList) DeleteAtIndex(index int) { + if index < 0 || l.size <= index { + return + } + + i, cur := -1, l.head + for i+1 < index { + i++ + cur = cur.next + } + + cur.next = cur.next.next + + l.size-- +} + +// NOTICE: Get 的调用次数,远多余其他方法,以下实现方式更快 + +// type MyLinkedList struct { +// list []int +// } + +// // +// // Constructor initialize your data structure here. */ +// func Constructor() MyLinkedList { +// return MyLinkedList{list: make([]int, 0, 1000)} +// } + +// // +// // Get the value of the index-th node in the linked list. If the index is invalid, return -1. */ +// func (l *MyLinkedList) Get(index int) int { +// if len(l.list) <= index { +// return -1 +// } +// return l.list[index] +// } + +// // +// // AddAtHead a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. +// func (l *MyLinkedList) AddAtHead(val int) { +// l.list = append([]int{val}, l.list...) +// } + +// // +// // AddAtTail append a node of value val to the last element of the linked list. +// func (l *MyLinkedList) AddAtTail(val int) { +// l.list = append(l.list, val) +// } + +// // +// // AddAtIndex add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. +// func (l *MyLinkedList) AddAtIndex(index int, val int) { +// size := len(l.list) +// if index < 0 || size < index { +// return +// } +// l.list = append(l.list, 0) +// copy(l.list[index+1:], l.list[index:]) +// l.list[index] = val +// } + +// // +// // DeleteAtIndex delete the index-th node in the linked list, if the index is valid. +// func (l *MyLinkedList) DeleteAtIndex(index int) { +// size := len(l.list) +// if index < 0 || size <= index { +// return +// } +// copy(l.list[index:], l.list[index+1:]) +// l.list = l.list[:size-1] +// } diff --git a/Algorithms/0707.design-linked-list/design-linked-list_test.go b/Algorithms/0707.design-linked-list/design-linked-list_test.go new file mode 100755 index 000000000..986490f50 --- /dev/null +++ b/Algorithms/0707.design-linked-list/design-linked-list_test.go @@ -0,0 +1,67 @@ +package problem0707 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myLinkedList(t *testing.T) { + ast := assert.New(t) + + l := Constructor() + + l.AddAtHead(1) + l.AddAtTail(3) + + l.AddAtIndex(5, 5) + ast.Equal(-1, l.Get(5)) + + l.AddAtIndex(1, 2) + + ast.Equal(2, l.Get(1)) + + l.DeleteAtIndex(1) + + ast.Equal(3, l.Get(1)) +} +func Test_myLinkedList_2(t *testing.T) { + ast := assert.New(t) + + l := Constructor() + + l.AddAtTail(2) + l.AddAtHead(1) + l.AddAtTail(4) + l.AddAtTail(5) + + l.AddAtIndex(2, 3) + l.AddAtIndex(0, 0) + l.AddAtIndex(6, 6) + + ast.Equal(1, l.Get(1)) + + l.DeleteAtIndex(5) + l.DeleteAtIndex(8) + + ast.Equal(6, l.Get(5)) + +} +func Test_myLinkedList_3(t *testing.T) { + ast := assert.New(t) + + l := Constructor() + + ast.Equal(-1, l.Get(0)) + + l.AddAtIndex(1, 2) + + ast.Equal(-1, l.Get(0)) + ast.Equal(-1, l.Get(1)) + + l.AddAtIndex(0, 1) + + ast.Equal(1, l.Get(0)) + ast.Equal(-1, l.Get(1)) + +} diff --git a/Algorithms/0709.to-lower-case/README.md b/Algorithms/0709.to-lower-case/README.md new file mode 100755 index 000000000..c76308786 --- /dev/null +++ b/Algorithms/0709.to-lower-case/README.md @@ -0,0 +1,30 @@ +# [709. To Lower Case](https://leetcode.com/problems/to-lower-case/) + +## 题目 + +Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. + +Example 1: + +```text +Input: "Hello" +Output: "hello" +``` + +Example 2: + +```text +Input: "here" +Output: "here" +``` + +Example 3: + +```text +Input: "LOVELY" +Output: "lovely" +``` + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0709.to-lower-case/to-lower-case.go b/Algorithms/0709.to-lower-case/to-lower-case.go new file mode 100755 index 000000000..2d0817cca --- /dev/null +++ b/Algorithms/0709.to-lower-case/to-lower-case.go @@ -0,0 +1,7 @@ +package problem0709 + +import "strings" + +func toLowerCase(str string) string { + return strings.ToLower(str) +} diff --git a/Algorithms/0709.to-lower-case/to-lower-case_test.go b/Algorithms/0709.to-lower-case/to-lower-case_test.go new file mode 100755 index 000000000..c18e83f20 --- /dev/null +++ b/Algorithms/0709.to-lower-case/to-lower-case_test.go @@ -0,0 +1,49 @@ +package problem0709 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + str string + ans string +}{ + + { + "Hello", + "hello", + }, + + { + "here", + "here", + }, + + { + "LOVELY", + "lovely", + }, + + // 可以有多个 testcase +} + +func Test_toLowerCase(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, toLowerCase(tc.str), "输入:%v", tc) + } +} + +func Benchmark_toLowerCase(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + toLowerCase(tc.str) + } + } +} diff --git a/Algorithms/0710.random-pick-with-blacklist/README.md b/Algorithms/0710.random-pick-with-blacklist/README.md new file mode 100755 index 000000000..92a3ff998 --- /dev/null +++ b/Algorithms/0710.random-pick-with-blacklist/README.md @@ -0,0 +1,57 @@ +# [710. Random Pick with Blacklist](https://leetcode.com/problems/random-pick-with-blacklist/) + +## 题目 + +Given a blacklistB containing unique integersfrom [0, N), write a function to return a uniform random integer from [0, N) which is NOTin B. + +Optimize it such that it minimizes the call to system’s Math.random(). + +Note: + +- 1 <= N <= 1000000000 +- 0 <= B.length < min(100000, N) +- [0, N)does NOT include N. See interval notation. + +Example 1: + +```text +Input: +["Solution","pick","pick","pick"] +[[1,[]],[],[],[]] +Output: [null,0,0,0] +``` + +Example 2: + +```text +Input: +["Solution","pick","pick","pick"] +[[2,[]],[],[],[]] +Output: [null,1,1,1] +``` + +Example 3: + +```text +Input: +["Solution","pick","pick","pick"] +[[3,[1]],[],[],[]] +Output: [null,0,0,2] +``` + +Example 4: + +```text +Input: +["Solution","pick","pick","pick"] +[[4,[2]],[],[],[]] +Output: [null,1,3,1] +``` + +Explanation of Input Syntax: + +The input is two lists:the subroutines calledand theirarguments.Solution'sconstructor has two arguments,N and the blacklist B. pick has no arguments.Argumentsarealways wrapped with a list, even if there aren't any. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist.go b/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist.go new file mode 100755 index 000000000..7774dac84 --- /dev/null +++ b/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist.go @@ -0,0 +1,66 @@ +package problem0710 + +import ( + "math/rand" + "time" +) + +// Solution 包含了 BlackList 和 N +type Solution struct { + M int + blackMap map[int]int +} + +// Constructor 构建了 Solution +func Constructor(N int, blacklist []int) Solution { + rand.Seed(time.Now().UnixNano()) + // M 是可以自由选择的数的个数 + M := N - len(blacklist) + + blackMap := make(map[int]int, len(blacklist)) + // 由于 blacklist 是乱序的,只好先把 blacklist 中的元素全部添加为 blackMap 的 key + for _, b := range blacklist { + blackMap[b] = b + } + + for _, b := range blacklist { + if b >= M { + continue + } + + // 对于所有的 b < M + // 与 [M,N) 中某个不在 BlackList 中的数,关联上 + + N-- + for blackMap[N] == N { + N-- + } + + blackMap[b] = N + } + + return Solution{ + M: M, + blackMap: blackMap, + } + +} + +// Pick 选取了不在 BlackList 中的值 +func (s *Solution) Pick() int { + // 在 [0,M) 中任意挑选一个数 r + r := rand.Intn(s.M) + if t, ok := s.blackMap[r]; ok { + // r 是 s.blackMap 的 key + // 说明 r 是 BlackList 中的值 + // 需要返回 与 r 相关联的值 + return t + } + return r +} + +/** + * Your Solution object will be instantiated and called as such: + * obj := Constructor(N, blacklist); + * param_1 := obj.Pick(); + */ diff --git a/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist_test.go b/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist_test.go new file mode 100755 index 000000000..62c535fa1 --- /dev/null +++ b/Algorithms/0710.random-pick-with-blacklist/random-pick-with-blacklist_test.go @@ -0,0 +1,46 @@ +package problem0710 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Solution(t *testing.T) { + ast := assert.New(t) + + N := 100000 + blacklist := make([]int, 0, N) + for i := 1; i < N; i++ { + blacklist = append(blacklist, i) + } + s := Constructor(N, blacklist) + + for i := 0; i < 100000; i++ { + ast.Equal(0, s.Pick()) + } +} +func Test_Solution_2(t *testing.T) { + ast := assert.New(t) + + N := 2 + blacklist := make([]int, 0, N) + s := Constructor(N, blacklist) + + for i := 0; i < 10; i++ { + p := s.Pick() + ast.True(p == 1 || p == 0, "%d", i) + } +} + +func Test_Solution_3(t *testing.T) { + ast := assert.New(t) + + N := 10 + blacklist := []int{0, 2, 4, 6, 8} + s := Constructor(N, blacklist) + + for i := 0; i < 10; i++ { + ast.NotContains(blacklist, s.Pick()) + } +} diff --git a/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/README.md b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/README.md new file mode 100755 index 000000000..e84a2d558 --- /dev/null +++ b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/README.md @@ -0,0 +1,35 @@ +# [712. Minimum ASCII Delete Sum for Two Strings](https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/) + +## 题目 + +Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. + +Example 1: + +```text +Input: s1 = "sea", s2 = "eat" +Output: 231 +Explanation: Deleting "s" from "sea" adds the ASCII value of "s" (115) to the sum. +Deleting "t" from "eat" adds 116 to the sum. +At the end, both strings are equal, and 115 + 116 = 231 is the minimum sum possible to achieve this. +``` + +Example 2: + +```text +Input: s1 = "delete", s2 = "leet" +Output: 403 +Explanation: Deleting "dee" from "delete" to turn the string into "let", +adds 100[d]+101[e]+101[e] to the sum. Deleting "e" from "leet" adds 101[e] to the sum. +At the end, both strings are equal to "let", and the answer is 100+101+101+101 = 403. +If instead we turned both strings into "lee" or "eet", we would get answers of 433 or 417, which are higher. +``` + +Note: + +1. 0 < s1.length, s2.length <= 1000. +1. All elements of each string will have an ASCII value in [97, 122]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings.go b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings.go new file mode 100755 index 000000000..fe59390c9 --- /dev/null +++ b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings.go @@ -0,0 +1,38 @@ +package problem0712 + +func minimumDeleteSum(s1, s2 string) int { + n1, n2 := len(s1), len(s2) + + // dp[i][j] == miniumDeleteSum(s1[i:], s2[j:]) + dp := make([][]int, n1+1) + for i := range dp { + dp[i] = make([]int, n2+1) + } + + for i := n1 - 1; 0 <= i; i-- { + dp[i][n2] = dp[i+1][n2] + int(s1[i]) + } + + for j := n2 - 1; 0 <= j; j-- { + dp[n1][j] = dp[n1][j+1] + int(s2[j]) + } + + for i := n1 - 1; 0 <= i; i-- { + for j := n2 - 1; 0 <= j; j-- { + if s1[i] == s2[j] { + dp[i][j] = dp[i+1][j+1] + } else { + dp[i][j] = min(dp[i+1][j]+int(s1[i]), dp[i][j+1]+int(s2[j])) + } + } + } + + return dp[0][0] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings_test.go b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings_test.go new file mode 100755 index 000000000..6aae03983 --- /dev/null +++ b/Algorithms/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings_test.go @@ -0,0 +1,46 @@ +package problem0712 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s1, s2 string + ans int +}{ + + { + "delete", + "leet", + 403, + }, + + { + "sea", + "eat", + 231, + }, + + // 可以有多个 testcase +} + +func Test_minimumDeleteSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minimumDeleteSum(tc.s1, tc.s2), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minimumDeleteSum(tc.s1, tc.s2) + } + } +} diff --git a/Algorithms/0713.subarray-product-less-than-k/README.md b/Algorithms/0713.subarray-product-less-than-k/README.md new file mode 100755 index 000000000..e8c9d2f01 --- /dev/null +++ b/Algorithms/0713.subarray-product-less-than-k/README.md @@ -0,0 +1,26 @@ +# [713. Subarray Product Less Than K](https://leetcode.com/problems/subarray-product-less-than-k/) + +## 题目 + +Your are given an array of positive integers nums. + +Count and print the number of (contiguous) subarrays where the product of all the elements in the subarray is less than k. + +Example 1: + +```text +Input: nums = [10, 5, 2, 6], k = 100 +Output: 8 +Explanation: The 8 subarrays that have product less than 100 are: [10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6]. +Note that [10, 5, 2] is not included as the product of 100 is not strictly less than k. +``` + +Note: + +1. 0 < nums.length <= 50000. +1. 0 < nums[i] < 1000. +1. 0 <= k < 10^6. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k.go b/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k.go new file mode 100755 index 000000000..77022fa5e --- /dev/null +++ b/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k.go @@ -0,0 +1,29 @@ +package problem0713 + +func numSubarrayProductLessThanK(a []int, k int) int { + res := 0 + + n := len(a) + p := 1 + + j := 0 + for i := 0; i < n; i++ { + for j < n && p*a[j] < k { + p *= a[j] + j++ + } + + if i == j { + // 此时 a[i] > k + // 需要跳过 a[i] + // 由于 p 没有乘以 a[i] + // 所以,p 也不需要除以 a[i] + j++ + } else { + res += j - i + p /= a[i] + } + } + + return res +} diff --git a/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k_test.go b/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k_test.go new file mode 100755 index 000000000..1d72fe7a2 --- /dev/null +++ b/Algorithms/0713.subarray-product-less-than-k/subarray-product-less-than-k_test.go @@ -0,0 +1,53 @@ +package problem0713 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans int +}{ + + { + []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + 5, + 367968907, + }, + + { + []int{1, 2, 3}, + 0, + 0, + }, + + { + []int{10, 5, 2, 6}, + 100, + 8, + }, + + // 可以有多个 testcase +} + +func Test_numSubarrayProductLessThanK(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numSubarrayProductLessThanK(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSubarrayProductLessThanK(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/README.md b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/README.md new file mode 100755 index 000000000..7cc090500 --- /dev/null +++ b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/README.md @@ -0,0 +1,32 @@ +# [714. Best Time to Buy and Sell Stock with Transaction Fee](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/) + +## 题目 + +Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee. + +You may complete as many transactions as you like, but you need to pay the transaction fee for each transaction. You may not buy more than 1 share of a stock at a time (ie. you must sell the stock share before you buy again.) + +Return the maximum profit you can make. + +Example 1: + +```text +Input: prices = [1, 3, 2, 8, 4, 9], fee = 2 +Output: 8 +Explanation: The maximum profit can be achieved by: +Buying at prices[0] = 1 +Selling at prices[3] = 8 +Buying at prices[4] = 4 +Selling at prices[5] = 9 +The total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8. +``` + +Note: + +1. 0 < prices.length <= 50000. +1. 0 < prices[i] < 50000. +1. 0 <= fee < 50000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee.go b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee.go new file mode 100755 index 000000000..9f4af3c0a --- /dev/null +++ b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee.go @@ -0,0 +1,21 @@ +package problem0714 + +func maxProfit(prices []int, fee int) int { + empty := 0 + hold := -1 << 63 + + for _, p := range prices { + temp := empty + empty = max(empty, hold+p) + hold = max(hold, temp-p-fee) + } + + return empty +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee_test.go b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee_test.go new file mode 100755 index 000000000..bad1f716b --- /dev/null +++ b/Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee_test.go @@ -0,0 +1,47 @@ +package problem0714 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + prices []int + fee int + ans int +}{ + + { + []int{1, 3, 7, 5, 10, 3}, + 3, + 6, + }, + + { + []int{1, 3, 2, 8, 4, 9}, + 2, + 8, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxProfit(tc.prices, tc.fee), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxProfit(tc.prices, tc.fee) + } + } +} diff --git a/Algorithms/0715.range-module/README.md b/Algorithms/0715.range-module/README.md new file mode 100755 index 000000000..4477efa90 --- /dev/null +++ b/Algorithms/0715.range-module/README.md @@ -0,0 +1,31 @@ +# [715. Range Module](https://leetcode.com/problems/range-module/) + +## 题目 + +A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner. + +- addRange(int left, int right) Adds the half-open interval [left, right), tracking every real number in that interval. Adding an interval that partially overlaps with currently tracked numbers should add any numbers in the interval [left, right) that are not already tracked. +- queryRange(int left, int right) Returns true if and only if every real number in the interval [left, right) is currently being tracked. +- removeRange(int left, int right) Stops tracking every real number currently being tracked in the interval [left, right). + +Example 1: + +```text +addRange(10, 20): null +removeRange(14, 16): null +queryRange(10, 14): true (Every number in [10, 14) is being tracked) +queryRange(13, 15): false (Numbers like 14, 14.03, 14.17 in [13, 15) are not being tracked) +queryRange(16, 17): true (The number 16 in [16, 17) is still being tracked, despite the remove operation) +``` + +Note: + +1. A half open interval [left, right) denotes all real numbers left <= x < right. +1. 0 < left < right < 10^9 in all calls to addRange, queryRange, removeRange. +1. The total number of calls to addRange in a single test case is at most 1000. +1. The total number of calls to queryRange in a single test case is at most 5000. +1. The total number of calls to removeRange in a single test case is at most 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0715.range-module/range-module.go b/Algorithms/0715.range-module/range-module.go new file mode 100755 index 000000000..608a487e1 --- /dev/null +++ b/Algorithms/0715.range-module/range-module.go @@ -0,0 +1,131 @@ +package problem0715 + +import ( + "sort" +) + +// RangeModule 记录了跟踪的范围 +type RangeModule struct { + ranges []*interval +} + +// Constructor 返回新建的 RangeModule +func Constructor() RangeModule { + return RangeModule{ranges: make([]*interval, 0, 2048)} +} + +// AddRange 添加追踪的返回 +func (r *RangeModule) AddRange(left int, right int) { + it := &interval{left: left, right: right} + + n := len(r.ranges) + i := sort.Search(n, func(i int) bool { + return left <= r.ranges[i].right + }) + + var j int + for j = i; j < n && r.ranges[j].left <= right; j++ { + it.add(r.ranges[j]) + } + + if i == j { + r.ranges = append(r.ranges, nil) + } + + copy(r.ranges[i+1:], r.ranges[j:]) + r.ranges = r.ranges[:n-j+i+1] + r.ranges[i] = it +} + +// QueryRange 返回 true 如果 [left, right) 全部都在追踪范围内 +func (r *RangeModule) QueryRange(left int, right int) bool { + n := len(r.ranges) + i := sort.Search(n, func(i int) bool { + return right <= r.ranges[i].right + }) + return 0 <= i && i < n && r.ranges[i].isCover(left, right) +} + +// RemoveRange 从追踪范围中删除 [left,right) +func (r *RangeModule) RemoveRange(left int, right int) { + it := &interval{left: left, right: right} + + n := len(r.ranges) + if n == 0 { + return + } + + i := sort.Search(n, func(i int) bool { + return left < r.ranges[i].right + }) + + temp := make([]*interval, 0, 16) + var j int + for j = i; j < n && r.ranges[j].left < right; j++ { + ra, rb := minus(r.ranges[j], it) + if ra != nil { + temp = append(temp, ra) + } + if rb != nil { + temp = append(temp, rb) + } + } + + if i == j { + return + } + + r.ranges = append(r.ranges, nil) + copy(r.ranges[i+len(temp):], r.ranges[j:]) + r.ranges = r.ranges[:n-j+i+len(temp)] + + for k := 0; k < len(temp); k++ { + r.ranges[i+k] = temp[k] + } +} + +type interval struct { + left, right int +} + +func (it *interval) isCover(left, right int) bool { + return it.left <= left && right <= it.right +} + +func (it *interval) add(a *interval) { + if a.left < it.left { + it.left = a.left + } + + if it.right < a.right { + it.right = a.right + } +} + +// 返回 a-b +func minus(a, b *interval) (*interval, *interval) { + if b.left <= a.left && a.right <= b.right { + return nil, nil + } + + if b.left <= a.left && a.left < b.right && b.right < a.right { + return &interval{left: b.right, right: a.right}, nil + } + + if a.left < b.left && b.left < a.right && a.right < b.right { + return &interval{left: a.left, right: b.left}, nil + } + + // a.left < b.left && b.right < a.right + return &interval{left: a.left, right: b.left}, + &interval{left: b.right, right: a.right} + +} + +/** + * Your RangeModule object will be instantiated and called as such: + * obj := Constructor(); + * obj.AddRange(left,right); + * param_2 := obj.QueryRange(left,right); + * obj.RemoveRange(left,right); + */ diff --git a/Algorithms/0715.range-module/range-module_test.go b/Algorithms/0715.range-module/range-module_test.go new file mode 100755 index 000000000..affec424d --- /dev/null +++ b/Algorithms/0715.range-module/range-module_test.go @@ -0,0 +1,111 @@ +package problem0715 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + rm := Constructor() + + rm.AddRange(10, 20) + + rm.RemoveRange(14, 16) + + ast.True(rm.QueryRange(10, 14)) + + ast.False(rm.QueryRange(13, 15)) + + ast.True(rm.QueryRange(16, 17)) +} + +func Test_RangeModule_AddRange(t *testing.T) { + ast := assert.New(t) + + rm := Constructor() + + ranges := [][]int{ + {10, 12}, + {14, 16}, + {18, 20}, + {12, 14}, + {16, 18}, + } + + for _, r := range ranges { + rm.AddRange(r[0], r[1]) + } + + ast.Equal(1, len(rm.ranges), "添加完 ranges 后,rm.ranges 的范围应该合并成一个") + ast.Equal(interval{left: 10, right: 20}, *rm.ranges[0], "添加完 ranges 后,rm.ranges 的范围应该合并成[10,20)") +} + +func Test_RangeModule_RemoveRange(t *testing.T) { + ast := assert.New(t) + + rm := Constructor() + + rm.RemoveRange(1, 2) + + ranges := [][]int{ + {10, 12}, + {14, 16}, + } + + for _, r := range ranges { + rm.AddRange(r[0], r[1]) + } + + rm.RemoveRange(12, 14) + + ast.Equal(2, len(rm.ranges), "添加完 ranges 后,rm.ranges 的范围应该合并成一个") + ast.Equal(interval{left: 10, right: 12}, *rm.ranges[0]) + ast.Equal(interval{left: 14, right: 16}, *rm.ranges[1]) +} + +func Test_minus(t *testing.T) { + ast := assert.New(t) + + var tcs = []struct { + a, b *interval + ansA, ansB *interval + }{ + + { + &interval{left: 10, right: 20}, + &interval{left: 5, right: 25}, + nil, + nil, + }, + + { + &interval{left: 10, right: 20}, + &interval{left: 5, right: 15}, + &interval{left: 15, right: 20}, + nil, + }, + + { + &interval{left: 10, right: 20}, + &interval{left: 15, right: 25}, + &interval{left: 10, right: 15}, + nil, + }, + + { + &interval{left: 10, right: 20}, + &interval{left: 14, right: 16}, + &interval{left: 10, right: 14}, + &interval{left: 16, right: 20}, + }, + } + + for _, tc := range tcs { + ra, rb := minus(tc.a, tc.b) + ast.Equal(tc.ansA, ra) + ast.Equal(tc.ansB, rb) + } +} diff --git a/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters.go b/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters.go new file mode 100755 index 000000000..ed2ef5967 --- /dev/null +++ b/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters.go @@ -0,0 +1,15 @@ +package problem0717 + +func isOneBitCharacter(bits []int) bool { + n := len(bits) + i := 0 + for i < n-1 { + if bits[i] == 1 { + // 遇见 1 说明遇见了 twoBits + i += 2 + } else { + i++ + } + } + return i == n-1 +} diff --git a/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters_test.go b/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters_test.go new file mode 100755 index 000000000..f1bf783ed --- /dev/null +++ b/Algorithms/0717.1-bit-and-2-bit-characters/1-bit-and-2-bit-characters_test.go @@ -0,0 +1,59 @@ +package problem0717 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + bits []int + ans bool +}{ + + { + []int{1, 1, 0, 0, 0, 0}, + true, + }, + + { + []int{1, 1, 1, 1, 0}, + true, + }, + + { + []int{1, 0, 0}, + true, + }, + + { + []int{1, 1, 1, 0}, + false, + }, + + { + []int{1, 1, 0}, + true, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isOneBitCharacter(tc.bits), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isOneBitCharacter(tc.bits) + } + } +} diff --git a/Algorithms/0717.1-bit-and-2-bit-characters/README.md b/Algorithms/0717.1-bit-and-2-bit-characters/README.md new file mode 100755 index 000000000..4d5da7413 --- /dev/null +++ b/Algorithms/0717.1-bit-and-2-bit-characters/README.md @@ -0,0 +1,36 @@ +# [717. 1-bit and 2-bit Characters](https://leetcode.com/problems/1-bit-and-2-bit-characters/) + +## 题目 + +We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). + +Now given a string represented by several bits. Return whether the last character must be a one-bit character or not. The given string will always end with a zero. + +Example 1: + +```text +Input: +bits = [1, 0, 0] +Output: True +Explanation: +The only way to decode it is two-bit character and one-bit character. So the last character is one-bit character. +``` + +Example 2: + +```text +Input: +bits = [1, 1, 1, 0] +Output: False +Explanation: +The only way to decode it is two-bit character and two-bit character. So the last character is NOT one-bit character. +``` + +Note: + +1. 1 <= len(bits) <= 1000. +1. bits[i] is always 0 or 1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0718.maximum-length-of-repeated-subarray/README.md b/Algorithms/0718.maximum-length-of-repeated-subarray/README.md new file mode 100755 index 000000000..3a8a0486e --- /dev/null +++ b/Algorithms/0718.maximum-length-of-repeated-subarray/README.md @@ -0,0 +1,25 @@ +# [718. Maximum Length of Repeated Subarray](https://leetcode.com/problems/maximum-length-of-repeated-subarray/) + +## 题目 + +Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. + +Example 1: + +```text +Input: +A: [1,2,3,2,1] +B: [3,2,1,4,7] +Output: 3 +Explanation: +The repeated subarray with maximum length is [3, 2, 1]. +``` + +Note: + +1. 1 <= len(A), len(B) <= 1000 +1. 0 <= A[i], B[i] < 100 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray.go b/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray.go new file mode 100755 index 000000000..9df4543c9 --- /dev/null +++ b/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray.go @@ -0,0 +1,31 @@ +package problem0718 + +func findLength(a1, a2 []int) int { + n1, n2 := len(a1), len(a2) + + // dp[i][j] == k 表示 a1[i-k:i] == a2[j-k:j] , + // 但是 a1[i-k-1] != a2[j-k-1] + dp := make([][]int, n1+1) + for i := range dp { + dp[i] = make([]int, n2+1) + } + + res := 0 + for i := 1; i <= n1; i++ { + for j := 1; j <= n2; j++ { + if a1[i-1] == a2[j-1] { + dp[i][j] = dp[i-1][j-1] + 1 + res = max(res, dp[i][j]) + } + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray_test.go b/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray_test.go new file mode 100755 index 000000000..48a14d053 --- /dev/null +++ b/Algorithms/0718.maximum-length-of-repeated-subarray/maximum-length-of-repeated-subarray_test.go @@ -0,0 +1,46 @@ +package problem0718 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a1, a2 []int + ans int +}{ + + { + []int{1, 2, 3, 2, 1}, + []int{3, 2, 4, 1, 7}, + 2, + }, + + { + []int{1, 2, 3, 2, 1}, + []int{3, 2, 1, 4, 7}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findLength(tc.a1, tc.a2), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findLength(tc.a1, tc.a2) + } + } +} diff --git a/Algorithms/0719.find-k-th-smallest-pair-distance/README.md b/Algorithms/0719.find-k-th-smallest-pair-distance/README.md new file mode 100755 index 000000000..29c7311fa --- /dev/null +++ b/Algorithms/0719.find-k-th-smallest-pair-distance/README.md @@ -0,0 +1,30 @@ +# [719. Find K-th Smallest Pair Distance](https://leetcode.com/problems/find-k-th-smallest-pair-distance/) + +## 题目 + +Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B. + +Example 1: + +```text +Input: +nums = [1,3,1] +k = 1 +Output: 0 +Explanation: +Here are all the pairs: +(1,3) -> 2 +(1,1) -> 0 +(3,1) -> 2 +Then the 1st smallest distance pair is (1,1), and its distance is 0. +``` + +Note: + +1. 2 <= len(nums) <= 10000. +1. 0 <= nums[i] < 1000000. +1. 1 <= k <= len(nums) * (len(nums) - 1) / 2. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance.go b/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance.go new file mode 100755 index 000000000..ee0cf89c6 --- /dev/null +++ b/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance.go @@ -0,0 +1,55 @@ +package problem0719 + +import "sort" + +func smallestDistancePair(a []int, k int) int { + n := len(a) + sort.Ints(a) + + low := a[1] - a[0] + for i := 2; i < n; i++ { + low = min(low, a[i]-a[i-1]) + } + + high := a[n-1] - a[0] + // 由题意可知,res 必定存在于 [low, high] 之中 + // 又由 count(a, mid) 可以 a 中距离 <= mid 的个数 + // 故可以使用 二分查找法 + for low < high { + mid := low + (high-low)/2 + if count(a, mid) < k { + low = mid + 1 + } else { + high = mid + } + // NOTICE: + // count(a,mid) == k , 并不能立即返回 mid 作为答案 + // 例如 count([]int{1,1,4}, 2) == 1, + // 但是 smallestDistancePair([]int{1,1,4}, 1) == 0 + } + + return low +} + +// 统计 a 中距离 <= mid 的元素对的数量 +func count(a []int, mid int) int { + n := len(a) + res := 0 + i, j := 0, 1 + for j < n { + if a[j]-a[i] <= mid { + res += j - i + j++ + } else { + i++ + } + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance_test.go b/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance_test.go new file mode 100755 index 000000000..3e11f5bad --- /dev/null +++ b/Algorithms/0719.find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance_test.go @@ -0,0 +1,53 @@ +package problem0719 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + k int + ans int +}{ + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 36, + 8, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 8, + 1, + }, + + { + []int{1, 3, 1}, + 1, + 0, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, smallestDistancePair(tc.nums, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestDistancePair(tc.nums, tc.k) + } + } +} diff --git a/Algorithms/0720.longest-word-in-dictionary/README.md b/Algorithms/0720.longest-word-in-dictionary/README.md new file mode 100755 index 000000000..031d5fdc6 --- /dev/null +++ b/Algorithms/0720.longest-word-in-dictionary/README.md @@ -0,0 +1,36 @@ +# [720. Longest Word in Dictionary](https://leetcode.com/problems/longest-word-in-dictionary/) + +## 题目 + +Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there is more than one possible answer, return the longest word with the smallest lexicographical order. + +If there is no answer, return the empty string. +Example 1: + +```text +Input: +words = ["w","wo","wor","worl", "world"] +Output: "world" +Explanation: +The word "world" can be built one character at a time by "w", "wo", "wor", and "worl". +``` + +Example 2: + +```text +Input: +words = ["a", "banana", "app", "appl", "ap", "apply", "apple"] +Output: "apple" +Explanation: +Both "apply" and "apple" can be built from other words in the dictionary. However, "apple" is lexicographically smaller than "apply". +``` + +Note: + +- All the strings in the input will only contain lowercase letters. +- The length of words will be in the range [1, 1000]. +- The length of words[i] will be in the range [1, 30]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary.go b/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary.go new file mode 100755 index 000000000..8d05ff1fe --- /dev/null +++ b/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary.go @@ -0,0 +1,24 @@ +package problem0720 + +import "sort" + +func longestWord(words []string) string { + sort.Strings(words) + m := make(map[string]bool, len(words)) + + res := words[0] + + for _, w := range words { + n := len(w) + if n == 1 { + m[w] = true + } else if m[w[:n-1]] { + m[w] = true + if len(res) < len(w) { + res = w + } + } + } + + return res +} diff --git a/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary_test.go b/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary_test.go new file mode 100755 index 000000000..56bf2c58a --- /dev/null +++ b/Algorithms/0720.longest-word-in-dictionary/longest-word-in-dictionary_test.go @@ -0,0 +1,59 @@ +package problem0720 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans string +}{ + + { + []string{"ts", "e", "x", "pbhj", "opto", "xhigy", "erikz", "pbh", "opt", "erikzb", "eri", "erik", "xlye", "xhig", "optoj", "optoje", "xly", "pb", "xhi", "x", "o"}, + "e", + }, + + { + []string{"rac", "rs", "ra", "on", "r", "otif", "o", "onpdu", "rsf", "rs", "ot", "oti", "racy", "onpd"}, + "otif", + }, + + { + []string{"yo", "ew", "fc", "zrc", "yodn", "fcm", "qm", "qmo", "fcmz", "z", "ewq", "yod", "ewqz", "y"}, + "yodn", + }, + + { + []string{"w", "wo", "wor", "worl", "world"}, + "world", + }, + + { + []string{"a", "banana", "app", "appl", "ap", "apply", "apple"}, + "apple", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestWord(tc.words), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestWord(tc.words) + } + } +} diff --git a/Algorithms/0721.accounts-merge/README.md b/Algorithms/0721.accounts-merge/README.md new file mode 100755 index 000000000..58fb079e7 --- /dev/null +++ b/Algorithms/0721.accounts-merge/README.md @@ -0,0 +1,32 @@ +# [721. Accounts Merge](https://leetcode.com/problems/accounts-merge/) + +## 题目 + +Given a list `accounts`, each element `accounts[i]` is a list of strings, where the first element `accounts[i][0]` is a name, and the rest of the elements are emails representing emails of the account. + +Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some email that is common to both accounts. Note that even if two accounts have the same name, they may belong to different people as people could have the same name. A person can have any number of accounts initially, but all of their accounts definitely have the same name. + +After merging the accounts, return the accounts in the following format: the first element of each account is the name, and the rest of the elements are emails in sorted order. The accounts themselves can be returned in any order. + +Example 1: + +```text +Input: +accounts = [["John", "johnsmith@mail.com", "john00@mail.com"], ["John", "johnnybravo@mail.com"], ["John", "johnsmith@mail.com", "john_newyork@mail.com"], ["Mary", "mary@mail.com"]] +Output: [["John", 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com'], ["John", "johnnybravo@mail.com"], ["Mary", "mary@mail.com"]] +Explanation: +The first and third John's are the same person as they have the common email "johnsmith@mail.com". +The second John and Mary are different people as none of their email addresses are used by other accounts. +We could return these lists in any order, for example the answer [['Mary', 'mary@mail.com'], ['John', 'johnnybravo@mail.com'], +['John', 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com']] would still be accepted. +``` + +Note: + +- The length of accounts will be in the range [1, 1000]. +- The length of accounts[i] will be in the range [1, 10]. +- The length of accounts[i][j] will be in the range [1, 30]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0721.accounts-merge/accounts-merge.go b/Algorithms/0721.accounts-merge/accounts-merge.go new file mode 100755 index 000000000..8f8b0b949 --- /dev/null +++ b/Algorithms/0721.accounts-merge/accounts-merge.go @@ -0,0 +1,53 @@ +package problem0721 + +import ( + "sort" +) + +func accountsMerge(acts [][]string) [][]string { + n := len(acts) + + owner := make(map[string]string, n) + parent := make(map[string]string, n*2) + + for _, a := range acts { + for i := 1; i < len(a); i++ { + parent[a[i]] = a[i] + owner[a[i]] = a[0] + } + } + + for _, a := range acts { + r := root(a[1], parent) + for i := 2; i < len(a); i++ { + p := root(a[i], parent) + parent[p] = r + } + } + + union := make(map[string][]string, n) + for email, p := range parent { + r := root(p, parent) + union[r] = append(union[r], email) + } + + res := make([][]string, 0, len(union)) + for p, emails := range union { + t := make([]string, len(emails)+1) + t[0] = owner[p] + if len(emails) > 1 { + sort.Strings(emails) + } + copy(t[1:], emails) + res = append(res, t) + } + + return res +} + +func root(e string, parent map[string]string) string { + if parent[e] == e { + return e + } + return root(parent[e], parent) +} diff --git a/Algorithms/0721.accounts-merge/accounts-merge_test.go b/Algorithms/0721.accounts-merge/accounts-merge_test.go new file mode 100755 index 000000000..c3e0ac5db --- /dev/null +++ b/Algorithms/0721.accounts-merge/accounts-merge_test.go @@ -0,0 +1,90 @@ +package problem0721 + +import ( + "fmt" + "sort" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + accounts [][]string + ans [][]string +}{ + + { + [][]string{ + {"David", "David0@m.co", "David1@m.co"}, + {"David", "David3@m.co", "David4@m.co"}, + {"David", "David4@m.co", "David5@m.co"}, + {"David", "David2@m.co", "David3@m.co"}, + {"David", "David1@m.co", "David2@m.co"}, + }, + [][]string{ + {"David", "David0@m.co", "David1@m.co", "David2@m.co", "David3@m.co", "David4@m.co", "David5@m.co"}, + }, + }, + + { + [][]string{ + {"Ethan", "Ethan1@m.co", "Ethan2@m.co", "Ethan0@m.co"}, + {"David", "David1@m.co", "David2@m.co", "David0@m.co"}, + {"Lily", "Lily0@m.co", "Lily0@m.co", "Lily4@m.co"}, + {"Gabe", "Gabe1@m.co", "Gabe4@m.co", "Gabe0@m.co"}, + {"Ethan", "Ethan2@m.co", "Ethan1@m.co", "Ethan0@m.co"}, + }, + [][]string{ + {"Gabe", "Gabe0@m.co", "Gabe1@m.co", "Gabe4@m.co"}, + {"Ethan", "Ethan0@m.co", "Ethan1@m.co", "Ethan2@m.co"}, + {"David", "David0@m.co", "David1@m.co", "David2@m.co"}, + {"Lily", "Lily0@m.co", "Lily4@m.co"}, + }, + }, + + { + [][]string{ + {"John", "johnsmith@mail.com", "john00@mail.com"}, + {"John", "johnnybravo@mail.com"}, + {"John", "johnsmith@mail.com", "john_newyork@mail.com"}, + {"Mary", "mary@mail.com"}, + }, + [][]string{ + {"John", "john00@mail.com", "john_newyork@mail.com", "johnsmith@mail.com"}, + {"John", "johnnybravo@mail.com"}, + {"Mary", "mary@mail.com"}, + }, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(normal(tc.ans), normal(accountsMerge(tc.accounts)), "输入:%v", tc) + } +} +func normal(sss [][]string) string { + ss := make([]string, len(sss)) + + for i := 0; i < len(sss); i++ { + sort.Strings(sss[i]) + ss[i] = strings.Join(sss[i], "☆") + } + + sort.Strings(ss) + + return strings.Join(ss, "★★") +} +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + accountsMerge(tc.accounts) + } + } +} diff --git a/Algorithms/0722.remove-comments/README.md b/Algorithms/0722.remove-comments/README.md new file mode 100755 index 000000000..62af3f8ca --- /dev/null +++ b/Algorithms/0722.remove-comments/README.md @@ -0,0 +1,76 @@ +# [722. Remove Comments](https://leetcode.com/problems/remove-comments/) + +## 题目 + +Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the result of splitting the original source code string by the newline character \n. + +In C++, there are two types of comments, line comments, and block comments. + +The string `//` denotes a line comment, which represents that it and rest of the characters to the right of it in the same line should be ignored. + +The string `/*` denotes a block comment, which represents that all characters until the next (non-overlapping) occurrence of `*/` should be ignored. (Here, occurrences happen in reading order: line by line from left to right.) To be clear, the string `/*/` does not yet end the block comment, as the ending would be overlapping the beginning. + +The first effective comment takes precedence over others: if the string `//` occurs in a block comment, it is ignored. Similarly, if the string `/*` occurs in a line or block comment, it is also ignored. + +If a certain line of code is empty after removing comments, you must not output that line: each string in the answer list will be non-empty. + +There will be no control characters, single quote, or double quote characters. For example, source = "string s = "/* Not a comment. */";" will not be a test case. (Also, nothing else such as defines or macros will interfere with the comments.) + +It is guaranteed that every open block comment will eventually be closed, so /* outside of a line or block comment always starts a new comment. + +Finally, implicit newline characters can be deleted by block comments. Please see the examples below for details. + +After removing the comments from the source code, return the source code in the same format. + +Example 1: + +```text +Input: +source = ["/*Test program */", "int main()", "{ ", " // variable declaration ", "int a, b, c;", "/* This is a test", " multiline ", " comment for ", " testing */", "a = b + c;", "}"] + +The line by line code is visualized as below: +/*Test program */ +int main() +{ + // variable declaration +int a, b, c; +/* This is a test + multiline + comment for + testing */ +a = b + c; +} + +Output: ["int main()","{ "," ","int a, b, c;","a = b + c;","}"] + +The line by line code is visualized as below: +int main() +{ + +int a, b, c; +a = b + c; +} + +Explanation: +The string /* denotes a block comment, including line 1 and lines 6-9. The string // denotes line 4 as comments. +``` + +Example 2: + +```text +Input: +source = ["a/*comment", "line", "more_comment*/b"] +Output: ["ab"] +Explanation: The original source string is "a/*comment\nline\nmore_comment*/b", where we have bolded the newline characters. After deletion, the implicit newline characters are deleted, leaving the string "ab", which when delimited by newline characters becomes ["ab"]. +``` + +Note: + +- The length of source is in the range [1, 100]. +- The length of source[i] is in the range [0, 80]. +- Every open block comment is eventually closed. +- There are no single-quote, double-quote, or control characters in the source code. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0722.remove-comments/remove-comments.go b/Algorithms/0722.remove-comments/remove-comments.go new file mode 100755 index 000000000..47e261a2b --- /dev/null +++ b/Algorithms/0722.remove-comments/remove-comments.go @@ -0,0 +1,47 @@ +package problem0722 + +import "strings" + +// TODO: 使用正则表达式替换,可以很简单地解决这个题目 + +func removeComments(source []string) []string { + // 末尾添加 "$$" 是为了当最后一行是 "// ..." 时,能找到终止符号 + s := strings.Join(source, "$$") + "$$" + s = helper(s) + source = split(s) + return source +} + +func helper(s string) string { + i := strings.Index(s, "/*") + j := strings.Index(s, "//") + + // "/*" 起作用了 + if 0 <= i && + (j == -1 || i < j) { + // i+2 是为了避免匹配到 "/*/" 中的 "*/" + k := i + 2 + strings.Index(s[i+2:], "*/") + return s[:i] + helper(s[k+2:]) // 删除了 s[i:k+2] + } + + // "//" 起作用了 + if 0 <= j && + (i == -1 || j < i) { + k := j + strings.Index(s[j:], "$$") + return s[:j] + helper(s[k:]) // 删除了 s[j:k] + } + + // 已经没有注释了 + return s +} + +func split(s string) []string { + ss := strings.Split(s, "$$") + res := make([]string, 0, len(ss)) + for _, s := range ss { + if s != "" { + res = append(res, s) + } + } + return res +} diff --git a/Algorithms/0722.remove-comments/remove-comments_test.go b/Algorithms/0722.remove-comments/remove-comments_test.go new file mode 100755 index 000000000..dacd193dc --- /dev/null +++ b/Algorithms/0722.remove-comments/remove-comments_test.go @@ -0,0 +1,139 @@ +package problem0722 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + source []string + ans []string +}{ + + { + []string{ + "struct Node{", + " /*/ declare members;/**/", + " int size;", + " /**/int val;", + "};", + }, + []string{ + "struct Node{", + " ", + " int size;", + " int val;", + "};", + }, + }, + + { + []string{ + "a//*b//*c", + "blank", + "d//*e/*/f", + }, + []string{ + "a", + "blank", + "d", + }, + }, + + { + []string{ + "/*Test program */", + "int main()", + "{ ", + " // variable declaration ", + "int a, b, c;", + "/* This is a test", + " multiline ", + " comment for ", + " testing */", + "a = b + c;", + "}", + }, + []string{ + "int main()", + "{ ", + " ", + "int a, b, c;", + "a = b + c;", + "}", + }, + }, + + { + []string{ + "main() {", + " Node* p;", + " /* declare a Node", + " /*float f = 2.0", + " p->val = f;", + " /**/", + " p->val = 1;", + " //*/ cout << success;*/", + "}", + " ", + }, + []string{ + "main() {", + " Node* p;", + " ", + " p->val = 1;", + " ", + "}", + " ", + }, + }, + + { + []string{ + "void func(int k) {", + "// this function does nothing /*", + " k = k*2/4;", + " k = k/2;*/", + "}", + }, + []string{ + "void func(int k) {", + " k = k*2/4;", + " k = k/2;*/", + "}", + }, + }, + + { + []string{ + "a/*comment", + "line", + "more_comment*/b", + }, + []string{ + "ab", + }, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, removeComments(tc.source), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeComments(tc.source) + } + } +} diff --git a/Algorithms/0724.find-pivot-index/README.md b/Algorithms/0724.find-pivot-index/README.md new file mode 100755 index 000000000..803a0c47a --- /dev/null +++ b/Algorithms/0724.find-pivot-index/README.md @@ -0,0 +1,39 @@ +# [724. Find Pivot Index](https://leetcode.com/problems/find-pivot-index/) + +## 题目 + +Given an array of integers nums, write a method that returns the "pivot" index of this array. + +We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the sum of the numbers to the right of the index. + +If no such index exists, we should return -1. If there are multiple pivot indexes, you should return the left-most pivot index. + +Example 1: + +```text +Input: +nums = [1, 7, 3, 6, 5, 6] +Output: 3 +Explanation: +The sum of the numbers to the left of index 3 (nums[3] = 6) is equal to the sum of numbers to the right of index 3. +Also, 3 is the first index where this occurs. +``` + +Example 2: + +```text +Input: +nums = [1, 2, 3] +Output: -1 +Explanation: +There is no index that satisfies the conditions in the problem statement. +``` + +Note: + +1. The length of nums will be in the range [0, 10000]. +1. Each element nums[i] will be an integer in the range [-1000, 1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0724.find-pivot-index/find-pivot-index.go b/Algorithms/0724.find-pivot-index/find-pivot-index.go new file mode 100755 index 000000000..f1b63f750 --- /dev/null +++ b/Algorithms/0724.find-pivot-index/find-pivot-index.go @@ -0,0 +1,18 @@ +package problem0724 + +func pivotIndex(nums []int) int { + sum := 0 + for i := range nums { + sum += nums[i] + } + + left := 0 + for i := range nums { + if left*2+nums[i] == sum { + return i + } + left += nums[i] + } + + return -1 +} diff --git a/Algorithms/0724.find-pivot-index/find-pivot-index_test.go b/Algorithms/0724.find-pivot-index/find-pivot-index_test.go new file mode 100755 index 000000000..777a8349a --- /dev/null +++ b/Algorithms/0724.find-pivot-index/find-pivot-index_test.go @@ -0,0 +1,44 @@ +package problem0724 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1, 7, 3, 6, 5, 6}, + 3, + }, + + { + []int{1, 2, 3}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, pivotIndex(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pivotIndex(tc.nums) + } + } +} diff --git a/Algorithms/0725.split-linked-list-in-parts/README.md b/Algorithms/0725.split-linked-list-in-parts/README.md new file mode 100755 index 000000000..c5d354c2b --- /dev/null +++ b/Algorithms/0725.split-linked-list-in-parts/README.md @@ -0,0 +1,46 @@ +# [725. Split Linked List in Parts](https://leetcode.com/problems/split-linked-list-in-parts/) + +## 题目 + +Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". + +The length of each part should be as equal as possible: no two parts should have a size differing by more than 1. This may lead to some parts being null. + +The parts should be in order of occurrence in the input list, and parts occurring earlier should always have a size greater than or equal parts occurring later. + +Return a List of ListNode's representing the linked list parts that are formed. + +Examples 1->2->3->4, k = 5 // 5 equal parts [ [1], [2], [3], [4], null ] + +Example 1: + +```text +Input: +root = [1, 2, 3], k = 5 +Output: [[1],[2],[3],[],[]] +Explanation: +The input and each element of the output are ListNodes, not arrays. +For example, the input root has root.val = 1, root.next.val = 2, \root.next.next.val = 3, and root.next.next.next = null. +The first element output[0] has output[0].val = 1, output[0].next = null. +The last element output[4] is null, but it's string representation as a ListNode is []. +``` + +Example 2: + +```text +Input: +root = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], k = 3 +Output: [[1, 2, 3, 4], [5, 6, 7], [8, 9, 10]] +Explanation: +The input has been split into consecutive parts with size difference at most 1, and earlier parts are a larger size than the later parts. +``` + +Note: + +- The length of root will be in the range [0, 1000]. +- Each value of a node in the input will be an integer in the range [0, 999]. +- k will be an integer in the range [1, 50]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts.go b/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts.go new file mode 100755 index 000000000..2f21080b7 --- /dev/null +++ b/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts.go @@ -0,0 +1,53 @@ +package problem0725 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +type ListNode = kit.ListNode + +func splitListToParts(root *ListNode, k int) []*ListNode { + size := length(root) + remainder := size % k + + res := make([]*ListNode, k) + + i := 0 + for { + res[i] = root + i++ + if i == k { + break + } + + leng := size / k + if remainder > 0 { + leng++ + remainder-- + } + + for leng > 1 && root != nil { + root = root.Next + leng-- + } + + if root == nil { + // 当 size < k 时,会出现这种情况 + break + } + + // 斩断链条 + root.Next, root = nil, root.Next + } + + return res +} + +func length(root *ListNode) int { + res := 0 + for root != nil { + res++ + root = root.Next + } + return res +} diff --git a/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts_test.go b/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts_test.go new file mode 100755 index 000000000..eef2805c9 --- /dev/null +++ b/Algorithms/0725.split-linked-list-in-parts/split-linked-list-in-parts_test.go @@ -0,0 +1,56 @@ +package problem0725 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ints []int + k int + ans [][]int +}{ + + { + []int{1, 2, 3}, + 5, + [][]int{{1}, {2}, {3}, {}, {}}, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + 3, + [][]int{{1, 2, 3, 4}, {5, 6, 7}, {8, 9, 10}}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2List(tc.ints) + ansLN := splitListToParts(root, tc.k) + ans := make([][]int, len(tc.ans)) + for i := range ans { + ans[i] = kit.List2Ints(ansLN[i]) + } + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2List(tc.ints) + splitListToParts(root, tc.k) + } + } +} diff --git a/Algorithms/0726.number-of-atoms/README.md b/Algorithms/0726.number-of-atoms/README.md new file mode 100755 index 000000000..4b85e234c --- /dev/null +++ b/Algorithms/0726.number-of-atoms/README.md @@ -0,0 +1,55 @@ +# [726. Number of Atoms](https://leetcode.com/problems/number-of-atoms/) + +## 题目 + +Given a chemical formula (given as a string), return the count of each atom. + +An atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name. + +1 or more digits representing the count of that element may follow if the count is greater than 1. If the count is 1, no digits will follow. For example, H2O and H2O2 are possible, but H1O2 is impossible. + +Two formulas concatenated together produce another formula. For example, H2O2He3Mg4 is also a formula. + +A formula placed in parentheses, and a count (optionally added) is also a formula. For example, (H2O2) and (H2O2)3 are formulas. + +Given a formula, output the count of all elements as a string in the following form: the first name (in sorted order), followed by its count (if that count is more than 1), followed by the second name (in sorted order), followed by its count (if that count is more than 1), and so on. + +Example 1: + +```text +Input: +formula = "H2O" +Output: "H2O" +Explanation: +The count of elements are {'H': 2, 'O': 1}. +``` + +Example 2: + +```text +Input: +formula = "Mg(OH)2" +Output: "H2MgO2" +Explanation: +The count of elements are {'H': 2, 'Mg': 1, 'O': 2}. +``` + +Example 3: + +```text +Input: +formula = "K4(ON(SO3)2)2" +Output: "K4N2O14S4" +Explanation: +The count of elements are {'K': 4, 'N': 2, 'O': 14, 'S': 4}. +``` + +Note: + +1. All atom names consist of lowercase letters, except for the first character which is uppercase. +1. The length of formula will be in the range [1, 1000]. +1. formula will only consist of letters, digits, and round parentheses, and is a valid formula as defined in the problem. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0726.number-of-atoms/number-of-atoms.go b/Algorithms/0726.number-of-atoms/number-of-atoms.go new file mode 100755 index 000000000..1a57dabd1 --- /dev/null +++ b/Algorithms/0726.number-of-atoms/number-of-atoms.go @@ -0,0 +1,110 @@ +package problem0726 + +import ( + "sort" + "strconv" +) + +func countOfAtoms(formula string) string { + return parse(count(formula)) +} + +func count(formula string) map[string]int { + rec := make(map[string]int, len(formula)/2) + var update = func(newRec map[string]int, times int) { + for atom, c := range newRec { + rec[atom] += c * times + } + } + + atoms := "" + for len(formula) > 0 { + atoms, formula = cut(formula) + if atoms[0] == '(' { + newFormula, times := dealParenthese(atoms) + newRec := count(newFormula) + update(newRec, times) + } else { + atom, num := getAtomAndNum(atoms) + rec[atom] += num + } + } + + return rec +} + +func cut(formula string) (string, string) { + i := 1 + if formula[0] == '(' { + i = jump(formula) + } + for i < len(formula) && + !isUpper(formula[i]) && + formula[i] != '(' { + i++ + } + return formula[:i], formula[i:] +} + +func dealParenthese(s string) (string, int) { + num, i := getNum(s) + return s[1 : i-1], num +} + +func getAtomAndNum(s string) (string, int) { + num, i := getNum(s) + return s[:i], num +} + +// 对于 "Ab321" 返回, 321 和 '3' 的索引号 2 +func getNum(s string) (num, i int) { + i = len(s) + for 0 <= i-1 && isNum(s[i-1]) { + i-- + } + num = 1 + if i == len(s) { + return + } + num, _ = strconv.Atoi(s[i:]) + return +} + +func isNum(b byte) bool { + return '0' <= b && b <= '9' +} + +func isUpper(b byte) bool { + return 'A' <= b && b <= 'Z' +} + +// jump 跳过了圆括号部分 +func jump(s string) int { + p := 1 + i := 1 + for i < len(s) && p > 0 { + if s[i] == '(' { + p++ + } else if s[i] == ')' { + p-- + } + i++ + } + return i +} + +func parse(r map[string]int) string { + atoms := make([]string, 0, len(r)) + for a := range r { + atoms = append(atoms, a) + } + sort.Strings(atoms) + res := "" + for _, a := range atoms { + res += a + if r[a] > 1 { + res += strconv.Itoa(r[a]) + } + } + return res +} diff --git a/Algorithms/0726.number-of-atoms/number-of-atoms_test.go b/Algorithms/0726.number-of-atoms/number-of-atoms_test.go new file mode 100755 index 000000000..24dcf322e --- /dev/null +++ b/Algorithms/0726.number-of-atoms/number-of-atoms_test.go @@ -0,0 +1,54 @@ +package problem0726 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + formula string + ans string +}{ + + { + "H2O", + "H2O", + }, + + { + "Mg(OH)2", + "H2MgO2", + }, + + { + "K4(ON(SO3)2)2K4(ON(SO3)2)2", + "K8N4O28S8", + }, + + { + "K4(ON(SO3)2)2", + "K4N2O14S4", + }, + + // 可以有多个 testcase +} + +func Test_countOfAtoms(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countOfAtoms(tc.formula), "输入:%v", tc) + } +} + +func Benchmark_countOfAtoms(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countOfAtoms(tc.formula) + } + } +} diff --git a/Algorithms/0728.self-dividing-numbers/README.md b/Algorithms/0728.self-dividing-numbers/README.md new file mode 100755 index 000000000..1dafd06e5 --- /dev/null +++ b/Algorithms/0728.self-dividing-numbers/README.md @@ -0,0 +1,27 @@ +# [728. Self Dividing Numbers](https://leetcode.com/problems/self-dividing-numbers/) + +## 题目 + +A self-dividing number is a number that is divisible by every digit it contains. + +For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. + +Also, a self-dividing number is not allowed to contain the digit zero. + +Given a lower and upper number bound, output a list of every possible self dividing number, including the bounds if possible. + +Example 1: + +```text +Input: +left = 1, right = 22 +Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22] +``` + +Note: + +The boundaries of each input argument are 1 <= left <= right <= 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0728.self-dividing-numbers/self-dividing-numbers.go b/Algorithms/0728.self-dividing-numbers/self-dividing-numbers.go new file mode 100755 index 000000000..a653db1d5 --- /dev/null +++ b/Algorithms/0728.self-dividing-numbers/self-dividing-numbers.go @@ -0,0 +1,23 @@ +package problem0728 + +func selfDividingNumbers(left, right int) []int { + res := make([]int, 0, right-left+1) + for i := left; i <= right; i++ { + if isSelfDividing(i) { + res = append(res, i) + } + } + return res +} + +func isSelfDividing(n int) bool { + t := n + for t > 0 { + d := t % 10 + t /= 10 + if d == 0 || n%d != 0 { + return false + } + } + return true +} diff --git a/Algorithms/0728.self-dividing-numbers/self-dividing-numbers_test.go b/Algorithms/0728.self-dividing-numbers/self-dividing-numbers_test.go new file mode 100755 index 000000000..ab56bb633 --- /dev/null +++ b/Algorithms/0728.self-dividing-numbers/self-dividing-numbers_test.go @@ -0,0 +1,40 @@ +package problem0728 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + left, right int + ans []int +}{ + + { + 1, + 22, + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, selfDividingNumbers(tc.left, tc.right), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + selfDividingNumbers(tc.left, tc.right) + } + } +} diff --git a/Algorithms/0729.my-calendar-i/README.md b/Algorithms/0729.my-calendar-i/README.md new file mode 100755 index 000000000..c918774d8 --- /dev/null +++ b/Algorithms/0729.my-calendar-i/README.md @@ -0,0 +1,33 @@ +# [729. My Calendar I](https://leetcode.com/problems/my-calendar-i/) + +## 题目 + +Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. + +Your class will have the method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the range of real numbers x such that start <= x < end. + +A double booking happens when two events have some non-empty intersection (ie., there is some time that is common to both events.) + +For each call to the method MyCalendar.book, return true if the event can be added to the calendar successfully without causing a double booking. Otherwise, return false and do not add the event to the calendar. + +Your class will be called like this: MyCalendar cal = new MyCalendar(); MyCalendar.book(start, end) +Example 1: + +```text +MyCalendar(); +MyCalendar.book(10, 20); // returns true +MyCalendar.book(15, 25); // returns false +MyCalendar.book(20, 30); // returns true +Explanation: +The first event can be booked. The second can't because time 15 is already booked by another event. +The third event can be booked, as the first event takes every time less than 20, but not including 20. +``` + +Note: + +- The number of calls to MyCalendar.book per test case will be at most 1000. +- In calls to MyCalendar.book(start, end), start and end are integers in the range [0, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0729.my-calendar-i/my-calendar-i.go b/Algorithms/0729.my-calendar-i/my-calendar-i.go new file mode 100755 index 000000000..c27ff607f --- /dev/null +++ b/Algorithms/0729.my-calendar-i/my-calendar-i.go @@ -0,0 +1,47 @@ +package problem0729 + +// MyCalendar 是我的日历类 +type MyCalendar struct { + head *event +} +type event struct { + start, end int + next *event +} + +// Constructor 构建 MyCanlendar +func Constructor() MyCalendar { + var head *event + return MyCalendar{head: head} +} + +// Book 可以预约时间 +func (m *MyCalendar) Book(start int, end int) bool { + e := &event{start: start, end: end} + + if m.head == nil || // 还没有事件记录 + e.end <= m.head.start { // 新事件的截止事件,在所有事件开始之前 + e.next, m.head = m.head, e + return true + } + + t := &event{next: m.head} + // 跳过所有在 e 开始之前的事件 + for t.next != nil && t.next.end <= e.start { + t = t.next + } + + if t.next == nil || // e 开始事件在所有事件结束之后 + e.end <= t.next.start { // e 结束后,才开始下一个事件 + e.next, t.next = t.next, e + return true + } + + return false +} + +/** + * Your MyCalendar object will be instantiated and called as such: + * obj := Constructor(); + * param_1 := obj.Book(start,end); + */ diff --git a/Algorithms/0729.my-calendar-i/my-calendar-i_test.go b/Algorithms/0729.my-calendar-i/my-calendar-i_test.go new file mode 100755 index 000000000..592f1a680 --- /dev/null +++ b/Algorithms/0729.my-calendar-i/my-calendar-i_test.go @@ -0,0 +1,19 @@ +package problem0729 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MyCanlendar(t *testing.T) { + ast := assert.New(t) + + mc := Constructor() + + ast.True(mc.Book(10, 20)) + + ast.False(mc.Book(15, 25)) + + ast.True(mc.Book(20, 30)) +} diff --git a/Algorithms/0730.count-different-palindromic-subsequences/README.md b/Algorithms/0730.count-different-palindromic-subsequences/README.md new file mode 100755 index 000000000..9dd0a18b1 --- /dev/null +++ b/Algorithms/0730.count-different-palindromic-subsequences/README.md @@ -0,0 +1,41 @@ +# [730. Count Different Palindromic Subsequences](https://leetcode.com/problems/count-different-palindromic-subsequences/) + +## 题目 + +Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7. + +A subsequence of a string S is obtained by deleting 0 or more characters from S. + +A sequence is palindromic if it is equal to the sequence reversed. + +Two sequences `A_1`, `A_2`, ... and `B_1`, `B_2`, ... are different if there is some i for which `A_i` != `B_i`. + +Example 1: + +```text +Input: +S = 'bccb' +Output: 6 +Explanation: +The 6 different non-empty palindromic subsequences are 'b', 'c', 'bb', 'cc', 'bcb', 'bccb'. +Note that 'bcb' is counted only once, even though it occurs twice. +``` + +Example 2: + +```text +Input: +S = 'abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba' +Output: 104860361 +Explanation: +There are 3104860382 different non-empty palindromic subsequences, which is 104860361 modulo 10^9 + 7. +``` + +Note: + +- The length of S will be in the range [1, 1000]. +- Each character S[i] will be in the set {'a', 'b', 'c', 'd'}. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences.go b/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences.go new file mode 100755 index 000000000..a5800d03d --- /dev/null +++ b/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences.go @@ -0,0 +1,87 @@ +package problem0730 + +const mod int = 1e9 + 7 + +// 题目中限定了,s 中只存在 a,b,c,d 这 4 个字母,在程序中,使用 0~3 替代他们 +func countPalindromicSubsequences(s string) int { + n := len(s) + + // dp[i][j] 表示 countPalindromicSubsquences(s[i:j+1]) + dp := make([][]int, n) + for i := 0; i < n; i++ { + dp[i] = make([]int, n) + dp[i][i] = 1 + } + + // before[i][0] == k 表示 + // 如果 0<=k<=i 的话, s[:i+1]中 s[k]=='a',且 s[k+1:i+1] 中没有 'a' + // 否则的话, s[:i+1] 中并没有 'a' + before := make([][]int, n) + // after[j][0] == k 表示 + // 如果 j<=k right { + return 0 + } + + // 已经计算过了,直接返回答案 + if dp[left][right] != 0 { + return dp[left][right] + } + + total := 0 + + for c := 0; c < 4; c++ { + i := after[left][c] + j := before[right][c] + if left <= i && j <= right { + if i < j { + // 此时 + // s[left:right+1] 中至少有 2 个 c + // 那么可以组成的回文格式为 + // c + // cc + // c*c,其中 * 代表 s[i+1:j] 中的不同回文数量 + // 所以,此时以 c 为两端的回文数量,等于 + // s[i+1:j] 中的回文数量 + 2 + // 即 + // helper(dp, before, after, i+1, j-1) + 2 + + total += helper(dp, before, after, i+1, j-1) + 2 + } else if i == j { + // i==j 说明此时只有一个单字符的回文 c + total++ + } + } + } + + total %= mod + dp[left][right] = total + + return total +} diff --git a/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences_test.go b/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences_test.go new file mode 100755 index 000000000..079c97062 --- /dev/null +++ b/Algorithms/0730.count-different-palindromic-subsequences/count-different-palindromic-subsequences_test.go @@ -0,0 +1,69 @@ +package problem0730 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "aacaca", + 11, + }, + + { + "aabacabaa", + 28, + }, + + { + "aabcdaa", + 13, + }, + + { + "abcda", + 8, + }, + + { + "bccb", + 6, + }, + + { + "abcdabcdabcdabcdabcdabcdabcdabcddcbadcbadcbadcbadcbadcbadcbadcba", + 104860361, + }, + + { + "bdddbcbaaacdcbacdbbcdcacdddacdbaddbabdbcbccdbdcadbbbbdabacdddcbacabcdcdaccdcbdaadbbbbdbddccacdadadbcbddbdccbcacbdcabdbdcccbdccbcdbadbcdbacadadaaadacdaadaabdbcccddcccdcadaccdaacbdddcbadadcadcbcbaaadcaabadbcadcdaaddacaddbadbbdbbcacaaacbbaadcaadbbaadbbbabbddcacaaabddbccbcacaadcbabcaaacdbdbcdabdbdddbcddaaabcadccbcdccdcdadbcddcdaacbaadbcbcdcbadbccbdbaabbabcadacbdcdbaadbcacdcbabcdaabdccadabccdccdcabbcabcbccdaaaddabbcdabcbdbddbbddaadbcbbddabccadccbcccdcdcbbbdaccdcbdccbdbbaacbabacdcabcdbcbadadadbcdaccaadcdcbbbcdcbcbcbaaaadcabacbdbdbcaddbadcaabdbacbaacbdcadcdbacbbbbabacdbcdaacdcbdadaaddbacccbccccaacabacddbbbbcbcbccbbccaddbaabcdbdbaaaccddacaaccdaccdcbcacbccbbabcbcadbcbdacdcbdacacadcdbbbbdcbddcddddaadbdacbcddbdacbadaacdabaddddaddbcbbbdaddcaaaabaacdbacaddcadbcaaabdbcdacaabcdcdcdddacdacbabdcaabdaaadddbcdbbdaacacacbabaadaaabcdbbabacddcdbaacaaadddddcabdabaababcbdcbadbddaccddcbabbdbcbaacdbbbdbdadddacdcddaacdbbadbacbcaccacbbbbdcadabadaccbcdcbcbbacacdaddabdddbdccbbccdaacbcbbabaddabcbbacccbbadbadbccccccc", + 115571776, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countPalindromicSubsequences(tc.s), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countPalindromicSubsequences(tc.s) + } + } +} diff --git a/Algorithms/0731.my-calendar-ii/README.md b/Algorithms/0731.my-calendar-ii/README.md new file mode 100755 index 000000000..49c03830d --- /dev/null +++ b/Algorithms/0731.my-calendar-ii/README.md @@ -0,0 +1,39 @@ +# [731. My Calendar II](https://leetcode.com/problems/my-calendar-ii/) + +## 题目 + +Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. + +Your class will have one method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the range of real numbers x such that start <= x < end. + +A triple booking happens when three events have some non-empty intersection (ie., there is some time that is common to all 3 events.) + +For each call to the method MyCalendar.book, return true if the event can be added to the calendar successfully without causing a triple booking. Otherwise, return false and do not add the event to the calendar. + +Your class will be called like this: MyCalendar cal = new MyCalendar(); MyCalendar.book(start, end) +Example 1: + +```text +MyCalendar(); +MyCalendar.book(10, 20); // returns true +MyCalendar.book(50, 60); // returns true +MyCalendar.book(10, 40); // returns true +MyCalendar.book(5, 15); // returns false +MyCalendar.book(5, 10); // returns true +MyCalendar.book(25, 55); // returns true +Explanation: +The first two events can be booked. The third event can be double booked. +The fourth event (5, 15) can't be booked, because it would result in a triple booking. +The fifth event (5, 10) can be booked, as it does not use time 10 which is already double booked. +The sixth event (25, 55) can be booked, as the time in [25, 40) will be double booked with the third event; +the time [40, 50) will be single booked, and the time [50, 55) will be double booked with the second event. +``` + +Note: + +- The number of calls to MyCalendar.book per test case will be at most 1000. +- In calls to MyCalendar.book(start, end), start and end are integers in the range [0, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0731.my-calendar-ii/my-calendar-ii.go b/Algorithms/0731.my-calendar-ii/my-calendar-ii.go new file mode 100755 index 000000000..2309166ab --- /dev/null +++ b/Algorithms/0731.my-calendar-ii/my-calendar-ii.go @@ -0,0 +1,102 @@ +package problem0731 + +import ( + "sort" +) + +// MyCalendarTwo 第二个日历类 +type MyCalendarTwo struct { + events [][]int +} + +// Constructor 返回 MyCalendarTwo +func Constructor() MyCalendarTwo { + return MyCalendarTwo{} +} + +// Book 可以预约事件,预约成功返回 true +func (m *MyCalendarTwo) Book(start, end int) bool { + e := []int{start, end, 1} + + n := len(m.events) + if n == 0 { + m.events = append(m.events, e) + return true + } + + i := sort.Search(n, func(i int) bool { + return e[0] < m.events[i][1] + }) + + j := sort.Search(n, func(j int) bool { + return e[1] <= m.events[j][0] + }) + + if i == j { + m.events = append(m.events, nil) + copy(m.events[i+1:], m.events[i:]) + m.events[i] = e + return true + } + + for k := i; k < j; k++ { + if m.events[k][2] == 2 { + return false + } + } + + segements := overlap(m.events[i:j], e) + temp := make([][]int, len(m.events)-j) + copy(temp, m.events[j:]) + m.events = m.events[:i] + m.events = append(m.events, segements...) + m.events = append(m.events, temp...) + + return true +} + +func overlap(events [][]int, e []int) [][]int { + res := make([][]int, 0, len(events)*2+1) + + for i := 0; i < len(events); i++ { + // 切除头部不重叠的部分 + // 运行完成后, + // e[0]==events[i][0] + if e[0] < events[i][0] { + e1 := []int{e[0], events[i][0], 1} + res = append(res, e1) + e[0] = events[i][0] + } else if events[i][0] < e[0] { + e1 := []int{events[i][0], e[0], 1} + res = append(res, e1) + events[i][0] = e[0] + } + // 计算其中重叠的部分 + if e[1] < events[i][1] { + e2 := []int{e[0], e[1], 2} + e1 := []int{e[1], events[i][1], 1} + res = append(res, e2, e1) + e = nil + } else if e[1] == events[i][1] { + e2 := []int{e[0], e[1], 2} + res = append(res, e2) + e = nil + } else { + e2 := []int{e[0], events[i][1], 2} + res = append(res, e2) + e[0] = events[i][1] + } + } + + if e != nil { + res = append(res, e) + } + + return res +} + +/** + * Your MyCalendarTwo object will be instantiated and called as such: + * obj := Constructor(); + * param_1 := obj.Book(start,end); + */ diff --git a/Algorithms/0731.my-calendar-ii/my-calendar-ii_test.go b/Algorithms/0731.my-calendar-ii/my-calendar-ii_test.go new file mode 100755 index 000000000..a8769f0a7 --- /dev/null +++ b/Algorithms/0731.my-calendar-ii/my-calendar-ii_test.go @@ -0,0 +1,84 @@ +package problem0731 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MyCanlendar(t *testing.T) { + ast := assert.New(t) + + mc := Constructor() + + ast.True(mc.Book(10, 20)) + ast.True(mc.Book(50, 60)) + ast.True(mc.Book(10, 40)) + + ast.False(mc.Book(5, 15)) + + ast.True(mc.Book(5, 10)) + ast.True(mc.Book(25, 55)) +} + +func Test_MyCanlendar_2(t *testing.T) { + events := [][]int{ + {5, 12}, + {42, 50}, + {4, 9}, + {33, 41}, + {2, 7}, + {16, 25}, + {7, 16}, + {6, 11}, + {13, 18}, + {38, 43}, + {49, 50}, + {6, 15}, + {5, 13}, + {35, 42}, + {19, 24}, + {46, 50}, + {39, 44}, + {28, 36}, + {28, 37}, + {20, 29}, + {41, 49}, + {11, 19}, + {41, 46}, + {28, 37}, + {17, 23}, + {22, 31}, + {4, 10}, + {31, 40}, + {4, 12}, + {19, 26}, + } + ans := []bool{true, true, true, true, false, true, false, false, true, true, true, false, false, false, true, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false} + + ast := assert.New(t) + + mc := Constructor() + + for i, e := range events { + // fmt.Println(i, e) + ast.Equal(ans[i], mc.Book(e[0], e[1]), "输入是 %d, %v", i, e) + // fmt.Println(mc.events) + } +} +func Test_MyCanlendar_3(t *testing.T) { + events := [][]int{ + {22, 29}, {12, 17}, {20, 27}, {27, 36}, {24, 31}, {23, 28}, {47, 50}, {23, 30}, {24, 29}, {19, 25}, {19, 27}, {3, 9}, {34, 41}, {22, 27}, {3, 9}, {29, 38}, {34, 40}, {49, 50}, {42, 48}, {43, 50}, {39, 44}, {30, 38}, {42, 50}, {31, 39}, {9, 16}, {10, 18}, {31, 39}, {30, 39}, {48, 50}, {36, 42}, + } + ans := []bool{true, true, true, true, false, false, true, false, false, false, false, true, true, false, true, false, false, true, true, false, true, false, false, false, true, false, false, false, false, false} + + ast := assert.New(t) + + mc := Constructor() + + for i, e := range events { + // fmt.Println(i, e) + ast.Equal(ans[i], mc.Book(e[0], e[1]), "输入是 %d, %v", i, e) + // fmt.Println(mc.events) + } +} diff --git a/Algorithms/0732.my-calendar-iii/732.100.png b/Algorithms/0732.my-calendar-iii/732.100.png new file mode 100644 index 000000000..ffd9c66d6 Binary files /dev/null and b/Algorithms/0732.my-calendar-iii/732.100.png differ diff --git a/Algorithms/0732.my-calendar-iii/README.md b/Algorithms/0732.my-calendar-iii/README.md new file mode 100755 index 000000000..5a53d158f --- /dev/null +++ b/Algorithms/0732.my-calendar-iii/README.md @@ -0,0 +1,42 @@ +# [732. My Calendar III](https://leetcode.com/problems/my-calendar-iii/) + +## 题目 + +Implement a MyCalendarThree class to store your events. A new event can always be added. + +Your class will have one method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the range of real numbers x such that start <= x < end. + +A K-booking happens when K events have some non-empty intersection (ie., there is some time that is common to all K events.) + +For each call to the method MyCalendar.book, return an integer K representing the largest integer such that there exists a K-booking in the calendar. + +Your class will be called like this: MyCalendarThree cal = new MyCalendarThree(); MyCalendarThree.book(start, end) + +Example 1: + +```text +MyCalendarThree(); +MyCalendarThree.book(10, 20); // returns 1 +MyCalendarThree.book(50, 60); // returns 1 +MyCalendarThree.book(10, 40); // returns 2 +MyCalendarThree.book(5, 15); // returns 3 +MyCalendarThree.book(5, 10); // returns 3 +MyCalendarThree.book(25, 55); // returns 3 +Explanation: +The first two events can be booked and are disjoint, so the maximum K-booking is a 1-booking. +The third event [10, 40) intersects the first event, and the maximum K-booking is a 2-booking. +The remaining events cause the maximum K-booking to be only a 3-booking. +Note that the last event locally causes a 2-booking, but the answer is still 3 because +eg. [10, 20), [10, 40), and [5, 15) are still triple booked. +``` + +Note: + +- The number of calls to MyCalendarThree.book per test case will be at most 400. +- In calls to MyCalendarThree.book(start, end), start and end are integers in the range [0, 10^9]. + +## 解题思路 + +见程序注释 + +![100](732.100.png) \ No newline at end of file diff --git a/Algorithms/0732.my-calendar-iii/my-calendar-iii.go b/Algorithms/0732.my-calendar-iii/my-calendar-iii.go new file mode 100755 index 000000000..c9d1bc9b5 --- /dev/null +++ b/Algorithms/0732.my-calendar-iii/my-calendar-iii.go @@ -0,0 +1,111 @@ +package problem0732 + +import "sort" + +// MyCalendarThree 第二个日历类 +type MyCalendarThree struct { + events [][]int + k int +} + +// Constructor 返回 MyCalendarTwo +func Constructor() MyCalendarThree { + return MyCalendarThree{} +} + +// Book 可以预约事件,预约成功返回 true +func (m *MyCalendarThree) Book(start, end int) int { + // e[2] 代表了此时间段的重合程度 + e := []int{start, end, 1} + + n := len(m.events) + if n == 0 { + m.events = append(m.events, e) + m.k = 1 + return m.k + } + + i := sort.Search(n, func(i int) bool { + return e[0] < m.events[i][1] + }) + j := sort.Search(n, func(j int) bool { + return e[1] <= m.events[j][0] + }) + + // m.events[i:j] 中的事件,都会与 e 有交集 + // 但如果 i==j 的话 + // 说明 e 应该插入到 m.events[i] 的位置 + if i == j { + m.events = append(m.events, nil) + copy(m.events[i+1:], m.events[i:]) + m.events[i] = e + return m.k + } + + // 更新 m.k + for k := i; k < j; k++ { + m.k = max(m.k, m.events[k][2]+1) + } + + segements := overlap(m.events[i:j], e) + temp := make([][]int, len(m.events)-j) + copy(temp, m.events[j:]) + m.events = m.events[:i] + m.events = append(m.events, segements...) + m.events = append(m.events, temp...) + + return m.k +} + +func overlap(events [][]int, e []int) [][]int { + res := make([][]int, 0, len(events)*2+1) + + for i := 0; i < len(events); i++ { + // 切除头部不重叠的部分 + // 运行完成后, + // e[0]==events[i][0] + if e[0] < events[i][0] { + e1 := []int{e[0], events[i][0], 1} + res = append(res, e1) + e[0] = events[i][0] + } else if events[i][0] < e[0] { + ei := []int{events[i][0], e[0], events[i][2]} + res = append(res, ei) + events[i][0] = e[0] + } + // 计算其中重叠的部分 + if e[1] < events[i][1] { + eo := []int{e[0], e[1], events[i][2] + 1} + ei := []int{e[1], events[i][1], events[i][2]} + res = append(res, eo, ei) + e = nil + } else if e[1] == events[i][1] { + eo := []int{e[0], e[1], events[i][2] + 1} + res = append(res, eo) + e = nil + } else { + eo := []int{e[0], events[i][1], events[i][2] + 1} + res = append(res, eo) + e[0] = events[i][1] + } + } + + if e != nil { + res = append(res, e) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +/** + * Your MyCalendarTwo object will be instantiated and called as such: + * obj := Constructor(); + * param_1 := obj.Book(start,end); + */ diff --git a/Algorithms/0732.my-calendar-iii/my-calendar-iii_test.go b/Algorithms/0732.my-calendar-iii/my-calendar-iii_test.go new file mode 100755 index 000000000..feb045ee9 --- /dev/null +++ b/Algorithms/0732.my-calendar-iii/my-calendar-iii_test.go @@ -0,0 +1,29 @@ +package problem0732 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MyCanlendar(t *testing.T) { + events := [][]int{ + {10, 20}, + {50, 60}, + {10, 40}, + {5, 15}, + {5, 10}, + {25, 55}, + } + ans := []int{1, 1, 2, 3, 3, 3} + + ast := assert.New(t) + + mc := Constructor() + + for i, e := range events { + // fmt.Println(i, e) + ast.Equal(ans[i], mc.Book(e[0], e[1]), "输入是 %d, %v", i, e) + // fmt.Println(mc.events) + } +} diff --git a/Algorithms/0733.flood-fill/README.md b/Algorithms/0733.flood-fill/README.md new file mode 100755 index 000000000..15a1ca71d --- /dev/null +++ b/Algorithms/0733.flood-fill/README.md @@ -0,0 +1,35 @@ +# [733. Flood Fill](https://leetcode.com/problems/flood-fill/) + +## 题目 + +An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). + +Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image. + +To perform a "flood fill", consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color as the starting pixel), and so on. Replace the color of all of the aforementioned pixels with the newColor. + +At the end, return the modified image. + +Example 1: + +```text +Input: +image = [[1,1,1],[1,1,0],[1,0,1]] +sr = 1, sc = 1, newColor = 2 +Output: [[2,2,2],[2,2,0],[2,0,1]] +Explanation: +From the center of the image (with position (sr, sc) = (1, 1)), all pixels connected +by a path of the same color as the starting pixel are colored with the new color. +Note the bottom corner is not colored 2, because it is not 4-directionally connected +to the starting pixel. +``` + +Note: + +1. The length of image and image[0] will be in the range [1, 50]. +1. The given starting pixel will satisfy 0 <= sr < image.length and 0 <= sc < image[0].length. +1. The value of each color in image[i][j] and newColor will be an integer in [0, 65535]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0733.flood-fill/flood-fill.go b/Algorithms/0733.flood-fill/flood-fill.go new file mode 100755 index 000000000..9a4bdb431 --- /dev/null +++ b/Algorithms/0733.flood-fill/flood-fill.go @@ -0,0 +1,34 @@ +package problem0733 + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +func floodFill(image [][]int, sr, sc, newColor int) [][]int { + oldColor := image[sr][sc] + if oldColor == newColor { + return image + } + + m, n := len(image), len(image[0]) + + coordinates := make([][]int, 1, m*n) + coordinates[0] = []int{sr, sc} + + for len(coordinates) > 0 { + c := coordinates[0] + coordinates = coordinates[1:] + image[c[0]][c[1]] = newColor + + for i := 0; i < 4; i++ { + x := c[0] + dx[i] + y := c[1] + dy[i] + if 0 <= x && x < m && + 0 <= y && y < n && + image[x][y] == oldColor { + coordinates = append(coordinates, []int{x, y}) + } + } + } + + return image +} diff --git a/Algorithms/0733.flood-fill/flood-fill_test.go b/Algorithms/0733.flood-fill/flood-fill_test.go new file mode 100755 index 000000000..63ca7950d --- /dev/null +++ b/Algorithms/0733.flood-fill/flood-fill_test.go @@ -0,0 +1,53 @@ +package problem0733 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + image [][]int + sr int + sc int + newColor int + ans [][]int +}{ + + { + [][]int{{0, 0, 0}, {0, 1, 1}}, + 1, + 1, + 1, + [][]int{{0, 0, 0}, {0, 1, 1}}, + }, + + { + [][]int{{1, 1, 1}, {1, 1, 0}, {1, 0, 1}}, + 1, + 1, + 2, + [][]int{{2, 2, 2}, {2, 2, 0}, {2, 0, 1}}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, floodFill(tc.image, tc.sr, tc.sc, tc.newColor), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + floodFill(tc.image, tc.sr, tc.sc, tc.newColor) + } + } +} diff --git a/Algorithms/0735.asteroid-collision/README.md b/Algorithms/0735.asteroid-collision/README.md new file mode 100755 index 000000000..d58f28a9d --- /dev/null +++ b/Algorithms/0735.asteroid-collision/README.md @@ -0,0 +1,59 @@ +# [735. Asteroid Collision](https://leetcode.com/problems/asteroid-collision/) + +## 题目 + +We are given an array asteroids of integers representing asteroids in a row. + +For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed. + +Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet. + +Example 1: + +```text +Input: +asteroids = [5, 10, -5] +Output: [5, 10] +Explanation: +The 10 and -5 collide resulting in 10. The 5 and 10 never collide. +``` + +Example 2: + +```text +Input: +asteroids = [8, -8] +Output: [] +Explanation: +The 8 and -8 collide exploding each other. +``` + +Example 3: + +```text +Input: +asteroids = [10, 2, -5] +Output: [10] +Explanation: +The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10. +``` + +Example 4: + +```text +Input: +asteroids = [-2, -1, 1, 2] +Output: [-2, -1, 1, 2] +Explanation: +The -2 and -1 are moving left, while the 1 and 2 are moving right. +Asteroids moving the same direction never meet, so no asteroids will meet each other. +``` + +Note: + +- The length of asteroids will be at most 10000. +- Each asteroid will be a non-zero integer in the range [-1000, 1000].. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0735.asteroid-collision/asteroid-collision.go b/Algorithms/0735.asteroid-collision/asteroid-collision.go new file mode 100755 index 000000000..ef065f9a4 --- /dev/null +++ b/Algorithms/0735.asteroid-collision/asteroid-collision.go @@ -0,0 +1,31 @@ +package problem0735 + +func asteroidCollision(asteroids []int) []int { + res := make([]int, 0, len(asteroids)) + stack := make([]int, 0, len(asteroids)) + + for _, a := range asteroids { + if a > 0 { + stack = append(stack, a) + continue + } + + for len(stack) > 0 && stack[len(stack)-1] <= -a { + last := stack[len(stack)-1] + stack = stack[:len(stack)-1] + if last == -a { + a = 0 + break + } + } + + if len(stack) == 0 && a != 0 { + res = append(res, a) + continue + } + } + + res = append(res, stack...) + + return res +} diff --git a/Algorithms/0735.asteroid-collision/asteroid-collision_test.go b/Algorithms/0735.asteroid-collision/asteroid-collision_test.go new file mode 100755 index 000000000..c893ff7fb --- /dev/null +++ b/Algorithms/0735.asteroid-collision/asteroid-collision_test.go @@ -0,0 +1,54 @@ +package problem0735 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + asteroids []int + ans []int +}{ + + { + []int{5, 10, -5}, + []int{5, 10}, + }, + + { + []int{8, -8}, + []int{}, + }, + + { + []int{10, 2, -5}, + []int{10}, + }, + + { + []int{-2, -1, 1, 2}, + []int{-2, -1, 1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, asteroidCollision(tc.asteroids), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + asteroidCollision(tc.asteroids) + } + } +} diff --git a/Algorithms/0736.parse-lisp-expression/README.md b/Algorithms/0736.parse-lisp-expression/README.md new file mode 100755 index 000000000..2ce4cd1e3 --- /dev/null +++ b/Algorithms/0736.parse-lisp-expression/README.md @@ -0,0 +1,62 @@ +# [736. Parse Lisp Expression](https://leetcode.com/problems/parse-lisp-expression/) + +## 题目 + +You are given a string expression representing a Lisp-like expression to return the integer value of. + +The syntax for these expressions is given as follows. + +- An expression is either an integer, a let-expression, an add-expression, a mult-expression, or an assigned variable. Expressions always evaluate to a single integer. +- (An integer could be positive or negative.) +- A let-expression takes the form (let v1 e1 v2 e2 ... vn en expr), where let is always the string "let", then there are 1 or more pairs of alternating variables and expressions, meaning that the first variable v1 is assigned the value of the expression e1, the second variable v2 is assigned the value of the expression e2, and so on sequentially; and then the value of this let-expression is the value of the expression expr. +- An add-expression takes the form (add e1 e2) where add is always the string "add", there are always two expressions e1, e2, and this expression evaluates to the addition of the evaluation of e1 and the evaluation of e2. +- A mult-expression takes the form (mult e1 e2) where mult is always the string "mult", there are always two expressions e1, e2, and this expression evaluates to the multiplication of the evaluation of e1 and the evaluation of e2. +- For the purposes of this question, we will use a smaller subset of variable names. A variable starts with a lowercase letter, then zero or more lowercase letters or digits. Additionally for your convenience, the names "add", "let", or "mult" are protected and will never be used as variable names. +- Finally, there is the concept of scope. When an expression of a variable name is evaluated, within the context of that evaluation, the innermost scope (in terms of parentheses) is checked first for the value of that variable, and then outer scopes are checked sequentially. It is guaranteed that every expression is legal. Please see the examples for more details on scope. + +Evaluation Examples: + +```text +Input: (add 1 2) +Output: 3 + +Input: (mult 3 (add 2 3)) +Output: 15 + +Input: (let x 2 (mult x 5)) +Output: 10 + +Input: (let x 2 (mult x (let x 3 y 4 (add x y)))) +Output: 14 +Explanation: In the expression (add x y), when checking for the value of the variable x, +we check from the innermost scope to the outermost in the context of the variable we are trying to evaluate. +Since x = 3 is found first, the value of x is 3. + +Input: (let x 3 x 2 x) +Output: 2 +Explanation: Assignment in let statements is processed sequentially. + +Input: (let x 1 y 2 x (add x y) (add x y)) +Output: 5 +Explanation: The first (add x y) evaluates as 3, and is assigned to x. +The second (add x y) evaluates as 3+2 = 5. + +Input: (let x 2 (add (let x 3 (let x 4 x)) x)) +Output: 6 +Explanation: Even though (let x 4 x) has a deeper scope, it is outside the context +of the final x in the add-expression. That final x will equal 2. + +Input: (let a1 3 b2 (add a1 1) b2) +Output 4 +Explanation: Variable names can contain digits after the first character. +``` + +Note: + +- The given string expression is well formatted: There are no leading or trailing spaces, there is only a single space separating different components of the string, and no space between adjacent parentheses. The expression is guaranteed to be legal and evaluate to an integer. +- The length of expression is at most 2000. (It is also non-empty, as that would not be a legal expression.) +- The answer and all intermediate calculations of that answer are guaranteed to fit in a 32-bit integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0736.parse-lisp-expression/parse-lisp-expression.go b/Algorithms/0736.parse-lisp-expression/parse-lisp-expression.go new file mode 100755 index 000000000..3421f2eb2 --- /dev/null +++ b/Algorithms/0736.parse-lisp-expression/parse-lisp-expression.go @@ -0,0 +1,110 @@ +package problem0736 + +import "strconv" + +func evaluate(expression string) int { + return helper(expression, nil) +} + +func helper(exp string, s *scope) int { + if exp[0] != '(' { + num, err := strconv.Atoi(exp) + if err != nil { + return s.get(exp) + } + return num + } + + // 删除外层的 "()" + exp = exp[1 : len(exp)-1] + var keyWord string + keyWord, exp = split(exp) + switch keyWord { + case "add": + a, b := split(exp) + return helper(a, s) + helper(b, s) + case "mult": + a, b := split(exp) + return helper(a, s) * helper(b, s) + default: + // 遇到 let 就意味着要生成新的 scope 了 + s = newScope(s) + var key, val string + for { + key, exp = split(exp) + if exp == "" { + break + } + val, exp = split(exp) + s.add(key, helper(val, s)) + } + return helper(key, s) + } +} + +// split 把 exp 分割成 pre 和 post +// 其中 pre 是 exp 中的第一个独立的块,post 则是剩下的部分 +// 比如 +// exp = "add 1 2" +// 则 +// pre = "add" +// post = "1 2" +// 又比如 +// exp = "(add x1 (add x2 x3))" +// 则 +// pre = "(add x1 (add x2 x3))" +// post = "" +func split(exp string) (pre, post string) { + n := len(exp) + i := 0 + if exp[0] == '(' { + countLeft := 0 + for i < n { + if exp[i] == '(' { + countLeft++ + } else if exp[i] == ')' { + countLeft-- + } + if countLeft == 0 { + break + } + i++ + } + } else { + for i+1 < n { + if exp[i+1] == ' ' { + break + } + i++ + } + } + + pre = exp[:i+1] + if i+1 == n { + post = "" + } else { + post = exp[i+2:] + } + + return +} + +type scope struct { + parent *scope + m map[string]int +} + +func newScope(parent *scope) *scope { + return &scope{parent: parent, m: make(map[string]int, 8)} +} + +func (s *scope) get(key string) int { + if val, ok := s.m[key]; ok { + return val + } + return s.parent.get(key) +} + +func (s *scope) add(key string, val int) { + s.m[key] = val +} diff --git a/Algorithms/0736.parse-lisp-expression/parse-lisp-expression_test.go b/Algorithms/0736.parse-lisp-expression/parse-lisp-expression_test.go new file mode 100755 index 000000000..1f8adb535 --- /dev/null +++ b/Algorithms/0736.parse-lisp-expression/parse-lisp-expression_test.go @@ -0,0 +1,79 @@ +package problem0736 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + expression string + ans int +}{ + + { + "(let x0 4 x1 -2 x2 3 x3 -5 x4 -3 x5 -1 x6 3 x7 -2 x8 4 x9 -5 (mult x2 (mult (let x0 -3 x4 -2 x8 4 (mult (let x0 -2 x6 4 (add x5 x2)) x3)) (mult (mult -7 (mult -9 (let x0 -2 x7 3 (add -10 x0)))) x6))))", + 68040, + }, + + { + "(mult 3 (add 2 3))", + 15, + }, + + { + "(add 1 2)", + 3, + }, + + { + "(let x 2 (mult x 5))", + 10, + }, + + { + "(let x 2 (mult x (let x 3 y 4 (add x y))))", + 14, + }, + + { + "(let x 3 x 2 x)", + 2, + }, + + { + "(let x 1 y 2 x (add x y) (add x y))", + 5, + }, + + { + "(let x 2 (add (let x 3 (let x 4 x)) x))", + 6, + }, + + { + "(let a1 3 b2 (add a1 1) b2)", + 4, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, evaluate(tc.expression), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + evaluate(tc.expression) + } + } +} diff --git a/Algorithms/0738.monotone-increasing-digits/README.md b/Algorithms/0738.monotone-increasing-digits/README.md new file mode 100755 index 000000000..4e3614fc8 --- /dev/null +++ b/Algorithms/0738.monotone-increasing-digits/README.md @@ -0,0 +1,34 @@ +# [738. Monotone Increasing Digits](https://leetcode.com/problems/monotone-increasing-digits/) + +## 题目 + +Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. + +(Recall that an integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.) + +Example 1: + +```text +Input: N = 10 +Output: 9 +``` + +Example 2: + +```text +Input: N = 1234 +Output: 1234 +``` + +Example 3: + +```text +Input: N = 332 +Output: 299 +``` + +Note: N is an integer in the range [0, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits.go b/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits.go new file mode 100755 index 000000000..9526448f2 --- /dev/null +++ b/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits.go @@ -0,0 +1,24 @@ +package problem0738 + +import ( + "strconv" +) + +func monotoneIncreasingDigits(n int) int { + s := []byte(strconv.Itoa(n)) + for i := len(s) - 2; 0 <= i; i-- { + if s[i] <= s[i+1] { + continue + } + + // 当 s[i] > s[i+1] 时 + s[i]-- + // s[i+1:] 中的数字全部变成 9 + for j := i + 1; j < len(s); j++ { + s[j] = '9' + } + } + + res, _ := strconv.Atoi(string(s)) + return res +} diff --git a/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits_test.go b/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits_test.go new file mode 100755 index 000000000..36f9c5cf5 --- /dev/null +++ b/Algorithms/0738.monotone-increasing-digits/monotone-increasing-digits_test.go @@ -0,0 +1,42 @@ +package problem0738 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + {10, 9}, + + {1234, 1234}, + + {332, 299}, + + {1332, 1299}, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, monotoneIncreasingDigits(tc.n), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + monotoneIncreasingDigits(tc.n) + } + } +} diff --git a/Algorithms/0739.daily-temperatures/README.md b/Algorithms/0739.daily-temperatures/README.md new file mode 100755 index 000000000..571b656b0 --- /dev/null +++ b/Algorithms/0739.daily-temperatures/README.md @@ -0,0 +1,13 @@ +# [739. Daily Temperatures](https://leetcode.com/problems/daily-temperatures/) + +## 题目 + +Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead. + +For example, given the list temperatures = [73, 74, 75, 71, 69, 72, 76, 73], your output should be [1, 1, 4, 2, 1, 1, 0, 0]. + +Note: The length of temperatures will be in the range [1, 30000]. Each temperature will be an integer in the range [30, 100]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0739.daily-temperatures/daily-temperatures.go b/Algorithms/0739.daily-temperatures/daily-temperatures.go new file mode 100755 index 000000000..30eba34fe --- /dev/null +++ b/Algorithms/0739.daily-temperatures/daily-temperatures.go @@ -0,0 +1,21 @@ +package problem0739 + +func dailyTemperatures(temperatures []int) []int { + n := len(temperatures) + res := make([]int, n) + + stack := make([]int, n) + + top := -1 + for i := 0; i < n; i++ { + for top >= 0 && temperatures[stack[top]] < temperatures[i] { + res[stack[top]] = i - stack[top] + top-- + } + + top++ + stack[top] = i + } + + return res +} diff --git a/Algorithms/0739.daily-temperatures/daily-temperatures_test.go b/Algorithms/0739.daily-temperatures/daily-temperatures_test.go new file mode 100755 index 000000000..478751a1a --- /dev/null +++ b/Algorithms/0739.daily-temperatures/daily-temperatures_test.go @@ -0,0 +1,45 @@ +package problem0739 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + temperatures []int + ans []int +}{ + + { + []int{73, 74, 75, 71, 69, 72, 76, 73}, + []int{1, 1, 4, 2, 1, 1, 0, 0}, + }, + + { + []int { 71,76,71,76,71,76,76,71,76,71,71,71,76,76,76,76,71,76,76,76,71,76,71,76,76,76,71,71,76,76,76,71,71,71,76,71,76,76,76,71,76,71,71,76,76,76,71,71,71,71,71,71,71,71,71,71,71,71,76,71,76,76,76,71,71,76,76,76,76,71,76,71,71,71,76,71,76,71,76,76,71,71,71,76,71,71,76,76,71,71,71,71,76,71,71,71,71,76,76,71,76,76,71,71,76,71,71,76,71,71,71,71,76,71,76,76,76,76,71,71,76,76,76,76,71,76,71,76,71,76,76,71,71,71,76,71,71,71,71,71,76,71,76,71,76,71,71,76,71,71,76,71,71,71,71,71,76,76,76,76,71,76,76,71,71,71,76,71,76,71,71,76,76,76,76,71,71,76,71,76,76,76,76,76,71,76,76,71,71,71,71,71,76,76,71,71,76,71,76,71,76,76,71,71,76,76,71,76,71,71,71,76,76,76,76,76,76,71,71,76,76,71,71,76,76,76,76,71,76,76,76,76,76,71,76,76,76,76,71,76,71,71,71,71,76,76,76,76,71,76,71,71,76,71,76,76,71,76,71,71,76,71,76,76,76,76,76,71,76,71,71,76,71,71,71,76,76,76,71,76,76,71,76,71,71,76,76,76,71,71,76,71,76,76,71,76,71,76,76,71,76,71,71,71,71,76,71,71,76,71,76,76,76,71,71,76,71,76,76,76,76,71,76,76,71,76,76,76,76,71,76,76,76,76,71,76,76,76,71,71,71,71,71,76,76,71,71,76,71,76,71,71,71,76,76,76,71,71,76,71,76,71,71,71,71,76,76,71,76,71,76,71,76,71,76,71,71,71,71,76,71,71,76,76,76,71,76,76,76,76,71,76,76,71,76,76,71,71,71,76,71,71,76,71,76,71,71,76,76,71,76,71,76,76,71,71,71,76,71,76,76,71,71,76,71,76,71,76,76,71,71,71,76,71,76,71,71,71,71,76,71,71,76,71,76,76,76,71,76,76,76,76,71,71,76,71,76,76,71,76,76,71,76,76,71,76,71,71,71,71,76,76,71,71,76,76,76,71,76,71,71,76,76,76,71,71,71,71,76,71,71,71,76,76,76,76,76,71,76,76,71,71,71,76,76,76,71,71,71,76,76,76,76,76,76,76,76,71,76,76,76,76,76,71,76,71,76,71,71,71,76,71,76,71,76,76,76,76,71,76,71,71,71,76,71,71,76,76,76,71,71,76,76,71,71,71,76,76,71,76,76,71,76,71,71,76,71,76,71,76,76,71,71,76,76,71,76,71,71,71,76,71,76,76,76,71,71,76,76,76,76,71,71,71,76,71,76,71,71,76,71,76,76,76,76,76,76,76,71,76,76,76,71,71,71,76,76,76,71,76,76,76,71,71,76,71,76,71,71,76,76,76,76,71,76,76,76,76,71,71,76,71,71,76,76,71,71,76,71,71,76,76,76,76,76,71,71,76,76,76,76,71,71,71,76,71,71,76,76,71,71,76,76,71,76,76,71,76,76,76,76,76,76,76,71,71,71,71,76,76,71,76,71,71,76,76,71,76,71,71,71,71,76,71,71,76,76,71,76,76,71,76,71,71,76,76,76,71,76,71,71,76,71,76,71,76,76,76,71,76,71,71,71,71,76,76,71,76,76,76,76,71,71,71,71,76,71,71,76,76,76,76,71,76,71,76,76,76,76,71,76,76,76,76,71,76,71,71,76,76,76,76,76,76,76,76,71,71,76,76,76,76,76,76,76,71,76,71,76,71,76,76,71,76,76,71,71,71,71,76,71,71,76,71,76,76,76,76,76,71,71,76,76,76,71,71,71,76,71,76,76,71,76,71,76,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,76,71,76,71,71,76,76,71,71,71,71,71,76,76,76,71,76,71,71,76,71,76,71,76,71,76,76,76,71,76,71,76,76,76,71,76,76,76,71,71,76,76,71,76,71,71,71,76,76,76,71,71,76,76,76,71,76,71,71,71,76,71,76,76,76,76,76,76,71,76,71,71,71,76,76,76,76,76,76,76,71,76,71,76,76,76,71,71,71,76,71,71,76,76,71,71,76,76,76,76,71,76,76,71,71,76,71,71,71,71,76,71,76,76,76,71,71,71,76,71,76,76,76,76,71,76,71,71,76,76,71,76,71,76,76,71,71,71,76,76,71,76,76,71,76,76,76,76,76,71,76,71,71,76,71,76,76,76,71,71,76,76,71,76,71,76,71,71,71,71,76,71,76,71,71,76,76,71,76,76,71,76,76,76,76,76,71,71,76,76,71,76,71,71,71,71,71,71,71,76,76,71,76,76,76,71,76,71,76,76,71,71,71,76,76,76,71,71,76,76,76,76,76,71,71,76,76,76,76,71,71,71,76,76,71,76,71,71,71,71,71,76,76,71,71,71,76,71,71,71,71,76,76,71,76,76,71,71,76,71,76,71,71,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,76,71,76,76,76,71,76,76,71,76,76,76,76,76,71,71,76,76,76,76,76,71,76,76,76,71,76,76,71,76,76,71,71,71,71,76,71,76,71,76,71,76,76,71,71,76,76,71,71,76,71,76,71,71,71,71,76,71,71,76,76,71,71,76,71,76,71,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,71,71,76,76,71,76,76,76,71,76,71,71,76,76,71,71,76,71,76,71,76,76,71,71,76,76,71,71,71,76,71,76,76,71,71,76,71,76,76,71,76,71,76,76,71,71,76,71,76,71,71,76,71,71,71,76,71,76,71,71,76,76,71,71,71,71,76,76,76,71,71,76,71,71,76,76,71,71,76,71,71,71,71,71,76,71,71,71,76,76,71,71,71,76,76,71,71,71,76,71,76,76,76,76,71,71,71,76,76,76,71,71,71,71,71,76,76,71,71,71,71,71,71,76,76,76,71,76,76,76,76,71,71,76,71,71,71,76,76,71,76,76,71,76,76,71,76,71,71,76,71,76,76,71,71,71,76,71,76,71,76,76,71,71,76,76,71,76,71,71,76,76,71,76,76,71,76,76,71,76,76,76,71,71,76,76,76,71,71,71,76,76,71,71,76,71,71,71,76,76,71,76,71,71,71,76,71,71,71,76,76,76,71,76,76,71,71,76,71,76,71,71,71,76,71,71,71,76,76,71,76,71,71,71,71,76,71,71,76,76,76,71,71,76,76,71,71,76,71,76,71,76,71,76,71,71,76,71,76,76,76,76,71,76,71,76,76,71,76,71,76,76,71,76,76,76,71,76,71,76,71,71,71,76,71,76,71,76,76,71,76,71,76,71,71,71,76,76,71,76,76,76,76,71,71,71,76,71,71,71,76,76,71,76,76,76,71,76,71,76,76,76,76,76,71,71,76,76,76,71,71,71,76,71,71,71,76,71,76,71,76,71,71,76,71,71,76,76,71,71,76,76,76,71,76,71,76,76,76,76,71,71,76,71,76,71,76,71,76,76,76,71,76,76,71,71,71,71,71,71,71,71,71,76,76,76,71,76,71,76,71,76,71,76,76,71,71,76,71,71,71,76,71,76,71,76,76,71,76,71,76,76,71,76,76,76,76,71,76,76,76,71,76,76,76,76,76,76,71,76,76,76,76,76,71,76,76,76,71,76,76,76,76,76,71,71,71,71,71,71,76,76,71,71,76,76,76,76,71,76,76,76,71,76,71,76,71,76,71,71,76,76,71,76,71,71,76,76,71,71,71,76,76,76,71,71,76,71,76,76,76,76,71,71,71,76,71,71,76,76,71,71,76,71,76,71,76,76,76,76,76,76,71,71,76,76,71,71,71,71,71,71,71,71,71,76,71,71,71,71,76,76,71,71,76,76,76,71,76,76,71,76,71,71,76,71,71,71,76,76,71,71,71,76,76,71,76,71,76,71,76,76,76,76,71,76,71,71,71,76,71,71,71,71,71,71,71,71,71,71,71,71,71,71,76,71,71,71,71,76,71,71,71,71,71,71,76,76,71,76,71,71,71,76,71,71,71,71,76,71,76,71,71,71,71,71,76,76,76,71,71,71,76,76,71,76,71,76,76,76,76,76,76,76,71,76,76,76,76,71,71,76,76,76,71,71,71,76,76,76,71,71,76,76,76,71,76,71,71,76,71,71,76,76,76,76,71,71,71,71,71,76,76,76,76,76,71,71,76,71,71,76,71,71,76,71,76,76,76,71,71,76,76,76,71,71,71,71,71,71,76,76,76,71,76,71,71,71,76,76,71,76,76,71,76,76,76,76,76,71,76,76,76,71,71,71,76,71,76,71,76,71,76,76,71,71,76,71,76,71,71,71,76,76,71,76,76,76,76,76,71,71,76,76,71,71,71,71,71,76,76,76,71,71,76,76,71,76,76,76,76,71,76,76,71,71,76,76,71,71,71,71,76,71,76,76,71,76,76,76,76,76,76,76,76,71,76,76,76,76,71,71,71,71,71,76,76,76,71,76,76,71,76,71,71,76,76,71,76,71,76,76,76,71,71,76,71,76,71,76,71,71,76,76,76,76,71,76,76,76,76,71,76,71,71,71,71,71,71,76,76,71,71,76,71,71,76,76,71,71,71,71,71,71,71,71,76,76,76,71,76,71,71,71,71,76,71,71,71,71,76,71,71,71,71,71,76,71,71,71,71,71,76,71,76,76,76,76,76,71,76,76,71,71,76,76,71,71,71,71,76,71,71,71,76,71,76,71,76,76,76,71,76,76,76,76,76,76,76,76,71,71,71,76,71,71,71,71,71,76,76,76,76,71,76,71,71,76,71,76,71,71,76,76,71,76,76,76,76,76,76,71,76,76,71,76,71,71,76,76,76,71,76,71,71,76,76,71,76,71,76,76,71,76,71,71,71,71,76,76,71,76,71,76,76,76,76,71,76,71,76,76,71,76,71,71,76,76,76,71,76,76,71,71,71,71,71,71,71,71,76,76,76,76,71,71,71,76,76,71,71,71,71,76,76,76,76,71,76,71,76,71,76,71,76,71,71,76,71,76,76,71,71,76,76,71,76,71,71,76,71,76,76,76,76,71,76,76,71,71,71,71,71,76,71,71,76,76,71,71,71,71,76,76,71,76,71,76,71,76,76,76,76,71,71,71,71,71,76,76,76,71,71,76,76,76,76,76,76,71,76,76,76,71,71,71,71,76,71,76,76,76,71,76,76,76,76,76,71,76,71,76,76,76,76,71,71,76,76,71,71,76,76,76,71,71,76,76,71,76,76,76,71,71,71,76,76,71,76,71,76,76,71,71,76,76,71,76,71,76,76,71,76,71,76,71,76,76,71,71,71,76,76,71,76,71,71,76,76,76,71,76,76,71,71,71,76,76,76,71,71,71,71,71,71,76,71,71,76,71,71,76,76,76,76,71,76,76,76,76,76,76,76,71,76,71,71,71,76,76,71,71,71,71,71,71,71,76,76,71,76,71,71,76,71,71,71,76,76,71,71,76,71,76,76,71,71,71,71,76,71,71,76,71,76,71,71,71,76,76,76,71,71,71,76,76,76,76,71,71,76,76,71,71,71,76,71,76,71,76,71,71,76,76,76,71,71,71,76,71,76,76,71,71,76,76,71,76,76,76,76,76,71,76,76,71,76,71,76,76,76,76,76,76,71,76,76,71,76,76,76,76,71,71,71,71,71,76,71,76,76,76,71,71,76,71,71,76,76,76,76,76,76,76,76,71,76,71,71,71,71,71,76,76,76,71,71,76,71,71,76,76,71,76,71,71,76,76,71,76,76,76,76,71,71,71,71,71,76,76,76,71,71,76,71,76,76,71,76,76,76,71,71,71,76,76,76,76,71,71,76,71,71,71,71,71,76,76,76,76,71,76,76,76,76,71,76,71,71,76,76,76,71,76,76,71,76,71,71,71,71,71,71,76,71,71,71,71,76,71,76,76,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,71,71,71,76,76,76,76,76,71,71,71,76,71,71,71,76,71,71,71,76,71,71,71,71,76,71,71,71,71,71,76,71,71,76,76,76,71,71,76,76,71,71,71,76,76,71,76,71,71,76,71,71,76,76,71,76,76,71,71,76,71,76,76,71,71,76,76,76,76,76,71,76,76,71,71,71,71,71,71,71,76,76,71,71,71,71,71,76,71,76,71,71,76,71,76,71,71,76,76,76,76,71,76,76,76,71,76,71,71,71,71,71,76,76,76,71,76,76,71,71,76,76,71,71,76,76,71,76,71,71,71,76,76,76,71,71,71,76,76,71,76,71,76,71,76,76,71,76,76,71,76,76,76,71,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,76,76,71,76,76,71,71,71,71,71,76,76,71,71,76,76,71,71,76,71,71,71,76,71,71,76,71,71,76,71,71,71,76,76,76,71,76,76,76,71,76,76,76,71,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,76,76,76,71,71,76,76,76,76,71,76,71,76,76,71,71,71,76,76,76,71,71,76,71,76,76,71,76,76,76,76,76,71,71,71,71,71,71,76,71,76,71,76,71,76,76,76,71,76,76,71,71,76,76,76,71,76,71,76,76,71,71,76,76,76,76,71,76,71,76,71,71,71,76,76,76,76,76,71,76,76,76,71,71,71,71,76,76,76,71,76,76,71,76,71,71,76,71,76,76,76,76,76,76,71,76,71,76,71,76,76,71,71,76,76,71,76,71,71,71,76,71,76,71,76,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,76,76,76,76,76,71,76,71,71,71,76,71,71,71,76,76,71,71,76,76,71,71,71,76,71,76,71,71,71,71,76,76,71,71,76,76,71,71,76,76,71,76,76,71,76,71,76,76,71,71,76,76,76,76,71,76,76,76,71,71,76,76,71,76,71,71,71,76,71,76,71,71,71,76,71,76,71,76,71,71,76,76,76,76,76,76,76,71,71,71,76,76,76,76,76,76,76,71,71,71,71,71,71,71,71,71,71,71,71,71,76,76,71,71,76,76,76,76,71,71,71,71,71,71,71,71,71,76,71,71,71,71,76,71,76,71,71,71,76,71,76,71,71,71,71,71,71,76,76,76,71,76,71,76,76,71,71,76,76,76,71,71,76,71,76,76,76,71,76,76,71,71,76,71,71,71,71,71,71,76,71,71,76,71,71,71,71,71,76,76,76,71,71,71,76,71,76,71,71,76,76,76,76,71,71,71,76,71,71,71,71,71,71,71,76,76,76,76,71,71,71,71,76,71,71,71,76,76,71,71,71,76,76,71,76,71,76,76,76,71,71,71,71,71,76,76,76,71,71,76,71,71,76,76,76,71,71,71,76,76,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,76,76,76,76,71,76,76,71,76,71,71,71,71,76,76,71,71,71,76,76,71,76,76,71,71,71,76,71,71,76,76,76,76,71,76,76,76,71,76,71,71,71,71,71,71,71,76,71,76,76,76,76,76,71,71,76,76,76,76,71,76,71,76,76,71,71,71,76,76,76,71,76,71,76,71,76,71,71,76,76,76,76,71,71,71,71,71,76,76,76,76,71,76,71,71,71,76,71,71,76,71,71,76,71,76,71,76,71,76,76,76,76,76,71,76,76,76,71,71,71,76,71,76,71,71,76,71,71,71,71,76,71,76,76,76,71,71,76,71,71,76,71,71,71,76,76,71,76,71,76,71,71,71,71,71,76,71,76,76,71,71,76,71,76,76,71,71,76,76,76,76,76,76,71,76,76,76,76,71,76,76,76,76,71,71,71,76,76,76,76,71,71,76,71,76,76,76,71,76,76,71,71,71,76,76,76,71,71,76,76,71,76,76,76,71,71,76,71,71,71,76,71,71,71,76,76,71,76,76,76,71,71,76,71,71,76,76,71,71,71,76,76,76,71,76,71,76,71,76,71,71,76,71,76,76,71,71,76,76,71,76,71,71,71,76,71,71,76,71,71,71,71,71,71,76,76,76,76,76,71,76,71,71,71,71,71,71,76,71,76,71,76,71,76,71,76,71,71,76,76,76,71,71,71,76,71,71,76,71,76,71,71,71,76,76,71,76,71,71,71,76,71,71,71,76,76,71,71,76,76,71,76,71,76,71,71,76,76,76,71,71,76,71,71,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,76,76,71,76,71,71,76,76,76,71,76,76,76,76,71,76,71,76,76,71,76,71,71,71,71,76,76,76,71,76,71,71,76,76,76,71,71,71,71,71,76,76,71,71,76,76,71,76,71,76,71,76,71,71,76,71,71,76,71,71,71,71,76,76,71,76,71,76,76,71,76,71,71,71,76,76,76,71,76,71,76,71,76,76,71,71,76,76,71,76,71,71,76,76,76,76,71,76,71,71,76,76,71,76,71,71,71,71,71,76,71,76,76,71,76,76,71,76,76,76,71,76,76,76,71,71,71,76,71,76,76,71,71,76,71,76,76,71,76,71,76,71,71,76,76,76,71,76,76,76,76,71,76,71,76,71,76,71,76,76,76,71,71,71,71,76,71,71,71,71,76,71,71,76,71,76,76,76,76,71,76,76,71,71,76,71,76,71,71,76,76,71,71,71,76,71,76,71,71,76,71,76,76,71,71,71,71,76,76,76,76,71,76,71,76,71,76,76,76,71,76,71,76,71,71,76,71,71,76,76,76,71,76,71,71,71,76,76,76,71,71,76,76,71,76,76,76,71,71,76,76,76,76,71,71,71,76,76,76,76,76,76,71,76,71,76,71,71,71,76,71,76,76,76,76,71,76,71,76,76,71,76,76,76,76,76,76,76,76,76,71,71,76,71,71,71,76,71,71,76,71,76,71,71,76,71,71,76,71,76,76,71,71,71,71,76,76,71,76,71,71,76,71,76,71,76,71,71,76,71,71,76,71,76,71,71,76,76,76,76,76,71,76,76,71,76,71,76,71,76,71,71,76,71,71,76,76,71,76,71,71,71,76,71,76,71,76,71,71,76,76,71,71,76,76,71,71,76,76,71,76,71,71,76,71,76,76,71,71,71,76,76,76,71,76,71,76,71,71,71,71,71,76,76,71,71,71,76,76,71,71,71,76,76,76,76,76,71,71,76,71,71,76,76,76,76,71,71,71,71,71,71,71,76,76,76,71,71,76,76,76,76,71,71,71,76,71,71,71,76,76,71,76,76,71,71,76,71,76,71,76,76,71,71,76,76,76,71,71,71,76,71,71,71,76,71,71,71,76,71,76,76,71,71,71,71,71,71,76,76,71,71,76,76,76,71,76,76,76,76,76,76,76,76,71,76,76,76,76,71,76,71,76,71,71,71,76,76,76,76,76,71,71,71,71,71,71,71,71,76,76,76,76,71,71,71,76,71,71,76,71,71,76,76,71,76,76,71,71,76,76,76,76,71,71,71,76,76,71,76,76,76,76,71,76,76,76,76,71,76,76,76,76,76,71,76,76,71,76,71,71,76,71,71,76,71,71,76,71,71,71,76,71,76,76,71,71,71,76,76,71,71,71,71,71,71,71,71,71,71,76,76,76,76,76,76,76,76,71,71,76,71,71,76,71,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,71,71,71,71,71,71,76,71,76,71,76,76,71,76,76,71,76,71,71,76,71,71,76,76,76,76,71,76,76,71,76,71,76,71,71,76,76,71,76,71,71,71,76,76,76,76,76,71,71,76,76,71,71,76,76,76,71,76,76,76,71,76,76,76,76,71,71,76,71,76,76,71,76,76,76,71,76,71,71,71,76,76,76,76,76,76,76,76,76,71,71,76,71,71,71,71,76,76,76,76,71,76,71,71,71,76,76,76,71,76,76,76,71,71,71,76,71,76,76,71,76,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,76,76,76,76,71,76,76,76,71,76,71,71,76,76,71,76,71,76,76,71,71,71,71,71,71,76,71,71,71,71,71,76,76,76,71,76,71,76,76,76,76,76,71,71,71,71,76,71,71,76,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,76,76,71,76,71,71,76,76,76,76,71,71,71,76,76,71,71,76,76,71,71,71,76,76,76,71,71,71,76,76,76,76,71,76,76,71,71,71,76,76,71,76,76,76,71,71,71,76,76,76,76,71,71,71,71,71,71,71,71,71,71,76,76,71,76,71,76,71,76,76,71,71,76,71,71,71,71,71,76,76,71,76,76,71,71,71,71,76,76,76,76,76,71,76,76,76,71,71,71,71,76,76,71,76,71,76,76,76,71,71,71,71,71,71,76,71,76,76,71,71,76,76,71,76,76,76,71,76,71,76,76,71,71,76,71,71,71,76,71,71,76,76,71,76,71,76,71,76,71,76,76,76,71,71,76,71,71,71,76,76,76,71,71,76,71,71,71,71,76,71,76,71,71,76,76,71,71,71,71,71,76,71,71,71,76,71,71,71,76,76,76,76,76,71,76,71,76,76,71,71,71,76,71,76,76,76,76,71,76,76,71,76,71,76,76,76,76,71,76,76,71,71,71,71,71,76,76,76,76,76,71,71,71,71,71,71,71,71,76,76,71,76,76,71,71,71,76,71,71,71,76,76,76,76,71,76,76,71,76,71,71,71,76,71,76,76,76,76,71,76,71,76,76,76,76,76,76,76,76,71,76,71,71,76,76,71,71,76,71,76,76,76,76,76,76,76,76,76,71,76,76,76,76,76,76,71,76,76,76,76,71,76,76,71,71,76,76,76,76,71,76,71,71,71,76,71,76,76,71,76,76,71,76,71,71,76,71,76,76,71,71,71,71,71,76,76,71,76,71,76,76,71,76,71,76,71,76,71,76,76,71,76,71,71,71,76,76,76,76,76,71,71,76,76,71,71,71,76,76,71,71,76,71,71,76,71,76,76,76,76,71,71,76,71,76,71,76,76,76,71,76,71,76,76,71,71,76,71,76,76,71,76,76,71,71,76,76,71,76,76,71,76,76,71,71,76,76,71,76,76,76,76,71,71,76,71,71,71,71,71,71,71,76,71,71,71,71,76,71,71,76,76,76,71,71,71,76,71,76,71,76,71,76,76,76,71,71,76,71,71,76,76,71,76,76,71,76,76,71,76,76,76,76,76,71,76,71,71,76,76,76,71,71,71,76,71,71,76,76,71,76,76,71,71,71,71,76,76,76,76,76,71,71,71,71,76,71,76,71,71,71,71,71,76,76,76,71,71,76,76,71,76,76,71,71,76,71,76,76,71,71,71,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,71,76,76,76,76,76,76,76,76,71,71,71,76,71,71,71,71,76,71,76,76,71,71,76,71,71,71,71,71,71,71,76,76,71,76,76,71,76,71,71,71,71,71,76,71,76,76,76,71,76,71,76,71,76,71,76,71,71,71,71,76,76,71,71,76,76,71,71,76,76,71,71,76,71,71,76,71,76,71,76,76,71,71,71,76,76,71,71,76,71,76,71,71,71,71,76,71,76,76,71,71,71,76,71,76,76,76,71,71,71,76,71,76,71,71,71,76,76,76,76,71,76,76,76,76,76,71,76,71,71,76,76,71,76,71,71,71,71,71,76,71,76,71,71,76,71,76,71,71,71,71,76,71,76,71,71,71,71,71,71,76,71,76,76,71,71,76,71,71,71,76,76,76,71,76,71,76,71,71,76,71,76,71,71,76,76,76,71,76,71,76,76,76,76,71,76,71,71,71,76,76,71,71,76,71,76,76,71,71,76,76,71,76,76,76,71,71,71,71,76,71,76,71,71,76,71,71,71,76,71,71,71,71,76,76,76,76,76,76,71,76,76,71,76,76,71,71,76,71,76,71,71,76,71,76,76,71,71,71,76,76,76,71,71,76,71,71,76,76,76,71,76,71,76,71,71,76,76,71,71,76,71,71,76,76,76,76,76,76,76,76,76,76,71,76,76,76,71,71,71,71,71,76,76,76,71,76,76,71,71,76,76,71,76,76,71,76,76,76,71,71,76,76,71,76,76,71,76,71,76,71,76,76,71,71,71,71,71,76,76,76,71,76,71,76,71,71,71,71,71,71,76,71,71,76,76,76,76,71,76,76,76,71,76,76,76,76,76,71,76,76,76,76,71,76,76,76,76,76,76,71,71,76,71,71,71,76,76,71,76,71,71,71,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,76,71,71,76,76,71,71,71,76,71,76,71,76,71,71,71,76,76,71,76,71,76,71,71,76,76,71,76,71,71,76,76,71,76,71,71,71,71,76,76,76,76,71,76,76,71,76,71,76,71,76,76,71,71,71,76,76,76,76,76,76,76,71,76,71,76,71,71,71,76,76,76,71,71,71,76,71,71,71,76,76,76,76,71,76,71,71,71,76,76,71,76,76,76,76,71,71,71,76,76,76,71,71,71,71,71,71,71,71,71,76,71,71,71,71,71,76,71,71,71,76,76,76,71,71,71,71,71,76,76,71,76,71,71,71,76,71,71,76,71,76,76,76,71,76,76,76,76,71,76,71,71,71,76,76,76,71,76,76,76,71,71,71,71,76,71,76,71,71,76,76,76,71,76,76,76,76,71,76,71,76,76,71,76,71,76,71,71,71,71,76,71,71,71,76,76,76,71,76,71,71,71,76,71,71,71,71,76,71,71,71,71,71,71,76,71,71,71,76,71,71,71,76,76,71,76,76,76,71,76,71,71,76,71,76,71,71,76,71,71,76,71,76,71,76,71,76,71,76,71,76,76,76,76,71,76,71,71,76,76,71,76,71,76,76,76,71,71,76,76,76,76,71,71,71,71,71,71,76,76,71,76,76,76,71,71,71,71,71,76,71,71,76,76,71,71,76,71,71,71,71,71,71,71,71,71,76,76,76,71,71,76,76,71,71,71,71,76,71,71,71,76,76,71,76,71,71,71,71,76,71,71,76,76,76,71,76,71,71,76,76,71,71,76,76,71,71,76,76,71,71,76,76,71,76,71,76,71,76,76,76,71,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,71,76,76,76,76,76,76,76,76,71,76,71,76,71,71,71,76,76,76,76,76,71,76,76,71,76,71,76,76,76,76,71,71,71,71,71,76,71,76,71,71,71,71,71,71,76,76,76,71,71,71,71,71,71,71,76,71,76,76,76,71,71,76,76,71,76,76,76,71,71,71,76,71,76,71,71,76,71,71,76,71,71,76,76,76,71,71,71,76,71,76,76,76,76,71,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,71,76,76,71,71,71,71,76,76,71,71,71,76,71,71,71,71,76,71,76,76,71,76,76,71,71,76,76,71,76,76,71,71,71,71,76,71,76,76,71,76,76,71,76,71,76,76,71,76,71,71,76,76,71,76,71,76,71,71,76,71,76,71,76,76,76,76,76,71,71,76,76,71,76,71,71,71,76,76,71,71,71,71,71,76,71,76,76,71,71,71,76,76,76,76,71,76,71,71,71,71,76,76,76,76,71,71,76,76,71,71,71,71,71,76,76,76,71,76,76,76,71,71,76,71,76,71,71,76,71,71,71,76,76,76,71,71,71,76,71,76,71,76,76,71,76,76,71,76,71,76,71,71,76,71,71,76,76,76,76,76,71,71,76,76,76,71,71,76,76,71,76,76,71,76,76,76,76,76,71,71,71,76,76,76,71,76,76,71,71,76,71,76,71,71,76,71,76,76,76,71,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,76,71,76,71,76,71,71,71,76,71,71,76,71,76,71,71,76,76,71,71,71,76,76,76,71,76,76,76,71,76,71,76,76,76,76,71,76,71,71,71,76,76,76,76,76,76,76,76,71,71,76,76,71,76,71,71,76,71,76,76,76,71,71,71,76,76,76,71,71,71,71,76,76,71,71,71,71,76,71,71,76,71,71,71,76,71,76,76,71,71,71,71,71,76,71,76,71,76,71,71,76,71,76,71,71,71,76,76,71,76,71,76,71,71,76,76,76,76,71,76,71,76,76,71,76,76,71,71,71,71,76,76,71,71,71,71,71,76,71,71,71,76,76,71,76,71,76,71,71,76,76,76,76,71,76,76,76,76,76,71,71,76,76,71,76,71,71,76,76,71,76,76,71,76,76,71,76,76,71,76,76,76,71,71,71,71,76,76,71,76,71,76,76,76,71,71,71,71,71,76,76,76,76,71,71,76,76,71,71,71,76,71,71,76,71,76,76,71,76,71,71,76,71,76,76,76,76,76,76,76,76,76,71,76,71,76,71,71,71,76,71,76,71,71,71,76,76,76,71,76,76,71,76,76,76,76,76,76,71,71,76,76,76,71,71,76,71,76,71,71,76,71,71,71,71,76,71,71,71,71,76,76,71,71,76,76,71,71,71,76,71,76,71,71,76,76,71,76,71,76,76,71,71,76,76,71,71,76,71,71,76,76,76,71,71,71,76,71,71,76,71,76,76,76,71,76,71,71,71,71,71,76,76,76,71,76,76,71,76,76,76,71,76,71,76,71,71,71,76,71,76,71,76,71,71,71,71,71,71,76,76,71,71,76,71,71,76,76,71,71,76,71,71,76,71,71,76,71,76,71,76,71,76,76,71,71,76,76,71,76,71,76,76,71,71,76,71,76,71,71,76,71,76,76,71,71,76,71,76,71,71,76,76,71,71,76,76,71,71,76,76,76,76,76,76,71,71,71,71,71,76,76,76,71,76,71,76,71,76,76,76,71,76,71,76,76,76,71,76,76,76,71,76,71,76,76,76,71,76,71,71,71,71,76,71,71,71,76,71,76,76,76,76,76,76,71,71,71,76,76,71,71,71,71,71,71,76,76,71,71,76,71,71,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,71,76,76,76,76,71,71,71,71,71,71,71,76,76,71,76,71,71,76,71,71,71,71,71,76,76,71,71,76,71,76,71,76,76,76,76,71,71,71,71,71,71,76,71,71,71,71,76,76,71,76,71,71,76,71,71,71,71,76,76,71,71,76,71,71,76,71,76,71,71,71,76,76,71,71,71,76,71,76,71,76,71,71,71,76,76,71,76,71,76,71,76,76,76,71,71,76,71,71,71,76,71,71,76,76,76,76,76,71,76,76,71,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,71,76,71,71,71,76,71,76,76,76,71,76,71,76,71,71,71,76,76,71,76,71,76,71,76,71,71,71,76,76,71,71,71,76,71,76,71,76,71,71,71,71,76,71,71,76,71,76,71,76,76,76,76,71,76,71,76,76,71,71,71,76,71,71,76,71,71,76,76,76,71,71,76,71,76,71,71,76,76,71,71,71,76,71,71,71,76,76,71,76,71,76,71,76,71,71,76,71,76,71,76,76,76,71,71,71,71,71,71,71,71,71,71,71,71,71,71,76,71,76,71,71,71,71,71,71,76,76,71,76,76,71,71,71,71,71,76,71,76,76,71,76,71,71,71,76,71,71,71,76,76,71,76,76,71,76,76,71,76,71,76,76,76,76,76,71,76,71,71,76,71,76,76,76,71,76,71,76,76,76,71,76,76,71,76,71,76,76,76,76,71,71,76,71,71,76,71,76,71,76,76,71,71,71,76,71,76,76,71,76,76,71,76,76,76,76,71,76,76,71,71,71,76,76,76,76,71,71,71,71,71,76,76,76,76,76,76,71,76,76,76,71,76,76,71,71,71,76,71,76,76,76,71,76,76,76,71,76,71,71,76,71,76,76,76,76,71,71,76,76,76,76,76,76,76,76,76,76,76,76,76,76,71,76,71,71,76,71,76,71,71,76,71,71,71,76,71,76,71,71,76,76,76,71,76,71,76,76,71,71,76,76,71,71,76,76,76,76,71,76,71,76,71,71,76,76,71,76,71,71,76,76,76,71,76,71,76,71,71,76,71,71,76,71,71,71,76,71,76,76,76,76,76,71,76,76,76,76,71,71,76,76,71,71,71,76,76,71,76,71,71,71,76,71,71,71,76,71,71,76,71,76,71,76,71,76,71,71,76,71,76,76,71,76,71,71,76,71,71,76,76,71,71,76,76,71,76,76,71,76,76,71,71,76,71,71,71,76,71,71,76,71,71,71,71,71,76,71,76,71,71,76,76,71,76,76,76,71,76,76,76,71,76,76,71,71,71,71,76,76,71,71,71,71,71,71,71,71,71,71,71,76,71,76,76,76,71,71,71,76,71,76,71,76,71,71,76,71,76,71,76,71,71,71,71,71,76,71,76,76,76,76,76,76,76,76,76,71,71,76,76,76,71,71,76,71,76,76,71,71,71,76,71,71,76,76,71,71,71,76,71,71,76,71,71,71,71,71,71,71,76,71,76,76,76,76,76,76,76,76,76,76,71,71,71,76,71,76,76,76,76,76,76,76,71,76,76,76,76,71,71,76,71,71,76,71,71,71,71,76,76,71,76,76,76,71,71,76,71,71,71,76,76,76,76,71,76,76,76,76,71,71,76,71,71,76,76,71,71,71,76,71,76,76,76,76,71,71,71,76,71,76,76,76,76,76,76,76,71,76,71,71,76,76,76,76,76,71,71,71,71,71,76,76,71,76,71,76,76,76,71,71,71,71,71,76,76,76,71,76,76,71,76,76,71,76,71,76,76,76,71,76,71,71,71,76,76,76,71,76,71,71,71,76,71,76,71,71,71,76,76,71,71,71,76,71,71,71,76,76,76,71,71,71,76,71,71,71,71,71,76,71,76,71,76,76,76,71,76,76,76,76,71,76,71,71,71,71,71,71,76,76,76,71,76,76,76,76,76,71,76,76,71,76,76,76,76,71,71,71,71,76,71,76,71,76,76,71,76,71,76,71,76,71,76,71,76,76,76,76,76,71,76,71,71,76,71,76,71,71,71,71,71,71,76,76,76,71,71,76,71,76,71,71,76,71,76,71,71,76,76,71,76,76,71,76,76,76,71,71,76,76,71,76,76,76,76,76,76,76,76,71,71,76,76,71,76,71,71,71,71,71,76,76,71,76,71,76,71,71,71,76,76,76,71,76,76,76,76,76,76,76,76,71,76,71,71,76,71,71,71,71,71,71,71,71,71,71,76,76,71,71,76,71,76,76,71,71,71,71,76,71,71,71,76,71,76,76,76,71,71,76,71,76,76,76,76,71,76,71,76,71,71,71,71,71,76,71,76,71,71,71,71,76,71,71,76,71,76,76,76,76,76,76,76,76,71,76,76,71,71,76,71,71,76,71,76,71,71,76,76,76,76,71,71,76,71,71,76,76,76,76,76,71,71,76,71,71,71,76,76,76,71,76,71,71,76,71,71,76,76,71,71,76,71,71,71,71,76,71,71,76,71,76,76,76,71,76,71,76,71,71,71,71,71,76,76,71,71,71,71,71,71,76,76,71,71,71,71,71,76,71,71,71,71,76,71,76,76,76,76,71,71,71,71,76,76,76,71,76,76,76,76,71,76,71,71,71,71,76,71,76,71,71,76,76,76,71,76,76,76,71,71,76,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,76,76,76,71,71,71,76,71,71,71,76,76,71,76,76,71,76,76,76,76,76,71,71,76,71,76,76,76,76,71,76,76,76,76,76,71,71,76,71,76,76,76,76,71,71,76,76,71,71,76,76,76,76,71,71,76,71,76,76,71,71,71,76,76,76,76,71,71,76,76,76,76,76,76,71,71,71,76,76,71,71,71,76,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,76,71,76,71,76,71,71,71,76,71,71,71,71,76,71,76,76,71,76,71,71,71,71,71,71,76,71,71,76,76,76,76,71,71,76,71,76,76,76,76,76,76,76,76,76,76,76,76,76,71,71,71,71,76,71,76,71,71,71,76,71,76,71,71,71,76,76,76,71,71,76,71,76,76,76,76,71,76,76,76,76,71,71,76,71,71,76,71,71,76,76,76,76,71,76,71,71,76,76,76,76,71,71,71,71,71,71,71,71,71,76,76,76,76,76,76,71,76,76,76,71,71,71,76,76,71,71,76,76,76,71,71,71,71,71,76,76,71,76,71,76,71,71,76,71,71,71,71,76,76,71,76,76,71,76,76,71,76,76,71,71,76,76,71,76,76,71,76,71,71,71,76,76,71,76,76,76,76,71,71,71,76,71,76,76,76,76,76,71,71,71,76,71,71,76,71,71,76,76,71,71,71,76,71,76,71,71,71,76,76,71,71,76,71,76,71,76,76,71,71,71,71,71,76,71,76,71,76,71,71,76,76,71,76,71,76,71,71,71,71,76,76,76,71,71,76,71,71,76,71,71,76,76,76,71,71,71,76,71,76,71,76,76,76,71,71,76,71,71,71,76,76,76,76,76,71,71,76,71,71,76,76,76,76,71,71,76,76,76,76,76,71,71,76,71,71,71,71,76,71,76,71,71,76,71,76,71,76,76,76,76,71,71,76,71,71,71,76,71,76,76,71,76,71,71,71,76,71,76,71,71,76,76,71,71,71,76,76,71,71,71,76,71,71,71,71,71,76,76,76,71,71,76,71,71,76,71,71,71,76,76,76,71,76,76,76,71,76,71,76,71,71,76,76,71,76,76,76,71,71,76,71,71,71,71,76,76,71,71,76,71,71,71,71,76,76,76,71,76,71,76,76,76,76,71,71,71,71,71,76,76,71,76,71,71,76,71,71,71,76,71,71,76,76,71,76,71,76,71,76,76,76,71,71,76,71,76,71,76,76,71,71,76,71,71,76,76,76,71,76,71,71,71,71,76,71,71,71,71,76,71,71,76,76,76,71,76,76,76,76,76,76,71,76,76,71,76,76,71,71,71,76,76,71,71,71,71,71,76,71,71,76,76,76,71,76,71,76,76,76,71,76,76,76,71,71,71,76,76,76,76,76,76,71,76,76,76,76,71,76,71,76,71,76,76,71,76,76,71,71,76,76,71,71,71,76,76,76,71,71,71,71,71,71,71,71,71,76,71,71,76,71,76,71,76,76,71,76,71,76,76,76,76,76,71,76,71,76,71,71,76,71,76,71,76,76,71,76,71,71,76,71,71,71,76,71,71,71,71,71,71,76,71,76,71,71,76,76,76,71,76,76,71,71,76,76,76,76,71,71,76,76,71,76,76,71,76,71,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,76,71,71,76,76,71,76,71,71,76,76,71,76,71,76,71,71,76,76,76,71,71,71,76,76,71,76,76,76,71,76,71,76,76,76,71,71,71,76,76,71,71,76,76,71,76,76,71,71,71,76,76,76,71,76,76,71,71,71,71,71,76,71,71,76,76,71,76,71,76,76,71,71,76,71,76,71,71,76,71,76,71,71,71,71,76,76,76,76,71,76,71,76,71,76,71,71,71,71,71,71,71,71,76,71,76,76,76,76,71,76,71,76,76,71,71,76,76,76,76,71,71,71,71,71,71,71,76,71,71,76,76,76,71,76,76,71,71,71,71,71,76,71,71,76,76,76,71,71,71,71,76,71,71,71,76,71,76,71,71,76,71,71,71,71,71,76,76,76,71,71,76,71,76,76,71,76,71,71,76,76,71,76,71,76,71,71,71,76,76,71,76,76,71,71,71,71,76,71,71,76,76,76,76,76,71,76,71,76,71,76,71,76,76,71,76,76,76,71,76,71,76,76,71,76,76,76,71,71,71,71,76,71,76,76,71,71,76,76,76,76,76,71,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,71,71,71,76,76,76,76,76,76,76,71,71,71,76,76,71,71,71,76,76,76,76,71,76,76,76,76,76,76,71,71,71,71,71,71,71,76,71,76,76,71,71,76,71,71,71,71,71,76,76,71,71,76,71,71,76,76,76,71,76,71,76,76,71,76,71,71,71,76,71,71,76,76,71,71,76,71,76,71,76,71,76,76,71,76,71,76,71,76,76,76,71,71,76,76,71,71,71,76,71,71,76,76,71,76,76,76,76,71,71,76,76,71,76,71,71,76,71,76,76,71,76,71,71,71,71,71,71,76,76,71,76,71,76,76,76,76,76,76,71,71,76,76,76,71,71,71,71,76,71,71,71,76,71,71,71,76,71,76,76,71,71,71,76,76,76,71,71,76,71,76,71,71,71,71,76,76,76,76,76,76,76,76,71,71,76,71,71,76,71,76,76,76,76,71,71,71,76,76,76,71,76,71,71,71,71,71,71,71,71,76,76,71,76,71,76,76,76,76,71,76,71,71,71,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,71,71,76,71,76,76,71,76,76,76,71,71,71,71,76,71,71,71,76,76,76,71,71,76,76,71,76,71,71,76,71,71,76,76,76,71,71,71,76,71,71,76,76,71,71,71,76,71,71,71,71,71,71,71,71,76,76,71,76,71,76,76,71,76,76,76,71,71,71,76,76,71,71,76,71,71,76,76,76,71,71,76,71,71,76,76,76,76,76,71,71,71,76,71,71,76,76,76,76,76,71,71,76,76,76,71,76,71,71,71,76,76,76,76,71,76,76,71,71,71,76,71,76,76,71,71,76,71,71,76,71,76,76,71,76,76,76,76,71,71,71,76,76,71,71,71,71,76,71,71,71,76,76,71,71,76,71,76,76,76,71,76,76,76,76,71,71,71,76,76,76,71,76,76,71,76,71,76,76,71,71,71,76,71,71,76,71,76,76,71,76,76,71,76,76,71,71,76,71,71,76,71,71,76,71,71,71,71,76,71,76,71,76,76,76,76,76,71,71,71,76,71,71,76,71,76,71,71,76,71,71,71,76,71,71,71,71,71,71,71,71,71,71,76,76,76,76,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,71,76,76,71,71,71,76,76,71,71,71,76,76,76,76,71,76,76,76,71,71,76,76,71,76,76,76,76,71,71,76,76,76,71,71,76,71,71,71,76,71,71,76,71,76,76,71,71,76,71,76,71,76,71,71,76,71,71,71,71,71,76,71,76,76,71,71,76,71,71,76,71,76,71,76,71,76,76,76,76,71,71,71,71,76,76,76,76,71,76,76,76,71,76,71,71,71,71,71,76,71,76,71,71,71,71,71,76,71,71,71,76,76,76,76,76,76,71,71,76,76,76,76,71,76,76,76,76,71,76,76,76,71,76,76,76,71,76,76,71,76,76,71,76,76,71,76,71,71,71,76,71,76,76,76,71,76,76,76,71,71,76,71,71,76,76,71,76,71,71,71,76,71,71,71,76,71,76,71,76,76,71,76,71,76,76,76,71,71,71,71,71,71,71,71,71,71,71,71,76,76,71,76,76,76,76,71,71,76,71,76,71,76,71,76,76,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,71,71,71,71,76,71,76,71,76,76,76,76,76,76,71,76,71,76,76,71,76,76,76,71,76,76,71,71,76,76,71,71,71,76,76,76,71,71,71,71,71,76,76,71,76,71,76,71,76,71,76,76,71,76,76,76,76,76,71,71,71,76,71,76,71,76,71,76,71,71,71,76,76,76,71,76,71,76,71,71,76,76,71,76,76,76,71,76,71,71,71,71,71,76,71,76,71,76,76,71,71,76,71,76,71,76,76,71,71,71,76,76,71,71,71,76,76,76,71,71,76,76,71,76,71,71,71,71,76,71,71,71,76,71,71,76,76,71,71,71,71,71,71,76,71,76,76,76,76,71,76,71,71,76,76,76,76,71,71,71,71,76,71,76,71,76,71,71,71,71,71,76,76,71,71,76,76,71,76,76,71,76,76,76,71,71,71,71,71,76,76,71,76,76,71,76,71,71,71,71,71,76,71,76,76,76,71,76,71,71,76,71,71,76,76,76,76,71,76,76,76,76,71,76,71,76,71,76,76,71,71,71,76,76,76,71,71,71,71,71,71,71,76,71,76,76,71,76,76,71,76,76,71,71,71,76,76,71,76,76,71,76,76,76,71,76,76,71,76,71,76,71,71,76,71,76,76,76,71,76,76,76,71,71,76,76,76,71,76,71,71,76,71,71,71,71,76,71,76,71,71,76,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,71,71,76,71,76,71,76,76,71,71,76,71,76,76,71,76,71,76,71,76,76,76,76,76,76,76,76,76,76,76,71,76,76,76,76,71,71,71,71,76,71,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,71,76,76,76,76,76,76,71,71,71,76,71,76,76,76,71,71,76,76,71,71,71,76,76,76,76,71,71,76,71,76,76,71,76,76,71,76,76,76,71,76,76,71,76,76,71,71,76,76,71,76,71,71,71,71,76,76,76,71,76,71,76,71,76,71,76,71,76,76,71,71,71,76,71,71,76,76,71,76,76,71,76,76,76,71,71,71,71,76,76,76,71,71,76,71,76,76,71,76,76,76,71,76,76,76,76,76,71,71,71,76,71,71,71,71,71,71,76,71,76,76,71,76,76,76,71,71,71,76,71,71,71,76,71,71,76,71,76,71,71,76,71,76,76,76,76,71,76,76,76,76,76,76,76,76,76,76,71,76,71,71,71,71,71,76,76,71,76,76,71,76,71,71,76,71,71,76,76,71,71,76,76,76,76,76,76,71,76,71,71,71,76,71,71,76,71,71,71,76,71,76,71,76,71,71,76,71,76,76,71,76,76,76,76,76,76,71,71,76,71,76,76,76,71,76,76,76,76,76,71,71,71,76,71,71,71,71,71,76,76,71,76,76,76,76,71,71,71,71,76,71,71,71,71,71,71,76,71,76,71,76,71,71,71,71,76,71,71,76,76,76,71,76,76,71,71,76,76,76,76,71,76,71,76,71,71,71,71,76,71,71,71,71,71,76,76,76,76,71,71,71,76,71,76,76,76,76,76,71,71,71,76,76,71,76,71,76,71,71,76,76,71,71,76,76,76,76,71,76,76,76,71,71,76,76,71,71,76,76,76,71,76,76,76,71,71,71,71,76,71,71,76,76,71,71,71,76,76,71,76,76,76,76,71,76,71,76,71,71,71,76,76,71,76,76,76,71,76,76,71,76,76,71,76,76,76,71,76,76,76,71,71,71,71,71,71,76,71,71,71,71,71,76,71,76,71,76,76,76,71,71,76,71,71,71,71,76,76,76,76,71,71,71,71,76,76,76,76,71,76,76,76,71,71,76,71,71,76,71,76,71,76,71,71,76,76,71,76,76,76,71,71,76,76,71,76,76,76,76,71,76,76,71,76,76,76,71,76,71,76,76,76,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,71,76,71,71,71,76,76,76,71,76,76,71,76,71,76,71,76,71,76,76,76,76,71,71,76,76,71,71,71,76,71,76,76,71,71,71,76,76,76,76,71,76,71,71,71,76,76,71,71,76,71,71,76,76,71,76,71,71,71,71,71,76,71,76,76,71,76,71,71,76,71,76,71,76,71,76,76,71,71,76,76,76,76,76,76,76,76,71,71,71,76,76,76,76,76,71,76,71,76,76,71,71,76,71,76,71,71,71,71,71,76,76,76,76,71,71,76,71,71,76,76,76,71,76,76,76,76,71,76,71,71,76,71,76,71,76,71,71,76,71,71,76,71,71,71,71,71,71,76,76,76,76,71,71,76,76,71,71,76,71,71,76,71,76,71,76,76,71,71,71,71,76,71,71,71,76,76,71,76,71,76,76,71,76,71,76,76,71,71,76,71,76,71,71,76,71,71,71,76,76,76,76,76,76,71,71,71,71,76,76,76,71,71,76,71,71,71,76,76,76,71,76,76,76,76,71,71,71,76,71,71,76,71,76,71,76,71,76,71,76,71,71,76,76,76,76,76,76,71,76,71,76,71,76,71,71,76,71,71,76,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,76,71,71,71,71,71,71,71,71,76,71,76,71,76,71,71,71,76,71,76,71,76,71,71,71,76,76,76,71,71,71,71,71,71,76,71,71,76,76,76,71,71,71,76,71,71,71,71,76,71,76,71,76,76,76,71,71,71,71,71,71,76,76,76,71,76,71,76,71,71,71,76,71,71,76,71,76,71,76,76,71,71,76,76,76,71,71,76,71,71,71,76,71,71,76,76,76,76,71,76,76,76,71,71,71,76,71,76,71,71,71,71,76,71,76,71,71,76,71,71,71,76,76,76,71,76,76,71,71,76,76,76,71,71,71,76,71,71,71,71,71,71,76,76,76,76,71,76,71,71,71,71,71,71,71,71,71,76,71,71,76,71,71,76,71,71,76,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,71,76,71,71,71,76,76,71,71,71,71,76,71,71,71,76,76,76,76,71,71,71,76,71,71,71,76,71,76,71,71,71,71,76,71,71,71,76,76,71,71,71,76,71,76,71,76,76,71,71,76,71,76,76,76,71,76,76,71,76,71,71,71,71,71,76,76,76,76,71,71,76,76,76,71,76,76,71,76,71,76,76,71,76,76,71,76,71,71,76,76,71,71,76,76,71,71,76,76,76,71,71,71,76,76,76,71,71,76,76,71,76,76,71,71,71,76,71,71,76,76,71,71,71,76,71,76,76,76,76,71,71,76,71,76,71,71,76,76,71,71,71,71,71,71,76,71,76,76,71,71,76,76,76,76,71,71,71,76,76,76,71,71,76,76,76,71,76,76,76,71,71,76,76,76,76,71,76,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,76,76,76,76,71,76,71,71,76,76,76,71,76,76,71,76,71,76,71,71,76,71,71,71,76,71,76,76,71,71,76,71,76,76,71,76,76,76,76,71,71,71,76,76,76,76,76,71,71,71,71,71,71,76,71,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,76,76,71,76,76,71,76,76,76,76,76,76,71,76,71,76,76,71,76,71,71,76,76,71,71,71,71,71,76,76,71,76,76,76,76,71,71,71,76,71,76,76,76,76,76,76,71,76,71,76,71,76,76,76,71,76,76,76,76,76,71,76,76,71,76,71,71,76,71,71,76,76,71,71,76,76,71,71,76,71,76,76,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,71,71,71,71,71,71,76,76,76,71,76,76,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,71,76,71,71,76,71,76,71,71,76,76,71,76,71,71,76,71,76,76,76,76,76,71,71,76,71,76,71,76,71,71,71,71,76,76,71,76,76,71,71,76,71,76,71,76,71,71,76,71,76,76,71,71,71,71,71,76,71,76,76,76,71,76,71,76,71,76,76,76,71,76,76,76,76,71,71,76,71,76,71,71,76,76,71,71,71,71,76,71,71,71,76,76,76,71,76,71,76,76,71,76,76,76,76,71,71,76,76,71,76,76,71,71,76,76,76,76,76,76,76,76,71,76,76,71,71,71,71,76,71,71,71,71,71,76,76,76,71,71,71,71,71,71,76,76,71,71,76,76,76,71,76,71,71,76,76,76,76,71,76,76,76,76,76,71,76,71,76,71,76,76,71,76,71,71,76,76,71,76,71,71,71,76,76,76,71,76,71,76,76,76,71,76,76,76,76,76,71,76,71,76,71,76,76,76,76,71,76,71,71,71,76,71,71,71,71,71,71,76,71,76,71,71,76,71,76,76,71,71,71,71,71,71,76,71,71,76,71,71,76,76,71,71,76,71,71,76,76,71,76,71,76,76,76,71,71,76,76,71,76,76,71,76,71,71,76,76,71,76,71,71,71,76,76,76,71,71,71,76,76,76,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,76,71,71,76,76,71,76,71,76,76,71,71,71,71,71,76,71,76,76,76,76,76,76,76,71,76,76,76,71,71,76,76,71,76,76,76,76,71,76,76,76,71,71,71,76,71,71,71,71,71,76,71,76,76,76,71,71,71,76,71,76,71,71,71,71,76,76,76,76,76,71,76,71,76,71,76,76,71,76,76,76,76,71,71,76,71,76,76,76,76,71,76,71,71,76,71,76,71,71,76,76,71,71,76,76,76,71,76,76,76,76,76,76,71,71,76,71,71,71,76,71,71,71,76,71,71,76,71,76,76,76,76,71,71,71,76,71,71,76,76,76,71,76,76,71,76,71,76,76,71,76,71,71,76,71,71,71,76,76,71,76,76,76,71,71,71,71,71,76,76,71,76,71,76,76,71,71,71,71,71,76,76,76,76,76,71,76,76,71,76,71,71,71,76,76,71,71,71,71,71,71,76,76,76,76,71,76,71,76,71,71,71,71,71,71,71,76,76,71,71,71,76,76,71,71,76,76,76,76,71,76,76,76,76,71,76,76,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,71,76,71,71,76,76,76,76,71,71,76,71,76,71,71,71,71,76,71,76,71,76,71,71,76,71,71,71,76,71,76,71,71,76,76,76,76,76,76,71,76,76,76,76,71,71,71,76,76,76,76,76,71,71,71,76,76,71,71,76,76,71,71,71,71,76,71,76,76,76,71,76,76,71,71,76,71,76,71,76,76,76,71,76,71,76,76,76,71,71,71,76,76,71,71,71,76,71,76,71,76,71,76,76,76,76,71,76,76,76,71,76,76,76,71,71,71,71,71,71,76,76,76,76,76,76,76,71,76,71,71,71,76,71,71,71,76,76,71,76,71,71,71,76,71,76,76,76,71,71,71,76,76,76,76,76,76,76,71,76,71,76,71,71,76,76,76,71,76,71,71,76,76,76,71,71,71,76,71,76,76,76,76,76,76,76,71,76,76,71,71,76,76,76,71,71,76,76,76,76,71,71,71,76,71,76,76,76,76,76,71,71,71,71,71,71,76,71,76,76,76,76,76,71,71,76,71,71,76,71,71,71,71,71,71,76,71,71,71,71,76,76,76,76,71,76,71,71,76,71,71,71,71,76,71,76,76,71,71,71,71,76,76,76,71,76,76,71,76,76,71,71,71,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,71,71,76,76,71,71,76,71,76,71,71,71,76,71,76,76,76,76,76,71,71,71,76,76,76,71,76,71,71,71,76,71,71,76,76,76,71,71,76,71,76,76,71,76,76,76,71,71,76,76,71,71,71,71,71,76,71,71,71,71,76,76,71,76,71,71,76,71,76,76,71,71,71,71,76,76,71,76,71,71,71,71,71,76,71,71,76,71,76,71,71,71,71,76,76,71,76,71,76,71,76,76,76,76,71,76,71,76,71,71,76,76,76,76,71,71,71,71,71,76,76,71,76,71,71,76,76,71,76,71,71,71,71,76,71,76,76,76,76,71,76,71,71,76,76,76,76,76,76,71,71,71,76,71,71,71,76,76,76,76,71,71,71,76,76,71,71,76,71,71,71,76,71,71,76,76,71,76,76,71,71,71,71,71,71,76,76,76,71,76,71,76,71,76,71,76,71,71,76,71,71,71,71,76,71,71,71,76,71,71,71,71,71,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,76,76,71,71,76,76,76,71,71,76,76,76,71,76,76,71,76,76,76,76,76,71,71,71,71,76,71,76,71,71,71,76,71,76,71,76,76,76,71,76,71,71,71,71,71,76,71,76,71,71,71,71,76,76,76,71,76,76,71,71,76,76,71,76,76,71,76,71,76,71,76,76,76,71,71,76,76,76,76,76,71,76,71,71,71,76,76,71,71,76,76,76,71,76,71,71,71,71,76,76,76,71,71,71,76,71,71,71,71,76,76,76,76,71,76,71,76,71,71,71,76,71,71,71,71,76,76,71,76,76,71,76,76,76,71,76,71,76,76,76,76,76,71,76,76,76,76,71,76,71,71,71,76,71,71,76,71,71,71,76,76,76,71,71,76,76,71,71,76,76,76,71,76,76,76,71,76,71,71,71,71,71,76,76,71,71,71,71,71,76,71,71,71,71,71,76,71,71,76,76,76,76,76,71,71,71,71,71,76,76,71,71,71,71,71,76,71,76,76,71,71,71,71,71,76,76,76,76,71,71,76,76,71,76,71,76,76,71,71,76,71,71,76,76,71,76,76,76,71,71,76,76,71,76,71,76,71,76,76,71,76,71,71,71,71,71,71,76,71,76,76,76,71,71,76,76,76,71,71,76,71,71,71,76,76,71,76,76,71,71,71,76,76,76,71,71,76,76,76,76,76,71,71,71,76,76,76,71,71,71,71,76,71,76,76,71,71,71,76,76,71,71,76,76,76,76,76,71,76,76,76,76,76,76,76,76,76,71,76,71,76,71,76,71,71,76,76,71,76,76,76,71,76,71,71,76,76,71,76,71,71,71,71,76,76,71,71,71,71,71,71,76,76,71,71,76,71,71,76,76,76,76,76,71,71,76,76,76,71,76,71,71,76,76,71,71,76,71,71,71,76,76,76,76,76,71,71,71,71,76,71,76,76,76,76,71,76,71,71,76,71,71,76,76,76,76,71,76,76,76,76,71,76,76,76,71,71,71,76,76,76,71,76,76,76,76,76,76,71,71,71,71,76,76,76,71,71,76,76,76,71,76,76,71,71,76,76,76,71,76,76,71,71,71,71,71,71,76,71,76,71,76,71,71,76,76,76,71,71,76,71,71,76,71,76,76,71,71,71,71,76,76,71,71,71,71,76,76,71,71,76,71,71,76,76,76,71,71,76,76,71,76,71,71,76,71,71,71,71,71,71,76,71,76,76,71,71,76,71,71,76,71,71,76,71,71,76,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,71,76,71,76,71,71,71,76,76,71,71,71,76,71,76,71,76,71,76,71,71,76,76,71,71,76,71,71,76,71,71,76,76,76,76,71,71,76,71,71,71,76,71,76,71,71,71,71,71,76,71,71,76,71,71,76,71,76,71,71,76,71,76,76,76,71,71,76,76,76,76,76,71,76,76,76,76,71,71,71,76,71,71,71,76,76,76,71,71,71,76,76,71,76,71,76,71,71,71,76,76,76,76,76,76,71,76,76,71,76,76,76,71,71,76,71,71,76,76,71,76,71,76,76,71,71,76,71,71,71,76,76,76,71,71,71,76,71,71,76,71,76,71,71,71,71,71,76,71,76,71,76,71,71,71,71,71,76,71,71,76,76,76,71,71,71,71,71,76,76,76,71,76,76,76,71,76,71,76,76,71,71,76,76,76,71,76,76,71,76,71,76,76,76,76,71,76,71,71,76,71,76,76,71,71,76,76,76,71,71,71,76,76,71,76,76,71,76,76,71,71,71,76,76,76,76,76,71,76,76,71,76,71,71,71,76,71,76,71,76,71,71,71,71,76,71,76,71,76,76,76,71,71,71,76,71,71,76,76,71,76,76,76,76,71,71,76,71,71,76,76,71,76,71,76,76,76,71,71,71,71,76,71,71,76,71,71,76,71,76,71,71,71,71,76,71,71,71,71,76,71,76,71,71,71,71,71,76,76,71,71,71,71,76,76,76,71,71,71,71,71,71,71,71,71,71,71,76,71,71,71,71,71,76,76,76,71,76,76,71,76,71,76,76,76,71,76,71,71,71,71,71,76,76,71,76,76,71,76,76,71,76,71,76,76,71,76,71,71,71,71,76,71,76,76,71,71,76,71,76,71,76,71,76,76,76,71,71,71,76,71,76,76,76,76,76,71,71,71,71,76,76,71,76,71,71,76,71,71,76,76,76,71,71,71,76,76,76,71,76,76,76,71,76,71,71,71,71,71,71,76,71,76,76,71,71,76,76,76,71,71,71,71,76,71,76,76,76,76,71,71,71,71,76,71,76,76,71,76,76,71,71,76,71,76,76,76,76,71,71,76,71,71,71,71,76,71,76,71,71,76,76,71,71,71,76,76,76,76,76,71,71,71,71,76,71,71,76,71,76,76,71,76,71,76,71,71,71,71,76,76,76,76,76,76,76,71,71,76,76,71,76,76,71,71,76,71,76,76,76,71,71,71,76,71,76,76,76,76,76,71,71,76,71,71,76,71,76,76,76,76,76,71,71,71,71,71,71,76,71,76,71,76,71,76,71,76,76,76,71,71,76,71,76,76,76,76,71,71,76,76,76,76,71,76,71,71,71,71,71,76,76,76,76,76,71,76,71,71,76,76,76,71,76,76,71,71,71,76,76,76,76,71,76,76,76,76,76,76,71,76,76,71,76,71,76,71,71,71,71,71,76,76,76,76,71,76,71,71,71,76,76,76,76,76,76,71,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,71,71,76,76,76,71,71,71,71,76,71,71,71,71,76,76,71,76,71,71,71,71,76,71,71,76,76,76,71,71,71,76,71,71,76,71,71,71,71,76,76,76,71,71,76,71,76,71,76,76,76,76,76,71,76,76,71,76,71,76,71,71,71,71,76,71,71,76,71,71,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,71,76,71,76,71,76,71,71,76,71,76,71,71,76,71,71,76,76,71,71,76,76,71,76,71,76,71,71,71,71,76,71,71,71,71,71,71,76,76,71,71,76,76,71,71,71,71,76,76,76,76,76,76,71,76,71,71,76,71,71,76,71,71,76,76,71,71,76,76,71,76,76,71,71,71,76,76,71,71,76,76,76,76,76,71,71,76,76,76,76,71,71,71,76,76,71,76,71,76,71,71,71,76,71,76,76,71,71,76,76,71,76,76,76,71,76,71,76,71,71,71,76,76,76,71,76,71,71,76,71,76,76,76,76,71,76,76,71,71,71,71,76,71,71,71,76,76,71,76,76,71,76,71,76,71,76,76,71,76,71,71,71,71,76,71,71,76,76,71,76,76,76,71,76,71,76,71,76,76,76,71,76,76,76,76,71,71,76,76,71,76,71,71,76,71,71,71,76,71,71,76,76,76,76,71,71,76,76,71,76,76,76,76,71,71,76,76,71,76,71,71,71,76,71,76,76,71,71,76,76,76,71,76,71,76,71,76,76,76,71,76,76,76,76,76,71,76,71,76,76,76,76,71,71,76,76,76,71,76,76,76,76,76,76,71,76,76,71,71,71,71,76,71,71,71,76,71,71,71,71,71,76,71,76,71,76,71,76,71,76,71,71,76,76,76,76,71,76,71,71,76,71,76,71,76,71,71,71,71,71,76,76,76,76,76,76,71,76,71,71,76,71,76,71,76,71,71,76,71,76,76,71,71,76,71,71,71,76,76,71,76,76,71,71,76,71,76,76,71,71,71,71,71,76,71,71,71,71,76,76,76,71,76,71,71,71,76,71,71,71,71,71,71,76,71,76,76,76,76,71,76,71,76,76,76,76,76,71,71,71,76,71,71,76,76,71,76,76,71,71,71,71,76,76,71,71,71,76,71,71,76,76,76,71,71,76,71,76,76,71,71,76,76,71,71,71,71,71,76,76,71,76,76,76,76,76,76,71,71,76,71,71,76,71,71,76,71,76,76,71,76,71,71,76,76,71,71,71,76,76,76,71,71,76,76,76,71,71,71,71,76,71,76,71,76,71,71,76,76,71,71,76,76,71,76,71,71,76,71,71,71,76,71,71,76,76,71,71,71,71,76,71,71,76,76,76,71,71,71,71,71,71,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,71,71,76,71,71,71,76,76,71,76,71,71,71,76,71,71,76,76,76,71,71,76,71,76,71,76,71,76,76,76,76,71,76,76,76,71,76,71,76,71,71,71,76,71,76,71,71,76,76,71,76,76,76,76,71,76,71,76,76,71,71,71,76,76,71,71,76,71,76,76,71,71,71,76,76,71,71,76,71,76,71,71,71,76,71,71,76,76,71,71,71,76,76,71,76,76,71,76,71,71,71,71,76,76,76,76,76,76,76,76,71,71,76,71,76,76,76,76,76,71,76,76,71,71,76,71,71,76,71,71,71,71,76,76,71,71,71,71,76,71,76,71,76,71,76,76,76,71,76,76,76,76,71,71,76,76,71,71,71,71,71,71,71,71,76,71,76,76,76,71,76,76,71,71,76,71,71,71,76,76,71,71,76,71,71,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,76,71,71,76,76,76,76,71,71,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,76,76,71,71,76,71,71,76,71,71,76,71,71,71,71,71,71,76,71,76,71,76,71,71,76,76,71,71,76,71,71,76,76,76,71,76,76,76,71,71,71,76,76,76,76,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,71,71,76,71,71,71,76,71,76,71,71,71,71,71,76,71,76,76,71,71,71,76,76,71,76,71,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,76,76,76,76,71,71,71,76,76,71,71,76,76,71,71,76,76,71,71,76,71,71,71,71,76,71,76,71,76,71,71,71,76,76,76,76,71,71,76,76,76,76,76,76,76,76,76,76,71,71,71,76,76,76,71,76,76,76,76,76,76,76,71,76,71,76,71,71,76,76,71,76,71,76,76,71,76,71,76,71,76,71,71,71,76,76,71,71,76,71,76,71,76,76,76,71,76,71,76,71,71,76,71,71,76,71,76,76,71,71,71,71,71,76,76,76,71,76,76,76,76,76,76,76,71,71,71,76,71,71,76,76,71,71,76,76,76,71,76,71,71,71,71,76,71,71,71,71,76,71,71,71,76,71,76,71,76,71,71,76,71,71,71,71,76,71,76,76,76,76,71,71,71,71,71,76,76,76,76,71,71,76,76,76,76,76,76,71,71,71,71,76,76,71,76,71,76,76,71,76,71,71,71,71,71,71,76,71,76,76,71,76,76,71,76,76,71,76,76,71,71,71,76,71,76,76,71,71,71,76,76,71,71,76,71,71,71,71,76,71,71,76,71,71,76,76,76,71,76,76,71,71,71,71,71,76,76,71,76,76,76,76,76,71,76,71,76,71,71,76,71,71,76,71,71,71,71,71,71,76,76,76,71,71,71,71,71,71,76,71,71,71,76,76,76,76,71,76,76,76,71,76,76,71,71,71,76,76,71,76,76,76,76,71,71,76,71,71,76,76,76,71,71,76,71,71,71,76,76,71,76,76,76,76,71,76,76,71,71,76,71,71,71,71,76,71,76,71,76,71,76,76,71,76,76,71,71,71,71,71,76,76,71,76,76,76,71,71,76,71,71,76,71,76,76,71,76,76,71,76,76,76,76,76,76,71,76,71,76,71,76,71,76,76,76,71,76,71,71,71,76,76,76,71,71,71,71,76,76,76,71,71,76,71,76,71,71,71,71,76,76,76,71,71,76,76,76,71,76,76,71,76,71,76,76,71,76,76,76,71,71,71,71,76,71,76,71,76,76,76,76,71,71,76,71,71,76,76,76,76,76,76,76,76,76,76,71,76,76,71,76,76,71,76,76,76,76,71,71,76,71,71,76,71,71,76,76,71,71,76,76,76,71,71,71,71,71,71,76,71,71,76,76,71,76,76,76,76,76,71,71,71,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,76,71,76,76,71,76,71,76,71,76,76,71,71,76,71,76,76,71,76,76,71,71,76,71,76,71,76,71,71,71,76,76,71,71,76,76,76,71,76,71,76,71,71,76,76,76,76,76,71,76,76,76,71,76,71,76,71,76,71,76,76,71,71,71,71,76,71,76,71,76,71,71,71,71,71,76,71,76,76,76,71,76,71,76,71,71,71,71,76,71,71,71,71,71,76,71,76,76,71,76,71,71,71,71,76,71,76,71,71,76,76,76,71,76,76,76,76,71,71,71,76,71,76,76,71,76,76,71,76,71,71,76,76,76,76,71,76,71,76,71,71,71,71,76,71,76,76,76,76,71,71,71,71,76,76,71,76,71,71,71,71,76,71,71,71,76,71,76,76,76,71,76,76,76,76,76,76,71,76,76,71,76,76,71,76,71,71,71,71,76,76,71,76,76,76,71,71,76,76,76,76,71,76,71,71,76,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,76,76,76,76,71,71,71,76,71,71,71,76,76,76,71,76,71,71,71,76,76,71,71,76,76,71,76,71,71,71,76,71,71,71,76,76,76,76,76,76,71,71,71,76,76,76,71,71,76,71,71,71,76,76,71,76,76,76,76,76,76,71,76,76,71,76,71,76,71,76,71,76,76,71,71,76,76,76,76,76,71,71,76,71,71,71,76,76,71,76,76,76,76,76,76,76,76,71,71,71,76,76,71,71,76,76,76,71,76,76,76,76,76,76,76,71,71,76,76,76,76,71,71,71,71,76,71,71,71,76,76,71,71,71,71,71,71,71,71,76,76,71,71,76,76,76,71,76,71,71,76,76,76,76,76,71,71,76,71,71,71,71,76,71,71,76,71,76,71,76,76,71,76,71,71,76,76,71,76,71,76,71,76,71,76,76,71,76,71,76,71,76,71,71,71,71,71,71,71,76,76,76,71,76,71,71,76,76,76,71,71,71,76,71,76,76,71,76,76,76,71,71,76,76,76,76,71,71,71,71,71,76,71,76,76,76,76,71,71,71,76,76,71,71,71,76,71,76,71,76,71,76,76,71,76,71,71,76,71,76,71,76,71,71,71,71,71,71,76,76,71,71,76,76,76,76,76,71,76,71,71,76,71,76,71,71,71,76,71,76,71,71,76,76,76,76,76,76,76,71,76,71,71,71,76,76,71,71,71,76,76,71,76,71,71,71,71,71,71,76,71,76,71,76,76,76,71,76,71,76,76,71,71,71,71,76,71,76,76,76,71,76,76,76,76,76,71,71,71,76,76,71,76,76,71,71,76,76,71,76,71,76,71,76,76,76,76,76,71,76,71,76,71,71,76,71,71,71,71,71,71,76,71,76,76,71,71,76,71,71,76,71,71,76,71,76,71,71,76,71,76,71,71,76,76,71,76,76,76,76,71,71,71,71,76,71,76,76,71,71,76,76,71,76,71,71,71,71,76,71,76,76,76,71,76,71,71,71,71,76,71,71,71,76,71,71,76,71,71,76,76,76,76,71,76,76,71,76,71,76,76,71,71,76,76,76,71,76,71,76,76,71,76,71,76,71,71,71,71,71,71,76,71,71,76,76,76,76,71,71,71,71,71,71,71,76,76,71,76,71,76,76,71,76,76,76,71,71,76,71,76,76,76,76,76,76,76,71,76,71,76,71,71,76,71,76,71,71,76,76,71,76,71,76,76,76,71,71,76,71,76,71,71,76,71,71,71,71,76,76,76,76,71,71,71,71,76,76,71,76,71,76,71,71,76,71,76,76,71,76,76,76,71,71,76,71,76,76,71,71,76,71,71,76,76,71,76,76,76,71,76,76,71,71,76,76,76,76,76,76,76,76,76,76,71,71,71,76,76,71,71,71,71,71,76,76,76,71,71,71,71,71,71,71,71,76,76,71,71,76,76,71,76,71,76,76,71,71,76,76,76,71,71,71,71,71,71,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,71,71,76,71,71,71,76,71,76,71,71,71,71,76,76,71,76,76,71,76,71,71,76,76,76,76,71,71,76,76,71,71,71,71,76,76,71,76,76,71,71,71,76,71,71,76,76,76,71,76,71,76,71,71,71,71,71,71,76,71,76,76,71,71,71,76,71,76,76,76,71,71,71,71,71,76,71,76,76,71,71,76,71,71,76,71,76,71,76,71,71,76,71,71,76,71,71,76,71,76,76,71,76,71,76,71,71,71,76,71,71,71,76,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,76,71,76,76,71,71,76,76,71,76,76,76,76,71,71,71,76,71,71,71,71,76,76,71,71,71,76,71,76,76,71,71,76,71,76,71,76,71,71,71,71,76,71,71,71,76,76,76,71,76,71,71,76,71,76,76,71,71,76,76,76,76,76,76,76,76,76,76,71,71,76,76,76,71,71,76,71,76,71,76,71,71,76,71,71,71,76,76,71,71,71,71,71,76,76,76,76,71,71,71,71,71,71,76,71,71,71,76,71,71,71,76,76,71,76,76,76,76,71,76,71,76,71,76,71,71,76,76,76,71,71,71,71,76,76,76,71,76,71,76,71,71,76,76,71,76,71,76,71,71,71,71,76,76,76,76,71,76,76,76,71,71,76,71,76,71,71,71,76,76,71,71,71,71,71,71,71,71,71,71,71,76,76,71,76,71,71,76,71,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,76,76,76,76,76,71,76,71,71,71,76,76,76,76,76,71,71,71,71,71,76,71,71,71,71,71,76,76,76,71,76,71,71,71,71,76,71,76,71,71,71,71,71,71,76,71,71,76,76,71,76,71,76,76,71,71,76,76,76,76,71,76,71,71,76,71,76,71,76,76,76,76,71,76,76,76,71,76,71,71,71,76,76,71,71,71,71,76,71,76,76,76,76,71,71,71,71,76,76,71,76,76,76,71,71,76,76,71,71,71,76,76,71,76,76,71,71,76,71,76,76,71,71,76,76,71,71,71,71,76,71,76,71,71,71,71,71,76,71,76,71,76,76,76,71,71,71,76,71,76,71,71,71,71,76,76,76,76,76,71,76,76,76,76,71,71,76,76,71,71,71,71,76,71,71,71,76,76,76,76,71,76,71,71,76,71,76,71,71,71,71,71,76,71,76,76,71,71,76,76,76,76,71,76,71,76,71,76,71,71,76,71,76,76,71,71,71,76,71,76,71,76,76,71,76,71,71,71,71,76,76,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,71,71,71,71,71,76,71,71,71,76,71,71,71,71,71,71,71,71,71,76,76,71,71,71,71,76,76,76,71,71,71,76,76,76,71,76,71,76,76,71,76,71,71,71,76,76,71,76,76,76,76,71,71,76,76,76,71,71,71,71,76,71,71,76,76,71,71,76,76,76,71,71,76,71,76,71,76,76,71,71,71,76,71,76,71,71,76,76,71,76,76,76,76,71,76,71,76,71,71,71,76,71,71,71,71,76,71,76,71,71,76,71,71,76,71,76,76,76,71,71,71,71,76,76,71,71,76,71,71,76,76,76,71,76,76,71,76,71,76,71,71,76,76,71,76,71,76,76,76,71,76,76,71,76,76,76,76,76,76,76,71,71,76,71,76,76,71,71,71,71,76,71,76,71,76,76,71,71,76,76,71,76,76,76,71,76,76,76,71,71,76,71,71,76,71,76,76,71,76,71,71,71,71,76,76,76,71,71,76,71,71,76,71,76,76,76,71,71,71,76,76,76,71,76,71,71,71,76,76,76,76,76,76,71,76,71,76,76,76,76,76,71,71,71,71,76,76,76,76,71,71,76,71,76,71,71,76,76,71,76,71,76,76,76,71,76,71,71,71,76,76,71,76,76,71,71,71,76,71,76,76,71,76,71,76,76,76,71,76,76,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,76,71,71,76,71,71,76,76,71,76,76,76,71,71,71,76,71,71,76,76,76,71,76,76,76,71,71,71,76,71,76,71,76,76,76,71,71,71,71,76,76,76,71,76,76,71,76,71,76,76,71,71,76,76,71,71,76,71,76,71,71,76,71,76,76,76,76,71,76,71,71,76,76,71,71,71,76,76,71,71,76,76,71,71,71,71,76,71,71,71,76,76,71,76,71,76,71,71,76,71,71,71,76,76,71,76,76,71,76,76,71,76,71,71,76,76,76,71,76,71,71,71,76,71,76,71,76,76,71,76,76,71,76,71,76,76,76,76,71,76,76,71,76,76,76,71,76,76,71,71,76,71,71,76,71,71,71,71,71,71,71,76,71,71,76,76,76,71,71,76,71,71,76,71,71,71,71,71,76,76,76,76,71,76,71,71,71,71,71,71,71,71,71,76,71,76,71,76,76,71,76,71,76,76,76,71,71,71,76,71,71,71,76,71,76,76,76,71,76,76,76,71,76,71,76,71,76,71,71,76,76,71,76,76,71,76,71,76,76,76,76,76,76,71,71,76,76,71,71,71,71,71,71,71,71,71,71,71,71,76,76,71,76,71,71,71,76,76,71,71,76,71,76,71,71,71,71,71,71,76,76,76,71,76,71,71,71,71,71,76,71,76,71,76,76,76,76,76,76,71,76,76,71,71,76,76,71,76,76,71,76,71,76,71,76,76,71,71,71,71,76,76,76,76,71,76,76,76,71,76,71,71,76,76,71,71,71,71,76,71,76,71,76,76,71,76,76,76,71,71,71,76,76,71,71,71,76,76,71,76,71,71,71,76,71,71,76,76,71,71,76,71,71,71,76,71,71,76,71,76,71,71,76,71,71,76,71,76,76,76,71,71,76,71,76,76,76,71,71,71,76,76,71,76,76,71,71,76,76,76,76,76,71,71,71,71,71,71,76,71,71,71,71,76,71,71,71,71,76,71,76,71,76,76,76,76,71,71,76,76,71,76,71,76,71,71,71,76,71,71,76,76,76,76,71,76,71,71,76,71,71,71,71,76,76,76,71,71,76,76,71,71,76,76,71,71,76,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,71,76,76,76,76,71,71,76,76,71,76,76,76,76,71,71,76,71,76,71,71,71,76,76,71,76,71,76,71,76,76,76,76,76,71,71,76,71,76,76,71,76,76,71,71,71,76,71,71,76,71,71,76,76,76,76,71,76,71,76,76,71,76,71,76,76,71,76,76,76,76,71,76,71,76,76,71,71,71,76,71,76,76,76,76,76,71,76,76,71,71,76,71,76,71,71,71,76,76,76,76,71,76,76,76,76,71,71,71,76,76,71,71,71,76,71,76,76,71,76,76,71,76,76,71,71,76,71,71,76,76,71,76,71,71,76,76,76,76,71,76,71,71,71,76,76,71,76,76,76,71,76,76,76,76,71,76,76,76,76,71,76,76,71,71,71,76,76,71,76,71,76,71,71,76,76,76,71,71,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,76,76,76,71,71,76,76,76,71,76,71,76,71,71,71,71,76,76,71,76,76,76,71,76,76,76,76,71,71,71,76,71,76,76,71,71,71,71,71,76,71,71,71,71,76,76,71,71,76,71,76,76,71,76,71,76,76,71,71,71,71,71,71,71,71,76,76,71,76,71,76,76,76,76,71,71,76,71,71,76,76,76,76,76,76,71,76,71,76,71,71,76,76,71,71,71,76,71,71,76,71,71,71,76,76,71,71,71,76,71,71,71,71,71,71,76,76,76,71,76,76,76,71,71,71,76,71,76,76,76,76,71,71,71,76,76,76,71,76,76,76,76,76,76,71,76,76,71,71,71,76,71,71,71,71,71,76,76,71,76,71,76,71,71,71,71,76,71,71,76,71,76,71,76,76,76,76,71,76,76,71,71,76,76,76,76,71,71,71,71,71,71,76,71,76,76,76,71,76,76,71,71,71,76,71,71,76,76,71,76,71,76,76,76,71,76,71,76,71,76,71,76,76,76,71,71,76,76,71,76,71,76,76,71,76,76,76,71,76,76,76,76,76,76,76,71,71,76,71,76,71,76,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,71,71,71,71,71,76,71,76,76,76,76,71,71,76,76,76,71,71,71,76,76,76,71,71,71,71,76,71,76,71,76,71,76,71,71,71,71,76,76,76,76,76,71,71,76,71,71,76,76,71,71,76,71,71,76,76,76,76,76,76,71,76,71,71,76,71,71,71,76,71,76,71,76,76,76,71,76,76,76,76,76,76,71,76,71,76,71,76,71,71,71,76,76,71,71,76,71,76,76,76,71,76,71,71,76,76,71,71,71,71,71,76,71,76,71,71,76,71,71,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,71,76,76,71,76,76,71,76,71,71,76,76,76,76,71,76,76,71,76,76,71,76,71,71,76,71,76,76,76,76,71,76,76,71,71,71,71,71,76,76,71,71,71,71,76,76,71,71,76,71,71,76,76,71,71,71,71,76,71,71,71,76,76,76,76,71,71,71,76,76,71,71,76,76,76,71,71,76,71,76,71,71,76,71,71,71,71,76,76,76,71,71,71,76,76,76,76,76,76,76,76,76,76,76,76,71,76,71,71,71,76,71,71,76,71,71,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,71,71,76,71,76,76,71,71,76,76,71,71,71,71,76,76,71,76,71,71,76,71,71,71,76,76,71,71,76,76,71,71,71,76,71,76,76,71,76,76,76,76,71,76,71,71,71,71,76,71,71,76,76,71,71,76,76,71,76,71,76,71,71,76,71,76,76,76,76,71,76,71,71,71,76,71,71,71,71,71,76,76,76,76,71,76,76,76,71,71,76,71,71,76,71,71,71,76,71,76,71,71,71,76,71,71,76,76,76,71,71,71,71,71,71,76,76,76,71,76,76,76,76,71,71,76,76,76,71,76,71,71,71,71,76,71,71,71,71,71,71,76,71,71,71,76,76,71,71,76,76,71,71,71,71,71,76,76,71,71,76,76,71,76,76,76,71,71,71,76,71,76,71,71,76,71,76,76,76,76,76,76,76,71,71,76,76,71,71,71,76,76,76,76,76,76,71,76,76,76,71,76,76,76,76,71,71,76,76,71,76,76,71,71,71,76,71,76,71,76,76,71,71,71,76,71,76,76,76,76,76,76,71,76,71,76,76,76,71,71,76,76,71,76,71,76,76,76,71,71,76,71,76,76,71,76,76,76,76,76,71,76,76,76,76,71,76,71,71,71,71,71,71,71,71,76,76,71,71,71,71,71,71,71,71,76,76,76,76,76,71,76,76,76,76,76,76,71,76,76,76,76,71,71,71,71,76,71,76,76,71,76,76,76,76,76,71,71,76,76,71,76,71,71,71,71,76,76,76,71,76,71,71,71,71,76,76,71,71,71,76,71,76,71,71,71,71,71,76,71,76,76,76,76,76,71,71,76,76,76,71,71,71,71,76,76,76,76,76,71,76,76,76,71,71,76,76,76,71,76,71,71,76,71,71,76,71,71,71,76,71,76,71,71,76,71,71,76,71,71,76,71,71,71,76,71,76,71,71,76,71,71,76,71,71,71,76,71,76,71,76,71,76,76,71,76,76,76,71,76,76,71,76,71,71,76,71,76,71,76,76,71,76,76,76,71,71,71,76,71,71,76,76,76,71,71,71,71,76,71,71,76,76,71,71,71,76,71,71,76,71,76,71,71,76,76,76,71,76,71,76,71,71,76,76,76,76,76,71,71,76,71,71,76,76,76,71,76,71,71,71,76,71,71,71,71,76,76,76,76,71,71,71,76,71,71,76,71,76,76,71,76,71,71,71,76,71,71,71,71,76,76,76,76,76,71,76,71,76,71,76,76,71,71,76,71,76,71,76,71,71,76,76,71,76,76,71,71,76,76,76,71,76,71,71,71,76,76,71,76,71,71,71,71,71,76,71,71,76,76,76,76,71,76,76,76,76,76,76,71,76,76,71,71,71,76,71,71,76,76,71,76,76,71,76,71,71,76,71,71,76,71,71,76,76,71,71,71,71,71,76,76,71,71,76,76,71,76,76,76,76,71,71,71,71,76,71,71,76,76,71,76,76,71,71,76,76,71,76,71,76,76,71,76,76,76,76,71,71,71,76,71,71,71,76,76,71,71,76,71,71,71,76,71,71,71,76,76,76,76,76,71,76,76,71,76,71,71,76,76,76,76,71,76,76,76,76,76,71,71,71,76,76,76,71,71,76,76,76,71,76,71,71,76,71,71,76,71,71,71,76,76,76,71,76,71,76,71,76,76,71,76,71,71,71,71,76,71,71,76,71,71,71,76,71,76,71,76,76,76,76,71,76,76,76,71,71,76,71,76,76,76,71,76,76,76,76,71,76,71,71,76,76,76,76,76,71,71,71,76,76,71,76,76,71,76,71,76,76,71,71,71,71,71,76,71,76,76,71,76,71,71,76,71,71,71,76,76,71,76,71,76,76,71,76,76,71,76,76,76,71,71,76,76,71,71,71,71,76,76,76,71,76,71,71,71,76,71,71,71,71,71,71,71,76,71,76,76,76,76,71,76,76,76,76,76,71,71,76,71,76,71,71,76,76,76,76,71,76,76,71,71,76,71,71,76,71,71,71,76,76,76,71,76,76,71,71,76,71,71,71,71,71,76,71,76,71,76,76,71,76,76,71,76,71,71,76,71,71,76,76,76,76,71,76,76,76,76,71,71,71,71,71,71,71,76,76,71,71,76,76,76,76,71,71,71,76,71,71,71,76,71,71,76,76,71,76,76,71,76,71,71,71,71,71,71,76,71,71,76,76,71,71,71,76,76,76,76,71,76,71,76,76,71,76,71,71,71,76,71,71,76,71,71,71,71,71,71,76,76,71,76,76,76,71,76,76,71,76,71,76,71,76,76,76,76,71,76,71,71,76,71,76,71,71,76,76,76,76,71,71,76,76,71,76,71,71,71,71,71,71,71,76,71,76,71,71,71,76,71,71,76,71,76,76,71,76,76,71,76,76,71,76,71,76,76,71,71,76,71,76,76,76,71,76,76,71,76,71,71,71,71,71,76,76,76,76,71,71,76,71,76,71,71,71,71,76,76,71,71,76,71,71,76,76,71,71,76,76,76,76,76,71,71,71,71,71,76,76,76,71,76,71,76,71,71,71,76,76,76,71,71,71,76,76,76,76,76,76,71,76,76,76,71,71,76,76,76,71,71,71,71,71,71,76,71,76,71,71,71,76,76,71,71,71,71,71,71,76,71,71,76,71,76,76,76,71,71,76,71,76,71,76,71,71,71,71,71,71,71,71,76,76,71,76,76,76,76,76,76,71,76,71,71,71,76,76,71,71,71,71,76,76,71,76,76,71,76,76,76,76,71,76,71,76,71,71,71,76,76,76,71,71,76,76,71,71,71,76,71,71,76,71,71,76,71,76,76,76,76,71,76,76,76,71,71,71,71,76,71,71,76,76,71,76,71,71,71,71,71,76,71,76,76,71,71,71,76,76,71,76,71,76,71,71,76,76,76,71,71,71,71,76,76,76,71,76,76,76,71,76,76,71,76,76,76,71,71,76,76,71,71,76,71,76,71,76,76,71,71,71,76,76,71,71,71,71,71,76,76,76,71,76,76,71,76,71,71,76,71,76,71,76,71,71,71,71,76,71,76,71,71,71,71,76,71,71,76,71,76,76,71,76,71,76,76,76,76,76,71,71,76,76,71,71,76,71,76,76,76,76,71,71,71,76,76,76,76,76,71,76,76,71,76,76,71,76,76,71,76,71,76,71,76,76,76,71,76,76,71,71,71,71,71,76,76,76,76,76,71,71,76,71,76,76,71,71,76,71,76,71,71,71,71,76,76,71,76,71,76,76,71,76,71,71,71,76,71,76,71,71,71,71,76,76,76,76,76,76,71,76,71,76,71,76,71,76,71,76,76,71,76,76,71,71,76,76,76,76,76,76,71,71,71,71,76,71,71,71,71,76,71,76,71,71,71,71,76,71,76,71,71,71,76,76,71,71,71,76,76,71,71,76,76,71,71,71,76,76,71,71,71,71,71,71,71,71,76,71,71,76,71,71,71,76,76,76,76,76,71,76,76,71,71,71,76,76,76,76,71,76,71,76,76,71,76,76,76,76,76,71,71,76,71,71,76,76,71,76,71,76,71,76,71,76,71,71,71,71,76,71,76,71,71,71,76,76,71,76,71,71,76,76,71,76,71,76,71,71,76,71,71,76,71,76,71,71,76,76,71,76,71,71,76,76,76,71,76,71,71,71,71,71,71,76,76,71,71,71,76,71,76,71,71,71,71,71,71,71,71,71,71,76,76,71,76,76,76,76,71,76,76,71,71,71,71,71,71,71,71,76,71,76,76,76,71,76,71,76,76,71,71,76,76,71,71,76,76,76,71,76,71,76,71,76,76,71,71,76,76,71,71,71,76,71,71,71,76,76,71,71,76,71,76,71,76,76,71,76,76,76,71,76,71,76,76,71,71,71,71,76,76,71,76,71,76,71,76,71,71,76,76,71,71,71,71,71,76,71,71,76,76,71,76,71,71,71,76,76,71,71,76,71,76,76,76,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,76,71,71,76,71,71,71,76,71,76,71,71,71,71,76,76,76,71,76,76,76,76,71,76,76,76,76,76,76,76,76,71,76,76,76,76,71,76,76,71,76,76,71,76,71,71,76,71,71,76,71,76,76,71,71,76,71,71,71,76,76,71,76,71,71,76,76,71,76,71,76,76,71,76,71,71,76,71,71,76,71,76,71,76,71,71,76,76,76,71,71,76,76,76,76,76,76,76,76,71,76,71,71,76,71,71,76,76,71,76,76,76,76,76,76,71,76,76,76,71,76,76,76,71,76,71,71,71,76,71,76,76,76,71,71,71,76,76,76,76,76,71,71,76,76,76,76,76,76,76,71,71,76,76,76,71,76,71,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,71,71,71,71,71,76,76,76,71,76,76,71,71,76,71,71,76,71,71,71,71,71,71,71,76,76,76,71,76,71,76,71,76,76,71,76,71,76,76,76,76,76,71,71,71,71,76,76,71,71,71,71,76,76,71,71,76,71,76,76,71,71,71,71,71,76,71,76,76,76,71,71,76,71,71,76,76,71,76,71,76,71,76,76,76,71,71,76,71,76,71,76,76,71,76,76,71,71,76,76,76,76,76,71,71,76,76,76,71,76,71,76,71,71,76,71,71,71,71,71,71,71,76,71,71,71,76,71,76,76,76,76,71,71,71,71,71,71,71,76,76,71,76,71,71,76,76,71,76,76,76,76,76,76,71,76,76,71,76,71,71,76,71,71,71,76,76,76,76,71,76,76,71,76,76,71,76,71,76,76,71,71,76,76,76,71,76,71,76,71,76,71,71,76,76,76,76,76,71,76,76,76,71,71,71,76,76,71,71,71,71,71,76,76,76,76,76,71,71,71,71,71,76,76,76,76,76,71,76,76,76,76,76,71,71,76,76,71,76,76,71,71,76,76,76,71,76,76,76,71,71,71,71,71,71,76,71,71,76,76,76,76,76,71,71,71,71,76,71,76,71,76,76,71,71,76,76,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,76,71,71,71,76,71,71,71,71,71,71,76,76,71,71,76,71,76,71,76,76,76,76,71,76,76,71,71,71,76,76,76,71,71,71,76,76,71,76,71,76,71,71,76,71,76,76,76,71,76,71,76,76,76,71,71,76,71,76,76,71,76,71,76,71,71,76,71,71,76,76,71,71,71,71,71,71,71,71,71,71,71,71,76,76,71,71,71,71,76,76,76,71,76,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,71,71,71,76,71,71,71,71,71,71,76,76,76,76,76,76,71,76,76,71,76,71,76,76,76,76,76,71,76,71,71,71,76,71,76,76,71,76,76,76,71,76,71,76,71,76,71,71,76,71,76,71,76,76,71,76,71,76,76,76,71,71,76,76,71,71,76,71,76,76,71,71,76,71,71,71,76,76,71,76,76,76,76,76,71,76,71,71,76,76,76,71,71,76,71,76,71,71,76,76,71,71,76,76,76,76,76,76,71,71,76,76,71,76,71,76,71,71,76,71,71,76,76,76,76,76,71,76,71,76,71,71,71,76,76,76,76,71,76,76,71,76,71,71,76,71,71,71,71,76,71,76,71,71,71,71,76,76,71,76,76,76,76,71,76,71,71,71,71,76,76,71,71,71,76,71,76,71,76,76,76,76,71,76,71,76,71,71,76,71,76,76,76,71,76,71,71,71,76,71,76,76,71,76,71,76,76,71,76,76,71,71,76,76,76,71,76,76,76,76,76,71,76,71,76,76,76,71,76,71,71,76,71,71,71,76,76,76,76,71,71,71,76,71,71,76,71,71,71,71,71,76,71,71,71,71,71,76,71,76,76,71,71,71,71,71,76,71,71,71,76,76,71,76,76,76,76,76,71,76,76,76,76,76,71,71,71,76,76,71,71,76,76,76,71,71,76,71,71,76,71,71,71,71,71,71,76,71,76,76,76,76,71,71,76,71,76,76,76,71,71,71,76,71,76,71,71,76,71,76,76,71,71,76,71,76,71,76,71,76,76,71,76,76,71,71,76,71,71,71,76,71,71,71,76,76,71,76,76,76,71,71,76,71,76,71,76,76,76,71,76,71,71,76,71,71,71,76,76,71,76,71,71,76,76,71,71,71,71,76,76,76,76,71,76,76,76,76,76,71,71,76,71,71,76,71,76,71,76,76,76,71,71,76,71,76,76,71,76,76,71,71,76,71,71,71,71,71,76,71,76,76,71,76,71,71,76,71,71,71,76,71,76,76,76,71,71,76,76,71,76,71,71,76,71,71,71,76,76,71,71,76,76,71,76,76,71,71,71,71,76,76,71,71,71,71,76,71,71,71,76,71,71,76,71,76,71,76,76,71,71,71,76,76,76,76,76,71,71,71,76,71,71,76,71,71,71,71,76,71,71,71,71,71,76,76,71,76,71,71,71,76,71,76,71,76,71,71,76,71,71,76,71,76,76,71,76,71,71,71,76,76,71,76,76,76,71,76,71,71,76,71,71,71,71,76,76,76,76,71,76,76,71,71,71,76,76,71,76,76,71,71,71,76,76,76,71,71,71,76,71,76,76,76,71,76,76,71,76,76,71,76,71,76,76,71,71,71,71,71,76,71,76,76,76,76,71,71,76,76,76,71,76,71,76,76,76,76,76,76,76,71,76,71,76,71,76,76,76,76,76,76,71,76,76,76,76,71,71,76,76,71,76,76,76,71,76,71,76,71,76,76,71,76,76,71,76,76,71,71,76,71,76,76,76,76,76,71,71,71,71,71,71,76,71,71,76,76,71,76,71,71,76,71,76,76,76,71,76,71,71,76,71,71,71,76,71,76,76,76,71,71,71,76,76,71,71,76,71,76,71,71,71,76,76,76,71,71,71,76,71,76,76,71,76,76,71,76,76,76,76,71,76,71,71,76,71,76,71,76,76,76,76,71,71,76,76,71,71,76,71,76,76,71,76,71,71,76,71,71,71,71,71,71,71,71,76,71,76,71,76,71,71,76,71,71,76,71,71,71,71,76,76,76,71,76,76,71,71,71,76,76,71,71,76,76,71,71,76,76,76,71,71,76,76,71,71,76,71,71,76,71,76,71,71,71,76,76,76,71,76,76,76,71,71,71,71,71,71,76,71,76,76,71,71,76,76,76,76,71,71,71,76,71,71,76,71,71,71,76,76,76,71,76,71,76,76,76,71,76,71,76,76,76,71,71,76,71,76,76,76,71,76,76,71,76,71,76,76,76,76,76,76,71,76,76,71,71,71,71,71,76,76,71,76,76,71,71,71,71,71,71,76,76,71,76,76,76,71,71,76,71,76,76,71,76,76,71,71,71,76,76,76,71,76,71,76,71,71,76,71,71,76,71,76,76,71,71,76,76,71,71,71,71,71,71,71,76,71,71,71,76,71,71,71,71,71,76,76,76,71,71,76,76,76,71,76,71,71,71,76,76,76,76,71,76,76,71,76,71,76,76,76,76,76,71,76,76,71,76,76,71,76,76,76,71,76,76,71,71,71,71,71,71,76,76,76,71,76,71,76,76,71,71,76,76,76,71,76,71,71,71,71,71,76,71,71,76,76,71,76,76,76,76,71,76,76,76,76,76,76,76,76,76,76,71,76,76,71,76,76,71,76,71,76,71,71,71,76,76,71,71,71,76,71,71,71,71,76,76,71,71,76,71,71,71,76,76,76,76,71,71,71,76,71,71,76,76,71,71,76,71,71,71,71,76,76,76,76,71,76,71,76,76,76,71,71,71,76,71,76,76,71,76,71,76,71,71,71,71,76,71,76,71,71,76,76,71,76,71,76,76,76,76,76,76,76,76,71,76,76,71,71,71,76,71,76,71,76,71,76,71,71,76,71,71,76,76,76,71,71,76,76,76,76,71,76,71,76,76,71,76,71,71,76,76,76,76,76,71,76,71,76,76,76,71,76,76,71,71,76,76,76,71,76,71,76,76,76,76,76,71,76,76,76,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,76,71,76,76,76,76,71,71,71,71,71,76,76,71,76,71,71,76,76,76,71,71,71,76,71,71,71,71,71,71,76,71,71,71,76,76,71,76,76,71,76,71,76,76,71,76,76,71,76,71,76,71,71,71,71,76,71,71,76,76,71,71,71,76,76,76,76,71,71,76,76,76,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,71,76,71,76,76,76,71,76,76,71,76,71,76,71,71,76,76,76,71,76,71,71,76,76,71,76,71,71,76,71,71,71,71,76,76,76,71,76,76,76,76,71,71,71,76,71,76,71,71,71,71,76,71,76,71,71,76,71,71,76,76,76,71,71,71,71,71,71,76,71,76,71,71,71,71,71,71,76,71,71,71,76,76,76,76,71,71,76,71,71,76,71,76,71,76,71,76,76,71,76,76,76,76,71,76,71,71,76,76,71,71,76,71,76,76,76,76,71,71,76,71,76,71,76,76,76,76,76,71,76,71,71,76,76,71,76,71,76,71,76,76,71,76,71,76,76,71,76,71,71,71,71,76,76,71,76,71,71,71,76,71,71,76,71,71,71,76,76,71,71,76,71,76,76,76,76,76,71,71,71,71,71,71,71,71,76,76,76,76,71,71,71,76,76,71,76,71,76,71,76,71,76,71,76,76,71,71,76,71,76,76,76,71,71,71,71,76,76,71,71,76,71,71,71,71,71,76,76,76,71,71,76,71,76,76,76,76,71,76,76,76,76,71,71,76,71,71,71,76,71,71,76,76,76,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,71,76,71,76,76,76,76,76,71,71,71,71,76,71,76,71,76,76,76,76,71,71,76,71,76,76,76,71,76,76,76,71,71,71,76,76,71,76,71,71,71,76,76,71,76,76,71,76,71,71,71,71,76,71,71,76,76,76,71,71,76,71,76,71,76,71,76,76,71,76,71,76,76,71,76,71,71,76,76,76,71,76,76,71,76,76,71,71,76,76,71,71,71,71,71,76,76,71,76,76,71,76,76,71,71,71,76,71,71,71,76,71,71,71,76,71,76,71,76,71,71,71,76,76,76,76,71,76,76,76,76,71,71,71,76,71,76,71,71,71,76,71,76,76,76,71,71,76,76,71,76,76,76,71,71,76,71,71,71,71,76,71,76,71,76,71,76,76,71,71,76,76,71,76,71,76,76,71,76,71,71,76,71,76,76,71,76,71,71,71,71,76,71,71,71,71,71,71,76,71,76,71,71,76,76,71,76,76,71,76,71,76,71,71,76,71,76,71,71,71,76,71,76,76,76,76,71,76,71,71,76,76,76,71,71,76,76,76,76,71,76,76,71,76,76,76,71,71,71,71,71,76,76,71,71,71,71,71,76,76,76,71,76,71,76,76,71,71,76,76,76,76,71,76,71,71,71,71,76,76,76,76,76,71,71,76,71,76,71,76,71,76,71,71,76,76,76,76,76,71,71,76,71,76,71,71,76,76,71,76,76,71,71,76,71,76,76,71,76,76,76,76,71,76,71,71,71,71,76,76,71,76,76,76,71,71,71,71,71,76,71,71,76,71,76,76,76,71,71,76,76,71,76,71,71,71,76,71,76,71,71,71,76,71,71,76,71,71,71,76,71,76,76,76,71,71,76,76,76,71,71,76,71,71,71,71,76,71,76,76,71,71,76,71,76,76,76,71,76,76,76,71,76,76,71,76,71,71,71,71,71,71,76,71,71,71,76,71,76,76,76,71,76,76,76,71,76,76,76,76,76,76,71,71,71,71,76,71,76,71,71,71,71,71,71,76,76,76,76,76,76,71,71,76,71,71,76,76,71,76,71,71,71,76,76,71,76,76,76,71,76,76,76,71,76,76,76,71,76,71,71,71,76,76,71,76,71,71,76,76,76,71,71,76,76,71,71,76,76,76,76,76,71,71,76,76,71,71,76,71,76,76,71,76,76,76,71,76,71,76,76,71,71,76,71,71,76,76,71,71,71,71,71,71,76,76,71,71,71,71,71,71,76,71,76,76,71,76,71,71,76,76,76,76,76,76,76,76,71,71,71,71,76,71,76,71,76,76,71,71,76,71,71,76,76,71,71,76,76,71,76,71,71,71,71,71,76,71,71,71,76,76,71,71,76,76,71,76,76,76,71,76,71,76,71,71,76,76,76,76,76,71,76,76,71,71,71,76,71,76,76,76,76,76,71,71,76,71,76,76,76,71,76,76,76,71,76,76,71,71,71,76,76,76,71,71,76,71,76,71,71,71,76,71,71,76,76,71,71,71,76,76,71,71,76,76,76,76,76,71,71,76,76,76,71,76,76,71,76,76,71,76,71,76,76,71,71,76,71,71,71,76,71,71,71,76,71,76,76,76,71,76,76,76,76,71,71,71,71,76,71,71,76,76,76,71,71,71,71,71,71,76,76,71,71,76,71,71,71,76,76,76,76,71,71,71,76,71,71,76,71,76,76,76,76,76,71,71,76,76,76,76,71,71,71,71,76,76,76,71,76,76,71,71,76,71,76,76,71,71,71,71,76,76,76,71,76,76,76,71,76,76,71,76,76,71,71,76,71,71,71,71,76,76,71,71,71,71,76,71,76,71,71,71,76,71,76,76,71,76,76,71,76,76,71,71,71,76,71,76,76,76,71,71,71,71,71,71,71,76,76,71,71,71,76,76,71,76,76,76,71,71,71,71,76,71,71,71,76,76,71,76,71,76,71,71,76,76,76,71,76,76,76,71,76,76,71,76,71,71,76,71,71,71,76,76,76,71,76,71,76,76,71,76,76,76,76,76,71,71,76,76,71,71,71,71,76,76,76,71,71,76,71,76,76,71,76,76,76,71,76,71,76,76,76,71,71,76,76,76,71,71,76,76,76,71,71,76,76,76,76,71,76,71,71,76,76,71,76,76,71,76,71,76,76,76,76,71,71,71,76,71,76,76,76,76,71,71,76,71,71,76,76,76,71,71,76,71,71,71,76,71,76,71,71,76,71,71,71,71,76,76,71,71,71,71,71,71,76,71,76,71,71,71,71,76,71,76,71,76,71,71,76,71,71,76,76,76,71,76,76,76,76,71,71,76,76,76,76,71,71,76,76,71,71,71,71,76,71,71,71,71,76,76,76,76,71,71,71,71,76,76,76,76,71,71,76,76,71,76,76,71,71,76,76,76,76,76,76,76,71,71,71,76,71,71,76,76,76,76,76,76,71,76,76,71,76,71,71,76,76,71,76,76,76,71,71,71,76,76,76,71,71,71,71,71,76,71,71,76,76,76,71,76,76,76,76,76,71,76,76,71,76,76,71,71,71,71,71,71,71,76,76,71,76,71,76,71,71,76,76,71,71,71,71,76,76,76,76,71,76,76,76,71,71,71,76,71,76,71,76,71,76,71,76,76,71,76,76,76,71,76,76,76,76,71,76,71,71,71,71,71,71,71,76,71,76,76,71,76,76,76,76,76,76,71,71,71,76,76,76,76,76,76,71,71,71,76,71,71,71,71,76,76,76,71,76,71,71,71,76,76,76,76,71,71,76,71,71,76,76,71,76,76,71,76,76,76,76,76,76,71,76,71,76,76,71,76,76,71,76,71,71,71,71,71,71,71,71,71,71,71,71,76,76,76,76,71,71,71,71,76,76,71,76,71,71,76,71,71,76,76,76,71,71,76,71,76,71,76,71,71,71,76,71,71,76,76,71,71,71,71,76,71,76,76,71,71,71,71,76,71,76,76,71,71,76,71,71,71,76,76,76,76,71,76,76,71,76,71,71,71,76,76,71,71,76,71,71,71,71,76,71,76,76,71,76,71,71,71,71,71,71,76,76,71,76,71,76,71,71,71,71,76,76,71,71,76,71,76,76,71,76,71,71,76,71,76,71,71,71,71,76,71,71,76,71,76,71,76,71,71,76,71,76,76,76,76,76,71,76,76,76,71,71,76,76,71,76,71,71,71,76,76,71,71,71,71,76,76,76,76,76,71,71,76,76,76,76,76,71,71,76,76,76,76,76,76,71,71,71,76,71,76,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,71,76,76,71,76,71,76,71,76,71,71,71,71,71,71,71,76,76,76,71,76,76,76,71,76,76,76,76,71,71,76,71,76,76,71,71,71,76,71,71,76,71,71,76,71,76,76,71,71,76,76,76,71,76,71,76,76,76,76,71,71,71,71,76,76,76,71,76,71,76,76,76,71,71,71,71,76,76,76,76,76,71,71,71,71,76,76,71,71,71,71,76,76,76,71,71,71,71,76,71,76,71,71,71,71,71,76,76,71,76,71,76,71,71,71,76,71,76,71,71,71,76,76,76,71,71,76,76,71,76,71,76,71,71,76,76,71,76,76,76,71,76,76,76,71,71,76,71,76,76,71,71,76,71,76,76,76,71,71,76,76,76,71,76,76,76,76,71,71,71,71,76,71,71,76,71,71,76,71,71,76,71,76,76,76,76,76,71,76,76,76,71,76,76,71,71,76,71,76,76,76,71,76,76,76,71,71,76,76,71,76,71,71,76,76,76,76,71,76,71,76,71,71,76,76,76,71,71,76,76,76,76,76,76,71,76,76,76,76,76,71,76,76,71,76,76,76,71,76,76,71,71,76,71,71,76,71,71,76,71,71,71,71,71,71,71,71,71,76,76,71,76,71,71,76,71,76,71,76,76,71,71,76,71,76,76,71,71,76,71,71,76,76,71,76,76,71,71,71,76,76,71,76,71,76,76,76,71,71,71,71,71,76,71,76,71,71,71,76,71,76,71,76,71,71,71,76,76,76,76,76,71,76,76,76,76,71,71,71,76,76,76,71,76,71,76,76,76,71,76,76,76,76,71,76,71,76,71,76,71,71,71,76,71,76,71,76,71,76,71,71,71,71,71,71,71,71,76,71,76,71,71,76,71,71,71,76,76,71,71,71,71,71,76,76,76,71,71,71,76,76,76,71,76,71,76,71,71,71,71,76,76,76,76,71,76,71,71,76,71,71,76,71,76,71,76,76,76,71,71,76,71,76,71,76,71,71,76,71,76,71,71,76,71,71,76,71,71,76,76,71,76,71,71,71,76,76,76,76,71,71,71,71,71,71,71,76,71,71,76,71,76,71,71,76,71,71,76,71,71,76,76,71,71,71,76,76,76,71,71,76,76,76,71,71,76,76,76,71,71,76,76,76,76,71,71,76,71,76,76,76,76,76,76,76,76,76,71,76,71,71,71,71,76,76,76,76,71,76,71,71,71,76,76,71,71,76,76,76,71,76,71,76,71,76,76,71,71,76,71,71,76,76,76,71,76,71,76,76,71,76,76,71,71,71,71,76,71,71,71,76,76,76,71,76,71,71,76,76,71,76,76,76,71,71,76,76,71,76,71,76,71,71,76,71,71,76,71,76,76,71,71,76,76,76,71,71,71,76,71,71,71,76,76,76,71,71,71,71,71,71,76,71,76,76,76,76,71,76,76,76,71,76,71,71,76,71,71,71,76,76,76,76,76,71,76,76,71,76,71,71,71,71,76,71,76,76,76,71,71,76,71,71,71,76,76,71,71,71,71,71,76,71,71,71,71,71,76,76,71,76,71,71,76,76,71,76,76,76,76,71,76,71,71,76,71,71,71,76,76,71,71,76,71,76,71,71,76,76,71,76,76,76,76,71,71,71,76,76,76,76,71,71,76,76,76,71,76,71,71,76,76,71,76,71,71,76,76,76,71,71,71,76,76,76,76,71,76,71,71,71,76,71,76,71,76,71,76,76,71,71,76,71,76,71,76,76,76,71,71,76,76,71,76,71,71,71,71,76,76,76,76,76,71,71,71,71,76,76,76,76,71,76,71,76,76,76,71,71,76,76,71,71,76,76,71,71,71,71,71,71,76,76,76,76,76,76,71,76,71,71,76,71,76,71,76,71,71,76,76,71,71,76,76,76,76,76,76,71,76,71,76,71,76,71,76,71,76,71,76,71,71,76,76,76,76,76,71,76,71,76,76,76,71,76,76,71,76,71,71,76,71,71,71,71,76,76,76,76,76,71,71,76,76,76,76,76,76,71,76,76,76,76,76,76,76,71,71,76,76,76,71,76,71,71,76,76,76,71,76,71,76,76,71,76,76,71,76,71,76,76,76,71,76,76,76,71,71,76,71,71,71,76,76,76,76,71,71,76,76,71,76,76,76,76,71,71,71,76,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,71,76,71,76,71,71,76,71,76,71,76,76,71,71,71,76,76,76,76,71,76,71,76,71,76,76,71,71,71,76,76,76,76,76,71,71,76,71,76,76,76,71,71,71,71,76,71,71,76,71,71,76,71,76,76,71,76,71,71,76,71,71,71,76,71,76,76,76,76,76,76,76,76,76,71,76,76,71,71,71,76,76,71,71,71,71,76,76,71,76,76,71,76,76,76,71,76,76,71,71,71,76,71,76,71,76,76,71,76,71,76,71,76,71,71,71,71,71,71,76,71,76,71,76,71,71,71,71,71,71,76,71,71,71,71,76,71,76,71,76,76,76,76,71,76,71,76,71,71,71,71,71,76,76,71,76,71,76,76,76,76,76,71,76,71,76,76,76,71,71,71,71,71,71,76,76,71,76,71,71,76,76,71,76,71,71,76,71,71,76,76,71,76,76,76,71,76,71,71,76,71,76,71,71,76,76,76,76,71,76,76,71,76,76,76,76,76,76,71,76,71,71,71,76,71,71,71,76,76,71,71,76,71,76,76,71,76,71,76,76,71,71,71,76,71,76,71,71,71,76,76,76,71,76,71,71,76,71,71,71,76,71,76,76,76,76,76,71,71,71,76,76,71,71,71,76,71,71,71,71,71,76,76,76,71,71,71,71,71,71,76,71,71,76,76,71,76,71,71,76,71,71,76,71,76,76,71,76,71,76,76,71,71,71,76,71,71,76,76,76,71,76,71,76,71,71,71,76,71,71,71,71,76,71,76,76,76,71,76,76,71,76,71,71,71,71,76,71,71,76,71,71,71,76,76,71,76,76,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,76,71,76,76,71,71,71,76,76,71,76,71,71,76,71,71,71,76,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,71,76,76,71,76,71,76,76,71,76,71,76,71,71,76,76,71,76,76,76,71,76,71,76,71,71,71,71,71,71,71,76,76,76,71,76,76,71,76,71,71,76,71,76,71,76,76,76,71,71,76,71,76,71,71,76,71,76,71,76,71,76,71,71,76,71,76,71,71,71,71,76,71,71,76,71,71,76,71,71,76,76,71,71,76,71,76,71,76,71,71,76,71,71,76,71,76,71,76,76,76,76,71,76,71,71,71,76,71,76,71,71,76,76,76,76,71,71,71,71,71,71,71,71,71,76,76,76,76,71,71,76,76,76,71,76,76,71,76,76,71,76,71,71,76,76,71,71,71,76,76,76,71,76,71,71,71,71,71,71,71,76,76,76,76,76,76,76,76,76,76,71,76,76,76,71,71,76,76,76,71,76,71,76,76,71,71,71,71,71,76,71,76,76,76,76,76,71,71,71,76,76,71,76,76,76,76,71,71,71,76,71,76,76,76,71,76,76,76,71,71,76,76,71,76,76,76,76,71,76,71,71,76,71,71,71,76,76,71,76,76,76,71,76,76,71,76,71,71,76,71,76,76,71,71,76,76,76,76,71,71,71,76,76,71,76,71,71,76,76,71,76,71,71,76,71,76,76,76,71,71,71,76,76,76,71,71,76,76,76,76,71,71,71,71,71,71,71,76,71,76,76,76,71,76,76,71,71,71,71,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,71,71,76,71,76,71,71,76,71,71,71,76,76,76,71,71,76,71,76,71,76,76,71,76,76,76,71,71,76,76,76,76,76,71,71,71,76,71,76,71,76,71,71,71,76,76,71,76,71,76,76,71,71,76,71,76,76,76,71,71,76,71,76,76,76,71,71,76,76,71,76,71,71,71,76,71,76,76,76,76,71,71,76,71,71,76,71,71,71,76,76,71,71,71,71,71,76,76,76,71,76,76,71,71,76,71,76,71,71,76,71,71,71,76,71,71,71,76,76,76,71,71,71,76,71,76,71,71,71,71,76,76,76,76,76,71,71,71,76,76,76,76,76,76,71,71,76,71,71,76,71,76,71,76,76,76,76,76,71,76,76,76,76,71,76,71,71,71,76,71,76,76,71,76,71,71,71,76,76,71,76,76,76,71,71,76,76,76,76,71,71,71,76,76,76,76,71,71,76,76,76,76,71,76,71,71,76,76,76,76,71,71,76,76,76,71,76,76,71,71,71,76,76,76,76,71,71,76,71,76,71,71,71,71,71,76,71,76,71,76,71,71,71,71,76,71,76,71,76,76,71,76,71,71,71,71,71,76,76,76,71,76,71,76,76,76,71,76,71,71,76,76,71,76,76,76,71,71,71,76,71,76,71,71,71,76,71,71,71,71,71,76,71,76,71,71,71,71,76,76,76,71,76,76,71,76,71,76,76,71,71,76,76,76,71,71,71,76,71,76,71,71,71,76,71,76,76,71,76,71,76,76,71,76,76,76,71,76,71,71,71,71,71,71,76,71,71,71,71,76,71,71,71,76,71,71,76,76,71,76,71,76,76,71,76,71,71,71,76,71,71,76,71,76,76,76,71,71,71,71,71,71,76,71,76,71,71,71,76,71,76,76,76,76,76,71,76,71,76,76,76,76,76,76,71,76,76,71,76,76,71,71,76,71,71,76,71,71,76,76,71,71,76,71,76,71,76,71,71,76,71,76,71,76,71,71,71,71,71,76,71,76,71,76,71,76,71,76,76,71,76,76,71,76,71,71,71,76,71,71,71,76,76,76,76,76,71,76,76,71,71,71,76,71,76,71,76,71,76,76,76,71,71,76,76,71,71,76,71,76,76,71,76,71,76,76,71,76,76,71,71,71,71,71,76,76,71,76,71,76,71,76,71,76,71,76,76,71,71,71,71,76,71,76,76,76,76,76,76,76,76,71,71,76,76,71,71,76,71,71,76,71,71,76,71,71,71,71,76,76,71,76,76,71,71,71,71,71,71,76,71,71,76,71,71,71,71,76,71,71,71,76,76,76,76,76,71,71,71,76,76,76,76,71,76,76,71,76,71,76,71,76,71,71,71,71,76,71,71,71,71,76,71,76,76,71,71,71,71,71,76,76,76,71,76,71,71,71,76,76,76,76,71,76,76,71,71,76,76,71,76,76,71,76,71,71,76,76,71,76,71,76,76,76,76,76,71,71,71,71,76,76,76,71,76,76,71,71,71,71,71,71,76,76,76,71,76,71,71,76,71,76,71,76,71,76,76,71,76,76,71,71,71,76,71,76,71,76,71,71,76,71,71,71,71,76,76,71,76,76,76,76,76,76,71,76,71,76,76,71,71,76,76,76,71,71,76,76,71,76,71,76,76,71,76,71,71,76,76,71,76,76,76,76,71,71,76,71,76,76,76,76,76,71,76,71,71,76,71,76,76,71,71,71,71,71,71,71,76,76,76,76,71,76,71,71,71,76,71,71,76,76,76,71,76,76,76,71,71,71,76,76,71,71,76,76,76,76,76,71,71,76,71,76,71,71,76,71,76,76,76,76,76,71,76,76,71,71,71,71,71,71,76,71,71,71,76,76,71,71,71,76,71,71,76,71,76,76,76,76,71,76,71,76,71,76,76,76,71,71,71,71,71,71,76,76,76,76,71,71,71,76,71,76,71,71,71,76,76,71,71,76,76,76,71,71,71,76,76,76,76,76,76,76,76,76,71,76,76,76,76,71,71,71,71,71,71,76,71,76,71,71,71,76,71,71,76,71,76,76,71,71,71,76,71,71,71,76,71,76,71,76,71,76,76,76,71,76,71,76,71,76,71,71,71,76,71,71,71,71,76,76,76,76,71,76,76,76,76,76,71,71,76,76,71,76,76,71,71,76,71,71,76,71,71,71,71,76,76,71,71,71,76,71,71,76,71,71,76,71,76,76,76,76,76,76,71,71,76,71,76,76,76,76,71,71,71,76,71,76,71,71,71,76,76,76,76,76,71,76,71,76,71,71,76,76,71,71,76,76,76,71,76,71,71,71,71,76,76,71,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,71,71,71,76,76,71,76,76,71,71,71,71,76,71,76,76,76,76,71,71,76,76,76,71,76,71,76,76,76,76,76,76,76,76,76,76,71,71,76,71,76,71,71,76,76,71,76,71,76,71,71,76,71,76,76,71,76,76,76,76,76,71,71,71,76,76,71,71,71,71,76,76,71,71,71,76,71,76,71,76,71,71,76,76,71,71,76,71,76,71,76,71,76,71,76,76,71,71,71,76,76,76,76,76,71,71,71,76,71,76,71,71,71,71,71,76,71,71,76,71,71,71,71,71,71,71,76,71,71,76,71,76,71,71,71,71,76,71,71,71,76,71,76,71,71,76,71,71,76,71,76,71,71,76,76,71,76,71,71,71,71,71,71,76,71,76,71,71,71,71,76,76,76,76,71,76,71,71,71,76,76,71,76,71,76,71,71,71,71,76,71,71,71,76,71,71,71,76,76,76,71,76,71,76,71,71,76,76,76,76,71,71,76,71,71,76,71,71,71,71,71,76,71,76,71,71,71,71,76,76,76,76,71,76,71,76,71,76,76,76,76,76,71,71,76,71,76,71,71,76,76,76,71,76,71,71,71,76,71,76,76,76,76,76,71,71,76,76,71,71,71,76,76,76,76,71,71,76,71,71,76,71,76,76,76,71,76,71,71,76,76,76,76,71,71,76,71,76,76,76,76,76,71,71,76,71,71,71,71,71,76,76,71,71,71,76,71,76,71,76,76,76,71,71,71,71,76,76,71,76,71,76,76,76,71,76,76,76,76,76,76,76,71,71,76,76,76,76,76,76,71,76,76,71,71,76,71,76,71,76,71,71,71,76,71,71,76,71,71,71,71,76,71,76,76,76,71,76,76,76,71,71,71,71,71,76,76,76,71,71,71,76,76,76,76,76,76,71,71,71,76,71,76,76,71,71,71,71,76,71,71,76,71,71,71,76,76,76,71,71,71,76,71,76,71,76,71,71,76,76,71,71,71,76,76,76,76,76,71,71,71,71,71,76,71,76,71,76,76,71,71,71,76,76,71,76,76,76,71,76,71,71,76,76,71,76,71,76,71,71,76,71,76,71,76,71,71,71,76,71,71,76,71,71,71,71,71,71,76,76,71,76,76,76,76,76,76,71,71,76,71,76,71,71,71,71,76,71,76,71,76,76,76,76,76,71,71,71,76,76,71,76,71,76,76,76,76,71,76,76,76,71,76,71,71,76,71,76,76,71,76,71,71,76,76,76,71,76,71,76,71,71,71,76,71,71,71,76,71,71,76,76,71,76,71,76,71,76,76,71,76,76,71,76,71,76,71,76,71,71,71,71,76,76,76,71,76,71,71,71,76,71,76,71,76,71,71,76,71,71,76,71,71,71,76,71,71,71,71,71,71,76,71,76,76,71,76,71,76,71,71,71,71,76,76,71,71,76,76,76,76,76,71,76,76,76,76,71,76,71,76,71,71,71,76,71,71,76,76,71,76,71,71,76,71,76,71,71,71,71,71,76,71,71,71,71,76,71,71,76,71,71,71,71,71,71,71,76,76,71,71,71,76,71,76,71,76,76,71,71,76,76,76,71,71,76,76,76,71,71,71,76,76,71,71,71,76,76,71,71,71,71,76,76,76,76,71,76,71,71,76,76,71,76,71,71,71,76,71,76,76,71,76,76,76,71,71,71,71,76,71,76,76,71,76,76,76,71,71,71,71,71,76,71,71,76,71,76,76,76,76,76,76,71,76,76,76,76,76,76,71,76,71,71,71,71,71,76,71,76,76,76,76,71,76,76,71,76,76,76,71,71,71,76,76,71,71,76,76,76,76,76,76,76,71,71,76,76,71,76,76,76,76,71,76,76,76,76,76,71,71,71,71,76,76,76,76,76,76,71,71,71,71,76,76,76,76,76,76,71,71,71,71,76,76,76,71,76,71,71,76,76,76,76,71,71,71,71,71,71,76,76,71,71,71,76,71,71,71,76,71,76,76,71,76,71,76,76,71,76,76,71,71,76,76,76,71,71,76,76,76,71,76,71,76,71,71,71,71,76,76,76,76,76,76,71,76,71,76,76,76,76,71,71,76,71,71,71,76,76,71,71,71,71,71,71,71,71,71,76,76,76,71,76,76,76,71,71,71,71,76,71,76,76,71,71,71,71,71,76,71,71,71,71,71,76,76,76,71,76,71,76,71,76,76,76,71,71,71,71,71,76,76,76,71,76,76,76,76,76,71,71,71,76,76,71,76,76,76,71,76,76,71,76,71,76,76,76,76,76,71,76,76,76,76,76,76,76,76,71,76,71,71,71,76,71,76,71,71,71,76,71,71,76,71,71,71,71,71,76,71,76,71,71,76,76,71,76,71,76,76,76,71,71,76,71,76,76,76,76,71,71,71,76,76,76,71,71,76,71,76,71,76,76,76,76,76,76,71,76,76,76,71,71,76,76,76,71,76,76,71,71,71,76,76,71,71,76,71,71,76,71,76,71,76,76,71,76,71,76,76,76,76,76,71,76,76,71,76,71,71,71,76,71,76,71,71,71,71,76,76,71,76,71,76,76,71,76,76,76,76,71,76,71,76,76,76,71,71,71,76,71,71,71,71,71,71,71,76,71,76,76,71,71,76,71,76,71,71,71,71,76,71,71,71,76,76,76,76,76,71,71,71,76,71,71,71,76,71,76,76,76,76,76,71,71,71,71,71,71,71,71,71,71,71,76,71,71,71,71,76,71,76,71,76,76,76,71,71,76,71,76,71,76,76,71,71,71,76,76,71,71,76,76,76,71,71,71,76,76,71,76,71,71,71,71,76,76,71,71,76,71,71,71,76,71,71,71,71,71,76,71,76,76,76,76,71,76,71,76,76,76,71,76,76,76,76,76,76,76,71,71,76,76,76,71,71,76,76,76,71,76,76,76,71,71,71,71,76,71,76,76,71,71,76,76,76,76,71,76,76,71,76,76,71,71,71,71,76,71,76,71,76,71,71,71,76,76,76,76,76,76,71,76,71,76,71,76,71,76,71,71,71,71,71,71,71,76,71,71,76,76,76,76,71,71,71,76,76,76,71,76,71,71,76,76,76,76,76,76,76,71,71,71,76,76,76,71,71,76,76,71,76,71,71,76,76,71,76,76,71,71,76,76,76,71,76,76,71,76,76,71,76,71,71,76,71,76,76,71,71,71,76,71,71,71,71,71,71,76,76,71,71,71,71,71,76,71,76,71,76,71,76,76,71,76,76,71,76,76,71,76,71,71,71,76,71,71,71,76,76,71,71,71,71,76,76,76,71,76,71,76,71,71,76,71,76,76,76,76,71,76,76,71,76,76,71,71,71,71,76,76,71,76,76,71,71,71,71,76,71,71,71,71,76,76,71,76,76,76,76,71,71,71,71,76,71,71,76,71,71,71,76,76,76,76,76,76,71,71,71,76,76,71,76,76,71,76,76,71,71,71,76,71,71,71,71,71,76,76,71,71,76,71,71,71,71,76,76,71,76,76,71,76,76,76,76,71,76,71,76,76,71,76,76,76,76,71,76,71,76,71,71,76,76,71,76,71,71,76,71,76,71,71,76,71,71,76,76,71,76,71,71,76,71,76,76,76,71,71,71,71,71,71,71,71,71,71,76,71,76,76,76,71,71,76,76,76,71,71,71,71,76,76,71,76,71,76,76,71,71,71,71,71,71,71,71,71,76,76,71,71,76,71,76,76,76,71,76,76,71,76,76,71,76,71,71,71,76,71,71,71,76,71,71,71,71,76,76,71,76,76,71,71,71,76,71,71,71,76,76,71,76,71,76,76,71,76,71,76,76,76,71,71,76,76,71,71,76,71,71,71,71,71,76,76,76,76,76,71,71,71,76,71,71,76,71,71,76,71,76,76,71,71,71,76,71,76,76,76,71,71,76,76,71,71,71,76,76,76,76,71,76,71,71,71,71,71,76,71,76,76,76,71,71,76,71,71,71,76,71,71,76,71,76,76,76,76,71,76,71,76,76,71,76,76,71,71,71,76,76,71,71,71,71,76,71,76,76,71,76,76,76,71,71,76,71,76,76,71,76,71,76,76,76,76,76,76,71,71,76,71,71,71,76,76,76,71,71,76,71,71,71,71,71,76,71,71,76,71,76,76,71,76,71,71,76,76,76,76,71,71,76,71,71,71,76,76,71,71,76,76,71,76,71,76,76,71,76,76,71,71,76,76,76,76,76,76,71,71,76,76,71,76,76,71,76,71,76,76,76,71,76,76,76,71,71,76,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,76,76,76,76,71,76,71,76,71,71,76,76,76,76,71,76,76,76,76,71,71,71,76,76,76,76,76,71,71,76,71,71,71,76,71,76,76,76,71,76,76,71,76,76,76,71,76,76,76,71,71,71,76,76,76,76,71,76,76,71,71,76,76,76,76,71,76,76,76,71,76,71,76,71,71,76,76,71,76,71,71,76,76,71,76,71,71,76,76,76,71,76,76,76,76,71,76,76,71,71,71,76,76,76,76,76,76,76,71,71,76,76,71,76,71,76,71,76,71,76,76,71,71,71,76,76,71,71,76,71,76,71,76,76,76,71,71,76,76,76,71,76,76,71,76,76,76,71,76,71,76,76,76,71,76,71,71,71,71,76,71,76,76,76,71,71,76,71,76,71,76,76,76,71,76,76,76,76,71,71,76,71,71,71,71,76,76,76,71,76,76,76,76,71,76,76,71,76,76,76,76,71,76,76,76,71,71,71,76,71,71,71,71,76,76,76,71,71,71,76,71,76,76,76,71,76,71,71,71,71,76,76,76,71,71,76,76,76,76,76,76,76,71,76,76,71,71,71,71,76,76,71,76,71,76,76,71,76,71,76,76,71,71,76,71,71,76,76,76,76,76,76,71,71,76,76,76,76,71,76,71,76,76,71,71,76,71,76,71,71,76,71,76,71,71,71,71,71,71,71,76,71,71,71,71,71,76,71,76,71,71,71,76,71,76,71,71,71,71,71,71,71,76,76,71,71,76,76,71,71,76,71,71,71,76,76,71,71,71,71,76,76,71,76,71,71,76,71,71,76,76,71,71,71,71,76,71,71,71,71,76,71,76,71,71,76,71,71,71,76,71,76,71,71,71,76,76,71,71,76,76,71,76,76,76,76,71,76,76,71,71,76,76,76,71,76,76,76,76,71,76,71,76,76,71,71,76,76,76,71,76,71,76,71,71,71,71,76,71,71,71,71,71,76,76,71,76,76,71,71,76,76,76,76,76,71,76,71,76,76,71,71,71,76,76,71,71,71,76,76,76,76,76,76,71,71,76,71,76,76,71,71,76,76,71,76,71,71,71,71,76,76,71,76,71,71,71,71,76,71,76,76,76,71,76,71,76,71,76,71,76,76,71,76,71,71,76,76,71,71,71,71,71,76,76,71,76,76,76,71,76,71,76,76,71,76,71,71,71,71,76,76,76,71,76,76,76,71,71,71,76,76,76,76,71,76,76,71,71,71,71,71,76,76,76,71,76,76,71,76,76,71,76,71,76,71,76,76,76,71,76,71,76,76,76,76,76,76,76,76,76,76,71,71,71,71,76,76,76,76,71,71,76,71,76,76,76,71,76,76,71,76,76,76,76,71,71,76,71,71,76,71,71,71,76,76,76,76,76,71,76,76,76,76,76,71,76,71,76,71,76,71,76,71,71,71,71,76,76,76,76,71,76,71,76,76,76,71,76,76,71,71,71,71,71,76,71,71,71,71,76,76,71,76,76,71,71,76,76,76,71,76,76,71,71,71,71,76,71,76,76,76,76,76,76,76,76,71,71,76,71,71,76,71,71,71,71,71,76,71,76,76,71,76,71,71,71,76,76,76,76,76,71,76,71,76,71,71,76,71,76,76,71,76,71,76,71,71,71,71,71,76,76,71,76,76,76,71,71,71,76,76,76,71,76,76,76,76,71,71,76,76,71,76,71,71,76,76,71,71,76,71,76,76,76,76,71,71,71,71,71,71,71,71,71,71,76,71,71,76,76,76,76,71,76,76,71,76,76,76,71,76,71,71,76,76,76,76,71,76,76,76,76,71,76,71,76,76,71,71,71,71,76,76,76,76,71,71,76,71,71,71,76,71,76,71,76,76,76,71,71,71,76,71,76,71,76,71,76,71,76,71,76,71,71,76,71,71,76,76,76,76,71,76,76,71,71,71,71,76,71,71,76,76,76,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,76,71,71,71,76,76,71,76,71,71,71,76,76,76,76,76,71,76,71,71,71,76,76,76,76,76,76,71,71,76,71,76,71,71,76,76,71,71,71,76,71,76,76,71,71,71,76,71,76,71,76,76,76,76,76,76,71,71,76,71,71,76,71,76,76,71,76,76,71,76,76,71,76,76,71,76,76,71,76,76,71,71,71,76,71,76,76,71,76,76,76,76,76,71,76,76,71,71,71,71,76,76,76,71,76,71,76,76,71,76,76,71,71,76,76,76,71,76,71,76,76,71,76,71,71,76,71,76,76,71,76,76,71,71,71,76,76,76,71,71,76,76,71,76,71,71,71,76,71,71,76,76,71,71,76,76,71,71,71,71,76,76,71,71,71,71,71,76,76,76,76,76,71,71,71,71,71,76,76,71,71,76,71,76,71,76,71,76,71,71,76,71,71,71,76,71,71,76,71,76,71,76,71,71,76,71,76,76,76,76,71,76,71,76,76,76,76,71,71,76,76,71,76,76,76,71,71,71,76,76,76,71,76,76,71,76,76,76,71,71,76,76,71,76,76,71,76,76,76,76,76,76,76,71,71,76,71,76,76,71,71,71,76,76,76,76,76,76,71,71,71,76,71,71,76,71,71,76,71,71,76,71,76,76,71,71,71,76,71,76,71,76,76,76,76,76,71,71,71,71,71,76,76,76,76,76,76,76,71,76,71,71,76,71,71,71,71,76,71,71,76,76,76,76,71,71,76,71,71,76,71,71,76,76,76,76,76,76,71,71,71,71,71,71,76,76,76,71,76,76,76,76,71,76,76,71,71,71,76,71,76,76,76,76,76,76,71,71,76,71,76,71,76,71,71,76,71,71,71,71,71,76,71,76,76,71,71,76,71,76,76,76,76,76,76,76,76,71,71,71,71,76,76,71,71,71,71,71,76,71,76,76,76,71,76,76,76,76,76,71,71,76,76,71,71,76,71,76,71,71,71,76,76,76,76,71,71,71,76,76,71,76,71,76,71,76,71,71,71,76,71,71,76,71,71,71,76,71,76,71,76,76,71,76,76,71,76,71,76,71,76,71,71,71,76,76,71,71,76,76,71,71,71,76,76,71,71,76,71,76,76,71,76,71,76,71,71,76,71,71,76,76,71,76,76,71,76,71,71,76,71,76,76,71,71,76,76,71,76,76,71,76,76,76,71,76,76,76,71,71,76,71,71,76,71,76,76,71,71,71,76,76,71,76,71,76,71,76,71,76,71,76,76,76,71,76,76,71,71,71,71,71,71,71,76,71,71,71,71,71,71,76,76,71,76,71,71,76,76,76,76,71,71,71,71,76,76,71,76,76,71,71,71,71,71,76,71,76,76,71,76,76,76,71,76,76,76,76,76,71,71,76,76,76,76,76,71,76,71,76,76,76,76,76,71,76,76,71,71,76,76,71,71,71,71,76,76,76,76,76,71,76,76,71,76,71,71,71,71,76,71,71,71,76,76,71,71,76,71,71,76,76,76,71,71,71,71,71,76,76,76,76,71,71,71,71,71,71,76,71,71,71,71,71,71,76,76,76,71,76,76,71,76,71,76,71,76,71,76,71,71,71,71,76,71,71,71,76,71,71,76,76,71,76,76,71,76,76,71,76,76,76,76,71,71,71,71,76,76,76,71,76,71,71,71,71,76,76,71,71,76,76,76,76,71,76,71,76,71,71,76,71,71,76,76,71,76,71,71,71,71,71,71,76,76,71,71,71,71,76,71,71,71,71,71,76,71,76,71,76,76,71,76,76,71,76,76,71,76,76,71,71,71,71,71,76,71,71,76,76,71,71,76,76,71,76,76,71,71,76,76,71,76,71,76,76,76,76,71,76,71,76,76,71,71,71,76,76,71,76,76,76,76,76,71,71,76,71,71,71,71,71,71,76,71,71,71,71,76,71,71,76,71,76,76,71,76,71,71,76,71,71,71,71,76,71,76,71,71,71,71,71,71,71,71,76,76,71,76,71,76,71,71,76,76,76,71,71,76,71,76,76,76,71,71,71,71,71,71,71,76,71,71,71,71,71,71,71,76,71,71,76,76,71,71,76,71,76,76,71,76,76,71,76,76,76,71,71,76,71,76,76,71,71,76,76,76,76,76,76,71,71,76,71,76,71,76,71,76,71,76,76,71,71,76,76,71,76,71,76,71,71,76,76,76,71,76,71,71,71,71,76,71,76,71,71,71,71,76,71,71,71,76,76,71,76,71,76,76,76,76,76,71,76,71,71,71,71,71,71,71,71,71,76,71,76,76,76,76,71,71,71,71,71,76,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0,2,1,0,0,1,0,0,1,0,0,1,0,0,0,0,4,3,2,1,0,0,0,1,0,4,3,2,1,0,0,2,1,0,0,0,0,1,0,1,0,2,1,0,2,1,0,0,1,0,6,5,4,3,2,1,0,0,4,3,2,1,0,5,4,3,2,1,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,5,4,3,2,1,0,2,1,0,0,2,1,0,0,1,0,0,2,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,3,2,1,0,0,1,0,0,0,0,0,2,1,0,6,5,4,3,2,1,0,4,3,2,1,0,2,1,0,1,0,0,1,0,2,1,0,4,3,2,1,0,1,0,8,7,6,5,4,3,2,1,0,0,1,0,1,0,2,1,0,0,0,2,1,0,1,0,0,0,7,6,5,4,3,2,1,0,7,6,5,4,3,2,1,0,2,1,0,0,2,1,0,1,0,0,1,0,0,1,0,0,0,2,1,0,1,0,0,2,1,0,0,0,0,0,0,2,1,0,1,0,1,0,1,0,1,0,0,2,1,0,0,1,0,1,0,2,1,0,0,0,1,0,4,3,2,1,0,1,0,4,3,2,1,0,3,2,1,0,0,1,0,1,0,0,0,0,0,1,0,9,8,7,6,5,4,3,2,1,0,1,0,0,0,0,5,4,3,2,1,0,0,0,3,2,1,0,0,0,0,0,0,1,0,0,0,0,1,0,3,2,1,0,0,0,0,4,3,2,1,0,3,2,1,0,0,0,1,0,0,3,2,1,0,0,5,4,3,2,1,0,0,2,1,0,3,2,1,0,0,1,0,3,2,1,0,0,1,0,1,0,0,0 }, + }, + + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, dailyTemperatures(tc.temperatures), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + dailyTemperatures(tc.temperatures) + } + } +} diff --git a/Algorithms/0740.delete-and-earn/README.md b/Algorithms/0740.delete-and-earn/README.md new file mode 100755 index 000000000..ab237341e --- /dev/null +++ b/Algorithms/0740.delete-and-earn/README.md @@ -0,0 +1,39 @@ +# [740. Delete and Earn](https://leetcode.com/problems/delete-and-earn/) + +## 题目 + +Given an array nums of integers, you can perform operations on the array. + +In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equal to nums[i] - 1 or nums[i] + 1. + +You start with 0 points. Return the maximum number of points you can earn by applying such operations. + +Example 1: + +```text +Input: nums = [3, 4, 2] +Output: 6 +Explanation: +Delete 4 to earn 4 points, consequently 3 is also deleted. +Then, delete 2 to earn 2 points. 6 total points are earned. +``` + +Example 2: + +```text +Input: nums = [2, 2, 3, 3, 3, 4] +Output: 9 +Explanation: +Delete 3 to earn 3 points, deleting both 2's and the 4. +Then, delete 3 again to earn 3 points, and 3 again to earn 3 points. +9 total points are earned. +``` + +Note: + +1. The length of nums is at most 20000. +1. Each element nums[i] is an integer in the range [1, 10000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0740.delete-and-earn/delete-and-earn.go b/Algorithms/0740.delete-and-earn/delete-and-earn.go new file mode 100755 index 000000000..98a377fc5 --- /dev/null +++ b/Algorithms/0740.delete-and-earn/delete-and-earn.go @@ -0,0 +1,34 @@ +package problem0740 + +func deleteAndEarn(nums []int) int { + if len(nums) == 0 { + return 0 + } + if len(nums) == 1 { + return nums[0] + } + + size := int(1e4 + 1) + // dp[n] 表示,删除 nums 中所有 <=n 的数后,能获取的最大分数 + dp := make([]int, size) + for _, n := range nums { + dp[n] += n + } + + for i := 2; i < size; i++ { + // 删除了 i-1,所以 i 是被消除掉的,不能累加 point + // ↓ + dp[i] = max(dp[i-1], dp[i]+dp[i-2]) + // ↑ + // i-1 是被消除掉的,所以,此时是 dp[i]+dp[i-2] + } + + return dp[size-1] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0740.delete-and-earn/delete-and-earn_test.go b/Algorithms/0740.delete-and-earn/delete-and-earn_test.go new file mode 100755 index 000000000..ee6b77b64 --- /dev/null +++ b/Algorithms/0740.delete-and-earn/delete-and-earn_test.go @@ -0,0 +1,59 @@ +package problem0740 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{8, 3, 4, 7, 6, 6, 9, 2, 5, 8, 2, 4, 9, 5, 9, 1, 5, 7, 1, 4}, + 61, + }, + + { + []int{}, + 0, + }, + + { + []int{3}, + 3, + }, + + { + []int{3, 4, 2}, + 6, + }, + + { + []int{2, 2, 3, 3, 3, 4}, + 9, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, deleteAndEarn(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + deleteAndEarn(tc.nums) + } + } +} diff --git a/Algorithms/0741.cherry-pickup/README.md b/Algorithms/0741.cherry-pickup/README.md new file mode 100755 index 000000000..9016ef003 --- /dev/null +++ b/Algorithms/0741.cherry-pickup/README.md @@ -0,0 +1,41 @@ +# [741. Cherry Pickup](https://leetcode.com/problems/cherry-pickup/) + +## 题目 + +In a N x N grid representing a field of cherries, each cell is one of three possible integers. + +- 0 means the cell is empty, so you can pass through; +- 1 means the cell contains a cherry, that you can pick up and pass through; +- -1 means the cell contains a thorn that blocks your way. + +Your task is to collect maximum number of cherries possible by following the rules below: + +- Starting at the position (0, 0) and reaching (N-1, N-1) by moving right or down through valid path cells (cells with value 0 or 1); +- After reaching (N-1, N-1), returning to (0, 0) by moving left or up through valid path cells; +- When passing through a path cell containing a cherry, you pick it up and the cell becomes an empty cell (0); +- If there is no valid path between (0, 0) and (N-1, N-1), then no cherries can be collected. + +Example 1: + +```text +Input: grid = +[[0, 1, -1], + [1, 0, -1], + [1, 1, 1]] +Output: 5 +Explanation: +The player started at (0, 0) and went down, down, right right to reach (2, 2). +4 cherries were picked up during this single trip, and the matrix becomes [[0,1,-1],[0,0,-1],[0,0,0]]. +Then, the player went left, up, up, left to return home, picking up one more cherry. +The total number of cherries picked up is 5, and this is the maximum possible. +``` + +Note: + +- grid is an N by N 2D array, with 1 <= N <= 50. +- Each grid[i][j] is an integer in the set {-1, 0, 1}. +- It is guaranteed that grid[0][0] and grid[N-1][N-1] are not -1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0741.cherry-pickup/cherry-pickup.go b/Algorithms/0741.cherry-pickup/cherry-pickup.go new file mode 100755 index 000000000..672ccaef2 --- /dev/null +++ b/Algorithms/0741.cherry-pickup/cherry-pickup.go @@ -0,0 +1,61 @@ +package problem0741 + +// 本题等效于两个人同时从 (0,0) 出发到 (n-1,n-1) 的过程 +func cherryPickup(grid [][]int) int { + n := len(grid) + // dp[x1][x2] means two length p path , currently one arrived at […, x1] , the other is at […, x2], the max value we can get + dp := make([][]int, n) + for i := range dp { + dp[i] = make([]int, n) + for j := range dp[i] { + dp[i][j] = -1 + } + } + dp[0][0] = grid[0][0] + + pathLen := n + n - 1 + for pl := 2; pl <= pathLen; pl++ { + for x1 := n - 1; x1 >= 0; x1-- { + for x2 := x1; x2 >= 0; x2-- { + y1 := pl - 1 - x1 + y2 := pl - 1 - x2 + if y1 < 0 || y2 < 0 || y1 >= n || y2 >= n { + continue + } + if grid[y1][x1] < 0 || grid[y2][x2] < 0 { + dp[x1][x2] = -1 + continue + } + + best := -1 + delta := grid[y1][x1] + + if x1 != x2 { + delta += grid[y2][x2] + } + if x1 > 0 && x2 > 0 && dp[x1-1][x2-1] >= 0 { + best = max(best, dp[x1-1][x2-1]+delta) + } + if x1 > 0 && y2 > 0 && dp[x1-1][x2] >= 0 { + best = max(best, dp[x1-1][x2]+delta) + } + if y1 > 0 && x2 > 0 && dp[x1][x2-1] >= 0 { + best = max(best, dp[x1][x2-1]+delta) + } + if y1 > 0 && y2 > 0 && dp[x1][x2] >= 0 { + best = max(best, dp[x1][x2]+delta) + } + dp[x1][x2] = best + } + } + } + + return max(dp[n-1][n-1], 0) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0741.cherry-pickup/cherry-pickup_test.go b/Algorithms/0741.cherry-pickup/cherry-pickup_test.go new file mode 100755 index 000000000..5d184eb61 --- /dev/null +++ b/Algorithms/0741.cherry-pickup/cherry-pickup_test.go @@ -0,0 +1,52 @@ +package problem0741 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{ + {1, 1, -1}, + {1, -1, 1}, + {-1, 1, 1}, + }, + 0, + }, + + { + [][]int{ + {0, 1, -1}, + {1, 0, -1}, + {1, 1, 1}, + }, + 5, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, cherryPickup(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + cherryPickup(tc.grid) + } + } +} diff --git a/Algorithms/0743.network-delay-time/README.md b/Algorithms/0743.network-delay-time/README.md new file mode 100755 index 000000000..2f1eab60e --- /dev/null +++ b/Algorithms/0743.network-delay-time/README.md @@ -0,0 +1,20 @@ +# [743. Network Delay Time](https://leetcode.com/problems/network-delay-time/) + +## 题目 + +There are N network nodes, labelled 1 to N. + +Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and w is the time it takes for a signal to travel from source to target. + +Now, we send a signal from a certain node K. How long will it take for all nodes to receive the signal? If it is impossible, return -1. + +Note: + +1. N will be in the range [1, 100]. +1. K will be in the range [1, N]. +1. The length of times will be in the range [1, 6000]. +1. All edges times[i] = (u, v, w) will have 1 <= u, v <= N and 1 <= w <= 100. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0743.network-delay-time/network-delay-time.go b/Algorithms/0743.network-delay-time/network-delay-time.go new file mode 100755 index 000000000..7cd0533b9 --- /dev/null +++ b/Algorithms/0743.network-delay-time/network-delay-time.go @@ -0,0 +1,57 @@ +package problem0743 + +func networkDelayTime(times [][]int, N int, K int) int { + maxInt := int(1e4) + + // minTime[i] == m 表示, i 节点接收到信号所需的最小时间为 m + minTime := make([]int, N+1) + for i := 1; i <= N; i++ { + minTime[i] = maxInt + } + // 信号从 K 节点出发,所以 minTime[K] = 0 + minTime[K] = 0 + + // cost[i][j] = m 表示,从 i 节点到 j 节点所需的时间 + cost := make([][]int, N+1) + for i := range cost { + cost[i] = make([]int, N+1) + for j := 0; j <= N; j++ { + cost[i][j] = maxInt + } + } + for _, t := range times { + cost[t[0]][t[1]] = t[2] + } + + queue := make([]int, 1, N+1) + queue[0] = K + for len(queue) > 0 { + u := queue[0] + queue = queue[1:] + + for v := 1; v <= N; v++ { + if minTime[v] > minTime[u]+cost[u][v] { + minTime[v] = minTime[u] + cost[u][v] + queue = append(queue, v) + } + } + } + + res := 0 + for i := 1; i <= N; i++ { + res = max(res, minTime[i]) + } + + if res == maxInt { + // 存在无法到达的节点 + return -1 + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0743.network-delay-time/network-delay-time_test.go b/Algorithms/0743.network-delay-time/network-delay-time_test.go new file mode 100755 index 000000000..36c8c745d --- /dev/null +++ b/Algorithms/0743.network-delay-time/network-delay-time_test.go @@ -0,0 +1,77 @@ +package problem0743 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + times [][]int + N int + K int + ans int +}{ + + { + [][]int{ + {3, 5, 78}, + {2, 1, 1}, + {1, 3, 0}, + {4, 3, 59}, + {5, 3, 85}, + {5, 2, 22}, + {2, 4, 23}, + {1, 4, 43}, + {4, 5, 75}, + {5, 1, 15}, + {1, 5, 91}, + {4, 1, 16}, + {3, 2, 98}, + {3, 4, 22}, + {5, 4, 31}, + {1, 2, 0}, + {2, 5, 4}, + {4, 2, 51}, + {3, 1, 36}, + {2, 3, 59}}, + 5, + 5, + 31, + }, + + { + [][]int{{2, 1, 1}, {2, 3, 1}, {3, 4, 1}}, + 4, + 2, + 2, + }, + + { + [][]int{{2, 1, 1}, {2, 3, 1}}, + 4, + 2, + -1, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, networkDelayTime(tc.times, tc.N, tc.K), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + networkDelayTime(tc.times, tc.N, tc.K) + } + } +} diff --git a/Algorithms/0744.find-smallest-letter-greater-than-target/README.md b/Algorithms/0744.find-smallest-letter-greater-than-target/README.md new file mode 100755 index 000000000..2425f3e11 --- /dev/null +++ b/Algorithms/0744.find-smallest-letter-greater-than-target/README.md @@ -0,0 +1,51 @@ +# [744. Find Smallest Letter Greater Than Target](https://leetcode.com/problems/find-smallest-letter-greater-than-target/) + +## 题目 + +Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list that is larger than the given target. + +Letters also wrap around. For example, if the target is target = 'z' and letters = ['a', 'b'], the answer is 'a'. + +Examples: + +```text +Input: +letters = ["c", "f", "j"] +target = "a" +Output: "c" + +Input: +letters = ["c", "f", "j"] +target = "c" +Output: "f" + +Input: +letters = ["c", "f", "j"] +target = "d" +Output: "f" + +Input: +letters = ["c", "f", "j"] +target = "g" +Output: "j" + +Input: +letters = ["c", "f", "j"] +target = "j" +Output: "c" + +Input: +letters = ["c", "f", "j"] +target = "k" +Output: "c" +``` + +Note: + +1. letters has a length in range [2, 10000]. +1. letters consists of lowercase letters, and contains at least 2 unique letters. +1. target is a lowercase letter. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target.go b/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target.go new file mode 100755 index 000000000..fd0cf01ff --- /dev/null +++ b/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target.go @@ -0,0 +1,13 @@ +package problem0744 + +import ( + "sort" +) + +func nextGreatestLetter(letters []byte, target byte) byte { + n := len(letters) + i := sort.Search(n, func(i int) bool { + return target < letters[i] + }) + return letters[i%n] +} diff --git a/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target_test.go b/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target_test.go new file mode 100755 index 000000000..9feb24533 --- /dev/null +++ b/Algorithms/0744.find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target_test.go @@ -0,0 +1,71 @@ +package problem0744 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + letters []byte + target byte + ans byte +}{ + + { + []byte{'c', 'f', 'j'}, + 'a', + 'c', + }, + + { + []byte{'c', 'f', 'j'}, + 'c', + 'f', + }, + + { + []byte{'c', 'f', 'j'}, + 'd', + 'f', + }, + + { + []byte{'c', 'f', 'j'}, + 'g', + 'j', + }, + + { + []byte{'c', 'f', 'j'}, + 'j', + 'c', + }, + + { + []byte{'c', 'f', 'j'}, + 'k', + 'c', + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nextGreatestLetter(tc.letters, tc.target), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nextGreatestLetter(tc.letters, tc.target) + } + } +} diff --git a/Algorithms/0745.prefix-and-suffix-search/README.md b/Algorithms/0745.prefix-and-suffix-search/README.md new file mode 100755 index 000000000..13cd651c4 --- /dev/null +++ b/Algorithms/0745.prefix-and-suffix-search/README.md @@ -0,0 +1,28 @@ +# [745. Prefix and Suffix Search](https://leetcode.com/problems/prefix-and-suffix-search/) + +## 题目 + +Given many words, words[i] has weight i. + +Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will return the word with given prefix and suffix with maximum weight. If no word exists, return -1. + +Examples: + +```text +Input: +WordFilter(["apple"]) +WordFilter.f("a", "e") // returns 0 +WordFilter.f("b", "") // returns -1 +``` + +Note: + +1. words has length in range [1, 15000]. +1. For each test case, up to words.length queries WordFilter.f may be made. +1. words[i] has length in range [1, 10]. +1. prefix, suffix have lengths in range [0, 10]. +1. words[i] and prefix, suffix queries consist of lowercase letters only. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search.go b/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search.go new file mode 100755 index 000000000..c58977579 --- /dev/null +++ b/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search.go @@ -0,0 +1,35 @@ +package problem0745 + +// WordFilter 是字符过滤器 +type WordFilter struct { + ords map[string]int +} + +// Constructor 返回 WordFilter +func Constructor(words []string) WordFilter { + o := make(map[string]int, len(words)*5) + for k := 0; k < len(words); k++ { + for i := 0; i <= 10 && i <= len(words[k]); i++ { + for j := len(words[k]); 0 <= j && len(words[k])-10 <= j; j-- { + pps := words[k][:i] + "#" + words[k][j:] + o[pps] = k + } + } + } + return WordFilter{ords: o} +} + +// F 用于查找同时拥有前缀和后缀的单词的索引号,同时存在多个符合条件的单词的话,返回其中的最大值 +func (w *WordFilter) F(prefix, suffix string) int { + pps := prefix + "#" + suffix + if index, ok := w.ords[pps]; ok { + return index + } + return -1 +} + +/** + * Your WordFilter object will be instantiated and called as such: + * obj := Constructor(words); + * param_1 := obj.F(prefix,suffix); + */ diff --git a/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search_test.go b/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search_test.go new file mode 100755 index 000000000..1e8e76e39 --- /dev/null +++ b/Algorithms/0745.prefix-and-suffix-search/prefix-and-suffix-search_test.go @@ -0,0 +1,37 @@ +package problem0745 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_wordFilter(t *testing.T) { + ast := assert.New(t) + + words := []string{"apple", "banana", "abbbe"} + w := Constructor(words) + + ast.Equal(0, w.F("ap", "e")) + + ast.Equal(1, w.F("ba", "")) + + ast.Equal(2, w.F("a", "e")) + + ast.Equal(2, w.F("", "")) +} +func Test_wordFilter_2(t *testing.T) { + ast := assert.New(t) + + words := []string{"pop"} + w := Constructor(words) + + pss := [][]string{ + {"", ""}, {"", "p"}, {"", "op"}, {"", "pop"}, {"p", ""}, {"p", "p"}, {"p", "op"}, {"p", "pop"}, {"po", ""}, {"po", "p"}, {"po", "op"}, {"po", "pop"}, {"pop", ""}, {"pop", "p"}, {"pop", "op"}, {"pop", "pop"}, {"", ""}, {"", "p"}, {"", "gp"}, {"", "pgp"}, {"p", ""}, {"p", "p"}, {"p", "gp"}, {"p", "pgp"}, {"pg", ""}, {"pg", "p"}, {"pg", "gp"}, {"pg", "pgp"}, {"pgp", ""}, {"pgp", "p"}, {"pgp", "gp"}, {"pgp", "pgp"}} + + ans := []int{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} + + for i := 0; i < len(pss); i++ { + ast.Equal(ans[i], w.F(pss[i][0], pss[i][1]), "输入 %v, %d", pss[i], ans[i]) + } +} diff --git a/Algorithms/0746.min-cost-climbing-stairs/README.md b/Algorithms/0746.min-cost-climbing-stairs/README.md new file mode 100755 index 000000000..c133d4b24 --- /dev/null +++ b/Algorithms/0746.min-cost-climbing-stairs/README.md @@ -0,0 +1,32 @@ +# [746. Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/) + +## 题目 + +On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). + +Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1. + +Example 1: + +```text +Input: cost = [10, 15, 20] +Output: 15 +Explanation: Cheapest is start on cost[1], pay that cost and go to the top. +``` + +Example 2: + +```text +Input: cost = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1] +Output: 6 +Explanation: Cheapest is start on cost[0], and only step on 1s, skipping cost[3]. +``` + +Note: + +1. cost will have a length in the range [2, 1000]. +1. Every cost[i] will be an integer in the range [0, 999]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs.go b/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs.go new file mode 100755 index 000000000..28c4fda8f --- /dev/null +++ b/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs.go @@ -0,0 +1,20 @@ +package problem0746 + +func minCostClimbingStairs(cost []int) int { + n := len(cost) + // dp[i] 表示,爬到 i-th 台阶需要的花费 + dp := make([]int, n+1) + + for i := 2; i <= n; i++ { + dp[i] = min(dp[i-1]+cost[i-1], dp[i-2]+cost[i-2]) + } + + return dp[n] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs_test.go b/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs_test.go new file mode 100755 index 000000000..4974129ad --- /dev/null +++ b/Algorithms/0746.min-cost-climbing-stairs/min-cost-climbing-stairs_test.go @@ -0,0 +1,44 @@ +package problem0746 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + cost []int + ans int +}{ + + { + []int{10, 15, 20}, + 15, + }, + + { + []int{1, 100, 1, 1, 1, 100, 1, 1, 100, 1}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minCostClimbingStairs(tc.cost), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minCostClimbingStairs(tc.cost) + } + } +} diff --git a/Algorithms/0747.largest-number-at-least-twice-of-others/README.md b/Algorithms/0747.largest-number-at-least-twice-of-others/README.md new file mode 100755 index 000000000..f93b1a80c --- /dev/null +++ b/Algorithms/0747.largest-number-at-least-twice-of-others/README.md @@ -0,0 +1,35 @@ +# [747. Largest Number At Least Twice of Others](https://leetcode.com/problems/largest-number-at-least-twice-of-others/) + +## 题目 + +In a given integer array nums, there is always exactly one largest element. + +Find whether the largest element in the array is at least twice as much as every other number in the array. + +If it is, return the index of the largest element, otherwise return -1. + +Example 1: + +```text +Input: nums = [3, 6, 1, 0] +Output: 1 +Explanation: 6 is the largest integer, and for every other number in the array x, +6 is more than twice as big as x. The index of value 6 is 1, so we return 1. +``` + +Example 2: + +```text +Input: nums = [1, 2, 3, 4] +Output: -1 +Explanation: 4 isn't at least as big as twice the value of 3, so we return -1. +``` + +Note: + +1. nums will have a length in the range [1, 50]. +1. Every nums[i] will be an integer in the range [0, 99]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others.go b/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others.go new file mode 100755 index 000000000..2b1ea6ae9 --- /dev/null +++ b/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others.go @@ -0,0 +1,29 @@ +package problem0747 + +func dominantIndex(a []int) int { + n := len(a) + if n == 1 { + return 0 + } + + // i1 是 a 中第 1 大的数的索引号 + // i2 是 a 中第 2 大的数的索引号 + i1, i2 := 0, 1 + if a[i1] < a[i2] { + i1, i2 = i2, i1 + } + + // 寻找真正的 i1 和 i2 + for i := 2; i < n; i++ { + if a[i1] < a[i] { + i2, i1 = i1, i + } else if a[i2] < a[i] { + i2 = i + } + } + + if a[i2] == 0 || a[i1]/a[i2] >= 2 { + return i1 + } + return -1 +} diff --git a/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others_test.go b/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others_test.go new file mode 100755 index 000000000..50d27bc5a --- /dev/null +++ b/Algorithms/0747.largest-number-at-least-twice-of-others/largest-number-at-least-twice-of-others_test.go @@ -0,0 +1,59 @@ +package problem0747 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{1}, + 0, + }, + + { + []int{0, 3, 1, 1}, + 1, + }, + + { + []int{0, 0, 0, 1}, + 3, + }, + + { + []int{3, 6, 1, 0}, + 1, + }, + + { + []int{1, 2, 3, 4}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, dominantIndex(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + dominantIndex(tc.nums) + } + } +} diff --git a/Algorithms/0748.shortest-completing-word/README.md b/Algorithms/0748.shortest-completing-word/README.md new file mode 100755 index 000000000..f661dfd8a --- /dev/null +++ b/Algorithms/0748.shortest-completing-word/README.md @@ -0,0 +1,41 @@ +# [748. Shortest Completing Word](https://leetcode.com/problems/shortest-completing-word/) + +## 题目 + +Find the minimum length word from a given dictionary words, which has all the letters from the string licensePlate. Such a word is said to complete the given string licensePlate + +Here, for letters we ignore case. For example, "P" on the licensePlate still matches "p" on the word. + +It is guaranteed an answer exists. If there are multiple answers, return the one that occurs first in the array. + +The license plate might have the same letter occurring multiple times. For example, given a licensePlate of "PP", the word "pair" does not complete the licensePlate, but the word "supper" does. + +Example 1: + +```text +Input: licensePlate = "1s3 PSt", words = ["step", "steps", "stripe", "stepple"] +Output: "steps" +Explanation: The smallest length word that contains the letters "S", "P", "S", and "T". +Note that the answer is not "step", because the letter "s" must occur in the word twice. +Also note that we ignored case for the purposes of comparing whether a letter exists in the word. +``` + +Example 2: + +```text +Input: licensePlate = "1s3 456", words = ["looks", "pest", "stew", "show"] +Output: "pest" +Explanation: There are 3 smallest length words that contains the letters "s". +We return the one that occurred first. +``` + +Note: + +1. licensePlate will be a string with length in range [1, 7]. +1. licensePlate will contain digits, spaces, or letters (uppercase or lowercase). +1. words will have a length in the range [10, 1000]. +1. Every words[i] will consist of lowercase letters, and have length in range [1, 15]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0748.shortest-completing-word/shortest-completing-word.go b/Algorithms/0748.shortest-completing-word/shortest-completing-word.go new file mode 100755 index 000000000..74d5c7b7a --- /dev/null +++ b/Algorithms/0748.shortest-completing-word/shortest-completing-word.go @@ -0,0 +1,46 @@ +package problem0748 + +import ( + "strings" +) + +func shortestCompletingWord(licensePlate string, words []string) string { + keys := getKeys(licensePlate) + minLen := 1<<63 - 1 + res := "" + + for _, w := range words { + if len(w) >= minLen { + continue + } + + isCompleting := true + for k, c := range keys { + if strings.Count(w, k) < c { + isCompleting = false + break + } + } + + if isCompleting { + res = w + minLen = len(w) + } + } + + return res +} + +func getKeys(licensePlate string) map[string]int { + licensePlate = strings.ToLower(licensePlate) + bs := []byte(licensePlate) + + res := make(map[string]int, len(licensePlate)) + for _, b := range bs { + if 'a' <= b && b <= 'z' { + res[string(b)]++ + } + } + + return res +} diff --git a/Algorithms/0748.shortest-completing-word/shortest-completing-word_test.go b/Algorithms/0748.shortest-completing-word/shortest-completing-word_test.go new file mode 100755 index 000000000..aa7ed3e1f --- /dev/null +++ b/Algorithms/0748.shortest-completing-word/shortest-completing-word_test.go @@ -0,0 +1,47 @@ +package problem0748 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + licensePlate string + words []string + ans string +}{ + + { + "1s3 PSt", + []string{"step", "steps", "stripe", "stepple"}, + "steps", + }, + + { + "1s3 456", + []string{"looks", "pest", "stew", "show"}, + "pest", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestCompletingWord(tc.licensePlate, tc.words), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestCompletingWord(tc.licensePlate, tc.words) + } + } +} diff --git a/Algorithms/0749.contain-virus/README.md b/Algorithms/0749.contain-virus/README.md new file mode 100755 index 000000000..c7fcac87a --- /dev/null +++ b/Algorithms/0749.contain-virus/README.md @@ -0,0 +1,65 @@ +# [749. Contain Virus](https://leetcode.com/problems/contain-virus/) + +## 题目 + +A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. + +The world is modeled as a 2-D array of cells, where 0 represents uninfected cells, and 1 represents cells contaminated with the virus. A wall (and only one wall) can be installed between any two 4-directionally adjacent cells, on the shared boundary. + +Every night, the virus spreads to all neighboring cells in all four directions unless blocked by a wall. Resources are limited. Each day, you can install walls around only one region -- the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night. There will never be a tie. + +Can you save the day? If so, what is the number of walls required? If not, and the world becomes fully infected, return the number of walls used. + +Example 1: + +```text +Input: grid = +[[0,1,0,0,0,0,0,1], + [0,1,0,0,0,0,0,1], + [0,0,0,0,0,0,0,1], + [0,0,0,0,0,0,0,0]] +Output: 10 +Explanation: +There are 2 contaminated regions. +On the first day, add 5 walls to quarantine the viral region on the left. The board after the virus spreads is: + +[[0,1,0,0,0,0,1,1], + [0,1,0,0,0,0,1,1], + [0,0,0,0,0,0,1,1], + [0,0,0,0,0,0,0,1]] + +On the second day, add 5 walls to quarantine the viral region on the right. The virus is fully contained. +``` + +Example 2: + +```text +Input: grid = +[[1,1,1], + [1,0,1], + [1,1,1]] +Output: 4 +Explanation: Even though there is only one cell saved, there are 4 walls built. +Notice that walls are only built on the shared boundary of two different cells. +``` + +Example 3: + +```text +Input: grid = +[[1,1,1,0,0,0,0,0,0], + [1,0,1,0,1,1,1,1,1], + [1,1,1,0,0,0,0,0,0]] +Output: 13 +Explanation: The region on the left only builds two new walls. +``` + +Note: + +1. The number of rows and columns of grid will each be in the range [1, 50]. +1. Each grid[i][j] will be either 0 or 1. +1. Throughout the described process, there is always a contiguous viral region that will infect strictly more uncontaminated squares in the next round. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0749.contain-virus/contain-virus.go b/Algorithms/0749.contain-virus/contain-virus.go new file mode 100755 index 000000000..026ee4d75 --- /dev/null +++ b/Algorithms/0749.contain-virus/contain-virus.go @@ -0,0 +1,146 @@ +package problem0749 + +// 贪心算法 +// 每次把会导致最多感染的区域围起来 + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +func containVirus(grid [][]int) int { + m, n := len(grid), len(grid[0]) + + bfs := func(i, j, regionID int, isChecked []bool) { + queue := make([][2]int, 1, m*n) + queue[0] = [2]int{i, j} + isChecked[i*n+j] = true + + for len(queue) > 0 { + i, j = queue[0][0], queue[0][1] + queue = queue[1:] + grid[i][j] = regionID + + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + !isChecked[x*n+y] && + grid[x][y] > 0 { + queue = append(queue, [2]int{x, y}) + isChecked[x*n+y] = true + } + } + } + } + + // 统计区域数量,并对其进行编号 + checkRegion := func() int { + regionID := 1 + isChecked := make([]bool, m*n) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] > 0 && !isChecked[i*n+j] { + bfs(i, j, regionID, isChecked) + regionID++ + } + } + } + return regionID + } + + // 返回,如果不修墙的话,下次会导致最多感染的区域 ID + // 如果没有新感染的话,返回 -1 + maxRegion := func(size int) int { + // 统计各个区域会导致感染的最大数量 + // 统计的时候, + // 0 如果可以被同一个区域的多个细胞感染的话,只能算作这个区域的一次感染 + // 0 如果可以被多个区域感染的话,每个区域分别多一个 + count := make([]int, size) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] == 0 { + isCounted := make(map[int]bool, 4) + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] > 0 && + !isCounted[grid[x][y]] { + count[grid[x][y]]++ + isCounted[grid[x][y]] = true + } + } + } + } + } + // 寻找会导致最多感染的区域 + max := 0 + id := -1 + for i := 1; i < size; i++ { + if max < count[i] { + max = count[i] + id = i + } + } + + return id + } + + // 给指定区域安装围墙 + // 同时把区域内的所有值,标记为 -1,就能不在统计此区域 + installWalls := func(regionID int) int { + res := 0 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] == regionID { + grid[i][j] = -1 + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] == 0 { + res++ + } + } + } + } + } + return res + } + + // 夜间的病毒传播 + nightInfect := func() { + isNewInfected := make([]bool, m*n) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] > 0 && !isNewInfected[i*n+j] { + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] == 0 { + grid[x][y] = 1 + isNewInfected[x*n+y] = true + } + } + } + } + } + } + + res := 0 + for { + size := checkRegion() + id := maxRegion(size) + if id == -1 { + break + } + res += installWalls(id) + nightInfect() + } + + return res +} diff --git a/Algorithms/0749.contain-virus/contain-virus_test.go b/Algorithms/0749.contain-virus/contain-virus_test.go new file mode 100755 index 000000000..0fb202cb5 --- /dev/null +++ b/Algorithms/0749.contain-virus/contain-virus_test.go @@ -0,0 +1,75 @@ +package problem0749 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{ + {0, 1, 0, 1, 1, 1, 1, 1, 1, 0}, + {0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 1, 1, 0, 0, 0, 1, 0}, + {0, 0, 0, 1, 1, 0, 0, 1, 1, 0}, + {0, 1, 0, 0, 1, 0, 1, 1, 0, 1}, + {0, 0, 0, 1, 0, 1, 0, 1, 1, 1}, + {0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + {0, 1, 0, 1, 0, 0, 0, 1, 1, 0}, + {0, 1, 1, 0, 0, 1, 1, 0, 0, 1}, + {1, 0, 1, 1, 0, 1, 0, 1, 0, 1}, + }, + 38, + }, + + { + [][]int{ + {0, 1, 0, 0, 0, 0, 0, 1}, + {0, 1, 0, 0, 0, 0, 0, 1}, + {0, 0, 0, 0, 0, 0, 0, 1}, + {0, 0, 0, 0, 0, 0, 0, 0}}, + 10, + }, + + { + [][]int{ + {1, 1, 1}, + {1, 0, 1}, + {1, 1, 1}}, + 4, + }, + + { + [][]int{ + {1, 1, 1, 0, 0, 0, 0, 0, 0}, + {1, 0, 1, 0, 1, 1, 1, 1, 1}, + {1, 1, 1, 0, 0, 0, 0, 0, 0}}, + 13, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, containVirus(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + containVirus(tc.grid) + } + } +} diff --git a/Algorithms/0752.open-the-lock/README.md b/Algorithms/0752.open-the-lock/README.md new file mode 100755 index 000000000..45bb87ec1 --- /dev/null +++ b/Algorithms/0752.open-the-lock/README.md @@ -0,0 +1,57 @@ +# [752. Open the Lock](https://leetcode.com/problems/open-the-lock/) + +## 题目 + +You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and wrap around: for example we can turn '9' to be '0', or '0' to be '9'. Each move consists of turning one wheel one slot. + +The lock initially starts at '0000', a string representing the state of the 4 wheels. + +You are given a list of deadends dead ends, meaning if the lock displays any of these codes, the wheels of the lock will stop turning and you will be unable to open it. + +Given a target representing the value of the wheels that will unlock the lock, return the minimum total number of turns required to open the lock, or -1 if it is impossible. + +Example 1: + +```text +Input: deadends = ["0201","0101","0102","1212","2002"], target = "0202" +Output: 6 +Explanation: +A sequence of valid moves would be "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202". +Note that a sequence like "0000" -> "0001" -> "0002" -> "0102" -> "0202" would be invalid, +because the wheels of the lock become stuck after the display becomes the dead end "0102". +``` + +Example 2: + +```text +Input: deadends = ["8888"], target = "0009" +Output: 1 +Explanation: +We can turn the last wheel in reverse to move from "0000" -> "0009". +``` + +Example 3: + +```text +Input: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"], target = "8888" +Output: -1 +Explanation: +We can't reach the target without getting stuck. +``` + +Example 4: + +```text +Input: deadends = ["0000"], target = "8888" +Output: -1 +``` + +Note: + +1. The length of deadends will be in the range [1, 500]. +1. target will not be in the list deadends. +1. Every string in deadends and the string target will be a string of 4 digits from the 10,000 possibilities '0000' to '9999'. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0752.open-the-lock/open-the-lock.go b/Algorithms/0752.open-the-lock/open-the-lock.go new file mode 100755 index 000000000..733d14ed7 --- /dev/null +++ b/Algorithms/0752.open-the-lock/open-the-lock.go @@ -0,0 +1,69 @@ +package problem0752 + +func openLock(deadends []string, target string) int { + isDeadends := dealDeadends(deadends) + return bfs(convert(target), isDeadends) +} + +func bfs(target [4]int, isDeadends map[[4]int]bool) int { + queue := [][4]int{convert("0000")} + if isDeadends[queue[0]] { + return -1 + } + if target == queue[0] { + return 0 + } + isChecked := make(map[[4]int]bool, 1e4) + isChecked[queue[0]] = true + leng := 1 + count := 1 + + for len(queue) > 0 { + if count == 0 { + leng++ + count = len(queue) + } + + for i := 0; i < 4; i++ { + a := queue[0] + a[i] = (a[i] + 9) % 10 + if !isDeadends[a] && !isChecked[a] { + if a == target { + return leng + } + queue = append(queue, a) + isChecked[a] = true + } + b := queue[0] + b[i] = (b[i] + 1) % 10 + if !isDeadends[b] && !isChecked[b] { + if b == target { + return leng + } + queue = append(queue, b) + isChecked[b] = true + } + } + + queue = queue[1:] + count-- + } + + return -1 +} + +func dealDeadends(deadends []string) map[[4]int]bool { + res := make(map[[4]int]bool, len(deadends)) + for _, d := range deadends { + res[convert(d)] = true + } + return res +} + +func convert(s string) [4]int { + res := [4]int{} + for i := range res { + res[i] = int(s[i] - '0') + } + return res +} diff --git a/Algorithms/0752.open-the-lock/open-the-lock_test.go b/Algorithms/0752.open-the-lock/open-the-lock_test.go new file mode 100755 index 000000000..4d4d77135 --- /dev/null +++ b/Algorithms/0752.open-the-lock/open-the-lock_test.go @@ -0,0 +1,64 @@ +package problem0752 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + deadends []string + target string + ans int +}{ + { + []string{"0201", "0101", "0102", "1212", "2002"}, + "0202", + 6, + }, + + { + []string{"8888"}, + "0000", + 0, + }, + + { + []string{"8888"}, + "0009", + 1, + }, + + { + []string{"8887", "8889", "8878", "8898", "8788", "8988", "7888", "9888"}, + "8888", + -1, + }, + + { + []string{"0000"}, + "8888", + -1, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, openLock(tc.deadends, tc.target), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + openLock(tc.deadends, tc.target) + } + } +} diff --git a/Algorithms/0753.cracking-the-safe/README.md b/Algorithms/0753.cracking-the-safe/README.md new file mode 100755 index 000000000..6ba3dcebd --- /dev/null +++ b/Algorithms/0753.cracking-the-safe/README.md @@ -0,0 +1,37 @@ +# [753. Cracking the Safe](https://leetcode.com/problems/cracking-the-safe/) + +## 题目 + +There is a box protected by a password. The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1. + +You can keep inputting the password, the password will automatically be matched against the last n digits entered. + +For example, assuming the password is "345", I can open it when I type "012345", but I enter a total of 6 digits. + +Please return any string of minimum length that is guaranteed to open the box after the entire string is inputted. + +Example 1: + +```text +Input: n = 1, k = 2 +Output: "01" +Note: "10" will be accepted too. +``` + +Example 2: + +```text +Input: n = 2, k = 2 +Output: "00110" +Note: "01100", "10011", "11001" will be accepted too. +``` + +Note: + +1. n will be in the range [1, 4]. +1. k will be in the range [1, 10]. +1. k^n will be at most 4096. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0753.cracking-the-safe/cracking-the-safe.go b/Algorithms/0753.cracking-the-safe/cracking-the-safe.go new file mode 100755 index 000000000..aae1dd142 --- /dev/null +++ b/Algorithms/0753.cracking-the-safe/cracking-the-safe.go @@ -0,0 +1,51 @@ +package problem0753 + +import ( + "math" + "strconv" + "strings" +) + +func crackSafe(n, k int) string { + keys := makeKeys(n-1, k) + r := make(map[string][]string, len(keys)) + for i := range keys { + r[keys[i]] = makeNums(k) + } + + res := strings.Repeat("0", n-1) + + count := int(math.Pow(float64(k), float64(n))) + + for k := 0; k < count; k++ { + key := res[len(res)-(n-1):] + next := r[key][0] + r[key] = r[key][1:] + res += next + } + + return res +} + +func makeKeys(keySize, k int) []string { + nums := makeNums(k) + res := []string{""} + for s := 0; s < keySize; s++ { + temp := make([]string, 0, len(res)*k) + for i := range res { + for j := range nums { + temp = append(temp, res[i]+nums[j]) + } + } + res = temp + } + return res +} + +func makeNums(k int) []string { + res := make([]string, k) + for i := range res { + res[i] = strconv.Itoa(k - i - 1) + } + return res +} diff --git a/Algorithms/0753.cracking-the-safe/cracking-the-safe_test.go b/Algorithms/0753.cracking-the-safe/cracking-the-safe_test.go new file mode 100755 index 000000000..cc3ae98c5 --- /dev/null +++ b/Algorithms/0753.cracking-the-safe/cracking-the-safe_test.go @@ -0,0 +1,52 @@ +package problem0753 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n, k int + ans string +}{ + + { + 1, + 2, + "10", + }, + + { + 2, + 2, + "01100", + }, + + { + 4, + 5, + "0004444344424441444044334432443144304423442244214420441344124411441044034402440144004343424341434043334332433143304323432243214320431343124311431043034302430143004242414240423342324231423042234222422142204213421242114210420342024201420041414041334132413141304123412241214120411341124111411041034102410141004040334032403140304023402240214020401340124011401040034002400140003333233313330332233213320331233113310330233013300323231323032223221322032123211321032023201320031313031223121312031123111311031023101310030302230213020301230113010300230013000222212220221122102201220021212021112110210121002020112010200120001111011001010000", + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, crackSafe(tc.n, tc.k), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + crackSafe(tc.n, tc.k) + } + } +} diff --git a/Algorithms/0754.reach-a-number/README.md b/Algorithms/0754.reach-a-number/README.md new file mode 100755 index 000000000..ffa647623 --- /dev/null +++ b/Algorithms/0754.reach-a-number/README.md @@ -0,0 +1,38 @@ +# [754. Reach a Number](https://leetcode.com/problems/reach-a-number/) + +## 题目 + +You are standing at position 0 on an infinite number line. There is a goal at position target. + +On each move, you can either go left or right. During the n-th move (starting from 1), you take n steps. + +Return the minimum number of steps required to reach the destination. + +Example 1: + +```text +Input: target = 3 +Output: 2 +Explanation: +On the first move we step from 0 to 1. +On the second step we step from 1 to 3. +``` + +Example 2: + +```text +Input: target = 2 +Output: 3 +Explanation: +On the first move we step from 0 to 1. +On the second move we step from 1 to -1. +On the third move we step from -1 to 2. +``` + +Note: + +- target will be a non-zero integer in the range [-10^9, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0754.reach-a-number/reach-a-number.go b/Algorithms/0754.reach-a-number/reach-a-number.go new file mode 100755 index 000000000..93deb23c8 --- /dev/null +++ b/Algorithms/0754.reach-a-number/reach-a-number.go @@ -0,0 +1,45 @@ +package problem0754 + +import ( + "math" +) + +func reachNumber(target int) int { + if target < 0 { + target = -target + } + + n := int(math.Ceil((math.Sqrt(8*float64(target)+1) - 1) / 2)) + + sum := n * (n + 1) / 2 + + if sum == target { + return n + } + + x := sum - target + + // sum = 1 + 2 + 3 + 4 + 5 + ... + (n-1) + n + // 可知 x 0 { + V-- + if !isDroppedLeft(heights, K) && !isDroppedRight(heights, K) { + heights[K]++ + } + } + return heights +} + +// 当 water 可以放在 cent 的 left 边时,返回 true +// 否则,返回 false +func isDroppedLeft(heights []int, center int) bool { + index := center + i := center + for 0 <= i-1 && heights[i-1] <= heights[i] { + // 出现落差,说明 + // i-1 是一个可行的落脚点 + if heights[i-1] < heights[i] { + index = i - 1 + } + i-- + } + if index < center { + heights[index]++ + return true + } + return false +} + +// 当 water 可以放在 cent 的 right 边时,返回 true +// 否则,返回 false +func isDroppedRight(heights []int, center int) bool { + index := center + i := center + for i+1 < len(heights) && heights[i] >= heights[i+1] { + // 出现落差,说明 + // i+1 是一个可行的落脚点 + if heights[i] > heights[i+1] { + index = i + 1 + } + i++ + } + if center < index { + heights[index]++ + return true + } + return false +} diff --git a/Algorithms/0756.pour-water/pour-water_test.go b/Algorithms/0756.pour-water/pour-water_test.go new file mode 100755 index 000000000..c54f28327 --- /dev/null +++ b/Algorithms/0756.pour-water/pour-water_test.go @@ -0,0 +1,63 @@ +package problem0756 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + heights []int + V, K int + ans []int +}{ + + { + []int{1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1}, + 10, + 5, + []int{3, 3, 4, 4, 4, 4, 3, 3, 3, 4, 3, 2, 1}, + }, + + { + []int{2, 1, 1, 2, 1, 2, 2}, + 4, + 3, + []int{2, 2, 2, 3, 2, 2, 2}, + }, + + { + []int{1, 2, 3, 4}, + 2, + 2, + []int{2, 3, 3, 4}, + }, + + { + []int{3, 1, 3}, + 5, + 1, + []int{4, 4, 4}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, pourWater(tc.heights, tc.V, tc.K), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pourWater(tc.heights, tc.V, tc.K) + } + } +} diff --git a/Algorithms/0756.pyramid-transition-matrix/README.md b/Algorithms/0756.pyramid-transition-matrix/README.md new file mode 100755 index 000000000..5f178c040 --- /dev/null +++ b/Algorithms/0756.pyramid-transition-matrix/README.md @@ -0,0 +1,47 @@ +# [756. Pyramid Transition Matrix](https://leetcode.com/problems/pyramid-transition-matrix/) + +## 题目 + +We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like `'Z'`. + +For every block of color `C` we place not in the bottom row, we are placing it on top of a left block of color `A` and right block of color `B`. We are allowed to place the block there only if `(A, B, C)` is an allowed triple. + +We start with a bottom row of bottom, represented as a single string. We also start with a list of allowed triples allowed. Each allowed triple is represented as a string of length 3. + +Return true if we can build the pyramid all the way to the top, otherwise false. + +Example 1: + +```text +Input: bottom = "XYZ", allowed = ["XYD", "YZE", "DEA", "FFF"] +Output: true +Explanation: +We can stack the pyramid like this: + A + / \ + D E + / \ / \ +X Y Z + +This works because ('X', 'Y', 'D'), ('Y', 'Z', 'E'), and ('D', 'E', 'A') are allowed triples. +``` + +Example 1: + +```text +Input: bottom = "XXYX", allowed = ["XXX", "XXY", "XYX", "XYY", "YXZ"] +Output: false +Explanation: +We can't stack the pyramid to the top. +Note that there could be allowed triples (A, B, C) and (A, B, D) with C != D. +``` + +Note: + +1. bottom will be a string with length in range [2, 8]. +1. allowed will have length in range [0, 200]. +1. Letters in all strings will be chosen from the set {'A', 'B', 'C', 'D', 'E', 'F', 'G'}. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix.go b/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix.go new file mode 100755 index 000000000..a10e9ffa4 --- /dev/null +++ b/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix.go @@ -0,0 +1,39 @@ +package problem0756 + +import ( + "strings" +) + +func pyramidTransition(bottom string, allowed []string) bool { + blocks := "#" + strings.Join(allowed, "#") + + var dfs func(string, int, int) bool + dfs = func(bottom string, curr, length int) bool { + if curr+2 > length { + bottom = bottom[length:] + length = len(bottom) + if length == 1 { + return true + } + return dfs(bottom, 0, length) + } + + b := "#" + bottom[curr:curr+2] + beg := 0 + for beg < len(blocks) { + index := strings.Index(blocks[beg:], b) + beg + if index < beg { + break + } + beg = index + 4 + color := blocks[index+3 : index+4] + if dfs(bottom+color, curr+1, length) { + return true + } + } + + return false + } + + return dfs(bottom, 0, len(bottom)) +} diff --git a/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix_test.go b/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix_test.go new file mode 100755 index 000000000..294d6cdca --- /dev/null +++ b/Algorithms/0756.pyramid-transition-matrix/pyramid-transition-matrix_test.go @@ -0,0 +1,53 @@ +package problem0756 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + bottom string + allowed []string + ans bool +}{ + + { + "BCD", + []string{"ACC", "ACB", "ABD", "DAA", "BDC", "BDB", "DBC", "BBD", "BBC", "DBD", "BCC", "CDD", "ABA", "BAB", "DDC", "CCD", "DDA", "CCA", "DDD"}, + true, + }, + + { + "XYZ", + []string{"XYD", "YZE", "DEA", "FFF"}, + true, + }, + + { + "XXYX", + []string{"XXX", "XXY", "XYX", "XYY", "YXZ"}, + false, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, pyramidTransition(tc.bottom, tc.allowed), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pyramidTransition(tc.bottom, tc.allowed) + } + } +} diff --git a/Algorithms/0757.set-intersection-size-at-least-two/README.md b/Algorithms/0757.set-intersection-size-at-least-two/README.md new file mode 100755 index 000000000..3a702760b --- /dev/null +++ b/Algorithms/0757.set-intersection-size-at-least-two/README.md @@ -0,0 +1,37 @@ +# [757. Set Intersection Size At Least Two](https://leetcode.com/problems/set-intersection-size-at-least-two/) + +## 题目 + +An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from a to b, including a and b. + +Find the minimum size of a set S such that for every integer interval A in intervals, the intersection of S with A has size at least 2. + +Example 1: + +```text +Input: intervals = [[1, 3], [1, 4], [2, 5], [3, 5]] +Output: 3 +Explanation: +Consider the set S = {2, 3, 4}. For each interval, there are at least 2 elements from S in the interval. +Also, there isn't a smaller size set that fulfills the above condition. +Thus, we output the size of this set, which is 3. +``` + +Example 2: + +```text +Input: intervals = [[1, 2], [2, 3], [2, 4], [4, 5]] +Output: 5 +Explanation: +An example of a minimum sized set is {1, 2, 3, 4, 5}. +``` + +Note: + +1. intervals will have length in range [1, 3000]. +1. intervals[i] will have length 2, representing some integer interval. +1. intervals[i][j] will be an integer in [0, 10^8]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two.go b/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two.go new file mode 100755 index 000000000..a00df8791 --- /dev/null +++ b/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two.go @@ -0,0 +1,48 @@ +package problem0757 + +import ( + "sort" +) + +func intersectionSizeTwo(intervals [][]int) int { + // 这样排序的意义是 + // 假设 intervals[i:j] 中的 b 都是一样的 + // [b-1,b] 和 intervals[i:j] 中的每一个也肯定都有两个公共元素 + sort.Slice(intervals, func(i, j int) bool { + if intervals[i][1] == intervals[j][1] { + return intervals[i][0] > intervals[j][0] + } + return intervals[i][1] < intervals[j][1] + }) + + res := 0 + // left 和 right 取过的值,就是 set 中的值 + left := intervals[0][1] - 1 + right := intervals[0][1] + res += 2 + + n := len(intervals) + + for i := 1; i < n; i++ { + a, b := intervals[i][0], intervals[i][1] + // 当 b == intervals[i-1][1] 什么都没有发生 + // 只有出现了新 b 时,才需要讨论 + // 根据排序规则 + // left < a 意味着出现了新 b + if left < a && a <= right { + res++ + // 原先的 left 没有包含在 intervals[i] 中 + // 新 left = right + left = right + // 新 right = intervals[i][1] + right = b + } else if right < a { + // left 和 right 都没有包含在 intervals[i] 中 + res += 2 + left = b - 1 + right = b + } + } + + return res +} diff --git a/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two_test.go b/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two_test.go new file mode 100755 index 000000000..ed7ebb0bf --- /dev/null +++ b/Algorithms/0757.set-intersection-size-at-least-two/set-intersection-size-at-least-two_test.go @@ -0,0 +1,79 @@ +package problem0757 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + intervals [][]int + ans int +}{ + + { + [][]int{{1, 5}, {4, 5}, {5, 9}, {7, 9}, {9, 20}, {12, 20}, {15, 20}, {18, 20}}, + 6, + }, + + { + [][]int{{1, 5}, {4, 5}, {5, 9}, {7, 9}, {9, 10}}, + 5, + }, + + { + [][]int{{1, 3}, {4, 9}, {0, 10}, {6, 7}, {1, 2}, {0, 6}, {7, 9}, {0, 1}, {2, 5}, {6, 8}}, + 7, + }, + + { + [][]int{{4, 14}, {6, 17}, {7, 14}, {14, 21}, {4, 7}}, + 4, + }, + + { + [][]int{{2, 10}, {3, 7}, {3, 15}, {4, 11}, {6, 12}, {6, 16}, {7, 8}, {7, 11}, {7, 15}, {11, 12}}, + 5, + }, + + { + [][]int{{100, 101}, {1, 3}, {8, 9}}, + 6, + }, + + { + [][]int{{1, 3}, {8, 9}}, + 4, + }, + + { + [][]int{{1, 3}, {1, 4}, {2, 5}, {3, 5}}, + 3, + }, + + { + [][]int{{1, 2}, {2, 3}, {2, 4}, {4, 5}}, + 5, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, intersectionSizeTwo(tc.intervals), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + intersectionSizeTwo(tc.intervals) + } + } +} diff --git a/Algorithms/0761.special-binary-string/README.md b/Algorithms/0761.special-binary-string/README.md new file mode 100755 index 000000000..828604fa2 --- /dev/null +++ b/Algorithms/0761.special-binary-string/README.md @@ -0,0 +1,31 @@ +# [761. Special Binary String](https://leetcode.com/problems/special-binary-string/) + +## 题目 + +Special binary strings are binary strings with the following two properties: + +1. The number of 0's is equal to the number of 1's. +1. Every prefix of the binary string has at least as many 1's as 0's. + +Given a special string S, a move consists of choosing two consecutive, non-empty, special substrings of S, and swapping them. (Two strings are consecutive if the last character of the first string is exactly one index before the first character of the second string.) + +At the end of any number of moves, what is the lexicographically largest resulting string possible? + +Example 1: + +```text +Input: S = "11011000" +Output: "11100100" +Explanation: +The strings "10" [occuring at S[1]] and "1100" [at S[3]] are swapped. +This is the lexicographically largest string possible after some number of swaps. +``` + +Note: + +1. S has length at most 50. +1. S is guaranteed to be a special binary string as defined above. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0761.special-binary-string/special-binary-string.go b/Algorithms/0761.special-binary-string/special-binary-string.go new file mode 100755 index 000000000..b58b20893 --- /dev/null +++ b/Algorithms/0761.special-binary-string/special-binary-string.go @@ -0,0 +1,47 @@ +package problem0761 + +import ( + "sort" + "strings" +) + +func makeLargestSpecial(S string) string { + if len(S) == 2 || len(S) == 0 { + // 此时,S 必定为 Largest Special + return S + } + + // 把 S 尽可能多的划分成小的 special binary + // 把划分成出的片段放入 res 中 + res := []string{} + // count 用于在划分时,统计片段中 1 和 0 的个数是否相等 + count, i := 0, 0 + + for j, b := range S { + if b == '1' { + count++ + } else { + count-- + } + + if count == 0 { + // 此时 S[i:j+1] 是 special binary + // 且根据 special binary 的定义,可知 + // S[i] == '1' + // S[j] == '0' + // 另外 + // 不把 "1"+makeLargestSpecial(S[i+1:j])+"0" 写成 + // makeLargestSpecial(S[i:j+1]) 是因为 + // 对于 "111000" 来说 + // i == 0 , j+1 == len(S) + // 递归的子集并没有缩小,程序无法结束 + res = append(res, "1"+makeLargestSpecial(S[i+1:j])+"0") + i = j + 1 + } + } + + // 按照从大到小的顺序排列 res 中的字符串 + sort.Sort(sort.Reverse(sort.StringSlice(res))) + + return strings.Join(res, "") +} diff --git a/Algorithms/0761.special-binary-string/special-binary-string_test.go b/Algorithms/0761.special-binary-string/special-binary-string_test.go new file mode 100755 index 000000000..9a9d0bf7d --- /dev/null +++ b/Algorithms/0761.special-binary-string/special-binary-string_test.go @@ -0,0 +1,44 @@ +package problem0761 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "101100", + "110010", + }, + + { + "11011000", + "11100100", + }, + + // 可以有多个 testcase +} + +func Test_makeLargestSpecial(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, makeLargestSpecial(tc.S), "输入:%v", tc) + } +} + +func Benchmark_makeLargestSpecial(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + makeLargestSpecial(tc.S) + } + } +} diff --git a/Algorithms/0762.find-anagram-mappings/README.md b/Algorithms/0762.find-anagram-mappings/README.md new file mode 100755 index 000000000..43adc6bbf --- /dev/null +++ b/Algorithms/0762.find-anagram-mappings/README.md @@ -0,0 +1,76 @@ +# [762. Find Anagram Mappings](https://leetcode.com/problems/find-anagram-mappings/) + +## 题目 + +Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A. + +We want to find an index mapping P, from A to B. A mapping P[i] = j means the ith element in A appears in B at index j. + +These lists A and B may contain duplicates. If there are multiple answers, output any of them. + +For example, given + +```text +A = [12, 28, 46, 32, 50] +B = [50, 12, 32, 46, 28] +``` + +We should return + +```text +[1, 4, 3, 2, 0] +``` + +as P[0] = 1 because the 0th element of A appears at B[1], and P[1] = 4 because the 1st element of A appears at B[4], and so on. +Note: + +1. A, B have equal lengths in range [1, 100]. +1. A[i], B[i] are integers in range [0, 10^5]. + +## 解题思路 + +见程序注释 + +我把问题想复杂了,以下是想复杂以后的解法。 + +```text +输入 +[47 34 51 47 47 34] +[47 51 34 34 47 47] +输出 +[0, 2, 1, 5, 4, 3] +``` + +复杂的地方在于,输出包含了 [0,len(A)) 之间的所有整数 + +```golang +func anagramMappings(A, B []int) []int { + n := len(A) + indexs := make(map[int]int, n) + values := make(map[int]int, n) + res := make([]int, n) + + for i := range res { + if A[i] == B[i] { + res[i] = i + continue + } + + if val, ok := values[A[i]]; ok { + res[i] = val + delete(values, A[i]) + } else { + indexs[A[i]] = i + } + + if idx, ok := indexs[B[i]]; ok { + res[idx] = i + delete(indexs, B[i]) + } else { + values[B[i]] = i + } + } + + return res +} +``` diff --git a/Algorithms/0762.find-anagram-mappings/find-anagram-mappings.go b/Algorithms/0762.find-anagram-mappings/find-anagram-mappings.go new file mode 100755 index 000000000..6d1ff8e13 --- /dev/null +++ b/Algorithms/0762.find-anagram-mappings/find-anagram-mappings.go @@ -0,0 +1,17 @@ +package problem0762 + +func anagramMappings(A, B []int) []int { + n := len(A) + values := make(map[int]int, n) + res := make([]int, n) + + for i := range B { + values[B[i]] = i + } + + for i := range res { + res[i] = values[A[i]] + } + + return res +} diff --git a/Algorithms/0762.find-anagram-mappings/find-anagram-mappings_test.go b/Algorithms/0762.find-anagram-mappings/find-anagram-mappings_test.go new file mode 100755 index 000000000..32dd8894f --- /dev/null +++ b/Algorithms/0762.find-anagram-mappings/find-anagram-mappings_test.go @@ -0,0 +1,52 @@ +package problem0762 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A, B []int + ans []int +}{ + + { + []int{47, 34, 51, 47, 47, 34}, + []int{47, 51, 34, 34, 47, 47}, + []int{5, 3, 1, 5, 5, 3}, + }, + + { + []int{12, 28, 46, 32, 50, 12}, + []int{50, 12, 32, 46, 28, 12}, + []int{5, 4, 3, 2, 0, 5}, + }, + + { + []int{12, 28, 46, 32, 50}, + []int{50, 12, 32, 46, 28}, + []int{1, 4, 3, 2, 0}, + }, + + // 可以有多个 testcase +} + +func Test_fn(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, anagramMappings(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_fn(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + anagramMappings(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/README.md b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/README.md new file mode 100755 index 000000000..72355ed16 --- /dev/null +++ b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/README.md @@ -0,0 +1,42 @@ +# [762. Prime Number of Set Bits in Binary Representation](https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/) + +## 题目 + +Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation. + +(Recall that the number of set bits an integer has is the number of 1s present when written in binary. For example, 21 written in binary is 10101 which has 3 set bits. Also, 1 is not a prime.) + +Example 1: + +```text +Input: L = 6, R = 10 +Output: 4 +Explanation: +6 -> 110 (2 set bits, 2 is prime) +7 -> 111 (3 set bits, 3 is prime) +9 -> 1001 (2 set bits , 2 is prime) +10->1010 (2 set bits , 2 is prime) +``` + +Example 2: + +```text +Input: L = 10, R = 15 +Output: 5 +Explanation: +10 -> 1010 (2 set bits, 2 is prime) +11 -> 1011 (3 set bits, 3 is prime) +12 -> 1100 (2 set bits, 2 is prime) +13 -> 1101 (3 set bits, 3 is prime) +14 -> 1110 (3 set bits, 3 is prime) +15 -> 1111 (4 set bits, 4 is not prime) +``` + +Note: + +1. L, R will be integers L <= R in the range [1, 10^6]. +1. R - L will be at most 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation.go b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation.go new file mode 100755 index 000000000..870c2c447 --- /dev/null +++ b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation.go @@ -0,0 +1,16 @@ +package problem0762 + +func countPrimeSetBits(L int, R int) int { + primes := [...]int{2: 1, 3: 1, 5: 1, 7: 1, 11: 1, 13: 1, 17: 1, 19: 1} + + res := 0 + for i := L; i <= R; i++ { + bits := 0 + for n := i; n > 0; n >>= 1 { + bits += n & 1 + } + res += primes[bits] + } + + return res +} diff --git a/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation_test.go b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation_test.go new file mode 100755 index 000000000..355a654c0 --- /dev/null +++ b/Algorithms/0762.prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation_test.go @@ -0,0 +1,53 @@ +package problem0762 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + L int + R int + ans int +}{ + + { + 6, + 10, + 4, + }, + + { + 16, + 16, + 0, + }, + + { + 10, + 15, + 5, + }, + + // 可以有多个 testcase +} + +func Test_countPrimeSetBits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, countPrimeSetBits(tc.L, tc.R), "输入:%v", tc) + } +} + +func Benchmark_countPrimeSetBits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countPrimeSetBits(tc.L, tc.R) + } + } +} diff --git a/Algorithms/0763.partition-labels/README.md b/Algorithms/0763.partition-labels/README.md new file mode 100755 index 000000000..5e5027413 --- /dev/null +++ b/Algorithms/0763.partition-labels/README.md @@ -0,0 +1,25 @@ +# [763. Partition Labels](https://leetcode.com/problems/partition-labels/) + +## 题目 + +A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts. + +Example 1: + +```text +Input: S = "ababcbacadefegdehijhklij" +Output: [9,7,8] +Explanation: +The partition is "ababcbaca", "defegde", "hijhklij". +This is a partition so that each letter appears in at most one part. +A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits S into less parts. +``` + +Note: + +1. S will have length in range [1, 500]. +1. S will consist of lowercase letters ('a' to 'z') only. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0763.partition-labels/partition-labels.go b/Algorithms/0763.partition-labels/partition-labels.go new file mode 100755 index 000000000..2feba1ba7 --- /dev/null +++ b/Algorithms/0763.partition-labels/partition-labels.go @@ -0,0 +1,39 @@ +package problem0763 + +func partitionLabels(S string) []int { + maxIndex := [26]int{} + for i, b := range S { + maxIndex[b-'a'] = i + } + + begin := 0 + end := maxIndex[S[begin]-'a'] + res := make([]int, 0, len(S)) + + for i, b := range S { + if i < end { + // 在 S[:i+1] 和 S[i:] 中存在相同的字母 S[end] + // 所以此时不能分隔,仅更新 end + end = max(end, maxIndex[b-'a']) + continue + } + + // 此时 S[begin:i+1] 中的所有字母都不会出现在其他片段中 + // 可以进行分隔 + res = append(res, i-begin+1) + begin = i + 1 // 从 i+1 处作为新片段的起始点 + if begin < len(S) { + // 及时更新 end + end = maxIndex[S[begin]-'a'] + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0763.partition-labels/partition-labels_test.go b/Algorithms/0763.partition-labels/partition-labels_test.go new file mode 100755 index 000000000..f1d1b9107 --- /dev/null +++ b/Algorithms/0763.partition-labels/partition-labels_test.go @@ -0,0 +1,44 @@ +package problem0763 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans []int +}{ + + { + "abcdefg", + []int{1, 1, 1, 1, 1, 1, 1}, + }, + + { + "ababcbacadefegdehijhklij", + []int{9, 7, 8}, + }, + + // 可以有多个 testcase +} + +func Test_partitionLabels(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, partitionLabels(tc.S), "输入:%v", tc) + } +} + +func Benchmark_partitionLabels(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + partitionLabels(tc.S) + } + } +} diff --git a/Algorithms/0764.largest-plus-sign/README.md b/Algorithms/0764.largest-plus-sign/README.md new file mode 100755 index 000000000..cd3852735 --- /dev/null +++ b/Algorithms/0764.largest-plus-sign/README.md @@ -0,0 +1,75 @@ +# [764. Largest Plus Sign](https://leetcode.com/problems/largest-plus-sign/) + +## 题目 + +In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. What is the largest axis-aligned plus sign of 1s contained in the grid? Return the order of the plus sign. If there is none, return 0. + +An "axis-aligned plus sign of 1s of order k" has some center grid[x][y] = 1 along with 4 arms of length k-1 going up, down, left, and right, and made of 1s. This is demonstrated in the diagrams below. Note that there could be 0s or 1s beyond the arms of the plus sign, only the relevant area of the plus sign is checked for 1s. + +Examples of Axis-Aligned Plus Signs of Order k: + +```text +Order 1: +000 +010 +000 + +Order 2: +00000 +00100 +01110 +00100 +00000 + +Order 3: +0000000 +0001000 +0001000 +0111110 +0001000 +0001000 +0000000 +``` + +Example 1: + +```text +Input: N = 5, mines = [[4, 2]] +Output: 2 +Explanation: +11111 +11111 +11111 +11111 +11011 +In the above grid, the largest plus sign can only be order 2. One of them is marked in bold. +``` + +Example 2: + +```text +Input: N = 2, mines = [] +Output: 1 +Explanation: +There is no plus sign of order 2, but there is of order 1. +``` + +Example 3: + +```text +Input: N = 1, mines = [[0, 0]] +Output: 0 +Explanation: +There is no plus sign, so return 0. +``` + +Note: + +1. N will be an integer in the range [1, 500]. +1. mines will have length at most 5000. +1. mines[i] will be length 2 and consist of integers in the range [0, N-1]. +1. (Additionally, programs submitted in C, C++, or C# will be judged with a slightly smaller time limit.) + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0764.largest-plus-sign/largest-plus-sign.go b/Algorithms/0764.largest-plus-sign/largest-plus-sign.go new file mode 100755 index 000000000..1179253e0 --- /dev/null +++ b/Algorithms/0764.largest-plus-sign/largest-plus-sign.go @@ -0,0 +1,42 @@ +package problem0764 + +func orderOfLargestPlusSign(N int, mines [][]int) int { + k := N/2 + N%2 + + if len(mines) == 0 { + return k + } + + isMined := [500][500]bool{} + for _, m := range mines { + isMined[m[0]][m[1]] = true + } + + isGoodEdge := func(xBegin, xEnd, yBegin, yEnd int) bool { + for i := xBegin; i <= xEnd; i++ { + for j := yBegin; j <= yEnd; j++ { + if isMined[i][j] { + return false + } + } + } + return true + } + + for ; k > 0; k-- { + for i := k - 1; i <= N-k; i++ { + for j := k - 1; j <= N-k; j++ { + // (i,j) 是十字的中心点 + if !isMined[i][j] && + isGoodEdge(i-k+1, i-1, j, j) && + isGoodEdge(i+1, i+k-1, j, j) && + isGoodEdge(i, i, j-k+1, j-1) && + isGoodEdge(i, i, j+1, j+k-1) { + return k + } + } + } + } + + return 0 +} diff --git a/Algorithms/0764.largest-plus-sign/largest-plus-sign_test.go b/Algorithms/0764.largest-plus-sign/largest-plus-sign_test.go new file mode 100755 index 000000000..60cc6ec07 --- /dev/null +++ b/Algorithms/0764.largest-plus-sign/largest-plus-sign_test.go @@ -0,0 +1,53 @@ +package problem0764 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + mines [][]int + ans int +}{ + + { + 5, + [][]int{[]int{4, 2}}, + 2, + }, + + { + 2, + [][]int{}, + 1, + }, + + { + 1, + [][]int{[]int{0, 0}}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_orderOfLargestPlusSign(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, orderOfLargestPlusSign(tc.N, tc.mines), "输入:%v", tc) + } +} + +func Benchmark_orderOfLargestPlusSign(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + orderOfLargestPlusSign(tc.N, tc.mines) + } + } +} diff --git a/Algorithms/0765.couples-holding-hands/README.md b/Algorithms/0765.couples-holding-hands/README.md new file mode 100755 index 000000000..f2fe3e7eb --- /dev/null +++ b/Algorithms/0765.couples-holding-hands/README.md @@ -0,0 +1,34 @@ +# [765. Couples Holding Hands](https://leetcode.com/problems/couples-holding-hands/) + +## 题目 + +N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side by side. A swap consists of choosing any two people, then they stand up and switch seats. + +The people and seats are represented by an integer from 0 to 2N-1, the couples are numbered in order, the first couple being (0, 1), the second couple being (2, 3), and so on with the last couple being (2N-2, 2N-1). + +The couples' initial seating is given by row[i] being the value of the person who is initially sitting in the i-th seat. + +Example 1: + +```text +Input: row = [0, 2, 1, 3] +Output: 1 +Explanation: We only need to swap the second (row[1]) and third (row[2]) person. +``` + +Example 2: + +```text +Input: row = [3, 2, 0, 1] +Output: 0 +Explanation: All couples are already seated side by side. +``` + +Note: + +1. len(row) is even and in the range of [4, 60]. +1. row is guaranteed to be a permutation of 0...len(row)-1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0765.couples-holding-hands/couples-holding-hands.go b/Algorithms/0765.couples-holding-hands/couples-holding-hands.go new file mode 100755 index 000000000..563ffff56 --- /dev/null +++ b/Algorithms/0765.couples-holding-hands/couples-holding-hands.go @@ -0,0 +1,65 @@ +package problem0765 + +import ( + "sort" +) + +func minSwapsCouples(row []int) int { + n := len(row) + + // pairs 把不成对的数收集起来 + pairs := make([][]int, 0, 30) + for i := 0; i < n; i += 2 { + if !isCouple(row[i], row[i+1]) { + pairs = append(pairs, makePair(row[i], row[i+1])) + } + } + + res := 0 + + for len(pairs) > 0 { + // 新产生的 pair 有可能会打乱 pairs 的顺序 + // 重新排序是为了保证每次的 pairs[0][0] 和 pairs[1][0] 都是一对 + sort.Slice(pairs, func(i, j int) bool { + return pairs[i][0] < pairs[j][0] + }) + + for len(pairs) > 1 && isCouple(pairs[0][1], pairs[1][1]) { + pairs = pairs[2:] + // 此时相当于完成了一次交换。 + // 但是促成了两个 couple + res++ + // 而且由于没有产生新的 pair, + // 所以,pairs 的顺序没有被打乱,可以重复使用。 + } + + if len(pairs) == 0 { + break + } + + // 因为 pairs[0][0] 和 pairs[1][0] 肯定就是一个 couple + // 要把 pairs[0][1] 和 pairs[1][1] 重新凑成一个 pair + pairs[1] = makePair(pairs[0][1], pairs[1][1]) + pairs = pairs[1:] + // 此时相当于完成了一次交换。 + // 只促成了一个 couple + res++ + } + + return res +} + +// 把较小的数放在前面 +func makePair(a, b int) []int { + if a > b { + a, b = b, a + } + return []int{a, b} +} + +func isCouple(a, b int) bool { + if a > b { + a, b = b, a + } + return a+1 == b && a%2 == 0 +} diff --git a/Algorithms/0765.couples-holding-hands/couples-holding-hands_test.go b/Algorithms/0765.couples-holding-hands/couples-holding-hands_test.go new file mode 100755 index 000000000..7b5aaa36f --- /dev/null +++ b/Algorithms/0765.couples-holding-hands/couples-holding-hands_test.go @@ -0,0 +1,75 @@ +package problem0765 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + row []int + ans int +}{ + + { + []int{1, 4, 0, 5, 8, 7, 6, 3, 2, 9}, + 3, + }, + + { + []int{0, 2, 1, 3}, + 1, + }, + + { + []int{3, 2, 0, 1}, + 0, + }, + + { + []int{3, 4, 2, 5, 0, 1}, + 1, + }, + + { + []int{3, 4, 2, 0, 5, 1}, + 2, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 0}, + 3, + }, + + { + []int{0, 5, 3, 1, 4, 2}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_minSwapsCouples(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minSwapsCouples(tc.row), "输入:%v", tc) + } +} + +func Benchmark_minSwapsCouples(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minSwapsCouples(tc.row) + } + } +} + +func Benchmark_delet2AtOnce(b *testing.B) { + for i := 0; i < b.N; i++ { + minSwapsCouples([]int{0, 2, 1, 3, 4, 6, 5, 7, 8, 10, 9, 11}) + } +} diff --git a/Algorithms/0766.toeplitz-matrix/README.md b/Algorithms/0766.toeplitz-matrix/README.md new file mode 100755 index 000000000..a78d7f933 --- /dev/null +++ b/Algorithms/0766.toeplitz-matrix/README.md @@ -0,0 +1,39 @@ +# [766. Toeplitz Matrix](https://leetcode.com/problems/toeplitz-matrix/) + +## 题目 + +A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. + +Now given an `M x N` matrix, return `True` if and only if the matrix is Toeplitz. + +Example 1: + +```text +Input: matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]] +Output: True +Explanation: +1234 +5123 +9512 + +In the above grid, the diagonals are "[9]", "[5, 5]", "[1, 1, 1]", "[2, 2, 2]", "[3, 3]", "[4]", and in each diagonal all elements are the same, so the answer is True. +``` + +Example 2: + +```text +Input: matrix = [[1,2],[2,2]] +Output: False +Explanation: +The diagonal "[1, 2]" has different elements. +``` + +Note: + +1. `matrix` will be a 2D array of integers. +1. `matrix` will have a number of rows and columns in range [1, 20]. +1. `matrix[i][j]` will be integers in range [0, 99]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0766.toeplitz-matrix/toeplitz-matrix.go b/Algorithms/0766.toeplitz-matrix/toeplitz-matrix.go new file mode 100755 index 000000000..ad22e81da --- /dev/null +++ b/Algorithms/0766.toeplitz-matrix/toeplitz-matrix.go @@ -0,0 +1,15 @@ +package problem0766 + +func isToeplitzMatrix(mat [][]int) bool { + m, n := len(mat), len(mat[0]) + + for i := 0; i+1 < m; i++ { + for j := 0; j+1 < n; j++ { + if mat[i][j] != mat[i+1][j+1] { + return false + } + } + } + + return true +} diff --git a/Algorithms/0766.toeplitz-matrix/toeplitz-matrix_test.go b/Algorithms/0766.toeplitz-matrix/toeplitz-matrix_test.go new file mode 100755 index 000000000..e657301f9 --- /dev/null +++ b/Algorithms/0766.toeplitz-matrix/toeplitz-matrix_test.go @@ -0,0 +1,44 @@ +package problem0766 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans bool +}{ + + { + [][]int{{1, 2, 3, 4}, {5, 1, 2, 3}, {9, 5, 1, 2}}, + true, + }, + + { + [][]int{{1, 2}, {2, 2}}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isToeplitzMatrix(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isToeplitzMatrix(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_isToeplitzMatrix(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isToeplitzMatrix(tc.matrix) + } + } +} diff --git a/Algorithms/0767.reorganize-string/README.md b/Algorithms/0767.reorganize-string/README.md new file mode 100755 index 000000000..51c2d9f7f --- /dev/null +++ b/Algorithms/0767.reorganize-string/README.md @@ -0,0 +1,29 @@ +# [767. Reorganize String](https://leetcode.com/problems/reorganize-string/) + +## 题目 + +Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. + +If possible, output any possible result.  If not possible, return the empty string. + +Example 1: + +```text +Input: S = "aab" +Output: "aba" +``` + +Example 2: + +```text +Input: S = "aaab" +Output: "" +``` + +Note: + +1. S will consist of lowercase letters and have length in range [1, 500]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0767.reorganize-string/reorganize-string.go b/Algorithms/0767.reorganize-string/reorganize-string.go new file mode 100755 index 000000000..63d3b0b28 --- /dev/null +++ b/Algorithms/0767.reorganize-string/reorganize-string.go @@ -0,0 +1,60 @@ +package problem0767 + +import ( + "sort" +) + +func reorganizeString(s string) string { + n := len(s) + bs := []byte(s) + + count := make([][2]int, 26) + maxCount := 0 + for _, b := range bs { + count[b-'a'][0]++ // 0 位放字母的个数 + count[b-'a'][1] = int(b - 'a') // 1 位字母本身 + maxCount = max(maxCount, count[b-'a'][0]) + } + + // 利用个数最多的元素,进行快速判断。 + if 2*maxCount > n+1 { + return "" + } + + sort.Slice(count, func(i, j int) bool { + if count[i][0] == count[j][0] { + // 字母个数相同的时候,ascii 码小的在前面 + return count[i][1] < count[j][1] + } + // 个数多的字母排在前面 + return count[i][0] > count[j][0] + }) + + idx := 0 + + for i := 0; i < 26 && count[i][0] > 0; i++ { + b := byte('a' + count[i][1]) + + for count[i][0] > 0 { + bs[idx] = b + count[i][0]-- + // 填写的时候,留下间隔 + // 避免相同的字母相邻 + idx += 2 + if idx >= n { + // 到头了以后,从 1 位重新填写 + idx = 1 + } + } + + } + + return string(bs) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0767.reorganize-string/reorganize-string_test.go b/Algorithms/0767.reorganize-string/reorganize-string_test.go new file mode 100755 index 000000000..60fd34556 --- /dev/null +++ b/Algorithms/0767.reorganize-string/reorganize-string_test.go @@ -0,0 +1,64 @@ +package problem0767 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "abbabbaaab", + "ababababab", + }, + + { + "snnnnbpngobwznvnnnlnwhvnnnnfjnnlnnnnnnbnknnqkndzefncknnnnnaiqrntnndnnnjninnnunnunqhndnnqnnsjqnnpiqshntnnncnvnnnncnnqenlnninyndnnnljongnnjwnnnngllnnngkbnllnnnnontlbpngjnnenqnsnnnnnjeqqghnfpngepnodnnnnnnvnsrnughbnipvnhqmnzonoonnnjotnnonoennnpnfnnkdnnbmnmnpnqninnxronnnnvnlanlnnnebnnnlnvnfknsnbincnttnmnguqenhnnxunnnntnnnnhnqnzehvunfnvnndvnjnnnbnnpxnqipwnmnonnndlnsnonnninnxnnnjnnnnnesennmyiednnnnnnnnnhimtnnnonjlicnwnwvnntaxmnrntnnnnsnbnanninnecbcfjxncnnkvnnqgnunensanpnngjnzxjnopnnyvnnxskniyytnsnnnnx", + "nqnqnqnqnqnqnqnqnqnqnqnqnqnqnqnqnonononononononononononononononenenenenenenenenenenenenenenininininininininininininininjnjnjnjnjnjnjnjnjnjnjnjnjnjnlnlnlnlnlnlnlnlnlnlnlnlnlnlnvnvnvnvnvnvnvnvnvnvnvnvnvnbnbnbnbnbnbnbnbnbnbnbnbnpnpnpnpnpnpnpnpnpnpnpnpnsnsnsnsnsnsnsnsnsnsnsnsngngngngngngngngngngngntntntntntntntntntntntnhnhnhnhnhnhnhnhnhnhndndndndndndndndndnxnxnxnxnxnxnxnxnxncncncncncncncncnknknknknknknknknmnmnmnmnmnmnmnmnfnfnfnfnfnfnfnunununununununwnwnwnwnwnwnanananananynynynynynznznznznznrnrnrnrn", + }, + + { + "aaab", + "", + }, + + { + "aab", + "aba", + }, + + { + "baaba", + "ababa", + }, + + { + "vvvlo", + "vlvov", + }, + + // 可以有多个 testcase +} + +func Test_reorganizeString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reorganizeString(tc.S), "输入:%v", tc) + } +} + +func Benchmark_reorganizeString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reorganizeString(tc.S) + } + } +} diff --git a/Algorithms/0768.max-chunks-to-make-sorted-ii/README.md b/Algorithms/0768.max-chunks-to-make-sorted-ii/README.md new file mode 100755 index 000000000..2f45ad971 --- /dev/null +++ b/Algorithms/0768.max-chunks-to-make-sorted-ii/README.md @@ -0,0 +1,40 @@ +# [768. Max Chunks To Make Sorted II](https://leetcode.com/problems/max-chunks-to-make-sorted-ii/) + +## 题目 + +This question is the same as "Max Chunks to Make Sorted" except the integers of the given array are not necessarily distinct, the input array could be up to length 2000, and the elements could be up to 10**8. + +------- + +Given an array `arr` of integers (**not necessarily distinct**), we split the array into some number of chunks (partitions), and individually sort each chunk. After concatenating them, the result equals the sorted array. + +What is the most number of chunks we could have made? + +Example 1: + +```text +Input: arr = [5,4,3,2,1] +Output: 1 +Explanation: +Splitting into two or more chunks will not return the required result. +For example, splitting into [5, 4], [3, 2, 1] will result in [4, 5, 1, 2, 3], which isn't sorted. +``` + +Example 2: + +```text +Input: arr = [2,1,3,4,4] +Output: 4 +Explanation: +We can split into two chunks, such as [2, 1], [3, 4, 4]. +However, splitting into [2, 1], [3], [4], [4] is the highest number of chunks possible. +``` + +Note: + +1. arr will have length in range [1, 2000]. +1. arr[i] will be an integer in range [0, 10**8]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii.go b/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii.go new file mode 100755 index 000000000..c06ba731e --- /dev/null +++ b/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii.go @@ -0,0 +1,57 @@ +package problem0768 + +import ( + "sort" +) + +func maxChunksToSorted(arr []int) int { + return helper(convert(arr)) +} + +// 把 +// arr will have length in range [1, 2000]. +// arr[i] will be an integer in range [0, 10**8] +// 转换成 +// arr will have length in range [1, 10]. +// arr[i] will be a permutation of [0, 1, ..., arr.length - 1] +// 就可以利用 769 题的答案来解答了 +func convert(arr []int) []int { + a := make([][]int, len(arr)) + for i := range a { + a[i] = []int{arr[i], i} + } + + sort.Slice(a, func(i int, j int) bool { + if a[i][0] == a[j][0] { + return a[i][1] < a[j][1] + } + return a[i][0] < a[j][0] + }) + + res := make([]int, len(arr)) + + for i := range a { + res[a[i][1]] = i + } + + return res +} + +// 直接复制了 769 的答案 +func helper(arr []int) int { + lastIdx, res := 0, 0 + for i := 0; i < len(arr); i++ { + if lastIdx < arr[i] { + lastIdx = arr[i] + continue + } + + if i == lastIdx { + res++ + lastIdx++ + } + + } + + return res +} diff --git a/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii_test.go b/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii_test.go new file mode 100755 index 000000000..cdf763a07 --- /dev/null +++ b/Algorithms/0768.max-chunks-to-make-sorted-ii/max-chunks-to-make-sorted-ii_test.go @@ -0,0 +1,54 @@ +package problem0768 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans int +}{ + + { + []int{6, 4, 5}, + 1, + }, + + { + []int{6, 4, 3, 2, 1, 5}, + 1, + }, + + { + []int{5, 4, 3, 2, 1}, + 1, + }, + + { + []int{2, 1, 3, 4, 4}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_maxChunksToSorted(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxChunksToSorted(tc.arr), "输入:%v", tc) + } +} + +func Benchmark_maxChunksToSorted(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxChunksToSorted(tc.arr) + } + } +} diff --git a/Algorithms/0769.max-chunks-to-make-sorted/README.md b/Algorithms/0769.max-chunks-to-make-sorted/README.md new file mode 100755 index 000000000..ebcfcbf31 --- /dev/null +++ b/Algorithms/0769.max-chunks-to-make-sorted/README.md @@ -0,0 +1,36 @@ +# [769. Max Chunks To Make Sorted](https://leetcode.com/problems/max-chunks-to-make-sorted/) + +## 题目 + +Given an array `arr` that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of `chunks` (partitions), and individually sort each chunk. After concatenating them, the result equals the sorted array. + +What is the most number of chunks we could have made? + +Example 1: + +```text +Input: arr = [4,3,2,1,0] +Output: 1 +Explanation: +Splitting into two or more chunks will not return the required result. +For example, splitting into [4, 3], [2, 1, 0] will result in [3, 4, 0, 1, 2], which isn't sorted. +``` + +Example 2: + +```text +Input: arr = [1,0,2,3,4] +Output: 4 +Explanation: +We can split into two chunks, such as [1, 0], [2, 3, 4]. +However, splitting into [1, 0], [2], [3], [4] is the highest number of chunks possible. +``` + +Note: + +1. arr will have length in range [1, 10]. +1. arr[i] will be a permutation of [0, 1, ..., arr.length - 1]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted.go b/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted.go new file mode 100755 index 000000000..eea83841a --- /dev/null +++ b/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted.go @@ -0,0 +1,28 @@ +package problem0769 + +func maxChunksToSorted(arr []int) int { + // 充分利用好 arr[i] will be a permutation of [0, 1, ..., arr.length - 1] + // 假设某个 chunk 为 arr[j:k],则对于 + // j <= i < k ,必有 + // j <= arr[i] < k + // 因为排序后,arr[x]=x + // + // lastIdx 是 下一个要切下来的 chunk 中最后一个元素的索引号 + lastIdx, res := 0, 0 + for i := 0; i < len(arr); i++ { + if lastIdx < arr[i] { + lastIdx = arr[i] + // lastIdx == arr[i],才能满足前面提到的要求 + continue + } + + if i == lastIdx { + // 此时可以切下一刀 + res++ + lastIdx++ + } + + } + + return res +} diff --git a/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted_test.go b/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted_test.go new file mode 100755 index 000000000..145711106 --- /dev/null +++ b/Algorithms/0769.max-chunks-to-make-sorted/max-chunks-to-make-sorted_test.go @@ -0,0 +1,49 @@ +package problem0769 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans int +}{ + + { + []int{2, 1, 0, 5, 4, 3, 6, 9, 8, 7}, + 4, + }, + + { + []int{4, 3, 2, 1, 0}, + 1, + }, + + { + []int{1, 0, 2, 3, 4}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_maxChunksToSorted(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxChunksToSorted(tc.arr), "输入:%v", tc) + } +} + +func Benchmark_maxChunksToSorted(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxChunksToSorted(tc.arr) + } + } +} diff --git a/Algorithms/0770.basic-calculator-iv/README.md b/Algorithms/0770.basic-calculator-iv/README.md new file mode 100755 index 000000000..79e0bccd8 --- /dev/null +++ b/Algorithms/0770.basic-calculator-iv/README.md @@ -0,0 +1,52 @@ +# [770. Basic Calculator IV](https://leetcode.com/problems/basic-calculator-iv/) + +## 题目 + +Given an `expression` such as `expression = "e + 8 - a + 5"` and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1]), return a list of tokens representing the simplified expression, such as ["-1*a","14"] + +- An expression alternates chunks and symbols, with a space separating each chunk and symbol. +- A chunk is either an expression in parentheses, a variable, or a non-negative integer. +- A variable is a string of lowercase letters (not including digits.) Note that variables can be multiple letters, and note that variables never have a leading coefficient or unary operator like "2x" or "-x". + +Expressions are evaluated in the usual order: brackets first, then multiplication, then addition and subtraction. For example, expression = "1 + 2 * 3" has an answer of ["7"]. + +The format of the output is as follows: + +- For each term of free variables with non-zero coefficient, we write the free variables within a term in sorted order lexicographically. For example, we would never write a term like `"b*a*c"`, only `"a*b*c"`. +- Terms have degree equal to the number of free variables being multiplied, counting multiplicity. (For example, `"a*a*b*c"` has degree 4.) We write the largest degree terms of our answer first, breaking ties by lexicographic order ignoring the leading coefficient of the term. +- The leading coefficient of the term is placed directly to the left with an asterisk separating it from the variables (if they exist.) A leading coefficient of 1 is still printed. +- An example of a well formatted answer is [`"-2*a*a*a"`, `"3*a*a*b"`, `"3*b*b"`, `"4*a"`, `"5*c"`, `"-6"`] +- Terms (including constant terms) with coefficient 0 are not included. For example, an expression of "0" has an output of []. + +Examples: + +```text +Input: expression = "e + 8 - a + 5", evalvars = ["e"], evalints = [1] +Output: ["-1*a","14"] + +Input: expression = "e - 8 + temperature - pressure", +evalvars = ["e", "temperature"], evalints = [1, 12] +Output: ["-1*pressure","5"] + +Input: expression = "(e + 8) * (e - 8)", evalvars = [], evalints = [] +Output: ["1*e*e","-64"] + +Input: expression = "7 - 7", evalvars = [], evalints = [] +Output: [] + +Input: expression = "a * b * c + b * a * c * 4", evalvars = [], evalints = [] +Output: ["5*a*b*c"] + +Input: expression = "((a - b) * (b - c) + (c - a)) * ((a - b) + (b - c) * (c - a))", +evalvars = [], evalints = [] +Output: ["-1*a*a*b*b","2*a*a*b*c","-1*a*a*c*c","1*a*b*b*b","-1*a*b*b*c","-1*a*b*c*c","1*a*c*c*c","-1*b*b*b*c","2*b*b*c*c","-1*b*c*c*c","2*a*a*b","-2*a*a*c","-2*a*b*b","2*a*c*c","1*b*b*b","-1*b*b*c","1*b*c*c","-1*c*c*c","-1*a*a","1*a*b","1*a*c","-1*b*c"] +``` + +Note: + +1. expression will have length in range [1, 250]. +1. evalvars, evalints will have equal lengths in range [0, 100]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0770.basic-calculator-iv/basic-calculator-iv.go b/Algorithms/0770.basic-calculator-iv/basic-calculator-iv.go new file mode 100755 index 000000000..23b757a52 --- /dev/null +++ b/Algorithms/0770.basic-calculator-iv/basic-calculator-iv.go @@ -0,0 +1,218 @@ +package problem0770 + +import ( + "sort" + "strconv" + "strings" +) + +func basicCalculatorIV(expression string, evalvars []string, evalints []int) []string { + // 把 evalvars 和 evalints 转换成 eemap + eemap := make(map[string]int, len(evalvars)) + for i := range evalvars { + eemap[evalvars[i]] = evalints[i] + } + + // 删除 expression 中的所有空格,为下面的 parse 有准备 + expression = strings.Replace(expression, " ", "", -1) + + numbers := parse(expression, eemap) + + return format(numbers) +} + +func parse(expression string, m map[string]int) nums { + // n1 opt1 n2 opt2 n3 opt3 ... + // 根据 opt2 是否为 * 决定运算顺序 + // 像以下这样提前设置 n1,n2,opt1,opt2 + // 不会改变运算结果,却可以简化 for 循环 + n1, n2 := nums{num{c: 0}}, nums{num{c: 0}} + opt1, opt2 := byte('+'), byte('+') + + for { + var n3 nums + var i int + // 获取 n3 + if expression[0] == '(' { + // 遇见括号,就把括号中的内容取出,进行递归 + i = indexOfCounterParentheses(expression) + n3 = parse(expression[1:i], m) + // i++前,i 是右括号的索引值 + i++ + // i++后,i 是右括号右边的运算符号的索引值 + } else { + i = indexOfNextOpt(expression) + n3 = creatNums(expression[:i], m) + } + + // 根据 opt2 进行不同的运算 + if opt2 == '*' { + n2 = operate(opt2, n2, n3) + } else { + n1 = operate(opt1, n1, n2) + n2 = n3 + opt1 = opt2 + } + + // 检查 i ,确保后续操作不溢出 + if i == len(expression) { + break + } + + opt2 = expression[i] + expression = expression[i+1:] + } + + return operate(opt1, n1, n2) +} + +func creatNums(exp string, m map[string]int) nums { + constant, ok := m[exp] + if ok { + return nums{num{c: constant}} + } + + constant, err := strconv.Atoi(exp) + if err != nil { + return nums{num{vars: []string{exp}, c: 1}} + } + + return nums{num{c: constant}} +} + +func operate(opt byte, a, b nums) nums { + var res nums + switch opt { + case '+': + res = add(a, b) + case '-': + res = minus(a, b) + case '*': + res = mult(a, b) + } + return res +} + +func add(a, b nums) nums { + return append(a, b...) +} + +func minus(a, b nums) nums { + for i := range b { + b[i].c *= -1 + } + return append(a, b...) +} + +func mult(a, b nums) nums { + res := make(nums, 0, len(a)*len(b)) + for i := range a { + for j := range b { + vars := make([]string, 0, len(a[i].vars)+len(b[j].vars)) + vars = append(vars, a[i].vars...) + vars = append(vars, b[j].vars...) + res = append(res, num{vars: vars, c: a[i].c * b[j].c}) + } + } + return res +} + +func indexOfCounterParentheses(expression string) int { + i := 1 + count := 1 + for ; i < len(expression); i++ { + switch expression[i] { + case '(': + count++ + case ')': + count-- + } + if count == 0 { + break + } + } + return i +} + +func indexOfNextOpt(expression string) int { + var i int + for i = 1; i < len(expression); i++ { + if expression[i] == '+' || + expression[i] == '-' || + expression[i] == '*' { + break + } + } + return i +} + +func format(numbers nums) []string { + numbers = update(numbers) + res := make([]string, 0, len(numbers)) + + for _, n := range numbers { + if n.c == 0 { + continue + } + temp := strconv.Itoa(n.c) + if n.key != "" { + temp = temp + "*" + n.key + } + res = append(res, temp) + } + + return res +} + +type nums []num + +type num struct { + vars []string // 变量 + key string // vars 排序后,使用 "*" 连接,成为 key + c int // 系数 +} + +func update(ns nums) nums { + // 更新每个 num 的 key + for i := range ns { + sort.Strings(ns[i].vars) + ns[i].key = strings.Join(ns[i].vars, "*") + } + + // 对 ns 进行排序 + sort.Slice(ns, func(i int, j int) bool { + leni := len(ns[i].vars) + lenj := len(ns[j].vars) + // 首先,变量多的放在前面 + if leni != lenj { + return leni > lenj + } + // 变量一样多的时候 + // 不同变量,小的放在前面 + for k := 0; k < leni; k++ { + if ns[i].vars[k] == ns[j].vars[k] { + continue + } + return ns[i].vars[k] < ns[j].vars[k] + } + // i,j 所有变量都一样的时候 + // 返回 false 表示不用交换 + return false + }) + + // 合并相同 key 的 c + res := make(nums, 1, len(ns)) + res[0] = ns[0] + i, j := 0, 1 + for j < len(ns) { + if res[i].key == ns[j].key { + res[i].c += ns[j].c + } else { + res = append(res, ns[j]) + i++ + } + j++ + } + + return res +} diff --git a/Algorithms/0770.basic-calculator-iv/basic-calculator-iv_test.go b/Algorithms/0770.basic-calculator-iv/basic-calculator-iv_test.go new file mode 100755 index 000000000..3769656ef --- /dev/null +++ b/Algorithms/0770.basic-calculator-iv/basic-calculator-iv_test.go @@ -0,0 +1,85 @@ +package problem0770 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + expression string + evalvars []string + evalints []int + ans []string +}{ + + { + "(av * 9) - (ar + 0) - ((bq - cv) + v * (b + bq - bk)) * (a - 12 + 2 - (6 * cc - 8 - bv + ag))", + []string{"d", "g", "h", "j", "l", "o", "s", "u", "v", "w", "af", "ag", "ah", "ak", "at", "au", "av", "aw", "az", "bc", "be", "bg", "bj", "bm", "bn", "bq", "br", "bs", "bt", "bu", "bv", "bw", "bx", "by", "bz", "ca", "cd", "ce", "cf", "ch", "ci", "ck", "cq", "cr", "cs", "cu", "cv"}, + []int{3, 6, 7, 9, 11, 1, 5, 7, 8, 9, 10, 11, 12, 2, 11, 12, 0, 1, 4, 12, 1, 3, 6, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 5, 6, 7, 9, 10, 12, 5, 6, 7, 9, 10}, + []string{"-8*a*b", "8*a*bk", "48*b*cc", "-48*bk*cc", "10*a", "-1*ar", "64*b", "-64*bk", "-60*cc", "-80"}, + }, + + { + "(e + 8) * (e - 8)", + []string{}, + []int{}, + []string{"1*e*e", "-64"}, + }, + + { + "e + 8 - a + 5", + []string{"e"}, + []int{1}, + []string{"-1*a", "14"}, + }, + + { + "e - 8 + temperature - pressure", + []string{"e", "temperature"}, + []int{1, 12}, + []string{"-1*pressure", "5"}, + }, + + { + "7 - 7", + []string{}, + []int{}, + []string{}, + }, + + { + "a * b * c + b * a * c * 4", + []string{}, + []int{}, + []string{"5*a*b*c"}, + }, + + { + "((a - b) * (b - c) + (c - a)) * ((a - b) + (b - c) * (c - a))", + []string{}, + []int{}, + []string{"-1*a*a*b*b", "2*a*a*b*c", "-1*a*a*c*c", "1*a*b*b*b", "-1*a*b*b*c", "-1*a*b*c*c", "1*a*c*c*c", "-1*b*b*b*c", "2*b*b*c*c", "-1*b*c*c*c", "2*a*a*b", "-2*a*a*c", "-2*a*b*b", "2*a*c*c", "1*b*b*b", "-1*b*b*c", "1*b*c*c", "-1*c*c*c", "-1*a*a", "1*a*b", "1*a*c", "-1*b*c"}, + }, + + // 可以有多个 testcase +} + +func Test_basicCalculatorIV(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, basicCalculatorIV(tc.expression, tc.evalvars, tc.evalints), "输入:%v", tc) + } +} + +func Benchmark_basicCalculatorIV(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + basicCalculatorIV(tc.expression, tc.evalvars, tc.evalints) + } + } +} diff --git a/Algorithms/0771.jewels-and-stones/README.md b/Algorithms/0771.jewels-and-stones/README.md new file mode 100755 index 000000000..67aa11630 --- /dev/null +++ b/Algorithms/0771.jewels-and-stones/README.md @@ -0,0 +1,30 @@ +# [771. Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/) + +## 题目 + +You‘re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels. + +The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A". + +Example 1: + +```text +Input: J = "aA", S = "aAAbbbb" +Output: 3 +``` + +Example 2: + +```text +Input: J = "z", S = "ZZ" +Output: 0 +``` + +Note: + +- S and J will consist of letters and have length at most 50. +- The characters in J are distinct. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0771.jewels-and-stones/jewels-and-stones.go b/Algorithms/0771.jewels-and-stones/jewels-and-stones.go new file mode 100755 index 000000000..8b8fb7743 --- /dev/null +++ b/Algorithms/0771.jewels-and-stones/jewels-and-stones.go @@ -0,0 +1,17 @@ +package problem0771 + +func numJewelsInStones(J string, S string) int { + isJewel := make(map[byte]bool, len(J)) + for i := range J { + isJewel[J[i]] = true + } + + res := 0 + for i := range S { + if isJewel[S[i]] { + res++ + } + } + + return res +} diff --git a/Algorithms/0771.jewels-and-stones/jewels-and-stones_test.go b/Algorithms/0771.jewels-and-stones/jewels-and-stones_test.go new file mode 100755 index 000000000..e8979abd4 --- /dev/null +++ b/Algorithms/0771.jewels-and-stones/jewels-and-stones_test.go @@ -0,0 +1,47 @@ +package problem0771 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + J string + S string + ans int +}{ + + { + "aA", + "aAAbbbb", + 3, + }, + + { + "z", + "ZZ", + 0, + }, + + // 可以有多个 testcase +} + +func Test_numJewelsInStones(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numJewelsInStones(tc.J, tc.S), "输入:%v", tc) + } +} + +func Benchmark_numJewelsInStones(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numJewelsInStones(tc.J, tc.S) + } + } +} diff --git a/Algorithms/0773.sliding-puzzle/README.md b/Algorithms/0773.sliding-puzzle/README.md new file mode 100755 index 000000000..79b86b691 --- /dev/null +++ b/Algorithms/0773.sliding-puzzle/README.md @@ -0,0 +1,46 @@ +# [773. Sliding Puzzle](https://leetcode.com/problems/sliding-puzzle/) + +## 题目 + +On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0. + +A move consists of choosing 0 and a 4-directionally adjacent number and swapping it. + +The state of the board is solved if and only if the board is [[1,2,3],[4,5,0]]. + +Given a puzzle board, return the least number of moves required so that the state of the board is solved. If it is impossible for the state of the board to be solved, return -1. + +Examples: + +```text +Input: board = [[1,2,3],[4,0,5]] +Output: 1 +Explanation: Swap the 0 and the 5 in one move. + +Input: board = [[1,2,3],[5,4,0]] +Output: -1 +Explanation: No number of moves will make the board solved. + +Input: board = [[4,1,2],[5,0,3]] +Output: 5 +Explanation: 5 is the smallest number of moves that solves the board. +An example path: +After move 0: [[4,1,2],[5,0,3]] +After move 1: [[4,1,2],[0,5,3]] +After move 2: [[0,1,2],[4,5,3]] +After move 3: [[1,0,2],[4,5,3]] +After move 4: [[1,2,0],[4,5,3]] +After move 5: [[1,2,3],[4,5,0]] + +Input: board = [[3,2,4],[1,5,0]] +Output: 14 +``` + +Note: + +1. board will be a 2 x 3 array as described above. +1. board[i][j] will be a permutation of [0, 1, 2, 3, 4, 5]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0773.sliding-puzzle/sliding-puzzle.go b/Algorithms/0773.sliding-puzzle/sliding-puzzle.go new file mode 100755 index 000000000..284d78d7f --- /dev/null +++ b/Algorithms/0773.sliding-puzzle/sliding-puzzle.go @@ -0,0 +1,69 @@ +package problem0773 + +import ( + "strings" +) + +func slidingPuzzle(board [][]int) int { + origin, target := "123450", convert(board) + if origin == target { + return 0 + } + + queue := make([]string, 1, 720) + queue[0] = origin + + hasSeen := make(map[string]bool, 720) + hasSeen[origin] = true + + res := 0 + d := []int{-1, 1, 3, -3} + countDown := len(queue) + for len(queue) > 0 { + // 从队列中抽取 s 对其进行变形 + s := queue[0] + i := strings.IndexByte(s, '0') + for k := range d { + j := i + d[k] + if j < 0 || + j > 5 || + i == 2 && j == 3 || + i == 3 && j == 2 { + continue + } + c := swap(s, i, j) + if c == target { + return res + 1 + } + + if !hasSeen[c] { + queue = append(queue, c) + hasSeen[c] = true + } + } + + // 删除队列头部,检查 res 是否需要 ++ + queue = queue[1:] + countDown-- + if countDown == 0 { + countDown = len(queue) + res++ + } + } + + return -1 +} + +func convert(board [][]int) string { + res := make([]byte, 6) + for i := range res { + res[i] = byte(board[i/3][i%3]) + '0' + } + return string(res) +} + +func swap(s string, i, j int) string { + b := []byte(s) + b[i], b[j] = b[j], b[i] + return string(b) +} diff --git a/Algorithms/0773.sliding-puzzle/sliding-puzzle_test.go b/Algorithms/0773.sliding-puzzle/sliding-puzzle_test.go new file mode 100755 index 000000000..36ce5772f --- /dev/null +++ b/Algorithms/0773.sliding-puzzle/sliding-puzzle_test.go @@ -0,0 +1,59 @@ +package problem0773 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]int + ans int +}{ + + { + [][]int{{4, 1, 2}, {5, 0, 3}}, + 5, + }, + + { + [][]int{{1, 2, 3}, {4, 0, 5}}, + 1, + }, + + { + [][]int{{3, 2, 4}, {1, 5, 0}}, + 14, + }, + + { + [][]int{{1, 2, 3}, {4, 5, 0}}, + 0, + }, + + { + [][]int{{1, 2, 3}, {5, 4, 0}}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_slidingPuzzle(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, slidingPuzzle(tc.board), "输入:%v", tc) + } +} + +func Benchmark_slidingPuzzle(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + slidingPuzzle(tc.board) + } + } +} diff --git a/Algorithms/0775.global-and-local-inversions/README.md b/Algorithms/0775.global-and-local-inversions/README.md new file mode 100755 index 000000000..052ac67b2 --- /dev/null +++ b/Algorithms/0775.global-and-local-inversions/README.md @@ -0,0 +1,37 @@ +# [775. Global and Local Inversions](https://leetcode.com/problems/global-and-local-inversions/) + +## 题目 + +We have some permutation A of [0, 1, ..., N - 1], where N is the length of A. + +The number of (global) inversions is the number of i < j with 0 <= i < j < N and A[i] > A[j]. + +The number of local inversions is the number of i with 0 <= i < N and A[i] > A[i+1]. + +Return true if and only if the number of global inversions is equal to the number of local inversions. + +Example 1: + +```text +Input: A = [1,0,2] +Output: true +Explanation: There is 1 global inversion, and 1 local inversion. +``` + +Example 2: + +```text +Input: A = [1,2,0] +Output: false +Explanation: There are 2 global inversions, and 1 local inversion. +``` + +Note: + +- A will be a permutation of [0, 1, ..., A.length - 1]. +- A will have length in range [1, 5000]. +- The time limit for this problem has been reduced. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0775.global-and-local-inversions/global-and-local-inversions.go b/Algorithms/0775.global-and-local-inversions/global-and-local-inversions.go new file mode 100755 index 000000000..d82826cf3 --- /dev/null +++ b/Algorithms/0775.global-and-local-inversions/global-and-local-inversions.go @@ -0,0 +1,19 @@ +package problem0775 + +func isIdealPermutation(a []int) bool { + for i := 0; i < len(a)-1; i++ { + if a[i] == i { + continue + } + + // 只有 **仅有** 相邻的两个数交换的时候 + // 才有可能满足题意,局部逆序等于全局逆序 + if a[i] == i+1 && a[i+1] == i { + i++ + } else { + return false + } + } + + return true +} diff --git a/Algorithms/0775.global-and-local-inversions/global-and-local-inversions_test.go b/Algorithms/0775.global-and-local-inversions/global-and-local-inversions_test.go new file mode 100755 index 000000000..dbaaaec3f --- /dev/null +++ b/Algorithms/0775.global-and-local-inversions/global-and-local-inversions_test.go @@ -0,0 +1,49 @@ +package problem0775 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{0, 1, 2}, + true, + }, + + { + []int{1, 0, 2}, + true, + }, + + { + []int{1, 2, 0}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isIdealPermutation(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isIdealPermutation(tc.A), "输入:%v", tc) + } +} + +func Benchmark_isIdealPermutation(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isIdealPermutation(tc.A) + } + } +} diff --git a/Algorithms/0777.swap-adjacent-in-lr-string/README.md b/Algorithms/0777.swap-adjacent-in-lr-string/README.md new file mode 100755 index 000000000..2f373e7bc --- /dev/null +++ b/Algorithms/0777.swap-adjacent-in-lr-string/README.md @@ -0,0 +1,28 @@ +# [777. Swap Adjacent in LR String](https://leetcode.com/problems/swap-adjacent-in-lr-string/) + +## 题目 + +In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or replacing one occurrence of "RX" with "XR". Given the starting string start and the ending string end, return True if and only if there exists a sequence of moves to transform one string to the other. + +Example: + +```text +Input: start = "RXXLRXRXL", end = "XRLXXRRLX" +Output: True +Explanation: +We can transform start to end following these steps: +RXXLRXRXL -> +XRXLRXRXL -> +XRLXRXRXL -> +XRLXXRRXL -> +XRLXXRRLX +``` + +Note: + +- 1 <= len(start) = len(end) <= 10000. +- Both start and end will only consist of characters in {'L', 'R', 'X'}. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string.go b/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string.go new file mode 100755 index 000000000..f398c5fc1 --- /dev/null +++ b/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string.go @@ -0,0 +1,61 @@ +package problem0777 + +import ( + "strings" +) + +func canTransform(start string, end string) bool { + // L 可以往左移 + // R 可以往右移 + // 但是, + // L 没法移动到 R 的左边 + // R 没法移动到 L 的右边 + // 所有,L 和 R 互相为对方划清了移动范围 + // 无论 L 和 R 怎么移动,消去 X 后,start 和 end 中剩下的部分,应该是一样的。 + return strings.Replace(start, "X", "", -1) == strings.Replace(end, "X", "", -1) && + // 由于 L 不能往右移动,所以,每一个 L 的索引号只能变小 + isOK(idxs(start, 'L'), idxs(end, 'L'), isMoreOrEqual) && + // 由于 R 不能往左移动,所以,每一个 R 的索引号只能变大 + isOK(idxs(start, 'R'), idxs(end, 'R'), isLessOrEqual) + // 换句话说, + // 以上判断都是在检查 end 中的 L 和 R 的索引值变化有没有超出范围 + // 消去,检查了 end 中每个 L 的下限和每个 R 的上限 + // 然后 + // 检查了 end 中每个 L 的上限和每个 R 的下限 +} + +// idxs 返回 s 中所有 b 字符的索引号 +func idxs(s string, b byte) []int { + res := make([]int, 0, len(s)) + for i := range s { + if s[i] == b { + res = append(res, i) + } + } + return res +} + +// 对于任意的 i ,都能使的 isAvailable(a[i], b[i]) 返回 true +// 则 isOK 返回 true +func isOK(a, b []int, isAvailable func(x, y int) bool) bool { + for i := range a { + if !isAvailable(a[i], b[i]) { + return false + } + } + return true +} + +func isLessOrEqual(x, y int) bool { + if x <= y { + return true + } + return false +} + +func isMoreOrEqual(x, y int) bool { + if x >= y { + return true + } + return false +} diff --git a/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string_test.go b/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string_test.go new file mode 100755 index 000000000..91af1e94a --- /dev/null +++ b/Algorithms/0777.swap-adjacent-in-lr-string/swap-adjacent-in-lr-string_test.go @@ -0,0 +1,65 @@ +package problem0777 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + start string + end string + ans bool +}{ + + { + "RXXXXXLXXXX", + "LRXXXXXXXXX", + false, + }, + + { + "LXXXXXXXXX", + "XXXXXLXXXX", + false, + }, + + { + "XXXXXRXXXX", + "RXXXXXXXXX", + false, + }, + + { + "XXXXXLXXXX", + "LXXXXXXXXX", + true, + }, + + { + "RXXLRXRXL", + "XRLXXRRLX", + true, + }, + + // 可以有多个 testcase +} + +func Test_canTransform(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canTransform(tc.start, tc.end), "输入:%v", tc) + } +} + +func Benchmark_canTransform(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canTransform(tc.start, tc.end) + } + } +} diff --git a/Algorithms/0778.swim-in-rising-water/README.md b/Algorithms/0778.swim-in-rising-water/README.md new file mode 100755 index 000000000..34f77c80a --- /dev/null +++ b/Algorithms/0778.swim-in-rising-water/README.md @@ -0,0 +1,47 @@ +# [778. Swim in Rising Water](https://leetcode.com/problems/swim-in-rising-water/) + +## 题目 + +On an N x N `grid`, each square `grid[i][j]` represents the elevation at that point `(i,j)`. + +Now rain starts to fall. At time t, the depth of the water everywhere is `t`. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares individually are at most `t`. You can swim infinite distance in zero time. Of course, you must stay within the boundaries of the grid during your swim. + +You start at the top left square `(0, 0)`. What is the least time until you can reach the bottom right square `(N-1, N-1)`? + +Example 1: + +```text +Input: [[0,2],[1,3]] +Output: 3 +Explanation: +At time 0, you are in grid location (0, 0). +You cannot go anywhere else because 4-directionally adjacent neighbors have a higher elevation than t = 0. + +You cannot reach point (1, 1) until time 3. +When the depth of water is 3, we can swim anywhere inside the grid. +``` + +Example 2: + +```text +Input: [[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]] +Output: 16 +Explanation: + 0 1 2 3 4 +24 23 22 21 5 +12 13 14 15 16 +11 17 18 19 20 +10 9 8 7 6 + +The final route is marked in bold. +We need to wait until time 16 so that (0, 0) and (4, 4) are connected. +``` + +Note: + +1. 2 <= N <= 50. +1. `grid[i][j]` is a permutation of [0, ..., N*N - 1]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0778.swim-in-rising-water/swim-in-rising-water.go b/Algorithms/0778.swim-in-rising-water/swim-in-rising-water.go new file mode 100755 index 000000000..4a4933aa3 --- /dev/null +++ b/Algorithms/0778.swim-in-rising-water/swim-in-rising-water.go @@ -0,0 +1,92 @@ +package Problem0778 + +import "container/heap" + +func swimInWater(grid [][]int) int { + n := len(grid) + + pq := make(PQ, 0, n*n) + isPushed := make([]bool, n*n) + + origin := &entry{ + x: 0, + y: 0, + max: grid[0][0], + } + heap.Push(&pq, origin) + isPushed[0] = true + + dx := [4]int{0, 0, -1, 1} + dy := [4]int{-1, 1, 0, 0} + + for { + // 每次把沿路经过的最高海拔值中的最低者提取出来 + // 作为优先选择的路径 + pre := heap.Pop(&pq).(*entry) + for k := 0; k < 4; k++ { + i := pre.x + dx[k] + j := pre.y + dy[k] + + if i < 0 || n <= i || + j < 0 || n <= j || + isPushed[i*n+j] { + continue + } + + if i == n-1 && j == n-1 { + // 找到目的地后,最后再比较一下 + // 就可以返回答案了 + return max(pre.max, grid[n-1][n-1]) + } + + next := &entry{ + x: i, + y: j, + max: max(pre.max, grid[i][j]), + } + + // next 作为候选,放入 pq + heap.Push(&pq, next) + isPushed[i*n+j] = true + } + } +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// entry 是 priorityQueue 中的元素 +type entry struct { + x, y int + max int // 沿路经过的海拔的最高值 +} + +// PQ implements heap.Interface and holds entries. +type PQ []*entry + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i].max < pq[j].max +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + temp := x.(*entry) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} diff --git a/Algorithms/0778.swim-in-rising-water/swim-in-rising-water_test.go b/Algorithms/0778.swim-in-rising-water/swim-in-rising-water_test.go new file mode 100755 index 000000000..cf57816c2 --- /dev/null +++ b/Algorithms/0778.swim-in-rising-water/swim-in-rising-water_test.go @@ -0,0 +1,44 @@ +package Problem0778 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{0, 2}, {1, 3}}, + 3, + }, + + { + [][]int{{0, 1, 2, 3, 4}, {24, 23, 22, 21, 5}, {12, 13, 14, 15, 16}, {11, 17, 18, 19, 20}, {10, 9, 8, 7, 6}}, + 16, + }, + + // 可以有多个 testcase +} + +func Test_swimInWater(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, swimInWater(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_swimInWater(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + swimInWater(tc.grid) + } + } +} diff --git a/Algorithms/0779.k-th-symbol-in-grammar/README.md b/Algorithms/0779.k-th-symbol-in-grammar/README.md new file mode 100755 index 000000000..b537bd2cf --- /dev/null +++ b/Algorithms/0779.k-th-symbol-in-grammar/README.md @@ -0,0 +1,37 @@ +# [779. K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) + +## 题目 + +On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10. + +Given row N and index K, return the K-th indexed symbol in row N. (The values of K are 1-indexed.) (1 indexed). + +```text +Examples: +Input: N = 1, K = 1 +Output: 0 + +Input: N = 2, K = 1 +Output: 0 + +Input: N = 2, K = 2 +Output: 1 + +Input: N = 4, K = 5 +Output: 1 + +Explanation: +row 1: 0 +row 2: 01 +row 3: 0110 +row 4: 01101001 +``` + +Note: + +- N will be an integer in the range [1, 30]. +- will be an integer in the range [1, 2^(N-1)]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar.go b/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar.go new file mode 100755 index 000000000..8ac6e1a1d --- /dev/null +++ b/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar.go @@ -0,0 +1,27 @@ +package problem0779 + +func kthGrammar(N int, K int) int { + if N == 1 { + return 0 + } + + if K%2 == 1 { + // 0 + // / \ + // 0 1 + // /\ /\ + // 0 1 1 0 + // 把变化按照 binary tree 的样子写下来,会发现 + // 当 K 为奇数时,其数值与其父节点 (N-1, (K+1)/2) 一样 + return kthGrammar(N-1, (K+1)/2) + } + + // 当 K 为偶数时,其数值与其父节点 (N-1, K/2) 相反 + return opposite(kthGrammar(N-1, K/2)) +} + +// 当 a 是 0 时,返回 1 +// 当 a 是 1 时,返回 0 +func opposite(a int) int { + return (a + 1) % 2 +} diff --git a/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar_test.go b/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar_test.go new file mode 100755 index 000000000..4de609e03 --- /dev/null +++ b/Algorithms/0779.k-th-symbol-in-grammar/k-th-symbol-in-grammar_test.go @@ -0,0 +1,65 @@ +package problem0779 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + K int + ans int +}{ + + { + 30, + 434991989, + 0, + }, + + { + 1, + 1, + 0, + }, + + { + 2, + 1, + 0, + }, + + { + 2, + 2, + 1, + }, + + { + 4, + 5, + 1, + }, + + // 可以有多个 testcase +} + +func Test_kthGrammar(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kthGrammar(tc.N, tc.K), "输入:%v", tc) + } +} + +func Benchmark_kthGrammar(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kthGrammar(tc.N, tc.K) + } + } +} diff --git a/Algorithms/0780.reaching-points/README.md b/Algorithms/0780.reaching-points/README.md new file mode 100755 index 000000000..e2226cb07 --- /dev/null +++ b/Algorithms/0780.reaching-points/README.md @@ -0,0 +1,32 @@ +# [780. Reaching Points](https://leetcode.com/problems/reaching-points/) + +## 题目 + +A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). + +Given a starting point (sx, sy) and a target point (tx, ty), return True if and only if a sequence of moves exists to transform the point (sx, sy) to (tx, ty). Otherwise, return False. + +```text +Examples: +Input: sx = 1, sy = 1, tx = 3, ty = 5 +Output: True +Explanation: +One series of moves that transforms the starting point to the target is: +(1, 1) -> (1, 2) +(1, 2) -> (3, 2) +(3, 2) -> (3, 5) + +Input: sx = 1, sy = 1, tx = 2, ty = 2 +Output: False + +Input: sx = 1, sy = 1, tx = 1, ty = 1 +Output: True +``` + +Note: + +- sx, sy, tx, ty will all be integers in the range [1, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0780.reaching-points/reaching-points.go b/Algorithms/0780.reaching-points/reaching-points.go new file mode 100755 index 000000000..6ed408bcb --- /dev/null +++ b/Algorithms/0780.reaching-points/reaching-points.go @@ -0,0 +1,43 @@ +package problem0780 + +// 考虑到 x y 的范围是 [1, 10^9] +// (x, y) 在变形的过程中,只会越变越大 +// 那么,反过来看,想要得到 (tx,ty) +// 当 tx > ty 时, 必有 (tx-ty,ty) -> (tx,ty) +// 当 tx < ty 时, 必有 (tx,ty-tx) -> (tx,ty) +// 所以,通过递归地减小 (tx,ty) 的值,可以很快的得到答案 +func reachingPoints(sx int, sy int, tx int, ty int) bool { + // 让 tx 比 ty 大 + if tx < ty { + sx, sy = sy, sx + tx, ty = ty, tx + } + + var helper func(int, int) bool + helper = func(x, y int) bool { + // 找到答案 + if sx == x && sy == y { + return true + } + + // 确定无法找到答案 + if sx > x || sy > y || + x == y { + // x == y 也返回 false,是因为 x-y == 0,超过了取值范围 + return false + } + + if sy == y { + // 当 sy == y 时 + // 只有 x-y 这一种运算了。 + // 就可以依据 sx%sy == x%y 判断结果 + return sx%sy == x%y + } + + // 根据对称性 + // 直接把较小的数,放在 y 的位置 + return helper(y, x%y) + } + + return helper(tx, ty) +} diff --git a/Algorithms/0780.reaching-points/reaching-points_test.go b/Algorithms/0780.reaching-points/reaching-points_test.go new file mode 100755 index 000000000..718d0c229 --- /dev/null +++ b/Algorithms/0780.reaching-points/reaching-points_test.go @@ -0,0 +1,85 @@ +package problem0780 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + sx int + sy int + tx int + ty int + ans bool +}{ + + { + 3, + 3, + 12, + 9, + true, + }, + + { + 1, + 1, + 100000001, + 2, + true, + }, + + { + 1, + 1, + 1000000000, + 1, + true, + }, + + { + 1, + 1, + 3, + 5, + true, + }, + + { + 1, + 1, + 2, + 2, + false, + }, + + { + 1, + 1, + 1, + 1, + true, + }, + + // 可以有多个 testcase +} + +func Test_reachingPoints(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reachingPoints(tc.sx, tc.sy, tc.tx, tc.ty), "输入:%v", tc) + } +} + +func Benchmark_reachingPoints(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reachingPoints(tc.sx, tc.sy, tc.tx, tc.ty) + } + } +} diff --git a/Algorithms/0781.rabbits-in-forest/README.md b/Algorithms/0781.rabbits-in-forest/README.md new file mode 100755 index 000000000..edae44abc --- /dev/null +++ b/Algorithms/0781.rabbits-in-forest/README.md @@ -0,0 +1,34 @@ +# [781. Rabbits in Forest](https://leetcode.com/problems/rabbits-in-forest/) + +## 题目 + +In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how many other rabbits have the same color as them. Those answers are placed in an array. + +Return the minimum number of rabbits that could be in the forest. + +```text +Examples: +Input: answers = [1, 1, 2] +Output: 5 +Explanation: +The two rabbits that answered "1" could both be the same color, say red. +The rabbit than answered "2" can't be red or the answers would be inconsistent. +Say the rabbit that answered "2" was blue. +Then there should be 2 other blue rabbits in the forest that didn't answer into the array. +The smallest possible number of rabbits in the forest is therefore 5: 3 that answered plus 2 that didn't. + +Input: answers = [10, 10, 10] +Output: 11 + +Input: answers = [] +Output: 0 +``` + +Note: + +1. answers will have length at most 1000. +1. Each answers[i] will be an integer in the range [0, 999]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0781.rabbits-in-forest/rabbits-in-forest.go b/Algorithms/0781.rabbits-in-forest/rabbits-in-forest.go new file mode 100755 index 000000000..efd27214a --- /dev/null +++ b/Algorithms/0781.rabbits-in-forest/rabbits-in-forest.go @@ -0,0 +1,35 @@ +package problem0781 + +func numRabbits(answers []int) int { + count := [1000]int{} + for _, v := range answers { + count[v]++ + } + + res := 0 + + // 假设所有的 answer 都是 3 + // answer count -> res + // 3 1 4 + // 3 2 4 + // 3 3 4 + // 3 4 4 + // 3 5 8 + // 3 6 8 + // 3 7 8 + // 3 8 8 + // 3 9 12 + + for ans, c := range count { + if c == 0 { + continue + } + ans++ + res += c / ans * ans + if c%ans > 0 { + res += ans + } + } + + return res +} diff --git a/Algorithms/0781.rabbits-in-forest/rabbits-in-forest_test.go b/Algorithms/0781.rabbits-in-forest/rabbits-in-forest_test.go new file mode 100755 index 000000000..8de46986a --- /dev/null +++ b/Algorithms/0781.rabbits-in-forest/rabbits-in-forest_test.go @@ -0,0 +1,74 @@ +package problem0781 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + answers []int + ans int +}{ + + { + []int{3, 3, 3, 3, 3}, + 8, + }, + + { + []int{3, 3, 3, 3}, + 4, + }, + + { + []int{2, 2, 2, 2}, + 6, + }, + + { + []int{1, 1, 1, 1, 1}, + 6, + }, + + { + []int{1, 0, 1, 0, 0}, + 5, + }, + + { + []int{1, 1, 2}, + 5, + }, + + { + []int{10, 10, 10}, + 11, + }, + + { + []int{}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_numRabbits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numRabbits(tc.answers), "输入:%v", tc) + } +} + +func Benchmark_numRabbits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numRabbits(tc.answers) + } + } +} diff --git a/Algorithms/0782.transform-to-chessboard/, b/Algorithms/0782.transform-to-chessboard/, new file mode 100644 index 000000000..e69de29bb diff --git a/Algorithms/0782.transform-to-chessboard/README.md b/Algorithms/0782.transform-to-chessboard/README.md new file mode 100755 index 000000000..c9095b5cc --- /dev/null +++ b/Algorithms/0782.transform-to-chessboard/README.md @@ -0,0 +1,47 @@ +# [782. Transform to Chessboard](https://leetcode.com/problems/transform-to-chessboard/) + +## 题目 + +An N x N board contains only 0s and 1s. In each move, you can swap any 2 rows with each other, or any 2 columns with each other. + +What is the minimum number of moves to transform the board into a "chessboard" - a board where no 0s and no 1s are 4-directionally adjacent? If the task is impossible, return -1. + +```text +Examples: +Input: board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]] +Output: 2 +Explanation: +One potential sequence of moves is shown below, from left to right: + +0110 1010 1010 +0110 --> 1010 --> 0101 +1001 0101 1010 +1001 0101 0101 + +The first move swaps the first and second column. +The second move swaps the second and third row. + + +Input: board = [[0, 1], [1, 0]] +Output: 0 +Explanation: +Also note that the board with 0 in the top left corner, +01 +10 + +is also a valid chessboard. + +Input: board = [[1, 0], [1, 0]] +Output: -1 +Explanation: +No matter what sequence of moves you make, you cannot end with a valid chessboard. +``` + +Note: + +1. board will have the same number of rows and columns, a number in the range [2, 30]. +1. board[i][j] will be only 0s or 1s. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0782.transform-to-chessboard/transform-to-chessboard.go b/Algorithms/0782.transform-to-chessboard/transform-to-chessboard.go new file mode 100755 index 000000000..4e83ceeb9 --- /dev/null +++ b/Algorithms/0782.transform-to-chessboard/transform-to-chessboard.go @@ -0,0 +1,102 @@ +package problem0782 + +func movesToChessboard(b [][]int) int { + N := len(b) + + // b 中的行有且只能有两种 + // 并且这两种行互补,例如 + // [1 0 1 0 1 1 0 0] + // [0 1 0 1 0 0 1 1] + // 一旦出现第 3 种,就可以返回 -1 了 + for i := 0; i < N; i++ { + for j := 0; j < N; j++ { + if b[0][0]^b[i][0]^b[0][j]^b[i][j] == 1 { + // 等价于 + // if !((b[0][0] == b[i][0] && b[0][j] == b[i][j]) || + // (b[0][0] != b[i][0] && b[0][j] != b[i][j])) { + return -1 + } + } + } + + rowSum, colSum, rowSwap, colSwap := 0, 0, 0, 0 + + for i := 0; i < N; i++ { + rowSum += b[0][i] + colSum += b[i][0] + // 先假设排列好的样子是 + // 0 1 0 1 0 1 ... + // 1 + // 0 + // 1 + // 0 + // 1 + // . + // . + // . + // + // 那么 rowSwap 和 colSwap 分别统计了列和行上 + // 需要变动的元素的个数 + if b[i][0] == i%2 { + rowSwap++ + } + if b[0][i] == i%2 { + colSwap++ + } + } + + // 当 N 为偶数时, rowSum == N/2 且 colSum == N/2 + // 当 N 为奇数时, | rowSum - colSum | == 1 + // 才有可能交换成功 + // 否则,就可以返回 -1 了 + if rowSum < N/2 || (N+1)/2 < rowSum { + // 一行中,拥有了太少或太多的 1 + return -1 + } + + if colSum < N/2 || (N+1)/2 < colSum { + // 一列中,拥有了太少或太多的 1 + return -1 + } + + // 当 N 为奇数时 + if N%2 == 1 { + // 如果 colSwap 也为奇数的话 + // 说明,我们前面预想的排列好的样子中 + // 行的样子反了 + if colSwap%2 == 1 { + // 以前以为放对的位置,其实才是放错了的 + colSwap = N - colSwap + } + // 如果 rowSwap 也为奇数的话 + // 说明,我们前面预想的排列好的样子中 + // 列的样子反了 + if rowSwap%2 == 1 { + // 以前以为放对的位置,其实才是放错了的 + rowSwap = N - rowSwap + } + // 其实可以从另一个角度来想 + // 由于只存在 0 和 1 两种元素,因此 + // colSwap 和 rowSwap 只能是偶数 + // 当他们为奇数时,说明,我们前面的预想是错的 + } else { // 当 N 为偶数时 + // 如果 colSwap 或 rowSwap 超过了 N/2 + // 同样说明我们预想的样子反了 + // 那不是经过最少步骤能够达到的样子 + colSwap = min(N-colSwap, colSwap) + rowSwap = min(N-rowSwap, rowSwap) + } + + // colSwap 和 rowSwap 是错位的元素个数 + // 调整次数需要 ÷2 + return (colSwap + rowSwap) / 2 +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +// 本题来自于 https://leetcode.com/problems/transform-to-chessboard/discuss/114847/Easy-and-Concise-Solution-with-Explanation-C++JavaPython diff --git a/Algorithms/0782.transform-to-chessboard/transform-to-chessboard_test.go b/Algorithms/0782.transform-to-chessboard/transform-to-chessboard_test.go new file mode 100755 index 000000000..9ecc61ca0 --- /dev/null +++ b/Algorithms/0782.transform-to-chessboard/transform-to-chessboard_test.go @@ -0,0 +1,74 @@ +package problem0782 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]int + ans int +}{ + + { + [][]int{{0, 0, 0}, {0, 0, 0}, {1, 1, 1}}, + -1, + }, + + { + [][]int{{0, 0, 1}, {1, 1, 0}, {1, 1, 0}}, + 2, + }, + + { + [][]int{{0, 1, 1}, {0, 1, 1}, {1, 0, 0}}, + 2, + }, + + { + [][]int{{1, 1, 0}, {0, 0, 1}, {0, 0, 1}}, + 2, + }, + + { + [][]int{{0, 1}, {1, 0}}, + 0, + }, + + { + [][]int{{1, 1, 1, 0}, {0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 0, 1}}, + -1, + }, + + { + [][]int{{0, 1, 1, 0}, {0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 0, 1}}, + 2, + }, + + { + [][]int{{1, 0}, {1, 0}}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_movesToChessboard(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, movesToChessboard(tc.board), "输入:%v", tc) + } +} + +func Benchmark_movesToChessboard(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + movesToChessboard(tc.board) + } + } +} diff --git a/Algorithms/0783.minimum-distance-between-bst-nodes/README.md b/Algorithms/0783.minimum-distance-between-bst-nodes/README.md new file mode 100755 index 000000000..9c04ae82f --- /dev/null +++ b/Algorithms/0783.minimum-distance-between-bst-nodes/README.md @@ -0,0 +1,33 @@ +# [783. Minimum Distance Between BST Nodes](https://leetcode.com/problems/minimum-distance-between-bst-nodes/) + +## 题目 + +Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. + +Example : + +```text +Input: root = [4,2,6,1,3,null,null] +Output: 1 +Explanation: +Note that root is a TreeNode object, not an array. + +The given tree [4,2,6,1,3,null,null] is represented by the following diagram: + + 4 + / \ + 2 6 + / \ + 1 3 + +while the minimum difference in this tree is 1, it occurs between node 1 and node 2, also between node 3 and node 2. +``` + +Note: + +1. The size of the BST will be between 2 and 100. +1. The BST is always valid, each node's value is an integer, and each node's value is different. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes.go b/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes.go new file mode 100755 index 000000000..f3f599814 --- /dev/null +++ b/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes.go @@ -0,0 +1,52 @@ +package problem0783 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ + +type TreeNode = kit.TreeNode + +func minDiffInBST(root *TreeNode) int { + res := 1<<63 - 1 + pre := 1>>63 + null := pre + + var helper func(*TreeNode) + helper = func (root *TreeNode) { + if root.Left != nil { + helper(root.Left) + } + + if pre != null{ + res = min(res, root.Val-pre) + } + + pre = root.Val + + if root.Right != nil { + helper(root.Right) + } + } + + helper(root) + + return res +} + + + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes_test.go b/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes_test.go new file mode 100755 index 000000000..a0041c62f --- /dev/null +++ b/Algorithms/0783.minimum-distance-between-bst-nodes/minimum-distance-between-bst-nodes_test.go @@ -0,0 +1,55 @@ +package problem0783 + +import ( + "fmt" + "github.com/aQuaYi/LeetCode-in-Go/kit" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre, in []int + ans int +}{ + + { + []int{27,34,58,50,44 }, + []int{27,34,44,50,58}, + 6, + }, + + { + []int{1, 0, 48, 12, 49}, + []int{0, 1, 12, 48, 49}, + 1, + }, + + { + []int{4, 2, 1, 3, 6}, + []int{1, 2, 3, 4, 6}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_minDiffInBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.PreIn2Tree(tc.pre, tc.in) + ast.Equal(tc.ans, minDiffInBST(root)) + } +} + +func Benchmark_minDiffInBST(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.PreIn2Tree(tc.pre, tc.in) + minDiffInBST(root) + } + } +} diff --git a/Algorithms/0784.letter-case-permutation/README.md b/Algorithms/0784.letter-case-permutation/README.md new file mode 100755 index 000000000..be541be59 --- /dev/null +++ b/Algorithms/0784.letter-case-permutation/README.md @@ -0,0 +1,27 @@ +# [784. Letter Case Permutation](https://leetcode.com/problems/letter-case-permutation/) + +## 题目 + +Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create. + +Examples: + +```text +Input: S = "a1b2" +Output: ["a1b2", "a1B2", "A1b2", "A1B2"] + +Input: S = "3z4" +Output: ["3z4", "3Z4"] + +Input: S = "12345" +Output: ["12345"] +``` + +Note: + +1. S will be a string with length at most 12. +1. S will consist only of letters or digits. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0784.letter-case-permutation/letter-case-permutation.go b/Algorithms/0784.letter-case-permutation/letter-case-permutation.go new file mode 100755 index 000000000..893397b9f --- /dev/null +++ b/Algorithms/0784.letter-case-permutation/letter-case-permutation.go @@ -0,0 +1,45 @@ +package problem0784 + +func letterCasePermutation(s string) []string { + size := len(s) + if size == 0 { + // 递归结束 + return []string{""} + } + + // 提取 s 的最后一个字符,作为后缀 + lastByte := s[size-1] + postfixs := make([]string, 1, 2) + postfixs[0] = string(lastByte) + // 如果最后一个字符是字母的话 + // 后缀,添加其另外一种书写形式 + if b, ok := check(lastByte); ok { + postfixs = append(postfixs, string(b)) + } + + // 利用递归,计算出 prefixs + prefixs := letterCasePermutation(s[:size-1]) + + // res 是 prefixs 和 postfixs 的乘积 + res := make([]string, 0, len(prefixs)*len(postfixs)) + + for _, pre := range prefixs { + for _, post := range postfixs { + res = append(res, pre+post) + } + } + + return res +} + +// 如果 b 是字母的话, +// 返回另外一种书写形式和 true +func check(b byte) (byte, bool) { + if 'a' <= b && b <= 'z' { + return b + 'A' - 'a', true + } + if 'A' <= b && b <= 'Z' { + return b + 'a' - 'A', true + } + return 0, false +} diff --git a/Algorithms/0784.letter-case-permutation/letter-case-permutation_test.go b/Algorithms/0784.letter-case-permutation/letter-case-permutation_test.go new file mode 100755 index 000000000..d1fb3eef6 --- /dev/null +++ b/Algorithms/0784.letter-case-permutation/letter-case-permutation_test.go @@ -0,0 +1,63 @@ +package problem0784 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans []string +}{ + + { + "A12", + []string{"a12", "A12"}, + }, + + { + "a1b2", + []string{"a1b2", "a1B2", "A1b2", "A1B2"}, + }, + + { + "3z4", + []string{"3z4", "3Z4"}, + }, + + { + "abcdefghijkl", + []string{"abcdefghijkl", "abcdefghijkL", "abcdefghijKl", "abcdefghijKL", "abcdefghiJkl", "abcdefghiJkL", "abcdefghiJKl", "abcdefghiJKL", "abcdefghIjkl", "abcdefghIjkL", "abcdefghIjKl", "abcdefghIjKL", "abcdefghIJkl", "abcdefghIJkL", "abcdefghIJKl", "abcdefghIJKL", "abcdefgHijkl", "abcdefgHijkL", "abcdefgHijKl", "abcdefgHijKL", "abcdefgHiJkl", "abcdefgHiJkL", "abcdefgHiJKl", "abcdefgHiJKL", "abcdefgHIjkl", "abcdefgHIjkL", "abcdefgHIjKl", "abcdefgHIjKL", "abcdefgHIJkl", "abcdefgHIJkL", "abcdefgHIJKl", "abcdefgHIJKL", "abcdefGhijkl", "abcdefGhijkL", "abcdefGhijKl", "abcdefGhijKL", "abcdefGhiJkl", "abcdefGhiJkL", "abcdefGhiJKl", "abcdefGhiJKL", "abcdefGhIjkl", "abcdefGhIjkL", "abcdefGhIjKl", "abcdefGhIjKL", "abcdefGhIJkl", "abcdefGhIJkL", "abcdefGhIJKl", "abcdefGhIJKL", "abcdefGHijkl", "abcdefGHijkL", "abcdefGHijKl", "abcdefGHijKL", "abcdefGHiJkl", "abcdefGHiJkL", "abcdefGHiJKl", "abcdefGHiJKL", "abcdefGHIjkl", "abcdefGHIjkL", "abcdefGHIjKl", "abcdefGHIjKL", "abcdefGHIJkl", "abcdefGHIJkL", "abcdefGHIJKl", "abcdefGHIJKL", "abcdeFghijkl", "abcdeFghijkL", "abcdeFghijKl", "abcdeFghijKL", "abcdeFghiJkl", "abcdeFghiJkL", "abcdeFghiJKl", "abcdeFghiJKL", "abcdeFghIjkl", "abcdeFghIjkL", "abcdeFghIjKl", "abcdeFghIjKL", "abcdeFghIJkl", "abcdeFghIJkL", "abcdeFghIJKl", "abcdeFghIJKL", "abcdeFgHijkl", "abcdeFgHijkL", "abcdeFgHijKl", "abcdeFgHijKL", "abcdeFgHiJkl", "abcdeFgHiJkL", "abcdeFgHiJKl", "abcdeFgHiJKL", "abcdeFgHIjkl", "abcdeFgHIjkL", "abcdeFgHIjKl", "abcdeFgHIjKL", "abcdeFgHIJkl", "abcdeFgHIJkL", "abcdeFgHIJKl", "abcdeFgHIJKL", "abcdeFGhijkl", "abcdeFGhijkL", "abcdeFGhijKl", "abcdeFGhijKL", "abcdeFGhiJkl", "abcdeFGhiJkL", "abcdeFGhiJKl", "abcdeFGhiJKL", "abcdeFGhIjkl", "abcdeFGhIjkL", "abcdeFGhIjKl", "abcdeFGhIjKL", "abcdeFGhIJkl", "abcdeFGhIJkL", "abcdeFGhIJKl", "abcdeFGhIJKL", "abcdeFGHijkl", "abcdeFGHijkL", "abcdeFGHijKl", "abcdeFGHijKL", "abcdeFGHiJkl", "abcdeFGHiJkL", "abcdeFGHiJKl", "abcdeFGHiJKL", "abcdeFGHIjkl", "abcdeFGHIjkL", "abcdeFGHIjKl", "abcdeFGHIjKL", "abcdeFGHIJkl", "abcdeFGHIJkL", "abcdeFGHIJKl", "abcdeFGHIJKL", "abcdEfghijkl", "abcdEfghijkL", "abcdEfghijKl", "abcdEfghijKL", "abcdEfghiJkl", "abcdEfghiJkL", "abcdEfghiJKl", "abcdEfghiJKL", "abcdEfghIjkl", "abcdEfghIjkL", "abcdEfghIjKl", "abcdEfghIjKL", "abcdEfghIJkl", "abcdEfghIJkL", "abcdEfghIJKl", "abcdEfghIJKL", "abcdEfgHijkl", "abcdEfgHijkL", "abcdEfgHijKl", "abcdEfgHijKL", "abcdEfgHiJkl", "abcdEfgHiJkL", "abcdEfgHiJKl", "abcdEfgHiJKL", "abcdEfgHIjkl", "abcdEfgHIjkL", "abcdEfgHIjKl", "abcdEfgHIjKL", "abcdEfgHIJkl", "abcdEfgHIJkL", "abcdEfgHIJKl", "abcdEfgHIJKL", "abcdEfGhijkl", "abcdEfGhijkL", "abcdEfGhijKl", "abcdEfGhijKL", "abcdEfGhiJkl", "abcdEfGhiJkL", "abcdEfGhiJKl", "abcdEfGhiJKL", "abcdEfGhIjkl", "abcdEfGhIjkL", "abcdEfGhIjKl", "abcdEfGhIjKL", "abcdEfGhIJkl", "abcdEfGhIJkL", "abcdEfGhIJKl", "abcdEfGhIJKL", "abcdEfGHijkl", "abcdEfGHijkL", "abcdEfGHijKl", "abcdEfGHijKL", "abcdEfGHiJkl", "abcdEfGHiJkL", "abcdEfGHiJKl", "abcdEfGHiJKL", "abcdEfGHIjkl", "abcdEfGHIjkL", "abcdEfGHIjKl", "abcdEfGHIjKL", "abcdEfGHIJkl", "abcdEfGHIJkL", "abcdEfGHIJKl", "abcdEfGHIJKL", "abcdEFghijkl", "abcdEFghijkL", "abcdEFghijKl", "abcdEFghijKL", "abcdEFghiJkl", "abcdEFghiJkL", "abcdEFghiJKl", "abcdEFghiJKL", "abcdEFghIjkl", "abcdEFghIjkL", "abcdEFghIjKl", "abcdEFghIjKL", "abcdEFghIJkl", "abcdEFghIJkL", "abcdEFghIJKl", "abcdEFghIJKL", "abcdEFgHijkl", "abcdEFgHijkL", "abcdEFgHijKl", "abcdEFgHijKL", "abcdEFgHiJkl", "abcdEFgHiJkL", "abcdEFgHiJKl", "abcdEFgHiJKL", "abcdEFgHIjkl", "abcdEFgHIjkL", "abcdEFgHIjKl", "abcdEFgHIjKL", "abcdEFgHIJkl", "abcdEFgHIJkL", "abcdEFgHIJKl", "abcdEFgHIJKL", "abcdEFGhijkl", "abcdEFGhijkL", "abcdEFGhijKl", "abcdEFGhijKL", "abcdEFGhiJkl", "abcdEFGhiJkL", "abcdEFGhiJKl", "abcdEFGhiJKL", "abcdEFGhIjkl", "abcdEFGhIjkL", "abcdEFGhIjKl", "abcdEFGhIjKL", "abcdEFGhIJkl", "abcdEFGhIJkL", "abcdEFGhIJKl", "abcdEFGhIJKL", "abcdEFGHijkl", "abcdEFGHijkL", "abcdEFGHijKl", "abcdEFGHijKL", "abcdEFGHiJkl", "abcdEFGHiJkL", "abcdEFGHiJKl", "abcdEFGHiJKL", "abcdEFGHIjkl", "abcdEFGHIjkL", "abcdEFGHIjKl", "abcdEFGHIjKL", "abcdEFGHIJkl", "abcdEFGHIJkL", "abcdEFGHIJKl", "abcdEFGHIJKL", "abcDefghijkl", "abcDefghijkL", "abcDefghijKl", "abcDefghijKL", "abcDefghiJkl", "abcDefghiJkL", "abcDefghiJKl", "abcDefghiJKL", "abcDefghIjkl", "abcDefghIjkL", "abcDefghIjKl", "abcDefghIjKL", "abcDefghIJkl", "abcDefghIJkL", "abcDefghIJKl", "abcDefghIJKL", "abcDefgHijkl", "abcDefgHijkL", "abcDefgHijKl", "abcDefgHijKL", "abcDefgHiJkl", "abcDefgHiJkL", "abcDefgHiJKl", "abcDefgHiJKL", "abcDefgHIjkl", "abcDefgHIjkL", "abcDefgHIjKl", "abcDefgHIjKL", "abcDefgHIJkl", "abcDefgHIJkL", "abcDefgHIJKl", "abcDefgHIJKL", "abcDefGhijkl", "abcDefGhijkL", "abcDefGhijKl", "abcDefGhijKL", "abcDefGhiJkl", "abcDefGhiJkL", "abcDefGhiJKl", "abcDefGhiJKL", "abcDefGhIjkl", "abcDefGhIjkL", "abcDefGhIjKl", "abcDefGhIjKL", "abcDefGhIJkl", "abcDefGhIJkL", "abcDefGhIJKl", "abcDefGhIJKL", "abcDefGHijkl", "abcDefGHijkL", "abcDefGHijKl", "abcDefGHijKL", "abcDefGHiJkl", "abcDefGHiJkL", "abcDefGHiJKl", "abcDefGHiJKL", "abcDefGHIjkl", "abcDefGHIjkL", "abcDefGHIjKl", "abcDefGHIjKL", "abcDefGHIJkl", "abcDefGHIJkL", "abcDefGHIJKl", "abcDefGHIJKL", "abcDeFghijkl", "abcDeFghijkL", "abcDeFghijKl", "abcDeFghijKL", "abcDeFghiJkl", "abcDeFghiJkL", "abcDeFghiJKl", "abcDeFghiJKL", "abcDeFghIjkl", "abcDeFghIjkL", "abcDeFghIjKl", "abcDeFghIjKL", "abcDeFghIJkl", "abcDeFghIJkL", "abcDeFghIJKl", "abcDeFghIJKL", "abcDeFgHijkl", "abcDeFgHijkL", "abcDeFgHijKl", "abcDeFgHijKL", "abcDeFgHiJkl", "abcDeFgHiJkL", "abcDeFgHiJKl", "abcDeFgHiJKL", "abcDeFgHIjkl", "abcDeFgHIjkL", "abcDeFgHIjKl", "abcDeFgHIjKL", "abcDeFgHIJkl", "abcDeFgHIJkL", "abcDeFgHIJKl", "abcDeFgHIJKL", "abcDeFGhijkl", "abcDeFGhijkL", "abcDeFGhijKl", "abcDeFGhijKL", "abcDeFGhiJkl", "abcDeFGhiJkL", "abcDeFGhiJKl", "abcDeFGhiJKL", "abcDeFGhIjkl", "abcDeFGhIjkL", "abcDeFGhIjKl", "abcDeFGhIjKL", "abcDeFGhIJkl", "abcDeFGhIJkL", "abcDeFGhIJKl", "abcDeFGhIJKL", "abcDeFGHijkl", "abcDeFGHijkL", "abcDeFGHijKl", "abcDeFGHijKL", "abcDeFGHiJkl", "abcDeFGHiJkL", "abcDeFGHiJKl", "abcDeFGHiJKL", "abcDeFGHIjkl", "abcDeFGHIjkL", "abcDeFGHIjKl", "abcDeFGHIjKL", "abcDeFGHIJkl", "abcDeFGHIJkL", "abcDeFGHIJKl", "abcDeFGHIJKL", "abcDEfghijkl", "abcDEfghijkL", "abcDEfghijKl", "abcDEfghijKL", "abcDEfghiJkl", "abcDEfghiJkL", "abcDEfghiJKl", "abcDEfghiJKL", "abcDEfghIjkl", "abcDEfghIjkL", "abcDEfghIjKl", "abcDEfghIjKL", "abcDEfghIJkl", "abcDEfghIJkL", "abcDEfghIJKl", "abcDEfghIJKL", "abcDEfgHijkl", "abcDEfgHijkL", "abcDEfgHijKl", "abcDEfgHijKL", "abcDEfgHiJkl", "abcDEfgHiJkL", "abcDEfgHiJKl", "abcDEfgHiJKL", "abcDEfgHIjkl", "abcDEfgHIjkL", "abcDEfgHIjKl", "abcDEfgHIjKL", "abcDEfgHIJkl", "abcDEfgHIJkL", "abcDEfgHIJKl", "abcDEfgHIJKL", "abcDEfGhijkl", "abcDEfGhijkL", "abcDEfGhijKl", "abcDEfGhijKL", "abcDEfGhiJkl", "abcDEfGhiJkL", "abcDEfGhiJKl", "abcDEfGhiJKL", "abcDEfGhIjkl", "abcDEfGhIjkL", "abcDEfGhIjKl", "abcDEfGhIjKL", "abcDEfGhIJkl", "abcDEfGhIJkL", "abcDEfGhIJKl", "abcDEfGhIJKL", "abcDEfGHijkl", "abcDEfGHijkL", "abcDEfGHijKl", "abcDEfGHijKL", "abcDEfGHiJkl", "abcDEfGHiJkL", "abcDEfGHiJKl", "abcDEfGHiJKL", "abcDEfGHIjkl", "abcDEfGHIjkL", "abcDEfGHIjKl", "abcDEfGHIjKL", "abcDEfGHIJkl", "abcDEfGHIJkL", "abcDEfGHIJKl", "abcDEfGHIJKL", "abcDEFghijkl", "abcDEFghijkL", "abcDEFghijKl", "abcDEFghijKL", "abcDEFghiJkl", "abcDEFghiJkL", "abcDEFghiJKl", "abcDEFghiJKL", "abcDEFghIjkl", "abcDEFghIjkL", "abcDEFghIjKl", "abcDEFghIjKL", "abcDEFghIJkl", "abcDEFghIJkL", "abcDEFghIJKl", "abcDEFghIJKL", "abcDEFgHijkl", "abcDEFgHijkL", "abcDEFgHijKl", "abcDEFgHijKL", "abcDEFgHiJkl", "abcDEFgHiJkL", "abcDEFgHiJKl", "abcDEFgHiJKL", "abcDEFgHIjkl", "abcDEFgHIjkL", "abcDEFgHIjKl", "abcDEFgHIjKL", "abcDEFgHIJkl", "abcDEFgHIJkL", "abcDEFgHIJKl", "abcDEFgHIJKL", "abcDEFGhijkl", "abcDEFGhijkL", "abcDEFGhijKl", "abcDEFGhijKL", "abcDEFGhiJkl", "abcDEFGhiJkL", "abcDEFGhiJKl", "abcDEFGhiJKL", "abcDEFGhIjkl", "abcDEFGhIjkL", "abcDEFGhIjKl", "abcDEFGhIjKL", "abcDEFGhIJkl", "abcDEFGhIJkL", "abcDEFGhIJKl", "abcDEFGhIJKL", "abcDEFGHijkl", "abcDEFGHijkL", "abcDEFGHijKl", "abcDEFGHijKL", "abcDEFGHiJkl", "abcDEFGHiJkL", "abcDEFGHiJKl", "abcDEFGHiJKL", "abcDEFGHIjkl", "abcDEFGHIjkL", "abcDEFGHIjKl", "abcDEFGHIjKL", "abcDEFGHIJkl", "abcDEFGHIJkL", "abcDEFGHIJKl", "abcDEFGHIJKL", "abCdefghijkl", "abCdefghijkL", "abCdefghijKl", "abCdefghijKL", "abCdefghiJkl", "abCdefghiJkL", "abCdefghiJKl", "abCdefghiJKL", "abCdefghIjkl", "abCdefghIjkL", "abCdefghIjKl", "abCdefghIjKL", "abCdefghIJkl", "abCdefghIJkL", "abCdefghIJKl", "abCdefghIJKL", "abCdefgHijkl", "abCdefgHijkL", "abCdefgHijKl", "abCdefgHijKL", "abCdefgHiJkl", "abCdefgHiJkL", "abCdefgHiJKl", "abCdefgHiJKL", "abCdefgHIjkl", "abCdefgHIjkL", "abCdefgHIjKl", "abCdefgHIjKL", "abCdefgHIJkl", "abCdefgHIJkL", "abCdefgHIJKl", "abCdefgHIJKL", "abCdefGhijkl", "abCdefGhijkL", "abCdefGhijKl", "abCdefGhijKL", "abCdefGhiJkl", "abCdefGhiJkL", "abCdefGhiJKl", "abCdefGhiJKL", "abCdefGhIjkl", "abCdefGhIjkL", "abCdefGhIjKl", "abCdefGhIjKL", "abCdefGhIJkl", "abCdefGhIJkL", "abCdefGhIJKl", "abCdefGhIJKL", "abCdefGHijkl", "abCdefGHijkL", "abCdefGHijKl", "abCdefGHijKL", "abCdefGHiJkl", "abCdefGHiJkL", "abCdefGHiJKl", "abCdefGHiJKL", "abCdefGHIjkl", "abCdefGHIjkL", "abCdefGHIjKl", "abCdefGHIjKL", "abCdefGHIJkl", "abCdefGHIJkL", "abCdefGHIJKl", "abCdefGHIJKL", "abCdeFghijkl", "abCdeFghijkL", "abCdeFghijKl", "abCdeFghijKL", "abCdeFghiJkl", "abCdeFghiJkL", "abCdeFghiJKl", "abCdeFghiJKL", "abCdeFghIjkl", "abCdeFghIjkL", "abCdeFghIjKl", "abCdeFghIjKL", "abCdeFghIJkl", "abCdeFghIJkL", "abCdeFghIJKl", "abCdeFghIJKL", "abCdeFgHijkl", "abCdeFgHijkL", "abCdeFgHijKl", "abCdeFgHijKL", "abCdeFgHiJkl", "abCdeFgHiJkL", "abCdeFgHiJKl", "abCdeFgHiJKL", "abCdeFgHIjkl", "abCdeFgHIjkL", "abCdeFgHIjKl", "abCdeFgHIjKL", "abCdeFgHIJkl", "abCdeFgHIJkL", "abCdeFgHIJKl", "abCdeFgHIJKL", "abCdeFGhijkl", "abCdeFGhijkL", "abCdeFGhijKl", "abCdeFGhijKL", "abCdeFGhiJkl", "abCdeFGhiJkL", "abCdeFGhiJKl", "abCdeFGhiJKL", "abCdeFGhIjkl", "abCdeFGhIjkL", "abCdeFGhIjKl", "abCdeFGhIjKL", "abCdeFGhIJkl", "abCdeFGhIJkL", "abCdeFGhIJKl", "abCdeFGhIJKL", "abCdeFGHijkl", "abCdeFGHijkL", "abCdeFGHijKl", "abCdeFGHijKL", "abCdeFGHiJkl", "abCdeFGHiJkL", "abCdeFGHiJKl", "abCdeFGHiJKL", "abCdeFGHIjkl", "abCdeFGHIjkL", "abCdeFGHIjKl", "abCdeFGHIjKL", "abCdeFGHIJkl", "abCdeFGHIJkL", "abCdeFGHIJKl", "abCdeFGHIJKL", "abCdEfghijkl", "abCdEfghijkL", "abCdEfghijKl", "abCdEfghijKL", "abCdEfghiJkl", "abCdEfghiJkL", "abCdEfghiJKl", "abCdEfghiJKL", "abCdEfghIjkl", "abCdEfghIjkL", "abCdEfghIjKl", "abCdEfghIjKL", "abCdEfghIJkl", "abCdEfghIJkL", "abCdEfghIJKl", "abCdEfghIJKL", "abCdEfgHijkl", "abCdEfgHijkL", "abCdEfgHijKl", "abCdEfgHijKL", "abCdEfgHiJkl", "abCdEfgHiJkL", "abCdEfgHiJKl", "abCdEfgHiJKL", "abCdEfgHIjkl", "abCdEfgHIjkL", "abCdEfgHIjKl", "abCdEfgHIjKL", "abCdEfgHIJkl", "abCdEfgHIJkL", "abCdEfgHIJKl", "abCdEfgHIJKL", "abCdEfGhijkl", "abCdEfGhijkL", "abCdEfGhijKl", "abCdEfGhijKL", "abCdEfGhiJkl", "abCdEfGhiJkL", "abCdEfGhiJKl", "abCdEfGhiJKL", "abCdEfGhIjkl", "abCdEfGhIjkL", "abCdEfGhIjKl", "abCdEfGhIjKL", "abCdEfGhIJkl", "abCdEfGhIJkL", "abCdEfGhIJKl", "abCdEfGhIJKL", "abCdEfGHijkl", "abCdEfGHijkL", "abCdEfGHijKl", "abCdEfGHijKL", "abCdEfGHiJkl", "abCdEfGHiJkL", "abCdEfGHiJKl", "abCdEfGHiJKL", "abCdEfGHIjkl", "abCdEfGHIjkL", "abCdEfGHIjKl", "abCdEfGHIjKL", "abCdEfGHIJkl", "abCdEfGHIJkL", "abCdEfGHIJKl", "abCdEfGHIJKL", "abCdEFghijkl", "abCdEFghijkL", "abCdEFghijKl", "abCdEFghijKL", "abCdEFghiJkl", "abCdEFghiJkL", "abCdEFghiJKl", "abCdEFghiJKL", "abCdEFghIjkl", "abCdEFghIjkL", "abCdEFghIjKl", "abCdEFghIjKL", "abCdEFghIJkl", "abCdEFghIJkL", "abCdEFghIJKl", "abCdEFghIJKL", "abCdEFgHijkl", "abCdEFgHijkL", "abCdEFgHijKl", "abCdEFgHijKL", "abCdEFgHiJkl", "abCdEFgHiJkL", "abCdEFgHiJKl", "abCdEFgHiJKL", "abCdEFgHIjkl", "abCdEFgHIjkL", "abCdEFgHIjKl", "abCdEFgHIjKL", "abCdEFgHIJkl", "abCdEFgHIJkL", "abCdEFgHIJKl", "abCdEFgHIJKL", "abCdEFGhijkl", "abCdEFGhijkL", "abCdEFGhijKl", "abCdEFGhijKL", "abCdEFGhiJkl", "abCdEFGhiJkL", "abCdEFGhiJKl", "abCdEFGhiJKL", "abCdEFGhIjkl", "abCdEFGhIjkL", "abCdEFGhIjKl", "abCdEFGhIjKL", "abCdEFGhIJkl", "abCdEFGhIJkL", "abCdEFGhIJKl", "abCdEFGhIJKL", "abCdEFGHijkl", "abCdEFGHijkL", "abCdEFGHijKl", "abCdEFGHijKL", "abCdEFGHiJkl", "abCdEFGHiJkL", "abCdEFGHiJKl", "abCdEFGHiJKL", "abCdEFGHIjkl", "abCdEFGHIjkL", "abCdEFGHIjKl", "abCdEFGHIjKL", "abCdEFGHIJkl", "abCdEFGHIJkL", "abCdEFGHIJKl", "abCdEFGHIJKL", "abCDefghijkl", "abCDefghijkL", "abCDefghijKl", "abCDefghijKL", "abCDefghiJkl", "abCDefghiJkL", "abCDefghiJKl", "abCDefghiJKL", "abCDefghIjkl", "abCDefghIjkL", "abCDefghIjKl", "abCDefghIjKL", "abCDefghIJkl", "abCDefghIJkL", "abCDefghIJKl", "abCDefghIJKL", "abCDefgHijkl", "abCDefgHijkL", "abCDefgHijKl", "abCDefgHijKL", "abCDefgHiJkl", "abCDefgHiJkL", "abCDefgHiJKl", "abCDefgHiJKL", "abCDefgHIjkl", "abCDefgHIjkL", "abCDefgHIjKl", "abCDefgHIjKL", "abCDefgHIJkl", "abCDefgHIJkL", "abCDefgHIJKl", "abCDefgHIJKL", "abCDefGhijkl", "abCDefGhijkL", "abCDefGhijKl", "abCDefGhijKL", "abCDefGhiJkl", "abCDefGhiJkL", "abCDefGhiJKl", "abCDefGhiJKL", "abCDefGhIjkl", "abCDefGhIjkL", "abCDefGhIjKl", "abCDefGhIjKL", "abCDefGhIJkl", "abCDefGhIJkL", "abCDefGhIJKl", "abCDefGhIJKL", "abCDefGHijkl", "abCDefGHijkL", "abCDefGHijKl", "abCDefGHijKL", "abCDefGHiJkl", "abCDefGHiJkL", "abCDefGHiJKl", "abCDefGHiJKL", "abCDefGHIjkl", "abCDefGHIjkL", "abCDefGHIjKl", "abCDefGHIjKL", "abCDefGHIJkl", "abCDefGHIJkL", "abCDefGHIJKl", "abCDefGHIJKL", "abCDeFghijkl", "abCDeFghijkL", "abCDeFghijKl", "abCDeFghijKL", "abCDeFghiJkl", "abCDeFghiJkL", "abCDeFghiJKl", "abCDeFghiJKL", "abCDeFghIjkl", "abCDeFghIjkL", "abCDeFghIjKl", "abCDeFghIjKL", "abCDeFghIJkl", "abCDeFghIJkL", "abCDeFghIJKl", "abCDeFghIJKL", "abCDeFgHijkl", "abCDeFgHijkL", "abCDeFgHijKl", "abCDeFgHijKL", "abCDeFgHiJkl", "abCDeFgHiJkL", "abCDeFgHiJKl", "abCDeFgHiJKL", "abCDeFgHIjkl", "abCDeFgHIjkL", "abCDeFgHIjKl", "abCDeFgHIjKL", "abCDeFgHIJkl", "abCDeFgHIJkL", "abCDeFgHIJKl", "abCDeFgHIJKL", "abCDeFGhijkl", "abCDeFGhijkL", "abCDeFGhijKl", "abCDeFGhijKL", "abCDeFGhiJkl", "abCDeFGhiJkL", "abCDeFGhiJKl", "abCDeFGhiJKL", "abCDeFGhIjkl", "abCDeFGhIjkL", "abCDeFGhIjKl", "abCDeFGhIjKL", "abCDeFGhIJkl", "abCDeFGhIJkL", "abCDeFGhIJKl", "abCDeFGhIJKL", "abCDeFGHijkl", "abCDeFGHijkL", "abCDeFGHijKl", "abCDeFGHijKL", "abCDeFGHiJkl", "abCDeFGHiJkL", "abCDeFGHiJKl", "abCDeFGHiJKL", "abCDeFGHIjkl", "abCDeFGHIjkL", "abCDeFGHIjKl", "abCDeFGHIjKL", "abCDeFGHIJkl", "abCDeFGHIJkL", "abCDeFGHIJKl", "abCDeFGHIJKL", "abCDEfghijkl", "abCDEfghijkL", "abCDEfghijKl", "abCDEfghijKL", "abCDEfghiJkl", "abCDEfghiJkL", "abCDEfghiJKl", "abCDEfghiJKL", "abCDEfghIjkl", "abCDEfghIjkL", "abCDEfghIjKl", "abCDEfghIjKL", "abCDEfghIJkl", "abCDEfghIJkL", "abCDEfghIJKl", "abCDEfghIJKL", "abCDEfgHijkl", "abCDEfgHijkL", "abCDEfgHijKl", "abCDEfgHijKL", "abCDEfgHiJkl", "abCDEfgHiJkL", "abCDEfgHiJKl", "abCDEfgHiJKL", "abCDEfgHIjkl", "abCDEfgHIjkL", "abCDEfgHIjKl", "abCDEfgHIjKL", "abCDEfgHIJkl", "abCDEfgHIJkL", "abCDEfgHIJKl", "abCDEfgHIJKL", "abCDEfGhijkl", "abCDEfGhijkL", "abCDEfGhijKl", "abCDEfGhijKL", "abCDEfGhiJkl", "abCDEfGhiJkL", "abCDEfGhiJKl", "abCDEfGhiJKL", "abCDEfGhIjkl", "abCDEfGhIjkL", "abCDEfGhIjKl", "abCDEfGhIjKL", "abCDEfGhIJkl", "abCDEfGhIJkL", "abCDEfGhIJKl", "abCDEfGhIJKL", "abCDEfGHijkl", "abCDEfGHijkL", "abCDEfGHijKl", "abCDEfGHijKL", "abCDEfGHiJkl", "abCDEfGHiJkL", "abCDEfGHiJKl", "abCDEfGHiJKL", "abCDEfGHIjkl", "abCDEfGHIjkL", "abCDEfGHIjKl", "abCDEfGHIjKL", "abCDEfGHIJkl", "abCDEfGHIJkL", "abCDEfGHIJKl", "abCDEfGHIJKL", "abCDEFghijkl", "abCDEFghijkL", "abCDEFghijKl", "abCDEFghijKL", "abCDEFghiJkl", "abCDEFghiJkL", "abCDEFghiJKl", "abCDEFghiJKL", "abCDEFghIjkl", "abCDEFghIjkL", "abCDEFghIjKl", "abCDEFghIjKL", "abCDEFghIJkl", "abCDEFghIJkL", "abCDEFghIJKl", "abCDEFghIJKL", "abCDEFgHijkl", "abCDEFgHijkL", "abCDEFgHijKl", "abCDEFgHijKL", "abCDEFgHiJkl", "abCDEFgHiJkL", "abCDEFgHiJKl", "abCDEFgHiJKL", "abCDEFgHIjkl", "abCDEFgHIjkL", "abCDEFgHIjKl", "abCDEFgHIjKL", "abCDEFgHIJkl", "abCDEFgHIJkL", "abCDEFgHIJKl", "abCDEFgHIJKL", "abCDEFGhijkl", "abCDEFGhijkL", "abCDEFGhijKl", "abCDEFGhijKL", "abCDEFGhiJkl", "abCDEFGhiJkL", "abCDEFGhiJKl", "abCDEFGhiJKL", "abCDEFGhIjkl", "abCDEFGhIjkL", "abCDEFGhIjKl", "abCDEFGhIjKL", "abCDEFGhIJkl", "abCDEFGhIJkL", "abCDEFGhIJKl", "abCDEFGhIJKL", "abCDEFGHijkl", "abCDEFGHijkL", "abCDEFGHijKl", "abCDEFGHijKL", "abCDEFGHiJkl", "abCDEFGHiJkL", "abCDEFGHiJKl", "abCDEFGHiJKL", "abCDEFGHIjkl", "abCDEFGHIjkL", "abCDEFGHIjKl", "abCDEFGHIjKL", "abCDEFGHIJkl", "abCDEFGHIJkL", "abCDEFGHIJKl", "abCDEFGHIJKL", "aBcdefghijkl", "aBcdefghijkL", "aBcdefghijKl", "aBcdefghijKL", "aBcdefghiJkl", "aBcdefghiJkL", "aBcdefghiJKl", "aBcdefghiJKL", "aBcdefghIjkl", "aBcdefghIjkL", "aBcdefghIjKl", "aBcdefghIjKL", "aBcdefghIJkl", "aBcdefghIJkL", "aBcdefghIJKl", "aBcdefghIJKL", "aBcdefgHijkl", "aBcdefgHijkL", "aBcdefgHijKl", "aBcdefgHijKL", "aBcdefgHiJkl", "aBcdefgHiJkL", "aBcdefgHiJKl", "aBcdefgHiJKL", "aBcdefgHIjkl", "aBcdefgHIjkL", "aBcdefgHIjKl", "aBcdefgHIjKL", "aBcdefgHIJkl", "aBcdefgHIJkL", "aBcdefgHIJKl", "aBcdefgHIJKL", "aBcdefGhijkl", "aBcdefGhijkL", "aBcdefGhijKl", "aBcdefGhijKL", "aBcdefGhiJkl", "aBcdefGhiJkL", "aBcdefGhiJKl", "aBcdefGhiJKL", "aBcdefGhIjkl", "aBcdefGhIjkL", "aBcdefGhIjKl", "aBcdefGhIjKL", "aBcdefGhIJkl", "aBcdefGhIJkL", "aBcdefGhIJKl", "aBcdefGhIJKL", "aBcdefGHijkl", "aBcdefGHijkL", "aBcdefGHijKl", "aBcdefGHijKL", "aBcdefGHiJkl", "aBcdefGHiJkL", "aBcdefGHiJKl", "aBcdefGHiJKL", "aBcdefGHIjkl", "aBcdefGHIjkL", "aBcdefGHIjKl", "aBcdefGHIjKL", "aBcdefGHIJkl", "aBcdefGHIJkL", "aBcdefGHIJKl", "aBcdefGHIJKL", "aBcdeFghijkl", "aBcdeFghijkL", "aBcdeFghijKl", "aBcdeFghijKL", "aBcdeFghiJkl", "aBcdeFghiJkL", "aBcdeFghiJKl", "aBcdeFghiJKL", "aBcdeFghIjkl", "aBcdeFghIjkL", "aBcdeFghIjKl", "aBcdeFghIjKL", "aBcdeFghIJkl", "aBcdeFghIJkL", "aBcdeFghIJKl", "aBcdeFghIJKL", "aBcdeFgHijkl", "aBcdeFgHijkL", "aBcdeFgHijKl", "aBcdeFgHijKL", "aBcdeFgHiJkl", "aBcdeFgHiJkL", "aBcdeFgHiJKl", "aBcdeFgHiJKL", "aBcdeFgHIjkl", "aBcdeFgHIjkL", "aBcdeFgHIjKl", "aBcdeFgHIjKL", "aBcdeFgHIJkl", "aBcdeFgHIJkL", "aBcdeFgHIJKl", "aBcdeFgHIJKL", "aBcdeFGhijkl", "aBcdeFGhijkL", "aBcdeFGhijKl", "aBcdeFGhijKL", "aBcdeFGhiJkl", "aBcdeFGhiJkL", "aBcdeFGhiJKl", "aBcdeFGhiJKL", "aBcdeFGhIjkl", "aBcdeFGhIjkL", "aBcdeFGhIjKl", "aBcdeFGhIjKL", "aBcdeFGhIJkl", "aBcdeFGhIJkL", "aBcdeFGhIJKl", "aBcdeFGhIJKL", "aBcdeFGHijkl", "aBcdeFGHijkL", "aBcdeFGHijKl", "aBcdeFGHijKL", "aBcdeFGHiJkl", "aBcdeFGHiJkL", "aBcdeFGHiJKl", "aBcdeFGHiJKL", "aBcdeFGHIjkl", "aBcdeFGHIjkL", "aBcdeFGHIjKl", "aBcdeFGHIjKL", "aBcdeFGHIJkl", "aBcdeFGHIJkL", "aBcdeFGHIJKl", "aBcdeFGHIJKL", "aBcdEfghijkl", "aBcdEfghijkL", "aBcdEfghijKl", "aBcdEfghijKL", "aBcdEfghiJkl", "aBcdEfghiJkL", "aBcdEfghiJKl", "aBcdEfghiJKL", "aBcdEfghIjkl", "aBcdEfghIjkL", "aBcdEfghIjKl", "aBcdEfghIjKL", "aBcdEfghIJkl", "aBcdEfghIJkL", "aBcdEfghIJKl", "aBcdEfghIJKL", "aBcdEfgHijkl", "aBcdEfgHijkL", "aBcdEfgHijKl", "aBcdEfgHijKL", "aBcdEfgHiJkl", "aBcdEfgHiJkL", "aBcdEfgHiJKl", "aBcdEfgHiJKL", "aBcdEfgHIjkl", "aBcdEfgHIjkL", "aBcdEfgHIjKl", "aBcdEfgHIjKL", "aBcdEfgHIJkl", "aBcdEfgHIJkL", "aBcdEfgHIJKl", "aBcdEfgHIJKL", "aBcdEfGhijkl", "aBcdEfGhijkL", "aBcdEfGhijKl", "aBcdEfGhijKL", "aBcdEfGhiJkl", "aBcdEfGhiJkL", "aBcdEfGhiJKl", "aBcdEfGhiJKL", "aBcdEfGhIjkl", "aBcdEfGhIjkL", "aBcdEfGhIjKl", "aBcdEfGhIjKL", "aBcdEfGhIJkl", "aBcdEfGhIJkL", "aBcdEfGhIJKl", "aBcdEfGhIJKL", "aBcdEfGHijkl", "aBcdEfGHijkL", "aBcdEfGHijKl", "aBcdEfGHijKL", "aBcdEfGHiJkl", "aBcdEfGHiJkL", "aBcdEfGHiJKl", "aBcdEfGHiJKL", "aBcdEfGHIjkl", "aBcdEfGHIjkL", "aBcdEfGHIjKl", "aBcdEfGHIjKL", "aBcdEfGHIJkl", "aBcdEfGHIJkL", "aBcdEfGHIJKl", "aBcdEfGHIJKL", "aBcdEFghijkl", "aBcdEFghijkL", "aBcdEFghijKl", "aBcdEFghijKL", "aBcdEFghiJkl", "aBcdEFghiJkL", "aBcdEFghiJKl", "aBcdEFghiJKL", "aBcdEFghIjkl", "aBcdEFghIjkL", "aBcdEFghIjKl", "aBcdEFghIjKL", "aBcdEFghIJkl", "aBcdEFghIJkL", "aBcdEFghIJKl", "aBcdEFghIJKL", "aBcdEFgHijkl", "aBcdEFgHijkL", "aBcdEFgHijKl", "aBcdEFgHijKL", "aBcdEFgHiJkl", "aBcdEFgHiJkL", "aBcdEFgHiJKl", "aBcdEFgHiJKL", "aBcdEFgHIjkl", "aBcdEFgHIjkL", "aBcdEFgHIjKl", "aBcdEFgHIjKL", "aBcdEFgHIJkl", "aBcdEFgHIJkL", "aBcdEFgHIJKl", "aBcdEFgHIJKL", "aBcdEFGhijkl", "aBcdEFGhijkL", "aBcdEFGhijKl", "aBcdEFGhijKL", "aBcdEFGhiJkl", "aBcdEFGhiJkL", "aBcdEFGhiJKl", "aBcdEFGhiJKL", "aBcdEFGhIjkl", "aBcdEFGhIjkL", "aBcdEFGhIjKl", "aBcdEFGhIjKL", "aBcdEFGhIJkl", "aBcdEFGhIJkL", "aBcdEFGhIJKl", "aBcdEFGhIJKL", "aBcdEFGHijkl", "aBcdEFGHijkL", "aBcdEFGHijKl", "aBcdEFGHijKL", "aBcdEFGHiJkl", "aBcdEFGHiJkL", "aBcdEFGHiJKl", "aBcdEFGHiJKL", "aBcdEFGHIjkl", "aBcdEFGHIjkL", "aBcdEFGHIjKl", "aBcdEFGHIjKL", "aBcdEFGHIJkl", "aBcdEFGHIJkL", "aBcdEFGHIJKl", "aBcdEFGHIJKL", "aBcDefghijkl", "aBcDefghijkL", "aBcDefghijKl", "aBcDefghijKL", "aBcDefghiJkl", "aBcDefghiJkL", "aBcDefghiJKl", "aBcDefghiJKL", "aBcDefghIjkl", "aBcDefghIjkL", "aBcDefghIjKl", "aBcDefghIjKL", "aBcDefghIJkl", "aBcDefghIJkL", "aBcDefghIJKl", "aBcDefghIJKL", "aBcDefgHijkl", "aBcDefgHijkL", "aBcDefgHijKl", "aBcDefgHijKL", "aBcDefgHiJkl", "aBcDefgHiJkL", "aBcDefgHiJKl", "aBcDefgHiJKL", "aBcDefgHIjkl", "aBcDefgHIjkL", "aBcDefgHIjKl", "aBcDefgHIjKL", "aBcDefgHIJkl", "aBcDefgHIJkL", "aBcDefgHIJKl", "aBcDefgHIJKL", "aBcDefGhijkl", "aBcDefGhijkL", "aBcDefGhijKl", "aBcDefGhijKL", "aBcDefGhiJkl", "aBcDefGhiJkL", "aBcDefGhiJKl", "aBcDefGhiJKL", "aBcDefGhIjkl", "aBcDefGhIjkL", "aBcDefGhIjKl", "aBcDefGhIjKL", "aBcDefGhIJkl", "aBcDefGhIJkL", "aBcDefGhIJKl", "aBcDefGhIJKL", "aBcDefGHijkl", "aBcDefGHijkL", "aBcDefGHijKl", "aBcDefGHijKL", "aBcDefGHiJkl", "aBcDefGHiJkL", "aBcDefGHiJKl", "aBcDefGHiJKL", "aBcDefGHIjkl", "aBcDefGHIjkL", "aBcDefGHIjKl", "aBcDefGHIjKL", "aBcDefGHIJkl", "aBcDefGHIJkL", "aBcDefGHIJKl", "aBcDefGHIJKL", "aBcDeFghijkl", "aBcDeFghijkL", "aBcDeFghijKl", "aBcDeFghijKL", "aBcDeFghiJkl", "aBcDeFghiJkL", "aBcDeFghiJKl", "aBcDeFghiJKL", "aBcDeFghIjkl", "aBcDeFghIjkL", "aBcDeFghIjKl", "aBcDeFghIjKL", "aBcDeFghIJkl", "aBcDeFghIJkL", "aBcDeFghIJKl", "aBcDeFghIJKL", "aBcDeFgHijkl", "aBcDeFgHijkL", "aBcDeFgHijKl", "aBcDeFgHijKL", "aBcDeFgHiJkl", "aBcDeFgHiJkL", "aBcDeFgHiJKl", "aBcDeFgHiJKL", "aBcDeFgHIjkl", "aBcDeFgHIjkL", "aBcDeFgHIjKl", "aBcDeFgHIjKL", "aBcDeFgHIJkl", "aBcDeFgHIJkL", "aBcDeFgHIJKl", "aBcDeFgHIJKL", "aBcDeFGhijkl", "aBcDeFGhijkL", "aBcDeFGhijKl", "aBcDeFGhijKL", "aBcDeFGhiJkl", "aBcDeFGhiJkL", "aBcDeFGhiJKl", "aBcDeFGhiJKL", "aBcDeFGhIjkl", "aBcDeFGhIjkL", "aBcDeFGhIjKl", "aBcDeFGhIjKL", "aBcDeFGhIJkl", "aBcDeFGhIJkL", "aBcDeFGhIJKl", "aBcDeFGhIJKL", "aBcDeFGHijkl", "aBcDeFGHijkL", "aBcDeFGHijKl", "aBcDeFGHijKL", "aBcDeFGHiJkl", "aBcDeFGHiJkL", "aBcDeFGHiJKl", "aBcDeFGHiJKL", "aBcDeFGHIjkl", "aBcDeFGHIjkL", "aBcDeFGHIjKl", "aBcDeFGHIjKL", "aBcDeFGHIJkl", "aBcDeFGHIJkL", "aBcDeFGHIJKl", "aBcDeFGHIJKL", "aBcDEfghijkl", "aBcDEfghijkL", "aBcDEfghijKl", "aBcDEfghijKL", "aBcDEfghiJkl", "aBcDEfghiJkL", "aBcDEfghiJKl", "aBcDEfghiJKL", "aBcDEfghIjkl", "aBcDEfghIjkL", "aBcDEfghIjKl", "aBcDEfghIjKL", "aBcDEfghIJkl", "aBcDEfghIJkL", "aBcDEfghIJKl", "aBcDEfghIJKL", "aBcDEfgHijkl", "aBcDEfgHijkL", "aBcDEfgHijKl", "aBcDEfgHijKL", "aBcDEfgHiJkl", "aBcDEfgHiJkL", "aBcDEfgHiJKl", "aBcDEfgHiJKL", "aBcDEfgHIjkl", "aBcDEfgHIjkL", "aBcDEfgHIjKl", "aBcDEfgHIjKL", "aBcDEfgHIJkl", "aBcDEfgHIJkL", "aBcDEfgHIJKl", "aBcDEfgHIJKL", "aBcDEfGhijkl", "aBcDEfGhijkL", "aBcDEfGhijKl", "aBcDEfGhijKL", "aBcDEfGhiJkl", "aBcDEfGhiJkL", "aBcDEfGhiJKl", "aBcDEfGhiJKL", "aBcDEfGhIjkl", "aBcDEfGhIjkL", "aBcDEfGhIjKl", "aBcDEfGhIjKL", "aBcDEfGhIJkl", "aBcDEfGhIJkL", "aBcDEfGhIJKl", "aBcDEfGhIJKL", "aBcDEfGHijkl", "aBcDEfGHijkL", "aBcDEfGHijKl", "aBcDEfGHijKL", "aBcDEfGHiJkl", "aBcDEfGHiJkL", "aBcDEfGHiJKl", "aBcDEfGHiJKL", "aBcDEfGHIjkl", "aBcDEfGHIjkL", "aBcDEfGHIjKl", "aBcDEfGHIjKL", "aBcDEfGHIJkl", "aBcDEfGHIJkL", "aBcDEfGHIJKl", "aBcDEfGHIJKL", "aBcDEFghijkl", "aBcDEFghijkL", "aBcDEFghijKl", "aBcDEFghijKL", "aBcDEFghiJkl", "aBcDEFghiJkL", "aBcDEFghiJKl", "aBcDEFghiJKL", "aBcDEFghIjkl", "aBcDEFghIjkL", "aBcDEFghIjKl", "aBcDEFghIjKL", "aBcDEFghIJkl", "aBcDEFghIJkL", "aBcDEFghIJKl", "aBcDEFghIJKL", "aBcDEFgHijkl", "aBcDEFgHijkL", "aBcDEFgHijKl", "aBcDEFgHijKL", "aBcDEFgHiJkl", "aBcDEFgHiJkL", "aBcDEFgHiJKl", "aBcDEFgHiJKL", "aBcDEFgHIjkl", "aBcDEFgHIjkL", "aBcDEFgHIjKl", "aBcDEFgHIjKL", "aBcDEFgHIJkl", "aBcDEFgHIJkL", "aBcDEFgHIJKl", "aBcDEFgHIJKL", "aBcDEFGhijkl", "aBcDEFGhijkL", "aBcDEFGhijKl", "aBcDEFGhijKL", "aBcDEFGhiJkl", "aBcDEFGhiJkL", "aBcDEFGhiJKl", "aBcDEFGhiJKL", "aBcDEFGhIjkl", "aBcDEFGhIjkL", "aBcDEFGhIjKl", "aBcDEFGhIjKL", "aBcDEFGhIJkl", "aBcDEFGhIJkL", "aBcDEFGhIJKl", "aBcDEFGhIJKL", "aBcDEFGHijkl", "aBcDEFGHijkL", "aBcDEFGHijKl", "aBcDEFGHijKL", "aBcDEFGHiJkl", "aBcDEFGHiJkL", "aBcDEFGHiJKl", "aBcDEFGHiJKL", "aBcDEFGHIjkl", "aBcDEFGHIjkL", "aBcDEFGHIjKl", "aBcDEFGHIjKL", "aBcDEFGHIJkl", "aBcDEFGHIJkL", "aBcDEFGHIJKl", "aBcDEFGHIJKL", "aBCdefghijkl", "aBCdefghijkL", "aBCdefghijKl", "aBCdefghijKL", "aBCdefghiJkl", "aBCdefghiJkL", "aBCdefghiJKl", "aBCdefghiJKL", "aBCdefghIjkl", "aBCdefghIjkL", "aBCdefghIjKl", "aBCdefghIjKL", "aBCdefghIJkl", "aBCdefghIJkL", "aBCdefghIJKl", "aBCdefghIJKL", "aBCdefgHijkl", "aBCdefgHijkL", "aBCdefgHijKl", "aBCdefgHijKL", "aBCdefgHiJkl", "aBCdefgHiJkL", "aBCdefgHiJKl", "aBCdefgHiJKL", "aBCdefgHIjkl", "aBCdefgHIjkL", "aBCdefgHIjKl", "aBCdefgHIjKL", "aBCdefgHIJkl", "aBCdefgHIJkL", "aBCdefgHIJKl", "aBCdefgHIJKL", "aBCdefGhijkl", "aBCdefGhijkL", "aBCdefGhijKl", "aBCdefGhijKL", "aBCdefGhiJkl", "aBCdefGhiJkL", "aBCdefGhiJKl", "aBCdefGhiJKL", "aBCdefGhIjkl", "aBCdefGhIjkL", "aBCdefGhIjKl", "aBCdefGhIjKL", "aBCdefGhIJkl", "aBCdefGhIJkL", "aBCdefGhIJKl", "aBCdefGhIJKL", "aBCdefGHijkl", "aBCdefGHijkL", "aBCdefGHijKl", "aBCdefGHijKL", "aBCdefGHiJkl", "aBCdefGHiJkL", "aBCdefGHiJKl", "aBCdefGHiJKL", "aBCdefGHIjkl", "aBCdefGHIjkL", "aBCdefGHIjKl", "aBCdefGHIjKL", "aBCdefGHIJkl", "aBCdefGHIJkL", "aBCdefGHIJKl", "aBCdefGHIJKL", "aBCdeFghijkl", "aBCdeFghijkL", "aBCdeFghijKl", "aBCdeFghijKL", "aBCdeFghiJkl", "aBCdeFghiJkL", "aBCdeFghiJKl", "aBCdeFghiJKL", "aBCdeFghIjkl", "aBCdeFghIjkL", "aBCdeFghIjKl", "aBCdeFghIjKL", "aBCdeFghIJkl", "aBCdeFghIJkL", "aBCdeFghIJKl", "aBCdeFghIJKL", "aBCdeFgHijkl", "aBCdeFgHijkL", "aBCdeFgHijKl", "aBCdeFgHijKL", "aBCdeFgHiJkl", "aBCdeFgHiJkL", "aBCdeFgHiJKl", "aBCdeFgHiJKL", "aBCdeFgHIjkl", "aBCdeFgHIjkL", "aBCdeFgHIjKl", "aBCdeFgHIjKL", "aBCdeFgHIJkl", "aBCdeFgHIJkL", "aBCdeFgHIJKl", "aBCdeFgHIJKL", "aBCdeFGhijkl", "aBCdeFGhijkL", "aBCdeFGhijKl", "aBCdeFGhijKL", "aBCdeFGhiJkl", "aBCdeFGhiJkL", "aBCdeFGhiJKl", "aBCdeFGhiJKL", "aBCdeFGhIjkl", "aBCdeFGhIjkL", "aBCdeFGhIjKl", "aBCdeFGhIjKL", "aBCdeFGhIJkl", "aBCdeFGhIJkL", "aBCdeFGhIJKl", "aBCdeFGhIJKL", "aBCdeFGHijkl", "aBCdeFGHijkL", "aBCdeFGHijKl", "aBCdeFGHijKL", "aBCdeFGHiJkl", "aBCdeFGHiJkL", "aBCdeFGHiJKl", "aBCdeFGHiJKL", "aBCdeFGHIjkl", "aBCdeFGHIjkL", "aBCdeFGHIjKl", "aBCdeFGHIjKL", "aBCdeFGHIJkl", "aBCdeFGHIJkL", "aBCdeFGHIJKl", "aBCdeFGHIJKL", "aBCdEfghijkl", "aBCdEfghijkL", "aBCdEfghijKl", "aBCdEfghijKL", "aBCdEfghiJkl", "aBCdEfghiJkL", "aBCdEfghiJKl", "aBCdEfghiJKL", "aBCdEfghIjkl", "aBCdEfghIjkL", "aBCdEfghIjKl", "aBCdEfghIjKL", "aBCdEfghIJkl", "aBCdEfghIJkL", "aBCdEfghIJKl", "aBCdEfghIJKL", "aBCdEfgHijkl", "aBCdEfgHijkL", "aBCdEfgHijKl", "aBCdEfgHijKL", "aBCdEfgHiJkl", "aBCdEfgHiJkL", "aBCdEfgHiJKl", "aBCdEfgHiJKL", "aBCdEfgHIjkl", "aBCdEfgHIjkL", "aBCdEfgHIjKl", "aBCdEfgHIjKL", "aBCdEfgHIJkl", "aBCdEfgHIJkL", "aBCdEfgHIJKl", "aBCdEfgHIJKL", "aBCdEfGhijkl", "aBCdEfGhijkL", "aBCdEfGhijKl", "aBCdEfGhijKL", "aBCdEfGhiJkl", "aBCdEfGhiJkL", "aBCdEfGhiJKl", "aBCdEfGhiJKL", "aBCdEfGhIjkl", "aBCdEfGhIjkL", "aBCdEfGhIjKl", "aBCdEfGhIjKL", "aBCdEfGhIJkl", "aBCdEfGhIJkL", "aBCdEfGhIJKl", "aBCdEfGhIJKL", "aBCdEfGHijkl", "aBCdEfGHijkL", "aBCdEfGHijKl", "aBCdEfGHijKL", "aBCdEfGHiJkl", "aBCdEfGHiJkL", "aBCdEfGHiJKl", "aBCdEfGHiJKL", "aBCdEfGHIjkl", "aBCdEfGHIjkL", "aBCdEfGHIjKl", "aBCdEfGHIjKL", "aBCdEfGHIJkl", "aBCdEfGHIJkL", "aBCdEfGHIJKl", "aBCdEfGHIJKL", "aBCdEFghijkl", "aBCdEFghijkL", "aBCdEFghijKl", "aBCdEFghijKL", "aBCdEFghiJkl", "aBCdEFghiJkL", "aBCdEFghiJKl", "aBCdEFghiJKL", "aBCdEFghIjkl", "aBCdEFghIjkL", "aBCdEFghIjKl", "aBCdEFghIjKL", "aBCdEFghIJkl", "aBCdEFghIJkL", "aBCdEFghIJKl", "aBCdEFghIJKL", "aBCdEFgHijkl", "aBCdEFgHijkL", "aBCdEFgHijKl", "aBCdEFgHijKL", "aBCdEFgHiJkl", "aBCdEFgHiJkL", "aBCdEFgHiJKl", "aBCdEFgHiJKL", "aBCdEFgHIjkl", "aBCdEFgHIjkL", "aBCdEFgHIjKl", "aBCdEFgHIjKL", "aBCdEFgHIJkl", "aBCdEFgHIJkL", "aBCdEFgHIJKl", "aBCdEFgHIJKL", "aBCdEFGhijkl", "aBCdEFGhijkL", "aBCdEFGhijKl", "aBCdEFGhijKL", "aBCdEFGhiJkl", "aBCdEFGhiJkL", "aBCdEFGhiJKl", "aBCdEFGhiJKL", "aBCdEFGhIjkl", "aBCdEFGhIjkL", "aBCdEFGhIjKl", "aBCdEFGhIjKL", "aBCdEFGhIJkl", "aBCdEFGhIJkL", "aBCdEFGhIJKl", "aBCdEFGhIJKL", "aBCdEFGHijkl", "aBCdEFGHijkL", "aBCdEFGHijKl", "aBCdEFGHijKL", "aBCdEFGHiJkl", "aBCdEFGHiJkL", "aBCdEFGHiJKl", "aBCdEFGHiJKL", "aBCdEFGHIjkl", "aBCdEFGHIjkL", "aBCdEFGHIjKl", "aBCdEFGHIjKL", "aBCdEFGHIJkl", "aBCdEFGHIJkL", "aBCdEFGHIJKl", "aBCdEFGHIJKL", "aBCDefghijkl", "aBCDefghijkL", "aBCDefghijKl", "aBCDefghijKL", "aBCDefghiJkl", "aBCDefghiJkL", "aBCDefghiJKl", "aBCDefghiJKL", "aBCDefghIjkl", "aBCDefghIjkL", "aBCDefghIjKl", "aBCDefghIjKL", "aBCDefghIJkl", "aBCDefghIJkL", "aBCDefghIJKl", "aBCDefghIJKL", "aBCDefgHijkl", "aBCDefgHijkL", "aBCDefgHijKl", "aBCDefgHijKL", "aBCDefgHiJkl", "aBCDefgHiJkL", "aBCDefgHiJKl", "aBCDefgHiJKL", "aBCDefgHIjkl", "aBCDefgHIjkL", "aBCDefgHIjKl", "aBCDefgHIjKL", "aBCDefgHIJkl", "aBCDefgHIJkL", "aBCDefgHIJKl", "aBCDefgHIJKL", "aBCDefGhijkl", "aBCDefGhijkL", "aBCDefGhijKl", "aBCDefGhijKL", "aBCDefGhiJkl", "aBCDefGhiJkL", "aBCDefGhiJKl", "aBCDefGhiJKL", "aBCDefGhIjkl", "aBCDefGhIjkL", "aBCDefGhIjKl", "aBCDefGhIjKL", "aBCDefGhIJkl", "aBCDefGhIJkL", "aBCDefGhIJKl", "aBCDefGhIJKL", "aBCDefGHijkl", "aBCDefGHijkL", "aBCDefGHijKl", "aBCDefGHijKL", "aBCDefGHiJkl", "aBCDefGHiJkL", "aBCDefGHiJKl", "aBCDefGHiJKL", "aBCDefGHIjkl", "aBCDefGHIjkL", "aBCDefGHIjKl", "aBCDefGHIjKL", "aBCDefGHIJkl", "aBCDefGHIJkL", "aBCDefGHIJKl", "aBCDefGHIJKL", "aBCDeFghijkl", "aBCDeFghijkL", "aBCDeFghijKl", "aBCDeFghijKL", "aBCDeFghiJkl", "aBCDeFghiJkL", "aBCDeFghiJKl", "aBCDeFghiJKL", "aBCDeFghIjkl", "aBCDeFghIjkL", "aBCDeFghIjKl", "aBCDeFghIjKL", "aBCDeFghIJkl", "aBCDeFghIJkL", "aBCDeFghIJKl", "aBCDeFghIJKL", "aBCDeFgHijkl", "aBCDeFgHijkL", "aBCDeFgHijKl", "aBCDeFgHijKL", "aBCDeFgHiJkl", "aBCDeFgHiJkL", "aBCDeFgHiJKl", "aBCDeFgHiJKL", "aBCDeFgHIjkl", "aBCDeFgHIjkL", "aBCDeFgHIjKl", "aBCDeFgHIjKL", "aBCDeFgHIJkl", "aBCDeFgHIJkL", "aBCDeFgHIJKl", "aBCDeFgHIJKL", "aBCDeFGhijkl", "aBCDeFGhijkL", "aBCDeFGhijKl", "aBCDeFGhijKL", "aBCDeFGhiJkl", "aBCDeFGhiJkL", "aBCDeFGhiJKl", "aBCDeFGhiJKL", "aBCDeFGhIjkl", "aBCDeFGhIjkL", "aBCDeFGhIjKl", "aBCDeFGhIjKL", "aBCDeFGhIJkl", "aBCDeFGhIJkL", "aBCDeFGhIJKl", "aBCDeFGhIJKL", "aBCDeFGHijkl", "aBCDeFGHijkL", "aBCDeFGHijKl", "aBCDeFGHijKL", "aBCDeFGHiJkl", "aBCDeFGHiJkL", "aBCDeFGHiJKl", "aBCDeFGHiJKL", "aBCDeFGHIjkl", "aBCDeFGHIjkL", "aBCDeFGHIjKl", "aBCDeFGHIjKL", "aBCDeFGHIJkl", "aBCDeFGHIJkL", "aBCDeFGHIJKl", "aBCDeFGHIJKL", "aBCDEfghijkl", "aBCDEfghijkL", "aBCDEfghijKl", "aBCDEfghijKL", "aBCDEfghiJkl", "aBCDEfghiJkL", "aBCDEfghiJKl", "aBCDEfghiJKL", "aBCDEfghIjkl", "aBCDEfghIjkL", "aBCDEfghIjKl", "aBCDEfghIjKL", "aBCDEfghIJkl", "aBCDEfghIJkL", "aBCDEfghIJKl", "aBCDEfghIJKL", "aBCDEfgHijkl", "aBCDEfgHijkL", "aBCDEfgHijKl", "aBCDEfgHijKL", "aBCDEfgHiJkl", "aBCDEfgHiJkL", "aBCDEfgHiJKl", "aBCDEfgHiJKL", "aBCDEfgHIjkl", "aBCDEfgHIjkL", "aBCDEfgHIjKl", "aBCDEfgHIjKL", "aBCDEfgHIJkl", "aBCDEfgHIJkL", "aBCDEfgHIJKl", "aBCDEfgHIJKL", "aBCDEfGhijkl", "aBCDEfGhijkL", "aBCDEfGhijKl", "aBCDEfGhijKL", "aBCDEfGhiJkl", "aBCDEfGhiJkL", "aBCDEfGhiJKl", "aBCDEfGhiJKL", "aBCDEfGhIjkl", "aBCDEfGhIjkL", "aBCDEfGhIjKl", "aBCDEfGhIjKL", "aBCDEfGhIJkl", "aBCDEfGhIJkL", "aBCDEfGhIJKl", "aBCDEfGhIJKL", "aBCDEfGHijkl", "aBCDEfGHijkL", "aBCDEfGHijKl", "aBCDEfGHijKL", "aBCDEfGHiJkl", "aBCDEfGHiJkL", "aBCDEfGHiJKl", "aBCDEfGHiJKL", "aBCDEfGHIjkl", "aBCDEfGHIjkL", "aBCDEfGHIjKl", "aBCDEfGHIjKL", "aBCDEfGHIJkl", "aBCDEfGHIJkL", "aBCDEfGHIJKl", "aBCDEfGHIJKL", "aBCDEFghijkl", "aBCDEFghijkL", "aBCDEFghijKl", "aBCDEFghijKL", "aBCDEFghiJkl", "aBCDEFghiJkL", "aBCDEFghiJKl", "aBCDEFghiJKL", "aBCDEFghIjkl", "aBCDEFghIjkL", "aBCDEFghIjKl", "aBCDEFghIjKL", "aBCDEFghIJkl", "aBCDEFghIJkL", "aBCDEFghIJKl", "aBCDEFghIJKL", "aBCDEFgHijkl", "aBCDEFgHijkL", "aBCDEFgHijKl", "aBCDEFgHijKL", "aBCDEFgHiJkl", "aBCDEFgHiJkL", "aBCDEFgHiJKl", "aBCDEFgHiJKL", "aBCDEFgHIjkl", "aBCDEFgHIjkL", "aBCDEFgHIjKl", "aBCDEFgHIjKL", "aBCDEFgHIJkl", "aBCDEFgHIJkL", "aBCDEFgHIJKl", "aBCDEFgHIJKL", "aBCDEFGhijkl", "aBCDEFGhijkL", "aBCDEFGhijKl", "aBCDEFGhijKL", "aBCDEFGhiJkl", "aBCDEFGhiJkL", "aBCDEFGhiJKl", "aBCDEFGhiJKL", "aBCDEFGhIjkl", "aBCDEFGhIjkL", "aBCDEFGhIjKl", "aBCDEFGhIjKL", "aBCDEFGhIJkl", "aBCDEFGhIJkL", "aBCDEFGhIJKl", "aBCDEFGhIJKL", "aBCDEFGHijkl", "aBCDEFGHijkL", "aBCDEFGHijKl", "aBCDEFGHijKL", "aBCDEFGHiJkl", "aBCDEFGHiJkL", "aBCDEFGHiJKl", "aBCDEFGHiJKL", "aBCDEFGHIjkl", "aBCDEFGHIjkL", "aBCDEFGHIjKl", "aBCDEFGHIjKL", "aBCDEFGHIJkl", "aBCDEFGHIJkL", "aBCDEFGHIJKl", "aBCDEFGHIJKL", "Abcdefghijkl", "AbcdefghijkL", "AbcdefghijKl", "AbcdefghijKL", "AbcdefghiJkl", "AbcdefghiJkL", "AbcdefghiJKl", "AbcdefghiJKL", "AbcdefghIjkl", "AbcdefghIjkL", "AbcdefghIjKl", "AbcdefghIjKL", "AbcdefghIJkl", "AbcdefghIJkL", "AbcdefghIJKl", "AbcdefghIJKL", "AbcdefgHijkl", "AbcdefgHijkL", "AbcdefgHijKl", "AbcdefgHijKL", "AbcdefgHiJkl", "AbcdefgHiJkL", "AbcdefgHiJKl", "AbcdefgHiJKL", "AbcdefgHIjkl", "AbcdefgHIjkL", "AbcdefgHIjKl", "AbcdefgHIjKL", "AbcdefgHIJkl", "AbcdefgHIJkL", "AbcdefgHIJKl", "AbcdefgHIJKL", "AbcdefGhijkl", "AbcdefGhijkL", "AbcdefGhijKl", "AbcdefGhijKL", "AbcdefGhiJkl", "AbcdefGhiJkL", "AbcdefGhiJKl", "AbcdefGhiJKL", "AbcdefGhIjkl", "AbcdefGhIjkL", "AbcdefGhIjKl", "AbcdefGhIjKL", "AbcdefGhIJkl", "AbcdefGhIJkL", "AbcdefGhIJKl", "AbcdefGhIJKL", "AbcdefGHijkl", "AbcdefGHijkL", "AbcdefGHijKl", "AbcdefGHijKL", "AbcdefGHiJkl", "AbcdefGHiJkL", "AbcdefGHiJKl", "AbcdefGHiJKL", "AbcdefGHIjkl", "AbcdefGHIjkL", "AbcdefGHIjKl", "AbcdefGHIjKL", "AbcdefGHIJkl", "AbcdefGHIJkL", "AbcdefGHIJKl", "AbcdefGHIJKL", "AbcdeFghijkl", "AbcdeFghijkL", "AbcdeFghijKl", "AbcdeFghijKL", "AbcdeFghiJkl", "AbcdeFghiJkL", "AbcdeFghiJKl", "AbcdeFghiJKL", "AbcdeFghIjkl", "AbcdeFghIjkL", "AbcdeFghIjKl", "AbcdeFghIjKL", "AbcdeFghIJkl", "AbcdeFghIJkL", "AbcdeFghIJKl", "AbcdeFghIJKL", "AbcdeFgHijkl", "AbcdeFgHijkL", "AbcdeFgHijKl", "AbcdeFgHijKL", "AbcdeFgHiJkl", "AbcdeFgHiJkL", "AbcdeFgHiJKl", "AbcdeFgHiJKL", "AbcdeFgHIjkl", "AbcdeFgHIjkL", "AbcdeFgHIjKl", "AbcdeFgHIjKL", "AbcdeFgHIJkl", "AbcdeFgHIJkL", "AbcdeFgHIJKl", "AbcdeFgHIJKL", "AbcdeFGhijkl", "AbcdeFGhijkL", "AbcdeFGhijKl", "AbcdeFGhijKL", "AbcdeFGhiJkl", "AbcdeFGhiJkL", "AbcdeFGhiJKl", "AbcdeFGhiJKL", "AbcdeFGhIjkl", "AbcdeFGhIjkL", "AbcdeFGhIjKl", "AbcdeFGhIjKL", "AbcdeFGhIJkl", "AbcdeFGhIJkL", "AbcdeFGhIJKl", "AbcdeFGhIJKL", "AbcdeFGHijkl", "AbcdeFGHijkL", "AbcdeFGHijKl", "AbcdeFGHijKL", "AbcdeFGHiJkl", "AbcdeFGHiJkL", "AbcdeFGHiJKl", "AbcdeFGHiJKL", "AbcdeFGHIjkl", "AbcdeFGHIjkL", "AbcdeFGHIjKl", "AbcdeFGHIjKL", "AbcdeFGHIJkl", "AbcdeFGHIJkL", "AbcdeFGHIJKl", "AbcdeFGHIJKL", "AbcdEfghijkl", "AbcdEfghijkL", "AbcdEfghijKl", "AbcdEfghijKL", "AbcdEfghiJkl", "AbcdEfghiJkL", "AbcdEfghiJKl", "AbcdEfghiJKL", "AbcdEfghIjkl", "AbcdEfghIjkL", "AbcdEfghIjKl", "AbcdEfghIjKL", "AbcdEfghIJkl", "AbcdEfghIJkL", "AbcdEfghIJKl", "AbcdEfghIJKL", "AbcdEfgHijkl", "AbcdEfgHijkL", "AbcdEfgHijKl", "AbcdEfgHijKL", "AbcdEfgHiJkl", "AbcdEfgHiJkL", "AbcdEfgHiJKl", "AbcdEfgHiJKL", "AbcdEfgHIjkl", "AbcdEfgHIjkL", "AbcdEfgHIjKl", "AbcdEfgHIjKL", "AbcdEfgHIJkl", "AbcdEfgHIJkL", "AbcdEfgHIJKl", "AbcdEfgHIJKL", "AbcdEfGhijkl", "AbcdEfGhijkL", "AbcdEfGhijKl", "AbcdEfGhijKL", "AbcdEfGhiJkl", "AbcdEfGhiJkL", "AbcdEfGhiJKl", "AbcdEfGhiJKL", "AbcdEfGhIjkl", "AbcdEfGhIjkL", "AbcdEfGhIjKl", "AbcdEfGhIjKL", "AbcdEfGhIJkl", "AbcdEfGhIJkL", "AbcdEfGhIJKl", "AbcdEfGhIJKL", "AbcdEfGHijkl", "AbcdEfGHijkL", "AbcdEfGHijKl", "AbcdEfGHijKL", "AbcdEfGHiJkl", "AbcdEfGHiJkL", "AbcdEfGHiJKl", "AbcdEfGHiJKL", "AbcdEfGHIjkl", "AbcdEfGHIjkL", "AbcdEfGHIjKl", "AbcdEfGHIjKL", "AbcdEfGHIJkl", "AbcdEfGHIJkL", "AbcdEfGHIJKl", "AbcdEfGHIJKL", "AbcdEFghijkl", "AbcdEFghijkL", "AbcdEFghijKl", "AbcdEFghijKL", "AbcdEFghiJkl", "AbcdEFghiJkL", "AbcdEFghiJKl", "AbcdEFghiJKL", "AbcdEFghIjkl", "AbcdEFghIjkL", "AbcdEFghIjKl", "AbcdEFghIjKL", "AbcdEFghIJkl", "AbcdEFghIJkL", "AbcdEFghIJKl", "AbcdEFghIJKL", "AbcdEFgHijkl", "AbcdEFgHijkL", "AbcdEFgHijKl", "AbcdEFgHijKL", "AbcdEFgHiJkl", "AbcdEFgHiJkL", "AbcdEFgHiJKl", "AbcdEFgHiJKL", "AbcdEFgHIjkl", "AbcdEFgHIjkL", "AbcdEFgHIjKl", "AbcdEFgHIjKL", "AbcdEFgHIJkl", "AbcdEFgHIJkL", "AbcdEFgHIJKl", "AbcdEFgHIJKL", "AbcdEFGhijkl", "AbcdEFGhijkL", "AbcdEFGhijKl", "AbcdEFGhijKL", "AbcdEFGhiJkl", "AbcdEFGhiJkL", "AbcdEFGhiJKl", "AbcdEFGhiJKL", "AbcdEFGhIjkl", "AbcdEFGhIjkL", "AbcdEFGhIjKl", "AbcdEFGhIjKL", "AbcdEFGhIJkl", "AbcdEFGhIJkL", "AbcdEFGhIJKl", "AbcdEFGhIJKL", "AbcdEFGHijkl", "AbcdEFGHijkL", "AbcdEFGHijKl", "AbcdEFGHijKL", "AbcdEFGHiJkl", "AbcdEFGHiJkL", "AbcdEFGHiJKl", "AbcdEFGHiJKL", "AbcdEFGHIjkl", "AbcdEFGHIjkL", "AbcdEFGHIjKl", "AbcdEFGHIjKL", "AbcdEFGHIJkl", "AbcdEFGHIJkL", "AbcdEFGHIJKl", "AbcdEFGHIJKL", "AbcDefghijkl", "AbcDefghijkL", "AbcDefghijKl", "AbcDefghijKL", "AbcDefghiJkl", "AbcDefghiJkL", "AbcDefghiJKl", "AbcDefghiJKL", "AbcDefghIjkl", "AbcDefghIjkL", "AbcDefghIjKl", "AbcDefghIjKL", "AbcDefghIJkl", "AbcDefghIJkL", "AbcDefghIJKl", "AbcDefghIJKL", "AbcDefgHijkl", "AbcDefgHijkL", "AbcDefgHijKl", "AbcDefgHijKL", "AbcDefgHiJkl", "AbcDefgHiJkL", "AbcDefgHiJKl", "AbcDefgHiJKL", "AbcDefgHIjkl", "AbcDefgHIjkL", "AbcDefgHIjKl", "AbcDefgHIjKL", "AbcDefgHIJkl", "AbcDefgHIJkL", "AbcDefgHIJKl", "AbcDefgHIJKL", "AbcDefGhijkl", "AbcDefGhijkL", "AbcDefGhijKl", "AbcDefGhijKL", "AbcDefGhiJkl", "AbcDefGhiJkL", "AbcDefGhiJKl", "AbcDefGhiJKL", "AbcDefGhIjkl", "AbcDefGhIjkL", "AbcDefGhIjKl", "AbcDefGhIjKL", "AbcDefGhIJkl", "AbcDefGhIJkL", "AbcDefGhIJKl", "AbcDefGhIJKL", "AbcDefGHijkl", "AbcDefGHijkL", "AbcDefGHijKl", "AbcDefGHijKL", "AbcDefGHiJkl", "AbcDefGHiJkL", "AbcDefGHiJKl", "AbcDefGHiJKL", "AbcDefGHIjkl", "AbcDefGHIjkL", "AbcDefGHIjKl", "AbcDefGHIjKL", "AbcDefGHIJkl", "AbcDefGHIJkL", "AbcDefGHIJKl", "AbcDefGHIJKL", "AbcDeFghijkl", "AbcDeFghijkL", "AbcDeFghijKl", "AbcDeFghijKL", "AbcDeFghiJkl", "AbcDeFghiJkL", "AbcDeFghiJKl", "AbcDeFghiJKL", "AbcDeFghIjkl", "AbcDeFghIjkL", "AbcDeFghIjKl", "AbcDeFghIjKL", "AbcDeFghIJkl", "AbcDeFghIJkL", "AbcDeFghIJKl", "AbcDeFghIJKL", "AbcDeFgHijkl", "AbcDeFgHijkL", "AbcDeFgHijKl", "AbcDeFgHijKL", "AbcDeFgHiJkl", "AbcDeFgHiJkL", "AbcDeFgHiJKl", "AbcDeFgHiJKL", "AbcDeFgHIjkl", "AbcDeFgHIjkL", "AbcDeFgHIjKl", "AbcDeFgHIjKL", "AbcDeFgHIJkl", "AbcDeFgHIJkL", "AbcDeFgHIJKl", "AbcDeFgHIJKL", "AbcDeFGhijkl", "AbcDeFGhijkL", "AbcDeFGhijKl", "AbcDeFGhijKL", "AbcDeFGhiJkl", "AbcDeFGhiJkL", "AbcDeFGhiJKl", "AbcDeFGhiJKL", "AbcDeFGhIjkl", "AbcDeFGhIjkL", "AbcDeFGhIjKl", "AbcDeFGhIjKL", "AbcDeFGhIJkl", "AbcDeFGhIJkL", "AbcDeFGhIJKl", "AbcDeFGhIJKL", "AbcDeFGHijkl", "AbcDeFGHijkL", "AbcDeFGHijKl", "AbcDeFGHijKL", "AbcDeFGHiJkl", "AbcDeFGHiJkL", "AbcDeFGHiJKl", "AbcDeFGHiJKL", "AbcDeFGHIjkl", "AbcDeFGHIjkL", "AbcDeFGHIjKl", "AbcDeFGHIjKL", "AbcDeFGHIJkl", "AbcDeFGHIJkL", "AbcDeFGHIJKl", "AbcDeFGHIJKL", "AbcDEfghijkl", "AbcDEfghijkL", "AbcDEfghijKl", "AbcDEfghijKL", "AbcDEfghiJkl", "AbcDEfghiJkL", "AbcDEfghiJKl", "AbcDEfghiJKL", "AbcDEfghIjkl", "AbcDEfghIjkL", "AbcDEfghIjKl", "AbcDEfghIjKL", "AbcDEfghIJkl", "AbcDEfghIJkL", "AbcDEfghIJKl", "AbcDEfghIJKL", "AbcDEfgHijkl", "AbcDEfgHijkL", "AbcDEfgHijKl", "AbcDEfgHijKL", "AbcDEfgHiJkl", "AbcDEfgHiJkL", "AbcDEfgHiJKl", "AbcDEfgHiJKL", "AbcDEfgHIjkl", "AbcDEfgHIjkL", "AbcDEfgHIjKl", "AbcDEfgHIjKL", "AbcDEfgHIJkl", "AbcDEfgHIJkL", "AbcDEfgHIJKl", "AbcDEfgHIJKL", "AbcDEfGhijkl", "AbcDEfGhijkL", "AbcDEfGhijKl", "AbcDEfGhijKL", "AbcDEfGhiJkl", "AbcDEfGhiJkL", "AbcDEfGhiJKl", "AbcDEfGhiJKL", "AbcDEfGhIjkl", "AbcDEfGhIjkL", "AbcDEfGhIjKl", "AbcDEfGhIjKL", "AbcDEfGhIJkl", "AbcDEfGhIJkL", "AbcDEfGhIJKl", "AbcDEfGhIJKL", "AbcDEfGHijkl", "AbcDEfGHijkL", "AbcDEfGHijKl", "AbcDEfGHijKL", "AbcDEfGHiJkl", "AbcDEfGHiJkL", "AbcDEfGHiJKl", "AbcDEfGHiJKL", "AbcDEfGHIjkl", "AbcDEfGHIjkL", "AbcDEfGHIjKl", "AbcDEfGHIjKL", "AbcDEfGHIJkl", "AbcDEfGHIJkL", "AbcDEfGHIJKl", "AbcDEfGHIJKL", "AbcDEFghijkl", "AbcDEFghijkL", "AbcDEFghijKl", "AbcDEFghijKL", "AbcDEFghiJkl", "AbcDEFghiJkL", "AbcDEFghiJKl", "AbcDEFghiJKL", "AbcDEFghIjkl", "AbcDEFghIjkL", "AbcDEFghIjKl", "AbcDEFghIjKL", "AbcDEFghIJkl", "AbcDEFghIJkL", "AbcDEFghIJKl", "AbcDEFghIJKL", "AbcDEFgHijkl", "AbcDEFgHijkL", "AbcDEFgHijKl", "AbcDEFgHijKL", "AbcDEFgHiJkl", "AbcDEFgHiJkL", "AbcDEFgHiJKl", "AbcDEFgHiJKL", "AbcDEFgHIjkl", "AbcDEFgHIjkL", "AbcDEFgHIjKl", "AbcDEFgHIjKL", "AbcDEFgHIJkl", "AbcDEFgHIJkL", "AbcDEFgHIJKl", "AbcDEFgHIJKL", "AbcDEFGhijkl", "AbcDEFGhijkL", "AbcDEFGhijKl", "AbcDEFGhijKL", "AbcDEFGhiJkl", "AbcDEFGhiJkL", "AbcDEFGhiJKl", "AbcDEFGhiJKL", "AbcDEFGhIjkl", "AbcDEFGhIjkL", "AbcDEFGhIjKl", "AbcDEFGhIjKL", "AbcDEFGhIJkl", "AbcDEFGhIJkL", "AbcDEFGhIJKl", "AbcDEFGhIJKL", "AbcDEFGHijkl", "AbcDEFGHijkL", "AbcDEFGHijKl", "AbcDEFGHijKL", "AbcDEFGHiJkl", "AbcDEFGHiJkL", "AbcDEFGHiJKl", "AbcDEFGHiJKL", "AbcDEFGHIjkl", "AbcDEFGHIjkL", "AbcDEFGHIjKl", "AbcDEFGHIjKL", "AbcDEFGHIJkl", "AbcDEFGHIJkL", "AbcDEFGHIJKl", "AbcDEFGHIJKL", "AbCdefghijkl", "AbCdefghijkL", "AbCdefghijKl", "AbCdefghijKL", "AbCdefghiJkl", "AbCdefghiJkL", "AbCdefghiJKl", "AbCdefghiJKL", "AbCdefghIjkl", "AbCdefghIjkL", "AbCdefghIjKl", "AbCdefghIjKL", "AbCdefghIJkl", "AbCdefghIJkL", "AbCdefghIJKl", "AbCdefghIJKL", "AbCdefgHijkl", "AbCdefgHijkL", "AbCdefgHijKl", "AbCdefgHijKL", "AbCdefgHiJkl", "AbCdefgHiJkL", "AbCdefgHiJKl", "AbCdefgHiJKL", "AbCdefgHIjkl", "AbCdefgHIjkL", "AbCdefgHIjKl", "AbCdefgHIjKL", "AbCdefgHIJkl", "AbCdefgHIJkL", "AbCdefgHIJKl", "AbCdefgHIJKL", "AbCdefGhijkl", "AbCdefGhijkL", "AbCdefGhijKl", "AbCdefGhijKL", "AbCdefGhiJkl", "AbCdefGhiJkL", "AbCdefGhiJKl", "AbCdefGhiJKL", "AbCdefGhIjkl", "AbCdefGhIjkL", "AbCdefGhIjKl", "AbCdefGhIjKL", "AbCdefGhIJkl", "AbCdefGhIJkL", "AbCdefGhIJKl", "AbCdefGhIJKL", "AbCdefGHijkl", "AbCdefGHijkL", "AbCdefGHijKl", "AbCdefGHijKL", "AbCdefGHiJkl", "AbCdefGHiJkL", "AbCdefGHiJKl", "AbCdefGHiJKL", "AbCdefGHIjkl", "AbCdefGHIjkL", "AbCdefGHIjKl", "AbCdefGHIjKL", "AbCdefGHIJkl", "AbCdefGHIJkL", "AbCdefGHIJKl", "AbCdefGHIJKL", "AbCdeFghijkl", "AbCdeFghijkL", "AbCdeFghijKl", "AbCdeFghijKL", "AbCdeFghiJkl", "AbCdeFghiJkL", "AbCdeFghiJKl", "AbCdeFghiJKL", "AbCdeFghIjkl", "AbCdeFghIjkL", "AbCdeFghIjKl", "AbCdeFghIjKL", "AbCdeFghIJkl", "AbCdeFghIJkL", "AbCdeFghIJKl", "AbCdeFghIJKL", "AbCdeFgHijkl", "AbCdeFgHijkL", "AbCdeFgHijKl", "AbCdeFgHijKL", "AbCdeFgHiJkl", "AbCdeFgHiJkL", "AbCdeFgHiJKl", "AbCdeFgHiJKL", "AbCdeFgHIjkl", "AbCdeFgHIjkL", "AbCdeFgHIjKl", "AbCdeFgHIjKL", "AbCdeFgHIJkl", "AbCdeFgHIJkL", "AbCdeFgHIJKl", "AbCdeFgHIJKL", "AbCdeFGhijkl", "AbCdeFGhijkL", "AbCdeFGhijKl", "AbCdeFGhijKL", "AbCdeFGhiJkl", "AbCdeFGhiJkL", "AbCdeFGhiJKl", "AbCdeFGhiJKL", "AbCdeFGhIjkl", "AbCdeFGhIjkL", "AbCdeFGhIjKl", "AbCdeFGhIjKL", "AbCdeFGhIJkl", "AbCdeFGhIJkL", "AbCdeFGhIJKl", "AbCdeFGhIJKL", "AbCdeFGHijkl", "AbCdeFGHijkL", "AbCdeFGHijKl", "AbCdeFGHijKL", "AbCdeFGHiJkl", "AbCdeFGHiJkL", "AbCdeFGHiJKl", "AbCdeFGHiJKL", "AbCdeFGHIjkl", "AbCdeFGHIjkL", "AbCdeFGHIjKl", "AbCdeFGHIjKL", "AbCdeFGHIJkl", "AbCdeFGHIJkL", "AbCdeFGHIJKl", "AbCdeFGHIJKL", "AbCdEfghijkl", "AbCdEfghijkL", "AbCdEfghijKl", "AbCdEfghijKL", "AbCdEfghiJkl", "AbCdEfghiJkL", "AbCdEfghiJKl", "AbCdEfghiJKL", "AbCdEfghIjkl", "AbCdEfghIjkL", "AbCdEfghIjKl", "AbCdEfghIjKL", "AbCdEfghIJkl", "AbCdEfghIJkL", "AbCdEfghIJKl", "AbCdEfghIJKL", "AbCdEfgHijkl", "AbCdEfgHijkL", "AbCdEfgHijKl", "AbCdEfgHijKL", "AbCdEfgHiJkl", "AbCdEfgHiJkL", "AbCdEfgHiJKl", "AbCdEfgHiJKL", "AbCdEfgHIjkl", "AbCdEfgHIjkL", "AbCdEfgHIjKl", "AbCdEfgHIjKL", "AbCdEfgHIJkl", "AbCdEfgHIJkL", "AbCdEfgHIJKl", "AbCdEfgHIJKL", "AbCdEfGhijkl", "AbCdEfGhijkL", "AbCdEfGhijKl", "AbCdEfGhijKL", "AbCdEfGhiJkl", "AbCdEfGhiJkL", "AbCdEfGhiJKl", "AbCdEfGhiJKL", "AbCdEfGhIjkl", "AbCdEfGhIjkL", "AbCdEfGhIjKl", "AbCdEfGhIjKL", "AbCdEfGhIJkl", "AbCdEfGhIJkL", "AbCdEfGhIJKl", "AbCdEfGhIJKL", "AbCdEfGHijkl", "AbCdEfGHijkL", "AbCdEfGHijKl", "AbCdEfGHijKL", "AbCdEfGHiJkl", "AbCdEfGHiJkL", "AbCdEfGHiJKl", "AbCdEfGHiJKL", "AbCdEfGHIjkl", "AbCdEfGHIjkL", "AbCdEfGHIjKl", "AbCdEfGHIjKL", "AbCdEfGHIJkl", "AbCdEfGHIJkL", "AbCdEfGHIJKl", "AbCdEfGHIJKL", "AbCdEFghijkl", "AbCdEFghijkL", "AbCdEFghijKl", "AbCdEFghijKL", "AbCdEFghiJkl", "AbCdEFghiJkL", "AbCdEFghiJKl", "AbCdEFghiJKL", "AbCdEFghIjkl", "AbCdEFghIjkL", "AbCdEFghIjKl", "AbCdEFghIjKL", "AbCdEFghIJkl", "AbCdEFghIJkL", "AbCdEFghIJKl", "AbCdEFghIJKL", "AbCdEFgHijkl", "AbCdEFgHijkL", "AbCdEFgHijKl", "AbCdEFgHijKL", "AbCdEFgHiJkl", "AbCdEFgHiJkL", "AbCdEFgHiJKl", "AbCdEFgHiJKL", "AbCdEFgHIjkl", "AbCdEFgHIjkL", "AbCdEFgHIjKl", "AbCdEFgHIjKL", "AbCdEFgHIJkl", "AbCdEFgHIJkL", "AbCdEFgHIJKl", "AbCdEFgHIJKL", "AbCdEFGhijkl", "AbCdEFGhijkL", "AbCdEFGhijKl", "AbCdEFGhijKL", "AbCdEFGhiJkl", "AbCdEFGhiJkL", "AbCdEFGhiJKl", "AbCdEFGhiJKL", "AbCdEFGhIjkl", "AbCdEFGhIjkL", "AbCdEFGhIjKl", "AbCdEFGhIjKL", "AbCdEFGhIJkl", "AbCdEFGhIJkL", "AbCdEFGhIJKl", "AbCdEFGhIJKL", "AbCdEFGHijkl", "AbCdEFGHijkL", "AbCdEFGHijKl", "AbCdEFGHijKL", "AbCdEFGHiJkl", "AbCdEFGHiJkL", "AbCdEFGHiJKl", "AbCdEFGHiJKL", "AbCdEFGHIjkl", "AbCdEFGHIjkL", "AbCdEFGHIjKl", "AbCdEFGHIjKL", "AbCdEFGHIJkl", "AbCdEFGHIJkL", "AbCdEFGHIJKl", "AbCdEFGHIJKL", "AbCDefghijkl", "AbCDefghijkL", "AbCDefghijKl", "AbCDefghijKL", "AbCDefghiJkl", "AbCDefghiJkL", "AbCDefghiJKl", "AbCDefghiJKL", "AbCDefghIjkl", "AbCDefghIjkL", "AbCDefghIjKl", "AbCDefghIjKL", "AbCDefghIJkl", "AbCDefghIJkL", "AbCDefghIJKl", "AbCDefghIJKL", "AbCDefgHijkl", "AbCDefgHijkL", "AbCDefgHijKl", "AbCDefgHijKL", "AbCDefgHiJkl", "AbCDefgHiJkL", "AbCDefgHiJKl", "AbCDefgHiJKL", "AbCDefgHIjkl", "AbCDefgHIjkL", "AbCDefgHIjKl", "AbCDefgHIjKL", "AbCDefgHIJkl", "AbCDefgHIJkL", "AbCDefgHIJKl", "AbCDefgHIJKL", "AbCDefGhijkl", "AbCDefGhijkL", "AbCDefGhijKl", "AbCDefGhijKL", "AbCDefGhiJkl", "AbCDefGhiJkL", "AbCDefGhiJKl", "AbCDefGhiJKL", "AbCDefGhIjkl", "AbCDefGhIjkL", "AbCDefGhIjKl", "AbCDefGhIjKL", "AbCDefGhIJkl", "AbCDefGhIJkL", "AbCDefGhIJKl", "AbCDefGhIJKL", "AbCDefGHijkl", "AbCDefGHijkL", "AbCDefGHijKl", "AbCDefGHijKL", "AbCDefGHiJkl", "AbCDefGHiJkL", "AbCDefGHiJKl", "AbCDefGHiJKL", "AbCDefGHIjkl", "AbCDefGHIjkL", "AbCDefGHIjKl", "AbCDefGHIjKL", "AbCDefGHIJkl", "AbCDefGHIJkL", "AbCDefGHIJKl", "AbCDefGHIJKL", "AbCDeFghijkl", "AbCDeFghijkL", "AbCDeFghijKl", "AbCDeFghijKL", "AbCDeFghiJkl", "AbCDeFghiJkL", "AbCDeFghiJKl", "AbCDeFghiJKL", "AbCDeFghIjkl", "AbCDeFghIjkL", "AbCDeFghIjKl", "AbCDeFghIjKL", "AbCDeFghIJkl", "AbCDeFghIJkL", "AbCDeFghIJKl", "AbCDeFghIJKL", "AbCDeFgHijkl", "AbCDeFgHijkL", "AbCDeFgHijKl", "AbCDeFgHijKL", "AbCDeFgHiJkl", "AbCDeFgHiJkL", "AbCDeFgHiJKl", "AbCDeFgHiJKL", "AbCDeFgHIjkl", "AbCDeFgHIjkL", "AbCDeFgHIjKl", "AbCDeFgHIjKL", "AbCDeFgHIJkl", "AbCDeFgHIJkL", "AbCDeFgHIJKl", "AbCDeFgHIJKL", "AbCDeFGhijkl", "AbCDeFGhijkL", "AbCDeFGhijKl", "AbCDeFGhijKL", "AbCDeFGhiJkl", "AbCDeFGhiJkL", "AbCDeFGhiJKl", "AbCDeFGhiJKL", "AbCDeFGhIjkl", "AbCDeFGhIjkL", "AbCDeFGhIjKl", "AbCDeFGhIjKL", "AbCDeFGhIJkl", "AbCDeFGhIJkL", "AbCDeFGhIJKl", "AbCDeFGhIJKL", "AbCDeFGHijkl", "AbCDeFGHijkL", "AbCDeFGHijKl", "AbCDeFGHijKL", "AbCDeFGHiJkl", "AbCDeFGHiJkL", "AbCDeFGHiJKl", "AbCDeFGHiJKL", "AbCDeFGHIjkl", "AbCDeFGHIjkL", "AbCDeFGHIjKl", "AbCDeFGHIjKL", "AbCDeFGHIJkl", "AbCDeFGHIJkL", "AbCDeFGHIJKl", "AbCDeFGHIJKL", "AbCDEfghijkl", "AbCDEfghijkL", "AbCDEfghijKl", "AbCDEfghijKL", "AbCDEfghiJkl", "AbCDEfghiJkL", "AbCDEfghiJKl", "AbCDEfghiJKL", "AbCDEfghIjkl", "AbCDEfghIjkL", "AbCDEfghIjKl", "AbCDEfghIjKL", "AbCDEfghIJkl", "AbCDEfghIJkL", "AbCDEfghIJKl", "AbCDEfghIJKL", "AbCDEfgHijkl", "AbCDEfgHijkL", "AbCDEfgHijKl", "AbCDEfgHijKL", "AbCDEfgHiJkl", "AbCDEfgHiJkL", "AbCDEfgHiJKl", "AbCDEfgHiJKL", "AbCDEfgHIjkl", "AbCDEfgHIjkL", "AbCDEfgHIjKl", "AbCDEfgHIjKL", "AbCDEfgHIJkl", "AbCDEfgHIJkL", "AbCDEfgHIJKl", "AbCDEfgHIJKL", "AbCDEfGhijkl", "AbCDEfGhijkL", "AbCDEfGhijKl", "AbCDEfGhijKL", "AbCDEfGhiJkl", "AbCDEfGhiJkL", "AbCDEfGhiJKl", "AbCDEfGhiJKL", "AbCDEfGhIjkl", "AbCDEfGhIjkL", "AbCDEfGhIjKl", "AbCDEfGhIjKL", "AbCDEfGhIJkl", "AbCDEfGhIJkL", "AbCDEfGhIJKl", "AbCDEfGhIJKL", "AbCDEfGHijkl", "AbCDEfGHijkL", "AbCDEfGHijKl", "AbCDEfGHijKL", "AbCDEfGHiJkl", "AbCDEfGHiJkL", "AbCDEfGHiJKl", "AbCDEfGHiJKL", "AbCDEfGHIjkl", "AbCDEfGHIjkL", "AbCDEfGHIjKl", "AbCDEfGHIjKL", "AbCDEfGHIJkl", "AbCDEfGHIJkL", "AbCDEfGHIJKl", "AbCDEfGHIJKL", "AbCDEFghijkl", "AbCDEFghijkL", "AbCDEFghijKl", "AbCDEFghijKL", "AbCDEFghiJkl", "AbCDEFghiJkL", "AbCDEFghiJKl", "AbCDEFghiJKL", "AbCDEFghIjkl", "AbCDEFghIjkL", "AbCDEFghIjKl", "AbCDEFghIjKL", "AbCDEFghIJkl", "AbCDEFghIJkL", "AbCDEFghIJKl", "AbCDEFghIJKL", "AbCDEFgHijkl", "AbCDEFgHijkL", "AbCDEFgHijKl", "AbCDEFgHijKL", "AbCDEFgHiJkl", "AbCDEFgHiJkL", "AbCDEFgHiJKl", "AbCDEFgHiJKL", "AbCDEFgHIjkl", "AbCDEFgHIjkL", "AbCDEFgHIjKl", "AbCDEFgHIjKL", "AbCDEFgHIJkl", "AbCDEFgHIJkL", "AbCDEFgHIJKl", "AbCDEFgHIJKL", "AbCDEFGhijkl", "AbCDEFGhijkL", "AbCDEFGhijKl", "AbCDEFGhijKL", "AbCDEFGhiJkl", "AbCDEFGhiJkL", "AbCDEFGhiJKl", "AbCDEFGhiJKL", "AbCDEFGhIjkl", "AbCDEFGhIjkL", "AbCDEFGhIjKl", "AbCDEFGhIjKL", "AbCDEFGhIJkl", "AbCDEFGhIJkL", "AbCDEFGhIJKl", "AbCDEFGhIJKL", "AbCDEFGHijkl", "AbCDEFGHijkL", "AbCDEFGHijKl", "AbCDEFGHijKL", "AbCDEFGHiJkl", "AbCDEFGHiJkL", "AbCDEFGHiJKl", "AbCDEFGHiJKL", "AbCDEFGHIjkl", "AbCDEFGHIjkL", "AbCDEFGHIjKl", "AbCDEFGHIjKL", "AbCDEFGHIJkl", "AbCDEFGHIJkL", "AbCDEFGHIJKl", "AbCDEFGHIJKL", "ABcdefghijkl", "ABcdefghijkL", "ABcdefghijKl", "ABcdefghijKL", "ABcdefghiJkl", "ABcdefghiJkL", "ABcdefghiJKl", "ABcdefghiJKL", "ABcdefghIjkl", "ABcdefghIjkL", "ABcdefghIjKl", "ABcdefghIjKL", "ABcdefghIJkl", "ABcdefghIJkL", "ABcdefghIJKl", "ABcdefghIJKL", "ABcdefgHijkl", "ABcdefgHijkL", "ABcdefgHijKl", "ABcdefgHijKL", "ABcdefgHiJkl", "ABcdefgHiJkL", "ABcdefgHiJKl", "ABcdefgHiJKL", "ABcdefgHIjkl", "ABcdefgHIjkL", "ABcdefgHIjKl", "ABcdefgHIjKL", "ABcdefgHIJkl", "ABcdefgHIJkL", "ABcdefgHIJKl", "ABcdefgHIJKL", "ABcdefGhijkl", "ABcdefGhijkL", "ABcdefGhijKl", "ABcdefGhijKL", "ABcdefGhiJkl", "ABcdefGhiJkL", "ABcdefGhiJKl", "ABcdefGhiJKL", "ABcdefGhIjkl", "ABcdefGhIjkL", "ABcdefGhIjKl", "ABcdefGhIjKL", "ABcdefGhIJkl", "ABcdefGhIJkL", "ABcdefGhIJKl", "ABcdefGhIJKL", "ABcdefGHijkl", "ABcdefGHijkL", "ABcdefGHijKl", "ABcdefGHijKL", "ABcdefGHiJkl", "ABcdefGHiJkL", "ABcdefGHiJKl", "ABcdefGHiJKL", "ABcdefGHIjkl", "ABcdefGHIjkL", "ABcdefGHIjKl", "ABcdefGHIjKL", "ABcdefGHIJkl", "ABcdefGHIJkL", "ABcdefGHIJKl", "ABcdefGHIJKL", "ABcdeFghijkl", "ABcdeFghijkL", "ABcdeFghijKl", "ABcdeFghijKL", "ABcdeFghiJkl", "ABcdeFghiJkL", "ABcdeFghiJKl", "ABcdeFghiJKL", "ABcdeFghIjkl", "ABcdeFghIjkL", "ABcdeFghIjKl", "ABcdeFghIjKL", "ABcdeFghIJkl", "ABcdeFghIJkL", "ABcdeFghIJKl", "ABcdeFghIJKL", "ABcdeFgHijkl", "ABcdeFgHijkL", "ABcdeFgHijKl", "ABcdeFgHijKL", "ABcdeFgHiJkl", "ABcdeFgHiJkL", "ABcdeFgHiJKl", "ABcdeFgHiJKL", "ABcdeFgHIjkl", "ABcdeFgHIjkL", "ABcdeFgHIjKl", "ABcdeFgHIjKL", "ABcdeFgHIJkl", "ABcdeFgHIJkL", "ABcdeFgHIJKl", "ABcdeFgHIJKL", "ABcdeFGhijkl", "ABcdeFGhijkL", "ABcdeFGhijKl", "ABcdeFGhijKL", "ABcdeFGhiJkl", "ABcdeFGhiJkL", "ABcdeFGhiJKl", "ABcdeFGhiJKL", "ABcdeFGhIjkl", "ABcdeFGhIjkL", "ABcdeFGhIjKl", "ABcdeFGhIjKL", "ABcdeFGhIJkl", "ABcdeFGhIJkL", "ABcdeFGhIJKl", "ABcdeFGhIJKL", "ABcdeFGHijkl", "ABcdeFGHijkL", "ABcdeFGHijKl", "ABcdeFGHijKL", "ABcdeFGHiJkl", "ABcdeFGHiJkL", "ABcdeFGHiJKl", "ABcdeFGHiJKL", "ABcdeFGHIjkl", "ABcdeFGHIjkL", "ABcdeFGHIjKl", "ABcdeFGHIjKL", "ABcdeFGHIJkl", "ABcdeFGHIJkL", "ABcdeFGHIJKl", "ABcdeFGHIJKL", "ABcdEfghijkl", "ABcdEfghijkL", "ABcdEfghijKl", "ABcdEfghijKL", "ABcdEfghiJkl", "ABcdEfghiJkL", "ABcdEfghiJKl", "ABcdEfghiJKL", "ABcdEfghIjkl", "ABcdEfghIjkL", "ABcdEfghIjKl", "ABcdEfghIjKL", "ABcdEfghIJkl", "ABcdEfghIJkL", "ABcdEfghIJKl", "ABcdEfghIJKL", "ABcdEfgHijkl", "ABcdEfgHijkL", "ABcdEfgHijKl", "ABcdEfgHijKL", "ABcdEfgHiJkl", "ABcdEfgHiJkL", "ABcdEfgHiJKl", "ABcdEfgHiJKL", "ABcdEfgHIjkl", "ABcdEfgHIjkL", "ABcdEfgHIjKl", "ABcdEfgHIjKL", "ABcdEfgHIJkl", "ABcdEfgHIJkL", "ABcdEfgHIJKl", "ABcdEfgHIJKL", "ABcdEfGhijkl", "ABcdEfGhijkL", "ABcdEfGhijKl", "ABcdEfGhijKL", "ABcdEfGhiJkl", "ABcdEfGhiJkL", "ABcdEfGhiJKl", "ABcdEfGhiJKL", "ABcdEfGhIjkl", "ABcdEfGhIjkL", "ABcdEfGhIjKl", "ABcdEfGhIjKL", "ABcdEfGhIJkl", "ABcdEfGhIJkL", "ABcdEfGhIJKl", "ABcdEfGhIJKL", "ABcdEfGHijkl", "ABcdEfGHijkL", "ABcdEfGHijKl", "ABcdEfGHijKL", "ABcdEfGHiJkl", "ABcdEfGHiJkL", "ABcdEfGHiJKl", "ABcdEfGHiJKL", "ABcdEfGHIjkl", "ABcdEfGHIjkL", "ABcdEfGHIjKl", "ABcdEfGHIjKL", "ABcdEfGHIJkl", "ABcdEfGHIJkL", "ABcdEfGHIJKl", "ABcdEfGHIJKL", "ABcdEFghijkl", "ABcdEFghijkL", "ABcdEFghijKl", "ABcdEFghijKL", "ABcdEFghiJkl", "ABcdEFghiJkL", "ABcdEFghiJKl", "ABcdEFghiJKL", "ABcdEFghIjkl", "ABcdEFghIjkL", "ABcdEFghIjKl", "ABcdEFghIjKL", "ABcdEFghIJkl", "ABcdEFghIJkL", "ABcdEFghIJKl", "ABcdEFghIJKL", "ABcdEFgHijkl", "ABcdEFgHijkL", "ABcdEFgHijKl", "ABcdEFgHijKL", "ABcdEFgHiJkl", "ABcdEFgHiJkL", "ABcdEFgHiJKl", "ABcdEFgHiJKL", "ABcdEFgHIjkl", "ABcdEFgHIjkL", "ABcdEFgHIjKl", "ABcdEFgHIjKL", "ABcdEFgHIJkl", "ABcdEFgHIJkL", "ABcdEFgHIJKl", "ABcdEFgHIJKL", "ABcdEFGhijkl", "ABcdEFGhijkL", "ABcdEFGhijKl", "ABcdEFGhijKL", "ABcdEFGhiJkl", "ABcdEFGhiJkL", "ABcdEFGhiJKl", "ABcdEFGhiJKL", "ABcdEFGhIjkl", "ABcdEFGhIjkL", "ABcdEFGhIjKl", "ABcdEFGhIjKL", "ABcdEFGhIJkl", "ABcdEFGhIJkL", "ABcdEFGhIJKl", "ABcdEFGhIJKL", "ABcdEFGHijkl", "ABcdEFGHijkL", "ABcdEFGHijKl", "ABcdEFGHijKL", "ABcdEFGHiJkl", "ABcdEFGHiJkL", "ABcdEFGHiJKl", "ABcdEFGHiJKL", "ABcdEFGHIjkl", "ABcdEFGHIjkL", "ABcdEFGHIjKl", "ABcdEFGHIjKL", "ABcdEFGHIJkl", "ABcdEFGHIJkL", "ABcdEFGHIJKl", "ABcdEFGHIJKL", "ABcDefghijkl", "ABcDefghijkL", "ABcDefghijKl", "ABcDefghijKL", "ABcDefghiJkl", "ABcDefghiJkL", "ABcDefghiJKl", "ABcDefghiJKL", "ABcDefghIjkl", "ABcDefghIjkL", "ABcDefghIjKl", "ABcDefghIjKL", "ABcDefghIJkl", "ABcDefghIJkL", "ABcDefghIJKl", "ABcDefghIJKL", "ABcDefgHijkl", "ABcDefgHijkL", "ABcDefgHijKl", "ABcDefgHijKL", "ABcDefgHiJkl", "ABcDefgHiJkL", "ABcDefgHiJKl", "ABcDefgHiJKL", "ABcDefgHIjkl", "ABcDefgHIjkL", "ABcDefgHIjKl", "ABcDefgHIjKL", "ABcDefgHIJkl", "ABcDefgHIJkL", "ABcDefgHIJKl", "ABcDefgHIJKL", "ABcDefGhijkl", "ABcDefGhijkL", "ABcDefGhijKl", "ABcDefGhijKL", "ABcDefGhiJkl", "ABcDefGhiJkL", "ABcDefGhiJKl", "ABcDefGhiJKL", "ABcDefGhIjkl", "ABcDefGhIjkL", "ABcDefGhIjKl", "ABcDefGhIjKL", "ABcDefGhIJkl", "ABcDefGhIJkL", "ABcDefGhIJKl", "ABcDefGhIJKL", "ABcDefGHijkl", "ABcDefGHijkL", "ABcDefGHijKl", "ABcDefGHijKL", "ABcDefGHiJkl", "ABcDefGHiJkL", "ABcDefGHiJKl", "ABcDefGHiJKL", "ABcDefGHIjkl", "ABcDefGHIjkL", "ABcDefGHIjKl", "ABcDefGHIjKL", "ABcDefGHIJkl", "ABcDefGHIJkL", "ABcDefGHIJKl", "ABcDefGHIJKL", "ABcDeFghijkl", "ABcDeFghijkL", "ABcDeFghijKl", "ABcDeFghijKL", "ABcDeFghiJkl", "ABcDeFghiJkL", "ABcDeFghiJKl", "ABcDeFghiJKL", "ABcDeFghIjkl", "ABcDeFghIjkL", "ABcDeFghIjKl", "ABcDeFghIjKL", "ABcDeFghIJkl", "ABcDeFghIJkL", "ABcDeFghIJKl", "ABcDeFghIJKL", "ABcDeFgHijkl", "ABcDeFgHijkL", "ABcDeFgHijKl", "ABcDeFgHijKL", "ABcDeFgHiJkl", "ABcDeFgHiJkL", "ABcDeFgHiJKl", "ABcDeFgHiJKL", "ABcDeFgHIjkl", "ABcDeFgHIjkL", "ABcDeFgHIjKl", "ABcDeFgHIjKL", "ABcDeFgHIJkl", "ABcDeFgHIJkL", "ABcDeFgHIJKl", "ABcDeFgHIJKL", "ABcDeFGhijkl", "ABcDeFGhijkL", "ABcDeFGhijKl", "ABcDeFGhijKL", "ABcDeFGhiJkl", "ABcDeFGhiJkL", "ABcDeFGhiJKl", "ABcDeFGhiJKL", "ABcDeFGhIjkl", "ABcDeFGhIjkL", "ABcDeFGhIjKl", "ABcDeFGhIjKL", "ABcDeFGhIJkl", "ABcDeFGhIJkL", "ABcDeFGhIJKl", "ABcDeFGhIJKL", "ABcDeFGHijkl", "ABcDeFGHijkL", "ABcDeFGHijKl", "ABcDeFGHijKL", "ABcDeFGHiJkl", "ABcDeFGHiJkL", "ABcDeFGHiJKl", "ABcDeFGHiJKL", "ABcDeFGHIjkl", "ABcDeFGHIjkL", "ABcDeFGHIjKl", "ABcDeFGHIjKL", "ABcDeFGHIJkl", "ABcDeFGHIJkL", "ABcDeFGHIJKl", "ABcDeFGHIJKL", "ABcDEfghijkl", "ABcDEfghijkL", "ABcDEfghijKl", "ABcDEfghijKL", "ABcDEfghiJkl", "ABcDEfghiJkL", "ABcDEfghiJKl", "ABcDEfghiJKL", "ABcDEfghIjkl", "ABcDEfghIjkL", "ABcDEfghIjKl", "ABcDEfghIjKL", "ABcDEfghIJkl", "ABcDEfghIJkL", "ABcDEfghIJKl", "ABcDEfghIJKL", "ABcDEfgHijkl", "ABcDEfgHijkL", "ABcDEfgHijKl", "ABcDEfgHijKL", "ABcDEfgHiJkl", "ABcDEfgHiJkL", "ABcDEfgHiJKl", "ABcDEfgHiJKL", "ABcDEfgHIjkl", "ABcDEfgHIjkL", "ABcDEfgHIjKl", "ABcDEfgHIjKL", "ABcDEfgHIJkl", "ABcDEfgHIJkL", "ABcDEfgHIJKl", "ABcDEfgHIJKL", "ABcDEfGhijkl", "ABcDEfGhijkL", "ABcDEfGhijKl", "ABcDEfGhijKL", "ABcDEfGhiJkl", "ABcDEfGhiJkL", "ABcDEfGhiJKl", "ABcDEfGhiJKL", "ABcDEfGhIjkl", "ABcDEfGhIjkL", "ABcDEfGhIjKl", "ABcDEfGhIjKL", "ABcDEfGhIJkl", "ABcDEfGhIJkL", "ABcDEfGhIJKl", "ABcDEfGhIJKL", "ABcDEfGHijkl", "ABcDEfGHijkL", "ABcDEfGHijKl", "ABcDEfGHijKL", "ABcDEfGHiJkl", "ABcDEfGHiJkL", "ABcDEfGHiJKl", "ABcDEfGHiJKL", "ABcDEfGHIjkl", "ABcDEfGHIjkL", "ABcDEfGHIjKl", "ABcDEfGHIjKL", "ABcDEfGHIJkl", "ABcDEfGHIJkL", "ABcDEfGHIJKl", "ABcDEfGHIJKL", "ABcDEFghijkl", "ABcDEFghijkL", "ABcDEFghijKl", "ABcDEFghijKL", "ABcDEFghiJkl", "ABcDEFghiJkL", "ABcDEFghiJKl", "ABcDEFghiJKL", "ABcDEFghIjkl", "ABcDEFghIjkL", "ABcDEFghIjKl", "ABcDEFghIjKL", "ABcDEFghIJkl", "ABcDEFghIJkL", "ABcDEFghIJKl", "ABcDEFghIJKL", "ABcDEFgHijkl", "ABcDEFgHijkL", "ABcDEFgHijKl", "ABcDEFgHijKL", "ABcDEFgHiJkl", "ABcDEFgHiJkL", "ABcDEFgHiJKl", "ABcDEFgHiJKL", "ABcDEFgHIjkl", "ABcDEFgHIjkL", "ABcDEFgHIjKl", "ABcDEFgHIjKL", "ABcDEFgHIJkl", "ABcDEFgHIJkL", "ABcDEFgHIJKl", "ABcDEFgHIJKL", "ABcDEFGhijkl", "ABcDEFGhijkL", "ABcDEFGhijKl", "ABcDEFGhijKL", "ABcDEFGhiJkl", "ABcDEFGhiJkL", "ABcDEFGhiJKl", "ABcDEFGhiJKL", "ABcDEFGhIjkl", "ABcDEFGhIjkL", "ABcDEFGhIjKl", "ABcDEFGhIjKL", "ABcDEFGhIJkl", "ABcDEFGhIJkL", "ABcDEFGhIJKl", "ABcDEFGhIJKL", "ABcDEFGHijkl", "ABcDEFGHijkL", "ABcDEFGHijKl", "ABcDEFGHijKL", "ABcDEFGHiJkl", "ABcDEFGHiJkL", "ABcDEFGHiJKl", "ABcDEFGHiJKL", "ABcDEFGHIjkl", "ABcDEFGHIjkL", "ABcDEFGHIjKl", "ABcDEFGHIjKL", "ABcDEFGHIJkl", "ABcDEFGHIJkL", "ABcDEFGHIJKl", "ABcDEFGHIJKL", "ABCdefghijkl", "ABCdefghijkL", "ABCdefghijKl", "ABCdefghijKL", "ABCdefghiJkl", "ABCdefghiJkL", "ABCdefghiJKl", "ABCdefghiJKL", "ABCdefghIjkl", "ABCdefghIjkL", "ABCdefghIjKl", "ABCdefghIjKL", "ABCdefghIJkl", "ABCdefghIJkL", "ABCdefghIJKl", "ABCdefghIJKL", "ABCdefgHijkl", "ABCdefgHijkL", "ABCdefgHijKl", "ABCdefgHijKL", "ABCdefgHiJkl", "ABCdefgHiJkL", "ABCdefgHiJKl", "ABCdefgHiJKL", "ABCdefgHIjkl", "ABCdefgHIjkL", "ABCdefgHIjKl", "ABCdefgHIjKL", "ABCdefgHIJkl", "ABCdefgHIJkL", "ABCdefgHIJKl", "ABCdefgHIJKL", "ABCdefGhijkl", "ABCdefGhijkL", "ABCdefGhijKl", "ABCdefGhijKL", "ABCdefGhiJkl", "ABCdefGhiJkL", "ABCdefGhiJKl", "ABCdefGhiJKL", "ABCdefGhIjkl", "ABCdefGhIjkL", "ABCdefGhIjKl", "ABCdefGhIjKL", "ABCdefGhIJkl", "ABCdefGhIJkL", "ABCdefGhIJKl", "ABCdefGhIJKL", "ABCdefGHijkl", "ABCdefGHijkL", "ABCdefGHijKl", "ABCdefGHijKL", "ABCdefGHiJkl", "ABCdefGHiJkL", "ABCdefGHiJKl", "ABCdefGHiJKL", "ABCdefGHIjkl", "ABCdefGHIjkL", "ABCdefGHIjKl", "ABCdefGHIjKL", "ABCdefGHIJkl", "ABCdefGHIJkL", "ABCdefGHIJKl", "ABCdefGHIJKL", "ABCdeFghijkl", "ABCdeFghijkL", "ABCdeFghijKl", "ABCdeFghijKL", "ABCdeFghiJkl", "ABCdeFghiJkL", "ABCdeFghiJKl", "ABCdeFghiJKL", "ABCdeFghIjkl", "ABCdeFghIjkL", "ABCdeFghIjKl", "ABCdeFghIjKL", "ABCdeFghIJkl", "ABCdeFghIJkL", "ABCdeFghIJKl", "ABCdeFghIJKL", "ABCdeFgHijkl", "ABCdeFgHijkL", "ABCdeFgHijKl", "ABCdeFgHijKL", "ABCdeFgHiJkl", "ABCdeFgHiJkL", "ABCdeFgHiJKl", "ABCdeFgHiJKL", "ABCdeFgHIjkl", "ABCdeFgHIjkL", "ABCdeFgHIjKl", "ABCdeFgHIjKL", "ABCdeFgHIJkl", "ABCdeFgHIJkL", "ABCdeFgHIJKl", "ABCdeFgHIJKL", "ABCdeFGhijkl", "ABCdeFGhijkL", "ABCdeFGhijKl", "ABCdeFGhijKL", "ABCdeFGhiJkl", "ABCdeFGhiJkL", "ABCdeFGhiJKl", "ABCdeFGhiJKL", "ABCdeFGhIjkl", "ABCdeFGhIjkL", "ABCdeFGhIjKl", "ABCdeFGhIjKL", "ABCdeFGhIJkl", "ABCdeFGhIJkL", "ABCdeFGhIJKl", "ABCdeFGhIJKL", "ABCdeFGHijkl", "ABCdeFGHijkL", "ABCdeFGHijKl", "ABCdeFGHijKL", "ABCdeFGHiJkl", "ABCdeFGHiJkL", "ABCdeFGHiJKl", "ABCdeFGHiJKL", "ABCdeFGHIjkl", "ABCdeFGHIjkL", "ABCdeFGHIjKl", "ABCdeFGHIjKL", "ABCdeFGHIJkl", "ABCdeFGHIJkL", "ABCdeFGHIJKl", "ABCdeFGHIJKL", "ABCdEfghijkl", "ABCdEfghijkL", "ABCdEfghijKl", "ABCdEfghijKL", "ABCdEfghiJkl", "ABCdEfghiJkL", "ABCdEfghiJKl", "ABCdEfghiJKL", "ABCdEfghIjkl", "ABCdEfghIjkL", "ABCdEfghIjKl", "ABCdEfghIjKL", "ABCdEfghIJkl", "ABCdEfghIJkL", "ABCdEfghIJKl", "ABCdEfghIJKL", "ABCdEfgHijkl", "ABCdEfgHijkL", "ABCdEfgHijKl", "ABCdEfgHijKL", "ABCdEfgHiJkl", "ABCdEfgHiJkL", "ABCdEfgHiJKl", "ABCdEfgHiJKL", "ABCdEfgHIjkl", "ABCdEfgHIjkL", "ABCdEfgHIjKl", "ABCdEfgHIjKL", "ABCdEfgHIJkl", "ABCdEfgHIJkL", "ABCdEfgHIJKl", "ABCdEfgHIJKL", "ABCdEfGhijkl", "ABCdEfGhijkL", "ABCdEfGhijKl", "ABCdEfGhijKL", "ABCdEfGhiJkl", "ABCdEfGhiJkL", "ABCdEfGhiJKl", "ABCdEfGhiJKL", "ABCdEfGhIjkl", "ABCdEfGhIjkL", "ABCdEfGhIjKl", "ABCdEfGhIjKL", "ABCdEfGhIJkl", "ABCdEfGhIJkL", "ABCdEfGhIJKl", "ABCdEfGhIJKL", "ABCdEfGHijkl", "ABCdEfGHijkL", "ABCdEfGHijKl", "ABCdEfGHijKL", "ABCdEfGHiJkl", "ABCdEfGHiJkL", "ABCdEfGHiJKl", "ABCdEfGHiJKL", "ABCdEfGHIjkl", "ABCdEfGHIjkL", "ABCdEfGHIjKl", "ABCdEfGHIjKL", "ABCdEfGHIJkl", "ABCdEfGHIJkL", "ABCdEfGHIJKl", "ABCdEfGHIJKL", "ABCdEFghijkl", "ABCdEFghijkL", "ABCdEFghijKl", "ABCdEFghijKL", "ABCdEFghiJkl", "ABCdEFghiJkL", "ABCdEFghiJKl", "ABCdEFghiJKL", "ABCdEFghIjkl", "ABCdEFghIjkL", "ABCdEFghIjKl", "ABCdEFghIjKL", "ABCdEFghIJkl", "ABCdEFghIJkL", "ABCdEFghIJKl", "ABCdEFghIJKL", "ABCdEFgHijkl", "ABCdEFgHijkL", "ABCdEFgHijKl", "ABCdEFgHijKL", "ABCdEFgHiJkl", "ABCdEFgHiJkL", "ABCdEFgHiJKl", "ABCdEFgHiJKL", "ABCdEFgHIjkl", "ABCdEFgHIjkL", "ABCdEFgHIjKl", "ABCdEFgHIjKL", "ABCdEFgHIJkl", "ABCdEFgHIJkL", "ABCdEFgHIJKl", "ABCdEFgHIJKL", "ABCdEFGhijkl", "ABCdEFGhijkL", "ABCdEFGhijKl", "ABCdEFGhijKL", "ABCdEFGhiJkl", "ABCdEFGhiJkL", "ABCdEFGhiJKl", "ABCdEFGhiJKL", "ABCdEFGhIjkl", "ABCdEFGhIjkL", "ABCdEFGhIjKl", "ABCdEFGhIjKL", "ABCdEFGhIJkl", "ABCdEFGhIJkL", "ABCdEFGhIJKl", "ABCdEFGhIJKL", "ABCdEFGHijkl", "ABCdEFGHijkL", "ABCdEFGHijKl", "ABCdEFGHijKL", "ABCdEFGHiJkl", "ABCdEFGHiJkL", "ABCdEFGHiJKl", "ABCdEFGHiJKL", "ABCdEFGHIjkl", "ABCdEFGHIjkL", "ABCdEFGHIjKl", "ABCdEFGHIjKL", "ABCdEFGHIJkl", "ABCdEFGHIJkL", "ABCdEFGHIJKl", "ABCdEFGHIJKL", "ABCDefghijkl", "ABCDefghijkL", "ABCDefghijKl", "ABCDefghijKL", "ABCDefghiJkl", "ABCDefghiJkL", "ABCDefghiJKl", "ABCDefghiJKL", "ABCDefghIjkl", "ABCDefghIjkL", "ABCDefghIjKl", "ABCDefghIjKL", "ABCDefghIJkl", "ABCDefghIJkL", "ABCDefghIJKl", "ABCDefghIJKL", "ABCDefgHijkl", "ABCDefgHijkL", "ABCDefgHijKl", "ABCDefgHijKL", "ABCDefgHiJkl", "ABCDefgHiJkL", "ABCDefgHiJKl", "ABCDefgHiJKL", "ABCDefgHIjkl", "ABCDefgHIjkL", "ABCDefgHIjKl", "ABCDefgHIjKL", "ABCDefgHIJkl", "ABCDefgHIJkL", "ABCDefgHIJKl", "ABCDefgHIJKL", "ABCDefGhijkl", "ABCDefGhijkL", "ABCDefGhijKl", "ABCDefGhijKL", "ABCDefGhiJkl", "ABCDefGhiJkL", "ABCDefGhiJKl", "ABCDefGhiJKL", "ABCDefGhIjkl", "ABCDefGhIjkL", "ABCDefGhIjKl", "ABCDefGhIjKL", "ABCDefGhIJkl", "ABCDefGhIJkL", "ABCDefGhIJKl", "ABCDefGhIJKL", "ABCDefGHijkl", "ABCDefGHijkL", "ABCDefGHijKl", "ABCDefGHijKL", "ABCDefGHiJkl", "ABCDefGHiJkL", "ABCDefGHiJKl", "ABCDefGHiJKL", "ABCDefGHIjkl", "ABCDefGHIjkL", "ABCDefGHIjKl", "ABCDefGHIjKL", "ABCDefGHIJkl", "ABCDefGHIJkL", "ABCDefGHIJKl", "ABCDefGHIJKL", "ABCDeFghijkl", "ABCDeFghijkL", "ABCDeFghijKl", "ABCDeFghijKL", "ABCDeFghiJkl", "ABCDeFghiJkL", "ABCDeFghiJKl", "ABCDeFghiJKL", "ABCDeFghIjkl", "ABCDeFghIjkL", "ABCDeFghIjKl", "ABCDeFghIjKL", "ABCDeFghIJkl", "ABCDeFghIJkL", "ABCDeFghIJKl", "ABCDeFghIJKL", "ABCDeFgHijkl", "ABCDeFgHijkL", "ABCDeFgHijKl", "ABCDeFgHijKL", "ABCDeFgHiJkl", "ABCDeFgHiJkL", "ABCDeFgHiJKl", "ABCDeFgHiJKL", "ABCDeFgHIjkl", "ABCDeFgHIjkL", "ABCDeFgHIjKl", "ABCDeFgHIjKL", "ABCDeFgHIJkl", "ABCDeFgHIJkL", "ABCDeFgHIJKl", "ABCDeFgHIJKL", "ABCDeFGhijkl", "ABCDeFGhijkL", "ABCDeFGhijKl", "ABCDeFGhijKL", "ABCDeFGhiJkl", "ABCDeFGhiJkL", "ABCDeFGhiJKl", "ABCDeFGhiJKL", "ABCDeFGhIjkl", "ABCDeFGhIjkL", "ABCDeFGhIjKl", "ABCDeFGhIjKL", "ABCDeFGhIJkl", "ABCDeFGhIJkL", "ABCDeFGhIJKl", "ABCDeFGhIJKL", "ABCDeFGHijkl", "ABCDeFGHijkL", "ABCDeFGHijKl", "ABCDeFGHijKL", "ABCDeFGHiJkl", "ABCDeFGHiJkL", "ABCDeFGHiJKl", "ABCDeFGHiJKL", "ABCDeFGHIjkl", "ABCDeFGHIjkL", "ABCDeFGHIjKl", "ABCDeFGHIjKL", "ABCDeFGHIJkl", "ABCDeFGHIJkL", "ABCDeFGHIJKl", "ABCDeFGHIJKL", "ABCDEfghijkl", "ABCDEfghijkL", "ABCDEfghijKl", "ABCDEfghijKL", "ABCDEfghiJkl", "ABCDEfghiJkL", "ABCDEfghiJKl", "ABCDEfghiJKL", "ABCDEfghIjkl", "ABCDEfghIjkL", "ABCDEfghIjKl", "ABCDEfghIjKL", "ABCDEfghIJkl", "ABCDEfghIJkL", "ABCDEfghIJKl", "ABCDEfghIJKL", "ABCDEfgHijkl", "ABCDEfgHijkL", "ABCDEfgHijKl", "ABCDEfgHijKL", "ABCDEfgHiJkl", "ABCDEfgHiJkL", "ABCDEfgHiJKl", "ABCDEfgHiJKL", "ABCDEfgHIjkl", "ABCDEfgHIjkL", "ABCDEfgHIjKl", "ABCDEfgHIjKL", "ABCDEfgHIJkl", "ABCDEfgHIJkL", "ABCDEfgHIJKl", "ABCDEfgHIJKL", "ABCDEfGhijkl", "ABCDEfGhijkL", "ABCDEfGhijKl", "ABCDEfGhijKL", "ABCDEfGhiJkl", "ABCDEfGhiJkL", "ABCDEfGhiJKl", "ABCDEfGhiJKL", "ABCDEfGhIjkl", "ABCDEfGhIjkL", "ABCDEfGhIjKl", "ABCDEfGhIjKL", "ABCDEfGhIJkl", "ABCDEfGhIJkL", "ABCDEfGhIJKl", "ABCDEfGhIJKL", "ABCDEfGHijkl", "ABCDEfGHijkL", "ABCDEfGHijKl", "ABCDEfGHijKL", "ABCDEfGHiJkl", "ABCDEfGHiJkL", "ABCDEfGHiJKl", "ABCDEfGHiJKL", "ABCDEfGHIjkl", "ABCDEfGHIjkL", "ABCDEfGHIjKl", "ABCDEfGHIjKL", "ABCDEfGHIJkl", "ABCDEfGHIJkL", "ABCDEfGHIJKl", "ABCDEfGHIJKL", "ABCDEFghijkl", "ABCDEFghijkL", "ABCDEFghijKl", "ABCDEFghijKL", "ABCDEFghiJkl", "ABCDEFghiJkL", "ABCDEFghiJKl", "ABCDEFghiJKL", "ABCDEFghIjkl", "ABCDEFghIjkL", "ABCDEFghIjKl", "ABCDEFghIjKL", "ABCDEFghIJkl", "ABCDEFghIJkL", "ABCDEFghIJKl", "ABCDEFghIJKL", "ABCDEFgHijkl", "ABCDEFgHijkL", "ABCDEFgHijKl", "ABCDEFgHijKL", "ABCDEFgHiJkl", "ABCDEFgHiJkL", "ABCDEFgHiJKl", "ABCDEFgHiJKL", "ABCDEFgHIjkl", "ABCDEFgHIjkL", "ABCDEFgHIjKl", "ABCDEFgHIjKL", "ABCDEFgHIJkl", "ABCDEFgHIJkL", "ABCDEFgHIJKl", "ABCDEFgHIJKL", "ABCDEFGhijkl", "ABCDEFGhijkL", "ABCDEFGhijKl", "ABCDEFGhijKL", "ABCDEFGhiJkl", "ABCDEFGhiJkL", "ABCDEFGhiJKl", "ABCDEFGhiJKL", "ABCDEFGhIjkl", "ABCDEFGhIjkL", "ABCDEFGhIjKl", "ABCDEFGhIjKL", "ABCDEFGhIJkl", "ABCDEFGhIJkL", "ABCDEFGhIJKl", "ABCDEFGhIJKL", "ABCDEFGHijkl", "ABCDEFGHijkL", "ABCDEFGHijKl", "ABCDEFGHijKL", "ABCDEFGHiJkl", "ABCDEFGHiJkL", "ABCDEFGHiJKl", "ABCDEFGHiJKL", "ABCDEFGHIjkl", "ABCDEFGHIjkL", "ABCDEFGHIjKl", "ABCDEFGHIjKL", "ABCDEFGHIJkl", "ABCDEFGHIJkL", "ABCDEFGHIJKl", "ABCDEFGHIJKL"}, + }, + + { + "12345", + []string{"12345"}, + }, + + // 可以有多个 testcase +} + +func Test_letterCasePermutation(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + sort.Strings(tc.ans) + actual := letterCasePermutation(tc.S) + sort.Strings(actual) + ast.Equal(tc.ans, actual, "输入:%v", tc) + } +} + +func Benchmark_letterCasePermutation(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + letterCasePermutation(tc.S) + } + } +} diff --git a/Algorithms/0785.is-graph-bipartite/README.md b/Algorithms/0785.is-graph-bipartite/README.md new file mode 100755 index 000000000..9eaf227ed --- /dev/null +++ b/Algorithms/0785.is-graph-bipartite/README.md @@ -0,0 +1,46 @@ +# [785. Is Graph Bipartite?](https://leetcode.com/problems/is-graph-bipartite/) + +## 题目 + +Given an undirected graph, return true if and only if it is bipartite. + +Recall that a graph is bipartite if we can split it's set of nodes into two independent subsets A and B such that every edge in the graph has one node in A and another node in B. + +The graph is given in the following form: graph[i] is a list of indexes j for which the edge between nodes i and j exists. Each node is an integer between 0 and graph.length - 1. There are no self edges or parallel edges: graph[i] does not contain i, and it doesn't contain any element twice. + +```text +Example 1: +Input: [[1,3], [0,2], [1,3], [0,2]] +Output: true +Explanation: +The graph looks like this: +0----1 +| | +| | +3----2 +We can divide the vertices into two groups: {0, 2} and {1, 3}. +``` + +```text +Example 2: +Input: [[1,2,3], [0,2], [0,1,3], [0,2]] +Output: false +Explanation: +The graph looks like this: +0----1 +| \ | +| \ | +3----2 +We cannot find a way to divide the set of nodes into two independent subsets. +``` + +Note: + +1. graph will have length in range [1, 100]. +1. graph[i] will contain integers in range [0, graph.length - 1]. +1. graph[i] will not contain i or duplicate values. +1. The graph is undirected: if any element j is in graph[i], then i will be in graph[j]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0785.is-graph-bipartite/is-graph-bipartite.go b/Algorithms/0785.is-graph-bipartite/is-graph-bipartite.go new file mode 100755 index 000000000..f9c53b61a --- /dev/null +++ b/Algorithms/0785.is-graph-bipartite/is-graph-bipartite.go @@ -0,0 +1,41 @@ +package problem0785 + +func isBipartite(graph [][]int) bool { + n := len(graph) + // painted[i] == 1 表示 node i 在 白色 集合中 + // painted[i] == -1 表示 node i 在 黑色 集合中 + // painted[i] == 0 表示 node i 还没有被标记集合 + painted := make([]int, n) + + for i := 0; i < n; i++ { + // painted[i]== 0 说明,所有与 node i 相互联通的点,都没有被检查过 + if painted[i] == 0 && !isOK(i, 1, painted, graph) { + return false + } + } + + return true +} + +// isOK 会把 node 归类为 color 集合 +// 在符合题意时,返回 true +func isOK(node, color int, painted []int, graph [][]int) bool { + // 如果 node 已经被检查过了 + // 可以直接核对颜色 + if painted[node] != 0 { + return painted[node] == color + } + + // 按照要求,对 node 进行归类 + painted[node] = color + + // 对与 node 连接的点,也进行同样的检查 + for _, i := range graph[node] { + // 注意,转变 color + if !isOK(i, -color, painted, graph) { + return false + } + } + + return true +} diff --git a/Algorithms/0785.is-graph-bipartite/is-graph-bipartite_test.go b/Algorithms/0785.is-graph-bipartite/is-graph-bipartite_test.go new file mode 100755 index 000000000..7eecb9512 --- /dev/null +++ b/Algorithms/0785.is-graph-bipartite/is-graph-bipartite_test.go @@ -0,0 +1,63 @@ +package problem0785 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + ans bool +}{ + + { + [][]int{{}, {2}, {1}, {4}, {3}}, // 图是两根分开的边 + true, + }, + { + [][]int{{2, 4}, {2, 3, 4}, {0, 1}, {1}, {0, 1}, {7}, {9}, {5}, {}, {6}, {12, 14}, {}, {10}, {}, {10}, {19}, {18}, {}, {16}, {15}, {23}, {23}, {}, {20, 21}, {}, {}, {27}, {26}, {}, {}, {34}, {33, 34}, {}, {31}, {30, 31}, {38, 39}, {37, 38, 39}, {36}, {35, 36}, {35, 36}, {43}, {}, {}, {40}, {}, {49}, {47, 48, 49}, {46, 48, 49}, {46, 47, 49}, {45, 46, 47, 48}}, + false, + }, + + { + [][]int{{}, {2, 4, 6}, {1, 4, 8, 9}, {7, 8}, {1, 2, 8, 9}, {6, 9}, {1, 5, 7, 8, 9}, {3, 6, 9}, {2, 3, 4, 6, 9}, {2, 4, 5, 6, 7, 8}}, + false, + }, + + { + [][]int{{}}, + true, + }, + + { + [][]int{{1, 3}, {0, 2}, {1, 3}, {0, 2}}, + true, + }, + + { + [][]int{{1, 2, 3}, {0, 2}, {0, 1, 3}, {0, 2}}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isBipartite(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isBipartite(tc.graph), "输入:%v", tc) + } +} + +func Benchmark_isBipartite(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isBipartite(tc.graph) + } + } +} diff --git a/Algorithms/0786.k-th-smallest-prime-fraction/README.md b/Algorithms/0786.k-th-smallest-prime-fraction/README.md new file mode 100755 index 000000000..d242f6d92 --- /dev/null +++ b/Algorithms/0786.k-th-smallest-prime-fraction/README.md @@ -0,0 +1,30 @@ +# [786. K-th Smallest Prime Fraction](https://leetcode.com/problems/k-th-smallest-prime-fraction/) + +## 题目 + +A sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q. + +What is the K-th smallest fraction considered? Return your answer as an array of ints, where answer[0] = p and answer[1] = q. + +```text +Examples: +Input: A = [1, 2, 3, 5], K = 3 +Output: [2, 5] +Explanation: +The fractions to be considered in sorted order are: +1/5, 1/3, 2/5, 1/2, 3/5, 2/3. +The third fraction is 2/5. + +Input: A = [1, 7], K = 1 +Output: [1, 7] +``` + +Note: + +1. A will have length between 2 and 2000. +1. Each A[i] will be between 1 and 30000. +1. K will be between 1 and A.length * (A.length - 1) / 2. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.go b/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.go new file mode 100755 index 000000000..77e4a2b57 --- /dev/null +++ b/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.go @@ -0,0 +1,81 @@ +package problem0786 + +import ( + "sort" +) + +// 二分法查找 +func kthSmallestPrimeFraction(A []int, K int) []int { + // 确保 A 处于升序 + sort.Ints(A) + + lo, hi := 0.0, 1.0 + for { + mid := (lo + hi) / 2 + + p, q, count := countUnder(mid, A) + + switch { + case count < K: + lo = mid + case count > K: + hi = mid + default: + return []int{p, q} + } + } +} + +// 统计 A 中所有能组成的分数中,数值 <= max 的数量 +// 其中 p/q 是这些分数中的最大值 +func countUnder(max float64, A []int) (p, q, count int) { + n := len(A) + // 把 q 赋值为 1 是为了能够更新 p,q 的值 + p, q, count = 0, 1, 0 + + // A[i] 和 p 表示分子 + // A[j] 和 q 表示分母 + + for i := 0; i < n-1; i++ { + // 当分母为 A[i] 保存不变时 + // 利用二分法找到 j + // 使得 A[j:] 中的所有元素做分母时, + // 都满足 A[i]/A[j] <= mid + // 注意,A 是升序 + + lo, hi := i, n + // 此时,A[hi:] 就是要找的 A[j:] 的子集 + // 利用二分法不断缩小 [lo,hi],直到 lo == hi 时, + // A[hi:] 就是 A[j:] + + // lo < hi, [lo:hi] 不为空,还要继续查找 + for lo < hi { + mid := (hi + lo) / 2 + if float64(A[i]) <= max*float64(A[mid]) { + // 当 A[i]/A[mid] <= max 时 + // A[mid:] 中的元素都 可以 满足要求 + // 所以 hi 向下移动 + hi = mid + } else { + // 当 max < A[i]/A[mid] 时 + // A[:mid+1] 中的元素都 不能 满足要求 + // 所以 lo 向上移动 + lo = mid + 1 + } + } + j := hi + + // n - j 是 A[j:] 中元素的个数 + count += n - j + + // n - j > 0 说明 A[j:] 中的存在满足要求的元素 + // 这些元素中作为分母,与 A[i] 组成分数的最大值, + // 就是 A[i]/A[j] + // 如果 p/q < A[i]/A[j],就更新 p 和 q + if n-j > 0 && p*A[j] < q*A[i] { + p, q = A[i], A[j] + } + } + + return p, q, count +} diff --git a/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction_test.go b/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction_test.go new file mode 100755 index 000000000..53a5b4f3e --- /dev/null +++ b/Algorithms/0786.k-th-smallest-prime-fraction/k-th-smallest-prime-fraction_test.go @@ -0,0 +1,98 @@ +package problem0786 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans []int +}{ + + { + []int{1, 2, 3, 5, 7, 13, 17, 23, 31, 41, 47, 53, 61, 67, 73, 79, 83, 97, 103, 107, 109, 131, 149, 151, 163, 167, 173, 179, 191, 211, 223, 227, 229, 239, 241, 251, 263, 271, 293, 313, 317, 331, 347, 349, 353, 359, 367, 389, 397, 401, 431, 433, 439, 443, 449, 457, 461, 463, 479, 487, 491, 509, 521, 569, 571, 577, 587, 601, 619, 641, 647, 659, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 773, 787, 797, 811, 821, 823, 827, 839, 853, 857, 863, 929, 937, 941, 947, 953, 967, 991, 1021, 1031, 1033, 1051, 1061, 1087, 1091, 1093, 1103, 1117, 1129, 1151, 1153, 1187, 1201, 1217, 1229, 1237, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1373, 1399, 1423, 1429, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1543, 1549, 1553, 1559, 1579, 1583, 1597, 1601, 1607, 1613, 1621, 1627, 1637, 1657, 1663, 1693, 1697, 1699, 1747, 1777, 1787, 1789, 1801, 1811, 1831, 1847, 1867, 1871, 1879, 1913, 1931, 1933, 1949, 1951, 1973, 1993, 1997, 2011, 2017, 2027, 2029, 2039, 2063, 2069, 2081, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2213, 2243, 2269, 2281, 2287, 2293, 2297, 2339, 2351, 2357, 2371, 2377, 2389, 2393, 2417, 2441, 2447, 2467, 2477, 2503, 2531, 2539, 2549, 2551, 2557, 2617, 2633, 2657, 2659, 2663, 2687, 2689, 2693, 2713, 2731, 2749, 2767, 2791, 2803, 2833, 2837, 2843, 2851, 2861, 2879, 2887, 2903, 2909, 2939, 2953, 2969, 2971, 2999, 3001, 3041, 3079, 3083, 3089, 3121, 3163, 3169, 3187, 3203, 3217, 3221, 3229, 3253, 3259, 3299, 3301, 3307, 3319, 3329, 3331, 3343, 3347, 3361, 3389, 3413, 3463, 3467, 3469, 3499, 3511, 3517, 3533, 3541, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3643, 3677, 3691, 3697, 3701, 3733, 3767, 3833, 3847, 3851, 3881, 3907, 3911, 3919, 3929, 3931, 3947, 3989, 4001, 4003, 4013, 4019, 4021, 4049, 4051, 4057, 4073, 4079, 4093, 4099, 4127, 4133, 4153, 4157, 4159, 4177, 4211, 4217, 4219, 4241, 4243, 4253, 4261, 4271, 4273, 4297, 4327, 4337, 4339, 4363, 4373, 4391, 4409, 4447, 4451, 4457, 4463, 4481, 4513, 4523, 4561, 4567, 4583, 4591, 4603, 4621, 4637, 4643, 4649, 4663, 4691, 4721, 4751, 4787, 4799, 4801, 4813, 4817, 4831, 4861, 4877, 4909, 4931, 4937, 4943, 4957, 4967, 4969, 4993, 5003, 5009, 5021, 5023, 5051, 5077, 5101, 5113, 5119, 5153, 5167, 5171, 5179, 5189, 5231, 5273, 5279, 5281, 5303, 5309, 5323, 5347, 5387, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5591, 5623, 5639, 5647, 5651, 5659, 5669, 5693, 5741, 5743, 5749, 5783, 5801, 5813, 5827, 5843, 5849, 5861, 5867, 5879, 5903, 5923, 5927, 5939, 5953, 5987, 6011, 6037, 6047, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6173, 6197, 6199, 6203, 6211, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6287, 6299, 6301, 6317, 6329, 6337, 6343, 6359, 6367, 6373, 6389, 6397, 6421, 6449, 6451, 6469, 6473, 6491, 6529, 6551, 6553, 6563, 6577, 6607, 6619, 6637, 6659, 6679, 6689, 6701, 6709, 6763, 6779, 6791, 6793, 6803, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6917, 6949, 6959, 6961, 6971, 6977, 6983, 6991, 7001, 7019, 7027, 7043, 7069, 7079, 7109, 7121, 7159, 7177, 7211, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7331, 7333, 7351, 7369, 7393, 7411, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7517, 7523, 7537, 7547, 7561, 7577, 7583, 7591, 7603, 7621, 7649, 7669, 7691, 7703, 7717, 7741, 7753, 7757, 7759, 7789, 7823, 7829, 7841, 7853, 7867, 7873, 7883, 7901, 7919, 7927, 7933, 7949, 7951, 7963, 8009, 8011, 8017, 8053, 8081, 8087, 8089, 8093, 8111, 8123, 8179, 8209, 8231, 8233, 8237, 8263, 8269, 8273, 8287, 8311, 8317, 8329, 8363, 8369, 8377, 8389, 8419, 8423, 8443, 8447, 8461, 8467, 8521, 8537, 8543, 8563, 8581, 8599, 8609, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8689, 8699, 8731, 8737, 8741, 8747, 8753, 8761, 8803, 8807, 8839, 8863, 8867, 8923, 8963, 8971, 8999, 9007, 9011, 9013, 9029, 9041, 9043, 9067, 9133, 9161, 9181, 9187, 9199, 9203, 9209, 9221, 9239, 9241, 9257, 9281, 9293, 9323, 9341, 9343, 9349, 9391, 9419, 9421, 9431, 9433, 9437, 9461, 9463, 9473, 9479, 9491, 9497, 9511, 9533, 9539, 9547, 9551, 9587, 9601, 9623, 9629, 9631, 9649, 9689, 9697, 9719, 9733, 9739, 9749, 9769, 9787, 9791, 9803, 9811, 9817, 9857, 9859, 9883, 9901, 9907, 9923, 9931, 9941, 9967, 9973, 10007, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10133, 10141, 10159, 10163, 10177, 10193, 10211, 10253, 10259, 10271, 10273, 10289, 10301, 10313, 10331, 10333, 10337, 10343, 10369, 10391, 10399, 10427, 10429, 10433, 10459, 10499, 10501, 10529, 10531, 10559, 10589, 10597, 10601, 10607, 10627, 10639, 10657, 10687, 10691, 10709, 10723, 10729, 10733, 10753, 10771, 10781, 10847, 10853, 10859, 10883, 10889, 10891, 10903, 10939, 10949, 10957, 10993, 11003, 11027, 11047, 11059, 11069, 11083, 11117, 11119, 11131, 11149, 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11243, 11261, 11273, 11279, 11287, 11311, 11329, 11351, 11353, 11369, 11383, 11393, 11423, 11437, 11447, 11483, 11489, 11497, 11527, 11549, 11551, 11587, 11593, 11617, 11621, 11633, 11657, 11677, 11681, 11699, 11701, 11717, 11719, 11731, 11777, 11779, 11783, 11789, 11801, 11813, 11821, 11827, 11831, 11833, 11839, 11867, 11887, 11897, 11903, 11909, 11927, 11939, 11953, 11971, 11987, 12011, 12041, 12043, 12073, 12097, 12101, 12109, 12113, 12149, 12157, 12197, 12211, 12251, 12253, 12269, 12277, 12289, 12301, 12343, 12347, 12379, 12401, 12409, 12413, 12421, 12433, 12437, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12527, 12541, 12547, 12553, 12569, 12583, 12589, 12601, 12611, 12613, 12619, 12641, 12647, 12653, 12659, 12671, 12721, 12739, 12743, 12757, 12763, 12799, 12823, 12841, 12889, 12907, 12923, 12953, 12959, 12979, 12983, 13033, 13037, 13049, 13063, 13093, 13127, 13151, 13159, 13171, 13183, 13187, 13217, 13219, 13229, 13241, 13249, 13259, 13291, 13313, 13327, 13337, 13339, 13367, 13381, 13397, 13411, 13417, 13421, 13457, 13463, 13469, 13477, 13499, 13513, 13523, 13537, 13553, 13567, 13591, 13627, 13649, 13679, 13681, 13687, 13691, 13693, 13711, 13721, 13723, 13757, 13763, 13781, 13789, 13799, 13831, 13841, 13859, 13873, 13963, 13967, 13999, 14009, 14029, 14033, 14051, 14057, 14087, 14143, 14149, 14153, 14159, 14177, 14221, 14243, 14249, 14293, 14321, 14327, 14347, 14401, 14419, 14423, 14431, 14437, 14449, 14461, 14503, 14533, 14537, 14543, 14549, 14551, 14557, 14563, 14591, 14593, 14621, 14629, 14639, 14653, 14657, 14683, 14699, 14717, 14731, 14741, 14747, 14753, 14759, 14767, 14779, 14797, 14813, 14821, 14843, 14869, 14879, 14891, 14897, 14923, 14929, 14947, 14951, 14969, 14983, 15013, 15061, 15073, 15083, 15101, 15107, 15121, 15137, 15139, 15149, 15161, 15187, 15193, 15199, 15227, 15233, 15263, 15271, 15277, 15287, 15289, 15299, 15313, 15319, 15329, 15331, 15349, 15359, 15361, 15401, 15413, 15427, 15439, 15443, 15451, 15461, 15467, 15473, 15511, 15527, 15541, 15559, 15581, 15583, 15601, 15607, 15619, 15643, 15679, 15683, 15727, 15731, 15733, 15737, 15749, 15767, 15773, 15791, 15797, 15803, 15809, 15817, 15823, 15859, 15881, 15887, 15889, 15907, 15923, 15937, 15959, 15971, 15991, 16033, 16057, 16061, 16067, 16103, 16111, 16127, 16141, 16183, 16189, 16217, 16229, 16231, 16253, 16267, 16301, 16333, 16363, 16369, 16381, 16411, 16427, 16433, 16451, 16477, 16481, 16487, 16493, 16519, 16529, 16547, 16553, 16603, 16607, 16619, 16631, 16633, 16651, 16661, 16693, 16729, 16763, 16787, 16811, 16829, 16831, 16843, 16871, 16903, 16921, 16927, 16931, 16937, 16943, 16979, 16981, 16987, 16993, 17011, 17021, 17033, 17041, 17053, 17077, 17093, 17099, 17107, 17123, 17159, 17167, 17189, 17191, 17203, 17231, 17239, 17257, 17291, 17317, 17327, 17333, 17387, 17393, 17401, 17417, 17431, 17443, 17449, 17467, 17471, 17489, 17497, 17509, 17519, 17551, 17569, 17579, 17581, 17599, 17609, 17657, 17659, 17669, 17707, 17713, 17729, 17737, 17747, 17783, 17789, 17791, 17807, 17851, 17881, 17891, 17903, 17911, 17921, 17923, 17939, 17959, 17977, 17981, 17989, 18043, 18047, 18049, 18059, 18061, 18089, 18119, 18121, 18127, 18133, 18169, 18181, 18199, 18211, 18217, 18251, 18253, 18269, 18287, 18289, 18313, 18329, 18341, 18367, 18371, 18457, 18481, 18517, 18521, 18523, 18539, 18541, 18553, 18587, 18593, 18617, 18637, 18661, 18671, 18691, 18719, 18743, 18749, 18757, 18773, 18787, 18793, 18797, 18859, 18869, 18899, 18911, 18913, 18919, 18973, 18979, 19031, 19037, 19051, 19073, 19081, 19121, 19139, 19157, 19163, 19183, 19213, 19237, 19259, 19301, 19309, 19319, 19333, 19373, 19379, 19381, 19387, 19403, 19417, 19423, 19427, 19429, 19433, 19457, 19469, 19471, 19477, 19483, 19489, 19501, 19507, 19541, 19571, 19577, 19583, 19603, 19609, 19661, 19681, 19687, 19697, 19717, 19739, 19751, 19753, 19759, 19763, 19813, 19843, 19853, 19867, 19913, 19919, 19927, 19937, 19949, 19973, 19979, 19991, 19993, 20011, 20021, 20023, 20047, 20051, 20089, 20101, 20107, 20113, 20143, 20147, 20173, 20177, 20201, 20219, 20231, 20233, 20249, 20269, 20323, 20341, 20347, 20357, 20359, 20369, 20393, 20399, 20411, 20431, 20443, 20479, 20483, 20509, 20521, 20543, 20549, 20551, 20563, 20593, 20639, 20641, 20681, 20749, 20753, 20759, 20771, 20773, 20789, 20807, 20809, 20849, 20857, 20879, 20887, 20897, 20899, 20921, 20929, 20947, 20959, 20963, 20981, 21001, 21011, 21017, 21023, 21031, 21061, 21089, 21107, 21121, 21139, 21143, 21157, 21163, 21187, 21191, 21211, 21221, 21227, 21247, 21277, 21283, 21313, 21317, 21347, 21379, 21383, 21391, 21397, 21407, 21419, 21467, 21481, 21493, 21517, 21521, 21529, 21559, 21563, 21569, 21577, 21587, 21599, 21611, 21613, 21617, 21649, 21673, 21713, 21727, 21737, 21739, 21751, 21773, 21787, 21799, 21817, 21871, 21937, 21977, 21991, 21997, 22003, 22013, 22039, 22063, 22073, 22079, 22093, 22109, 22123, 22129, 22147, 22229, 22247, 22259, 22273, 22277, 22279, 22283, 22291, 22343, 22349, 22367, 22369, 22381, 22391, 22409, 22453, 22483, 22501, 22511, 22531, 22541, 22549, 22571, 22573, 22613, 22619, 22621, 22639, 22643, 22651, 22697, 22699, 22721, 22727, 22741, 22783, 22807, 22811, 22853, 22859, 22861, 22877, 22921, 22937, 22943, 22963, 23003, 23017, 23027, 23053, 23059, 23071, 23087, 23099, 23117, 23131, 23159, 23167, 23173, 23189, 23197, 23201, 23203, 23209, 23227, 23251, 23269, 23279, 23291, 23293, 23297, 23311, 23327, 23357, 23369, 23399, 23431, 23447, 23473, 23509, 23549, 23563, 23581, 23593, 23599, 23609, 23623, 23633, 23663, 23677, 23687, 23741, 23743, 23747, 23753, 23761, 23767, 23773, 23801, 23813, 23819, 23827, 23831, 23833, 23857, 23869, 23873, 23879, 23887, 23917, 23929, 23981, 24001, 24029, 24043, 24049, 24071, 24077, 24083, 24091, 24103, 24107, 24121, 24133, 24137, 24151, 24169, 24181, 24197, 24203, 24223, 24229, 24247, 24251, 24281, 24329, 24337, 24359, 24371, 24373, 24379, 24413, 24421, 24473, 24481, 24509, 24517, 24527, 24533, 24547, 24551, 24631, 24671, 24677, 24697, 24709, 24767, 24781, 24793, 24809, 24847, 24851, 24907, 24917, 24919, 24923, 24943, 24971, 24979, 24989, 25013, 25031, 25073, 25097, 25111, 25121, 25127, 25147, 25153, 25163, 25169, 25171, 25183, 25189, 25219, 25229, 25237, 25247, 25301, 25321, 25343, 25349, 25357, 25367, 25391, 25409, 25411, 25423, 25439, 25447, 25457, 25469, 25523, 25541, 25561, 25577, 25583, 25589, 25603, 25621, 25633, 25643, 25657, 25667, 25673, 25679, 25703, 25741, 25747, 25759, 25763, 25771, 25799, 25819, 25841, 25873, 25889, 25913, 25919, 25939, 25943, 25951, 25969, 25999, 26017, 26021, 26041, 26053, 26083, 26099, 26107, 26119, 26141, 26161, 26171, 26177, 26189, 26203, 26209, 26227, 26237, 26267, 26293, 26297, 26309, 26321, 26347, 26387, 26399, 26407, 26431, 26449, 26459, 26479, 26497, 26513, 26539, 26561, 26573, 26591, 26597, 26627, 26633, 26669, 26681, 26683, 26687, 26699, 26701, 26711, 26729, 26731, 26737, 26759, 26777, 26783, 26813, 26833, 26839, 26849, 26881, 26891, 26903, 26927, 26953, 26959, 26987, 26993, 27031, 27043, 27061, 27067, 27077, 27091, 27103, 27109, 27127, 27143, 27191, 27197, 27211, 27259, 27271, 27277, 27281, 27299, 27329, 27361, 27367, 27397, 27407, 27409, 27427, 27431, 27437, 27449, 27457, 27479, 27539, 27581, 27611, 27647, 27653, 27689, 27691, 27697, 27701, 27733, 27739, 27743, 27751, 27763, 27767, 27773, 27779, 27791, 27793, 27799, 27809, 27823, 27827, 27851, 27883, 27893, 27901, 27941, 27947, 27953, 27961, 27983, 28001, 28019, 28031, 28069, 28081, 28097, 28099, 28111, 28123, 28151, 28181, 28201, 28211, 28229, 28277, 28279, 28283, 28289, 28307, 28309, 28349, 28393, 28411, 28433, 28439, 28447, 28463, 28477, 28513, 28517, 28537, 28541, 28549, 28559, 28579, 28597, 28607, 28619, 28621, 28657, 28661, 28663, 28669, 28687, 28703, 28711, 28723, 28729, 28751, 28759, 28771, 28789, 28793, 28807, 28843, 28859, 28867, 28933, 28949, 28961, 29021, 29023, 29027, 29033, 29059, 29123, 29129, 29131, 29137, 29147, 29153, 29173, 29179, 29191, 29207, 29209, 29221, 29251, 29269, 29297, 29303, 29311, 29327, 29333, 29339, 29347, 29363, 29389, 29401, 29411, 29423, 29429, 29437, 29453, 29473, 29483, 29501, 29569, 29573, 29581, 29599, 29611, 29663, 29669, 29671, 29717, 29741, 29753, 29761, 29789, 29819, 29833, 29863, 29867, 29879, 29881, 29917, 29921, 29927, 29959, 29983}, + 453785, + []int{3221, 17041}, + }, + + { + []int{1, 3, 2}, + 2, + []int{1, 2}, + }, + + { + []int{1, 2, 3, 5}, + 3, + []int{2, 5}, + }, + + { + []int{1, 7}, + 1, + []int{1, 7}, + }, + + // 可以有多个 testcase +} + +func Test_kthSmallestPrimeFraction(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kthSmallestPrimeFraction(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_kthSmallestPrimeFraction(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kthSmallestPrimeFraction(tc.A, tc.K) + } + } +} + +func Test_countUnder(t *testing.T) { + type args struct { + mid float64 + A []int + } + tests := []struct { + name string + args args + want int + want1 int + want2 int + }{ + { + "测试", + args{ + mid: 0.4, + A: []int{1, 2, 3, 5}, + }, + 2, + 5, + 3, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, got1, got2 := countUnder(tt.args.mid, tt.args.A) + if got != tt.want { + t.Errorf("countUnder() got = %v, want %v", got, tt.want) + } + if got1 != tt.want1 { + t.Errorf("countUnder() got1 = %v, want %v", got1, tt.want1) + } + if got2 != tt.want2 { + t.Errorf("countUnder() got2 = %v, want %v", got2, tt.want2) + } + }) + } +} diff --git a/Algorithms/0787.cheapest-flights-within-k-stops/README.md b/Algorithms/0787.cheapest-flights-within-k-stops/README.md new file mode 100755 index 000000000..146d48341 --- /dev/null +++ b/Algorithms/0787.cheapest-flights-within-k-stops/README.md @@ -0,0 +1,50 @@ +# [787. Cheapest Flights Within K Stops](https://leetcode.com/problems/cheapest-flights-within-k-stops/) + +## 题目 + +There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w. + +Now given all the cities and fights, together with starting city src and the destination dst, your task is to find the cheapest price from src to dst with up to k stops. If there is no such route, output -1. + +```text +Example 1: +Input: +n = 3, edges = [[0,1,100],[1,2,100],[0,2,500]] +src = 0, dst = 2, k = 1 +Output: 200 +Explanation: +The graph looks like this: +``` + +![graph1](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/02/16/995.png) + +```text +The cheapest price from city 0 to city 2 with at most 1 stop costs 200, as marked red in the picture. + +Example 2: +Input: +n = 3, edges = [[0,1,100],[1,2,100],[0,2,500]] +src = 0, dst = 2, k = 0 +Output: 500 +Explanation: +The graph looks like this: +``` + +![graph2](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/02/16/995.png) + +```text +The cheapest price from city 0 to city 2 with at most 0 stop costs 500, as marked blue in the picture. +``` + +Note: + +1. The number of nodes n will be in range [1, 100], with nodes labeled from 0 to n - 1. +1. The size of flights will be in range [0, n * (n - 1) / 2]. +1. The format of each flight will be (src, dst, price). +1. The price of each flight will be in the range [1, 10000]. +1. k is in the range of [0, n - 1]. +1. There will not be any duplicated flights or self cycles. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops.go b/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops.go new file mode 100755 index 000000000..8463a4259 --- /dev/null +++ b/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops.go @@ -0,0 +1,76 @@ +package problem0787 + +import "container/heap" + +func findCheapestPrice(n int, flights [][]int, src int, dst int, k int) int { + fmap := make([][][]int, n) + for i := range flights { + src := flights[i][0] + fmap[src] = append(fmap[src], flights[i][1:]) + } + + pq := make(PQ, 0, n) + // 把 src 作为起点放入 pq + heap.Push(&pq, &city{ + price: 0, // 费用为 0 + id: src, // id 就是 src + countdown: k + 1, // 飞机还可以飞行 k+1 次 + }) + + for len(pq) > 0 { + ct, _ := heap.Pop(&pq).(*city) + + // 如果到达了 dst + if ct.id == dst { + // 返回到达 ct 的票价即可 + // 优先队列保证了此时的 price 一定是最小的 + return ct.price + } + + // 如果还能飞行 + if ct.countdown > 0 { + nexts := fmap[ct.id] + for _, n := range nexts { + heap.Push(&pq, &city{ + id: n[0], + price: ct.price + n[1], + countdown: ct.countdown - 1, + }) + } + } + } + + return -1 +} + +// city 是 priorityQueue 中的元素 +type city struct { + id, price, countdown int + // countdown 表示飞机还可以飞行的次数 +} + +// PQ implements heap.Interface and holds entries. +type PQ []*city + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i].price < pq[j].price +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 city +func (pq *PQ) Push(x interface{}) { + temp := x.(*city) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 city +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} diff --git a/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops_test.go b/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops_test.go new file mode 100755 index 000000000..de1f21076 --- /dev/null +++ b/Algorithms/0787.cheapest-flights-within-k-stops/cheapest-flights-within-k-stops_test.go @@ -0,0 +1,83 @@ +package problem0787 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + flights [][]int + src int + dst int + K int + ans int +}{ + + { + 10, + [][]int{{3, 4, 4}, {2, 5, 6}, {4, 7, 10}, {9, 6, 5}, {7, 4, 4}, {6, 2, 10}, {6, 8, 6}, {7, 9, 4}, {1, 5, 4}, {1, 0, 4}, {9, 7, 3}, {7, 0, 5}, {6, 5, 8}, {1, 7, 6}, {4, 0, 9}, {5, 9, 1}, {8, 7, 3}, {1, 2, 6}, {4, 1, 5}, {5, 2, 4}, {1, 9, 1}, {7, 8, 10}, {0, 4, 2}, {7, 2, 8}}, + 6, + 0, + 7, + 14, + }, + + { + 17, + [][]int{{0, 12, 28}, {5, 6, 39}, {8, 6, 59}, {13, 15, 7}, {13, 12, 38}, {10, 12, 35}, {15, 3, 23}, {7, 11, 26}, {9, 4, 65}, {10, 2, 38}, {4, 7, 7}, {14, 15, 31}, {2, 12, 44}, {8, 10, 34}, {13, 6, 29}, {5, 14, 89}, {11, 16, 13}, {7, 3, 46}, {10, 15, 19}, {12, 4, 58}, {13, 16, 11}, {16, 4, 76}, {2, 0, 12}, {15, 0, 22}, {16, 12, 13}, {7, 1, 29}, {7, 14, 100}, {16, 1, 14}, {9, 6, 74}, {11, 1, 73}, {2, 11, 60}, {10, 11, 85}, {2, 5, 49}, {3, 4, 17}, {4, 9, 77}, {16, 3, 47}, {15, 6, 78}, {14, 1, 90}, {10, 5, 95}, {1, 11, 30}, {11, 0, 37}, {10, 4, 86}, {0, 8, 57}, {6, 14, 68}, {16, 8, 3}, {13, 0, 65}, {2, 13, 6}, {5, 13, 5}, {8, 11, 31}, {6, 10, 20}, {6, 2, 33}, {9, 1, 3}, {14, 9, 58}, {12, 3, 19}, {11, 2, 74}, {12, 14, 48}, {16, 11, 100}, {3, 12, 38}, {12, 13, 77}, {10, 9, 99}, {15, 13, 98}, {15, 12, 71}, {1, 4, 28}, {7, 0, 83}, {3, 5, 100}, {8, 9, 14}, {15, 11, 57}, {3, 6, 65}, {1, 3, 45}, {14, 7, 74}, {2, 10, 39}, {4, 8, 73}, {13, 5, 77}, {10, 0, 43}, {12, 9, 92}, {8, 2, 26}, {1, 7, 7}, {9, 12, 10}, {13, 11, 64}, {8, 13, 80}, {6, 12, 74}, {9, 7, 35}, {0, 15, 48}, {3, 7, 87}, {16, 9, 42}, {5, 16, 64}, {4, 5, 65}, {15, 14, 70}, {12, 0, 13}, {16, 14, 52}, {3, 10, 80}, {14, 11, 85}, {15, 2, 77}, {4, 11, 19}, {2, 7, 49}, {10, 7, 78}, {14, 6, 84}, {13, 7, 50}, {11, 6, 75}, {5, 10, 46}, {13, 8, 43}, {9, 10, 49}, {7, 12, 64}, {0, 10, 76}, {5, 9, 77}, {8, 3, 28}, {11, 9, 28}, {12, 16, 87}, {12, 6, 24}, {9, 15, 94}, {5, 7, 77}, {4, 10, 18}, {7, 2, 11}, {9, 5, 41}}, + 13, + 4, + 13, + 47, + }, + + { + 3, + [][]int{{0, 1, 100}, {1, 2, 100}, {0, 2, 500}}, + 0, + 2, + 1, + 200, + }, + + { + 3, + [][]int{{0, 1, 100}, {1, 2, 100}, {0, 2, 500}}, + 0, + 2, + 0, + 500, + }, + + { + 3, + [][]int{{0, 1, 100}, {1, 2, 100}, {0, 2, 500}}, + 2, + 0, + 0, + -1, + }, + + // 可以有多个 testcase +} + +func Test_findCheapestPrice(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findCheapestPrice(tc.n, tc.flights, tc.src, tc.dst, tc.K), "输入:%v", tc) + } +} + +func Benchmark_findCheapestPrice(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findCheapestPrice(tc.n, tc.flights, tc.src, tc.dst, tc.K) + } + } +} diff --git a/Algorithms/0788.rotated-digits/README.md b/Algorithms/0788.rotated-digits/README.md new file mode 100755 index 000000000..ddfd42d65 --- /dev/null +++ b/Algorithms/0788.rotated-digits/README.md @@ -0,0 +1,26 @@ +# [788. Rotated Digits](https://leetcode.com/problems/rotated-digits/) + +## 题目 + +X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be rotated - we cannot choose to leave it alone. + +A number is valid if each digit remains a digit after rotation. 0, 1, and 8 rotate to themselves; 2 and 5 rotate to each other; 6 and 9 rotate to each other, and the rest of the numbers do not rotate to any other number and become invalid. + +Nowgiven a positive number N, how many numbers X from 1 to N are good? + +```text +Example: +Input: 10 +Output: 4 +Explanation: +There are four good numbers in the range [1, 10] : 2, 5, 6, 9. +Note that 1 and 10 are not good numbers, since they remain unchanged after rotating. +``` + +Note: + +1. N will be in range [1, 10000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0788.rotated-digits/rotated-digits.go b/Algorithms/0788.rotated-digits/rotated-digits.go new file mode 100755 index 000000000..dde300259 --- /dev/null +++ b/Algorithms/0788.rotated-digits/rotated-digits.go @@ -0,0 +1,26 @@ +package problem0788 + +func rotatedDigits(n int) int { + count := 0 + // 暴力方法,逐个检查 + for i := 2; i <= n; i++ { + if isValid(i) { + count++ + } + } + return count +} + +func isValid(n int) bool { + var hasFoundValid bool + for n > 0 { + switch n % 10 { + case 2, 5, 6, 9: + hasFoundValid = true + case 3, 4, 7: + return false + } + n /= 10 + } + return hasFoundValid +} diff --git a/Algorithms/0788.rotated-digits/rotated-digits_test.go b/Algorithms/0788.rotated-digits/rotated-digits_test.go new file mode 100755 index 000000000..737dea7d1 --- /dev/null +++ b/Algorithms/0788.rotated-digits/rotated-digits_test.go @@ -0,0 +1,54 @@ +package problem0788 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 9876, + 2257, + }, + + { + 10000, + 2320, + }, + + { + 100, + 40, + }, + + { + 10, + 4, + }, + + // 可以有多个 testcase +} + +func Test_rotatedDigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rotatedDigits(tc.N), "输入:%v", tc) + } +} + +func Benchmark_rotatedDigits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rotatedDigits(tc.N) + } + } +} diff --git a/Algorithms/0789.escape-the-ghosts/README.md b/Algorithms/0789.escape-the-ghosts/README.md new file mode 100755 index 000000000..533557750 --- /dev/null +++ b/Algorithms/0789.escape-the-ghosts/README.md @@ -0,0 +1,50 @@ +# [789. Escape The Ghosts](https://leetcode.com/problems/escape-the-ghosts/) + +## 题目 + +You are playing a simplified Pacman game. You start at the point (0, 0), and your destination is `(target[0], target[1])`. There are several ghosts on the map, the i-th ghost starts at `(ghosts[i][0], ghosts[i][1])`. + +Each turn, you and all ghosts simultaneously *may* move in one of 4 cardinal directions: north, east, west, or south, going from the previous point to a new point 1 unit of distance away. + +You escape if and only if you can reach the target before any ghost reaches you (for any given moves the ghosts may take.) If you reach any square (including the target) at the same time as a ghost, it doesn't count as an escape. + +Return True if and only if it is possible to escape. + +```text +Example 1: +Input: +ghosts = [[1, 0], [0, 3]] +target = [0, 1] +Output: true +Explanation: +You can directly reach the destination (0, 1) at time 1, while the ghosts located at (1, 0) or (0, 3) have no way to catch up with you. +``` + +```text +Example 2: +Input: +ghosts = [[1, 0]] +target = [2, 0] +Output: false +Explanation: +You need to reach the destination (2, 0), but the ghost at (1, 0) lies between you and the destination. +``` + +```text +Example 3: +Input: +ghosts = [[2, 0]] +target = [1, 0] +Output: false +Explanation: +The ghost can reach the target at the same time as you. +``` + +Note: + +1. All points have coordinates with absolute value <= 10000. +1. The number of ghosts will not exceed 100. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0789.escape-the-ghosts/escape-the-ghosts.go b/Algorithms/0789.escape-the-ghosts/escape-the-ghosts.go new file mode 100755 index 000000000..9da29fbbc --- /dev/null +++ b/Algorithms/0789.escape-the-ghosts/escape-the-ghosts.go @@ -0,0 +1,23 @@ +package problem0789 + +func escapeGhosts(ghosts [][]int, target []int) bool { + steps := countSteps([]int{0, 0}, target) + for _, g := range ghosts { + if steps >= countSteps(g, target) { + // 表示 ghost 可以在终点等着 + return false + } + } + return true +} + +func countSteps(from, to []int) int { + return abs(to[0]-from[0]) + abs(to[1]-from[1]) +} + +func abs(n int) int { + if n < 0 { + return -n + } + return n +} diff --git a/Algorithms/0789.escape-the-ghosts/escape-the-ghosts_test.go b/Algorithms/0789.escape-the-ghosts/escape-the-ghosts_test.go new file mode 100755 index 000000000..61c11d6a0 --- /dev/null +++ b/Algorithms/0789.escape-the-ghosts/escape-the-ghosts_test.go @@ -0,0 +1,59 @@ +package problem0789 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ghosts [][]int + target []int + ans bool +}{ + + { + [][]int{{-1, 0}, {0, 1}, {-1, 0}, {0, 1}, {-1, 0}}, + []int{0, 0}, + true, + }, + + { + [][]int{{1, 0}, {0, 3}}, + []int{0, 1}, + true, + }, + + { + [][]int{{1, 0}}, + []int{2, 0}, + false, + }, + + { + [][]int{{2, 0}}, + []int{1, 0}, + false, + }, + + // 可以有多个 testcase +} + +func Test_escapeGhosts(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, escapeGhosts(tc.ghosts, tc.target), "输入:%v", tc) + } +} + +func Benchmark_escapeGhosts(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + escapeGhosts(tc.ghosts, tc.target) + } + } +} diff --git a/Algorithms/0790.domino-and-tromino-tiling/README.md b/Algorithms/0790.domino-and-tromino-tiling/README.md new file mode 100755 index 000000000..b027ee429 --- /dev/null +++ b/Algorithms/0790.domino-and-tromino-tiling/README.md @@ -0,0 +1,34 @@ +# [790. Domino and Tromino Tiling](https://leetcode.com/problems/domino-and-tromino-tiling/) + +## 题目 + +We have two types of tiles: a 2x1 domino shape, and an "L" tromino shape. These shapes may be rotated. + +```text +XX <- domino + +XX <- "L" tromino +X +``` + +Given N, how many ways are there to tile a 2 x N board? Return your answer modulo 10^9 + 7. + +(In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.) + +```text +Example: +Input: 3 +Output: 5 +Explanation: +The five different ways are listed below, different letters indicates different tiles: +XYZ XXZ XYY XXY XYY +XYZ YYZ XZZ XYY XXY +``` + +Note: + +1. N will be in range [1, 1000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling.go b/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling.go new file mode 100755 index 000000000..dad86a4c0 --- /dev/null +++ b/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling.go @@ -0,0 +1,17 @@ +package problem0790 + +const mod = 1e9 + 7 + +func numTilings(N int) int { + dp := [1001]int{1: 1, 2: 2, 3: 5} + if N <= 3 { + return dp[N] + } + + for i := 4; i <= N; i++ { + dp[i] = 2*dp[i-1] + dp[i-3] + dp[i] %= mod + } + + return dp[N] +} diff --git a/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling_test.go b/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling_test.go new file mode 100755 index 000000000..9561d0ccc --- /dev/null +++ b/Algorithms/0790.domino-and-tromino-tiling/domino-and-tromino-tiling_test.go @@ -0,0 +1,64 @@ +package problem0790 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 5, + 24, + }, + + { + 4, + 11, + }, + + { + 3, + 5, + }, + + { + 2, + 2, + }, + + { + 1, + 1, + }, + + { + 1000, + 979232805, + }, + + // 可以有多个 testcase +} + +func Test_numTilings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numTilings(tc.N), "输入:%v", tc) + } +} + +func Benchmark_numTilings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numTilings(tc.N) + } + } +} diff --git a/Algorithms/0791.custom-sort-string/README.md b/Algorithms/0791.custom-sort-string/README.md new file mode 100755 index 000000000..9db8e5c62 --- /dev/null +++ b/Algorithms/0791.custom-sort-string/README.md @@ -0,0 +1,30 @@ +# [791. Custom Sort String](https://leetcode.com/problems/custom-sort-string/) + +## 题目 + +S and T are strings composed of lowercase letters. In S, no letter occurs more than once. + +S was sorted in some custom order previously. We want to permute the characters of T so that they match the order that S was sorted. More specifically, if x occurs before y in S, then x should occur before y in the returned string. + +Return any permutation of T (as a string) that satisfies this property. + +```text +Example : +Input: +S = "cba" +T = "abcd" +Output: "cbad" +Explanation: +"a", "b", "c" appear in S, so the order of "a", "b", "c" should be "c", "b", and "a". +Since "d" does not appear in S, it can be at any position in T. "dcba", "cdba", "cbda" are also valid outputs. +``` + +Note: + +1. S has length at most 26, and no character is repeated in S. +1. T has length at most 200. +1. S and T consist of lowercase letters only. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0791.custom-sort-string/custom-sort-string.go b/Algorithms/0791.custom-sort-string/custom-sort-string.go new file mode 100755 index 000000000..78e0593b2 --- /dev/null +++ b/Algorithms/0791.custom-sort-string/custom-sort-string.go @@ -0,0 +1,16 @@ +package problem0791 + +import ( + "strings" +) + +func customSortString(S string, T string) string { + res := "" + for i := 0; i < len(S); i++ { + count := strings.Count(T, S[i:i+1]) + res += strings.Repeat(S[i:i+1], count) + T = strings.Replace(T, S[i:i+1], "", -1) + } + + return res + T +} diff --git a/Algorithms/0791.custom-sort-string/custom-sort-string_test.go b/Algorithms/0791.custom-sort-string/custom-sort-string_test.go new file mode 100755 index 000000000..e70d60770 --- /dev/null +++ b/Algorithms/0791.custom-sort-string/custom-sort-string_test.go @@ -0,0 +1,47 @@ +package problem0791 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + T string + ans string +}{ + + { + "cba", + "abcd", + "cbad", + }, + + { + "cba", + "abcdbca", + "ccbbaad", + }, + + // 可以有多个 testcase +} + +func Test_customSortString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, customSortString(tc.S, tc.T), "输入:%v", tc) + } +} + +func Benchmark_customSortString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + customSortString(tc.S, tc.T) + } + } +} diff --git a/Algorithms/0792.number-of-matching-subsequences/README.md b/Algorithms/0792.number-of-matching-subsequences/README.md new file mode 100755 index 000000000..ee7ac8c0d --- /dev/null +++ b/Algorithms/0792.number-of-matching-subsequences/README.md @@ -0,0 +1,25 @@ +# [792. Number of Matching Subsequences](https://leetcode.com/problems/number-of-matching-subsequences/) + +## 题目 + +Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S. + +```text +Example : +Input: +S = "abcde" +words = ["a", "bb", "acd", "ace"] +Output: 3 +Explanation: There are three words in words that are a subsequence of S: "a", "acd", "ace". +``` + +Note: + +1. All words in words and S will only consists of lowercase letters. +1. The length of S will be in the range of [1, 50000]. +1. The length of words will be in the range of [1, 5000]. +1. The length of words[i] will be in the range of [1, 50]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences.go b/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences.go new file mode 100755 index 000000000..54be3bd43 --- /dev/null +++ b/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences.go @@ -0,0 +1,27 @@ +package problem0792 + +func numMatchingSubseq(s string, words []string) int { + dic := make(map[string]int, len(words)) + for _, w := range words { + dic[w]++ + } + + res := 0 + for w := range dic { + if isMatching(s, w) { + res += dic[w] + } + } + + return res +} + +func isMatching(s, w string) bool { + m, n, j := len(s), len(w), 0 + for i := 0; i < m && j < n; i++ { + if s[i] == w[j] { + j++ + } + } + return j == n +} diff --git a/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences_test.go b/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences_test.go new file mode 100755 index 000000000..6003044c4 --- /dev/null +++ b/Algorithms/0792.number-of-matching-subsequences/number-of-matching-subsequences_test.go @@ -0,0 +1,80 @@ +package problem0792 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + words []string + ans int +}{ + + { + + "abcde", + []string{"a", "bb", "acd", "ace"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numMatchingSubseq(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numMatchingSubseq(tc.S, tc.words), "输入:%v", tc) + } +} + +func Benchmark_numMatchingSubseq(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numMatchingSubseq(tc.S, tc.words) + } + } +} + +func Test_isMatching(t *testing.T) { + type args struct { + s string + c string + } + tests := []struct { + name string + args args + want bool + }{ + + { + "包含", + args{ + s: "abc", + c: "abc", + }, + true, + }, + + { + "不包含", + args{ + s: "abc", + c: "abd", + }, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := isMatching(tt.args.s, tt.args.c); got != tt.want { + t.Errorf("isMatching() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/Algorithms/0793.preimage-size-of-factorial-zeroes-function/README.md b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/README.md new file mode 100755 index 000000000..6578babcb --- /dev/null +++ b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/README.md @@ -0,0 +1,27 @@ +# [793. Preimage Size of Factorial Zeroes Function](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/) + +## 题目 + +Let f(x) be the number of zeroes at the end of x!. (Recall that `x! = 1 * 2 * 3 * ... * x`, and by convention, 0! = 1.) + +For example, f(3) = 0 because 3! = 6 has no zeroes at the end, while f(11) = 2 because 11! = 39916800 has 2 zeroes at the end. Given K, find how many non-negative integers x have the property that f(x) = K. + +```text +Example 1: +Input: K = 0 +Output: 5 +Explanation: 0!, 1!, 2!, 3!, and 4! end with K = 0 zeroes. + +Example 2: +Input: K = 5 +Output: 0 +Explanation: There is no x such that x! ends in K = 5 zeroes. +``` + +Note: + +1. K will be an integer in the range [0, 10^9]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function.go b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function.go new file mode 100755 index 000000000..c46b1aae3 --- /dev/null +++ b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function.go @@ -0,0 +1,29 @@ +package problem0793 + +// https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/discuss/117821/Four-binary-search-solutions-based-on-different-ideas + +func preimageSizeFZF(k int) int { + l, r := 0, 5*(k+1) + for l <= r { + m := l + (r-l)/2 + km := zeros(m) + if km < k { + l = m + 1 + } else if km > k { + r = m - 1 + } else { + return 5 + } + } + return 0 +} + +// 返回 x! 尾部的 0 的个数 +func zeros(x int) int { + res := 0 + for x > 0 { + res += x / 5 + x /= 5 + } + return res +} diff --git a/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function_test.go b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function_test.go new file mode 100755 index 000000000..b1e25124b --- /dev/null +++ b/Algorithms/0793.preimage-size-of-factorial-zeroes-function/preimage-size-of-factorial-zeroes-function_test.go @@ -0,0 +1,59 @@ +package problem0793 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + K int + ans int +}{ + + { + 0, + 5, + }, + + { + 17, + 0, + }, + + { + 11, + 0, + }, + + { + 79, + 0, + }, + + { + 5, + 0, + }, + + // 可以有多个 testcase +} + +func Test_preimageSizeFZF(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, preimageSizeFZF(tc.K), "输入:%v", tc) + } +} + +func Benchmark_preimageSizeFZF(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + preimageSizeFZF(tc.K) + } + } +} diff --git a/Algorithms/0794.valid-tic-tac-toe-state/README.md b/Algorithms/0794.valid-tic-tac-toe-state/README.md new file mode 100755 index 000000000..7048204d8 --- /dev/null +++ b/Algorithms/0794.valid-tic-tac-toe-state/README.md @@ -0,0 +1,45 @@ +# [794. Valid Tic-Tac-Toe State](https://leetcode.com/problems/valid-tic-tac-toe-state/) + +## 题目 + +A Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to reach this board position during the course of a valid tic-tac-toe game. + +The board is a 3 x 3 array, and consists of characters " ", "X", and "O". The " " character represents an empty square. + +Here are the rules of Tic-Tac-Toe: + +- Players take turns placing characters into empty squares (" "). +- The first player always places "X" characters, while the second player always places "O" characters. +- "X" and "O" characters are always placed into empty squares, never filled ones. +- The game ends when there are 3 of the same (non-empty) character filling any row, column, or diagonal. +- The game also ends if all squares are non-empty. +- No more moves can be played if the game is over. + +```text +Example 1: +Input: board = ["O ", " ", " "] +Output: false +Explanation: The first player always plays "X". + +Example 2: +Input: board = ["XOX", " X ", " "] +Output: false +Explanation: Players take turns making moves. + +Example 3: +Input: board = ["XXX", " ", "OOO"] +Output: false + +Example 4: +Input: board = ["XOX", "O O", "XOX"] +Output: true +``` + +Note: + +1. board is a length-3 array of strings, where each string board[i] has length 3. +1. Each board[i][j] is a character in the set {" ", "X", "O"}. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state.go b/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state.go new file mode 100755 index 000000000..d591e43de --- /dev/null +++ b/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state.go @@ -0,0 +1,41 @@ +package problem0794 + +func validTicTacToe(board []string) bool { + xs, os := count(board) + + if isWin('X', board) { + return xs == os+1 && !isWin('O', board) + } + + if isWin('O', board) { + return xs == os && !isWin('X', board) + } + + return xs == os+1 || xs == os +} + +func count(board []string) (xs, os int) { + for i := 0; i < 3; i++ { + for j := 0; j < 3; j++ { + switch board[i][j] { + case 'X': + xs++ + case 'O': + os++ + } + } + } + return +} + +func isWin(c byte, b []string) bool { + for i := 0; i < 3; i++ { + if (b[i][0] == c && b[i][1] == c && b[i][2] == c) || + (b[0][i] == c && b[1][i] == c && b[2][i] == c) { + return true + } + } + + return b[0][0] == c && b[1][1] == c && b[2][2] == c || + b[0][2] == c && b[1][1] == c && b[2][0] == c +} diff --git a/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state_test.go b/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state_test.go new file mode 100755 index 000000000..3a94d27cd --- /dev/null +++ b/Algorithms/0794.valid-tic-tac-toe-state/valid-tic-tac-toe-state_test.go @@ -0,0 +1,59 @@ +package problem0794 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board []string + ans bool +}{ + + { + []string{"O ", " ", " "}, + false, + }, + + { + []string{"XOX", " X ", " "}, + false, + }, + + { + []string{"X X", "X ", "OOO"}, + true, + }, + + { + []string{"XXX", " ", "OOO"}, + false, + }, + + { + []string{"XOX", "O O", "XOX"}, + true, + }, + + // 可以有多个 testcase +} + +func Test_validTicTacToe(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, validTicTacToe(tc.board), "输入:%v", tc) + } +} + +func Benchmark_validTicTacToe(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validTicTacToe(tc.board) + } + } +} diff --git a/Algorithms/0795.number-of-subarrays-with-bounded-maximum/README.md b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/README.md new file mode 100755 index 000000000..e01616265 --- /dev/null +++ b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/README.md @@ -0,0 +1,26 @@ +# [795. Number of Subarrays with Bounded Maximum](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/) + +## 题目 + +We are given an array A of positive integers, and two positive integers L and R (L <= R). + +Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least L and at most R. + +```text +Example : +Input: +A = [2, 1, 4, 3] +L = 2 +R = 3 +Output: 3 +Explanation: There are three subarrays that meet the requirements: [2], [2, 1], [3]. +``` + +Note: + +1. L, R ; and A[i] will be an integer in the range [0, 10^9]. +1. The length of A will be in the range of [1, 50000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum.go b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum.go new file mode 100755 index 000000000..b67df4281 --- /dev/null +++ b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum.go @@ -0,0 +1,44 @@ +package problem0795 + +func numSubarrayBoundedMax(a []int, l int, r int) int { + res, heads, tails := 0, 0, 0 + isHead := func(x int) bool { + return l <= x && x <= r + } + isTail := func(x int) bool { + return x < l + } + + // 每一个合格的 subarray 都必须至少含有一个 head + + // 在按顺序迭代的过程中 + // res += 以 a[i] 为末尾元素的 subarray 的个数,如果 a[i] 是 head 或 tail 的话 + for i := 0; i < len(a); i++ { + if isTail(a[i]) { + tails++ + // 如果 a[i] 是 tail 的话 + // 此前所有包含了 head 的 subarray 都能够延续到 a[i] 成为新的 subarray + // 所以 res += heads,要把这些 heads 统计进去 + res += heads + } else if isHead(a[i]) { + // 如果 a[i] 是 head + // heads = heads + tails + 1 + // ↑ ↑ ↑ + // | | a[i:i+1] 单独一个元素组成的 subarray + // | a[i-x:i+1], 1<=x<=tails 这 tails 个 subarray + // a[i-y:i+1], tails < y <= heads + tails 这 heads 个 subarray + // 可以看到这些 subarray 的末尾都是 a[i] + heads += tails + 1 + // tails 重置为 0 是因为,算上 a[i] 后 + // a[i-z:i+1] 的末尾,不存在 tail + tails = 0 + res += heads + } else { + // 超过 head 的话,需要重新计算 + heads = 0 + tails = 0 + } + } + + return res +} diff --git a/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum_test.go b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum_test.go new file mode 100755 index 000000000..0ba470ff2 --- /dev/null +++ b/Algorithms/0795.number-of-subarrays-with-bounded-maximum/number-of-subarrays-with-bounded-maximum_test.go @@ -0,0 +1,50 @@ +package problem0795 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + L int + R int + ans int +}{ + + { + []int{2, 2, 4, 3}, + 2, + 3, + 4, + }, + + { + []int{2, 1, 4, 3}, + 2, + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numSubarrayBoundedMax(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numSubarrayBoundedMax(tc.A, tc.L, tc.R), "输入:%v", tc) + } +} + +func Benchmark_numSubarrayBoundedMax(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSubarrayBoundedMax(tc.A, tc.L, tc.R) + } + } +} diff --git a/Algorithms/0796.rotate-string/README.md b/Algorithms/0796.rotate-string/README.md new file mode 100755 index 000000000..bf2677c95 --- /dev/null +++ b/Algorithms/0796.rotate-string/README.md @@ -0,0 +1,25 @@ +# [796. Rotate String](https://leetcode.com/problems/rotate-string/) + +## 题目 + +We are given two strings, A and B. + +A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A. + +```text +Example 1: +Input: A = 'abcde', B = 'cdeab' +Output: true + +Example 2: +Input: A = 'abcde', B = 'abced' +Output: false +``` + +Note: + +1. A and B will have length at most 100. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0796.rotate-string/rotate-string.go b/Algorithms/0796.rotate-string/rotate-string.go new file mode 100755 index 000000000..76c684ee5 --- /dev/null +++ b/Algorithms/0796.rotate-string/rotate-string.go @@ -0,0 +1,10 @@ +package problem0796 + +import ( + "strings" +) + +func rotateString(A string, B string) bool { + return len(A) == len(B) && + strings.Contains(A+A, B) +} diff --git a/Algorithms/0796.rotate-string/rotate-string_test.go b/Algorithms/0796.rotate-string/rotate-string_test.go new file mode 100755 index 000000000..a742957e5 --- /dev/null +++ b/Algorithms/0796.rotate-string/rotate-string_test.go @@ -0,0 +1,53 @@ +package problem0796 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A string + B string + ans bool +}{ + + { + "abcde", + "cdeab", + true, + }, + + { + "aa", + "a", + false, + }, + + { + "abcde", + "abced", + false, + }, + + // 可以有多个 testcase +} + +func Test_rotateString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rotateString(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_rotateString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rotateString(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0797.all-paths-from-source-to-target/README.md b/Algorithms/0797.all-paths-from-source-to-target/README.md new file mode 100755 index 000000000..f233cdf3a --- /dev/null +++ b/Algorithms/0797.all-paths-from-source-to-target/README.md @@ -0,0 +1,28 @@ +# [797. All Paths From Source to Target](https://leetcode.com/problems/all-paths-from-source-to-target/) + +## 题目 + +Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order. + +The graph is given as follows: the nodes are 0, 1, ..., graph.length - 1. graph[i] is a list of all nodes j for which the edge (i, j) exists. + +```text +Example: +Input: [[1,2], [3], [3], []] +Output: [[0,1,3],[0,2,3]] +Explanation: The graph looks like this: +0--->1 +| | +v v +2--->3 +There are two paths: 0 -> 1 -> 3 and 0 -> 2 -> 3. +``` + +Note: + +1. The number of nodes in the graph will be in the range [2, 15]. +1. You can print different paths in any order, but you should keep the order of nodes inside one path. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target.go b/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target.go new file mode 100755 index 000000000..220ac7de2 --- /dev/null +++ b/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target.go @@ -0,0 +1,23 @@ +package problem0797 + +func allPathsSourceTarget(graph [][]int) [][]int { + path := make([]int, len(graph)) + res := make([][]int, 0, len(graph)) + + dfs(0, len(graph)-1, 1, path, graph, &res) + + return res +} + +func dfs(id, dst, pathLen int, path []int, graph [][]int, res *[][]int) { + if id == dst { + temp := make([]int, pathLen) + copy(temp, path) + *res = append(*res, temp) + } + + for _, node := range graph[id] { + path[pathLen] = node + dfs(node, dst, pathLen+1, path, graph, res) + } +} diff --git a/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target_test.go b/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target_test.go new file mode 100755 index 000000000..df90c93ae --- /dev/null +++ b/Algorithms/0797.all-paths-from-source-to-target/all-paths-from-source-to-target_test.go @@ -0,0 +1,39 @@ +package problem0797 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + ans [][]int +}{ + + { + [][]int{{1, 2}, {3}, {3}, {}}, + [][]int{{0, 1, 3}, {0, 2, 3}}, + }, + + // 可以有多个 testcase +} + +func Test_allPathsSourceTarget(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, allPathsSourceTarget(tc.graph), "输入:%v", tc) + } +} + +func Benchmark_allPathsSourceTarget(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + allPathsSourceTarget(tc.graph) + } + } +} diff --git a/Algorithms/0798.smallest-rotation-with-highest-score/README.md b/Algorithms/0798.smallest-rotation-with-highest-score/README.md new file mode 100755 index 000000000..f0eb25bc1 --- /dev/null +++ b/Algorithms/0798.smallest-rotation-with-highest-score/README.md @@ -0,0 +1,41 @@ +# [798. Smallest Rotation with Highest Score](https://leetcode.com/problems/smallest-rotation-with-highest-score/) + +## 题目 + +Given an array A, we may rotate it by a non-negative integer K so that the array becomes A[K], A[K+1], A{K+2], ... A[A.length - 1], A[0], A[1], ..., A[K-1]. Afterward, any entries that are less than or equal to their index are worth 1 point. + +For example, if we have [2, 4, 1, 3, 0], and we rotate by K = 2, it becomes [1, 3, 0, 2, 4]. This is worth 3 points because 1 > 0 [no points], 3 > 1 [no points], 0 <= 2 [one point], 2 <= 3 [one point], 4 <= 4 [one point]. + +Over all possible rotations, return the rotation index K that corresponds to the highest score we could receive. If there are multiple answers, return the smallest such index K. + +```text +Example 1: +Input: [2, 3, 1, 4, 0] +Output: 3 +Explanation: +Scores for each K are listed below: +K = 0, A = [2,3,1,4,0], score 2 +K = 1, A = [3,1,4,0,2], score 3 +K = 2, A = [1,4,0,2,3], score 3 +K = 3, A = [4,0,2,3,1], score 4 +K = 4, A = [0,2,3,1,4], score 3 +``` + +So we should choose K = 3, which has the highest score. + +```text +Example 2: +Input: [1, 3, 0, 2, 4] +Output: 0 +Explanation: A will always have 3 points no matter how it shifts. +So we will choose the smallest K, which is 0. +``` + +Note: + +1. Awill havelength at most 20000. +1. A[i] will be in the range [0, A.length]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score.go b/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score.go new file mode 100755 index 000000000..7ebe5f79e --- /dev/null +++ b/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score.go @@ -0,0 +1,37 @@ +package problem0798 + +// NOTICE: a[i] 的范围是 [0, len(a)) +// 所以,每次移动一格的话 +// a[0] 中的元素移动到了末尾 score++,只有这个会带来 score 加分 +// 同时,所有移动前 a[i]==i 的元素,会导致 score--,只有这个会带来 score 减分 +// 所以,不用计算具体的 score 是多少 +// 只要比较 score[k] = score[0] + delta[k] 中的 delta[k] 就好了 + +func bestRotation(a []int) int { + size := len(a) + delta := make([]int, size) + for i := 0; i < size; i++ { + delta[(i-a[i]+1+size)%size]-- + } + // 此时,假设 delta[3] == -2 + // 表示,每次移动一位的话 + // 第 3 次移动前,有 2 个元素是处于 a[i]==i 的状态, + // 所以,第 3 次移动后, score 需要减去 2 分 + + maxIdx := 0 + for k := 1; k < size; k++ { + // delta[k] = delta[k] + delta[k-1] + 1 + // ^ ^ ^ ^ + // | | | | + // | | | 第 k 次移动后,a[0] 移到末尾带来的加分 + // | | delta[k-1] = score[k-1] - score[0] + // | 第 k 次移动后,会带来的分数减少 + // delta[k] = score[k] - score[0] + delta[k] += delta[k-1] + 1 + if delta[maxIdx] < delta[k] { + maxIdx = k + } + } + + return maxIdx +} diff --git a/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score_test.go b/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score_test.go new file mode 100755 index 000000000..836774326 --- /dev/null +++ b/Algorithms/0798.smallest-rotation-with-highest-score/smallest-rotation-with-highest-score_test.go @@ -0,0 +1,64 @@ +package problem0798 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{4,3,2,1,0}, + 0, + }, + + { + []int{0,1,2,3,4}, + 0, + }, + + { + []int{2, 3, 1, 3, 0}, + 3, + }, + + { + []int{2, 3, 1, 4, 0}, + 3, + }, + + { + []int{8104, 16229, 12435, 814, 5896, 7257, 6385, 7256, 16977, 16783, 15629, 17787, 16045, 13616, 897, 18191, 10028, 11433, 14127, 10840, 10802, 17172, 13135, 17554, 7104, 3841, 16574, 4839, 9037, 8479, 14623, 7521, 11413, 11866, 3277, 17766, 15514, 6837, 7098, 9414, 12850, 521, 1988, 17808, 1664, 13314, 9573, 4545, 1286, 6848, 1431, 7007, 19062, 17098, 4140, 16495, 19537, 18778, 2310, 10681, 15387, 15298, 16682, 9693, 4828, 17960, 6255, 1220, 2620, 19707, 15199, 4997, 19918, 2620, 2983, 5195, 4850, 3149, 12563, 1182, 1811, 10120, 9030, 14260, 1086, 11744, 14940, 9880, 4969, 3364, 14485, 18285, 6856, 12041, 8925, 17816, 19629, 1823, 4585, 6983, 8197, 9982, 14732, 12595, 9092, 1807, 324, 5512, 5416, 2922, 14730, 6105, 14959, 458, 18829, 7780, 4639, 3829, 15170, 15016, 15271, 9283, 19602, 8546, 1367, 5402, 10773, 7707, 16536, 6620, 18306, 818, 18841, 10860, 9977, 4693, 10427, 2547, 4998, 19784, 17804, 17478, 12907, 4570, 15450, 19876, 187, 8798, 9338, 2599, 656, 15756, 18838, 11555, 15704, 76, 3400, 15429, 5111, 3282, 4209, 5491, 292, 1064, 15279, 8552, 10674, 14225, 12765, 14414, 6467, 17025, 3595, 6341, 12096, 14016, 9015, 11798, 7984, 18247, 18466, 9206, 2364, 19043, 16152, 4099, 11602, 1930, 1103, 17358, 1843, 4051, 13302, 11217, 15253, 6768, 9765, 14542, 18648, 11659, 10423, 18386, 12106, 6019, 35, 448, 6756, 11254, 19348, 16670, 9724, 6972, 1405, 10692, 8558, 17615, 18131, 9831, 1278, 4204, 16772, 10627, 5676, 5343, 2244, 17518, 13005, 16690, 13260, 10854, 9845, 14366, 1197, 16857, 523, 12633, 3483, 10201, 19010, 11346, 19465, 19163, 13681, 6227, 18587, 6654, 8226, 7993, 16077, 10959, 9115, 6611, 13237, 16089, 7800, 18687, 7746, 13843, 956, 15425, 11996, 10300, 18567, 15159, 12775, 5669, 12250, 10623, 14011, 179, 1210, 7604, 18286, 14358, 10602, 14046, 1478, 15986, 5239, 9151, 9792, 4967, 10888, 4475, 3831, 4680, 11640, 8556, 2410, 923, 18591, 3011, 9882, 6521, 1044, 12144, 7743, 8221, 13831, 8445, 3411, 9224, 3699, 6161, 4214, 1215, 10903, 578, 2051, 3790, 8998, 19220, 3777, 10119, 9959, 8214, 19688, 9375, 8774, 7976, 7937, 12996, 4675, 7206, 19596, 8216, 9783, 1320, 18532, 877, 4854, 11368, 10564, 10127, 6514, 4965, 8575, 7652, 7040, 13434, 4039, 13819, 2357, 14321, 13202, 18029, 16583, 3528, 1940, 2470, 6310, 3385, 18644, 14700, 9198, 11437, 4405, 2914, 16751, 1114, 19535, 12803, 17054, 11840, 10671, 8637, 19098, 5950, 1444, 14960, 3956, 14524, 9810, 2671, 960, 6160, 4181, 6537, 914, 17674, 3772, 5780, 5999, 4465, 18594, 12630, 13520, 15997, 5925, 4592, 17016, 17371, 15263, 11293, 8043, 2638, 19647, 6367, 3629, 4333, 17336, 17806, 17539, 19782, 13018, 14818, 17106, 1999, 15520, 14929, 6541, 15982, 17800, 327, 3768, 653, 2651, 9499, 14099, 18555, 11140, 9582, 17908, 3339, 11589, 14020, 16526, 14906, 13982, 10234, 3482, 7990, 15950, 15553, 7019, 17728, 4572, 8944, 6059, 3443, 587, 2547, 1253, 5053, 13118, 14766, 15602, 6972, 18708, 13912, 4333, 12897, 594, 12524, 5438, 11359, 15939, 13624, 7519, 13912, 3783, 5973, 19787, 1334, 17512, 5971, 15124, 12229, 6639, 12808, 1404, 19612, 10197, 18784, 6908, 2643, 15038, 5711, 15033, 10635, 6253, 10187, 12960, 7336, 4251, 3162, 6550, 2938, 10173, 931, 2075, 3460, 11977, 11066, 17004, 19796, 18660, 19389, 1407, 17904, 3302, 19106, 14691, 13107, 16624, 6988, 150, 15633, 993, 8760, 8878, 17983, 645, 9474, 1573, 768, 13561, 14119, 12896, 3137, 18048, 9465, 14068, 642, 17730, 8787, 16761, 9365, 16249, 6562, 16381, 6820, 13260, 4316, 2869, 4165, 2319, 18446, 13942, 748, 8877, 1880, 17357, 6225, 1835, 19966, 18063, 854, 2121, 2955, 15714, 13692, 13006, 11024, 11118, 9923, 7891, 4390, 7397, 10534, 10205, 11359, 12716, 8882, 12485, 12435, 7533, 4483, 8361, 8389, 6344, 3308, 5917, 10606, 11361, 7280, 7131, 4268, 105, 6589, 12091, 6661, 7082, 3046, 5606, 15190, 13680, 19719, 17909, 19561, 15899, 15861, 14620, 17012, 9266, 18992, 19804, 19472, 9735, 11375, 11056, 5135, 4076, 3623, 8848, 3029, 15726, 3889, 16521, 17873, 9424, 14160, 10766, 17618, 15193, 8186, 14598, 4563, 9068, 11619, 17772, 12944, 4401, 5373, 10910, 16897, 8768, 16830, 14680, 4933, 9780, 12340, 10519, 4649, 12132, 14188, 18041, 17884, 2629, 7614, 14972, 193, 801, 15468, 2360, 14030, 6550, 3602, 18288, 6068, 921, 14306, 10260, 3891, 14950, 1365, 17141, 282, 15615, 18789, 1510, 116, 291, 34, 7739, 13793, 17185, 10003, 4946, 2958, 9347, 10138, 12877, 7975, 3564, 2238, 14956, 2898, 1644, 15617, 9748, 5812, 1482, 4515, 11402, 8540, 1201, 7365, 15750, 624, 17918, 12822, 12190, 212, 19584, 469, 5025, 6508, 11943, 13673, 12581, 6378, 8681, 14867, 18482, 19881, 10635, 13975, 108, 13592, 13733, 9661, 1386, 11652, 3277, 15488, 5787, 7094, 7881, 13844, 516, 106, 3661, 12114, 14646, 15821, 12882, 9459, 9200, 19549, 4851, 11686, 6206, 8229, 9003, 8170, 8485, 7951, 13491, 18981, 5747, 7808, 3994, 941, 2145, 12603, 19504, 17728, 3430, 5378, 11924, 6641, 2822, 471, 17727, 1311, 17519, 7116, 9761, 3964, 13348, 3877, 2952, 18486, 5568, 17174, 12411, 15242, 2090, 1868, 1607, 8237, 6376, 17295, 2381, 18781, 12540, 633, 10601, 270, 6534, 5366, 17241, 14532, 8828, 11632, 1472, 11367, 7206, 3436, 2025, 8306, 12574, 15780, 8170, 19341, 10669, 17348, 7099, 18771, 1762, 19166, 2949, 639, 1548, 9047, 15699, 16398, 8887, 2568, 7018, 13149, 5653, 5177, 97, 906, 8655, 4237, 14428, 14775, 14451, 6566, 6397, 7862, 13991, 15273, 891, 8704, 17832, 2015, 4966, 7379, 12969, 6128, 14721, 13364, 17071, 4358, 16248, 9494, 7818, 3634, 10681, 19389, 18200, 7325, 14349, 7042, 8591, 14298, 10068, 8972, 12041, 6189, 5510, 12773, 1375, 12762, 2967, 6745, 12683, 17360, 3349, 14209, 12094, 8589, 1128, 16382, 731, 18981, 12908, 14591, 12956, 16935, 3850, 10039, 17702, 7117, 8112, 4652, 15889, 1087, 9975, 6640, 18440, 15472, 1708, 4452, 3686, 6114, 13268, 15295, 11851, 17897, 8525, 16493, 8779, 15080, 9828, 8264, 2383, 464, 9968, 18140, 4166, 2961, 14729, 10574, 9853, 7241, 8924, 17793, 12193, 13399, 18045, 13048, 7294, 6705, 15421, 13613, 2614, 4720, 12307, 2865, 14532, 3269, 6036, 9139, 2066, 10149, 8779, 2071, 6666, 2342, 2522, 2899, 2067, 3808, 14923, 1967, 10520, 109, 18100, 7010, 11966, 12168, 12337, 5393, 17983, 3864, 10012, 2733, 2577, 14275, 13052, 15562, 10213, 3866, 5800, 19789, 8513, 7112, 2192, 18580, 9455, 17925, 7646, 6746, 4818, 16171, 16067, 14049, 8400, 7787, 669, 9557, 5001, 6912, 4840, 6835, 18709, 19627, 3208, 15878, 9512, 3765, 3240, 19199, 84, 3422, 18873, 19496, 6454, 2555, 1001, 9524, 10520, 15710, 18284, 7820, 16801, 3017, 10700, 10311, 6244, 2943, 2452, 1835, 17198, 2389, 7511, 3668, 9427, 18441, 3729, 1425, 13279, 17050, 8662, 13015, 10486, 5884, 13277, 16365, 15110, 1605, 15776, 11021, 2199, 2615, 12651, 4712, 14612, 9920, 18374, 3893, 3552, 4992, 1745, 6154, 9698, 8630, 17091, 7822, 19522, 19419, 14031, 2651, 12214, 2559, 3386, 918, 12472, 17034, 11832, 1996, 14234, 1344, 5008, 16276, 9660, 17257, 17664, 16129, 10714, 5641, 2607, 16381, 3448, 5648, 9615, 12074, 2203, 1852, 8271, 8201, 11271, 15167, 6905, 18936, 11787, 17441, 11998, 17477, 19993, 3003, 4930, 18687, 6885, 16479, 14122, 4079, 19764, 6952, 10485, 9271, 10117, 6843, 3863, 8534, 10709, 8214, 1216, 10022, 15886, 619, 4486, 10935, 17739, 15356, 10999, 8540, 11830, 17716, 3771, 13252, 5340, 10247, 16841, 17949, 17995, 1207, 9528, 16760, 4055, 14224, 7095, 12613, 4265, 7582, 5775, 17722, 1800, 4426, 17012, 9878, 2544, 17461, 4518, 10851, 12265, 5380, 15844, 6717, 11197, 8540, 16428, 7425, 19057, 6987, 6336, 6574, 14903, 19582, 17120, 14078, 10245, 7712, 3918, 729, 17949, 4760, 16039, 16657, 12191, 16620, 14559, 10730, 13793, 8946, 7948, 12755, 3523, 11932, 10884, 4616, 9531, 11931, 19140, 537, 4549, 3391, 10294, 19753, 9793, 564, 1607, 2213, 17040, 7417, 1865, 8676, 10322, 4489, 11655, 14930, 17203, 12529, 2534, 15919, 9908, 19168, 10492, 19768, 9636, 1147, 15734, 18266, 18338, 10565, 3663, 8385, 6027, 18290, 7485, 7759, 7505, 4460, 5990, 5461, 6795, 622, 7172, 13727, 9949, 2741, 16091, 19353, 17337, 12296, 11343, 13957, 2851, 9213, 19618, 18226, 12051, 9495, 365, 553, 8022, 9644, 9880, 9006, 15823, 9920, 14582, 11966, 1497, 13909, 16163, 10916, 1241, 19449, 13483, 11589, 12984, 15922, 4399, 9501, 9310, 19952, 10877, 11182, 758, 10491, 10922, 12419, 11245, 11054, 14895, 2944, 19354, 5422, 19952, 9680, 14366, 680, 19913, 16108, 1989, 17031, 7086, 18334, 17286, 8072, 3401, 1650, 7457, 16243, 10615, 5894, 9998, 17355, 13279, 6706, 18748, 12585, 17810, 5267, 2904, 18599, 13327, 15891, 16154, 15382, 3808, 18214, 18370, 497, 4867, 19455, 128, 7820, 18899, 10296, 9269, 8902, 15918, 3479, 10219, 17351, 6015, 3497, 3153, 16689, 17605, 1322, 10822, 4349, 10463, 18508, 11295, 16133, 979, 163, 5874, 7407, 12912, 12591, 2076, 11663, 5907, 3721, 8232, 3830, 3749, 1991, 9238, 15492, 15002, 8547, 5735, 5126, 11491, 9598, 10181, 18564, 9581, 10414, 16140, 7552, 3641, 5581, 2238, 10512, 7113, 5024, 14629, 12975, 1318, 3271, 225, 1485, 3226, 19812, 10794, 4411, 4651, 3661, 6605, 19528, 15461, 19969, 1414, 16396, 17394, 17390, 3753, 15483, 17255, 9349, 1306, 4065, 13131, 14307, 1991, 5796, 13038, 2076, 15928, 3304, 4834, 16278, 2016, 18563, 16393, 11324, 2161, 9861, 2471, 11888, 17221, 6755, 6283, 15355, 2482, 15698, 15753, 5341, 15131, 16109, 16776, 15473, 1406, 8300, 12649, 12016, 19858, 9178, 11262, 3034, 7768, 3483, 9245, 9977, 161, 14680, 11062, 2227, 10256, 2816, 16245, 5685, 6362, 4700, 6464, 19752, 359, 1569, 6576, 13589, 10030, 5356, 18109, 8386, 10125, 14765, 4948, 18031, 9252, 10418, 4489, 2906, 9811, 532, 1104, 8987, 6877, 18973, 17870, 315, 11554, 777, 2709, 12320, 10458, 15969, 10622, 13322, 7817, 1670, 1864, 11338, 15679, 8206, 9760, 17098, 1420, 17392, 18258, 15299, 15707, 9600, 6537, 3183, 9362, 6811, 11401, 15595, 699, 1878, 12281, 5280, 13406, 9801, 12547, 8170, 350, 9981, 1278, 14909, 12324, 14285, 19414, 6643, 8656, 13811, 11874, 17846, 19548, 11555, 12858, 2232, 14976, 10046, 19191, 866, 2734, 3828, 2094, 7953, 11694, 18978, 3188, 18792, 18160, 950, 5406, 19532, 17935, 18548, 2678, 6195, 1512, 14908, 13405, 13523, 14350, 3192, 4279, 13368, 5393, 8396, 14106, 11571, 9131, 13871, 4484, 18787, 19892, 6580, 14509, 8727, 1269, 6582, 16960, 8847, 11578, 1248, 5229, 18429, 15037, 18627, 16398, 13924, 16009, 16832, 9207, 721, 5943, 14204, 4801, 14730, 3273, 15043, 12539, 11261, 15807, 7308, 6568, 9845, 8931, 18138, 9482, 3961, 14148, 11390, 13134, 4681, 17853, 9557, 6529, 89, 3893, 13575, 8763, 12107, 9439, 4834, 3252, 16877, 5168, 8530, 2723, 5739, 18021, 10297, 12112, 6405, 17793, 16562, 19147, 15600, 15615, 10531, 6011, 4673, 17204, 11485, 17556, 5285, 5412, 19589, 19841, 11884, 3205, 4494, 19696, 2956, 17973, 7991, 7590, 15457, 14837, 843, 565, 17413, 3516, 14488, 16603, 14998, 8707, 7028, 18875, 3009, 5324, 12186, 10984, 12647, 15559, 11337, 4260, 14232, 10592, 19734, 19775, 3412, 15360, 2724, 17295, 5431, 11054, 16219, 15428, 13026, 15874, 13940, 15882, 7756, 14394, 4604, 2301, 15283, 12753, 15727, 18476, 12742, 4155, 2084, 13760, 11368, 5770, 3458, 12440, 3799, 9637, 700, 7470, 19752, 398, 7658, 3312, 15257, 11877, 1166, 2398, 13487, 12355, 343, 281, 3617, 2393, 14643, 12131, 12539, 2241, 7941, 19509, 5452, 18181, 18889, 7064, 5585, 8420, 10684, 19189, 5052, 17325, 3703, 771, 9251, 14197, 13990, 14824, 19208, 3725, 8740, 8424, 15455, 672, 599, 11964, 14284, 3170, 18912, 5462, 17902, 1459, 11635, 9186, 14138, 4321, 4283, 16406, 3751, 19219, 9285, 10626, 17078, 6549, 8064, 12438, 3289, 16894, 4485, 342, 9796, 11179, 171, 15128, 6954, 18595, 280, 4653, 3595, 8896, 19053, 7902, 16131, 14069, 16126, 9044, 11688, 18818, 15453, 1604, 11412, 18832, 13702, 10589, 18067, 17967, 12964, 17415, 3429, 11078, 14157, 4536, 2583, 10771, 3306, 4317, 19050, 9728, 3233, 8061, 7965, 9128, 6959, 17029, 17135, 15420, 2293, 3254, 2976, 19987, 7504, 10466, 5254, 14665, 5996, 3275, 5223, 10916, 11162, 1813, 141, 14922, 11884, 9394, 12444, 4073, 3096, 12919, 15876, 3672, 4239, 5545, 16853, 19947, 4502, 18263, 13729, 19046, 13635, 1207, 11538, 1374, 18505, 10202, 5816, 3183, 8612, 14376, 16546, 13901, 6356, 14461, 2194, 16326, 18128, 7412, 5403, 2236, 12935, 18274, 1076, 557, 2979, 7865, 12144, 9932, 9893, 1010, 9094, 14883, 8877, 1354, 19888, 13503, 7656, 15102, 12122, 3695, 11573, 7158, 5248, 15747, 13678, 15870, 16033, 4673, 4201, 14698, 12863, 15121, 13982, 2248, 15340, 4739, 8892, 4617, 3450, 13927, 13952, 325, 14685, 1678, 9385, 5108, 18471, 1773, 2397, 3815, 495, 8296, 8295, 1516, 10926, 7176, 13895, 8665, 4405, 11221, 11055, 13119, 2181, 9501, 4746, 7617, 639, 3436, 19692, 14017, 13057, 18661, 16903, 15997, 8462, 16353, 11632, 3037, 2828, 133, 15435, 17340, 2144, 1724, 2884, 780, 3197, 19981, 8149, 14833, 12262, 14697, 1012, 7733, 3441, 13225, 4948, 11133, 2363, 4781, 8028, 3926, 7197, 2235, 15043, 3152, 13180, 7970, 15300, 8067, 19682, 3142, 17493, 994, 18619, 16546, 13560, 16574, 19109, 18350, 10358, 6771, 14021, 11351, 11649, 18074, 8380, 19062, 4038, 684, 10444, 3753, 12541, 13334, 12842, 16850, 456, 8448, 9071, 12112, 13391, 1792, 12825, 16225, 14199, 7786, 14981, 3313, 15081, 13382, 4710, 4347, 13995, 7794, 16224, 12420, 7102, 16339, 13852, 18082, 7706, 243, 13462, 13869, 491, 19238, 210, 13587, 11672, 13156, 8581, 6212, 15681, 18654, 6259, 2373, 14797, 17887, 7803, 10541, 52, 10388, 227, 947, 12709, 18961, 12254, 3467, 4493, 6791, 18953, 1501, 16043, 7027, 16709, 7766, 17155, 18821, 6283, 12410, 1148, 17903, 15817, 7403, 10663, 3242, 19205, 4828, 19510, 10697, 2613, 2113, 13821, 12505, 6649, 4936, 7445, 693, 10203, 14873, 15595, 1634, 7091, 4632, 540, 7883, 16372, 17386, 18225, 14951, 17204, 5562, 2264, 11336, 2446, 13592, 19773, 14869, 6858, 4789, 8390, 5551, 13967, 15675, 15396, 10018, 11594, 9344, 846, 17710, 3725, 1776, 11480, 6196, 6934, 9976, 8831, 14801, 283, 3177, 8392, 15725, 494, 3780, 2963, 2349, 19975, 6773, 613, 14368, 17070, 1359, 8305, 9055, 12340, 13525, 7561, 8596, 10094, 7347, 8554, 17573, 15480, 298, 16408, 18887, 9019, 15122, 1998, 1942, 18448, 3465, 16771, 18359, 12618, 19945, 8889, 2875, 10189, 7344, 4482, 5707, 2339, 5435, 19244, 19643, 12096, 18544, 15610, 18326, 17953, 14693, 8868, 479, 5578, 8272, 9525, 10558, 15468, 497, 4485, 7716, 8243, 11082, 11410, 13185, 10736, 10741, 1366, 6310, 744, 15522, 10223, 15215, 9465, 11901, 1322, 14058, 16170, 19125, 1391, 9257, 9674, 19949, 18005, 2085, 8997, 6010, 12642, 9178, 1431, 15957, 8772, 13010, 14996, 17468, 4635, 3827, 4430, 5801, 3863, 9727, 142, 9035, 14239, 12361, 16102, 3476, 4311, 871, 6944, 4117, 1515, 5157, 12279, 6812, 14407, 10967, 3120, 17375, 15306, 1644, 5065, 8737, 10566, 3791, 11863, 10954, 14299, 8678, 5859, 17833, 5317, 18982, 2525, 722, 9388, 7486, 7833, 1530, 7239, 14832, 12777, 10195, 7733, 6759, 7443, 12913, 16483, 11844, 678, 14582, 701, 7322, 13775, 17065, 10788, 6878, 18285, 10768, 2458, 11766, 6548, 8268, 11024, 9483, 14892, 1388, 2420, 150, 2973, 13166, 17360, 3547, 17280, 19794, 2243, 18709, 10188, 7265, 17249, 17642, 5935, 14392, 7448, 10201, 11714, 14327, 1319, 16979, 1497, 17757, 15311, 14911, 11109, 15093, 2679, 5117, 13193, 4940, 9381, 9039, 7920, 16643, 2148, 2835, 8432, 11467, 1770, 6775, 8995, 11135, 19209, 15252, 14379, 375, 7765, 412, 3962, 13843, 1811, 14928, 12554, 9007, 602, 5715, 4437, 2875, 967, 8120, 2533, 12897, 18531, 5339, 11899, 14792, 17297, 173, 14769, 4517, 15103, 893, 16950, 5866, 6773, 17175, 14186, 3976, 8699, 3986, 17246, 11102, 13738, 6955, 14941, 7702, 9728, 11776, 726, 11938, 16588, 1370, 8868, 19788, 1131, 235, 2428, 18590, 7435, 1744, 19530, 3428, 12924, 16212, 7521, 15208, 14038, 11899, 9197, 7390, 943, 9490, 12313, 5105, 454, 13007, 11150, 265, 10398, 17478, 2332, 7468, 15455, 14891, 11245, 13990, 6166, 6738, 2331, 7482, 12105, 10112, 9866, 118, 16025, 9558, 4024, 6214, 7683, 4951, 15663, 8846, 177, 14736, 19130, 15568, 18899, 5917, 4679, 5550, 4089, 12045, 16574, 2394, 19089, 13950, 10275, 2440, 18195, 17704, 4011, 11336, 4027, 9667, 12048, 13976, 14660, 6943, 19533, 14194, 1752, 7190, 812, 8566, 14440, 3747, 1741, 17940, 3136, 16837, 16393, 2340, 15750, 14847, 7808, 11384, 2649, 16443, 7582, 18819, 870, 18704, 10219, 7967, 11285, 12952, 13882, 18616, 11998, 3459, 2713, 16971, 19476, 3147, 13204, 987, 13828, 19148, 18207, 5979, 1774, 13400, 1355, 5539, 17307, 2638, 12223, 18578, 13257, 13208, 6076, 8389, 11930, 19755, 10445, 19040, 8389, 3417, 14079, 1840, 18675, 16124, 10770, 9908, 2477, 14115, 11106, 7960, 3905, 1472, 9881, 4141, 13632, 16869, 4210, 6811, 9515, 9418, 2171, 16222, 9139, 17710, 7063, 4521, 17818, 6682, 17054, 14215, 3321, 18440, 15170, 7519, 15985, 11761, 8890, 8490, 3834, 1096, 9782, 6602, 3707, 17720, 18724, 13218, 17609, 3452, 7607, 13751, 6429, 17741, 14075, 3443, 11033, 14186, 13801, 15479, 3232, 5091, 11645, 17196, 6841, 4129, 19008, 7612, 18314, 15904, 19722, 1857, 586, 6636, 387, 14376, 9366, 10455, 9030, 15744, 4551, 2505, 1739, 14650, 17297, 6529, 3037, 16479, 7367, 1734, 10085, 7725, 12768, 4046, 9843, 2505, 7059, 12249, 51, 7143, 13611, 4769, 19084, 11555, 5843, 1746, 6896, 5723, 6245, 14916, 12657, 16699, 12855, 18454, 12906, 277, 5609, 19209, 8072, 6267, 12618, 8156, 14073, 17086, 15369, 3698, 16028, 8701, 3004, 1241, 16444, 2746, 12014, 8241, 3003, 3619, 6026, 12419, 4092, 15269, 11118, 3005, 16407, 1797, 5668, 6610, 18498, 51, 16139, 12721, 6145, 10346, 16136, 258, 411, 17496, 9076, 15575, 16644, 16107, 39, 11651, 11443, 11082, 8848, 9881, 15292, 17295, 3810, 18072, 14791, 13896, 15021, 16058, 13513, 338, 2214, 9518, 15118, 8351, 12880, 15108, 10244, 17552, 7224, 2873, 8267, 3357, 752, 11478, 19573, 6031, 16874, 7220, 11230, 10349, 18109, 2990, 1336, 10125, 18966, 15774, 14279, 3994, 7519, 11149, 19013, 19646, 11052, 14674, 14746, 12936, 12254, 17457, 450, 16098, 2428, 3305, 16309, 1744, 9284, 18115, 17446, 7191, 12497, 5577, 12513, 5060, 13400, 1083, 4122, 11698, 1769, 15387, 7382, 16548, 3360, 980, 17032, 8808, 13818, 9176, 7721, 4311, 9947, 6438, 19616, 13744, 6951, 11647, 4213, 8820, 7773, 188, 12212, 12254, 19039, 12052, 8102, 19657, 19202, 15662, 6428, 2651, 12419, 14920, 5713, 3851, 12768, 4745, 1563, 8601, 8141, 2949, 11933, 3976, 6653, 502, 1638, 7752, 12309, 5694, 5638, 11550, 3154, 19684, 866, 12500, 1940, 1570, 8080, 12943, 4703, 8405, 12359, 11628, 5330, 15400, 18300, 17902, 16613, 3496, 8030, 16681, 490, 5651, 8825, 5303, 7229, 10467, 1362, 11962, 12435, 8768, 19230, 758, 13124, 18829, 16530, 10672, 14422, 8887, 12032, 19603, 337, 293, 17133, 13599, 2397, 14366, 14829, 5587, 11559, 1439, 2988, 17412, 16630, 14675, 1327, 15138, 3463, 15936, 18191, 18149, 10775, 7614, 16451, 12181, 12145, 13319, 11365, 16924, 19835, 12724, 9566, 15046, 5383, 4513, 15790, 8767, 3542, 12027, 3374, 5233, 125, 703, 2479, 10222, 4098, 1491, 206, 6281, 15129, 12722, 6286, 16811, 6418, 10219, 3346, 743, 19465, 6007, 13106, 1722, 9821, 14925, 5110, 16506, 11257, 8220, 10959, 17713, 2708, 7478, 8787, 8202, 2631, 1263, 13670, 12036, 10765, 4147, 9062, 10460, 4097, 9039, 737, 6427, 6422, 8274, 15436, 1453, 18182, 13584, 17729, 19775, 12644, 9943, 518, 9036, 16783, 10759, 1839, 8514, 15154, 13032, 152, 4303, 5986, 1446, 6407, 10784, 7273, 19852, 16130, 602, 19829, 7793, 18890, 849, 3183, 6532, 15865, 19167, 6826, 10992, 17828, 3143, 17155, 10777, 19179, 4101, 2783, 13152, 1430, 2752, 291, 3727, 8521, 2142, 11990, 14724, 12899, 12446, 1674, 3214, 16172, 14068, 3190, 7147, 11731, 18291, 7855, 12505, 8345, 18920, 15294, 12869, 17672, 2067, 10034, 10202, 16112, 5680, 18606, 9138, 13536, 11941, 970, 6344, 2021, 19166, 15479, 10382, 1997, 13858, 7793, 8907, 12811, 14514, 16575, 4002, 2955, 13306, 18426, 3035, 17384, 16750, 4651, 16646, 16380, 5015, 15568, 1158, 537, 18266, 2351, 19568, 5372, 7576, 2879, 16493, 9423, 15885, 18890, 17695, 4738, 6296, 5535, 13870, 19466, 14012, 80, 14955, 2899, 13451, 6588, 8535, 2437, 116, 2007, 17407, 4723, 12066, 11610, 1566, 19700, 4812, 1348, 223, 1823, 14534, 8412, 2421, 6984, 17714, 2367, 5354, 16465, 18086, 13013, 16611, 6105, 7501, 8770, 2360, 5098, 11825, 14777, 8481, 10195, 17476, 4817, 7072, 15963, 631, 6731, 3614, 13620, 4440, 5105, 816, 9001, 6045, 16173, 3515, 10042, 6010, 19744, 2256, 16658, 6125, 9669, 7889, 3195, 17623, 923, 12668, 7703, 3521, 4808, 17783, 17986, 14301, 15514, 1559, 15480, 18603, 2239, 16154, 13508, 15854, 14772, 17613, 15477, 14316, 3317, 8177, 5932, 19515, 18673, 19795, 4386, 7555, 373, 8294, 11359, 2307, 18638, 16642, 3408, 12090, 10591, 8869, 627, 7299, 7729, 14074, 2364, 19899, 2964, 3135, 10341, 11253, 6649, 10055, 15313, 1736, 12982, 7613, 10527, 5553, 15422, 9674, 4297, 11334, 13143, 14938, 17029, 3743, 15486, 15910, 11379, 1927, 19741, 4852, 10940, 17106, 19147, 19803, 2310, 16149, 18713, 9705, 16876, 12193, 866, 19127, 13122, 7787, 8521, 14467, 16784, 18131, 2203, 17865, 5736, 10751, 1914, 3233, 8298, 10132, 7065, 1429, 12237, 12130, 13008, 12359, 6419, 18803, 677, 1149, 6168, 15503, 13508, 4274, 10549, 12169, 17901, 17520, 19359, 8811, 8811, 19572, 16057, 14084, 4245, 13328, 18760, 9282, 6465, 18054, 3691, 17577, 9585, 5965, 3892, 11631, 538, 2499, 9410, 14817, 40, 14372, 15347, 5235, 15080, 5379, 7769, 7369, 12284, 7354, 14036, 3131, 18512, 10391, 12745, 9153, 3514, 17863, 5652, 19604, 19672, 15395, 11222, 18024, 75, 15522, 11338, 12897, 14310, 15219, 6702, 9330, 2369, 15355, 13268, 13735, 4185, 15835, 14333, 12056, 10171, 12, 2574, 4414, 3941, 2996, 3505, 7360, 17001, 15687, 6473, 17469, 19726, 1058, 2995, 12846, 9928, 18251, 15586, 15499, 1603, 13043, 5520, 8436, 14675, 3166, 7227, 8459, 921, 6636, 18056, 6104, 19047, 10840, 5920, 2435, 7138, 5141, 7521, 10347, 12929, 5518, 17407, 15326, 11197, 5800, 16910, 13948, 18954, 2438, 6243, 12977, 231, 3922, 3974, 1454, 1335, 15968, 13223, 1024, 11075, 7197, 1785, 13189, 10533, 15709, 5563, 2095, 17240, 13964, 17400, 7180, 15377, 16041, 2270, 15050, 8924, 14826, 18363, 581, 15810, 5797, 8851, 14969, 13884, 10606, 7037, 3563, 9986, 11012, 17654, 5003, 7332, 19419, 13294, 18235, 16682, 4215, 14904, 17468, 6019, 6033, 10881, 1679, 12976, 5273, 1381, 19440, 6201, 2036, 1830, 18393, 19986, 10161, 4601, 15373, 17670, 18203, 3616, 14045, 19445, 19978, 6316, 2531, 924, 12983, 5393, 18892, 1929, 3112, 16410, 3838, 4941, 7223, 18066, 14679, 1299, 14186, 4918, 7869, 11206, 6284, 16342, 13169, 10187, 1426, 1028, 1937, 1753, 11892, 10630, 3701, 10359, 10681, 11986, 11442, 652, 16834, 3333, 17620, 14548, 1875, 8708, 9349, 16246, 10294, 17240, 19779, 2524, 7749, 18757, 4947, 4026, 19172, 14460, 18676, 15134, 6127, 18105, 16003, 16782, 172, 4481, 11218, 10398, 9049, 1079, 7813, 10503, 11397, 275, 3067, 5188, 946, 6218, 15040, 1540, 1759, 10663, 4745, 1681, 5472, 1471, 6703, 2061, 7541, 3149, 17211, 627, 14367, 17935, 11073, 4494, 19837, 4377, 17681, 10405, 2836, 2445, 12347, 8800, 9060, 7823, 3938, 2156, 16931, 17498, 13316, 9244, 2884, 13220, 18336, 18315, 350, 13714, 12905, 15877, 19192, 3452, 10555, 3904, 6201, 1112, 5904, 16518, 19779, 12979, 16298, 7669, 14168, 886, 11486, 16462, 3069, 5573, 14767, 3523, 4870, 16159, 222, 11753, 7229, 15002, 10818, 18069, 12927, 7570, 4423, 16370, 13546, 16116, 4745, 2986, 15230, 14381, 14220, 19269, 4774, 17702, 15724, 4990, 14595, 10306, 1181, 8154, 7166, 15101, 16453, 6688, 5416, 8226, 9538, 16088, 13126, 11802, 18196, 15798, 18592, 16142, 16877, 17739, 19030, 19807, 4742, 3445, 7190, 1732, 10131, 15720, 19840, 14862, 9459, 14069, 7566, 6498, 4544, 14399, 4102, 19105, 5916, 1956, 4972, 16441, 14067, 16567, 6674, 16109, 5139, 8743, 9468, 12306, 7059, 17658, 7160, 8767, 15496, 11136, 9090, 6393, 18900, 19436, 4805, 9125, 662, 16358, 16443, 10326, 7252, 14943, 3573, 7554, 18818, 16124, 1381, 6829, 18805, 11160, 704, 15336, 3726, 13360, 15244, 92, 19841, 16146, 3419, 4462, 17909, 11742, 17992, 9421, 5846, 9205, 11231, 2935, 17169, 20, 1184, 19619, 12093, 68, 13288, 3371, 12695, 7756, 6596, 12777, 10165, 11321, 10341, 18151, 18631, 19391, 419, 10574, 12043, 17770, 7185, 5333, 13876, 19133, 9299, 13867, 2871, 13640, 3985, 7755, 17819, 5907, 7015, 3936, 8509, 11267, 15226, 4976, 16794, 13425, 16185, 10529, 1593, 12942, 11298, 14663, 5662, 18663, 3378, 5527, 15156, 16821, 3624, 4077, 12349, 7064, 14326, 13277, 16403, 3656, 11613, 4425, 4167, 15714, 10123, 3696, 15507, 8790, 18259, 7697, 6316, 12480, 1319, 11279, 13787, 19365, 5579, 8676, 15369, 3940, 11668, 7646, 6159, 7588, 804, 162, 11808, 9115, 9377, 17203, 13131, 1907, 18684, 4982, 17693, 19196, 4130, 443, 16428, 14815, 8088, 621, 1204, 14560, 12444, 6002, 1068, 4498, 10684, 6747, 3909, 9499, 16439, 11444, 10163, 13739, 10808, 9416, 19442, 4324, 15051, 11547, 7508, 5467, 7541, 11499, 14039, 3417, 5202, 13546, 14993, 18431, 10608, 18168, 13335, 7057, 6851, 4117, 19653, 8829, 3353, 17217, 9319, 14603, 13811, 1371, 2807, 12145, 9121, 12089, 3230, 19427, 9422, 2218, 7851, 15387, 11237, 6137, 17077, 5237, 17178, 3703, 15416, 2057, 4697, 19106, 7355, 8018, 14252, 12969, 13784, 3301, 2241, 19553, 11992, 15544, 9416, 1925, 14492, 4513, 16292, 12603, 15846, 17203, 5064, 19920, 7861, 1916, 3166, 17205, 14733, 15686, 3603, 15024, 2824, 16736, 10505, 7596, 14913, 9109, 8514, 14670, 1420, 5747, 18721, 559, 13734, 14705, 8184, 10482, 3403, 15416, 13915, 15790, 4455, 6907, 10701, 10735, 9466, 11531, 1273, 8906, 11895, 18937, 11396, 17901, 12850, 14439, 257, 18265, 9982, 13559, 15648, 2957, 2330, 3152, 12507, 4423, 8261, 2385, 2280, 352, 17608, 3452, 4595, 8083, 606, 18225, 6886, 18288, 869, 18011, 13487, 4424, 3245, 15564, 7881, 10877, 15091, 16578, 19117, 14133, 7468, 18819, 18430, 413, 8413, 10356, 4286, 8049, 17251, 10876, 15217, 6786, 2582, 16752, 1244, 1056, 6756, 15029, 16995, 12504, 5088, 5639, 12111, 18866, 16808, 4698, 18522, 9064, 2352, 17124, 9893, 7193, 18535, 18978, 11366, 1827, 7303, 13469, 6402, 7540, 4661, 627, 7445, 6541, 2772, 19348, 1116, 18760, 2106, 6048, 18567, 2655, 10379, 6369, 7186, 5635, 3869, 16426, 6851, 16080, 2810, 18396, 5314, 4922, 18078, 12149, 2492, 2710, 411, 3236, 8759, 69, 18179, 19168, 6037, 9316, 5329, 1581, 13366, 7924, 15392, 12514, 11086, 12381, 16691, 11044, 16427, 4730, 6647, 9897, 12255, 4062, 6338, 16540, 13332, 18214, 9981, 3451, 9879, 1382, 8014, 18764, 13692, 3296, 8729, 3118, 4307, 7109, 8181, 1036, 7897, 10591, 15611, 16857, 17858, 6482, 4252, 17323, 13175, 15210, 9429, 4127, 5796, 18282, 3212, 18751, 4054, 18382, 11789, 4455, 10269, 3870, 17380, 445, 1069, 8874, 2097, 9, 3569, 2406, 15907, 4807, 10168, 6334, 2728, 4601, 17662, 2387, 9128, 8448, 1372, 9280, 7777, 3716, 4779, 15377, 16035, 9889, 15774, 7521, 1615, 15343, 10132, 17177, 15535, 6389, 12956, 16534, 5047, 3190, 12863, 11508, 494, 15299, 4912, 5534, 10826, 13520, 4740, 2464, 9166, 19436, 10625, 698, 18153, 871, 8257, 19060, 14232, 11517, 19811, 6891, 6014, 472, 6466, 16504, 3755, 9965, 4665, 19737, 13022, 8048, 19423, 3790, 19984, 519, 19328, 10554, 5216, 19802, 150, 15146, 18786, 4082, 12944, 11027, 5860, 15971, 12412, 4623, 7222, 4921, 17814, 11438, 15331, 10580, 6730, 5362, 2963, 2549, 8780, 715, 2529, 14005, 11011, 12285, 12784, 7155, 14920, 1796, 6825, 2682, 622, 9210, 2532, 15182, 3002, 15275, 12641, 12899, 2106, 10975, 13903, 17281, 7208, 2129, 18138, 18887, 17370, 3328, 9523, 15921, 3826, 2313, 15762, 1428, 12198, 5492, 15200, 15428, 15445, 4220, 4403, 2263, 16442, 11947, 18702, 16304, 7387, 372, 2318, 4299, 14095, 14005, 2775, 9064, 3201, 14052, 4082, 7269, 19425, 1698, 3371, 4677, 7913, 215, 6429, 19407, 18602, 3187, 1073, 4891, 15581, 9021, 14203, 4030, 340, 10000, 4233, 8392, 11024, 2408, 4657, 19274, 5436, 495, 13473, 12096, 10480, 12025, 13092, 10628, 16376, 15621, 428, 19316, 7844, 16838, 1043, 10501, 7854, 2782, 2721, 14005, 5065, 4872, 1041, 5071, 2998, 12644, 13866, 396, 5584, 7710, 5316, 5902, 16467, 14738, 7613, 12299, 18898, 9079, 7571, 16844, 638, 33, 9629, 4227, 12834, 752, 509, 3648, 13442, 16560, 1674, 13650, 10227, 16996, 884, 19590, 13412, 825, 18021, 19175, 1398, 12721, 18919, 16137, 18314, 2622, 7476, 3041, 12051, 43, 6493, 18112, 17935, 18286, 2185, 2658, 15476, 207, 15538, 1087, 17277, 11322, 15072, 14605, 980, 15923, 5617, 6502, 13939, 9941, 2421, 19798, 16572, 9649, 18765, 15681, 17748, 11236, 10564, 3666, 18196, 3384, 19931, 16140, 11226, 13823, 16726, 13109, 14951, 5569, 15281, 1443, 18515, 8653, 5865, 1619, 17259, 18377, 8180, 19136, 19109, 19924, 12840, 18219, 18426, 7936, 8226, 19805, 7782, 4196, 9143, 14699, 19637, 313, 1309, 18185, 581, 14818, 2975, 6060, 10823, 762, 334, 9696, 16316, 14513, 255, 7197, 9002, 6514, 11543, 14240, 3922, 5412, 13519, 15559, 12579, 7851, 8760, 5411, 3629, 6636, 5624, 19926, 12070, 11491, 13144, 17113, 3139, 4929, 6819, 10458, 2366, 16257, 11768, 11694, 14693, 13605, 16814, 2231, 3498, 16442, 12964, 17300, 16805, 11194, 9251, 1661, 14167, 11128, 10319, 8945, 6096, 2987, 7597, 9209, 19574, 12873, 12294, 2038, 7470, 7837, 6893, 18333, 7882, 8649, 3763, 11783, 6888, 15798, 10726, 14235, 2194, 10523, 10439, 9617, 16088, 18468, 18453, 18326, 14366, 19646, 2447, 13337, 248, 11218, 4913, 5831, 18247, 17354, 9929, 2673, 15790, 13771, 1898, 8311, 16648, 5257, 5846, 5553, 18358, 938, 16191, 2714, 15439, 5050, 16938, 8471, 8134, 4704, 13264, 19078, 19699, 10051, 6301, 17340, 15849, 8946, 15207, 12755, 10028, 17648, 4621, 8039, 3513, 4941, 8401, 2938, 14612, 19042, 17385, 916, 3024, 16123, 3257, 9572, 2500, 15708, 11235, 6469, 17344, 4689, 19874, 13305, 3806, 14389, 13089, 12273, 12878, 14861, 12907, 18504, 5367, 3604, 13320, 3030, 1153, 13937, 10409, 15551, 7887, 8209, 13313, 19459, 10708, 7869, 4447, 17536, 11980, 14233, 19197, 13937, 6311, 16508, 1513, 16924, 11867, 14803, 9384, 10783, 15939, 10561, 17114, 5980, 4246, 7094, 10730, 1936, 14556, 11803, 19582, 10900, 4705, 5317, 3358, 5802, 15603, 10757, 9790, 3759, 6001, 4135, 9511, 5908, 3712, 6127, 17357, 14182, 10400, 13719, 18160, 5294, 4139, 4121, 5016, 13710, 5525, 6366, 9303, 17795, 17277, 13251, 7059, 7723, 182, 4396, 10287, 9763, 5524, 13917, 9230, 13342, 16014, 17419, 12405, 5763, 5624, 16072, 10125, 17533, 9137, 2541, 11122, 12047, 5766, 4246, 9755, 17755, 10876, 2238, 565, 18301, 19457, 14795, 7194, 8520, 5101, 5287, 17240, 6196, 408, 1416, 1483, 17915, 12396, 14943, 9813, 7607, 12925, 17411, 1760, 13538, 565, 14268, 9714, 3115, 1422, 5400, 2046, 10183, 2511, 11413, 10088, 16939, 18329, 3277, 1693, 4083, 17256, 4397, 13750, 9738, 10807, 2791, 24, 637, 3410, 15195, 12269, 5128, 7002, 932, 12431, 5428, 16858, 16540, 7553, 5010, 8554, 3321, 10680, 2107, 2510, 14645, 7094, 6253, 2560, 12763, 1205, 3069, 9243, 10029, 16966, 3905, 18775, 2465, 10578, 10718, 10251, 9142, 8686, 6508, 3374, 19390, 9260, 5595, 15039, 4843, 15711, 2464, 19692, 1849, 13269, 1853, 5261, 691, 10068, 14616, 14383, 11319, 16602, 11858, 10288, 17354, 10607, 15394, 1290, 3345, 18072, 5492, 6198, 4442, 87, 17385, 19089, 10882, 14581, 19335, 19, 14364, 13862, 10250, 18008, 10502, 19762, 19373, 9550, 11300, 16107, 17224, 7664, 10788, 18883, 18929, 15563, 19639, 12251, 1962, 17903, 10398, 14649, 443, 10661, 17045, 7947, 1903, 18899, 12361, 7257, 350, 1826, 12491, 18581, 15543, 11356, 14100, 4218, 18744, 10558, 13029, 11283, 11360, 10167, 2994, 9777, 11799, 15704, 18501, 16684, 13756, 18805, 1932, 12337, 7839, 4618, 13200, 444, 1475, 17677, 16998, 12599, 12181, 7642, 15205, 7196, 4385, 6315, 8053, 6363, 6650, 10719, 9534, 7399, 5630, 1787, 69, 14611, 11603, 13474, 17657, 5050, 14408, 5643, 6034, 2911, 19651, 6172, 13990, 19048, 9439, 6358, 19045, 5024, 333, 11645, 15206, 8144, 16118, 721, 17661, 10184, 565, 16172, 18424, 18250, 16049, 517, 5494, 16499, 3665, 1081, 9503, 839, 13744, 10592, 17463, 6280, 18656, 4253, 13157, 7779, 13167, 11685, 3755, 15650, 11463, 107, 11668, 2840, 18983, 4255, 20, 3900, 2641, 12935, 3059, 3292, 847, 17135, 12872, 1695, 8650, 19922, 14948, 3145, 13270, 2561, 3194, 14174, 8533, 19339, 12529, 15594, 13901, 14325, 19463, 9755, 6383, 18622, 9139, 2660, 2135, 16797, 14538, 7679, 5943, 14669, 13335, 4301, 349, 4813, 10997, 6711, 934, 14026, 6982, 3773, 4171, 9269, 4419, 410, 2218, 1069, 19669, 19468, 5029, 15300, 4450, 3490, 13995, 15300, 9440, 4481, 9664, 1147, 4144, 5136, 1202, 19470, 8311, 10068, 14752, 11748, 1278, 11377, 18484, 13431, 10956, 5121, 10301, 3867, 6052, 19269, 8647, 2112, 7960, 11118, 3893, 17301, 5704, 16335, 12445, 11024, 10341, 13586, 19211, 12921, 14891, 9845, 6001, 6823, 11427, 11061, 350, 10803, 9190, 9256, 8760, 15105, 18163, 14703, 1369, 7379, 14659, 5730, 15796, 3544, 17128, 5219, 886, 19950, 11141, 2396, 19560, 17818, 17578, 18266, 7636, 11327, 4059, 11179, 4961, 16261, 18381, 665, 4977, 14086, 3062, 10279, 804, 16091, 5435, 5424, 10407, 38, 11716, 5679, 12620, 13087, 12646, 12306, 17316, 8780, 15687, 16576, 17346, 16626, 18573, 9106, 10158, 8238, 3042, 16685, 13567, 991, 16501, 14583, 3193, 5144, 14236, 2, 15538, 338, 6774, 14837, 2416, 7390, 19634, 13572, 2406, 405, 10812, 1684, 19237, 18653, 1018, 12782, 11667, 2151, 3589, 457, 7193, 5238, 9936, 6953, 6162, 17909, 4706, 9437, 5757, 2540, 19402, 8003, 2688, 12407, 6418, 13290, 17197, 4553, 19865, 13992, 15481, 4594, 12160, 6608, 7096, 1101, 12581, 2144, 9016, 954, 4572, 7452, 9131, 731, 7882, 7863, 18629, 15841, 4969, 2384, 16618, 14845, 10051, 4355, 12611, 14161, 18219, 13204, 3853, 4019, 12669, 13179, 14768, 5510, 2853, 18173, 1328, 11143, 60, 14777, 14263, 11952, 12218, 5933, 6420, 11973, 11136, 4030, 12936, 16869, 8484, 10055, 5431, 8026, 2811, 16466, 11249, 13289, 11374, 18861, 6883, 16827, 19661, 6296, 13317, 15111, 2526, 15428, 12327, 11122, 19293, 800, 7024, 12194, 4915, 2271, 8556, 11960, 6173, 18437, 9483, 6408, 3286, 10758, 19618, 15725, 16411, 3967, 12748, 18628, 10679, 1408, 14052, 3856, 7715, 11095, 9619, 19090, 930, 5211, 11369, 16283, 8453, 7503, 1948, 4659, 7766, 10193, 2663, 15916, 16401, 846, 747, 10403, 6023, 18469, 10510, 8443, 284, 12325, 7835, 13044, 7297, 6247, 10193, 226, 19865, 3078, 3164, 3672, 1628, 14929, 3266, 14387, 14802, 4102, 14743, 2967, 12925, 13543, 325, 9977, 11050, 15807, 1193, 19894, 8655, 1577, 7669, 11625, 15456, 14493, 4909, 13711, 18037, 15265, 6467, 8262, 4343, 17574, 15381, 18255, 366, 5401, 4749, 18896, 3837, 17464, 573, 6655, 5394, 8036, 3340, 7046, 9102, 18424, 1406, 1633, 15383, 4973, 3813, 2610, 11140, 17583, 14284, 6899, 8433, 1097, 9819, 4483, 11962, 7824, 2819, 14288, 14250, 10336, 7467, 15545, 15153, 11196, 8693, 153, 7181, 2742, 1982, 4504, 18929, 1325, 16125, 16735, 7002, 15150, 6572, 15352, 3203, 981, 7034, 5339, 19354, 13689, 2336, 13151, 3777, 15445, 4349, 5156, 14126, 285, 15283, 11596, 17105, 18889, 1941, 2916, 18880, 1015, 1364, 1298, 11491, 2156, 6422, 17711, 10932, 7809, 7280, 10754, 10533, 1517, 3456, 8165, 5525, 13297, 19330, 2872, 9928, 10674, 16350, 3721, 4082, 7726, 13200, 1158, 15697, 5976, 17657, 14772, 7819, 8297, 18912, 9117, 5676, 14732, 8164, 3370, 2286, 799, 2581, 15090, 8039, 15512, 17138, 9767, 4565, 14531, 13301, 16763, 9698, 5926, 1284, 12466, 3704, 6149, 9108, 8914, 15891, 14847, 17968, 3679, 8179, 18225, 5057, 12400, 19241, 6416, 2010, 10994, 1101, 2787, 16491, 4677, 5743, 123, 406, 12002, 12557, 607, 10955, 10388, 17872, 9796, 17839, 18940, 5462, 1448, 6978, 12718, 17846, 18246, 11859, 11030, 9473, 14929, 17609, 18512, 7767, 17453, 6283, 2379, 17931, 7187, 19818, 6569, 1026, 4160, 18669, 5177, 9580, 4400, 6537, 1180, 10027, 19633, 8630, 5061, 6162, 17731, 8246, 10284, 18957, 8560, 2754, 3210, 2632, 6366, 3567, 10054, 2236, 11593, 10792, 14974, 13874, 3331, 90, 7629, 11455, 9114, 573, 18269, 7090, 4555, 3602, 14234, 9324, 7868, 5104, 7667, 3520, 7288, 16172, 4587, 8860, 1081, 9305, 6697, 7530, 19171, 10600, 13152, 13562, 8773, 13683, 887, 990, 6173, 3516, 14430, 15250, 13965, 897, 6952, 3510, 6908, 2096, 6571, 3543, 3667, 13814, 6330, 19379, 4987, 17169, 7184, 15237, 5013, 4636, 6170, 15179, 12632, 1780, 13946, 17564, 13219, 13261, 12914, 11244, 14209, 10562, 9412, 159, 16412, 11992, 7579, 10827, 7454, 4114, 13949, 936, 7173, 14864, 8711, 15951, 14320, 4580, 16225, 6338, 1486, 1065, 10721, 15346, 13039, 10934, 10529, 8444, 3374, 18266, 16889, 15175, 5694, 7608, 13560, 6481, 12710, 3041, 7348, 10794, 18997, 12872, 13382, 2054, 18220, 16404, 16325, 4191, 14899, 5485, 16979, 19989, 16485, 7673, 3546, 3534, 344, 12726, 4972, 4082, 10211, 13702, 515, 7315, 10352, 6141, 12385, 18298, 19869, 18271, 12675, 9286, 14630, 807, 15421, 4514, 625, 5021, 408, 13832, 5415, 18718, 6971, 16182, 11375, 17869, 13078, 5202, 14038, 8051, 1866, 8604, 18685, 6310, 328, 14495, 13921, 4353, 12453, 16840, 9650, 1639, 14984, 10459, 10418, 6555, 15677, 9915, 6175, 1311, 18706, 2059, 5510, 2226, 167, 13582, 5947, 9244, 6256, 14838, 10926, 7080, 15024, 17043, 14701, 10232, 10374, 12864, 18941, 1454, 14441, 15033, 10685, 11913, 16211, 19230, 958, 17732, 15552, 6211, 679, 10843, 13834, 13905, 15468, 8535, 18073, 12956, 11190, 534, 7588, 4173, 11097, 15371, 18973, 4356, 1481, 15321, 1349, 14034, 9384, 15744, 5921, 4918, 5582, 18802, 18467, 6548, 7225, 4384, 1707, 11681, 619, 19887, 1878, 4323, 13352, 11010, 2090, 17654, 14221, 4161, 17914, 19145, 8670, 10458, 16668, 13403, 18732, 8758, 11999, 5099, 4405, 9306, 3509, 1005, 5867, 12446, 12140, 6706, 13568, 12005, 1281, 9321, 10443, 13876, 10854, 7290, 14530, 8478, 7522, 4452, 15163, 12, 3129, 7443, 7733, 189, 18443, 6348, 5415, 3325, 3993, 15307, 17422, 19912, 7865, 12282, 10329, 1635, 13177, 10897, 6242, 10925, 3953, 10197, 8055, 18379, 2816, 11751, 9734, 17212, 11288, 16912, 16310, 9464, 4521, 4148, 14467, 3284, 12799, 13044, 16338, 8964, 11802, 7184, 247, 2669, 7744, 8629, 6865, 11908, 19326, 16648, 19164, 11889, 5571, 10709, 10156, 19493, 3077, 13327, 2663, 10847, 17769, 18144, 8577, 5181, 14539, 1537, 16874, 4735, 17582, 13661, 13155, 14721, 8523, 35, 12471, 13832, 19293, 3723, 12001, 11455, 15353, 17202, 17364, 6001, 15416, 12542, 11110, 12929, 16071, 16804, 7623, 11220, 15910, 12826, 13023, 16596, 2012, 16772, 17959, 10997, 7121, 7040, 901, 16095, 11618, 7879, 16131, 11917, 12868, 12552, 19189, 8563, 16996, 12600, 16205, 6809, 6745, 3002, 11997, 10875, 10317, 15559, 19800, 7344, 1734, 6722, 8279, 12202, 8804, 1783, 2946, 7407, 9185, 15548, 17407, 19509, 17927, 12568, 1088, 4225, 9967, 6312, 8463, 17498, 2849, 18627, 19769, 3060, 16845, 11654, 15593, 17591, 7322, 10874, 11725, 10026, 4336, 11535, 13019, 3919, 18286, 19960, 116, 11684, 1134, 8972, 15424, 16446, 14014, 12351, 10746, 4460, 19208, 15070, 12737, 11576, 6386, 14519, 1126, 15096, 2089, 1470, 4874, 3400, 6054, 16928, 19154, 7782, 3370, 15817, 2080, 19980, 19991, 11718, 19070, 7653, 14775, 5796, 11069, 3182, 15674, 5711, 15884, 6158, 10894, 13031, 15415, 8801, 5321, 6610, 13748, 17755, 4782, 10408, 11760, 903, 18916, 2633, 12333, 13691, 12947, 2519, 1496, 14012, 14973, 7394, 13773, 6070, 13354, 10802, 8132, 10422, 14142, 4875, 18563, 6215, 17119, 11548, 18117, 14093, 14585, 6456, 3539, 11165, 14008, 4539, 16875, 15157, 4966, 13215, 18061, 16454, 3854, 7194, 12769, 15799, 16697, 13423, 15453, 8993, 12675, 6805, 2681, 9095, 335, 7769, 5230, 16100, 11603, 514, 11631, 18970, 3098, 11277, 2015, 9917, 17859, 7705, 9011, 18404, 11745, 15081, 4005, 53, 10670, 10949, 12357, 15583, 874, 4897, 5972, 2686, 2264, 1810, 5038, 10854, 15025, 16785, 9730, 15986, 8907, 14220, 10889, 15352, 17294, 4342, 13136, 12760, 2938, 1648, 3199, 18974, 12912, 9891, 7611, 4021, 8084, 12435, 15069, 2491, 17441, 11224, 9964, 11974, 1805, 6660, 11067, 7128, 16505, 19130, 18439, 3787, 19609, 17232, 1170, 14758, 3844, 18172, 9671, 581, 4410, 10342, 8696, 15622, 10724, 2597, 1446, 18609, 3489, 7199, 2700, 8273, 15253, 7671, 9525, 8522, 18529, 11701, 18311, 2248, 10178, 19891, 7641, 19981, 12473, 17008, 18564, 12748, 10905, 5894, 3355, 19766, 11436, 652, 6358, 9539, 19046, 13632, 2939, 14157, 2261, 4577, 13216, 7888, 5608, 14665, 16552, 8790, 6482, 1811, 7732, 10787, 13043, 4288, 10626, 12870, 4477, 1576, 18068, 13997, 6154, 13675, 10966, 15879, 13264, 3913, 7965, 15187, 18717, 17619, 12043, 3144, 14239, 660, 17902, 3864, 3835, 4578, 7900, 1727, 10297, 16825, 2674, 17499, 7759, 12108, 10808, 1540, 4781, 9293, 9865, 13517, 2192, 10459, 10840, 10129, 17870, 10597, 4728, 3099, 14927, 15940, 12971, 13171, 7771, 8295, 12891, 16977, 15079, 7776, 13337, 15054, 19106, 3228, 10328, 1025, 15215, 17003, 9326, 1533, 16181, 3665, 503, 6093, 8257, 7029, 5456, 2989, 15982, 15146, 10218, 7102, 4855, 9514, 9935, 15597, 3298, 618, 13345, 17250, 3359, 5084, 15761, 5037, 6981, 5792, 11212, 12695, 11507, 4002, 17707, 6685, 12148, 9779, 13247, 18454, 17178, 10861, 11049, 8033, 18333, 3372, 12378, 16027, 19374, 19826, 4616, 8516, 752, 10194, 15883, 11610, 19960, 9889, 9401, 2136, 10164, 18790, 13281, 6606, 13527, 7607, 14171, 1283, 18624, 13080, 13222, 15403, 9068, 10994, 5097, 3962, 10499, 5460, 13122, 4328, 5672, 7069, 4429, 14443, 9522, 19377, 12629, 70, 6585, 2409, 2213, 13048, 4328, 7011, 5154, 19863, 10666, 5427, 11037, 2945, 6568, 3878, 2207, 7154, 14037, 843, 16008, 18734, 1477, 8772, 18884, 4477, 5196, 10882, 5929, 12621, 14176, 16422, 16268, 15262, 4213, 5990, 16360, 7212, 4471, 18557, 18047, 19422, 12073, 18883, 10452, 4243, 8676, 2451, 6512, 8646, 7786, 9447, 11139, 3454, 15000, 19186, 2050, 19763, 2989, 13723, 15573, 12476, 901, 2174, 1351, 15147, 5348, 9592, 8372, 6657, 9260, 5787, 14874, 19158, 590, 17954, 1890, 5910, 8038, 15170, 9121, 880, 13106, 4836, 4414, 16635, 7924, 6011, 3183, 5860, 8781, 6193, 14989, 9871, 2235, 5868, 2994, 12427, 427, 12980, 4785, 17924, 10200, 11756, 6295, 17257, 14886, 3119, 19998, 96, 6075, 5495, 10356, 2308, 2953, 5767, 18581, 9837, 15017, 19574, 193, 14700, 16439, 11197, 5488, 17435, 19218, 16466, 16264, 1840, 12039, 9112, 13914, 9664, 8456, 11785, 13694, 5660, 2285, 12634, 3363, 8670, 11488, 19727, 9921, 11796, 9021, 18439, 19903, 5864, 3378, 433, 7256, 8925, 6596, 14115, 19899, 7055, 8667, 12797, 18994, 3171, 14186, 425, 5876, 5054, 12963, 16326, 15640, 14061, 7336, 16787, 12783, 16782, 19704, 13267, 6003, 9628, 7018, 13859, 5679, 3731, 18356, 16539, 11232, 9692, 4403, 15431, 1854, 6989, 2262, 7977, 11145, 13471, 12486, 14037, 7824, 578, 12153, 12812, 8424, 13129, 4820, 13689, 16499, 2737, 15335, 16296, 8425, 740, 14124, 9770, 6481, 6711, 703, 2821, 7753, 17801, 2103, 7400, 3566, 13699, 10978, 9106, 17156, 5057, 7370, 4166, 9349, 4248, 15888, 5663, 6109, 10225, 10470, 16531, 2145, 13825, 7261, 3869, 11769, 1608, 14431, 10081, 3828, 6972, 18114, 1049, 7103, 8491, 15146, 12066, 11496, 9596, 4476, 10365, 5573, 9623, 10884, 6223, 18385, 11487, 5092, 2363, 4678, 3409, 8511, 12446, 8684, 17200, 16704, 6975, 3864, 2912, 10177, 10881, 14870, 15397, 11055, 5336, 1575, 16153, 5999, 19918, 2290, 1234, 6266, 7799, 11231, 10021, 2754, 5041, 1658, 2117, 16996, 2884, 14743, 246, 8528, 5045, 14894, 7127, 1872, 6424, 13705, 4544, 16506, 2080, 12389, 2624, 5379, 7060, 6328, 5429, 13872, 553, 16495, 4856, 19071, 8817, 9351, 17487, 3611, 9365, 13273, 18916, 4837, 7596, 10319, 12245, 9055, 1660, 1890, 4997, 14327, 8994, 4478, 14518, 14355, 16119, 14252, 17587, 4174, 16690, 19049, 14055, 18897, 11259, 9934, 10511, 18093, 12567, 8348, 17186, 2061, 16854, 9619, 3412, 13487, 18812, 13239, 10851, 3490, 14849, 1447, 8388, 18673, 17522, 754, 11518, 19660, 15556, 17293, 3083, 17957, 15113, 1000, 6541, 10436, 5789, 4345, 15058, 14202, 19608, 7897, 16211, 6459, 11788, 3097, 5822, 18836, 19836, 19714, 8003, 14915, 5154, 11259, 18286, 8829, 10919, 12776, 4563, 17701, 7680, 2475, 5629, 4365, 16265, 8672, 8346, 12781, 5926, 14393, 3091, 19449, 16117, 6211, 7323, 4020, 5031, 12565, 11403, 8420, 7475, 15727, 13980, 3149, 17179, 4023, 19961, 10991, 19761, 787, 18365, 3777, 534, 16806, 6140, 4205, 9279, 1638, 19975, 8254, 8027, 4062, 7077, 18915, 16853, 17155, 9112, 11034, 4683, 4802, 12122, 18045, 16714, 9899, 12822, 4174, 14298, 13267, 13635, 6035, 5136, 7054, 7608, 273, 3718, 13651, 244, 14803, 10721, 17393, 8196, 7606, 10638, 12488, 10996, 18269, 11045, 13671, 16440, 5570, 12067, 6315, 18722, 3514, 8323, 15336, 4613, 10293, 1952, 14250, 10101, 1299, 19626, 18971, 3568, 19838, 17156, 10887, 752, 4177, 6206, 17405, 15180, 18603, 18846, 13895, 16368, 12713, 5825, 7737, 17720, 15390, 18828, 10717, 16828, 5132, 12741, 12574, 1825, 11513, 1515, 15078, 10791, 11611, 14696, 12704, 8773, 1234, 4281, 1293, 14182, 2138, 19237, 11132, 1019, 11754, 5658, 1657, 14652, 12391, 3737, 9561, 13563, 5846, 1062, 11655, 19312, 16623, 4602, 4046, 19745, 19326, 3182, 18321, 13495, 19807, 8609, 12323, 17353, 8105, 9780, 13866, 16025, 15290, 647, 17351, 19584, 8101, 14580, 10169, 9556, 11084, 1645, 18112, 11835, 12894, 13374, 1418, 2179, 13202, 782, 18590, 10505, 6477, 2223, 18604, 1084, 12401, 17850, 16726, 2570, 18722, 5856, 553, 3152, 10811, 12554, 2032, 8370, 9800, 13625, 14285, 13889, 3430, 8625, 18721, 12850, 8168, 17537, 15118, 13396, 15632, 6959, 2159, 4326, 1305, 8869, 17059, 7255, 17025, 16803, 13131, 581, 888, 10470, 5356, 4207, 1313, 6923, 14473, 14511, 7452, 17688, 14633, 18493, 4072, 10876, 8282, 15761, 18362, 4843, 2266, 6380, 16382, 19244, 6262, 17828, 15675, 6349, 8458, 17407, 10890, 3231, 13254, 7773, 4340, 12013, 13783, 19343, 18051, 7019, 7161, 361, 6847, 1239, 7315, 5766, 1591, 16851, 16301, 2804, 5312, 8485, 14995, 16383, 15922, 878, 9930, 9680, 8660, 18314, 13356, 6648, 14520, 938, 1401, 3772, 1269, 18069, 19165, 17687, 12897, 13079, 15836, 8784, 8622, 15199, 7686, 19946, 13220, 19609, 13063, 14970, 19065, 13075, 14847, 7016, 9018, 6198, 6101, 17173, 14188, 12632, 1082, 15400, 9348, 2802, 9291, 14838, 13336, 15841, 17020, 12231, 11117, 10951, 16648, 11536, 10953, 14012, 5153, 14309, 1558, 3644, 5622, 2114, 14105, 438, 16637, 2594, 19199, 10149, 17938, 9660, 4148, 6413, 14242, 19749, 11170, 9131, 12349, 2542, 4665, 13866, 13453, 12380, 4782, 17848, 1501, 14480, 17416, 16103, 13612, 11202, 16303, 7562, 6673, 19711, 18782, 8269, 8206, 664, 2246, 15111, 18704, 9244, 16745, 5656, 11203, 11894, 8242, 12675, 16252, 3025, 1852, 5080, 12266, 7267, 16343, 1351, 1018, 13923, 19938, 2141, 2857, 19731, 4442, 13165, 8412, 12264, 13696, 10453, 922, 360, 8046, 1501, 11840, 16788, 16716, 111, 1279, 19613, 6352, 7603, 9701, 3238, 7394, 2108, 18550, 6421, 11396, 11861, 4776, 6863, 1237, 4436, 2172, 12494, 16600, 8411, 8244, 375, 8365, 339, 3687, 12675, 8664, 8529, 5, 3270, 3736, 5332, 18045, 2278, 12608, 514, 1427, 18374, 19691, 5272, 11754, 19155, 11399, 3780, 15443, 132, 15872, 6232, 7799, 8238, 9127, 7959, 7875, 16938, 15548, 6287, 6701, 3800, 8358, 14964, 3249, 5030, 17006, 16436, 483, 9195, 4541, 19535, 2821, 9176, 13910, 6176, 8399, 17145, 16935, 595, 5042, 15860, 11527, 13850, 17784, 9931, 6519, 15939, 4967, 3135, 10964, 16914, 5195, 19232, 18420, 8857, 9760, 12446, 38, 18106, 3435, 9920, 2824, 17171, 2991, 11522, 16609, 15267, 13342, 11019, 3091, 3810, 10211, 1630, 18333, 5899, 2838, 18784, 7276, 16168, 6319, 3170, 12232, 15357, 17357, 10639, 15850, 13293, 10185, 9769, 9008, 11690, 13535, 1841, 4839, 11387, 6171, 14727, 19650, 7656, 5344, 13020, 5689, 14468, 2450, 19739, 15328, 12407, 13152, 18315, 16865, 17794, 13721, 16968, 7726, 6328, 7289, 11551, 19894, 561, 3746, 12638, 3135, 545, 17536, 18833, 15618, 16294, 9374, 15883, 10224, 17780, 6848, 1783, 13442, 19093, 8936, 14035, 13449, 18143, 14066, 2864, 14558, 18126, 15155, 17661, 527, 6113, 2699, 16767, 14770, 17543, 1254, 1160, 1692, 1125, 3712, 5529, 861, 639, 9038, 874, 14268, 4928, 4556, 10112, 10919, 5035, 7499, 5594, 9074, 15921, 2820, 18944, 11160, 10019, 12954, 9190, 18598, 5220, 15397, 822, 10285, 15340, 10770, 5852, 4457, 5146, 1063, 16753, 1984, 3795, 14693, 4339, 19195, 7605, 17324, 17326, 4093, 12523, 4388, 7617, 5757, 7834, 13602, 10066, 9956, 13531, 6479, 19594, 17068, 1664, 2372, 5784, 8661, 12000, 3758, 5966, 15266, 6639, 9223, 3330, 11184, 1264, 2257, 3234, 12566, 15275, 11645, 12005, 19807, 2726, 9315, 4806, 1661, 8916, 3506, 15110, 3350, 14124, 14061, 12390, 15317, 12686, 19996, 19298, 416, 5812, 17170, 11735, 4420, 18472, 8443, 5255, 18416, 13407, 4497, 6208, 9752, 147, 4693, 1203, 3412, 1283, 117, 5321, 7000, 6831, 8638, 6170, 12181, 14346, 3321, 19982, 7923, 790, 6390, 2715, 10664, 9630, 9408, 16494, 7034, 3430, 16332, 12609, 15975, 3710, 823, 14530, 6240, 10226, 9909, 15456, 14623, 10730, 5902, 11509, 16939, 17258, 6682, 3498, 6799, 7001, 7507, 453, 9125, 2094, 5177, 621, 759, 11885, 16352, 6580, 825, 19057, 14542, 4788, 14818, 16575, 2555, 7444, 1994, 8358, 7826, 19366, 11131, 8310, 8810, 8775, 15381, 15893, 8541, 13903, 8534, 10109, 10719, 7332, 17731, 1885, 9793, 13745, 11666, 19089, 15394, 8896, 8333, 8384, 1890, 16977, 10938, 9725, 6741, 3142, 7476, 19235, 288, 12493, 16543, 9477, 14533, 17450, 19864, 5477, 11485, 19870, 4561, 18413, 3606, 3140, 6380, 15420, 5501, 14534, 2201, 592, 18799, 8119, 573, 5487, 18775, 18963, 15677, 19691, 12914, 4716, 8149, 1203, 13244, 923, 4327, 8963, 2474, 12288, 4227, 7802, 12012, 12990, 7688, 12982, 15287, 3034, 1060, 10737, 14397, 7165, 12306, 1744, 2662, 518, 4678, 1756, 18543, 946, 2898, 19687, 14500, 7724, 6778, 7648, 10762, 12320, 3221, 9511, 87, 4407, 5599, 2601, 13541, 17798, 17400, 18136, 14719, 7032, 8338, 3870, 17042, 6746, 7555, 16014, 3720, 647, 10194, 12780, 1575, 10909, 15345, 5387, 13908, 1339, 8677, 5024, 7055, 2951, 17905, 21, 6915, 16695, 4999, 10361, 16622, 14012, 14255, 11047, 944, 189, 4960, 8803, 9092, 3028, 17559, 6184, 2578, 17075, 5830, 11424, 7955, 11805, 5563, 9400, 11699, 865, 16810, 16690, 14087, 9671, 18332, 14436, 13530, 11328, 18413, 8001, 6955, 2489, 11455, 18599, 12562, 16010, 11631, 8048, 12752, 8836, 19879, 5451, 19309, 9475, 281, 13432, 8043, 4020, 3544, 2822, 18098, 3790, 435, 10253, 2476, 1528, 18945, 11349, 9326, 10586, 8072, 18589, 2655, 3268, 16517, 5680, 841, 7530, 4514, 17601, 11077, 16750, 18437, 1972, 10842, 9269, 17173, 13481, 2905, 16280, 3397, 1525, 8165, 7440, 7922, 17586, 6066, 5954, 6076, 18899, 3422, 8754, 1764, 9571, 4849, 6536, 19417, 13189, 16816, 10808, 10106, 1139, 1157, 1192, 2964, 13390, 16584, 6430, 19227, 1758, 2859, 1543, 11108, 11685, 19808, 2132, 17435, 16179, 9527, 1204, 17806, 7193, 17457, 19018, 14525, 25, 12853, 7583, 5251, 5267, 7114, 9494, 3793, 1855, 1225, 18825, 10066, 18228, 11851, 17137, 17344, 15904, 523, 10126, 1858, 15318, 15414, 17564, 6480, 18143, 739, 14714, 6150, 8297, 1371, 12184, 17138, 5319, 13835, 6599, 2089, 10122, 13324, 8773, 14294, 11009, 6259, 19804, 7001, 15841, 994, 5453, 8351, 7856, 3748, 12712, 4409, 4246, 13250, 7190, 6687, 8836, 16147, 10700, 2258, 16185, 18012, 14519, 12757, 2147, 3136, 13012, 18770, 17270, 11662, 636, 1007, 8008, 12328, 19743, 16889, 211, 15023, 10205, 12654, 1892, 1972, 1995, 417, 6003, 16211, 2347, 1434, 14942, 14034, 19163, 7451, 3971, 4563, 16007, 13402, 5244, 13483, 2925, 17346, 18506, 8171, 7623, 1660, 10435, 869, 14746, 4392, 2365, 8933, 13075, 18744, 4594, 14066, 4735, 4949, 5814, 2552, 4750, 4088, 16837, 8025, 9036, 7922, 2341, 12016, 6240, 1702, 8697, 10487, 12649, 12345, 10163, 12223, 3616, 8324, 15895, 2347, 12143, 3775, 8548, 11630, 3325, 3899, 108, 12792, 13924, 16288, 2164, 3235, 15693, 12870, 12567, 10789, 13850, 6792, 12520, 1538, 3123, 2983, 19605, 7141, 11169, 18252, 19565, 8097, 18511, 4318, 11781, 9765, 2595, 17496, 6763, 6772, 3316, 9887, 932, 19287, 2565, 14065, 12262, 15587, 7825, 714, 5696, 1282, 6728, 5925, 995, 1919, 702, 13090, 17742, 12435, 6694, 11426, 5684, 12742, 14718, 116, 15103, 18559, 17818, 10282, 5387, 19328, 10299, 11122, 3799, 18519, 3041, 9141, 1220, 17227, 8992, 6761, 10745, 19064, 5277, 2380, 4095, 10583, 4838, 3375, 19984, 5440, 25, 8503, 12183, 14046, 10597, 12847, 18976, 7290, 14231, 16750, 14275, 5124, 6103, 5375, 15030, 19307, 583, 16277, 16559, 4264, 17191, 2988, 9759, 17217, 13218, 1567, 1727, 2498, 9880, 4843, 19062, 3737, 16111, 16043, 15830, 1461, 108, 18773, 10344, 19384, 8880, 706, 13981, 16260, 7518, 5657, 3553, 156, 14524, 2256, 6330, 5704, 9466, 1815, 10920, 17309, 14383, 15217, 5801, 5863, 17203, 6891, 7646, 13517, 12584, 14029, 11941, 6527, 17831, 3139, 11782, 12305, 6118, 2160, 8595, 17642, 8954, 19216, 15078, 13245, 7644, 1115, 9963, 13553, 8045, 1562, 9412, 16967, 12590, 17623, 15610, 13304, 16241, 14686, 14876, 4038, 19222, 12269, 19836, 1136, 4552, 4916, 14951, 5504, 6909, 152, 16814, 3382, 19976, 10896, 4409, 10201, 19552, 15218, 712, 14946, 76, 11815, 11533, 19018, 8033, 6698, 5552, 4650, 337, 43, 626, 17276, 5896, 6472, 19023, 4351, 15301, 11360, 15261, 16197, 4170, 13265, 9654, 1883, 9260, 7454, 12192, 8267, 17240, 2554, 15601, 8163, 3962, 4561, 7904, 8453, 12268, 19383, 13465, 4874, 11095, 19383, 12826, 18517, 19021, 11602, 18465, 12776, 9732, 2498, 9249, 12393, 18906, 9929, 13473, 4533, 13595, 12831, 14625, 7771, 5132, 5611, 320, 72, 2716, 15878, 1301, 8949, 11761, 1018, 8958, 4204, 8227, 1171, 8809, 1439, 11246, 13683, 18534, 4239, 4293, 3416, 5412, 5899, 5026, 16998, 5843, 15566, 10660, 3679, 15043, 12712, 12409, 6076, 9234, 10097, 6711, 12734, 15291, 9438, 6608, 9807, 10052, 8959, 19220, 7975, 2724, 2487, 5688, 11369, 8724, 1565, 6483, 2262, 15351, 18514, 9541, 5894, 10488, 9157, 127, 5718, 7602, 6467, 19903, 16949, 3641, 19448, 6682, 19836, 14959, 11904, 16516, 12678, 4146, 2292, 3722, 13883, 18332, 8724, 16435, 14307, 6991, 6480, 10590, 428, 19297, 9211, 360, 3187, 17938, 9725, 12430, 7832, 6413, 2446, 4905, 2233, 17732, 15241, 1188, 1274, 9713, 8892, 7314, 3139, 144, 4480, 19563, 11057, 3063, 13643, 6412, 19301, 13603, 9948, 17720, 4124, 16816, 695, 3612, 7409, 19092, 1078, 5799, 13228, 16271, 11495, 16455, 11339, 4179, 18555, 2688, 1867, 15289, 9487, 2515, 8229, 7253, 19876, 8223, 15304, 5377, 5267, 4288, 1113, 14817, 1119, 3973, 4577, 17009, 11479, 18544, 952, 5470, 8550, 17047, 4750, 17979, 19707, 7352, 11703, 18118, 16784, 16726, 17630, 1672, 18794, 16820, 8371, 7970, 3740, 19602, 19199, 2247, 14237, 13407, 9324, 19557, 15111, 16475, 5204, 2671, 4061, 6461, 19905, 6332, 9986, 13339, 13130, 18032, 13345, 91, 17406, 6407, 19157, 9663, 10824, 1585, 5809, 13593, 18812, 2477, 9074, 8114, 17317, 16003, 9067, 2555, 8900, 9341, 14929, 18589, 17401, 4097, 2643, 16093, 19676, 19898, 9119, 11750, 867, 19468, 8510, 3206, 15506, 7562, 1640, 18690, 12744, 15029, 15142, 18612, 14411, 18801, 13277, 11432, 14918, 16466, 19851, 3150, 16375, 14889, 12180, 8079, 6807, 16657, 18771, 19462, 4391, 8455, 12001, 2210, 5617, 7459, 6705, 11180, 11676, 1348, 3082, 15653, 17605, 6840, 2012, 12169, 13546, 13524, 9898, 7720, 17280, 12132, 18927, 16834, 13074, 14855, 523, 5760, 5491, 1898, 15645, 17724, 3245, 28, 875, 7597, 7497, 3517, 11865, 2805, 7593, 18921, 4052, 9415, 11622, 17760, 4787, 16218, 15677, 14427, 18757, 6083, 4400, 16348, 2407, 12610, 15726, 11296, 838, 10867, 12099, 13737, 2965, 15585, 18915, 13918, 1763, 4284, 7679, 16383, 1655, 5236, 9880, 8668, 3440, 16794, 15474, 5398, 6927, 5028, 1109, 14241, 11832, 14168, 1802, 226, 17112, 15668, 13900, 8328, 8978, 12977, 14920, 10521, 10728, 15151, 1838, 3270, 11299, 17400, 7898, 12726, 11521, 3434, 19614, 12663, 3895, 12748, 12525, 15412, 5355, 7336, 18284, 6201, 16671, 3943, 5812, 12385, 460, 15027, 14551, 9381, 789, 3157, 17990, 12877, 7939, 12816, 17325, 1027, 4651, 10600, 18231, 18661, 1298, 16647, 14283, 7267, 11249, 11202, 17387, 14286, 2149, 12940, 19013, 15683, 9386, 4681, 18970, 10077, 1345, 12934, 13062, 14509, 13423, 14612, 17847, 1371, 4429, 16578, 3726, 4512, 7806, 2234, 6335, 198, 2431, 13742, 98, 8049, 8851, 4842, 9842, 18103, 10936, 18171, 16926, 11982, 12449, 15695, 18040, 138, 9921, 10253, 9096, 9539, 17987, 7499, 1189, 10050, 10994, 16268, 19170, 2072, 11561, 11209, 17976, 2738, 3173, 16420, 6777, 11320, 10131, 11854, 8625, 3386, 11686, 14331, 3901, 1482, 9309, 16912, 12866, 16043, 13069, 9280, 8147, 1825, 8695, 3680, 14438, 13257, 5999, 16674, 10766, 9548, 10612, 19862, 18304, 8639, 14760, 19182, 17581, 17687, 11400, 15379, 6330, 7853, 18717, 18457, 12814, 16608, 720, 11563, 3505, 8374, 8871, 13, 2954, 1025, 3159, 11926, 5588, 906, 5802, 1085, 18588, 9151, 19356, 14816, 9010, 12233, 18030, 18098, 17747, 12647, 18152, 8785, 7532, 17833, 722, 759, 9715, 9285, 12828, 2185, 8944, 380, 6723, 8384, 9900, 14756, 16107, 16184, 4600, 3286, 19670, 9184, 19783, 1306, 14552, 7673, 17514, 13699, 5380, 12784, 13901, 2527, 16600, 2403, 14058, 9307, 4473, 15030, 1941, 15914, 3018, 10916, 18067, 10952, 923, 18759, 19454, 13801, 818, 18986, 15182, 13696, 15112, 6297, 9386, 12081, 17005, 14781, 16580, 18636, 3933, 9303, 16194, 12195, 16549, 15389, 17758, 5686, 14960, 4550, 3061, 31, 15124, 11182, 14987, 5547, 17883, 11403, 13154, 6863, 2153, 2747, 7602, 5771, 7080, 16050, 19215, 893, 19605, 5170, 3524, 14708, 855, 5522, 6511, 16404, 4842, 8256, 13965, 6107, 11066, 17127, 15755, 4233, 15968, 18357, 7379, 2315, 9297, 4082, 18821, 2401, 6572, 16276, 2235, 9647, 8252, 10252, 3789, 14401, 4593, 11661, 491, 12234, 19754, 6774, 7164, 9931, 7803, 14436, 5417, 12333, 4921, 18488, 3943, 9964, 5203, 16197, 3393, 8508, 5595, 832, 1849, 2174, 9448, 15100, 12142, 5960, 8211, 11978, 8595, 9618, 13699, 8803, 12665, 3739, 2751, 2859, 16404, 18429, 12040, 19855, 9677, 17595, 5025, 10229, 14220, 4071, 6468, 4089, 7253, 9157, 7272, 19343, 8972, 11371, 3326, 1073, 9132, 1681, 1849, 14265, 19846, 1646, 7799, 12847, 850, 15986, 19284, 12729, 17421, 472, 10667, 11552, 18575, 18616, 1991, 4390, 14126, 7799, 2838, 18211, 440, 8457, 19324, 16616, 18382, 18889, 8877, 6300, 9293, 10045, 14040, 5954, 10182, 19617, 2450, 18519, 7743, 17172, 6576, 15660, 17342, 8116, 18712, 6690, 19890, 12759, 1539, 6169, 10486, 4637, 9626, 7048, 6262, 5623, 6219, 16336, 19190, 13288, 3876, 1774, 12090, 16344, 13018, 1641, 4674, 10538, 5197, 7835, 11412, 13425, 6719, 9468, 9825, 19572, 879, 3430, 16737, 2939, 13511, 6756, 18415, 2239, 2939, 14074, 3528, 19029, 2987, 2374, 8296, 18519, 14741, 4455, 10550, 13036, 205, 3503, 19310, 17807, 12507, 392, 3384, 6468, 11550, 2927, 9521, 3574, 18649, 19519, 14157, 16664, 5994, 2432, 7155, 7627, 6392, 1542, 19669, 10462, 5553, 8430, 8421, 5335, 6517, 6847, 11123, 18183, 9352, 1694, 10861, 12206, 3427, 4713, 19112, 1958, 15432, 18717, 6510, 12651, 5096, 14398, 15705, 17923, 5459, 3202, 2339, 3494, 9855, 17991, 5781, 12079, 19348, 1961, 18856, 8647, 19042, 5205, 10923, 14132, 3751, 3811, 10927, 15584, 15064, 12212, 2432, 9199, 2908, 4755, 5093, 18293, 9862, 9300, 3014, 17679, 18889, 10512, 16564, 9388, 7832, 6381, 1916, 19816, 15264, 13386, 4473, 10292, 10238, 5102, 6656, 12161, 17452, 18627, 11423, 6032, 19210, 7747, 11648, 6392, 15538, 14733, 11121, 9383, 8694, 15925, 16714, 3562, 4358, 13261, 12214, 16969, 11831, 5154, 13300, 17435, 13725, 11614, 8014, 2337, 19217, 5430, 7246, 6534, 1783, 19451, 2797, 2023, 6547, 9490, 16456, 14148, 16082, 13628, 11978, 8171, 17988, 17365, 11266, 13693, 15809, 3160, 15864, 2756, 17545, 15817, 11387, 10165, 17976, 3192, 13940, 8232, 8047, 7561, 8462, 2722, 8448, 16860, 8435, 10766, 5291, 14716, 3457, 10546, 14546, 17492, 2605, 8916, 13658, 7161, 364, 4622, 18494, 16306, 14342, 15841, 16407, 19499, 2340, 2735, 6782, 12882, 5306, 15509, 15818, 16217, 10562, 16071, 19099, 17714, 8266, 19051, 17923, 13236, 1108, 16844, 11402, 954, 17304, 16358, 13525, 14382, 4682, 2466, 7881, 2717, 3277, 18753, 15130, 13129, 14030, 147, 15992, 11743, 11973, 16435, 3666, 10821, 13031, 13992, 2692, 4667, 3015, 18259, 7780, 13096, 19162, 14992, 9360, 7316, 17883, 6901, 5036, 18284, 10792, 5021, 10225, 18003, 8823, 1920, 5377, 16401, 1049, 14840, 5049, 19050, 18534, 7367, 15351, 10655, 19422, 1537, 19180, 4917, 326, 14213, 12378, 5025, 4498, 11562, 18974, 17854, 4508, 6806, 6827, 17468, 16526, 5036, 15184, 10378, 15240, 14883, 11925, 19275, 11080, 18990, 3734, 10154, 18531, 11021, 2519, 2457, 10683, 12490, 17464, 9582, 12690, 5116, 15340, 1334, 18120, 14682, 5267, 4221, 14908, 18826, 864, 16930, 7274, 12504, 15398, 19, 3696, 5889, 10417, 4055, 15424, 8827, 4904, 19355, 13871, 13229, 9121, 10155, 5169, 15754, 17854, 2360, 12516, 6972, 14912, 623, 18408, 18348, 17489, 14909, 19709, 16866, 4864, 4485, 12827, 19748, 14620, 6275, 9146, 2302, 15981, 14828, 19324, 19139, 14954, 8109, 976, 14473, 6608, 9121, 18700, 9770, 1116, 4790, 2801, 19830, 2794, 2308, 8305, 11864, 5377, 3565, 12480, 7156, 16567, 18084, 18855, 18634, 16792, 17294, 3947, 12068, 6776, 15828, 4829, 6642, 4719, 3581, 5962, 1403, 8935, 5530, 2781, 15202, 17727, 390, 11346, 13401, 11586, 7317, 7515, 11291, 7363, 8485, 15202, 14204, 14717, 14556, 17612, 16759, 17296, 8154, 19302, 10741, 11760, 11183, 9936, 16342, 11126, 2762, 7975, 14207, 11380, 14568, 5584, 7564, 8066, 1563, 16115, 6676, 7976, 6275, 1635, 12790, 11281, 1146, 12981, 16856, 11008, 6932, 18968, 13924, 15372, 1967, 3945, 14441, 4393, 14711, 5946, 8409, 7867, 13245, 9426, 16639, 10703, 3734, 8435, 9660, 11126, 6456, 17863, 15772, 18422, 15686, 16325, 10518, 4413, 12997, 12771, 7343, 15093, 9023, 19086, 325, 11496, 6717, 2687, 17754, 18011, 15357, 5337, 1531, 13006, 5964, 10808, 5537, 15831, 19058, 255, 9727, 18376, 16205, 3650, 12454, 4144, 11146, 16244, 11846, 5567, 5148, 17368, 12846, 11086, 1646, 16273, 10803, 16789, 4179, 6999, 665, 11513, 3145, 5857, 6414, 578, 12748, 11131, 6312, 11008, 13267, 4963, 4113, 8950, 9671, 9725, 12197, 6257, 10789, 9287, 3591, 1504, 16003, 9603, 10606, 5358, 12487, 11304, 17024, 16106, 14225, 2783, 5921, 8719, 15787, 12802, 16180, 11713, 3842, 6319, 14956, 7805, 5608, 8157, 13346, 19840, 14689, 16039, 417, 4125, 485, 15985, 19615, 1757, 5106, 19615, 12499, 14130, 19357, 15094, 17638, 4422, 18021, 8563, 8160, 13941, 449, 17129, 860, 12631, 5675, 3652, 7709, 6305, 8266, 14300, 9543, 3892, 528, 18798, 6325, 1410, 19308, 14030, 15860, 6213, 4457, 18155, 9623, 9058, 1000, 1784, 8084, 7270, 4370, 5610, 5719, 9113, 8429, 14891, 5159, 19181, 14039, 8368, 17050, 11375, 7034, 2799, 3555, 9125, 10056, 6259, 2674, 5061, 16422, 10869, 10210, 19659, 13131, 4067, 1383, 658, 2602, 13835, 7671, 8319, 10809, 17472, 12096, 4381, 6183, 14966, 1292, 10507, 9076, 11514, 724, 15099, 17522, 19274, 18465, 6586, 4135, 16096, 2490, 13561, 10847, 8994, 8481, 9049, 9297, 15079, 1932, 4030, 17634, 13642, 19887, 1864, 2034, 5494, 12454, 6288, 2835, 17613, 16645, 13688, 15264, 17961, 8879, 7829, 8407, 11930, 5044, 17731, 2832, 19035, 11584, 19896, 15877, 14420, 13750, 5195, 10560, 4660, 5948, 8065, 17466, 18028, 17176, 16908, 2584, 19544, 16740, 4250, 12196, 15541, 6938, 3934, 12106, 18071, 4669, 18850, 4818, 14016, 12842, 449, 8733, 1939, 3128, 8932, 1104, 5826, 10365, 7867, 18591, 16032, 14713, 14548, 17529, 15839, 7025, 18612, 13353, 17120, 3980, 5177, 18036, 6636, 8340, 337, 9348, 7668, 7459, 4377, 3220, 10040, 739, 12111, 10801, 534, 5671, 1038, 18016, 4931, 16248, 15139, 1621, 14693, 5432, 10569, 15206, 19723, 1323, 7037, 18149, 19556, 4422, 3595, 3537, 16827, 6091, 16616, 1262, 3147, 9117, 15526, 6259, 10462, 743, 14047, 2127, 4605, 11031, 14977, 6557, 14982, 16708, 17247, 4902, 9157, 8916, 19966, 15744, 12242, 12284, 10318, 354, 4281, 16249, 2683, 5110, 9814, 10384, 19098, 3510, 3196, 5177, 17825, 3891, 8447, 18300, 964, 12512, 2913, 4156, 15401, 9410, 16550, 6228, 12066, 5825, 1069, 11073, 3131, 19510, 17903, 1820, 11864, 17276, 15758, 15556, 17518, 9504, 12696, 7594, 9981, 16436, 9998, 8421, 18027, 18193, 16674, 10492, 18743, 18972, 2373, 6387, 1248, 1168, 9992, 1341, 13916, 8257, 13916, 19547, 7325, 19739, 19361, 7068, 18018, 7600, 17379, 7866, 16142, 11122, 6354, 18153, 1199, 1103, 18879, 8064, 17640, 13587, 11358, 10258, 18818, 15942, 14846, 4783, 19381, 8945, 14224, 8219, 4564, 4714, 10715, 6635, 1317, 5859, 15539, 1197, 7807, 14598, 919, 8030, 10026, 2407, 5919, 12696, 2661, 9529, 6720, 18758, 17497, 210, 18060, 13706, 3133, 19436, 13836, 8194, 3006, 13525, 13991, 10326, 17245, 18130, 1549, 19154, 13588, 5842, 8581, 4286, 15849, 18841, 7737, 3110, 18132, 15202, 8974, 13154, 7145, 13799, 9820, 1474, 8472, 14909, 18424, 9354, 10582, 7057, 2557, 1255, 1409, 18872, 13916, 8397, 8604, 10196, 11722, 8630, 18549, 15252, 9355, 19628, 17319, 433, 8379, 3953, 1507, 15175, 3963, 11761, 4987, 13252, 5586, 13885, 7352, 7576, 16889, 16975, 16393, 18809, 15024, 12809, 17793, 19915, 9931, 6877, 18046, 19384, 888, 12684, 8368, 3306, 4993, 3442, 348, 8076, 18329, 1673, 17605, 405, 16785, 15390, 10892, 16167, 18802, 19621, 2124, 1996, 9107, 3109, 313, 12345, 4311, 8661, 19302, 9126, 11799, 10864, 7612, 7683, 12735, 13969, 15081, 6388, 14252, 6795, 8093, 709, 1995, 17359, 14087, 18992, 3362, 2071, 16340, 10800, 14013, 932, 15404, 594, 10908, 1288, 13052, 18761, 1153, 2590, 10926, 17063, 11056, 18120, 15328, 15813, 13464, 19577, 12846, 19857, 11545, 3606, 6785, 12415, 12164, 17379, 8663, 5891, 3387, 6845, 7110, 3393, 8906, 8995, 5873, 5992, 17397, 10283, 12078, 2491, 7509, 13079, 8859, 6529, 9296, 18916, 11117, 11664, 3850, 1922, 16405, 9261, 18378, 571, 3377, 4846, 14377, 16942, 11021, 16485, 7433, 4470, 14820, 12579, 11772, 14015, 17823, 16996, 11207, 8304, 14471, 7437, 18049, 617, 16400, 15026, 2971, 10639, 11530, 18407, 18632, 13709, 13109, 10022, 2621, 19494, 5208, 5003, 16467, 5536, 8435, 1341, 18959, 7107, 4571, 2354, 5266, 3492, 16610, 11150, 14215, 5380, 5812, 468, 144, 15307, 6617, 2569, 17383, 2376, 8410, 6126, 4042, 3958, 2964, 7228, 4493, 11183, 9886, 17737, 7714, 2352, 5665, 1620, 6691, 2290, 16060, 3546, 1925, 7161, 12500, 6938, 8713, 10282, 14722, 18498, 15964, 5882, 7448, 14282, 12666, 804, 3672, 3984, 14235, 6925, 6994, 8638, 16674, 18060, 17733, 8165, 7462, 10183, 6067, 11650, 3505, 8788, 1664, 1794, 8759, 17330, 15043, 15082, 16225, 19209, 14465, 4324, 15257, 18128, 13659, 10872, 16488, 1417, 9308, 1717, 7660, 11455, 11953, 19294, 16319, 4695, 2025, 11224, 14536, 8042, 1747, 9675, 19055, 9196, 18484, 12259, 14223, 7867, 16325, 2715, 5413, 11592, 8820, 11521, 4073, 15156, 5772, 14636, 15440, 15418, 3951, 10183, 18793, 4940, 12209, 3807, 6725, 17091, 12710, 13085, 6906, 13351, 5240, 714, 433, 9944, 4997, 18571, 10961, 4733, 388, 10658, 5864, 8678, 8350, 19165, 12673, 15866, 4195, 15906, 905, 8447, 15997, 4780, 9875, 11620, 15544, 8416, 13727, 16257, 2046, 4051, 5087, 4561, 1287, 7860, 19211, 699, 2372, 17673, 2590, 11079, 10859, 17719, 16980, 5612, 7899, 7897, 8298, 18291, 13510, 15383, 308, 14777, 468, 10074, 14794, 9525, 3726, 1158, 10960, 17606, 18772, 4650, 6028, 10346, 8267, 9036, 1792, 15402, 18676, 2451, 3000, 19279, 11459, 17355, 236, 14163, 4398, 19813, 9316, 7693, 19050, 13366, 18458, 10726, 10558, 992, 6882, 10704, 15151, 13028, 10061, 12509, 14831, 7301, 5003, 8716, 1849, 15279, 5301, 19552, 2657, 2884, 12121, 18304, 8461, 16777, 6747, 11192, 9412, 2809, 1664, 16180, 11087, 2652, 15562, 1998, 2431, 1022, 16151, 711, 10353, 4312, 13264, 11053, 3233, 14386, 6174, 17093, 17167, 1621, 4556, 14918, 742, 1064, 19194, 14819, 13250, 9918, 11140, 8598, 19495, 4378, 11376, 18110, 14085, 1683, 18368, 19162, 19807, 6274, 4473, 15217, 12879, 650, 16306, 4032, 13315, 5708, 780, 13873, 279, 15563, 14731, 15227, 17931, 5773, 12119, 4906, 5025, 9702, 17105, 313, 18992, 12249, 2999, 8188, 17327, 14102, 10629, 1146, 4855, 13202, 11030, 1563, 2764, 6873, 10364, 4181, 11311, 16374, 19060, 10763, 5402, 15576, 1141, 1903, 12497, 13042, 12668, 11285, 16539, 12353, 15832, 4463, 3563, 16584, 9155, 9449, 16942, 617, 14278, 17471, 19233, 4953, 382, 17546, 18732, 7072, 19466, 7557, 5350, 8604, 1676, 17440, 9175, 5359, 1300, 10071, 13529, 11692, 453, 7584, 6235, 9599, 394, 3605, 8740, 13733, 16131, 4036, 9341, 7013, 18328, 16673, 11660, 18872, 265, 6597, 16884, 17712, 5562, 4813, 10359, 4019, 11087, 18149, 3201, 3413, 6293, 10653, 6136, 10528, 19169, 3662, 15958, 15282, 10685, 4736, 7087, 4215, 13538, 16919, 1937, 13585, 12661, 6188, 3866, 10178, 1008, 18091, 3960, 13069, 7540, 7712, 12976, 10513, 19408, 10041, 3328, 17481, 9522, 16779, 12194, 197, 18898, 2273, 16246, 8797, 14852, 18862, 16132, 11318, 18591, 4601, 11178, 6950, 14266, 13684, 14321, 2875, 15123, 4044, 11376, 8200, 5373, 9188, 3725, 9595, 187, 19282, 16493, 16174, 10873, 16612, 18982, 19955, 9803, 13346, 14064, 15823, 9426, 14069, 13281, 3741, 6756, 12775, 4275, 17673, 10995, 2427, 6110, 583, 842, 13745, 10725, 3083, 6050, 14028, 4045, 8718, 10139, 3583, 5236, 16194, 406, 7258, 9222, 16003, 3281, 10653, 7422, 11961, 751, 3212, 17257, 12268, 6083, 5309, 16734, 2353, 7713, 5352, 4147, 2889, 10331, 10542, 12486, 1335, 2732, 19583, 5321, 10294, 18474, 10109, 4411, 15162, 5850, 4064, 12329, 12613, 1401, 4501, 19682, 5739, 13976, 11029, 10215, 7878, 15508, 19533, 17810, 10807, 6656, 13691, 4015, 19525, 10377, 5394, 7527, 13809, 2783, 13162, 17118, 7077, 9232, 12618, 17401, 7463, 15776, 4002, 18905, 9483, 12068, 8391, 10090, 11602, 827, 8963, 2495, 607, 14404, 13866, 2144, 5986, 6896, 2888, 15277, 15774, 6595, 13001, 5709, 9285, 3236, 12824, 17012, 11525, 8348, 19725, 2983, 16217, 2726, 8412, 6777, 1235, 12576, 11079, 7701, 1699, 12531, 3748, 18407, 6807, 15321, 3282, 4570, 17433, 4726, 11261, 6006, 15416, 6998, 13106, 9653, 447, 286, 10143, 11141, 1326, 14175, 2509, 7245, 13543, 7432, 116, 14794, 1621, 19584, 5903, 18719, 7675, 5837, 16827, 18361, 13455, 15535, 2171, 8272, 15301, 17185, 13031, 17586, 1478, 8239, 12022, 655, 3694, 851, 9606, 4976, 9318, 16812, 12323, 10375, 1009, 11442, 11168, 8675, 16026, 2603, 18081, 3347, 3519, 1971, 3965, 13012, 11190, 6700, 13273, 4679, 18047, 11107, 6743, 10863, 9572, 8336, 10627, 8997, 2203, 16388, 7447, 5514, 11140, 3318, 16549, 15923, 17468, 11506, 16433, 15571, 15103, 8630, 3359, 12097, 14179, 14773, 13275, 19682, 17885, 3063, 14802, 5550, 13756, 5190, 12850, 9277, 8999, 258, 6554, 1312, 7173, 2225, 17985, 3263, 1900, 3536, 15748, 12014, 13921, 15449, 2763, 6622, 5771, 14334, 4247, 17363, 16700, 4384, 12620, 10518, 11640, 4047, 11723, 11313, 13865, 7464, 16688, 13151, 11267, 19110, 13301, 14261, 1467, 2183, 15955, 1723, 8432, 1092, 6597, 18575, 11020, 1066, 6460, 13417, 7134, 918, 4077, 2762, 6496, 6451, 15015, 122, 19342, 13366, 8511, 5319, 12944, 3415, 14149, 2063, 16255, 16538, 8307, 15759, 7818, 137, 11507, 18589, 15322, 12561, 16013, 2262, 12731, 8602, 914, 16048, 1583, 263, 608, 14899, 7527, 5703, 5527, 4154, 1062, 9041, 16767, 1539, 4590, 15964, 9906, 12841, 3695, 11391, 10947, 5923, 3521, 9746, 1787, 4512, 19938, 10099, 8487, 15543, 11673, 6663, 15050, 6476, 6148, 13550, 13428, 13064, 3189, 11951, 17491, 13703, 9077, 9282, 12071, 10975, 11800, 10388, 9345, 4331, 82, 3067, 3101, 14708, 3632, 9196, 19111, 18202, 4738, 17062, 4932, 481, 6906, 17361, 19902, 16668, 6176, 1767, 18598, 11020, 10949, 7110, 13780, 489, 1205, 18730, 16940, 1942, 11581, 5654, 13722, 8077, 4192, 12506, 3747, 12152, 13775, 10193, 19158, 3437, 16664, 3999, 8090, 12152, 19306, 4129, 8896, 9649, 14025, 15788, 5664, 12607, 3100, 4611, 4577, 5875, 14053, 10927, 4991, 9352, 10629, 1115, 7241, 16300, 15862, 3546, 19345, 9900, 16365, 13958, 5307, 757, 16424, 13177, 19876, 10539, 9743, 18212, 583, 131, 2923, 11434, 3528, 6249, 2613, 10636, 5984, 12183, 10111, 3724, 178, 5121, 10703, 19155, 17462, 16940, 3311, 8341, 8432, 4868, 19090, 6391, 6040, 9453, 9355, 3273, 14519, 13208, 13593, 12304, 13651, 7404, 6150, 3510, 3684, 16062, 11255, 17131, 12288, 6746, 16290, 16067, 12879, 17643, 422, 914, 19874, 7867, 606, 12922, 5422, 10488, 16555, 7254, 19333, 8209, 6252, 11250, 16166, 5130, 18622, 2197, 11427, 12751, 18581, 17444, 7015, 5157, 6336, 15294, 12317, 12672, 9471, 1814, 12590, 3169, 4135, 14266, 4703, 12400, 16017, 10859, 5048, 19657, 6593, 3912, 14724, 14969, 11841, 296, 15713, 10606, 10250, 9628, 3977, 16048, 14110, 18449, 19744, 9332, 19911, 1210, 10643, 6833, 670, 15451, 15518, 49, 9903, 17483, 6309, 964, 4838, 725, 3527, 3608, 3138, 6826, 4983, 9707, 3030, 11335, 7448, 13256, 16628, 2497, 19164, 2667, 6024, 11914, 16517, 8646, 9456, 15444, 1679, 14109, 7544, 8957, 16183, 13718, 17176, 19702, 17380, 19516, 364, 10417, 3177, 10553, 15464, 13197, 10181, 14460, 6443, 564, 574, 16572, 303, 15972, 131, 11698, 14883, 15163, 7020, 19240, 7243, 16428, 18197, 4057, 37, 17757, 13967, 9000, 9395, 11734, 7722, 5018, 14536, 12878, 582, 19112, 3997, 2008, 8549, 14902, 7986, 2876, 6134, 8764, 10255, 4148, 2546, 5038, 5417, 10085, 4508, 14902, 17307, 3483, 6779, 1843, 17234, 9767, 11344, 18480, 11613, 18261, 19391, 6423, 9998, 9861, 3229, 17135, 1446, 2226, 7945, 11520, 3130, 6487, 18169, 4423, 19374, 4327, 3374, 10589, 8618, 12739, 16055, 18093, 17167, 10328, 17572, 13588, 778, 10412, 617, 12046, 10779, 2919, 821, 15264, 18172, 16917, 9504, 15677, 4234, 14940, 14133, 18563, 14251, 11134, 9419, 2297, 14558, 11476, 7350, 14572, 3459, 3247, 7165, 18223, 7460, 15484, 3328, 14827, 73, 879, 10078, 1246, 5821, 16492, 15783, 3201, 19871, 14656, 19512, 17229, 12534, 16532, 19383, 5614, 15845, 16, 12086, 17841, 3021, 19072, 14776, 1691, 13033, 13326, 19468, 19444, 11401, 11410, 12375, 15769, 14106, 18154, 17444, 3713, 6728, 19454, 7156, 2339, 17247, 5023, 13774, 18837, 9324, 39, 18359, 6731, 260, 16772, 12053, 7730, 17456, 11587, 1258, 13490, 14938, 19833, 15461, 19949, 18291, 475, 5815, 1768, 14604, 11517, 494, 6833, 6554, 191, 10134, 5836, 8334, 4266, 18729, 17454, 12564, 465, 4451, 14362, 2149, 2224, 1654, 9760, 431, 6008, 15024, 2037, 1835, 6811, 11155, 41, 16301, 1616, 15581, 6891, 7948, 8965, 8055, 18479, 16403, 4085, 9444, 17319, 9471, 14599, 17649, 12197, 17002, 1042, 15956, 2762, 1468, 7704, 19583, 11165, 120, 17782, 7494, 5329, 8741, 13935, 17348, 12128, 12465, 6725, 4480, 1370, 1807, 14123, 16420, 10631, 19258, 13911, 32, 13483, 7589, 3500, 4267, 13073, 6617, 4376, 9640, 4075, 59, 16238, 18425, 15285, 6484, 14336, 19318, 4965, 7349, 12398, 6204, 11848, 12165, 8011, 17920, 1130, 5382, 8678, 12209, 6179, 14352, 15085, 7406, 13673, 15198, 10910, 2032, 6285, 5904, 3380, 10135, 18002, 9938, 16640, 13019, 705, 15222, 10002, 9443, 16931, 13961, 13804, 5433, 13430, 10650, 8883, 962, 5081, 13947, 2868, 6442, 10967, 11908, 3570, 9892, 1086, 10430, 6116, 6030, 6923, 2381, 4850, 6097, 15530, 10177, 6957, 17980, 1565, 1786, 2653, 8856, 3867, 15962, 53, 16527, 16109, 12303, 6023, 14397, 11772, 3100, 12202, 3661, 1713, 11972, 7592, 15632, 8109, 15443, 8604, 4585, 15909, 9473, 4769, 7689, 5057, 7381, 9938, 203, 10058, 16808, 10342, 8603, 12484, 2854, 18155, 18702, 809, 19008, 7963, 13649, 143, 340, 4186, 9779, 13811, 4429, 3032, 15794, 10987, 15839, 2074, 15975, 5717, 12298, 7587, 12525, 9506, 13578, 19070, 178, 102, 11434, 5564, 14173, 503, 15764, 11476, 12782, 725, 3521, 11820, 11959, 14899, 18390, 256, 16266, 5678, 8313, 5012, 4789, 19922, 4936, 9526, 15799, 3114, 1804, 17893, 2164, 11631, 5637, 12814, 8223, 9571, 11023, 5478, 10448, 10431, 12752, 10339, 13379, 1986, 19744, 18002, 19415, 6592, 18954, 5515, 694, 6437, 7765, 11954, 10561, 12175, 7638, 6964, 15974, 3374, 5126, 15871, 5272, 1437, 17410, 13027, 13230, 7288, 17892, 5916, 16432, 1789, 15211, 4993, 12281, 19656, 1473, 19645, 16095, 7545, 124, 15552, 15951, 7456, 10802, 343, 15931, 18587, 13319, 13082, 4227, 15580, 14747, 11587, 7040, 11760, 15576, 6643, 16147, 17697, 1075, 5300, 14380, 12272, 4393, 302, 14733, 190, 18288, 12415, 15610, 6287, 13281, 2737, 16727, 11016, 9801, 2563, 13814, 18206, 8661, 17962, 10993, 6291, 11342, 18417, 10528, 17246, 10826, 12403, 7912, 9023, 4677, 13316, 11205, 6775, 13127, 1953, 3631, 7001, 9938, 14971, 8037, 19142, 17442, 11345, 15430, 14585, 15584, 10643, 10815, 9308, 5565, 18163, 6310, 18603, 14738, 5729, 1168, 18589, 11769, 12582, 19535, 8573, 1804, 3076, 9758, 14020, 13874, 12452, 14894, 5827, 10132, 9239, 3360, 11977, 7186, 10222, 19044, 14502, 13496, 13893, 7670, 11049, 700, 14799, 12864, 8322, 4958, 12984, 4019, 9214, 7370, 1596, 7091, 8008, 18356, 1416, 9291, 1701, 13525, 7485, 136, 5526, 7985, 1330, 7131, 18968, 3570, 3866, 65, 2162, 14100, 17411, 6478, 13521, 18087, 15858, 17561, 4858, 18538, 14547, 6562, 6450, 3998, 17683, 11624, 14032, 11606, 19148, 4943, 5340, 4898, 8068, 18101, 4524, 17140, 18635, 3583, 11104, 19549, 11873, 10890, 6806, 13330, 4005, 1823, 6677, 14621, 16330, 8414, 17504, 5937, 5914, 3502, 2972, 7319, 16031, 4328, 6409, 9917, 6124, 5944, 14364, 19639, 1224, 13034, 3956, 16215, 14712, 9621, 17147, 2287, 103, 5825, 18050, 7050, 9007, 18782, 6103, 14609, 19165, 17148, 9958, 15434, 15602, 9837, 1105, 13684, 6954, 18555, 9946, 1163, 3387, 15001, 1660, 414, 1605, 13722, 17435, 2143, 17376, 2246, 5599, 19159, 5159, 6567, 13441, 12062, 12103, 5091, 27, 10613, 8807, 14452, 9024, 19720, 16144, 6188, 1441, 6236, 19621, 14487, 17395, 18735, 15220, 15933, 3959, 7832, 12131, 12057, 19431, 642, 12850, 15019, 19200, 9691, 14293, 1804, 7889, 13348, 6744, 18950, 17598, 12470, 19354, 14854, 19183, 7543, 16625, 1470, 13372, 12896, 1868, 18902, 16027, 6432, 5136, 9482, 18445, 5863, 10337, 71, 12037, 8689, 9060, 12105, 18125, 7741, 6186, 16459, 4981, 16253, 12179, 2589, 709, 13402, 16108, 2373, 9920, 15288, 6318, 2469, 9753, 19603, 7993, 10023, 11186, 6888, 4101, 2074, 1510, 14509, 9474, 530, 8213, 9243, 4611, 6815, 11913, 2823, 14471, 13714, 18533, 6540, 1578, 13426, 19399, 11794, 203, 16872, 19617, 4020, 4109, 16741, 3349, 10598, 15863, 582, 15783, 19014, 10433, 2162, 15309, 15863, 4056, 1841, 9244, 2976, 16189, 14587, 18188, 9026, 6273, 2907, 18380, 7196, 16043, 10570, 4207, 17188, 4850, 872, 19367, 19462, 15077, 18264, 10434, 9851, 11293, 17469, 8294, 4630, 16552, 19620, 14572, 15441, 16718, 19134, 19424, 4190, 17125, 14441, 3222, 7141, 207, 6353, 12508, 10408, 6867, 8461, 11101, 17641, 18095, 16224, 18062, 6231, 17714, 6297, 18238, 1942, 11485, 8261, 14522, 11624, 1297, 12857, 17251, 11660, 11528, 14230, 3686, 4655, 7504, 11828, 7988, 13663, 7588, 2115, 2531, 5853, 16134, 1767, 13321, 1462, 6558, 7887, 19734, 14222, 4518, 6648, 12662, 18247, 13153, 5345, 18309, 16359, 4031, 1500, 18519, 6448, 344, 13802, 6540, 17286, 16611, 14204, 16306, 19569, 5247, 15706, 12028, 5694, 15850, 10168, 16342, 7562, 6249, 13687, 10350, 7759, 19868, 1323, 8905, 16110, 10256, 7908, 13639, 709, 17495, 5681, 363, 11574, 16034, 4923, 8350, 3641, 11170, 4091, 15980, 12480, 6216, 6800, 4987, 4510, 2212, 5435, 8405, 15941, 14223, 1041, 4221, 2682, 18175, 17292, 2951, 6941, 8107, 12790, 10429, 16871, 4371, 19063, 2829, 5825, 11635, 510, 4988, 7526, 5822, 11291, 3730, 14557, 9230, 10014, 10742, 17520, 8180, 17127, 8727, 14615, 17293, 12698, 7698, 1000, 16782, 449, 8226, 13815, 3497, 15922, 9237, 3191, 16073, 3234, 14907, 3889, 1262, 14458, 9712, 13706, 5868, 11648, 6155, 16426, 2908, 12091, 11172, 13866, 8573, 19912, 1334, 11372, 5088, 11878, 15140, 17179, 1298, 5857, 1834, 16920, 93, 9960, 7721, 6365, 18160, 19495, 14031, 2482, 6810, 2963, 5476, 13688, 11704, 5836, 8066, 15945, 3455, 18592, 14414, 6426, 18847, 19954, 19130, 14221, 2086, 13772, 13935, 2827, 15341, 18515, 5957, 12059, 3356, 615, 17524, 6208, 13774, 11927, 5025, 17082, 7912, 19650, 11186, 12052, 19766, 15948, 17085, 18322, 522, 9059, 18040, 273, 2931, 910, 8042, 4907, 18726, 12603, 7595, 6080, 9780, 14251, 11647, 11018, 1727, 18538, 113, 8545, 12714, 5051, 13416, 2405, 15039, 10998, 3564, 6103, 12618, 2476, 17624, 11731, 5050, 13667, 310, 12583, 9778, 6746, 4113, 10756, 8498, 13323, 7939, 10321, 7008, 1111, 19114, 13906, 7471, 13486, 8568, 16123, 6202, 3497, 11369, 7648, 2521, 7825, 14758, 5570, 18296, 18026, 3862, 14548, 2170, 13237, 8507, 11261, 11222, 10410, 13487, 6624, 6681, 19045, 7717, 19123, 5302, 7905, 19871, 13795, 6322, 2251, 1878, 4564, 6932, 2177, 12036, 4420, 7625, 3010, 12550, 18602, 2567, 17855, 8848, 11305, 13563, 7539, 6546, 3822, 15353, 5297, 5114, 9587, 3260, 9987, 1070, 17535, 1659, 9423, 13749, 16313, 3512, 13742, 277, 4094, 1023, 4694, 3796, 11146, 13413, 12667, 7980, 4137, 4580, 12647, 18570, 7345, 3228, 4801, 18878, 1345, 1443, 13005, 14913, 19580, 9046, 12113, 18848, 237, 336, 13081, 7304, 19533, 13646, 16783, 11516, 16666, 18545, 17361, 1047, 15242, 13207, 11941, 1261, 19592, 5111, 11265, 18730, 5906, 15170, 2711, 6678, 11314, 1139, 972, 4879, 12155, 17765, 16377, 4735, 3352, 18357, 5805, 9182, 10333, 15359, 6828, 1519, 183, 17514, 1581, 15650, 15952, 10538, 18053, 16599, 18892, 3055, 16913, 964, 4887, 8718, 16506, 7126, 11791, 13207, 5106, 8571, 8904, 10860, 6349, 2236, 8014, 5439, 3060, 15077, 509, 2992, 12994, 16635, 17573, 13469, 19760, 18301, 9060, 4090, 15436, 12946, 6009, 13669, 11620, 17505, 8201, 6936, 10862, 19388, 8809, 6048, 10690, 5551, 1558, 6840, 14191, 16514, 4690, 4765, 2669, 11061, 12071, 6296, 693, 14845, 3253, 3385, 3083, 9937, 8125, 9048, 5464, 14477, 8863, 5366, 5701, 2097, 11524, 4895, 12883, 7883, 19933, 5869, 10294, 5937, 6319, 3840, 19930, 15383, 16262, 17327, 169, 16574, 12900, 4349, 13613, 2786, 3746, 5281, 2424, 10964, 13400, 19523, 3896, 12632, 19303, 17728, 3954, 3334, 13096, 14133, 1238, 16655, 16921, 1751, 18517, 7855, 7881, 2866, 19089, 17361, 13379, 13338, 5486, 1141, 5071, 11269, 10388, 15338, 18248, 18819, 4759, 5720, 1784, 14040, 11223, 5658, 10830, 15577, 10280, 3511, 2134, 2956, 14310, 11138, 1413, 7880, 2310, 1213, 9710, 4536, 1230, 15696, 3373, 17082, 3191, 15512, 9777, 11429, 2000, 2268, 4500, 1345, 1332, 15803, 13157, 18427, 16598, 359, 383, 7220, 19439, 11269, 800, 16108, 18714, 4886, 284, 4616, 14947, 18613, 14319, 7406, 18231, 1614, 5884, 7824, 5581, 13829, 8443, 17141, 1744, 1163, 13849, 5261, 5650, 13143, 13330, 929, 2987, 9590, 11642, 18044, 13187, 7338, 19937, 2914, 12683, 1105, 8391, 8099, 10835, 15689, 17238, 14210, 14792, 13610, 7643, 15447, 4474, 5482, 5258, 5563, 18093, 8558, 15931, 11467, 5081, 10265, 19843, 6219, 17909, 6352, 9589, 15843, 2679, 18947, 2029, 15087, 15293, 15637, 14165, 7027, 12660, 18473, 11292, 14762, 16661, 6960, 7000, 14000, 17693, 10307, 18826, 18882, 5684, 13907, 18848, 323, 9644, 11816, 12324, 14260, 17071, 5280, 2976, 12099, 2378, 14714, 13301, 6224, 5074, 16972, 10879, 2634, 26, 17773, 11025, 1591, 4772, 3139, 18353, 14941, 8209, 1477, 13309, 6256, 3010, 1120, 4986, 10648, 4907, 12411, 12422, 14731, 5643, 7878, 15891, 2331, 4696, 16695, 15560, 3045, 17371, 2661, 13583, 15332, 5588, 525, 8376, 18364, 19050, 14292, 3673, 3020, 18854, 14476, 17993, 8057, 10207, 15161, 3270, 16577, 5811, 18558, 770, 18257, 5266, 14906, 13377, 16540, 14001, 23, 16843, 10144, 1640, 6875, 16736, 13281, 19110, 9737, 1173, 8789, 11121, 11579, 4587, 9110, 13837, 1133, 9079, 8218, 2156, 2461, 15222, 7392, 5693, 3670, 11322, 9642, 10304, 10776, 8593, 7353, 16939, 2516, 929, 9618, 7746, 16738, 367, 2725, 14278, 19904, 13788, 11314, 5805, 782, 202, 16218, 19800, 17800, 15674, 8230, 15276, 5478, 9765, 12461, 17916, 1703, 38, 14710, 18490, 6187, 8365, 10681, 12172, 3135, 11420, 12218, 10970, 14460, 15605, 14422, 14211, 14443, 15396, 1800, 17108, 3222, 2433, 11726, 245, 18435, 10181, 1749, 18080, 2214, 17059, 2639, 15943, 13319, 10118, 15432, 18067, 6074, 3527, 265, 10609, 16073, 8361, 13201, 15436, 10526, 1733, 14114, 13816, 15751, 16099, 11974, 11258, 3891, 1459, 2214, 16502, 8673, 8166, 19165, 14451, 9848, 184, 8650, 10418, 10966, 18729, 17545, 17894, 13392, 9767, 7284, 12948, 7572, 7971, 13607, 4247, 10470, 14771, 11604, 9069, 9938, 8621, 11629, 7719, 6557, 11868, 5586, 10003, 11890, 1205, 19642, 19047, 16393, 10712, 5454, 17688, 5688, 1701, 9643, 2897, 10812, 4774, 4825, 10504, 7760, 14318, 9373, 2251, 4249, 13113, 15826, 6288, 12526, 5992, 11626, 8834, 10476, 16172, 15973, 14967, 7288, 16808, 1112, 7717, 9134, 9950, 17315, 6451, 4275, 12501, 2173, 19991, 13825, 183, 7391, 2267, 13270, 16651, 10067, 9445, 17394, 8098, 94, 4936, 2851, 4104, 10900, 10659, 9907, 9193, 4779, 4678, 6904, 8335, 2109, 7055, 11535, 14815, 11830, 2674, 11125, 8367, 16099, 14378, 13091, 4821, 15099, 8348, 3770, 17502, 19614, 5224, 16860, 16870, 11247, 2541, 12064, 7447, 19520, 10741, 11959, 8641, 6603, 19321, 15620, 10993, 5038, 8460, 6025, 18505, 751, 10561, 180, 12361, 14824, 555, 17635, 12340, 19410, 4797, 3571, 4719, 14631, 13792, 8870, 15838, 5934, 9109, 4086, 15274, 17871, 7310, 6576, 8081, 16537, 5435, 19504, 18096, 9691, 17420, 13382, 6744, 5126, 11705, 13483, 299, 5620, 4992, 4773, 2071, 14642, 955, 5588, 19958, 18857, 13778, 3821, 1184, 12593, 1480, 6812, 18503, 12446, 8833, 15161, 6223, 3261, 6921, 9660, 17153, 11555, 6285, 4325, 7505, 9905, 14206, 9344, 5917, 8876, 5379, 16585, 17110, 12987, 4165, 8115, 16222, 17951, 18387, 14389, 10367, 9268, 10766, 15586, 5429, 11025, 6883, 5814, 19742, 11462, 626, 11879, 766, 2294, 18211, 19517, 15253, 18814, 1097, 16049, 19636, 2127, 1459, 3002, 6758, 13518, 19291, 14207, 10043, 13251, 14471, 8876, 5921, 2955, 9940, 3051, 9256, 17619, 15806, 17829, 10928, 6472, 12426, 274, 1633, 7451, 19533, 6737, 17543, 6497, 7837, 4479, 12093, 4952, 1941, 10695, 6892, 4303, 17642, 19488, 17704, 4708, 5283, 9386, 12761, 15956, 9625, 5625, 15410, 9098, 10155, 18088, 1420, 15544, 2203, 4565, 4028, 2583, 10775, 19798, 7493, 6641, 15243, 999, 16199, 5683, 13480, 16991, 13589, 7417, 10929, 3887, 17148, 16105, 3231, 19135, 3968, 4030, 10085, 6695, 12462, 13244, 9570, 14063, 5682, 3864, 5495, 426, 10897, 666, 11091, 19610, 5950, 13414, 13629, 17498, 6125, 10876, 10295, 11818, 8419, 13095, 10125, 391, 2252, 13400, 6818, 17467, 3813, 12690, 14740, 6624, 2598, 17015, 4724, 3081, 14784, 3588, 529, 1313, 11562, 16192, 10112, 13001, 12062, 6904, 17327, 9647, 14448, 15717, 3324, 15849, 1031, 10263, 15797, 12012, 18606, 3937, 8795, 6900, 8376, 7877, 8629, 9291, 19013, 6372, 7827, 6535, 12418, 19281, 8647, 19232, 19985, 15230, 3233, 12978, 11865, 15440, 3846, 7902, 16093, 14405, 2122, 560, 10117, 17854, 4879, 10489, 16503, 9157, 1919, 17364, 12625, 2588, 1975, 9687, 19911, 5025, 19870, 12936, 17177, 19718, 11626, 16590, 19836, 2488, 3342, 3632, 2351, 12340, 1627, 16385, 18894, 3479, 14945, 18583, 15674, 11951, 2639, 19538, 5768, 13582, 5556, 2280, 9969, 17886, 455, 15478, 5944, 5076, 8370, 2497, 951, 13008, 7499, 16849, 4151, 17287, 14663, 14747, 1944, 208, 3614, 13919, 70, 18152, 14968, 3987, 2240, 11164, 2592, 13494, 11688, 3694, 18204, 13419, 7496, 12443, 7461, 17873, 3515, 14974, 546, 15823, 4172, 4282, 7283, 8389, 16161, 11402, 10981, 14864, 17202, 18484, 19032, 6609, 17832, 17653, 4913, 2014, 5743, 254, 15927, 14077, 3110, 9192, 4010, 2737, 11848, 3412, 5198, 8694, 16734, 10689, 17200, 11135, 263, 15239, 14000, 3147, 3072, 17037, 10463, 15629, 2241, 3388, 9784, 12897, 1973, 17704, 19914, 13457, 13134, 5447, 9872, 10725, 3224, 8259, 16366, 7413, 4704, 15944, 13465, 14324, 7089, 5493, 6535, 3511, 3734, 1643, 9459, 1403, 15017, 4367, 2681, 14424, 3331, 5994, 8829, 10651, 16495, 3572, 12955, 12094, 5229, 17242, 10458, 15072, 2682, 18348, 12730, 505, 16375, 16958, 12372, 3806, 6284, 134, 9006, 2450, 17851, 16323, 2739, 3450, 17348, 14249, 11018, 7185, 12699, 17304, 18693, 1609, 3288, 18024, 14875, 4377, 13066, 8973, 10368, 9453, 12696, 11559, 1572, 5657, 1853, 14288, 4777, 12400, 16958, 17468, 5645, 1239, 580, 15807, 9787, 13558, 15345, 4097, 18372, 1050, 16366, 1956, 18213, 538, 346, 7791, 6125, 16356, 11617, 7919, 19073, 14420, 5355, 10159, 9018, 11510, 10028, 7527, 1263, 12839, 853, 16061, 14710, 2858, 1030, 9173, 16389, 16013, 13323, 19707, 14678, 1157, 11970, 3589, 10980, 17293, 19165, 1697, 8274, 301, 5462, 12579, 16127, 18388, 1446, 8085, 12399, 2214, 14616, 17798, 14341, 12409, 19378, 5999, 5400, 5177, 6856, 15318, 4271, 1246, 13459, 1858, 15300, 987, 8363, 16984, 5867, 15370, 1270, 15850, 11345, 1804, 166, 15171, 969, 3443, 17043, 17899, 13690, 1888, 11547, 6856, 6897, 1804, 19157, 11207, 17378, 6150, 7365, 17203, 19987, 3780, 18376, 17701, 15597, 199, 14890, 9875, 9468, 6124, 9019, 14833, 9430, 12005, 15512, 11649, 14049, 14956, 19996, 19021, 62, 1453, 14573, 3191, 19008, 11149, 17853, 16850, 1818, 14997, 228, 14549, 11034, 1526, 15112, 15956, 7832, 2579, 1532, 6585, 14700, 7528, 10944, 5434, 14380, 8110, 7907, 2943, 10333, 16538, 5689, 6814, 13584, 9911, 9394, 17685, 10209, 2247, 3768, 70, 12697, 17360, 7697, 11911, 11775, 1822, 150, 3766, 14596, 15642, 6514, 12719, 9498, 16117, 18568, 4561, 6153, 17616, 7163, 9755, 13219, 3515, 13747, 804, 16695, 5887, 6299, 10412, 6415, 16773, 6077, 17337, 5093, 6338, 7267, 16666, 16638, 5929, 12084, 2851, 15215, 4804, 19604, 18399, 11792, 7286, 6295, 11780, 13678, 4352, 15779, 9850, 12808, 1371, 17910, 8484, 17048, 632, 12455, 9357, 9098, 16735, 1239, 4020, 15551, 1742, 3464, 5917, 3110, 7491, 14144, 1795, 5910, 6330, 14111, 14537, 8661, 16429, 12888, 3367, 5638, 4440, 12538, 10630, 9703, 7354, 18359, 3612, 7012, 11185, 17399, 16063, 17148, 8853, 2374, 10166, 15357, 4055, 11660, 16335, 15171, 3209, 8676, 12796, 360, 5766, 33, 505, 4593, 6963, 8541, 8410, 16404, 9488, 10246, 19443, 10549, 15452, 3919, 14395, 6838, 11120, 3601, 10587, 5751, 12394, 15708, 7519, 16887, 19326, 13322, 12115, 2300, 12781, 12993, 6110, 6139, 4001, 18731, 5161, 16707, 13549, 2069, 1055, 19128, 9031, 2232, 13228, 14642, 15254, 11728, 3037, 7894, 4469, 6426, 6785, 3728, 17968, 10047, 1515, 4394, 9923, 3055, 16437, 2963, 5833, 9281, 9101, 17246, 18463, 3456, 7834, 19902, 13729, 11519, 5152, 17705, 11027, 1594, 13502, 10299, 14656, 7277, 2708, 2860, 8742, 9068, 533, 19221, 10156, 5414, 12885, 6347, 14912, 1903, 11275, 4396, 9354, 12588, 15109, 13941, 3003, 17598, 18040, 9387, 11331, 10553, 3254, 15111, 9157, 5628, 2111, 19544, 16126, 12254, 19907, 3741, 18531, 14834, 6747, 5129, 3889, 5115, 1828, 17439, 1136, 17481, 9055, 12267, 5319, 2440, 16548, 14856, 5486, 13925, 3101, 18606, 3832, 2063, 8055, 8334, 81, 17035, 19671, 14453, 18185, 9992, 14749, 17754, 12746, 13841, 12992, 3969, 8050, 9865, 2360, 11210, 6624, 3173, 1038, 12962, 8517, 16525, 14075, 11879, 15292, 8875, 17501, 19642, 18787, 4851, 3067, 7415, 17332, 16094, 4353, 13429, 8871, 2203, 16923, 19485, 3940, 14952, 16472, 5621, 16088, 15131, 8661, 4168, 10161, 6596, 19727, 7176, 9736, 16213, 9098, 13264, 19495, 7144, 7263, 14299, 18267, 12648, 15516, 13101, 12333, 19243, 14267, 2855, 4237, 16850, 16457, 15539, 3516, 11166, 9117, 16872, 15266, 6846, 4549, 11453, 16083, 12742, 18249, 19363, 51, 6335, 2282, 9713, 10258, 8356, 12243, 19337, 15465, 16546, 13459, 14707, 9657, 8691, 13877, 7539, 17307, 120, 2117, 1631, 13306, 11562, 5844, 19451, 1595, 4456, 13604, 7582, 9789, 15037, 19614, 8595, 106, 5453, 8504, 19576, 87, 1472, 12987, 11070, 14727, 17003, 4546, 4714, 6257, 12760, 2172, 2526, 308, 2538, 8996, 19437, 2207, 15289, 3069, 13364, 2189, 18525, 19016, 7220, 7600, 14700, 10213, 13714, 5704, 11070, 17033, 3234, 3668, 10132, 10652, 8281, 3581, 13864, 18754, 834, 16411, 1828, 9740, 14368, 657, 873, 17308, 191, 12609, 15167, 16857, 6841, 2691, 8285, 1485, 9795, 19302, 3739, 369, 19520, 11452, 3955, 9229, 8324, 16060, 15849, 17604, 8438, 3646, 12711, 14217, 19402, 11500, 17896, 16214, 7614, 11293, 19546, 12027, 4008, 17097, 17783, 4958, 12856, 5849, 18660, 10372, 14168, 4820, 2154, 10055, 18328, 11661, 18879, 11286, 19007, 1098, 6008, 4225, 2570, 13566, 9168, 1846, 10999, 14085, 898, 11516, 18747, 14067, 3507, 3658, 15374, 638, 13972, 15318, 3537, 10021, 2253, 14407, 19507, 11829, 3653, 6938, 12341, 18813, 3521, 10453, 18061, 16943, 6580, 14271, 16349, 12202, 1666, 11325, 11651, 10280, 2915, 2053, 7307, 5202, 9048, 5658, 13093, 11249, 12013, 10920, 8516, 5325, 10641, 13811, 14083, 6832, 15406, 16403, 1613, 7892, 308, 11605, 280, 15300, 19241, 5878, 11809, 9546, 2481, 18058, 6190, 15317, 5045, 5444, 16988, 14094, 3064, 16860, 6253, 12781, 10829, 1950, 203, 11242, 6330, 5366, 3560, 15208, 10248, 11758, 19121, 19346, 19364, 14692, 17814, 5078, 9977, 4982, 18085, 681, 7227, 17871, 8806, 2823, 11762, 17854, 14062, 13443, 12485, 14712, 2254, 13218, 11610, 7466, 7672, 6916, 369, 4920, 14067, 12557, 1364, 17607, 4114, 12726, 15736, 15832, 11657, 16064, 13654, 8844, 11604, 1604, 9203, 19805, 9635, 1085, 15093, 16417, 8827, 9435, 18352, 14463, 11054, 2004, 12674, 17430, 10526, 3334, 9333, 8473, 3385, 13151, 4603, 11437, 12146, 16398, 19762, 12054, 3762, 3070, 7147, 5047, 16623, 15120, 15474, 9910, 1548, 11178, 9941, 17216, 1140, 3357, 12550, 3759, 2780, 15860, 18191, 12414, 8200, 18502, 19179, 10124, 11267, 17563, 7579, 13786, 1684, 12326, 7788, 4275, 1430, 1542, 634, 13648, 9091, 2571, 14641, 11219, 18423, 15797, 16778, 7897, 5781, 6419, 7566, 18108, 14602, 15196, 1773, 19604, 4081, 15093, 15839, 6084, 18585, 1503, 15091, 15437, 686, 2408, 2548, 4307, 6940, 9746, 5354, 11939, 3218, 19649, 1511, 12044, 1218, 3739, 16953, 4448, 1145, 18790, 4643, 18683, 7941, 8081, 6438, 5640, 3558, 1980, 1224, 9954, 13699, 11564, 2969, 19966, 15291, 12781, 12257, 13842, 10082, 1625, 15813, 6871, 4353, 19669, 3165, 2317, 19384, 18312, 3023, 4328, 11073, 10823, 8561, 4799, 7629, 19734, 11129, 10893, 19033, 3128, 14757, 9723, 16252, 8837, 13961, 18910, 19548, 9601, 3777, 1345, 10497, 13914, 7368, 7250, 17457, 16615, 10609, 12779, 8046, 8116, 8618, 19562, 8184, 1899, 10952, 5221, 6327, 4522, 11033, 8254, 1860, 5792, 8874, 16678, 9723, 7484, 3994, 13362, 9008, 10266, 8846, 4783, 11707, 16627, 13878, 2860, 3771, 3600, 3648, 13789, 17134, 12847, 3334, 12844, 7561, 16549, 8108, 9818, 7693, 17058, 17500, 356, 7063, 15613, 3622, 17571, 17849, 16826, 2185, 10739, 8177, 9699, 11111, 17481, 18286, 288, 1748, 17005, 9406, 17395, 5622, 4278, 15348, 6311, 7321, 16001, 14426, 10521, 13737, 1416, 10156, 4870, 6958, 9199, 19772, 13472, 2198, 8906, 4403, 18094, 12743, 13278, 18168, 1747, 14094, 4555, 7724, 19297, 603, 5193, 19857, 10366, 2962, 5999, 4766, 2727, 14955, 15158, 18320, 17627, 120, 13106, 19166, 11225, 9679, 927, 8190, 14287, 17930, 16329, 3284, 29, 8249, 13648, 253, 12600, 18331, 359, 18738, 899, 9671, 17233, 9354, 17913, 10265, 5645, 9956, 5978, 7122, 16060, 5721, 5945, 12653, 7429, 5624, 19176, 2253, 13629, 17847, 7367, 10237, 7913, 9536, 3883, 5840, 17540, 19794, 16386, 2444, 6674, 6455, 14983, 11810, 16230, 16708, 12683, 19536, 3309, 8957, 13891, 1344, 16059, 1853, 14557, 10170, 7059, 8305, 7859, 16260, 8729, 7023, 6652, 10312, 2468, 18097, 12136, 8955, 14674, 11532, 11520, 10985, 16984, 17092, 19709, 6160, 101, 2977, 9093, 3616, 2315, 1375, 17429, 17942, 138, 17455, 5157, 1224, 2077, 8469, 8358, 10189, 1752, 11851, 1313, 1515, 19161, 5108, 5773, 6040, 18347, 11319, 12530, 13145, 16782, 443, 19270, 8060, 17074, 19075, 10542, 1494, 19742, 12304, 14264, 19869, 13323, 10953, 15499, 5868, 16909, 2832, 7442, 2182, 10499, 2315, 4666, 9309, 14999, 19596, 13115, 1497, 11119, 19517, 7341, 14337, 3692, 2936, 12414, 16283, 1606, 98, 17846, 132, 19514, 18706, 11893, 9611, 17640, 2175, 16728, 3736, 15437, 2580, 17587, 10509, 6583, 1908, 1267, 15482, 2161, 6815, 18649, 15804, 10510, 19735, 15731, 8891, 12433, 6931, 19056, 3483, 14879, 10926, 13311, 1437, 14783, 5701, 7173, 7457, 47, 16921, 11588, 5564, 6354, 9130, 8814, 6012, 3750, 3738, 3769, 4284, 4009, 18280, 686, 10823, 11791, 17004, 8988, 11198, 10316, 10468, 12177, 9229, 16789, 9119, 10048, 1514, 10925, 2533, 1671, 4466, 4747, 1950, 8643, 19364, 19228, 11162, 12015, 5558, 2804, 4402, 6556, 10266, 3221, 8397, 11664, 1378, 13577, 6253, 14772, 7759, 15802, 6702, 4978, 4446, 5046, 2658, 16051, 5713, 3271, 9601, 6368, 3222, 7807, 9222, 11302, 17230, 13142, 8596, 12775, 15335, 12566, 9821, 12759, 14569, 14586, 10416, 6652, 18481, 12197, 17590, 18288, 13681, 5271, 3697, 11208, 854, 2067, 7088, 3461, 10827, 2356, 12345, 2536, 133, 2216, 19183, 5793, 15878, 2661, 1761, 12107, 7667, 9274, 8379, 281, 7670, 14833, 1867, 17675, 14591, 6360, 11470, 19703, 12621, 6725, 18221, 191, 11176, 9880, 19945, 15883, 13732, 12295, 16085, 13515, 13885, 13555, 10167, 3840, 16386, 3926, 3408, 1113, 13440, 14906, 10238, 3819, 14953, 18068, 5318, 15012, 4472, 8721, 5823, 6871, 8952, 14537, 10356, 16135, 9397, 7120, 8126, 2213, 9290, 4451, 2161, 13160, 11600, 9446, 17981, 3999, 8734, 2220, 8716, 17696, 1890, 834, 3181, 6043, 4545, 14137, 7514, 15162, 79, 18777, 19183, 12007, 6452, 14175, 14511, 2280, 13017, 19092, 15343, 3135, 5610, 8910, 6851, 3680, 1346, 16398, 6797, 1551, 7133, 16687, 13038, 5000, 10232, 17307, 17549, 10167, 7877, 16490, 14407, 13308, 9300, 7911, 2872, 7732, 10107, 14758, 2365, 1910, 4005, 17199, 15224, 13197, 8573, 8215, 909, 12998, 475, 5331, 3048, 14086, 7253, 11956, 16616, 14317, 14518, 8612, 18743, 8482, 13838, 12051, 9281, 3650, 5447, 1802, 10179, 13882, 16398, 4717, 14937, 14962, 9811, 11832, 7664, 11258, 2498, 17922, 12071, 1651, 18988, 1096, 1290, 6340, 6690, 358, 19786, 16990, 12909, 1905, 5333, 14325, 4920, 4816, 11996, 14004, 8300, 8709, 10970, 2556, 18146, 15868, 17060, 7272, 7584, 18435, 200, 11611, 18703, 19107, 6419, 12761, 5513, 13391, 6327, 15434, 14941, 19193, 6945, 18137, 7439, 18142, 6579, 19603, 2905, 51, 17866, 8168, 17749, 8367, 19155, 8964, 11819, 2412, 460, 11026, 2907, 17838, 1667, 2725, 15919, 18556, 10817, 7217, 4563, 7575, 5174, 8631, 2783, 450, 14698, 16776, 7057, 7324, 11672, 4551, 19482, 11560, 13190, 17323, 10954, 3119, 5329, 751, 4354, 1674, 13834, 7454, 17515, 7328, 8638, 2576, 18714, 16858, 1846, 13679, 2245, 12942, 6649, 13435, 1557, 3815, 9445, 12418, 9182, 5054, 19171, 19958, 11646, 19487, 12212, 9542, 17859, 17620, 12998, 15443, 8067, 14046, 6554, 13665, 5330, 18923, 1389, 13287, 7842, 6438, 8942, 3871, 5338, 13831, 17278, 2203, 8031, 14047, 11879, 16449, 10228, 7688, 3819, 2908, 8535, 8208, 2755, 851, 5631, 9437, 10308, 17010, 308, 201, 7826, 7681, 7450, 3142, 15485, 14571, 13918, 2676, 10328, 3133, 13147, 14111, 6628, 10877, 15298, 4829, 17445, 2191, 13237, 12101, 3697, 16068, 12291, 3378, 15649, 18792, 9264, 12672, 9308, 5306, 2702, 4884, 12760, 16953, 990, 169, 9706, 6549, 10200, 16576, 1065, 17132, 12021, 2345, 19843, 8906, 2250, 2941, 2153, 2494, 10600, 10842, 14286, 5349, 17055, 8591, 11499, 8608, 13863, 10160, 16456, 15171, 10665, 13235, 9707, 5048, 9055, 12571, 607, 1392, 1345, 9439, 10771, 11422, 18824, 11060, 13989, 8273, 8571, 14404, 8243, 15059, 8060, 17869, 4626, 5910, 17694, 13851, 11555, 11626, 3977, 10026, 19323, 15316, 9583, 1683, 6531, 15059, 7486, 9921, 12537, 6428, 9465, 161, 4321, 2586, 19165, 11975, 6926, 1560, 3243, 15026, 19653, 13536, 2755, 3664, 18641, 17754, 19853, 7419, 449, 9352, 13873, 11267, 5, 5035, 8692, 11641, 8570, 2340, 17291, 7339, 19321, 18241, 17541, 11325, 14233, 2176, 3688, 18303, 10493, 5000, 15031, 4053, 10553, 348, 6846, 5962, 6812, 19965, 911, 12312, 18348, 12158, 14615, 11877, 9366, 14003, 8588, 12691, 13037, 7762, 4132, 18290, 3617, 5595, 18258, 5318, 11827, 12456, 2408, 264, 17106, 6199, 15526, 509, 15420, 16308, 15916, 13859, 2249, 17081, 11397, 6492, 14993, 14752, 9604, 9107, 16828, 13381, 16210, 3541, 2595, 13127, 13354, 7394, 19803, 9506, 16749, 14909, 12410, 9649, 3066, 12770, 15111, 7592, 18936, 16164, 9130, 19719, 232, 2153, 8045, 12455, 19641, 9881, 876, 9622, 16150, 19099, 7303, 10969, 3419, 3761, 4020, 9222, 15714, 17842, 12717, 15767, 1929, 11931, 17990, 7770, 18468, 16212, 9409, 17482, 15935, 6362, 16198, 13007, 5515, 2011, 4863, 7160, 11539, 19286, 18930, 12148, 10595, 15923, 9053, 7407, 17375, 9766, 8267, 16173, 182, 17212, 1581, 5915, 8107, 17858, 14597, 9525, 9634, 17950, 15727, 5310, 18116, 2793, 12237, 12526, 11392, 18365, 9070, 2906, 15060, 5717, 17159, 16183, 8476, 17242, 11956, 7345, 6084, 13533, 636, 18645, 19030, 12033, 7052, 16766, 6447, 17382, 6563, 14808, 6229, 7955, 6436, 7303, 9338, 13912, 10810, 15663, 15609, 16362, 2389, 4639, 3227, 3937, 8079, 19549, 296, 5507, 2398, 6250, 17226, 18879, 15678, 7228, 8305, 12561, 5360, 14761, 11929, 12057, 6916, 11928, 2066, 4685, 10743, 1728, 11176, 17975, 6035, 8963, 18421, 230, 6929, 13325, 13897, 16012, 3436, 7859, 16044, 15893, 15583, 1398, 16855, 5292, 19765, 14079, 15391, 17838, 2566, 6329, 11668, 8047, 12535, 16677, 8908, 13998, 7238, 15015, 8401, 3583, 9732, 3673, 17177, 3519, 15405, 18124, 11087, 17618, 14184, 5523, 3951, 3884, 15141, 2084, 14985, 4596, 18687, 10035, 12342, 9516, 12514, 17711, 7723, 15967, 5303, 16216, 18600, 5939, 14800, 7515, 13323, 14037, 6465, 16712, 1911, 6657, 2447, 8127, 7890, 18538, 7163, 13057, 1449, 18066, 742, 19094, 12391, 1755, 1699, 3108, 14159, 18352, 19620, 12052, 17351, 11574, 773, 8633, 19733, 12064, 12811, 15175, 7155, 12091, 13804, 4464, 9361, 13738, 578, 19201, 10441, 18463, 3098, 14118, 14904, 18642, 8986, 9979, 10982, 17856, 7129, 12377, 1079, 700, 7296, 15957, 13665, 2127, 14980, 4214, 18869, 6655, 6448, 4042, 6331, 4872, 11738, 9365, 11173, 19981, 1410, 9871, 17007, 12850, 14173, 1318, 2013, 6835, 2516, 16819, 1256, 4441, 11867, 19895, 12904, 2377, 19550, 11258, 7826, 14375, 12931, 8389, 18394, 12524, 16701, 17010, 5868, 3807, 4847, 6119, 15730, 3058, 14002, 1641, 1776, 1819, 13283, 1275, 19791, 8625, 4999, 18599, 15864, 4054, 13859, 8095, 19354, 10229, 15622, 15179, 13987, 13238, 4562, 16838, 5368, 10222, 9470, 19392, 9154, 5360, 18704, 4175, 12680, 1456, 17606, 12517, 14940, 16976, 4408, 10814, 16659, 6453, 8653, 4805, 1195, 11309, 3290, 12815, 4641, 10954, 15961, 19106, 14607, 11662, 9272, 7769, 5260, 19713, 11618, 5603, 11007, 17045, 18080, 7236, 7500, 7125, 7869, 4469, 4691, 5812, 12136, 13538, 14660, 14735, 9041, 8568, 1377, 19216, 14002, 16274, 9961, 11646, 5392, 740, 4772, 14142, 11362, 19698, 17852, 385, 17955, 12115, 19110, 631, 8826, 14334, 16626, 269, 13952, 1096, 19038, 15024, 16832, 18155, 8299, 19553, 5954, 9600, 19403, 9040, 2241, 1946, 6566, 11115, 17027, 15657, 12659, 14003, 10572, 8316, 9884, 134, 12448, 13280, 1199, 10823, 7190, 11709, 175, 4085, 15100, 8402, 18027, 19617, 4514, 19520, 3356, 18704, 18543, 17071, 3694, 6128, 6541, 1611, 5914, 17904, 7061, 16726, 3654, 16943, 12316, 11107, 14498, 7104, 2449, 6816, 5983, 15626, 13176, 2698, 5365, 12317, 8109, 9998, 14697, 4697, 18117, 3413, 17473, 7546, 4437, 5543, 1763, 2788, 5515, 11066, 2409, 621, 3237, 9737, 19880, 10092, 16301, 17731, 19279, 12929, 15394, 2277, 18670, 13147, 6900, 12750, 16771, 8383, 8247, 16295, 11487, 11966, 3071, 14104, 5938, 2501, 6017, 1605, 10063, 16585, 18355, 10091, 16183, 6209, 12193, 77, 14515, 755, 14744, 9144, 7109, 15302, 3047, 8863, 7359, 16588, 11183, 13122, 18782, 7064, 5790, 10912, 11977, 1228, 18933, 8937, 8756, 18228, 12200, 18756, 8294, 18553, 18440, 13036, 7016, 2509, 17762, 15289, 4447, 8428, 9443, 1346, 14783, 3189, 19812, 17469, 18500, 16613, 12653, 12873, 19337, 13791, 17726, 3174, 12941, 17991, 18284, 19103, 13551, 4408, 443, 10414, 16437, 19118, 15817, 5183, 17511, 17229, 12237, 10706, 10865, 13057, 11359, 10795, 482, 7526, 10969, 7895, 19658, 1498, 5291, 16479, 6921, 16838, 3651, 1587, 9847, 266, 4375, 16931, 6178, 19826, 10634, 9622, 2488, 17786, 10962, 7270, 3941, 11915, 2925, 6585, 7064, 9573, 10465, 17736, 9426, 13896, 10132, 1485, 4183, 9465, 6842, 6149, 9044, 102, 3223, 16204, 17898, 3334, 6014, 17190, 17934, 17190, 11100, 3264, 4301, 4707, 8265, 9538, 5793, 82, 17748, 10868, 7004, 11140, 18892, 17884, 19673, 3985, 10490, 15481, 12851, 6948, 14902, 11930, 15501, 13803, 1859, 5098, 19230, 8131, 2119, 4144, 11311, 8952, 10157, 8823, 8943, 17427, 15425, 19248, 5653, 7525, 18675, 2605, 3177, 10310, 14088, 17446, 15100, 2825, 16969, 16582, 5439, 10576, 8224, 10896, 8042, 13389, 268, 13870, 4312, 18787, 17492, 19889, 1857, 13359, 16387, 9065, 11755, 1776, 15990, 375, 18783, 4759, 828, 15733, 162, 13104, 9500, 19949, 6193, 14902, 5861, 15954, 1119, 6455, 13279, 3809, 14144, 18382, 15065, 15760, 2171, 17947, 224, 7540, 15399, 10570, 16047, 4653, 2107, 5665, 9232, 8822, 5564, 6694, 17374, 2695, 5358, 15823, 5844, 5413, 1583, 12730, 11130, 2982, 16963, 19569, 6157, 13255, 18980, 12635, 14735, 17473, 13463, 3491, 15983, 13265, 12347, 7282, 6242, 2628, 0, 12729, 2343, 14466, 13736, 3068, 18070, 5761, 16963, 10546, 10086, 10515, 12516, 19805, 8215, 4381, 12285, 9743, 3340, 2808, 19364, 15441, 1513, 2144, 9383, 3624, 10965, 9579, 19008, 5683, 15563, 19733, 4726, 11692, 9712, 535, 17054, 8, 17790, 17419, 15015, 2178, 13141, 13171, 19407, 1924, 18478, 16028, 17545, 12985, 10252, 14566, 17860, 16531, 18600, 1426, 4839, 12427, 12777, 7270, 1741, 18833, 7634, 15988, 7844, 16108, 19303, 16560, 11893, 17331, 12556, 7188, 17087, 19820, 5580, 4407, 5544, 638, 5528, 3749, 8366, 518, 2997, 469, 14462, 18332, 10203, 1040, 7769, 13729, 18378, 9835, 12736, 17255, 13885, 1990, 17282, 1517, 5975, 7443, 578, 9538, 10983, 4458, 11995, 12280, 11537, 19778, 1324, 8767, 19249, 641, 2114, 573, 8870, 931, 6919, 17358, 7449, 5650, 4411, 19105, 18739, 18875, 18306, 9678, 11159, 8951, 7955, 12863, 12100, 282, 11878, 15587, 2450, 3225, 443, 3391, 3520, 9745, 18062, 12346, 11237, 2233, 6625, 11424, 13819, 15552, 18951, 13202, 10903, 10523, 14750, 14321, 2847, 246, 490, 16217, 10293, 10149, 14103, 5069, 3773, 6746, 8216, 9962, 5926, 18571, 4989, 13000, 15009, 17827, 10843, 10317, 11241, 17701, 13946, 17950, 8251, 14569, 18298, 14529, 7491, 6858, 6795, 18579, 8576, 1745, 16049, 13407, 5548, 11078, 8108, 13373, 967, 15807, 5725, 10701, 15967, 8339, 5054, 13185, 2817, 10521, 9839, 7448, 6688, 16345, 4046, 1179, 10473, 18279, 2975, 10027, 11058, 13963, 10514, 3985, 9078, 6141, 237, 9738, 3541, 13624, 6524, 1899, 6687, 16205, 5615, 2734, 7853, 16188, 17454, 7010, 19084, 6207, 2074, 10128, 4543, 12633, 16157, 11410, 7923, 17612, 16518, 4869, 4533, 13383, 12412, 4799, 6589, 7199, 10530, 675, 1888, 15943, 12904, 18031, 16269, 11831, 9695, 16432, 242, 5758, 341, 9567, 11859, 16762, 9640, 10919, 11597, 8558, 1551, 7200, 7501, 2163, 1298, 12206, 9574, 17827, 205, 15388, 14762, 19327, 16986, 10841, 14752, 10284, 10514, 12817, 8380, 14937, 19095, 2271, 11433, 8299, 9538, 309, 12387, 5631, 2900, 3467, 14096, 19694, 13926, 2772, 10360, 5359, 5838, 10749, 6017, 10545, 341, 9770, 1742, 3121, 10342, 14414, 15354, 9961, 15462, 2520, 18356, 7640, 16237, 12882, 5793, 11320, 13167, 13064, 11045, 4247, 5928, 5919, 14881, 155, 7165, 5074, 18968, 7434, 8433, 4401, 17497, 12895, 14459, 5727, 12130, 10101, 16268, 14148, 11585, 7812, 10569, 19037, 91, 19321, 3266, 12831, 6417, 739, 2764, 12246, 8683, 19728, 16629, 1578, 6858, 10916, 6895, 8515, 273, 1559, 9590, 9996, 9527, 18340, 6167, 1881, 6599, 6525, 10176, 9954, 17276, 12830, 4267, 15349, 7179, 18275, 8360, 6053, 5513, 6991, 16547, 16262, 11506, 14012, 9089, 334, 2921, 6058, 13789, 1811, 3359, 3807, 1362, 13881, 7881, 2340, 15706, 7764, 14349, 9431, 707, 7362, 4552, 15945, 18958, 1028, 11766, 3358, 17997, 7384, 16603, 6136, 14131, 6039, 8178, 1858, 7795, 14853, 17302, 8134, 5751, 18421, 10615, 16915, 6281, 13716, 11773, 19182, 9970, 11170, 18359, 1351, 9621, 17230, 2465, 985, 12874, 15163, 691, 17663, 17996, 12294, 10037, 1890, 19849, 3592, 4381, 12065, 7157, 17638, 19344, 4207, 1337, 14049, 15671, 2404, 17079, 19223, 8516, 792, 14274, 1407, 4770, 13236, 2254, 4116, 14392, 3291, 9512, 19029, 9678, 16593, 7683, 3641, 18405, 13716, 11222, 16064, 15453, 8970, 5407, 17743, 7374, 2745, 11732, 15129, 5927, 12803, 1522, 9300, 1460, 2044, 19028, 7068, 19140, 12705, 11258, 16770, 3238, 16590, 19008, 15329, 16005, 896, 152, 17167, 10435, 268, 6536, 13276, 6957, 12292, 8789, 11589, 4560, 12808, 13666, 13768, 15272, 718, 14138, 18044, 6892, 16130, 4139, 320, 3104, 13665, 11160, 14659, 5938, 10589, 9741, 809, 1423, 5660, 1770, 17053, 13646, 8716, 14913, 1737, 13367, 6611, 8533, 6539, 9190, 198, 3458, 5741, 10662, 3354, 2188, 3914, 12456, 11217, 14338, 7388, 16423, 1928, 5856, 11450, 17220, 19236, 2960, 17269, 9636, 18247, 1101, 386, 19389, 10575, 5403, 5225, 14125, 5131, 9006, 11872, 13742, 7547, 3863, 6193, 11168, 11359, 4634, 15393, 16917, 10935, 14716, 1033, 1528, 7318, 16010, 3734, 12644, 19246, 3089, 11580, 8359, 2554, 264, 15312, 13793, 14669, 13063, 16837, 10358, 6081, 6756, 14266, 4693, 8936, 17655, 14383, 9666, 669, 5461, 12048, 12508, 1205, 17324, 9158, 17768, 12932, 11667, 12448, 5203, 4021, 3046, 14309, 13434, 17515, 10098, 13963, 10606, 317, 14827, 19922, 11510, 12500, 11971, 9407, 1179, 18190, 4359, 8127, 17860, 15015, 13506, 19253, 2297, 17084, 10907, 12373, 10712, 12082, 14402, 11063, 9111, 19473, 8783, 2143, 15797, 7326, 5878, 16982, 10123, 11536, 15614, 946, 10620, 18302, 11701, 13230, 5823, 8607, 17602, 18813, 10569, 7868, 10801, 2240, 452, 11611, 7583, 4330, 5494, 16708, 10287, 295, 16680, 8160, 18131, 18507, 10574, 15410, 8225, 3082, 8737, 10040, 5537, 15415, 1947, 18151, 2357, 5338, 9132, 14827, 11703, 7545, 3233, 19262, 12329, 10525, 9179, 18935, 19341, 9152, 6751, 9575, 4886, 9679, 5715, 560, 14975, 11623, 8717, 5133, 13569, 12509, 373, 220, 18019, 11922, 19554, 18684, 15781, 1520, 10655, 2702, 5093, 5143, 5609, 10544, 6378, 2024, 8307, 11110, 11057, 13319, 770, 3271, 13367, 688, 14179, 17103, 7486, 7181, 1360, 7543, 9686, 2663, 5748, 15829, 16733, 322, 5860, 6713, 7520, 12044, 1734, 16880, 17383, 18365, 16334, 4811, 6945, 5183, 1734, 18156, 19460, 7693, 1725, 18584, 19025, 12946, 10780, 13818, 884, 739, 9626, 6085, 9695, 11330, 12742, 10173, 5483, 397, 5200, 17237, 639, 9008, 2491, 17841, 14512, 14525, 12421, 18356, 588, 12247, 15505, 15263, 11752, 7369, 2403, 16203, 12729, 17083, 8076, 18668, 3179, 6234, 5845, 19494, 8687, 7754, 1087, 17382, 10817, 1682, 7255, 14345, 3183, 12598, 4491, 5753, 17662, 4306, 552, 12780, 11613, 8952, 19073, 4605, 4871, 11119, 7041, 1916, 3437, 9495, 13779, 4841, 4018, 10018, 5758, 13605, 4767, 16402, 16066, 15973, 6093, 1312, 10183, 1104, 894, 1327, 9692, 13095, 17277, 12904, 8667, 18749, 4106, 2397, 6174, 9983, 8626, 8636, 4332, 3333, 5805, 5617, 7341, 9691, 18959, 8224, 19533, 1447, 6680, 16671, 6666, 13822, 18542, 16957, 11635, 2637, 11910, 5901, 15275, 4853, 14201, 15576, 2839, 2323, 1740, 18078, 19885, 14538, 8125, 12056, 14519, 11165, 19581, 11367, 8811, 7952, 6094, 10259, 5082, 4182, 7494, 7852, 12926, 7316, 13648, 1029, 12221, 3679, 18258, 17342, 19400, 4423, 2892, 8702, 12045, 18730, 2100, 9029, 7248, 8623, 17749, 17113, 2854, 6028, 3437, 1207, 8465, 19458, 19184, 17287, 5589, 5089, 19840, 16995, 9405, 348, 1432, 128, 17957, 10412, 11006, 17160, 8899, 11642, 14521, 13959, 19733, 12117, 10027, 6410, 319, 9838, 15226, 14872, 17886, 8889, 10186, 12313, 3324, 2523, 9973, 16896, 15062, 4864, 14413, 5675, 6527, 19859, 2100, 1912, 8720, 12213, 1602, 15591, 10106, 15663, 13315, 6285, 18721, 9543, 6220, 18973, 11173, 16574, 5607, 10796, 8335, 10152, 4507, 9737, 1789, 4494, 2668, 9720, 16940, 2825, 15379, 2934, 15318, 5684, 680, 4902, 2711, 13513, 19168, 835, 7138, 6245, 1945, 97, 8620, 19399, 10279, 6858, 14016, 808, 17302, 19124, 1984, 18812, 15830, 9568, 6575, 2482, 13696, 12177, 11888, 16040, 9594, 15583, 8407, 19536, 8048, 11593, 6798, 17560, 15318, 276, 14178, 9440, 9501, 14203, 18112, 7597, 17663, 3103, 18721, 11922, 10307, 14656, 4486, 1636, 7974, 2982, 6292, 8288, 13951, 3382, 6595, 16092, 16804, 444, 13180, 12749, 14004, 10484, 13465, 6682, 7365, 10209, 135, 13243, 18237, 3352, 17645, 3850, 2916, 5776, 19708, 7002, 15575, 253, 7641, 19889, 19045, 12512, 3839, 4174, 8283, 13642, 14653, 9220, 4704, 4247, 1914, 10306, 11814, 5373, 18112, 127, 17996, 3681, 907, 332, 5615, 4259, 19956, 11432, 8157, 11803, 4660, 1985, 4493, 7267, 15089, 12235, 15691, 6328, 14245, 16309, 611, 8112, 8113, 16189, 10391, 672, 6011, 5931, 18595, 19810, 5995, 13408, 19920, 7668, 17663, 17170, 18656, 8657, 13734, 16478, 14680, 12009, 1187, 15641, 9705, 11570, 15329, 15992, 16490, 5540, 8069, 13784, 3641, 14162, 12300, 3343, 1576, 11198, 10691, 16347, 8606, 15321, 2167, 17790, 11479, 6946, 18950, 5276, 14461, 19007, 9666, 17223, 2356, 15926, 7345, 15096, 2409, 10062, 8655, 7534, 13310, 9595, 16933, 18564, 17529, 2706, 17833, 11520, 11780, 3220, 9832, 19433, 8885, 16350, 11905, 4895, 6377, 14332, 17883, 11598, 494, 15174, 5192, 5442, 10882, 13442, 14005, 13459, 14966, 146, 9716, 13611, 9034, 18714, 14921, 7667, 15026, 1141, 5837, 18895, 10334, 13225, 12694, 18718, 6473, 8784, 19837, 18831, 661, 5985, 10288, 1389, 9615, 1972, 18857, 863, 4800, 1258, 18084, 6387, 15726, 1425, 1760, 19664, 17577, 17468, 7654, 6386, 2227, 9612, 3062, 7816, 10307, 5232, 4508, 12161, 12042, 13058, 17781, 9552, 9923, 11820, 13263, 10584, 19261, 8983, 8969, 13077, 13583, 17871, 10692, 15174, 1587, 3720, 15668, 12687, 5554, 3576, 4120, 9374, 14273, 15461, 14276, 19122, 10714, 3823, 10617, 19495, 11408, 15029, 14966, 128, 1184, 18895, 19133, 2598, 19402, 10093, 12585, 11693, 7287, 6249, 19647, 4580, 14839, 1660, 4646, 16375, 17797, 16313, 4214, 18761, 14151, 1144, 14068, 14388, 18534, 3167, 2871, 18994, 14431, 6250, 17996, 4398, 10592, 8629, 4082, 12311, 9134, 19338, 15348, 7740, 3625, 902, 5387, 13670, 19961, 3393, 11302, 8682, 605, 11540, 1973, 17455, 16625, 7137, 14297, 572, 2098, 16506, 4754, 12563, 16839, 8982, 7269, 15290, 4766, 15754, 3234, 19451, 9063, 15868, 15895, 17902, 15728, 14745, 2121, 13296, 13991, 7651, 10620, 15281, 5812, 11557, 12796, 9544, 3634, 9875, 9515, 12001, 4987, 1528, 8365, 19642, 876, 10566, 19638, 3424, 16927, 2644, 17188, 17178, 13335, 6109, 12654, 11719, 3221, 12961, 17652, 3529, 6389, 1803, 7569, 4304, 9905, 15698, 11135, 10401, 14998, 19654, 13455, 15926, 4540, 7193, 18658, 6547, 1042, 15524, 14186, 6509, 6808, 7863, 9612, 10738, 8885, 14885, 15769, 4621, 458, 2087, 6133, 16851, 2325, 10313, 13936, 1580, 15605, 8794, 19678, 14179, 2233, 758, 8775, 19333, 3271, 17542, 17554, 5925, 19552, 12592, 13976, 19267, 159, 13904, 6734, 15531, 9676, 11056, 113, 18059, 17249, 5114, 19384, 15580, 10982, 3256, 14723, 6107, 8845, 13805, 16454, 7789, 3104, 10118, 10689, 19863, 13929, 8610, 19892, 5907, 2136, 9305, 12424, 6080, 11974, 18837, 3820, 19911, 13888, 6172, 9726, 2602, 2767, 18741, 12957, 14456, 14177, 12218, 10917, 2811, 9806, 3052, 13720, 6141, 14651, 12028, 11907, 19090, 10402, 17182, 14944, 12909, 15103, 12984, 14751, 8671, 6647, 7757, 5727, 9626, 4935, 2248, 1711, 7026, 3368, 11370, 18308, 6835, 18676, 3025, 19552, 6228, 15093, 9922, 3106, 1636, 15298, 3733, 318, 13428, 11869, 706, 1402, 14474, 813, 8668, 14686, 15640, 6691, 4513, 13877, 17538, 2199, 3388, 10490, 11277, 7965, 7929, 15604, 7005, 294, 5103, 6591, 6478, 4829, 15316, 7496, 14926, 12119, 14425, 6687, 5847, 11268, 889, 13907, 7730, 13873, 2214, 6391, 2031, 14588, 18565, 16608, 5396, 13785, 10582, 1542, 6878, 1928, 10191, 2653, 19732, 5442, 12333, 12582, 12232, 9602, 1484, 18299, 6035, 2817, 5839, 18562, 8348, 4617, 10251, 16831, 8542, 18412, 16154, 18076, 19351, 13265, 2032, 3168, 6922, 13707, 8857, 5778, 10596, 16288, 6040, 6792, 18288, 1596, 14151, 7809, 7305, 16672, 3748, 9669, 11698, 9449, 2363, 9801, 11608, 276, 336, 13290, 3185, 2422, 11248, 15285, 4293, 5429, 12710, 18867, 5403, 12716, 8195, 18550, 6327, 18082, 8445, 13635, 3767, 8564, 3183, 10362, 5825, 4618, 17896, 12512, 4519, 7304, 17642, 13699, 1311, 457, 17700, 413, 14279, 7371, 9053, 12404, 9873, 19318, 7152, 19190, 9840, 6942, 3927, 3180, 4671, 13442, 15836, 11098, 2506, 12494, 7158, 519, 9315, 18346, 17359, 17176, 13716, 11610, 2910, 5080, 6534, 13732, 16286, 8599, 11387, 5924, 19762, 12031, 3959, 9871, 14806, 190, 16445, 8138, 455, 8622, 5219, 16264, 2665, 19988, 5618, 8448, 1667, 3068, 741, 17736, 16462, 9781, 14930, 13836, 19670, 3303, 7252, 14834, 15666, 15326, 12361, 13103, 1997, 19541, 6186, 5808, 13536, 9765, 6368, 7114, 4785, 19159, 10386, 387, 13674, 14242, 15086, 18386, 9588, 2907, 17337, 16965, 10532, 929, 3729, 1701, 12250, 15608, 16686, 8461, 3933, 6288, 14912, 1238, 17114, 17858, 959, 4802, 520, 12987, 6828, 11260, 13455, 14817, 3770, 3990, 9496, 19216, 4853, 967, 19145, 18437, 3805, 16893, 1235, 2256, 8676, 10061, 11950, 16616, 8550, 857, 2479, 17675, 16148, 14264, 1703, 4016, 14759, 19248, 3320, 10550, 6816, 5393, 8234, 15400, 18776, 16083, 15823, 7010, 18026, 14131, 2361, 19604, 12264, 8087, 17743, 3568, 3042, 11634, 16251, 18957, 7526, 10991, 9840, 18741, 10662, 17575, 11580, 11993, 11574, 13209, 15314, 14470, 15319, 15312, 8769, 10242, 2697, 1191, 1306, 6645, 12955, 2957, 2869, 3427, 9318, 10226, 18742, 12024, 9911, 7369, 1110, 4546, 10297, 8740, 14488, 14317, 12762, 5267, 11615, 5007, 17025, 16686, 8844, 11251, 10452, 16834, 17032, 19267, 13347, 11292, 612, 2036, 13458, 12423, 903, 9355, 4146, 9208, 16072, 8025, 1467, 14035, 2897, 18232, 6075, 462, 13610, 6423, 3875, 7710, 6962, 2119, 1817, 13636, 1440, 9476, 14209, 3535, 11446, 5609, 18735, 6156, 3170, 15913, 6759, 13483, 13589, 9309, 364, 1261, 8155, 7897, 7288, 4963, 11969, 18764, 7894, 9694, 1960, 5569, 1466, 7380, 19015, 5520, 5184, 3532, 10537, 3603, 4103, 9132, 5903, 7541, 15386, 11591, 15690, 14014, 10448, 9010, 3837, 13230, 16230, 10059, 13029, 9948, 2373, 15289, 2230, 11582, 5497, 15373, 6064, 18649, 18258, 10748, 5322, 5263, 12641, 12459, 14880, 6532, 2826, 10694, 17593, 16915, 5334, 1701, 4557, 19731, 5253, 5934, 3537, 1270, 10616, 11169, 1849, 2903, 5868, 5838, 14395, 11770, 5377, 16789, 15137, 10492, 4078, 1160, 9843, 8803, 12351, 19683, 13131, 9651, 10968, 13340, 7306, 12969, 13495, 4893, 8525, 11151, 16202, 8858, 5043, 10541, 19561, 4862, 10153, 9783, 2328, 10168, 357, 12618, 984, 10939, 4610, 2405, 18626, 3090, 16779, 17427, 51, 157, 5993, 13671, 13848, 6162, 16468, 15441, 9416, 212, 7791, 5380, 1092, 8761, 16538, 2277, 8220, 12877, 11779, 5795, 18986, 19198, 17207, 16165, 16461, 73, 2814, 19686, 17856, 11932, 10769, 9183, 4507, 8475, 6045, 7637, 5989, 7751, 3068, 1810, 6630, 15453, 1710, 19460, 7048, 6111, 493, 15725, 17995, 466, 3059, 15243, 11609, 14342, 16496, 4208, 17490, 5080, 4448, 6861, 19624, 18081, 3177, 9679, 15140, 2936, 19613, 816, 773, 2562, 1382, 8364, 10370, 12919, 5184, 5564, 3119, 4565, 7122, 4222, 2728, 1268, 7489, 8591, 2393, 13015, 3996, 8354, 18623, 13935, 19932, 7285, 1988, 18662, 8615, 5827, 16872, 5406, 15189, 10392, 16132, 13470, 11310, 3293, 18034, 1925, 4094, 9948, 6341, 17655, 4509, 9680, 6930, 18467, 7809, 2218, 13023, 4966, 12785, 9043, 7275, 16054, 9890, 663, 8369, 15723, 14634, 15722, 1388, 11073, 17339, 5126, 10655, 389, 19810, 1754, 14719, 11689, 6398, 14603, 17351, 10181, 6819, 9495, 5387, 418, 2988, 9595, 16915, 15195, 12808, 9295, 15098, 718, 702, 4005, 18754, 4231, 39, 16975, 18418, 2288, 12634, 9878, 16074, 12260, 7777, 13166, 4340, 16007, 12334, 2965, 14504, 14874, 15173, 7235, 18915, 14212, 18848, 13178, 7692, 3839, 4527, 10803, 9324, 5396, 19440, 338, 10456, 13150, 1455, 744, 12364, 12862, 8177, 6051, 8220, 12962, 6360, 8123, 8303, 12832, 17265, 2413, 5967, 4749, 1089, 13329, 13782, 8190, 125, 16859, 19713, 500, 14487, 13073, 2121, 13257, 19242, 1048, 15140, 3812, 2448, 4762, 7556, 13649, 3626, 19435, 10404, 8152, 12248, 19975, 7835, 8153, 17166, 12624, 8664, 10780, 18865, 1468, 12878, 14348, 3089, 17231, 9982, 18618, 1405, 3395, 11438, 13837, 7197, 1688, 18344, 17135, 1824, 19239, 17294, 880, 1172, 16508, 10522, 7006, 2081, 10330, 18279, 11940, 19907, 3389, 2402, 3810, 19425, 3440, 833, 9381, 15881, 3022, 1510, 16980, 6907, 18951, 560, 3957, 10596, 14849, 7530, 19498, 2945, 14216, 5078, 5301, 18541, 11149, 13021, 13625, 6330, 3440, 11465, 13477, 9861, 2319, 10390, 14135, 6590, 16598, 19901, 8419, 13777, 3372, 7726, 9191, 5223, 9274, 6363, 13482, 14462, 7630, 12483, 1457, 15627, 7313, 5364, 4514, 19726, 11251, 17588, 16261, 16697, 3170, 2943, 15577, 6545, 2033, 16933, 3348, 7554, 1143, 17835, 1695, 5213, 15138, 15557, 3458, 6685, 4527, 7502, 3539, 12459, 1467, 2846, 11925, 18196, 18171, 15399, 15005, 2432, 11067, 8946, 13241, 4928, 6415, 7, 7007, 11113, 11556, 14431, 18683, 11199, 1431, 1254, 19883, 12129, 783, 15210, 4995, 12073, 6386, 9809, 13384, 15487, 15606, 2032, 17237, 13535, 15336, 10914, 4974, 11035, 14491, 18433, 4027, 9501, 11737, 9980, 16947, 4059, 4052, 16699, 717, 19581, 14647, 10279, 13951, 4638, 12241, 13273, 12085, 651, 16008, 7526, 18807, 7897, 8225, 6994, 6241, 13685, 1810, 9556, 14528, 1477, 15229, 3449, 2311, 15241, 14559, 18826, 14766, 210, 17407, 11297, 3023, 9931, 5811, 6617, 18499, 18568, 9385, 9728, 17438, 7994, 5923, 1222, 16570, 2914, 5005, 56, 15032, 10482, 17304, 7317, 13483, 18420, 14651, 12273, 13773, 19773, 17574, 4715, 1989, 15293, 7590, 2642, 4288, 3404, 18952, 2906, 2825, 8377, 19649, 8594, 4977, 5072, 15323, 19355, 662, 9082, 16561, 6912, 1738, 6077, 2796, 11683, 6176, 6079, 1202, 13074, 18510, 3426, 5826, 13988, 13456, 998, 10579, 1491, 7639, 14424, 19397, 1834, 2558, 4097, 11715, 6749, 19000, 11622, 14571, 13844, 8952, 894, 15811, 15409, 19819, 16968, 13124, 9637, 8838, 7085, 16585, 15267, 6715, 11291, 5647, 4889, 6709, 7598, 8109, 5869, 333, 13629, 12696, 10977, 2430, 6088, 7100, 17145, 10313, 3747, 9574, 152, 4721, 4775, 8415, 12114, 7777, 3379, 9666, 8979, 8320, 15135, 5071, 17537, 608, 2980, 2833, 4497, 15323, 14937, 3588, 7628, 13542, 4479, 303, 11004, 19204, 18256, 8762, 4733, 9943, 15147, 12909, 10658, 7922, 2505, 4856, 761, 4507, 14350, 16967, 15197, 3915, 5990, 11556, 6999, 18298, 17901, 4485, 10645, 12066, 8415, 15143, 448, 5468, 4427, 4473, 12514, 15411, 13879, 1130, 1648, 6398, 17329, 562, 2278, 16396, 514, 19870, 786, 2220, 16189, 13039, 11875, 12628, 12750, 14323, 1393, 19870, 5472, 3721, 18315, 17801, 8046, 8919, 17355, 3368, 12630, 8970, 18698, 14154, 11942, 8535, 936, 6278, 6728, 9953, 14285, 6196, 7099, 14270, 4938, 2779, 10780, 16142, 12105, 618, 18348, 9232, 15156, 14114, 2830, 13569, 10727, 3607, 15784, 9112, 8742, 7274, 16359, 14759, 360, 9164, 6600, 2773, 9540, 5379, 6126, 17799, 16360, 382, 19691, 12632, 14169, 7624, 6400, 4828, 17876, 18106, 8413, 19104, 13601, 2258, 10371, 12922, 11928, 8437, 3599, 7171, 17602, 19015, 5035, 402, 4549, 11286, 16614, 11591, 6307, 849, 8069, 772, 19846, 10698, 15597, 19092, 16534, 706, 19029, 1111, 11402, 18095, 17944, 14083, 18698, 190, 6914, 19188, 3935, 11164, 2284, 6394, 11925, 1309, 18116, 9319, 18113, 9242, 114, 16384, 17599, 3542, 6500, 4226, 12372, 16509, 9834, 5207, 8140, 5112, 18053, 14123, 3030, 15562, 18886, 12261, 15262, 15494, 8838, 2139, 10989, 10315, 5783, 7566, 975, 6986, 15990, 12554, 5538, 5171, 10208, 5550, 6013, 6910, 1535, 5645, 4618, 16080, 9900, 5041, 9317, 586, 5044, 9017, 6825, 5780, 15044, 16805, 3414, 15059, 9616, 8000, 538, 14642, 13057, 15731, 10654, 16824, 1077, 7596, 8836, 15114, 6722, 2902, 9364, 3337, 17238, 16967, 6677, 18941, 2268, 3937, 6339, 9222, 18346, 13238, 970, 12, 19328, 13771, 8454, 13605, 9537, 19498, 2760, 1909, 5108, 13404, 18682, 3282, 17457, 14660, 12761, 8330, 10264, 11947, 14720, 4282, 18870, 19869, 7781, 11622, 10461, 11155, 16338, 15248, 4614, 18251, 14628, 17770, 3813, 2603, 4864, 14949, 18933, 14305, 10691, 17591, 1661, 723, 11491, 10170, 7671, 13138, 19301, 11628, 5943, 15735, 13074, 13386, 926, 6333, 7133, 11954, 1005, 9253, 7164, 19794, 13472, 16858, 6829, 3739, 9996, 5633, 17693, 11588, 18751, 1963, 11609, 14112, 1950, 8377, 528, 15295, 4641, 16176, 2160, 8379, 11051, 3380, 16299, 9609, 16421, 25, 7619, 16228, 3003, 13905, 13586, 3546, 5626, 971, 1268, 19324, 281, 9962, 6800, 11336, 4997, 15964, 12745, 13573, 2186, 14383, 947, 1203, 1867, 18746, 9351, 5765, 9652, 18481, 14702, 3746, 19734, 12526, 13618, 17697, 12330, 1531, 13199, 7216, 2410, 10220, 11925, 10639, 3757, 12321, 15464, 1129, 17719, 18278, 18093, 1121, 17094, 14326, 8852, 18615, 17777, 13892, 2719, 5644, 14007, 17439, 5043, 6657, 455, 281, 5606, 15697, 14147, 10786, 737, 6058, 6046, 11972, 2918, 13817, 6979, 5400, 2422, 8483, 13091, 7430, 13248, 17147, 9629, 7533, 8885, 14148, 7532, 10667, 5184, 16053, 3108, 10179, 5081, 17623, 11384, 1321, 19997, 10523, 19857, 15311, 6616, 4134, 11707, 16191, 1195, 1133, 12201, 9881, 8224, 4871, 237, 18597, 1831, 1406, 11830, 12, 7091, 17570, 12530, 10931, 870, 17540, 4899, 13234, 292, 13322, 7445, 10495, 16255, 3752, 14619, 18909, 13780, 16548, 15630, 4432, 7937, 12384, 13491, 1898, 10809, 14261, 13463, 16576, 6976, 15657, 5315, 7804, 8950, 5388, 11466, 7610, 14097, 4072, 8359, 4802, 1558, 8180, 18535, 8311, 15565, 2763, 3386, 809, 7133, 15030, 179, 1514, 6594, 2345, 17537, 19793, 13937, 7563, 15390, 914, 16245, 2732, 6522, 8522, 1484, 16468, 660, 15927, 3310, 5271, 7384, 1629, 9496, 2061, 15102, 7972, 3432, 14445, 17896, 7259, 12918, 4515, 7694, 317, 2111, 18899, 16235, 8801, 6942, 4631, 13533, 9424, 15781, 11607, 14075, 2410, 9292, 11297, 17919, 16338, 2452, 9952, 13361, 19147, 12523, 1616, 6105, 10122, 12816, 13548, 11427, 8951, 15127, 4703, 8922, 11115, 17278, 19475, 6032, 1707, 15559, 16949, 17262, 17561, 614, 592, 3079, 9992, 7724, 3543, 9518, 1543, 9384, 14822, 4450, 8595, 4556, 8955, 11820, 11069, 2165, 10359, 1177, 16395, 6774, 13135, 14656, 5256, 2561, 1852, 7408, 18808, 8147, 15479, 4402, 14413, 6120, 18562, 3959, 7479, 18438, 10924, 9885, 18715, 700, 2697, 19596, 1148, 12201, 15383, 10306, 11647, 1333, 1794, 8638, 11047, 10261, 6847, 454, 11737, 2415, 1419, 15590, 494, 11064, 7023, 6534, 12848, 19074, 18113, 9907, 12360, 11133, 4805, 19602, 7124, 12552, 5350, 3948, 11900, 14782, 12677, 11774, 17570, 1496, 18599, 14794, 16835, 5423, 3610, 11379, 10798, 5371, 12384, 5493, 13670, 14572, 18935, 14017, 15943, 8515, 13332, 5200, 17531, 5657, 2781, 8025, 19239, 19762, 4160, 17599, 10514, 11451, 5243, 10760, 15226, 693, 18530, 19368, 2729, 9880, 12663, 3196, 8442, 5351, 18545, 16061, 14755, 16960, 15741, 14627, 11110, 12169, 4758, 14834, 2525, 9414, 3407, 18773, 15214, 5442, 267, 13506, 9998, 18395, 11260, 8040, 16417, 19133, 7111, 12418, 48, 15002, 8122, 17573, 8351, 3883, 3126, 12520, 5272, 2223, 9996, 221, 9127, 12666, 1553, 11, 6313, 2807, 13854, 1755, 19950, 12744, 10885, 7200, 18094, 15421, 15634, 15006, 10226, 5082, 19149, 4725, 9181, 7071, 16536, 1139, 8796, 17435, 12115, 14135, 7175, 11881, 736, 5301, 11842, 9656, 2507, 7061, 14479, 86, 13660, 6036, 15664, 18590, 9417, 14816, 11903, 5575, 13360, 13823, 19025, 7498, 6883, 3501, 5938, 10042, 12693, 6768, 2992, 17135, 14350, 14181, 2820, 6459, 1518, 2451, 14884, 1179, 19440, 10849, 5553, 17835, 8687, 52, 17975, 11927, 15126, 17382, 6972, 9794, 8268, 24, 5547, 12172, 1283, 15595, 7336, 10537, 19933, 1011, 13981, 1474, 312, 11005, 16327, 17704, 19823, 18381, 2644, 9748, 16620, 1302, 19398, 17865, 3426, 2007, 673, 13357, 1063, 16146, 17284, 17326, 3283, 15904, 16796, 14875, 18211, 17777, 8322, 11256, 15348, 5677, 13894, 5937, 6396, 14608, 805, 4639, 14188, 1745, 12519, 19202, 11063, 5985, 2930, 14091, 5964, 6158, 19100, 7736, 2498, 7752, 14297, 4103, 19281, 2749, 23, 8912, 10243, 11619, 5509, 4012, 1595, 3996, 653, 13027, 16698, 10281, 5965, 10140, 19910, 9254, 10878, 11004, 8427, 12706, 11291, 10499, 13078, 10523, 10542, 2507, 8648, 6868, 11698, 13685, 6956, 11344, 4557, 18059, 15954, 4619, 2717, 17788, 17726, 194, 6195, 4565, 18758, 1466, 8361, 5317, 19360, 2975, 15926, 9242, 8591, 15407, 13139, 679, 11648, 3454, 7109, 6495, 5108, 1902, 16285, 9075, 8482, 7925, 16751, 17960, 10054, 2675, 9344, 661, 4826, 11549, 12830, 3470, 16153, 17129, 9943, 1236, 19699, 192, 5905, 10603, 9917, 8518, 8107, 10763, 5936, 19375, 14588, 14816, 19081, 10981, 3467, 1430, 17704, 14551, 2366, 14676, 6600, 328, 2908, 10365, 16784, 9447, 14910, 337, 824, 11207, 10762, 11190, 9178, 8364, 17618, 18401, 5521, 18323, 19919, 1261, 6681, 9366, 10556, 6790, 17690, 9425, 3190, 413, 9312, 14120, 5945, 13942, 11280, 2569, 427, 6392, 3237, 19520, 4975, 18582, 5528, 3652, 5850, 2704, 4445, 9149, 10372, 13979, 4403, 7636, 15718, 11446, 12752, 6185, 738, 8037, 19442, 6775, 13189, 7503, 16777, 2959, 15811, 7527, 12396, 10986, 1522, 12328, 9179, 15099, 9776, 7275, 2212, 7641, 3315, 18940, 8208, 5150, 16405, 15067, 19864, 17198, 10149, 9401, 3523, 1945, 11933, 10591, 14139, 15357, 9136, 4145, 16479, 4954, 6372, 14061, 18785, 4132, 17634, 4833, 14436, 797, 5736, 18604, 2719, 17738, 13556, 3346, 9929, 15512, 19259, 17332, 16017, 2408, 1608, 11825, 18673, 10413, 13207, 12414, 4846, 6557, 17143, 4107, 15049, 1871, 13367, 4073, 5395, 6786, 16662, 12819, 6569, 5041, 1047, 2051, 16722, 13684, 5043, 6590, 1165, 16610, 16437, 10986, 1733, 7060, 1656, 15251, 2, 5582, 705, 2363, 5181, 13628, 6622, 15326, 7166, 1015, 16753, 16241, 7013, 8729, 16000, 17312, 10234, 17719, 16379, 12517, 6491, 11856, 3619, 19567, 12996, 8342, 17536, 16349, 5937, 2438, 18513, 1324, 7856, 3890, 4019, 9630, 8181, 6319, 5516, 3810, 13984, 2860, 138, 8153, 12656, 5850, 3353, 12257, 6966, 7469, 3767, 17741, 18165, 6676, 10546, 5525, 8200, 16209, 3785, 4678, 17582, 12104, 13590, 4116, 16404, 58, 18922, 9862, 3063, 828, 17584, 8207, 8682, 4640, 3508, 14598, 1071, 9657, 16346, 12745, 11582, 3725, 14341, 841, 19559, 14320, 1026, 6191, 11111, 1869, 5545, 11871, 276, 16727, 15517, 13507, 12558, 456, 111, 15216, 10479, 5325, 15581, 4848, 19279, 11919, 15359, 4177, 9981, 376, 5029, 14174, 11855, 5798, 3950, 13444, 1554, 10360, 11226, 8429, 15846, 8133, 5620, 7937, 4563, 2535, 6643, 11100, 3298, 3947, 3990, 19417, 592, 5558, 1426, 8155, 19141, 14311, 7074, 732, 19568, 3425, 19802, 19375, 7484, 16452, 3134, 19856, 16170, 10485, 8363, 11618, 5113, 12971, 7119, 6977, 14735, 3503, 11812, 3553, 16777, 12533, 1116, 13677, 2729, 15404, 17706, 15358, 11290, 14533, 18554, 6731, 8717, 14242, 7665, 14315, 278, 2082, 13080, 7629, 663, 17433, 884, 10990, 19459, 3666, 240, 10704, 11927, 4325, 17083, 1073, 16690, 8034, 19254, 18794, 7131, 239, 10454, 7457, 8420, 13047, 10521, 808, 10668, 1759, 19735, 18160, 18171, 3921, 18947, 2569, 11602, 2967, 18480, 14364, 16775, 6431, 5938, 2831, 12858, 7828, 17547, 4705, 5542, 8720, 13246, 8300, 15042, 9274, 4814, 9262, 10796, 14037, 1850, 15777, 16532, 16391, 3400, 5510, 2783, 12747, 15747, 18029, 8726, 3114, 675, 12559, 9382, 7205, 16519, 17750, 13682, 18570, 18139, 19650, 12524, 17448, 4746, 15689, 6676, 27, 14923, 5360, 2556, 919, 10806, 8948, 5023, 5962, 14344, 13498, 13371, 14618, 4375, 2769, 10543, 15895, 652, 19434, 18831, 19917, 17246, 7905, 9860, 331, 4442, 7021, 13177, 12606, 4394, 13812, 17041, 3289, 11926, 6685, 8565, 12367, 9475, 3509, 9398, 3599, 18462, 5835, 1624, 913, 15457, 14109, 2101, 943, 283, 13211, 6057, 8548, 9496, 9610, 6277, 5272, 15238, 19164, 8079, 312, 18527}, + 18254, + }, + + { + []int{1, 3, 0, 2, 4}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_bestRotation(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, bestRotation(tc.A), "输入:%v", tc) + } +} + +func Benchmark_bestRotation(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + bestRotation(tc.A) + } + } +} diff --git a/Algorithms/0799.champagne-tower/README.md b/Algorithms/0799.champagne-tower/README.md new file mode 100755 index 000000000..dea24107d --- /dev/null +++ b/Algorithms/0799.champagne-tower/README.md @@ -0,0 +1,34 @@ +# [799. Champagne Tower](https://leetcode.com/problems/champagne-tower/) + +## 题目 + +We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup (250ml) of champagne. + +Then, some champagne is poured in the first glass at the top. When the top most glass is full, any excess liquid poured will fall equally to the glass immediately to the left and right of it. When those glasses become full, any excess champagne will fall equally to the left and right of those glasses, and so on. (A glass at the bottom row has it's excess champagne fall on the floor.) + +For example, after one cup of champagne is poured, the top most glass is full. After two cups of champagne are poured, the two glasses on the second row are half full. After three cups of champagne are poured, those two cups become full - there are 3 full glasses total now. After four cups of champagne are poured, the third row has the middle glass half full, and the two outside glasses are a quarter full, as pictured below. + +![tower](tower.png) + +Now after pouring some non-negative integer cups of champagne, return how full the j-th glass in the i-th row is (both i and j are 0 indexed.) + +```text +Example 1: +Input: poured = 1, query_glass = 1, query_row = 1 +Output: 0.0 +Explanation: We poured 1 cup of champange to the top glass of the tower (which is indexed as (0, 0)). There will be no excess liquid so all the glasses under the top glass will remain empty. + +Example 2: +Input: poured = 2, query_glass = 1, query_row = 1 +Output: 0.5 +Explanation: We poured 2 cups of champange to the top glass of the tower (which is indexed as (0, 0)). There is one cup of excess liquid. The glass indexed as (1, 0) and the glass indexed as (1, 1) will share the excess liquid equally, and each will get half cup of champange. +``` + +Note: + +1. pouredwillbein the range of [0, 10 ^ 9]. +1. query_glass and query_row will be in the range of [0, 99]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0799.champagne-tower/champagne-tower.go b/Algorithms/0799.champagne-tower/champagne-tower.go new file mode 100755 index 000000000..cc5f3d623 --- /dev/null +++ b/Algorithms/0799.champagne-tower/champagne-tower.go @@ -0,0 +1,37 @@ +package problem0799 + +func champagneTower(poured int, queryRow int, queryGlass int) float64 { + // 答案是对称的,统一求解左边半边 + if queryGlass > queryRow/2 { + queryGlass = queryRow - queryGlass + } + + row := [100]float64{0: float64(poured)} + i := 0 // 代表 row 所在的行数 + for { + nextRow := [100]float64{} + for j := max(i+queryGlass-queryRow, 0); j <= queryGlass; j++ { + if row[j] > 1 { + // 对于所有超过的杯子,多余的香槟,分给它下面的杯子 + nextRow[j] += (row[j] - 1) / 2 + nextRow[j+1] += (row[j] - 1) / 2 + row[j] = 1 + } + } + + if i == queryRow { + // 已经完成了对最后一行的检查 + return row[queryGlass] + } + + row = nextRow + i++ + } +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0799.champagne-tower/champagne-tower_test.go b/Algorithms/0799.champagne-tower/champagne-tower_test.go new file mode 100755 index 000000000..cfa5ebc68 --- /dev/null +++ b/Algorithms/0799.champagne-tower/champagne-tower_test.go @@ -0,0 +1,64 @@ +package problem0799 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + poured int + queryRow int + queryGlass int + ans float64 +}{ + + { + 2000, + 99, + 40, + 0, + }, + + { + 2, + 0, + 0, + 1.0, + }, + + { + 1, + 1, + 1, + 0.0, + }, + + { + 2, + 1, + 1, + 0.5, + }, + + // 可以有多个 testcase +} + +func Test_champagneTower(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, champagneTower(tc.poured, tc.queryRow, tc.queryGlass), "输入:%v", tc) + } +} + +func Benchmark_champagneTower(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + champagneTower(tc.poured, tc.queryRow, tc.queryGlass) + } + } +} diff --git a/Algorithms/0799.champagne-tower/tower.png b/Algorithms/0799.champagne-tower/tower.png new file mode 100644 index 000000000..aa11d2304 Binary files /dev/null and b/Algorithms/0799.champagne-tower/tower.png differ diff --git a/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/README.md b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/README.md new file mode 100755 index 000000000..55828625e --- /dev/null +++ b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/README.md @@ -0,0 +1,30 @@ +# [801. Minimum Swaps To Make Sequences Increasing](https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/) + +## 题目 + +We have two integer sequences A and B of the same non-zero length. + +We are allowed to swap elements A[i] and B[i]. Note that both elements are in the same index position in their respective sequences. + +At the end of some number of swaps, A and B are both strictly increasing. (A sequence is strictly increasing if and only if A[0] < A[1] < A[2] < ... < A[A.length - 1].) + +Given A and B, return the minimum number of swaps to make both sequences strictly increasing. It is guaranteed that the given input always makes it possible. + +```text +Example: +Input: A = [1,3,5,4], B = [1,2,3,7] +Output: 1 +Explanation: +Swap A[3] and B[3]. Then the sequences are: +A = [1, 3, 5, 7] and B = [1, 2, 3, 4] +which are both strictly increasing. +``` + +Note: + +1. A, B are arrays with the same length, and that length will be in the range [1, 1000]. +1. A[i], B[i] are integer values in the range [0, 2000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing.go b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing.go new file mode 100755 index 000000000..fe14f7ac2 --- /dev/null +++ b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing.go @@ -0,0 +1,27 @@ +package problem0801 + +func minSwap(a []int, b []int) int { + n := len(a) + r0, r1 := 0, 1 + + for i := 1; i < n; i++ { + newR0, newR1 := 1<<63-1, 1<<63-1 + if a[i] > a[i-1] && b[i] > b[i-1] { + newR0 = min(newR0, r0) + newR1 = min(newR1, r1+1) + } + if a[i] > b[i-1] && b[i] > a[i-1] { + newR0 = min(newR0, r1) + newR1 = min(newR1, r0+1) + } + r0, r1 = newR0, newR1 + } + return min(r0, r1) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing_test.go b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing_test.go new file mode 100755 index 000000000..3bd6b72c9 --- /dev/null +++ b/Algorithms/0801.minimum-swaps-to-make-sequences-increasing/minimum-swaps-to-make-sequences-increasing_test.go @@ -0,0 +1,66 @@ +package problem0801 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans int +}{ + + { + []int{2, 3, 2, 5, 6}, + []int{0, 1, 4, 4, 5}, + 1, + }, + + { + []int{0, 2, 5, 8, 9, 10, 12, 14, 18, 19, 20, 20, 24, 27, 28, 31, 33, 34, 36, 38}, + []int{1, 2, 5, 7, 8, 9, 11, 17, 15, 16, 19, 21, 28, 29, 30, 31, 33, 34, 38, 39}, + 2, + }, + + { + []int{0, 3, 4, 9, 10}, + []int{2, 3, 7, 5, 6}, + 1, + }, + + { + []int{3, 3, 8, 9, 10}, + []int{1, 7, 4, 6, 8}, + 1, + }, + + { + []int{1, 3, 5, 4}, + []int{1, 2, 3, 7}, + 1, + }, + + // 可以有多个 testcase + +} + +func Test_minSwap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minSwap(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_minSwap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minSwap(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0802.find-eventual-safe-states/README.md b/Algorithms/0802.find-eventual-safe-states/README.md new file mode 100755 index 000000000..9b69a5388 --- /dev/null +++ b/Algorithms/0802.find-eventual-safe-states/README.md @@ -0,0 +1,30 @@ +# [802. Find Eventual Safe States](https://leetcode.com/problems/find-eventual-safe-states/) + +## 题目 + +In a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no outgoing directed edges), we stop. + +Now, say our starting node is eventually safeif and only if we must eventually walk to a terminal node. More specifically, there exists a natural number K so that for any choice of where to walk, we must have stopped at a terminal node in less than K steps. + +Which nodes are eventually safe? Return them as an array in sorted order. + +The directed graph has N nodes with labels 0, 1, ..., N-1, where N is the length of graph. Thegraph is given in the following form: graph[i] is a list of labels j such that (i, j) is a directed edge of the graph. + +```text +Example: +Input: graph = [[1,2],[2,3],[5],[0],[5],[],[]] +Output: [2,4,5,6] +Here is a diagram of the above graph. +``` + +![pic](pic.png) + +Note: + +1. graph will have length at most 10000. +1. The number of edges in the graph will not exceed 32000. +1. Each graph[i] will be a sorted list of different integers, chosen within the range [0, graph.length - 1]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states.go b/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states.go new file mode 100755 index 000000000..e50dfcccc --- /dev/null +++ b/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states.go @@ -0,0 +1,39 @@ +package problem0802 + +type color int + +const ( + blank color = iota // unvisited + danger + safe +) + +func eventualSafeNodes(graph [][]int) []int { + colors := make([]color, len(graph)) + res := make([]int, 0, len(graph)) + + for i := 0; i < len(graph); i++ { + if isSafe(i, colors, graph) { + res = append(res, i) + } + } + + return res +} + +func isSafe(src int, colors []color, graph [][]int) bool { + if colors[src] != blank { + return colors[src] == safe + } + + colors[src] = danger + + for i := 0; i < len(graph[src]); i++ { + if !isSafe(graph[src][i], colors, graph) { + return false + } + } + + colors[src] = safe + return true +} diff --git a/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states_test.go b/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states_test.go new file mode 100755 index 000000000..9c7a3ff70 --- /dev/null +++ b/Algorithms/0802.find-eventual-safe-states/find-eventual-safe-states_test.go @@ -0,0 +1,50 @@ +package problem0802 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + ans []int +}{ + +{ +[][]int {{1420,3521,3576,6682},{1696,6406},{1366,7439,7654,8145,8874,9023},{3167,6434,9866},{9880},{2532,2864,4050,5837,7578,9201},{2179,4153,5120,8623,9537},{4391,7726},{6797},{},{9743},{9412},{436,525,2042,3938,4325},{613,5771},{997,1004,5364,5657,9294},{11,1766},{1589},{},{},{954,2675,3201,3744,9085},{673,4705,4964},{},{3133,6820,7435,8873,9030,9129},{4800,5246},{2086,2184,6105,6863,7656},{5707,9416},{1236,1362,2100,5483,7774},{200,2770,3062,6909},{4000,4854,5738,7131},{498,2741,3546,4612,7249},{304,7876},{},{811},{981,1601,8086},{881,3157,3840,4416,5762,7001},{2843},{7064,8243,8535,9092},{},{1039,1330,3521,6241,7566,9824},{2525,3930,9638},{},{},{30,4280,4386,8742},{1186,3275,3369,5932,9280},{1357,4428,9924},{4064,7039,8762},{6034},{2716,2952,5803,6739,7570,7637},{884,2416,2893,4077,4830},{865,4458},{156,1404,3001,3673,6652},{1618,9069,9584,9608},{},{},{1258,3598,4020,8788},{6823},{1761,2088,2377,5291,6975},{7811,9148},{1408,2509,3789,7046},{273,3704,4319},{441,6834},{3052,4142,5326,6108,6603},{248,3212,5283,5323},{6580},{7211,7259,8646},{1763,3906,5418,7635,9384},{390,3952,8515},{316,2551,6853},{1892,3170,4140,4920,8396,9766},{711,2931,5799,6153,8488,9989},{4624,6994},{324,1329,2471,5439,5818,6557},{849,2997,6969},{},{1137,2402,5590,8968,9658},{1206,3022,3094,3946,6342,8173},{477,3581,5279,6359,9343},{2004},{},{1016,1298,4056,7984,8356},{931,1379,4987},{5241},{1070,1303,2966,7067,8451,8943},{4883,4916,8292,8818},{1419,2502},{3225},{567,2149,2350,6907,7341,7754},{4525},{4432,5460,5561,6062,9362,9533},{2144,2837,3232,4315,4427,6923},{322,1818,6290,7808,8410,9354},{2428},{7943,9241},{707,3294,6985},{2608,7363,9226},{2194,2196,5861,7451,7725,7911},{123,2790,5323,7224},{4954,5824},{},{},{4556,8940},{4198},{2386,8572,8936},{1302,3164,4378},{3266,3558,5259,7274},{1036,3762,7572,9851},{549,4441,6631,7424},{51,758,1296,4687,6030,9056},{348,6662,6823,7650},{1703,2083,5899},{2609,5603,7874,8656},{339,553,2943,3488,8335},{9835},{},{2154,5093,6668},{1534,2124,2315,7732},{3697,7944},{},{1351,2339,5495,7885},{1116},{4465,8237,8250},{4400,4862,5709,6809},{294,2860,4563},{4380,5315,6359},{5373,8082},{2727,2875,3272,7333},{},{2226,3430,5121,7898,8407,9229},{1741,8410,8621},{1573,4450,8741},{},{2084,3010,4659,6197,6266,8955},{7945},{399,4177,5100,6781,7982},{3555,3920},{1584,3251,4979,6103,9606},{3400,5856,8298,9138},{1227,8896,9401},{},{1285,3502,5254},{1088,4326,6081},{6678,8189,9575,9866,9923},{2391,6077,7489},{826,3582,4948,5494,6020,7164},{1497,2189,4598,6484,8131},{},{},{5987},{},{1696,2190,3200,3991,8861},{326,1110,1554,3028,7058,8254},{8549},{2638,5477,5877},{5106,5749},{721,1545,2385,5425,6511},{51,863,2009,4966,6828,7518,8290},{9493},{832,2658,3291},{917,3839,4709,6130,7475},{2029,2245,5490,5598,6654},{340,3691},{6202},{3364,4543,9759},{6378,8450},{2991,8780},{383,7995,9775},{},{381,2437,5164,6110,8913},{1681,5522,5904,6473,9865},{659,5028,9096},{3170,5317},{1202,1741,9692},{1140,2299,3586,4335,6026,9416},{1517},{},{4211,5547,7074},{1416,2161},{4548,6615},{2904,5164,5967,6337,8027,8630},{1287,8598,9362},{3000,5509,6158,6917,9072},{5504,7352},{4160},{857,6468,7645,8534},{2973,3993,6240},{1680},{1490,2135,8530,9614},{721,1641,2832,7089,7358,9380},{2794,2955,3562,5555,6857,7704},{1349,3166},{3488,5857,6757,7438},{4319},{1548,3722,4090,5923},{370,1052,1919,6577},{302,416,4148,7117,7267,9918},{292,2050,4538,7390,9417},{6687,8412,8466,8951,9926},{286,545,806,4358},{542,1329,1894,2045,3451,4884},{4106},{1712,2820,2947,5061,5346,6254},{900,2535,5020,5325,6754,7938},{8158},{3594,6132,6138,8277},{268,1483,4478,8331},{1834,2015,9087,9723},{258,712,3506,6441,8924},{6488,6655,8380},{881,7391},{563,2217,7012,9120},{3080,3572,4854,6318,8849},{3009},{},{342,6064,7288},{},{679,4130},{314,4761,4827,6567},{8829},{8091},{1926,3925},{3553,4841},{823,2106,3571,6908},{1937,6610},{9335},{773,2678},{},{2958,6253,8509},{8323},{1317,1790,2725,5572,5752,9124},{2965},{357,5838},{3195,3758,6146},{2025,4638,7389,8611},{3469,4638,5389,8854,9185,9551},{3790,4483,4596,4916},{7677},{3287,4056,5739,7142,9640},{2733,3338,5399,6747},{2595,9358},{1281,3858,8562,8761,9438},{2022,3588,4597,5553,9418},{2065,3670,6003,8886},{693,699,1168,1608,4326},{2167,3493,3556,7430,7980},{450,2820,8836},{},{901,4807},{88,1527,3286,3394,8319,8391},{983,6766,9943},{4507,8121},{1794,1805,4214,7841,8926},{},{5128,5901},{1396,4152},{761,2024,8818,9866},{288,3822,7893,9111,9175},{67,1218,6881},{119,4599,4807,4829,5550,6240,6846},{730,4816,6234,9906},{},{1214,2506,4802,7662,8021},{918,1097,2301,5980},{2485,3688,7178,8947},{2570,5474,7814,8737},{1909,5381,9890},{1333,1482,3667,9969},{1311,1783,4791},{},{},{4875,7398,7666},{990,1500,2556,2932,7415,8376},{1182,3001,5651,7747,8451,9583},{2621,4802,6957,7658},{6671,6879},{2341,6010,6546,8972},{434,8266},{},{458,1033,6952,8496},{2871,6815,7147,8344},{334,2421},{2155,5528,5995,7443},{422,7308,9190,9226,9292},{3405,8180,8238},{588,4994},{},{5386,5757,8958},{3239,3779,8092,9191,9577,9850},{589,1280,3129,6757,9767},{293,1998,5937},{4499,6693},{748,892,1254,5114,7234,8191},{1722,6539},{5531},{2710,5985,6700},{3128,4489,7014},{9389},{5395},{3384,5179,5327,8572,9817},{2404,5916,7596,7771},{4612,5503,7605,8728},{7823,7827,9227},{788,3461,3516,8836},{3279,5242,8111,8168},{2657,8440,8980,9270},{},{1981,2176,2231,2331,5309,9608},{2803,3563,7103,7378,8833,9550},{963,2275,3911,6850,7975,8077},{1635,2985,3655,7975,8932},{330,766,2780,9104},{1464,6368,6692,9747},{8308},{2676,3785,5559,6651},{89,5800,7078},{7115},{1238,3364,5524,6455,9341,9650},{},{1664,5603},{1176,3563,9384},{3629,9345},{2201,7539},{876,3377,3924,6127,6449},{950,2485,4686,6504,6914},{7703},{3747,5211,5258,9023},{3167},{504,2156,5328,6533,8091},{3660,4993,6128,8792},{1684,2078,2556,7170,9522},{1549,3561,3682,6107,6838,8514},{973,2753,4045,5364},{1665},{3329},{4352,6656,9281},{2809,5086,7095,7529,9488},{5383},{1933,2843,3881,4806,6396,7487},{5630,5734,8951},{3171,4172,6217,6846,8123},{},{4439,8769,9508},{6929,7514},{4990,7736,8856,9190},{4024,7487},{},{884,3877,4645,4825,5355,6059},{2330,8760,9157},{1497,3469,4930,6893,7867},{2832,4310,5681},{3870,8555},{316},{2769,3381},{3271},{467,2178,2601,3369,8936,9754},{7436,8007},{},{7283,9045},{2534},{2509,2678,3902,3948,4955,6022},{449,597,1560,2277},{2684},{3060,5957,7071,9137},{4049,6556},{},{1955,2975,4699,6139,6802,9928},{921,1604,5440,5602,7316,8393},{3363,3760,3929,5152,5428,7268},{6376,6487},{2091,2263,3328,5191,8692},{897,1221,2748,5529,7128,7631},{304,645,5306,6701,9762},{484,3046,6227,8905,9318},{2225,6993,8371},{4414},{9220,9298},{7693,9249,9720,9977},{3007,3557,3811,4130,9909},{1477,2473,8233},{737,4198,4970,6213,6492},{788,2561,4674,6890,8701},{2317,4765,6429,8320,9891},{3066,6001,6272,8925,9984},{2681,3239,4376,5062,7664,9155},{1351},{},{1552,3661,4219,4744,7865},{3114},{2849},{8250},{1610,6126,6505},{2312,4825,5534,6919,7215},{5506,5886},{2146,2854,3826,3849,4789,7766},{},{4795,9835},{422,1500,2628,4372,6128,8947},{3219,8202},{739,1286,3100,4470},{833,2503,4234,4441,9682},{1417,1544,2452,7349,8106},{3318,3383,6587,9193},{547,2113,2290,2338,5018,8622},{},{9484},{},{7700},{4,2711,3864,5969,7856},{1566,6675,7670,8855},{526,8506,9101,9603},{3924,4721,4953,5152,5912,9070},{3128,4810,8872},{3542,9261},{937,4686,7268},{1400,3599},{5150,5866,6553,9376},{2262},{323},{6579},{4066,7614,8018},{1048,1252,1523,4252,5890,8051},{426,2293,6271,9061},{600,2069,3970,4986,6042,6577},{1163,1884,8175,8797,9609},{2020,5840,8303,8913,9373},{},{2169,5988,6424,7938,9188,9750},{538,1091,8355,8838},{2012,6141},{1464,7932},{5610,6117,6909,9656},{7614},{764,766,6110},{6180,7164,7455,8457,8946,9554},{3028,3707},{},{5335},{1222,3240},{1157,1505,1952,3857,7917,9120},{7519,7566,8529,9017,9908},{999,2739,3122,5610,7616,8459},{1109,2206,2484,9241},{1333,1791},{},{6348},{540,3899},{5070},{946,2405,4314,6054,9949},{4336,9103,9795},{3117},{1777,2700,7152},{3157,5326},{1312,2128,2654,4693,6649,7451},{924,949,5779,8137,8452},{4424,6081},{},{3469,5914,9545},{},{},{},{},{1926,6796,7127,7514,8585},{3306,4930,7758,8645,9073,9566},{3303,6713,8325,8506,9811},{2364,4362,6883,8148},{3326,5110,5828},{},{},{3076,6422,8494,8931,9009},{4167},{5674,8932,9423,9529},{499,3286,4075,6755,7680,7898},{2079,2187,3190,4239},{803,3185,3973,4080,7093,8344},{},{1415,1595,1734,2696,7156,7383},{4195,6053,6958},{1499,1562,8994},{8126},{4780,8238},{4388},{},{1424,5103,6665},{3909,4051,4245,5144,6640,6708},{3942,6050,8120,9406},{3151,7332},{656,1200,7992,8914},{1219,2641,8421,9832,9949},{3185,3867,5360,7838,9200},{1462,2521,6697,7606,9726},{1207,5209,7795,7823,8215,9436},{},{3348},{4422,4529,5424,5954,7417,9776},{2880,9831},{3386,4254},{719,860,2087,5040,6387,9813},{943,6480,8995},{900,1370,3499,5901,5940,8748},{1765,3898,7112,8734,8986},{1092,6754,8799},{836,1131,4636,9288},{2744,4768},{7303},{},{},{1345,2413,4386,7656},{6493},{},{5647,6030,6510,8503,8795},{1566,4267},{7242,8319,8653},{7019,9528},{1894,3161,5504,6101,7671},{2026,2965,3783,5003,6185,9846},{1917,3627,4059,7731,8176,8652},{},{4632,8677},{631,2515,3292,9033},{6217,6294,7924,8235,8271,8649},{2815,3394,9948},{912,2072,2784,4879,9090,9501},{2528,3661,5406},{2127,3647,6141,9115,9834},{4989,5345,9353},{5235,7093},{3048,4049,6920,8280},{820,4695,6937,9006,9123,9771},{5490,5880,8426,8820,9791},{720},{2364,4966,5001,5890,5892,6781},{3032,3052},{1510,2620,2783,5182,6642,7446},{1169,2138,5369,9160,9449,9514},{6735,9908},{708,4196,4638,4736,5465},{1453,3604,5637,9122},{2258,5223,7757,9402,9609},{8998},{},{9253},{705,3048,7549},{1284},{2919,4364,7887,9375},{5531,9581,9695},{},{1297,1790,2669,3735,9996},{2298,2960,3268},{2909,3572,3694,7773,9829},{2581,4448,5228,7339,8261},{2131,3516,3835,9104},{2557,3809,3934,4607,5550,9933},{1973,3044,4788,6640,7788,9180},{1065,3471,4294,5210},{1728,4061,8655},{2068,2682,4357},{5741,8949},{6985,8431,8612,9017,9610},{2756,4386},{},{3195,4596},{1684},{799,875,2629,3146,5779,7203},{2148,3009,4588,5604,8903},{604,4187,4365,8220},{1262,1519,5107,6117,7004,8547},{},{2406,4429,8150},{8007},{1836,2327,3263,3323,8983,9858},{},{5761,9652,9856},{5125,6547,7270,9627},{919,2942,6081,8647},{1973,3569,7560,7908},{2172,2548,3706,6719},{1280,2896},{876,965,3801,4657,5361},{2689,2897,4183,5900},{1580},{660,2205},{5898,7715},{1536,1694,7926,8691,8908},{4369,5674,6412},{964,1324,6239,8178},{1857,6135,7041},{2436,4446,6549,6591,6819},{1329,2880,3578,4336,4729,6965},{6039,6132,6264,6275,8389,9322},{4916,7517},{},{1240,2240,4815,7226,9215},{1083,1679,7510},{1960,9230,9939},{2703,6071,6209,7361},{1470,3967,7911,9332},{1813,4882,7591},{1380},{3709,6241},{3577,6285,8270},{1138,2925,3918,4650,6009,8081},{},{3663,4783,4902,7742},{3093,3166,3214,4140,4541,6623},{5283},{3901,6464},{1484,3932,6203,7542,8340,9265},{8397,8444,8965},{698,1241,1469,7063,7706},{3245,7567,8609},{808,1368,1460,7052,7456},{4761,5817,7987,9377},{1724,7708,7771,9478},{2059,2193,2550,4702,6940,7999},{5466,7042,7059,7900,8677},{2076,4004,5509,6919,8526},{1422,1798,5815,6425,7453,7630},{1589,3286},{4197},{1121,3664,4625,4885,7669},{2219,3302,5123,7970,9035},{2745,2961},{2358,5394,6477,8997,9010,9178},{4784,6261,7755,9200,9643,9792},{2891,4184,4533,8789,9201,9635},{3751,5243},{668,2062},{8785},{},{5949},{1520,4794,5191,8559},{4515,5597,9873},{7253,8368},{2544,7722,7965,9737},{4165},{3090,5503,8443},{700,1623,4264,4548,6104},{},{2830,3671,5971,7233,7906},{278,1287,6666},{1075,3873,6420,7495,8746},{1228,2039,4509,5471,7049},{2744},{9499},{3626,6248,6983},{},{7409,9569},{1508,1959,1967,6271,7071,8544},{3469,4012,4900,5014,7975,8444},{2859,9518},{672,3855},{8017},{4488,4849,6478},{2374,3777,6686,8393},{4150},{783,4379,4490,7485,7687,9218},{1593,3776,7800,8164,8686},{6409,6442,9652},{1022,1818,3112,4320,7456},{2063,2245,8708},{3740,4211,4944,6018,9216},{734,1206,5831,8143},{},{4549,6394,7346,7812,9040,9160},{4462,9195,9427},{911,3007,7581,8511},{1724,5359,5728},{5444,7043,7417,9296,9843,9938},{694,795,1322,2813},{759,3003,7649},{3619},{4403},{2515,2617,4443,8036},{795,1725,5644,6342,9146,9993},{3479,5731},{2245,5020,7604,7757,7930,8982},{},{1675},{1875,7167},{7698,8724},{},{3207,9571},{3372,3667,7425},{5947,7029},{702,4908,6860,6996,9813},{900,1515,3460,4025,5998},{1247,1512,4898,7739,9164,9501},{3582},{2090,9681},{1653,3103,3245,3295,7608},{2251,3222},{2214,2915,4407},{3654,4925,8956},{},{1637,3333,4568,5880,6688},{2512,4543,6694,7685},{4564,8168,9651},{4956},{2194,5270,6366,7121},{5888},{876,6985},{2195,9940},{3465,3782,4296,6941},{},{},{1614,6683,7157,7802,9374,9848},{7003,7961,8347,8402,8783},{1122,2087},{6861},{1778,3498,6485,7319},{6406,8481},{1362,3720,4811,6078,6749},{1365,3412,5731,7070,8925},{2624,4284,7416},{},{4092,4268,5546,6883,7041},{2932},{4438,4693,5431,8157},{4978,5988},{2226,2840,6338,6748,9721,9811},{},{1721,6295,8884,9337,9860},{7226},{7089,7715,7726},{1248,4895,7207,8377},{},{1267,2600,3027,4340,4548,8825},{5585,5933,6098,6967},{},{},{1970,2234,5656,8725,8922,9520},{1752,3706,5364,9518},{8551,9168},{2913,3698,8889},{1381,1447,3710,8114},{5308,7159},{5262,7363,8012,8578,9738},{1068,4990,5070,6253},{9966},{3611,6623},{2711,3890,4170},{817,5106,8411,9912,9976},{1802,1962,2641,7096,8342,9618},{966,3105,7208,7822,8077},{1444,6231,7253,9228},{3923,4044,5367,9455},{808,3240,4777,5886,6632,6709},{1186,1428,5553,8948},{1504,5130,5925,7189,8342},{2254,4942,7842,8081},{},{6220,7063},{2551,3892,4916,7623,7652,9641},{5876,7853,8057},{3085,9829},{4141,6812,8891,9560},{3167,4231,4900},{5241},{2265,4715,6635,7636},{5899,8955},{3094,6815},{7448},{1492,4563,5875,5878,9740},{3222,3351,4369,4827,4893,7716},{923,939,1150,3380,9158,9363},{3342,3539,3616,4684,6018,9934},{2652,3300,5845},{5205},{1524},{},{8318},{1958,4922,5690,8827,9150},{896,1609,1927,2947},{5020,5083,6095,8651},{1566,5961,9428},{1939},{},{},{8934},{},{1859,2154,2482,4236,4266,7058},{1448,4120,5973,8499},{2713,6620},{919,1579,5339,5385,9957},{},{917,2115,5718,7978,8510},{2620,5183,9390,9436},{1544,1914,3670,8964,9206,9941},{},{4844,5523,6029},{2485},{8208},{1636,3558,5681},{},{1089,4472,6491,8383,8748,8907},{6037,7368,7824,7950,9986},{3198,9029},{1613,5448,5933,7572,8421},{},{204,3951,8601},{6185,6488},{8609},{1413,1495},{2750},{8886,9255,9430,9958,9981},{1532,9982},{1417,6020,6669,6863},{},{1986,3312,4207,7019,7345},{2244,6479,7705},{4489,6012,8981},{1464,3512,4173,7400,7981},{2855,4563,7548},{},{1304,2024,2169,4703,7228,7839},{2209,2704,4995,6590},{2955,6082},{1360,1389,5056,6065,7849,9531},{},{1644,5894,7845,8153,8932},{},{4467},{867,1223,3683,5264,9709},{3367,4256,5656},{1502,5371,7621},{},{1567,3296,6615},{8523},{},{4013,7667},{1822,2654,3267,6114},{1035,1172,2952,3717,8146},{4622,5108,8822},{4613,6350,8725,8808,9522},{3949},{},{2651,8079,9433},{1078,1262},{5786,6286,7094,8376,9190},{5878,6393,6928,8469,8693,9829},{4720},{1214,3504,5808,6694},{},{2471,2757,2978,5774,8133,8482},{621,1256,3399,5141,7132,8612},{2683,2812,7789,8111,8793,8828},{871,2467,3270,6958,9047,9586},{6663,6763},{1448,2569,4316,5407,8917},{5857,5920},{2047,3743,4218,9087},{1676,3777,3858,5611,7699},{},{2564,9565},{3990,4784,4988},{4269,6047,8992},{1197,4659,8202,9318},{2818},{4083,5433,5688},{4373,5088,7892,8293},{},{2808,7922,9606},{8655},{},{3476,3779,6075},{946,1491,2002,2076,2144,6272},{2889,3872,6062,8003,8071},{2338},{4668,4711,5341,9142},{2481,7012},{3874,3950,5073,6081,7253},{5673,6628,6689,7369,7727,9094},{2855,8287},{1609,3856},{1361,4987,5048,5249,6053,7561},{3143,4257,5850,7050,9510},{6629,8690},{5668,7164,7984},{2705,3961,8734},{7714,8162,9345},{},{193,4290},{1752,4555,5158,7962},{3094},{1615,9574},{2159,3683,5349,5529,7563,8720},{5202,7799,9136},{6191,8014},{1752,9467},{2401,2904,6004,6191,8104,8376},{3978,6668,9647},{2292,5940,6368,8750},{2935,3060,4199,8048,8418,9811},{1315,3665,5866,5885,8796},{4483,6512},{7112,8655,9919},{1263,3783,4024,4143,7311},{4061,5733},{1314,2403,8467},{1574,3899,5879,8448,9117},{3604,5344,5774,7005,7265,8229},{970,974,1027,1110,1207,8269},{4189,5186,7431,8269,8850},{924,1649,1789,4201},{2777,3568,4291,5748,6617,7595},{2863,3145},{5346,5600},{5274,7075,9362,9965},{5412,8836,8924,9730,9794},{3402,5080,8337},{2122,2784,4428,5037,6770,7098},{6554},{5378,9376},{3343,5055,7163,7588},{3433,5005,7339,9694,9905},{1893,2924,4822,5741,8550,8666},{1389,1641,1731,1891,5190},{4285,4373,4647,5405,5699,8728},{1500},{4272,5871,8459},{4782,5161,9684},{3787,6282,6905},{929,1240,7161,8884},{2750},{4547,5254,8231},{1526,7229,8756,9150},{},{},{8322,9936},{},{},{},{211,3892,5029,6563,7417,9707},{6588},{1161,3133,3797,4969,5373},{4044,9357},{1859,2577,3563,7872,9427,9835},{3702,5689,9878,9978},{1127,2783,4636,7117,7540,8101},{1048,2035,6762,8167,9530},{1158,6221},{2622},{2116,4732},{1532,6121,8898},{4851,5894,8863,9264},{3446,9814},{1290,2444,2494,2772},{3352,5319},{4715,6179,6262,6514},{2495,2846,5848,5955,6707},{1034,5380,9375},{5332,5867},{3451,3866,6121,6210,6246,7981},{374,1473,4684,4779,6477,6719,7487},{},{5340,6446,6935,7235,9397},{3284,5735,8231},{1320,2156,4769,7496,9724,9866},{4911,6265,6551,7124,8676},{6864,9943},{1487,3973,4016,6465,8177},{2493,3293,5168,6473,7994},{1157,7779,9235,9737},{2057,4604,7812,9835},{5661,7003},{1665,4179,5282},{},{3810,7286},{5620,8812},{6165},{2147,3723,7366},{},{},{9427},{1266,1630,1775,5101,5410,9763},{3445,4898,6400},{1147},{3543,5114,6585},{2424,4997,6228,9595},{3820,5685,7730,9612},{2353,4160},{},{},{1997,3937,5444,5773,7884,8867},{},{},{2241,2408,5306,7303,8766,9907},{1257,7812},{1552,4150,4332,5121,5455,9626},{2590,3739,5827,7388,8286},{4293,4732,5573,7823,7892},{2804,2988,3569,4552},{1161,3160,4141,7315,9657},{4127,6194,6695,7882},{1062,1249,2778,8285,8630},{7379,7499,8074},{6031,9303},{1240,6742},{2836,2845,6979,8549},{6657},{3531},{1331,2738,4056,5580,9449},{},{2064,4727,8540},{1099},{},{},{2076,4427,5395,6462,7735,9757},{4433,8662},{6425,9250,9601},{9153},{3428,3833,4426,5481},{1194,3362,5133,6731},{9602},{3562,3728,4928,6151,6347,9088},{8811},{3703,3779,7290,7568},{2028,2297,5146},{1520,1845,2762,5583,5893,9639},{1673,5012,6536,7041,7406,8951},{},{6401},{1174,4283,5204,7017,9614},{1665,1760,3524,4185,6244,6419},{2651,5355,6969,7259,7789,7845},{1356,3252},{4665},{1712,1800,6184,8978,9869},{6400,7113,7823},{1739,5406,7678,9154,9561,9810},{3564,6924,7014,7665,7704,9633},{3413,7285,7942,9881},{1331,3103},{2857,3178,4052},{1410,2824},{},{},{1163,4923,5214,6051,6673,7504},{4869,4878,7317,8690,8819},{},{2273,9513},{1099,3934,4491,7309,7688},{},{1211,5112},{3441,5107,5362},{1814,3106,5599,6389,8826,9626},{5443,6662,8430},{6497,6931,8654,9664},{},{2354,4398,5046,8742},{3348,5699,8178,8680},{3734,9388},{1700,2238,3184,7170,8883,9684},{2720,3078,3355,3912,7680,8809},{},{2344,3986,4408,5301,7353,9450},{4033,5873},{1085,2596,4106,7765,8705,8710},{2849,4517,7445},{1158,1512},{},{392,2489},{3962,5398,6536},{1803,2131,2913,3852,8892,9837},{1379,2341,3723,6026},{3866,6001,9064},{2070,8234,8529,9032,9546},{1133,5206},{4153},{2760},{3748,4106,5692,7130},{2178,6052,6610,7031,8596},{1949,3980},{4879,6300,6639},{},{3112,7238,7541,9960},{},{2146,9523,9627},{1661,2031,5259,6069,9719},{2897,6182,7036,7482,8113,9788},{5386,7647},{2041},{2438,3767,4772,7284,8332,9649},{},{4015,5570,8021,8845},{1135,2208,3476,5774},{1360,3705,5484,9690},{2457,4077,5121,6393,8680,8990},{7103},{1513,3174,4137},{2851,3243,4904,9179},{7380},{},{2431,3073,3513,3758,7142,8271},{4297},{2746,5011,5611,9766},{4017,5495,5848,8487,8515},{},{1410,2721,5995,8887,9904},{1312,3252,6917},{1818,6380,6630,9226},{3698,5412,5978,7016},{1434,1903,2238,9155},{1955,2070,2422,7736},{5136,6405,7371,8569,9572},{},{},{2481,4075,4923,9387,9951},{},{3178,5198},{1518,3931,6652,6987,7988,9594},{1849,2565,2942,6567,8296,9981},{5681,5796,6299,6913,8783},{1971,4558},{2115,3308,5590,6741,6939,9264},{1333,7185,8091},{5451,5820,6888},{1706,4115,4389,4524,4782,7294},{1646,2923},{3365,6208,9505},{1352,1972,4969,7980,8766},{4205},{2916,4229},{},{6408,6888,8299},{3426},{2045,4974,5363,5805,6717},{1533,5800,8486},{2619,3520,4844,5429,6170,6245},{8355},{1448,8118},{8191},{2712,3212,4347,5470,6372},{},{3885,6251},{7205,7577,8008,9619},{4600,4924,5712,7030,7977},{1632,3560,5827,6609,8181},{1151,1464,2294,3248,8406},{1228,3987,4422,6383,6622,8689},{},{3312,4700,5194,6769,8026,9916},{2276,2593,8721,9451},{1341,3414,8069},{},{1350,1390,2831},{5799,6688},{3817,5397,6646,7918},{6586,6916},{},{},{},{4364,4610},{1696,3160,7099,8585,8813,9813},{1159,1461,6084,6140,8862},{2685,3695,3896,4644,6856},{4538,7437,9672,9858},{},{1718,4686,5505,8140},{},{},{3484,4022,4543,5058,5681},{1895,2782,2813,7410,8357,8955},{2526},{3946,6816,8467,8705,9843},{8996},{1300,5653,7559,8769},{4366,4795,9852},{3178,3378,4586},{5306,5915},{4444,4463,6739,7814,8405,9150},{1834,3335,3458,4275,6015},{4261,5461,5664,7217,9546,9716},{1639,3798,7182,7920,9580},{1470,4618,5106,5250,9919},{3622,6447,6783,6905,9992},{1598,3848,6593,9388},{2901,8070,9552},{3280,5731,7869},{2408},{6327},{2208,4754,7249,7334,8463,9792},{6100,6695},{1862,3500,3539,6725,7191,9235},{1801,3289,5893,6739,8472},{5768,7320,7348,9459,9693},{4328},{},{2251,3090,7846,9286,9524},{1334,7356},{8313},{2087,3378,5946,8347},{},{2132,6316,7690,8959},{1875,2063,2966,3063,4614,5759},{1764,7048},{4227,8123,9158,9682},{2264,5022},{1895,4065,6224,6244,9830,9932},{3231},{3838,4251},{3411,3546,3797,4771,5460,6459},{6478,9167},{},{1624,3552,8108,8274,9527},{2435,3102},{5524,6119,6889,7863,8221},{1822,5650,7043,7479,8640},{1381,2568,2913,2973,4621,6395},{},{},{2131,4482,4518,9304},{1857,8148},{3385,3471,6760},{1414,2428,5423,6312,7516,9718},{1576,3055,4563,6181,6288},{3529,4185,5245},{},{7650,8900},{8797},{7297},{2801,4097,5790,7600},{2333,3433,4322,4558,8756,9908},{4463,5353,7303},{1380,1660,2454,6193,6368,9704},{1869,2329,4776,6486,8986},{3710,7399},{1814,1910,2565,4707,4708,8342},{4308,6135,8258,9923},{3054,3689,8798,8872},{2718,3016},{4754,8071,8671},{9995},{2103,3055},{1803,3092,6124,6572,9433},{},{4135,4657,4684,6641,8301,9290},{2704,5083,8714,8961},{1275,1779,1871,2469,3182,3513},{2860,3467,4239,6172,6376,9762},{2136,2213,5987},{1284,4028,4187,6787,9328},{2077,2870,5849,8996},{2048},{2495,2710,4967,5563,8454},{4073,4104,8918},{1628,8614,8797},{2822,2883,7632},{2880},{1511,5854,7739,7756},{1519,1977,4243,8484},{5709,6894,8398,9114},{5267,5756,8093,9950},{},{2129,4401,4956,5860,9654,9719},{6849},{2274,3963,5247,5651,7823},{2197,4618,5204,8459},{6544,6852,6917,8074,9091,9094},{7575},{4467},{2575,3912},{},{1885,2064,3621,9209},{2394,6235},{},{9240},{},{3883},{4609,5031,6492,8135},{3588,6155,6364,8161,8505},{7137},{3483,5734,7376},{},{1785,5016,5486,9436,9527,9872},{6526,7263},{2667,3088,5471,6952,8627},{1387,1808,3289,7840,8171,9817},{2387,4221,4488},{2732,3152,4992,5643,7677,9628},{2090,5853},{4448,5091,7715,9970},{6876,7031},{1772,6325},{2419,6085,6591},{},{1542,2089,2224,5651,6134,7691},{1683,2640,9838},{2372,3057,4831,5009},{},{1887,1954,5922,8575},{7044},{3324,3362,5088},{6001,8268,9968},{4358,6572,6973,7549,9062},{5003,7064,7495},{4068,4244,4368,4789},{},{},{1465,5551,6393,7027,9511,9583},{3376,3524,4966,5640},{7320,9249},{2035,4027,5061,5128,6680,6843},{},{},{6028,7160,8471,8524},{2643,5248,6423,6564,7393},{2411,4350,5233,6236,7133,8628},{7293,8061,8887,9261},{},{7973},{1668,2928,4696,9183,9812},{7368,9522},{5288,5725,7319},{2372,5187,5858,6259,7875},{5155},{38},{3141},{6993},{1452,6760,8951},{3750,6165,6240,6996},{4947,7829,8273,9717},{},{1560,3587,8623,8684,9517},{8485,8838},{2215,9628},{1710,1891,4861,6728,9213},{1570,1647,1816,8857,9962},{},{3042,8094,8647,8972},{1750,2705,3059,5129,5260,6277},{2074,2736,7152,8852},{2792,3117,4123,4281,6122,7069},{3785,7496},{8320,8903},{3582,3718,4491},{2013,3662,4483,7911},{2427,4096,6272,7394,9666},{2411,3983,5018,5044,5390,7560},{},{3395,4133,7224},{7364,8671,9235,9315},{3166,3372,4677,5278,5425,6840},{1699,4070,4883,8278,9052,9440},{2385,2837,5995,6900,8903,9424},{2143,5331,6726,8378},{3675,4437,6218,7540,9018},{2308,5089,7665},{2646,3965,8297,8581},{},{2467,2562,3701,4469,6245,7028},{2441,5953,6157,6973,7013,8192},{1640,1936,3508,4957,6833,8021},{3592,8838},{6471},{4231,5340,6258},{3265,4324,5001,7542,8247},{2489,2565,6041,8021,8204},{2442,5482,6984,8900,9184,9752},{1481,1641,5539,7082,9277},{1485,3261,7066,7769,9355,9862},{1927,3319,3774,7499,8267},{1825,5128,6120,9109},{1385,3037,7798},{9479},{8891},{},{5991,7705},{9333},{3680,4300,5565,6747,9050},{5794,9261},{2621,2828,3706,5517,5527},{1688,6863,9872},{2166,7026,7557},{2241,2691,3104,7397,8194},{5826,7935,9216,9834},{3048},{4608,8414,8623,9878},{3341,3816},{4223,6412,6531,6958,9788},{2851,2983,3253,3704,8056,9573},{},{3637,5797,6591,6675},{2457,4525,5955,6943,7764,9945},{2360},{},{1799,8734,9609,9744,9745},{1609,2293,4498,4650,5913},{3144,9059},{1718,5650,9501},{2277},{4264,4777,5111,9047,9333,9605},{3874,4155,4686,5417,8428,9579},{},{2632,7961,9208,9602},{409,3842,7395,9622},{1976,2937,3318,4964,7092,7195},{2803,3275,7390,7574,7753,9997},{},{3237,6752,7337},{4129,5894,6527,6848,8360},{4945,5674},{1652,3132},{1746,7338},{},{2991,5235,7560},{3066,7676,8479,8541,8963,9323},{1506,3881,6095,6123,8196,9552},{3606,3680,5763,6304,8910},{4663,5088},{1610,6567,8011,8201,9786},{2454,3125,9329},{5087,5852,6722,9400,9869,9892},{2741,6044,7547,7997,8097,8227},{1898,6739,8003,8107,9720},{2646,6562,7901,9871,9998},{4070,4234,4991,6202,6668},{2910,3222,6204,6502,9966},{},{2269,2619,4517,8175,8241,9600},{3296,5553,6467,9014,9036},{8563,9230},{2733,9914},{4641},{8906,9638},{1946,5696,7187,7425,9092},{6220,7055,7986},{2720},{1915,4001,6735,7909,8024,8422},{2642,3254,3960},{},{1689,4854,5762,7392},{3779},{},{2182,4504},{},{2849,5162,7528},{5773,6096,6467},{3461,3741,7343,9195,9947},{6841,8813},{1629,2227,4168,9353},{1850,1912,3885,4706},{3890,4679,4715,5088,9437,9821},{1998,5545,6563,8248,8857,9648},{2643,4264,5732,5838},{1736,2369,3614,7229,8024},{6132,9690},{},{1462,5488,7101,8790},{4435,4840,5293,6955,9996},{},{3697,4151,4663,6066,6987,8742},{},{2714,7115},{6848},{1844,2347,4987,7601,8261},{2283,3801,4703,6783,6973,8762},{4948,6362,8438,9445},{8812},{},{},{1553,6704,8664},{2629,8162,8193,8470,9706},{7186},{5785,6945},{2141,3916,5171,8639,9203,9963},{1467,3735},{2978,3253,4626,6449,7712,8286},{},{2340},{1646,2135,2540,3477,4907,5890},{1577,4027,4330,6454,7654},{5010,9170},{2032,2326,4902},{2267,3665,7711,9464},{1630,3781,3979,6067,7223},{1841,2313,4385,6076,9940},{9826},{7255,8817,9912},{5193,7765,7982},{6608,8393},{1726,2200,4739,6230,7029,7901},{1595,4378,4799,6490,8217,9343},{2376,2807,4127},{2002,4215,6355,7409},{},{},{},{2781,4248,5235,5733,6708},{5120,5898},{1727,4553,5386},{2546,8642},{4032,4794,8224},{3685,4936,5929,9578},{1697,3476,5990,8174},{2034,6533,8165,8670},{5500,6212,9404},{2599,3165,3193,4598,5613,8001},{1560,5920,6168,7727,8583,9597},{3326,6749,9859},{2913,3375,3573,4640,5289,6332},{6588,7939},{2513,4823,6948,7104,8113,8327},{},{9368},{2510,3212,5127,7699,8177,8402},{2136,2569,4590,7361,9682},{2591,3156,3400,5057,5211,8111},{3854,5034,8502,8531,9656},{3900,7291,8095,8313},{9819},{3887,5654,5799,6491,9901},{4479,4525,4619,9740},{3077,3564,4476,8138,9725},{},{4675},{4313,5439,6106,6169,6661,7407},{2578,2699,8722,9641,9749,9996},{4868,5193,7851},{2495,3084,3835,4031,4347,4905},{2080,2104,3710,4201,6812,8729},{1661,4514,8174},{6009,7322,8304},{2214,3542,4865,7286,9217},{2162,2361,4751,6528,7796,9568},{3951,4328,4841,8651,9412},{1673,4055,5586,8315},{6355,6808,7089,7207,8200,9415},{2322,2887,4216,8995,9862,9881},{5732},{3420,3760,4956,5064,5923,8993},{4244,5261,5581,6586,6915,7133},{2690,7883,8929},{6758,7744},{3105,4397,6323,6329,9601},{},{},{3271,4066,7076,8159},{8519},{},{},{2241,2391,2893,3299,6837,7944},{},{4293,6340,8922},{6912},{4927},{8388},{1531,1739,5806,7354,8500},{1830,3681},{6252,9430},{2969,4943,5387,8572,9705},{1982},{2533,3146,6678,7676,7907,9368},{4630,5826,9992},{1999,5058,5564,6800,7658},{4041,6494,9231},{1785,2228,2980,8598,9429},{5622,6106,7481,8078},{2873,3262},{3166},{1675,2594,3639},{2431,5120,6265,7574,9852},{2667,4075,6295,9984},{2459,3225,9374},{2049,3023,3911,4084,8084,8115},{3377,3818,4818,6120,6212,6465},{3922,5868,7496},{9005},{},{4064,6018,6155,6230,9906},{1952,3930,7723,8623,8718},{4573,6074,6415},{3333,5274,7276,7600,7883,9570},{3905,7202,7974,8785},{5400,7137,7457},{3703,4073,5393,7450,9140,9610},{},{3166,5166,7024,8747,9491,9945},{2857},{3504,5832,6768,7202,9528},{1828,3043,4370,4962,8109,9056},{1742,3880,5164},{4985},{},{},{},{1990,3994,7511,8784},{2617},{},{2170,4865},{1943,5060,9478},{6253,6790,7571,8265,9867},{2090,7523,8779,8952},{2406},{2703,6697,8464},{2136,2962,4064,5879,6067,8595},{1650,5058},{1676,3223,4558},{4796,5695,5747,7346,7524,8917},{2561,5706},{},{3665,7003},{8412},{3758,4190,6627,9701},{2857,6197,6743,7827,8773,9854},{3172,6603,7892},{},{},{},{2175,3223,6879,8570},{3683,6295,7044},{},{6499,9593},{2169,3502,3957,6968,7208},{1957,3819,4288,6754,9614},{2936,4733,6282},{2524,3401,4091,5368,9102},{1621,4194,5534,8327,9672},{3036,3268},{2603,4072,4214,5441,8835,9412},{3172,7930,8832},{2973,8673,9210,9942,9991},{1982,5206},{4511},{3432,4851,5256,7824},{2819,9963},{1965,5320,6981,7976,8462},{},{4275,4618,7354},{},{},{2325,3499,5274},{1686},{5784,6234},{3136,4781,5513},{4050,5449,6044,8202},{},{1930},{5256,7167},{1863,2667,5092,5325,6349},{3458,4643,7096},{2264,4247,5489,5956},{1660,4034,8515},{2136,2901,3160,4851,5408,8709},{6103,9661,9975},{8710},{},{},{3110,3973,5224,7208,8944},{},{2058,5293,6282,8857},{2951,4380,4612,6581,8980,9177},{},{7952,8036},{8313},{},{2385,4426,5287,5822,8719,8874},{2480},{3984,4697,4896,5400,7467,7590},{2206,3769,5946,9336},{},{},{7279,7983},{1696,4326,4596,5592,6182,6687},{},{1801,3686,3845,6525},{1713,1917,5398,8914},{},{4814,5058,8147,8540},{4046,7394,8764},{},{224,5506,9942},{3614,4876,5578,7059,8662},{2987,6467,7596},{4993,5646,9334},{4166,4504,4826,5786,8036},{2102,2232,2742,4804,8394,9855},{2870,3539,4644,6192,6967,8532},{},{3407,3921,8880},{4073,4542,6205,9622},{2881,6973,7958},{3474,5966},{9266},{},{1888,2231,3994,8987},{4513,6918,7337},{5823,7566},{2378,4124,6764,8808},{7832},{1880,6151,6291,9442},{3803,5384,5418,5719,6891},{1906,3812,4620,8666,9909},{2225,5908,6921},{},{3491,4714,5905,9036},{6106,7734,8399,9412},{2967,3354,6867,7561,7767,8728},{3398,6167,7658},{3749,4146,6391,8254,9412,9524},{},{2217,3787,6083},{1854,2690,6050,6193},{3183,4914,8788},{2199,4163,6099,7510},{2632,2823,6975,8774,9681},{},{2303,2717,3990,4038,4118,6320},{2466,2856,5734,8281,8341,8821},{3032,5602,6261},{1726,5916},{1721,4207,4537,4717,7961,8235},{},{5394,6848,8895,9938},{4410,4596},{3394,6194,7120,7141,9613},{1918,2298,3200,6357,6508,9334},{2878,6876},{8771},{2546,3547,4811},{4576,6448,7101,7872,7922,9367},{3593,5701},{4560,8071,8235,9918},{},{2118,2431,3039,5252,5788,7804},{1968,4580,7731,8636,9026,9341},{8677},{},{2363,8146},{1808,2429,4275,4544,5104,6516},{3991,5276,6794,7744,9029,9428},{5029,8844},{},{1866,2211,5406,5447,5644,5852},{2630,4227,6519,8427,9367},{3368},{2634,2763,3263,3355,4440},{9243},{3003,4414,5437,7067,9939},{1825,3810,5721,9282},{5335,6557},{6362,6610},{2061},{5338,6060,6595},{3449,4479,7720,8049,8848,9695},{7992},{6663},{5704,7610,9770},{2387,3752,4229,5888,7844,9771},{1791},{8626},{8874},{3489,5417,6139,8121,8758},{2538,4196,5436},{},{},{2339,6230},{1985,6584,6687,7401,9978},{1958,3778,5068},{3680,4192,5538,6284,9127},{5383,5551,9130},{4098,4670,5959,6743,9061},{4959,5721,5724,8585,9703},{4646},{8141,8448},{6757},{3848,4767,5990,6053,8703},{},{},{},{3415,8476},{3654,3897,8681},{3200,4601,8101,9246},{1844,2817,4266,4565},{3331,5199,5867,6166,7162,7770},{4608},{4885,5215,7524,7872,9948},{5118},{3228,5849,6179,6268,7621,9476},{2235},{4279},{},{3912,7729,9328,9746},{},{3973},{},{4114,7714},{1837,2145,5826,5963,7060,8868},{2540},{2281,7903,9083},{2961,9913},{},{3895,4892,5400,6550,8371,8956},{1879,2746,2874,3695,8868,9166},{6358},{8545},{},{2268,6640,8170,8173,9354},{2274,5160,7715,7932},{2524,6710,8064,8237},{4380,8394},{2969,5902,6437,6979,9405},{3118,3623,4337},{4993,8329,8354,8632,9158,9831},{3619,3752,4640,5961,7303},{4062,4653},{2038,3833,5166,6128,8083,8515},{2097,3360,4190,6409,8926},{},{5598,8950,9178,9327,9941},{},{4760,6549,7184,9234,9369},{6582,7677,9476},{},{7974},{3327,7494,8622,8787},{3823,7692,8109,8114,8200,9288},{6522,6605,7743,9252},{1975,6823,7837,7848,9313},{4654,6285,6984},{},{4615,4844,8843,9327},{4005,6921},{1929,6720},{4307,5264,7374},{2647,3940,4193,5318,5820},{4604,5999,7369},{3007,4952,7583,9078,9155},{2164},{3807},{1977,2717,6619,7045,7796},{},{3432},{2049,3819,9413},{2883,3666,5927,6796,7799,7915},{3653,4882,5024,5321,5939,9837},{4774,5380,6384,6573,9277,9300},{4598,6403,7337,7596,8095,8892},{5876,5927,7387,7858,9304},{},{4545,8877},{8904},{},{2075,3172,4890,7573,9249},{2723,6013,7033,7131,8448},{2447,2484,6609},{2889,4115,4712,4857,6595},{2555,4834,5316,5986,7605},{1893,2255,5450,5545,8701,8852},{},{4284,5733,8012,8128,8269,9444},{571,2628,3886,6928,8227},{5446},{},{2601,2656,7374,8090,9302},{2909,4816,7591,8883,9904},{},{2526,4353,6890,9829,9870},{7282,8929,9057},{5332},{1893,2128,7420,8080,9637},{1878,3819,4992,9314},{9387,9393},{4724,5484,8796,9535,9696},{6677,8667},{5917,6268,7489,8170,9393},{},{3272,3361,5301,8439,8531},{3248,3982,7878,8506},{2219,3440,7565,8593},{5058},{2331,7458},{2929,3089,5031,7760},{3665,4432,6106,8729,9896},{2414,4141,7185,7519,9269},{2286,6356,9164,9451},{4947},{7137,8929},{2398,4099,4141,6535},{3167,8404,9607},{2388,2409,7499},{2923,4753,8352,9972},{2925},{2662,5442,6168,9871},{6790},{},{2316},{2262,4087,7602},{8934,9184,9394},{3702,6711,8468,9465},{3726,6424,7873},{},{2453,2494,5909,6313,7909,9160},{3427,5819,5841,6806,9171},{4147,6242,7433},{4499,6185},{5558},{6691,7683,8947},{2222,2362,3428,3434,4710,9527},{2636,2735,5454},{1970,4308,4526,5321,6171,7567},{2183,3006,4688,7499},{3459,4502,4887,6182,8400,9251},{4391,5944},{},{2871,5190,6871,7024,7448,8095},{7105,7383,7967,8341,8843},{3378,4035,4310,7395,8175,9878},{2714,8166},{2791,4097,6160,8693,9612},{7601,9478},{4663,6185,6693,8214,9333},{5060,5285,6033,6105,7869},{5344,6350,6975,7092,9622,9662},{},{2994,4605,8974},{2830},{1941,6323,7555},{3080},{2603,4790,5185,8598,9610},{4018,9544},{2074,2233,2700,4699,7013,9079},{2528,2934,7732,8603},{3017,3202,3653,6601,6909,9824},{2838,3571,4077},{3683,6387,8930},{2801,5531,6133,7319,8369,9194},{4898},{4180,4812},{4169,8630,8669},{5135,5559,6061,9776},{4220,6232,7485},{2154,6172,8517,8579,9190,9577},{2242,2879,3279,3308,4322,9865},{4680,5297,6580,7372},{6862,6936},{2508,3177,5533,5678,8401,9705},{2914},{3295,4745,4819,4912,6996,8731},{2787,7107,7587,7691},{6255,8555,9812},{3316,3871,4947,5708,7020},{2783},{},{7264,7824},{4801},{8308},{4493,5244,6888},{3171,4597,7817,8873},{4812,7237},{4152,4474},{2662,3061,7071,9919},{3852,4032,4869,6963,7264,7898},{2235,3522,5924,7132,8266,8797},{7388,9600},{4786,9727},{2449,7213,7509,7802},{7133,8041},{4308,5743,7025,7270},{2337,3397,4290,9917},{6162,7517},{2314,4149},{3160,3996,9526},{8,2797,7427},{3004,5445,6260,6566},{3855,8043,9933},{7282,8807},{2880,4332,4717,5817},{2178,4938,5556,9801},{2981,3448,5356,5533,8630},{7284},{4165,7140,8707,9390},{},{4792,9791},{3189,5006,6315,8555},{4623,7953},{3321,8739,8942},{3663,5077,6590,9497},{3728,5358},{},{},{8849},{4962,6049,8563,9104,9855},{5831,6114,6786,7303,8649},{4442},{5578,8893},{8104},{2183,3789,4599,5147,8530,9767},{6769},{4702,6021,6443,6548,7291,7400},{4036,7503,8783,9019,9167},{4105,4634,6669,7376,7885,8510},{5945,6636,7702,9535},{6604},{6340,8612},{3419},{5225,7249},{6014,6222,6518,7341,7361,8917},{2034},{2248,6890,7483},{2298,4633,7279,9018},{3626,3753,7422,8896,9083},{2707,3747,4238,5973,8281,9495},{6268,8992},{2057,2435,5973},{},{3397,3419,3644,5847,7106,9521},{},{94,3581,5130,5959,7507,8356},{9611},{2404,3973,5866,6953,7825,8062},{2409,2988,4157,5777,8612},{3891},{2873,3572,6443,8456},{},{3734,7207,9210},{3326,5628},{3314,7417,7522},{2018,3586,5107,6267,6944,9997},{2633,3204,4564,5507,8398},{5414,7668,8585},{7853},{2113,3376,7532,8037,8970},{4243,6248,6740,8042},{},{4739,6079,6493,7018,8784},{2749,2930,3309,4111,5461,6912},{3180,4819,6032,6292,6404},{2155,3907,5127,7503,8834},{},{3005},{3773,6768,8204,8515},{3209,7784},{3082},{},{4719},{7004},{4153,8686},{3580,3838,6223,7089},{7194},{3925,6704,8419,9716},{2198,3325,6141,6803},{8220},{2078,3064,3775,5956,8742},{2361,3955,5625,7335,7931},{},{2804,4400,4767},{2658,2726,3327,4412,5919,7104},{2685,6647},{3461,4956},{6495,6625,7276,7877,8261,9739},{4026,5169,5897,7433,8594},{2588,3849,4117},{9169},{},{5780},{4934,7019},{2350,5201,9170,9996},{7480},{},{2218,4003,8109},{4385,4830,6818},{},{2540},{3811,5833},{},{3383,6891,9591},{6438,7957,8712,9708},{2197,2487,4955,8266},{2613,4554,6561},{2752,4074,5335,8554},{8058},{8423},{2653,2737,4697,6073,7958,9236},{2382,3006,5923,5941,7253,8918},{7267,8219,8232,8518},{},{2465,2487,4903,5673,6833,8914},{4315,6163,7516,9113,9225,9283},{8722,8797},{3855,6157,6926,7131,7699,7814},{},{3210,6552,7135},{3749,9685},{4367,4434,5108,7943,9544,9668},{2646,7266,8101,9988},{4372,4884,5083,5924,7447},{4277,7075},{3515,4031,4791,5455,9866,9908},{2753,2837,3129,7538},{6254},{3219,3580,4666,7456,9191},{},{},{2817,7639,9988},{},{},{},{7044,8153,9654},{4200,6373,6623,7102},{3550,8837},{4545,6326},{},{4338},{3272,6370,6414,9288,9488},{6189,9524},{3064,7590,7861,9217},{3295,4232,5026,7021,8289,9495},{2377,3522,4407,9814},{3724,4461,4614,5236,9839},{2871,9634},{2332,3204,4308,6181,7599,9262},{8782,9795},{},{3378,3891,4475,7444,8627,9633},{2450,2888,8650,8949},{5031,6649,8187},{},{5194,5485,5721,6107,7801},{3254,3541,5040,5276,9591},{},{2726,9660,9957},{},{2243,4622,9310},{5024,7779},{6823},{3420,4489,5078,6955,8188},{2682,2865,3454,4917,9657},{3472},{2802,2808,4553},{2788,6448,8196,8451,9209},{4025,7331},{},{7870,9147},{7465},{3248,4383,5040,9261,9751},{3100,5103,5864,6334,6572,7549},{},{3526,4579,6822},{2629,3244,3370,7605},{4011,4778,5170},{4989},{5054,5415,9153},{7840},{4409,5456,5461},{6025,6677,6914,7236,8012},{8713},{},{6189},{2411,4372,4758,6149,6688,9524},{3375,4001,6484},{6505,7883},{5213,5645,6657},{6893,8658,9707,9984},{3767,4947,7199,7426},{7878,8617,8938},{4049,4303,5096,6095,7217,8525},{2580,2587,2700,7021,7713,9477},{2547,2997,3012,7850,8224},{2219,3501,4902,6017,6747,8048},{},{2940},{6492},{},{5020,6825,9306},{4045,7375,8836,9098},{2996,4285,7475,8053,8438},{4383,4554,5107,6079,6764,8611},{4622,4956,7830},{},{3901,4402,7127,8125,8571,8985},{2298,3515},{},{5676,7587,8892},{6074},{2383,2971,7366},{3178,6244,8779},{4406,6044,7481,9169},{4379,5547,6482,7599,8988},{3707,6092,8092,8633,9365},{},{},{2629,9203},{2836},{7823},{2208,2807,4523,5884,7409,7753},{2985,6037,7510,8007},{6268,9969},{3488,3499,3607,8165},{4791,9387},{2881,8530,8841},{2750,3410,4009,5472},{3325,5514,5734,6524,9757},{2317,3351,7341,9145,9542},{2223,7307,7447,9193},{2212,3543,3850,5371,5650,6198},{7363},{3842,7768,8078,9617},{},{2560,4086,4459,4610,8425},{9575,9754},{},{2334,3756,6635,8131,8224,9937},{2497,3709,4514,4936,7070,9316},{3287,6289,8893},{4297},{2253,2499,2692,3951,6838,6842},{3567,7136,9152},{9514},{3322,4561,8387},{6278},{6192},{2290,3256,3568,3656,6162,8689},{2851,3346,3971,6088,6534},{4967,6892,7846,8521},{2303,3324,3785,6124,6925,9691},{2739,2994,3216,4755,7688,9423},{4908,5245,6655,8128,9370,9994},{3691,8010},{2676,2996,4441,5884,6113},{4832,4910,6293,7677},{3449,3884,4299,4739},{},{3166,8733},{4690,6490,6513,7346,7606,7766},{5207,5861,6045},{},{3404,4828,6230,9498,9866},{},{4856,5368,5905,6319,8510},{6604},{6729,6922,7293,7643,8485,9229},{3212,6582,7790},{},{3827,6993,8639,8897},{6790,7107,9376,9802},{4599,6437,8992,9539,9889,9891},{},{},{6116,8719,9867},{3056,3614,8784,9337},{2925,8427},{2391,3820,6291},{2315,4500,5597,7604},{},{9884},{4730,5401,7581},{},{5691},{3435,5995,9957},{3027,4416,9392},{9881},{3005,3159,7473,8200,9046,9322},{},{},{2281,4229,4532,5508,7319,9319},{2905,6428,6972},{3726,3994,5017,6816,9241,9735},{4378,5252,5584},{4393,4441,8597,9596},{},{2518,9081},{2698,5001,5925},{3924,4405,5254,6678,7885},{4780,7294,7480},{3224,3683,4680,5906,5925,7510},{2488,4398,9549},{2539,3404,7025,7529,8890,9151},{4001,8980},{3596,5284,5532,5999},{3074,3482,5243,5549,6775,8077},{6694,7915},{2893,4129,6273,6494},{5347,8082},{4230,4904,7167,8972},{7948},{6332,8078,9009,9636},{2721,4436,4826,5395,6950,7551},{},{2688,7901},{4891},{4986,5549,7997,8126,8571,9027},{7303,9610},{4540,6167,8319,9158},{8390,9118,9214},{3645,6878,7269,8330,8743,9400},{3094,3216},{5050,5242,7761},{6265,6579,8028,8609,9356},{},{7249},{4240,4755,6338},{2883,5040,6457,7765},{8425,8468,9052,9444},{},{2699,3198,5767,7590,8127},{},{2560,3744,4000,6136,7596,8779},{7707},{6287},{8153,9061,9080,9754,9979},{9406},{6305},{9279,9669},{},{9019},{3677,4593,6523,8786},{3741,3823,5501,6776,6908,7464},{2498,4122,6996,8881,9372},{3589,7955,8993,9029,9163,9847},{2638,5992,9491},{4105,4911,4916,5768,9332},{3691,5720},{2384,3478,4710,8386,8785,9395},{},{5833},{2750,2843,4764,6301,6831,7558},{3477,4044,5559,8623,8734},{5703},{2477,4201,5349,5793,6507,8263},{},{3756,5960,7213,7621,7717},{5466,6001,8740,9336},{4059,6731,9553},{3328,6457,7631,7903},{3034,7486,8256,8606,9410},{4143,4442,6337},{3879,8926,9155,9323,9576},{3890,5407,5806},{2478,2711,3404,3638,7990,8357},{3150,4701},{3826,4436,6226,6525},{3244,6859,7030},{5992,6574,7442,9670},{7644,8721,9585},{2108,2778,5796,6505,8393,8771},{7206,8648},{3054,6218,6450,8209,8214,9507},{2517,2584,5666,5865,7954,9877},{4828},{5342},{5626,5637,6529,7801,9822},{3751,5619},{3305,4045,5065,5817,6730,8979},{6024,7019,9404},{2591,5085,7508,8987},{3129,4764,5690,9245,9347},{4042,5828,6290,8069},{},{3363,4117,4190},{2776,9931},{3489,6020,6021},{3727,6943,9384},{7888,8205},{},{3714,3813,4570,5767,8779},{},{5494,6140,7609,8919},{4825,4955},{7120,7585,8354},{},{2415,5478,6091,9402},{2889,4934,5245,5642,7272,7786},{5549},{4089},{5709,6461,6546,6976,7243,7804},{5317,5717,6626},{5807,6357,9150},{8312},{2599,3865,4264,8898,9424},{2441,4205,6377,6772,9869},{},{7978,8704,9783},{9972},{3094},{2584,3375,5397},{},{4203,4596,5283,7889},{},{4572,8343,9279,9310},{3037,3737,4356,4454,4516,5482},{7583,8561},{2965,9663},{4692,4766,9264},{4952,5724,6362,9411},{3169,4987,7442},{2448,4810,5757},{4376},{2647,7380},{5446,6093,7107},{2806,3476,6391,6766,6851,9813},{3186},{6195,7664},{3249,4844,5912,6478,8116},{3377,4428,6238,9360},{3783,5777,7193,7726,8583,8659},{2505,3200,4498},{2974,3322,3363,4090,4574,5065},{5766,9043},{3188,3768,4404,5492,5805,7535},{2781},{2957,6057,7087,9411,9798,9892},{5554,5865,6209,8830,9152,9496},{2637,4247,6307,6651,8646,9323},{2835,2863,6732,9379},{3457,8759,9023},{},{2927,4037,6296,6520,8405,9809},{3285,3797,8376,8481},{4318},{2763,4122,4255,7313,8167,9195},{},{6816,8523,9554},{6740},{2533,3010,4852,5610,6536,9490},{1804,2424,2842,4798,6157},{2794,2885,7804,8721,8996,9643},{},{},{3035,3185,3257,6726,8073,8178},{9375},{3003,5838},{},{2871,4268,6425},{9438},{4459,6108,6234},{2507,2570,2892,4926,7234,8551},{3631,6090,6839,7268,7460,8941},{3689,8080},{5072,9390},{3551,5116},{3005},{2688,4126,4957,6786,6888},{},{9029,9480},{2717,6436,6632},{5637,6696,6896,9547,9986},{6594,6822,8463},{3106,3551,3958,4986,5552,8409},{3048,4814,6896,7915,7921,9201},{4143,4336,4774,5560,6484,7794},{5428},{},{7930},{3603,4177,4868,6761,9293,9778},{},{3403,6262,6466,7302,7327,7934},{3116,7302,7308,8526,8639},{4847,6715,7999,8138,9045,9433},{2482,2552,4098,8800},{},{8500},{2522,3695,4088},{2598,5637,7890,9077},{4753,7446,7725,9030},{},{7350,8930,9616},{3179,4709,6183,7036,7136,8318},{2800,5786,9258},{3951,8125,8607,9124},{5577,7760,8334,8759},{},{5773,6489,9590},{5557},{},{6594,6909,7192,8092},{9317,9772},{2516,4470,4955,5481,8804,9119},{6453,8509},{3790,5121,6286,6306,6912,8848},{3278,6869},{6337,9434},{6990},{3366,3739,5796,7278,8647},{2825,3702,3862,8730,9419},{6858,8025,8176,8306,9305},{5323,6191},{6490},{},{4521,8372,8853},{5695,5759,7913,8786,8853,9313},{5403},{},{3126,5370,7452,8211},{4199,5202,6333,6651,7215},{8601},{8725},{7453,7940,8163,9660,9709},{},{2910,3594,5155,5554,6438},{3876,4672,5835,7288,8617,9597},{3492,3558,4527,9371},{3046,5578,5631},{3967,4691,5533,6457,7555,9019},{8125},{3015,5389,6884,8654},{7396,9702},{2618,9795},{3963,7373},{2712},{4160,4499,4809,6535,9303,9313},{2725,3568,4694,5390,8196,9018},{},{2823,5866,6387},{4227},{},{8258,8704,9804},{9399},{7891,9507},{},{3642,4229,4625,6103,6945,9633},{2535,4625,5358,7475,8831,9067},{6605,8675},{5673,5864,7790,9751},{2731,2853,6185,9120},{8912},{3316,3355,5017,8877},{2742,4565,5139,5197,7740,8999},{3212,3448,4882,6839,6950},{2615,3369,3609,4045},{},{3415,5099,5131},{5591},{3887,4385,4876,9138,9870},{7443,8229},{3214,3636,3809,6774,7080,7857},{3390,7130,7392,9891},{4036,5728,7794,8297,8454,9128},{3880,4225},{2571,2912,6386,6991},{7146},{5577,6618,8926,9520},{2725,3158,3399,7674,9161},{8016},{},{5908,7363,7884,9945},{7244,7588},{2994,3195,3773,4036,6529},{2654,2664,4020,4252,5605,7792},{},{2614,4852,8074,8163,9215,9393},{6599,7842,9728},{5017,5804,6981},{4786,5671,6620},{},{6264,6514,6539,7441},{5275,6740,7168,7252,8042},{},{4239,4706,5404,6959,8688},{6373,6815},{4477,5291,6843,9612,9781},{3667,4278,5348,7207,9819},{},{},{4059},{7134,7156},{},{2794,4720,7923,8857,9367},{3209},{3169},{4231,5100,5199,5444,6588,8076},{8381},{6579,9494},{5967},{3358,5341},{8060},{2791,5567,6908,7726},{7624},{4577,5947,6074,6849,9406},{2769,5327,6295,9234},{5642,7899},{5394},{3958,5360,5527,7303,8101,9010},{6897,7675,8362},{},{4564,8670},{6362,6493,7021,7806,8220,8598},{2696,8970},{},{6889},{4340,5527,6176,9088},{5070,6428,9393},{},{4384,4501,6697,7099},{6345,8069,8478},{2977,8761},{2593,5918,5991,7176,7309},{},{4425,7707},{7821,8977},{5023,7458,7541},{4260},{3301,4762,6108},{3852,6440,8992},{2957,6823,7449,9582},{6097,7463},{},{2623,2897,4498,5014,6038,7699},{3092,3553,4271,8604},{4171,7335,8087},{6754},{3061,3242,3949,6485,6952,9578},{},{},{5560,6188,7258,8277},{5418},{2738,6968,8764,9424},{2843,5618},{5640,6287},{3991,5658,7175},{4547,5634,7261,7669,7709},{4337},{7187,7232,9415},{3853},{3509,7289,7295},{3191,4814,5435,8165},{4020,7742,9691},{3468},{},{4515,7766,8899},{},{5406,6871,7050,7589},{2773,3908,5548,6544},{3645,7027,7626,8975},{7330},{3432,4598,5215,5445,6725,9553},{4124,5252,9037},{3428,3524,5686,9515,9519,9696},{5564,7828,9181},{5812,7391,7412,7706,9075,9372},{},{},{},{3017,5498,6420,6493,8381,8703},{3020,6606,8046,8108,8243},{},{5568},{6524},{4996,8738},{3163,3227,3778,6197,8757},{3901,6330,6663,7347,9183,9987},{3042,6781,7904,9907},{5145},{7532},{4079,4214,4706,5579,7124},{3787,5365,9017},{2737,3711,4797,5094,8619},{3958,7331,8024},{3725,3845,4636,5321,5800},{2733,5321,6978},{2906,3824,4434,6143,8489},{},{6537,8668},{7148,7285,7699,8083,9118},{5779,6898,7033,8613},{3416,6483,7993,8096,8299,8534},{4145,6744,9979},{8138,9192},{7751,7846,7997,8135,8722},{5461,7339,8161},{4519},{3446,5752,8128,8377},{5099,6067,6805,7920,8741},{3319,3801,3808,5933,7912,9203},{7173,8167},{2778,4429,4666,4881},{},{2866,5452,6939},{},{3282,3753,6397,9257},{4022,4727,7521,8610,9077},{5380,7023,9144},{3937,7205,9319},{2686,4091,4738,4779,5515,5831},{7316},{3316},{4598,5265,5577,5827,7789,9889},{5314,5418},{5014,7093,7626,7779,8285},{7092},{4022,7520,9391,9556,9688},{2930,5577},{2983,5662,7910,8058,9969},{2758,3152,5956,8705},{},{4694,4784,5328},{6370},{4771,9387},{5038,5248,6217,7806,8617,9914},{3785},{6215,7665},{8426,9299},{3042,5893,6340,7113,8676},{3997,7954,8385,8483,8557},{2778},{6844},{2785,4712,9538,9553},{6438,7482},{3246,9681},{2840,4869,6845},{1202,4157,5365,6203,9017},{},{3697,7148,7424,9017,9637},{3768,4436,8285},{2762,4289,5047,5223,5882,8031},{4902,5467,6952,8121,9154},{5266,8242,8983},{6077,7033,9244},{2712,4716,5208,5982,7056,9881},{2779,5595,5901},{3836,4629,4981,6619,7001,8492},{6694,8021,8257,8710},{2927,4329,4628,7096},{7727},{2827,6455},{6609,6785,8913},{3337,4766,6565},{3356,5160},{3138,3933,6468,7477,7895},{8448},{3910,5645,7875,8162},{3743,4847,5228,5539,6174,9063},{3353,4470,5131,5611},{5305,7312},{5315,7340,8556},{},{},{2369,6547,9177},{5456,6023,6524,9115},{3186,5768,7528},{4716,4991},{2938,3368,3791,6781,6874,9556},{3842,6501,7538,7545},{},{3482,3880,4397,7471},{},{3617,4247,4687,5144,6590,7397},{4663,6442},{8039,8340},{5610,6236,7699,8103,9919},{4829,5088,9306},{4753,7557,8682},{5552},{9601},{},{3868,6686,9011,9455},{3766,5618,6072,6241,7710},{6820,9879},{3383,3434},{5397,8848},{},{3103,9386},{},{},{4221,5207,6219,7012,8711,8790},{6764,8753,8847},{},{9946},{4045,4317,7832,8149,8633,8838},{},{4041,5085,8269,8388,8600},{},{3732,6786},{3982,5351,8038},{9302},{3316,5833},{3467,5933,7924,7942,9230,9554},{9599},{},{3849,4733,6254,7098},{8694},{4477,5001,5605,6757,7558,7878},{},{5841,5854,7079,8742,8871,9352},{4118,9559},{4948,5202,5297,5833,7928,9938},{5816,9673},{7089,7622},{5095,8100,9284},{3230,4489,6111,6410,6858},{3490,5109,9101},{3756,4392,6851},{3982,4237,6356,7051,7374,9401},{},{4355,5136,7769,9326},{6841,8185},{6304,7947,8829},{3934,5475,7329},{6733},{3782,4952,5685,7167,8815,9594},{3874,5281,7174},{4869,5170,5598,8305,8424},{4052,5479,6331,7086,7688,9438},{4449,6963,7646,7692},{},{},{3100,6554,7039,9111,9190},{6224,8963,8974,9799},{1522,3100,4484},{4846,5365},{5045,6236,6726,8524},{5951,6713,8363,9257,9584},{3849,4564,5732,7548,8792},{4477,5156,5974,6439,7033},{},{9138,9947},{3909,7843},{4135,5543,8989},{4102,6140,7319,7334,9798,9800},{5973,8348,8513,8722},{4025,7957,9990},{4291,4802,8631},{3747,8985},{7067,9925},{9028},{3472,4464,4985,6204,6552,7171},{2849,3420,3552,3563,4874,8156},{4470,6025,8961,9015},{9784},{3792,8888,9887},{7224},{5459,8625},{3382,5872,7536,8511},{3983},{4604,9867},{7137,7529,7685},{},{3194,3714,5905,7780},{3327,3815,4821,6619,9645},{5898,6351,6851,7209},{},{4183},{4710,8880,9367},{3739,6183,8623},{},{},{},{3106,4580,5194,5707,7013,8522},{3355,5357},{8288},{8226,8309},{8509},{3670,5360},{4303,4981,7656},{4554,5535,6421,8588},{},{3847,8030,8318},{6203,6777},{2863,3914,8183,8821},{4638,7361,7922},{},{2905,3658,4858,5145,9637},{},{3950,5421,5492,5831,6450},{3412,5947,8265,9234},{4564,4655,7585},{3067,3203,3379,6355,6687,7848},{4062,5850,6394,6865,9459},{6857,8666,9654},{3630,4690,5031,5590,6637,7893},{},{7183,8955},{3224,4507,5451,7964,8337},{5044,5049,6436,6929,7854,9938},{5207,6777,6985,7795,8783},{4681,4912,4965,6010},{4750,8104},{4785,6444,8442},{2934,6621},{3719,6399,7596,9883},{5809,7080,7921},{3309,5722},{5430,7240,8393,8412},{5088},{6049},{3088,3412,3710,4495,7177,7647},{4115,7340,8951,9867},{24,2990,7981,8000,9513,9786},{3053},{4269,6632,7954},{3844,4051,6168,6291},{3409,3584,4745,5063,9065,9095},{},{4200,4641,4702,4747,4825,6637},{4730,6045,6282,7648,8182,8571},{3429,3805},{5825},{6569,8232},{4288,4632,5148,5747,7808,9547},{5181},{},{4632,5316,7143,8386,8937},{8804},{},{3898,4261},{8316,8880},{3750,4297,6695,8671,8682},{3334,4088,4969,5019,8619,8733},{},{2996,4390,4939,9819},{6224,9836},{5777,5872,7481},{4263,4660,7807},{3683,4649,4763,5984,6287,9936},{2928,6772,7605,8003,8015,8597},{3759,7135,7231,8428,8437,9601},{},{},{3111,3937,4993,6579,7847},{5258,5716,5997,6189,9806},{},{5235,7217,8182},{},{9613},{5651},{5132,5260,7667,8225,9173},{5364,6597,9570},{4365,5513,9328},{},{3821},{5580,6083},{6768,8978},{7160},{9324},{4097,5028,7499,7661,9141,9737},{5910},{8770},{4559,4833,5864,6888},{},{3597},{5776,6819,8021,8370},{3798,4450,5140,5939,9129},{},{},{3031,4199,4605,7677,7983},{3041,4141,7885,8598,9042,9418},{7262,7918,8585},{6489,8045},{},{3459,9885},{3362,3897,4397,5328,9402,9711},{4753,5360,5604,7883,8252,9190},{4683,7791,9373},{4349,6716,7101,8194,8253,9228},{3089,6557,7304,7335,7974},{4041,5067,6701,7148,9185,9756},{5404,5836,6010},{3096,8494,8943,9043,9679},{9604},{3073},{5052,7408,8511},{7724,9476},{3555,7378},{},{3374,6060,7941,8506},{3304,3620,6662,7457,9032,9975},{6396},{4414,8175},{5677,7018,8890},{4458,7525,7670},{5254,7824,9407},{3035,3708,4995,5961,9838},{4736,6357,7781,8261,9148,9334},{},{6293,8647,9207},{5807,6761,7823},{5600,6330,6664,7225},{3736,5713,6300,7476,9497,9818},{3578,4528,5195,8570},{3920,4281,8111},{5999,6921,7798,8196},{5482,5527,6832,9363,9489,9654},{5097,6045,6902},{5010,7597,7746,9279},{3229,3929,5904,7549},{7108},{3986,6398},{6940},{},{4823,5534,6788,9238},{4073,4365,6830,7109,9402},{6948,7834,8141,8612,8996},{4432,6212,8264,9603},{5309,7694},{},{},{3847,4538,4748,4954,5306,9302},{4848},{4748,9327},{9604},{},{5809,6457,7279,7745,8473,9955},{4286},{6160,6573,7375,9026,9433},{},{4634,5019,5674,8658},{5620,6063,6962},{3370,3603,7592,7999,8557,8937},{4813},{},{3819,8010,9234},{4042,6321,6868,7360,8300},{5422,9953},{5913,6212},{4602,6064,6227,7682,7737},{3384,6001,8432},{4728,4743,4787,5272,7337},{3183},{4638,8794},{6800,7682,8412,8681,9423},{},{4226,4273,4708,6116,9915},{7796,9922},{5053,7081},{4414,4986,7231,8121,9623},{3763,7337,7602,8302,9153},{3644,4931,5174,5717,6944},{3023,3245,3805,7748,9022,9677},{6217,9063},{5035},{4486,5569,8029,9206,9506},{4593,5442},{5901,6235,7770,9856},{},{3799,3957,4246},{},{},{3164,6186,9443},{4857,5469,6648,7367,9245},{4731,5671},{3293,3897,5081,6441,8590},{},{4287,4344,5239,6663,8904},{3099,3417,5600,6502},{3478,3949,5303,5786,6374,6732},{4000,6190,9109},{4056,4475,4968,6245,9788},{4160,4789,5600,5690,5698},{387,8976},{4859,8034},{4861},{4809,5051,5467,6656,6872},{5930,6349,7479,7480,7765,9404},{5231,5829,7115,7116,7274,8281},{4960},{4975,6722},{4594,4713,6723,7103},{4174,6458,6880,9961},{9438},{3617,3927,4648,4704,6005,8762},{5255},{6140,6223,6417,7004,9709},{3782},{3143,5269,5472,7469,7925,8996},{6092,6652,9941},{4570,5896,6571,6650},{4176,5077,5311,6368,6691,6817},{3719,6616,6675,9967},{3717,4142,4197,5908,9698,9778},{3309,3587,3655,4943},{4610,7467,7871,9067},{},{},{3680,4484,4729,8197,9065,9281},{},{3836,5034},{3619,4188,5898,7700,9513},{8418},{3587,7479},{6659,7872},{},{3970,9474,9673},{3836,4454,5740,7976,8459,9220},{5926,5989,9668},{3389,8997},{3334,5858,6601,6681,7867,8672},{8391},{3802,3971,5916,6642,9994},{3271,5101,5378,8024,8587,9718},{3089,3663,7975,9737},{6803,8038},{3086,3459,5146,8699,9507,9771},{4155,7604,7859},{3278,3411,5523,7281},{8001},{5093,5362,8552},{4334,6189,7586,7685},{5141},{3500,4227,4614,6181,6725,8160},{8094},{3346,9019},{5208,7156,7969,9500},{},{4732,5805},{3589},{6313,7155},{},{8121},{3504,6777,6834,7913,8991,9193},{3571,4983,5107,8170,8911,9638},{7505},{1209,4499,5535,6180,6419,7047,9926},{4626},{5436,5637,6045,6929,7902,9009},{3408,4502,4819,7348,9014},{5796,5878,9176},{4798},{},{3201,3455,3933,8027,9201},{},{3477,3982,5585,8544},{4006,4580,4775,7862,9300},{4292,4605,4613,7497,9807},{3125,3937,4492,8250,9743},{3944,4764,8939},{7330,7966},{3847,9100,9727},{4873,4981,5227,6883,7213},{9502},{6758,7871,8568},{4622},{3497,3760,4378,6394,7807,8337},{4380,5093},{3283,5187,6951,7900},{5119},{5593,7407,8295,8624,9753},{},{6383,6775,6958},{947,4395},{8295,9005,9260,9366},{7800},{3167,3969,5417,7661,8988,9770},{2639,7372,8692},{6059,6174,6848},{},{4430,8716},{6598},{4677,5445,5976,7775,7898,8907},{7917},{},{4609,5593,5876,7320},{5083,5235,6831,8396,8892,9087},{},{},{4586,6359,6873,8461},{4548,5723,5882,9668,9962},{5347,7354},{3715,6672,9906},{7267,7913,8599},{},{3843,8426,8708,9506},{3313,4513,6044},{4577,6132,8920},{3553,8266},{7322,9927},{},{3969,5094,7626,9368},{3564,5009,6652,8683},{5050,7443,7818,8663,9859},{1475,3536,6249},{3834,5494},{},{},{6769,7579,7653,8427,8550,9844},{4257,4408,4984,5019,9324},{6307,6384,7243,8131,8464},{3685,6917,8668,9986},{3289,3642,4706,5363,5596,6038},{4989,5450,5453,5781,8791},{3501},{},{4310,6585,6815,7298,7377,7582},{4049,4071,6840,7091,8710,9881},{5711,5811,6123,6187,7162},{},{6041,8068},{},{3868,4701,7229,7754,9052},{6961,7515,7901,9702},{4454,4605,6364,7079},{8249,9060},{3315,7672,8545,9332},{9724,9837},{8935,9513},{6377,8505},{},{3672,5604,7057},{4480,4542,6163,6486,8058,9492},{3676,5102,5389,7350,7766},{3942,5426,6974,7476,9823},{5231,5712,7148,7420,9917},{3683,4048,4078,7036},{4164,4747,5919,6263},{7690},{9600},{3326,3410,4274,4899,5231,9193},{5910,8516,8689},{7399},{4220,8626},{3228,6596,7168,8179,8235,8597},{5224,6351,7495,7809,8660},{3384,3836,5483,7079,9143,9490},{},{3441,6195},{3661,4020,4475,7915,8211},{4008,5315,7304},{3943,7777},{5970},{7053},{6700,7850},{4631,5854,9106,9308,9765,9823},{4231},{9658},{7757,8230},{8162},{4239,7888},{6930},{5906,6898,9453,9531},{9439},{3243,5587,8512},{3939,5295,7561},{},{5307,6067,6753,8931},{6651,7607},{8626,9289},{},{3414,3987,4762,5861,6525,8307},{3677,4394,6771,7952,9133},{4760,6743},{4520,4896,5406},{4003,4555,9690},{8892},{5178,6571},{8987,9536},{7206,9771},{6686,9744},{5052,7309},{6234,8403,8506,8620,8654,9138},{557,3946,8530,9675},{5546,5629,6866},{5110,7860},{},{3844,6365,6762},{},{4646},{7471},{6287},{3780,5715,6725,8877},{7048},{4593,8953,9990},{4212,5979,8179},{3625,3933,4057,4396,6766,9890},{4664,8926,8962,9281,9756,9869},{5040,9214,9707},{5661,7792,8078},{5187,7350,8575},{8553},{6256,6792,8380,9116},{3767,4021},{7398,8050,8516},{4670,9101,9394},{},{7829},{9573},{4874,6561,9808},{3393,6720,6853,7419,7692,8971},{6916},{7386,7779,9057},{4321,8464},{3416,6977},{5987,6911,6942,8237,9025},{7614,9986},{4145,4343,7585},{4224},{8566},{4670,6576,6897,7774,7906},{},{6098},{3889,6351},{4539,5319,8028,8361,9210,9507},{6655,7116,7915,8424,9550},{5091,5234,5351,7064,8820,9017},{},{3953},{4631,4718,6293,8626,8883,8967},{4674,6251},{3377,4944,7454,7914,8519,8639},{3924,5008,6207,7445,8961,9305},{},{6954},{},{7608,9159,9214},{},{3640,5114,5292},{5830,8652},{3412,3621,5662,8423,8505,9478},{6497,8931},{4133,4670,5835,6316,7694},{4224,6148,6172},{3598,4655,6834},{},{6171},{3388,3853,7068,7893},{},{4658,6557,7224,7295,7612,8828},{3399},{7550,8173},{3871,3907,4332,9395},{3875,3993,9316,9732},{4975,5595,5892,7338},{4414,6057,7511,8055},{8661},{},{7557,7583,8999,9598,9929},{6577},{4934,6601,8708},{7286,8780,9469,9603},{},{9711},{4141,4390,4479,5717,8753},{},{4125},{6069,6163,8388},{3556,5497,5594,5835,8931},{},{3576,3870,5557,8507,9357},{3908,5081,5993},{4769,5573,6049},{7069},{4174,5357,7941,8577},{3605,6876},{3384,5871,5945,6183,7065},{3579},{1778,4120,4378,7441,8277,8471,9761},{5556,6632,9074},{3821,4093,6265,6435,7560},{8193,8352,8763},{7489,9101},{3813,3862,5343,7534},{4425,4974,5906,9176,9772},{3507,3878,4144,9972},{4463,4978,5153,5401,7171,7953},{4254,4724,6986},{4009,4515,9701},{4006,6803,7570,9669},{4388,6713,7808,9168},{5124,5771,5944,7267,8103,9919},{5846,6359,6406,6501},{6513,6606,8771},{7512,9291,9903},{4205,7538,9945},{4946,5769},{5356,7094,7468,8929,9326},{5741,5771,7120,7851,8021,9825},{5726},{3388,8064,8462,8475,8808},{6945,7956},{5889,8598,8706},{6332},{8952},{4415},{5531,5713,7306,8592,9475},{},{5743,8521,9072},{4437,4613,5841,6612,8855,9290},{3428,5040},{4264,5668,6449,6650,8034,8526},{4262,4894,7352,7772,9275},{5841,6792,6819,7677},{},{5272,5893,6708,7520},{7094,7435,7939},{5929,6705,6773,7248,7366,8293},{7187,8033,8583,9237,9821},{7529,7665,8676},{3660,4415,9383},{},{3754,4746,5885,9546},{4822,5326,6006,6797,8313,9529},{7847},{4478,5471,6969,7568},{5423,6878,7037},{4573,5553,7168,8193,9257},{4267,6545,7714,8450,8933,9460},{4986},{6148,7752,8938},{1410,4843,8237},{},{3552,8167,8202,9861},{4241,5212,8935,9038},{3899,4368,8336,8403,8678},{4924,6445,6981,7806,8023,9461},{},{9776},{5787,7703,8182,9268},{4113,4121,5072,7539,7583,8555},{3409,4084,5700,7110},{6730,8100,8388,8986},{7629,8369,8834,9433},{3820,7073,8056},{6493,7370},{7069},{},{4779},{6873,7037,8638,9160},{5756,8503,8947},{3793,6143,6835},{8015},{6101,7919,9169},{4424,9048},{3600,5322,5997,7644,8396,8973},{},{7830,8131,8390},{3720,6350,6461},{},{3562,5114,6842,7528,7796},{},{3449,7017,9029},{5832,6885,6932,9555,9887},{3500,9021},{4034,4670,6024,6934},{5064,5093,7394,8420,9357},{3564,4092,6306,6576,7853,8618},{4947,5487,6503,8072,8654},{5546,5592,6814,8468,9661},{4228,7372,7541,9724,9826},{5183,5438,7132,7973,9256,9439},{9199},{4637,4719,5827,7313,9024,9468},{},{9129},{4763,5488,6134,8508,9733},{},{3626,5871,6046,6778,7147},{7273,8835},{3593,3959,3987,7187,9336},{6000,6196,8993},{5341,6019,7072,8924,9073},{4807,6850,7086,7685,8468,9394},{6475,9079,9549},{4872,5501,7330,8831},{5668,5971,6635,6702},{6109},{3841,4453,5218,6220,8280,9397},{},{8570},{},{4403,6816,6915,7984},{3773,4125,4789,5484},{5520,7234},{5696,6201,7303,8376,8525},{4949},{4225,6623},{},{6988,7949,8540},{3888},{4249,5286,6743,8686,9418},{5773,6454,8673,8824},{4891,8407,8801,9470},{3995,5397,7777,8082},{4774,9157},{4586,5366,5694,5695,6133,6156},{4711,4796,8166,8752,9243,9477},{4379,4968,7008,7041,8926},{5993},{5743,6154,6378,9438},{3718,6854,9428,9451},{},{4746,5392,8058,9488},{7512,8550},{},{6079},{7175},{4221,6241,6470,6494,7140,7177},{4643,6313,8392},{4586},{4899},{5916,8807},{3943,4179,5075,6259,7931},{4022,5059,5557,7388},{757},{4381,7901,8557,8797},{3750,4301,5829,7928,8185,9319},{4645,7521,8716,9551,9681},{3860,3870,5306,6596,6661,7607},{5628,6370,9516},{5175,6178,6799},{5023,6568,8109},{4062,9997},{3856,4134,4327,6248,9823},{},{6666,8434,8593,8657,9001},{4555,6596,8258,9865,9948},{4776},{5933},{5806,5932,6884,8583,9129,9597},{4719,5971,8312},{6230,6317,6537,9296,9415,9845},{6376,6600,6917,7063,7624,9253},{4695,5299,5452,7645},{5845,7478,7553,8062,8888,9857},{3725,4768,5690,9369,9644},{4871,7785,8645,9846},{6432,8116},{7960},{3682,5376,6899},{8631},{3854,3911,5421,8964},{4078,8281},{4364,4722,7233,7686,8520,9499},{8303},{8912,9619},{},{4353,6091,7617,7949,8795,9778},{},{4427},{3707,5197,6775,6967,7426},{4059,5255,5702,6633,8212,9810},{3855,5528,7670},{6684,8378,9717},{3159,4878,5515},{4883,4995,7618,7934},{5154,6647},{3636,4298,5925},{1064,3599,7321},{7228,8147},{3849,4104,7707,8314,8362,8529},{5525,5569,8915},{7560,7853,7885,9331},{4503,6259},{3861},{3792,7163,8014,8148,8423},{},{},{3661,3742,8511,8542},{},{4595,5621,7397,9361},{4133,4167,4467},{4885,6766,7314,7524,7998,8630},{4834},{5724,8411,9875,9939},{3760,5644,5913,7431,9881},{4421,4647,5309,8162,8712,9278},{5492},{3903,4110,4525,6123,6386,6676},{5813,8398,8605,9447},{5226},{5931,6992,8303},{3857},{4453,4616,7029,9314},{4930,7917,9809},{4675},{3832,9334,9485},{4072,4170,8628},{6093,6263,6924,7356,8469,9625},{4974,5169,6047,6059,7491,9749},{3584},{4949,5321,6819},{6338},{7815},{3600,4813,5855,5928,6528},{3951,4896,5725,6142,6615,9387},{3778,6127,8002,8484,9626,9686},{4027,6670,7073,7402,7750,8584},{4760,4816,6898,8667},{4298,6163,6451,7639,9547},{6853,8509},{4464,8122,9981},{},{4083},{},{4462,4874,5070,5882,6944,7767},{5323,7153,8380,9393},{5803,8888,9753},{5586},{4227,9878},{},{4040},{7576,8363},{},{4998},{},{4811,8010,8198,9697},{5376,5497,6608,6962},{4587,6388,6656,8744},{4867,5383,8349,8975,9069,9094},{4333,8737},{3765,4644,6483,7952,9160,9820},{7054,8361},{4976,5070,6542,7419,8652},{3851,4680,4810,4996,5631,8020},{},{7724,8887},{3747,9743},{4339,6405,7237,7670},{5586,7394,9117,9318,9323,9883},{4541,4620,6159,9740},{},{3920,6769,9050,9523},{7639,7738,8597,8826,9250},{},{4785,6005,8194},{6277,6648,8113,8697,9289},{5267,5442,5608,7896,8931},{},{},{5475,6955},{},{4013,6311,7903},{4707},{4761,5056,6584,8092,8738},{3801,6021,7893,8070,8780},{6117,6154,7091,7126,7852},{6902},{6666,7149,9504,9652},{4080,5223,7529},{5901,6456,9038,9095},{8458,9749},{3725,4329,4531,6078,9640},{3966,6492},{6993,7052},{7482,7605},{},{4164,5434,6094,7101,7517},{},{4230,5649,7035,7922,8065,9348},{4572,4754,5898,7194,7628,9010},{4897,9488,9516},{},{8529},{},{5418,5420,5639},{4482,6043,7560,8101},{6122,6648,7757},{3909,6784,9251},{},{},{4833,5039,7817,8309,8396,9957},{5689,6741,8173},{},{3761,5833,7969,8378,8582},{5122,5896,8426},{9860},{5046,7059,7558},{4164},{},{5040,8398,8424},{7791,9064,9455},{6106},{5212,5444,5481,6021,7609,9514},{},{4967,5578,5732,7669,7958,8773},{4132,5059,8326,8466},{},{2765},{4885,5675},{8613,9449},{3722,6932,7707,7932},{4619},{5080,8191,8319,9687},{6545,9711,9770},{4446,4643,4862,5965,7758,9249},{3905},{5911,6956,7281,7538},{3875,4827,6581,7483,7681,8956},{3715,4378,6217,6548,8348},{},{4765,5024,5996,6328,7840},{6340,6582,6742,7873,9024,9269},{7271,8552,8795,9239},{},{},{7508,8540,9038},{4307,6573,7194},{5025,5835,7003,8372},{3784,5818,7322,8867,9935},{4999,6755,7484,8160,9188},{4385,4762,4882,6054,6869,9192},{4537,4734,4771,7372,8836,8975},{4037,6079,8175,9257},{4019,5101,6010},{},{4138,4948,6003,7540,8712,9647},{4746,8918},{4174,6610,8205,9293},{4093,5155,6099,8066,9466,9666},{},{},{4343,6020,6327,7571,9371,9537},{4074,6034,9352},{4428,5204,5713,6458,8380,8682},{4691,4914,6995,7556,7909,9168},{4526,4561,4933},{6162,6760,8577},{6038,9170},{4140,7350,8192},{4701,5762,5899,6985,7274},{3784,6840,7271,8959},{},{4638,5409,6879,7625,7752,8212},{4195,7358},{4064,6248,6561,6979,8999},{8564},{4224,5225},{6430},{3823,5691,5710,6815,7869,8621},{4026,6752,6767,8257},{3894,4379,7639,8467},{7833,8012},{8096},{4391,7872,8210},{3799,5492,5589,6472,9028},{},{3919,4332,6347,9035,9363},{4371,5782,6341,6383,9452,9801},{6254},{6321,6415,7554},{4020,7141,9620},{7438},{3938,6484,8546,9815},{3896,4648,4768,6745,9406},{5346,6411,7274,7444,8067},{6140,6150,7639,8614},{7568},{7497,7732,9246},{5987,6928,8784,9875},{4371,4676,5487,7383,9291,9588},{5185,5501,6398},{3921,5895,7480,7826,9369},{5561,7993,9403},{5112},{},{},{4170,8315,8431},{4352,5625,5913,6246,6573},{4699,6356},{4811,5085},{5998,8770,9770},{5161,7280,7360,7470,8289},{},{5501,5897,8056,8702},{7875,8240,8543,9700,9708},{4611,6193,6733,8045,9431,9617},{7293,9563},{4209,4982,5719,7039,8760,9080},{7839},{6195,6357,9067,9882},{6876,9525},{6501,9895},{5744,7338},{4057,7488},{1003},{5022,7425,8453},{5580,6501,7897,9217},{4945,5227,5536,8369},{4409,6459,7418,7650,8683,9859},{4751,5936,6198,6778,7748,7860},{4558,4876,5005,5478,6808,9246},{2336,4339,4839,8101},{6611,9261,9478,9506},{},{5742,6690,6915,7423,8118},{},{606,3943,4160,7940,8276,9583},{},{3867,4773,6311,9262,9876},{},{3779,5922,7089},{3812,6008,7130,7222,8278},{4246,6593,8718,9665},{4872,5966,7115},{9766},{4422,8161,8488,9496},{},{4439,5053,5696,9220,9967},{3850,6055,9121,9909},{4613,5228,8733},{},{5617,6158,6818,7479,9280,9739},{3994,4316,8364,8392,8918},{4401,7708},{5191,6130,6146,6149,8701,9412},{},{7905},{4047,4242},{4618,6634,6773,7733,7762,7780},{4153,5844,6776,7332,7511,7620},{},{},{4350,6751,7830,7955,8249},{5372,5763},{3964,8427,9904},{4222,4514,7563,9708},{4495,6461},{3957,6663,6892},{4080,5669,6637,8186},{5388,6705,7066,8958,9059,9386},{},{4084,4187,4764,4893,4924,6367},{4482},{5252,7266,7304,7686},{},{4586,7808,9301,9978},{3907,4505,5777,5989,6517},{5158,9046,9178,9239},{3808,3998,4912,5553},{},{3982,4288,7343,8908,8921},{5127,5287,6534,7664,8300},{},{4480,5363,5978,7590},{5860,8482},{4988,5576,9518},{6919,8011,8289,8655},{},{4309,7839,9297,9703},{4556,6092,6159,6695,6799,7926},{4167,4916,5403,5542,8317,8468},{5009,6603,6845,7674,7816},{},{5618,5655,8268,8491},{5128,7594,7765,9315,9776,9807},{},{8911},{4862,6019,8808,8904},{7787,8001,9446},{3895,5921,6925,8113},{6162},{5144,8148,9177,9431},{6075,6218,8825,9559,9765},{4255,6603},{7409,8943,9314},{6360,6833,7371,7939,8429},{},{4483,6584,7613,8801,9023},{5785,6354,6402,6807,7602,8641},{7608},{3872,4655,6870,8446,8504},{},{4499,5394,6399,7811,8872},{3960,5365},{6209,6325,9256},{7021},{9813},{4221,9988},{9018},{6997,9931},{9244},{3871,4747,7303,7425,8557,9979},{6788,6929,7230,7425,7512},{4972,7369,8811},{},{4315},{},{},{4586,5847,5979,6317,8733,9158},{4076,4123,4311,6345},{4272,4907,7939},{4615,4768,5119,6002,8506,9296},{4043,4559,4573,6095,6989,8935},{4430,5409,5525,6427,7361,8488},{},{3921,5378,5574,5798},{7589},{4407,5279,6365,6676,7729,8497},{9577},{4984},{4156,4162,7347,9141,9545},{4524,4826,7104,7609,7888,8608},{5920,7538,8609},{4993,5526,5689,6020,6714,8298},{7391,7575,8431,8571},{},{6914,7840},{4046,6491,7514,8583},{7190},{4485,4651,5174,6473,8381,9729},{4200,6329,7577,9254},{5918,7579,8277,9382,9854},{5323,6230,9162},{6698,7653,7877,8031,9793},{9042},{5987,6204,9943},{4149,4313,5783,8238,8480,9853},{5979,5999,9630,9854},{4997,6028,9207},{},{2305,4481,4995,8262,9682},{},{3993,5584,5934,7352,9595,9767},{6179,7374},{},{},{4236,7893,9495},{7434,9013},{1257},{},{3919,4274,6738,7711,8244},{3968,5302,5524,5794,5968,6224},{4021,4837},{5523,7237,7714,8733,9009},{231,7061,8176,9665},{},{},{5103,5794,8127},{5473,6795,6888},{6105},{6995,7219,9022},{5263},{4400,5079,5962,6659,8245,8848},{7464,7826,8034,9889},{7640},{},{5478,8305,9029,9318},{5688,8161},{4823,6333,6375,9018},{},{6230,7506,8416,8678,9500},{3964,4627},{},{5464,6754,6944,9053,9588},{7583,8806},{},{7340,7351},{4771,5771,6032},{3942,4729,5168,5760,8709,9899},{5300,9260,9318},{4059,6076,6648,7887,8235,9430},{5839,7569,8649,8881},{2312,4953,5823,6125,6959,9224},{5051,5641,5761,6794,9984},{4509,5267,5714,6604,8730},{4235,6205,7275,7472,8111,8599},{4797,5922,6674,6806,8429,9109},{},{4569,5405,6856,7118,8720},{4375,6375,7895},{5554,7127,7277,7975,9120,9930},{4669,7733,8139},{4012,5484,7562,9923},{},{8110,8635},{},{5939,7072,7090,9042,9638,9722},{4915,5004,5392,7621,9304},{},{},{5443},{4714,5863,7099,8487,9173},{5154,6288,6338,8069,8578,8718},{4920,5795,7036},{6883,6892,7832},{4068,4702,7870,7902,9045},{4548,7371},{4999,5069,9703},{4970,5273,7593,7793,8105},{6890,9292},{4527,6670},{9882},{},{},{4295,5413,7846,8320},{8597},{4303,7232},{5891},{5860,7195,7547},{5156,6516,6678,6845},{4753,4833,8297,9536,9601},{4779,5826,6548,8064,8696,9251},{4609,6844},{5287,7649,8760,9189,9997},{6811,7295,7855,9049,9378},{6229,7949,8116,8610,8989,9361},{4297,5340,7560,9261},{4713,7574,8074,8585,9983},{5269,6369,7644,9233,9879},{5190},{6586},{6291},{4113,6154,6714,7134,9234},{7522,8544},{4286,7091,9187,9223,9847},{6314,6729,6930,8456,9323},{6462,8885},{2036,8418,8723},{5915,5932,9785},{4627,6601,6682,6766,6912,9508},{4157,4325,4658,8022},{},{},{4054,4772,8211,9777,9997},{4432,4732,6253,9486},{4397,6342,7157,7542,8943,9660},{4605,5085,9626},{6226,6328,6916,6970,9825},{5025,6677,7752,9106,9606},{},{6495,7697,8578},{5989,6129,6513,6797,7563},{4827,5207,5699,8327},{4563,5399,5838},{4287},{},{},{4587,4965,5732},{},{5518},{4407,4477,5402,7944},{4184,4551,8676,9760,9932},{5985,6378},{4751,6429,8207,9933},{5343,9378,9775},{6588,7507,7897,8864},{4106,8790,9229,9725,9826},{},{},{5169,5976,6977,8386,8508},{5329,6838,8000,8583,9332,9880},{5969,7816},{4128,5079,5420,6602,7770,8745},{6529,6783,8094,9207},{9520},{4169,4986,5310,9179,9448},{},{5611,8759},{5651,8303,8753,9508},{},{4275,5607,6272,7832,8480},{},{5235,5655,6237,6823,7875,8677},{5131,6071,7321,8964,9683},{5276,7376,9579,9763,9916},{8850,9818},{5465,6072,6326,6645},{4255,5873,6402,7108,7526},{8316},{7201,8276,8604},{6094,7284,8344,9294},{7001,8297,9250},{6317,7137,9231,9718},{5276,9206},{},{4433,6672,7410,9689},{4094,4793,6714,9938},{9103},{4154,7223,7932,9434,9435,9988},{5084,5506,5806,6946,7303},{4194,4400,4517,9988},{7310,8436},{4146,5903,7140,7894,9746},{4202,5345,5925,7176,7824,9000},{6856},{4333,6030,6920,7300,8296,9614},{4062,4175,4267,6821},{5645,8039,8091,8338,9042},{5353,8473},{},{4939,5676,6990,9683},{6412,6779},{5155,7961,9117},{7119,8556},{4153,6932,7052,7423,7895,9852},{7206,7455,9926},{4256,7264,9186},{},{6713,8225},{7851,9678,9998},{4304,4606,5194,5468,8574,9969},{4121,9201,9265,9595},{4119,5129,5609,9182},{4167,5152,6466,7001,7733,8525},{},{4075,6883,7582,9988},{6351,8434},{5015,5925,7603,7631,9545},{4636,7133,7373,7441,9104},{8579},{4418,7823,9903},{6020},{},{},{4468,5703,5825,6169,7999,8683},{5284,6078,9818},{4128,4369,7134,7698,7887,9269},{8080,8280,8434},{},{4177,9588},{4904,7542,8100,8108,8207,9686},{},{6644},{4428,5164,6100,9482},{5833,6269,9091,9960},{4789,6428},{6127,6519,9326,9630},{6533,7313,9144,9468},{4516,4672,5918},{7221,9112,9128},{4868,4983,5333,7948},{},{4104,5521,6301},{},{5722,6255,6506,7673,9615},{7854},{4189},{4952,5255},{5043,6336,6467,6872,7635,8840},{4386,6486,9766},{5129,7588,8001},{4509,6766,7110,7733,9250},{4143,4460,4638,7345,8015,8102},{4841,6098,7093,7255,7880,8587},{4254,5828,7218,7998},{5615,5805,7997,8008,9444},{4293,4779,5357,9246},{4955,5343,6457,6808,7772,8930},{4858,8245,9133},{4356,4839,5560,7442,7811,9371},{5119},{6576,9224},{4374,8765,9295},{7465,7881,8418,8875},{5070,8927,9573,9599},{5065,5367,7551,9464},{},{6789,7644,9118,9803},{6574},{4316,6346},{7071,8630},{},{4354,7785,7982,8629,8634},{4619,5261,6379,6886,7459,7921},{},{},{5267,8053},{4764,6754,9327,9693},{4362},{4279,5964,7693,8318,8808},{5549,7916,7957,9021},{6060,7428},{5276,5572,8692,8763},{7757},{4790,5705,5955,8662},{6726,6822},{6135,6640,6703,7290},{5738,5931,7347},{5131,5632,5939,6254,6806,7549},{4759,4925},{5383,6059,7262,7879},{7923,8048,9620,9630},{5130,5514,8260,8664,8783},{4747,5986,6057,8552,9379},{5072,5567,8096},{4201,6454,6967,8161,9814,9836},{6668},{8169},{6096,6803,6879,7084,7318,9659},{1559,7656},{5369,8575},{6779,7690,9647,9996},{4601,5436,6129,6992,9540},{6594,7486,9729},{4772,5789,7785,8994,9210},{9565},{7650,9390},{9716,9782},{},{4768,8650,9135,9361},{},{4257,5683,6092},{4567,5468,9095},{5107,5746,6261,7620,9681},{7891,9607},{4317,4591,5295,5499,7330,9304},{9575},{},{8350},{8942},{4673,4860,7926,8718,8738},{4718,7946,8033,8334,9370},{7537,8352,8565,9855},{},{},{4957},{4835,6411},{5417,5898,6654,6968},{4281,7913,8582},{},{4344,7115,7584,8948,9527,9769},{},{7116},{},{6113,6217,6451,6896,6999,9790},{7112,7115,7512,8511,8553,9330},{},{7715},{5660,6115,6344,9296},{5568,6361,8084,8557},{5318,7513,7944,9757},{4260,5121,5177,5509,6986,7267},{4233,8194,9447,9480},{4670,5874,6135,8922},{4519,7254,8572,9237,9858,9893},{6194,6587},{4367,7481},{4642,5318,7714,8180,8716,8812},{730,6891},{4384,5043,8386},{6473,7147,7720,8406},{4421,6084,8339,8805,9688,9992},{4308,5746,6937,6944,8317},{5477,6094,6117,6294,6699},{4602,5559,7467,8086},{5397,6486,7948,8526,9869},{4374,6935},{5594,6446,8888,9057},{4710,6026,7674,8850,8870,9988},{6265,7346,8630,8772},{7198,9744},{4962,5306,5659},{6195,6497},{5754,6509,6981},{4358,4449,6954,8087,9087,9482},{},{6226,6326,6617,6900,7153,7208},{4306,4392,6511,7297,8081,8817},{6373,6782},{},{4371,5727,5865,8692,8941},{},{4372,4459,8182},{6258,6351,8423},{4910,5499},{5754,7618,8047,8839,8991},{6602,7129,7491},{6747,6850,7492,7773,9136},{4639,5491,6853,7226,7811,9121},{5431,7629,8132,8317,8672,9379},{3704,4248,9923},{5401,5650,7025,8686},{5035,7088},{4826,4974,6603,9523},{},{6103,9876},{},{5516,8147,8235,9036,9951},{8311},{},{5297},{4846,5354,6746,9649},{7715,9314},{4604,5969,9041,9314,9371},{4748,6113,6971,8238,9358},{4509,4666,5769,9505},{4799,5005,6045,7449,9182},{4632,8273,9356},{6363,6492},{},{6637,7995},{},{5467,5812,6688,6807,9987},{5161},{6142,7111,8232,8747},{6490,8645,8759,9012},{4411,4837,4926,6740,7670,9152},{6410},{4641,8513,9653},{4370,5280,5777,6692,8871,9245},{4312,4535,6305,6800,7597,9439},{5066,8566,9975},{6292,6352,7128,8444,9884,9960},{6349,6411,8265,8816},{4441,5528,6920,8423,9444},{7268,9806},{4579,5596,7213,8060,8720,9609},{4329,5358,5678,6028,6791,8923},{6272,6909,9725,9766},{4890,6007,8389},{},{4627,6294,7189,7544,9280,9917},{6207,7201,8073,8906},{8522,8957},{6053},{},{6268,6776,7901,9190},{},{5464,5909,6128,7907,9998},{6998},{6897,8862},{4992,6832,9732},{4507,5970,6716,6747,7200,7452},{},{8926},{7172,7343},{5170,6856,7508,9041,9209,9454},{4367,6924,7944,8398,9252},{4592},{4767,5113,6210,6852,7899},{5980,7376,8152},{6881,8563,9247,9455},{9359},{9289},{},{5720,7751,7970,9466,9469,9941},{},{},{},{8998},{6722,7486,8293,9318,9981},{4379,4918,6684,7365,8734},{},{9994},{7298,8465},{6235},{5315,6213,7901,8353},{4406,4841,7395},{6005,6815,7473,8492},{5005,5629,9590,9896,9996},{4825,9619,9670},{5353,6305,6551,6642,8949,9749},{4713,5363,6442,8476},{5941,9474},{5262,6327,6602,7209,7408,9855},{5850,7667,9687},{4641,9679,9969},{4644,7451,8146,8329},{5583,8279,8606,9175},{4830,4922,6111,7566,7587},{6036,6368,7265,8522},{4893,9284},{6236,7013,7225,8731},{6414,7718,8108,8177,8271,9138},{},{},{5080,6240,7482,7486,9936},{},{6104,7189,7558,7891,8796,9423},{5765,6390},{6314},{5360,6619},{5263,8864,9937},{4751,8020,8407,9661},{5508,7330},{},{4883,6412},{4538,4776,7504,7622,8740,9852},{4428,5410,5583,6762,7807,8357},{4923,5040,5252,5333,7928},{4500,6695,8097,8880},{4546,5777,6309,7207,8038,8273},{7855,8772,9028,9180,9866},{},{},{6224,7650,8819},{5773,6440,7881,9430,9476},{4730,6843,8159},{8684,9422},{},{},{7541},{5072,6510,6770,6979,7260,9390},{5228,5420,6315,6609},{5782,6059,6399,6857,7522,9983},{5646,7697},{7836},{4486,5128,8404,8968,9105},{},{5731,6393,8677},{6226,6250,7034},{4654,5763,5979,7728},{4532,5746,8044},{5514,6785,8162,8730,9561},{6414,9543},{4792,6068,6921,8518,8785},{5594,6259,7418,8241,8846},{6372},{7312,7600,8125,9254,9679},{5763,7243,7653,8194,8630},{4985,5432,6399,7531,9430,9981},{},{5682,9435,9773},{5367,5909},{},{},{5717,5867,8028,8306,9413,9928},{5400,5983,6669,8263,9486,9711},{5234,5632,6601,6846},{},{4491,6873},{4816,4930,6276,9073},{8028,8593},{},{5392,6268,6771},{4432,5049,6084,6346,8248,9216},{},{6238,7063},{5060,5256,6629,7143,8811,9457},{},{5086,6892,9801},{4905,5035,5469,8089,8580},{6296,6636,7155,7169,7925,9670},{4602,7238,8245,8872,9329,9984},{6575,6796,7561,8005,8213,9622},{4706,9473},{5077,5596,6340},{5069,6064},{},{4706},{4490,8407},{4580,8607},{5471,8704},{4538,9762},{5080,6407},{5961,6600,7071,7997,8877,9575},{4820},{},{},{5292,9870},{4926,5382,8225,8276,8874,9489},{},{5982,6056,7709,7714,8558},{6553},{},{},{4653,5015,5053,8403,9116,9645},{},{4796,6895,8177,8687,9857},{8331,8368,8420,8870},{6854},{5909,7796,8920,9434,9685},{5012,5434,5886,6573,7510,8697},{6069,7342,9155,9748},{6579,6847,9018},{6709,7521,9027,9153,9584},{4775},{5513,8115,9035,9182,9206},{7972,8171},{4667,5404,5438,6068,6152,6558},{5309,5410,7299,7340},{4979,5135,5302,6685,9109,9634},{7683,8544,9335},{4961,8682,8719},{5963,6045,6545,6757,7293,9190},{},{5650,5977,7522,8060,8750,9155},{8055,8996},{5228,8473},{5160,6926,7254},{6424,8032,8442,9091,9538,9661},{5163,5645,6395,6764,8804,9128},{4999,5378,5858,9210,9512},{5667,6536,6797},{4531,9933},{6395,8726,9174},{},{6211},{6060,6235,8195},{5486,6297,7542,7543,7659},{5544,5939,5985,6098,9304},{},{7653,9779,9855},{5029,5853,7304,9197},{4701,6641,6810,8408,8777},{8464,9327},{5754,6092,9031,9218},{5987,8350,9104},{7667,8643},{8722},{4477,5182,6340,8432,8582,8877},{},{},{},{},{4710,8265},{},{7621,8820,9228,9432,9870},{6840},{9651,9872},{5654,5768,6464,6926,7524,8971},{4514,9476},{6772},{5278,6329,7284,8022,8438,9455},{4539,5769,6926,7116,9112},{5043,7132,8012,8139,8501,9832},{6644,7591,9299,9344,9571},{4630,5063},{4704,5192,5314,8825,8830},{6756,7511,8055,8709},{5530,8771},{7310},{9389,9443},{5971},{5881,8316,8425,9858,9948},{5334,5988,6483,7269,8125,8138},{4920,5202,8186},{5460,9063},{},{7297,9406,9649},{7202,9041},{3926,4758,5068,6820,9478},{},{},{8308,9768},{6795,7067,7524,9440},{5832,6224,6635,7373,8510,9865},{5020,5368,5405,7280,8082,9140},{4766},{7275,8256},{6100,6598,8803,8821},{5527,8371},{5542,7125,7292,7346,7850},{4893,9796},{5709,6670,7199,7696,8469,8703},{6704},{6270,6622,8072,8915,9685},{992,6138,6698,8754},{9468},{8908},{6627,7727,8678,9427},{5462,5512,5916,8890,9628,9910},{5000,5196,5908,7656,8509,9714},{5442,6248,7722,8258},{},{},{5105,5761,6326,7554,8077,8252},{6669,7749},{4677,5222,5514,7270},{4782,5258},{5312,6558,6861,8231,9391},{6876,8018,8339,8544,8717,9472},{4558,8785,9693},{6682,7348},{7346,7998,9474,9729},{5119,5139,7851,8152,8822,9909},{4630,5159,5200,6612,7449,7874},{4598,4749},{5574,7715,7886,8566,9472},{5106,5744,6035,8473,9584,9799},{7753,7928,8131,9517,9865},{5687,6170,8732,9475},{6514},{4545,4988,6195},{5000,7867,8363,8910},{7820},{9889},{6326},{4993},{5507,7884,8348,9819},{5169,5587,5600,5751,8242,9440},{5312,6307,7514,7841,9774},{5866},{4858,5168,6540,7316,8642,9999},{6440,6525},{9161},{5042,5417,5750,6901},{5677,5686,8377,8509,9959},{5851,6312,7425},{4719,4748,5835,7198,7388,8284},{6156,6213,9103},{6066,6233,6505,7590,7716,8634},{6949,8268},{4921,5173,5200,5264,7556,9691},{6570,7274,7402,8109},{4976,5481,7115,7227,7704},{},{6872},{4840,5878,8136,8773,9982},{5325,5368,6588,7400,7440,7886},{4829,5469,6801,7587,8625,9251},{4581,4864,5231,6812,8981,9351},{7221,7261,9918,9990},{5831,6365,7815,8400,9247,9590},{5355,5959,6961,9467},{2601,5463,7930},{4925,5358,7238,8353},{5485,5672,6962,7759,8625},{},{},{4580,5384,8429,8601,8660,8923},{5753,6608,6873,7182,7429,8283},{4727,5302,6532,6555,7643,8524},{},{8226,8712},{6201,8424,9056},{6346,8988,9204,9541},{6730,8900},{5104,5383,5460,5785,7411,9629},{5616,5730,6695,7258},{6977,8983,9255,9804},{4939,5947,6363,6495,8452},{6222,7156,7552,9301,9314},{},{4847,6989,7436,9894,9926},{4621,5908,7140,8562,9737},{5163,7263},{4624,4932,6373,6956,7500,8771},{4738,5871,6073,8879,8975},{9010,9339,9790},{4811,6144,8412},{9922},{5657},{5889,6593,8068,9640},{4775,6663,7014,8686,9727},{5157,5464},{},{5284,6090,9498},{5331,7112,7623,7872,8596,9564},{4816,6034},{4615,6005,6635,7254},{5966,8738,9812},{5455,8159,8615},{6638,7966},{9050,9663},{5272,6578,7345,8317,8866,9115},{},{9278,9380},{6060,6313,8524},{6004},{5393,7223,7493},{7418,8704,9459},{5155,6595,9237},{6038,7322,8932,9161},{7766,7795,7809,7987},{},{6271},{5019,7906,8412,9971},{5038,5078,6464,9156,9811},{8074},{4871,6235},{6316,7072,7948,8561,9110},{7690,8347,8660,9118,9964},{7186,7763,8979},{5653,6682,7776,8251,8923},{5014,6827,7610},{4686,8443,8979,9502,9825},{154,4889,5795,8504,8628,9807},{5355,6428,7451,8013,8163,8498},{5340,6520,6691,7052,8246},{4844,6155,6205,6438,8529,9340},{8908},{5086,5593,7421,7666},{6069,7717,7759,7905,9399},{8499,9882},{7267,9896},{5733,5771,7338,9668},{9423},{5939,7637,8266,9021,9817},{6138,9058},{6352,7401,8234,8535,9858},{6767},{7676,7800},{4762,8628,9483,9506},{},{4971,7239,8705},{},{6692},{5460,5781,6765,6849,8645,9849},{5552,6686,6831,7405,9708,9962},{6857},{4861,6352,6606},{5425,5766,6017,6481,7387},{6271,6339,6960,8016},{6073,6870,7160,9253},{7592,9157,9397,9811},{5980,6219,7457,7829,8041,8796},{},{4883,5655,6493,7381,8719},{5241,5679,6145,6207,7421,8785},{6226,8590,9713},{},{4729,4927,5368,6957,9401},{4749,4809,5564,5825,6913},{5529,5958,7422,7469},{6319,8785},{7478},{6878,8067,8088,8283,8831,9485},{4987,8802},{6698,7352,8489,9983},{6823,8738},{5027,6459,9802},{5570,6349,6939,7455,9465},{5457,6607},{},{},{5810,5877,6977,8741,9350,9440},{6849,8662,8698},{7083},{},{5096,5202,5324,6249,7373,8934},{6819,9787},{7058},{},{4798,5097,6414,7427,8120,9796},{7224},{6423,6606,7308,7643,8475,9223},{},{5544,5724,8295,8550,9916},{7730},{5146,6426,7079,8918,9506},{7085,8717},{4996,5506,8366},{6136,7770},{},{8879},{4858,5266,5770,6751,8450,8536},{},{},{7565,7998},{9616,9848},{5289,5398,5948,7605},{6111,6228,8157,8554},{8728},{7039,7621,8482,9506,9813,9927},{4987,6064,6236,8883,8911},{},{5302,5784,6139,6363,9376},{4998,6888,8897},{},{7413},{4742,5970,6799,7292,7614,8099},{5512,9489},{6007,6661},{4760,6688},{5587,6193,6604,7564,7841},{7027,7333,7503,7911,8527},{5367,6610,8567,8695},{6180,9343,9459,9702},{5035,7358,8079,8794,8800,8913},{},{5223,6479,8781},{5381,5580,7336,9172,9496,9728},{4952,7149,7315,9351},{4733,6038},{4972,6394,7317,9032,9224,9455},{993,5570,6700,7048,7774,9746},{5938},{6663,7251,8841},{6033,7510,7664,8565},{},{},{5725,5990,5998,6028,6745,8000},{5154,6204,6518,6754,9156},{},{6373,6605,6714,8711,9660},{5036,5564},{5401,7635},{5947,6375,9725},{5451},{5738},{},{5951,6506,8778,9868},{5621,8193},{5910,6133,6482,8452,8795,9714},{6087,6278},{9752},{7602,7826,8912},{6829},{},{5147,5156,5570,6100,6425,9017},{4932,5726,6607,8195,8332,8849},{5026,6437,6488,6848,6921,7298},{5234,6503,6720,6926,9850},{5512,6808,7214,7477,7759,8836},{5611,7566,8007,8533},{4793,6078,6100,7344,8229,9872},{},{5087,5220},{4898,6892,9282},{4789},{4799,5965,9657},{},{6106,8536,8748,9191,9294,9737},{6341,8193,9762},{5257,5973,6460,6464,8204,9713},{9622},{5835,8594},{8468},{5233,6284,6372,6908,9419},{5251,6210,9051},{9831},{6043,7296,8614,9915},{5053,5107,5951,8309,8455,9243},{5544,5885,6311,7818,9963},{6029,7661,8238,8324,9355,9658},{4792,6173,7852,8198},{7169,8969,9841},{6395,7408,8519,9003,9296,9525},{5277,6147,9368},{6221,7854,8958,9278},{5483,7579,8810,9082,9822},{5306,5394},{5519},{7259,7619},{},{6775,7234,8934,9086,9267},{8584,9726},{5023,6320,6375,7209,8694,8878},{4956,5739},{5016,5216,5842,9404},{5591,7487,7489,9973},{6285,6651,7166,7312,8359,9672},{},{5948,7402,8213,9668},{7649,7756,8025,8807,9057,9322},{9602},{6036,6962,7849,9031,9735,9738},{6762},{5762,5918,6007,6913,8073,9416},{},{6385},{5236,5726,6480,7222},{8101,9293,9631,9943},{5414,8137,8280,8469,8535,8748},{6076,6708,8026,8990,9443,9449},{8351,8704},{5001,6295,8767},{5529,6754},{6582},{5203},{6569,6693,7000,7586},{4931,7379,7571,7604},{5561,6356,7930,8670},{5291,5774,6092,6816},{6075,6631,8557,8898},{5573,6053,6378,9825,9835},{5632,5804,6890,7001,8041},{5775,6169,6454,6611,8150,9421},{5322,6479,7603,7740,7810},{},{},{5034,5906,6601,7294,7900,9996},{5510,5944,9577},{6830,7442,8785,9716},{4904,6566,8455},{6047,9190},{7141,7162,9412},{4883,5356,6467,6729,7391},{5135,6163,7064,7660,8349},{8735},{6152,7316},{4978,5865,6174,7600,7866},{5099,5562,6623,8369,8687,9681},{6998,9633},{5298,6307,6573,9660,9985},{5732,7298,8318},{6651,7439,8099,9618,9794},{4926},{5837,5920,6361,7980,9636},{},{6991,7113,7703},{8573,9738},{6003,6791,7782,9389,9862},{5294,8930,9055},{7711,8072,8470,8600},{5424,6738,8908},{6658,7036,8720,9733},{7637},{4874,5073,5298,5743,9382},{6125,6971,7012},{5933,6274,6506,8090},{5475},{7118,9014},{5033,6086,8046,9447,9638,9656},{4895,7459,8702,9555},{6212,6877,9328},{7301,9285,9900},{7018,8280,9441},{6748,8812},{9575},{5398,5788,5889,6878,7245,8642},{},{7794,8303},{8185,8727,9077},{},{8141},{9468},{},{5579,6519,8791,9699},{5780,5887,6500,6886,7478},{9113,9634},{9437},{4656},{5294,5394,5980,7017,8614},{5129},{7098,8197},{},{},{6089},{5335,6416,8379},{},{5055,5704,5798,5991,7823,8508},{7101,7898,8671,9748,9970},{7852,7948,9843},{7392,7966,9923},{5155,7599,8334,9912},{7472},{5337,5344,7048},{5866,6991,9488},{7578,7873},{5187,6724,8710,9569},{8384,8696,9570},{6191,6231,8461,8842},{7856,8637},{4933,5016,7329,8527,8568},{5022,5077,9357,9436,9895},{7723},{5743,6134,7869,8848,9328,9422},{5377},{6204,6485,7026,7725,8839},{6503,8906,9742},{6301,6798,7306},{5283,5798,7682,8540,9587},{5379,6013,9531},{},{5075,5777,6249,7298,8117,8604},{6499,6848,9304},{4981,5450,7161},{5582,5972},{9677},{9197},{},{5230,5447,5879,7761,8798,9211},{9341},{6050,6339,7657},{5106,7720,8548,9318,9355},{},{5950,6700,6747,7716,8730},{5004,5070,6086,9375},{6483,9008},{5142,5973,7079,7538,8159},{},{6003,7102},{8367,9006,9643},{},{5627,6242,7292,8952,9781},{5600,7132,7409},{5881,5884,7293,7889,9675},{5089,5504,6329,6419,8002,8706},{5806,6188,7377,8544,8607,9553},{5517,5879,6248,7203,9338},{},{6466,6892,7338,7724,7782,8530},{6043,6540,7798,8914,9431},{5090,6539,6962,8167,9187,9273},{6262,6406,7323,8018,8954},{6273,6471,6568,7970,8060,8914},{6038},{9261},{},{4956,8041,8095,8334,9122},{},{5404,8319,8915},{5122},{5907,9824},{6161,6678,9190,9381},{5194,7297,7415,8034,8307,8787},{6752,7474,7980,8511,9527},{5075,7856,8547,9319},{5368,6198,7244,8019,9024},{6175,6290},{5232,8557,9337,9903},{5131},{5564},{5654,5995,7361,7470,9105,9151},{5034,5993,7091,8022,8507},{412,6014},{8739},{8485},{5847,6595,6728,7392,9630},{},{5273,6465,7325,8085,8782,9849},{},{5282,6412,8719,8720,8944,9356},{6408},{},{7107,7381,8804,9842},{5368,5709,5797,7997,9534},{5138,5369,8047},{6282,7641,9172,9233,9912},{5465,7764,8340,8821},{},{6623,7049,7057,7500,7517},{5923,6728},{7671},{9824},{7526},{5406,6477,6742,7909},{7147,7627,8525,9382,9520},{5399,8794},{5232,7093,8929},{5538,8012,8109,8727,8789,9166},{5102,9389},{6468,6738,6786,7526,8510},{9384},{},{8767},{},{9722},{6003,7214},{5433,5447,5602,5936,7371,9497},{},{5206,5866,9694},{7355,9930},{5807,7012},{5909,6727,7715,9833},{6676},{7875,9821,9840},{5059,5173,5298,9482},{6807,8381},{7008},{5053,6045},{6380,7276,9853,9944},{7107,8250,8652},{5149,6771,7191,7397,8355,8842},{6376,6904,9261},{6002,6261,7109,7854,8317,8836},{6141},{},{6047,7398,7577,8658,8834},{6980,8488,8742,9691},{5612,8363,8928},{6055,7094,7486,9751},{5348,5733,7012,7229,9796},{8303,9257,9937},{},{5658,9803},{5166},{5936,8923},{5675,7103,7234,8613,9668},{},{6516,9133,9594},{5042,7067},{},{6832,7769,8757},{5631,6836},{6448},{},{5901,9770},{9475},{},{5998,6240,7976,8242,8789},{5293,7821},{6814,7873,7975},{9662},{6474,6806,7533},{5425,7114,8587},{5589,6092,7178,7931,7942,8396},{5394,7301,8159,9351},{6817,8316,9246},{},{5054,6191,6406,7803,8040,9249},{6394,8121,8278,8382,8763},{5158,5328,5528,8079,8397},{5946},{6037,7003,7950,8009,9243},{5404,7030,8438,8669},{6558,6888,7148,7893,9877},{5267,5713,7403,7740},{6784,9353,9846},{5486,5611,7108,7771,8877},{5169,5213,8317},{6241},{5125,5484,7542,8406,8767},{5591,7009,9203},{5256,5586,5779,7893,7975,9549},{5381,5526,9430,9648},{},{5415,6803,6804,8628,9867},{8749},{5770,6069,6395,6620,6950,9086},{7134,8640,8961,9402},{6218,9507},{6192,6331,6914,7574,8678,9593},{6634},{5684,7857,7913,8035,8405},{5585,5621,6065,6617,9559,9632},{7291,8485},{8800},{5804,5810,9354,9495,9620},{7404,8591,9334,9404,9412},{8107},{5479,5599,9416,9535},{7148},{7335,7498,8299},{},{5384,5652,5753,5913,8060,8974},{9849},{},{7303,8106,8785},{},{5864,6998,8088},{8224},{6849,8776,9514},{7115},{5271,5694},{8038},{7750,7914},{9471,9898},{5649,8039,8118,8431,8582,9818},{5181,6547,7331,9468},{},{6494,8896,8995},{},{6521,9422},{7542,8371,8721,9633},{6328,6960,7086,7345,7630},{6194,7381,8360,8886},{6506,7537},{6716,7657,8375,8916,9321},{7268,7281,7316,8372,9658,9742},{5112,8786},{6604,6755,7665,7775,8444,9354},{6184,7329,9616},{5529,6130,8180,9134},{6655,7975},{5978,6148,6160,6914,8632,9177},{5628,8407,8644},{9271},{5592,5836,7959,8429,8798,9482},{5428,5650,7377,9690},{5195,7260,8195,9739,9942},{8022,8800,8802,9159,9635},{8180,8751},{8466},{5799,6213,7779,9865},{5477,6874,7740,9480,9666,9884},{6202,6597,9795},{6882,8884,9012,9244},{},{1266,5272,6642,7703},{5133,5726,6846},{},{7173,9642},{6516,7441,8361,8409,8812,9526},{},{6119,6585,8435,8587},{5571,9803},{},{5620,6120,7582,7626},{5375,5537,5726,6764,9345,9697},{},{5791,8504},{6102,6617,7299},{5393,6769,7268,9064,9233},{8789},{5197,5198},{6990,9104},{7252,9400},{},{5157,5508,6456,6902,9761},{5809,6102,8258,9829},{5543,6929,6950,8050,9521},{5766,7117,8510,8879,9224,9403},{5504,6802,6967,7146,9060,9470},{},{8700},{},{9080},{6892,8469},{},{6204,7273,8698,9173,9572},{5369,5660,5725,7349},{6677,8557,8564,9678},{},{5945,8412,9226},{5207,6598,7249,7642,8271},{5753,5884,7039},{8409,9101},{5820,6596,8371,8660,8837,9805},{8311},{6486,9479},{5374,6981,9369},{8265},{5760,8415,9583},{},{6856,9645,9728},{6678,7448,9235},{6964,7856,8244,9711,9780},{5823,6577,8023,9856},{7409},{9070},{5330,5450,6144,7384,7823,8400},{5410,6216,7761,8014,8100,9107},{6626,8469,9718},{},{7292},{5362,5797,6102},{7667,8255,8470},{9527},{5321},{6637,7578,8265,9002},{5255,5555,6144,7153,7647,9088},{9378},{5798,6783,9787},{5313,5612,5956,6809,7305,8156},{},{7526,8504,8890,9264,9345},{7439,8333,8566,9423},{},{8236,8502,9813,9836},{6860,7474,7781,8343},{8168,9188},{},{},{6574,7098,7309,8682,9584},{5943,7077},{5561,6116,7235,7656,8665},{5257,5635,6238,6668,7976,8097},{6147,7805,8530,8731},{5267,7198,7588,9194},{5501,6159,6297,6796,6894,7905},{5210,9012,9474,9668,9934},{},{9766},{5441,5769,7780,9110,9311,9588},{7261},{6506,7265},{6132,7107},{5278},{6434,6544,8416,9261},{5313,6608,7916,8689,9639},{5278},{5499,7735,8151,9291,9388},{5805,6402},{5326,8128,8419},{5945,7066},{6857,7126,7940,8787,9732},{8190},{6940,7403,8969},{},{5417,5636},{5555,7974,8121,9360},{5628,6087,6647,8543,9138},{5714,6371,9671},{5656,5866,8974,9644,9658,9728},{5386,6433,6645,6662},{5456,5651,6372,7840,7941,8872},{5250,6246},{6760,8110,8248,9532,9797,9858},{6229,6651,7386,7597,8628,8817},{5772,8390,8437,9437,9556},{5316,7322,9198,9419},{5432,7091,8664,9181},{7061,8082},{6001,7860,7921,9285,9710},{},{7510,8042,8392,9268,9793},{5764,6330,7629,8543,9008},{5640,9057,9797,9869},{5846,7136,7300,8394,9343,9602},{},{7691,7745,8706},{5871,7637,8808},{9265},{6692,7210,8510,8621,9915},{5823,7890},{7432,9993},{5730,6013,6402,6617,8574,9619},{6818,7630},{},{5873,6456,6833,8262,8383,9606},{6151,8331,8468},{9240},{5791,6895,8780,9312,9624,9637},{6470},{5998},{6650,6929,7867},{5919,5968,6411,6935,7247},{6438,6888,7208},{},{8310,8794},{7403},{6013,6314,6783,7427,9948},{7893,8743},{6151,6302,6494,6569,7372,9690},{},{5668,8407,8571,9088},{6572,9169,9603,9778},{5680,5960,6449,7527,7573},{5885,6265,7724,8402},{8416,9162},{},{6035,7924,8490},{5487,5984,6269,8942,9727},{6614},{},{5309,5393,5967,6930,7701},{5999,7115},{6241,6704,6800,7901,9148},{6332,6442,6578,8452,9518,9559},{5711,5881,6972,7773,9107,9291},{6742,7862,9915,9933},{9809},{9898},{},{},{6133,7150,7303,7529,7886,8504},{6853},{86,8629,8813},{6821,7117,9079},{6866,7840},{5891,8353,9079,9331,9509},{6145,6805,6884,7722,8108},{5841,6932,7175,7433,8579},{5641,6477,8029,8210,8574},{6216,7254,7295,7737,8643},{5939,8076,9076,9174},{6151,6400,7041,7222,7646,7759},{6739,9657},{6810,7128,9284,9674},{6218,8634},{},{5536,6775,8326,8410},{6766,8379,8826,8923},{5875,6778},{5354,5715,8068},{6049,6978,7997,8084},{6036,6848,7553,9541},{5404,6165,8299,8988},{5919,8704},{},{6553,7971,8030,8395},{9921},{6992,8459},{5351},{8820,9022},{6594,9352},{6040,7695,8312,8481,8613,9235},{9105,9753},{5339,6355,8253},{7259,7408,7671,8907,9232,9444},{7205,7923,8081,8167},{6187,6476,6915,9972},{6065,8039,8452},{6962,9523},{6386,6803,6855,7715},{6006,6092,6289},{5370,7353},{7319,9415},{6389,7045,8111,8396,8414,9238},{6793},{8686,9843},{6263,6977,7176},{},{6936},{6226,6260,7059,7894},{8781,9722,9934,9993},{5650,8902,8986,9209},{8271,8871},{6745,7371,8465,8835,9076,9239},{5521,6324,8059,8100,9335},{5703,6602,7323,9588,9999},{9386,9802,9957},{5695,6176,9280,9711,9770,9924},{6649,7092,8159,8938,9983},{6645},{5568,5883,5922,6031,6771,9756},{5698,6244,6587,9580},{6504,7824,8880},{6007,6349,7002,9288},{5742,6640},{5710,5842,6862,8195,8928,9672},{},{6694},{5925,6760,7957},{5508,5873,7022,7637,9377,9669},{6026,7019,7038,9083,9214},{5776,6179,8173,9056,9789},{6712,7160,8176,9585},{9409},{7067,9424},{5866,6035,6791,7155,7933,8270},{6939,9053},{6407,7422,7883,8873,9434,9961},{5587,7690,8308,9680},{9709},{5595,5844,6048,9054,9158},{8020,8101,8947},{8969,9929},{6956},{5849,6189,7219,9402},{},{6521,6567,7569,8418},{5612,5769,6474,6867,6954,9726},{},{6005,7386},{5396,7179,7306,7900,8533,8769},{6739},{7493,8017,9248},{6088,6504,8909},{5937,6022,6243,6833,7769,9359},{6122,6523,6752,7327,7739},{6836,7545,7546,8800,9004,9617},{6542,6804,6919},{8243},{5722,6878},{6148,6717,7538,7954,8459},{9444,9465},{6224,7034,8555},{8381,9321,9429},{5841,7810,9673,9749},{},{5876,6687,8232,9184,9814},{8781},{6379,8072,9897},{9278},{7311,7676},{8252},{5770,6494,6561,6660,7441,9691},{5947,6269,7879,8388,9098,9318},{6007,7150,7265,8085,8932,9018},{8777},{5848,5953,6771,6777,8100,8517},{6096,7492,8784,9256,9745,9822},{5878,5936,6048,7598},{6197,7525,7646,7785,8347},{},{},{6772,7288,8521,9451},{5496,7098,8353},{9752},{5928,6271,9455},{5732,7702,8510},{5966,5995,6778,7611},{8418,8988,9414},{5764,7808,8423},{8497},{6275,6548},{5460,5596,7253,8946},{5553,6291,6900,7269,9056},{8425,9327,9594},{8165,8675,9840},{6111,7125,9483,9821},{},{5593,7032,7033,8623},{5986,6584,8013,9079,9755},{7638,8669,9747},{},{7505,8269,9083,9885},{},{},{},{5947,6091,8311,8770,9031},{6175,6468,7752,8633,9834},{6471,7920,8860,8888,9907},{},{7146,7368,7590,7899,8074},{7025,9134,9545},{6443,7091,9903},{7244,7769,9012,9529,9974},{},{6521,6538,7200,8127,9097,9651},{5773,6146,6292,6615,6759,8593},{5663},{6136,6587,6637,9203,9650},{5796,5895,6074,6366,8375,8816},{5942,7024,7462,7742,9354,9689},{6256,7177,9361,9714},{8494,8860},{7577,9641},{7628,8615},{},{6647,7127,9052},{6697,6945,6952,8674,9909},{6293},{7229,9752},{},{5990,7827},{5494,5860,6505,6612,7092,9549},{6207,7864,9532},{8544,8797,8851},{6991},{7157,9275},{5750,5933,5976,6964,7756,7843},{9628},{8483},{5692,7503,7530,9652},{},{9857},{},{5696,7443,7475,8105},{7193,7260,7458},{6942,8071,8906,9628,9669,9956},{8508},{7221},{6894,7233},{},{6964,7547,8714,9816},{5886,5943,8046,8458,8483,9936},{5915,6614,8644,8878},{6571,7008,8432,8872,9790},{8925},{},{5715},{6577,7222,7793,7861,8831},{8070},{5662,6043,8951,9276},{911,8235,9475,9780},{6437},{5817,8069,9964},{7457,9786},{6652,7163,7417,9741},{5850,9311},{7559,8225,8227,9259,9499,9507},{},{},{},{6691,7246,7537,7539,9381},{9346},{8237,8373,8623},{7743},{9143},{7888,7980,8191,8868,9876},{9165},{7728,9668},{6210,8203,8814},{9499,9709},{9968},{},{6263,6377,7766},{},{5880,7569,8530,8830},{7852,9419},{8520,9074},{6473,6737,7735,9830},{5999,7268,9332,9381,9964},{6343,9195},{6203,7773,7809,8010,8030},{6980,7349,7790,9122},{6499,7895,8058,8402,8761,8902},{6839,8538,9677},{5957,7325,7521},{8286},{7070,7114,8164},{6182},{4474,6279,8329,9165},{6191,7155,8286,9091},{},{6354,6448,9259,9410},{6829,7314,8572,8909,9025,9126},{},{},{6351,6541,7823,8315,9836},{5729,6538,7442,8142,8289,9122},{},{7549,7911},{6532},{5614,5751,6290,7098,7671,8074},{6929,7555,7596},{7219},{6699,7585,8419,8594},{6238,9345},{},{6983,8240,9045},{},{9797},{},{5925,7957,9024,9513},{6100,7131,7453,7724,8011,8402},{5937,5978,6159,8261,9577},{6126,6513,8170,8474,9007,9952},{5793,6242,9141},{5827,6421,7378,7964,8236},{5634,7225,7856,7948,8596},{5659,6931,7659,7902,8334,8584},{5956,6240,7035,9107},{5577,5602,6553,8422,9033,9389},{},{9761,9803},{5770,6511,6522,6739,8731,9215},{},{5820,8438,9918},{7762,8218,9875},{5574,7164,8265},{6250,7325,8678,8789},{5619,7769,7876,9091,9811},{6395,7086,7226,8350,8499,9163},{5870,5907,6456,9445},{5711,6251,6298,8270,8690,9003},{5656},{7775,9145,9420},{8132,8238,8918},{5821,6496,7793},{8479,8934},{6640},{6456,7426,7483},{9719},{5989,6122,8285,8599,9072,9284},{5597,6553,7325,7623,9395,9448},{9723},{},{5731,6315,9506},{8775},{},{5969,9278,9709},{6119,7312,8055,8168,9309},{6924,7047,7172,7541,7835,9852},{6042,6875,8411,9211,9375},{6454,7518,9877},{},{5952,6140,6849,8385},{7354,7801,7843,8036,8767},{},{6489,7203,7634,8563,8716,8777},{},{5733,6074,7519},{6317,6598,7869,7928,8687,9547},{6069,7295,8212,8737,8945},{5735,7942,9621},{},{},{5811,5951,7957,8444,8968},{6793,8138,9044},{4400},{5758,5997,6262,6634,7002},{},{},{6202,6393,6569,7795},{1486,5837,6664},{5678,6863,7162,7232,9514,9952},{8807,9554},{7121},{9858},{7444,7528,7643,8179,8646},{6100,7510,8150},{5688,7338,9116,9392,9400},{5734,6691},{6265,6743,7057,8309,9007,9217},{6823,7148,8256,8462,8896},{6583,6945,7081,8131,8743,9108},{},{5640},{7704,8150,9132},{9632},{6160,8068,8503,9384,9670,9968},{6422,7576,9871},{9187,9452},{8161},{7740},{},{5837,7897,8865},{6028,7262,8228,8694,9938},{7833,8532,9193,9213,9250,9966},{7901,9498},{},{8639,9624},{},{5774,9341},{6071,6579,7880,8935,8959,9315},{6658,7002,9797},{6622},{6402,7317,8094},{7894},{5683,6039,8165,8267,9267,9978},{5853,6318,7285,8175},{6034,6688,7611},{6962,7754},{5701,7748,7805,8822,9184},{6740,8105,9095,9638},{},{},{5800,7047,7195},{7483,7701,8407},{1179,6698,6865,8768},{7470,7800,8707,9656},{6549},{6407,6505,7371,9887},{7967},{6753,7230,8393,9140,9633},{},{7368,9835},{8455,9367},{7228,9023},{5688,6721,9319},{8860},{6565,6666,6954,7096,8908,9050},{},{7152,9537},{6234,7320,8594},{8574,9685},{6794,8151,8592,8841,8893,9909},{6721,9238},{6346,6436,7628,8116,9769},{6014,6717,7066,7725,9757,9978},{7011,7619,7853},{6085,6831,7990},{6586,7071,7934,8432,8929},{6794,6917,8675},{6338,7193,8119},{7240,7242,8078,9470},{6740,7320,7808,8899,9334},{6441,7908,8041,8551,9482},{5691,7043,7429,9723},{5941,6142,7376,8614,8747,9283},{5901,7517,8184,8501,9001},{5908,8167,8957},{9240,9589,9822},{7053,9570},{5935,7110,7384,9981},{6439,7320},{},{6813,8392,8916,9947},{},{6675,6744,7009,7361,8847},{6182,8650,8694,8941,9979},{},{6804,7127,7814,8296},{5828,6969,7878,9137},{7666,9621},{6076,6214,6248},{7810},{7336,8166,8995,9871,9991},{6298,7248,7365,7863},{6121,6636,6902,8177,8871,9538},{7907,8362,9214},{5793,6998,7671,8564},{7210,7222,7384,7492,7779,9648},{6155,6665,7162,7882,8283,9162},{6009,6223,6237,6744,8452},{5835,6159,6383,8612,9246},{6161,6911,7217,8431,8729},{6044,7348,8571,8812,8894,8969},{6719,7468,8312,9376,9634,9793},{6631,7324,8231},{7957,8521},{7746,9915},{8665,9285},{7886,8734,9131,9311,9445,9503},{5847,8902,9909},{5796,6442,6549},{6369,6520,6533,6822,9419,9837},{7383,9007,9661},{7194,8199},{},{9988},{6137,6417,6685,7810,8054,8246},{6606,9870},{7720,8154,8310,8787,9070},{5961,6458,6593,6712,8859,8895},{6387,7615,8109,8207,9429,9790},{6734},{6678},{6457,6587,6989,7056,7337,7437},{5815,5820,6535,7117,9756},{7602,8787},{},{7205,9839},{},{8078,9268},{8087,8168},{7052,7765,8899,9041,9824,9894},{6129,6904,8664,9002,9231,9984},{6187,7598,8142,9055,9815,9941},{8153},{6335,7033,8551,9203},{5788,8026},{6131,6350,6785,7025},{5929,6945,7483,7721},{5983,6142,7988,9653,9830},{6606,6655,7090,7484,9788,9929},{6298},{8373,9667},{5830,6774,7179,8758,8900,9105},{5803,6852},{},{7718,8110,8968,9244,9836,9912},{5272,8417,9785},{8340,8413,8580,8643},{7159,7283,7449,9216,9430,9526},{5775,6398,7869,7920,8803,9793},{6231,6376,7213,7554,7732,9443},{7784,7785},{6994,7896,8458,8870,9054},{7902,8346,8604,9952},{8226},{},{5787,9128,9169},{7082,7312,8161,9251},{6367,7334,8328,8814,9208,9261},{5840,7736,8294,9312},{6737},{6215,9271},{6313,9285,9410},{8361,8452,8497},{5787,6772,7567,7651,7917,8256},{7246,7767,9068,9312},{6342,6597,6783,8434},{7033,8891,9732},{7574},{6094},{6258,7952,9482},{6520,6608,9424},{7170},{},{5985,9424},{7224},{},{7061},{8687},{8919,9544},{},{7527,9803},{6027,6066,6615,7382,8093,9899},{},{8110},{6132,8926,9889},{6262,6707,7438,7629,7782},{8652},{7312,7548,7956,8400,9038,9150},{8322,8623,9585},{5828,6838,7423,7483,9401,9786},{9405,9888},{6693,8068,9353,9505},{8005,8113,9765,9908},{7021,8535,9046},{6111,6521,6679,7484,8417},{5840,6193},{6173,9088},{6537,7153,7287,8671,8930},{6177,6770},{6047,6621,7476,8362,8613,9140},{6070,7057,9683},{6587,6911,8177,8694},{8572,9066,9327},{7064,7105,8424,9724},{7644,7956,8542,8819,9833,9917},{7355,7535,9125,9454,9507},{6063,6413,6462,7366,9997},{3146,6323,6477,7372,8519,9046,9875},{6130,6707,8234,8514,8884,9891},{7520,8268,9060,9311,9516},{},{6812},{6095,6304,7212,9479,9590,9858},{7549,7730,8112,8170,9303},{7424},{6088,7328,8332,8753,9200,9479},{9155},{6246,7579,7692,7797,8314},{},{7630,8060,8369,8991},{8336,8558,8936,9441},{7000,9114},{},{6380,6384,7640,8063,9308},{6413,7496,7831,7936},{6242,6597,6645,7138,8858,8940},{8301},{6770,6899,7237,7975,8317},{8220,8379},{9649},{6679,6841,7495,9618},{6458,7347,8241,8552},{6129,6436,6959,8513,8960,9102},{5958,6870,9424},{9837,9965},{},{6121,8280,9555,9669},{6998,7023,7741,7806,7887,8239},{},{6203,7287,8447,8738,9947},{7530,9288,9362,9443},{6759,7879,8004,8412,9700},{6065,6195,7451,9331,9394},{6502,7632},{7524,7882,9078,9358,9962,9997},{6143,9402},{6322,6513,7075},{6258,7234,8622,9078,9726},{6281,7148,7940,8626,8662,9402},{8067},{6782,7208,8101,8383,9404,9714},{},{8332,8453,9255,9741,9995},{7091,8662,8843,8919,9130,9638},{7347,7359,9461},{4643,6509,8134},{8025},{6698,8449,9385},{6106,6556,7882,8718,8765,9345},{9683},{6094,6115,8938},{6099,6612,7172,8162},{6506,7593,9047},{5941,7237,8370,8805},{9070,9609,9822,9840},{6445,6573,7309,8486,9286,9601},{7142},{7767},{7326,7466,7580,8403,8777},{6036,6142,6220,7962,8065,9560},{6074,7311,8028,9334,9960},{9356},{8969},{6726,6866,7215,9652,9700},{7619,8266},{6672,7320,7666,7913,8795},{7633},{7970},{6023,8352},{5951,7111,9358},{2662},{6028,6749,7039,8692,8901,9108},{},{6413,7448,8704,9554},{6521,7061,7567,7817},{5967,7843,7906,9129},{6125,9925},{6171},{6109,7146},{5934,9329},{6252},{6110,7586},{7052,7993,8416,8531,8768,9335},{6434,6640,7132,7667,9365},{6488},{6904,7094,9348,9660},{},{6174,6255,6272,7069,9468,9541},{},{},{6042,7751,8478,9466,9746},{6782},{6302,6503,9861},{7586,8301,9844},{6400,8310},{6324,7101,8742,9915},{5950,9132,9210,9252},{},{6764,7186,7862},{6358,6675,6949,7168,8627,8629},{6778,8026,8117,9050,9186},{6185,7990,8390,8610},{6147,9603},{7581,8516,8581,8595,8923,9023},{9649},{6278,6432,8569},{6283},{6164,8425,9874},{5959,7381,8003,9539},{8700},{7033,7680,8367,9619},{7126,8902,8905},{7077,7428,8980},{6191,7174,7500,9144,9230},{6117,7051,8697,9451},{8097,9147,9348},{5995,6703,6768,8809,9570,9834},{6384,6442},{},{},{5955,7900,8027,8309},{6510},{6415,6712,8553},{6893,8974,9149,9989},{},{6178,7906,8234,9049,9255},{7102,8784},{7884},{6883,7275,8964,9055,9456},{7848,8109,9481,9922},{},{7925},{8162,8180,9311},{6857,7174,7498,8993},{},{8482},{6519,7597,8676,9058,9601},{6362,6646,6845,6957,7681,8385},{6408,6980,8993},{6176,6407,8259,9004,9158},{},{6114,8754,9221},{6800,8295,8775,8940,9721},{7685,8566,8698},{7785},{7663,7670,7750,8354},{6281,6738,6848,8366,9138},{},{6322,7831,8066,9090},{6291,6347,7055,7065,7624},{6195,6653,8145,9025,9469},{6036},{7675,7746,9063,9190},{6115,8146,8653,9224},{6046},{6394,7480,8099,9199,9347,9647},{6227,7820,7921,9297},{8224},{7003,7541,9992},{9422},{6429,7154,7482,9105,9339,9649},{5997,6311,6510,7673,8631,8768},{},{6027,6572,8375,8922},{6055,6152,7806,9682},{6189,8392,9686},{},{6205,6820,7217,8580,9637},{6498,8214,8288},{6234,7003,8106},{},{6172,6216,6456,8272,9311},{6102,6798,6850,7712,8423},{6261,9882},{6511,6794,8055,9128},{6696,8696,8795,9884},{6587,7492,8472,8750,9110},{},{7317,9086},{6338,6468,7910,8067,8218,8530},{6905,7476,7549,9274},{7006,8121,8509,9647,9768},{6181,7288,7873,8692},{8320,9689},{7283,7368,8108,8450,9724},{6786,7430,7468,9985},{9738},{7763},{},{},{7399,7571,7802},{},{6703,7645,8785},{6607,9052,9421},{6778,6848,8590,8956},{6108,6244,7038,8730,9896},{1489,6900,7418,7994,8009},{8667},{8948},{6739,8718,9297,9462},{6119,7828,8223,8542,9696},{6743,7516,8064,8242,8357,9681},{6289,7400,8232,8408,8803,9659},{6335,8295},{6049,8450,8982,9359,9748},{8213},{},{7418,8431,8874,9634},{6931,8140,8657},{7052,7436,7537,9419},{7112,7333,7379,9063,9903},{7754,8799,9339},{6185,6370,7815},{6456,7741},{},{9451,9674,9962},{6819,7308,7768,8184,9703},{6059,6096,6568,9438,9682},{6766,7576,9978},{1957,6820},{7820,8391,9267,9922},{},{},{6436,8913},{6713,7111,7605,8213,8573},{7785,8566,8933,9206},{7174,7411,7556,8596,9171,9818},{6176,6786,7346,8905},{6256,7238,8381,8705,9024,9799},{6896,7542,9253},{},{6919,8629,9258,9264,9500,9911},{7914,9516},{3234},{6276,6600,6750,7585,8483},{9366,9720},{6667,6940,7418,8630,9950},{3766,7694,8530,9198,9908},{6086,7147,7318,7831,9389,9824},{7262,8588,8861,9848},{6677,6968,8271,8763},{},{},{7215},{6686,6830,7362,8781,9106},{6582,8228},{7304},{9610},{6740},{7445,8973,9275},{8227},{6872,8089,8100,9760},{7057,7123,8043,8417,9196},{8424,8630,9066,9168,9763},{6366,7267,8201,8638,9660,9814},{7011,7797,8632,9057,9183},{6296,7711,8526,8648},{6630,8390},{},{},{7458,8611,8637,8930,9458,9511},{6247,6464,6578,9654},{6185,6714},{6541,6620,7135,8724},{9149},{7953},{},{},{7739,8796,8901,8994,9348},{7439,7814,8474,8865,9310},{6166,6415,8274,8398,8874},{7540,9170,9729},{7144,8920,9675},{6435,8371,9017,9193,9310,9475},{6246,6342,9141,9254,9576},{6216,6293,6349,7072,7364},{9447,9829,9909},{7033,8418,8543,8832,8990},{6832,6953,7490,9571,9637},{},{6975,7051,8073,8402,8987,9167},{},{6529,6537,6611,7798,8157,8995},{6290,9853},{6853,7958,7961,7979,8692,9556},{6542,6817,8739},{7073,7949,8348,8688},{7600,8438,8770,9577,9723},{6349,8766,9059,9451,9515},{8484,8741},{6590,8423,9027},{6511,6752,7372,7479},{},{7763,9320,9682,9977},{6558,6876},{7248,9255},{9473},{6734,7140},{6742},{9935},{6137,6543,8023},{7031,8104,9648,9688},{6147,6733,7734,7832,9548,9730},{6386,9241,9421},{7618,7624,8909},{6579},{6443,6755,7541,7737,8139,8375},{},{7280,8766,9607,9731},{},{},{},{8105,8840},{6861,7980},{6291,6346,8058,8248},{},{6772,6992,7774,8202,8663},{},{7193,7889},{9334,9753},{7440,7578},{7527,7908,8405,9086},{7531},{6733,7952},{7372,8445,9322},{6689,7961,8124,8807,9993},{6164,7553,8801},{},{7941},{},{6303,7115,7190,7559,8800},{6511},{6739},{6244,8503,8848,8855,9688,9992},{6329,6836,6936,7259,7768},{},{6866,8116,8581,8849},{8226},{},{6580,7141,7402,7650,7882,9463},{6410,6528,7214,7982,9273},{6345,7830,8424,9416,9545},{6331,8649},{8130,8886,9861},{6197,6341,8799,9648},{7362},{},{7594,7639,7998,8986,9041},{3408,6388,7018,9012,9600},{8005},{6335,6681,6714,7180,9633},{},{8625,9443,9722},{},{6896},{6575,7037,7114,9702},{8770,9421},{},{8294,8303,8680,8932,9726},{6685,7115,8118,9354,9393},{},{},{9964},{6701,7707,9337,9500,9919},{6421,7972,9529},{9053,9682,9792},{7556,7606,8426,8661,9520,9982},{9618},{6694,6941,7022,8931,9089,9163},{6206,6373,7249,9556},{6299,6561,7226,8630,8960,9028},{8898,9415},{6817,8650,8724,9662},{},{6462,6551,6685,8323,8590,9608},{6229,7387,7713,9522,9744,9964},{8382},{7566,8569,9083,9133},{7035},{7732,8076,8746,9133,9478},{7734,8536},{6915,8505,9315},{8671,8787},{7241,8335},{7810,8761,9163,9954},{8355,8673},{6247,9557,9680,9693},{6611,6823,8413,9433,9968},{6945},{6433,6519},{6528,7033,7387,9071},{6974,7715,8072,8357,8541,9423},{6538,8381,8403},{6556,7125,7327,9487,9961},{7406,7465,7502,7984,9428,9828},{},{6285,7472,9157,9404},{7493,8084,8453,8682,9199},{6814,6843,9294},{7244,7784,7918,7931,8398,9081},{6578,6691,7764,8371,9733},{7564,8332,8598,8711,8784,9444},{6668},{6709,7006,7318,7884,7961,8875},{8241,9376,9866},{7683,8808,9407},{9099,9264},{6818,7015,7463,8580,9666},{},{7712,9643},{7403},{7588},{6337,7361,8076,9826},{6256},{},{6289,7523,8725,9115},{6781,7365,8381},{6286,7134,7546,9234},{7154,7494,7839},{8468,9622},{7331,7362,7857,8052},{7286,9149,9694},{9044,9216,9611,9746,9859},{6505,9108},{6963},{6368,6514,6735,7054,8917,9653},{6524,6616,7077,7339,9348},{6593,6921,7154,9102,9529},{8759,9348},{9822},{8322,9783},{7383,7399,8060,8770,8785,9177},{},{},{6983,7584,8868},{6281,7278,9395},{6382,7801,8667,9889},{7423,9471},{6550,6698,9212,9644},{},{7993},{6685,7385,7908,9664},{},{8986,9756},{6559,7646,8150,8424,8606},{7040,7363,8137,8819,9552},{6687,7542,9468,9551,9769},{6803,7020,8491,9309,9337},{6488,6610,7304,7943,8454,8524},{6303,6430,8832},{6455},{8035,8263},{6615,8594,9009},{6373,8044,9141,9225,9473},{},{6913,7499,7622,8694,9232},{7044,9277,9523},{7932,8150,8219,9871},{7292,7485,8402,8487,9160,9169},{6423,7182,8700},{},{9500,9636},{8619},{7801,7948,8910},{7237,7771,7969,7975,9010,9494},{},{},{7849},{6486,9098},{7799,7921,8475},{6413,8756,8868,9867},{7313,7674,7951,8792,8871,9776},{8266,9022,9222,9876},{6565,7260,7604},{},{6886,7078},{7281,7366,8056,9257,9636},{},{6802,7428,7536},{6647,6765,7401,7866,8853},{9219},{7492,7504,7766,8450},{9399,9913},{6441,7551,7925,7930,7980,8263},{7616,8864,9255,9776},{7593,8281,8817,9428,9526,9924},{6439,9218},{6516,8690,9070},{7121},{7260,8280,8752,9722},{8357,8975,9488},{7315,9065},{9103},{6636,7609,7715},{6883,7436,7479,7497,7618,7702},{6871,7107,8970},{7015,7069,7073,8791,9664},{7316,8304,8437,8684},{6936,8626},{9506},{},{8263,9151},{7800,8056,8637,8926,9019,9254},{},{7477,8239,9364},{6410,7250,7394,8884,9050,9635},{8115},{9417},{6404,7139,7284,8923,8940},{8638},{6664,7562,8676,9000},{},{6591,6659,6849,7704,9833},{8150},{7283,7689,8638,9403,9519,9734},{6392,6409,6765,7891,9060},{7369,7536,7631,9300,9565},{},{7619,8519},{6852,8877,9016,9047,9861,9882},{6844,6861,7017,7214,9774},{9465},{7359,8054,8527,9293,9614,9873},{6968,7942,8347,8870,9339},{6791,8255,9233,9586},{7600,8030,8180,8553,9783},{8498,9323},{6380,6463,8043},{6475,6676,6695,8433},{7161,7383},{8057,8243,8427,8631,8641,9762},{6812,7507,8732,9216,9939},{7958,8896,9304,9934},{7443,7523,9134,9742},{},{},{},{7128,7835,9600},{5134,6500,6715,7171,8480,9989},{6660,7073,8475,8966,9694,9864},{7078,7597,8080,9553,9851,9875},{8744,9203,9260},{},{6838,7394,9056,9265,9607,9911},{9011},{},{7730},{6664,8165,9318},{6634,8774,9543},{6421,7190,9599,9757},{7555,7756},{6743},{7291,9503,9768},{8896,8908},{8594},{9328,9540},{6768,8213,8599,9417,9911},{6997,8751,8812,9424},{6702,9034,9036,9181,9907},{8897},{7132,7895,7919,9218},{7182,9066,9584},{8046,8188,8605,8711,9208},{7690,9444},{6657,7231,7889,9051,9399,9926},{6771,7949},{7086,7210,7920,8481,8584,9439},{7479,9048,9107,9833},{6682,8535,9075,9256,9529},{7315,7946,7974,8081,8207,8677},{},{8106,8791,9071,9761},{8014},{},{6922,7026,8790,9914},{},{},{7033,7043,7205,9012},{6962,7268,7361,7974},{7857,8246,8980,9488},{6492,6520,7586,9714},{6784,9410},{8054,9209,9384,9957},{},{6467,6650,7762,8431,9224},{7047,7621},{6465,7588,8186,8999,9497},{7292,8778,9197,9842},{7310,7437,8160},{6495,8125,9351,9519,9783,9807},{8632},{8564},{8195},{6854,7245,8982,9418},{6986,7673},{},{},{6755,7138,8749,8751,9717,9818},{9157},{6588,6754,7932,8233,8925,9783},{7066,8429},{8067,8776},{7134},{7530,8338},{},{7719,8241,8608,8775,8895,9298},{6508,6652,7194,7589,9481},{6642,7088,8030,8767,9728},{6462,7366,7845,8041,8279,8408},{6550,7160,7764,7875,8787,9922},{7225,8383,9577,9749},{},{7900,8336,9116},{7308,7949,8982,9328},{6935,7724,8058,9622,9901},{6890,7038,7842,8383,8636},{7439,8328},{6732,6760,7336,9162,9404,9632},{7290,8991,9495},{8646,8987},{8609,8793,9414,9419,9541},{6510,6820,7904,8545,9777,9906},{},{7920,7948,8641,8673,8926,9368},{7589,7918,8335,8447},{6997,9636},{9254,9567,9600},{7193,8479,8848,9339},{6801},{7145,7602,8476},{7506,7576,8020,9157,9595},{},{8279,8837,9114,9371,9555,9962},{6815,6935,7801,8225,9283,9717},{7556,8464,8743,8913,9470,9584},{6607,7098,7358,9996},{7010,7087,7720},{9456},{6752,7491,8405,9567},{6540,7731,7928,9904},{},{6589,9031,9992},{},{},{6930,7025,7099,8015,9839},{7758,8601},{7499,7918,8885,9953},{8093},{7887},{7740},{7805,8536},{},{},{},{7473,7807,7995,8210,9795},{8227,8503,9755},{},{6515,7219},{6491,7866,8957,9777},{},{7134,7878,8454,9010,9877,9980},{8296,8498},{7961,8100,8500},{9879},{},{},{8305},{8111,8804},{8194,8214,8240,9284},{6816,7280,7619,8248,9154,9794},{8351},{7262,7602,8581,9367,9960},{6796,7210,7463,8980},{7849,9176,9654,9942,9943},{},{6769,8689,8749},{7461,7971,8318,8543},{6649},{6997},{6881,7665,7803,7903,8515,9459},{6549,7674,8656,8679,8873},{7023,7917,9244},{6796,6883,7123,7139,8403,8939},{},{7075,7216,7415,7627,7637,8286},{6884,7676,8446,8534},{7220,7640,8031,8237,8468,9410},{7286,7576,7701,8923},{8508,8551},{6524,7212,8358,8479,8854,9468},{6953,7854,8155,8759,9353,9664},{},{7693,8515,8723,9272},{6778,7478,7551,7851,8227,9692},{6942,7540,8285,9372},{6980,7224,8234,8493,9346},{6962,7968,8243,8375,8476,8928},{7278,7528,8006,8478,8516,9402},{8531},{7735,8163,9904},{8379,9083,9760},{7980,8377},{6843,6901,9402,9453,9722},{7706,9371},{6747,7314,8216,8779,8885,9948},{},{6942,7722,8206,8246,9209},{6613,6724,8154,9855},{},{7253,8568},{6764,8406,8679,8987,9875},{7805,7929,8905,9313,9784},{8374},{},{},{7316,7358,8047,9292,9591},{6642,7442,7766,8081,8151,9426},{7255,7404,7660,9447},{7997,8165,9828},{8343,9866},{6557,6576,6655,7761,9005,9283},{6593,8942},{7006,7552,7951,8123,9164,9454},{8123,8200,9361,9364},{7466,8543,9533},{8467},{7084,7482,7598},{6637},{8043,8604},{8683},{7197},{6675,8172,9349},{7016,7081,7158,8112,9378,9623},{7822,8011,8095,8456,8767},{6568,8096,8554,9867},{7249},{7157,7206,7477,8546,8968,9969},{6960,7605,7679,7682,8043,8189},{6689},{7813,9169},{6766,7007,7816},{6609,8105,8587},{7255,7583,8068,8144,9449},{},{},{6821,7965,8452,9379},{7710,7831,7967},{7134,8227,8556},{7403,7411,7687,9927},{8307},{8250,9179,9821},{7212},{},{7150,8449},{6812,7111},{7542},{8089,8959},{7656,8469,8626,9589,9672,9993},{},{8224,8552,9331},{},{6955,8281,9302},{7384,7744,8088,9350},{8631},{7431,9242,9674},{8379},{},{7081},{7873},{6707,7454,7509,8206,9111,9546},{6710,6730,7895,9105,9635},{7679,8391},{6752,7351,8116},{},{8147,9000,9804},{7273},{},{6671,6859,7519,8461,8846,9141},{7748,7789,8201,8360,9614},{8398},{},{7317,7472,7695,7899,8710,9350},{8939,9389},{7483,8588,9037,9914},{7199,8525,8596,9775},{7937,9142,9385,9505,9611},{6801,8901},{6632,6638,8722,9300,9523,9739},{7986,8031,8373,9360},{6690,7540,8378,9810},{7038,7045,7713,8651,9682},{7178,8481,8778,8890,9631,9741},{7985,9031,9946},{9751},{6671,6947,7767,8952},{6797,7176,8202,9461,9847},{8656,9012,9827,9845},{},{7087},{9526},{7790,7850,8574},{8047,9735},{7385,7642,8025,8272},{8324,8693,8866,9325},{},{7884,7949},{6784,7404,8491,9030,9116},{6919,8914},{8285},{7916,7973,8753},{9134},{},{},{7274,7833,8693},{8285,8499,9274,9303,9620},{7878,8479,8626,9799},{6892,9633,9649,9965},{},{9292},{6798,9601},{7678,7939,8287,9799,9868},{},{},{8258},{},{8722,9679,9803},{8604,8688,9380},{7045,7367,9216},{},{7014,7071,7184,7847,8010,8084},{6758,8111,8132,8433,8790},{6984,7307,7323,7508,8781},{7240,8009,8798},{7207,7233,7561,8736,9274,9866},{7231,7742,9395,9630},{7560,9524,9929},{6887,7034,8951,9255,9738},{7248,7543,7683,7855,8992,9063},{6831,8053,8170},{6925,7100,7726,8867,9457,9508},{},{},{7167,7571,7719,8582,8587,9882},{6764,7072,7740,8043,8525,9621},{},{9142},{6781,7852,7910,8516},{6767,6966,7440,9279,9834},{7133},{7725,7964,8023,8975},{8889,9297},{6970,7666,9329},{8172},{6755,8373,8435,8683},{8281,8354,8778,9134,9372},{7019,7506,7896,9590},{7458},{8823,8908,9363},{7157,7676,7778,8157,9759},{},{7439,7595,7599,7650,8655,8792},{7528,8394,9402,9707,9917},{},{7625,7781,7872,9101,9809,9859},{7384,7388,8565,9163,9573,9614},{7206,7265,7805,9115,9218,9993},{6931,7393,7485,8505,8722},{8074,8317,8890,9463},{8775,9858},{8429},{},{7457,8472,8926},{8936},{7910,8273},{6817,8715,9502,9648},{8001},{7587,8527},{6955,9774},{6935,9834},{},{7026,8354,8380,8841,9501,9854},{8649},{},{9153},{7854,7965,8372,9886},{7128,7230,7881,9167,9293},{7886,8116,9531},{6933,8771,9699},{},{6892,8367,8380,9004,9390},{9799},{},{},{6908,7929,8253},{6892,7394,7509,8068,8689},{3145,6730,7789,8101,9308},{7155,8157,8875,8942,9744,9864},{8569,9721},{7620,8525,9870},{7443,7552,8107,8742,8856,9716},{8223,8598,8934,9512,9966},{},{7005},{7014},{},{7744},{6853,7423,7573,7783,8186,9494},{7160},{7000,7291},{7107,7447,8724,9322},{7962,8896,9713,9788},{7315,9399,9859},{},{8565},{7033,8088,8729},{},{8209,8648},{8309,9194},{7906},{6821,7734,7751,7759},{6895,7418,8248,9804},{6757,8425,9130},{7809},{7601,9662},{},{},{7183},{9101,9336,9360},{8354,8443,9201,9425},{8108,8672,9731},{9323,9472,9530,9731},{8022},{7170,7325},{7850,7963,8203,9333},{6950,8118,9146,9147},{8267,8738,8755,9070,9349},{7766,7812,9467},{7295,9243},{},{7059},{},{7252,7391,7707,8175,8266,9366},{7791},{},{7012,8125,8821,9792},{8626,8851,9946},{7121},{7748,8455,9123,9316,9881},{8779},{7301,7552,8260,8552,9451,9497},{9008,9914},{7313,7908,8131,9218,9697},{6882,8878,9335},{7892,9875},{7172,8133,8421,8498,9636,9857},{6993,8363,8697,9393},{8999,9325},{7379},{7148,7871,7873,7883,9596},{},{7331,7767,8489},{6827,8100},{7637,7663,9177,9391,9971},{8710,8884,9169,9764},{7268,8767,9172,9467,9584},{7288,8063,8222,8931},{8981,9026},{7283,7678,9517,9549,9752},{9360,9961},{7804,8829,9339},{7056,8623,8749,8857,9808},{9517,9802,9960},{7658,8178,8660,8896,9456,9530},{7007,8099,8763,9818},{8197,9190,9387,9738,9823},{8177,8228,8747,9517,9606},{6828,7358,8333,8454,9100,9244},{6841,7765,9279,9540},{6886,7378,7890,8093,9965},{},{7156,7976,9139,9479,9706},{7158,8183,8426,8571,8666,9054},{7174,7360,7671,8077,9062,9691},{7697,9394,9974},{6846,6863},{6970,7558,7728,8888,9024,9569},{7276,8489,8763,8903},{},{7755,7960,8460,9918},{7069},{7305,7530,8212,8470,8504,9473},{6884},{7617,7758,8674},{8340,8985,9194},{},{},{6907,7151,9059,9399},{7225,8772,8987,9576,9863},{9335,9512},{7828,9166,9286},{8248,8671,9211,9345},{},{},{6916,7901,8042,8184,8765,9045},{6926,7198,7297,8585,8588},{6870},{9631},{6876,7011,7780,8473,9159,9878},{7111,7801,8103},{8314},{8070,9071,9215,9438,9803},{6874,8067,9834},{},{7766,7852,7916},{},{7132,8348,9326},{8782,8792,9108,9611,9829},{7306,7425,8283,8542,8621},{},{9143,9574},{6880,7233,9912},{8004,8087,9180,9870},{8026,8634,9034,9536,9678},{6878,7199,7632,8629},{7640,7930,8094,8644,9638},{7143,8285},{},{8263,8502,9761},{7329,7867,8170,9024,9896},{7213,7762,7829,7963,8188,8750},{7650,8766,8997,9463},{9253,9270,9478},{7871,7881,8121,8630,8983},{8312,9191,9616},{7037,9528},{9220},{7611,8138,8800,8914,9984,9998},{6885,7546,7599,7809,8355,9259},{7095,8240,8473,8476,9431},{9156},{6872,7503,8829,9360,9913},{7285,8392,9478,9659},{7615,7922,9118,9488,9576},{},{8079,8256,8772},{7096,7167,7699,8089},{7024,7971,7976,8476,9850},{7175,7352,7644,8194},{7335},{7020,8331,8395,8482,8935,8950},{6958,7409,7879,8268,8974,9130},{7677,8293,8328},{8254,8592},{7099,9544},{9440},{7667,8907,9492},{6984,7524,7818},{8763},{},{7545,8987,9145},{6895,7075,7859,8652,8776,9402},{},{7755,8525,9022,9158,9644},{9864},{7388,8567,9120,9873,9947},{7106,7265,8518},{7257,8648},{7998,9907},{6971,9329},{9198},{7344,9661},{7749,8371,8981},{8440},{},{6922,8324,8438,8665,9218,9336},{7319,8312},{7131,7500,9269,9712},{7597,7703,8264,8976,9828},{7152,7882,7943},{9710,9985},{8706,9140},{7040,8817,8874},{7539,8047,8423,9587,9848},{6928,8023,9359,9462},{7221},{},{7323,7356,8003,8392,8918},{7254,9320,9519},{},{8221,8380,9197,9335},{7253,7925,8106,9835},{7041,8846,9035,9395},{7249,8627},{9809},{7682,7836,7998,8453,8803},{8306,9393,9748,9868},{8407,9256,9307,9665},{8599},{6966,8000,8877,9246},{8204,8617,9837},{6998,8549,8893,9020},{7566,7641,7771,8155,9494},{7862,8327,8797,9908},{7746,8602,9236,9247,9876,9941},{7061,7210,7281,7399,9106},{7302,7348,8703,9067,9237,9768},{8790},{},{9437},{},{7905,7983,8564,9285,9569},{6963,7355,8445,8919,9497,9534},{7056,8520},{6975,7925,8682},{7010,7214,7925,9569,9942},{7788,7981,8852,9643},{7185,7900},{7042,7409,8959},{7334,8926},{7224,8231},{8194,9466,9477},{7830,9692},{},{6991,7575},{8884,9867,9927},{7465,7764,8192,8293,8794,9686},{8593},{7029,7142,7465,8535,8630,8840},{},{7011,7424,7787,8043},{7555},{7326,7544,7963,8461,8498,9160},{9716},{8606},{7178,7264,7469,7951,9343},{},{7490,7747,8735,9006,9240,9872},{8748},{7972,8079,8951},{8536,8713,8726,9848,9927},{7794,8501,9708},{8348,8755,9105},{9083,9215,9435,9647},{7290,8236,8585,9134,9276,9448},{7725},{7525,8235,9074,9171,9756},{7560,7635,7956,8908,9183},{7274,7578,7746,7799,8050,8839},{7516,7701,8467,8942,9865},{7517,8702,9361},{},{7758,8094,8239,8519,8750,9049},{7406,8287,9960},{},{7907,8946},{7854,7875,8207,8737,9518},{8988},{7563},{7289,7514,9432},{7326,7507,7980,8871},{},{7446,9171,9597},{7565,7766,7892,8506,9522,9554},{9096,9224,9503},{7712,9446,9485},{},{7159,7477,9043,9457,9537},{9994},{},{8234},{7893,8745,9110},{7555,8904,9304},{7527,7780,7849,8296,9317,9966},{7478},{8149,8287,8974,9623,9758},{7128,7289,7343,7428},{3949,7747,7920},{7136,8009,8238,8753,8837,9116},{8739,9769},{7288,7565,9393,9696},{7802,9333},{7800,7834,8911,9702},{7629,9130},{7155,7597,9001,9554,9878},{8129,9721,9910},{7232,9848},{8590},{8008},{},{7034,9752,9921},{7130,9446},{7764,7802,9350},{7694,8697,8890,8902,9358,9380},{8057,8232,8533,8867,9366},{7231,7464,8464,8959,9424},{8794,9112,9375,9542,9663},{},{8829,9994},{7039,9807,9939,9966},{},{7648,7700,8375,8674,9261},{},{7785},{9660},{},{7426,8056,9948},{7142,9326,9572,9969},{9596},{7668,8207,8387,9483},{7589,7679,7741,9687},{7245,8101,8570,8933},{7079,7528,7598,9166,9224},{7745},{7506,9654},{7090},{7315,8100},{},{7565,8349,9353},{8556},{8123,8197,9340,9639},{7114,7488,7508,7669,7804,9349},{},{7856,9312,9544},{7625,8482,8549,9767},{7482},{8601,9094},{8291,8342,8555,9172,9972},{7279,7739,9772},{9142,9927},{8025},{7943,8229,9283,9584,9959},{},{7415,7480,8404,8480,8771},{},{8060,9376},{8244,8504,9523,9596,9655,9816},{9371},{7266,7378,9078,9135},{7362,8766,9357,9807,9910},{},{9196,9449},{9145,9463,9881},{},{7681,8123,8568,8749,9587},{8048,8181,9450},{7408},{7200,9225,9468,9741},{8113,8232,8341,8695,9277,9317},{8262,8587},{7141,7259,7440,9593},{7148,7519,8135,8404},{7220},{7407,7448,7562,7806},{7125,8662,9215,9553,9815},{8148,8476,8650,8822},{},{7855,8809,8956,9650},{7130,8474,9256},{},{7382},{8351},{9345},{7850,8036,8280,8512,9762},{9135,9575,9908},{9997},{},{7910,9049},{7721},{8218,8610,8926,9077},{8167,8377,9357,9572},{9079},{9607,9717},{7336,7578,7845,8900,9239},{8013,8749,9436,9900},{7340,7498},{7269,7538,8678,9618},{},{7720,8111,9549,9570,9718},{9090,9471},{8195,8499,9033,9440,9454},{7744,9100,9921},{9157,9495},{8440,8517,9430,9535,9786},{7461},{8841,8881,9252,9888,9929},{7242,8779,8916,9293,9327,9572},{9627},{7537,9251,9360,9928},{7622,7689,8286,8421,9677},{8165,8275,9090,9251},{8605},{7483,7547,8387,8988},{8303},{},{7847,8209},{7274,8621,9274,9488,9746},{7345,8146,8704,9424,9735},{7565,7923,8563,9330,9574},{},{8520,8778,9419},{7427,8275,8702},{7257,7428,8065,8198,9581,9917},{7145,8317,8910,9271,9287,9357},{7456,8387,9072},{7629,9157},{7232,7489,8583,9592},{7475,7659,8772,9133,9670,9976},{8364,8776},{},{7460,8628,8721,9692},{8315,8669},{7627,9257,9379,9430,9830},{7380,8138},{7183,7295,7548,8654,9925},{7288,7303,8318,8559,8950,9348},{},{8257,8370,8686,8856,9441,9641},{8111,9598},{7430,8689,9802,9935},{7911,8037},{7352,8353,8775},{7305,7995,8675,8830,9945},{8056},{7453,8060,8196,9725},{7451},{7938,9996},{7244,7357,9212,9342,9766,9918},{8285,8483},{7277,8268,8448,8534,8660,8873},{191,8290,8820,8825},{7185,7437,7813,8780,8915,9630},{7224,8310,8506,8824,9718,9856},{7275,7356,7963,8454,8987},{8470,8958,9173,9320,9471,9757},{7746,9514,9799},{8974},{7756,8606,8707,9142,9813,9949},{8303,8309,8940,9036,9535,9897},{},{7284,8412,9262,9453,9930},{7674,8910,8935,9164,9285,9640},{7630,7911,8230,8769,9276},{},{8698},{7697},{7895,8559,8779,8887,9736},{8594,9769},{8218,8724,8904,8961,9334,9798},{7223,7251,7392,7986,8863},{7336,7541,7608},{8136,8227},{7392,9198},{7454,7615,7779,8815,9394},{9764},{7641,8081,9728,9924},{8745,9539,9722},{7186,7727,8216,8644,9737},{7573,7739,7934,7983,8124,9236},{},{7194,8354,9716,9827},{9739},{7197,7488,7641},{7889,8718,9956},{7335,7738,7797,9726},{9296},{},{7314,8192,8360,9255,9591},{8933},{7906,8043,8443,8479,9068,9750},{8009,8721},{7652,8735,8937,9403,9443,9485},{7652,8157},{9317},{8678,9924},{7479},{9089,9803},{8796},{8566,9273,9905},{7641},{},{9982},{7585,7732},{},{7840,8160,8167,9835,9980},{7536,8353,8420,8635,8999},{8219},{},{8072},{7701,8191,8482,8689,9368,9754},{7418,7494,7538,8927,9496,9652},{8394,8690,9966},{7669,8505},{7576,7702,7706,8561,9040,9653},{8729,8755},{8842,9558,9706},{7477,9366,9915},{7879},{7885},{7833,8400,8971,9595,9855},{6379,8070},{7685,7775,8320,8373,9114,9884},{9637},{8749,8907,9765,9852},{8114,9179},{8051,8417,9706},{2930,8160,8724,9093,9487},{8129,8175,8290},{7411,8090,8095,8962,9011,9928},{9231,9387,9884},{8200,8788,9050,9246},{7367,7667,8364,8377,9424},{7483,8256,8557,9624,9773},{7414,7730,8354,9686},{7806,8436,8650,9970},{7453,7759,8102,9025,9378,9684},{7458,8600},{7596,7924,8260,9005,9699,9801},{8193,8346,8833,9301,9781},{8108,8215,8357,8686},{7365,7732,8741,9404,9419},{2174,7434,8131,8257},{7778,8104,9514},{7519,8481,8888,9439,9497},{8087,8185,8574},{},{8117,8478,9376,9581,9834},{},{8041,9332,9635,9641},{9644},{7988,8073,9955},{8265},{7712,8466,8516,9375,9748},{7829,9434,9553},{7372,7621,8032,9034,9078,9605},{7938,9214,9687},{},{7826,8221,8754,9476,9985},{7294,7783,9376,9608},{},{7398,7687,7720,9311,9461,9738},{7611,7773,8001,8883},{7271,8007,8405,9137,9642},{7387,9738},{7847,8548,8702,9698},{7307,8161,8358,8494,9251},{7940,8236,8566,9469,9946},{8054,8586,8923,9795},{7514,8250,8332,8940},{7373,7788,9322},{7558,9464},{7947,8472},{7743,7749,8370,9402},{8005,8103,8576,9488,9716,9837},{},{7638,8291,8812,9188},{7766,8214,8310,8624,9556,9562},{8252,9245,9355,9369,9692},{7825,9052,9325,9805},{7440,8686,8772,8879,8918},{7471,8855,9131,9838},{8716,8738,8961,8988,9967},{},{7786},{7493,7690,8665,9123,9243},{},{8580,8686,9045,9581,9859},{8833,9227,9654},{},{8669,8738,9824,9836,9898},{7711,8440,9752},{},{7664,8588,9823,9928},{8457,9494},{7703,7947,8232,9117,9909,9993},{7324,7916,8257,8323,8789,8843},{8030,8442,8724,8773},{7890,8280,8925,9259,9899},{7628,8414,9081,9247,9285},{7716,8437,9185,9322,9563,9632},{7968,9758,9920,9921,9963,9987},{7340},{8841},{8099,9877},{9057,9114,9872},{9471},{8820,9601,9630,9904},{7759,8165,8601,8741,9029,9597},{9174},{7503,8155,8303,8759,9938},{9383,9950},{},{8876,9190,9484,9771},{5436},{8873,9290},{9935},{7786},{},{7785,8241,8769,9255,9718,9846},{},{7932,8039},{8918,9117,9275,9498},{9201},{9155},{7415,7428,9249,9501},{7825,8370,9389},{7744,8042,8092,8371,8738,9396},{9647},{8258,8326,9031},{9647},{},{8120,8719,8885,9708},{7800,8229,8286,9168},{8632,9790,9998},{8370,8589,9253,9668,9865,9906},{},{8578,8878,9438,9534,9951},{7771,8749,8901,9593},{7578,8011,8147,8520,8692,9189},{9058,9059,9324,9494},{8139,8926,9955,9974},{},{7810,7863,8085,8196,9066,9400},{8482,8942,9058,9364,9996},{7982,8589},{8926,8957},{7708,8365,8751,9902},{8707,9487,9638},{},{8156,8706,8769,8795,9203},{},{7925,7965,8578,9140,9260},{9774},{},{7418,8681,9207,9815},{7691,7807,8106,8836,8892,9519},{},{7876},{8553,9612},{},{9296},{7597,7902,7938,8907,9648},{7411,8537,8603,8777},{9093,9731,9860},{7682,7783,7884,7964,8658,9880},{8525,9301},{7516,7694,7787,8700,9237,9547},{8494},{7395,7734,9033,9996},{},{8095,8615},{7433,8056,8411,8645,9842},{7484,8834},{7458,8386,8577,8761,9129},{},{7680,9060},{7389,7801,9270,9524,9622},{7629,7933,8152,8271,9806},{8743,9149,9250,9458,9527},{9295,9926},{8960,9432},{},{7502,7886,9136},{7740,7826,8310,9194,9641,9678},{9461},{7734,9456},{7475,8180,8297,8988,9253,9420},{8210,9370},{8460,8908,8958,9205,9327,9855},{7421,7802,8651,9227},{8164,8944,9249},{7542,8409,8428,9202,9870},{},{},{8571},{9681,9754,9898},{9338,9639},{7652,9453,9551},{9118},{7820,8793,9662,9830},{7702,8346,9147,9548,9650},{8334},{7807,8765,9171},{},{},{7964,9345},{8512,8860,8950},{7441,7619,8054,9460,9852},{9575,9852,9905},{9989},{7474,9181,9674,9774},{8090,8326,8975,9032,9072,9383},{7789},{7555,7718,7738,8027,8287,8665},{7508,7595,7604,7638,8295,9352},{7720,7915,9450,9588},{7896,8147,9181,9550},{9370,9685,9903},{},{},{},{7590,7625,7711,7813},{3591,7509,7743,8238,8254,8959,9404},{7728,7781,8707,9938},{7651,7875,8128,9312,9697},{8042,8186,9169,9178},{7747,7764,8692,9360,9403,9885},{9775},{7526,9080},{},{7751,8817,9024},{9970},{8805,8980,9962,9971},{7551,8677,8865,8975,9856},{8298,8522,8909,9131,9587,9822},{8095,9029,9398},{7657,7727,9542},{},{7936,8330,8641,9861,9977,9989},{7601,9098,9345},{8639},{8219,8446,8553,8676,8943,9651},{8437,9100,9803,9822,9915},{},{8020,8949,9835},{9166,9977},{},{9486,9865},{8195,8273,9681,9989},{8575,8797,9065,9393,9878,9894},{7834,8356},{7601,8973},{},{8667,9548},{7470,8048,8217,8557,8612,9044},{8313,8342,8572,9034,9570,9623},{},{8256,9826},{9713,9749},{},{7796,9350},{7544,8194,8947,9015,9226,9543},{8361,9544,9574,9869,9962},{},{8409,9010,9257,9723},{8292,9138,9142,9978},{7550,7922,9202,9620,9738,9803},{7830,8484,9790},{7918,7925,8330,9989},{7866,8884,9016,9424},{7954,9083,9185,9325,9512},{8427,8548,8558,8632,9803},{7714,8686,9569,9898},{2907,7701,8112,9614,9956},{7655},{8232},{7930,8063,8928,9090,9347,9496},{8181,9573,9924},{8285,8521,9057,9156},{},{8152,8509,9049,9542},{7578,7694,8322,8859,8941,9068},{7765,8270,9044,9293,9644,9848},{9312,9685,9711},{9658},{7758,8600,9141},{},{8841,9821,9849},{7817,9935},{8396},{7775,8562,9610,9798},{7771,7943,8245,8432,8669,9811},{7683,7887,8235,9063},{8116},{9591,9772,9818},{7566,8036,9335},{8955},{8194,8542,8878,9778},{},{},{7548,8260,8281,8947},{9129},{7959,8114,8241,9446,9844},{8080,8187,8618},{7756,8231,9024,9508,9834,9910},{7866,9410},{},{8157},{7636,8321,8667,8989,9878},{7718,8578,9180,9653},{8617,9105,9827},{7765,8262,9142,9180,9821},{8202,8743},{8669,9602,9838},{8536},{7787,8061,8428,8430,8711,9644},{9853},{},{9812},{8419,8743,8876,9303,9889},{8153,9319,9505,9635},{9631,9851},{},{8125,8263,9724},{7911,9193,9646,9778},{7774,7775,7783,8275,8469,8715},{7684,8554,9223,9422},{7751,8095,8716,9177},{7843,7966,8685,8773,8895,9357},{8086},{8708,9493,9518,9989},{8210,8409,9129,9537,9922,9956},{8237,8917,9410,9443,9627,9961},{9317},{9860},{7873,8137},{8057,8130,8454,8624},{7616,7624,7740,7804,9484},{7643,8092,8778,9128,9438},{},{7805,7810,8638,8644,8647},{7915,9223,9465},{7621,8730,9164},{8113},{7700,7889},{7559},{8388,9752},{8212,8947,9124,9718},{236,7682,8120,9607,9735},{7558,7909,8307,9703},{9180,9382},{8173,9393},{8873,9662},{7687,8303,8455,9173,9917,9986},{7839},{8530,9684},{8332},{7680,9210},{7948,8423,8612,9055,9148,9534},{9382,9557,9919},{8137,8147,8964,9210,9828,9917},{7634,8812,8816,8924,9295,9324},{8244,8706},{},{},{7693,9130,9580,9737},{7767,7911,8509,9048,9979},{8579,9165,9956},{9297,9409},{9169},{7740,7895,7936,9194,9285},{8326},{},{8405,8535,8820,9116,9664},{7642,8544,9812},{},{8185,8348,8540,8557,8867},{7730,7971,9543,9989},{7923,9322},{},{9126},{8046,9011,9789,9827},{2836,7592,7855,8645,8953,9413,9886},{7647},{8680},{8602,8796,8828},{8337,8370,8731,9317,9544,9690},{8610,9719,9945},{9292},{7822,8303,8398,9414,9810},{8475},{8763,8798},{},{},{7864,8391,9164,9982},{7652,7927,8687},{8560,9023,9389,9526,9568},{},{9931},{8227,9247},{9891},{},{9826},{7949,8026,8519,8753,8804,8820},{7631,7947,8521},{7654,8783,9488,9704,9795},{7807,7809,9572},{8546,8566,8995,9668,9985},{8420,8650,8906},{},{7763,7868,8809},{7663,7804,9407,9996},{9164},{9190},{},{7713,8225,8408,9216,9256,9950},{7764,8574,8925,9961},{7839,8202,8268,9336,9465},{},{7761},{7972},{9845,9887},{8129,9321},{8111,9174},{7744,8247,8474,9590},{9017,9740,9968},{},{8124,8168,8307,9678},{7695,9196,9909},{7894,7919,8518,8882},{8362,9417,9871},{9164,9244},{8399,8581,8722,8976,9353},{8133,8436,8470,8844,9145},{8074},{7826,8301,8985},{8130,8341},{},{},{7651,8581,8896,8936,9757},{},{8003,8208,8328,8590,8645},{7926},{7677,8338,8646,8751,9484,9811},{7883,7918,8016,8573,9727,9990},{},{7998,8227,8353,8747,9176},{7899,8925,9502},{7797,8800,8871,9438,9496},{7760,7852,8227,8326,8885},{8718,8734,9490,9507,9943},{8052,8660,9466,9873},{8266,8278,8298,9251},{7969,8995},{8604,8654,9011,9105,9220,9426},{7993,8253,8278,8508,9860},{7773,7913,8642,9405,9466,9761},{8276,8762,8775,8853,9671},{},{7766,8072,9643},{},{9101},{7758,8725,8872,9238,9372},{7753,8227,8334},{8308},{7705,7759,8594,8858,9666,9675},{8891,9003,9119,9339,9819},{9545},{7943,8835,8844,9106,9866},{8115,8220,8642,9527,9589,9945},{8364},{9251,9886},{8952,9493,9716,9888},{8250,8781,8944},{8672,9146,9192,9493},{9327},{8149,8793,9617,9771},{},{8027},{8781},{8172,8523,9108,9518},{9531},{7863,8618,8868,8899,9225,9635},{},{8042,8639,8784,8958,9522},{8244,9371},{8097,8370,9726},{7907,8109,8199,9480,9668,9678},{8166,9572,9611},{},{8820,8884},{8835,9085,9863},{7822,7965,8851,9116},{8481,8683,9361,9446,9959,9967},{7900,8237,8404,8621,9597,9696},{},{7921,8448,8517,8702,9550,9685},{8852,9156,9262,9380,9652,9914},{8047,8108,8237,8388,8884},{8536,8679,8716,8884,9080,9253},{8151,8453,8550},{7982,8838,8897,9494,9529},{8190,8389,8466,9100},{8092,8422,8431,8466,8484,9473},{8569,9518},{8546,8903,9981},{8197,8572,9503},{7901,9101,9366},{9774,9864},{8424,8826},{8075,8099,8220,9877,9973},{8147,8846,9657},{7776,8423,8834,9245},{},{7967,8941,9331,9555},{8807,9192},{8123,8367,8438,9967},{7763,8130,8896,9422,9511,9722},{9184},{},{8372,8531,9231},{},{8069,8404,8405,8512},{},{7943,8696,8886,9276},{8123,8854},{9925},{8167,8572,8644,8758,9400,9409},{8275,8816,9027,9423,9598,9908},{7945,8033,8290,9141,9162,9438},{},{},{7913,8997,9029,9913},{7907,7992,8303,9766,9895},{8410,9034},{8964,9083,9534,9829},{9431},{9015,9865},{8118,9681,9685,9955},{},{8526,8981,9097,9409,9915},{7773,8034,8160,8933,9407,9661},{},{8403},{9247,9842},{8453,8623,9486},{7826,8593},{9767,9772},{},{},{9916},{9446},{8525,9341,9377},{},{9197},{9773,9855,9856},{7876,8015,8116,8322,8819,9291},{7842,8036,8355,9353},{7884},{9937},{9457,9608,9691,9918},{8759,9138},{8036,8050,8477},{7963,8465,8481,8904,9974},{7873,8058,8066,8547,8757,9322},{7775,9456,9612,9669},{},{},{9064,9738},{9921},{},{8147,8452,8909},{7902,8586,8741,8779},{8187,8423},{9161},{7925,7960,7961,8712,8935,9373},{9464,9539,9964},{8036,8259,8373,9977},{7971,8068,8201,8719,8795},{7824},{8244,8304,9101,9329},{},{8306,9810},{9563,9979},{8173,8499},{9716},{8151,8620,8973,9852},{7870,9498},{8003,8052,9280,9577,9838},{8396,8478},{9145},{8012,8173,8738,8829,9679,9740},{},{8527,8702,8945,8971,9614,9875},{7917,8059},{8366},{},{434},{8066,8246,8254,8364,8783,9391},{8019,8036,8702,9162,9646},{7911,8642,9397,9712,9837},{},{},{},{8151,8297,8307,8406,8466},{9039},{},{8383,8423,9129,9389},{7885,8021,8271,8505,8646,8980},{8232,8500,8894,9955},{8730,8931,9973},{7932,9440,9957},{9133,9405,9420},{},{8506,8881,9211,9693,9817},{8197,8975,9120,9416},{8143,8484},{8035,8737,9178,9368},{8158,9296,9308},{7920,8749,9449},{8060,9045,9113,9369},{8134,8629,8743,9735,9894,9955},{8432,8800,8832,8876,9520},{8400,9332,9394,9900},{},{8398},{},{},{8584,9274,9324,9633},{7993,8112},{7952,9264,9352,9861},{8009,8586,9018,9135,9618,9687},{8047,8760,8908},{8035,9033,9208,9255,9314},{8375,8838,9419},{8630,9379,9567,9632,9876},{8617,8869},{9259,9272,9799},{7973,8264},{8105,8356,8497},{9031,9566,9629,9803},{8830,9320,9893},{},{},{8570,9018,9268,9513,9782},{7978,8600,8932},{7931,8142},{8441,9043,9405},{8279,8310,8747,9802},{7986,8191,8263,8318,8658,9839},{8259,8603,8752,9676,9921},{7938,8434,8671,9194},{8117,8206,8213,8442,9502,9593},{9934},{},{},{8134,8258,8482,8879,9446},{8220,9279,9280},{7942,8654,9150,9717},{},{8012,8236,8538,9257,9662},{7884},{9359,9372,9387},{8172,9509,9613,9674},{8401,8536,9458},{9482,9545},{9046,9086,9432,9465,9506,9565},{8308,8354,8886},{8348,8598,8774,8806,9685},{8128,8275,8755,9259,9756,9998},{8044,8988,9508,9777},{},{8460,9701,9906},{8416,9416,9472},{},{8123,8148,8322,8914,9795,9998},{8740,8789,9777},{8244,8402,9178,9449,9599},{8899},{9230,9436,9846,9929},{8005,8307,9089,9661},{7988,9355},{8952},{8525,8692,9229},{},{8565},{8024,8410,8606,9752,9920},{8060,8416,9540,9709},{7979,9914},{8279,8341,8960,8999,9027,9402},{},{7918,8497,8525,8761},{9715},{},{},{},{8337,8651,9171,9398,9411,9921},{8153,9200,9347,9437,9585},{9721},{8826,8883,9583},{8983,9684},{8542,9022},{7981,7998,8349,9504},{8191,8688,9090,9818},{8345,9154,9195,9426,9976,9993},{9677,9882},{8837,9254},{8500,9727},{},{8980,8985,9224,9670},{},{7947,8278,8420,8792,9213,9480},{8390,9040,9480},{8760,9075,9838,9929},{8882,8951,9365,9517},{7963,8613,9131},{8113,8354,8772,9041,9951,9975},{8628,9127,9192,9708},{8700,9003,9441},{8361,8714,8999},{},{7986,8720,8828,9403},{8395},{7960,9410,9587},{},{8954},{8942,9412,9589,9670},{},{9751},{},{8388,8558,9060},{9579},{},{8298,8796,9109,9511,9748},{8209,8285,8349,8914,9255,9852},{8125},{9037,9441,9512,9811,9876},{9214},{7992,8154,9415,9580},{8323,9288,9374,9404,9611},{8196,8395,9381},{},{},{8377},{8920,9300},{9007,9671,9690,9751,9973},{9241,9426,9535,9945},{8249,9105},{},{7969,9049,9225,9366,9880},{8171,8819,9106},{8102,8650,9011},{},{8087,9103,9235,9420},{8011,8625,8981,8993},{8259,9418,9852},{},{8131,8589,9091,9366},{},{8144,8499,8874,9896},{9415},{8006,9419,9613,9853},{8731,8793,9051,9517,9555},{7979,8417,8942,9459,9602},{8077,8237,8439,8803,9728},{8125,8667,9252,9992},{8108,8298,9081,9362,9373,9396},{},{8499,8784,9371,9397,9700},{9211},{8350,9028,9620},{},{8078,8158,9273,9298,9558},{8132,9021,9043,9462,9557},{8450,8671,8708},{9010,9129,9374,9717},{8434,8961,9150,9225,9572},{8432},{9292},{8990},{8456,9136,9790},{},{8633,9404,9786},{},{8140,8428,8624,8731,9127,9147},{},{8469,8738,8979,9258},{8585,8691,9441,9952},{8005,8652,8720,8869,9976},{8452,8939,9169,9668},{},{8492,8651,9956},{8575,9950},{8209,8629,9145,9328,9673},{8310,8844,9492,9691,9776,9780},{8146,9415,9766},{8878,9041,9748},{8537,9080,9348,9376,9612,9697},{8318,8483,9996},{},{8984,9192,9339,9341,9617},{8258,8607,8764,9564,9599},{8568,9686},{8792,8925,9040,9322,9355,9867},{},{8374,9002,9665,9720,9995},{},{8090,9100,9949},{},{8270},{8602},{8315,8906},{8651,8877,9066,9568,9657},{8280,8803,8963,9192,9641},{8169,8894,9278,9534,9850,9983},{8549,8614,9016,9500,9617,9828},{8209,8631,8752,9135,9526,9720},{8978},{8209,8245,8423,9442,9940},{8412,8595,9226,9741},{9262,9589,9979},{8097,8705,8874},{8433,8523,9827},{8698},{8035,8042,8645,9025,9626,9869},{8803,8995,9158,9238,9664,9998},{8156,8466,8835,8855,9119},{8398,8498,8556,8988,8993,9107},{8044,8984,9005,9304,9751},{8636,9606},{8612,8652,8767,9146,9205,9724},{8690,8881,8882,9212},{},{8847,9274,9727},{8713,8714,8919,9357},{8127,9694},{8447,9042,9881},{8456,8784,9496},{8069,8432,9219,9976},{8318,8413,8498,8954,9257,9639},{},{9487},{8438,8666,8800,9021,9158,9491},{8842,9502},{8538,8887,8934,9915},{8125,9125},{8473,8480},{},{},{8635,8755,9445},{8387,9753},{},{8507,8559,8875,9922},{9028,9511},{8289,9397,9637,9964},{9046,9911},{9024},{8641,8708,9922},{8325,8549,8753,9398,9603,9741},{},{8132,8426,8443},{8093,8549,8863,9533},{8176,8428,9105,9187,9638,9734},{8282,8292,8427,9209,9435,9990},{},{8438,9338,9477},{8152,8977,9205,9824},{},{8678,8841,9131,9239,9877},{8984,9965,9970},{8515,8683,8854,9129,9396,9782},{9614,9959},{8197,9450,9859},{8239,8433,8642,9206,9523},{8522,8627,8682,8826},{8439,9171},{8486,8588,8605,8664,8959,9602},{8196,8250,8885,8983,9583,9860},{9721,9746},{8178,8324,8526,9164,9729},{8101,8875,9629},{8106,8128,9629},{8739,9913},{8435,8701},{8566,9611},{8350,8861,9369},{},{9612},{9348},{8248,9306,9787,9910},{8289,8947,9093},{},{9013,9073,9432,9447},{8443,8915},{9138},{8299,8764,9359,9647,9804,9958},{8315,8755,9069,9409},{},{},{9877},{},{9056,9561,9833},{9776},{9927},{8343,9414},{9061},{8179,9144,9744},{8413,8569,9321,9447,9782},{},{9499},{8745,9189,9920},{8969,9436},{8144,8733,8803,9191,9202,9603},{8492},{9224,9493,9677,9761,9922},{},{8193,8303,8545,8696},{8192,8529},{8755,9331},{},{8270,8864,8873},{8254,8595,9284,9336,9436,9839},{8302,8869,8971,9001,9450,9540},{8790,8793,9219,9525,9952},{8614,8651,9129,9143,9466,9822},{9303},{8143,9025,9146,9521,9979,9982},{8280,9844},{8189,8686,9160,9438},{},{9157,9350},{8903},{},{8162,8242},{8785,9263,9731,9989},{8387,8477,8801,9474,9675,9754},{448,8948,9060,9544,9559},{8240,8881,8935,9505,9878,9995},{9584,9768},{8859,9022,9503},{8594,8961,9197,9657,9835},{8457,8548,9767,9804,9829,9874},{8153,8202,8255,8775,9113,9819},{9927},{8736,8832,8931,9200,9442,9657},{8250,8302,8428,9252,9979},{9041,9525},{8266,8843,8919,8946,9249,9581},{8224,8613,8749,9055,9105,9321},{9971},{9253,9453},{8230,8452,8594,9096,9129,9580},{9183},{},{8669,8794,8966,9884,9965},{8771,8822,8955,9520},{},{},{9053,9488},{},{8985,9046,9703,9716,9872,9921},{9984},{9545},{8526,8994,9083,9385,9437},{8537,8880,9453,9988},{},{8752,9104,9155,9550,9565,9633},{},{8672},{8178},{8215,9214,9234},{8997},{9124},{8713,8958,9227,9498},{8688,8820,8944,8988},{9064,9135},{8582,8671,9960},{8219,8783,8902,8909,9255,9823},{8636,8777,8897,9241,9648,9697},{},{8189,9949},{8639,8748},{8213},{9072},{8210,8590,8958,9174,9411,9616},{8269},{8255,8480,8750,9460},{},{8648,9132,9149,9549,9566,9828},{9024,9334,9519,9802},{8289,9873},{8866,9219,9415},{8693,9210},{9299},{8250,8446,8771,9085,9782},{8207,8351,8662,8783,9169},{8471,9276,9484,9770,9852},{8537,8646,8881,9226,9527},{8226,9535,9818},{8274,8333,8818,8911,9280},{8775,8792,8887,9623},{9494,9495,9749},{9061},{8333,8589,8959,9027},{8234,8584,9223,9699},{8236,8834,9354},{8377,8482,8989,9974},{8406,8863,9001,9190,9274},{8234,8263,8286,9106,9693},{8407,8612,8744,8790,9060,9448},{8384,8393,8867,9230,9524},{8901,9484,9726},{8493,8667,8669,8684,9656},{},{},{},{8649},{8466,8946,9713,9744},{8340,9188},{7700,9490,9604,9793,9971},{8669,9032,9580,9714,9966},{8794,8841,9177,9357,9390,9633},{8398},{8408},{8455,8953,9075,9893},{},{8746,9063,9646},{8328,9179,9209,9420,9684},{8418,8841,9041,9356},{8752,9186,9885},{8900},{},{8787,8922,9326,9797,9878},{8537,8760,9343},{8501,9995},{9777,9831},{8254,8600,9363,9480},{8624,9677},{},{8278,8961,9538,9701,9940},{8276,8917,8989,9136,9694,9807},{8394,8950,9401,9675,9801,9823},{},{8469,8763,9279,9517,9693},{8264,8532,9246,9467,9568,9671},{8943},{8281,8338,9107,9757},{9181,9398,9872},{8404},{8766,9339,9462},{8381},{9845},{8290,8437,8838,9077,9113,9470},{8398,8895,9440,9469,9863,9962},{8959,9071,9081,9319,9448,9651},{8995,9828,9958},{8427,8579,9079,9391,9740,9982},{8289,9801,9843},{8815},{8676,9153,9487},{8387,9208},{8414,8993,9173,9557},{82,9898},{8920,9873},{9491,9625,9750},{6217,8487,8694,8700,9091,9493},{9057,9174,9454},{8605,8611,9015,9265,9837},{8909,9065,9300},{8775},{8460,8760,8821,9075,9320},{8465,9327,9630,9995},{8547,9067,9125,9537,9647,9709},{},{9592,9821},{9101,9375,9452,9929},{},{9146,9371},{8579,8633,9820},{9691},{8596,8740,8918,9239,9246,9601},{8624,9472,9575,9779},{8528,8923,9579,9779},{},{8795,9015,9072,9202,9313,9527},{9204,9302,9527},{8750,9450,9774},{8472},{8318,8358,8574,8580,8877,9319},{8624,8631,8819,9418,9618},{},{8515},{},{8413},{8346,9448,9819},{8439,8705,9285},{8360,8993,9145,9474},{8429,8464},{8558},{8825,8868,9641,9773,9926,9989},{8795,8821,9065},{8376,8428,9895},{8311,9034},{8668,9674,9807},{8456,8619,9187,9494,9774},{8471,8548},{8923},{},{8653,9020,9902,9936,9967},{9256,9416},{9567,9866},{8618,8766,8813,9659,9668,9815},{8549,8598,8726,9522,9543},{8647,9037},{9140,9662,9964},{},{8524,8616,9063,9283,9319},{8360,8877,8993,9181,9666,9771},{},{},{},{9005,9037,9375,9557,9678,9841},{9015},{},{8370,8429,8612,8912},{8343,8689,9914},{8419,9627,9764,9852,9907,9929},{9197,9943},{},{8472,9738,9955,9972},{8372,8460,8479,8612,9005,9319},{8891,9353,9437},{8504,8574,8661,9344,9789},{8469,8669,9693},{8574,8789,9004,9081},{8708,9025},{},{8508,8758,9330,9563,9614,9749},{8385,8966,9066,9405},{8788,9236,9304,9672},{8357,8584,8860,9390},{9567,9696},{8732,9411,9577},{},{8777,8845,8860,8923,9221,9612},{},{9351},{8791,8893,8967,9248,9250,9381},{9397},{},{8506,8818,8825,9434,9495,9879},{},{9042},{9643},{},{8711,9034,9263,9447,9954},{9022,9842},{9232,9375,9379,9780},{8692,8915,8989,9765,9897},{8724,8729,9069,9761,9783},{8854,9411},{9834},{8737,9453,9456},{8671,8696},{8376,9503},{8706,8923,9229,9340,9445,9514},{8559,8962,9403},{8513,8652,8912,9323,9412,9578},{8677},{8564,8753,9155,9601},{9205},{8462,8639,8974,9775,9996},{9279,9802},{},{8847,9267,9409,9612,9701},{8621,8928,9450},{8562,9259,9334,9457,9954},{8748},{8426,8759,8988,9091,9797,9832},{9642,9674,9897,9969,9983},{8904,9649,9912,9921,9977},{9578,9904},{8728,9051,9661,9929},{8747},{8429,8685,9042,9386},{8685,9188,9279,9373,9491},{8699},{8563,8960,9226,9302,9667},{},{8514,9794,9892},{8430,9000,9667,9893},{8500,8979,9080,9085,9167,9836},{9988},{},{8602,8775,8811,9252,9493,9683},{8444,8573,8886,8972,9080,9419},{9844},{8480,8557,9777},{8580},{8833,8983},{8723,9553},{9013,9149,9577,9617,9618,9938},{8441,8655,8983,9179,9895,9970},{},{8665,8778,9323,9862},{8787,9289},{},{},{8936,8983,9255,9573,9575,9605},{9378,9401,9547,9583,9596,9984},{8649,8901,8935,9644,9775},{9362},{},{8581,8594,8769,9295},{8775,9314,9572},{},{},{9184},{28,8963,9347,9485,9569,9797},{8462,8655,9021,9414},{},{},{8966,9426,9687},{8449,8492,8610,9859},{},{8807,8818,9149,9233,9283,9880},{8713,9529},{8481,8556,9340,9553},{9994},{},{8656,9650,9959},{8540,8780,8931,9196,9556},{},{},{9290,9394,9423,9973},{8923,9441,9817},{},{8507,8542,8699,9028,9172,9858},{},{9126,9540,9559},{9339,9367,9383,9861,9903},{8720,8940,9064,9321,9506},{8571,8601,9402,9828},{8456,8848,9054,9125,9788},{8935,9749,9977},{9336,9788,9852,9928},{9032,9897},{},{8740,8815,9132,9196,9494,9996},{8588,9141,9257,9379,9941},{8699,9084,9430,9513,9765,9768},{8857,9441},{},{},{8689,9306,9576,9748,9757,9955},{9492,9581,9887,9937},{9162,9190,9561,9925},{8632,8647,8942,9067,9163,9872},{8813,9467,9501,9695,9972},{8512,8968,9215,9505,9712,9827},{},{8587,9125,9553,9600,9835,9938},{},{},{8648,8926,8934,8977,9090,9115},{},{8732,8734,9031,9397,9656},{8665,8711,9176,9252,9816},{9473},{8696,8849,9012,9134,9795},{8672,9024},{8606,9760},{9339},{8992,9028,9692},{9747},{},{9489},{8874,9235,9318,9593,9647,9916},{8647,8699,8839},{8575,8831,9644},{},{8859,9013,9251,9972,9985,9997},{8598},{9074,9314,9429,9431,9528},{8721,8808,9059,9851},{8538,9160,9485,9910},{8614,9671,9814},{},{8611,8750,8847,9012,9043,9732},{9039,9182,9757},{8576,8871,9368},{8572,8745,8939,9130,9418,9629},{8952,9398},{},{8585,8795,9241,9368,9426,9999},{9173,9206,9829},{9605,9991},{8800},{},{9113},{8588,9217,9386,9480,9538,9908},{8973,9309,9648},{},{},{8771},{9294,9411},{8601,8845,9565,9939},{},{8812,9969},{9435,9527},{8527,9132,9427,9815,9851,9889},{8925},{8941,9336,9985},{8911},{9361},{8903},{8996,9423,9458,9615,9941,9957},{8707,8928,9251,9442,9854,9982},{8724,8734,9454},{8662},{9573,9660,9845},{},{8750,9441,9671,9694},{9515,9593},{9294,9304,9495},{8742,8906,9059,9380,9518,9739},{9085,9325,9554,9599,9736,9969},{9112,9744,9811},{8740,8881,8926,9043,9477,9978},{8750,8762,8936,9664,9681},{9984},{},{8628},{8562,9438,9552,9802},{9152,9380,9599,9967},{9137,9822},{},{9559},{9062,9180,9331,9363},{9504},{8647,9567,9691,9820},{9552,9684},{9265,9600,9954},{8581,8999,9010,9519,9877,9980},{},{8654,9486,9520,9806,9819},{9561,9878},{8833,8922,9149,9509},{8753,9085,9219,9514,9715,9818},{8730},{9844},{8713,8793,8878,9037,9616,9752},{8776,8928,9311},{},{},{8665,8713,9992},{},{9052,9318,9755,9814},{9775},{8598,9118},{8616,8677,8712,9124,9209},{8286},{8827,9506,9705},{8753,9740,9913,9941},{9262,9792,9979},{8721,8741,8853,9316,9427},{8702,9050,9602},{9033},{8765,8772,8949,9026},{9471,9500},{8835,9085},{9102,9109,9111,9126,9439},{9860},{8840,8944,9265,9675,9818,9864},{9155,9758,9927},{9025},{8825,9101,9175,9493,9658},{8920,9542,9874,9962},{8896,9473,9580},{9314,9747},{9183,9683,9718},{8970,8977,9310,9352,9890},{8937,9031,9075,9392},{8777,8869,8935,9352,9773,9848},{9023,9431,9680},{9702},{},{8650,8811,9181,9347,9429,9892},{8683,8741,8916,9644},{9433},{8636,8839,9481,9901,9981},{9018,9166,9651},{9016,9443},{},{8885},{8682,9226,9240},{9291,9720,9980,9993},{8694,8830,8963},{8619,8684,8884,9425,9632,9669},{8780,9096},{9911},{9772},{},{8761,9593,9885},{8652,9109,9465,9714,9856,9994},{},{},{8651,8754,9391,9535,9828},{},{9043,9752},{9074,9867},{9031},{8942},{},{8779,8873},{9903},{9037,9262,9509},{9099,9538},{8705,8867,8989,9116,9343,9977},{9344,9348,9475},{},{9044,9770,9854,9946},{8764,8861,9499,9599,9872,9925},{},{},{9069},{8911,8955,9034,9884},{9196},{8861,9385,9859},{8852,8993,9335,9432,9699,9775},{8942,9126},{},{8765,8930,9128},{8753,9430,9571},{8817,9259,9862},{},{},{8946,9201,9633,9812},{8949,9212,9236,9306,9983},{8782,9015,9096,9642},{},{9398,9613,9798,9874},{},{8678,8732,9273,9591},{8770},{},{9997},{9174,9282,9645,9775},{},{9271,9360},{8915,9128,9499},{8778,9208},{},{8701,8761,8823,9216,9510},{8671,8685,8743,9178},{9021,9462},{},{8688,8816,9235,9634,9711,9955},{8733,8866,8894,9298,9924},{},{},{9043,9316,9400,9412},{8752,8781,9250,9302,9831},{9294,9328,9467,9772,9917},{},{9157,9444},{9271,9471,9850},{},{9137,9890},{9030,9496,9567,9665,9803},{8824},{8896,9325,9923},{9100,9453,9458,9794,9921},{8793,8805,9440,9591},{8683,8738,8835,9195,9715,9960},{9222,9235,9253,9311,9539},{8834,9053,9083,9116,9459},{8764,9559,9688,9708,9846},{9381,9660,9738},{8896,9003,9207},{8932,9035,9190,9254,9576},{},{9119},{8708,8878},{},{9001,9179,9339,9846},{8870,9439,9525,9593,9787},{9421},{8885,9066},{8725,8802,8896,9249,9832},{},{9312,9341,9564,9877},{9134,9285,9621,9927},{},{8755,9875},{9265},{9185,9775},{8715,8824,9117,9211,9874},{9116,9690,9855,9923},{8832,9318,9607,9671,9991},{9125,9225,9270,9475,9705,9784},{9025,9168,9611,9997},{9600},{8975,9018,9074},{9232},{},{8767,8769,9324,9390,9538},{9101,9199},{8853,8887,9387},{},{8745,8780,8975,9703,9848},{9109,9349,9519,9565,9996},{9016,9046,9100},{9012},{8987,9707},{},{},{8757,9562,9699,9725,9802,9901},{8795,9254},{8738,9317,9773},{8729,8752,8861,8991,9073,9683},{8794,9170,9365},{9065,9252,9333,9809},{8867,8914,8938,9000,9197,9218},{8787,8832,8924,9422},{8830,8836,8941,9035,9293,9862},{9010,9154,9260,9768,9992},{8896,9173,9330},{9431,9503},{8853,9530,9714},{9220,9476,9598,9880},{9332,9420},{9591,9949},{8912,9175},{9044,9396,9510,9854},{},{9260},{},{9061,9219,9769},{9346,9389,9466,9575},{},{9098,9659,9782,9967,9984},{8775,8791,8891,9081,9348},{},{9532},{9029,9715,9965},{8876,9240,9393,9496,9782,9825},{8767,9739},{},{9508,9804},{8823,9052,9281,9310,9537,9701},{9161,9471},{},{9835},{9036,9428,9549,9930},{9928},{3669},{9208,9398,9530},{8834,9418},{8915,8924,9508,9720,9942},{9929,9993},{8877,8973,9022,9064,9308,9849},{9185,9423},{9040,9120,9200,9270,9538,9701},{9583},{},{},{8793,8969,9062,9442,9799},{9091,9346,9376,9614,9617},{8831,8980,9174,9714},{9934},{8916},{9104,9438,9703,9795,9836},{9122,9396,9543,9869},{9260,9331,9415,9767,9772},{8816,9054,9833},{},{8876,9251,9395,9513,9754,9925},{9472,9675,9809},{8963,9515,9651,9900},{9002,9003},{},{9251,9687,9975},{8890},{8929,9041,9149,9498},{},{9183,9959,9973},{},{9014,9271,9408,9561,9682,9944},{8947,9831},{8954,8964,9354,9465,9722,9839},{8990,9188,9290},{8926,9122,9275,9555,9925},{8810,8811,8899,8947,9142},{9155,9888},{},{9099,9177,9269,9402,9725},{9223,9605,9724,9827,9975},{8833,8939,8983,9144,9622,9679},{},{8845},{9350,9474,9872,9921,9978},{9218,9358,9547,9740,9910,9989},{9007,9561,9647},{8897,9316,9400,9699,9921},{8819,8994,9120,9744},{9150,9277,9349,9589},{9001},{9411,9650,9983},{9065,9073,9156,9632,9766,9942},{9179},{9026,9856,9977},{9331,9544},{8994,9626,9630},{8922,8963,9166},{9890},{},{8991,9047,9131,9234,9246,9988},{9075,9101,9471,9709},{8866,9115,9372,9837},{8971,9475},{8970,9029,9055,9235,9724,9896},{9080},{8645},{8889,9008,9549,9741},{},{9660,9714},{9657},{},{},{},{},{9012,9085,9342,9398,9444,9985},{9067,9410,9630,9683,9905},{},{},{},{9219,9343,9639},{},{8859,9108,9381,9499,9618},{9008,9231,9248,9573,9668},{9084,9353,9387,9635,9835,9867},{},{9146,9595,9837},{9035,9480},{8998,9445,9863},{9000,9853},{9045,9608,9675,9789},{9658},{9009},{9206,9449,9605,9665,9669},{8922,9771,9824,9962},{9212,9359,9791,9873,9880},{9200,9832},{8947,9108,9109,9141,9572,9916},{9075,9516,9628,9677,9711,9862},{8782,9865},{9343,9725},{},{9811},{},{8967,9065,9107,9295,9612,9966},{9480,9659,9726},{512,9109,9149,9259,9513},{9528},{9366,9958},{8914,9275,9633,9678,9990},{9673},{8990,9668,9767},{9181,9291,9560,9720,9781},{9081,9545,9568,9707},{9159,9240,9542,9783},{9400,9607,9919},{8891},{9037,9404},{9576,9752,9985},{9215},{9104,9870,9883,9937,9950},{8905,8964,8994,9659},{8950},{8930,8996,9752},{9133,9741},{8920,9066,9624,9672,9707},{8903},{9050,9094,9257,9331,9389},{9222},{},{},{9272,9486,9491,9655,9759,9781},{8945,8976,9104},{9051},{9072,9185,9247,9255,9647},{9102,9444,9522,9902,9954},{8984,9072,9079,9450,9926},{8962,9500,9736},{8930,8981,9067,9069,9557,9764},{9183,9291,9982},{8952,8982,9555,9623,9701,9871},{},{9236},{9576,9734,9938},{8970,9618},{9334,9351,9513,9632},{9083,9570,9574},{9045,9047,9914,9937},{8956,9369,9379,9559,9606},{9285,9327,9331,9397},{9481,9518,9560},{9052,9076,9263,9669,9824},{9333,9835},{8973,9416,9436,9508,9655},{8954,9004,9264,9989},{9339,9559},{8945,9415,9850},{9498},{9290,9403,9435,9531},{9308,9316,9386,9540,9669},{9047,9139,9416,9424,9455},{},{9328,9490},{},{},{9493,9536,9674,9861,9865},{9057},{9055,9589,9912,9997},{9643},{9689,9735,9799,9827,9890,9978},{9243},{},{9002,9549,9759,9862,9900},{9049,9257,9350,9438,9543,9834},{8979,9291,9706,9772,9918},{9062,9218,9278,9569,9694,9911},{3413,9195,9438,9658,9823,9927,9966},{8959,8973,9013,9164,9435,9991},{9159,9259,9334,9545,9897},{},{9153,9619},{},{9056,9405,9469,9536,9748,9801},{9619},{9097,9463,9519,9680,9739,9966},{9878},{9987},{9038,9068,9294,9380,9638},{9762},{9400},{9050,9143,9426,9595,9760},{8970,8973,9051},{9388,9762},{9324,9385,9438,9521,9616,9794},{8965,8974,9254,9471,9857},{9188,9457,9633,9859},{9223,9271,9540,9799,9805},{9038,9269},{},{9070,9098,9130,9391},{},{9040,9143,9384,9464,9465,9936},{8991,9013,9258,9825},{9028,9920},{9186,9311,9453,9774,9820,9922},{9438,9523,9541,9650,9871},{},{},{9026,9533},{9862},{8981,9237},{9258},{9008,9023,9079,9730,9911,9946},{9084,9095,9250,9402,9451,9530},{9078,9233,9270,9592,9623},{9560},{9246,9876},{9004,9168,9355,9543,9827},{9242,9537,9849,9914},{9259,9434,9448,9808,9838,9862},{},{},{9195,9322},{9909},{9379,9835},{9001,9278},{9421,9988},{9457,9496,9525,9538,9550,9848},{9221,9960},{9326,9412,9799,9829},{9295,9841,9950},{9163,9435,9444,9491,9751},{9636,9892,9942},{9093,9158,9506},{9111,9816,9936},{9815},{9126,9144,9261,9402,9605,9770},{9469},{},{9196,9526,9729,9787,9791},{},{9131,9813,9928},{9434,9568,9596,9803},{9173,9688,9839,9897},{9022},{},{9185,9207,9212,9266,9517,9557},{9868},{9341,9388,9400,9408,9569},{9323,9629,9686,9768},{9368,9426,9616,9808,9921},{9963},{9042},{},{9963},{},{9947},{9127,9273,9280,9355,9998},{9035,9460,9534},{9086,9401,9673},{9235,9806},{9355},{9139,9238,9503,9705},{9252,9372,9560,9648,9937},{9038,9041,9130,9332,9471,9882},{9203},{9097,9384,9426,9469},{9033,9062,9344,9477,9708},{9191,9415,9464,9577,9601},{},{9798},{9182,9258,9437,9734},{9169,9342,9426},{9442,9487,9738,9771},{9061,9091,9638,9781,9913},{9077,9358,9878},{9316,9786,9850},{9157},{9551,9693,9920},{},{},{9165,9198,9275,9360,9917},{9082,9375,9486,9692,9786,9866},{9152},{9133,9423,9514,9625,9738},{9066,9338,9442},{9457,9889},{9653,9908},{9182,9703,9782,9854},{9638,9742},{9295},{9169,9412,9541,9667},{9127,9162,9642,9955},{9472,9856,9883},{9476},{9169,9953},{9164,9241,9401,9902},{9172,9187,9469,9738,9878,9933},{9233,9378,9619,9992},{},{9340,9419,9511,9933},{},{9200,9654,9692},{9179,9479,9519,9836,9889},{9220,9233,9423,9430,9765},{9574,9737,9825},{9673},{9325,9804},{9100,9782,9853},{9149},{9161,9480,9870,9883,9996},{9230,9299,9420,9511,9940,9971},{},{},{9428},{9360},{9414,9583,9853,9865,9914},{9119,9121,9606,9795,9911},{9549},{9251,9793,9888},{9140,9357,9589,9648,9680},{},{9271,9402,9488,9530,9640,9982},{9753,9962},{9173,9630,9718},{9160,9685,9831,9930},{9154,9242,9607,9822,9844,9867},{9380,9959},{9254,9423,9531,9540,9990},{9105,9669,9672,9673,9874},{9206,9651},{},{9301,9678,9682,9687},{9136},{9267,9374,9666,9869},{9325,9399,9839,9854,9923},{9676,9744,9814,9868,9898},{9833},{9646},{},{9295,9577,9671,9739,9953,9991},{9121,9393,9468},{9592},{9827},{9271,9420,9695},{9363,9730,9901,9971},{9436,9848,9990},{9255,9798,9940},{9119,9333,9548,9814,9949},{9356,9412,9478,9749,9760,9927},{9374,9631,9636,9890,9904},{9895},{9238,9477,9654,9665,9932,9953},{9196,9335,9374,9378,9426,9803},{9261,9305,9439,9529,9846},{9551},{9275,9726,9950},{9219,9309,9361,9370,9977},{9179,9209,9809},{9166,9265,9351,9838,9846,9872},{9223,9257,9566,9670,9783,9894},{9443,9707,9832},{9181,9231},{9189,9577},{9415,9436,9699,9864,9984},{},{9225,9240,9632,9665,9857,9869},{},{9707},{9372},{9274,9536,9661,9781,9854},{9212,9231,9528,9563,9632},{9625},{9415,9445,9728},{},{9244,9614,9668},{},{9424,9435},{9770,9894,9977},{9157,9187,9278,9329,9734,9821},{9164,9310,9334,9492,9708,9749},{9402,9463,9814,9831,9911},{9222,9242,9356,9633},{},{9585,9673,9840},{9317,9337,9440,9521,9577,9888},{},{9300,9631},{9327,9332,9546,9749},{9244,9323,9345,9391,9595,9895},{9252,9484,9838},{9457},{9162,9416,9795},{9736},{9176,9251,9304,9661,9973},{},{9266,9315,9915},{9354,9440,9742},{},{9189,9422,9658,9739},{9327,9448,9667,9905},{},{9206,9263,9459,9681,9823,9859},{9310,9929},{9359,9376,9513,9522,9962},{9192,9511,9647,9687},{9213,9318,9460,9550,9557},{9755},{9215,9498,9778,9967},{9388,9455,9468,9523,9555},{9334,9404,9524,9750,9965},{9181,9362,9534,9837,9991},{9341,9581},{9499},{9180},{9529,9794,9926,9932},{9470,9639,9894},{9231,9541,9721,9898,9990},{9189},{9809},{},{9656},{9324,9417,9839,9956},{9263,9933},{9237,9368,9516,9592,9613,9755},{9286,9303,9654,9692,9728,9833},{9201,9286,9489},{9882},{9235,9311,9669,9691,9704,9941},{9678,9803,9888},{9232,9452,9459,9514,9777,9948},{9247,9611,9719},{9465,9900},{9556},{9331,9983},{9216,9297,9409,9741,9759,9900},{9422},{9308},{9727,9938},{9823},{9877},{9214,9229,9484,9534,9848,9931},{},{9483,9488,9652,9912},{},{9212,9248,9276,9827,9907,9955},{9272,9385,9565,9621,9731,9885},{},{9311,9606,9614,9634,9902,9905},{9388,9461,9559,9726,9782,9962},{9565},{9318,9474,9489,9840,9959},{9724,9932},{9321,9427,9520,9585,9671,9719},{9630,9861},{9314,9852,9985},{9291,9964},{9409,9473,9702,9732,9739},{9239,9268,9273,9342,9742},{9312,9355,9804,9991,9999},{9356,9768},{},{9452,9458,9504},{9231,9248,9379,9467,9536,9553},{9394,9433,9455,9571,9939},{9333,9423,9565,9845,9982},{9308,9769,9862,9870,9912},{9302,9322,9561,9603,9863,9864},{9795},{9592,9620,9894},{9398,9644},{},{},{},{9387,9442,9445,9919},{9897},{9266,9735,9949},{},{9348,9377,9579,9703,9994},{9329,9755,9915,9928,9956},{9457,9667,9952,9966},{9454,9814,9931},{9431,9481,9666,9745,9791,9802},{9625},{9532,9683},{9671,9697},{9349,9351,9415,9620,9641,9820},{9276,9673,9754,9860,9983},{9525,9955},{9847},{},{9315,9374,9659,9927},{9277,9500,9558,9686,9826,9835},{9357,9505,9799},{9292,9296,9476,9484},{9569,9682,9945},{9566,9889},{9277,9512,9907},{9492,9599,9622,9643,9861},{9527,9711,9741},{},{9271,9738,9873,9968},{9633,9739,9762},{9551,9595,9784,9864,9889},{9311,9371,9534},{9568,9837},{9642,9656,9870},{9609,9615,9866,9962},{9952},{9729,9871},{9614,9630,9891,9902,9907,9922},{9333,9413,9632,9711,9818,9987},{9854,9976},{9279,9453,9606,9916},{9374,9773,9921,9982},{9345,9351},{9500},{},{9291,9656,9736,9747},{},{9329},{9394,9751,9766,9895},{},{9327,9372,9460,9579,9757,9961},{9445,9551,9696,9888,9940},{9467,9927},{},{},{9921},{9340,9387,9855,9966,9994},{9975,9992},{9976},{9901,9964},{9400,9578,9644,9717,9972},{9478,9591,9596,9714},{9348,9522,9595,9666,9749,9878},{},{9403,9647,9683,9863},{9495,9547,9639,9667,9703},{9519,9534,9709},{9511,9802,9864,9870,9919},{},{9405,9436},{9396,9402,9526,9639},{9374,9802},{9447,9520,9681},{9525,9776,9966},{9373,9502,9657},{9433,9597,9711,9764,9838,9948},{},{9512},{9343,9436,9598,9713,9898,9903},{9424,9573,9622,9708,9788},{9432,9829,9912},{},{9855,9989},{9631,9725,9737,9868},{9327,9493,9547,9821},{9378,9395,9503,9902,9910},{9360,9564},{9739,9962},{9392,9488,9649,9789,9793},{},{9343,9352,9516,9599,9940},{9419,9536,9572,9930,9959},{9487,9631,9727,9741,9826},{9386,9400,9667,9703,9810,9993},{},{9349,9628,9712,9740,9885,9894},{9888},{9369,9422,9593,9659,9867,9936},{9596,9619,9750,9861,9866},{9402,9478,9937},{9361,9618,9737,9971},{9587,9646,9709,9714},{9465,9885,9988},{},{9401,9459,9502,9564},{},{9553},{9383,9480,9774,9863,9991},{9538,9710,9932},{9466,9587,9914},{9715,9888,9933,9954},{9366,9503,9600,9776,9784,9937},{9381,9990},{},{9623,9818,9827},{9402,9827,9887,9903,9999},{9376,9547,9680,9811,9824,9962},{9460,9693,9732,9987},{9461,9692,9739},{9440,9594,9840},{9398,9407,9692,9739,9742,9989},{9479,9482,9522,9696,9775,9802},{9566,9955},{9497,9818,9865,9903},{9448,9482,9564,9820,9924,9980},{9463,9938},{},{9515,9579,9593,9873},{9375,9482,9653},{9627,9702,9973},{9444,9671,9681,9843},{9393,9560,9842,9997},{},{9822},{9493,9550,9760,9865,9955},{9509},{},{9621,9694,9856,9870,9875},{9453,9699,9707,9780,9806,9847},{9502},{9930,9956},{9841},{},{9655,9666,9708,9781,9784,9789},{9442,9655,9767,9788},{},{9832,9877,9898},{9636,9957},{9472,9620,9623,9855},{9609,9739,9888},{},{9413,9428,9430,9549},{9645},{9522,9531,9570},{},{9535,9547,9578,9762,9922,9928},{},{9540,9548,9758,9767,9875,9990},{9444,9513,9718,9798,9808,9894},{9444,9484,9503,9661,9674,9918},{9584,9668,9939},{9799},{9579,9619,9644,9646,9754,9918},{9517,9544,9585,9655,9691},{9614,9850},{9424,9474,9575,9608},{9462,9619,9657,9679,9849,9973},{9482,9488,9743},{},{9436,9715,9824},{},{9901},{},{9460,9521,9533,9554,9989},{9537,9790,9888},{9448,9580,9816,9890,9934,9983},{9530,9564,9689,9869,9879,9885},{9444,9567,9911,9915},{9587,9755,9994},{9485,9567,9729,9900},{},{7358,9576,9633,9699},{},{},{9427,9526,9701,9753,9826,9842},{},{9594,9672,9818,9857,9955},{9470,9686,9892,9918,9947},{9469,9476,9652,9773,9799,9948},{9573,9735,9736,9910,9998},{9591},{},{},{},{9458,9470,9485,9697,9786},{9977},{9496,9855},{9507,9581,9700,9835,9980,9993},{9859},{9455,9571,9845,9962,9968},{9455,9577,9792},{9536,9613,9859,9961},{9447,9633,9933},{9491,9785,9869,9962,9992},{9518},{9522,9851},{9460,9519,9564,9572,9871,9925},{9528,9551,9597,9695},{9449,9939},{9464,9563,9733,9978},{9884},{9465,9663,9684,9832,9875,9940},{9564,9733},{9851},{},{9640,9677,9829,9877},{},{9491,9633,9666,9703},{9529,9588,9673,9800,9821,9870},{9541,9580,9786,9884},{9560,9652,9836},{9466,9476,9673,9795,9821,9929},{9486},{9556,9640,9766},{9532,9578,9652,9745,9798},{},{9466,9725,9971},{},{9518,9627,9670,9853,9911},{9780},{},{9592,9784},{9486,9830,9861,9916,9930},{9645},{9730,9765,9842},{9562,9887,9908,9925},{9570,9728,9762,9856},{9586,9725,9803,9991},{9796,9875,9945},{9839,9844,9960},{},{9666,9965},{9571,9674,9960,9978},{9606,9625,9642,9788,9790},{},{9825,9916},{},{9541,9835},{},{9898,9939},{},{9599,9872,9919},{9623,9654,9766,9785,9901},{9770,9811,9935},{9629,9745,9770},{9524,9537,9712,9827,9846,9916},{9747,9759,9899},{9502,9569,9724},{9700,9703,9925},{9599,9726,9940},{9594,9870,9903},{9829},{9578,9681,9946},{9525,9618,9648,9853},{},{9774},{9514,9544},{9707,9734,9822},{9873},{},{9520,9579,9853,9885,9906},{9541,9819},{9678},{9661,9779,9818,9874,9876},{9587,9688,9743,9814,9953,9957},{9580,9687,9788,9811,9823,9890},{9734,9745,9786,9911,9947,9983},{9762,9914},{9699,9723,9743},{9558,9668,9873},{9609,9663,9883,9903,9925},{9763,9937,9969},{9585,9775},{},{9540,9564,9592,9813,9842,9888},{9549,9640,9686,9831,9847},{},{9642,9718,9721,9962},{9597,9843,9906,9985},{},{},{9729,9748},{9866},{9557,9665,9865,9954,9989},{},{9716,9812,9951},{9697,9727,9781,9853,9989},{9586,9633,9753,9777},{9761},{9581,9658,9863},{9566,9629,9995},{9652,9747,9751,9800,9911},{},{},{9922},{9572,9707,9759,9776,9827},{9617,9624,9773,9795,9983},{9591,9668,9712,9759,9946},{9575,9630,9731,9824,9915},{9554,9595,9662,9668,9686,9879},{9577,9583,9592,9817,9824,9904},{9622,9714,9973},{9797,9924},{9766},{9678,9814,9902,9903},{9805,9864,9890,9963},{9575,9659,9683,9693,9731,9981},{9639,9686,9702,9743,9968,9976},{9643,9827,9969},{9582,9691,9762,9784,9878,9996},{9766,9844,9915},{9717},{9574,9658,9777,9880,9927,9999},{9804,9991},{9661,9665,9689,9719,9865},{9668,9698,9718,9929},{9681,9793,9914,9920},{9606,9626,9653,9710,9809,9978},{9642,9697,9744},{9903},{9604,9754,9997},{},{9582,9586},{9719,9772,9907,9971},{9816,9848},{9682,9839},{9628,9741,9743,9842,9881,9967},{344,9631},{9721,9724,9758},{9820},{9915},{},{9601,9721},{9595,9612,9817,9855,9860,9926},{9638,9718,9722},{9929},{9674,9706,9772,9814,9876,9882},{9700,9836,9993},{9648,9677,9695,9709,9792},{9787,9890,9968},{9668,9779,9867,9944},{9712,9727,9805,9930},{3929,9605},{9889,9983},{},{9775,9906},{9764,9801,9824,9883,9922,9943},{9599,9644,9666,9706,9969},{9999},{9604,9631,9954,9958},{9769,9907,9936},{9630,9690,9727,9931,9932},{9891},{9780,9854,9940},{9641,9817,9820},{9682,9812,9942,9953},{},{9919},{9665,9675,9688,9693,9702,9957},{9630,9874,9890},{9674,9701,9758,9867},{9630,9691,9994},{9689,9891},{9817},{9701,9721,9910},{},{},{9893},{9825,9912,9955,9958},{9715,9733,9776,9925,9931},{9713,9811,9933,9977},{},{9811,9851,9885,9897},{9690,9777},{9647,9681,9784,9896,9959},{9633,9654,9696,9960},{9766},{9675,9676,9709,9778,9875,9939},{9668,9740,9811},{},{9809},{9687,9856,9977,9985},{},{9775,9901},{9833,9913,9990},{9894},{9707,9770,9797,9928,9941,9973},{},{9931},{9653,9673,9714,9766,9906},{},{9835,9860,9881},{9801,9867,9880,9913,9941,9957},{9697},{9741,9873,9935,9973},{9732,9738,9776,9806,9828,9875},{9759},{9718,9727,9736,9771,9786,9848},{9829,9887,9973},{9674},{9827,9844,9854,9868},{9683,9877},{9692,9776,9867,9910},{},{9793},{},{9687,9726,9858},{9685},{9769},{9753,9760,9794,9842,9941},{9659,9800},{9693,9700,9787,9796},{9697,9902},{9710,9804,9875,9926},{9962},{},{9685,9809,9847,9872,9877,9901},{9761,9810,9895},{},{},{9926},{9704,9717,9768,9822},{9686,9745,9848,9898,9980,9995},{},{9718,9906},{9798,9810,9827,9911,9937,9960},{},{9776,9811,9948,9986},{9760,9769,9896,9908,9921},{9782,9861},{9979},{9906},{9704,9871,9898,9951},{9721,9819,9866,9889,9893,9964},{9779,9788,9811,9911,9915,9999},{9928},{9829},{9744,9971},{9693,9750,9803,9968},{9710,9725,9872,9921,9922,9944},{9690,9691,9873,9876,9923},{9991},{9703,9766,9780,9846,9942},{9780,9849,9903,9928,9958,9962},{9725,9735,9853,9864,9910,9957},{},{9859,9872,9915},{9828,9893},{},{9793,9848,9972,9990},{9724,9859,9904,9924,9978,9983},{9825,9898},{9722,9754,9766,9829,9928},{9773,9795,9866,9877,9948},{9777,9905,9909},{9717,9769,9939,9973},{9721,9741,9757,9777,9795,9864},{9755,9775,9777,9995},{9722,9859,9946,9967},{9941,9989},{9893,9894},{9725,9783,9899,9941},{9794,9951,9974,9987},{9755,9764,9864,9948,9998},{9780,9831,9888,9899,9920,9963},{},{9718,9734,9776,9914},{9970},{},{9798,9878,9961},{9910},{9738,9893},{},{9808,9900,9915,9949},{9784},{9731,9732,9750,9924,9962},{9763,9775,9851},{9740,9778,9881},{9760},{9805},{9876,9943,9955},{9855},{},{9750,9817,9884,9891,9986},{9764,9857,9918,9919,9920},{9853,9870,9883,9979,9991,9996},{9763,9973,9993},{9749,9752,9842,9878,9963,9979},{},{9865,9943,9994},{9917,9932,9960},{9804,9854,9999},{9807},{9768,9803,9810},{9752,9766,9872,9957,9978},{},{9828,9880,9916,9996},{9948},{},{9853,9898,9915},{9754,9762},{9836,9841,9863,9867,9908,9967},{9780},{9769,9812,9845,9863,9907,9986},{9823,9911},{9854,9914},{9766,9801,9861,9885,9906},{9850,9878,9938,9976},{9805,9912,9958,9995,9999},{9775,9973},{},{9903},{9853},{},{9798,9832,9852,9899,9923},{9808},{9776,9814,9926,9985},{9804,9813,9949,9953},{9972},{9789,9820,9859,9964,9983},{},{9834},{9928},{9949,9952,9986},{9824,9867,9869,9963,9988},{},{9801},{9783,9817,9824,9926},{9790,9797,9905,9968,9971},{},{9877,9880,9906,9952,9995},{9847,9877,9880,9921,9932,9974},{9797,9829,9905,9959},{9785,9812,9909},{},{9951},{},{9817,9904,9916,9962,9990},{9822,9866,9990},{9790,9827,9906,9961},{9798,9931,9959},{9909,9940},{9799,9802,9874,9903,9961,9994},{9889},{9957},{9879,9905,9909,9955,9998},{9823,9835},{9853,9954,9959},{9919,9985},{9810,9879,9925},{9799,9934,9971},{},{9876,9888,9927,9982,9993},{9828,9860},{9806,9868,9907,9934,9937},{9832,9995},{9890,9903,9950,9952,9986},{},{9826,9861,9889,9919,9934,9947},{9827,9836,9838,9861,9901,9907},{9895,9922,9924},{},{9815,9828,9886},{},{9917,9975},{9856,9910,9961,9970,9992,9994},{9896},{9845,9880,9945,9951,9977,9992},{9819,9834,9853,9893,9982},{9870,9889,9898,9927,9990},{9838,9901,9930,9982,9990,9998},{},{9917,9938,9976,9985,9994,9997},{9858,9921},{9839,9850},{9845,9934,9976},{9843,9861},{9905,9927,9961},{},{},{9836,9851,9866,9939,9969,9990},{9868,9964},{9844,9895,9945},{9910,9970,9982},{9836},{9856,9917,9932,9951,9956,9981},{},{9852,9860,9895,9928,9977,9979},{9856},{9840,9861,9919,9963,9973,9975},{9899},{9873},{9939},{9849,9878,9901,9906},{9930,9961,9997},{9857,9958,9985},{9892,9932,9947,9987},{9852,9896},{9853,9870,9938,9941,9959,9997},{9872,9958,9967,9970,9986,9993},{9867,9931},{9882,9901,9911,9951},{9873,9888,9944,9995},{9866,9871,9914,9930,9952,9978},{},{9997},{9897,9925},{9942,9943,9980,9992},{9928,9944,9971},{9907,9913,9972},{9865,9926,9947},{9860,9862,9873,9874,9951,9977},{9878,9913,9917,9925,9932},{9898,9900,9998},{9913,9932,9935,9990},{9864,9879,9899,9911,9922,9930},{9883,9903,9908,9996},{9870,9921,9957,9978,9983},{9872,9878,9880,9922},{9906,9954},{9875,9889,9916,9925,9981},{9968},{9906,9973},{9906,9915,9936,9944,9954},{9917},{9973},{9890,9892,9914},{},{9905,9914,9927,9953,9970,9973},{9890,9903,9917,9934,9991,9994},{9949},{9880,9881,9903,9927,9951},{9935,9996},{9883,9898,9909,9910,9954,9983},{9937,9945},{9949,9956,9964,9972},{9894,9898,9932,9956,9973},{9920,9929},{9896,9923},{9889,9905,9936,9957,9992,9998},{9955},{9966},{9905,9936},{9992},{9927,9948,9972,9983},{9983},{},{9925,9945,9987,9988,9991},{9959},{9899,9900,9902,9906,9951,9965},{9921,9952,9984,9987},{9905},{9983},{9926,9931,9958,9991},{9969,9988,9990},{9912,9951,9961,9970},{9908,9952,9956,9965,9978,9985},{},{9919,9921,9959},{9918,9959,9970,9971},{9911,9989},{9911,9951,9967,9998},{9912,9947,9952,9978},{9913,9937,9945,9953,9990},{9937,9959,9987,9991,9999},{9997},{9935,9937,9968,9974},{9951,9988},{9968},{9919,9934,9959,9981},{9935,9939,9968,9980,9986},{},{9956},{9924,9927,9959,9980,9989},{9929,9976,9978},{},{9939,9967},{9952},{9951,9963,9978,9991},{9944,9965,9984},{9959,9977,9993},{9939,9944,9949,9955,9995},{9985,9998},{9946,9979,9991},{9938,9944,9958,9971,9981,9983},{9974,9975,9977},{9945,9961,9970,9973,9980},{9959,9971,9973},{9943,9982},{9938,9966,9972,9997},{9947,9958,9963,9970},{9942,9946,9948,9959,9984,9991},{},{},{9944,9958,9960,9966,9988,9992},{9957,9959,9969,9982,9986,9998},{9971,9994,9999},{9972},{9959,9984,9990,9994,9999},{9952},{9974},{9957,9989},{9953,9968,9969,9975,9982},{9987},{9965,9994,9998},{},{9964,9977,9979,9988,9989},{},{9982,9989},{9975,9996},{9963,9975,9983,9990,9994,9995},{9969},{9964,9967,9968,9978,9991,9998},{},{9967,9974,9988,9990,9993,9999},{9974,9980,9994},{9999},{9975,9987,9992},{},{9974,9983,9990,9994},{9973,9979,9980,9981,9985,9996},{9970,9972,9975,9979,9980,9991},{9973,9975,9980,9984,9991,9993},{},{9977,9989},{9988},{},{9976,9989,9995,9999},{},{9980,9982,9984,9989,9995,9998},{9991,9995},{9983,9988},{9982,9987,9990,9996},{9995},{},{9986,9993,9996},{9998},{9986,9987,9992,9993},{9990,9998},{9988,9989,9991,9994},{9990,9991,9994,9995,9998,9999},{9991,9992,9993,9996,9998},{9991,9992,9996,9997,9998,9999},{},{9994,9995,9996,9997,9999},{},{9995,9996,9997,9998,9999},{9996,9997,9998,9999},{},{9998,9999},{9999},{}}, +[]int { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,202,203,204,205,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,473,474,475,476,477,478,479,480,481,482,483,484,485,486,488,490,491,492,493,494,495,496,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,571,572,573,575,576,577,578,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,603,604,605,606,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1242,1243,1244,1245,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1617,1618,1619,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2307,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3895,3896,3897,3898,3899,3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,3928,3930,3931,3932,3933,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4308,4309,4310,4311,4312,4313,4314,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,9000,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9589,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9680,9681,9682,9683,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9740,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,9893,9894,9895,9896,9897,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,9915,9916,9917,9918,9919,9920,9921,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,9947,9948,9949,9950,9951,9952,9953,9954,9955,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,9966,9967,9968,9969,9970,9971,9972,9973,9974,9975,9976,9977,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999 }, + +}, + + { + [][]int { { },{7074},{3600,7551,8894},{4053,6530},{499,7655,7764,8006,9413,9876},{},{4713,7532,9459},{750,1979,5699,6255},{4733,4796,7777},{},{4107,5961},{3158,5327,7933},{250,513,759,5158,7873},{1217,7417,9665},{8105},{},{542,3482,6138,9674,9993},{8681},{1032,1485,5456,5659},{8187},{950,1272,3546,6144,6327,9349},{7333},{3730,4279,5603,7747,9597,9795},{3758,8565,9777},{910,1773,1986,4684,5989,7136},{},{},{1447,2056,4147},{},{2111,6518,9757},{100,1788,3241,3432,5186,6848},{2426,5690,6957,7987},{3024},{},{1566,2005,8912},{},{2721,3714,5672,5851},{1409},{150,278,1130,2300,2763,3359},{},{770,1911,4015,8144,9980},{577,4185,6840,6847,6855,8019},{},{2991,4516},{1297,3647},{},{1459,7006},{36,3841,4226,9888},{204,697,1673,4995,7305,9427},{6270},{1072,2527,6429,8544,8631,9153},{377,5701,6735,7358,7537,8573},{6225},{5447},{1035,8378,8981,9624},{414,940,8761},{237,431,2730},{4442},{},{1393,3228,3655,4911,7909},{4612,5198,7656,9679,9771},{530,3971,4816,8131,9826},{6279,9356},{1171,7645},{780,6973,7086,9217},{402,9804},{},{13,4340},{1279,5696,8612,9207,9299},{1768,3934,4206,7238},{953,3837,8401},{1220,3039,5002,5189,7159},{5623,7026,7914,9230,9633},{965,1040,3071,8676},{5521,7362,8284,9044},{6176,6658,9718},{},{},{},{1842,2334},{3531},{854,1668,7221,7583,7946,9133},{558,3349,3649,3901,5787},{1440,4007,4521,6315,6410,7731},{791,4018,4715,5462,6964,7010},{8231},{4550,5832,9985},{1205,1483,6188},{3270},{3280,9450},{},{},{},{757,5745,7271,7445,7899},{3651,5358,7290,7350,8062,9597},{3819,4477,5609,5746,6298,9178},{2284,4640,5551,6131,7963,9468},{5578},{2420,5490},{7791,9759},{3054,4658},{4853,9255},{142,1715,2693,7649,9012},{2019,6262,6437,7202,9444},{257,7148},{4662,6311,6453,7393},{1188,3069,6135,6771,8147,8857},{2259,3138,3885,4897,5405,9841},{1911,6282,6673,7356,8028,8081},{2042,3325},{2010,5373,5523,6210,7440,7775},{},{3201,5104,7543,8130},{9435},{687,4630,6852,6881,7473},{},{1106,3031,5566,7566,8135},{498,742,1283,2201,3305},{},{2866,5254,6412,7895},{2130,2567,9103},{3551,8147,9999},{7366,7744},{},{9604},{6903},{5356,6530,8183},{2734,4104,6400,7160,8118,8675},{578},{},{3226,6585,6827,6938,9383},{1826,3377,4198,5102,9916,9941},{400,1549,9925},{},{365,1392,3652,5287,6698},{199},{5629,9630},{8874},{467,3807,7161,7981},{516,600,3471,4332},{673,5627,9976},{2158,2323,4400,9566},{},{355,516},{2820},{},{2490,2780,4905,5009,9247,9728},{9787},{3688,3979,4286,8151,9641,9770},{1016,1442,2366,6513,6958,8427},{},{6431},{},{},{305,7497},{},{1204,2524,3081,6440,9038},{204,2526,4837,6382,8598},{6109,6728},{861,7431},{3662,5765,7864,8783},{6224,6503,7355,9561},{9076},{325,980,5971,7817,8950,9061},{1410,6321,9511},{229,5601,7637},{4812,6500,8955},{},{1424,8741},{1284,1296,1471,3094,3884,7632},{},{4837,5779,6308},{},{510,5381,6186,8671},{8892},{3362,6607,7476,8495},{965,8373,8965,9386,9528},{8789},{},{2666,4321,5376,5803,7245,8397},{353,3825,4222,8285},{595,7131,7516,7628,8156,9388},{5290,9498},{6467,6992,8657},{2210,3465,7914,8858},{2622,3245,9310},{},{3030,3562,5490,7911,8906},{2382,8679,9657},{},{1553,2524,4699},{3127,6785},{},{3604,4894,5087,7199},{},{513,4055},{9474},{2234,6844,7234,8430,8854},{1345,2240,3566,6392,8434,8697},{4428,5742,6847,7485,9314},{3680},{613,3717,6628,8439},{741,951,1998,2474,3653},{496},{8190},{4284,4952,5368,8120,8492},{2624,2736,4926,9497},{2525,3933,4000,5506,6044},{842,6492,8221},{415,2326,3064,3300,9289},{2337,4598,6091,9725},{232,774,2189,2376,8100,9824},{1258,2634,7138,9610},{3937,5368,6709,7024,7631,8274},{2878,4641,8526},{},{6660},{},{1704,2782,3133,4388,8280},{4708,6946},{1077,1250,6679,6886,7181},{2119,2529,3148,5852,8783,9375},{},{8841},{},{970,4410,5913,7312,7547,7940},{2904,7942,8208,8390,9422},{965,1163,3046,3413,6800},{1277,4062,4173,5516,8625,9553},{1457,3296},{971,7694},{4741,5338,6579,7045},{2705,5857,8618,8787},{492,2013,2615,8733,9850},{9431},{1117,3059,6332,6631,9759},{8717},{970,7840,8608},{2557,3150,3170,4045,8555},{577,2298,8361,8595,8991},{1936,2210},{4664},{8583,8914},{2732},{1195},{1360,2286,2462,7230},{624,2448,6296,6321},{843,2748,5398,6426,6839},{},{422,2899,3685,3871,5982,7520},{1030,3746,4140,5888},{},{1080,2588,3415,4381,5332,8819},{2091,3082,7143},{1495,4825,5958,8627,9320,9508},{2464,3505,5932,6160,9255},{2015,3707,6268,9403},{2984,5659,8757},{6724},{1134},{},{4410},{5113,6533},{2052,5080,7019,8151},{2262,6469},{3410,4159,9675},{788,2255,3342,4424,5995,7631},{857,9489},{},{1520,9772},{1283,7263,7515,9005},{3411,5072,8064,9566},{1337,2097,3728,5671},{},{4529,4611,5510},{1623,1737,5076,9413},{439,632,4197,6129,9009},{303,4690,7651},{598,5513,8140,8314,9049,9333},{5358,6609,6714,9534},{1876,2268,4157,8618},{1021,2240,2561,7040,8280,8709},{1336,5514,6812},{2129,3617,4905,7417,7997},{1158,6973},{1049,2659,4622,5822,7906},{1957,5215,5644,7103,8816},{863,2975,6090,6154,9548},{},{8521},{},{1953,2505,2914,4739,8567,9947},{7106},{8683,9136,9191},{},{628,2190,2890,3960,5170,5889},{4462,8625},{849,2012,2071,3679,4418},{736,3341,3674,5015,7998},{},{3341,7183,9244},{1363,5369,9604},{1443,2229,4870,4971,6564,8901},{322,789,2737,3088,7814,8423},{552,1435,3248,3844,3950,9138},{2441,2547,5843,7028},{3878},{2905,3128,5971,7147,9003,9862},{570,4179,4322,8860},{1677,2137,6610,6895,7320,8904},{1747,3560,5724,6532},{},{3591,6789,9203},{843,7172,9265},{3089,3355},{514},{4716,5784,6325},{1509,1767,3066,8741},{2260,5175,7376,7625,8972},{6504},{567,1163,1383,2789,6279},{4062},{},{7258,7449},{2288,2624,5337,8751},{2625,2664,3736,3822,4686,8661},{649,965,6710,8292},{3902,8948},{6727},{582,4459,6060,6879,6960,9440},{3340,4226,5934},{5360,6211,6496,8031},{},{943,2038,5214,5534,8205},{2863,3119,4449,4892,6796,8957},{},{1082},{1718,2429,3680,4788,5697,9996},{3495},{1758,1878,3310,6068,8996,9391},{},{3842,4197,4492,6239,9515,9975},{6326,7922},{6274,7085,7724},{2784},{9967},{2171,3610,5257,7262},{534,2728,5291,5699},{4978},{416,1127,5478,6137,6814,6911},{4798,4809,7614,7722,9867},{4027,5225},{1383,1832,2055,5231},{6948},{1661,2977,3062,4124,5840,7869},{},{1027,1271,3476,7235,9101,9201},{6855,7677,8664},{2112},{2791,5235,6097,8810,9953},{540,4424,6927,8870},{9430},{8230},{405,856,4573,6404,7262,9715},{372,2333,7535,7656},{},{748,4307,8231,9336},{773,9572},{598,2436,2735,7956,8863},{},{1663,4688,8295},{4683,5223,8431},{3582},{2764,3044,3316},{807,3201,8722},{3920,5834},{2154,6153,6931},{},{1790,3154,4582,5664,6050,7356},{2735,2851,2979,3226,8151,9373},{951,3437,4518},{2955,3864,4305,4703,8582},{4479,5454,7910,9859},{4412,6299,7345,9668},{},{},{3922,5910,5919,7999},{2913,7266},{2003},{4364,4822,6138,6552,6872,8971},{},{2601,9488},{1283,2664,2744,2944,5112,5231},{2175,2336,7394,9247,9538},{6061,6101},{700,2126,7685,8147},{680,5521,5623,5689,7416,9165},{},{1460,4531,6110,7020,9283},{},{626,789},{},{506,1868,2056,2205,2490,9842},{578,2689,6839,9418,9731},{2391},{4372,6373},{1487,6238,6892,6914,9506},{3874},{7885},{},{950,6345,6548,6836},{5804},{3981},{1329,1543,3312,5279,5606,5682},{1543},{},{3116},{876,2199},{1320,1873,3668,3833,6446,8554},{},{5880},{3767,4158},{634,2562,5354,5607},{5091,7321,8982},{4669,6923,9761},{1654,2369,8185,9589},{1731,2635,3068,9789},{1078,3218,3742,6082,8211},{2296,5397},{3109,4929,5742,5939,8158,9135},{3947,4606,8842},{},{1728,2637,3394,3867,5590,8356},{2618},{4632,8021,8297},{2067,2465,2569,5917,6128,7339},{826,1235,5242,5485,5996,9496},{8583},{723,4656,6584,6886,7037,9216},{8850},{1693,1710,3816,4318,5116,8281},{1376,3204},{2728,9667},{661,3930,4213,4910,6293},{4512},{2483,2569,4019,6349},{2285,7575,8750},{809,891,1326,2001,4790},{758,2930,6915,6917,8108},{7507,7749,8495},{683,2537,3573,4347,9914},{997,2240,6020,6490,6995,9107},{2227,5571},{3188,5719},{498,887,2400,2835,8490},{895,4701,4832,7101,7404,9318},{2682,4238,8614},{6731,7097},{3392,5990,6364},{2296,3032,3388,4449,7949,8443},{},{2768,4380,8164,8661},{2096,2846,4932,7096,8984},{1604,9013},{528,704,848,4595,7783},{3638,6966,7623,9473},{529,1193,2273,2824,5814,9693},{2995,3273,7749,7895,9863},{},{2766},{705,1429,2593,5867,6852},{},{3298,3885,4282,6824,7069,8193},{5761,8089},{8677,9427},{},{1286},{},{2606,6280,6883},{2402,2610,5179,8800,9818},{},{1328,3899,4428},{1649,2724,5801,5888,7793,8537},{1598,2940},{6265},{1483,3532,7849,9196},{5481,7961},{5800,8658},{879,2646,5225},{1943,2180,2239,6622,8424,9981},{},{6222,7816,8016,9251},{3034,5591},{2410,4424,4673,4857,5283},{7617},{2658,3240,5570,8756,9524,9531},{},{},{1875,2240},{},{4526,5242},{2214,7035,7200,8266,8623,8900},{2530,4811,5853,7886,8262},{1478,2357,5123,5809,8744},{2521,3243,3693,7708,8124},{2055,2155,6644},{1703,2569,7567,9053},{3425},{4719,9893},{998,5592,7976,8697},{2510,3010,5661,9323},{4377,4466},{1024,2698,4743,6471,6925},{2939,3643,6274,7369},{1400,1594,6136,9357},{1351,2286,5315,8041,9453},{1646,8245},{819,4199,5336,8514},{},{},{3732,4092,4445,6087},{4426,7232},{1481,4799,5934,6267,7237},{1629,2115,7236},{7495,9472},{8388},{},{2465,6811},{2162,2485,2876,4469,4886},{},{5378},{},{3136,5945,7253,8447,9359},{2905,6003,6653},{3012,4704,8357},{9597},{2624,8378,8555},{2185,3895,5563,6484},{4676,7121,7804},{5592,5728,6949,8215},{3415,3465,9438},{2081},{2718,5336,6251,8285},{1212,4473,7223,8245,9687},{5148,6633,9084},{6278,8219},{9889},{923,1920,2916,3192,6378,6885},{4615,5734},{1520},{4687},{2100,4382,7776,8252},{6870},{914,5138,5656,6599,7215},{1721,6332,8477,9180,9239},{633,5791,7549},{8635},{1763,4999,5499,5920,6047,9667},{7251,8512},{2980,3401,5214,5743},{2685,3773,4451,6108},{4045,5274,6301,8271},{},{2766,9934},{1009,1862,4551,7182,8122},{1745},{3574,3650,3997,5665,9086},{2302,3743,5094,5935,8704},{6701,7798},{3646,3968,5502,7471},{},{776,2258,4773,8934},{4316,5826,6748},{3813,5816,6223,7497,7666},{},{4307,4496,6855},{684,6541,9901},{},{2666,2870,4195,6225},{1303},{2765,5121,5343,5490,6233,8542},{3526,3935,7908,8362,8892},{},{4551,7577,8990},{1888,2312,4027,8761,9968},{1548,2316,4818,5900},{},{1322},{3166,7637,9924},{1753,6157,7973,8148,9605},{3189,7738,9725},{2176,2686,3835,6335,9644,9856},{939,1980,3588,8791,8961},{3222,5556,6949,7572,9283,9581},{1627,2218,2640,3640,4214,4717},{},{1899,3620,6094,9791},{7012},{7472,8395},{2094,5995,6990,7145,8410},{},{945},{2205,4452},{4785,5134,5752,6846},{7529,7685,8476},{2649},{2541},{7230},{2317,4453,5291,5870},{4436},{},{5839},{},{1031,2971,4444,8167,9850},{},{8502,8562},{2584,2950,5235,5918,6853,9091},{},{3928,8349},{5230,8706,9936},{5025},{5780,6284},{1967,5651,8010,9961},{8074,9960},{6458,8477},{7852,8697},{8774},{2452,3028,4149,6578,8472,9110},{1289,2290,3990,6042,8915},{1576,4205,4547,7388,7976,8902},{},{2566,4823,5954,6726,6931,7399},{2931,5646,5996},{4449,7849,9161},{1264,2900,4853,4878,9813},{3659,4190,4398,5951,8376},{1984,3137,4973,5834,6444},{},{6542},{1964,3987},{3953,4399,5000,6335,7321,9665},{2097,2594,2951,6499},{4019,7113,7730,7761,9457},{},{716,3782,4564,5376,7435},{},{3626,3841,6727,6745,7610,7882},{2291,5521},{1326,1963,2698,3002,3919,9211},{7581},{},{1061,1436,4574,6339,6654,7711},{3813},{938,4747,5035,5596},{969,6628,7904,9296},{},{7433},{1027},{1784,8868},{5272,5742},{2148,6501,7531},{711,968,4992,5234,8771,9772},{2327,7547},{3304,9476},{964,1929,4897,7606,9211,9458},{2468,3396,9164},{1028,3811,5542},{5996,7194,7365},{},{2387,7254,9927},{795,2584,4697},{2086,2838,3779,3897,5961,7403},{4688},{1173,3012,3213,5177,9821},{4631,7076,7503,8970},{3942,8682},{6134,6199,6429,7187},{1484,1996,2537,2696,9390},{},{1489,5005,5462,7709},{4748,7732},{4844},{1328,2987,4563,5196,7923,8851},{},{1060,1655,3455,7674,8040,9922},{2206,3234,4005,9144},{1051,3089,3541,4756,5205},{850,2253,3267,4519,5821},{1140,3347,5567},{},{3988,5145,7928},{695,1670,8140,8228},{4414,4818,5819,6832,7059,9478},{},{1558,2140,3763,4989},{7906,9161},{1034,3401,8335},{},{3350,8483},{7754},{723,2445,7586,8017},{},{2289,5280},{2099,2747,2881,4336,6881,8109},{},{},{6616},{1234,2628,4420},{},{1580},{3146,3610,3753},{1090,3489,7271,9421},{7027,8008},{811,2506,4795,6114,7714},{1585,2792,3885,7182,7670,8721},{},{},{2970,5143,5678,6192,8355},{},{1282,5183,5757,7306},{},{4947,5290,5983,6172},{3825,5098,5139},{3305,5111,7691},{9093},{860,5404},{},{1262,3957},{3268,8012,9212},{2697,4781,5995,8215,9369},{},{},{2248,3684},{},{2733,3598,4445,5459,7300,8543},{1758,2569,5398,5522,5715},{1069,3131,4582,6095,9564},{5137,7030},{},{3145},{2174},{},{},{1818,3625,6192,7035,9190},{2063,5268,6981,8866},{5444},{854,1912,3338,4005,4593},{1623,6532},{5613,7538,7760},{4530},{2461},{1304},{6298,8481},{2197,3651,6354,9815},{6607,8772},{8848},{1630,5183,7516},{1870,2182,4128,5589,7123},{2342,2605,2980,6727,8322},{},{2382,4894,5449,7177},{},{9169},{2099},{1041,1457,2205,8313},{3064},{6545},{961,3045,3808,5673,8191,9812},{8984},{},{930,8590},{6366,7273,7569,9027},{1617,2529,4296,4562,7003,7365},{8229},{},{3299,3379,4475,5780,9324},{1636,2475,9315},{2081,2314},{1547,2961,3245,6516,9125,9895},{},{9682},{},{1641,4966,7319,7396,7516,7551},{},{7598,7777},{2532,4572,7134},{3486,4712,8339},{7283},{6016},{824,3703,3922,9681},{891,9672},{},{2151,2777,8334,9809},{},{1430,4900,5513,6528,7198,9843},{937,1893,7299,8808,9281},{6520,8031},{3790,3810,5118},{8859,8967},{},{2067,2981,6386,7184,8203,8235},{5668},{1320,3006,7331},{2057,4591},{1100,3466,3544,6758,7159,8084},{863,6007,6488,8212},{2377,4326,7336},{},{2321,4066,8289},{3689,3782,4558,7873,8324},{865,2830,4131,8778},{952,1249,6336,6827},{3520,5448,7385,7897},{3685},{},{1241,2972,4962,9289},{2152},{4623,5886,6074,8654},{1484,3157,3609,3828,4661,9087},{},{3210},{5580,7358,9142,9401,9665},{184},{4249,5420},{},{957,1241,5136,5859,6001,6433},{2259,5112,7943,8337,8386},{2998},{7985},{7534},{4990},{931,3492,3723,4397,4485,8546},{},{1214,2267,2374,5331,5828},{5449,6434},{1478,3614,3671,6310},{2410,7779},{2217},{2632,4106,4881,6350,7450,8825},{},{4602,6488},{},{5007,7396,8652,9802},{1450,2761,3099,4388,9824},{2103,2387,3179,3452,4151},{},{1881,2616,3654,5095,8532,8632},{9014},{4961,5252,5414,6462,8224,9767},{2415,4189,5380},{2894},{4996,8828},{},{1039,1555,4401},{2575,9780},{1846},{2817,4308,4718,5944,7784,8335},{3717,7867},{626,4326},{1271},{9099},{5365,7959,8283},{3118,4130},{},{3289,4015,4633,6512,7308},{1676,3109,6271,9381},{7513},{2665,2714,3029,5244},{2474,5740,9524},{1383,2554,3403,5822,8236},{9531},{2360,3254,4228,5765,6748},{6220},{5181},{},{8482},{6536,7892,7948,9455},{1355,1745,1914,2368,6931,8860},{1274,4123,4420,6402,8622},{1805,5043,6134,6603,7030,7910},{2164},{},{1814,4633,4954,5296,5872,6025},{3554,4825,6045,7753,8566,8639},{6799,7775,7832,8476},{8978},{3026,4094,6768,7177,7728,8206},{3038,4417},{3330},{5215},{7980},{},{2881,5369,5450,5787},{1845,3707,6192,6917,9168},{1971,7068},{1571,2044,6213,7856},{5069},{2708},{2187,3235,5429,6593},{4900},{1910,2346,6359},{1394,4516,6276,9125},{1831,4364,5875,6794,8898},{1664,2402,4557,4666,5927,6970},{},{4736,7489},{},{3214,4288,5527,6123,9189,9771},{1422,2447,3772,9114,9401,9808},{},{8212},{4035,4716,5894},{4187,4486,4956,8291,9431},{4307,4563,4573,6960,8000,9295},{1805,1978,3829,5821,9264,9505},{2237,2540,2550,5358,7100,8272},{5329,5692,7122,7587},{4027,6787},{1195,2411,4267},{},{1239,5213,5560},{1583,5825,5885,6451,7905},{4620,5106,6666},{9093},{1286,2550,3108,7622},{},{6776,6964},{1628,3548,3647,5080,5890,9110},{5917,9302,9466,9518},{3294,5769},{3176,3689,3877,3908,4752,6585},{2597,7677},{},{1967,4222,4496,9841},{},{4445,4531,4673,5437,5934,9002},{3095,7609,9835},{1741},{1251,5802,5997,8506,8644},{3280,5126,5547,7828},{2878,3644,6734,7118,7909},{7676},{1890,7077,8850,8961},{1020,4548,5251},{},{},{},{1934,2129,2196,9184},{3068,6006},{},{1269,4622,4686,5074,8049,9500},{1673,7548,7584,8376,9407},{2679,5040,5411,8155,8645},{1521,2882,3682,4669,6454,6561},{2673,5445,8522,9749,9809},{5333,5992,6840,7556,7947},{5734,8442},{8359},{1420,8546},{1818,2293,2998,3115,5556},{1313,3333,4407,5406},{1253,3485,4339,7594,8854},{1419,1884,2146,5325},{1934,5613,7226},{1509,8171,9660},{1335,1579,1908,2939,4229,5842},{986,4099,4746,4981,7928},{1781,2788,4995},{1011,1393,3644,3730,9512},{2273,6858,8043,8169,9152},{3316,4439},{3279,3317,3475,3783,6572,7907},{},{4858,9774},{1325,3189,8186},{},{1620,2813,4316,4777,5786,7898},{8196,9918},{2613,2848,4025,6342,6693},{1545,6057,8972},{},{2745},{3159,3180,4620,8682,9308,9855},{3810,4029,4450,5747,7010,9236},{2691,3181,6112},{3988,5807,7094,8000,8454,9967},{1999,3915,8723,9497},{3568,5094,5921,9862},{9443},{4216,6903,7802,9337,9494},{1080,3861,7246,7694,8600},{2118,3097,5316,9571,9964},{3593,4601,4688,4950},{6899},{3505},{},{1448,7776},{},{4492},{1360,4529,4588,5216,6073,8855},{1155,2409,3495,3724,8622},{7568,9812},{},{542,1589,5419,8092,8557},{4516,6640,7511,7881},{4526},{3407,4676},{1526},{2479,3730,5748,9690},{2940},{4387,4640,8607,9786},{7838,8521,8742,9822},{7040},{1317,4311,5698,8036,8338},{5794,6023},{7876,8173,9617},{1165,4493,5906,7668},{},{4087,5105,5207,5252,6172,6356},{2820,3474,8912,9135,9394},{3026,6224},{2920},{5746},{5480,6333,7843,9037},{2442,4183},{},{2116},{3973,4241,5613,7073},{},{9333},{6460,7404,7411,9846},{6854,6917,8755,8885},{6813,7412,7903,9951},{3811,5261},{3887,8785},{},{1454,1617,3586,4960,7547,8262},{1119,2421,3456},{2735,3865,4290,8498,8671},{1486,1613,2120,2477,7607,9703},{1867,6710,7479,9466,9653},{3837,5347,7091,8077,8926,9388},{3164,3902},{5931,6077,6684,9083},{1980,6158,6521,6571,7488,8211},{2450,2735,5160,6239,7611,8150},{8308},{1721,2739},{},{1781,3569,3683,4879,7947},{},{1058,1725,2471},{2093,3526,4972,5106,8524,8662},{2710,6171,8503},{2913,5355},{2436,5224,7948,8976},{2397,5773,7392},{4292,7312},{4878},{},{6647,8810},{4476,4853,5991},{2852,2932,3688,4248,7456,9868},{3645,7120},{1492,5835,7152,7639},{9657},{1826,2454,3302,4439,7368},{3813},{4897,5225,5735,6753,9783},{6198,6416,6942,7235,7789,8703},{1311,5957,6688,8265},{},{3083,3410,8010,9078},{3391,5987,7585,7903,9353},{3007,3045,3311,5415,7492,7827},{1431},{1454,5194,6365},{3056},{1237,1799,3245,6071,9721},{1110,4245,6350,8512,8761},{4591,4872,4944,8544,8889,9445},{1942,5822,6133,6820},{},{3969,9220,9297,9663},{4941},{},{1580},{2893,3139,5230,5392,7600},{3319,6371},{9920},{1376,2373,4697,7279},{2632,8774,9142},{1388,5867,8467},{5912,8118},{5492},{4045,4166,4457,6343},{4609,4858,5720,6412,7374,8763},{5797},{2414,3392,8083},{1437,8412},{2279,5590,5849},{},{1765},{3387},{1612,2389,2795,3657,4197,5459},{2141,6774,7220,7377,7600,8602},{1329,1699,5419,7076,8623,9804},{1882,5192,6660,7995},{6419},{4288},{1638,3261},{4990,8154},{5678},{3239,5560},{},{1429,2239,5516},{2750,4551,5388,6340},{1851,3418,3443,7494,8918,9260},{5932,7883},{6535},{},{3821,8810},{2614},{8847,8978},{1266,1650,6586,8146,8988},{2631,3025,4085,8461,8662},{7607,9958},{},{2571,2859,3379,7441,8365,9213},{3458,3535,3715,4643,7276},{1606,3192,7862,9414},{2791,5158,7411,8566,9499},{3433,3483,4237,7848,9260},{2075,3521,3555},{},{5715},{},{},{1689,3029},{1263,1625,5498,5778,6162,8984},{3043,6862,7894},{3399,4210,4778,6939,7090,8521},{7974},{1402},{2287,7568,9782},{1151,2077,5659,6537},{2790,7306,8977},{3590,8344,9018},{1682,1849,2574,2614,4764,8354},{3988},{1768,2556,2565,3475,6439,8663},{6246},{3537,4393,5057,5380},{2816,3031,4657,5184,6443,9251},{4831,4863,6981},{8879},{1914,4171,4252,6982,7370,7423},{2787,3334,4740,8651},{},{2970,6106,7044,8071},{1950,5419},{2010,2464,2734,7847},{3536},{6218},{9582},{1345,2228,2680,6068,6223,9279},{5181,5536,5609,8203},{1911,3595,3628,4848,4970,5788},{2210,7966,9390},{1887,5703,6027,7831},{3967,6685,6756,8880},{4408},{1234,1567,4355,4427,5586},{3446,7351},{5507,9440,9562},{5526,7042,8163,8923},{},{5233,6009},{1359,2577,4969,9066},{},{},{1208,2747,5611,8972},{1876,6379},{1295,1994,5614,6050,6497,9287},{1372,5728},{1915,4855,6157,7748},{3396,7611},{5149,6622,7687,8583},{},{1780,2642,2921,4367,9303,9659},{6251,9378},{4390,6054,7430},{7849},{1372},{3318,4384,4993,5846,6274,9170},{8653},{1340,6336,9634},{3703},{1430,2541},{4545,4783,5418,7241},{},{1646,4744,8269,9974},{},{7093},{},{3534,4884,6771,7875,8541},{3343,8070},{1510,2161,2932,3038,7822,7888},{1962,6341,7681},{2236,4112,8301,9659},{},{},{8835},{2205,7990,8831},{4602,5622,6689,9391,9788},{5989},{4327,7515},{2781,3193,5739,7501,9884},{3087,4131},{2814,3418,7800,9010},{1733,3064},{1234,1502,3094,4611,6394,8597},{4128,4561,7915},{3322,5156,6149,9376},{4537,4561,8320},{2736,7100,7252,7688},{},{},{2672},{},{2899,3447,5283,8152},{1794,4749},{1670,9876},{},{9622},{5896,8540},{2134,3224,4530,5726,9266,9970},{1960,5534,9155},{7571},{4418,8179},{5234,5448,6353,8241},{},{2264,8106,9837,9870},{3402,6165,8954,9945},{2765,6160,6342,6549,7087,8890},{2987,6587,8846},{2270,2330,4353,4573,9078},{1917,2151,7660,9368,9963},{},{5749,6885,8252},{1392,2193,4893,9580},{6821},{1368,1982,5692,6477,8569},{2538,4140,4497,5532},{1690,7057},{8412,8738,8947},{1870,1970,7182,8098},{4954},{3702,3896,5783,6010,9963},{1378,1609,8462,9358},{2959,3006,3691,4997,7441,8690},{2622,8399},{4743,4891,5262},{4563,4687,6178,9360,9963},{6600},{1778,2102,3450,4067,5289},{1880,4647,7123,7847},{3034,4032},{2074,3346,6469},{4402,6903,9144},{},{2389},{3436,7178,8237,9116,9242},{4203},{3800,4321,7512,7674},{1624,4563},{2455,3030,6027,7199},{},{5568,6664,8691,9061,9334},{3840,6243,8815,9009},{3383,3497,4514,6446,8573,9658},{2726,3549,3944,4180,5990},{4030,4185,4241,5270,6331,9381},{},{1529,1909,3792,6703,9234,9608},{4096,5090,7148,7689,7977,9306},{5653,9048},{9663},{6560,6642,6987,7390,8058,9396},{2033,2104,3370,5547,6209,7088},{6828,8885},{},{2836},{1970,2010,4903,7819,8833},{1839,3622,6572,7438,8628,9279},{2240,4145,6073,6386,8399},{4934,6248,8386,9230},{9072},{},{},{},{1623,1792,1824,1908,4202,8200},{1674},{},{},{3271,3546,3898,5449,6562},{6643,7428,7867,9550},{2179,2805,4201,6660,7890,9876},{},{1703},{4231,7621,9364},{3080,5162},{2198,5767},{2464},{3846,5893,7592},{},{1885,2028,2674,5578},{},{4081,7700},{4581},{5641},{},{1419,2889,6895,7203,7229},{5239,5373,9510},{4593},{1534,2006,7063,7876},{3222,3896,5114,5165,6749,8809},{1852,9755},{},{3962},{1455,1493,6300,7812,9038},{1362,2401,4124,5092},{5260,9461},{},{2667,2734,7240,9861},{4273,6397},{1391,4107},{2714,3962,4122,5275},{1502,5838,8652},{2487,8844},{},{3039,4878,6104,7299,8385,9022},{1785,2382,2481},{5458,6090,7227,8934},{6216,7196,7246},{1953,2766,2972,8583,9300},{5823,6564},{2603,5217,7108,7273,8694,8728},{3217,8383},{2247,2704,4583,4918,8713,9946},{6865},{3108,5207,5292,5687,7250},{2648,8296,8537,8616},{3861,6065},{},{5243},{882,1643,8535,9059,9406},{1728,4241,4795,4807,6043,8967},{},{1482,6326,6794,8003},{4023,4523,6467,9061},{1673,4649,5692,5880,6161,9109},{2416,6793,9234},{},{2095,4493,5496,8762},{2124,4902},{3617,8683,8808},{},{6528,7133},{2850},{3049,3091,3418,4802},{1528,2281,4744,5303,8294},{},{},{1721,7637},{3116,3607,4891,7211,8574},{1835,2329,5535},{3203,7373,7606},{},{1536,2319,2595,3915,5298,9758},{1605,6979,7576},{4553,7484},{3002,4184},{3405,6852},{1631},{3276,4285,5019,5166,6687,7582},{3920,6328,8746},{4392,5006,6585,8587,9183},{1541,5986,7933,9476},{2762,2821,4527,5345,5933},{},{1538,7292,7724,8490},{4920,6590,6927},{2534,2789,6023,6143,7276},{4782,8528},{},{5125,6775,8281,9456},{1756,2482,3478,6397,8311,9336},{1531,1996,2134,7030,9729},{3026,3548,4010,5125,6338},{4243,6854},{5379,7011,7568,9347},{5697,9202},{1906,6167,6610,7854,9805},{},{1699,8920,9869,9989},{2085,8512,9779},{4465},{1582,3720,5035},{3105,7963,9105},{2178,2328,6502,8879},{1668,9360},{1525,7389,8786},{2419,2922},{},{1595,5862,5904,7772,7960},{3692,6693,6711},{3022,5973},{2749,3128,5085,6546,7501,8506},{4865,5829},{},{3910,6815},{},{1424,1791,4178,7443,9856},{6984,8112,8779},{1975,3550,9185},{1613,7852},{4895},{2766},{5345,9982},{},{2735,3230,3632,4712},{},{},{1600,2602,3699,7725},{1610,4396,7844,8830},{6998,8199,9467},{5117},{1743,6192,8012,9100},{},{5832,9904},{2993,4636,5526,5800,8358,9915},{2166,4992,5640,6782,8078},{2419,3378,4429,9193},{1984,3269,5958},{2852,4309,8042,9234},{4462,4709,5340,5496,6396,9678},{},{},{2824,2862,4282,4739,5669},{6244},{2270,7451,8797},{1714,1776,3165,6383,8336},{9523},{2784,6092,6267,6628,7266},{3192},{3630},{},{2729,3570,4409,6786},{},{4183,6856,8459},{3771,4225,5170,8061},{1602,1854,2066,2770},{},{},{3686,6846,8623},{9096},{1763,2090,6692,7558,9140,9632},{},{4920,7844,9388},{2677,8711},{},{2594},{3316,5873,8563,9140},{3829,7398},{2278,7007,9659,9699},{1665,6710,8003,8151,9038,9207},{2993},{3674},{3123,4313,4400,4630,8792,8873},{2670,8898,9293,9860},{2690,4878,6501,8307,9359},{3829,8751},{4736,5004,5097},{2705,3763,6691,7813,9035,9973},{2785,5615,7452,8476},{1751,2110,2263,2982,4847,7998},{},{3123,4015,4932,5182,5985,7089},{7903,9144},{2739,3300,4117},{3675,4346,5684,6311,6860,7058},{4482,5668,7263,9805},{2908,3940,8394,9366},{},{4599,9280},{9807},{1995,3435,6460,8485,8884},{7925},{8795},{2952,2967,3620,3809,4004,7253},{2371,6470,9733},{1987,4350,5890},{},{3420,3923,5354,6009,7159,7675},{6771},{2205,2394,2902,4653,7995,8883},{3581,4082},{1854,3379,7008,8794,9893},{6372,8189,8536,9195},{4308,5425,5431},{2641,2897,6852,7094},{2817,4080,6318,8322},{2247,3181,3279,9532},{4085,7220},{1841,4034,4483,5353,9276},{1778,5698,9122,9145},{6427},{1923,2818,4756,4799,8402,9716},{2031,8654},{},{2139,3152,3576,7069,8988},{},{1905},{},{2676,3043,4470,6090,6564,7241},{},{3806,6061,8141},{7262},{3506,4096,7912,7947},{3760,3928,6581},{3875,5160,6128},{4762,4916,6188,7001,7065},{},{1560,4017,4539,6216,7623,9792},{4100},{1852},{7225},{7214},{2673,3905,4206,6079,7030,9036},{},{4555,4807,7403,9192,9206},{3525,4754,4864,5711,8729},{5456,8776},{9981},{4098,7547,8198,9064,9394},{3362,3488,4182,4225,8585},{2966,3030,5060},{3645,3981,5114,5681,7101,9104},{},{1824,5181},{4811,5619,7098,7635,7808,9131},{2784,3807,6828,9333},{2333},{5433,7102,9462,9910},{2481,2486,4017},{3595,4750,5876,6125,6797},{2141},{2463,5885,5924,6045,7374,8637},{1667,8478,8842,8936},{},{2272,9447},{1646,4852,5597,6830,9472},{},{8045},{7044},{6199},{4705},{2188,4882,5967,9688},{5509},{4350,7298},{},{2038,3112,3645,6286},{2835,4008,8836,9901},{3768,6920},{2261,5045,5427,5474,6809},{1702,9251},{4527,4921},{2140,5316,5699,7429},{},{6497},{},{},{1236,2655,2917,4671,5138,5152,8847},{7177,9934},{1740,4039,6417,7359,7402,9548},{2798,8811},{6658},{},{1762,6405,6900},{5634},{2402,3058,4060},{2602,6711,8990},{2191,3148},{},{},{2701,8383,9092,9366},{3577,7401,9672},{},{1850,2902,3357,5313,8409,8482},{6338,8455},{2123,2558,3174,9047},{7282},{4672,8759},{8408},{2202,7183,8216},{968,5358,9001},{7288,7296,7319,7958,9723,9819},{3336,5013,7411,8301,8699},{5705,6632,7621,9381,9900},{1846,2656,5884},{9578},{3096,5043,5739,7502},{1847,3229,8115,9652},{2018,2788,4756,7279},{3180,8658,9488},{2995,4508,6584,7489},{1830,2251,2404,2520},{2726,4118},{2261,2997},{1766,3961,4570,7946,8913},{1634,2109,6326,8330,9804},{},{3336,8190},{3929,4104},{3057,3909,4185,5478},{1810,1910,3230,7824,9765},{3176,3197,9161},{1806,2286,5940,8936,9623},{2394,2980,4611,5771,6731,8263},{3888,4306,6971,7823,7986},{7065},{2488,2991,5245,9085},{3917,5795,7493,9259},{},{7180},{4991,5671,6638,7530,8387,9852},{},{4301,6191,7965,8251,8784},{6543,8510,8535},{},{},{1885,3082,8921},{2338,3975,4884,7788},{2485,3920,3942,4745,6142,7116},{3380,3902,8957},{9946},{2767},{6055},{4449},{2351,4887,6312,7273,8900},{9855},{2374},{3775,5361,8674},{6592,8316},{},{1775},{},{5950,6064,7279,7719,9343,9570},{2396,2454},{3080,3198,9647},{},{4092,5105,6072,8225,9730,9952},{3305,3617,4181,4840},{},{3588,4016,5709,6536},{5452,5600,7515,8055,9840},{2246,2411,2584,7875,9467},{4667,5350,6219,8324,8775},{2924,3871,7881},{5586,6185},{6068,6751,7374},{2747},{4883,5399,6516},{5567,9621},{1844,3024},{2546,2570,9740},{2676},{1787,9402},{2896},{2280,3980,7896},{3599,4101,5179,5476,6201,6238},{2781},{6989,7631,8274},{3097,3537,4216,4901,7776,7939},{4450},{2412,3351,3641,7308,8305,9840},{2950},{5469},{1943,3180,7162,9219},{9509},{3278,5285,5639,5858,6838,9280},{},{},{3370,3824,5192,5633,5825,6018},{2533,9976},{2194,8238},{4519,4753,5567,6698,7226,7738},{3098,5775,7674,8041,8950,9039},{7447,7729},{},{3812,5224,7655,9205},{4658},{},{2114,2799,3463,3482,3665},{5785},{4948,6972,7590,7634,8345,9495},{2065,4510,5287,5348,9120},{1896,2153,2525,6556,6617},{3494,5812},{3400,4355,4902,9403},{3442},{5402,6188,8580,9063},{2663,3316,4214,4330,6032},{},{2694},{3083,5175},{3017,3452,6960,7148},{2182},{3847},{2233,2886,4905,7678,9827},{3970,5211,9250,9816},{4509,5021,6720,7469},{2101,4514,4718,7708,8899},{4624,6509,7305},{2267,4531,5117},{},{2379,3881,4971,7249},{3758,7282},{},{4020,4698,9344},{},{1971,2393},{4810,6578},{},{1745,2648,5975,7898,8540},{1905,1988,3056,4903,9515},{},{},{5276},{4019,4615,5897,6582,9622},{},{5783,7444,9498},{4108,4524,7834},{6779,9131},{2282},{8051},{5250,6744,6787,9290},{},{3333,3809,5520,6267},{2997,6246,9411},{2366,9284,9740},{2074,2421,5274,8195,8946},{4753},{2211,7277,7381},{5344,8732,9770},{4157,7844},{3206,4707,5316,6037,8687,9669},{4034,8643,8718,9323},{2420,2650,3603,5610},{5346},{3375,3812,5153,5932,6918},{},{2403,3379,3537,4984,7965},{7139},{},{},{4417},{2806,6805,8170},{2472,2865,5663,7306,7408,9215},{1832,4247,4570,6714,8801},{3886,4028,4198,5093},{},{3819,6499,7773,8287,9985},{},{4485,6498,7056,7746,9845},{7352,7746,8523,8710},{3423,4672,9547},{8727,9460},{922,3062,5501,7613},{2134,2371},{2090,8457,9490},{2618,4174,4454},{4105,7055,8466,8487,8914,9023},{2474,6401,7915,8459},{2851,2984,4403,4843,5624,9175},{6538,6921},{2151},{4067,4137,4266,4598,7516,7764},{7091,8466,9328},{2172,5954},{1854,2477,5409,6149,8787,8798},{2223,3963,4673,8473,8627},{2578,3176,4167,5604,6912},{7047,7359,7697},{2419,2827,3872,5454,7247,8770},{3345,4962,5360,5697,6255,8210},{2484,3630,7864,9107},{},{6102,6742,6841,9436,9526},{3291},{2052,5896,6039,9272},{2966,4017,5166,7528},{2801,5382,6660,7128,9070},{1943,2775,2863,6269,7248,7585},{3210,3240,4601,5180,5408},{2351,3647,4149,7449,8029},{4711,6063,8638,9180},{4363,4960,9223,9329,9837},{1861,2003,2048,2796,5193,9803},{},{7180,7266,7301,9607},{7153},{4769,6544,6768,6976},{3287},{4365,6284,8610},{},{4349,7947,9039},{5397,6199,9808,9979},{2447},{},{},{2886},{},{3161,3800,4527},{3383,7141,7859},{5951,7688,8178},{},{3910,8531,9003,9245},{3552,4387,4954,6547,6742,9125},{3513,5266},{6790},{5768},{4019,5548,5712,6200,7074},{},{},{4990},{2282,3816,8633},{},{2083},{3354,5827,6649,6898,8259,8630},{5012},{4593,7322},{2967,3500,4900,5833,6577,9756},{1886,2435,8917},{2531,6066,6760,7398,8358},{3396,6078,8645},{2356,2738,4935,8961,9735},{},{1982,3167,3833,5796},{3196,4453,6443},{},{2746,8195,8329,9533},{},{2448},{1918,3049,5829,8339},{},{2193,7948,9153},{},{3867,4381,5378,6332,8369,9949},{2221,6023,7136,7182,9084,9440},{},{3933,5023,6503,8583,9253},{2874},{2378,6266,6537,6912,8523,9215},{7888,9272,9645},{4015},{8979},{3994,5410,6888,7654},{2594,3866},{2600,3950,4558,7349,7437,9597},{2649,6520,9246},{2063,4226,7519,7614,8306},{3312,4467,6756,9797},{3264,6401,9141},{1988,8292,8411},{3971,6190,7905},{2421,3149,9947},{},{1982,2223,3092,7983,8779,9720},{1911,2527,2565,5432,5575},{},{},{3056,3339,5103,5727,7088,9446},{4332,4487,7503,8430,9078},{7864,9542},{6965},{},{2565,3672},{},{},{2276,3298,4242,5697,6008,7050},{3047,4392,5975,9827},{2506,2579,3807,6784,8562},{2225,5814,9584},{4514},{3378,4517,6203},{2053,7902,8587,9809},{3522,6609,7906,7996,8974,9816},{2667},{},{5145,6914,8033},{2012,2243},{},{7075},{4648,6338},{4696,4857},{2433,3353,4696,7325},{9678},{7133},{2600,6557,7596,8465},{2697,7569,7972,8356},{9740},{},{2647,3235,5140,7850,8540,9744},{4032},{6149},{6117,7854,9377},{5129,5144,6162,7781,8828},{7523},{2255,7862},{2759},{7791},{4532,5888,9827},{},{4742,5012,5986,8364,8925,9588},{2868,4183,5875,6756},{4413,5192,6001},{317,2341,3226,4995,8171,8710},{9150},{},{2405},{2973,5810,7017,8473},{4747,6934,9015},{2966,5635,7646},{},{3152,3463,4936,5269,6730,6866},{4407,9754},{8117},{1146,6732},{4229,4705,5484,7293},{1942},{6325},{2698,2732,3617,3940,3984,9626},{},{3641,4066,6492,8867,8964,9074},{7249,7510,8204,9339},{},{2620,2967,3527,5675,6554,7763},{2627,4262,5618,5714,8352,9122},{2426,7025,7888},{},{2401,7176},{7820},{4528,5710,7581},{1511,5884,6450,9123},{3012,3082,3425,3528,5775,8688},{4806,8136},{},{4785,6249,7709,8506,8746},{3373,5195,6987,8689},{3746,4053,5012},{},{5500},{2903,3824,4787},{},{8151},{3041,9374},{},{4821,7767},{3842,3957,4772,6149,7041},{6801,8805},{},{3703,4678,5168,7202},{3179,5328,5527,5571,5687},{},{3832,4112},{},{2783,5187,7304,9804},{2343,4054,4204,8207,9589},{},{1207,2188,3004,6000,7085,8081},{2556,3883,4290,4650,5234},{3021,8900,9129,9522},{5680},{3599,6603},{2072,3302,5525,7139,7518},{2680,4406,6855,7054,8663,9716},{3650,7198,8580,9048},{4846,5873,6810,8330,9980},{7626,9329},{3059,3227,6768,9809},{4427,7963},{2307,3741,6983,6994,8384},{},{8038},{2198,6880,7464,7959},{2480,7436},{2046,2412,6668,7871,9016},{5855,6596},{},{3748,3882,4134,4792,5961,7900},{5082,5518},{2602,3317,6878},{2152,2618,7181,8775,9692},{},{4091,9289,9571},{},{6127,6391},{3159,4401,5304,8617},{},{5167},{3347,5203,5787,7410,9308},{},{5699},{4916,5376,8954},{5776,8894,9783},{4452,6157,7639,8583,9156},{3486,4625,4976,7000},{},{9775},{2444,5025,8264,8370,8921},{5464,6223,8059,8632},{2712,4697,6452,7743,8681,9262},{2265,3777,5861,8967},{3270,5446,6050,8564},{2098,2281,4378,6467,6516,6854},{2359},{3022,3420,5892,8992,9009,9626},{3625},{7318},{7902,9982},{2834,5455,8310,9264,9399,9617},{8962},{3270,4030,5230,5989,7413,9356},{6550,9132,9568,9857},{3140,3401,6662,8637},{3209,8786},{4964,5662,8608,9037},{2548,2969,4328,7310,8661,8780},{2323,6821},{},{2646,3223,6012},{2287,5311,6415},{3099,8140,8589,9636,9773},{4625},{2062},{7890,9156},{5269,6057,7867},{8646,9137},{3856,4447,8996},{4826,7160},{3111,6946,7053,8188,8360},{},{2494,4248},{3530},{4801,5853,8677},{3723},{},{4336,5979,6280,6566,8094,9330},{2904,4136,4858,6081,6576},{6672,8411,9716},{2670,3288,3443,6215},{6910,7136},{},{3548,4150,5202,5396,7440,9760},{2252,2948,2982,3538},{2596,2631,7368},{3491,3838,4820},{},{2559,8635},{},{2890,3663,5300,7115,9473},{3660,3960,6628,7247,9238},{6862,8754},{},{4360,6106,7289,8088},{2729,4652,9704,9930},{3581,4373,6506},{332,3447,3605,9082},{},{2705,3672,5390,7037,8363},{2744},{4301,5098,5899,6324,6354,8097},{7492},{7959},{2265},{2272,3268,3563,4672,4850,9822},{2548},{2501,4207,7354,7560,7693,8212},{4892,5390,6609,9865},{2957,6201,7897},{4712,6159,6645,7755,8900},{3003,6370,9187},{},{2272,8221},{4030,8395,8589},{3847,3988,5373,5806,7265,9394},{},{2190,5723,6081},{7218,9803},{2235,2726,5710,7532,8547,9239},{2861,6135},{2107,8087,9171},{},{},{2971,4190,5019,6076,7323,8752},{2221,3164,4556,8353,8601},{},{2698},{},{},{2839},{9063,9467},{2647,5127,5348},{5282,7042,8385},{2432,5048,6651,7177},{4937,5179},{2773,3582,8274,8688},{5247,6015,9124},{3677,5675,7949,7979,8121,9802},{2411,4371,9679},{3922,6500,9093},{8618,8709,9632,9749},{3147,6863,8466,8574,8855},{2155,3913,7464,9445},{2663,3827,5975},{2559,3283,3995,4197,4637,8215},{2439},{3697,6164},{3652,3812,6031,7012,9066,9571},{2459,9831},{3876,5483,6925,8671,8801,9169},{2648,6109,7636},{},{2899,4488,6714},{2295,2749,7541,8124},{2987,9026},{3530,4100,6876,9085},{3594,5769,9520},{2972,4183,6510,8186},{},{2877,4897},{3570,3713,4158,5536,6868,8973},{6166,7430,8221},{3899},{2543,2707,3032,3098,5496,5918},{5649,7680,9379},{},{},{2615},{9068},{2443,3733,5699,6839},{2157,2761,4956},{3484,3864,6071},{},{},{},{3342,3612,3897,6873,7280},{2540,8250},{2916,3980,6242,7145,8789},{2685,4028,6480,7159,8056,8830},{2933,3069,9096,9617},{2466,7022,7042,7867,9933},{},{6820,8029},{4083,6669,9918},{3023,4917,8800},{},{8248,9721,9757},{5443,5736,6177,7170,7305},{4171,5444,5746,5755,8212,8300},{3733,5371,7663,8976,9042},{2331,2421,3311,6453},{5458,6002,8957},{},{3235,3622,5618,6767,9038,9099},{5784,6450},{4179,5265,5411,9102},{3426,6178,7501,8612},{3871,9083},{4662,7532,8094,8351,9908},{5304},{3489,4321,5492,6047,7908},{3345,8039,8074},{},{2929,4112,5472,9404,9459},{5971,6026},{3762,5023,5404},{6080,7647},{2245,7857,7914,8922,9919},{781,7818,8533},{2817,3672,3816,4450,9488,9880},{3435,4383,6689},{4593},{3037,6965,7098,9078},{2557,3450,3709,5905,9089,9528},{2996,3442,5424,7416},{9174},{2259,4136,6315,9407},{3520,4516,6560,9592},{2873,5303,8991,9314},{5957,7101,7667},{8257},{3138,4504,6985,7472,8049,8175},{3415,4907,7326,8664},{6573,7964,8052,8987},{7241,8734,9638,9768},{5470},{3232,5035,5063,5601,7793},{},{7524,9382},{3372,5956,6031,6293,9916},{2698,4347,5545},{3509,4244,4445,5373,6936},{4119},{3416,4469,6427,8817,8937},{3095,3998,5054,6563},{3352,4444,7082,8766,9658},{2425,3514,5176},{3406,3459,4072,4980},{4727,7322,7720,7823,9015},{2736,2802,9593},{4042,5624,7528,9674},{},{5133,9100},{4984},{2455,2680,3489,7582,7592,9215},{4052},{3560,3933,5061,5463,6300,9723},{4905,8730},{9862},{5346,6113,6927},{2739,6273,6818,7353,8876,9788},{2544,2844,5898,6664,9193,9991},{2484,6679,7589,9382},{3953,8421,8683},{2921,3847,3856,4322,5680,8476},{4181,4651,7052,7075,8175,8420},{4535,4710,4951,7270,8528,9975},{3301,4532,5106,5550,6418},{4494,6231,6818,8777,9073},{9366},{3778,5345,8604,9621},{},{2864,3497,8327},{},{5773,6559,9687},{8257},{4157,4572,4769,4987,9268,9587},{},{2463,3198,5495,6058,7572,9751},{},{3114,6045,9104},{2477,2718,3496,4781,6283,9368},{6377,7312,8047},{9697},{4304,5296,6421,6436,6775,9552},{},{5179,5295,7302,7571,9174,9488},{2782,2846,2850,5334,8771},{2511,2722,4540,6535,9700},{2653,3318,5083,7120,9636},{},{},{2928,5914,6649,7498,9877},{},{4609,4630,7809},{4146,4994,6015,7296,9677},{4473,5755,5816,5902,6858,7621},{2753,4655,6533,7825,9352,9726},{2639,3188,4165,4979,9419,9803},{4148,9624},{},{2717,4832,9913},{},{3081,5155,7971,8159,8429,8764},{},{9421},{},{},{3310,3831,4361,6438,7279,7842},{8870,9558},{4335},{767,5733,7296,7815},{3525,3809,5257,7161,7460,9493},{6422,9468,9773},{4356,8546},{},{2840,4542,8129,8785},{5477},{3721,3883,6572,8099,8433,9108},{2673,3267,3726,4135,5458,9586},{6509},{6152,6173,7133,7394,9307,9782},{7120,7187},{8434},{4578,5469,6425,9142},{},{},{4210,5550,7878,8508,9025,9501},{5059,6442,6849,7675,8511,9283},{8903},{4886,7491,8094},{3827,5580},{},{5400,6719},{4420,4652,6417,6432,9065,9271},{8617,9797,9810},{},{2672,4655,8608,9290,9739},{3078,3717,4973,6307,6308,7933},{6000,7398,8379,9061},{6707,9170},{3724,8550},{5728,6955,7456,7703},{4406,4646,4676,6268,7092},{4034,4098,4187,5235,9254},{},{4555,6762,9734},{4479,7754,9341},{4105,4257,7505,8987},{2446,3322,3560,3795,7223},{2826,2974,4867,9755},{3858,6503,8133},{4118,4583,6330,8085},{4823,5026,9104},{3575,7092,8647,8827},{4670,5751,7457,9309,9427},{3500,3714,7608,7906},{1988,2538,3921,3924,5421},{8072,9042},{7027,8802},{1593,6907,8961},{4476},{6020,6357,7991,8554,9928},{6689,7212,8071,8327,9766},{4222,5571,7121,9790},{7344,9139,9847},{5971,7488,7494,7590,8508,9552},{4528,6156,6214,7166,8246},{},{3003,3903,4142,5400,9122,9954},{2637,8481},{2482,5471,7255,7548},{3529,4725,7320,8359,9473},{3264,6704,8831,9322},{97},{4902,9628},{5198,7055,7237,8894,9884},{2530,5008,6135,6176,8912},{3357,5698,6801,9174},{2844,5548,6180,8728,9007},{7398,9282,9676},{2502,3053},{4030,5116,5609,6124,7263,8012},{4411,7101,8121,8160,8298},{},{},{},{2751,2984,6551,7437},{5130,5394,5921,7001,8526,8908},{2862,4588,7678,8693},{3678,7210,8296},{4609,6141,6677,7142,7433,8793},{2640,3276,5101,6904,7473,8871},{2662,3919,5367,6845,9967},{7627},{4008,4881,8953,9766},{3729,3977,9953},{2922,5766,5859,9430},{4739,6142,8622},{2612,3779,7484},{2993,4119,7407,7973,8792,9901},{2512,8352},{2757,2937,3056,5295,5503},{2888,3451,4748,5485,6595,8397},{4816,5123,6716,8313,8370,8582},{},{2780,3480,6672,7430,9667},{4540,8268},{},{3988,4456,5652},{},{2505,4778,7777,8255,8271},{2461,3657,5751,6366,6485},{4226,5586,5705,7602,8711,9113},{3309,3394,4219,6495,7049,8839},{6664,8174,8220},{4849,5259,6470},{2627,2662,6509},{3461,5196,5302,6023,6679,9321},{2434},{4982},{5382},{4206,5590,5728,6065,7130,8670},{3606,9164},{3159,5311,6867,9826},{3038,3687,4226,7651,7749,8377},{},{2893,4323,5493,7006,7261,8927},{2863,9043,9647},{6270,6964,9681},{4729,8449},{5153,5611,6550},{4824,6018,7176,8059,8184,9884},{3254,3663,5364,5863,7189,7841},{3022},{4605,6866},{2868,6048},{4435,5032,7357},{2897,3143,3444,3831,6066,7507},{3516,3843,9753},{3146,5121,6214},{3761},{3536,5321,6965,9653},{8700},{6138,6568,6928,6955,7047,7756},{2660,4390,5402},{3498,4614,5447,8442,9148},{4939,6076,8693,8985,9565},{2856,2917,3074,7164,9278},{7678,9645},{},{7509},{3222,6671,8772},{6517},{4815,4836,5563,5865,8291},{3374,4564,4928,6154},{4636},{},{4134,5372,5742,6641,7395,7578},{},{6593},{8047,9429},{4644,4797,8250,8883},{3348,4333,8197},{2605,2749,3504,4343,5257,5622},{4422,7991},{},{},{2860,4619},{4342,8777,9337},{2597,4537,6055,6445,6779,6891},{3919,7768},{5512,9355,9978},{3999,5318,7369},{2826,5597,7749,8876},{4260,9274,9480},{},{5908},{4562,6839,8465,9126,9427},{3128,4693,5303,6882,7473},{2713,3084,3540,3707,4794,9821},{2610,3191,3357,3397,5595,6276},{7228,8385,8887,9405},{},{3418,4118,6658,8687,9211},{2845,3289,3903,6341,8575},{2568,4347,5357,9977},{},{3119,6466,6662,8125,9894},{},{3678,3804,6244,6824},{3466,3490,4752,5200,9005,9463},{4503,4557,4669,7891,9184,9231},{4127,5049,5329,8935},{3892,4552,8047,8052},{3222,3596,4760,6233,9974},{3148,3899,5016,6117,6826,8588},{5509,5601,8725},{3961,4850,6753},{},{2614,3419,5681,7373,8027},{3044,6904,9819},{},{3076,5276,7045,7296,9149},{3842,6547,7538,7885,8041},{3368,4258,5365,6173,8629},{4721,5343},{2802,8257,9620},{2980,3388,4843,5672,5949},{5723,7956,8251,8862,9626},{},{5411,6477,6612,7399,9574},{3711,4264,5052,9285,9854},{4440},{3799,3846,4751,5220,7885},{2661,3458,3808,7244,9983},{6256},{2960,4669},{3166},{},{4037},{},{},{3181,6368,7519,8709},{},{3075,5578,5903,8350,8917},{3006,7752},{6362,8466,9464,9578},{8711},{8420,8470},{},{2908,4862,8539,9510},{6147,6798},{5598,6806,7238,8722},{4191,8487},{3616,4942,6388,6778},{2973,3619,3821,6918,7602},{4010,4801,5104,6109},{2573,3564,4705,8243},{4588,4645,5520,9482},{3829,5921,7191},{2913,5118},{3110,3221,9739,9893},{2988,4360,4723,5662,7160},{2937,7463,9403,9607},{5433},{3684,3983,5121,7039,7828},{2826,5733,8230,8491,9689},{},{2875,4770,6043,7900,8815,9476},{2555,2890,3040,5124,5964},{4147,6257,6492},{2569,4714,5309,7206,8091,9150},{3636,3985,4255,6156,7956,7980},{7023,7109,7299,7877,9476},{},{2889,9426},{5122,5263,5342,5709,6452},{3062,6236,9303},{3338,5358,6009,6409,7873,8678},{6534,8053,8507,9317},{2883,4000,5756,5940,7507},{5154,5409,6968,8498,9218,9502},{3308,3774,5479,5552},{2858},{5246,7128,9034},{5479},{3065,3206,3880,6332,8494,8547},{4650,7802},{2797,5152},{2793,3000,3756,8478},{4633,5287,6777,9554},{3228,9042},{},{},{5645},{},{7113},{4014,4083,5007,5138,5229},{3273},{2656,5122,5699},{2786,3518},{9301},{},{},{3657,5601,7510,8286,9047},{5351,5471,6033,9281,9782,9961},{3599,4171,5897,6589,8020},{8211},{4049,7066,8242},{2568,5237,5372,7076,9642},{4976},{6334,6430,7717},{5481,6707,8719},{4908,5482,6497,7207,9394,9408},{3139,6471,7636,7720},{8876},{4015,8243,8754},{9798},{4880,6000,6720,9863},{4903,6359},{5319,6258,7620,8568,9626},{7928},{9467},{3222,6745,8012},{4046,5190,7847,8141},{5028,5722},{},{3224,3940,4098,8145,8727,8965},{3211,7749},{3147,3264,3852,4022,4219},{9736},{4390,4539,4917,5600,6410,7584},{},{3049,5460,6679,7337,7708,9525},{5022,7822,9076},{3578,5695,8356,9556,9948},{3013,4001,5425},{},{4283,8884},{5461},{},{5125,7202,8225},{4834,6108,6580,8358},{2998,8383,9193,9701},{6542},{7096,7162,8342,8920,9426},{2795,4240,4371,7057},{5437,6137,6954,9768},{2632,3042,7574},{3771},{5911},{9446},{2812,4423,7506},{8962,9040},{4679,4735,5056,9720,9826},{5223},{3915,4040,5075,6573},{9593},{2819,3982,5134,5582,7269,7340},{5804,7026,9175},{},{3268,3396,4422,6419,6515,7931},{2826,3837,3928,6960,7708,9149},{5263,5663,7308,9409},{6250,8478},{2990,5454,6273,9037,9627},{3168,4428,5207,5572,7415},{},{4121,7186,7556},{4035,6751,9049},{5658,7782},{3398,3901,4113,4547,7733,9905},{3741,8690,9621,9938},{779,4355},{3111,3444},{5015,5132,5557,6755,7425},{3966,7391},{2914,3208,3298,5546,6185,7838},{8468},{3604,5853,9506},{774,4694,5004,5193,7912,8207,9715},{3074,4500,6112,8792,9435,9629},{2854,3669,4314,5304,6353},{3164,4257,7796,7901,8401},{3396,5219,8568},{6461,8600,8757},{4408,6064,7062},{5644,6022,6995,7732},{3594,4086,8713,9728},{5139,5555,7419,9841},{},{3808,4061,4269,5161,9014,9427},{4877,6587,6712,7529,8810},{},{199,2732,9546},{5256,7672,8784,8964},{5106},{4422,5177},{3207,4023,5162,7353},{},{5296,9717},{7815,8300,9763},{4601,7124},{6212,8292,8357},{3380,4480,4617,8528,8846,8915},{9081,9126},{9612},{5832,7830,8621,9695,9972},{5528,9723},{6763},{7604,9549},{6609,9131},{4061,6353,8918},{},{6001,6188,6199,6877},{2841,5441,7074,8817,9392,9429},{3455,3531,3806,5611,9786},{3187,4004,6033,8903,9782},{},{},{4546},{3059,6652,7504,8283},{4655,5761,7313,8942,9045,9722},{6150},{4231,9427,9768},{2703,2769,3235,6821,8628,9102},{6404},{5161,6910},{},{3300,3847,4432,4596,9450,9922},{2688,4066,4916,5586,7704,8348},{2722,4478,9313},{4278,5214,7592,8519,9033},{4184,5961,6125},{5931,6590,8464},{3887,6244},{3579,3754,4628,6991,8093,9610},{3768,7999},{5113,5272,7532,7967,8888},{4195,8509},{4407,4782,6273,7093,8801,9113},{3566,6819,7973,7998,9905},{},{},{3518,5725},{5287,5814,7750},{3470,5965,8257,8336,9128,9585},{7433},{3475,4200,4437,4877,9497},{4668,8830,8945},{6545,6946,7110},{4045,6749,9679},{5957,7655,9483},{3427,4021,4490},{2814,2954,6832,7102,7910,8742},{5074,5485,9004,9467,9680,9820},{532,3867,4125,4611,5319,5948,7983},{4397,6302,6320},{},{5672,8674,8762,9653},{4038,6261,6291,8882},{4341,6031,7673,7882,9786},{4615,6848},{5250,5968,8564,8738,9598},{},{5167,5199,8571,8993},{2855,4600,6410,9325,9337},{3535,4824,6506,6777,7169,7614},{9719},{3099,4282,6830,8442},{6087,8353,9265,9389},{4440,6214,7599,8248,8464},{2782,4039,5401,6621},{},{},{4738,6269,6564,6579,7877,9372},{6097,8034},{4207},{6576,7512,8354,9519},{3291},{3622,5266,7201,8341,8947},{3228,6149,8184},{7661},{3759,6405,6580,8771},{4214,4414,4904},{3978},{8016,9229},{3753,6297,6547},{3055,3893,4322,5090,6620,7498},{3285,8343,8865},{3912,5766,5966,6979,7005,9567},{3430,6395},{5431,6308},{4281},{4916,5661,5683,8855,9491,9909},{3439,4961,7146},{4827,5538},{5957,6407,9755},{5184,6627,7111},{3736,6247,6766,7715},{6504,6520,6640},{6462,8726},{4880,6149,6692,9306},{2979,4293,7073,7184,9353},{2826,3116,4425,4708,4725,8305},{6061,8143},{},{2905,3101,4939},{8640},{7723},{2953,3212,3684,8868,9619},{5753,7415,7790},{3444,5295,8012},{7271},{5738,6166,6262,7476,9447},{2917,3331,6172,8839},{},{3116,3757,4594,8003},{3541,4213},{},{4022,4727,5083,7229},{3001,7214,7863,9641},{3922},{3946,4580,4960},{},{3783,5957,6138,7987,9037},{},{4004,5838,8380,9718,9769,9829},{},{7292,7337,9689},{8389,8881},{3275,3606,4317,4989,9657},{5146,5200,5722,6664,8297,9089},{4564,4644,6669,7139,9175,9415},{},{3337,9934},{5976,6971,7730,9394},{3853,7160,7387,7856,9715},{3100,3898,5168,6290},{3002,5171,6439,6630},{3206,4678,5065,5638,6380,8715},{3638,4763,5056,5695,8007,9928},{4346,6237,6915,7639,9358,9411},{9509,9757},{},{7050,9001,9751,9939},{2912,3279,3355,4045,8477,9490},{3701,5409,6211,6786,6978,7088},{3130,6593,8605,9567,9936},{3409,5453,9385,9721},{4610,4969,7029,7808,7931,8250},{3764,5038},{3264},{1817,3383},{5614},{3589,6529,9649},{6041,6229,7621},{5386,6013,7355},{4889,5487,6369,7281,7985,8473},{7411,7800,7820,9068},{3335,6275,7989,8472,8528},{5597},{4697,6577,8146,9059,9454},{3517},{3835,4328,4448,5155,7178,9741},{4210,5019,5241,6467,6782,9136},{5072},{4189,5029,5117,6540,6779},{},{5910,6077},{4416,4745,8550},{3954,5255,5994,7720},{4703,6900,7042,7073,9361},{3632,6348,7800},{},{2863,2920,4955,7449,8051},{4133,4591,8204,8761,9303},{5026,5454,6051,8400,8913},{4302,4635,6449},{3660,4827,5452,9006},{3637,5364,5437,5989,8089},{3335,3362,3967,6402,7812,8060},{5644,6099,6580,9815},{},{},{3699,3962,4248,4305,9402},{7250},{7126},{4413,4760,5189,8892,9647},{6661,6820,8579,8779},{4905,5910,8573},{3858,3978,7299,8770,9219,9844},{},{},{},{3715,4692,6500},{},{2935,3338,8971},{},{3612,4105,4273,8283,8703},{3188,4903,5299,6107},{4186,5900,6789,6956,7796},{6278},{4031,5740,6194,7108,7623,9760},{6131,9940},{},{8706},{4469,5933},{3489,5260,5326},{3380,7357},{4020,7365},{},{},{3799,5941,6600},{4286,4476,7715,8104,9236},{4949,5822,6158,6689},{5151,6634,7554,7775,9234},{3564,4109,6520,7769,8744,9334},{6911,8055},{},{4254,5297,5369,5932,6720,7012},{3314,4303,4964},{3347,3385,4925,7290},{3392,3593,5810,6484,7141,7635},{7733},{5183,8400,8407,9877},{},{6140,6685,7779,8473,8709,9111},{3785,8464,9408},{4133,6333,7626,7949},{2918,3006,4163,6548,8212},{},{},{3135,5299,6147,8042,9527,9809},{},{3075,3901,5052,8707},{3191,3648,5670,7871},{3150,3421},{8844},{3975,6604,7428,8852},{3791,5848,6395,6774,8688,9973},{3189,3960,4128,9735,9994},{5706,7276,8242,8260,8861,8878},{},{3312,3847,6548,7199,9004,9370},{3125,3666,6381,8538,8927},{3678,4852,7356,7847,8993,9549},{},{6034},{3454,4027,6278,6971,7575,9674},{3108,5113,5176,5414,5735,8243},{3868,4516,5351,8839},{3043,3422,3725,6757,7449,8599},{3770,4930,6300},{},{2115,2980},{4618,5489,7369,8380,9717},{},{3052,3391,4012,6865,8188,8824},{3145,4234,4506,5350,5815,7689},{3353,4793,5572,9611},{4990,9405},{4795,5777,5831,6023,6374,8739},{4044,5640,6976,7821,8953},{9481},{3855,7241},{8788},{4596,9746},{3277,4164,5768,6615,9936},{4513,7375,7837,7947,8247,9674},{6106,8496},{4077,4195,6117,9417,9833},{3318,6564,8662},{6600},{},{1716,3178,4155,5425,6357,8864,8865},{},{3315,7055,7654,8093,8726},{3835},{3028,7623,9496},{3898},{7831},{3188,3283,4674,6392,7935,8099},{3696,4305,5805,5971,6374},{4535,5493,8662,9474},{8171},{3233,4063,4775,6526,7928,8021},{7688,9482},{},{5373,7099,7340,7992,8851},{4363,5529,5995,7674,7987},{3302,5615,5887,7966,9146},{8493},{3320,5076,7838},{},{3243,4412,5377,5436,6158,8630},{4286,4488,5328,8076,8335},{6472,6845,7293,8770,9207},{4749,5232,6814,7520,7595,8244},{4431,5654},{3032,4839,5559,6250,7590,8129},{4660,5881,6018,7250,8717},{3180,6637,7813,9283,9832,9843},{5121,6928},{},{3417,4313},{3473,9087,9338},{},{4449,9411},{6341},{5272,7688},{6269,6456,9082,9383},{3252,4710,5123,7584,9792},{5431,5440,6131,7235},{4141,6732,8912},{},{},{3166,3334,6337,7144,7398,8794},{5655,6932,7986},{},{4928,4983,6447,8432},{4014,4203,4789},{4121,5364,7577,9847},{3087,3662,4873,4938,9090},{4955,6094},{3151,6120,8030},{5164,8443,9464},{},{3947,4109,6858,8162},{5004,6831,8046,8751,9595,9629},{4106},{4037,4709,4989,7007,7998,8095},{8631},{5133,6091,8763,9963},{},{},{4638,6662,6864},{5526,5643,6362,7827,9446,9586},{},{4093,7997},{5343,7330},{},{5541,5749,6435,6496,7137},{3656},{3309,4166,4276,5211,6607},{3490,3527,4720,7211,8045,8735},{9187},{6104,6751},{},{},{3028,3675,6653,6728,6815,7760},{3487,4164,4205,4658,7736,9821},{6639,6900,7081,8184,9662,9817},{6610,7602},{},{},{4232,6467,7303},{3547,4402,4490,6177,8912},{5604},{3733,4997,6492,6506,7423},{3052,4402,5280,7123,7142,8472},{},{7525},{4496,4527,7123,9285,9662,9961},{8781},{5080,6389,6565,7944,8094},{3055,8000},{6738,7665,8897},{6552},{4219,5434,6560,8372},{4161,7551,8195,8568,9039,9147},{7435},{},{5747,7019,7576,8372,8430,9887},{7852,9779},{3775,7567},{7099},{5716,8831},{6043},{3355,6681,9592},{},{4236,5267,8992},{3452,5858,7059,7226,9778,9980},{5446,5977,6035,9398,9658},{},{},{9244,9594,9682},{7601},{4215},{7440},{3616,6502},{},{},{7181,9479},{6044},{4566,4735,7406,7500,9989},{4288,6933,8314,9224},{3482},{5304,5552,5737,6066,6793,7392},{4609,7985,9564},{3610,4108,4858,5569,5854,9799},{3910},{},{4131,4226,5679,6504,6826,9803},{4088,5945},{3971,4690,6639,8125,9423},{6503,6883,7231,7630,8536,8632},{3304,5370},{6450,9174},{5146,5586},{4228,7196,7583,7852,8535},{4382,4557,5889,6938,8099,9876},{8646},{},{9380},{8478},{4034,4262,5768,6310,8166},{4375,4763,6617},{7055,9392},{6098,6654,7022,7125,7708,9437},{3859,3868,3999,4297},{},{3965,4438,6173},{3996,9106,9217,9317},{6228,8764,9340,9406,9958},{6531,8622},{8835},{8560},{},{4670,6062,6153},{3604,3707,4638,6145,7292,9034},{},{5092,7438,7975},{5701,6677,7215},{3848,3915,6211,7083},{3566,6780,8744},{6538,6898,7898,7911},{8323},{3145,5175,7203,7215,7829,9310},{3447,7777,7888},{},{4094,4910,5225},{3411,3446,6274,6442,7276,7281},{4728,5007,7150,7931},{5614,6974,9578},{4399,4636,6869,7278,8927},{4459,6445,7682},{3269,4278,6776,8942,9098,9823},{},{4047,5434,9430},{3918,5800,9014},{5704,7958,8674,9745},{4356,5273,6271},{4243,4792,4888,4912,6165},{4331,6216,8193,8346},{3265,3319,4366,7983,8497,9899},{3519,3569,3707,7754,7878,9740},{3528},{},{4933,7921,8146},{5106},{8566},{5114,5373,6155,8933,9818},{133},{4589,4754,5012,7461,8981},{},{3194,6503,6786},{8819},{5274,6749,8873},{3630,3932,5366,7151,9603},{7337,8104,9866},{},{},{},{4665,4754,9247,9914},{3353,7261,7538,7711,9442},{6871,7220,8534},{3667,3675,5047,5929,9147,9196},{8565},{},{3598},{9329},{4907,4960,7980},{5964,8647,9143},{},{4495,6631,7248,7619,7704,8686},{3166,4558,5952,6544,8945,9737},{4421},{6298,6447,7525},{},{4744,5303,8788,9764},{},{5190,5817,5978,9112},{3473,6385,8976},{4603,5369,6046,9904},{4336,4745,5726,8244,8936,9347},{3884},{5024,6127},{3950,4091,5658,6240,6470,7923},{3632,3791,4585,4754,6357,9958},{5966,6890,8418,8618,9476},{3826,6643,7984,9532},{5005,6255,9087},{4208,4766,6072,7389,8942,9854},{},{3292,3919,8511,9167,9283,9962},{4329,5297},{7685,8006,9067},{3399,4769,5775,8320,9303},{3303},{7169,7965,8206},{4029,4509,6905,7792,8594,9243},{4173,4735,7462,7464,9900},{8081,9200,9677},{3660},{3266,4308,4988,8567,9837},{4484,5783,5934,7544,7584,9249},{3701,4287,5952,7037},{4936,5453,5919},{3275,6697,7308},{},{},{6326,8169},{},{3303,7585,8079,9146,9382,9896},{4003},{},{5671,5874,7341},{},{},{4686,8661,9722},{3497,4927,5290,8435,8820,9780},{3252,3386,4260,8024,8585,9108},{6263,8347,9829},{},{4821,5498,6317,7257,8594},{3610,5094,5723},{3431,4037,6625,7938,9253,9826},{3355,4421},{3219,5287,8520,8536,8689,9442},{},{5592,7220,8138,9280,9604},{4417,4914,8929},{4305,7096,7979},{4400,4419,5764,8009,9219},{3318,3757,5641,9207,9814},{4495,4717,7772,8335,8880,9657},{5057,5122,5207,7226,8404,8964},{4113,4680,5023,6113,8540,9373},{},{4215,7856,8871,9410},{9576},{3837,4659,4878,7299},{3997,7446},{},{4408,8059},{},{3953,4117,6633,7380,9193},{4224,5029},{},{7180,7930,8497},{3716,3818,4541,5102,8103,9338},{4883,6580},{},{3527,6986,7791},{4176,4844,5155,5590,7824,9497},{5568,7146,7618},{4323,6012,7629,9730,9743,9763},{3791,5953,7265,7741},{4932,5584,5639,6689,7577},{4902,5664,6729,8929,8971},{},{6119},{6529,8261,8340},{8697},{9811},{4828,5330,6144},{},{6371,7368,7556,7923,9033,9806},{5502,6939},{},{4587},{5004,5751,6765,7234,9643,9803},{5103,6691,9811,9865},{8149},{5306,7362,8118,8264},{4009,4986,6470,8064,8985,9177},{5082,6415},{},{3523,3590,8058,9765},{4189,4268,6182,7581,7802},{4578,5054,6001,6513,8562},{4644,5424,5867,7516,9883},{5410,7203,9044,9348},{4178,7539},{},{},{6469,6776},{4148,5927,7719,7897,8043,8564},{6837,9853},{6823,7963,7985,8112,8237},{6086,8073,8802},{6228,9507},{4980,5567,5733,5791,9378},{4692,6853,7372,8667,8973},{8265},{4920,5137,6876,6883,8033,9646},{7661,8670},{3736},{4715,6502,7155,7369,8000,9163},{4944,6518,6640,7135,7165},{4232},{7505},{4104,5106,5745,6263,7454},{5405,7981,9895},{},{6832},{4896,6522,8892},{4930,6715,8251,9003,9565},{3527,3645,7096,8691,9968},{5213,6223,7204,9871},{4102},{},{3301,3530,5183},{},{3411,4209,8637},{},{4560,6125,7345,8510,8701},{},{},{3827,9776},{3464,3626,4135,4802,5104,9222},{},{5700,8431},{4764,6329,7511,7737,8434,9208},{},{4351,5643,8481,9117,9613},{7661},{8933},{4096},{4466,5248},{3378,5146,5708,6884,8089,9176},{},{5518},{3544,4222,4860,7307},{6180,6644,9953},{7270,8213,9548},{4771},{},{},{3766,6172,6193,7328,8429},{4793,8147},{9998},{4652,5512,7841,8542,8618,9783},{},{3328,4238,5721,7798,8419,9111},{7085,7651,7839,8573},{3694,3838,5492},{},{3562,5021,8193},{4525,8245,9256},{3742},{5457,6463},{6128,6981,8060,8299},{4339,4767,5851,6425,7236},{},{6404,8466},{6412,7501,9283},{3558,5900,6544,8290,9806},{4650,4691,7276},{5617,5820,7257,8302},{4128},{4071,4455,5452,8047,9622,9767},{7502},{9302},{5075,5541,6368,6455,7916,8325},{8205},{6459,7147,7898,8979},{4598,5508,7057},{5011,8304,8924,9717},{1079,3457,5962,8060,8343,9351,9762},{3642,3993,5964,6098,9602},{4768},{},{4731,4858,5166,9635},{3653,6715},{4504,5388,5934},{6154,7292},{6003,6531},{4370,5772,6001,8218,9181},{4536,7205,8016,8157},{3842,4143,5851,7197,8312,9893},{4534,7050,7095,7284,8543},{3351,5270,7203,8044},{4090,4638,5145,6283,7600},{3487,4013,4564,6528,9110,9959},{3769,4198},{3441},{4314},{3778,8489,9859},{7334,8937},{3799,4410,8826,8969,9348},{3563,3904,6512,6662,7194,8187},{3393,7347,7901,8396,8826,8827},{4599,5663,7912},{3527,3585,4535,4854,5414},{5306},{3923},{6198,9535},{6177,6647},{5556,8718,9961,9994},{7600,9557,9954},{3966,4351,5266,6669,7606},{3603,4241,6104,9521},{4168,4213,4926,8650},{6950,7054,9532},{3955,4112,5414,6545},{7511,8833,9386},{},{4330,4810,6416,7520,7536,9730},{},{7695,7833,9057},{},{3426,4581,7302,9394},{},{4093,4239,4966},{5538,5726,6667,7408},{4134,5321,5431,8520,9483,9929},{5104},{},{5317},{6917,8089,8457,8748},{4125,5367,5520,6070},{1344,4137,9820},{5169,7836,8404,9113},{3984,4097,5484,8334,8675},{5078,5856,6066,7162,9358},{5323,5682,7280,9336},{6833,8413,8581},{6220,6744,7755,8860},{4977,5972,6855,7938,9116,9586},{},{3934,4470,4830,6680,7411},{4620,4881,5851,5899,6423,9227},{1260,4092,5074,6504,8356},{7214,7765,9241,9406},{4006,8614},{3957,5522,8560},{},{6967,8248,8989,9165,9769,9888},{3572,4892,5003,8394,8778},{8911},{7009,7700,7772,7979,9281,9775},{5372,6156,9679},{8615},{3460,3887,4336,5987,7711},{3470,5487,5869,8447},{8955},{4099,6292,8233,9924},{4341,5997,7117,9347},{1578,4185,5287,5893,8083,8792,9850},{4355,4524,4774,6127,6459,7954},{7080},{7930,8126,8694},{4265,5101,5552,5836,7880,7889},{3878,4473,6971,7502,8009,8788},{2914},{5572},{5275,6708,6802,8666},{3503,4255,4838,4935,6238,9618},{4372,5224,6578,8212,9518},{7017,7205,8251,8424,8469,8987},{4613,5677,6356,6704,9603},{3820,6035,6386,9460,9553},{4477,8708},{4701,5104,5154,7346,7881,9497},{4005,9319},{4087,7913,8338,8400},{4901,5875,6985,7529},{3777,4122,4560,6715,7888},{3820,4634,6274},{4625,5062,8870},{5376,7976,8685},{8502},{8067},{3474,3485,4297,5187,8011,9185},{3714,4100,7522},{4095,8557,9495},{3829,5088,8910},{6001},{4676,5384,5479,6963},{6067,6585,7034,7657,7705,7728},{3832,5213,5909,7322,7953,8205},{9569},{7587,9700},{3591,4144,4238,8772},{4338,4474,7672,9572},{4308,6963},{3721,4324,5136,5595,8602,9542},{1754,8102,8528,8571},{4449,6617,8357,8483,8576,9527},{4664,5986,6287,7721},{3867,5662,6437,8259},{3467,4709},{4395,4983,5096,8166,8943},{4413,9657},{3762,4278,6612,7778},{6911,9173,9923},{4202,4902,5010,6784,8160,8689},{5119},{3933},{},{},{},{6641,6655},{4332},{4650},{6551,7237},{5605,5903,6150,6303},{3792,5407},{3821,3991,5496},{},{7591},{},{3962,8740,9104},{4414,6142,6393,6994,7211,8801},{462,3517,5283,6537,8818,9662},{},{5400,7093,8069,8144,8589,9920},{6635,9155},{7636,7863},{5902,6186,6314},{5488,8330,9445,9612},{4932,9102,9472,9818},{7762,8658,9027,9837},{6111,6692,6900,7327,7931,9389},{3495,5087,5548,6821},{6724},{4170,6645,7570,9956},{4407,4477,4586,6279,8729,9382},{8873},{3989,4322,4664,6430,6938},{4699,9824},{4000,4336,5383,6948,7743,9691},{3573,4375,8306},{5382,7552,9011},{},{5608,8213,8573,8911},{817,7745},{4139,4310,4828,5881,7516,8310},{5954,6772,7362,7806},{3847,5731,7206,7625},{6563,7716,9207},{6667,8219,8392,9056},{3539,9760},{3632,7369},{3968,4749,5789,8104},{5929,6555,7645,8011,8054,8060},{8909},{},{4811,5112,5250,5385},{},{4384,5207,6310,7098,7248,7677},{6385},{},{9634},{4646,5988,7203,7844,8787},{7854,9839},{4368,4570,4639,4744,7948},{4508,6160,7337,7532,9424},{4764,5527,6632},{5040,8061,9148,9254},{5426,6454,6943,7363,7430,7619},{6296,7024,7739,8377,8391,9571},{},{},{},{6970,7746},{4656,6912,6977},{},{4836,5919},{9802,9805},{},{4156,6158,9261},{4552,6825,6893,7723,9288,9480},{7357,7816,9465},{3811,4075,5346,5801,6606,8011},{3806,4127,6173,7490,8272,9929},{3663,5158,7163,8730},{8023},{8792},{},{3729},{3851,4791,5226,6548,7303,9927},{},{4095,4383,4717,5826,7795},{5526,6262,6331,6935,8257,8644},{4386},{4923,5430,7620,8061},{3559,3901,4030,5133,9106},{9210,9685},{4043,4794},{5399,5529,5984,6306,7685,8565},{6319},{4143,7001,9691,9787},{5332,6618,8017,8362,8914},{4077,4544,4974,5172,6512},{5673},{6695},{8570,9092,9624},{5389,9964},{4312,6139,6450,8013,9007},{5237,7955},{4279,5578,5728},{3580,5443,6435,8513},{4942,7325,7328,8433,8527},{3756,5418,5891,6200,8744,9899},{4166,5087,7270,9097,9953,9986},{5769,7192,7383,7768},{},{6516,6552,6939,8052,8687,9560},{3927,6188,6495},{},{5188,8293,8531,8811,8833},{4588,6302,7303,7674,8670,9262},{4268,5351,5612},{3992,4507,9639,9697},{7314,8537,9204,9307,9846},{3655,4065,4586,4642,5827,9682},{7798,7873,9279},{3591},{6348,7354,9411},{4848,5952,7573,8312},{},{},{4050,4420,5699,6428,8482},{7063,8634,9338},{3619,3650,3685,6398,8449},{5512,8418,9341},{9120},{2123,4771,5102,5289,5330,5865,8004},{5022,5807,6097},{5365},{5224,5965,7818,8970},{},{4348,5156,5955,7384,8229},{8721},{3654,5567,5805},{4005,4490,6808},{3757,4547,4850,7612,7732},{3744,4616,4940,9406,9410,9457},{},{4676,5549,7099,9505,9613,9983},{3959,6063,6858,7324,7885,8894},{6305,8257},{4884,5342,5626,6212,8409},{4636,6768,8964,9635},{5247,6035,6658,6919,7823,8087},{3827,4988,6385},{3823,4007,5689,5958,7443,8533},{5767,8669,9199},{6121,6516,6761,6967,7237},{5152,5165,6525,6576,8962},{5102,5942,6145,6936,8775},{4658,6643,8468,9187,9786},{4895,5979},{4013,4411,5544},{3864,8603},{4814,4964,5157,9566},{5827,6985,7601,8608,9919},{3673,5633,8142,9597},{4476,5892,8576,9981},{},{9816},{7227,9377},{5509},{3942,6385,8320},{7029},{6923,8455,8828},{6567,6621,7457,7925,8644},{4256,4692,6275,7041,8254,8694},{5845,5897,6099,6685},{8537},{6734,7095,9924},{5454,5992,6306,6616,7500,8519},{5422},{},{4762,6029,6556,6622,6752},{4113,7226,7434},{},{4142,4342,6285,7190,9518},{4254,6715,7177,7602,8835},{8217,8314,8938,9913},{4254,4957,5834,7070,9637},{5834},{3916,5756,6886,7967,8916,9619},{3789,4307,5216,5608,9567},{4720,8752,9159,9338,9692},{4678,7712,7898,8430},{5873,6452,8882},{5347,5448,5657,8656,9391},{5111,9134,9346},{3687,5133,8677},{4085,5417,7004,7477,8633},{5102},{9357},{},{5854,8965,9362,9924,9975},{4392,5073,5343,6903,8599,9087},{4312,4739,8406,8696,9019,9562},{},{7300,7383},{3778,5192,7115,7914,9999},{4636,6077,6765,7039,7152,8059},{3709,3961,4424},{4096,5315,5749},{7985},{6812,7122,9626,9977},{3757,4017,5922,6664,8186,8915},{7017},{5094,5520,6322,6671,8924},{},{9125},{8316},{3762,7771},{5185,6594,9486,9832},{3842,5181,5612,6195,6440,7536},{3973,4147,6269,9257},{5396,8026},{5124,6024},{3977,8741,8914},{4295},{},{4956,5476,8099,8500},{8153,9419},{8768},{},{5092,5325,6084,7070,7153,7370},{3984,4290,4478,7343},{4399,5666,6940,7141,8286,9418},{4238,7460,7611,7814},{4639,5349,5603,5993,7948,8011},{5483,8309,9210,9488},{4835},{3794,6186,7091,7390,9531,9549},{},{5911,6920,7668,9372,9677},{8945},{5051,9511},{5316,8372},{4308,9262},{7148},{5841,7791,8311},{4215,5226,5351,7943,9013,9587},{6282,7368,8289,8353},{4149,4172,5809,6715,7386,8687},{7748,9220,9958},{5465,5642,8436,8817,9117},{4367,5322,8333},{8726},{},{7162,9336,9867},{},{4273},{3943,6187,6573,7021,8441,8571},{5375,5524,6966},{3732,3836,5235,7044,7082,7753},{8541},{7181,9660},{},{},{5112,7176},{5113,8126},{4916,5553,8299},{4619,9517},{6328,6962,7465,8199,8993,9581},{4471,4578,4982,6814,8746},{8267,8666,8675},{4128,4265,5796,8540,9207},{},{4111,6534,6876},{6877},{5546,8773,9303},{3849,7196},{8080,9423},{5516},{4781,6502,7825},{},{},{},{6316},{5309,6801,7371,8096},{4258,9709},{4825,8383,8397},{},{4469,5460,5633,7167},{5333,8859},{4622,5057},{},{4177},{3923},{4232,4404,4427,8674},{4337,5771,6267,8767,8829},{8677},{3999,6734,7480,9504,9972},{6280,6956,7387,7476,9491},{3816,9507},{3865,4036,5645,5798,8026},{},{4873,9654},{4008,6519,7832,8276,8450,8873},{4563,5106,5903,9250,9558},{6241,7763},{5761,6397},{7815,8373,9194,9878},{4409,4599,5215,6432,6494,9290},{4214,8955,9579},{6119,7396,7726,8149,9379},{4049,6324,6959,9589},{6193,8239,9376},{4079,4942,5048,8479},{5441,5498,5564,9154},{8728},{5849},{4570},{5479,6570,8615},{5078,6448,8540,9417},{5992,7004,8755,9563},{3934,7713,8282,8680},{4665,6926,8076},{7399,8441},{4438,6100},{4448,5111,5700,8068,8686,9891},{6506,8717,8957},{},{4887,5059,7976,9258},{6502,7032,8370,8378,8788},{6623,6746},{7000},{5492,6823,7210,8078,8441},{5624},{2899,6929,7715,7801,7822},{6662,8530},{},{6151,6912,7598},{4429},{4405,6461,6826},{5233,5467,8317},{3947,4782,5214,5805,7240,7795},{9794},{4957,5301,7358},{5244,9580},{5062,5302,5848,7527,8766,9692},{4094,4349,4404,4671,6497,9352},{4291,5057,5316,7365,7921,8712},{6089,8848,8984},{4281,4885,8600,8700},{4496,5870,6392,6871},{6374,6458,6840,9206,9640},{},{5903,7344,9567},{4629,4689,7507,7827,8494},{4832,6837,7279},{6499,6889,7293,7914,8199},{4924,5169,7867,9302},{4082,6127},{6061,6759,8109},{6575,7623,8655,8922,9811},{4366,4959,6225},{6939,8909},{6549,7693,9948},{5398,6523,8919,9786},{4857,6164,7343,8077,9603,9668},{4161,7575,7956,8166},{1751},{4614,4867,5327,6850,7324,8204},{5935,7727},{3926,4145,5582,5850,7318,9776},{4026,7707,8948,9651,9898},{4600,5796,6056,7570,9024},{8534,9720,9985},{4212,5912,6595,8566},{6204,7245,7764,8897},{5563,6902,7096,8484},{6324,9445},{4175,4784,4993},{9362,9821},{},{4063,7553},{},{6126,6592,7004,7939,8201},{6743,7346,7800,9874},{4174,6864,8155,9567},{5666,5854,6074},{3898,9534},{3978,4277,4592,5715,6672,7054},{4797,5064,5325,5699,9356},{4180,4249,5046,8356,9090,9894},{4833,5495,6506,7474,8881,9540},{591},{5663,7701},{5980,7642,7783,9528,9927,9978},{4796,6320},{7636,7639,8137},{9029,9692},{5418,6058,9367},{9229},{4778,7414,9730},{4778,6857,9762,9966},{4131,6286,6406,7220,8634,8706},{},{8799,9129},{4086,6174,8035,9568},{4127,4442,4467,5917,6301,6653},{4727,4965,6054,7562,7952,9871},{5358,5591,6971,9977},{4589,6355,8303},{3941,4205,4751,9334},{},{5897,6429,6510,9145,9449},{4187},{5877,6599,6951,8734,9412},{},{5192,6617,6709,9819},{4330,9611},{4339,5125,7874,7916,8726},{7532,9436,9562},{5353,7203,8243},{3990,4599,7258},{4736,4760,6260},{4924,7768,7793},{6720,6961,7892,9103,9369},{4986,4999,8187,8529,9227},{4178,9844},{4723,4934,7379},{5513,5960,7125,7987,9576},{4227,5235,5470,9478,9941},{5308,6928,8657},{6317,6704,7707,9632},{5532,9200},{4462,4535,6264,6333,7851},{4183,5152,7530,8281,9139,9982},{4533,7686,7996},{5791,5937,6784,8191,9781},{4548,4822,4936,5399,6597},{4489},{6133,6228,7349,8173,9015},{5042,7693,8121,8370,8937,9024},{4395,5009,5680,5970,9645,9825},{4395,4915,8450,9941},{4899,6122,6810,7850,8699,9041},{6378,8283},{},{4272,5475,6100,8847},{5993,7650,8703,8736},{},{5386,6748,7468},{8611},{6075,8549,9149,9202,9669},{},{5230,6378,7022,7659,8615,9500},{},{},{4714,5016},{5776,5940,6150,6690,8480,9451},{5301,7108,7658,8601,9142,9923},{4295,4705,4722},{9011},{4629,7139},{787,4942,6762,7255,7878,8051,8684},{},{5212,9180},{8643,9067},{6331,8477},{5604,9045},{6625,7141,7727,8748},{5315,5967,6647,6861,9791},{5094,6513,7778,8561},{5207,5303,6082,8647,9098,9321},{5223,8768},{3951,5904,6638,7711},{},{4786,7590,9534},{5781},{3959,4235,4932,5581,6290,8113},{},{5469},{7385,7834},{4181,7258},{4020,6055},{},{5218,6618,7437},{7671,7740,8220,9597},{229},{6465,7384,7805,8268,8533},{},{4116,6609,6791,7790,7861,8186},{4141,6753,7626,8025,8189},{6130},{7405},{6431},{3975,5352,7219,8657},{},{5565,5620,6510,8141},{},{8939},{5509,5658,7703,8662,9524,9883},{5753,6308,8996,9610},{5224,7367,8486,8848},{5678,8175,8366,9567},{6317,7019,7089,7952},{4571,7629},{9672},{6190,6452,7176},{5827,6391,7071,7888,9551},{4680,4992,5885,6331,7047,8421},{4715,6413,8660,9089},{5964,6396,6843,9184,9476,9748},{8744,9762},{5982},{5297,5366,6843,7359,9014},{4639},{6880},{4233,5777,5961,7600,8570,8823},{4809},{},{4636,8488},{7001,7757},{6140,6587,7850},{5969},{5304,7935,8039,8519,9826},{9289},{},{},{4729,5789,7342,7723,8857,9621},{5130,5414,5546,7296,8528,8551},{5020,5442,5502,9471,9577},{5516,5665,6372,6431,7100,7394},{7111,9871},{4253,5180},{6113,8263,8265},{6367,8768,9512,9542,9648,9841},{6165,6297},{4188,4687,7359,9151,9764,9934},{6777},{4183,4529,4729,7793,8426},{4142,6421,8997,9494,9930},{4443,4823,6321,6684,7495,7941},{4378,4544,4937,7800,7971,9202},{5907,6596,6816,7776,7936,9827},{4845,7232,7323,7937},{5023,5520,8489},{},{6511,6640},{5627,8546},{5350,5809,9438},{7135},{8046,8956,9334,9400},{5982,6384,7168,8561},{3009,4508,5193,6704,8299,8764,9344},{5972,7677,8128,9706},{4154,4314,8382},{4354,7719,8387,9020,9687},{5991},{},{},{4783,5804,6921,8745,9451},{},{},{5367,5699,6056,6715,8756,9486},{},{6382,8210},{4210,4282,4555,6932,7665},{5443,6313,6658,6884,7573,9222},{5171,8715},{1908,9424},{4225,5717,8509,8878,9429},{4388,9823},{},{5015,8804},{4109},{5530,7393,8735,8919,9728},{5988},{4503,5206,6170,6177,7811,9209},{5315,7342,8916},{4207,5060,5312,5489,5690,9345},{4043,4948,5993,7771,9364},{},{6491},{8130,8628},{5358,5998,6061,6434,7280,8919},{4552,4689,5477,6124,6486,9246},{},{4846,5048,5193,5664,7361,8126},{},{7254,8442,9336,9621},{5995,7153},{8356,8873},{4706,4739,5428,6200,6955,8905},{5521,5535,5946,6411,7185,8849},{6938,7337,8135,9270},{8998},{6560,7263},{4699,9126,9525},{8349},{4265,6330,8359,8545},{},{5680,6145,6858,7613},{4610,4656,5829,8210,9470},{4476,5260,6451,6898,7936,9967},{4924,5248,5454,7926,8412},{5956,6024,7783,8424},{},{4341,4428,8608,9140,9634,9728},{4474,4751,4800,7632},{4920,5685,6175,9545},{4973,4976,6167,6280,7421,7703},{4112,4651,7179,7641,7935,8767},{4673,5514,8238,8604,9601,9950},{8814},{},{},{4423,5514,7042,8070,8115,8587},{6236,6253,8638,8759},{4817,5694,9008},{4716,6615,9035},{5012,5148,7282,7359,7597},{4839,6818,8727},{4217,7211,9463,9635},{4553,5052,5447,5449,6601,8258},{5873},{4628,6685},{4720,4971,5412,6441,8857},{5184,5939,7119,7238,9061},{4881,7278,9109},{4229,7436,7454,8175,8539},{5637,8776,9594,9976},{4252,6954,8242,9417},{},{5886,5905,6611,7938,9728},{6863,8270,9066,9616},{5692,7522,8152,8513},{8425,9248},{},{5631,6420},{5104},{6191},{4617,5095,7845,8157,9504,9798},{6477,6495,6802,7294,7390,7930},{6420,7139,7198},{},{6524,6574,9079},{4626,4989,5546,6364,6769,9756},{4615,5026,5173,7598,7979},{6047,6703,6873,7024,8869},{7049,7851,8159,8397,8693,9295},{6139,7014},{},{6660,7622,8670,9332},{7537,8811,9640},{5143,5316,8002,8526},{},{6718,9271},{},{8802},{6189,7544},{4380,4421,6308},{4515,4979,5348,8859,9022,9144},{9081},{9303,9801},{},{6581,7574,8332,8583,8786},{1644,4317,4891,7641,7667,8471},{5750,6756,8298,9693},{4561,5333,6107,6426},{},{},{4251,6306,6657,8520},{},{},{5543,7323},{6779,7181},{4308,4901,5426,6188,7603,8902},{4334,8077,8460,8677},{5990,6279,7604,8886,9063,9904},{},{4970,5618},{5525,5769,6431,7079,8967,9667},{5269,8459},{5036,6325,7316,9733},{},{9182},{4725,4839,6849,7200,7358},{4545,9721},{4760,5028,6174,8078},{5005,8070,9869},{6885,7462,7923,8144,8605},{4935,7335,7822,9692},{4194,4244,7046,7567,9301},{5089,8829,9414},{4725,6945,7754,8253,8719,9101},{5438,6349,7048,7201,8390},{6918,8260,9069},{},{4230,4769,4860,8321,8848},{6835},{4913,4952,9075,9466,9553},{4332,8983,9998},{7423},{5395,8394},{6159},{5611,7759,8885},{4216,4397,5947,6215,6386},{4682,5508,6185,6520,8150},{6808,9292,9524},{4619,7483,8288,9399,9936},{7451},{5838,6007,9330},{5846},{5031,6609,6931,7746,8575,9576},{5148,6159,8004},{6907,7391,7817},{6797,7553,8739,9026},{5975,6178,6669},{4380,4416,6671,6985,8218,8750},{4992,5387,7349,8917},{},{4703,7108,7828,8079,9387},{6129,6426},{4687,5008,5818,7789,8565,8709},{4372,4780,5003},{},{5258,6640,9840},{4613,4909,4957,8448},{4846,5076,6448,7559},{4635,6811,9032},{4732,5460,6202,7925,9218,9390},{4627,5556,5756,5979,8635,9033},{},{4699,4777,4872,6923,7992,9785},{5374,6710,8761,9220},{6016,7112},{},{4445,6174,9118,9609},{8976},{4619,4734,6274,8232,8355},{6794,7820},{4605,6943,7295,8440,9211,9260},{8189,8551,9227},{4316,5371,8059,8142,8467},{4822,6266,7879},{4832,7002,7976,8277,9067,9956},{5638,6638,7331,8297,9513},{6085,9679},{5853,7840},{6312,7539,9060},{6913},{5846,8256},{5890,6276,7192},{5412,7506},{4671,6266,7069,9473},{5785,5789,5872,8123,8500,9597},{},{6291},{4867,5209,6599,7295,8576,9238},{},{4838,6081,6450,6951,9011},{4848,7406,9472},{4223,6236,6831,6836,9458},{5873,9146},{4595,7592,7689,7926},{5651,5673,7713,7844,9231,9293},{6003,7040,7338,8602,9273,9586},{6176,9161,9574,9667},{4856,7528,7535,8001,9265,9537},{},{6890},{5683,6502,8882},{4529,5689,7670},{4837,5064,5720,7103,8363,9211},{5146,8256,9553,9829,9851,9867},{5070,5622,5801,9030,9333},{5956,7058,7503,9761},{4586,4884,5930,6732},{4780,4785,4799,6780,8731,9027},{4465,6425,9719},{4840},{4551,5040,7658},{},{5401,7425,7630,8952,9049},{4987,7117,8004},{},{},{5388,5422,6177,9319,9753},{5564,7459,7950,8369},{6128,7442},{4331,6409,6603,8463,9378,9536},{7330,8365},{5100,6870,7407,7452},{5931,6750,8556,8820},{8242,8641,9883},{7684,8653},{5600},{4614,5771,7615,9112},{},{5853},{8067,9145,9343},{7323,8551},{5486,7327,9584},{6808,7146,7643,8837,9964},{4071,6123,6382,8120},{5033},{6825},{4307,4925,6856,9155},{4826,5663},{4785,6060,7794,8627,9953},{4548,5203,6533,7431},{4577,6721,9032},{4769,5827,8930,9302,9464,9767},{4274,4466,7333,7430,8548},{6097},{4792,9003},{7642,8605,8909,9870},{6913},{},{4535,5461,8646},{6308,7306},{6941,8479,9383,9813,9955},{5327},{6274,7235,7999,9202,9597},{6956},{8008,8732},{4808},{5238},{7914,9521},{6297,6345,8570,9981},{5503,5515,5755,7521,7605},{6780,8532,8651,9387,9709},{4615,4653},{8357},{},{6345,6476,8485,9144,9253},{8136,8848,9067,9890,9986},{4839,4908,5081},{4464,4974,7123,7629},{},{},{4344,4347,7737,8261},{5859,6812,7258},{9022},{5275,6294,6448,7790,8734,9543},{5082},{4325,6128,6918,7224},{8975},{7341},{4858,8835,9153},{7640},{4930},{},{4511,6193,6256,7473,9493,9575},{},{7836,8565,8919,9016},{5405,5677,6367,6892,7598,8086},{4589,4910,5664,7224,7238,8422},{4935,5400,6091,6844,7872},{4358,6767,8516,9013},{6476,8954},{5387,7286},{4348,9926},{5863,7620,8264,8430},{4994,5854},{5175,5365,5749,7990},{7270,9585},{},{6375},{},{4954,7607,7839,9825,9897,9921},{5567,5951},{4927,8871,9306,9585},{4350,4903,5658,9499},{},{5384},{4460,5039,5447,8336,9054},{6123,6734},{4541,4656,5753,8438,9868},{7276,7668,9200},{1676,5717,5805,9062,9527},{8622,9016,9279},{7039,7269,8234},{4593,8876},{4482},{},{4738,5077,7810,9980},{5212,8866,9309},{4815,5730,6677,7573,8580,9072},{7519,7618},{5323,8317},{7002},{4416,4734,6596,7176,9371},{5137,5441,8723,9116,9878},{6681,6799,8312,8960,9624},{5180,8107,8124},{8701,9025},{4961,5314,5498,5781,6936},{},{6963},{4908,5823,8009,9477,9963},{3659,4616,6393},{4820,9651,9933},{},{5136,5311,5709,7695,7776,7939},{5104,5635},{5088,5479,6827,7326,8310,9298},{8466,9246,9564,9883},{5383,5756,6017,9243},{},{5871,6783,7661},{5860,7867,8307,8525,9395},{},{6053,9504},{9950},{5135},{7037,8764},{4975,6527,6675,7138,9209},{6637,7427,8060,9169,9251},{5780,9994},{9583},{6665,6829,6897,7830},{6490,9331},{5023,9024,9606},{4590,7383,9967},{5629,6837,8288},{7120,9144},{6441,6607,9517},{4972,9344},{5368,6335,6521,6557,6594,9563},{},{4487,5409,6281},{5133,6517,8097,8271,9611},{},{4535,8925},{4992,6370},{5000,5494,6713,7400,7844},{7530,8286,9300,9482,9808,9860},{8813,9073},{4766,5336,5850,7263,8989},{4546,6481,6544,7148,7987,9431},{6783,8737},{5220,5295,5754},{4963,5117,5242,6524,6870,9963},{},{6871},{6974},{6742,6899,7754,8548,9357},{},{4513,6820,8277,8340,8919,9630},{8578},{5227,6469,7358,7525,8284,9033},{8742},{6245,8598,9260},{4535,5672,5804,6669,6899,8850},{5841,7332,8855},{5717,8317},{5154,5937,7707,7746,8636,9893},{4589,8399,8656,9921},{4578,5227,5344,6112,8222,9350},{5903,9851},{5927,7172,7904},{5895,7016},{6106,8043,9984},{4636,5447,9320,9455},{},{5109,5593,5733,6257,7779,8947},{5191,5267,5797,5945},{5735},{7528,9501},{5642,6587,8332},{4838,6267,7235,8144,8999},{5335},{4828,5385,7566,7896},{5066,6758,8282,8408,9833},{6250,8471,9381},{4457,4866,5084,7053,7314},{5641,7041,8075,8340,9731},{4766,5724,7326,7538,7640,9142},{5910,7347,8424,9658,9790},{4485,7955},{4530,5426,6255,8462},{6773,9209,9544},{5291,6486},{7537,9097,9305},{7042,7626,7838,9097,9484,9920},{4601},{7251,7879,8776,9131},{9182},{5158,8842},{6110,6197,6659,6857,7032,8885},{6014,7207,8687,9180},{5111,5125,5417,7292,7427,8393},{7239,8507,9346},{6398,7701,8315,8994,9107},{5322,5503,5692,8307},{},{7402},{5405,5732,7274,8757,9060},{4565,5136,5217,7067,9376},{6701,8612},{5542,6927,6984},{5614,6351,8833},{5078,5566,8183,8505},{6525,7836},{5280,5506,5866,8749,9020,9766},{4933,5595,7129,9606},{},{7975},{4807,5489,8094,8480},{5070,6387,6708,8468,8734},{6701,6891,7000,7060,8748},{},{6004,6252,6396,8845},{4628,4696},{5926},{6019,6776,7095,9061},{7336,8792},{4808,5829,6253,9320},{9518},{5086,5855,6723,7954,8023,8580},{},{5724,7177,7685,8060},{4739,5292,5932,6206,7305,7881},{},{7724,8179,9080},{7590,9383},{6590,8422},{5268,7267,8098},{5719,5839,7484},{},{},{},{},{5605,7087,7618,8704},{4965,5396,6203,6714,7049},{5539,5555,8754,9634},{5843,6093,9038},{6765},{5381,5695,5869,7398,7727},{6108},{6082,6433,6510,7273,8763},{5052,6168,6745,8393,9116,9244},{7518},{},{},{},{4555,4925,5613,6247,8858},{6816,8587,9286},{5178,9667},{8194},{4529,4887,9568},{6182,8980,9042,9106,9627,9912},{},{4680},{4536,6977,8868,9652},{8611,9530},{5323,6321,6488,8215,8865,9296},{},{6160,8781},{6389,7003},{6606,6968,7718,8203},{5059,5137,5478,8099,9475},{},{5551,6101,7510,8324,9094},{5069,6961,7073,9498},{5115,5255,5966,6577,8012,9464},{8016,9675},{6034,6770,8362,8434,8613,9296},{7409},{4798,4836,5450},{7060,7506},{8788,8950,9069,9252},{4874,6047,7126,7766,8936},{5426,9880},{4613,6369,9020},{6205,6297,8000,8886},{5341,6974,8017},{},{},{7313,8505},{6270,8067,9145,9979},{5872,5994,9319},{5211,5527,6924,8418},{5229,5968,6828,8853,9145},{5737},{},{8118,9794},{4561,5466,8193,9599},{4823,4916,6614,8021,9891},{},{9389},{4822,6790,7785,8035,8807},{5325,5544,5701,7939,8265,9987},{7277},{6203,7159,7262,8358},{},{4968,6883,8824},{5636,6019,7035,7496,7937},{6372,8118,8809,9576,9724},{7479},{7700,8070,8772,9556,9756,9896},{5229},{5086,6846,7877,8042},{9515},{5078,6976},{6858,7272,7319,9021},{9592},{5920,8931},{},{6268,9483,9767,9828},{7716,8577,9867},{4627,6517,6744,7128,9378,9792},{7174},{6042,6936,7300,8361,8983},{5166,5219,7354},{6628,7567,7821,9658},{4821,5820,6486,8284,8785,8970},{},{4854,4907,7439,8013,8783},{7999,9176,9280},{5866,8122},{6284,7087,9511},{6268,6733,7206,8595},{5365,6078},{4910,5622,5985,6384,9309},{5261,8140},{},{6309,7500},{},{6405,8389},{4994,5126,5350,7645,8392,8599},{},{},{6037,6117,6557,6948},{5154,5805,8175,8418},{},{9771,9964},{4822,8063,8536,8792},{},{6657},{7568},{5369,5717,5731,6682},{6340,6817,8497},{5681,9629},{5007,5086,6861,7210,8251,9587},{5953,6251,7239,7497,9053,9204},{7613},{8563,9299},{6310,8908},{4677,5818,6514},{6201,6838,6883,8251,8823,8980},{5366,7795,8509,8916},{4713,5065,6038,9946},{6174,9593},{4727,5779,6181,7325,8266,8557},{9203},{4882,6667},{4724,8968},{},{6180,6759},{4752,5459,5508,7159,8510,9372},{6651,7539,7555,9400,9469,9555},{6963,7704,8137,9225},{4633,4868,5444,6671,8197},{5193,5766},{5501,5914},{7022,7711,8047,8797,9286,9695},{5475},{7586,7974},{4923,5724,7221,9054,9109,9829},{7667},{},{6825,7881,8056,8105,8956,9217},{6334,6928,7013,8591},{},{8784,9153},{6831},{6632,9186},{5019,7777,8583},{8599},{4661,4838,6644,6849,8480},{8545},{5573,5774,8442},{7873,8148},{5405,5423,8700},{4677,4972,7170},{5648},{5572,7553,7836,7982,9855},{5026,6427,7733,8747,9316},{5545,6942,7093,8237,9174,9614},{5045},{6700,6789,6895,7425,7943},{5235,8385,8682,8695,9626},{7675,9548},{5974,8717,9324},{9112,9427,9696},{5785,7907,9161},{7086},{4889,4898,5632,7475,9889},{5149,5675},{7337},{4890,4916,5994,6944,8017},{},{},{6100,6401,7681,9264,9770},{5318,8230,8847},{6538,7836},{4778,6071,8110,8597,9868},{5520,7307,7847},{5059,5555,5599,6915,7019,9085},{5888,7165,8162,8218,9065,9349},{5989,7146,7927,8322},{4808,6361,8702},{4753,4861,5013,5142,7063},{8420},{6540,7183,7555,8537,9151,9640},{5524,6406,6458,9641},{},{7450},{5031,8954,9059},{6490,7225},{5332,6861},{9123,9146,9411,9949},{4745,5597,6455,7010,7412,7881},{4719,4899,5074,5854,5982,8800},{5221,6573,7756,8334,8705,8998},{7789},{},{6576,6963,8740},{6155},{},{4806,5754,5948,5984,6443,9152},{8678,9517},{7020,8445},{6916,8765},{4823,5207,5296,5398,6642},{6449,6636,9503},{6043},{},{6604,7291,7466,7634,8084,8166},{5095,5506,5953,6204,9239},{4992,5370,9362},{5560},{5312,6326,9223,9978},{6427,7265,8172,8244},{7963,8924},{5365,6368,8650,8993,9589,9710},{2840,4787,8560,9521},{6549,6724,7787},{5154,5982,6260,8040,8741},{5799,6180,7393,8629,8928},{},{7613,8852},{},{},{8294},{},{},{},{5857,6118,6403,6809,8061,8107},{5363,9197,9812},{5039,5575,7751},{6066,8959,9568},{5291,6337,8113,8854,9217,9352},{},{4837,6016,8318},{4874,5523,6217,8036,9581},{5016,6420,6715,7163,9815},{},{5697,8198,8418},{6367,6852,8821},{},{5326,7208,7603},{},{7248,8212,9204},{6337,7724,9213},{7526},{},{6356},{},{7842,7956,8572,9522,9742,9830},{6219,6604,9529,9695},{9749},{5037,9195},{},{5379,7434,8496,8528,9809},{5891,6743,7956},{6063,6393,7159,8883},{4783,6590,7824,8430,8628,9236},{6449},{7732,9101,9332},{6464,6805,6937,9358},{5953},{6053,6784,7216,7893,9839},{9730},{},{6635,7836,8769,9999},{8963},{5878,7498},{4812,4996,6681,9453,9774},{4903,4911,6863,8172,8946},{5872,9723},{},{},{8786,8883,9803},{6300,6460,7449,7615,8717,9050},{6118,6385,9162,9860},{6951,7828},{5949,6354,7219,8011},{6454,8375},{5178,7780,9636},{8390,8960},{9455,9802},{4868,4968},{},{5941,6455,7504,9276,9603},{6176,8779,8864,9669},{4948,5282,5987,9224,9379,9989},{},{4863,7717,9963},{4974},{5248,6293,9594,9732},{5544,8499},{8114,8504},{6875,7264,7915,8264},{7558,9700},{4893,7159,8615},{5696,9350},{5061,5191,6090,9311,9641},{5276},{6121,7077,7328,7363},{},{5378,6281,6307,9697},{5523,5597,5710,8517,9285,9896},{6221,6843,8779,8951,9881},{4904,7096},{},{4972,9601,9837,9923},{5557,6616,7121,8309,9744},{5788,6425,9400,9600,9950},{5956,9987},{5134,5502,5943,6115,8891,8981},{8761},{7346,7359,7443,7992,8150,9766},{7773},{6039,6097,8100},{5521,5757,7466},{9463},{7654,9394},{},{8357,8759},{5259,8120,8990},{2479},{6807,8585},{6693,7693,9213},{6815,9502},{5497,6849,8831},{7536},{9980},{5345,6389,8483,9054},{5084,6297,8202,8236},{5796},{5314,5395,7836,8134},{6031,6933,7111,7123,7154,9022},{4960,6433,8686,9665},{4845,6719,8206},{9389},{5677,5689,6246,9109},{5709,6136,6798,7120,7352,8912},{},{6877,8216,8746,9681},{5931,6748,7830,8714},{6128,7631,8217},{5855,6884,6925,7677,7985,8564},{5020,5073,5689,6727},{5249,6904,7008,8022,8195,9666},{7771,8019},{6753},{8462},{6513,7268,8957},{5162},{5357,5886,6098,9807,9845},{6445,6542,8111,9567},{6261,6887,8372,9384},{},{9423,9476},{6501,7133,8873,9232,9920},{5833,6705,6917,7457,9567},{6660,9160},{5612,6685,6947,6959},{5176,6525,9104,9220,9248,9717},{7453},{5131,8488,9441},{},{5378,5425,6916,7277,8373,9980},{6731,7542,8453,9675},{5186,7885,9118},{5207,8180},{5334,6621,9542},{6019,6442,7614,7678,8454,9134},{6657,6807,7254,7857,9970},{6642},{5284,5832,5917},{},{4924,9045},{9104},{5771,7708,8453,8567,9100},{5186,9455},{5917,6665,9654,9801},{},{},{8255,8788},{6076,7478,7593},{},{5297,6754},{5672,5825,8317,8653},{6230},{},{5065,5100,5538,8934},{5428,6725,7425,9502},{5465,5881,6666,8949,9323,9618},{5606,6449,8518},{5948,6093,8051,8112,8320,9257},{5230},{5027,6347,6483,6865,7964,9734},{5567,5641,6380,6606,7964,8018},{},{6111,6913,9177,9287},{7630,8132},{5652,6046,8925,9773},{},{},{5877,7152,9716,9758},{6124,8297,9120,9248},{6849,7353,7541,7629,8967},{7468,7878,9063,9853},{},{},{5108,5243,5578,9313},{7010,8451},{6682,7912,8160,9495},{},{5101,6540,7193,9645},{6024,6812,9661},{4925,5490,7861,7965,8830,9282},{5775,6140,7897,9188,9608},{8063,8787,9866},{5522,6656,8053},{6195,6733},{5377,6065,7857},{5384,7768},{},{5223,7080,8721},{5852,5964},{6342,6565,9049,9451},{8498},{5902},{5155,5700,6117,6829,7619},{5450,5993,7663,7725},{6125,6240,6842,7014,9494},{8762,9738},{5800,8253,9459},{8912},{},{5316,5964,7127,7840,8958},{5693,9719,9886},{},{7358},{5920,6429,6459,9094,9629,9767},{6922,7437,8927,9062},{7733,8633,9293},{5658,5725,6425,9429,9571,9592},{9092},{5734,7411,8581,8590,8697},{6620},{6783,7352,7855,8036,9377},{},{5105,7074,7813,8710,9564},{5492,5709,5963,6680,7563,8738},{263,5359,6222,8167,9916},{5024,5287,5508,7330,8379,8802},{5658,9074},{5294,9257},{},{5860,6263,8813,9445},{6396,8203,8797},{6825,8174,8346,9030,9580},{7406},{5373,6416},{5241,5773,6282,9859},{4966,6629,7887},{},{5548,6378},{7903},{6145,6739,6776,7822,8472,9883},{5980,6164,6973,7438,8205,9448},{8560},{9355,9705},{6884,8030,8296,9188,9313},{8406},{5329,5799,6993},{7030,8312},{6808,7268,8236,8371,9601},{5320,5376,7209,9782},{5373,6078,7300,8464,9005,9905},{5669,6664,8081,8537,9487},{},{6197,7087,7577,9080,9244,9452},{5719},{},{},{5288,8710,9878},{5851,6345,6940,7016,7830},{},{5676,8125},{9200},{6739,7675,7862},{5257,6741,6997},{5349,5605,9179},{5379,5382,6485,6978},{5398,5765,6468,6530,7069,9567},{5619,8346,9621},{5158,5318,8724,9885},{6855,7195,8330},{5270,8146,8389,8923,9122,9602},{5338,6179,9020,9121},{8539,8586,9142,9782,9790},{5933,6416,8342,8586},{7363},{6306},{5633},{6503,7274,7859,8307,8319,9650},{},{6438,7914,8847,9186},{5608,6602,7543,8001,8278,8432},{5376,5738,5795,6021,7725},{},{5299,6878,6927,7895,8087},{5913,6878,8125},{},{},{6893,6947,7331,8156,8268,8394},{5416,6706,8249,8701,9129,9714},{5237,5831,9024,9903},{8322,9827},{5683,5687,7718,7949},{6029,6389,6391,7530,8520,8920},{7354,8940},{7619,9090},{},{7887,8293},{6550,8250,9973,9993},{5290,7011,7891,8900,9059},{5906,6156,6982,7531,9013,9456},{},{5982,6370,8349},{5365,5409,5860,7239},{5595,6149,7749,9078,9461},{5163,7807,8473,8845,9797},{5267},{5326},{5568,5742,7232,8411,9474},{5031,5376,5382,8131,8941},{6008,6620,8674,8824,9089},{},{5630},{5698,6647,8241},{5717,5847,8931,9309},{5585,7468,8020,9322,9990},{6301,6889},{9539},{5302,5954,6147,6562,7543,9113},{6624,7125,7158,7679,9161},{6380,7011,8082,8606,8998},{6057,6583,7267,8095,8422},{7829,9906},{7452,7738,8399,9236,9548,9955},{5184,6368,9408},{5353,5926,6228,8707},{5816,6315,7618},{5620,6211,6380,6492,9350},{5258,6655},{7990,8741,9263},{5085,5492,8428,9647},{5424,6038,6970,9439},{5419},{},{6147,8879,9294,9352,9491,9656},{},{5857,6803,7119,8543,9255,9890},{6202,9187,9746},{},{5967,6951,7215},{5816,9302,9397,9713,9753},{5790,6220,6560,8020},{5842,6944,7894,8554},{5822,5933,7848,8241},{5403,6615,6924,9882},{5370,8829},{6578,6642,7369,8421,9424},{5183,5220,5276,6630,7235,8890},{5237,6045,6590,8765,9529,9944},{6029,6414,7160,8700,9043},{6176,9089,9735,9982},{5103,6182,8157},{},{5151,5298,5346,9472,9593},{5861,6226,6362,7370,9387,9476},{6010,6563,7062,8629},{5426,5683,7005,8031,8891},{7266},{5314,6275},{5184,7579,7720},{5459,6745,8260,8469,8677},{7181,7839,9495,9882},{},{6334,8130,8747,9370,9539},{7629,9315,9454},{5614,6187,6982,6993,8508},{},{9055},{6137,7717,9090},{8997,9127},{},{5611,6300,6968,7647},{},{6069,6913,8857,9357},{},{6495,6810,6974,7373,8015},{5794,7153,8842,8908},{8547,9201},{},{5235,8100},{7905,7960},{6182,8259,8663,9953},{5870,6560,6981,7347},{6345,7033},{5440,6184,7548,8525,8602,8960},{5538,7085,9468},{6178,6434,6598,8205},{5672,5926,6666,7318,7433},{6236,6311,6824,9013},{5172,6212,8166},{7053,9331},{7081},{6313,6755,9422,9939},{5286,5838,6033,7809,9410},{8019},{6177,7384,8448,9024,9112},{6640,8485},{6138,6789,9006},{},{5163,5684,7307,8759,9662},{6241,9977},{5129,8953},{7296},{5460,5799,6138,6685,7074,9464},{5906,7504,7727,9106},{5277,5621,8513,9284},{5135,6683,7229,9416},{5195,5325,9147},{6063,8737,8983},{},{5135,6553,7027,9118,9407,9795},{5398,5655,6230,7092,7620,8483},{5687,6560,7096,7179,7459,9420},{},{5817,6753,6845,6892,9248},{6024,6654,8496},{5508,7680,9536},{8852,9326,9664},{6354,6633,7017,8907,8947},{},{6178,7139,7443,9782},{},{5778,5895},{5163,6365,6582,6764,8476,8547},{5313},{6807,7442,8894,9486,9525},{5584,8630},{5633,7019,8145,8297,8896,9336},{6028,6600,7198,8714,8900,9062},{5925,7313},{},{8092,8314},{5356,5522,5713,5848,7901},{6646,7108,8113,9083,9400},{5939,6925,8036,9838},{6774,8083,8099},{},{7026,7070,7401,9907},{9675},{6250,7187,7854,8241,8918,9059},{7132,8494,8690,8998,9092,9861},{5437,8673},{6082,6199,6921,7279,8380},{5177,9113,9266},{7189,8617,9047,9215,9536},{6073,7435,9953,9989},{5614,7714,9459,9468,9631},{6041,7247,8285,8486,9123},{6476,6940,7304},{9596},{5333,6446,7794},{5603,6125,7321,7324,7648},{5581,6982,8400},{6734},{5512,5728,7986},{6014,6615,7106,7780,8722,9092},{7644},{},{},{6580,8907},{6113,8832,8953,9931},{7598,8349,8757,8906,9125},{6014,6131,6501,8363},{5470,5623,6503,7342,8084,9501},{5313,5747,7553,9884},{},{6364,8170,8350,9497},{5359,6451,6598,8528,9431,9909},{5197,5271,5967,7363,8291},{5506,6938,7749,7794,9859},{6074,6458,6648,6682},{9078},{7945,8639,9263,9372},{5643,5838,6555,7341,8360},{6059,6293,7907,9686},{7171},{5440,5651,6017,7029,7511,8210},{},{5408,6622,7205,7638,9503},{9815},{},{5517,5950,6230,7493,8707},{},{5282,7019,7527,7815},{},{5427,6119,6223,7589,8004},{},{5495,7750},{},{5751,8990},{7424,9367,9535},{5241,5291,6715,7559},{6357,8243,8998},{6054,7610,7641,7803,8150,9380},{6542},{},{5392,5592,8730,9231,9856},{8656,9910},{6001,7020},{5657,5693,5842,7164,8935,9244},{},{6779},{5382,6070,6721,9110,9895},{7135,7478,7503,8563,9341},{5764,7011},{1238,9963},{6409,6642,7633,7750,7994,8240},{3385,5343,6241,9541,9726},{6112,7112,7174},{5448,5764,6080,6680,9345,9822},{},{5786,7645,8809,9640},{6004,6908,7204,7288,7737},{9520},{5758,6403,7008,7129,7133},{7521,8673,9461,9884},{6520,6661,8794},{7380},{1659,6520,6895},{7316,8670},{},{5359,7301,7761},{6038,7829,8438},{5527,7189},{5567,8098,8481},{5984,6846,7282,7370,9052},{},{},{5462,5983,7976,8070,9480},{6089,7608,7714,7962,8371},{5356,5949,6068,7174,7844},{7232},{5273,9825},{8098},{5670,9910},{},{9705},{5277,8446,8514,8865},{7377},{7918},{5480,7624,8579},{5527,7658,8340,8428,9932,9989},{},{5277,5918,6071,6685,7216},{},{5756,6247,7237,7405,8594,9308},{8938,9970},{5976,6655,8004},{5438,6432,6775,7664,9946},{5770,6460,7035,7187,9113},{6488,8612,8750,9422,9847},{8531,9565,9958},{7887,8700,8744},{6137,7127,7986,8609},{5476,5494,7635,7995},{5412,6603,6668,8170},{6448,6580,6611,8557,9526,9649},{5924,6348,6474,9975},{6851,7081,7152,7925,9883},{5533,5811,8102,8607,9555,9726},{5664,5800,8143,9088,9176},{},{9432},{5789,6158},{6125,6142,6589,7732},{6625,6644,6661,7322,7911,8258},{6869,8614,8844},{6007,7083},{},{9497},{5675,5855,7296,8177},{6453,8117,9844},{6473,7534,8531,8559},{5527,9744},{7332,7834},{5496,7189,8187},{9071,9286,9432,9664},{5647,6068,6396},{5442,6484,7058,7623,8160,8230},{5789},{5457,7250},{8367},{5853,6227,6927,8150,8677,9735},{},{5342,5726,5885,6594,7556,8291},{6240,6418,6896,7694,9160},{5916,7899,8030,8762,9486,9642},{9697},{9423},{7156,8597,9358,9713,9937},{9459},{5957,7136,7870,8862,9075,9257},{8703,8811,9797},{7724,9077},{5860},{7705,8456},{5321,5861,6706,7262,7801},{5410,7757},{5579,8282},{5733,6596,6904,8056,9274,9702},{6469},{},{8341},{6246,7764,8783},{5759,6048,6201,8395,9516},{5434,5769,8036,8158,9123},{8201,8885},{5425,7207,8041},{6402,8011,8171,8404,9583},{5958,7151,8129,8586},{},{5357,9094,9782},{5665,7437,9008,9811},{5788,7464,7610,8333,8696,9676},{},{5339,5786,7723,7799,9000},{5614,7188,7680,9030,9358,9689},{6647,7556,8473,8976},{5562,5729,8461,8504,8772},{6008,6759,8107,8111,9153,9779},{5502,5906,6296,9213,9606,9970},{5723,7401,8313,9876,9931},{},{5398,7710,8231,8722,9051},{6659,7054,7821},{6300,6527,6662,7240,8435,8722},{8389,9678},{7906},{},{6913,7973,8415},{},{7089,7933,8560,8874},{5568,7875,7961,8757},{6233,6310,6403,7465,8780},{6251,7646},{6318,6636,7448,8113,8192,8670},{7672,9253,9261},{},{8825},{},{5649},{7216,8054},{6156,9820},{},{9151},{6426,6717,8803},{},{},{5382,5631,7300,8011,9484,9644},{5378,5914,6470,8767,9190,9589},{8196,8787,9561,9640,9643,9941},{6256,6615,6805,8826,9280,9983},{5552,6688,8611,8787,9627,9991},{8983,9005},{9125},{9811},{8914,9616},{5704,7664,8554,8678,9456,9716},{},{6073,7011},{5635,7042,8718},{5616,6282,7699,8866,8934},{6745,9120,9670},{6315,6780,7952,8958,9940},{5659,5700,6384,6458,7209,7375},{5395,8145,8915,9964},{5902},{5723},{5885,6759,9076},{7283},{5484,6263,6339,7447,9988},{7564,8498,8958,9546},{7465},{5426,6138,7743,8608},{5410,7623,7994,9401,9603},{},{9804},{5672,6797,8128,8472,9136,9940},{},{6053,6601,9678},{5506,5720,6607,6874,7060,7914},{6323},{},{7948,8438,9129,9386,9925},{7134,8480,9291,9974},{},{2708,5806,8123,9640},{5440,6296,7774,8206,9179},{6157,6574,6889,8732},{6736},{7655,7896,8680},{9136},{6386,9743},{7532},{6151,6670,9829,9837},{5714,6703,6950},{6736},{5432,8935,9769},{6304,7137},{5765,6308,8021},{5634,5763},{5558,5628,6055,6177,6585,8326},{},{6376,6516,7782,8591,9247},{5707,8286},{6314,7574},{7486},{7124},{5625,6280,6327,6574},{},{7207,9137},{5600,5894,7706,7709,9072},{5472,7001,7970},{},{},{5733},{},{5561,6810,8677},{7786,8797,9410},{5794,6034,6536,8079,8738,9976},{5659,6975},{8339,8687},{5529,6853,7882},{8907},{5659,6532,6669,7715,8159,8960},{6633,7473,9935},{7873,8015,8420},{},{},{6872,9006,9411},{6624,6673,9352},{7014},{5788,8104},{6853,8316,9067},{7642,7872,8343,8502,8859},{8599,9321},{6155},{5707,5934,7135,8574,8821,8852},{},{5935,7218,8181,8261,9087,9851},{6342,7369},{6173,9031},{5643},{6071,6536,6695,7534,7956,8815},{5636,6573,8230,8946,9087,9170},{6729,7381,7941,8929,9238,9611},{5959,6976,7937,9199},{},{5558,6456,9768},{6358,8712},{5681,6492,8641},{6978,8146,8942},{5893,8126,8710},{5747,5975,7531,8806,9111,9210},{5530,6616},{8249},{},{8534},{8533,9195,9719},{5485,5556,6643,9096,9122,9142},{},{6509,6863,6962,8762},{6187,7498},{6065,6566,6965,8843},{5715,5938,6239,6771,8214,8839},{7389,7940,8228},{5767,9282,9379},{6622},{6886,7410,8878,8915},{8571,9313},{6248,6882,7273,8544,9374,9700},{9199},{8071},{6409,6417,8581,8713,9735},{5683,6777,8739,9540},{6137,7418,7623,8264,9612},{5754},{5652,5678,6189},{},{5661,8736,9213,9721,9732},{6389,6457,8207,8460,8680,8697},{5500,6011,6851,9170},{5753,6267,9026},{6673,7801,8775,9426,9935},{8222},{7321,7692,8713,9596,9848},{8132},{5886,7777,8864,9177,9477},{},{6419,8953,9606},{6634,9552,9869},{5935,6586,7608},{6018,6254},{5714,5926,8595},{8970},{6419,6652,7448,7716,9086,9901},{5678,6528,7788,8166,8919,9774},{5987,6083,6936,7538,8246,9364},{6919,7983},{7022,7957,8535,8809,9613,9884},{7538,8872},{7228,7898,9709,9817,9955},{7867,8185,9645},{6653},{8318},{9780},{772,6979,8001},{9866},{5564,5999,7585,9827,9905},{6576,7267,8247,8274,8838,9798},{6541},{6375,6427,8516,9379,9883},{},{6353,7768,8520},{5608,9009},{8202},{5837,6944,8888,9188,9241},{},{6229,8188,8802,9833},{6066,8399,9991},{5992,6183,6963,9545},{},{6215,8330},{5964,6018,7358,7831,8821,9133},{5550,6856,7695,7806},{6072},{6520,9994},{},{5599},{6966,7098},{6187,6866,6954,7325,8630,8785},{8562,9162,9707},{5798,6310,7003},{2680,7378,8514,8690},{5900,6831,6890,7448,8351,9286},{7715,8394,9368},{5930,6580,7543,7759,8201},{6158,7664,8969,9353},{6093,7007,7755,8735,8747},{},{5639,6627},{6214,6257,6902,7528,9757},{5558,6569,6623,7097,9108,9732},{},{6664},{7689,8236,9847},{},{7731},{6332,6460,6746,6759,8696,9801},{8400},{9280,9721},{6668,8575},{6489,7104,7267,7394,7445,9265},{8895},{6471,7361,7496,8593},{8332,8512,8593,9406,9607,9704},{9333,9798},{7935,8682,9501,9508},{5585,5710,7254,7877,8519},{6179,7312,9509},{5837,6402,7930,8379,9008,9958},{7286},{6529,6676,7797,8720,8756},{7138},{7743,9565},{5819,6284,6292,6404,8356,9204},{8585,8763},{6633,8424,8496,8738,9089},{},{9341},{8249,8616},{9335},{6156,6370,8170,8437,9315,9787},{5639,7898,8774,9823},{7400,8052,9753},{7379,7636,8408,9139},{9355,9577},{5708,5800,8431,9197},{8111},{5662},{5662,6165,6417,9254},{6444,6935,8548},{6204,6582,8209,9487},{6192,6390,9780},{6761,7031,7351,7677,8312,8838},{6750,7010,8801},{5943},{6249,6383,7705,8494},{},{7621,7972,8322,8689,8983,9515},{6180,6304,6775,6955,8953,9019},{5787,6974,9735},{9730},{2305,6113,6525,9107,9988},{6218,8275,9632},{6798,6845,7238},{5779,6219,6448,7176},{9857},{6162,6835,7071},{},{},{6297,6495,7387,8028,8055,8685},{7170,7528,7580,8338,8641},{5742,6665,8656,9072},{7494,8542,8554,8799},{6177,8053,9134},{5848,8062,8185},{},{6120,8522},{7475,8057,8492,9179,9683},{6184,7049,7619,8368,8756,9436},{5868,6539,7223},{5882,7505,7567,8115,8182,9079},{9351},{6456,6890,7015,7576,9013},{8670},{5828,6323,6684,8798,9671},{5865,5913,7642,8306,9415,9759},{6056,6156,6528,8390},{5940,7072,7478},{7366,9386},{6709,7080,7743,8406,8460},{7597,8468,8732,8833,9473},{5721,6336,9499},{5810,5859,5992,6028,8297,9259},{6818,7161,7364,8243,9219,9498},{8614,9169,9600},{},{6877,6951,8715,9826},{5897,6187,7212,8697,8816,8864},{5798,6784,7266,8562,8981,9247},{5865,5926,6020,6999,7520,9590},{6115,7266,7343,8413,9002},{5745,6124,9490,9597},{6159,7076,9078,9083},{6003,9494},{6799,7368},{7960,9059},{8663,9653},{},{5701},{8329},{8165,9848,9857},{7326,7512,9228,9280,9377,9860},{7400,7475,9399},{6525,9082},{5971},{5764,8261,9331},{6723},{},{6696,7006,7788,8179,8464,9688},{},{7156},{7977,9354,9423,9780},{6543,9100,9285,9838},{6439,7242,8888},{6472,8057,8365},{},{},{9364},{5949,8697},{6014},{8729},{7066,7582,7722,8270,9049},{5684,6668,7230,7235,8132,9781},{},{7943,8641},{6221,6309,6398,8353,8409},{6005,7155,7707},{6215,7973,8361,9878},{7043,7471,7890,9008,9724,9727},{},{6210,6507,8736},{5811,7231,8444},{5969,6596,7438,8263},{},{5798,8344},{5981,6544,8315,9447,9600},{7935},{6135,6992,7576,8420},{7327,9273},{5905,8020,8209},{9034},{5947,8949,9102,9708,9721,9921},{6216,6557,6644,7015,9126},{7133,8611,8623},{7497,7747,7857,9339,9471},{},{7835},{},{6045,7500,8887,9295},{7823,8682},{6856,6886,6978,8128,9307,9364},{6630,8070,8199,8344},{7700,8724},{6473,8200},{6625,6676,6958,7732,8338},{7649},{6808,7896,8769},{6413,8222,8352,9338},{6553,6582,8552,8877,9010,9821},{7070,7704,8564,9388},{},{6498,6512,9483,9841},{5872,8041,9251},{5813,6405,6938,7741,8185,9130},{},{6615,7841,8221,9030,9623,9961},{8186},{8703,9369},{7640,8163,9178,9405},{6733,9323},{6509,9005},{7288,7382},{5844,7327,7661,7945,8256,9913},{8900,9338},{5828,6732,7843,8535,9264},{8554},{6138,6366,6691,7100,7101},{8033},{7806,7906,8420,9338},{7381,7570,7847},{6862,7358,9323},{6026,6057,8873,8962,9734},{7565,7724},{6275,7120,7198,7275,7632,9295},{},{6230,6555,8256},{},{7654,8614,9577,9629},{6806,9651},{6515,8671,9489},{6298,6544,6556,7129,7587,7747},{7415,7953,8152,8688},{6725,7195,9110,9171,9225},{8345,9105},{7432,8607,9375,9641,9645},{5764,6482,7410,7751,8003,8686},{6729,7680,8683,9254,9494},{7251,7273,8949,9545},{7296,7370,7685},{6752,7341,7466,8012,8361,9593},{8893},{},{7519,8037,8486,9315},{},{6168,6398,7456,8450,9826},{5899,6510,7397,8459,8859,9602},{6817,7092,7152,7745,8887},{},{5851,7217,8133,9997},{7172,8334,9328},{6078,6277,7962},{7562},{6947,7320,8119,8533},{},{6249},{5909,5928,6102,6364,7489},{},{5892,6136,7830,7995,8547,9612},{9229},{},{5981,7783,8582,8878,8890,9111},{5979,6022,9318,9828},{5982,6658,7203,7636,7919,9912},{8587,9085,9909},{},{7314,7747,9581},{},{6142,6458,6494,6759,9428,9690},{7507,8107,8958,9703},{8070},{7187},{6776,8632,8980},{7886,8035,8075,9181},{},{6895,7339,8938,9567},{8407,9594},{7318},{},{},{4753,6006,9585},{6865,7849,8155,8537,9465,9553},{5807,6025,6736,8309,9683},{7609,9166},{5866,5920,7571,7639,7928,9122},{6666,9189,9519,9572},{},{6107,8643,9164,9503,9609,9678},{6068,8266,8811,8826,9517},{9190},{6646,6662,6729},{9144},{8944},{6078,6964,7473},{},{5940,6405,6597,7928,8784},{6076,6319,7125,7644,9462},{6906,7726},{5951,7283,8263,8665},{6088,7036,7954,9394},{6199,7252,9023,9768},{},{5842,6287,7559,7955,8735,9159},{8549,9672,9727},{6124,6612,7242,7281,8071},{7859,9223,9308,9763},{8879},{8561,8901},{6866},{6062,9759},{},{7417,8696,9032,9885},{6341,7699,7872},{6553,6900,7147,7275},{6474,9824},{7039,7194,7322,8192,8581,8855},{6925,8609,8841,9500},{7161,9594},{6477,7996,8410,9880},{},{7317,8072,8217,9848},{6786,8280,8803,8867},{7509,9952},{8409},{8973},{8429},{6101,6191,6804},{8371},{6701,6987,7091,8676,9851},{7171,7353,7939,8012,8541},{5993,6143,8417,8787,9331,9679},{6396,9584},{},{6260,6911,7440,7543,8941,9792},{},{5942,6559,6883,7172,8669,8938},{7131,8026,8890},{6516,7892,8137,8545,9770},{},{6926,7047},{6136,6177,8509},{6371,9984},{6238},{9318},{6013,6093,6610,7067,7495,9944},{},{7724},{8055,8589,8819,9010},{7521,7933,8464,9165,9700,9993},{7189,7454,7615},{6465,7144,7672,7957},{6579,7357,7615,8617,9626,9860},{8057,8736,9638},{6665},{6320,7357,7376},{7144,7166,7530,8772},{6044,6139,9636,9855,9906},{},{6339,6925,7185,7704,7847,8902},{6471,7907,8330,9259},{7834},{},{7163,8344,8524,8733,9187,9314},{7437,8216,9070,9177,9756},{6978,9745},{7185,9430},{2223,6128,6805,6818,7588,7994,8350},{},{9314,9612},{},{},{6038,6715,7934},{7752,8382},{6858,7542,7771,9147,9341},{6960},{5937,6168,6292,8384,9537},{6846,7722,8570,9090,9439,9475},{},{8278,9055,9189,9516},{6274,8972,9467},{8103,8607},{5988,6551,9069,9384},{1669,5902,6548,6666,8762,9160,9531},{6542,6649,6864,7596,8491,9951},{9274,9492,9523},{6069,8205},{6599,7711,8087,9418},{},{6012,6682,8610,9350,9948},{7637,8546,9575,9973},{},{},{5975},{6411,7172,7230,8652,9386},{6839,8009,8242},{},{7225,7548,7794,7941,9581},{5977,6720,7824,7996,8431},{6472,7584,7936,8128,8592,9521},{5981,6559,9629},{7954,8096,8163,9415,9486},{7914,8056,9735},{7021,8398,8817,8884,9585,9770},{9211,9558,9896},{},{6227,6344,6561,6715,8480,8599},{6564,8210,9181,9207},{6274,6295,7987,9008,9126,9510},{6615,7334},{6511,7511,8780,9455},{9693},{8335,8515,8870,8982},{6150,6857,7192,8075,8368},{8080},{6087,7252,8677,9536,9546},{6156,8053,8331,8481,8551,9133},{8783,9254,9304},{425},{6163,7083,7881,9801,9913},{7713},{},{9770},{6701,6894,7318,8732,9609},{6231,7386,8757,9810},{},{7879,8087,9376,9555},{6975,7320,7638,7950},{6715,6930,8036,8457,9348},{9435},{6292,6639,6707,7552,9210},{5961,6419,6472,6804,8466},{},{7038,7220,7725,7912},{9987},{6156},{},{6054,6287,7599,9967},{6128,8825},{5980,6009,6337,6975,8570,8811},{6984,7378,8236,8657},{},{6115,6187,7387,8048,9193,9447},{6818,7817},{6728,7919},{5961,8862,8883,9812},{5961,6590,6878,7726,7871},{},{5603,9278,9657},{7662,9443},{7598},{8453},{8037,9132,9332},{9120},{6196,6867,8223,9494,9962},{6629,7759,8595},{6690,8157,8624,8732},{6553,8940},{9820},{8455,8521},{6532,7873,8058,8547},{6528,8163,8939,9255},{6384,6521,7196,7887,8749,9452},{6693,6756,7446,7493,8113,9324},{5982,6211,8835,8973},{8147,8478,8957,9604},{6839,6931,8394,8874,9456},{6039,6402,7466,7836,8063,9480},{9106},{8219,8573,9510},{6532},{6394,7239,7510,7974},{},{6500,6929,7402,8758},{7053,7621,8372,8753,8902,9212},{6300,9862},{6288,7796,8779,8982},{},{8165,9148,9795},{7981,8161},{6238,8445,8604,9565},{6540,7255,7571,7591,8348,9590},{},{},{6110,7740,9223,9723},{7387,8482},{6392,9300},{6302,7173,9485,9916},{6294,6485,8092,8845,9286},{},{6746,8226,8453,9298},{6935,8035,8672},{6479,6546,6557,7178,7340,7468},{8910,9800},{6437,6770,7120,7331},{6346,6600,7646,7673,9098,9792},{9206},{7641,8617},{6507,7196,7904},{7302,9166,9779,9963},{6538,7498,8545,8665,8833},{6789,7251,7627,9045,9899},{6723},{6426},{7763},{8355,8442},{6325,6446,6709,7936,8602,8734},{6494,6631,6885,7889,8547,8800},{7469,7955,8333,8705},{6556,6588,6618,8318,9486},{},{},{6378,7790,9070},{8745,8861,9030,9826},{6520,9475},{},{6287,8133,8573},{6172,6396},{6262,6747,7486,7711},{6690,6702,7594,9046},{6525,6969,7408,9980},{6741,7605,7812,8215,8526},{3896,8529},{6513,6934,8259,8264,8756,9823},{},{6077,6201,6292,7155},{6902,7516,7944,8409,8489,9111},{6362,6882,9145,9563,9958},{7494,8222,8417,9080,9299,9721},{6550,8540,8870,9672},{7818,8352,8419,8658},{7486},{6059,6379,6480,7889,8329},{6730},{8297,9358},{7597,7674,8453,8978},{8437,9090},{6581,7615,8165,8878,9442},{6589,7968,8041,8867,8896},{6072,6599,9747},{7772,9469},{8086},{9419},{6371,7214,7992,8272,8716},{7183,7673,7705,7775},{},{8814},{8234,8682,9609},{6345,7382,9995},{6208,8404,8652,9663,9848},{6299,6877,9419,9803},{8753},{6876},{7529,9487},{6176,6212,6313,7544,8226,8410},{6472,8055},{6524,7471,7681,7955,9553},{6108,8901},{8918,9383},{6210,6332,8007,8066,9047,9105},{8218,8347,8468,8848,9184,9210},{9677},{9619},{8119,8178},{8334},{},{9496},{6262,6789,7590,7757,7920,8458},{7131,7287,8365,8504},{},{7118,7346,7355,9430,9908},{6553,7268,7442,8309,9410,9801},{8717},{7142,7244,8281},{7446,7876,8197,9377,9732},{6657,8570,8989,9401,9746},{},{6135,9688},{},{},{6150,6943,7809,8336,8487},{},{9655,9875},{},{8159,8228,8915},{6322,8294,9175},{6651,7276,7672,8286,8305,8543},{8225,9731},{},{6514,6550},{7279,8681},{6765,7232,7362,7489,8536,8889},{6261,7254,8142,9812},{6574,7238,7443,7694,8762},{6126,9362},{6284,6767,7176},{6913,7157,7329,8272,9549,9798},{9468},{6590,7278},{6306,6548,7520,9661},{7263},{6204,7434,7615,7810,9010},{7056,7122,7634,8419,8792,9404},{6223,7106,9247,9374},{8627,8970},{},{7103,7292},{6305},{6429,6979,7763,9887},{},{6214,7316,7574,9431,9877},{6838,7246},{},{6698,7306,7437,8328,9261},{8739,9476},{6216,6316,6840,7491,7767},{},{8726,9589},{6749,7651,9405},{6684,6791,6893,7359,8651,8808},{7133,7253,8173},{9733},{6920,6928,7346,7624,8136,8268},{6929,9422},{6523,6791,7264,7572,8509,8780},{8940,9889},{6389,8460,9475},{8145},{6236,8147,8745},{6714,7100,7340,7713,9042,9997},{},{7222,9141,9169,9468},{6720,9146,9767,9886,9928},{9265,9832},{6484,6992,8909,9250,9279,9567},{6352,7192,7657,8653},{8065,8103,8868,9651},{6990,8294,8510},{7096,8478,9197,9634},{6461},{7145},{7317},{6556,8481,8763,9543,9992},{7549,9160,9651},{6673,6826,9395,9953},{7314,7478,7846},{},{6203,7635},{7588,7810},{6221,6947,8387},{6783},{7137,7905,8797,8827},{6798,8549,9322,9345},{7069,9601},{7821},{6974,7442,7452},{6502,6674,7692,8358,8931,9125},{6553},{9490},{7312,7989,8280,9035},{6283,7308,7593,9818},{6987,7070,9082,9521,9606,9992},{6917,7310,7608,7618,8802},{6380,6551,6903,7420,8506,9251},{1435,6793,8753,9010,9237,9767},{6663,8868,9785},{7479,7555,8504,9828},{7082,8176,8293,9264,9363,9597},{9479},{9225,9371},{6764,8016},{6940,8854},{7048,7073,8094,8383,9446,9464},{7941,7977,9669,9761},{7733,8124,8869},{8039,8470,9248,9320,9646},{7322,7356,8214,8853,9165},{6986},{8176,8805,8867,9427},{},{7994,8605,8986},{7541,8234,8664,9187,9208,9706},{8115},{7297,7700,8590,9530,9809},{7484,7858,8085,8569},{6381,6567,7278,7665,8684},{6212,6849,6869,7927,8290,8489},{6706,7033,7403,8443,9441},{8867,9865},{7473,8174,8299,8547,8853,9834},{6813,8618,8954},{6219,6444,6617,7764,8107,8220},{6919,9016},{},{6722,8145},{6668,7094,7567,8353,9318,9992},{6438,6543,7123,9543,9951},{6728,8482,8555,8828,9607},{6442,6840,6884,7869,7892,8675},{6238,7418,7442,9154,9627},{6753,8025,8106,8683,8719,8963},{7216,8171,9736},{7219,7396,7504,8007,9504},{6631,7766,9788},{6445,8328},{6414,7201,8491,8874,9180,9339},{6501,8683,8935,9011,9344},{6515,6826,7653,8312,9141,9720},{6762,7507,7904,8407,9223},{6368,6460,9327,9841},{6289,7599,7959,8304,8902},{7143,7197,8168,8567,9285,9571},{7267,7971,9835},{7944,9612},{6237,6265,6730,6814,7114,7230},{7068,8378,8504,9619},{8507,8976},{8440,9792},{},{6526,9234},{6268,7151},{6946,7825,8171,8333,8707,9227},{6269,7475,7959,9670},{7456,7720},{6345,6973,7305,9394},{6618,8739,9064,9134},{6786,6897,8022,9099,9522,9894},{6599,7244,7452},{7043},{6706},{6628,9186},{6603,7011,7346,7821,9769},{6457,6491,6987,7635,8743,9029},{6438,6993,7407,7943,7956,8714},{7341,9282,9444},{6467,8401,8640,9291},{6384,7960,9284,9754,9850},{8069,8218,8326,8792,9029,9281},{8394},{7657,7949,7998,8479,9824},{7402,7573,8060,9605},{},{6538,6629,8842},{6369,9935},{7527,9069},{7311,7936,9449},{8742},{8079},{6835,7475,9801},{7843,7882,7970,8164,9182},{},{6881,6954,7458,7495,8332},{6836,6943,7568,8013,8929,9634},{6407,7080,9124,9793},{8832},{6393,9807},{6851,7831},{6821,7042,8189,8291,8834},{6840,6896,9394,9459,9797},{6550,8320,9974},{6684,6850,7288,8727,9451},{8720,9073,9278,9644},{6479},{6363,6701,7075,7415,7941,8543},{1374,7160,7450,7842,9563},{6922},{6807,6964,9540,9698},{7212,8154,8615,9534},{7996},{6400},{6458,7659,8031,9271},{7813},{7504,8138,8147},{7009,7402,7838,8757,8963},{},{8556,9636,9789,9892},{8252,8452,9034,9134,9881},{6793,6851,7306,8483,9195},{6369,8334},{7112,7934,8150,9182},{7182,7855,7969,8994,9256},{6472,6531,7056,9120,9457,9715},{9156},{6866,7427},{7446,7656,7802,8442,9170,9778},{6680,7371},{7169,8934},{7400,8816},{8636},{7602,7707,7996,9527,9630,9825},{7727,8542,8696,8905},{7697,8793,9242,9618},{6395,7708,8928,9458,9979},{9227},{8166,9285,9750,9854},{8284,8978},{},{},{6514,9032},{7215,7255,7330,7979},{9865,9979},{6464,7038,7573,7691,8522,9881},{8823,8893},{},{6440,7772,8973,9447,9657},{7032,9852},{8582,9323},{7141,7164,7813,9025},{8309,9302},{6752,7793},{6627,8386},{6882,9072,9805},{6628,8995},{6583,6941,7335,7381,8979,9267},{7513,7618},{6333,7312,7725,7793,8788},{6842,8384},{9839},{8741,8802,9210},{6643,7044,7049,7459,9471,9937},{6450,8278,8403,8486,8661,8984},{6794},{6483,7102,7644,8200},{944},{},{},{},{6644,7375,9248,9759,9979},{6967,8270},{},{6395,6859,8037,9421,9526,9575},{7713},{6994,7454,9461},{6602,9700},{7090,8692,9525,9914},{9016,9829},{6951},{7118,7565,9245,9861},{7864,8326,9474},{7239},{},{8111,8398,8641,9047,9693,9711},{},{6904,7810,8019,8039,8366},{},{7008,8092,8133,8672},{7484,8969},{9451},{7422,7571,7723,9000,9119},{6515,6705,7348,8266},{6627,7299,9284},{9251},{6599,6892,7388,9403,9486,9893},{6977,8556,8926,9873},{6391,7649,8295,9156,9567,9611},{9492,9629,9826,9828},{8504,8653},{9157},{7483,7891,9478,9517,9528},{7768,9716},{6816,7712,9903},{8400},{7536,7543,8154,9882,9973},{6868,7424,7965,9656,9920},{6869,7303,7534},{6711,6730,6924,6987,7282},{6874,8082,8194,9745},{9053,9894},{7556},{},{7536,8572,8593,9022,9441,9879},{},{7290,9035,9374},{8263,8999,9916},{6405,8896},{8350},{6442,7871,9301,9488},{6434,6524,7702,9235},{8239,8874},{6916,7155,7346,8818},{},{8142},{},{7913,9607},{6603,7193,8197,8275,8538},{},{7019,7769,9729,9978},{7195},{6708,7039,8306,8511,8946,9670},{},{},{6577,6700,6802,8165,8580,9244},{6563},{6585,6673,6992},{6504},{7792},{7014,8414,8753,9464},{8245,8746,9511},{6821,7439,8064,9305,9462},{6579,6677},{7001,7502,9540},{},{6518,6534,6999,7677,7989,9699},{},{6770,7407,7567},{7497},{9075},{6627},{7094,7562,8223},{6507},{6498,6833,8280,8344,8510,8938},{6658,6756,7566},{},{},{7452,7496},{7270,8030,9030},{9438,9905},{7155,7181,7460,7880,8070,9374},{8900,8934,9082,9109,9719},{},{6675,7756},{8808,9519},{6521,7035},{6877,7022,7077,7751,8067,8464},{6826,7299,8861,9360},{7240,8117,8598,8659},{6596,8456,9123,9511},{6648,7465,8698},{9506,9547,9752,9767},{8589,8596,8979,9318,9342},{8187,8261,8356},{7206,7474,7940,8429,9034,9526},{7058,7757,8242,9129,9987},{},{6771,7020,7065,8053,8953},{7866,9018,9239,9428,9886},{7717,9918,9993},{7195},{7338,7888,8168,8347,8973},{},{7140,7940,8047,9645,9851},{6641,6965,7947,8756,9449,9818},{6885,7869,8297,8736,8756,9532},{6607,8844},{},{6797,7335,8043,9712,9952},{8605},{7193,7664,8326,9274,9431,9786},{7416,8838,9550},{6843,6880,7361,9285,9572},{},{7848,9671},{8782,9302},{6967,7184,9166,9334,9776,9979},{},{},{7278,7371,7485,8275,9007,9958},{8262,8471},{6789,6843,9151},{7577,7602,8098,9219,9655},{6631,7224,7283,7286,9392},{8011,9063,9633,9830,9937},{7607,7906,8310,8554,8698,8976},{},{6578,6913,7817,7987},{7630,8311,9920},{6775,7203,7757,7804,9442,9603},{7499,8749,9036,9143,9508,9803},{8968},{9726},{6785,8782,8946,9680},{7823,9441},{7188,7511,8704},{6870,8606,9656},{8656},{},{6969,8303,8921},{8305,8321},{},{6753,8308,8464,8608,8893,9809},{7157,9329,9584,9629,9789},{6758,6980,7408,7636,9190},{7336,8702},{8539,9761},{8748,9468,9808},{7813},{9023},{7106,8841,8877,9328,9797},{},{7786,9273},{},{6971,8351,9045},{6833,7377,8530,8598,8768,9296},{6894,7057,7994,9828},{6865,6875,9246,9584},{8063},{6549},{},{6891,7448,7548},{6874,7338,9419},{6880,7122,7801,8158},{6868,7140,9693},{7051,8409,8693,9719,9858},{7228},{7711,7934,8767},{7297,8847,9844},{6807,7722,7927,8290},{7200,7564,8309,9105,9207},{},{6737,7369,9266},{3704,7579},{6988,7850,8429,9367,9851},{6897,6992,8795,8941},{7997,8761,8769,8878,9626},{},{8576},{},{8074},{7073,7341,8699,9069,9536,9808},{7150},{7842,8558},{},{8943},{7535,7641,9210,9665},{7204},{6729,7677,8200,9618,9755},{7835},{6707,7731,8461,8511,9642,9810},{7820,7943,9478},{7520,8131,9510},{6959,7518,7690,7776,8729,9675},{6746,6988,7029,9666,9681},{},{7759,9032,9412,9520},{7565,8010,9538},{7727,8548,9288,9592,9939},{7110,7708,7780,8111,8558,9178},{6561,7172,7974},{},{7668},{7856,8282,8773,9435,9930},{7440},{7597,8837,9022},{6760,8304,9363,9816},{8810},{9918},{7075,8921,8933,9763},{6864,7165,7247,8432,8864,9784},{},{},{7714,8352,9475,9843},{6693,7038,8903,9887},{6796,7910,8751,8866},{6797,6900,7040,8162},{7230,8120},{},{6590,8978},{7865,9285},{},{7533,8313,8583,9850},{},{8470},{7130,7923,9099},{},{6925,7612,8125,9991},{},{7734,9002,9164},{7259,7726,7766},{7628,8010},{7278,8764,9611},{6718,6799,8485,8943,9720,9988},{7421,8076,8939},{9798},{7068,7389,8507,8641},{7354,7516,7802,8223,9088,9129},{7198,7442},{7320,7452,7602,9003},{7619,9750,9853},{6835,7279,9877,9963},{7098,7137},{8228,8726,9391,9462,9688},{7254,8944},{7897,9061},{7612,8929,9339},{},{7198,7570,7913,9274},{8215,9682},{7016,7427,7670,8692},{},{8109,9810,9909},{6688,6983,9258,9293,9464,9865},{6608,7073,8241,8992},{7360},{},{6639,7108,8071,8159,8393,9213},{},{},{},{7892,9044,9173,9648,9822},{7489,8227},{7393,7600,8341,9410,9975},{},{9927},{8180,8247,8818,9839},{7749,8688},{5722,6768,7029,8899,9309,9712},{},{},{6862,7106,7152,7498,8321,9390},{6832,7216,7893,8084},{7284,8166},{7445,8386,8651},{8004,8280,8293,9203,9311,9421},{7613,9293,9686,9714,9749,9849},{6799,8555,8860,9033},{7452,7972,9303,9512},{7386,7538,8770},{7706,9304},{7317,7409,9685,9724},{7484,9960},{6802,7904,9663},{7808},{6869,8872,9049,9165,9574},{9478},{7658},{8740},{7098,7622},{6799,7475,9380,9548,9997},{6750,8318,9693},{7249},{7169,8159,9458},{6741,8583},{6687,6761,7831,8215,8686},{7742,8378,8435,9106},{6729,8393,8978,9086},{6690},{},{8010,8757,9922},{7053,8421,8921,9722},{},{7342,7719,7937,9161,9199},{6931,9803},{7571,8758,9109,9240,9570},{},{6727,6879,7397,8608,9293},{9532,9839},{},{8679},{6734},{8225,9135,9845},{7457,8003,8665},{8995,9601},{7081,7968,8892,9257,9994},{6884,7809,8567,8571},{7148,7385,8439},{6876,7037,8928,8940,9602,9804},{6798,8191},{7840,8168,9256,9283},{6792,7634,8542},{7859,9084},{6767,8144,8791},{9361},{7189,9099},{7264,8309,9768},{7421,7695,8005,9768},{7110,8086,8315},{6791,8758},{7919,8710,9196,9684},{7728,7873,8012,8552,9253,9910},{8745},{7191,8873,9152,9601},{7432,8076,8827,9565,9629,9885},{7192,7862,7964,8392,9714},{9115},{8162,8313,8339,8892,9511,9736},{6915,7538,8616,8973,9811},{},{7145,7596,8050,8957,9091,9490},{9731},{8669,8883},{6900,7234,7651,7710,8453,8687},{8231,8510,8663,9297,9404,9521},{7019,8854,9750},{7488,8455,9763,9805},{6794,6812,7473,7477,9031,9928},{8438,9785,9825},{7312,7428,7611,7616,8094,9992},{7058,8415,8446,9097,9254,9491},{},{6774,7112,7853,8019,8935},{7087,9019},{6988,8357,8418,8984,9980},{7338},{6770,6776,6989,7215,8811,9392},{7808,9061},{},{8219},{8364,9476},{7727,7791},{7045,7742,8392,8486,9224,9481},{6792,7360,8747,9083,9402,9518},{6941,7456,8182,8224,9769,9807},{7176,7533,7573,7685,9428},{},{8441,8852,9146,9779},{},{6889,7773,7961,9748},{},{},{7408,7505,8451,9739},{},{7268,7458,8396},{1635,8555,9086,9476},{8040,8324,9450,9551,9682},{8008,9500,9513},{7070,7472,8471,8893,9554,9639},{7707,9468,9795},{7743,8698,9617},{7760,8145,9177,9468},{6857,6881,7130,7927,8804,9114},{6968,7972,8016,8571},{8443,9139,9259,9265,9632,9973},{7209,7504,7808,8110},{7107,7266,7651,9899,9993},{6995,7135,7660,8039,8057,9037},{7190,7797,9121,9153},{8774},{9179},{9154},{7315,8112,8923,8936,9388,9917},{},{7373,7787},{},{7243,7488,8739,9249},{6887,7465,7858,8196},{},{9705},{},{7926,8600,8607,9397},{7628,7797,7952},{7545,8245,8807},{7171,8449,9427,9942,9947},{6947,7244,9080,9277},{7922},{7048,8752,9190},{7046,7162,7893,9458,9469,9580},{6938,7204,7865,8448,9410,9953},{8500,9077,9150,9801},{9389,9839},{9104,9558},{6035,7286,7489,9024,9278,9752},{7274,8317},{8183,8498,9418,9499,9914},{8315},{8881,9121},{},{6873,7149,7181,7664,7946,8366},{5941,7043,7235,7749,7962,8293,9888},{8075,8223,9113},{7153},{8026,8416,8522},{7873,8245,9622},{7269,7761,7865,8654,9453,9513},{7292,8685,9289},{6801,6997,7200,8241,8750,9500},{8182,9243,9732,9757,9778},{7031,7113,7439,8563,8661,9899},{6934,9147},{9424},{},{6805,8228,8500,9022},{7012,7471,7744},{7525,8396,8543,9220},{8125,8466},{8707,9370},{6928,7201,7630,8747,8941,9677},{8102,8985,9207},{6881,7360,9343,9843},{7207,8269,8427,8715,8797,9974},{7545,8790},{7334,7861,9302,9874},{6999,7041},{},{6834,7466,9627,9835},{9683,9856},{7565},{6827},{7268,7327,9209,9230,9679,9901},{7217,9763},{},{},{7189,7192,7357,7724,8542,9759},{7347,9156},{6825,7289,8864,8887,8998,9111},{7272,8523,9498,9576},{8862,8988},{},{},{9102,9380,9490,9503},{8715},{},{7229,7499,7892},{7005,7268,7535,8035,9920},{8420},{6853,7256,7790,8113,9455},{},{7841,7933,8691,8820,9231},{7819,7922},{7015,7132,9063,9238,9817},{7200,7512,7726,9076,9362},{},{},{6954,7880,8490},{9432,9471,9488},{6921,8159,8207,8603,9261},{7859,8122,8860,8876,9552},{},{7782,8506,9610},{},{6918,7219,8670,9174},{8172,8386,9629,9770},{6959,8205,9398},{7147,7198,7943,8549,8793},{7723},{7120,8132,8412,9055,9236},{6926,7549,7570,9024},{7778,7834,8883,9400},{7972,8744},{7804,9120},{7082,9776,9901},{7542,9171,9379},{9461},{8444},{9693,9713},{7788},{6906,9460,9793,9846},{7197,7258,7357,8306,9793},{7144,9702},{7536,7591,9190},{9012,9245},{7554,8203,8714,9469},{6987,8916,9281,9462,9900},{8257,8541,8652,9598},{6954,7611,8213,8781},{6879,8562},{8403,8427,9007,9035,9280,9329},{},{6947,6953,7906},{7521,8681,8867,9893},{7605,7740,8702,9045,9060,9308},{7126,8104,8927,8935,9131,9646},{6994,8225},{8368,8776,9985},{8040,8545,8586,8619,8807,9358},{7254,7297},{7185,7253,7906,8218,9815,9824},{},{6873,6942,8394,8819,8913},{8937,9081,9487,9859},{7405,7539,9539},{7638,8232,8704,9583,9899,9940},{8591,8658,9026,9346},{},{9921},{8565,8608,8912},{6950,7416,8301,9190,9746},{6902,7050,9006,9205,9562},{8911},{8552,9829},{7054,7191,9481,9780,9838},{},{7986},{7234,8210},{8023,9499,9987},{},{8171,8179,8348,8915,9252,9467},{7208,8224,8294,8305,8392,8429},{7448,7606,8810},{9473,9507,9831},{6971,7849,8193,9345},{7255,7537,8425,9448},{8322,9772,9997},{7443,8131},{},{},{7530},{},{7245,7543,7674,8600,9396,9698},{7293,7773,9329},{7268,8000,8281,8368,9667},{7223,7322,7802,7997,9332},{7481},{},{},{7335,8957,9653,9824},{7854,8186,9930},{6962,7831,8045,8878,9427,9679},{},{7067,7615,8216,9431},{7379,7626,9567,9774},{7446,7939,8958,9433,9942},{7482,8597,9634},{},{9290},{7026,7651,9074,9274,9901,9961},{7332,7923,8127,8155,9720,9733},{7812,7842,8205,8654,9371,9744},{7610,7967,8077,9716},{7001,7174,7244,8425,9191},{8287,9376},{7381},{8268,8406,8477},{7560,8303,8940},{7201,8156,8222,8275,8886,9929},{7024,7869,8373,8686,9463,9662},{7124,8285,8407,8828,9848},{8256,9385,9456},{8469,9338,9997},{7239,7300,8051,8911,9583,9779},{7009,7625,7753,9940},{},{7163,8521},{7068,7311,7388,8686,9208,9462},{7458,8407,8610,9326},{6968,7009,8044,8392,8884,9084},{7196,7225,7337,7714,8046},{7369,9687},{7436,9350,9524},{7415},{8688},{7325,7925,9449},{8273,8558,8765,8890,9022,9691},{6961,8204,9276,9415,9530,9540},{6957,8263,8838,9006,9121,9240},{7017,7442},{7259,7659,8758,8911},{7659,8205},{},{8447,8534,8563,8703,8733,9171},{8811,9170,9503,9569,9927},{8112},{7921,9566},{8024},{7790,8606,8671,9902},{9345},{6994,8353,9544},{7076,7350,7637,8837},{6987,7241,7481,7512,7957,9176},{6994,7125},{7204,7389,7705},{7552,8353,8586,8773,8951,9781},{},{7155,7190,8373,9625,9888},{7331,9042},{9161,9436,9497},{7150,7234,7268,7905},{7519,7852,8909},{7245,7403,8345,8593,9337,9728},{},{7268,8225,8289,8511,9344,9832},{7550,8084,8259,9176},{7338,7780,8824,9899},{7778,8083,8437,9477},{7659,8216,9071},{7720,8869},{8039,8182,8209,8426},{7049,7523,8541,9168,9187},{7034,7124,9288,9305,9362},{8465,8531,8661,9662,9771},{7159},{},{7769,8391},{7440,8349,8402,8486,9547},{7436,8693,8713},{8321},{7758,8470,9130,9183},{},{7184,8514},{7338},{8031,9239,9555},{},{7261,8398},{7007,7011,7170,8659,9910},{8235,9228,9635,9690,9694},{},{7039,7354,7790,8053,8325,8923},{9031},{8422,9511},{9179,9771},{},{8858,9437,9672},{7454,7466,8305,8944,8964,9367},{7729,7805,8287,8479,8905,9474},{8257,9075},{7426,7599,8636,9255,9854,9951},{7150,7640,8788,9165},{7249,7884,8027,8342,8424},{9177,9683},{8954},{8783},{9030},{7777,8008},{7037,7131,7497,7866,8866},{},{},{7721,7926,7980,8805,9460,9641},{7268,8914,9865},{7493,7558,8502,8705,9078,9427},{7248,8572},{7139,7610,7801,8346,9084},{7264,7858,9539},{},{8433,9492},{7490,9589,9646,9903},{8448},{8485,9236,9865,9937},{5024,7110,7316,7607,9121},{},{},{},{8261,9085,9648,9885},{7074,7340,7432,8197},{7254,7269,7951,8745,9205,9509},{7212,7406,8474,8736,9261},{7592},{7398,8380,9303},{9361},{7892,8051,8334,9988},{7448,8149,8883,9513,9619,9859},{7394,7518,7618,7995,8865,8932},{7982,8998,9025,9345,9478},{7524,7932,8080,8100,8220,8438},{8046,9771},{1761,7517,8060,9805},{7063,8269,9389,9535,9645,9944},{2781,7342,8396,8595},{7765},{},{9024},{8937,9272},{7252,7809,8976,9472},{7562,8961,9676},{},{8071,8172,9167,9444,9673},{7383,7731},{8813,9308,9920},{8268,8477,8611,8704},{8063,8293,8455,9293,9362,9589},{7957,8836,9703},{7664,7846,8750,9232},{7386,9735},{7767},{7099,8081,9176,9737},{7924,9368},{9068,9841},{9385},{},{8366,8512,8640,9651,9891,9923},{7550,8028,8840},{7849,8138,8295,8503},{7205,8742,8780,8861,8896,9872},{7466,7854,8147,9298},{7148,8070,9583},{7136,8027},{7370,7502,7583,7652,7897,9708},{7367,9455,9740},{8297},{7369,8053},{7669},{8374,8863},{},{},{7599,7916,8422,9762},{7966,9391},{7261,8469,9062,9424,9557,9559},{7696,8565,9829},{7400,7598,8492,9266,9580},{8081,8568,8582,8657,8676,9601},{7136,8767,9068,9086,9114,9588},{7443,7958,8592,9638,9733},{},{8452},{8946},{8083,8439,8907,9295,9691,9837},{8110,8391,8517,8533,8882},{7721,8141,8351,8395,9855},{7887,8011,8242,8339,8567,9363},{7552,8015,8452,9224},{7153,8173,8311,9084,9114,9570},{7484,7852,8711},{7280,7547},{8531,8713,8730},{7116,9366},{7238,7459,7833,8427},{},{7839,8019,8220,8308,8498,9876},{},{7988,8379,8847,9249,9544},{7205,7461,8186,9595,9909},{7887,7914,8303},{8718,9043,9074,9231},{9122,9462,9596},{8326,8956,9233,9696,9957,9962},{7581,7700,9262,9729,9742},{7620,8593,8823,8986,9514,9785},{7478},{7203,7856,8487},{7278,7862,8152,9337,9538},{7332,8282,8318,9522,9677},{7703,8210,8457,8703,9450},{7912,9075,9269,9741,9961},{9315},{7700,8205,8616,8629,9842},{7176,8694,8847,9349},{562,8421},{7902,9274},{7324,7447,7474,7728,8112},{7991,8283,9141,9549,9644,9750},{7397,7911,9390},{8872},{},{},{7370,8170,8329,8886,9073,9854},{8783},{9008,9031},{7641,9571},{8490,9302},{8755,8814,9325},{8092,8227},{7380,7435,7942,8108,8790},{7212,9746},{7227,8323,9003,9670,9801},{7325,7999,9132,9778,9821},{7640,8752,8976,9528,9973},{7270},{9822},{8354,8662,9209,9547},{8416,8734,9106,9674,9899,9996},{},{7396,8913},{8233,8830},{7795,9139,9853},{7341,8505,8624,9189},{9297,9788},{7272,7760,9257,9834,9950,9951},{7883,8654,9451},{9397},{7194,7695,8239,8319,8610,9278},{8355},{7213,9051},{7192,8478,9504},{7330,8055,8690,9528,9858},{9076,9412},{8247,9806},{9480},{8023,8436,8448,8988,9631,9758},{7259,8613,8707,9458,9950},{8556},{7922,8028,9107,9357},{7359,7479,7704,8371,8636},{7746,8642,8721,9254,9797,9953},{7362,7441,7896,8475,8648,9807},{7526,8545,8814,9493,9869},{8359,9367},{7920,8659,9092,9266,9553},{8139},{8825},{7503,7600,9288,9430,9898,9989},{7756,8255,8886,9634,9865,9983},{7753,7849,7976},{7379,8868,9511,9779},{8234,8475,9374},{8476},{7725,8436,9515,9523,9559},{8369},{8966,9619},{8447,9085,9291},{8889,9025,9321,9353},{},{9168},{7489},{7389,8347,9962},{7713,8145},{7278,7469,8232,8664,9623,9790},{8051,8636,9714,9806},{7612,7829,8677,8938,9350},{7247,7785,8360},{7598,8083,9625},{7306,9116,9420},{7745,9357,9467},{7326,8922},{7437,7578,8621,8868,9872,9918},{7325,8483,9110,9275,9455},{8709,8923,9717},{7687,7856,8991,9219,9701},{7370,9097},{},{},{7598,7717,8108,8297,8631,9439},{7952,8742},{7915,8214,8659,9696,9700},{7447,9912},{},{8234,8399,9341,9941},{7701,8137,8288,9736},{7524,7879,8718,9613,9705,9991},{8518,8982},{7286,7468,8145,9285,9718},{7879,7897,8984},{7728,8147,9406,9608},{8168},{7432},{7680,8553,9030,9078,9338},{7251,8155,8471,9711,9792},{7307,8080,8283,9112,9636,9835},{9000},{7744,9629,9712},{7980},{7442,7522,7668,8637,8808,9918},{7945,8083,8340,9646,9933},{8932},{7727,7959,8078,8191,8895,9692},{7421,8046,9555},{7732,8121,8234,8434,9919},{8930},{7254},{7631},{9608},{8308,8431,8613,8711,8905,8993},{},{9632},{7940,8016,9753},{7513},{7458,7914},{7488,7743,8340,9119,9502,9851},{7587,8890,9299},{7284,7675,9766},{7563,7581,7923,9502,9596},{8242,9864},{7787,7933,8034,8084,9584,9671},{9815},{7463,8769,9372},{8169,8399,8692,9671,9876,9889},{7749,8663,9265,9540,9945,9947},{7419,8464},{7439,8767,9689,9709},{},{7498,8010,8492,9367},{7563,8993},{9187,9350},{8321,8378,9500,9569,9591},{7396,8947},{7355,8040,8090,8271,8810,9577},{7555,7799,8853,9130},{7425,7943,8329,8845},{7808,9510,9719},{7399,8224,8246,8825,8895,8993},{},{9495,9549,9707},{7627,8678,8834,9516},{7587,7825,7931},{7399,7624,8758,8874,9125,9970},{8683},{},{7324,8938},{7354,7613,8982,9553,9920},{},{8421,8543,8552,9643,9908},{7891,8721,9153},{5275,7519,7943,8036,9570,9878},{9104,9233},{7334,8855,8879,9799},{7570,8536,9921},{7775,7845,7934,8761,8763,9570},{7611,8580,9262,9523,9759},{7797,8561,9649},{7315,8010,8455,9991},{8597,8624,8792,9682,9900},{9789,9967},{8377,8511},{7390,9225,9810},{8672,8772},{8226,9553},{8755,8822,9131,9593},{8493,9957},{7589,7692,9477,9612,9962},{7575,7664,8988,9139,9775,9850},{8826,8964},{7506,8107,8445,8622,8885,9842},{7341,8528,9483,9730},{7926,8184,8791,9014,9724},{7769,9232,9571,9732},{9137},{},{8187,8808,8832},{7661},{7375,7668,9902},{},{8191,9031},{8294,9026,9821},{},{9035},{},{7346,7487},{7506,8278,9291,9600},{7807,8660,9365,9568,9866,9916},{9773,9985},{},{8101,8334,8605,9578},{7474,7788,7826,8448,9028,9538},{7941,7969,8188,8211},{},{8564,8942,9762,9999},{8394,8637},{7527,8353,9681},{7358,7561,7946,8114},{9882},{7829,9525},{8648,9486},{7343,8025,8470},{7679,8115,8272,8584},{9190},{8352},{7939},{8246},{8134,9167,9272,9429,9828},{8342,8799,9270},{8312,8944,9171},{},{},{8381},{},{7360,7371,8004,8087,8519,9409},{7697,7727,9531,9966},{7813,9302},{8046,8243,8556,8607,9539},{},{9040},{7788,8348,8864,9188},{7404},{7456,9058,9152,9601,9700,9979},{8278,8975,9269,9337,9605},{7533,8009,8747,9454,9488,9950},{8005,8580,9195,9487,9552,9805},{7859,8700,8713},{},{7779,8600,8604,8729,9274,9713},{8204,8534},{8091,8417,8550,8841,9155},{8133,8958},{7499,8157,8483},{7565,9432,9552},{9510},{7636,7926,9471,9696,9793},{8688,9094,9559,9597,9666},{7763,8502,8534,8773,9105,9353},{7443,9027,9210},{7650,7910,8260,8517,8578,9090},{7494,8451,8533,9530},{7557,8240,9100},{7649,7654,7739,8820,8884,9529},{7523,9071,9277,9617,9896},{8154,8633,9271,9499,9879},{},{7702,7870,7938,8959,9468,9514},{8268,8429,8955,9017,9130,9527},{7903,9927},{7401,7489,7573,8427},{7853,8301,8602,9086},{8128,8200},{7569,8413,8653,9072,9794},{7892,9899},{7533,7583,8283,8286,8488,8903},{9156},{7794,8517,9531,9848,9951},{},{7692,7905,8052,8738,9342},{7578,7715,7743,9024,9284,9487},{7562,8235,9120,9168,9317,9393},{8028,8675,8906,9408,9648},{},{8934},{8756,9141,9484},{},{7432,7528,8340,9186,9239,9393},{8140,8773,8781,8933},{7800,8309},{8081,8492,8849,8994,9118,9652},{7807,8524},{},{8070,8404,8807,9050,9064},{7499,8014,9272},{8978,9937},{7748,8737,8762,8912,9877},{7612,7620,7629,7767,8741},{7913},{9106,9643},{7738,8407,9547,9667},{8257,8523,9271,9582},{7897,8160,8438},{7563,7746,8601,8694,9373},{8037},{7633,7951,8050,8098,8994},{9237},{},{8669,9713},{7657,9230,9601,9761},{7838,9336},{8979,9515,9699},{7757,7946,9373,9468,9628},{8117,8212,8277,8531,8609,9070},{8169},{7872,8646},{7920,9258,9789,9800},{7472,7899,8075,8232,9800},{8450},{7533,7733,8365,8631,9658},{7618,8664,9551,9817,9859},{8331,8415,8852,9511,9606,9817},{7834,8213,8530},{8775},{9346},{9649},{8695},{7647,7671,8909,9187,9714},{7757,8105,9095,9342,9784,9884},{8007,8916,9044},{},{8243},{7829,8010},{7765,7911,8074,8769,9792},{},{7671,7978,9266,9843,9901},{7600,7715,8154,8333,8737,8956},{8454,8525},{7758,8772,9869,9884,9885},{},{8174,8222,8593,8784,9503},{8695},{},{9900},{9450},{8244,8508,8980,9184,9797},{},{7520,7594,8431,8839,9057},{7822,8221,9661},{8069,8248,8308,9248},{7961,8316,8767,9080,9459},{7515,7661,7796,7827,9688},{7727,7959,9115,9687},{8455,8460,9848},{7733,8217,9356,9939},{7735,8428,9729,9923},{8350,8427},{8036,8191,9972},{7819,9158,9210,9504},{9143,9496},{7848,8149,9824},{7617,9243,9633},{7784,7966},{8307,9157,9983},{8163,8380,9116,9813,9860},{7791,8351,8976,9165},{8215,9159,9978},{8063,8225,8328,8382,8522,9542},{7922,8817,8874,8921,9824},{7926,8308,9954},{7905,9871},{7849,8329},{8020,8433,9409},{7553,8419,8969,9338,9797},{1231,9884},{7759,7770,8203,8952,9246,9822},{8191,9122,9409,9536,9605},{},{8494,8851,8993},{9172},{8277},{},{7985,9755},{7713,8069,8539,9220},{8227,8285,8381,8511,9035,9739},{7544,7884,8545,8610,9511,9891},{},{9443},{8045,8253,8918,9464},{7657,7704,9647},{7945,8112,8391,8536,9463},{8024,9074,9335,9500,9552,9704},{8030,8162,9152,9158},{7746,7937,9017,9421},{},{7651,7653,9099,9771},{8443,8527,8838},{},{},{},{7911,9456,9570},{7698,7772,9242,9362},{8261,8521,9008,9744},{7643,7932,8206,9024,9721,9964},{},{},{7639,8414,9609},{9395},{7898,8712,8989,9025,9494,9713},{8679,9198,9451},{9647},{7932,8534},{},{9191,9366},{8332},{8046,9349,9920},{8406},{7736,8217,8478,9369,9451},{7550,8041,9422},{9304,9520,9682},{7746,7944,9162,9200,9807},{7694,8249,8264,9077,9233},{7718,7723,8239,9108},{},{},{8323,8857,9130,9404,9528,9805},{7892,8162,8309,8527,8557,8572},{7583,7904,8222,9018,9870},{7664,7797,8499},{7619},{9587},{7728,8264,8492,8984},{},{8046,9152},{},{8732,8922,9601,9982},{8884,9248},{7617,8284,8659,8814,8933,9831},{7586,7950,8009,8288},{7580,8081,8179,8241,8507,9861},{7566,7796,8627,8806,8890,9447},{8165,8438},{7918,8447,8463,9984},{8469,8823,9219,9689},{7706,9575,9968},{7738,9855},{8563},{},{5781,7696,8681,9226,9854},{8602,9683,9695,9800,9855,9945},{7963,9537},{9438},{},{7575,7795,8319,8600},{7819,7908,7987,8283,8714},{8180,8831,8988,9259},{},{8282,8947,9150,9172},{7588},{},{7912,9408},{7599,7780,7949,7951,8160},{8415,8545,9297,9634},{8248,8455,8746,9000,9228,9944},{7619,9686,9974},{7837,7912,8132,9451,9770},{9125},{8843},{9422,9935},{},{7664,9035,9588,9641,9737},{},{},{8190},{7746,7922,8122,9068,9455,9672},{8008,8246,8319,8566,9164,9566},{7612,8219,9380,9623},{},{8053,8104,8637,8901},{8424,8887},{7844},{7670,7920,7965,8731,9783},{7883,8068,8269,8651,9533},{8552},{7841,7934,9523},{7723,8509,8561,8802,9594,9948},{9753},{},{8053,8254,8552,9297,9346},{8566,8986,9467,9861},{7943,9538,9668},{},{8312,8822,9487},{9053,9953},{},{7742,8393,8425,9005},{8231,9103},{7870},{9114},{9323},{},{},{8048,9836},{8602,9000,9458},{7826,9086},{7958},{7921,8149,8888,9165,9174,9542},{8017,9020,9075,9150,9211,9749},{1055,7947,8013,9203,9304,9338},{7875,9164,9562},{},{8895,9458,9734,9763},{7845,7850,9416},{7998,8387,8815,9363,9947},{8190,8550,9039,9107,9554},{8049,8567,8708,9421},{8572,8830,9115,9684},{8156,8378,8668,9904},{},{7790,8066,8827,8947,9670},{7908,9179,9389,9544},{8212,9605,9658,9820,9855},{7858,8184,9200,9221,9296,9597},{7946,8223},{8289,9415},{8155},{7891,9470},{8722,8849},{7789},{8175,8680,8961,9568,9831},{},{},{8047,8717,8764,9364,9874},{7801,8364,9007,9184,9530,9640},{8022,8477,9179,9214},{8304,8528,8610,8736,9686,9967},{8092,8605,8756,9048,9966},{9316,9915,9922},{8654,9805},{8139,8322,9362},{8897},{8285,8327,8855},{7886,7887,7957,8564,9624},{7661,8272,8293,8809},{8018,8036,8220},{},{9070,9236},{7878,8832,8965,9380,9491,9848},{7751,7882,7909,9618},{},{7972},{7687,8327,8435,8522,8941},{9333,9366,9374,9639},{3035,8579,9064,9172,9574,9842},{7830,8105,9052},{9656},{7834,7907,8884,8913,9652},{8242,9090,9691},{8638},{7736,7784,8021,8792,8848,9864},{8051,8978,9335,9730},{9292,9431,9516,9935},{7929,8093,9307,9320,9802},{8637,8914,9388,9477,9550},{},{7803,8201,8387},{},{7984,8489,8663,9877},{7686,7900,8827,9602,9997},{8948,9268},{8527,8645},{7915,8068,8229},{8349,9008,9020},{},{8541,8796,9527,9723},{8209},{7831,9016,9445,9755},{9221},{7730,8012,8373,8639},{8166,8771,8953,9368},{8687,9801},{},{7749,8449,9072,9343,9896},{3275,8199,8865,9517,9859},{7887,7954,8221,8655,8939,8956},{8362,9084},{},{8769},{7835,7842,8056,9537},{8024,9167,9734},{7933,7995,8247,9084},{7826,8373,9105,9419},{7724},{9412,9711},{8092,8271,8621,9030,9705,9935},{8603,9483,9918},{8658},{8310},{8696,8737,8947,9119,9811},{7968,8030,8055,8694},{8097,8441,8657,9388,9839,9907},{7764,8352,9159},{7760,8620,9402,9739},{7739,8799},{8852,9528,9991},{7966},{},{7798,8384,8647,9987},{7723,8006,8794,9092,9703,9883},{7924},{8066,8078,8730,9079},{8507,9201,9243},{8087,9010,9446},{7986,8281,9693,9719},{8204,8425,9197},{8234,8485,8545,9871,9955},{7887,8196,8356,8892,9431,9469},{8168},{8414,8485,8629,8933,9090,9528},{7757,8179,8591,8914,9417},{8045,8658,9180,9400},{7770,8750,8895,8990,9308,9509},{9537},{8917,9786},{},{8945},{},{8478,8902,9520},{7912,8004,8252,8557,8765,9281},{},{8031,8415,8443,8964,9643},{9176,9460},{7920,9547},{9331,9826},{8642,8662,9128,9632},{8031,8745,8893},{904,8011,8283,9028,9644,9669},{8397},{8307,9204,9989},{8781,8873,9361},{8319,9864},{8019,8177,8372,8524},{8073,8851,8871,9120},{},{8474,8845,9198,9424},{9128,9227,9498,9996},{},{7933,9293},{9294},{8437,9316,9631},{9935},{8224,9878},{8640,9300,9492,9953},{7832,8137,8416,9355},{8230,8736},{8499,9527,9700},{7911,7955,8070},{9228},{8305,9187},{9701},{8029,8138,8675},{7817,7915,8647,9193,9388,9826},{8472,8594,9012,9479,9969},{8318},{8117,8242,8688,9454,9793},{9403,9418,9566},{8518,8953,9222,9273,9737,9957},{},{9149},{8103,8839,8852,9891},{7798,7908,7937,9774},{7867,8735,9571,9664},{7854,9966,9969},{7918,8292,8808,8988,9201,9298},{8126,8755,8936,9079,9798},{8749,9980,9984},{7995,9052,9147,9371},{7877,8235,9509},{9353,9474},{8245,8896,9896},{},{7800,9551,9720,9904},{8308,8586,8700,9001,9981},{7964,8361,8451,8906,9471,9629},{9274,9498,9722},{8613,8677,8784,9259,9311,9935},{7859,9372,9892},{7871,8490,8533,8891,9444,9911},{9046,9130,9974},{},{8510,8515,9703,9874},{7855,9560},{7925,9092,9482},{8203,8809,9070,9517,9611,9832},{8160},{},{9086},{},{8203,8704,8783},{8498,9221,9244,9482,9711,9984},{8157,9240,9585,9900,9955,9959},{8031,8166,8717,9021,9096},{8646,9360,9595},{8163,8473,8680,8758,9162},{},{8098},{},{8575},{9534},{8921,8938,9288,9835},{},{8428,8769,8771,9235,9274,9421},{9021,9717},{8778,9374},{8190,8994},{},{7903,9076,9565,9671,9987},{7905,7916,9912},{},{7953,8455,8725,9074,9195},{8405,8916,9023},{},{7949,8842,8927,9045,9363},{},{8195,8839,9540,9883},{8189,8912,8942,9588,9858},{8593,9077,9197,9487,9841},{},{7841,8776,9120,9288,9405},{8763,9409},{8727,8898,9223,9537},{},{},{5978,8211,8741,8956},{},{8552,9492},{8299,8671,8691,9194,9784,9866},{8945,9233,9538,9942},{8498,9598},{},{8079,8473,8725,9076,9655},{8248,8642,9443,9577,9663},{8353,8936,9031,9887},{7873,8173},{8581},{7884,8419,8729,9029,9202,9647},{7945,9701},{8284,9130,9645},{},{8425,8461,8774,9610},{7862,8021,9083},{8451,8500},{7880,7953,9491,9760,9779,9868},{8077,8982,9436,9579,9706,9803},{8272,8303,9195,9361},{},{9009,9741,9744},{8187,8254,8570,8781},{8021,8668,8865,8973,9253},{},{8300,8348,8478,9173,9953},{9192},{8062,8637,9218,9437,9654,9800},{8450,9297,9387,9638,9848},{7994,8082},{9205,9360},{8311,9205,9574,9663},{8781,9833,9955},{7920,8711,8824,9292,9764},{4329,8116,8273,9430,9627,9910,9923},{},{7925,7962,8368,8774,9210,9844},{8642,8997},{7979,8082,8270,8305,8520,8574},{8008,8399,8539,9163,9245,9546},{8049,8487,9048,9687},{8135,9602},{9507},{8078,8397,8946,9051,9358,9984},{8320,8397,8420,8752,8822},{8213,8841,9509,9661},{},{7964,8106,8299,9180,9642},{7991,9449,9479,9967},{8201,8373,8904},{8272,8348,8837},{8500,8548,9053,9747,9794},{8698,8997,9225,9420,9953},{7974,8252,9534,9969},{8359,8569,8620,8920,9517},{},{8017,9718},{7926,8276,9342,9430,9436},{9835},{8206,8477,9086},{8842,9220,9786},{8618,9014,9359,9611,9916},{8328,8406,9307,9579,9908},{8537,9669},{7965,8774,9408},{8580,8621,8722,9403,9761},{},{7989,8117,8442,8941,9332,9715},{8606,8990,9149,9644,9723},{8455,8815,9500,9568},{7976,8755,9313,9372,9620},{8546,8853,9237,9803},{},{8100,9764},{8744,9254},{8295,9594},{8023,8528,8688,8740,9481,9543},{9510,9921},{1070,9312,9884},{8494,8719,9442,9485},{7985,8099,8720,9053,9154,9309},{},{},{8512,8633},{8302},{},{8623,8801},{8105},{8133},{8298,8399,8666,8922,9130,9234},{8034,8387,8419,8479,9464,9794},{8987},{8151,8876,8922,9080,9718,9872},{8625,9070,9471,9472,9513},{9571,9993},{8180,8406,8570,9049},{8455,8945,9622,9661},{9038,9353,9687},{8224,8483,8811},{8782,9837},{8886,9116,9386},{8460,8656,8821,9264,9745},{8234},{},{7984,9315},{7988,8342,9055,9224,9233},{},{8177,8352,8904,9106,9914,9988},{8916,9598,9634},{8285,8333,9126,9215,9251,9481},{8533,9173,9461},{8071,8275,8525,8768,8862,9430},{8193,9293},{9767},{8141,9411,9657},{8526,9718},{7983,8041,8158,8543,9109,9298},{},{},{8302,8604,9100,9858},{8656},{8349,9006,9195},{8182,8505,9182,9793},{8088,8215,9035,9467,9663,9822},{8139},{8418,8647,8766,9541,9808},{7977,8412,9207,9991},{8668,9211},{8180,8345,8624,9755},{8054,8614,9003},{8626,8809},{8451,8684,9998},{8158,8321,8502,8560},{8101,8532,9945,9947,9986},{9763},{8091,8793,9279,9407},{9192},{8019,8345,8553,9957},{8344,8610,9059},{8161,8219,9247,9621,9787,9882},{9079,9793},{8533},{},{8206,8484,9030,9681},{9950},{},{8264,8991,9022,9285,9957},{1738},{9106,9238,9627,9909,9968},{8022,9542,9567,9863,9941},{8615,8874,9368,9620},{},{8173,8315,9287},{8893,9627},{8499,8712,9580},{8562,8603,9775,9783},{},{8508,8742,9108,9223},{9971},{8643,9258},{8261,9992},{8398,8679,8699,9525},{8788,9339},{8462,8546,8951,8985,9064,9510},{8327,8883,9126,9453,9967},{8431,8822,9149,9350},{8682,8833,9378,9425,9862},{9858,9864},{},{},{8020},{},{7589,8349,8971,9244,9548,9675,9887},{},{8155,8447,9456,9705},{8486,9025,9907},{},{8267,8382,8642,9128,9149,9881},{8056,8469,8983},{8474,9916,9991},{},{8524,8717,9478,9938,9963},{8517},{9138},{8215},{8182,8623,8664,8667},{8369,9659},{6197,8507,8597,9765},{},{8951,9674},{9286,9471,9869,9951},{8547,9288,9354,9543,9947},{8230,8320,8365,9071,9229},{9080,9226,9375,9517,9604},{8194,8425},{8309,8383,8386,8515,9658,9757},{8308,8402,9238,9274,9699},{9350},{8429,9074,9591,9600,9736},{8087,8794,9074,9164,9758},{8524,8683,8954,9149,9769,9887},{8312,8325,9853,9912},{8057,8861,9218,9279,9399},{},{8159,8610,8877,9697},{8409,9066},{8593,8675,9881,9943},{},{8495,9103,9275,9396,9645,9933},{8064,8290,8306,8502,9708,9845},{},{9270,9673},{9044,9330,9523},{8152,8205,8991,9184,9506,9899},{},{8433},{8284,8860,8937,9089,9374,9816},{9381,9456},{8250,8587,8652,9396,9411,9713},{9552},{8221,8481,8683,8750,8858,9330},{8217,9920},{},{8577,8803,9148},{8282,8554,8920,9710},{8156,9788},{8674,9955},{8204,8760,8781,9130,9501,9969},{8112,8941,8948,9492},{9009},{8670},{8435,8769},{9173,9200,9343},{},{8683,8832},{8719,9628,9697,9731,9842,9916},{8286,8499,8600,8814,9955},{9264,9611},{8086,8652,8678,8737,9455},{8105,8192,9099,9179,9442,9591},{9944},{9067,9238,9598,9793},{},{},{9907},{8166,8478,8941,9248,9321,9475},{8415,9005,9238,9824,9954},{8386,8667,8685,9105,9217,9777},{9164,9583,9980},{9150,9230,9281},{9444},{8145,8906,8960},{8344,8655,8724,9387,9546},{3067,9316},{8354,8846,8881,8954,9301},{8229,8364,8507,8566,9626},{8287},{8250,8454,8676,8850},{8768,8831,9082},{8381,9050,9270,9274,9391,9872},{8515,9047,9269,9629},{9434,9998},{8383,8620,8795,8830,8933,9854},{8670},{8181,8193,8516,8867,9277,9450},{8432,8827,8884,8954},{8904,8996,9175,9793},{9652},{6616},{8412,8433,9138,9164,9586},{8232,8278,8708,8743,9468,9791},{8454,8733,9348,9753},{8119,8394,8661,9283},{8509,9127,9142},{8637,9077,9118,9717,9867,9961},{8332,9553,9562,9818},{8602,9022,9094,9923},{},{9941},{},{9208},{8302,8695,8802,9004,9038},{8338,9482},{8475,9274,9553,9660,9838},{8176,8410,8577,9330,9472,9723},{8182,8451,8873,9781},{8252,8606,9309},{8154,8411,8544,8922,9019,9689},{},{8797,9245,9968},{8390,8653},{8190,8935,9179,9887},{9333,9772},{8190,8746,8792},{8396,8595,9187},{8871,9942},{8204,8409,8831,9134},{8639},{8252,9081,9202,9955},{8647,8883,9485,9561},{9276,9780},{9245},{9399},{9104},{9755},{8759,8818},{9016,9628},{8572,8686,9842},{9101,9558},{},{},{8341,9539},{8325,9098,9374},{8766,9115,9511},{8644,8932,9218,9640},{8949,9123,9190},{8696,9173,9742,9925},{},{8583,8595,8705,8954,9127,9288},{8788,9242,9787},{9138},{8870,8955,9556},{8397,8600,8819,9501,9980},{8306,8977,9716,9893,9950},{8438,8460,8695,8723,9857},{8966,9761},{8272,8648,8848,9155,9733,9899},{8726,8837,9448,9467,9640,9891},{8274,8745,9173,9555},{8381,8859},{8265,8463,9115,9424,9548,9585},{8301,8838},{9084,9094,9252,9500,9605,9648},{8255,9419},{8410,9095,9864},{},{9245,9802},{8906},{8460,8649},{2042,8456,9629,9705},{},{8483,9001,9489},{8282,9281,9285,9427},{5115},{8567,8684,8950,9423},{9274,9337,9990},{8388,8425,8548,8562,9317,9344},{8343,8492,8601,8861,8996},{8855},{9073,9406},{8212,8337,8384,9852},{8794,8880,9137,9960},{8381,8628,8999,9757},{9182,9270,9370,9378},{8856,9059,9482,9842},{9948},{8221,8339,9274},{8587,9410,9848},{8401,8913,8918,9683,9725,9773},{8767},{8248,8704,9205,9243,9320},{8594,8606,9503},{},{9382,9458},{8251},{8819,8885,9369,9412,9687},{8375,9181,9191,9370,9895},{8255,8527,8860,9424},{8350,8409,8482,8738,8799},{8653,9977},{9508},{8524,8552,9543,9645,9752},{8245,8545,8728,8978,9001,9800},{8542,8964,9206,9349,9509,9776},{8929,9222},{8710,9028,9313,9447},{8239,8790,8796,9502,9709},{8345,8371,8872,9014,9320,9769},{8694,9643},{8509,9168,9900,9921},{8506,8546,9174,9595},{8826,9409},{9996},{8308,9977},{9614,9771,9976},{9305},{9094},{8238,8548,9311,9673,9699,9787},{8796,9039,9167,9645,9838,9954},{},{8401,8549,8888,9231,9589,9661},{8284,8691,9537,9734},{8561,8935,9315,9690,9710},{8293,8356,8375,8503,8909,9245},{},{},{8905,9035,9396,9774},{9972},{8339,8524,9379,9513},{8314,8652},{9026,9080,9237,9302,9407,9775},{8754},{8451,8461,9235,9585},{9495},{9246,9451},{8725,9150},{8640,8743,9185,9213,9666},{8545,9069},{9110},{8734,8823,9785},{8519},{8543,8605,9411,9488,9665},{8277,8575,8837,9438,9852},{8385,8730,8737,8985,9138,9426},{8409,8507,8903,8978,9113},{8809,9052,9849},{},{8473,9298,9705},{8767,8776,9567,9670},{8878,8894,9445,9809},{8615,9351},{9737},{9449,9538},{8666,9934},{8570,9860},{8461},{8800,8945,8983,9028,9149,9315},{8714,8889,9776,9983},{8364,9117,9161,9707,9986},{8317,8448,8728,9048},{8476,9089,9232,9349,9635},{8729,9890},{9582,9611},{8396,8745},{8448,8779,8787,9660,9945},{9988},{8302,8798,8937,9573},{8413,8536,8611,8709,9117,9602},{8414,8702,9086,9654},{8443,8658,8920,9059,9894},{8504,8516,9621,9930,9954},{},{8324,8578,8909,9840},{},{8303,8793,9146,9613},{9130},{},{8494,9034,9062,9498,9580,9619},{3026,8924,8960,9039,9228,9783},{8393,8421,8457,8638,9188,9518},{9404},{},{8710,9066,9178,9542,9697,9725},{8509,8798,9541},{8962,9234},{},{8661,9482},{9177},{8811,9606},{8756,9232,9407},{8783,9082},{8337,8643,8701,8798,9141},{8431,8686,8718,9576,9758},{8664,8762,8952,9123},{8707,8941,9120,9425},{},{8338,8620,8888,9064},{8419,8540,8807,9202,9647,9819},{8582,8732,9339,9619,9629},{8551,8725,8807,9051,9343},{},{8526,8587,8903,9531,9903},{8841,8853,9720},{8340,9552,9696,9718,9836},{},{8466,9025,9056,9403},{},{8368,8592,8674,9879},{8401,8597,8647,9179,9513,9588},{},{8673},{8778},{8577,8989,9468},{8370,8593,9010,9270,9946},{8543,8590,8809,9201,9753,9923},{8436,8922,9568,9788},{8372},{8447,8481,9269,9582},{9487},{8760,9311,9431,9506,9697,9744},{8763,9093,9524,9683},{8681,8870,9619,9842},{8501,9727},{9535},{9053,9140,9670},{8498,8695,9048,9235,9459,9926},{8633},{8597,8813},{9226,9932,9956},{},{8600,9240,9381,9458,9846,9888},{8539,8573,8933,9301,9592},{8716,8930,9039,9706},{8792,9380,9731},{},{8578},{8483,9913},{8360,8698},{8832,9445},{8508,8679,8877,9007},{},{8363,9656},{8513,8713,9336,9811,9862,9935},{},{},{8467,8486,8891,9196,9388,9789},{8537,8661,8746,8879,8899},{8682,9118,9170},{8926,9333},{8503,9324},{},{9030,9418,9634,9677,9834},{9334},{8864,9479,9508},{9729},{9684},{8757,8882,8915,9400},{8761,9157,9846},{8629,9193,9219,9976},{8520,8693,9445,9840},{8673,8834,9244,9443},{8706,9314,9665,9728},{9862},{8786,9937},{8510,8681,8767,8922,9299,9618},{8941},{},{8635,9355,9900},{9070,9134,9305,9608,9698},{},{8580,9677},{8474,8499,8649,9092,9318},{9067,9126,9578,9909},{8468,8642,9235,9386,9693},{8521,8571,8773,9253,9766,9876},{},{8751,9741},{8970},{8652,8685},{8658,8961,9496,9827,9915},{8451,8670,8673,9491,9776},{8829,8930,9130},{8482},{9028,9598},{9185,9374,9642},{8863,8917,9305,9898,9964,9969},{9468},{9424,9575,9951},{8747,9020,9044,9565},{9022,9539},{},{},{9715,9802},{9496,9783},{9234,9768},{8833,9037,9165},{9264,9322,9798},{9544,9828},{8748,9766,9813},{8658,9258,9381},{8890,9890},{8463},{8463,8941,9285,9517,9731},{8837,8934},{9467},{8641,8696,9214,9586,9627,9696},{8711},{9479},{9361,9731},{8776,9360,9876},{9019,9292,9739},{9419,9471},{9191,9212,9335,9373},{8765,9358},{8440,8617,8754},{8475,8860,9052},{8555},{9989},{8553,9073},{8561,8863,8865,8901,9879},{8550,8729,9016},{8591,9866},{8689},{9656},{},{8893,9701},{8645,8906,9148,9416,9845,9891},{8875,9026,9358},{9091,9576},{8601,8762,9065,9320,9718,9870},{8609,9120,9348},{9027,9720},{},{8457,8478,8908,9540,9675,9786},{9424},{},{},{8555,9330,9767,9815,9945,9954},{9049,9096,9732},{9462,9879},{8651,9025,9591},{},{8776,8809,9403,9419,9848,9904},{},{8521,8677,9744},{},{8640,8820,9829},{8464,8658,8818,9021},{},{},{8516,9435,9500,9578,9867},{8487,8552,8954,9026,9093,9791},{8674,9430,9887},{8876,9124,9146},{},{8515,8935,9065,9755,9823,9993},{8479,8976},{8690,8822,9090,9718,9934},{8761,8940,9031,9449,9469},{8985,9801},{9504},{8557,9405,9450,9613},{9012,9049,9481},{9204},{8537,8909},{8604,9197,9644,9690},{9424,9569},{8759,8854,9230,9356,9386},{8829},{8597,8635,9011,9202,9582,9969},{},{8610,9587},{8492,8853,9167,9599},{8970},{9059,9096,9295,9619},{8502,8514,8563,9068,9597,9777},{8814,9171,9505,9578,9823,9986},{8843,9138,9632},{8948,9106,9861},{8842,9444},{9085,9162,9212,9370},{9187,9339,9482,9602},{},{8853,8869,9092,9328,9437,9840},{8979,9236,9772},{9017,9042,9136,9797},{8626,8842,9657},{8600,9775,9905},{8620,9177,9514,9850},{9027,9441,9465,9517,9874},{9054,9207,9810},{8995,9522,9525},{9297,9966},{},{9140,9722,9776},{8537,9000,9174,9178,9182,9183},{},{8656,8677,8988,9187,9433,9830},{8836,9439,9640,9759},{9340,9745},{8522,9175,9333},{},{8587,9442,9545,9754,9764},{9820},{8525,8890,9043,9164,9737},{8609,9224},{8662,8679,8768,8935,9467},{9350,9453,9788},{8553,9522,9744},{},{8546,8596,8756,9840},{8680},{9313,9520,9595},{9007,9050,9313},{9340,9802},{9002,9869,9986},{9192,9375,9738},{8749,8822,8914,9806,9933},{8577,8947,9243,9332,9334,9414},{},{9260,9831},{8611,9232},{9299},{8756,9190,9922,9974},{},{8919,9008,9136,9553,9694},{8549,8661,9650,9729},{9582,9728,9770},{8713,9027},{8563,9872},{8773,8787,8870,9237,9547,9992},{8862,8982,9876},{8938,9029},{8718,8782,9448,9643,9677,9795},{9202,9249,9473},{8974,9603},{8790,8829,9363,9598},{9235,9568,9679},{8604,8854,8952,9855},{8574,9049,9659,9676,9937},{9034,9189,9437},{9328},{},{9128,9159,9190,9427,9740},{9369},{9637},{},{9410,9452},{9501},{},{8893},{},{8621,9542,9701,9837},{9528,9844,9992},{9412},{8688,8786,8803,9547,9810},{8808},{9325},{8700,8724,8884,8899,8921},{9724},{8725,9193,9425,9488,9860},{9328},{3774,8832,8988,9947},{9095,9796},{},{8919,8930,9162,9472,9625,9685},{8967,9064,9232,9589},{8757,9108,9174,9233,9240},{8802},{},{8718,9921},{8732,8744,9367,9746},{8606,9881},{8927,8990,9508,9616,9711},{8851,9374,9586,9936},{8692,8847,8896,9221,9720},{8768,9230,9604},{8722,9001,9049,9369,9479,9766},{9154,9275,9467},{8782,8839,9051,9411,9560,9723},{9331,9341,9495,9842,9905},{9341,9360},{9224,9803,9937},{9181,9317},{8746,8869,9078,9104,9847},{9003,9086,9444,9457,9650,9792},{9028,9038,9204},{},{9340},{9090},{2485,9573},{8712,8883,9079,9503,9721,9742},{8760,8993,9185,9822},{8617,8802,8983,9104},{8719},{9486,9834,9925},{9281,9676},{9293,9459,9477,9870},{8932,8996},{8671,8832,8979,9156,9172,9525},{9415,9453,9524,9660,9953},{8919,9486,9902},{},{1398,8762,9584},{},{},{9270,9320,9357,9473,9781},{9236},{8666,9041,9091,9553,9774,9880},{9302,9355,9685,9710,9713},{8631,8780,8936,9327,9402},{8817,9242,9523,9781,9983},{8732},{8940,9403},{8675,8791,8830,9136,9237,9869},{8694,9397,9436,9571},{8666,8951,9032,9504,9792,9803},{8851,9398,9698,9753,9871},{8985,9092,9920},{},{8881,9402,9458,9914},{9023,9823},{9256,9796},{9220,9375,9411},{8973,9130,9140,9167,9981},{},{8865,9214,9278,9337,9367},{8744,8865,9632,9807},{8698,8981,9170,9539,9541,9886},{8675},{8944,9275},{8683},{8788,9241},{8670,9527},{8948,9078,9411,9712},{9010,9152,9300,9957},{8715,8961,9058,9616,9625,9717},{},{8822,9994},{9231},{9704},{9029},{8732,9279},{8665,9305,9459,9842,9922},{8813,9419,9920},{8979,9692,9989},{},{9062,9082,9477,9499,9807,9835},{8698,8737,9977},{8854,9171,9203,9675},{9717,9729},{8671,8840,9118,9309,9782,9961},{8763,9075,9103,9701},{8986,9006,9290,9385,9585,9920},{8852,9807,9833,9990},{8842,9067,9328,9763},{9109,9160,9340,9757,9995},{8871,9053,9625,9829},{9255,9364},{9121,9271,9393,9636},{8847,9341,9639},{5375,9573,9683,9781},{9180},{9233},{8694,9241,9889},{9062,9323,9403,9984},{9137,9808},{8780,8798,8897,9200,9547,9870},{8756,9236,9241,9544,9706,9841},{},{128,9872},{9039,9741},{},{9062,9760,9763},{},{8873,9075,9207,9516,9724},{9111,9537,9621,9694,9765,9871},{9134,9174,9723},{7380,9752},{8776,8888,9259,9402},{8969,8970,9065,9177,9896,9927},{8714,9219,9573,9618},{5156,9088,9256},{8745,8868,9307,9802},{8826,8879,9123,9222,9379,9486},{},{9165},{8777,9179,9507,9739},{8809,9411,9748},{8845,9963},{8941,8969,9324,9369,9707},{9284,9294,9472,9506,9673,9963},{},{8886,8951,9463},{},{8927,9142,9191,9273,9403},{},{},{9522},{8803,8911,8962,9876,9904},{9226,9589},{9533,9869,9979},{9958},{9929},{8882,8958},{8729,9083,9427,9461,9494,9651},{9336},{8990,9110,9313,9787},{8824,9211,9395,9698,9789},{8742,8940,9672,9740,9805,9882},{8778,9290,9300},{8942,8994},{8741,9393,9512,9659},{8833,9049,9339,9479,9586,9811},{8876,9927},{8859,9551,9758},{},{8793,8976,8995,9110,9581,9859},{8850,9157},{9278},{9119},{9800},{8829,8849,9061,9645},{8819,8990,9025,9679,9788,9907},{},{},{9010,9582,9646,9816},{8915,9081},{9006,9418},{8778,8830,9553},{9071,9087,9129,9342,9481},{9433,9720,9979},{8759,9238,9550,9565,9897},{9017,9147,9213,9341,9787,9882},{9291,9325},{},{9495,9662},{8990},{9114,9295,9549,9650,9694,9816},{9689},{8762,8947,9019,9167,9693},{8810,9330},{8991,9216,9291,9343,9519},{9288},{8998,9635,9794,9971},{8769,9344,9669},{9157,9224,9235,9694},{},{8893,9216},{8826,8921,9789},{9148,9357},{9103,9170,9426,9734,9735,9931},{8971,9001,9112,9174,9558,9734},{9140,9986},{9301,9326},{8889,9432,9591,9597,9904},{8828,8947,9412,9677},{9038,9131,9831,9886,9911,9976},{},{},{9577},{8793,8819,9155,9568,9580,9997},{9452,9707,9962},{9026},{9329,9794},{9674,9843},{8859,8986,9037,9690,9822},{8866,9062,9260,9439,9500},{8885,9121,9673,9975},{9339,9577,9745,9845,9915},{8940},{8825,8943,9171},{8833,9019,9026,9191,9491},{8833,8947,9514,9697,9897},{},{9592,9827},{9422},{9624,9815},{9218},{},{},{},{8941,9232,9309},{9086,9181,9288,9892,9931,9972},{8927,9130,9317,9487,9677,9829},{9027,9069,9792},{9216,9294,9975,9990},{8820},{9326,9428,9478,9516,9927,9984},{9288,9430,9654,9994},{9134,9142,9716},{9765},{8920,9001,9270,9496,9633,9958},{8996,9627,9640},{9248,9316,9579,9870},{},{9120,9277,9339,9458},{8846,9709},{9180,9694,9727,9786},{9497,9733},{9122,9521,9606,9848,9948},{9367},{8916,9158,9343,9577,9764},{9111,9462,9644},{},{8991,9255,9478,9806,9811},{9030,9569},{8955,9350,9674,9712,9874},{8917,9167,9190,9339,9709},{9591,9845,9852},{},{9121,9571,9665,9681,9800,9853},{8938,9046,9205,9366,9927},{9694,9762},{8922,9165,9304,9439,9538},{},{9210,9515,9560,9845,9950,9967},{9465},{8875,8932,9102,9573,9884},{},{9236,9266,9354},{8843,9902},{8866,9079,9196,9244,9624},{9131,9437,9576,9625,9822},{9076,9128,9794},{9136,9250,9442,9849},{9120,9452,9463},{9165,9447,9540,9575},{9315,9401},{9602},{9125,9385,9550,9741,9950},{8931,8948,9161,9259,9421,9464},{8874,9655,9748,9782,9824},{9329,9398},{9767,9938,9954},{8948,9581,9950},{8914,9305,9471,9531,9797,9979},{8906,8971,9189,9538},{9590},{8879,9004,9436,9464,9528,9739},{8980,9805},{},{8985,9077,9237,9689,9765,9930},{8904,9047,9513,9615,9966},{9175,9286,9310,9460},{8926,9285,9811,9830},{9009,9224,9456,9548,9680,9721},{},{9012,9293,9350,9512,9603},{9037,9083,9179,9670,9856},{},{8991,9103,9156,9556,9831,9996},{9610},{},{8963,9038,9162,9295},{9049,9171,9220,9668,9922},{9015,9051,9366,9644,9692},{9229,9278,9541,9645,9846,9962},{8922,9889,9892},{9887},{9224,9241,9365,9667,9758,9945},{9227,9577},{8986,9101,9509,9623,9636,9808},{9969},{8906,9919},{8909,9543,9906},{8910,9063,9298},{8952,9052,9375,9610},{8897,8973,9209,9608},{},{9153,9999},{},{8968,9043,9130,9236,9875,9922},{9676,9714},{},{9372,9544},{8945,9363,9916},{},{8983,9356,9511,9595,9741,9797},{8993,9190,9343,9482,9577},{9300,9675,9697},{8914,9231,9389,9435,9733,9940},{9171,9446,9465,9535,9995},{9273,9440,9497,9637,9725,9964},{9011},{9270,9382,9414},{},{8930,9264,9442,9498,9917},{9007,9171,9374,9506,9546,9571},{9114},{9123,9295,9468,9578,9771,9816},{9451,9667},{9435,9963,9979,9982},{},{9405,9671},{9286,9593,9703},{9802},{9056,9987},{9253,9520,9857},{9288,9384},{9504,9547,9745},{9402,9888},{},{},{8960,9362,9457,9612,9964,9974},{9188,9510},{9713,9901},{9952},{9377,9455,9502,9763},{9282,9350,9732,9820,9844,9908},{8989,9244,9414,9606,9735,9943},{9159,9235,9310,9485,9846,9988},{8963,9434,9617,9823,9903,9950},{9155,9443,9792,9798,9846,9903},{9339,9375,9473,9714,9761,9777},{9376},{9109,9341},{9722},{9037,9108,9121,9353,9763,9882},{9044,9283,9379,9524,9742},{9151,9373,9559,9568,9604},{9106,9706,9865},{9277,9452,9602,9786,9802,9991},{8958,8970,9065},{9098,9235},{9027,9044,9424,9600},{9025,9211,9298,9358,9586,9905},{8985,9069,9200,9367,9702,9963},{8983,8987,9061,9165,9401,9590},{9068},{8994,9464,9790},{8998,9027,9110,9229,9300},{},{8987},{9034,9402,9840},{9082,9110,9268,9436,9692,9894},{9555,9828},{9365,9616},{},{9209,9294,9324,9632,9913,9997},{9040,9264,9341,9807,9825},{9725},{9023},{8989,9232,9388,9557,9701,9918},{8961,9536,9893},{9101,9113,9439,9795,9988},{9107},{9357,9457,9831},{},{9045,9070,9671},{9014,9126,9207,9399,9410,9850},{9050},{9599,9865},{},{9961},{9295,9637,9735,9847,9907,9947},{9005,9020,9417,9420},{9040,9155,9263,9489,9666},{9423,9514,9608,9951},{},{9551,9749,9838},{9267,9366},{9047,9069,9577,9623,9707,9991},{9298,9798},{9156,9426,9610,9638},{},{9427,9602,9636},{9156,9629,9849},{9370,9819,9881,9980},{9025,9036,9782,9868,9950},{9225,9270,9331,9515,9599,9613},{},{9076,9395,9508,9706,9885,9936},{9028,9122,9145,9211,9285,9985},{9189,9193,9760,9829},{9485,9688,9751},{9064,9746},{9009,9219},{9106,9325,9443,9589,9963,9980},{9318,9644,9809,9881},{9076,9922},{},{9130,9159,9341,9813},{9653},{},{9104,9177,9208,9799,9839,9886},{9917},{9807,9815,9873},{9038,9299,9568,9627,9738},{9300,9574,9830},{},{9047,9437,9466,9498,9619},{9170,9176,9737,9747,9908,9966},{9255,9881,9989},{9414,9576,9603},{9073,9546,9762},{9027,9275,9447},{9233,9427,9565,9841,9986},{9104,9167,9217,9670,9716,9892},{9276,9327,9335,9675,9989},{9271},{9299,9492,9581,9898,9901},{},{9516,9750,9762},{9121,9252,9860,9966,9973,9987},{9326,9347,9872},{9143,9439,9481,9689,9865,9914},{9209,9565,9763},{},{9165,9442,9669,9796},{9250,9400,9640},{9120,9314,9343,9464,9564,9573},{},{9075,9507,9517,9521,9973},{9040,9500},{},{9134,9275,9424},{9252,9258,9669,9753},{9263,9974},{9044,9244,9351,9430,9955},{9268,9423,9453,9567,9673,9986},{9186,9239,9337,9433,9848,9979},{},{9740,9920,9938,9986,9987},{9255,9440,9470,9496,9712},{9182,9306,9596,9735},{9737,9857},{9527,9620,9767,9810},{},{9196,9370,9679,9735,9997},{9771,9773},{9121,9189,9722,9747},{9174,9270,9290,9334,9502,9630},{9842,9989},{9874},{9837},{9226,9410,9615},{},{9212,9326,9886},{},{9623,9747,9953},{9154,9180,9479,9488,9604},{9259,9683,9768},{9182},{},{},{9233,9291,9406,9585,9627,9770},{9224,9723},{9239},{9471,9774},{9413,9841},{9224,9227,9344,9488,9547,9867},{9300,9552,9665,9756,9837,9878},{9246},{7424,9301,9535,9639},{9176,9703,9715,9818,9864},{9272,9817},{9282,9301,9467,9845},{},{9171,9221,9611,9774},{9168,9413,9923,9934},{9229,9325,9473,9686},{9151,9288,9510,9518,9899},{9150,9458,9601,9743,9849,9935},{},{9300,9500,9550,9610,9618,9969},{9486},{9090,9957},{9120,9241,9617,9681,9894,9960},{9560,9912,9989},{9886},{9265,9495,9587,9622,9664,9879},{9204,9867,9965},{9366,9419,9665,9782},{9671,9909,9986},{9098,9385,9673,9831,9884},{9289,9326,9497,9570,9677,9847},{},{},{9193,9235,9579},{9116,9135,9144,9904,9933,9992},{9891},{9358,9442,9541,9625,9965,9983},{9692,9715,9942,9963},{},{9175,9479,9747,9898,9941},{},{},{9743,9932},{},{9147,9281,9404,9523,9568,9962},{9112,9436,9559},{9269},{9348,9506,9674,9798,9877},{9374,9433,9803,9825,9849,9900},{9272,9514,9740},{9223,9620,9723,9956,9967},{9285,9403,9718,9994},{9188,9252,9418,9582,9780},{9257,9677},{9290,9693},{9123,9124,9485,9836},{9187,9587},{9294,9830},{9175,9684,9945,9948},{9610,9780},{9324,9608,9686,9902},{9579},{9224,9251,9562,9592,9791,9880},{9192,9316,9632,9649,9676,9865},{9386,9520,9693,9710,9742,9900},{9620},{9304},{9187,9452,9843,9845},{9206,9229,9259,9469,9615,9639},{9312,9313,9542,9569,9760},{9366,9442},{9538,9691,9998},{9472,9559,9666,9680,9764,9869},{9284,9861},{9528,9720,9897},{9620,9860},{9219,9231,9302,9711,9837,9886},{9190,9293,9638,9759,9877},{9434},{},{9362},{9181,9390,9729,9794,9926},{9235,9405,9528,9673,9680,9735},{9676},{9514},{9307,9377,9385,9419,9454,9960},{9152,9245},{9533,9970},{9151,9157,9665},{9357,9977},{9454},{9220,9288,9433,9435,9594,9601},{9834},{9239,9242,9288,9446,9486,9849},{9234,9358,9498,9551,9642,9981},{},{9525,9680,9743,9819},{9365},{9174,9256,9281,9793,9981,9988},{9227,9339},{},{9436,9472,9611,9981},{9263,9446,9478,9580,9759},{9290,9481,9531,9623,9795},{},{9299,9545,9697,9883,9982,9992},{9173,9310},{9478},{9209,9411,9426},{9504,9698,9741},{},{9269,9271,9570,9684,9891},{9388,9850},{9372,9389,9401,9544,9683,9806},{9353,9821},{9250,9263,9329,9606,9770},{},{9222,9386,9592},{9278,9296},{9217},{},{9976},{9304,9389,9479},{},{9193,9330,9591,9609,9844},{9379,9386,9704},{9329,9334,9454,9464,9812,9875},{9373,9522},{9216,9224,9297,9438,9580,9702},{},{9307,9326,9362,9645,9710},{9427,9509,9830},{9373,9640,9670,9935,9967},{9646},{9378},{9279,9522,9620,9859,9895,9936},{},{9575},{9240,9512},{9632,9871,9885},{9296,9391,9689,9840},{9989},{9285,9384,9486,9636,9751,9856},{9345},{9224,9327,9543,9757,9762,9986},{9393,9707},{},{9328,9428,9467,9753,9973},{9398,9472,9537,9562,9694},{},{},{9815},{9239,9267,9464,9576,9625,9715},{9361,9617},{9362,9725,9773,9934},{9248,9348,9431,9829},{9249,9360,9604,9923},{9292,9446,9499,9604},{9825},{9486,9628,9887},{9456,9474,9605,9982},{9879},{9591,9610,9690,9771},{9457,9594},{9387,9435,9458,9619,9793,9881},{9234,9409,9628,9682,9803,9890},{9241,9374,9664},{},{9431,9479,9496,9531,9887},{9625,9693},{9727,9759,9891,9931,9997},{9380,9494,9861,9968,9997},{},{9294,9629,9824},{9442,9658,9761},{9387,9417,9560,9568,9806},{9297,9301,9917},{9384,9574,9595,9710,9747},{},{9645,9657,9972,9974},{9373,9457,9659,9672,9673},{9450,9665,9889,9891},{9306,9451,9706,9708,9836},{9450,9630},{9274,9536,9687},{9914},{9358,9954,9973},{9462,9463,9812,9917,9956},{9582,9765,9873},{9530,9988,9992},{9869},{9453,9454,9479,9548,9595},{9266,9372,9449,9549,9959},{9647},{9299,9575,9597,9602,9704,9832},{9287,9501,9560},{9970},{},{9320,9488,9656},{9516,9774},{9276,9529,9574},{9920},{9433,9939},{9289,9339,9785,9954},{9296,9557,9679},{},{},{9533,9839,9854},{9512,9789},{9366,9659,9664,9680,9765},{9467,9501},{9288,9528,9536,9638,9666,9765},{9305,9463,9546,9744},{9530,9609,9670,9872},{9316,9705,9715},{9292,9367,9393,9569,9667,9987},{},{9392,9671,9743,9752,9790,9914},{9350,9377,9443,9522,9670},{9405,9752,9879,9976},{9310,9489,9635,9704,9832},{},{9387},{9560,9921},{},{9536},{9747,9793},{9864},{9854},{9475,9701,9895,9912},{9999},{9359,9396,9545,9691},{9376,9891,9960},{9552,9660,9879},{9474,9615,9678,9733,9867},{},{},{9456,9498,9542,9602,9792},{9358,9386,9513},{9349,9423,9647,9843,9848},{9528,9777},{9734,9877},{},{},{},{9868},{9367,9435,9528,9690,9911,9944},{9484,9675,9688,9822},{9543,9623,9710,9746,9798,9906},{9439},{9455,9683,9843},{9430,9643,9723,9766,9785,9893},{9431,9620,9720},{9517},{9330,9600,9616,9822},{9333,9573,9583,9652,9669,9950},{9379,9386,9732,9817,9836},{9324,9803},{9382},{9561,9642,9672,9887},{9386,9534,9949},{9429,9521,9684,9728,9763,9843},{9571,9639,9649,9670,9839},{9380,9756,9812,9932},{9496,9534,9816,9879,9896,9990},{9386,9732,9823,9974,9998},{9798},{9563,9697},{},{9397},{9428,9531,9572,9710,9793,9802},{},{9401,9402,9408,9445,9893,9972},{9669},{},{9566,9651},{9433,9974},{9613,9665,9803,9804,9875,9947},{},{9514,9752},{},{},{9666,9905},{9507,9622,9635,9785},{9854},{9517,9597,9613,9682,9935,9949},{},{9426,9997},{9374,9584,9660,9786,9857,9864},{9572,9578,9777},{9412,9532,9767},{9371,9378,9476,9734,9742,9992},{9431},{9407,9650},{9862},{9433,9645,9716,9783,9841},{9449,9473,9481,9570,9686,9947},{9776},{},{9569,9926},{},{9484,9505,9648,9788,9836,9915},{9813},{9445,9817,9874,9896},{9586,9681,9714,9724,9889,9997},{9843},{9397,9570,9642,9825},{9519,9697,9814,9851,9994},{9467,9681,9867},{9973},{9792},{9516,9610,9788,9975,9989},{9866,9974},{9422,9507,9625,9802,9914,9920},{9403,9442,9539,9605,9871,9973},{9514,9807},{9418,9427,9625,9700,9882,9926},{7329,9430,9486,9524,9707,9822,9848},{9416,9554,9615,9691,9770,9839},{9815,9920},{},{9417,9591,9724,9788,9888},{9661,9740,9909,9962},{9950},{9622,9631,9660,9663,9782,9993},{9653,9664,9824,9871,9907,9929},{},{9535,9666,9803,9862},{9545,9901,9980},{9396,9998},{9398,9594,9634,9718},{9405,9491,9587,9889},{9586,9928,9936},{9628,9806,9962,9967},{9610,9635,9951},{9431,9499,9561,9596},{9881,9993},{},{},{9770,9897},{9453,9891},{},{9826},{},{9618,9729,9851,9872},{9759,9791,9875,9953,9956,9986},{9469,9564,9786},{},{9562,9826,9956},{9532,9610,9667},{9546,9566,9760,9941},{9539,9615,9775,9957,9968,9980},{9568,9582,9661,9994},{9453,9611,9847,9864},{9825},{9741,9754,9896,9947},{9477,9581,9599,9758,9860},{9987},{9503,9716,9819,9892,9967},{9478,9546,9633,9821,9885,9990},{9793,9976,9985},{9545},{9440,9649,9814},{9469,9819,9949,9975},{},{},{},{9832},{9532,9540,9612,9717,9736,9857},{9835},{9480,9514},{},{9630,9668},{9710},{},{9441,9676,9712,9771,9983},{},{9756,9973},{9480,9851},{9478,9568,9704,9764,9945},{9445,9871},{9462},{9540,9638,9677,9695,9967},{9830},{9553,9901,9945,9950,9965},{9466,9776},{9993},{9655,9748,9856},{9672,9919},{9468,9499,9646,9704,9972},{},{9530,9589,9748},{9499,9734,9776,9785,9789,9910},{9512,9515,9819,9874},{},{9601,9687,9905,9934},{9753},{9462,9596,9696,9741,9841,9897},{9484,9612,9656,9777,9903},{9620,9910,9989},{},{},{9700,9800,9830},{9500,9708,9814,9993},{9894,9952},{9588,9608,9616,9717,9742,9913},{9940},{9532,9621,9838},{9499,9665,9823},{9542,9589,9693,9962,9970},{9514,9555,9561,9841},{9545,9682,9763,9792,9922},{9554,9746,9854,9870,9926},{},{9510,9656,9696,9823},{9957},{9511},{9516,9556,9606,9615,9709,9772},{9786,9809,9844,9870,9882},{9691},{9738},{9587,9631,9701,9970,9999},{9734,9740,9918,9969,9987},{},{9662,9696,9887,9955,9956,9980},{9755,9945},{9590,9602,9625,9805},{9612,9684,9702,9874,9924,9962},{},{9658,9770,9822},{9535,9711,9944,9996},{9566},{9501,9530,9597,9769,9867},{},{},{9577},{9516,9567,9726,9784,9986},{9538,9571,9624},{9562,9617,9712,9728,9801},{},{},{9610},{9625,9960},{9615,9896},{9717,9738,9768,9877,9966},{9640,9975},{9598},{9544,9836,9891,9939,9952,9992},{9582,9641,9689,9723,9796,9942},{9523,9574,9594,9668,9725,9976},{9716,9720,9926,9963},{9536,9640,9785,9840,9862,9874},{9525,9535,9970,9991},{9636,9866},{9620,9922,9972},{9530,9634,9688,9830,9873,9913},{9629,9665},{9647,9811},{9809,9823,9833},{},{9648},{9568,9586,9684,9780,9867,9892},{9583,9651,9652,9836,9922},{9750},{9870,9977},{9738},{9539,9699,9945},{9814,9858},{9751,9834,9854},{9742,9921,9953,9967},{},{9586,9671,9858,9992},{9634,9680,9767,9865,9990},{9538,9555,9570,9635,9825,9909},{},{9577,9701,9757,9771,9845,9862},{9831,9853,9865,9910,9917},{9834},{9584,9833,9873,9974,9998},{9682,9746,9774,9787,9791,9811},{9547,9556,9622},{9632,9905},{9719,9756},{9584,9613,9667,9752,9789,9924},{9562,9685,9744,9761,9914},{9676,9769,9864},{},{9629,9847},{9603,9751,9765,9974},{},{9739,9839,9894,9922,9970},{9618,9641,9770,9862,9907,9948},{9924},{},{},{9596,9630,9636,9729,9893,9939},{9575,9886,9895},{},{9753},{9655,9675,9686,9729,9995},{9629,9794,9944},{9591,9687,9727,9753,9914,9918},{9629,9776,9843,9979,9990},{9632,9912},{9695,9873,9977},{9909},{9659,9705},{9634,9741,9745,9769,9894},{},{9800,9961,9972},{9703,9822,9913,9948,9972},{9578,9640,9771,9837,9958},{9626,9667,9717,9751,9766},{9578,9845},{9584,9652,9665,9759,9844,9951},{9624,9713,9874,9939},{9974},{9598,9656,9667,9746,9975},{9590,9756,9823,9957},{9716,9783,9866,9908,9970},{},{9691,9851},{9592,9660,9913},{9688,9715,9724,9859,9952,9988},{9822},{9837},{9611,9664,9700,9908},{9590,9627,9683,9733,9860,9967},{9692},{},{9666,9731,9758,9765,9901,9949},{9671},{9801,9859,9860,9886},{9626,9688,9690,9708,9828},{9850,9869,9897,9961,9977},{9670,9725,9813,9878,9958,9994},{9611,9807},{9738,9942},{},{9624},{9613,9695,9707},{},{9866},{9616,9630,9864,9876},{9664,9711,9729,9927,9928,9992},{},{9725,9789,9847},{9781,9812,9835,9854,9900,9970},{9685,9762},{9663,9705,9732,9896},{},{},{9766,9858,9961,9983},{9803,9981},{9668,9802},{9706,9753,9780,9812,9827,9862},{9633,9744,9909},{9755},{9646,9647,9739,9771,9889,9997},{9961},{9624,9649,9685,9771,9973},{9652,9693,9811,9855},{9785,9803,9820},{},{9715,9860,9994},{9745,9761,9813,9824,9896,9959},{9641,9969,9983},{9751,9771,9891},{},{9701,9823,9982},{9650,9672,9686,9865,9929},{9647,9712,9732,9821,9874,9967},{9671,9687,9912,9975},{9847},{9687,9942,9950,9981,9983},{9648,9760,9828},{9875},{9644,9702,9824,9847,9888,9928},{9766,9895,9910,9914,9941},{9696,9766,9897},{9811},{9883,9928,9997},{},{},{},{9851,9887,9937},{9693,9776,9858,9913,9990},{9756,9787,9875,9959,9983},{},{9874},{9783,9814,9877,9895},{9830},{},{9837,9988},{9973},{9683,9693,9717,9777,9819,9993},{9664,9679,9741,9744,9989},{5516,9736,9876},{9809,9874,9889,9996},{9849,9984},{9714,9820,9994},{9666},{9667,9830,9838,9858,9928,9965},{9829,9880},{9684,9873,9958},{},{9722,9748},{9712},{9912},{9770,9889,9891,9906,9962,9968},{9694,9704,9820,9829,9913},{9751,9782},{9824,9916,9997,9999},{9696,9701,9798,9805,9956},{9707,9809,9862,9863,9925,9943},{},{9753,9849,9852,9895,9896,9989},{9708,9715,9757,9774,9904,9911},{9695,9813,9840},{9816,9992},{9725},{9740,9856,9963},{9693,9717,9887,9922,9941},{9695,9774,9784,9805,9856,9920},{9697,9730,9780,9888},{9734,9854,9874,9905},{9707,9710,9847,9896,9943,9970},{9707,9794,9814,9836,9900,9939},{9721,9798,9822,9840},{9748},{9830,9889},{9713,9732,9976,9995},{9710,9719,9808,9918},{},{9794,9870,9921},{},{9716,9834,9907,9962,9965,9999},{9841,9848},{9765,9767,9859,9908,9987},{},{9823,9862,9950},{9785,9820},{},{9767,9789,9798,9990},{9715,9768,9825,9917,9966,9984},{9917},{9813,9853,9867},{9713,9770,9799,9847,9957},{},{9726,9776,9811,9871,9922},{9777,9817,9828,9836,9904},{9856,9944,9992},{9993},{9920},{9940,9970},{9796,9858,9896,9986},{9958},{9922,9998},{9765,9792,9860,9930,9952},{},{9763,9767,9772,9892,9956,9991},{9756},{9864},{},{9729,9812,9898,9907,9910},{9826,9911,9945},{9749,9780,9859,9960,9970},{9782,9787,9825},{},{},{9792,9803,9854,9863,9905},{},{9751,9793,9812,9838,9954},{9782,9832,9891,9909,9949,9996},{9738,9831,9845,9898},{9867},{},{9906},{323,9759,9870},{9845},{9822,9824,9842,9896,9962,9966},{9994},{9762,9813,9821,9886,9998},{9792,9912},{9758,9918,9930},{9766,9781,9841},{},{9851,9917,9954},{9757,9823,9927,9961,9970,9997},{},{9798,9938,9962,9985,9996,9998},{9793,9968},{9823,9881,9949,9962,9986,9995},{9801,9922},{9961},{9765,9768,9779,9819,9837,9966},{9801,9854},{9784,9802,9807,9812,9985},{},{9802,9820,9912},{},{8440,9801,9892,9956},{9779,9805,9814,9834,9970,9988},{9779,9875,9886,9933},{9847,9967},{9871,9877,9901,9920,9987},{9806,9854,9855,9881,9953,9980},{},{9931,9984},{9791,9841,9855,9866,9936,9998},{9833,9838,9865,9957,9998},{9913,9946,9957,9989},{9803,9897,9953},{9816,9880,9969,9988},{9839,9914,9921},{9796,9867,9898,9943},{9866,9868,9935},{9817,9850,9871,9884,9962,9994},{9802,9847,9883},{9844,9896},{9834,9877},{},{9792,9871,9936,9937,9941,9965},{},{9797,9819,9851,9984},{9873},{9852,9877,9896,9900,9929,9976},{},{9828,9928,9959},{9831,9975},{9821,9964,9972,9975},{9802,9814,9898,9918,9938,9960},{9831},{9798,9823},{9854,9939,9978},{9804,9817,9862,9876,9882,9905},{9810,9905,9942},{9924,9951},{9872,9874,9877,9990},{9927},{9872,9943,9995},{9837,9885},{9912},{9867,9873,9952},{9912,9959,9962,9981,9996},{9873,9881,9890,9899},{},{9844,9967,9975,9994},{9929},{9825,9841,9893,9939,9943,9974},{9923},{9818,9825,9886,9913,9954,9968},{9842,9855,9891},{9818,9889},{9883,9884,9886,9981,9994},{9895,9902,9929,9964},{9830,9850,9857,9891,9919,9988},{9833,9884,9973,9997},{9826},{9834,9889},{},{9828,9866,9914,9937,9946,9952},{9895},{9885,9894,9898,9996},{9966},{9897,9910,9931,9941},{9847},{9837,9892,9978,9994},{9870,9871,9872,9938,9968},{9834,9919,9923,9946,9950,9979},{9862,9892,9905,9921,9924,9947},{9922},{9870,9958},{9913,9929,9954},{9868,9890,9956,9977,9980,9985},{9845,9937,9960},{9858,9933,9964},{9906},{9871,9913,9916,9943,9972},{9844,9912},{9850,9863,9876,9940,9951,9979},{9893,9959},{9876,9896,9957,9960,9983},{9904,9918,9970},{9856,9877,9878,9915,9965},{},{9853,9862,9890,9970,9990,9994},{9854,9922,9974,9999},{9899,9940,9942,9963,9982},{9946,9949,9959},{9862,9877,9889,9894,9925},{9898,9933},{9884,9954,9960,9983},{},{9885,9939,9959,9969,9994},{9925,9932,9946,9980},{},{9883,9901,9969,9977,9983,9996},{9861,9870,9905,9933,9962,9994},{9876},{9873,9934,9952,9953,9969,9997},{},{9930,9985,9986,9993},{9906,9950,9952,9968,9970},{9898,9920,9929,9952,9988},{9878,9880,9902,9941,9979,9982},{},{9905,9958},{9900,9972},{9918,9920},{9886,9891,9893,9913,9978},{9948,9965,9970},{9878,9921,9926,9964},{9902,9904,9965},{9934,9946,9959},{9887,9918,9957,9963},{9881,9911,9913,9918,9996},{9885,9910,9933,9941,9952,9986},{},{9902,9907,9989},{9914,9995},{9887,9914,9923,9992},{},{9955},{9890,9946,9980},{9897},{9936,9968,9970,9976,9983},{9891,9908,9995},{9908,9927,9933,9949,9974,9986},{9942},{9895,9925,9928,9969,9995,9996},{9935,9959,9964,9975,9988},{9907,9919,9920,9923,9954,9975},{},{9902,9940,9951,9973},{9909,9939,9961},{9913,9967,9980},{9928,9936,9944,9975},{9943,9947,9982,9996},{9926,9971},{9909},{9906,9916,9918,9971,9986},{9919,9928,9934,9986,9990,9991},{9978,9997},{},{9937,9953,9970,9972},{9915,9947,9987},{9936,9958},{9915,9920,9942,9951,9955,9963},{9925,9926,9929,9935,9950,9993},{9938,9998},{},{9928,9946,9948,9962,9963,9982},{9942,9966},{9993},{9961,9964,9989},{9949},{9932,9969,9976,9980,9990,9999},{9942,9966},{9936,9939,9956,9960,9975},{9926,9943,9973,9990},{9949,9961,9993},{9928,9977},{9958,9959,9972,9973,9993},{9942,9988},{9934},{9946,9959,9963,9969,9988,9998},{9946},{9959,9961,9973,9982,9998},{},{9949,9952,9960,9992},{},{},{},{9965},{9974,9989},{9939,9970},{9950,9962},{},{},{},{9948,9954,9964,9971,9972,9974},{},{9988},{9960,9969,9986,9987,9993,9998},{9951,9972},{9971},{9950,9961,9968,9970,9987,9996},{9972,9996},{9954,9958,9975,9993},{9973,9986,9990,9992,9993},{9964,9971,9972,9975,9984},{9962,9963,9982,9996},{9956,9958},{},{9959,9977,9982,9993,9999},{9966},{9974,9977,9993,9995},{9961,9977,9999},{9983,9988,9989},{9963,9966,9991,9993,9996,9997},{9969,9974,9989,9994},{9974},{9970,9976,9978,9988,9993},{9969},{9973,9983,9986,9988,9992},{},{},{},{9973,9977,9984,9994,9998},{9975,9982,9986,9997},{9989,9997},{},{9990,9993,9998},{9991,9992,9998},{9989},{9979,9985,9990},{9983,9984,9996,9998,9999},{9984,9985,9993,9998},{9985,9990,9991,9996,9997,9998},{9985,9988,9990,9991,9999},{9985,9992,9995},{9985,9986,9990,9992,9993},{9986,9993},{9987,9989,9993,9999},{9989,9995},{},{9990,9992,9995},{9992,9996},{9993,9994,9996},{},{9994,9996,9998,9999},{9995,9996,9997,9999},{9996,9997,9998,9999},{},{9998,9999},{9999},{ } }, + []int{ 0,5,9,15,17,19,21,25,26,28,33,35,39,41,42,45,54,58,66,76,77,78,85,88,89,90,91,92,97,99,111,113,115,118,122,123,124,126,129,133,137,142,144,145,147,150,152,153,155,167,170,172,178,181,182,186,189,191,192,194,196,203,215,216,217,222,223,224,229,234,236,241,244,248,251,258,259,260,268,269,273,288,289,290,292,294,299,301,311,319,322,332,335,336,340,345,353,355,361,362,365,369,377,384,385,390,397,399,401,409,411,415,419,423,431,434,437,439,442,460,463,468,471,475,477,480,490,496,497,499,508,518,519,525,526,529,531,535,546,549,550,552,556,562,565,570,574,577,579,582,583,586,595,597,600,601,605,607,610,612,614,617,620,624,626,630,637,643,645,650,652,655,668,672,678,683,689,693,697,699,701,704,705,706,708,715,716,718,720,724,726,730,731,733,738,739,741,742,751,755,759,761,768,769,774,779,780,781,783,784,790,791,793,799,801,807,814,819,820,824,829,832,834,839,841,845,847,852,854,860,863,870,874,875,880,881,885,888,889,890,891,904,906,909,919,923,925,932,934,937,944,945,946,949,957,972,975,980,988,993,995,996,997,998,1002,1007,1012,1015,1017,1021,1025,1028,1029,1035,1048,1050,1058,1059,1067,1071,1077,1082,1085,1088,1089,1091,1094,1100,1101,1102,1108,1114,1119,1120,1121,1122,1126,1127,1134,1135,1136,1137,1140,1142,1155,1158,1162,1164,1168,1171,1175,1176,1179,1180,1188,1192,1193,1195,1200,1202,1204,1210,1211,1212,1216,1226,1227,1228,1229,1233,1234,1238,1239,1241,1242,1248,1264,1267,1270,1277,1283,1287,1291,1297,1298,1299,1300,1302,1303,1304,1308,1309,1312,1315,1317,1320,1321,1324,1328,1332,1333,1340,1348,1354,1358,1363,1367,1368,1369,1372,1373,1378,1390,1395,1404,1406,1414,1417,1420,1422,1430,1432,1433,1436,1439,1444,1447,1448,1457,1459,1463,1464,1465,1466,1468,1471,1472,1487,1494,1495,1496,1499,1503,1517,1519,1520,1522,1524,1526,1528,1533,1535,1540,1544,1549,1557,1560,1563,1571,1579,1581,1582,1584,1586,1588,1590,1594,1595,1598,1600,1604,1611,1615,1622,1634,1635,1637,1639,1640,1641,1646,1647,1648,1651,1655,1657,1661,1664,1674,1688,1690,1692,1693,1700,1703,1706,1714,1718,1726,1729,1731,1733,1734,1737,1738,1739,1741,1745,1746,1748,1755,1762,1764,1765,1766,1772,1774,1781,1787,1798,1808,1810,1816,1820,1821,1822,1823,1825,1827,1834,1835,1838,1848,1851,1853,1856,1858,1861,1865,1867,1878,1881,1882,1886,1887,1889,1890,1895,1897,1899,1900,1903,1908,1909,1913,1915,1919,1922,1924,1929,1930,1935,1937,1944,1947,1951,1958,1962,1965,1966,1967,1968,1972,1975,1977,1980,1984,1994,2000,2005,2007,2010,2013,2014,2019,2020,2027,2031,2033,2041,2047,2049,2053,2055,2057,2058,2064,2069,2071,2075,2079,2080,2084,2085,2090,2094,2098,2104,2105,2108,2110,2111,2113,2115,2117,2123,2128,2134,2137,2138,2141,2148,2149,2151,2155,2156,2157,2164,2168,2169,2175,2182,2185,2194,2198,2203,2207,2208,2210,2211,2224,2225,2231,2242,2244,2246,2248,2250,2252,2256,2258,2260,2263,2264,2266,2273,2275,2277,2279,2280,2282,2286,2288,2290,2293,2298,2299,2302,2305,2308,2309,2314,2318,2320,2331,2341,2345,2347,2348,2357,2358,2359,2378,2381,2383,2399,2407,2422,2423,2424,2429,2430,2432,2439,2440,2449,2456,2460,2462,2472,2475,2483,2492,2494,2495,2497,2501,2502,2503,2521,2528,2539,2542,2545,2546,2547,2549,2555,2556,2557,2564,2565,2571,2575,2576,2580,2584,2586,2591,2593,2594,2605,2607,2611,2614,2621,2626,2632,2644,2647,2649,2653,2655,2659,2660,2663,2664,2667,2672,2673,2674,2680,2682,2691,2696,2697,2712,2713,2718,2722,2727,2728,2730,2760,2767,2770,2773,2778,2780,2782,2788,2789,2797,2798,2799,2808,2817,2820,2822,2828,2833,2837,2838,2840,2846,2847,2848,2850,2852,2859,2865,2866,2873,2878,2880,2885,2886,2888,2892,2897,2901,2908,2911,2918,2920,2921,2927,2928,2930,2935,2939,2941,2942,2946,2948,2958,2961,2969,2970,2973,2981,2987,2988,2989,2992,2995,3002,3003,3007,3008,3009,3015,3018,3022,3025,3026,3031,3034,3038,3039,3040,3041,3043,3045,3046,3056,3062,3066,3067,3068,3075,3080,3081,3082,3085,3093,3094,3102,3111,3112,3115,3117,3119,3125,3126,3127,3132,3133,3134,3135,3138,3143,3145,3156,3158,3160,3163,3167,3168,3174,3175,3177,3180,3182,3183,3188,3194,3203,3205,3208,3210,3213,3217,3225,3226,3228,3229,3231,3234,3235,3238,3242,3249,3250,3266,3269,3270,3276,3278,3280,3282,3283,3286,3289,3292,3293,3296,3297,3302,3303,3306,3308,3312,3315,3319,3328,3330,3337,3352,3353,3358,3365,3371,3372,3374,3376,3378,3383,3385,3395,3402,3403,3405,3407,3411,3416,3428,3447,3465,3466,3467,3469,3475,3477,3481,3491,3494,3496,3498,3500,3506,3512,3513,3515,3517,3518,3519,3528,3529,3530,3533,3535,3536,3544,3545,3548,3554,3557,3561,3562,3563,3564,3573,3576,3587,3588,3598,3600,3605,3610,3614,3621,3626,3627,3631,3632,3636,3640,3643,3648,3659,3660,3664,3669,3673,3675,3676,3677,3679,3682,3686,3689,3690,3699,3701,3710,3713,3714,3716,3721,3723,3724,3728,3733,3734,3735,3741,3742,3743,3744,3746,3748,3752,3762,3768,3777,3778,3788,3790,3792,3797,3803,3809,3813,3821,3840,3841,3843,3858,3860,3864,3872,3876,3892,3906,3909,3911,3913,3915,3916,3921,3924,3927,3935,3936,3939,3940,3941,3944,3947,3949,3952,3956,3958,3965,3966,3971,3972,3975,3979,3980,3984,3985,3986,3987,3998,4006,4010,4014,4017,4018,4019,4021,4022,4024,4028,4029,4032,4038,4041,4046,4048,4051,4055,4057,4058,4060,4066,4073,4074,4075,4092,4094,4096,4097,4100,4104,4110,4111,4115,4117,4118,4122,4123,4124,4129,4130,4132,4133,4139,4144,4145,4157,4161,4162,4165,4171,4172,4180,4185,4189,4192,4196,4198,4208,4211,4216,4219,4229,4242,4245,4246,4255,4256,4258,4259,4266,4274,4275,4276,4278,4280,4285,4286,4294,4299,4300,4303,4307,4312,4314,4327,4328,4329,4332,4334,4345,4351,4356,4358,4359,4363,4369,4372,4374,4375,4379,4380,4390,4393,4398,4401,4404,4407,4408,4418,4425,4437,4448,4456,4467,4472,4475,4477,4479,4481,4484,4485,4486,4490,4491,4492,4493,4500,4502,4503,4504,4505,4506,4513,4514,4516,4518,4519,4520,4523,4538,4539,4546,4550,4551,4554,4556,4562,4564,4567,4569,4570,4571,4578,4580,4587,4589,4592,4593,4596,4597,4599,4600,4608,4609,4616,4619,4628,4632,4635,4636,4637,4639,4640,4642,4654,4656,4663,4664,4673,4675,4678,4679,4680,4683,4687,4688,4691,4693,4699,4703,4706,4712,4714,4715,4717,4718,4719,4725,4729,4732,4734,4736,4738,4739,4740,4743,4745,4755,4756,4758,4762,4763,4764,4765,4773,4775,4779,4781,4784,4786,4788,4790,4792,4797,4803,4807,4808,4810,4819,4827,4830,4838,4845,4846,4847,4849,4852,4854,4859,4862,4864,4865,4866,4870,4871,4872,4874,4878,4887,4891,4892,4897,4898,4902,4904,4912,4916,4917,4921,4923,4924,4927,4931,4933,4935,4937,4944,4946,4948,4952,4957,4958,4960,4967,4970,4971,4974,4975,4976,4993,4997,5000,5001,5005,5010,5015,5019,5025,5031,5036,5043,5047,5048,5049,5052,5054,5066,5072,5076,5078,5080,5081,5083,5084,5086,5088,5091,5092,5093,5108,5112,5120,5123,5127,5130,5133,5135,5144,5150,5152,5155,5158,5163,5171,5172,5175,5179,5185,5191,5193,5194,5196,5198,5200,5202,5209,5211,5214,5215,5219,5224,5227,5229,5234,5235,5236,5240,5241,5249,5250,5252,5253,5256,5258,5260,5264,5265,5275,5276,5281,5282,5283,5290,5293,5295,5297,5301,5302,5304,5307,5308,5314,5315,5320,5324,5325,5328,5334,5336,5342,5344,5351,5352,5353,5354,5356,5357,5358,5359,5360,5361,5367,5368,5369,5372,5380,5389,5390,5392,5396,5398,5399,5405,5414,5416,5420,5421,5423,5424,5427,5428,5430,5432,5437,5441,5442,5445,5449,5452,5461,5463,5466,5469,5470,5474,5475,5477,5479,5483,5485,5486,5487,5492,5499,5502,5503,5505,5508,5517,5518,5519,5521,5526,5529,5531,5533,5535,5539,5541,5545,5552,5553,5557,5560,5563,5564,5567,5570,5571,5575,5577,5578,5580,5582,5583,5585,5590,5600,5602,5606,5611,5613,5614,5621,5627,5634,5636,5641,5642,5649,5652,5653,5654,5663,5665,5668,5671,5672,5673,5674,5675,5676,5679,5680,5685,5689,5692,5696,5699,5701,5703,5705,5711,5715,5716,5720,5722,5726,5729,5731,5740,5742,5749,5756,5757,5759,5763,5767,5769,5772,5774,5775,5779,5780,5782,5789,5790,5791,5793,5794,5801,5804,5806,5807,5809,5816,5820,5821,5825,5831,5834,5837,5838,5842,5846,5847,5849,5851,5853,5856,5860,5861,5864,5867,5872,5875,5876,5882,5883,5884,5885,5892,5893,5902,5905,5906,5910,5918,5919,5924,5925,5926,5931,5935,5936,5939,5943,5946,5948,5949,5950,5955,5958,5959,5961,5964,5966,5972,5973,5985,5986,5991,5996,5997,5999,6003,6007,6010,6011,6014,6017,6024,6025,6029,6031,6038,6045,6047,6048,6055,6056,6059,6060,6065,6066,6072,6075,6076,6078,6079,6080,6083,6086,6087,6089,6090,6091,6092,6093,6095,6096,6097,6102,6108,6111,6119,6123,6126,6130,6135,6139,6144,6147,6156,6160,6162,6164,6167,6168,6172,6175,6182,6183,6188,6189,6191,6193,6202,6204,6207,6215,6229,6231,6232,6255,6257,6258,6261,6264,6268,6275,6285,6288,6292,6296,6307,6308,6309,6310,6311,6314,6316,6317,6319,6331,6332,6334,6337,6338,6339,6340,6342,6343,6346,6347,6350,6353,6354,6356,6358,6361,6365,6369,6370,6371,6375,6381,6383,6385,6387,6389,6394,6396,6399,6403,6404,6406,6408,6409,6410,6415,6417,6419,6420,6422,6426,6427,6430,6433,6434,6442,6447,6450,6453,6457,6458,6460,6464,6465,6468,6469,6477,6482,6483,6488,6489,6492,6494,6496,6498,6499,6500,6501,6502,6503,6504,6509,6511,6516,6522,6528,6530,6533,6534,6535,6537,6538,6543,6546,6547,6552,6555,6556,6558,6559,6562,6563,6566,6569,6571,6572,6574,6575,6577,6578,6579,6586,6594,6595,6596,6598,6600,6602,6607,6609,6610,6611,6615,6616,6620,6621,6624,6631,6635,6639,6642,6645,6649,6650,6653,6656,6657,6659,6660,6661,6675,6676,6681,6683,6684,6686,6687,6690,6692,6693,6695,6697,6699,6702,6704,6708,6709,6717,6719,6721,6722,6724,6728,6730,6735,6740,6741,6742,6744,6745,6746,6749,6750,6751,6753,6761,6762,6763,6766,6768,6769,6772,6777,6779,6781,6782,6783,6785,6788,6793,6796,6803,6804,6810,6811,6812,6813,6814,6817,6819,6822,6824,6825,6830,6831,6832,6840,6843,6845,6846,6847,6848,6855,6860,6862,6863,6870,6876,6877,6878,6881,6884,6885,6888,6892,6895,6897,6898,6899,6900,6906,6907,6908,6911,6916,6917,6923,6925,6930,6934,6941,6942,6943,6948,6951,6953,6958,6962,6963,6965,6967,6968,6972,6979,6982,6984,6986,6987,6990,6994,6998,7000,7002,7003,7007,7012,7013,7014,7015,7017,7018,7025,7026,7028,7029,7031,7032,7033,7036,7040,7041,7042,7050,7051,7052,7056,7059,7068,7069,7070,7080,7082,7083,7084,7085,7087,7094,7095,7097,7106,7108,7110,7114,7115,7116,7124,7125,7129,7131,7132,7133,7134,7135,7137,7138,7139,7140,7141,7142,7146,7149,7150,7152,7155,7157,7160,7168,7177,7178,7180,7182,7186,7189,7191,7192,7201,7202,7204,7206,7207,7210,7211,7216,7220,7229,7230,7231,7234,7238,7239,7240,7241,7243,7244,7248,7250,7254,7258,7260,7262,7267,7269,7271,7272,7277,7280,7284,7286,7289,7291,7292,7298,7301,7306,7307,7311,7312,7314,7315,7316,7320,7321,7325,7326,7330,7331,7333,7335,7336,7339,7340,7342,7343,7345,7348,7350,7351,7355,7359,7366,7368,7373,7375,7377,7383,7384,7385,7387,7389,7394,7397,7403,7406,7407,7415,7418,7419,7421,7422,7423,7425,7426,7427,7429,7434,7435,7436,7440,7441,7442,7445,7448,7450,7453,7454,7455,7457,7466,7469,7470,7471,7475,7477,7486,7487,7488,7490,7491,7492,7497,7498,7505,7508,7509,7510,7511,7515,7516,7517,7518,7520,7521,7523,7524,7527,7530,7534,7535,7541,7543,7545,7546,7555,7557,7558,7561,7562,7563,7567,7569,7570,7571,7573,7577,7578,7579,7580,7582,7583,7588,7590,7597,7598,7600,7601,7602,7604,7605,7607,7608,7610,7611,7612,7615,7618,7621,7622,7623,7628,7629,7631,7634,7636,7638,7639,7641,7642,7646,7648,7649,7656,7660,7663,7666,7669,7671,7672,7675,7677,7678,7680,7683,7684,7685,7686,7688,7690,7692,7697,7698,7702,7703,7704,7705,7706,7707,7716,7717,7724,7729,7732,7733,7735,7736,7737,7740,7743,7744,7748,7750,7751,7754,7755,7756,7757,7759,7761,7765,7770,7774,7776,7777,7778,7779,7782,7786,7787,7788,7789,7791,7792,7795,7797,7799,7800,7801,7802,7806,7807,7808,7810,7813,7815,7817,7818,7819,7821,7823,7824,7826,7829,7831,7832,7834,7837,7838,7840,7842,7843,7845,7848,7849,7850,7855,7858,7859,7860,7861,7862,7865,7866,7867,7868,7870,7872,7874,7876,7877,7878,7881,7887,7888,7890,7892,7894,7897,7901,7902,7904,7907,7908,7909,7910,7911,7912,7918,7919,7920,7923,7927,7928,7929,7930,7931,7935,7937,7940,7941,7942,7943,7946,7949,7950,7951,7952,7954,7959,7963,7964,7965,7966,7967,7969,7973,7974,7980,7982,7984,7986,7988,7990,7991,7992,7993,7995,7997,7999,8001,8002,8004,8007,8008,8012,8013,8014,8015,8017,8019,8021,8022,8025,8026,8028,8029,8030,8034,8035,8037,8039,8043,8049,8051,8053,8056,8057,8060,8061,8063,8065,8068,8069,8071,8072,8075,8079,8081,8083,8086,8087,8088,8089,8090,8092,8095,8096,8099,8100,8102,8104,8106,8107,8108,8113,8114,8119,8123,8124,8125,8126,8128,8131,8134,8135,8138,8141,8143,8146,8147,8148,8149,8150,8151,8155,8156,8158,8161,8163,8166,8167,8169,8171,8173,8177,8179,8180,8181,8182,8183,8186,8187,8191,8192,8195,8197,8199,8200,8201,8202,8203,8205,8208,8209,8214,8215,8216,8221,8223,8227,8228,8230,8231,8232,8235,8237,8240,8241,8243,8248,8249,8250,8253,8254,8255,8256,8257,8258,8262,8263,8264,8267,8268,8269,8270,8271,8272,8273,8276,8277,8278,8281,8283,8284,8287,8289,8290,8291,8292,8296,8297,8298,8300,8301,8302,8303,8304,8306,8311,8316,8318,8319,8320,8322,8325,8326,8327,8328,8334,8335,8337,8338,8339,8340,8342,8343,8344,8345,8349,8350,8352,8354,8356,8359,8360,8366,8367,8370,8371,8373,8374,8376,8378,8379,8380,8382,8383,8385,8386,8388,8391,8392,8393,8397,8398,8399,8400,8402,8403,8404,8405,8406,8407,8408,8409,8410,8412,8413,8414,8415,8416,8417,8420,8422,8423,8424,8425,8426,8428,8433,8438,8439,8440,8441,8443,8444,8448,8450,8451,8452,8454,8455,8457,8459,8461,8463,8464,8465,8468,8470,8473,8474,8476,8477,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8492,8493,8496,8498,8500,8501,8504,8506,8508,8509,8510,8511,8512,8514,8515,8517,8518,8519,8521,8525,8528,8530,8531,8532,8535,8536,8537,8538,8540,8541,8543,8545,8547,8548,8550,8551,8554,8557,8558,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8573,8575,8577,8579,8580,8581,8583,8584,8585,8586,8587,8589,8590,8592,8593,8594,8596,8597,8598,8599,8601,8603,8604,8605,8607,8608,8609,8610,8611,8612,8613,8617,8618,8620,8621,8622,8623,8624,8625,8628,8629,8632,8633,8635,8637,8638,8639,8641,8646,8650,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8665,8666,8668,8669,8672,8673,8674,8678,8679,8681,8682,8685,8688,8689,8690,8691,8693,8697,8699,8701,8702,8705,8707,8708,8709,8710,8711,8712,8713,8714,8715,8717,8718,8719,8720,8721,8722,8723,8726,8729,8732,8734,8735,8736,8737,8738,8740,8741,8744,8745,8747,8748,8749,8750,8751,8752,8753,8755,8757,8758,8759,8760,8761,8762,8763,8764,8766,8767,8768,8769,8770,8771,8774,8775,8776,8778,8779,8780,8781,8783,8784,8785,8786,8788,8790,8791,8792,8793,8794,8795,8796,8797,8799,8800,8802,8803,8805,8806,8807,8810,8811,8813,8814,8815,8816,8817,8818,8820,8822,8823,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8841,8843,8844,8845,8846,8848,8849,8850,8851,8853,8854,8856,8857,8862,8863,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8877,8879,8880,8881,8882,8883,8885,8886,8887,8888,8889,8890,8891,8893,8895,8896,8898,8899,8900,8902,8903,8906,8907,8908,8909,8910,8911,8912,8913,8916,8918,8919,8922,8923,8924,8925,8927,8928,8930,8931,8932,8933,8938,8940,8942,8944,8945,8948,8949,8951,8952,8953,8954,8955,8956,8957,8958,8959,8962,8963,8964,8966,8967,8968,8969,8970,8971,8972,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8986,8987,8989,8990,8991,8993,8997,8998,8999,9000,9001,9002,9003,9005,9006,9008,9009,9011,9013,9014,9015,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9028,9029,9030,9031,9032,9033,9034,9035,9038,9040,9041,9042,9043,9044,9045,9046,9047,9049,9050,9051,9052,9053,9054,9055,9056,9057,9059,9060,9061,9062,9063,9066,9067,9068,9069,9071,9072,9073,9074,9075,9077,9078,9079,9080,9081,9082,9083,9085,9086,9087,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9102,9103,9104,9105,9107,9108,9109,9110,9112,9113,9115,9116,9117,9119,9121,9122,9123,9124,9125,9126,9127,9128,9130,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,9152,9153,9154,9156,9157,9158,9159,9160,9161,9162,9163,9165,9166,9167,9170,9171,9172,9174,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,9205,9206,9207,9208,9209,9210,9211,9212,9213,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9229,9230,9231,9232,9233,9234,9235,9236,9238,9240,9243,9244,9245,9246,9247,9248,9249,9250,9251,9252,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9310,9311,9313,9314,9315,9316,9317,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9380,9381,9382,9383,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9416,9417,9418,9419,9420,9422,9423,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9438,9439,9440,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452,9454,9455,9456,9457,9458,9459,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9472,9473,9474,9475,9476,9477,9479,9480,9481,9482,9483,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9658,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9680,9681,9682,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,9893,9894,9895,9896,9897,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,9915,9916,9917,9918,9919,9920,9921,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,9947,9948,9949,9950,9951,9952,9953,9954,9955,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,9966,9967,9968,9969,9970,9971,9972,9973,9974,9975,9976,9977,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999 }, + }, + + { + [][]int{{1, 2}, {2, 3}, {5}, {0}, {5}, {}, {}}, + []int{2, 4, 5, 6}, + }, + + // 可以有多个 testcase +} + +func Test_eventualSafeNodes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, eventualSafeNodes(tc.graph), "输入:%v", tc) + } +} + +func Benchmark_eventualSafeNodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + eventualSafeNodes(tc.graph) + } + } +} diff --git a/Algorithms/0802.find-eventual-safe-states/pic.png b/Algorithms/0802.find-eventual-safe-states/pic.png new file mode 100644 index 000000000..fb1f30cea Binary files /dev/null and b/Algorithms/0802.find-eventual-safe-states/pic.png differ diff --git a/Algorithms/0803.bricks-falling-when-hit/README.md b/Algorithms/0803.bricks-falling-when-hit/README.md new file mode 100755 index 000000000..bae81a542 --- /dev/null +++ b/Algorithms/0803.bricks-falling-when-hit/README.md @@ -0,0 +1,40 @@ +# [803. Bricks Falling When Hit](https://leetcode.com/problems/bricks-falling-when-hit/) + +## 题目 + +We have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only if it is directly connected to the top of the grid, or at least one of its (4-way) adjacent bricks will not drop. + +We will do some erasuressequentially. Each time we want to do the erasure at the location (i, j), the brick (if it exists) on that location will disappear, and then some other bricks maydrop because of thaterasure. + +Return an array representing the number of bricks that will drop after each erasure in sequence. + +```text +Example 1: +Input: +grid = [[1,0,0,0],[1,1,1,0]] +hits = [[1,0]] +Output: [2] +Explanation: +If we erase the brick at (1, 0), the brick at (1, 1) and (1, 2) will drop. So we should return 2. +``` + +```text +Example 2: +Input: +grid = [[1,0,0,0],[1,1,0,0]] +hits = [[1,1],[1,0]] +Output: [0,0] +Explanation: +When we erase the brick at (1, 0), the brick at (1, 1) has already disappeared due to the last move. So each erasure will cause no bricks dropping. Note that the erased brick (1, 0) will not be counted as a dropped brick. +``` + +Note: + +1. The number of rows and columns in the grid will be in the range[1, 200]. +1. The number of erasures will not exceed the area of the grid. +1. It is guaranteed that each erasure will be different from any other erasure, and located inside the grid. +1. An erasure may refer to a location with no brick - if it does, no bricks drop. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit.go b/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit.go new file mode 100755 index 000000000..5aa9782f1 --- /dev/null +++ b/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit.go @@ -0,0 +1,83 @@ +package problem0803 + +func hitBricks(grid [][]int, hits [][]int) []int { + m, n := len(grid), len(grid[0]) + res := make([]int, len(hits)) + + for i := range hits { + // 先把所有的点都消去 + // 使用 -- 而不是 =0 + // 是为了让原先是 0 的点变成 -1 + // 这很重要 + grid[hits[i][0]][hits[i][1]]-- + } + + // 全部点消去后,仍然挂着的点,全部变成 2 + for j := 0; j < len(grid[0]); j++ { + if grid[0][j] == 1 { + check(0, j, grid) + } + } + + // 倒着往上面添加点 + for idx := len(hits) - 1; 0 <= idx; idx-- { + i, j := hits[idx][0], hits[idx][1] + // 先把 (i,j) 还原 + grid[i][j]++ + if grid[i][j] == 0 { + // 原先就是 0 的点,不会引起别的点下落 + continue + } + // 然后,检查 (i,j) 是否和 2 相连 + // 或者 + // i == 0,表示 (i,j) 本身,就在顶部 + if (0 <= i-1 && grid[i-1][j] == 2) || + (0 <= j-1 && grid[i][j-1] == 2) || + (i+1 < m && grid[i+1][j] == 2) || + (j+1 < n && grid[i][j+1] == 2) || + i == 0 { + // 所有和 (i,j) 相连的值为 1 的点,都变成 2 + // 这些点在 (i,j) 被擦除后,都会掉落 + // 但是这些点中也包含了 (i,j) ,所以结果要 -1 + res[idx] = add(i, j, grid) - 1 + } + } + + return res +} + +func check(i, j int, grid [][]int) { + grid[i][j] = 2 + m, n := len(grid), len(grid[0]) + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && 0 <= y && y < n && grid[x][y] == 1 { + check(x, y, grid) + } + } +} + +func add(i, j int, grid [][]int) int { + m, n := len(grid), len(grid[0]) + + if i < 0 || m <= i || + j < 0 || n <= j || + grid[i][j] != 1 { + return 0 + } + + grid[i][j] = 2 + res := 1 + + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + res += add(x, y, grid) + } + + return res +} + +var dx = []int{-1, 0, 0, 1} +var dy = []int{0, -1, 1, 0} diff --git a/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit_test.go b/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit_test.go new file mode 100755 index 000000000..bb4406baa --- /dev/null +++ b/Algorithms/0803.bricks-falling-when-hit/bricks-falling-when-hit_test.go @@ -0,0 +1,89 @@ +package problem0803 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + hits [][]int + ans []int +}{ + +{ +[][]int { { 1,0,1 },{ 0,0,1 } }, +[][]int { { 1,0 },{ 0,0 } }, +[]int { 0,0 }, +}, + + { +[][]int { { 1 },{ 1 },{ 1 },{ 1 },{ 1 } }, +[][]int { { 3,0 },{ 4,0 },{ 1,0 },{ 2,0 },{ 0,0 } }, +[]int { 1,0,1,0,0 }, + }, + + { + [][]int{{1, 0, 0, 0}, {1, 1, 1, 0}}, + [][]int{{1, 0}}, + []int{2}, + }, + + { + [][]int{{1, 0, 0, 0}, {1, 1, 0, 0}}, + [][]int{{1, 1}, {1, 0}}, + []int{0, 0}, + }, + + { + [][]int{{1, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 0}}, + [][]int{{2, 1}}, + []int{3}, + }, + + { + [][]int{{1, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 0}}, + [][]int{{2, 4}}, + []int{0}, + }, + + { + [][]int{{1, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1}}, + [][]int{{2, 0}}, + []int{10}, + }, + + { + [][]int{{1, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 1, 0}, {1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1}}, + [][]int{{2, 0}}, + []int{11}, + }, + + { + [][]int { { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } }, +[][]int {{169,0},{169,1},{169,2},{169,3},{169,4},{169,5},{169,6},{169,7},{169,8},{169,9},{169,10},{169,11},{169,12},{169,13},{169,14},{169,15},{169,16},{169,17},{169,18},{169,19},{169,20},{169,21},{169,22},{169,23},{169,24},{169,25},{169,26},{169,27},{169,28},{169,29},{169,30},{169,31},{169,32},{169,33},{169,34},{169,35},{169,36},{169,37},{169,38},{169,39},{169,40},{169,41},{169,42},{169,43},{169,44},{169,45},{169,46},{169,47},{169,48},{169,49},{169,50},{169,51},{169,52},{169,53},{169,54},{169,55},{169,56},{169,57},{169,58},{169,59},{169,60},{169,61},{169,62},{169,63},{169,64},{169,65},{169,66},{169,67},{169,68},{169,69},{169,70},{169,71},{169,72},{169,73},{169,74},{169,75},{169,76},{169,77},{169,78},{169,79},{169,80},{169,81},{169,82},{169,83},{169,84},{169,85},{169,86},{169,87},{169,88},{169,89},{169,90},{169,91},{169,92},{169,93},{169,94},{169,95},{169,96},{169,97},{169,98},{169,99},{169,100},{169,101},{169,102},{169,103},{169,104},{169,105},{169,106},{169,107},{169,108},{169,109},{169,110},{169,111},{169,112},{169,113},{169,114},{169,115},{169,116},{169,117},{169,118},{169,119},{169,120},{169,121},{169,122},{169,123},{169,124},{169,125},{169,126},{169,127},{169,128},{169,129},{169,130},{169,131},{169,132},{169,133},{169,134},{169,135},{169,136},{169,137},{169,138},{169,139},{169,140},{169,141},{169,142},{169,143},{169,144},{169,145},{169,146},{169,147},{169,148},{169,149},{169,150},{168,0},{168,1},{168,2},{168,3},{168,4},{168,5},{168,6},{168,7},{168,8},{168,9},{168,10},{168,11},{168,12},{168,13},{168,14},{168,15},{168,16},{168,17},{168,18},{168,19},{168,20},{168,21},{168,22},{168,23},{168,24},{168,25},{168,26},{168,27},{168,28},{168,29},{168,30},{168,31},{168,32},{168,33},{168,34},{168,35},{168,36},{168,37},{168,38},{168,39},{168,40},{168,41},{168,42},{168,43},{168,44},{168,45},{168,46},{168,47},{168,48},{168,49},{168,50},{168,51},{168,52},{168,53},{168,54},{168,55},{168,56},{168,57},{168,58},{168,59},{168,60},{168,61},{168,62},{168,63},{168,64},{168,65},{168,66},{168,67},{168,68},{168,69},{168,70},{168,71},{168,72},{168,73},{168,74},{168,75},{168,76},{168,77},{168,78},{168,79},{168,80},{168,81},{168,82},{168,83},{168,84},{168,85},{168,86},{168,87},{168,88},{168,89},{168,90},{168,91},{168,92},{168,93},{168,94},{168,95},{168,96},{168,97},{168,98},{168,99},{168,100},{168,101},{168,102},{168,103},{168,104},{168,105},{168,106},{168,107},{168,108},{168,109},{168,110},{168,111},{168,112},{168,113},{168,114},{168,115},{168,116},{168,117},{168,118},{168,119},{168,120},{168,121},{168,122},{168,123},{168,124},{168,125},{168,126},{168,127},{168,128},{168,129},{168,130},{168,131},{168,132},{168,133},{168,134},{168,135},{168,136},{168,137},{168,138},{168,139},{168,140},{168,141},{168,142},{168,143},{168,144},{168,145},{168,146},{168,147},{168,148},{168,149},{168,150},{167,0},{167,1},{167,2},{167,3},{167,4},{167,5},{167,6},{167,7},{167,8},{167,9},{167,10},{167,11},{167,12},{167,13},{167,14},{167,15},{167,16},{167,17},{167,18},{167,19},{167,20},{167,21},{167,22},{167,23},{167,24},{167,25},{167,26},{167,27},{167,28},{167,29},{167,30},{167,31},{167,32},{167,33},{167,34},{167,35},{167,36},{167,37},{167,38},{167,39},{167,40},{167,41},{167,42},{167,43},{167,44},{167,45},{167,46},{167,47},{167,48},{167,49},{167,50},{167,51},{167,52},{167,53},{167,54},{167,55},{167,56},{167,57},{167,58},{167,59},{167,60},{167,61},{167,62},{167,63},{167,64},{167,65},{167,66},{167,67},{167,68},{167,69},{167,70},{167,71},{167,72},{167,73},{167,74},{167,75},{167,76},{167,77},{167,78},{167,79},{167,80},{167,81},{167,82},{167,83},{167,84},{167,85},{167,86},{167,87},{167,88},{167,89},{167,90},{167,91},{167,92},{167,93},{167,94},{167,95},{167,96},{167,97},{167,98},{167,99},{167,100},{167,101},{167,102},{167,103},{167,104},{167,105},{167,106},{167,107},{167,108},{167,109},{167,110},{167,111},{167,112},{167,113},{167,114},{167,115},{167,116},{167,117},{167,118},{167,119},{167,120},{167,121},{167,122},{167,123},{167,124},{167,125},{167,126},{167,127},{167,128},{167,129},{167,130},{167,131},{167,132},{167,133},{167,134},{167,135},{167,136},{167,137},{167,138},{167,139},{167,140},{167,141},{167,142},{167,143},{167,144},{167,145},{167,146},{167,147},{167,148},{167,149},{167,150},{166,0},{166,1},{166,2},{166,3},{166,4},{166,5},{166,6},{166,7},{166,8},{166,9},{166,10},{166,11},{166,12},{166,13},{166,14},{166,15},{166,16},{166,17},{166,18},{166,19},{166,20},{166,21},{166,22},{166,23},{166,24},{166,25},{166,26},{166,27},{166,28},{166,29},{166,30},{166,31},{166,32},{166,33},{166,34},{166,35},{166,36},{166,37},{166,38},{166,39},{166,40},{166,41},{166,42},{166,43},{166,44},{166,45},{166,46},{166,47},{166,48},{166,49},{166,50},{166,51},{166,52},{166,53},{166,54},{166,55},{166,56},{166,57},{166,58},{166,59},{166,60},{166,61},{166,62},{166,63},{166,64},{166,65},{166,66},{166,67},{166,68},{166,69},{166,70},{166,71},{166,72},{166,73},{166,74},{166,75},{166,76},{166,77},{166,78},{166,79},{166,80},{166,81},{166,82},{166,83},{166,84},{166,85},{166,86},{166,87},{166,88},{166,89},{166,90},{166,91},{166,92},{166,93},{166,94},{166,95},{166,96},{166,97},{166,98},{166,99},{166,100},{166,101},{166,102},{166,103},{166,104},{166,105},{166,106},{166,107},{166,108},{166,109},{166,110},{166,111},{166,112},{166,113},{166,114},{166,115},{166,116},{166,117},{166,118},{166,119},{166,120},{166,121},{166,122},{166,123},{166,124},{166,125},{166,126},{166,127},{166,128},{166,129},{166,130},{166,131},{166,132},{166,133},{166,134},{166,135},{166,136},{166,137},{166,138},{166,139},{166,140},{166,141},{166,142},{166,143},{166,144},{166,145},{166,146},{166,147},{166,148},{166,149},{166,150},{165,0},{165,1},{165,2},{165,3},{165,4},{165,5},{165,6},{165,7},{165,8},{165,9},{165,10},{165,11},{165,12},{165,13},{165,14},{165,15},{165,16},{165,17},{165,18},{165,19},{165,20},{165,21},{165,22},{165,23},{165,24},{165,25},{165,26},{165,27},{165,28},{165,29},{165,30},{165,31},{165,32},{165,33},{165,34},{165,35},{165,36},{165,37},{165,38},{165,39},{165,40},{165,41},{165,42},{165,43},{165,44},{165,45},{165,46},{165,47},{165,48},{165,49},{165,50},{165,51},{165,52},{165,53},{165,54},{165,55},{165,56},{165,57},{165,58},{165,59},{165,60},{165,61},{165,62},{165,63},{165,64},{165,65},{165,66},{165,67},{165,68},{165,69},{165,70},{165,71},{165,72},{165,73},{165,74},{165,75},{165,76},{165,77},{165,78},{165,79},{165,80},{165,81},{165,82},{165,83},{165,84},{165,85},{165,86},{165,87},{165,88},{165,89},{165,90},{165,91},{165,92},{165,93},{165,94},{165,95},{165,96},{165,97},{165,98},{165,99},{165,100},{165,101},{165,102},{165,103},{165,104},{165,105},{165,106},{165,107},{165,108},{165,109},{165,110},{165,111},{165,112},{165,113},{165,114},{165,115},{165,116},{165,117},{165,118},{165,119},{165,120},{165,121},{165,122},{165,123},{165,124},{165,125},{165,126},{165,127},{165,128},{165,129},{165,130},{165,131},{165,132},{165,133},{165,134},{165,135},{165,136},{165,137},{165,138},{165,139},{165,140},{165,141},{165,142},{165,143},{165,144},{165,145},{165,146},{165,147},{165,148},{165,149},{165,150},{164,0},{164,1},{164,2},{164,3},{164,4},{164,5},{164,6},{164,7},{164,8},{164,9},{164,10},{164,11},{164,12},{164,13},{164,14},{164,15},{164,16},{164,17},{164,18},{164,19},{164,20},{164,21},{164,22},{164,23},{164,24},{164,25},{164,26},{164,27},{164,28},{164,29},{164,30},{164,31},{164,32},{164,33},{164,34},{164,35},{164,36},{164,37},{164,38},{164,39},{164,40},{164,41},{164,42},{164,43},{164,44},{164,45},{164,46},{164,47},{164,48},{164,49},{164,50},{164,51},{164,52},{164,53},{164,54},{164,55},{164,56},{164,57},{164,58},{164,59},{164,60},{164,61},{164,62},{164,63},{164,64},{164,65},{164,66},{164,67},{164,68},{164,69},{164,70},{164,71},{164,72},{164,73},{164,74},{164,75},{164,76},{164,77},{164,78},{164,79},{164,80},{164,81},{164,82},{164,83},{164,84},{164,85},{164,86},{164,87},{164,88},{164,89},{164,90},{164,91},{164,92},{164,93},{164,94},{164,95},{164,96},{164,97},{164,98},{164,99},{164,100},{164,101},{164,102},{164,103},{164,104},{164,105},{164,106},{164,107},{164,108},{164,109},{164,110},{164,111},{164,112},{164,113},{164,114},{164,115},{164,116},{164,117},{164,118},{164,119},{164,120},{164,121},{164,122},{164,123},{164,124},{164,125},{164,126},{164,127},{164,128},{164,129},{164,130},{164,131},{164,132},{164,133},{164,134},{164,135},{164,136},{164,137},{164,138},{164,139},{164,140},{164,141},{164,142},{164,143},{164,144},{164,145},{164,146},{164,147},{164,148},{164,149},{164,150},{163,0},{163,1},{163,2},{163,3},{163,4},{163,5},{163,6},{163,7},{163,8},{163,9},{163,10},{163,11},{163,12},{163,13},{163,14},{163,15},{163,16},{163,17},{163,18},{163,19},{163,20},{163,21},{163,22},{163,23},{163,24},{163,25},{163,26},{163,27},{163,28},{163,29},{163,30},{163,31},{163,32},{163,33},{163,34},{163,35},{163,36},{163,37},{163,38},{163,39},{163,40},{163,41},{163,42},{163,43},{163,44},{163,45},{163,46},{163,47},{163,48},{163,49},{163,50},{163,51},{163,52},{163,53},{163,54},{163,55},{163,56},{163,57},{163,58},{163,59},{163,60},{163,61},{163,62},{163,63},{163,64},{163,65},{163,66},{163,67},{163,68},{163,69},{163,70},{163,71},{163,72},{163,73},{163,74},{163,75},{163,76},{163,77},{163,78},{163,79},{163,80},{163,81},{163,82},{163,83},{163,84},{163,85},{163,86},{163,87},{163,88},{163,89},{163,90},{163,91},{163,92},{163,93},{163,94},{163,95},{163,96},{163,97},{163,98},{163,99},{163,100},{163,101},{163,102},{163,103},{163,104},{163,105},{163,106},{163,107},{163,108},{163,109},{163,110},{163,111},{163,112},{163,113},{163,114},{163,115},{163,116},{163,117},{163,118},{163,119},{163,120},{163,121},{163,122},{163,123},{163,124},{163,125},{163,126},{163,127},{163,128},{163,129},{163,130},{163,131},{163,132},{163,133},{163,134},{163,135},{163,136},{163,137},{163,138},{163,139},{163,140},{163,141},{163,142},{163,143},{163,144},{163,145},{163,146},{163,147},{163,148},{163,149},{163,150},{162,0},{162,1},{162,2},{162,3},{162,4},{162,5},{162,6},{162,7},{162,8},{162,9},{162,10},{162,11},{162,12},{162,13},{162,14},{162,15},{162,16},{162,17},{162,18},{162,19},{162,20},{162,21},{162,22},{162,23},{162,24},{162,25},{162,26},{162,27},{162,28},{162,29},{162,30},{162,31},{162,32},{162,33},{162,34},{162,35},{162,36},{162,37},{162,38},{162,39},{162,40},{162,41},{162,42},{162,43},{162,44},{162,45},{162,46},{162,47},{162,48},{162,49},{162,50},{162,51},{162,52},{162,53},{162,54},{162,55},{162,56},{162,57},{162,58},{162,59},{162,60},{162,61},{162,62},{162,63},{162,64},{162,65},{162,66},{162,67},{162,68},{162,69},{162,70},{162,71},{162,72},{162,73},{162,74},{162,75},{162,76},{162,77},{162,78},{162,79},{162,80},{162,81},{162,82},{162,83},{162,84},{162,85},{162,86},{162,87},{162,88},{162,89},{162,90},{162,91},{162,92},{162,93},{162,94},{162,95},{162,96},{162,97},{162,98},{162,99},{162,100},{162,101},{162,102},{162,103},{162,104},{162,105},{162,106},{162,107},{162,108},{162,109},{162,110},{162,111},{162,112},{162,113},{162,114},{162,115},{162,116},{162,117},{162,118},{162,119},{162,120},{162,121},{162,122},{162,123},{162,124},{162,125},{162,126},{162,127},{162,128},{162,129},{162,130},{162,131},{162,132},{162,133},{162,134},{162,135},{162,136},{162,137},{162,138},{162,139},{162,140},{162,141},{162,142},{162,143},{162,144},{162,145},{162,146},{162,147},{162,148},{162,149},{162,150},{161,0},{161,1},{161,2},{161,3},{161,4},{161,5},{161,6},{161,7},{161,8},{161,9},{161,10},{161,11},{161,12},{161,13},{161,14},{161,15},{161,16},{161,17},{161,18},{161,19},{161,20},{161,21},{161,22},{161,23},{161,24},{161,25},{161,26},{161,27},{161,28},{161,29},{161,30},{161,31},{161,32},{161,33},{161,34},{161,35},{161,36},{161,37},{161,38},{161,39},{161,40},{161,41},{161,42},{161,43},{161,44},{161,45},{161,46},{161,47},{161,48},{161,49},{161,50},{161,51},{161,52},{161,53},{161,54},{161,55},{161,56},{161,57},{161,58},{161,59},{161,60},{161,61},{161,62},{161,63},{161,64},{161,65},{161,66},{161,67},{161,68},{161,69},{161,70},{161,71},{161,72},{161,73},{161,74},{161,75},{161,76},{161,77},{161,78},{161,79},{161,80},{161,81},{161,82},{161,83},{161,84},{161,85},{161,86},{161,87},{161,88},{161,89},{161,90},{161,91},{161,92},{161,93},{161,94},{161,95},{161,96},{161,97},{161,98},{161,99},{161,100},{161,101},{161,102},{161,103},{161,104},{161,105},{161,106},{161,107},{161,108},{161,109},{161,110},{161,111},{161,112},{161,113},{161,114},{161,115},{161,116},{161,117},{161,118},{161,119},{161,120},{161,121},{161,122},{161,123},{161,124},{161,125},{161,126},{161,127},{161,128},{161,129},{161,130},{161,131},{161,132},{161,133},{161,134},{161,135},{161,136},{161,137},{161,138},{161,139},{161,140},{161,141},{161,142},{161,143},{161,144},{161,145},{161,146},{161,147},{161,148},{161,149},{161,150},{160,0},{160,1},{160,2},{160,3},{160,4},{160,5},{160,6},{160,7},{160,8},{160,9},{160,10},{160,11},{160,12},{160,13},{160,14},{160,15},{160,16},{160,17},{160,18},{160,19},{160,20},{160,21},{160,22},{160,23},{160,24},{160,25},{160,26},{160,27},{160,28},{160,29},{160,30},{160,31},{160,32},{160,33},{160,34},{160,35},{160,36},{160,37},{160,38},{160,39},{160,40},{160,41},{160,42},{160,43},{160,44},{160,45},{160,46},{160,47},{160,48},{160,49},{160,50},{160,51},{160,52},{160,53},{160,54},{160,55},{160,56},{160,57},{160,58},{160,59},{160,60},{160,61},{160,62},{160,63},{160,64},{160,65},{160,66},{160,67},{160,68},{160,69},{160,70},{160,71},{160,72},{160,73},{160,74},{160,75},{160,76},{160,77},{160,78},{160,79},{160,80},{160,81},{160,82},{160,83},{160,84},{160,85},{160,86},{160,87},{160,88},{160,89},{160,90},{160,91},{160,92},{160,93},{160,94},{160,95},{160,96},{160,97},{160,98},{160,99},{160,100},{160,101},{160,102},{160,103},{160,104},{160,105},{160,106},{160,107},{160,108},{160,109},{160,110},{160,111},{160,112},{160,113},{160,114},{160,115},{160,116},{160,117},{160,118},{160,119},{160,120},{160,121},{160,122},{160,123},{160,124},{160,125},{160,126},{160,127},{160,128},{160,129},{160,130},{160,131},{160,132},{160,133},{160,134},{160,135},{160,136},{160,137},{160,138},{160,139},{160,140},{160,141},{160,142},{160,143},{160,144},{160,145},{160,146},{160,147},{160,148},{160,149},{160,150},{159,0},{159,1},{159,2},{159,3},{159,4},{159,5},{159,6},{159,7},{159,8},{159,9},{159,10},{159,11},{159,12},{159,13},{159,14},{159,15},{159,16},{159,17},{159,18},{159,19},{159,20},{159,21},{159,22},{159,23},{159,24},{159,25},{159,26},{159,27},{159,28},{159,29},{159,30},{159,31},{159,32},{159,33},{159,34},{159,35},{159,36},{159,37},{159,38},{159,39},{159,40},{159,41},{159,42},{159,43},{159,44},{159,45},{159,46},{159,47},{159,48},{159,49},{159,50},{159,51},{159,52},{159,53},{159,54},{159,55},{159,56},{159,57},{159,58},{159,59},{159,60},{159,61},{159,62},{159,63},{159,64},{159,65},{159,66},{159,67},{159,68},{159,69},{159,70},{159,71},{159,72},{159,73},{159,74},{159,75},{159,76},{159,77},{159,78},{159,79},{159,80},{159,81},{159,82},{159,83},{159,84},{159,85},{159,86},{159,87},{159,88},{159,89},{159,90},{159,91},{159,92},{159,93},{159,94},{159,95},{159,96},{159,97},{159,98},{159,99},{159,100},{159,101},{159,102},{159,103},{159,104},{159,105},{159,106},{159,107},{159,108},{159,109},{159,110},{159,111},{159,112},{159,113},{159,114},{159,115},{159,116},{159,117},{159,118},{159,119},{159,120},{159,121},{159,122},{159,123},{159,124},{159,125},{159,126},{159,127},{159,128},{159,129},{159,130},{159,131},{159,132},{159,133},{159,134},{159,135},{159,136},{159,137},{159,138},{159,139},{159,140},{159,141},{159,142},{159,143},{159,144},{159,145},{159,146},{159,147},{159,148},{159,149},{159,150},{158,0},{158,1},{158,2},{158,3},{158,4},{158,5},{158,6},{158,7},{158,8},{158,9},{158,10},{158,11},{158,12},{158,13},{158,14},{158,15},{158,16},{158,17},{158,18},{158,19},{158,20},{158,21},{158,22},{158,23},{158,24},{158,25},{158,26},{158,27},{158,28},{158,29},{158,30},{158,31},{158,32},{158,33},{158,34},{158,35},{158,36},{158,37},{158,38},{158,39},{158,40},{158,41},{158,42},{158,43},{158,44},{158,45},{158,46},{158,47},{158,48},{158,49},{158,50},{158,51},{158,52},{158,53},{158,54},{158,55},{158,56},{158,57},{158,58},{158,59},{158,60},{158,61},{158,62},{158,63},{158,64},{158,65},{158,66},{158,67},{158,68},{158,69},{158,70},{158,71},{158,72},{158,73},{158,74},{158,75},{158,76},{158,77},{158,78},{158,79},{158,80},{158,81},{158,82},{158,83},{158,84},{158,85},{158,86},{158,87},{158,88},{158,89},{158,90},{158,91},{158,92},{158,93},{158,94},{158,95},{158,96},{158,97},{158,98},{158,99},{158,100},{158,101},{158,102},{158,103},{158,104},{158,105},{158,106},{158,107},{158,108},{158,109},{158,110},{158,111},{158,112},{158,113},{158,114},{158,115},{158,116},{158,117},{158,118},{158,119},{158,120},{158,121},{158,122},{158,123},{158,124},{158,125},{158,126},{158,127},{158,128},{158,129},{158,130},{158,131},{158,132},{158,133},{158,134},{158,135},{158,136},{158,137},{158,138},{158,139},{158,140},{158,141},{158,142},{158,143},{158,144},{158,145},{158,146},{158,147},{158,148},{158,149},{158,150},{157,0},{157,1},{157,2},{157,3},{157,4},{157,5},{157,6},{157,7},{157,8},{157,9},{157,10},{157,11},{157,12},{157,13},{157,14},{157,15},{157,16},{157,17},{157,18},{157,19},{157,20},{157,21},{157,22},{157,23},{157,24},{157,25},{157,26},{157,27},{157,28},{157,29},{157,30},{157,31},{157,32},{157,33},{157,34},{157,35},{157,36},{157,37},{157,38},{157,39},{157,40},{157,41},{157,42},{157,43},{157,44},{157,45},{157,46},{157,47},{157,48},{157,49},{157,50},{157,51},{157,52},{157,53},{157,54},{157,55},{157,56},{157,57},{157,58},{157,59},{157,60},{157,61},{157,62},{157,63},{157,64},{157,65},{157,66},{157,67},{157,68},{157,69},{157,70},{157,71},{157,72},{157,73},{157,74},{157,75},{157,76},{157,77},{157,78},{157,79},{157,80},{157,81},{157,82},{157,83},{157,84},{157,85},{157,86},{157,87},{157,88},{157,89},{157,90},{157,91},{157,92},{157,93},{157,94},{157,95},{157,96},{157,97},{157,98},{157,99},{157,100},{157,101},{157,102},{157,103},{157,104},{157,105},{157,106},{157,107},{157,108},{157,109},{157,110},{157,111},{157,112},{157,113},{157,114},{157,115},{157,116},{157,117},{157,118},{157,119},{157,120},{157,121},{157,122},{157,123},{157,124},{157,125},{157,126},{157,127},{157,128},{157,129},{157,130},{157,131},{157,132},{157,133},{157,134},{157,135},{157,136},{157,137},{157,138},{157,139},{157,140},{157,141},{157,142},{157,143},{157,144},{157,145},{157,146},{157,147},{157,148},{157,149},{157,150},{156,0},{156,1},{156,2},{156,3},{156,4},{156,5},{156,6},{156,7},{156,8},{156,9},{156,10},{156,11},{156,12},{156,13},{156,14},{156,15},{156,16},{156,17},{156,18},{156,19},{156,20},{156,21},{156,22},{156,23},{156,24},{156,25},{156,26},{156,27},{156,28},{156,29},{156,30},{156,31},{156,32},{156,33},{156,34},{156,35},{156,36},{156,37},{156,38},{156,39},{156,40},{156,41},{156,42},{156,43},{156,44},{156,45},{156,46},{156,47},{156,48},{156,49},{156,50},{156,51},{156,52},{156,53},{156,54},{156,55},{156,56},{156,57},{156,58},{156,59},{156,60},{156,61},{156,62},{156,63},{156,64},{156,65},{156,66},{156,67},{156,68},{156,69},{156,70},{156,71},{156,72},{156,73},{156,74},{156,75},{156,76},{156,77},{156,78},{156,79},{156,80},{156,81},{156,82},{156,83},{156,84},{156,85},{156,86},{156,87},{156,88},{156,89},{156,90},{156,91},{156,92},{156,93},{156,94},{156,95},{156,96},{156,97},{156,98},{156,99},{156,100},{156,101},{156,102},{156,103},{156,104},{156,105},{156,106},{156,107},{156,108},{156,109},{156,110},{156,111},{156,112},{156,113},{156,114},{156,115},{156,116},{156,117},{156,118},{156,119},{156,120},{156,121},{156,122},{156,123},{156,124},{156,125},{156,126},{156,127},{156,128},{156,129},{156,130},{156,131},{156,132},{156,133},{156,134},{156,135},{156,136},{156,137},{156,138},{156,139},{156,140},{156,141},{156,142},{156,143},{156,144},{156,145},{156,146},{156,147},{156,148},{156,149},{156,150},{155,0},{155,1},{155,2},{155,3},{155,4},{155,5},{155,6},{155,7},{155,8},{155,9},{155,10},{155,11},{155,12},{155,13},{155,14},{155,15},{155,16},{155,17},{155,18},{155,19},{155,20},{155,21},{155,22},{155,23},{155,24},{155,25},{155,26},{155,27},{155,28},{155,29},{155,30},{155,31},{155,32},{155,33},{155,34},{155,35},{155,36},{155,37},{155,38},{155,39},{155,40},{155,41},{155,42},{155,43},{155,44},{155,45},{155,46},{155,47},{155,48},{155,49},{155,50},{155,51},{155,52},{155,53},{155,54},{155,55},{155,56},{155,57},{155,58},{155,59},{155,60},{155,61},{155,62},{155,63},{155,64},{155,65},{155,66},{155,67},{155,68},{155,69},{155,70},{155,71},{155,72},{155,73},{155,74},{155,75},{155,76},{155,77},{155,78},{155,79},{155,80},{155,81},{155,82},{155,83},{155,84},{155,85},{155,86},{155,87},{155,88},{155,89},{155,90},{155,91},{155,92},{155,93},{155,94},{155,95},{155,96},{155,97},{155,98},{155,99},{155,100},{155,101},{155,102},{155,103},{155,104},{155,105},{155,106},{155,107},{155,108},{155,109},{155,110},{155,111},{155,112},{155,113},{155,114},{155,115},{155,116},{155,117},{155,118},{155,119},{155,120},{155,121},{155,122},{155,123},{155,124},{155,125},{155,126},{155,127},{155,128},{155,129},{155,130},{155,131},{155,132},{155,133},{155,134},{155,135},{155,136},{155,137},{155,138},{155,139},{155,140},{155,141},{155,142},{155,143},{155,144},{155,145},{155,146},{155,147},{155,148},{155,149},{155,150},{154,0},{154,1},{154,2},{154,3},{154,4},{154,5},{154,6},{154,7},{154,8},{154,9},{154,10},{154,11},{154,12},{154,13},{154,14},{154,15},{154,16},{154,17},{154,18},{154,19},{154,20},{154,21},{154,22},{154,23},{154,24},{154,25},{154,26},{154,27},{154,28},{154,29},{154,30},{154,31},{154,32},{154,33},{154,34},{154,35},{154,36},{154,37},{154,38},{154,39},{154,40},{154,41},{154,42},{154,43},{154,44},{154,45},{154,46},{154,47},{154,48},{154,49},{154,50},{154,51},{154,52},{154,53},{154,54},{154,55},{154,56},{154,57},{154,58},{154,59},{154,60},{154,61},{154,62},{154,63},{154,64},{154,65},{154,66},{154,67},{154,68},{154,69},{154,70},{154,71},{154,72},{154,73},{154,74},{154,75},{154,76},{154,77},{154,78},{154,79},{154,80},{154,81},{154,82},{154,83},{154,84},{154,85},{154,86},{154,87},{154,88},{154,89},{154,90},{154,91},{154,92},{154,93},{154,94},{154,95},{154,96},{154,97},{154,98},{154,99},{154,100},{154,101},{154,102},{154,103},{154,104},{154,105},{154,106},{154,107},{154,108},{154,109},{154,110},{154,111},{154,112},{154,113},{154,114},{154,115},{154,116},{154,117},{154,118},{154,119},{154,120},{154,121},{154,122},{154,123},{154,124},{154,125},{154,126},{154,127},{154,128},{154,129},{154,130},{154,131},{154,132},{154,133},{154,134},{154,135},{154,136},{154,137},{154,138},{154,139},{154,140},{154,141},{154,142},{154,143},{154,144},{154,145},{154,146},{154,147},{154,148},{154,149},{154,150},{153,0},{153,1},{153,2},{153,3},{153,4},{153,5},{153,6},{153,7},{153,8},{153,9},{153,10},{153,11},{153,12},{153,13},{153,14},{153,15},{153,16},{153,17},{153,18},{153,19},{153,20},{153,21},{153,22},{153,23},{153,24},{153,25},{153,26},{153,27},{153,28},{153,29},{153,30},{153,31},{153,32},{153,33},{153,34},{153,35},{153,36},{153,37},{153,38},{153,39},{153,40},{153,41},{153,42},{153,43},{153,44},{153,45},{153,46},{153,47},{153,48},{153,49},{153,50},{153,51},{153,52},{153,53},{153,54},{153,55},{153,56},{153,57},{153,58},{153,59},{153,60},{153,61},{153,62},{153,63},{153,64},{153,65},{153,66},{153,67},{153,68},{153,69},{153,70},{153,71},{153,72},{153,73},{153,74},{153,75},{153,76},{153,77},{153,78},{153,79},{153,80},{153,81},{153,82},{153,83},{153,84},{153,85},{153,86},{153,87},{153,88},{153,89},{153,90},{153,91},{153,92},{153,93},{153,94},{153,95},{153,96},{153,97},{153,98},{153,99},{153,100},{153,101},{153,102},{153,103},{153,104},{153,105},{153,106},{153,107},{153,108},{153,109},{153,110},{153,111},{153,112},{153,113},{153,114},{153,115},{153,116},{153,117},{153,118},{153,119},{153,120},{153,121},{153,122},{153,123},{153,124},{153,125},{153,126},{153,127},{153,128},{153,129},{153,130},{153,131},{153,132},{153,133},{153,134},{153,135},{153,136},{153,137},{153,138},{153,139},{153,140},{153,141},{153,142},{153,143},{153,144},{153,145},{153,146},{153,147},{153,148},{153,149},{153,150},{152,0},{152,1},{152,2},{152,3},{152,4},{152,5},{152,6},{152,7},{152,8},{152,9},{152,10},{152,11},{152,12},{152,13},{152,14},{152,15},{152,16},{152,17},{152,18},{152,19},{152,20},{152,21},{152,22},{152,23},{152,24},{152,25},{152,26},{152,27},{152,28},{152,29},{152,30},{152,31},{152,32},{152,33},{152,34},{152,35},{152,36},{152,37},{152,38},{152,39},{152,40},{152,41},{152,42},{152,43},{152,44},{152,45},{152,46},{152,47},{152,48},{152,49},{152,50},{152,51},{152,52},{152,53},{152,54},{152,55},{152,56},{152,57},{152,58},{152,59},{152,60},{152,61},{152,62},{152,63},{152,64},{152,65},{152,66},{152,67},{152,68},{152,69},{152,70},{152,71},{152,72},{152,73},{152,74},{152,75},{152,76},{152,77},{152,78},{152,79},{152,80},{152,81},{152,82},{152,83},{152,84},{152,85},{152,86},{152,87},{152,88},{152,89},{152,90},{152,91},{152,92},{152,93},{152,94},{152,95},{152,96},{152,97},{152,98},{152,99},{152,100},{152,101},{152,102},{152,103},{152,104},{152,105},{152,106},{152,107},{152,108},{152,109},{152,110},{152,111},{152,112},{152,113},{152,114},{152,115},{152,116},{152,117},{152,118},{152,119},{152,120},{152,121},{152,122},{152,123},{152,124},{152,125},{152,126},{152,127},{152,128},{152,129},{152,130},{152,131},{152,132},{152,133},{152,134},{152,135},{152,136},{152,137},{152,138},{152,139},{152,140},{152,141},{152,142},{152,143},{152,144},{152,145},{152,146},{152,147},{152,148},{152,149},{152,150},{151,0},{151,1},{151,2},{151,3},{151,4},{151,5},{151,6},{151,7},{151,8},{151,9},{151,10},{151,11},{151,12},{151,13},{151,14},{151,15},{151,16},{151,17},{151,18},{151,19},{151,20},{151,21},{151,22},{151,23},{151,24},{151,25},{151,26},{151,27},{151,28},{151,29},{151,30},{151,31},{151,32},{151,33},{151,34},{151,35},{151,36},{151,37},{151,38},{151,39},{151,40},{151,41},{151,42},{151,43},{151,44},{151,45},{151,46},{151,47},{151,48},{151,49},{151,50},{151,51},{151,52},{151,53},{151,54},{151,55},{151,56},{151,57},{151,58},{151,59},{151,60},{151,61},{151,62},{151,63},{151,64},{151,65},{151,66},{151,67},{151,68},{151,69},{151,70},{151,71},{151,72},{151,73},{151,74},{151,75},{151,76},{151,77},{151,78},{151,79},{151,80},{151,81},{151,82},{151,83},{151,84},{151,85},{151,86},{151,87},{151,88},{151,89},{151,90},{151,91},{151,92},{151,93},{151,94},{151,95},{151,96},{151,97},{151,98},{151,99},{151,100},{151,101},{151,102},{151,103},{151,104},{151,105},{151,106},{151,107},{151,108},{151,109},{151,110},{151,111},{151,112},{151,113},{151,114},{151,115},{151,116},{151,117},{151,118},{151,119},{151,120},{151,121},{151,122},{151,123},{151,124},{151,125},{151,126},{151,127},{151,128},{151,129},{151,130},{151,131},{151,132},{151,133},{151,134},{151,135},{151,136},{151,137},{151,138},{151,139},{151,140},{151,141},{151,142},{151,143},{151,144},{151,145},{151,146},{151,147},{151,148},{151,149},{151,150},{150,0},{150,1},{150,2},{150,3},{150,4},{150,5},{150,6},{150,7},{150,8},{150,9},{150,10},{150,11},{150,12},{150,13},{150,14},{150,15},{150,16},{150,17},{150,18},{150,19},{150,20},{150,21},{150,22},{150,23},{150,24},{150,25},{150,26},{150,27},{150,28},{150,29},{150,30},{150,31},{150,32},{150,33},{150,34},{150,35},{150,36},{150,37},{150,38},{150,39},{150,40},{150,41},{150,42},{150,43},{150,44},{150,45},{150,46},{150,47},{150,48},{150,49},{150,50},{150,51},{150,52},{150,53},{150,54},{150,55},{150,56},{150,57},{150,58},{150,59},{150,60},{150,61},{150,62},{150,63},{150,64},{150,65},{150,66},{150,67},{150,68},{150,69},{150,70},{150,71},{150,72},{150,73},{150,74},{150,75},{150,76},{150,77},{150,78},{150,79},{150,80},{150,81},{150,82},{150,83},{150,84},{150,85},{150,86},{150,87},{150,88},{150,89},{150,90},{150,91},{150,92},{150,93},{150,94},{150,95},{150,96},{150,97},{150,98},{150,99},{150,100},{150,101},{150,102},{150,103},{150,104},{150,105},{150,106},{150,107},{150,108},{150,109},{150,110},{150,111},{150,112},{150,113},{150,114},{150,115},{150,116},{150,117},{150,118},{150,119},{150,120},{150,121},{150,122},{150,123},{150,124},{150,125},{150,126},{150,127},{150,128},{150,129},{150,130},{150,131},{150,132},{150,133},{150,134},{150,135},{150,136},{150,137},{150,138},{150,139},{150,140},{150,141},{150,142},{150,143},{150,144},{150,145},{150,146},{150,147},{150,148},{150,149},{150,150},{149,0},{149,1},{149,2},{149,3},{149,4},{149,5},{149,6},{149,7},{149,8},{149,9},{149,10},{149,11},{149,12},{149,13},{149,14},{149,15},{149,16},{149,17},{149,18},{149,19},{149,20},{149,21},{149,22},{149,23},{149,24},{149,25},{149,26},{149,27},{149,28},{149,29},{149,30},{149,31},{149,32},{149,33},{149,34},{149,35},{149,36},{149,37},{149,38},{149,39},{149,40},{149,41},{149,42},{149,43},{149,44},{149,45},{149,46},{149,47},{149,48},{149,49},{149,50},{149,51},{149,52},{149,53},{149,54},{149,55},{149,56},{149,57},{149,58},{149,59},{149,60},{149,61},{149,62},{149,63},{149,64},{149,65},{149,66},{149,67},{149,68},{149,69},{149,70},{149,71},{149,72},{149,73},{149,74},{149,75},{149,76},{149,77},{149,78},{149,79},{149,80},{149,81},{149,82},{149,83},{149,84},{149,85},{149,86},{149,87},{149,88},{149,89},{149,90},{149,91},{149,92},{149,93},{149,94},{149,95},{149,96},{149,97},{149,98},{149,99},{149,100},{149,101},{149,102},{149,103},{149,104},{149,105},{149,106},{149,107},{149,108},{149,109},{149,110},{149,111},{149,112},{149,113},{149,114},{149,115},{149,116},{149,117},{149,118},{149,119},{149,120},{149,121},{149,122},{149,123},{149,124},{149,125},{149,126},{149,127},{149,128},{149,129},{149,130},{149,131},{149,132},{149,133},{149,134},{149,135},{149,136},{149,137},{149,138},{149,139},{149,140},{149,141},{149,142},{149,143},{149,144},{149,145},{149,146},{149,147},{149,148},{149,149},{149,150},{148,0},{148,1},{148,2},{148,3},{148,4},{148,5},{148,6},{148,7},{148,8},{148,9},{148,10},{148,11},{148,12},{148,13},{148,14},{148,15},{148,16},{148,17},{148,18},{148,19},{148,20},{148,21},{148,22},{148,23},{148,24},{148,25},{148,26},{148,27},{148,28},{148,29},{148,30},{148,31},{148,32},{148,33},{148,34},{148,35},{148,36},{148,37},{148,38},{148,39},{148,40},{148,41},{148,42},{148,43},{148,44},{148,45},{148,46},{148,47},{148,48},{148,49},{148,50},{148,51},{148,52},{148,53},{148,54},{148,55},{148,56},{148,57},{148,58},{148,59},{148,60},{148,61},{148,62},{148,63},{148,64},{148,65},{148,66},{148,67},{148,68},{148,69},{148,70},{148,71},{148,72},{148,73},{148,74},{148,75},{148,76},{148,77},{148,78},{148,79},{148,80},{148,81},{148,82},{148,83},{148,84},{148,85},{148,86},{148,87},{148,88},{148,89},{148,90},{148,91},{148,92},{148,93},{148,94},{148,95},{148,96},{148,97},{148,98},{148,99},{148,100},{148,101},{148,102},{148,103},{148,104},{148,105},{148,106},{148,107},{148,108},{148,109},{148,110},{148,111},{148,112},{148,113},{148,114},{148,115},{148,116},{148,117},{148,118},{148,119},{148,120},{148,121},{148,122},{148,123},{148,124},{148,125},{148,126},{148,127},{148,128},{148,129},{148,130},{148,131},{148,132},{148,133},{148,134},{148,135},{148,136},{148,137},{148,138},{148,139},{148,140},{148,141},{148,142},{148,143},{148,144},{148,145},{148,146},{148,147},{148,148},{148,149},{148,150},{147,0},{147,1},{147,2},{147,3},{147,4},{147,5},{147,6},{147,7},{147,8},{147,9},{147,10},{147,11},{147,12},{147,13},{147,14},{147,15},{147,16},{147,17},{147,18},{147,19},{147,20},{147,21},{147,22},{147,23},{147,24},{147,25},{147,26},{147,27},{147,28},{147,29},{147,30},{147,31},{147,32},{147,33},{147,34},{147,35},{147,36},{147,37},{147,38},{147,39},{147,40},{147,41},{147,42},{147,43},{147,44},{147,45},{147,46},{147,47},{147,48},{147,49},{147,50},{147,51},{147,52},{147,53},{147,54},{147,55},{147,56},{147,57},{147,58},{147,59},{147,60},{147,61},{147,62},{147,63},{147,64},{147,65},{147,66},{147,67},{147,68},{147,69},{147,70},{147,71},{147,72},{147,73},{147,74},{147,75},{147,76},{147,77},{147,78},{147,79},{147,80},{147,81},{147,82},{147,83},{147,84},{147,85},{147,86},{147,87},{147,88},{147,89},{147,90},{147,91},{147,92},{147,93},{147,94},{147,95},{147,96},{147,97},{147,98},{147,99},{147,100},{147,101},{147,102},{147,103},{147,104},{147,105},{147,106},{147,107},{147,108},{147,109},{147,110},{147,111},{147,112},{147,113},{147,114},{147,115},{147,116},{147,117},{147,118},{147,119},{147,120},{147,121},{147,122},{147,123},{147,124},{147,125},{147,126},{147,127},{147,128},{147,129},{147,130},{147,131},{147,132},{147,133},{147,134},{147,135},{147,136},{147,137},{147,138},{147,139},{147,140},{147,141},{147,142},{147,143},{147,144},{147,145},{147,146},{147,147},{147,148},{147,149},{147,150},{146,0},{146,1},{146,2},{146,3},{146,4},{146,5},{146,6},{146,7},{146,8},{146,9},{146,10},{146,11},{146,12},{146,13},{146,14},{146,15},{146,16},{146,17},{146,18},{146,19},{146,20},{146,21},{146,22},{146,23},{146,24},{146,25},{146,26},{146,27},{146,28},{146,29},{146,30},{146,31},{146,32},{146,33},{146,34},{146,35},{146,36},{146,37},{146,38},{146,39},{146,40},{146,41},{146,42},{146,43},{146,44},{146,45},{146,46},{146,47},{146,48},{146,49},{146,50},{146,51},{146,52},{146,53},{146,54},{146,55},{146,56},{146,57},{146,58},{146,59},{146,60},{146,61},{146,62},{146,63},{146,64},{146,65},{146,66},{146,67},{146,68},{146,69},{146,70},{146,71},{146,72},{146,73},{146,74},{146,75},{146,76},{146,77},{146,78},{146,79},{146,80},{146,81},{146,82},{146,83},{146,84},{146,85},{146,86},{146,87},{146,88},{146,89},{146,90},{146,91},{146,92},{146,93},{146,94},{146,95},{146,96},{146,97},{146,98},{146,99},{146,100},{146,101},{146,102},{146,103},{146,104},{146,105},{146,106},{146,107},{146,108},{146,109},{146,110},{146,111},{146,112},{146,113},{146,114},{146,115},{146,116},{146,117},{146,118},{146,119},{146,120},{146,121},{146,122},{146,123},{146,124},{146,125},{146,126},{146,127},{146,128},{146,129},{146,130},{146,131},{146,132},{146,133},{146,134},{146,135},{146,136},{146,137},{146,138},{146,139},{146,140},{146,141},{146,142},{146,143},{146,144},{146,145},{146,146},{146,147},{146,148},{146,149},{146,150},{145,0},{145,1},{145,2},{145,3},{145,4},{145,5},{145,6},{145,7},{145,8},{145,9},{145,10},{145,11},{145,12},{145,13},{145,14},{145,15},{145,16},{145,17},{145,18},{145,19},{145,20},{145,21},{145,22},{145,23},{145,24},{145,25},{145,26},{145,27},{145,28},{145,29},{145,30},{145,31},{145,32},{145,33},{145,34},{145,35},{145,36},{145,37},{145,38},{145,39},{145,40},{145,41},{145,42},{145,43},{145,44},{145,45},{145,46},{145,47},{145,48},{145,49},{145,50},{145,51},{145,52},{145,53},{145,54},{145,55},{145,56},{145,57},{145,58},{145,59},{145,60},{145,61},{145,62},{145,63},{145,64},{145,65},{145,66},{145,67},{145,68},{145,69},{145,70},{145,71},{145,72},{145,73},{145,74},{145,75},{145,76},{145,77},{145,78},{145,79},{145,80},{145,81},{145,82},{145,83},{145,84},{145,85},{145,86},{145,87},{145,88},{145,89},{145,90},{145,91},{145,92},{145,93},{145,94},{145,95},{145,96},{145,97},{145,98},{145,99},{145,100},{145,101},{145,102},{145,103},{145,104},{145,105},{145,106},{145,107},{145,108},{145,109},{145,110},{145,111},{145,112},{145,113},{145,114},{145,115},{145,116},{145,117},{145,118},{145,119},{145,120},{145,121},{145,122},{145,123},{145,124},{145,125},{145,126},{145,127},{145,128},{145,129},{145,130},{145,131},{145,132},{145,133},{145,134},{145,135},{145,136},{145,137},{145,138},{145,139},{145,140},{145,141},{145,142},{145,143},{145,144},{145,145},{145,146},{145,147},{145,148},{145,149},{145,150},{144,0},{144,1},{144,2},{144,3},{144,4},{144,5},{144,6},{144,7},{144,8},{144,9},{144,10},{144,11},{144,12},{144,13},{144,14},{144,15},{144,16},{144,17},{144,18},{144,19},{144,20},{144,21},{144,22},{144,23},{144,24},{144,25},{144,26},{144,27},{144,28},{144,29},{144,30},{144,31},{144,32},{144,33},{144,34},{144,35},{144,36},{144,37},{144,38},{144,39},{144,40},{144,41},{144,42},{144,43},{144,44},{144,45},{144,46},{144,47},{144,48},{144,49},{144,50},{144,51},{144,52},{144,53},{144,54},{144,55},{144,56},{144,57},{144,58},{144,59},{144,60},{144,61},{144,62},{144,63},{144,64},{144,65},{144,66},{144,67},{144,68},{144,69},{144,70},{144,71},{144,72},{144,73},{144,74},{144,75},{144,76},{144,77},{144,78},{144,79},{144,80},{144,81},{144,82},{144,83},{144,84},{144,85},{144,86},{144,87},{144,88},{144,89},{144,90},{144,91},{144,92},{144,93},{144,94},{144,95},{144,96},{144,97},{144,98},{144,99},{144,100},{144,101},{144,102},{144,103},{144,104},{144,105},{144,106},{144,107},{144,108},{144,109},{144,110},{144,111},{144,112},{144,113},{144,114},{144,115},{144,116},{144,117},{144,118},{144,119},{144,120},{144,121},{144,122},{144,123},{144,124},{144,125},{144,126},{144,127},{144,128},{144,129},{144,130},{144,131},{144,132},{144,133},{144,134},{144,135},{144,136},{144,137},{144,138},{144,139},{144,140},{144,141},{144,142},{144,143},{144,144},{144,145},{144,146},{144,147},{144,148},{144,149},{144,150},{143,0},{143,1},{143,2},{143,3},{143,4},{143,5},{143,6},{143,7},{143,8},{143,9},{143,10},{143,11},{143,12},{143,13},{143,14},{143,15},{143,16},{143,17},{143,18},{143,19},{143,20},{143,21},{143,22},{143,23},{143,24},{143,25},{143,26},{143,27},{143,28},{143,29},{143,30},{143,31},{143,32},{143,33},{143,34},{143,35},{143,36},{143,37},{143,38},{143,39},{143,40},{143,41},{143,42},{143,43},{143,44},{143,45},{143,46},{143,47},{143,48},{143,49},{143,50},{143,51},{143,52},{143,53},{143,54},{143,55},{143,56},{143,57},{143,58},{143,59},{143,60},{143,61},{143,62},{143,63},{143,64},{143,65},{143,66},{143,67},{143,68},{143,69},{143,70},{143,71},{143,72},{143,73},{143,74},{143,75},{143,76},{143,77},{143,78},{143,79},{143,80},{143,81},{143,82},{143,83},{143,84},{143,85},{143,86},{143,87},{143,88},{143,89},{143,90},{143,91},{143,92},{143,93},{143,94},{143,95},{143,96},{143,97},{143,98},{143,99},{143,100},{143,101},{143,102},{143,103},{143,104},{143,105},{143,106},{143,107},{143,108},{143,109},{143,110},{143,111},{143,112},{143,113},{143,114},{143,115},{143,116},{143,117},{143,118},{143,119},{143,120},{143,121},{143,122},{143,123},{143,124},{143,125},{143,126},{143,127},{143,128},{143,129},{143,130},{143,131},{143,132},{143,133},{143,134},{143,135},{143,136},{143,137},{143,138},{143,139},{143,140},{143,141},{143,142},{143,143},{143,144},{143,145},{143,146},{143,147},{143,148},{143,149},{143,150},{142,0},{142,1},{142,2},{142,3},{142,4},{142,5},{142,6},{142,7},{142,8},{142,9},{142,10},{142,11},{142,12},{142,13},{142,14},{142,15},{142,16},{142,17},{142,18},{142,19},{142,20},{142,21},{142,22},{142,23},{142,24},{142,25},{142,26},{142,27},{142,28},{142,29},{142,30},{142,31},{142,32},{142,33},{142,34},{142,35},{142,36},{142,37},{142,38},{142,39},{142,40},{142,41},{142,42},{142,43},{142,44},{142,45},{142,46},{142,47},{142,48},{142,49},{142,50},{142,51},{142,52},{142,53},{142,54},{142,55},{142,56},{142,57},{142,58},{142,59},{142,60},{142,61},{142,62},{142,63},{142,64},{142,65},{142,66},{142,67},{142,68},{142,69},{142,70},{142,71},{142,72},{142,73},{142,74},{142,75},{142,76},{142,77},{142,78},{142,79},{142,80},{142,81},{142,82},{142,83},{142,84},{142,85},{142,86},{142,87},{142,88},{142,89},{142,90},{142,91},{142,92},{142,93},{142,94},{142,95},{142,96},{142,97},{142,98},{142,99},{142,100},{142,101},{142,102},{142,103},{142,104},{142,105},{142,106},{142,107},{142,108},{142,109},{142,110},{142,111},{142,112},{142,113},{142,114},{142,115},{142,116},{142,117},{142,118},{142,119},{142,120},{142,121},{142,122},{142,123},{142,124},{142,125},{142,126},{142,127},{142,128},{142,129},{142,130},{142,131},{142,132},{142,133},{142,134},{142,135},{142,136},{142,137},{142,138},{142,139},{142,140},{142,141},{142,142},{142,143},{142,144},{142,145},{142,146},{142,147},{142,148},{142,149},{142,150},{141,0},{141,1},{141,2},{141,3},{141,4},{141,5},{141,6},{141,7},{141,8},{141,9},{141,10},{141,11},{141,12},{141,13},{141,14},{141,15},{141,16},{141,17},{141,18},{141,19},{141,20},{141,21},{141,22},{141,23},{141,24},{141,25},{141,26},{141,27},{141,28},{141,29},{141,30},{141,31},{141,32},{141,33},{141,34},{141,35},{141,36},{141,37},{141,38},{141,39},{141,40},{141,41},{141,42},{141,43},{141,44},{141,45},{141,46},{141,47},{141,48},{141,49},{141,50},{141,51},{141,52},{141,53},{141,54},{141,55},{141,56},{141,57},{141,58},{141,59},{141,60},{141,61},{141,62},{141,63},{141,64},{141,65},{141,66},{141,67},{141,68},{141,69},{141,70},{141,71},{141,72},{141,73},{141,74},{141,75},{141,76},{141,77},{141,78},{141,79},{141,80},{141,81},{141,82},{141,83},{141,84},{141,85},{141,86},{141,87},{141,88},{141,89},{141,90},{141,91},{141,92},{141,93},{141,94},{141,95},{141,96},{141,97},{141,98},{141,99},{141,100},{141,101},{141,102},{141,103},{141,104},{141,105},{141,106},{141,107},{141,108},{141,109},{141,110},{141,111},{141,112},{141,113},{141,114},{141,115},{141,116},{141,117},{141,118},{141,119},{141,120},{141,121},{141,122},{141,123},{141,124},{141,125},{141,126},{141,127},{141,128},{141,129},{141,130},{141,131},{141,132},{141,133},{141,134},{141,135},{141,136},{141,137},{141,138},{141,139},{141,140},{141,141},{141,142},{141,143},{141,144},{141,145},{141,146},{141,147},{141,148},{141,149},{141,150},{140,0},{140,1},{140,2},{140,3},{140,4},{140,5},{140,6},{140,7},{140,8},{140,9},{140,10},{140,11},{140,12},{140,13},{140,14},{140,15},{140,16},{140,17},{140,18},{140,19},{140,20},{140,21},{140,22},{140,23},{140,24},{140,25},{140,26},{140,27},{140,28},{140,29},{140,30},{140,31},{140,32},{140,33},{140,34},{140,35},{140,36},{140,37},{140,38},{140,39},{140,40},{140,41},{140,42},{140,43},{140,44},{140,45},{140,46},{140,47},{140,48},{140,49},{140,50},{140,51},{140,52},{140,53},{140,54},{140,55},{140,56},{140,57},{140,58},{140,59},{140,60},{140,61},{140,62},{140,63},{140,64},{140,65},{140,66},{140,67},{140,68},{140,69},{140,70},{140,71},{140,72},{140,73},{140,74},{140,75},{140,76},{140,77},{140,78},{140,79},{140,80},{140,81},{140,82},{140,83},{140,84},{140,85},{140,86},{140,87},{140,88},{140,89},{140,90},{140,91},{140,92},{140,93},{140,94},{140,95},{140,96},{140,97},{140,98},{140,99},{140,100},{140,101},{140,102},{140,103},{140,104},{140,105},{140,106},{140,107},{140,108},{140,109},{140,110},{140,111},{140,112},{140,113},{140,114},{140,115},{140,116},{140,117},{140,118},{140,119},{140,120},{140,121},{140,122},{140,123},{140,124},{140,125},{140,126},{140,127},{140,128},{140,129},{140,130},{140,131},{140,132},{140,133},{140,134},{140,135},{140,136},{140,137},{140,138},{140,139},{140,140},{140,141},{140,142},{140,143},{140,144},{140,145},{140,146},{140,147},{140,148},{140,149},{140,150},{139,0},{139,1},{139,2},{139,3},{139,4},{139,5},{139,6},{139,7},{139,8},{139,9},{139,10},{139,11},{139,12},{139,13},{139,14},{139,15},{139,16},{139,17},{139,18},{139,19},{139,20},{139,21},{139,22},{139,23},{139,24},{139,25},{139,26},{139,27},{139,28},{139,29},{139,30},{139,31},{139,32},{139,33},{139,34},{139,35},{139,36},{139,37},{139,38},{139,39},{139,40},{139,41},{139,42},{139,43},{139,44},{139,45},{139,46},{139,47},{139,48},{139,49},{139,50},{139,51},{139,52},{139,53},{139,54},{139,55},{139,56},{139,57},{139,58},{139,59},{139,60},{139,61},{139,62},{139,63},{139,64},{139,65},{139,66},{139,67},{139,68},{139,69},{139,70},{139,71},{139,72},{139,73},{139,74},{139,75},{139,76},{139,77},{139,78},{139,79},{139,80},{139,81},{139,82},{139,83},{139,84},{139,85},{139,86},{139,87},{139,88},{139,89},{139,90},{139,91},{139,92},{139,93},{139,94},{139,95},{139,96},{139,97},{139,98},{139,99},{139,100},{139,101},{139,102},{139,103},{139,104},{139,105},{139,106},{139,107},{139,108},{139,109},{139,110},{139,111},{139,112},{139,113},{139,114},{139,115},{139,116},{139,117},{139,118},{139,119},{139,120},{139,121},{139,122},{139,123},{139,124},{139,125},{139,126},{139,127},{139,128},{139,129},{139,130},{139,131},{139,132},{139,133},{139,134},{139,135},{139,136},{139,137},{139,138},{139,139},{139,140},{139,141},{139,142},{139,143},{139,144},{139,145},{139,146},{139,147},{139,148},{139,149},{139,150},{138,0},{138,1},{138,2},{138,3},{138,4},{138,5},{138,6},{138,7},{138,8},{138,9},{138,10},{138,11},{138,12},{138,13},{138,14},{138,15},{138,16},{138,17},{138,18},{138,19},{138,20},{138,21},{138,22},{138,23},{138,24},{138,25},{138,26},{138,27},{138,28},{138,29},{138,30},{138,31},{138,32},{138,33},{138,34},{138,35},{138,36},{138,37},{138,38},{138,39},{138,40},{138,41},{138,42},{138,43},{138,44},{138,45},{138,46},{138,47},{138,48},{138,49},{138,50},{138,51},{138,52},{138,53},{138,54},{138,55},{138,56},{138,57},{138,58},{138,59},{138,60},{138,61},{138,62},{138,63},{138,64},{138,65},{138,66},{138,67},{138,68},{138,69},{138,70},{138,71},{138,72},{138,73},{138,74},{138,75},{138,76},{138,77},{138,78},{138,79},{138,80},{138,81},{138,82},{138,83},{138,84},{138,85},{138,86},{138,87},{138,88},{138,89},{138,90},{138,91},{138,92},{138,93},{138,94},{138,95},{138,96},{138,97},{138,98},{138,99},{138,100},{138,101},{138,102},{138,103},{138,104},{138,105},{138,106},{138,107},{138,108},{138,109},{138,110},{138,111},{138,112},{138,113},{138,114},{138,115},{138,116},{138,117},{138,118},{138,119},{138,120},{138,121},{138,122},{138,123},{138,124},{138,125},{138,126},{138,127},{138,128},{138,129},{138,130},{138,131},{138,132},{138,133},{138,134},{138,135},{138,136},{138,137},{138,138},{138,139},{138,140},{138,141},{138,142},{138,143},{138,144},{138,145},{138,146},{138,147},{138,148},{138,149},{138,150},{137,0},{137,1},{137,2},{137,3},{137,4},{137,5},{137,6},{137,7},{137,8},{137,9},{137,10},{137,11},{137,12},{137,13},{137,14},{137,15},{137,16},{137,17},{137,18},{137,19},{137,20},{137,21},{137,22},{137,23},{137,24},{137,25},{137,26},{137,27},{137,28},{137,29},{137,30},{137,31},{137,32},{137,33},{137,34},{137,35},{137,36},{137,37},{137,38},{137,39},{137,40},{137,41},{137,42},{137,43},{137,44},{137,45},{137,46},{137,47},{137,48},{137,49},{137,50},{137,51},{137,52},{137,53},{137,54},{137,55},{137,56},{137,57},{137,58},{137,59},{137,60},{137,61},{137,62},{137,63},{137,64},{137,65},{137,66},{137,67},{137,68},{137,69},{137,70},{137,71},{137,72},{137,73},{137,74},{137,75},{137,76},{137,77},{137,78},{137,79},{137,80},{137,81},{137,82},{137,83},{137,84},{137,85},{137,86},{137,87},{137,88},{137,89},{137,90},{137,91},{137,92},{137,93},{137,94},{137,95},{137,96},{137,97},{137,98},{137,99},{137,100},{137,101},{137,102},{137,103},{137,104},{137,105},{137,106},{137,107},{137,108},{137,109},{137,110},{137,111},{137,112},{137,113},{137,114},{137,115},{137,116},{137,117},{137,118},{137,119},{137,120},{137,121},{137,122},{137,123},{137,124},{137,125},{137,126},{137,127},{137,128},{137,129},{137,130},{137,131},{137,132},{137,133},{137,134},{137,135},{137,136},{137,137},{137,138},{137,139},{137,140},{137,141},{137,142},{137,143},{137,144},{137,145},{137,146},{137,147},{137,148},{137,149},{137,150},{136,0},{136,1},{136,2},{136,3},{136,4},{136,5},{136,6},{136,7},{136,8},{136,9},{136,10},{136,11},{136,12},{136,13},{136,14},{136,15},{136,16},{136,17},{136,18},{136,19},{136,20},{136,21},{136,22},{136,23},{136,24},{136,25},{136,26},{136,27},{136,28},{136,29},{136,30},{136,31},{136,32},{136,33},{136,34},{136,35},{136,36},{136,37},{136,38},{136,39},{136,40},{136,41},{136,42},{136,43},{136,44},{136,45},{136,46},{136,47},{136,48},{136,49},{136,50},{136,51},{136,52},{136,53},{136,54},{136,55},{136,56},{136,57},{136,58},{136,59},{136,60},{136,61},{136,62},{136,63},{136,64},{136,65},{136,66},{136,67},{136,68},{136,69},{136,70},{136,71},{136,72},{136,73},{136,74},{136,75},{136,76},{136,77},{136,78},{136,79},{136,80},{136,81},{136,82},{136,83},{136,84},{136,85},{136,86},{136,87},{136,88},{136,89},{136,90},{136,91},{136,92},{136,93},{136,94},{136,95},{136,96},{136,97},{136,98},{136,99},{136,100},{136,101},{136,102},{136,103},{136,104},{136,105},{136,106},{136,107},{136,108},{136,109},{136,110},{136,111},{136,112},{136,113},{136,114},{136,115},{136,116},{136,117},{136,118},{136,119},{136,120},{136,121},{136,122},{136,123},{136,124},{136,125},{136,126},{136,127},{136,128},{136,129},{136,130},{136,131},{136,132},{136,133},{136,134},{136,135},{136,136},{136,137},{136,138},{136,139},{136,140},{136,141},{136,142},{136,143},{136,144},{136,145},{136,146},{136,147},{136,148},{136,149},{136,150},{135,0},{135,1},{135,2},{135,3},{135,4},{135,5},{135,6},{135,7},{135,8},{135,9},{135,10},{135,11},{135,12},{135,13},{135,14},{135,15},{135,16},{135,17},{135,18},{135,19},{135,20},{135,21},{135,22},{135,23},{135,24},{135,25},{135,26},{135,27},{135,28},{135,29},{135,30},{135,31},{135,32},{135,33},{135,34},{135,35},{135,36},{135,37},{135,38},{135,39},{135,40},{135,41},{135,42},{135,43},{135,44},{135,45},{135,46},{135,47},{135,48},{135,49},{135,50},{135,51},{135,52},{135,53},{135,54},{135,55},{135,56},{135,57},{135,58},{135,59},{135,60},{135,61},{135,62},{135,63},{135,64},{135,65},{135,66},{135,67},{135,68},{135,69},{135,70},{135,71},{135,72},{135,73},{135,74},{135,75},{135,76},{135,77},{135,78},{135,79},{135,80},{135,81},{135,82},{135,83},{135,84},{135,85},{135,86},{135,87},{135,88},{135,89},{135,90},{135,91},{135,92},{135,93},{135,94},{135,95},{135,96},{135,97},{135,98},{135,99},{135,100},{135,101},{135,102},{135,103},{135,104},{135,105},{135,106},{135,107},{135,108},{135,109},{135,110},{135,111},{135,112},{135,113},{135,114},{135,115},{135,116},{135,117},{135,118},{135,119},{135,120},{135,121},{135,122},{135,123},{135,124},{135,125},{135,126},{135,127},{135,128},{135,129},{135,130},{135,131},{135,132},{135,133},{135,134},{135,135},{135,136},{135,137},{135,138},{135,139},{135,140},{135,141},{135,142},{135,143},{135,144},{135,145},{135,146},{135,147},{135,148},{135,149},{135,150},{134,0},{134,1},{134,2},{134,3},{134,4},{134,5},{134,6},{134,7},{134,8},{134,9},{134,10},{134,11},{134,12},{134,13},{134,14},{134,15},{134,16},{134,17},{134,18},{134,19},{134,20},{134,21},{134,22},{134,23},{134,24},{134,25},{134,26},{134,27},{134,28},{134,29},{134,30},{134,31},{134,32},{134,33},{134,34},{134,35},{134,36},{134,37},{134,38},{134,39},{134,40},{134,41},{134,42},{134,43},{134,44},{134,45},{134,46},{134,47},{134,48},{134,49},{134,50},{134,51},{134,52},{134,53},{134,54},{134,55},{134,56},{134,57},{134,58},{134,59},{134,60},{134,61},{134,62},{134,63},{134,64},{134,65},{134,66},{134,67},{134,68},{134,69},{134,70},{134,71},{134,72},{134,73},{134,74},{134,75},{134,76},{134,77},{134,78},{134,79},{134,80},{134,81},{134,82},{134,83},{134,84},{134,85},{134,86},{134,87},{134,88},{134,89},{134,90},{134,91},{134,92},{134,93},{134,94},{134,95},{134,96},{134,97},{134,98},{134,99},{134,100},{134,101},{134,102},{134,103},{134,104},{134,105},{134,106},{134,107},{134,108},{134,109},{134,110},{134,111},{134,112},{134,113},{134,114},{134,115},{134,116},{134,117},{134,118},{134,119},{134,120},{134,121},{134,122},{134,123},{134,124},{134,125},{134,126},{134,127},{134,128},{134,129},{134,130},{134,131},{134,132},{134,133},{134,134},{134,135},{134,136},{134,137},{134,138},{134,139},{134,140},{134,141},{134,142},{134,143},{134,144},{134,145},{134,146},{134,147},{134,148},{134,149},{134,150},{133,0},{133,1},{133,2},{133,3},{133,4},{133,5},{133,6},{133,7},{133,8},{133,9},{133,10},{133,11},{133,12},{133,13},{133,14},{133,15},{133,16},{133,17},{133,18},{133,19},{133,20},{133,21},{133,22},{133,23},{133,24},{133,25},{133,26},{133,27},{133,28},{133,29},{133,30},{133,31},{133,32},{133,33},{133,34},{133,35},{133,36},{133,37},{133,38},{133,39},{133,40},{133,41},{133,42},{133,43},{133,44},{133,45},{133,46},{133,47},{133,48},{133,49},{133,50},{133,51},{133,52},{133,53},{133,54},{133,55},{133,56},{133,57},{133,58},{133,59},{133,60},{133,61},{133,62},{133,63},{133,64},{133,65},{133,66},{133,67},{133,68},{133,69},{133,70},{133,71},{133,72},{133,73},{133,74},{133,75},{133,76},{133,77},{133,78},{133,79},{133,80},{133,81},{133,82},{133,83},{133,84},{133,85},{133,86},{133,87},{133,88},{133,89},{133,90},{133,91},{133,92},{133,93},{133,94},{133,95},{133,96},{133,97},{133,98},{133,99},{133,100},{133,101},{133,102},{133,103},{133,104},{133,105},{133,106},{133,107},{133,108},{133,109},{133,110},{133,111},{133,112},{133,113},{133,114},{133,115},{133,116},{133,117},{133,118},{133,119},{133,120},{133,121},{133,122},{133,123},{133,124},{133,125},{133,126},{133,127},{133,128},{133,129},{133,130},{133,131},{133,132},{133,133},{133,134},{133,135},{133,136},{133,137},{133,138},{133,139},{133,140},{133,141},{133,142},{133,143},{133,144},{133,145},{133,146},{133,147},{133,148},{133,149},{133,150},{132,0},{132,1},{132,2},{132,3},{132,4},{132,5},{132,6},{132,7},{132,8},{132,9},{132,10},{132,11},{132,12},{132,13},{132,14},{132,15},{132,16},{132,17},{132,18},{132,19},{132,20},{132,21},{132,22},{132,23},{132,24},{132,25},{132,26},{132,27},{132,28},{132,29},{132,30},{132,31},{132,32},{132,33},{132,34},{132,35},{132,36},{132,37},{132,38},{132,39},{132,40},{132,41},{132,42},{132,43},{132,44},{132,45},{132,46},{132,47},{132,48},{132,49},{132,50},{132,51},{132,52},{132,53},{132,54},{132,55},{132,56},{132,57},{132,58},{132,59},{132,60},{132,61},{132,62},{132,63},{132,64},{132,65},{132,66},{132,67},{132,68},{132,69},{132,70},{132,71},{132,72},{132,73},{132,74},{132,75},{132,76},{132,77},{132,78},{132,79},{132,80},{132,81},{132,82},{132,83},{132,84},{132,85},{132,86},{132,87},{132,88},{132,89},{132,90},{132,91},{132,92},{132,93},{132,94},{132,95},{132,96},{132,97},{132,98},{132,99},{132,100},{132,101},{132,102},{132,103},{132,104},{132,105},{132,106},{132,107},{132,108},{132,109},{132,110},{132,111},{132,112},{132,113},{132,114},{132,115},{132,116},{132,117},{132,118},{132,119},{132,120},{132,121},{132,122},{132,123},{132,124},{132,125},{132,126},{132,127},{132,128},{132,129},{132,130},{132,131},{132,132},{132,133},{132,134},{132,135},{132,136},{132,137},{132,138},{132,139},{132,140},{132,141},{132,142},{132,143},{132,144},{132,145},{132,146},{132,147},{132,148},{132,149},{132,150},{131,0},{131,1},{131,2},{131,3},{131,4},{131,5},{131,6},{131,7},{131,8},{131,9},{131,10},{131,11},{131,12},{131,13},{131,14},{131,15},{131,16},{131,17},{131,18},{131,19},{131,20},{131,21},{131,22},{131,23},{131,24},{131,25},{131,26},{131,27},{131,28},{131,29},{131,30},{131,31},{131,32},{131,33},{131,34},{131,35},{131,36},{131,37},{131,38},{131,39},{131,40},{131,41},{131,42},{131,43},{131,44},{131,45},{131,46},{131,47},{131,48},{131,49},{131,50},{131,51},{131,52},{131,53},{131,54},{131,55},{131,56},{131,57},{131,58},{131,59},{131,60},{131,61},{131,62},{131,63},{131,64},{131,65},{131,66},{131,67},{131,68},{131,69},{131,70},{131,71},{131,72},{131,73},{131,74},{131,75},{131,76},{131,77},{131,78},{131,79},{131,80},{131,81},{131,82},{131,83},{131,84},{131,85},{131,86},{131,87},{131,88},{131,89},{131,90},{131,91},{131,92},{131,93},{131,94},{131,95},{131,96},{131,97},{131,98},{131,99},{131,100},{131,101},{131,102},{131,103},{131,104},{131,105},{131,106},{131,107},{131,108},{131,109},{131,110},{131,111},{131,112},{131,113},{131,114},{131,115},{131,116},{131,117},{131,118},{131,119},{131,120},{131,121},{131,122},{131,123},{131,124},{131,125},{131,126},{131,127},{131,128},{131,129},{131,130},{131,131},{131,132},{131,133},{131,134},{131,135},{131,136},{131,137},{131,138},{131,139},{131,140},{131,141},{131,142},{131,143},{131,144},{131,145},{131,146},{131,147},{131,148},{131,149},{131,150},{130,0},{130,1},{130,2},{130,3},{130,4},{130,5},{130,6},{130,7},{130,8},{130,9},{130,10},{130,11},{130,12},{130,13},{130,14},{130,15},{130,16},{130,17},{130,18},{130,19},{130,20},{130,21},{130,22},{130,23},{130,24},{130,25},{130,26},{130,27},{130,28},{130,29},{130,30},{130,31},{130,32},{130,33},{130,34},{130,35},{130,36},{130,37},{130,38},{130,39},{130,40},{130,41},{130,42},{130,43},{130,44},{130,45},{130,46},{130,47},{130,48},{130,49},{130,50},{130,51},{130,52},{130,53},{130,54},{130,55},{130,56},{130,57},{130,58},{130,59},{130,60},{130,61},{130,62},{130,63},{130,64},{130,65},{130,66},{130,67},{130,68},{130,69},{130,70},{130,71},{130,72},{130,73},{130,74},{130,75},{130,76},{130,77},{130,78},{130,79},{130,80},{130,81},{130,82},{130,83},{130,84},{130,85},{130,86},{130,87},{130,88},{130,89},{130,90},{130,91},{130,92},{130,93},{130,94},{130,95},{130,96},{130,97},{130,98},{130,99},{130,100},{130,101},{130,102},{130,103},{130,104},{130,105},{130,106},{130,107},{130,108},{130,109},{130,110},{130,111},{130,112},{130,113},{130,114},{130,115},{130,116},{130,117},{130,118},{130,119},{130,120},{130,121},{130,122},{130,123},{130,124},{130,125},{130,126},{130,127},{130,128},{130,129},{130,130},{130,131},{130,132},{130,133},{130,134},{130,135},{130,136},{130,137},{130,138},{130,139},{130,140},{130,141},{130,142},{130,143},{130,144},{130,145},{130,146},{130,147},{130,148},{130,149},{130,150},{129,0},{129,1},{129,2},{129,3},{129,4},{129,5},{129,6},{129,7},{129,8},{129,9},{129,10},{129,11},{129,12},{129,13},{129,14},{129,15},{129,16},{129,17},{129,18},{129,19},{129,20},{129,21},{129,22},{129,23},{129,24},{129,25},{129,26},{129,27},{129,28},{129,29},{129,30},{129,31},{129,32},{129,33},{129,34},{129,35},{129,36},{129,37},{129,38},{129,39},{129,40},{129,41},{129,42},{129,43},{129,44},{129,45},{129,46},{129,47},{129,48},{129,49},{129,50},{129,51},{129,52},{129,53},{129,54},{129,55},{129,56},{129,57},{129,58},{129,59},{129,60},{129,61},{129,62},{129,63},{129,64},{129,65},{129,66},{129,67},{129,68},{129,69},{129,70},{129,71},{129,72},{129,73},{129,74},{129,75},{129,76},{129,77},{129,78},{129,79},{129,80},{129,81},{129,82},{129,83},{129,84},{129,85},{129,86},{129,87},{129,88},{129,89},{129,90},{129,91},{129,92},{129,93},{129,94},{129,95},{129,96},{129,97},{129,98},{129,99},{129,100},{129,101},{129,102},{129,103},{129,104},{129,105},{129,106},{129,107},{129,108},{129,109},{129,110},{129,111},{129,112},{129,113},{129,114},{129,115},{129,116},{129,117},{129,118},{129,119},{129,120},{129,121},{129,122},{129,123},{129,124},{129,125},{129,126},{129,127},{129,128},{129,129},{129,130},{129,131},{129,132},{129,133},{129,134},{129,135},{129,136},{129,137},{129,138},{129,139},{129,140},{129,141},{129,142},{129,143},{129,144},{129,145},{129,146},{129,147},{129,148},{129,149},{129,150},{128,0},{128,1},{128,2},{128,3},{128,4},{128,5},{128,6},{128,7},{128,8},{128,9},{128,10},{128,11},{128,12},{128,13},{128,14},{128,15},{128,16},{128,17},{128,18},{128,19},{128,20},{128,21},{128,22},{128,23},{128,24},{128,25},{128,26},{128,27},{128,28},{128,29},{128,30},{128,31},{128,32},{128,33},{128,34},{128,35},{128,36},{128,37},{128,38},{128,39},{128,40},{128,41},{128,42},{128,43},{128,44},{128,45},{128,46},{128,47},{128,48},{128,49},{128,50},{128,51},{128,52},{128,53},{128,54},{128,55},{128,56},{128,57},{128,58},{128,59},{128,60},{128,61},{128,62},{128,63},{128,64},{128,65},{128,66},{128,67},{128,68},{128,69},{128,70},{128,71},{128,72},{128,73},{128,74},{128,75},{128,76},{128,77},{128,78},{128,79},{128,80},{128,81},{128,82},{128,83},{128,84},{128,85},{128,86},{128,87},{128,88},{128,89},{128,90},{128,91},{128,92},{128,93},{128,94},{128,95},{128,96},{128,97},{128,98},{128,99},{128,100},{128,101},{128,102},{128,103},{128,104},{128,105},{128,106},{128,107},{128,108},{128,109},{128,110},{128,111},{128,112},{128,113},{128,114},{128,115},{128,116},{128,117},{128,118},{128,119},{128,120},{128,121},{128,122},{128,123},{128,124},{128,125},{128,126},{128,127},{128,128},{128,129},{128,130},{128,131},{128,132},{128,133},{128,134},{128,135},{128,136},{128,137},{128,138},{128,139},{128,140},{128,141},{128,142},{128,143},{128,144},{128,145},{128,146},{128,147},{128,148},{128,149},{128,150},{127,0},{127,1},{127,2},{127,3},{127,4},{127,5},{127,6},{127,7},{127,8},{127,9},{127,10},{127,11},{127,12},{127,13},{127,14},{127,15},{127,16},{127,17},{127,18},{127,19},{127,20},{127,21},{127,22},{127,23},{127,24},{127,25},{127,26},{127,27},{127,28},{127,29},{127,30},{127,31},{127,32},{127,33},{127,34},{127,35},{127,36},{127,37},{127,38},{127,39},{127,40},{127,41},{127,42},{127,43},{127,44},{127,45},{127,46},{127,47},{127,48},{127,49},{127,50},{127,51},{127,52},{127,53},{127,54},{127,55},{127,56},{127,57},{127,58},{127,59},{127,60},{127,61},{127,62},{127,63},{127,64},{127,65},{127,66},{127,67},{127,68},{127,69},{127,70},{127,71},{127,72},{127,73},{127,74},{127,75},{127,76},{127,77},{127,78},{127,79},{127,80},{127,81},{127,82},{127,83},{127,84},{127,85},{127,86},{127,87},{127,88},{127,89},{127,90},{127,91},{127,92},{127,93},{127,94},{127,95},{127,96},{127,97},{127,98},{127,99},{127,100},{127,101},{127,102},{127,103},{127,104},{127,105},{127,106},{127,107},{127,108},{127,109},{127,110},{127,111},{127,112},{127,113},{127,114},{127,115},{127,116},{127,117},{127,118},{127,119},{127,120},{127,121},{127,122},{127,123},{127,124},{127,125},{127,126},{127,127},{127,128},{127,129},{127,130},{127,131},{127,132},{127,133},{127,134},{127,135},{127,136},{127,137},{127,138},{127,139},{127,140},{127,141},{127,142},{127,143},{127,144},{127,145},{127,146},{127,147},{127,148},{127,149},{127,150},{126,0},{126,1},{126,2},{126,3},{126,4},{126,5},{126,6},{126,7},{126,8},{126,9},{126,10},{126,11},{126,12},{126,13},{126,14},{126,15},{126,16},{126,17},{126,18},{126,19},{126,20},{126,21},{126,22},{126,23},{126,24},{126,25},{126,26},{126,27},{126,28},{126,29},{126,30},{126,31},{126,32},{126,33},{126,34},{126,35},{126,36},{126,37},{126,38},{126,39},{126,40},{126,41},{126,42},{126,43},{126,44},{126,45},{126,46},{126,47},{126,48},{126,49},{126,50},{126,51},{126,52},{126,53},{126,54},{126,55},{126,56},{126,57},{126,58},{126,59},{126,60},{126,61},{126,62},{126,63},{126,64},{126,65},{126,66},{126,67},{126,68},{126,69},{126,70},{126,71},{126,72},{126,73},{126,74},{126,75},{126,76},{126,77},{126,78},{126,79},{126,80},{126,81},{126,82},{126,83},{126,84},{126,85},{126,86},{126,87},{126,88},{126,89},{126,90},{126,91},{126,92},{126,93},{126,94},{126,95},{126,96},{126,97},{126,98},{126,99},{126,100},{126,101},{126,102},{126,103},{126,104},{126,105},{126,106},{126,107},{126,108},{126,109},{126,110},{126,111},{126,112},{126,113},{126,114},{126,115},{126,116},{126,117},{126,118},{126,119},{126,120},{126,121},{126,122},{126,123},{126,124},{126,125},{126,126},{126,127},{126,128},{126,129},{126,130},{126,131},{126,132},{126,133},{126,134},{126,135},{126,136},{126,137},{126,138},{126,139},{126,140},{126,141},{126,142},{126,143},{126,144},{126,145},{126,146},{126,147},{126,148},{126,149},{126,150},{125,0},{125,1},{125,2},{125,3},{125,4},{125,5},{125,6},{125,7},{125,8},{125,9},{125,10},{125,11},{125,12},{125,13},{125,14},{125,15},{125,16},{125,17},{125,18},{125,19},{125,20},{125,21},{125,22},{125,23},{125,24},{125,25},{125,26},{125,27},{125,28},{125,29},{125,30},{125,31},{125,32},{125,33},{125,34},{125,35},{125,36},{125,37},{125,38},{125,39},{125,40},{125,41},{125,42},{125,43},{125,44},{125,45},{125,46},{125,47},{125,48},{125,49},{125,50},{125,51},{125,52},{125,53},{125,54},{125,55},{125,56},{125,57},{125,58},{125,59},{125,60},{125,61},{125,62},{125,63},{125,64},{125,65},{125,66},{125,67},{125,68},{125,69},{125,70},{125,71},{125,72},{125,73},{125,74},{125,75},{125,76},{125,77},{125,78},{125,79},{125,80},{125,81},{125,82},{125,83},{125,84},{125,85},{125,86},{125,87},{125,88},{125,89},{125,90},{125,91},{125,92},{125,93},{125,94},{125,95},{125,96},{125,97},{125,98},{125,99},{125,100},{125,101},{125,102},{125,103},{125,104},{125,105},{125,106},{125,107},{125,108},{125,109},{125,110},{125,111},{125,112},{125,113},{125,114},{125,115},{125,116},{125,117},{125,118},{125,119},{125,120},{125,121},{125,122},{125,123},{125,124},{125,125},{125,126},{125,127},{125,128},{125,129},{125,130},{125,131},{125,132},{125,133},{125,134},{125,135},{125,136},{125,137},{125,138},{125,139},{125,140},{125,141},{125,142},{125,143},{125,144},{125,145},{125,146},{125,147},{125,148},{125,149},{125,150},{124,0},{124,1},{124,2},{124,3},{124,4},{124,5},{124,6},{124,7},{124,8},{124,9},{124,10},{124,11},{124,12},{124,13},{124,14},{124,15},{124,16},{124,17},{124,18},{124,19},{124,20},{124,21},{124,22},{124,23},{124,24},{124,25},{124,26},{124,27},{124,28},{124,29},{124,30},{124,31},{124,32},{124,33},{124,34},{124,35},{124,36},{124,37},{124,38},{124,39},{124,40},{124,41},{124,42},{124,43},{124,44},{124,45},{124,46},{124,47},{124,48},{124,49},{124,50},{124,51},{124,52},{124,53},{124,54},{124,55},{124,56},{124,57},{124,58},{124,59},{124,60},{124,61},{124,62},{124,63},{124,64},{124,65},{124,66},{124,67},{124,68},{124,69},{124,70},{124,71},{124,72},{124,73},{124,74},{124,75},{124,76},{124,77},{124,78},{124,79},{124,80},{124,81},{124,82},{124,83},{124,84},{124,85},{124,86},{124,87},{124,88},{124,89},{124,90},{124,91},{124,92},{124,93},{124,94},{124,95},{124,96},{124,97},{124,98},{124,99},{124,100},{124,101},{124,102},{124,103},{124,104},{124,105},{124,106},{124,107},{124,108},{124,109},{124,110},{124,111},{124,112},{124,113},{124,114},{124,115},{124,116},{124,117},{124,118},{124,119},{124,120},{124,121},{124,122},{124,123},{124,124},{124,125},{124,126},{124,127},{124,128},{124,129},{124,130},{124,131},{124,132},{124,133},{124,134},{124,135},{124,136},{124,137},{124,138},{124,139},{124,140},{124,141},{124,142},{124,143},{124,144},{124,145},{124,146},{124,147},{124,148},{124,149},{124,150},{123,0},{123,1},{123,2},{123,3},{123,4},{123,5},{123,6},{123,7},{123,8},{123,9},{123,10},{123,11},{123,12},{123,13},{123,14},{123,15},{123,16},{123,17},{123,18},{123,19},{123,20},{123,21},{123,22},{123,23},{123,24},{123,25},{123,26},{123,27},{123,28},{123,29},{123,30},{123,31},{123,32},{123,33},{123,34},{123,35},{123,36},{123,37},{123,38},{123,39},{123,40},{123,41},{123,42},{123,43},{123,44},{123,45},{123,46},{123,47},{123,48},{123,49},{123,50},{123,51},{123,52},{123,53},{123,54},{123,55},{123,56},{123,57},{123,58},{123,59},{123,60},{123,61},{123,62},{123,63},{123,64},{123,65},{123,66},{123,67},{123,68},{123,69},{123,70},{123,71},{123,72},{123,73},{123,74},{123,75},{123,76},{123,77},{123,78},{123,79},{123,80},{123,81},{123,82},{123,83},{123,84},{123,85},{123,86},{123,87},{123,88},{123,89},{123,90},{123,91},{123,92},{123,93},{123,94},{123,95},{123,96},{123,97},{123,98},{123,99},{123,100},{123,101},{123,102},{123,103},{123,104},{123,105},{123,106},{123,107},{123,108},{123,109},{123,110},{123,111},{123,112},{123,113},{123,114},{123,115},{123,116},{123,117},{123,118},{123,119},{123,120},{123,121},{123,122},{123,123},{123,124},{123,125},{123,126},{123,127},{123,128},{123,129},{123,130},{123,131},{123,132},{123,133},{123,134},{123,135},{123,136},{123,137},{123,138},{123,139},{123,140},{123,141},{123,142},{123,143},{123,144},{123,145},{123,146},{123,147},{123,148},{123,149},{123,150},{122,0},{122,1},{122,2},{122,3},{122,4},{122,5},{122,6},{122,7},{122,8},{122,9},{122,10},{122,11},{122,12},{122,13},{122,14},{122,15},{122,16},{122,17},{122,18},{122,19},{122,20},{122,21},{122,22},{122,23},{122,24},{122,25},{122,26},{122,27},{122,28},{122,29},{122,30},{122,31},{122,32},{122,33},{122,34},{122,35},{122,36},{122,37},{122,38},{122,39},{122,40},{122,41},{122,42},{122,43},{122,44},{122,45},{122,46},{122,47},{122,48},{122,49},{122,50},{122,51},{122,52},{122,53},{122,54},{122,55},{122,56},{122,57},{122,58},{122,59},{122,60},{122,61},{122,62},{122,63},{122,64},{122,65},{122,66},{122,67},{122,68},{122,69},{122,70},{122,71},{122,72},{122,73},{122,74},{122,75},{122,76},{122,77},{122,78},{122,79},{122,80},{122,81},{122,82},{122,83},{122,84},{122,85},{122,86},{122,87},{122,88},{122,89},{122,90},{122,91},{122,92},{122,93},{122,94},{122,95},{122,96},{122,97},{122,98},{122,99},{122,100},{122,101},{122,102},{122,103},{122,104},{122,105},{122,106},{122,107},{122,108},{122,109},{122,110},{122,111},{122,112},{122,113},{122,114},{122,115},{122,116},{122,117},{122,118},{122,119},{122,120},{122,121},{122,122},{122,123},{122,124},{122,125},{122,126},{122,127},{122,128},{122,129},{122,130},{122,131},{122,132},{122,133},{122,134},{122,135},{122,136},{122,137},{122,138},{122,139},{122,140},{122,141},{122,142},{122,143},{122,144},{122,145},{122,146},{122,147},{122,148},{122,149},{122,150},{121,0},{121,1},{121,2},{121,3},{121,4},{121,5},{121,6},{121,7},{121,8},{121,9},{121,10},{121,11},{121,12},{121,13},{121,14},{121,15},{121,16},{121,17},{121,18},{121,19},{121,20},{121,21},{121,22},{121,23},{121,24},{121,25},{121,26},{121,27},{121,28},{121,29},{121,30},{121,31},{121,32},{121,33},{121,34},{121,35},{121,36},{121,37},{121,38},{121,39},{121,40},{121,41},{121,42},{121,43},{121,44},{121,45},{121,46},{121,47},{121,48},{121,49},{121,50},{121,51},{121,52},{121,53},{121,54},{121,55},{121,56},{121,57},{121,58},{121,59},{121,60},{121,61},{121,62},{121,63},{121,64},{121,65},{121,66},{121,67},{121,68},{121,69},{121,70},{121,71},{121,72},{121,73},{121,74},{121,75},{121,76},{121,77},{121,78},{121,79},{121,80},{121,81},{121,82},{121,83},{121,84},{121,85},{121,86},{121,87},{121,88},{121,89},{121,90},{121,91},{121,92},{121,93},{121,94},{121,95},{121,96},{121,97},{121,98},{121,99},{121,100},{121,101},{121,102},{121,103},{121,104},{121,105},{121,106},{121,107},{121,108},{121,109},{121,110},{121,111},{121,112},{121,113},{121,114},{121,115},{121,116},{121,117},{121,118},{121,119},{121,120},{121,121},{121,122},{121,123},{121,124},{121,125},{121,126},{121,127},{121,128},{121,129},{121,130},{121,131},{121,132},{121,133},{121,134},{121,135},{121,136},{121,137},{121,138},{121,139},{121,140},{121,141},{121,142},{121,143},{121,144},{121,145},{121,146},{121,147},{121,148},{121,149},{121,150},{120,0},{120,1},{120,2},{120,3},{120,4},{120,5},{120,6},{120,7},{120,8},{120,9},{120,10},{120,11},{120,12},{120,13},{120,14},{120,15},{120,16},{120,17},{120,18},{120,19},{120,20},{120,21},{120,22},{120,23},{120,24},{120,25},{120,26},{120,27},{120,28},{120,29},{120,30},{120,31},{120,32},{120,33},{120,34},{120,35},{120,36},{120,37},{120,38},{120,39},{120,40},{120,41},{120,42},{120,43},{120,44},{120,45},{120,46},{120,47},{120,48},{120,49},{120,50},{120,51},{120,52},{120,53},{120,54},{120,55},{120,56},{120,57},{120,58},{120,59},{120,60},{120,61},{120,62},{120,63},{120,64},{120,65},{120,66},{120,67},{120,68},{120,69},{120,70},{120,71},{120,72},{120,73},{120,74},{120,75},{120,76},{120,77},{120,78},{120,79},{120,80},{120,81},{120,82},{120,83},{120,84},{120,85},{120,86},{120,87},{120,88},{120,89},{120,90},{120,91},{120,92},{120,93},{120,94},{120,95},{120,96},{120,97},{120,98},{120,99},{120,100},{120,101},{120,102},{120,103},{120,104},{120,105},{120,106},{120,107},{120,108},{120,109},{120,110},{120,111},{120,112},{120,113},{120,114},{120,115},{120,116},{120,117},{120,118},{120,119},{120,120},{120,121},{120,122},{120,123},{120,124},{120,125},{120,126},{120,127},{120,128},{120,129},{120,130},{120,131},{120,132},{120,133},{120,134},{120,135},{120,136},{120,137},{120,138},{120,139},{120,140},{120,141},{120,142},{120,143},{120,144},{120,145},{120,146},{120,147},{120,148},{120,149},{120,150},{119,0},{119,1},{119,2},{119,3},{119,4},{119,5},{119,6},{119,7},{119,8},{119,9},{119,10},{119,11},{119,12},{119,13},{119,14},{119,15},{119,16},{119,17},{119,18},{119,19},{119,20},{119,21},{119,22},{119,23},{119,24},{119,25},{119,26},{119,27},{119,28},{119,29},{119,30},{119,31},{119,32},{119,33},{119,34},{119,35},{119,36},{119,37},{119,38},{119,39},{119,40},{119,41},{119,42},{119,43},{119,44},{119,45},{119,46},{119,47},{119,48},{119,49},{119,50},{119,51},{119,52},{119,53},{119,54},{119,55},{119,56},{119,57},{119,58},{119,59},{119,60},{119,61},{119,62},{119,63},{119,64},{119,65},{119,66},{119,67},{119,68},{119,69},{119,70},{119,71},{119,72},{119,73},{119,74},{119,75},{119,76},{119,77},{119,78},{119,79},{119,80},{119,81},{119,82},{119,83},{119,84},{119,85},{119,86},{119,87},{119,88},{119,89},{119,90},{119,91},{119,92},{119,93},{119,94},{119,95},{119,96},{119,97},{119,98},{119,99},{119,100},{119,101},{119,102},{119,103},{119,104},{119,105},{119,106},{119,107},{119,108},{119,109},{119,110},{119,111},{119,112},{119,113},{119,114},{119,115},{119,116},{119,117},{119,118},{119,119},{119,120},{119,121},{119,122},{119,123},{119,124},{119,125},{119,126},{119,127},{119,128},{119,129},{119,130},{119,131},{119,132},{119,133},{119,134},{119,135},{119,136},{119,137},{119,138},{119,139},{119,140},{119,141},{119,142},{119,143},{119,144},{119,145},{119,146},{119,147},{119,148},{119,149},{119,150},{118,0},{118,1},{118,2},{118,3},{118,4},{118,5},{118,6},{118,7},{118,8},{118,9},{118,10},{118,11},{118,12},{118,13},{118,14},{118,15},{118,16},{118,17},{118,18},{118,19},{118,20},{118,21},{118,22},{118,23},{118,24},{118,25},{118,26},{118,27},{118,28},{118,29},{118,30},{118,31},{118,32},{118,33},{118,34},{118,35},{118,36},{118,37},{118,38},{118,39},{118,40},{118,41},{118,42},{118,43},{118,44},{118,45},{118,46},{118,47},{118,48},{118,49},{118,50},{118,51},{118,52},{118,53},{118,54},{118,55},{118,56},{118,57},{118,58},{118,59},{118,60},{118,61},{118,62},{118,63},{118,64},{118,65},{118,66},{118,67},{118,68},{118,69},{118,70},{118,71},{118,72},{118,73},{118,74},{118,75},{118,76},{118,77},{118,78},{118,79},{118,80},{118,81},{118,82},{118,83},{118,84},{118,85},{118,86},{118,87},{118,88},{118,89},{118,90},{118,91},{118,92},{118,93},{118,94},{118,95},{118,96},{118,97},{118,98},{118,99},{118,100},{118,101},{118,102},{118,103},{118,104},{118,105},{118,106},{118,107},{118,108},{118,109},{118,110},{118,111},{118,112},{118,113},{118,114},{118,115},{118,116},{118,117},{118,118},{118,119},{118,120},{118,121},{118,122},{118,123},{118,124},{118,125},{118,126},{118,127},{118,128},{118,129},{118,130},{118,131},{118,132},{118,133},{118,134},{118,135},{118,136},{118,137},{118,138},{118,139},{118,140},{118,141},{118,142},{118,143},{118,144},{118,145},{118,146},{118,147},{118,148},{118,149},{118,150},{117,0},{117,1},{117,2},{117,3},{117,4},{117,5},{117,6},{117,7},{117,8},{117,9},{117,10},{117,11},{117,12},{117,13},{117,14},{117,15},{117,16},{117,17},{117,18},{117,19},{117,20},{117,21},{117,22},{117,23},{117,24},{117,25},{117,26},{117,27},{117,28},{117,29},{117,30},{117,31},{117,32},{117,33},{117,34},{117,35},{117,36},{117,37},{117,38},{117,39},{117,40},{117,41},{117,42},{117,43},{117,44},{117,45},{117,46},{117,47},{117,48},{117,49},{117,50},{117,51},{117,52},{117,53},{117,54},{117,55},{117,56},{117,57},{117,58},{117,59},{117,60},{117,61},{117,62},{117,63},{117,64},{117,65},{117,66},{117,67},{117,68},{117,69},{117,70},{117,71},{117,72},{117,73},{117,74},{117,75},{117,76},{117,77},{117,78},{117,79},{117,80},{117,81},{117,82},{117,83},{117,84},{117,85},{117,86},{117,87},{117,88},{117,89},{117,90},{117,91},{117,92},{117,93},{117,94},{117,95},{117,96},{117,97},{117,98},{117,99},{117,100},{117,101},{117,102},{117,103},{117,104},{117,105},{117,106},{117,107},{117,108},{117,109},{117,110},{117,111},{117,112},{117,113},{117,114},{117,115},{117,116},{117,117},{117,118},{117,119},{117,120},{117,121},{117,122},{117,123},{117,124},{117,125},{117,126},{117,127},{117,128},{117,129},{117,130},{117,131},{117,132},{117,133},{117,134},{117,135},{117,136},{117,137},{117,138},{117,139},{117,140},{117,141},{117,142},{117,143},{117,144},{117,145},{117,146},{117,147},{117,148},{117,149},{117,150},{116,0},{116,1},{116,2},{116,3},{116,4},{116,5},{116,6},{116,7},{116,8},{116,9},{116,10},{116,11},{116,12},{116,13},{116,14},{116,15},{116,16},{116,17},{116,18},{116,19},{116,20},{116,21},{116,22},{116,23},{116,24},{116,25},{116,26},{116,27},{116,28},{116,29},{116,30},{116,31},{116,32},{116,33},{116,34},{116,35},{116,36},{116,37},{116,38},{116,39},{116,40},{116,41},{116,42},{116,43},{116,44},{116,45},{116,46},{116,47},{116,48},{116,49},{116,50},{116,51},{116,52},{116,53},{116,54},{116,55},{116,56},{116,57},{116,58},{116,59},{116,60},{116,61},{116,62},{116,63},{116,64},{116,65},{116,66},{116,67},{116,68},{116,69},{116,70},{116,71},{116,72},{116,73},{116,74},{116,75},{116,76},{116,77},{116,78},{116,79},{116,80},{116,81},{116,82},{116,83},{116,84},{116,85},{116,86},{116,87},{116,88},{116,89},{116,90},{116,91},{116,92},{116,93},{116,94},{116,95},{116,96},{116,97},{116,98},{116,99},{116,100},{116,101},{116,102},{116,103},{116,104},{116,105},{116,106},{116,107},{116,108},{116,109},{116,110},{116,111},{116,112},{116,113},{116,114},{116,115},{116,116},{116,117},{116,118},{116,119},{116,120},{116,121},{116,122},{116,123},{116,124},{116,125},{116,126},{116,127},{116,128},{116,129},{116,130},{116,131},{116,132},{116,133},{116,134},{116,135},{116,136},{116,137},{116,138},{116,139},{116,140},{116,141},{116,142},{116,143},{116,144},{116,145},{116,146},{116,147},{116,148},{116,149},{116,150},{115,0},{115,1},{115,2},{115,3},{115,4},{115,5},{115,6},{115,7},{115,8},{115,9},{115,10},{115,11},{115,12},{115,13},{115,14},{115,15},{115,16},{115,17},{115,18},{115,19},{115,20},{115,21},{115,22},{115,23},{115,24},{115,25},{115,26},{115,27},{115,28},{115,29},{115,30},{115,31},{115,32},{115,33},{115,34},{115,35},{115,36},{115,37},{115,38},{115,39},{115,40},{115,41},{115,42},{115,43},{115,44},{115,45},{115,46},{115,47},{115,48},{115,49},{115,50},{115,51},{115,52},{115,53},{115,54},{115,55},{115,56},{115,57},{115,58},{115,59},{115,60},{115,61},{115,62},{115,63},{115,64},{115,65},{115,66},{115,67},{115,68},{115,69},{115,70},{115,71},{115,72},{115,73},{115,74},{115,75},{115,76},{115,77},{115,78},{115,79},{115,80},{115,81},{115,82},{115,83},{115,84},{115,85},{115,86},{115,87},{115,88},{115,89},{115,90},{115,91},{115,92},{115,93},{115,94},{115,95},{115,96},{115,97},{115,98},{115,99},{115,100},{115,101},{115,102},{115,103},{115,104},{115,105},{115,106},{115,107},{115,108},{115,109},{115,110},{115,111},{115,112},{115,113},{115,114},{115,115},{115,116},{115,117},{115,118},{115,119},{115,120},{115,121},{115,122},{115,123},{115,124},{115,125},{115,126},{115,127},{115,128},{115,129},{115,130},{115,131},{115,132},{115,133},{115,134},{115,135},{115,136},{115,137},{115,138},{115,139},{115,140},{115,141},{115,142},{115,143},{115,144},{115,145},{115,146},{115,147},{115,148},{115,149},{115,150},{114,0},{114,1},{114,2},{114,3},{114,4},{114,5},{114,6},{114,7},{114,8},{114,9},{114,10},{114,11},{114,12},{114,13},{114,14},{114,15},{114,16},{114,17},{114,18},{114,19},{114,20},{114,21},{114,22},{114,23},{114,24},{114,25},{114,26},{114,27},{114,28},{114,29},{114,30},{114,31},{114,32},{114,33},{114,34},{114,35},{114,36},{114,37},{114,38},{114,39},{114,40},{114,41},{114,42},{114,43},{114,44},{114,45},{114,46},{114,47},{114,48},{114,49},{114,50},{114,51},{114,52},{114,53},{114,54},{114,55},{114,56},{114,57},{114,58},{114,59},{114,60},{114,61},{114,62},{114,63},{114,64},{114,65},{114,66},{114,67},{114,68},{114,69},{114,70},{114,71},{114,72},{114,73},{114,74},{114,75},{114,76},{114,77},{114,78},{114,79},{114,80},{114,81},{114,82},{114,83},{114,84},{114,85},{114,86},{114,87},{114,88},{114,89},{114,90},{114,91},{114,92},{114,93},{114,94},{114,95},{114,96},{114,97},{114,98},{114,99},{114,100},{114,101},{114,102},{114,103},{114,104},{114,105},{114,106},{114,107},{114,108},{114,109},{114,110},{114,111},{114,112},{114,113},{114,114},{114,115},{114,116},{114,117},{114,118},{114,119},{114,120},{114,121},{114,122},{114,123},{114,124},{114,125},{114,126},{114,127},{114,128},{114,129},{114,130},{114,131},{114,132},{114,133},{114,134},{114,135},{114,136},{114,137},{114,138},{114,139},{114,140},{114,141},{114,142},{114,143},{114,144},{114,145},{114,146},{114,147},{114,148},{114,149},{114,150},{113,0},{113,1},{113,2},{113,3},{113,4},{113,5},{113,6},{113,7},{113,8},{113,9},{113,10},{113,11},{113,12},{113,13},{113,14},{113,15},{113,16},{113,17},{113,18},{113,19},{113,20},{113,21},{113,22},{113,23},{113,24},{113,25},{113,26},{113,27},{113,28},{113,29},{113,30},{113,31},{113,32},{113,33},{113,34},{113,35},{113,36},{113,37},{113,38},{113,39},{113,40},{113,41},{113,42},{113,43},{113,44},{113,45},{113,46},{113,47},{113,48},{113,49},{113,50},{113,51},{113,52},{113,53},{113,54},{113,55},{113,56},{113,57},{113,58},{113,59},{113,60},{113,61},{113,62},{113,63},{113,64},{113,65},{113,66},{113,67},{113,68},{113,69},{113,70},{113,71},{113,72},{113,73},{113,74},{113,75},{113,76},{113,77},{113,78},{113,79},{113,80},{113,81},{113,82},{113,83},{113,84},{113,85},{113,86},{113,87},{113,88},{113,89},{113,90},{113,91},{113,92},{113,93},{113,94},{113,95},{113,96},{113,97},{113,98},{113,99},{113,100},{113,101},{113,102},{113,103},{113,104},{113,105},{113,106},{113,107},{113,108},{113,109},{113,110},{113,111},{113,112},{113,113},{113,114},{113,115},{113,116},{113,117},{113,118},{113,119},{113,120},{113,121},{113,122},{113,123},{113,124},{113,125},{113,126},{113,127},{113,128},{113,129},{113,130},{113,131},{113,132},{113,133},{113,134},{113,135},{113,136},{113,137},{113,138},{113,139},{113,140},{113,141},{113,142},{113,143},{113,144},{113,145},{113,146},{113,147},{113,148},{113,149},{113,150},{112,0},{112,1},{112,2},{112,3},{112,4},{112,5},{112,6},{112,7},{112,8},{112,9},{112,10},{112,11},{112,12},{112,13},{112,14},{112,15},{112,16},{112,17},{112,18},{112,19},{112,20},{112,21},{112,22},{112,23},{112,24},{112,25},{112,26},{112,27},{112,28},{112,29},{112,30},{112,31},{112,32},{112,33},{112,34},{112,35},{112,36},{112,37},{112,38},{112,39},{112,40},{112,41},{112,42},{112,43},{112,44},{112,45},{112,46},{112,47},{112,48},{112,49},{112,50},{112,51},{112,52},{112,53},{112,54},{112,55},{112,56},{112,57},{112,58},{112,59},{112,60},{112,61},{112,62},{112,63},{112,64},{112,65},{112,66},{112,67},{112,68},{112,69},{112,70},{112,71},{112,72},{112,73},{112,74},{112,75},{112,76},{112,77},{112,78},{112,79},{112,80},{112,81},{112,82},{112,83},{112,84},{112,85},{112,86},{112,87},{112,88},{112,89},{112,90},{112,91},{112,92},{112,93},{112,94},{112,95},{112,96},{112,97},{112,98},{112,99},{112,100},{112,101},{112,102},{112,103},{112,104},{112,105},{112,106},{112,107},{112,108},{112,109},{112,110},{112,111},{112,112},{112,113},{112,114},{112,115},{112,116},{112,117},{112,118},{112,119},{112,120},{112,121},{112,122},{112,123},{112,124},{112,125},{112,126},{112,127},{112,128},{112,129},{112,130},{112,131},{112,132},{112,133},{112,134},{112,135},{112,136},{112,137},{112,138},{112,139},{112,140},{112,141},{112,142},{112,143},{112,144},{112,145},{112,146},{112,147},{112,148},{112,149},{112,150},{111,0},{111,1},{111,2},{111,3},{111,4},{111,5},{111,6},{111,7},{111,8},{111,9},{111,10},{111,11},{111,12},{111,13},{111,14},{111,15},{111,16},{111,17},{111,18},{111,19},{111,20},{111,21},{111,22},{111,23},{111,24},{111,25},{111,26},{111,27},{111,28},{111,29},{111,30},{111,31},{111,32},{111,33},{111,34},{111,35},{111,36},{111,37},{111,38},{111,39},{111,40},{111,41},{111,42},{111,43},{111,44},{111,45},{111,46},{111,47},{111,48},{111,49},{111,50},{111,51},{111,52},{111,53},{111,54},{111,55},{111,56},{111,57},{111,58},{111,59},{111,60},{111,61},{111,62},{111,63},{111,64},{111,65},{111,66},{111,67},{111,68},{111,69},{111,70},{111,71},{111,72},{111,73},{111,74},{111,75},{111,76},{111,77},{111,78},{111,79},{111,80},{111,81},{111,82},{111,83},{111,84},{111,85},{111,86},{111,87},{111,88},{111,89},{111,90},{111,91},{111,92},{111,93},{111,94},{111,95},{111,96},{111,97},{111,98},{111,99},{111,100},{111,101},{111,102},{111,103},{111,104},{111,105},{111,106},{111,107},{111,108},{111,109},{111,110},{111,111},{111,112},{111,113},{111,114},{111,115},{111,116},{111,117},{111,118},{111,119},{111,120},{111,121},{111,122},{111,123},{111,124},{111,125},{111,126},{111,127},{111,128},{111,129},{111,130},{111,131},{111,132},{111,133},{111,134},{111,135},{111,136},{111,137},{111,138},{111,139},{111,140},{111,141},{111,142},{111,143},{111,144},{111,145},{111,146},{111,147},{111,148},{111,149},{111,150},{110,0},{110,1},{110,2},{110,3},{110,4},{110,5},{110,6},{110,7},{110,8},{110,9},{110,10},{110,11},{110,12},{110,13},{110,14},{110,15},{110,16},{110,17},{110,18},{110,19},{110,20},{110,21},{110,22},{110,23},{110,24},{110,25},{110,26},{110,27},{110,28},{110,29},{110,30},{110,31},{110,32},{110,33},{110,34},{110,35},{110,36},{110,37},{110,38},{110,39},{110,40},{110,41},{110,42},{110,43},{110,44},{110,45},{110,46},{110,47},{110,48},{110,49},{110,50},{110,51},{110,52},{110,53},{110,54},{110,55},{110,56},{110,57},{110,58},{110,59},{110,60},{110,61},{110,62},{110,63},{110,64},{110,65},{110,66},{110,67},{110,68},{110,69},{110,70},{110,71},{110,72},{110,73},{110,74},{110,75},{110,76},{110,77},{110,78},{110,79},{110,80},{110,81},{110,82},{110,83},{110,84},{110,85},{110,86},{110,87},{110,88},{110,89},{110,90},{110,91},{110,92},{110,93},{110,94},{110,95},{110,96},{110,97},{110,98},{110,99},{110,100},{110,101},{110,102},{110,103},{110,104},{110,105},{110,106},{110,107},{110,108},{110,109},{110,110},{110,111},{110,112},{110,113},{110,114},{110,115},{110,116},{110,117},{110,118},{110,119},{110,120},{110,121},{110,122},{110,123},{110,124},{110,125},{110,126},{110,127},{110,128},{110,129},{110,130},{110,131},{110,132},{110,133},{110,134},{110,135},{110,136},{110,137},{110,138},{110,139},{110,140},{110,141},{110,142},{110,143},{110,144},{110,145},{110,146},{110,147},{110,148},{110,149},{110,150},{109,0},{109,1},{109,2},{109,3},{109,4},{109,5},{109,6},{109,7},{109,8},{109,9},{109,10},{109,11},{109,12},{109,13},{109,14},{109,15},{109,16},{109,17},{109,18},{109,19},{109,20},{109,21},{109,22},{109,23},{109,24},{109,25},{109,26},{109,27},{109,28},{109,29},{109,30},{109,31},{109,32},{109,33},{109,34},{109,35},{109,36},{109,37},{109,38},{109,39},{109,40},{109,41},{109,42},{109,43},{109,44},{109,45},{109,46},{109,47},{109,48},{109,49},{109,50},{109,51},{109,52},{109,53},{109,54},{109,55},{109,56},{109,57},{109,58},{109,59},{109,60},{109,61},{109,62},{109,63},{109,64},{109,65},{109,66},{109,67},{109,68},{109,69},{109,70},{109,71},{109,72},{109,73},{109,74},{109,75},{109,76},{109,77},{109,78},{109,79},{109,80},{109,81},{109,82},{109,83},{109,84},{109,85},{109,86},{109,87},{109,88},{109,89},{109,90},{109,91},{109,92},{109,93},{109,94},{109,95},{109,96},{109,97},{109,98},{109,99},{109,100},{109,101},{109,102},{109,103},{109,104},{109,105},{109,106},{109,107},{109,108},{109,109},{109,110},{109,111},{109,112},{109,113},{109,114},{109,115},{109,116},{109,117},{109,118},{109,119},{109,120},{109,121},{109,122},{109,123},{109,124},{109,125},{109,126},{109,127},{109,128},{109,129},{109,130},{109,131},{109,132},{109,133},{109,134},{109,135},{109,136},{109,137},{109,138},{109,139},{109,140},{109,141},{109,142},{109,143},{109,144},{109,145},{109,146},{109,147},{109,148},{109,149},{109,150},{108,0},{108,1},{108,2},{108,3},{108,4},{108,5},{108,6},{108,7},{108,8},{108,9},{108,10},{108,11},{108,12},{108,13},{108,14},{108,15},{108,16},{108,17},{108,18},{108,19},{108,20},{108,21},{108,22},{108,23},{108,24},{108,25},{108,26},{108,27},{108,28},{108,29},{108,30},{108,31},{108,32},{108,33},{108,34},{108,35},{108,36},{108,37},{108,38},{108,39},{108,40},{108,41},{108,42},{108,43},{108,44},{108,45},{108,46},{108,47},{108,48},{108,49},{108,50},{108,51},{108,52},{108,53},{108,54},{108,55},{108,56},{108,57},{108,58},{108,59},{108,60},{108,61},{108,62},{108,63},{108,64},{108,65},{108,66},{108,67},{108,68},{108,69},{108,70},{108,71},{108,72},{108,73},{108,74},{108,75},{108,76},{108,77},{108,78},{108,79},{108,80},{108,81},{108,82},{108,83},{108,84},{108,85},{108,86},{108,87},{108,88},{108,89},{108,90},{108,91},{108,92},{108,93},{108,94},{108,95},{108,96},{108,97},{108,98},{108,99},{108,100},{108,101},{108,102},{108,103},{108,104},{108,105},{108,106},{108,107},{108,108},{108,109},{108,110},{108,111},{108,112},{108,113},{108,114},{108,115},{108,116},{108,117},{108,118},{108,119},{108,120},{108,121},{108,122},{108,123},{108,124},{108,125},{108,126},{108,127},{108,128},{108,129},{108,130},{108,131},{108,132},{108,133},{108,134},{108,135},{108,136},{108,137},{108,138},{108,139},{108,140},{108,141},{108,142},{108,143},{108,144},{108,145},{108,146},{108,147},{108,148},{108,149},{108,150},{107,0},{107,1},{107,2},{107,3},{107,4},{107,5},{107,6},{107,7},{107,8},{107,9},{107,10},{107,11},{107,12},{107,13},{107,14},{107,15},{107,16},{107,17},{107,18},{107,19},{107,20},{107,21},{107,22},{107,23},{107,24},{107,25},{107,26},{107,27},{107,28},{107,29},{107,30},{107,31},{107,32},{107,33},{107,34},{107,35},{107,36},{107,37},{107,38},{107,39},{107,40},{107,41},{107,42},{107,43},{107,44},{107,45},{107,46},{107,47},{107,48},{107,49},{107,50},{107,51},{107,52},{107,53},{107,54},{107,55},{107,56},{107,57},{107,58},{107,59},{107,60},{107,61},{107,62},{107,63},{107,64},{107,65},{107,66},{107,67},{107,68},{107,69},{107,70},{107,71},{107,72},{107,73},{107,74},{107,75},{107,76},{107,77},{107,78},{107,79},{107,80},{107,81},{107,82},{107,83},{107,84},{107,85},{107,86},{107,87},{107,88},{107,89},{107,90},{107,91},{107,92},{107,93},{107,94},{107,95},{107,96},{107,97},{107,98},{107,99},{107,100},{107,101},{107,102},{107,103},{107,104},{107,105},{107,106},{107,107},{107,108},{107,109},{107,110},{107,111},{107,112},{107,113},{107,114},{107,115},{107,116},{107,117},{107,118},{107,119},{107,120},{107,121},{107,122},{107,123},{107,124},{107,125},{107,126},{107,127},{107,128},{107,129},{107,130},{107,131},{107,132},{107,133},{107,134},{107,135},{107,136},{107,137},{107,138},{107,139},{107,140},{107,141},{107,142},{107,143},{107,144},{107,145},{107,146},{107,147},{107,148},{107,149},{107,150},{106,0},{106,1},{106,2},{106,3},{106,4},{106,5},{106,6},{106,7},{106,8},{106,9},{106,10},{106,11},{106,12},{106,13},{106,14},{106,15},{106,16},{106,17},{106,18},{106,19},{106,20},{106,21},{106,22},{106,23},{106,24},{106,25},{106,26},{106,27},{106,28},{106,29},{106,30},{106,31},{106,32},{106,33},{106,34},{106,35},{106,36},{106,37},{106,38},{106,39},{106,40},{106,41},{106,42},{106,43},{106,44},{106,45},{106,46},{106,47},{106,48},{106,49},{106,50},{106,51},{106,52},{106,53},{106,54},{106,55},{106,56},{106,57},{106,58},{106,59},{106,60},{106,61},{106,62},{106,63},{106,64},{106,65},{106,66},{106,67},{106,68},{106,69},{106,70},{106,71},{106,72},{106,73},{106,74},{106,75},{106,76},{106,77},{106,78},{106,79},{106,80},{106,81},{106,82},{106,83},{106,84},{106,85},{106,86},{106,87},{106,88},{106,89},{106,90},{106,91},{106,92},{106,93},{106,94},{106,95},{106,96},{106,97},{106,98},{106,99},{106,100},{106,101},{106,102},{106,103},{106,104},{106,105},{106,106},{106,107},{106,108},{106,109},{106,110},{106,111},{106,112},{106,113},{106,114},{106,115},{106,116},{106,117},{106,118},{106,119},{106,120},{106,121},{106,122},{106,123},{106,124},{106,125},{106,126},{106,127},{106,128},{106,129},{106,130},{106,131},{106,132},{106,133},{106,134},{106,135},{106,136},{106,137},{106,138},{106,139},{106,140},{106,141},{106,142},{106,143},{106,144},{106,145},{106,146},{106,147},{106,148},{106,149},{106,150},{105,0},{105,1},{105,2},{105,3},{105,4},{105,5},{105,6},{105,7},{105,8},{105,9},{105,10},{105,11},{105,12},{105,13},{105,14},{105,15},{105,16},{105,17},{105,18},{105,19},{105,20},{105,21},{105,22},{105,23},{105,24},{105,25},{105,26},{105,27},{105,28},{105,29},{105,30},{105,31},{105,32},{105,33},{105,34},{105,35},{105,36},{105,37},{105,38},{105,39},{105,40},{105,41},{105,42},{105,43},{105,44},{105,45},{105,46},{105,47},{105,48},{105,49},{105,50},{105,51},{105,52},{105,53},{105,54},{105,55},{105,56},{105,57},{105,58},{105,59},{105,60},{105,61},{105,62},{105,63},{105,64},{105,65},{105,66},{105,67},{105,68},{105,69},{105,70},{105,71},{105,72},{105,73},{105,74},{105,75},{105,76},{105,77},{105,78},{105,79},{105,80},{105,81},{105,82},{105,83},{105,84},{105,85},{105,86},{105,87},{105,88},{105,89},{105,90},{105,91},{105,92},{105,93},{105,94},{105,95},{105,96},{105,97},{105,98},{105,99},{105,100},{105,101},{105,102},{105,103},{105,104},{105,105},{105,106},{105,107},{105,108},{105,109},{105,110},{105,111},{105,112},{105,113},{105,114},{105,115},{105,116},{105,117},{105,118},{105,119},{105,120},{105,121},{105,122},{105,123},{105,124},{105,125},{105,126},{105,127},{105,128},{105,129},{105,130},{105,131},{105,132},{105,133},{105,134},{105,135},{105,136},{105,137},{105,138},{105,139},{105,140},{105,141},{105,142},{105,143},{105,144},{105,145},{105,146},{105,147},{105,148},{105,149},{105,150},{104,0},{104,1},{104,2},{104,3},{104,4},{104,5},{104,6},{104,7},{104,8},{104,9},{104,10},{104,11},{104,12},{104,13},{104,14},{104,15},{104,16},{104,17},{104,18},{104,19},{104,20},{104,21},{104,22},{104,23},{104,24},{104,25},{104,26},{104,27},{104,28},{104,29},{104,30},{104,31},{104,32},{104,33},{104,34},{104,35},{104,36},{104,37},{104,38},{104,39},{104,40},{104,41},{104,42},{104,43},{104,44},{104,45},{104,46},{104,47},{104,48},{104,49},{104,50},{104,51},{104,52},{104,53},{104,54},{104,55},{104,56},{104,57},{104,58},{104,59},{104,60},{104,61},{104,62},{104,63},{104,64},{104,65},{104,66},{104,67},{104,68},{104,69},{104,70},{104,71},{104,72},{104,73},{104,74},{104,75},{104,76},{104,77},{104,78},{104,79},{104,80},{104,81},{104,82},{104,83},{104,84},{104,85},{104,86},{104,87},{104,88},{104,89},{104,90},{104,91},{104,92},{104,93},{104,94},{104,95},{104,96},{104,97},{104,98},{104,99},{104,100},{104,101},{104,102},{104,103},{104,104},{104,105},{104,106},{104,107},{104,108},{104,109},{104,110},{104,111},{104,112},{104,113},{104,114},{104,115},{104,116},{104,117},{104,118},{104,119},{104,120},{104,121},{104,122},{104,123},{104,124},{104,125},{104,126},{104,127},{104,128},{104,129},{104,130},{104,131},{104,132},{104,133},{104,134},{104,135},{104,136},{104,137},{104,138},{104,139},{104,140},{104,141},{104,142},{104,143},{104,144},{104,145},{104,146},{104,147},{104,148},{104,149},{104,150},{103,0},{103,1},{103,2},{103,3},{103,4},{103,5},{103,6},{103,7},{103,8},{103,9},{103,10},{103,11},{103,12},{103,13},{103,14},{103,15},{103,16},{103,17},{103,18},{103,19},{103,20},{103,21},{103,22},{103,23},{103,24},{103,25},{103,26},{103,27},{103,28},{103,29},{103,30},{103,31},{103,32},{103,33},{103,34},{103,35},{103,36},{103,37},{103,38},{103,39},{103,40},{103,41},{103,42},{103,43},{103,44},{103,45},{103,46},{103,47},{103,48},{103,49},{103,50},{103,51},{103,52},{103,53},{103,54},{103,55},{103,56},{103,57},{103,58},{103,59},{103,60},{103,61},{103,62},{103,63},{103,64},{103,65},{103,66},{103,67},{103,68},{103,69},{103,70},{103,71},{103,72},{103,73},{103,74},{103,75},{103,76},{103,77},{103,78},{103,79},{103,80},{103,81},{103,82},{103,83},{103,84},{103,85},{103,86},{103,87},{103,88},{103,89},{103,90},{103,91},{103,92},{103,93},{103,94},{103,95},{103,96},{103,97},{103,98},{103,99},{103,100},{103,101},{103,102},{103,103},{103,104},{103,105},{103,106},{103,107},{103,108},{103,109},{103,110},{103,111},{103,112},{103,113},{103,114},{103,115},{103,116},{103,117},{103,118},{103,119},{103,120},{103,121},{103,122},{103,123},{103,124},{103,125},{103,126},{103,127},{103,128},{103,129},{103,130},{103,131},{103,132},{103,133},{103,134},{103,135},{103,136},{103,137},{103,138},{103,139},{103,140},{103,141},{103,142},{103,143},{103,144},{103,145},{103,146},{103,147},{103,148},{103,149},{103,150},{102,0},{102,1},{102,2},{102,3},{102,4},{102,5},{102,6},{102,7},{102,8},{102,9},{102,10},{102,11},{102,12},{102,13},{102,14},{102,15},{102,16},{102,17},{102,18},{102,19},{102,20},{102,21},{102,22},{102,23},{102,24},{102,25},{102,26},{102,27},{102,28},{102,29},{102,30},{102,31},{102,32},{102,33},{102,34},{102,35},{102,36},{102,37},{102,38},{102,39},{102,40},{102,41},{102,42},{102,43},{102,44},{102,45},{102,46},{102,47},{102,48},{102,49},{102,50},{102,51},{102,52},{102,53},{102,54},{102,55},{102,56},{102,57},{102,58},{102,59},{102,60},{102,61},{102,62},{102,63},{102,64},{102,65},{102,66},{102,67},{102,68},{102,69},{102,70},{102,71},{102,72},{102,73},{102,74},{102,75},{102,76},{102,77},{102,78},{102,79},{102,80},{102,81},{102,82},{102,83},{102,84},{102,85},{102,86},{102,87},{102,88},{102,89},{102,90},{102,91},{102,92},{102,93},{102,94},{102,95},{102,96},{102,97},{102,98},{102,99},{102,100},{102,101},{102,102},{102,103},{102,104},{102,105},{102,106},{102,107},{102,108},{102,109},{102,110},{102,111},{102,112},{102,113},{102,114},{102,115},{102,116},{102,117},{102,118},{102,119},{102,120},{102,121},{102,122},{102,123},{102,124},{102,125},{102,126},{102,127},{102,128},{102,129},{102,130},{102,131},{102,132},{102,133},{102,134},{102,135},{102,136},{102,137},{102,138},{102,139},{102,140},{102,141},{102,142},{102,143},{102,144},{102,145},{102,146},{102,147},{102,148},{102,149},{102,150},{101,0},{101,1},{101,2},{101,3},{101,4},{101,5},{101,6},{101,7},{101,8},{101,9},{101,10},{101,11},{101,12},{101,13},{101,14},{101,15},{101,16},{101,17},{101,18},{101,19},{101,20},{101,21},{101,22},{101,23},{101,24},{101,25},{101,26},{101,27},{101,28},{101,29},{101,30},{101,31},{101,32},{101,33},{101,34},{101,35},{101,36},{101,37},{101,38},{101,39},{101,40},{101,41},{101,42},{101,43},{101,44},{101,45},{101,46},{101,47},{101,48},{101,49},{101,50},{101,51},{101,52},{101,53},{101,54},{101,55},{101,56},{101,57},{101,58},{101,59},{101,60},{101,61},{101,62},{101,63},{101,64},{101,65},{101,66},{101,67},{101,68},{101,69},{101,70},{101,71},{101,72},{101,73},{101,74},{101,75},{101,76},{101,77},{101,78},{101,79},{101,80},{101,81},{101,82},{101,83},{101,84},{101,85},{101,86},{101,87},{101,88},{101,89},{101,90},{101,91},{101,92},{101,93},{101,94},{101,95},{101,96},{101,97},{101,98},{101,99},{101,100},{101,101},{101,102},{101,103},{101,104},{101,105},{101,106},{101,107},{101,108},{101,109},{101,110},{101,111},{101,112},{101,113},{101,114},{101,115},{101,116},{101,117},{101,118},{101,119},{101,120},{101,121},{101,122},{101,123},{101,124},{101,125},{101,126},{101,127},{101,128},{101,129},{101,130},{101,131},{101,132},{101,133},{101,134},{101,135},{101,136},{101,137},{101,138},{101,139},{101,140},{101,141},{101,142},{101,143},{101,144},{101,145},{101,146},{101,147},{101,148},{101,149},{101,150},{100,0},{100,1},{100,2},{100,3},{100,4},{100,5},{100,6},{100,7},{100,8},{100,9},{100,10},{100,11},{100,12},{100,13},{100,14},{100,15},{100,16},{100,17},{100,18},{100,19},{100,20},{100,21},{100,22},{100,23},{100,24},{100,25},{100,26},{100,27},{100,28},{100,29},{100,30},{100,31},{100,32},{100,33},{100,34},{100,35},{100,36},{100,37},{100,38},{100,39},{100,40},{100,41},{100,42},{100,43},{100,44},{100,45},{100,46},{100,47},{100,48},{100,49},{100,50},{100,51},{100,52},{100,53},{100,54},{100,55},{100,56},{100,57},{100,58},{100,59},{100,60},{100,61},{100,62},{100,63},{100,64},{100,65},{100,66},{100,67},{100,68},{100,69},{100,70},{100,71},{100,72},{100,73},{100,74},{100,75},{100,76},{100,77},{100,78},{100,79},{100,80},{100,81},{100,82},{100,83},{100,84},{100,85},{100,86},{100,87},{100,88},{100,89},{100,90},{100,91},{100,92},{100,93},{100,94},{100,95},{100,96},{100,97},{100,98},{100,99},{100,100},{100,101},{100,102},{100,103},{100,104},{100,105},{100,106},{100,107},{100,108},{100,109},{100,110},{100,111},{100,112},{100,113},{100,114},{100,115},{100,116},{100,117},{100,118},{100,119},{100,120},{100,121},{100,122},{100,123},{100,124},{100,125},{100,126},{100,127},{100,128},{100,129},{100,130},{100,131},{100,132},{100,133},{100,134},{100,135},{100,136},{100,137},{100,138},{100,139},{100,140},{100,141},{100,142},{100,143},{100,144},{100,145},{100,146},{100,147},{100,148},{100,149},{100,150},{99,0},{99,1},{99,2},{99,3},{99,4},{99,5},{99,6},{99,7},{99,8},{99,9},{99,10},{99,11},{99,12},{99,13},{99,14},{99,15},{99,16},{99,17},{99,18},{99,19},{99,20},{99,21},{99,22},{99,23},{99,24},{99,25},{99,26},{99,27},{99,28},{99,29},{99,30},{99,31},{99,32},{99,33},{99,34},{99,35},{99,36},{99,37},{99,38},{99,39},{99,40},{99,41},{99,42},{99,43},{99,44},{99,45},{99,46},{99,47},{99,48},{99,49},{99,50},{99,51},{99,52},{99,53},{99,54},{99,55},{99,56},{99,57},{99,58},{99,59},{99,60},{99,61},{99,62},{99,63},{99,64},{99,65},{99,66},{99,67},{99,68},{99,69},{99,70},{99,71},{99,72},{99,73},{99,74},{99,75},{99,76},{99,77},{99,78},{99,79},{99,80},{99,81},{99,82},{99,83},{99,84},{99,85},{99,86},{99,87},{99,88},{99,89},{99,90},{99,91},{99,92},{99,93},{99,94},{99,95},{99,96},{99,97},{99,98},{99,99},{99,100},{99,101},{99,102},{99,103},{99,104},{99,105},{99,106},{99,107},{99,108},{99,109},{99,110},{99,111},{99,112},{99,113},{99,114},{99,115},{99,116},{99,117},{99,118},{99,119},{99,120},{99,121},{99,122},{99,123},{99,124},{99,125},{99,126},{99,127},{99,128},{99,129},{99,130},{99,131},{99,132},{99,133},{99,134},{99,135},{99,136},{99,137},{99,138},{99,139},{99,140},{99,141},{99,142},{99,143},{99,144},{99,145},{99,146},{99,147},{99,148},{99,149},{99,150},{98,0},{98,1},{98,2},{98,3},{98,4},{98,5},{98,6},{98,7},{98,8},{98,9},{98,10},{98,11},{98,12},{98,13},{98,14},{98,15},{98,16},{98,17},{98,18},{98,19},{98,20},{98,21},{98,22},{98,23},{98,24},{98,25},{98,26},{98,27},{98,28},{98,29},{98,30},{98,31},{98,32},{98,33},{98,34},{98,35},{98,36},{98,37},{98,38},{98,39},{98,40},{98,41},{98,42},{98,43},{98,44},{98,45},{98,46},{98,47},{98,48},{98,49},{98,50},{98,51},{98,52},{98,53},{98,54},{98,55},{98,56},{98,57},{98,58},{98,59},{98,60},{98,61},{98,62},{98,63},{98,64},{98,65},{98,66},{98,67},{98,68},{98,69},{98,70},{98,71},{98,72},{98,73},{98,74},{98,75},{98,76},{98,77},{98,78},{98,79},{98,80},{98,81},{98,82},{98,83},{98,84},{98,85},{98,86},{98,87},{98,88},{98,89},{98,90},{98,91},{98,92},{98,93},{98,94},{98,95},{98,96},{98,97},{98,98},{98,99},{98,100},{98,101},{98,102},{98,103},{98,104},{98,105},{98,106},{98,107},{98,108},{98,109},{98,110},{98,111},{98,112},{98,113},{98,114},{98,115},{98,116},{98,117},{98,118},{98,119},{98,120},{98,121},{98,122},{98,123},{98,124},{98,125},{98,126},{98,127},{98,128},{98,129},{98,130},{98,131},{98,132},{98,133},{98,134},{98,135},{98,136},{98,137},{98,138},{98,139},{98,140},{98,141},{98,142},{98,143},{98,144},{98,145},{98,146},{98,147},{98,148},{98,149},{98,150},{97,0},{97,1},{97,2},{97,3},{97,4},{97,5},{97,6},{97,7},{97,8},{97,9},{97,10},{97,11},{97,12},{97,13},{97,14},{97,15},{97,16},{97,17},{97,18},{97,19},{97,20},{97,21},{97,22},{97,23},{97,24},{97,25},{97,26},{97,27},{97,28},{97,29},{97,30},{97,31},{97,32},{97,33},{97,34},{97,35},{97,36},{97,37},{97,38},{97,39},{97,40},{97,41},{97,42},{97,43},{97,44},{97,45},{97,46},{97,47},{97,48},{97,49},{97,50},{97,51},{97,52},{97,53},{97,54},{97,55},{97,56},{97,57},{97,58},{97,59},{97,60},{97,61},{97,62},{97,63},{97,64},{97,65},{97,66},{97,67},{97,68},{97,69},{97,70},{97,71},{97,72},{97,73},{97,74},{97,75},{97,76},{97,77},{97,78},{97,79},{97,80},{97,81},{97,82},{97,83},{97,84},{97,85},{97,86},{97,87},{97,88},{97,89},{97,90},{97,91},{97,92},{97,93},{97,94},{97,95},{97,96},{97,97},{97,98},{97,99},{97,100},{97,101},{97,102},{97,103},{97,104},{97,105},{97,106},{97,107},{97,108},{97,109},{97,110},{97,111},{97,112},{97,113},{97,114},{97,115},{97,116},{97,117},{97,118},{97,119},{97,120},{97,121},{97,122},{97,123},{97,124},{97,125},{97,126},{97,127},{97,128},{97,129},{97,130},{97,131},{97,132},{97,133},{97,134},{97,135},{97,136},{97,137},{97,138},{97,139},{97,140},{97,141},{97,142},{97,143},{97,144},{97,145},{97,146},{97,147},{97,148},{97,149},{97,150},{96,0},{96,1},{96,2},{96,3},{96,4},{96,5},{96,6},{96,7},{96,8},{96,9},{96,10},{96,11},{96,12},{96,13},{96,14},{96,15},{96,16},{96,17},{96,18},{96,19},{96,20},{96,21},{96,22},{96,23},{96,24},{96,25},{96,26},{96,27},{96,28},{96,29},{96,30},{96,31},{96,32},{96,33},{96,34},{96,35},{96,36},{96,37},{96,38},{96,39},{96,40},{96,41},{96,42},{96,43},{96,44},{96,45},{96,46},{96,47},{96,48},{96,49},{96,50},{96,51},{96,52},{96,53},{96,54},{96,55},{96,56},{96,57},{96,58},{96,59},{96,60},{96,61},{96,62},{96,63},{96,64},{96,65},{96,66},{96,67},{96,68},{96,69},{96,70},{96,71},{96,72},{96,73},{96,74},{96,75},{96,76},{96,77},{96,78},{96,79},{96,80},{96,81},{96,82},{96,83},{96,84},{96,85},{96,86},{96,87},{96,88},{96,89},{96,90},{96,91},{96,92},{96,93},{96,94},{96,95},{96,96},{96,97},{96,98},{96,99},{96,100},{96,101},{96,102},{96,103},{96,104},{96,105},{96,106},{96,107},{96,108},{96,109},{96,110},{96,111},{96,112},{96,113},{96,114},{96,115},{96,116},{96,117},{96,118},{96,119},{96,120},{96,121},{96,122},{96,123},{96,124},{96,125},{96,126},{96,127},{96,128},{96,129},{96,130},{96,131},{96,132},{96,133},{96,134},{96,135},{96,136},{96,137},{96,138},{96,139},{96,140},{96,141},{96,142},{96,143},{96,144},{96,145},{96,146},{96,147},{96,148},{96,149},{96,150},{95,0},{95,1},{95,2},{95,3},{95,4},{95,5},{95,6},{95,7},{95,8},{95,9},{95,10},{95,11},{95,12},{95,13},{95,14},{95,15},{95,16},{95,17},{95,18},{95,19},{95,20},{95,21},{95,22},{95,23},{95,24},{95,25},{95,26},{95,27},{95,28},{95,29},{95,30},{95,31},{95,32},{95,33},{95,34},{95,35},{95,36},{95,37},{95,38},{95,39},{95,40},{95,41},{95,42},{95,43},{95,44},{95,45},{95,46},{95,47},{95,48},{95,49},{95,50},{95,51},{95,52},{95,53},{95,54},{95,55},{95,56},{95,57},{95,58},{95,59},{95,60},{95,61},{95,62},{95,63},{95,64},{95,65},{95,66},{95,67},{95,68},{95,69},{95,70},{95,71},{95,72},{95,73},{95,74},{95,75},{95,76},{95,77},{95,78},{95,79},{95,80},{95,81},{95,82},{95,83},{95,84},{95,85},{95,86},{95,87},{95,88},{95,89},{95,90},{95,91},{95,92},{95,93},{95,94},{95,95},{95,96},{95,97},{95,98},{95,99},{95,100},{95,101},{95,102},{95,103},{95,104},{95,105},{95,106},{95,107},{95,108},{95,109},{95,110},{95,111},{95,112},{95,113},{95,114},{95,115},{95,116},{95,117},{95,118},{95,119},{95,120},{95,121},{95,122},{95,123},{95,124},{95,125},{95,126},{95,127},{95,128},{95,129},{95,130},{95,131},{95,132},{95,133},{95,134},{95,135},{95,136},{95,137},{95,138},{95,139},{95,140},{95,141},{95,142},{95,143},{95,144},{95,145},{95,146},{95,147},{95,148},{95,149},{95,150},{94,0},{94,1},{94,2},{94,3},{94,4},{94,5},{94,6},{94,7},{94,8},{94,9},{94,10},{94,11},{94,12},{94,13},{94,14},{94,15},{94,16},{94,17},{94,18},{94,19},{94,20},{94,21},{94,22},{94,23},{94,24},{94,25},{94,26},{94,27},{94,28},{94,29},{94,30},{94,31},{94,32},{94,33},{94,34},{94,35},{94,36},{94,37},{94,38},{94,39},{94,40},{94,41},{94,42},{94,43},{94,44},{94,45},{94,46},{94,47},{94,48},{94,49},{94,50},{94,51},{94,52},{94,53},{94,54},{94,55},{94,56},{94,57},{94,58},{94,59},{94,60},{94,61},{94,62},{94,63},{94,64},{94,65},{94,66},{94,67},{94,68},{94,69},{94,70},{94,71},{94,72},{94,73},{94,74},{94,75},{94,76},{94,77},{94,78},{94,79},{94,80},{94,81},{94,82},{94,83},{94,84},{94,85},{94,86},{94,87},{94,88},{94,89},{94,90},{94,91},{94,92},{94,93},{94,94},{94,95},{94,96},{94,97},{94,98},{94,99},{94,100},{94,101},{94,102},{94,103},{94,104},{94,105},{94,106},{94,107},{94,108},{94,109},{94,110},{94,111},{94,112},{94,113},{94,114},{94,115},{94,116},{94,117},{94,118},{94,119},{94,120},{94,121},{94,122},{94,123},{94,124},{94,125},{94,126},{94,127},{94,128},{94,129},{94,130},{94,131},{94,132},{94,133},{94,134},{94,135},{94,136},{94,137},{94,138},{94,139},{94,140},{94,141},{94,142},{94,143},{94,144},{94,145},{94,146},{94,147},{94,148},{94,149},{94,150},{93,0},{93,1},{93,2},{93,3},{93,4},{93,5},{93,6},{93,7},{93,8},{93,9},{93,10},{93,11},{93,12},{93,13},{93,14},{93,15},{93,16},{93,17},{93,18},{93,19},{93,20},{93,21},{93,22},{93,23},{93,24},{93,25},{93,26},{93,27},{93,28},{93,29},{93,30},{93,31},{93,32},{93,33},{93,34},{93,35},{93,36},{93,37},{93,38},{93,39},{93,40},{93,41},{93,42},{93,43},{93,44},{93,45},{93,46},{93,47},{93,48},{93,49},{93,50},{93,51},{93,52},{93,53},{93,54},{93,55},{93,56},{93,57},{93,58},{93,59},{93,60},{93,61},{93,62},{93,63},{93,64},{93,65},{93,66},{93,67},{93,68},{93,69},{93,70},{93,71},{93,72},{93,73},{93,74},{93,75},{93,76},{93,77},{93,78},{93,79},{93,80},{93,81},{93,82},{93,83},{93,84},{93,85},{93,86},{93,87},{93,88},{93,89},{93,90},{93,91},{93,92},{93,93},{93,94},{93,95},{93,96},{93,97},{93,98},{93,99},{93,100},{93,101},{93,102},{93,103},{93,104},{93,105},{93,106},{93,107},{93,108},{93,109},{93,110},{93,111},{93,112},{93,113},{93,114},{93,115},{93,116},{93,117},{93,118},{93,119},{93,120},{93,121},{93,122},{93,123},{93,124},{93,125},{93,126},{93,127},{93,128},{93,129},{93,130},{93,131},{93,132},{93,133},{93,134},{93,135},{93,136},{93,137},{93,138},{93,139},{93,140},{93,141},{93,142},{93,143},{93,144},{93,145},{93,146},{93,147},{93,148},{93,149},{93,150},{92,0},{92,1},{92,2},{92,3},{92,4},{92,5},{92,6},{92,7},{92,8},{92,9},{92,10},{92,11},{92,12},{92,13},{92,14},{92,15},{92,16},{92,17},{92,18},{92,19},{92,20},{92,21},{92,22},{92,23},{92,24},{92,25},{92,26},{92,27},{92,28},{92,29},{92,30},{92,31},{92,32},{92,33},{92,34},{92,35},{92,36},{92,37},{92,38},{92,39},{92,40},{92,41},{92,42},{92,43},{92,44},{92,45},{92,46},{92,47},{92,48},{92,49},{92,50},{92,51},{92,52},{92,53},{92,54},{92,55},{92,56},{92,57},{92,58},{92,59},{92,60},{92,61},{92,62},{92,63},{92,64},{92,65},{92,66},{92,67},{92,68},{92,69},{92,70},{92,71},{92,72},{92,73},{92,74},{92,75},{92,76},{92,77},{92,78},{92,79},{92,80},{92,81},{92,82},{92,83},{92,84},{92,85},{92,86},{92,87},{92,88},{92,89},{92,90},{92,91},{92,92},{92,93},{92,94},{92,95},{92,96},{92,97},{92,98},{92,99},{92,100},{92,101},{92,102},{92,103},{92,104},{92,105},{92,106},{92,107},{92,108},{92,109},{92,110},{92,111},{92,112},{92,113},{92,114},{92,115},{92,116},{92,117},{92,118},{92,119},{92,120},{92,121},{92,122},{92,123},{92,124},{92,125},{92,126},{92,127},{92,128},{92,129},{92,130},{92,131},{92,132},{92,133},{92,134},{92,135},{92,136},{92,137},{92,138},{92,139},{92,140},{92,141},{92,142},{92,143},{92,144},{92,145},{92,146},{92,147},{92,148},{92,149},{92,150},{91,0},{91,1},{91,2},{91,3},{91,4},{91,5},{91,6},{91,7},{91,8},{91,9},{91,10},{91,11},{91,12},{91,13},{91,14},{91,15},{91,16},{91,17},{91,18},{91,19},{91,20},{91,21},{91,22},{91,23},{91,24},{91,25},{91,26},{91,27},{91,28},{91,29},{91,30},{91,31},{91,32},{91,33},{91,34},{91,35},{91,36},{91,37},{91,38},{91,39},{91,40},{91,41},{91,42},{91,43},{91,44},{91,45},{91,46},{91,47},{91,48},{91,49},{91,50},{91,51},{91,52},{91,53},{91,54},{91,55},{91,56},{91,57},{91,58},{91,59},{91,60},{91,61},{91,62},{91,63},{91,64},{91,65},{91,66},{91,67},{91,68},{91,69},{91,70},{91,71},{91,72},{91,73},{91,74},{91,75},{91,76},{91,77},{91,78},{91,79},{91,80},{91,81},{91,82},{91,83},{91,84},{91,85},{91,86},{91,87},{91,88},{91,89},{91,90},{91,91},{91,92},{91,93},{91,94},{91,95},{91,96},{91,97},{91,98},{91,99},{91,100},{91,101},{91,102},{91,103},{91,104},{91,105},{91,106},{91,107},{91,108},{91,109},{91,110},{91,111},{91,112},{91,113},{91,114},{91,115},{91,116},{91,117},{91,118},{91,119},{91,120},{91,121},{91,122},{91,123},{91,124},{91,125},{91,126},{91,127},{91,128},{91,129},{91,130},{91,131},{91,132},{91,133},{91,134},{91,135},{91,136},{91,137},{91,138},{91,139},{91,140},{91,141},{91,142},{91,143},{91,144},{91,145},{91,146},{91,147},{91,148},{91,149},{91,150},{90,0},{90,1},{90,2},{90,3},{90,4},{90,5},{90,6},{90,7},{90,8},{90,9},{90,10},{90,11},{90,12},{90,13},{90,14},{90,15},{90,16},{90,17},{90,18},{90,19},{90,20},{90,21},{90,22},{90,23},{90,24},{90,25},{90,26},{90,27},{90,28},{90,29},{90,30},{90,31},{90,32},{90,33},{90,34},{90,35},{90,36},{90,37},{90,38},{90,39},{90,40},{90,41},{90,42},{90,43},{90,44},{90,45},{90,46},{90,47},{90,48},{90,49},{90,50},{90,51},{90,52},{90,53},{90,54},{90,55},{90,56},{90,57},{90,58},{90,59},{90,60},{90,61},{90,62},{90,63},{90,64},{90,65},{90,66},{90,67},{90,68},{90,69},{90,70},{90,71},{90,72},{90,73},{90,74},{90,75},{90,76},{90,77},{90,78},{90,79},{90,80},{90,81},{90,82},{90,83},{90,84},{90,85},{90,86},{90,87},{90,88},{90,89},{90,90},{90,91},{90,92},{90,93},{90,94},{90,95},{90,96},{90,97},{90,98},{90,99},{90,100},{90,101},{90,102},{90,103},{90,104},{90,105},{90,106},{90,107},{90,108},{90,109},{90,110},{90,111},{90,112},{90,113},{90,114},{90,115},{90,116},{90,117},{90,118},{90,119},{90,120},{90,121},{90,122},{90,123},{90,124},{90,125},{90,126},{90,127},{90,128},{90,129},{90,130},{90,131},{90,132},{90,133},{90,134},{90,135},{90,136},{90,137},{90,138},{90,139},{90,140},{90,141},{90,142},{90,143},{90,144},{90,145},{90,146},{90,147},{90,148},{90,149},{90,150},{89,0},{89,1},{89,2},{89,3},{89,4},{89,5},{89,6},{89,7},{89,8},{89,9},{89,10},{89,11},{89,12},{89,13},{89,14},{89,15},{89,16},{89,17},{89,18},{89,19},{89,20},{89,21},{89,22},{89,23},{89,24},{89,25},{89,26},{89,27},{89,28},{89,29},{89,30},{89,31},{89,32},{89,33},{89,34},{89,35},{89,36},{89,37},{89,38},{89,39},{89,40},{89,41},{89,42},{89,43},{89,44},{89,45},{89,46},{89,47},{89,48},{89,49},{89,50},{89,51},{89,52},{89,53},{89,54},{89,55},{89,56},{89,57},{89,58},{89,59},{89,60},{89,61},{89,62},{89,63},{89,64},{89,65},{89,66},{89,67},{89,68},{89,69},{89,70},{89,71},{89,72},{89,73},{89,74},{89,75},{89,76},{89,77},{89,78},{89,79},{89,80},{89,81},{89,82},{89,83},{89,84},{89,85},{89,86},{89,87},{89,88},{89,89},{89,90},{89,91},{89,92},{89,93},{89,94},{89,95},{89,96},{89,97},{89,98},{89,99},{89,100},{89,101},{89,102},{89,103},{89,104},{89,105},{89,106},{89,107},{89,108},{89,109},{89,110},{89,111},{89,112},{89,113},{89,114},{89,115},{89,116},{89,117},{89,118},{89,119},{89,120},{89,121},{89,122},{89,123},{89,124},{89,125},{89,126},{89,127},{89,128},{89,129},{89,130},{89,131},{89,132},{89,133},{89,134},{89,135},{89,136},{89,137},{89,138},{89,139},{89,140},{89,141},{89,142},{89,143},{89,144},{89,145},{89,146},{89,147},{89,148},{89,149},{89,150},{88,0},{88,1},{88,2},{88,3},{88,4},{88,5},{88,6},{88,7},{88,8},{88,9},{88,10},{88,11},{88,12},{88,13},{88,14},{88,15},{88,16},{88,17},{88,18},{88,19},{88,20},{88,21},{88,22},{88,23},{88,24},{88,25},{88,26},{88,27},{88,28},{88,29},{88,30},{88,31},{88,32},{88,33},{88,34},{88,35},{88,36},{88,37},{88,38},{88,39},{88,40},{88,41},{88,42},{88,43},{88,44},{88,45},{88,46},{88,47},{88,48},{88,49},{88,50},{88,51},{88,52},{88,53},{88,54},{88,55},{88,56},{88,57},{88,58},{88,59},{88,60},{88,61},{88,62},{88,63},{88,64},{88,65},{88,66},{88,67},{88,68},{88,69},{88,70},{88,71},{88,72},{88,73},{88,74},{88,75},{88,76},{88,77},{88,78},{88,79},{88,80},{88,81},{88,82},{88,83},{88,84},{88,85},{88,86},{88,87},{88,88},{88,89},{88,90},{88,91},{88,92},{88,93},{88,94},{88,95},{88,96},{88,97},{88,98},{88,99},{88,100},{88,101},{88,102},{88,103},{88,104},{88,105},{88,106},{88,107},{88,108},{88,109},{88,110},{88,111},{88,112},{88,113},{88,114},{88,115},{88,116},{88,117},{88,118},{88,119},{88,120},{88,121},{88,122},{88,123},{88,124},{88,125},{88,126},{88,127},{88,128},{88,129},{88,130},{88,131},{88,132},{88,133},{88,134},{88,135},{88,136},{88,137},{88,138},{88,139},{88,140},{88,141},{88,142},{88,143},{88,144},{88,145},{88,146},{88,147},{88,148},{88,149},{88,150},{87,0},{87,1},{87,2},{87,3},{87,4},{87,5},{87,6},{87,7},{87,8},{87,9},{87,10},{87,11},{87,12},{87,13},{87,14},{87,15},{87,16},{87,17},{87,18},{87,19},{87,20},{87,21},{87,22},{87,23},{87,24},{87,25},{87,26},{87,27},{87,28},{87,29},{87,30},{87,31},{87,32},{87,33},{87,34},{87,35},{87,36},{87,37},{87,38},{87,39},{87,40},{87,41},{87,42},{87,43},{87,44},{87,45},{87,46},{87,47},{87,48},{87,49},{87,50},{87,51},{87,52},{87,53},{87,54},{87,55},{87,56},{87,57},{87,58},{87,59},{87,60},{87,61},{87,62},{87,63},{87,64},{87,65},{87,66},{87,67},{87,68},{87,69},{87,70},{87,71},{87,72},{87,73},{87,74},{87,75},{87,76},{87,77},{87,78},{87,79},{87,80},{87,81},{87,82},{87,83},{87,84},{87,85},{87,86},{87,87},{87,88},{87,89},{87,90},{87,91},{87,92},{87,93},{87,94},{87,95},{87,96},{87,97},{87,98},{87,99},{87,100},{87,101},{87,102},{87,103},{87,104},{87,105},{87,106},{87,107},{87,108},{87,109},{87,110},{87,111},{87,112},{87,113},{87,114},{87,115},{87,116},{87,117},{87,118},{87,119},{87,120},{87,121},{87,122},{87,123},{87,124},{87,125},{87,126},{87,127},{87,128},{87,129},{87,130},{87,131},{87,132},{87,133},{87,134},{87,135},{87,136},{87,137},{87,138},{87,139},{87,140},{87,141},{87,142},{87,143},{87,144},{87,145},{87,146},{87,147},{87,148},{87,149},{87,150},{86,0},{86,1},{86,2},{86,3},{86,4},{86,5},{86,6},{86,7},{86,8},{86,9},{86,10},{86,11},{86,12},{86,13},{86,14},{86,15},{86,16},{86,17},{86,18},{86,19},{86,20},{86,21},{86,22},{86,23},{86,24},{86,25},{86,26},{86,27},{86,28},{86,29},{86,30},{86,31},{86,32},{86,33},{86,34},{86,35},{86,36},{86,37},{86,38},{86,39},{86,40},{86,41},{86,42},{86,43},{86,44},{86,45},{86,46},{86,47},{86,48},{86,49},{86,50},{86,51},{86,52},{86,53},{86,54},{86,55},{86,56},{86,57},{86,58},{86,59},{86,60},{86,61},{86,62},{86,63},{86,64},{86,65},{86,66},{86,67},{86,68},{86,69},{86,70},{86,71},{86,72},{86,73},{86,74},{86,75},{86,76},{86,77},{86,78},{86,79},{86,80},{86,81},{86,82},{86,83},{86,84},{86,85},{86,86},{86,87},{86,88},{86,89},{86,90},{86,91},{86,92},{86,93},{86,94},{86,95},{86,96},{86,97},{86,98},{86,99},{86,100},{86,101},{86,102},{86,103},{86,104},{86,105},{86,106},{86,107},{86,108},{86,109},{86,110},{86,111},{86,112},{86,113},{86,114},{86,115},{86,116},{86,117},{86,118},{86,119},{86,120},{86,121},{86,122},{86,123},{86,124},{86,125},{86,126},{86,127},{86,128},{86,129},{86,130},{86,131},{86,132},{86,133},{86,134},{86,135},{86,136},{86,137},{86,138},{86,139},{86,140},{86,141},{86,142},{86,143},{86,144},{86,145},{86,146},{86,147},{86,148},{86,149},{86,150},{85,0},{85,1},{85,2},{85,3},{85,4},{85,5},{85,6},{85,7},{85,8},{85,9},{85,10},{85,11},{85,12},{85,13},{85,14},{85,15},{85,16},{85,17},{85,18},{85,19},{85,20},{85,21},{85,22},{85,23},{85,24},{85,25},{85,26},{85,27},{85,28},{85,29},{85,30},{85,31},{85,32},{85,33},{85,34},{85,35},{85,36},{85,37},{85,38},{85,39},{85,40},{85,41},{85,42},{85,43},{85,44},{85,45},{85,46},{85,47},{85,48},{85,49},{85,50},{85,51},{85,52},{85,53},{85,54},{85,55},{85,56},{85,57},{85,58},{85,59},{85,60},{85,61},{85,62},{85,63},{85,64},{85,65},{85,66},{85,67},{85,68},{85,69},{85,70},{85,71},{85,72},{85,73},{85,74},{85,75},{85,76},{85,77},{85,78},{85,79},{85,80},{85,81},{85,82},{85,83},{85,84},{85,85},{85,86},{85,87},{85,88},{85,89},{85,90},{85,91},{85,92},{85,93},{85,94},{85,95},{85,96},{85,97},{85,98},{85,99},{85,100},{85,101},{85,102},{85,103},{85,104},{85,105},{85,106},{85,107},{85,108},{85,109},{85,110},{85,111},{85,112},{85,113},{85,114},{85,115},{85,116},{85,117},{85,118},{85,119},{85,120},{85,121},{85,122},{85,123},{85,124},{85,125},{85,126},{85,127},{85,128},{85,129},{85,130},{85,131},{85,132},{85,133},{85,134},{85,135},{85,136},{85,137},{85,138},{85,139},{85,140},{85,141},{85,142},{85,143},{85,144},{85,145},{85,146},{85,147},{85,148},{85,149},{85,150},{84,0},{84,1},{84,2},{84,3},{84,4},{84,5},{84,6},{84,7},{84,8},{84,9},{84,10},{84,11},{84,12},{84,13},{84,14},{84,15},{84,16},{84,17},{84,18},{84,19},{84,20},{84,21},{84,22},{84,23},{84,24},{84,25},{84,26},{84,27},{84,28},{84,29},{84,30},{84,31},{84,32},{84,33},{84,34},{84,35},{84,36},{84,37},{84,38},{84,39},{84,40},{84,41},{84,42},{84,43},{84,44},{84,45},{84,46},{84,47},{84,48},{84,49},{84,50},{84,51},{84,52},{84,53},{84,54},{84,55},{84,56},{84,57},{84,58},{84,59},{84,60},{84,61},{84,62},{84,63},{84,64},{84,65},{84,66},{84,67},{84,68},{84,69},{84,70},{84,71},{84,72},{84,73},{84,74},{84,75},{84,76},{84,77},{84,78},{84,79},{84,80},{84,81},{84,82},{84,83},{84,84},{84,85},{84,86},{84,87},{84,88},{84,89},{84,90},{84,91},{84,92},{84,93},{84,94},{84,95},{84,96},{84,97},{84,98},{84,99},{84,100},{84,101},{84,102},{84,103},{84,104},{84,105},{84,106},{84,107},{84,108},{84,109},{84,110},{84,111},{84,112},{84,113},{84,114},{84,115},{84,116},{84,117},{84,118},{84,119},{84,120},{84,121},{84,122},{84,123},{84,124},{84,125},{84,126},{84,127},{84,128},{84,129},{84,130},{84,131},{84,132},{84,133},{84,134},{84,135},{84,136},{84,137},{84,138},{84,139},{84,140},{84,141},{84,142},{84,143},{84,144},{84,145},{84,146},{84,147},{84,148},{84,149},{84,150},{83,0},{83,1},{83,2},{83,3},{83,4},{83,5},{83,6},{83,7},{83,8},{83,9},{83,10},{83,11},{83,12},{83,13},{83,14},{83,15},{83,16},{83,17},{83,18},{83,19},{83,20},{83,21},{83,22},{83,23},{83,24},{83,25},{83,26},{83,27},{83,28},{83,29},{83,30},{83,31},{83,32},{83,33},{83,34},{83,35},{83,36},{83,37},{83,38},{83,39},{83,40},{83,41},{83,42},{83,43},{83,44},{83,45},{83,46},{83,47},{83,48},{83,49},{83,50},{83,51},{83,52},{83,53},{83,54},{83,55},{83,56},{83,57},{83,58},{83,59},{83,60},{83,61},{83,62},{83,63},{83,64},{83,65},{83,66},{83,67},{83,68},{83,69},{83,70},{83,71},{83,72},{83,73},{83,74},{83,75},{83,76},{83,77},{83,78},{83,79},{83,80},{83,81},{83,82},{83,83},{83,84},{83,85},{83,86},{83,87},{83,88},{83,89},{83,90},{83,91},{83,92},{83,93},{83,94},{83,95},{83,96},{83,97},{83,98},{83,99},{83,100},{83,101},{83,102},{83,103},{83,104},{83,105},{83,106},{83,107},{83,108},{83,109},{83,110},{83,111},{83,112},{83,113},{83,114},{83,115},{83,116},{83,117},{83,118},{83,119},{83,120},{83,121},{83,122},{83,123},{83,124},{83,125},{83,126},{83,127},{83,128},{83,129},{83,130},{83,131},{83,132},{83,133},{83,134},{83,135},{83,136},{83,137},{83,138},{83,139},{83,140},{83,141},{83,142},{83,143},{83,144},{83,145},{83,146},{83,147},{83,148},{83,149},{83,150},{82,0},{82,1},{82,2},{82,3},{82,4},{82,5},{82,6},{82,7},{82,8},{82,9},{82,10},{82,11},{82,12},{82,13},{82,14},{82,15},{82,16},{82,17},{82,18},{82,19},{82,20},{82,21},{82,22},{82,23},{82,24},{82,25},{82,26},{82,27},{82,28},{82,29},{82,30},{82,31},{82,32},{82,33},{82,34},{82,35},{82,36},{82,37},{82,38},{82,39},{82,40},{82,41},{82,42},{82,43},{82,44},{82,45},{82,46},{82,47},{82,48},{82,49},{82,50},{82,51},{82,52},{82,53},{82,54},{82,55},{82,56},{82,57},{82,58},{82,59},{82,60},{82,61},{82,62},{82,63},{82,64},{82,65},{82,66},{82,67},{82,68},{82,69},{82,70},{82,71},{82,72},{82,73},{82,74},{82,75},{82,76},{82,77},{82,78},{82,79},{82,80},{82,81},{82,82},{82,83},{82,84},{82,85},{82,86},{82,87},{82,88},{82,89},{82,90},{82,91},{82,92},{82,93},{82,94},{82,95},{82,96},{82,97},{82,98},{82,99},{82,100},{82,101},{82,102},{82,103},{82,104},{82,105},{82,106},{82,107},{82,108},{82,109},{82,110},{82,111},{82,112},{82,113},{82,114},{82,115},{82,116},{82,117},{82,118},{82,119},{82,120},{82,121},{82,122},{82,123},{82,124},{82,125},{82,126},{82,127},{82,128},{82,129},{82,130},{82,131},{82,132},{82,133},{82,134},{82,135},{82,136},{82,137},{82,138},{82,139},{82,140},{82,141},{82,142},{82,143},{82,144},{82,145},{82,146},{82,147},{82,148},{82,149},{82,150},{81,0},{81,1},{81,2},{81,3},{81,4},{81,5},{81,6},{81,7},{81,8},{81,9},{81,10},{81,11},{81,12},{81,13},{81,14},{81,15},{81,16},{81,17},{81,18},{81,19},{81,20},{81,21},{81,22},{81,23},{81,24},{81,25},{81,26},{81,27},{81,28},{81,29},{81,30},{81,31},{81,32},{81,33},{81,34},{81,35},{81,36},{81,37},{81,38},{81,39},{81,40},{81,41},{81,42},{81,43},{81,44},{81,45},{81,46},{81,47},{81,48},{81,49},{81,50},{81,51},{81,52},{81,53},{81,54},{81,55},{81,56},{81,57},{81,58},{81,59},{81,60},{81,61},{81,62},{81,63},{81,64},{81,65},{81,66},{81,67},{81,68},{81,69},{81,70},{81,71},{81,72},{81,73},{81,74},{81,75},{81,76},{81,77},{81,78},{81,79},{81,80},{81,81},{81,82},{81,83},{81,84},{81,85},{81,86},{81,87},{81,88},{81,89},{81,90},{81,91},{81,92},{81,93},{81,94},{81,95},{81,96},{81,97},{81,98},{81,99},{81,100},{81,101},{81,102},{81,103},{81,104},{81,105},{81,106},{81,107},{81,108},{81,109},{81,110},{81,111},{81,112},{81,113},{81,114},{81,115},{81,116},{81,117},{81,118},{81,119},{81,120},{81,121},{81,122},{81,123},{81,124},{81,125},{81,126},{81,127},{81,128},{81,129},{81,130},{81,131},{81,132},{81,133},{81,134},{81,135},{81,136},{81,137},{81,138},{81,139},{81,140},{81,141},{81,142},{81,143},{81,144},{81,145},{81,146},{81,147},{81,148},{81,149},{81,150},{80,0},{80,1},{80,2},{80,3},{80,4},{80,5},{80,6},{80,7},{80,8},{80,9},{80,10},{80,11},{80,12},{80,13},{80,14},{80,15},{80,16},{80,17},{80,18},{80,19},{80,20},{80,21},{80,22},{80,23},{80,24},{80,25},{80,26},{80,27},{80,28},{80,29},{80,30},{80,31},{80,32},{80,33},{80,34},{80,35},{80,36},{80,37},{80,38},{80,39},{80,40},{80,41},{80,42},{80,43},{80,44},{80,45},{80,46},{80,47},{80,48},{80,49},{80,50},{80,51},{80,52},{80,53},{80,54},{80,55},{80,56},{80,57},{80,58},{80,59},{80,60},{80,61},{80,62},{80,63},{80,64},{80,65},{80,66},{80,67},{80,68},{80,69},{80,70},{80,71},{80,72},{80,73},{80,74},{80,75},{80,76},{80,77},{80,78},{80,79},{80,80},{80,81},{80,82},{80,83},{80,84},{80,85},{80,86},{80,87},{80,88},{80,89},{80,90},{80,91},{80,92},{80,93},{80,94},{80,95},{80,96},{80,97},{80,98},{80,99},{80,100},{80,101},{80,102},{80,103},{80,104},{80,105},{80,106},{80,107},{80,108},{80,109},{80,110},{80,111},{80,112},{80,113},{80,114},{80,115},{80,116},{80,117},{80,118},{80,119},{80,120},{80,121},{80,122},{80,123},{80,124},{80,125},{80,126},{80,127},{80,128},{80,129},{80,130},{80,131},{80,132},{80,133},{80,134},{80,135},{80,136},{80,137},{80,138},{80,139},{80,140},{80,141},{80,142},{80,143},{80,144},{80,145},{80,146},{80,147},{80,148},{80,149},{80,150},{79,0},{79,1},{79,2},{79,3},{79,4},{79,5},{79,6},{79,7},{79,8},{79,9},{79,10},{79,11},{79,12},{79,13},{79,14},{79,15},{79,16},{79,17},{79,18},{79,19},{79,20},{79,21},{79,22},{79,23},{79,24},{79,25},{79,26},{79,27},{79,28},{79,29},{79,30},{79,31},{79,32},{79,33},{79,34},{79,35},{79,36},{79,37},{79,38},{79,39},{79,40},{79,41},{79,42},{79,43},{79,44},{79,45},{79,46},{79,47},{79,48},{79,49},{79,50},{79,51},{79,52},{79,53},{79,54},{79,55},{79,56},{79,57},{79,58},{79,59},{79,60},{79,61},{79,62},{79,63},{79,64},{79,65},{79,66},{79,67},{79,68},{79,69},{79,70},{79,71},{79,72},{79,73},{79,74},{79,75},{79,76},{79,77},{79,78},{79,79},{79,80},{79,81},{79,82},{79,83},{79,84},{79,85},{79,86},{79,87},{79,88},{79,89},{79,90},{79,91},{79,92},{79,93},{79,94},{79,95},{79,96},{79,97},{79,98},{79,99},{79,100},{79,101},{79,102},{79,103},{79,104},{79,105},{79,106},{79,107},{79,108},{79,109},{79,110},{79,111},{79,112},{79,113},{79,114},{79,115},{79,116},{79,117},{79,118},{79,119},{79,120},{79,121},{79,122},{79,123},{79,124},{79,125},{79,126},{79,127},{79,128},{79,129},{79,130},{79,131},{79,132},{79,133},{79,134},{79,135},{79,136},{79,137},{79,138},{79,139},{79,140},{79,141},{79,142},{79,143},{79,144},{79,145},{79,146},{79,147},{79,148},{79,149},{79,150},{78,0},{78,1},{78,2},{78,3},{78,4},{78,5},{78,6},{78,7},{78,8},{78,9},{78,10},{78,11},{78,12},{78,13},{78,14},{78,15},{78,16},{78,17},{78,18},{78,19},{78,20},{78,21},{78,22},{78,23},{78,24},{78,25},{78,26},{78,27},{78,28},{78,29},{78,30},{78,31},{78,32},{78,33},{78,34},{78,35},{78,36},{78,37},{78,38},{78,39},{78,40},{78,41},{78,42},{78,43},{78,44},{78,45},{78,46},{78,47},{78,48},{78,49},{78,50},{78,51},{78,52},{78,53},{78,54},{78,55},{78,56},{78,57},{78,58},{78,59},{78,60},{78,61},{78,62},{78,63},{78,64},{78,65},{78,66},{78,67},{78,68},{78,69},{78,70},{78,71},{78,72},{78,73},{78,74},{78,75},{78,76},{78,77},{78,78},{78,79},{78,80},{78,81},{78,82},{78,83},{78,84},{78,85},{78,86},{78,87},{78,88},{78,89},{78,90},{78,91},{78,92},{78,93},{78,94},{78,95},{78,96},{78,97},{78,98},{78,99},{78,100},{78,101},{78,102},{78,103},{78,104},{78,105},{78,106},{78,107},{78,108},{78,109},{78,110},{78,111},{78,112},{78,113},{78,114},{78,115},{78,116},{78,117},{78,118},{78,119},{78,120},{78,121},{78,122},{78,123},{78,124},{78,125},{78,126},{78,127},{78,128},{78,129},{78,130},{78,131},{78,132},{78,133},{78,134},{78,135},{78,136},{78,137},{78,138},{78,139},{78,140},{78,141},{78,142},{78,143},{78,144},{78,145},{78,146},{78,147},{78,148},{78,149},{78,150},{77,0},{77,1},{77,2},{77,3},{77,4},{77,5},{77,6},{77,7},{77,8},{77,9},{77,10},{77,11},{77,12},{77,13},{77,14},{77,15},{77,16},{77,17},{77,18},{77,19},{77,20},{77,21},{77,22},{77,23},{77,24},{77,25},{77,26},{77,27},{77,28},{77,29},{77,30},{77,31},{77,32},{77,33},{77,34},{77,35},{77,36},{77,37},{77,38},{77,39},{77,40},{77,41},{77,42},{77,43},{77,44},{77,45},{77,46},{77,47},{77,48},{77,49},{77,50},{77,51},{77,52},{77,53},{77,54},{77,55},{77,56},{77,57},{77,58},{77,59},{77,60},{77,61},{77,62},{77,63},{77,64},{77,65},{77,66},{77,67},{77,68},{77,69},{77,70},{77,71},{77,72},{77,73},{77,74},{77,75},{77,76},{77,77},{77,78},{77,79},{77,80},{77,81},{77,82},{77,83},{77,84},{77,85},{77,86},{77,87},{77,88},{77,89},{77,90},{77,91},{77,92},{77,93},{77,94},{77,95},{77,96},{77,97},{77,98},{77,99},{77,100},{77,101},{77,102},{77,103},{77,104},{77,105},{77,106},{77,107},{77,108},{77,109},{77,110},{77,111},{77,112},{77,113},{77,114},{77,115},{77,116},{77,117},{77,118},{77,119},{77,120},{77,121},{77,122},{77,123},{77,124},{77,125},{77,126},{77,127},{77,128},{77,129},{77,130},{77,131},{77,132},{77,133},{77,134},{77,135},{77,136},{77,137},{77,138},{77,139},{77,140},{77,141},{77,142},{77,143},{77,144},{77,145},{77,146},{77,147},{77,148},{77,149},{77,150},{76,0},{76,1},{76,2},{76,3},{76,4},{76,5},{76,6},{76,7},{76,8},{76,9},{76,10},{76,11},{76,12},{76,13},{76,14},{76,15},{76,16},{76,17},{76,18},{76,19},{76,20},{76,21},{76,22},{76,23},{76,24},{76,25},{76,26},{76,27},{76,28},{76,29},{76,30},{76,31},{76,32},{76,33},{76,34},{76,35},{76,36},{76,37},{76,38},{76,39},{76,40},{76,41},{76,42},{76,43},{76,44},{76,45},{76,46},{76,47},{76,48},{76,49},{76,50},{76,51},{76,52},{76,53},{76,54},{76,55},{76,56},{76,57},{76,58},{76,59},{76,60},{76,61},{76,62},{76,63},{76,64},{76,65},{76,66},{76,67},{76,68},{76,69},{76,70},{76,71},{76,72},{76,73},{76,74},{76,75},{76,76},{76,77},{76,78},{76,79},{76,80},{76,81},{76,82},{76,83},{76,84},{76,85},{76,86},{76,87},{76,88},{76,89},{76,90},{76,91},{76,92},{76,93},{76,94},{76,95},{76,96},{76,97},{76,98},{76,99},{76,100},{76,101},{76,102},{76,103},{76,104},{76,105},{76,106},{76,107},{76,108},{76,109},{76,110},{76,111},{76,112},{76,113},{76,114},{76,115},{76,116},{76,117},{76,118},{76,119},{76,120},{76,121},{76,122},{76,123},{76,124},{76,125},{76,126},{76,127},{76,128},{76,129},{76,130},{76,131},{76,132},{76,133},{76,134},{76,135},{76,136},{76,137},{76,138},{76,139},{76,140},{76,141},{76,142},{76,143},{76,144},{76,145},{76,146},{76,147},{76,148},{76,149},{76,150},{75,0},{75,1},{75,2},{75,3},{75,4},{75,5},{75,6},{75,7},{75,8},{75,9},{75,10},{75,11},{75,12},{75,13},{75,14},{75,15},{75,16},{75,17},{75,18},{75,19},{75,20},{75,21},{75,22},{75,23},{75,24},{75,25},{75,26},{75,27},{75,28},{75,29},{75,30},{75,31},{75,32},{75,33},{75,34},{75,35},{75,36},{75,37},{75,38},{75,39},{75,40},{75,41},{75,42},{75,43},{75,44},{75,45},{75,46},{75,47},{75,48},{75,49},{75,50},{75,51},{75,52},{75,53},{75,54},{75,55},{75,56},{75,57},{75,58},{75,59},{75,60},{75,61},{75,62},{75,63},{75,64},{75,65},{75,66},{75,67},{75,68},{75,69},{75,70},{75,71},{75,72},{75,73},{75,74},{75,75},{75,76},{75,77},{75,78},{75,79},{75,80},{75,81},{75,82},{75,83},{75,84},{75,85},{75,86},{75,87},{75,88},{75,89},{75,90},{75,91},{75,92},{75,93},{75,94},{75,95},{75,96},{75,97},{75,98},{75,99},{75,100},{75,101},{75,102},{75,103},{75,104},{75,105},{75,106},{75,107},{75,108},{75,109},{75,110},{75,111},{75,112},{75,113},{75,114},{75,115},{75,116},{75,117},{75,118},{75,119},{75,120},{75,121},{75,122},{75,123},{75,124},{75,125},{75,126},{75,127},{75,128},{75,129},{75,130},{75,131},{75,132},{75,133},{75,134},{75,135},{75,136},{75,137},{75,138},{75,139},{75,140},{75,141},{75,142},{75,143},{75,144},{75,145},{75,146},{75,147},{75,148},{75,149},{75,150},{74,0},{74,1},{74,2},{74,3},{74,4},{74,5},{74,6},{74,7},{74,8},{74,9},{74,10},{74,11},{74,12},{74,13},{74,14},{74,15},{74,16},{74,17},{74,18},{74,19},{74,20},{74,21},{74,22},{74,23},{74,24},{74,25},{74,26},{74,27},{74,28},{74,29},{74,30},{74,31},{74,32},{74,33},{74,34},{74,35},{74,36},{74,37},{74,38},{74,39},{74,40},{74,41},{74,42},{74,43},{74,44},{74,45},{74,46},{74,47},{74,48},{74,49},{74,50},{74,51},{74,52},{74,53},{74,54},{74,55},{74,56},{74,57},{74,58},{74,59},{74,60},{74,61},{74,62},{74,63},{74,64},{74,65},{74,66},{74,67},{74,68},{74,69},{74,70},{74,71},{74,72},{74,73},{74,74},{74,75},{74,76},{74,77},{74,78},{74,79},{74,80},{74,81},{74,82},{74,83},{74,84},{74,85},{74,86},{74,87},{74,88},{74,89},{74,90},{74,91},{74,92},{74,93},{74,94},{74,95},{74,96},{74,97},{74,98},{74,99},{74,100},{74,101},{74,102},{74,103},{74,104},{74,105},{74,106},{74,107},{74,108},{74,109},{74,110},{74,111},{74,112},{74,113},{74,114},{74,115},{74,116},{74,117},{74,118},{74,119},{74,120},{74,121},{74,122},{74,123},{74,124},{74,125},{74,126},{74,127},{74,128},{74,129},{74,130},{74,131},{74,132},{74,133},{74,134},{74,135},{74,136},{74,137},{74,138},{74,139},{74,140},{74,141},{74,142},{74,143},{74,144},{74,145},{74,146},{74,147},{74,148},{74,149},{74,150},{73,0},{73,1},{73,2},{73,3},{73,4},{73,5},{73,6},{73,7},{73,8},{73,9},{73,10},{73,11},{73,12},{73,13},{73,14},{73,15},{73,16},{73,17},{73,18},{73,19},{73,20},{73,21},{73,22},{73,23},{73,24},{73,25},{73,26},{73,27},{73,28},{73,29},{73,30},{73,31},{73,32},{73,33},{73,34},{73,35},{73,36},{73,37},{73,38},{73,39},{73,40},{73,41},{73,42},{73,43},{73,44},{73,45},{73,46},{73,47},{73,48},{73,49},{73,50},{73,51},{73,52},{73,53},{73,54},{73,55},{73,56},{73,57},{73,58},{73,59},{73,60},{73,61},{73,62},{73,63},{73,64},{73,65},{73,66},{73,67},{73,68},{73,69},{73,70},{73,71},{73,72},{73,73},{73,74},{73,75},{73,76},{73,77},{73,78},{73,79},{73,80},{73,81},{73,82},{73,83},{73,84},{73,85},{73,86},{73,87},{73,88},{73,89},{73,90},{73,91},{73,92},{73,93},{73,94},{73,95},{73,96},{73,97},{73,98},{73,99},{73,100},{73,101},{73,102},{73,103},{73,104},{73,105},{73,106},{73,107},{73,108},{73,109},{73,110},{73,111},{73,112},{73,113},{73,114},{73,115},{73,116},{73,117},{73,118},{73,119},{73,120},{73,121},{73,122},{73,123},{73,124},{73,125},{73,126},{73,127},{73,128},{73,129},{73,130},{73,131},{73,132},{73,133},{73,134},{73,135},{73,136},{73,137},{73,138},{73,139},{73,140},{73,141},{73,142},{73,143},{73,144},{73,145},{73,146},{73,147},{73,148},{73,149},{73,150},{72,0},{72,1},{72,2},{72,3},{72,4},{72,5},{72,6},{72,7},{72,8},{72,9},{72,10},{72,11},{72,12},{72,13},{72,14},{72,15},{72,16},{72,17},{72,18},{72,19},{72,20},{72,21},{72,22},{72,23},{72,24},{72,25},{72,26},{72,27},{72,28},{72,29},{72,30},{72,31},{72,32},{72,33},{72,34},{72,35},{72,36},{72,37},{72,38},{72,39},{72,40},{72,41},{72,42},{72,43},{72,44},{72,45},{72,46},{72,47},{72,48},{72,49},{72,50},{72,51},{72,52},{72,53},{72,54},{72,55},{72,56},{72,57},{72,58},{72,59},{72,60},{72,61},{72,62},{72,63},{72,64},{72,65},{72,66},{72,67},{72,68},{72,69},{72,70},{72,71},{72,72},{72,73},{72,74},{72,75},{72,76},{72,77},{72,78},{72,79},{72,80},{72,81},{72,82},{72,83},{72,84},{72,85},{72,86},{72,87},{72,88},{72,89},{72,90},{72,91},{72,92},{72,93},{72,94},{72,95},{72,96},{72,97},{72,98},{72,99},{72,100},{72,101},{72,102},{72,103},{72,104},{72,105},{72,106},{72,107},{72,108},{72,109},{72,110},{72,111},{72,112},{72,113},{72,114},{72,115},{72,116},{72,117},{72,118},{72,119},{72,120},{72,121},{72,122},{72,123},{72,124},{72,125},{72,126},{72,127},{72,128},{72,129},{72,130},{72,131},{72,132},{72,133},{72,134},{72,135},{72,136},{72,137},{72,138},{72,139},{72,140},{72,141},{72,142},{72,143},{72,144},{72,145},{72,146},{72,147},{72,148},{72,149},{72,150},{71,0},{71,1},{71,2},{71,3},{71,4},{71,5},{71,6},{71,7},{71,8},{71,9},{71,10},{71,11},{71,12},{71,13},{71,14},{71,15},{71,16},{71,17},{71,18},{71,19},{71,20},{71,21},{71,22},{71,23},{71,24},{71,25},{71,26},{71,27},{71,28},{71,29},{71,30},{71,31},{71,32},{71,33},{71,34},{71,35},{71,36},{71,37},{71,38},{71,39},{71,40},{71,41},{71,42},{71,43},{71,44},{71,45},{71,46},{71,47},{71,48},{71,49},{71,50},{71,51},{71,52},{71,53},{71,54},{71,55},{71,56},{71,57},{71,58},{71,59},{71,60},{71,61},{71,62},{71,63},{71,64},{71,65},{71,66},{71,67},{71,68},{71,69},{71,70},{71,71},{71,72},{71,73},{71,74},{71,75},{71,76},{71,77},{71,78},{71,79},{71,80},{71,81},{71,82},{71,83},{71,84},{71,85},{71,86},{71,87},{71,88},{71,89},{71,90},{71,91},{71,92},{71,93},{71,94},{71,95},{71,96},{71,97},{71,98},{71,99},{71,100},{71,101},{71,102},{71,103},{71,104},{71,105},{71,106},{71,107},{71,108},{71,109},{71,110},{71,111},{71,112},{71,113},{71,114},{71,115},{71,116},{71,117},{71,118},{71,119},{71,120},{71,121},{71,122},{71,123},{71,124},{71,125},{71,126},{71,127},{71,128},{71,129},{71,130},{71,131},{71,132},{71,133},{71,134},{71,135},{71,136},{71,137},{71,138},{71,139},{71,140},{71,141},{71,142},{71,143},{71,144},{71,145},{71,146},{71,147},{71,148},{71,149},{71,150},{70,0},{70,1},{70,2},{70,3},{70,4},{70,5},{70,6},{70,7},{70,8},{70,9},{70,10},{70,11},{70,12},{70,13},{70,14},{70,15},{70,16},{70,17},{70,18},{70,19},{70,20},{70,21},{70,22},{70,23},{70,24},{70,25},{70,26},{70,27},{70,28},{70,29},{70,30},{70,31},{70,32},{70,33},{70,34},{70,35},{70,36},{70,37},{70,38},{70,39},{70,40},{70,41},{70,42},{70,43},{70,44},{70,45},{70,46},{70,47},{70,48},{70,49},{70,50},{70,51},{70,52},{70,53},{70,54},{70,55},{70,56},{70,57},{70,58},{70,59},{70,60},{70,61},{70,62},{70,63},{70,64},{70,65},{70,66},{70,67},{70,68},{70,69},{70,70},{70,71},{70,72},{70,73},{70,74},{70,75},{70,76},{70,77},{70,78},{70,79},{70,80},{70,81},{70,82},{70,83},{70,84},{70,85},{70,86},{70,87},{70,88},{70,89},{70,90},{70,91},{70,92},{70,93},{70,94},{70,95},{70,96},{70,97},{70,98},{70,99},{70,100},{70,101},{70,102},{70,103},{70,104},{70,105},{70,106},{70,107},{70,108},{70,109},{70,110},{70,111},{70,112},{70,113},{70,114},{70,115},{70,116},{70,117},{70,118},{70,119},{70,120},{70,121},{70,122},{70,123},{70,124},{70,125},{70,126},{70,127},{70,128},{70,129},{70,130},{70,131},{70,132},{70,133},{70,134},{70,135},{70,136},{70,137},{70,138},{70,139},{70,140},{70,141},{70,142},{70,143},{70,144},{70,145},{70,146},{70,147},{70,148},{70,149},{70,150},{69,0},{69,1},{69,2},{69,3},{69,4},{69,5},{69,6},{69,7},{69,8},{69,9},{69,10},{69,11},{69,12},{69,13},{69,14},{69,15},{69,16},{69,17},{69,18},{69,19},{69,20},{69,21},{69,22},{69,23},{69,24},{69,25},{69,26},{69,27},{69,28},{69,29},{69,30},{69,31},{69,32},{69,33},{69,34},{69,35},{69,36},{69,37},{69,38},{69,39},{69,40},{69,41},{69,42},{69,43},{69,44},{69,45},{69,46},{69,47},{69,48},{69,49},{69,50},{69,51},{69,52},{69,53},{69,54},{69,55},{69,56},{69,57},{69,58},{69,59},{69,60},{69,61},{69,62},{69,63},{69,64},{69,65},{69,66},{69,67},{69,68},{69,69},{69,70},{69,71},{69,72},{69,73},{69,74},{69,75},{69,76},{69,77},{69,78},{69,79},{69,80},{69,81},{69,82},{69,83},{69,84},{69,85},{69,86},{69,87},{69,88},{69,89},{69,90},{69,91},{69,92},{69,93},{69,94},{69,95},{69,96},{69,97},{69,98},{69,99},{69,100},{69,101},{69,102},{69,103},{69,104},{69,105},{69,106},{69,107},{69,108},{69,109},{69,110},{69,111},{69,112},{69,113},{69,114},{69,115},{69,116},{69,117},{69,118},{69,119},{69,120},{69,121},{69,122},{69,123},{69,124},{69,125},{69,126},{69,127},{69,128},{69,129},{69,130},{69,131},{69,132},{69,133},{69,134},{69,135},{69,136},{69,137},{69,138},{69,139},{69,140},{69,141},{69,142},{69,143},{69,144},{69,145},{69,146},{69,147},{69,148},{69,149},{69,150},{68,0},{68,1},{68,2},{68,3},{68,4},{68,5},{68,6},{68,7},{68,8},{68,9},{68,10},{68,11},{68,12},{68,13},{68,14},{68,15},{68,16},{68,17},{68,18},{68,19},{68,20},{68,21},{68,22},{68,23},{68,24},{68,25},{68,26},{68,27},{68,28},{68,29},{68,30},{68,31},{68,32},{68,33},{68,34},{68,35},{68,36},{68,37},{68,38},{68,39},{68,40},{68,41},{68,42},{68,43},{68,44},{68,45},{68,46},{68,47},{68,48},{68,49},{68,50},{68,51},{68,52},{68,53},{68,54},{68,55},{68,56},{68,57},{68,58},{68,59},{68,60},{68,61},{68,62},{68,63},{68,64},{68,65},{68,66},{68,67},{68,68},{68,69},{68,70},{68,71},{68,72},{68,73},{68,74},{68,75},{68,76},{68,77},{68,78},{68,79},{68,80},{68,81},{68,82},{68,83},{68,84},{68,85},{68,86},{68,87},{68,88},{68,89},{68,90},{68,91},{68,92},{68,93},{68,94},{68,95},{68,96},{68,97},{68,98},{68,99},{68,100},{68,101},{68,102},{68,103},{68,104},{68,105},{68,106},{68,107},{68,108},{68,109},{68,110},{68,111},{68,112},{68,113},{68,114},{68,115},{68,116},{68,117},{68,118},{68,119},{68,120},{68,121},{68,122},{68,123},{68,124},{68,125},{68,126},{68,127},{68,128},{68,129},{68,130},{68,131},{68,132},{68,133},{68,134},{68,135},{68,136},{68,137},{68,138},{68,139},{68,140},{68,141},{68,142},{68,143},{68,144},{68,145},{68,146},{68,147},{68,148},{68,149},{68,150},{67,0},{67,1},{67,2},{67,3},{67,4},{67,5},{67,6},{67,7},{67,8},{67,9},{67,10},{67,11},{67,12},{67,13},{67,14},{67,15},{67,16},{67,17},{67,18},{67,19},{67,20},{67,21},{67,22},{67,23},{67,24},{67,25},{67,26},{67,27},{67,28},{67,29},{67,30},{67,31},{67,32},{67,33},{67,34},{67,35},{67,36},{67,37},{67,38},{67,39},{67,40},{67,41},{67,42},{67,43},{67,44},{67,45},{67,46},{67,47},{67,48},{67,49},{67,50},{67,51},{67,52},{67,53},{67,54},{67,55},{67,56},{67,57},{67,58},{67,59},{67,60},{67,61},{67,62},{67,63},{67,64},{67,65},{67,66},{67,67},{67,68},{67,69},{67,70},{67,71},{67,72},{67,73},{67,74},{67,75},{67,76},{67,77},{67,78},{67,79},{67,80},{67,81},{67,82},{67,83},{67,84},{67,85},{67,86},{67,87},{67,88},{67,89},{67,90},{67,91},{67,92},{67,93},{67,94},{67,95},{67,96},{67,97},{67,98},{67,99},{67,100},{67,101},{67,102},{67,103},{67,104},{67,105},{67,106},{67,107},{67,108},{67,109},{67,110},{67,111},{67,112},{67,113},{67,114},{67,115},{67,116},{67,117},{67,118},{67,119},{67,120},{67,121},{67,122},{67,123},{67,124},{67,125},{67,126},{67,127},{67,128},{67,129},{67,130},{67,131},{67,132},{67,133},{67,134},{67,135},{67,136},{67,137},{67,138},{67,139},{67,140},{67,141},{67,142},{67,143},{67,144},{67,145},{67,146},{67,147},{67,148},{67,149},{67,150},{66,0},{66,1},{66,2},{66,3},{66,4},{66,5},{66,6},{66,7},{66,8},{66,9},{66,10},{66,11},{66,12},{66,13},{66,14},{66,15},{66,16},{66,17},{66,18},{66,19},{66,20},{66,21},{66,22},{66,23},{66,24},{66,25},{66,26},{66,27},{66,28},{66,29},{66,30},{66,31},{66,32},{66,33},{66,34},{66,35},{66,36},{66,37},{66,38},{66,39},{66,40},{66,41},{66,42},{66,43},{66,44},{66,45},{66,46},{66,47},{66,48},{66,49},{66,50},{66,51},{66,52},{66,53},{66,54},{66,55},{66,56},{66,57},{66,58},{66,59},{66,60},{66,61},{66,62},{66,63},{66,64},{66,65},{66,66},{66,67},{66,68},{66,69},{66,70},{66,71},{66,72},{66,73},{66,74},{66,75},{66,76},{66,77},{66,78},{66,79},{66,80},{66,81},{66,82},{66,83},{66,84},{66,85},{66,86},{66,87},{66,88},{66,89},{66,90},{66,91},{66,92},{66,93},{66,94},{66,95},{66,96},{66,97},{66,98},{66,99},{66,100},{66,101},{66,102},{66,103},{66,104},{66,105},{66,106},{66,107},{66,108},{66,109},{66,110},{66,111},{66,112},{66,113},{66,114},{66,115},{66,116},{66,117},{66,118},{66,119},{66,120},{66,121},{66,122},{66,123},{66,124},{66,125},{66,126},{66,127},{66,128},{66,129},{66,130},{66,131},{66,132},{66,133},{66,134},{66,135},{66,136},{66,137},{66,138},{66,139},{66,140},{66,141},{66,142},{66,143},{66,144},{66,145},{66,146},{66,147},{66,148},{66,149},{66,150},{65,0},{65,1},{65,2},{65,3},{65,4},{65,5},{65,6},{65,7},{65,8},{65,9},{65,10},{65,11},{65,12},{65,13},{65,14},{65,15},{65,16},{65,17},{65,18},{65,19},{65,20},{65,21},{65,22},{65,23},{65,24},{65,25},{65,26},{65,27},{65,28},{65,29},{65,30},{65,31},{65,32},{65,33},{65,34},{65,35},{65,36},{65,37},{65,38},{65,39},{65,40},{65,41},{65,42},{65,43},{65,44},{65,45},{65,46},{65,47},{65,48},{65,49},{65,50},{65,51},{65,52},{65,53},{65,54},{65,55},{65,56},{65,57},{65,58},{65,59},{65,60},{65,61},{65,62},{65,63},{65,64},{65,65},{65,66},{65,67},{65,68},{65,69},{65,70},{65,71},{65,72},{65,73},{65,74},{65,75},{65,76},{65,77},{65,78},{65,79},{65,80},{65,81},{65,82},{65,83},{65,84},{65,85},{65,86},{65,87},{65,88},{65,89},{65,90},{65,91},{65,92},{65,93},{65,94},{65,95},{65,96},{65,97},{65,98},{65,99},{65,100},{65,101},{65,102},{65,103},{65,104},{65,105},{65,106},{65,107},{65,108},{65,109},{65,110},{65,111},{65,112},{65,113},{65,114},{65,115},{65,116},{65,117},{65,118},{65,119},{65,120},{65,121},{65,122},{65,123},{65,124},{65,125},{65,126},{65,127},{65,128},{65,129},{65,130},{65,131},{65,132},{65,133},{65,134},{65,135},{65,136},{65,137},{65,138},{65,139},{65,140},{65,141},{65,142},{65,143},{65,144},{65,145},{65,146},{65,147},{65,148},{65,149},{65,150},{64,0},{64,1},{64,2},{64,3},{64,4},{64,5},{64,6},{64,7},{64,8},{64,9},{64,10},{64,11},{64,12},{64,13},{64,14},{64,15},{64,16},{64,17},{64,18},{64,19},{64,20},{64,21},{64,22},{64,23},{64,24},{64,25},{64,26},{64,27},{64,28},{64,29},{64,30},{64,31},{64,32},{64,33},{64,34},{64,35},{64,36},{64,37},{64,38},{64,39},{64,40},{64,41},{64,42},{64,43},{64,44},{64,45},{64,46},{64,47},{64,48},{64,49},{64,50},{64,51},{64,52},{64,53},{64,54},{64,55},{64,56},{64,57},{64,58},{64,59},{64,60},{64,61},{64,62},{64,63},{64,64},{64,65},{64,66},{64,67},{64,68},{64,69},{64,70},{64,71},{64,72},{64,73},{64,74},{64,75},{64,76},{64,77},{64,78},{64,79},{64,80},{64,81},{64,82},{64,83},{64,84},{64,85},{64,86},{64,87},{64,88},{64,89},{64,90},{64,91},{64,92},{64,93},{64,94},{64,95},{64,96},{64,97},{64,98},{64,99},{64,100},{64,101},{64,102},{64,103},{64,104},{64,105},{64,106},{64,107},{64,108},{64,109},{64,110},{64,111},{64,112},{64,113},{64,114},{64,115},{64,116},{64,117},{64,118},{64,119},{64,120},{64,121},{64,122},{64,123},{64,124},{64,125},{64,126},{64,127},{64,128},{64,129},{64,130},{64,131},{64,132},{64,133},{64,134},{64,135},{64,136},{64,137},{64,138},{64,139},{64,140},{64,141},{64,142},{64,143},{64,144},{64,145},{64,146},{64,147},{64,148},{64,149},{64,150},{63,0},{63,1},{63,2},{63,3},{63,4},{63,5},{63,6},{63,7},{63,8},{63,9},{63,10},{63,11},{63,12},{63,13},{63,14},{63,15},{63,16},{63,17},{63,18},{63,19},{63,20},{63,21},{63,22},{63,23},{63,24},{63,25},{63,26},{63,27},{63,28},{63,29},{63,30},{63,31},{63,32},{63,33},{63,34},{63,35},{63,36},{63,37},{63,38},{63,39},{63,40},{63,41},{63,42},{63,43},{63,44},{63,45},{63,46},{63,47},{63,48},{63,49},{63,50},{63,51},{63,52},{63,53},{63,54},{63,55},{63,56},{63,57},{63,58},{63,59},{63,60},{63,61},{63,62},{63,63},{63,64},{63,65},{63,66},{63,67},{63,68},{63,69},{63,70},{63,71},{63,72},{63,73},{63,74},{63,75},{63,76},{63,77},{63,78},{63,79},{63,80},{63,81},{63,82},{63,83},{63,84},{63,85},{63,86},{63,87},{63,88},{63,89},{63,90},{63,91},{63,92},{63,93},{63,94},{63,95},{63,96},{63,97},{63,98},{63,99},{63,100},{63,101},{63,102},{63,103},{63,104},{63,105},{63,106},{63,107},{63,108},{63,109},{63,110},{63,111},{63,112},{63,113},{63,114},{63,115},{63,116},{63,117},{63,118},{63,119},{63,120},{63,121},{63,122},{63,123},{63,124},{63,125},{63,126},{63,127},{63,128},{63,129},{63,130},{63,131},{63,132},{63,133},{63,134},{63,135},{63,136},{63,137},{63,138},{63,139},{63,140},{63,141},{63,142},{63,143},{63,144},{63,145},{63,146},{63,147},{63,148},{63,149},{63,150},{62,0},{62,1},{62,2},{62,3},{62,4},{62,5},{62,6},{62,7},{62,8},{62,9},{62,10},{62,11},{62,12},{62,13},{62,14},{62,15},{62,16},{62,17},{62,18},{62,19},{62,20},{62,21},{62,22},{62,23},{62,24},{62,25},{62,26},{62,27},{62,28},{62,29},{62,30},{62,31},{62,32},{62,33},{62,34},{62,35},{62,36},{62,37},{62,38},{62,39},{62,40},{62,41},{62,42},{62,43},{62,44},{62,45},{62,46},{62,47},{62,48},{62,49},{62,50},{62,51},{62,52},{62,53},{62,54},{62,55},{62,56},{62,57},{62,58},{62,59},{62,60},{62,61},{62,62},{62,63},{62,64},{62,65},{62,66},{62,67},{62,68},{62,69},{62,70},{62,71},{62,72},{62,73},{62,74},{62,75},{62,76},{62,77},{62,78},{62,79},{62,80},{62,81},{62,82},{62,83},{62,84},{62,85},{62,86},{62,87},{62,88},{62,89},{62,90},{62,91},{62,92},{62,93},{62,94},{62,95},{62,96},{62,97},{62,98},{62,99},{62,100},{62,101},{62,102},{62,103},{62,104},{62,105},{62,106},{62,107},{62,108},{62,109},{62,110},{62,111},{62,112},{62,113},{62,114},{62,115},{62,116},{62,117},{62,118},{62,119},{62,120},{62,121},{62,122},{62,123},{62,124},{62,125},{62,126},{62,127},{62,128},{62,129},{62,130},{62,131},{62,132},{62,133},{62,134},{62,135},{62,136},{62,137},{62,138},{62,139},{62,140},{62,141},{62,142},{62,143},{62,144},{62,145},{62,146},{62,147},{62,148},{62,149},{62,150},{61,0},{61,1},{61,2},{61,3},{61,4},{61,5},{61,6},{61,7},{61,8},{61,9},{61,10},{61,11},{61,12},{61,13},{61,14},{61,15},{61,16},{61,17},{61,18},{61,19},{61,20},{61,21},{61,22},{61,23},{61,24},{61,25},{61,26},{61,27},{61,28},{61,29},{61,30},{61,31},{61,32},{61,33},{61,34},{61,35},{61,36},{61,37},{61,38},{61,39},{61,40},{61,41},{61,42},{61,43},{61,44},{61,45},{61,46},{61,47},{61,48},{61,49},{61,50},{61,51},{61,52},{61,53},{61,54},{61,55},{61,56},{61,57},{61,58},{61,59},{61,60},{61,61},{61,62},{61,63},{61,64},{61,65},{61,66},{61,67},{61,68},{61,69},{61,70},{61,71},{61,72},{61,73},{61,74},{61,75},{61,76},{61,77},{61,78},{61,79},{61,80},{61,81},{61,82},{61,83},{61,84},{61,85},{61,86},{61,87},{61,88},{61,89},{61,90},{61,91},{61,92},{61,93},{61,94},{61,95},{61,96},{61,97},{61,98},{61,99},{61,100},{61,101},{61,102},{61,103},{61,104},{61,105},{61,106},{61,107},{61,108},{61,109},{61,110},{61,111},{61,112},{61,113},{61,114},{61,115},{61,116},{61,117},{61,118},{61,119},{61,120},{61,121},{61,122},{61,123},{61,124},{61,125},{61,126},{61,127},{61,128},{61,129},{61,130},{61,131},{61,132},{61,133},{61,134},{61,135},{61,136},{61,137},{61,138},{61,139},{61,140},{61,141},{61,142},{61,143},{61,144},{61,145},{61,146},{61,147},{61,148},{61,149},{61,150},{60,0},{60,1},{60,2},{60,3},{60,4},{60,5},{60,6},{60,7},{60,8},{60,9},{60,10},{60,11},{60,12},{60,13},{60,14},{60,15},{60,16},{60,17},{60,18},{60,19},{60,20},{60,21},{60,22},{60,23},{60,24},{60,25},{60,26},{60,27},{60,28},{60,29},{60,30},{60,31},{60,32},{60,33},{60,34},{60,35},{60,36},{60,37},{60,38},{60,39},{60,40},{60,41},{60,42},{60,43},{60,44},{60,45},{60,46},{60,47},{60,48},{60,49},{60,50},{60,51},{60,52},{60,53},{60,54},{60,55},{60,56},{60,57},{60,58},{60,59},{60,60},{60,61},{60,62},{60,63},{60,64},{60,65},{60,66},{60,67},{60,68},{60,69},{60,70},{60,71},{60,72},{60,73},{60,74},{60,75},{60,76},{60,77},{60,78},{60,79},{60,80},{60,81},{60,82},{60,83},{60,84},{60,85},{60,86},{60,87},{60,88},{60,89},{60,90},{60,91},{60,92},{60,93},{60,94},{60,95},{60,96},{60,97},{60,98},{60,99},{60,100},{60,101},{60,102},{60,103},{60,104},{60,105},{60,106},{60,107},{60,108},{60,109},{60,110},{60,111},{60,112},{60,113},{60,114},{60,115},{60,116},{60,117},{60,118},{60,119},{60,120},{60,121},{60,122},{60,123},{60,124},{60,125},{60,126},{60,127},{60,128},{60,129},{60,130},{60,131},{60,132},{60,133},{60,134},{60,135},{60,136},{60,137},{60,138},{60,139},{60,140},{60,141},{60,142},{60,143},{60,144},{60,145},{60,146},{60,147},{60,148},{60,149},{60,150},{59,0},{59,1},{59,2},{59,3},{59,4},{59,5},{59,6},{59,7},{59,8},{59,9},{59,10},{59,11},{59,12},{59,13},{59,14},{59,15},{59,16},{59,17},{59,18},{59,19},{59,20},{59,21},{59,22},{59,23},{59,24},{59,25},{59,26},{59,27},{59,28},{59,29},{59,30},{59,31},{59,32},{59,33},{59,34},{59,35},{59,36},{59,37},{59,38},{59,39},{59,40},{59,41},{59,42},{59,43},{59,44},{59,45},{59,46},{59,47},{59,48},{59,49},{59,50},{59,51},{59,52},{59,53},{59,54},{59,55},{59,56},{59,57},{59,58},{59,59},{59,60},{59,61},{59,62},{59,63},{59,64},{59,65},{59,66},{59,67},{59,68},{59,69},{59,70},{59,71},{59,72},{59,73},{59,74},{59,75},{59,76},{59,77},{59,78},{59,79},{59,80},{59,81},{59,82},{59,83},{59,84},{59,85},{59,86},{59,87},{59,88},{59,89},{59,90},{59,91},{59,92},{59,93},{59,94},{59,95},{59,96},{59,97},{59,98},{59,99},{59,100},{59,101},{59,102},{59,103},{59,104},{59,105},{59,106},{59,107},{59,108},{59,109},{59,110},{59,111},{59,112},{59,113},{59,114},{59,115},{59,116},{59,117},{59,118},{59,119},{59,120},{59,121},{59,122},{59,123},{59,124},{59,125},{59,126},{59,127},{59,128},{59,129},{59,130},{59,131},{59,132},{59,133},{59,134},{59,135},{59,136},{59,137},{59,138},{59,139},{59,140},{59,141},{59,142},{59,143},{59,144},{59,145},{59,146},{59,147},{59,148},{59,149},{59,150},{58,0},{58,1},{58,2},{58,3},{58,4},{58,5},{58,6},{58,7},{58,8},{58,9},{58,10},{58,11},{58,12},{58,13},{58,14},{58,15},{58,16},{58,17},{58,18},{58,19},{58,20},{58,21},{58,22},{58,23},{58,24},{58,25},{58,26},{58,27},{58,28},{58,29},{58,30},{58,31},{58,32},{58,33},{58,34},{58,35},{58,36},{58,37},{58,38},{58,39},{58,40},{58,41},{58,42},{58,43},{58,44},{58,45},{58,46},{58,47},{58,48},{58,49},{58,50},{58,51},{58,52},{58,53},{58,54},{58,55},{58,56},{58,57},{58,58},{58,59},{58,60},{58,61},{58,62},{58,63},{58,64},{58,65},{58,66},{58,67},{58,68},{58,69},{58,70},{58,71},{58,72},{58,73},{58,74},{58,75},{58,76},{58,77},{58,78},{58,79},{58,80},{58,81},{58,82},{58,83},{58,84},{58,85},{58,86},{58,87},{58,88},{58,89},{58,90},{58,91},{58,92},{58,93},{58,94},{58,95},{58,96},{58,97},{58,98},{58,99},{58,100},{58,101},{58,102},{58,103},{58,104},{58,105},{58,106},{58,107},{58,108},{58,109},{58,110},{58,111},{58,112},{58,113},{58,114},{58,115},{58,116},{58,117},{58,118},{58,119},{58,120},{58,121},{58,122},{58,123},{58,124},{58,125},{58,126},{58,127},{58,128},{58,129},{58,130},{58,131},{58,132},{58,133},{58,134},{58,135},{58,136},{58,137},{58,138},{58,139},{58,140},{58,141},{58,142},{58,143},{58,144},{58,145},{58,146},{58,147},{58,148},{58,149},{58,150},{57,0},{57,1},{57,2},{57,3},{57,4},{57,5},{57,6},{57,7},{57,8},{57,9},{57,10},{57,11},{57,12},{57,13},{57,14},{57,15},{57,16},{57,17},{57,18},{57,19},{57,20},{57,21},{57,22},{57,23},{57,24},{57,25},{57,26},{57,27},{57,28},{57,29},{57,30},{57,31},{57,32},{57,33},{57,34},{57,35},{57,36},{57,37},{57,38},{57,39},{57,40},{57,41},{57,42},{57,43},{57,44},{57,45},{57,46},{57,47},{57,48},{57,49},{57,50},{57,51},{57,52},{57,53},{57,54},{57,55},{57,56},{57,57},{57,58},{57,59},{57,60},{57,61},{57,62},{57,63},{57,64},{57,65},{57,66},{57,67},{57,68},{57,69},{57,70},{57,71},{57,72},{57,73},{57,74},{57,75},{57,76},{57,77},{57,78},{57,79},{57,80},{57,81},{57,82},{57,83},{57,84},{57,85},{57,86},{57,87},{57,88},{57,89},{57,90},{57,91},{57,92},{57,93},{57,94},{57,95},{57,96},{57,97},{57,98},{57,99},{57,100},{57,101},{57,102},{57,103},{57,104},{57,105},{57,106},{57,107},{57,108},{57,109},{57,110},{57,111},{57,112},{57,113},{57,114},{57,115},{57,116},{57,117},{57,118},{57,119},{57,120},{57,121},{57,122},{57,123},{57,124},{57,125},{57,126},{57,127},{57,128},{57,129},{57,130},{57,131},{57,132},{57,133},{57,134},{57,135},{57,136},{57,137},{57,138},{57,139},{57,140},{57,141},{57,142},{57,143},{57,144},{57,145},{57,146},{57,147},{57,148},{57,149},{57,150},{56,0},{56,1},{56,2},{56,3},{56,4},{56,5},{56,6},{56,7},{56,8},{56,9},{56,10},{56,11},{56,12},{56,13},{56,14},{56,15},{56,16},{56,17},{56,18},{56,19},{56,20},{56,21},{56,22},{56,23},{56,24},{56,25},{56,26},{56,27},{56,28},{56,29},{56,30},{56,31},{56,32},{56,33},{56,34},{56,35},{56,36},{56,37},{56,38},{56,39},{56,40},{56,41},{56,42},{56,43},{56,44},{56,45},{56,46},{56,47},{56,48},{56,49},{56,50},{56,51},{56,52},{56,53},{56,54},{56,55},{56,56},{56,57},{56,58},{56,59},{56,60},{56,61},{56,62},{56,63},{56,64},{56,65},{56,66},{56,67},{56,68},{56,69},{56,70},{56,71},{56,72},{56,73},{56,74},{56,75},{56,76},{56,77},{56,78},{56,79},{56,80},{56,81},{56,82},{56,83},{56,84},{56,85},{56,86},{56,87},{56,88},{56,89},{56,90},{56,91},{56,92},{56,93},{56,94},{56,95},{56,96},{56,97},{56,98},{56,99},{56,100},{56,101},{56,102},{56,103},{56,104},{56,105},{56,106},{56,107},{56,108},{56,109},{56,110},{56,111},{56,112},{56,113},{56,114},{56,115},{56,116},{56,117},{56,118},{56,119},{56,120},{56,121},{56,122},{56,123},{56,124},{56,125},{56,126},{56,127},{56,128},{56,129},{56,130},{56,131},{56,132},{56,133},{56,134},{56,135},{56,136},{56,137},{56,138},{56,139},{56,140},{56,141},{56,142},{56,143},{56,144},{56,145},{56,146},{56,147},{56,148},{56,149},{56,150},{55,0},{55,1},{55,2},{55,3},{55,4},{55,5},{55,6},{55,7},{55,8},{55,9},{55,10},{55,11},{55,12},{55,13},{55,14},{55,15},{55,16},{55,17},{55,18},{55,19},{55,20},{55,21},{55,22},{55,23},{55,24},{55,25},{55,26},{55,27},{55,28},{55,29},{55,30},{55,31},{55,32},{55,33},{55,34},{55,35},{55,36},{55,37},{55,38},{55,39},{55,40},{55,41},{55,42},{55,43},{55,44},{55,45},{55,46},{55,47},{55,48},{55,49},{55,50},{55,51},{55,52},{55,53},{55,54},{55,55},{55,56},{55,57},{55,58},{55,59},{55,60},{55,61},{55,62},{55,63},{55,64},{55,65},{55,66},{55,67},{55,68},{55,69},{55,70},{55,71},{55,72},{55,73},{55,74},{55,75},{55,76},{55,77},{55,78},{55,79},{55,80},{55,81},{55,82},{55,83},{55,84},{55,85},{55,86},{55,87},{55,88},{55,89},{55,90},{55,91},{55,92},{55,93},{55,94},{55,95},{55,96},{55,97},{55,98},{55,99},{55,100},{55,101},{55,102},{55,103},{55,104},{55,105},{55,106},{55,107},{55,108},{55,109},{55,110},{55,111},{55,112},{55,113},{55,114},{55,115},{55,116},{55,117},{55,118},{55,119},{55,120},{55,121},{55,122},{55,123},{55,124},{55,125},{55,126},{55,127},{55,128},{55,129},{55,130},{55,131},{55,132},{55,133},{55,134},{55,135},{55,136},{55,137},{55,138},{55,139},{55,140},{55,141},{55,142},{55,143},{55,144},{55,145},{55,146},{55,147},{55,148},{55,149},{55,150},{54,0},{54,1},{54,2},{54,3},{54,4},{54,5},{54,6},{54,7},{54,8},{54,9},{54,10},{54,11},{54,12},{54,13},{54,14},{54,15},{54,16},{54,17},{54,18},{54,19},{54,20},{54,21},{54,22},{54,23},{54,24},{54,25},{54,26},{54,27},{54,28},{54,29},{54,30},{54,31},{54,32},{54,33},{54,34},{54,35},{54,36},{54,37},{54,38},{54,39},{54,40},{54,41},{54,42},{54,43},{54,44},{54,45},{54,46},{54,47},{54,48},{54,49},{54,50},{54,51},{54,52},{54,53},{54,54},{54,55},{54,56},{54,57},{54,58},{54,59},{54,60},{54,61},{54,62},{54,63},{54,64},{54,65},{54,66},{54,67},{54,68},{54,69},{54,70},{54,71},{54,72},{54,73},{54,74},{54,75},{54,76},{54,77},{54,78},{54,79},{54,80},{54,81},{54,82},{54,83},{54,84},{54,85},{54,86},{54,87},{54,88},{54,89},{54,90},{54,91},{54,92},{54,93},{54,94},{54,95},{54,96},{54,97},{54,98},{54,99},{54,100},{54,101},{54,102},{54,103},{54,104},{54,105},{54,106},{54,107},{54,108},{54,109},{54,110},{54,111},{54,112},{54,113},{54,114},{54,115},{54,116},{54,117},{54,118},{54,119},{54,120},{54,121},{54,122},{54,123},{54,124},{54,125},{54,126},{54,127},{54,128},{54,129},{54,130},{54,131},{54,132},{54,133},{54,134},{54,135},{54,136},{54,137},{54,138},{54,139},{54,140},{54,141},{54,142},{54,143},{54,144},{54,145},{54,146},{54,147},{54,148},{54,149},{54,150},{53,0},{53,1},{53,2},{53,3},{53,4},{53,5},{53,6},{53,7},{53,8},{53,9},{53,10},{53,11},{53,12},{53,13},{53,14},{53,15},{53,16},{53,17},{53,18},{53,19},{53,20},{53,21},{53,22},{53,23},{53,24},{53,25},{53,26},{53,27},{53,28},{53,29},{53,30},{53,31},{53,32},{53,33},{53,34},{53,35},{53,36},{53,37},{53,38},{53,39},{53,40},{53,41},{53,42},{53,43},{53,44},{53,45},{53,46},{53,47},{53,48},{53,49},{53,50},{53,51},{53,52},{53,53},{53,54},{53,55},{53,56},{53,57},{53,58},{53,59},{53,60},{53,61},{53,62},{53,63},{53,64},{53,65},{53,66},{53,67},{53,68},{53,69},{53,70},{53,71},{53,72},{53,73},{53,74},{53,75},{53,76},{53,77},{53,78},{53,79},{53,80},{53,81},{53,82},{53,83},{53,84},{53,85},{53,86},{53,87},{53,88},{53,89},{53,90},{53,91},{53,92},{53,93},{53,94},{53,95},{53,96},{53,97},{53,98},{53,99},{53,100},{53,101},{53,102},{53,103},{53,104},{53,105},{53,106},{53,107},{53,108},{53,109},{53,110},{53,111},{53,112},{53,113},{53,114},{53,115},{53,116},{53,117},{53,118},{53,119},{53,120},{53,121},{53,122},{53,123},{53,124},{53,125},{53,126},{53,127},{53,128},{53,129},{53,130},{53,131},{53,132},{53,133},{53,134},{53,135},{53,136},{53,137},{53,138},{53,139},{53,140},{53,141},{53,142},{53,143},{53,144},{53,145},{53,146},{53,147},{53,148},{53,149},{53,150},{52,0},{52,1},{52,2},{52,3},{52,4},{52,5},{52,6},{52,7},{52,8},{52,9},{52,10},{52,11},{52,12},{52,13},{52,14},{52,15},{52,16},{52,17},{52,18},{52,19},{52,20},{52,21},{52,22},{52,23},{52,24},{52,25},{52,26},{52,27},{52,28},{52,29},{52,30},{52,31},{52,32},{52,33},{52,34},{52,35},{52,36},{52,37},{52,38},{52,39},{52,40},{52,41},{52,42},{52,43},{52,44},{52,45},{52,46},{52,47},{52,48},{52,49},{52,50},{52,51},{52,52},{52,53},{52,54},{52,55},{52,56},{52,57},{52,58},{52,59},{52,60},{52,61},{52,62},{52,63},{52,64},{52,65},{52,66},{52,67},{52,68},{52,69},{52,70},{52,71},{52,72},{52,73},{52,74},{52,75},{52,76},{52,77},{52,78},{52,79},{52,80},{52,81},{52,82},{52,83},{52,84},{52,85},{52,86},{52,87},{52,88},{52,89},{52,90},{52,91},{52,92},{52,93},{52,94},{52,95},{52,96},{52,97},{52,98},{52,99},{52,100},{52,101},{52,102},{52,103},{52,104},{52,105},{52,106},{52,107},{52,108},{52,109},{52,110},{52,111},{52,112},{52,113},{52,114},{52,115},{52,116},{52,117},{52,118},{52,119},{52,120},{52,121},{52,122},{52,123},{52,124},{52,125},{52,126},{52,127},{52,128},{52,129},{52,130},{52,131},{52,132},{52,133},{52,134},{52,135},{52,136},{52,137},{52,138},{52,139},{52,140},{52,141},{52,142},{52,143},{52,144},{52,145},{52,146},{52,147},{52,148},{52,149},{52,150},{51,0},{51,1},{51,2},{51,3},{51,4},{51,5},{51,6},{51,7},{51,8},{51,9},{51,10},{51,11},{51,12},{51,13},{51,14},{51,15},{51,16},{51,17},{51,18},{51,19},{51,20},{51,21},{51,22},{51,23},{51,24},{51,25},{51,26},{51,27},{51,28},{51,29},{51,30},{51,31},{51,32},{51,33},{51,34},{51,35},{51,36},{51,37},{51,38},{51,39},{51,40},{51,41},{51,42},{51,43},{51,44},{51,45},{51,46},{51,47},{51,48},{51,49},{51,50},{51,51},{51,52},{51,53},{51,54},{51,55},{51,56},{51,57},{51,58},{51,59},{51,60},{51,61},{51,62},{51,63},{51,64},{51,65},{51,66},{51,67},{51,68},{51,69},{51,70},{51,71},{51,72},{51,73},{51,74},{51,75},{51,76},{51,77},{51,78},{51,79},{51,80},{51,81},{51,82},{51,83},{51,84},{51,85},{51,86},{51,87},{51,88},{51,89},{51,90},{51,91},{51,92},{51,93},{51,94},{51,95},{51,96},{51,97},{51,98},{51,99},{51,100},{51,101},{51,102},{51,103},{51,104},{51,105},{51,106},{51,107},{51,108},{51,109},{51,110},{51,111},{51,112},{51,113},{51,114},{51,115},{51,116},{51,117},{51,118},{51,119},{51,120},{51,121},{51,122},{51,123},{51,124},{51,125},{51,126},{51,127},{51,128},{51,129},{51,130},{51,131},{51,132},{51,133},{51,134},{51,135},{51,136},{51,137},{51,138},{51,139},{51,140},{51,141},{51,142},{51,143},{51,144},{51,145},{51,146},{51,147},{51,148},{51,149},{51,150},{50,0},{50,1},{50,2},{50,3},{50,4},{50,5},{50,6},{50,7},{50,8},{50,9},{50,10},{50,11},{50,12},{50,13},{50,14},{50,15},{50,16},{50,17},{50,18},{50,19},{50,20},{50,21},{50,22},{50,23},{50,24},{50,25},{50,26},{50,27},{50,28},{50,29},{50,30},{50,31},{50,32},{50,33},{50,34},{50,35},{50,36},{50,37},{50,38},{50,39},{50,40},{50,41},{50,42},{50,43},{50,44},{50,45},{50,46},{50,47},{50,48},{50,49},{50,50},{50,51},{50,52},{50,53},{50,54},{50,55},{50,56},{50,57},{50,58},{50,59},{50,60},{50,61},{50,62},{50,63},{50,64},{50,65},{50,66},{50,67},{50,68},{50,69},{50,70},{50,71},{50,72},{50,73},{50,74},{50,75},{50,76},{50,77},{50,78},{50,79},{50,80},{50,81},{50,82},{50,83},{50,84},{50,85},{50,86},{50,87},{50,88},{50,89},{50,90},{50,91},{50,92},{50,93},{50,94},{50,95},{50,96},{50,97},{50,98},{50,99},{50,100},{50,101},{50,102},{50,103},{50,104},{50,105},{50,106},{50,107},{50,108},{50,109},{50,110},{50,111},{50,112},{50,113},{50,114},{50,115},{50,116},{50,117},{50,118},{50,119},{50,120},{50,121},{50,122},{50,123},{50,124},{50,125},{50,126},{50,127},{50,128},{50,129},{50,130},{50,131},{50,132},{50,133},{50,134},{50,135},{50,136},{50,137},{50,138},{50,139},{50,140},{50,141},{50,142},{50,143},{50,144},{50,145},{50,146},{50,147},{50,148},{50,149},{50,150},{49,0},{49,1},{49,2},{49,3},{49,4},{49,5},{49,6},{49,7},{49,8},{49,9},{49,10},{49,11},{49,12},{49,13},{49,14},{49,15},{49,16},{49,17},{49,18},{49,19},{49,20},{49,21},{49,22},{49,23},{49,24},{49,25},{49,26},{49,27},{49,28},{49,29},{49,30},{49,31},{49,32},{49,33},{49,34},{49,35},{49,36},{49,37},{49,38},{49,39},{49,40},{49,41},{49,42},{49,43},{49,44},{49,45},{49,46},{49,47},{49,48},{49,49},{49,50},{49,51},{49,52},{49,53},{49,54},{49,55},{49,56},{49,57},{49,58},{49,59},{49,60},{49,61},{49,62},{49,63},{49,64},{49,65},{49,66},{49,67},{49,68},{49,69},{49,70},{49,71},{49,72},{49,73},{49,74},{49,75},{49,76},{49,77},{49,78},{49,79},{49,80},{49,81},{49,82},{49,83},{49,84},{49,85},{49,86},{49,87},{49,88},{49,89},{49,90},{49,91},{49,92},{49,93},{49,94},{49,95},{49,96},{49,97},{49,98},{49,99},{49,100},{49,101},{49,102},{49,103},{49,104},{49,105},{49,106},{49,107},{49,108},{49,109},{49,110},{49,111},{49,112},{49,113},{49,114},{49,115},{49,116},{49,117},{49,118},{49,119},{49,120},{49,121},{49,122},{49,123},{49,124},{49,125},{49,126},{49,127},{49,128},{49,129},{49,130},{49,131},{49,132},{49,133},{49,134},{49,135},{49,136},{49,137},{49,138},{49,139},{49,140},{49,141},{49,142},{49,143},{49,144},{49,145},{49,146},{49,147},{49,148},{49,149},{49,150},{48,0},{48,1},{48,2},{48,3},{48,4},{48,5},{48,6},{48,7},{48,8},{48,9},{48,10},{48,11},{48,12},{48,13},{48,14},{48,15},{48,16},{48,17},{48,18},{48,19},{48,20},{48,21},{48,22},{48,23},{48,24},{48,25},{48,26},{48,27},{48,28},{48,29},{48,30},{48,31},{48,32},{48,33},{48,34},{48,35},{48,36},{48,37},{48,38},{48,39},{48,40},{48,41},{48,42},{48,43},{48,44},{48,45},{48,46},{48,47},{48,48},{48,49},{48,50},{48,51},{48,52},{48,53},{48,54},{48,55},{48,56},{48,57},{48,58},{48,59},{48,60},{48,61},{48,62},{48,63},{48,64},{48,65},{48,66},{48,67},{48,68},{48,69},{48,70},{48,71},{48,72},{48,73},{48,74},{48,75},{48,76},{48,77},{48,78},{48,79},{48,80},{48,81},{48,82},{48,83},{48,84},{48,85},{48,86},{48,87},{48,88},{48,89},{48,90},{48,91},{48,92},{48,93},{48,94},{48,95},{48,96},{48,97},{48,98},{48,99},{48,100},{48,101},{48,102},{48,103},{48,104},{48,105},{48,106},{48,107},{48,108},{48,109},{48,110},{48,111},{48,112},{48,113},{48,114},{48,115},{48,116},{48,117},{48,118},{48,119},{48,120},{48,121},{48,122},{48,123},{48,124},{48,125},{48,126},{48,127},{48,128},{48,129},{48,130},{48,131},{48,132},{48,133},{48,134},{48,135},{48,136},{48,137},{48,138},{48,139},{48,140},{48,141},{48,142},{48,143},{48,144},{48,145},{48,146},{48,147},{48,148},{48,149},{48,150},{47,0},{47,1},{47,2},{47,3},{47,4},{47,5},{47,6},{47,7},{47,8},{47,9},{47,10},{47,11},{47,12},{47,13},{47,14},{47,15},{47,16},{47,17},{47,18},{47,19},{47,20},{47,21},{47,22},{47,23},{47,24},{47,25},{47,26},{47,27},{47,28},{47,29},{47,30},{47,31},{47,32},{47,33},{47,34},{47,35},{47,36},{47,37},{47,38},{47,39},{47,40},{47,41},{47,42},{47,43},{47,44},{47,45},{47,46},{47,47},{47,48},{47,49},{47,50},{47,51},{47,52},{47,53},{47,54},{47,55},{47,56},{47,57},{47,58},{47,59},{47,60},{47,61},{47,62},{47,63},{47,64},{47,65},{47,66},{47,67},{47,68},{47,69},{47,70},{47,71},{47,72},{47,73},{47,74},{47,75},{47,76},{47,77},{47,78},{47,79},{47,80},{47,81},{47,82},{47,83},{47,84},{47,85},{47,86},{47,87},{47,88},{47,89},{47,90},{47,91},{47,92},{47,93},{47,94},{47,95},{47,96},{47,97},{47,98},{47,99},{47,100},{47,101},{47,102},{47,103},{47,104},{47,105},{47,106},{47,107},{47,108},{47,109},{47,110},{47,111},{47,112},{47,113},{47,114},{47,115},{47,116},{47,117},{47,118},{47,119},{47,120},{47,121},{47,122},{47,123},{47,124},{47,125},{47,126},{47,127},{47,128},{47,129},{47,130},{47,131},{47,132},{47,133},{47,134},{47,135},{47,136},{47,137},{47,138},{47,139},{47,140},{47,141},{47,142},{47,143},{47,144},{47,145},{47,146},{47,147},{47,148},{47,149},{47,150},{46,0},{46,1},{46,2},{46,3},{46,4},{46,5},{46,6},{46,7},{46,8},{46,9},{46,10},{46,11},{46,12},{46,13},{46,14},{46,15},{46,16},{46,17},{46,18},{46,19},{46,20},{46,21},{46,22},{46,23},{46,24},{46,25},{46,26},{46,27},{46,28},{46,29},{46,30},{46,31},{46,32},{46,33},{46,34},{46,35},{46,36},{46,37},{46,38},{46,39},{46,40},{46,41},{46,42},{46,43},{46,44},{46,45},{46,46},{46,47},{46,48},{46,49},{46,50},{46,51},{46,52},{46,53},{46,54},{46,55},{46,56},{46,57},{46,58},{46,59},{46,60},{46,61},{46,62},{46,63},{46,64},{46,65},{46,66},{46,67},{46,68},{46,69},{46,70},{46,71},{46,72},{46,73},{46,74},{46,75},{46,76},{46,77},{46,78},{46,79},{46,80},{46,81},{46,82},{46,83},{46,84},{46,85},{46,86},{46,87},{46,88},{46,89},{46,90},{46,91},{46,92},{46,93},{46,94},{46,95},{46,96},{46,97},{46,98},{46,99},{46,100},{46,101},{46,102},{46,103},{46,104},{46,105},{46,106},{46,107},{46,108},{46,109},{46,110},{46,111},{46,112},{46,113},{46,114},{46,115},{46,116},{46,117},{46,118},{46,119},{46,120},{46,121},{46,122},{46,123},{46,124},{46,125},{46,126},{46,127},{46,128},{46,129},{46,130},{46,131},{46,132},{46,133},{46,134},{46,135},{46,136},{46,137},{46,138},{46,139},{46,140},{46,141},{46,142},{46,143},{46,144},{46,145},{46,146},{46,147},{46,148},{46,149},{46,150},{45,0},{45,1},{45,2},{45,3},{45,4},{45,5},{45,6},{45,7},{45,8},{45,9},{45,10},{45,11},{45,12},{45,13},{45,14},{45,15},{45,16},{45,17},{45,18},{45,19},{45,20},{45,21},{45,22},{45,23},{45,24},{45,25},{45,26},{45,27},{45,28},{45,29},{45,30},{45,31},{45,32},{45,33},{45,34},{45,35},{45,36},{45,37},{45,38},{45,39},{45,40},{45,41},{45,42},{45,43},{45,44},{45,45},{45,46},{45,47},{45,48},{45,49},{45,50},{45,51},{45,52},{45,53},{45,54},{45,55},{45,56},{45,57},{45,58},{45,59},{45,60},{45,61},{45,62},{45,63},{45,64},{45,65},{45,66},{45,67},{45,68},{45,69},{45,70},{45,71},{45,72},{45,73},{45,74},{45,75},{45,76},{45,77},{45,78},{45,79},{45,80},{45,81},{45,82},{45,83},{45,84},{45,85},{45,86},{45,87},{45,88},{45,89},{45,90},{45,91},{45,92},{45,93},{45,94},{45,95},{45,96},{45,97},{45,98},{45,99},{45,100},{45,101},{45,102},{45,103},{45,104},{45,105},{45,106},{45,107},{45,108},{45,109},{45,110},{45,111},{45,112},{45,113},{45,114},{45,115},{45,116},{45,117},{45,118},{45,119},{45,120},{45,121},{45,122},{45,123},{45,124},{45,125},{45,126},{45,127},{45,128},{45,129},{45,130},{45,131},{45,132},{45,133},{45,134},{45,135},{45,136},{45,137},{45,138},{45,139},{45,140},{45,141},{45,142},{45,143},{45,144},{45,145},{45,146},{45,147},{45,148},{45,149},{45,150},{44,0},{44,1},{44,2},{44,3},{44,4},{44,5},{44,6},{44,7},{44,8},{44,9},{44,10},{44,11},{44,12},{44,13},{44,14},{44,15},{44,16},{44,17},{44,18},{44,19},{44,20},{44,21},{44,22},{44,23},{44,24},{44,25},{44,26},{44,27},{44,28},{44,29},{44,30},{44,31},{44,32},{44,33},{44,34},{44,35},{44,36},{44,37},{44,38},{44,39},{44,40},{44,41},{44,42},{44,43},{44,44},{44,45},{44,46},{44,47},{44,48},{44,49},{44,50},{44,51},{44,52},{44,53},{44,54},{44,55},{44,56},{44,57},{44,58},{44,59},{44,60},{44,61},{44,62},{44,63},{44,64},{44,65},{44,66},{44,67},{44,68},{44,69},{44,70},{44,71},{44,72},{44,73},{44,74},{44,75},{44,76},{44,77},{44,78},{44,79},{44,80},{44,81},{44,82},{44,83},{44,84},{44,85},{44,86},{44,87},{44,88},{44,89},{44,90},{44,91},{44,92},{44,93},{44,94},{44,95},{44,96},{44,97},{44,98},{44,99},{44,100},{44,101},{44,102},{44,103},{44,104},{44,105},{44,106},{44,107},{44,108},{44,109},{44,110},{44,111},{44,112},{44,113},{44,114},{44,115},{44,116},{44,117},{44,118},{44,119},{44,120},{44,121},{44,122},{44,123},{44,124},{44,125},{44,126},{44,127},{44,128},{44,129},{44,130},{44,131},{44,132},{44,133},{44,134},{44,135},{44,136},{44,137},{44,138},{44,139},{44,140},{44,141},{44,142},{44,143},{44,144},{44,145},{44,146},{44,147},{44,148},{44,149},{44,150},{43,0},{43,1},{43,2},{43,3},{43,4},{43,5},{43,6},{43,7},{43,8},{43,9},{43,10},{43,11},{43,12},{43,13},{43,14},{43,15},{43,16},{43,17},{43,18},{43,19},{43,20},{43,21},{43,22},{43,23},{43,24},{43,25},{43,26},{43,27},{43,28},{43,29},{43,30},{43,31},{43,32},{43,33},{43,34},{43,35},{43,36},{43,37},{43,38},{43,39},{43,40},{43,41},{43,42},{43,43},{43,44},{43,45},{43,46},{43,47},{43,48},{43,49},{43,50},{43,51},{43,52},{43,53},{43,54},{43,55},{43,56},{43,57},{43,58},{43,59},{43,60},{43,61},{43,62},{43,63},{43,64},{43,65},{43,66},{43,67},{43,68},{43,69},{43,70},{43,71},{43,72},{43,73},{43,74},{43,75},{43,76},{43,77},{43,78},{43,79},{43,80},{43,81},{43,82},{43,83},{43,84},{43,85},{43,86},{43,87},{43,88},{43,89},{43,90},{43,91},{43,92},{43,93},{43,94},{43,95},{43,96},{43,97},{43,98},{43,99},{43,100},{43,101},{43,102},{43,103},{43,104},{43,105},{43,106},{43,107},{43,108},{43,109},{43,110},{43,111},{43,112},{43,113},{43,114},{43,115},{43,116},{43,117},{43,118},{43,119},{43,120},{43,121},{43,122},{43,123},{43,124},{43,125},{43,126},{43,127},{43,128},{43,129},{43,130},{43,131},{43,132},{43,133},{43,134},{43,135},{43,136},{43,137},{43,138},{43,139},{43,140},{43,141},{43,142},{43,143},{43,144},{43,145},{43,146},{43,147},{43,148},{43,149},{43,150},{42,0},{42,1},{42,2},{42,3},{42,4},{42,5},{42,6},{42,7},{42,8},{42,9},{42,10},{42,11},{42,12},{42,13},{42,14},{42,15},{42,16},{42,17},{42,18},{42,19},{42,20},{42,21},{42,22},{42,23},{42,24},{42,25},{42,26},{42,27},{42,28},{42,29},{42,30},{42,31},{42,32},{42,33},{42,34},{42,35},{42,36},{42,37},{42,38},{42,39},{42,40},{42,41},{42,42},{42,43},{42,44},{42,45},{42,46},{42,47},{42,48},{42,49},{42,50},{42,51},{42,52},{42,53},{42,54},{42,55},{42,56},{42,57},{42,58},{42,59},{42,60},{42,61},{42,62},{42,63},{42,64},{42,65},{42,66},{42,67},{42,68},{42,69},{42,70},{42,71},{42,72},{42,73},{42,74},{42,75},{42,76},{42,77},{42,78},{42,79},{42,80},{42,81},{42,82},{42,83},{42,84},{42,85},{42,86},{42,87},{42,88},{42,89},{42,90},{42,91},{42,92},{42,93},{42,94},{42,95},{42,96},{42,97},{42,98},{42,99},{42,100},{42,101},{42,102},{42,103},{42,104},{42,105},{42,106},{42,107},{42,108},{42,109},{42,110},{42,111},{42,112},{42,113},{42,114},{42,115},{42,116},{42,117},{42,118},{42,119},{42,120},{42,121},{42,122},{42,123},{42,124},{42,125},{42,126},{42,127},{42,128},{42,129},{42,130},{42,131},{42,132},{42,133},{42,134},{42,135},{42,136},{42,137},{42,138},{42,139},{42,140},{42,141},{42,142},{42,143},{42,144},{42,145},{42,146},{42,147},{42,148},{42,149},{42,150},{41,0},{41,1},{41,2},{41,3},{41,4},{41,5},{41,6},{41,7},{41,8},{41,9},{41,10},{41,11},{41,12},{41,13},{41,14},{41,15},{41,16},{41,17},{41,18},{41,19},{41,20},{41,21},{41,22},{41,23},{41,24},{41,25},{41,26},{41,27},{41,28},{41,29},{41,30},{41,31},{41,32},{41,33},{41,34},{41,35},{41,36},{41,37},{41,38},{41,39},{41,40},{41,41},{41,42},{41,43},{41,44},{41,45},{41,46},{41,47},{41,48},{41,49},{41,50},{41,51},{41,52},{41,53},{41,54},{41,55},{41,56},{41,57},{41,58},{41,59},{41,60},{41,61},{41,62},{41,63},{41,64},{41,65},{41,66},{41,67},{41,68},{41,69},{41,70},{41,71},{41,72},{41,73},{41,74},{41,75},{41,76},{41,77},{41,78},{41,79},{41,80},{41,81},{41,82},{41,83},{41,84},{41,85},{41,86},{41,87},{41,88},{41,89},{41,90},{41,91},{41,92},{41,93},{41,94},{41,95},{41,96},{41,97},{41,98},{41,99},{41,100},{41,101},{41,102},{41,103},{41,104},{41,105},{41,106},{41,107},{41,108},{41,109},{41,110},{41,111},{41,112},{41,113},{41,114},{41,115},{41,116},{41,117},{41,118},{41,119},{41,120},{41,121},{41,122},{41,123},{41,124},{41,125},{41,126},{41,127},{41,128},{41,129},{41,130},{41,131},{41,132},{41,133},{41,134},{41,135},{41,136},{41,137},{41,138},{41,139},{41,140},{41,141},{41,142},{41,143},{41,144},{41,145},{41,146},{41,147},{41,148},{41,149},{41,150},{40,0},{40,1},{40,2},{40,3},{40,4},{40,5},{40,6},{40,7},{40,8},{40,9},{40,10},{40,11},{40,12},{40,13},{40,14},{40,15},{40,16},{40,17},{40,18},{40,19},{40,20},{40,21},{40,22},{40,23},{40,24},{40,25},{40,26},{40,27},{40,28},{40,29},{40,30},{40,31},{40,32},{40,33},{40,34},{40,35},{40,36},{40,37},{40,38},{40,39},{40,40},{40,41},{40,42},{40,43},{40,44},{40,45},{40,46},{40,47},{40,48},{40,49},{40,50},{40,51},{40,52},{40,53},{40,54},{40,55},{40,56},{40,57},{40,58},{40,59},{40,60},{40,61},{40,62},{40,63},{40,64},{40,65},{40,66},{40,67},{40,68},{40,69},{40,70},{40,71},{40,72},{40,73},{40,74},{40,75},{40,76},{40,77},{40,78},{40,79},{40,80},{40,81},{40,82},{40,83},{40,84},{40,85},{40,86},{40,87},{40,88},{40,89},{40,90},{40,91},{40,92},{40,93},{40,94},{40,95},{40,96},{40,97},{40,98},{40,99},{40,100},{40,101},{40,102},{40,103},{40,104},{40,105},{40,106},{40,107},{40,108},{40,109},{40,110},{40,111},{40,112},{40,113},{40,114},{40,115},{40,116},{40,117},{40,118},{40,119},{40,120},{40,121},{40,122},{40,123},{40,124},{40,125},{40,126},{40,127},{40,128},{40,129},{40,130},{40,131},{40,132},{40,133},{40,134},{40,135},{40,136},{40,137},{40,138},{40,139},{40,140},{40,141},{40,142},{40,143},{40,144},{40,145},{40,146},{40,147},{40,148},{40,149},{40,150},{39,0},{39,1},{39,2},{39,3},{39,4},{39,5},{39,6},{39,7},{39,8},{39,9},{39,10},{39,11},{39,12},{39,13},{39,14},{39,15},{39,16},{39,17},{39,18},{39,19},{39,20},{39,21},{39,22},{39,23},{39,24},{39,25},{39,26},{39,27},{39,28},{39,29},{39,30},{39,31},{39,32},{39,33},{39,34},{39,35},{39,36},{39,37},{39,38},{39,39},{39,40},{39,41},{39,42},{39,43},{39,44},{39,45},{39,46},{39,47},{39,48},{39,49},{39,50},{39,51},{39,52},{39,53},{39,54},{39,55},{39,56},{39,57},{39,58},{39,59},{39,60},{39,61},{39,62},{39,63},{39,64},{39,65},{39,66},{39,67},{39,68},{39,69},{39,70},{39,71},{39,72},{39,73},{39,74},{39,75},{39,76},{39,77},{39,78},{39,79},{39,80},{39,81},{39,82},{39,83},{39,84},{39,85},{39,86},{39,87},{39,88},{39,89},{39,90},{39,91},{39,92},{39,93},{39,94},{39,95},{39,96},{39,97},{39,98},{39,99},{39,100},{39,101},{39,102},{39,103},{39,104},{39,105},{39,106},{39,107},{39,108},{39,109},{39,110},{39,111},{39,112},{39,113},{39,114},{39,115},{39,116},{39,117},{39,118},{39,119},{39,120},{39,121},{39,122},{39,123},{39,124},{39,125},{39,126},{39,127},{39,128},{39,129},{39,130},{39,131},{39,132},{39,133},{39,134},{39,135},{39,136},{39,137},{39,138},{39,139},{39,140},{39,141},{39,142},{39,143},{39,144},{39,145},{39,146},{39,147},{39,148},{39,149},{39,150},{38,0},{38,1},{38,2},{38,3},{38,4},{38,5},{38,6},{38,7},{38,8},{38,9},{38,10},{38,11},{38,12},{38,13},{38,14},{38,15},{38,16},{38,17},{38,18},{38,19},{38,20},{38,21},{38,22},{38,23},{38,24},{38,25},{38,26},{38,27},{38,28},{38,29},{38,30},{38,31},{38,32},{38,33},{38,34},{38,35},{38,36},{38,37},{38,38},{38,39},{38,40},{38,41},{38,42},{38,43},{38,44},{38,45},{38,46},{38,47},{38,48},{38,49},{38,50},{38,51},{38,52},{38,53},{38,54},{38,55},{38,56},{38,57},{38,58},{38,59},{38,60},{38,61},{38,62},{38,63},{38,64},{38,65},{38,66},{38,67},{38,68},{38,69},{38,70},{38,71},{38,72},{38,73},{38,74},{38,75},{38,76},{38,77},{38,78},{38,79},{38,80},{38,81},{38,82},{38,83},{38,84},{38,85},{38,86},{38,87},{38,88},{38,89},{38,90},{38,91},{38,92},{38,93},{38,94},{38,95},{38,96},{38,97},{38,98},{38,99},{38,100},{38,101},{38,102},{38,103},{38,104},{38,105},{38,106},{38,107},{38,108},{38,109},{38,110},{38,111},{38,112},{38,113},{38,114},{38,115},{38,116},{38,117},{38,118},{38,119},{38,120},{38,121},{38,122},{38,123},{38,124},{38,125},{38,126},{38,127},{38,128},{38,129},{38,130},{38,131},{38,132},{38,133},{38,134},{38,135},{38,136},{38,137},{38,138},{38,139},{38,140},{38,141},{38,142},{38,143},{38,144},{38,145},{38,146},{38,147},{38,148},{38,149},{38,150},{37,0},{37,1},{37,2},{37,3},{37,4},{37,5},{37,6},{37,7},{37,8},{37,9},{37,10},{37,11},{37,12},{37,13},{37,14},{37,15},{37,16},{37,17},{37,18},{37,19},{37,20},{37,21},{37,22},{37,23},{37,24},{37,25},{37,26},{37,27},{37,28},{37,29},{37,30},{37,31},{37,32},{37,33},{37,34},{37,35},{37,36},{37,37},{37,38},{37,39},{37,40},{37,41},{37,42},{37,43},{37,44},{37,45},{37,46},{37,47},{37,48},{37,49},{37,50},{37,51},{37,52},{37,53},{37,54},{37,55},{37,56},{37,57},{37,58},{37,59},{37,60},{37,61},{37,62},{37,63},{37,64},{37,65},{37,66},{37,67},{37,68},{37,69},{37,70},{37,71},{37,72},{37,73},{37,74},{37,75},{37,76},{37,77},{37,78},{37,79},{37,80},{37,81},{37,82},{37,83},{37,84},{37,85},{37,86},{37,87},{37,88},{37,89},{37,90},{37,91},{37,92},{37,93},{37,94},{37,95},{37,96},{37,97},{37,98},{37,99},{37,100},{37,101},{37,102},{37,103},{37,104},{37,105},{37,106},{37,107},{37,108},{37,109},{37,110},{37,111},{37,112},{37,113},{37,114},{37,115},{37,116},{37,117},{37,118},{37,119},{37,120},{37,121},{37,122},{37,123},{37,124},{37,125},{37,126},{37,127},{37,128},{37,129},{37,130},{37,131},{37,132},{37,133},{37,134},{37,135},{37,136},{37,137},{37,138},{37,139},{37,140},{37,141},{37,142},{37,143},{37,144},{37,145},{37,146},{37,147},{37,148},{37,149},{37,150},{36,0},{36,1},{36,2},{36,3},{36,4},{36,5},{36,6},{36,7},{36,8},{36,9},{36,10},{36,11},{36,12},{36,13},{36,14},{36,15},{36,16},{36,17},{36,18},{36,19},{36,20},{36,21},{36,22},{36,23},{36,24},{36,25},{36,26},{36,27},{36,28},{36,29},{36,30},{36,31},{36,32},{36,33},{36,34},{36,35},{36,36},{36,37},{36,38},{36,39},{36,40},{36,41},{36,42},{36,43},{36,44},{36,45},{36,46},{36,47},{36,48},{36,49},{36,50},{36,51},{36,52},{36,53},{36,54},{36,55},{36,56},{36,57},{36,58},{36,59},{36,60},{36,61},{36,62},{36,63},{36,64},{36,65},{36,66},{36,67},{36,68},{36,69},{36,70},{36,71},{36,72},{36,73},{36,74},{36,75},{36,76},{36,77},{36,78},{36,79},{36,80},{36,81},{36,82},{36,83},{36,84},{36,85},{36,86},{36,87},{36,88},{36,89},{36,90},{36,91},{36,92},{36,93},{36,94},{36,95},{36,96},{36,97},{36,98},{36,99},{36,100},{36,101},{36,102},{36,103},{36,104},{36,105},{36,106},{36,107},{36,108},{36,109},{36,110},{36,111},{36,112},{36,113},{36,114},{36,115},{36,116},{36,117},{36,118},{36,119},{36,120},{36,121},{36,122},{36,123},{36,124},{36,125},{36,126},{36,127},{36,128},{36,129},{36,130},{36,131},{36,132},{36,133},{36,134},{36,135},{36,136},{36,137},{36,138},{36,139},{36,140},{36,141},{36,142},{36,143},{36,144},{36,145},{36,146},{36,147},{36,148},{36,149},{36,150},{35,0},{35,1},{35,2},{35,3},{35,4},{35,5},{35,6},{35,7},{35,8},{35,9},{35,10},{35,11},{35,12},{35,13},{35,14},{35,15},{35,16},{35,17},{35,18},{35,19},{35,20},{35,21},{35,22},{35,23},{35,24},{35,25},{35,26},{35,27},{35,28},{35,29},{35,30},{35,31},{35,32},{35,33},{35,34},{35,35},{35,36},{35,37},{35,38},{35,39},{35,40},{35,41},{35,42},{35,43},{35,44},{35,45},{35,46},{35,47},{35,48},{35,49},{35,50},{35,51},{35,52},{35,53},{35,54},{35,55},{35,56},{35,57},{35,58},{35,59},{35,60},{35,61},{35,62},{35,63},{35,64},{35,65},{35,66},{35,67},{35,68},{35,69},{35,70},{35,71},{35,72},{35,73},{35,74},{35,75},{35,76},{35,77},{35,78},{35,79},{35,80},{35,81},{35,82},{35,83},{35,84},{35,85},{35,86},{35,87},{35,88},{35,89},{35,90},{35,91},{35,92},{35,93},{35,94},{35,95},{35,96},{35,97},{35,98},{35,99},{35,100},{35,101},{35,102},{35,103},{35,104},{35,105},{35,106},{35,107},{35,108},{35,109},{35,110},{35,111},{35,112},{35,113},{35,114},{35,115},{35,116},{35,117},{35,118},{35,119},{35,120},{35,121},{35,122},{35,123},{35,124},{35,125},{35,126},{35,127},{35,128},{35,129},{35,130},{35,131},{35,132},{35,133},{35,134},{35,135},{35,136},{35,137},{35,138},{35,139},{35,140},{35,141},{35,142},{35,143},{35,144},{35,145},{35,146},{35,147},{35,148},{35,149},{35,150},{34,0},{34,1},{34,2},{34,3},{34,4},{34,5},{34,6},{34,7},{34,8},{34,9},{34,10},{34,11},{34,12},{34,13},{34,14},{34,15},{34,16},{34,17},{34,18},{34,19},{34,20},{34,21},{34,22},{34,23},{34,24},{34,25},{34,26},{34,27},{34,28},{34,29},{34,30},{34,31},{34,32},{34,33},{34,34},{34,35},{34,36},{34,37},{34,38},{34,39},{34,40},{34,41},{34,42},{34,43},{34,44},{34,45},{34,46},{34,47},{34,48},{34,49},{34,50},{34,51},{34,52},{34,53},{34,54},{34,55},{34,56},{34,57},{34,58},{34,59},{34,60},{34,61},{34,62},{34,63},{34,64},{34,65},{34,66},{34,67},{34,68},{34,69},{34,70},{34,71},{34,72},{34,73},{34,74},{34,75},{34,76},{34,77},{34,78},{34,79},{34,80},{34,81},{34,82},{34,83},{34,84},{34,85},{34,86},{34,87},{34,88},{34,89},{34,90},{34,91},{34,92},{34,93},{34,94},{34,95},{34,96},{34,97},{34,98},{34,99},{34,100},{34,101},{34,102},{34,103},{34,104},{34,105},{34,106},{34,107},{34,108},{34,109},{34,110},{34,111},{34,112},{34,113},{34,114},{34,115},{34,116},{34,117},{34,118},{34,119},{34,120},{34,121},{34,122},{34,123},{34,124},{34,125},{34,126},{34,127},{34,128},{34,129},{34,130},{34,131},{34,132},{34,133},{34,134},{34,135},{34,136},{34,137},{34,138},{34,139},{34,140},{34,141},{34,142},{34,143},{34,144},{34,145},{34,146},{34,147},{34,148},{34,149},{34,150},{33,0},{33,1},{33,2},{33,3},{33,4},{33,5},{33,6},{33,7},{33,8},{33,9},{33,10},{33,11},{33,12},{33,13},{33,14},{33,15},{33,16},{33,17},{33,18},{33,19},{33,20},{33,21},{33,22},{33,23},{33,24},{33,25},{33,26},{33,27},{33,28},{33,29},{33,30},{33,31},{33,32},{33,33},{33,34},{33,35},{33,36},{33,37},{33,38},{33,39},{33,40},{33,41},{33,42},{33,43},{33,44},{33,45},{33,46},{33,47},{33,48},{33,49},{33,50},{33,51},{33,52},{33,53},{33,54},{33,55},{33,56},{33,57},{33,58},{33,59},{33,60},{33,61},{33,62},{33,63},{33,64},{33,65},{33,66},{33,67},{33,68},{33,69},{33,70},{33,71},{33,72},{33,73},{33,74},{33,75},{33,76},{33,77},{33,78},{33,79},{33,80},{33,81},{33,82},{33,83},{33,84},{33,85},{33,86},{33,87},{33,88},{33,89},{33,90},{33,91},{33,92},{33,93},{33,94},{33,95},{33,96},{33,97},{33,98},{33,99},{33,100},{33,101},{33,102},{33,103},{33,104},{33,105},{33,106},{33,107},{33,108},{33,109},{33,110},{33,111},{33,112},{33,113},{33,114},{33,115},{33,116},{33,117},{33,118},{33,119},{33,120},{33,121},{33,122},{33,123},{33,124},{33,125},{33,126},{33,127},{33,128},{33,129},{33,130},{33,131},{33,132},{33,133},{33,134},{33,135},{33,136},{33,137},{33,138},{33,139},{33,140},{33,141},{33,142},{33,143},{33,144},{33,145},{33,146},{33,147},{33,148},{33,149},{33,150},{32,0},{32,1},{32,2},{32,3},{32,4},{32,5},{32,6},{32,7},{32,8},{32,9},{32,10},{32,11},{32,12},{32,13},{32,14},{32,15},{32,16},{32,17},{32,18},{32,19},{32,20},{32,21},{32,22},{32,23},{32,24},{32,25},{32,26},{32,27},{32,28},{32,29},{32,30},{32,31},{32,32},{32,33},{32,34},{32,35},{32,36},{32,37},{32,38},{32,39},{32,40},{32,41},{32,42},{32,43},{32,44},{32,45},{32,46},{32,47},{32,48},{32,49},{32,50},{32,51},{32,52},{32,53},{32,54},{32,55},{32,56},{32,57},{32,58},{32,59},{32,60},{32,61},{32,62},{32,63},{32,64},{32,65},{32,66},{32,67},{32,68},{32,69},{32,70},{32,71},{32,72},{32,73},{32,74},{32,75},{32,76},{32,77},{32,78},{32,79},{32,80},{32,81},{32,82},{32,83},{32,84},{32,85},{32,86},{32,87},{32,88},{32,89},{32,90},{32,91},{32,92},{32,93},{32,94},{32,95},{32,96},{32,97},{32,98},{32,99},{32,100},{32,101},{32,102},{32,103},{32,104},{32,105},{32,106},{32,107},{32,108},{32,109},{32,110},{32,111},{32,112},{32,113},{32,114},{32,115},{32,116},{32,117},{32,118},{32,119},{32,120},{32,121},{32,122},{32,123},{32,124},{32,125},{32,126},{32,127},{32,128},{32,129},{32,130},{32,131},{32,132},{32,133},{32,134},{32,135},{32,136},{32,137},{32,138},{32,139},{32,140},{32,141},{32,142},{32,143},{32,144},{32,145},{32,146},{32,147},{32,148},{32,149},{32,150},{31,0},{31,1},{31,2},{31,3},{31,4},{31,5},{31,6},{31,7},{31,8},{31,9},{31,10},{31,11},{31,12},{31,13},{31,14},{31,15},{31,16},{31,17},{31,18},{31,19},{31,20},{31,21},{31,22},{31,23},{31,24},{31,25},{31,26},{31,27},{31,28},{31,29},{31,30},{31,31},{31,32},{31,33},{31,34},{31,35},{31,36},{31,37},{31,38},{31,39},{31,40},{31,41},{31,42},{31,43},{31,44},{31,45},{31,46},{31,47},{31,48},{31,49},{31,50},{31,51},{31,52},{31,53},{31,54},{31,55},{31,56},{31,57},{31,58},{31,59},{31,60},{31,61},{31,62},{31,63},{31,64},{31,65},{31,66},{31,67},{31,68},{31,69},{31,70},{31,71},{31,72},{31,73},{31,74},{31,75},{31,76},{31,77},{31,78},{31,79},{31,80},{31,81},{31,82},{31,83},{31,84},{31,85},{31,86},{31,87},{31,88},{31,89},{31,90},{31,91},{31,92},{31,93},{31,94},{31,95},{31,96},{31,97},{31,98},{31,99},{31,100},{31,101},{31,102},{31,103},{31,104},{31,105},{31,106},{31,107},{31,108},{31,109},{31,110},{31,111},{31,112},{31,113},{31,114},{31,115},{31,116},{31,117},{31,118},{31,119},{31,120},{31,121},{31,122},{31,123},{31,124},{31,125},{31,126},{31,127},{31,128},{31,129},{31,130},{31,131},{31,132},{31,133},{31,134},{31,135},{31,136},{31,137},{31,138},{31,139},{31,140},{31,141},{31,142},{31,143},{31,144},{31,145},{31,146},{31,147},{31,148},{31,149},{31,150},{30,0},{30,1},{30,2},{30,3},{30,4},{30,5},{30,6},{30,7},{30,8},{30,9},{30,10},{30,11},{30,12},{30,13},{30,14},{30,15},{30,16},{30,17},{30,18},{30,19},{30,20},{30,21},{30,22},{30,23},{30,24},{30,25},{30,26},{30,27},{30,28},{30,29},{30,30},{30,31},{30,32},{30,33},{30,34},{30,35},{30,36},{30,37},{30,38},{30,39},{30,40},{30,41},{30,42},{30,43},{30,44},{30,45},{30,46},{30,47},{30,48},{30,49},{30,50},{30,51},{30,52},{30,53},{30,54},{30,55},{30,56},{30,57},{30,58},{30,59},{30,60},{30,61},{30,62},{30,63},{30,64},{30,65},{30,66},{30,67},{30,68},{30,69},{30,70},{30,71},{30,72},{30,73},{30,74},{30,75},{30,76},{30,77},{30,78},{30,79},{30,80},{30,81},{30,82},{30,83},{30,84},{30,85},{30,86},{30,87},{30,88},{30,89},{30,90},{30,91},{30,92},{30,93},{30,94},{30,95},{30,96},{30,97},{30,98},{30,99},{30,100},{30,101},{30,102},{30,103},{30,104},{30,105},{30,106},{30,107},{30,108},{30,109},{30,110},{30,111},{30,112},{30,113},{30,114},{30,115},{30,116},{30,117},{30,118},{30,119},{30,120},{30,121},{30,122},{30,123},{30,124},{30,125},{30,126},{30,127},{30,128},{30,129},{30,130},{30,131},{30,132},{30,133},{30,134},{30,135},{30,136},{30,137},{30,138},{30,139},{30,140},{30,141},{30,142},{30,143},{30,144},{30,145},{30,146},{30,147},{30,148},{30,149},{30,150},{29,0},{29,1},{29,2},{29,3},{29,4},{29,5},{29,6},{29,7},{29,8},{29,9},{29,10},{29,11},{29,12},{29,13},{29,14},{29,15},{29,16},{29,17},{29,18},{29,19},{29,20},{29,21},{29,22},{29,23},{29,24},{29,25},{29,26},{29,27},{29,28},{29,29},{29,30},{29,31},{29,32},{29,33},{29,34},{29,35},{29,36},{29,37},{29,38},{29,39},{29,40},{29,41},{29,42},{29,43},{29,44},{29,45},{29,46},{29,47},{29,48},{29,49},{29,50},{29,51},{29,52},{29,53},{29,54},{29,55},{29,56},{29,57},{29,58},{29,59},{29,60},{29,61},{29,62},{29,63},{29,64},{29,65},{29,66},{29,67},{29,68},{29,69},{29,70},{29,71},{29,72},{29,73},{29,74},{29,75},{29,76},{29,77},{29,78},{29,79},{29,80},{29,81},{29,82},{29,83},{29,84},{29,85},{29,86},{29,87},{29,88},{29,89},{29,90},{29,91},{29,92},{29,93},{29,94},{29,95},{29,96},{29,97},{29,98},{29,99},{29,100},{29,101},{29,102},{29,103},{29,104},{29,105},{29,106},{29,107},{29,108},{29,109},{29,110},{29,111},{29,112},{29,113},{29,114},{29,115},{29,116},{29,117},{29,118},{29,119},{29,120},{29,121},{29,122},{29,123},{29,124},{29,125},{29,126},{29,127},{29,128},{29,129},{29,130},{29,131},{29,132},{29,133},{29,134},{29,135},{29,136},{29,137},{29,138},{29,139},{29,140},{29,141},{29,142},{29,143},{29,144},{29,145},{29,146},{29,147},{29,148},{29,149},{29,150},{28,0},{28,1},{28,2},{28,3},{28,4},{28,5},{28,6},{28,7},{28,8},{28,9},{28,10},{28,11},{28,12},{28,13},{28,14},{28,15},{28,16},{28,17},{28,18},{28,19},{28,20},{28,21},{28,22},{28,23},{28,24},{28,25},{28,26},{28,27},{28,28},{28,29},{28,30},{28,31},{28,32},{28,33},{28,34},{28,35},{28,36},{28,37},{28,38},{28,39},{28,40},{28,41},{28,42},{28,43},{28,44},{28,45},{28,46},{28,47},{28,48},{28,49},{28,50},{28,51},{28,52},{28,53},{28,54},{28,55},{28,56},{28,57},{28,58},{28,59},{28,60},{28,61},{28,62},{28,63},{28,64},{28,65},{28,66},{28,67},{28,68},{28,69},{28,70},{28,71},{28,72},{28,73},{28,74},{28,75},{28,76},{28,77},{28,78},{28,79},{28,80},{28,81},{28,82},{28,83},{28,84},{28,85},{28,86},{28,87},{28,88},{28,89},{28,90},{28,91},{28,92},{28,93},{28,94},{28,95},{28,96},{28,97},{28,98},{28,99},{28,100},{28,101},{28,102},{28,103},{28,104},{28,105},{28,106},{28,107},{28,108},{28,109},{28,110},{28,111},{28,112},{28,113},{28,114},{28,115},{28,116},{28,117},{28,118},{28,119},{28,120},{28,121},{28,122},{28,123},{28,124},{28,125},{28,126},{28,127},{28,128},{28,129},{28,130},{28,131},{28,132},{28,133},{28,134},{28,135},{28,136},{28,137},{28,138},{28,139},{28,140},{28,141},{28,142},{28,143},{28,144},{28,145},{28,146},{28,147},{28,148},{28,149},{28,150},{27,0},{27,1},{27,2},{27,3},{27,4},{27,5},{27,6},{27,7},{27,8},{27,9},{27,10},{27,11},{27,12},{27,13},{27,14},{27,15},{27,16},{27,17},{27,18},{27,19},{27,20},{27,21},{27,22},{27,23},{27,24},{27,25},{27,26},{27,27},{27,28},{27,29},{27,30},{27,31},{27,32},{27,33},{27,34},{27,35},{27,36},{27,37},{27,38},{27,39},{27,40},{27,41},{27,42},{27,43},{27,44},{27,45},{27,46},{27,47},{27,48},{27,49},{27,50},{27,51},{27,52},{27,53},{27,54},{27,55},{27,56},{27,57},{27,58},{27,59},{27,60},{27,61},{27,62},{27,63},{27,64},{27,65},{27,66},{27,67},{27,68},{27,69},{27,70},{27,71},{27,72},{27,73},{27,74},{27,75},{27,76},{27,77},{27,78},{27,79},{27,80},{27,81},{27,82},{27,83},{27,84},{27,85},{27,86},{27,87},{27,88},{27,89},{27,90},{27,91},{27,92},{27,93},{27,94},{27,95},{27,96},{27,97},{27,98},{27,99},{27,100},{27,101},{27,102},{27,103},{27,104},{27,105},{27,106},{27,107},{27,108},{27,109},{27,110},{27,111},{27,112},{27,113},{27,114},{27,115},{27,116},{27,117},{27,118},{27,119},{27,120},{27,121},{27,122},{27,123},{27,124},{27,125},{27,126},{27,127},{27,128},{27,129},{27,130},{27,131},{27,132},{27,133},{27,134},{27,135},{27,136},{27,137},{27,138},{27,139},{27,140},{27,141},{27,142},{27,143},{27,144},{27,145},{27,146},{27,147},{27,148},{27,149},{27,150},{26,0},{26,1},{26,2},{26,3},{26,4},{26,5},{26,6},{26,7},{26,8},{26,9},{26,10},{26,11},{26,12},{26,13},{26,14},{26,15},{26,16},{26,17},{26,18},{26,19},{26,20},{26,21},{26,22},{26,23},{26,24},{26,25},{26,26},{26,27},{26,28},{26,29},{26,30},{26,31},{26,32},{26,33},{26,34},{26,35},{26,36},{26,37},{26,38},{26,39},{26,40},{26,41},{26,42},{26,43},{26,44},{26,45},{26,46},{26,47},{26,48},{26,49},{26,50},{26,51},{26,52},{26,53},{26,54},{26,55},{26,56},{26,57},{26,58},{26,59},{26,60},{26,61},{26,62},{26,63},{26,64},{26,65},{26,66},{26,67},{26,68},{26,69},{26,70},{26,71},{26,72},{26,73},{26,74},{26,75},{26,76},{26,77},{26,78},{26,79},{26,80},{26,81},{26,82},{26,83},{26,84},{26,85},{26,86},{26,87},{26,88},{26,89},{26,90},{26,91},{26,92},{26,93},{26,94},{26,95},{26,96},{26,97},{26,98},{26,99},{26,100},{26,101},{26,102},{26,103},{26,104},{26,105},{26,106},{26,107},{26,108},{26,109},{26,110},{26,111},{26,112},{26,113},{26,114},{26,115},{26,116},{26,117},{26,118},{26,119},{26,120},{26,121},{26,122},{26,123},{26,124},{26,125},{26,126},{26,127},{26,128},{26,129},{26,130},{26,131},{26,132},{26,133},{26,134},{26,135},{26,136},{26,137},{26,138},{26,139},{26,140},{26,141},{26,142},{26,143},{26,144},{26,145},{26,146},{26,147},{26,148},{26,149},{26,150},{25,0},{25,1},{25,2},{25,3},{25,4},{25,5},{25,6},{25,7},{25,8},{25,9},{25,10},{25,11},{25,12},{25,13},{25,14},{25,15},{25,16},{25,17},{25,18},{25,19},{25,20},{25,21},{25,22},{25,23},{25,24},{25,25},{25,26},{25,27},{25,28},{25,29},{25,30},{25,31},{25,32},{25,33},{25,34},{25,35},{25,36},{25,37},{25,38},{25,39},{25,40},{25,41},{25,42},{25,43},{25,44},{25,45},{25,46},{25,47},{25,48},{25,49},{25,50},{25,51},{25,52},{25,53},{25,54},{25,55},{25,56},{25,57},{25,58},{25,59},{25,60},{25,61},{25,62},{25,63},{25,64},{25,65},{25,66},{25,67},{25,68},{25,69},{25,70},{25,71},{25,72},{25,73},{25,74},{25,75},{25,76},{25,77},{25,78},{25,79},{25,80},{25,81},{25,82},{25,83},{25,84},{25,85},{25,86},{25,87},{25,88},{25,89},{25,90},{25,91},{25,92},{25,93},{25,94},{25,95},{25,96},{25,97},{25,98},{25,99},{25,100},{25,101},{25,102},{25,103},{25,104},{25,105},{25,106},{25,107},{25,108},{25,109},{25,110},{25,111},{25,112},{25,113},{25,114},{25,115},{25,116},{25,117},{25,118},{25,119},{25,120},{25,121},{25,122},{25,123},{25,124},{25,125},{25,126},{25,127},{25,128},{25,129},{25,130},{25,131},{25,132},{25,133},{25,134},{25,135},{25,136},{25,137},{25,138},{25,139},{25,140},{25,141},{25,142},{25,143},{25,144},{25,145},{25,146},{25,147},{25,148},{25,149},{25,150},{24,0},{24,1},{24,2},{24,3},{24,4},{24,5},{24,6},{24,7},{24,8},{24,9},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{24,25},{24,26},{24,27},{24,28},{24,29},{24,30},{24,31},{24,32},{24,33},{24,34},{24,35},{24,36},{24,37},{24,38},{24,39},{24,40},{24,41},{24,42},{24,43},{24,44},{24,45},{24,46},{24,47},{24,48},{24,49},{24,50},{24,51},{24,52},{24,53},{24,54},{24,55},{24,56},{24,57},{24,58},{24,59},{24,60},{24,61},{24,62},{24,63},{24,64},{24,65},{24,66},{24,67},{24,68},{24,69},{24,70},{24,71},{24,72},{24,73},{24,74},{24,75},{24,76},{24,77},{24,78},{24,79},{24,80},{24,81},{24,82},{24,83},{24,84},{24,85},{24,86},{24,87},{24,88},{24,89},{24,90},{24,91},{24,92},{24,93},{24,94},{24,95},{24,96},{24,97},{24,98},{24,99},{24,100},{24,101},{24,102},{24,103},{24,104},{24,105},{24,106},{24,107},{24,108},{24,109},{24,110},{24,111},{24,112},{24,113},{24,114},{24,115},{24,116},{24,117},{24,118},{24,119},{24,120},{24,121},{24,122},{24,123},{24,124},{24,125},{24,126},{24,127},{24,128},{24,129},{24,130},{24,131},{24,132},{24,133},{24,134},{24,135},{24,136},{24,137},{24,138},{24,139},{24,140},{24,141},{24,142},{24,143},{24,144},{24,145},{24,146},{24,147},{24,148},{24,149},{24,150},{23,0},{23,1},{23,2},{23,3},{23,4},{23,5},{23,6},{23,7},{23,8},{23,9},{23,10},{23,11},{23,12},{23,13},{23,14},{23,15},{23,16},{23,17},{23,18},{23,19},{23,20},{23,21},{23,22},{23,23},{23,24},{23,25},{23,26},{23,27},{23,28},{23,29},{23,30},{23,31},{23,32},{23,33},{23,34},{23,35},{23,36},{23,37},{23,38},{23,39},{23,40},{23,41},{23,42},{23,43},{23,44},{23,45},{23,46},{23,47},{23,48},{23,49},{23,50},{23,51},{23,52},{23,53},{23,54},{23,55},{23,56},{23,57},{23,58},{23,59},{23,60},{23,61},{23,62},{23,63},{23,64},{23,65},{23,66},{23,67},{23,68},{23,69},{23,70},{23,71},{23,72},{23,73},{23,74},{23,75},{23,76},{23,77},{23,78},{23,79},{23,80},{23,81},{23,82},{23,83},{23,84},{23,85},{23,86},{23,87},{23,88},{23,89},{23,90},{23,91},{23,92},{23,93},{23,94},{23,95},{23,96},{23,97},{23,98},{23,99},{23,100},{23,101},{23,102},{23,103},{23,104},{23,105},{23,106},{23,107},{23,108},{23,109},{23,110},{23,111},{23,112},{23,113},{23,114},{23,115},{23,116},{23,117},{23,118},{23,119},{23,120},{23,121},{23,122},{23,123},{23,124},{23,125},{23,126},{23,127},{23,128},{23,129},{23,130},{23,131},{23,132},{23,133},{23,134},{23,135},{23,136},{23,137},{23,138},{23,139},{23,140},{23,141},{23,142},{23,143},{23,144},{23,145},{23,146},{23,147},{23,148},{23,149},{23,150},{22,0},{22,1},{22,2},{22,3},{22,4},{22,5},{22,6},{22,7},{22,8},{22,9},{22,10},{22,11},{22,12},{22,13},{22,14},{22,15},{22,16},{22,17},{22,18},{22,19},{22,20},{22,21},{22,22},{22,23},{22,24},{22,25},{22,26},{22,27},{22,28},{22,29},{22,30},{22,31},{22,32},{22,33},{22,34},{22,35},{22,36},{22,37},{22,38},{22,39},{22,40},{22,41},{22,42},{22,43},{22,44},{22,45},{22,46},{22,47},{22,48},{22,49},{22,50},{22,51},{22,52},{22,53},{22,54},{22,55},{22,56},{22,57},{22,58},{22,59},{22,60},{22,61},{22,62},{22,63},{22,64},{22,65},{22,66},{22,67},{22,68},{22,69},{22,70},{22,71},{22,72},{22,73},{22,74},{22,75},{22,76},{22,77},{22,78},{22,79},{22,80},{22,81},{22,82},{22,83},{22,84},{22,85},{22,86},{22,87},{22,88},{22,89},{22,90},{22,91},{22,92},{22,93},{22,94},{22,95},{22,96},{22,97},{22,98},{22,99},{22,100},{22,101},{22,102},{22,103},{22,104},{22,105},{22,106},{22,107},{22,108},{22,109},{22,110},{22,111},{22,112},{22,113},{22,114},{22,115},{22,116},{22,117},{22,118},{22,119},{22,120},{22,121},{22,122},{22,123},{22,124},{22,125},{22,126},{22,127},{22,128},{22,129},{22,130},{22,131},{22,132},{22,133},{22,134},{22,135},{22,136},{22,137},{22,138},{22,139},{22,140},{22,141},{22,142},{22,143},{22,144},{22,145},{22,146},{22,147},{22,148},{22,149},{22,150},{21,0},{21,1},{21,2},{21,3},{21,4},{21,5},{21,6},{21,7},{21,8},{21,9},{21,10},{21,11},{21,12},{21,13},{21,14},{21,15},{21,16},{21,17},{21,18},{21,19},{21,20},{21,21},{21,22},{21,23},{21,24},{21,25},{21,26},{21,27},{21,28},{21,29},{21,30},{21,31},{21,32},{21,33},{21,34},{21,35},{21,36},{21,37},{21,38},{21,39},{21,40},{21,41},{21,42},{21,43},{21,44},{21,45},{21,46},{21,47},{21,48},{21,49},{21,50},{21,51},{21,52},{21,53},{21,54},{21,55},{21,56},{21,57},{21,58},{21,59},{21,60},{21,61},{21,62},{21,63},{21,64},{21,65},{21,66},{21,67},{21,68},{21,69},{21,70},{21,71},{21,72},{21,73},{21,74},{21,75},{21,76},{21,77},{21,78},{21,79},{21,80},{21,81},{21,82},{21,83},{21,84},{21,85},{21,86},{21,87},{21,88},{21,89},{21,90},{21,91},{21,92},{21,93},{21,94},{21,95},{21,96},{21,97},{21,98},{21,99},{21,100},{21,101},{21,102},{21,103},{21,104},{21,105},{21,106},{21,107},{21,108},{21,109},{21,110},{21,111},{21,112},{21,113},{21,114},{21,115},{21,116},{21,117},{21,118},{21,119},{21,120},{21,121},{21,122},{21,123},{21,124},{21,125},{21,126},{21,127},{21,128},{21,129},{21,130},{21,131},{21,132},{21,133},{21,134},{21,135},{21,136},{21,137},{21,138},{21,139},{21,140},{21,141},{21,142},{21,143},{21,144},{21,145},{21,146},{21,147},{21,148},{21,149},{21,150},{20,0},{20,1},{20,2},{20,3},{20,4},{20,5},{20,6},{20,7},{20,8},{20,9},{20,10},{20,11},{20,12},{20,13},{20,14},{20,15},{20,16},{20,17},{20,18},{20,19},{20,20},{20,21},{20,22},{20,23},{20,24},{20,25},{20,26},{20,27},{20,28},{20,29},{20,30},{20,31},{20,32},{20,33},{20,34},{20,35},{20,36},{20,37},{20,38},{20,39},{20,40},{20,41},{20,42},{20,43},{20,44},{20,45},{20,46},{20,47},{20,48},{20,49},{20,50},{20,51},{20,52},{20,53},{20,54},{20,55},{20,56},{20,57},{20,58},{20,59},{20,60},{20,61},{20,62},{20,63},{20,64},{20,65},{20,66},{20,67},{20,68},{20,69},{20,70},{20,71},{20,72},{20,73},{20,74},{20,75},{20,76},{20,77},{20,78},{20,79},{20,80},{20,81},{20,82},{20,83},{20,84},{20,85},{20,86},{20,87},{20,88},{20,89},{20,90},{20,91},{20,92},{20,93},{20,94},{20,95},{20,96},{20,97},{20,98},{20,99},{20,100},{20,101},{20,102},{20,103},{20,104},{20,105},{20,106},{20,107},{20,108},{20,109},{20,110},{20,111},{20,112},{20,113},{20,114},{20,115},{20,116},{20,117},{20,118},{20,119},{20,120},{20,121},{20,122},{20,123},{20,124},{20,125},{20,126},{20,127},{20,128},{20,129},{20,130},{20,131},{20,132},{20,133},{20,134},{20,135},{20,136},{20,137},{20,138},{20,139},{20,140},{20,141},{20,142},{20,143},{20,144},{20,145},{20,146},{20,147},{20,148},{20,149},{20,150},{19,0},{19,1},{19,2},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{19,11},{19,12},{19,13},{19,14},{19,15},{19,16},{19,17},{19,18},{19,19},{19,20},{19,21},{19,22},{19,23},{19,24},{19,25},{19,26},{19,27},{19,28},{19,29},{19,30},{19,31},{19,32},{19,33},{19,34},{19,35},{19,36},{19,37},{19,38},{19,39},{19,40},{19,41},{19,42},{19,43},{19,44},{19,45},{19,46},{19,47},{19,48},{19,49},{19,50},{19,51},{19,52},{19,53},{19,54},{19,55},{19,56},{19,57},{19,58},{19,59},{19,60},{19,61},{19,62},{19,63},{19,64},{19,65},{19,66},{19,67},{19,68},{19,69},{19,70},{19,71},{19,72},{19,73},{19,74},{19,75},{19,76},{19,77},{19,78},{19,79},{19,80},{19,81},{19,82},{19,83},{19,84},{19,85},{19,86},{19,87},{19,88},{19,89},{19,90},{19,91},{19,92},{19,93},{19,94},{19,95},{19,96},{19,97},{19,98},{19,99},{19,100},{19,101},{19,102},{19,103},{19,104},{19,105},{19,106},{19,107},{19,108},{19,109},{19,110},{19,111},{19,112},{19,113},{19,114},{19,115},{19,116},{19,117},{19,118},{19,119},{19,120},{19,121},{19,122},{19,123},{19,124},{19,125},{19,126},{19,127},{19,128},{19,129},{19,130},{19,131},{19,132},{19,133},{19,134},{19,135},{19,136},{19,137},{19,138},{19,139},{19,140},{19,141},{19,142},{19,143},{19,144},{19,145},{19,146},{19,147},{19,148},{19,149},{19,150},{18,0},{18,1},{18,2},{18,3},{18,4},{18,5},{18,6},{18,7},{18,8},{18,9},{18,10},{18,11},{18,12},{18,13},{18,14},{18,15},{18,16},{18,17},{18,18},{18,19},{18,20},{18,21},{18,22},{18,23},{18,24},{18,25},{18,26},{18,27},{18,28},{18,29},{18,30},{18,31},{18,32},{18,33},{18,34},{18,35},{18,36},{18,37},{18,38},{18,39},{18,40},{18,41},{18,42},{18,43},{18,44},{18,45},{18,46},{18,47},{18,48},{18,49},{18,50},{18,51},{18,52},{18,53},{18,54},{18,55},{18,56},{18,57},{18,58},{18,59},{18,60},{18,61},{18,62},{18,63},{18,64},{18,65},{18,66},{18,67},{18,68},{18,69},{18,70},{18,71},{18,72},{18,73},{18,74},{18,75},{18,76},{18,77},{18,78},{18,79},{18,80},{18,81},{18,82},{18,83},{18,84},{18,85},{18,86},{18,87},{18,88},{18,89},{18,90},{18,91},{18,92},{18,93},{18,94},{18,95},{18,96},{18,97},{18,98},{18,99},{18,100},{18,101},{18,102},{18,103},{18,104},{18,105},{18,106},{18,107},{18,108},{18,109},{18,110},{18,111},{18,112},{18,113},{18,114},{18,115},{18,116},{18,117},{18,118},{18,119},{18,120},{18,121},{18,122},{18,123},{18,124},{18,125},{18,126},{18,127},{18,128},{18,129},{18,130},{18,131},{18,132},{18,133},{18,134},{18,135},{18,136},{18,137},{18,138},{18,139},{18,140},{18,141},{18,142},{18,143},{18,144},{18,145},{18,146},{18,147},{18,148},{18,149},{18,150},{17,0},{17,1},{17,2},{17,3},{17,4},{17,5},{17,6},{17,7},{17,8},{17,9},{17,10},{17,11},{17,12},{17,13},{17,14},{17,15},{17,16},{17,17},{17,18},{17,19},{17,20},{17,21},{17,22},{17,23},{17,24},{17,25},{17,26},{17,27},{17,28},{17,29},{17,30},{17,31},{17,32},{17,33},{17,34},{17,35},{17,36},{17,37},{17,38},{17,39},{17,40},{17,41},{17,42},{17,43},{17,44},{17,45},{17,46},{17,47},{17,48},{17,49},{17,50},{17,51},{17,52},{17,53},{17,54},{17,55},{17,56},{17,57},{17,58},{17,59},{17,60},{17,61},{17,62},{17,63},{17,64},{17,65},{17,66},{17,67},{17,68},{17,69},{17,70},{17,71},{17,72},{17,73},{17,74},{17,75},{17,76},{17,77},{17,78},{17,79},{17,80},{17,81},{17,82},{17,83},{17,84},{17,85},{17,86},{17,87},{17,88},{17,89},{17,90},{17,91},{17,92},{17,93},{17,94},{17,95},{17,96},{17,97},{17,98},{17,99},{17,100},{17,101},{17,102},{17,103},{17,104},{17,105},{17,106},{17,107},{17,108},{17,109},{17,110},{17,111},{17,112},{17,113},{17,114},{17,115},{17,116},{17,117},{17,118},{17,119},{17,120},{17,121},{17,122},{17,123},{17,124},{17,125},{17,126},{17,127},{17,128},{17,129},{17,130},{17,131},{17,132},{17,133},{17,134},{17,135},{17,136},{17,137},{17,138},{17,139},{17,140},{17,141},{17,142},{17,143},{17,144},{17,145},{17,146},{17,147},{17,148},{17,149},{17,150},{16,0},{16,1},{16,2},{16,3},{16,4},{16,5},{16,6},{16,7},{16,8},{16,9},{16,10},{16,11},{16,12},{16,13},{16,14},{16,15},{16,16},{16,17},{16,18},{16,19},{16,20},{16,21},{16,22},{16,23},{16,24},{16,25},{16,26},{16,27},{16,28},{16,29},{16,30},{16,31},{16,32},{16,33},{16,34},{16,35},{16,36},{16,37},{16,38},{16,39},{16,40},{16,41},{16,42},{16,43},{16,44},{16,45},{16,46},{16,47},{16,48},{16,49},{16,50},{16,51},{16,52},{16,53},{16,54},{16,55},{16,56},{16,57},{16,58},{16,59},{16,60},{16,61},{16,62},{16,63},{16,64},{16,65},{16,66},{16,67},{16,68},{16,69},{16,70},{16,71},{16,72},{16,73},{16,74},{16,75},{16,76},{16,77},{16,78},{16,79},{16,80},{16,81},{16,82},{16,83},{16,84},{16,85},{16,86},{16,87},{16,88},{16,89},{16,90},{16,91},{16,92},{16,93},{16,94},{16,95},{16,96},{16,97},{16,98},{16,99},{16,100},{16,101},{16,102},{16,103},{16,104},{16,105},{16,106},{16,107},{16,108},{16,109},{16,110},{16,111},{16,112},{16,113},{16,114},{16,115},{16,116},{16,117},{16,118},{16,119},{16,120},{16,121},{16,122},{16,123},{16,124},{16,125},{16,126},{16,127},{16,128},{16,129},{16,130},{16,131},{16,132},{16,133},{16,134},{16,135},{16,136},{16,137},{16,138},{16,139},{16,140},{16,141},{16,142},{16,143},{16,144},{16,145},{16,146},{16,147},{16,148},{16,149},{16,150},{15,0},{15,1},{15,2},{15,3},{15,4},{15,5},{15,6},{15,7},{15,8},{15,9},{15,10},{15,11},{15,12},{15,13},{15,14},{15,15},{15,16},{15,17},{15,18},{15,19},{15,20},{15,21},{15,22},{15,23},{15,24},{15,25},{15,26},{15,27},{15,28},{15,29},{15,30},{15,31},{15,32},{15,33},{15,34},{15,35},{15,36},{15,37},{15,38},{15,39},{15,40},{15,41},{15,42},{15,43},{15,44},{15,45},{15,46},{15,47},{15,48},{15,49},{15,50},{15,51},{15,52},{15,53},{15,54},{15,55},{15,56},{15,57},{15,58},{15,59},{15,60},{15,61},{15,62},{15,63},{15,64},{15,65},{15,66},{15,67},{15,68},{15,69},{15,70},{15,71},{15,72},{15,73},{15,74},{15,75},{15,76},{15,77},{15,78},{15,79},{15,80},{15,81},{15,82},{15,83},{15,84},{15,85},{15,86},{15,87},{15,88},{15,89},{15,90},{15,91},{15,92},{15,93},{15,94},{15,95},{15,96},{15,97},{15,98},{15,99},{15,100},{15,101},{15,102},{15,103},{15,104},{15,105},{15,106},{15,107},{15,108},{15,109},{15,110},{15,111},{15,112},{15,113},{15,114},{15,115},{15,116},{15,117},{15,118},{15,119},{15,120},{15,121},{15,122},{15,123},{15,124},{15,125},{15,126},{15,127},{15,128},{15,129},{15,130},{15,131},{15,132},{15,133},{15,134},{15,135},{15,136},{15,137},{15,138},{15,139},{15,140},{15,141},{15,142},{15,143},{15,144},{15,145},{15,146},{15,147},{15,148},{15,149},{15,150},{14,0},{14,1},{14,2},{14,3},{14,4},{14,5},{14,6},{14,7},{14,8},{14,9},{14,10},{14,11},{14,12},{14,13},{14,14},{14,15},{14,16},{14,17},{14,18},{14,19},{14,20},{14,21},{14,22},{14,23},{14,24},{14,25},{14,26},{14,27},{14,28},{14,29},{14,30},{14,31},{14,32},{14,33},{14,34},{14,35},{14,36},{14,37},{14,38},{14,39},{14,40},{14,41},{14,42},{14,43},{14,44},{14,45},{14,46},{14,47},{14,48},{14,49},{14,50},{14,51},{14,52},{14,53},{14,54},{14,55},{14,56},{14,57},{14,58},{14,59},{14,60},{14,61},{14,62},{14,63},{14,64},{14,65},{14,66},{14,67},{14,68},{14,69},{14,70},{14,71},{14,72},{14,73},{14,74},{14,75},{14,76},{14,77},{14,78},{14,79},{14,80},{14,81},{14,82},{14,83},{14,84},{14,85},{14,86},{14,87},{14,88},{14,89},{14,90},{14,91},{14,92},{14,93},{14,94},{14,95},{14,96},{14,97},{14,98},{14,99},{14,100},{14,101},{14,102},{14,103},{14,104},{14,105},{14,106},{14,107},{14,108},{14,109},{14,110},{14,111},{14,112},{14,113},{14,114},{14,115},{14,116},{14,117},{14,118},{14,119},{14,120},{14,121},{14,122},{14,123},{14,124},{14,125},{14,126},{14,127},{14,128},{14,129},{14,130},{14,131},{14,132},{14,133},{14,134},{14,135},{14,136},{14,137},{14,138},{14,139},{14,140},{14,141},{14,142},{14,143},{14,144},{14,145},{14,146},{14,147},{14,148},{14,149},{14,150},{13,0},{13,1},{13,2},{13,3},{13,4},{13,5},{13,6},{13,7},{13,8},{13,9},{13,10},{13,11},{13,12},{13,13},{13,14},{13,15},{13,16},{13,17},{13,18},{13,19},{13,20},{13,21},{13,22},{13,23},{13,24},{13,25},{13,26},{13,27},{13,28},{13,29},{13,30},{13,31},{13,32},{13,33},{13,34},{13,35},{13,36},{13,37},{13,38},{13,39},{13,40},{13,41},{13,42},{13,43},{13,44},{13,45},{13,46},{13,47},{13,48},{13,49},{13,50},{13,51},{13,52},{13,53},{13,54},{13,55},{13,56},{13,57},{13,58},{13,59},{13,60},{13,61},{13,62},{13,63},{13,64},{13,65},{13,66},{13,67},{13,68},{13,69},{13,70},{13,71},{13,72},{13,73},{13,74},{13,75},{13,76},{13,77},{13,78},{13,79},{13,80},{13,81},{13,82},{13,83},{13,84},{13,85},{13,86},{13,87},{13,88},{13,89},{13,90},{13,91},{13,92},{13,93},{13,94},{13,95},{13,96},{13,97},{13,98},{13,99},{13,100},{13,101},{13,102},{13,103},{13,104},{13,105},{13,106},{13,107},{13,108},{13,109},{13,110},{13,111},{13,112},{13,113},{13,114},{13,115},{13,116},{13,117},{13,118},{13,119},{13,120},{13,121},{13,122},{13,123},{13,124},{13,125},{13,126},{13,127},{13,128},{13,129},{13,130},{13,131},{13,132},{13,133},{13,134},{13,135},{13,136},{13,137},{13,138},{13,139},{13,140},{13,141},{13,142},{13,143},{13,144},{13,145},{13,146},{13,147},{13,148},{13,149},{13,150},{12,0},{12,1},{12,2},{12,3},{12,4},{12,5},{12,6},{12,7},{12,8},{12,9},{12,10},{12,11},{12,12},{12,13},{12,14},{12,15},{12,16},{12,17},{12,18},{12,19},{12,20},{12,21},{12,22},{12,23},{12,24},{12,25},{12,26},{12,27},{12,28},{12,29},{12,30},{12,31},{12,32},{12,33},{12,34},{12,35},{12,36},{12,37},{12,38},{12,39},{12,40},{12,41},{12,42},{12,43},{12,44},{12,45},{12,46},{12,47},{12,48},{12,49},{12,50},{12,51},{12,52},{12,53},{12,54},{12,55},{12,56},{12,57},{12,58},{12,59},{12,60},{12,61},{12,62},{12,63},{12,64},{12,65},{12,66},{12,67},{12,68},{12,69},{12,70},{12,71},{12,72},{12,73},{12,74},{12,75},{12,76},{12,77},{12,78},{12,79},{12,80},{12,81},{12,82},{12,83},{12,84},{12,85},{12,86},{12,87},{12,88},{12,89},{12,90},{12,91},{12,92},{12,93},{12,94},{12,95},{12,96},{12,97},{12,98},{12,99},{12,100},{12,101},{12,102},{12,103},{12,104},{12,105},{12,106},{12,107},{12,108},{12,109},{12,110},{12,111},{12,112},{12,113},{12,114},{12,115},{12,116},{12,117},{12,118},{12,119},{12,120},{12,121},{12,122},{12,123},{12,124},{12,125},{12,126},{12,127},{12,128},{12,129},{12,130},{12,131},{12,132},{12,133},{12,134},{12,135},{12,136},{12,137},{12,138},{12,139},{12,140},{12,141},{12,142},{12,143},{12,144},{12,145},{12,146},{12,147},{12,148},{12,149},{12,150},{11,0},{11,1},{11,2},{11,3},{11,4},{11,5},{11,6},{11,7},{11,8},{11,9},{11,10},{11,11},{11,12},{11,13},{11,14},{11,15},{11,16},{11,17},{11,18},{11,19},{11,20},{11,21},{11,22},{11,23},{11,24},{11,25},{11,26},{11,27},{11,28},{11,29},{11,30},{11,31},{11,32},{11,33},{11,34},{11,35},{11,36},{11,37},{11,38},{11,39},{11,40},{11,41},{11,42},{11,43},{11,44},{11,45},{11,46},{11,47},{11,48},{11,49},{11,50},{11,51},{11,52},{11,53},{11,54},{11,55},{11,56},{11,57},{11,58},{11,59},{11,60},{11,61},{11,62},{11,63},{11,64},{11,65},{11,66},{11,67},{11,68},{11,69},{11,70},{11,71},{11,72},{11,73},{11,74},{11,75},{11,76},{11,77},{11,78},{11,79},{11,80},{11,81},{11,82},{11,83},{11,84},{11,85},{11,86},{11,87},{11,88},{11,89},{11,90},{11,91},{11,92},{11,93},{11,94},{11,95},{11,96},{11,97},{11,98},{11,99},{11,100},{11,101},{11,102},{11,103},{11,104},{11,105},{11,106},{11,107},{11,108},{11,109},{11,110},{11,111},{11,112},{11,113},{11,114},{11,115},{11,116},{11,117},{11,118},{11,119},{11,120},{11,121},{11,122},{11,123},{11,124},{11,125},{11,126},{11,127},{11,128},{11,129},{11,130},{11,131},{11,132},{11,133},{11,134},{11,135},{11,136},{11,137},{11,138},{11,139},{11,140},{11,141},{11,142},{11,143},{11,144},{11,145},{11,146},{11,147},{11,148},{11,149},{11,150},{10,0},{10,1},{10,2},{10,3},{10,4},{10,5},{10,6},{10,7},{10,8},{10,9},{10,10},{10,11},{10,12},{10,13},{10,14},{10,15},{10,16},{10,17},{10,18},{10,19},{10,20},{10,21},{10,22},{10,23},{10,24},{10,25},{10,26},{10,27},{10,28},{10,29},{10,30},{10,31},{10,32},{10,33},{10,34},{10,35},{10,36},{10,37},{10,38},{10,39},{10,40},{10,41},{10,42},{10,43},{10,44},{10,45},{10,46},{10,47},{10,48},{10,49},{10,50},{10,51},{10,52},{10,53},{10,54},{10,55},{10,56},{10,57},{10,58},{10,59},{10,60},{10,61},{10,62},{10,63},{10,64},{10,65},{10,66},{10,67},{10,68},{10,69},{10,70},{10,71},{10,72},{10,73},{10,74},{10,75},{10,76},{10,77},{10,78},{10,79},{10,80},{10,81},{10,82},{10,83},{10,84},{10,85},{10,86},{10,87},{10,88},{10,89},{10,90},{10,91},{10,92},{10,93},{10,94},{10,95},{10,96},{10,97},{10,98},{10,99},{10,100},{10,101},{10,102},{10,103},{10,104},{10,105},{10,106},{10,107},{10,108},{10,109},{10,110},{10,111},{10,112},{10,113},{10,114},{10,115},{10,116},{10,117},{10,118},{10,119},{10,120},{10,121},{10,122},{10,123},{10,124},{10,125},{10,126},{10,127},{10,128},{10,129},{10,130},{10,131},{10,132},{10,133},{10,134},{10,135},{10,136},{10,137},{10,138},{10,139},{10,140},{10,141},{10,142},{10,143},{10,144},{10,145},{10,146},{10,147},{10,148},{10,149},{10,150},{9,0},{9,1},{9,2},{9,3},{9,4},{9,5},{9,6},{9,7},{9,8},{9,9},{9,10},{9,11},{9,12},{9,13},{9,14},{9,15},{9,16},{9,17},{9,18},{9,19},{9,20},{9,21},{9,22},{9,23},{9,24},{9,25},{9,26},{9,27},{9,28},{9,29},{9,30},{9,31},{9,32},{9,33},{9,34},{9,35},{9,36},{9,37},{9,38},{9,39},{9,40},{9,41},{9,42},{9,43},{9,44},{9,45},{9,46},{9,47},{9,48},{9,49},{9,50},{9,51},{9,52},{9,53},{9,54},{9,55},{9,56},{9,57},{9,58},{9,59},{9,60},{9,61},{9,62},{9,63},{9,64},{9,65},{9,66},{9,67},{9,68},{9,69},{9,70},{9,71},{9,72},{9,73},{9,74},{9,75},{9,76},{9,77},{9,78},{9,79},{9,80},{9,81},{9,82},{9,83},{9,84},{9,85},{9,86},{9,87},{9,88},{9,89},{9,90},{9,91},{9,92},{9,93},{9,94},{9,95},{9,96},{9,97},{9,98},{9,99},{9,100},{9,101},{9,102},{9,103},{9,104},{9,105},{9,106},{9,107},{9,108},{9,109},{9,110},{9,111},{9,112},{9,113},{9,114},{9,115},{9,116},{9,117},{9,118},{9,119},{9,120},{9,121},{9,122},{9,123},{9,124},{9,125},{9,126},{9,127},{9,128},{9,129},{9,130},{9,131},{9,132},{9,133},{9,134},{9,135},{9,136},{9,137},{9,138},{9,139},{9,140},{9,141},{9,142},{9,143},{9,144},{9,145},{9,146},{9,147},{9,148},{9,149},{9,150},{8,0},{8,1},{8,2},{8,3},{8,4},{8,5},{8,6},{8,7},{8,8},{8,9},{8,10},{8,11},{8,12},{8,13},{8,14},{8,15},{8,16},{8,17},{8,18},{8,19},{8,20},{8,21},{8,22},{8,23},{8,24},{8,25},{8,26},{8,27},{8,28},{8,29},{8,30},{8,31},{8,32},{8,33},{8,34},{8,35},{8,36},{8,37},{8,38},{8,39},{8,40},{8,41},{8,42},{8,43},{8,44},{8,45},{8,46},{8,47},{8,48},{8,49},{8,50},{8,51},{8,52},{8,53},{8,54},{8,55},{8,56},{8,57},{8,58},{8,59},{8,60},{8,61},{8,62},{8,63},{8,64},{8,65},{8,66},{8,67},{8,68},{8,69},{8,70},{8,71},{8,72},{8,73},{8,74},{8,75},{8,76},{8,77},{8,78},{8,79},{8,80},{8,81},{8,82},{8,83},{8,84},{8,85},{8,86},{8,87},{8,88},{8,89},{8,90},{8,91},{8,92},{8,93},{8,94},{8,95},{8,96},{8,97},{8,98},{8,99},{8,100},{8,101},{8,102},{8,103},{8,104},{8,105},{8,106},{8,107},{8,108},{8,109},{8,110},{8,111},{8,112},{8,113},{8,114},{8,115},{8,116},{8,117},{8,118},{8,119},{8,120},{8,121},{8,122},{8,123},{8,124},{8,125},{8,126},{8,127},{8,128},{8,129},{8,130},{8,131},{8,132},{8,133},{8,134},{8,135},{8,136},{8,137},{8,138},{8,139},{8,140},{8,141},{8,142},{8,143},{8,144},{8,145},{8,146},{8,147},{8,148},{8,149},{8,150},{7,0},{7,1},{7,2},{7,3},{7,4},{7,5},{7,6},{7,7},{7,8},{7,9},{7,10},{7,11},{7,12},{7,13},{7,14},{7,15},{7,16},{7,17},{7,18},{7,19},{7,20},{7,21},{7,22},{7,23},{7,24},{7,25},{7,26},{7,27},{7,28},{7,29},{7,30},{7,31},{7,32},{7,33},{7,34},{7,35},{7,36},{7,37},{7,38},{7,39},{7,40},{7,41},{7,42},{7,43},{7,44},{7,45},{7,46},{7,47},{7,48},{7,49},{7,50},{7,51},{7,52},{7,53},{7,54},{7,55},{7,56},{7,57},{7,58},{7,59},{7,60},{7,61},{7,62},{7,63},{7,64},{7,65},{7,66},{7,67},{7,68},{7,69},{7,70},{7,71},{7,72},{7,73},{7,74},{7,75},{7,76},{7,77},{7,78},{7,79},{7,80},{7,81},{7,82},{7,83},{7,84},{7,85},{7,86},{7,87},{7,88},{7,89},{7,90},{7,91},{7,92},{7,93},{7,94},{7,95},{7,96},{7,97},{7,98},{7,99},{7,100},{7,101},{7,102},{7,103},{7,104},{7,105},{7,106},{7,107},{7,108},{7,109},{7,110},{7,111},{7,112},{7,113},{7,114},{7,115},{7,116},{7,117},{7,118},{7,119},{7,120},{7,121},{7,122},{7,123},{7,124},{7,125},{7,126},{7,127},{7,128},{7,129},{7,130},{7,131},{7,132},{7,133},{7,134},{7,135},{7,136},{7,137},{7,138},{7,139},{7,140},{7,141},{7,142},{7,143},{7,144},{7,145},{7,146},{7,147},{7,148},{7,149},{7,150},{6,0},{6,1},{6,2},{6,3},{6,4},{6,5},{6,6},{6,7},{6,8},{6,9},{6,10},{6,11},{6,12},{6,13},{6,14},{6,15},{6,16},{6,17},{6,18},{6,19},{6,20},{6,21},{6,22},{6,23},{6,24},{6,25},{6,26},{6,27},{6,28},{6,29},{6,30},{6,31},{6,32},{6,33},{6,34},{6,35},{6,36},{6,37},{6,38},{6,39},{6,40},{6,41},{6,42},{6,43},{6,44},{6,45},{6,46},{6,47},{6,48},{6,49},{6,50},{6,51},{6,52},{6,53},{6,54},{6,55},{6,56},{6,57},{6,58},{6,59},{6,60},{6,61},{6,62},{6,63},{6,64},{6,65},{6,66},{6,67},{6,68},{6,69},{6,70},{6,71},{6,72},{6,73},{6,74},{6,75},{6,76},{6,77},{6,78},{6,79},{6,80},{6,81},{6,82},{6,83},{6,84},{6,85},{6,86},{6,87},{6,88},{6,89},{6,90},{6,91},{6,92},{6,93},{6,94},{6,95},{6,96},{6,97},{6,98},{6,99},{6,100},{6,101},{6,102},{6,103},{6,104},{6,105},{6,106},{6,107},{6,108},{6,109},{6,110},{6,111},{6,112},{6,113},{6,114},{6,115},{6,116},{6,117},{6,118},{6,119},{6,120},{6,121},{6,122},{6,123},{6,124},{6,125},{6,126},{6,127},{6,128},{6,129},{6,130},{6,131},{6,132},{6,133},{6,134},{6,135},{6,136},{6,137},{6,138},{6,139},{6,140},{6,141},{6,142},{6,143},{6,144},{6,145},{6,146},{6,147},{6,148},{6,149},{6,150},{5,0},{5,1},{5,2},{5,3},{5,4},{5,5},{5,6},{5,7},{5,8},{5,9},{5,10},{5,11},{5,12},{5,13},{5,14},{5,15},{5,16},{5,17},{5,18},{5,19},{5,20},{5,21},{5,22},{5,23},{5,24},{5,25},{5,26},{5,27},{5,28},{5,29},{5,30},{5,31},{5,32},{5,33},{5,34},{5,35},{5,36},{5,37},{5,38},{5,39},{5,40},{5,41},{5,42},{5,43},{5,44},{5,45},{5,46},{5,47},{5,48},{5,49},{5,50},{5,51},{5,52},{5,53},{5,54},{5,55},{5,56},{5,57},{5,58},{5,59},{5,60},{5,61},{5,62},{5,63},{5,64},{5,65},{5,66},{5,67},{5,68},{5,69},{5,70},{5,71},{5,72},{5,73},{5,74},{5,75},{5,76},{5,77},{5,78},{5,79},{5,80},{5,81},{5,82},{5,83},{5,84},{5,85},{5,86},{5,87},{5,88},{5,89},{5,90},{5,91},{5,92},{5,93},{5,94},{5,95},{5,96},{5,97},{5,98},{5,99},{5,100},{5,101},{5,102},{5,103},{5,104},{5,105},{5,106},{5,107},{5,108},{5,109},{5,110},{5,111},{5,112},{5,113},{5,114},{5,115},{5,116},{5,117},{5,118},{5,119},{5,120},{5,121},{5,122},{5,123},{5,124},{5,125},{5,126},{5,127},{5,128},{5,129},{5,130},{5,131},{5,132},{5,133},{5,134},{5,135},{5,136},{5,137},{5,138},{5,139},{5,140},{5,141},{5,142},{5,143},{5,144},{5,145},{5,146},{5,147},{5,148},{5,149},{5,150},{4,0},{4,1},{4,2},{4,3},{4,4},{4,5},{4,6},{4,7},{4,8},{4,9},{4,10},{4,11},{4,12},{4,13},{4,14},{4,15},{4,16},{4,17},{4,18},{4,19},{4,20},{4,21},{4,22},{4,23},{4,24},{4,25},{4,26},{4,27},{4,28},{4,29},{4,30},{4,31},{4,32},{4,33},{4,34},{4,35},{4,36},{4,37},{4,38},{4,39},{4,40},{4,41},{4,42},{4,43},{4,44},{4,45},{4,46},{4,47},{4,48},{4,49},{4,50},{4,51},{4,52},{4,53},{4,54},{4,55},{4,56},{4,57},{4,58},{4,59},{4,60},{4,61},{4,62},{4,63},{4,64},{4,65},{4,66},{4,67},{4,68},{4,69},{4,70},{4,71},{4,72},{4,73},{4,74},{4,75},{4,76},{4,77},{4,78},{4,79},{4,80},{4,81},{4,82},{4,83},{4,84},{4,85},{4,86},{4,87},{4,88},{4,89},{4,90},{4,91},{4,92},{4,93},{4,94},{4,95},{4,96},{4,97},{4,98},{4,99},{4,100},{4,101},{4,102},{4,103},{4,104},{4,105},{4,106},{4,107},{4,108},{4,109},{4,110},{4,111},{4,112},{4,113},{4,114},{4,115},{4,116},{4,117},{4,118},{4,119},{4,120},{4,121},{4,122},{4,123},{4,124},{4,125},{4,126},{4,127},{4,128},{4,129},{4,130},{4,131},{4,132},{4,133},{4,134},{4,135},{4,136},{4,137},{4,138},{4,139},{4,140},{4,141},{4,142},{4,143},{4,144},{4,145},{4,146},{4,147},{4,148},{4,149},{4,150},{3,0},{3,1},{3,2},{3,3},{3,4},{3,5},{3,6},{3,7},{3,8},{3,9},{3,10},{3,11},{3,12},{3,13},{3,14},{3,15},{3,16},{3,17},{3,18},{3,19},{3,20},{3,21},{3,22},{3,23},{3,24},{3,25},{3,26},{3,27},{3,28},{3,29},{3,30},{3,31},{3,32},{3,33},{3,34},{3,35},{3,36},{3,37},{3,38},{3,39},{3,40},{3,41},{3,42},{3,43},{3,44},{3,45},{3,46},{3,47},{3,48},{3,49},{3,50},{3,51},{3,52},{3,53},{3,54},{3,55},{3,56},{3,57},{3,58},{3,59},{3,60},{3,61},{3,62},{3,63},{3,64},{3,65},{3,66},{3,67},{3,68},{3,69},{3,70},{3,71},{3,72},{3,73},{3,74},{3,75},{3,76},{3,77},{3,78},{3,79},{3,80},{3,81},{3,82},{3,83},{3,84},{3,85},{3,86},{3,87},{3,88},{3,89},{3,90},{3,91},{3,92},{3,93},{3,94},{3,95},{3,96},{3,97},{3,98},{3,99},{3,100},{3,101},{3,102},{3,103},{3,104},{3,105},{3,106},{3,107},{3,108},{3,109},{3,110},{3,111},{3,112},{3,113},{3,114},{3,115},{3,116},{3,117},{3,118},{3,119},{3,120},{3,121},{3,122},{3,123},{3,124},{3,125},{3,126},{3,127},{3,128},{3,129},{3,130},{3,131},{3,132},{3,133},{3,134},{3,135},{3,136},{3,137},{3,138},{3,139},{3,140},{3,141},{3,142},{3,143},{3,144},{3,145},{3,146},{3,147},{3,148},{3,149},{3,150},{2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11},{2,12},{2,13},{2,14},{2,15},{2,16},{2,17},{2,18},{2,19},{2,20},{2,21},{2,22},{2,23},{2,24},{2,25},{2,26},{2,27},{2,28},{2,29},{2,30},{2,31},{2,32},{2,33},{2,34},{2,35},{2,36},{2,37},{2,38},{2,39},{2,40},{2,41},{2,42},{2,43},{2,44},{2,45},{2,46},{2,47},{2,48},{2,49},{2,50},{2,51},{2,52},{2,53},{2,54},{2,55},{2,56},{2,57},{2,58},{2,59},{2,60},{2,61},{2,62},{2,63},{2,64},{2,65},{2,66},{2,67},{2,68},{2,69},{2,70},{2,71},{2,72},{2,73},{2,74},{2,75},{2,76},{2,77},{2,78},{2,79},{2,80},{2,81},{2,82},{2,83},{2,84},{2,85},{2,86},{2,87},{2,88},{2,89},{2,90},{2,91},{2,92},{2,93},{2,94},{2,95},{2,96},{2,97},{2,98},{2,99},{2,100},{2,101},{2,102},{2,103},{2,104},{2,105},{2,106},{2,107},{2,108},{2,109},{2,110},{2,111},{2,112},{2,113},{2,114},{2,115},{2,116},{2,117},{2,118},{2,119},{2,120},{2,121},{2,122},{2,123},{2,124},{2,125},{2,126},{2,127},{2,128},{2,129},{2,130},{2,131},{2,132},{2,133},{2,134},{2,135},{2,136},{2,137},{2,138},{2,139},{2,140},{2,141},{2,142},{2,143},{2,144},{2,145},{2,146},{2,147},{2,148},{2,149},{2,150},{1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11},{1,12},{1,13},{1,14},{1,15},{1,16},{1,17},{1,18},{1,19},{1,20},{1,21},{1,22},{1,23},{1,24},{1,25},{1,26},{1,27},{1,28},{1,29},{1,30},{1,31},{1,32},{1,33},{1,34},{1,35},{1,36},{1,37},{1,38},{1,39},{1,40},{1,41},{1,42},{1,43},{1,44},{1,45},{1,46},{1,47},{1,48},{1,49},{1,50},{1,51},{1,52},{1,53},{1,54},{1,55},{1,56},{1,57},{1,58},{1,59},{1,60},{1,61},{1,62},{1,63},{1,64},{1,65},{1,66},{1,67},{1,68},{1,69},{1,70},{1,71},{1,72},{1,73},{1,74},{1,75},{1,76},{1,77},{1,78},{1,79},{1,80},{1,81},{1,82},{1,83},{1,84},{1,85},{1,86},{1,87},{1,88},{1,89},{1,90},{1,91},{1,92},{1,93},{1,94},{1,95},{1,96},{1,97},{1,98},{1,99},{1,100},{1,101},{1,102},{1,103},{1,104},{1,105},{1,106},{1,107},{1,108},{1,109},{1,110},{1,111},{1,112},{1,113},{1,114},{1,115},{1,116},{1,117},{1,118},{1,119},{1,120},{1,121},{1,122},{1,123},{1,124},{1,125},{1,126},{1,127},{1,128},{1,129},{1,130},{1,131},{1,132},{1,133},{1,134},{1,135},{1,136},{1,137},{1,138},{1,139},{1,140},{1,141},{1,142},{1,143},{1,144},{1,145},{1,146},{1,147},{1,148},{1,149},{1,150},{0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},{0,12},{0,13},{0,14},{0,15},{0,16},{0,17},{0,18},{0,19},{0,20},{0,21},{0,22},{0,23},{0,24},{0,25},{0,26},{0,27},{0,28},{0,29},{0,30},{0,31},{0,32},{0,33},{0,34},{0,35},{0,36},{0,37},{0,38},{0,39},{0,40},{0,41},{0,42},{0,43},{0,44},{0,45},{0,46},{0,47},{0,48},{0,49},{0,50},{0,51},{0,52},{0,53},{0,54},{0,55},{0,56},{0,57},{0,58},{0,59},{0,60},{0,61},{0,62},{0,63},{0,64},{0,65},{0,66},{0,67},{0,68},{0,69},{0,70},{0,71},{0,72},{0,73},{0,74},{0,75},{0,76},{0,77},{0,78},{0,79},{0,80},{0,81},{0,82},{0,83},{0,84},{0,85},{0,86},{0,87},{0,88},{0,89},{0,90},{0,91},{0,92},{0,93},{0,94},{0,95},{0,96},{0,97},{0,98},{0,99},{0,100},{0,101},{0,102},{0,103},{0,104},{0,105},{0,106},{0,107},{0,108},{0,109},{0,110},{0,111},{0,112},{0,113},{0,114},{0,115},{0,116},{0,117},{0,118},{0,119},{0,120},{0,121},{0,122},{0,123},{0,124},{0,125},{0,126},{0,127},{0,128},{0,129},{0,130},{0,131},{0,132},{0,133},{0,134},{0,135},{0,136},{0,137},{0,138},{0,139},{0,140},{0,141},{0,142},{0,143},{0,144},{0,145},{0,146},{0,147},{0,148},{0,149},{0,150}}, +[]int{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + }, + + // 可以有多个 testcase +} + +func Test_hitBricks(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hitBricks(tc.grid, tc.hits), "输入:%v", tc) + } +} + +func Benchmark_hitBricks(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hitBricks(tc.grid, tc.hits) + } + } +} diff --git a/Algorithms/0804.unique-morse-code-words/README.md b/Algorithms/0804.unique-morse-code-words/README.md new file mode 100755 index 000000000..f3ccb6f1c --- /dev/null +++ b/Algorithms/0804.unique-morse-code-words/README.md @@ -0,0 +1,39 @@ +# [804. Unique Morse Code Words](https://leetcode.com/problems/unique-morse-code-words/) + +## 题目 + +International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on. + +For convenience, the full table for the 26 letters of the English alphabet is given below: + +```text +[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."] +``` + +Now, given a list of words, each word can be written as a concatenation of the Morse code of each letter. For example, "cab" can be written as "-.-.-....-", (which is the concatenation "-.-." + "-..." + ".-"). We'll call such a concatenation, the transformation of a word. + +Return the number of different transformations among all words we have. + +```text +Example: +Input: words = ["gin", "zen", "gig", "msg"] +Output: 2 +Explanation: +The transformation of each word is: +"gin" -> "--...-." +"zen" -> "--...-." +"gig" -> "--...--." +"msg" -> "--...--." + +There are 2 different transformations, "--...-." and "--...--.". +``` + +Note: + +1. The length of words will be at most 100. +1. Each words[i] will have length in range [1, 12]. +1. words[i] will only consist of lowercase letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0804.unique-morse-code-words/unique-morse-code-words.go b/Algorithms/0804.unique-morse-code-words/unique-morse-code-words.go new file mode 100755 index 000000000..b05251465 --- /dev/null +++ b/Algorithms/0804.unique-morse-code-words/unique-morse-code-words.go @@ -0,0 +1,34 @@ +package problem0804 + +import ( + "bytes" + "fmt" +) + +var table = []string{".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."} + +func uniqueMorseRepresentations(words []string) int { + res := make(map[string]bool, len(words)) + for _, w := range words { + var b bytes.Buffer + for i := 0; i < len(w); i++ { + fmt.Fprint(&b, table[w[i]-'a']) + } + res[b.String()] = true + } + return len(res) +} + +// 对于 go >= 1.10 来说,以下才是最快的方法 + +// func uniqueMorseRepresentations(words []string) int { +// res := make(map[string]bool, len(words)) +// for _, w := range words { +// var b strings.Builder +// for i := 0; i < len(w); i++ { +// b.WriteString(table[w[i]-'a']) +// } +// res[b.String()] = true +// } +// return len(res) +// } diff --git a/Algorithms/0804.unique-morse-code-words/unique-morse-code-words_test.go b/Algorithms/0804.unique-morse-code-words/unique-morse-code-words_test.go new file mode 100755 index 000000000..bb12cae0c --- /dev/null +++ b/Algorithms/0804.unique-morse-code-words/unique-morse-code-words_test.go @@ -0,0 +1,55 @@ +package problem0804 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans int +}{ + + { + []string{"gin", "zen", "gig", "msg"}, + 2, + }, + + { + []string{ + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyz", + }, + 1, + }, + + // 可以有多个 testcase +} + +func Test_uniqueMorseRepresentations(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, uniqueMorseRepresentations(tc.words), "输入:%v", tc) + } +} + +func Benchmark_uniqueMorseRepresentations(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + uniqueMorseRepresentations(tc.words) + } + } +} diff --git a/Algorithms/0805.split-array-with-same-average/README.md b/Algorithms/0805.split-array-with-same-average/README.md new file mode 100755 index 000000000..ff6ca0fca --- /dev/null +++ b/Algorithms/0805.split-array-with-same-average/README.md @@ -0,0 +1,24 @@ +# [805. Split Array With Same Average](https://leetcode.com/problems/split-array-with-same-average/) + +## 题目 + +In a given integer array A, we must move every element of A to either list B or list C. (B and C initially start empty.) + +Return true if and only if after such a move, it is possible that the average value of B is equal to the average value of C, and B and C are both non-empty. + +```text +Example : +Input: +[1,2,3,4,5,6,7,8] +Output: true +Explanation: We can split the array into [1,4,5,8] and [2,3,6,7], and both of them have the average of 4.5. +``` + +Note: + +1. The length of A will be in the range [1, 30]. +1. A[i] will be in the range of [0, 10000]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0805.split-array-with-same-average/split-array-with-same-average.go b/Algorithms/0805.split-array-with-same-average/split-array-with-same-average.go new file mode 100755 index 000000000..6847eac56 --- /dev/null +++ b/Algorithms/0805.split-array-with-same-average/split-array-with-same-average.go @@ -0,0 +1,54 @@ +package problem0805 + +// n = len(A) +// k = len(B) +// sum = A 的所有数之和 +// s = B 的所有数之和 +// 可由 s/k==(sum-s)/(n-k) +// 得 sum/n==s/k +// 即 s*n == sum*k +// 这是返回 true 的充分必要条件 +// +// 根据对称性,可以假设 len(B)<=len(C) +// 可得 k<=n-k, +// k 的范围是 1<=k<=n/2 +func splitArraySameAverage(A []int) bool { + n := len(A) + sum := 0 + for _, num := range A { + sum += num + } + + dp := make([][]bool, n/2+1) + for i := range dp { + dp[i] = make([]bool, sum+1) + } + + dp[0][0] = true + // dp[k][s] == true 的含义是 + // 当 B 是由 k 个元素组成时,s 是其中一个可能的 sum 值 + // 所以 dp[0][0] == true 表示 + // B 由 0 个元素组成时,其和为 0 + for _, num := range A { + for s := sum; s >= num; s-- { + for k := 1; k <= n/2; k++ { + // 当把 num 作为第 k 个数,添加到 B 以后, + // B 的总和为 s + // 此时,dp[s][k] 想要为 true + // 要么,由别的 k 个数之和为 s 的组合成的 B 为 true + // 要么,由 k-1 个数之和为 s-num 的组合成的 B 为 true + dp[k][s] = dp[k][s] || dp[k-1][s-num] + + // 如果 k 和 s 是一个可行的组合, + // 就检查 sum/n =?= s/k + // 两者都成立,说明找到了题目要求的组合 + // 立即返回 true + if dp[k][s] && sum*k == s*n { + return true + } + } + } + } + + return false +} diff --git a/Algorithms/0805.split-array-with-same-average/split-array-with-same-average_test.go b/Algorithms/0805.split-array-with-same-average/split-array-with-same-average_test.go new file mode 100755 index 000000000..68651d15d --- /dev/null +++ b/Algorithms/0805.split-array-with-same-average/split-array-with-same-average_test.go @@ -0,0 +1,44 @@ +package problem0805 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{1, 2, 3, 4, 5, 6, 7, 7}, + false, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8}, + true, + }, + + // 可以有多个 testcase +} + +func Test_splitArraySameAverage(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, splitArraySameAverage(tc.A), "输入:%v", tc) + } +} + +func Benchmark_splitArraySameAverage(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + splitArraySameAverage(tc.A) + } + } +} diff --git a/Algorithms/0806.number-of-lines-to-write-string/README.md b/Algorithms/0806.number-of-lines-to-write-string/README.md new file mode 100755 index 000000000..549f16a38 --- /dev/null +++ b/Algorithms/0806.number-of-lines-to-write-string/README.md @@ -0,0 +1,43 @@ +# [806. Number of Lines To Write String](https://leetcode.com/problems/number-of-lines-to-write-string/) + +## 题目 + +We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units, it is written on the next line. We are given an array widths, an array where widths[0] is the width of 'a', widths[1] is the width of 'b', ..., and widths[25] is the width of 'z'. + +Now answer two questions: how many lines have at least one character from S, and what is the width used by the last such line? Return your answer as an integer list of length 2. + +```text +Example : +Input: +widths = [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10] +S = "abcdefghijklmnopqrstuvwxyz" +Output: [3, 60] +Explanation: +All letters have the same length of 10. To write all 26 letters, +we need two full lines and one line with 60 units. +``` + +```text +Example : +Input: +widths = [4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10] +S = "bbbcccdddaaa" +Output: [2, 4] +Explanation: +All letters except 'a' have the same length of 10, and +"bbbcccdddaa" will cover 9 * 10 + 2 * 4 = 98 units. +For the last 'a', it is written on the second line because +there is only 2 units left in the first line. +So the answer is 2 lines, plus 4 units in the second line. +``` + +Note: + +1. The length of S will be in the range [1, 1000]. +1. S will only contain lowercase letters. +1. widths is an array of length 26. +1. widths[i] will be in the range of [2, 10]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string.go b/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string.go new file mode 100755 index 000000000..be6620091 --- /dev/null +++ b/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string.go @@ -0,0 +1,20 @@ +package problem0806 + +func numberOfLines(widths []int, S string) []int { + res := []int{0, 0} + if len(S) == 0 { + return res + } + res[0] = 1 + + for i := 0; i < len(S); i++ { + if res[1]+widths[S[i]-'a'] > 100 { + res[0]++ + res[1] = widths[S[i]-'a'] + } else { + res[1] += widths[S[i]-'a'] + } + } + + return res +} diff --git a/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string_test.go b/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string_test.go new file mode 100755 index 000000000..3d0022c3c --- /dev/null +++ b/Algorithms/0806.number-of-lines-to-write-string/number-of-lines-to-write-string_test.go @@ -0,0 +1,53 @@ +package problem0806 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + widths []int + S string + ans []int +}{ + + { + []int{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + "", + []int{0, 0}, + }, + + { + []int{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + "abcdefghijklmnopqrstuvwxyz", + []int{3, 60}, + }, + + { + []int{4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, + "bbbcccdddaaa", + []int{2, 4}, + }, + + // 可以有多个 testcase +} + +func Test_numberOfLines(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numberOfLines(tc.widths, tc.S), "输入:%v", tc) + } +} + +func Benchmark_numberOfLines(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numberOfLines(tc.widths, tc.S) + } + } +} diff --git a/Algorithms/0807.max-increase-to-keep-city-skyline/README.md b/Algorithms/0807.max-increase-to-keep-city-skyline/README.md new file mode 100755 index 000000000..b83d81fdf --- /dev/null +++ b/Algorithms/0807.max-increase-to-keep-city-skyline/README.md @@ -0,0 +1,41 @@ +# [807. Max Increase to Keep City Skyline](https://leetcode.com/problems/max-increase-to-keep-city-skyline/) + +## 题目 + +In a 2 dimensional array `grid`, each value `grid[i][j]` represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the amounts can be different for different buildings). Height 0 is considered to be a building as well. + +At the end, the "skyline" when viewed from all four directions of the grid, i.e. top, bottom, left, and right, must be the same as the skyline of the original grid. A city's skyline is the outer contour of the rectangles formed by all the buildings when viewed from a distance. See the following example. + +What is the maximum total sum that the height of the buildings can be increased? + +```text +Example: +Input: grid = [[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]] +Output: 35 +Explanation: +The grid is: +[ [3, 0, 8, 4], + [2, 4, 5, 7], + [9, 2, 6, 3], + [0, 3, 1, 0] ] + +The skyline viewed from top or bottom is: [9, 4, 8, 7] +The skyline viewed from left or right is: [8, 7, 9, 3] + +The grid after increasing the height of buildings without affecting skylines is: + +gridNew = [ [8, 4, 8, 7], + [7, 4, 7, 7], + [9, 4, 8, 7], + [3, 3, 3, 3] ] +``` + +Notes: + +1. 1 < grid.length = grid[0].length <= 50. +1. All heights `grid[i][j]` are in the range [0, 100]. +1. All buildings in `grid[i][j]` occupy the entire grid cell: that is, they are a 1 x 1 x `grid[i][j]` rectangular prism. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline.go b/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline.go new file mode 100755 index 000000000..f5c9a55ae --- /dev/null +++ b/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline.go @@ -0,0 +1,39 @@ +package problem0807 + +func maxIncreaseKeepingSkyline(grid [][]int) int { + n := len(grid) + + maxRow := make([]int, n) + maxCol := make([]int, n) + + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + maxRow[i] = max(maxRow[i], grid[i][j]) + maxCol[j] = max(maxCol[j], grid[i][j]) + } + } + + res := 0 + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + g := grid[i][j] + res += max(g, min(maxRow[i], maxCol[j])) - g + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline_test.go b/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline_test.go new file mode 100755 index 000000000..3b36ca2e6 --- /dev/null +++ b/Algorithms/0807.max-increase-to-keep-city-skyline/max-increase-to-keep-city-skyline_test.go @@ -0,0 +1,39 @@ +package problem0807 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{3, 0, 8, 4}, {2, 4, 5, 7}, {9, 2, 6, 3}, {0, 3, 1, 0}}, + 35, + }, + + // 可以有多个 testcase +} + +func Test_maxIncreaseKeepingSkyline(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxIncreaseKeepingSkyline(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_maxIncreaseKeepingSkyline(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxIncreaseKeepingSkyline(tc.grid) + } + } +} diff --git a/Algorithms/0808.soup-servings/README.md b/Algorithms/0808.soup-servings/README.md new file mode 100755 index 000000000..e69c900f4 --- /dev/null +++ b/Algorithms/0808.soup-servings/README.md @@ -0,0 +1,35 @@ +# [808. Soup Servings](https://leetcode.com/problems/soup-servings/) + +## 题目 + +There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations: + +1. Serve ;100 ml of soup A and 0 ml of soup B +1. Serve ;75 ml of soup A and 25 ;ml of soup B +1. Serve 50 ml of soup A and 50 ml of soup B +1. Serve 25 ;ml of soup A and 75 ;ml of soup B + +When we serve some soup, we give it to someone and we no longer have it. ; Each turn, ;we will choose from the four operations with equal probability 0.25. If the remaining volume of soup is not enough to complete the operation, we will serve ;as much as we can. ; We stop once we no longer have some quantity of both types of soup. + +Note that we do not have the operation where all 100 ml's of soup B are used first. ; ; + +Return the probability that soup A will be empty ;first, plus half the probability that A and B become empty at the same time. + + ; + +```text +Example: +Input: N = 50 +Output: 0.625 +Explanation: +If we choose the first two operations, A will become empty first. For the third operation, A and B will become empty at the same time. For the fourth operation, B will become empty first. So the total probability of A becoming empty first plus half the probability that A and B become empty at the same time, is 0.25 * (1 + 1 + 0.5 + 0) = 0.625. +``` + +Notes: + +1. 0 <= N <= 10^9. ; +1. Answers within ;10^-6 ;of the true value will be accepted as correct. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0808.soup-servings/soup-servings.go b/Algorithms/0808.soup-servings/soup-servings.go new file mode 100755 index 000000000..511e453ce --- /dev/null +++ b/Algorithms/0808.soup-servings/soup-servings.go @@ -0,0 +1,35 @@ +package problem0808 + +var results = [201][201]float64{} + +func soupServings(N int) float64 { + if N >= 5000 { + return 1 + } + return serve((N+24)/25, (N+24)/25) +} + +func serve(a, b int) float64 { + if a <= 0 && b > 0 { + return 1 + } + + if a <= 0 && b <= 0 { + return 0.5 + } + + if b <= 0 && a > 0 { + return 0 + } + + if results[a][b] > 0 { + return results[a][b] + } + + results[a][b] = 0.25*serve(a-4, b) + + 0.25*serve(a-3, b-1) + + 0.25*serve(a-2, b-2) + + 0.25*serve(a-1, b-3) + + return results[a][b] +} diff --git a/Algorithms/0808.soup-servings/soup-servings_test.go b/Algorithms/0808.soup-servings/soup-servings_test.go new file mode 100755 index 000000000..76e0da80c --- /dev/null +++ b/Algorithms/0808.soup-servings/soup-servings_test.go @@ -0,0 +1,64 @@ +package problem0808 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans float64 +}{ + + { + 660295675, + 1, + }, + + { + 5000, + 1, + }, + + { + 4800, + 0.99999, + }, + + { + 20000, + 1, + }, + + { + 850, + 0.96612, + }, + + { + 50, + 0.625, + }, + + // 可以有多个 testcase +} + +func Test_soupServings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.InDelta(tc.ans, soupServings(tc.N), 0.00001, "输入:%v", tc) + } +} + +func Benchmark_soupServings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + soupServings(tc.N) + } + } +} diff --git a/Algorithms/0809.expressive-words/README.md b/Algorithms/0809.expressive-words/README.md new file mode 100755 index 000000000..76c3603df --- /dev/null +++ b/Algorithms/0809.expressive-words/README.md @@ -0,0 +1,31 @@ +# [809. Expressive Words](https://leetcode.com/problems/expressive-words/) + +## 题目 + +Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii". Here, we havegroups, of adjacent letters that are all the same character, and adjacent characters tothe group are different. A groupis extended if that group is length 3 or more, so "e" and "o" would be extended in the first example, and "i" would be extended in the second example. As another example, the groups of "abbcccaaaa" would be "a", "bb", "ccc", and "aaaa"; and "ccc" and "aaaa" are the extended groups of that string. + +For some given string S, a query word is stretchy if it can be made to be equal to S by extending some groups. Formally, we are allowed to repeatedly choose a group(as defined above) of characters c, and add some number of thesame character c to it so that the length of the group is 3 or more. Note that we cannot extend a group of size one like "h" to a group of size two like "hh" - all extensions must leave the group extended - ie., at least 3 characters long. + +Given a list of query words, return the number of words that are stretchy. + +```text +Example: +Input: +S = "heeellooo" +words = ["hello", "hi", "helo"] +Output: 1 +Explanation: +We can extend "e" and "o" in the word "hello" to get "heeellooo". +We can't extend "helo" to get "heeellooo" because the group "ll" is not extended. +``` + +Notes: + +1. 0 <= len(S) <= 100. +1. 0 <= len(words) <= 100. +1. 0 <= len(words[i]) <= 100. +1. S and all words in wordsconsist only oflowercase letters + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0809.expressive-words/expressive-words.go b/Algorithms/0809.expressive-words/expressive-words.go new file mode 100755 index 000000000..245b74b19 --- /dev/null +++ b/Algorithms/0809.expressive-words/expressive-words.go @@ -0,0 +1,40 @@ +package problem0809 + +func expressiveWords(S string, words []string) int { + res := 0 + short, count := parse(S) + for i := range words { + res += check(words[i], short, count) + } + return res +} + +func parse(s string) (string, []int) { + short := s[0:1] + count := make([]int, len(s)) + idx := 0 + for i := range s { + if short[idx] != s[i] { + short += s[i : i+1] + idx++ + } + count[idx]++ + } + return short, count[:idx+1] +} + +func check(w, short string, count []int) int { + s, c := parse(w) + if s != short { + return 0 + } + + for i := range count { + if (count[i] < 3 && c[i] != count[i]) || + (count[i] >= 3 && c[i] > count[i]) { + return 0 + } + } + + return 1 +} diff --git a/Algorithms/0809.expressive-words/expressive-words_test.go b/Algorithms/0809.expressive-words/expressive-words_test.go new file mode 100755 index 000000000..7cde9721a --- /dev/null +++ b/Algorithms/0809.expressive-words/expressive-words_test.go @@ -0,0 +1,47 @@ +package problem0809 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + words []string + ans int +}{ + + { + "heeellooo", + []string{"hello", "hi", "helo"}, + 1, + }, + + { + "zzzzzyyyyy", + []string{"zzyy", "zy", "zyy"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_expressiveWords(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, expressiveWords(tc.S, tc.words), "输入:%v", tc) + } +} + +func Benchmark_expressiveWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + expressiveWords(tc.S, tc.words) + } + } +} diff --git a/Algorithms/0810.chalkboard-xor-game/README.md b/Algorithms/0810.chalkboard-xor-game/README.md new file mode 100755 index 000000000..72508d45d --- /dev/null +++ b/Algorithms/0810.chalkboard-xor-game/README.md @@ -0,0 +1,28 @@ +# [810. Chalkboard XOR Game](https://leetcode.com/problems/chalkboard-xor-game/) + +## 题目 + +We are given non-negative integers nums[i] which are written on a chalkboard. Alice and Bob take turns erasing exactly one number from the chalkboard, with Alice starting first. If erasing a number causesthe bitwise XOR of all the elements of the chalkboard to become0, then that player loses. (Also, we'll say the bitwise XOR of one element is that element itself, and the bitwise XOR of no elements is 0.) + +Also, if any player starts their turn with the bitwise XOR of all the elements of the chalkboard equal to 0, then that player wins. + +Return True if and only if Alice wins the game, assuming both players play optimally. + +```text +Example: +Input: nums = [1, 1, 2] +Output: false +Explanation: +Alice has two choices: erase 1 or erase 2. +If she erases 1, the nums array becomes [1, 2]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 2 = 3. Now Bob can remove any element he wants, because Alice will be the one to erase the last element and she will lose. +If Alice erases 2 first, now nums becomes [1, 1]. The bitwise XOR of all the elements of the chalkboard is 1 XOR 1 = 0. Alice will lose. +``` + +Notes: + +1. 1 <= N <= 1000. +1. 0 <= nums[i] <= 2^16. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game.go b/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game.go new file mode 100755 index 000000000..ae224e8ee --- /dev/null +++ b/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game.go @@ -0,0 +1,20 @@ +package problem0810 + +func xorGame(nums []int) bool { + n := len(nums) + xor := 0 + for i := 0; i < n; i++ { + xor ^= nums[i] + } + return xor == 0 || n%2 == 0 +} + +// Let’s discuss it if we add this condition. +// If xor == 0, Alice win directly. +// If xor != 0 and length of numbers is even, Alice will win. + +// Beacause: +// All numbers won’t be the same. Otherwise xor will be equal to 0 +// If all numbers are not the same, It means there are at least 2 different numbers. +// Alice can always erase a number different from current xor. +// So Alice won’t never lose this turn at this situation. diff --git a/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game_test.go b/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game_test.go new file mode 100755 index 000000000..029567386 --- /dev/null +++ b/Algorithms/0810.chalkboard-xor-game/chalkboard-xor-game_test.go @@ -0,0 +1,59 @@ +package problem0810 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + name string + nums []int + ans bool +}{ + + { + "1", + []int{7, 8, 6, 10, 14, 15, 16, 6, 4, 0, 4, 9, 3, 3, 8, 10, 5, 5, 3, 10}, + true, + }, + + { + "2", + []int{0, 4, 4, 0, 4, 4, 2, 2, 2, 3, 0, 3, 1, 3, 2, 4, 2, 0, 1, 3}, + true, + }, + + { + "3", + []int{1, 1, 2}, + false, + }, + + { + "4", + []int{1, 3, 2}, + true, + }, + + // 可以有多个 testcase +} + +func Test_xorGame(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, xorGame(tc.nums), "%s, 输入:%v", tc.name, tc) + } +} + +func Benchmark_xorGame(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + xorGame(tc.nums) + } + } +} diff --git a/Algorithms/0811.subdomain-visit-count/README.md b/Algorithms/0811.subdomain-visit-count/README.md new file mode 100755 index 000000000..9d4ef2e64 --- /dev/null +++ b/Algorithms/0811.subdomain-visit-count/README.md @@ -0,0 +1,41 @@ +# [811. Subdomain Visit Count](https://leetcode.com/problems/subdomain-visit-count/) + +## 题目 + +A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com", and at the lowest level, "discuss.leetcode.com". When we visit a domain like "discuss.leetcode.com", we will also visit the parent domains "leetcode.com" and "com" implicitly. + +Now, call a "count-paired domain" to be a count (representing the number of visits this domain received), followed by a space, followed by the address. An example of a count-paired domain might be "9001 discuss.leetcode.com". + +We are given a list cpdomains of count-paired domains. We would like a list of count-paired domains, (in the same format as the input, and in any order), that explicitly counts the number of visits to each subdomain. + +```text +Example 1: +Input: +["9001 discuss.leetcode.com"] +Output: +["9001 discuss.leetcode.com", "9001 leetcode.com", "9001 com"] +Explanation: +We only have one website domain: "discuss.leetcode.com". As discussed above, the subdomain "leetcode.com" and "com" will also be visited. So they will all be visited 9001 times. +``` + +```text +Example 2: +Input: +["900 google.mail.com", "50 yahoo.com", "1 intel.mail.com", "5 wiki.org"] +Output: +["901 mail.com","50 yahoo.com","900 google.mail.com","5 wiki.org","5 org","1 intel.mail.com","951 com"] +Explanation: +We will visit "google.mail.com" 900 times, "yahoo.com" 50 times, "intel.mail.com" once and "wiki.org" 5 times. For the subdomains, we will visit "mail.com" 900 + 1 = 901 times, "com" 900 + 50 + 1 = 951 times, and "org" 5 times. +``` + +Notes: + +1. The length of cpdomains will not exceed100. +1. The length of each domain name will not exceed 100. +1. Each address will have either 1 or 2 "." characters. +1. The input countin any count-paired domain will not exceed 10000. +1. The answer output can be returned in any order. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0811.subdomain-visit-count/subdomain-visit-count.go b/Algorithms/0811.subdomain-visit-count/subdomain-visit-count.go new file mode 100755 index 000000000..bf16e11c8 --- /dev/null +++ b/Algorithms/0811.subdomain-visit-count/subdomain-visit-count.go @@ -0,0 +1,44 @@ +package problem0811 + +import ( + "fmt" + "strconv" + "strings" +) + +func subdomainVisits(cpdomains []string) []string { + m := make(map[string]int, len(cpdomains)) + + for _, domin := range cpdomains { + d, n := parse(domin) + isNew := true + for isNew { + m[d] += n + d, isNew = cut(d) + } + } + + return getResult(m) +} + +func cut(s string) (string, bool) { + idx := strings.Index(s, ".") + if idx == -1 { + return "", false + } + return s[idx+1:], true +} + +func parse(s string) (string, int) { + ss := strings.Split(s, " ") + n, _ := strconv.Atoi(ss[0]) + return ss[1], n +} + +func getResult(m map[string]int) []string { + res := make([]string, 0, len(m)) + for k, v := range m { + res = append(res, fmt.Sprintf("%d %s", v, k)) + } + return res +} diff --git a/Algorithms/0811.subdomain-visit-count/subdomain-visit-count_test.go b/Algorithms/0811.subdomain-visit-count/subdomain-visit-count_test.go new file mode 100755 index 000000000..f935b69b5 --- /dev/null +++ b/Algorithms/0811.subdomain-visit-count/subdomain-visit-count_test.go @@ -0,0 +1,49 @@ +package problem0811 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + cpdomains []string + ans []string +}{ + + { + []string{"9001 discuss.leetcode.com"}, + []string{"9001 discuss.leetcode.com", "9001 leetcode.com", "9001 com"}, + }, + + { + []string{"900 google.mail.com", "50 yahoo.com", "1 intel.mail.com", "5 wiki.org"}, + []string{"901 mail.com", "50 yahoo.com", "900 google.mail.com", "5 wiki.org", "5 org", "1 intel.mail.com", "951 com"}, + }, + + // 可以有多个 testcase +} + +func Test_subdomainVisits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + geted := subdomainVisits(tc.cpdomains) + sort.Strings(geted) + sort.Strings(tc.ans) + + ast.Equal(tc.ans, geted, "输入:%v", tc) + } +} + +func Benchmark_subdomainVisits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + subdomainVisits(tc.cpdomains) + } + } +} diff --git a/Algorithms/0812.largest-triangle-area/README.md b/Algorithms/0812.largest-triangle-area/README.md new file mode 100755 index 000000000..0770fd1f6 --- /dev/null +++ b/Algorithms/0812.largest-triangle-area/README.md @@ -0,0 +1,26 @@ +# [812. Largest Triangle Area](https://leetcode.com/problems/largest-triangle-area/) + +## 题目 + +You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. + +```text +Example: +Input: points = [[0,0],[0,1],[1,0],[0,2],[2,0]] +Output: 2 +Explanation: +The five points are show in the figure below. The red triangle is the largest. +``` + +![pic](pic.png) + +Notes: + +1. 3 <= points.length <= 50. +1. No points will be duplicated. +1. -50 <= points[i][j] <= 50. +1. Answers within 10^-6 of the true value will be accepted as correct. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0812.largest-triangle-area/largest-triangle-area.go b/Algorithms/0812.largest-triangle-area/largest-triangle-area.go new file mode 100755 index 000000000..248aab128 --- /dev/null +++ b/Algorithms/0812.largest-triangle-area/largest-triangle-area.go @@ -0,0 +1,32 @@ +package problem0812 + +func largestTriangleArea(points [][]int) float64 { + maxArea := 0.0 + n := len(points) + for i := 0; i < n; i++ { + for j := i + 1; j < n; j++ { + for k := j + 1; k < n; k++ { + maxArea = max(maxArea, area(points[i], points[j], points[k])) + } + } + } + return maxArea +} + +func area(p1, p2, p3 []int) float64 { + return abs(p1[0]*p2[1]+p2[0]*p3[1]+p3[0]*p1[1]-p1[0]*p3[1]-p2[0]*p1[1]-p3[0]*p2[1]) / 2 +} + +func abs(num int) float64 { + if num < 0 { + num = -num + } + return float64(num) +} + +func max(a, b float64) float64 { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0812.largest-triangle-area/largest-triangle-area_test.go b/Algorithms/0812.largest-triangle-area/largest-triangle-area_test.go new file mode 100755 index 000000000..2502da075 --- /dev/null +++ b/Algorithms/0812.largest-triangle-area/largest-triangle-area_test.go @@ -0,0 +1,39 @@ +package problem0812 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans float64 +}{ + + { + [][]int{{0, 0}, {0, 1}, {1, 0}, {0, 2}, {2, 0}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_largestTriangleArea(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largestTriangleArea(tc.points), "输入:%v", tc) + } +} + +func Benchmark_largestTriangleArea(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestTriangleArea(tc.points) + } + } +} diff --git a/Algorithms/0812.largest-triangle-area/pic.png b/Algorithms/0812.largest-triangle-area/pic.png new file mode 100644 index 000000000..611d67dd9 Binary files /dev/null and b/Algorithms/0812.largest-triangle-area/pic.png differ diff --git a/Algorithms/0813.largest-sum-of-averages/README.md b/Algorithms/0813.largest-sum-of-averages/README.md new file mode 100755 index 000000000..fcb2fafea --- /dev/null +++ b/Algorithms/0813.largest-sum-of-averages/README.md @@ -0,0 +1,30 @@ +# [813. Largest Sum of Averages](https://leetcode.com/problems/largest-sum-of-averages/) + +## 题目 + +We partition a row of numbers A into at most K adjacent (non-empty) groups, then our score is the sum of the average of each group. What is the largest score we can achieve? + +Note that our partition must use every number in A, and that scores are not necessarily integers. + +```text +Example: +Input: +A = [9,1,2,3,9] +K = 3 +Output: 20 +Explanation: +The best choice is to partition A into [9], [1, 2, 3], [9]. The answer is 9 + (1 + 2 + 3) / 3 + 9 = 20. +We could have also partitioned A into [9, 1], [2], [3, 9], for example. +That partition would lead to a score of 5 + 2 + 6 = 13, which is worse. +``` + +Note: + +1. 1 <= A.length <= 100. +1. 1 <= A[i] <= 10000. +1. 1 <= K <= A.length. +1. Answers within 10^-6 of the correct answer will be accepted as correct. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages.go b/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages.go new file mode 100755 index 000000000..4fea9c29a --- /dev/null +++ b/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages.go @@ -0,0 +1,44 @@ +package problem0813 + +import ( + "math" +) + +// dp[n][k] == 20 表示 +// 长度为 n 的数组 A +// 分成 k 份的时候 +// 满足题意的结果为 20 +var dp [101][101]float64 + +func largestSumOfAverages(A []int, K int) float64 { + n := len(A) + + dp = [101][101]float64{} + + sum := 0 + for i := range A { + sum += A[i] + dp[i+1][1] = float64(sum) / float64(i+1) + } + + return search(n, K, A) +} + +func search(n, k int, A []int) float64 { + if dp[n][k] > 0 { + return dp[n][k] + } + + if n < k { + return 0 + } + + sum := 0 + + for i := n - 1; i > 0; i-- { + sum += A[i] + dp[n][k] = math.Max(dp[n][k], search(i, k-1, A)+float64(sum)/float64(n-i)) + } + + return dp[n][k] +} diff --git a/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages_test.go b/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages_test.go new file mode 100755 index 000000000..9464f5768 --- /dev/null +++ b/Algorithms/0813.largest-sum-of-averages/largest-sum-of-averages_test.go @@ -0,0 +1,47 @@ +package problem0813 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans float64 +}{ + + { + []int{9, 1, 2, 3, 9}, + 3, + 20, + }, + + { + []int{4663, 3020, 7789, 1627, 9668, 1356, 4207, 1133, 8765, 4649, 205, 6455, 8864, 3554, 3916, 5925, 3995, 4540, 3487, 5444, 8259, 8802, 6777, 7306, 989, 4958, 2921, 8155, 4922, 2469, 6923, 776, 9777, 1796, 708, 786, 3158, 7369, 8715, 2136, 2510, 3739, 6411, 7996, 6211, 8282, 4805, 236, 1489, 7698}, + 27, + 167436.08333, + }, + + // 可以有多个 testcase +} + +func Test_largestSumOfAverages(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.InDelta(tc.ans, largestSumOfAverages(tc.A, tc.K), 0.00001, "输入:%v", tc) + } +} + +func Benchmark_largestSumOfAverages(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestSumOfAverages(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0814.binary-tree-pruning/1.png b/Algorithms/0814.binary-tree-pruning/1.png new file mode 100644 index 000000000..c4cf1ac07 Binary files /dev/null and b/Algorithms/0814.binary-tree-pruning/1.png differ diff --git a/Algorithms/0814.binary-tree-pruning/2.png b/Algorithms/0814.binary-tree-pruning/2.png new file mode 100644 index 000000000..848fdf786 Binary files /dev/null and b/Algorithms/0814.binary-tree-pruning/2.png differ diff --git a/Algorithms/0814.binary-tree-pruning/3.png b/Algorithms/0814.binary-tree-pruning/3.png new file mode 100644 index 000000000..24fa7c21d Binary files /dev/null and b/Algorithms/0814.binary-tree-pruning/3.png differ diff --git a/Algorithms/0814.binary-tree-pruning/README.md b/Algorithms/0814.binary-tree-pruning/README.md new file mode 100755 index 000000000..ae566ee21 --- /dev/null +++ b/Algorithms/0814.binary-tree-pruning/README.md @@ -0,0 +1,45 @@ +# [814. Binary Tree Pruning](https://leetcode.com/problems/binary-tree-pruning/) + +## 题目 + +We are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1. + +Return the same tree where every subtree (of the given tree) not containing a 1 has been removed. + +(Recall that the subtree of a node X is X, plus every node that is a descendant of X.) + +```text +Example 1: +Input: [1,null,0,0,1] +Output: [1,null,0,null,1] +Explanation: +Only the red nodes satisfy the property "every subtree not containing a 1". +The diagram on the right represents the answer. +``` + +![1](1.png) + +```text +Example 2: +Input: [1,0,1,0,0,0,1] +Output: [1,null,1,null,1] +``` + +![2](2.png) + +```text +Example 3: +Input: [1,1,0,1,1,0,1,0] +Output: [1,1,0,1,1,null,1] +``` + +![3](3.png) + +Note: + +1. The binary tree will have at most 100 nodes. +1. The value of each node will only be 0 or 1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0814.binary-tree-pruning/binary-tree-pruning.go b/Algorithms/0814.binary-tree-pruning/binary-tree-pruning.go new file mode 100755 index 000000000..c31b42a17 --- /dev/null +++ b/Algorithms/0814.binary-tree-pruning/binary-tree-pruning.go @@ -0,0 +1,34 @@ +package problem0814 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * return nil +} +*/ + +// TreeNode 是 tree 的 node +type TreeNode = kit.TreeNode + +func pruneTree(root *TreeNode) *TreeNode { + if root == nil { + return nil + } + + root.Left = pruneTree(root.Left) + root.Right = pruneTree(root.Right) + + if root.Val == 0 && + root.Left == nil && + root.Right == nil { + return nil + } + return root +} diff --git a/Algorithms/0814.binary-tree-pruning/binary-tree-pruning_test.go b/Algorithms/0814.binary-tree-pruning/binary-tree-pruning_test.go new file mode 100755 index 000000000..86d61214f --- /dev/null +++ b/Algorithms/0814.binary-tree-pruning/binary-tree-pruning_test.go @@ -0,0 +1,55 @@ +package problem0814 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +var null = -1 << 63 + +// tcs is testcase slice +var tcs = []struct { + root []int + ans []int +}{ + + { + []int{1, null, 0, 0, 1}, + []int{1, null, 0, null, 1}, + }, + + { + []int{1, 0, 1, 0, 0, 0, 1}, + []int{1, null, 1, null, 1}, + }, + + { + []int{1, 1, 0, 1, 1, 0, 1, 0}, + []int{1, 1, 0, 1, 1, null, 1}, + }, + + // 可以有多个 testcase +} + +func Test_pruneTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := kit.Ints2TreeNode(tc.ans) + get := pruneTree(kit.Ints2TreeNode(tc.root)) + ast.True(ans.Equal(get), "输入:%v", tc) + } +} + +func Benchmark_pruneTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pruneTree(kit.Ints2TreeNode(tc.root)) + } + } +} diff --git a/Algorithms/0815.bus-routes/README.md b/Algorithms/0815.bus-routes/README.md new file mode 100755 index 000000000..823f07762 --- /dev/null +++ b/Algorithms/0815.bus-routes/README.md @@ -0,0 +1,28 @@ +# [815. Bus Routes](https://leetcode.com/problems/bus-routes/) + +## 题目 + +We have a list of bus routes. Each routes[i] is a bus route that the i-th bus repeats forever. For example if routes[0] = [1, 5, 7], this means that the first bus (0-th indexed) travels in the sequence 1->5->7->1->5->7->1->... forever. + +We start at bus stop S (initially not on a bus), and we want to go to bus stop T. Travelling by buses only, what is the least number of buses we must take to reach our destination? Return -1 if it is not possible. + +```text +Example: +Input: +routes = [[1, 2, 7], [3, 6, 7]] +S = 1 +T = 6 +Output: 2 +Explanation: +The best strategy is take the first bus to the bus stop 7, then take the second bus to the bus stop 6. +``` + +Note: + +1. 1 <= routes.length <= 500. +1. 1 <= routes[i].length <= 500. +1. 0 <= routes[i][j] < 10 ^ 6. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0815.bus-routes/bus-routes.go b/Algorithms/0815.bus-routes/bus-routes.go new file mode 100755 index 000000000..08038ba47 --- /dev/null +++ b/Algorithms/0815.bus-routes/bus-routes.go @@ -0,0 +1,91 @@ +package problem0815 + +func numBusesToDestination(routes [][]int, S int, T int) int { + if S == T { + return 0 + } + + // 用于检查 T 是否存在与 routes 中 + // 不存在的话,可以直接返回 -1,提前结束程序 + isSeenT := false + + // busesSlice[7]=={0,1} 表示 + // 7 号站点,会有 0,1 两辆 bus 停靠 + busesSlice := make(map[int][]int, len(routes)) + for i := 0; i < len(routes); i++ { + for j := 0; j < len(routes[i]); j++ { + busesSlice[routes[i][j]] = append(busesSlice[routes[i][j]], i) + if routes[i][j] == T { + isSeenT = true + } + } + } + + if !isSeenT { + // T 是不存在的站点,可以直接返回 -1 + return -1 + } + + // 记录所有访问过的车站 + // 由于车站的编号太大,只好使用 Map + isCheckedStop := make(map[int]bool, len(routes)) + isCheckedStop[S] = true + + // stops 收集每一步可以停靠的所有站点 + stops := make([]int, 1, len(routes)*len(routes[0])) + stops[0] = S + + // 所有检查过得车辆不再检查 + isCheckedBus := make([]bool, len(routes)) + + // 由于 S!=T,res 从 1 开始 + res := 1 + + for len(stops) > 0 { + // 为下一站准备好存放的地方 + nextStops := make([]int, 0, len(routes)*len(routes[0])) + + // 依次查询每个 stop 所能到达的地方 + for _, stop := range stops { + // 获取从 stop 能搭乘的所有 bus 编号 + buses := busesSlice[stop] + // 添加每个 bus 能够到达的地方作为 nextStops 中的地点 + for _, bus := range buses { + // 搭乘过的 bus ,就不用再检查了 + if isCheckedBus[bus] { + continue + } + isCheckedBus[bus] = true + + // 获取 bus 能够到达的所有站点 + route := routes[bus] + + // 分别检查每个站点 r + for _, r := range route { + // 访问过的站点,就不用再一次检查了 + if isCheckedStop[r] { + continue + } + isCheckedStop[r] = true + + // 到达目的地 + if r == T { + // 直接结束程序 + return res + } + + // 要不然,就把 r 放入 nextStops + nextStops = append(nextStops, r) + } + } + } + + // 开始下一轮循环前,更新 stops + stops = nextStops + // 还需要换乘一次,所以 res++ + res++ + } + + // 依然没有找到 + return -1 +} diff --git a/Algorithms/0815.bus-routes/bus-routes_test.go b/Algorithms/0815.bus-routes/bus-routes_test.go new file mode 100755 index 000000000..74c300968 --- /dev/null +++ b/Algorithms/0815.bus-routes/bus-routes_test.go @@ -0,0 +1,78 @@ +package problem0815 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + routes [][]int + S int + T int + ans int +}{ + + { + [][]int{{1, 9, 12, 20, 23, 24, 35, 38}, {10, 21, 24, 31, 32, 34, 37, 38, 43}, {10, 19, 28, 37}, {8}, {14, 19}, {11, 17, 23, 31, 41, 43, 44}, {21, 26, 29, 33}, {5, 11, 33, 41}, {4, 5, 8, 9, 24, 44}}, + 37, + 28, + 1, + }, + + { + [][]int{{1, 2, 7}, {3, 6, 7}}, + 1, + 7, + 1, + }, + + { + [][]int{{1, 2, 7}, {3, 6, 7}}, + 1, + 6, + 2, + }, + + { + [][]int{{1, 2, 7}, {3, 6, 7}}, + 1, + 1, + 0, + }, + + { + [][]int{{1, 2, 7}, {3, 6, 7}}, + 1, + 5, + -1, + }, + + { + [][]int{{1, 2, 7}, {3, 6, 7}, {4, 5}}, + 1, + 5, + -1, + }, + + // 可以有多个 testcase +} + +func Test_numBusesToDestination(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numBusesToDestination(tc.routes, tc.S, tc.T), "输入:%v", tc) + } +} + +func Benchmark_numBusesToDestination(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numBusesToDestination(tc.routes, tc.S, tc.T) + } + } +} diff --git a/Algorithms/0816.ambiguous-coordinates/README.md b/Algorithms/0816.ambiguous-coordinates/README.md new file mode 100755 index 000000000..24360e43b --- /dev/null +++ b/Algorithms/0816.ambiguous-coordinates/README.md @@ -0,0 +1,46 @@ +# [816. Ambiguous Coordinates](https://leetcode.com/problems/ambiguous-coordinates/) + +## 题目 + +We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removedall commas, decimal points, and spaces, and ended up with the stringS. Return a list of strings representingall possibilities for what our original coordinates could have been. + +Our original representation never had extraneous zeroes, so we never started with numbers like "00", "0.0", "0.00", "1.0", "001", "00.01", or any other number that can be represented withless digits. Also, a decimal point within a number never occurs without at least one digit occuring before it, so we never started with numbers like ".1". + +The final answer list can be returned in any order. Also note that all coordinates in the final answerhave exactly one space between them (occurring after the comma.) + +```text +Example 1: +Input: "(123)" +Output: ["(1, 23)", "(12, 3)", "(1.2, 3)", "(1, 2.3)"] +``` + +```text +Example 2: +Input: "(00011)" +Output: ["(0.001, 1)", "(0, 0.011)"] +Explanation: +0.0, 00, 0001 or 00.01 are not allowed. +``` + +```text +Example 3: +Input: "(0123)" +Output: ["(0, 123)", "(0, 12.3)", "(0, 1.23)", "(0.1, 23)", "(0.1, 2.3)", "(0.12, 3)"] +``` + +```text +Example 4: +Input: "(100)" +Output: [(10, 0)] +Explanation: +1.0 is not allowed. +``` + +Note: + +1. 4 <= S.length <= 12. +1. S[0] = "(", S[S.length - 1] = ")", and the other elements in S are digits. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates.go b/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates.go new file mode 100755 index 000000000..e79616cd3 --- /dev/null +++ b/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates.go @@ -0,0 +1,46 @@ +package problem0816 + +import ( + "fmt" + "strconv" +) + +func ambiguousCoordinates(S string) []string { + res := make([]string, 0, len(S)) + s := S[1 : len(S)-1] + for i := 1; i < len(s); i++ { + lefts, rights := addDot(s[:i]), addDot(s[i:]) + for _, l := range lefts { + for _, r := range rights { + res = append(res, connect(l, r)) + } + } + } + return res +} + +func addDot(s string) []string { + res := make([]string, 0, len(s)) + if isValid(s) { + res = append(res, s) + } + + for i := 1; i < len(s); i++ { + t := s[:i] + "." + s[i:] + if isValid(t) { + res = append(res, t) + } + } + + return res +} + +func isValid(s string) bool { + f, _ := strconv.ParseFloat(s, 64) + fs := strconv.FormatFloat(f, 'f', -1, 64) + return s == fs +} + +func connect(left, right string) string { + return fmt.Sprintf("(%s, %s)", left, right) +} diff --git a/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates_test.go b/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates_test.go new file mode 100755 index 000000000..d3b513d21 --- /dev/null +++ b/Algorithms/0816.ambiguous-coordinates/ambiguous-coordinates_test.go @@ -0,0 +1,58 @@ +package problem0816 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans []string +}{ + + { + "(123)", + []string{"(1, 23)", "(12, 3)", "(1.2, 3)", "(1, 2.3)"}, + }, + + { + "(00011)", + []string{"(0.001, 1)", "(0, 0.011)"}, + }, + + { + "(0123)", + []string{"(0, 123)", "(0, 12.3)", "(0, 1.23)", "(0.1, 23)", "(0.1, 2.3)", "(0.12, 3)"}, + }, + + { + "(100)", + []string{"(10, 0)"}, + }, + + // 可以有多个 testcase +} + +func Test_ambiguousCoordinates(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := ambiguousCoordinates(tc.S) + sort.Strings(ans) + sort.Strings(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_ambiguousCoordinates(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + ambiguousCoordinates(tc.S) + } + } +} diff --git a/Algorithms/0817.linked-list-components/README.md b/Algorithms/0817.linked-list-components/README.md new file mode 100755 index 000000000..cc29365e5 --- /dev/null +++ b/Algorithms/0817.linked-list-components/README.md @@ -0,0 +1,42 @@ +# [817. Linked List Components](https://leetcode.com/problems/linked-list-components/) + +## 题目 + +We are given head, the head node of a linked list containing unique integer values. + +We are also given the list G, a subset of the values in the linked list. + +Return the number of connected components in G, where two values are connected if they appear consecutively in the linked list. + +Example 1: + +```text +Input: +head: 0->1->2->3 +G = [0, 1, 3] +Output: 2 +Explanation: +0 and 1 are connected, so [0, 1] and [3] are the two connected components. +``` + +Example 2: + +```text +Input: +head: 0->1->2->3->4 +G = [0, 3, 1, 4] +Output: 2 +Explanation: +0 and 1 are connected, 3 and 4 are connected, so [0, 1] and [3, 4] are the two connected components. +``` + +Note: + +1. If N is the length of the linked list given by head, 1 <= N <= 10000. +1. The value of each node in the linked list will be in the range [0, N - 1]. +1. 1 <= G.length <= 10000. +1. G is a subset of all values in the linked list. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0817.linked-list-components/linked-list-components.go b/Algorithms/0817.linked-list-components/linked-list-components.go new file mode 100755 index 000000000..021dd780c --- /dev/null +++ b/Algorithms/0817.linked-list-components/linked-list-components.go @@ -0,0 +1,46 @@ +package problem0817 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/* + * Definition for singly-linked list. + * type ListNode struct { + * Val int + * Next *ListNode + * return 0 +} +*/ + +// ListNode is from kit +type ListNode = kit.ListNode + +func numComponents(head *ListNode, G []int) int { + isInG := make(map[int]bool, len(G)) + for i := range G { + isInG[G[i]] = true + } + + res := 0 + + for head != nil { + /** + * head: 0->1->2->3->4 + * G = [0, 3, 1, 4] + * 结果为 2 + * 可以按照 connected components 划分 head + * head: (0->1)->2->(3->4) + * 每个单独的 connected components 的特点是 + * 最后一个 node 的 Next.Val 不在 G 中,或者是 list 的结尾 + * 那么,统计下面 if 成立的次数,就是所需的结果了 + */ + if isInG[head.Val] && + (head.Next == nil || !isInG[head.Next.Val]) { + res++ + } + head = head.Next + } + + return res +} diff --git a/Algorithms/0817.linked-list-components/linked-list-components_test.go b/Algorithms/0817.linked-list-components/linked-list-components_test.go new file mode 100755 index 000000000..219f655b5 --- /dev/null +++ b/Algorithms/0817.linked-list-components/linked-list-components_test.go @@ -0,0 +1,75 @@ +package problem0817 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + G []int + ans int +}{ + + { + []int{0, 2, 4, 3, 1}, + []int{3, 2, 4}, + 1, + }, + + { + []int{1, 2, 0, 4, 3}, + []int{3, 4, 0, 2, 1}, + 1, + }, + + { + []int{0, 1, 2}, + []int{1, 0, 2}, + 1, + }, + + { + []int{0, 1, 2}, + []int{1, 0}, + 1, + }, + + { + []int{0, 1, 2, 3}, + []int{0, 1, 3}, + 2, + }, + + { + []int{0, 1, 2, 3, 4}, + []int{0, 3, 1, 4}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_numComponents(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.head) + ast.Equal(tc.ans, numComponents(head, tc.G), "输入:%v", tc) + } +} + +func Benchmark_numComponents(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + numComponents(head, tc.G) + } + } +} diff --git a/Algorithms/0818.race-car/README.md b/Algorithms/0818.race-car/README.md new file mode 100755 index 000000000..79febc844 --- /dev/null +++ b/Algorithms/0818.race-car/README.md @@ -0,0 +1,43 @@ +# [818. Race Car](https://leetcode.com/problems/race-car/) + +## 题目 + +Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) + +Your car drives automatically according to a sequence of instructions A (accelerate) and R (reverse). + +When you get an instruction "A", your car does the following:position += speed, speed *= 2. + +When you get an instruction "R", your car does the following: if your speed is positive thenspeed = -1, otherwisespeed = 1. (Your position stays the same.) + +For example, after commands "AAR", your car goes to positions 0->1->3->3, and your speed goes to 1->2->4->-1. + +Now for some target position, say the length of the shortest sequence of instructions to get there. + +```text +Example 1: +Input: +target = 3 +Output: 2 +Explanation: +The shortest instruction sequence is "AA". +Your position goes from 0->1->3. +``` + +```text +Example 2: +Input: +target = 6 +Output: 5 +Explanation: +The shortest instruction sequence is "AAARA". +Your position goes from 0->1->3->7->7->6. +``` + +Note: + +1. 1 <= target <= 10000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0818.race-car/race-car.go b/Algorithms/0818.race-car/race-car.go new file mode 100755 index 000000000..f04607051 --- /dev/null +++ b/Algorithms/0818.race-car/race-car.go @@ -0,0 +1,54 @@ +package problem0818 + +import ( + "math" +) + +var dp [10001]int + +func racecar(t int) int { + if dp[t] > 0 { + return dp[t] + } + + // 2^(n-1) <= target < 2^n + n := uint(math.Log2(float64(t))) + 1 + + if t == 1< t 的情况 + dp[t] = racecar(1< 0 && curj > 0 { + curi-- + curj-- + if words[i][curi] == words[j][curj] { + continue + } + if words[i][curi] > words[j][curj] { + return true + } + return false + } + // 短的排在前面 + return curi == 0 + }) + + words = append(words, "") + res, i := 0, 1 + for ; i < len(words); i++ { + if !endWith(words[i], words[i-1]) { + res += len(words[i-1]) + 1 + } + } + + return res +} + +// if s end with post, return true +func endWith(s, post string) bool { + if len(s) < len(post) { + return false + } + return s[len(s)-len(post):] == post +} diff --git a/Algorithms/0820.short-encoding-of-words/short-encoding-of-words_test.go b/Algorithms/0820.short-encoding-of-words/short-encoding-of-words_test.go new file mode 100755 index 000000000..dc802bf37 --- /dev/null +++ b/Algorithms/0820.short-encoding-of-words/short-encoding-of-words_test.go @@ -0,0 +1,54 @@ +package problem0820 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans int +}{ + + { + []string{"gtgwzg", "bgmwmrk", "nqslwdi", "nwsfvi", "ixfez", "muovikm", "cfxptlx", "nffdyw", "zrmtvv", "odmhe", "btupmf", "sjfmx", "pytwab", "kznqxp", "jngry", "ppivkj", "bwwmqpq", "lxbnu", "altks", "motdd", "jimgy", "lppjek", "kbanc", "lxtgvb", "uqvvek", "ntpxnyn", "qlrdcx", "xcmgzwt", "gtcapjg", "sntqu", "tkfwow", "xqbja", "fyqbiw", "ruawk", "frjdyp", "txknwrh", "kzyjg", "bttxz", "lgntv", "ewfxgz", "lchzsg", "yqfoa", "zhsbm", "htxcg", "qjqkxou", "gkcxv", "lhsjs", "igrtnjv", "ifuecww", "slzcs", "yceue", "retyxs", "klybm", "jbxjv", "erhosw", "bjhjpjr", "nvwkcq", "mezursm", "ykbvin", "xzlij", "uiopt", "zyuxddz", "rmfhp", "xfltr", "csluqps", "gzuvj", "oyqyjy", "lgjuw", "hytegp", "gkoxj", "boirzbg", "dsqre", "gxrgabo", "jdlab", "kchijrb", "kuozwmp", "vrjqov", "hfmehfl", "xkonfn", "yfhkp", "ocota", "akfao", "qllffp", "etrpndt", "nrnmeh", "kaemhl", "diqeja", "wxclkjl", "bggfny", "krvmmx", "wofbj", "dliqwvn", "fcihtkt", "fonqx", "irawity", "kkmlx", "gjmshvq", "llcov", "vyqbaz", "ypprher", "erzcn", "zdzmj", "secthxg", "dnyxtvn", "ivqrk", "xzstj", "tvmepa", "rweifqm", "tjvoeme", "lquuq", "xeulv", "gxmyfrx", "ahltke", "hgbgr", "gtddmv", "dbrol", "tmqlk", "bmfaok", "iqojj", "zowni", "gwkvkgs", "mtoxm", "wyinnug", "kfotoix", "duymz", "keywrvl", "mukloly", "lfcycan", "illypju", "jfmlw", "atmaai", "lcsrk", "aarsej", "gylent", "cvoorpa", "awpczi", "vsrerd", "gngvhu", "fhwkc", "wsvftqb", "yevwb", "vgcpwb", "zymvkkh", "bziergz", "regjz", "ajhdn", "bgqwre", "kqfqax", "cjyly", "vinwbe", "ymkbtst", "oavwn", "onjzg", "qssxa", "eiakw", "zpcke", "ifgotsq", "adjdprf", "ilbtt", "vcjgw", "zzbjnin", "nztco", "dbyruh", "nvsvk", "jgits", "erzqz", "leqns", "twrrlp", "rqymf", "vmzijn", "kegnmyk", "oqbmcg", "otzae", "wtnls", "gstgfvy", "pqcjlui", "mxuitc", "tthpkeo", "ilhfm", "mganq", "akfti", "savwla", "jknboxy", "gizapl", "kkogrl", "bxflyea", "djeqc", "trypds", "ifowgv", "wojnr", "zqtpjh", "hirqg", "bfssfo", "wklsjey", "flvmqe", "lccbypw", "vatqhl", "exoqnda", "timli", "dfqsw", "vpqofqw", "wkqmuw", "jjrak", "ehqkwsc", "aszlpxn", "pcljgad", "oulhg", "miuirt", "fnpbpb", "slgcj", "sobzp", "qjjaaz", "xyzqeyp", "hxcdwyz", "zoxfyc", "dpjezj", "nhlbk", "wjgbvxc", "vskzyvm", "yjknun", "magigau", "qdyztsp", "tzauro", "cyafd", "tueqrk", "vbsndz", "oenku", "onyxixo", "cznrfu", "vylwwl", "cjquqf", "dtvjbs", "hrbax", "vtfkhsv", "kgunkh", "gzoralk", "rrnyslz", "ynqxm", "cpgky", "xhasqk", "mobfn", "qzumziz", "gttim", "cfvghnl", "bqlna", "saaaoa", "bdejifh", "uwddhyf", "ucqde", "yahxi", "ghjytm", "pfdtj", "ncqyqz", "bwplqpm", "jmdprp", "wjzuh", "oyvsn", "uxlqcco", "rgxzul", "mzhgvih", "iauvz", "zpygy", "mptoxu", "veektwe", "ulaietf", "bqcymhk", "hibij", "fzcoy", "ksrdhev", "auvxxqg", "bkqvrj", "egkcxj", "vdczklu", "wopnw", "wtfxx", "zdryst", "yfxyi", "hdezi", "cwsoiof", "gwfuqg", "wikkxzu", "vakgw", "jtoqr", "qzrzgo", "ovqtjk", "fvouhbd", "iunwj", "aafavex", "wwaisl", "idcyou", "pmbbjxw", "icjufh", "rjzog", "exhvn", "dypdbhr", "crvpii", "uylzlrp", "sutckm", "sxakybe", "kxhlcve", "xnnbz", "xrvwgj", "tfzqzz", "mzknfo", "anlfzcr", "lwsdak", "eqjgkk", "njdqzuw", "bvbrtx", "jozfbs", "zenxg", "rkpaoft", "aeztwv", "zdftrrx", "uurpcsk", "qdxkz", "ijjuxiv", "excyqo", "qqvbfz", "aywtfnl", "zpmfprc", "rydfsn", "nvfohp", "mvbjpx", "jpbkjef", "ogwhp", "ubaxvg", "ofrqfy", "zyhvyo", "wlakxaa", "tnzyk", "saapyr", "tcmpeb", "etnyaq", "lrgsq", "mzpbs", "fkczm", "xxdgd", "lkibi", "gthxdj", "dgzld", "tnunjn", "hzzepd", "qhmoci", "dskxgx", "jfyyrzg", "hanzy", "pzier", "thxkmx", "fktcrf", "ymdjvmf", "hgzhek", "qcelftn", "yoget", "hsadqp", "ydiip", "lkhztjr", "pjkfbi", "wskxv", "qezzdtk", "zereg", "lcqvjym", "epdlycj", "lqfnau", "njehxn", "srafi", "dhfwu", "wztjr", "ucwgnqv", "wigdg", "jkzcglz", "oxxjx", "yqvlodf", "mmaltkd", "fqahe", "nfdef", "urxct", "hzhardk", "ugvufrl", "qoraj", "itsymq", "dxvbn", "hvgmwb", "vyoab", "wqexj", "rzimt", "aejilm", "fbetztv", "gzktuf", "yxhursl", "uxluoui", "vlhpj", "cazppiu", "skibpc", "iaawl", "bgpqqjw", "haworva", "dkdzrd", "oertq", "prphs", "pwoikd", "jzxtju", "lukslx", "mwzgsa", "zbmymir", "aarvrk", "vcnarwb", "yvbae", "mblgdx", "wpknz", "ftdowg", "ogayhz", "qmemfr", "ldqbre", "oexhbh", "pndmji", "lmmhxnb", "ecmutw", "zsblbn", "aimqqnz", "ubsft", "xzagmrb", "lswjdx", "glevzy", "kmkzoec", "kimrwg", "akote", "uovrxi", "kfocof", "sikiqtk", "iyjyf", "pkpsqu", "otsxxoe", "eoxyld", "snljhud", "ryuqnn", "osadi", "teqsj", "ulvrij", "kfjcz", "wvfqwon", "zkisf", "zanaxlm", "zzgegc", "dvcpuj", "qdgcjg", "ziwqwr", "enxcv", "cecwvep", "tqoctkw", "zwoau", "opkglae", "olpvlts", "zdtrcl", "klrvh", "obrqs", "iwykadf", "vvugv", "sxskcjo", "vhyeg", "ydbaeb", "tzgplyf", "bwhyp", "uwombi", "svkodw", "otszu", "bkyqfup", "rojnt", "bauroa", "bcribk", "ctihaog", "xktdiel", "hkvctki", "wheih", "ylhxy", "wgosp", "bvgtk", "xpclcti", "uktyodd", "gfblo", "toaur", "cxdvo", "qezdwdb", "mdvdk", "zyhbs", "akbydkw", "wejgqnr", "qifti", "kxalog", "nklzot", "fgoas", "apeymfw", "mdjgo", "xifpo", "hfouhi", "mdyyzf", "xacds", "zuijqyd", "hdhsop", "ivgfg", "uarodof", "lyqlzmc", "vcyqwnj", "uiekded", "uosqq", "quajnw", "adkri", "lxsbi", "porjvx", "awnkf", "sotppb", "sfhorj", "uuocxz", "vstcick", "gqvzobl", "rkccef", "rlihmff", "lazuav", "iyahmv", "jmuplkb", "oforwx", "ogeheqd", "qpayb", "txetvjv", "uxsgsrj", "procbt", "ehlkp", "vdtyz", "eqjyvll", "tkwrwud", "qivrv", "abkkllr", "khpzqpp", "cvlhohv", "nvzbx", "svvtji", "wmyveiu", "jrogfr", "zpphtie", "faoamt", "ksektw", "ujlilq", "ufuax", "mqjla", "fqrnf", "xcdaet", "kfqknho", "ofvdjn", "kxopf", "yysdl", "dgronv", "goknbep", "lyhuswu", "cqmvhx", "hoitpoi", "dgzqll", "hpyea", "xfzohrg", "ziyod", "jxkki", "vbyoxz", "ouylxxr", "mggezan", "shxvven", "yrqnj", "tzdyik", "syeaa", "fthdjm", "zjzvdse", "jxzdjdx", "ipxpb", "ollgnbu", "jcdjyxj", "bqltawp", "lhxyv", "dvggabj", "ahcuqje", "lnrtyaz", "kubtfl", "rjetqbx", "fogbvq", "tcwhba", "ksxusyg", "qlemv", "dsjnth", "zdmmncv", "sdrzpfk", "yyocl", "vtqst", "bobtwdu", "ivifxf", "uaxwlo", "piqiigo", "pifql", "tdhuue", "lrmdb", "peetwl", "lvwpwji", "dcibnrm", "ppamuxo", "pknto", "cbiova", "wdhekr", "kgipdgd", "jlpvi", "zoptbb", "yxeamj", "pjnac", "tpdprx", "bltdktt", "wtisu", "cezsmz", "bbbqxk", "hnyweo", "jsuuu", "bykgghi", "spulymw", "bynqe", "accaq", "lghcqe", "nqygqvx", "lfvkqbw", "duzud", "agmnlw", "gqhqc", "xkgie", "fumakny", "momon", "scubukr", "xrtmoe", "ywnbn", "wdkbdzv", "wyflbp", "vyaeb", "wwzzper", "veghzzz", "fdkrof", "bkjtao", "tbvpcis", "ftzghcq", "yjsfg", "ngdkr", "pllzc", "rgviwsm", "mydqr", "ilcjq", "kmoryr", "ocnwqw", "zxggamr", "kjlasr", "idjbkt", "bjvple", "oauzpzw", "gsxjp", "sehbaf", "uubptgp", "ebhaa", "ximeurd", "kqewx", "mmcaiba", "lzpqva", "viexed", "zbcocmi", "nxnuzv", "vyawhnk", "rozmsws", "oqbubyy", "lbvegpt", "xfxct", "jifzdqm", "bmnjwmc", "ptxcqc", "ovzsxog", "ylomlt", "quoic", "tlyjmyb", "fgxpcf", "wyhyzyb", "zngau", "zgsef", "phsinbl", "kgybiqo", "tvpsi", "cuxnlt", "hqrrs", "spkjg", "kstnc", "grcrons", "lmbjo", "mypsfq", "scwir", "ypngb", "rwqksn", "ehjufq", "yulvm", "vyqrmg", "luyto", "ueiqm", "tcgcqrg", "yknwn", "szrbbtv", "wupfh", "vwrmiq", "msleyih", "iqtae", "ezykx", "ilewp", "hcttjul", "esiianh", "wkuuv", "jszkrx", "gumys", "lketi", "zvpsb", "xsvlhst", "myywl", "svexdk", "biwsh", "kpbjcdf", "cyiwl", "ilhfm", "rvqbly", "ukowa", "gkmul", "krtcmi", "vwszj", "nxwipbr", "fsycct", "jeglcq", "donvsld", "bdckkdr", "iemljm", "gfpgc", "qilgqhx", "ounvam", "qyomyt", "zklqshf", "bpauei", "kenzs", "ytgaq", "nnepek", "tniqq", "swlbj", "ibdkeo", "oxoed", "scvcrs", "jbitcfz", "fjnrwjl", "jogkl", "pmeyrjc", "kahnos", "wozbzk", "ytdav", "pcley", "kjxsvub", "jfyxt", "xkttisb", "rvdhbpc", "vvbwnmi", "cecnlb", "jjqemu", "iasnf", "usrtyx", "vtastv", "gcbwnft", "qsiqvo", "rfbua", "utaxsxl", "msrkymm", "hjuppov", "jmhmcsc", "pdiujj", "eafuzlc", "srjvh", "kzrubm", "fkgzdj", "kjptq", "zrcid", "xiuqod", "nvfjea", "ioeod", "wncxt", "avbhjud", "qkxrl", "rbmhfcq", "shyvqbu", "ffcmv", "omfeko", "ucibm", "lexpw", "rjuqey", "qohfd", "fjgzi", "mlozc", "rstgl", "ntkraqo", "paykcw", "iaajb", "adpem", "gkgjbnj", "yxbuvg", "fqkxt", "jmyqte", "uzeqyj", "rumyxor", "gkfzleq", "dwngr", "thtqdtr", "yptnz", "xoadll", "psvhyce", "geoso", "lijtbu", "amkbuby", "gfpyw", "plkso", "owdmtvh", "fkxad", "keqdrz", "irxjure", "gfwepm", "wyxiom", "pyedlj", "mfszmv", "tkjiofn", "epjdigv", "jjnuh", "mtxks", "nvfts", "xtqhc", "xttlu", "sasra", "qfumac", "rwfavex", "rcwstl", "cfzmi", "htvxrs", "nokfsvv", "tbvtckp", "wsikt", "tyvwtw", "hyvzd", "edflcy", "wduqbbl", "xacrrb", "sfbzq", "adhhyy", "tltmppb", "imjooie", "joizol", "rbzhgs", "rcldg", "ikspo", "sxouwi", "llemmdb", "nkkfie", "uadfas", "rigylga", "mbnhs", "vwtsnh", "uiskft", "ppvhyr", "znaenz", "lbjldsk", "sizcja", "dzvlem", "iedleqf", "zhxzaqt", "zyeen", "ijdohjj", "dvycit", "nfqyxoc", "xgspmx", "gticsq", "tvodn", "zpvtu", "yvevn", "bugvglx", "pprlwl", "wikandw", "fmkqpzp", "sjfnjlf", "yswptd", "aeuqf", "ihynsy", "fnlrtb", "haewxo", "fvnzrx", "mudxoc", "vtdpd", "zuldtvj", "kerpq", "xeesgr", "enhkpmo", "bhhlngf", "vcqrcr", "drflmq", "dufvzsz", "fuouj", "bqcyqr", "tsiyu", "lrpnmx", "hfqhwz", "irfjh", "fikhwz", "qxptzm", "jzppff", "asutke", "byouz", "amqbvx", "jgsfh", "obdvlb", "sfcdx", "ofkxo", "asamcnd", "caxpnb", "qjaqpy", "zbtsmeu", "atzzwkl", "ebkpov", "gxuyje", "ybgbdd", "jqaca", "wnrqyt", "omxxneb", "xerpzsl", "iadesn", "mtbdwj", "qftiu", "fpeuu", "pipsu", "koxnbn", "ztult", "uguldn", "aceqlji", "uasdjf", "tcydz", "gswhdlg", "rieim", "ojplv", "tjmavcp", "tfbcvlh", "uutoacm", "ihsixk", "qwvagbe", "nxizc", "zvwfvk", "cdsyeb", "hambpgs", "hpsndyh", "gwjoyw", "ocqpmcm", "xrbmn", "grmefy", "wwoxg", "tyvgc", "voeqrnu", "rwnsj", "cnmnz", "dxltx", "xnybz", "jslwhka", "dremxm", "gfcba", "fijeyqo", "kxzpxyg", "idjbzud", "rfndjd", "gqyslh", "wpoznf", "cbzma", "dnvfyh", "spguxoa", "bhjhe", "pehce", "vwanott", "giwquq", "vhvwh", "krukn", "xojkq", "mpdfbk", "evlzdsw", "mlbytl", "dzeeupj", "pfyyieu", "khbxqla", "pjfdf", "ouvrzs", "liyksgg", "aimlb", "jujhbu", "qtxebe", "nermn", "itsnf", "whpetav", "pnjfufk", "xeutgz", "sbzev", "vimqnd", "dmagho", "qfwlrsd", "dnchdg", "ykmrpua", "fwlim", "mxxhdrc", "uewuwtk", "cubiq", "lrrot", "ntfzl", "epluzj", "lqxnwo", "cehhmlm", "ntewnl", "mqlxmr", "yifbwx", "srvzoge", "ocorz", "nahzh", "eyxyrv", "ygtxiq", "lznyt", "kntje", "qztqnwk", "zcuogu", "jvvqgir", "cgknqi", "jzdcl", "kbcnli", "ofavaz", "govvnq", "chmuflw", "vxkxu", "lgzbgu", "oaeleyg", "wbjjdiq", "rxzei", "orhgon", "swmrkye", "lfecfum", "zrwygt", "dnsly", "wayaxe", "idvhdd", "nzlrr", "qinomxp", "zqexfqg", "cgirjzp", "cxyrqt", "jledfgr", "xstkbu", "lsazo", "vqlam", "bwdacez", "mpyxys", "mjljmde", "hztog", "tjubtlz", "vhhhn", "ssercal", "xthbxt", "icyiu", "iljzz", "zhnjfm", "cktcwjh", "qetdt", "gdeenr", "lcktgy", "wzwoug", "mefjve", "fryrl", "fefwp", "dzvow", "ytomt", "wglib", "komqcu", "wztnrs", "gestvx", "hquwilc", "mxfzqf", "svhwm", "viymyf", "uolmu", "uirzdao", "iyprm", "uxjnyzd", "rcwczh", "qofsqkz", "oefie", "gmtgrn", "krrfs", "bfhsdnq", "cowzu", "fgrjjz", "xtpdn", "wiepso", "slgjrjd", "inlimj", "nscgl", "vvnby", "kxckw", "gllbjjp", "juvui", "kbzjd", "odhqpx", "pnpkvf", "fuleic", "inawlx", "essdsdj", "fvlud", "ttvjwz", "cnkmtdy", "xlchd", "isqhk", "vmilcks", "xoifyy", "bkygwh", "mgzdpre", "waemqvd", "ricio", "wycuo", "bqzkd", "pjazcp", "kqviffk", "ojfvq", "unlbnfb", "detmfih", "nytprpm", "fevnwin", "iydfpqc", "pkhlbi", "aetnje", "pzojli", "basba", "xutuv", "akncyfb", "nsiwt", "shovlwd", "qyayx", "mzjcre", "xadyr", "dxpxj", "mlcpp", "zzyaht", "vwqhyeq", "dwmla", "oizmbr", "egwzibj", "rfbmu", "fuzhg", "ynlbutf", "yycgtro", "humfhb", "lrkkga", "xglbsoe", "mvrdb", "fvxjbw", "lomacg", "fmfmal", "qykti", "oujsp", "nohogca", "dbyvxbi", "eawic", "qfzwp", "xrzbec", "rrqyw", "mtbhs", "hbrnv", "fnmeikj", "mwogm", "ovxyvn", "cvkqxcr", "xfnobdy", "pkity", "rbgtuwh", "odjnv", "zksyrl", "rzuceuk", "qukxs", "ipznvtc", "bsvzooz", "nzbpb", "xpiiir", "chkqepj", "wzwzzcw", "rhptep", "yjccu", "avijaiv", "kxpms", "ovwqsgo", "jjqvi", "wyrxpu", "kybsyhw", "kvyaj", "dnusp", "irgrjyj", "wpeico", "psgnk", "joevw", "pfyqwr", "sxlmcs", "ibblhvx", "aecsjes", "tuqnfd", "avemo", "fvijtdb", "zcehesf", "yowvgv", "fnrgd", "jpvkykx", "ekyho", "abtxc", "hptqmiy", "duwef", "bdsac", "mgamp", "wtsto", "efxhwad", "yhjwfe", "adnhhh", "ouykgrh", "sbtpmr", "fzkps", "mdilvvn", "ztvysu", "rafkn", "ledgijl", "ewlnpsr", "cedlekw", "gngcu", "phbqtb", "znfjwqk", "wrqkv", "tayvdd", "cceqg", "dabgyh", "wgutqn", "klseoo", "kaktas", "einjkvf", "gzmbvur", "plcskol", "vhpzaqz", "gcezm", "giavzjt", "prrai", "szrtye", "lbegl", "jkkunm", "ociydiw", "kstxl", "bqxhkzh", "jzzjv", "vbjzopr", "jvdkro", "padxe", "pmezf", "eqwlb", "nupajjp", "bkunbit", "xjqxtr", "wzuqmc", "dqozgi", "diqfj", "eqlfngp", "gvnggid", "znylx", "jajie", "qmsamw", "mttvg", "gzamj", "cscnb", "bvtreg", "qhbiq", "eklkjp", "fbcyl", "rdjsfqf", "qevuv", "jwislw", "unjvd", "fsbvb", "wqcrho", "orrylro", "zoxokla", "dgoja", "rgwja", "vqpzfh", "llhtc", "afoic", "arscma", "qfwfli", "ivcncxd", "ximts", "kwfebh", "wffmri", "ljace", "eonkn", "ueapcli", "qmocdvr", "mdviccj", "vwvyl", "savupw", "fanliyh", "ykwvsh", "yzqez", "vdxepxm", "soocy", "jqczsb", "ckufr", "gyusijy", "sbdvh", "hgbqt", "zrcka", "mhfhy", "shksov", "pfliju", "xlesen", "rgqiz", "mnajzkt", "iozcs", "hqikmbq", "ervfyim", "ezddw", "kgklyaw", "sfmqe", "lnaexsi", "llvvt", "bhiwu", "riigy", "gtdxlh", "vpkoeau", "apapx", "ebpwll", "pkhqe", "erulwb", "ljxkn", "zhcgls", "ejvxh", "fwlsjmq", "yrrykh", "stcxaw", "tgpbny", "grvkdk", "svuzxpf", "jwsmwcm", "kayffuh", "xnaisep", "qigyx", "dxnje", "nplwles", "qqomb", "xrnrvr", "qmqxr", "datvf", "vllggut", "cadczx", "nknpbhk", "izowycz", "pekxqfk", "unbrsm", "mcjown", "kaqiw", "obrurt", "dmwqli", "atjrc", "oqmlell", "wymlr", "xjpkztx", "wjyhkna", "otqju", "hblgv", "lxrbs", "gyfwu", "vdpmt", "kjmdibo", "ozapzmw", "jwcgtq", "dfymo", "qagvqil", "hittrny", "uinvmlm", "tehfpsl", "vpqnzqy", "sroki", "inxetz", "isnmony", "nzmvf", "dzufni", "nexqh", "fkjnvma", "gwvst", "idhwax", "neeuvln", "iecja", "zwzdp", "vfppg", "obbei", "dfgopn", "acijhp", "ixwtkp", "fpyny", "rzozlxq", "djuov", "hhfjcl", "kcnfa", "grguw", "dduiej", "rewvs", "imlwk", "fosbbtq", "xjclkjn", "wwpqgb", "jovsfes", "mhiaeuj", "fxjgk", "enngxv", "skiaud", "whfkr", "igchqb", "kftala", "dwjxl", "xepvk", "qidfjb", "titaly", "jplijvv", "nuzcon", "slleg", "tyycth", "dtvrvpd", "yubfqoi", "pkwsff", "zbbko", "nrggf", "hqgnna", "yfumb", "qubvic", "qjpwo", "vmepg", "btawj", "zveot", "xaivzxu", "tknsmv", "fgbvza", "fnsnqs", "qbismc", "arhyycq", "evvxs", "xpkees", "nuumqyd", "yzqdh", "oeeuxh", "vmjcm", "lkvgv", "mpxrugr", "tkxnx", "cpafxvh", "wrswmb", "eadznj", "bdvgwz", "ahiegu", "shedlup", "sejcyww", "zbusii", "lzdzak", "oymze", "vhbrz", "digdz", "xphzgg", "levzi", "tgkvqp", "kmxcnm", "bnwlngx", "iejarx", "dizrscz", "vsyqnv", "zkuoye", "beojpk", "hfhvzg", "gisjftm", "dvweqa", "keauzic", "lkjby", "ngguexc", "pohngye", "afjtde", "xhddc", "hhttmgi", "caczjl", "wgkfbv", "ulvax", "uemxgxs", "uqfzxu", "keaaw", "pdxhn", "waoly", "ukvfwy", "pentckg", "bgypmd", "ozywxef", "kxbyg", "ituij", "yssywlv", "iybzdz", "knpyeub", "sbkrdlh", "hsqvas", "wrjiuyo", "pgogqmv", "ofsoix", "dxldl", "ezhgfxg", "igpkh", "bobmm", "gddpayx", "ejihwu", "evxddr", "wdlcpqn", "zlucrvj", "lciroeu", "tozwakg", "ymrlcji", "cpupkp", "oqjaa", "ikerp", "eghad", "tntbl", "giqxr", "szavqhz", "acqawb", "hdfytnu", "qoksmwl", "snnplu", "drvhr", "uyjef", "kjlpxcr", "wivxg", "jemkix", "mlhcmd", "vlivttu", "georzc", "vagamm", "gndipgf", "cmvsbmv", "pbfyvz", "pgwye", "qyxpvs", "grjadvo", "vgfev", "kpfloyz", "lchpqln", "eejfkcs", "vlkrhp", "ppfukr", "pgrjbg", "wogtj", "cgivop", "jnpqoj", "ldlpbrr", "vlgal", "kbjar", "dngqm", "ikgadp", "jipvwuq", "xqvjkl", "ojtecxz", "updfcm", "xwbhr", "qhupf", "yuiat", "jhpfebe", "vnrrunw", "eunefe", "kzcbqd", "fvxufv", "koynws", "dgyfwb", "nyvekrk", "rjuotpr", "ymdwzj", "dnkmrlt", "abykta", "ubmbjdy", "pvarsmz", "ttnvs", "jqhejm", "zvrek", "edhxibz", "qexny", "oagswer", "twtur", "fmcbl", "qmdma", "zthlqwv", "bhwps", "czqgr", "gqbrrxx", "nkvgzrs", "cazmrjq", "nieyb", "bgsgq", "ukfakiz", "yztyra", "tyfrigv", "wlfhd", "rbyunj", "usvypgo", "hhkej", "jivtlg", "ifgzqu", "ofjrlw", "rlqyxnm", "smljy", "mbgwv", "fwlehwb", "qlogyx", "faxwc", "axaeo", "hkgsppo", "dencdr", "ddhbps", "jbxxoc", "pjxyk", "ctvqy", "qvvpzyu", "yewduf", "mugmbte", "lzfqvuc", "vhxpg", "jnmqj", "ennlwu", "qmjhiqg", "adierw", "goezh", "vjnoz", "rqagh", "emtspp", "nmmhe", "ssomw", "ofkwv", "ludzh", "otpfssv", "snwjzz", "ahimcsq", "tgoxkeg", "shnsfau", "cmcdlym", "ybnft", "kcoyn", "bonazcf", "gufvm", "tpmlzom", "eyzmod", "dokojaj", "xadbjwk", "ffvle", "ntteh", "jevrazt", "efkhc", "bbwntl", "srihk", "kmjadz", "qkxsvbq", "ddljp", "uwwuvth", "bipgo", "ihsmv", "xmmmcsj", "odmqr", "fttvlys", "shehiuy", "icgwi", "nsvmg", "zqjjkyk", "umrie", "spbqz", "xmidgzv", "yadhc", "mspibhn", "xtgxom", "rasfnft", "blerfgx", "zfpfq", "xkfclje", "tbzvw", "vgbvg", "ayngxcp", "ndyle", "vqbgsce", "fpshlx", "vqufvgv", "dkyccvy", "yyuyjf", "rfxmqdn", "sxugzm", "gjhbkv", "xhdjvx", "ymykgxb", "prknrk", "eabbpqr", "qxojf", "lzwhuby", "cpozcue", "ishbwlf", "mduhyjx", "rrhhav", "ufbafzp", "mfpwuww", "pobnaaj", "lrsxxj", "cohjf", "jkbxz", "sarme", "grklhj", "tqvkqy", "ytikna", "asntarp", "gslbu", "exorbu", "cjkwzu", "psdma", "zzpdol", "dvgloav", "yxbfakk", "emmcvx", "jlguic", "jjxkfmt", "iuendwj", "rathmt", "qyweiba", "xafoy", "dqsnc", "hvkowm", "eabcao", "phydpb", "rndnfwg", "qjahwwx", "ytpal", "htmau", "dopybqz", "nvjif", "vwwqi", "qermpq", "iizvetj", "xqfos", "rtcuhbe", "igjrfme", "ubxbb", "qppcb", "nohfxao", "nfyncug", "ddzhw", "froajrf", "sjjiss", "kqitq", "unzlbaj", "sbdaepv", "tvmhcga", "kqhgtom", "vamfzf", "gyofhng", "mabbme", "zdchndq", "zybctyd", "psqbrzl", "hyxfsrj", "xtgkdh", "ptwqat", "uucrov", "igljkfu", "pktoiui", "nhyil", "cshte", "pfsqa", "nsfsmze", "twcuf", "jfqwtd", "vinzb", "afruk", "txldlnj", "jsttu", "pkbczjm", "txpfq", "xbhwtcg", "cmcho", "jtuixpl", "xfefj", "oapaczq", "xcpvsw", "qbudm", "xdvtr", "hwkmj", "zagtjpd", "ohnawr", "flxbat", "epicea", "xmjnmbw", "ywvfcz", "rvyel", "nsuwwuz", "kknoqq", "mhsfiz", "hnromvi", "dedzukf", "uldavy", "pdcec", "qojqpmf", "sivfru", "xjayrn", "xwjuah", "vkqmb", "wuvkxpc", "nrhsb", "hashdly", "oeudry", "foqpt", "sdexar", "nuyli", "smxpkk", "mjheihb", "zmxlu", "ouiisf", "gmhjbb", "zozpja", "diimrrm", "uwonbw", "pegxoxf", "obdtpcn", "fdadto", "aekkg", "fjjxmeu", "dkqpptm", "wbfuzr", "lfteh", "rbtfbzo", "eglch", "qxrru", "oofwkgz", "rgigqr", "gnjpoep", "uexcxs", "mwfgk", "embebip", "suans", "oagqbqx", "plyzcsq", "huggwzw", "ccsxy", "waixkjw", "doqwr", "uqxkvkc", "yurkj", "slgbj", "mbqzm", "yssszr", "htoph", "gupqhgj", "kkrsdv", "uiuxfp", "qxacm", "uwmqc", "jbnzh", "sqyalww", "kcjsmx", "lonsz", "pzsmu", "cjqvjw", "qiiulzm", "wfoqt", "kdjnfe", "dsnpjn", "xnzmimc", "ulvdd", "fvxpmm", "rzklco", "whyolla", "ppmex", "bgaoi", "vskeguj", "kjwbh", "wzskso", "lnpkvie", "lcxsnc", "ddwpwc", "hezxemz", "tcgkj", "yawyd", "oymed", "ukqrx", "zfwmo", "ifswz", "mzjuo", "cafpb", "kubdbe", "owkux", "rhrvb", "usaev", "pkffvsn", "uindrki", "xeemo", "qumuu", "pldri", "ghusk", "xkzsrym", "mndqb", "fpvokz", "kfmeg", "lrhmj", "refbzvk", "qlbrmp", "ddjuaj", "foyet", "qtdujqj", "uwvhxsj", "xtmtkiz", "xpwvh", "fcgll", "dlnwmj", "rmfnoz", "pomnxn", "vhjcyi", "totup", "udgpv", "axpaddc", "qtzmga", "hoszek", "smsmmvg", "qoyvj", "vxqigxy", "pvwynx", "puxjpjv", "odcaxeo", "daeuw", "cdugp", "sgwgjdx", "buhfyf", "yiwykai", "ojtfyal", "tjaob", "oimmn", "bdtnidq", "zhysw", "bojjkf", "wkgqrd", "njecfik", "cnndzrq", "dsiaa", "kumtk", "towbx", "bzoirpz", "vtnxby", "plhdj", "rqpai", "ztaousd", "vspwkxu", "mikncyf", "pafxpnc", "bggcmvj", "tahqf", "izchgc", "xaspz", "zwfwl", "cwgcuci", "wzuzq", "rgrsyzu", "mgytix", "kqqakjw", "eekgzcm", "txbcw", "fcoxkag", "kqxac", "licntr", "vmweor", "bslmfto", "jzalnup", "tuiep", "dacwc", "zntmpb", "ikexnhq", "mlioa", "klwpv", "ddhbtg", "jurwdf", "jutynuo", "dlcicqo", "cnvqsq", "qqsiszn", "vqabt", "huaoigf", "bmlpczh", "dsnuy", "qrrqv", "edoxkud", "uqxdk", "gyphg", "rvyzzz", "epjhqj", "dejkvae", "zczwgm", "ulisrt", "ihuayib"}, + 13935, + }, + + { + []string{"atime", "aatime", "btime"}, + 13, + }, + + { + []string{"ime", "time", "me", "bell"}, + 10, + }, + + { + []string{"time", "me", "bell"}, + 10, + }, + + // 可以有多个 testcase +} + +func Test_minimumLengthEncoding(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minimumLengthEncoding(tc.words), "输入:%v", tc) + } +} + +func Benchmark_minimumLengthEncoding(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minimumLengthEncoding(tc.words) + } + } +} diff --git a/Algorithms/0821.shortest-distance-to-a-character/README.md b/Algorithms/0821.shortest-distance-to-a-character/README.md new file mode 100755 index 000000000..f941d5f1b --- /dev/null +++ b/Algorithms/0821.shortest-distance-to-a-character/README.md @@ -0,0 +1,22 @@ +# [821. Shortest Distance to a Character](https://leetcode.com/problems/shortest-distance-to-a-character/) + +## 题目 + +Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string. + +Example 1: + +```text +Input: S = "loveleetcode", C = "e" +Output: [3, 2, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0] +``` + +Note: + +1. S string length is in [1, 10000]. +1. C is a single character, and guaranteed to be in string S. +1. All letters in S and C are lowercase. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character.go b/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character.go new file mode 100755 index 000000000..30ffb574e --- /dev/null +++ b/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character.go @@ -0,0 +1,40 @@ +package problem0821 + +func shortestToChar(S string, C byte) []int { + n := len(S) + + res := make([]int, n) + for i := range res { + res[i] = n + } + + left, right := -n, 2*n + + for i := 0; i < n; i++ { + j := n - i - 1 + if S[i] == C { + left = i + } + if S[j] == C { + right = j + } + res[i] = min(res[i], dist(i, left)) + res[j] = min(res[j], dist(j, right)) + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func dist(i, j int) int { + if i > j { + return i - j + } + return j - i +} diff --git a/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character_test.go b/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character_test.go new file mode 100755 index 000000000..22964522c --- /dev/null +++ b/Algorithms/0821.shortest-distance-to-a-character/shortest-distance-to-a-character_test.go @@ -0,0 +1,46 @@ +package problem0821 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + C byte + ans []int +}{ + + { + "abaa", + 'b', + []int{1, 0, 1, 2}, + }, + { + "loveleetcode", + 'e', + []int{3, 2, 1, 0, 1, 0, 0, 1, 2, 2, 1, 0}, + }, + + // 可以有多个 testcase +} + +func Test_shortestToChar(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestToChar(tc.S, tc.C), "输入:%v", tc) + } +} + +func Benchmark_shortestToChar(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestToChar(tc.S, tc.C) + } + } +} diff --git a/Algorithms/0822.card-flipping-game/README.md b/Algorithms/0822.card-flipping-game/README.md new file mode 100755 index 000000000..bcf93adcd --- /dev/null +++ b/Algorithms/0822.card-flipping-game/README.md @@ -0,0 +1,32 @@ +# [822. Card Flipping Game](https://leetcode.com/problems/card-flipping-game/) + +## 题目 + +On a table are N cards, with a positive integer printed on the front and back of each card (possibly different). + +We flip any number of cards, and after we choose onecard. + +If the number X on the back of the chosencard is not on the front of any card, then this number X is good. + +What is the smallest number that is good? If no number is good, output 0. + +Here, fronts[i] and backs[i] represent the number on the front and back of card i. + +Aflip swaps the front and back numbers, so the value on the front is now on the back and vice versa. + +Example: + +Input: fronts = [1,2,4,4,7], backs = [1,3,4,1,3] +Output: 2 +Explanation: If we flip the second card, the fronts are [1,3,4,4,7] and the backs are [1,2,4,1,3]. +We choose the second card, which has number 2 on the back, and it isn't on the front of any card, so 2 is good. + +Note: + +1. 1 <= fronts.length == backs.length<=1000. +1. 1 <=fronts[i]<= 2000. +1. 1 <= backs[i]<= 2000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0822.card-flipping-game/card-flipping-game.go b/Algorithms/0822.card-flipping-game/card-flipping-game.go new file mode 100755 index 000000000..50f7d7d5b --- /dev/null +++ b/Algorithms/0822.card-flipping-game/card-flipping-game.go @@ -0,0 +1,38 @@ +package problem0822 + +func flipgame(fronts []int, backs []int) int { + size := len(fronts) + + isBoth := make(map[int]bool, size) + for i := 0; i < size; i++ { + if fronts[i] == backs[i] { + isBoth[fronts[i]] = true + } + } + + upLimit := 2001 + + res := upLimit + + for i := 0; i < size; i++ { + if !isBoth[fronts[i]] { + res = min(res, fronts[i]) + } + if !isBoth[backs[i]] { + res = min(res, backs[i]) + } + } + + if res == upLimit { + return 0 + } + return res + +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0822.card-flipping-game/card-flipping-game_test.go b/Algorithms/0822.card-flipping-game/card-flipping-game_test.go new file mode 100755 index 000000000..963593fc9 --- /dev/null +++ b/Algorithms/0822.card-flipping-game/card-flipping-game_test.go @@ -0,0 +1,53 @@ +package problem0822 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + fronts []int + backs []int + ans int +}{ + + { + []int{1, 1}, + []int{2, 2}, + 1, + }, + + { + []int{1, 3, 4, 4, 3}, + []int{1, 3, 4, 1, 3}, + 0, + }, + + { + []int{1, 2, 4, 4, 7}, + []int{1, 3, 4, 1, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_flipgame(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, flipgame(tc.fronts, tc.backs), "输入:%v", tc) + } +} + +func Benchmark_flipgame(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + flipgame(tc.fronts, tc.backs) + } + } +} diff --git a/Algorithms/0823.binary-trees-with-factors/README.md b/Algorithms/0823.binary-trees-with-factors/README.md new file mode 100755 index 000000000..2c7e90039 --- /dev/null +++ b/Algorithms/0823.binary-trees-with-factors/README.md @@ -0,0 +1,36 @@ +# [823. Binary Trees With Factors](https://leetcode.com/problems/binary-trees-with-factors/) + +## 题目 + +Given an array of unique integers, each integer is strictly greater than 1. + +We make a binary tree using these integersand each number may be used for any number of times. + +Each non-leaf node'svalue should be equal to the product of the values of it's children. + +How many binary trees can we make? Return the answer modulo 10 ** 9 + 7. + +Example 1: + +```text +Input: A = [2, 4] +Output: 3 +Explanation: We can make these trees: [2], [4], [4, 2, 2] +``` + +Example 2: + +```text +Input: A = [2, 4, 5, 10] +Output: 7 +Explanation: We can make these trees: [2], [4], [5], [10], [4, 2, 2], [10, 2, 5], [10, 5, 2]. +``` + +Note: + +1. 1 <= A.length <=1000. +1. 2 <=A[i]<=10 ^ 9. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors.go b/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors.go new file mode 100755 index 000000000..29e5c18d9 --- /dev/null +++ b/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors.go @@ -0,0 +1,50 @@ +package problem0823 + +import "sort" + +const ( + modulo = 1E9 + 7 +) + +func numFactoredBinaryTrees(A []int) int { + sort.Ints(A) + + factorIndex := make(map[int]int, len(A)) + for i := range A { + factorIndex[A[i]] = i + } + + ress := make([]int, len(A)) + + for i := 0; i < len(A); i++ { + // 自身算一个 + ress[i] = 1 + for j := 0; j < i; j++ { + quotient, remainder := A[i]/A[j], A[i]%A[j] + k, isFactor := factorIndex[quotient] + + if remainder != 0 || !isFactor { + continue + } + + // 左边和右边的组合数 + // 题目还说了 A[x] is unique + ress[i] += ress[j] * ress[k] + } + ress[i] = mod(ress[i]) + } + + return sum(ress) +} + +func sum(a []int) int { + res := 0 + for i := range a { + res += a[i] + } + return mod(res) +} + +func mod(n int) int { + return n % modulo +} diff --git a/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors_test.go b/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors_test.go new file mode 100755 index 000000000..744bb34fa --- /dev/null +++ b/Algorithms/0823.binary-trees-with-factors/binary-trees-with-factors_test.go @@ -0,0 +1,49 @@ +package problem0823 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{18, 3, 6, 2}, + 12, + }, + + { + []int{2, 4}, + 3, + }, + + { + []int{2, 4, 5, 10}, + 7, + }, + + // 可以有多个 testcase +} + +func Test_numFactoredBinaryTrees(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numFactoredBinaryTrees(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numFactoredBinaryTrees(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numFactoredBinaryTrees(tc.A) + } + } +} diff --git a/Algorithms/0824.goat-latin/README.md b/Algorithms/0824.goat-latin/README.md new file mode 100755 index 000000000..cfe6d1a5e --- /dev/null +++ b/Algorithms/0824.goat-latin/README.md @@ -0,0 +1,41 @@ +# [824. Goat Latin](https://leetcode.com/problems/goat-latin/) + +## 题目 + +A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only. + +We would like to convert the sentence to "Goat Latin"(a made-up language similar to Pig Latin.) + +The rules of Goat Latin are as follows: + +- If a word begins with a vowel (a, e, i, o, or u), append "ma"to the end of the word. +- For example, the word 'apple' becomes 'applema'. +- If a word begins with a consonant (i.e. not a vowel), remove the first letter and append it to the end, then add "ma". +- For example, the word "goat"becomes "oatgma". +- Add one letter 'a'to the end of each word per its word index in the sentence, starting with 1. +- For example,the first word gets "a" added to the end, the second word gets "aa" added to the end and so on. + +Return thefinal sentence representing the conversion from Sto GoatLatin. + +Example 1: + +```text +Input: "I speak Goat Latin" +Output: "Imaa peaksmaaa oatGmaaaa atinLmaaaaa" +``` + +Example 2: + +```text +Input: "The quick brown fox jumped over the lazy dog" +Output: "heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa" +``` + +Notes: + +1. S contains only uppercase, lowercase and spaces.Exactly one space between each word. +1. 1 <= S.length <= 150. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0824.goat-latin/goat-latin.go b/Algorithms/0824.goat-latin/goat-latin.go new file mode 100755 index 000000000..ca5d69fcc --- /dev/null +++ b/Algorithms/0824.goat-latin/goat-latin.go @@ -0,0 +1,34 @@ +package problem0824 + +import ( + "strings" +) + +func toGoatLatin(S string) string { + ss := strings.Split(S, " ") + + for i := range ss { + ss[i] = handleWord(ss[i], i) + } + + return strings.Join(ss, " ") +} + +func handleWord(s string, i int) string { + postfix := "ma" + strings.Repeat("a", i+1) + + if isBeginWithVowel(s) { + return s + postfix + } + + return s[1:] + s[0:1] + postfix +} + +func isBeginWithVowel(s string) bool { + switch s[0] { + case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U': + return true + default: + return false + } +} diff --git a/Algorithms/0824.goat-latin/goat-latin_test.go b/Algorithms/0824.goat-latin/goat-latin_test.go new file mode 100755 index 000000000..0288d8814 --- /dev/null +++ b/Algorithms/0824.goat-latin/goat-latin_test.go @@ -0,0 +1,44 @@ +package problem0824 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "I speak Goat Latin", + "Imaa peaksmaaa oatGmaaaa atinLmaaaaa", + }, + + { + "The quick brown fox jumped over the lazy dog", + "heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa", + }, + + // 可以有多个 testcase +} + +func Test_toGoatLatin(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, toGoatLatin(tc.S), "输入:%v", tc) + } +} + +func Benchmark_toGoatLatin(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + toGoatLatin(tc.S) + } + } +} diff --git a/Algorithms/0825.friends-of-appropriate-ages/README.md b/Algorithms/0825.friends-of-appropriate-ages/README.md new file mode 100755 index 000000000..f2c6c4174 --- /dev/null +++ b/Algorithms/0825.friends-of-appropriate-ages/README.md @@ -0,0 +1,50 @@ +# [825. Friends Of Appropriate Ages](https://leetcode.com/problems/friends-of-appropriate-ages/) + +## 题目 + +Some people will make friend requests. Thelist of their ages is given andages[i]is the age of theith person. + +Person A will NOT friend request person B (B != A) if any of the following conditions are true: + +- age[B]<= 0.5 * age[A]+ 7 +- age[B]> age[A] +- age[B]> 100 &&age[A]< 100 + +Otherwise, A will friend request B. + +Note that ifA requests B, B does not necessarily request A. Also, people will not friend request themselves. + +How many total friend requests are made? + +Example 1: + +```text +Input: [16,16] +Output: 2 +Explanation: 2 people friend request each other. +``` + +Example 2: + +```text +Input: [16,17,18] +Output: 2 +Explanation: Friend requests are made 17 -> 16, 18 -> 17. +``` + +Example 3: + +```text +Input: [20,30,100,110,120] +Output: +Explanation: Friend requests are made 110 -> 100, 120 -> 110, 120 -> 100. +``` + +Notes: + +1. 1 <= ages.length<= 20000. +1. 1 <= ages[i] <= 120. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages.go b/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages.go new file mode 100755 index 000000000..438a7f53d --- /dev/null +++ b/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages.go @@ -0,0 +1,39 @@ +package problem0825 + +func numFriendRequests(ages []int) int { + count := [121]int{} + for i := range ages { + count[ages[i]]++ + } + + sums := [121]int{} + sum := 0 + res := 0 + for a := range count { + sum += count[a] + sums[a] = sum + + if a <= 14 || count[a] == 0 { + // 此时 a/2+7 >= a + continue + } + + b := a/2 + 7 + + res += count[a] * (sums[a] - sums[b] - 1) + // sums[a] - sums[b],年龄段 (b,a] 中的人数 + // sums[a] - sums[b] - 1,减一是因为不能和自己交朋友 + // + // 题目中的 3 条交友规则,归纳总结一下,就是 + // 年龄为 a 的人 + // 只能和年龄段 (a/2+7, a] 中除了自己以外的人交朋友, + } + + return res +} + +/** + * 当 age[B] <= 0.5 * age[A] + 7 和 age[B] > age[A] 成立时 + * age[B] > 100 && age[A] < 100 一定成立,所以这个限制是障眼法 + * +**/ diff --git a/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages_test.go b/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages_test.go new file mode 100755 index 000000000..49aa268c2 --- /dev/null +++ b/Algorithms/0825.friends-of-appropriate-ages/friends-of-appropriate-ages_test.go @@ -0,0 +1,54 @@ +package problem0825 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + ages []int + ans int +}{ + + { + []int{7, 44, 108, 41, 74, 20, 25, 36, 59, 71, 98, 17, 66, 100, 39, 111, 82, 21, 41, 114, 29, 79, 95, 76, 97, 64, 66, 98, 56, 103, 61, 12, 47, 78, 1, 79, 78, 105, 22, 67, 95, 79, 27, 10, 51, 30, 7, 43, 23, 45, 20, 33, 95, 52, 25, 29, 117, 47, 84, 95, 42, 89, 49, 116, 44, 60, 29, 104, 116, 11, 87, 110, 120, 23, 89, 34, 112, 84, 102, 47, 106, 102, 45, 111, 84, 70, 108, 41, 36, 77, 11, 109, 3, 111, 23, 36, 9, 86, 71, 28, 92, 90, 115, 53, 12, 71, 114, 102, 11, 53, 44, 19, 66, 79, 13, 20, 59, 4, 112, 116, 15, 38, 29, 87, 94, 35, 97, 9, 85, 97, 77, 18, 118, 101, 80, 29, 109, 10, 25, 85, 54, 114, 106, 93, 113, 47, 81, 19, 61, 57, 57, 20, 19, 44, 99, 94, 73, 5, 24, 100, 97, 99, 41, 44, 114, 67, 61, 31, 2, 15, 6, 53, 108, 119, 3, 60, 65, 72, 26, 91, 1, 22, 34, 30, 35, 86, 120, 60, 28, 88, 83, 18, 114, 64, 54, 74, 91, 30, 14, 3, 1, 70, 106, 20, 117, 100, 111, 73, 71, 41, 70, 14, 46, 27, 51, 42, 44, 112, 111, 45, 81, 92, 66, 21, 13, 78, 11, 67, 64, 97, 83, 13, 67, 47, 5, 74, 87, 110, 103, 96, 92, 21, 49, 22, 16, 86, 73, 56, 73, 56, 113, 38, 3, 116, 76, 85, 107, 105, 15, 94, 46, 61, 116, 20, 104, 13, 22, 40, 118, 71, 116, 68, 12, 97, 12, 109, 46, 4, 102, 76, 59, 71, 61, 107, 101, 61, 13, 27, 109, 22, 55, 116, 49, 6, 86, 70, 4, 10, 4, 11, 95, 34, 31, 67, 84, 103, 73, 111, 69, 27, 67, 32, 78, 49, 94, 53, 120, 11, 109, 32, 85, 93, 5, 25, 19, 42, 71, 49, 101, 18, 83, 98, 68, 113, 58, 18, 106, 71, 29, 80, 66, 5, 54, 73, 120, 41, 18, 74, 98, 116, 91, 26, 13, 2, 101, 35, 48, 96, 58, 89, 50, 17, 18, 61, 31, 26, 84, 42, 80, 92, 94, 108, 106, 70, 89, 98, 2, 44, 111, 74, 69, 67, 39, 89, 55, 1, 47, 1, 43, 94, 50, 11, 45, 99, 28, 43, 42, 36, 29, 81, 11, 95, 71, 7, 20, 85, 49, 100, 101, 63, 13, 1, 100, 108, 9, 53, 47, 31, 83, 32, 98, 18, 27, 81, 97, 98, 51, 16, 59, 38, 71, 115, 79, 16, 48, 108, 102, 98, 49, 87, 44, 31, 11, 75, 36, 108, 112, 12, 84, 50, 52, 95, 86, 71, 64, 18, 5, 29, 85, 91, 113, 108, 43, 46, 88, 38, 34, 41, 83, 106, 63, 38, 36, 113, 41, 108, 16, 65, 11, 115, 3, 26, 53, 103, 115, 63, 113, 86, 25, 67, 6, 52, 18, 34, 93, 38, 79, 75, 31, 82, 80, 104, 37, 66, 53, 102, 86, 8, 24, 43, 23, 65, 65, 46, 101, 28, 87, 86, 89, 114, 78, 62, 114, 53, 20, 32, 92, 54, 7, 108, 10, 48, 76, 78, 70, 71, 37, 106, 52, 18, 106, 117, 19, 61, 3, 106, 90, 110, 4, 87, 48, 106, 103, 88, 32, 111, 80, 51, 115, 7, 103, 38, 107, 4, 59, 102, 61, 102, 120, 7, 38, 92, 99, 99, 87, 91, 97, 89, 52, 2, 104, 89, 15, 27, 43, 23, 74, 94, 30, 91, 63, 56, 96, 54, 106, 63, 51, 13, 8, 80, 96, 16, 63, 105, 76, 58, 2, 29, 61, 82, 40, 100, 88, 119, 13, 90, 108, 119, 51, 80, 92, 2, 85, 103, 28, 79, 54, 64, 97, 102, 94, 32, 96, 116, 74, 93, 47, 117, 31, 32, 52, 106, 74, 97, 76, 108, 30, 50, 60, 22, 106, 66, 7, 53, 93, 43, 41, 82, 84, 108, 36, 99, 51, 106, 31, 50, 64, 94, 90, 42, 45, 28, 102, 14, 118, 3, 109, 2, 51, 47, 98, 107, 5, 98, 101, 35, 116, 112, 54, 114, 53, 97, 54, 83, 114, 9, 84, 104, 83, 49, 93, 118, 83, 18, 117, 77, 60, 76, 30, 108, 30, 77, 84, 113, 86, 43, 92, 69, 35, 24, 48, 24, 7, 54, 120, 2, 44, 113, 29, 109, 116, 108, 30, 77, 89, 9, 46, 21, 113, 113, 61, 50, 80, 24, 11, 3, 15, 24, 38, 29, 101, 114, 15, 114, 52, 95, 80, 10, 85, 86, 5, 40, 83, 89, 27, 53, 50, 109, 96, 80, 52, 53, 73, 43, 52, 78, 115, 90, 24, 117, 32, 22, 34, 17, 51, 56, 43, 16, 113, 44, 103, 68, 19, 50, 111, 112, 105, 69, 4, 93, 18, 59, 79, 48, 83, 17, 24, 12, 86, 107, 27, 77, 23, 59, 9, 58, 94, 77, 33, 88, 97, 6, 9, 78, 55, 58, 9, 36, 69, 35, 58, 27, 38, 17, 13, 53, 97, 80, 36, 27, 48, 80, 37, 2, 78, 81, 33, 36, 94, 48, 114, 59, 21, 52, 76, 29, 16, 21, 32, 56, 71, 50, 24, 3, 17, 111, 24, 71, 101, 49, 97, 32, 117, 64, 92, 63, 93, 110, 74, 104, 81, 60, 42, 120, 32, 107, 59, 26, 1, 95, 110, 32, 112, 60, 88, 51, 45, 6, 9, 41, 63, 92, 114, 94, 62, 98, 57, 11, 28, 68, 76, 61, 55, 8, 96, 65, 19, 23, 97, 25, 114, 76, 2, 85, 85, 115, 19, 10, 76, 102, 74, 59, 57, 100, 2, 104, 31, 10, 88, 50, 89, 113, 78, 95, 60, 49, 60, 85, 24, 22, 6, 8, 5, 44, 3, 22, 50, 93, 28, 66, 58, 95, 25, 21, 72, 120, 102, 117, 63, 40, 53, 4, 71, 90, 59, 71, 32, 90, 32, 106, 117, 29, 98, 5, 29, 60, 103, 57, 79, 48, 84, 62, 78, 87, 51, 104, 16, 39, 79, 65, 104, 84, 25, 100, 39, 27, 39, 108, 26, 20, 120, 87, 57, 95, 67, 100, 40, 47, 59, 81, 14, 27, 110, 71, 89, 53, 111, 46, 61, 27, 25, 18, 113, 105, 43, 118, 79, 60, 92, 98, 101, 2, 69, 16, 56, 34, 23, 46, 8, 93, 95, 70, 60, 24, 16, 86, 46, 26, 60, 108, 48, 74, 116, 90, 105, 3, 6, 56, 50, 116, 61, 79, 109, 70, 19, 42, 61, 31, 83, 114, 48, 72, 71, 40, 101, 48, 46, 81, 7, 105, 104, 60, 79, 70, 77, 11, 54, 108, 5, 65, 94, 24, 5, 53, 89, 48, 88, 40, 56, 66, 92, 17, 17, 4, 47, 40, 59, 33, 113, 80, 55, 73, 71, 45, 19, 48, 26, 48, 8, 2, 62, 14, 60, 54, 111, 93, 30, 102, 8, 51, 96, 75, 98, 101, 23, 49, 97, 61, 88, 71, 111, 62, 112, 64, 69, 75, 55, 83, 16, 13, 111, 105, 108, 14, 59, 30, 119, 106, 93, 116, 31, 88, 14, 3, 74, 46, 30, 33, 87, 61, 91, 75, 95, 59, 91, 49, 27, 104, 67, 106, 36, 109, 78, 8, 42, 2, 56, 26, 112, 78, 5, 41, 104, 4, 81, 96, 3, 106, 47, 65, 26, 82, 46, 18, 112, 72, 98, 90, 109, 50, 65, 104, 80, 33, 19, 47, 116, 115, 43, 31, 34, 8, 92, 92, 108, 117, 7, 55, 30, 64, 91, 100, 50, 23, 106, 25, 109, 30, 116, 53, 55, 13, 36, 117, 84, 32, 18, 111, 75, 24, 66, 3, 15, 117, 37, 88, 7, 58, 7, 34, 92, 109, 11, 30, 91, 79, 45, 78, 51, 111, 65, 96, 36, 33, 47, 10, 109, 98, 29, 52, 37, 87, 43, 85, 101, 41, 31, 82, 91, 61, 45, 99, 81, 41, 24, 97, 22, 10, 107, 102, 4, 86, 54, 118, 10, 87, 11, 114, 14, 20, 97, 22, 44, 80, 23, 90, 113, 109, 84, 28, 48, 54, 113, 9, 57, 15, 46, 9, 110, 45, 102, 77, 20, 83, 35, 65, 88, 104, 92, 6, 44, 34, 43, 70, 44, 81, 80, 61, 102, 104, 48, 10, 76, 104, 59, 20, 117, 96, 79, 84, 59, 80, 115, 49, 6, 98, 40, 63, 29, 109, 116, 55, 39, 43, 22, 97, 40, 67, 71, 89, 120, 118, 114, 95, 107, 17, 18, 116, 26, 82, 60, 28, 33, 71, 3, 109, 25, 53, 93, 82, 111, 12, 87, 54, 94, 75, 72, 87, 36, 32, 119, 94, 101, 45, 64, 67, 113, 76, 114, 46, 116, 10, 56, 31, 44, 94, 105, 45, 35, 114, 90, 19, 31, 71, 18, 30, 51, 68, 111, 42, 97, 5, 66, 39, 81, 120, 5, 33, 11, 19, 88, 76, 83, 20, 88, 32, 111, 81, 30, 1, 6, 65, 39, 44, 14, 54, 5, 5, 115, 49, 11, 34, 38, 43, 82, 9, 93, 50, 95, 69, 120, 102, 59, 72, 52, 102, 83, 47, 78, 66, 99, 91, 34, 26, 60, 22, 33, 27, 54, 51, 111, 47, 68, 64, 25, 63, 20, 115, 26, 36, 50, 73, 37, 68, 11, 69, 90, 5, 1, 4, 48, 27, 3, 67, 78, 76, 55, 52, 27, 25, 73, 83, 23, 90, 84, 74, 61, 17, 89, 73, 62, 81, 63, 56, 19, 34, 45, 50, 4, 21, 57, 35, 54, 72, 15, 42, 76, 19, 46, 2, 112, 106, 108, 10, 56, 48, 46, 55, 75, 8, 33, 29, 24, 62, 115, 72, 51, 80, 102, 57, 59, 108, 29, 103, 66, 27, 5, 43, 113, 19, 53, 41, 76, 105, 100, 63, 103, 24, 14, 41, 33, 92, 47, 91, 19, 26, 68, 63, 79, 109, 89, 41, 82, 5, 103, 40, 93, 114, 9, 49, 50, 59, 53, 111, 103, 32, 46, 57, 85, 37, 98, 78, 29, 52, 56, 10, 68, 99, 69, 100, 112, 75, 9, 5, 120, 84, 113, 70, 71, 82, 34, 19, 80, 4, 20, 83, 120, 14, 63, 1, 120, 17, 118, 60, 43, 117, 87, 22, 11, 89, 37, 111, 30, 93, 17, 61, 116, 107, 91, 99, 62, 20, 38, 98, 75, 83, 48, 10, 108, 120, 87, 91, 43, 67, 91, 99, 59, 22, 73, 3, 81, 79, 103, 22, 40, 26, 75, 58, 81, 89, 43, 98, 69, 23, 59, 23, 1, 56, 75, 96, 97, 75, 22, 109, 23, 95, 56, 100, 106, 31, 109, 58, 114, 24, 80, 110, 50, 3, 33, 52, 88, 49, 23, 37, 35, 28, 5, 30, 83, 50, 31, 92, 18, 18, 57, 98, 20, 15, 6, 83, 66, 55, 36, 89, 56, 75, 53, 49, 62, 9, 59, 24, 3, 66, 50, 5, 40, 75, 69, 45, 43, 35, 120, 67, 103, 64, 38, 118, 30, 105, 48, 98, 47, 28, 87, 11, 57, 92, 68, 110, 57, 109, 105, 112, 41, 63, 62, 95, 31, 90, 47, 28, 66, 88, 68, 38, 108, 7, 18, 94, 112, 60, 119, 94, 51, 23, 114, 106, 81, 100, 55, 110, 58, 93, 51, 55, 68, 52, 114, 93, 53, 28, 13, 116, 12, 1, 65, 112, 39, 52, 53, 115, 72, 42, 95, 26, 45, 27, 56, 51, 104, 47, 3, 91, 56, 1, 2, 41, 33, 52, 13, 86, 83, 47, 55, 4, 1, 83, 86, 21, 44, 56, 29, 114, 52, 19, 61, 92, 104, 14, 99, 70, 70, 80, 70, 2, 67, 1, 103, 72, 14, 117, 39, 43, 99, 84, 79, 22, 79, 15, 72, 29, 62, 30, 101, 35, 95, 2, 25, 33, 102, 47, 13, 115, 103, 86, 98, 24, 92, 76, 6, 32, 115, 22, 98, 105, 8, 45, 102, 32, 12, 72, 106, 7, 114, 120, 112, 60, 101, 51, 47, 34, 81, 7, 119, 39, 20, 79, 29, 117, 23, 82, 23, 32, 46, 118, 10, 2, 44, 37, 17, 64, 76, 7, 31, 77, 102, 83, 19, 45, 49, 76, 25, 79, 4, 108, 36, 14, 43, 115, 55, 112, 53, 102, 40, 63, 105, 7, 20, 95, 113, 56, 48, 9, 88, 85, 91, 9, 68, 2, 99, 104, 63, 10, 68, 64, 44, 120, 30, 36, 76, 86, 87, 111, 2, 6, 23, 38, 3, 51, 107, 21, 119, 73, 11, 49, 22, 93, 42, 27, 30, 70, 89, 84, 79, 86, 1, 17, 46, 15, 70, 79, 27, 11, 41, 52, 8, 89, 89, 28, 98, 11, 44, 30, 103, 102, 120, 116, 6, 42, 64, 38, 62, 10, 65, 118, 89, 11, 68, 51, 15, 7, 112, 79, 93, 36, 22, 61, 102, 85, 100, 48, 12, 43, 33, 39, 90, 86, 35, 20, 83, 116, 76, 120, 10, 53, 20, 77, 61, 85, 74, 90, 104, 79, 81, 53, 74, 16, 80, 75, 111, 58, 25, 66, 98, 58, 116, 42, 44, 63, 89, 51, 21, 29, 62, 56, 115, 47, 71, 68, 77, 9, 57, 11, 33, 30, 68, 89, 120, 4, 22, 20, 102, 92, 64, 54, 87, 96, 30, 87, 93, 32, 24, 98, 112, 103, 70, 75, 12, 46, 52, 97, 40, 51, 59, 110, 95, 40, 92, 12, 113, 89, 89, 34, 70, 49, 21, 68, 34, 38, 52, 33, 26, 58, 32, 59, 28, 4, 64, 77, 23, 2, 49, 25, 89, 39, 45, 86, 1, 98, 103, 52, 3, 83, 44, 50, 61, 9, 69, 110, 113, 64, 30, 40, 120, 3, 71, 54, 61, 49, 48, 68, 31, 82, 52, 119, 9, 110, 28, 53, 113, 19, 3, 33, 18, 46, 23, 77, 11, 59, 91, 83, 115, 71, 18, 84, 43, 41, 24, 66, 106, 28, 100, 36, 104, 66, 43, 62, 83, 65, 120, 76, 91, 70, 44, 35, 38, 37, 38, 80, 76, 30, 49, 8, 24, 87, 85, 26, 65, 106, 104, 47, 51, 85, 47, 20, 113, 79, 25, 54, 100, 58, 75, 20, 98, 52, 14, 11, 9, 115, 71, 103, 41, 101, 1, 92, 79, 34, 54, 95, 22, 110, 65, 77, 65, 17, 1, 2, 92, 42, 60, 54, 42, 31, 18, 26, 75, 85, 104, 100, 101, 71, 77, 67, 27, 74, 105, 46, 102, 50, 78, 57, 96, 105, 3, 46, 47, 83, 2, 50, 120, 19, 36, 77, 48, 105, 87, 14, 93, 2, 86, 118, 54, 74, 109, 64, 113, 72, 11, 55, 44, 30, 5, 15, 28, 67, 94, 55, 34, 33, 72, 56, 38, 96, 38, 82, 91, 78, 24, 64, 71, 9, 73, 6, 40, 85, 53, 29, 11, 46, 13, 85, 68, 7, 119, 72, 62, 78, 46, 46, 3, 4, 120, 116, 107, 112, 119, 75, 22, 113, 70, 94, 35, 111, 13, 19, 103, 113, 119, 56, 116, 66, 108, 28, 114, 14, 62, 16, 71, 42, 23, 118, 43, 8, 61, 36, 55, 6, 47, 82, 107, 44, 33, 5, 101, 110, 12, 112, 100, 88, 51, 118, 115, 99, 56, 60, 113, 43, 51, 61, 97, 62, 97, 59, 3, 30, 39, 30, 1, 95, 111, 77, 16, 111, 118, 93, 84, 72, 50, 92, 120, 3, 96, 81, 66, 24, 14, 112, 1, 24, 15, 51, 92, 96, 23, 75, 83, 47, 42, 101, 7, 84, 63, 16, 117, 21, 69, 20, 61, 50, 94, 118, 69, 61, 113, 110, 40, 111, 68, 60, 14, 120, 64, 83, 25, 94, 80, 98, 114, 54, 102, 103, 53, 53, 14, 47, 76, 96, 75, 26, 64, 19, 90, 99, 43, 8, 86, 5, 37, 83, 6, 3, 108, 108, 100, 91, 24, 47, 34, 86, 98, 54, 47, 32, 93, 62, 51, 35, 118, 29, 118, 69, 80, 4, 52, 47, 88, 79, 81, 62, 115, 87, 54, 116, 18, 114, 63, 79, 110, 59, 32, 14, 71, 31, 47, 115, 54, 110, 35, 5, 87, 75, 48, 16, 58, 69, 7, 28, 61, 100, 77, 120, 97, 58, 118, 41, 120, 23, 32, 89, 89, 39, 57, 108, 10, 24, 100, 28, 35, 64, 52, 29, 9, 78, 53, 62, 3, 69, 86, 5, 3, 4, 69, 5, 100, 6, 18, 20, 44, 40, 24, 35, 99, 95, 102, 15, 16, 33, 114, 25, 15, 97, 14, 78, 18, 23, 16, 112, 2, 34, 107, 37, 51, 30, 36, 46, 113, 91, 60, 30, 72, 25, 17, 89, 44, 79, 64, 13, 77, 113, 77, 119, 103, 9, 103, 71, 55, 75, 71, 60, 61, 43, 58, 15, 74, 83, 71, 7, 105, 43, 117, 93, 36, 11, 66, 111, 100, 87, 64, 89, 97, 109, 54, 78, 11, 10, 68, 54, 81, 29, 110, 119, 93, 53, 87, 60, 117, 35, 31, 101, 39, 34, 15, 39, 3, 96, 99, 117, 1, 120, 72, 115, 29, 112, 59, 57, 72, 91, 66, 110, 94, 81, 98, 22, 21, 50, 93, 104, 22, 82, 94, 56, 3, 42, 23, 91, 28, 86, 5, 75, 14, 115, 56, 35, 48, 25, 35, 41, 6, 39, 43, 26, 28, 119, 14, 69, 115, 82, 50, 84, 83, 18, 34, 19, 102, 90, 5, 96, 102, 110, 107, 78, 29, 73, 8, 50, 77, 99, 79, 46, 45, 23, 32, 51, 12, 109, 46, 90, 99, 18, 13, 120, 50, 54, 96, 31, 104, 68, 72, 65, 105, 33, 102, 88, 25, 108, 107, 79, 118, 15, 79, 115, 86, 88, 38, 112, 26, 110, 114, 40, 5, 37, 16, 22, 118, 41, 99, 12, 103, 85, 67, 40, 67, 26, 49, 30, 104, 26, 95, 76, 29, 110, 105, 40, 50, 50, 107, 119, 95, 14, 101, 2, 50, 31, 104, 23, 46, 92, 66, 77, 81, 71, 77, 117, 80, 116, 32, 66, 42, 66, 101, 76, 89, 46, 47, 100, 25, 100, 67, 94, 34, 8, 19, 9, 41, 93, 61, 105, 42, 81, 5, 1, 26, 4, 101, 23, 109, 76, 105, 106, 2, 38, 86, 55, 78, 41, 17, 12, 116, 68, 94, 91, 71, 56, 9, 7, 46, 109, 105, 63, 38, 14, 43, 96, 28, 34, 14, 81, 45, 120, 66, 32, 19, 22, 110, 36, 98, 65, 89, 15, 112, 72, 18, 7, 35, 84, 71, 11, 82, 98, 70, 42, 41, 91, 95, 112, 54, 117, 56, 79, 70, 49, 84, 97, 90, 13, 48, 58, 107, 87, 111, 1, 48, 115, 9, 22, 110, 49, 108, 34, 55, 10, 101, 22, 34, 108, 63, 63, 9, 118, 68, 108, 82, 98, 103, 30, 44, 66, 91, 28, 119, 79, 118, 119, 79, 59, 116, 50, 63, 26, 68, 105, 4, 64, 52, 24, 119, 12, 79, 78, 54, 103, 84, 18, 1, 50, 76, 19, 78, 46, 29, 50, 47, 118, 64, 44, 18, 78, 119, 94, 103, 80, 8, 98, 7, 80, 89, 111, 49, 46, 69, 118, 27, 8, 85, 15, 117, 20, 65, 108, 29, 117, 81, 51, 71, 4, 66, 24, 89, 45, 2, 22, 116, 91, 105, 100, 108, 116, 16, 27, 88, 80, 82, 110, 109, 97, 95, 81, 74, 13, 85, 48, 37, 76, 18, 110, 50, 116, 89, 38, 45, 42, 95, 109, 40, 101, 60, 21, 110, 11, 114, 75, 66, 50, 76, 77, 100, 6, 26, 120, 96, 3, 115, 103, 92, 27, 62, 51, 104, 119, 71, 57, 26, 74, 82, 14, 63, 80, 116, 17, 25, 86, 65, 60, 63, 101, 24, 68, 34, 73, 42, 58, 99, 7, 44, 70, 107, 113, 43, 73, 10, 47, 44, 24, 27, 30, 67, 33, 102, 37, 72, 72, 96, 8, 4, 111, 99, 30, 71, 67, 25, 81, 75, 25, 115, 62, 120, 115, 34, 101, 114, 67, 97, 105, 51, 2, 49, 108, 5, 1, 27, 89, 62, 119, 112, 47, 80, 87, 5, 2, 74, 112, 82, 53, 92, 14, 58, 71, 23, 9, 78, 23, 88, 61, 115, 1, 75, 31, 52, 82, 29, 86, 75, 16, 57, 117, 72, 10, 85, 12, 27, 50, 14, 118, 58, 35, 109, 108, 17, 28, 18, 19, 53, 51, 38, 7, 39, 56, 30, 90, 37, 109, 18, 46, 33, 17, 33, 120, 54, 18, 78, 92, 64, 94, 63, 43, 62, 55, 35, 117, 119, 22, 71, 18, 70, 77, 37, 59, 69, 13, 41, 51, 16, 85, 48, 110, 30, 110, 109, 46, 25, 113, 113, 79, 120, 29, 38, 37, 2, 65, 117, 112, 4, 72, 117, 40, 20, 81, 51, 92, 36, 108, 47, 60, 107, 58, 24, 50, 93, 11, 81, 26, 104, 115, 56, 15, 43, 99, 59, 25, 46, 36, 31, 117, 34, 21, 49, 100, 75, 14, 23, 54, 27, 93, 64, 37, 112, 66, 29, 19, 92, 68, 36, 88, 4, 17, 78, 74, 13, 113, 15, 38, 40, 70, 104, 55, 50, 36, 117, 90, 47, 80, 66, 71, 46, 50, 27, 9, 39, 11, 102, 84, 51, 111, 100, 111, 77, 20, 116, 119, 18, 92, 51, 18, 118, 20, 79, 22, 29, 91, 52, 13, 78, 99, 43, 116, 56, 105, 20, 73, 15, 52, 111, 13, 43, 72, 53, 75, 25, 62, 1, 96, 75, 64, 46, 22, 35, 107, 62, 30, 85, 82, 2, 27, 41, 14, 15, 34, 24, 103, 97, 37, 106, 116, 90, 45, 82, 103, 95, 14, 106, 32, 64, 79, 101, 32, 107, 40, 30, 19, 28, 88, 44, 50, 120, 11, 31, 52, 117, 13, 65, 108, 108, 43, 107, 89, 116, 75, 99, 55, 69, 16, 24, 92, 57, 60, 3, 55, 89, 51, 18, 28, 25, 78, 1, 37, 20, 7, 61, 24, 16, 23, 27, 39, 96, 82, 107, 13, 90, 94, 35, 118, 35, 1, 81, 16, 48, 111, 94, 33, 100, 93, 24, 80, 54, 17, 76, 68, 81, 4, 42, 50, 39, 89, 85, 113, 59, 76, 19, 16, 109, 101, 9, 61, 61, 37, 101, 28, 58, 106, 9, 18, 102, 114, 66, 5, 5, 28, 106, 76, 21, 111, 46, 15, 82, 116, 38, 58, 92, 53, 2, 23, 46, 41, 53, 59, 103, 24, 9, 21, 90, 116, 90, 102, 44, 32, 120, 51, 91, 93, 24, 114, 114, 109, 35, 95, 83, 84, 55, 97, 95, 108, 52, 94, 69, 97, 39, 16, 98, 53, 34, 74, 45, 115, 12, 3, 119, 74, 73, 40, 97, 52, 84, 47, 38, 6, 70, 14, 22, 41, 4, 4, 105, 54, 116, 7, 32, 71, 76, 75, 44, 104, 97, 33, 2, 104, 66, 79, 99, 4, 55, 19, 48, 16, 116, 83, 18, 33, 67, 21, 83, 88, 77, 8, 71, 82, 71, 37, 88, 79, 73, 104, 67, 41, 48, 17, 65, 45, 117, 109, 90, 44, 95, 71, 53, 95, 47, 84, 52, 110, 59, 59, 106, 120, 31, 87, 4, 105, 120, 6, 56, 114, 58, 39, 80, 69, 4, 2, 80, 101, 80, 48, 95, 100, 14, 64, 4, 83, 103, 8, 11, 112, 99, 6, 5, 20, 63, 60, 6, 54, 30, 17, 111, 29, 103, 73, 48, 63, 117, 45, 27, 93, 16, 67, 105, 29, 73, 67, 29, 3, 114, 34, 117, 53, 77, 59, 23, 58, 27, 83, 74, 54, 15, 76, 9, 80, 22, 63, 65, 24, 108, 33, 7, 35, 60, 70, 63, 16, 59, 45, 40, 89, 55, 60, 56, 37, 107, 63, 6, 63, 23, 14, 58, 96, 92, 103, 79, 118, 87, 9, 53, 5, 62, 85, 3, 37, 56, 79, 77, 63, 118, 30, 95, 9, 85, 25, 90, 109, 109, 117, 4, 31, 59, 79, 8, 67, 54, 86, 104, 42, 17, 111, 62, 30, 56, 22, 100, 119, 115, 105, 51, 59, 48, 117, 69, 22, 11, 44, 49, 40, 58, 81, 106, 31, 31, 1, 47, 66, 92, 22, 76, 94, 68, 101, 80, 107, 42, 46, 49, 26, 67, 13, 69, 26, 86, 84, 40, 48, 40, 79, 91, 48, 19, 40, 116, 46, 114, 24, 74, 70, 50, 74, 88, 79, 96, 111, 66, 89, 84, 111, 109, 69, 21, 53, 21, 68, 107, 115, 55, 19, 83, 85, 64, 54, 46, 35, 95, 17, 70, 80, 114, 97, 78, 61, 61, 37, 65, 87, 1, 17, 41, 9, 91, 19, 78, 88, 43, 72, 95, 54, 99, 80, 39, 46, 6, 49, 25, 43, 11, 120, 114, 105, 101, 25, 78, 107, 67, 65, 16, 118, 47, 39, 88, 25, 113, 120, 2, 61, 2, 111, 52, 56, 56, 117, 120, 29, 21, 31, 12, 60, 15, 99, 14, 70, 96, 45, 78, 78, 18, 32, 14, 44, 30, 48, 117, 41, 104, 78, 104, 81, 10, 21, 63, 108, 13, 99, 96, 11, 20, 13, 106, 98, 21, 70, 112, 91, 77, 68, 12, 90, 51, 105, 24, 118, 103, 67, 2, 93, 110, 68, 71, 51, 30, 56, 1, 22, 118, 65, 54, 70, 101, 53, 89, 84, 77, 117, 16, 92, 80, 14, 52, 16, 51, 52, 80, 100, 34, 2, 68, 9, 79, 78, 84, 116, 41, 106, 115, 50, 4, 16, 28, 27, 100, 102, 97, 29, 100, 114, 86, 108, 85, 47, 13, 43, 67, 22, 101, 37, 114, 21, 30, 54, 116, 16, 10, 3, 22, 5, 91, 92, 116, 29, 70, 54, 114, 24, 15, 8, 105, 34, 112, 71, 51, 95, 106, 69, 56, 9, 41, 47, 86, 98, 51, 68, 17, 105, 11, 68, 93, 86, 118, 97, 87, 7, 48, 113, 79, 27, 94, 73, 3, 83, 67, 44, 65, 92, 48, 7, 3, 95, 81, 66, 3, 54, 8, 11, 81, 42, 6, 47, 102, 14, 92, 40, 37, 3, 67, 30, 90, 110, 48, 90, 18, 38, 19, 54, 117, 35, 48, 100, 13, 89, 49, 38, 20, 106, 35, 21, 39, 33, 6, 112, 55, 36, 108, 112, 28, 103, 29, 68, 87, 72, 33, 6, 101, 30, 89, 47, 86, 111, 71, 12, 55, 10, 92, 40, 119, 96, 48, 92, 114, 68, 17, 18, 21, 28, 26, 9, 53, 67, 4, 88, 69, 4, 97, 81, 6, 12, 107, 15, 99, 70, 81, 77, 20, 117, 18, 103, 19, 9, 27, 59, 16, 99, 18, 48, 35, 119, 116, 36, 7, 86, 117, 3, 48, 8, 116, 19, 51, 102, 119, 103, 24, 43, 31, 77, 62, 83, 39, 75, 41, 27, 92, 42, 55, 49, 107, 1, 54, 68, 31, 58, 65, 48, 53, 118, 66, 89, 28, 28, 29, 68, 3, 86, 120, 1, 73, 21, 112, 56, 26, 106, 13, 57, 17, 46, 29, 66, 22, 110, 40, 24, 74, 69, 62, 35, 25, 69, 95, 37, 40, 46, 57, 17, 111, 114, 120, 27, 28, 109, 5, 13, 19, 87, 82, 118, 95, 40, 45, 77, 115, 18, 59, 37, 17, 33, 86, 68, 71, 10, 42, 102, 29, 26, 29, 81, 95, 2, 80, 67, 17, 69, 25, 96, 53, 113, 75, 54, 117, 60, 14, 114, 100, 12, 112, 76, 106, 62, 46, 84, 97, 38, 21, 48, 15, 20, 17, 35, 96, 69, 84, 76, 78, 72, 77, 96, 1, 42, 61, 105, 1, 3, 16, 48, 82, 41, 26, 53, 110, 85, 7, 42, 67, 72, 66, 80, 43, 98, 111, 2, 1, 106, 61, 49, 25, 62, 86, 68, 92, 70, 72, 6, 60, 87, 26, 37, 66, 82, 45, 62, 95, 94, 68, 12, 107, 120, 86, 101, 87, 91, 11, 41, 14, 51, 111, 29, 77, 101, 120, 68, 7, 55, 74, 81, 48, 10, 11, 20, 28, 85, 80, 52, 40, 33, 60, 26, 24, 60, 53, 4, 119, 97, 3, 100, 53, 38, 114, 3, 35, 59, 100, 92, 42, 57, 97, 71, 56, 48, 6, 71, 68, 27, 69, 83, 103, 107, 101, 65, 30, 23, 35, 20, 77, 18, 11, 75, 71, 4, 112, 5, 92, 93, 111, 23, 88, 100, 44, 101, 90, 93, 107, 86, 31, 84, 82, 43, 44, 71, 81, 68, 14, 9, 93, 31, 21, 37, 56, 49, 72, 2, 101, 19, 92, 113, 118, 92, 19, 75, 45, 115, 101, 52, 52, 117, 89, 50, 102, 82, 102, 94, 17, 39, 74, 40, 102, 79, 102, 114, 4, 7, 49, 50, 54, 55, 80, 81, 49, 37, 71, 118, 76, 71, 73, 113, 11, 100, 55, 33, 66, 35, 102, 25, 61, 102, 119, 9, 107, 73, 86, 99, 98, 91, 44, 38, 104, 103, 58, 116, 101, 20, 39, 96, 62, 46, 79, 66, 31, 27, 80, 93, 118, 70, 72, 35, 90, 41, 23, 49, 27, 5, 65, 2, 58, 93, 54, 50, 86, 20, 48, 90, 103, 51, 94, 43, 52, 40, 55, 75, 11, 97, 26, 95, 1, 108, 14, 60, 77, 45, 55, 4, 1, 27, 78, 80, 65, 28, 58, 110, 12, 16, 2, 20, 90, 103, 48, 28, 75, 51, 62, 36, 65, 72, 69, 25, 102, 16, 46, 62, 18, 50, 109, 67, 74, 24, 28, 113, 114, 85, 19, 53, 80, 17, 32, 82, 66, 65, 99, 115, 28, 69, 49, 61, 8, 19, 71, 99, 56, 114, 33, 93, 88, 103, 95, 60, 11, 75, 59, 101, 33, 111, 109, 35, 66, 39, 91, 70, 66, 39, 44, 15, 28, 120, 79, 53, 54, 24, 34, 72, 112, 20, 2, 86, 107, 27, 119, 67, 35, 80, 29, 38, 120, 42, 112, 67, 17, 11, 47, 107, 51, 51, 40, 57, 98, 7, 115, 65, 110, 118, 100, 67, 95, 116, 52, 108, 107, 81, 85, 56, 29, 29, 22, 117, 3, 64, 103, 85, 35, 110, 99, 99, 20, 64, 35, 112, 81, 76, 64, 44, 75, 90, 119, 16, 114, 39, 50, 8, 86, 112, 21, 3, 4, 50, 26, 90, 37, 18, 45, 59, 110, 120, 42, 117, 99, 16, 84, 21, 119, 44, 107, 118, 16, 46, 15, 107, 19, 39, 74, 111, 73, 5, 92, 68, 53, 54, 29, 62, 8, 96, 103, 44, 11, 18, 47, 115, 110, 44, 89, 9, 78, 55, 92, 1, 103, 71, 1, 53, 34, 108, 113, 99, 117, 15, 98, 33, 31, 5, 8, 47, 103, 4, 37, 14, 94, 79, 42, 22, 98, 54, 64, 82, 89, 115, 4, 120, 61, 50, 94, 6, 91, 27, 53, 110, 80, 45, 19, 90, 78, 7, 108, 48, 27, 65, 32, 10, 101, 78, 79, 89, 13, 102, 37, 5, 3, 84, 48, 86, 109, 93, 84, 111, 30, 16, 76, 53, 21, 60, 102, 76, 16, 84, 45, 64, 90, 35, 97, 118, 15, 58, 58, 62, 12, 101, 103, 84, 18, 83, 119, 72, 27, 48, 4, 111, 111, 66, 13, 55, 7, 99, 92, 77, 85, 90, 101, 9, 67, 9, 92, 105, 16, 93, 74, 39, 99, 41, 26, 108, 24, 57, 96, 3, 110, 103, 53, 68, 115, 73, 40, 76, 41, 41, 31, 65, 36, 74, 42, 28, 76, 55, 65, 92, 18, 37, 93, 95, 20, 7, 53, 79, 57, 18, 9, 65, 74, 20, 21, 91, 107, 54, 84, 54, 100, 102, 73, 106, 44, 41, 119, 15, 11, 41, 8, 62, 82, 57, 83, 73, 74, 2, 58, 94, 109, 69, 38, 74, 47, 65, 91, 66, 59, 14, 7, 41, 69, 100, 2, 51, 102, 18, 35, 21, 49, 81, 106, 50, 29, 41, 72, 16, 32, 15, 11, 46, 52, 74, 100, 38, 44, 118, 69, 74, 90, 9, 6, 54, 114, 107, 21, 2, 58, 46, 22, 74, 44, 65, 2, 10, 70, 90, 72, 17, 72, 83, 110, 82, 8, 55, 89, 16, 48, 90, 92, 12, 102, 89, 40, 88, 95, 73, 13, 21, 118, 87, 57, 117, 63, 9, 8, 7, 76, 109, 50, 69, 33, 63, 116, 105, 22, 67, 35, 44, 87, 97, 97, 93, 89, 6, 112, 49, 29, 30, 34, 39, 96, 86, 72, 94, 53, 116, 59, 102, 40, 7, 114, 62, 78, 23, 36, 3, 12, 13, 1, 78, 54, 55, 29, 35, 10, 79, 22, 101, 62, 77, 113, 33, 78, 100, 109, 118, 53, 28, 100, 50, 78, 6, 105, 28, 16, 95, 120, 97, 15, 78, 4, 28, 56, 61, 54, 106, 14, 29, 79, 33, 76, 14, 27, 107, 47, 31, 39, 22, 96, 26, 95, 60, 5, 47, 62, 115, 22, 57, 69, 56, 69, 61, 113, 88, 10, 94, 6, 97, 47, 79, 78, 108, 81, 90, 57, 70, 23, 9, 116, 102, 64, 10, 62, 81, 104, 17, 51, 8, 15, 117, 99, 42, 105, 113, 27, 54, 8, 71, 2, 98, 114, 1, 23, 6, 103, 102, 104, 117, 120, 74, 21, 79, 114, 100, 22, 33, 34, 117, 120, 117, 71, 25, 15, 51, 81, 67, 26, 44, 7, 47, 43, 89, 4, 70, 112, 92, 7, 97, 71, 11, 41, 85, 93, 25, 90, 116, 32, 33, 10, 78, 23, 111, 42, 85, 24, 33, 9, 62, 32, 17, 47, 81, 40, 73, 55, 53, 120, 11, 118, 81, 30, 100, 40, 104, 87, 57, 8, 59, 112, 18, 76, 79, 38, 41, 55, 13, 43, 77, 55, 48, 57, 67, 81, 113, 81, 58, 69, 12, 63, 105, 77, 105, 87, 118, 110, 29, 29, 1, 57, 81, 49, 51, 44, 54, 4, 87, 82, 66, 41, 17, 43, 6, 50, 90, 72, 6, 44, 98, 71, 52, 22, 101, 66, 3, 96, 119, 73, 116, 105, 11, 29, 84, 110, 43, 71, 61, 84, 21, 36, 6, 4, 24, 101, 94, 94, 6, 73, 93, 31, 73, 37, 23, 6, 33, 5, 4, 115, 110, 38, 59, 23, 97, 82, 16, 31, 51, 78, 20, 107, 108, 95, 57, 59, 13, 3, 39, 7, 4, 75, 53, 120, 71, 75, 101, 1, 43, 100, 39, 23, 109, 23, 17, 105, 119, 6, 14, 66, 10, 60, 39, 77, 64, 108, 61, 96, 118, 98, 110, 99, 115, 3, 106, 37, 65, 51, 111, 82, 67, 117, 58, 86, 104, 87, 115, 69, 78, 9, 95, 8, 111, 114, 96, 54, 6, 100, 21, 31, 70, 89, 10, 109, 27, 109, 13, 92, 101, 45, 40, 27, 119, 16, 78, 60, 92, 9, 59, 61, 45, 102, 59, 12, 76, 72, 91, 111, 13, 78, 11, 82, 69, 101, 119, 87, 107, 69, 31, 47, 115, 55, 70, 57, 55, 89, 20, 78, 93, 68, 40, 13, 86, 91, 53, 114, 44, 59, 114, 7, 75, 24, 29, 110, 70, 12, 28, 114, 106, 113, 34, 113, 116, 112, 7, 32, 117, 64, 29, 4, 93, 36, 116, 32, 86, 22, 25, 113, 73, 34, 85, 41, 63, 9, 55, 108, 50, 29, 113, 10, 38, 75, 70, 23, 93, 101, 71, 85, 41, 41, 14, 94, 111, 65, 52, 92, 33, 33, 76, 81, 83, 87, 39, 88, 72, 50, 46, 32, 38, 51, 84, 90, 62, 12, 95, 29, 82, 11, 82, 68, 63, 87, 25, 56, 56, 8, 43, 66, 54, 60, 114, 71, 84, 25, 79, 33, 86, 11, 103, 40, 82, 25, 114, 71, 62, 31, 8, 48, 80, 105, 77, 50, 87, 64, 77, 21, 36, 42, 97, 26, 75, 3, 115, 96, 55, 102, 58, 80, 101, 115, 75, 81, 59, 29, 26, 55, 95, 112, 90, 68, 35, 97, 23, 38, 78, 59, 88, 91, 13, 29, 11, 75, 79, 29, 36, 116, 51, 62, 102, 65, 83, 87, 119, 82, 8, 6, 92, 98, 11, 106, 97, 71, 26, 36, 60, 98, 105, 81, 60, 41, 79, 111, 58, 85, 53, 23, 114, 40, 34, 8, 40, 78, 90, 2, 21, 22, 22, 117, 114, 49, 108, 2, 41, 54, 21, 104, 71, 112, 33, 13, 92, 89, 42, 97, 51, 112, 21, 84, 39, 40, 3, 62, 33, 21, 105, 50, 96, 93, 98, 76, 44, 85, 119, 47, 81, 108, 24, 30, 95, 60, 113, 85, 9, 54, 47, 21, 92, 41, 40, 118, 101, 73, 84, 7, 98, 110, 88, 99, 52, 35, 88, 93, 40, 57, 115, 112, 103, 53, 52, 85, 101, 20, 107, 16, 48, 9, 6, 39, 104, 86, 33, 110, 50, 74, 7, 46, 10, 18, 25, 11, 11, 114, 41, 106, 55, 12, 39, 52, 34, 27, 58, 41, 83, 102, 76, 5, 54, 115, 18, 94, 48, 68, 103, 3, 1, 29, 49, 57, 97, 54, 61, 51, 82, 91, 10, 58, 40, 5, 102, 105, 88, 119, 46, 117, 64, 109, 103, 39, 71, 10, 81, 72, 28, 85, 114, 14, 14, 90, 75, 44, 22, 32, 55, 13, 76, 90, 15, 69, 64, 99, 86, 52, 15, 86, 5, 16, 10, 49, 47, 15, 83, 56, 40, 21, 59, 55, 45, 56, 13, 28, 26, 70, 32, 11, 98, 76, 41, 55, 32, 77, 34, 111, 78, 66, 94, 62, 101, 1, 56, 55, 77, 114, 67, 57, 113, 91, 113, 116, 49, 55, 75, 86, 37, 26, 52, 6, 72, 2, 96, 20, 40, 27, 47, 22, 62, 118, 87, 10, 114, 91, 29, 3, 77, 47, 63, 61, 19, 72, 19, 51, 20, 89, 64, 39, 78, 78, 26, 85, 103, 55, 8, 42, 55, 41, 8, 19, 47, 21, 66, 31, 66, 107, 68, 21, 18, 71, 85, 14, 100, 10, 79, 87, 105, 43, 8, 40, 91, 10, 24, 119, 100, 26, 42, 64, 79, 104, 44, 54, 3, 44, 68, 32, 48, 52, 101, 73, 59, 23, 113, 83, 45, 10, 53, 48, 3, 37, 61, 67, 88, 57, 105, 67, 120, 7, 119, 51, 28, 112, 90, 15, 1, 99, 18, 74, 14, 55, 21, 115, 112, 47, 43, 108, 84, 102, 96, 8, 17, 43, 24, 111, 108, 91, 90, 109, 51, 89, 89, 40, 87, 8, 93, 83, 102, 18, 36, 8, 74, 11, 88, 100, 98, 8, 103, 62, 59, 38, 56, 13, 23, 14, 63, 53, 7, 64, 43, 46, 75, 23, 58, 94, 16, 42, 4, 88, 62, 28, 44, 96, 86, 82, 91, 113, 108, 55, 101, 89, 1, 85, 89, 100, 101, 31, 14, 9, 105, 63, 25, 92, 80, 77, 85, 37, 77, 102, 65, 40, 81, 25, 8, 95, 2, 90, 94, 89, 5, 109, 88, 111, 52, 119, 57, 85, 82, 49, 116, 59, 59, 81, 33, 44, 94, 72, 72, 68, 102, 97, 44, 60, 37, 60, 14, 85, 10, 63, 73, 18, 40, 96, 45, 43, 92, 21, 1, 27, 96, 118, 53, 11, 27, 86, 83, 44, 100, 34, 48, 51, 118, 82, 97, 6, 57, 42, 27, 47, 29, 118, 16, 46, 31, 47, 45, 72, 89, 77, 12, 119, 81, 12, 39, 18, 55, 110, 38, 96, 78, 69, 18, 48, 63, 100, 26, 42, 20, 2, 13, 41, 67, 22, 65, 18, 20, 104, 63, 12, 111, 88, 106, 1, 98, 7, 33, 46, 94, 16, 38, 79, 49, 111, 83, 51, 88, 80, 9, 59, 34, 28, 12, 78, 102, 85, 35, 115, 100, 76, 6, 94, 10, 25, 25, 11, 60, 101, 52, 67, 58, 25, 20, 51, 67, 39, 94, 14, 41, 9, 57, 27, 54, 19, 108, 73, 103, 77, 81, 47, 95, 79, 20, 113, 11, 76, 66, 33, 27, 18, 28, 26, 45, 29, 120, 41, 34, 57, 55, 68, 117, 14, 38, 83, 85, 90, 30, 55, 117, 63, 92, 48, 81, 3, 77, 68, 73, 72, 4, 113, 49, 12, 104, 2, 40, 4, 5, 45, 8, 4, 5, 17, 73, 20, 56, 106, 28, 48, 32, 45, 6, 61, 46, 74, 112, 111, 8, 96, 100, 31, 32, 27, 75, 47, 108, 90, 78, 43, 59, 115, 77, 91, 23, 44, 93, 118, 21, 78, 112, 46, 87, 80, 97, 56, 114, 111, 67, 79, 113, 33, 49, 26, 117, 54, 23, 76, 19, 17, 106, 64, 31, 79, 84, 92, 36, 90, 78, 17, 88, 81, 39, 114, 70, 89, 64, 120, 77, 108, 65, 1, 18, 53, 54, 113, 73, 84, 101, 33, 112, 11, 22, 29, 30, 21, 66, 87, 69, 76, 53, 39, 46, 91, 7, 96, 112, 3, 59, 50, 7, 97, 10, 112, 38, 28, 26, 73, 111, 105, 18, 70, 54, 50, 84, 65, 91, 67, 106, 16, 58, 89, 101, 35, 15, 24, 47, 108, 2, 15, 74, 49, 21, 78, 17, 82, 120, 92, 38, 83, 108, 43, 93, 81, 20, 68, 30, 26, 105, 22, 71, 59, 69, 104, 114, 108, 40, 69, 57, 80, 71, 114, 21, 18, 55, 44, 55, 58, 27, 87, 117, 59, 101, 119, 91, 47, 45, 39, 66, 27, 63, 108, 19, 74, 43, 15, 38, 31, 98, 21, 43, 43, 61, 93, 34, 17, 56, 91, 110, 51, 84, 34, 63, 101, 28, 93, 87, 26, 109, 92, 77, 35, 12, 23, 109, 88, 88, 55, 96, 5, 88, 3, 87, 83, 4, 70, 77, 26, 95, 59, 1, 13, 98, 80, 107, 24, 5, 100, 23, 111, 59, 79, 11, 105, 85, 90, 54, 36, 10, 28, 116, 58, 38, 71, 33, 88, 102, 108, 83, 85, 88, 64, 66, 49, 25, 87, 99, 101, 100, 91, 8, 100, 91, 12, 48, 73, 19, 103, 87, 38, 48, 92, 42, 91, 113, 99, 106, 91, 105, 27, 36, 112, 100, 119, 19, 51, 23, 19, 28, 55, 10, 112, 90, 107, 17, 94, 76, 9, 7, 55, 43, 110, 3, 13, 79, 80, 8, 18, 88, 25, 7, 120, 78, 49, 2, 18, 37, 35, 113, 116, 102, 90, 53, 90, 60, 71, 70, 6, 106, 38, 57, 45, 65, 66, 40, 20, 49, 46, 65, 40, 119, 68, 52, 63, 82, 6, 119, 35, 29, 84, 24, 84, 13, 54, 17, 31, 9, 41, 50, 87, 71, 67, 67, 84, 109, 70, 94, 103, 38, 104, 53, 54, 23, 60, 58, 15, 9, 60, 62, 48, 50, 24, 41, 21, 58, 94, 5, 19, 25, 3, 85, 81, 80, 40, 31, 112, 52, 30, 5, 13, 59, 8, 63, 34, 87, 70, 102, 103, 91, 87, 63, 37, 78, 94, 38, 87, 49, 26, 89, 58, 71, 72, 99, 34, 113, 82, 63, 117, 65, 4, 20, 64, 120, 87, 54, 9, 46, 54, 18, 84, 49, 46, 85, 40, 117, 11, 44, 3, 65, 15, 120, 99, 55, 22, 60, 107, 40, 20, 16, 53, 20, 78, 28, 96, 120, 36, 110, 119, 2, 75, 89, 12, 119, 116, 23, 20, 63, 112, 41, 46, 18, 66, 33, 42, 45, 76, 18, 98, 115, 14, 41, 89, 120, 62, 24, 76, 115, 109, 69, 11, 80, 109, 30, 87, 73, 59, 111, 47, 30, 91, 41, 14, 85, 78, 23, 89, 100, 69, 16, 64, 37, 119, 71, 98, 90, 93, 34, 113, 99, 20, 99, 62, 92, 6, 97, 29, 102, 32, 52, 108, 65, 72, 73, 83, 55, 106, 52, 85, 106, 39, 50, 3, 65, 19, 106, 90, 25, 57, 50, 76, 71, 120, 73, 92, 84, 44, 25, 61, 43, 54, 24, 67, 114, 88, 103, 70, 90, 16, 22, 2, 23, 96, 76, 26, 41, 38, 36, 116, 64, 88, 112, 65, 26, 64, 54, 82, 92, 7, 56, 36, 1, 22, 102, 110, 70, 71, 27, 98, 62, 117, 79, 110, 80, 60, 96, 17, 107, 70, 12, 6, 100, 89, 17, 70, 18, 82, 120, 97, 55, 15, 91, 102, 46, 5, 48, 19, 83, 70, 79, 41, 109, 21, 21, 88, 32, 82, 95, 23, 64, 36, 47, 72, 57, 65, 112, 7, 36, 36, 52, 61, 28, 26, 60, 100, 13, 77, 83, 14, 80, 73, 18, 82, 24, 54, 57, 79, 109, 18, 95, 24, 98, 118, 88, 117, 38, 25, 94, 69, 96, 44, 77, 8, 75, 14, 113, 78, 82, 27, 89, 87, 40, 115, 97, 68, 51, 83, 72, 61, 56, 111, 56, 34, 26, 79, 36, 103, 117, 4, 38, 79, 26, 44, 37, 46, 25, 40, 49, 34, 107, 119, 50, 78, 111, 71, 90, 120, 60, 56, 45, 116, 71, 72, 27, 27, 71, 4, 85, 97, 92, 47, 22, 22, 7, 115, 68, 97, 120, 53, 3, 57, 77, 9, 100, 107, 4, 42, 30, 86, 26, 37, 62, 70, 5, 17, 102, 54, 8, 26, 86, 28, 12, 17, 109, 10, 66, 25, 47, 109, 68, 101, 3, 86, 2, 56, 12, 65, 17, 44, 13, 4, 111, 71, 64, 7, 66, 77, 46, 1, 78, 73, 115, 92, 118, 10, 92, 87, 60, 21, 94, 83, 2, 90, 117, 117, 103, 48, 54, 51, 21, 9, 49, 70, 69, 101, 76, 29, 109, 93, 113, 46, 23, 75, 114, 5, 29, 6, 15, 15, 36, 45, 75, 2, 12, 1, 57, 106, 63, 81, 78, 116, 93, 117, 70, 57, 107, 108, 61, 22, 9, 117, 110, 23, 81, 74, 116, 87, 55, 43, 39, 2, 15, 22, 88, 62, 44, 60, 90, 9, 18, 107, 45, 39, 77, 24, 90, 39, 96, 12, 25, 70, 21, 97, 97, 1, 71, 41, 70, 88, 97, 47, 48, 66, 109, 64, 6, 63, 8, 117, 89, 94, 54, 91, 56, 94, 32, 95, 52, 17, 62, 83, 3, 10, 20, 79, 55, 45, 39, 71, 94, 4, 85, 18, 42, 28, 21, 90, 11, 113, 17, 120, 106, 31, 84, 106, 34, 15, 54, 32, 10, 83, 40, 19, 41, 56, 25, 66, 44, 70, 53, 100, 92, 90, 46, 58, 4, 101, 10, 70, 90, 91, 27, 5, 13, 101, 53, 36, 120, 97, 96, 88, 67, 3, 12, 59, 59, 38, 34, 84, 39, 108, 47, 86, 75, 104, 98, 3, 28, 6, 19, 7, 62, 109, 41, 117, 11, 64, 118, 98, 106, 25, 99, 48, 63, 14, 18, 86, 112, 21, 6, 90, 37, 5, 60, 9, 70, 32, 86, 94, 33, 74, 86, 61, 16, 111, 37, 80, 31, 105, 46, 68, 114, 104, 84, 68, 13, 78, 71, 58, 11, 56, 37, 109, 82, 8, 57, 62, 56, 30, 83, 57, 19, 26, 115, 8, 105, 105, 65, 107, 31, 7, 91, 112, 100, 30, 14, 94, 101, 66, 23, 79, 81, 62, 94, 30, 82, 104, 62, 88, 44, 12, 13, 65, 57, 62, 119, 30, 17, 108, 52, 89, 110, 17, 109, 61, 114, 9, 116, 112, 44, 87, 54, 103, 36, 50, 5, 68, 18, 79, 20, 57, 108, 60, 9, 32, 28, 14, 6, 2, 91, 28, 40, 45, 20, 111, 77, 69, 106, 47, 107, 119, 72, 110, 116, 31, 99, 40, 15, 43, 7, 116, 96, 19, 45, 80, 28, 64, 19, 44, 17, 80, 28, 75, 115, 87, 55, 35, 44, 106, 74, 67, 118, 63, 26, 24, 12, 8, 120, 60, 1, 67, 15, 64, 99, 27, 112, 35, 83, 86, 74, 30, 97, 109, 68, 1, 7, 5, 36, 44, 37, 22, 12, 71, 22, 33, 13, 22, 93, 98, 106, 5, 64, 65, 92, 89, 60, 31, 39, 106, 75, 95, 76, 21, 101, 37, 101, 102, 36, 37, 47, 83, 94, 50, 64, 18, 108, 68, 46, 50, 75, 78, 59, 72, 15, 27, 5, 51, 81, 21, 98, 53, 120, 17, 87, 103, 75, 56, 52, 8, 112, 93, 55, 85, 19, 116, 23, 21, 95, 70, 44, 94, 72, 28, 113, 114, 42, 19, 95, 96, 50, 35, 8, 107, 77, 54, 3, 26, 70, 44, 27, 18, 24, 53, 70, 97, 102, 80, 116, 86, 94, 53, 38, 114, 49, 85, 30, 29, 23, 4, 38, 56, 56, 5, 52, 46, 96, 46, 34, 7, 93, 44, 77, 90, 108, 23, 8, 23, 11, 64, 22, 82, 59, 61, 7, 39, 91, 86, 64, 26, 108, 104, 36, 73, 19, 93, 3, 101, 102, 73, 64, 45, 28, 94, 27, 48, 46, 111, 19, 97, 93, 32, 116, 20, 84, 7, 119, 22, 99, 45, 100, 42, 59, 75, 61, 18, 70, 15, 57, 5, 28, 34, 69, 81, 77, 27, 106, 52, 79, 85, 17, 58, 16, 61, 10, 35, 18, 28, 85, 114, 48, 58, 80, 71, 96, 4, 12, 25, 104, 56, 41, 56, 84, 59, 110, 109, 37, 16, 82, 12, 103, 94, 21, 102, 93, 106, 93, 50, 7, 10, 96, 5, 41, 77, 38, 54, 81, 81, 66, 92, 22, 63, 90, 26, 120, 53, 44, 20, 74, 55, 96, 116, 45, 74, 53, 77, 107, 64, 105, 65, 95, 13, 20, 36, 34, 58, 56, 58, 67, 64, 92, 20, 105, 62, 55, 49, 59, 78, 52, 107, 60, 83, 59, 115, 39, 26, 9, 106, 108, 119, 85, 81, 99, 120, 69, 29, 22, 27, 69, 12, 67, 82, 116, 23, 62, 3, 34, 120, 36, 55, 20, 116, 108, 113, 84, 98, 55, 111, 32, 89, 107, 39, 78, 17, 52, 120, 62, 112, 89, 11, 48, 63, 91, 43, 22, 118, 75, 118, 91, 78, 62, 104, 47, 70, 119, 10, 94, 66, 31, 93, 107, 46, 98, 98, 77, 31, 41, 81, 67, 12, 30, 51, 64, 78, 40, 16, 43, 120, 16, 11, 55, 49, 49, 7, 11, 63, 54, 39, 58, 68, 26, 4, 98, 2, 120, 63, 29, 66, 102, 99, 63, 75, 98, 13, 35, 59, 94, 26, 56, 106, 25, 99, 111, 47, 108, 96, 74, 56, 30, 117, 5, 32, 93, 99, 69, 3, 22, 56, 19, 112, 31, 89, 104, 9, 42, 45, 16, 38, 79, 7, 83, 109, 118, 22, 39, 46, 67, 83, 34, 32, 66, 62, 96, 87, 106, 56, 81, 51, 113, 22, 112, 54, 26, 20, 13, 25, 94, 57, 69, 117, 81, 105, 115, 31, 92, 8, 18, 65, 86, 54, 115, 52, 104, 2, 115, 1, 108, 19, 65, 40, 17, 102, 36, 15, 17, 27, 65, 120, 53, 82, 83, 112, 75, 41, 63, 70, 57, 109, 72, 117, 117, 77, 22, 109, 27, 76, 31, 90, 12, 32, 38, 81, 44, 120, 70, 59, 14, 110, 114, 81, 75, 91, 100, 44, 55, 20, 15, 25, 29, 81, 77, 107, 85, 90, 49, 7, 94, 9, 53, 88, 1, 118, 68, 24, 101, 78, 53, 4, 58, 110, 6, 106, 17, 3, 13, 19, 120, 53, 58, 74, 113, 107, 113, 86, 91, 59, 45, 53, 43, 58, 17, 22, 20, 36, 118, 90, 66, 31, 113, 92, 45, 97, 8, 92, 52, 118, 21, 101, 36, 35, 35, 61, 101, 88, 87, 22, 81, 12, 3, 52, 63, 107, 89, 34, 7, 108, 92, 36, 39, 10, 115, 41, 96, 39, 40, 53, 44, 119, 116, 64, 118, 34, 62, 45, 25, 58, 92, 11, 47, 92, 13, 106, 46, 33, 26, 76, 22, 91, 17, 91, 41, 29, 18, 23, 24, 61, 80, 76, 54, 13, 47, 90, 32, 112, 63, 104, 119, 103, 67, 97, 29, 43, 57, 21, 24, 46, 98, 20, 26, 28, 82, 114, 80, 52, 33, 28, 21, 24, 104, 74, 4, 17, 116, 100, 69, 106, 39, 111, 89, 67, 59, 89, 18, 103, 28, 56, 40, 7, 56, 48, 67, 57, 78, 13, 96, 44, 103, 118, 91, 63, 83, 88, 56, 30, 21, 85, 92, 100, 109, 102, 37, 76, 93, 106, 41, 52, 11, 77, 57, 110, 25, 118, 77, 26, 32, 88, 99, 37, 106, 57, 50, 101, 40, 112, 59, 116, 24, 17, 93, 68, 53, 56, 96, 114, 96, 41, 82, 119, 18, 5, 69, 6, 41, 114, 72, 81, 60, 106, 94, 108, 46, 64, 115, 117, 17, 50, 82, 14, 106, 10, 119, 33, 82, 76, 69, 28, 85, 78, 51, 119, 37, 69, 22, 27, 42, 20, 59, 29, 59, 92, 33, 82, 64, 21, 51, 81, 83, 28, 85, 86, 5, 26, 35, 88, 18, 63, 77, 30, 12, 67, 104, 119, 97, 77, 26, 29, 83, 45, 47, 117, 20, 111, 92, 73, 19, 63, 73, 104, 40, 22, 73, 84, 68, 119, 84, 55, 31, 44, 82, 44, 15, 54, 38, 62, 53, 39, 59, 46, 27, 61, 86, 10, 32, 53, 16, 98, 98, 61, 9, 113, 22, 48, 110, 13, 48, 104, 119, 32, 52, 52, 8, 46, 46, 74, 38, 44, 94, 99, 95, 41, 1, 49, 9, 118, 45, 16, 58, 69, 15, 35, 78, 71, 108, 42, 74, 62, 70, 47, 99, 25, 77, 24, 94, 53, 20, 41, 14, 80, 38, 61, 4, 103, 53, 109, 95, 21, 84, 85, 19, 87, 18, 44, 28, 26, 97, 53, 95, 14, 69, 90, 92, 102, 46, 102, 120, 114, 13, 62, 47, 56, 90, 15, 112, 16, 110, 53, 12, 33, 16, 1, 40, 84, 75, 33, 48, 103, 98, 58, 37, 53, 13, 49, 88, 47, 109, 67, 40, 26, 115, 112, 41, 7, 48, 112, 30, 103, 36, 87, 56, 30, 117, 17, 70, 80, 21, 81, 105, 1, 22, 56, 78, 101, 16, 34, 82, 40, 10, 41, 69, 23, 103, 115, 10, 96, 66, 6, 9, 76, 120, 48, 17, 73, 72, 45, 2, 116, 14, 73, 110, 51, 75, 102, 39, 24, 26, 49, 34, 69, 43, 25, 100, 77, 101, 94, 64, 55, 9, 64, 27, 5, 90, 18, 23, 90, 58, 24, 39, 36, 113, 61, 113, 89, 72, 81, 72, 57, 84, 24, 20, 98, 62, 103, 39, 61, 113, 38, 115, 15, 28, 71, 78, 14, 48, 70, 51, 35, 54, 5, 40, 44, 1, 22, 90, 65, 45, 23, 51, 73, 120, 67, 44, 54, 38, 29, 9, 1, 87, 8, 3, 25, 107, 96, 91, 95, 101, 81, 3, 47, 63, 10, 113, 24, 7, 35, 63, 84, 38, 105, 93, 112, 85, 35, 68, 98, 53, 102, 19, 11, 78, 113, 3, 114, 110, 65, 57, 119, 45, 11, 80, 21, 10, 107, 2, 16, 112, 81, 17, 17, 109, 70, 109, 43, 27, 57, 56, 14, 72, 74, 69, 120, 117, 115, 5, 34, 92, 97, 98, 103, 76, 37, 115, 22, 78, 29, 18, 105, 60, 53, 2, 59, 65, 38, 116, 58, 7, 81, 98, 20, 30, 104, 120, 40, 10, 44, 10, 81, 28, 5, 60, 96, 20, 26, 95, 119, 34, 31, 85, 113, 61, 52, 9, 97, 92, 26, 85, 115, 115, 11, 31, 89, 80, 68, 53, 34, 97, 59, 27, 35, 9, 52, 56, 79, 49, 48, 31, 1, 98, 110, 32, 55, 8, 86, 69, 22, 26, 56, 99, 83, 17, 9, 57, 27, 101, 111, 44, 10, 102, 60, 52, 67, 59, 3, 12, 30, 42, 26, 60, 27, 56, 3, 55, 26, 77, 113, 50, 90, 41, 13, 67, 94, 45, 84, 71, 110, 62, 66, 37, 68, 30, 10, 3, 96, 16, 9, 113, 99, 110, 5, 42, 7, 23, 4, 105, 39, 12, 4, 76, 26, 117, 105, 73, 53, 109, 81, 117, 9, 20, 11, 8, 79, 80, 75, 112, 104, 27, 60, 91, 9, 33, 88, 17, 35, 5, 83, 61, 101, 112, 27, 61, 60, 20, 40, 49, 44, 11, 60, 106, 66, 30, 59, 56, 66, 98, 110, 113, 100, 65, 93, 11, 97, 47, 77, 107, 11, 79, 92, 109, 24, 61, 69, 7, 18, 115, 29, 74, 51, 42, 91, 114, 96, 81, 8, 29, 90, 96, 105, 33, 4, 67, 17, 44, 65, 100, 41, 116, 48, 85, 114, 80, 53, 107, 80, 120, 93, 12, 20, 93, 47, 26, 77, 93, 50, 110, 85, 82, 41, 73, 119, 63, 100, 93, 10, 107, 6, 87, 99, 118, 67, 66, 119, 5, 61, 118, 6, 74, 5, 75, 111, 74, 40, 41, 42, 79, 100, 10, 37, 51, 76, 22, 71, 43, 100, 102, 118, 106, 120, 119, 10, 103, 70, 82, 37, 71, 92, 20, 71, 7, 116, 44, 12, 11, 94, 104, 2, 100, 38, 43, 5, 39, 100, 18, 47, 109, 72, 57, 84, 93, 67, 99, 102, 78, 84, 30, 69, 28, 46, 45, 76, 98, 40, 64, 106, 113, 83, 107, 72, 95, 86, 51, 115, 9, 85, 113, 34, 103, 25, 47, 101, 114, 5, 43, 20, 17, 61, 94, 84, 72, 109, 39, 80, 33, 82, 43, 112, 46, 59, 103, 72, 19, 41, 10, 69, 24, 73, 88, 30, 62, 50, 35, 45, 66, 20, 99, 103, 67, 72, 25, 113, 74, 103, 83, 50, 88, 111, 52, 59, 11, 88, 119, 41, 9, 7, 55, 35, 99, 107, 97, 4, 23, 14, 88, 46, 22, 87, 46, 91, 94, 79, 63, 27, 15, 3, 1, 98, 24, 59, 67, 110, 27, 98, 40, 43, 89, 15, 8, 107, 118, 14, 21, 36, 22, 85, 24, 53, 113, 69, 104, 99, 32, 101, 1, 26, 61, 82, 31, 16, 96, 44, 72, 99, 47, 112, 51, 108, 38, 21, 51, 113, 34, 68, 33, 4, 6, 91, 108, 11, 94, 37, 72, 90, 76, 59, 38, 111, 2, 15, 94, 104, 22, 24, 9, 7, 17, 88, 2, 11, 21, 59, 33, 2, 58, 71, 9, 104, 92, 86, 91, 67, 89, 19, 24, 109, 34, 105, 5, 17, 53, 112, 37, 43, 104, 27, 21, 59, 5, 17, 62, 33, 35, 34, 119, 67, 94, 113, 50, 29, 81, 36, 50, 84, 8, 92, 73, 56, 81, 2, 25, 120, 50, 74, 87, 119, 57, 15, 38, 54, 99, 99, 62, 72, 116, 92, 102, 113, 85, 95, 37, 82, 4, 26, 47, 64, 112, 56, 21, 15, 29, 40, 45, 55, 97, 19, 105, 52, 61, 74, 85, 81, 97, 12, 21, 15, 52, 23, 47, 106, 25, 30, 65, 31, 13, 94, 65, 70, 37, 6, 78, 88, 6, 110, 118, 64, 27, 44, 105, 75, 49, 15, 106, 81, 77, 50, 100, 45, 89, 3, 115, 102, 19, 16, 37, 14, 11, 22, 76, 31, 42, 17, 4, 8, 32, 114, 35, 63, 105, 31, 96, 93, 79, 61, 60, 49, 53, 84, 23, 67, 67, 49, 50, 5, 50, 89, 1, 86, 102, 19, 39, 65, 44, 50, 102, 24, 94, 29, 116, 56, 8, 101, 93, 81, 102, 71, 52, 13, 87, 51, 67, 51, 102, 98, 37, 71, 119, 3, 75, 119, 16, 31, 10, 22, 119, 58, 105, 31, 42, 4, 99, 118, 44, 88, 30, 71, 83, 79, 3, 40, 75, 86, 116, 84, 91, 112, 20, 5, 55, 8, 23, 29, 54, 66, 47, 48, 49, 97, 65, 56, 102, 66, 12, 40, 113, 14, 40, 103, 21, 47, 87, 88, 110, 53, 102, 6, 75, 108, 35, 50, 118, 37, 5, 43, 117, 117, 45, 99, 110, 100, 7, 46, 119, 66, 72, 80, 68, 43, 99, 17, 51, 81, 67, 33, 73, 5, 18, 107, 20, 23, 72, 58, 22, 118, 24, 15, 20, 76, 103, 52, 10, 115, 62, 97, 71, 3, 46, 44, 70, 91, 5, 51, 97, 65, 5, 40, 92, 47, 107, 42, 78, 109, 93, 81, 66, 104, 118, 93, 75, 60, 13, 55, 16, 76, 66, 117, 31, 39, 28, 17, 41, 75, 25, 44, 84, 20, 75, 54, 27, 64, 29, 71, 115, 30, 99, 61, 32, 31, 40, 15, 36, 116, 65, 113, 53, 107, 18, 44, 3, 44, 38, 21, 65, 76, 60, 86, 2, 56, 105, 15, 57, 93, 88, 98, 29, 38, 32, 117, 2, 58, 45, 3, 12, 84, 12, 65, 10, 77, 10, 98, 92, 83, 23, 32, 37, 76, 35, 7, 41, 78, 47, 23, 48, 53, 47, 43, 74, 32, 25, 7, 12, 114, 52, 111, 79, 18, 43, 86, 24, 75, 27, 37, 78, 23, 98, 96, 100, 48, 42, 105, 40, 86, 54, 107, 14, 95, 63, 46, 100, 16, 2, 25, 86, 7, 98, 8, 53, 106, 76, 12, 83, 36, 65, 101, 66, 84, 79, 115, 53, 82, 66, 99, 118, 67, 111, 69, 48, 54, 2, 37, 18, 30, 69, 47, 2, 32, 79, 29, 104, 44, 5, 67, 101, 78, 72, 117, 24, 36, 36, 52, 55, 34, 92, 13, 20, 3, 26, 68, 39, 14, 50, 2, 81, 87, 12, 56, 2, 42, 79, 28, 106, 24, 53, 42, 84, 41, 100, 11, 62, 10, 109, 19, 34, 109, 38, 60, 92, 85, 49, 48, 104, 27, 23, 6, 35, 45, 106, 28, 28, 59, 82, 39, 5, 54, 46, 2, 11, 20, 17, 22, 68, 64, 48, 64, 106, 96, 24, 5, 72, 13, 53, 41, 96, 76, 59, 65, 10, 15, 98, 83, 106, 58, 17, 100, 40, 14, 11, 47, 31, 100, 105, 98, 113, 54, 47, 85, 2, 100, 93, 73, 105, 99, 26, 4, 62, 56, 38, 114, 34, 64, 114, 48, 103, 101, 85, 35, 29, 112, 120, 79, 20, 119, 114, 101, 17, 111, 20, 72, 107, 56, 1, 86, 68, 68, 11, 114, 76, 45, 75, 10, 119, 88, 8, 28, 14, 49, 95, 26, 81, 95, 30, 115, 96, 86, 41, 44, 114, 10, 87, 8, 18, 98, 33, 24, 35, 30, 8, 77, 90, 29, 119, 79, 12, 48, 2, 36, 59, 37, 27, 36, 113, 48, 87, 36, 48, 85, 66, 98, 79, 73, 27, 52, 41, 44, 93, 51, 109, 53, 21, 84, 19, 62, 18, 82, 32, 77, 42, 117, 117, 56, 62, 3, 46, 120, 49, 90, 31, 40, 66, 117, 13, 86, 83, 36, 78, 38, 50, 60, 8, 77, 84, 22, 83, 101, 26, 115, 39, 60, 30, 23, 120, 17, 17, 102, 87, 49, 30, 48, 53, 115, 3, 103, 4, 87, 28, 56, 76, 22, 101, 55, 65, 1, 23, 107, 88, 42, 36, 56, 54, 100, 101, 90, 37, 7, 37, 42, 102, 95, 3, 83, 39, 38, 30, 114, 52, 32, 91, 18, 108, 54, 34, 109, 99, 74, 49, 69, 21, 1, 94, 36, 4, 70, 2, 70, 109, 72, 20, 6, 71, 105, 51, 54, 36, 70, 50, 36, 77, 23, 44, 23, 80, 96, 52, 106, 6, 17, 53, 43, 111, 49, 65, 72, 118, 33, 13, 30, 56, 88, 10, 22, 45, 98, 107, 34, 96, 28, 105, 54, 84, 46, 60, 75, 67, 115, 83, 79, 114, 47, 37, 74, 87, 89, 11, 107, 4, 105, 66, 91, 28, 74, 6, 63, 113, 74, 29, 82, 102, 50, 17, 48, 115, 84, 98, 94, 119, 111, 74, 25, 99, 45, 107, 87, 58, 102, 12, 59, 99, 48, 1, 115, 26, 27, 94, 35, 107, 108, 65, 5, 41, 84, 23, 74, 34, 76, 40, 29, 115, 107, 27, 18, 108, 63, 44, 23, 99, 61, 71, 53, 104, 55, 20, 85, 4, 76, 78, 69, 59, 7, 46, 109, 79, 63, 81, 101, 83, 33, 78, 59, 77, 107, 81, 10, 17, 2, 91, 99, 27, 95, 99, 55, 51, 28, 31, 97, 91, 59, 11, 4, 16, 11, 118, 110, 88, 62, 49, 63, 73, 8, 33, 50, 95, 39, 116, 69, 106, 114, 12, 119, 91, 72, 21, 48, 110, 75, 26, 50, 57, 93, 65, 9, 80, 86, 60, 56, 56, 12, 43, 66, 104, 65, 29, 49, 3, 78, 42, 106, 78, 67, 9, 79, 95, 81, 89, 45, 15, 57, 102, 78, 52, 39, 13, 3, 91, 43, 80, 13, 108, 67, 76, 60, 51, 22, 54, 53, 5, 103, 113, 56, 53, 81, 89, 111, 46, 70, 48, 116, 89, 107, 116, 106, 44, 112, 37, 47, 64, 4, 15, 69, 91, 75, 42, 96, 18, 35, 9, 52, 32, 99, 1, 52, 109, 82, 7, 84, 34, 28, 113, 25, 106, 96, 29, 101, 15, 74, 60, 92, 109, 51, 43, 58, 15, 37, 7, 70, 103, 68, 119, 1, 71, 117, 56, 105, 76, 44, 106, 12, 29, 92, 75, 3, 15, 24, 115, 56, 66, 96, 76, 1, 29, 99, 78, 42, 54, 114, 36, 38, 89, 93, 80, 61, 111, 106, 95, 41, 63, 99, 59, 54, 58, 88, 90, 19, 36, 26, 74, 88, 54, 120, 101, 70, 77, 63, 118, 77, 114, 17, 88, 82, 67, 51, 38, 64, 40, 61, 111, 23, 90, 117, 105, 42, 85, 62, 58, 69, 62, 112, 14, 61, 119, 56, 99, 26, 76, 18, 118, 93, 24, 63, 39, 7, 61, 20, 107, 76, 35, 82, 24, 50, 42, 62, 98, 59, 2, 36, 30, 103, 98, 85, 90, 69, 41, 18, 34, 105, 3, 110, 103, 61, 22, 20, 95, 98, 53, 64, 23, 40, 22, 12, 46, 2, 17, 119, 105, 118, 18, 74, 29, 100, 26, 73, 73, 33, 35, 68, 9, 9, 19, 39, 51, 16, 27, 32, 68, 74, 62, 66, 1, 12, 39, 46, 33, 72, 65, 41, 111, 104, 92, 49, 73, 22, 26, 71, 113, 63, 115, 90, 83, 118, 69, 120, 54, 108, 76, 8, 15, 45, 97, 67, 97, 49, 35, 37, 27, 46, 14, 54, 9, 49, 12, 65, 28, 2, 28, 32, 80, 31, 96, 106, 64, 19, 14, 97, 39, 22, 44, 33, 81, 23, 102, 100, 88, 24, 38, 60, 54, 105, 49, 117, 25, 69, 86, 9, 6, 92, 78, 103, 108, 46, 12, 52, 49, 46, 61, 42, 105, 106, 74, 78, 33, 8, 104, 43, 66, 100, 84, 26, 21, 87, 102, 59, 33, 41, 3, 22, 95, 45, 21, 26, 107, 46, 29, 49, 56, 22, 61, 64, 31, 108, 100, 66, 88, 47, 39, 2, 95, 17, 6, 103, 34, 28, 50, 82, 59, 40, 31, 12, 37, 74, 9, 51, 50, 28, 91, 3, 52, 2, 26, 15, 105, 42, 110, 54, 5, 110, 22, 74, 99, 49, 47, 76, 40, 17, 25, 46, 9, 71, 88, 39, 90, 5, 52, 114, 116, 45, 72, 52, 40, 46, 97, 99, 68, 62, 93, 119, 10, 66, 64, 33, 86, 53, 56, 23, 32, 67, 91, 114, 115, 14, 91, 37, 120, 18, 89, 99, 83, 100, 71, 16, 98, 113, 97, 7, 28, 76, 68, 42, 64, 74, 49, 105, 85, 25, 27, 39, 120, 8, 6, 50, 67, 22, 61, 83, 31, 32, 26, 80, 33, 79, 30, 61, 62, 1, 22, 115, 27, 93, 58, 6, 73, 78, 95, 6, 100, 40, 14, 35, 76, 45, 70, 103, 69, 36, 100, 60, 23, 72, 30, 30, 9, 90, 2, 105, 45, 1, 117, 100, 22, 68, 92, 118, 110, 3, 39, 102, 120, 109, 94, 69, 91, 47, 61, 88, 59, 100, 50, 24, 30, 7, 101, 116, 4, 72, 28, 62, 87, 65, 74, 88, 47, 77, 8, 39, 85, 58, 10, 96, 2, 81, 36, 113, 113, 14, 79, 39, 23, 98, 99, 107, 84, 61, 111, 73, 49, 22, 21, 87, 106, 65, 95, 93, 56, 76, 113, 15, 30, 115, 117, 79, 17, 34, 66, 69, 23, 24, 97, 111, 37, 16, 100, 59, 43, 12, 60, 2, 52, 48, 100, 29, 99, 90, 60, 74, 109, 80, 94, 32, 82, 23, 91, 51, 109, 62, 111, 111, 11, 71, 2, 26, 111, 100, 34, 56, 103, 83, 87, 106, 57, 6, 58, 23, 5, 16, 118, 63, 46, 61, 8, 16, 98, 29, 105, 118, 68, 3, 34, 42, 23, 32, 94, 108, 87, 33, 23, 18, 54, 97, 74, 91, 88, 19, 44, 13, 112, 105, 103, 71, 118, 5, 96, 84, 39, 42, 59, 54, 119, 18, 119, 1, 47, 26, 69, 113, 56, 119, 22, 33, 99, 35, 8, 80, 117, 7, 18, 38, 31, 15, 119, 75, 107, 70, 36, 120, 32, 31, 30, 56, 24, 99, 119, 39, 57, 91, 33, 49, 100, 77, 73, 67, 48, 57, 110, 12, 63, 58, 111, 8, 65, 104, 54, 64, 32, 110, 60, 38, 21, 46, 3, 79, 111, 119, 18, 40, 117, 79, 87, 14, 119, 55, 98, 84, 112, 77, 61, 101, 66, 119, 48, 97, 66, 115, 20, 79, 5, 23, 66, 45, 70, 48, 69, 36, 25, 34, 98, 119, 31, 107, 32, 38, 88, 44, 26, 92, 56, 62, 16, 99, 103, 20, 74, 3, 85, 47, 22, 4, 94, 120, 40, 13, 36, 55, 49, 46, 9, 115, 87, 63, 30, 31, 94, 23, 109, 13, 96, 74, 67, 34, 65, 30, 112, 22, 76, 3, 28, 43, 89, 18, 19, 31, 108, 34, 15, 18, 14, 96, 36, 34, 91, 93, 60, 28, 41, 62, 12, 2, 13, 120, 46, 56, 68, 104, 31, 48, 27, 7, 97, 5, 97, 53, 99, 2, 111, 99, 97, 19, 60, 111, 30, 109, 87, 74, 94, 77, 25, 119, 110, 97, 31, 51, 21, 3, 3, 103, 9, 71, 15, 107, 35, 64, 17, 104, 4, 68, 54, 114, 43, 95, 47, 99, 28, 104, 114, 85, 74, 21, 61, 92, 12, 47, 32, 42, 7, 30, 113, 71, 59, 16, 93, 66, 120, 114, 104, 108, 23, 25, 8, 48, 110, 9, 112, 29, 21, 40, 91, 97, 42, 45, 103, 115, 86, 87, 116, 104, 52, 100, 61, 41, 115, 9, 116, 15, 120, 90, 49, 62, 71, 113, 20, 95, 7, 115, 87, 7, 47, 82, 18, 56, 34, 68, 34, 87, 75, 101, 4, 85, 120, 104, 83, 46, 42, 94, 114, 65, 114, 72, 32, 67, 31, 77, 56, 101, 44, 68, 24, 86, 66, 41, 109, 11, 16, 109, 53, 16, 54, 101, 21, 119, 35, 30, 28, 110, 31, 30, 41, 29, 74, 48, 35, 5, 9, 66, 7, 57, 58, 98, 30, 16, 16, 70, 3, 116, 107, 59, 19, 45, 42, 36, 105, 94, 73, 22, 102, 108, 16, 18, 82, 87, 105, 15, 55, 11, 70, 74, 65, 92, 118, 52, 96, 12, 80, 98, 46, 100, 53, 10, 39, 82, 66, 22, 93, 114, 89, 67, 119, 103, 5, 51, 29, 96, 114, 59, 80, 53, 12, 43, 39, 65, 12, 70, 95, 73, 49, 73, 36, 69, 76, 44, 2, 4, 38, 40, 49, 22, 79, 72, 28, 22, 30, 37, 2, 15, 1, 88, 62, 91, 6, 55, 23, 32, 42, 77, 110, 82, 90, 88, 118, 5, 98, 75, 35, 117, 78, 2, 13, 75, 4, 105, 7, 94, 33, 17, 28, 113, 92, 63, 95, 110, 76, 69, 47, 86, 60, 106, 52, 47, 87, 62, 62, 72, 53, 97, 39, 18, 83, 100, 34, 83, 6, 96, 115, 43, 22, 24, 105, 47, 43, 56, 72, 107, 11, 80, 24, 102, 40, 101, 108, 30, 70, 44, 23, 57, 51, 41, 108, 73, 60, 52, 36, 11, 58, 19, 84, 99, 54, 38, 100, 92, 89, 96, 50, 32, 23, 68, 81, 120, 11, 71, 100, 1, 31, 2, 58, 60, 120, 30, 62, 16, 41, 72, 31, 25, 89, 14, 58, 99, 88, 6, 58, 101, 58, 72, 8, 28, 114, 100, 118, 5, 71, 30, 105, 114, 21, 54, 75, 113, 109, 73, 102, 88, 99, 30, 81, 44, 2, 19, 101, 65, 22, 99, 31, 24, 20, 100, 96, 47, 71, 28, 53, 67, 113, 117, 120, 53, 11, 34, 70, 76, 54, 62, 120, 20, 22, 44, 26, 51, 10, 84, 45, 101, 55, 49, 81, 35, 73, 71, 71, 74, 28, 94, 49, 80, 77, 70, 30, 80, 42, 5, 29, 7, 105, 68, 32, 92, 44, 74, 12, 29, 41, 100, 68, 74, 58, 45, 61, 73, 76, 67, 42, 94, 53, 19, 55, 74, 9, 81, 81, 6, 98, 54, 28, 4, 56, 26, 48, 6, 45, 5, 79, 28, 17, 63, 32, 76, 58, 51, 38, 48, 31, 3, 16, 72, 116, 45, 38, 71, 98, 106, 96, 76, 48, 109, 75, 100, 45, 47, 54, 120, 65, 46, 89, 20, 12, 108, 120, 48, 95, 71, 17, 27, 13, 58, 32, 111, 106, 6, 33, 81, 28, 77, 34, 96, 72, 24, 14, 114, 96, 42, 3, 91, 92, 46, 35, 70, 27, 23, 8, 19, 84, 100, 64, 80, 83, 93, 64, 105, 41, 23, 97, 62, 23, 25, 20, 47, 47, 116, 14, 6, 74, 15, 71, 26, 102, 109, 95, 27, 98, 62, 50, 69, 112, 64, 106, 84, 51, 15, 31, 114, 28, 106, 7, 117, 63, 116, 99, 22, 47, 80, 49, 91, 81, 44, 94, 67, 88, 73, 79, 71, 114, 56, 18, 103, 117, 44, 101, 14, 64, 50, 59, 79, 54, 92, 47, 4, 7, 113, 50, 92, 1, 117, 93, 8, 58, 6, 42, 14, 112, 97, 74, 98, 2, 79, 86, 56, 117, 8, 90, 90, 61, 101, 84, 50, 46, 78, 36, 20, 44, 59, 9, 117, 101, 80, 19, 50, 114, 22, 18, 34, 108, 41, 7, 119, 14, 75, 23, 111, 65, 115, 112, 67, 2, 28, 86, 105, 20, 83, 15, 90, 103, 92, 94, 82, 21, 27, 58, 14, 9, 55, 13, 76, 60, 16, 59, 5, 82, 120, 89, 35, 55, 76, 106, 97, 20, 10, 34, 104, 72, 87, 27, 11, 119, 78, 32, 83, 95, 31, 77, 10, 82, 79, 107, 108, 84, 61, 47, 98, 31, 118, 81, 85, 111, 11, 1, 119, 57, 82, 44, 77, 22, 61, 40, 22, 113, 6, 16, 9, 28, 88, 29, 77, 112, 97, 47, 26, 2, 47, 39, 117, 53, 114, 118, 88, 114, 81, 5, 98, 92, 113, 24, 79, 41, 32, 102, 36, 106, 55, 27, 34, 18, 79, 80, 10, 112, 94, 61, 42, 113, 94, 85, 99, 112, 72, 32, 67, 33, 35, 36, 51, 19, 44, 64, 43, 40, 99, 89, 54, 28, 71, 40, 27, 30, 118, 78, 95, 67, 68, 24, 43, 82, 51, 102, 118, 79, 56, 78, 115, 107, 63, 56, 22, 88, 57, 52, 45, 113, 34, 57, 5, 29, 105, 98, 101, 26, 106, 54, 21, 34, 104, 6, 41, 76, 52, 67, 29, 113, 108, 10, 24, 4, 108, 105, 12, 12, 3, 110, 2, 19, 66, 114, 35, 49, 32, 86, 72, 73, 70, 52, 17, 21, 62, 12, 17, 79, 73, 18, 19, 34, 10, 71, 84, 73, 43, 8, 110, 109, 68, 13, 28, 70, 44, 107, 114, 47, 8, 12, 91, 98, 75, 113, 116, 78, 100, 101, 74, 118, 113, 95, 62, 112, 22, 105, 19, 95, 27, 86, 56, 96, 32, 60, 5, 92, 22, 83, 55, 120, 27, 76, 101, 97, 13, 5, 101, 35, 110, 74, 30, 11, 43, 61, 58, 77, 46, 57, 19, 61, 61, 55, 103, 97, 110, 76, 57, 44, 35, 40, 77, 32, 64, 5, 15, 42, 21, 83, 105, 29, 30, 66, 19, 117, 34, 28, 99, 42, 61, 69, 117, 30, 83, 78, 2, 33, 36, 51, 20, 57, 91, 86, 73, 74, 39, 62, 60, 58, 35, 22, 12, 87, 87, 69, 57, 104, 9, 66, 27, 48, 106, 98, 29, 53, 94, 16, 119, 34, 85, 67, 90, 71, 28, 88, 86, 98, 41, 84, 61, 105, 45, 120, 118, 94, 1, 34, 40, 59, 13, 88, 75, 102, 91, 29, 67, 107, 51, 23, 32, 103, 85, 37, 62, 86, 27, 2, 95, 87, 13, 58, 13, 16, 54, 114, 57, 31, 115, 8, 64, 26, 92, 23, 47, 10, 67, 114, 63, 89, 7, 68, 64, 2, 119, 14, 27, 7, 32, 93, 27, 101, 57, 116, 91, 73, 60, 54, 120, 69, 58, 51, 21, 114, 117, 59, 67, 15, 96, 16, 69, 47, 65, 42, 5, 47, 94, 111, 2, 17, 5, 43, 104, 51, 26, 25, 24, 98, 54, 22, 20, 61, 92, 91, 22, 34, 118, 45, 21, 100, 81, 4, 120, 90, 30, 22, 27, 49, 33, 11, 56, 7, 8, 104, 65, 88, 55, 13, 85, 80, 39, 34, 50, 43, 50, 60, 43, 2, 15, 119, 85, 78, 47, 109, 85, 99, 5, 76, 12, 19, 15, 56, 46, 72, 117, 94, 105, 106, 93, 99, 89, 33, 14, 9, 38, 74, 32, 67, 35, 41, 37, 86, 57, 98, 113, 107, 56, 59, 57, 12, 85, 44, 34, 66, 15, 59, 76, 83, 87, 24, 88, 90, 100, 54, 115, 86, 99, 88, 34, 19, 35, 42, 96, 113, 5, 41, 12, 30, 102, 39, 40, 63, 85, 101, 60, 31, 120, 120, 77, 44, 45, 47, 115, 51, 27, 97, 57, 80, 40, 21, 17, 87, 70, 8, 76, 116, 111, 111, 59, 40, 15, 31, 116, 100, 23, 112, 4, 18, 34, 11, 110, 59, 84, 74, 40, 9, 36, 61, 43, 108, 89, 32, 109, 67, 60, 120, 81, 5, 86, 26, 63, 26, 91, 103, 9, 52, 23, 81, 26, 29, 109, 30, 119, 26, 70, 24, 77, 92, 111, 48, 25, 12, 55, 42, 19, 34, 89, 9, 118, 98, 103, 6, 100, 32, 7, 97, 29, 104, 2, 113, 63, 29, 109, 10, 74, 18, 61, 16, 112, 55, 20, 93, 99, 75, 7, 32, 84, 13, 23, 42, 28, 72, 84, 34, 53, 110, 91, 100, 76, 95, 24, 101, 32, 101, 115, 15, 50, 113, 14, 13, 100, 114, 41, 115, 111, 94, 114, 42, 24, 98, 83, 24, 110, 60, 75, 17, 62, 76, 88, 110, 94, 29, 116, 56, 56, 30, 46, 34, 5, 48, 99, 41, 109, 37, 18, 45, 98, 111, 112, 113, 57, 116, 47, 30, 107, 9, 78, 70, 83, 51, 63, 80, 49, 97, 23, 3, 8, 7, 72, 77, 79, 24, 76, 107, 65, 44, 27, 83, 53, 120, 103, 33, 96, 7, 114, 98, 12, 71, 66, 119, 10, 94, 21, 117, 41, 84, 37, 9, 105, 54, 25, 115, 58, 17, 94, 35, 113, 45, 111, 65, 83, 81, 35, 33, 2, 98, 89, 94, 26, 6, 3, 24, 120, 74, 87, 60, 27, 71, 107, 96, 106, 104, 104, 73, 67, 8, 63, 3, 2, 45, 49, 54, 79, 86, 110, 108, 43, 1, 12, 66, 37, 44, 25, 12, 46, 48, 8, 108, 119, 2, 85, 3, 83, 59, 24, 62, 31, 81, 48, 54, 36, 43, 67, 92, 79, 102, 50, 78, 115, 65, 112, 92, 41, 51, 61, 2, 83, 2, 88, 65, 91, 1, 80, 71, 14, 29, 85, 55, 8, 96, 49, 22, 108, 68, 79, 9, 94, 69, 13, 46, 47, 103, 120, 94, 6, 73, 85, 18, 59, 3, 64, 120, 118, 71, 15, 67, 52, 94, 18, 101, 31, 55, 67, 2, 100, 115, 114, 111, 7, 25, 2, 47, 50, 72, 20, 58, 59, 14, 99, 107, 68, 45, 54, 32, 97, 39, 13, 98, 42, 43, 110, 49, 28, 60, 91, 91, 40, 95, 20, 62, 16, 104, 46, 54, 83, 3, 92, 37, 60, 93, 94, 77, 114, 106, 20, 39, 8, 4, 15, 107, 1, 25, 68, 113, 16, 17, 78, 87, 61, 11, 46, 35, 98, 50, 66, 105, 58, 65, 20, 3, 7, 14, 5, 66, 50, 73, 34, 115, 15, 73, 7, 101, 79, 63, 16, 64, 25, 105, 31, 91, 74, 46, 1, 33, 103, 103, 110, 34, 112, 92, 71, 1, 53, 8, 33, 93, 60, 2, 95, 119, 18, 68, 71, 114, 7, 77, 119, 10, 62, 101, 45, 42, 27, 1, 101, 105, 104, 75, 41, 48, 78, 20, 82, 57, 72, 79, 106, 38, 39, 116, 98, 21, 91, 46, 15, 111, 78, 25, 66, 84, 83, 82, 92, 14, 96, 36, 7, 23, 115, 42, 30, 45, 83, 25, 57, 23, 35, 93, 9, 109, 8, 6, 12, 75, 74, 72, 10, 6, 100, 61, 69, 34, 27, 109, 2, 66, 120, 62, 27, 113, 64, 10, 97, 32, 37, 18, 17, 120, 33, 105, 116, 27, 80, 67, 4, 46, 81, 25, 76, 86, 46, 43, 38, 87, 85, 33, 47, 77, 41, 91, 78, 109, 96, 64, 120, 54, 7, 3, 44, 106, 84, 8, 14, 2, 19, 73, 102, 117, 90, 100, 58, 35, 13, 33, 4, 101, 48, 76, 36, 29, 88, 69, 58, 72, 100, 2, 59, 27, 118, 24, 97, 31, 113, 66, 27, 35, 65, 28, 62, 60, 1, 9, 6, 60, 20, 93, 120, 18, 11, 35, 62, 18, 75, 115, 119, 115, 8, 10, 91, 115, 16, 117, 70, 86, 78, 6, 80, 119, 52, 101, 36, 111, 107, 25, 87, 81, 42, 57, 111, 92, 32, 49, 18, 37, 48, 71, 91, 102, 76, 4, 92, 49, 93, 93, 12, 79, 69, 99, 82, 38, 29, 54, 46, 49, 25, 94, 88, 74, 49, 90, 68, 39, 94, 41, 26, 62, 36, 112, 38, 55, 22, 12, 85, 35, 92, 20, 5, 72, 24, 84, 75, 2, 99, 64, 88, 25, 85, 60, 119, 19, 12, 90, 106, 11, 95, 25, 59, 45, 25, 79, 106, 92, 18, 37, 98, 40, 65, 119, 5, 25, 1, 28, 82, 95, 50, 82, 91, 107, 52, 18, 52, 62, 43, 25, 45, 85, 90, 92, 93, 82, 72, 50, 7, 13, 120, 46, 56, 26, 90, 107, 70, 28, 75, 95, 111, 7, 36, 103, 88, 12, 31, 11, 14, 56, 11, 33, 68, 115, 46, 91, 93, 40, 108, 73, 56, 33, 110, 26, 23, 24, 45, 85, 69, 2, 74, 3, 10, 120, 76, 43, 109, 10, 71, 100, 86, 105, 8, 75, 7, 96, 16, 60, 33, 108, 18, 98, 90, 79, 20, 35, 106, 50, 58, 44, 108, 118, 1, 32, 91, 43, 71, 18, 59, 67, 33, 64, 1, 103, 81, 75, 26, 55, 111, 8, 3, 89, 66, 22, 72, 40, 11, 21, 3, 88, 110, 60, 42, 61, 60, 10, 106, 54, 114, 103, 98, 28, 12, 119, 39, 83, 102, 114, 21, 55, 87, 62, 88, 96, 102, 105, 94, 116, 49, 48, 48, 62, 67, 78, 74, 54, 59, 35, 88, 27, 39, 120, 113, 34, 65, 83, 70, 59, 101, 42, 117, 18, 22, 16, 118, 97, 51, 24, 44, 97, 55, 17, 4, 99, 114, 38, 74, 15, 13, 22, 12, 96, 76, 68, 43, 77, 71, 57, 27, 61, 86, 41, 98, 28, 81, 97, 77, 111, 44, 1, 115, 80, 61, 69, 111, 103, 42, 94, 1, 34, 7, 100, 51, 78, 58, 7, 93, 104, 95, 98, 51, 108, 74, 11, 22, 61, 81, 35, 85, 10, 93, 36, 2, 87, 36, 16, 56, 112, 47, 66, 23, 95, 15, 83, 112, 22, 28, 67, 76, 72, 92, 56, 86, 19, 23, 109, 3, 82, 32, 63, 95, 114, 51, 41, 51, 86, 56, 109, 74, 49, 47, 104, 58, 43, 34, 22, 41, 37, 9, 16, 120, 60, 108, 53, 96, 69, 69, 95, 42, 40, 86, 25, 42, 31, 56, 36, 45, 10, 5, 78, 116, 66, 120, 74, 44, 3, 95, 19, 42, 38, 58, 79, 81, 60, 43, 97, 106, 67, 61, 9, 103, 99, 71, 19, 31, 111, 66, 111, 28, 97, 66, 8, 16, 92, 70, 13, 65, 60, 24, 18, 2, 18, 90, 67, 5, 1, 21, 50, 49, 31, 86, 27, 42, 43, 109, 57, 20, 96, 104, 18, 48, 78, 71, 72, 90, 58, 42, 103, 5, 24, 93, 119, 81, 3, 55, 25, 89, 22, 35, 107, 79, 6, 90, 25, 8, 119, 66, 2, 23, 31, 53, 13, 35, 24, 79, 109, 82, 83, 95, 94, 67, 69, 24, 105, 49, 32, 117, 59, 81, 29, 39, 30, 79, 80, 104, 30, 61, 44, 74, 68, 20, 72, 59, 96, 22, 107, 11, 110, 88, 27, 60, 105, 24, 31, 51, 107, 23, 56, 7, 22, 10, 38, 72, 36, 84, 95, 3, 65, 85, 92, 69, 1, 30, 77, 9, 76, 110, 109, 70, 54, 116, 116, 10, 87, 75, 91, 34, 93, 31, 29, 104, 118, 103, 7, 10, 14, 84, 110, 113, 113, 106, 4, 41, 109, 51, 46, 105, 29, 18, 69, 75, 102, 82, 87, 93, 77, 109, 47, 98, 49, 12, 26, 115, 95, 80, 47, 44, 28, 87, 54, 29, 6, 43, 16, 56, 9, 79, 118, 59, 48, 111, 86, 86, 87, 119, 80, 34, 35, 93, 66, 74, 36, 98, 29, 95, 73, 78, 36, 33, 46, 49, 51, 50, 79, 86, 18, 98, 44, 94, 40, 93, 107, 27, 71, 34, 79, 109, 2, 10, 59, 26, 96, 103, 60, 76, 14, 8, 43, 8, 64, 119, 34, 111, 85, 76, 112, 1, 53, 105, 104, 56, 48, 11, 43, 85, 57, 110, 17, 54, 66, 62, 84, 117, 15, 72, 120, 85, 57, 96, 80, 13, 46, 76, 99, 44, 105, 120, 76, 40, 40, 95, 54, 119, 59, 25, 104, 26, 68, 75, 90, 61, 48, 17, 47, 62, 27, 22, 63, 19, 86, 65, 73, 44, 62, 91, 109, 61, 117, 57, 39, 60, 14, 37, 96, 52, 99, 17, 17, 50, 28, 101, 111, 72, 58, 58, 74, 80, 120, 50, 53, 12, 66, 88, 105, 36, 114, 68, 52, 56, 3, 27, 71, 74, 58, 19, 107, 11, 8, 31, 3, 68, 41, 105, 99, 88, 50, 20, 31, 95, 45, 29, 47, 43, 103, 7, 34, 58, 104, 120, 88, 51, 88, 67, 87, 52, 61, 74, 48, 98, 39, 23, 70, 52, 12, 110, 88, 64, 12, 79, 17, 15, 105, 72, 104, 10, 118, 37, 22, 117, 108, 22, 58, 120, 13, 88, 14, 32, 50, 45, 25, 116, 3, 106, 114, 19, 5, 69, 112, 60, 19, 17, 19, 95, 48, 76, 80, 110, 26, 116, 28, 105, 57, 67, 15, 40, 26, 85, 105, 120, 33, 60, 116, 45, 96, 69, 27, 10, 2, 27, 74, 9, 53, 47, 95, 7, 16, 7, 19, 32, 68, 105, 48, 96, 109, 28, 81, 34, 81, 99, 6, 8, 95, 88, 4, 21, 97, 118, 72, 47, 26, 25, 101, 88, 62, 115, 96, 41, 62, 18, 79, 51, 40, 16, 109, 20, 21, 59, 68, 27, 75, 97, 57, 95, 94, 34, 70, 55, 15, 83, 40, 24, 29, 33, 96, 88, 47, 107, 111, 49, 117, 86, 82, 115, 60, 22, 59, 61, 18, 75, 6, 42, 28, 70, 100, 69, 49, 119, 37, 50, 27, 59, 22, 31, 6, 53, 79, 34, 57, 45, 83, 82, 22, 25, 6, 120, 102, 49, 66, 77, 56, 9, 80, 57, 73, 80, 16, 19, 45, 97, 2, 46, 35, 27, 67, 111, 21, 92, 86, 78, 92, 18, 94, 46, 79, 45, 103, 93, 105, 101, 36, 107, 87, 46, 84, 108, 90, 58, 90, 49, 41, 119, 34, 108, 72, 103, 99, 33, 17, 24, 11, 32, 55, 54, 48, 16, 54, 63, 103, 60, 45, 43, 82, 60, 24, 63, 66, 116, 59, 74, 65, 58, 64, 110, 62, 78, 99, 37, 44, 10, 115, 42, 36, 88, 66, 92, 94, 70, 25, 94, 18, 32, 73, 100, 82, 1, 107, 74, 3, 18, 17, 14, 62, 76, 90, 117, 56, 31, 2, 65, 34, 67, 86, 117, 23, 47, 88, 86, 58, 88, 59, 57, 98, 33, 32, 78, 70, 112, 98, 46, 98, 101, 111, 76, 40, 33, 110, 114, 68, 70, 100, 104, 114, 61, 110, 101, 74, 94, 109, 43, 71, 43, 100, 101, 69, 18, 12, 5, 108, 19, 69, 23, 16, 3, 20, 95, 106, 14, 11, 15, 96, 31, 73, 119, 86, 31, 104, 29, 43, 16, 108, 43, 5, 95, 33, 25, 112, 25, 111, 113, 37, 104, 114, 50, 1, 40, 104, 65, 46, 88, 27, 116, 3, 55, 15, 89, 45, 1, 67, 10, 32, 66, 40, 56, 58, 63, 117, 8, 16, 91, 61, 38, 18, 77, 7, 116, 34, 113, 88, 106, 72, 7, 69, 44, 45, 50, 24, 56, 105, 50, 29, 76, 82, 16, 84, 65, 45, 22, 13, 28, 42, 48, 98, 13, 62, 65, 17, 117, 82, 78, 3, 18, 86, 38, 3, 4, 13, 49, 95, 56, 89, 47, 40, 89, 66, 102, 9, 109, 81, 7, 116, 65, 39, 83, 73, 120, 56, 101, 91, 64, 108, 8, 111, 14, 71, 55, 34, 19, 44, 14, 80, 79, 72, 4, 42, 91, 120, 89, 1, 67, 96, 87, 15, 83, 99, 84, 70, 104, 47, 111, 96, 98, 60, 39, 50, 64, 14, 113, 27, 104, 72, 3, 25, 107, 70, 62, 10, 94, 9, 31, 33, 10, 58, 102, 46, 39, 88, 3, 34, 78, 27, 55, 41, 116, 14, 33, 32, 10, 32, 108, 5, 84, 72, 119, 38, 119, 104, 24, 106, 54, 90, 11, 103, 28, 12, 93, 10, 41, 28, 104, 119, 96, 118, 79, 91, 83, 32, 79, 87, 114, 120, 97, 48, 59, 33, 115, 90, 39, 107, 112, 51, 74, 79, 4, 47, 46, 106, 99, 22, 22, 50, 31, 117, 14, 60, 24, 92, 107, 9, 10, 105, 118, 24, 12, 68, 111, 50, 5, 31, 37, 50, 77, 110, 4, 12, 61, 52, 38, 13, 63, 89, 82, 57, 99, 57, 102, 21, 67, 80, 120, 9, 84, 54, 60, 27, 89, 68, 119, 44, 120, 3, 54, 62, 95, 70, 34, 92, 97, 39, 22, 73, 17, 18, 3, 11, 104, 14, 55, 120, 61, 89, 59, 72, 8, 98, 38, 48, 22, 108, 62, 34, 75, 29, 60, 52, 38, 67, 5, 36, 50, 56, 105, 72, 101, 65, 17, 17, 34, 9, 93, 32, 74, 44, 97, 81, 107, 15, 28, 87, 43, 97, 92, 115, 62, 96, 66, 115, 16, 52, 13, 41, 14, 79, 68, 65, 14, 64, 101, 76, 85, 78, 114, 76, 75, 88, 42, 86, 118, 64, 19, 99, 75, 1, 6, 90, 97, 34, 94, 2, 67, 41, 28, 26, 85, 8, 59, 53, 72, 14, 120, 34, 20, 19, 84, 62, 94, 114, 18, 78, 81, 82, 79, 102, 87, 22, 17, 66, 108, 51, 95, 16, 9, 97, 75, 108, 18, 50, 31, 28, 114, 72, 34, 30, 71, 82, 98, 112, 118, 120, 117, 63, 20, 71, 46, 36, 78, 43, 92, 17, 23, 43, 51, 98, 3, 23, 59, 118, 11, 119, 103, 28, 58, 62, 93, 54, 40, 88, 79, 90, 114, 40, 37, 97, 4, 114, 42, 7, 60, 72, 81, 115, 2, 29, 107, 61, 101, 3, 33, 39, 10, 26, 12, 26, 28, 69, 5, 76, 33, 3, 32, 75, 116, 38, 107, 71, 11, 82, 117, 68, 45, 30, 38, 109, 69, 70, 12, 119, 20, 75, 34, 20, 66, 5, 30, 50, 88, 84, 111, 31, 93, 111, 40, 96, 20, 94, 119, 69, 92, 119, 101, 43, 45, 119, 118, 117, 89, 85, 98, 31, 17, 51, 26, 78, 26, 29, 73, 53, 58, 59, 55, 98, 116, 102, 120, 112, 91, 48, 94, 116, 14, 44, 109, 34, 37, 113, 53, 20, 53, 101, 76, 81, 83, 53, 1, 70, 84, 53, 53, 24, 71, 67, 6, 53, 109, 107, 39, 49, 67, 5, 64, 16, 3, 34, 13, 72, 36, 53, 93, 16, 84, 119, 45, 43, 30, 28, 10, 76, 79, 23, 12, 11, 90, 95, 55, 86, 56, 16, 3, 65, 71, 11, 9, 9, 103, 15, 22, 10, 85, 83, 46, 33, 47, 40, 59, 64, 32, 32, 79, 43, 89, 64, 107, 38, 91, 103, 11, 81, 31, 18, 49, 107, 62, 58, 29, 58, 73, 45, 75, 23, 61, 47, 23, 38, 88, 13, 74, 30, 21, 63, 22, 39, 111, 15, 29, 33, 110, 48, 62, 41, 47, 47, 17, 41, 49, 40, 113, 3, 13, 33, 22, 41, 89, 116, 70, 8, 62, 10, 109, 26, 97, 64, 86, 17, 46, 64, 58, 58, 47, 33, 67, 113, 87, 94, 88, 91, 13, 113, 82, 95, 20, 25, 85, 102, 87, 71, 47, 48, 24, 10, 94, 116, 30, 28, 81, 18, 30, 78, 64, 40, 32, 74, 17, 76, 20, 10, 29, 49, 36, 102, 105, 82, 86, 74, 48, 21, 82, 72, 68, 114, 12, 95, 41, 72, 72, 26, 56, 3, 120, 88, 90, 79, 22, 51, 91, 31, 108, 111, 97, 90, 82, 31, 1, 66, 51, 113, 9, 37, 23, 118, 29, 81, 23, 50, 115, 42, 47, 68, 81, 19, 35, 112, 90, 40, 64, 95, 66, 87, 83, 67, 9, 56, 75, 105, 69, 106, 69, 19, 41, 69, 57, 43, 24, 12, 23, 89, 69, 82, 16, 3, 107, 53, 119, 28, 53, 61, 86, 37, 110, 102, 110, 52, 105, 49, 78, 4, 111, 115, 16, 94, 6, 35, 118, 4, 93, 42, 97, 85, 72, 59, 82, 26, 29, 81, 42, 83, 64, 97, 105, 102, 19, 89, 95, 48, 78, 65, 115, 41, 40, 73, 50, 63, 87, 39, 16, 51, 4, 53, 9, 103, 84, 58, 10, 4, 120, 60, 28, 21, 88, 3, 20, 35, 106, 95, 59, 70, 54, 74, 28, 119, 2, 13, 110, 97, 37, 21, 33, 60, 52, 108, 18, 90, 26, 118, 19, 9, 48, 51, 36, 87, 30, 14, 11, 112, 40, 11, 21, 104, 78, 5, 95, 77, 26, 50, 70, 82, 28, 111, 84, 61, 82, 104, 89, 88, 113, 14, 11, 57, 54, 19, 91, 108, 49, 47, 95, 95, 23, 70, 25, 101, 13, 106, 70, 118, 109, 68, 92, 97, 32, 41, 20, 110, 45, 111, 4, 77, 97, 105, 99, 9, 5, 82, 114, 82, 52, 85, 43, 87, 85, 59, 82, 86, 4, 36, 111, 120, 41, 92, 104, 112, 62, 112, 112, 47, 12, 56, 71, 24, 29, 115, 16, 6, 67, 53, 29, 15, 11, 79, 46, 13, 100, 77, 5, 87, 92, 119, 53, 12, 85, 98, 67, 119, 120, 106, 11, 93, 50, 36, 27, 100, 30, 2, 98, 7, 26, 29, 26, 66, 2, 34, 111, 1, 25, 41, 36, 103, 48, 71, 63, 93, 84, 29, 51, 86, 56, 73, 31, 101, 75, 1, 2, 37, 101, 5, 43, 75, 78, 53, 16, 106, 78, 19, 30, 105, 46, 15, 58, 119, 73, 80, 113, 88, 30, 66, 55, 22, 115, 43, 120, 4, 47, 102, 90, 39, 89, 17, 112, 16, 43, 14, 102, 111, 51, 27, 17, 19, 118, 12, 2, 19, 93, 62, 15, 72, 70, 113, 93, 4, 79, 88, 111, 5, 95, 81, 11, 118, 98, 75, 2, 51, 109, 110, 110, 92, 64, 64, 85, 109, 117, 110, 47, 13, 53, 63, 9, 117, 21, 55, 87, 52, 83, 8, 113, 88, 27, 7, 90, 9, 120, 22, 78, 113, 23, 110, 29, 90, 100, 87, 72, 73, 84, 60, 28, 31, 59, 41, 39, 56, 117, 19, 93, 69, 118, 45, 66, 92, 106, 73, 90, 29, 63, 2, 98, 64, 47, 100, 68, 31, 3, 15, 103, 98, 40, 84, 13, 113, 70, 79, 79, 118, 7, 31, 71, 34, 51, 96, 90, 93, 50, 41, 7, 31, 22, 111, 106, 62, 100, 2, 13, 9, 91, 20, 103, 55, 75, 105, 77, 97, 70, 89, 40, 57, 10, 85, 67, 74, 93, 9, 6, 40, 64, 51, 86, 84, 96, 52, 27, 33, 2, 81, 103, 120, 80, 27, 109, 28, 18, 103, 40, 64, 29, 89, 9, 74, 73, 39, 34, 103, 15, 94, 5, 37, 38, 3, 72, 88, 102, 38, 113, 30, 103, 30, 84, 53, 40, 36, 119, 34, 11, 87, 29, 13, 91, 82, 42, 103, 12, 97, 11, 59, 56, 110, 54, 29, 14, 26, 66, 6, 75, 92, 9, 28, 76, 37, 90, 52, 27, 40, 20, 116, 71, 12, 108, 78, 20, 19, 32, 83, 63, 45, 93, 67, 84, 62, 99, 75, 55, 45, 99, 62, 12, 55, 50, 57, 31, 79, 61, 73, 105, 72, 92, 43, 84, 53, 17, 36, 25, 32, 62, 107, 106, 92, 104, 78, 82, 93, 60, 76, 75, 73, 57, 38, 96, 80, 28, 75, 117, 103, 17, 68, 7, 58, 67, 120, 20, 120, 115, 58, 104, 54, 10, 22, 91, 46, 27, 47, 50, 114, 91, 116, 9, 104, 28, 93, 34, 93, 43, 96, 82, 111, 31, 65, 90, 21, 70, 60, 16, 119, 67, 10, 9, 56, 107, 30, 44, 95, 99, 9, 91, 65, 59, 89, 49, 59, 92, 98, 4, 68, 30, 80, 1, 65, 65, 90, 84, 38, 85, 101, 117, 74, 90, 81, 91, 30, 116, 117, 53, 35, 51, 4, 36, 13, 88, 51, 17, 96, 13, 2, 57, 52, 114, 101, 59, 31, 26, 111, 81, 43, 117, 34, 22, 76, 63, 82, 38, 44, 69, 52, 70, 33, 79, 77, 102, 104, 68, 90, 74, 45, 50, 21, 29, 94, 45, 41, 69, 95, 24, 16, 18, 84, 83, 20, 94, 25, 54, 4, 49, 106, 54, 109, 64, 97, 56, 42, 75, 78, 92, 44, 67, 75, 95, 62, 46, 37, 108, 118, 31, 16, 51, 107, 58, 68, 95, 100, 2, 89, 65, 87, 89, 118, 90, 103, 97, 118, 102, 117, 49, 44, 1, 16, 66, 60, 28, 113, 22, 93, 32, 55, 79, 15, 106, 59, 92, 51, 90, 106, 107, 90, 113, 109, 79, 37, 114, 102, 64, 33, 114, 87, 119, 14, 37, 1, 5, 110, 72, 106, 64, 51, 69, 120, 43, 65, 100, 22, 97, 109, 50, 55, 7, 99, 92, 109, 56, 41, 105, 70, 82, 46, 108, 64, 57, 103, 86, 54, 69, 34, 34, 55, 73, 77, 101, 34, 67, 6, 78, 22, 16, 23, 26, 69, 17, 83, 112, 74, 46, 45, 87, 60, 80, 51, 95, 86, 41, 31, 38, 42, 90, 28, 117, 52, 115, 10, 8, 88, 30, 110, 37, 82, 14, 25, 48, 59, 108, 45, 15, 18, 71, 37, 95, 69, 57, 65, 22, 46, 32, 23, 64, 96, 96, 26, 63, 68, 60, 57, 35, 32, 70, 36, 69, 35, 119, 64, 56, 69, 89, 26, 110, 111, 7, 84, 117, 35, 4, 28, 15, 6, 51, 61, 18, 59, 36, 33, 54, 45, 72, 116, 90, 75, 42, 108, 111, 65, 73, 104, 97, 75, 96, 4, 118, 108, 10, 61, 92, 2, 34, 25, 93, 19, 110, 9, 26, 27, 84, 67, 106, 89, 13, 8, 18, 19, 67, 49, 50, 48, 40, 66, 34, 9, 64, 50, 101, 75, 22, 41, 25, 80, 34, 119, 4, 11, 20, 71, 33, 35, 84, 108, 103, 87, 15, 53, 11, 70, 75, 35, 60, 60, 88, 31, 68, 23, 18, 9, 4, 48, 97, 73, 33, 95, 110, 120, 97, 29, 91, 89, 111, 75, 107, 12, 2, 26, 98, 111, 62, 74, 22, 19, 74, 82, 29, 6, 59, 89, 103, 64, 55, 8, 26, 116, 27, 19, 66, 64, 81, 24, 47, 44, 24, 48, 48, 109, 110, 35, 7, 41, 29, 95, 59, 119, 117, 77, 25, 25, 1, 5, 73, 93, 87, 95, 21, 113, 41, 13, 4, 13, 103, 25, 34, 89, 66, 5, 120, 71, 57, 56, 114, 86, 10, 111, 12, 67, 77, 102, 86, 91, 85, 23, 24, 46, 40, 25, 110, 58, 13, 116, 82, 96, 112, 90, 24, 3, 100, 41, 48, 116, 6, 43, 70, 35, 119, 43, 46, 49, 37, 17, 23, 62, 47, 70, 108, 76, 87, 8, 20, 84, 51, 77, 101, 60, 114, 85, 32, 56, 56, 95, 70, 61, 29, 101, 92, 21, 11, 87, 95, 110, 22, 92, 106, 77, 90, 74, 74, 67, 97, 105, 28, 37, 110, 12, 96, 93, 63, 93, 75, 102, 58, 57, 56, 45, 53, 58, 43, 117, 90, 79, 38, 10, 100, 77, 54, 102, 46, 89, 83, 16, 60, 51, 10, 24, 103, 33, 74, 74, 106, 107, 115, 119, 12, 8, 41, 5, 31, 109, 24, 113, 76, 101, 53, 92, 55, 112, 43, 67, 117, 39, 11, 113, 83, 59, 91, 21, 91, 72, 9, 107, 3, 44, 54, 100, 64, 34, 34, 62, 73, 115, 98, 113, 80, 35, 84, 75, 20, 53, 21, 35, 72, 91, 97, 17, 117, 106, 1, 75, 103, 99, 3, 79, 76, 90, 41, 110, 112, 85, 51, 91, 1, 56, 95, 29, 116, 37, 54, 26, 81, 6, 29, 115, 44, 19, 67, 106, 48, 40, 120, 4, 113, 24, 68, 85, 113, 85, 28, 58, 88, 64, 101, 44, 65, 67, 38, 13, 62, 84, 78, 112, 96, 57, 51, 56, 99, 24, 9, 98, 97, 32, 98, 100, 27, 82, 93, 76, 88, 101, 7, 29, 111, 120, 25, 101, 64, 27, 110, 116, 68, 38, 63, 66, 22, 99, 109, 38, 105, 9, 54, 86, 54, 85, 46, 85, 59, 50, 105, 117, 38, 8, 49, 42, 1, 76, 56, 28, 75, 12, 68, 4, 25, 77, 66, 80, 87, 60, 33, 62, 44, 3, 80, 56, 91, 47, 55, 44, 25, 41, 97, 100, 119, 118, 88, 29, 102, 55, 115, 90, 37, 78, 104, 109, 43, 32, 48, 55, 62, 9, 46, 94, 18, 43, 55, 114, 11, 55, 14, 85, 71, 52, 106, 25, 110, 88, 69, 90, 86, 26, 71, 11, 21, 40, 88, 58, 32, 10, 97, 20, 45, 83, 29, 49, 23, 30, 93, 104, 68, 10, 31, 15, 105, 39, 43, 102, 34, 103, 81, 113, 11, 33, 22, 67, 76, 119, 37, 34, 61, 70, 105, 13, 104, 102, 65, 56, 40, 76, 3, 95, 85, 13, 10, 74, 21, 53, 21, 63, 10, 74, 114, 54, 106, 113, 116, 54, 73, 93, 103, 98, 109, 114, 10, 70, 97, 68, 9, 10, 27, 74, 40, 2, 93, 58, 51, 89, 24, 72, 56, 23, 32, 117, 95, 101, 108, 20, 114, 117, 51, 54, 73, 99, 58, 21, 6, 11, 8, 94, 15, 62, 20, 24, 108, 83, 42, 110, 43, 14, 71, 107, 87, 39, 105, 44, 70, 67, 19, 81, 5, 30, 104, 98, 90, 28, 27, 37, 52, 75, 42, 29, 35, 115, 99, 14, 83, 102, 53, 29, 3, 11, 6, 102, 109, 109, 63, 80, 60, 68, 48, 93, 67, 70, 85, 67, 12, 93, 39, 115, 29, 51, 51, 118, 56, 29, 102, 102, 38, 99, 3, 110, 98, 100, 75, 82, 27, 80, 39, 39, 22, 92, 57, 117, 118, 85, 118, 115, 86, 25, 47, 107, 68, 65, 48, 41, 92, 100, 105, 31, 60, 41, 28, 90, 107, 79, 35, 32, 77, 38, 85, 67, 42, 50, 77, 1, 92, 29, 99, 33, 43, 33, 79, 42, 45, 23, 26, 79, 36, 2, 50, 101, 29, 24, 86, 117, 30, 93, 75, 56, 47, 38, 29, 32, 19, 40, 81, 107, 87, 17, 83, 41, 115, 35, 24, 13, 34, 73, 120, 25, 80, 114, 17, 58, 28, 119, 70, 27, 30, 5, 7, 29, 109, 11, 9, 13, 12, 19, 32, 79, 101, 17, 78, 116, 96, 43, 45, 60, 106, 76, 19, 98, 40, 27, 27, 8, 84, 10, 118, 6, 110, 104, 69, 40, 17, 54, 2, 79, 67, 85, 108, 54, 34, 55, 31, 18, 33, 37, 77, 95, 30, 91, 86, 85, 19, 51, 92, 10, 8, 8, 91, 34, 100, 75, 22, 20, 66, 23, 106, 103, 93, 54, 21, 36, 23, 68, 84, 117, 12, 56, 41, 3, 75, 61, 14, 63, 39, 17, 77, 88, 47, 21, 72, 64, 71, 64, 25, 64, 69, 64, 115, 49, 19, 84, 78, 10, 47, 60, 80, 68, 38, 48, 76, 99, 25, 16, 71, 69, 120, 24, 88, 75, 3, 52, 47, 4, 89, 23, 65, 110, 102, 107, 26, 95, 20, 114, 68, 50, 23, 32, 114, 39, 8, 70, 49, 89, 3, 65, 55, 19, 49, 89, 55, 19, 20, 17, 85, 71, 91, 110, 67, 110, 8, 65, 34, 44, 5, 41, 52, 104, 35, 58, 53, 92, 35, 71, 37, 43, 42, 70, 50, 102, 46, 15, 118, 59, 36, 116, 63, 12, 72, 40, 42, 120, 79, 105, 43, 55, 72, 77, 115, 65, 53, 75, 5, 24, 45, 95, 40, 98, 114, 119, 67, 36, 15, 95, 28, 15, 35, 95, 93, 19, 54, 37, 76, 50, 80, 34, 112, 13, 64, 84, 79, 58, 83, 9, 70, 95, 36, 105, 114, 117, 5, 100, 74, 45, 93, 60, 3, 117, 5, 111, 86, 38, 65, 80, 30, 9, 76, 29, 97, 28, 26, 48, 32, 29, 2, 78, 4, 75, 50, 100, 46, 93, 81, 75, 70, 10, 97, 69, 13, 106, 95, 23, 100, 120, 2, 18, 93, 31, 75, 77, 12, 27, 100, 109, 91, 104, 11, 27, 46, 28, 66, 10, 85, 76, 12, 66, 66, 58, 48, 110, 10, 90, 80, 4, 108, 57, 53, 118, 46, 19, 91, 34, 36, 103, 82, 14, 4, 102, 97, 31, 20, 108, 9, 74, 34, 104, 82, 66, 116, 36, 22, 36, 107, 51, 30, 117, 105, 46, 108, 22, 58, 14, 8, 112, 35, 106, 115, 75, 9, 51, 11, 86, 50, 83, 75, 30, 73, 11, 113, 95, 32, 94, 39, 56, 119, 31, 62, 103, 43, 76, 65, 103, 27, 40, 102, 66, 51, 1, 103, 98, 28, 103, 58, 84, 71, 54, 91, 65, 46, 6, 53, 66, 63, 61, 61, 80, 7, 117, 64, 108, 67, 53, 31, 115, 70, 82, 120, 88, 17, 7, 46, 79, 26, 103, 48, 76, 34, 66, 84, 44, 82, 39, 38, 70, 115, 53, 93, 70, 79, 76, 110, 97, 83, 101, 62, 91, 57, 42, 68, 4, 106, 94, 89, 81, 94, 14, 120, 75, 33, 63, 79, 24, 73, 94, 46, 50, 71, 9, 34, 112, 67, 116, 109, 69, 70, 72, 109, 63, 108, 68, 82, 24, 90, 52, 33, 7, 77, 4, 66, 89, 30, 100, 84, 82, 99, 89, 116, 35, 26, 9, 63, 45, 47, 99, 118, 67, 42, 115, 84, 108, 33, 34, 24, 88, 26, 41, 118, 120, 78, 49, 89, 108, 82, 81, 55, 88, 16, 44, 100, 1, 95, 95, 59, 56, 22, 10, 44, 103, 92, 98, 87, 113, 25, 57, 31, 95, 4, 81, 78, 32, 111, 23, 54, 67, 69, 61, 39, 25, 90, 23, 31, 109, 49, 11, 43, 49, 39, 33, 11, 61, 119, 60, 75, 83, 78, 16, 36, 112, 40, 43, 59, 21, 41, 59, 46, 24, 117, 55, 120, 88, 108, 72, 16, 91, 25, 61, 66, 67, 32, 97, 102, 103, 117, 25, 17, 54, 113, 86, 29, 44, 91, 84, 107, 54, 51, 96, 119, 99, 82, 96, 69, 51, 17, 25, 3, 24, 71, 86, 43, 16, 3, 25, 63, 98, 85, 17, 58, 98, 42, 5, 60, 108, 29, 69, 89, 88, 102, 81, 6, 66, 92, 110, 70, 30, 79, 77, 88, 87, 2, 41, 101, 77, 3, 118, 28, 68, 108, 30, 60, 24, 84, 37, 81, 28, 53, 63, 62, 30, 28, 64, 70, 34, 3, 55, 73, 116, 77, 103, 6, 55, 34, 93, 116, 52, 88, 36, 74, 46, 89, 115, 112, 79, 7, 23, 41, 21, 100, 39, 104, 43, 52, 18, 13, 27, 73, 73, 3, 77, 25, 54, 101, 50, 49, 12, 75, 24, 62, 31, 2, 95, 39, 42, 118, 79, 100, 107, 10, 7, 112, 51, 75, 25, 3, 67, 62, 109, 2, 116, 118, 22, 117, 58, 120, 94, 47, 87, 48, 26, 115, 78, 9, 19, 36, 86, 95, 100, 94, 63, 73, 65, 102, 24, 51, 108, 63, 60, 77, 21, 88, 15, 115, 47, 90, 55, 64, 80, 10, 108, 14, 58, 88, 40, 42, 53, 62, 99, 98, 104, 12, 35, 14, 40, 56, 105, 16, 18, 1, 23, 26, 112, 55, 35, 97, 71, 66, 120, 21, 53, 112, 87, 26, 83, 24, 46, 27, 99, 115, 54, 79, 51, 75, 54, 6, 115, 110, 17, 2, 22, 99, 62, 14, 18, 118, 94, 102, 25, 96, 105, 6, 65, 67, 60, 86, 8, 113, 92, 86, 42, 82, 20, 48, 80, 53, 117, 69, 40, 55, 62, 102, 83, 61, 9, 8, 36, 12, 73, 96, 43, 26, 18, 83, 61, 66, 63, 63, 99, 63, 101, 22, 47, 40, 19, 49, 70, 55, 62, 68, 43, 58, 109, 102, 84, 43, 37, 107, 60, 53, 10, 85, 33, 16, 102, 48, 17, 93, 36, 4, 46, 56, 36, 26, 95, 114, 91, 72, 15, 64, 103, 70, 42, 27, 66, 24, 24, 96, 73, 52, 73, 2, 81, 87, 45, 70, 67, 20, 100, 17, 88, 92, 52, 13, 66, 14, 111, 47, 32, 20, 2, 115, 9, 16, 113, 69, 109, 14, 104, 17, 30, 81, 62, 29, 62, 12, 71, 46, 55, 38, 75, 104, 80, 116, 58, 57, 4, 67, 50, 20, 94, 109, 21, 26, 84, 22, 77, 104, 117, 65, 89, 98, 118, 81, 73, 22, 68, 104, 72, 98, 61, 6, 84, 53, 90, 17, 56, 94, 15, 67, 119, 112, 86, 64, 52, 20, 98, 101, 101, 20, 16, 93, 118, 55, 13, 79, 11, 10, 11, 63, 47, 93, 54, 116, 95, 112, 5, 107, 20, 15, 36, 36, 40, 83, 3, 26, 78, 116, 14, 21, 19, 87, 4, 27, 62, 13, 90, 82, 13, 91, 1, 35, 30, 74, 13, 8, 86, 3, 7, 72, 38, 34, 24, 104, 49, 104, 31, 95, 11, 94, 66, 66, 71, 51, 19, 45, 98, 116, 38, 51, 120, 29, 70, 58, 23, 74, 73, 43, 28, 86, 56, 62, 77, 64, 8, 118, 5, 45, 80, 83, 12, 56, 84, 9, 25, 108, 3, 59, 53, 72, 43, 106, 6, 91, 90, 120, 100, 23, 95, 76, 36, 15, 49, 9, 2, 97, 50, 66, 64, 107, 26, 30, 72, 83, 20, 48, 85, 21, 24, 102, 113, 73, 38, 112, 40, 76, 19, 27, 111, 33, 111, 76, 115, 52, 42, 107, 103, 109, 6, 6, 38, 30, 2, 37, 35, 20, 115, 99, 46, 65, 100, 83, 96, 101, 102, 115, 24, 4, 80, 84, 77, 101, 118, 62, 100, 96, 45, 115, 18, 94, 57, 85, 103, 42, 76, 23, 31, 86, 75, 45, 73, 112, 81, 23, 58, 52, 57, 14, 101, 9, 79, 17, 7, 18, 94, 57, 29, 78, 65, 45, 87, 13, 12, 7, 8, 10, 32, 35, 76, 46, 62, 111, 3, 50, 72, 66, 47, 78, 117, 42, 59, 1, 68, 27, 119, 30, 76, 22, 17, 73, 99, 5, 63, 24, 106, 56, 35, 62, 113, 67, 73, 26, 97, 116, 10, 39, 6, 40, 94, 105, 56, 90, 97, 43, 3, 88, 58, 112, 111, 102, 117, 103, 37, 27, 76, 107, 73, 79, 117, 106, 3, 84, 31, 18, 67, 66, 2, 104, 81, 107, 24, 61, 20, 59, 115, 106, 30, 88, 5, 52, 94, 9, 5, 24, 51, 88, 14, 97, 101, 98, 93, 65, 78, 54, 72, 27, 87, 109, 65, 69, 29, 31, 102, 55, 30, 116, 79, 78, 12, 109, 16, 35, 101, 16, 79, 25, 53, 88, 75, 32, 99, 1, 35, 39, 9, 38, 66, 61, 62, 86, 96, 31, 32, 42, 54, 98, 74, 36, 106, 63, 22, 55, 94, 41, 4, 93, 72, 116, 35, 21, 82, 3, 19, 59, 93, 57, 15, 26, 5, 76, 46, 19, 95, 72, 105, 115, 41, 93, 12, 53, 3, 10, 76, 80, 10, 45, 96, 78, 71, 6, 53, 113, 82, 36, 118, 1, 26, 102, 24, 8, 56, 87, 26, 22, 80, 101, 79, 102, 65, 104, 12, 35, 107, 75, 61, 98, 106, 74, 48, 35, 47, 65, 25, 1, 77, 92, 118, 22, 43, 57, 77, 25, 5, 17, 63, 48, 4, 100, 46, 106, 48, 65, 112, 103, 1, 114, 90, 43, 49, 7, 88, 109, 99, 84, 92, 68, 24, 119, 76, 80, 7, 109, 102, 2, 104, 59, 108, 66, 69, 105, 113, 9, 7, 27, 101, 52, 41, 17, 109, 69, 5, 32, 11, 85, 48, 42, 116, 111, 54, 115, 71, 34, 118, 72, 7, 21, 47, 76, 97, 88, 86, 113, 80, 58, 114, 67, 82, 44, 64, 100, 86, 17, 91, 62, 70, 21, 66, 88, 116, 89, 71, 68, 13, 41, 90, 63, 25, 119, 81, 43, 51, 32, 111, 48, 116, 17, 3, 72, 45, 14, 50, 6, 96, 20, 48, 40, 16, 87, 103, 94, 117, 102, 69, 11, 35, 87, 114, 41, 109, 18, 63, 67, 112, 55, 40, 117, 11, 97, 116, 17, 110, 98, 104, 2, 50, 13, 112, 22, 90, 19, 7, 81, 16, 105, 56, 34, 73, 44, 89, 119, 33, 40, 94, 107, 80, 84, 44, 100, 16, 66, 96, 21, 7, 94, 74, 35, 83, 111, 26, 47, 47, 32, 37, 108, 106, 99, 30, 106, 106, 42, 19, 48, 110, 29, 101, 22, 92, 112, 35, 22, 43, 34, 73, 82, 77, 51, 95, 4, 37, 36, 68, 4, 109, 112, 1, 23, 42, 103, 78, 41, 50, 84, 96, 34, 3, 37, 80, 107, 52, 83, 65, 65, 62, 3, 8, 41, 112, 42, 61, 106, 6, 43, 7, 73, 9, 43, 9, 60, 107, 11, 92, 17, 61, 118, 62, 12, 3, 112, 64, 1, 15, 34, 97, 44, 44, 40, 6, 41, 52, 119, 42, 82, 52, 53, 13, 91, 55, 37, 101, 10, 96, 37, 9, 25, 103, 117, 32, 34, 32, 106, 55, 31, 55, 56, 100, 54, 81, 8, 45, 29, 120, 48, 8, 119, 119, 82, 37, 54, 59, 89, 105, 120, 107, 24, 67, 66, 23, 86, 15, 36, 7, 17, 114, 116, 109, 72, 49, 21, 80, 45, 3, 45, 11, 11, 88, 96, 46, 101, 2, 70, 93, 102, 22, 118, 100, 52, 58, 62, 116, 73, 83, 21, 68, 68, 119, 104, 103, 62, 64, 49, 4, 79, 40, 114, 45, 79, 10, 19, 87, 71, 36, 52, 94, 81, 104, 39, 35, 15, 97, 70, 112, 106, 86, 4, 84, 60, 31, 47, 101, 23, 56, 3, 112, 82, 86, 33, 96, 52, 63, 68, 50, 8, 115, 1, 96, 2, 90, 7, 37, 53, 58, 13, 18, 67, 63, 19, 61, 21, 43, 103, 21, 67, 10, 29, 116, 44, 8, 36, 111, 120, 101, 114, 69, 4, 27, 115, 89, 79, 53, 50, 49, 78, 64, 29, 113, 105, 72, 104, 100, 6, 74, 50, 93, 26, 111, 61, 22, 2, 88, 28, 46, 120, 83, 38, 101, 111, 100, 21, 53, 31, 28, 34, 44, 101, 98, 9, 21, 32, 101, 73, 60, 107, 36, 112, 75, 10, 25, 59, 62, 31, 60, 120, 42, 14, 38, 111, 48, 20, 33, 98, 55, 33, 62, 7, 40, 58, 48, 9, 10, 1, 59, 76, 113, 36, 43, 102, 5, 6, 77, 20, 82, 60, 39, 99, 67, 62, 101, 118, 102, 106, 77, 45, 93, 30, 106, 34, 47, 14, 28, 1, 79, 80, 98, 119, 51, 111, 19, 38, 28, 110, 7, 22, 52, 95, 106, 112, 95, 108, 66, 17, 62, 120, 74, 82, 5, 100, 31, 109, 47, 82, 20, 56, 34, 27, 26, 102, 108, 51, 6, 52, 8, 33, 74, 17, 11, 80, 46, 43, 93, 34, 24, 82, 58, 79, 102, 3, 45, 37, 92, 86, 83, 90, 89, 75, 62, 6, 41, 113, 83, 53, 95, 101, 46, 39, 68, 57, 61, 9, 80, 22, 117, 52, 41, 8, 44, 97, 6, 97, 106, 112, 70, 25, 116, 85, 68, 65, 34, 10, 70, 42, 111, 85, 82, 85, 84, 31, 102, 51, 1, 93, 34, 66, 83, 37, 120, 24, 103, 30, 51, 44, 119, 98, 112, 88, 31, 70, 48, 67, 104, 92, 77, 116, 55, 47, 52, 55, 2, 105, 61, 39, 91, 99, 111, 48, 31, 15, 7, 97, 112, 1, 80, 20, 88, 74, 59, 67, 23, 38, 4, 29, 49, 70, 61, 86, 76, 58, 35, 75, 16, 51, 61, 117, 29, 9, 7, 81, 21, 54, 97, 82, 65, 71, 111, 81, 70, 51, 93, 14, 52, 92, 28, 45, 51, 17, 93, 75, 113, 47, 18, 46, 77, 55, 103, 69, 67, 98, 116, 25, 40, 72, 120, 82, 48, 59, 1, 101, 93, 20, 2, 96, 16, 5, 118, 38, 32, 100, 100, 69, 43, 36, 49, 18, 19, 67, 52, 103, 84, 91, 92, 113, 66, 39, 30, 89, 118, 5, 49, 82, 60, 1, 93, 25, 114, 7, 98, 28, 63, 42, 71, 92, 118, 108, 117, 28, 65, 58, 100, 19, 51, 57, 31, 29, 68, 44, 107, 68, 83, 41, 104, 76, 8, 3, 91, 114, 79, 31, 22, 88, 72, 117, 2, 70, 47, 44, 24, 118, 29, 99, 112, 99, 36, 39, 16, 4, 53, 54, 59, 57, 60, 101, 43, 71, 62, 15, 98, 4, 111, 41, 9, 74, 106, 99, 9, 9, 5, 120, 47, 54, 61, 118, 18, 70, 49, 11, 73, 83, 39, 84, 80, 58, 19, 1, 106, 94, 39, 22, 68, 94, 110, 1, 39, 81, 79, 111, 71, 83, 99, 9, 109, 110, 71, 96, 101, 50, 117, 52, 81, 87, 63, 89, 83, 79, 70, 10, 9, 72, 96, 75, 21, 97, 45, 1, 63, 54, 83, 15, 65, 33, 51, 100, 81, 52, 77, 28, 20, 110, 29, 51, 94, 35, 117, 108, 81, 105, 9, 62, 120, 31, 4, 44, 98, 120, 6, 117, 1, 48, 79, 66, 31, 102, 49, 44, 31, 91, 101, 96, 79, 83, 85, 106, 9, 113, 49, 45, 76, 97, 66, 110, 24, 116, 51, 3, 60, 77, 65, 3, 33, 120, 68, 75, 85, 13, 82, 6, 104, 32, 57, 63, 71, 62, 91, 44, 65, 64, 91, 78, 63, 105, 47, 120, 49, 33, 91, 47, 49, 22, 4, 82, 12, 37, 118, 119, 106, 91, 107, 67, 71, 74, 50, 115, 79, 37, 63, 95, 31, 85, 102, 119, 2, 110, 111, 65, 110, 85, 1, 112, 97, 25, 95, 97, 59, 77, 111, 51, 53, 77, 114, 27, 15, 57, 71, 66, 57, 75, 22, 103, 22, 80, 113, 107, 101, 63, 117, 16, 89, 27, 105, 32, 1, 104, 48, 93, 56, 29, 34, 46, 79, 50, 120, 21, 79, 17, 57, 37, 13, 41, 49, 21, 35, 107, 86, 20, 29, 77, 33, 49, 85, 99, 13, 82, 97, 46, 33, 108, 104, 35, 28, 86, 22, 32, 90, 47, 62, 46, 89, 120, 46, 32, 75, 26, 98, 33, 89, 31, 81, 40, 7, 26, 16, 78, 5, 44, 35, 105, 115, 77, 61, 106, 10, 58, 40, 37, 74, 62, 116, 94, 71, 21, 77, 78, 36, 111, 91, 71, 96, 28, 68, 60, 40, 104, 105, 94, 103, 90, 57, 37, 86, 73, 39, 68, 19, 112, 35, 8, 12, 112, 34, 73, 56, 103, 92, 109, 75, 109, 11, 39, 73, 42, 74, 58, 85, 92, 71, 97, 119, 87, 58, 8, 46, 106, 20, 59, 67, 110, 107, 79, 53, 78, 86, 86, 105, 88, 80, 116, 22, 93, 16, 4, 73, 17, 26, 103, 49, 93, 69, 62, 80, 31, 34, 119, 60, 83, 47, 14, 78, 14, 33, 103, 72, 34, 91, 55, 109, 111, 37, 118, 105, 63, 38, 108, 110, 36, 9, 120, 2, 110, 93, 73, 74, 14, 55, 83, 118, 7, 88, 46, 102, 51, 46, 91, 79, 79, 106, 57, 65, 78, 35, 49, 63, 89, 31, 40, 63, 27, 39, 63, 30, 81, 63, 101, 50, 3, 68, 49, 103, 74, 96, 26, 116, 56, 72, 35, 53, 49, 7, 112, 20, 18, 23, 25, 45, 112, 81, 77, 81, 43, 85, 47, 81, 48, 5, 59, 119, 117, 97, 101, 75, 30, 97, 97, 30, 73, 27, 29, 82, 46, 70, 45, 106, 5, 45, 64, 82, 6, 58, 114, 76, 22, 81, 16, 2, 11, 36, 25, 18, 84, 53, 37, 81, 38, 108, 18, 27, 70, 73, 57, 120, 37, 116, 15, 71, 94, 87, 84, 105, 90, 62, 44, 14, 59, 67, 28, 40, 112, 108, 113, 68, 101, 112, 56, 17, 13, 22, 23, 76, 49, 22, 116, 18, 108, 19, 97, 87, 10, 103, 40, 16, 92, 37, 48, 110, 85, 70, 73, 51, 19, 70, 110, 74, 64, 11, 100, 83, 101, 44, 82, 83, 2, 77, 67, 60, 107, 91, 28, 115, 101, 39, 74, 15, 4, 67, 87, 105, 13, 55, 108, 1, 86, 27, 5, 76, 20, 95, 41, 42, 8, 3, 109, 19, 13, 29, 114, 71, 34, 33, 27, 73, 30, 103, 100, 92, 9, 57, 42, 3, 66, 12, 66, 13, 60, 96, 27, 119, 31, 49, 77, 72, 45, 29, 34, 3, 21, 47, 96, 73, 12, 81, 88, 85, 9, 76, 99, 97, 50, 98, 69, 101, 119, 24, 87, 44, 26, 48, 88, 79, 67, 9, 56, 112, 48, 90, 41, 89, 30, 25, 56, 73, 28, 49, 118, 79, 44, 7}, + 80001635, + }, + + { + []int{16, 16}, + 2, + }, + + { + []int{16, 17, 18}, + 2, + }, + + { + []int{20, 30, 100, 110, 120}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numFriendRequests(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numFriendRequests(tc.ages), "输入:%v", tc) + } +} + +func Benchmark_numFriendRequests(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numFriendRequests(tc.ages) + } + } +} diff --git a/Algorithms/0826.most-profit-assigning-work/README.md b/Algorithms/0826.most-profit-assigning-work/README.md new file mode 100755 index 000000000..db916b539 --- /dev/null +++ b/Algorithms/0826.most-profit-assigning-work/README.md @@ -0,0 +1,29 @@ +# [826. Most Profit Assigning Work](https://leetcode.com/problems/most-profit-assigning-work/) + +## 题目 + +We have jobs: difficulty[i]is the difficulty of theith job, andprofit[i]is the profit of theith job. + +Now we have some workers.worker[i]is the ability of theith worker, which means that this worker can only complete a job with difficulty at mostworker[i]. + +Every worker can be assigned at most one job, but one jobcan be completed multiple times. + +For example, if 3 people attempt the same job that pays $1, then the total profit will be $3. If a worker cannot complete any job, his profit is $0. + +What is the most profit we can make? + +Example 1: + +Input: difficulty = [2,4,6,8,10], profit = [10,20,30,40,50], worker = [4,5,6,7] +Output: 100 +Explanation: Workers are assigned jobs of difficulty [4,4,6,6] and they get profit of [20,20,30,30] seperately. + +Notes: + +1. 1 <= difficulty.length = profit.length <= 10000 +1. 1 <= worker.length <= 10000 +1. difficulty[i], profit[i], worker[i] are in range[1, 10^5] + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work.go b/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work.go new file mode 100755 index 000000000..bd6a85191 --- /dev/null +++ b/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work.go @@ -0,0 +1,47 @@ +package problem0826 + +import ( + "sort" +) + +func maxProfitAssignment(difficulty []int, profit []int, worker []int) int { + jobs := make([]job, len(difficulty)) + for i := range difficulty { + jobs[i] = job{ + d: difficulty[i], + p: profit[i], + } + } + sort.Slice(jobs, func(i int, j int) bool { + return jobs[i].d < jobs[j].d + }) + + sort.Ints(worker) + + res := 0 + i := 0 + maxp := 0 + for _, ability := range worker { + for i < len(jobs) && ability >= jobs[i].d { + maxp = max(maxp, jobs[i].p) + i++ + } + // 由于 jobs 按照 difficulty 的升序排列 + // 由于 worker 按照 ability 的升序排列 + // 所以,此时 maxp 代表了此 worker 所能完成的工作中,能获取的最大收益 + res += maxp + } + + return res +} + +type job struct { + d, p int +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work_test.go b/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work_test.go new file mode 100755 index 000000000..6dac2a2d0 --- /dev/null +++ b/Algorithms/0826.most-profit-assigning-work/most-profit-assigning-work_test.go @@ -0,0 +1,50 @@ +package problem0826 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + difficulty []int + profit []int + worker []int + ans int +}{ + + { + []int{2, 4, 6, 8, 10}, + []int{50, 20, 30, 40, 50}, + []int{4, 5, 6, 7}, + 200, + }, + + { + []int{2, 4, 6, 8, 10}, + []int{10, 20, 30, 40, 50}, + []int{4, 5, 6, 7}, + 100, + }, + + // 可以有多个 testcase +} + +func Test_maxProfitAssignment(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxProfitAssignment(tc.difficulty, tc.profit, tc.worker), "输入:%v", tc) + } +} + +func Benchmark_maxProfitAssignment(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxProfitAssignment(tc.difficulty, tc.profit, tc.worker) + } + } +} diff --git a/Algorithms/0827.making-a-large-island/README.md b/Algorithms/0827.making-a-large-island/README.md new file mode 100755 index 000000000..cf26de4fe --- /dev/null +++ b/Algorithms/0827.making-a-large-island/README.md @@ -0,0 +1,40 @@ +# [827. Making A Large Island](https://leetcode.com/problems/making-a-large-island/) + +## 题目 + +In a 2D grid of 0s and 1s, we change at most one 0 to a 1. + +After, what is the size of the largest island?(An island is a 4-directionally connected group of 1s). + +Example 1: + +```text +Input: [[1, 0], [0, 1]] +Output: 3 +Explanation: Change one 0 to 1 and connect two 1s, then we get an island with area = 3. +``` + +Example 2: + +```text +Input: [[1, 1], [1, 0]] +Output: 4 +Explanation: Change the 0 to 1 and make the island bigger, only one island with area = 1. +``` + +Example 3: + +```text +Input: [[1, 1], [1, 1]] +Output: 4 +Explanation: Can't change any 0 to 1, only one island with area = 1. +``` + +Notes: + +1. 1 <= grid.length = grid[0].length <= 50. +1. 0 <= grid[i][j] <= 1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0827.making-a-large-island/making-a-large-island.go b/Algorithms/0827.making-a-large-island/making-a-large-island.go new file mode 100755 index 000000000..403de68d3 --- /dev/null +++ b/Algorithms/0827.making-a-large-island/making-a-large-island.go @@ -0,0 +1,100 @@ +package problem0827 + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +func largestIsland(grid [][]int) int { + m, n := len(grid), len(grid[0]) + + // 收集 grid 中的 0 + zeros := collectZero(grid) + if len(zeros) <= 1 { + return m * n + } + + colors := addColor(grid) + + res := 0 + + for _, z := range zeros { + i, j := z[0], z[1] + isConnected := make([]bool, len(colors)) + temp := 1 + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] > 1 && !isConnected[grid[x][y]] { + temp += colors[grid[x][y]] + isConnected[grid[x][y]] = true + } + } + res = max(res, temp) + } + + return res +} + +func collectZero(grid [][]int) [][]int { + res := make([][]int, 0, len(grid)) + for i := range grid { + for j := range grid[i] { + if grid[i][j] == 0 { + res = append(res, []int{i, j}) + } + } + } + return res +} + +// 返回每种色彩的数量 +func addColor(grid [][]int) []int { + m, n := len(grid), len(grid[0]) + res := make([]int, 2, m) + color := 2 + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + if grid[i][j] == 1 { + res = append(res, bfs(i, j, color, grid)) + color++ + } + } + } + + return res +} + +func bfs(i, j, color int, grid [][]int) int { + m, n := len(grid), len(grid[0]) + queue := [][]int{[]int{i, j}} + grid[i][j] = color + res := 1 + + for len(queue) > 0 { + next := queue[0] + queue = queue[1:] + i, j := next[0], next[1] + for k := 0; k < 4; k++ { + x := i + dx[k] + y := j + dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] == 1 { + queue = append(queue, []int{x, y}) + grid[x][y] = color + res++ + } + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0827.making-a-large-island/making-a-large-island_test.go b/Algorithms/0827.making-a-large-island/making-a-large-island_test.go new file mode 100755 index 000000000..853dd6525 --- /dev/null +++ b/Algorithms/0827.making-a-large-island/making-a-large-island_test.go @@ -0,0 +1,64 @@ +package problem0827 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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, 1}}, + 3, + }, + + { + [][]int{{1, 1}, {1, 0}}, + 4, + }, + + { + [][]int{{1, 1}, {1, 1}}, + 4, + }, + + { + [][]int{ + {1, 1, 1, 1}, + {1, 1, 1, 0}, + {1, 1, 0, 0}, + {1, 0, 0, 1}, + }, + 11, + }, + + // 可以有多个 testcase +} + +func Test_largestIsland(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largestIsland(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_largestIsland(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestIsland(tc.grid) + } + } +} diff --git a/Algorithms/0828.unique-letter-string/README.md b/Algorithms/0828.unique-letter-string/README.md new file mode 100755 index 000000000..99c793b40 --- /dev/null +++ b/Algorithms/0828.unique-letter-string/README.md @@ -0,0 +1,74 @@ +# [828. Unique Letter String](https://leetcode.com/problems/unique-letter-string/) + +## 题目 + +A character is unique in string S if it occurs exactly once in it. + +For example, in string S = "LETTER", the only unique characters are "L" and "R". + +Let's define UNIQ(S) as the number of unique characters in string S. + +For example, UNIQ("LETTER") = 2. + +Given a string S with only uppercases, calculate the sum of UNIQ(substring) over all non-empty substrings of S. + +If there are two or more equal substrings at different positions in S, we consider them different. + +Since the answer can be very large, retrun the answermodulo `10^9+7`. + +Example 1: + +```text +Input: "ABC" +Output: 10 +Explanation: All possible substrings are: "A","B","C","AB","BC" and "ABC". +Evey substring is composed with only unique letters. +Sum of lengths of all substring is 1 + 1 + 1 + 2 + 2 + 3 = 10 +``` + +Example 2: + +```text +Input: "ABA" +Output: 8 +Explanation: The same as example 1, except uni("ABA") = 1. +``` + +Note: 0 <= S.length <= 10000. + +## 解题思路 + +from + +Intuition: + +Let's think about how a character can be found as a unique character. + +Think about string "XAXAXXAX" and focus on making the second "A" a unique character. +We can take "XA(XAXX)AX" and between "()" is our substring. +We can see here, to make the second "A" counted as a uniq character, we need to: + +insert "(" somewhere between the first and second A +insert ")" somewhere between the second and third A +For step 1 we have "A(XA" and "AX(A", 2 possibility. +For step 2 we have "A)XXA", "AX)XA" and "AXX)A", 3 possibilities. + +So there are in total 2 * 3 = 6 ways to make the second A a unique character in a substring. +In other words, there are only 6 substring, in which this A contribute 1 point as unique string. + +Instead of counting all unique characters and struggling with all possible substrings, +we can count for every char in S, how many ways to be found as a unique char. +We count and sum, and it will be out answer. + +Explanation: + +index[26][2] record last two occurrence index for every upper characters. +Initialise all values in index to -1. +Loop on string S, for every character c, update its last two occurrence index to index[c]. +Count when loop. For example, if "A" appears twice at index 3, 6, 9 seperately, we need to count: +For the first "A": (6-3) * (3-(-1))" +For the second "A": (9-6) * (6-3)" +For the third "A": (N-9) * (9-6)" +Complexity: +One pass, time complexity O(N). +Space complexity O(1). \ No newline at end of file diff --git a/Algorithms/0828.unique-letter-string/unique-letter-string.go b/Algorithms/0828.unique-letter-string/unique-letter-string.go new file mode 100755 index 000000000..fb4f342e9 --- /dev/null +++ b/Algorithms/0828.unique-letter-string/unique-letter-string.go @@ -0,0 +1,35 @@ +package problem0828 + +const module = 1e9 + 7 + +func uniqueLetterString(s string) int { + size := len(s) + if size == 0 { + return 0 + } + + index := [26][]int{} + for i := range index { + index[i] = make([]int, 0, size) + } + + for i, b := range s { + index[b-'A'] = append(index[b-'A'], i) + } + + res := 0 + for i := range index { + if len(index[i]) == 0 { + continue + } + index[i] = append(index[i], size) + a, b, c := 0, -1, index[i][0] + for j := 1; j < len(index[i]); j++ { + a, b, c = b, c, index[i][j] + res += ((b - a) * (c - b)) % module + res %= module + } + } + + return res +} diff --git a/Algorithms/0828.unique-letter-string/unique-letter-string_test.go b/Algorithms/0828.unique-letter-string/unique-letter-string_test.go new file mode 100755 index 000000000..557d74dca --- /dev/null +++ b/Algorithms/0828.unique-letter-string/unique-letter-string_test.go @@ -0,0 +1,64 @@ +package problem0828 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "DELQGVWNZKIJJPSXOVWWIZUXCEGWSQLESNSRBMKZARFPAXSVWQEZDENDAHNNIBHGHTFDLPGDLFXMIYRFNLMXHNPIFUAXINXPXLCTTJNLGGMKJIOEWBECNOFQPVCIKIAZMNGHEHFMCPWSMJTMGVSXTOGCGUYKFMNCGLCBRAFJLJVPIVDOLJBURULPGXBVDCEWXXXLTRMSHPKSPFDGNVOCZWDXJUWVNAREDOKTZMIUDKDQWWWSAEUUDBHMWZELOSBIHMAYJEMGZPMDOOGSCKLVHTGMETHUISCLJKDOQEWGVBULEMUXGTRKGXYFDIZTZWMLOFTCANBGUARNWQEQWGMIKMORVQUZANJNRNPMJWYLVHWKDFLDDBBMILAKGFROEQAMEVONUVHOHGPKLBPNYZFPLXNBCIFENCGIMIDCXIIQJWPVVCOCJTSKSHVMQJNLHSQTEZQTTMOXUSKBMUJEJDBJQNXECJGSZUDENJCPTTSREKHPRIISXMWBUGMTOVOTRKQCFSDOTEFPSVQINYLHXYVZTVAMWGPNKIDLOPGAMWSKDXEPLPPTKUHEKBQAWEBMORRZHBLOGIYLTPMUVBPGOOOIEBJEGTKQKOUURHSEJCMWMGHXYIAOGKJXFAMRLGTPNSLERNOHSDFSSFASUJTFHBDMGBQOKZRBRAZEQQVWFRNUNHBGKRFNBETEDJIWCTUBJDPFRRVNZENGRANELPHSDJLKVHWXAXUTMPWHUQPLTLYQAATEFXHZARFAUDLIUDEHEGGNIYICVARQNRJJKQSLXKZZTFPVJMOXADCIGKUXCVMLPFJGVXMMBEKQXFNXNUWOHCSZSEZWZHDCXPGLROYPMUOBDFLQMTTERGSSGVGOURDWDSEXONCKWHDUOVDHDESNINELLCTURJHGCJWVIPNSISHRWTFSFNRAHJAJNNXKKEMESDWGIYIQQRLUUADAXOUEYURQRVZBCSHXXFLYWFHDZKPHAGYOCTYGZNPALAUZSTOU", + 629134, + }, + + { + "", + 0, + }, + + { + "BABABBABAA", + 35, + }, + + { + "AAA", + 3, + }, + + { + "ABC", + 10, + }, + + { + "ABA", + 8, + }, + + // 可以有多个 testcase +} + +func Test_uniqueLetterString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, uniqueLetterString(tc.S), "输入:%v", tc) + } +} + +func Benchmark_uniqueLetterString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + uniqueLetterString(tc.S) + } + } +} diff --git a/Algorithms/0829.consecutive-numbers-sum/README.md b/Algorithms/0829.consecutive-numbers-sum/README.md new file mode 100755 index 000000000..c5ecdb939 --- /dev/null +++ b/Algorithms/0829.consecutive-numbers-sum/README.md @@ -0,0 +1,35 @@ +# [829. Consecutive Numbers Sum](https://leetcode.com/problems/consecutive-numbers-sum/) + +## 题目 + +Given a positive integerN, how many ways can we write it as a sum ofconsecutive positive integers? + +Example 1: + +```text +Input: 5 +Output: 2 +Explanation: 5 = 5 = 2 + 3 +``` + +Example 2: + +```text +Input: 9 +Output: 3 +Explanation: 9 = 9 = 4 + 5 = 2 + 3 + 4 +``` + +Example 3: + +```text +Input: 15 +Output: 4 +Explanation: 15 = 15 = 8 + 7 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5 +``` + +Note:1 <= N <= 10 ^ 9. + +## 解题思路 + + diff --git a/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum.go b/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum.go new file mode 100755 index 000000000..d888d6c7a --- /dev/null +++ b/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum.go @@ -0,0 +1,21 @@ +package problem0829 + +import ( + "math" +) + +func consecutiveNumbersSum(N int) int { + res := 1 + + root := int(math.Sqrt(float64(2 * N))) + for k := 2; k <= root; k++ { + kx := N - k*(k-1)/2 + if kx%k == 0 { + res++ + } + } + + return res +} + +// diff --git a/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum_test.go b/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum_test.go new file mode 100755 index 000000000..fcb3008d5 --- /dev/null +++ b/Algorithms/0829.consecutive-numbers-sum/consecutive-numbers-sum_test.go @@ -0,0 +1,74 @@ +package problem0829 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 21, + 4, + }, + + { + 1, + 1, + }, + + { + 3, + 2, + }, + + { + 1000000000, + 10, + }, + + { + 51, + 4, + }, + + { + 9, + 3, + }, + + { + 5, + 2, + }, + + { + 15, + 4, + }, + + // 可以有多个 testcase +} + +func Test_consecutiveNumbersSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, consecutiveNumbersSum(tc.N), "输入:%v", tc) + } +} + +func Benchmark_consecutiveNumbersSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + consecutiveNumbersSum(tc.N) + } + } +} diff --git a/Algorithms/0830.positions-of-large-groups/README.md b/Algorithms/0830.positions-of-large-groups/README.md new file mode 100755 index 000000000..6e0cfa000 --- /dev/null +++ b/Algorithms/0830.positions-of-large-groups/README.md @@ -0,0 +1,42 @@ +# [830. Positions of Large Groups](https://leetcode.com/problems/positions-of-large-groups/) + +## 题目 + +In a stringSof lowercase letters, these letters form consecutive groups of the same character. + +For example, a string like S = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z" and"yy". + +Call a group large if it has 3 or more characters. We would like the starting and ending positions of every large group. + +The final answer should be in lexicographic order. + +Example 1: + +```text +Input: "abbxxxxzzy" +Output: [[3,6]] +Explanation: "xxxx" is the single large group with starting 3 and ending positions 6. +``` + +Example 2: + +```text +Input: "abc" +Output: [] +Explanation: We have "a","b" and "c" but no large group. +``` + +Example 3: + +```text +Input: "abcdddeeeeaabbbcd" +Output: [[3,5],[6,9],[12,14]] +``` + +Note: + +- 1 <= S.length <= 1000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0830.positions-of-large-groups/positions-of-large-groups.go b/Algorithms/0830.positions-of-large-groups/positions-of-large-groups.go new file mode 100755 index 000000000..d2f8414f8 --- /dev/null +++ b/Algorithms/0830.positions-of-large-groups/positions-of-large-groups.go @@ -0,0 +1,21 @@ +package problem0830 + +func largeGroupPositions(s string) [][]int { + res := make([][]int, 0, len(s)/3) + l, r := 0, 1 + + for ; r < len(s); r++ { + if s[l] != s[r] { + l = r + continue + } + + if r-l+1 == 3 { // 找到一个 large group + res = append(res, []int{l, r}) + } else if r-l+1 > 3 { // 最后一个 large group 继续变大 + res[len(res)-1][1] = r + } + } + + return res +} diff --git a/Algorithms/0830.positions-of-large-groups/positions-of-large-groups_test.go b/Algorithms/0830.positions-of-large-groups/positions-of-large-groups_test.go new file mode 100755 index 000000000..4841864be --- /dev/null +++ b/Algorithms/0830.positions-of-large-groups/positions-of-large-groups_test.go @@ -0,0 +1,49 @@ +package problem0830 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans [][]int +}{ + + { + "abbxxxxzzy", + [][]int{{3, 6}}, + }, + + { + "abc", + [][]int{}, + }, + + { + "abcdddeeeeaabbbcd", + [][]int{{3, 5}, {6, 9}, {12, 14}}, + }, + + // 可以有多个 testcase +} + +func Test_largeGroupPositions(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, largeGroupPositions(tc.S), "输入:%v", tc) + } +} + +func Benchmark_largeGroupPositions(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largeGroupPositions(tc.S) + } + } +} diff --git a/Algorithms/0831.masking-personal-information/README.md b/Algorithms/0831.masking-personal-information/README.md new file mode 100755 index 000000000..5d52d5d18 --- /dev/null +++ b/Algorithms/0831.masking-personal-information/README.md @@ -0,0 +1,76 @@ +# [831. Masking Personal Information](https://leetcode.com/problems/masking-personal-information/) + +## 题目 + +We are given apersonal information string S, which may representeither an email address or a phone number. + +We would like to mask thispersonal information according to thefollowing rules: + +1.Email address: + +We define aname to be a string of length >= 2 consistingof only lowercase lettersa-z or uppercaselettersA-Z. + +An email address starts with a name, followed by thesymbol '@', followed by a name, followed by thedot'.'andfollowed by a name. + +All email addresses areguaranteed to be valid and in the format of"name1@name2.name3". + +To mask an email, all names must be converted to lowercase and all letters between the first and last letter of the first name must be replaced by 5 asterisks '*'. + +2.Phone number: + +A phone number is a string consisting ofonly the digits 0-9 or the characters from the set {'+', '-', '(', ')', ''}.You may assume a phonenumber contains10 to 13 digits. + +The last 10 digits make up the localnumber, while the digits before those make up the country code. Note thatthe country code is optional. We want to expose only the last 4 digitsand mask all otherdigits. + +The localnumbershould be formatted and masked as "***-***-1111",where 1 represents the exposed digits. + +To mask a phone number with country code like "+111 111 111 1111", we write it in the form "+***-***-***-1111". The '+'sign and the first '-'sign before the local number should only exist if there is a country code. For example, a 12 digit phone number maskshould startwith "+**-". + +Note that extraneous characters like "(", ")", " ", as well asextra dashes or plus signs not part of the above formatting scheme should be removed. + +Return the correct "mask" of the information provided. + +Example 1: + +```text +Input: "LeetCode@LeetCode.com" +Output: "l*****e@leetcode.com" +Explanation:All names are converted to lowercase, and the letters between the + first and last letter of the first name is replaced by 5 asterisks. + Therefore, "leetcode" -> "l*****e". +``` + +Example 2: + +```text +Input: "AB@qq.com" +Output: "a*****b@qq.com" +Explanation:There must be 5 asterisks between the first and last letter + of the first name "ab". Therefore, "ab" -> "a*****b". +``` + +Example 3: + +```text +Input: "1(234)567-890" +Output: "***-***-7890" +Explanation:10 digits in the phone number, which means all digits make up the local number. +``` + +Example 4: + +```text +Input: "86-(10)12345678" +Output: "+**-***-***-5678" +Explanation:12 digits, 2 digits for country code and 10 digits for local number. +``` + +Notes: + +1. S.length<=40. +1. Emails have length at least 8. +1. Phone numbers have length at least 10. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0831.masking-personal-information/masking-personal-information.go b/Algorithms/0831.masking-personal-information/masking-personal-information.go new file mode 100755 index 000000000..92fc38031 --- /dev/null +++ b/Algorithms/0831.masking-personal-information/masking-personal-information.go @@ -0,0 +1,34 @@ +package problem0831 + +import "strings" + +func maskPII(s string) string { + if strings.ContainsRune(s, '@') { + return maskEmailAddress(strings.ToLower(s)) + } + return maskPhoneNumber(s) +} + +func maskEmailAddress(s string) string { + ss := strings.Split(s, "@") + ss[0] = ss[0][0:1] + "*****" + ss[0][len(ss[0])-1:] + return strings.Join(ss, "@") +} + +func maskPhoneNumber(s string) string { + tmp := make([]byte, 0, 13) + for i := range s { + if '0' <= s[i] && s[i] <= '9' { + tmp = append(tmp, s[i]) + } + } + + size := len(tmp) + s = string(tmp[size-4:]) + + if size == 10 { + return "***-***-" + s + } + + return "+" + strings.Repeat("*", size-10) + "-***-***-" + s +} diff --git a/Algorithms/0831.masking-personal-information/masking-personal-information_test.go b/Algorithms/0831.masking-personal-information/masking-personal-information_test.go new file mode 100755 index 000000000..e96c7c227 --- /dev/null +++ b/Algorithms/0831.masking-personal-information/masking-personal-information_test.go @@ -0,0 +1,54 @@ +package problem0831 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "LeetCode@LeetCode.com", + "l*****e@leetcode.com", + }, + + { + "AB@qq.com", + "a*****b@qq.com", + }, + + { + "1(234)567-890", + "***-***-7890", + }, + + { + "86-(10)12345678", + "+**-***-***-5678", + }, + + // 可以有多个 testcase +} + +func Test_maskPII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maskPII(tc.S), "输入:%v", tc) + } +} + +func Benchmark_maskPII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maskPII(tc.S) + } + } +} diff --git a/Algorithms/0832.flipping-an-image/README.md b/Algorithms/0832.flipping-an-image/README.md new file mode 100755 index 000000000..21030c091 --- /dev/null +++ b/Algorithms/0832.flipping-an-image/README.md @@ -0,0 +1,36 @@ +# [832. Flipping an Image](https://leetcode.com/problems/flipping-an-image/) + +## 题目 + +Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image. + +To flip an image horizontally means that each row of the image is reversed. For example, flipping[1, 1, 0]horizontally results in[0, 1, 1]. + +To invert an image meansthat each 0 is replaced by 1, and each 1 is replaced by 0.For example, inverting[0, 1, 1]results in[1, 0, 0]. + +Example 1: + +```text +Input: [[1,1,0],[1,0,1],[0,0,0]] +Output: [[1,0,0],[0,1,0],[1,1,1]] +Explanation: First reverse each row: [[0,1,1],[1,0,1],[0,0,0]]. +Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]] +``` + +Example 2: + +```text +Input: [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]] +Output: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]] +Explanation: First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]]. +Then invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]] +``` + +Notes: + +1. 1 <= A.length = A[0].length <= 20 +1. 0 <= A[i][j]<=1 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0832.flipping-an-image/flipping-an-image.go b/Algorithms/0832.flipping-an-image/flipping-an-image.go new file mode 100755 index 000000000..23d432760 --- /dev/null +++ b/Algorithms/0832.flipping-an-image/flipping-an-image.go @@ -0,0 +1,23 @@ +package problem0832 + +func flipAndInvertImage(A [][]int) [][]int { + for k := 0; k < len(A); k++ { + i, j := 0, len(A[k])-1 + for i < j { + A[k][i], A[k][j] = invert(A[k][j]), invert(A[k][i]) + i++ + j-- + } + if i == j { // 当 len(A[k]) 的长度为奇数时,处理正中间的数 + A[k][i] = invert(A[k][i]) + } + } + return A +} + +func invert(i int) int { + if i == 0 { + return 1 + } + return 0 +} diff --git a/Algorithms/0832.flipping-an-image/flipping-an-image_test.go b/Algorithms/0832.flipping-an-image/flipping-an-image_test.go new file mode 100755 index 000000000..d5ce3ab6b --- /dev/null +++ b/Algorithms/0832.flipping-an-image/flipping-an-image_test.go @@ -0,0 +1,44 @@ +package problem0832 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans [][]int +}{ + + { + [][]int{{1, 1, 0}, {1, 0, 1}, {0, 0, 0}}, + [][]int{{1, 0, 0}, {0, 1, 0}, {1, 1, 1}}, + }, + + { + [][]int{{1, 1, 0, 0}, {1, 0, 0, 1}, {0, 1, 1, 1}, {1, 0, 1, 0}}, + [][]int{{1, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 0, 1}, {1, 0, 1, 0}}, + }, + + // 可以有多个 testcase +} + +func Test_flipAndInvertImage(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, flipAndInvertImage(tc.A), "输入:%v", tc) + } +} + +func Benchmark_flipAndInvertImage(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + flipAndInvertImage(tc.A) + } + } +} diff --git a/Algorithms/0833.find-and-replace-in-string/README.md b/Algorithms/0833.find-and-replace-in-string/README.md new file mode 100755 index 000000000..0141fe3b0 --- /dev/null +++ b/Algorithms/0833.find-and-replace-in-string/README.md @@ -0,0 +1,41 @@ +# [833. Find And Replace in String](https://leetcode.com/problems/find-and-replace-in-string/) + +## 题目 + +To some string S, we will perform somereplacementoperations that replace groups of letters with new ones (not necessarily the same size). + +Each replacement operation has 3 parameters: a starting index i, a source wordxand a target wordy. The rule is that if xstarts at position iin the original string S, then we will replace that occurrence ofxwithy. If not, we do nothing. + +For example, if we haveS = "abcd"and we have some replacement operationi = 2, x = "cd", y = "ffff", then because"cd"starts at position 2in the original string S, we will replace it with "ffff". + +Using another example on S = "abcd", if we have both the replacement operation i = 0, x = "ab", y = "eee", as well as another replacement operationi = 2, x = "ec", y = "ffff", this second operation does nothing because in the original stringS[2] = 'c', which doesn't matchx[0] = 'e'. + +All these operations occur simultaneously. It's guaranteed that there won't be any overlap in replacement: for example,S = "abc", indexes = [0, 1],sources = ["ab","bc"] is not a valid test case. + +Example 1: + +```text +Input: S = "abcd", indexes = [0,2], sources = ["a","cd"], targets = ["eee","ffff"] +Output: "eeebffff" +Explanation: "a" starts at index 0 in S, so it's replaced by "eee". +"cd" starts at index 2 in S, so it's replaced by "ffff". +``` + +Example 2: + +```text +Input: S = "abcd", indexes = [0,2], sources = ["ab","ec"], targets = ["eee","ffff"] +Output: "eeecd" +Explanation: "ab" starts at index 0 in S, so it's replaced by "eee". +"ec" doesn't starts at index 2 in the original S, so we do nothing. +``` + +Notes: + +1. 0 <=indexes.length =sources.length =targets.length <= 100 +1. 0 b { + return a + } + return b +} diff --git a/Algorithms/0835.image-overlap/image-overlap_test.go b/Algorithms/0835.image-overlap/image-overlap_test.go new file mode 100644 index 000000000..0978401fd --- /dev/null +++ b/Algorithms/0835.image-overlap/image-overlap_test.go @@ -0,0 +1,42 @@ +package problem0835 + +import "testing" + +type args struct { + A [][]int + B [][]int +} + +var tests = []struct { + name string + args args + want int +}{ + { + "3X3 image", + args{ + [][]int{{1, 1, 0}, {0, 1, 0}, {0, 1, 0}}, + [][]int{{0, 0, 0}, {0, 1, 1}, {0, 0, 1}}, + }, + 3, + }, +} + +func Test_largestOverlap(t *testing.T) { + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := largestOverlap(tt.args.A, tt.args.B); got != tt.want { + t.Errorf("largestOverlap() = %v, want %v", got, tt.want) + } + }) + } +} +func Benchmark_largestOverlap(b *testing.B) { + for i := 1; i < b.N; i++ { + for _, tt := range tests { + a, b := tt.args.A, tt.args.B + largestOverlap(a, b) + } + } +} diff --git a/Algorithms/0836.rectangle-overlap/README.md b/Algorithms/0836.rectangle-overlap/README.md new file mode 100755 index 000000000..d9a406652 --- /dev/null +++ b/Algorithms/0836.rectangle-overlap/README.md @@ -0,0 +1,32 @@ +# [836. Rectangle Overlap](https://leetcode.com/problems/rectangle-overlap/) + +## 题目 + +A rectangle isrepresented as alist [x1, y1, x2, y2], where(x1, y1)are the coordinates of its bottom-left corner, and (x2,y2)are the coordinates of its top-right corner. + +Two rectangles overlap if the area of their intersection is positive. To be clear, two rectangles that only touch at the corner or edges do not overlap. + +Given two (axis-aligned) rectangles, return whetherthey overlap. + +Example 1: + +```text +Input: rec1 = [0,0,2,2], rec2 = [1,1,3,3] +Output: true +``` + +Example 2: + +```text +Input: rec1 = [0,0,1,1], rec2 = [1,0,2,1] +Output: false +``` + +Notes: + +1. Both rectangles rec1 and rec2 are lists of 4 integers. +1. All coordinates in rectangles will be between-10^9 and 10^9. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0836.rectangle-overlap/rectangle-overlap.go b/Algorithms/0836.rectangle-overlap/rectangle-overlap.go new file mode 100755 index 000000000..5fc6f69af --- /dev/null +++ b/Algorithms/0836.rectangle-overlap/rectangle-overlap.go @@ -0,0 +1,20 @@ +package problem0836 + +func isRectangleOverlap(rec1 []int, rec2 []int) bool { + // 把 rec 分别投影到水平轴和竖直轴上 + h1, v1 := projecting(rec1) + h2, v2 := projecting(rec2) + // 两个投影线同时相交可以认为 rec 相交 + return isLineOverlap(h1, h2) && isLineOverlap(v1, v2) +} + +func projecting(rec []int) (h, v []int) { + h = []int{rec[0], rec[2]} + v = []int{rec[1], rec[3]} + return +} + +func isLineOverlap(a, b []int) bool { + // 没有分开,就是相交 + return !(a[1] <= b[0] || b[1] <= a[0]) +} diff --git a/Algorithms/0836.rectangle-overlap/rectangle-overlap_test.go b/Algorithms/0836.rectangle-overlap/rectangle-overlap_test.go new file mode 100755 index 000000000..3981530ec --- /dev/null +++ b/Algorithms/0836.rectangle-overlap/rectangle-overlap_test.go @@ -0,0 +1,47 @@ +package problem0836 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + rec1 []int + rec2 []int + ans bool +}{ + + { + []int{0, 0, 2, 2}, + []int{1, 1, 3, 3}, + true, + }, + + { + []int{0, 0, 1, 1}, + []int{1, 0, 2, 1}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isRectangleOverlap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isRectangleOverlap(tc.rec1, tc.rec2), "输入:%v", tc) + } +} + +func Benchmark_isRectangleOverlap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isRectangleOverlap(tc.rec1, tc.rec2) + } + } +} diff --git a/Algorithms/0837.new-21-game/README.md b/Algorithms/0837.new-21-game/README.md new file mode 100755 index 000000000..c5bdf80df --- /dev/null +++ b/Algorithms/0837.new-21-game/README.md @@ -0,0 +1,44 @@ +# [837. New 21 Game](https://leetcode.com/problems/new-21-game/) + +## 题目 + +Alice plays the following game, loosely based on the card game "21". + +Alice starts with 0 points, and draws numbers while she has less than K points. During each draw, she gains an integer number of points randomly from the range [1, W], where W is an integer. Each draw is independent and the outcomes have equal probabilities. + +Alice stops drawing numbers when she gets K or more points. What is the probabilitythat she has N or less points? + +Example 1: + +```text +Input: N = 10, K = 1, W = 10 +Output: 1.00000 +Explanation: Alice gets a single card, then stops. +``` + +Example 2: + +```text +Input: N = 6, K = 1, W = 10 +Output: 0.60000 +Explanation: Alice gets a single card, then stops. +In 6 out of W = 10 possibilities, she is at or below N = 6 points. +``` + +Example 3: + +```text +Input: N = 21, K = 17, W = 10 +Output: 0.73278 +``` + +Note: + +1. 0 <= K <= N <= 10000 +1. 1 <= W <= 10000 +1. Answers will be accepted as correct if they are within 10^-5 of the correct answer. +1. The judging time limit has been reduced for this question. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0837.new-21-game/new-21-game.go b/Algorithms/0837.new-21-game/new-21-game.go new file mode 100755 index 000000000..c0903e085 --- /dev/null +++ b/Algorithms/0837.new-21-game/new-21-game.go @@ -0,0 +1,45 @@ +package problem0837 + +func new21Game(N int, K int, W int) float64 { + if K == 0 || + N >= K+W { + return 1.0 + } + + // dp[i]: 获取分数 i 的概率 + // 假设 p 为抽取 [1,W] 中任意一个数的概率,即 p = 1/W + // + // dp[i] = dp[i-1]*p + dp[i-2]*p + ... + dp[i-W]*p + // = (dp[i-1] + dp[i-2] + ... + dp[i-W]) * p + // = (dp[i-1] + dp[i-2] + ... + dp[i-W]) / W + // 令 last= dp[i-1] + dp[i-2] + ... + dp[i-W] + // dp[i] = last/ W + // + // 由于 i 的取值范围为 [1,N] + // 当 W <= i < K 时 + // last= dp[i-1] + dp[i-2] + ... + dp[i-W] + // 当 i < W 时 + // last应为 dp[i-1] + dp[i-2] + ... + dp[0] + // 当 K <= i 时 + // last应为 dp[k-1] + dp[k-2] + ... + dp[i-W] + dp := make([]float64, N+1) + dp[0] = 1.0 + last := 1.0 // 初始概率为 1 + res := 0.0 + for i := 1; i <= N; i++ { + dp[i] = last / float64(W) + + if W <= i { + last -= dp[i-W] + } + + if i < K { + last += dp[i] + } else { + res += dp[i] + } + + } + + return res +} diff --git a/Algorithms/0837.new-21-game/new-21-game_test.go b/Algorithms/0837.new-21-game/new-21-game_test.go new file mode 100755 index 000000000..063cb9c1b --- /dev/null +++ b/Algorithms/0837.new-21-game/new-21-game_test.go @@ -0,0 +1,71 @@ +package problem0837 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + K int + W int + ans float64 +}{ + + { + 421, + 400, + 47, + 0.71188, + }, + + { + 3, + 1, + 1, + 1.00000, + }, + + { + 10, + 1, + 10, + 1.00000, + }, + + { + 6, + 1, + 10, + 0.60000, + }, + + { + 21, + 17, + 10, + 0.73278, + }, + + // 可以有多个 testcase +} + +func Test_new21Game(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.InEpsilon(tc.ans, new21Game(tc.N, tc.K, tc.W), 0.00001, "输入:%v", tc) + } +} + +func Benchmark_new21Game(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + new21Game(tc.N, tc.K, tc.W) + } + } +} diff --git a/Algorithms/0838.push-dominoes/README.md b/Algorithms/0838.push-dominoes/README.md new file mode 100755 index 000000000..b39cf4b6a --- /dev/null +++ b/Algorithms/0838.push-dominoes/README.md @@ -0,0 +1,45 @@ +# [838. Push Dominoes](https://leetcode.com/problems/push-dominoes/) + +## 题目 + +There areN dominoes in a line, and we place each domino vertically upright. + +In the beginning, we simultaneously pushsome of the dominoes either to the left or to the right. + +![domino](domino.png) + +After each second, each domino that is falling to the left pushes the adjacent domino on the left. + +Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right. + +When a vertical domino has dominoes falling on it from both sides, it stays still due to the balance of the forces. + +For the purposes of this question, we will consider that a falling dominoexpends no additional force to a falling or already fallen domino. + +Given a string "S" representing the initial state.S[i] = 'L', if the i-th domino has been pushed to the left; S[i] = 'R', if the i-th domino has been pushed to the right; S[i] = '.',if the i-th domino has not been pushed. + +Return a string representing the final state. + +Example 1: + +```text +Input: ".L.R...LR..L.." +Output: "LL.RR.LLRRLL.." +``` + +Example 2: + +```text +Input: "RR.L" +Output: "RR.L" +Explanation: The first domino expends no additional force on the second domino. +``` + +Note: + +1. 0 <= N<= 10^5 +1. Stringdominoes contains only'L', 'R' and '.' + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0838.push-dominoes/domino.png b/Algorithms/0838.push-dominoes/domino.png new file mode 100644 index 000000000..78e3a36b0 Binary files /dev/null and b/Algorithms/0838.push-dominoes/domino.png differ diff --git a/Algorithms/0838.push-dominoes/push-dominoes.go b/Algorithms/0838.push-dominoes/push-dominoes.go new file mode 100755 index 000000000..7cc99004a --- /dev/null +++ b/Algorithms/0838.push-dominoes/push-dominoes.go @@ -0,0 +1,48 @@ +package problem0838 + +func pushDominoes(dominoes string) string { + d := "L" + dominoes + "R" + size := len(d) + res := make([]byte, 0, size) + + for i, j := 0, 1; j < size; j++ { + if d[j] == '.' { + continue + } + + if 0 < i { + res = append(res, d[i]) + } + + mid := j - i - 1 + + switch { + case d[i] == 'R' && d[j] == 'L': + // 'R......L' => 'RRRRLLLL' or 'RRRR.LLLL' + for k := 0; k < mid/2; k++ { + res = append(res, 'R') + } + if mid%2 == 1 { + res = append(res, '.') + } + for k := 0; k < mid/2; k++ { + res = append(res, 'L') + } + case d[i] == 'L' && d[j] == 'R': + // 'L......R' => 'L......R' + for k := 0; k < mid; k++ { + res = append(res, '.') + } + default: + // 'R......R' => 'RRRRRRRR' + // 'L......L' => 'LLLLLLLL' + for k := 0; k < mid; k++ { + res = append(res, d[i]) + } + } + + i = j + } + + return string(res) +} diff --git a/Algorithms/0838.push-dominoes/push-dominoes_test.go b/Algorithms/0838.push-dominoes/push-dominoes_test.go new file mode 100755 index 000000000..a50cc93fe --- /dev/null +++ b/Algorithms/0838.push-dominoes/push-dominoes_test.go @@ -0,0 +1,44 @@ +package problem0838 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + dominoes string + ans string +}{ + + { + ".L.R...LR..L..", + "LL.RR.LLRRLL..", + }, + + { + "RR.L", + "RR.L", + }, + + // 可以有多个 testcase +} + +func Test_pushDominoes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, pushDominoes(tc.dominoes), "输入:%v", tc) + } +} + +func Benchmark_pushDominoes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pushDominoes(tc.dominoes) + } + } +} diff --git a/Algorithms/0839.similar-string-groups/README.md b/Algorithms/0839.similar-string-groups/README.md new file mode 100755 index 000000000..5dd4a1e1b --- /dev/null +++ b/Algorithms/0839.similar-string-groups/README.md @@ -0,0 +1,31 @@ +# [839. Similar String Groups](https://leetcode.com/problems/similar-string-groups/) + +## 题目 + +Two strings Xand Yare similar if we can swap two letters (in different positions) of X, so thatit equals Y. + +For example, "tars"and "rats"are similar (swapping at positions 0 and 2), and "rats" and "arts" are similar, but "star" is not similar to "tars", "rats", or "arts". + +Together, these form two connected groups by similarity: {"tars", "rats", "arts"} and {"star"}. Notice that "tars" and "arts" are in the same group even though they are not similar. Formally, each group is such that a word is in the group if and only if it is similar to at least one other word in the group. + +We are given a list A of strings. Every string in A is an anagram of every other string in A. How many groups are there? + +Example 1: + +```text +Input: ["tars","rats","arts","star"] +Output: 2 +``` + +Note: + +1. A.length <= 2000 +1. A[i].length <= 1000 +1. A.length * A[i].length <= 20000 +1. All words in Aconsist of lowercase letters only. +1. All words in A have the same length and are anagrams of each other. +1. The judging time limit has been increased for this question. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0839.similar-string-groups/similar-string-groups.go b/Algorithms/0839.similar-string-groups/similar-string-groups.go new file mode 100755 index 000000000..7dc593b99 --- /dev/null +++ b/Algorithms/0839.similar-string-groups/similar-string-groups.go @@ -0,0 +1,53 @@ +package problem0839 + +func numSimilarGroups(A []string) int { + size := len(A) + count := size + + parent := make([]int, size) + for i := 0; i < size; i++ { + parent[i] = i + } + var find func(int) int + find = func(x int) int { + if x != parent[x] { + parent[x] = find(parent[x]) + } + return parent[x] + } + union := func(x, y int) { + x, y = find(x), find(y) + if x != y { + parent[y] = x + count-- + } + } + + for i := 0; i < size; i++ { + for j := i + 1; j < size; j++ { + if isSimilar(A[i], A[j]) { + union(i, j) + } + } + } + + return count +} + +func isSimilar(a, b string) bool { + hasSeen := [26]bool{} + hasDouble := false + count := 0 + for i := 0; i < len(a) && count < 3; i++ { + if a[i] != b[i] { + count++ + continue + } + if hasSeen[a[i]-'a'] { + hasDouble = true + } + hasSeen[a[i]-'a'] = true + } + + return count == 2 || (count == 0 && hasDouble) +} diff --git a/Algorithms/0839.similar-string-groups/similar-string-groups_test.go b/Algorithms/0839.similar-string-groups/similar-string-groups_test.go new file mode 100755 index 000000000..2b8bfb1a5 --- /dev/null +++ b/Algorithms/0839.similar-string-groups/similar-string-groups_test.go @@ -0,0 +1,49 @@ +package problem0839 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans int +}{ + + { + []string{"kccomwcgcs", "socgcmcwkc", "sgckwcmcoc", "coswcmcgkc", "cowkccmsgc", "cosgmccwkc", "sgmkwcccoc", "coswmccgkc", "kowcccmsgc", "kgcomwcccs"}, + 5, + }, + + { + []string{"aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa"}, + 1, + }, + + { + []string{"tars", "rats", "arts", "star"}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_numSimilarGroups(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numSimilarGroups(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numSimilarGroups(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSimilarGroups(tc.A) + } + } +} diff --git a/Algorithms/0840.magic-squares-in-grid/README.md b/Algorithms/0840.magic-squares-in-grid/README.md new file mode 100755 index 000000000..07e37b6b8 --- /dev/null +++ b/Algorithms/0840.magic-squares-in-grid/README.md @@ -0,0 +1,38 @@ +# [840. Magic Squares In Grid](https://leetcode.com/problems/magic-squares-in-grid/) + +## 题目 + +A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum. + +Given an gridof integers, how many 3 x 3 "magic square" subgrids are there? (Each subgrid is contiguous). + +Example 1: + +```text +Input: [[4,3,8,4], + [9,5,1,9], + [2,7,6,2]] +Output: 1 +Explanation: +The following subgrid is a 3 x 3 magic square: +438 +951 +276 + +while this one is not: +384 +519 +762 + +In total, there is only one magic square inside the given grid. +``` + +Note: + +1. 1 <= grid.length<= 10 +1. 1 <= grid[0].length<= 10 +1. 0 <= grid[i][j] <= 15 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid.go b/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid.go new file mode 100755 index 000000000..c64b211c0 --- /dev/null +++ b/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid.go @@ -0,0 +1,48 @@ +package problem0840 + +func numMagicSquaresInside(g [][]int) int { + m, n := len(g), len(g[0]) + + res := 0 + + for i := 0; i+2 < m; i++ { + for j := 0; j+2 < n; j++ { + if !isAvailbleNum(i, j, g) { + continue + } + + if // 检查行 + g[i][j]+g[i][j+1]+g[i][j+2] == 15 && + g[i+1][j]+g[i+1][j+1]+g[i+1][j+2] == 15 && + g[i+2][j]+g[i+2][j+1]+g[i+2][j+2] == 15 && + // 检查列 + g[i][j]+g[i+1][j]+g[i+2][j] == 15 && + g[i][j+1]+g[i+1][j+1]+g[i+2][j+1] == 15 && + g[i][j+2]+g[i+1][j+2]+g[i+2][j+2] == 15 && + // 检查对角 + g[i][j]+g[i+1][j+1]+g[i+2][j+2] == 15 && + g[i][j+2]+g[i+1][j+1]+g[i+2][j] == 15 { + res++ + } + } + } + + return res +} + +func isAvailbleNum(x, y int, g [][]int) bool { + tmp := [16]int{} + + for i := x; i <= x+2; i++ { + for j := y; j <= y+2; j++ { + tmp[g[i][j]]++ + } + } + + for i := 1; i <= 9; i++ { + if tmp[i] != 1 { + return false + } + } + return true +} diff --git a/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid_test.go b/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid_test.go new file mode 100755 index 000000000..6031e1ea0 --- /dev/null +++ b/Algorithms/0840.magic-squares-in-grid/magic-squares-in-grid_test.go @@ -0,0 +1,63 @@ +package problem0840 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{ + {3, 2, 9, 2, 7}, + {6, 1, 8, 4, 2}, + {7, 5, 3, 2, 7}, + {2, 9, 4, 9, 6}, + {4, 3, 8, 2, 5}, + }, + 1, + }, + + { + [][]int{ + {4, 3, 8, 4}, + {9, 5, 1, 9}, + {2, 7, 6, 2}, + }, + 1, + }, + + { + [][]int{ + {1, 8, 6}, + {10, 5, 0}, + {4, 2, 9}, + }, + 0, + }, + + // 可以有多个 testcase +} + +func Test_numMagicSquaresInside(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numMagicSquaresInside(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_numMagicSquaresInside(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numMagicSquaresInside(tc.grid) + } + } +} diff --git a/Algorithms/0841.keys-and-rooms/README.md b/Algorithms/0841.keys-and-rooms/README.md new file mode 100755 index 000000000..20fd8ebec --- /dev/null +++ b/Algorithms/0841.keys-and-rooms/README.md @@ -0,0 +1,43 @@ +# [841. Keys and Rooms](https://leetcode.com/problems/keys-and-rooms/) + +## 题目 + +There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may havesome keys to access the next room. + +Formally, each room ihas a list of keys rooms[i], and each key rooms[i][j] is an integer in [0, 1, ..., N-1] where N = rooms.length. A key rooms[i][j] = vopens the room with number v. + +Initially, all the rooms start locked (except for room 0). + +You can walk back and forth between rooms freely. + +Return trueif and only if you can enterevery room. + +Example 1: + +```text +Input: [[1],[2],[3],[]] +Output: true +Explanation: +We start in room 0, and pick up key 1. +We then go to room 1, and pick up key 2. +We then go to room 2, and pick up key 3. +We then go to room 3. Since we were able to go to every room, we return true. +``` + +Example 2: + +```text +Input: [[1,3],[3,0,1],[2],[0]] +Output: false +Explanation: We can't enter the room with number 2. +``` + +Note: + +1. 1 <= rooms.length <=1000 +1. 0 <= rooms[i].length <= 1000 +1. The number of keys in all rooms combined is at most3000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0841.keys-and-rooms/keys-and-rooms.go b/Algorithms/0841.keys-and-rooms/keys-and-rooms.go new file mode 100755 index 000000000..e36cfbde2 --- /dev/null +++ b/Algorithms/0841.keys-and-rooms/keys-and-rooms.go @@ -0,0 +1,33 @@ +package problem0841 + +func canVisitAllRooms(rooms [][]int) bool { + N := len(rooms) + + next := make([]int, 1, N) + next[0] = 0 + + isEntered := make([]bool, N) + isEntered[0] = true + count := 1 + + for len(next) > 0 { + r := next[0] + next = next[1:] + + for _, x := range rooms[r] { + if isEntered[x] { + continue + } + next = append(next, x) + isEntered[x] = true + count++ + } + + if count == N { + return true + } + + } + + return count == N +} diff --git a/Algorithms/0841.keys-and-rooms/keys-and-rooms_test.go b/Algorithms/0841.keys-and-rooms/keys-and-rooms_test.go new file mode 100755 index 000000000..72e04e7d5 --- /dev/null +++ b/Algorithms/0841.keys-and-rooms/keys-and-rooms_test.go @@ -0,0 +1,44 @@ +package problem0841 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + rooms [][]int + ans bool +}{ + + { + [][]int{{1, 3}, {3, 0, 1}, {2}, {0}}, + false, + }, + + { + [][]int{{1}, {2}, {3}, {}}, + true, + }, + + // 可以有多个 testcase +} + +func Test_canVisitAllRooms(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, canVisitAllRooms(tc.rooms), "输入:%v", tc) + } +} + +func Benchmark_canVisitAllRooms(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canVisitAllRooms(tc.rooms) + } + } +} diff --git a/Algorithms/0842.split-array-into-fibonacci-sequence/README.md b/Algorithms/0842.split-array-into-fibonacci-sequence/README.md new file mode 100755 index 000000000..3b4231300 --- /dev/null +++ b/Algorithms/0842.split-array-into-fibonacci-sequence/README.md @@ -0,0 +1,62 @@ +# [842. Split Array into Fibonacci Sequence](https://leetcode.com/problems/split-array-into-fibonacci-sequence/) + +## 题目 + +Given a string Sof digits, such as S = "123456579", we can split it into a Fibonacci-like sequence[123, 456, 579]. + +Formally, a Fibonacci-like sequence is a listF of non-negative integers such that: + +- 0 <= F[i] <= 2^31 - 1, (that is,each integer fits a 32-bit signed integer type); +- F.length >= 3; +- and F[i] + F[i+1] = F[i+2] for all 0 <= i < F.length - 2. + +Also, note that when splitting the string into pieces, each piece must not have extra leading zeroes, except if the piece is the number 0 itself. + +Return any Fibonacci-like sequence split from S, or return [] if it cannot be done. + +Example 1: + +```text +Input: "123456579" +Output: [123,456,579] +``` + +Example 2: + +```text +Input: "11235813" +Output: [1,1,2,3,5,8,13] +``` + +Example 3: + +```text +Input: "112358130" +Output: [] +Explanation: The task is impossible. +``` + +Example 4: + +```text +Input: "0123" +Output: [] +Explanation: Leading zeroes are not allowed, so "01", "2", "3" is not valid. +``` + +Example 5: + +```text +Input: "1101111" +Output: [110, 1, 111] +Explanation: The output [11, 0, 11, 11] would also be accepted. +``` + +Note: + +1. 1 <= S.length<= 200 +1. S contains only digits. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence.go b/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence.go new file mode 100755 index 000000000..623dff4ca --- /dev/null +++ b/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence.go @@ -0,0 +1,58 @@ +package problem0842 + +import ( + "strconv" +) + +func splitIntoFibonacci(s string) []int { + for i := 1; i <= len(s)/2; i++ { + if isLeadingZero(s[:i]) { + break + } + for j := i + 1; max(i, j-i) <= len(s)-j; j++ { + if isLeadingZero(s[i:j]) { + break + } + a, _ := strconv.Atoi(s[:i]) + b, _ := strconv.Atoi(s[i:j]) + res := make([]int, 0, len(s)) + res = append(res, a, b) + if find(a, b, s[j:], &res) { + return res + } + } + } + return nil +} + +func find(a, b int, s string, res *[]int) bool { + for len(s) > 0 { + c := a + b + if c > 1<<31-1 { + return false + } + cs := strconv.Itoa(c) + csl := len(cs) + + if len(s) < csl || s[:csl] != cs { + return false + } + + *res = append(*res, c) + a, b = b, c + s = s[csl:] + } + + return true +} + +func isLeadingZero(s string) bool { + return len(s) > 1 && s[0] == '0' +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence_test.go b/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence_test.go new file mode 100755 index 000000000..4be03a77c --- /dev/null +++ b/Algorithms/0842.split-array-into-fibonacci-sequence/split-array-into-fibonacci-sequence_test.go @@ -0,0 +1,69 @@ +package problem0842 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans []int +}{ + + { + "1320581321313221264343965566089105744171833277577", + []int{13205, 8, 13213, 13221, 26434, 39655, 66089, 105744, 171833, 277577}, + }, + + { + "123456579", + []int{123, 456, 579}, + }, + + { + "539834657215398346785398346991079669377161950407626991734534318677529701785098211336528511", + nil, + }, + + { + "11235813", + []int{1, 1, 2, 3, 5, 8, 13}, + }, + + { + "112358130", + nil, + }, + + { + "0123", + nil, + }, + + { + "1101111", + []int{11, 0, 11, 11}, + }, + + // 可以有多个 testcase +} + +func Test_splitIntoFibonacci(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, splitIntoFibonacci(tc.S), "输入:%v", tc) + } +} + +func Benchmark_splitIntoFibonacci(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + splitIntoFibonacci(tc.S) + } + } +} diff --git a/Algorithms/0843.guess-the-word/README.md b/Algorithms/0843.guess-the-word/README.md new file mode 100755 index 000000000..4222a5832 --- /dev/null +++ b/Algorithms/0843.guess-the-word/README.md @@ -0,0 +1,36 @@ +# [843. Guess the Word](https://leetcode.com/problems/guess-the-word/) + +## 题目 + +This problem is aninteractive problemnew to the LeetCode platform. + +We are given a word list of unique words, each word is 6 letters long, and one word in this list is chosen as secret. + +You may call master.guess(word)to guess a word. The guessed word should havetype stringand must be from the original listwith 6 lowercase letters. + +This function returns anintegertype, representingthe number of exact matches (value and position) of your guess to the secret word. Also, if your guess is not in the given wordlist, it will return -1 instead. + +For each test case, you have 10 guesses to guess the word. At the end of any number of calls, if you have made 10 or less calls to master.guessand at least one of these guesses was the secret, you pass the testcase. + +Besides the example test case below, there will be 5additional test cases, each with 100 words in the word list. The letters of each word in those testcases were chosenindependently at random from 'a' to 'z', such that every word in the given word lists is unique. + +```text +Example 1: +Input:secret = "acckzz", wordlist = ["acckzz","ccbazz","eiowzz","abcczz"] + +Explanation: + +master.guess("aaaaaa") returns -1, because"aaaaaa"is not in wordlist. +master.guess("acckzz") returns 6, because"acckzz" is secret and has all 6matches. +master.guess("ccbazz") returns 3, because"ccbazz"has 3 matches. +master.guess("eiowzz") returns 2, because"eiowzz"has 2matches. +master.guess("abcczz") returns 4, because"abcczz" has 4 matches. + +We made 5 calls tomaster.guess and one of them was the secret, so we pass the test case. +``` + +Note: Any solutions that attempt to circumvent the judgewill result in disqualification. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0843.guess-the-word/guess-the-word.go b/Algorithms/0843.guess-the-word/guess-the-word.go new file mode 100755 index 000000000..728a73e84 --- /dev/null +++ b/Algorithms/0843.guess-the-word/guess-the-word.go @@ -0,0 +1,67 @@ +package problem0843 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// Master is the Master's API interface. +// You should not implement it, or speculate about its implementation +// type Master struct {} +// func (this *Master) Guess(word string) int {} +type Master = kit.Master + +// 解答参考 https://leetcode.com/problems/guess-the-word/discuss/133862/Random-Guess-and-Minimax-Guess-with-Comparison + +func findSecretWord(wordList []string, master *Master) { + matches := 0 + // 题目默认是猜 10 次 + for i := 0; i < 10; i++ { + // count[w] 代表了 w 与 wordList 中单词的匹配程度 + // 数值越高,越匹配 + count := make(map[string]int, len(wordList)) + for _, w := range wordList { + for _, b := range wordList { + count[w] += match(w, b) + } + } + + key := "" + max := 0 + for _, w := range wordList { + if max < count[w] { + max = count[w] + key = w + } + } + // 现在 key 与 wordList 中别的单词最具有相似性 + + matches = master.Guess(key) + // wordList 中的单词长度都为 6 + if matches == 6 { + // 猜到了 + return + } + + // 没有猜到就缩小 wordList 的范围 + newList := make([]string, 0, len(wordList)) + for _, w := range wordList { + if match(key, w) == matches { + // 因为 matches = match(key, secret) + // 所以,符合 match(key, w) == matches 的 w 才有可能是 secret + newList = append(newList, w) + } + } + + wordList = newList + } +} + +// a, b 总是一样长 +func match(a, b string) int { + res := 0 + size := len(a) + for i := 0; i < size; i++ { + if a[i] == b[i] { + res++ + } + } + return res +} diff --git a/Algorithms/0843.guess-the-word/guess-the-word_test.go b/Algorithms/0843.guess-the-word/guess-the-word_test.go new file mode 100755 index 000000000..61aea6447 --- /dev/null +++ b/Algorithms/0843.guess-the-word/guess-the-word_test.go @@ -0,0 +1,43 @@ +package problem0843 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + secret string + wordList []string + count int +}{ + + { + "hbaczn", + []string{"gaxckt", "trlccr", "jxwhkz", "ycbfps", "peayuf", "yiejjw", "ldzccp", "nqsjoa", "qrjasy", "pcldos", "acrtag", "buyeia", "ubmtpj", "drtclz", "zqderp", "snywek", "caoztp", "ibpghw", "evtkhl", "bhpfla", "ymqhxk", "qkvipb", "tvmued", "rvbass", "axeasm", "qolsjg", "roswcb", "vdjgxx", "bugbyv", "zipjpc", "tamszl", "osdifo", "dvxlxm", "iwmyfb", "wmnwhe", "hslnop", "nkrfwn", "puvgve", "rqsqpq", "jwoswl", "tittgf", "evqsqe", "aishiv", "pmwovj", "sorbte", "hbaczn", "coifed", "hrctvp", "vkytbw", "dizcxz", "arabol", "uywurk", "ppywdo", "resfls", "tmoliy", "etriev", "oanvlx", "wcsnzy", "loufkw", "onnwcy", "novblw", "mtxgwe", "rgrdbt", "ckolob", "kxnflb", "phonmg", "egcdab", "cykndr", "lkzobv", "ifwmwp", "jqmbib", "mypnvf", "lnrgnj", "clijwa", "kiioqr", "syzebr", "rqsmhg", "sczjmz", "hsdjfp", "mjcgvm", "ajotcx", "olgnfv", "mjyjxj", "wzgbmg", "lpcnbj", "yjjlwn", "blrogv", "bdplzs", "oxblph", "twejel", "rupapy", "euwrrz", "apiqzu", "ydcroj", "ldvzgq", "zailgu", "xgqpsr", "wxdyho", "alrplq", "brklfk"}, + 10, + }, + + // 可以有多个 testcase +} + +func Test_findSecretWord(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + m := &Master{ + Secret: tc.secret, + WordList: tc.wordList, + Count: tc.count, + } + + m.Update() + + findSecretWord(tc.wordList, m) + + ast.True(m.Count > 0, "没有猜到 %s", tc.secret) + } +} diff --git a/Algorithms/0844.backspace-string-compare/README.md b/Algorithms/0844.backspace-string-compare/README.md new file mode 100755 index 000000000..7d9f06fd2 --- /dev/null +++ b/Algorithms/0844.backspace-string-compare/README.md @@ -0,0 +1,51 @@ +# [844. Backspace String Compare](https://leetcode.com/problems/backspace-string-compare/) + +## 题目 + +Given twostringsSand T,return if they are equal when both are typed into empty text editors. # means a backspace character. + +Example 1: + +```text +Input: S = "ab#c", T = "ad#c" +Output: true +Explanation: Both S and T become "ac". +``` + +Example 2: + +```text +Input: S = "ab##", T = "c#d#" +Output: true +Explanation: Both S and T become "". +``` + +Example 3: + +```text +Input: S = "a##c", T = "#a#c" +Output: true +Explanation: Both S and T become "c". +``` + +Example 4: + +```text +Input: S = "a#c", T = "b" +Output: false +Explanation: S becomes "c" while T becomes "b". +``` + +Note: + +1. 1 <= S.length <= 200 +1. 1 <= T.length <= 200 +1. Sand T only containlowercase letters and '#' characters. + +Follow up: + +1. Can you solve it in O(N) time and O(1) space? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0844.backspace-string-compare/backspace-string-compare.go b/Algorithms/0844.backspace-string-compare/backspace-string-compare.go new file mode 100755 index 000000000..f4fc04586 --- /dev/null +++ b/Algorithms/0844.backspace-string-compare/backspace-string-compare.go @@ -0,0 +1,33 @@ +package problem0844 + +func backspaceCompare(S string, T string) bool { + i := len(S) + j := len(T) + + for i >= 0 || j >= 0 { + i = nextIndex(&S, i) + j = nextIndex(&T, j) + + if i >= 0 && j >= 0 && S[i] != T[j] { + return false + } + + } + + return i == j +} + +// 返回 s[:i] 中,不是 '#' 的字符的最大的索引号 +func nextIndex(s *string, i int) int { + i-- + count := 0 + for i >= 0 && ((*s)[i] == '#' || count > 0) { + if (*s)[i] == '#' { + count++ + } else { + count-- + } + i-- + } + return i +} diff --git a/Algorithms/0844.backspace-string-compare/backspace-string-compare_test.go b/Algorithms/0844.backspace-string-compare/backspace-string-compare_test.go new file mode 100755 index 000000000..e05a7166f --- /dev/null +++ b/Algorithms/0844.backspace-string-compare/backspace-string-compare_test.go @@ -0,0 +1,65 @@ +package problem0844 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + T string + ans bool +}{ + + { + "#ab#c", + "#ad#c", + true, + }, + + { + "ab#c", + "ad#c", + true, + }, + + { + "ab##", + "c#d#", + true, + }, + + { + "a##c", + "#a#c", + true, + }, + + { + "a#c", + "b", + false, + }, + + // 可以有多个 testcase +} + +func Test_backspaceCompare(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, backspaceCompare(tc.S, tc.T), "输入:%v", tc) + } +} + +func Benchmark_backspaceCompare(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + backspaceCompare(tc.S, tc.T) + } + } +} diff --git a/Algorithms/0845.longest-mountain-in-array/README.md b/Algorithms/0845.longest-mountain-in-array/README.md new file mode 100755 index 000000000..bbac6aecc --- /dev/null +++ b/Algorithms/0845.longest-mountain-in-array/README.md @@ -0,0 +1,44 @@ +# [845. Longest Mountain in Array](https://leetcode.com/problems/longest-mountain-in-array/) + +## 题目 + +Let's call any (contiguous) subarray B (of A)a mountain if the following properties hold: + +- B.length >= 3 +- There exists some 0 < i< B.length - 1 such that B[0] < B[1] < ... B[i-1] < B[i] > B[i+1] > ... > B[B.length - 1] + +(Note that B could be any subarray of A, including the entire array A.) + +Given an array Aof integers,return the length of the longestmountain. + +Return 0 if there is no mountain. + +Example 1: + +```text +Input: [2,1,4,7,3,2,5] +Output: 5 +Explanation: The largest mountain is [1,4,7,3,2] which has length 5. +``` + +Example 2: + +```text +Input: [2,2,2] +Output: 0 +Explanation: There is no mountain. +``` + +Note: + +1. 0 <= A.length <= 10000 +1. 0 <= A[i] <= 10000 + +Follow up: + +- Can you solve it using only one pass? +- Can you solve it in O(1) space? + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array.go b/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array.go new file mode 100755 index 000000000..40bc7927b --- /dev/null +++ b/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array.go @@ -0,0 +1,27 @@ +package problem0845 + +func longestMountain(A []int) int { + size := len(A) + if size <= 2 { + return 0 + } + + res, up, down := 0, 0, 0 + for i := 1; i < size; i++ { + if (down > 0 && A[i-1] < A[i]) || + A[i-1] == A[i] { + up, down = 0, 0 + } + if A[i-1] < A[i] { + up++ + } + if A[i-1] > A[i] { + down++ + } + if up > 0 && down > 0 && up+down+1 > res { + res = up + down + 1 + } + } + + return res +} diff --git a/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array_test.go b/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array_test.go new file mode 100755 index 000000000..695b55fc9 --- /dev/null +++ b/Algorithms/0845.longest-mountain-in-array/longest-mountain-in-array_test.go @@ -0,0 +1,59 @@ +package problem0845 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{2, 3, 3, 2, 0, 2}, + 0, + }, + + { + []int{1, 2, 0, 2, 0, 2}, + 3, + }, + + { + []int{2, 1, 4, 7, 3, 2, 5}, + 5, + }, + + { + []int{2, 2, 2}, + 0, + }, + + { + []int{2, 3}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_longestMountain(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, longestMountain(tc.A), "输入:%v", tc) + } +} + +func Benchmark_longestMountain(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestMountain(tc.A) + } + } +} diff --git a/Algorithms/0846.hand-of-straights/README.md b/Algorithms/0846.hand-of-straights/README.md new file mode 100755 index 000000000..c2c526eec --- /dev/null +++ b/Algorithms/0846.hand-of-straights/README.md @@ -0,0 +1,35 @@ +# [846. Hand of Straights](https://leetcode.com/problems/hand-of-straights/) + +## 题目 + +Alice has a hand of cards, given as an array of integers. + +Now she wants to rearrange the cards into groups so that each group is size W, and consists of W consecutive cards. + +Return true if and only if she can. + +Example 1: + +```text +Input: hand = [1,2,3,6,2,3,4,7,8], W = 3 +Output: true +Explanation: Alice's hand can be rearranged as [1,2,3],[2,3,4],[6,7,8]. +``` + +Example 2: + +```text +Input: hand = [1,2,3,4,5], W = 4 +Output: false +Explanation: Alice's hand can't be rearranged into groups of 4. +``` + +Note: + +1. 1 <= hand.length <= 10000 +1. 0 <= hand[i]<= 10^9 +1. 1 <= W <= hand.length + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0846.hand-of-straights/hand-of-straights.go b/Algorithms/0846.hand-of-straights/hand-of-straights.go new file mode 100755 index 000000000..555154404 --- /dev/null +++ b/Algorithms/0846.hand-of-straights/hand-of-straights.go @@ -0,0 +1,40 @@ +package problem0846 + +import ( + "sort" +) + +func isNStraightHand(hand []int, W int) bool { + if W == 1 { + return true + } + + if W > len(hand) || len(hand)%W != 0 { + return false + } + + size := len(hand) / W + + groups := make([][]int, size) + + sort.Ints(hand) + + for _, c := range hand { + i := 0 + for ; i < size; i++ { + if len(groups[i]) == W { + continue + } + last := len(groups[i]) - 1 + if last == -1 || groups[i][last]+1 == c { + groups[i] = append(groups[i], c) + break + } + } + if i == size { + return false + } + } + + return true +} diff --git a/Algorithms/0846.hand-of-straights/hand-of-straights_test.go b/Algorithms/0846.hand-of-straights/hand-of-straights_test.go new file mode 100755 index 000000000..5bbdec3b6 --- /dev/null +++ b/Algorithms/0846.hand-of-straights/hand-of-straights_test.go @@ -0,0 +1,59 @@ +package problem0846 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + hand []int + W int + ans bool +}{ + + { + []int{1, 2, 3}, + 1, + true, + }, + + { + []int{1, 2, 3, 7, 2, 3, 4, 7, 8}, + 3, + false, + }, + + { + []int{1, 2, 3, 6, 2, 3, 4, 7, 8}, + 3, + true, + }, + + { + []int{1, 2, 3, 4, 5}, + 4, + false, + }, + + // 可以有多个 testcase +} + +func Test_isNStraightHand(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isNStraightHand(tc.hand, tc.W), "输入:%v", tc) + } +} + +func Benchmark_isNStraightHand(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isNStraightHand(tc.hand, tc.W) + } + } +} diff --git a/Algorithms/0847.shortest-path-visiting-all-nodes/README.md b/Algorithms/0847.shortest-path-visiting-all-nodes/README.md new file mode 100755 index 000000000..45fa26ef7 --- /dev/null +++ b/Algorithms/0847.shortest-path-visiting-all-nodes/README.md @@ -0,0 +1,34 @@ +# [847. Shortest Path Visiting All Nodes](https://leetcode.com/problems/shortest-path-visiting-all-nodes/) + +## 题目 + +An undirected, connected graph of N nodes (labeled0, 1, 2, ..., N-1) is given as graph. + +graph.length = N, and j != iis in the listgraph[i]exactly once, if and only if nodes i and j are connected. + +Return the length of the shortest path that visits every node. You may start and stop at any node, you may revisit nodes multiple times, and you may reuse edges. + +Example 1: + +```text +Input: [[1,2,3],[0],[0],[0]] +Output: 4 +Explanation: One possible path is [1,0,2,0,3] +``` + +Example 2: + +```text +Input: [[1],[0,2,4],[1,3,4],[2],[1,2]] +Output: 4 +Explanation: One possible path is [0,1,4,2,3] +``` + +Note: + +1. 1 <= graph.length <= 12 +1. 0 <= graph[i].length < graph.length + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes.go b/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes.go new file mode 100755 index 000000000..41b7937c9 --- /dev/null +++ b/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes.go @@ -0,0 +1,68 @@ +package problem0847 + +func shortestPathLength(graph [][]int) int { + size := len(graph) + maskSize := 1 << uint(size) + maxInt := 1<<63 - 1 + + queue := make([]state, 0, size*size) + dp := make([][]int, size) + // dp[3][11(00...001011)] = 2 的含义是 + // 从 3 出发,包含了 0,1,3 点的路径距离是 2 + // 通过把二进制数 0,1,3 位上的值设置为 1,其余位为 0 ,来表示包含了 0,1,3 点的路径 + // 11 是其二进制 1011 的 mask + + for i := range dp { + dp[i] = make([]int, maskSize) + for j := range dp[i] { + // 先把每个路径都设置成最大值 + dp[i][j] = maxInt + } + mask := 1 << uint(i) + // 从自身出发到达自身的距离为 0 + dp[i][mask] = 0 + // 从每个节点出发都可以作为一个状态 + queue = append(queue, state{source: i, mask: mask}) + } + + // 搜索 + for len(queue) > 0 { + // 从 queue 中获取一个状态 + s := queue[0] + queue = queue[1:] + + // 检查从 s 状态的 source 能够到达的所有节点 + // 是否有新的更优状态产生 + // 有的话,就放入 queue 中 + + for _, next := range graph[s.source] { + // nextMask 很巧妙 + // nextMask 表示,s 状态所包含的节点,并上 next 节点 + nextMask := s.mask | 1< dp[s.source][s.mask]+1 { + dp[next][nextMask] = dp[s.source][s.mask] + 1 + // 注意,只有更优的状态才能放入 queue 中,避免了死循环 + queue = append(queue, state{source: next, mask: nextMask}) + } + } + } + + res := maxInt + traversalMask := maskSize - 1 + for i := 0; i < size; i++ { + res = min(res, dp[i][traversalMask]) + } + + return res +} + +type state struct { + source, mask int +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes_test.go b/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes_test.go new file mode 100755 index 000000000..571575e40 --- /dev/null +++ b/Algorithms/0847.shortest-path-visiting-all-nodes/shortest-path-visiting-all-nodes_test.go @@ -0,0 +1,49 @@ +package problem0847 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + ans int +}{ + + { + [][]int{{1}, {2}, {0}}, + 2, + }, + + { + [][]int{{1, 2, 3}, {0}, {0}, {0}}, + 4, + }, + + { + [][]int{{1}, {0, 2, 4}, {1, 3, 4}, {2}, {1, 2}}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_shortestPathLength(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestPathLength(tc.graph), "输入:%v", tc) + } +} + +func Benchmark_shortestPathLength(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestPathLength(tc.graph) + } + } +} diff --git a/Algorithms/0848.shifting-letters/README.md b/Algorithms/0848.shifting-letters/README.md new file mode 100755 index 000000000..19e168dc1 --- /dev/null +++ b/Algorithms/0848.shifting-letters/README.md @@ -0,0 +1,34 @@ +# [848. Shifting Letters](https://leetcode.com/problems/shifting-letters/) + +## 题目 + +We have a string S of lowercase letters, and an integer array shifts. + +Call the shift of a letter, the next letter in the alphabet, (wrapping around so that 'z' becomes 'a'). + +For example, shift('a') = 'b', shift('t') = 'u', and shift('z') = 'a'. + +Now for each shifts[i] = x, we want to shift the first i+1letters of S, x times. + +Return the final stringafter all such shifts to S are applied. + +Example 1: + +```text +Input: S = "abc", shifts = [3,5,9] +Output: "rpl" +Explanation: +We start with "abc". +After shifting the first 1 letters of S by 3, we have "dbc". +After shifting the first 2 letters of S by 5, we have "igc". +After shifting the first 3 letters of S by 9, we have "rpl", the answer. +``` + +Note: + +1. 1 <= S.length = shifts.length <= 20000 +1. 0 <= shifts[i] <= 10 ^ 9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0848.shifting-letters/shifting-letters.go b/Algorithms/0848.shifting-letters/shifting-letters.go new file mode 100755 index 000000000..c9975b611 --- /dev/null +++ b/Algorithms/0848.shifting-letters/shifting-letters.go @@ -0,0 +1,29 @@ +package problem0848 + +func shiftingLetters(S string, shifts []int) string { + size := len(S) + a := s2is(S) + shift := 0 + for i := size - 1; 0 <= i; i-- { + shift += shifts[i] + shift %= 26 + a[i] = (a[i] + shift) % 26 + } + return is2s(a) +} + +func s2is(s string) []int { + res := make([]int, len(s)) + for i := range s { + res[i] = int(s[i] - 'a') + } + return res +} + +func is2s(a []int) string { + bs := make([]byte, len(a)) + for i, n := range a { + bs[i] = byte(n + 'a') + } + return string(bs) +} diff --git a/Algorithms/0848.shifting-letters/shifting-letters_test.go b/Algorithms/0848.shifting-letters/shifting-letters_test.go new file mode 100755 index 000000000..fa63fa9a8 --- /dev/null +++ b/Algorithms/0848.shifting-letters/shifting-letters_test.go @@ -0,0 +1,41 @@ +package problem0848 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + shifts []int + ans string +}{ + + { + "abc", + []int{3, 5, 9}, + "rpl", + }, + + // 可以有多个 testcase +} + +func Test_shiftingLetters(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shiftingLetters(tc.S, tc.shifts), "输入:%v", tc) + } +} + +func Benchmark_shiftingLetters(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shiftingLetters(tc.S, tc.shifts) + } + } +} diff --git a/Algorithms/0849.maximize-distance-to-closest-person/README.md b/Algorithms/0849.maximize-distance-to-closest-person/README.md new file mode 100755 index 000000000..ce9801fb7 --- /dev/null +++ b/Algorithms/0849.maximize-distance-to-closest-person/README.md @@ -0,0 +1,41 @@ +# [849. Maximize Distance to Closest Person](https://leetcode.com/problems/maximize-distance-to-closest-person/) + +## 题目 + +In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. + +There is at least one empty seat, and at least one person sitting. + +Alex wants to sit in the seat such that the distance between him and the closest person to him is maximized. + +Return that maximum distance to closest person. + +Example 1: + +```text +Input: [1,0,0,0,1,0,1] +Output: 2 +Explanation: +If Alex sits in the second open seat (seats[2]), then the closest person has distance 2. +If Alex sits in any other open seat, the closest person has distance 1. +Thus, the maximum distance to the closest person is 2. +``` + +Example 2: + +```text +Input: [1,0,0,0] +Output: 3 +Explanation: +If Alex sits in the last seat, the closest person is 3 seats away. +This is the maximum distance possible, so the answer is 3. +``` + +Note: + +1. 1 <= seats.length <= 20000 +1. seatscontains only 0s or 1s, at least one 0, and at least one 1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person.go b/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person.go new file mode 100755 index 000000000..4ee4967b6 --- /dev/null +++ b/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person.go @@ -0,0 +1,34 @@ +package problem0849 + +func maxDistToClosest(seats []int) int { + size := len(seats) + maxDis := 0 + // e 代表了连续空位的个数 + // 当连续空位两边都有人的时候,maxDis = (e+e%2)/2 + // 如果有一边没人的话, maxDis = e + e := 0 + for i := 0; i < size; i++ { + if e == i { + // 说明 seats[0:i] 全是 0 + maxDis = e + } else { + maxDis = max(maxDis, (e+e%2)/2) + } + if seats[i] == 1 { + e = 0 + } else { + e++ + } + } + + // 当 seats[size-1]==0 的时候 + // e 最后的值,有可能 > maxDis + return max(maxDis, e) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person_test.go b/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person_test.go new file mode 100755 index 000000000..038ac8670 --- /dev/null +++ b/Algorithms/0849.maximize-distance-to-closest-person/maximize-distance-to-closest-person_test.go @@ -0,0 +1,49 @@ +package problem0849 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + seats []int + ans int +}{ + + { + []int{1, 0, 0, 0, 1, 0, 1}, + 2, + }, + + { + []int{0, 0, 0, 1}, + 3, + }, + + { + []int{1, 0, 0, 0}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_maxDistToClosest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxDistToClosest(tc.seats), "输入:%v", tc) + } +} + +func Benchmark_maxDistToClosest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxDistToClosest(tc.seats) + } + } +} diff --git a/Algorithms/0850.rectangle-area-ii/README.md b/Algorithms/0850.rectangle-area-ii/README.md new file mode 100755 index 000000000..d14716dbc --- /dev/null +++ b/Algorithms/0850.rectangle-area-ii/README.md @@ -0,0 +1,36 @@ +# [850. Rectangle Area II](https://leetcode.com/problems/rectangle-area-ii/) + +## 题目 + +We are given a list of (axis-aligned)rectangles. Eachrectangle[i] = [x1, y1, x2, y2], where (x1, y1) are the coordinates of the bottom-left corner, and (x2, y2) are the coordinates of the top-right corner of the ith rectangle. + +Find the total area covered by all rectangles in the plane. Since the answermay be too large, return it modulo 10^9 + 7. + +![pic](rectangle_area_ii_pic.png) + +Example 1: + +```text +Input: [[0,0,2,2],[1,0,2,3],[1,0,3,1]] +Output: 6 +Explanation: As illustrated in the picture. +``` + +Example 2: + +```text +Input: [[0,0,1000000000,1000000000]] +Output: 49 +Explanation: The answer is 10^18 modulo (10^9 + 7), which is (10^9)^2 = (-7)^2 = 49. +``` + +Note: + +1. 1 <= rectangles.length <= 200 +1. rectanges[i].length = 4 +1. 0 <= rectangles[i][j] <= 10^9 +1. The total area covered by all rectangles will never exceed2^63 - 1and thus will fit in a 64-bit signed integer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0850.rectangle-area-ii/rectangle-area-ii.go b/Algorithms/0850.rectangle-area-ii/rectangle-area-ii.go new file mode 100755 index 000000000..ae50dfff2 --- /dev/null +++ b/Algorithms/0850.rectangle-area-ii/rectangle-area-ii.go @@ -0,0 +1,95 @@ +package problem0850 + +import ( + "sort" +) + +// 思路来自 https://leetcode.com/problems/rectangle-area-ii/discuss/137914/C++Python-Discretization-and-O(NlogN) +// +// 可以想象成, +// 根据 rectangles 中所有的 x 值,在平面上划 竖线 +// 根据 rectangles 中所有的 y 值,在平面上划 横线 +// 原先的长方形被划线分隔成更小的长方形 +// 这些小长方形,要么单独存在,要么与别的小长方形**完全重合** +// +// 然后,从下往上,依次统计每一行,所有小长方形的面积,重合的小长方形只统计一次 + +const mod = 1e9 + 7 + +func rectangleArea(rectangles [][]int) int { + // 提取 rectangles 中所有的 x 坐标值,并按照升序排列 + xs := getXs(rectangles) + + // idxs 记录了 x 在 xs 中的索引值,即 + // idxs[key]==val <==> xs[val]==key + idxs := make(map[int]int, 2*len(xs)) + for idx, x := range xs { + idxs[x] = idx + } + + // labels[i]=[y,x1,x2,sig] + // 其中 [y,[x1,x2]] 表示小长方形的一条横边 + // sig==1 为底边 + // sig==-1 为顶边 + labels := getLabels(rectangles) + + // 当 curY=j ,count[i]=5 时,意味着 + // 以 y=j,[xs[i],xs[i+1]] 为底边的小长方形,有 5 个 + count := make([]int, len(xs)) + + curY, curXSum, area := 0, 0, 0 + + for _, l := range labels { + y, x1, x2, sig := l[0], l[1], l[2], l[3] + area += (y - curY) * curXSum + curY = y + // 更新 curXSum + curXSum = 0 + for i := idxs[x1]; i < idxs[x2]; i++ { + // 更新每个小长方形的重合度 + count[i] += sig + } + for i := 0; i+1 < len(count); i++ { + if count[i] > 0 { + // curY 上 + // 所有小长方形**底边**长度相加 + curXSum += xs[i+1] - xs[i] + } + } + } + + return area % mod +} + +func getXs(rects [][]int) []int { + size := len(rects) + xs := make([]int, 0, size*2) + xMap := make(map[int]bool, size*2) + for _, r := range rects { + xMap[r[0]] = true + xMap[r[2]] = true + } + for k := range xMap { + xs = append(xs, k) + } + sort.Ints(xs) + return xs +} + +func getLabels(rects [][]int) [][]int { + labels := make([][]int, 0, 2*len(rects)) + for _, r := range rects { + x1, y1, x2, y2 := r[0], r[1], r[2], r[3] + labels = append(labels, + []int{y1, x1, x2, 1}, + []int{y2, x1, x2, -1}, + ) + } + + // 对 labels 进行排序 + sort.Slice(labels, func(i int, j int) bool { + return labels[i][0] < labels[j][0] + }) + + return labels +} diff --git a/Algorithms/0850.rectangle-area-ii/rectangle-area-ii_test.go b/Algorithms/0850.rectangle-area-ii/rectangle-area-ii_test.go new file mode 100755 index 000000000..df61f3ebc --- /dev/null +++ b/Algorithms/0850.rectangle-area-ii/rectangle-area-ii_test.go @@ -0,0 +1,54 @@ +package problem0850 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + rectangles [][]int + ans int +}{ + + { + [][]int{{0, 0, 2, 2}, {3, 0, 5, 2}}, + 8, + }, + + { + [][]int{{0, 0, 2, 2}, {1, 0, 2, 3}, {1, 0, 3, 1}}, + 6, + }, + + { + [][]int{{0, 0, 1000000000, 1000000000}}, + 49, + }, + + { + [][]int{{0, 0, 1000000000, 1000000000}, {0, 1000000000, 1000000000, 2000000000}}, + 98, + }, + + // 可以有多个 testcase +} + +func Test_rectangleArea(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, rectangleArea(tc.rectangles), "输入:%v", tc) + } +} + +func Benchmark_rectangleArea(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rectangleArea(tc.rectangles) + } + } +} diff --git a/Algorithms/0850.rectangle-area-ii/rectangle_area_ii_pic.png b/Algorithms/0850.rectangle-area-ii/rectangle_area_ii_pic.png new file mode 100644 index 000000000..d9d772610 Binary files /dev/null and b/Algorithms/0850.rectangle-area-ii/rectangle_area_ii_pic.png differ diff --git a/Algorithms/0851.loud-and-rich/README.md b/Algorithms/0851.loud-and-rich/README.md new file mode 100755 index 000000000..e28e68adb --- /dev/null +++ b/Algorithms/0851.loud-and-rich/README.md @@ -0,0 +1,46 @@ +# [851. Loud and Rich](https://leetcode.com/problems/loud-and-rich/) + +## 题目 + +In a group of N people (labelled 0, 1, 2, ..., N-1), each person has different amounts of money, and different levels of quietness. + +For convenience, we'll call the person with label x, simply "person x". + +We'll say that richer[i] = [x, y] if person xdefinitely has more money than persony. Note that richermay only be a subset of valid observations. + +Also, we'll say quiet[x] = q if person xhas quietness q. + +Now, return answer, where answer[x] = y if y is the least quiet person (that is, the person y with the smallest value of quiet[y]), among all peoplewho definitely haveequal to or more money than person x. + +Example 1: + +```text +Input: richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0] +Output: [5,5,2,5,4,5,6,7] +Explanation: +answer[0] = 5. +Person 5 has more money than 3, which has more money than 1, which has more money than 0. +The only person who is quieter (has lower quiet[x]) is person 7, but +it isn't clear if they have more money than person 0. + +answer[7] = 7. +Among all people that definitely have equal to or more money than person 7 +(which could be persons 3, 4, 5, 6, or 7), the person who is the quietest (has lower quiet[x]) +is person 7. + +The other answers can be filled out with similar reasoning. +``` + +Note: + +1. 1 <= quiet.length = N <= 500 +1. 0 <= quiet[i] < N, all quiet[i] are different. +1. 0 <= richer.length <= N * (N-1) / 2 +1. 0 <= richer[i][j] < N +1. richer[i][0] != richer[i][1] +1. richer[i]'s are all different. +1. Theobservations in richer are all logically consistent. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0851.loud-and-rich/loud-and-rich.go b/Algorithms/0851.loud-and-rich/loud-and-rich.go new file mode 100755 index 000000000..82205d35b --- /dev/null +++ b/Algorithms/0851.loud-and-rich/loud-and-rich.go @@ -0,0 +1,39 @@ +package problem0851 + +func loudAndRich(richer [][]int, quiet []int) []int { + size := len(quiet) + + // rs[y] 中保存了所有比 y 有钱的人 + rs := make([][]int, size) + for _, r := range richer { + x, y := r[0], r[1] + rs[y] = append(rs[y], x) + } + + res := make([]int, size) + // res 全部设置为 -1 + // 作为是否设置过的标记 + for i := range res { + res[i] = -1 + } + + var dfs func(int) int + dfs = func(i int) int { + if res[i] >= 0 { + return res[i] + } + res[i] = i + for _, j := range rs[i] { + if quiet[res[i]] > quiet[dfs(j)] { + res[i] = res[j] + } + } + return res[i] + } + + for i := 0; i < size; i++ { + dfs(i) + } + + return res +} diff --git a/Algorithms/0851.loud-and-rich/loud-and-rich_test.go b/Algorithms/0851.loud-and-rich/loud-and-rich_test.go new file mode 100755 index 000000000..11640a7d1 --- /dev/null +++ b/Algorithms/0851.loud-and-rich/loud-and-rich_test.go @@ -0,0 +1,41 @@ +package problem0851 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + richer [][]int + quiet []int + ans []int +}{ + + { + [][]int{{1, 0}, {2, 1}, {3, 1}, {3, 7}, {4, 3}, {5, 3}, {6, 3}}, + []int{3, 2, 5, 4, 6, 1, 7, 0}, + []int{5, 5, 2, 5, 4, 5, 6, 7}, + }, + + // 可以有多个 testcase +} + +func Test_loudAndRich(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, loudAndRich(tc.richer, tc.quiet), "输入:%v", tc) + } +} + +func Benchmark_loudAndRich(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + loudAndRich(tc.richer, tc.quiet) + } + } +} diff --git a/Algorithms/0852.peak-index-in-a-mountain-array/README.md b/Algorithms/0852.peak-index-in-a-mountain-array/README.md new file mode 100755 index 000000000..903e385eb --- /dev/null +++ b/Algorithms/0852.peak-index-in-a-mountain-array/README.md @@ -0,0 +1,34 @@ +# [852. Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array/) + +## 题目 + +Let's call an array A a mountainif the following properties hold: + +- A.length >= 3 +- There exists some 0 < i< A.length - 1 such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1] + +Given an array that is definitely a mountain, return anyisuch thatA[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1]. + +Example 1: + +```text +Input: [0,1,0] +Output: 1 +``` + +Example 2: + +```text +Input: [0,2,1,0] +Output: 1 +``` + +Note: + +1. 3 <= A.length <= 10000 +1. 0 <= A[i] <= 10^6 +1. Ais a mountain, as defined above. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array.go b/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array.go new file mode 100755 index 000000000..7f775ea87 --- /dev/null +++ b/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array.go @@ -0,0 +1,26 @@ +package problem0852 + +func peakIndexInMountainArray(a []int) int { + l, r := 0, len(a)-1 + for { + m := (l + r) / 2 + switch { + case a[m] < a[m+1]: + l = m // 想想看,为什么不是 l = m+1 + case a[m-1] > a[m]: + r = m // 想想看,为什么不是 r = m-1 + default: + return m + } + } +} + +/** + * 通常的二分搜索, 正确值在 [l,r] 内, + * 当 m 不是正确值的时候,需要把 m 排除在新的 [l,r] 外 + * 所以,l = m+1 或 r = m-1,正确值依然在 [l,r] 内 + * + * 此题中的二分搜索,正确值在 (l,r) 内 + * 当 m 不是正确值的时候,需要把 m 排除在新的 (l,r) 外 + * 所以,l = m 或 r = m,正确值依然在 (l,r) 内 + */ diff --git a/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array_test.go b/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array_test.go new file mode 100755 index 000000000..fcc023b4f --- /dev/null +++ b/Algorithms/0852.peak-index-in-a-mountain-array/peak-index-in-a-mountain-array_test.go @@ -0,0 +1,59 @@ +package problem0852 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + +{ + []int{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3851,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,9000,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9680,9681,9682,9683,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9740,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,9893,9894,9895,9896,9897,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,9915,9916,9917,9918,9919,9920,9921,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,9947,9948,9949,9950,9951,9952,9953,9954,9955,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,9966,9967,9968,9969,9970,9971,9972,9973,9974,9975,9976,9977,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,1}, +9998, +}, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 8}, + 8, + }, + + { + []int{8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, + 1, + }, + + { + []int{0, 1, 0}, + 1, + }, + + { + []int{0, 2, 1, 0}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_peakIndexInMountainArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, peakIndexInMountainArray(tc.A), "输入:%v", tc) + } +} + +func Benchmark_peakIndexInMountainArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + peakIndexInMountainArray(tc.A) + } + } +} diff --git a/Algorithms/0853.car-fleet/README.md b/Algorithms/0853.car-fleet/README.md new file mode 100755 index 000000000..204d1890d --- /dev/null +++ b/Algorithms/0853.car-fleet/README.md @@ -0,0 +1,41 @@ +# [853. Car Fleet](https://leetcode.com/problems/car-fleet/) + +## 题目 + +N cars are going to the same destination along a one lane road. The destination is target miles away. + +Each car ihas a constant speed speed[i](in miles per hour), and initial position position[i]miles towards the target along the road. + +A car can never pass another car ahead of it, but it can catch up to it, and drive bumper to bumper at the same speed. + +The distance between these two cars is ignored - they are assumed to have the same position. + +A car fleet is some non-empty set of cars drivingat the same position and same speed. Note that a single car is also a car fleet. + +If a car catches up to a car fleet right at the destination point, it willstill beconsidered as one car fleet. + +How many car fleets will arrive at the destination? + +Example 1: + +```text +Input: target = 12, position = [10,8,0,5,3], speed = [2,4,1,1,3] +Output: 3 +Explanation: +The cars starting at 10 and 8 become a fleet, meeting each other at 12. +The car starting at 0 doesn't catch up to any other car, so it is a fleet by itself. +The cars starting at 5 and 3 become a fleet, meeting each other at 6. +Note that no other cars meet these fleets before the destination, so the answer is 3. +``` + +Note: + +1. 0 <= N <= 10 ^ 4 +1. 0 < target<= 10 ^ 6 +1. 0 rs[j].initPos + }) + + fleetTime := 0. + res := 0 + + for _, r := range rs { + at := r.arrivalTime + if fleetTime < at { + fleetTime = at + res++ + } + } + + return res +} + +type record struct { + initPos int + arrivalTime float64 +} diff --git a/Algorithms/0853.car-fleet/car-fleet_test.go b/Algorithms/0853.car-fleet/car-fleet_test.go new file mode 100755 index 000000000..d93fdeac8 --- /dev/null +++ b/Algorithms/0853.car-fleet/car-fleet_test.go @@ -0,0 +1,57 @@ +package problem0853 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + target int + position []int + speed []int + ans int +}{ + + { + 20, + []int{11, 10, 5}, + []int{9, 9, 10}, + 3, + }, + + { + 12, + []int{10, 8, 0, 5, 3}, + []int{2, 4, 1, 1, 3}, + 3, + }, + + { + 10000, + []int{10, 8, 0, 5, 3}, + []int{2, 4, 10000, 1, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_carFleet(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, carFleet(tc.target, tc.position, tc.speed), "输入:%v", tc) + } +} + +func Benchmark_carFleet(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + carFleet(tc.target, tc.position, tc.speed) + } + } +} diff --git a/Algorithms/0854.k-similar-strings/README.md b/Algorithms/0854.k-similar-strings/README.md new file mode 100755 index 000000000..37fd52697 --- /dev/null +++ b/Algorithms/0854.k-similar-strings/README.md @@ -0,0 +1,44 @@ +# [854. K-Similar Strings](https://leetcode.com/problems/k-similar-strings/) + +## 题目 + +StringsA and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly Ktimes so that the resulting string equals B. + +Given two anagrams A and B, return the smallest Kfor which A and B are K-similar. + +Example 1: + +```text +Input: A = "ab", B = "ba" +Output: 1 +``` + +Example 2: + +```text +Input: A = "abc", B = "bca" +Output: 2 +``` + +Example 3: + +```text +Input: A = "abac", B = "baca" +Output: 2 +``` + +Example 4: + +```text +Input: A = "aabc", B = "abca" +Output: 2 +``` + +Note: + +1. 1 <= A.length == B.length <= 20 +1. A and B contain only lowercase letters from the set {'a', 'b', 'c', 'd', 'e', 'f'} + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0854.k-similar-strings/k-similar-strings.go b/Algorithms/0854.k-similar-strings/k-similar-strings.go new file mode 100755 index 000000000..505186208 --- /dev/null +++ b/Algorithms/0854.k-similar-strings/k-similar-strings.go @@ -0,0 +1,56 @@ +package problem0854 + +func kSimilarity(a, b string) int { + if a == b { + return 0 + } + + hasSeen := make(map[string]bool, 4096) + hasSeen[a] = true + queue := make([]string, 1, 4096) + queue[0] = a + + strSize := len(a) + res := 0 + + // BFS + // 看见 shortest 就要想到 BFS + for { + res++ + for countDown := len(queue); countDown > 0; countDown-- { + // 从 queue 中取出一个候选字符串 + s := queue[0] + queue = queue[1:] + + // 跳过相等的字符 + i := 0 + for s[i] == b[i] { + i++ + } + for j := i + 1; j < strSize; j++ { + if s[j] == b[j] || // 依然跳过相等的字符 + // 还要保证 s 中的 i,j 互换后,s[j] == b[j] + // 要不然,就是没有意义的交换 + s[i] != b[j] { + continue + } + + temp := swap(s, i, j) + if temp == b { + return res + } + + if !hasSeen[temp] { + hasSeen[temp] = true + queue = append(queue, temp) + } + } + } + } +} + +func swap(s string, i, j int) string { + bs := []byte(s) + bs[i], bs[j] = bs[j], bs[i] + return string(bs) +} diff --git a/Algorithms/0854.k-similar-strings/k-similar-strings_test.go b/Algorithms/0854.k-similar-strings/k-similar-strings_test.go new file mode 100755 index 000000000..a3bc5f544 --- /dev/null +++ b/Algorithms/0854.k-similar-strings/k-similar-strings_test.go @@ -0,0 +1,65 @@ +package problem0854 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A string + B string + ans int +}{ + + { + "ab", + "ab", + 0, + }, + + { + "ab", + "ba", + 1, + }, + + { + "abc", + "bca", + 2, + }, + + { + "abac", + "baca", + 2, + }, + + { + "aabc", + "abca", + 2, + }, + + // 可以有多个 testcase +} + +func Test_kSimilarity(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, kSimilarity(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_kSimilarity(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kSimilarity(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0855.exam-room/README.md b/Algorithms/0855.exam-room/README.md new file mode 100755 index 000000000..69f748f37 --- /dev/null +++ b/Algorithms/0855.exam-room/README.md @@ -0,0 +1,34 @@ +# [855. Exam Room](https://leetcode.com/problems/exam-room/) + +## 题目 + +In an exam room, there are N seats in a single row, numbered 0, 1, 2, ..., N-1. + +When a student enters the room, they must sit in the seat that maximizes the distance to the closest person. If there are multiple such seats, they sit in the seat with the lowest number. (Also, if no one is in the room, then the student sits at seat number 0.) + +Return a class ExamRoom(int N)that exposes two functions: ExamRoom.seat()returning an intrepresenting what seat the student sat in, and ExamRoom.leave(int p)representing that the student in seat number pnow leaves the room. It is guaranteed that any calls to ExamRoom.leave(p) have a student sitting in seat p. + +Example 1: + +```text +Input: ["ExamRoom","seat","seat","seat","seat","leave","seat"], [[10],[],[],[],[],[4],[]] +Output: [null,0,9,4,2,null,5] +Explanation: +ExamRoom(10) -> null +seat() -> 0, no one is in the room, then the student sits at seat number 0. +seat() -> 9, the student sits at the last seat number 9. +seat() -> 4, the student sits at the last seat number 4. +seat() -> 2, the student sits at the last seat number 2. +leave(4) -> null +seat() -> 5, the student​​​​​​​ sits at the last seat number 5. +``` + +Note: + +1. 1 <= N <= 10^9 +1. ExamRoom.seat() and ExamRoom.leave() will be called at most 10^4 times across all test cases. +1. Calls to ExamRoom.leave(p) are guaranteed to have a student currently sitting in seat number p. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0855.exam-room/exam-room.go b/Algorithms/0855.exam-room/exam-room.go new file mode 100755 index 000000000..e8ede5d05 --- /dev/null +++ b/Algorithms/0855.exam-room/exam-room.go @@ -0,0 +1,74 @@ +package problem0855 + +// ExamRoom 是题目需要的结构体 +type ExamRoom struct { + seats *[]int + N int +} + +// Constructor 创建 ExamRoom +func Constructor(N int) ExamRoom { // 如果返回 *ExamRoom 后面可以写的好看一些 + t := make([]int, 0, 10000) + return ExamRoom{ + seats: &t, + N: N, + } +} + +// Seat 表示有人入座 +func (r *ExamRoom) Seat() int { + if len(*r.seats) == 0 { + *r.seats = append(*r.seats, 0) + return 0 + } + + f := -(*r.seats)[0] + *r.seats = append(*r.seats, 2*r.N-2-(*r.seats)[len(*r.seats)-1]) + idx := -1 + dis := -1 + seat := -1 + + for i := 0; i < len(*r.seats); i++ { + newDis := ((*r.seats)[i] - f) / 2 + if dis < newDis { + idx = i + dis = newDis + seat = f + dis + } + f = (*r.seats)[i] + } + + copy((*r.seats)[idx+1:], (*r.seats)[idx:]) + + (*r.seats)[idx] = seat + + return seat +} + +// Leave 表示有人离座 +func (r *ExamRoom) Leave(p int) { + size := len(*r.seats) + left, right := 0, size-1 + + for { // 题目保证了 p 一定在 r.seats 中 + m := (left + right) / 2 + mp := (*r.seats)[m] + switch { + case mp < p: + left = m + 1 + case p < mp: + right = m - 1 + default: + copy((*r.seats)[m:], (*r.seats)[m+1:]) + *r.seats = (*r.seats)[:size-1] + return + } + } +} + +/** + * Your ExamRoom object will be instantiated and called as such: + * obj := Constructor(N); + * param_1 := obj.Seat(); + * obj.Leave(p); + */ diff --git a/Algorithms/0855.exam-room/exam-room_test.go b/Algorithms/0855.exam-room/exam-room_test.go new file mode 100755 index 000000000..882ac265a --- /dev/null +++ b/Algorithms/0855.exam-room/exam-room_test.go @@ -0,0 +1,37 @@ +package problem0855 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_ExamRoom(t *testing.T) { + ast := assert.New(t) + + r := Constructor(10) + + seats := []int{0, 9, 4, 2} + + for i := 0; i < len(seats); i++ { + ast.Equal(seats[i], r.Seat(), "第 %d 次,入座了 %d", i, seats[i]) + } + + r.Leave(4) + + ast.Equal(5, r.Seat(), "4 号位离座后,应该是 5 号位入座") + + r.Leave(0) + + ast.Equal(0, r.Seat(), "0 号位离座后,应该是 0 号位入座") +} + +func Test_ExamRoom_2(t *testing.T) { + ast := assert.New(t) + r := Constructor(1000000000) + + for i := 0; i < 10; i++ { + ast.Equal(0, r.Seat(), "第 %d 次,入座了 %d", i, 0) + r.Leave(0) + } +} diff --git a/Algorithms/0856.score-of-parentheses/README.md b/Algorithms/0856.score-of-parentheses/README.md new file mode 100755 index 000000000..20c226712 --- /dev/null +++ b/Algorithms/0856.score-of-parentheses/README.md @@ -0,0 +1,46 @@ +# [856. Score of Parentheses](https://leetcode.com/problems/score-of-parentheses/) + +## 题目 + +Given a balanced parentheses string S, compute the score of the string based on the following rule: + +- () has score 1 +- AB has score A + B, where A and B are balanced parentheses strings. +- (A) has score 2 * A, where A is a balanced parentheses string. + +Example 1: + +```text +Input: "()" +Output: 1 +``` + +Example 2: + +```text +Input: "(())" +Output: 2 +``` + +Example 3: + +```text +Input: "()()" +Output: 2 +``` + +Example 4: + +```text +Input: "(()(()))" +Output: 6 +``` + +Note: + +1. S is a balanced parentheses string, containing only ( and ). +1. 2 <= S.length <= 50 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0856.score-of-parentheses/score-of-parentheses.go b/Algorithms/0856.score-of-parentheses/score-of-parentheses.go new file mode 100755 index 000000000..2c5638c10 --- /dev/null +++ b/Algorithms/0856.score-of-parentheses/score-of-parentheses.go @@ -0,0 +1,18 @@ +package problem0856 + +func scoreOfParentheses(s string) int { + res := 0 + factor := 1 + size := len(s) + for i := 0; i < size; i++ { + if s[i] == '(' { + factor *= 2 + } else { + factor /= 2 + } + if s[i] == '(' && s[i+1] == ')' { + res += factor / 2 + } + } + return res +} diff --git a/Algorithms/0856.score-of-parentheses/score-of-parentheses_test.go b/Algorithms/0856.score-of-parentheses/score-of-parentheses_test.go new file mode 100755 index 000000000..a656e0cfb --- /dev/null +++ b/Algorithms/0856.score-of-parentheses/score-of-parentheses_test.go @@ -0,0 +1,54 @@ +package problem0856 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "()", + 1, + }, + + { + "(())", + 2, + }, + + { + "()()", + 2, + }, + + { + "(()(()))", + 6, + }, + + // 可以有多个 testcase +} + +func Test_scoreOfParentheses(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, scoreOfParentheses(tc.S), "输入:%v", tc) + } +} + +func Benchmark_scoreOfParentheses(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + scoreOfParentheses(tc.S) + } + } +} diff --git a/Algorithms/0857.minimum-cost-to-hire-k-workers/README.md b/Algorithms/0857.minimum-cost-to-hire-k-workers/README.md new file mode 100755 index 000000000..000e02d15 --- /dev/null +++ b/Algorithms/0857.minimum-cost-to-hire-k-workers/README.md @@ -0,0 +1,39 @@ +# [857. Minimum Cost to Hire K Workers](https://leetcode.com/problems/minimum-cost-to-hire-k-workers/) + +## 题目 + +There are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i]. + +Now we want to hire exactly Kworkers to form a paid group. When hiring a group of K workers, we must pay them according to the following rules: + +1. Every worker in the paid group should be paid in the ratio of their quality compared to other workers in the paid group. +1. Every worker in the paid group must be paid at least their minimum wage expectation. + +Return the least amount of money needed to form a paid group satisfying the above conditions. + +Example 1: + +```text +Input: quality = [10,20,5], wage = [70,50,30], K = 2 +Output: 105.00000 +Explanation: We pay 70 to 0-th worker and 35 to 2-th worker. +``` + +Example 2: + +```text +Input: quality = [3,1,10,10,1], wage = [4,8,2,2,7], K = 3 +Output: 30.66667 +Explanation: We pay 4 to 0-th worker, 13.33333 to 2-th and 3-th workers seperately. +``` + +Note: + +1. 1 <= K <= N <= 10000, where N = quality.length = wage.length +1. 1 <= quality[i] <= 10000 +1. 1 <= wage[i] <= 10000 +1. Answers within 10^-5 of the correct answer will be considered correct. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers.go b/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers.go new file mode 100755 index 000000000..e4a163b28 --- /dev/null +++ b/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers.go @@ -0,0 +1,82 @@ +package problem0857 + +import ( + "container/heap" + "sort" +) + +func mincostToHireWorkers(quality []int, wage []int, K int) float64 { + size := len(quality) + + workers := make([][2]float64, size) + for i := 0; i < size; i++ { + w, q := float64(wage[i]), float64(quality[i]) + ratio := w / q + workers[i] = [2]float64{ratio, q} + } + sort.Slice(workers, func(i int, j int) bool { + return workers[i][0] < workers[j][0] + }) + + pq := make(PQ, 0, size) + qSum := 0. + for i := 0; i < K; i++ { + q := workers[i][1] + pq = append(pq, q) + qSum += q + } + + maxRatio := workers[K-1][0] + + cost := qSum * maxRatio + + heap.Init(&pq) + + for i := K; i < size; i++ { + maxRatio, q := workers[i][0], workers[i][1] + if q >= pq[0] { + /* q >= pq[0] 时,qSum 不变,maxRatio 变大,qSum*maxRatio 不会是新低 */ + continue + } + heap.Push(&pq, q) + qSum += q + qSum -= heap.Pop(&pq).(float64) + /* qSum 总是 workers[:i+1] 中 K 个最小的 q 之和 */ + cost = min(cost, qSum*maxRatio) + } + + return cost +} + +// PQ implements heap.Interface +type PQ []float64 + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i] > pq[j] +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 x +func (pq *PQ) Push(x interface{}) { + temp := x.(float64) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 x +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} + +func min(a, b float64) float64 { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers_test.go b/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers_test.go new file mode 100755 index 000000000..432bd9720 --- /dev/null +++ b/Algorithms/0857.minimum-cost-to-hire-k-workers/minimum-cost-to-hire-k-workers_test.go @@ -0,0 +1,72 @@ +package problem0857 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + quality []int + wage []int + K int + ans float64 +}{ + + { + []int{3000, 1, 20, 200, 1}, + []int{30000, 8, 5, 50, 7}, + 3, + 176, + }, + + { + []int{3000, 1, 20, 200, 1}, + []int{4000, 8, 5, 50, 7}, + 3, + 176, + }, + + { + []int{3000, 1, 10, 10, 1}, + []int{4000, 8, 2, 2, 7}, + 3, + 96, + }, + + { + []int{10, 20, 5}, + []int{70, 50, 30}, + 2, + 105.00000, + }, + + { + []int{3, 1, 10, 10, 1}, + []int{4, 8, 2, 2, 7}, + 3, + 30.66667, + }, + + // 可以有多个 testcase +} + +func Test_mincostToHireWorkers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + res := mincostToHireWorkers(tc.quality, tc.wage, tc.K) + ast.InDelta(tc.ans, res, 0.00001, "输入:%v", tc) + } +} + +func Benchmark_mincostToHireWorkers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + mincostToHireWorkers(tc.quality, tc.wage, tc.K) + } + } +} diff --git a/Algorithms/0858.mirror-reflection/README.md b/Algorithms/0858.mirror-reflection/README.md new file mode 100755 index 000000000..95d537de6 --- /dev/null +++ b/Algorithms/0858.mirror-reflection/README.md @@ -0,0 +1,28 @@ +# [858. Mirror Reflection](https://leetcode.com/problems/mirror-reflection/) + +## 题目 + +There isa special square room with mirrors on each of the fourwalls. Except for the southwestcorner, there are receptors on each of the remaining corners, numbered 0, 1, and 2. + +The square room has walls of length p, and a laser ray from the southwest cornerfirst meets the east wall at a distance qfrom the 0th receptor. + +Return the number of the receptor that the ray meets first. (It is guaranteed that the ray will meeta receptor eventually.) + +Example 1: + +```text +Input: p = 2, q = 1 +Output: 2 +Explanation: The ray meets receptor 2 the first time it gets reflected back to the left wall. +``` + +![reflection picture](reflection.png) + +Note: + +1. 1 <= p <= 1000 +1. 0 <= q <= p + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0858.mirror-reflection/mirror-reflection.go b/Algorithms/0858.mirror-reflection/mirror-reflection.go new file mode 100755 index 000000000..f2c1311a0 --- /dev/null +++ b/Algorithms/0858.mirror-reflection/mirror-reflection.go @@ -0,0 +1,27 @@ +package problem0858 + +// 在坐标系中,画上间距为 p 的网格 +// 按照题目中的镜像关系标注网格中的点为 0,1,2 +// 可以总结出以下规律 +func mirrorReflection(p int, q int) int { + l := lcm(p, q) + if (l/q)%2 == 0 { + return 2 + } + return (l / p) % 2 +} + +// p 和 q 的最小公倍数 +// p >= q +func lcm(p, q int) int { + return p * q / gcd(p, q) +} + +// p 和 q 的最大公约数 +// p >= q +func gcd(p, q int) int { + for q != 0 { + p, q = q, p%q + } + return p +} diff --git a/Algorithms/0858.mirror-reflection/mirror-reflection_test.go b/Algorithms/0858.mirror-reflection/mirror-reflection_test.go new file mode 100755 index 000000000..f45071a67 --- /dev/null +++ b/Algorithms/0858.mirror-reflection/mirror-reflection_test.go @@ -0,0 +1,47 @@ +package problem0858 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + p int + q int + ans int +}{ + + { + 2, + 2, + 1, + }, + + { + 2, + 1, + 2, + }, + + // 可以有多个 testcase +} + +func Test_mirrorReflection(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, mirrorReflection(tc.p, tc.q), "输入:%v", tc) + } +} + +func Benchmark_mirrorReflection(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + mirrorReflection(tc.p, tc.q) + } + } +} diff --git a/Algorithms/0858.mirror-reflection/reflection.png b/Algorithms/0858.mirror-reflection/reflection.png new file mode 100644 index 000000000..0b15f47aa Binary files /dev/null and b/Algorithms/0858.mirror-reflection/reflection.png differ diff --git a/Algorithms/0859.buddy-strings/README.md b/Algorithms/0859.buddy-strings/README.md new file mode 100755 index 000000000..ffcea1676 --- /dev/null +++ b/Algorithms/0859.buddy-strings/README.md @@ -0,0 +1,50 @@ +# [859. Buddy Strings](https://leetcode.com/problems/buddy-strings/) + +## 题目 + +Given two strings A and Bof lowercase letters, return true if and only if wecan swap two letters in A so that the result equals B. + +Example 1: + +```text +Input: A = "ab", B = "ba" +Output: true +``` + +Example 2: + +```text +Input: A = "ab", B = "ab" +Output: false +``` + +Example 3: + +```text +Input: A = "aa", B = "aa" +Output: true +``` + +Example 4: + +```text +Input: A = "aaaaaaabc", B = "aaaaaaacb" +Output: true +``` + +Example 5: + +```text +Input: A = "", B = "aa" +Output: false +``` + +Note: + +1. 0 <= A.length <= 20000 +1. 0 <= B.length <= 20000 +1. A andB consist only of lowercase letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0859.buddy-strings/buddy-strings.go b/Algorithms/0859.buddy-strings/buddy-strings.go new file mode 100755 index 000000000..fbd8c729f --- /dev/null +++ b/Algorithms/0859.buddy-strings/buddy-strings.go @@ -0,0 +1,38 @@ +package problem0859 + +func buddyStrings(A, B string) bool { + if len(A) != len(B) { + return false + } + + if A == B { + return hasDouble(A) + } + + size := len(A) + i := 0 + countDown := 2 + ca, cb := byte(0), byte(0) + for countDown > 0 && i < size { + if A[i] != B[i] { + ca += A[i] + cb += B[i] + countDown-- + } + i++ + } + + return ca == cb && A[i:] == B[i:] +} + +func hasDouble(s string) bool { + seen := [26]bool{} + for i := range s { + b := s[i] - 'a' + if seen[b] { + return true + } + seen[b] = true + } + return false +} diff --git a/Algorithms/0859.buddy-strings/buddy-strings_test.go b/Algorithms/0859.buddy-strings/buddy-strings_test.go new file mode 100755 index 000000000..65cdabafe --- /dev/null +++ b/Algorithms/0859.buddy-strings/buddy-strings_test.go @@ -0,0 +1,65 @@ +package problem0859 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A string + B string + ans bool +}{ + + { + "ab", + "ba", + true, + }, + + { + "ab", + "ab", + false, + }, + + { + "aa", + "aa", + true, + }, + + { + "aaaaaaabc", + "aaaaaaacb", + true, + }, + + { + "", + "aa", + false, + }, + + // 可以有多个 testcase +} + +func Test_buddyStrings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, buddyStrings(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_buddyStrings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + buddyStrings(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0860.lemonade-change/README.md b/Algorithms/0860.lemonade-change/README.md new file mode 100755 index 000000000..566c85e0c --- /dev/null +++ b/Algorithms/0860.lemonade-change/README.md @@ -0,0 +1,60 @@ +# [860. Lemonade Change](https://leetcode.com/problems/lemonade-change/) + +## 题目 + +At a lemonade stand, each lemonade costs $5. + +Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). + +Each customer will only buy one lemonade andpay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net transaction is that the customer pays $5. + +Note that you don't have any changein hand at first. + +Return trueif and only if you can provide every customer with correct change. + +Example 1: + +```text +Input: [5,5,5,10,20] +Output: true +Explanation: +From the first 3 customers, we collect three $5 bills in order. +From the fourth customer, we collect a $10 bill and give back a $5. +From the fifth customer, we give a $10 bill and a $5 bill. +Since all customers got correct change, we output true. +``` + +Example 2: + +```text +Input: [5,5,10] +Output: true +``` + +Example 3: + +```text +Input: [10,10] +Output: false +``` + +Example 4: + +```text +Input: [5,5,10,10,20] +Output: false +Explanation: +From the first two customers in order, we collect two $5 bills. +For the next two customers in order, we collect a $10 bill and give back a $5 bill. +For the last customer, we can't give change of $15 back because we only have two $10 bills. +Since not every customer received correct change, the answer is false. +``` + +Note: + +1. 0 <= bills.length <= 10000 +1. bills[i]will be either5, 10, or 20. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0860.lemonade-change/lemonade-change.go b/Algorithms/0860.lemonade-change/lemonade-change.go new file mode 100755 index 000000000..f91e3d7cf --- /dev/null +++ b/Algorithms/0860.lemonade-change/lemonade-change.go @@ -0,0 +1,29 @@ +package problem0860 + +func lemonadeChange(bills []int) bool { + fives, tens := 0, 0 + + for _, b := range bills { + switch b { + case 5: + fives++ + case 10: + fives-- + tens++ + case 20: + if tens > 0 { + // 找零的时候,尽量先给 10 元的整钱 + // 而不是两个 5 元 + tens-- + fives-- + } else { + fives -= 3 + } + } + if fives < 0 || tens < 0 { + return false + } + } + + return true +} diff --git a/Algorithms/0860.lemonade-change/lemonade-change_test.go b/Algorithms/0860.lemonade-change/lemonade-change_test.go new file mode 100755 index 000000000..6d4485a4b --- /dev/null +++ b/Algorithms/0860.lemonade-change/lemonade-change_test.go @@ -0,0 +1,59 @@ +package problem0860 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + bills []int + ans bool +}{ + + { + []int{5, 5, 5, 10, 20}, + true, + }, + + { + []int{5, 5, 5, 20, 10, 20}, + false, + }, + + { + []int{5, 5, 10}, + true, + }, + + { + []int{10, 10}, + false, + }, + + { + []int{5, 5, 10, 10, 20}, + false, + }, + + // 可以有多个 testcase +} + +func Test_lemonadeChange(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, lemonadeChange(tc.bills), "输入:%v", tc) + } +} + +func Benchmark_lemonadeChange(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lemonadeChange(tc.bills) + } + } +} diff --git a/Algorithms/0861.score-after-flipping-matrix/README.md b/Algorithms/0861.score-after-flipping-matrix/README.md new file mode 100755 index 000000000..645761b59 --- /dev/null +++ b/Algorithms/0861.score-after-flipping-matrix/README.md @@ -0,0 +1,31 @@ +# [861. Score After Flipping Matrix](https://leetcode.com/problems/score-after-flipping-matrix/) + +## 题目 + +We have a two dimensional matrixA where each value is 0 or 1. + +A move consists of choosing any row or column, and toggling each value in that row or column: changing all 0s to 1s, and all 1s to 0s. + +After making any number of moves, every row of this matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers. + +Return the highest possiblescore. + +Example 1: + +```text +Input: [[0,0,1,1],[1,0,1,0],[1,1,0,0]] +Output: 39 +Explanation: +Toggled to [[1,1,1,1],[1,0,0,1],[1,1,1,1]]. +0b1111 + 0b1001 + 0b1111 = 15 + 9 + 15 = 39 +``` + +Note: + +1. 1 <= A.length <= 20 +1. 1 <= A[0].length <= 20 +1. A[i][j]is 0 or 1. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix.go b/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix.go new file mode 100755 index 000000000..712cc3eb4 --- /dev/null +++ b/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix.go @@ -0,0 +1,41 @@ +package problem0861 + +func matrixScore(A [][]int) int { + m, n := len(A), len(A[0]) + + toggleRow := func(i int) { + for j := 0; j < n; j++ { + A[i][j] ^= 1 + } + } + + countCol := func(j int) int { + c := 0 + for i := 0; i < m; i++ { + c += A[i][j] + } + return c + } + + // 1. 保证每行的最高位是 1 + for i := 0; i < m; i++ { + if A[i][0] == 0 { + toggleRow(i) + } + } + + res := m // 因为 m 行的开头都是 1 + + // 2. 从第 1 列开始统计每列中 1 的个数 + // 当 1 的个数不足 m 的一半时,需要翻转此列 + // 翻转后的 1 的个数为 m-c + for j := 1; j < n; j++ { + c := countCol(j) + if 2*c < m { + c = m - c + } + res = res*2 + c + } + + return res +} diff --git a/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix_test.go b/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix_test.go new file mode 100755 index 000000000..28aa44f42 --- /dev/null +++ b/Algorithms/0861.score-after-flipping-matrix/score-after-flipping-matrix_test.go @@ -0,0 +1,44 @@ +package problem0861 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans int +}{ + + { + [][]int{{0, 0, 1, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}}, + 39, + }, + + { + [][]int{{1, 1}, {1, 1}, {0, 1}}, + 8, + }, + + // 可以有多个 testcase +} + +func Test_matrixScore(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, matrixScore(tc.A), "输入:%v", tc) + } +} + +func Benchmark_matrixScore(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + matrixScore(tc.A) + } + } +} diff --git a/Algorithms/0862.shortest-subarray-with-sum-at-least-k/README.md b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/README.md new file mode 100755 index 000000000..00d1463e7 --- /dev/null +++ b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/README.md @@ -0,0 +1,38 @@ +# [862. Shortest Subarray with Sum at Least K](https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/) + +## 题目 + +Return the length of the shortest, non-empty, contiguoussubarray of A with sum at least K. + +If there is no non-empty subarray with sum at least K, return -1. + +Example 1: + +```text +Input: A = [1], K = 1 +Output: 1 +``` + +Example 2: + +```text +Input: A = [1,2], K = 4 +Output: -1 +``` + +Example 3: + +```text +Input: A = [2,-1,2], K = 3 +Output: 3 +``` + +Note: + +1. 1 <= A.length <= 50000 +1. -10 ^ 5<= A[i] <= 10 ^ 5 +1. 1 <= K <= 10 ^ 9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k.go b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k.go new file mode 100755 index 000000000..e5bb98913 --- /dev/null +++ b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k.go @@ -0,0 +1,55 @@ +package problem0862 + +func shortestSubarray(a []int, K int) int { + size := len(a) + + sums := make([]int, size+1) + s := 0 + for i, n := range a { + if n == K { + return 1 + } + s += n + sums[i+1] = s + } + + initialValue := size * 2 + res := initialValue + + deque := make([]int, size+1) + deque[0] = 0 + first, last := 0, 0 + // deque[first:last+1] 中保存了以后会用到的 sums 中元素的索引号 + + for i := 1; i <= size; i++ { + for first <= last && sums[i]-sums[deque[first]] >= K { + // 由于 i 递增 + // 即使以后会有 j>i 使得 sums[j] - sums[deque[first]] >= K + // 但是由于 j>i, 导致 j-deque[first] > i-deque[first] 不会是更短的答案。 + // 所以,可以把 deque[first] 删除 + res = min(res, i-deque[first]) + first++ + } + for first <= last && sums[i] <= sums[deque[last]] { + // 如果存在 j>i>deque[last] 使得 sums[j] - sums[deque[last]] >= K + // 由于 sums[deque[last]] >= sums[i] 则 + // sums[j] - sums[i] >= K 一定成立,并且 j-i < j-deque[last] + // 所以,没有必要把 deque[last] 放入队列中 + last-- + } + last++ + deque[last] = i + } + + if res == initialValue { + return -1 + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k_test.go b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k_test.go new file mode 100755 index 000000000..1e2ea43b8 --- /dev/null +++ b/Algorithms/0862.shortest-subarray-with-sum-at-least-k/shortest-subarray-with-sum-at-least-k_test.go @@ -0,0 +1,59 @@ +package problem0862 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{48, 99, 37, 4, -31}, + 140, + 2, + }, + + { + []int{1}, + 1, + 1, + }, + + { + []int{1, 2}, + 4, + -1, + }, + + { + []int{2, -1, 2}, + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_shortestSubarray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestSubarray(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_shortestSubarray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestSubarray(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0863.all-nodes-distance-k-in-binary-tree/README.md b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/README.md new file mode 100755 index 000000000..948a65837 --- /dev/null +++ b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/README.md @@ -0,0 +1,35 @@ +# [863. All Nodes Distance K in Binary Tree](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/) + +## 题目 + +We are given a binary tree (with root noderoot), a target node, and an integer value K. + +Return a list of the values of allnodes that have a distance K from the target node. The answer can be returned in any order. + +Example 1: + +```text +Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, K = 2 + +Output: [7,4,1] + +Explanation: +The nodes that are a distance 2 from the target node (with value 5) +have values 7, 4, and 1. + +Note that the inputs "root" and "target" are actually TreeNodes. +The descriptions of the inputs above are just serializations of these objects. +``` + +![pic](pic.png) + +Note: + +1. The given tree is non-empty. +1. Each node in the tree has unique values0 <= node.val <= 500. +1. The targetnode is a node in the tree. +1. 0 <= K <= 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree.go b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree.go new file mode 100755 index 000000000..eca46a3fe --- /dev/null +++ b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree.go @@ -0,0 +1,69 @@ +package problem0863 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +/*TreeNode 是题目预定义的类型 + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +type TreeNode = kit.TreeNode + +func distanceK(root *TreeNode, target *TreeNode, k int) []int { + res := make([]int, 0, 2048) + search(root, target, k, &res) + return res +} + +// check 检查 root 到 target 的 dist 是否已经是 k 了 +func check(root *TreeNode, dist, k int, res *[]int) { + if root == nil || dist > k { + return + } + + if dist == k { + *res = append(*res, root.Val) + return + } + + check(root.Left, dist+1, k, res) + check(root.Right, dist+1, k, res) +} + +// search 返回从 root 到 target 的距离 +// 返回值 -1 表示 target 不在 root 及其子节点中 +func search(root, target *TreeNode, k int, res *[]int) (dist int) { + if root == nil { + return -1 + } + + if root == target { + check(root, 0, k, res) + return 0 + } + + isIn := func(child, theOther *TreeNode) bool { + childDist := search(child, target, k, res) + if childDist > -1 { + dist = childDist + 1 + if dist == k { + *res = append(*res, root.Val) + } else if dist < k { + check(theOther, dist+1, k, res) + } + return true + } + return false + } + + if !isIn(root.Left, root.Right) && !isIn(root.Right, root.Left) { + return -1 + } + + return dist +} diff --git a/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree_test.go b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree_test.go new file mode 100755 index 000000000..dda883f26 --- /dev/null +++ b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/all-nodes-distance-k-in-binary-tree_test.go @@ -0,0 +1,98 @@ +package problem0863 + +import ( + "fmt" + "sort" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + target int + K int + ans []int +}{ + + { + []int{0, kit.NULL, 1, 2, 5, kit.NULL, 3, kit.NULL, kit.NULL, kit.NULL, 4}, + 2, + 2, + []int{4, 5, 0}, + }, + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}, + 4, + 2, + []int{5, 7}, + }, + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}, + 5, + 1, + []int{2, 3, 6}, + }, + + { + []int{0, kit.NULL, 1, kit.NULL, 2, kit.NULL, 3}, + 1, + 2, + []int{3}, + }, + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}, + 5, + 0, + []int{5}, + }, + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}, + 5, + 2, + []int{7, 4, 1}, + }, + + { + []int{3}, + 3, + 0, + []int{3}, + }, + + // 可以有多个 testcase +} + +func Test_distanceK(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + + root := kit.Ints2TreeNode(tc.root) + target := kit.GetTargetNode(root, tc.target) + ans := distanceK(root, target, tc.K) + sort.Ints(ans) + sort.Ints(tc.ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_distanceK(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + + root := kit.Ints2TreeNode(tc.root) + target := kit.GetTargetNode(root, tc.target) + + distanceK(root, target, tc.K) + } + } +} diff --git a/Algorithms/0863.all-nodes-distance-k-in-binary-tree/pic.png b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/pic.png new file mode 100644 index 000000000..b516fb3d9 Binary files /dev/null and b/Algorithms/0863.all-nodes-distance-k-in-binary-tree/pic.png differ diff --git a/Algorithms/0864.shortest-path-to-get-all-keys/README.md b/Algorithms/0864.shortest-path-to-get-all-keys/README.md new file mode 100755 index 000000000..dd8cfcf06 --- /dev/null +++ b/Algorithms/0864.shortest-path-to-get-all-keys/README.md @@ -0,0 +1,36 @@ +# [864. Shortest Path to Get All Keys](https://leetcode.com/problems/shortest-path-to-get-all-keys/) + +## 题目 + +We are given a 2-dimensionalgrid."." is an empty cell, "#" isa wall, "@" is the starting point, ("a", "b", ...) are keys, and ("A","B", ...) are locks. + +We start at the starting point, and one move consists of walking one space in one of the 4 cardinal directions. We cannot walk outside the grid, or walk into a wall. If we walk over a key, we pick it up. We can't walk over a lock unless we have the corresponding key. + +For some 1 <= K <= 6, there is exactly one lowercase and one uppercase letter of the first K letters of the English alphabet in the grid. This means that there is exactly one key for each lock, and one lock for each key; and also that the letters used to represent the keys and locks werechosen in the same order as the English alphabet. + +Return the lowest number of moves to acquire all keys. Ifit's impossible, return -1. + +Example 1: + +```text +Input: ["@.a.#","###.#","b.A.B"] +Output: 8 +``` + +Example 2: + +```text +Input: ["@..aA","..B#.","....b"] +Output: 6 +``` + +Note: + +1. 1 <= grid.length<= 30 +1. 1 <= grid[0].length<= 30 +1. grid[i][j] contains only '.', '#', '@','a'-'f' and 'A'-'F' +1. The number of keys is in [1, 6]. Each key has a different letter and opens exactly one lock. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys.go b/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys.go new file mode 100755 index 000000000..5b555f1ed --- /dev/null +++ b/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys.go @@ -0,0 +1,96 @@ +package problem0864 + +var dx = [4]int{1, -1, 0, 0} +var dy = [4]int{0, 0, 1, -1} + +func shortestPathAllKeys(grid []string) int { + m, n := len(grid), len(grid[0]) + + /** 按照题目给出的条件,在 30*30 的矩阵中,最多 6 把 key, + * 使用 6 bit 的整数,就可以记录全部 2^6 = 64 种拥有钥匙的状态 + * 所以,30×30×64 的数组,就可以记录所有的状态。 */ + + hasSeen := [30][30][64]bool{} + queue := make([]int, 1, m*n*4) + allKeys := 0 + + // 获取起点位置,和所有 key 的信息 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + b := grid[i][j] + if b >= 'a' { + allKeys |= 1 << uint(b-'a') + } else if b == '@' { + hasSeen[i][j][0] = true + queue[0] = encode(i, j, 0) + } + } + } + + steps := 1 + + /**bfs */ + for len(queue) > 0 { + size := len(queue) + + for i := 0; i < size; i++ { + x, y, keys := decode(queue[i]) + + for j := 0; j < 4; j++ { + nx, ny := x+dx[j], y+dy[j] + + inRange := 0 <= nx && nx < m && 0 <= ny && ny < n + if !inRange { + continue + } + + b := grid[nx][ny] + if b == '#' || // 遇见墙了,或者,没有钥匙开锁 + 'A' <= b && b <= 'F' && keys&(1<= 'a' { + nkeys |= 1 << uint(b-'a') // 带上这个钥匙 + if nkeys == allKeys { + return steps + } + } + + if hasSeen[nx][ny][nkeys] { + continue + } + + hasSeen[nx][ny][nkeys] = true + queue = append(queue, encode(nx, ny, nkeys)) + } + } + + queue = queue[size:] + steps++ + } + + return -1 +} + +const ( + xBits = 16 + yBits = 8 + mask = 0xFF +) + +/**由于 x, y, keys 的范围都很小 + * 可以用同一个 int 数字的不同的 bit 位段,来分别记录他们的值 + * 具体的记录方式,参考下方的 encode 和 decode 函数 */ + +func encode(x, y, keys int) int { + return x<> xBits + y = state >> yBits & mask + keys = state & mask + return +} diff --git a/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys_test.go b/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys_test.go new file mode 100755 index 000000000..f3cd1e97b --- /dev/null +++ b/Algorithms/0864.shortest-path-to-get-all-keys/shortest-path-to-get-all-keys_test.go @@ -0,0 +1,74 @@ +package problem0864 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid []string + ans int +}{ + + { + []string{"@...a", ".###A", "b.BCc"}, + 10, + }, + + { + []string{"@abcdeABCDEFf"}, + -1, + }, + + { + []string{"@..aA", "..B#.", "....b"}, + 6, + }, + + { + []string{"@.a.#", "###.#", "b.A.B"}, + 8, + }, + + { + []string{"@.....", ".####.", "....#.", ".##.#.", "BC#A#.", ".c#b#a"}, + 38, + }, + + { + []string{"@.....", ".####.", "....#.", ".##.#.", "BA#C#.", ".a#b#c"}, + 38, + }, + + { + []string{"@.....", ".####.", "....#.", ".##.#.", "BA#A#.", ".a#b#a"}, + 28, + }, + + { + []string{"@.....", ".####.", "....#.", ".##.#.", "CB#A#.", ".c#b#a"}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_shortestPathAllKeys(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, shortestPathAllKeys(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_shortestPathAllKeys(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestPathAllKeys(tc.grid) + } + } +} diff --git a/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/README.md b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/README.md new file mode 100755 index 000000000..ee765b115 --- /dev/null +++ b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/README.md @@ -0,0 +1,36 @@ +# [865. Smallest Subtree with all the Deepest Nodes](https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/) + +## 题目 + +Given a binary tree rooted at root, the depth of each node is the shortest distance to the root. + +A node is deepest if it has the largest depth possible amongany node in the entire tree. + +The subtree of a node is that node, plus the set of all descendants of that node. + +Return the node with the largest depth such that it contains all the deepest nodes in its subtree. + +Example 1: + +```text +Input: [3,5,1,6,2,0,8,null,null,7,4] +Output: [2,7,4] +Explanation: + +We return the node with value 2, colored in yellow in the diagram. +The nodes colored in blue are the deepest nodes of the tree. +The input "[3, 5, 1, 6, 2, 0, 8, null, null, 7, 4]" is a serialization of the given tree. +The output "[2, 7, 4]" is a serialization of the subtree rooted at the node with value 2. +Both the input and output have TreeNode type. +``` + +![pic](pic.png) + +Note: + +1. The number of nodes in the tree will be between 1 and 500. +1. The values of each node are unique. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/pic.png b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/pic.png new file mode 100644 index 000000000..7d1a945b8 Binary files /dev/null and b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/pic.png differ diff --git a/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes.go b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes.go new file mode 100755 index 000000000..9a4d25167 --- /dev/null +++ b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes.go @@ -0,0 +1,41 @@ +package problem0865 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode 是预定义的数据结构 +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +type TreeNode = kit.TreeNode + +func subtreeWithAllDeepest(root *TreeNode) *TreeNode { + res, _ := walk(root) + return res +} + +// walk 就是 subtreeWithAllDeepest +// 只是多返回树的深度结果 +func walk(root *TreeNode) (*TreeNode, int) { + if root == nil { + return nil, 0 + } + + lst, l := walk(root.Left) + rst, r := walk(root.Right) + + switch { + case l > r: + return lst, l + 1 + case l < r: + return rst, r + 1 + default: + return root, r + 1 + } +} diff --git a/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes_test.go b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes_test.go new file mode 100755 index 000000000..16d8565a0 --- /dev/null +++ b/Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes/smallest-subtree-with-all-the-deepest-nodes_test.go @@ -0,0 +1,50 @@ +package problem0865 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans []int +}{ + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4}, + []int{2, 7, 4}, + }, + + { + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4, 9, 10}, + []int{3, 5, 1, 6, 2, 0, 8, kit.NULL, kit.NULL, 7, 4, 9, 10}, + }, + + // 可以有多个 testcase +} + +func Test_subtreeWithAllDeepest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2TreeNode(tc.root) + actual := kit.Tree2Preorder(subtreeWithAllDeepest(root)) + expected := kit.Tree2Preorder(kit.Ints2TreeNode(tc.ans)) + ast.Equal(expected, actual, "输入:%v", tc) + } +} + +func Benchmark_subtreeWithAllDeepest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + subtreeWithAllDeepest(root) + } + } +} diff --git a/Algorithms/0866.prime-palindrome/README.md b/Algorithms/0866.prime-palindrome/README.md new file mode 100755 index 000000000..353a7003a --- /dev/null +++ b/Algorithms/0866.prime-palindrome/README.md @@ -0,0 +1,43 @@ +# [866. Prime Palindrome](https://leetcode.com/problems/prime-palindrome/) + +## 题目 + +Find the smallest prime palindrome greater than or equal to N. + +Recall that anumber is prime if it's only divisors are 1 and itself, and it is greater than 1. + +For example, 2,3,5,7,11 and 13 areprimes. + +Recall that a number is a palindrome if it reads the same from left to right as it does from right to left. + +For example, 12321 is a palindrome. + +Example 1: + +```text +Input: 6 +Output: 7 +``` + +Example 2: + +```text +Input: 8 +Output: 11 +``` + +Example 3: + +```text +Input: 13 +Output: 101 +``` + +Note: + +1. 1 <= N <= 10^8 +1. The answer is guaranteed to exist and be less than 2 * 10^8. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0866.prime-palindrome/prime-palindrome.go b/Algorithms/0866.prime-palindrome/prime-palindrome.go new file mode 100755 index 000000000..e0bbed81f --- /dev/null +++ b/Algorithms/0866.prime-palindrome/prime-palindrome.go @@ -0,0 +1,82 @@ +package problem0866 + +import ( + "math" + "strconv" +) + +var special = []int{2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11} + +func primePalindrome(N int) int { + if N <= 11 { + return special[N] + } + + /** 由于 11 是偶数长度的 palindrome 的因子 + * 所以答案一定是奇数长度的 + * 假设答案的形式如 lmr (Left + Middle + Right) */ + lm := genLM(N) + + for { + p := genPalindrome(lm) + if p >= N && isPrime(p) { + /** 需要验证 p >= N,是因为 + * 刚开始的 p 可能会比 N 小, + * 例如,N = 98390 时,第一个 p 是 98389 */ + return p + } + lm++ + } +} + +// 根据 N 生成 palindrome 的 left + middle 部分 +func genLM(N int) int { + size := len(strconv.Itoa(N)) + base := int(math.Pow10(size / 2)) + + /** lm 是 N 的左边和中间部分 */ + lm := N / base + + if size&1 == 0 { + /** 如果 N 的长度是偶数, 把 base 当做 lm + * 直接从 10^size+1 开始检查*/ + lm = base + } + + return lm +} + +// 利用 left 和 middle 生成一个奇数位长度的 palindrome +func genPalindrome(lm int) int { + res := lm + /**把 l 按照相反的顺序放到 lm 的右边,就形成了奇数位的 palindrome */ + for l := lm / 10; l > 0; l /= 10 { + res = res*10 + l%10 + } + return res +} + +// https://blog.csdn.net/willduan1/article/details/50975381 +func isPrime(n int) bool { + if n <= 3 { + return n > 1 + } + if n%2 == 0 || n%3 == 0 { + return false + } + k := int(math.Sqrt(float64(n))) + 1 + for i := 5; i < k; i += 6 { + if n%i == 0 || n%(i+2) == 0 { + return false + } + } + return true +} + +/** + * 此题要点: + * 1. 利用数学知识简化需要处理的情况 + * 形如 abccba 等长度为偶数的回文数,都不是素数,因为有因子 11 + * 2. 把 res <= 101 这样的与后面处理方式不兼容的少数情况,单独处理。 + * 3. 没有把寻找 n 作为单独的函数,简化了判断条件。 + */ diff --git a/Algorithms/0866.prime-palindrome/prime-palindrome_test.go b/Algorithms/0866.prime-palindrome/prime-palindrome_test.go new file mode 100755 index 000000000..798d1c76b --- /dev/null +++ b/Algorithms/0866.prime-palindrome/prime-palindrome_test.go @@ -0,0 +1,123 @@ +package problem0866 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 1000000000, + 10000500001, + }, + + { + 11, + 11, + }, + + { + 8, + 11, + }, + + { + 98390, + 98689, + }, + + { + 983910, + 1003001, + }, + + { + 930, + 10301, + }, + + { + 192, + 313, + }, + + { + 102, + 131, + }, + + { + 12, + 101, + }, + + { + 13, + 101, + }, + + { + 9999, + 10301, + }, + + { + 6, + 7, + }, + + { + 2, + 2, + }, + + { + 3, + 3, + }, + + { + 5, + 5, + }, + + { + 7, + 7, + }, + + // 可以有多个 testcase +} + +func Test_primePalindrome(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, primePalindrome(tc.N), "输入:%v", tc) + } +} + +func Benchmark_primePalindrome(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + primePalindrome(tc.N) + } + } +} + +func Test_isPrime(t *testing.T) { + ast := assert.New(t) + + actual := isPrime(3) + expected := true + ast.Equal(expected, actual) + +} diff --git a/Algorithms/0867.transpose-matrix/README.md b/Algorithms/0867.transpose-matrix/README.md new file mode 100755 index 000000000..3155379cb --- /dev/null +++ b/Algorithms/0867.transpose-matrix/README.md @@ -0,0 +1,30 @@ +# [867. Transpose Matrix](https://leetcode.com/problems/transpose-matrix/) + +## 题目 + +Given amatrix A, return the transpose of A. + +The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. + +Example 1: + +```text +Input: [[1,2,3],[4,5,6],[7,8,9]] +Output: [[1,4,7],[2,5,8],[3,6,9]] +``` + +Example 2: + +```text +Input: [[1,2,3],[4,5,6]] +Output: [[1,4],[2,5],[3,6]] +``` + +Note: + +1. 1 <= A.length<= 1000 +1. 1 <= A[0].length<= 1000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0867.transpose-matrix/transpose-matrix.go b/Algorithms/0867.transpose-matrix/transpose-matrix.go new file mode 100755 index 000000000..9a5a37191 --- /dev/null +++ b/Algorithms/0867.transpose-matrix/transpose-matrix.go @@ -0,0 +1,18 @@ +package problem0867 + +func transpose(A [][]int) [][]int { + m, n := len(A), len(A[0]) + + res := make([][]int, n) + for i := 0; i < n; i++ { + res[i] = make([]int, m) + } + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + res[j][i] = A[i][j] + } + } + + return res +} diff --git a/Algorithms/0867.transpose-matrix/transpose-matrix_test.go b/Algorithms/0867.transpose-matrix/transpose-matrix_test.go new file mode 100755 index 000000000..ff08d328e --- /dev/null +++ b/Algorithms/0867.transpose-matrix/transpose-matrix_test.go @@ -0,0 +1,44 @@ +package problem0867 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans [][]int +}{ + + { + [][]int{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, + [][]int{{1, 4, 7}, {2, 5, 8}, {3, 6, 9}}, + }, + + { + [][]int{{1, 2, 3}, {4, 5, 6}}, + [][]int{{1, 4}, {2, 5}, {3, 6}}, + }, + + // 可以有多个 testcase +} + +func Test_transpose(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, transpose(tc.A), "输入:%v", tc) + } +} + +func Benchmark_transpose(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + transpose(tc.A) + } + } +} diff --git a/Algorithms/0868.binary-gap/README.md b/Algorithms/0868.binary-gap/README.md new file mode 100755 index 000000000..8a5efbe04 --- /dev/null +++ b/Algorithms/0868.binary-gap/README.md @@ -0,0 +1,56 @@ +# [868. Binary Gap](https://leetcode.com/problems/binary-gap/) + +## 题目 + +Given a positiveinteger N, find and return the longest distance between two consecutive 1's in the binary representation of N. + +If there aren't two consecutive 1's, return 0. + +Example 1: + +```text +Input: 22 +Output: 2 +Explanation: +22 in binary is 0b10110. +In the binary representation of 22, there are three ones, and two consecutive pairs of 1's. +The first consecutive pair of 1's have distance 2. +The second consecutive pair of 1's have distance 1. +The answer is the largest of these two distances, which is 2. +``` + +Example 2: + +```text +Input: 5 +Output: 2 +Explanation: +5 in binary is 0b101. +``` + +Example 3: + +```text +Input: 6 +Output: 1 +Explanation: +6 in binary is 0b110. +``` + +Example 4: + +```text +Input: 8 +Output: 0 +Explanation: +8 in binary is 0b1000. +There aren't any consecutive pairs of 1's in the binary representation of 8, so we return 0. +``` + +Note: + +- 1 <= N <= 10^9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0868.binary-gap/binary-gap.go b/Algorithms/0868.binary-gap/binary-gap.go new file mode 100755 index 000000000..f38c4e980 --- /dev/null +++ b/Algorithms/0868.binary-gap/binary-gap.go @@ -0,0 +1,27 @@ +package problem0868 + +func binaryGap(N int) int { + res := 0 + gap := 0 + + for N > 0 { + if N&1 == 1 { + res = max(res, gap) + gap = 1 + } else if gap > 0 { + // gap > 0 才 gap++ 是想要 + // 在遇到第一个 1 后,每次遇到 0 才 gap++ + gap++ + } + N >>= 1 + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0868.binary-gap/binary-gap_test.go b/Algorithms/0868.binary-gap/binary-gap_test.go new file mode 100755 index 000000000..a68164d67 --- /dev/null +++ b/Algorithms/0868.binary-gap/binary-gap_test.go @@ -0,0 +1,59 @@ +package problem0868 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 41, + 3, + }, + + { + 22, + 2, + }, + + { + 5, + 2, + }, + + { + 6, + 1, + }, + + { + 8, + 0, + }, + + // 可以有多个 testcase +} + +func Test_binaryGap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, binaryGap(tc.N), "输入:%v", tc) + } +} + +func Benchmark_binaryGap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + binaryGap(tc.N) + } + } +} diff --git a/Algorithms/0869.reordered-power-of-2/README.md b/Algorithms/0869.reordered-power-of-2/README.md new file mode 100755 index 000000000..ce1c98f76 --- /dev/null +++ b/Algorithms/0869.reordered-power-of-2/README.md @@ -0,0 +1,50 @@ +# [869. Reordered Power of 2](https://leetcode.com/problems/reordered-power-of-2/) + +## 题目 + +Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero. + +Return trueif and only if we can do this in a way such that the resulting number is a power of 2. + +Example 1: + +```text +Input: 1 +Output: true +``` + +Example 2: + +```text +Input: 10 +Output: false +``` + +Example 3: + +```text +Input: 16 +Output: true +``` + +Example 4: + +```text +Input: 24 +Output: false +``` + +Example 5: + +```text +Input: 46 +Output: true +``` + +Note: + +1. 1 <= N <= 10^9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0869.reordered-power-of-2/reordered-power-of-2.go b/Algorithms/0869.reordered-power-of-2/reordered-power-of-2.go new file mode 100755 index 000000000..daa959e6f --- /dev/null +++ b/Algorithms/0869.reordered-power-of-2/reordered-power-of-2.go @@ -0,0 +1,85 @@ +package problem0869 + +// 对 [1, 1e9] 中所有的 2^n 进行编码 +// 把 key 写成 16 进制, 对应关系更明显 +var isValid = map[int]bool{ + //9876543210 + 0x0000000010: true, // 2^0 = 1 + //9876543210 + 0x0000000100: true, // 2^1 = 2 + //9876543210 + 0x0000010000: true, // 2^2 = 4 + //9876543210 + 0x0100000000: true, // 2^3 = 8 + //9876543210 + 0x0001000010: true, // 2^4 = 16 + //9876543210 + 0x0000001100: true, // 2^5 = 32 + //9876543210 + 0x0001010000: true, // 2^6 = 64 + //9876543210 + 0x0100000110: true, // 2^7 = 128 + //9876543210 + 0x0001100100: true, // 2^8 = 256 + //9876543210 + 0x0000100110: true, // 2^9 = 512 + //9876543210 + 0x0000010111: true, // 2^10 = 1024 + //9876543210 + 0x0100010101: true, // 2^11 = 2048 + //9876543210 + 0x1001010001: true, // 2^12 = 4096 + //9876543210 + 0x1100000110: true, // 2^13 = 8192 + //9876543210 + 0x0101011010: true, // 2^14 = 16384 + //9876543210 + 0x0111001100: true, // 2^15 = 32768 + //9876543210 + 0x0002201000: true, // 2^16 = 65536 + //9876543210 + 0x0010001121: true, // 2^17 = 131072 + //9876543210 + 0x0001020210: true, // 2^18 = 262144 + //9876543210 + 0x0200110200: true, // 2^19 = 524288 + //9876543210 + 0x0111110011: true, // 2^20 = 1048576 + //9876543210 + 0x1010100211: true, // 2^21 = 2097152 + //9876543210 + 0x1000031011: true, // 2^22 = 4194304 + //9876543210 + 0x0401001001: true, // 2^23 = 8388608 + //9876543210 + 0x0032000120: true, // 2^24 = 16777216 + //9876543210 + 0x0000223100: true, // 2^25 = 33554432 + //9876543210 + 0x0212010011: true, // 2^26 = 67108864 + //9876543210 + 0x0120011220: true, // 2^27 = 134217728 + //9876543210 + 0x0102221100: true, // 2^28 = 268435456 + //9876543210 + 0x1111101111: true, // 2^29 = 536870912 +} + +func reorderedPowerOf2(N int) bool { + return isValid[encode(N)] +} + +// 由于 n 的范围是 [1,1e9] +// 每个数字出现的次数不会超过 10 次,可以用 4 bit 的二进制数记录 +// go 的 int 类型是 64 bit,足够记录 10 个数字的出现次数 +// 所以, res 的 [4*digit, 4*digit+4) 位代表的二进制数,表示 digit 在 n 中出现的次数 +func encode(N int) int { + res := 0 + n := uint(N) + for n > 0 { + digit := n % 10 + res += 1 << (4 * digit) + n /= 10 + } + return res +} diff --git a/Algorithms/0869.reordered-power-of-2/reordered-power-of-2_test.go b/Algorithms/0869.reordered-power-of-2/reordered-power-of-2_test.go new file mode 100755 index 000000000..6262ad03a --- /dev/null +++ b/Algorithms/0869.reordered-power-of-2/reordered-power-of-2_test.go @@ -0,0 +1,94 @@ +package problem0869 + +import ( + "fmt" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans bool +}{ + + { + 160, + false, + }, + + { + 1, + true, + }, + + { + 10, + false, + }, + + { + 16, + true, + }, + + { + 24, + false, + }, + + { + 46, + true, + }, + + // 可以有多个 testcase +} + +func Test_reorderedPowerOf2(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reorderedPowerOf2(tc.N), "输入:%v", tc) + } +} + +func Benchmark_reorderedPowerOf2(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reorderedPowerOf2(tc.N) + } + } +} + +var val = 9876543210 + +func Benchmark_encode(b *testing.B) { + for i := 1; i < b.N; i++ { + encode(val) + } +} + +func encodeString(n int) string { + tmp := [10]int{} + for n > 0 { + tmp[n%10]++ + n /= 10 + } + ss := make([]string, 0, 10) + for n, c := range tmp { + if c > 0 { + ss = append(ss, fmt.Sprintf("%d_%d", n, c)) + } + } + return strings.Join(ss, "-") +} + +func Benchmark_encodeString(b *testing.B) { + for i := 1; i < b.N; i++ { + encodeString(val) + } +} diff --git a/Algorithms/0870.advantage-shuffle/README.md b/Algorithms/0870.advantage-shuffle/README.md new file mode 100755 index 000000000..94fbbad55 --- /dev/null +++ b/Algorithms/0870.advantage-shuffle/README.md @@ -0,0 +1,31 @@ +# [870. Advantage Shuffle](https://leetcode.com/problems/advantage-shuffle/) + +## 题目 + +Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices ifor which A[i] > B[i]. + +Return any permutation of A that maximizes its advantage with respect to B. + +Example 1: + +```text +Input: A = [2,7,11,15], B = [1,10,4,11] +Output: [2,11,7,15] +``` + +Example 2: + +```text +Input: A = [12,24,8,32], B = [13,25,32,11] +Output: [24,32,8,12] +``` + +Note: + +1. 1 <= A.length = B.length <= 10000 +1. 0 <= A[i] <= 10^9 +1. 0 <= B[i] <= 10^9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0870.advantage-shuffle/advantage-shuffle.go b/Algorithms/0870.advantage-shuffle/advantage-shuffle.go new file mode 100755 index 000000000..ddbee142a --- /dev/null +++ b/Algorithms/0870.advantage-shuffle/advantage-shuffle.go @@ -0,0 +1,35 @@ +package problem0870 + +import ( + "sort" +) + +func advantageCount(A []int, B []int) []int { + size := len(A) + + BI := make([][2]int, size) + for i, n := range B { + BI[i][0], BI[i][1] = n, i + } + + sort.Slice(BI, func(i int, j int) bool { + return BI[i][0] < BI[j][0] + }) + + res := make([]int, size) + + sort.Ints(A) + + l, r := 0, size-1 + for _, a := range A { + if BI[l][0] < a { + res[BI[l][1]] = a + l++ + } else { + res[BI[r][1]] = a + r-- + } + } + + return res +} diff --git a/Algorithms/0870.advantage-shuffle/advantage-shuffle_test.go b/Algorithms/0870.advantage-shuffle/advantage-shuffle_test.go new file mode 100755 index 000000000..f9c89ea99 --- /dev/null +++ b/Algorithms/0870.advantage-shuffle/advantage-shuffle_test.go @@ -0,0 +1,53 @@ +package problem0870 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans []int +}{ + + { + []int{15448, 14234, 13574, 19893, 6475}, + []int{14234, 6475, 19893, 15448, 13574}, + []int{15448, 13574, 6475, 19893, 14234}, + }, + + { + []int{2, 7, 11, 15}, + []int{1, 10, 4, 11}, + []int{2, 11, 7, 15}, + }, + + { + []int{12, 24, 8, 32}, + []int{13, 25, 32, 11}, + []int{24, 32, 8, 12}, + }, + + // 可以有多个 testcase +} + +func Test_advantageCount(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, advantageCount(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_advantageCount(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + advantageCount(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0871.minimum-number-of-refueling-stops/README.md b/Algorithms/0871.minimum-number-of-refueling-stops/README.md new file mode 100755 index 000000000..bd0e24205 --- /dev/null +++ b/Algorithms/0871.minimum-number-of-refueling-stops/README.md @@ -0,0 +1,54 @@ +# [871. Minimum Number of Refueling Stops](https://leetcode.com/problems/minimum-number-of-refueling-stops/) + +## 题目 + +A car travels from a starting position to a destination which is target miles east of the starting position. + +Along the way, there are gas stations. Each station[i]represents a gas station that is station[i][0] miles east of the starting position, and has station[i][1] liters of gas. + +The car starts with an infinite tank of gas, which initially hasstartFuelliters of fuel in it. It uses 1 liter of gas per 1 mile that it drives. + +When the carreaches a gas station, it may stop and refuel, transferring all the gas from the station into the car. + +What is the least number of refueling stops the car must make in order to reach its destination? If it cannot reach the destination, return -1. + +Note that if the car reaches a gas station with 0 fuel left, the car can still refuel there. If the car reaches the destination with 0 fuel left, it is still considered to have arrived. + +Example 1: + +```text +Input: target = 1, startFuel = 1, stations = [] +Output: 0 +Explanation: We can reach the target without refueling. +``` + +Example 2: + +```text +Input: target = 100, startFuel = 1, stations = [[10,100]] +Output: -1 +Explanation: We can't reach the target (or even the first gas station). +``` + +Example 3: + +```text +Input: target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]] +Output: 2 +Explanation: +We start with 10 liters of fuel. +We drive to position 10, expending 10 liters of fuel. We refuel from 0 liters to 60 liters of gas. +Then, we drive from position 10 to position 60 (expending 50 liters of fuel), +and refuel from 10 liters to 50 liters of gas. We then drive to and reach the target. +We made 2 refueling stops along the way, so we return 2. +``` + +Note: + +1. 1 <= target, startFuel, stations[i][1] <= 10^9 +1. 0 <= stations.length <= 500 +1. 0 < stations[0][0] < stations[1][0] < ... < stations[stations.length-1][0] < target + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops.go b/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops.go new file mode 100755 index 000000000..9dba393aa --- /dev/null +++ b/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops.go @@ -0,0 +1,72 @@ +package problem0871 + +import "container/heap" + +// 把题目换一种说法,就好理解了。 +// 汽车在开往目的地的过程中, +// 会在沿路的加油站,都买上一箱汽油, +// 每个加油站的汽油大小还不一样。 +// 汽车每次没油的时候,就在买过的汽油中,挑一箱加上。 +// 问,汽车达到目的地的时候,最少需要加几次油? + +func minRefuelStops(target int, startFuel int, stations [][]int) int { + size := len(stations) + gases := make(intHeap, 0, size) + miles := startFuel + stops := 0 + i := 0 + + for { + if miles >= target { + // 到达了目的地 + return stops + } + + // 路过加油站的时候,买汽油 + for i < size && stations[i][0] <= miles { + heap.Push(&gases, stations[i][1]) + i++ + } + + if len(gases) == 0 { + break + } + + maxGas := heap.Pop(&gases).(int) + stops++ + miles += maxGas + + } + + return -1 +} + +// intHeap 实现了 heap 的接口 +type intHeap []int + +func (h intHeap) Len() int { + return len(h) +} + +func (h intHeap) Less(i, j int) bool { + // 返回堆中的最大值 + return h[i] > h[j] +} + +func (h intHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} + +func (h *intHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *intHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[:len(*h)-1] + return res +} diff --git a/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops_test.go b/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops_test.go new file mode 100755 index 000000000..c33c94925 --- /dev/null +++ b/Algorithms/0871.minimum-number-of-refueling-stops/minimum-number-of-refueling-stops_test.go @@ -0,0 +1,78 @@ +package problem0871 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + target int + startFuel int + stations [][]int + ans int +}{ + + { + 1000, + 36, + [][]int{{7, 13}, {10, 11}, {12, 31}, {22, 14}, {32, 26}, {38, 16}, {50, 8}, {54, 13}, {75, 4}, {85, 2}, {88, 35}, {90, 9}, {96, 35}, {103, 16}, {115, 33}, {121, 6}, {123, 1}, {138, 2}, {139, 34}, {145, 30}, {149, 14}, {160, 21}, {167, 14}, {188, 7}, {196, 27}, {248, 4}, {256, 35}, {262, 16}, {264, 12}, {283, 23}, {297, 15}, {307, 25}, {311, 35}, {316, 6}, {345, 30}, {348, 2}, {354, 21}, {360, 10}, {362, 28}, {363, 29}, {367, 7}, {370, 13}, {402, 6}, {410, 32}, {447, 20}, {453, 13}, {454, 27}, {468, 1}, {470, 8}, {471, 11}, {474, 34}, {486, 13}, {490, 16}, {495, 10}, {527, 9}, {533, 14}, {553, 36}, {554, 23}, {605, 5}, {630, 17}, {635, 30}, {640, 31}, {646, 9}, {647, 12}, {659, 5}, {664, 34}, {667, 35}, {676, 6}, {690, 19}, {709, 10}, {721, 28}, {734, 2}, {742, 6}, {772, 22}, {777, 32}, {778, 36}, {794, 7}, {812, 24}, {813, 33}, {815, 14}, {816, 21}, {824, 17}, {826, 3}, {838, 14}, {840, 8}, {853, 29}, {863, 18}, {867, 1}, {881, 27}, {886, 27}, {894, 26}, {917, 3}, {953, 6}, {956, 3}, {957, 28}, {962, 33}, {967, 35}, {972, 34}, {984, 8}, {987, 12}}, + 32, + }, + + { + 1000, + 299, + [][]int{{14, 123}, {145, 203}, {344, 26}, {357, 68}, {390, 35}, {478, 135}, {685, 108}, {823, 186}, {934, 217}, {959, 80}}, + 5, + }, + + { + 100, + 25, + [][]int{{25, 25}, {50, 25}, {75, 25}}, + 3, + }, + + { + 100, + 10, + [][]int{{10, 60}, {20, 30}, {30, 30}, {60, 40}}, + 2, + }, + + { + 1, + 1, + [][]int{}, + 0, + }, + + { + 100, + 1, + [][]int{{10, 100}}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_minRefuelStops(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minRefuelStops(tc.target, tc.startFuel, tc.stations), "输入:%v", tc) + } +} + +func Benchmark_minRefuelStops(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minRefuelStops(tc.target, tc.startFuel, tc.stations) + } + } +} diff --git a/Algorithms/0872.leaf-similar-trees/README.md b/Algorithms/0872.leaf-similar-trees/README.md new file mode 100755 index 000000000..532c00890 --- /dev/null +++ b/Algorithms/0872.leaf-similar-trees/README.md @@ -0,0 +1,21 @@ +# [872. Leaf-Similar Trees](https://leetcode.com/problems/leaf-similar-trees/) + +## 题目 + +Consider all the leaves of a binary tree. Fromleft to right order, the values of thoseleaves form a leaf value sequence. + +![tree](tree.png) + +For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8). + +Two binary trees are considered leaf-similarif their leaf value sequence is the same. + +Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar. + +Note: + +- Both of the given trees will have between 1 and 100 nodes. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0872.leaf-similar-trees/leaf-similar-trees.go b/Algorithms/0872.leaf-similar-trees/leaf-similar-trees.go new file mode 100755 index 000000000..aabae66ad --- /dev/null +++ b/Algorithms/0872.leaf-similar-trees/leaf-similar-trees.go @@ -0,0 +1,42 @@ +package problem0872 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode definition for a binary tree node. +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func leafSimilar(root1 *TreeNode, root2 *TreeNode) bool { + // 因为题目说了,root 的全部节点不会超过 100 个 + // 那么 leaf 节点就更不会超过 100 个了 + // 所以 a 始终是 s 的底层数组,不会发生变更 + // 结尾比较 a1 和 a2 的异同就会很方便 + + a1 := [100]int{} + s1 := a1[:0] + search(root1, &s1) + + a2 := [100]int{} + s2 := a2[:0] + search(root2, &s2) + + return a1 == a2 +} + +func search(root *TreeNode, sp *[]int) { + if root == nil { + return + } + if root.Left == nil && root.Right == nil { + *sp = append(*sp, root.Val) + return + } + search(root.Left, sp) + search(root.Right, sp) +} diff --git a/Algorithms/0872.leaf-similar-trees/leaf-similar-trees_test.go b/Algorithms/0872.leaf-similar-trees/leaf-similar-trees_test.go new file mode 100755 index 000000000..6bcfc9371 --- /dev/null +++ b/Algorithms/0872.leaf-similar-trees/leaf-similar-trees_test.go @@ -0,0 +1,65 @@ +package problem0872 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root1 []int + root2 []int + ans bool +}{ + + { + []int{44, 79, 25, kit.NULL, kit.NULL, 112, 7, 74, 49, 2, 122}, + []int{38, 86, 120, 49, 54, 2, 122, kit.NULL, kit.NULL, 74, 79}, + false, + }, + + { + []int{3, 5, 1, 6, 2, 9, 8, kit.NULL, kit.NULL, 7, 4}, + []int{3, 5, 1, 6, 7, 4, 2, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 9, 8}, + true, + }, + + { + []int{3, 5, 1, 6, 2, 9, 8, kit.NULL, kit.NULL, 7, 4}, + []int{3, 5, 1, 6, 7, 4, 2, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 9, 9}, + false, + }, + + { + []int{3, 5, 1, 6, 2, 9, 8, 3, kit.NULL, 7, 4}, + []int{3, 5, 1, 6, 7, 4, 2, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 9, 9}, + false, + }, + + // 可以有多个 testcase +} + +func Test_leafSimilar(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root1 := kit.Ints2TreeNode(tc.root1) + root2 := kit.Ints2TreeNode(tc.root2) + ast.Equal(tc.ans, leafSimilar(root1, root2), "输入:%v", tc) + } +} + +func Benchmark_leafSimilar(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root1 := kit.Ints2TreeNode(tc.root1) + root2 := kit.Ints2TreeNode(tc.root2) + leafSimilar(root1, root2) + } + } +} diff --git a/Algorithms/0872.leaf-similar-trees/tree.png b/Algorithms/0872.leaf-similar-trees/tree.png new file mode 100644 index 000000000..9298a5759 Binary files /dev/null and b/Algorithms/0872.leaf-similar-trees/tree.png differ diff --git a/Algorithms/0873.length-of-longest-fibonacci-subsequence/README.md b/Algorithms/0873.length-of-longest-fibonacci-subsequence/README.md new file mode 100755 index 000000000..3ad6bcd67 --- /dev/null +++ b/Algorithms/0873.length-of-longest-fibonacci-subsequence/README.md @@ -0,0 +1,41 @@ +# [873. Length of Longest Fibonacci Subsequence](https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/) + +## 题目 + +A sequence X_1, X_2, ..., X_nis fibonacci-like if: + +- n >= 3 +- X_i + X_{i+1} = X_{i+2}for alli + 2 <= n + +Given a strictly increasingarrayA of positive integers forming a sequence, find the length of the longest fibonacci-like subsequence of A. If one does not exist, return 0. + +(Recall that a subsequence is derived from another sequence A bydeleting any number ofelements (including none)from A, without changing the order of the remaining elements. For example, [3, 5, 8] is a subsequence of [3, 4, 5, 6, 7, 8].) + +Example 1: + +```text +Input: [1,2,3,4,5,6,7,8] +Output: 5 +Explanation: +The longest subsequence that is fibonacci-like: [1,2,3,5,8]. +``` + +Example 2: + +```text +Input: [1,3,7,11,12,14,18] +Output: 3 +Explanation: +The longest subsequence that is fibonacci-like: +[1,11,12], [3,11,14] or [7,11,18]. +``` + +Note: + +1. 3 <= A.length <= 1000 +1. 1 <= A[0] < A[1] < ... < A[A.length - 1] <= 10^9 +1. (The time limit has been reduced by 50% for submissions in Java, C, and C++.) + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence.go b/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence.go new file mode 100755 index 000000000..dc59d5dd9 --- /dev/null +++ b/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence.go @@ -0,0 +1,54 @@ +package problem0873 + +import "sort" + +func lenLongestFibSubseq(a []int) int { + size := len(a) + res := 0 + + // (size - k) + 2 > res 表示,此时的 k 至少还有可能让 res 变的更大 + // (size - k) + 2 > res ==> k < size - res + 2 + + for k := 2; k < size && k < size-res+2; k++ { + l, r := 0, k-1 + + for l < r { + s := a[l] + a[r] + + if s < a[k] { + l++ + continue + } else if a[k] < s { + r-- + continue + } + + // 此时找到了第一组 a[l] + a[r] = a[k] + count := 3 + i, j := r, k + // 反复利用二分查找法,查看下个数是否在 a 中 + for { + next := a[i] + a[j] + i, j = j, j+sort.SearchInts(a[j:], next) + if j == size || a[j] != next { + break + } + count++ + } + + res = max(res, count) + l++ + r-- + } + + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence_test.go b/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence_test.go new file mode 100755 index 000000000..ac459871e --- /dev/null +++ b/Algorithms/0873.length-of-longest-fibonacci-subsequence/length-of-longest-fibonacci-subsequence_test.go @@ -0,0 +1,54 @@ +package problem0873 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{2, 4, 7, 8, 9, 10, 14, 15, 18, 23, 32, 50}, + 5, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000}, + 15, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8}, + 5, + }, + + { + []int{1, 3, 7, 11, 12, 14, 18}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_lenLongestFibSubseq(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, lenLongestFibSubseq(tc.A), "输入:%v", tc) + } +} + +func Benchmark_lenLongestFibSubseq(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lenLongestFibSubseq(tc.A) + } + } +} diff --git a/Algorithms/0874.walking-robot-simulation/README.md b/Algorithms/0874.walking-robot-simulation/README.md new file mode 100755 index 000000000..8d88ace37 --- /dev/null +++ b/Algorithms/0874.walking-robot-simulation/README.md @@ -0,0 +1,45 @@ +# [874. Walking Robot Simulation](https://leetcode.com/problems/walking-robot-simulation/) + +## 题目 + +A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands: + +- -2: turn left 90 degrees +- -1: turn right 90 degrees +- 1 <= x <= 9: move forward x units + +Some of the grid squares are obstacles. + +The i-th obstacle is at grid point (obstacles[i][0], obstacles[i][1]) + +If the robot would try to move onto them, the robot stays on the previous grid square instead (but still continues following the rest of the route.) + +Return the square of the maximum Euclidean distance that the robot will be from the origin. + +Example 1: + +```text +Input: commands = [4,-1,3], obstacles = [] +Output: 25 +Explanation: robot will go to (3, 4) +``` + +Example 2: + +```text +Input: commands = [4,-1,4,-2,4], obstacles = [[2,4]] +Output: 65 +Explanation: robot will be stuck at (1, 4) before turning left and going to (1, 8) +``` + +Note: + +- 0 <= commands.length <= 10000 +- 0 <= obstacles.length <= 10000 +- -30000 <= obstacle[i][0] <= 30000 +- -30000 <= obstacle[i][1] <= 30000 +- The answer is guaranteed to be less than 2 ^ 31. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0874.walking-robot-simulation/walking-robot-simulation.go b/Algorithms/0874.walking-robot-simulation/walking-robot-simulation.go new file mode 100755 index 000000000..a45747fe5 --- /dev/null +++ b/Algorithms/0874.walking-robot-simulation/walking-robot-simulation.go @@ -0,0 +1,174 @@ +package problem0874 + +var dxs = []int{0, 1, 0, -1} +var dys = []int{1, 0, -1, 0} + +func robotSim(commands []int, obstacles [][]int) int { + isBlocked := make(map[int]bool, 10000) + for _, o := range obstacles { + i, j := o[0], o[1] + isBlocked[encode(i, j)] = true + } + + x, y, res := 0, 0, 0 + index := 0 + + for _, c := range commands { + switch { + case c == -2: + index-- + case c == -1: + index++ + default: + if index < 0 { + index += 1<<63 - 4 + } + index %= 4 + dx, dy := dxs[index], dys[index] + for c > 0 && !isBlocked[encode(x+dx, y+dy)] { + c-- + x += dx + y += dy + } + res = max(res, x*x+y*y) + } + } + + return res +} + +func encode(x, y int) int { + x &= 0xFFFF + y &= 0xFFFF + return x<<16 | y +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// 以下方法太繁琐了 +// 应该注意到,每次最多移动 9 步,所以,走一步看一步,也是一个好方法。 + +// func robotSim(commands []int, obstacles [][]int) int { + +// sort.Slice(obstacles, func(i int, j int) bool { +// if obstacles[i][0] == obstacles[j][0] { +// return obstacles[i][1] < obstacles[j][1] +// } +// return obstacles[i][0] < obstacles[j][0] +// }) +// oxs := make(map[int][]int, len(obstacles)) +// oys := make(map[int][]int, len(obstacles)) +// for _, o := range obstacles { +// if o[0] == 0 && o[1] == 0 { +// continue +// } +// oxs[o[0]] = append(oxs[o[0]], o[1]) +// oys[o[1]] = append(oys[o[1]], o[0]) +// } + +// x, y := 0, 0 + +// north := func(a int) { +// y += a +// ys, ok := oxs[x] +// if ok { +// i := sort.SearchInts(ys, y-a) +// if i < len(ys) { +// y = min(y, ys[i]-1) +// } +// } +// } + +// east := func(a int) { +// x += a +// xs, ok := oys[y] +// if ok { +// i := sort.SearchInts(xs, x-a) +// if i < len(xs) { +// x = min(x, xs[i]-1) +// } +// } +// } + +// south := func(a int) { +// y -= a +// ys, ok := oxs[x] +// if ok { +// i := sort.SearchInts(ys, y+a) +// if 0 < i { +// y = max(y, ys[i-1]+1) +// } +// } +// } + +// west := func(a int) { +// x -= a +// xs, ok := oys[y] +// if ok { +// i := sort.SearchInts(xs, x+a) +// if 0 < i { +// x = max(x, xs[i-1]+1) +// } +// } +// } + +// moves := []func(int){north, east, south, west} +// idx := 40000 +// mov := north + +// turn := func(c int) { +// if c == -2 { +// idx-- +// } else { +// idx++ +// } +// mov = moves[idx%4] +// } + +// // 合并同一个方向连续移动的步数 +// tmp := make([]int, 1, len(commands)) +// tmp[0] = commands[0] +// j := 0 +// for i := 1; i < len(commands); i++ { +// c := commands[i] +// if tmp[j] > 0 && c > 0 { +// tmp[j] += c +// } else { +// tmp = append(tmp, c) +// j++ +// } +// } +// commands = tmp + +// res := 0 + +// for _, c := range commands { +// if c < 0 { +// turn(c) +// } else { +// mov(c) +// res = max(res, x*x+y*y) +// } +// } + +// return res +// } + +// func max(a, b int) int { +// if a > b { +// return a +// } +// return b +// } + +// func min(a, b int) int { +// if a < b { +// return a +// } +// return b +// } diff --git a/Algorithms/0874.walking-robot-simulation/walking-robot-simulation_test.go b/Algorithms/0874.walking-robot-simulation/walking-robot-simulation_test.go new file mode 100755 index 000000000..00b925262 --- /dev/null +++ b/Algorithms/0874.walking-robot-simulation/walking-robot-simulation_test.go @@ -0,0 +1,107 @@ +package problem0874 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + commands []int + obstacles [][]int + ans int +}{ + + { + []int{3, 2, 4, 1, -2, -1, -1, 3, 8, 7, 5, -2, 5, 9, -2, 8, 3, -1, 8, 7, -2, 7, -2, 7, 4, 9, 5, 7, 9, 9, -1, 2, -1, -1, -2, -1, 8, -1, 7, -1, 2, 6, 6, 3, -1, 7, 5, 4, 4, 1, -2, 9, 4, -2, 5, 7, -2, -2, 5, 4, 3, 8, -2, 5, 5, 6, 6, 6, 8, -1, 1, -1, -1, 6, 3, 5, 8, 2, -1, 7, -2, 8, -2, -2, 2, 4, -1, -1, -2, 3, 4, -2, 1, 9, -1, -2, 4, 7, 5, 9}, + [][]int{{39, 83}, {1, 30}, {-62, -88}, {-82, -65}, {81, -88}, {-100, -74}, {-33, 64}, {96, -15}, {91, -71}, {27, 33}, {-66, 28}, {99, 83}, {80, 3}, {-65, -53}, {92, -47}, {14, -71}, {-70, -6}, {-42, -31}, {92, 73}, {-47, -59}, {-77, -8}, {-89, 8}, {-2, -22}, {-95, 61}, {-76, -75}, {5, -52}, {81, 32}, {12, -15}, {-69, -20}, {81, -77}, {-79, -42}, {13, -32}, {-6, 12}, {-6, 95}, {54, -17}, {-55, -76}, {9, -93}, {51, -27}, {73, -70}, {13, -3}, {-72, 38}, {8, 56}, {88, 56}, {62, 16}, {-5, -94}, {-55, 31}, {-21, 69}, {-32, 82}, {-80, 60}, {-1, 54}, {-52, 22}, {30, 52}, {-35, -55}, {-100, 75}, {98, 10}, {-67, 41}, {44, 38}, {18, -29}, {73, 0}, {-29, -62}, {-27, -67}, {-42, -64}, {-60, 20}, {-32, 18}, {60, -89}, {-31, 98}, {-27, 85}, {53, -38}, {-58, -33}, {9, -9}, {-66, -26}, {72, 46}, {49, 99}, {58, -80}, {-10, -76}, {-22, 13}, {-34, 100}, {-31, -43}, {89, -95}, {52, -49}, {61, -5}, {20, -94}, {-42, 79}, {-39, -60}, {-70, 39}, {-21, -10}, {-41, 51}, {-21, -51}, {82, 97}, {-81, -77}, {39, 63}, {24, 96}, {-73, 36}, {88, -92}, {-84, 27}, {-33, 78}, {96, 7}, {-19, 10}, {19, -40}, {-94, -25}, {32, 52}, {42, -22}, {77, 65}, {-64, -4}, {93, 94}, {21, 89}, {-90, 9}, {-74, -33}, {-30, -13}, {35, 2}, {-38, 84}, {-29, 96}, {73, 57}, {-43, -9}, {-9, -86}, {50, -64}, {24, -83}, {2, 18}, {-96, 52}, {77, 71}, {-93, -57}, {-88, -40}, {85, -40}, {2, -45}, {1, 47}, {89, 19}, {-27, 40}, {-6, -39}, {40, -19}, {35, 87}, {88, -37}, {31, -79}, {33, 8}, {-2, 56}, {25, 16}, {-60, -9}, {-7, -23}, {-24, 86}, {-79, 79}, {80, -69}, {10, -21}, {-93, -25}, {23, -59}, {-81, -50}, {-2, -46}, {-64, -91}, {82, 25}, {24, 8}, {-59, 53}, {-94, 61}, {-18, -67}, {47, 34}, {77, 11}, {11, -81}, {84, 29}, {-61, -12}, {-94, 41}, {-56, -1}, {-79, 10}, {-32, 67}, {17, 45}, {-11, -4}, {44, 66}, {-98, -55}, {67, 43}, {-28, -80}, {72, -97}, {-86, -99}, {1, 43}, {-75, -72}, {-24, -92}, {-42, -44}, {38, 33}, {-64, -12}, {-82, -60}, {38, -51}, {71, -47}, {40, 42}, {-85, 60}, {-46, -61}, {-25, 17}, {-13, -17}, {21, 84}, {-56, -72}, {95, 67}, {-28, 73}, {53, -4}, {-14, -92}, {21, -43}, {82, -63}, {-98, 42}, {65, -97}, {-78, 72}, {54, 65}, {44, -15}, {-88, 7}, {23, -62}, {-8, -6}, {-11, -93}, {43, 81}}, + 4328, + }, + + { + []int{5}, + [][]int{{0, 3}}, + 4, + }, + + { + []int{-2, -2, -2, 5}, + [][]int{{3, 0}}, + 4, + }, + + { + []int{-1, 5}, + [][]int{{3, 0}}, + 4, + }, + + { + []int{-2, -2, 5}, + [][]int{{0, -3}}, + 4, + }, + + { + []int{-1, -1, 5}, + [][]int{{0, -3}}, + 4, + }, + + { + []int{-2, 5}, + [][]int{{-3, 0}}, + 4, + }, + + { + []int{-1, -1, -1, 5}, + [][]int{{-3, 0}}, + 4, + }, + + { + []int{1, 2, -2, 5, -1, -2, -1, 8, 3, -1, 9, 4, -2, 3, 2, 4, 3, 9, 2, -1, -1, -2, 1, 3, -2, 4, 1, 4, -1, 1, 9, -1, -2, 5, -1, 5, 5, -2, 6, 6, 7, 7, 2, 8, 9, -1, 7, 4, 6, 9, 9, 9, -1, 5, 1, 3, 3, -1, 5, 9, 7, 4, 8, -1, -2, 1, 3, 2, 9, 3, -1, -2, 8, 8, 7, 5, -2, 6, 8, 4, 6, 2, 7, 2, -1, 7, -2, 3, 3, 2, -2, 6, 9, 8, 1, -2, -1, 1, 4, 7}, + [][]int{{-57, -58}, {-72, 91}, {-55, 35}, {-20, 29}, {51, 70}, {-61, 88}, {-62, 99}, {52, 17}, {-75, -32}, {91, -22}, {54, 33}, {-45, -59}, {47, -48}, {53, -98}, {-91, 83}, {81, 12}, {-34, -90}, {-79, -82}, {-15, -86}, {-24, 66}, {-35, 35}, {3, 31}, {87, 93}, {2, -19}, {87, -93}, {24, -10}, {84, -53}, {86, 87}, {-88, -18}, {-51, 89}, {96, 66}, {-77, -94}, {-39, -1}, {89, 51}, {-23, -72}, {27, 24}, {53, -80}, {52, -33}, {32, 4}, {78, -55}, {-25, 18}, {-23, 47}, {79, -5}, {-23, -22}, {14, -25}, {-11, 69}, {63, 36}, {35, -99}, {-24, 82}, {-29, -98}, {-50, -70}, {72, 95}, {80, 80}, {-68, -40}, {65, 70}, {-92, 78}, {-45, -63}, {1, 34}, {81, 50}, {14, 91}, {-77, -54}, {13, -88}, {24, 37}, {-12, 59}, {-48, -62}, {57, -22}, {-8, 85}, {48, 71}, {12, 1}, {-20, 36}, {-32, -14}, {39, 46}, {-41, 75}, {13, -23}, {98, 10}, {-88, 64}, {50, 37}, {-95, -32}, {46, -91}, {10, 79}, {-11, 43}, {-94, 98}, {79, 42}, {51, 71}, {4, -30}, {2, 74}, {4, 10}, {61, 98}, {57, 98}, {46, 43}, {-16, 72}, {53, -69}, {54, -96}, {22, 0}, {-7, 92}, {-69, 80}, {68, -73}, {-24, -92}, {-21, 82}, {32, -1}, {-6, 16}, {15, -29}, {70, -66}, {-85, 80}, {50, -3}, {6, 13}, {-30, -98}, {-30, 59}, {-67, 40}, {17, 72}, {79, 82}, {89, -100}, {2, 79}, {-95, -46}, {17, 68}, {-46, 81}, {-5, -57}, {7, 58}, {-42, 68}, {19, -95}, {-17, -76}, {81, -86}, {79, 78}, {-82, -67}, {6, 0}, {35, -16}, {98, 83}, {-81, 100}, {-11, 46}, {-21, -38}, {-30, -41}, {86, 18}, {-68, 6}, {80, 75}, {-96, -44}, {-19, 66}, {21, 84}, {-56, -64}, {39, -15}, {0, 45}, {-81, -54}, {-66, -93}, {-4, 2}, {-42, -67}, {-15, -33}, {1, -32}, {-74, -24}, {7, 18}, {-62, 84}, {19, 61}, {39, 79}, {60, -98}, {-76, 45}, {58, -98}, {33, 26}, {-74, -95}, {22, 30}, {-68, -62}, {-59, 4}, {-62, 35}, {-78, 80}, {-82, 54}, {-42, 81}, {56, -15}, {32, -19}, {34, 93}, {57, -100}, {-1, -87}, {68, -26}, {18, 86}, {-55, -19}, {-68, -99}, {-9, 47}, {24, 94}, {92, 97}, {5, 67}, {97, -71}, {63, -57}, {-52, -14}, {-86, -78}, {-17, 92}, {-61, -83}, {-84, -10}, {20, 13}, {-68, -47}, {7, 28}, {66, 89}, {-41, -17}, {-14, -46}, {-72, -91}, {4, 52}, {-17, -59}, {-85, -46}, {-94, -23}, {-48, -3}, {-64, -37}, {2, 26}, {76, 88}, {-8, -46}, {-19, -68}}, + 5140, + }, + + { + []int{2, 2, 5, -1, -1}, + [][]int{{-3, 5}, {-2, 5}, {3, 2}, {5, 0}, {-2, 0}, {-1, 5}, {5, -3}, {0, 0}, {-4, 4}, {-3, 4}}, + 81, + }, + + { + []int{4, -1, 4, -2, 4}, + [][]int{{2, 4}}, + 65, + }, + + { + []int{4, -1, 3}, + [][]int{}, + 25, + }, + + // 可以有多个 testcase +} + +func Test_robotSim(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, robotSim(tc.commands, tc.obstacles), "输入:%v", tc) + } +} + +func Benchmark_robotSim(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + robotSim(tc.commands, tc.obstacles) + } + } +} diff --git a/Algorithms/0875.koko-eating-bananas/README.md b/Algorithms/0875.koko-eating-bananas/README.md new file mode 100755 index 000000000..7a7521494 --- /dev/null +++ b/Algorithms/0875.koko-eating-bananas/README.md @@ -0,0 +1,42 @@ +# [875. Koko Eating Bananas](https://leetcode.com/problems/koko-eating-bananas/) + +## 题目 + +Koko loves to eat bananas. There are Npiles of bananas, the i-thpile has piles[i] bananas. The guards have gone and will come back in H hours. + +Koko can decide her bananas-per-hour eating speed of K. Each hour, she chooses some pile of bananas, and eats K bananas from that pile. If the pile has less than K bananas, she eats all of them instead, and won't eat any more bananas during this hour. + +Koko likes to eat slowly, but still wants to finish eating all the bananas before the guards come back. + +Return the minimum integer K such that she can eat all the bananas within H hours. + +Example 1: + +```text +Input: piles = [3,6,7,11], H = 8 +Output: 4 +``` + +Example 2: + +```text +Input: piles = [30,11,23,4,20], H = 5 +Output: 30 +``` + +Example 3: + +```text +Input: piles = [30,11,23,4,20], H = 6 +Output: 23 +``` + +Note: + +1. 1 <= piles.length <= 10^4 +1. piles.length <= H <= 10^9 +1. 1 <= piles[i] <= 10^9 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0875.koko-eating-bananas/koko-eating-bananas.go b/Algorithms/0875.koko-eating-bananas/koko-eating-bananas.go new file mode 100755 index 000000000..584119d39 --- /dev/null +++ b/Algorithms/0875.koko-eating-bananas/koko-eating-bananas.go @@ -0,0 +1,50 @@ +package problem0875 + +import ( + "math" +) + +func minEatingSpeed(piles []int, h int) int { + sum, r := sumAndMax(piles) + l := (sum + h - 1) / h + + for l < r { + m := (l + r) / 2 + if canEatAll(m, h, piles) { + r = m + } else { + l = m + 1 + } + } + + return r +} + +func sumAndMax(a []int) (int, int) { + sum := 0 + mx := 0 + for _, n := range a { + sum += n + mx = max(mx, n) + } + return sum, mx +} + +func canEatAll(k, h int, piles []int) bool { + r := 1 / float64(k) + for _, p := range piles { + fp := float64(p) + h -= int(math.Ceil(fp * r)) + if h < 0 { + return false + } + } + return true +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0875.koko-eating-bananas/koko-eating-bananas_test.go b/Algorithms/0875.koko-eating-bananas/koko-eating-bananas_test.go new file mode 100755 index 000000000..079327489 --- /dev/null +++ b/Algorithms/0875.koko-eating-bananas/koko-eating-bananas_test.go @@ -0,0 +1,65 @@ +package problem0875 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + piles []int + H int + ans int +}{ + + { + []int{1, 2, 3, 4, 100}, + 5, + 100, + }, + + { + []int{3, 6, 7, 10000}, + 8, + 2000, + }, + + { + []int{3, 6, 7, 11}, + 8, + 4, + }, + + { + []int{30, 11, 23, 4, 20}, + 5, + 30, + }, + + { + []int{30, 11, 23, 4, 20}, + 6, + 23, + }, + + // 可以有多个 testcase +} + +func Test_minEatingSpeed(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minEatingSpeed(tc.piles, tc.H), "输入:%v", tc) + } +} + +func Benchmark_minEatingSpeed(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minEatingSpeed(tc.piles, tc.H) + } + } +} diff --git a/Algorithms/0876.middle-of-the-linked-list/README.md b/Algorithms/0876.middle-of-the-linked-list/README.md new file mode 100755 index 000000000..1eb7b5b19 --- /dev/null +++ b/Algorithms/0876.middle-of-the-linked-list/README.md @@ -0,0 +1,33 @@ +# [876. Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list/) + +## 题目 + +Given a non-empty, singlylinked list with head node head, returnamiddle node of linked list. + +If there are two middle nodes, return the second middle node. + +Example 1: + +```text +Input: [1,2,3,4,5] +Output: Node 3 from this list (Serialization: [3,4,5]) +The returned node has value 3. (The judge's serialization of this node is [3,4,5]). +Note that we returned a ListNode object ans, such that: +ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, and ans.next.next.next = NULL. +``` + +Example 2: + +```text +Input: [1,2,3,4,5,6] +Output: Node 4 from this list (Serialization: [4,5,6]) +Since the list has two middle nodes with values 3 and 4, we return the second one. +``` + +Note: + +1. The number of nodes in the given list will be between 1and 100. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list.go b/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list.go new file mode 100755 index 000000000..6429eb547 --- /dev/null +++ b/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list.go @@ -0,0 +1,21 @@ +package problem0876 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// ListNode defined for singly-linked list. +// type ListNode struct { +// Val int +// Next *ListNode +// } +type ListNode = kit.ListNode + +func middleNode(head *ListNode) *ListNode { + slow, fast := head, head + for fast != nil && fast.Next != nil { + slow = slow.Next + fast = fast.Next.Next + } + return slow +} diff --git a/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list_test.go b/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list_test.go new file mode 100755 index 000000000..488b9388f --- /dev/null +++ b/Algorithms/0876.middle-of-the-linked-list/middle-of-the-linked-list_test.go @@ -0,0 +1,49 @@ +package problem0876 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{1, 2, 3, 4, 5}, + []int{3, 4, 5}, + }, + + { + []int{1, 2, 3, 4, 5, 6}, + []int{4, 5, 6}, + }, + + // 可以有多个 testcase +} + +func Test_middleNode(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + head := kit.Ints2List(tc.head) + actual := kit.List2Ints(middleNode(head)) + ast.Equal(tc.ans, actual, "输入:%v", tc) + } +} + +func Benchmark_middleNode(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + middleNode(head) + } + } +} diff --git a/Algorithms/0877.stone-game/README.md b/Algorithms/0877.stone-game/README.md new file mode 100755 index 000000000..d2861e4d4 --- /dev/null +++ b/Algorithms/0877.stone-game/README.md @@ -0,0 +1,35 @@ +# [877. Stone Game](https://leetcode.com/problems/stone-game/) + +## 题目 + +Alex and Lee play a game with piles of stones. There are an even number ofpiles arranged in a row, and each pile has a positive integer number of stones piles[i]. + +The objective of the game is to end with the moststones. The total number of stones is odd, so there are no ties. + +Alex and Lee take turns, with Alex starting first. Each turn, a playertakes the entire pile of stones from either the beginning or the end of the row. This continues until there are no more piles left, at which point the person with the most stones wins. + +Assuming Alex and Lee play optimally, return Trueif and only if Alex wins the game. + +Example 1: + +```text +Input: [5,3,4,5] +Output: true +Explanation: +Alex starts first, and can only take the first 5 or the last 5. +Say he takes the first 5, so that the row becomes [3, 4, 5]. +If Lee takes 3, then the board is [4, 5], and Alex takes 5 to win with 10 points. +If Lee takes the last 5, then the board is [3, 4], and Alex takes 4 to win with 9 points. +This demonstrated that taking the first 5 was a winning move for Alex, so we return true. +``` + +Note: + +1. 2 <= piles.length <= 500 +1. piles.length is even. +1. 1 <= piles[i] <= 500 +1. sum(piles) is odd. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0877.stone-game/stone-game.go b/Algorithms/0877.stone-game/stone-game.go new file mode 100755 index 000000000..1f488bbe6 --- /dev/null +++ b/Algorithms/0877.stone-game/stone-game.go @@ -0,0 +1,31 @@ +package problem0877 + +func stoneGame(p []int) bool { + size := len(p) + + // dp[i][j] = k 表示, 面对 p[i:j+1] 个石头,先拿的人会比后拿的人多 k 个 + dp := [501][501]int{} + for i := 0; i < size; i++ { + dp[i][i] = p[i] + } + + for d := 1; d < size; d++ { + for i := 0; i < size-d; i++ { + // p[i]-dp[i+1][i+d] 表示,如果拿了左边的会比后拿的人多的个数 + // p[i+d]-dp[i][i+d-1] 表示,如果拿了右边会比后拿的人多的个数 + // 注意 dp[i][i+d] 与 dp[i+1][i+d] (or dp[i][i+d-1]) 的先拿后拿的转换 + dp[i][i+d] = max(p[i]-dp[i+1][i+d], p[i+d]-dp[i][i+d-1]) + } + } + + return dp[0][size-1] > 0 +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// https://leetcode.com/problems/stone-game/discuss/154610/C++JavaPython-DP-or-Just-return-true diff --git a/Algorithms/0877.stone-game/stone-game_test.go b/Algorithms/0877.stone-game/stone-game_test.go new file mode 100755 index 000000000..86b87f0bd --- /dev/null +++ b/Algorithms/0877.stone-game/stone-game_test.go @@ -0,0 +1,44 @@ +package problem0877 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + piles []int + ans bool +}{ + + { + []int{1, 100, 2, 4}, + true, + }, + + { + []int{5, 3, 4, 5}, + true, + }, + + // 可以有多个 testcase +} + +func Test_stoneGame(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, stoneGame(tc.piles), "输入:%v", tc) + } +} + +func Benchmark_stoneGame(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + stoneGame(tc.piles) + } + } +} diff --git a/Algorithms/0878.nth-magical-number/README.md b/Algorithms/0878.nth-magical-number/README.md new file mode 100755 index 000000000..b22a59a1b --- /dev/null +++ b/Algorithms/0878.nth-magical-number/README.md @@ -0,0 +1,45 @@ +# [878. Nth Magical Number](https://leetcode.com/problems/nth-magical-number/) + +## 题目 + +A positive integeris magicalif it is divisible by either Aor B. + +Return the N-th magical number. Since the answer may be very large, return it modulo 10^9 + 7. + +Example 1: + +```text +Input: N = 1, A = 2, B = 3 +Output: 2 +``` + +Example 2: + +```text +Input: N = 4, A = 2, B = 3 +Output: 6 +``` + +Example 3: + +```text +Input: N = 5, A = 2, B = 4 +Output: 10 +``` + +Example 4: + +```text +Input: N = 3, A = 6, B = 4 +Output: 8 +``` + +Note: + +1. 1 <= N<= 10^9 +1. 2 <= A<= 40000 +1. 2 <= B<= 40000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0878.nth-magical-number/nth-magical-number.go b/Algorithms/0878.nth-magical-number/nth-magical-number.go new file mode 100755 index 000000000..740b07684 --- /dev/null +++ b/Algorithms/0878.nth-magical-number/nth-magical-number.go @@ -0,0 +1,53 @@ +package problem0878 + +const mod = 1e9 + 7 + +func nthMagicalNumber(n, a, b int) int { + if a > b { + a, b = b, a + } + + m := lcm(a, b) + l, r := a*n/2, b*n + + for { + med := (l + r) / 2 + count := magicalOf(med, a, b, m) + switch { + case count < n: + l = med + 1 + case n < count: + r = med - 1 + default: + res := med - min(med%a, med%b) + return res % mod + } + } +} + +func magicalOf(num, a, b, m int) int { + return num/a + num/b - num/m +} + +// 最小公倍数 +func lcm(a, b int) int { + return a * b / gcd(a, b) +} + +// 最大公约数 +func gcd(a, b int) int { + if a < b { + a, b = b, a + } + for b != 0 { + a, b = b, a%b + } + return a +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0878.nth-magical-number/nth-magical-number_test.go b/Algorithms/0878.nth-magical-number/nth-magical-number_test.go new file mode 100755 index 000000000..5ec0212e5 --- /dev/null +++ b/Algorithms/0878.nth-magical-number/nth-magical-number_test.go @@ -0,0 +1,71 @@ +package problem0878 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + A int + B int + ans int +}{ + + { + 1000000000, + 40000, + 40000, + 999720007, + }, + + { + 1, + 2, + 3, + 2, + }, + + { + 4, + 2, + 3, + 6, + }, + + { + 5, + 2, + 4, + 10, + }, + + { + 3, + 6, + 4, + 8, + }, + + // 可以有多个 testcase +} + +func Test_nthMagicalNumber(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, nthMagicalNumber(tc.N, tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_nthMagicalNumber(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + nthMagicalNumber(tc.N, tc.A, tc.B) + } + } +} diff --git a/Algorithms/0879.profitable-schemes/README.md b/Algorithms/0879.profitable-schemes/README.md new file mode 100755 index 000000000..c9bac7cc4 --- /dev/null +++ b/Algorithms/0879.profitable-schemes/README.md @@ -0,0 +1,45 @@ +# [879. Profitable Schemes](https://leetcode.com/problems/profitable-schemes/) + +## 题目 + +There are G people in a gang, and a list of various crimes they could commit. + +The i-th crime generates a profit[i] and requires group[i] gang members to participate. + +If a gang member participates in one crime, that member can't participate in another crime. + +Let's call a profitable schemeany subset of these crimes that generates at least P profit, and the total number of gang members participating in that subset of crimes is at most G. + +How many schemes can be chosen? Since the answer may be verylarge, return it modulo 10^9 + 7. + +Example 1: + +```text +Input: G = 5, P = 3, group = [2,2], profit = [2,3] +Output: 2 +Explanation: +To make a profit of at least 3, the gang could either commit crimes 0 and 1, or just crime 1. +In total, there are 2 schemes. +``` + +Example 2: + +```text +Input: G = 10, P = 5, group = [2,3,5], profit = [6,7,8] +Output: 7 +Explanation: +To make a profit of at least 5, the gang could commit any crimes, as long as they commit one. +There are 7 possible schemes: (0), (1), (2), (0,1), (0,2), (1,2), and (0,1,2). +``` + +Note: + +1. 1 <= G <= 100 +1. 0 <= P <= 100 +1. 1 <= group[i] <= 100 +1. 0 <= profit[i] <= 100 +1. 1 <= group.length = profit.length <= 100 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0879.profitable-schemes/profitable-schemes.go b/Algorithms/0879.profitable-schemes/profitable-schemes.go new file mode 100755 index 000000000..bb19bd7eb --- /dev/null +++ b/Algorithms/0879.profitable-schemes/profitable-schemes.go @@ -0,0 +1,48 @@ +package problem0879 + +const mod = 1e9 + 7 + +func profitableSchemes(G, P int, group, profit []int) int { + /* dp[p][g] = x 表示, + * g 个人想要获得收益 p ,一共有 x 种选择 + * 其中的 g 个人,每个人都有事情做,而且人和人之间没有区别。 + * 特别地, + * dp[P][g] = x 表示, + * g 个无差别的人,每个人都有事情做,总的收益 >=P 的选择数为 x + */ + dp := [101][101]int{} + dp[0][0] = 1 + + size := len(group) + + for k := 0; k < size; k++ { + gk := group[k] + pk := profit[k] + for i := P; i >= 0; i-- { + ip := min(i+pk, P) + for j := G - gk; j >= 0; j-- { + // 首先假设 dp 的行数有无穷多 + // 那么 dp[i+p][j+g] = dp[i][j] 的含义是 + // j+g 比 j 多 g 个人,可以取得 i+p 的收益 + // 可惜 dp 的行数没有无穷多,需要压缩 + // 需要把 dp[>=P][j] 求和放置到 dp[P][j] + // ip := min(i+p, P) 就是压缩过程 + dp[ip][j+gk] += dp[i][j] + dp[ip][j+gk] %= mod + } + } + } + + res := 0 + for i := 0; i <= G; i++ { + res += dp[P][i] + } + return res % mod +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0879.profitable-schemes/profitable-schemes_test.go b/Algorithms/0879.profitable-schemes/profitable-schemes_test.go new file mode 100755 index 000000000..62d2f344d --- /dev/null +++ b/Algorithms/0879.profitable-schemes/profitable-schemes_test.go @@ -0,0 +1,61 @@ +package problem0879 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + G int + P int + group []int + profit []int + ans int +}{ + + { + 10, + 5, + []int{2, 3, 5}, + []int{6, 7, 8}, + 7, + }, + + { + 5, + 3, + []int{2, 2}, + []int{2, 3}, + 2, + }, + + { + 5, + 0, + []int{2, 2}, + []int{2, 3}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_profitableSchemes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, profitableSchemes(tc.G, tc.P, tc.group, tc.profit), "输入:%v", tc) + } +} + +func Benchmark_profitableSchemes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + profitableSchemes(tc.G, tc.P, tc.group, tc.profit) + } + } +} diff --git a/Algorithms/0880.decoded-string-at-index/README.md b/Algorithms/0880.decoded-string-at-index/README.md new file mode 100755 index 000000000..9fa221f03 --- /dev/null +++ b/Algorithms/0880.decoded-string-at-index/README.md @@ -0,0 +1,50 @@ +# [880. Decoded String at Index](https://leetcode.com/problems/decoded-string-at-index/) + +## 题目 + +An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a timeand the following steps are taken: + +- If the character read is a letter, that letter is written onto the tape. +- If the character read is a digit (say d), the entire current tape is repeatedly writtend-1more times in total. + +Now for some encoded string S, and an index K, find and return the K-th letter (1 indexed) in the decoded string. + +Example 1: + +```text +Input: S = "leet2code3", K = 10 +Output: "o" +Explanation: +The decoded string is "leetleetcodeleetleetcodeleetleetcode". +The 10th letter in the string is "o". +``` + +Example 2: + +```text +Input: S = "ha22", K = 5 +Output: "h" +Explanation: +The decoded string is "hahahaha". The 5th letter is "h". +``` + +Example 3: + +```text +Input: S = "a2345678999999999999999", K = 1 +Output: "a" +Explanation: +The decoded string is "a" repeated 8301530446056247680 times. The 1st letter is "a". +``` + +Note: + +1. 2 <= S.length <= 100 +1. Swill only contain lowercase letters and digits 2 through 9. +1. Sstarts with a letter. +1. 1 <= K <= 10^9 +1. The decoded string is guaranteed to have less than 2^63 letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0880.decoded-string-at-index/decoded-string-at-index.go b/Algorithms/0880.decoded-string-at-index/decoded-string-at-index.go new file mode 100755 index 000000000..7d1721648 --- /dev/null +++ b/Algorithms/0880.decoded-string-at-index/decoded-string-at-index.go @@ -0,0 +1,35 @@ +package problem0880 + +func decodeAtIndex(S string, K int) string { + /** lenSi 是 S[:i] 展开后的长度。*/ + lenSi, i := 0, 0 + + for ; lenSi < K; i++ { + char := S[i] + if isDigit(char) { + lenSi *= int(char - '0') + } else { + lenSi++ + } + } + + for { + i-- + char := S[i] + if isDigit(char) { + lenSi /= int(char - '0') + K %= lenSi + } else { + if K == 0 || // "leet3code2" K = 8 会导致 K == 0 成立 + K == lenSi { + return string(char) + } + lenSi-- + } + } + +} + +func isDigit(b byte) bool { + return b <= '9' +} diff --git a/Algorithms/0880.decoded-string-at-index/decoded-string-at-index_test.go b/Algorithms/0880.decoded-string-at-index/decoded-string-at-index_test.go new file mode 100755 index 000000000..87fd2d26f --- /dev/null +++ b/Algorithms/0880.decoded-string-at-index/decoded-string-at-index_test.go @@ -0,0 +1,113 @@ +package problem0880 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + K int + ans string +}{ + + { + "a2345678999999999999999", + 12314145213412, + "a", + }, + + { + "a2b3c4d5e6f7g8h9", + 3, + "b", + }, + + { + "leet2code3for2you2", + 160, + "y", + }, + + { + "leet2code3for2you2", + 89, + "t", + }, + + { + "leet2code3for2you2", + 13, + "l", + }, + + { + "leet2code3for2you2", + 90, + "c", + }, + + { + "leet2code3", + 10, + "o", + }, + + { + "leet2code3for2you", + 16, + "t", + }, + + { + "leet2code3for2you2", + 85, + "t", + }, + + { + "ha22", + 5, + "h", + }, + + { + "a2345678999999999999999", + 1, + "a", + }, + + // 可以有多个 testcase +} + +func Test_decodeAtIndex(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, decodeAtIndex(tc.S, tc.K), "输入:%v", tc) + } +} + +func Test_decodeAtIndex_2(t *testing.T) { + ast := assert.New(t) + + s := "leat2code3for2you2" + ansStr := "leatleatcodeleatleatcodeleatleatcodeforleatleatcodeleatleatcodeleatleatcodeforyouleatleatcodeleatleatcodeleatleatcodeforleatleatcodeleatleatcodeleatleatcodeforyou" + for i := range ansStr { + expectd := ansStr[i : i+1] + actual := decodeAtIndex(s, i+1) + msg := fmt.Sprintf("%s 的第 %d 个字符应该是 %s", s, i+1, expectd) + ast.Equal(expectd, actual, msg) + } +} + +func Benchmark_decodeAtIndex(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + decodeAtIndex(tc.S, tc.K) + } + } +} diff --git a/Algorithms/0881.boats-to-save-people/README.md b/Algorithms/0881.boats-to-save-people/README.md new file mode 100755 index 000000000..611e2f605 --- /dev/null +++ b/Algorithms/0881.boats-to-save-people/README.md @@ -0,0 +1,42 @@ +# [881. Boats to Save People](https://leetcode.com/problems/boats-to-save-people/) + +## 题目 + +The i-th person has weight people[i], and each boat can carry a maximum weight of limit. + +Each boat carries at most 2 people at the same time, provided the sum of theweight of those people is at most limit. + +Return the minimum number of boats to carry every given person. (It is guaranteed each person can be carried by a boat.) + +Example 1: + +```text +Input: people = [1,2], limit = 3 +Output: 1 +Explanation: 1 boat (1, 2) +``` + +Example 2: + +```text +Input: people = [3,2,2,1], limit = 3 +Output: 3 +Explanation: 3 boats (1, 2), (2) and (3) +``` + +Example 3: + +```text +Input: people = [3,5,3,4], limit = 5 +Output: 4 +Explanation: 4 boats (3), (3), (4), (5) +``` + +Note: + +1. 1 <=people.length <= 50000 +1. 1 <= people[i] <=limit <= 30000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0881.boats-to-save-people/boats-to-save-people.go b/Algorithms/0881.boats-to-save-people/boats-to-save-people.go new file mode 100755 index 000000000..3d1d401b1 --- /dev/null +++ b/Algorithms/0881.boats-to-save-people/boats-to-save-people.go @@ -0,0 +1,29 @@ +package problem0881 + +import ( + "sort" +) + +func numRescueBoats(people []int, limit int) int { + sort.Ints(people) + + thin, fat := 0, len(people)-1 + + res := 0 + + for thin <= fat { + // 如果,队列中最瘦的人,也可以上船的话,就跟上去 + if people[thin]+people[fat] <= limit { + thin++ + } + // 队列中,最胖的人肯定要上船 + fat-- + res++ + } + + return res +} + +// 首先看到 people.length <= 50000 就应该知道不可能使用动态规划。 +// 然后,还要注意到一个关键条件:每艘船只能坐两个人。 +// 可以使用贪心算法做 diff --git a/Algorithms/0881.boats-to-save-people/boats-to-save-people_test.go b/Algorithms/0881.boats-to-save-people/boats-to-save-people_test.go new file mode 100755 index 000000000..92816579d --- /dev/null +++ b/Algorithms/0881.boats-to-save-people/boats-to-save-people_test.go @@ -0,0 +1,71 @@ +package problem0881 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + people []int + limit int + ans int +}{ + + { + []int{2, 49, 10, 7, 11, 41, 47, 2, 22, 6, 13, 12, 33, 18, 10, 26, 2, 6, 50, 10}, + 50, + 11, + }, + + { + []int{1, 3, 3, 4}, + 5, + 3, + }, + + { + []int{2, 4}, + 5, + 2, + }, + + { + []int{1, 2}, + 3, + 1, + }, + + { + []int{3, 2, 2, 1}, + 3, + 3, + }, + + { + []int{3, 5, 3, 4}, + 5, + 4, + }, + + // 可以有多个 testcase +} + +func Test_numRescueBoats(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numRescueBoats(tc.people, tc.limit), "输入:%v", tc) + } +} + +func Benchmark_numRescueBoats(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numRescueBoats(tc.people, tc.limit) + } + } +} diff --git a/Algorithms/0882.reachable-nodes-in-subdivided-graph/README.md b/Algorithms/0882.reachable-nodes-in-subdivided-graph/README.md new file mode 100755 index 000000000..5d42f4acb --- /dev/null +++ b/Algorithms/0882.reachable-nodes-in-subdivided-graph/README.md @@ -0,0 +1,50 @@ +# [882. Reachable Nodes In Subdivided Graph](https://leetcode.com/problems/reachable-nodes-in-subdivided-graph/) + +## 题目 + +Starting with anundirected graph (the "original graph") with nodes from 0 to N-1, subdivisions are made to some of the edges. + +The graph is given as follows: edges[k] is a list of integer pairs (i, j, n) such that (i, j) is an edge of the original graph, + +and n is the total number of new nodes on that edge. + +Then, the edge (i, j) is deleted from the original graph,nnew nodes (x_1, x_2, ..., x_n) are added to the original graph, + +and n+1 newedges (i, x_1), (x_1, x_2), (x_2, x_3), ..., (x_{n-1}, x_n), (x_n, j)are added to the originalgraph. + +Now, you start at node 0from the original graph, and in each move, you travel along oneedge. + +Return how many nodes you can reach in at most M moves. + +Example 1: + +```text +Input: edges = [[0,1,10],[0,2,1],[1,2,2]], M = 6, N = 3 +Output: 13 +Explanation: +The nodes that are reachable in the final graph after M = 6 moves are indicated below. +``` + +![original-to-final](origfinal.png) + +Example 2: + +```text +Input: edges = [[0,1,4],[1,2,6],[0,2,8],[1,3,1]], M = 10, N = 4 +Output: 23 +``` + +Note: + +1. 0 <= edges.length <= 10000 +1. 0 <= edges[i][0] 0 { + m := pq[0][0] + i := pq[0][1] + heap.Pop(&pq) + + if seen[i] { + continue + } + + seen[i] = true + maxRemainMoves[i] = m + res++ // 收获 edge 端点 i + + for _, j := range nextTo[i] { + if seen[j] { + continue + } + n := nodes[encode(i, j)] + jRemainMoves := m - n - 1 + if jRemainMoves >= 0 { + // 如果可以在 M 步内到达 j + heap.Push(&pq, []int{jRemainMoves, j}) + } + } + } + + /**统计 edge 上的点 */ + for _, e := range edges { + i, j, n := e[0], e[1], e[2] + mi := maxRemainMoves[i] // 表示达到 i 点后,最多还可以走 mi 步 + mj := maxRemainMoves[j] // 表示达到 j 点后,最多还可以走 mj 步 + // 如果 mi + mj >= n, 则 edge(i,j) 中间的 n 个点都可以被走到 + // 否则 edge(i,j) 中只有 mi+mj 个点被走到 + res += min(mi+mj, n) + } + + return res +} + +func encode(i, j int) int { + if i > j { + i, j = j, i + } + return i<<16 | j +} + +// PQ implements heap.Interface and holds entries. +type PQ [][]int + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i][0] > pq[j][0] +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + temp := x.([]int) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0882.reachable-nodes-in-subdivided-graph/reachable-nodes-in-subdivided-graph_test.go b/Algorithms/0882.reachable-nodes-in-subdivided-graph/reachable-nodes-in-subdivided-graph_test.go new file mode 100755 index 000000000..bb454ef00 --- /dev/null +++ b/Algorithms/0882.reachable-nodes-in-subdivided-graph/reachable-nodes-in-subdivided-graph_test.go @@ -0,0 +1,78 @@ +package problem0882 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + edges [][]int + M int + N int + ans int +}{ + + { + [][]int{{3, 4, 8}, {0, 1, 3}, {1, 4, 0}, {1, 2, 3}, {0, 3, 2}, {0, 4, 10}, {1, 3, 3}, {2, 4, 3}, {2, 3, 3}, {0, 2, 10}}, + 7, + 5, + 43, + }, + + { + [][]int{{4, 5, 21}, {2, 9, 19}, {5, 9, 12}, {3, 8, 17}, {4, 9, 2}, {1, 2, 19}, {2, 8, 6}, {8, 9, 20}, {3, 5, 16}, {5, 6, 13}, {0, 8, 13}, {5, 8, 1}, {0, 9, 1}, {6, 8, 0}, {1, 3, 20}, {7, 9, 3}, {6, 9, 3}, {1, 9, 10}, {5, 7, 25}, {3, 6, 23}, {4, 6, 8}, {4, 7, 21}, {0, 5, 2}, {0, 6, 10}, {4, 8, 15}}, + 20, + 10, + 282, + }, + + { + [][]int{{1, 2, 5}, {0, 3, 3}, {1, 3, 2}, {2, 3, 4}, {0, 4, 1}}, + 7, + 5, + 13, + }, + + { + [][]int{{1, 2, 4}, {1, 4, 5}, {1, 3, 1}, {2, 3, 4}, {3, 4, 5}}, + 17, + 5, + 1, + }, + + { + [][]int{{0, 1, 10}, {0, 2, 1}, {1, 2, 2}}, + 6, + 3, + 13, + }, + + { + [][]int{{0, 1, 4}, {1, 2, 6}, {0, 2, 8}, {1, 3, 1}}, + 10, + 4, + 23, + }, + + // 可以有多个 testcase +} + +func Test_reachableNodes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reachableNodes(tc.edges, tc.M, tc.N), "输入:%v", tc) + } +} + +func Benchmark_reachableNodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reachableNodes(tc.edges, tc.M, tc.N) + } + } +} diff --git a/Algorithms/0883.projection-area-of-3d-shapes/README.md b/Algorithms/0883.projection-area-of-3d-shapes/README.md new file mode 100755 index 000000000..6cf2101cc --- /dev/null +++ b/Algorithms/0883.projection-area-of-3d-shapes/README.md @@ -0,0 +1,63 @@ +# [883. Projection Area of 3D Shapes](https://leetcode.com/problems/projection-area-of-3d-shapes/) + +## 题目 + +On aN*N grid, we place some1 * 1 * 1cubes that are axis-aligned with the x, y, and z axes. + +Each valuev = grid[i][j]represents a tower ofvcubes placed on top of grid cell (i, j). + +Now we view theprojectionof these cubesonto the xy, yz, and zx planes. + +A projection is like a shadow, thatmaps our 3 dimensional figure to a 2 dimensional plane. + +Here, we are viewing the "shadow" when looking at the cubes from the top, the front, and the side. + +Return the total area of all three projections. + +Example 1: + +```text +Input: [[2]] +Output: 5 +``` + +Example 2: + +```text +Input: [[1,2],[3,4]] +Output: 17 +Explanation: +Here are the three projections ("shadows") of the shape made with each axis-aligned plane. +``` + +![shadow](shadow.png) + +Example 3: + +```text +Input: [[1,0],[0,2]] +Output: 8 +``` + +Example 4: + +```text +Input: [[1,1,1],[1,0,1],[1,1,1]] +Output: 14 +``` + +Example 5: + +```text +Input: [[2,2,2],[2,1,2],[2,2,2]] +Output: 21 +``` + +Note: + +1. 1 <= grid.length = grid[0].length<= 50 +1. 0 <= grid[i][j] <= 50 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes.go b/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes.go new file mode 100755 index 000000000..a4b62060d --- /dev/null +++ b/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes.go @@ -0,0 +1,31 @@ +package problem0883 + +func projectionArea(grid [][]int) int { + xs := [51]int{} + ys := [51]int{} + res := 0 + + for i, line := range grid { + for j, k := range line { + if k == 0 { + continue + } + res++ + xs[i] = max(xs[i], k) + ys[j] = max(ys[j], k) + } + } + + for i := range xs { + res += xs[i] + ys[i] + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes_test.go b/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes_test.go new file mode 100755 index 000000000..c1c5146c4 --- /dev/null +++ b/Algorithms/0883.projection-area-of-3d-shapes/projection-area-of-3d-shapes_test.go @@ -0,0 +1,59 @@ +package problem0883 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{2}}, + 5, + }, + + { + [][]int{{1, 2}, {3, 4}}, + 17, + }, + + { + [][]int{{1, 0}, {0, 2}}, + 8, + }, + + { + [][]int{{1, 1, 1}, {1, 0, 1}, {1, 1, 1}}, + 14, + }, + + { + [][]int{{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}, + 21, + }, + + // 可以有多个 testcase +} + +func Test_projectionArea(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, projectionArea(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_projectionArea(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + projectionArea(tc.grid) + } + } +} diff --git a/Algorithms/0883.projection-area-of-3d-shapes/shadow.png b/Algorithms/0883.projection-area-of-3d-shapes/shadow.png new file mode 100644 index 000000000..6f0c5d48e Binary files /dev/null and b/Algorithms/0883.projection-area-of-3d-shapes/shadow.png differ diff --git a/Algorithms/0884.uncommon-words-from-two-sentences/README.md b/Algorithms/0884.uncommon-words-from-two-sentences/README.md new file mode 100755 index 000000000..2b15334c1 --- /dev/null +++ b/Algorithms/0884.uncommon-words-from-two-sentences/README.md @@ -0,0 +1,35 @@ +# [884. Uncommon Words from Two Sentences](https://leetcode.com/problems/uncommon-words-from-two-sentences/) + +## 题目 + +We are given two sentences A and B. (A sentenceis a string of space separated words. Each word consists only of lowercase letters.) + +A word is uncommonif it appears exactly once in one of the sentences, and does not appear in the other sentence. + +Return a list of all uncommon words. + +You may return the list in any order. + +Example 1: + +```text +Input: A = "this apple is sweet", B = "this apple is sour" +Output: ["sweet","sour"] +``` + +Example 2: + +```text +Input: A = "apple apple", B = "banana" +Output: ["banana"] +``` + +Note: + +1. 0 <= A.length <= 200 +1. 0 <= B.length <= 200 +1. A and B both contain only spaces and lowercase letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences.go b/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences.go new file mode 100755 index 000000000..bfea0d0a3 --- /dev/null +++ b/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences.go @@ -0,0 +1,28 @@ +package problem0884 + +import ( + "sort" + "strings" +) + +func uncommonFromSentences(A string, B string) []string { + tmp := strings.Split(A, " ") + tmp = append(tmp, strings.Split(B, " ")...) + + // 排序完成后, "" 会在首, "~" 会在尾 + // 安排这两个不相干的单词进入 tmp ,有利于简化后面的判断逻辑 + tmp = append(tmp, "", "~") + sort.Strings(tmp) + + size := len(tmp) + + res := make([]string, 0, size) + + for i := 1; i+1 < size; i++ { + if tmp[i-1] != tmp[i] && tmp[i] != tmp[i+1] { + res = append(res, tmp[i]) + } + } + + return res +} diff --git a/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences_test.go b/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences_test.go new file mode 100755 index 000000000..96a6ca8cd --- /dev/null +++ b/Algorithms/0884.uncommon-words-from-two-sentences/uncommon-words-from-two-sentences_test.go @@ -0,0 +1,51 @@ +package problem0884 + +import ( + "fmt" + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A string + B string + ans []string +}{ + + { + "this apple is sweet", + "this apple is sour", + []string{"sweet", "sour"}, + }, + + { + "apple apple", + "banana", + []string{"banana"}, + }, + + // 可以有多个 testcase +} + +func Test_uncommonFromSentences(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + sort.Strings(tc.ans) + actual := uncommonFromSentences(tc.A, tc.B) + sort.Strings(actual) + ast.Equal(tc.ans, actual, "输入:%v", tc) + } +} + +func Benchmark_uncommonFromSentences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + uncommonFromSentences(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0885.spiral-matrix-iii/README.md b/Algorithms/0885.spiral-matrix-iii/README.md new file mode 100755 index 000000000..12d088ed1 --- /dev/null +++ b/Algorithms/0885.spiral-matrix-iii/README.md @@ -0,0 +1,44 @@ +# [885. Spiral Matrix III](https://leetcode.com/problems/spiral-matrix-iii/) + +## 题目 + +On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. + +Here, the north-west corner of the grid is at thefirst row and column, and the south-east corner of the grid is at the last row and column. + +Now, we walk in a clockwise spiral shape to visit every position in this grid. + +Whenever we would move outside the boundary of the grid, we continue our walk outside the grid (but may return to the grid boundary later.) + +Eventually, we reach all R * C spaces of the grid. + +Return a list of coordinates representing the positions of the grid in the order they were visited. + +Example 1: + +```text +Input: R = 1, C = 4, r0 = 0, c0 = 0 +Output: [[0,0],[0,1],[0,2],[0,3]] +``` + +![Example 1 picture](p1.png) + +Example 2: + +```text +Input: R = 5, C = 6, r0 = 1, c0 = 4 +Output: [[1,4],[1,5],[2,5],[2,4],[2,3],[1,3],[0,3],[0,4],[0,5],[3,5],[3,4],[3,3],[3,2],[2,2],[1,2],[0,2],[4,5],[4,4],[4,3],[4,2],[4,1],[3,1],[2,1],[1,1],[0,1],[4,0],[3,0],[2,0],[1,0],[0,0]] +``` + +![Example 2 picture](p2.png) + +Note: + +1. 1 <= R <= 100 +1. 1 <= C <= 100 +1. 0 <= r0 < R +1. 0 <= c0 < C + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0885.spiral-matrix-iii/p1.png b/Algorithms/0885.spiral-matrix-iii/p1.png new file mode 100644 index 000000000..b7664fcf5 Binary files /dev/null and b/Algorithms/0885.spiral-matrix-iii/p1.png differ diff --git a/Algorithms/0885.spiral-matrix-iii/p2.png b/Algorithms/0885.spiral-matrix-iii/p2.png new file mode 100644 index 000000000..6fbd6734d Binary files /dev/null and b/Algorithms/0885.spiral-matrix-iii/p2.png differ diff --git a/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii.go b/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii.go new file mode 100755 index 000000000..345fc6cf2 --- /dev/null +++ b/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii.go @@ -0,0 +1,35 @@ +package problem0885 + +func spiralMatrixIII(R, C, x, y int) [][]int { + moves := R * C + + res := make([][]int, 1, moves) + res[0] = []int{x, y} + moves-- + + round := 2 + dx, dy := 0, 1 + + for moves > 0 { + for m := round / 2; m > 0; m-- { + x += dx + y += dy + if 0 <= x && x < R && 0 <= y && y < C { + res = append(res, []int{x, y}) + moves-- + } + } + round++ + /** + * 从向西开始,(dx,dy) 的变化如下 + * (0, 1) + * (1, 0) + * (0,-1) + * (-1,0) + * dx, dy = dy, -dx 可以实现以上变化 + */ + dx, dy = dy, -dx + } + + return res +} diff --git a/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii_test.go b/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii_test.go new file mode 100755 index 000000000..bf08e2dc1 --- /dev/null +++ b/Algorithms/0885.spiral-matrix-iii/spiral-matrix-iii_test.go @@ -0,0 +1,53 @@ +package problem0885 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + R int + C int + r0 int + c0 int + ans [][]int +}{ + + { + 1, + 4, + 0, + 0, + [][]int{{0, 0}, {0, 1}, {0, 2}, {0, 3}}, + }, + + { + 5, + 6, + 1, + 4, + [][]int{{1, 4}, {1, 5}, {2, 5}, {2, 4}, {2, 3}, {1, 3}, {0, 3}, {0, 4}, {0, 5}, {3, 5}, {3, 4}, {3, 3}, {3, 2}, {2, 2}, {1, 2}, {0, 2}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + }, + + // 可以有多个 testcase +} + +func Test_spiralMatrixIII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, spiralMatrixIII(tc.R, tc.C, tc.r0, tc.c0), "输入:%v", tc) + } +} + +func Benchmark_spiralMatrixIII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + spiralMatrixIII(tc.R, tc.C, tc.r0, tc.c0) + } + } +} diff --git a/Algorithms/0886.possible-bipartition/README.md b/Algorithms/0886.possible-bipartition/README.md new file mode 100755 index 000000000..ba31eae58 --- /dev/null +++ b/Algorithms/0886.possible-bipartition/README.md @@ -0,0 +1,45 @@ +# [886. Possible Bipartition](https://leetcode.com/problems/possible-bipartition/) + +## 题目 + +Given a set of Npeople (numbered 1, 2, ..., N), we would like to split everyone into two groups of any size. + +Each person may dislike some other people, and they should not go into the same group. + +Formally, if dislikes[i] = [a, b], it means it is not allowed to put the people numbered a and b into the same group. + +Return trueif and only if it is possible to split everyone into two groups in this way. + +Example 1: + +```text +Input: N = 4, dislikes = [[1,2],[1,3],[2,4]] +Output: true +Explanation: group1 [1,4], group2 [2,3] +``` + +Example 2: + +```text +Input: N = 3, dislikes = [[1,2],[1,3],[2,3]] +Output: false +``` + +Example 3: + +```text +Input: N = 5, dislikes = [[1,2],[2,3],[3,4],[4,5],[1,5]] +Output: false +``` + +Note: + +1. 1 <= N <= 2000 +1. 0 <= dislikes.length <= 10000 +1. 1 <= dislikes[i][j] <= N +1. dislikes[i][0] < dislikes[i][1] +1. There does not exist i != j for which dislikes[i] == dislikes[j]. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0886.possible-bipartition/possible-bipartition.go b/Algorithms/0886.possible-bipartition/possible-bipartition.go new file mode 100755 index 000000000..d182fa846 --- /dev/null +++ b/Algorithms/0886.possible-bipartition/possible-bipartition.go @@ -0,0 +1,51 @@ +package problem0886 + +func possibleBipartition(N int, dislikes [][]int) bool { + /**转换 dislikes 到 diss + * 收集每个人 dislike 的所有人 + */ + diss := make([][]int, N+1) + for i := range diss { + diss[i] = make([]int, 0, 10) + } + for _, dl := range dislikes { + a, b := dl[0], dl[1] + diss[a] = append(diss[a], b) + diss[b] = append(diss[b], a) + } + + group := make([]int, N+1) + flag := 1 + + for i := 1; i <= N; i++ { + if group[i] != 0 { + continue + } + + /**bfs */ + + group[i] = flag + queue := make([]int, 1, N+1) + queue[0] = i + + for len(queue) > 0 { + flag = -flag + size := len(queue) + for j := 0; j < size; j++ { + qj := queue[j] + for _, p := range diss[qj] { + if group[p] == 0 { + group[p] = flag + queue = append(queue, p) + } else if group[p] != flag { + return false + } + } + } + queue = queue[size:] + } + + } + + return true +} diff --git a/Algorithms/0886.possible-bipartition/possible-bipartition_test.go b/Algorithms/0886.possible-bipartition/possible-bipartition_test.go new file mode 100755 index 000000000..c5aa2ac0c --- /dev/null +++ b/Algorithms/0886.possible-bipartition/possible-bipartition_test.go @@ -0,0 +1,53 @@ +package problem0886 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + dislikes [][]int + ans bool +}{ + + { + 4, + [][]int{{1, 2}, {1, 3}, {2, 4}}, + true, + }, + + { + 3, + [][]int{{1, 2}, {1, 3}, {2, 3}}, + false, + }, + + { + 5, + [][]int{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {1, 5}}, + false, + }, + + // 可以有多个 testcase +} + +func Test_possibleBipartition(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, possibleBipartition(tc.N, tc.dislikes), "输入:%v", tc) + } +} + +func Benchmark_possibleBipartition(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + possibleBipartition(tc.N, tc.dislikes) + } + } +} diff --git a/Algorithms/0887.super-egg-drop/README.md b/Algorithms/0887.super-egg-drop/README.md new file mode 100755 index 000000000..f203014cd --- /dev/null +++ b/Algorithms/0887.super-egg-drop/README.md @@ -0,0 +1,50 @@ +# [887. Super Egg Drop](https://leetcode.com/problems/super-egg-drop/) + +## 题目 + +You are given K eggs, and you have access to a building with N floors from 1 to N. + +Each egg is identical in function, and if an egg breaks, you cannot drop itagain. + +You know that there exists a floor F with 0 <= F <= N such that any egg dropped at a floor higher than F will break, and any egg dropped at or below floor F will not break. + +Each move, you may take an egg (if you have an unbroken one) and drop it from any floor X (with1 <= X <= N). + +Your goal is to knowwith certaintywhat the value of F is. + +What is the minimum number of moves that you need to know with certaintywhat F is, regardless of the initial value of F? + +Example 1: + +```text +Input: K = 1, N = 2 +Output: 2 +Explanation: +Drop the egg from floor 1. If it breaks, we know with certainty that F = 0. +Otherwise, drop the egg from floor 2. If it breaks, we know with certainty that F = 1. +If it didn't break, then we know with certainty F = 2. +Hence, we needed 2 moves in the worst case to know what F is with certainty. +``` + +Example 2: + +```text +Input: K = 2, N = 6 +Output: 3 +``` + +Example 3: + +```text +Input: K = 3, N = 14 +Output: 4 +``` + +Note: + +1. 1 <= K <= 100 +1. 1 <= N <= 10000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0887.super-egg-drop/super-egg-drop.go b/Algorithms/0887.super-egg-drop/super-egg-drop.go new file mode 100755 index 000000000..f3951dc77 --- /dev/null +++ b/Algorithms/0887.super-egg-drop/super-egg-drop.go @@ -0,0 +1,24 @@ +package problem0887 + +func superEggDrop(K, N int) int { + moves := 0 + dp := [101]int{} // 1 <= K <= 100 + // dp[i] = n 表示, i 个鸡蛋,利用 moves 次移动,最多可以检测 n 层楼 + for dp[K] < N { + for i := K; i > 0; i-- { + dp[i] += dp[i-1] + 1 + // 以上计算式,是从以下转移方程简化而来 + // dp[moves][k] = 1 + dp[moves-1][k-1] + dp[moves-1][k] + // 假设 dp[moves-1][k-1] = n0, dp[moves-1][k] = n1 + // 首先检测,从第 n0+1 楼丢下鸡蛋会不会破。 + // 如果鸡蛋破了,F 一定是在 [1:n0] 楼中, + // 利用剩下的 moves-1 次机会和 k-1 个鸡蛋,可以把 F 找出来。 + // 如果鸡蛋没破,假如 F 在 [n0+2:n0+n1+1] 楼中 + // 利用剩下的 moves-1 次机会和 k 个鸡蛋把,也可以把 F 找出来。 + // 所以,当有 moves 个放置机会和 k 个鸡蛋的时候 + // F 在 [1, n0+n1+1] 中的任何一楼,都能够被检测出来。 + } + moves++ + } + return moves +} diff --git a/Algorithms/0887.super-egg-drop/super-egg-drop_test.go b/Algorithms/0887.super-egg-drop/super-egg-drop_test.go new file mode 100755 index 000000000..e617278b9 --- /dev/null +++ b/Algorithms/0887.super-egg-drop/super-egg-drop_test.go @@ -0,0 +1,71 @@ +package problem0887 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + K int + N int + ans int +}{ + + { + 2, + 10000, + 141, + }, + + { + 5, + 10000, + 18, + }, + + { + 100, + 10000, + 14, + }, + + { + 1, + 2, + 2, + }, + + { + 2, + 6, + 3, + }, + + { + 3, + 14, + 4, + }, + + // 可以有多个 testcase +} + +func Test_superEggDrop(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, superEggDrop(tc.K, tc.N), "输入:%v", tc) + } +} + +func Benchmark_superEggDrop(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + superEggDrop(tc.K, tc.N) + } + } +} diff --git a/Algorithms/0888.fair-candy-swap/README.md b/Algorithms/0888.fair-candy-swap/README.md new file mode 100755 index 000000000..d5429a60d --- /dev/null +++ b/Algorithms/0888.fair-candy-swap/README.md @@ -0,0 +1,52 @@ +# [888. Fair Candy Swap](https://leetcode.com/problems/fair-candy-swap/) + +## 题目 + +Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar of candy that Bob has. + +Since they are friends, they would like to exchange one candy bar each so that after the exchange, they both have the same totalamount of candy. (The total amount of candya person has is the sum of the sizes of candybars they have.) + +Return an integer array answhere ans[0] is the size of the candy bar that Alice must exchange, and ans[1] is the size of the candy bar that Bob must exchange. + +If there are multiple answers, you may return any one of them. It is guaranteed an answer exists. + +Example 1: + +```text +Input: A = [1,1], B = [2,2] +Output: [1,2] +``` + +Example 2: + +```text +Input: A = [1,2], B = [2,3] +Output: [1,2] +``` + +Example 3: + +```text +Input: A = [2], B = [1,3] +Output: [2,3] +``` + +Example 4: + +```text +Input: A = [1,2,5], B = [2,4] +Output: [5,4] +``` + +Note: + +1. 1 <= A.length <= 10000 +1. 1 <= B.length <= 10000 +1. 1 <= A[i] <= 100000 +1. 1 <= B[i] <= 100000 +1. It is guaranteed that Alice and Bob have different total amounts ofcandy. +1. It is guaranteed there exists ananswer. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0888.fair-candy-swap/fair-candy-swap.go b/Algorithms/0888.fair-candy-swap/fair-candy-swap.go new file mode 100755 index 000000000..6fa89778a --- /dev/null +++ b/Algorithms/0888.fair-candy-swap/fair-candy-swap.go @@ -0,0 +1,28 @@ +package problem0888 + +func fairCandySwap(A []int, B []int) []int { + + sumA := 0 + isExist := make(map[int]bool, len(A)) + for _, a := range A { + sumA += a + isExist[a] = true + } + + sumB := 0 + for _, b := range B { + sumB += b + } + + halfDiff := (sumA - sumB) / 2 + + a, b := 0, 0 + for _, b = range B { + a = b + halfDiff + if isExist[a] { + break + } + } + + return []int{a, b} +} diff --git a/Algorithms/0888.fair-candy-swap/fair-candy-swap_test.go b/Algorithms/0888.fair-candy-swap/fair-candy-swap_test.go new file mode 100755 index 000000000..21e320dec --- /dev/null +++ b/Algorithms/0888.fair-candy-swap/fair-candy-swap_test.go @@ -0,0 +1,59 @@ +package problem0888 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans []int +}{ + + { + []int{1, 1}, + []int{2, 2}, + []int{1, 2}, + }, + + { + []int{1, 2}, + []int{2, 3}, + []int{1, 2}, + }, + + { + []int{2}, + []int{1, 3}, + []int{2, 3}, + }, + + { + []int{1, 2, 5}, + []int{2, 4}, + []int{5, 4}, + }, + + // 可以有多个 testcase +} + +func Test_fairCandySwap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, fairCandySwap(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_fairCandySwap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + fairCandySwap(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/README.md b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/README.md new file mode 100755 index 000000000..8de0eeeba --- /dev/null +++ b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/README.md @@ -0,0 +1,24 @@ +# [889. Construct Binary Tree from Preorder and Postorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/) + +## 题目 + +Return any binary tree that matches the given preorder and postorder traversals. + +Values in the traversalspre and postare distinctpositive integers. + +Example 1: + +```text +Input: pre = [1,2,4,5,3,6,7], post = [4,5,2,6,7,3,1] +Output: [1,2,3,4,5,6,7] +``` + +Note: + +1. 1 <= pre.length == post.length <= 30 +1. pre[] and post[]are both permutations of 1, 2, ..., pre.length. +1. It is guaranteed an answer exists. If there exists multiple answers, you can return any of them. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal.go b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal.go new file mode 100755 index 000000000..c15eceeda --- /dev/null +++ b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal.go @@ -0,0 +1,43 @@ +package problem0889 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is definited for a binary tree node. +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func constructFromPrePost(pre []int, post []int) *TreeNode { + size := len(pre) + + if size == 0 { + return nil + } + + res := &TreeNode{ + Val: pre[0], + } + + if size == 1 { + return res + } + + leftVal := pre[1] + // 查找 leftVal 在 post 中的索引号 + i := 0 + for ; i < size; i++ { + if post[i] == leftVal { + break + } + } + + res.Left = constructFromPrePost(pre[1:i+2], post[0:i+1]) + res.Right = constructFromPrePost(pre[i+2:], post[i+1:size-1]) + + return res +} diff --git a/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal_test.go b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal_test.go new file mode 100755 index 000000000..379690833 --- /dev/null +++ b/Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal/construct-binary-tree-from-preorder-and-postorder-traversal_test.go @@ -0,0 +1,49 @@ +package problem0889 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pre []int + post []int + ans []int +}{ + + { + []int{1, 2, 4, 5, 3, 6}, + []int{4, 5, 2, 6, 3, 1}, + []int{1, 2, 3, 4, 5, 6}, + }, + + { + []int{1, 2, 4, 5, 3, 6, 7}, + []int{4, 5, 2, 6, 7, 3, 1}, + []int{1, 2, 3, 4, 5, 6, 7}, + }, + + // 可以有多个 testcase +} + +func Test_constructFromPrePost(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := kit.Tree2ints(constructFromPrePost(tc.pre, tc.post)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_constructFromPrePost(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + constructFromPrePost(tc.pre, tc.post) + } + } +} diff --git a/Algorithms/0890.find-and-replace-pattern/README.md b/Algorithms/0890.find-and-replace-pattern/README.md new file mode 100755 index 000000000..627667d0c --- /dev/null +++ b/Algorithms/0890.find-and-replace-pattern/README.md @@ -0,0 +1,32 @@ +# [890. Find and Replace Pattern](https://leetcode.com/problems/find-and-replace-pattern/) + +## 题目 + +You have a list ofwords and a pattern, and you want to know which words in words matches the pattern. + +A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word. + +(Recall that a permutation of letters is a bijection from letters to letters: every letter maps to another letter, and no two letters map to the same letter.) + +Return a list of the words in wordsthat match the given pattern. + +You may return the answer in any order. + +Example 1: + +```text +Input: words = ["abc","deq","mee","aqq","dkd","ccc"], pattern = "abb" +Output: ["mee","aqq"] +Explanation: "mee" matches the pattern because there is a permutation {a -> m, b -> e, ...}. +"ccc" does not match the pattern because {a -> c, b -> c, ...} is not a permutation, +since a and b map to the same letter. +``` + +Note: + +1. 1 <= words.length <= 50 +1. 1 <= pattern.length = words[i].length<= 20 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern.go b/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern.go new file mode 100755 index 000000000..a9062e5ec --- /dev/null +++ b/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern.go @@ -0,0 +1,29 @@ +package problem0890 + +func findAndReplacePattern(words []string, pattern string) []string { + np := normalize(pattern) + res := make([]string, 0, len(words)) + for _, w := range words { + if normalize(w) == np { + res = append(res, w) + } + } + return res +} + +// 把 str 标准化 +func normalize(str string) string { + m := make(map[rune]byte, len(str)) + /**按照字符在 s 中第一次出现的顺序,依次映射到 a,b,c,... */ + for _, c := range str { + if _, ok := m[c]; !ok { + m[c] = byte(len(m)) + 'a' + } + } + /**按照字符的映射关系,映射 s 到 res */ + res := make([]byte, len(str)) + for i, c := range str { + res[i] = m[c] + } + return string(res) +} diff --git a/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern_test.go b/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern_test.go new file mode 100755 index 000000000..627deb95b --- /dev/null +++ b/Algorithms/0890.find-and-replace-pattern/find-and-replace-pattern_test.go @@ -0,0 +1,53 @@ +package problem0890 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + pattern string + ans []string +}{ + + { + []string{"abc", "deq", ",ee", "aqq", "dkd", "ccc"}, + "abb", + []string{",ee", "aqq"}, + }, + + { + []string{"abc", "deq", "Mee", "aqq", "dkd", "ccc"}, + "abb", + []string{"Mee", "aqq"}, + }, + + { + []string{"abc", "deq", "mee", "aqq", "dkd", "ccc"}, + "abb", + []string{"mee", "aqq"}, + }, + + // 可以有多个 testcase +} + +func Test_findAndReplacePattern(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, findAndReplacePattern(tc.words, tc.pattern), "输入:%v", tc) + } +} + +func Benchmark_findAndReplacePattern(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findAndReplacePattern(tc.words, tc.pattern) + } + } +} diff --git a/Algorithms/0891.sum-of-subsequence-widths/README.md b/Algorithms/0891.sum-of-subsequence-widths/README.md new file mode 100755 index 000000000..0ec0c620b --- /dev/null +++ b/Algorithms/0891.sum-of-subsequence-widths/README.md @@ -0,0 +1,31 @@ +# [891. Sum of Subsequence Widths](https://leetcode.com/problems/sum-of-subsequence-widths/) + +## 题目 + +Given an array of integers A, consider all non-empty subsequences of A. + +For any sequence S, let thewidthof S be the difference between the maximum and minimum element of S. + +Return the sum of the widths of all subsequences of A. + +As the answer may be very large, return the answer modulo 10^9 + 7. + +Example 1: + +```text +Input: [2,1,3] +Output: 6 +Explanation: +Subsequences are [1], [2], [3], [2,1], [2,3], [1,3], [2,1,3]. +The corresponding widths are 0, 0, 0, 1, 1, 2, 2. +The sum of these widths is 6. +``` + +Note: + +1. 1 <= A.length <= 20000 +1. 1 <= A[i] <= 20000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths.go b/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths.go new file mode 100755 index 000000000..8542caa14 --- /dev/null +++ b/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths.go @@ -0,0 +1,33 @@ +package problem0891 + +import ( + "sort" +) + +const mod = int(1e9 + 7) + +func sumSubseqWidths(a []int) int { + sort.Ints(a) + + n := len(a) + res := 0 + times := 1 + for i := 0; i < n; i++ { + res += (a[i] - a[n-i-1]) * times + res %= mod + times = (times << 1) % mod + } + + return res +} + +/** + * https://leetcode.com/problems/sum-of-subsequence-widths/discuss/161267/C++Java1-line-Python-Sort-and-One-Pass + * For A[i]: + * There are i smaller numbers, + * so there are 2 ^ i sequences in which A[i] is maximum. + * we should do res += A[i] * (2 ^ i) + * There are n - i - 1 bigger numbers, + * so there are 2 ^ (n - i - 1) sequences in which A[i] is minimum. + * we should do res -= A[i] * 2 ^ (n - i - 1) + */ diff --git a/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths_test.go b/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths_test.go new file mode 100755 index 000000000..e27e00e35 --- /dev/null +++ b/Algorithms/0891.sum-of-subsequence-widths/sum-of-subsequence-widths_test.go @@ -0,0 +1,59 @@ +package problem0891 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, 10001}, + 10000, + }, + + { + []int{96, 87, 191, 197, 40, 101, 108, 35, 169, 50, 168, 182, 95, 80, 144, 43, 18, 60, 174, 13, 77, 173, 38, 46, 80, 117, 13, 19, 11, 6, 13, 118, 39, 80, 171, 36, 86, 156, 165, 190, 53, 49, 160, 192, 57, 42, 97, 35, 124, 200, 84, 70, 145, 180, 54, 141, 159, 42, 66, 66, 25, 95, 24, 136, 140, 159, 71, 131, 5, 140, 115, 76, 151, 137, 63, 47, 69, 164, 60, 172, 153, 183, 6, 70, 40, 168, 133, 45, 116, 188, 20, 52, 70, 156, 44, 27, 124, 59, 42, 172}, + 136988321, + }, + + { + []int{160, 192, 57, 42, 97, 35, 124, 200, 84, 70, 145, 180, 54, 141, 159, 42, 66, 66, 25, 95, 24, 136, 140, 159, 71, 131, 5, 140, 115, 76, 151, 137, 63, 47, 69, 164, 60, 172, 153, 183, 6, 70, 40, 168, 133, 45, 116, 188, 20, 52, 70, 156, 44, 27, 124, 59, 42, 172}, + 350094743, + }, + + { + []int{2, 1, 3, 4}, + 23, + }, + + { + []int{2, 1, 3}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_sumSubseqWidths(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, sumSubseqWidths(tc.A), "输入:%v", tc) + } +} + +func Benchmark_sumSubseqWidths(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sumSubseqWidths(tc.A) + } + } +} diff --git a/Algorithms/0892.surface-area-of-3d-shapes/README.md b/Algorithms/0892.surface-area-of-3d-shapes/README.md new file mode 100755 index 000000000..3dbb060aa --- /dev/null +++ b/Algorithms/0892.surface-area-of-3d-shapes/README.md @@ -0,0 +1,53 @@ +# [892. Surface Area of 3D Shapes](https://leetcode.com/problems/surface-area-of-3d-shapes/) + +## 题目 + +On a `N*N` grid, we place some `1 * 1 * 1` cubes. + +Each value `v = grid[i][j]` represents a tower ofvcubes placed on top of grid cell(i, j). + +Return the total surface area of the resulting shapes. + +Example 1: + +```text +Input: [[2]] +Output: 10 +``` + +Example 2: + +```text +Input: [[1,2],[3,4]] +Output: 34 +``` + +Example 3: + +```text +Input: [[1,0],[0,2]] +Output: 16 +``` + +Example 4: + +```text +Input: [[1,1,1],[1,0,1],[1,1,1]] +Output: 32 +``` + +Example 5: + +```text +Input: [[2,2,2],[2,1,2],[2,2,2]] +Output: 46 +``` + +Note: + +- 1 <= N <= 50 +- 0 <= grid[i][j] <= 50 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes.go b/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes.go new file mode 100755 index 000000000..ea38033a8 --- /dev/null +++ b/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes.go @@ -0,0 +1,29 @@ +package problem0892 + +func surfaceArea(grid [][]int) int { + N := len(grid) + res := 0 + for i := 0; i < N; i++ { + for j := 0; j < N; j++ { + v := grid[i][j] + if v == 0 { + continue + } + res += v*6 - (v-1)*2 /** 单独一个立柱的外表面面积 */ + if j+1 < N { + res -= min(v, grid[i][j+1]) * 2 /** 与右侧立柱贴合的面积 */ + } + if i+1 < N { + res -= min(v, grid[i+1][j]) * 2 /** 与下侧立柱贴合的面积 */ + } + } + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes_test.go b/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes_test.go new file mode 100755 index 000000000..3be06b3d8 --- /dev/null +++ b/Algorithms/0892.surface-area-of-3d-shapes/surface-area-of-3d-shapes_test.go @@ -0,0 +1,59 @@ +package problem0892 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{1, 0}, {0, 2}}, + 16, + }, + + { + [][]int{{2}}, + 10, + }, + + { + [][]int{{1, 2}, {3, 4}}, + 34, + }, + + { + [][]int{{1, 1, 1}, {1, 0, 1}, {1, 1, 1}}, + 32, + }, + + { + [][]int{{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}, + 46, + }, + + // 可以有多个 testcase +} + +func Test_surfaceArea(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, surfaceArea(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_surfaceArea(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + surfaceArea(tc.grid) + } + } +} diff --git a/Algorithms/0893.groups-of-special-equivalent-strings/README.md b/Algorithms/0893.groups-of-special-equivalent-strings/README.md new file mode 100755 index 000000000..e1acc3926 --- /dev/null +++ b/Algorithms/0893.groups-of-special-equivalent-strings/README.md @@ -0,0 +1,56 @@ +# [893. Groups of Special-Equivalent Strings](https://leetcode.com/problems/groups-of-special-equivalent-strings/) + +## 题目 + +You are given an array A of strings. + +Two strings S and T arespecial-equivalentif after any number of moves, S == T. + +A move consists of choosing two indices i and j with i % 2 == j % 2, and swapping S[i] with S[j]. + +Now, a group of special-equivalent strings from Ais anon-empty subset S of Asuch that any string not in Sis not special-equivalent with any string in S. + +Return the number of groups of special-equivalent strings from A. + +Example 1: + +```text +Input: ["a","b","c","a","c","c"] +Output: 3 +Explanation: 3 groups ["a","a"], ["b"], ["c","c","c"] +``` + +Example 2: + +```text +Input: ["aa","bb","ab","ba"] +Output: 4 +Explanation: 4 groups ["aa"], ["bb"], ["ab"], ["ba"] +``` + +Example 3: + +```text +Input: ["abc","acb","bac","bca","cab","cba"] +Output: 3 +Explanation: 3 groups ["abc","cba"], ["acb","bca"], ["bac","cab"] +``` + +Example 4: + +```text +Input: ["abcd","cdab","adcb","cbad"] +Output: 1 +Explanation: 1 group ["abcd","cdab","adcb","cbad"] +``` + +Note: + +1. 1 <= A.length <= 1000 +1. 1 <= A[i].length <= 20 +1. All A[i] have the same length. +1. All A[i] consist of only lowercase letters. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings.go b/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings.go new file mode 100755 index 000000000..8a670dfe3 --- /dev/null +++ b/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings.go @@ -0,0 +1,23 @@ +package problem0893 + +func numSpecialEquivGroups(A []string) int { + strSize := len(A[0]) + groups := make(map[[26]int]bool, len(A)) + for _, a := range A { + count := [26]int{} + i := 0 + for i = 0; i+1 < strSize; i += 2 { + // 使用循环展开,避免了判断 i 的奇偶性的 mod 运算 + // 还减短了关键路径的长度。 + count[a[i]-'a']++ + // 由于题目条件限制了 strSize <= 20 + // 所以可以在同一个数据同时统计奇偶位上字母 + count[a[i+1]-'a'] += 100 + } + if i < strSize { + count[a[i]-'a']++ + } + groups[count] = true + } + return len(groups) +} diff --git a/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings_test.go b/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings_test.go new file mode 100755 index 000000000..330aba5e3 --- /dev/null +++ b/Algorithms/0893.groups-of-special-equivalent-strings/groups-of-special-equivalent-strings_test.go @@ -0,0 +1,59 @@ +package problem0893 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans int +}{ + + { + []string{"demp", "cfhp", "dzvf", "ggxe", "hkte", "clug", "nhgk", "hvwj", "zozr", "datm", "hisr", "gfry", "jknr", "laju", "emsf", "duwe", "ilta", "gjrd", "woaq", "zhdm", "ujmz", "jalu", "tkhe", "gexg", "hrsi", "tail", "ilta", "xegg", "srhi", "clug", "cgul", "gexg", "tehk", "ulcg", "xgge", "cgul", "hrsi", "aowq", "jalu", "laju", "vzdf", "gexg", "hpcf", "zhdm", "hfcp", "zhdm", "ulcg", "jalu", "ggxe", "gexg", "nkgh", "hrsi", "vfdz", "nkgh", "cgul", "hpcf", "hetk", "zrzo", "xegg", "nkgh", "srhi", "smef", "ulcg", "hrsi", "ggxe", "ggxe", "efsm", "ggxe", "jalu", "srhi", "dmzh", "laju", "zmdh", "sfem", "tehk", "srhi", "wqao", "gknh", "jalu", "iatl", "gexg", "ugcl", "nkgh", "hrsi", "srhi", "hkte", "gdrj", "zozr", "hisr", "sihr", "smef", "zmdh", "clug", "iatl", "cgul", "woaq", "jrnk", "sihr", "xegg", "luja"}, + 21, + }, + + { + []string{"a", "b", "c", "a", "c", "c"}, + 3, + }, + + { + []string{"aa", "bb", "ab", "ba"}, + 4, + }, + + { + []string{"abc", "acb", "bac", "bca", "cab", "cba"}, + 3, + }, + + { + []string{"abcd", "cdab", "adcb", "cbad"}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_numSpecialEquivGroups(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numSpecialEquivGroups(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numSpecialEquivGroups(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSpecialEquivGroups(tc.A) + } + } +} diff --git a/Algorithms/0894.all-possible-full-binary-trees/README.md b/Algorithms/0894.all-possible-full-binary-trees/README.md new file mode 100755 index 000000000..a3a0b60f1 --- /dev/null +++ b/Algorithms/0894.all-possible-full-binary-trees/README.md @@ -0,0 +1,29 @@ +# [894. All Possible Full Binary Trees](https://leetcode.com/problems/all-possible-full-binary-trees/) + +## 题目 + +A `full binary tree` is a binary tree where each node has exactly 0 or 2 children. + +Return a list of all possible full binary trees with `N` nodes. Each element of the answer is the root node of one possible tree. + +Each `node` of each tree in the answer must have node.Val = 0. + +You may return the final list of trees in any order. + +Example 1: + +```text +Input: 7 +Output: [[0,0,0,null,null,0,0,null,null,0,0],[0,0,0,null,null,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,null,null,null,null,0,0],[0,0,0,0,0,null,null,0,0]] +Explanation: +``` + +![trees](fivetrees.png) + +Note: + +- 1 <= N <= 20 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees.go b/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees.go new file mode 100755 index 000000000..bb16ef862 --- /dev/null +++ b/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees.go @@ -0,0 +1,36 @@ +package problem0894 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode 是题目预定义的树结构 +type TreeNode = kit.TreeNode + +var forest = [10][]*TreeNode{[]*TreeNode{&TreeNode{Val: 0}}} + +func allPossibleFBT(N int) []*TreeNode { + if N%2 == 0 { + return nil + } else if forest[N/2] != nil { + return forest[N/2] + } + + trees := make([]*TreeNode, 0, N*2) + for les := 1; les <= N-2; les += 2 { + ris := N - 1 - les + for _, left := range allPossibleFBT(les) { + for _, right := range allPossibleFBT(ris) { + trees = append(trees, &TreeNode{ + Val: 0, + Left: left, + Right: right, + }) + } + } + } + + forest[N/2] = trees + + return forest[N/2] +} diff --git a/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees_test.go b/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees_test.go new file mode 100755 index 000000000..3d1df267d --- /dev/null +++ b/Algorithms/0894.all-possible-full-binary-trees/all-possible-full-binary-trees_test.go @@ -0,0 +1,70 @@ +package problem0894 + +import ( + "fmt" + "sort" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans [][]int +}{ + + { + 2, + [][]int{}, + }, + + { + 7, + [][]int{{0, 0, 0, kit.NULL, kit.NULL, 0, 0, kit.NULL, kit.NULL, 0, 0}, {0, 0, 0, kit.NULL, kit.NULL, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 0, 0}, {0, 0, 0, 0, 0, kit.NULL, kit.NULL, 0, 0}}, + }, + + // 可以有多个 testcase +} + +func Test_allPossibleFBT(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := allPossibleFBT(tc.N) + ansInts := make([][]int, 0, 20) + for _, tree := range ans { + ansInts = append(ansInts, kit.Tree2ints(tree)) + } + + sort.Slice(tc.ans, func(i int, j int) bool { + for k := 0; k < len(tc.ans[i]); k++ { + if tc.ans[i][k] != tc.ans[j][k] { + return tc.ans[i][k] < tc.ans[j][k] + } + } + return false + }) + + sort.Slice(ansInts, func(i int, j int) bool { + for k := 0; k < len(tc.ans[i]); k++ { + if ansInts[i][k] != ansInts[j][k] { + return ansInts[i][k] < ansInts[j][k] + } + } + return false + }) + + ast.Equal(tc.ans, ansInts, "输入:%v", tc) + } +} + +func Benchmark_allPossibleFBT(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + allPossibleFBT(tc.N) + } + } +} diff --git a/Algorithms/0894.all-possible-full-binary-trees/fivetrees.png b/Algorithms/0894.all-possible-full-binary-trees/fivetrees.png new file mode 100644 index 000000000..89d1fb33c Binary files /dev/null and b/Algorithms/0894.all-possible-full-binary-trees/fivetrees.png differ diff --git a/Algorithms/0895.maximum-frequency-stack/README.md b/Algorithms/0895.maximum-frequency-stack/README.md new file mode 100755 index 000000000..e6c0bbd46 --- /dev/null +++ b/Algorithms/0895.maximum-frequency-stack/README.md @@ -0,0 +1,46 @@ +# [895. Maximum Frequency Stack](https://leetcode.com/problems/maximum-frequency-stack/) + +## 题目 + +Implement FreqStack, a class which simulates the operation of a stack-like data structure. + +FreqStack`has two functions: + +- push(int x), which pushes an integer x onto the stack. +- pop(), which removes and returns the most frequent element in the stack. + - If there is a tie for most frequent element, the element closest to the top of the stack is removed and returned. + +Example 1: + +```text +Input: +["FreqStack","push","push","push","push","push","push","pop","pop","pop","pop"], +[[],[5],[7],[5],[7],[4],[5],[],[],[],[]] +Output: [null,null,null,null,null,null,null,5,7,5,4] +Explanation: +After making six .push operations, the stack is [5,7,5,7,4,5] from bottom to top. Then: + +pop() -> returns 5, as 5 is the most frequent. +The stack becomes [5,7,5,7,4]. + +pop() -> returns 7, as 5 and 7 is the most frequent, but 7 is closest to the top. +The stack becomes [5,7,5,4]. + +pop() -> returns 5. +The stack becomes [5,7,4]. + +pop() -> returns 4. +The stack becomes [5,7]. +``` + +Note: + +- Calls to FreqStack.push(int x)`will be such that 0 <= x <= 10^9. +- It is guaranteed that FreqStack.pop() won't be called if the stack has zero elements. +- The total number of FreqStack.push calls will not exceed 10000 in a single test case. +- The total number of FreqStack.pop`calls will not exceed 10000 in a single test case. +- The total number of FreqStack.push and FreqStack.pop calls will not exceed 150000 across all test cases. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack.go b/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack.go new file mode 100755 index 000000000..93bf5dfc9 --- /dev/null +++ b/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack.go @@ -0,0 +1,77 @@ +package problem0895 + +import ( + "container/heap" +) + +// FreqStack object will be instantiated and called as such: +// obj := Constructor(); +// obj.Push(x); +// param_2 := obj.Pop(); +type FreqStack struct { + index int + freq map[int]int + pq *PQ +} + +// Constructor 构建 FreqStack +func Constructor() FreqStack { + pq := make(PQ, 0, 10000) + return FreqStack{ + freq: make(map[int]int, 10000), + pq: &pq, + } +} + +// Push 在 fs 中放入 x +func (fs *FreqStack) Push(x int) { + fs.index++ + fs.freq[x]++ + e := &entry{ + key: x, + index: fs.index, + freq: fs.freq[x], + } + heap.Push(fs.pq, e) +} + +// Pop 从 fs 中弹出元素 +func (fs *FreqStack) Pop() int { + x := heap.Pop(fs.pq).(*entry).key + fs.freq[x]-- + return x +} + +// entry 是 priorityQueue 中的元素 +type entry struct { + key, index, freq int +} + +// PQ implements heap.Interface and holds entries. +type PQ []*entry + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + if pq[i].freq == pq[j].freq { + return pq[i].index > pq[j].index + } + return pq[i].freq > pq[j].freq +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + temp := x.(*entry) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} diff --git a/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack_test.go b/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack_test.go new file mode 100755 index 000000000..03868eeaa --- /dev/null +++ b/Algorithms/0895.maximum-frequency-stack/maximum-frequency-stack_test.go @@ -0,0 +1,46 @@ +package problem0895 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_FreqStack_1(t *testing.T) { + ast := assert.New(t) + fs := Constructor() + pushes := []int{5, 7, 5, 7, 4, 5} + for _, p := range pushes { + fs.Push(p) + } + expecteds := []int{5, 7, 5, 4} + for _, expected := range expecteds { + actual := fs.Pop() + ast.Equal(expected, actual) + } +} + +func Test_FreqStack_2(t *testing.T) { + ast := assert.New(t) + fs := Constructor() + // + pushes := []int{1, 1, 1, 2} + for _, p := range pushes { + fs.Push(p) + } + expecteds := []int{1, 1} + for _, expected := range expecteds { + actual := fs.Pop() + ast.Equal(expected, actual) + } + // + pushes = []int{2, 2, 1} + for _, p := range pushes { + fs.Push(p) + } + expecteds = []int{2, 1, 2} + for _, expected := range expecteds { + actual := fs.Pop() + ast.Equal(expected, actual) + } +} diff --git a/Algorithms/0896.monotonic-array/README.md b/Algorithms/0896.monotonic-array/README.md new file mode 100755 index 000000000..b3f577a08 --- /dev/null +++ b/Algorithms/0896.monotonic-array/README.md @@ -0,0 +1,53 @@ +# [896. Monotonic Array](https://leetcode.com/problems/monotonic-array/) + +## 题目 + +An array is monotonic if it is either monotone increasing or monotone decreasing. + +An array `A` is monotone increasing if for all `i <= j, A[i] <= A[j].` An array `A` is monotone decreasing if for all `i <= j, A[i] >= A[j]`. + +Return `true` if and only if the given array `A` is monotonic. + +Example 1: + +```text +Input: [1,2,2,3] +Output: true +``` + +Example 2: + +```text +Input: [6,5,4,4] +Output: true +``` + +Example 3: + +```text +Input: [1,3,2] +Output: false +``` + +Example 4: + +```text +Input: [1,2,4,5] +Output: true +``` + +Example 5: + +```text +Input: [1,1,1] +Output: true +``` + +Note: + +- 1 <= A.length <= 50000 +- -100000 <= A[i] <= 100000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0896.monotonic-array/monotonic-array.go b/Algorithms/0896.monotonic-array/monotonic-array.go new file mode 100755 index 000000000..240dbb6e4 --- /dev/null +++ b/Algorithms/0896.monotonic-array/monotonic-array.go @@ -0,0 +1,12 @@ +package problem0896 + +func isMonotonic(A []int) bool { + size := len(A) + inc, dec := true, true + for i := 1; i < size && (inc || dec); i++ { + inc = inc && A[i-1] <= A[i] + dec = dec && A[i-1] >= A[i] + } + + return inc || dec +} diff --git a/Algorithms/0896.monotonic-array/monotonic-array_test.go b/Algorithms/0896.monotonic-array/monotonic-array_test.go new file mode 100755 index 000000000..77ff98eaa --- /dev/null +++ b/Algorithms/0896.monotonic-array/monotonic-array_test.go @@ -0,0 +1,59 @@ +package problem0896 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{1, 2, 2, 3}, + true, + }, + + { + []int{6, 5, 4, 4}, + true, + }, + + { + []int{1, 3, 2}, + false, + }, + + { + []int{1, 2, 4, 5}, + true, + }, + + { + []int{1, 1, 1}, + true, + }, + + // 可以有多个 testcase +} + +func Test_isMonotonic(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, isMonotonic(tc.A), "输入:%v", tc) + } +} + +func Benchmark_isMonotonic(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isMonotonic(tc.A) + } + } +} diff --git a/Algorithms/0897.increasing-order-search-tree/README.md b/Algorithms/0897.increasing-order-search-tree/README.md new file mode 100755 index 000000000..84470d304 --- /dev/null +++ b/Algorithms/0897.increasing-order-search-tree/README.md @@ -0,0 +1,47 @@ +# [897. Increasing Order Search Tree](https://leetcode.com/problems/increasing-order-search-tree/) + +## 题目 + +Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child. + +```text +Example 1: +Input: [5,3,6,2,4,null,8,1,null,null,null,7,9] + + 5 + / \ + 3 6 + / \ \ + 2 4 8 + / / \ +1 7 9 + +Output: [1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9] + +1 + \ + 2 + \ + 3 + \ + 4 + \ + 5 + \ + 6 + \ + 7 + \ + 8 + \ + 9 +``` + +Note: + +- The number of nodes in the given tree will be between 1 and 100. +- Each node will have a unique integer value from 0 to 1000. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree.go b/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree.go new file mode 100755 index 000000000..289bea012 --- /dev/null +++ b/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree.go @@ -0,0 +1,28 @@ +package problem0897 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode Definition for a binary tree node. +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func increasingBST(root *TreeNode) *TreeNode { + var head = &TreeNode{} + tail := head + var rec func(root *TreeNode) + rec = func(root *TreeNode) { + if root == nil { + return + } + rec(root.Left) + root.Left = nil // 切断 root 与其 Left 的连接,避免形成环 + tail.Right, tail = root, root // 把 root 接上 tail,并保持 tail 指向尾部 + rec(root.Right) + } + rec(root) + return head.Right +} diff --git a/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree_test.go b/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree_test.go new file mode 100755 index 000000000..7c8183b58 --- /dev/null +++ b/Algorithms/0897.increasing-order-search-tree/increasing-order-search-tree_test.go @@ -0,0 +1,45 @@ +package problem0897 + +import ( + "fmt" + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +var null = kit.NULL + +// tcs is testcase slice +var tcs = []struct { + p []int + ans []int +}{ + + { + []int{5, 3, 6, 2, 4, null, 8, 1, null, null, null, 7, 9}, + []int{1, null, 2, null, 3, null, 4, null, 5, null, 6, null, 7, null, 8, null, 9}, + }, + + // 可以有多个 testcase +} + +func Test_increasingBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + root := kit.Ints2TreeNode(tc.p) + ans := kit.Tree2ints(increasingBST(root)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.p) + increasingBST(root) + } + } +} diff --git a/Algorithms/0898.bitwise-ors-of-subarrays/README.md b/Algorithms/0898.bitwise-ors-of-subarrays/README.md new file mode 100755 index 000000000..91efeb7fa --- /dev/null +++ b/Algorithms/0898.bitwise-ors-of-subarrays/README.md @@ -0,0 +1,43 @@ +# [898. Bitwise ORs of SubArrays](https://leetcode.com/problems/bitwise-ors-of-subarrays/) + +## 题目 + +We have an array `A` of non-negative integers. + +For every (contiguous) sub array `B =[A[i], A[i+1], ..., A[j]]` (with i <= j), we take the bitwise OR of all the elements in B, obtaining a result `A[i] | A[i+1] | ... | A[j]`. + +Return the number of possible`results.` (Results that occur more than once are only counted once in the final answer.) + +Example 1: + +```text +Input: [0] +Output: 1 +Explanation: +There is only one possible result: 0. +``` + +Example 2: + +```text +Input: [1,1,2] +Output: 3 +Explanation: +The possible sub arrays are [1], [1], [2], [1, 1], [1, 2], [1, 1, 2]. +These yield the results 1, 1, 2, 1, 3, 3. +There are 3 unique values, so the answer is 3. +``` + +Example 3: + +```text +Input: [1,2,4] +Output: 6 +Explanation: +The possible results are 1, 2, 3, 4, 6, and 7. +``` + +Note: + +- 1 <= A.length <= 50000 +- 0 <= A[i] <= 10^9 diff --git a/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays.go b/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays.go new file mode 100755 index 000000000..1b9b1ffaf --- /dev/null +++ b/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays.go @@ -0,0 +1,22 @@ +package problem0898 + +func subarrayBitwiseORs(a []int) int { + unique := make(map[int]bool, len(a)) + var prev, next []int + for _, x := range a { + isInNext := make(map[int]bool, len(prev)) + isInNext[x], unique[x] = true, true + next = append(next, x) + for _, y := range prev { + y |= x + if !isInNext[y] { + isInNext[y], unique[y] = true, true + next = append(next, y) + } + } + // 假设 x 在 a 中的索引号是 j,BitwiseOR(a) 表示对 a 中所有元素依次取或的结果 + // 那么此时, next 是 BitwiseOR(a[i:j+1]) 的集合,其中 i=0,1,...,j + prev, next = next, prev[:0] + } + return len(unique) +} diff --git a/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays_test.go b/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays_test.go new file mode 100755 index 000000000..417f7953f --- /dev/null +++ b/Algorithms/0898.bitwise-ors-of-subarrays/bitwise-ors-of-subarrays_test.go @@ -0,0 +1,59 @@ +package problem0898 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, 3, 4}, + 4, + }, + + { + []int{0}, + 1, + }, + + { + []int{1, 1, 2}, + 3, + }, + + { + []int{1, 2, 4}, + 6, + }, + + { + []int{530655536, 928078641, 321189591, 433348369, 368148846, 244673843, 935344340, 420292413, 802812842, 135640995, 520631925, 999129109, 225698369, 600346256, 559988972, 839784923, 456990771, 178246718, 308836641, 9242427, 61293926, 444870028, 618485197, 430197532, 151462860, 756059866, 575618363, 980126270, 559249004, 278111112, 220022472, 873721074, 995495324, 680558741, 281152893, 228088262, 828192401, 409220507, 676333585, 61874245, 622417672, 319124744, 569998772, 21055136, 325998969, 816437667, 39728988, 865273979, 379564726, 666426462, 954173567, 620212914, 653921867, 396611097, 314381640, 192828845, 915350101, 538762791, 343732646, 454249966, 127449168, 336328759, 635965386, 253575860, 621845032, 524471161, 141500781, 19665639, 837705535, 888053144, 191136767, 243591733, 694994005, 634783856, 669090696, 202172146, 361953009, 558462431, 442270553, 603459833, 91745235, 296539372, 139571372, 459605680, 925409904, 870556316, 789969050, 114846316, 292394258, 400728851, 119952885, 318577840, 298673755, 866399606, 906840482, 258819285, 705827935, 356722865, 669344279, 625367269, 717179880, 607717299, 411333710, 698779345, 26241552, 35404654, 154674449, 452768565, 102125350, 104953608, 881647237, 20745039, 459112502, 584192613, 213059203, 489674007, 576169704, 179055717, 423121361, 98163359, 244758426, 783341838, 18342205, 629853039, 510618595, 397044210, 429283438, 300216262, 402011520, 802712481, 946957766, 605582898, 909742104, 741648369, 516885886, 538523761, 164786455, 831785761, 173534064, 96918956, 177349204, 924754694, 638114449, 276674630, 671554258, 141991901, 900765459, 141745953, 704038254, 424882954, 37306863, 472247511, 569758486, 518469037, 235911823, 846688692, 303848304, 313423879, 632939188, 331104243, 517167442, 571055004, 266597871, 532608599, 296550877, 71993133, 762653468, 902280359, 789429097, 280250899, 14522378, 12643255, 502708413, 121774119, 783841941, 256950120, 262811378, 443354332, 254757044, 302985827, 262962504, 225722777, 319973037, 535978045, 840021548, 776860444, 753730714, 294066027, 952586930, 6514649, 286004792, 172702655, 637057474, 228715955, 105126015, 631615602, 869546624, 621774628, 530823095, 850851686, 114273855, 938790033, 115853565, 4749870, 955668289, 654223219, 171395367, 980279694, 698312020, 181353540, 462277167, 545194856, 224866048, 630979957, 943463621, 30190301, 853262246, 882986362, 22847439, 364928740, 953901210, 633505688, 38747191, 170033807, 229801458, 676004518, 75797397, 671245659, 823752370, 190615238, 570427636, 305352045, 560907620, 547653017, 686443946, 793805564, 636437835, 799056222, 457277848, 775008212, 841952374, 228857728, 234822155, 934424262, 706342550, 705900503, 623388192, 990147572, 886178585, 836493633, 171673887, 831500449, 711161010, 132929746, 280635769, 733519030, 316220544, 290754059, 654146891, 137456046, 223722543, 206168321, 715538503, 289962750, 608810889, 161589860, 824289995, 847862068, 984131593, 115738291, 778750356, 773861760, 257069501, 486063852, 775076393, 176854587, 359223345, 482417861, 697396663, 855261682, 594439310, 648078429, 743733268, 636669294, 769690723, 926990758, 889896532, 123427813, 34741679, 916437670, 140719166, 69051506, 456106260, 256535700, 795166886, 417653361, 791926546, 180398247, 750671851, 346140241, 609215214, 694735107, 856435584, 134015212, 614119121, 120673547, 744054980, 837344526, 350047981, 423306961, 552443876, 634648822, 379984981, 730898698, 87932716, 181028315, 649326619, 467382122, 212012221, 389292635, 35623804, 740348959, 298027524, 843279976, 213016500, 459412052, 317721420, 77962264, 764693639, 649143437, 159422738, 837780372, 348136992, 236345789, 498119322, 715373253, 482423067, 655449219, 834193190, 304088958, 1399139, 991096681, 732703820, 325160663, 468819853, 271586829, 96535142, 503334694, 910374575, 82747567, 354731446, 283598043, 585477712, 245161151, 345776310, 245524170, 9971459, 710823468, 90343051, 123580293, 670899635, 901223684, 539344677, 942927808, 383344232, 775261154, 202458936, 364178337, 644496289, 420449342, 734707612, 518230769, 59344459, 113448314, 957764320, 722800277, 460574296, 250371045, 379915120, 599673628, 851147271, 695258038, 342136141, 363429491, 170826906, 109926145, 917978489, 295445029, 156304005, 356597317, 614824142, 372859922, 787394040, 235867284, 284707523, 7622007, 274575480, 622054108, 248793728, 339813479, 401838598, 441875846, 330115950, 269866102, 716286283, 286158638, 11572337, 563336190, 371870126, 742575522, 30438828, 937785813, 786710077, 823038461, 202384911, 342611080, 987709284, 624342632, 553949432, 8790920, 638595095, 693713228, 634231188, 502798901, 752111301, 866853308, 366337798, 543021245, 571228126, 10653565, 752019642, 215522510, 913531723, 32637793, 250432799, 468386440, 466275456, 558222995, 735968948, 484684316, 48069686, 319820898, 439098336, 849599740, 55716616, 988684711, 809762536, 23195589, 302168113, 624021401, 57717807, 205903394, 999606167, 719055284, 652468784, 182863872, 727267875, 809921633, 217314117, 722259144, 446443226, 557203139, 341526448, 787175204, 379807766, 528932772, 858483055, 473807317, 988310021, 949758851, 198406027, 170469128, 367240443, 846011417, 125237977, 115514749, 975852386, 175941972, 393486961, 227653615, 857088471, 564458163, 419985867, 562747630, 660951237, 418860726, 602360353, 693036985, 803839919, 826954844, 474935241, 359639502, 901839521, 363248174, 651299096, 957637512, 662961732, 303239473, 587068005, 416770784, 200458495, 607470333, 36616013, 376261616, 815543449, 13744402, 332491172, 27391235, 283190, 458407034, 554084351, 646130004, 886184356, 947514802, 163019319, 591340865, 735198697, 931436390, 318580482, 382355901, 364322477, 787220294, 400681363, 589019478, 414844354, 902082200, 278544545, 336678839, 829438385, 133085758, 566196035, 468622812, 580350240, 60444553, 555204701, 527383566, 15503986, 990278321, 889721921, 576344425, 318755567, 224221164, 509948579, 554986987, 75147931, 922426289, 283106239, 189875951, 861616928, 776146514, 374756970, 717185706, 18356631, 42843096, 991191958, 639721930, 641704156, 595588414, 924626440, 999390962, 24731231, 53605368, 572297980, 14743260, 593093618, 308948318, 20237996, 958028846, 792836214, 440038148, 289314269, 59830062, 949956134, 729562982, 607675645, 360754319, 406899445, 65147224, 730017685, 638674719, 148845434, 684562548, 501554616, 212546597, 29714791, 829248978, 700084153, 231681849, 682551026, 815857307, 541910003, 324532244, 3828316, 146555634, 351450133, 258264318, 529238058, 514101615, 19662010, 533216859, 245662089, 489270970, 385222250, 71376152, 650819972, 418880632, 98766933, 207769588, 305456855, 874347082, 615680533, 131077055, 20639584, 965119884, 867495264, 101489772, 967445546, 119909121, 600351654, 265456676, 625329404, 845939142, 662017247, 71878236, 704007773, 309871217, 325404462, 845413270, 370989970, 88184649, 215041482, 392046060, 998887102, 144292920, 799804293, 328066064, 484802949, 331125111, 800815394, 800552869, 434493667, 764383920, 752217734, 318875562, 718096149, 749514671, 824107725, 748843685, 551452301, 32721319, 749368009, 998468873, 537152148, 194355495, 620147611, 522647153, 117467940, 171189606, 826918795, 3036705, 196076417, 74231525, 356357753, 415152279, 877788469, 51953596, 901470380, 621144912, 709238436, 72003245, 144695588, 491175426, 832905436, 484353527, 476176576, 959348616, 775833579, 385084137, 507944891, 401962505, 753171262, 320547818, 774196305, 327158087, 329591059, 466599347, 613849165, 442875909, 32254071, 902697057, 498066042, 630326311, 337758217, 760335528, 795792494, 228786892, 518412676, 764133247, 996357455, 977770312, 557113569, 148841329, 608797940, 742035850, 624032983, 218017533, 330314539, 521199663, 768196027, 29579010, 68819648, 568441189, 725209156, 279394647, 602993677, 421141644, 612474045, 875286587, 91868159, 930036707, 767770911, 838578140, 734896235, 50841785, 182301226, 479525401, 909901538, 468148262, 364265478, 948114408, 364533780, 391303343, 262788662, 40909680, 166457508, 647101962, 609458181, 211396927, 321588558, 574216191, 390244310, 615873345, 217295610, 173844113, 866199617, 882828546, 568815891, 717250333, 351995417, 90364649, 167952330, 336309462, 947356469, 385152530, 448608774, 867945780, 228958890, 623665086, 815775429, 814053954, 908661438, 554001370, 51125794, 862275420, 245422157, 681675143, 123896515, 414006739, 304053904, 159229193, 981998191, 622389636, 954654685, 644072784, 282607360, 219203800, 330992129, 608619819, 972751698, 533313070, 838405999, 88858401, 942089097, 746977241, 926666961, 859159975, 292376727, 793660707, 698843271, 417891509, 802973267, 293553845, 987673554, 379595510, 851444472, 257055715, 927610025, 226987215, 895075910, 884570518, 283178936, 105243328, 377082077, 265517856, 956496706, 829941496, 472609076, 547087021, 685497271, 262437496, 499020508, 920214939, 202768447, 74060803, 5944497, 641997590, 691498033, 331150561, 427138570, 540153226, 370041113, 20622181, 849822694, 925800277, 190115626, 674645658, 715137059, 774928394, 886297438, 360231177, 931163449, 947769246, 51808442, 143604124, 858957600, 865332557, 530636426, 33324832, 442034085, 771058274, 61792852, 808074280, 898577167, 753786935, 134548388, 264378009, 787468173, 578194692, 681004264, 779787409, 542636893, 354627810, 689300623, 162865415, 533422759, 351032705, 881784116, 526248487, 758692081, 406013592, 943221155, 468193259, 844873781, 426602722, 13046711, 818942154, 919103237, 618174444, 967199004, 93062018, 174923809, 431468472, 283722938, 529491426, 467399914, 934021857, 799590369, 583621475, 227168235, 163250082, 555046937, 469005906, 769502955, 886534299, 580431492, 537942630, 959135032, 377811501, 125837998, 151102081, 325460524, 33676687, 168466534, 963089827, 488449525, 453939156, 641587723, 756071590, 161352189, 573227615, 879288550, 976419637, 76030495, 424952893, 498338146, 867774358, 175387564, 238601329, 84364223, 422257403, 1596289, 577153399, 440055681, 849470354, 353000862, 587949899, 569731125, 745841859, 637745065, 138525773, 731559083, 739735346, 574241801, 290241180, 735284880, 705674538, 742150263, 891677914, 632286711, 716601216, 277071972, 406073814, 488308568, 604891030, 305818763, 22800424, 717419668, 715193045, 197750926, 650559606, 520898789, 169586095, 86930839, 675363845, 996980937, 571847964, 869967309, 863997019, 724755524, 543635262, 764130212, 124244089, 698257841, 75734340, 381823241, 354193343, 257939491, 307178081, 390043222, 14427239, 23917935, 145523402, 574418021, 105552442, 670296397, 725419581, 931643778, 335776934, 435197956, 892718196, 62952343, 445081731, 765753742, 848659718, 853215425, 902977866, 291618482, 376031016, 83058178, 268193463, 635441685, 671959938, 171377448, 122567921, 507986154, 14625899, 197738764, 857568902, 971057288, 134102415, 871829033, 139554103, 342377734, 949676018, 247031829, 400122714, 386044179, 115983333, 330544640, 369667643, 524943597, 901852364, 465521890, 663195216, 841504393, 478140546, 437868847, 632234415, 89164537, 510732718, 506473529, 925857517, 844109696, 495445229, 687197802, 354761298, 657958227, 794128788, 253898174, 51707361, 663947575, 285202226, 51256555, 959773458, 985096661, 989115609, 838342002, 501319858, 505045818, 294397502, 719261035, 846908705, 719552689, 628557707, 788430877, 54114334, 649567609, 426853348, 63491914, 937067140, 337208166, 669248408, 164304553, 703112882, 362884566, 191391070, 879332134, 152391223, 44295138, 905725871, 542223549, 849580189, 472457880, 834300041, 828967768, 408429507, 960014898, 90278694, 313807136, 967027635, 541773323, 92312812, 242459550, 853057864, 73201279, 711298593, 350890103, 520249608, 958984192, 137243860, 982081484, 515046107, 864075286, 875144687, 905087170, 279703517, 37209153, 970478809, 499479499, 52076676, 658588039, 768738685, 524193201, 275900227, 212740220, 171551924, 734125356, 724451879, 35725830, 968038239, 758684378, 829633482, 564288467, 432477407, 551170704, 512597311, 159812008, 115080234, 211573377, 178491131, 448704720, 255618000, 428719345, 478509774, 715865570, 396537086, 403199030, 756158822, 19958648, 960772049, 509404505, 196210034, 901424631, 574582812, 776137808, 955573763, 392685885, 511473681, 749672950, 484736963, 374980119, 268509251, 519569263, 621018742, 73787980, 889159483, 437534712, 871591557, 276377422, 334880540, 490935183, 775521554, 769122914, 428801318, 559230512, 793304088, 190411977, 839822265, 909455697, 798982932, 165275244, 720465469, 85759159, 54437495, 191884595, 672590057, 400723689, 644099534, 428865253, 224896394, 659410733, 729849464, 560210890, 73314197, 805319102, 758181533, 50865572, 262303187, 309720239, 841747068, 248625386, 519678426, 942276119, 305505310, 467931837, 79479139, 863069758, 667609141, 707723480, 929149875, 730900623, 207697820, 644252853, 485261136, 259488812, 685211991, 535298084, 712058280, 648184791, 275314646, 459034493, 908123669, 735806843, 458617544, 774873614, 87258784, 358544966, 803731973, 998408230, 573293348, 950410096, 44391386, 227758737, 441887376, 508172639, 408170871, 839608845, 749072635, 54395790, 216135838, 27259691, 630010201, 682298607, 783101346, 592684605, 201312572, 886569216, 390349621, 228750058, 659328019, 352996465, 558343470, 218197823, 808159462, 576065254, 244121333, 280370719, 705678387, 160887305, 939986753, 668075000, 511839543, 121433748, 728782969, 9100162, 331252730, 629746210, 79918444, 444882351, 663035685, 26467866, 970616596, 322199017, 516064972, 404978495, 413804996, 909128669, 346028708, 826609848, 805419344, 97904041, 249736143, 206685558, 173666976, 544644487, 707724103, 689986879, 597359785, 262499187, 478508293, 853110529, 483417018, 993644699, 726019174, 576812057, 861551974, 350334155, 196166744, 306319461, 34395756, 182983381, 599041131, 793888565, 788794038, 415702043, 775462463, 756607891, 405782513, 30066009, 825062717, 445926726, 118297383, 842086362, 818032332, 619366899, 817042931, 588011379, 610997700, 459970639, 832188890, 762328733, 757623300, 609004761, 548498125, 441741551, 739960140, 344428292, 654202247, 191611327, 899335843, 102666973, 701874692, 498133768, 242207557, 660353767, 33798767, 405225431, 150916805, 767688694, 272574276, 61072023, 790224132, 764785932, 973340287, 133001892, 423623842, 395554769, 480781663, 42018563, 169517420, 504719737, 55810259, 183530435, 418427452, 586271906, 887014525, 317743590, 762660015, 103691670, 552875714, 288040573, 448661065, 118017526, 279232517, 394289998, 918443330, 708979402, 131212487, 161450506, 738395274, 297338228, 292736235, 620564307, 669658188, 888124241, 961482853, 159253706, 738730395, 662846350, 348104647, 15149077, 15040180, 547955582, 852895013, 172692938, 533077598, 28530281, 177751787, 268140559, 557687823, 635066467, 244529506, 563226026, 507041664, 603394281, 913876383, 988793122, 503116131, 248110238, 814146275, 859692693, 355628399, 635842539, 820526089, 647352418, 196564144, 116943652, 622204999, 990828691, 638920881, 151862189, 889612903, 745789040, 762371135, 206726240, 29037112, 210320485, 236184339, 757453925, 590350897, 170704488, 489378771, 518349322, 828840727, 384991563, 27330749, 671518838, 692962234, 160268461, 867682266, 932798449, 309874897, 943384033, 632174174, 128378884, 821751196, 278779465, 146542001, 311612236, 864241569, 128599250, 450001236, 830941553, 965101620, 820029265, 428770355, 934963565, 892942463, 26543336, 748440818, 273192827, 606285240, 171294765, 18385968, 173416477, 611930800, 323032337, 850094912, 698754471, 213472194, 386455206, 98878100, 16867588, 959943438, 687963711, 310432368, 627837228, 774656795, 343431953, 410484555, 227428598, 361762454, 23649964, 309470523, 809662023, 929501783, 665630893, 626017941, 446493142, 740500748, 826001700, 844188596, 162448182, 984746913, 255946037, 923902859, 792033510, 254921069, 13477293, 250299193, 146237838, 784031542, 210204714, 130918155, 228986292, 369049595, 889625378, 506569320, 522507209, 365960806, 382622078, 443720685, 830324289, 15261923, 205711340, 15323832, 871799113, 696205111, 750294271, 975990610, 153485431, 296156047, 919692289, 652479512, 773428875, 169240983, 698578810, 142517346, 685174458, 298074867, 104832401, 819431359, 65985310, 44404574, 422135419, 135124243, 310861583, 636349787, 75282449, 781826319, 559323301, 438116952, 163554023, 233715293, 224703721, 916211361, 207443247, 609513414, 768300139, 658844147, 568506210, 495537732, 180739366, 625169364, 109169121, 982686980, 393441826, 70911614, 526697727, 664349572, 50731453, 382504513, 210952948, 160753589, 616246550, 412339113, 695415820, 267298836, 215254348, 649141154, 811042789, 279526826, 81909736, 732680160, 652643570, 802579699, 863303092, 837148579, 906184587, 670926647, 917239717, 97580270, 234406450, 577354774, 352872339, 320452466, 497780315, 588784161, 908779798, 502099700, 774307059, 326664186, 606902131, 928604677, 566969749, 806176493, 325586691, 45455591, 502095128, 118790605, 83729077, 941569521, 396274251, 102741462, 382033834, 800503895, 225116762, 855853282, 850985067, 906096732, 216800396, 220035577, 725748857, 303918990, 165622030, 573273713, 7299062, 60711486, 249046529, 370730722, 272129223, 729145567, 537447982, 832624466, 698209660, 583274433, 769900342, 743918446, 558986699, 484159982, 938552445, 929900504, 669853082, 387068389, 700053058, 637158088, 997809191, 656791472, 427982003, 279135025, 699458209, 694953874, 164028672, 747407724, 287483322, 4800403, 235039817, 641804285, 515774874, 390953823, 602744039, 613092486, 796871222, 243116207, 972878934, 220790804, 958118550, 408193403, 210736493, 539314887, 345049706, 158417907, 554679724, 503764222, 598221415, 253692739, 245951789, 124317235, 342123517, 260052135, 709444593, 444741343, 480560792, 97270102, 593221065, 645567301, 144859661, 775500760, 759811013, 292823701, 332248910, 124771537, 972787629, 638909369, 278380896, 170199561, 628381488, 923954877, 849562324, 924987600, 341765076, 665243624, 619781817, 871407612, 895181067, 150404282, 954865788, 488955991, 356165993, 898798302, 110927181, 646767030, 182454193, 800780021, 965824091, 640597826, 264469272, 37504824, 799618475, 523354912, 146926535, 120806538, 624224960, 535878449, 551324502, 673448381, 705450531, 234011672, 882171498, 466694777, 711746632, 747005335, 165476350, 118714747, 636241889, 709602352, 482550331, 176078811, 590781481, 356174582, 644246516, 65078580, 786810925, 819313435, 129105070, 395935332, 790209347, 475305234, 926212160, 515470275, 927674602, 555353306, 119218784, 631466298, 595823719, 280218827, 67370855, 303386114, 391153221, 203779404, 246686879, 883992445, 981360850, 910542680, 67750873, 824568732, 467146269, 964842667, 762194758, 383637427, 98742072, 178483706, 59440986, 428707803, 252546104, 926209334, 21543310, 804358989, 87963226, 322188832, 430034099, 258885156, 797697651, 523092948, 475298539, 428738284, 11327608, 965621934, 523802759, 97480537, 559938585, 757376462, 468611695, 209927164, 621696521, 966530963, 338932325, 978434291, 175847137, 798010732, 461911263, 820883336, 992047866, 785440894, 818414607, 518833532, 729901137, 401657143, 134669556, 716971916, 639710792, 882272160, 378563920, 960015269, 552134774, 817213981, 172695419, 933476010, 828721858, 891248425, 447507490, 827140634, 205176045, 817576495, 129625625, 267337670, 640223363, 976484621, 438823203, 619321331, 72549610, 563909637, 786090074, 233195485, 282000408, 822322257, 732540837, 659018171, 730364098, 69161511, 91717990, 238678976, 394295957, 408525576, 792912910, 394302841, 711807371, 726774141, 995973354, 237343843, 391742131, 543839995, 574111282, 136772395, 659005921, 771122534, 607750377, 470683899, 636734664, 801184593, 812789400, 337626212, 224809214, 935934136, 823163420, 564452442, 962713789, 82269552, 468932607, 490172046, 687089529, 768277733, 336222352, 427957023, 581867042, 757160651, 937259497, 339476642, 638978097, 389212742, 477714383, 694932052, 588399211, 737894147, 83766649, 675409010, 615763214, 200459126, 870833028, 180777826, 269294076, 623017566, 286538156, 88124552, 682000641, 689606726, 918429007, 563507307, 873360562, 970133147, 980833321, 218496061, 414966033, 628801581, 833695725, 334323273, 945888523, 96260890, 808835191, 546305749, 17410437, 788505257, 117235238, 980535199, 696066423, 802063758, 46654191, 656288667, 117760215, 606837132, 779041380, 269256744, 934474781, 58302571, 973486974, 385093945, 402417524, 353733278, 715338240, 393165821, 541938705, 887722138, 510676130, 22887649, 191130572, 583585556, 285126289, 794508926, 629355353, 810812298, 11138788, 885751157, 801020720, 155832600, 443562373, 677529647, 532819221, 538057234, 861345991, 278129691, 235240013, 630224203, 513436010, 41969914, 315320771, 112512865, 304735790, 462299628, 263724880, 539359109, 367295235, 708352639, 273514634, 292527186, 203352191, 329958072, 225281078, 271286045, 573983549, 529222715, 854419519, 632234599, 936439778, 181344828, 400901962, 464266790, 614572029, 541551645, 803775030, 168433586, 740852788, 275654154, 275709948, 695707145, 156940333, 411434841, 483548197, 710535555, 622302255, 403099577, 584468017, 747258874, 488244736, 210779744, 905582486, 902066596, 957582593, 411206343, 483571625, 803543211, 976948901, 799259730, 394720218, 537391355, 622004441, 466512392, 503256717, 350264162, 911689384, 403108804, 378743139, 840456167, 473622153, 998034594, 70642958, 837682978, 361492462, 562960588, 47544889, 660059853, 487618158, 860826481, 834046500, 260848227, 761441833, 698060210, 268971753, 195993798, 214106622, 41265063, 469323422, 564150184, 741927954, 950007368, 361233027, 379803151, 74715037, 860741914, 127576419, 96862192, 195047536, 875876455, 353190304, 108672899, 81263957, 252308829, 757925787, 905099541, 716311184, 180654650, 333247786, 133236849, 789372981, 218976532, 949975655, 973893372, 780744998, 630033851, 451914471, 619790591, 139958015, 812559603, 860597950, 561283947, 66386643, 142168667, 615867857, 459105367, 904528454, 474073767, 550928997, 947534173, 149723272, 215416051, 691878341, 869753212, 399446378, 803375998, 965065721, 518866187, 201033706, 804449084, 858397460, 816850849, 951111453, 260747319, 142501296, 636115045, 280712431, 847034914, 156744459, 466665120, 56548829, 65680009, 695889090, 497804508, 523001131, 144216652, 88592160, 701619079, 377250083, 317451008, 194387734, 786221043, 207034718, 449503942, 549807191, 573890799, 138403017, 436558917, 591187498, 742753156, 877161889, 853326616, 818748336, 243753942, 131648694, 695225315, 129388228, 238418217, 648916129, 419435637, 67152945, 859353274, 309051543, 775819598, 554320869, 672329985, 629708486, 337555732, 85291431, 846566179, 56195921, 790708680, 916723429, 97062059, 404617193, 642713490, 978839672, 160427061, 464787674, 232658480, 140758624, 158426935, 306087777, 60146592, 739143149, 590691270, 480228944, 751021659, 183912288, 231405247, 761274058, 793156786, 339742941, 144346777, 887474383, 7355448, 765568771, 516666124, 803677562, 468765587, 916858179, 877528256, 419961677, 871611111, 123818806, 106897460, 198208616, 278659738, 576064081, 860207641, 495889609, 233892033, 401133501, 48266857, 48621606, 819794935, 792396372, 846567053, 654052331, 164582094, 817104977, 982569902, 633496245, 221390154, 843550784, 280055238, 281641297, 19023741, 211860725, 476861067, 353283503, 171924066, 12404874, 699392211, 817897657, 368046748, 666490894, 432304656, 213751827, 38221437, 156730461, 591421321, 560695259, 463158087, 506259472, 748014837, 336744332, 522850752, 853149834, 685924528, 50043174, 104374614, 776567583, 758410071, 132636843, 22783718, 400844101, 140951446, 498703700, 294201046, 195511629, 399145996, 265054378, 945241686, 880285229, 911002299, 558992962, 529948612, 985215175, 830710462, 775977662, 319184503, 753939465, 404439086, 737018999, 459536186, 82659815, 444203013, 657965787, 500255983, 539456806, 949840014, 331261442, 874770277, 69955892, 647940019, 731884343, 49686299, 144676304, 212716247, 794011141, 31236451, 589124411, 308478090, 533680125, 269175743, 1178750, 1461502, 957633006, 263694179, 805047960, 140021926, 287320034, 580524028, 886732852, 339603541, 978799317, 327334915, 182276857, 382253882, 335262465, 94828135, 902394678, 586384312, 251922363, 989222351, 119746409, 738020062, 241157582, 324131931, 943252307, 321626638, 410078825, 560767279, 311505875, 303153744, 670975663, 604064725, 711826981, 354427925, 100926691, 554748580, 753289254, 658003199, 526561583, 826109612, 482470102, 744130143, 595583840, 440224354, 33775172, 474609376, 862235902, 876351312, 801271143, 327575355, 288324896, 425787099, 941855052, 878748572, 652999311, 593926808, 323139753, 448866799, 761537768, 224788685, 564199740, 419950081, 138835325, 157162448, 918518463, 229781043, 162752546, 803985988, 36237700, 734801304, 943846762, 438254587, 650448003, 525091525, 703308020, 716237083, 672012293, 674350759, 76036496, 682901298, 226949829, 83558187, 452351953, 158815624, 504378526, 127514973, 906239825, 296394950, 19804473, 499630603, 956177746, 361234844, 248049773, 853700339, 485273656, 572333161, 291650424, 986117348, 463429370, 21203090, 339728783, 97564928, 237265248, 723808022, 748312590, 439550973, 55086048, 422234095, 516245775, 470201486, 833021621, 769068429, 630981441, 282387912, 656384006, 715639298, 906030725, 744589867, 425974272, 902457237, 652064056, 685928545, 538809869, 306003586, 902399949, 433349986, 365349227, 229465474, 570735010, 823956184, 207950081, 311098833, 282392534, 582014532, 668383264, 881999692, 433746032, 877343632, 859141793, 420520441, 934110487, 473949242, 646311718, 641467593, 325412904, 556643167, 757313170, 887773099, 373897157, 571608955, 394183179, 383029922, 831123899, 836157353, 122621507, 539259358, 180320576, 124219203, 670195088, 330374454, 330988348, 633952682, 187622880, 588375571, 594121601, 575448812, 49141022, 742917666, 577995615, 583814950, 600228498, 193744677, 604098053, 682915731, 625212201, 632937454, 502418584, 915332122, 115719042, 406749840, 280372534, 755044979, 319211009, 507384162, 296458390, 548147486, 249587698, 11836626, 25741671, 614543254, 471008564, 262507615, 235439497, 400588424, 828009396, 693282611, 629501143, 321920214, 175447744, 169740896, 322798049, 366247436, 842974619, 225178254, 473960048, 161312326, 867188547, 323196539, 604369303, 741656654, 187293173, 349234625, 577419728, 343232255, 243655869, 942638882, 594242091, 819468675, 28591772, 371584345, 81493995, 449559149, 576397975, 647576431, 139213469, 745109557, 202164493, 468746338, 496537915, 559944679, 191915494, 695282728, 277292042, 495947018, 641632755, 111497866, 263113405, 60826313, 577486286, 65246205, 156492408, 635473964, 559274791, 198229013, 423700390, 319353632, 366742291, 375383783, 870496329, 513843707, 326194231, 595738336, 773645857, 949405460, 860143850, 223896466, 902000944, 915537214, 641516217, 761377407, 194618847, 583494828, 128287219, 269409489, 654286347, 725175099, 389801571, 758828617, 164645813, 643686935, 624658648, 52575635, 973836399, 334185325, 101197129, 998719476, 568203797, 255637013, 717374115, 148088087, 994281088, 321497519, 580599870, 581340896, 502657196, 894834642, 286241267, 330527681, 944611010, 45047166, 603757743, 279920384, 173122333, 861599666, 762652681, 611880298, 829369331, 654691655, 874061435, 812171670, 762390787, 840972353, 200470598, 690109045, 357005864, 842683990, 696589229, 59541454, 614377729, 278275377, 384289648, 705968155, 305538789, 47934553, 950013145, 244492197, 252057714, 680560438, 685938568, 624166911, 217740838, 47278883, 930834901, 48851288, 460540927, 200822142, 827023229, 268859553, 640204474, 711196768, 333368062, 167503464, 656513964, 203634541, 488114969, 523119815, 191274317, 319331326, 21784920, 282447495, 37956495, 883632266, 521853859, 93178470, 326611905, 636394420, 413541517, 595699362, 536650623, 981921683, 356639116, 807233372, 645429209, 732500109, 868754682, 876290443, 437209008, 982352473, 804157149, 643628342, 899998635, 147931676, 141013527, 30444891, 831337751, 116241967, 583470112, 365550547, 352011543, 882772328, 485673721, 769633562, 228716613, 791779909, 296576623, 570698294, 161343662, 945706227, 910664298, 185871486, 313035872, 676006652, 850218993, 644419057, 301234523, 108527500, 265903438, 623086072, 639268535, 121489258, 696407503, 836425962, 635879149, 626893905, 439856257, 489197050, 577978659, 840334831, 245368825, 186251767, 69672784, 150057178, 210649992, 530374697, 849445731, 560212686, 804087514, 982790640, 547219182, 244204727, 270543947, 996766190, 834847921, 336526959, 422953445, 882194985, 226702683, 659167416, 813663031, 824750068, 472819178, 891930829, 620557260, 750329860, 516740580, 207609471, 450809564, 721470651, 184233427, 678505237, 449943848, 335575504, 265162202, 995408933, 579784500, 956703704, 602166613, 531933391, 130936607, 283623012, 39277062, 448366875, 59802673, 461986506, 625514081, 623399654, 762005744, 39675701, 667556033, 574189318, 17210625, 310108991, 989898502, 871869387, 989859631, 339161179, 388560578, 87905648, 298033092, 312361025, 805672973, 140810100, 894733112, 114270777, 292092244, 136784015, 532296915, 429072566, 827341044, 572283409, 527529427, 501069020, 158578686, 632464359, 685413722, 31535858, 668632987, 939829588, 569307653, 779475876, 811543771, 751289678, 518984201, 487023369, 488239212, 156533746, 846850481, 336775451, 695252617, 591588201, 836744840, 82875182, 379060315, 93234497, 925125863, 491899257, 70845007, 677259069, 563183140, 93402510, 654492866, 374887786, 783518810, 761261934, 576213361, 94481817, 517473087, 60541279, 812121480, 287554445, 841788832, 863830519, 619801960, 324371589, 206449474, 181061176, 591325562, 480634613, 85461687, 36117475, 748652612, 44734773, 133213883, 355620225, 454877956, 228191243, 409653629, 482978729, 119144207, 470088667, 177675395, 429833274, 123239539, 138838396, 248936871, 961302342, 30543171, 119269577, 481307040, 25839074, 351793734, 882279911, 347107057, 709605152, 754463858, 160685079, 289006372, 245692922, 811575906, 318080152, 37400343, 209224042, 964099891, 642527923, 957773983, 306688568, 351500170, 950944003, 749488824, 228917626, 442812589, 462546347, 818938142, 721927314, 246502694, 819047375, 533354231, 301804181, 155246761, 920990516, 398024301, 216247914, 185603586, 827755661, 132504547, 937097757, 159686896, 680201237, 489958849, 291247491, 605639390, 640712222, 624543937, 784617275, 78106260, 530249799, 573272665, 945274654, 929148479, 257760751, 404211526, 588056426, 121853785, 191284067, 20203606, 432769195, 904243497, 172250364, 197907593, 503246808, 405161796, 465384113, 657604492, 500273698, 18114348, 429530952, 43348543, 594700827, 226402418, 598310414, 512639075, 916330543, 984223477, 368618946, 359594479, 839786349, 421593141, 250147236, 529388695, 3550398, 842239962, 162161302, 447505625, 641456342, 792298733, 59612153, 152689952, 43551000, 274412964, 734725216, 60803514, 291740484, 983037869, 1311716, 450866934, 500281188, 981388781, 362569883, 367687476, 210463946, 31672911, 891000854, 701327821, 43663151, 471278789, 382289343, 523118106, 722461445, 583745832, 244786919, 796993687, 992033994, 112262111, 566744895, 824724357, 202696142, 697822234, 12764784, 346997762, 833129814, 787268594, 313535022, 99515101, 822477159, 668412387, 980894945, 849224786, 586866586, 597748541, 889523095, 607630218, 697868188, 842517598, 326473743, 869907983, 157686167, 781535684, 621203308, 600804641, 388024154, 796892388, 402222681, 614217751, 155093037, 581385882, 174603588, 717169520, 205642535, 586303315, 678740453, 428464059, 446245349, 933206239, 875491673, 682281731, 686252214, 232865348, 388595414, 766396521, 922532465, 191701854, 227927997, 360921459, 704250559, 456876037, 773444029, 383774679, 465722716, 160618902, 68600481, 40663849, 487778753, 832771726, 2633569, 355057638, 765774506, 56304033, 475966017, 508738407, 1166700, 920667150, 459758754, 95889623, 45688073, 843709184, 31050986, 836864964, 477178992, 333834646, 361313826, 696147208, 108306645, 692447914, 882216026, 446969737, 858772375, 416431544, 662977172, 881885302, 727297678, 98351451, 208692862, 837840014, 662783024, 458103202, 785528643, 212081005, 777939524, 947725060, 907766036, 322768732, 898912503, 277294436, 515409636, 632614375, 512114558, 752134983, 949642223, 705117151, 853851090, 742709285, 507469717, 434532748, 180052, 924612691, 70644757, 344138341, 138450043, 473646803, 20513509, 849737487, 525041828, 659788778, 721819179, 586125901, 821176124, 315025188, 138715635, 385342297, 819672377, 698177748, 47645272, 603555243, 170766371, 129547867, 291664176, 105726656, 169986169, 796846466, 778436450, 246153283, 214010804, 640353684, 999687936, 822832579, 869719149, 142793254, 740802080, 301025868, 530531016, 263503425, 896134515, 529884461, 319308821, 415710338, 936759717, 147805512, 33826834, 458515835, 302178300, 658962478, 268806969, 240454631, 352765263, 212175277, 753692670, 822502636, 132197363, 874545414, 579838682, 593129312, 164112662, 254625423, 843092934, 801619573, 946388189, 3596568, 538974994, 651359120, 872890956, 420448975, 303482060, 57242847, 514150474, 544789707, 168300513, 214259496, 673730347, 967542088, 379496204, 42945519, 395760268, 813918295, 335876073, 497801287, 646239999, 803865989, 901073627, 791406554, 244330478, 487746010, 447170004, 386551640, 838891740, 544766261, 226629213, 872186745, 932261977, 334424560, 201122084, 656323143, 873348042, 269987830, 91644718, 831471622, 464128561, 192331895, 671459075, 375783329, 688168588, 262421728, 709406516, 959847674, 726327804, 511264255, 41035399, 692504374, 275390575, 337671249, 113018216, 113180362, 172440826, 549235825, 944737029, 875164427, 933196399, 145138837, 274494926, 374517159, 272239745, 681113477, 841298381, 96719922, 605493561, 842637349, 468463264, 223371941, 145779732, 621237833, 817115860, 280521783, 670916090, 62779831, 162186617, 540662698, 465231245, 118732405, 725150874, 265342426, 492614658, 195246452, 868948560, 326217878, 30120209, 921755601, 267646300, 940895520, 250313648, 842267782, 688914872, 636659134, 406461880, 270291025, 819346506, 6775093, 485133474, 324365371, 408282623, 812623555, 859208784, 293250026, 98151864, 925268341, 918213101, 100090356, 55961186, 418816900, 753495549, 886594826, 421914696, 251725894, 326236021, 218291838, 91393947, 71933385, 786501313, 518240112, 450061161, 598592462, 711802289, 342915369, 594108618, 387402445, 308786020, 674791912, 332682590, 36809873, 274582534, 837151186, 184710866, 15967339, 629403717, 87966841, 444472370, 229074038, 46165552, 859723523, 735397400, 790056707, 550092544, 616387449, 601914095, 420093728, 999877784, 518114179, 586172965, 86929212, 327828681, 772529624, 441432296, 975543639, 859985407, 306078227, 401356795, 719702145, 792042541, 910411007, 995819256, 511326436, 56959075, 481231003, 158632156, 556434001, 435633362, 518847211, 188121729, 874953534, 5245616, 358865627, 941160105, 525982817, 307737821, 677139331, 620423843, 810741954, 534982263, 896628207, 545020618, 807446919, 783872387, 571988477, 920989942, 733037908, 156877485, 798974495, 380168081, 498713695, 102842576, 452417792, 139699834, 605030718, 220414067, 225036942, 956751179, 273663287, 926959201, 5671483, 426905995, 975075985, 797254696, 774972346, 171460980, 612254081, 657842918, 47618676, 709991740, 234168149, 456952050, 306536017, 600969034, 651518524, 167484435, 202503886, 911783775, 788840383, 644943333, 696631250, 558805048, 69865320, 803773277, 348630797, 168142925, 886486656, 438378225, 599083541, 456816581, 935098094, 493659378, 367292705, 1232245, 606451861, 792015328, 37537007, 105647226, 384738726, 992288064, 912227187, 874686392, 269803473, 842767156, 401296861, 967979335, 50202221, 730611407, 277011142, 440355006, 198178319, 906391954, 271377245, 979969848, 671352140, 838606563, 496318039, 765522032, 529372283, 209706909, 881113368, 554301445, 287153235, 853708705, 777500324, 431682823, 169951855, 96873812, 550448445, 645192688, 691170218, 478738719, 384581000, 847155047, 845263280, 477517958, 702932354, 945480292, 237847576, 777300714, 409159808, 873662373, 442064594, 409523810, 680820046, 633123026, 76604599, 552711621, 99511163, 819826875, 412655362, 518054614, 108873956, 264000122, 620392371, 825984322, 87019144, 660892253, 416648453, 914551651, 93439787, 546399336, 519861118, 671931819, 548005044, 422525703, 137634184, 212805312, 869824349, 866157754, 235816911, 446877404, 724147776, 957251692, 36888532, 277361976, 13703309, 804946204, 111472087, 188029241, 670158597, 467892649, 707099434, 953715809, 678442180, 828612636, 696143850, 862461018, 238548793, 64988052, 984526006, 449965788, 352025977, 458148713, 416975659, 850099020, 601320047, 123383130, 62834090, 78549220, 98579267, 59683850, 177929115, 16134918, 531036895, 856739881, 418395242, 950816507, 514232505, 977543466, 698846688, 130232695, 634460497, 766232430, 905962747, 634134799, 993401029, 251572998, 676486573, 654489732, 981380828, 47815241, 586601800, 20042899, 364638559, 154935407, 74060250, 270344602, 998521085, 963056464, 140790065, 843393435, 993295826, 871535267, 534772430, 98334372, 528495158, 294906382, 792645256, 309016123, 401864545, 235297029, 472750212, 996424010, 105341760, 420412184, 945571270, 779295380, 106556293, 103355753, 36230143, 181468769, 475321275, 183231147, 994898920, 331651276, 499985564, 207503846, 736148214, 611354962, 354928909, 991185503, 787448632, 823324736, 746083534, 819465161, 187532304, 432583396, 421167840, 879802773, 367208103, 540832694, 59136142, 956778591, 672044035, 880806707, 180233300, 385234332, 584806418, 953200890, 368339596, 411665993, 258108479, 373198053, 411031644, 872829449, 486642891, 2225594, 651216637, 216200232, 375536013, 344321887, 307697391, 434230854, 875380565, 837997241, 582892501, 5861281, 172160251, 19937778, 236149098, 28800795, 555081169, 329835072, 996050319, 789999878, 161020328, 539109259, 901529879, 590492958, 462779846, 906680399, 813158064, 947754104, 531145040, 624789154, 617682534, 155712091, 129337766, 149701592, 56650903, 784040531, 915483581, 623910704, 731506141, 391856092, 487171875, 92063875, 482209578, 357026910, 880294192, 747170733, 141407073, 881944086, 771904391, 533497178, 689499078, 593718566, 234144388, 963852220, 587372808, 398492831, 292131535, 646054685, 543299512, 258922278, 411848740, 917431603, 534178942, 944989636, 60982709, 153089973, 80295751, 130903635, 490185648, 366790761, 429843510, 64085106, 778903410, 781071717, 521286653, 757896559, 684337527, 532624635, 426787858, 293248259, 801880487, 378047990, 127996895, 717928101, 430612897, 103269544, 553384892, 901753373, 833899513, 863114644, 871028760, 117532800, 323447996, 117586713, 546992450, 611725986, 555737156, 964930133, 332924962, 524669778, 889935840, 898329785, 504747628, 500202599, 967320952, 780303143, 602744582, 108383141, 564665841, 231806541, 906091243, 593500914, 9219371, 404742053, 532241381, 412789539, 692959627, 404727219, 913855035, 977296766, 169497134, 127366359, 482982783, 769150939, 980820760, 478878381, 885117851, 172901064, 842437752, 572079074, 586575138, 207538904, 565863658, 338346702, 468351194, 242884698, 865946528, 865163156, 805811711, 372494334, 192139281, 943066073, 855092827, 609833251, 325969593, 198236605, 125209890, 451762084, 586267128, 233072657, 258280054, 113800915, 893434140, 108762223, 812851409, 633242015, 920448830, 170036844, 378219952, 510576250, 427160986, 292480736, 209465994, 796547027, 457835582, 531560456, 713907160, 333576540, 444866688, 242645128, 192482369, 109251370, 964773378, 111865844, 320812754, 100517957, 384918094, 143527722, 713068761, 22598183, 374967073, 799522713, 743155113, 259330669, 716801288, 769882662, 554425144, 563901400, 905911188, 864970670, 586073534, 389919068, 455328168, 420042212, 89329569, 614041725, 529154931, 911568272, 684124692, 35861969, 286675533, 526172708, 547234350, 373906704, 69034834, 158626168, 245153447, 448602753, 677768859, 881316941, 806536268, 44659730, 996592481, 565239374, 815923052, 919803451, 997828061, 648219685, 938491554, 749598235, 219257523, 227858012, 749769992, 783599982, 884589518, 300067411, 572674833, 376179574, 539483737, 67737458, 746954245, 565241350, 725709930, 258284241, 173027539, 177873064, 469930298, 54148396, 90145094, 839815004, 71896629, 377553215, 511775165, 859870052, 934427222, 844104709, 781665649, 288171231, 341557142, 769731175, 155376533, 289736346, 602644777, 499988094, 482142157, 905765097, 718593617, 919677967, 332349942, 280053085, 938306670, 958630611, 649562435, 830671300, 896072051, 162762783, 552141131, 424863933, 459545739, 66606178, 315292162, 256139658, 756512767, 206821732, 762070138, 606482390, 121810837, 660913399, 129402673, 933492167, 943041391, 788077201, 748330622, 265989911, 568945918, 817213724, 680134040, 83226625, 783111327, 789998755, 256798969, 426431581, 23087136, 180976413, 662538886, 3923227, 58926973, 876719809, 398700228, 104863177, 323999651, 531784783, 683491905, 51484472, 641541658, 432645242, 659022974, 579710324, 60865282, 341615178, 208915242, 699327442, 465600427, 247474658, 993815399, 343743464, 6548210, 3529874, 473658657, 403971918, 792212683, 910757416, 143300380, 791869596, 205618069, 747461584, 833281283, 777295920, 879660914, 830983721, 267886116, 420302138, 7167532, 65734033, 364965042, 895916440, 455185945, 723685816, 704588859, 289553801, 817198376, 361925995, 824499280, 780160863, 821402442, 636768070, 388392168, 685786718, 151759730, 327074411, 131321076, 157450803, 559054984, 313833371, 514245903, 121786188, 850720440, 2433945, 595370553, 483457449, 156224269, 424429879, 354338464, 986873091, 418595769, 596801355, 205515431, 687126830, 485740876, 307132889, 197038091, 372246142, 468621936, 137642318, 102819588, 703986556, 109014100, 710681929, 668120664, 987440443, 162389784, 982494261, 551067739, 422152441, 959497683, 394437930, 995025745, 127311714, 506307202, 129588099, 802684890, 701532157, 791020442, 20842068, 482025054, 35892130, 328604191, 339084115, 966216753, 796196264, 785343007, 223029061, 414583231, 523157608, 914520468, 608227254, 300039679, 755197673, 501662030, 195835363, 810040514, 623160582, 342410148, 219592898, 10358260, 227034517, 21611961, 43003706, 996268507, 252755805, 826913063, 533398942, 730096612, 615570581, 234601472, 294599143, 79199785, 147475685, 787464723, 263862821, 398554850, 545241422, 380986324, 680179859, 592136120, 608373575, 110246921, 778116089, 310296955, 762001485, 451646209, 139991283, 553728233, 44350891, 947401732, 276372022, 103337128, 997495587, 11976413, 76254517, 724296611, 410627640, 318008847, 425621433, 221550610, 638391760, 487761231, 445075121, 773320485, 587658077, 821762056, 587294858, 406692267, 287039278, 691553557, 653184465, 119570830, 941818398, 496127501, 18538357, 623610233, 24069549, 373087986, 668498655, 848621488, 101885328, 453781003, 18019489, 294185505, 713869682, 977172836, 907631531, 970298342, 168691919, 388272420, 799425250, 974169388, 294324646, 53005175, 329170381, 623786157, 324319036, 876771345, 369451495, 269694154, 400242685, 815302420, 293992773, 272822761, 471661089, 45848278, 541588497, 288424467, 963934844, 232603134, 898466110, 36007870, 704440929, 407363557, 811648626, 827820387, 731808565, 750934586, 485217590, 422790141, 729484465, 360856738, 3059306, 368101936, 120838999, 36678591, 592207169, 776390431, 819769689, 677958023, 761236548, 7977825, 475072399, 128518217, 46820800, 315968517, 887823605, 257615535, 44266461, 286900128, 539018505, 393019227, 50859974, 175540764, 226515631, 603321800, 433225139, 988863672, 688246765, 960411637, 822531363, 231615757, 119131685, 355879366, 251249285, 576290565, 477705138, 607617927, 585972435, 177943269, 583143427, 774534766, 868986368, 722056172, 889522541, 438862517, 600148340, 94689233, 142772181, 514620055, 595557543, 435512676, 36440987, 749250782, 602363754, 164276830, 584180568, 709528094, 990216699, 669522557, 238496508, 78949740, 301729352, 230413467, 959879981, 325230669, 550670209, 865128003, 546737162, 499235749, 777308647, 300346240, 500890858, 282170346, 488865405, 248791409, 334147287, 708388350, 816453285, 176114429, 957939063, 886047768, 708963144, 697977374, 704971232, 918025685, 632120122, 887531271, 206613128, 380832883, 706547402, 734619578, 378996759, 825975760, 494617547, 427347432, 659804776, 386773363, 52304702, 56924900, 310212051, 586691326, 90908552, 122390863, 716251656, 942248484, 682415058, 737074528, 436318097, 767305627, 819021923, 397877645, 363636954, 866056078, 479246540, 646928330, 592177953, 131864218, 707805721, 588661130, 819649589, 692117001, 644337523, 726171866, 575372698, 285579003, 563857792, 545663267, 305770135, 269299931, 43250086, 953969848, 383335298, 225568858, 813939478, 696767501, 439847794, 476097217, 895749299, 305320750, 104033263, 578392145, 113766013, 953740400, 872775389, 271840925, 623336895, 592115780, 851162017, 582768715, 341022716, 198703208, 177080762, 381955353, 30430394, 833266985, 723965441, 864032355, 944277486, 748385678, 509012418, 593693896, 335329096, 350631997, 569487549, 267443673, 833703097, 168296111, 795026893, 53475082, 209743814, 215050414, 314719065, 570500925, 610798556, 548014586, 93219050, 429735006, 907937966, 937839127, 297954056, 628331297, 801802585, 930528779, 826281378, 680190339, 960733802, 427535202, 20740255, 382981666, 486105223, 838351314, 212100613, 188528009, 211294762, 128019468, 907977594, 10205221, 250757692, 533958963, 356284943, 933489330, 473547811, 895551926, 387173515, 108015703, 183586968, 19446759, 196913431, 482787458, 747269219, 37899043, 90700746, 184220044, 433428930, 419779650, 700461814, 375816557, 636982812, 56327803, 771275194, 414396165, 392666456, 830820859, 630977952, 913261644, 654782456, 851203558, 172849301, 199175644, 158712322, 202973249, 228958858, 639335656, 933651652, 694498898, 931852394, 940598537, 661107129, 313457555, 548316638, 651038241, 156256065, 454065506, 646271223, 660430208, 944512758, 997836610, 807588258, 861770194, 631032200, 198767246, 149612733, 946007698, 332125353, 767160056, 256725611, 61915975, 796523526, 6461577, 888532238, 682840214, 989254528, 529007925, 871500558, 972311554, 49136173, 940966952, 609881654, 346058363, 258601583, 822705382, 555619968, 546495208, 33355632, 582158518, 376094423, 377314877, 109012397, 562625298, 460675835, 72848863, 40175791, 500986535, 605668884, 328914416, 679186061, 787332209, 966259518, 874952833, 907768858, 548995440, 910852962, 216373601, 741069045, 842835493, 669237279, 268927126, 620207641, 496485599, 405590386, 260835794, 93381747, 28069217, 230151615, 925376271, 946197680, 49519012, 760051398, 185733717, 750686951, 934176884, 999690003, 737620331, 336994517, 880193083, 115067519, 387151027, 71933570, 915430219, 690019207, 70415381, 84430381, 618510196, 341258986, 759839554, 448521996, 146685527, 543712436, 352763876, 93107738, 825085744, 894186729, 686951667, 971024177, 508711332, 926126173, 970500519, 221978322, 870385137, 934250717, 739401950, 363083566, 43378335, 453042975, 847720290, 125879658, 745171024, 82104732, 683403978, 373561365, 340085436, 962297864, 935576511, 185489514, 99739329, 977232798, 430526400, 565570301, 461509967, 300107580, 798317091, 570463834, 359349925, 989743110, 497096487, 331995104, 754339462, 614050726, 869316332, 77064807, 764157035, 810422477, 164784290, 896246113, 650915167, 388737822, 702314708, 964609734, 209685027, 189971786, 324616996, 106540882, 608830818, 119563576, 3058914, 308836524, 278081051, 576172772, 251887389, 713418859, 349490038, 720379091, 365105188, 775159137, 152588694, 100912429, 832849921, 507885523, 737697148, 725994404, 744328532, 198906889, 480578480, 54805002, 54474587, 919906015, 265051738, 462280777, 810550510, 804357584, 603824122, 655421135, 968270273, 696764835, 601397497, 986710172, 137934441, 730296669, 181876371, 195284852, 156587911, 280151811, 79668537, 618758786, 912255998, 36763440, 468918542, 261842521, 124742670, 402181587, 956307800, 359302215, 224687918, 618757581, 409588132, 457357683, 652276564, 82641982, 3000029, 940376792, 750137092, 319384231, 475481080, 834055693, 164416300, 601000540, 50424970, 333721078, 354848138, 765407464, 882498361, 403648102, 836079123, 248038824, 351275683, 294884371, 609519174, 952334941, 536694766, 130453658, 687970810, 306131845, 855571363, 529868521, 865671170, 749044693, 716672811, 923884347, 546151229, 867313129, 353889640, 364975371, 306622369, 468733099, 642473829, 914125240, 412097603, 292154597, 950687500, 843237528, 791025913, 516221152, 199933385, 961029432, 308014700, 397820273, 115997954, 533956215, 560114662, 96508152, 5657528, 965570091, 560103363, 471910206, 90381073, 993960455, 344158979, 423462656, 498536712, 216795332, 4788407, 502795944, 769754181, 406454389, 731645472, 520806212, 696301111, 185796972, 690052977, 75044155, 600813974, 806497114, 732227888, 378416075, 133744649, 136396823, 586052600, 57296287, 479039736, 744997979, 855597174, 86667473, 938405734, 677472929, 556784569, 998181506, 149194723, 676607822, 272597146, 130301873, 554428409, 732689840, 20874904, 908283204, 722489186, 841665236, 376145436, 929535614, 363832905, 337319497, 625944178, 70758268, 951903862, 551344434, 810462249, 536468603, 219503118, 687169808, 929574489, 808101058, 359486553, 347225643, 576930946, 417360386, 3329032, 197693666, 975162746, 801714206, 895794803, 886270285, 66369355, 435382822, 205933435, 106138794, 808619969, 676033730, 176796226, 722283829, 161063191, 383174325, 200158330, 186008006, 247435890, 668610562, 845328954, 217211323, 451985424, 666497651, 293995987, 511506481, 348377533, 47582578, 157815818, 41103456, 60000092, 695443282, 93800930, 784839550, 968145173, 752837652, 466189147, 35554215, 362917443, 551733399, 639175762, 369141514, 469459025, 733529711, 540366352, 846075197, 108123819, 402057496, 791121975, 673122780, 765959199, 119874001, 317238847, 877248235, 105673171, 789353252, 572656305, 967624498, 492153789, 65887084, 219919253, 776534108, 390692757, 196433474, 978342517, 35069065, 291353487, 599911979, 676946446, 312032250, 447463174, 241512195, 890378606, 53777113, 185858508, 985091242, 665725801, 90670500, 840049223, 220783907, 17799964, 212554815, 814765489, 923606375, 503829867, 422846930, 419597683, 541334861, 138816727, 678920213, 16168517, 892631744, 337980182, 450691114, 810998497, 955955638, 927578939, 768290526, 401284843, 314003245, 158101178, 991720754, 683732062, 214303153, 184766129, 222302705, 778113421, 504354270, 162637291, 530710674, 362262307, 2811227, 516679778, 361436582, 523992068, 457519531, 54740508, 909096148, 967440652, 665324618, 888764591, 876946744, 593106900, 891056000, 929801901, 57758754, 267471814, 43873246, 992740082, 26772310, 643786251, 883390177, 797945328, 65252516, 469078816, 527220000, 201720227, 460210846, 158289008, 59245903, 692324063, 925710201, 459606499, 606580397, 825597607, 824971214, 201517398, 960610461, 907056275, 329879060, 812571337, 387508805, 991193196, 725418735, 606527342, 987943992, 49050524, 356556895, 771219714, 418499614, 871783994, 118389254, 275338430, 466006625, 369862772, 203833368, 14917929, 517127402, 455312181, 572398452, 446101184, 716265411, 855927469, 871359111, 140369135, 437100015, 484276304, 449477358, 525372459, 309115248, 326277795, 200269228, 838113260, 840976052, 746405029, 16862725, 244606888, 851679845, 138677504, 828914179, 560422196, 320942742, 183913669, 928794993, 813603445, 762030432, 525683804, 309698327, 784779396, 34930254, 38658947, 10532888, 479215749, 569047154, 190876422, 181148058, 161501724, 115666163, 665675032, 877942480, 995932315, 116621881, 273362134, 291234249, 262095098, 674764553, 484405473, 828616584, 189193455, 290047178, 229388324, 463136059, 243595123, 741268707, 978943108, 473866544, 953889606, 621381682, 913182612, 284711891, 605228304, 264465044, 662466665, 127754639, 882528438, 568090482, 973284017, 205351333, 280529046, 887860832, 738853831, 690079520, 294994340, 593686044, 31614554, 47956520, 487648986, 480908507, 183228239, 347576595, 128124270, 792925712, 7158718, 351916494, 366954372, 490133813, 329079626, 992837333, 716721800, 92561043, 72861809, 865693480, 443406576, 572478109, 739883009, 740775384, 661080773, 703180555, 341679433, 515858621, 978352891, 480071698, 508297069, 529652227, 746684292, 268442032, 17041056, 18149147, 687895777, 955887455, 766479705, 490146579, 645783608, 30300672, 201844195, 692631914, 589990283, 284781791, 773150348, 529208618, 97282823, 912843566, 189329436, 756282046, 490400174, 226641219, 653069797, 746597682, 694267620, 844880489, 365159711, 171116257, 751576250, 171245715, 774554815, 876348962, 72679, 550625494, 112647398, 480766880, 131795033, 203730735, 133151145, 911000868, 175853718, 915669304, 138661461, 452864047, 520929322, 392888914, 747299979, 622592554, 758709846, 301106092, 899503065, 566677368, 75366924, 711105319, 741204122, 699275276, 726402394, 882320213, 307687771, 676058177, 877243591, 189056754, 205933950, 875168003, 725607634, 975934046, 244758754, 682495709, 5545997, 205042174, 386621049, 652799295, 930637125, 594018854, 110627697, 243894831, 680287391, 598264048, 601088940, 925041594, 767028491, 478194261, 689016228, 591386459, 978267456, 291197508, 962496188, 699207052, 566502831, 326772939, 758834882, 32744888, 519293618, 620000224, 127912367, 584090246, 798003011, 680376153, 115576611, 655464422, 805752499, 874299241, 793646546, 983050504, 470407199, 665687598, 845365695, 675258725, 893328504, 544855772, 941363551, 591235690, 750342949, 227344141, 657069598, 229537726, 596511890, 812829831, 18593149, 878206561, 78858138, 81852260, 385322041, 449677685, 324659787, 87460357, 216240448, 686223360, 529299231, 900891317, 971537431, 171719009, 333573854, 759776731, 556673911, 980060872, 480289478, 992517097, 637425330, 927043462, 359308972, 198226729, 150150203, 717078614, 869889309, 372445613, 963090584, 887152663, 523665476, 396429886, 180966881, 138343946, 125228861, 975930048, 537747175, 151830395, 895644995, 374147006, 30179012, 112442473, 438060220, 348787293, 659020304, 217474080, 272084072, 778679954, 92132532, 220558153, 225194975, 884517919, 209759140, 229702360, 884899658, 936679721, 901097174, 687690273, 684753724, 442961424, 388472872, 72257155, 289517989, 356082114, 602719494, 105857575, 820490502, 663490136, 959644718, 805616097, 594014096, 745474639, 81893404, 126379358, 667338088, 697970197, 653312497, 132406261, 734736602, 198516421, 302338237, 195954723, 670411472, 716295487, 176369790, 323400315, 236806827, 356519813}, + 14861, + }, + + // 可以有多个 testcase +} + +func Test_subarrayBitwiseORs(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, subarrayBitwiseORs(tc.A), "输入:%v", tc) + } +} + +func Benchmark_subarrayBitwiseORs(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + subarrayBitwiseORs(tc.A) + } + } +} diff --git a/Algorithms/0899.orderly-queue/README.md b/Algorithms/0899.orderly-queue/README.md new file mode 100755 index 000000000..7e86f2c88 --- /dev/null +++ b/Algorithms/0899.orderly-queue/README.md @@ -0,0 +1,38 @@ +# [899. Orderly Queue](https://leetcode.com/problems/orderly-queue/) + +## 题目 + +A string `S` of lowercase letters is given. Then, we may make any number of moves. + +In each move, we choose one of the first `K` letters (starting from the left), remove it,`and place it at the end of the string. + +Return the lexicographically smallest string we could have after any number of moves. + +Example 1: + +```text +Input: S = "cba", K = 1 +Output: "acb" +Explanation: +In the first move, we move the 1st character ("c") to the end, obtaining the string "bac". +In the second move, we move the 1st character ("b") to the end, obtaining the final result "acb". +``` + +Example 2: + +```text +Input: S = "baaca", K = 3 +Output: "aaabc" +Explanation: +In the first move, we move the 1st character ("b") to the end, obtaining the string "aacab". +In the second move, we move the 3rd character ("c") to the end, obtaining the final result "aaabc". +``` + +Note: + +- `1 <= K <= S.length<= 1000` +- `S`consists of lowercase letters only. + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0899.orderly-queue/orderly-queue.go b/Algorithms/0899.orderly-queue/orderly-queue.go new file mode 100755 index 000000000..3faef2042 --- /dev/null +++ b/Algorithms/0899.orderly-queue/orderly-queue.go @@ -0,0 +1,42 @@ +package problem0899 + +import ( + "sort" +) + +func orderlyQueue(s string, k int) string { + if k == 1 { + return minRotated(s) + } + // 当 k >=2 时 + // 前两个位置上的字母,总是把较小的字母移到末尾 + // 经过 len(s)-1 次比较后,s 中最大的字母,一定在前两个位置中, + // 此时,把 s 中最大的字母移到末尾。 + // 以此类推,可以形成一个冒泡排序。 + // 所以,当 k >= 2 时,可以直接对 s 进行排序 + // 当 k = 1 时,无法进行比较 + // 就只能通过回转 s 来查看最小的字符串了 + return sorted(s) +} + +func minRotated(s string) string { + min := s + bytes := []byte(s) + bytes = append(bytes, bytes...) + size := len(s) + for i := 1; i < size; i++ { + rs := string(bytes[i : i+size]) + if min > rs { + min = rs + } + } + return min +} + +func sorted(s string) string { + bytes := []byte(s) + sort.Slice(bytes, func(i int, j int) bool { + return bytes[i] < bytes[j] + }) + return string(bytes) +} diff --git a/Algorithms/0899.orderly-queue/orderly-queue_test.go b/Algorithms/0899.orderly-queue/orderly-queue_test.go new file mode 100755 index 000000000..62c01e244 --- /dev/null +++ b/Algorithms/0899.orderly-queue/orderly-queue_test.go @@ -0,0 +1,59 @@ +package problem0899 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + K int + ans string +}{ + + { + "cba", + 1, + "acb", + }, + + { + "edcba", + 5, + "abcde", + }, + + { + "dasfkasdlkfasdlkjflaksdjflksdajflkasdjflksdajflkasdjflkasdj", + 3, + "aaaaaaaaadddddddddffffffffjjjjjjjkkkkkkkkkllllllllsssssssss", + }, + + { + "baaca", + 3, + "aaabc", + }, + + // 可以有多个 testcase +} + +func Test_orderlyQueue(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, orderlyQueue(tc.S, tc.K), "输入:%v", tc) + } +} + +func Benchmark_orderlyQueue(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + orderlyQueue(tc.S, tc.K) + } + } +} diff --git a/Algorithms/0900.rle-iterator/README.md b/Algorithms/0900.rle-iterator/README.md new file mode 100755 index 000000000..f32e93efa --- /dev/null +++ b/Algorithms/0900.rle-iterator/README.md @@ -0,0 +1,39 @@ +# [900. RLE Iterator](https://leetcode.com/problems/rle-iterator/) + +## 题目 + +Write an iterator that iterates through a run-length encoded sequence. + +The iterator is initialized by `RLEIterator(int[] A)`, where `A` is a run-length encoding of some `sequence.` More specifically, for all even `i, A[i]` tells us the number of times that the non-negative integer value `A[i+1]` is repeated in the sequence. + +The iterator supports one function:`next(int n)`, which exhausts the next `n` elements (`n >= 1`) and returns the last element exhausted in this way. If there is no element left to exhaust, `next` returns `-1` instead. + +For example, we start with `A = [3,8,0,9,2,5]`, which is a run-length encoding of the sequence `[8,8,8,5,5]`. This is because the sequence can be read as "three eights, zero nines, two fives". + +Example 1: + +```text +Input: ["RLEIterator","next","next","next","next"], [[[3,8,0,9,2,5]],[2],[1],[1],[2]] +Output: [null,8,8,5,-1] +Explanation: +RLEIterator is initialized with RLEIterator([3,8,0,9,2,5]). +This maps to the sequence [8,8,8,5,5]. +RLEIterator.next is then called 4 times: + +.next(2) exhausts 2 terms of the sequence, returning 8. The remaining sequence is now [8, 5, 5]. + +.next(1) exhausts 1 term of the sequence, returning 8. The remaining sequence is now [5, 5]. + +.next(1) exhausts 1 term of the sequence, returning 5. The remaining sequence is now [5]. + +.next(2) exhausts 2 terms, returning -1. This is because the first term exhausted was 5, +but the second term did not exist. Since the last term exhausted does not exist, we return -1. +``` + +Note: + +- 0 <= A.length <= 1000 +- A.length`is an even integer. +- 0 <= A[i] <= 10^9 +- There are at most 1000 calls to `RLEIterator.next(int n)` per test case. +- Each call to `RLEIterator.next(int n)` will have 1 <= n <= 10^9. diff --git a/Algorithms/0900.rle-iterator/rle-iterator.go b/Algorithms/0900.rle-iterator/rle-iterator.go new file mode 100755 index 000000000..3f4fefa99 --- /dev/null +++ b/Algorithms/0900.rle-iterator/rle-iterator.go @@ -0,0 +1,50 @@ +package problem0900 + +// RLEIterator object will be instantiated and called as such: +// obj := Constructor(A); +// param_1 := obj.Next(n); +type RLEIterator struct { + es []entry +} + +type entry struct { + count, number int +} + +// Constructor is +func Constructor(a []int) RLEIterator { + size := len(a) + es := make([]entry, 0, size/2) + for i := 0; i+1 < size; i += 2 { + if a[i] == 0 { + continue + } + es = append(es, entry{ + count: a[i], + number: a[i+1], + }) + } + return RLEIterator{ + es: es, + } +} + +// Next is +func (r *RLEIterator) Next(n int) int { + var prev entry + for len(r.es) > 0 && r.es[0].count <= n { + n -= r.es[0].count + prev, r.es = r.es[0], r.es[1:] + } + + if len(r.es) == 0 && n > 0 { + return -1 + } + + if n == 0 { + return prev.number + } + + r.es[0].count -= n + return r.es[0].number +} diff --git a/Algorithms/0900.rle-iterator/rle-iterator_test.go b/Algorithms/0900.rle-iterator/rle-iterator_test.go new file mode 100755 index 000000000..7fadf095e --- /dev/null +++ b/Algorithms/0900.rle-iterator/rle-iterator_test.go @@ -0,0 +1,24 @@ +package problem0900 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_RLEIterator(t *testing.T) { + ast := assert.New(t) + + ints := []int{3, 8, 0, 9, 2, 5} + + r := Constructor(ints) + + nums := []int{2, 1, 1, 2} + expecteds := []int{8, 8, 5, -1} + + for i, n := range nums { + expected := expecteds[i] + actual := r.Next(n) + ast.Equal(expected, actual) + } +} diff --git a/Algorithms/0901.online-stock-span/README.md b/Algorithms/0901.online-stock-span/README.md new file mode 100755 index 000000000..d75d74d69 --- /dev/null +++ b/Algorithms/0901.online-stock-span/README.md @@ -0,0 +1,35 @@ +# [901. Online Stock Span](https://leetcode.com/problems/online-stock-span/) + +## 题目 + +Write a class `StockSpanner` which collects daily price quotes for some stock, and returns the span of that stock's price for the current day. + +The span of the stock's price today is defined as the maximum number of consecutive days (starting from today and going backwards) for which the price of the stock was less than or equal to today's price. + +For example, if the price of a stock over the next 7 days were `[100, 80, 60, 70, 60, 75, 85]`, then the stock spans would be `[1, 1, 1, 2, 1, 4, 6]`. + +Example 1: + +```text +Input: ["StockSpanner","next","next","next","next","next","next","next"], [[],[100],[80],[60],[70],[60],[75],[85]] +Output: [null,1,1,1,2,1,4,6] +Explanation: +First, S = StockSpanner() is initialized. Then: +S.next(100) is called and returns 1, +S.next(80) is called and returns 1, +S.next(60) is called and returns 1, +S.next(70) is called and returns 2, +S.next(60) is called and returns 1, +S.next(75) is called and returns 4, +S.next(85) is called and returns 6. + +Note that (for example) S.next(75) returned 4, because the last 4 prices +(including today's price of 75) were less than or equal to today's price. +``` + +Note: + +- Calls to StockSpanner.next(int price) will have 1 <= price <= 10^5. +- There will be at most 10000 calls to StockSpanner.next per test case. +- There will be at most 150000 calls to StockSpanner.next across all test cases. +- The total time limit for this problem has been reduced by 75% for C++, and 50% for all other languages. \ No newline at end of file diff --git a/Algorithms/0901.online-stock-span/online-stock-span.go b/Algorithms/0901.online-stock-span/online-stock-span.go new file mode 100755 index 000000000..f2d040aaf --- /dev/null +++ b/Algorithms/0901.online-stock-span/online-stock-span.go @@ -0,0 +1,43 @@ +package problem0901 + +// StockSpanner object will be instantiated and called as such: +// obj := Constructor(); +// param_1 := obj.Next(price); +type StockSpanner struct { + prices []int // stack + days []int // stack +} + +// Constructor is +func Constructor() StockSpanner { + ps := make([]int, 1, 10000) + ds := make([]int, 1, 10000) + ps[0] = 1<<63 - 1 // more than max-price + ds[0] = -1 // the day before first-day + return StockSpanner{ + prices: ps, + days: ds, + } +} + +// Next is +func (s *StockSpanner) Next(price int) int { + i := len(s.prices) - 1 + // s.prices[i] 中保存了昨天的 price + // s.days[i] 中保存了昨天的 日期 + today := s.days[i] + 1 + + for i >= 0 { + if s.prices[i] > price { + // 深入 s.prices 栈,直到找到比 price 大的价格 + break + } + i-- + } + + res := today - s.days[i] + i++ + s.prices = append(s.prices[:i], price) + s.days = append(s.days[:i], today) + return res +} diff --git a/Algorithms/0901.online-stock-span/online-stock-span_test.go b/Algorithms/0901.online-stock-span/online-stock-span_test.go new file mode 100755 index 000000000..2b6c16ac5 --- /dev/null +++ b/Algorithms/0901.online-stock-span/online-stock-span_test.go @@ -0,0 +1,35 @@ +package problem0901 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_StockSpanner(t *testing.T) { + ast := assert.New(t) + // + nexts := []int{100, 80, 60, 70, 60, 75, 85} + expecteds := []int{1, 1, 1, 2, 1, 4, 6} + // + s := Constructor() + for i, n := range nexts { + expected := expecteds[i] + actual := s.Next(n) + ast.Equal(expected, actual) + } +} + +func Test_StockSpanner_2(t *testing.T) { + ast := assert.New(t) + // + nexts := []int{29, 91, 62, 76, 51} + expecteds := []int{1, 2, 1, 2, 1} + // + s := Constructor() + for i, n := range nexts { + expected := expecteds[i] + actual := s.Next(n) + ast.Equal(expected, actual) + } +} diff --git a/Algorithms/0902.numbers-at-most-n-given-digit-set/README.md b/Algorithms/0902.numbers-at-most-n-given-digit-set/README.md new file mode 100755 index 000000000..2e51d266a --- /dev/null +++ b/Algorithms/0902.numbers-at-most-n-given-digit-set/README.md @@ -0,0 +1,36 @@ +# [902. Numbers At Most N Given Digit Set](https://leetcode.com/problems/numbers-at-most-n-given-digit-set/) + +## 题目 + +We have a sorted set of digits `D`, a non-empty subset of `{'1','2','3','4','5','6','7','8','9'}.` (Note that '0' is not included.) + +Now, we write numbers using these digits, using each digit as many times as we want. For example, if `D = {'1','3','5'}`, we may write numbers such as `'13', '551', '1351315'`. + +Return the number of positive integers that can be written (using the digits of `D`) that are less than or equal to `N`. + +Example 1: + +```text +Input: D = ["1","3","5","7"], N = 100 +Output: 20 +Explanation: +The 20 numbers that can be written are: +1, 3, 5, 7, 11, 13, 15, 17, 31, 33, 35, 37, 51, 53, 55, 57, 71, 73, 75, 77. +``` + +Example 2: + +```text +Input: D = ["1","4","9"], N = 1000000000 +Output: 29523 +Explanation: +We can write 3 one digit numbers, 9 two digit numbers, 27 three digit numbers, +81 four digit numbers, 243 five digit numbers, 729 six digit numbers, +2187 seven digit numbers, 6561 eight digit numbers, and 19683 nine digit numbers. +In total, this is 29523 integers that can be written using the digits of D. +``` + +Note: + +- `D` is a subset of digits `'1'-'9'` in sorted order. +- `1 <= N <= 10^9` diff --git a/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set.go b/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set.go new file mode 100755 index 000000000..af854fe8c --- /dev/null +++ b/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set.go @@ -0,0 +1,57 @@ +package problem0902 + +import ( + "strconv" +) + +func atMostNGivenDigitSet(D []string, N int) int { + ns := strconv.Itoa(N) + size := len(D) + res := zeroLead(size, len(ns)) + return res + equal(D, ns) +} + +// 从 N 的高位往低位防止 D 中的数字,分为 3 种情况 +// 1. 可以选择不放置数字,但是一旦放置了,后续低位就不能不放置了,这一类数的特点是以 0 开头,其个数使用 zeroLead 函数计算。 +// 2. 比 N 对应位上的数字小,其后续低位可以任意放置 D 中的数字,其个数使用 less 函数计算。 +// 3. 与 N 对应位上的数字一样大,其后续低位上的数字需要分情况讨论,这一类数的个数,使用 equal 函数,递归计算。 + +func equal(D []string, ns string) int { + if len(ns) == 0 { + return 1 + } + size := len(D) + res := 0 + head := ns[0:1] + for _, d := range D { + switch { + case d < head: + res += less(size, len(ns)) + case d == head: + res += equal(D, ns[1:]) + } + } + return res +} + +// size 个数,组合成低于 length 位的数字的组合数 +func zeroLead(size, length int) int { + p := size + res := 0 + for length > 1 { + res += p + p *= size + length-- + } + return res +} + +// size 个数,组成 length-1 位数字的组合数 +func less(size, length int) int { + res := 1 + for length > 1 { + res *= size + length-- + } + return res +} diff --git a/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set_test.go b/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set_test.go new file mode 100755 index 000000000..dfb92f87b --- /dev/null +++ b/Algorithms/0902.numbers-at-most-n-given-digit-set/numbers-at-most-n-given-digit-set_test.go @@ -0,0 +1,128 @@ +package problem0902 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + D []string + N int + ans int +}{ + + { + []string{"9"}, + 55, + 1, + }, + + { + []string{"7"}, + 8, + 1, + }, + + { + []string{"1", "3", "5", "7"}, + 1357, + 112, + }, + + { + []string{"1", "3", "5", "7"}, + 200, + 36, + }, + + { + []string{"1", "3", "5", "7"}, + 100, + 20, + }, + + { + []string{"1", "4", "9"}, + 1000000000, + 29523, + }, + + // 可以有多个 testcase +} + +func Test_atMostNGivenDigitSet(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, atMostNGivenDigitSet(tc.D, tc.N), "输入:%v", tc) + } +} + +func Benchmark_atMostNGivenDigitSet(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + atMostNGivenDigitSet(tc.D, tc.N) + } + } +} + +func Test_zeroLead(t *testing.T) { + type args struct { + size int + length int + } + tests := []struct { + name string + args args + want int + }{ + + { + "4 个数字,组成最多 2 位数的组合数", + args{ + 4, + 3, + }, + 20, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := zeroLead(tt.args.size, tt.args.length); got != tt.want { + t.Errorf("empty() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_less(t *testing.T) { + type args struct { + size int + length int + } + tests := []struct { + name string + args args + want int + }{ + { + "4 个不同的数,组合 5 位数的组合数", + args{ + 4, + 6, // 5+1 + }, + 1024, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := less(tt.args.size, tt.args.length); got != tt.want { + t.Errorf("less() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/Algorithms/0903.valid-permutations-for-di-sequence/README.md b/Algorithms/0903.valid-permutations-for-di-sequence/README.md new file mode 100755 index 000000000..207be7c80 --- /dev/null +++ b/Algorithms/0903.valid-permutations-for-di-sequence/README.md @@ -0,0 +1,29 @@ +# [903. Valid Permutations for DI Sequence](https://leetcode.com/problems/valid-permutations-for-di-sequence/) + +We are given `S`, a length `n` string of characters from the set `{'D', 'I'}`. (These letters stand for "decreasing" and "increasing".) + +A *valid permutation* is a permutation `P[0], P[1], ..., P[n]` of integers `{0, 1, ..., n}`, such that for all i: + +- If `S[i] == 'D'`, then `P[i] > P[i+1]`, and; +- If `S[i] == 'I'`, then `P[i] < P[i+1]`. + +How many valid permutations are there?  Since the answer may be large, **return your answer modulo** `10^9 + 7`. + +Example 1: + +```text +Input: "DID" +Output: 5 +Explanation: +The 5 valid permutations of (0, 1, 2, 3) are: +(1, 0, 3, 2) +(2, 0, 3, 1) +(2, 1, 3, 0) +(3, 0, 2, 1) +(3, 1, 2, 0) +``` + +Note: + +- `1 <= S.length <= 200` +- `S` consists only of characters from the set `{'D', 'I'}`. diff --git a/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence.go b/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence.go new file mode 100755 index 000000000..f6e5e6106 --- /dev/null +++ b/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence.go @@ -0,0 +1,32 @@ +package problem0903 + +const mod = 1e9 + 7 + +// ref: https://leetcode.com/problems/valid-permutations-for-di-sequence/discuss/168278/C++JavaPython-DP-Solution-O(N2) +func numPermsDISequence(S string) int { + n := len(S) + + dp := [201][201]int{} + + for j := 0; j <= n; j++ { + dp[0][j] = 1 + } + + for i := 0; i < n; i++ { + count := 0 + if S[i] == 'I' { + for j := 0; j < n-i; j++ { + count += dp[i][j] + dp[i+1][j] = count % mod + + } + } else { + for j := n - i - 1; j >= 0; j-- { + count += dp[i][j+1] + dp[i+1][j] = count % mod + } + } + } + + return dp[n][0] +} diff --git a/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence_test.go b/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence_test.go new file mode 100755 index 000000000..e1e609211 --- /dev/null +++ b/Algorithms/0903.valid-permutations-for-di-sequence/valid-permutations-for-di-sequence_test.go @@ -0,0 +1,44 @@ +package problem0903 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "DID", + 5, + }, + + { + "DIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDDDIDD", + 795732224, + }, + + // 可以有多个 testcase +} + +func Test_numPermsDISequence(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, numPermsDISequence(tc.S), "输入:%v", tc) + } +} + +func Benchmark_numPermsDISequence(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numPermsDISequence(tc.S) + } + } +} diff --git a/Algorithms/0904.fruit-into-baskets/README.md b/Algorithms/0904.fruit-into-baskets/README.md new file mode 100755 index 000000000..c7cbe0c7c --- /dev/null +++ b/Algorithms/0904.fruit-into-baskets/README.md @@ -0,0 +1,54 @@ +# [904. Fruit Into Baskets](https://leetcode.com/problems/fruit-into-baskets/) + +In a row of trees, the `i`-th tree produces fruit with type`tree[i]`. + +You **start at any tree of your choice**, then repeatedly perform the following steps: + +1. Add one piece of fruit from this tree to your baskets.` If you cannot, stop. +1. Move to the next tree to the right of the current tree.` If there is no tree to the right, stop. + +Note that you do not have any choice after the initial choice of starting tree:`you must perform step 1, then step 2, then back to step 1, then step 2, and so on until you stop. + +You have two baskets, and each basket can carry any quantity of fruit, but you want each basket to only carry one type of fruit each. + +What is the total amount of fruit you can collect with this procedure? + +Example 1: + +```text +Input: [1,2,1] +Output: 3 +Explanation: We can collect [1,2,1]. +``` + +Example 2: + +```text +Input: [0,1,2,2] +Output: 3 +Explanation: We can collect [1,2,2]. +If we started at the first tree, we would only collect [0, 1]. +``` + +Example 3: + +```text +Input: [1,2,3,2,2] +Output: 4 +Explanation: We can collect [2,3,2,2]. +If we started at the first tree, we would only collect [1, 2]. +``` + +Example 4: + +```text +Input: [3,3,3,1,2,1,1,2,3,3,4] +Output: 5 +Explanation: We can collect [1,2,1,1,2]. +If we started at the first tree or the eighth tree, we would only collect 4 fruits. +``` + +Note: + +- `1 <= tree.length <= 40000` +- `0 <= tree[i] < tree.length` diff --git a/Algorithms/0904.fruit-into-baskets/fruit-into-baskets.go b/Algorithms/0904.fruit-into-baskets/fruit-into-baskets.go new file mode 100755 index 000000000..17a34727d --- /dev/null +++ b/Algorithms/0904.fruit-into-baskets/fruit-into-baskets.go @@ -0,0 +1,40 @@ +package problem0904 + +// 找到最长的 tree 的子数组,要求最多只能含有两种数字 +func totalFruit(trees []int) int { + // 子数组 "252555" 中, tail 是尾部的 "555" + // tailType 是 “5” + // tailCount 是 3 + tailType, theOther := -1, -1 + tailCount, count := 0, 0 // 子数组尾部相同类型水果的长度,子数组的长度 + res := 0 + + for _, t := range trees { + count++ + if t != tailType && t != theOther { + // t 是新的类型 + // 原先的子数组的 tail 加上 t 组成新的子数组 + count = tailCount + 1 + } + + res = max(res, count) + + tailCount++ + if t != tailType { + // t 成为新的 tail,需要更新 tailType 和 tailCount + theOther, tailType = tailType, t + tailCount = 1 + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// ref: https://leetcode.com/problems/fruit-into-baskets/discuss/170745/Problem:-Longest-Subarray-With-2-Elements diff --git a/Algorithms/0904.fruit-into-baskets/fruit-into-baskets_test.go b/Algorithms/0904.fruit-into-baskets/fruit-into-baskets_test.go new file mode 100755 index 000000000..85656d694 --- /dev/null +++ b/Algorithms/0904.fruit-into-baskets/fruit-into-baskets_test.go @@ -0,0 +1,59 @@ +package problem0904 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + tree []int + ans int +}{ + + { + []int{0}, + 1, + }, + + { + []int{1, 2, 1}, + 3, + }, + + { + []int{0, 1, 2, 2}, + 3, + }, + + { + []int{1, 2, 3, 2, 2}, + 4, + }, + + { + []int{3, 3, 3, 1, 2, 1, 1, 2, 3, 3, 4}, + 5, + }, + + // 可以有多个 testcase +} + +func Test_totalFruit(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, totalFruit(tc.tree), "输入:%v", tc) + } +} + +func Benchmark_totalFruit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + totalFruit(tc.tree) + } + } +} diff --git a/Algorithms/0905.sort-array-by-parity/README.md b/Algorithms/0905.sort-array-by-parity/README.md new file mode 100755 index 000000000..ee2ce9771 --- /dev/null +++ b/Algorithms/0905.sort-array-by-parity/README.md @@ -0,0 +1,24 @@ +# [905. Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity/) + +## 题目 + +Given an array `A` of non-negative integers, return an array consisting of all the even elements of `A`, followed by all the odd elements of `A`. + +You may return any answer array that satisfies this condition. + +Example 1: + +```text +Input: [3,1,2,4] +Output: [2,4,3,1] +The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted. +``` + +Note: + +- 1 <= A.length <= 5000 +- 0 <= A[i] <= 5000 + +## 解题思路 + +见程序注释 diff --git a/Algorithms/0905.sort-array-by-parity/sort-array-by-parity.go b/Algorithms/0905.sort-array-by-parity/sort-array-by-parity.go new file mode 100755 index 000000000..3aa2a2943 --- /dev/null +++ b/Algorithms/0905.sort-array-by-parity/sort-array-by-parity.go @@ -0,0 +1,21 @@ +package problem0905 + +func sortArrayByParity(a []int) []int { + i, j := 0, len(a)-1 + for { + for i < j && a[i]%2 == 0 { + i++ + } + for i < j && a[j]%2 == 1 { + j-- + } + + if i < j { + a[i], a[j] = a[j], a[i] + } else { + break + } + + } + return a +} diff --git a/Algorithms/0905.sort-array-by-parity/sort-array-by-parity_test.go b/Algorithms/0905.sort-array-by-parity/sort-array-by-parity_test.go new file mode 100755 index 000000000..d224ea716 --- /dev/null +++ b/Algorithms/0905.sort-array-by-parity/sort-array-by-parity_test.go @@ -0,0 +1,69 @@ +package problem0905 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int +}{ + + { + []int{3, 1, 2, 4}, + }, + + // 可以有多个 testcase +} + +func split(a []int) (evens, odds []int) { + size := len(a) + var i int + for i = 0; i < size; i++ { + if a[i]%2 == 1 { + break + } + } + return a[:i], a[i:] +} + +func isAllEven(a []int) bool { + for _, n := range a { + if n%2 == 1 { + return false + } + } + return true +} + +func isAllOdd(a []int) bool { + for _, n := range a { + if n%2 == 0 { + return false + } + } + return true +} + +func Test_sortArrayByParity(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ans := sortArrayByParity(tc.A) + evens, odds := split(ans) + ast.True(isAllEven(evens)) + ast.True(isAllOdd(odds)) + } +} + +func Benchmark_sortArrayByParity(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sortArrayByParity(tc.A) + } + } +} diff --git a/Algorithms/0906.super-palindromes/README.md b/Algorithms/0906.super-palindromes/README.md new file mode 100755 index 000000000..a635d3e8c --- /dev/null +++ b/Algorithms/0906.super-palindromes/README.md @@ -0,0 +1,21 @@ +# [906. Super Palindromes](https://leetcode.com/problems/super-palindromes/) + +Let's say a positive integer is a *superpalindrome* if it is a palindrome, and it is also the square of a palindrome. + +Now, given two positive integers `L` and `R` (represented as strings), return the number of *superpalindromes* in the inclusive range `[L, R]`. + +Example 1: + +```text +Input: L = "4", R = "1000" +Output: 4 +Explanation: 4, 9, 121, and 484 are *superpalindromes*. +Note that 676 is not a *superpalindrome*: 26 * 26 = 676, but 26 is not a palindrome. +``` + +Note: + +1. `1 <= len(L) <= 18` +1. `1 <= len(R) <= 18` +1. `L` and `R` are strings representing integers in the range `[1, 10^18)`. +1. `int(L) <= int(R)` \ No newline at end of file diff --git a/Algorithms/0906.super-palindromes/super-palindromes.go b/Algorithms/0906.super-palindromes/super-palindromes.go new file mode 100755 index 000000000..f0ba7ed74 --- /dev/null +++ b/Algorithms/0906.super-palindromes/super-palindromes.go @@ -0,0 +1,39 @@ +package problem0906 + +import ( + "sort" + "strconv" +) + +// square root of all superpalindrome +// 以下这些数的特点是,各个位上的所有数字的平方和,不超过 9 +// 才能保证自身平方后,还是回文。 +// 例如, 212 是 2*2 + 1*1 + 2*2 = 9 没有超过 9 +// 212*212 = 44944 还是回文。 +// 在题目规定的范围内,符合条件的数字,只有以下 70 个,干脆就都列举出来好了 +var palindromes = []int{ + 1, 2, 3, + 11, 22, + 101, 111, 121, 202, 212, + 1001, 1111, 2002, + 10001, 10101, 10201, 11011, 11111, 11211, 20002, 20102, + 100001, 101101, 110011, 111111, 200002, + 1000001, 1001001, 1002001, 1010101, 1011101, 1012101, 1100011, 1101011, 1102011, 1110111, 1111111, 2000002, 2001002, + 10000001, 10011001, 10100101, 10111101, 11000011, 11011011, 11100111, 11111111, 20000002, + 100000001, 100010001, 100020001, 100101001, 100111001, 100121001, 101000101, 101010101, 101020101, 101101101, 101111101, 110000011, 110010011, 110020011, 110101011, 110111011, 111000111, 111010111, 111101111, 111111111, 200000002, 200010002, +} + +func superpalindromesInRange(L, R string) int { + l, _ := strconv.Atoi(L) + r, _ := strconv.Atoi(R) + + li := sort.Search(len(palindromes), func(i int) bool { + return l <= palindromes[i]*palindromes[i] + }) + + ri := sort.Search(len(palindromes), func(i int) bool { + return r <= palindromes[i]*palindromes[i] + }) + + return ri - li +} diff --git a/Algorithms/0906.super-palindromes/super-palindromes_test.go b/Algorithms/0906.super-palindromes/super-palindromes_test.go new file mode 100755 index 000000000..689c9895f --- /dev/null +++ b/Algorithms/0906.super-palindromes/super-palindromes_test.go @@ -0,0 +1,58 @@ +package problem0906 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + L, R string + ans int +}{ + + { + "1020762146323", + "142246798855636", + 17, + }, + + { + "398904669", + "13479046850", + 6, + }, + + { + "1", + "2", + 1, + }, + + { + "4", + "1000", + 4, + }, + + // 可以有多个 testcase +} + +func Test_superpalindromesInRange(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, superpalindromesInRange(tc.L, tc.R), "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + superpalindromesInRange(tc.L, tc.R) + } + } +} diff --git a/Algorithms/0907.sum-of-subarray-minimums/README.md b/Algorithms/0907.sum-of-subarray-minimums/README.md new file mode 100755 index 000000000..08eb923b8 --- /dev/null +++ b/Algorithms/0907.sum-of-subarray-minimums/README.md @@ -0,0 +1,19 @@ +# [907. Sum of Subarray Minimums](https://leetcode.com/problems/sum-of-subarray-minimums/) + +Given an array of integers `A`, find the sum of `min(B)`, where `B` ranges over every (contiguous) subarray of `A`. + +Since the answer may be large, return the answer modulo `10^9 + 7`. + +Example 1: + +```text +Input: [3,1,2,4] +Output: 17 +Explanation: Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4]. +Minimums are 3, 1, 2, 4, 1, 1, 2, 1, 1, 1. Sum is 17. +``` + +Note: + +- `1 <= A.length <= 30000` +- `1 <= A[i] <= 30000` \ No newline at end of file diff --git a/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums.go b/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums.go new file mode 100755 index 000000000..44d4b73f9 --- /dev/null +++ b/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums.go @@ -0,0 +1,65 @@ +package problem0907 + +const modulo = 1e9 + 7 + +// 求解 A 的所有子数组的最小值之和 +func sumSubarrayMins(A []int) int { + minOfA := 1 // 题目规定了 A[i]>=1 + A = append(A, minOfA-1) // 加入低过 A 下限的值,是为了简化代码 + // 以下是没有添加元素时候的代码,可以观察两者的区别 + // https://github.com/aQuaYi/LeetCode-in-Go/blob/6122433cf04f1d9ab0925b3eddf2b6750c1ba3d1/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums.go + + size := len(A) + sum := 0 + s := new(stack) + + for k := 0; k < size; k++ { + for s.len() > 0 && A[s.top()] > A[k] { + j := s.pop() + i := s.top() + sum += (j - i) * (k - j) * A[j] + // 由题意可知, + // 为了找到全部以 A[j] 为最小值的子数组, + // 需要找到这些子数组左右端点的个数 + // anyoneOf(A[i+1:j]) > A[j],但是 A[i] < A[j] + // 所以,A[i+1:j+1] 中的数,都可以做左端点,共有 j-i 个 + // anyoneOf(A[j+1:k]) > A[j],但是 A[j] > A[k] + // 所以,A[j:k] 中的数,都可以做右端点,共有 k-j 个 + // 两边的端点可以任意组合,所以是乘法关系 + // (j-i) * (k-j) 是所有以 A[j] 为最小值的子数组的个数 + } + s.push(k) + } + + return sum % modulo +} + +// stack 用于存放 A 中元素的 index +// 并且越往上的 index, A[index] 越大 +type stack []int + +func (s *stack) top() int { + size := len(*s) + if size == 0 { + // 按照上面的分析, A[i+1:j] 中的元素都可以做左端点 + // 当 size=0 且调用 top 的时候, A[0:j] 中的元素都可以做左端点 + // 所以, i+1=0 → i=-1 + // 需要返回 -1 + return -1 + } + return (*s)[size-1] +} + +func (s *stack) push(index int) { + *s = append(*s, index) +} + +func (s *stack) pop() (index int) { + size := len(*s) + *s, index = (*s)[:size-1], (*s)[size-1] + return +} + +func (s *stack) len() int { + return len(*s) +} diff --git a/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums_test.go b/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums_test.go new file mode 100755 index 000000000..ab6ede676 --- /dev/null +++ b/Algorithms/0907.sum-of-subarray-minimums/sum-of-subarray-minimums_test.go @@ -0,0 +1,44 @@ +package problem0907 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{48, 87, 27}, + 264, + }, + + { + []int{3, 1, 2, 4}, + 17, + }, + + // 可以有多个 testcase +} + +func Test_sumSubarrayMins(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, sumSubarrayMins(tc.A), "输入:%v", tc) + } +} + +func Benchmark_sumSubarrayMins(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sumSubarrayMins(tc.A) + } + } +} diff --git a/Algorithms/0908.smallest-range-i/README.md b/Algorithms/0908.smallest-range-i/README.md new file mode 100755 index 000000000..2571dc36f --- /dev/null +++ b/Algorithms/0908.smallest-range-i/README.md @@ -0,0 +1,39 @@ +# [908. Smallest Range I](https://leetcode.com/problems/smallest-range-i/) + +## 题目 + +Given an array `A` of integers, for each integer `A[i]` we may choose any `x` with `-K <= x <= K`, and add x to `A[i]`. + +After this process, we have some array `B`. + +Return the smallest possible difference between the maximum value of `B`and the minimum value of `B`. + +Example 1: + +```text +Input: A = [1], K = 0 +Output: 0 +Explanation: B = [1] +``` + +Example 2: + +```text +Input: A = [0,10], K = 2 +Output: 6 +Explanation: B = [2,8] +``` + +Example 3: + +```text +Input: A = [1,3,6], K = 3 +Output: 0 +Explanation: B = [3,3,3] or B = [4,4,4] +``` + +Note: + +- `1 <= A.length <= 10000` +- `0 <= A[i] <= 10000` +- `0 <= K <= 10000` diff --git a/Algorithms/0908.smallest-range-i/smallest-range-i.go b/Algorithms/0908.smallest-range-i/smallest-range-i.go new file mode 100755 index 000000000..7901145be --- /dev/null +++ b/Algorithms/0908.smallest-range-i/smallest-range-i.go @@ -0,0 +1,18 @@ +package problem0908 + +func smallestRangeI(A []int, K int) int { + min, max := A[0], A[0] + for i := range A { + if A[i] < min { + min = A[i] + } else if max < A[i] { + max = A[i] + } + } + + if min+K >= max-K { + return 0 + } + + return max - min - K*2 +} diff --git a/Algorithms/0908.smallest-range-i/smallest-range-i_test.go b/Algorithms/0908.smallest-range-i/smallest-range-i_test.go new file mode 100755 index 000000000..edd9bd1af --- /dev/null +++ b/Algorithms/0908.smallest-range-i/smallest-range-i_test.go @@ -0,0 +1,59 @@ +package problem0908 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{1}, + 0, + 0, + }, + + { + []int{0, 10}, + 2, + 6, + }, + + { + []int{1, 0, 3, 6}, + 3, + 0, + }, + + { + []int{1, 3, 6}, + 3, + 0, + }, + + // 可以有多个 testcase +} + +func Test_smallestRangeI(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, smallestRangeI(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_smallestRangeI(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestRangeI(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0909.snakes-and-ladders/README.md b/Algorithms/0909.snakes-and-ladders/README.md new file mode 100755 index 000000000..a3d35a791 --- /dev/null +++ b/Algorithms/0909.snakes-and-ladders/README.md @@ -0,0 +1,44 @@ +# [909. Snakes and Ladders](https://leetcode.com/problems/snakes-and-ladders/) + +On an N x N `board`, the numbers from `1` to `N*N` are written *boustrophedonically* **starting from the bottom left of the board**, and alternating direction each row. For example, for a 6 x 6 board, the numbers are written as follows: + +![snakes](snakes.png) + +You start on square `1` of the board (which is always in the last row and first column). Each move, starting from square `x`, consists of the following: + +- You choose a destination square `S` with number `x+1`, `x+2`, `x+3`, `x+4`, `x+5`, or `x+6`, provided this number is `<= N*N`. + - (This choice simulates the result of a standard 6-sided die roll: ie., there are always at most 6 destinations.) +- If `S` has a snake or ladder, you move to the destination of that snake or ladder. Otherwise, you move to `S`. + +A board square on row `r` and column `c` has a "snake or ladder" if `board[r][c] != -1`. The destination of that snake or ladder is `board[r][c]`. + +Note that you only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do **not** continue moving. (For example, if the board is `[[4,-1],[-1,3]]`, and on the first move your destination square is `2`, then you finish your first move at `3`, because you do **not** continue moving to `4`.) + +Return the least number of moves required to reach square `N*N`. If it is not possible, return `-1`. + +Example 1: + +```text +Input: [ +[-1,-1,-1,-1,-1,-1], +[-1,-1,-1,-1,-1,-1], +[-1,-1,-1,-1,-1,-1], +[-1,35,-1,-1,13,-1], +[-1,-1,-1,-1,-1,-1], +[-1,15,-1,-1,-1,-1]] +Output: 4 +Explanation: +At the beginning, you start at square 1 [at row 5, column 0]. +You decide to move to square 2, and must take the ladder to square 15. +You then decide to move to square 17 (row 3, column 5), and must take the snake to square 13. +You then decide to move to square 14, and must take the ladder to square 35. +You then decide to move to square 36, ending the game. +It can be shown that you need at least 4 moves to reach the N*N-th square, so the answer is 4. +``` + +Note: + +- `2 <= board.length = board[0].length <= 20` +- `board[i][j]` is between `1` and `N*N` or is equal to `-1`. +- The board square with number `1` has no snake or ladder. +- The board square with number `N*N` has no snake or ladder. \ No newline at end of file diff --git a/Algorithms/0909.snakes-and-ladders/snakes-and-ladders.go b/Algorithms/0909.snakes-and-ladders/snakes-and-ladders.go new file mode 100755 index 000000000..5c5972419 --- /dev/null +++ b/Algorithms/0909.snakes-and-ladders/snakes-and-ladders.go @@ -0,0 +1,55 @@ +package problem0909 + +func snakesAndLadders(p [][]int) int { + n := len(p) + destination := n * n + + squares := make([]int, 400) + isChecked := [401]bool{} + + squares[0] = 1 + isChecked[1] = true + + steps := 0 + + // BFS + for len(squares) > 0 { + steps++ + size := len(squares) + for j := 0; j < size; j++ { + s := squares[j] + for i := 1; i <= 6; i++ { + si := s + i + x, y := position(si, n) + if p[x][y] != -1 { + // jump + isChecked[si] = true + si = p[x][y] + } + if si == destination { + return steps + } + if !isChecked[si] { + squares = append(squares, si) + isChecked[si] = true + } + } + } + squares = squares[size:] + } + + return -1 +} + +func position(square, n int) (x, y int) { + square-- + // 首先计算正常的位置 + x, y = square/n, square%n + if x%2 == 1 { + // 行号为奇数的行,需要左右翻转 + y = n - 1 - y + } + // 整体上下翻转 + x = n - 1 - x + return +} diff --git a/Algorithms/0909.snakes-and-ladders/snakes-and-ladders_test.go b/Algorithms/0909.snakes-and-ladders/snakes-and-ladders_test.go new file mode 100755 index 000000000..023b3e621 --- /dev/null +++ b/Algorithms/0909.snakes-and-ladders/snakes-and-ladders_test.go @@ -0,0 +1,135 @@ +package problem0909 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]int + ans int +}{ + + { + [][]int{ + {1, 1, -1}, + {1, 1, 1}, + {-1, 1, 1}, + }, + -1, + }, + + { + [][]int{ + {1, -1, -1, -1, 48, 5, -1}, + {12, 29, 13, 9, -1, 2, 32}, + {-1, -1, 21, 7, -1, 12, 49}, + {42, 37, 21, 40, -1, 22, 12}, + {42, -1, 2, -1, -1, -1, 6}, + {39, -1, 35, -1, -1, 39, -1}, + {-1, 36, -1, -1, -1, -1, 5}, + }, + 3, + }, + + { + [][]int{ + {-1, -1, 27, 13, -1, 25, -1}, + {-1, -1, -1, -1, -1, -1, -1}, + {44, -1, 8, -1, -1, 2, -1}, + {-1, 30, -1, -1, -1, -1, -1}, + {3, -1, 20, -1, 46, 6, -1}, + {-1, -1, -1, -1, -1, -1, 29}, + {-1, 29, 21, 33, -1, -1, -1}, + }, + 4, + }, + + { + [][]int{ + {-1, 1, 2, -1}, + {2, 13, 15, -1}, + {-1, 10, -1, -1}, + {-1, 6, 2, 8}, + }, + 2, + }, + + { + [][]int{ + {-1, -1, -1, -1, 162, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, 396, -1, 184, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, 384, -1, -1, -1, -1, -1, 76, -1, -1, -1, 196, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, -1, -1, 152, -1, -1, -1, -1, -1, 40, -1, -1, -1, 30, 159}, + {-1, 86, -1, -1, 25, 307, 280, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, -1, 330, -1}, + {-1, -1, -1, -1, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, 213, 57, 36, -1, 399}, + {-1, -1, -1, -1, -1, -1, -1, -1, 149, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, 366, -1, -1, -1, -1, -1, 140, 247, -1, -1, -1, -1, 396, -1, -1, 347, -1, -1, -1}, + {-1, -1, 73, -1, -1, -1, 120, 178, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1, 22, -1}, + {-1, 394, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, 370, 345, -1}, + {-1, -1, -1, -1, 356, -1, 28, -1, -1, -1, -1, -1, -1, 102, -1, 312, -1, 242, -1, -1}, + {-1, -1, -1, 235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, 81, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, 306, -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, -1, 236, 395}, + {-1, -1, -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, -1, -1, 40, 387, -1, -1, -1, -1}, + {-1, -1, -1, 151, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 222, 230, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 186, -1, -1, -1, -1, -1, 236, -1, -1, -1}, + }, + 6, + }, + + { + [][]int{ + {-1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1}, + {-1, -1, -1, -1, -1, -1}, + {-1, 35, -1, -1, 13, -1}, + {-1, -1, -1, -1, -1, -1}, + {-1, 15, -1, -1, -1, -1}}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_snakesAndLadders(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, snakesAndLadders(tc.board), "输入:%v", tc) + } +} + +func Benchmark_snakesAndLadders(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + snakesAndLadders(tc.board) + } + } +} +func Test_position(t *testing.T) { + ast := assert.New(t) + // + const ( + n = 3 + ) + // + expected := [n][n]int{ + {7, 8, 9}, + {6, 5, 4}, + {1, 2, 3}, + } + actual := [n][n]int{} + for i := 1; i <= 9; i++ { + x, y := position(i, n) + actual[x][y] = i + } + ast.Equal(expected, actual) +} diff --git a/Algorithms/0909.snakes-and-ladders/snakes.png b/Algorithms/0909.snakes-and-ladders/snakes.png new file mode 100644 index 000000000..dde4d8290 Binary files /dev/null and b/Algorithms/0909.snakes-and-ladders/snakes.png differ diff --git a/Algorithms/0910.smallest-range-ii/README.md b/Algorithms/0910.smallest-range-ii/README.md new file mode 100755 index 000000000..ee47c9b03 --- /dev/null +++ b/Algorithms/0910.smallest-range-ii/README.md @@ -0,0 +1,37 @@ +# [910. Smallest Range II](https://leetcode.com/problems/smallest-range-ii/) + +Given an array `A` of integers, for each integer `A[i]` we need to choose **either** `x = -K` **or** `x = K`, and add `x` to `A[i] (only once)`. + +After this process, we have some array `B`. + +Return the smallest possible difference between the maximum value of `B` and the minimum value of `B`. + +Example 1: + +```text +Input: A = [1], K = 0 +Output: 0 +Explanation: `B` = [1] +``` + +Example 2: + +```text +Input: A = [0,10], K = 2 +Output: 6 +Explanation: `B` = [2,8] +``` + +Example 3: + +```text +Input: A = [1,3,6], K = 3 +Output: 3 +Explanation: `B` = [4,6,3] +``` + +Note: + +- `1 <= A.length <= 10000` +- `0 <= A[i] <= 10000` +- `0 <= K <= 10000` \ No newline at end of file diff --git a/Algorithms/0910.smallest-range-ii/smallest-range-ii.go b/Algorithms/0910.smallest-range-ii/smallest-range-ii.go new file mode 100755 index 000000000..701458c53 --- /dev/null +++ b/Algorithms/0910.smallest-range-ii/smallest-range-ii.go @@ -0,0 +1,37 @@ +package problem0910 + +import ( + "sort" +) + +// ref: https://leetcode.com/problems/smallest-range-ii/discuss/173377/C++JavaPython-Add-0-or-2-*-K + +func smallestRangeII(A []int, k int) int { + sort.Ints(A) + + n := len(A) + mx, mn := A[n-1], A[0] + res := mx - mn + + for i := 0; i+1 < n; i++ { + mx = max(mx, A[i]+2*k) + mn = min(A[i+1], A[0]+2*k) + res = min(res, mx-mn) + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0910.smallest-range-ii/smallest-range-ii_test.go b/Algorithms/0910.smallest-range-ii/smallest-range-ii_test.go new file mode 100755 index 000000000..bbe3b5915 --- /dev/null +++ b/Algorithms/0910.smallest-range-ii/smallest-range-ii_test.go @@ -0,0 +1,53 @@ +package problem0910 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + k int + ans int +}{ + + { + []int{1}, + 0, + 0, + }, + + { + []int{0, 10}, + 2, + 6, + }, + + { + []int{1, 3, 6}, + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, smallestRangeII(tc.A, tc.k), "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestRangeII(tc.A, tc.k) + } + } +} diff --git a/Algorithms/0911.online-election/README.md b/Algorithms/0911.online-election/README.md new file mode 100755 index 000000000..c00077691 --- /dev/null +++ b/Algorithms/0911.online-election/README.md @@ -0,0 +1,27 @@ +# [911. Online Election](https://leetcode.com/problems/online-election/) + +In an election, the `i`-th vote was cast for `persons[i]` at time `times[i]`. + +Now, we would like to implement the following query function: `TopVotedCandidate.q(int t)` will return the number of the person that was leading the election at time `t`. + +Votes cast at time `t` will count towards our query. In the case of a tie, the most recent vote (among tied candidates) wins. + +Example 1: + +```text +Input: ["TopVotedCandidate","q","q","q","q","q","q"], [[[0,1,1,0,0,1,0],[0,5,10,15,20,25,30]],[3],[12],[25],[15],[24],[8]] +Output: [null,0,1,1,0,0,1] +Explanation: +At time 3, the votes are [0], and 0 is leading. +At time 12, the votes are [0,1,1], and 1 is leading. +At time 25, the votes are [0,1,1,0,0,1], and 1 is leading (as ties go to the most recent vote.) +This continues for 3 more queries at time 15, 24, and 8. +``` + +Note: + +1. `1 <= persons.length = times.length <= 5000` +1. `0 <= persons[i] <= persons.length` +1. `times` is a strictly increasing array with all elements in `[0, 10^9]`. +1. `TopVotedCandidate.q` is called at most `10000` times per test case. +1. `TopVotedCandidate.q(int t)` is always called with `t >= times[0]`. \ No newline at end of file diff --git a/Algorithms/0911.online-election/online-election.go b/Algorithms/0911.online-election/online-election.go new file mode 100755 index 000000000..e6f39cf46 --- /dev/null +++ b/Algorithms/0911.online-election/online-election.go @@ -0,0 +1,39 @@ +package problem0911 + +import "sort" + +// TopVotedCandidate object will be instantiated and called as such: +// obj := Constructor(persons, times); +// param_1 := obj.Q(t); +type TopVotedCandidate struct { + times []int + leaders []int +} + +// Constructor returns TopVotedCandidate +func Constructor(persons []int, times []int) TopVotedCandidate { + size := len(persons) + + votes := make([]int, size) + leaders := make([]int, size) + + leader := persons[0] + for i := 0; i < size; i++ { + p := persons[i] + votes[p]++ + if votes[p] >= votes[leader] { + leader = p + } + leaders[i] = leader + } + return TopVotedCandidate{times, leaders} +} + +// Q is quest +func (tvc *TopVotedCandidate) Q(t int) int { + i := sort.SearchInts(tvc.times, t) + if i == len(tvc.times) || t != tvc.times[i] { + i-- + } + return tvc.leaders[i] +} diff --git a/Algorithms/0911.online-election/online-election_test.go b/Algorithms/0911.online-election/online-election_test.go new file mode 100755 index 000000000..19125b60f --- /dev/null +++ b/Algorithms/0911.online-election/online-election_test.go @@ -0,0 +1,26 @@ +package problem0911 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + persons := []int{0, 1, 1, 0, 0, 1, 0} + times := []int{0, 5, 10, 15, 20, 25, 30} + + qs := []int{3, 12, 25, 15, 24, 8} + as := []int{0, 1, 1, 0, 0, 1} + + tvc := Constructor(persons, times) + + for i, q := range qs { + expected := tvc.Q(q) + actual := as[i] + + ast.Equal(expected, actual) + } +} diff --git a/Algorithms/0912.sort-an-array/README.md b/Algorithms/0912.sort-an-array/README.md new file mode 100755 index 000000000..1b5609ef9 --- /dev/null +++ b/Algorithms/0912.sort-an-array/README.md @@ -0,0 +1,22 @@ +# [912. Sort an Array](https://leetcode.com/problems/sort-an-array/) + +Given an array of integers nums, sort the array in ascending order. + +Example 1: + +```text +Input: [5,2,3,1] +Output: [1,2,3,5] +``` + +Example 2: + +```text +Input: [5,1,1,2,0,0] +Output: [0,0,1,1,2,5] +``` + +Note: + +- 1 <= A.length <= 10000 +- -50000 <= A[i] <= 50000 diff --git a/Algorithms/0912.sort-an-array/sort-an-array.go b/Algorithms/0912.sort-an-array/sort-an-array.go new file mode 100755 index 000000000..c88a4208f --- /dev/null +++ b/Algorithms/0912.sort-an-array/sort-an-array.go @@ -0,0 +1,30 @@ +package problem0912 + +func sortArray(nums []int) []int { + quick3way(nums, 0, len(nums)-1) + return nums +} + +// 3 way quick sort +func quick3way(nums []int, lo, hi int) { + if lo >= hi { + return + } + lt, i, gt := lo, lo+1, hi + v := nums[lo] + for i <= gt { + switch { + case nums[i] < v: + nums[lt], nums[i] = nums[i], nums[lt] + lt++ + i++ + case nums[i] > v: + nums[i], nums[gt] = nums[gt], nums[i] + gt-- + default: + i++ + } + } + quick3way(nums, lo, lt-1) + quick3way(nums, gt+1, hi) +} diff --git a/Algorithms/0912.sort-an-array/sort-an-array_test.go b/Algorithms/0912.sort-an-array/sort-an-array_test.go new file mode 100755 index 000000000..362e63b46 --- /dev/null +++ b/Algorithms/0912.sort-an-array/sort-an-array_test.go @@ -0,0 +1,42 @@ +package problem0912 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans []int +}{ + + { + []int{5, 2, 3, 1}, + []int{1, 2, 3, 5}, + }, + + { + []int{5, 1, 1, 2, 0, 0}, + []int{0, 0, 1, 1, 2, 5}, + }, + + // 可以有多个 testcase +} + +func Test_sortArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, sortArray(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_sortArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sortArray(tc.nums) + } + } +} diff --git a/Algorithms/0913.cat-and-mouse/README.md b/Algorithms/0913.cat-and-mouse/README.md new file mode 100755 index 000000000..1d070bcef --- /dev/null +++ b/Algorithms/0913.cat-and-mouse/README.md @@ -0,0 +1,38 @@ +# [913. Cat and Mouse](https://leetcode.com/problems/cat-and-mouse/) + +A game on an **undirected** graph is played by two players, Mouse and Cat, who alternate turns. + +The graph is given as follows: `graph[a]` is a list of all nodes `b` such that `ab` is an edge of the graph. + +Mouse starts at node 1 and goes first, Cat starts at node 2 and goes second, and there is a Hole at node 0. + +During each player's turn, they **must** travel along one edge of the graph that meets where they are. For example, if the Mouse is at node `1`, it **must** travel to any node in `graph[1]`. + +Additionally, it is not allowed for the Cat to travel to the Hole (node 0.) + +Then, the game can end in 3 ways: + +- If ever the Cat occupies the same node as the Mouse, the Cat wins. +- If ever the Mouse reaches the Hole, the Mouse wins. +- If ever a position is repeated (ie. the players are in the same position as a previous turn, and it is the same player's turn to move), the game is a draw. + +Given a `graph`, and assuming both players play optimally, return `1` if the game is won by Mouse, `2` if the game is won by Cat, and `0` if the game is a draw. + +Example 1: + +```text +Input: [[2,5],[3],[0,4,5],[1,4,5],[2,3],[0,2,3]] +Output: 0 +Explanation: +4---3---1 +| | +2---5 + \ / + 0 +``` + +Note: + +1. `3 <= graph.length <= 50` +1. It is guaranteed that `graph[1]` is non-empty. +1. It is guaranteed that `graph[2]` contains a non-zero element. \ No newline at end of file diff --git a/Algorithms/0913.cat-and-mouse/cat-and-mouse.go b/Algorithms/0913.cat-and-mouse/cat-and-mouse.go new file mode 100755 index 000000000..1dc275be4 --- /dev/null +++ b/Algorithms/0913.cat-and-mouse/cat-and-mouse.go @@ -0,0 +1,79 @@ +package problem0913 + +// ref: https://leetcode.com/problems/cat-and-mouse/discuss/176177/Most-of-the-DFS-solutions-are-WRONG-check-this-case + +func catMouseGame(graph [][]int) int { + n := len(graph) + colors := [50][50][2]int{} + outdegree := [50][50][2]int{} + + for i := 0; i < n; i++ { // cat + for j := 0; j < n; j++ { // mouse + outdegree[i][j][0] = len(graph[j]) + outdegree[i][j][1] = len(graph[i]) + for _, k := range graph[i] { + if k == 0 { + outdegree[i][j][1]-- + break + } + } + } + } + + queue := make([][4]int, 0, n) + + colorizeAndPush := func(cat, mouse, mouseMove, color int) { + colors[cat][mouse][mouseMove] = color + queue = append(queue, [4]int{cat, mouse, mouseMove, color}) + } + + for k := 1; k < n; k++ { + for m := 0; m < 2; m++ { + colorizeAndPush(k, 0, m, 1) + colorizeAndPush(k, k, m, 2) + } + } + + var cur [4]int + + for len(queue) > 0 { + cur, queue = queue[0], queue[1:] + cat, mouse, mouseMove, color := cur[0], cur[1], cur[2], cur[3] + if cat == 2 && + mouse == 1 && + mouseMove == 0 { + return color + } + prevMouseMove := 1 - mouseMove + animal := mouse + if prevMouseMove == 1 { + animal = cat + } + for _, prev := range graph[animal] { + prevCat := cat + prevMouse := prev + if prevMouseMove == 1 { + prevCat = prev + prevMouse = mouse + } + + if prevCat == 0 { + continue + } + + if colors[prevCat][prevMouse][prevMouseMove] > 0 { + continue + } + + outdegree[prevCat][prevMouse][prevMouseMove]-- + if (prevMouseMove == 1 && color == 2) || + (prevMouseMove == 0 && color == 1) || + (outdegree[prevCat][prevMouse][prevMouseMove] == 0) { + colors[prevCat][prevMouse][prevMouseMove] = color + queue = append(queue, [4]int{prevCat, prevMouse, prevMouseMove, color}) + } + } + } + + return colors[2][1][0] +} diff --git a/Algorithms/0913.cat-and-mouse/cat-and-mouse_test.go b/Algorithms/0913.cat-and-mouse/cat-and-mouse_test.go new file mode 100755 index 000000000..bf1f97939 --- /dev/null +++ b/Algorithms/0913.cat-and-mouse/cat-and-mouse_test.go @@ -0,0 +1,48 @@ +package problem0913 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + ans int +}{ + + { + [][]int{ + {2, 5}, {3}, {0, 4, 5}, {1, 4, 5}, {2, 3}, {0, 2, 3}, + }, + 0, + }, + + { + [][]int{ + {6}, {4}, {9}, {5}, {1, 5}, {3, 4, 6}, {0, 5, 10}, {8, 9, 10}, {7}, {2, 7}, {6, 7}, + }, + 1, + }, + + // 可以有多个 testcase +} + +func Test_catMouseGame(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, catMouseGame(tc.graph), "输入:%v", tc) + } +} + +func Benchmark_catMouseGame(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + catMouseGame(tc.graph) + } + } +} diff --git a/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/README.md b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/README.md new file mode 100755 index 000000000..4e8387872 --- /dev/null +++ b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/README.md @@ -0,0 +1,53 @@ +# [914. X of a Kind in a Deck of Cards](https://leetcode.com/problems/x-of-a-kind-in-a-deck-of-cards/) + +In a deck of cards, each card has an integer written on it. + +Return `true` if and only if you can choose `X >= 2` such that it is possible to split the entire deck into 1 or more groups of cards, where: + +- Each group has exactly X cards. +- All the cards in each group have the same integer. + +Example 1: + +```text +Input: [1,2,3,4,4,3,2,1] +Output: true +Explanation: Possible partition [1,1],[2,2],[3,3],[4,4] +``` + +Example 2: + +```text +Input: [1,1,1,2,2,2,3,3] +Output: false +Explanation: No possible partition. +``` + +Example 3: + +```text +Input: [1] +Output: false +Explanation: No possible partition. +``` + +Example 4: + +```text +Input: [1,1] +Output: true +Explanation: Possible partition [1,1] +``` + +Example 5: + +```text +Input: [1,1,2,2,2,2] +Output: true +Explanation: Possible partition [1,1],[2,2],[2,2] +``` + +Note: + +- `1 <= deck.length <= 10000` +- `0 <= deck[i] < 10000` \ No newline at end of file diff --git a/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards.go b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards.go new file mode 100755 index 000000000..41ede5376 --- /dev/null +++ b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards.go @@ -0,0 +1,33 @@ +package problem0914 + +func hasGroupsSizeX(deck []int) bool { + size := len(deck) // 题目说了 size >= 1 + + // 统计 deck 中相同数字的数量 + count := make(map[int]int, size) + for _, card := range deck { + count[card]++ + } + + d := count[deck[0]] + + for _, c := range count { + d = gcd(d, c) + if d == 1 { + return false + } + } + + return true +} + +// 最大公约数 +func gcd(a, b int) int { + if a < b { + a, b = b, a + } + for b != 0 { + a, b = b, a%b + } + return a +} diff --git a/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards_test.go b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards_test.go new file mode 100755 index 000000000..4897f8c03 --- /dev/null +++ b/Algorithms/0914.x-of-a-kind-in-a-deck-of-cards/x-of-a-kind-in-a-deck-of-cards_test.go @@ -0,0 +1,59 @@ +package problem0914 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + deck []int + ans bool +}{ + + { + []int{1, 2, 3, 4, 4, 3, 2, 1}, + true, + }, + + { + []int{1, 1, 1, 2, 2, 2, 3, 3}, + false, + }, + + { + []int{1}, + false, + }, + + { + []int{1, 1}, + true, + }, + + { + []int{1, 1, 2, 2, 2, 2}, + true, + }, + + // 可以有多个 testcase +} + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, hasGroupsSizeX(tc.deck), "输入:%v", tc) + } +} + +func Benchmark_myFunc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + hasGroupsSizeX(tc.deck) + } + } +} diff --git a/Algorithms/0915.partition-array-into-disjoint-intervals/README.md b/Algorithms/0915.partition-array-into-disjoint-intervals/README.md new file mode 100755 index 000000000..a02777e8c --- /dev/null +++ b/Algorithms/0915.partition-array-into-disjoint-intervals/README.md @@ -0,0 +1,31 @@ +# [915. Partition Array into Disjoint Intervals](https://leetcode.com/problems/partition-array-into-disjoint-intervals/) + +Given an array `A`, partition it into two (contiguous) subarrays `left` and `right` so that: + +- Every element in `left` is less than or equal to every element in `right`. +- `left` and `right` are non-empty. +- `left` has the smallest possible size. + +Return the **length** of `left` after such a partitioning. It is guaranteed that such a partitioning exists. + +Example 1: + +```text +Input: [5,0,3,8,6] +Output: 3 +Explanation: left = [5,0,3], right = [8,6] +``` + +Example 2: + +```text +Input: [1,1,1,0,6,12] +Output: 4 +Explanation: left = [1,1,1,0], right = [6,12] +``` + +Note: + +1. `2 <= A.length <= 30000` +1. `0 <= A[i] <= 10^6` +1. It is guaranteed there is at least one way to partition `A` as described. diff --git a/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals.go b/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals.go new file mode 100755 index 000000000..afbc70219 --- /dev/null +++ b/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals.go @@ -0,0 +1,25 @@ +package problem0915 + +func partitionDisjoint(A []int) int { + leftMax, nextMax, rightBegin := A[0], A[0], 1 + + for i := 1; i < len(A); i++ { + if leftMax > A[i] { + // 此时,A[i] 比在 left 中, + leftMax = nextMax + // right 的起点,至少是 i+1 + rightBegin = i + 1 + } else { + nextMax = max(nextMax, A[i]) + } + } + + return rightBegin +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals_test.go b/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals_test.go new file mode 100755 index 000000000..84b0627c0 --- /dev/null +++ b/Algorithms/0915.partition-array-into-disjoint-intervals/partition-array-into-disjoint-intervals_test.go @@ -0,0 +1,54 @@ +package problem0915 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{90, 47, 69, 10, 43, 92, 31, 73, 61, 97}, + 9, + }, + + { + []int{1, 1}, + 1, + }, + + { + []int{5, 0, 3, 8, 6}, + 3, + }, + + { + []int{1, 1, 1, 0, 6, 12}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_partitionDisjoint(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, partitionDisjoint(tc.A), "输入:%v", tc) + } +} + +func Benchmark_partitionDisjoint(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + partitionDisjoint(tc.A) + } + } +} diff --git a/Algorithms/0916.word-subsets/README.md b/Algorithms/0916.word-subsets/README.md new file mode 100755 index 000000000..e58c54555 --- /dev/null +++ b/Algorithms/0916.word-subsets/README.md @@ -0,0 +1,51 @@ +# [916. Word Subsets](https://leetcode.com/problems/word-subsets/) + +We are given two arrays `A` and `B` of words. Each word is a string of lowercase letters. + +Now, say that word `b` is a subset of word `a` if every letter in `b` occurs in `a`, **including multiplicity**. For example, `"wrr"` is a subset of `"warrior"`, but is not a subset of `"world"`. + +Now say a word `a` from `A` is *universal* if for every `b` in `B`, `b` is a subset of `a`. + +Return a list of all universal words in `A`. You can return the words in any order. + +Example 1: + +```text +Input: A = ["amazon","apple","facebook","google","leetcode"], B = ["e","o"] +Output: ["facebook","google","leetcode"] +``` + +Example 2: + +```text +Input: A = ["amazon","apple","facebook","google","leetcode"], B = ["l","e"] +Output: ["apple","google","leetcode"] +``` + +Example 3: + +```text +Input: A = ["amazon","apple","facebook","google","leetcode"], B = ["e","oo"] +Output: ["facebook","google"] +``` + +Example 4: + +```text +Input: A = ["amazon","apple","facebook","google","leetcode"], B = ["lo","eo"] +Output: ["google","leetcode"] +``` + +Example 5: + +```text +Input: A = ["amazon","apple","facebook","google","leetcode"], B = ["ec","oc","ceo"] +Output: ["facebook","leetcode"] +``` + +Note: + +1. `1 <= A.length, B.length <= 10000` +1. `1 <= A[i].length, B[i].length <= 10` +1. `A[i]` and `B[i]` consist only of lowercase letters. +1. All words in `A[i]` are unique: there isn't `i != j` with `A[i] == A[j]`. \ No newline at end of file diff --git a/Algorithms/0916.word-subsets/word-subsets.go b/Algorithms/0916.word-subsets/word-subsets.go new file mode 100755 index 000000000..0eccad20d --- /dev/null +++ b/Algorithms/0916.word-subsets/word-subsets.go @@ -0,0 +1,49 @@ +package problem0916 + +func wordSubsets(A, B []string) []string { + clt := new([26]int) + for _, b := range B { + collect(clt, count(b)) + } + + res := make([]string, 0, len(A)) + for _, a := range A { + if isSubset(count(a), clt) { + res = append(res, a) + } + } + + return res +} + +func count(s string) *[26]int { + res := [26]int{} + for _, b := range s { + res[b-'a']++ + } + return &res +} + +func isSubset(s, clt *[26]int) bool { + isSubset := true + i := 0 + for isSubset && i < 26 { + isSubset = isSubset && (s[i] >= clt[i]) + i++ + } + return isSubset +} + +// collect to clt +func collect(clt, b *[26]int) { + for i := range clt { + clt[i] = max(clt[i], b[i]) + } +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0916.word-subsets/word-subsets_test.go b/Algorithms/0916.word-subsets/word-subsets_test.go new file mode 100755 index 000000000..e33b7485a --- /dev/null +++ b/Algorithms/0916.word-subsets/word-subsets_test.go @@ -0,0 +1,64 @@ +package problem0916 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A, B []string + ans []string +}{ + + { + []string{"amazon", "apple", "facebook", "google", "leetcode"}, + []string{"e", "o"}, + []string{"facebook", "google", "leetcode"}, + }, + + { + []string{"amazon", "apple", "facebook", "google", "leetcode"}, + []string{"l", "e"}, + []string{"apple", "google", "leetcode"}, + }, + + { + []string{"amazon", "apple", "facebook", "google", "leetcode"}, + []string{"e", "oo"}, + []string{"facebook", "google"}, + }, + + { + []string{"amazon", "apple", "facebook", "google", "leetcode"}, + []string{"lo", "eo"}, + []string{"google", "leetcode"}, + }, + + { + []string{"amazon", "apple", "facebook", "google", "leetcode"}, + []string{"ec", "oc", "ceo"}, + []string{"facebook", "leetcode"}, + }, + + // 可以有多个 testcase +} + +func Test_wordSubsets(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, wordSubsets(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_wordSubsets(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + wordSubsets(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0917.reverse-only-letters/README.md b/Algorithms/0917.reverse-only-letters/README.md new file mode 100755 index 000000000..64e38b7ed --- /dev/null +++ b/Algorithms/0917.reverse-only-letters/README.md @@ -0,0 +1,30 @@ +# [917. Reverse Only Letters](https://leetcode.com/problems/reverse-only-letters/) + +Given a string `S`, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positions. + +Example 1: + +```text +Input: "ab-cd" +Output: "dc-ba" +``` + +Example 2: + +```text +Input: "a-bC-dEf-ghIj" +Output: "j-Ih-gfE-dCba" +``` + +Example 3: + +```text +Input: "Test1ng-Leet=code-Q!" +Output: "Qedo1ct-eeLg=ntse-T!" +``` + +Note: + +1. `S.length <= 100` +1. `33 <= S[i].ASCIIcode <= 122` +1. `S` doesn't contain `\` or `"` diff --git a/Algorithms/0917.reverse-only-letters/reverse-only-letters.go b/Algorithms/0917.reverse-only-letters/reverse-only-letters.go new file mode 100755 index 000000000..9655020df --- /dev/null +++ b/Algorithms/0917.reverse-only-letters/reverse-only-letters.go @@ -0,0 +1,25 @@ +package problem0917 + +func reverseOnlyLetters(S string) string { + bs := []byte(S) + + left, right := 0, len(bs)-1 + for left < right { + for left < right && !isLetter(bs[left]) { + left++ + } + for left < right && !isLetter(bs[right]) { + right-- + } + bs[left], bs[right] = bs[right], bs[left] + left++ + right-- + } + + return string(bs) +} + +func isLetter(b byte) bool { + return 'a' <= b && b <= 'z' || + 'A' <= b && b <= 'Z' +} diff --git a/Algorithms/0917.reverse-only-letters/reverse-only-letters_test.go b/Algorithms/0917.reverse-only-letters/reverse-only-letters_test.go new file mode 100755 index 000000000..a091469b0 --- /dev/null +++ b/Algorithms/0917.reverse-only-letters/reverse-only-letters_test.go @@ -0,0 +1,49 @@ +package problem0917 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "ab-cd", + "dc-ba", + }, + + { + "a-bC-dEf-ghIj", + "j-Ih-gfE-dCba", + }, + + { + "Test1ng-Leet=code-Q!", + "Qedo1ct-eeLg=ntse-T!", + }, + + // 可以有多个 testcase +} + +func Test_reverseOnlyLetters(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, reverseOnlyLetters(tc.S), "输入:%v", tc) + } +} + +func Benchmark_reverseOnlyLetters(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseOnlyLetters(tc.S) + } + } +} diff --git a/Algorithms/0918.maximum-sum-circular-subarray/README.md b/Algorithms/0918.maximum-sum-circular-subarray/README.md new file mode 100755 index 000000000..56b15cea5 --- /dev/null +++ b/Algorithms/0918.maximum-sum-circular-subarray/README.md @@ -0,0 +1,52 @@ +# [918. Maximum Sum Circular Subarray](https://leetcode.com/problems/maximum-sum-circular-subarray/) + +Given a **circular array C** of integers represented by `A`, find the maximum possible sum of a non-empty subarray of **C**. + +Here, a circular array means the end of the array connects to the beginning of the array.  (Formally, `C[i] = A[i]` when `0 <= i < A.length`, and `C[i+A.length] = C[i]` when `i >= 0`.) + +Also, a subarray may only include each element of the fixed buffer `A` at most once.  (Formally, for a subarray `C[i], C[i+1], ..., C[j]`, there does not exist `i <= k1, k2 <= j` with `k1 % A.length = k2 % A.length`.) + +Example 1: + +```text +Input: [1,-2,3,-2] +Output: 3 +Explanation: Subarray [3] has maximum sum 3 +``` + +Example 2: + +```text +Input: [5,-3,5] +Output: 10 +Explanation: Subarray [5,5] has maximum sum 5 + 5 = 10 +``` + +Example 3: + +```text +Input: [3,-1,2,-1] +Output: 4 +Explanation: Subarray [2,-1,3] has maximum sum 2 + (-1) + 3 = 4 +``` + +Example 4: + +```text +Input: [3,-2,2,-3] +Output: 3 +Explanation: Subarray [3] and [3,-2,2] both have maximum sum 3 +``` + +Example 5: + +```text +Input: [-2,-3,-1] +Output: -1 +Explanation: Subarray [-1] has maximum sum -1 +``` + +Note: + +1. `-30000 <= A[i] <= 30000` +1. `1 <= A.length <= 30000` diff --git a/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray.go b/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray.go new file mode 100755 index 000000000..4d23d2f11 --- /dev/null +++ b/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray.go @@ -0,0 +1,35 @@ +package problem0918 + +// ref: https://leetcode.com/problems/maximum-sum-circular-subarray/discuss/178422/C++JavaPython-One-Pass + +func maxSubarraySumCircular(A []int) int { + total, curMax, curMin := 0, 0, 0 + maxSum, minSum := -30001, 30001 + + for _, a := range A { + curMax = max(curMax+a, a) + maxSum = max(maxSum, curMax) + curMin = min(curMin+a, a) + minSum = min(minSum, curMin) + total += a + } + + if maxSum > 0 { + return max(maxSum, total-minSum) + } + return maxSum +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray_test.go b/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray_test.go new file mode 100755 index 000000000..664fa58e4 --- /dev/null +++ b/Algorithms/0918.maximum-sum-circular-subarray/maximum-sum-circular-subarray_test.go @@ -0,0 +1,59 @@ +package problem0918 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, -2, 3, -2}, + 3, + }, + + { + []int{5, -3, 5}, + 10, + }, + + { + []int{3, -1, 2, -1}, + 4, + }, + + { + []int{3, -2, 2, -3}, + 3, + }, + + { + []int{-2, -3, -1}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_maxSubarraySumCircular(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, maxSubarraySumCircular(tc.A), "输入:%v", tc) + } +} + +func Benchmark_maxSubarraySumCircular(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSubarraySumCircular(tc.A) + } + } +} diff --git a/Algorithms/0919.complete-binary-tree-inserter/README.md b/Algorithms/0919.complete-binary-tree-inserter/README.md new file mode 100755 index 000000000..925fc21e8 --- /dev/null +++ b/Algorithms/0919.complete-binary-tree-inserter/README.md @@ -0,0 +1,29 @@ +# [919. Complete Binary Tree Inserter](https://leetcode.com/problems/complete-binary-tree-inserter/) + +A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. + +Write a data structure CBTInserter that is initialized with a complete binary tree and supports the following operations: + +- CBTInserter(TreeNode root) initializes the data structure on a given tree with head node root; +- CBTInserter.insert(int v) will insert a TreeNode into the tree with value node.val = v so that the tree remains complete, and returns the value of the parent of the inserted TreeNode; +- CBTInserter.get_root() will return the head node of the tree. + +Example 1: + +```text +Input: inputs = ["CBTInserter","insert","get_root"], inputs = [[[1]],[2],[]] +Output: [null,1,[1,2]] +``` + +Example 2: + +```text +Input: inputs = ["CBTInserter","insert","insert","get_root"], inputs = [[[1,2,3,4,5,6]],[7],[8],[]] +Output: [null,3,4,[1,2,3,4,5,6,7,8]] +``` + +Note: + +1. The initial given tree is complete and contains between 1 and 1000 nodes. +1. CBTInserter.insert is called at most 10000 times per test case. +1. Every value of a given or inserted node is between 0 and 5000. \ No newline at end of file diff --git a/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter.go b/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter.go new file mode 100755 index 000000000..713c1929c --- /dev/null +++ b/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter.go @@ -0,0 +1,53 @@ +package problem0919 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is defined in kit +type TreeNode = kit.TreeNode + +// CBTInserter is ... +type CBTInserter struct { + root *TreeNode +} + +// Constructor is ... +func Constructor(root *TreeNode) CBTInserter { + return CBTInserter{root: root} +} + +// Insert is +func (c *CBTInserter) Insert(v int) int { + nds := []*TreeNode{c.root} + + var parent *TreeNode + added := false + +ALL: + for len(nds) > 0 { + size := len(nds) + for i := 0; i < size; i++ { + parent = nds[i] + if parent.Left == nil { + parent.Left = &TreeNode{Val: v} + added = true + } else if parent.Right == nil { + parent.Right = &TreeNode{Val: v} + added = true + } + + if added { + break ALL + } + nds = append(nds, parent.Left, parent.Right) + } + nds = nds[size:] + } + return parent.Val +} + +// Get_root is ... +func (c *CBTInserter) Get_root() *TreeNode { + return c.root +} diff --git a/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter_test.go b/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter_test.go new file mode 100755 index 000000000..537f54bd5 --- /dev/null +++ b/Algorithms/0919.complete-binary-tree-inserter/complete-binary-tree-inserter_test.go @@ -0,0 +1,45 @@ +package problem0919 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + . "github.com/smartystreets/goconvey/convey" +) + +func Test_CBTInserter(t *testing.T) { + Convey("insert [1]", t, func() { + root := &TreeNode{Val: 1} + c := Constructor(root) + + parent := c.Insert(2) + So(parent, ShouldEqual, 1) + + actual := c.Get_root() + expected := &TreeNode{ + Val: 1, + Left: &TreeNode{ + Val: 2, + }, + } + So(actual, ShouldResemble, expected) + }) + + Convey("insert [1,2,3,4,5,6]", t, func() { + root := kit.Ints2TreeNode([]int{1, 2, 3, 4, 5, 6}) + c := Constructor(root) + + parent := c.Insert(7) + So(parent, ShouldEqual, 3) + + parent = c.Insert(8) + So(parent, ShouldEqual, 4) + + actual := c.Get_root() + expected := kit.Ints2TreeNode([]int{1, 2, 3, 4, 5, 6, 7, 8}) + So(actual, ShouldResemble, expected) + }) + + // +} diff --git a/Algorithms/0920.number-of-music-playlists/README.md b/Algorithms/0920.number-of-music-playlists/README.md new file mode 100755 index 000000000..0fbe86fdc --- /dev/null +++ b/Algorithms/0920.number-of-music-playlists/README.md @@ -0,0 +1,36 @@ +# [920. Number of Music Playlists](https://leetcode.com/problems/number-of-music-playlists/) + +Your music player contains `N` different songs and she wants to listen to `L` (not necessarily different) songs during your trip. You create a playlist so that: + +- Every song is played at least once +- A song can only be played again only if `K` other songs have been played + +Return the number of possible playlists. **As the answer can be very large, return it modulo** `10^9 + 7`. + +Example 1: + +```text +Input: N = 3, L = 3, K = 1 +Output: 6 +Explanation: There are 6 possible playlists. [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]. +``` + +Example 2: + +```text +Input: N = 2, L = 3, K = 0 +Output: 6 +Explanation: There are 6 possible playlists. [1, 1, 2], [1, 2, 1], [2, 1, 1], [2, 2, 1], [2, 1, 2], [1, 2, 2] +``` + +Example 3: + +```text +Input: N = 2, L = 3, K = 1 +Output: 2 +Explanation: There are 2 possible playlists. [1, 2, 1], [2, 1, 2] +``` + +Note: + +1. 0 <= K < N <= L <= 100 diff --git a/Algorithms/0920.number-of-music-playlists/number-of-music-playlists.go b/Algorithms/0920.number-of-music-playlists/number-of-music-playlists.go new file mode 100755 index 000000000..97fe5df66 --- /dev/null +++ b/Algorithms/0920.number-of-music-playlists/number-of-music-playlists.go @@ -0,0 +1,39 @@ +package problem0920 + +// ref: https://leetcode.com/problems/number-of-music-playlists/discuss/178415/C++JavaPython-DP-Solution + +const mod = 1e9 + 7 + +func numMusicPlaylists(N int, L int, K int) int { + dp := [101][101]int{} + // dp[n][l] means n songs in l lines and K other songs has been played when some song wants to play again + + // 0 <= K < N <= L <= 100 + for n := K + 1; n <= N; n++ { + // when n songs in n lines, + // just factorial n conditions + dp[n][n] = factorial(n) + // when n songs in n+ lines, + for l := n + 1; l <= L; l++ { + count := dp[n-1][l-1]*n + dp[n][l-1]*(n-K) + // dp[n-1][l-1] *n + // dp[n-1][l-1] means n-1 songs has been in [1,l-1] lines, + // want to add a new song which is not in n-1 songs to l line + // the new song could be anyone of n songs, So *n + // dp[n][l-1] *(n-K) + // dp[n][l-1] means n songs has been in [1,l-1] lines, + // add one of n songs to l line + // the song to add must be different with [l-k, l-1] line songs + // only choose from (n-k) songs, So *(n-k) + dp[n][l] = count % mod + } + } + return dp[N][L] +} + +func factorial(n int) int { + if n == 1 { + return 1 + } + return (n * factorial(n-1)) % mod +} diff --git a/Algorithms/0920.number-of-music-playlists/number-of-music-playlists_test.go b/Algorithms/0920.number-of-music-playlists/number-of-music-playlists_test.go new file mode 100755 index 000000000..8f13233df --- /dev/null +++ b/Algorithms/0920.number-of-music-playlists/number-of-music-playlists_test.go @@ -0,0 +1,69 @@ +package problem0920 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + L int + K int + ans int +}{ + + { + 25, + 28, + 5, + 906368459, + }, + + { + 16, + 16, + 4, + 789741546, + }, + + { + 3, + 3, + 1, + 6, + }, + + { + 2, + 3, + 0, + 6, + }, + + { + 2, + 3, + 1, + 2, + }, + + // 可以有多个 testcase +} + +func Test_numMusicPlaylists(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numMusicPlaylists(tc.N, tc.L, tc.K), "输入:%v", tc) + } +} + +func Benchmark_numMusicPlaylists(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numMusicPlaylists(tc.N, tc.L, tc.K) + } + } +} diff --git a/Algorithms/0921.minimum-add-to-make-parentheses-valid/README.md b/Algorithms/0921.minimum-add-to-make-parentheses-valid/README.md new file mode 100755 index 000000000..44b6dd2fc --- /dev/null +++ b/Algorithms/0921.minimum-add-to-make-parentheses-valid/README.md @@ -0,0 +1,44 @@ +# [921. Minimum Add to Make Parentheses Valid](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/) + +Given a string S of `(` and `)` parentheses, we add the minimum number of parentheses ( `(` or `)`, and in any positions ) so that the resulting parentheses string is valid. + +Formally, a parentheses string is valid if and only if: + +- It is the empty string, or +- It can be written as AB (A concatenated with B), where A and B are valid strings, or +- It can be written as (A), where A is a valid string. + +Given a parentheses string, return the minimum number of parentheses we must add to make the resulting string valid. + +Example 1: + +```text +Input: "())" +Output: 1 +``` + +Example 2: + +```text +Input: "(((" +Output: 3 +``` + +Example 3: + +```text +Input: "()" +Output: 0 +``` + +Example 4: + +```text +Input: "()))((" +Output: 4 +``` + +Note: + +1. S.length <= 1000 +1. S only consists of `(` and `)` characters. \ No newline at end of file diff --git a/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid.go b/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid.go new file mode 100755 index 000000000..314d96fbb --- /dev/null +++ b/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid.go @@ -0,0 +1,10 @@ +package problem0921 + +import "strings" + +func minAddToMakeValid(S string) int { + for strings.Contains(S, "()") { + S = strings.Replace(S, "()", "", -1) + } + return len(S) +} diff --git a/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid_test.go b/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid_test.go new file mode 100755 index 000000000..7e35cf293 --- /dev/null +++ b/Algorithms/0921.minimum-add-to-make-parentheses-valid/minimum-add-to-make-parentheses-valid_test.go @@ -0,0 +1,54 @@ +package problem0921 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "())", + 1, + }, + + { + "(((", + 3, + }, + + { + "()", + 0, + }, + + { + "()))((", + 4, + }, + + // 可以有多个 testcase +} + +func Test_minAddToMakeValid(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Printf("~~%v~~\n", tc) + ast.Equal(tc.ans, minAddToMakeValid(tc.S), "输入:%v", tc) + } +} + +func Benchmark_minAddToMakeValid(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minAddToMakeValid(tc.S) + } + } +} diff --git a/Algorithms/0922.sort-array-by-parity-ii/README.md b/Algorithms/0922.sort-array-by-parity-ii/README.md new file mode 100755 index 000000000..4a37db79f --- /dev/null +++ b/Algorithms/0922.sort-array-by-parity-ii/README.md @@ -0,0 +1,21 @@ +# [922. Sort Array By Parity II](https://leetcode.com/problems/sort-array-by-parity-ii/) + +Given an array `A` of non-negative integers, half of the integers in A are odd, and half of the integers are even. + +Sort the array so that whenever `A[i]` is odd, `i` is odd; and whenever `A[i]` is even, `i` is even. + +You may return any answer array that satisfies this condition. + +Example 1: + +```text +Input: [4,2,5,7] +Output: [4,5,2,7] +Explanation: [4,7,2,5], [2,5,4,7], [2,7,4,5] would also have been accepted. +``` + +Note: + +1. `2 <= A.length <= 20000` +1. `A.length % 2 == 0` +1. `0 <= A[i] <= 1000` \ No newline at end of file diff --git a/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii.go b/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii.go new file mode 100755 index 000000000..7bb0cfcac --- /dev/null +++ b/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii.go @@ -0,0 +1,19 @@ +package problem0922 + +func sortArrayByParityII(A []int) []int { + size := len(A) + res := make([]int, size) + even, odd := 0, 1 + + for _, a := range A { + if a%2 == 0 { + res[even] = a + even += 2 + } else { + res[odd] = a + odd += 2 + } + } + + return res +} diff --git a/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii_test.go b/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii_test.go new file mode 100755 index 000000000..b9bef97f8 --- /dev/null +++ b/Algorithms/0922.sort-array-by-parity-ii/sort-array-by-parity-ii_test.go @@ -0,0 +1,44 @@ +package problem0922 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int +}{ + + { + []int{4, 2, 5, 7}, + }, + + // 可以有多个 testcase +} + +func Test_sortArrayByParityII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.True(check(sortArrayByParityII(tc.A))) + } +} + +func Benchmark_sortArrayByParityII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sortArrayByParityII(tc.A) + } + } +} + +func check(a []int) bool { + for i := range a { + if a[i]%2 != i%2 { + return false + } + } + return true +} diff --git a/Algorithms/0923.3sum-with-multiplicity/3sum-with-multiplicity.go b/Algorithms/0923.3sum-with-multiplicity/3sum-with-multiplicity.go new file mode 100755 index 000000000..11abec354 --- /dev/null +++ b/Algorithms/0923.3sum-with-multiplicity/3sum-with-multiplicity.go @@ -0,0 +1,53 @@ +package problem0923 + +// refer: https://leetcode.com/problems/3sum-with-multiplicity/discuss/181131/C++JavaPython-O(1012) + +const mod = 1e9 + 7 + +// first of all, swap will NOT change answer +// for example +// A[0]=0, A[1]=1, A[2]=2 , A[0]+A[1]+A[2]=3 +// A[0]=1, A[1]=0, A[2]=2 , A[0]+A[1]+A[2]=3 +// i, j, k and A[i]+A[j]+A[k] don't change, answer don't change +// if we sort A +// then, i A[i]<=A[j]<=A[k] +// but we do not need sort A +// just count it + +func threeSumMulti(A []int, target int) int { + count := [101]int{} + for _, a := range A { + count[a]++ + } + + res := 0 + + for Ai := 0; Ai <= 100; Ai++ { + for Aj := Ai; Aj <= 100; Aj++ { // so always Ai<=Aj + Ak := target - Ai - Aj + if Ak < 0 || 100 < Ak { // need 0<= A[k] <= 100 + continue + } + + // remember, i A[i]<=A[j]<=A[k] + // A[i]<=A[j]<=A[k] has 4 conditions + // 按照以下情况分别计算组合数的话 + // 可以确保 A[i]<=A[j]<=A[k] => i malware:恶意软件 + +In a network of nodes, each node `i` is directly connected to another node `j` if and only if `graph[i][j] = 1`. + +Some nodes `initial` are initially infected by malware. Whenever two nodes are directly connected and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner. + +Suppose `M(initial)` is the final number of nodes infected with malware in the entire network, after the spread of malware stops. + +We will remove one node from the initial list. Return the node that if removed, would minimize `M(initial)`. If multiple nodes could be removed to minimize `M(initial)`, return such a node with the smallest index. + +Note that if a node was removed from the `initial` list of infected nodes, it may still be infected later as a result of the malware spread. + +Example 1: + +```text +Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1] +Output: 0 +``` + +Example 2: + +```text +Input: graph = [[1,0,0],[0,1,0],[0,0,1]], initial = [0,2] +Output: 0 +``` + +Example 3: + +```text +Input: graph = [[1,1,1],[1,1,1],[1,1,1]], initial = [1,2] +Output: 1 +``` + +Note: + +1. `1 < graph.length = graph[0].length <= 300` +1. `0 <= graph[i][j] == graph[j][i] <= 1` +1. `graph[i][i] = 1` +1. `1 <= initial.length < graph.length` +1. `0 <= initial[i] < graph.length` \ No newline at end of file diff --git a/Algorithms/0924.minimize-malware-spread/minimize-malware-spread.go b/Algorithms/0924.minimize-malware-spread/minimize-malware-spread.go new file mode 100755 index 000000000..d88977ee0 --- /dev/null +++ b/Algorithms/0924.minimize-malware-spread/minimize-malware-spread.go @@ -0,0 +1,75 @@ +package problem0924 + +// 题目的意思是,在 graph 中寻找包含 initial 点的连通区域 +// 如果,所有包含 initial 点的连通区域,都不止一个 initial 点 +// 返回,initial 中的最小值。 +// 如果,存在只包含一个 initial 点的连通区域, +// 找到只包含一个 initial 点且最大的连通区域 +// 返回其中 initial 点的值。 + +func minMalwareSpread(graph [][]int, initial []int) int { + size := len(graph) + + maxCount := -1 + res := size + + // 记录 initial 中的点,并找到其中的最小值作为 res 备选 + isInitial := [301]bool{} + for _, n := range initial { + isInitial[n] = true + res = min(res, n) + } + + for candidate := 0; candidate < size; candidate++ { + if !isInitial[candidate] { + continue + } + + // 从 initial 中的点,可以寻找连通区域 + + queue := make([]int, 1, size) + queue[0] = candidate + + hasSeen := [301]bool{} + hasSeen[candidate] = true + isUnique := true // 标记此连通区域中,只有一个 initial 点 + count := 1 // 记录此连通区域中点的数目 + + // BFS + for len(queue) > 0 { + queueSize := len(queue) + for idx := 0; idx < queueSize; idx++ { + i := queue[idx] + for j := 0; j < size; j++ { + if !hasSeen[j] && graph[i][j] == 1 { + hasSeen[j] = true + count++ + queue = append(queue, j) + if isInitial[j] { + isUnique = false + isInitial[j] = false + // 这样就不会再次搜索此连通区域,可以加快速度 + // 并且可以保证 i 就是此连通区域中最小的 initial 点 + } + } + } + } + queue = queue[queueSize:] + } + + if isUnique && // 只有一个 initial 点时,才有必要更新 res + maxCount < count { + maxCount = count + res = candidate + } + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0924.minimize-malware-spread/minimize-malware-spread_test.go b/Algorithms/0924.minimize-malware-spread/minimize-malware-spread_test.go new file mode 100755 index 000000000..ca97255e9 --- /dev/null +++ b/Algorithms/0924.minimize-malware-spread/minimize-malware-spread_test.go @@ -0,0 +1,63 @@ +package problem0924 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + initial []int + ans int +}{ + + { + [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}, + []int{0, 1, 2}, + 2, + }, + + { + [][]int{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 1}, {0, 0, 1, 1}}, + []int{3, 1}, + 3, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}, + []int{0, 1}, + 0, + }, + + { + [][]int{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, + []int{0, 2}, + 0, + }, + + { + [][]int{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, + []int{1, 2}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_minMalwareSpread(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minMalwareSpread(tc.graph, tc.initial), "输入:%v", tc) + } +} + +func Benchmark_minMalwareSpread(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minMalwareSpread(tc.graph, tc.initial) + } + } +} diff --git a/Algorithms/0925.long-pressed-name/README.md b/Algorithms/0925.long-pressed-name/README.md new file mode 100755 index 000000000..68d2dcef9 --- /dev/null +++ b/Algorithms/0925.long-pressed-name/README.md @@ -0,0 +1,42 @@ +# [925. Long Pressed Name](https://leetcode.com/problems/long-pressed-name/) + +Your friend is typing his `name` into a keyboard. Sometimes, when typing a character `c`, the key might get long pressed, and the character will be typed 1 or more times. + +You examine the `typed` characters of the keyboard. Return `True` if it is possible that it was your friends name, with some characters (possibly none) being long pressed. + +Example 1: + +```text +Input: name = "alex", typed = "aaleex" +Output: true +Explanation: 'a' and 'e' in 'alex' were long pressed. +``` + +Example 2: + +```text +Input: name = "saeed", typed = "ssaaedd" +Output: false +Explanation: 'e' must have been pressed twice, but it wasn't in the typed output. +``` + +Example 3: + +```text +Input: name = "leelee", typed = "lleeelee" +Output: true +``` + +Example 4: + +```text +Input: name = "laiden", typed = "laiden" +Output: true +Explanation: It's not necessary to long press any character. +``` + +Note: + +1. `name.length <= 1000` +1. `typed.length <= 1000` +1. The characters of `name` and `typed` are lowercase letters. \ No newline at end of file diff --git a/Algorithms/0925.long-pressed-name/long-pressed-name.go b/Algorithms/0925.long-pressed-name/long-pressed-name.go new file mode 100755 index 000000000..8a16c60df --- /dev/null +++ b/Algorithms/0925.long-pressed-name/long-pressed-name.go @@ -0,0 +1,34 @@ +package problem0925 + +func isLongPressedName(name, typed string) bool { + if name == typed { + return true + } + + nameSize := len(name) + typedSize := len(typed) + + i, j := 0, 0 + + for i < nameSize && j < typedSize { + c := name[i] + need, pressed := 0, 0 + + for i < nameSize && name[i] == c { + need++ + i++ + } + + for j < typedSize && typed[j] == c { + pressed++ + j++ + } + + if pressed < need { + return false + } + + } + + return i == nameSize && j == typedSize +} diff --git a/Algorithms/0925.long-pressed-name/long-pressed-name_test.go b/Algorithms/0925.long-pressed-name/long-pressed-name_test.go new file mode 100755 index 000000000..8ce6df705 --- /dev/null +++ b/Algorithms/0925.long-pressed-name/long-pressed-name_test.go @@ -0,0 +1,75 @@ +package problem0925 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + name string + typed string + ans bool +}{ + + { + "alex", + "aaaaaaaaaaaallllllllllllllleeeeeeeeeeeeeeeexxxxxxxxx", + true, + }, + + { + "alex", + "aal", + false, + }, + + { + "alex", + "aaleexOK", + false, + }, + + { + "alex", + "aaleex", + true, + }, + + { + "saeed", + "ssaaedd", + false, + }, + + { + "leelee", + "lleeelee", + true, + }, + + { + "laiden", + "laiden", + true, + }, + + // 可以有多个 testcase +} + +func Test_isLongPressedName(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isLongPressedName(tc.name, tc.typed), "输入:%v", tc) + } +} + +func Benchmark_isLongPressedName(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isLongPressedName(tc.name, tc.typed) + } + } +} diff --git a/Algorithms/0926.flip-string-to-monotone-increasing/README.md b/Algorithms/0926.flip-string-to-monotone-increasing/README.md new file mode 100755 index 000000000..815e7b334 --- /dev/null +++ b/Algorithms/0926.flip-string-to-monotone-increasing/README.md @@ -0,0 +1,36 @@ +# [926. Flip String to Monotone Increasing](https://leetcode.com/problems/flip-string-to-monotone-increasing/) + +A string of `0`s and `1`s is monotone increasing if it consists of some number of `0`s (possibly 0), followed by some number of `1`s (also possibly 0.) + +We are given a string `S` of `0`s and `1`s, and we may flip any `0` to a `1` or a `1` to a `0`. + +Return the minimum number of flips to make `S` monotone increasing. + +Example 1: + +```text +Input: "00110" +Output: 1 +Explanation: We flip the last digit to get 00111. +``` + +Example 2: + +```text +Input: "010110" +Output: 2 +Explanation: We flip to get 011111, or alternatively 000111. +``` + +Example 3: + +```text +Input: "00011000" +Output: 2 +Explanation: We flip to get 00000000. +``` + +Note: + +1. `1 <= S.length <= 20000` +1. `S` only consists of `0` and `1` characters. \ No newline at end of file diff --git a/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing.go b/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing.go new file mode 100755 index 000000000..4ced736cd --- /dev/null +++ b/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing.go @@ -0,0 +1,36 @@ +package problem0926 + +func minFlipsMonoIncr(S string) int { + size := len(S) + + count := make([]int, size+1) + for i := 0; i < size; i++ { + count[i+1] = count[i] + if S[i] == '1' { + count[i+1]++ + } + } + + res := size + for i := 0; i <= size; i++ { + // for S[:i] is all 0 + // need flip 1 to 0 in S[:i], + // there are count[i] 1s in S[i:] + // for S[i:] is all 1 + // need flip 0 to 1 in S[i:], + // length of S[i:] is size-i, + // count of 1s in S[i:] is count[size]-count[i], + // there are (size-i)-(count[size]-count[i]) 0s in S[i:] + tmp := count[i] + ((size - i) - (count[size] - count[i])) + res = min(res, tmp) + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing_test.go b/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing_test.go new file mode 100755 index 000000000..f286a0b61 --- /dev/null +++ b/Algorithms/0926.flip-string-to-monotone-increasing/flip-string-to-monotone-increasing_test.go @@ -0,0 +1,57 @@ +package problem0926 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "01000011110", + 2, + }, + + { + "00110", + 1, + }, + + { + "00110", + 1, + }, + + { + "010110", + 2, + }, + + { + "00011000", + 2, + }, + + // 可以有多个 testcase +} + +func Test_minFlipsMonoIncr(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minFlipsMonoIncr(tc.S), "输入:%v", tc) + } +} + +func Benchmark_minFlipsMonoIncr(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minFlipsMonoIncr(tc.S) + } + } +} diff --git a/Algorithms/0927.three-equal-parts/README.md b/Algorithms/0927.three-equal-parts/README.md new file mode 100755 index 000000000..9c6760b04 --- /dev/null +++ b/Algorithms/0927.three-equal-parts/README.md @@ -0,0 +1,33 @@ +# [927. Three Equal Parts](https://leetcode.com/problems/three-equal-parts/) + +Given an array `A` of `0`s and `1`s, divide the array into 3 non-empty parts such that all of these parts represent the same binary value. + +If it is possible, return **any** `[i, j]` with `i+1 < j`, such that: + +- `A[0], A[1], ..., A[i]` is the first part; +- `A[i+1], A[i+2], ..., A[j-1]` is the second part, and +- `A[j], A[j+1], ..., A[A.length - 1]` is the third part. +- All three parts have equal binary value. + +If it is not possible, return `[-1, -1]`. + +Note that the entire part is used when considering what binary value it represents. For example, `[1,1,0]` represents `6` in decimal, not `3`. Also, leading zeros are allowed, so `[0,1,1]` and `[1,1]` represent the same value. + +Example 1: + +```text +Input: [1,0,1,0,1] +Output: [0,3] +``` + +Example 2: + +```text +Input: [1,1,0,1,1] +Output: [-1,-1] +``` + +Note: + +1. `3 <= A.length <= 30000` +1. `A[i] == 0` or `A[i] == 1` \ No newline at end of file diff --git a/Algorithms/0927.three-equal-parts/three-equal-parts.go b/Algorithms/0927.three-equal-parts/three-equal-parts.go new file mode 100755 index 000000000..9022c918e --- /dev/null +++ b/Algorithms/0927.three-equal-parts/three-equal-parts.go @@ -0,0 +1,52 @@ +package problem0927 + +// ref: https://leetcode.com/problems/three-equal-parts/discuss/183922/C++-O(n)-time-O(1)-space-12-ms-with-explanation-and-comments + +var noPossible = []int{-1, -1} + +func threeEqualParts(A []int) []int { + size := len(A) + + indexs := make([]int, 0, size) + for i, val := range A { + if val == 1 { + indexs = append(indexs, i) + } + } + + count := len(indexs) + + if count == 0 { + return []int{0, 2} + } + + if count%3 != 0 { + // 此时,无法保证每个部分都有相同数目的 1 + // 所以,不可能出现可行解 + return noPossible + } + + c1, c2 := count/3, count/3*2 + s0, s1, s2 := indexs[0], indexs[c1], indexs[c2] + + // 此时 A[s0:s1], A[s1:s2] 和 A[s2:] 中分别有三分之一的 1 + // 且 + // A[s0]==A[s1]==A[s2]==1 三个部分的第一个 1 已经对齐 + // 可以开始逐个比较 + for s2 < size && + A[s0] == A[s1] && + A[s1] == A[s2] { + s0++ + s1++ + s2++ + } + + if s2 == size { + // 此时, 所有的 1 都被比较过了 + // 且三段中的 1 分布相同。 + // 没有被比较的元素都是 0 + return []int{s0 - 1, s1} + } + + return noPossible +} diff --git a/Algorithms/0927.three-equal-parts/three-equal-parts_test.go b/Algorithms/0927.three-equal-parts/three-equal-parts_test.go new file mode 100755 index 000000000..23b971352 --- /dev/null +++ b/Algorithms/0927.three-equal-parts/three-equal-parts_test.go @@ -0,0 +1,52 @@ +package problem0927 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans []int +}{ + + { + []int{0, 0, 0, 0, 0}, + []int{0, 2}, + }, + + { + []int{1, 0, 1, 0, 1, 0, 0}, + []int{-1, -1}, + }, + + { + []int{1, 0, 1, 0, 1}, + []int{0, 3}, + }, + + { + []int{1, 1, 0, 1, 1}, + []int{-1, -1}, + }, + + // 可以有多个 testcase +} + +func Test_threeEqualParts(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, threeEqualParts(tc.A), "输入:%v", tc) + } +} + +func Benchmark_threeEqualParts(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + threeEqualParts(tc.A) + } + } +} diff --git a/Algorithms/0928.minimize-malware-spread-ii/README.md b/Algorithms/0928.minimize-malware-spread-ii/README.md new file mode 100755 index 000000000..750fd267d --- /dev/null +++ b/Algorithms/0928.minimize-malware-spread-ii/README.md @@ -0,0 +1,40 @@ +# [928. Minimize Malware Spread II](https://leetcode.com/problems/minimize-malware-spread-ii/) + +(This problem is the same as Minimize Malware Spread, with the differences bolded.) + +In a network of nodes, each node `i` is directly connected to another node `j` if and only if `graph[i][j] = 1`. + +Some nodes `initial` are initially infected by malware. Whenever two nodes are directly connected and at least one of those two nodes is infected by malware, both nodes will be infected by malware. This spread of malware will continue until no more nodes can be infected in this manner. + +Suppose `M(initial)` is the final number of nodes infected with malware in the entire network, after the spread of malware stops. + +We will remove one node from the initial list, **completely removing it and any connections from this node to any other node**. Return the node that if removed, would minimize `M(initial)`. If multiple nodes could be removed to minimize `M(initial)`, return such a node with the smallest index. + +Example 1: + +```text +Input: graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1] +Output: 0 +``` + +Example 2: + +```text +Input: graph = [[1,1,0],[1,1,1],[0,1,1]], initial = [0,1] +Output: 1 +``` + +Example 3: + +```text +Input: graph = [[1,1,0,0],[1,1,1,0],[0,1,1,1],[0,0,1,1]], initial = [0,1] +Output: 1 +``` + +Note: + +1. `1 < graph.length = graph[0].length <= 300` +1. `0 <= graph[i][j] == graph[j][i] <= 1` +1. `graph[i][i] = 1` +1. `1 <= initial.length < graph.length` +1. `0 <= initial[i] < graph.length` diff --git a/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii.go b/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii.go new file mode 100755 index 000000000..ff2591318 --- /dev/null +++ b/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii.go @@ -0,0 +1,60 @@ +package problem0928 + +func minMalwareSpread(graph [][]int, initial []int) int { + size := len(graph) + + infected := make([]bool, size) + for _, i := range initial { + infected[i] = true + } + + seen := make([]bool, size) + + var dfs func(int) int + // 返回 0 表示遇到了 infected 计算机 + dfs = func(i int) int { + if infected[i] { + return 0 + } + count := 1 // 1 是代表了 i 本身 + seen[i] = true + for j := 0; j < size; j++ { + if seen[j] || graph[i][j] == 0 { + continue + } + c := dfs(j) + if c == 0 { + // 深入过程中,遇到了 infected + // 就把 i 标记为 infected,可以加快后续的步骤 + // 但需要同时标记 seen[i]=false + // 因为 dfs 不会检查 seen[i]=true 的点是否已经感染。 + infected[i] = true + seen[i] = false + return 0 + } + count += c + } + return count + } + + maxCount := -1 + res := size + + for _, i := range initial { + count := 0 + seen[i] = true + for j := 0; j < size; j++ { + if seen[j] || graph[i][j] == 0 { + continue + } + count += dfs(j) + } + if (maxCount < count) || + (maxCount == count && res > i) { + maxCount = count + res = i + } + } + + return res +} diff --git a/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii_test.go b/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii_test.go new file mode 100755 index 000000000..55887fa7d --- /dev/null +++ b/Algorithms/0928.minimize-malware-spread-ii/minimize-malware-spread-ii_test.go @@ -0,0 +1,144 @@ +package problem0928 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + graph [][]int + initial []int + ans int +}{ + + { + [][]int{ + {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 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, 0, 1, 0, 0}, + {1, 1, 1, 1, 0, 0}, + {0, 1, 1, 0, 0, 0}, + {1, 1, 0, 1, 0, 0}, + {0, 0, 0, 0, 1, 1}, + {0, 0, 0, 0, 1, 1}, + }, + []int{0, 2, 4}, + 4, + }, + + { + [][]int{ + {1, 1, 0, 1, 0}, + {1, 1, 1, 1, 0}, + {0, 1, 1, 0, 0}, + {1, 1, 0, 1, 0}, + {0, 0, 0, 0, 1}, + }, + []int{0, 2, 4}, + 0, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 1}, {0, 1, 1}}, + []int{0, 1}, + 1, + }, + + { + [][]int{ + {1, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1, 0, 1, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 1}, + }, + []int{6, 0, 4}, + 0, + }, + + { + [][]int{{1, 1, 0, 0}, {1, 1, 1, 0}, {0, 1, 1, 1}, {0, 0, 1, 1}}, + []int{0, 1}, + 1, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}, + []int{0}, + 0, + }, + + { + [][]int{{1, 1, 0}, {1, 1, 0}, {0, 0, 1}}, + []int{0, 1}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_minMalwareSpread(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minMalwareSpread(tc.graph, tc.initial), "输入:%v", tc) + } +} + +func Benchmark_minMalwareSpread(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minMalwareSpread(tc.graph, tc.initial) + } + } +} diff --git a/Algorithms/0929.unique-email-addresses/README.md b/Algorithms/0929.unique-email-addresses/README.md new file mode 100755 index 000000000..33803928b --- /dev/null +++ b/Algorithms/0929.unique-email-addresses/README.md @@ -0,0 +1,29 @@ +# [929. Unique Email Addresses](https://leetcode.com/problems/unique-email-addresses/) + +Every email consists of a local name and a domain name, separated by the @ sign. + +For example, in `alice@leetcode.com`, `alice` is the local name, and `leetcode.com` is the domain name. + +Besides lowercase letters, these emails may contain `.`s or `+`s. + +If you add periods (`.`) between some characters in the **local name** part of an email address, mail sent there will be forwarded to the same address without dots in the **local name**. For example, `"alice.z@leetcode.com"` and `"alicez@leetcode.com"` forward to the same email address. (Note that this rule does not apply for domain names.) + +If you add a plus (`+`) in the **local name**, everything after the first plus sign will be ignored. This allows certain emails to be filtered, for example `m.y+name@email.com` will be forwarded to `my@email.com`. (Again, this rule does not apply for domain names.) + +It is possible to use both of these rules at the same time. + +Given a list of `emails`, we send one email to each address in the list. How many different addresses actually receive mails? + +Example 1: + +```text +Input: ["test.email+alex@leetcode.com","test.e.mail+bob.cathy@leetcode.com","testemail+david@lee.tcode.com"] +Output: 2 +Explanation: "testemail@leetcode.com" and "testemail@lee.tcode.com" actually receive mails +``` + +Note: + +1. `1 <= emails[i].length <= 100` +1. `1 <= emails.length <= 100` +1. Each `emails[i]` contains exactly one `@` character. diff --git a/Algorithms/0929.unique-email-addresses/unique-email-addresses.go b/Algorithms/0929.unique-email-addresses/unique-email-addresses.go new file mode 100755 index 000000000..33f1eace0 --- /dev/null +++ b/Algorithms/0929.unique-email-addresses/unique-email-addresses.go @@ -0,0 +1,31 @@ +package problem0929 + +import ( + "strings" +) + +func numUniqueEmails(emails []string) int { + hasSeen := make(map[string]bool, 100) + for _, email := range emails { + hasSeen[clean(email)] = true + } + return len(hasSeen) +} + +func clean(email string) string { + i := strings.IndexByte(email, '@') + user, atDomain := email[:i], email[i:] + return deleteDot(trim(user)) + atDomain +} + +func deleteDot(username string) string { + return strings.Replace(username, ".", "", -1) +} + +func trim(username string) string { + i := strings.IndexByte(username, '+') + if i == -1 { + return username + } + return username[:i] +} diff --git a/Algorithms/0929.unique-email-addresses/unique-email-addresses_test.go b/Algorithms/0929.unique-email-addresses/unique-email-addresses_test.go new file mode 100755 index 000000000..68ee2950d --- /dev/null +++ b/Algorithms/0929.unique-email-addresses/unique-email-addresses_test.go @@ -0,0 +1,47 @@ +package problem0929 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + emails []string + ans int +}{ + + { + []string{"test.email@leetcode.com", "test.e.mai+bob.cathy@leetcode.com"}, + 2, + }, + + { + []string{"test.email+alex@leetcode.com", "test.e.mai+bob.cathy@leetcode.com"}, + 2, + }, + + { + []string{"test.email+alex@leetcode.com", "test.e.mail+bob.cathy@leetcode.com", "testemail+david@lee.tcode.com"}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_numUniqueEmails(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numUniqueEmails(tc.emails), "输入:%v", tc) + } +} + +func Benchmark_numUniqueEmails(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numUniqueEmails(tc.emails) + } + } +} diff --git a/Algorithms/0930.binary-subarrays-with-sum/README.md b/Algorithms/0930.binary-subarrays-with-sum/README.md new file mode 100755 index 000000000..ef4f7ad7b --- /dev/null +++ b/Algorithms/0930.binary-subarrays-with-sum/README.md @@ -0,0 +1,22 @@ +# [930. Binary Subarrays With Sum](https://leetcode.com/problems/binary-subarrays-with-sum/) + +In an array A of 0s and 1s, how many non-empty subarrays have sum S? + +Example 1: + +```text +Input: A = [1,0,1,0,1], S = 2 +Output: 4 +Explanation: +The 4 subarrays are bolded below: +[1,0,1,0,1] +[1,0,1,0,1] +[1,0,1,0,1] +[1,0,1,0,1] +``` + +Note: + +1. `A.length <= 30000` +1. `0 <= S <= A.length` +1. `A[i] is either 0 or 1.` \ No newline at end of file diff --git a/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum.go b/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum.go new file mode 100755 index 000000000..1733d92e0 --- /dev/null +++ b/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum.go @@ -0,0 +1,17 @@ +package problem0930 + +// ref: https://leetcode.com/problems/binary-subarrays-with-sum/discuss/186683/C%2B%2BJavaPython-Straight-Forward + +func numSubarraysWithSum(A []int, S int) int { + preSum, res := 0, 0 + count := make([]int, len(A)+1) + count[0] = 1 + for _, n := range A { + preSum += n + if preSum >= S { + res += count[preSum-S] + } + count[preSum]++ + } + return res +} diff --git a/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum_test.go b/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum_test.go new file mode 100755 index 000000000..ebb6baa21 --- /dev/null +++ b/Algorithms/0930.binary-subarrays-with-sum/binary-subarrays-with-sum_test.go @@ -0,0 +1,63 @@ +package problem0930 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + S int + ans int +}{ + + { + []int{1, 1, 1, 1, 1, 1, 1, 1}, + 6, + 3, + }, + + { + []int{0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + 0, + 27, + }, + + { + []int{0, 0, 0, 0, 1}, + 2, + 0, + }, + + { + []int{0, 0, 0, 0, 0}, + 0, + 15, + }, + + { + []int{1, 0, 1, 0, 1}, + 2, + 4, + }, + + // 可以有多个 testcase +} + +func Test_numSubarraysWithSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numSubarraysWithSum(tc.A, tc.S), "输入:%v", tc) + } +} + +func Benchmark_numSubarraysWithSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSubarraysWithSum(tc.A, tc.S) + } + } +} diff --git a/Algorithms/0931.minimum-falling-path-sum/README.md b/Algorithms/0931.minimum-falling-path-sum/README.md new file mode 100755 index 000000000..1228d815e --- /dev/null +++ b/Algorithms/0931.minimum-falling-path-sum/README.md @@ -0,0 +1,25 @@ +# [931. Minimum Falling Path Sum](https://leetcode.com/problems/minimum-falling-path-sum/) + +Given a **square** array of integers `A`, we want the **minimum** sum of a *falling* path through `A`. + +A falling path starts at any element in the first row, and chooses one element from each row. The next row's choice must be in a column that is different from the previous row's column by at most one. + +Example 1: + +```text +Input: [[1,2,3],[4,5,6],[7,8,9]] +Output: 12 +Explanation: +The possible falling paths are: +``` + +- `[1,4,7], [1,4,8], [1,5,7], [1,5,8], [1,5,9]` +- `[2,4,7], [2,4,8], [2,5,7], [2,5,8], [2,5,9], [2,6,8], [2,6,9]` +- `[3,5,7], [3,5,8], [3,5,9], [3,6,8], [3,6,9]` + +The falling path with the smallest sum is `[1,4,7]`, so the answer is `12`. + +Note: + +1. `1 <= A.length == A[0].length <= 100` +1. `-100 <= A[i][j] <= 100` diff --git a/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum.go b/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum.go new file mode 100755 index 000000000..03b618195 --- /dev/null +++ b/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum.go @@ -0,0 +1,44 @@ +package problem0931 + +const maxSum = 10000 + +func minFallingPathSum(A [][]int) int { + size := len(A) + + dp := make([]int, size) + copy(dp, A[0]) + + for i := 1; i < size; i++ { + tmps := [100]int{} + for j := 0; j < size; j++ { + a, tmp := A[i][j], maxSum + l, r := max(j-1, 0), min(j+1, size-1) + for k := l; k <= r; k++ { + tmp = min(tmp, a+dp[k]) + } + tmps[j] = tmp + } + dp = tmps[:size] + } + + res := maxSum + for i := 0; i < size; i++ { + res = min(res, dp[i]) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum_test.go b/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum_test.go new file mode 100755 index 000000000..a0c8b0b89 --- /dev/null +++ b/Algorithms/0931.minimum-falling-path-sum/minimum-falling-path-sum_test.go @@ -0,0 +1,68 @@ +package problem0931 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans int +}{ + + { + [][]int{ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }, + 12, + }, + + { + [][]int{ + {-19, -1, -96, 48, -94, 36, 16, 55, -42, 37, -59, 6, -32, 96, 95, -58, 13, -34, 94, 85}, + {17, 44, 36, -29, 84, 80, -34, 50, -99, 64, 13, 91, -27, 25, -36, 57, 20, 98, -100, -72}, + {-92, -75, 86, 90, -4, 90, 64, 56, 50, -63, 10, -15, 90, -66, -66, 32, -69, -78, 1, 60}, + {21, 51, -47, -43, -14, 99, 44, 90, 8, 11, 99, -62, 57, 59, 69, 50, -69, 32, 85, 13}, + {-28, 90, 12, -18, 23, 61, -55, -97, 6, 89, 36, 26, 26, -1, 46, -50, 79, -45, 89, 86}, + {-85, -10, 49, -10, 2, 62, 41, 92, -67, 85, 86, 27, 89, -50, 77, 55, 22, -82, -94, -98}, + {-50, 53, -23, 55, 25, -22, 76, -93, -7, 66, -75, 42, -35, -96, -5, 4, -92, 13, -31, -100}, + {-62, -78, 8, -92, 86, 69, 90, -37, 81, 97, 53, -45, 34, 19, -19, -39, -88, -75, -74, -4}, + {29, 53, -91, 65, -92, 11, 49, 26, 90, -31, 17, -84, 12, 63, -60, -48, 40, -49, -48, 88}, + {100, -69, 80, 11, -93, 17, 28, -94, 52, 64, -86, 30, -9, -53, -8, -68, -33, 31, -5, 11}, + {9, 64, -31, 63, -84, -15, -30, -10, 67, 2, 98, 73, -77, -37, -96, 47, -97, 78, -62, -17}, + {-88, -38, -22, -90, 54, 42, -29, 67, -85, -90, -29, 81, 52, 35, 13, 61, -18, -94, 61, -62}, + {-23, -29, -76, -30, -65, 23, 31, -98, -9, 11, 75, -1, -84, -90, 73, 58, 72, -48, 30, -81}, + {66, -33, 91, -6, -94, 82, 25, -43, -93, -25, -69, 10, -71, -65, 85, 28, -52, 76, 25, 90}, + {-3, 78, 36, -92, -52, -44, -66, -53, -55, 76, -7, 76, -73, 13, -98, 86, -99, -22, 61, 100}, + {-97, 65, 2, -93, 56, -78, 22, 56, 35, -24, -95, -13, 83, -34, -51, -73, 2, 7, -86, -19}, + {32, 94, -14, -13, -6, -55, -21, 29, -21, 16, 67, 100, 77, -26, -96, 22, -5, -53, -92, -36}, + {60, 93, -79, 76, -91, 43, -95, -16, 74, -21, 85, 43, 21, -68, -32, -18, 18, 100, -43, 1}, + {87, -31, 26, 53, 26, 51, -61, 92, -65, 17, -41, 27, -42, -14, 37, -46, 46, -31, -74, 23}, + {-67, -14, -20, -85, 42, 36, 56, 9, 11, -66, -59, -55, 5, 64, -29, 77, 47, 44, -33, -77}, + }, + -1428, + }, + + // 可以有多个 testcase +} + +func Test_minFallingPathSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + + ast.Equal(tc.ans, minFallingPathSum(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minFallingPathSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minFallingPathSum(tc.A) + } + } +} diff --git a/Algorithms/0932.beautiful-array/README.md b/Algorithms/0932.beautiful-array/README.md new file mode 100755 index 000000000..477e87499 --- /dev/null +++ b/Algorithms/0932.beautiful-array/README.md @@ -0,0 +1,25 @@ +# [932. Beautiful Array](https://leetcode.com/problems/beautiful-array/) + +For some fixed `N`, an array `A` is *beautiful* if it is a permutation of the integers `1, 2, ..., N`, such that: + +For every `i < j`, there is **no** `k` with `i < k < j` such that `A[k] * 2 = A[i] + A[j]`. + +Given `N`, return **any** beautiful array `A`. (It is guaranteed that one exists.) + +Example 1: + +```text +Input: 4 +Output: [2,1,4,3] +``` + +Example 2: + +```text +Input: 5 +Output: [3,1,2,5,4] +``` + +Note: + +- `1 <= N <= 1000` diff --git a/Algorithms/0932.beautiful-array/beautiful-array.go b/Algorithms/0932.beautiful-array/beautiful-array.go new file mode 100755 index 000000000..f90cf08b7 --- /dev/null +++ b/Algorithms/0932.beautiful-array/beautiful-array.go @@ -0,0 +1,46 @@ +package problem0932 + +// ref: https://leetcode.com/problems/beautiful-array/discuss/186679/C%2B%2BJavaPython-Odd-%2B-Even-Pattern-O(N) +// + +func beautifulArray(N int) []int { + res := []int{1} + for len(res) < N { + tmp := make([]int, 0, len(res)*2) + for _, v := range res { + if v*2-1 <= N { + tmp = append(tmp, v*2-1) + } + } + for _, v := range res { + if v*2 <= N { + tmp = append(tmp, v*2) + } + } + res = tmp + } + + return res +} + +/** + * 以 N == 10 为例,res 的变化过程是 + * [1] + * [1 2] + * [1 3 2 4] + * [1 5 3 7 2 6 4 8] + * [1 9 5 13 3 11 7 15 2 10 6 14 4 12 8 16] + * 长度超过 N,进行裁剪,删除 >N=10 的数字。裁剪不改变 beautiful + * [1 9 5 3 7 2 10 6 4 8] + * + * 每个下一行的 + * 左半部分,都是 上一行×2-1 + * 右半部分,都是 上一行×2 + * 由文章中证明,× 和 - 不会改变 beautiful + * 所以,左右两边都是 beautiful 的 + * + * 左右合并的时候,只需要讨论 Ai 和 Aj 分别位于左右两边的情况。 + * 左边的 Ai 是奇数,右边的 Aj 是偶数。所以 Ai+Aj 是奇数。 + * 而 Ak×2 是偶数,所以,不存在 Ak×2 == Ai+Aj + * A 仍然是 beautiful 的 + */ diff --git a/Algorithms/0932.beautiful-array/beautiful-array_test.go b/Algorithms/0932.beautiful-array/beautiful-array_test.go new file mode 100755 index 000000000..b384843d2 --- /dev/null +++ b/Algorithms/0932.beautiful-array/beautiful-array_test.go @@ -0,0 +1,78 @@ +package problem0932 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int +}{ + + { + 4, + }, + + { + 5, + }, + + { + 10, + }, + + { + 1000, + }, + + // 可以有多个 testcase +} + +func isBeautiful(A []int) bool { + size := len(A) + for i := 0; i < size; i++ { + for j := i + 2; j < size; j++ { + AiPlusAj := A[i] + A[j] + for k := i + 1; k < j; k++ { + Ak := A[k] + if Ak*2 == AiPlusAj || Ak > size { + fmt.Println(A[i], A[k], A[j]) + return false + } + } + } + } + return true +} + +func Test_checkArray(t *testing.T) { + ast := assert.New(t) + + results := [][]int{ + {2, 1, 4, 5, 3}, + {3, 5, 1, 2, 4}, + } + + for _, r := range results { + ast.True(isBeautiful(r)) + } +} + +func Test_beautifulArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.True(isBeautiful(beautifulArray(tc.N)), "输入:%v", tc) + } +} + +func Benchmark_beautifulArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + beautifulArray(tc.N) + } + } +} diff --git a/Algorithms/0933.number-of-recent-calls/README.md b/Algorithms/0933.number-of-recent-calls/README.md new file mode 100755 index 000000000..a3ea4f659 --- /dev/null +++ b/Algorithms/0933.number-of-recent-calls/README.md @@ -0,0 +1,24 @@ +# [933. Number of Recent Calls](https://leetcode.com/problems/number-of-recent-calls/) + +Write a class `RecentCounter` to count recent requests. + +It has only one method: `ping(int t)`, where t represents some time in milliseconds. + +Return the number of `pings` that have been made from 3000 milliseconds ago until now. + +Any ping with time in `[t - 3000, t]` will count, including the current ping. + +It is guaranteed that every call to `ping` uses a strictly larger value of `t` than before. + +Example 1: + +```text +Input: inputs = ["RecentCounter","ping","ping","ping","ping"], inputs = [[],[1],[100],[3001],[3002]] +Output: [null,1,2,3,3] +``` + +Note: + +1. Each test case will have at most 10000 calls to ping. +1. Each test case will call ping with strictly increasing values of t. +1. Each call to ping will have 1 <= t <= 10^9. \ No newline at end of file diff --git a/Algorithms/0933.number-of-recent-calls/number-of-recent-calls.go b/Algorithms/0933.number-of-recent-calls/number-of-recent-calls.go new file mode 100755 index 000000000..43580838d --- /dev/null +++ b/Algorithms/0933.number-of-recent-calls/number-of-recent-calls.go @@ -0,0 +1,27 @@ +package problem0933 + +import "sort" + +/** + * Your RecentCounter object will be instantiated and called as such: + * obj := Constructor(); + * param_1 := obj.Ping(t); + */ + +// RecentCounter ... +type RecentCounter struct { + times []int +} + +// Constructor ... +func Constructor() RecentCounter { + return RecentCounter{ + times: make([]int, 0, 10000), + } +} + +// Ping use binary search +func (rc *RecentCounter) Ping(t int) int { + rc.times = append(rc.times, t) + return len(rc.times) - sort.SearchInts(rc.times, t-3000) +} diff --git a/Algorithms/0933.number-of-recent-calls/number-of-recent-calls_test.go b/Algorithms/0933.number-of-recent-calls/number-of-recent-calls_test.go new file mode 100755 index 000000000..8c7fbb5bc --- /dev/null +++ b/Algorithms/0933.number-of-recent-calls/number-of-recent-calls_test.go @@ -0,0 +1,21 @@ +package problem0933 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_myFunc(t *testing.T) { + ast := assert.New(t) + + rc := Constructor() + + times := []int{1, 100, 3001, 3002} + counters := []int{1, 2, 3, 3} + + for i := range times { + t, c := times[i], counters[i] + ast.Equal(c, rc.Ping(t)) + } +} diff --git a/Algorithms/0934.shortest-bridge/README.md b/Algorithms/0934.shortest-bridge/README.md new file mode 100755 index 000000000..25ed6cb49 --- /dev/null +++ b/Algorithms/0934.shortest-bridge/README.md @@ -0,0 +1,33 @@ +# [934. Shortest Bridge](https://leetcode.com/problems/shortest-bridge/) + +In a given 2D binary array `A`, there are two islands. (An island is a 4-directionally connected group of `1s` not connected to any other 1s.) + +Now, we may change `0s` to `1s` so as to connect the two islands together to form 1 island. + +Return the smallest number of `0s` that must be flipped. (It is guaranteed that the answer is at least 1.) + +Example 1: + +```text +Input: [[0,1],[1,0]] +Output: 1 +``` + +Example 2: + +```text +Input: [[0,1,0],[0,0,0],[0,0,1]] +Output: 2 +``` + +Example 3: + +```text +Input: [[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]] +Output: 1 +``` + +Note: + +1. `1 <= A.length = A[0].length <= 100` +1. `A[i][j] == 0` or `A[i][j] == 1` diff --git a/Algorithms/0934.shortest-bridge/shortest-bridge.go b/Algorithms/0934.shortest-bridge/shortest-bridge.go new file mode 100755 index 000000000..65c96b0ab --- /dev/null +++ b/Algorithms/0934.shortest-bridge/shortest-bridge.go @@ -0,0 +1,73 @@ +package problem0934 + +var dx = []int{1, -1, 0, 0} +var dy = []int{0, 0, 1, -1} + +func shortestBridge(A [][]int) int { + m, n := len(A), len(A[0]) + + p, q := searchForIsland(A) + + isChecked := [100][100]bool{} + isChecked[p][q] = true + + island := make([][]int, 0, 1024) + island = append(island, []int{p, q}) + + // bfs 查找岛中全部的点 + for idx := 0; idx < len(island); idx++ { + i, j := island[idx][0], island[idx][1] + for l := 0; l < 4; l++ { + x, y := i+dx[l], j+dy[l] + if 0 <= x && x < m && + 0 <= y && y < n && + A[x][y] == 1 && + !isChecked[x][y] { + island = append(island, []int{x, y}) + isChecked[x][y] = true + } + } + } + + bridge := island + length := 0 + + // 此时, bridge 中所有的点,在 isChecked 中都被标记为 true + + // bfs 查找最短的桥 + for len(bridge) > 0 { + size := len(bridge) + for idx := 0; idx < size; idx++ { + land := bridge[idx] + i, j := land[0], land[1] + for l := 0; l < 4; l++ { + x, y := i+dx[l], j+dy[l] + if 0 <= x && x < m && + 0 <= y && y < n && + !isChecked[x][y] { + if A[x][y] == 1 { + return length + } + A[x][y] = 1 + bridge = append(bridge, []int{x, y}) + isChecked[x][y] = true + } + } + } + bridge = bridge[size:] + length++ + } + + panic("A has only one island") +} + +func searchForIsland(A [][]int) (int, int) { + for i := 0; i < len(A); i++ { + for j := 0; j < len(A[0]); j++ { + if A[i][j] == 1 { + return i, j + } + } + } + panic("A has NO island.") +} diff --git a/Algorithms/0934.shortest-bridge/shortest-bridge_test.go b/Algorithms/0934.shortest-bridge/shortest-bridge_test.go new file mode 100755 index 000000000..3d8840c56 --- /dev/null +++ b/Algorithms/0934.shortest-bridge/shortest-bridge_test.go @@ -0,0 +1,69 @@ +package problem0934 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans int +}{ + + { + [][]int{ + {0, 1, 0}, + {0, 0, 0}, + {0, 0, 1}, + }, + 2, + }, + + { + [][]int{ + {0, 1}, + {1, 0}, + }, + 1, + }, + + { + [][]int{ + {1, 1, 1, 1, 1}, + {1, 0, 0, 0, 1}, + {1, 0, 1, 0, 1}, + {1, 0, 0, 0, 1}, + {1, 1, 1, 1, 1}, + }, + 1, + }, + + // 可以有多个 testcase +} + +func Test_shortestBridge(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + ast.Equal(tc.ans, shortestBridge(tc.A), "输入:%v", tc) + } +} + +func Benchmark_shortestBridge(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestBridge(tc.A) + } + } +} + +func Test_searchForIsland_panicWithNoIsland(t *testing.T) { + ast := assert.New(t) + ast.Panics(func() { searchForIsland([][]int{}) }) +} + +func Test_shortestBridge_panicWithOnlyOneIsland(t *testing.T) { + ast := assert.New(t) + ast.Panics(func() { shortestBridge([][]int{{1, 0}}) }) +} diff --git a/Algorithms/0935.knight-dialer/README.md b/Algorithms/0935.knight-dialer/README.md new file mode 100755 index 000000000..0c3b85908 --- /dev/null +++ b/Algorithms/0935.knight-dialer/README.md @@ -0,0 +1,51 @@ +# [935. Knight Dialer](https://leetcode.com/problems/knight-dialer/) + +A chess knight can move as indicated in the chess diagram below: + +![knight](knight.png) + +![keypad](keypad.png) + +This time, we place our chess knight on any numbered key of a phone pad (indicated above), and the knight makes `N-1` hops. Each hop must be from one key to another numbered key. + +Each time it lands on a key (including the initial placement of the knight), it presses the number of that key, pressing N digits total. + +How many distinct numbers can you dial in this manner? + +Since the answer may be large, **output the answer modulo 10^9 + 7**. + +Example 1: + +```text +Input: 1 +Output: 10 +``` + +Example 2: + +```text +Input: 2 +Output: 20 +``` + +Example 3: + +```text +Input: 3 +Output: 46 +``` + +Note: + +- `1 <= N <= 5000` + +## 提醒 + +```text +1 2 3 +4 5 6 +7 8 9 +* 0 # +``` + +4 可以到达 0, 4 -> 7 -> * -> 0。同理,6 也可以达到 0。 diff --git a/Algorithms/0935.knight-dialer/keypad.png b/Algorithms/0935.knight-dialer/keypad.png new file mode 100644 index 000000000..4dae52779 Binary files /dev/null and b/Algorithms/0935.knight-dialer/keypad.png differ diff --git a/Algorithms/0935.knight-dialer/knight-dialer.go b/Algorithms/0935.knight-dialer/knight-dialer.go new file mode 100755 index 000000000..d16060cec --- /dev/null +++ b/Algorithms/0935.knight-dialer/knight-dialer.go @@ -0,0 +1,56 @@ +package problem0935 + +const mod = 1e9 + 7 + +var rec = [5000][10]int{} + +var hop = [][]int{ + {4, 6}, // from 0 + {6, 8}, // from 1 + {7, 9}, // from 2 + {4, 8}, // from 3 + {3, 9, 0}, // from 4, 4 -> 7 -> * -> 0 + {}, // from 5 + {0, 1, 7}, // from 6 + {2, 6}, // from 7 + {1, 3}, // from 8 + {2, 4}, // from 9 +} + +func knightDialer(N int) int { + if N == 1 { + // now can chose 5 + return 10 + } + + res := 0 + for i := 0; i < 10; i++ { + res += recur(N-1, i, &rec) + } + + return res % mod +} + +func recur(N, digit int, rec *[5000][10]int) int { + r := (*rec)[N][digit] + if r > 0 { + return r + } + + h := hop[digit] + + if N == 1 { + l := len(h) + (*rec)[N][digit] = l + return l + } + + res := 0 + for _, d := range h { + res += recur(N-1, d, rec) + } + res %= mod + + (*rec)[N][digit] = res + return res +} diff --git a/Algorithms/0935.knight-dialer/knight-dialer_test.go b/Algorithms/0935.knight-dialer/knight-dialer_test.go new file mode 100755 index 000000000..55f8ba6f4 --- /dev/null +++ b/Algorithms/0935.knight-dialer/knight-dialer_test.go @@ -0,0 +1,52 @@ +package problem0935 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 1, + 10, + }, + + { + 2, + 20, + }, + + { + 3, + 46, + }, + + { + 5000, + 406880451, + }, + + // 可以有多个 testcase +} + +func Test_knightDialer(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, knightDialer(tc.N), "输入:%v", tc) + } +} + +func Benchmark_knightDialer(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + knightDialer(tc.N) + } + } +} diff --git a/Algorithms/0935.knight-dialer/knight.png b/Algorithms/0935.knight-dialer/knight.png new file mode 100644 index 000000000..b3cd5dd8e Binary files /dev/null and b/Algorithms/0935.knight-dialer/knight.png differ diff --git a/Algorithms/0936.stamping-the-sequence/README.md b/Algorithms/0936.stamping-the-sequence/README.md new file mode 100755 index 000000000..d2af83621 --- /dev/null +++ b/Algorithms/0936.stamping-the-sequence/README.md @@ -0,0 +1,35 @@ +# [936. Stamping The Sequence](https://leetcode.com/problems/stamping-the-sequence/) + +You want to form a target string of lowercase letters. + +At the beginning, your sequence is target.length '?' marks. You also have a stamp of lowercase letters. + +On each turn, you may place the stamp over the sequence, and replace every letter in the sequence with the corresponding letter from the stamp. You can make up to 10 * target.length turns. + +For example, if the initial sequence is "?????", and your stamp is "abc", then you may make "abc??", "?abc?", "??abc" in the first turn. (Note that the stamp must be fully contained in the boundaries of the sequence in order to stamp.) + +If the sequence is possible to stamp, then return an array of the index of the left-most letter being stamped at each turn. If the sequence is not possible to stamp, return an empty array. + +For example, if the sequence is "ababc", and the stamp is "abc", then we could return the answer [0, 2], corresponding to the moves "?????" -> "abc??" -> "ababc". + +Also, if the sequence is possible to stamp, it is guaranteed it is possible to stamp within 10 * target.length moves. Any answers specifying more than this number of moves will not be accepted. + +Example 1: + +```text +Input: stamp = "abc", target = "ababc" +Output: [0,2] +([1,0,2] would also be accepted as an answer, as well as some other answers.) +``` + +Example 2: + +```text +Input: stamp = "abca", target = "aabcaca" +Output: [3,0,1] +``` + +Note: + +- 1 <= stamp.length <= target.length <= 1000 +- stamp and target only contain lowercase letters. diff --git a/Algorithms/0936.stamping-the-sequence/stamping-the-sequence.go b/Algorithms/0936.stamping-the-sequence/stamping-the-sequence.go new file mode 100755 index 000000000..7f054eb32 --- /dev/null +++ b/Algorithms/0936.stamping-the-sequence/stamping-the-sequence.go @@ -0,0 +1,62 @@ +package problem0936 + +import "strings" + +// ref: https://leetcode.com/problems/stamping-the-sequence/discuss/189254/Python-Greedy-and-DFS + +func movesToStamp(stamp string, target string) []int { + s, t := []byte(stamp), []byte(target) + sSize, tSize := len(stamp), len(target) + + res := make([]int, 0, 1000) + + // isStamped return true if stamped since i + isStamped := func(i int) bool { + canStamp := false + for j := 0; j < sSize; j++ { + if t[i+j] == '?' { + continue + } + if t[i+j] != s[j] { + return false + } + canStamp = true + } + if canStamp { + for k := i; k < i+sSize; k++ { + t[k] = '?' + } + res = append(res, i) + } + return canStamp + } + + maxIndex := tSize - sSize + 1 + + for { + isChanged := false + for i := 0; i < maxIndex; i++ { + isChanged = isChanged || isStamped(i) + } + if !isChanged { + // no more place to stamp + break + } + } + + reverse(res) + + if string(t) == strings.Repeat("?", tSize) { + return res + } + return nil +} + +func reverse(a []int) { + l, r := 0, len(a)-1 + for l < r { + a[l], a[r] = a[r], a[l] + l++ + r-- + } +} diff --git a/Algorithms/0936.stamping-the-sequence/stamping-the-sequence_test.go b/Algorithms/0936.stamping-the-sequence/stamping-the-sequence_test.go new file mode 100755 index 000000000..37cf81785 --- /dev/null +++ b/Algorithms/0936.stamping-the-sequence/stamping-the-sequence_test.go @@ -0,0 +1,72 @@ +package problem0936 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stamp string + target string +}{ + + { + "ab", + "aba", + }, + + { + "abc", + "ababc", + }, + + { + "abca", + "aabcaca", + }, + + // +} + +func isCorrect(stamp, target string, sequence []int) bool { + if len(sequence) > 10*len(target) { + return false + } + sb := []byte(stamp) + lt := len(target) + tb := make([]byte, lt*2) + for _, i := range sequence { + copy(tb[i:], sb) + } + stb := string(tb[:lt]) + if stb != target && len(sequence) != 0 { + fmt.Println(stamp, target, sequence) + return false + } + return true +} + +func Test_isCorrect(t *testing.T) { + ast := assert.New(t) + ast.True(isCorrect("aba", "ababa", []int{0, 2})) + ast.True(isCorrect("aba", "ababa", []int{2, 0})) +} + +func Test_movesToStamp(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + seq := movesToStamp(tc.stamp, tc.target) + ast.True(isCorrect(tc.stamp, tc.target, seq)) + } +} + +func Benchmark_movesToStamp(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + movesToStamp(tc.stamp, tc.target) + } + } +} diff --git a/Algorithms/0937.reorder-log-files/README.md b/Algorithms/0937.reorder-log-files/README.md new file mode 100755 index 000000000..bc9ef86c7 --- /dev/null +++ b/Algorithms/0937.reorder-log-files/README.md @@ -0,0 +1,27 @@ +# [937. Reorder Log Files](https://leetcode.com/problems/reorder-log-files/) + +You have an array of `logs`. Each log is a space delimited string of words. + +For each log, the first word in each log is an alphanumeric identifier. Then, either: + +- Each word after the identifier will consist only of lowercase letters, or; +- Each word after the identifier will consist only of digits. + +We will call these two varieties of logs letter-logs and digit-logs. It is guaranteed that each log has at least one word after its identifier. + +Reorder the logs so that all of the letter-logs come before any digit-log. The letter-logs are ordered lexicographically ignoring identifier, with the identifier used in case of ties. The digit-logs should be put in their original order. + +Return the final order of the logs. + +Example 1: + +```text +Input: ["a1 9 2 3 1","g1 act car","zo4 4 7","ab1 off key dog","a8 act zoo"] +Output: ["g1 act car","a8 act zoo","ab1 off key dog","a1 9 2 3 1","zo4 4 7"] +``` + +Note: + +1. `0 <= logs.length <= 100` +1. `3 <= logs[i].length <= 100` +1. `logs[i]` is guaranteed to have an identifier, and a word after the identifier. diff --git a/Algorithms/0937.reorder-log-files/reorder-log-files.go b/Algorithms/0937.reorder-log-files/reorder-log-files.go new file mode 100755 index 000000000..5c1255a35 --- /dev/null +++ b/Algorithms/0937.reorder-log-files/reorder-log-files.go @@ -0,0 +1,23 @@ +package problem0937 + +import ( + "sort" + "strings" + "unicode" +) + +func reorderLogFiles(logs []string) []string { + sort.SliceStable(logs, func(i, j int) bool { + s1 := strings.SplitN(logs[i], " ", 2) + s2 := strings.SplitN(logs[j], " ", 2) + f1, f2 := "0"+s1[1], "0"+s2[1] + if unicode.IsNumber(rune(f1[1])) { + f1 = "1" + } + if unicode.IsNumber(rune(f2[1])) { + f2 = "1" + } + return f1 < f2 + }) + return logs +} diff --git a/Algorithms/0937.reorder-log-files/reorder-log-files_test.go b/Algorithms/0937.reorder-log-files/reorder-log-files_test.go new file mode 100755 index 000000000..ec304f762 --- /dev/null +++ b/Algorithms/0937.reorder-log-files/reorder-log-files_test.go @@ -0,0 +1,37 @@ +package problem0937 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + logs []string + ans []string +}{ + + { + []string{"a1 9 2 3 1", "g1 act car", "zo4 4 7", "ab1 off key dog", "a8 act zoo"}, + []string{"g1 act car", "a8 act zoo", "ab1 off key dog", "a1 9 2 3 1", "zo4 4 7"}, + }, + + // 可以有多个 testcase +} + +func Test_reorderLogFiles(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, reorderLogFiles(tc.logs), "输入:%v", tc) + } +} + +func Benchmark_reorderLogFiles(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reorderLogFiles(tc.logs) + } + } +} diff --git a/Algorithms/0938.range-sum-of-bst/README.md b/Algorithms/0938.range-sum-of-bst/README.md new file mode 100755 index 000000000..1cc4b3929 --- /dev/null +++ b/Algorithms/0938.range-sum-of-bst/README.md @@ -0,0 +1,24 @@ +# [938. Range Sum of BST](https://leetcode.com/problems/range-sum-of-bst/) + +Given the `root` node of a binary search tree, return the sum of values of all nodes with value between `L` and `R` (inclusive). + +The binary search tree is guaranteed to have unique values. + +Example 1: + +```text +Input: root = [10,5,15,3,7,null,18], L = 7, R = 15 +Output: 32 +``` + +Example 2: + +```text +Input: root = [10,5,15,3,7,13,18,1,null,6], L = 6, R = 10 +Output: 23 +``` + +Note: + +1. The number of nodes in the tree is at most `10000`. +1. The final answer is guaranteed to be less than `2^31`. \ No newline at end of file diff --git a/Algorithms/0938.range-sum-of-bst/range-sum-of-bst.go b/Algorithms/0938.range-sum-of-bst/range-sum-of-bst.go new file mode 100755 index 000000000..89e2e4090 --- /dev/null +++ b/Algorithms/0938.range-sum-of-bst/range-sum-of-bst.go @@ -0,0 +1,27 @@ +package problem0938 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is Definition for a binary tree node. +type TreeNode = kit.TreeNode + +func rangeSumBST(root *TreeNode, L int, R int) int { + if root == nil { + return 0 + } + + sum := 0 + + switch { + case root.Val < L: + sum = rangeSumBST(root.Right, L, R) + case R < root.Val: + sum = rangeSumBST(root.Left, L, R) + default: + sum = root.Val + sum += rangeSumBST(root.Left, L, R) + sum += rangeSumBST(root.Right, L, R) + } + + return sum +} diff --git a/Algorithms/0938.range-sum-of-bst/range-sum-of-bst_test.go b/Algorithms/0938.range-sum-of-bst/range-sum-of-bst_test.go new file mode 100755 index 000000000..b1797edff --- /dev/null +++ b/Algorithms/0938.range-sum-of-bst/range-sum-of-bst_test.go @@ -0,0 +1,51 @@ +package problem0938 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + L int + R int + ans int +}{ + + { + []int{10, 5, 15, 3, 7, kit.NULL, 18}, + 7, + 15, + 32, + }, + + { + []int{10, 5, 15, 3, 7, 13, 18, 1, kit.NULL, 6}, + 6, + 10, + 23, + }, + + // 可以有多个 testcase +} + +func Test_rangeSumBST(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, rangeSumBST(root, tc.L, tc.R), "输入:%v", tc) + } +} + +func Benchmark_rangeSumBST(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + rangeSumBST(root, tc.L, tc.R) + } + } +} diff --git a/Algorithms/0939.minimum-area-rectangle/README.md b/Algorithms/0939.minimum-area-rectangle/README.md new file mode 100755 index 000000000..ef722d0dd --- /dev/null +++ b/Algorithms/0939.minimum-area-rectangle/README.md @@ -0,0 +1,26 @@ +# [939. Minimum Area Rectangle](https://leetcode.com/problems/minimum-area-rectangle/) + +Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes. + +If there isn't any rectangle, return 0. + +Example 1: + +```text +Input: [[1,1],[1,3],[3,1],[3,3],[2,2]] +Output: 4 +``` + +Example 2: + +```text +Input: [[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]] +Output: 2 +``` + +Note: + +1. `1 <= points.length <= 500` +1. `0 <= points[i][0] <= 40000` +1. `0 <= points[i][1] <= 40000` +1. All points are distinct. \ No newline at end of file diff --git a/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle.go b/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle.go new file mode 100755 index 000000000..1f4d475ec --- /dev/null +++ b/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle.go @@ -0,0 +1,44 @@ +package problem0939 + +const initialArea = 2000000000 // > 40000*40000 + +func minAreaRect(points [][]int) int { + size := len(points) + + isExisting := make(map[[2]int]bool, size) + for _, p := range points { + x, y := p[0], p[1] + isExisting[[2]int{x, y}] = true + } + + minArea := initialArea + + for i := 0; i < size; i++ { + xi, yi := points[i][0], points[i][1] + for j := i + 1; j < size; j++ { + xj, yj := points[j][0], points[j][1] + if xi == xj || yi == yj { + continue + } + area := abs((xi - xj) * (yi - yj)) + if area >= minArea || // NOTICE: delay heavy operation + !isExisting[[2]int{xi, yj}] || + !isExisting[[2]int{xj, yi}] { + continue + } + minArea = area + } + } + + if minArea == initialArea { + return 0 + } + return minArea +} + +func abs(n int) int { + if n < 0 { + return -n + } + return n +} diff --git a/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle_test.go b/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle_test.go new file mode 100755 index 000000000..c30f86242 --- /dev/null +++ b/Algorithms/0939.minimum-area-rectangle/minimum-area-rectangle_test.go @@ -0,0 +1,54 @@ +package problem0939 + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans int +}{ + + { + [][]int{{3, 2}, {1, 3}, {3, 0}, {3, 4}, {2, 1}, {0, 4}, {0, 3}, {4, 1}, {2, 4}}, + 0, + }, + + { + [][]int{{1, 1}, {1, 3}, {3, 1}, {3, 3}, {2, 2}}, + 4, + }, + + { + [][]int{{1, 1}, {1, 3}, {3, 1}, {3, 3}, {4, 1}, {4, 3}}, + 2, + }, + + { + [][]int{{3, 2}, {3, 1}, {4, 4}, {1, 1}, {4, 3}, {0, 3}, {0, 2}, {4, 0}}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_minAreaRect(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + fmt.Println("====") + ast.Equal(tc.ans, minAreaRect(tc.points), "输入:%v", tc) + } +} + +func Benchmark_minAreaRect(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minAreaRect(tc.points) + } + } +} diff --git a/Algorithms/0940.distinct-subsequences-ii/README.md b/Algorithms/0940.distinct-subsequences-ii/README.md new file mode 100755 index 000000000..d6be61b5d --- /dev/null +++ b/Algorithms/0940.distinct-subsequences-ii/README.md @@ -0,0 +1,34 @@ +# [940. Distinct Subsequences II](https://leetcode.com/problems/distinct-subsequences-ii/) + +Given a string S, count the number of distinct, non-empty subsequences of S . + +Since the result may be large, return the answer modulo 10^9 + 7. + +Example 1: + +```text +Input: "abc" +Output: 7 +Explanation: The 7 distinct subsequences are "a", "b", "c", "ab", "ac", "bc", and "abc". +``` + +Example 2: + +```text +Input: "aba" +Output: 6 +Explanation: The 6 distinct subsequences are "a", "b", "ab", "ba", "aa" and "aba". +``` + +Example 3: + +```text +Input: "aaa" +Output: 3 +Explanation: The 3 distinct subsequences are "a", "aa" and "aaa". +``` + +Note: + +1. `S contains only lowercase letters.` +1. `1 <= S.length <= 2000` diff --git a/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii.go b/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii.go new file mode 100755 index 000000000..fba77bdd1 --- /dev/null +++ b/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii.go @@ -0,0 +1,23 @@ +package problem0940 + +// ref: https://www.jianshu.com/p/02501f516437 + +const mod = 1e9 + 7 + +func distinctSubseqII(S string) int { + tail := make([]int, 26) + + total := func() int { + count := 0 + for i := 0; i < 26; i++ { + count += tail[i] + } + return count % mod + } + + for _, r := range S { + tail[r-'a'] = total() + 1 + } + + return total() +} diff --git a/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii_test.go b/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii_test.go new file mode 100755 index 000000000..b051dc6b6 --- /dev/null +++ b/Algorithms/0940.distinct-subsequences-ii/distinct-subsequences-ii_test.go @@ -0,0 +1,52 @@ +package problem0940 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans int +}{ + + { + "adsflkasldgalksdglakdsfjlakjdsglkasjdlkasdadsflkdsfldaslfjsdaldadsabc", + 589422165, + }, + + { + "abc", + 7, + }, + + { + "aba", + 6, + }, + + { + "aaa", + 3, + }, + + // 可以有多个 testcase +} + +func Test_distinctSubseqII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, distinctSubseqII(tc.S), "输入:%v", tc) + } +} + +func Benchmark_distinctSubseqII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + distinctSubseqII(tc.S) + } + } +} diff --git a/Algorithms/0941.valid-mountain-array/README.md b/Algorithms/0941.valid-mountain-array/README.md new file mode 100755 index 000000000..e2efd670b --- /dev/null +++ b/Algorithms/0941.valid-mountain-array/README.md @@ -0,0 +1,36 @@ +# [941. Valid Mountain Array](https://leetcode.com/problems/valid-mountain-array/) + +Given an array `A` of integers, return `true` if and only if it is a valid mountain array. + +Recall that A is a mountain array if and only if: + +- `A.length >= 3` +- There exists some i with `0 < i < A.length - 1` such that: + - `A[0] < A[1] < ... A[i-1] < A[i]` + - `A[i] > A[i+1] > ... > A[B.length - 1]` + +Example 1: + +```text +Input: [2,1] +Output: false +``` + +Example 2: + +```text +Input: [3,5,5] +Output: false +``` + +Example 3: + +```text +Input: [0,3,2,1] +Output: true +``` + +Note: + +1. `0 <= A.length <= 10000` +1. `0 <= A[i] <= 10000` \ No newline at end of file diff --git a/Algorithms/0941.valid-mountain-array/valid-mountain-array.go b/Algorithms/0941.valid-mountain-array/valid-mountain-array.go new file mode 100755 index 000000000..e8b608ba4 --- /dev/null +++ b/Algorithms/0941.valid-mountain-array/valid-mountain-array.go @@ -0,0 +1,22 @@ +package problem0941 + +func validMountainArray(A []int) bool { + size := len(A) + + if size < 3 { + return false + } + + i := 1 + for i < size && A[i-1] < A[i] { + i++ + } + + top := i - 1 + + for i < size && A[i-1] > A[i] { + i++ + } + + return 0 < top && top < size-1 && i == size +} diff --git a/Algorithms/0941.valid-mountain-array/valid-mountain-array_test.go b/Algorithms/0941.valid-mountain-array/valid-mountain-array_test.go new file mode 100755 index 000000000..a6f13a8f0 --- /dev/null +++ b/Algorithms/0941.valid-mountain-array/valid-mountain-array_test.go @@ -0,0 +1,57 @@ +package problem0941 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{9,8,7,6,5,4,3,2,1,0}, + false, + }, + + { + []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, + false, + }, + + { + []int{2, 1}, + false, + }, + + { + []int{3, 5, 5}, + false, + }, + + { + []int{0, 3, 2, 1}, + true, + }, + + // 可以有多个 testcase +} + +func Test_validMountainArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, validMountainArray(tc.A), "输入:%v", tc) + } +} + +func Benchmark_validMountainArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validMountainArray(tc.A) + } + } +} diff --git a/Algorithms/0942.di-string-match/README.md b/Algorithms/0942.di-string-match/README.md new file mode 100755 index 000000000..0db2b06b8 --- /dev/null +++ b/Algorithms/0942.di-string-match/README.md @@ -0,0 +1,34 @@ +# [942. DI String Match](https://leetcode.com/problems/di-string-match/) + +Given a string `S` that **only** contains "I" (increase) or "D" (decrease), let N = S.length. + +Return **any** permutation `A` of `[0, 1, ..., N]` such that for all `i = 0, ..., N-1`: + +- If `S[i] == "I"`, then `A[i] < A[i+1]` +- If `S[i] == "D"`, then `A[i] > A[i+1]` + +Example 1: + +```text +Input: "IDID" +Output: [0,4,1,3,2] +``` + +Example 2: + +```text +Input: "III" +Output: [0,1,2,3] +``` + +Example 3: + +```text +Input: "DDI" +Output: [3,2,0,1] +``` + +Note: + +1. `1 <= S.length <= 10000` +1. `S` only contains characters "I" or "D". diff --git a/Algorithms/0942.di-string-match/di-string-match.go b/Algorithms/0942.di-string-match/di-string-match.go new file mode 100755 index 000000000..318c0899e --- /dev/null +++ b/Algorithms/0942.di-string-match/di-string-match.go @@ -0,0 +1,21 @@ +package problem0942 + +func diStringMatch(S string) []int { + size := len(S) + l, r := 0, size + a := make([]int, size+1) + for i, b := range S { + if b == 'I' { + a[i] = l + l++ + } else { + a[i] = r + r-- + } + i++ + } + + a[size] = l + + return a +} diff --git a/Algorithms/0942.di-string-match/di-string-match_test.go b/Algorithms/0942.di-string-match/di-string-match_test.go new file mode 100755 index 000000000..3f60087b5 --- /dev/null +++ b/Algorithms/0942.di-string-match/di-string-match_test.go @@ -0,0 +1,62 @@ +package problem0942 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string +}{ + + { + "IDID", + }, + + { + "III", + }, + + { + "DDI", + }, + + // 可以有多个 testcase +} + +func isCorrect(s string, a []int) bool { + for i, b := range s { + switch b { + case 'I': + if !(a[i] < a[i+1]) { + return false + } + case 'D': + if !(a[i] > a[i+1]) { + return false + } + default: + panic("s contain not only I and D") + } + } + return true +} + +func Test_diStringMatch(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + a := diStringMatch(tc.S) + ast.True(isCorrect(tc.S, a)) + } +} + +func Benchmark_diStringMatch(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + diStringMatch(tc.S) + } + } +} diff --git a/Algorithms/0943.find-the-shortest-superstring/README.md b/Algorithms/0943.find-the-shortest-superstring/README.md new file mode 100755 index 000000000..209509929 --- /dev/null +++ b/Algorithms/0943.find-the-shortest-superstring/README.md @@ -0,0 +1,25 @@ +# [943. Find the Shortest Superstring](https://leetcode.com/problems/find-the-shortest-superstring/) + +Given an array A of strings, find any smallest string that contains each string in A as a substring. + +We may assume that no string in A is substring of another string in A. + +Example 1: + +```text +Input: ["alex","loves","leetcode"] +Output: "alexlovesleetcode" +Explanation: All permutations of "alex","loves","leetcode" would also be accepted. +``` + +Example 2: + +```text +Input: ["catg","ctaagt","gcta","ttca","atgcatc"] +Output: "gctaagttcatgcatc" +``` + +Note: + +1. 1 <= A.length <= 12 +1. 1 <= A[i].length <= 20 diff --git a/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring.go b/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring.go new file mode 100755 index 000000000..3846afb0f --- /dev/null +++ b/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring.go @@ -0,0 +1,101 @@ +package problem0943 + +import ( + "strings" +) + +func shortestSuperstring(A []string) string { + size := len(A) + indexs := make([]int, 0, size) + isUsed := make([]bool, size) + suffixes := getSuffixes(A) + res := make([]int, size) + minLen := 241 // > 12*20 + for i := 0; i < size; i++ { + isUsed[i] = true + greedy(len(A[i]), &minLen, append(indexs, i), res, A, isUsed, suffixes) + isUsed[i] = false + } + return connect(A, res, suffixes) +} + +// indexs 按顺序记录了 super string 中单词的 index +// length 记录了 super string 的长度 +// 传入 suffixes 是为了避免重复多次计算两个单词之间的重叠关系 +func greedy(length int, minLen *int, indexs, res []int, A []string, isUsed []bool, suffixes [][]int) { + if len(indexs) == len(A) { + if *minLen > length { + *minLen = length + copy(res, indexs) + } + return + } + + tail := indexs[len(indexs)-1] + // get max suffix length of UNUSED string + maxLen := -1 + lens := suffixes[tail] + for i, sl := range lens { + if maxLen >= sl || isUsed[i] { + continue + } + maxLen = sl + } + + // only connect string with max suffix length + for i, sl := range lens { + if sl < maxLen || isUsed[i] { + continue + } + isUsed[i] = true + greedy(length+len(A[i])-maxLen, minLen, append(indexs, i), res, A, isUsed, suffixes) + isUsed[i] = false + } +} + +// res[i][j] == 3 means A[j][:3] is A[i]'s suffix +func getSuffixes(A []string) [][]int { + size := len(A) + res := make([][]int, size) + for i := 0; i < size; i++ { + res[i] = make([]int, size) + for j := 0; j < size; j++ { + if i == j { + continue + } + res[i][j] = suffix(A[i], A[j]) + } + } + return res +} + +func suffix(a, b string) int { + // none is substring of another, so can -1 + i := min(len(a), len(b)) - 1 + for !strings.HasSuffix(a, b[:i]) { + i-- + } + return i +} + +func connect(A []string, indexs []int, suffixes [][]int) string { + size := len(A) + var sb strings.Builder + sb.Grow(240) + i := indexs[0] + sb.WriteString(A[i]) + for k := 1; k < size; k++ { + j := indexs[k] + s := suffixes[i][j] + sb.WriteString(A[j][s:]) + i = j + } + return sb.String() +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring_test.go b/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring_test.go new file mode 100755 index 000000000..a130d02fc --- /dev/null +++ b/Algorithms/0943.find-the-shortest-superstring/find-the-shortest-superstring_test.go @@ -0,0 +1,71 @@ +package problem0943 + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + expected string +}{ + + { + []string{"fgbabcde", "abcdefgb", "bcdei"}, + "abcdefgbabcdei", + }, + + { + []string{"cedefifgstkyxfcuajfa", "ooncedefifgstkyxfcua", "assqjfwarvjcjedqtoz", "fcuajfassqjfwarvjc", "fwarvjcjedqtozctcd", "zppedxfumcfsngp", "kyxfcuajfassqjfwa", "fumcfsngphjyfhhwkqa", "fassqjfwarvjcjedq", "ppedxfumcfsngphjyf", "dqtozctcdk"}, + "ooncedefifgstkyxfcuajfassqjfwarvjcjedqtozctcdkzppedxfumcfsngphjyfhhwkqa", + }, + { + []string{"alex", "loves", "leetcode"}, + "alexlovesleetcode", + }, + + { + []string{"catg", "ctaagt", "gcta", "ttca", "atgcatc"}, + "gctaagttcatgcatc", + }, + + // 可以有多个 testcase +} + +func isCorrect(A []string, expected, actual string) bool { + if expected == actual { + return true + } + + if len(expected) != len(actual) { + return false + } + + for _, sub := range A { + if !strings.Contains(actual, sub) { + return false + } + } + + return true +} + +func Test_shortestSuperstring(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + actual := shortestSuperstring(tc.A) + ast.True(isCorrect(tc.A, tc.expected, actual), "输入:%v", tc) + } +} + +func Benchmark_shortestSuperstring(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestSuperstring(tc.A) + } + } +} diff --git a/Algorithms/0944.delete-columns-to-make-sorted/README.md b/Algorithms/0944.delete-columns-to-make-sorted/README.md new file mode 100755 index 000000000..f23eb8e17 --- /dev/null +++ b/Algorithms/0944.delete-columns-to-make-sorted/README.md @@ -0,0 +1,42 @@ +# [944. Delete Columns to Make Sorted](https://leetcode.com/problems/delete-columns-to-make-sorted/) + +We are given an array `A` of `N` lowercase letter strings, all of the same length. + +Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices. + +For example, if we have an array `A = ["abcdef","uvwxyz"]` and deletion indices `{0, 2, 3}`, then the final array after deletions is `["bef", "vyz"]`, and the remaining columns of A are `["b","v"]`, `["e","y"]`, and `["f","z"]`. (Formally, the c-th column is `[A[0][c], A[1][c], ..., A[A.length-1][c]]`.) + +Suppose we chose a set of deletion indices `D` such that after deletions, each remaining column in A is in **non-decreasing** sorted order. + +Return the minimum possible value of `D.length`. + +Example 1: + +```text +Input: ["cba","daf","ghi"] +Output: 1 +Explanation: +After choosing D = {1}, each column ["c","d","g"] and ["a","f","i"] are in non-decreasing sorted order. +If we chose D = {}, then a column ["b","a","h"] would not be in non-decreasing sorted order. +``` + +Example 2: + +```text +Input: ["a","b"] +Output: 0 +Explanation: D = {} +``` + +Example 3: + +```text +Input: ["zyx","wvu","tsr"] +Output: 3 +Explanation: D = {0, 1, 2} +``` + +Note: + +- `1 <= A.length <= 100` +- `1 <= A[i].length <= 1000` \ No newline at end of file diff --git a/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted.go b/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted.go new file mode 100755 index 000000000..36446c124 --- /dev/null +++ b/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted.go @@ -0,0 +1,15 @@ +package problem0944 + +func minDeletionSize(A []string) int { + m, n := len(A), len(A[0]) + res := 0 + for j := 0; j < n; j++ { + for i := 1; i < m; i++ { + if A[i-1][j] > A[i][j] { + res++ + break + } + } + } + return res +} diff --git a/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted_test.go b/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted_test.go new file mode 100755 index 000000000..bbed8b950 --- /dev/null +++ b/Algorithms/0944.delete-columns-to-make-sorted/delete-columns-to-make-sorted_test.go @@ -0,0 +1,47 @@ +package problem0944 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans int +}{ + + { + []string{"cba", "daf", "ghi"}, + 1, + }, + + { + []string{"a", "b"}, + 0, + }, + + { + []string{"zyx", "wvu", "tsr"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_minDeletionSize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minDeletionSize(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minDeletionSize(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minDeletionSize(tc.A) + } + } +} diff --git a/Algorithms/0945.minimum-increment-to-make-array-unique/README.md b/Algorithms/0945.minimum-increment-to-make-array-unique/README.md new file mode 100755 index 000000000..00b829819 --- /dev/null +++ b/Algorithms/0945.minimum-increment-to-make-array-unique/README.md @@ -0,0 +1,27 @@ +# [945. Minimum Increment to Make Array Unique](https://leetcode.com/problems/minimum-increment-to-make-array-unique/) + +Given an array of integers A, a move consists of choosing any A[i], and incrementing it by 1. + +Return the least number of moves to make every value in A unique. + +Example 1: + +```text +Input: [1,2,2] +Output: 1 +Explanation: After 1 move, the array could be [1, 2, 3]. +``` + +Example 2: + +```text +Input: [3,2,1,2,1,7] +Output: 6 +Explanation: After 6 moves, the array could be [3, 4, 1, 2, 5, 7]. +It can be shown with 5 or less moves that it is impossible for the array to have all unique values. +``` + +Note: + +1. 0 <= A.length <= 40000 +1. 0 <= A[i] < 40000 diff --git a/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique.go b/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique.go new file mode 100755 index 000000000..55d794ea1 --- /dev/null +++ b/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique.go @@ -0,0 +1,30 @@ +package problem0945 + +func minIncrementForUnique(A []int) int { + counts := [40001]int{} + max := 0 + + for _, n := range A { + counts[n]++ + if max < n { + max = n + } + } + + res := 0 + + for n := 0; n < max; n++ { + if counts[n] <= 1 { // no redundance + continue + } + redundance := counts[n] - 1 + // move all redundance to n+1 + res += redundance + counts[n+1] += redundance + } + + redundance := counts[max] - 1 + res += (redundance + 1) * redundance / 2 + + return res +} diff --git a/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique_test.go b/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique_test.go new file mode 100755 index 000000000..d15a1f079 --- /dev/null +++ b/Algorithms/0945.minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique_test.go @@ -0,0 +1,47 @@ +package problem0945 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{}, + 0, + }, + + { + []int{1, 2, 2}, + 1, + }, + + { + []int{3, 2, 1, 2, 1, 7}, + 6, + }, + + // 可以有多个 testcase +} + +func Test_minIncrementForUnique(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minIncrementForUnique(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minIncrementForUnique(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minIncrementForUnique(tc.A) + } + } +} diff --git a/Algorithms/0946.validate-stack-sequences/README.md b/Algorithms/0946.validate-stack-sequences/README.md new file mode 100755 index 000000000..9a1c99331 --- /dev/null +++ b/Algorithms/0946.validate-stack-sequences/README.md @@ -0,0 +1,28 @@ +# [946. Validate Stack Sequences](https://leetcode.com/problems/validate-stack-sequences/) + +Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. + +Example 1: + +```text +Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] +Output: true +Explanation: We might do the following sequence: +push(1), push(2), push(3), push(4), pop() -> 4, +push(5), pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1 +``` + +Example 2: + +```text +Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2] +Output: false +Explanation: 1 cannot be popped before 2. +``` + +Note: + +1. 0 <= pushed.length == popped.length <= 1000 +1. 0 <= pushed[i], popped[i] < 1000 +1. pushed is a permutation of popped. +1. pushed and popped have distinct values. \ No newline at end of file diff --git a/Algorithms/0946.validate-stack-sequences/validate-stack-sequences.go b/Algorithms/0946.validate-stack-sequences/validate-stack-sequences.go new file mode 100755 index 000000000..1f48d44bb --- /dev/null +++ b/Algorithms/0946.validate-stack-sequences/validate-stack-sequences.go @@ -0,0 +1,23 @@ +package problem0946 + +func validateStackSequences(pushed, popped []int) bool { + size := len(pushed) + + stack := make([]int, size) + top := -1 + + for in, out := 0, 0; in < size; in++ { + if pushed[in] != popped[out] { + top++ + stack[top] = pushed[in] + } else { + out++ + for top >= 0 && stack[top] == popped[out] { + top-- + out++ + } + } + } + + return top == -1 +} diff --git a/Algorithms/0946.validate-stack-sequences/validate-stack-sequences_test.go b/Algorithms/0946.validate-stack-sequences/validate-stack-sequences_test.go new file mode 100755 index 000000000..86c8ad9f8 --- /dev/null +++ b/Algorithms/0946.validate-stack-sequences/validate-stack-sequences_test.go @@ -0,0 +1,51 @@ +package problem0946 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + pushed []int + popped []int + ans bool +}{ + + { + []int{0, 2, 1}, + []int{0, 1, 2}, + true, + }, + + { + []int{1, 2, 3, 4, 5}, + []int{4, 5, 3, 2, 1}, + true, + }, + + { + []int{1, 2, 3, 4, 5}, + []int{4, 3, 5, 1, 2}, + false, + }, + + // 可以有多个 testcase +} + +func Test_validateStackSequences(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, validateStackSequences(tc.pushed, tc.popped), "输入:%v", tc) + } +} + +func Benchmark_validateStackSequences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + validateStackSequences(tc.pushed, tc.popped) + } + } +} diff --git a/Algorithms/0947.most-stones-removed-with-same-row-or-column/README.md b/Algorithms/0947.most-stones-removed-with-same-row-or-column/README.md new file mode 100755 index 000000000..19de12457 --- /dev/null +++ b/Algorithms/0947.most-stones-removed-with-same-row-or-column/README.md @@ -0,0 +1,33 @@ +# [947. Most Stones Removed with Same Row or Column](https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/) + +On a 2D plane, we place stones at some integer coordinate points. Each coordinate point may have at most one stone. + +Now, a move consists of removing a stone that shares a column or row with another stone on the grid. + +What is the largest possible number of moves we can make? + +Example 1: + +```text +Input: stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]] +Output: 5 +``` + +Example 2: + +```text +Input: stones = [[0,0],[0,2],[1,1],[2,0],[2,2]] +Output: 3 +``` + +Example 3: + +```text +Input: stones = [[0,0]] +Output: 0 +``` + +Note: + +1. 1 <= stones.length <= 1000 +1. 0 <= stones[i][j] < 10000 diff --git a/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column.go b/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column.go new file mode 100755 index 000000000..b8f4549c4 --- /dev/null +++ b/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column.go @@ -0,0 +1,48 @@ +package problem0947 + +// 如果把相同行或者列上的点,看作是联通的 +// 那么本题的本质就是,每个联通区域只保留一个点,则可以删除多少个点 + +func removeStones(stones [][]int) int { + u := newUnion(20000) + for _, s := range stones { + // 把一个点的 x 和 y 坐标进行连通,可以把复杂度从 O^2 降低到 O + // 当为了避免坐标轴的重叠,需要把每个 y 坐标的值 +10000 + u.union(s[0], s[1]+10000) + } + + keeps := make(map[int]int, 1000) + for _, s := range stones { + root := u.find(s[0]) + keeps[root]++ + } + + return len(stones) - len(keeps) +} + +type union struct { + parent []int +} + +func newUnion(size int) *union { + parent := make([]int, size) + for i := range parent { + parent[i] = i + } + return &union{ + parent: parent, + } +} + +func (u *union) find(i int) int { + if u.parent[i] == i { + return i + } + u.parent[i] = u.find(u.parent[i]) + return u.parent[i] +} + +func (u *union) union(x, y int) { + xp, yp := u.find(x), u.find(y) + u.parent[yp] = xp +} diff --git a/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column_test.go b/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column_test.go new file mode 100755 index 000000000..7b8925435 --- /dev/null +++ b/Algorithms/0947.most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column_test.go @@ -0,0 +1,53 @@ +package problem0947 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones [][]int + ans int +}{ + { + [][]int{{0, 1}, {1, 0}, {1, 1}}, + 2, + }, + + {[][]int{{0, 0}, {0, 1}, {1, 0}, {1, 2}, {2, 1}, {2, 2}}, + 5, + }, + + {[][]int{{0, 0}, {0, 2}, {1, 1}, {2, 0}, {2, 2}}, + 3, + }, + + {[][]int{{0, 0}}, + 0, + }, + + { + [][]int{{279, 2814}, {2343, 975}, {2680, 1479}, {1922, 451}, {1538, 2188}, {2180, 1620}, {2452, 1425}, {1626, 1625}, {2697, 1281}, {1450, 339}, {1252, 219}, {2256, 1772}, {150, 1442}, {691, 2958}, {2477, 1565}, {1730, 1884}, {1077, 291}, {641, 1267}, {1196, 1419}, {2590, 2078}, {1285, 2006}, {2608, 2610}, {173, 438}, {191, 2537}, {1240, 1797}, {1681, 2174}, {1145, 1306}, {2623, 2705}, {421, 538}, {2114, 428}, {1270, 2004}, {2091, 2376}, {754, 2827}, {2816, 1698}, {2606, 1299}, {1881, 1299}, {1511, 420}, {2929, 44}, {1945, 258}, {2700, 2455}, {36, 1556}, {1049, 1545}, {1242, 1486}, {893, 2322}, {2117, 2955}, {269, 1299}, {497, 2145}, {2495, 1110}, {2851, 1273}, {1221, 864}, {16, 1491}, {403, 2549}, {2125, 1281}, {160, 2062}, {2887, 141}, {2583, 2216}, {2247, 754}, {504, 1141}, {2372, 2404}, {1711, 1047}, {751, 2211}, {1232, 244}, {2309, 961}, {2943, 488}, {822, 1485}, {1273, 0}, {2306, 2209}, {2223, 712}, {2596, 86}, {2245, 128}, {2567, 727}, {2526, 2479}, {44, 2623}, {968, 735}, {1256, 1831}, {234, 1302}, {2181, 586}, {2365, 1033}, {529, 2910}, {822, 777}, {131, 489}, {729, 2030}, {1621, 299}, {932, 1589}, {1589, 1649}, {498, 1813}, {1218, 366}, {2309, 2754}, {2709, 2553}, {1671, 795}, {2851, 700}, {1944, 1143}, {2430, 2714}, {2283, 1291}, {2730, 838}, {257, 146}, {2862, 1167}, {2093, 2561}, {1379, 2025}, {901, 1019}, {2261, 2414}, {1597, 2796}, {1221, 2543}, {2688, 2399}, {1927, 363}, {113, 720}, {241, 411}, {2507, 668}, {1984, 2278}, {409, 1460}, {2916, 2547}, {1576, 2495}, {737, 1125}, {2566, 1241}, {2040, 344}, {2600, 2363}, {2798, 1218}, {1424, 2763}, {2180, 1459}, {2532, 2072}, {2493, 2318}, {595, 1889}, {1860, 353}, {2880, 1402}, {1191, 2453}, {1488, 392}, {777, 1609}, {1879, 180}, {2189, 2377}, {458, 1878}, {2350, 1404}, {1936, 779}, {615, 512}, {1562, 2045}, {1052, 2307}, {1024, 520}, {894, 1624}, {1733, 773}, {1807, 222}, {914, 563}, {2719, 448}, {1059, 520}, {340, 742}, {1951, 2170}, {2066, 2825}, {104, 604}, {2836, 1969}, {1676, 2523}, {961, 1456}, {1390, 647}, {2703, 2911}, {955, 2698}, {849, 183}, {1376, 2044}, {740, 2163}, {2577, 2983}, {688, 1846}, {328, 753}, {1177, 2262}, {1149, 1682}, {1837, 90}, {313, 2584}, {880, 1181}, {351, 2241}, {298, 2527}, {2260, 1626}, {2185, 1390}, {1019, 1915}, {2213, 600}, {2840, 1166}, {22, 722}, {2435, 2438}, {1829, 1793}, {1190, 1733}, {986, 815}, {1467, 2135}, {2255, 2238}, {826, 1067}, {1807, 1723}, {1355, 345}, {728, 184}, {2908, 174}, {312, 73}, {2878, 1597}, {1881, 14}, {306, 2664}, {2944, 3}, {2063, 2607}, {2403, 1494}, {1797, 549}, {2691, 2615}, {2118, 1281}, {1214, 1329}, {1655, 885}, {2973, 2797}, {365, 968}, {777, 1458}, {2922, 1403}, {1444, 2366}, {1573, 2718}, {1979, 1655}, {1869, 1847}, {184, 1298}, {1357, 1123}, {1744, 2903}, {2892, 2386}, {2798, 193}, {2126, 706}, {718, 2582}, {215, 220}, {2428, 1921}, {321, 1705}, {852, 2383}, {293, 771}, {1294, 933}, {961, 1037}, {2892, 2951}, {1026, 875}, {1642, 155}, {349, 824}, {2910, 2343}, {780, 726}, {1861, 2576}, {1456, 227}, {1961, 2710}, {2035, 2853}, {2179, 902}, {2295, 1126}, {62, 1761}, {378, 1722}, {2254, 505}, {203, 2621}, {209, 2429}, {2226, 2085}, {1412, 827}, {790, 755}, {2375, 893}, {968, 1049}, {457, 1696}, {2999, 244}, {1164, 2494}, {2850, 132}, {1556, 304}, {2104, 1394}, {2276, 2504}, {1856, 1838}, {1677, 893}, {221, 2677}, {2784, 2818}, {779, 1153}, {2962, 1161}, {2489, 85}, {37, 279}, {1033, 870}, {1502, 2978}, {1495, 1391}, {2700, 2851}, {45, 46}, {1335, 2155}, {2859, 296}, {2380, 447}, {1957, 328}, {562, 2135}, {2070, 1078}, {233, 48}, {407, 2666}, {1981, 564}, {250, 485}, {857, 2496}, {2194, 73}, {765, 261}, {2045, 1768}, {773, 1612}, {2728, 2325}, {1830, 640}, {2618, 1253}, {1392, 1088}, {2258, 1000}, {2738, 478}, {1735, 2406}, {600, 1774}, {1682, 1222}, {161, 2918}, {1887, 599}, {1498, 2535}, {1213, 612}, {2915, 795}, {2845, 976}, {424, 260}, {1075, 639}, {264, 2945}, {855, 715}, {1130, 2745}, {2562, 1625}, {763, 360}, {1724, 1043}, {2813, 1930}, {384, 2363}, {197, 275}, {914, 2153}, {809, 2885}, {143, 2347}, {659, 2872}, {2855, 2995}, {2686, 2122}, {623, 1043}, {2263, 2172}, {2634, 2672}, {990, 1897}, {1628, 672}, {863, 1034}, {1216, 129}, {1268, 2810}, {1858, 2332}, {2061, 632}, {1851, 2069}, {696, 1381}, {659, 859}, {2299, 322}, {2109, 989}, {65, 763}, {1873, 515}, {2954, 1859}, {544, 887}, {691, 1224}, {927, 968}, {433, 1468}, {2781, 1977}, {1435, 2594}, {275, 2802}, {523, 324}, {1266, 2146}, {10, 1139}, {1708, 121}, {2367, 2481}, {2663, 862}, {1068, 2308}, {2861, 2962}, {637, 1667}, {632, 2781}, {2685, 2013}, {1268, 1591}, {678, 1511}, {2365, 2337}, {1903, 2032}, {913, 275}, {710, 1831}, {719, 338}, {2089, 655}, {2179, 2849}, {2292, 2253}, {765, 1246}, {961, 926}, {1309, 1459}, {1856, 2023}, {601, 1582}, {156, 2969}, {1504, 1473}, {244, 2074}, {1472, 1647}, {445, 1769}, {1815, 2070}, {2084, 1787}, {1205, 2895}, {151, 1647}, {340, 368}, {2664, 2296}, {280, 667}, {49, 1935}, {1578, 2696}, {526, 2172}, {487, 673}, {2054, 1884}, {2236, 1559}, {823, 2519}, {861, 1870}, {2032, 1947}, {390, 450}, {654, 803}, {1985, 1291}, {336, 368}, {1124, 2793}, {968, 117}, {943, 2655}, {606, 1483}, {1126, 130}, {2155, 1903}, {2614, 874}, {1493, 1090}, {1699, 907}, {359, 1374}, {1104, 1391}, {2701, 2259}, {2242, 1176}, {2238, 569}, {492, 1431}, {232, 110}, {14, 1962}, {403, 113}, {1451, 2821}, {912, 2753}, {1160, 1590}, {576, 2686}, {2497, 2859}, {1217, 1186}, {2321, 1629}, {2024, 169}, {651, 1429}, {935, 2049}, {2980, 2642}, {2802, 1412}, {1946, 1963}, {1305, 801}, {2952, 1858}, {457, 276}, {2806, 667}, {1011, 2407}, {2861, 1668}, {190, 2286}, {1267, 2597}, {923, 369}, {698, 691}, {1398, 84}, {1174, 90}, {1540, 2547}, {370, 1549}, {2983, 114}, {1160, 1962}, {772, 1517}, {1230, 1953}, {2337, 1546}, {2122, 2784}, {1477, 2012}, {1991, 2178}, {1370, 2680}, {2207, 1009}, {588, 1200}, {1700, 139}, {1884, 1720}, {75, 2688}, {2171, 327}, {1038, 929}, {584, 1958}, {2458, 2163}, {1468, 2194}, {2348, 1135}, {557, 1244}, {2608, 1495}, {1754, 2722}, {2776, 2969}, {2699, 1236}, {225, 777}, {821, 397}, {271, 1004}, {540, 555}, {1590, 1583}, {557, 2920}, {1217, 1053}, {755, 2122}, {2758, 47}, {2868, 1563}, {1986, 2891}, {833, 369}, {2779, 1709}, {1132, 685}, {318, 2527}, {1461, 1803}, {1088, 1481}, {1694, 7}, {2805, 2829}, {2620, 2654}, {1355, 1701}, {1109, 414}, {766, 221}, {2617, 916}, {2155, 693}, {2918, 18}, {2830, 2616}, {1266, 346}, {2774, 2537}, {937, 126}, {1550, 864}, {2429, 2628}, {1048, 1460}, {1170, 2752}, {1484, 372}, {149, 571}, {983, 1184}, {2240, 2570}, {199, 625}, {2014, 975}, {1215, 730}, {1233, 2562}, {1589, 457}, {2392, 1592}, {2925, 882}, {25, 2940}, {261, 836}, {1806, 842}, {1828, 262}, {1776, 445}, {1047, 98}, {1196, 1624}, {1316, 2965}, {455, 1315}, {2324, 727}, {761, 1444}, {500, 852}, {1646, 2747}, {2339, 1074}, {919, 2837}, {2993, 1869}, {202, 2774}, {2857, 2298}, {1759, 605}, {1408, 1722}, {936, 1143}, {540, 1385}, {2770, 2769}, {2281, 1136}, {1672, 1138}, {2862, 1692}, {2729, 2369}, {643, 1205}, {911, 144}, {288, 618}, {2666, 2239}, {1589, 2969}, {2110, 655}, {2522, 2775}, {1227, 604}, {979, 2606}, {2797, 2395}, {2053, 1465}, {1765, 2688}, {2349, 62}, {866, 1912}, {2670, 2018}, {691, 683}, {2358, 308}, {1162, 2660}, {170, 2666}, {1641, 376}, {1696, 1367}, {231, 384}, {2915, 875}, {2675, 2499}, {212, 2735}, {1879, 1008}, {2958, 2053}, {544, 212}, {605, 2281}, {1390, 2014}, {1559, 1218}, {1194, 2222}, {1533, 1881}, {1863, 1736}, {2746, 473}, {2129, 481}, {2340, 1229}, {1394, 1040}, {1736, 2567}, {2442, 489}, {2388, 1453}, {226, 2027}, {1512, 1514}, {812, 2057}, {526, 992}, {1935, 1527}, {1167, 793}, {2236, 1763}, {740, 1623}, {619, 1777}, {2118, 763}, {2123, 19}, {2026, 32}, {1211, 697}, {73, 916}, {2847, 2372}, {559, 1180}, {2244, 1271}, {1632, 2730}, {1859, 2109}, {2701, 2367}, {2978, 1360}, {288, 1940}, {792, 356}, {1530, 936}, {891, 254}, {2943, 57}, {177, 1168}, {2095, 1910}, {1268, 2508}, {95, 23}, {2275, 838}, {1754, 1002}, {1634, 2616}, {69, 2285}, {1538, 1309}, {1135, 1559}, {2356, 1315}, {2568, 1483}, {2311, 2669}, {174, 943}, {669, 2851}, {1976, 2820}, {2526, 2874}, {656, 2117}, {227, 547}, {945, 508}, {2731, 355}, {443, 11}, {928, 1193}, {911, 1104}, {1760, 1363}, {897, 2599}, {810, 768}, {1911, 2502}, {1712, 2744}, {449, 1172}, {1189, 772}, {2195, 956}, {2938, 438}, {810, 915}, {2377, 2410}, {1437, 766}, {1804, 2212}, {2880, 1635}, {741, 2082}, {2180, 1998}, {635, 1480}, {2709, 909}, {1145, 2743}, {761, 2922}, {2117, 2770}, {477, 1934}, {838, 2609}, {1531, 1891}, {2553, 1820}, {2819, 463}, {1727, 637}, {1401, 1363}, {2652, 1603}, {942, 1435}, {1891, 2820}, {759, 274}, {796, 280}, {580, 1767}, {2929, 1671}, {1072, 2595}, {1952, 583}, {1346, 1962}, {2687, 2356}, {928, 2499}, {2427, 1071}, {1928, 447}, {2967, 1539}, {1901, 2602}, {2233, 1015}, {1104, 166}, {2696, 1837}, {2573, 2289}, {408, 881}, {1574, 1855}, {88, 25}, {1655, 160}, {2745, 2089}, {2155, 903}, {360, 1453}, {2967, 906}, {20, 1333}, {1765, 2285}, {2126, 1236}, {2466, 345}, {1427, 1245}, {1106, 1636}, {2459, 689}, {242, 566}, {2776, 1650}, {2890, 1202}, {1985, 2269}, {2563, 2833}, {2261, 1715}, {559, 2412}, {1371, 1338}, {1686, 708}, {1808, 29}, {944, 1019}, {852, 1661}, {2098, 2032}, {1787, 867}, {2477, 608}, {2098, 279}, {400, 1405}, {2170, 1705}, {1135, 836}, {870, 2092}, {1339, 2071}, {919, 1279}, {1704, 1879}, {686, 2482}, {1500, 701}, {239, 2148}, {2324, 2179}, {2560, 1501}, {117, 2421}, {298, 2481}, {2664, 769}, {752, 608}, {2647, 2313}, {1490, 734}, {48, 2751}, {1806, 1921}, {2756, 315}, {2105, 2459}, {1062, 813}, {364, 2856}, {2689, 407}, {1187, 2580}, {2023, 2663}, {682, 2132}, {1280, 2985}, {2356, 1307}, {1602, 48}, {173, 452}, {2337, 942}, {1106, 1318}, {597, 813}, {1446, 1973}, {2846, 904}, {730, 2033}, {950, 1240}, {620, 2804}, {395, 5}, {1212, 1391}, {1581, 2961}, {1317, 1943}, {2930, 1003}, {805, 707}, {277, 1946}, {775, 1007}, {2654, 2254}, {2885, 1105}, {1154, 20}, {578, 2710}, {2114, 2627}, {80, 1711}, {1320, 1423}, {1728, 288}, {1220, 388}, {2377, 2076}, {817, 415}, {797, 2945}, {1653, 874}, {1882, 352}, {632, 2710}, {1091, 369}, {1162, 1609}, {162, 688}, {1231, 1717}, {838, 1097}, {1270, 1538}, {1313, 2652}, {530, 2265}, {1408, 979}, {301, 1822}, {2754, 2531}, {904, 161}, {1201, 957}, {747, 1066}, {2248, 2394}, {2501, 420}, {2215, 762}, {2665, 2095}, {1311, 351}, {2478, 2880}, {708, 2645}, {24, 2614}, {1625, 828}, {1992, 717}, {889, 1540}, {241, 1249}, {971, 2074}, {550, 2130}, {2633, 1640}, {2726, 575}, {1962, 783}, {2649, 514}, {21, 1745}, {2892, 1890}, {2638, 330}, {1344, 2413}, {210, 2941}, {2819, 2809}, {2241, 2336}, {1592, 606}, {2706, 365}, {1046, 91}, {2342, 2389}, {224, 844}, {1159, 873}, {1584, 1361}, {2224, 1195}, {101, 235}, {2009, 1089}, {1812, 740}, {1002, 905}, {759, 2527}, {1879, 1692}, {1476, 145}, {791, 2624}, {992, 1226}, {1864, 1862}, {481, 843}, {2830, 609}, {2520, 2309}, {2716, 1251}, {867, 2325}, {1507, 296}, {1423, 1874}, {2869, 1931}, {1684, 978}, {2216, 633}, {381, 2781}, {2238, 1070}, {1048, 1743}, {2931, 239}, {960, 2239}, {2803, 2197}, {1065, 288}, {1263, 1613}, {1052, 2334}, {2594, 1928}, {1880, 731}, {919, 253}, {458, 2380}, {2995, 1935}, {1614, 1696}, {899, 113}, {2489, 2550}, {159, 1582}, {1597, 1843}, {2008, 459}, {2270, 1032}, {1522, 2951}, {1201, 2104}, {1626, 1259}, {943, 668}, {756, 2739}, {1954, 1445}, {1079, 1969}, {614, 1664}, {1437, 555}, {1169, 1237}, {1356, 701}, {2253, 1280}, {42, 703}, {36, 2410}, {887, 1361}, {1027, 2880}, {2835, 986}, {503, 1576}, {2059, 1524}, {1868, 1080}, {1371, 1693}, {2330, 2421}, {829, 1225}, {2836, 1127}, {2473, 1387}, {1431, 1792}, {1551, 1696}, {1354, 2738}, {2304, 1674}, {1707, 1536}, {382, 1494}, {99, 220}, {2832, 271}, {682, 1275}, {840, 1210}, {5, 2820}, {1615, 1184}, {959, 905}, {2853, 1400}, {863, 1659}, {50, 2878}, {1065, 2297}, {2818, 1648}, {2791, 2965}, {1049, 2712}, {1101, 1148}, {2140, 1633}, {1799, 1963}, {1361, 2671}, {2832, 1739}, {2468, 1363}, {2129, 2101}, {1631, 249}, {2953, 58}, {2888, 1897}, {504, 1586}, {2671, 318}, {160, 1234}, {245, 2858}, {227, 1050}, {180, 2340}, {980, 2320}, {1897, 2317}, {2735, 2166}, {2559, 2298}, {1767, 1904}, {1769, 2460}, {2953, 357}, {2548, 1841}, {1925, 2654}, {2888, 1166}, {814, 2826}, {1434, 2871}, {1949, 2558}, {1726, 2570}, {373, 1322}, {181, 108}, {79, 241}, {18, 1876}, {654, 512}, {2648, 105}, {1289, 1325}, {2679, 692}, {2139, 1187}, {1942, 629}, {1434, 788}, {2963, 2768}, {645, 2388}, {2841, 2644}, {693, 1025}, {89, 2428}, {2202, 893}, {2286, 2523}, {1492, 2991}, {1090, 59}, {806, 2384}, {1681, 644}, {156, 785}, {13, 184}, {775, 2648}, {353, 2961}, {2440, 596}, {1297, 2608}, {1829, 358}, {2893, 2372}, {2322, 1979}, {592, 1953}, {2543, 267}, {827, 970}, {1926, 2840}, {1041, 400}, {1098, 323}, {1281, 1141}, {40, 1635}, {588, 609}, {1067, 2920}, {2597, 1293}, {298, 2586}, {1450, 1495}, {1375, 2238}, {97, 459}, {742, 1641}, {2652, 2923}, {2343, 1798}, {796, 1344}, {1103, 2592}, {2314, 1836}, {388, 1371}, {1126, 1731}, {176, 949}, {115, 2420}, {435, 2632}, {2243, 515}, {2689, 1527}, {422, 569}, {406, 1426}, {2039, 2458}, {781, 1278}, {1557, 913}, {969, 1382}, {18, 1942}, {832, 575}, {2952, 2348}, {1162, 2023}, {2508, 651}, {2494, 1182}, {2626, 1962}, {1253, 2288}, {1840, 137}, {1709, 2308}, {121, 1287}, {371, 2745}, {2458, 178}, {1470, 1691}, {1994, 1061}, {288, 2325}}, + 288, + }, + + // 可以有多个 testcase +} + +func Test_removeStones(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, removeStones(tc.stones), "输入:%v", tc) + } +} + +func Benchmark_removeStones(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeStones(tc.stones) + } + } +} diff --git a/Algorithms/0948.bag-of-tokens/README.md b/Algorithms/0948.bag-of-tokens/README.md new file mode 100755 index 000000000..142526d88 --- /dev/null +++ b/Algorithms/0948.bag-of-tokens/README.md @@ -0,0 +1,37 @@ +# [948. Bag of Tokens](https://leetcode.com/problems/bag-of-tokens/) + +You have an initial power P, an initial score of 0 points, and a bag of tokens. + +Each token can be used at most once, has a value token[i], and has potentially two ways to use it. + +- If we have at least token[i] power, we may play the token face up, losing token[i] power, and gaining 1 point. +- If we have at least 1 point, we may play the token face down, gaining token[i] power, and losing 1 point. + +Return the largest number of points we can have after playing any number of tokens. + +Example 1: + +```text +Input: tokens = [100], P = 50 +Output: 0 +``` + +Example 2: + +```text +Input: tokens = [100,200], P = 150 +Output: 1 +``` + +Example 3: + +```text +Input: tokens = [100,200,300,400], P = 200 +Output: 2 +``` + +Note: + +1. tokens.length <= 1000 +1. 0 <= tokens[i] < 10000 +1. 0 <= P < 10000 \ No newline at end of file diff --git a/Algorithms/0948.bag-of-tokens/bag-of-tokens.go b/Algorithms/0948.bag-of-tokens/bag-of-tokens.go new file mode 100755 index 000000000..f9efd4113 --- /dev/null +++ b/Algorithms/0948.bag-of-tokens/bag-of-tokens.go @@ -0,0 +1,34 @@ +package problem0948 + +import "sort" + +// ref: https://leetcode.com/problems/bag-of-tokens/discuss/197696/C%2B%2BJavaPython-Greedy-%2B-Two-Pointers + +func bagOfTokensScore(tokens []int, P int) int { + sort.Ints(tokens) + + maxScore, score := 0, 0 + i, j := 0, len(tokens)-1 + + for i <= j { + if P >= tokens[i] { + P -= tokens[i] + score++ + maxScore = score + // 因为 tokens 是升序排列 + // 所以,卖了 tokens[j] 后,肯定应该买得起 tokens[i] + // 除非 i==j,会导致 score-- 后, score 比真正的结果小 1 + // 于是,每次 score++ 后,score 肯定是最大值。 + // 使用 maxScore 记录一下,避免错误的结果。 + i++ + } else if score > 0 { + P += tokens[j] + score-- + j-- + } else { + break + } + } + + return maxScore +} diff --git a/Algorithms/0948.bag-of-tokens/bag-of-tokens_test.go b/Algorithms/0948.bag-of-tokens/bag-of-tokens_test.go new file mode 100755 index 000000000..2f51f8cd4 --- /dev/null +++ b/Algorithms/0948.bag-of-tokens/bag-of-tokens_test.go @@ -0,0 +1,63 @@ +package problem0948 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + tokens []int + P int + ans int +}{ + + { + []int{33, 4, 28, 24, 96}, + 35, + 3, + }, + + { + []int{26}, + 51, + 1, + }, + + { + []int{100, 200, 300, 400}, + 200, + 2, + }, + + { + []int{100}, + 50, + 0, + }, + + { + []int{100, 200}, + 150, + 1, + }, + + // 可以有多个 testcase +} + +func Test_bagOfTokensScore(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, bagOfTokensScore(tc.tokens, tc.P), "输入:%v", tc) + } +} + +func Benchmark_bagOfTokensScore(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + bagOfTokensScore(tc.tokens, tc.P) + } + } +} diff --git a/Algorithms/0949.largest-time-for-given-digits/README.md b/Algorithms/0949.largest-time-for-given-digits/README.md new file mode 100755 index 000000000..4548c1573 --- /dev/null +++ b/Algorithms/0949.largest-time-for-given-digits/README.md @@ -0,0 +1,26 @@ +# [949. Largest Time for Given Digits](https://leetcode.com/problems/largest-time-for-given-digits/) + +Given an array of 4 digits, return the largest 24 hour time that can be made. + +The smallest 24 hour time is 00:00, and the largest is 23:59. Starting from 00:00, a time is larger if more time has elapsed since midnight. + +Return the answer as a string of length 5. If no valid time can be made, return an empty string. + +Example 1: + +```text +Input: [1,2,3,4] +Output: "23:41" +``` + +Example 2: + +```text +Input: [5,5,5,5] +Output: "" +``` + +Note: + +1. A.length == 4 +1. 0 <= A[i] <= 9 diff --git a/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits.go b/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits.go new file mode 100755 index 000000000..aa2cd9a6c --- /dev/null +++ b/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits.go @@ -0,0 +1,47 @@ +package problem0949 + +import "fmt" + +var permutations = [][]int{ + {0, 1, 2, 3}, + {0, 1, 3, 2}, + {0, 2, 1, 3}, + {0, 2, 3, 1}, + {0, 3, 1, 2}, + {0, 3, 2, 1}, + {1, 0, 2, 3}, + {1, 0, 3, 2}, + {1, 2, 0, 3}, + {1, 2, 3, 0}, + {1, 3, 0, 2}, + {1, 3, 2, 0}, + {2, 0, 1, 3}, + {2, 0, 3, 1}, + {2, 1, 0, 3}, + {2, 1, 3, 0}, + {2, 3, 1, 0}, + {2, 3, 0, 1}, + {3, 0, 2, 1}, + {3, 0, 1, 2}, + {3, 1, 0, 2}, + {3, 1, 2, 0}, + {3, 2, 0, 1}, + {3, 2, 1, 0}, +} + +func largestTimeFromDigits(A []int) string { + h, m := -1, -1 + res := "" + for _, p := range permutations { + a, b, c, d := A[p[0]], A[p[1]], A[p[2]], A[p[3]] + ab, cd := a*10+b, c*10+d + if ab > 23 || + cd > 59 || + ab*60+cd <= h*60+m { + continue + } + h, m = ab, cd + res = fmt.Sprintf("%02d:%02d", h, m) + } + return res +} diff --git a/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits_test.go b/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits_test.go new file mode 100755 index 000000000..7b3d39fff --- /dev/null +++ b/Algorithms/0949.largest-time-for-given-digits/largest-time-for-given-digits_test.go @@ -0,0 +1,42 @@ +package problem0949 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans string +}{ + + { + []int{1, 2, 3, 4}, + "23:41", + }, + + { + []int{5, 5, 5, 5}, + "", + }, + + // 可以有多个 testcase +} + +func Test_largestTimeFromDigits(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largestTimeFromDigits(tc.A), "输入:%v", tc) + } +} + +func Benchmark_largestTimeFromDigits(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestTimeFromDigits(tc.A) + } + } +} diff --git a/Algorithms/0950.reveal-cards-in-increasing-order/README.md b/Algorithms/0950.reveal-cards-in-increasing-order/README.md new file mode 100755 index 000000000..be69923ea --- /dev/null +++ b/Algorithms/0950.reveal-cards-in-increasing-order/README.md @@ -0,0 +1,39 @@ +# [950. Reveal Cards In Increasing Order](https://leetcode.com/problems/reveal-cards-in-increasing-order/) + +In a deck of cards, every card has a unique integer. You can order the deck in any order you want. + +Initially, all the cards start face down (unrevealed) in one deck. + +Now, you do the following steps repeatedly, until all cards are revealed: + +1. Take the top card of the deck, reveal it, and take it out of the deck. +1. If there are still cards in the deck, put the next top card of the deck at the bottom of the deck. +1. If there are still unrevealed cards, go back to step 1. Otherwise, stop. + +Return an ordering of the deck that would reveal the cards in increasing order. + +The first entry in the answer is considered to be the top of the deck. + +Example 1: + +```text +Input: [17,13,11,2,3,5,7] +Output: [2,13,3,11,5,17,7] +Explanation: +We get the deck in the order [17,13,11,2,3,5,7] (this order doesn't matter), and reorder it. +After reordering, the deck starts as [2,13,3,11,5,17,7], where 2 is the top of the deck. +We reveal 2, and move 13 to the bottom. The deck is now [3,11,5,17,7,13]. +We reveal 3, and move 11 to the bottom. The deck is now [5,17,7,13,11]. +We reveal 5, and move 17 to the bottom. The deck is now [7,13,11,17]. +We reveal 7, and move 13 to the bottom. The deck is now [11,17,13]. +We reveal 11, and move 17 to the bottom. The deck is now [13,17]. +We reveal 13, and move 17 to the bottom. The deck is now [17]. +We reveal 17. +Since all the cards revealed are in increasing order, the answer is correct. +``` + +Note: + +1. 1 <= A.length <= 1000 +1. 1 <= A[i] <= 10^6 +1. A[i] != A[j] for all i != j \ No newline at end of file diff --git a/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order.go b/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order.go new file mode 100755 index 000000000..6873035ad --- /dev/null +++ b/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order.go @@ -0,0 +1,26 @@ +package problem0950 + +import "sort" + +func deckRevealedIncreasing(deck []int) []int { + sort.Ints(deck) + + size := len(deck) + + t := make([]int, 0, size*2) + b := 0 + + for i := size - 1; i >= 0; i-- { + t = append(t, deck[i]) + if i > 0 { + t = append(t, t[b]) + b++ + } + } + + for i, j := b, len(t)-1; i < j; i, j = i+1, j-1 { + t[i], t[j] = t[j], t[i] + } + + return t[b:] +} diff --git a/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order_test.go b/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order_test.go new file mode 100755 index 000000000..b4220e677 --- /dev/null +++ b/Algorithms/0950.reveal-cards-in-increasing-order/reveal-cards-in-increasing-order_test.go @@ -0,0 +1,47 @@ +package problem0950 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + deck []int + ans []int +}{ + + { + []int{340521, 308195, 414778, 856972, 402441, 590007, 348211, 666707, 657054, 539706, 632693, 816862, 711470, 94728, 153338, 4286, 49872, 437601, 642859, 98097, 240413, 865721, 253342, 29202, 166074, 766869, 740302, 929275, 770347, 702724, 703473, 85883, 686240, 452695, 584763, 307510, 382863, 818141, 891101, 939491, 654978, 588723, 19897, 341156, 495496, 925312, 414621, 600282, 494990, 102613, 830016, 95336, 718899, 584098, 85743, 127515, 194913, 504435, 619536, 674062, 394671, 307059, 552652, 37397, 206997, 71302, 587679, 872713, 425546, 436031, 539342, 931335, 7600, 801921, 330906, 233278, 496999, 373899, 487057, 898883, 330963, 940553, 25987, 238485, 423698, 194849, 608311, 445219, 995936, 848906, 821059, 813703, 736693, 618701, 710857, 829800, 161868, 918154, 514008, 741717, 210984, 313832, 159840, 931417, 9404, 779463, 715888, 33556, 473923, 497947, 734030, 205989, 57639, 252021, 622960, 477220, 410129, 330717, 995079, 493527, 325212, 706586, 467464, 678015, 204661, 923419, 83697, 501294, 694380, 650356, 18040, 775123, 985098, 696033, 135021, 900201, 321210, 736992, 860780, 589050, 904337, 416678, 678543, 384659, 585690, 937425, 863284, 93500, 699230, 565558, 803849, 664563, 411466, 273941, 464969, 813014, 388201, 543906, 257491, 953585, 284639, 994903, 654452, 968406, 864690, 700492, 557408, 59526, 920627, 895148, 25935, 510862, 995462, 4051, 127725, 195442, 880672, 363279, 785698, 259859, 73946, 817942, 393343, 58646, 82301, 890345, 220885, 179888, 814860, 969864, 339504, 223187, 945205, 844426, 780437, 822363, 433177, 281681, 921182, 96892, 413479, 302542, 584987, 581634, 777990, 643900, 443506, 491403, 370994, 600813, 521805, 444146, 917884, 302210, 172349, 558656, 670895, 454672, 47022, 257713, 210127, 564948, 274188, 859890, 73486, 453778, 22221, 957568, 186766, 129198, 412534, 316800, 649427, 45770, 496858, 763717, 764335, 468273, 840758, 866858, 845948, 303613, 127089, 964039, 678645, 991330, 290125, 975124, 591517, 307205, 664374, 52078, 178376, 451273, 503299, 456959, 309875, 960401, 320969, 309113, 844773, 940860, 823394, 329033, 200901, 755305, 119814, 892458, 59675, 178342, 897569, 293224, 834182, 745647, 15282, 641829, 638633, 342063, 474011, 316077, 653069, 550770, 821574, 357066, 104559, 254575, 955750, 938860, 828818, 959576, 242038, 733465, 539238, 654012, 127896, 741289, 409857, 205603, 315410, 306062, 966299, 414132, 868398, 499681, 272766, 91058, 818720, 24, 636007, 922632, 371509, 880679, 880348, 297788, 746839, 298507, 621113, 594894, 333655, 159347, 952368, 613085, 14538, 138433, 144488, 117404, 386082, 812662, 428489, 609566, 136480, 129656, 881380, 736917, 803733, 169759, 97531, 724019, 23867, 718245, 709275, 204992, 309979, 912104, 826418, 940412, 284839, 217358, 998517, 651632, 929402, 626008, 217257, 150049, 273217, 823909, 522085, 476558, 802766, 481609, 538128, 73869, 77995, 524597, 712191, 526303, 903786, 293051, 283533, 444298, 678509, 565341, 131944, 849449, 415543, 679279, 699487, 468216, 696630, 915086, 999832, 524212, 844066, 292383, 855336, 502486, 962935, 389168, 165263, 539223, 931090, 944144, 604706, 77857, 421858, 12322, 56167, 227907, 801951, 863613, 263982, 803706, 732394, 120924, 841596, 942599, 866843, 515069, 505075, 709508, 365828, 539119, 935822, 52403, 384068, 36137, 329331, 190246, 979081, 515881, 387377, 457384, 698759, 50214, 323059, 225206, 256988, 862672, 772897, 530895, 677918, 882647, 921559, 549915, 708462, 309665, 649081, 129902, 381934, 446383, 962920, 724557, 776473, 306948, 922841, 584825, 680870, 847321, 552370, 690900, 968662, 464930, 788520, 832026, 527725, 213744, 534899, 884579, 153871, 174164, 414753, 880381, 172408, 585299, 821450, 684523, 424280, 978543, 678648, 568765, 88098, 628021, 46897, 560387, 923096, 355942, 289721, 255527, 303699, 608368, 540830, 243289, 105347, 96833, 475437, 175954, 310999, 233396, 13274, 660571, 401096, 704722, 563450, 266468, 635987, 317967, 392048, 350999, 561057, 335538, 648327, 226509, 42185, 231038, 791283, 722087, 799410, 952751, 873448, 373329, 923612, 295029, 609712, 592772, 177609, 97584, 42022, 317549, 37368, 39211, 602764, 449014, 170668, 84246, 274211, 996592, 509178, 408916, 864999, 646886, 706351, 588061, 898946, 794804, 627699, 220735, 834784, 436922, 144896, 842435, 495157, 384749, 696641, 52719, 402570, 382215, 855528, 741741, 992277, 615091, 810558, 880743, 365840, 570713, 73147, 340168, 928037, 569566, 419484, 311613, 441233, 44048, 103169, 452623, 415175, 340954, 391322, 932083, 151701, 894617, 916722, 34527, 925736, 984694, 773548, 192016, 862092, 657710, 988582, 114761, 277002, 403344, 458117, 816925, 646096, 150555, 265813, 687119, 136548, 799320, 427446, 422710, 942682, 978670, 524964, 90961, 933814, 214770, 444577, 26149, 256622, 815776, 67614, 222127, 791955, 62518, 347830, 573207, 933852, 943510, 50312, 744310, 406884, 373020, 227023, 134105, 85642, 543225, 4219, 478229, 331031, 833705, 886039, 215980, 154957, 887585, 703564, 360167, 197129, 546325, 237829, 372919, 502454, 968537, 294018, 702134, 166473, 865832, 760017, 720863, 881253, 160268, 297009, 890740, 900954, 855793, 195406, 473842, 146865, 179929, 955179, 407097, 975225, 562796, 305073, 888321, 698197, 816558, 39082, 882732, 449932, 861691, 91652, 269099, 262645, 153554, 495586, 893186, 967400, 749496, 871174, 512042, 332084, 821155, 97423, 483425, 833967, 295381, 120141, 735117, 383739, 302516, 825418, 306564, 656643, 823259, 759161, 878374, 296726, 304647, 31557, 728298, 112024, 373665, 942563, 902277, 705325, 166897, 650301, 10088, 76990, 210118, 661290, 625930, 420631, 616514, 819513, 69325, 125068, 490640, 495636, 111094, 231715, 98372, 990421, 651332, 259782, 883282, 459704, 8034, 411191, 567683, 163158, 939733, 613989, 311030, 639938, 200594, 985851, 913200, 783381, 973639, 404978, 565317, 169306, 542229, 544121, 488696, 364125, 918286, 154315, 664568, 724737, 946235, 19809, 449481, 404159, 180205, 540240, 665439, 888298, 360643, 401417, 24997, 153728, 480714, 400335, 543323, 14853, 4453, 19163, 991379, 79148, 418146, 315301, 458752, 765658, 147227, 259435, 295569, 556553, 784997, 434398, 610043, 276507, 336216, 190657, 286593, 352698, 235756, 2737, 20626, 647496, 492822, 785401, 298967, 275046, 726903, 701700, 749909, 362234, 921627, 213122, 949182, 892242, 597387, 762784, 53661, 881204, 312569, 435667, 178265, 224147, 737721, 727778, 911410, 487210, 259523, 811532, 510532, 227777, 151870, 377834, 220628, 522457, 576772, 268011, 556101, 451092, 290341, 335381, 826715, 189403, 631702, 965884, 237771, 149048, 544539, 171573, 3378, 499233, 408339, 514495, 568249, 612337, 413729, 361787, 345549, 472826, 679129, 528852, 679054, 886876, 332700, 687939, 684652, 798870, 712731, 453954, 129383, 941555, 754331, 155371, 225400, 249987, 534722, 465349, 80735, 417217, 296985, 80101, 33837, 581373, 926520, 507839, 223949, 976053, 226328, 17439, 828614, 269768, 606731, 687685, 830672, 68819, 259277, 15294, 496390, 392444, 343187, 146893, 636091, 715526, 164207, 392748, 276056, 602607, 369190, 462401, 962986, 840142, 853993, 179269, 619809, 504247, 94169, 376790, 860117, 441111}, + []int{24, 749909, 2737, 495157, 3378, 995936, 4051, 495496, 4219, 754331, 4286, 495586, 4453, 882647, 7600, 495636, 8034, 755305, 9404, 496390, 10088, 938860, 12322, 496858, 13274, 759161, 14538, 496999, 14853, 882732, 15282, 497947, 15294, 760017, 17439, 499233, 18040, 966299, 19163, 499681, 19809, 762784, 19897, 501294, 20626, 883282, 22221, 502454, 23867, 763717, 24997, 502486, 25935, 939491, 25987, 503299, 26149, 764335, 29202, 504247, 31557, 884579, 33556, 504435, 33837, 765658, 34527, 505075, 36137, 985098, 37368, 507839, 37397, 766869, 39082, 509178, 39211, 886039, 42022, 510532, 42185, 770347, 44048, 510862, 45770, 939733, 46897, 512042, 47022, 772897, 49872, 514008, 50214, 886876, 50312, 514495, 52078, 773548, 52403, 515069, 52719, 967400, 53661, 515881, 56167, 775123, 57639, 521805, 58646, 887585, 59526, 522085, 59675, 776473, 62518, 522457, 67614, 940412, 68819, 524212, 69325, 777990, 71302, 524597, 73147, 888298, 73486, 524964, 73869, 779463, 73946, 526303, 76990, 994903, 77857, 527725, 77995, 780437, 79148, 528852, 80101, 888321, 80735, 530895, 82301, 783381, 83697, 534722, 84246, 940553, 85642, 534899, 85743, 784997, 85883, 538128, 88098, 890345, 90961, 539119, 91058, 785401, 91652, 539223, 93500, 968406, 94169, 539238, 94728, 785698, 95336, 539342, 96833, 890740, 96892, 539706, 97423, 788520, 97531, 540240, 97584, 940860, 98097, 540830, 98372, 791283, 102613, 542229, 103169, 891101, 104559, 543225, 105347, 791955, 111094, 543323, 112024, 985851, 114761, 543906, 117404, 794804, 119814, 544121, 120141, 892242, 120924, 544539, 125068, 798870, 127089, 546325, 127515, 941555, 127725, 549915, 127896, 799320, 129198, 550770, 129383, 892458, 129656, 552370, 129902, 799410, 131944, 552652, 134105, 968537, 135021, 556101, 136480, 801921, 136548, 556553, 138433, 893186, 144488, 557408, 144896, 801951, 146865, 558656, 146893, 942563, 147227, 560387, 149048, 802766, 150049, 561057, 150555, 894617, 151701, 562796, 151870, 803706, 153338, 563450, 153554, 998517, 153728, 564948, 153871, 803733, 154315, 565317, 154957, 895148, 155371, 565341, 159347, 803849, 159840, 565558, 160268, 942599, 161868, 567683, 163158, 810558, 164207, 568249, 165263, 897569, 166074, 568765, 166473, 811532, 166897, 569566, 169306, 968662, 169759, 570713, 170668, 812662, 171573, 573207, 172349, 898883, 172408, 576772, 174164, 813014, 175954, 581373, 177609, 942682, 178265, 581634, 178342, 813703, 178376, 584098, 179269, 898946, 179888, 584763, 179929, 814860, 180205, 584825, 186766, 988582, 189403, 584987, 190246, 815776, 190657, 585299, 192016, 900201, 194849, 585690, 194913, 816558, 195406, 587679, 195442, 943510, 197129, 588061, 200594, 816862, 200901, 588723, 204661, 900954, 204992, 589050, 205603, 816925, 205989, 590007, 206997, 969864, 210118, 591517, 210127, 817942, 210984, 592772, 213122, 902277, 213744, 594894, 214770, 818141, 215980, 597387, 217257, 944144, 217358, 600282, 220628, 818720, 220735, 600813, 220885, 903786, 222127, 602607, 223187, 819513, 223949, 602764, 224147, 995079, 225206, 604706, 225400, 821059, 226328, 606731, 226509, 904337, 227023, 608311, 227777, 821155, 227907, 608368, 231038, 945205, 231715, 609566, 233278, 821450, 233396, 609712, 235756, 911410, 237771, 610043, 237829, 821574, 238485, 612337, 240413, 973639, 242038, 613085, 243289, 822363, 249987, 613989, 252021, 912104, 253342, 615091, 254575, 823259, 255527, 616514, 256622, 946235, 256988, 618701, 257491, 823394, 257713, 619536, 259277, 913200, 259435, 619809, 259523, 823909, 259782, 621113, 259859, 990421, 262645, 622960, 263982, 825418, 265813, 625930, 266468, 915086, 268011, 626008, 269099, 826418, 269768, 627699, 272766, 949182, 273217, 628021, 273941, 826715, 274188, 631702, 274211, 916722, 275046, 632693, 276056, 828614, 276507, 635987, 277002, 975124, 281681, 636007, 283533, 828818, 284639, 636091, 284839, 917884, 286593, 638633, 289721, 829800, 290125, 639938, 290341, 952368, 292383, 641829, 293051, 830016, 293224, 642859, 294018, 918154, 295029, 643900, 295381, 830672, 295569, 646096, 296726, 996592, 296985, 646886, 297009, 832026, 297788, 647496, 298507, 918286, 298967, 648327, 302210, 833705, 302516, 649081, 302542, 952751, 303613, 649427, 303699, 833967, 304647, 650301, 305073, 920627, 306062, 650356, 306564, 834182, 306948, 651332, 307059, 975225, 307205, 651632, 307510, 834784, 308195, 653069, 309113, 921182, 309665, 654012, 309875, 840142, 309979, 654452, 310999, 953585, 311030, 654978, 311613, 840758, 312569, 656643, 313832, 921559, 315301, 657054, 315410, 841596, 316077, 657710, 316800, 991330, 317549, 660571, 317967, 842435, 320969, 661290, 321210, 921627, 323059, 664374, 325212, 844066, 329033, 664563, 329331, 955179, 330717, 664568, 330906, 844426, 330963, 665439, 331031, 922632, 332084, 666707, 332700, 844773, 333655, 670895, 335381, 976053, 335538, 674062, 336216, 845948, 339504, 677918, 340168, 922841, 340521, 678015, 340954, 847321, 341156, 678509, 342063, 955750, 343187, 678543, 345549, 848906, 347830, 678645, 348211, 923096, 350999, 678648, 352698, 849449, 355942, 679054, 357066, 995462, 360167, 679129, 360643, 853993, 361787, 679279, 362234, 923419, 363279, 680870, 364125, 855336, 365828, 684523, 365840, 957568, 369190, 684652, 370994, 855528, 371509, 686240, 372919, 923612, 373020, 687119, 373329, 855793, 373665, 687685, 373899, 978543, 376790, 687939, 377834, 856972, 381934, 690900, 382215, 925312, 382863, 694380, 383739, 859890, 384068, 696033, 384659, 959576, 384749, 696630, 386082, 860117, 387377, 696641, 388201, 925736, 389168, 698197, 391322, 860780, 392048, 698759, 392444, 991379, 392748, 699230, 393343, 861691, 394671, 699487, 400335, 926520, 401096, 700492, 401417, 862092, 402441, 701700, 402570, 960401, 403344, 702134, 404159, 862672, 404978, 702724, 406884, 928037, 407097, 703473, 408339, 863284, 408916, 703564, 409857, 978670, 410129, 704722, 411191, 863613, 411466, 705325, 412534, 929275, 413479, 706351, 413729, 864690, 414132, 706586, 414621, 962920, 414753, 708462, 414778, 864999, 415175, 709275, 415543, 929402, 416678, 709508, 417217, 865721, 418146, 710857, 419484, 999832, 420631, 711470, 421858, 865832, 422710, 712191, 423698, 931090, 424280, 712731, 425546, 866843, 427446, 715526, 428489, 962935, 433177, 715888, 434398, 866858, 435667, 718245, 436031, 931335, 436922, 718899, 437601, 868398, 441111, 720863, 441233, 979081, 443506, 722087, 444146, 871174, 444298, 724019, 444577, 931417, 445219, 724557, 446383, 872713, 449014, 724737, 449481, 962986, 449932, 726903, 451092, 873448, 451273, 727778, 452623, 932083, 452695, 728298, 453778, 878374, 453954, 732394, 454672, 992277, 456959, 733465, 457384, 880348, 458117, 734030, 458752, 933814, 459704, 735117, 462401, 880381, 464930, 736693, 464969, 964039, 465349, 736917, 467464, 880672, 468216, 736992, 468273, 933852, 472826, 737721, 473842, 880679, 473923, 740302, 474011, 984694, 475437, 741289, 476558, 880743, 477220, 741717, 478229, 935822, 480714, 741741, 481609, 881204, 483425, 744310, 487057, 965884, 487210, 745647, 488696, 881253, 490640, 746839, 491403, 937425, 492822, 749496, 493527, 881380, 494990}, + }, + + { + []int{17, 13, 11, 2, 3, 5, 7}, + []int{2, 13, 3, 11, 5, 17, 7}, + }, + + { + []int{1}, + []int{1}, + }, + + // 可以有多个 testcase +} + +func Test_deckRevealedIncreasing(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, deckRevealedIncreasing(tc.deck), "输入:%v", tc) + } +} + +func Benchmark_deckRevealedIncreasing(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + deckRevealedIncreasing(tc.deck) + } + } +} diff --git a/Algorithms/0951.flip-equivalent-binary-trees/README.md b/Algorithms/0951.flip-equivalent-binary-trees/README.md new file mode 100755 index 000000000..994d28ba4 --- /dev/null +++ b/Algorithms/0951.flip-equivalent-binary-trees/README.md @@ -0,0 +1,23 @@ +# [951. Flip Equivalent Binary Trees](https://leetcode.com/problems/flip-equivalent-binary-trees/) + +For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. + +A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations. + +Write a function that determines whether two binary trees are flip equivalent. The trees are given by root nodes root1 and root2. + +Example 1: + +```text +Input: root1 = [1,2,3,4,5,6,null,null,null,7,8], root2 = [1,3,2,null,6,4,5,null,null,null,null,8,7] +Output: true +Explanation: We flipped at nodes with values 1, 3, and 5. +Flipped Trees Diagram +``` + +![tree](tree.png) + +Note: + +1. Each tree will have at most 100 nodes. +1. Each value in each tree will be a unique integer in the range [0, 99]. \ No newline at end of file diff --git a/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees.go b/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees.go new file mode 100755 index 000000000..fc1e72a48 --- /dev/null +++ b/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees.go @@ -0,0 +1,25 @@ +package problem0951 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined in kit library +type TreeNode = kit.TreeNode + +func flipEquiv(r1, r2 *TreeNode) bool { + if r1 == nil && r2 == nil { + return true + } + + if (r1 != nil && r2 == nil) || + (r1 == nil && r2 != nil) || + r1.Val != r2.Val { + return false + } + + if (flipEquiv(r1.Left, r2.Left) && flipEquiv(r1.Right, r2.Right)) || + (flipEquiv(r1.Left, r2.Right) && flipEquiv(r1.Right, r2.Left)) { + return true + } + + return false +} diff --git a/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees_test.go b/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees_test.go new file mode 100755 index 000000000..95f200a91 --- /dev/null +++ b/Algorithms/0951.flip-equivalent-binary-trees/flip-equivalent-binary-trees_test.go @@ -0,0 +1,50 @@ +package problem0951 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root1 []int + root2 []int + ans bool +}{ + + { + []int{1, 2, 3, 4, 5, 6, kit.NULL, kit.NULL, kit.NULL, 7, 8}, + []int{1, 3, 2, kit.NULL, 6, 4, 5, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 8, 7}, + true, + }, + + { + []int{1, 2, 3, 4, 5, 6, kit.NULL, kit.NULL, kit.NULL, 7, 9}, + []int{1, 3, 2, kit.NULL, 6, 4, 5, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 8, 7}, + false, + }, + + // 可以有多个 testcase +} + +func Test_flipEquiv(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root1 := kit.Ints2TreeNode(tc.root1) + root2 := kit.Ints2TreeNode(tc.root2) + ast.Equal(tc.ans, flipEquiv(root1, root2), "输入:%v", tc) + } +} + +func Benchmark_flipEquiv(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root1 := kit.Ints2TreeNode(tc.root1) + root2 := kit.Ints2TreeNode(tc.root2) + flipEquiv(root1, root2) + } + } +} diff --git a/Algorithms/0951.flip-equivalent-binary-trees/tree.png b/Algorithms/0951.flip-equivalent-binary-trees/tree.png new file mode 100644 index 000000000..c834f0bbf Binary files /dev/null and b/Algorithms/0951.flip-equivalent-binary-trees/tree.png differ diff --git a/Algorithms/0952.largest-component-size-by-common-factor/1.png b/Algorithms/0952.largest-component-size-by-common-factor/1.png new file mode 100644 index 000000000..259ef1e9f Binary files /dev/null and b/Algorithms/0952.largest-component-size-by-common-factor/1.png differ diff --git a/Algorithms/0952.largest-component-size-by-common-factor/2.png b/Algorithms/0952.largest-component-size-by-common-factor/2.png new file mode 100644 index 000000000..947894807 Binary files /dev/null and b/Algorithms/0952.largest-component-size-by-common-factor/2.png differ diff --git a/Algorithms/0952.largest-component-size-by-common-factor/3.png b/Algorithms/0952.largest-component-size-by-common-factor/3.png new file mode 100644 index 000000000..bc9678c6c Binary files /dev/null and b/Algorithms/0952.largest-component-size-by-common-factor/3.png differ diff --git a/Algorithms/0952.largest-component-size-by-common-factor/README.md b/Algorithms/0952.largest-component-size-by-common-factor/README.md new file mode 100755 index 000000000..0160bdef1 --- /dev/null +++ b/Algorithms/0952.largest-component-size-by-common-factor/README.md @@ -0,0 +1,40 @@ +# [952. Largest Component Size by Common Factor](https://leetcode.com/problems/largest-component-size-by-common-factor/) + +Given a non-empty array of unique positive integers `A`, consider the following graph: + +- There are `A.length` nodes, labelled `A[0]` to `A[A.length - 1]`; +- There is an edge between `A[i]` and `A[j]` if and only if `A[i]` and `A[j]` share a common factor greater than 1. + +Return the size of the largest connected component in the graph. + +Example 1: + +```text +Input: [4,6,15,35] +Output: 4 +``` + +![example1](1.png) + +Example 2: + +```text +Input: [20,50,9,63] +Output: 2 +``` + +![example2](2.png) + +Example 3: + +```text +Input: [2,3,6,7,4,12,21,39] +Output: 8 +``` + +![example3](3.png) + +Note: + +1. `1 <= A.length <= 20000` +1. `1 <= A[i] <= 100000` diff --git a/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor.go b/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor.go new file mode 100755 index 000000000..59e33f0c5 --- /dev/null +++ b/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor.go @@ -0,0 +1,94 @@ +package problem0952 + +func largestComponentSize(A []int) int { + size := len(A) + u := newUnion(size) + + // rec = map[factor]index + rec := make(map[int]int, size*2) + + for i := 0; i < size; i++ { + a := A[i] + for f := 2; f*f <= a; f++ { + if a%f != 0 { + continue + } + if j, ok := rec[f]; ok { + u.union(i, j) + } else { + rec[f] = i + } + d := a / f + if j, ok := rec[d]; ok { + u.union(i, j) + } else { + rec[d] = i + } + } + // a 本身还可以作为 factor + if j, ok := rec[a]; ok { + u.union(i, j) + } else { + rec[a] = i + } + } + + return u.max +} + +// Robert Sedgewick 算法(第4版) 1.5.2.7 +// union-find (加权 quick-union),还作了路径压缩优化 + +type union struct { + parents []int // 父链接数组(由触点索引) + sizes []int // (由触点索引的) 各个根节点所对应的分量的大小 + max int +} + +func newUnion(N int) *union { + parents := make([]int, N) + for i := range parents { + parents[i] = i + } + counts := make([]int, N) + for i := range counts { + counts[i] = 1 + } + return &union{ + parents: parents, + sizes: counts, + max: 1, + } +} + +func (u *union) find(p int) int { + // 跟随连接找到根节点 + if u.parents[p] != p { + u.parents[p] = u.find(u.parents[p]) + } + return u.parents[p] +} + +func (u *union) union(p, q int) { + i, j := u.find(p), u.find(q) + if i == j { + return + } + + if u.sizes[i] > u.sizes[j] { + i, j = j, i + } + + // 将小树的根节点连接到大树的根节点 + u.parents[i] = j + u.sizes[j] += u.sizes[i] + u.max = max(u.max, u.sizes[j]) + return +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor_test.go b/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor_test.go new file mode 100755 index 000000000..adcd8f54d --- /dev/null +++ b/Algorithms/0952.largest-component-size-by-common-factor/largest-component-size-by-common-factor_test.go @@ -0,0 +1,56 @@ +package problem0952 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{4, 6, 15, 35}, + 4, + }, + + { + []int{20, 50, 9, 63}, + 2, + }, + + { + []int{2, 3, 6, 7, 4, 12, 21, 39}, + 8, + }, + + { + []int{2, 7, 522, 526, 535, 26, 944, 35, 519, 45, 48, 567, 266, 68, 74, 591, 81, 86, 602, 93, 610, 621, 111, 114, 629, 641, 131, 651, 142, 659, 669, 161, 674, 163, 180, 187, 190, 194, 195, 206, 207, 218, 737, 229, 240, 757, 770, 260, 778, 270, 272, 785, 274, 290, 291, 292, 296, 810, 816, 314, 829, 833, 841, 349, 880, 369, 147, 897, 387, 390, 905, 405, 406, 407, 414, 416, 417, 425, 938, 429, 432, 926, 959, 960, 449, 963, 966, 929, 457, 463, 981, 985, 79, 487, 1000, 494, 508}, + 84, + }, + + { + []int{5803, 6153, 13, 2062, 6161, 2068, 7172, 8219, 6174, 2080, 36, 4138, 6188, 8237, 46, 8240, 8242, 4151, 6202, 8253, 8269, 2126, 6226, 2135, 4187, 97, 102, 9233, 6263, 126, 3776, 2178, 4233, 8330, 9581, 8342, 152, 6297, 5487, 4253, 8350, 2208, 6308, 4262, 4263, 6314, 1053, 8373, 184, 4281, 2242, 8388, 6346, 6352, 2258, 6355, 2261, 2084, 4815, 6365, 2270, 225, 4330, 4333, 6525, 4341, 6390, 3455, 4355, 262, 8456, 6410, 2318, 6873, 4379, 6435, 297, 2439, 302, 2364, 2372, 334, 4431, 2387, 340, 8590, 345, 2400, 8548, 6508, 367, 4466, 371, 6516, 2429, 2662, 391, 2442, 8589, 398, 8595, 2452, 4506, 415, 2467, 8612, 8615, 4525, 6578, 8627, 4535, 2489, 445, 4542, 447, 8644, 4558, 629, 6611, 4567, 6564, 6620, 4582, 6638, 496, 4596, 2549, 4605, 513, 6660, 8714, 4620, 2579, 2585, 6685, 544, 4644, 557, 8816, 6717, 8767, 6723, 2628, 582, 4679, 3853, 4689, 2643, 599, 4700, 614, 8807, 618, 4882, 6768, 626, 4724, 2677, 2689, 642, 4740, 6790, 4749, 158, 8848, 5913, 4769, 2724, 2730, 4779, 8897, 717, 2206, 719, 2769, 8916, 6871, 4825, 2788, 8934, 6890, 751, 6898, 4855, 2811, 8960, 4915, 8967, 4877, 786, 2835, 2843, 2848, 6945, 2851, 8997, 2856, 6958, 6961, 9011, 9012, 9014, 6976, 4931, 4932, 842, 7309, 4947, 9046, 7001, 2910, 9055, 2917, 1169, 7017, 874, 7655, 9072, 2931, 9078, 2935, 9024, 7044, 9103, 912, 9105, 923, 5021, 7071, 1520, 5029, 2982, 5033, 2987, 7089, 7667, 2997, 950, 7533, 7096, 954, 6033, 5059, 970, 9719, 973, 3023, 1669, 5075, 3034, 2895, 5084, 9181, 7141, 7142, 3050, 9196, 7150, 9201, 1015, 5116, 9220, 9223, 3083, 1036, 1041, 175, 7197, 1055, 1057, 3108, 3109, 7212, 3123, 5173, 7223, 1081, 7007, 1085, 3143, 9293, 5424, 5205, 1893, 7266, 1128, 9325, 1146, 1157, 5258, 9357, 1166, 9361, 7325, 9385, 9392, 7346, 3254, 1208, 5309, 9412, 9416, 5321, 1229, 7374, 1238, 5339, 9436, 5344, 1254, 9451, 5368, 3326, 5376, 1282, 2945, 3341, 3343, 7440, 7441, 1298, 3348, 5397, 5398, 3351, 3633, 5416, 7465, 3975, 1325, 3376, 1335, 3385, 9536, 7492, 5445, 3399, 3402, 3408, 5462, 9559, 9934, 5474, 1383, 3437, 7535, 9593, 9597, 1406, 5503, 7555, 5511, 3464, 1423, 7568, 7570, 3651, 7573, 3481, 1437, 7589, 3496, 9649, 5559, 9665, 1474, 7627, 1487, 7632, 1495, 5592, 9126, 3558, 593, 7657, 9708, 3568, 5618, 595, 3575, 5625, 3583, 1536, 1537, 5634, 9131, 7685, 5646, 3601, 1556, 7705, 9757, 1572, 9777, 3635, 7736, 5692, 9795, 3656, 7773, 6758, 7783, 7792, 9842, 9847, 1667, 7813, 8813, 9873, 1682, 1683, 9880, 1648, 9899, 3756, 1710, 5811, 3769, 9916, 7114, 4725, 1728, 9924, 5835, 3790, 4387, 740, 7906, 5859, 1778, 3828, 3830, 1784, 9983, 1799, 9994, 5901, 1807, 1810, 5909, 8836, 1818, 5919, 5921, 1827, 7978, 5931, 3900, 1853, 7998, 3907, 8005, 8012, 3925, 8030, 3935, 3940, 5989, 8038, 3730, 5998, 3953, 8054, 1914, 6020, 6023, 1931, 1934, 6031, 8080, 1688, 8516, 1955, 4006, 4007, 6059, 6064, 1981, 4037, 6087, 1999, 2002, 4054, 8159, 4072, 6124, 2032, 4083, 2037, 8186}, + 439, + }, + // 可以有多个 testcase +} + +func Test_largestComponentSize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largestComponentSize(tc.A), "输入:%v", tc) + } +} + +func Benchmark_largestComponentSize(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestComponentSize(tc.A) + } + } +} diff --git a/Algorithms/0953.verifying-an-alien-dictionary/README.md b/Algorithms/0953.verifying-an-alien-dictionary/README.md new file mode 100755 index 000000000..ef4fd5d09 --- /dev/null +++ b/Algorithms/0953.verifying-an-alien-dictionary/README.md @@ -0,0 +1,36 @@ +# [953. Verifying an Alien Dictionary](https://leetcode.com/problems/verifying-an-alien-dictionary/) + +In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. + +Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographicaly in this alien language. + +Example 1: + +```text +Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz" +Output: true +Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted. +``` + +Example 2: + +```text +Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz" +Output: false +Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted. +``` + +Example 3: + +```text +Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz" +Output: false +Explanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info). +``` + +Note: + +1. 1 <= words.length <= 100 +1. 1 <= words[i].length <= 20 +1. order.length == 26 +1. All characters in words[i] and order are english lowercase letters. diff --git a/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary.go b/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary.go new file mode 100755 index 000000000..7b02db1b3 --- /dev/null +++ b/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary.go @@ -0,0 +1,29 @@ +package problem0953 + +func isAlienSorted(words []string, order string) bool { + indexs := make([]int, 123) + for i, c := range order { + indexs[c] = i + } + + less := func(i, j int) bool { + si, sj := len(words[i]), len(words[j]) + for k := 0; k < si && k < sj; k++ { + ii, ij := indexs[words[i][k]], indexs[words[j][k]] + switch { + case ii < ij: + return true + case ii > ij: + return false + } + } + return si <= sj + } + + for i := 1; i < len(words); i++ { + if !less(i-1, i) { + return false + } + } + return true +} diff --git a/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary_test.go b/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary_test.go new file mode 100755 index 000000000..d05f185fb --- /dev/null +++ b/Algorithms/0953.verifying-an-alien-dictionary/verifying-an-alien-dictionary_test.go @@ -0,0 +1,57 @@ +package problem0953 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + order string + ans bool +}{ + + { + []string{"skuxofhyqffmvem", "pivlrvyixuwkteq", "alsgqypugsbbobl", "aaeognfoaxhcfii", "mpyonsmytxdnysa", "midsibtcmyeshoy", "ozqieboykydhjlz", "bolwcxirutfkovw", "kmbgtngnzhldnql", "xrxbriikmpxrprn", "xasnbmzcyncynqf", "srvryjpvrkjfwum", "kxcytrfssxrrksl", "foiaripeubtyyox", "yyhnjykzexgksob", "tykvetxwxbnaghl", "pkfmfhnboutbzry", "mlxxxcpeapjhwvx", "jmtcevkbcurjqhp", "hpowpmxkjiufoyz", "trbrldyxjbthcwi", "elkqzwcdljzzilp", "xuututciwchdtgp", "dznknlxbhjqlnfp", "usvebdafpehvhnn", "vgztrhsazakvkoy", "ppeowsoiwauodrd", "rwfnkmwpowiilmn", "gnptotnrcujhobx", "rfesptvhuiwtzuv", "nncoygoxusmskdj", "zrdmgclmxuygrfa", "ccuprnhgisbhnlo", "iwwnyuooaxciddu", "kyyzpnkywltfyqf", "fwvfdgyhgwnedww", "inleqhipjuvaipy", "ggwajwbrmbsvzto", "smfnzvhxnzlttqq", "hgolraueyiveyff", "bcitwifwgcvnfiz", "tporichlcybalot", "axjnikarmsedfkf", "takwnduamciroyg", "jtoikpsttsdiusp", "tlwzeycxdkigmia", "gvktgerybyghsoi", "gexklhkdamzxsar", "eaescmsyvbfhjki", "izkzehqhdpfkcfd", "riygtdcgibpigjr", "hxnngtftblikoan", "hqeyivtoimdmcgw", "srgbehdjwgvkwfd", "syrqpdzhbwrohvw", "ulghcdyoaaimdsk", "yotgykrwulptddt", "vmujiultrruvicw", "bvgazhtfaxopncl", "tlygnypwvdpqruq", "gwghjruwprmaywb", "tmjlyehemrjllsf", "jbtollpqxhcxipc", "urryhtrjdcyyxgk", "fovuiicvzbvopje", "iocnnebdisktpto", "dizpowvljuxcuyp", "lmbryijbblvbfew", "hsbdhkhaqjsyezo", "xuzrakcohgkzvja", "rqytcuxmbexynso", "muvxuufnbdxpgqp", "kazzhqfnoerazdp", "ydcbxbysbzqavgq", "uvswbtjojzodhxx", "ogficmoxohwmacf", "rsxarauxrlsugzl", "ivxddltcdfqnsku", "flxhjxcbldrhmtg", "gwcgyybialciiaz", "euizzqwnnefihcz", "ttlzrgnwhgzkirj", "geomyyrdrhkimzv", "wfoxpjisclyoygt", "iunuvuqdkeqqacf", "vfftvmtoaanoafp", "ogzwqioazjyedjq", "iltzlygzsreqlkw", "paighhiwamnafai", "aslchefeszbmokl", "opvtsdbqxgppvmj", "kfjaofmhvgfjxja", "xiwykodfpgizgky", "qsznrasrvabazev", "qpevsngotolecsi"}, + "fhgbavxiyjpueqkodmtzncslwr", + false, + }, + + { + []string{"hello", "leetcode"}, + "hlabcdefgijkmnopqrstuvwxyz", + true, + }, + + { + []string{"word", "world", "row"}, + "worldabcefghijkmnpqstuvxyz", + false, + }, + + { + []string{"apple", "app"}, + "abcdefghijklmnopqrstuvwxyz", + false, + }, + + // 可以有多个 testcase +} + +func Test_isAlienSorted(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isAlienSorted(tc.words, tc.order), "输入:%v", tc) + } +} + +func Benchmark_isAlienSorted(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isAlienSorted(tc.words, tc.order) + } + } +} diff --git a/Algorithms/0954.array-of-doubled-pairs/README.md b/Algorithms/0954.array-of-doubled-pairs/README.md new file mode 100755 index 000000000..0be09b3fa --- /dev/null +++ b/Algorithms/0954.array-of-doubled-pairs/README.md @@ -0,0 +1,38 @@ +# [954. Array of Doubled Pairs](https://leetcode.com/problems/array-of-doubled-pairs/) + +Given an array of integers A with even length, return true if and only if it is possible to reorder it such that `A[2 * i + 1] = 2 * A[2 * i]` for every 0 <= i < len(A) / 2. + +Example 1: + +```text +Input: [3,1,3,6] +Output: false +``` + +Example 2: + +```text +Input: [2,1,2,6] +Output: false +``` + +Example 3: + +```text +Input: [4,-2,2,-4] +Output: true +Explanation: We can take two groups, [-2,-4] and [2,4] to form [-2,-4,2,4] or [2,4,-2,-4]. +``` + +Example 4: + +```text +Input: [1,2,4,16,8,4] +Output: false +``` + +Note: + +1. 0 <= A.length <= 30000 +1. A.length is even +1. -100000 <= A[i] <= 100000 diff --git a/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs.go b/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs.go new file mode 100755 index 000000000..b4b0fa9cb --- /dev/null +++ b/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs.go @@ -0,0 +1,50 @@ +package problem0954 + +import "sort" + +func canReorderDoubled(A []int) bool { + size := len(A) + A1, A2 := make([]int, 0, size), make([]int, 0, size) + for _, v := range A { + if v >= 0 { + A1 = append(A1, v) + } else { + A2 = append(A2, -v) + } + } + // 把负数单独分出来,并转换成正数的数列 + // 两个部分,就可以用相同的逻辑来处理了。 + return isPossible(A1) && isPossible(A2) +} + +func isPossible(A []int) bool { + size := len(A) + + if size%2 == 1 { + return false + } + + sort.Ints(A) + + count := 0 + i, j := 0, 1 + for j < size { + for A[i] < 0 { + i++ + } + double := A[i] * 2 + for (j < size && A[j] < double) || + j <= i { + j++ + } + if j == size || A[j] != double { + return false + } + A[j] = -1 + count++ + i++ + j++ + } + + return count == size/2 +} diff --git a/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs_test.go b/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs_test.go new file mode 100755 index 000000000..39db2932a --- /dev/null +++ b/Algorithms/0954.array-of-doubled-pairs/array-of-doubled-pairs_test.go @@ -0,0 +1,72 @@ +package problem0954 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + true, + }, + + { + []int{0, 0, 0, 0, 0, 0}, + true, + }, + + { + []int{1, 2, 4, 8}, + true, + }, + + { + []int{3, 1, 3, 6}, + false, + }, + + { + []int{2, 1, 2, 6}, + false, + }, + + { + []int{4, -2 }, + false, + }, + + { + []int{4, -2, 2, -4}, + true, + }, + + { + []int{1, 2, 4, 16, 8, 4}, + false, + }, + + // 可以有多个 testcase +} + +func Test_canReorderDoubled(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, canReorderDoubled(tc.A), "输入:%v", tc) + } +} + +func Benchmark_canReorderDoubled(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canReorderDoubled(tc.A) + } + } +} diff --git a/Algorithms/0955.delete-columns-to-make-sorted-ii/README.md b/Algorithms/0955.delete-columns-to-make-sorted-ii/README.md new file mode 100755 index 000000000..01b9f91f3 --- /dev/null +++ b/Algorithms/0955.delete-columns-to-make-sorted-ii/README.md @@ -0,0 +1,47 @@ +# [955. Delete Columns to Make Sorted II](https://leetcode.com/problems/delete-columns-to-make-sorted-ii/) + +We are given an array A of N lowercase letter strings, all of the same length. + +Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices. + +For example, if we have an array A = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef","vyz"]. + +Suppose we chose a set of deletion indices D such that after deletions, the final array has its elements in lexicographic order (A[0] <= A[1] <= A[2] ... <= A[A.length - 1]). + +Return the minimum possible value of D.length. + +Example 1: + +```text +Input: ["ca","bb","ac"] +Output: 1 +Explanation: +After deleting the first column, A = ["a", "b", "c"]. +Now A is in lexicographic order (ie. A[0] <= A[1] <= A[2]). +We require at least 1 deletion since initially A was not in lexicographic order, so the answer is 1. +``` + +Example 2: + +```text +Input: ["xc","yb","za"] +Output: 0 +Explanation: +A is already in lexicographic order, so we don't need to delete anything. +Note that the rows of A are not necessarily in lexicographic order: +ie. it is NOT necessarily true that (A[0][0] <= A[0][1] <= ...) +``` + +Example 3: + +```text +Input: ["zyx","wvu","tsr"] +Output: 3 +Explanation: +We have to delete every column. +``` + +Note: + +1. 1 <= A.length <= 100 +1. 1 <= A[i].length <= 100 \ No newline at end of file diff --git a/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii.go b/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii.go new file mode 100755 index 000000000..8b6888d44 --- /dev/null +++ b/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii.go @@ -0,0 +1,32 @@ +package problem0955 + +func minDeletionSize(A []string) int { + m, n := len(A), len(A[0]) + + // isBigger[i]=true means A[i]>A[i-1] + isBigger := make([]bool, m) + res := 0 + + for j := 0; j < n; j++ { + t := make([]bool, m) + i, count := 1, 1 + for ; i < m; i++ { + if isBigger[i] || + A[i][j] > A[i-1][j] { + t[i] = true + count++ + } else if A[i-1][j] > A[i][j] { + res++ + break + } + } + if count == m { // for now, all is sorted. + break + } + if i == m { // every string is checked + isBigger = t + } + } + + return res +} diff --git a/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii_test.go b/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii_test.go new file mode 100755 index 000000000..bd20b033c --- /dev/null +++ b/Algorithms/0955.delete-columns-to-make-sorted-ii/delete-columns-to-make-sorted-ii_test.go @@ -0,0 +1,62 @@ +package problem0955 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans int +}{ + + { + []string{"nobhttjnanwsfjaoythqlziymsvpqgxsfvpzmgoloppabwuzxyxrtvleozeffvuiobsnwrejqzaxrapmgcvnguugpqwaktbjuowr", "vnzaupgircggfdazttarjooyggjjfwgoezdesayffmfpdyfqzknbvkeunsxgfkvilmqzqxyxymbfklqowvqshwgrhqqutovxdquj", "jrxxdrlmeyfcsmsaxntrbxjjhsjitgdfsjdsqmzkaajhupidktqiwopbthaaukvgpzphgwsrzobmolgamoegiprphpnuyswvmrer", "rvqsgytjnymsuhpthsfixvsmaaffmjzczrcaviodivzxzjafdwzaftnmfneopzfucbvvwzzzorbpdnbxynsazmtgszimvmnlkzei", "qwcuafxeawbekrgkqzqjdjlygxasmmydkrpidnxezawcblqhdcldymxxytpllanuylgzdfsporccczayczwolxszolqgouaftebw", "hgacebtnnorodnjbwzfrxodcoexgcoljheypkswucrdwuzykrzttviuyooirscmazliqkzqtjucgfoewzlrufmuipnzihmrewrgp", "poiiqlckvgqjguiloqsambwtazngpkbxlxuyudpazegfjovdhcbexqyuzfphoaqqxgdqncqukxcnqzxqrnztogafefllnooldvzd", "saxjgvpdzvducqohlhviviigqwnvdfbjwfzudrskobxoxcnwkgkgkljwayazrdvbbbguhskcuhcpqrmgjqtwnsxubzxzcdyrfurh", "nlyhfleljrgkvcfrttbhxhsvqlehskvfkemzqlptfanctrgazyacjchfrwmxjbkdezpgyhkbtecputkbelracwgwqsmzumtnqazx", "xyfdjkzugkhliomgpmwxewrqqptenajhwmlnahepjzjnzybqlnkzzolvnvvijdnavmykpygksocyxqcmvargirtngaeubransrjz", "hmauiygfrvtallotnwhtweykggifyocnygxbibbishkwkshkbkobhwfohssxdlihknzzlcbfafddiqqznhqlgeycpzpdzkgwlqpl", "dqnorvruwcmrprqfucwtxqwjdtxonctgoypyqlhfkqsuvtbmfcfrbjjdglenteyzkksqcwhkgxdgafzgnecforlmsffpvqwhciaw", "dkcdkpttoxajqnbihprlrdkwwiivuyvxlbcdnfeclaqmiprvptahupvddgphhunjwmremymsnudpwnxdaovvfavxdmgfaotqbijx", "ojgssedmspxmftngpnicmysghydvlbfsxzmayhtjcqtvudnrlffnpuvlslcihxexqgpvrzcamzdsouzupaxhafjogryatvnsrmgt", "xqrjxzgowfzphmolckctnslrdmpvymmjrkmcabqnzebkbsqjuzifmvbuthdvpfkrqglldsyrmedwkyxzqjpggtwhiguefekcgqrz", "umvcxsfbqfypamhfqrhrifdtbkxpfjwfrmnfxdvghwgmlqhlotddlkgdbktzzmxyzbrvexwxwxdzzjynoojcuuyfljdwsnjupouj", "jxzhumhaecvsnolmzyjwxdxuvmcfnarfpqobjvvrguzekmwdgrqqwfwjdabcmbdgphzkkvckxbejkbgnphtiwtuwympkgqzyevaz", "ryrkzfjrvphycmhqovxdodjzcfhfisbsyxcxhgrolbqqsjmzpndgxjlpyiiarxbspnshcjjcfkemfjdkrtzmtbypymrpwckgksax", "xbnhcitibihydssekxkuxqxxnsypykwejmpbpfaajpippykfupcanqsrvuzjeqlwyxfkbhmvdteunxpecjduyiwdzjrwirtgffhr", "hlznpdalynzlzpvhwczfssdvblgdujzqmdietyrghrvfrlmtjvpjgxcycmzsucbbwlthbrsqbrewpqyfskitalevfsuyytdkvgfq", "zxmetstwhjgqbkcnuaqhtjilzwwuzuwvwcbeoqfvzohgbnsqadazmupycngvsqrtforvebxlhzfljbxldpjuprpsmjzfrcrdmeaq", "kbulkjgdfokeybdomgseeyblnhwlsptzvhygakzbzjptnnyhtlhgdmzfepsokakmcaeeytlhqyfquxpcktxqlxpfhfehksocgvfv", "zzzngsbzpamxbgkmedczejbaaafjvtisepbkrvstsabncxsthfjfioizxvppfqwazaaknyhxhufvvywusfqiblokjpqbeqmawilx", "opjagfdtqsgsodzbidjimyblcpqivrmcrfaulbuzulfwavimkmjrjfzbeuvtdpphspptrncuyefxsoctgrbziicpenckxitdsxev", "bxgrnjveicjmtgzthacrmmhhbhapmyakfkfbmldtvjdsuqyydkkwstaekeaxbazxleaapkbrzhfyonrqeuxeqgyreqhelkhvxebt", "wppdwufbsdcwxqufibzydwspjtjoygkhckvbnhtkaxcarrilgggdjdpqxaoopswvwnmqpnjlvqfyopsdemdblrkhkjhubmqpcnqa", "mkyrpfeyouhbcrrgrjtcxwafzpkghjcnelwikbbgktybexkyhbmkvplwpebormqhhdszdcmzdwgmvhmmimyfrqfhomcbjsxvgdrg", "jbpbchsjzbfrptibifazielpzrrosxxrkcrnyimmetmjejmkneihvsvphkutryrwsihvgdfkufiagtilhzxyjdiygqbzanjqrhfx", "cjzlxpnzfsmqzrbgkwdxtozaotwhajsngxqztkzkvzfkcjfcjnbztydhwdqvynpbtvhywocjflicratlgvgmojwzonpczjbybynm", "irudzaapcaakadlchpwuringeavwxzpnvkkefpovuhomjkfkbktmytfjcrnqaptkbacoozbbhuiqsklagfyksrxveetmokxtsaeq", "ohirkpimrbaickgzbejrbxmcsxpwydchtdwhiiyqiaiohqwolhhbvafkkneowxmaqrhaalyaffjxreazftdtnyylobbbxgswskew", "uqbbuhgywtkoqyuaygegxoeowczivecgkciabypgfgplmqowmojqtdknonxqkfyhfwomzdirbvkukmdequrezaqtuojmicaxcpfk", "cpduibajwldtjzkbigjxrpfhyzjvoewookzgnfuwhamrrypfsjzzquharpcevjzsbljixfiupwljcjxrtrrftiepsgoruykgcior", "saddyfxdpvctiotakglrdbaowduvvupqdwkmnealwxgpntvtdsfmriessrwwidbwratmebfreqlnahcphjvionmidxuzwjziggsr", "hhdpgzrbidmwzsswbnjzaiudxxkbbbuoezszvyqkdcucgahuwzdvghlhdnevuslzhdhspqpxqilpigojohzlrokaqkjpawhylpzk", "nrqlfenyomdhmxqvtqjfcphqfqjtduxijencdvudyqqhtygaziylucuuvkuciwrmttagrnfojslwgchdogdoupsbsbglhdzdufnn", "dhbgukrrrnioxivpfciaseovghiiqfiadvmojeyzdbszsoumehowbxhwnyvuxhyqgzgygfflvflyofodjoittschlurcdamlgjww", "calhlfhgppsikxpcpkjjoqjwivrdpsvwtmhgrjonnbzcyvmqzwxcddyixururvrbpnpbfjiadflzhvycgoivncoteplodztiugon", "oeoayqpytrbqogrpjqrftyuwrnmxqtzrudzgvbjedaguokeighusaoomgevpywragjgrlixkanmgzctgsdhkbxjsfbpodtoqisfe", "qcyaosryeclcqsyywgbmmnmtudytqbiwneemyyswssgjnasxyhsmkbjbjrpgtrruymyjewfwkomlzusvihpxuettmhjraroyklrx", "zixpuufjugkgaardcudctjkijaehtstncoircazqxhvbcfughqhlwatxbyfmeugbmseivolistmmkzhdtkfebexdusgjszwamcvx", "twiqzwqxfsgdhkdwjalejfzxudwvqpclxzqwzmfkxllzunmfmunnbjnfpzxkznmxwefyfvnhhrngiiagzvwgxlureiyhbteycsnl", "aibbqdrtsvhhnrqofawwdbqmphalczvyjlrotqkhttjnifbqkwotpphnjfyikfvssmgsnhkgjinkypzrdlxfsohmwnoynbehgcxz", "pxvfwtwlafycvqzozebolsompldxfhmnomnjddakhmdysyjmlalmkmmpcshvsclpfbmhviksbrogjrdooixctqlgalayioezshxo", "obzvnqimmvyxxjgnysrowbypfoolfkygbosbvroecunahoxtqtlvxweinutubcuaxmnpterplxokvbykabpmgfandumwsmqfiovj", "vdvvoukuisnggrahehjvmcffjqssorszpgvlyqkwdxfkfcyrpdyiihrzngvsolacrqluphbsgbolaxwqyxuhgrkzkkyacxxrcwtq", "xfvsfetyfzidgkcvraplasyzspypkpyeidpmnxodwjzrsvsxzbfmoemyvvzhtbsnnbmztaiijcpapxukeqcyjokvvzlwpfnjluiz", "jcndqdmqyrzphvhmzqwrfqbujzcovpprrvamuvtxpmacdppfpstjcjqehvlhkhlnrmcqdcjgdppdbziqczwtrnuxlahtljtbzjgn", "juotqnaeqsispfezjmkvzroivnnczpzxwnwbzodsyzjpqvieylmyiqejdsiloeatycacrcpgaapkpeafuoorjrymrqevfaqfczpa", "iblikloirsywhdmnfjwwozryvcwogrihgqfjqyfemaasfbosqielhseuplcxpvelercddvnyhcpqvlpjwqcbgnsmmlbusgirlzzb", "pezrxkgtsgoyxlfncnviteszrjcympupxestdeiirjamnhkulmcsubjonvjmhplunjtppalypoqfxvewhqxoiexlzgdcpanxfzup", "qmrzspkklimygtkpfdwjhnahhfndliodqpjmnftwqlqaaqgqvcyupljhrowivjylzyirftjvonqhitnzyaigntuijzkxtncqhksm", "juvuznetreylakribucjywjsckpiggnlwrjffabzjmuegdvxzyrjlclitllsayxwquagfgogtyqqgotntbxyobemvskwwpfchskz", "sxpusrsqduguxjzcmaaemqifazwmohbtfepzzwwsysmmsfbnihhluiahkoyhszcowjpfzzrizfrilpicxgiibipamzyznjhicfdi", "seyqpopooecldhydmqambxnxxiachmfdvcfefslfgxneownavqvzktfhqlldcvkopcvowduundrmurwcvtavkujkgsjvxqnmvoio", "xuqwkgeaugprlrqvxbynubpqxmrtzbgskkvhmmftyqxwksipefywfwbzkbyndufzrrnijqhhhasjagkunaanexpnrkxvwnmfneaf", "rsprllqjicbujdedunyeaasiwkvxeehszjjqwaqtlgyyoslilvomismzxzmtsnqdxnhfshzpuysjtwacwrfgxfvetcxribrshtbr", "onixzpwuxaelchmzvzzhezijjwyvwcesizwaarvlubjobxemlrpiosxtuocfbpnacbnrsuvhekskskqbrrmvomzrcjezunmzchlj", "xatqvgufdguhenbdqxhqyqlnsoflukpcsybpqkhqmvhamxnrzohejfddwhdhotwexbqppnlksgsuvqfgwwpouvgqcmmlxbksqgjd", "uvgcwzkmnrazrvfyffwsguooygpmqwsurgvxfjnfrywwfczmikhfymuyluflwchxsfhkmbbzslsvlhicfxomhmmohcfdmzkaahbm", "qgmqgzqkmmwuoveyvjcffebidcwvldmoszgzzrwdynzdmjuqgvfnaiykdhtonssyekywpmbeuftijgdvugvhvmurdhblohmvjxbd", "vyjiooeamfklryjkaofokbcurltjujrnniltrfrafgcmowwyspylckvbaoawahsdkdtsfsgzixtmwsqqylfddjcobbhiudsuermr", "istwcyruifilmalcynnpseuvdapbcrsowblopftdufiwoqytbzddfeuvcfkjcgmaoqmaqjkakatpronphslvsyhpcttwqqgdydcb", "onuapbtebwhjjxclktndnguegxdtenpipndduzavsxmhetykqqdbksvtdskmjojpjbzbgpawlvtrnxrmfhsttihyhgzhskgzfhxa", "sbtceulryccnzzuyzhmasuxpvibykoealyylaaxyxuzfqduppjjrjpbgyhkkitrpetncltrnapuaewnwssroctfbkuigrlutetjj", "uvfgtiaeieiybeslslxpzqtnrqteooxsrxgfoihuefuwwqdfoxxaneqfnsqzvdpbilvyyhmaeauewaolcambienmubdanhkuxcge", "ensmqnrzjltbdtyiaxzxzegyxpoypskxtunahevcxfqkcpbytdsysndgctalnlijhhrxbcgqviuhwbprllxciruyijvxxhpzscgo", "dynidnxljmbijllwwvjqcjoqgalikgzomxmlvoveyzshfvotjnbmdbyeipopmvlrbassfdvuqrukwjaxqgwxlqrcyxueykznnxjz", "rkxuubhscwjocyelteklgxifnorblunyadrjidsefscqznkwmhxkmztemaiajkciromvyfzzwiunyjrzmlwmldlhfthajvklatvl", "cgnlgaqrpqgktrylnthagdmsnhkggvyaqckfincsnavmdtuwjsrjrrskfrslrgxqcklgbwtlxduttvqttikfjrbskmwjqtbyavmo", "ewzflfemetkqqrnsnusbloyqwyvktkrhysxypsniiynivognelvujwcrlgjxiorglayuglbuiyuuydukdjrhzjiafupdibkcbgrk", "wjqtoxsvljfesolvkdyfqxmmpzvoocnyvxhwjpwvlhjpienyepflpnngzmvmztmgjawqegcvkzuyacmqipwulphnjaboldifpcoh", "tmckqvfumjtpmjmijytbuhrnnfltyqjagozieqgswyfpjgudduipqnfogorfugtjojmjdsautwvhivsylevfoznwnwbrjfknrrxg", "jhzqwbukqsbqfhnbvfftreqqjkzxbtvxfkeaxxccohsesdnttfgasqyiqsszwvdsjwmldnxvrwvyzeeagtjxxhklquyfruwurbsi", "tzuwyyojswwldxpzzhlylvhodsxirmwqklsmedegmbnzatchzlivdzzcqnmctclyxaiwmkinzuwjiehhjblrcevtpvjxzpkrkprb", "lsfzutypbznpiuplegezeouhltefsmqafycudgumetkmqqqmccxiuplmreegatxzsxxosmiepdwougsglifctzeifnvgiikuerea", "fwnmtllbophqgwikkmglnxvcftseyyuthnsnzazyptrqmaoukmuqkfrhzegnzpcowkzyyozmlqwqprgmhlgmiqxifbjvjyfvhtmp", "esnqustifizyijbngkwmkeworaathlqkenmdacnrcsdplkeipdjjditjofjmaylerlankqxelywqshookugwrcedzafxheuhpich", "pchwcigplovuhyqfdljqvmixrzinzmjkwzbshtcrupjcqejyrzeipibuqyiexfhxhsgvvmaqgtwwnmuclhvfnjsfozxcndelgyib", "zxrjngumnjhzdavthekeadsugmjnanyecxinulhcpfkynyncavbyeuyccyxpcxgxotjpjxfdgaxcwerybtpuhxgofircivkkjqzd", "yuaobmfqiunwovzyulkkhsrsarrauykfdkkcipjojfjmarlzhahcwwxdhknoybmxyinlivwupsxemzqrwxekbbogjsfebjucoxxq", "ammhctpsepgbagoafnpwaumammlcjcfbxqmztvzjumwujeylpotaswwtgwnkacngvsyikffefdxgcnvvqbayyrjvudrtgdhpuglj", "edknamctunqcijhnfcdiuseuvopwhkiwxcxdepstzesfyobvkmnrmfxgsybpdotwjtjvakwvhzximtiskkwzydehsthhyplbnhrc", "sifrawqfgcgbykecxppsiwxszqumdtxquguynqmevamwirhsdxvwfuytaljabhzrqoybwiyvywxmquwjboqqkprdxwblzzgsrqvi", "zopzxtlxsytnycerbtlbsokjadatritemzbvwmxxfdkyzamlezqekudwprprnlnszmfapweczixmzwuzgsbnkktlogfvvsajuwoe", "kfknjfcnqletleexwhwaiigsztoqczbpopsjcshjjoqmvposltoshvdtrxnoalfvvptmaaszxexyycnsivjdrwijzkzhpyucdfik", "yebnuukkmsldxswocmqhjsrmpymyeiyjyirbxfzpwjdqpbtiaaqnpuyifurtvjhieudsymmnpxydasmgitzzzcgnctyckzsohlwm", "dymvgjducexyedlbtponapnebmdkfdogouqpyibhuhsfprntcxxzykawvrprjzceaydjlozevpyeaxvckuqmxxjegfkvmxouyukz", "ulkhumuqnrxeusndjcjqxqjaivcsvktgdlxbmyydijrugqwhckxdghxanirqlzmufpnhnmkdsiymuqurtoodmqotufmyrgkvvlpl", "sxzkgmtehoqeouqbaeopsfratiekrelbfpqyrfhraxbkkiqmusrqcdtswbfnjndeehaawzlgayynzqywtudugdwyeupnraptwjjf", "hoxexviivuqqmggfxhsqxjmaqqnbunovmrbcakkhdqjkpopkhdaylpfrezzeckfgbijdunxpdzyveansmqpnfmydczzpmxtlxkbp", "xywmzjvuexvcnrbjeuaxabecistwssxeqxhldvpmbyehiyampuzqpagjebgmtetjmmcjncioegyvvilzrcwphkhhfxcxhnmuukwq", "avgqdewdnczmhjlxdvuejphbjjtqplsbrrunsknsushattrwbgugugeqembvahdkxhwvphkwtnzcfycoclwwzctcubmibztupbgb", "fowggwthyyvgdheaogzhlyiysnzujudxmfjvuwspqqdwdgzlxljursdsesyvfasqtmtzmohjehzfafilrlwwvchfwksqyrwizakx", "eubkidkyoqikppqlwealwdqkhimuvzuqnjbkjhwrojiurpukonttxnmkwlwtvujpyzxcyxutugzmjlpylrliiwbihsjsanaazofh", "jhagizqiwepckxdzxufccslxizelsgmmzzxymouzttrxoeshxqypqzrbuthsbqbnfczlnecxeczqgoxsbsleitmwpofwaxwvkmmn", "ophsohylthngescjeddixbgmtrhvnysmmylucbgwlpdqnljsztebfqcahjeqeeozsssfuisualzrgbihpdckrqarsylkklmnevpg", "czhvbrbjropeoagempmmsicdmtqimvtbkmndujqcgfqidsnvqphffdhwdoelmwiustgnadcgpzzrluxgfrjcsqmurdlzkactiqvm", "xddmrmupfsnqlidwsxopxbpbmkiklhqzmfxkpvfuebvwnkrjhmpxxmbrkplihiabctzoqavsilzsmeoujlbhcnclaohphekvwuhq", "cchrefbftixmfiekisqezsbvlcrtiihlgjuahdocpasplultieammaqmzqaqrefakecyvuhwiyztzemkbezpjbpocxirqwcyzjdj"}, + 74, + }, + + { + []string{"abx", "agz", "bgc", "bfc"}, + 1, + }, + + { + []string{"ca", "bb", "ac"}, + 1, + }, + + { + []string{"xga", "xfb", "yfa"}, + 1, + }, + + { + []string{"xc", "yb", "za"}, + 0, + }, + + { + []string{"zyx", "wvu", "tsr"}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_minDeletionSize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minDeletionSize(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minDeletionSize(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minDeletionSize(tc.A) + } + } +} diff --git a/Algorithms/0956.tallest-billboard/README.md b/Algorithms/0956.tallest-billboard/README.md new file mode 100755 index 000000000..abcf60bc2 --- /dev/null +++ b/Algorithms/0956.tallest-billboard/README.md @@ -0,0 +1,37 @@ +# [956. Tallest Billboard](https://leetcode.com/problems/tallest-billboard/) + +You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height. + +You have a collection of `rods` which can be welded together. For example, if you have rods of lengths 1, 2, and 3, you can weld them together to make a support of length 6. + +Return the largest possible height of your billboard installation. If you cannot support the billboard, return 0. + +Example 1: + +```text +Input: [1,2,3,6] +Output: 6 +Explanation: We have two disjoint subsets {1,2,3} and {6}, which have the same sum = 6. +``` + +Example 2: + +```text +Input: [1,2,3,4,5,6] +Output: 10 +Explanation: We have two disjoint subsets {2,3,5} and {4,6}, which have the same sum = 10. +``` + +Example 3: + +```text +Input: [1,2] +Output: 0 +Explanation: The billboard cannot be supported, so we return 0. +``` + +Note: + +1. `0 <= rods.length <= 20` +1. `1 <= rods[i] <= 1000` +1. `The sum of rods is at most 5000.` diff --git a/Algorithms/0956.tallest-billboard/tallest-billboard.go b/Algorithms/0956.tallest-billboard/tallest-billboard.go new file mode 100755 index 000000000..0409226c9 --- /dev/null +++ b/Algorithms/0956.tallest-billboard/tallest-billboard.go @@ -0,0 +1,48 @@ +package problem0956 + +// ref: https://leetcode.com/problems/tallest-billboard/discuss/203181/JavaC%2B%2BPython-DP-min(O(SN2)-O(3N2-*-N) + +const maxDiff = 5001 + +func tallestBillboard(rods []int) int { + dp := [maxDiff]int{} + // a pair of sum (a, b) with a > b, then dp[a - b] = b + // 每次都用更大的值去更新 dp[diff] + // 最后想要求的解在 dp[0] 中 + for d := 1; d < maxDiff; d++ { + dp[d] = -10000 + } + // NOTICE: dp[0]=0 + for _, r := range rods { + cur := dp + for d := 0; d+r < maxDiff; d++ { + // add r to the tall side + dp[d+r] = max(dp[d+r], cur[d]) + // add r to the low side + adr := abs(d - r) + dp[adr] = max(dp[adr], cur[d]+min(d, r)) + } + } + return dp[0] +} + +func abs(n int) int { + if n < 0 { + return -n + } + return n +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0956.tallest-billboard/tallest-billboard_test.go b/Algorithms/0956.tallest-billboard/tallest-billboard_test.go new file mode 100755 index 000000000..c68d4846e --- /dev/null +++ b/Algorithms/0956.tallest-billboard/tallest-billboard_test.go @@ -0,0 +1,47 @@ +package problem0956 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + rods []int + ans int +}{ + + { + []int{1, 2, 3, 6}, + 6, + }, + + { + []int{1, 2, 3, 4, 5, 6}, + 10, + }, + + { + []int{1, 2}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_tallestBillboard(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, tallestBillboard(tc.rods), "输入:%v", tc) + } +} + +func Benchmark_tallestBillboard(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + tallestBillboard(tc.rods) + } + } +} diff --git a/Algorithms/0957.prison-cells-after-n-days/README.md b/Algorithms/0957.prison-cells-after-n-days/README.md new file mode 100755 index 000000000..6e1c3fc29 --- /dev/null +++ b/Algorithms/0957.prison-cells-after-n-days/README.md @@ -0,0 +1,44 @@ +# [957. Prison Cells After N Days](https://leetcode.com/problems/prison-cells-after-n-days/) + +There are 8 prison cells in a row, and each cell is either occupied or vacant. + +Each day, whether the cell is occupied or vacant changes according to the following rules: + +- If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied. +- Otherwise, it becomes vacant. + +(Note that because the prison is a row, the first and the last cells in the row can't have two adjacent neighbors.) + +We describe the current state of the prison in the following way: cells[i] == 1 if the i-th cell is occupied, else cells[i] == 0. + +Given the initial state of the prison, return the state of the prison after N days (and N such changes described above.) + +Example 1: + +```text +Input: cells = [0,1,0,1,1,0,0,1], N = 7 +Output: [0,0,1,1,0,0,0,0] +Explanation: +The following table summarizes the state of the prison on each day: +Day 0: [0, 1, 0, 1, 1, 0, 0, 1] +Day 1: [0, 1, 1, 0, 0, 0, 0, 0] +Day 2: [0, 0, 0, 0, 1, 1, 1, 0] +Day 3: [0, 1, 1, 0, 0, 1, 0, 0] +Day 4: [0, 0, 0, 0, 0, 1, 0, 0] +Day 5: [0, 1, 1, 1, 0, 1, 0, 0] +Day 6: [0, 0, 1, 0, 1, 1, 0, 0] +Day 7: [0, 0, 1, 1, 0, 0, 0, 0] +``` + +Example 2: + +```text +Input: cells = [1,0,0,1,0,0,1,0], N = 1000000000 +Output: [0,0,1,1,1,1,1,0] +``` + +Note: + +1. cells.length == 8 +1. cells[i] is in {0, 1} +1. 1 <= N <= 10^9 \ No newline at end of file diff --git a/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days.go b/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days.go new file mode 100755 index 000000000..5827eb658 --- /dev/null +++ b/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days.go @@ -0,0 +1,36 @@ +package problem0957 + +func prisonAfterNDays(cells []int, N int) []int { + N = (N-1)%14 + 1 // every 14 steps is a loop + + n := cells2int(cells) + + for i := 0; i < N; i++ { + n = (^((n >> 1) ^ (n << 1))) & 0x7e + } + + return int2cells(n) +} + +func cells2int(cells []int) int { + res, size := 0, len(cells) + for i := 0; i < size; i++ { + res = res<<1 + cells[i] + } + return res +} + +func int2cells(n int) []int { + bits := uint(8) + cells := make([]int, bits) + i := 0 + for n > 0 { + cells[i] = n & 1 + n >>= 1 + i++ + } + for i, j := 0, int(bits-1); i < j; i, j = i+1, j-1 { + cells[i], cells[j] = cells[j], cells[i] + } + return cells +} diff --git a/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days_test.go b/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days_test.go new file mode 100755 index 000000000..c38959f61 --- /dev/null +++ b/Algorithms/0957.prison-cells-after-n-days/prison-cells-after-n-days_test.go @@ -0,0 +1,57 @@ +package problem0957 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + cells []int + N int + ans []int +}{ + + { + []int{1, 0, 0, 1, 0, 0, 0, 1}, + 826, + []int{0, 1, 1, 0, 1, 1, 1, 0}, + }, + + { + []int{0, 1, 0, 1, 1, 0, 0, 1}, + 1, + []int{0, 1, 1, 0, 0, 0, 0, 0}, + }, + + { + []int{0, 1, 0, 1, 1, 0, 0, 1}, + 7, + []int{0, 0, 1, 1, 0, 0, 0, 0}, + }, + + { + []int{1, 0, 0, 1, 0, 0, 1, 0}, + 1000000000, + []int{0, 0, 1, 1, 1, 1, 1, 0}, + }, + + // 可以有多个 testcase +} + +func Test_prisonAfterNDays(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, prisonAfterNDays(tc.cells, tc.N), "输入:%v", tc) + } +} + +func Benchmark_prisonAfterNDays(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + prisonAfterNDays(tc.cells, tc.N) + } + } +} diff --git a/Algorithms/0958.check-completeness-of-a-binary-tree/README.md b/Algorithms/0958.check-completeness-of-a-binary-tree/README.md new file mode 100755 index 000000000..1e0134676 --- /dev/null +++ b/Algorithms/0958.check-completeness-of-a-binary-tree/README.md @@ -0,0 +1,31 @@ +# [958. Check Completeness of a Binary Tree](https://leetcode.com/problems/check-completeness-of-a-binary-tree/) + +Given a binary tree, determine if it is a complete binary tree. + +Definition of a complete binary tree from [Wikipedia](http://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees): + +> In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h. + +Example 1: + +![ex1](ex1.png) + +```text +Input: [1,2,3,4,5,6] +Output: true +Explanation: Every level before the last is full (ie. levels with node-values {1} and {2, 3}), and all nodes in the last level ({4, 5, 6}) are as far left as possible. +``` + +Example 2: + +![ex2](ex2.png) + +```text +Input: [1,2,3,4,5,null,7] +Output: false +Explanation: The node with value 7 isn't as far left as possible. +``` + +Note: + +1. The tree will have between 1 and 100 nodes. \ No newline at end of file diff --git a/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree.go b/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree.go new file mode 100755 index 000000000..4f3a1d1f9 --- /dev/null +++ b/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree.go @@ -0,0 +1,33 @@ +package problem0958 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined. +type TreeNode = kit.TreeNode + +func isCompleteTree(root *TreeNode) bool { + queue := make([]*TreeNode, 1, 128) + + queue[0] = root + hasSeenNil := false + + for len(queue) > 0 { + size := len(queue) + for i := 0; i < size; i++ { + node := queue[i] + if node == nil { + hasSeenNil = true + continue + } + if hasSeenNil { + return false + } + queue = append(queue, node.Left, node.Right) + } + queue = queue[size:] + } + + return true +} diff --git a/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree_test.go b/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree_test.go new file mode 100755 index 000000000..7c5085f37 --- /dev/null +++ b/Algorithms/0958.check-completeness-of-a-binary-tree/check-completeness-of-a-binary-tree_test.go @@ -0,0 +1,45 @@ +package problem0958 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans bool +}{ + + { + []int{1, 2, 3, 4, 5, 6}, + true, + }, + + { + []int{1, 2, 3, 4, 5, kit.NULL, 7}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isCompleteTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, isCompleteTree(root), "输入:%v", tc) + } +} + +func Benchmark_isCompleteTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + isCompleteTree(root) + } + } +} diff --git a/Algorithms/0958.check-completeness-of-a-binary-tree/ex1.png b/Algorithms/0958.check-completeness-of-a-binary-tree/ex1.png new file mode 100644 index 000000000..9189e2cf9 Binary files /dev/null and b/Algorithms/0958.check-completeness-of-a-binary-tree/ex1.png differ diff --git a/Algorithms/0958.check-completeness-of-a-binary-tree/ex2.png b/Algorithms/0958.check-completeness-of-a-binary-tree/ex2.png new file mode 100644 index 000000000..9067fe328 Binary files /dev/null and b/Algorithms/0958.check-completeness-of-a-binary-tree/ex2.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/1.png b/Algorithms/0959.regions-cut-by-slashes/1.png new file mode 100644 index 000000000..eeed41bb0 Binary files /dev/null and b/Algorithms/0959.regions-cut-by-slashes/1.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/2.png b/Algorithms/0959.regions-cut-by-slashes/2.png new file mode 100644 index 000000000..4bce5fb85 Binary files /dev/null and b/Algorithms/0959.regions-cut-by-slashes/2.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/3.png b/Algorithms/0959.regions-cut-by-slashes/3.png new file mode 100644 index 000000000..84909b990 Binary files /dev/null and b/Algorithms/0959.regions-cut-by-slashes/3.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/4.png b/Algorithms/0959.regions-cut-by-slashes/4.png new file mode 100644 index 000000000..278de2030 Binary files /dev/null and b/Algorithms/0959.regions-cut-by-slashes/4.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/5.png b/Algorithms/0959.regions-cut-by-slashes/5.png new file mode 100644 index 000000000..8f02f3896 Binary files /dev/null and b/Algorithms/0959.regions-cut-by-slashes/5.png differ diff --git a/Algorithms/0959.regions-cut-by-slashes/README.md b/Algorithms/0959.regions-cut-by-slashes/README.md new file mode 100755 index 000000000..5eaeb18dd --- /dev/null +++ b/Algorithms/0959.regions-cut-by-slashes/README.md @@ -0,0 +1,85 @@ +# [959. Regions Cut By Slashes](https://leetcode.com/problems/regions-cut-by-slashes/) + +In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, \, or blank space. These characters divide the square into contiguous regions. + +(Note that backslash characters are escaped, so a \ is represented as "\\".) + +Return the number of regions. + +Example 1: + +```text +Input: +[ + " /", + "/ " +] + +Output: 2 +Explanation: The 2x2 grid is as follows: +``` + +![1](1.png) + +Example 2: + +```text +Input: +[ + " /", + " " +] +Output: 1 +Explanation: The 2x2 grid is as follows: +``` + +![2](2.png) + +Example 3: + +```text +Input: +[ + "\\/", + "/\\" +] +Output: 4 +Explanation: (Recall that because \ characters are escaped, "\\/" refers to \/, and "/\\" refers to /\.) +The 2x2 grid is as follows: +``` + +![3](3.png) + +Example 4: + +```text +Input: +[ + "/\\", + "\\/" +] +Output: 5 +Explanation: (Recall that because \ characters are escaped, "/\\" refers to /\, and "\\/" refers to \/.) +The 2x2 grid is as follows: +``` + +![4](4.png) + +Example 5: + +```text +Input: +[ + "//", + "/ " +] +Output: 3 +Explanation: The 2x2 grid is as follows: +``` + +![5](5.png) + +Note: + +1. 1 <= grid.length == grid[0].length <= 30 +1. grid[i][j] is either '/', '\', or ' '. \ No newline at end of file diff --git a/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes.go b/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes.go new file mode 100755 index 000000000..59a4c66c1 --- /dev/null +++ b/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes.go @@ -0,0 +1,81 @@ +package problem0959 + +func regionsBySlashes(grid []string) int { + m := len(grid) + + size := m * m * 4 + u := newUnion(size) + + // cut every square to 4 parts, and mark them + // \top/ + // \0/ + // left 3 X 1 right + // /2\ + // /down\ + for i := 0; i < m; i++ { + for j := 0; j < m; j++ { + baseIndex := (i*m + j) * 4 + top := baseIndex + 0 + right := baseIndex + 1 + down := baseIndex + 2 + left := baseIndex + 3 + switch grid[i][j] { + case '\\': + u.unite(top, right) + u.unite(down, left) + case '/': + u.unite(top, left) + u.unite(down, right) + default: + u.unite(top, right) + u.unite(right, down) + u.unite(down, left) + } + // right part unites right square's left + if j+1 < m { + rsl := baseIndex + 4 + 3 + u.unite(right, rsl) + } + // down part unites down square's top + if i+1 < m { + dst := baseIndex + 4*m + u.unite(down, dst) + } + } + } + + return u.count +} + +type union struct { + parent []int + count int +} + +func newUnion(size int) *union { + parent := make([]int, size) + for i := range parent { + parent[i] = i + } + return &union{ + parent: parent, + count: size, + } +} + +func (u *union) find(i int) int { + if u.parent[i] == i { + return i + } + u.parent[i] = u.find(u.parent[i]) + return u.parent[i] +} + +func (u *union) unite(x, y int) { + xp, yp := u.find(x), u.find(y) + if xp == yp { + return + } + u.parent[yp] = xp + u.count-- +} diff --git a/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes_test.go b/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes_test.go new file mode 100755 index 000000000..b0a1d7964 --- /dev/null +++ b/Algorithms/0959.regions-cut-by-slashes/regions-cut-by-slashes_test.go @@ -0,0 +1,79 @@ +package problem0959 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid []string + ans int +}{ + + { + []string{ + " /", + "/ ", + }, + 2, + }, + + { + []string{ + "/", + }, + 2, + }, + + { + []string{ + " /", + " ", + }, + 1, + }, + + { + []string{ + "\\/", + "/\\", + }, + 4, + }, + + { + []string{ + "/\\", + "\\/", + }, + 5, + }, + + { + []string{ + "//", + "/ ", + }, + 3, + }, + + // // 可以有多个 testcase +} + +func Test_regionsBySlashes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, regionsBySlashes(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_regionsBySlashes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + regionsBySlashes(tc.grid) + } + } +} diff --git a/Algorithms/0960.delete-columns-to-make-sorted-iii/README.md b/Algorithms/0960.delete-columns-to-make-sorted-iii/README.md new file mode 100755 index 000000000..90c496a9e --- /dev/null +++ b/Algorithms/0960.delete-columns-to-make-sorted-iii/README.md @@ -0,0 +1,44 @@ +# [960. Delete Columns to Make Sorted III](https://leetcode.com/problems/delete-columns-to-make-sorted-iii/) + +We are given an array `A` of `N` lowercase letter strings, all of the same length. + +Now, we may choose any set of deletion indices, and for each string, we delete all the characters in those indices. + +For example, if we have an array `A = ["babca","bbazb"]` and deletion indices `{0, 1, 4}`, then the final array after deletions is `["bc","az"]`. + +Suppose we chose a set of deletion indices D such that after deletions, the final array has **every element (row) in lexicographic order**. + +For clarity, `A[0]` is in lexicographic order (ie. `A[0][0] <= A[0][1] <= ... <= A[0][A[0].length - 1]), A[1]` is in lexicographic order (ie. `A[1][0] <= A[1][1] <= ... <= A[1][A[1].length - 1]`), and so on. + +Return the minimum possible value of `D.length`. + +Example 1: + +```text +Input: ["babca","bbazb"] +Output: 3 +Explanation: After deleting columns 0, 1, and 4, the final array is A = ["bc", "az"]. +Both these rows are individually in lexicographic order (ie. A[0][0] <= A[0][1] and A[1][0] <= A[1][1]). +Note that A[0] > A[1] - the array A isn't necessarily in lexicographic order. +``` + +Example 2: + +```text +Input: ["edcba"] +Output: 4 +Explanation: If we delete less than 4 columns, the only row won't be lexicographically sorted. +``` + +Example 3: + +```text +Input: ["ghi","def","abc"] +Output: 0 +Explanation: All rows are already lexicographically sorted. +``` + +Note: + +1. 1 <= A.length <= 100 +1. 1 <= A[i].length <= 100 \ No newline at end of file diff --git a/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii.go b/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii.go new file mode 100755 index 000000000..57cd0fd89 --- /dev/null +++ b/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii.go @@ -0,0 +1,40 @@ +package problem0960 + +// ref: https://leetcode.com/problems/delete-columns-to-make-sorted-iii/discuss/205679/C%2B%2BJavaPython-Maximum-Increasing-Subsequence + +func minDeletionSize(A []string) int { + m, n := len(A), len(A[0]) + res := n - 1 + + dp := make([]int, n) + // dp[i] means the longest subsequence ends with i-th element. + // For all i < j, if A[][i] <= A[][j], then dp[j] = max(dp[j], dp[i] + 1) + for i := 0; i < n; i++ { + dp[i] = 1 + } + + for j := 0; j < n; j++ { + for i := 0; i < j; i++ { + k := 0 + for ; k < m; k++ { + if A[k][i] > A[k][j] { + break + } + } + if k == m && // compared all strings + dp[j] < dp[i]+1 { // find longer sub string + dp[j] = dp[i] + 1 + } + } + res = min(res, n-dp[j]) + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii_test.go b/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii_test.go new file mode 100755 index 000000000..925375890 --- /dev/null +++ b/Algorithms/0960.delete-columns-to-make-sorted-iii/delete-columns-to-make-sorted-iii_test.go @@ -0,0 +1,73 @@ +package problem0960 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans int +}{ + + { + []string{"aaaabaa"}, + 1, + }, + + { + []string{"babca", "bbazb"}, + 3, + }, + + { + []string{"edcba"}, + 4, + }, + + { + []string{"ghi", "def", "abc"}, + 0, + }, + + { + []string{ + "deehdecfcgegffegghfhfaagcaaffbfahcfaghgdfggbbddbff", + "dchhgcbahdbdgbbaafhbgfggcbebfacdebhfgcfaafcgbgbggg", + "hehdggagfabdfbhegebhaaddcaghhegeegdgegagehhdhheecd", + "fhbbagbdffedafacbeahddbgagggdafceeabaffhhhhcedcfbh", + "caaefgdgefeahcgfgccaacdfabdgdbdhdbhbhfadbeaegbbdce", + "habgbahaeebeacccbdhfhddegfebheeffdbcbgfahhgbhcheeb", + "gfaaedgcachcehgdghebbhegbfagdgcdcgebddbdccbedbbhcd", + "badaebdbdgeadbfgchaegaddgdhdgaeaaedagacgbdecfdghca", + "eefcceffcggeefbecaceadbdcfccgbfgffgahfgeebafdcfhhb", + "aeebdahabfecbafgbcchbhdeecaadaccbahghcbdcfaeagehha", + }, + 48, + }, + + { + []string{"phmanpfeerddicoacphbpmkfdhjjokpapcfimqiaimrrrbiikhfafjlnsimblbogopfostsosfkebcioimpepaojer", "otpdmoeqqfaohfihkfeqqekhmoeiftkiqscnspshdbbhdgshbgllqqloirbghcdijsiboscqedjnppgltfftcbppdf", "ameslfrhjroforrsiagccbjngeetljsohijaslqccascnmbotaqcneccctfkormncfahfthgghimianlmgfedapngp", "rhafnippttlifdfmgpbrirfnklickrbaabnhjkqlseicsrmnpagakrcjsgrbfctdtifdreeitkqopnfjaggelgbhri", "nbtimdrfbdamdoigmkoccfljkndqefagioitjqskmbgejfihlqjmppsfehhqofrohnbqbklrsllkdstbrqpagfihoc", "gedokkanbsmnobeqakitkfsanafgfsdpmcmfofjcasgkbtffaoagpkdkbchlscergoqasqsekseatcjilmdliisjnb", "isohlmsspfqjjatqjhjgimjhcindfrqcnnjcojoebqsoajatbiottjhielqpaophidljbdohdddgohmpmgjjmdtbfl", "hffrakhnrgcgehaiispoijhjfrfpqmkqjqsrrogqbjdooriotiptoqajlccmdefpomggsetbkmkedphfgptaaasgjm", "fckgathcofjtadfjksphjfitoanrgfcqejdqsikjmrqtmtplmshbhdkaemblcncmgsmeisrrkgcqhdjhcarticolkn", "blikjgtmrfjgagtmpckjsdlkltbccpkileprmjmlmmidfbdplclatjdgqqmdrmoagharoshthpmjkahahtqfceshbg", "pciskclgnoteonjmcqgbscgbrsrafnrfbobgmqldmimorelgebnqebemqrlsdjaskhodkqprathdkahojgepfkjjpj", "qnicoehgsfhfcasqsipfhojbsmsdcdbdfbmepptjoideanhcadtqkeektgggskgbncmhqqskafohcdabgtoardhhhf", "bsncdfabthigiaglfipcastarjglrcccpadmsogjfnpfkmtkhgdkettshitbgoblfpftbnqckagrgjqkqfktgcsget", "lmgddsctcplqfedrhgophebkjgmpidieteogqhkqsjjfbedkenkschaakofmkndkrnfkbijckdgtimorfrecedhpta", "klljccpmdhntecipglsoijakoaoashagnhdjeseafbaprtgajhmogclrdpoldrpoqqgdomajrjciojltdjfspbrqdd", "odqaopclftopeljclltneknakqdiojdqbiaaijmsddcqdpaqaconptcbfpkghmspqkdnnnepenbrjelhidrhgkcoqm", "bqcdehrsjiggekrihmsojddoplmfcjgjhlrqnqgldqoadneebjtfffgrfdsonfpqmatoolknafndokpbnctgcamorf", "getpaimcjjnosietldpqkafnkqnfrarastqrqfmrogjtmnqhbbmppmbrahaofheaotqfpmpgshhrghsifiimiftoct", "kbqmgnarmsbmfejoabpoicnfabeabmpndrlsqecqdbhnthptrgqksfnkceltkmdedkjrnmdefqidtlninehmccdfmj", "beonkipjkbffprdjitprshflopstjjjclogpfrobhcmecqeppaolklhledbskocfekfshaishrlpjiapcgntkmbbgi", "llkbnfahptmeoisbjalrtttjcjmkoqgpeagnikmfmrmboimgclalbbqgdhgsgictnpbsgfgqeiapcafrgomlpirptl", "etcrribptmqaaimiolnlkfclaaabaghainraelqbeeqfngdsndmkggnblkacttrkmnlijophqiemsbjbgsnsnadabs", "qbfqpkdgmnopmtispdnntjkbgialiqcccfhpilfmnqsfjalgsiilqgkcthsmfktqidldfngpihorgposlshbenrdgi", "tcmnppsrtrimllheanbcpqerijhrqtfflglnkmcrktdihncoopadmdmknokkjddekokprcscedrokipctokbqtdhjf", "tnomaqbmdogejfsmdjfeidmldelnsgmfiastibhdqspnlihsmfhgeqdilbsietssnbodaamtihpsbndgttmetqsldh", "qinaamidenlabreftbbpshdsiikeitkofjnlntplkprnrdsrrbjljnjshkmsorignmrtnifldtsdmhislsjhcehdci", "rnshsmiliqfocjqehhojbiampbmjioqifrohotlektpblahthhpdbarefaqhefnbfkfeoljtlcbnonogkomdjmargn", "totcgptritgadkitcpfkmpfreaagldcokgcbnljrrcqppdqohsqbfnkrlgkngocnaaaaalhoshcpdflbtsjnkjptco", "tghpensgnjpjpbgnhmoafgciktkbtomsiairkdssrterdeobdoqrtmagckrpphfeqtmelbkenkbrgfmnokstmljorr", "dgfqrmlhdnijboqtbpidodfkdciaoemlblpljebajgmgdcsfiogltktadotbssonkefdtghdhjpbflhiostdmheqcm", "oincdrsdfqffedirnqcgiqqtpjpqfamcarhhhsbhflhbmiidknkbmfrcsjsdakgcnsrroeqiqttttppjphfghajcbf", "nppnlarjsenpktoatososblhiibenttdojkcpkfjgntihhtsoshtqsgdgtpkekakpmplpoakkpekliqgadecbbrjhe", "aacgacsteskloracbrdoiksbnfnblqdceahlhdknecabtqcljjgkhmkjqkbfqjlnlflfkgmptarbmnaeepehfecghi", "iiesrnktlemospboogeqipoobrdqoqbholpjtpmpgfgpktlgjmphqqqsgaioiqhpqecjrgrdipootsqhatrelraprf", "inkjdrqcipjkjrkoorkjinhmlsniecrpeoltteanjrjpbjgpjgngqnebejsaastckhdcsqtnorekefomligmcojiak", "pngtnomclgqoghcgkjkdktnamlemrbldldejjqjsfigqtgrrakmciiceqtshqkssklffbdgphlhaqslenfekgrskan", "gqljatqmbcblfcrppcqpmbnaiqpifkoecgjnfigsbqhamonjoiegjlabphteqgjifnsorpdgqmjdhpbebqscrpplsh", "snjisfprkjftlsoqglqbimtjqtmdflpqnqophiqpkbmahmlgtmrborqlkcdrolildtdlgqngmgslnltfckjniaacgn", "qqcbqkqasqsjrgkelodadsjsepqpepkkjjkiepngnhqhaheiitfckhplodiqhrnagsaqscrotdchdoaimsrfmcfbih", "idjqlejjkgqjatmqkmqjispfjjccbmjbsssjqmqnmjnksbnghgfltgfoesdqjjfiepllrcgdmngmpabkkjsnbgtegb", "tsqdeirrckbsdrikrhemedrgfqlaphlngkdopsjengmsefpraeekcntqmbedmqmsjleonfjrmhcelckjgctribetgl", "qhdfeicofasrdgnsitcjhkankjinmdhdtbgmlqlofglkjrssflbaeafblljlerphsmtmkjqcitgbtkgdfmcniemcac", "qldmtrdejgdhtnlenbhhkomlhppqibjcghbecaifnfmhkqjshopgarlpthckkbipabkrqfjajbihqbssrmgssgnqcp", "aoiclbfitikoatdgajrlghohadtqcgrnbcbrjjgipisbhismlrcgskbecgpalggmjefjcsnfgrcrftleanncrjnscj", "tfchpjfpmsoqimapoosclrstiqtgtkotgtnjiktqpasikegpqrlpthcsptairccfmgtqtjcrnmfepnpqonhjgpckep", "jicqaibcjbcrtqsqtsidtklcserqbtfqnekhsjcafdaldaksbsalgjteenoghkfdqcflhpklfkbrtbkogchqncoebl", "tbecetgjafhcnhadrbcefsnarolejrccdbjdtaqccqhthjhqbcfadqbplsqhhdkctlfkbcrdlmrbftjdmjgbephlhs", "ehmckejgmngkjgdfmicpftkilhbpfbdierbhaclcpggdakdmracfkbintdjbkpdhlaqrotamerjndeoajnrpfqnlse", "qiohbqfehmtmnhrimiisajraihalfdbggmcmhsgncihgmhrncnoospairaorapprmfetebledstkdafthtopskcrss", "llkbigjdctajlqaictbgigakfocdaapfdhmeitrpdmqoonefibdkssmtmrfnbmsolqrrigamiclbaqtsrndlhitqko", "ejjnrassbsdhhhmjbrkpbnjkdbhtjhiqkfelpdmnbnfijgtocspmdefigflhtlmpcpognefgebchgdfihetgmrmpbg", "cbpjaepsidnjcmspddsfslcaggmagicmqldldkkkbnbagdtbkfketakrfgidejhpjhdpobrejfmjntljjhjrdceptq", "kajbttoefedrhlrrkcpnlkqtlgsrblipecjjtrothhadqpalmnjmgbbqjnfjshmqckmsnarhqsicqqcgbrcimaocns", "ossbaroctfpaaamtakedlsbcsgorkgbddrgaticemnqkjoeroptkpeiacqglfhaoefefribhndjborprqsredkhqem", "cgmfpghgctochmgbarlcnongsgsgnfcnstoaapkrtnlianbrpokqgtnppniaohpimndrrsqitcdijiegrabpkhrfdk", "coclqpoqlhnofrtdcfjagidilpsdiboqtogelepehgrtsigkqqqftmpnefrngorithrgscpssspffhmschpqandpae", "depikqsrtfmstreabeeebhdmmiqlgheijimdpsejqfohfjjksrgorrlgbbtoaitosbaapjgrjthqpsksltafrbogkt", "bcgofiomhshnpdeokefjnactfomsforldadrtibefnkldppkganfeofhfllilmiatlhblspflbacthoiasrslkljqs", "mmalsspekhhmfdeprokntcsjeiqhjissreiatntjfgoaoleordieqclfomrsgmqmfkejtcjetonrhmtorsnaadlgab", "fnfojpijdepiheaqktkkglmrrcmcgbqdrcrerphgrrcdmfahpcrfqocgnrckfniktihbjmndkcmtmeqdelhgrndnan", "elpsetrdbshkggtnsfqmhahnaifdiqccfraeobginifkgtpqghhjrkgebdbbefienqqimigcsedtcqogsdfpcoijql", "lbdljabrerneobnbtfahiigncgthnkhjkbstbjmtthrcbrqtdfctgeihlptfjrsahpptqtgobpajphchgkiqleghgj", "knrgleatafghlhklpfmsdqilmcthtqrfisidmglpimeqaihjfsfslkopickkhhifoicciqsjaqfsqhpisrqllrkdlt", "ftocrlllikdeneosnntacblnqckcgjrbdnftcothadsjsjinnfnbjohkcnqhnatbeqlbokcbifiqhosbmdtqgrsmds", "jcamabaeerjefqhnfppbccsspqloaiifshsoetqcbbadtmgorelncrpombhdnrmmsmpedghrepkhioammcbhfilmld", "pkotmbfpdeclrfpgdimnjehcpbtjlhrdboggkpphscqaggcklcenfaroiniqghlatdfpelrermnltbleoclcaokmns", "fhbaacenerjdshderihnetnpratblmmjbmcdrsnjcajjcpqjibogahtgsarohmtimolgiobotibmfibppaimtmrftf", "kmsgjjgfpdhmhilkeiasqkfmgijljkttslqmddasgcjastgbcsgjhdlndjdlrmodopgblpbinjtilejblfhocnlppt", "aeedambescttbpsotgikpsabpihaltggmscmkodpkjkfjphmtfananigdtibgiblqsiodnrlgneqlbqtondfjrhroa", "ahqklnslrrpnrmeogafedeionhjgjnqkpkkbqamffrotjckqtokisbgntkeilosbfgtceasqmgjsnctatrdbmitreg", "ketmofdhlmakcjgbpcptpncbgmnjloeadndactassdtfkgebmanrltbcnhgsofpgadlajbeofajrnojlihkbnklbee", "fnjbssaojginmdcrschkcrmlsbihmrrdmntcqllhtkbhpotqdrqhjrtmbhjrasschsmarsgfikgrjberdbnkmobcet", "bemeodanetbndqmesjcspoksbcsicootbipabjrjieboqqqlssknkbmamapalhhracjftirkckirjcdeaisaebkehg", "qfhbpacfklbbiabnsimnbrsmjbrshjaoltofliajdgktdlsoejlnkapblpoedpnttoqrsrbsdlsciegtmljoleqhnk", "oiccnkflglqmjjsffcjkggqggblbpsjlrbbdbroikhsqqbmqimobnkpslnkagsfqhhhjiotttdkrcgkaktfkeaseoc", "emqardrgiqsalmongmefggdhqajlptfmcnoppinhiqltsjnicpbqtjamodkhqteicdkqnnoragtqfqcaeegfkftkpt", "gmimbbotkrsmfahrlcleagctndasggiiscapotkqoagelnfbcfqbqelkmdgrihdpaottsoegeabfroltebqiemhtsd", "dfsggtglaanlsrgjatsnhfcpaisccndjecsjnalbclmbtooqodpftbcoojqmfqaqteossldjkgneatdtpqolkokoil", "kqpilrcqoqtttnchomtscaakronjbhgtkraogsqielhicdjnskopnhaopkkiakspgtnrnrchoqosmdtjojeatoplqd", "trcckrjtmngokchcrcbharbnflqdjbnftdhlbrqhhpddolpngsknjdtsglircerrpplnlbjfbblkfmobdeoqjsijkb", "aqlqecbhofrhgjlnknaifhimrmetinfdtrlocalfnbkkofekfhnmlrtehncjqchlrpcndtqmhmkgsdprlbsragkonq", "iphmfigoffaqrfelreqgtnmbsmetennijejargpocdagagremtkcjkigfmqjrjcbrblfkktalrifdnirfphqhapmmk", "drctfeaeqdftkcqrkonnlisaegqtctsmjsbjplpqqodrmkltaltprfdhlkiqeililjmjbqrnlhficmkbbkpfdksosm", "lgfkpjtellkdghbjoblgenjodnmjjpqosjkjhedfirlcpltelhlkrojegkmbhcckifgfolglnbclgeaacsotrempjr", "tpafgdnpfleqnsjofjfgqkfcjrrqkccarrrskbskpcroddeatqhfmjhqlfqedqhrpfnarrfsjocopjhmbefoljqsqg", "oomodtqsalqfaqnpgcqmbmrsrqnkjomieohkhdmbkajhksjcbqlmgsfrbhsbreihjsgtbdeapcotigfkddkksoabaq", "graoppjibblfkrirsdrithbamqfogllfcgckjjmlgiaeepqjgnbsjnonfnqmikfmfeihpeoldjjbbgqleqmccnkirg", "ghrknahmbgtaiadhitotcroqkhsgjabahdnpcsrnfrlkjtgslrcbabhcansiecmmmjifrejtmcgbfhrhjobmrleqre", "qabesfqqhjimbshinbbadaplpmrrtinrhidelqdmjoogbhmdsktdmdtoisbbckaligtnqtfjgmpadfnihbrpqtlnrf", "asqqlsmjdtemglsmtmbekktqpmqjshfjkesentmcnhlgldkmlngannlrdohpjjmshiofcmplhaorhiacohooqbjetb"}, + 89, + }, + + // 可以有多个 testcase +} + +func Test_minDeletionSize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minDeletionSize(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minDeletionSize(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minDeletionSize(tc.A) + } + } +} diff --git a/Algorithms/0961.n-repeated-element-in-size-2n-array/README.md b/Algorithms/0961.n-repeated-element-in-size-2n-array/README.md new file mode 100755 index 000000000..1a7db68f5 --- /dev/null +++ b/Algorithms/0961.n-repeated-element-in-size-2n-array/README.md @@ -0,0 +1,32 @@ +# [961. N-Repeated Element in Size 2N Array](https://leetcode.com/problems/n-repeated-element-in-size-2n-array/) + +In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. + +Return the element repeated N times. + +Example 1: + +```text +Input: [1,2,3,3] +Output: 3 +``` + +Example 2: + +```text +Input: [2,1,2,5,3,2] +Output: 2 +``` + +Example 3: + +```text +Input: [5,1,5,2,5,3,5,4] +Output: 5 +``` + +Note: + +1. 4 <= A.length <= 10000 +1. 0 <= A[i] < 10000 +1. A.length is even \ No newline at end of file diff --git a/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array.go b/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array.go new file mode 100755 index 000000000..557cd8a07 --- /dev/null +++ b/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array.go @@ -0,0 +1,13 @@ +package problem0961 + +func repeatedNTimes(A []int) int { + hasSeen := [10000]bool{} + var res int + for _, res = range A { + if hasSeen[res] { + break + } + hasSeen[res] = true + } + return res +} diff --git a/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array_test.go b/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array_test.go new file mode 100755 index 000000000..05e328cfe --- /dev/null +++ b/Algorithms/0961.n-repeated-element-in-size-2n-array/n-repeated-element-in-size-2n-array_test.go @@ -0,0 +1,47 @@ +package problem0961 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, 2, 3, 3}, + 3, + }, + + { + []int{2, 1, 2, 5, 3, 2}, + 2, + }, + + { + []int{5, 1, 5, 2, 5, 3, 5, 4}, + 5, + }, + + // 可以有多个 testcase +} + +func Test_repeatedNTimes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, repeatedNTimes(tc.A), "输入:%v", tc) + } +} + +func Benchmark_repeatedNTimes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + repeatedNTimes(tc.A) + } + } +} diff --git a/Algorithms/0962.maximum-width-ramp/README.md b/Algorithms/0962.maximum-width-ramp/README.md new file mode 100755 index 000000000..bc29f2c09 --- /dev/null +++ b/Algorithms/0962.maximum-width-ramp/README.md @@ -0,0 +1,28 @@ +# [962. Maximum Width Ramp](https://leetcode.com/problems/maximum-width-ramp/) + +Given an array A of integers, a ramp is a tuple (i, j) for which i < j and A[i] <= A[j]. The width of such a ramp is j - i. + +Find the maximum width of a ramp in A. If one doesn't exist, return 0. + +Example 1: + +```text +Input: [6,0,8,2,1,5] +Output: 4 +Explanation: +The maximum width ramp is achieved at (i, j) = (1, 5): A[1] = 0 and A[5] = 5. +``` + +Example 2: + +```text +Input: [9,8,1,0,1,9,4,0,4,1] +Output: 7 +Explanation: +The maximum width ramp is achieved at (i, j) = (2, 9): A[2] = 1 and A[9] = 1. +``` + +Note: + +- 2 <= A.length <= 50000 +- 0 <= A[i] <= 50000 \ No newline at end of file diff --git a/Algorithms/0962.maximum-width-ramp/maximum-width-ramp.go b/Algorithms/0962.maximum-width-ramp/maximum-width-ramp.go new file mode 100755 index 000000000..daa0a7d0c --- /dev/null +++ b/Algorithms/0962.maximum-width-ramp/maximum-width-ramp.go @@ -0,0 +1,34 @@ +package problem0962 + +func maxWidthRamp(A []int) int { + size := len(A) + + stack := make([]int, 1, size) + top := 0 + for i := 1; i < size; i++ { + if A[stack[top]] > A[i] { + stack = append(stack, i) + top++ + } + } + + res := 0 + for j := size - 1; j >= 0 && top >= 0; j-- { + width := 0 + for top >= 0 && A[stack[top]] <= A[j] { + width = j - stack[top] + stack = stack[:top] + top-- + } + res = max(res, width) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0962.maximum-width-ramp/maximum-width-ramp_test.go b/Algorithms/0962.maximum-width-ramp/maximum-width-ramp_test.go new file mode 100755 index 000000000..60da4939b --- /dev/null +++ b/Algorithms/0962.maximum-width-ramp/maximum-width-ramp_test.go @@ -0,0 +1,56 @@ +package problem0962 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{6, 7, 8, 8, 6, 5, 5, 8, 2, 2}, + 7, + }, + + { + []int{312, 433, 973, 998, 384, 703, 589, 547, 234, 781, 447, 22, 865, 613, 683, 851, 564, 845, 430, 440, 898, 383, 244, 643, 808, 304, 650, 847, 314, 378, 494, 487, 417, 323, 837, 570, 799, 460, 2, 903, 83, 226, 835, 146, 666, 154, 602, 705, 336, 40, 801, 19, 448, 726, 539, 72, 511, 694, 527, 79, 69, 394, 875, 415, 942, 756, 398, 347, 899, 228, 952, 119, 187, 92, 335, 64, 577, 929, 100, 933, 893, 513, 799, 742, 913, 928, 400, 450, 289, 67, 434, 853, 817, 967, 452, 796, 309, 188, 728, 497, 977, 726, 618, 987, 445, 395, 636, 209, 285, 788, 63, 329, 289, 826, 2, 450, 990, 126, 394, 380, 438, 900, 738, 549, 625, 657, 732, 700, 768, 523, 711, 328, 337, 179, 960, 660, 873, 739, 247, 326, 608, 281, 337, 337, 578, 441, 185, 199, 379, 292, 963, 724, 424, 252, 594, 110, 227, 921, 538, 849, 212, 22, 898, 163, 132, 911, 91, 206, 183, 879, 723, 919, 276, 257, 734, 395, 122, 104, 818, 987, 554, 679, 373, 127, 953, 847, 443, 509, 471, 657, 53, 686, 532, 393, 596, 918, 643, 777, 192, 10, 512, 490, 371, 363, 67, 861, 898, 555, 942, 35, 725, 584, 941, 767, 340, 89, 702, 207, 195, 386, 510, 233, 80, 434, 940, 804, 767, 618, 382, 310, 977, 527, 683, 8, 46, 233, 712, 310, 847, 111, 545, 405, 224, 29, 126, 407, 623, 466, 775, 131, 364, 588, 591, 982, 902, 354, 871, 554, 808, 118, 993, 176, 496, 903, 350, 370, 749, 941, 581, 988, 532, 984, 537, 404, 297, 750, 654, 580, 162, 976, 42, 153, 694, 194, 235, 773, 291, 102, 556, 795, 457, 113, 466, 432, 569, 2, 206, 746, 94, 77, 712, 758, 550, 451, 107, 493, 695, 386, 615, 767, 560, 175, 65, 599, 314, 77, 175, 611, 550, 210, 457, 122, 769, 411, 330, 163, 692, 504, 475, 297, 618, 360, 875, 291, 933, 766, 394, 965, 447, 478, 85, 577, 123, 445, 584, 525, 634, 883, 221, 618, 69, 167, 907, 751, 176, 375, 491, 780, 677, 696, 106, 317, 406, 29, 546, 457, 870, 621, 868, 951, 442, 570, 958, 331, 346, 194, 378, 944, 400, 739, 120, 665, 403, 267, 952, 71, 833, 486, 322, 494, 333, 402, 315, 159, 429, 104, 606, 0, 922, 745, 419, 45, 313, 99, 396, 928, 246, 139, 88, 55, 239, 158, 487, 313, 409, 708, 107, 967, 6, 192, 301, 100, 25, 121, 596, 233, 669, 571, 614, 662, 149, 715, 505, 558, 817, 122, 269, 643, 584, 137, 749, 846, 605, 33, 897, 233, 349, 209, 991, 932, 448, 699, 310, 223, 460, 501, 751, 605, 694, 970, 0, 758, 540, 261, 4, 458, 89, 75, 565, 63, 672, 306, 149, 452, 163, 971, 392, 603, 590, 134, 250, 47, 738, 472, 17, 160, 855, 80, 499, 950, 338, 355, 241, 599, 580, 666, 901, 21, 999, 197, 695, 771, 599, 278, 883, 334, 385, 482, 286, 62, 968, 149, 29, 259, 889, 890, 265, 882, 436, 397, 160, 268, 973, 57, 284, 296, 576, 242, 836, 204, 344, 782, 539, 327, 542, 795, 825, 813, 475, 430, 145, 481, 508, 613, 348, 954, 827, 258, 469, 417, 933, 629, 242, 90, 425, 686, 494, 47, 202, 320, 804, 834, 3, 914, 722, 798, 868, 48, 595, 973, 533, 786, 834, 852, 621, 45, 458, 953, 347, 390, 135, 405, 596, 47, 112, 433, 854, 522, 575, 961, 18, 131, 445, 964, 237, 893, 279, 237, 415, 741, 712, 832, 428, 190, 288, 291, 648, 724, 583, 952, 575, 893, 250, 221, 471, 128, 921, 200, 855, 684, 258, 835, 86, 689, 777, 122, 974, 115, 575, 196, 739, 996, 572, 355, 202, 280, 333, 650, 520, 286, 409, 174, 976, 852, 335, 812, 147, 297, 666, 828, 234, 763, 61, 132, 550, 124, 105, 511, 438, 997, 199, 31, 471, 760, 134, 283, 283, 494, 312, 405, 767, 225, 944, 214, 512, 206, 738, 720, 833, 212, 65, 225, 495, 380, 71, 852, 309, 345, 723, 857, 825, 109, 649, 901, 356, 324, 903, 654, 953, 180, 777, 142, 321, 929, 654, 583, 145, 878, 632, 519, 648, 766, 64, 239, 892, 898, 498, 883, 645, 567, 307, 342, 356, 97, 882, 548, 589, 780, 755, 672, 768, 494, 175, 379, 155, 115, 121, 148, 887, 876, 49, 898, 81, 617, 976, 401, 781, 308, 220, 74, 698, 569, 976, 407, 500, 389, 18, 69, 344, 712, 37, 198, 398, 708, 982, 500, 407, 632, 39, 900, 967, 675, 730, 69, 266, 75, 158, 732, 854, 34, 697, 528, 936, 721, 329, 460, 891, 595, 902, 774, 306, 109, 51, 253, 597, 648, 318, 571, 419, 915, 266, 803, 39, 851, 369, 482, 857, 616, 858, 301, 978, 389, 888, 594, 609, 843, 919, 349, 283, 112, 270, 118, 644, 598, 424, 431, 559, 475, 43, 784, 49, 451, 224, 869, 582, 789, 140, 443, 975, 190, 313, 621, 480, 502, 349, 55, 945, 596, 725, 115, 104, 155, 29, 396, 104, 258, 702, 753, 572, 948, 936, 570, 458, 310, 253, 951, 46, 814, 257, 156, 140, 40, 438, 682, 657, 833, 920, 514, 473, 21, 920, 267, 318, 297, 296, 86, 650, 481, 480, 225, 547, 265, 747, 994, 36, 0, 584, 982, 181, 680, 141, 505, 2, 298, 83, 901, 513, 66, 242, 787, 961, 851, 516, 638, 697, 38, 234, 771, 542, 89, 947, 682, 799, 338, 358, 695, 395, 440, 892, 357, 546, 518, 468, 874, 456, 654, 716, 369, 325, 621, 943, 314, 225, 664, 423, 413, 461, 485, 56, 77, 524, 626, 89, 670, 792, 607, 553, 860, 673, 300, 248, 375, 76, 417, 865, 236, 274, 129, 658, 954, 167, 52, 594, 308, 22, 758, 539, 477, 599, 695, 310, 947, 945, 428, 844, 812, 920, 146, 684, 418, 466, 239, 537, 800, 918, 577, 515, 502, 708, 366}, + 999, + }, + + { + []int{2, 3, 1, 4}, + 3, + }, + { + []int{6, 0, 8, 2, 1, 5}, + 4, + }, + + { + []int{9, 8, 1, 0, 1, 9, 4, 0, 4, 1}, + 7, + }, + + // 可以有多个 testcase +} + +func Test_maxWidthRamp(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxWidthRamp(tc.A), "输入:%v", tc) + } +} + +func Benchmark_maxWidthRamp(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxWidthRamp(tc.A) + } + } +} diff --git a/Algorithms/0963.minimum-area-rectangle-ii/1.png b/Algorithms/0963.minimum-area-rectangle-ii/1.png new file mode 100644 index 000000000..f54541fa2 Binary files /dev/null and b/Algorithms/0963.minimum-area-rectangle-ii/1.png differ diff --git a/Algorithms/0963.minimum-area-rectangle-ii/2.png b/Algorithms/0963.minimum-area-rectangle-ii/2.png new file mode 100644 index 000000000..348ad9062 Binary files /dev/null and b/Algorithms/0963.minimum-area-rectangle-ii/2.png differ diff --git a/Algorithms/0963.minimum-area-rectangle-ii/3.png b/Algorithms/0963.minimum-area-rectangle-ii/3.png new file mode 100644 index 000000000..837eecc31 Binary files /dev/null and b/Algorithms/0963.minimum-area-rectangle-ii/3.png differ diff --git a/Algorithms/0963.minimum-area-rectangle-ii/4.png b/Algorithms/0963.minimum-area-rectangle-ii/4.png new file mode 100644 index 000000000..016c824a8 Binary files /dev/null and b/Algorithms/0963.minimum-area-rectangle-ii/4.png differ diff --git a/Algorithms/0963.minimum-area-rectangle-ii/README.md b/Algorithms/0963.minimum-area-rectangle-ii/README.md new file mode 100755 index 000000000..1343cfd12 --- /dev/null +++ b/Algorithms/0963.minimum-area-rectangle-ii/README.md @@ -0,0 +1,53 @@ +# [963. Minimum Area Rectangle II](https://leetcode.com/problems/minimum-area-rectangle-ii/) + +Given a set of points in the xy-plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to the x and y axes. + +If there isn't any rectangle, return 0. + +Example 1: + +![1](1.png) + +```text +Input: [[1,2],[2,1],[1,0],[0,1]] +Output: 2.00000 +Explanation: The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1], with an area of 2. +``` + +Example 2: + +![2](2.png) + +```text +Input: [[0,1],[2,1],[1,1],[1,0],[2,0]] +Output: 1.00000 +Explanation: The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0], with an area of 1. +``` + +Example 3: + +![3](3.png) + +```text +Input: [[0,3],[1,2],[3,1],[1,3],[2,1]] +Output: 0 +Explanation: There is no possible rectangle to form from these points. +``` + +Example 4: + +![4](4.png) + +```text +Input: [[3,1],[1,1],[0,1],[2,1],[3,3],[3,2],[0,2],[2,3]] +Output: 2.00000 +Explanation: The minimum area rectangle occurs at [2,1],[2,3],[3,3],[3,1], with an area of 2. +``` + +Note: + +- 1 <= points.length <= 50 +- 0 <= points[i][0] <= 40000 +- 0 <= points[i][1] <= 40000 +- All points are distinct. +- Answers within 10^-5 of the actual value will be accepted as correct. \ No newline at end of file diff --git a/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii.go b/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii.go new file mode 100755 index 000000000..230ed0998 --- /dev/null +++ b/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii.go @@ -0,0 +1,47 @@ +package problem0963 + +import "math" + +func minAreaFreeRect(points [][]int) float64 { + size := len(points) + res := math.MaxFloat64 + + check := make(map[[2]int]struct{}, size) + for _, p := range points { + check[[2]int{p[0], p[1]}] = struct{}{} + } + + for i := 0; i < size; i++ { + o := points[i] + for j := i + 1; j < size; j++ { + p := points[j] + x1, y1 := p[0]-o[0], p[1]-o[1] // vector form o to p + for k := j + 1; k < size; k++ { + q := points[k] + x2, y2 := q[0]-o[0], q[1]-o[1] // vector form o to q + + if x1*x2+y1*y2 != 0 { // not a rectangle + continue + } + + p4 := [2]int{q[0] - o[0] + p[0], q[1] - o[1] + p[1]} + if _, ok := check[p4]; !ok { // miss fourth point + continue + } + + area := length(x1, y1) * length(x2, y2) + res = math.Min(res, area) + } + } + } + + if res == math.MaxFloat64 { + return 0 + } + return res +} + +// length of vector +func length(x, y int) float64 { + return math.Sqrt(float64(x*x + y*y)) +} diff --git a/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii_test.go b/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii_test.go new file mode 100755 index 000000000..46fc547ab --- /dev/null +++ b/Algorithms/0963.minimum-area-rectangle-ii/minimum-area-rectangle-ii_test.go @@ -0,0 +1,52 @@ +package problem0963 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans float64 +}{ + + { + [][]int{{1, 2}, {2, 1}, {1, 0}, {0, 1}}, + 2.00000, + }, + + { + [][]int{{0, 1}, {2, 1}, {1, 1}, {1, 0}, {2, 0}}, + 1.00000, + }, + + { + [][]int{{0, 3}, {1, 2}, {3, 1}, {1, 3}, {2, 1}}, + 0, + }, + + { + [][]int{{3, 1}, {1, 1}, {0, 1}, {2, 1}, {3, 3}, {3, 2}, {0, 2}, {2, 3}}, + 2.00000, + }, + + // 可以有多个 testcase +} + +func Test_minAreaFreeRect(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.InDelta(tc.ans, minAreaFreeRect(tc.points), 0.00001, "输入:%v", tc) + } +} + +func Benchmark_minAreaFreeRect(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minAreaFreeRect(tc.points) + } + } +} diff --git a/Algorithms/0964.least-operators-to-express-number/README.md b/Algorithms/0964.least-operators-to-express-number/README.md new file mode 100755 index 000000000..dca96997b --- /dev/null +++ b/Algorithms/0964.least-operators-to-express-number/README.md @@ -0,0 +1,41 @@ +# [964. Least Operators to Express Number](https://leetcode.com/problems/least-operators-to-express-number/) + +Given a single positive integer `x`, we will write an expression of the form `x (op1) x (op2) x (op3) x ...` where each operator `op1`, `op2`, etc. is either addition, subtraction, multiplication, or division `(+, -, *, or /)`. For example, with `x = 3`, we might write `3 * 3 / 3 + 3 - 3` which is a value of 3. + +When writing such an expression, we adhere to the following conventions: + +1. The division operator (/) returns rational numbers. +1. There are no parentheses placed anywhere. +1. We use the usual order of operations: multiplication and division happens before addition and subtraction. +1. It's not allowed to use the unary negation operator (-). For example, "x - x" is a valid expression as it only uses subtraction, but "-x + x" is not because it uses negation. + +We would like to write an expression with the least number of operators such that the expression equals the given target. Return the least number of operators used. + +Example 1: + +```text +Input: x = 3, target = 19 +Output: 5 +Explanation: 3 * 3 + 3 * 3 + 3 / 3. The expression contains 5 operations. +``` + +Example 2: + +```text +Input: x = 5, target = 501 +Output: 8 +Explanation: 5 * 5 * 5 * 5 - 5 * 5 * 5 + 5 / 5. The expression contains 8 operations. +``` + +Example 3: + +```text +Input: x = 100, target = 100000000 +Output: 3 +Explanation: 100 * 100 * 100 * 100. The expression contains 3 operations. +``` + +Note: + +- 2 <= x <= 100 +- 1 <= target <= 2 * 10^8 \ No newline at end of file diff --git a/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number.go b/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number.go new file mode 100755 index 000000000..f85ed2f4b --- /dev/null +++ b/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number.go @@ -0,0 +1,38 @@ +package problem0964 + +// ref: https://leetcode.com/problems/least-operators-to-express-number/discuss/208376/python2-O(log-target)-chinese + +// 由于不能有括号,所以每一位(x进制)必须是由自己组成或者由下一位减自己余数组成,所以首先短除法求出每一位的余数 +// 在个位的时候,必须用x/x表示1,所以*2,但其它位不用,所以单独先提出 +// 正数表示时,可用自己+剩下的正数表示或者多加一个本位然后减去上一位的余数表示 +// 负数表示时,可用自己的余数加上剩下的正数表示或者用自己的余数+剩下的余数,但此时可以合并同级项减少运算符 +// 如在10进制下,86可表示为 +// 80 + 6 (6 为下一位正数表示 +// 80 + 10 - 4 (4 为下一位负数表示) +// 100 - 20 + 6 (100-20为本位余数表示,6为下一位正数表示 +// 100 - 20 + 10 - 4 (100-20为本位余数表示,10 -4 为下一位余数表示 +// 在此时, 20 和 10注定为同一位且符号相反,可以省去两个符号(一个符号在该位用i 个符号表示(如100为第二位,所以表示为+10 * 10,用两个符号,在此时所有符号均带自己的正负号 +// 因为在前面算法中所有位都带自己的正负号,所以第一位应该减去自己的符号,所以总量减1 +// 或者在余数表示法中,加上一个更高位的减去自己表示本位余数 +// 所以此题归根结底还是考察对进制的理解而不是简单的理解bfs, dfs,那样复杂度远远高于此,但是是对惯性思维者的一种挑战 + +func leastOpsExpressTarget(x int, target int) int { + target, r := target/x, target%x + pos, neg := r*2, (x-r)*2 // 处理个位上的数 + + bit := 1 + for target > 0 { + target, r = target/x, target%x + pos, neg = min(r*bit+pos, (r+1)*bit+neg), min((x-r)*bit+pos, (x-r-1)*bit+neg) + bit++ + } + + return min(pos, bit+neg) - 1 +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number_test.go b/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number_test.go new file mode 100755 index 000000000..d98df5aea --- /dev/null +++ b/Algorithms/0964.least-operators-to-express-number/least-operators-to-express-number_test.go @@ -0,0 +1,104 @@ +package problem0964 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + x int + target int + ans int +}{ + + { + 3, + 6, + 1, + }, + + { + 3, + 55125018, + 105, + }, + + { + 30, + 281347, + 81, + }, + + { + 97, + 49, + 96, + }, + + { + 11, + 19, + 7, + }, + + { + 11, + 500041, + 41, + }, + + { + 2, + 6125100, + 104, + }, + { + 3, + 2, + 2, + }, + + { + 3, + 365, + 17, + }, + + { + 100, + 100000000, + 3, + }, + + { + 3, + 19, + 5, + }, + + { + 5, + 501, + 8, + }, + + // 可以有多个 testcase +} + +func Test_leastOpsExpressTarget(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, leastOpsExpressTarget(tc.x, tc.target), "输入:%v", tc) + } +} + +func Benchmark_leastOpsExpressTarget(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + leastOpsExpressTarget(tc.x, tc.target) + } + } +} diff --git a/Algorithms/0965.univalued-binary-tree/README.md b/Algorithms/0965.univalued-binary-tree/README.md new file mode 100755 index 000000000..ac9e02609 --- /dev/null +++ b/Algorithms/0965.univalued-binary-tree/README.md @@ -0,0 +1,28 @@ +# [965. Univalued Binary Tree](https://leetcode.com/problems/univalued-binary-tree/) + +A binary tree is univalued if every node in the tree has the same value. + +Return true if and only if the given tree is univalued. + +Example 1: + +![ex1](ex1.png) + +```text +Input: [1,1,1,1,1,null,1] +Output: true +``` + +Example 2: + +![ex2](ex2.png) + +```text +Input: [2,2,2,5,2] +Output: false +``` + +Note: + +1. The number of nodes in the given tree will be in the range [1, 100]. +1. Each node's value will be an integer in the range [0, 99]. diff --git a/Algorithms/0965.univalued-binary-tree/ex1.png b/Algorithms/0965.univalued-binary-tree/ex1.png new file mode 100644 index 000000000..155325f2b Binary files /dev/null and b/Algorithms/0965.univalued-binary-tree/ex1.png differ diff --git a/Algorithms/0965.univalued-binary-tree/ex2.png b/Algorithms/0965.univalued-binary-tree/ex2.png new file mode 100644 index 000000000..c7073b651 Binary files /dev/null and b/Algorithms/0965.univalued-binary-tree/ex2.png differ diff --git a/Algorithms/0965.univalued-binary-tree/univalued-binary-tree.go b/Algorithms/0965.univalued-binary-tree/univalued-binary-tree.go new file mode 100755 index 000000000..ce2939742 --- /dev/null +++ b/Algorithms/0965.univalued-binary-tree/univalued-binary-tree.go @@ -0,0 +1,19 @@ +package problem0965 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined in kit +type TreeNode = kit.TreeNode + +func isUnivalTree(root *TreeNode) bool { + if root == nil { + return true + } + + if (root.Left != nil && root.Val != root.Left.Val) || + (root.Right != nil && root.Val != root.Right.Val) { + return false + } + + return isUnivalTree(root.Left) && isUnivalTree(root.Right) +} diff --git a/Algorithms/0965.univalued-binary-tree/univalued-binary-tree_test.go b/Algorithms/0965.univalued-binary-tree/univalued-binary-tree_test.go new file mode 100755 index 000000000..5c89c94d4 --- /dev/null +++ b/Algorithms/0965.univalued-binary-tree/univalued-binary-tree_test.go @@ -0,0 +1,45 @@ +package problem0965 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans bool +}{ + + { + []int{1, 1, 1, 1, 1, kit.NULL, 1}, + true, + }, + + { + []int{2, 2, 2, 5, 2}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isUnivalTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, isUnivalTree(root), "输入:%v", tc) + } +} + +func Benchmark_isUnivalTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + isUnivalTree(root) + } + } +} diff --git a/Algorithms/0966.vowel-spellchecker/README.md b/Algorithms/0966.vowel-spellchecker/README.md new file mode 100755 index 000000000..a2c931446 --- /dev/null +++ b/Algorithms/0966.vowel-spellchecker/README.md @@ -0,0 +1,38 @@ +# [966. Vowel Spellchecker](https://leetcode.com/problems/vowel-spellchecker/) + +Given a `wordlist`, we want to implement a spellchecker that converts a query word into a correct word. + +For a given `query` word, the spell checker handles two categories of spelling mistakes: + +- Capitalization: If the query matches a word in the wordlist (**case-insensitive**), then the query word is returned with the same case as the case in the wordlist. + - Example: `wordlist = ["yellow"], query = "YellOw": correct = "yellow"` + - Example: `wordlist = ["Yellow"], query = "yellow": correct = "Yellow"` + - Example: `wordlist = ["yellow"], query = "yellow": correct = "yellow"` +- Vowel Errors: If after replacing the vowels ('a', 'e', 'i', 'o', 'u') of the query word with any vowel individually, it matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the match in the wordlist. + - Example: `wordlist = ["YellOw"], query = "yollow": correct = "YellOw"` + - Example: `wordlist = ["YellOw"], query = "yeellow": correct = ""` (no match) + - Example: `wordlist = ["YellOw"], query = "yllw": correct = ""` (no match) + +In addition, the spell checker operates under the following precedence rules: + +- When the query exactly matches a word in the wordlist (**case-sensitive**), you should return the same word back. +- When the query matches a word up to capitlization, you should return the first such match in the wordlist. +- When the query matches a word up to vowel errors, you should return the first such match in the wordlist. +- If the query has no matches in the wordlist, you should return the empty string. + +Given some `queries`, return a list of words `answer`, where `answer[i]` is the correct word for `query = queries[i]`. + +Example 1: + +```text +Input: wordlist = ["KiTe","kite","hare","Hare"], queries = ["kite","Kite","KiTe","Hare","HARE","Hear","hear","keti","keet","keto"] +Output: ["kite","KiTe","KiTe","Hare","hare","","","KiTe","","KiTe"] +``` + +Note: + +- 1 <= wordlist.length <= 5000 +- 1 <= queries.length <= 5000 +- 1 <= wordlist[i].length <= 7 +- 1 <= queries[i].length <= 7 +- All strings in wordlist and queries consist only of english letters. \ No newline at end of file diff --git a/Algorithms/0966.vowel-spellchecker/vowel-spellchecker.go b/Algorithms/0966.vowel-spellchecker/vowel-spellchecker.go new file mode 100755 index 000000000..bef77bef0 --- /dev/null +++ b/Algorithms/0966.vowel-spellchecker/vowel-spellchecker.go @@ -0,0 +1,43 @@ +package problem0966 + +import "strings" + +func spellchecker(wordlist []string, queries []string) []string { + isExactlyMatch := make(map[string]bool, len(wordlist)) + cap := make(map[string]int, len(wordlist)) + vow := make(map[string]int, len(wordlist)) + for i := len(wordlist) - 1; i >= 0; i-- { // 必须从大到小 + w := wordlist[i] + isExactlyMatch[w] = true // case sensitive + w = strings.ToLower(w) + cap[w] = i // case insensitive + vow[replacingVowel(w)] = i + } + + corrects := make([]string, len(queries)) + for i, q := range queries { + if isExactlyMatch[q] { + corrects[i] = q + } else if j, ok := cap[strings.ToLower(q)]; ok { + corrects[i] = wordlist[j] + } else if k, ok := vow[replacingVowel(q)]; ok { + corrects[i] = wordlist[k] + } + } + + return corrects +} + +func replacingVowel(s string) string { + var sb strings.Builder + for _, b := range s { + if 'A' <= b && b <= 'Z' { + b += 'a' - 'A' // case insensitive + } + if b == 'a' || b == 'e' || b == 'i' || b == 'o' || b == 'u' { + b = '*' + } + sb.WriteRune(b) + } + return sb.String() +} diff --git a/Algorithms/0966.vowel-spellchecker/vowel-spellchecker_test.go b/Algorithms/0966.vowel-spellchecker/vowel-spellchecker_test.go new file mode 100755 index 000000000..d7ebeccea --- /dev/null +++ b/Algorithms/0966.vowel-spellchecker/vowel-spellchecker_test.go @@ -0,0 +1,57 @@ +package problem0966 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + wordlist []string + queries []string + ans []string +}{ + + { + []string{"ae", "aa"}, + []string{"UU"}, + []string{"ae"}, + }, + + { + []string{"kkk", "hrt", "fze", "awj", "dfn", "kec", "zss", "dkp", "pdx", "pgm", "ozl", "dhj", "uqm", "eks", "opv", "cxo", "okq", "wym", "fjp", "yyo", "awz", "lsp", "quk", "hhe", "sth", "mpo", "mbg", "smj", "cpm", "dno", "miq", "fld", "zxa", "fdu", "ige", "lmt", "gyh", "wcu", "wiv", "zad", "tjk", "ync", "voc", "gqw", "fzk", "ehs", "kgp", "hde", "kkp", "tko", "uae", "uax", "xhm", "anh", "oph", "lws", "amw", "vyi", "lec", "exq", "dbx", "gee", "cbp", "pfu", "uya", "loi", "zba", "qdo", "cfv", "oxg", "him", "aoj", "uob", "kxs", "odx", "qtu", "xbg", "bqy", "imr", "dzo", "ona", "hat", "jxd", "bae", "ops", "len", "fof", "wlt", "fxa", "ryu", "qay", "asd", "shj", "wbi", "moz", "gsi", "hdc", "abt", "yfd", "ptc", "dyj", "dhg", "qwj", "zme", "enn", "lfc", "pdn", "vcx", "aig", "ywr", "txj", "ngl", "mro", "rqc", "baf", "vbr", "box", "wgv", "ifa", "ogw", "ikg", "aai", "qeg", "bgs", "cmo", "prf", "trt", "rqq", "sep", "uqx", "xvn", "uzw", "fof", "mzz", "qug", "pnq", "kwd", "igf", "yly", "ecb", "bcz", "osc", "onq", "khy", "ubi", "iik", "cee", "ora", "iyt", "soa", "qdo", "cmr", "hty", "jap", "ghn", "gwh", "cqd", "tre", "hix", "ztg", "zhf", "mbx", "esc", "hzo", "tic", "mpi", "gvt", "gmm", "tnp", "qgb", "riv", "yrw", "bvu", "uia", "mnx", "lnh", "wao", "pxz", "haw", "bix", "qmr", "kga", "umh", "lmk", "noi", "mjx", "erj", "yda", "dny", "zsk", "qla", "ndq", "atn", "hkb", "svh", "tvi", "pyw", "foa", "zuo", "ort", "ous", "orx", "vfk", "vus", "fwz", "nfg", "vsd", "opn", "nqm", "hru", "jrt", "ymi", "xty", "dph", "etf", "kiu", "dpa", "paa", "oug", "vca", "ejn", "hrl", "auc", "idt", "vuz", "dxr", "dzc", "crg", "cyw", "eiq", "owp", "qye", "aiy", "rmb", "laf", "fmu", "csn", "ray", "ckd", "rhg", "dvf", "guk", "suw", "nfv", "poe", "qpj", "tlg", "rxv", "iuu", "adj", "sjh", "ocw", "ytn", "ptt", "kdg", "anu", "dsl", "nhb", "ywm", "bok", "nlb", "wcf", "tor", "hlr", "rvw", "xui", "hxc", "knm", "oyb", "dgz", "puu", "ovo", "obi", "neb", "zfo", "ouz", "mcc", "fcd", "xzd", "mtu", "dpg", "zre", "tba", "hsz", "lqv", "tfv", "pbp", "glf", "dhc", "dzw", "zso", "cuf", "jek", "gqd", "wyr", "gip", "wsp", "wus", "emv", "kbc", "ssg", "gvu", "eme", "fwa", "zeo", "ljy", "rkv", "iiw", "ljl", "iwn", "oqo", "kcd", "bhl", "dyo", "mho", "scr", "zfg", "iqr", "zxo", "unq", "omd", "vck", "cux", "ivh", "xrw", "ata", "jgd", "mtu", "zhb", "ahd", "zcl", "zvi", "fgq", "htq", "epe", "vgi", "khc", "mdm", "nwq", "bbx", "iqz", "eys", "irl", "ihz", "zhd", "nsa", "ele", "pst", "xyq", "kox", "qys", "tlv", "uwr", "boi", "fdt", "amb", "lyq", "nej", "xxr", "ixx", "ust", "hwe", "hla", "ykp", "qyf", "sny", "bci", "yid", "gii", "dci", "irn", "mjp", "wvk", "zys", "cxs", "hua", "uji", "oxn", "flj", "uac", "yoz", "qcx", "fsk", "wvp", "vtq", "zsw", "uvw", "zqi", "bgu", "udg", "dnb", "ehz", "dtu", "atp", "cop", "unj", "zse", "vzv", "mjx", "xwr", "mlv", "mlv", "vky", "dkl", "kat", "ufp", "hyi", "vzd", "zok", "bel", "saz", "aba", "jgx", "uvc", "yir", "lid", "zph", "uuh", "gti", "lcl", "oxf", "yib", "xpa", "bwf", "udc", "bom", "nkm", "lkz", "rqw", "ihl", "bwy", "jmf", "pfy", "hbu", "imn", "eyf", "nkz", "gje", "svc", "ovt", "pdd", "ukl", "zxb", "mdr", "kzp", "oxi", "gtv", "raw", "shy", "cau", "vgx", "nrg", "bfg", "qzn", "knc", "srq", "qdx", "lij", "ixc", "ogc", "noj", "jxo", "usr", "ytl", "muv", "uti", "pbe", "dzb", "rvp", "fqt", "hhx", "mhe", "cga", "gtd", "yat", "zac", "lbt", "gke", "tuh", "obz", "vuv", "gmq", "dki", "skv", "qbm", "nbb", "ugv", "hxt", "uxn", "uaq", "qqa", "koe", "fxc", "sgj", "hvx", "nae", "wtp", "njm", "mnb", "rge"}, + []string{"pue", "kZp", "hjs", "HBu", "rsp", "epp", "wsz", "AuC", "gsi", "yfz", "ohi", "huu", "xbu", "Xih", "bfg", "gap", "bvu", "okq", "ote", "jlp", "nij", "awz", "Zys", "nvf", "hdr", "ndo", "lkg", "zaq", "iyy", "xjk", "iik", "fom", "evp", "pEB", "arx", "jpd", "rqc", "ynt", "rka", "aWJ", "bdq", "qle", "btc", "ybs", "kjj", "dzW", "tka", "jnj", "rok", "aqm", "brn", "ztg", "bgU", "jpv", "tre", "two", "gih", "rja", "cyu", "ips", "qks", "uVw", "vog", "sjk", "dxv", "hqi", "ezw", "GWH", "jru", "ivm", "fPy", "iXc", "ckd", "swl", "knm", "EYs", "ibv", "ugn", "emv", "epi", "zia", "qsa", "hvx", "mNB", "wcz", "vcg", "ozl", "oar", "shj", "amd", "ibp", "ntw", "qno", "dfn", "bel", "nnm", "szu", "nqm", "fam", "zal", "osd", "uDc", "jzn", "xyq", "stu", "vum", "ShJ", "wvi", "aiy", "rcf", "gue", "lij", "fmn", "Mpo", "hwa", "khc", "qnn", "pni", "ust", "isr", "dzw", "aqg", "etd", "bhl", "Rpv", "Zeo", "xxr", "ups", "cxs", "ckd", "nAe", "fif", "oRX", "rnt", "llv", "xaf", "ais", "mlw", "obz", "wqq", "LkD", "oib", "FjP", "hoq", "zhf", "Foa", "kwi", "kji", "jpr", "vzv", "ans", "kvp", "uaq", "xxr", "lya", "msz", "zhd", "mdz", "qve", "rmb", "jjm", "srf", "nib", "non", "zPH", "zCl", "paa", "zos", "rej", "ubg", "xeq", "meq", "kbC", "fxa", "nse", "lnh", "khy", "qyz", "shj", "gtk", "MdM", "jdg", "gEe", "aza", "btt", "rQc", "edp", "egq", "tvI", "knb", "yir", "vge", "hau", "lws", "ahn", "dvf", "vfe", "miq", "nrt", "ypj", "mhn", "cwz", "wrc", "vna", "sof", "hyk", "hmw", "HIY", "aia", "mbx", "hqu", "vfd", "vkr", "MzZ", "dNy", "cnn", "paa", "ybj", "sgb", "vvl", "jtr", "ioi", "maz", "uui", "LWs", "kBc", "cuq", "plj", "qos", "wvk", "apn", "rlu", "icX", "cge", "opt", "jez", "eow", "VGx", "mhu", "bjx", "UUh", "fmv", "eqg", "fpa", "ckp", "bka", "Vck", "onQ", "pvo", "fkf", "uQM", "yoz", "vus", "amz", "aub", "zrE", "jfm", "zzm", "hlp", "lfl", "qtu", "lvo", "tsn", "ohp", "stq", "aWz", "zii", "jek", "vtq", "bVu", "ZQI", "rap", "ljy", "grj", "vum", "frp", "wus", "frx", "tkh", "qbM", "qlz", "nEb", "gky", "lsp", "qug", "pdd", "khg", "CmO", "ngl", "IKg", "cfl", "qmR", "bol", "ebc", "yys", "sys", "pnq", "iqr", "vuz", "xxo", "btk", "tez", "pqw", "dzo", "kus", "lan", "xui", "HLA", "qpj", "sth", "FwZ", "ZsS", "vkc", "biw", "tko", "KYP", "tkr", "oli", "qvh", "mev", "lpq", "nsa", "hlk", "bgh", "giu", "gnp", "IKi", "jqe", "rav", "bch", "ztg", "cov", "pst", "fyu", "efm", "zth", "yqc", "nsa", "mro", "eyq", "Hty", "bKo", "MEh", "siu", "wzm", "nlb", "uae", "lba", "ioj", "ovT", "gYH", "pts", "drj", "eco", "cia", "xko", "mpo", "gvx", "qgb", "thd", "qef", "fqd", "gde", "mqg", "uqx", "mbg", "ocw", "pyw", "qol", "sKV", "imr", "gri", "QBG", "dlk", "ids", "eba", "qqi", "xew", "egc", "uqm", "rge", "itv", "baj", "cop", "jor", "bcz", "zkd", "fav", "pee", "qdd", "err", "any", "yzn", "nkc", "bmh", "hey", "lcb", "jgx", "mtz", "ecz", "aai", "bwy", "ckc", "zeu", "uum", "mao", "wvP", "svc", "nhs", "jeb", "upv", "noi", "crm", "bch", "nbj", "geh", "aia", "woq", "kel", "amw", "nhn", "hxv", "lxt", "hyf", "wSP", "iyz", "htw", "fnz", "zsx", "okq", "owp", "cqD", "eof", "hjm", "kOe", "gej", "CAz", "zba", "gyh", "beu", "isd", "gql", "miz", "xwm", "wxr", "foa", "ZtG", "wrb", "foo", "faf", "nsl", "prf", "dqi", "dkI", "hty", "kCd", "dzo", "gja", "rey", "unb", "zsw", "yhf", "xui", "kxs", "mag", "zpx", "fjp", "kob", "tnp", "afu", "zuv", "rbq", "qdr", "rvp", "hrt", "vzv", "MXN", "xcl", "wic", "wqm", "gir", "wfd", "JXo", "zss", "wnf", "opv", "rvk", "pdd", "uvh", "GmQ", "FUm", "gyc", "veu", "pjj", "dnb", "ipp", "pla", "dci", "ldr", "eyi"}, + []string{"paa", "kzp", "", "hbu", "", "", "", "auc", "gsi", "", "", "hua", "", "", "bfg", "gip", "bvu", "okq", "ata", "", "nej", "awz", "zys", "", "", "", "", "", "", "", "iik", "", "", "", "orx", "", "rqc", "", "", "awj", "", "qla", "", "", "", "dzw", "tko", "", "", "uqm", "", "ztg", "bgu", "", "tre", "", "", "", "", "ops", "", "uvw", "", "", "", "", "uzw", "gwh", "", "", "", "ixc", "ckd", "", "knm", "eys", "", "", "emv", "epe", "zuo", "", "hvx", "mnb", "", "", "ozl", "", "shj", "omd", "", "", "", "dfn", "bel", "", "", "nqm", "", "", "asd", "udc", "", "xyq", "", "", "shj", "", "aiy", "", "gee", "lij", "", "mpo", "hwe", "khc", "", "", "ust", "usr", "dzw", "", "", "bhl", "", "zeo", "xxr", "ops", "cxs", "ckd", "nae", "fof", "orx", "", "", "", "ous", "", "obz", "", "", "uob", "fjp", "", "zhf", "foa", "", "", "", "vzv", "", "", "uaq", "xxr", "", "", "zhd", "", "", "rmb", "", "", "neb", "", "zph", "zcl", "paa", "", "", "", "", "miq", "kbc", "fxa", "nsa", "lnh", "khy", "", "shj", "", "mdm", "", "gee", "", "", "rqc", "", "", "tvi", "", "yir", "vgi", "hua", "lws", "", "dvf", "", "miq", "", "", "", "", "", "", "", "", "", "", "uae", "mbx", "", "", "", "mzz", "dny", "", "paa", "", "", "", "", "uae", "moz", "uae", "lws", "kbc", "", "", "", "wvk", "opn", "", "", "cga", "", "", "iiw", "vgx", "mho", "", "uuh", "", "", "", "", "", "vck", "onq", "", "", "uqm", "yoz", "vus", "", "uob", "zre", "", "", "", "", "qtu", "", "", "", "", "awz", "zuo", "jek", "vtq", "bvu", "zqi", "", "ljy", "", "", "", "wus", "", "", "qbm", "", "neb", "", "lsp", "qug", "pdd", "", "cmo", "ngl", "ikg", "", "qmr", "bel", "", "", "", "pnq", "iqr", "vuz", "", "", "", "", "dzo", "", "len", "xui", "hla", "qpj", "sth", "fwz", "zss", "", "", "tko", "", "", "ele", "", "muv", "", "nsa", "", "", "gee", "", "", "", "riv", "", "ztg", "", "pst", "", "", "", "", "nsa", "mro", "", "hty", "", "", "soa", "", "nlb", "uae", "", "aoj", "ovt", "gyh", "", "", "", "cee", "", "mpo", "", "qgb", "", "", "", "", "", "uqx", "mbg", "ocw", "pyw", "", "skv", "imr", "", "", "", "", "ubi", "qqa", "", "ogc", "uqm", "rge", "", "", "cop", "", "bcz", "", "", "paa", "", "", "", "", "", "", "", "", "jgx", "", "", "aai", "bwy", "", "zuo", "", "", "wvp", "svc", "", "", "opv", "noi", "", "", "", "", "uae", "", "", "amw", "", "", "", "", "wsp", "", "", "", "", "okq", "owp", "cqd", "", "", "koe", "", "", "zba", "gyh", "bae", "asd", "", "moz", "", "", "foa", "ztg", "", "foa", "fof", "", "prf", "", "dki", "hty", "kcd", "dzo", "gje", "ray", "", "zsw", "", "xui", "kxs", "", "", "fjp", "", "tnp", "ifa", "", "", "", "rvp", "hrt", "vzv", "", "", "", "", "", "", "jxo", "zss", "", "opv", "", "pdd", "ivh", "gmq", "", "", "", "", "dnb", "", "", "dci", "", "uya"}, + }, + + { + []string{"YellOw"}, + []string{"yollew"}, + []string{"YellOw"}, + }, + + { + []string{"KiTe", "kite", "hare", "Hare"}, + []string{"kite", "Kite", "KiTe", "Hare", "HARE", "Hear", "hear", "keti", "keet", "keto"}, + []string{"kite", "KiTe", "KiTe", "Hare", "hare", "", "", "KiTe", "", "KiTe"}, + }, + + // 可以有多个 testcase +} + +func Test_spellchecker(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, spellchecker(tc.wordlist, tc.queries), "输入:%v", tc) + } +} + +func Benchmark_spellchecker(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + spellchecker(tc.wordlist, tc.queries) + } + } +} diff --git a/Algorithms/0967.numbers-with-same-consecutive-differences/README.md b/Algorithms/0967.numbers-with-same-consecutive-differences/README.md new file mode 100755 index 000000000..4c5d26ee2 --- /dev/null +++ b/Algorithms/0967.numbers-with-same-consecutive-differences/README.md @@ -0,0 +1,27 @@ +# [967. Numbers With Same Consecutive Differences](https://leetcode.com/problems/numbers-with-same-consecutive-differences/) + +Return all non-negative integers of length N such that the absolute difference between every two consecutive digits is K. + +Note that every number in the answer must not have leading zeros except for the number 0 itself. For example, 01 has one leading zero and is invalid, but 0 is valid. + +You may return the answer in any order. + +Example 1: + +```text +Input: N = 3, K = 7 +Output: [181,292,707,818,929] +Explanation: Note that 070 is not a valid number, because it has leading zeroes. +``` + +Example 2: + +```text +Input: N = 2, K = 1 +Output: [10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98] +``` + +Note: + +- 1 <= N <= 9 +- 0 <= K <= 9 diff --git a/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences.go b/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences.go new file mode 100755 index 000000000..cd750f566 --- /dev/null +++ b/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences.go @@ -0,0 +1,27 @@ +package problem0967 + +func numsSameConsecDiff(N int, K int) []int { + nums := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} + if N == 1 { + // when N is 1, whatever K is, the answer is nums + return nums + } + + res := nums[1:] // when N>1, delete 0 + // bfs + for n := 1; n < N; n++ { + tmp := make([]int, 0, len(res)*2) + for _, v := range res { + r := v % 10 + if r-K >= 0 { + tmp = append(tmp, v*10+r-K) + } + if K > 0 && r+K <= 9 { + tmp = append(tmp, v*10+r+K) + } + } + res = tmp + } + + return res +} diff --git a/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences_test.go b/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences_test.go new file mode 100755 index 000000000..6f95acc53 --- /dev/null +++ b/Algorithms/0967.numbers-with-same-consecutive-differences/numbers-with-same-consecutive-differences_test.go @@ -0,0 +1,69 @@ +package problem0967 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + K int + ans []int +}{ + + { + 3, + 1, + []int{101, 121, 123, 210, 212, 232, 234, 321, 323, 343, 345, 432, 434, 454, 456, 543, 545, 565, 567, 654, 656, 676, 678, 765, 767, 787, 789, 876, 878, 898, 987, 989}, + }, + + { + 2, + 0, + []int{11, 22, 33, 44, 55, 66, 77, 88, 99}, + }, + + { + 1, + 6, + []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, + }, + + { + 1, + 0, + []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, + }, + + { + 3, + 7, + []int{181, 292, 707, 818, 929}, + }, + + { + 2, + 1, + []int{10, 12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98}, + }, + + // 可以有多个 testcase +} + +func Test_numsSameConsecDiff(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numsSameConsecDiff(tc.N, tc.K), "输入:%v", tc) + } +} + +func Benchmark_numsSameConsecDiff(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numsSameConsecDiff(tc.N, tc.K) + } + } +} diff --git a/Algorithms/0968.binary-tree-cameras/1.png b/Algorithms/0968.binary-tree-cameras/1.png new file mode 100644 index 000000000..83acd7a1d Binary files /dev/null and b/Algorithms/0968.binary-tree-cameras/1.png differ diff --git a/Algorithms/0968.binary-tree-cameras/2.png b/Algorithms/0968.binary-tree-cameras/2.png new file mode 100644 index 000000000..9ded3b941 Binary files /dev/null and b/Algorithms/0968.binary-tree-cameras/2.png differ diff --git a/Algorithms/0968.binary-tree-cameras/README.md b/Algorithms/0968.binary-tree-cameras/README.md new file mode 100755 index 000000000..1a1c8878a --- /dev/null +++ b/Algorithms/0968.binary-tree-cameras/README.md @@ -0,0 +1,32 @@ +# [968. Binary Tree Cameras](https://leetcode.com/problems/binary-tree-cameras/) + +Given a binary tree, we install cameras on the nodes of the tree. + +Each camera at a node can monitor its parent, itself, and its immediate children. + +Calculate the minimum number of cameras needed to monitor all nodes of the tree. + +Example 1: + +![1](1.png) + +```text +Input: [0,0,null,0,0] +Output: 1 +Explanation: One camera is enough to monitor all nodes if placed as shown. +``` + +Example 2: + +![2](2.png) + +```text +Input: [0,0,null,0,null,0,null,null,0] +Output: 2 +Explanation: At least two cameras are needed to monitor all nodes of the tree. The above image shows one of the valid configurations of camera placement. +``` + +Note: + +- The number of nodes in the given tree will be in the range [1, 1000]. +- Every node has value 0. \ No newline at end of file diff --git a/Algorithms/0968.binary-tree-cameras/binary-tree-cameras.go b/Algorithms/0968.binary-tree-cameras/binary-tree-cameras.go new file mode 100755 index 000000000..a8f028936 --- /dev/null +++ b/Algorithms/0968.binary-tree-cameras/binary-tree-cameras.go @@ -0,0 +1,44 @@ +package problem0968 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +type status int + +// every node just has one status of three +const ( + hasACamera status = iota + isMonitoredByChild + isMonitoredByParent +) + +func minCameraCover(root *TreeNode) int { + res := 0 + s := check(root, &res) + if s == isMonitoredByParent { + // root has no parent + // so need itself has a camera + res++ + } + return res +} + +func check(root *TreeNode, res *int) status { + if root == nil { + // nil don't need be monitored. + // so we think it's monitored by his child + return isMonitoredByChild + } + l, r := check(root.Left, res), check(root.Right, res) + switch { + case l == isMonitoredByParent || r == isMonitoredByParent: + *res++ + return hasACamera + case l == hasACamera || r == hasACamera: + return isMonitoredByChild + default: + return isMonitoredByParent + } +} diff --git a/Algorithms/0968.binary-tree-cameras/binary-tree-cameras_test.go b/Algorithms/0968.binary-tree-cameras/binary-tree-cameras_test.go new file mode 100755 index 000000000..2c2430b02 --- /dev/null +++ b/Algorithms/0968.binary-tree-cameras/binary-tree-cameras_test.go @@ -0,0 +1,65 @@ +package problem0968 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans int +}{ + + { + []int{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + 5, + }, + + { + []int{0, 0, 0, 0, 0, kit.NULL, kit.NULL, 0}, + 3, + }, + + { + []int{0, 0, 0, 0, 0, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 0, 0}, + 3, + }, + + { + []int{0}, + 1, + }, + + { + []int{0, 0, kit.NULL, 0, 0}, + 1, + }, + + { + []int{0, 0, kit.NULL, 0, kit.NULL, 0, kit.NULL, kit.NULL, 0}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_minCameraCover(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, minCameraCover(root), "输入:%v", tc) + } +} + +func Benchmark_minCameraCover(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + minCameraCover(root) + } + } +} diff --git a/Algorithms/0969.pancake-sorting/README.md b/Algorithms/0969.pancake-sorting/README.md new file mode 100755 index 000000000..9fc3a8ec7 --- /dev/null +++ b/Algorithms/0969.pancake-sorting/README.md @@ -0,0 +1,33 @@ +# [969. Pancake Sorting](https://leetcode.com/problems/pancake-sorting/) + +Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.length, then reverse the order of the first k elements of A. We want to perform zero or more pancake flips (doing them one after another in succession) to sort the array A. + +Return the k-values corresponding to a sequence of pancake flips that sort A. Any valid answer that sorts the array within 10 * A.length flips will be judged as correct. + +Example 1: + +```text +Input: [3,2,4,1] +Output: [4,2,4,3] +Explanation: +We perform 4 pancake flips, with k values 4, 2, 4, and 3. +Starting state: A = [3, 2, 4, 1] +After 1st flip (k=4): A = [1, 4, 2, 3] +After 2nd flip (k=2): A = [4, 1, 2, 3] +After 3rd flip (k=4): A = [3, 2, 1, 4] +After 4th flip (k=3): A = [1, 2, 3, 4], which is sorted. +``` + +Example 2: + +```text +Input: [1,2,3] +Output: [] +Explanation: The input is already sorted, so there is no need to flip anything. +Note that other answers, such as [3, 3], would also be accepted. +``` + +Note: + +- 1 <= A.length <= 100 +- A[i] is a permutation of [1, 2, ..., A.length] \ No newline at end of file diff --git a/Algorithms/0969.pancake-sorting/pancake-sorting.go b/Algorithms/0969.pancake-sorting/pancake-sorting.go new file mode 100755 index 000000000..de1a5b531 --- /dev/null +++ b/Algorithms/0969.pancake-sorting/pancake-sorting.go @@ -0,0 +1,29 @@ +package problem0969 + +func pancakeSort(A []int) []int { + size := len(A) + res := make([]int, 0, size*2) + for Ai := size; Ai > 1; Ai-- { + // every round makes A[i-1] is i + if A[Ai-1] == Ai { + continue + } + i := Ai - 2 + for A[i] != Ai { + i-- + } + if i != 0 { + reverse(A, i+1) // move Ai to A[0] + res = append(res, i+1) + } + reverse(A, Ai) // move Ai to A[Ai-1] + res = append(res, Ai) + } + return res +} + +func reverse(A []int, k int) { + for i, j := 0, k-1; i < j; i, j = i+1, j-1 { + A[i], A[j] = A[j], A[i] + } +} diff --git a/Algorithms/0969.pancake-sorting/pancake-sorting_test.go b/Algorithms/0969.pancake-sorting/pancake-sorting_test.go new file mode 100755 index 000000000..889b36ba8 --- /dev/null +++ b/Algorithms/0969.pancake-sorting/pancake-sorting_test.go @@ -0,0 +1,51 @@ +package problem0969 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int +}{ + + { + []int{3, 2, 4, 1}, + }, + + { + []int{1, 2, 3}, + }, + + { + []int{4, 1, 2, 3}, + }, + + // 可以有多个 testcase +} + +func Test_pancakeSort(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + A := make([]int, len(tc.A)) + copy(A, tc.A) + ans := pancakeSort(A) + copy(A, tc.A) + for _, k := range ans { + reverse(A, k) + } + ast.True(sort.IntsAreSorted(A), "输入 %v, 结果 %v, 转换后 %v", tc.A, ans, A) + } +} + +func Benchmark_pancakeSort(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pancakeSort(tc.A) + } + } +} diff --git a/Algorithms/0970.powerful-integers/README.md b/Algorithms/0970.powerful-integers/README.md new file mode 100755 index 000000000..dd07792f3 --- /dev/null +++ b/Algorithms/0970.powerful-integers/README.md @@ -0,0 +1,35 @@ +# [970. Powerful Integers](https://leetcode.com/problems/powerful-integers/) + +Given two positive integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0. + +Return a list of all powerful integers that have value less than or equal to bound. + +You may return the answer in any order. In your answer, each value should occur at most once. + +Example 1: + +```text +Input: x = 2, y = 3, bound = 10 +Output: [2,3,4,5,7,9,10] +Explanation: +2 = 2^0 + 3^0 +3 = 2^1 + 3^0 +4 = 2^0 + 3^1 +5 = 2^1 + 3^1 +7 = 2^2 + 3^1 +9 = 2^3 + 3^0 +10 = 2^0 + 3^2 +``` + +Example 2: + +```text +Input: x = 3, y = 5, bound = 15 +Output: [2,4,6,8,10,14] +``` + +Note: + +- 1 <= x <= 100 +- 1 <= y <= 100 +- 0 <= bound <= 10^6 \ No newline at end of file diff --git a/Algorithms/0970.powerful-integers/powerful-integers.go b/Algorithms/0970.powerful-integers/powerful-integers.go new file mode 100755 index 000000000..1de2d8fad --- /dev/null +++ b/Algorithms/0970.powerful-integers/powerful-integers.go @@ -0,0 +1,39 @@ +package problem0970 + +import ( + "sort" +) + +func powerfulIntegers(x int, y int, bound int) []int { + if x == 1 { + x = bound + 1 + } + if y == 1 { + y = bound + 1 + } + + res := make([]int, 0, 128) + for i := 1; i < bound; i *= x { + for j := 1; i+j <= bound; j *= y { + res = append(res, i+j) + } + } + + return removeRepeated(res) +} + +func removeRepeated(nums []int) []int { + sort.Ints(nums) + + size := len(nums) + + last, j := -1, -1 + for i := 0; i < size; i++ { + if last == nums[i] { // nums[i]>0 for any i + continue + } + j++ + nums[j], last = nums[i], nums[i] + } + return nums[:j+1] +} diff --git a/Algorithms/0970.powerful-integers/powerful-integers_test.go b/Algorithms/0970.powerful-integers/powerful-integers_test.go new file mode 100755 index 000000000..ec1f0070c --- /dev/null +++ b/Algorithms/0970.powerful-integers/powerful-integers_test.go @@ -0,0 +1,99 @@ +package problem0970 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + x int + y int + bound int + ans []int +}{ + + { + 1, + 1, + 0, + []int{}, + }, + + { + 2, + 1, + 10, + []int{2, 3, 5, 9}, + }, + + { + 2, + 3, + 10, + []int{2, 3, 4, 5, 7, 9, 10}, + }, + + { + 3, + 5, + 15, + []int{2, 4, 6, 8, 10, 14}, + }, + + // 可以有多个 testcase +} + +func Test_powerfulIntegers(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + sort.Ints(tc.ans) + ans := powerfulIntegers(tc.x, tc.y, tc.bound) + sort.Ints(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_powerfulIntegers(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + powerfulIntegers(tc.x, tc.y, tc.bound) + } + } +} + +func Benchmark_removeRepeated(b *testing.B) { + nums := []int{1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9} + for i := 1; i < b.N; i++ { + removeRepeated(nums) + } +} + +func Benchmark_removeRepeated2(b *testing.B) { + nums := []int{1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9} + for i := 1; i < b.N; i++ { + removeRepeated2(nums) + } +} + +func removeRepeated2(nums []int) []int { + sort.Ints(nums) + + size := len(nums) + if size == 0 { + return nums + } + + i := 0 + for j := 1; j < size; j++ { + if nums[i] == nums[j] { + continue + } + i++ + nums[i] = nums[j] + } + return nums[:i+1] +} diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/1.png b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/1.png new file mode 100644 index 000000000..d04161846 Binary files /dev/null and b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/1.png differ diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/2.png b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/2.png new file mode 100644 index 000000000..64e1acc46 Binary files /dev/null and b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/2.png differ diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/3.png b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/3.png new file mode 100644 index 000000000..64e1acc46 Binary files /dev/null and b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/3.png differ diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/README.md b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/README.md new file mode 100755 index 000000000..66043e0ed --- /dev/null +++ b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/README.md @@ -0,0 +1,46 @@ +# [971. Flip Binary Tree To Match Preorder Traversal](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/) + +Given a binary tree with N nodes, each node has a different value from {1, ..., N}. + +A node in this binary tree can be flipped by swapping the left child and the right child of that node. + +Consider the sequence of N values reported by a preorder traversal starting from the root. Call such a sequence of N values the voyage of the tree. + +(Recall that a preorder traversal of a node means we report the current node's value, then preorder-traverse the left child, then preorder-traverse the right child.) + +Our goal is to flip the least number of nodes in the tree so that the voyage of the tree matches the voyage we are given. + +If we can do so, then return a list of the values of all nodes flipped. You may return the answer in any order. + +If we cannot do so, then return the list [-1]. + +Example 1: + +![1](1.png) + +```text +Input: root = [1,2], voyage = [2,1] +Output: [-1] +``` + +Example 2: + +![2](2.png) + +```text +Input: root = [1,2,3], voyage = [1,3,2] +Output: [1] +``` + +Example 3: + +![3](3.png) + +```text +Input: root = [1,2,3], voyage = [1,2,3] +Output: [] +``` + +Note: + +- 1 <= N <= 100 \ No newline at end of file diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal.go b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal.go new file mode 100755 index 000000000..53bf67a15 --- /dev/null +++ b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal.go @@ -0,0 +1,38 @@ +package problem0971 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined. +/** + * Definition for a binary tree node. + * type TreeNode struct { + * Val int + * Left *TreeNode + * Right *TreeNode + * } + */ +type TreeNode = kit.TreeNode + +func flipMatchVoyage(root *TreeNode, voyage []int) []int { + res := make([]int, 0, len(voyage)) + index := 0 + var dfs func(*TreeNode) bool + dfs = func(node *TreeNode) bool { + if node == nil { + return true + } + if node.Val != voyage[index] { + return false + } + index++ + if node.Left != nil && node.Left.Val != voyage[index] { + res = append(res, node.Val) + return dfs(node.Right) && dfs(node.Left) + } + return dfs(node.Left) && dfs(node.Right) + } + if dfs(root) { + return res + } + return []int{-1} +} diff --git a/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal_test.go b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal_test.go new file mode 100755 index 000000000..36dde26ae --- /dev/null +++ b/Algorithms/0971.flip-binary-tree-to-match-preorder-traversal/flip-binary-tree-to-match-preorder-traversal_test.go @@ -0,0 +1,67 @@ +package problem0971 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + voyage []int + ans []int +}{ + + { + []int{1, 2}, + []int{1, 2}, + []int{}, + }, + + { + []int{1, kit.NULL, 2}, + []int{1, 2}, + []int{}, + }, + + { + []int{1, 2, 3}, + []int{1, 3, 2}, + []int{1}, + }, + + { + []int{1, 2}, + []int{2, 1}, + []int{-1}, + }, + + { + []int{1, 2, 3}, + []int{1, 2, 3}, + []int{}, + }, + + // 可以有多个 testcase +} + +func Test_flipMatchVoyage(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, flipMatchVoyage(root, tc.voyage), "输入:%v", tc) + } +} + +func Benchmark_flipMatchVoyage(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + flipMatchVoyage(root, tc.voyage) + } + } +} diff --git a/Algorithms/0972.equal-rational-numbers/README.md b/Algorithms/0972.equal-rational-numbers/README.md new file mode 100755 index 000000000..561b82782 --- /dev/null +++ b/Algorithms/0972.equal-rational-numbers/README.md @@ -0,0 +1,49 @@ +# [972. Equal Rational Numbers](https://leetcode.com/problems/equal-rational-numbers/) + +Given two strings S and T, each of which represents a non-negative rational number, return True if and only if they represent the same number. The strings may use parentheses to denote the repeating part of the rational number. + +In general a rational number can be represented using up to three parts: an integer part, a non-repeating part, and a repeating part. The number will be represented in one of the following three ways: + +- (e.g. 0, 12, 123) +- <.> (e.g. 0.5, 1., 2.12, 2.0001) +- <.><(><)> (e.g. 0.1(6), 0.9(9), 0.00(1212)) + +The repeating portion of a decimal expansion is conventionally denoted within a pair of round brackets. For example: + +1 / 6 = 0.16666666... = 0.1(6) = 0.1666(6) = 0.166(66) + +Both 0.1(6) or 0.1666(6) or 0.166(66) are correct representations of 1 / 6. + +Example 1: + +```text +Input: S = "0.(52)", T = "0.5(25)" +Output: true +Explanation: +Because "0.(52)" represents 0.52525252..., and "0.5(25)" represents 0.52525252525..... , the strings represent the same number. +``` + +Example 2: + +```text +Input: S = "0.1666(6)", T = "0.166(66)" +Output: true +``` + +Example 3: + +```text +Input: S = "0.9(9)", T = "1." +Output: true +Explanation: +"0.9(9)" represents 0.999999999... repeated forever, which equals 1. [See this link for an explanation.] +"1." represents the number 1, which is formed correctly: (IntegerPart) = "1" and (NonRepeatingPart) = "". +``` + +Note: + +- Each part consists only of digits. +- The will not begin with 2 or more zeros. (There is no other restriction on the digits of each part.) +- 1 <= .length <= 4 +- 0 <= .length <= 4 +- 1 <= .length <= 4 \ No newline at end of file diff --git a/Algorithms/0972.equal-rational-numbers/equal-rational-numbers.go b/Algorithms/0972.equal-rational-numbers/equal-rational-numbers.go new file mode 100755 index 000000000..32b88b9da --- /dev/null +++ b/Algorithms/0972.equal-rational-numbers/equal-rational-numbers.go @@ -0,0 +1,33 @@ +package problem0972 + +import ( + "strconv" + "strings" +) + +// 首先,牢记 note 中提到的 3 点 +// 3. 1 <= .length <= 4 +// 4. 0 <= .length <= 4 +// 5. 1 <= .length <= 4 +// 再根据 IEEE 754 中 https://zh.wikipedia.org/wiki/IEEE_754#%E8%AE%A8%E8%AE%BA%E4%B8%80 提到的 64 bit 双精度可以准确地表示 15 位十进制数 +// 分两种情况讨论: +// 1: 没有重复部分,可以直接精准地转换成 float64 +// 2: 存在重复部分,可以延展 S 到 20 位长度后,再近似地转换成 float64 +// 因为 note 中规定了各个部分的长度, +// A: 重复部分不为 9 的话,在 15 位以内就会出现差别 +// B: 重复部分为 9 的话, 至少 S[9:20] 中皆为 9,会在四舍五入时进位,与数学规定一致 + +func isRationalEqual(S string, T string) bool { + return convert(S) == convert(T) +} + +func convert(s string) float64 { + i := strings.IndexByte(s, '(') + if i != -1 { + base, repeat := s[:i], s[i+1:len(s)-1] + s = base + strings.Repeat(repeat, (20-len(base))/len(repeat)+1) + s = s[:20] // 20 could be 19, but not 18 + } + res, _ := strconv.ParseFloat(s, 64) + return res +} diff --git a/Algorithms/0972.equal-rational-numbers/equal-rational-numbers_test.go b/Algorithms/0972.equal-rational-numbers/equal-rational-numbers_test.go new file mode 100755 index 000000000..44c96f4b4 --- /dev/null +++ b/Algorithms/0972.equal-rational-numbers/equal-rational-numbers_test.go @@ -0,0 +1,93 @@ +package problem0972 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + T string + ans bool +}{ + + { + "1.0", + "1", + true, + }, + + { + "350.(111)", + "350.(11)", + true, + }, + + { + "15.(9)", + "16", + true, + }, + + { + "1.0(9)", + "1.1", + true, + }, + + { + "0.9(9)", + "1.", + true, + }, + + { + "1.9(0)", + "1.8(9)", + true, + }, + + { + "0", + "0.", + true, + }, + + { + "0.(0)", + "0", + true, + }, + + { + "0.(52)", + "0.5(25)", + true, + }, + + { + "0.1666(6)", + "0.166(66)", + true, + }, + + // 可以有多个 testcase +} + +func Test_isRationalEqual(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isRationalEqual(tc.S, tc.T), "输入:%v", tc) + } +} + +func Benchmark_isRationalEqual(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isRationalEqual(tc.S, tc.T) + } + } +} diff --git a/Algorithms/0973.k-closest-points-to-origin/README.md b/Algorithms/0973.k-closest-points-to-origin/README.md new file mode 100755 index 000000000..82f17e469 --- /dev/null +++ b/Algorithms/0973.k-closest-points-to-origin/README.md @@ -0,0 +1,33 @@ +# [973. K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) + +We have a list of points on the plane. Find the K closest points to the origin (0, 0). + +(Here, the distance between two points on a plane is the Euclidean distance.) + +You may return the answer in any order. The answer is guaranteed to be unique (except for the order that it is in.) + +Example 1: + +```text +Input: points = [[1,3],[-2,2]], K = 1 +Output: [[-2,2]] +Explanation: +The distance between (1, 3) and the origin is sqrt(10). +The distance between (-2, 2) and the origin is sqrt(8). +Since sqrt(8) < sqrt(10), (-2, 2) is closer to the origin. +We only want the closest K = 1 points from the origin, so the answer is just [[-2,2]]. +``` + +Example 2: + +```text +Input: points = [[3,3],[5,-1],[-2,4]], K = 2 +Output: [[3,3],[-2,4]] +(The answer [[-2,4],[3,3]] would also be accepted.) +``` + +Note: + +- `1 <= K <= points.length <= 10000` +- `-10000 < points[i][0] < 10000` +- `-10000 < points[i][1] < 10000` \ No newline at end of file diff --git a/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin.go b/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin.go new file mode 100755 index 000000000..b04ddd356 --- /dev/null +++ b/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin.go @@ -0,0 +1,14 @@ +package problem0973 + +import "sort" + +func kClosest(points [][]int, K int) [][]int { + sort.Slice(points, func(i int, j int) bool { + return dist(points[i]) < dist(points[j]) + }) + return points[:K] +} + +func dist(p []int) int { + return p[0]*p[0] + p[1]*p[1] +} diff --git a/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin_test.go b/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin_test.go new file mode 100755 index 000000000..4a0e22db8 --- /dev/null +++ b/Algorithms/0973.k-closest-points-to-origin/k-closest-points-to-origin_test.go @@ -0,0 +1,45 @@ +package problem0973 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + K int + ans [][]int +}{ + + { + [][]int{{1, 3}, {-2, 2}}, + 1, + [][]int{{-2, 2}}, + }, + + { + [][]int{{3, 3}, {5, -1}, {-2, 4}}, + 2, + [][]int{{3, 3}, {-2, 4}}, + }, + + // 可以有多个 testcase +} + +func Test_kClosest(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, kClosest(tc.points, tc.K), "输入:%v", tc) + } +} + +func Benchmark_kClosest(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + kClosest(tc.points, tc.K) + } + } +} diff --git a/Algorithms/0974.subarray-sums-divisible-by-k/README.md b/Algorithms/0974.subarray-sums-divisible-by-k/README.md new file mode 100755 index 000000000..7225304fd --- /dev/null +++ b/Algorithms/0974.subarray-sums-divisible-by-k/README.md @@ -0,0 +1,18 @@ +# [974. Subarray Sums Divisible by K](https://leetcode.com/problems/subarray-sums-divisible-by-k/) + +Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. + +Example 1: + +```text +Input: A = [4,5,0,-2,-3,1], K = 5 +Output: 7 +Explanation: There are 7 subarrays with a sum divisible by K = 5: +[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3] +``` + +Note: + +- `1 <= A.length <= 30000` +- `-10000 <= A[i] <= 10000` +- `2 <= K <= 10000` \ No newline at end of file diff --git a/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k.go b/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k.go new file mode 100755 index 000000000..fbcdff5cc --- /dev/null +++ b/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k.go @@ -0,0 +1,13 @@ +package problem0974 + +func subarraysDivByK(A []int, K int) int { + count := [10000]int{} + count[0] = 1 + prefix, res := 0, 0 + for _, a := range A { + prefix = (prefix + a%K + K) % K + res += count[prefix] // 减去相同的 prefix,剩下的就都是 K 的倍数 + count[prefix]++ + } + return res +} diff --git a/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k_test.go b/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k_test.go new file mode 100755 index 000000000..1685caeb8 --- /dev/null +++ b/Algorithms/0974.subarray-sums-divisible-by-k/subarray-sums-divisible-by-k_test.go @@ -0,0 +1,46 @@ +package problem0974 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + +{ + []int{ +1152,-6255,-7426,2761,-1188,7031,-4556,-7277,-2276,2559,-2932,-3888,5236,4320,4987,680,9794,3898,-5976,2962,-7131,-3812,4966,6059,9028,73,4198,2000,9482,-5529,-1527,2742,1181,5793,-958,8690,-1463,730,7733,9753,-9703,5613,-7979,-5161,5740,9493,-8778,8685,8485,-413,5182,8448,-1342,255,-2163,861,-4669,-9180,9445,3115,4593,-4734,-5028,54,-9250,1567,9690,6825,-3954,1946,-132,-4418,-4917,2676,-4525,-340,1500,-7901,9301,-9731,6337,7218,9999,922,7747,6986,-2848,-2829,1361,-8648,821,2406,-2575,-4304,6795,-4913,2981,-6271,-8994,1117,1645,-8345,8277,6884,7150,8259,1496,-2939,-4133,3382,2550,6378,-1250,-7831,9669,-669,375,6221,-8865,-5175,-2826,-9646,-5517,-5471,7630,-2214,4485,9344,-1336,-8356,3876,-2918,8390,-4886,4799,-1206,4165,7038,1944,1112,-3012,-9428,3015,5626,-9014,-4354,-4731,-8773,5221,6437,82,299,-7260,8828,3861,6423,7181,1848,1643,-2229,7840,2496,8589,6990,9521,5310,-9980,7732,-698,-1127,6226,-6341,-3076,-8436,-5962,7755,6803,6253,-8857,-4929,6469,-1401,-3892,6656,-9838,8580,-7197,-3344,4153,5542,4190,4947,-137,440,7286,-297,-8869,6780,8646,-5934,5174,7113,7458,9458,-6200,-4273,7243,-9841,2232,9776,-4787,2218,918,-9157,7059,6889,-6641,3871,2413,216,-9705,3745,-3324,2470,-23,-3269,480,6667,7034,2355,9074,2377,-7254,5961,-2231,4043,-9049,1501,4501,9411,8251,-9840,-9664,1830,-559,4662,-6849,-5450,9687,-4576,2831,9312,-3419,-4058,-7909,8406,-3919,465,-3985,2509,9726,4762,-8176,-6704,-4652,-9662,-7577,179,-7095,9887,-6866,-8241,4841,7141,-3273,5112,-7880,-4549,-6746,6419,8666,-2189,-6844,-3435,-8537,-1648,2645,-1121,4540,6275,7888,-5244,4085,4188,6673,6938,5775,6915,-5091,7225,9884,-9125,801,-4723,-6353,3572,-2334,-3422,-2989,9767,-8207,8239,-8001,6629,7257,-497,-5390,-201,-3599,-9960,6784,1868,-5129,-4928,4019,1874,-9935,2983,1970,8501,-5648,1396,376,841,-9945,2194,3153,-2501,1206,-7300,6153,4415,-4205,8039,727,9752,1610,-1531,4860,7804,-8830,-5307,4990,-5592,3806,41,-7622,6956,-4484,-5445,-5359,-7523,7561,-3079,2770,-7607,-3522,-4747,9541,8679,917,9909,2879,-8812,-4085,7299,-4354,-4881,-1856,-4369,-6117,-2387,-743,-3873,8417,3865,1312,-4966,1165,3320,8511,-8622,3475,-1370,5194,-118,-3810,-8400,3260,-4937,1537,-1935,-9360,-7289,-3499,9000,-3160,-1118,9463,2312,6935,-1262,6264,-6790,4273,7762,7192,-7776,3172,9238,-1138,-3452,-5572,9657,-5265,2283,645,130,-1240,452,-8255,-1493,-106,2952,9208,-5412,-7867,-3840,912,990,-9385,-469,-7725,9444,-1892,-4961,7966,-1758,-551,-1179,5007,8186,-2869,-7122,3575,5917,3004,-3032,-1151,5521,1665,-8971,-5740,-5213,9751,-9943,3056,175,7263,-4005,311,-7853,-6887,6558,-3063,-5914,-8164,-2429,-6065,9857,-2308,-2836,5097,-7061,4758,-7997,8036,-9560,-2890,2730,1446,4115,-9379,-6317,-8866,1232,8462,4571,-5530,9167,5553,1852,918,7938,-4663,-1023,-2113,7011,7825,4049,5073,6759,6192,-448,-2016,3784,5239,3231,2956,-7572,4246,1405,5936,7601,8508,-8573,-6476,-1782,-9553,-7697,7517,6598,-2470,-8970,-9430,3714,4415,-8957,223,-8265,-514,804,-6797,5059,6309,9426,-2759,-8581,-6619,-4793,1209,5534,-2354,-1606,4805,-3766,8139,3733,3645,-6697,-4619,-3268,2449,-2335,-8669,-8997,-8966,-9994,-7528,896,9952,-9537,-8105,-7889,-9850,-8213,4066,-6346,7602,-8432,6197,-3239,-8509,2362,-7147,3021,-400,-8612,-2178,2879,-496,7910,8435,-6139,3436,6190,4441,-6345,3648,5059,-9195,-3721,5145,3034,2727,-5891,5707,4922,1272,-2195,1482,7886,-3200,-3478,9076,-2963,2185,7974,-4394,-4013,-8032,-1500,-7333,-7896,6353,-1205,-860,-5806,-6000,-9155,8427,-6528,-7552,4016,6590,2786,8654,-6681,-5238,3431,8789,7581,-8661,-1564,-5316,2375,5309,2798,8176,9144,5122,-3471,-3422,-1410,6294,-6310,-8463,5366,-9251,-3988,-7020,-1798,4333,999,-3926,-1423,9018,5372,-2344,-8925,-4622,-5322,5784,-507,-8638,-8961,9367,2534,3982,6107,-4991,7891,9477,5807,2560,-9898,3670,-5249,4081,-215,-1650,-9618,-4633,2657,1213,-8059,766,-9351,6020,4168,8717,9283,6741,-1753,-4665,-6935,-7722,-9356,5000,-2015,4809,1385,464,576,-5208,-5185,-5756,9451,-2176,-5779,3591,-9760,-1172,1884,3635,-5447,4662,5057,5473,-8799,-6636,3989,-9189,-7194,-9346,2063,-8537,9966,4739,1944,-5669,-7228,-8830,-90,2135,-1120,6481,-9647,6883,-1020,6464,-9840,730,-1195,-2179,2991,2331,6110,2136,4595,2256,3811,-7036,3429,-1032,-3289,4680,629,6375,263,7393,2085,-7192,1487,-5963,2923,3624,8276,1144,-4066,-2785,-1440,-1752,3717,-8628,-7500,-4029,1512,1664,-5413,-1321,4855,2791,7748,352,7782,2048,8003,-917,-9363,369,7532,7272,-2155,-9519,2213,2939,5501,458,4471,-5199,369,1448,-7650,-56,1720,-9090,-3706,-3929,-2748,5850,-6186,-7075,-7953,-9362,9414,-2823,-8487,7199,8894,3066,6314,1247,4227,1516,92,4016,-6579,2236,-6855,3794,3570,-9501,1538,-8769,-5532,6590,1107,-6095,710,3289,6791,6280,-8688,282,-8823,129,7317,8785,386,404,-9844,-5861,-4732,-2737,-2531,-2241,5511,-575,-133,-7436,-969,2298,4172,-1369,8636,5422,5129,2437,-5764,-7534,-8954,8767,2949,-6579,2972,6793,-9755,5258,-6259,7908,4217,-2940,6268,-8931,-1971,-5774,-6137,-3971,3644,-7121,8298,-5077,-9079,7585,-600,7632,7063,-263,5499,931,2257,2201,66,-6011,9755,8581,1346,9570,4139,-1004,6634,-7676,1090,9247,-7584,-4128,-9728,-9854,-5272,9420,-9880,-2050,4070,-2456,-6485,-5612,-8686,-5866,777,5188,9597,5723,8964,9453,-7646,1488,5814,9934,-6773,-1097,-2289,-6104,-3311,7587,5385,-3423,9098,2883,6604,1439,8872,-5511,-9426,-5690,-4572,6922,-2624,-5780,-6939,2299,-7063,2179,-5349,351,5292,-7266,4685,-3475,539,-1919,7396,-2248,-5814,2184,5350,-724,4096,8668,-436,3775,9878,7347,8894,4736,-7972,-5437,-1995,-1084,-3960,-1577,-9478,-7737,-268,3476,-6851,-434,5191,4768,-4155,-3287,-132,-6707,8582,-6678,-4955,-2014,7420,-3532,281,-6544,9954,-5658,6236,7188,-2505,6379,8354,3422,-8375,-7566,-5191,3453,-825,173,2023,-1326,-6993,9791,5180,9201,-1208,-6067,-758,2201,9838,-9790,8344,-4523,1442,8028,-4879,976,3144,8022,2921,-8731,-1082,-7625,-9472,9014,-6971,-3672,3774,7962,6281,-9843,5027,-2649,-9228,-2493,-7203,-8625,3037,6427,-2141,-991,851,4312,7294,-9600,-3142,6770,1682,-8798,1158,-2857,9943,2553,-1790,3658,-2540,5531,-6403,-5071,-7511,648,-1050,-2008,-1037,4425,-9944,-588,2036,-6800,3911,2333,-8914,8722,2167,2484,-4883,-3646,-7113,8156,4299,1063,1627,6852,-6935,8250,-7519,-1134,2100,-8264,-544,1456,7603,9070,3250,-7850,-5108,3420,2897,-5126,1028,6736,-6635,-257,4185,-5700,7447,-5167,883,6174,4634,2592,-7094,-2361,8735,2546,7140,-4257,-4586,6532,4220,-9456,-8019,-127,-9002,1907,-4829,-1477,-6768,-1056,-2820,3042,-9124,8693,6431,902,4136,-795,-9664,7920,-9134,-5819,2952,8344,7676,4884,1739,7032,9336,7034,-395,5698,-7746,-7521,5385,2752,2235,4827,7743,1637,315,7865,9484,-7686,7784,2214,5215,8744,2754,4511,5219,-2667,-3080,-3406,3337,-3399,2672,908,-3736,-4643,7754,-7560,-7089,-283,-9871,334,-7192,-874,3635,-7299,-3140,161,2237,-3720,-5598,-2968,-632,-1244,-6142,6584,8026,2805,2329,-9818,-9517,-8795,4408,-6366,1020,666,-4691,7791,-3669,-3069,2138,446,463,-4,-6444,1989,-8451,3301,6455,6665,7260,-6641,8564,-1574,-3330,3658,4357,358,-2859,4250,-7218,5638,-3591,7554,-8596,-3904,-4622,-7011,1477,1754,-6622,-3425,-3170,8678,2075,1813,-7293,-5490,1295,9994,-5950,8956,-4486,-2503,7154,4488,3897,492,6115,7255,236,-3515,2287,-9325,4516,4383,8331,2569,-8459,5354,7820,-4720,-3142,8846,-8680,7065,-4677,3865,3602,8350,839,9858,-532,-813,3447,-9724,-6846,8574,9779,-1625,6148,8105,-36,-3932,-8759,3094,-1386,-5327,-7599,1032,-1709,8211,5522,-677,-9058,-5293,-2129,9868,5805,21,-3602,9682,-5065,-5428,-8197,-3278,-7100,-4709,-7995,2501,7149,-2495,-1554,2103,-5315,-2655,9077,5480,-6158,-7770,4191,8112,5290,-5348,-6762,1242,-345,5092,4490,-3995,8315,-1238,6060,3725,7100,1137,-8310,-3669,-6583,6117,-6266,-5847,-3044,9389,-6045,9300,-9529,-7703,-4986,8220,3823,9799,2811,-2079,-363,1826,7875,-9156,2831,-9121,-2808,-1463,8816,-604,2891,9121,-6442,-7053,7385,8676,6222,5167,8651,-6051,-4715,-750,-417,1895,8319,2195,-6614,5607,-8039,-9542,-8025,8891,-4231,-3709,8291,3759,-5530,-2808,-3528,-8916,-7552,582,-9036,7706,-1448,2621,-5809,-6267,-952,2888,-6590,-850,-1990,-4906,8586,-2602,2137,7061,-9171,3021,-4020,-1574,4495,5594,-6629,-5308,5126,931,-9755,4536,-8357,7932,-4596,-6597,-1406,5672,9468,-2762,9227,-7946,-3276,-3743,3626,1482,-924,2116,-435,4381,1114,-9953,7534,431,3366,6408,9471,-93,3377,7378,-9248,-887,1989,3162,9194,-2082,-1648,8343,1612,-1232,8256,-784,-9795,-9832,2316,1581,-6121,-3746,-5676,-7492,5207,-4972,6512,1121,-5902,3802,9352,268,6516,3647,-5117,4581,-2853,9620,-3097,1719,-4805,-7486,2313,-7739,-1622,-1967,118,7408,9490,7639,-4095,2010,-3589,-1675,6440,2938,-2091,-8556,9059,-3410,7745,7599,-1788,-5435,1033,8056,2196,-5623,5059,9416,-312,-752,-1288,-4757,7422,9730,5975,-8701,3673,1675,6091,-1973,3245,-7764,5951,-338,-8723,718,1599,-2577,5409,5730,7045,-7293,-589,3126,9781,6433,-7191,8644,3392,6492,8783,-3684,2937,-2450,9494,5618,2867,966,757,-9925,2057,-4367,-6850,8847,696,-1728,5517,-1672,-9425,-697,-6951,5459,4168,304,6191,-3784,-5480,-9326,-8700,9311,5329,4301,-7602,-5976,-4164,8739,4919,-6914,5839,9354,6188,-8561,7434,9935,8931,8347,-9597,-2548,3336,-5362,8782,2880,-2485,-8228,-3655,6376,-2760,-5949,4383,7894,6518,-3610,3741,5916,-4856,6601,9401,2876,-2236,-6349,-5873,-8462,592,-9597,-396,7911,-3839,-5396,-2430,-8830,1027,-693,-4156,6309,6427,-1291,-4462,514,7534,-3535,3030,7517,-2019,6814,9950,3108,529,-1370,-154,-165,-4181,-8721,5786,8258,6664,-6163,295,3514,4101,262,-9906,6430,-7681,5060,2046,7253,-2350,5896,5555,883,-7456,-9484,-3072,-2150,-2036,4116,-5128,996,-4637,-5158,-5308,6140,8498,-4349,58,-7928,4536,-16,-198,-5012,1725,645,-8764,6021,-2040,-1112,8189,2724,4234,-4966,8206,6616,-332,5660,-1188,-9432,2043,-7338,-6661,913,4649,5902,973,3421,3228,5856,9391,-9312,597,-4322,7127,-5687,1619,6126,6657,-9249,9919,-4522,7059,-7103,-4730,-3945,-3640,230,-9913,111,223,6777,8505,-7313,2440,-1331,-2640,-7203,9059,2737,-1030,3778,4638,6167,8987,2092,3913,-6739,1747,303,-6286,-7138,1119,-307,8884,4117,-3208,88,-8910,-9895,-9266,3728,-8203,-1141,-9414,4699,2761,-6790,-8991,-5766,5054,4639,-8668,9378,9212,-2625,-8957,9853,490,3779,1182,-4229,-4539,-1647,3429,7622,-4970,9332,-7157,1379,3099,5675,1031,-5420,1498,-5702,-5953,38,-9454,-5901,-45,2570,2469,4809,-7714,5888,3678,6280,-2532,-5094,3680,-3192,-1651,-8565,886,4338,5394,315,15,5304,3606,-6195,7142,6708,-1554,-6146,-3807,-8128,-7921,9673,-8236,4422,3618,644,-9037,7828,-4280,7120,-1967,3754,-8797,1116,-8854,7518,2723,-6511,-3465,3018,9189,-4329,3757,1008,2961,-2115,-8530,6798,-8703,-6099,6556,4460,3201,-6284,-7726,-9000,-6445,-3327,8781,-8562,-1282,9002,-1833,6386,-26,-532,2443,-5926,2326,1183,-6605,4701,-7262,3360,2320,-4221,-2637,-2788,2358,-4870,5841,8329,394,-4871,5862,-3879,-5982,-760,9806,-9298,-5685,1836,6732,-1979,-2539,-1720,-9042,-5952,8285,-513,9037,7119,-1561,-8007,829,-9878,4789,1292,-1292,7625,-954,1061,2359,4464,-1545,-9391,-9482,1575,-6363,-8227,-6613,1305,1257,-4648,-9956,9741,-4118,-7035,5230,-1195,6057,-578,5334,2041,2583,1456,496,5353,-2807,-1166,-9587,-255,9421,-4257,-8304,-5010,-9750,-218,-4517,9112,-5702,-5200,-123,2557,-8125,-7500,-8151,2616,9806,-1498,620,-1096,2121,-1964,-8936,6071,865,6458,-7108,-387,7455,-6679,-7208,3465,8426,7642,5837,-4288,-2687,2744,-2902,-8283,8362,-109,-7688,-800,7282,-8738,4199,-2780,4166,-3396,1974,9577,7381,-3267,-5041,-4927,-5352,-6102,-7217,7639,3469,2975,9357,-6226,8160,289,-3894,3834,8369,-458,-7824,3101,6863,8970,322,3791,377,8072,1622,6939,-1230,-3391,3744,-4040,-9281,-1363,-9733,-982,3447,-8995,6567,-5838,-7614,6162,-3007,3462,937,7502,-7576,1240,-1783,6771,-7732,-9317,1097,1196,-9526,777,-1946,-6843,8968,-2978,4293,-2042,232,-1791,1192,4695,6364,-4207,-2844,-8637,-5297,-8807,-7552,7970,5220,-3913,-1911,4983,-850,-9322,9755,-8617,9130,349,-731,4166,5547,8366,3683,-2386,-8920,-1685,-8047,1611,-5621,6918,1459,-1841,3508,9739,-8313,1077,6570,4014,4145,9420,8085,6324,3725,-6599,152,-8780,361,-5647,-7419,-9714,4583,6354,3715,6348,8921,3669,-5944,5003,-8754,6513,338,-3527,-9789,-669,-6682,6384,-1597,9825,657,-3609,-2889,-5481,275,5666,-6111,-7878,-9807,-1999,-5734,5890,-2387,6711,-5075,5317,5994,9885,8972,-923,-8381,-4974,9994,-5868,4998,5168,-7072,2103,6866,1682,1230,-5055,-3685,-4656,-359,5230,9249,-6854,5192,-3839,375,6409,-6887,-5887,-5114,1957,-583,-6348,6520,-4967,-8106,7380,1297,112,-3203,-9369,-9662,5013,-1952,-8804,9608,9486,9902,-6550,-7626,9697,-181,-1143,3642,8818,9802,469,-7678,-9844,1132,4574,6337,-9518,-669,6887,-5741,6920,-7463,-5221,-577,3737,6045,-9545,-6891,4229,4436,-8725,-5150,-645,-3754,644,-6008,8873,8480,9789,-7793,-5530,1609,4616,2814,-6392,8772,-7221,9347,-5513,-9346,-758,9341,-2306,8756,-7452,-9029,269,7416,1225,-4367,3654,-7176,5032,7575,-7742,6446,3486,1697,-1231,1423,8582,1450,-1973,-7296,5019,7898,-8436,-2199,6933,3260,2423,9491,8713,-5935,9305,-17,-9986,433,-9583,-2397,249,5329,9523,-5353,2729,1432,2852,-6644,-9101,7234,-4188,-2772,-7131,-9023,-1573,3842,-7798,2018,-4264,2943,-7891,2316,1436,6465,-4665,8747,-3284,1262,-6360,-2659,-7078,-2724,359,952,-1159,3953,-5766,-3986,-6909,6487,2373,1794,9137,6732,-5748,-5385,-8256,9151,-7587,-6975,-1938,-9675,-5566,8495,1844,7404,5338,-5654,-4729,-8907,-1774,8409,-9734,-5364,4105,8299,-2147,-8195,9695,-898,-8608,-8793,-5444,-5946,-2088,-6839,9152,3296,-4687,-4969,3176,4493,-2318,-2457,8673,-6012,-4037,-1612,-3510,-5981,4999,-5894,6490,-5592,8381,2066,2646,7542,5555,2257,5344,-8208,-4567,7759,-8475,4503,-2350,7246,1307,8402,-3012,-2342,-2864,5276,6570,-3574,9756,-8135,-7918,-4011,-8505,-4357,7317,-2493,6700,7778,2581,-5816,-8638,2623,-3697,1706,3584,-6342,2794,-9934,2701,-8802,-1633,5917,-8695,-3001,1632,-8519,-6071,8365,1068,8508,4257,-248,-7274,3809,646,-4726,5665,1452,8303,5961,-6232,-7306,-920,-8036,7057,4238,-8433,1461,3276,9783,-2179,3294,1759,6373,8185,9335,7363,5578,-2584,-3494,-1175,-803,-8488,-5810,-7164,-4492,6075,-8035,-6883,4431,-6367,-1418,-7218,4535,7387,-2000,9719,6198,9721,9918,-4792,9413,-2402,-6028,-1143,-4902,2563,3781,-1103,-1157,-2318,-711,9671,121,-1183,4024,-2932,2347,-2896,-1883,7256,181,-3861,9731,7675,7224,7920,6281,-6887,1104,5637,-7218,-3644,-1156,6902,-6410,-9010,-2315,-6041,1635,-3893,5801,-9306,1793,-7271,-8974,9737,3064,-7013,-8550,-3311,-6333,-4697,3365,-9464,-6152,6938,4320,4706,-6571,8240,-7257,6275,9842,-5304,4611,4874,-8964,-294,-7602,3458,-4302,2275,-8361,4685,5052,4911,-3960,7258,-3440,6766,-6235,3638,574,-7645,-8770,-3762,-4410,6907,-7693,3178,6512,-7533,-5007,-4899,1040,-5680,8034,-330,-6237,-5983,-3623,2813,-9102,-9574,2415,-8008,2674,6489,1360,-2055,-6441,-4307,-9004,-2110,-242,-8453,9947,-2146,7515,4094,4435,-1076,4464,-6739,2333,6672,-8184,-9469,-7484,6317,-9477,5394,1238,-7050,1770,8024,7277,-5029,-3479,3474,-6809,-4216,4973,-6301,4137,-3757,3090,-303,-6414,602,-1883,-4834,2107,4851,-7307,4207,8029,8557,-5156,-931,-2948,6207,5647,-2013,8455,0,7631,-9244,4160,83,-9539,-9444,-7231,-2419,1380,-4026,-8018,6837,-3864,-8135,8096,-8262,1606,-3315,4163,6766,-7191,1866,7858,8760,7499,1474,-1932,2632,-8138,7436,-5689,-6790,4045,7497,9912,-7695,-5162,-8751,-3445,5284,7773,94,-5240,6343,-5849,-1469,9269,-1512,6920,7307,-3969,2247,-7385,9077,-1464,-8399,-6174,-3104,3621,6313,-3625,9406,-614,-8696,681,-2787,-7903,1372,7787,5061,8473,-6823,2040,9251,-1637,-7747,-4913,-8068,-2669,1027,6914,-3782,-6502,7646,-6234,9076,-9346,-2596,-4342,-6652,8828,-432,5989,7197,2802,5055,9185,1433,7905,-6839,7111,9880,-5914,3849,-59,640,8571,6075,2072,6306,-3638,-54,-9184,-4186,-3065,-8317,6932,-5427,1740,-8067,-3721,-9473,-9808,-2642,-8798,-8639,9340,7665,-6812,-2968,-4442,6195,2973,-2768,6294,6759,8688,-7912,8550,-1337,-3265,-8116,-1681,811,-2846,-3861,-4468,955,-261,-6499,-4339,-7788,-70,2233,-9120,-3656,-9873,4904,3450,5373,-8454,2654,-9155,349,-8585,5769,-4906,-451,5378,1992,-1457,-66,1571,-8890,-7709,1005,5629,3943,-9230,1705,4347,1203,-8473,-6260,7553,-280,431,-1291,722,4311,-512,-9853,2073,8090,5917,-3333,-7419,-7980,-3980,6177,3703,-4609,-2859,1270,9385,-2496,7768,7175,-1728,-7935,9393,-3234,9485,5594,-8597,5041,-9568,9044,750,4995,8170,3602,-9466,4952,5338,5140,1836,8504,-7719,1330,-6176,-3352,9446,-1366,-7308,5860,-3636,7977,-4407,-5077,-1241,-6829,-5296,637,-2673,8382,-3540,198,-9093,8099,-9359,8094,-7524,-8186,6078,2724,6925,6610,-1990,-6584,-9826,9258,-8378,2509,4854,9639,-7706,6835,5337,5205,9278,7845,9854,8723,1432,3751,9809,-6416,-5903,5988,-2767,-2373,5764,-3868,-202,-8134,-4972,3516,1330,4455,-7289,-8927,-5746,8092,-7775,2157,-2182,4192,-783,-9890,9156,2655,-8925,-3858,5207,-7280,-7171,9426,-7201,3062,4981,681,127,-4502,-1038,-6929,5673,-5890,2075,3929,6281,9714,5567,817,-3553,2825,-805,6684,-7333,-6081,1363,6313,6531,2396,-472,4587,-5125,7855,3273,-526,-227,6809,-2955,3468,-134,4573,-9793,-8844,-5782,8242,-4744,-616,-9418,-1476,-8131,-3537,8892,-567,2324,9154,-473,4582,4473,-9575,7356,-4570,8624,4044,7726,5211,7553,2583,-7718,-9259,3744,1202,-6952,1536,9350,265,5801,5073,-1365,-5786,-7628,-8790,-9038,3786,7248,5899,3337,-5191,1785,6285,4699,882,3512,9540,-1734,-3647,1941,-4124,4060,2970,-9894,2868,-9901,2142,-8514,6461,-4099,570,-7463,-2505,7858,1198,7394,4011,-2887,3462,1978,-9631,-8184,343,3864,-3368,-4151,-9309,4083,-3766,-4130,918,-2332,4821,-8476,-2586,-4791,-5658,-4224,-9841,-6160,5744,6409,5130,1897,-2889,-7052,4486,407,3220,5637,-8435,-3401,-5809,7336,-7595,2943,-7639,-3426,5693,-7027,-563,6918,-4,3718,2621,-6332,131,-9809,-9027,-2441,-5422,-8401,5494,8059,-8283,2520,373,1153,-8177,2373,2947,-9781,7171,2078,-2543,-6073,-1061,-1917,-7976,-6098,-2262,6601,1483,6653,-1889,870,6893,8317,4277,6388,9407,-7424,-4194,-2163,-5427,-5007,7120,8760,-3364,-5161,4271,8433,9019,5141,-1474,-2486,9629,9440,8456,482,5105,1745,-1512,-5409,4446,2257,960,-5222,-4257,-7034,7581,304,1539,-9630,3169,-1017,221,104,-867,3834,7081,2588,-6682,-5308,7695,5605,8573,-3269,1569,-4193,4996,-7299,2893,8734,-6716,2298,6876,553,-2071,-9710,-1690,7804,4369,9940,-630,-6378,-1621,-539,-7908,5169,-3492,-2799,4503,-257,-8288,-2919,-7462,4237,-8118,-6029,-2391,-8609,7645,3028,-3447,-3182,-2343,-3510,6663,-5275,448,-8412,-7034,969,8010,-5364,5076,-9706,8399,-7516,652,-3776,-1124,-6698,1590,-5102,-3184,-9793,-1875,-9261,8477,3014,-9408,5640,-3010,9699,-346,6239,-533,1261,-5278,-1698,-9553,-4772,-5492,9808,1478,6690,-1660,3637,4544,-3354,-982,-7023,3347,9682,-3079,1439,2387,-2727,-5519,-5800,-796,1767,-7125,-1349,-3710,-6747,-8210,-5997,-5626,6771,-6191,-8276,962,2527,-9359,2541,-6984,538,6044,17,4493,7150,-4439,-4251,-7880,-5530,8634,-2792,5329,-7463,7189,7568,-4654,-6917,1486,-6477,8830,-9192,2639,-4051,-9567,2364,-3353,9459,6236,-3113,-9522,-9233,-8390,6749,-5299,-8518,-3244,4866,1987,-3560,8815,-3804,-8583,7771,-6971,-895,7243,-6139,-9535,-7629,-6652,-6607,9258,-9689,8537,7623,-3121,-9014,7129,8851,808,2465,359,-9899,5478,-941,-4594,5568,-3663,-8355,-6253,-8619,4725,2337,-1747,-9357,-2287,-1349,-3505,-1239,5383,-7180,-3088,-1533,6881,-6713,8119,4608,-2212,5114,-3948,-9871,9792,-1221,6560,6698,-1479,9488,-5785,6459,-6337,9984,9695,3781,5624,-459,-5138,3830,-5517,-3510,7690,-2194,-2736,7737,4721,7213,-774,-8442,6119,4998,4659,6937,-2717,300,1116,1323,-8588,-6745,-5223,3496,-278,-8628,-5858,2230,-6156,5371,-3793,9345,7592,3698,-655,4181,-9123,-384,-2814,1660,3519,2656,-8107,-4925,-3725,9492,-7341,-5016,-7852,-7598,3075,-8342,-5691,-7130,3643,814,-772,1210,2044,-6727,-284,6956,-7779,2605,5034,7879,-7660,5942,5104,-3083,7307,2335,5986,-3139,-1009,2580,1760,-5015,2952,1861,-2905,2451,-3436,-2901,5289,-1821,-3976,2262,4694,-7787,-4127,-6245,6606,-4533,-340,-990,7434,-6551,8891,-931,-2454,-5958,-2865,-2298,-6553,5490,-154,-4629,8780,9632,-3296,-3291,-9129,2056,1496,606,-2827,-1072,-7598,9496,5690,-8620,3448,2413,8886,-2218,5728,3435,7221,5955,-3421,2737,8742,-9046,9077,-1247,1894,4219,9673,-8687,8919,5682,9917,-9280,9023,2415,3353,4123,-4985,-4251,-258,-8611,-3851,-5250,6878,7020,5729,38,-3841,994,2470,16,-9464,6298,7853,-478,-2529,-8769,5853,2180,-3287,1083,7778,5874,-2081,-8853,-1669,-718,5505,-5517,-2056,-8144,8195,-4468,-2712,4807,4862,6309,6701,-1115,-9444,3584,9722,7211,2627,-8731,-2277,-9783,-9835,-3562,3700,293,8780,-4789,-5457,-742,-4710,-7909,-1339,5445,416,-6314,-9202,7214,-2340,-9528,1048,-3480,8465,-3688,-2925,-201,1152,1750,-9905,2657,-8630,8860,-5105,-1603,-3972,5258,-9827,807,3282,2328,5456,-9818,8834,-2203,8990,1704,9670,-5258,-8140,-4791,788,-4483,537,-2467,4685,6605,-4772,8753,7560,-5888,368,-9311,8732,2,-3683,-3671,-7010,-5562,-5567,5238,9691,-5244,-4399,-6683,1180,-2645,-7249,-7265,5604,5955,-401,-5827,7433,2660,6890,-4960,5674,156,-7457,4493,-7550,-7748,9179,-3002,-3131,860,154,-59,1363,6753,-5566,8066,-2736,7769,-371,-4926,-3399,7038,-2982,-4486,-4719,-6493,-9795,6703,9067,40,3582,-8960,1853,-4400,2332,-8789,-538,261,3526,7215,2203,-8290,-1172,-1838,6147,8004,5479,-3744,-2025,7806,-241,-3993,-3602,-1625,3665,-2792,8050,-6339,5404,-3260,-6535,6851,8245,-461,-5539,7105,2566,-2253,468,2357,-1572,2177,-6377,842,-9219,9240,-8456,-1711,7752,2600,-8519,4669,5805,-7937,7833,8119,-7654,1469,-9224,-1261,-7789,9830,-4729,3727,105,3237,1239,4318,8818,2283,-919,686,2732,4190,-6996,-1505,6459,8109,-1106,128,-6678,258,464,-3807,-390,3237,4552,-6369,450,-6633,9246,3418,7991,-2649,-1394,9551,8610,-8957,2871,-4203,-6556,-506,1253,-5489,5684,-131,179,-1398,-60,-766,-5666,1319,3354,4644,-5282,-1290,-910,-1034,930,6848,-7046,-8217,-2338,2608,-3437,9438,3793,7406,-9665,-2575,7150,-1107,7508,-4757,1201,-9603,-1999,348,6554,-2602,-7963,-9829,1492,-1243,-283,5581,9221,900,-3456,-2969,99,8766,7726,-7366,317,4912,1399,-5916,9059,3413,6218,-1271,21,4693,-8221,-8835,4162,-1376,-2134,-6587,3820,856,-9323,-928,8426,-4793,-4653,3005,8224,-3944,-3941,2639,-3562,-8675,6692,-5305,8066,-6626,6259,8183,7314,-4866,-2383,-107,-1491,-5215,-8683,5594,-2802,-6668,-3184,5683,-626,8332,-4177,-6416,-6843,-4473,-2922,4201,1867,-9070,8178,-2930,8076,9331,-4612,6290,-1115,541,-1911,-1532,-830,-9309,-2655,-2642,9813,7427,-1109,-2988,-877,-3445,7904,3349,-86,-5420,6378,7334,5859,4692,2639,6367,1690,5414,-6725,690,-9489,3027,6942,46,1558,6256,5501,4802,4951,6756,-6775,1898,-7214,-1981,-8296,-6751,9391,-903,5455,7326,-1876,-1986,-7992,-2480,3671,144,-313,9561,5305,-7700,-3830,6489,-8828,9795,2721,-329,-3441,-9572,-5717,5379,2270,9839,429,-9429,9700,8729,275,-8518,2504,8294,-1713,-711,7670,-9574,-6252,5869,8702,283,7342,-9348,-7575,8638,379,1254,-9222,5363,-837,-157,-4067,-6157,8102,9010,-8648,-8655,-4734,1962,1220,-4142,-4873,-7070,-4094,9116,8731,-1641,7632,-805,7839,-9507,5537,-9364,8576,-7514,-9577,3493,3154,7004,-389,1604,5465,4214,3284,-127,-7431,-5127,8588,9317,-3434,5268,-8974,5111,-5080,6535,-5284,7297,4807,-2434,9545,5280,-643,-8756,-491,-3565,-8419,-2837,5003,-8479,2294,-3525,-9918,-8398,1532,-129,2436,-9451,-4933,6410,6847,2351,6109,1467,-5403,-6808,-3815,-4776,-6289,6041,-4129,-532,-5397,8745,458,8042,190,5691,2236,-7303,6541,7327,75,7145,-8011,2916,-6047,8625,759,-4386,-3341,2987,-2414,-8710,1300,-224,7772,8581,6388,-3247,223,-2110,4708,-2548,-9758,8036,8185,1523,5005,870,-7841,-1220,-8687,-4438,-4189,7468,-6053,-7725,-5992,-8558,-4954,869,-2040,2920,-5636,8031,-8889,2633,372,-6841,8167,1504,4995,-2162,-3148,-8063,9014,868,9347,-6238,-9742,-9347,-8759,-1593,-1304,607,2830,3257,-1411,9043,-8521,-6083,-1636,-695,1485,-9476,1958,-9713,-2942,-644,8578,6158,-1747,7247,-937,228,-83,179,5817,-5071,-7958,-8638,-6660,9666,-6394,-7694,8046,-1187,695,-9213,-6597,-8744,512,5071,91,-9026,-1028,-6875,-9690,-7650,1382,-6710,7907,-1379,-2932,-7385,462,-3951,-2577,4219,800,-9459,-1052,-6287,-1995,2629,2748,-1831,5339,-8764,1562,-9003,7020,5622,5928,-5509,-5971,-7374,4556,4862,-2247,1908,707,-5586,-7996,-3387,-2041,-8876,3024,-4173,-972,-2032,-4571,-5027,-9979,-8087,903,-1874,-3956,-1681,-6277,-3006,-4316,6452,-8439,8980,3223,-7461,8249,-4296,-1622,819,-3868,-7159,1354,2351,-3888,-6043,1521,4731,6236,4178,-8065,3764,575,-801,609,-6610,3209,-5654,-667,-5131,-4285,6159,-5933,4172,7025,9283,-5548,-2087,7504,-3847,-1355,-9750,-906,-9161,9407,-682,-5114,-4874,-7303,-8193,-8621,-5474,-7714,9896,7509,7783,1438,2970,-6413,2817,-3888,5013,3670,7348,130,-1723,-4688,-2371,-8784,-9220,-4388,306,-4908,-8958,-7110,7161,-1675,-9844,-525,9944,-3305,-2221,7772,-7965,-4185,-4673,-1478,-9237,-9711,8978,-5535,-1515,6651,8797,-5195,-3773,-5330,-5783,6135,-3231,569,4876,-2335,-6264,-5245,2607,-4662,-8026,6423,8165,-2090,3446,-1806,6356,-3838,-881,-5870,-5685,6362,-593,5500,3626,-5707,1634,-8637,-3886,3256,158,-8218,9616,2993,3200,-4267,-2857,3220,-7108,3875,-5750,3904,-8935,-6222,1315,5054,-5201,-4186,-1682,2760,1224,-5607,-1806,-8340,8717,5885,4671,-980,6556,9619,4231,3261,2641,-9655,-389,-1245,-8125,-5534,-8497,3330,-5361,-6717,7536,-9193,-9320,6121,9413,-3353,-4560,-2859,-743,-3385,134,9777,-8664,-5423,-8816,4156,7652,1739,4736,-3306,2965,6308,5094,-9908,9553,-9083,-6140,6317,-5354,-4371,-2588,-1251,1734,9048,-6361,8069,1123,-8560,-6689,-2088,-9582,-5056,-8095,-2107,4514,-6875,7448,7322,8842,-2618,-1499,-6580,-6599,5995,-7090,6350,3748,4145,237,-8580,983,-6734,5357,-7130,-8128,-5097,-3287,-7919,6315,-625,684,-5627,-2401,3601,8105,2553,6785,-4038,6735,2045,-4552,-6634,-6183,2226,-970,1888,5525,6304,8295,5626,9270,3040,393,-7534,-4761,-4913,5087,3666,3169,4733,7382,9509,-7313,2040,-2255,5284,8465,258,-5622,2006,5257,-2292,-1167,7404,9174,-7813,-6850,8959,-3166,6838,-3442,3855,-8325,-1549,-2226,-4721,-5080,-2313,-8787,-3003,4946,-8463,-5032,1578,9480,-6313,6206,-838,9371,8626,-34,-1813,9800,-9226,-341,7347,888,-2950,5229,-9944,-6061,4520,9694,9335,-2808,5173,5992,-813,-3018,-6054,9746,7570,7456,-401,8508,9333,-3963,-664,1793,-5194,-711,8960,-4485,-9446,-6856,2104,-738,-8638,6883,-9653,7263,2800,2918,3451,-6904,4429,-574,6875,2425,-1291,-6566,4673,624,-2973,6734,5264,4797,-5827,-8646,-6138,-2469,4985,-3535,-351,3528,-5452,-9188,-5530,-7567,4655,2735,-1592,4651,-8681,-4308,1501,2512,2335,-3818,5663,2757,2177,-2080,-349,-913,-5114,3523,3006,-4163,2899,-3724,62,9765,5606,-707,-4453,-9227,-2144,-9393,-2350,1317,699,1225,-7181,258,9931,8240,-2217,6320,-5240,1286,1998,4187,-7351,-9745,-9173,885,-9507,6468,4913,-6216,6013,-3457,-7360,5626,-7394,1691,8820,-9555,-7564,-6979,5419,8877,-2950,-7087,-3249,-9719,-5615,-9218,-17,-3527,6821,-3239,8843,677,4787,-7213,-4138,2128,6294,5468,5469,-1377,-149,3973,7684,-4728,-7710,-3385,2730,7128,-4702,-5014,-423,5997,-2025,-862,-356,2841,-9726,-6881,-4362,-4305,-3259,3140,3766,9602,-6017,-126,5011,-4331,9687,-3194,5293,2328,3646,-3999,4898,3354,7144,-339,-7543,-5917,-4028,1144,542,-9414,-3419,-9172,-26,9651,9407,3765,-6122,6676,8812,4802,37,-5817,-6725,-6381,-5038,9573,6602,1052,4752,9210,715,2968,-9533,2215,97,-4073,7410,-880,5701,-3980,-4417,1927,3734,7444,1923,4569,1980,1287,8660,-9263,590,-6206,4083,8004,-5830,-2102,2769,7373,1386,8716,-3067,-7780,-5268,5021,2607,5238,8452,-3214,-7654,6194,-7087,4446,-8669,1007,-9862,-8292,2160,9700,-7,-6452,-5688,-6786,-9372,-5850,1658,8606,-2897,5226,-6594,1872,-7202,-7628,8443,-9422,-1666,-9576,5638,-6129,-3471,4951,7879,4230,1863,-5800,1971,4266,3855,3164,3988,3378,6839,8514,3925,-2789,-673,-353,-9,4130,6379,-9074,1054,-5501,1421,-2475,2840,-21,9173,1257,-3133,4670,3486,-7103,7567,2044,-9504,7394,-9718,6350,9227,5277,-8945,-5588,9036,6872,8156,-6304,707,3460,-8403,-1155,-6792,2895,5607,-2218,8667,-438,6918,-756,-9230,-2419,7485,8937,1946,-6754,6350,-1368,-2028,9855,-449,-1583,3018,-53,-257,6983,9253,-1097,7193,-7724,4124,646,8097,-7722,1435,-1738,809,-3040,-4875,2705,-7458,6923,3794,-7649,-8602,-7489,-5354,-8510,-6385,-7892,3425,-2721,-9921,6062,235,-514,6483,8513,2600,-6894,6577,-8314,5928,2851,-4956,-6908,7783,-9276,-3386,-3242,3820,3782,4140,-2546,-3292,7465,-8426,-9503,-3512,1182,7650,9769,3061,-6934,-574,-1768,-3103,-2570,3914,-3842,1532,6692,-361,1232,-8135,-3863,7847,-9947,2558,-5368,1812,-7197,-6626,-8696,9388,-349,3959,3327,-8835,-6065,-7225,8479,-8603,6391,5753,-2033,5878,-5782,7829,1969,-5496,1925,-5101,9382,-6128,9525,-9317,4266,-6278,-8900,7146,2678,7953,960,-4974,3226,7405,6840,-3630,4133,1788,-1500,1701,-4538,8979,1498,-1837,7647,-9441,-4481,7426,-2438,-2225,3689,2141,1862,5294,2810,6432,-4832,-8207,100,3964,9929,6829,743,-3904,-3473,5176,5630,5365,-9214,-8807,9354,-665,-1659,-9092,-9130,-7733,3936,777,-4595,4522,-516,4925,-3478,2091,-1411,-4892,3981,6989,5771,4500,-1833,-2500,8438,-3077,-3021,-6256,3350,-5406,-156,6612,144,8557,-1464,4788,-7798,2266,-7840,8664,-7107,439,-9813,8360,2100,-6790,2533,-1071,-2647,-8715,-6955,-9472,-7776,-8130,-7483,-5959,-172,8188,9156,-4346,2079,-7540,-6540,-9679,-211,-5345,9980,-2996,4259,4192,5881,8314,-1467,-7313,-5261,6437,-1099,6003,-2317,7104,-7815,-8727,-5898,-1643,6055,-5294,8385,2890,3441,-800,-6675,6508,6998,5224,7814,6591,6606,-3143,-5974,-672,-4256,-8597,2690,4006,-4538,-3871,8552,9018,6034,1540,7748,-2343,-4909,-1683,3895,-4934,-5173,-3890,615,8698,-9505,6281,6660,-4936,6528,-2776,-3513,9671,1910,-2700,-1369,-68,-8593,2722,4971,-2943,-6542,7688,2627,-3596,-4034,4877,-4822,9405,1370,8620,6024,-8855,-9696,185,-1624,-2618,-8299,9981,-9217,7544,-1627,2477,-4397,-6342,-8976,9145,-8815,6374,6637,-9676,832,-2832,-9267,5788,-3178,1336,-7392,4586,-4433,1929,-6643,-8921,-7062,-3573,-1377,-1856,-9511,-9457,-3871,-8701,-7937,1473,-7780,-9510,-9575,-3787,-686,-2676,-8259,-8997,-5324,7373,-1060,4275,4439,5724,4504,-7403,-8145,6401,2735,-1437,-8533,155,-1233,111,-8174,4896,-6613,-5354,9578,6860,-7229,-9006,8667,4682,-9259,-1183,-2064,-7935,-5497,3474,-831,-4842,-8919,-5378,5038,-8953,-6441,-1537,1636,1386,9081,7124,3640,8647,-7303,-882,5960,-3037,7726,-9709,-2866,-7313,9221,7834,9086,6721,3841,3712,7226,-8716,1952,1659,-3028,5388,-2817,526,-7219,1502,8432,-5729,3371,902,4301,-5800,-7180,-5324,2784,-6311,-6170,-3585,-3347,-5639,2860,9022,6602,-6723,5499,-4054,4304,-2052,2707,-5900,6433,644,8420,-496,4872,-1677,-7640,4809,5444,2056,1271,9535,-8664,-4883,-4922,-9880,2840,-8167,1586,3931,-3623,-5406,-1300,7498,-4935,-2762,8527,-2923,3646,-142,7060,-8190,6458,7839,3144,2150,-1568,9902,-858,-8605,7637,-3109,-8285,6725,5425,3063,-3646,2421,3832,-8385,-8347,-4366,-1405,-3122,-3688,6317,6754,-9129,-7197,4938,5329,-7496,3247,-1239,7584,-2819,-9090,5223,7951,6494,-5946,-3185,6228,-2843,4694,-9267,-8937,-9469,5089,8476,3912,-5471,-5296,7059,-479,-1050,1503,7992,-9743,-5664,3653,8721,-2158,2777,3685,-5690,-2421,-6745,99,933,-763,-7683,-8942,5862,7664,8167,8146,-4923,-7925,3239,4258,351,-8930,-9099,2063,-9423,8505,-8835,-1602,8352,-4311,2976,6531,-6556,145,-2187,-192,8458,-3379,6883,-2865,1242,4550,-210,3038,-4364,8284,-5111,-8050,-4451,-4077,-2444,-7915,-4748,-4185,6597,4133,8788,-9733,-4998,-5386,-7205,3203,530,-3789,4821,-8866,-4572,8259,-639,921,-1180,-4565,7272,-2705,1771,3491,1394,9814,-7271,-5626,4134,2720,-1167,5928,-9183,4428,-5612,-4807,9896,-7243,1469,-4725,-2326,-1389,-6658,1513,-9366,1423,-2979,3622,5956,887,-5588,1701,8938,5019,4493,3664,8535,7998,8532,-3977,6244,5864,-3922,-7723,8732,8253,-7820,-4229,9488,-9848,110,9428,-7874,-5467,-3660,2577,-46,7417,-6660,1331,4884,908,-7404,1403,-797,-5487,-2327,5990,394,-9696,-2605,-3228,-9551,-2588,2048,8799,7877,-6270,9314,9140,-3544,1236,1589,5159,-6244,9002,-2775,-1598,-5251,-6026,-1983,-3876,-7508,2133,5454,-6833,2932,7531,1863,-4157,-2618,-9158,2300,4278,2781,-5981,7913,-2238,7006,-8541,-1479,-1978,967,-9201,6697,-641,-343,-9017,-9869,9686,5309,8571,4439,-1036,-7165,-8173,-4674,8984,4543,4101,9961,-6778,6920,-3539,4208,-4285,9557,7896,3468,5152,971,-9077,-2735,5892,-815,-3836,-1938,-9331,9321,2624,-7499,5117,3422,-187,-2793,7961,-940,-8642,-4818,-6349,1991,2798,-9023,4970,-9536,7240,-1845,889,-9702,-8431,4322,7261,-2957,-6907,2483,7130,964,-1533,-9278,-8780,4439,-2402,7978,9240,-7166,5283,9017,3241,1673,6903,1144,-8029,4731,-2437,753,-5360,1830,-4052,6715,1450,-1475,-1635,-2212,2889,-9602,9781,6216,-3092,-951,7961,-3204,-6855,7489,-4306,349,3546,-651,-9805,2688,-9745,-7225,8034,-8250,8856,-2438,-9904,7804,8983,-2827,-3544,-7439,-1078,173,-5860,2855,9925,3024,-7041,8515,-6520,-8663,-5607,4550,5973,8149,8184,-5535,272,9287,8506,-7211,5415,-9141,-2109,-7392,-5754,7484,2759,4857,5153,-2330,4120,-5666,-1593,3193,992,-982,6335,-7018,-9668,54,3874,-49,6271,824,-5111,1216,6347,-7191,9538,8289,-1344,-1025,-2935,528,1757,7306,9198,-6318,-7381,-8443,5031,-2220,-2112,1452,8415,-1902,8087,208,-857,4388,5019,8902,81,-4779,-2705,4096,-6871,-2744,-4913,-2990,-5887,-1026,-9002,6523,-9569,3616,-9767,4512,25,-7687,791,5629,3254,-9404,-7866,-8800,-7933,-9808,-763,4309,6585,7556,-5072,-744,-5007,-9116,1799,2875,9439,1827,7812,8179,-299,-5561,472,-9776,-1511,6607,1686,6261,9207,8446,1467,-9494,7171,-8433,8561,1171,3739,7545,-515,2872,-3700,4112,172,5600,2074,320,3115,-1281,2663,7833,-4461,1575,6293,-1576,645,1135,-649,2403,-2928,-6161,-284,7485,-8118,4042,2381,310,7374,7456,-9921,-9923,8476,710,6774,-7320,-5247,2087,6748,5796,470,3798,4491,-2564,3085,3091,-7178,4378,3364,9218,5504,1161,-8683,-5917,9941,9611,2188,-5275,-3339,-5859,-2794,2612,-5908,-434,-6310,9004,4833,-587,-3454,-2594,-8550,848,-3522,229,-2347,8323,-7678,5826,-8173,3040,4538,1168,8538,8613,-7336,7131,4987,5156,1373,-5108,-515,2022,-4374,3177,-9918,8586,9179,-904,-8192,-296,8794,-4677,-9537,8472,-1431,-1776,7629,343,7360,-8831,749,1990,-2103,6154,-1172,-1440,-9542,-1547,-6275,3542,3904,-5906,-7575,981,3127,9717,-366,-1752,-5000,-3794,-303,132,3007,8416,1912,8864,-1041,2046,-8222,-5726,-7988,-1130,5508,-2026,-4608,4223,2522,3,-9130,-2844,7438,-8947,-8519,-9274,459,2400,5776,-2782,-6133,2929,9782,-9884,6336,-5280,8346,6509,-2179,8840,-2507,1996,-794,5861,-1742,-4773,-6746,-4709,5699,-4853,-9919,1850,323,-9078,-1926,8717,8512,-7308,968,-7941,-7030,-5828,-9206,5665,-3625,7898,-3572,-4628,3286,-6721,7349,7842,-6948,1126,-1867,1124,9377,-6833,7648,-4315,1,-3013,7914,4832,-3586,-2188,-9698,4096,-4706,-5001,1502,4803,8872,-2044,7155,-7119,-300,-2258,5139,-9176,549,3976,-7941,7808,-8892,1408,-5754,-8031,-9170,-2482,-3640,3483,-1462,4928,-6584,-3824,-3546,-7952,9736,8498,-7099,-1205,2560,-5911,-2624,4695,5169,-5884,-602,-978,3291,6361,6187,-2220,-9578,-5245,-8173,-2138,-4885,-8481,3620,3272,-4808,-8395,-2508,-5266,6542,9360,7352,-57,-2518,-5799,3427,2174,-1826,8868,3984,2698,-1206,-2146,7973,-4555,-1997,-1933,-3526,-1100,6085,-8223,9586,6553,3468,-3384,9091,5039,-8323,-3427,-2500,-1644,6551,-124,5923,-4029,-7348,6887,3521,254,-625,8602,-8010,3669,-1498,2256,630,5403,2196,9934,6020,9058,8354,-7911,-3469,-5082,-8666,-3897,-3470,-1634,-3142,-8098,5002,-1983,417,-4183,-4444,4713,-5138,-8391,-4270,-9748,-8322,-6032,-4348,8320,-6486,541,6825,-3375,-559,9854,1103,-1068,6156,5411,-5053,-1632,7465,6429,-2467,5717,-2477,5938,3234,6984,-8756,5139,-9761,2133,-1024,8769,1436,5222,-8227,6638,-38,1942,-7022,-1614,2109,1147,-4339,-6674,4819,-4782,6661,-8265,5064,9200,8801,9673,-9980,1143,-7498,3159,3008,7948,2445,7893,2560,-1053,-6502,-9559,-2031,-6392,1133,5202,-719,-3971,-4263,8273,3454,8135,4726,-504,2969,3723,9009,8603,9317,1634,-8140,5754,-5393,-5402,9428,-164,9744,4240,-7598,9595,-8319,-4686,5581,-1894,-4477,6144,-1049,-971,-4333,3318,-3284,8649,6883,-77,7486,-1462,7624,4918,7619,-504,3956,-9353,5492,-9445,671,-9839,-1958,-8947,-2611,-4819,-6770,-2029,3840,-6524,5552,-9902,-3252,7810,-4418,6162,-8970,1766,-4938,-7173,1366,2253,1807,3868,3673,8923,8896,-1560,354,7694,-6190,-1438,-4787,-5600,4992,9864,7686,-4440,1346,4707,-2315,-916,215,-7918,-6963,9741,-6047,-2199,3575,-9481,6413,-7983,8005,3969,-1011,1937,-3327,-280,-4791,-6980,2014,6366,3644,2722,1914,6508,-8698,-9846,-4463,-213,-4237,-3869,-6368,9261,-7271,-5617,2346,8938,-6983,1833,5917,-7194,-7732,5744,9936,6209,9504,169,-1732,-3065,-570,-1270,-8250,-9913,3553,7749,-3754,3152,-423,-8090,-8651,6861,54,7203,855,-3756,-758,-7837,-9227,-5203,-7761,-375,8014,-9005,5854,-8979,6341,3996,9786,-1224,9139,-9141,6240,-2079,-2761,4423,-2283,-6595,-2502,-8722,4803,-1462,-4087,6497,-6551,7631,-4134,-2311,9861,-6461,8603,-5635,6453,2643,9550,-5001,6456,623,-4282,-5636,-9360,8753,4071,-9505,-9344,-1714,9194,600,6919,2689,2398,-9543,2284,2227,4637,3918,-2212,-2042,5497,6473,-2836,4682,3184,-8760,-8951,1900,1973,7493,1576,108,-591,-4046,-8004,-8910,2890,-182,-6580,-1241,1092,8133,-1438,-8545,5001,2654,3627,5784,6201,-9475,226,7016,7008,-6870,-8846,975,3266,2124,2600,4153,9053,-3096,8444,-2954,9525,-8114,9824,2059,9762,3807,3003,2945,-7452,-993,-848,-6838,-7410,773,-5489,-1305,9230,4212,8431,4144,-3703,1790,-7764,-5199,42,-2452,-5152,6411,-7880,4876,-4894,3753,4484,1363,8306,2530,2706,2644,-6554,8789,-8485,4492,2462,-7579,-5298,-8049,-6404,2333,-6473,3450,-4073,-624,9132,4001,9060,-5392,3112,-6155,5544,2531,-6717,9690,2190,-1693,2651,5760,-503,1944,-9468,7416,-1670,-9287,3729,8584,-381,945,207,9510,9862,8157,-3570,508,-2506,9158,-8399,9516,-321,7985,9872,1583,707,6944,3955,-1560,-682,4087,-6441,-3376,-7841,-3818,-7730,-5487,-906,-9282,1040,3764,1022,-8601,-485,-9447,2578,-4127,-6943,-6742,5504,425,-4943,767,5637,9063,7752,-6461,-6564,-2409,5143,247,-4822,2033,-5652,-536,-2216,3394,-1758,-3171,-70,2487,251,3997,-2391,9410,-4072,-4005,8889,6382,-8388,-6457,-4512,8215,-6854,8795,2556,-5668,-2157,-6137,-5347,3166,9047,323,-2151,-9578,6944,-7035,-6370,-482,424,12,-4408,4109,-3911,-1570,-6959,-3458,5,8066,-3804,9720,-1959,-642,-8941,-5587,-6541,-2427,-5983,244,8846,-8844,-2023,-1059,3628,-2567,4215,5818,473,8965,2834,5586,-6703,4210,-2188,-4732,8355,-2440,9328,-6701,-6481,-4586,5084,-4788,-5721,-5364,2770,8958,-1053,5092,1820,-6811,-2953,-5715,-4751,-8183,-5276,-5846,857,-1681,-585,-4607,8478,-5833,-3258,6189,-1824,-3633,3450,1746,-1161,4841,-145,756,-3509,2299,-8355,-5464,-4025,2390,6008,2435,-7312,-139,9273,7112,876,-2397,-8705,-2344,-5070,-5960,-8552,-830,-8934,-457,5055,5379,1035,-8539,-7897,4244,-8761,5229,6746,344,6840,2311,-7137,-3694,5056,7202,-7205,2112,-5466,3476,-7960,8333,-2921,-604,-3003,5678,-2244,6503,-239,-340,-5550,9106,-5194,-6538,-5474,2926,4671,-4271,3976,-7668,2977,-4361,8299,3144,748,2433,7882,8956,-1690,-921,4591,6018,-9084,-1825,-9483,-1995,895,2816,5497,1348,-6937,-3395,-660,646,-1023,-4391,4402,-905,841,925,-7921,225,-519,-3331,9720,-4805,-1597,-4513,1820,-9995,4419,-6853,4512,-5864,-6075,-1449,-9760,8635,-6843,-9887,-214,-7911,-6533,1381,-8261,-6686,-6516,-2065,8899,1689,-4575,6607,-4586,5119,8318,3327,2636,4645,-3924,2454,-3654,6504,-6415,7245,-9420,-7351,-7172,586,-7995,3409,4501,6264,307,2309,-1137,-7799,2112,-2862,-2472,8691,9991,5674,-8279,-1024,-7323,3633,-7892,-1930,-3812,5184,9136,-9585,1248,-3055,-3837,2876,4503,4348,8947,3145,5515,-27,-7172,-4921,-5627,2812,7595,-2391,4119,6212,7147,-277,-6521,6254,-4069,-5840,6073,-6216,5491,42,3311,4186,-1730,-4818,258,-9844,3235,5570,-7473,-2941,-697,1773,2979,5837,-8708,8777,4335,2937,3565,740,-8609,5015,6724,4265,4770,6442,8084,3978,6960,-2497,2967,8986,-9978,1690,6881,-1348,2034,7494,5789,-8415,2692,-5475,-4740,-591,-54,-7253,1295,1313,5765,-7124,-344,-7323,-2161,7212,-9520,-4250,-3926,-8633,-246,-8114,7869,3450,8110,-8801,-3651,-9512,-4598,-7354,-7403,-4325,2938,1181,2523,-7351,-3035,7038,3684,9813,-5924,-9361,5253,-4716,-6460,13,-3742,-4548,-8105,3654,1458,-2230,9691,-4229,6437,-4430,2696,2194,6682,271,7767,-8175,-398,-8635,-7309,1911,-9013,-170,4163,742,-8648,-88,-1521,1082,3550,-2470,-2735,-9171,-1028,1717,-7356,-3992,-8642,-152,5552,-9037,-3683,3859,5475,1293,-9988,3047,-4115,2397,-1237,3948,4156,-7846,-9509,-9681,-919,840,-2739,-5851,294,-1277,4972,5607,7865,-9939,5465,851,142,376,7561,-8673,2299,-9870,3798,9012,-4307,-664,-5323,6578,-799,3023,2057,847,5849,8009,2041,5840,-4424,3777,-532,6609,8041,2543,1333,-2794,-7147,-4263,-7413,-1640,7205,-65,-6771,-99,-856,710,5313,5019,-9755,3325,-8843,4525,-5396,-1899,-7462,-1854,-3948,1057,-3010,5229,-3256,2847,8567,-4100,-6350,-9292,225,9725,545,4469,-3928,-7121,6400,7366,-1762,238,-9003,-2478,7252,7929,4547,2486,7132,-7916,-9872,-6209,7892,2515,700,3992,3060,360,-8490,9878,-6981,-2359,-7724,6891,-5199,-9610,-4063,-7023,-2911,4187,-8731,3051,-8324,-2194,6939,2032,-5768,-9460,-6077,-4470,-3003,-294,-6240,-4409,5317,6408,5501,1584,-2652,-5870,2043,-179,-3352,2515,5402,8669,9543,-107,5887,2537,-4232,713,4032,-7532,8774,-9602,-6743,-529,-9286,2397,-5089,4736,-3142,-4680,995,8281,9073,-6150,9911,-7326,201,-8215,-4780,-1319,2292,8978,5316,-4213,-5816,1094,7564,-9974,228,-1017,4833,2170,-4683,7767,-11,-3943,1753,-674,3827,6585,8783,5095,6165,8579,-2265,2277,-1688,-2757,6357,-5938,8419,8183,194,-3193,4211,-8174,-5558,-3683,-8215,661,3195,-3411,-3838,9163,-7963,-7098,-8830,8064,4404,9522,4095,-4888,1025,-3755,-3175,-2475,4525,-31,5621,-769,-8883,5201,-8008,-5708,-2023,6088,-5362,-8590,4677,-3322,1489,734,8331,9914,-4167,-8502,3203,-5486,-6197,-1706,-4793,-9501,110,5947,1490,-6732,3227,2586,-1641,-8757,2147,628,8327,667,-3567,-2475,-2321,1466,144,9356,-2828,2091,1696,3849,-7633,-5586,-9171,-2190,-4413,8783,6480,-3821,3989,-3854,-5932,685,-1557,94,-1403,6533,3317,-7582,-1415,1762,-563,-646,3923,-439,4276,-9328,4841,2473,-4343,-5470,3085,7972,5415,6686,-2154,5123,7225,-7032,-9495,-2128,-9098,-3017,-449,-6017,-4134,5089,-6836,-1069,-2835,8223,-6674,-2245,6973,-9822,-2540,3174,2907,4796,-7179,-1060,8496,7903,1979,-7778,9002,-8439,2347,-5331,-9908,4973,-753,-9689,103,9772,7267,-8714,7108,-7669,-3777,7193,-5678,9554,-1021,6542,-4854,-5283,-6281,-9510,-7676,-1466,-4009,3160,9124,-3153,9722,-9930,-3969,2315,-102,-1213,-1081,-430,6548,-5937,-5845,5004,8459,615,2407,-6758,-2513,-9730,-378,1657,9774,1222,2925,344,4167,5007,-3438,2738,-4221,-8324,-3022,-9081,-7467,4125,8194,1166,-8711,4672,-5906,1737,-7894,-2695,-4701,8076,-5215,7897,-4336,-6149,-5993,1614,-8395,9113,1064,-7257,-4943,6968,-6691,-5514,-2356,4726,6233,-5652,1097,9241,9749,-8060,1871,-3950,50,6926,-7912,-9811,-9938,-6594,-222,-9457,-3636,4459,-3881,2286,-8571,1751,-4788,8736,3220,-6221,1477,388,9914,-7080,8407,-4933,6960,-1996,6007,-3557,4765,-5945,322,-7552,9909,-5512,-9804,-1693,-7645,-1402,-9383,-6568,7279,-6009,9816,-5775,7172,-9045,-3931,-2238,-8405,2351,1204,-7622,-5258,5132,-6342,4662,-1640,-6927,-5074,1322,-8221,4955,9954,8891,-1389,7866,-7695,-6734,-5553,5715,-3729,-2687,2025,5117,-9657,7304,-9091,-5392,-9806,-4131,1840,-2211,-6486,-4890,-6185,3285,-2461,2440,8765,7142,-7511,9979,6828,7955,-2844,4128,-228,6203,2254,-7601,-8219,8044,-3680,-7625,7361,2190,5838,454,2399,-3393,-3300,-8625,390,-7680,1209,4406,-5640,-4782,5785,-2111,9211,9944,-4444,-6367,1373,-3394,-936,-9268,4340,6799,541,8165,-1055,-794,-539,8612,7306,5026,3001,-5255,1115,-7203,-6249,7975,-3664,-989,9957,1582,6127,4678,165,-8323,-742,-7247,5402,-1500,9482,4649,9566,-9389,-1931,5423,-5521,66,-4787,5973,5827,-4675,-2621,7091,4962,9817,2201,3211,-8,-6277,4477,3808,-4873,9840,1626,4887,5192,-3526,-4061,8472,8884,-5189,4554,2964,-9259,5318,7244,7574,-3105,7955,-6873,-7823,-5542,3661,-6791,-7647,-1824,-7993,26,-8321,539,-701,9280,-5193,2543,-1538,-6394,-7089,589,-7837,2329,859,-3011,4489,1679,-4544,579,2935,-2082,-351,5992,-6884,-4880,9932,9991,-5626,802,-1337,-6215,-9639,-916,3146,-1081,-9648,752,-6025,-1909,-7715,1419,3030,-989,5406,-166,5129,6110,-3855,538,-159,5347,-6333,3842,-8963,-5453,8526,-9444,3295,-6274,-9480,7986,2176,-7689,-627,-6663,-1826,1840,6277,-7520,-7646,-9387,570,-2871,4137,-476,3683,-381,-5722,-4575,3335,-1703,-6045,5883,3754,9684,7619,-1190,-3011,-174,-6778,1670,5358,-9718,1146,-295,-1877,6644,8979,9108,-9585,8854,-3302,-5762,9489,7705,5116,4481,7353,5096,3446,9652,-9417,-8115,1359,-8708,-2342,3654,-5691,2999,-8132,69,6837,4611,-5642,-7719,-824,-6760,-9772,3505,-2901,4960,-172,-3896,4965,-2763,352,4829,710,-3314,5350,-9013,2897,-5989,7612,-2488,-4126,4958,8535,-3405,-9056,-1231,-334,-2355,5542,-9960,2260,8892,4342,5365,-5740,3923,-5531,2830,5975,4034,2313,4412,8396,6592,8727,8258,-560,8734,1301,-9601,9308,-454,5793,-6513,5117,3237,-6082,-9318,-3420,-5613,6458,7268,2197,-5827,7064,2187,-6441,5036,3310,3462,8675,-1276,-922,3601,-1196,5461,-2780,-9277,-2925,2237,-7493,-7151,-7189,7637,5866,-4314,6375,1330,-7749,-7510,-8584,-9920,-7068,-1354,1870,-8891,2574,6281,874,-5141,3689,-564,-3990,-3548,3381,4092,2162,-2959,-9890,4967,-7510,9893,4241,7406,-4983,6898,2682,-9569,7975,2219,1501,-7858,-3625,-1837,-5478,-4420,-8552,2921,2756,1097,-5811,9083,-1502,884,5955,-1475,1498,-4661,4088,681,-5512,1324,6862,-915,9634,3835,297,1846,3273,-6215,-7585,1351,-5514,1258,8566,9027,3606,112,-1237,-3459,-4784,-8315,-887,-6966,-4638,7270,-221,-7474,-60,-3728,955,-9580,1499,-885,8182,-2099,174,7898,-1948,4817,6221,7972,5892,2178,-5371,-652,-7846,-1490,3177,1974,-8271,-1232,-4387,7304,9146,-7359,-968,4388,4824,-9199,-1105,-2523,9319,-8511,-3652,5269,3704,9246,9566,8032,7996,-9460,4568,-482,4008,3838,-9422,8983,-9566,-9527,-4113,5309,384,-6482,2944,9272,4916,-8364,49,8564,4660,-1334,-5088,-5730,-2625,-2418,9782,-7314,809,7638,-9701,-6379,9943,-212,-7282,6741,-7703,5453,4234,-3803,-4681,5452,-4030,-2624,8082,4712,-2745,8520,9151,-6992,7663,8966,-3074,-4266,8348,5482,-7505,1477,9253,1523,-3985,-8451,-5682,9952,-3918,-1992,-4236,242,-2980,6673,-2266,-281,-1586,-1726,6038,-6812,1454,1666,-5523,8741,388,-1646,-732,6922,-7547,-7835,-4484,-3005,7665,-7785,7949,6806,285,5258,3442,780,-105,1996,4168,9412,2889,-6591,5861,657,-7790,-8122,7322,-1506,684,-7808,1268,1200,-8876,2390,-2154,2688,-7868,2133,457,7459,8723,-5277,626,5315,-5149,5162,-3616,1730,7991,-6261,6688,-8514,8951,7899,-2499,-3950,-9461,-5835,7272,-4423,-3886,3858,4207,412,6682,-4564,5386,-3967,-9760,2291,3935,3970,4847,-7333,830,-4806,4854,-1892,1754,-3645,4141,620,-8490,5690,-9201,-5760,-7560,6873,-7577,728,7738,4846,4689,-988,-5521,300,-1076,-437,-1609,-5563,5092,-5897,4866,8311,8380,-7162,6644,-453,1762,-3149,-2581,3278,5373,-4474,525,9702,-6946,-3614,-4165,2282,-9125,-4913,8119,6305,4548,-2263,-6345,4157,4140,-1461,7655,6523,7992,-1089,-9167,2713,3867,2776,2525,-1289,-9942,9442,917,7086,7520,-457,5804,-808,-4424,5802,-3685,5402,6439,5910,9387,-8456,-8768,-7250,-5055,-171,3465,7623,9081,4749,5108,-5316,-5351,-8411,-5755,-3361,4404,9050,4511,4635,-3295,-8399,567,7243,-7724,-2749,3319,-5674,-2281,-1111,-917,6524,4401,612,-8427,381,-2438,7330,-6716,8223,-6668,226,1780,-1477,1506,6953,-2856,1025,-5288,3588,-5717,-3476,4830,-7486,-6267,1418,2577,-8537,-8875,4687,-3229,7170,-2465,4299,7329,-5121,8479,5931,7097,-757,-7694,-6422,745,-1654,-63,9029,-7589,3899,-1093,-2232,-7924,-4589,2903,-1340,2736,4045,-5553,-1712,921,-2682,1520,1951,4722,3286,-9287,-3379,1749,-8724,2551,8301,6130,-4528,3557,-235,-4693,-7738,9197,2591,7299,-3737,783,9221,-3076,-6783,2336,-7170,-8649,9266,4666,3583,-1635,9231,-5442,5694,-9124,8043,-9324,8647,-216,-5572,3028,-320,-9801,750,-647,-4171,7480,-931,8328,7917,181,-4797,1676,7470,7012,5181,-51,-2909,-8281,-980,4092,-947,322,-4646,2699,-9964,-4729,-4688,9503,-4385,855,-8943,-6860,2065,-5977,3074,-7900,4450,-1736,-7216,4781,-7354,-9822,-1527,1013,-8005,412,-3416,3546,2925,-6095,-3810,5411,7232,8828,-9769,4225,-3482,938,-6326,976,8959,8841,306,-622,2593,6128,-2484,-5507,6608,-3000,-8464,-1885,4215,5721,-7615,-6751,-151,825,-5819,4389,4677,-7413,2115,-9229,-7684,1463,-1084,8781,998,-8,-6039,9757,8871,-7907,-2046,-8710,-3064,641,4725,663,4564,3057,2138,9282,-1388,7695,-9922,-9855,-5941,-4465,5377,5393,-4619,-6204,-948,-8551,6711,8967,2114,-5312,-6210,1374,-3633,-7907,-5509,3532,-2488,6090,-66,9401,-5504,-5535,-4421,-7796,2123,1412,2665,9241,-6313,9044,-1174,4138,-2690,-918,1467,-4945,7694,1935,-764,-881,3508,-7176,1218,3485,-3361,5010,-4162,-600,-2614,-2558,-4785,-4423,8625,5468,2436,-3320,6762,-2607,-5762,3823,-6248,-643,7887,-5489,-719,2045,8913,-8959,398,-4059,-9110,-4589,6640,9417,-1006,-7092,6458,-5539,4941,2437,-2889,-4100,-4854,-6930,-5226,7183,-2045,-3585,-7346,6950,7554,-8739,-8600,-9109,-558,-5284,-415,-9482,-9525,-5124,8327,-8728,-7580,-9806,3420,-3383,-5359,-4015,-3920,-1767,5219,-4870,4734,2504,-3051,8791,6403,925,1372,-4719,-5785,-7757,-2597,1694,-769,1070,-7500,-9363,-3896,-4505,477,1269,6938,-5118,-7664,6818,8126,4490,2404,-993,-745,-7465,-4189,-7124,9785,-9740,7178,2503,-9011,2546,7811,1951,-8394,-8137,-573,6738,4712,-2744,-7028,5567,3730,4822,272,-74,-5239,251,-4216,-351,4701,5145,-7146,-1671,-3506,9048,-9025,9067,-6752,9496,6429,-563,-8098,3078,-3944,6885,4808,-9709,2919,7686,-4206,-5629,-8172,-9659,6872,-59,6610,-5349,7410,7988,-8287,4581,-5970,-8994,7690,-4315,9122,9610,7679,-8075,-279,7038,-5809,4160,4616,9851,4287,3203,-1381,5505,-3195,2526,7949,-4904,5273,8306,-3063,-8255,5179,-3494,8194,5546,-6901,6474,-7234,-2964,8191,7948,6750,2998,-4337,9376,9767,-6450,-4236,5167,8628,5941,-6513,-4403,-1299,814,-1751,7464,-8246,-4457,3833,-9373,9183,-4663,2663,-8050,-1190,3852,1190,-6740,4634,8694,6404,-6745,-5675,-3775,8710,-4532,-497,3561,-9794,-1326,-4007,-2946,-7481,7160,1339,-1554,9426,-4674,-5676,-8048,1013,5503,3140,9026,-9277,-6142,1553,-5387,1597,-9504,-4711,-3247,3594,-1651,-6534,-7884,8325,887,3129,5705,-4059,4140,-5680,5224,9190,7524,-3737,3369,8925,-6405,-3543,-2112,4572,-4877,9619,6147,-7442,-1180,-1298,-4194,8260,-8449,9861,8266,-441,2129,-3173,9102,-7862,3085,9189,4,4502,3798,2428,6583,6574,2814,-5331,8189,2968,-211,770,-2877,-3075,-5158,448,7475,-1014,5857,-1227,-5285,6012,-1442,9992,8512,-6169,8378,-9663,-2758,3875,-2214,-3451,1496,427,580,5157,-1074,-5730,-5160,-4237,-7316,1923,-3710,9405,-135,325,-5859,6724,3975,-997,3539,-4296,1577,-1742,8912,8556,-5079,-8987,56,-6303,-1148,-5016,-7649,-689,-1244,-1411,-9449,-7646,-5799,-3284,7582,1588,-4076,-9869,7124,539,3519,6521,-8188,9993,-371,-1312,2906,8713,8956,22,-769,-7464,-9669,9661,-2045,-5754,2807,5177,8067,-1138,-3541,148,-2233,890,2520,2626,-2882,9270,-4186,887,3701,2028,-9724,4660,1217,5249,-8096,-8815,8424,-468,4092,-1661,-7715,-8917,-3381,7822,8518,-5262,2074,-9778,7001,-8498,-1929,1070,3532,7585,8368,-7477,9148,8963,-7675,-2566,-6335,7493,-3457,-4917,-4846,-2128,3487,-7929,7438,-1733,1247,9929,6970,-6784,713,1052,-6451,-5388,8821,10,-2540,3175,2606,-9127,-663,6223,8383,-9987,-5677,9713,8368,-8246,291,9145,4201,4750,8291,6813,1433,-2194,7613,-2445,8105,1003,-8319,-3203,6997,-9150,2909,-5126,2752,732,-3457,7288,-193,-5709,-5660,1190,5973,-1276,-8029,-2726,2028,7222,984,-3064,8714,2753,-294,-7972,-4700,3821,1183,4836,1497,-9797,875,-1346,4768,4768,9091,8509,6013,2275,1693,-8064,-4516,-8288,-2188,6123,-6788,-480,3671,506,3,-7835,7631,-2630,246,5304,-2511,-6110,-1449,-5600,9097,-7294,-9191,-2332,-2531,-5646,668,4652,-526,-1688,-5349,-4005,1499,2703,8563,-48,-242,4878,-2879,6690,-706,-5628,6094,6853,-3290,-4067,4426,1867,5297,-4109,4085,7282,-3527,6402,6170,1912,-5171,5842,4751,-3345,-9247,450,-9689,-6708,-3161,1770,2482,3702,5697,-1619,-8947,6571,3129,6747,-7970,-662,-3954,4181,8477,-9039,-7578,-1315,-4103,3770,-3160,-3214,6035,5920,-6395,-5336,-6415,-2482,6515,-7196,-3181,-7698,6539,-7857,3541,-4692,-2383,-599,-7005,-5185,5139,3294,6094,4572,-1436,360,-3560,4199,-7422,7993,-4701,6839,7063,-2425,-3558,9801,-328,-2162,9100,9784,-1823,1729,2118,5129,4902,-6834,5780,-1179,-9467,-8399,-7999,3009,593,-1288,1106,-4250,-8392,7638,-4892,-8696,9407,-6712,-8215,-9714,4189,3608,8357,2427,7675,-6674,-7200,6292,506,8528,-6307,-4743,2087,9764,8714,-2464,2469,-4552,1879,-5897,7570,-3226,-5921,2063,-3337,-7588,5546,-4102,2918,1058,2644,-553,3092,-3093,2477,6369,-3270,-8218,-3862,-7689,-7189,3267,-9462,7714,556,-1118,4200,4451,6008,6420,-6187,-651,6832,-6364,-649,7627,7425,-2653,-1246,3992,-541,-5881,-4797,-7472,8443,8172,-6088,-5361,-5320,-4420,1545,-3574,-5770,-8125,-8170,-9062,-1120,2443,9677,-2032,394,2445,491,-7322,-5576,8307,-3673,5318,-8883,-4484,9989,526,3664,-5666,1358,757,-7037,5815,-9222,2450,-6278,2563,2528,5115,2744,7904,7032,4110,3373,79,4299,-4600,1906,-8246,-3712,-4239,-8536,-9023,978,3044,6418,-9455,-1943,-1713,8266,9778,7473,9426,8213,2675,5242,-5632,9890,179,-577,-6246,-3812,7364,7441,-8248,-9678,6435,-3145,-2836,3044,621,7904,-2475,8077,2588,3000,6132,1764,8906,-6778,1343,-7684,-5801,8944,7104,531,-6113,-8379,-1711,9852,453,-7679,-998,3151,5017,8762,-73,8866,-7469,-3984,8121,1798,6551,9228,-9482,-7548,-3850,-2909,6954,-2727,2064,-2747,-3599,-9928,3469,-7762,6917,-3456,2781,-5220,-7860,1870,2583,3016,7792,-3368,-9691,2450,-5581,6756,-1677,540,-6501,-1357,6579,3379,-8045,-3672,-4104,8644,-5152,-4036,-152,-6125,2356,-6026,8580,-9169,9440,2062,-2130,-1907,-4696,6685,8025,-4554,-9210,-3219,-6971,-58,-844,-3142,-7723,-3112,-2338,-8537,-4331,2040,-1959,-20,-5335,-6875,4064,-5378,7468,883,6106,-6446,-308,4270,-3831,-8442,4082,-7899,2027,4814,2926,-6461,155,-6679,-7057,-6644,1100,-4418,6070,-7331,968,7242,-9377,-7439,9872,2607,4955,-3817,4298,8589,1659,-6293,-7038,9118,-3453,513,9910,-2230,-8348,-8029,-5259,7165,7522,-9089,-3559,-4738,6766,-4754,5940,4118,-1470,3486,-9001,-3237,5170,581,6958,-2942,6059,-6459,7547,-7643,5061,1838,-1165,2340,-6502,-3851,1133,7466,-2289,7955,-6442,-614,-5571,-9958,-3712,5129,-8794,8828,5281,-2485,-5935,-3109,7215,-3664,4157,8431,-7883,-1865,1774,2172,-2660,5288,917,1638,-1699,2467,5896,-3493,9834,9119,8995,8242,4461,8938,-6944,6388,-4707,-6231,6810,9514,-4024,3528,2359,-3425,-4543,-1883,730,-7366,7219,8981,2232,6032,-3392,-6030,3512,1445,3556,6786,2763,8582,2203,-922,-7480,-6162,-3694,2847,-1812,-3720,-2860,-2855,6292,8420,-8212,-5500,5714,2817,7987,7548,647,-2982,5801,-4402,-4639,-8861,-5758,-1539,2225,-4169,-6293,6421,-8004,5699,5604,-8469,-6594,3332,9293,5307,7934,-6974,-7539,1937,-4260,-3039,-6580,-8500,-4685,-6120,4997,-2912,5989,-3540,-4620,5884,-1487,-6442,-6683,-755,3699,1840,-2421,-9897,7107,-4442,3107,-9462,4913,909,-4058,-1006,-4228,-806,3846,-7387,284,4954,-5715,-2183,-7556,-3108,4697,7040,-2251,6954,-4107,-4260,-4117,-6324,-4720,3733,-9712,4194,-390,926,370,-6598,3194,4070,-2464,-3702,-9113,163,2752,-9263,1166,-9974,6775,-9924,9002,5202,-2228,8056,-3220,5263,1850,2659,-3613,4668,699,8360,-489,-6253,-7531,7544,-2434,-3406,-9690,967,700,-6744,2152,5170,-317,-2889,9674,7870,-1724,7883,8726,1611,-2548,-1550,-949,6888,6898,-7617,-1459,4353,-3425,3612,9275,-8063,8437,7289,-8446,-9172,7585,7127,6732,-2835,2893,-2058,7059,7939,6456,-8460,-4807,7757,7172,3952,-9286,-230,3397,-3705,-5430,8078,-5369,7215,8669,-3320,9025,-6263,-9772,-9659,1053,6467,8452,5808,-7921,-4057,9191,-76,8383,6453,-7162,1617,2442,7259,-7176,4905,2476,-5397,2373,140,-2693,8083,2632,294,-2112,-5913,7785,-2148,6785,9186,110,2563,-2960,9852,-7000,9712,9492,1915,-7710,1052,6326,-3815,7775,-1618,7476,9041,-6606,891,5981,-1912,1083,-8004,-8964,-5696,5638,2777,5881,-1741,3925,5882,7668,-2729,-5586,434,-461,4639,4081,5580,-5772,5517,-276,1916,3570,-1872,597,5111,-4598,9025,4978,8941,6723,9384,396,8676,4317,-8660,9040,-924,6238,-4214,1332,8989,7950,2209,4345,2298,9452,-5026,962,-9446,-5728,-2152,2684,-2426,-4206,5108,3925,468,-8751,-3009,806,-6468,5864,-8391,-7191,-1623,-7745,1957,4680,4628,6905,-1262,3506,6619,-6105,7256,-3733,-5465,621,9477,9572,8653,-491,-1144,-2348,-5789,34,-5203,-7926,-4337,-9960,7971,1965,-63,-1938,1984,1097,7062,2284,8852,621,-8993,3475,-5223,-9936,-4687,-7893,-4778,932,689,-1442,-733,2626,1895,-2277,-6702,-7435,136,-2550,-7506,-7044,-2639,4225,8113,-3987,-7,2406,5591,-3050,8935,4494,9293,-5456,4882,-3365,2353,-3614,-8300,7050,-1681,-1711,-5426,1981,9858,3176,-9421,9543,6131,3717,-5785,-7946,9890,4228,8361,-8034,-3235,-8544,8659,-8458,5336,2585,-6223,8370,451,680,-769,7625,-8359,-9949,-7944,5006,-3040,9529,2596,9661,7502,-6538,7828,3430,-5431,-4645,-8954,7737,-8444,-5791,6463,2015,1278,-6470,9467,-8334,1420,-9189,-1216,-2664,6344,-3533,3865,565,606,-7221,-6667,-9248,-7212,1278,-9450,6173,1565,2186,-5387,1524,-8638,754,-39,6253,-6635,-8637,-9905,-2424,6123,-4182,9233,4894,8566,-3050,-5892,6560,6472,1128,-1199,3322,-2823,-3953,9139,1320,384,18,2786,-4831,-2699,7403,-6244,6281,-9533,6700,-1507,-5283,6168,9944,-4378,7399,763,-4195,3806,4690,5013,-4659,-4220,-44,-8202,-7865,-7847,-7774,-4703,-473,9521,5318,-5301,-2939,9037,-9815,-1652,-7457,5080,-3769,6944,-450,-6204,1688,-6620,-3879,-5161,-5361,-5024,-7771,-1224,5074,4260,-1357,-3240,4830,5902,-771,-3993,2051,-1164,-7012,3862,-8814,8544,-1435,-3625,5910,-6372,-850,1984,7619,-796,-598,-9744,-8452,-3263,53,-1467,7249,3598,9216,5318,5168,-5625,810,2941,-37,4529,5755,-248,1388,1961,7854,-1481,-1865,-6781,-411,1962,-2890,6937,-4922,2528,4961,-6092,-8952,1255,2047,-3356,-3799,3172,9443,-5478,-2213,-3225,5467,-1159,301,8524,5995,-3162,-6442,8951,-7000,869,-7906,604,-1036,-5540,-4136,5906,-6287,8011,-5244,5653,2488,-3684,9211,-7309,-6656,1130,-4980,4418,-7703,-2858,-4362,6636,2205,-6804,7749,-7154,-1958,-1198,3572,-546,-9926,3804,7026,-8175,7741,-8627,7409,1766,2168,-5943,5856,115,3324,-3078,52,-8631,3072,-7118,9159,246,8192,-7855,5299,6171,-197,-1568,-1125,-6762,3387,-5417,8373,-1852,4365,-9964,8329,-607,4339,9019,-6911,-9566,5723,7509,-2154,2963,-9271,-6014,-8485,-6373,-7724,705,-7112,3957,9930,-925,-3987,-8671,-1174,-4336,3038,-2700,-871,-9500,-7696,8623,9234,-3437,-8359,5733,4992,-3759,1311,7161,-685,3667,-853,-5497,8530,-1513,-8500,1766,1316,-8266,8593,864,2460,8667,-1218,-9402,-4978,-2120,541,-9141,4676,-4683,-8325,2953,6336,105,8464,4384,-2498,-3674,-6602,-564,9157,-1688,-5608,-5351,1770,2809,-8017,-2033,-2857,1644,-540,-4993,-5508,-180,4922,-6868,2535,-3245,-6860,-3552,-5100,-6040,-2036,3465,1191,-6064,-9965,5958,3615,-4651,105,9107,-4936,-7755,-6176,7705,-2059,-2007,4701,-2814,8919,-7022,-8227,-4199,807,-4779,-5906,-2638,-2356,8323,-1353,-9994,2720,4403,-1247,-1112,-4741,-7172,-8529,6407,8747,-3279,-5336,-8414,9156,6439,-6728,-9912,3964,-2487,6333,-2510,9232,6119,4474,5763,5147,-9073,-7451,-787,-7403,7036,-4796,-7436,2097,896,7054,-2228,-5440,7785,8180,-2300,-6962,8144,-5199,-6386,7181,-4596,-2421,5932,-9352,-9050,4181,-1639,-7707,-1147,7165,2113,5981,-4368,-1701,9495,-1573,3771,3135,4110,-8663,-8426,1595,3258,-5601,989,-4791,8666,-8028,-8680,-4178,7405,-1073,-1169,-435,652,-7841,-3842,-9172,879,648,-8462,5197,-6904,4918,-6260,9898,2573,8556,-7183,1992,7750,2820,-4761,-5480,2695,-2300,585,6266,6318,-2737,1173,-8468,-3719,812,-5768,1437,-9182,3556,213,5603,-4124,-1616,2324,129,-7847,6295,-877,-982,5506,-9417,-5364,640,5884,-827,3113,1108,-5045,-7440,7873,4655,8684,6528,1625,3839,794,5426,7201,9900,6822,-6533,-632,5235,2452,2787,2521,-6196,5383,-6784,-8090,-3563,-8212,-7570,9139,4326,9857,5491,8894,-6454,3117,-2127,-5943,-3001,8507,9537,-8089,871,-7518,-9708,-2836,-466,-9698,-5558,8995,-5166,-3470,-6761,7822,5408,2847,-2601,3089,5144,-2987,-2434,-1303,7128,-2458,-8050,-762,7894,-722,8179,-7113,7418,8122,9621,5545,2531,-806,-8145,-4445,-4190,-4619,2605,3850,-8365,1528,-5691,8585,5742,7660,6818,-6674,-4947,-2805,-8862,5516,-5374,1914,7276,934,-412,-1008,-1056,-3559,4487,697,-8875,-6087,9923,-9723,1398,-7646,-5825,-7904,-2148,7308,9346,8871,8761,1035,952,4634,9161,-2844,-8455,-7300,-1046,7172,-910,2392,-6988,9897,1531,-3824,9045,7981,8855,137,-6673,-6287,-881,4531,2108,5199,-1158,-4506,-5653,-7941,-4259,1698,7385,-658,5768,-6419,8831,-5415,1660,-8853,7895,-3753,-6341,-6982,5974,-7427,5176,5834,9526,-6563,-581,-4748,-5564,-8771,-8911,5055,6412,-97,5030,7207,3930,-2799,-8205,-2824,6486,-7020,-7188,9866,495,9299,-8500,-9073,-8193,4937,-2725,1367,1119,-2450,6880,7893,8524,-7838,9581,-9715,-7200,-5312,-147,-5232,-5679,-4808,-3028,3649,-4569,1940,4279,-8033,-7665,-8708,4234,-9961,-6509,-140,-2548,9287,1225,7464,1173,-5774,-4557,-9798,7287,-7815,-7875,3004,-8976,6763,-7614,-6893,-2077,-7096,-5853,-6008,2298,-7194,9274,3634,4513,8343,5525,-3341,-7341,-9517,-7286,-3456,4695,-9014,871,9590,3406,-2848,2498,7008,-6826,-3098,2260,-8498,5201,7739,-6055,564,8215,-3753,7548,-844,4212,7207,-1334,-9474,-9941,8050,1694,7825,5344,-6203,3377,-6910,8683,7513,9520,635,7726,8260,1757,9195,-836,-2310,9718,-180,1757,-9291,2876,5649,-9896,6877,-7477,5187,5285,5396,2691,-1822,-9089,1071,-6557,-7990,-4017,5144,99,2725,-2562,4000,8716,7494,-9096,-6399,-6523,-2143,-9542,-5326,1210,-4229,-3022,4089,-7653,-3391,1242,2357,6252,-7011,7114,9473,-8688,-6368,5126,811,-177,-1977,9678,-338,5528,143,-8089,7262,-7027,-1602,-9704,-128,4545,6490,-689,2491,2572,-2658,-6601,-4758,-89,-4426,-3466,3695,4243,3306,4613,3835,-677,3314,8958,8325,-2552,4166,-226,5801,1437,8341,-2291,5896,-8945,-386,-1882,-8377,-291,-2088,4513,2001,424,-3559,-6399,-4027,-5233,3543,-9023,9048,-3119,-4721,9829,6467,-4661,-2862,-1766,-1423,-6844,-7879,7777,4373,6820,-2470,-299,-7419,6795,4433,7712,-4058,-7995,4791,-2556,2165,7628,4150,-9716,-5031,-7707,-268,-3039,8624,-2099,-8288,-9029,4959,-9395,-6083,-3638,-5255,-1389,-5862,6084,-8395,3018,-1099,1308,-7600,-2840,9511,7467,2564,8561,-5554,-1401,-587,-2547,-5631,4732,6678,3231,-8714,5460,8513,-1890,-9683,-2478,8068,-965,-6050,2742,9835,8563,-9068,8137,5103,-3301,-7086,-656,3547,4842,-1203,-9357,-1052,-3678,805,9372,7424,7005,-9512,-7609,2505,8538,-8453,-7059,-8858,-7983,7370,-3592,-3955,-7402,7022,-553,1946,9432,-4549,3059,-9117,-8454,5844,3974,2575,6141,-1025,430,5881,-3311,1022,5579,9899,150,-1803,9463,3816,-490,5906,3027,-7656,-4927,9072,6179,-4627,-9341,6321,-79,-6320,-1369,-6197,8468,311,3121,3758,7964,-6024,-4430,-6256,9747,-1186,-7219,-6393,4915,-1284,9804,-3598,-3521,-7581,6818,8450,9891,-9233,8152,-2952,8878,9368,9871,7764,9529,3733,-8670,-2149,5253,-5061,-6568,-6992,-4315,7593,1151,3877,2066,1414,9920,4647,-8871,-3838,-4932,9971,-522,-8500,-9673,5070,-3918,-299,-9400,-3453,295,3226,-1081,-4307,-9560,8927,1985,955,-6244,-8252,-1551,-2351,2334,6321,8781,-2498,-4580,-9009,-2862,-9772,-4441,-433,3164,6600,9939,-5943,-4268,5843,-2941,5744,-7800,-2741,4319,-4436,-8755,-8964,-9177,4192,-2800,-8879,-8200,-3586,-4345,-3245,9398,411,-1991,-9015,7408,-8299,1364,3354,-4819,-1051,2248,798,7866,-9894,-1504,9183,1671,-9351,9180,-9014,2399,7281,-6897,-587,-3934,-256,3914,-437,564,-7935,-3076,5652,-8680,4182,7590,-5343,-5366,1069,7181,8528,2916,6365,777,6282,3331,-5458,-16,-8750,-4039,-7268,-4833,1083,-427,-2895,2953,45,5989,4244,-2529,-2732,-6142,6146,-8509,9723,-9788,-8187,9200,-5436,-572,5337,-3020,-4607,5022,-854,-2203,9307,9281,8597,8277,108,9379,-9387,-8687,-1986,8758,9688,-2147,-1315,-9827,-4396,-9198,453,2850,6398,-8167,-2005,-5656,-8475,4059,-5875,4198,-9828,3897,1414,7521,5457,943,-7408,-5803,4378,5250,2115,8996,9602,7718,-4056,5445,-2677,-6583,2600,-5750,-3964,-5065,-4653,-5740,556,-7792,-6870,9086,7988,-6647,-6202,-6827,4130,-5181,5064,5987,-656,5030,484,-430,5764,3133,-8407,5220,-5417,4769,8954,8666,7660,5117,-7884,-1743,-9973,-4833,-4652,-5330,-3675,-338,2723,2089,-4544,6774,2703,9312,1657,4072,3061,-278,1429,-6353,-5289,8438,-3549,-6936,-5641,-4623,-6484,-7281,-7060,3315,9154,-1354,7071,-7651,-3126,-8841,1543,8453,5661,-7783,-414,8075,9300,5643,-2573,1966,5855,4694,3528,-9102,4951,4648,1412,-3009,9818,806,-5392,-7878,-2127,3589,-1338,-3532,5852,1176,4162,2899,-8349,3019,25,-2449,592,7201,-999,-4309,-5888,-7755,-4107,-3974,696,-9701,-4378,-852,-805,3725,6199,-9422,-4194,-1119,-4515,-4680,8789,4867,1784,9086,7004,-7557,-2232,1885,2929,-8781,1224,-7994,-7155,-1288,9450,-9010,7911,4994,5175,-8052,97,7630,-6990,-535,-9986,-6211,6983,-199,8215,-3016,-4694,-1961,1408,-9560,-7522,8378,-6808,-625,9289,7013,-3517,6838,-9641,-4235,-8041,3196,-3261,-351,5982,70,-6668,-5458,-863,8966,-5665,-517,6317,-6408,-6074,-2032,9881,-6150,4096,3100,-8657,-3090,-9373,-1694,-9562,-8584,1028,-7435,-1662,300,4964,-3782,-9574,2246,-4769,653,909,4576,6907,-4780,5968,289,-7036,3194,9859,7944,-2344,8118,-2884,-9151,8935,-6597,6340,-416,3573,1547,8667,6489,9368,-3088,952,3132,-8697,5882,-24,3266,7845,-3012,-876,-1232,-1143,6338,4753,-6113,298,-6071,3578,6884,-3773,329,-403,-818,2354,5747,5089,6619,5280,4147,8908,-5532,3761,4980,1285,-7893,-2033,-782,3742,6942,-5546,-9794,3674,-6345,419,-9396,9354,1647,5199,-9076,-6208,-5304,-264,-6967,-9371,4106,960,-452,-204,-7900,-9647,-6187,7656,-7713,7586,385,-5346,-6145,-4462,-5072,1171,9762,-3791,-6974,1837,-1643,3027,-5863,-9460,4052,8047,-5584,-3983,4909,-6768,-1923,7733,7090,-7533,3952,-5102,8845,9710,7808,334,9513,-1579,7503,2269,-1599,373,-7573,4848,-9914,1218,9270,-3939,843,3186,-7945,7482,681,-4830,-60,9086,-7279,1380,3548,9602,-1203,6134,5201,-5872,-6692,-5657,-531,-1470,-7742,-4043,5737,-8380,-7035,-6323,-1398,2260,6357,-2,9193,-172,5469,3304,5867,4086,2705,-2802,-9953,1020,7574,-2834,-1357,-955,9503,6318,-3689,-774,1385,4282,6574,2813,-5642,6428,7261,-9710,1435,-9261,3239,-4837,-7576,9821,1742,-9196,-1010,-2201,-6438,-9753,4342,-8183,9646,1687,1498,7922,4914,280,2257,-1486,6118,-6142,-6000,-4682,2785,-7588,8782,8448,393,2042,3431,6451,498,922,-8611,-8468,3026,-1813,-726,5242,6613,-2219,6623,5178,-8097,-5545,-2905,-7684,1979,-7692,-7532,1942,3704,-5471,-111,3293,-7086,7061,-5006,-3853,3471,-5510,-6599,-8393,-776,9599,1896,1315,4476,7483,8438,-5500,5369,-6061,8964,-955,6794,-8997,-8540,-5475,-5005,-5586,-381,5221,-6253,8205,-4889,-4622,4684,-1444,6266,6824,8806,1451,-9949,4003,1397,-9058,4371,-2663,-2967,-2154,-4378,-7900,-351,4342,3418,377,-1359,-6126,5024,-9704,4272,2639,6507,-3564,3971,9631,-5921,8317,4111,8733,8706,1543,-2608,-367,-4116,-1746,-234,-5491,6325,-1692,-3032,1888,7137,-745,4241,3178,-2658,-9595,-4130,-9433,-9600,-6367,-301,6320,6584,-4931,-5255,-4429,-9497,-2311,-7676,-8521,-2447,1566,7669,7082,-3314,2633,-6968,-5413,8516,-8631,-1904,8838,6332,-6395,-1459,-7428,-8628,-8742,-3369,-3525,5278,-37,6555,-7417,-6561,-230,-6213,-7050,-5355,3329,-2626,8337,-5593,4171,9348,-7477,473,9948,7962,-3269,-8949,-6637,6285,144,2829,-6695,6881,637,-8832,-5885,-2360,8874,-5379,-5642,9244,-6064,9769,2106,-600,-5022,3709,1146,1088,1780,5672,6551,5404,-3445,348,-1323,-109,-8304,-7011,-7634,-6109,-6517,-1577,-8765,6026,5674,4113,3703,-8250,-6003,-8144,9690,3511,-6528,-8036,-3936,-2827,4625,-5105,-5190,-9622,8872,-7161,4801,-4666,-277,2733,-2867,3498,-8423,-5155,-3329,5353,5263,865,895,-6891,7443,-8199,-1598,1640,-571,-6339,-2967,6095,-8576,-7864,500,-6680,8368,-7169,9077,1534,2996,5278,8923,-4715,-2011,4506,1596,-4488,-2125,-5287,8034,-1908,522,-8329,-7410,1330,7433,7944,9156,-2737,5154,-227,9968,6489,-8033,-2895,9683,-5838,-3208,9506,4242,-3488,8779,1546,7865,1313,-1371,3194,-2042,5383,7155,-8891,-577,7042,-3348,3008,1916,8690,-2646,-4422,-1553,8095,5935,2752,-8129,-1492,-6322,-6699,867,-2507,-2115,1675,1444,-9584,-6277,7137,6819,4319,-3802,3344,5791,-9916,-5197,7179,7894,695,7470,1053,3185,-2977,993,-4460,5364,5501,-9626,4786,1714,-4111,5942,-9259,-6009,-9267,-7398,-3395,-3012,-5476,-6547,-2465,-9167,1844,-4196,-8753,-8723,245,2267,7024,-7576,2235,-2893,-2725,-145,-5190,-3657,4607,3494,2687,-485,-9809,9068,7086,-7426,2296,-7634,-1792,-1764,9501,-5082,7170,-9040,5812,-1635,5845,9762,7305,6542,9465,8215,3175,-3264,-9360,8917,2975,7047,3262,-2604,5706,9506,-8163,-8071,4923,9201,-765,5834,9421,7073,4547,-3493,1142,6152,-1322,-8717,7498,8711,9544,-6077,4628,5153,-4675,9653,9888,388,-5546,-1767,-9327,-8039,-2298,6035,-8217,-5281,9145,9907,-6897,7076,5448,7848,1237,-4283,-8198,5956,9856,4122,815,4714,-6558,8726,-6413,2228,6062,8909,7565,-1390,-408,-5191,-4299,-8549,5022,1918,-6310,2831,3973,-2575,65,-8975,7428,-7144,-67,-3533,-6790,821,-6547,-8536,9637,-7604,3095,-8244,2641,7490,3404,8335,2233,-5533,265,-4123,3010,-8234,1822,898,7623,-3599,-2286,-9064,-9198,5170,-6014,4981,6786,-6680,2338,6844,471,-9761,-1224,3055,-9828,7753,9836,7776,2662,4479,-8616,1376,2626,-7134,8005,-357,-5370,-8429,1599,-7664,-9856,-5732,8396,9020,-7028,-6569,-5969,5544,-1810,-9513,-4387,-5074,-4748,-9414,3132,-853,-4325,-2181,4568,1487,4544,-2680,1921,-5971,-8118,-7841,7624,4606,-276,8147,-7799,1524,-6697,3150,9748,-8473,-881,-1824,-7667,4555,3607,7712,-5138,-2547,5800,-5719,-6741,-6711,984,4526,-3764,9808,-7155,8767,-374,-2460,-6021,-9831,5239,-3853,3644,-9676,296,-1896,1991,-8359,1086,-4150,-6375,7285,3794,-4559,-7544,735,-3867,-6475,-3755,-7411,-2315,1883,6514,-2592,7623,-7248,5709,-8117,-2045,525,4545,-3084,8134,-6357,-9723,6580,9064,-9289,-2536,8177,3220,-1514,3312,9933,-4446,-9636,2072,5138,-4181,7319,5306,-4404,3021,-5527,-5903,680,4614,4202,1440,4628,1279,-6587,-673,-8863,8322,-1838,5772,-2286,-422,-8592,-8077,-1798,389,-5114,5411,4703,9013,2915,-4021,6028,-5081,-7212,9645,6671,-1897,8974,7332,-1804,5948,-4028,-2958,6776,4370,3368,7898,-4160,-2214,1657,7930,7757,6386,6946,-2365,-9416,2115,-1572,-1166,7847,-5584,-6038,-9162,9219,-7122,-773,-7301,2604,-3389,9350,-9680,6157,-9478,-5958,-1764,6933,5560,-2837,-3580,3866,9155,-5561,-9819,-9624,2975,-7654,-1859,3319,9993,4452,511,8027,-8275,-5932,-1289,3205,3920,3924,-1721,-2576,8005,7601,7572,6910,178,-6805,-7870,3826,9765,-8303,-4010,-6643,-9962,5292,4302,-4725,8983,-8353,6249,163,8234,5297,2261,8508,6985,176,8688,6752,6623,-4691,2444,6013,-7784,8825,-2673,8615,3584,-8137,4534,2265,5130,9426,-2613,6468,-9549,7446,6527,-2970,-6088,9475,-5885,584,-784,-9338,-2830,-5168,-4790,8808,9400,6435,478,-7801,5179,9831,-1474,9739,1937,-6791,8811,4269,-738,7006,-2235,6647,-2737,7937,-3158,-3593,-4,-3814,-8131,-2513,1831,-6439,6373,9842,5643,5850,-1336,1955,-6578,771,3738,6314,-3922,-5954,945,-3229,9795,-7414,5839,-714,913,-7877,-6217,6848,-9159,-1723,3505,-6532,9770,1644,-9028,3646,-4410,2875,291,-3106,4213,1112,5940,-6782,-3083,-4318,-3280,-5042,-225,-2458,8712,-2262,-5827,783,-6383,-3497,8063,-1493,8449,-6909,4840,4236,-4576,-8580,-1221,-645,8912,-5219,9538,-1090,2994,-1514,-2446,8292,4413,310,-9273,-2212,-6030,-1821,1252,-1287,2703,-1226,-6422,6001,-1667,7337,-5557,-2358,-8444,-6151,-6941,2688,4706,1766,-3459,-8208,9797,1845,-3896,6285,-557,-448,-6671,-8641,-1570,-2559,8957,-347,-6542,-6810,9038,8480,-1530,-3834,-6363,7776,729,854,7874,-3675,4688,-1181,-180,-3618,1929,-7547,1747,-4676,2889,-7270,1523,2801,-692,2135,9698,-7019,-6801,-4444,8981,-7141,5875,-2230,3979,-5167,-5495,8433,4502,5855,7631,2972,-738,3447,-9767,5906,5484,6148,-9458,-7772,2463,2510,6613,9477,129,-904,-9141,5279,2536,1493,1979,9743,9800,2219,-4301,-6779,-1544,-1248,-1480,2062,7320,-2444,-8703,6624,-2931,3354,8259,-7278,8705,6740,5151,-6763,-8960,-3934,-197,-5723,4534,-8412,3935,-7203,7313,1176,6345,-1965,1272,3930,267,-1686,-9353,9130,-1178,-4946,-9657,6981,2694,-7559,-9218,6778,8871,678,3486,-2838,-1530,-5774,-175,5632,-6401,-4145,-5251,7394,7261,5118,8284,3888,-2290,-4091,-3159,-3931,-3291,-7922,-7621,-4857,-3819,8867,-7906,8302,7579,-607,-8861,-66,-4433,4360,-5240,-672,4631,-1836,-597,7881,-6260,-7767,-1473,190,-568,-5320,-6234,7661,-540,9998,3906,9201,4620,-9182,3925,4677,2324,7156,5943,-4403,-1650,-9,-3886,1334,6133,6648,-3522,-3132,-2240,-4426,8973,841,-8267,8228,9509,5683,8541,7946,305,8620,-2714,2526,3366,8750,2710,3273,656,-4494,1978,-5210,-1509,-2886,8181,185,-3479,7631,-6251,7343,7699,5471,1495,-3901,8881,-5301,-9085,7386,-6732,-3495,9104,-7204,1418,3651,-832,7998,5881,5908,-5899,-5894,1480,5786,-5580,8219,-6625,-8242,-4268,3231,-3973,-8726,-5903,-7484,9475,7424,-1794,3453,3992,-4577,-2836,-6465,9390,3297,-7693,3980,7506,-4902,5464,-8119,2422,8817,4695,7468,-3860,-2541,-1056,-3286,-7985,3346,1634,1935,-8496,7612,4846,6406,-8795,-5190,4336,-7153,-5173,-2067,-2901,7328,9025,8701,-8170,-678,6736,7211,-5093,-4889,5649,-3652,-3348,4528,-4102,-3739,1907,-3861,5414,-9464,-9661,6417,9108,9309,9171,4558,-1736,-7236,4067,97,6163,-3197,3539,-3649,-3529,-783,-5033,8608,-251,4182,4850,8344,4621,7814,-1281,-7912,-3956,-8045,1757,-9090,-4259,-1376,8259,4324,-2819,1347,-9346,1000,8375,4840,3440,-4394,7968,2776,-6526,8120,-5069,-202,-9994,6899,-4931,3189,1689,-7647,6359,-9646,-7362,1530,3630,7701,4380,393,9142,2283,3561,752,1219,-5016,1865,-1031,2822,736,3215,-4901,-2339,-620,-4190,7047,1442,4254,-2086,-1315,2960,-9445,5285,2563,1664,-4593,1189,-7875,-6327,-1954,404,-5758,-2863,-4764,9092,5319,7899,-692,1371,9932,-5917,4094,747,-5630,-7752,-5211,4521,-6306,-9020,3907,-3893,-824,6704,9488,9943,-8976,-8816,1498,-5702,6408,8203,-7950,-3716,2688,-394,4487,1782,5371,-3993,9106,-6051,4743,-6365,-5614,4854,7674,-413,-8675,-3991,8205,523,-7736,-935,6458,-6099,181,5904,-9833,-9966,5308,-1580,-7362,-2578,1625,8023,-1872,4592,7169,759,-1770,7567,8348,2293,-8417,-5194,3846,-5330,-2645,-1037,-3806,5249,9062,-5417,-4984,251,9380,7718,1705,-2055,429,-415,640,-9220,-3090,745,-9688,9808,602,-5248,-6626,-312,1954,5270,8456,3739,4759,5888,7287,-9800,9041,6876,9273,-6505,-1581,2887,4334,7758,-6599,-4960,2423,427,-124,897,9393,-520,6595,2154,2000,-7866,8014,-4526,5980,-6377,8940,9246,2611,-1829,3070,3260,8756,6014,203,-6137,-382,-4913,8850,8831,9293,-1862,8314,2061,-9497,7436,-1333,2455,2258,2737,42,-8019,7389,9407,1779,5933,3615,6425,-9600,3916,-5914,1162,-6994,-3933,-2432,-5382,-1375,-4681,6003,2052,-7687,-8761,6844,674,9680,-9164,-5042,3288,-3335,-5725,-3982,2499,-8567,-7191,-3732,849,-4157,9369,-103,-494,893,-623,8715,-4987,2292,4832,3466,-8654,-2558,-2972,-548,7847,2652,-4499,-5103,-7333,6672,3338,-6515,3658,-5182,-2866,234,-2649,-1100,4572,9896,91,-950,3655,-3036,5281,-9542,1574,-8213,4878,459,5009,2819,7785,-9925,-1265,-5584,6307,4501,7862,4008,1076,-7915,5925,6702,246,7713,2000,1435,2183,-5533,-8951,-1086,4477,3642,-8481,-4431,-9459,7452,-4746,-1531,-7182,-5285,-9218,-6090,-1699,-1940,-8454,952,-7174,9574,-417,-2002,-5528,9793,611,-4401,9242,1786,-1461,-5581,-708,707,7274,7367,1825,78,-36,1143,8815,-225,-9117,-9492,5260,-7489,-7117,3552,-5220,-9909,-9812,-610,-1326,1163,-5540,6176,-3517,8004,-4009,-2992,1365,-7800,9294,6373,2729,7885,1737,-7949,-971,-2040,5647,4488,2040,5404,-6641,2722,-4850,-3036,-3419,8668,9083,6477,-8466,-9891,-7936,7013,2377,-2241,185,419,-9071,-6678,-5465,3129,-2830,4348,-7941,-3945,589,-4342,1641,2714,9703,-9812,1106,3802,-1109,-472,-8670,-6669,7031,-3690,8259,-1810,-8703,6407,-2382,3410,-8255,-5521,4198,4357,1169,4001,-7145,4550,-9861,2659,9027,2373,1537,2230,2373,7744,9222,8823,-9011,922,6178,3384,3287,3201,6480,8568,-2664,5936,5121,-5208,9856,4198,-3152,-1564,-3489,-1198,-3399,-8832,-8122,9449,1390,-6794,1976,-977,-7415,4302,4180,-2913,990,-7694,6839,-759,245,-9484,4087,1273,-4402,1679,5185,9586,-276,-8854,-7805,-5240,-829,7097,2267,5414,1652,-7596,-537,9747,-5702,1329,-474,-862,9391,-1100,-6963,-855,802,-9293,-6822,-3865,2813,-3022,984,1596,-4200,4320,9001,2435,-2005,4437,972,1238,7831,-86,-6706,-80,2497,6714,272,-360,8717,135,-8251,6057,8215,-4126,5800,-6898,4005,9150,-8126,-7612,-4132,6883,3046,-2205,6692,-2846,8029,9591,-4452,3579,3571,-206,2506,801,-9265,-2482,5801,2654,1499,6511,-5923,-5667,2796,5000,-8818,-8464,456,-1896,-4762,-2133,-7296,5698,-2200,-2671,1112,-1955,8212,-6543,-2180,1538,9512,-7987,6586,925,-5540,7222,-3293,-1336,8220,-1919,-2244,-4072,7212,-5946,-7120,6657,-2258,4303,-1527,2462,-9328,3172,-811,2639,-6522,7701,6915,-6376,-3140,-7888,-4414,-2604,2037,9737,-3698,-8068,-3025,-6458,-1220,-3402,4276,-5622,-6175,7411,54,4960,3954,2667,-3527,68,5101,-4758,-6002,5772,-4993,9347,4701,437,935,3512,-4045,1577,-2325,715,9614,361,3002,-9706,-391,7105,-6927,7753,6975,3343,9622,2625,8809,-407,8338,1242,4189,-1900,-4549,5246,3221,-6746,-6003,-9315,9812,-3382,4290,-2920,-9174,2340,44,6691,8716,-419,-8409,5791,-5781,-1742,-16,8247,-3608,4407,6079,-8307,-7090,-3577,2597,6169,1683,-3119,-94,2366,-2141,1739,8867,4019,3384,5505,1912,4595,1327,2190,7532,3663,4352,-1356,5675,3846,-5323,-2186,6325,-7276,-9712,3603,4454,2012,6103,-7317,-3813,9335,-1528,5902,-598,3881,-9056,-7367,5632,-1431,9611,7281,-5240,856,-6045,2279,-592,-3736,-81,-1129,7097,7865,3904,-1210,7464,-6849,1933,-783,-6662,-8735,-4316,-1661,-4275,-1334,-1878,-4308,5082,721,-9713,8679,4872,8975,9877,5021,9752,-658,-5620,-1852,-1978,1963,-3229,1997,2791,2101,-7357,-273,-7380,19,262,3462,-3230,6660,-8824,6160,-1595,8034,-7158,-4316,-9778,-7954,9255,-6989,-5034,-4298,-4497,-7404,5265,95,6425,-7015,-5535,-2647,-5439,-2734,9118,-502,-4600,-3344,4867,-7404,-4192,-15,2225,2143,9424,8662,-2809,141,8579,-4790,-9133,5334,5375,-9947,8862,-2246,7128,-8286,-1561,-2268,-3941,-100,-5514,-4200,9444,-8564,-2354,-7794,-2494,6557,-5770,-8378,1314,9899,-3059,-8932,-5796,6869,-1861,4909,-3287,1529,-1351,-7091,4641,219,-8831,-1486,-7578,936,-8754,2553,6543,6004,5798,-6098,469,9593,4457,6158,-6339,-3148,8901,-1489,-2204,-8598,2537,-9831,5295,-8805,1588,4712,-7496,-8817,4008,6688,9670,1394,2942,6346,7197,-3855,-9840,3998,-8470,6390,-2535,-2517,4581,1729,-349,-2916,1483,-5360,8570,2990,-9337,1428,6562,-4819,-6617,-7727,-444,1090,8737,4012,2617,6814,-5026,5036,9700,-2032,-1161,2536,2892,5032,3941,-887,-6146,2623,-4765,752,9385,7209,6854,1277,6143,2764,8205,8407,-67,427,-6047,4599,-4823,-5450,264,-95,964,-2682,-5518,656,2858,7373,5832,58,9308,-8534,2535,435,7873,-225,3992,-9387,-9794,6745,-1527,6276,3489,1185,3310,-9858,-9780,3164,-5616,-9010,-2327,9361,1136,-9918,-7484,2127,1721,-8919,-1529,6299,-3603,-3101,-5135,8710,-3783,-2286,-7725,9678,-7485,-7337,6641,-5396,-3335,-3777,117,8888,-150,9832,-6364,-1195,1570,5348,-7101,6206,2262,-226,1413,-7854,7668,-2546,-3239,-9507,8942,7032,9779,1813,8242,3996,8292,6195,5435,-3017,6136,1416,-1746,-1221,-5240,-1380,-2719,-4545,83,-5857,229,3867,-3486,-8362,-1031,4872,3458,-4448,1479,9952,-2598,1022,-7272,3332,7832,9649,-2450,-3289,3451,-8508,354,4463,7721,-401,-5203,3536,-132,-5793,-3558,4166,-6621,-9839,-8766,-8038,8516,-4713,6257,-3891,-9591,3142,4083,-9057,9393,-6213,-7164,-750,-1305,-7998,3025,3515,-2830,8748,6907,-3776,-665,9177,4303,-4525,-3992,-6061,-7615,7664,9584,6332,7023,-3923,4731,-2704,8448,1714,9547,4158,4325,3956,909,6164,2179,6406,4144,4428,-8471,-7666,-4315,5108,-959,2542,8099,6403,-1782,-3281,-5958,-9715,980,3447,9578,5414,6424,-411,-8507,553,-494,-7086,-6209,-6871,9509,-9713,956,-7462,-7653,8159,89,6803,7613,-8840,-8861,-4055,-7651,5901,3794,3798,8739,-4518,9457,1590,-4387,6692,-9805,1688,-3642,-9637,7523,-7483,3159,7583,7083,7667,8451,5588,-539,-3535,-7609,-5764,8269,-8810,-7843,1715,-2387,5695,5538,5315,4396,-8972,1711,605,4611,6475,4876,8904,-4289,4236,-8564,1729,-4865,8325,-3815,-5833,-9151,-6072,-8738,-2386,7557,2394,-6513,7746,-9951,4462,-7081,2561,-1238,4156,5294,-4187,-2447,9177,-8613,-6516,-5545,-5289,1348,6454,-8224,-5120,4394,4619,-6108,-2397,5865,6385,-8448,-8890,4717,-5157,6436,9457,5569,1726,123,-1833,-7361,6818,-2786,7196,8328,4818,-3390,9310,-3776,-5892,-25,-3418,-4061,3539,727,-4250,6610,-9488,-5190,-1075,-1765,-7171,-9767,-485,3485,-4599,-6587,-9452,-3604,-1458,-3267,-9032,-3059,-2439,-3088,-8026,9264,-7325,9177,-4495,-5895,-3358,9422,3060,7857,2051,9235,9865,940,4265,-6108,7235,6915,-1255,8408,-6635,-1656,3427,-8578,8554,2935,-8049,-7878,-3129,-4560,-1332,-9720,-9304,8336,-2477,-5082,722,2939,-3199,-984,3707,-253,-357,-8599,9789,4953,-6752,8272,-1138,-3059,-3062,-3850,-6615,-3327,-1368,-710,5115,9438,6703,-9554,3027,-4988,-3572,5858,-9746,-9109,600,6117,211,7615,8022,-8622,-4757,9449,-4392,-7697,-9461,-500,1445,9384,249,-3646,-6490,-6389,-768,-132,867,-3849,1151,8198,1296,1471,1376,-2049,-6978,-3107,-6555,6603,9744,-7765,-43,4951,-4062,-6311,6030,6221,453,-6646,-5462,5824,7429,2260,2108,9736,8876,613,-8592,4703,7921,-2363,9809,-7957,984,4764,4380,-6773,5165,5565,4177,-4101,3421,-8055,-143,2742,-3801,191,-9500,-2776,-3480,7227,-8462,-7017,-678,-3226,-8634,4231,-5433,740,-4295,-4634,7932,-9418,7469,4321,-1597,1656,-1603,-3982,-8619,6495,-7214,7563,9171,4575,-8346,-2623,-6597,3365,914,7522,7951,-1603,-43,6292,9381,-1102,-6648,-5223,8219,4089,-4468,-9110,-2804,-1253,7326,7376,-5011,-8538,1066,-2711,-7224,617,-8009,-6197,-7268,9293,-1462,6193,9739,-7415,9788,1861,-5467,4564,-8064,4561,4098,9108,7977,7351,-8467,-2326,-2895,-3785,-3268,8583,-9380,-1465,3432,-3021,-7088,4908,1975,-1990,-4068,965,-5386,2614,-4540,-2199,7165,5735,-9328,4577,-4736,1668,9838,724,873,-5017,9832,7691,6596,8765,-6915,2099,-5565,4128,-6568,4586,341,-7648,-9027,1485,4055,7624,-5784,4190,-6781,7091,-959,-6054,1768,7132,5413,9293,-6392,-4851,8463,-7128,7486,-5364,-1571,-5363,-6557,-9106,8821,-4187,-71,-5184,4786,-3024,8043,-8188,-2844,8883,416,8280,-7213,753,7697,53,7383,-2766,-9028,9875,-3194,3201,-8322,-7544,-6,4976,3204,854,-9205,9101,157,-2048,-2086,8565,4875,-9330,7912,-6468,-6457,-2192,-7119,-1776,1141,-1660,-365,-471,4456,-3887,6104,1309,2626,-9308,9522,-330,-2366,5492,1614,-3159,6922,4335,3848,-8472,9418,-8815,-9233,-6124,-1356,3114,6143,5368,-8883,5956,5534,7837,9757,5210,-4702,-770,-9693,-331,-2373,-8768,-7761,427,-5021,4348,-1923,-7187,4247,-1139,8242,746,1023,3137,5737,-5232,-2397,-4406,-5303,7067,2838,8100,3168,-7054,3801,-3192,-4585,6933,4693,7268,-7453,-5996,-4821,-3442,-2120,5579,2921,-1401,-5077,4473,9728,7461,-9934,-3969,-7768,-2396,-1897,1643,-1623,-7102,6273,-9482,-9485,1510,-6977,3282,-4040,2205,5375,-1963,-4722,2244,-1655,9408,7268,5282,4834,7777,1939,8946,3191,-2988,-6050,8486,-4128,-72,-801,-4059,-6760,-4530,-2800,-7075,-514,-9573,7454,5152,-9238,5572,-6112,5850,5261,-4113,-3198,2092,-3184,-8879,-5764,-8830,8370,522,783,-1583,-4472,-7289,4184,-7372,-831,-9425,-9706,-8680,-1566,-2281,188,3404,-338,5961,3719,-8453,-3047,-7240,-6207,-2223,2168,4528,2238,-6373,-7982,-8553,6636,-965,-3787,8022,-3988,8580,5823,-2222,8979,5792,-8379,-5480,1349,1622,5938,-5712,6213,-7480,-1670,-7304,8306,-5654,-6165,3520,-4313,-7564,-8101,-2655,-6238,3002,-651,-2082,-9449,-3071,8257,5570,8133,1927,8003,-9760,3141,-7453,9008,1472,-5158,3980,6138,-7052,-5879,-4328,1796,4675,-1148,3540,-7311,2113,-7409,7974,-9869,4563,-1443,8284,4411,7958,4795,-7066,-4418,-4473,2217,2825,-4347,-7247,-2263,8306,-7898,9487,-9371,5671,2676,-727,-3924,-9626,4124,7151,4256,224,-8302,-2855,3642,-6179,1728,-7146,8366,5046,5749,4688,191,-7252,6020,6345,-5367,6234,7723,-7721,7201,-6557,-1014,-1804,8865,-7947,6878,-8695,-9305,-247,-4326,2987,-9505,-4741,-9765,7772,4833,-811,-739,6435,-6049,5083,9861,-929,7271,-4985,-3702,-3897,-9012,-6961,-7921,-1063,-6002,-61,-3517,3992,5665,159,7644,-829,9194,-7998,-6805,1482,-7944,-8120,-8789,1429,5261,-6949,1370,-9712,8613,-1049,6504,-711,-7613,9769,-6232,8681,-2599,6613,-4491,9095,-3443,-2182,8893,3799,9293,2668,-9738,8138,2640,4921,-2721,3838,-1260,-4605,-1074,-4551,-9340,-3180,227,-2111,-3935,9128,-818,-7836,1617,2778,-7822,1297,3844,58,-6992,9442,6962,-1100,2799,-8794,2818,2202,1233,-7263,-8765,-4464,-7068,-2350,7318,-7407,-5203,5288,-3565,3144,-4704,-3996,-4655,-8362,8985,6368,-576,5344,-7350,-5811,-6364,7299,8109,8143,7515,4830,-7291,-1861,-8934,8990,-4112,8704,-5629,9303,133,5533,-9517,1538,-1026,2930,-171,-3441,-6591,-8481,6438,5154,-9456,9795,-9303,-6011,2215,4437,-7845,7132,4303,978,7031,-6092,1541,-2494,8380,-9188,7201,1987,-9068,-7078,-2093,3702,-268,2633,-9288,5373,5194,-5582,-2674,2226,1600,6575,-9543,4846,-9513,-5104,-7751,-6247,-7192,6537,-577,-9240,-5226,9182,-7043,8733,2012,-532,-1811,-2296,9442,-6363,722,-2896,-8594,5154,885,-1642,-2926,-1524,-9041,-6452,-804,-5306,-7120,5551,-9594,7551,5683,1995,-2738,5001,9218,-5563,-890,3803,6383,5564,3064,-7642,7282,-767,5416,198,4918,-6101,-5699,6146,8261,3467,8185,331,-8107,5572,-7383,-7157,9610,1570,9085,5033,6624,-315,8318,2400,-4605,-7197,4455,-6859,-5437,5247,-7619,-8228,-748,-9092,-7558,-1424,274,-6547,3561,-9117,8128,3951,-4203,-704,-4605,7979,4545,-6217,5412,-9681,1987,-6184,-2936,-738,-2461,4575,8395,-1573,6397,1669,-612,1540,-3552,6839,-4822,7592,-8805,753,-5437,381,-5889,-488,1477,-1845,-8776,-3403,-3167,5036,7753,1886,6009,-663,8074,-3243,-2299,-816,4947,4461,-1481,9536,3340,-4441,-3816,5037,6294,200,-4172,-7874,-7122,8616,2276,4197,2411,1894,-6109,9383,692,7067,-6602,-5547,4893,-2885,566,-9458,-7080,-5798,1830,-6154,3686,-6986,3626,-9261,-6515,-3433,-814,5371,7959,-635,5543,6918,-6046,4515,-2802,6169,7302,-1456,-1659,-2098,-6630,-9555,1325,2751,1804,-7421,1918,-1790,-1271,-278,4012,-4807,5282,-5749,-4788,-7592,-4917,-9703,921,-5089,4504,8128,-3649,3968,-5058,-6699,-1460,5475,2201,4018,-3801,5049,1739,5133,-2787,8587,1200,-9679,1107,7360,167,9329,-5547,6811,2333,7630,-8451,904,-2591,3594,7933,8275,6400,1485,-4005,-7114,2822,-2876,9807,-1500,-7489,-6432,-8688,-5490,-507,4911,5043,-2986,-8566,8182,-9778,-5142,-4776,2714,6525,-8926,-8061,-9111,4859,-5393,-8917,-1619,2696,8046,463,-6681,1692,6224,-3972,-4246,-786,4361,5074,-3237,-1820,2170,-2882,-2544,-7609,7500,-7013,-2484,-5357,1185,9351,4373,2416,166,5190,-1446,3760,-8499,-7533,-6770,3143,725,-8453,2250,4114,-9108,-9038,-1734,-6338,9033,-1982,2560,-427,-4740,-6981,5499,-7732,-2570,-7375,6274,9225,624,2257,-9033,-302,-8751,5626,7957,7444,-378,-8814,9557,-8991,-2709,-6524,-3537,5328,7933,-5018,6033,-791,-6529,-8504,2518,-3755,1400,-3300,-3300,4911,-2548,-2162,-253,3287,4564,-6924,-3096,-4897,3222,-8049,3901,-4925,8950,1282,9151,-1870,-3431,84,-3134,1313,2383,-4813,-8943,-788,-837,-8846,1950,-8598,4790,5982,-2121,7489,8442,8244,1742,6323,-5305,-8581,-4641,6999,-478,-8816,2092,9849,1273,-8555,-5252,-1104,6124,-6792,5946,-1455,3522,6168,-7725,-5223,7073,-2933,7692,-9466,-6318,3360,-8265,-5387,-3767,-3472,-2745,7686,-2231,8552,-6488,-1024,5999,5346,1872,2045,4046,-7975,-9505,-2414,-1047,-2524,-9818,4536,2464,9658,-8822,-5382,-2923,7888,7164,-4651,8943,-3694,4572,3977,6454,-2946,-1371,-3024,6772,8813,-6599,2644,-9842,-3135,9119,-2703,933,4051,5662,-4530,4004,4268,-9426,-2343,-4666,3809,-2757,968,6712,6332,-3576,3369,3766,-2253,4482,18,9581,-4243,-3176,-586,-3979,-9918,8219,197,8235,-8605,9921,-9495,6015,7136,-2167,-6646,5565,-907,4339,5264,-307,-8471,7519,-8070,2663,-2063,7111,3495,8537,-5846,-6668,-1743,-7705,7143,5179,4375,4822,-2030,-3164,8184,7242,7642,7321,3052,9328,-3482,-7611,3880,-7776,2965,-1267,7367,-779,8492,1352,8657,2141,-1552,-6751,-4143,3009,-1813,-5690,-3451,1983,-8300,-7396,6797,3392,6408,7511,1902,8695,-7398,1596,760,5331,-6439,488,-8342,1856,-6237,-415,-7580,-2607,-6984,9522,-8129,1653,9243,3406,6960,-6124,7262,-1003,1669,-786,8217,3680,8591,-5856,7774,-5588,2891,7486,-7950,-6840,-5019,-2869,8959,1333,-1904,-3800,6977,3636,5258,-1601,184,3355,-5233,7881,-4925,-9575,-361,7210,-5116,2987,-1622,1313,-1183,8511,-3469,-8616,-7348,1176,8902,-9496,5982,-2020,-3127,7211,7215,-4224,808,7204,-9363,-5582,6389,-4923,2606,6442,5893,4108,-7258,4262,8411,-6571,5109,-4900,-8454,7880,-4479,-6271,-9412,4414,-8305,-4511,-8237,7915,5044,-3258,-7383,-6302,6603,2789,-2092,-3199,3999,2895,-5804,-6353,-5523,-4484,-7614,1801,5264,8993,-7025,4823,-6365,8595,6835,1411,-4248,6091,-6050,6165,6391,-6486,-922,1333,-7965,-471,6443,4624,5398,5457,4484,6566,-1628,-792,-2642,-4709,2857,1952,4504,-3073,7176,-2578,-7014,6628,-8987,242,6128,363,-6237,-463,647,-3404,-3290,-3719,5455,8177,5171,2315,3956,-8412,4438,-5913,6259,-554,6426,-3328,-1334,7611,-2898,2690,3960,1847,-849,2605,7991,-8692,2850,2774,-4634,7311,-4179,-8721,9969,1816,2667,-7923,-1043,-6405,9423,1821,-814,1676,-897,1838,-9192,-8004,-7512,79,4099,3525,-1678,-9674,-1685,8075,5666,-9034,-3485,7544,-1733,-3522,1486,-5688,-8871,-9592,5123,-4147,-4421,-805,3869,6508,-4402,6143,9784,-9083,3938,2073,-4248,-3548,4877,9071,2914,2473,7453,8028,-7320,-420,5804,5559,-8762,6934,-5470,-8994,-6356,-8846,-5753,8952,-1749,8869,-1938,2640,-6003,-9348,-7091,-7502,-6079,8113,-6272,-2426,-9764,-2350,-7548,-6943,4603,-9834,9102,5009,-7965,-3399,8566,-5377,-965,-105,2896,-7138,-1090,607,-3495,-7569,-4663,-6487,-5556,6982,-2251,-6097,-6457,9268,-6177,-3108,9529,3428,817,3395,-8432,7343,-5207,5755,7805,6879,6396,9749,-5266,-9287,-2248,-4276,-3313,2351,-3748,-3232,-8736,-9348,5790,-3794,-7295,-3138,6777,9222,-658,883,-2587,9702,-4865,8600,3987,-5848,-4419,-3305,1373,1132,9767,-5948,9987,-2834,6758,7432,3992,-6821,-1331,-274,-2081,-9688,4067,-4838,-9044,-6590,8878,2966,-1220,-6093,4252,7246,6651,7646,-3241,7182,6685,-9164,-3781,7060,-8988,-8376,7383,-9285,7702,4396,-5302,-2503,3604,6045,1847,-3486,3127,1109,2142,6564,5924,9191,4169,-9579,8692,339,4981,9421,-4848,3477,7722,-3297,2906,1390,5133,7480,-3857,-6872,4928,4420,-8232,7975,-6590,6097,-1432,-810,5503,-884,8768,147,8204,1462,3588,1379,-1063,-7771,8632,-609,-7577,7090,-7427,-7572,-4930,-5375,-2546,-7625,-1097,6591,-8911,-4256,-187,-6639,-9535,8867,-9209,-9023,-6923,-1964,-9846,2505,-8435,5327,4301,-8736,919,8249,7171,-7031,-777,3337,5764,-7523,-4100,-5226,-3601,-5002,-8884,-8796,7092,1760,7894,-9962,7583,-81,-4733,4185,2669,-3265,-9498,4100,4856,-9486,7870,7434,-1764,-868,-4824,9052,-7783,3247,5904,-6001,9406,1979,1133,8784,4292,-1320,-2723,4278,6984,-3992,-3449,-8277,-9659,-8298,-2891,-3164,8942,-7014,-6342,-8924,5971,-911,-9860,-8722,-6642,-6843,1504,-5638,-6362,6119,8790,-4360,4172,3685,2115,7690,1119,6798,1912,-5284,9288,-8871,235,-9707,-377,3500,-3450,-7469,7262,-9205,-4952,-5835,8342,9829,-9016,4282,6749,1385,7427,-2711,5324,-8544,-8102,-4996,9,452,-6214,4223,-3394,-6231,5356,405,-4064,-1587,9165,6811,2500,-1372,-1266,4379,1537,2970,-9500,7476,-4610,-2786,6190,9866,-3539,7555,5758,-3671,-463,6731,8153,-3006,-9466,8778,-322,-4474,-9215,-9450,-7005,1341,220,-6639,5468,7493,1980,9129,1455,-5980,-5367,-5079,5393,-8627,4115,2785,-1866,-3205,6055,4128,756,3988,9337,2633,8661,-6372,4573,-3440,8783,5664,-7026,649,-6492,9214,5979,-2742,-8175,-3129,1026,5388,3930,-1924,3435,-1254,-4455,2481,-9517,7545,-1682,6602,8227,-3146,-2530,-6430,663,-7387,-1544,-8204,177,7146,9399,2867,2055,-2149,387,3314,8853,7011,-6603,-7726,9394,3169,-8585,761,521,8453,-3815,-4311,-5029,9428,8693,-5035,-6772,-5373,-7735,2719,1994,-9009,-3478,9426,-2876,-5639,-6893,-2108,9355,-8375,9930,8643,-389,4286,8195,-3583,1050,7453,7652,2604,7012,-1217,193,9861,-2257,4035,-7732,-7239,-9655,-1619,5821,-5363,-3416,-789,-2450,-9862,4989,5666,-740,-7150,1919,1509,-7519,-569,8716,1509,8528,-4690,1461,3576,8004,8743,-2096,-3769,8430,-623,-4385,2023,3234,9103,5868,4473,-6112,-7230,9944,30,465,-5482,-5621,-8758,-9777,8282,-2086,-5099,5571,-2383,840,-7597,-177,-7301,-8647,-2270,7177,8863,6002,-8409,-3403,-2786,467,-7021,5527,4521,-2263,-9716,7768,9741,1335,-3025,6124,4441,-2520,7745,7009,-2414,3407,1599,-2766,302,4360,-4432,-9864,7543,-6626,-4890,3223,5443,-8074,3563,8400,3331,9985,236,8240,9322,2678,-4198,-4288,4493,-4482,-2673,-220,9748,7066,9373,-9448,-2382,3571,-900,7652,4072,2148,9605,2479,7158,2231,2272,8377,3760,883,-1610,-5166,-1979,-1060,-6409,3676,2431,-2432,-4975,-3687,-1612,-4689,-5885,2959,139,-3896,-9814,368,3831,-9245,8260,-292,-3693,-2925,3666,-6610,7306,5769,993,6967,-4591,7939,-5301,-3235,-7095,5778,65,-548,7303,1158,-6601,3034,-1267,-6980,-3558,-1355,-8181,-8528,14,-516,-9956,4321,9717,5622,-3232,-8173,-4287,-3762,-9311,5676,3758,-4201,5213,-5116,-6122,4797,4807,-3837,-8745,3302,2443,3106,-6818,-6717,-37,-2099,114,9144,-9589,1127,-9746,7640,2958,-9549,7587,-2963,2259,5993,374,9074,-337,-2015,-7687,1336,4438,-1574,828,-5757,-4263,-8125,8984,-8257,6598,5520,5859,-8786,6445,4759,-6346,-3550,-6184,-5693,8838,730,-3640,2142,7697,-7348,-9271,8207,8934,-5992,8842,-621,-3705,9085,-8433,-4388,6937,-6951,9685,5483,-2572,-1632,-6071,961,-8390,-4381,-154,5757,-3294,-5623,-804,4726,9820,2566,9961,-8338,-6891,9504,-4732,927,8280,-8666,-6135,4978,9180,1356,-6932,9594,710,-9911,4930,-5292,7250,-2690,2456,-620,534,6556,3868,-2562,4188,1217,7530,-843,9135,-2047,6772,-7912,-9673,9965,3041,3807,-513,7272,8598,-6199,580,-6999,-9025,-3643,9660,-6357,600,-293,-7523,-6037,9315,-2542,-1644,6456,-2724,-3080,857,6722,7482,-6765,2556,-9761,3054,2158,411,-3739,-5507,-5094,-2206,9712,6582,-2755,1587,-8053,1036,-5440,5162,6412,4305,6421,6835,7613,5038,-7920,-7247,2320,5367,1167,7489,-6185,6919,6226,9815,-1568,3185,-8126,-3795,-7011,442,3070,-9159,1227,-3767,5217,8328,8918,-3748,-1951,6812,9744,5009,-1429,5534,1853,2514,4457,2200,7571,-4147,4666,4020,9872,802,9806,1222,2750,9595,3203,-6518,-9991,1304,1317,1826,-3126,-248,-7065,3277,5872,6410,3311,-6041,-3466,2079,2686,-3324,-5867,-2261,-6598,-2299,-2227,-759,5344,-6048,705,8540,-6023,2461,-9358,1704,-5232,-3355,6727,-350,8228,-1063,7960,2956,-4794,3224,-581,-8230,132,2062,7963,2688,-2235,-1211,-1454,1178,623,3178,5675,9343,-1336,4828,-8396,-892,-9673,1285,9411,-7663,9067,-6400,6993,-7732,6082,-1754,3406,2455,6753,-1157,6210,2043,-5103,8334,9100,1165,-4899,-2441,-102,8950,1144,4386,1447,1765,6379,418,288,1894,966,6433,6826,3416,6819,-1383,-5183,4154,7978,-5938,8618,-6115,3271,9024,-5755,-965,6271,-3550,933,7691,-597,5468,-6858,-9835,-6191,1712,8273,7253,-1469,443,1491,-3073,3078,4113,-2836,3659,-4029,-331,5984,-6332,6329,4217,-7642,-2204,-2997,-5657,-4036,-2307,-4588,8246,9038,88,-967,-8051,-7754,-9764,905,-2889,381,-7285,5090,-1977,-6229,-998,-6000,6053,-7828,-8735,9340,6375,-854,1816,1219,-4733,-799,1648,4254,2717,5113,4074,9848,8976,5266,6693,3840,4486,-9292,4062,-6020,5437,8645,-6288,2351,3414,8420,-2500,-4120,2151,8769,1967,-5096,933,-9392,-9269,6672,4645,-1395,-7496,4769,807,4024,-7282,6588,1213,-8674,1523,-3264,2316,7490,-3393,-1245,-9015,1564,6686,9767,-8093,5236,-7532,-6537,5609,6919,-8612,-8210,-4466,3520,-4383,-911,-5952,-2855,-3372,-8999,-6681,-404,-1900,-6418,2640,706,-8912,1953,-4223,8285,4115,5991,4945,3596,9297,-8031,-79,-3577,-4129,7838,6959,-9961,7717,3159,-3895,7332,-7257,970,2659,6246,7652,-9253,-6197,2687,4334,6234,8819,3305,-9902,-837,-606,5488,-1779,-7643,845,-337,4769,-2922,45,2610,3343,7818,8418,-2547,1611,-2495,-5229,-275,-8926,8773,-1110,-4764,-7982,2100,-8531,2569,-5676,-6746,-6567,-1131,-797,3982,-8324,-4474,1976,-68,-3041,113,-3210,-8508,9721,971,5663,8106,-3065,-232,-5409,6347,-2678,6386,-3293,1688,2644,7646,-6183,-6397,9243,2749,652,-3217,9287,4176,-2906,-1835,-9254,-7147,4850,6100,-9163,7841,3659,-9470,-9677,9147,-1782,-84,2953,-4920,-4672,259,3187,4161,287,-1647,5431,-8884,-6902,6190,-5481,8890,-9148,8798,9949,-4402,5618,-7117,2249,-6074,3981,-1552,-6869,5839,-8843,9503,-8715,-4450,-3497,4233,3443,-2302,-9425,-4470,-1111,-1357,2427,-4242,-4174,-177,-9256,6448,7286,6049,-1561,6652,6819,461,-5422,-8277,-7767,-4200,-8059,7634,-547,-1985,-8156,-5588,6203,279,-6597,-6948,2401,7356,3362,-7898,5550,7527,6252,8296,-6524,-6853,-4953,-826,5111,-7147,5069,2758,3510,4334,-2483,6459,6530,-4621,-8489,9286,-9897,-737,2221,-943,-3220,-3454,-9763,-2180,4780,-5022,392,-7526,2457,-4171,-3289,-6512,455,7805,7350,-9173,-5355,-7449,7889,5919,-161,7884,-9173,-1590,-3545,-6039,4503,2181,-6293,8044,-1408,-6958,-4882,7519,-3822,-9403,-682,2915,-5146,6558,9078,-7074,-6027,6089,3326,6587,3635,-2892,517,-2856,9689,-173,-4483,9311,7958,271,3594,-9678,6409,-9082,5557,-5428,4317,279,8188,385,1986,-1135,-1624,-3830,7934,-1722,5400,-8023,5861,-1122,235,539,-4402,2367,-2018,-4759,-5944,4454,-55,1783,5084,-7291,1571,467,-7144,267,5321,-6959,-9024,1780,-1082,-7009,-5332,-5366,-2562,-3881,1124,2692,9443,4260,8283,-1825,-2269,-2052,-9711,-792,-716,-1647,7591,7839,5560,2830,3866,3257,-6852,-5818,3141,5996,-7617,-618,7953,-9803,-6382,-1300,-1104,-7513,-3204,-8875,-3360,-1051,6578,-7683,-2276,-4462,9065,-7428,5743,5570,1449,-4252,9959,-6079,-3286,-9410,-3507,-820,8390,-4123,-2181,3216,-8213,-4049,-3064,-2714,8421,-2727,9638,9352,-3055,-5271,3390,-7440,9141,599,-7132,8191,-4937,-2864,6366,-6862,-5449,8400,-8410,4885,5070,-9113,5623,497,-2078,-4420,-4315,6807,-9184,-2555,4471,-7674,8208,-9302,7878,-2676,-7358,-9854,9472,5102,8120,-7295,4242,-6853,4054,4160,8314,7380,-8382,5394,-6666,-2591,-1547,-4826,2394,370,8606,5061,7055,-8783,8395,2582,-7743,-6839,-5659,8244,6690,-2618,-1108,6824,-3921,-1270,456,4200,-8804,-6128,2466,-7073,-9510,2411,3049,-2613,9668,3493,-8234,-9933,-9222,-6117,2543,3579,2201,-8936,-8908,8906,-2103,2968,4565,-9391,3454,-7646,3860,3192,9402,-6177,6793,-4960,-7224,98,75,-7094,706,-8641,-5423,-3208,288,9965,-4898,-1253,-3205,7314,-181,3941,-3193,-4642,9032,5093,-2148,-2618,-886,1287,-2635,126,-9471,1778,-8030,-10000,-4274,-7766,-1915,-1242,196,4306,-96,7854,-4879,-7040,394,-8284,-1765,3441,3740,-4341,-2978,-4202,-6084,4328,1481,-8273,4038,8956,-827,9512,-6616,7566,-2416,9945,-6443,-5286,-9586,716,-9237,-6602,6430,4430,-36,9499,-4988,9637,-110,921,2704,1180,4337,-8921,-9706,9020,6814,-2482,-2485,-6239,9708,9102,-7028,445,-3866,1031,-2264,-5133,-9721,-6330,3615,8709,-7131,-8994,4723,7552,4775,-7896,-2928,-8531,-2136,-3001,3634,-1189,6782,-6196,9181,-2617,7725,-4823,2559,2553,-3267,-6662,-7924,-1701,1773,-6006,8436,-1892,-6172,6872,152,-4373,3605,-8582,-7263,7325,6551,-7579,8213,7574,6514,-2110,-8016,-8915,5969,6866,-4375,-8798,8080,-122,830,-1895,-2009,-2022,-8150,-5533,-5433,1577,5959,7946,-4106,-7867,9174,831,-443,-3895,2198,2733,-4690,1796,8654,2548,-1754,5204,7038,-5052,-7852,-5857,-1287,-9755,4390,1597,-2371,-986,4558,-8546,3412,-7993,3,1902,4302,8909,-9601,6061,-449,4465,5878,-2752,5439,42,446,-5411,4055,4110,1000,7987,4426,-6320,-3017,4773,-1310,-7524,-966,649,-7843,-5301,7822,2128,-4853,-5966,6092,-3908,7308,-1095,-7295,-246,3475,5003,-6847,4942,2804,43,4210,-9356,1616,-9797,-1405,-6478,7650,-8557,-4799,7333,9337,-3311,-8565,1586,-2870,8056,-3002,-3161,7650,-5248,-7353,-2566,2730,-4276,-4366,-6831,3556,4731,-1181,-6802,1816,-3052,3448,-4693,6123,-326,-1244,-3745,-8502,7233,-328,-8681,-1450,-3980,-9474,-5754,2921,8805,-8841,-1226,2637,1673,-2740,-8292,2167,-4891,-1310,-2957,-7373,-855,-2455,3616,-1965,-8579,9650,9939,3955,6890,-2404,9605,6853,-7599,9322,-700,7297,-662,-7254,402,-6060,-5075,9836,-2849,1139,-9844,-9164,-3447,6127,-4164,-8927,-2370,735,-4446,9650,3573,-3422,-1336,7389,-7398,1904,-5811,6953,-1354,-3001,3598,1682,1406,5494,6321,1062,-2810,-4007,-4853,9229,7967,-1275,-935,8676,535,4601,6301,6000,7001,966,-2268,1369,-2071,7173,9767,-9584,-9745,-8324,2604,-5562,-2965,4617,5120,6706,-4266,7907,-8528,-6862,-8313,1704,1692,260,-3389,7856,-9748,3234,5981,-4499,2923,1294,-5850,-6778,8314,7023,7539,518,-6334,-9889,4835,6952,8461,-3167,6468,-8288,1083,-371,-5707,2878,759,-401,-2846,9908,50,-2993,3454,-3550,-3052,-6546,-9130,-1824,9915,4434,3724,1035,-496,-6142,-1688,-5374,-9826,-9897,6284,9036,312,-4741,2968,-2092,-5354,-1478,5135,8487,9573,-7703,7759,9559,7834,6480,6520,-9304,-374,2771,-9844,9490,-5150,-2594,-3195,-4355,-2082,810,7322,-5824,-6868,2356,6432,-3422,-6916,4495,4789,-281,4186,-1793,8549,-7392,-3909,7442,1384,905,7652,-9786,9251,-31,4513,-5678,-2197,-2956,2397,-8436,-7355,-2275,1269,-6857,7743,-865,8197,9149,-5671,2788,-653,-4360,-7361,9153,-957,9901,5460,9360,9103,3642,-620,-9754,4981,-7997,-5051,2528,-7831,-8237,3910,3671,5253,9668,8137,1920,3663,-5452,-8029,4520,-9779,-3413,-740,-4729,5034,7537,-6103,8030,-7158,-9502,4488,-6398,-1406,425,-5735,-6702,3258,-1510,-3577,7894,-6233,2837,4452,1880,-3965,3154,4153,-3998,-1634,9076,1757,1412,9229,-1692,-6811,4984,497,-4289,-2809,-9117,-8557,4866,2733,-7549,-8314,-274,-5632,-2789,1146,6954,3677,1508,-8418,2751,886,-3679,5564,-6011,-3959,876,-4759,-5072,2792,3108,-7552,1487,-2722,-7972,5367,4736,6141,-17,233,4058,3193,6317,4680,-481,-6085,-5034,1967,-4031,9091,4106,9899,-4219,-2570,8148,-782,8659,-744,-5698,7270,-5037,-8966,-8425,-6003,384,5319,-8777,-5342,-1206,-5736,-4299,9949,-1814,-2332,-5470,-7468,-2201,1757,1552,-4871,4340,-8158,-8727,5293,-7900,-5689,8746,-2786,6483,-8960,3870,6587,4748,2080,-812,-4234,-4952,5026,1415,5065,2196,8348,-2548,2094,-7159,9159,4598,3159,-1743,4878,-3232,9519,5844,4686,-1078,5076,1225,6071,-4571,9044,-9209,-986,-9950,5702,-8593,-4699,-3654,1747,-9199,-4393,-5231,8614,1732,-6084,-7029,4717,9775,1413,9354,9868,-7232,-3150,1685,-1332,-5215,7944,-3883,-3022,-9076,3703,-2505,6031,-6293,-3449,3755,9891,4134,-103,-4733,3413,-7496,-5697,-6975,8390,-1592,-2805,7435,-661,1337,1533,-8346,-2564,-150,-74,-1629,6125,6019,1350,-9660,-4171,1505,5838,-313,-6232,-1591,-6934,-4904,-7257,-4649,3340,-5632,1750,8399,6557,509,-9458,-4807,6398,1493,1526,8739,-2204,9872,6945,-2983,-5542,-9249,7130,-4731,-9894,-2546,4592,-2041,5063,-2375,347,-8221,-5255,-2728,-7378,2890,-2755,7075,-457,401,-4325,7053,9523,6372,-4487,-5394,-5382,-2250,-2323,-535,-8221,-8646,-9114,-7658,6847,-2834,-6409,6818,-2351,7087,8812,-94,-3185,6736,-3213,3255,1381,6704,-8795,8765,-3497,8664,9855,-5275,9056,-628,-2546,5567,8921,-7292,9697,-2563,-411,8482,-3036,-2113,-9125,3143,1512,7029,-1017,-2757,-8478,9535,-3106,-2605,3648,3945,950,-8044,9110,7002,5393,-6411,-1621,-9758,6902,-7100,2061,2990,-9678,9382,7713,-3311,8889,3789,-5998,-9155,6515,4688,-5971,-1051,4127,-1770,5426,8193,-8548,-461,4913,7047,-6925,7563,-6980,7800,-7547,-5844,-8002,5186,-4310,2309,6273,6774,-6142,-1993,-3182,-632,-6574,5382,1129,-2286,-8159,-5159,-6381,-6686,-859,5121,-5668,-1266,-9026,-3900,3238,3754,-6010,-5793,3607,-3595,2099,-3443,-2744,-7664,-9473,-2207,-1135,-6675,-6462,1303,980,-8073,-4040,8311,3966,2879,1956,9324,3574,-4840,8990,873,-8303,6005,7587,-7688,-2280,6029,3285,3740,-8847,2065,-193,-3951,7553,3526,3163,-5309,5410,1965,-7254,-9088,6165,-7486,9657,-8819,-8593,5925,-9859,-681,5057,-1064,-7347,9051,2732,4613,-9251,9610,91,1532,-1435,-8073,331,-6929,-2777,8307,-8887,-7947,-6830,-1149,8742,782,2041,8271,-390,9952,-5992,-279,2943,-2144,-6429,-516,1904,-3473,4026,2287,-5452,234,-7911,9569,-8863,-6970,-5901,8621,710,-2397,-6747,-9674,2608,8932,-4571,-6212,-5251,8850,7562,9260,-5564,2316,4770,5340,7406,-5410,-3635,-8723,7766,8510,-5382,-4311,-6999,-198,-67,5688,-6083,-4031,-2124,-1174,7953,732,-8669,3444,7275,-639,-5082,716,8257,2299,-511,3457,9421,1018,-9189,6774,-327,-2360,-7216,-8392,-731,-4114,-8976,-188,-9721,7904,-1695,-7081,7408,-6738,8449,-1994,-1304,-1050,-8963,-8380,680,-7867,-5942,-9784,1652,4244,7241,6461,3780,-5144,-8747,5772,5630,1925,2761,-6334,1206,-8597,9638,-6111,3696,7805,-7416,-5160,-2132,-377,6554,-5124,-9134,3671,5681,8177,-7001,3751,869,1372,8801,-3761,-6956,-9283,-651,-9853,-5265,5745,-6510,-2286,-5554,-7172,-7422,-8531,2864,3184,751,3419,6328,-6906,-5325,3205,4817,-525,4654,4309,3777,-5757,8359,-1829,2196,-4176,7490,-745,893,-6449,5680,5905,3126,-387,4045,-9817,1160,6589,7266,7985,-333,2876,9914,-1556,-5825,8879,-2596,-8600,8145,6684,-6828,1458,-4278,-7286,-3829,-2895,2522,-793,-4324,9116,-1264,-5588,4494,-8362,7511,-930,-8463,7636,8354,-6746,-8845,8140,-6130,7130,-1495,7141,7708,2531,6114,-2697,4915,-6550,-1258,6202,2740,-8552,2132,632,-9435,9032,523,5199,-1571,7899,-1184,-6647,-3500,4115,2173,5849,3438,-5196,6447,-335,9076,1920,5222,7139,-7671,-755,2475,9760,-5106,564,4788,8527,-6023,2280,6616,-2029,9854,-3950,-7808,-5098,5372,-9085,-4751,5709,5202,5707,1484,6262,-5058,5408,-3951,6893,6273,-9427,4003,-3745,9488,3390,8343,-7226,307,5884,546,-6953,1121,59,6024,-7028,1778,-2337,-1902,2402,3361,9415,-2314,-9736,2722,2913,-8388,-2645,-9324,4633,1261,-2846,-9634,-9374,-4133,-6634,5175,-3562,-4002,-5003,-1129,7733,-5991,4074,5713,-4757,-3991,-9332,9137,-2601,-9475,-827,8289,913,8972,-1006,9190,2705,1935,-975,-9361,-5573,2902,-2018,-7200,-6125,6809,-7495,4807,-6774,4904,-81,-1206,-9068,-3743,7423,7766,-6433,9860,-4635,-3312,-883,-2438,-5597,-3976,-8132,518,9233,-6360,-2518,9556,-8093,-1661,-532,-1577,-7787,-9773,8780,-5848,-7742,-1667,451,-544,-8984,2458,5215,2077,-9837,3275,2430,934,4418,4404,-5187,1813,2356,2814,-1365,5485,-8418,3472,-9099,-7,6824,-3533,-9260,253,5907,8409,7880,3197,-8437,6870,-606,2434,-3558,-1323,5529,479,8957,-1319,-7699,54,3233,-264,-589,-103,-5412,3101,-5653,-7129,-4983,-9634,1552,6472,-1944,-7918,5548,6057,1255,-4139,-1432,406,-4156,-4483,2095,-8898,5425,2719,9128,3098,-5487,-9487,-7216,-419,3552,-8692,-4527,7337,-9021,-2869,2178,-6046,-2751,-5435,6285,3752,3264,4407,4130,-4343,1537,-8035,-3579,-6198,-8150,8237,-2359,5450,-7508,-6130,-5650,-9957,36,-2214,5960,9102,-1134,737,-2421,-7940,8457,-808,3024,9827,-4349,-3386,1742,-8793,-1795,-2502,8919,-5073,4141,6379,-6265,8283,3355,-5683,5218,-3886,-6790,-521,-7786,-5790,5102,4333,3161,-7025,-1422,-7509,2718,6325,2077,2184,-4746,2244,8773,3201,6307,6348,4555,-1863,-4462,-5349,5930,-7568,-5955,-6440,8212,1681,-4703,5734,8632,-3831,8654,9672,701,-5366,550,5980,8001,-766,5433,-6230,-5398,1741,7630,7114,-6277,2312,-1978,-4284,8384,-5741,-6602,9805,-8743,-9184,322,-377,-6837,2268,344,3931,-6155,-9122,8803,-1618,1757,-5345,-4269,-4315,5183,-4927,-2439,590,1488,4848,-3577,-139,5029,3419,9078,-2883,-8855,-1964,5301,4518,-7484,4591,5558,-8739,-2724,-1226,4618,-8050,5598,-6819,7725,3923,-4035,9252,-8801,-9756,-9694,705,5536,-9879,9452,-3499,-5715,7474,9858,6426,-6058,7867,2793,9746,6079,4408,-4374,-4150,6839,5098,-4761,-452,2813,3292,-8159,5223,5529,5561,-4446,3731,-5385,-6055,4976,7580,-1640,-6366,-1063,-7761,-950,3804,8091,4496,-9977,6061,6920,-5657,6378,-2302,-8449,8816,-4491,-6665,8764,-5683,3930,-1143,-2414,-2189,2903,-5553,3039,806,7840,3880,-9480,-7716,6284,-9711,-8644,9035,9026,-4906,-5051,-5549,-7168,-4789,3623,7350,-2531,4423,-8750,5381,5683,-6015,3832,-4624,-3145,-4466,8637,-7497,-3577,2667,-3723,7887,-5410,-6105,7244,4193,-5613,6529,327,9372,8594,3420,-5508,7941,-3367,7104,1673,-3288,-3726,-3723,-746,-8707,2087,-7925,3174,547,6788,93,4280,7134,7588,2400,-3471,-1008,6329,3308,9102,-4552,4559,-4774,8939,5912,8710,1288,5356,4792,-7438,-8655,1921,-6041,-5384,-5140,456,5238,6508,3188,859,3009,9730,4414,-5899,5660,9321,4147,-5766,8378,8270,7883,3961,-4730,5753,2036,8722,-3363,9335,7175,4594,3488,-6210,-2572,-5625,-4681,973,2441,5965,1532,934,-6070,6379,-6740,2623,-8699,-4480,-48,-5425,8293,9723,4899,6144,-2960,8955,270,8534,-2922,-2059,-9009,1672,4842,235,3441,773,-7870,4583,-7942,-7943,8557,7808,3999,-1557,-8249,1791,-1307,-7535,5145,-8809,9517,2224,4836,1876,-7050,-8217,-124,474,1584,-3991,-489,59,3843,8239,-8532,-2311,-6723,-3852,-1845,7096,-8360,3877,-3928,-2187,-3097,-1241,7092,-4214,575,-9602,4589,5589,-8614,-3470,3586,-2154,7122,-2302,-4239,-1160,-3348,-2079,-5794,4036,-7990,-9907,-910,-5855,-7042,8638,-4553,186,-4637,2854,6717,7707,6828,-5364,6685,-4767,3889,-6995,-139,3048,-70,-4456,4564,7758,-3038,-2917,-1751,7493,6493,-3403,-149,-5484,-435,-7895,2504,-2747,6612,-1233,-7181,-4794,-1265,-7977,8573,-9724,-2288,1020,-1122,6545,5435,-7308,-502,6990,-72,-2356,2764,9766,5597,1772,3963,-6414,1523,8204,5269,5474,5447,-5691,8325,1142,9338,6644,7272,-3418,-30,-9984,-316,-4867,-8811,-1213,-1577,-8017,-9155,8507,-5107,7670,-2929,4427,6657,1973,-9162,-9483,5064,3764,4757,9791,9934,-8661,4610,-5585,-9629,7099,8118,-3815,-7825,-2093,546,9192,-4047,6962,-7337,941,6969,7341,9676,4334,-8606,4247,1521,-8921,-3787,-2309,-7871,8504,-113,-8357,-6735,3113,-910,-2076,659,-4634,16,-3243,9593,3367,4050,6476,4762,8436,9577,-6704,5717,7470,9970,-7905,-1413,-7823,-5080,-5686,2567,-2375,-7361,-4137,-1548,-6010,-3753,5628,4400,-1244,6775,-1098,-9021,-3377,-7686,-3346,-9783,-3008,2800,5479,5488,-6088,-4056,4534,4779,-129,2574,9953,2627,-6977,9588,-4474,-2722,-573,9084,-625,-9291,-1452,-5448,-7009,7886,3576,6598,-1634,-6205,1641,2905,-9874,-1135,-2899,-4385,2391,-8306,482,5950,-2260,575,-4106,710,4840,7889,-9370,356,-8038,1276,9603,1636,-8317,9302,-4444,-4337,-5172,-4349,5056,-4328,3113,-185,7377,-3134,-3066,8555,8703,-4625,5229,-559,-7197,-6125,4451,2181,5407,-8549,3912,281,-4688,-7790,-30,-4610,9113,-1076,5414,3289,-6469,-5593,-708,9607,9128,3250,-8228,-9467,8152,-4873,5287,4980,6048,3709,4266,1360,188,-2937,9910,-5305,-149,-3171,-5057,6522,5098,-126,-7775,2305,-3231,-1039,-9160,-3184,-6120,-7826,-9413,4098,8691,3849,-9159,-2045,911,67,5880,-4097,-5363,-1430,4097,-1073,-1613,7299,-5658,-74,-9896,1632,-3752,-3474,6942,-599,5324,-5238,-6725,-8472,-4134,-9064,-4625,4203,-5384,-7316,4227,612,2297,9311,-43,36,4620,-4423,7447,264,-39,6660,5352,3381,-6560,-5833,-3306,-4194,6342,-8351,-5814,-8153,5136,8329,-3194,466,5847,164,4899,-8738,8418,-3088,-1441,-6460,-8810,3181,-8323,9044,1417,5774,-9830,-3954,-9074,-392,686,7794,-7369,2314,8668,8585,5176,736,7767,-2052,1118,-4273,592,2324,-3366,-811,-1826,3157,7227,2141,9270,6126,1317,7106,-5140,5320,9166,-7285,-6732,5761,-6050,-3767,-9960,9739,2321,-4242,3817,-4301,-135,1666,-7031,8348,-2834,7123,2369,-804,1487,2454,-1777,35,-6202,5390,1528,1039,5425,2826,-8941,-9312,-3563,-3096,3371,2295,-5950,2778,-943,-109,1591,-8960,-3556,2761,1509,3303,4687,2305,-2469,6223,-188,-7052,9896,-4326,9349,5024,1,2646,6461,7457,-8839,2317,-6300,-9902,5119,-666,-715,-2642,1889,-5229,75,-1900,7278,117,7558,1350,1712,6932,8891,8091,-6200,-3139,-5010,-480,-2831,3071,-1521,-5928,-1690,-54,-3372,-1242,2993,-2525,4898,2347,8094,9364,7960,-3726,5360,676,2335,4095,5353,-7212,-8094,9344,1362,-5449,-8711,-8458,-4488,-4207,-9216,-7400,3288,9790,2060,6763,911,-6517,-844,-2097,2719,-714,-8809,-2572,-6592,4449,3762,-957,-1742,-571,2890,962,7061,-7281,-9364,7514,-756,-8996,2128,8323,-4702,-1096,-1751,427,6912,7130,7840,4499,2882,-8202,-2139,5041,7066,-1032,-25,9286,2261,-9849,3687,-5682,-2770,-5041,8328,7233,4854,-4375,7724,9233,7978,-6547,1522,-8681,-7077,2702,-4538,-5849,-6839,5754,-7195,-5627,6859,5037,-8008,3959,2956,9522,-4899,-9270,-6296,-2998,-4525,-9268,-7038,8012,4802,-4948,5672,-5535,-6745,-8948,6646,-5046,-3420,9823,-5974,-9318,-4675,-8756,2269,4424,7525,3130,4828,4085,48,7738,-1925,-5469,285,8235,-2502,6152,9589,5879,-307,36,-2322,-6379,-2935,-8076,-3349,-4721,3445,-4917,-8933,3171,8051,3147,-926,-4683,8283,1267,-6155,4817,8075,-1923,-215,-1746,4288,1745,5169,-8249,-9013,-3116,8718,-3527,-6548,6639,4456,9952,-464,3761,-5889,-6646,5824,1865,807,3097,2366,7328,-3535,8444,-9358,209,-451,-1296,-9087,3552,1945,14,-4761,7639,-5804,1546,7470,6125,-9178,-1559,-1124,9865,-2438,-5015,-2027,-828,680,-1276,6373,-759,1994,3531,-2964,-5207,-7213,9423,-5660,7456,-3146,-648,-6867,4772,-248,-3821,4297,7116,7834,-2373,4699,-8906,2142,7492,-5282,9046,-4145,1211,-2651,-4902,9827,-6379,-4478,-1722,2103,1780,-4222,-6250,4994,3510,-7104,9571,-848,-5788,-9501,7060,4376,-2996,-5253,2156,5549,2841,-4672,3419,5190,-1100,1254,9380,-292,-1190,6885,277,-4750,-9287,-1939,-1243,-992,-7453,-8756,-4972,-5529,-9475,799,-3352,-5443,-7016,7615,-9974,5045,6603,4761,-439,9506,4119,-5028,-1041,8435,9956,-7059,2433,2041,9759,-1403,-8845,-4928,-1466,4976,3905,-12,1706,-8003,5533,6115,-6597,8266,5707,5343,9473,702,-3129,9469,-5389,9628,1570,3961,-2975,1523,-4023,-8633,-3258,7588,4025,3184,-8548,9702,8887,-1092,6646,6198,-7367,5841,-6098,-8563,-8138,-9269,-4756,9570,-2610,-9438,5265,2904,9773,-9024,-3385,435,3885,-896,-7139,-5345,1785,9078,4253,7626,9844,4862,-8487,-3902,80,6880,-9195,-3700,7708,-38,3762,-9151,8080,-483,-2874,4194,104,-863,5247,-6243,-9790,-2404,-4209,8443,-5078,-1366,-8266,8575,-4935,-5115,-3990,9390,5716,-8359,9451,8447,-9384,-4270,-3486,-2960,-6612,6302,8789,3031,-2322,-5813,-9518,1501,-2078,7710,-1421,6843,-4296,-1305,7867,-7873,4517,-1413,6107,2311,3344,-8205,-8190,4777,307,-4247,-3156,4989,6176,3283,-8590,9307,4057,-5416,64,6604,-7479,1717,-1074,7248,-1223,-9979,-2348,33,9516,9613,-8641,4268,7498,-695,-1093,-6396,-861,-8184,-1797,-5505,-4740,2914,9200,-6213,9770,-2155,7255,-9053,-9766,1110,-6412,9402,-5339,1339,-418,9967,-5675,-3219,9036,4019,-837,7411,7668,6911,9401,-6490,-5388,-2114,-6341,-6872,-9828,-8488,-1306,294,-9640,-4063,-2688,981,1399,-3054,4335,7601,-6468,-605,558,-535,-6036,8326,-7027,865,6195,-8798,1699,-6989,8825,-9344,-2707,-7463,-5351,-7452,2676,7472,7955,-1434,-998,-8611,-2707,7664,9993,2886,-8431,-3004,270,-3898,9066,-8049,184,8676,7577,9283,-6431,-1786,8045,-6314,-9575,5085,1174,7977,-3807,-3533,-6983,-448,-3760,8143,-2683,-8410,7522,1892,-8347,-7913,1646,5210,-8835,4840,5965,8953,9348,-3578,2156,-929,-6068,-9959,-5135,3226,634,176,-3634,6679,4971,-2761,6819,1722,9318,796,8951,3299,4522,-5665,-8011,-2467,-8758,8766,2157,9585,-9830,-9405,-8015,7175,-5818,4699,-3365,-2776,372,-4389,2776,5388,-7467,6365,3355,-3290,2111,-8991,-2854,-2654,2289,9808,7430,7460,-6513,-4637,9450,-8623,1054,-8248,-442,-1667,9787,-4439,-655,-7960,5785,-4473,8208,8579,-5168,-9755,-9061,-4572,4484,7027,-9869,1632,-328,-3140,5075,8643,2788,6689,3499,1612,5805,4121,3353,-7195,7443,-6832,-5690,6555,-6256,7621,-2564,8729,-7980,-1707,3079,-3052,1098,6755,6922,8118,5883,9717,-5791,-6023,-3643,-7327,4946,-3971,6031,6579,-3532,-52,8124,-6520,-7144,6342,9220,-3439,-8655,-3021,639,2788,5553,8370,2935,7531,6018,-1978,2197,3628,429,-2075,-4738,-7917,233,566,-7941,3906,-1654,-3843,1590,-1106,1855,-5596,-7845,-8737,-728,6239,-4438,-1734,432,-7697,-1743,-6482,1609,-2060,-12,-2879,3651,5324,-9145,7227,9707,-7092,-4279,8517,-7613,4361,84,2282,-642,4520,8465,-5643,-4198,9673,2909,4590,-1856,7184,6391,1248,31,2347,-9145,8346,-6065,-2499,9099,-7771,1591,-1961,-977,5979,-6378,8210,-6807,-9130,-3645,7808,-5044,8197,2046,-2826,-5739,8003,2425,-752,5760,1482,1345,-7534,5904,9000,2957,1295,-5725,-1355,6010,-3916,6005,-569,1962,-3474,9253,2876,8772,8426,6738,4841,-207,5625,-2971,3635,-1491,-7811,-5627,-9384,9665,3292,772,3865,6875,8448,3892,4496,-5079,6845,4136,2032,8738,9435,-6487,-8569,-3719,2296,256,556,8935,4372,7088,-3056,1611,9043,-9994,7183,2748,6538,2900,8255,-6526,8772,-1673,6594,-1604,-8465,-883,-2072,-9052,-8619,3676,-5587,-3049,-8930,-4650,565,-3405,-9819,3428,-4839,-9565,-4635,4722,5825,-1372,-9204,-7664,-5459,-6426,-6758,5091,1237,-7629,8146,8748,-4025,3196,8889,7147,-2247,-4059,6812,-6546,-6960,-3346,7214,-550,2970,-2875,5515,-5656,6412,3331,-5190,1512,7524,3357,-4866,1724,-2538,4515,-1101,-5144,-5733,-2698,-5041,5586,3852,1413,4821,6595,-8726,-8730,6398,-6341,4746,-3410,-6361,1377,-5305,-6099,-4586,-5623,-2505,-1170,2926,-3520,2652,8855,-4391,-4449,-1882,-926,548,-8516,3202,-7867,5079,-1615,5804,-3662,8896,9298,6468,-5162,1466,9656,5200,487,8502,-4739,-958,4957,4948,5492,-3401,-2977,-6112,-4383,-2838,-9135,-2128,5449,-6247,-7633,-6714,5287,-8268,4242,-5122,7692,4907,860,-6396,-6688,-9323,-1152,1624,2146,-7377,5503,4905,2919,-9905,-5204,6536,1759,-8930,-7995,-5280,-4456,-8986,6083,9887,2528,8610,-2137,-6334,-2877,4863,-8452,-1033,3373,-9352,2417,-6293,-5985,-2702,1899,-5995,5091,9163,-4155,1793,-9793,3527,-1752,-4547,-143,4821,441,-783,4913,-934,4522,-695,1770,2366,4633,-7607,-9358,9164,7292,-3043,-166,4712,-1587,-788,7995,2043,-9661,9038,-7100,-3125,-8671,-3530,-5332,8391,971,-2875,2011,-4125,-7355,9252,-4735,6326,-5482,-7942,-8120,9368,3985,-4224,-4526,-4722,-5532,2515,-8994,-4473,3355,9886,307,1211,-9255,-8412,8279,-6836,-2849,-4636,5958,2423,-6130,-7747,-1913,-1710,-3473,6482,9829,-2458,8856,5719,-8235,-9106,-5620,-3535,2283,-6667,-8724,-3204,5880,3520,-6166,-3663,3478,-6198,8297,-3508,-3624,-8406,3878,5025,9601,-9389,-4651,8110,-218,-2153,-3014,-3185,9169,-4777,7852,-7364,6419,-9209,9184,-2697,-403,-9740,2908,-7746,6547,4504,346,-359,-1799,-4284,4245,9659,-1554,7237,6194,-9039,-7433,3831,4930,-6488,-3732,5949,-8436,1582,-6914,4487,-2970,-132,564,-5035,2232,7754,5051,-5888,2587,963,6257,1402,-1844,4659,-9880,-239,-9285,1723,-142,-9121,6388,-753,-4119,9737,9108,-1104,9671,1454,-8582,-6694,6244,8713,-3230,-1446,4889,9016,202,3937,5719,-7742,-2189,1992,-2641,-5883,-9819,9372,-4458,-7984,-4362,-4547,-9776,-6563,-7608,3390,-9633,8488,8533,-7320,9212,-6319,-3197,-7659,9581,7041,-454,4179,8580,7373,-8983,-8690,-4032,4854,-5398,1529,731,700,955,6942,4808,520,6922,-1499,-1412,-4315,3794,-7904,3265,6546,-1784,4651,-2848,5564,-956,-9591,-8790,1454,7915,5149,9093,6259,-7124,4550,8185,-597,5829,-5717,1342,5279,-8065,-6975,-1392,-692,-4704,-8329,-3787,3189,-5872,-4774,6855,-9632,271,7996,-8077,2562,9962,-5992,377,-1236,3515,8923,-6528,-6051,3760,5846,8725,2605,5554,-4932,-1608,7323,6855,3401,-985,5734,-5109,8927,2707,1200,5507,-7491,9467,-625,9276,7146,5334,-1401,2360,-6581,2804,-401,6521,4661,-3402,-9119,-3982,-2951,-7625,9761,6836,5079,-8642,-6241,-1132,4633,-3536,-2655,8489,-7355,-6436,4952,8694,4445,406,-6142,-2096,-6974,-9817,8811,7134,-1857,1574,-5438,3093,4920,7382,-3493,-9509,8130,1793,-2326,-1045,-3318,1842,9171,8686,1890,5139,-2680,-7874,-865,1503,5453,-5662,1568,4468,7221,-5995,1742,-3166,-1531,4676,7436,-4110,8131,9659,-5530,393,-4927,-7746,2979,-2150,-207,2824,-1155,-9541,-6811,-7023,-3119,116,6059,-303,9209,-2426,-3913,-3057,-9940,-9381,9034,8454,-5757,7084,4141,-4679,1346,-1808,-9865,-7264,-3652,-3021,-9862,-1810,-8642,-5822,-833,-9340,253,8842,6002,3908,2362,-1351,-8330,3874,5166,1970,4239,-3377,-2431,-4478,-4614,8008,-639,-6013,-8751,1145,438,-5401,-6763,6074,-1094,7114,1814,-1264,-9905,-6436,4933,-4318,7161,-5503,6190,9578,-3143,-8966,7902,2222,4728,-5630,8023,-7608,-2882,-450,7454,2742,4541,-5671,-2580,-4275,7620,2177,-9459,-8113,8,6651,-1420,7165,-2392,1354,-517,7641,9443,-6103,-7146,8083,2819,-2320,9115,-9768,-4156,-9343,2743,4582,-9934,-4826,2811,-5027,-5710,-776,-9912,4065,9997,-7595,-5191,3791,9058,-8462,-3039,-1453,-7336,-9485,-6242,6371,-1791,-3198,2158,5502,4305,9176,7951,-9719,6655,802,7654,-5852,289,6277,3883,4639,-3169,4645,-6046,8856,2197,4273,-8860,-7974,7270,4446,5882,3888,-6650,-6538,6830,-1251,-6799,1808,-690,-3777,-9843,8447,5890,7334,2568,4055,-3417,2191,-1861,-2341,-4377,889,8163,-9527,9860,5435,-7669,-1890,-4857,-2232,1297,3176,-1561,-2955,1841,9761,3186,4549,-8666,7908,-712,3519,2336,139,-6844,-4268,5975,7045,-4626,9277,-2617,-6496,-7481,9716,-8813,7980,-552,-1905,9598,772,-5037,5445,-1307,-5134,-669,-9493,-1753,2181,9315,5022,-273,-8553,2905,-7943,-3172,5652,6863,-379,1081,-3310,-6328,-372,-9760,-9308,7041,-8733,8480,-502,4252,-8200,7846,-2143,-3683,3116,-2668,2272,6849,1970,-3198,4562,-8065,3218,226,6743,-2177,-7574,-1599,-4186,-6414,-9671,5415,-6398,-4453,-8964,8009,-592,-6603,-5091,-2819,-3710,-903,-5589,-3984,-4937,-5774,6004,-9738,3737,-8708,-4840,-1091,-9713,-5178,2229,6867,-1347,-7613,-216,-5244,3831,1205,3831,1099,9905,8465,6305,5672,5853,3064,-5262,7903,-8458,4067,-8724,-5878,-5689,-7731,78,1299,6572,9927,9199,-3060,-2709,9857,6979,5061,-8201,-2747,7311,-3497,-8390,-3436,-1175,-9853,6161,6944,-7385,5892,3708,-9808,-8887,2839,9136,7176,3159,2206,1020,6899,9684,-8006,-626,-7064,-5294,6959,-3154,-146,1398,-4804,-4607,-661,1763,-4862,3871,841,8445,6955,9384,3310,239,7638,-5387,3719,-6164,9070,4209,6833,-9184,-5977,-211,-6189,544,-4713,-9902,556,-1667,-1070,6208,6581,-9870,-1072,1476,6751,-7489,2085,-2237,8441,-8257,4259,-9430,-9787,6153,-4792,-6471,-6014,4574,73,9504,-7330,-745,-5992,2024,-4122,5318,7548,9798,8747,-6507,-5942,8107,4742,-7957,7216,-1242,-992,-4908,-291,-3157,3244,3260,-6719,8377,685,-9458,-466,-4722,-8010,1470,7049,2350,1856,93,-6623,5326,3145,-4713,-5498,6179,-455,4261,6925,-355,8117,6655,-7020,-5005,6428,-1035,6344,2207,6067,3176,-1491,-8175,-6325,9947,-3375,9979,8589,-1195,-1240,-9559,-4828,-715,5804,-8144,-4005,-5890,983,7790,4526,3782,-6890,7468,-7426,-9641,1994,8913,3046,4761,3418,1198,-535,-6880,236,-3433,-4422,-8975,7851,6355,1308,-763,-1307,589,43,4618,3936,4667,7490,2635,1731,1883,-6,-4454,-5040,297,-7610,380,4635,-7692,-6260,3364,4536,8209,8112,-1124,291,-3426,-6059,3326,7451,-8608,-6559,-1389,-5305,5822,9487,-142,9664,-3131,7612,485,-3490,2623,3279,-5395,-739,-9171,264,4764,2204,3839,-9063,-3135,-8760,-1028,6753,-8427,-2861,1781,-1845,4549,-4085,-1717,-2643,-2964,-828,915,2696,-2991,3738,7158,5880,1529,10000,1016,-1462,-9958,5486,-7186,7545,2150,-9596,-3193,3394,-7889,-829,8034,3461,-2044,-8688,991,-9271,-2786,7244,-792,7249,5198,-2179,5279,8298,7750,-3378,5526,-2629,-1229,-3896,9742,-8593,-1704,-4991,3342,934,943,3878,5547,4993,885,-1148,9747,2356,5460,-4457,9513,2808,8946,-2161,-197,-3646,8814,6744,831,-6252,5334,-9718,4997,9706,-3825,1281,-8803,1312,-4197,-4455,-8294,-7026,-1721,-5839,5823,4389,8278,9162,-9351,-7260,-4709,-649,7809,7163,-4000,2494,7540,-2887,6434,4418,2271,9433,-3747,-9497,-9359,-4956,-1911,-1191,-1178,9164,-8233,-6380,9727,-1668,1469,-8886,-3929,2875,5895,5290,-9361,6678,-4960,2420,-7337,586,-7042,6939,3833,606,7951,5514,-5949,3710,-1411,1750,6418,8618,4870,-9199,1335,-3657,-9452,-3780,4946,-1030,8230,-6414,-2507,-3798,8891,4246,4865,-2261,3512,5587,8698,1794,7427,-9477,-4760,4686,6102,-6254,8289,2523,8328,-8824,5223,-4892,350,9480,495,-1042,9950,6914,-2292,8106,-428,8683,3784,-9116,-1278,-8558,-1581,-4262,1931,-9162,-5639,8592,4104,5383,-8259,-9831,74,8866,-7317,-3730,6441,-3513,-4948,-842,-4539,-8013,4108,9459,5153,9799,-2219,-6834,-4005,299,2103,4593,5382,-7495,-9086,1551,-6386,-2117,-2923,9545,7738,-6680,7032,-1558,-3799,3302,-7095,2276,9978,9828,-8389,3416,2276,-6785,4374,947,-785,-1680,9962,8221,9346,6050,-741,5097,9347,-125,6684,-7540,-9104,9005,5501,-8380,-2912,7272,1318,2094,-8573,-856,6980,9476,9966,-8885,5576,3235,3071,-302,-8222,-5872,-9622,8136,-466,-5909,-6944,-21,-8653,-8824,-3448,-9442,-679,-3473,-2378,4873,-6752,-7224,-8658,-2888,7204,5272,3424,5304,8174,4760,4731,-4513,-1684,3371,1019,-8359,-4227,-6192,-8180,6002,-1191,-3904,-3871,-2380,-7730,-6320,-9397,-4687,-1366,5593,-6467,7691,2848,-3951,1878,-2490,-3363,6712,-7849,-7930,9423,4786,-8021,-41,1581,-1811,9416,-1038,-1868,-650,6076,2926,-5948,-2508,-8929,-1774,9422,2090,4011,9551,2773,-8719,2034,-6280,-9761,-9063,5919,2632,-7859,-2811,2265,-2307,-8729,-4965,9242,-6769,-5972,3431,7993,-2423,2119,6617,1708,-4317,-4870,-2802,3255,1107,1730,9578,-140,5030,-9679,-559,-5911,127,5852,-8102,6486,-5227,1361,-6106,7608,-8027,1216,6011,-3427,-4310,-992,-4670,-3057,-1287,-24,-2969,-540,-9077,307,-395,3204,-8014,7197,6914,-2405,-7865,-5101,-4843,-7781,2266,-6085,4642,609,-6473,-7645,32,3966,1150,4984,1156,8734,2515,-8466,-4094,-2284,4662,-9998,3994,-7763,-198,811,-8184,7461,-1869,-6571,9349,4462,493,-993,-5003,-3914,2441,2838,4490,-8887,5236,-3934,5878,-2187,5329,3713,-1015,-8218,-5755,7901,-711,5186,6573,-5257,-9806,2713,-2129,-9803,7119,223,-3832,6373,-1823,1699,-5415,8023,1313,3668,-9345,5418,-9650,9235,4195,5788,-8164,1469,-6129,1998,1360,6977,8563,-3994,8369,-7759,-4803,-5968,5041,-5587,6410,1001,-6451,2220,-4419,-8055,-5873,-3902,-4817,3740,-8076,7909,-3716,-2996,3161,1210,5263,1039,3457,-7697,-5842,-1406,-1716,3641,-7217,-584,6230,-1457,-7823,-4298,3476,9067,-6319,-6060,-8556,7198,7514,-3972,-7802,1911,-1558,-9987,-5983,4393,-4518,-739,7383,-8894,987,7352,-3005,-4209,9452,-6087,-2757,5077,-4450,8252,-6874,-1838,5951,129,93,-5267,-8602,1729,-9599,1309,5194,3786,-7188,7351,1861,3401,8131,-4318,4274,-8283,9878,-2212,-2453,-9233,-6796,-296,4582,4366,2545,2816,881,6371,8093,-2933,-9635,3650,-8586,-7055,3367,9100,2951,-4908,-8368,-2972,7264,2825,-5101,-6511,4278,8010,-3212,6756,-6370,-6093,8655,-7455,7515,5295,5223,-4857,-3196,8913,5143,1227,8048,5709,-4940,7438,-571,8984,-1346,-1759,-5503,-7280,9204,-112,6897,-7469,3374,-4161,1500,5262,4765,-6156,2436,-7476,7569,3801,-1199,-4828,-2812,2082,9410,-5498,3300,-62,-1197,-1820,-5512,-8870,4968,4031,-6601,-1585,9248,5253,-2920,6832,-8981,4517,9120,3632,2005,-9104,-2319,-286,6982,7550,7796,-4795,2140,-4109,-3501,-1815,4413,8388,1812,-663,-4768,2876,1037,9845,5123,-2674,7355,-4167,5924,4067,4774,5825,-4286,-9879,1961,6489,7937,1664,-5727,-3203,5982,8882,-3984,2137,-4988,1302,5051,7810,-8276,-8656,-4104,1579,-283,-910,7327,-1449,5463,-9028,-8405,-7990,-3278,2003,-1523,-2147,-675,9011,-2373,1562,-4595,-8939,8744,-4337,-4474,3644,-5157,-9553,-9481,6728,1146,-6494,-9412,-1433,8815,-9049,-6209,-3492,2612,-800,4808,7334,-6387,8482,-5775,-196,-9586,-3772,6377,5856,-347,9391,-3633,-4350,1547,3783,-3853,-8622,4406,5662,-5314,8444,227,7112,803,-4454,-4919,-4688,5964,5586,-9362,5036,2146,6445,-6172,-6901,-6576,9454,2345,8053,6176,2151,-5942,6898,-9292,-1949,-3004,-5349,-4176,-2544,1294,-4146,9556,7915,3826,-2878,2567,3923,2583,318,-8930,-474,7694,-8821,7114,2786,8369,-9798,-5097,-3352,-3301,3079,-7679,-1362,2252,-2681,-589,9941,2990,-9654,-6952,-4991,-2755,8606,7330,-6078,-744,8717,2066,6313,3253,-5310,3200,8384,2514,-56,6205,-8932,1780,2576,8126,-4644,-3814,4561,757,-5930,1823,-2836,-6695,-8331,3439,3084,9232,4719,709,-7826,4157,4811,5126,6447,-5581,2429,3488,-8987,9819,6976,-7787,5579,-2532,-7048,-3160,-499,2773,-6081,2630,-6110,2126,-6126,1620,-5344,9633,-3761,1792,-8590,-4367,-2559,9486,-2267,-5873,1846,-4920,-9099,-8760,-8934,7380,-3739,-4592,3243,2042,9521,-7074,1873,-5649,5019,-6850,9954,-6229,7800,6803,2921,4134,8611,6236,-322,-7478,2922,-6868,8253,3127,199,-9758,6052,-9608,-4682,-9114,-1248,-4366,8374,-2243,-7584,-4043,-9439,-8130,-728,-9859,1820,6713,9104,-8082,-9790,-5017,7923,-4434,-1681,7894,6272,5599,-919,-759,7448,3234,7355,3961,-7549,4587,-6770,-9948,8669,-7559,-7272,-6822,3581,-3233,5964,-1449,-2278,8989,1785,8049,-1368,-8021,-223,-5222,2006,-9993,-8458,1135,5703,8182,-8605,-7076,-7439,-3424,-9123,-4189,9904,7029,806,2113,4898,-4864,2930,8792,-3281,-4974,6982,1162,4941,-2163,5342,-2892,-719,-7321,-8720,7104,-5775,9327,-9091,2278,2471,-275,-1543,7966,893,-7258,7658,-3948,-3385,6261,-8375,-2868,-8915,-3504,-2327,4825,1258,-4785,-1222,833,7234,908,6522,8519,-8240,8691,3332,4519,5889,-1062,-9930,-8575,6355,3954,8421,-2768,9427,-5890,2496,6945,-7384,-1900,-6529,-9735,2908,-5291,4848,5520,-8577,7543,-8113,4627,4141,8914,-4332,8435,2017,-7745,9677,4348,7373,-2949,-6976,2425,-3846,8420,-1322,-3505,-72,-5350,-954,-1549,8309,7856,-1245,-5217,6528,-1010,-2670,7072,9542,5876,-4886,-2421,3972,-5043,4320,-2863,8225,6152,-6125,-4239,3121,2021,-5684,5476,-4866,-9497,-7297,-7035,8751,-8570,-3015,8090,3350,-1579,4667,-5627,-3108,-3473,-3724,2261,1369,-6200,5567,-9632,-4071,1556,2749,-8136,-1733,4291,-1898,5403,-1338,414,8156,2691,-2581,3792,7811,-6748,-2324,7189,8752,-5350,1548,3118,-5224,-8642,-5465,-1861,-1008,6975,9637,1831,-6652,-2239,6398,3606,8893,-3031,-321,4914,9938,1751,-4032,7515,2333,5332,-1909,-6080,5710,5843,7510,-6909,2649,8021,-2711,-3220,917,7132,3162,-1549,-9277,8405,9825,-2540,898,4277,-6979,-1331,-1646,3467,-2134,4300,-280,2537,2961,9061,-7579,3516,-733,2186,-3932,-9159,8676,1004,-8159,4743,7431,6099,-339,2854,-1650,9233,8213,233,9069,6615,-1708,4455,8571,-6966,-5133,-4202,-1512,-9032,-6062,-8895,-5160,8653,-3502,-7723,9074,591,5050,4362,-5143,7006,-5354,-6932,-4784,8313,-8000,-4846,3912,7392,9886,2247,-5715,-4194,4294,-8997,-5143,-9785,8641,-5178,-6032,-3111,8424,8082,1755,-836,-5910,-2370,2456,2440,6507,-9269,-9502,6457,4561,-4099,-1036,179,9604,6602,-822,1080,-3319,-155,1675,-2990,-827,-5977,6795,6736,-5799,-6625,7926,8738,-3526,2036,1563,-1155,-6574,-1796,5408,1811,-6446,-1173,-4071,-2020,-5945,9406,7274,8523,-9487,-5673,-6004,7266,8924,7110,-1272,5491,-621,-9239,8772,-7842,1573,2445,5529,-4613,9006,3991,1950,-5437,928,5967,119,3000,-9072,-5656,-2472,-8596,-525,975,2979,-3058,1905,7360,-7935,285,9245,-887,6551,241,5177,2714,-6413,-6430,7595,-3284,-2422,-6889,7270,-4555,116,7230,9366,9506,-7132,-8791,-9922,-3641,8399,3116,-9224,7845,-2051,7563,-2142,23,8916,-1227,9401,-6059,5192,1632,-2949,6129,1521,-8601,3689,5195,1066,3993,-6524,5786,8599,-1303,3670,6454,975,-4036,-2238,-5464,5446,-9425,8748,6807,-1494,7161,8851,5556,2947,-1178,3695,-5933,-3732,-7902,-888,4634,8781,9899,-9792,909,-4758,1773,-1851,-1616,7201,2426,-390,-7575,-9842,5237,833,-2621,-2034,9346,-9674,-103,7913,-7080,5121,-5704,238,-6727,-3537,3388,4418,-2846,-6980,3460,-6159,641,7850,-1036,2884,8494,-2440,-9345,5357,-1715,7865,5234,-8265,-1588,-7994,-6470,-1879,8843,1210,-5338,7616,3953,-589,-5047,2034,7562,3268,-3893,-5361,-719,238,-9908,-8269,-1627,2237,4830,1236,-7786,-1995,7422,-2825,7668,4694,-3074,-8475,-1164,-1052,4086,7669,5745,7568,1627,-4728,9443,-96,-6330,-6564,-1534,871,-1374,2090,-2775,3818,-7011,-6009,-1057,-9856,9147,4825,8494,-878,2603,4645,4234,-8429,3509,-2860,1453,-7340,-8216,5621,5162,-5119,-3466,-6747,2013,6484,9456,-5725,-8849,-1381,9151,-7555,-3070,3924,-9613,-7463,1579,3222,-4804,165,-2351,-7286,1609,-7318,-2403,7872,9250,6880,-9416,1378,-4594,-8709,7327,-6824,-8901,2065,-5341,-9344,346,1952,6901,-5166,-7922,1034,-1448,-4127,-7101,-3346,-6054,9617,-4564,-4506,-3891,1195,1193,3294,-5353,-2582,3387,-9129,-850,-1970,-7963,7927,-1051,-4907,-2438,2864,-8432,-2045,-1716,-7895,-2062,7233,-4244,6298,-9761,2370,6788,-2541,3091,8522,-8436,-701,8534,-2978,-1250,6493,9376,285,2575,3219,3406,7929,3477,-7829,-734,-3813,-2621,4105,-5866,6549,5642,-2590,-2778,-2123,-7955,-4926,8882,2745,-5842,-8557,8413,8587,-3957,3042,-8980,678,5330,-4166,2001,2231,3558,6434,-6167,6298,3077,-7273,-4963,6795,4278,4480,1385,3790,5905,4837,-8345,-1338,-4037,1409,3650,1644,9174,-7062,-8739,2537,-1832,-3693,-7642,-9465,602,-8777,8275,-3856,5549,-2010,9268,5620,-7659,-6631,-367,9013,2769,-4565,-4131,5284,6154,-8129,1441,-124,9089,3272,4100,4053,7982,2760,5604,-6287,-8156,2274,-9161,4483,1211,-5357,7356,689,2366,-5597,3940,-796,-971,-3891,3026,6902,-4051,4708,6198,-602,6112,-4820,-1330,-1953,-2302,3437,7107,-9087,8733,-728,3922,717,8193,-6229,-8426,-7302,-4828,3746,6536,-7319,767,-7559,-9053,7191,-429,-7424,3883,-9603,9400,4616,-5546,-3491,-5984,133,4981,2988,3586,-8246,2090,-5771,-1933,-6371,9656,-1526,-791,8397,5234,-6177,-1518,-7359,237,4649,4269,960,-3686,2604,-676,4961,-5989,6356,7295,-4753,-5738,-8019,3217,2700,5046,-3089,9362,5271,913,-7661,7900,-4877,-9844,9084,4635,-4348,3852,-1666,-3417,5592,-8677,-6740,-3078,6352,-3985,-8828,2293,4938,-5757,3974,-1514,-5369,-660,-1763,5039,-9249,656,6190,-3759,-5628,171,-9004,-6457,732,-8640,-9582,9366,-9244,-7565,3789,-6059,5407,956,-1254,8239,-6324,-3635,7787,-5685,-1144,-3611,-2065,-6857,3014,-921,-6220,-5204,-6833,1298,-1960,-1842,1361,-6738,6429,789,-344,2043,-7784,6886,2361,6919,-4658,-4640,3989,-2195,-4719,-3290,2768,9421,3627,7784,3144,8087,-9248,-7928,-3084,-6979,-4999,7322,-1378,6454,9533,1765,-450,5553,3610,3898,-1220,1483,1477,-3995,4190,-9393,-8257,-9233,-5798,-2395,1329,-4060,8756,-2019,2821,-1632,7631,1036,3508,7793,-1418,-8148,-271,4031,15,9354,6322,-234,-3588,-8337,-1943,5474,-469,4219,-3343,-958,7922,-8247,1723,5006,6246,-2872,2312,3946,6968,7848,-4590,93,473,-6358,8093,-6701,320,5669,7304,5804,6194,2153,-3956,-5345,4522,-6197,-5173,-9098,-2599,-2308,-7338,4502,-2788,-4604,-7186,-8792,5789,8857,-6275,-5520,-5578,7917,-7625,-4444,-8405,82,-9808,8784,640,-2720,5079,3869,9670,6354,-7024,9538,8072,-3849,-1676,-6606,278,-4018,6956,-4041,-9809,-1783,-9974,6224,-6397,7395,-6454,-2526,-5559,-6677,5963,-4226,2315,-3842,-3126,-7735,1980,5964,1638,7636,6357,-279,-4992,-5550,6317,-8036,3319,5263,4101,-7818,-6598,4665,-7598,2219,-9538,6058,-4224,7678,-7015,-8902,1268,3034,-6463,1480,-9287,-3237,-4131,-7974,1125,-8979,-1995,7231,-7853,8329,-1172,-1615,3982,7572,6802,6624,-2403,7838,-9396,35,-753,-5919,-9078,6716,-6290,3159,130,-1790,3689,-7111,-9091,7213,8634,7967,-1505,8223,-8874,-5112,-2323,6954,8189,6324,5812,-1853,-7745,3269,2136,4247,1458,7029,-8766,9160,-5325,-8159,-9696,-9883,7737,-3458,-8491,-6056,-621,6492,-2670,-7775,4158,-2661,-7074,-1497,2040,-7816,6946,2693,-1874,-9613,-9628,9520,1700,6149,-4220,-6513,7926,-2414,2651,4831,-8408,-4158,7385,-6905,-5923,-6987,-891,820,6383,-6876,-2234,5538,7190,-1765,-8518,4669,2079,-4647,-7293,-9699,3337,-6275,-2784,-8765,7537,-1957,-4864,1973,9997,-669,9396,-5685,404,-3604,6880,-9650,-6754,-3005,-7303,-3335,-7012,2003,2000,-8780,5624,-7389,1176,4647,8451,-9587,7755,-985,4762,9888,-2766,4031,7538,-3437,2534,-1385,-5759,304,6956,-3336,7895,9169,-4312,-271,-7152,4497,-9968,8503,-5789,7649,-7878,3727,5580,-9977,-2005,-986,8406,5912,-5701,-2151,-1642,8870,-9982,-1333,-8754,8038,9395,1698,25,-5706,3549,4786,-4509,5897,-2419,6328,-4635,-8828,-2897,-2165,-9478,5948,6144,-9073,-6798,-3674,2286,9531,-6470,4040,4324,6217,3886,8732,2982,81,-6830,848,-1164,-2160,6642,9421,-1364,4459,4597,-8814,-1159,7137,4004,7665,6786,-8703,2405,-4210,-8801,-1936,-8475,-52,5046,7551,5055,8232,-9453,7916,4172,-6490,1603,3892,-555,3756,5648,-5590,4490,1550,4708,3513,8489,-1857,8674,-4433,9169,-3108,3123,2689,8170,6524,-458,-6997,-2248,-1941,-3245,-5448,7043,-1439,-8069,-9215,6826,6595,7965,7526,-3135,-6793,2394,-234,8676,-8,-3395,6132,-1941,2217,349,-5209,7085,-5814,-7810,3604,4967,5532,-5760,-9793,3837,5337,2766,9267,5628,8058,1390,-312,8071,-6046,496,8554,6025,-4147,3322,-225,-2122,-9892,901,-6603,-1572,8105,4054,-1830,962,6858,975,-9411,-9051,-7919,6356,-8365,-2070,-4627,-5930,5433,-9446,-2560,2742,2987,-7283,9984,-76,1172,9506,3708,-3247,-7314,-8427,-9835,-8658,-4010,-8028,1956,7038,8564,3753,-6395,-7243,-1036,745,-8643,-5369,-615,-5771,-1656,-6298,7827,9527,7479,4825,2669,-947,6707,-635,6389,-3915,-5144,6972,6498,3992,3162,-4848,-4921,2808,9425,-2976,1455,-5833,-2386,237,-1521,7446,-2185,5417,7738,1061,4014,-4690,5828,9187,-2500,-9695,7865,-7188,3225,7434,8869,3336,-36,-3370,4032,-3833,9345,2912,-4008,492,-8249,-3722,2017,7467,-9241,-6155,3489,-6354,1234,-8744,183,-3264,-2229,4993,247,6797,-4763,4013,2188,-4837,9432,-1745,20,-3324,-9673,-8218,3362,-265,7806,8563,8257,5960,8230,-9092,-7211,-4109,5221,-2329,-9088,7602,8759,369,-4551,-2745,-8476,685,-4743,-2417,-1938,-7818,8230,6977,-3749,7672,-9545,-6081,-5668,8064,-6004,-4625,-8992,7223,-3879,7671,9003,5227,2498,8522,5034,5849,6901,-2086,-6262,-6077,-8892,-6548,8579,-736,-6054,4204,-9389,-8438,3239,-8943,-1489,-1461,-6750,2163,-2291,-728,-7842,-1127,5838,-5837,-3191,-204,-8510,8353,8810,3801,4031,1918,-3461,7102,1387,-7838,-2508,-7309,1684,8856,3320,-1395,-4165,-4992,9022,8898,4735,-5924,1162,-703,-3105,8821,-6139,-1329,7469,-7398,585,4392,1924,2119,-4485,-2985,6168,4751,-2827,-5991,6019,7029,-910,-7204,-4163,708,1867,-8948,6682,-7459,9286,-5318,2156,8154,-5774,-1437,1356,5839,4205,-5838,3186,-7122,3181,-5117,-8087,60,5145,-2395,8636,1686,2968,5466,1937,-8659,6299,9189,-7444,-476,-4463,-4616,5962,7167,6461,-5050,-9989,9619,5085,-3658,-379,-4966,-4040,9050,-8911,-3937,-8491,8672,3044,-5638,328,-4385,1483,-3080,8295,6233,8414,4865,-4490,-92,2963,-4468,6771,4358,9818,-1892,-7319,6367,5252,2797,3255,3317,-7390,8620,-4726,-5831,-5485,-4185,-5832,9457,5115,9192,2427,8896,2138,-8208,-7191,-8450,-3266,-2525,8408,-3642,3467,-4728,140,-6655,3179,5022,2511,-2406,4835,-404,-5443,9071,-4532,-7501,6158,-9948,306,-6440,-5531,-6029,-8360,3676,-8583,7332,-3506,7078,-8757,-9665,-3469,-7650,255,5074,497,-5675,2315,-9864,2446,-835,-7220,4682,2448,-9013,4301,-2503,4673,1193,6366,-3886,-8680,-8312,-3326,-7939,9871,182,-3857,6993,5867,-9053,-4327,9488,-8811,2937,2396,8303,-3199,-5982,4677,-3285,-2859,-9285,9994,6748,3250,1526,-9128,5309,2559,-2193,8982,-8962,-7677,-4841,-5420,-2729,-5446,-5609,3996,6456,3924,-9262,-5332,1466,9923,5831,1320,622,4439,-9019,8458,-6032,628,-9250,-847,-4214,7428,2133,7270,3852,4339,-9500,-1893,-2618,-6911,4856,-6145,-3751,3505,-1110,9388,-8729,-2135,-148,5664,1407,-9772,1177,-5711,2288,9094,-1509,5105,6490,-5399,7555,-8216,-6656,-2235,-4995,4242,4407,-1300,-9918,4754,6620,-4011,-7448,4268,2229,6535,1462,-3870,3458,-7659,-3793,9334,-7560,-3848,7731,4885,8358,-8712,-5236,-4789,-2178,-8346,-5140,5053,-6368,-9674,-5729,633,-4152,4210,-2141,5328,-282,1023,-4746,-4726,-270,4632,861,-3546,-5003,-8909,1707,-9562,8335,-8342,5700,2002,4801,-8783,-563,-1945,-1951,-8562,-4618,2878,9459,-7487,-6109,2396,-475,-3493,-3154,2559,-3084,3630,-3177,6803,3781,-7452,8070,9124,4686,265,-1175,-9765,-2986,9305,7678,6818,1135,-8917,-2867,556,9117,8191,-471,-5909,9994,-3847,2377,9843,-9089,-1067,-7673,-5654,-450,-7983,-2375,-6953,-3566,4586,-8012,-7485,202,5750,-5870,-8802,-6722,-2651,-4665,7627,-8010,355,8467,-8793,-7427,3128,-947,-3832,-9086,-9989,5080,-277,3140,4016,4281,-290,-6650,-9281,8135,-3883,-546,2546,-9273,-4394,4779,1484,4909,6338,-1254,-8181,-9316,755,6050,-1162,5149,6799,-1415,4109,-5873,2517,-2474,-8760,-1873,-2459,-9898,-7827,9255,-9615,-6467,-4012,4668,-1463,1099,2926,7885,-8933,1478,4119,-5044,8804,-4309,2720,-1280,1358,-4081,4712,5780,-573,6071,935,-9637,7969,-5062,-3462,-7789,-6398,5768,-4259,6730,-5545,2393,7162,-4806,-8507,1930,4499,-3908,9730,9737,3063,5142,-8552,-9895,-7924,3648,3441,-4688,-8639,-3337,9842,-6038,-8295,-438,-4684,-5780,6422,-8602,-5687,-5046,5219,1655,1529,1607,-5866,-2563,4978,4055,-7628,-644,1979,9090,7424,8608,4795,2065,9814,-9358,-3999,5243,-855,-3215,-2573,5174,-4500,6977,6296,-4949,-7740,-7701,-7532,8900,-4890,-9269,-641,-9485,2186,8714,-1454,-2233,-2191,3359,-2247,-7480,7833,-2821,-2569,6021,2053,7030,-4008,5304,6855,7226,965,-8865,-2842,1840,-1565,4694,2161,1814,3450,9457,57,-8664,3952,-4461,-6529,-2488,-2441,5436,-8873,6291,-6438,-7052,-4101,-8336,9295,6695,2499,-1314,-3741,-1450,9106,-2559,9126,4522,9386,-8168,-6114,4122,1830,696,-7942,-2875,2361,2980,7964,6772,-1228,6257,-4592,5994,2779,883,-299,2074,6946,20,-2744,-4376,-4977,-7836,-4604,-8172,9344,-8207,-9410,-2361,8982,-503,-918,-5415,-7198,-6132,1700,-9773,5082,-3387,-7064,1034,-8955,-8143,-577,5702,5474,-9932,9181,1247,-3841,-4512,323,-5932,6415,5558,3165,-2007,-1622,6259,4985,-4602,9232,-8707,5980,7559,9608,-743,-4606,9972,7994,9924,9256,7876,-1116,-2392,-4638,2306,-528,-5247,-5793,-8315,9060,-1953,-3105,-4737,-6943,1558,-8267,-2091,-3157,5273,-2402,5556,-1033,-328,4876,-6345,7020,5326,-6518,3282,-834,5431,3350,4513,-3207,6259,-5065,572,-2169,-9098,9,5353,-2278,6758,847,9999,6618,6362,-1761,5177,-8969,-4304,1101,9428,-1597,1469,-6347,6373,6679,-7064,1200,-1349,-299,-437,1074,-6423,-312,477,-9931,2614,-613,9727,3456,7350,9660,9199,-7009,-4141,9249,1836,6221,8808,6991,1570,-1281,7795,-6934,-1081,4410,8496,-1173,-6939,-2815,9380,-2837,-5087,-2631,8663,5759,1209,8929,2248,6257,8592,854,-4940,-832,-1397,-6502,3601,1610,7089,4074,3501,-7741,-3046,1335,-4573,2848,-2658,-5753,4438,-924,2099,6848,-6765,-3034,1402,7484,-317,-7676,-9565,2550,2647,-9527,-4670,3736,-1745,-6779,5845,-7770,200,6179,-9415,-2731,-3988,-3667,-3756,-8478,1646,4782,8476,5834,8128,-2994,4216,6116,-5885,-5044,712,-7978,-6671,-2218,1541,5985,-3751,-1356,7924,8020,8428,-3828,-813,-6965,-7363,9750,2362,244,-7863,5568,-1187,-1673,-5869,-5955,-7119,4881,4461,-8853,-1366,9557,-3112,-3142,1992,-7350,6135,-5539,866,3343,2515,1792,9168,-5453,6255,-5500,2422,6287,-5466,4240,-4534,5077,-771,1192,-4113,-9830,1523,-9174,8948,1718,-5127,-5418,2887,5684,7370,-1067,9614,84,-7835,7223,3360,7618,6827,1861,5259,2047,1520,-6943,5470,6397,-9321,9930,4357,2152,-5578,-4874,-7086,6049,6928,7734,-4753,-7865,-8377,2481,7866,-5006,6388,605,3973,-6980,7356,1600,-9797,-5865,-7555,-4369,7584,-7540,3845,1321,6806,8269,-2096,-5345,-2156,6842,-7006,-7969,9812,-4848,-1306,-1697,4063,-3153,-7841,-6021,-5064,5462,1887,-5244,-8918,2258,-708,-2020,4335,-1254,-1214,3962,-5025,-376,9057,4008,3956,-3863,9807,-4294,-3422,-3198,6677,-1487,-3071,-6573,-9543,-9367,-8742,6542,8211,-7364,1624,3368,1177,2100,-9211,4748,2584,1454,-8090,8948,763,2376,-8972,9608,9326,6999,7432,4519,732,-9213,9912,5999,1114,-8693,4621,9447,6262,-684,-9746,-7588,-3083,-2425,8294,4674,617,4959,-8195,1088,-5515,-2381,7241,3270,-8316,992,-9367,-9103,-8393,6049,-8313,8318,-8834,-2311,430,-3157,4459,5709,-7364,132,-7668,3577,5843,-267,8008,-3585,7114,4232,-3683,8714,1687,-1228,7201,-8369,7918,3546,8250,-2412,-5756,2072,1927,4209,-9643,-257,-991,6369,3897,9865,4274,-9000,1180,2807,9313,2482,5838,-6333,3450,9355,8520,2894,5218,157,-6780,-7133,669,-6485,-4140,2721,-4161,5491,3746,-1866,-7500,-5291,-8149,-2706,1979,-4851,-1333,-4156,6664,-263,47,-9113,-2197,4683,6472,5560,6206,2207,5514,-27,-3013,7904,-3765,6254,-9244,7308,-1005,-4896,6753,-7805,9782,-7200,794,-6272,-7605,-491,699,-8425,5071,-3222,-6286,-4126,-3220,2790,5601,-2938,-9660,-6723,8807,361,-1874,-3772,-8802,-421,-6630,-6782,-6247,1872,8240,-367,6915,918,-1951,-8913,7352,-6906,3975,-2048,6237,-505,1784,-9578,1063,9428,-4746,5218,-4475,-5990,-956,-4203,-3633,6740,7010,7878,-7451,-2957,-4530,-2113,8643,-6169,-1945,1737,5256,-1365,2279,3039,2374,-1813,-8990,-8284,6849,8203,5633,-2656,-2388,-9724,-6256,4710,-8338,-1893,5311,-5287,-3238,-2730,5868,-5856,19,1935,8396,3350,9966,-7570,8100,-5295,-4578,7070,8756,-6083,438,-4351,-4844,9396,-6255,-3244,784,8949,8943,1216,-9992,-8589,-246,3343,9997,-1053,694,-3737,-2491,-162,-3501,9198,6683,-7797,5637,7575,-8826,-9452,601,-1722,-4952,8367,7094,-1266,-9488,-900,-4277,-8992,7760,6396,207,-9844,-7608,-7304,-9508,2936,-373,-6003,9352,-4426,5003,3711,-2646,5835,-7152,5528,-1772,-746,-1095,-1542,-6134,-494,1356,-2092,-9855,-7843,-3275,8541,728,-2295,-9285,7901,-4904,-7961,-2101,6658,7018,-4243,9536,8893,9940,-6085,-364,5621,-3832,901,-2592,-4593,8454,-1903,-4230,1157,3787,-1167,-8268,533,-2399,3781,6706,5016,9970,5832,3529,5357,-6110,4909,-8553,-6812,9074,-968,-5316,-588,-2286,8286,-8594,9471,8454,4237,-4016,3656,3658,-6221,5760,-8395,588,2166,-876,-3533,-9989,-1473,5514,43,-4092,9162,-245,951,4776,-4331,6633,8061,7422,-9966,-5383,5416,-5061,3387,17,3759,-6091,-1728,5820,-2876,-2165,-3203,-2417,-6843,-9891,3205,-3978,-4223,-8398,5726,6747,6873,7829,-3197,-7049,9408,6748,-8085,337,-78,-8122,6846,-7477,-2395,3602,-6511,-6114,-3627,1237,-8771,-5424,-8364,-7415,6593,4294,2763,-7988,3246,8107,-3766,-1684,-603,-2332,-9971,6423,-2848,2141,-4623,5607,1197,7448,7237,-7458,2822,7183,-4283,2013,-7482,353,-1693,5704,-4998,-4383,7773,-7414,-5888,2417,9786,-8508,6,6624,-8615,6152,-1880,-4980,758,-1063,1418,7237,2507,-7521,3461,2313,1105,-9118,5599,-8042,-8383,-1444,-717,2444,-599,-4030,8702,-2355,-2484,7364,-4101,-5485,-5236,4734,6101,8274,-2600,1152,-1123,5221,8392,-910,199,8107,-8597,-7710,5223,2,-8403,5014,-8178,-850,2467,5140,-9385,9385,5040,-3171,8454,-465,2992,-4296,2212,3629,4402,-64,2350,-9857,3514,-2469,-4390,7732,4276,6231,-5230,-4550,-8870,738,-549,-1010,7605,-7490,6560,-2742,-4422,-6582,-5242,-2492,-6950,395,5910,-5604,-3421,6842,7346,4526,-92,5734,-4253,8992,-581,-6041,2762,-7255,6557,-3505,-3087,5235,-8831,-6888,8458,6398,-9666,-1674,8663,-4193,7367,2452,-392,-5830,-8384,8213,-5279,-8739,1009,-7112,-6794,-5438,-8936,-66,7432,-7931,1615,416,-5623,-4743,6170,-4359,9131,8455,-7970,-1676,-3971,9180,8649,764,9185,3682,-702,-5373,-9285,-4040,901,9044,-1582,4437,4774,-2503,5748,141,2881,-9620,-2044,1085,3733,936,9483,7896,-2117,-7793,-5546,2872,-9508,3713,7500,-1292,-2676,1256,2375,-7199,-8751,-4865,2027,7451,-4977,-4604,2544,39,8862,3629,-6048,6770,-3015,-2734,951,7427,-4118,5671,2685,6369,8163,1494,-8098,-9162,3277,-701,-8547,8340,-1063,-9182,-2383,9790,313,-4727,-7410,-7128,-9622,-1339,4035,382,-322,-1250,3526,7220,3025,-7791,5593,-270,-441,-3714,-7320,-9900,-6360,5686,5820,7557,1331,-7126,-3221,4488,4533,4795,-1357,8255,9759,-3331,-7440,5984,2522,-7073,809,4458,9879,4217,1192,2807,-1312,-939,-7995,6383,9284,7557,-8640,-9315,-539,-5945,9919,4036,7587,1316,-1303,5598,3997,3931,-3111,-4712,1154,-8562,1967,-598,-1060,-4704,9876,-1230,-2411,3400,5425,8881,5402,-5662,443,372,-766,5137,-8596,1957,9940,243,-9445,-7822,-2841,5180,-7258,-9045,-3620,-5749,5691,-9084,-3355,-395,-2053,3634,729,-9995,87,-9860,-7528,-6223,7759,-8978,5811,4689,-9487,-892,6846,-1053,-4411,1279,7523,-9930,-7024,-5860,-4669,1400,7355,-5834,6027,7378,1802,-2197,7981,14,2819,-9143,-4934,-5212,-7623,1593,-7876,-3030,-9765,9041,5427,1939,-7243,-3046,-979,4324,8484,-5233,8850,-962,8811,-3756,9712,2487,7897,-8995,-3765,-9605,-5052,1155,7857,5858,-2171,-132,5491,7147,-96,5874,-2848,-6086,8108,4721,-2629,6864,-8690,-6470,-5805,-6393,-4653,2951,-1040,6239,-1791,-7170,-4278,-361,-4796,6843,-8550,3918,340,-372,8138,-7062,-173,-1954,-5030,-7128,2807,5230,8407,-6911,7288,9400,-6524,1131,3618,-6351,-6278,4315,-9383,-7572,1322,-2659,-6200,4644,1941,9994,-1299,-6972,7107,8048,5442,-5514,6661,-6947,-997,2538,627,5432,2297,-6717,-6626,-2163,7393,8706,-2109,227,6575,9449,4736,-1579,4700,1018,-5753,8408,-1318,7521,4706,-8383,-1684,-5185,-5397,66,9902,-8672,-6110,2209,9662,6632,8062,106,-9331,7365,4273,-6260,2922,6924,-4001,822,-2827,-2936,-3416,4271,-5355,-3035,-8149,-6883,-7714,682,-3857,-7015,9781,9505,5560,-3158,721,-6991,3831,3048,9223,8961,1519,-2661,5477,-5159,-280,-5090,-7108,-2613,-771,-4557,9867,5515,341,4983,3889,1663,854,8580,5447,1925,-8754,7915,-487,7802,7029,182,6669,7421,3379,-4435,284,-363,1206,6858,-2498,-3711,-5249,-2007,7737,-6943,-6499,-603,4771,-5527,-7981,2853,-3467,2133,1685,8323,6415,3966,410,1441,-5317,693,-6280,2924,4710,-5007,-2840,-6373,-6831,-3750,8555,-7376,-457,8038,2575,66,6110,358,-4959,-3183,-5896,5596,3075,1984,-7583,-7396,-2604,9095,-3163,2660,-1574,-2291,-5218,-6362,3831,4576,-2870,6144,-7860,723,-1585,2732,-1673,-4378,-3162,996,-8698,3867,7043,-6670,482,8536,-4749,9271,5103,-5726,-2939,-6791,1814,5941,-8339,6385,-1509,7473,8285,-6875,-9690,8481,4661,6376,-1379,5327,-9126,-478,-3453,7393,5008,-9699,-4501,-133,-7383,7580,-5092,-8236,3770,-5872,7085,-5450,395,6260,-5455,-4893,6154,-6929,-9271,-4173,-8807,-9445,-4893,5558,5556,-6447,-3535,5782,804,5903,846,1057,-6653,6926,7639,-2554,4702,-306,3751,-5198,-780,1142,7032,-5187,-5624,-2514,5320,2046,5347,5954,8271,1020,3007,-2034,-1661,-3793,-3227,-7398,-4066,-392,5056,5832,615,-1930,2302,-4604,-6785,6727,2768,-4775,7838,1369,-5405,9307,7973,-2611,-2774,-8765,5512,9902,2667,-7569,-7883,9964,9397,-4392,-9070,-7689,-1417,-8952,-1962,5890,-2297,3020,7118,7706,-2366,-9333,5347,-3747,7875,-4954,-1444,-6804,8112,-4899,6772,-1447,-8089,6164,3888,3178,-364,8237,-8138,9037,8071,5423,9062,5506,2508,9793,7151,8032,-121,2499,-6086,-6945,9536,7855,8546,5325,-5506,1424,-7027,1973,7812,-1743,-9957,-9380,8093,5935,-803,-1349,-538,9520,6804,7899,-788,-8780,-8588,2753,-9469,-4678,-4541,2109,4528,-9328,2442,261,-8566,-1658,8048,7327,1927,-2240,-194,-4743,3851,8258,-6910,7767,-7105,-9208,-7792,8441,7919,6142,-5360,9505,-519,3563,1388,-5618,8840,-9872,-652,2166,-3807,-4900,-7868,-7583,-2014,-4873,-4588,3977,2084,2328,2415,-1558,-5642,4102,6164,7027,-7493,-5715,-3599,5386,7551,-7232,6672,8235,-9265,-561,8057,1067,9112,7203,-1203,8512,-3904,4886,-5560,-7796,7720,3310,6311,-1266,-8620,2004,-2951,4811,-8140,-6889,-5504,7850,7210,5386,5939,-9987,-2182,-5599,-8002,6011,5973,-2711,-783,-1561,1697,9974,6234,-3537,4938,-604,9761,-2089,-3495,7023,8759,-4974,3903,5923,-3728,9277,3534,-7765,7490,-4242,-1630,-9457,499,1190,2354,-4095,-3157,-8278,-2615,7766,7001,-4885,9858,1689,-4016,-8896,6407,6737,1840,7557,7442,-4415,-9252,1234,-4942,8912,-9952,-7590,1282,-338,-1434,821,-6576,3418,996,4210,-9275,-2814,8760,-7114,-6715,-1092,-4330,-7691,-2510,-8667,-9847,7883,8487,-9268,418,5042,3054,-7748,-3475,6470,-7041,4381,-7632,4253,6363,-1113,-4808,4300,-908,-9746,3787,551,-1454,5925,6344,-4596,7028,-3195,6555,-2712,581,-2126,4183,-1319,4050,-2292,8915,-7277,8212,1661,9238,915,-9145,-6966,-9499,8466,7152,-6758,-5087,7980,1118,-9038,542,-8153,-7304,-1095,-5933,-2376,3758,55,-3487,5664,5890,-3652,6380,4547,-896,-2023,-9008,4816,-7674,-6637,4194,-929,-3569,-2512,-9766,-1049,-5454,6301,3025,-2819,-9168,-8253,-7615,8756,6049,-7736,-5671,4682,-1826,3030,-9137,478,-2300,-5854,4236,-8748,-8425,-3241,6002,1702,3673,-4690,793,6311,9412,-2411,-7712,4952,973,6133,-2433,1343,6412,-2947,-3030,9780,-8190,8276,-3604,-9970,-5096,301,9711,-745,-1513,-9310,6595,-4274,-643,8720,-3063,3355,-5394,9819,1159,8905,7133,9296,-1413,-4688,4216,-7625,-8424,4978,9671,3851,1706,1077,2263,-9998,4332,9980,4500,-5839,8886,1544,5016,-6366,-5511,-9273,-9877,7607,-974,6891,3847,7843,6896,8834,7334,-8037,-7032,-1491,-6661,-5523,5373,958,4257,4559,-3999,6937,-8457,-7965,-2818,-3515,411,4340,5928,-6883,1230,-3173,-2600,1504,-2229,1913,-1625,9773,-4138,-3435,2186,-8620,-323,-8819,-3105,-7789,-951,-8628,-9046,4831,-2496,3617,-4238,5678,7696,-6414,-3035,7344,-1783,-2767,-8349,7913,8168,-3475,3367,-4894,7494,-6746,-8235,-851,5265,-3922,-3554,8418,2252,7170,-5023,4942,-562,-7550,3006,6617,-7469,-945,-2703,8498,5132,8708,9879,3854,6924,-3595,-3748,-4737,-2564,6287,-665,-4590,-4719,-4106,2425,1285,-9789,-3068,-9578,-9573,9546,-2096,-3787,-8436,-3034,7224,-3059,8571,-9854,-5053,-2706,534,5218,-9078,-4806,5178,4270,3433,9941,-5909,-1303,-8865,-6215,1581,6834,6180,6408,-1912,-9867,2237,7153,9210,-8753,709,-2373,-7412,-1838,-338,1058,5748,1017,-684,-6483,-9326,-5574,3529,-8320,-2954,694,-7130,-2169,7051,-1877,9090,-5807,-1156,9245,5569,3200,2540,-8384,7303,-1732,-6305,-6297,4396,-7155,-3347,-3129,666,-447,-227,8399,-6629,9673,2793,1318,-165,1766,5647,-9151,-2252,9425,6398,-7675,-8616,2174,6200,2989,9529,3126,-6830,-2989,4685,-4579,-3135,-6246,-6163,-5220,9475,7266,-3332,787,-9021,-1568,4084,-2704,-4582,9083,9586,9721,7917,-5032,-1428,-2146,747,-5890,-923,-7993,-3663,-6155,-4212,-7122,-2798,-7565,-7544,-2064,2738,-5550,-9807,1010,-3265,-4417,4298,3577,5124,8629,-5314,-1858,-640,-5470,4802,-4199,5201,-5418,-2572,6085,-7721,4488,9391,-5952,5023,-8191,-5553,7102,8800,3399,2175,1736,-2524,-4794,4974,-8270,1716,4740,-5804,-9202,2470,-6375,4796,-2023,-2495,1711,986,5961,-8570,5930,-4470,1199,-3946,9069,401,9509,-2439,-9991,9946,-2310,1780,7480,1435,2216,-3457,-1443,-7430,-1115,189,5438,-2137,-6955,-3229,-8868,4380,-6405,-5209,7446,-3622,1728,1308,-4571,-4866,8785,-601,-5569,4925,9570,907,-3798,6532,-6306,-2421,-4019,356,7583,-4327,-9186,-7448,5021,-1988,-362,8504,2193,-1344,-7393,721,-9713,-3736,4288,-7718,-8270,1378,4682,-8480,4564,7446,-4331,-9222,-5360,8922,-4319,9828,-4504,4957,-3745,8456,-593,-4602,-7905,-5003,-2098,6474,8642,2616,-4907,1219,-1919,-4639,-606,9775,-915,-7801,-9617,-2132,2267,-7078,7569,-1276,-6062,4997,5420,-3913,8757,9270,3235,-1991,8402,5246,1800,3892,2388,8461,2698,7071,8310,-1921,5777,5499,-4570,-1466,3797,-1297,-7860,5051,2933,-5314,-4185,-8627,-6399,-3216,-9349,4777,-7351,5962,-821,-8851,6933,-3708,-3581,-9894,8820,5199,9497,-5346,-2741,-3777,-9663,5676,-7484,-1894,2246,1722,3494,9846,-1665,8285,1628,5826,8285,8616,8961,-3041,9854,9720,6814,7980,-611,-4383,-3154,6807,-8110,7864,4770,-1644,3896,-4483,-2579,-1102,-6854,-2684,-9026,-3917,-9938,-5026,4818,-3498,4598,-5895,5680,-3663,1117,-6395,8395,7539,-8796,-8876,-1702,-7652,-149,-7784,8811,-2859,4543,-7867,-4211,-6097,6923,-3452,9201,2008,-6304,6825,8563,-9064,3010,2672,7465,7739,-3865,-7478,-8335,-7921,-2414,2073,7213,-8896,-8188,-6560,357,-6268,-8447,5266,2687,6037,8270,9778,-5891,-1442,6136,2954,-611,-1726,4743,3477,-5883,4558,6144,7547,-3500,-9498,5118,-7118,8816,-2603,6923,5116,-7896,-9753,3470,6012,1425,1933,8083,5641,-4039,3873,6213,4830,-3732,-1539,8324,-442,-9842,2502,-7317,9788,-3426,-4105,8231,2953,-1785,5948,-6860,-8802,-9648,-5192,-1708,-4269,6028,2808,-5834,8541,9817,-4852,-2432,-1953,6960,-569,-1750,-4332,2450,-4499,7108,305,-8357,9188,-682,-2501,-2288,5,-8271,-39,-416,-7657,-8360,-1321,-9101,4518,3454,2493,6842,-7836,-8379,1406,-1769,-1619,4313,6510,4867,834,-9648,1923,7734,9155,-1983,-57,8186,8329,-3958,-6260,-5124,-7400,4371,-5834,5198,-5438,-3704,2268,1072,7267,-7970,5922,-7364,-4850,2304,4499,-4090,-9041,-3039,-5797,6168,1965,-8252,7080,-6362,-1691,-7661,-4385,8608,-1374,-1808,-4652,5126,2925,2277,-7098,-8656,3887,1488,6181,-4629,8341,-9474,6095,-8039,8737,1193,-9148,1097,3988,-2408,8951,2458,-5620,4737,-157,-1812,7229,-7795,-348,9495,-2292,4399,6746,-4674,2425,-577,-7647,-4167,-4529,6539,-6432,3486,-1518,-3108,-5115,-3937,-8524,-4417,6833,6549,-5787,1322,-8690,3909,-2012,-1568,7260,-2303,7482,-581,6724,523,2205,-7693,952,-3841,-5540,4020,-7543,2689,-2038,-3826,-5300,2766,-4948,-1258,7366,392,6737,-5067,-559,235,-1774,-703,-7338,-1068,7350,2360,-5030,8816,-6985,-2737,-179,-3161,6988,7571,-3012,-7316,4990,-8196,-6834,-6367,-8035,-2074,-4060,-8122,-1052,4065,215,683,8806,994,7798,-849,-574,-4610,-3938,6801,-5741,-8441,-9884,7988,9995,-602,2756,4856,-550,2877,7493,-7753,-2962,8676,6444,-4740,2154,4900,-1352,-1836,7045,-5039,2120,5291,-4748,8591,3800,4115,2285,-8528,-9491,8066,4392,5024,5767,1849,3900,-3868,-7415,1858,924,-7089,9625,-8105,-3123,1541,443,5571,6681,-8190,-8312,-8868,-8406,5475,-757,4013,2784,-6078,-3352,6780,-7368,5849,-6847,5494,7041,-1459,-7184,-9745,9255,-8741,5937,7668,-8081,-7291,-5755,4009,-2355,-6698,-8502,6331,7793,4826,-5734,-2398,1595,-7684,-8841,5175,6251,-7311,2806,5955,6278,-5942,1869,-9850,9956,-7209,3052,-8413,-9127,-3061,-9359,-3661,5308,-527,8891,9522,-2186,-4173,-7356,8312,41,6238,7956,5611,-3398,7966,4177,-9287,1313,-7175,-264,-2127,1061,6148,-5392,1689,3077,-3042,-887,2499,-7615,-5741,3112,-426,-1963,9033,2156,2120,-1688,1693,8924,2180,8811,691,1677,7447,7951,254,9099,-5635,8544,-7571,-4253,2513,-7840,590,7933,-4770,718,-5749,9433,-3474,7199,-4169,6058,6709,-7498,9196,-8079,7981,-4147,3468,1086,-2673,-5426,-2031,2122,-3880,5793,7389,276,-2656,-2541,3268,9269,-5205,8821,-5701,9507,3866,7329,-104,8007,6711,-1872,-4369,3300,-9923,-3131,-5642,-2141,-6059,4766,2714,1202,-2023,-3026,-8949,5140,-7896,850,-7002,-2350,-2884,7642,-6193,-1158,174,-254,-9037,-1226,4106,-6130,4043,6468,-8439,-7509,-8754,8486,-5277,-7166,-9216,6127,-6436,-3466,9067,-4074,1203,2476,-4864,2114,1825,9775,6066,-8916,-9582,6428,7183,-6224,8459,2177,4332,-5804,2180,7142,3280,-2167,-5055,2001,6645,4049,2261,-3965,5131,5822,-5412,5242,2922,728,8158,-7227,3623,-991,-1892,2858,7718,-8267,-2591,-3045,3620,-8522,5185,9434,5575,669,8476,4127,-5659,7871,6180,-9991,-4966,-7519,-3226,5010,-7393,6247,-9012,-595,9769,-2125,-8692,9130,8312,3491,-8632,-7233,3458,9745,-3675,8862,-5519,3866,7245,8976,-3963,6444,-5686,528,821,1743,-6276,-5283,-3295,661,-9961,8396,-4028,3159,5816,-8610,739,-8397,-3582,6075,-9741,7435,9651,-4384,8618,160,-383,1011,6815,898,-992,-1918,1016,-6188,2603,9329,-5056,5706,8042,-384,8899,6731,9799,4932,-344,-6787,9347,1306,-1437,-8574,-2335,-3647,4793,-6514,2317,-5645,-2039,-591,-2280,-8906,-6197,841,-5765,-5558,9629,3736,-930,-1292,3683,-8740,4958,7588,-8194,3737,-7414,4288,-3146,5334,3162,1771,-3600,-4792,6861,-4923,4103,-272,-2894,-585,6122,7892,3193,9749,-4848,173,2660,5360,9728,-959,519,-4138,2972,-3827,3897,-8408,-1813,-411,3591,-1245,8549,-5440,-992,3286,-7600,8724,-1967,-6704,831,-2387,5744,-5819,120,-8091,-7904,4923,-92,-1814,-9711,2808,659,-5131,47,9812,-8977,-5550,2744,-4682,4211,8380,4847,8710,8347,-5657,-622,5080,-6529,-3276,6003,-5245,3338,5382,2548,7749,-3484,-8337,1214,-7684,3822,-7351,-1027,-7789,-7129,-7160,-3304,5628,962,9582,-5400,-4097,3928,1230,-7893,-5848,-4607,1856,-7303,-4736,3810,5266,8964,9802,-6581,6597,3980,-403,4954,8971,9184,3363,-3657,-7686,3727,-4083,2055,-7683,927,3186,6118,-6750,-934,-5494,7569,-4222,-6342,243,-978,9712,380,7631,-9120,2956,3241,9489,-2888,6548,-7586,-9758,-2429,9206,-2464,-2440,-5080,6001,-5170,-4050,3970,-8986,8891,733,-9390,-5904,1695,-5279,8635,-9624,903,8981,-7873,3790,-6570,-7040,7672,-7086,-8441,-7848,-8781,-753,-1590,5935,-7316,9118,6535,-9946,7283,7982,2277,-8700,8699,3431,-7401,244,-3883,3358,-6123,654,-1862,8919,-2846,4436,7091,328,-4913,5882,-7294,-3838,9503,6849,-5605,-7807,7589,6070,-7199,-465,8541,-9041,4825,-442,701,-4665,-5452,8239,-3648,5646,-4577,9041,2859,3739,-6685,2905,5687,6210,1851,5670,4584,-8557,-7215,-8163,-8736,2932,9432,4766,6099,3467,-3730,-7198,-8486,1668,7252,4638,4605,3921,6823,3594,5380,6951,-1013,-5279,-6050,2122,7547,4521,3878,9055,-3932,-9594,592,6337,-1781,4718,1264,-6799,-7673,-9544,-8896,9796,4772,-9127,-3326,-8558,3465,-7875,3373,9360,8178,-5628,-2354,-7240,-1251,-6206,7086,-1942,7947,8496,139,7016,-9847,9709,3382,-1829,7069,-4023,9756,1536,-3911,2186,1088,-3880,-6901,-4557,-1332,-2771,6823,-6362,-8859,9416,-1714,-9049,-3718,8403,4824,9018,-2435,250,-9365,4068,8610,3103,-9945,-4204,-6545,-8124,-2914,8357,-2634,-9039,-6212,6736,-7749,-3227,2670,2844,-1437,-307,7818,6326,-1856,5754,8499,-7227,9016,1907,258,9607,290,-4193,1670,-6031,3944,7544,-3381,-5289,2132,-7403,-9017,4315,-1345,-2169,-9786,6711,-5758,-2301,9512,-2077,3939,967,4235,3586,-1492,4162,-371,-2281,-4674,-2464,-3872,-9221,-1723,-8367,-9150,-8749,-4291,-7268,1813,-14,6934,-383,6609,-4836,4851,8822,-1813,-5911,-6666,9802,8431,-7711,-4809,-7428,-6570,438,-2977,8735,-1060,-1367,6631,-1582,-7751,-5150,-949,2928,-453,-2882,-6099,-7107,1472,-2976,-2676,7274,-8080,-4615,-6512,4256,5693,6077,9214,2975,-3626,-4762,470,3271,-6615,-4004,-4368,-6903,1606,1787,5664,-9340,9065,-3511,7320,5892,6160,4003,-290,-7094,5566,-1347,2974,7299,3725,-7659,-6556,-7231,2933,-5222,936,4469,-1158,2249,-2290,-6673,-2832,6463,3894,658,8042,9621,-7718,-4156,8358,-8694,564,1662,-3814,3458,-427,4224,9437,9245,9791,-6312,2037,8178,5516,9545,-7755,3392,2349,-3382,2138,4827,7191,2195,-8884,9895,-8529,7424,-8377,-6622,-695,-248,8143,-384,-8118,5535,-4935,-907,3642,-4615,-722,-9221,4804,7228,3936,-9910,9445,-8596,-3858,8599,-4403,-6302,-8280,428,8843,-2139,-9281,227,-5384,-9273,7426,7489,9529,-9082,6083,-8632,-7787,5201,-8845,-7899,158,3738,2667,-1448,6382,1569,6949,5279,5901,-5885,4626,-4656,8428,9780,-9447,2561,-8671,-6731,-3431,4391,-5100,-8841,-7316,-157,6504,-7426,8558,-4924,5822,6018,-7804,529,-1300,-9563,6981,3751,-2005,4624,9393,5249,-3079,7248,-2675,4625,1858,3882,-8901,753,-1493,6053,4766,7791,-1019,1489,-7675,1310,-3600,-6842,4129,-8330,9241,-8692,-9110,6862,-1091,8423,5907,5705,-2164,3426,-715,-2292,-2956,1998,1678,-5851,-1084,4757,-4606,3089,-7339,-6432,341,-6838,6142,9043,-3924,-5222,5125,9923,2658,1416,41,8963,5416,5867,-6999,8977,-9232,2277,6837,-9175,-2058,9453,-140,-6223,5908,-6933,2091,-8075,8240,9210,-5619,6342,8167,-6204,7267,-8241,-5159,-4496,-2306,-9190,-7323,7580,-4806,-1389,1859,-8372,8755,290,3907,-1805,-5277,-465,-9280,85,-2941,8942,-1116,-6143,1540,-6163,8039,9672,7916,-9406,1547,-7150,-4073,-3918,1877,-2407,-1321,6163,630,-311,-6082,669,8724,6521,-4878,-8473,2679,-7739,-4612,-7486,2067,-6856,2021,1951,-3308,-2960,-3755,8214,9888,1400,5983,-4309,-1244,-5168,-2891,-9204,5144,-3202,8211,-9168,2796,-3746,7966,-447,2702,-3804,3762,-1697,7496,8798,450,1436,-8948,-1341,-9967,3372,4099,6797,-4243,6725,-5004,-3856,-3060,-3615,3031,9539,3328,-7797,6755,-3961,4159,1006,3357,4339,-5203,795,2491,7227,6911,8996,6844,-6346,5838,5991,4043,-1812,-5085,-7983,-8937,6241,7842,-9779,-6040,-3938,-6478,-3262,-4148,8565,151,4783,1353,-3097,-4153,-2170,4749,-4919,-3547,9063,-4966,8985,6394,-8291,-9011,7459,9756,3555,-7153,-9625,-9708,956,4385,-859,-4078,-9968,1017,-3483,148,-3719,-8734,2615,-5663,8592,3384,5276,7911,7155,1769,-5851,-7637,-7735,2298,-9374,-5417,-7504,-3098,9194,5362,-9820,-6527,4644,-9813,2211,-4266,-7826,-5704,4034,6545,407,-5767,4105,1748,-8869,9117,6632,3357,-7602,8239,898,-434,4168,-2105,-3881,8414,-8161,8825,9073,3912,-5447,8617,-4990,-9873,4654,-8771,-3585,7063,7681,2072,1743,1699,8199,-4413,2785,1042,7138,-4045,8250,5761,9946,5854,-6428,1599,-9611,872,-7606,-7381,2919,-1537,7131,1010,-1386,-2129,7506,9520,8311,8721,-656,4170,2275,8424,-2195,9971,-9780,7987,-8502,-915,4892,-7514,8070,-5298,-9769,-6103,3237,9455,5569,4080,8484,-5369,337,132,-3742,7641,1191,7397,-1393,6488,439,-5165,9061,-4137,8625,3589,-3079,726,-7892,4212,-4468,-5918,7104,4823,-5931,-8066,-2911,-7400,-5257,-1990,-1488,3558,-8128,-3537,1632,-3699,-6779,2329,6695,6706,1374,-7458,2565,-2448,-1713,-8962,1950,6058,-1069,8758,2445,-4794,-6809,7216,1958,-5808,-2262,-3334,6124,-3127,-2724,-5851,6129,2894,7691,-2178,-5907,3716,7776,-7971,-5438,-3314,7670,-6847,-1329,8930,-876,1551,9468,9488,3298,-5989,1775,4588,-1838,-9117,6182,4605,3147,-4323,5522,93,-2925,-5707,3675,-9462,5561,-742,-1212,503,-5376,-8536,7881,2463,8184,5408,2917,9321,7764,9375,-8907,851,-1859,9660,9615,-8835,-2173,820,7885,-4899,8836,-4467,4380,-1222,8625,7069,998,-782,4132,611,4267,-9100,2412,1104,205,-4926,-6190,-3087,-5306,2173,-862,9674,-7379,-8726,-1396,2652,7291,-1204,-1207,-8242,-3736,-3790,337,2980,-6043,602,7472,-705,-4588,-7528,3064,7721,-9739,-5635,-8172,-7460,5739,-1204,9977,8404,4964,2050,-1659,9628,3269,1520,8410,-2031,-1595,5110,-8832,9254,-5505,-6877,-1923,9513,8416,-9078,9112,-2187,-6047,-43,-4294,791,5621,-4397,-8619,-7148,-1446,-9789,-3565,2117,3625,7402,-1736,6479,6197,-6365,8019,6069,-4013,-1829,7715,2395,-3574,9263,-3716,7797,9024,-8523,8866,-5542,4338,3080,-8342,-8582,9566,318,-4524,5047,-4294,-5948,-9997,7127,7353,-3634,-8702,5125,-5825,-1157,-8712,-9158,-1742,-2916,7332,-6678,-4460,2681,-5054,-1009,-5578,2784,-3781,6397,4334,-1531,-7263,-2179,-8053,-5227,-2665,6245,6422,-2196,9351,9135,-4933,8464,-5801,5329,-6819,5355,-4043,6903,-8861,3666,-9010,6263,-7267,-6187,-4591,6567,-8180,-1818,6346,4841,629,-8611,8896,2271,9131,4351,2419,1784,217,-6603,-5208,2556,-2832,8227,5535,-8387,5524,8989,7484,-7671,-1511,-5575,9495,-8786,-928,636,2972,7151,-277,5408,5006,-5429,-4697,-573,-9078,-8494,4496,3993,-9036,8190,-2968,-1508,-1542,3202,184,1039,2497,-9878,-529,1602,4721,-8038,-7885,-2556,7859,4331,9343,585,8716,727,6156,-5759,1357,-9331,7182,-8335,5074,-4814,-2639,-6960,-2450,6014,-2280,1710,8791,298,-2430,-2263,2672,-4295,-7937,-5729,5297,3691,-6867,2637,-8929,-8894,-4850,-5988,-519,3248,5411,130,-1416,-2985,-2414,-5559,5757,193,6208,9180,-8283,-8669,6484,1372,-2313,7633,-1264,-5634,8790,6613,6709,-8819,-2759,4164,-6534,-9179,8814,9675,274,5203,-6324,9831,9732,2901,-5311,-8060,-4476,-3487,6562,611,-3956,-1316,-1059,-23,2841,8287,-2380,-4096,-9115,-2842,6276,-6297,-9973,-5000,47,-4829,-5879,5005,-4060,3989,-7147,8815,6434,-3506,-3317,6691,-3056,2200,4480,6935,-824,903,-3416,5036,-9564,6590,-953,-3676,-8283,-4363,3029,-8822,-2386,-9188,-364,-7552,-1926,-2220,4914,-210,1522,7597,-2364,-4791,-6821,-7035,-6615,3726,-8363,3435,-8092,9510,-3943,6736,7410,6940,776,-4461,7411,-4986,-116,766,3335,-2910,-794,-785,381,3058,1225,-8866,-8908,-4943,-8022,9842,-1556,-973,513,5407,-4503,832,-3461,-3557,-2135,-6668,5440,-6107,7513,-2769,5610,6684,-2282,9215,-392,-3749,3311,8523,2007,8330,3648,1464,-5111,8828,-2355,1203,1302,-710,1967,-1945,-4172,8739,-3605,5906,-6163,493,-7497,3462,4904,-8639,5673,-3174,1921,4544,-1811,8182,1117,1775,-3586,1823,9314,-7649,4713,-3248,5470,4123,-1994,-7128,-9198,-3883,-5984,7525,2911,-8746,7578,1373,1914,9931,5683,9377,-3298,-6284,-7142,2709,2106,8268,7115,-5909,836,-2808,-501,717,1344,-6632,6358,-5767,-877,-3820,1862,-8802,8229,1658,-7215,657,7128,-7666,-4970,-9790,-2890,334,-2015,8811,-4803,8419,4456,6982,-9330,-6256,-515,-2697,2053,-9375,-1896,9457,-836,966,737,3084,8105,7926,783,-8105,2763,-6266,6877,1545,3434,-5200,3202,9460,-5927,-7499,418,-6521,9606,-2200,-4095,455,2610,9190,-4036,-569,-3118,7152,-8702,-4933,6787,3393,6902,7347,1754,8714,-6546,6274,-5838,-9840,-1045,-6435,-357,321,-7923,-9746,-8072,-1758,9420,5521,7621,-7056,-1581,6495,-6563,-6837,-5588,4735,-1687,-662,1235,2663,7166,8950,9856,-671,1556,-4962,8745,9359,-3265,944,3443,-5936,-9686,3841,-6657,1256,-4013,3027,9776,-1351,9523,-9610,5636,4300,-2024,2943,1852,1429,-9971,4251,-5141,2617,2029,8266,-8443,-3955,-6419,-5544,-7119,-7255,-7793,5605,5153,-7463,-3291,-6717,6705,-6152,3620,-2681,1842,8232,-886,1747,-9671,-1724,-6184,-7475,-1462,6628,2757,-537,1240,-9894,-4765,-3053,-6173,-5690,9483,5568,7055,-393,9157,-3198,6134,7316,-9191,9773,1997,-2160,-8167,3078,6034,-1781,3884,-1800,6582,-9307,7037,7748,9733,-4242,7571,-1194,3986,-8635,6130,3509,9255,-7477,7773,-4066,418,-7302,-9003,-9924,-3693,-4086,-946,6148,-3114,-298,7113,-5503,2494,2000,-5676,-6001,8364,8041,-1843,3483,7995,3933,-5065,8667,-4077,-4759,3657,3624,-139,-7812,3130,4677,938,8309,9186,-9401,-209,7989,-9750,-844,9408,6806,-1854,3018,7855,-2115,-9753,3055,-9353,-7772,425,7878,3125,-8941,1828,-5255,7514,5660,-5160,-7262,-1168,8191,-9453,-2098,7888,-4613,-1687,5658,2658,-9377,88,-7474,9212,284,2176,-9399,8973,-5778,-6014,5013,-77,-551,2990,1064,8288,-7075,-821,5762,-4993,8278,-8016,2676,9971,-9754,6623,6479,8336,-8557,-9090,-528,-1276,-6532,-3973,977,305,8260,7298,8411,2846,446,-6943,-1566,-9504,-4224,5586,-8454,3292,-7489,-7468,-1931,-6135,-4278,-2577,4387,-2404,-4817,3736,2350,-8905,-3051,1646,5957,-1114,7146,8393,1283,-6286,7984,-5285,-7178,-7107,-7644,5407,-3238,-7693,-8183,-1114,-8183,5936,9638,4898,3218,5157,4173,-6338,-7573,1958,-9861,4750,-8269,-8031,-2602,-7480,7195,5416,9873,1094,8137,3924,2009,2711,5964,-8841,8459,-1172,-4800,-8642,-1363,3770,3986,5882,-5167,-8589,-6552,-1651,9392,-86,6179,4454,-8632,-4156,7655,-2182,-9207,-7522,-5916,-2912,-8561,-1568,-1508,-2962,1047,-3640,-7675,-5633,3510,-4562,775,-164,2906,4979,-4493,-9175,8756,7122,-2281,6692,3874,-4649,-9926,-1084,4677,5162,-1020,9561,8113,1596,-5628,8544,-9889,-3689,-7175,7378,-4342,-1184,7595,-2741,-8654,163,-7447,-5167,-4142,-6271,-487,-7941,-6942,2445,-551,3561,-3502,-7627,3111,6758,2546,5773,6226,6476,-3915,-9002,-5347,-1948,8821,-7688,6951,7060,5289,5519,9445,-7079,-9553,-4607,766,-2079,-3031,-8697,2487,-1547,-3266,4992,7790,-7599,-2580,-4791,-552,-2059,6619,7332,7155,1032,3738,-4843,6516,7763,-4344,-9049,5950,8206,2563,378,-1114}, +586, +767481, + }, + + { + []int{4, 5, 0, -2, -3, 1}, + 5, + 7, + }, + + // 可以有多个 testcase +} + +func Test_subarraysDivByK(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, subarraysDivByK(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_subarraysDivByK(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + subarraysDivByK(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0975.odd-even-jump/README.md b/Algorithms/0975.odd-even-jump/README.md new file mode 100755 index 000000000..ce1a2ba91 --- /dev/null +++ b/Algorithms/0975.odd-even-jump/README.md @@ -0,0 +1,64 @@ +# [975. Odd Even Jump](https://leetcode.com/problems/odd-even-jump/) + +You are given an integer array A. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd numbered jumps, and the (2nd, 4th, 6th, ...) jumps in the series are called even numbered jumps. + +You may from index i jump forward to index j (with i < j) in the following way: + +- During odd numbered jumps (ie. jumps 1, 3, 5, ...), you jump to the index j such that A[i] <= A[j] and A[j] is the smallest possible value. If there are multiple such indexes j, you can only jump to the smallest such index j. +- During even numbered jumps (ie. jumps 2, 4, 6, ...), you jump to the index j such that A[i] >= A[j] and A[j] is the largest possible value. If there are multiple such indexes j, you can only jump to the smallest such index j. +- (It may be the case that for some index i, there are no legal jumps.) + +A starting index is good if, starting from that index, you can reach the end of the array (index A.length - 1) by jumping some number of times (possibly 0 or more than once.) + +Return the number of good starting indexes. + +Example 1: + +```text +Input: [10,13,12,14,15] +Output: 2 +Explanation: +From starting index i = 0, we can jump to i = 2 (since A[2] is the smallest among A[1], A[2], A[3], A[4] that is greater or equal to A[0]), then we can't jump any more. +From starting index i = 1 and i = 2, we can jump to i = 3, then we can't jump any more. +From starting index i = 3, we can jump to i = 4, so we've reached the end. +From starting index i = 4, we've reached the end already. +In total, there are 2 different starting indexes (i = 3, i = 4) where we can reach the end with some number of jumps. +``` + +Example 2: + +```text +Input: [2,3,1,1,4] +Output: 3 +Explanation: +From starting index i = 0, we make jumps to i = 1, i = 2, i = 3: + +During our 1st jump (odd numbered), we first jump to i = 1 because A[1] is the smallest value in (A[1], A[2], A[3], A[4]) that is greater than or equal to A[0]. + +During our 2nd jump (even numbered), we jump from i = 1 to i = 2 because A[2] is the largest value in (A[2], A[3], A[4]) that is less than or equal to A[1]. A[3] is also the largest value, but 2 is a smaller index, so we can only jump to i = 2 and not i = 3. + +During our 3rd jump (odd numbered), we jump from i = 2 to i = 3 because A[3] is the smallest value in (A[3], A[4]) that is greater than or equal to A[2]. + +We can't jump from i = 3 to i = 4, so the starting index i = 0 is not good. + +In a similar manner, we can deduce that: +From starting index i = 1, we jump to i = 4, so we reach the end. +From starting index i = 2, we jump to i = 3, and then we can't jump anymore. +From starting index i = 3, we jump to i = 4, so we reach the end. +From starting index i = 4, we are already at the end. +In total, there are 3 different starting indexes (i = 1, i = 3, i = 4) where we can reach the end with some number of jumps. +``` + +Example 3: + +```text +Input: [5,1,3,4,2] +Output: 3 +Explanation: +We can reach the end from starting indexes 1, 2, and 4. +``` + +Note: + +- `1 <= A.length <= 20000` +- `0 <= A[i] < 100000` \ No newline at end of file diff --git a/Algorithms/0975.odd-even-jump/odd-even-jump.go b/Algorithms/0975.odd-even-jump/odd-even-jump.go new file mode 100755 index 000000000..5b853a076 --- /dev/null +++ b/Algorithms/0975.odd-even-jump/odd-even-jump.go @@ -0,0 +1,81 @@ +package problem0975 + +import "sort" + +// ref: https://leetcode.com/problems/odd-even-jump/discuss/217981/JavaC%2B%2BPython-DP-idea-Using-TreeMap-or-Stack +func oddEvenJumps(A []int) int { + size := len(A) + + indexs := make([]int, size) + for i := range indexs { + indexs[i] = i + } + + sort.Slice(indexs, func(i int, j int) bool { + if A[indexs[i]] == A[indexs[j]] { + return indexs[i] < indexs[j] + } + return A[indexs[i]] < A[indexs[j]] + }) + + nextHigher := nextIndex(indexs) + + ascToDes(A, indexs) + + nextLower := nextIndex(indexs) + + higher, lower := make([]int, size), make([]int, size) + higher[size-1], lower[size-1] = 1, 1 + for i := size - 2; i >= 0; i-- { + higher[i], lower[i] = lower[nextHigher[i]], higher[nextLower[i]] + } + return sum(higher) +} + +func nextIndex(indexs []int) []int { + size := len(indexs) + res := make([]int, size) + stack := make([]int, 0, size) + for _, j := range indexs { + for len(stack) > 0 && stack[len(stack)-1] < j { + pop := stack[len(stack)-1] + res[pop] = j + stack = stack[:len(stack)-1] + } + stack = append(stack, j) + } + return res +} + +func ascToDes(A, indexs []int) { + i, size := 0, len(A) + for i+1 < size { + if A[indexs[i]] != A[indexs[i+1]] { + i++ + continue + } + a, j := A[indexs[i]], i+1 + for j+1 < size && A[indexs[j+1]] == a { + j++ + } + reverse(indexs, i, j) + i = j + 1 + } + reverse(indexs, 0, size-1) +} + +func reverse(A []int, i, j int) { + for i < j { + A[i], A[j] = A[j], A[i] + i++ + j-- + } +} + +func sum(A []int) int { + res := 0 + for _, a := range A { + res += a + } + return res +} diff --git a/Algorithms/0975.odd-even-jump/odd-even-jump_test.go b/Algorithms/0975.odd-even-jump/odd-even-jump_test.go new file mode 100755 index 000000000..3184bfb45 --- /dev/null +++ b/Algorithms/0975.odd-even-jump/odd-even-jump_test.go @@ -0,0 +1,62 @@ +package problem0975 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{2, 3, 1, 1, 4, 2, 3, 1, 1, 4}, + 5, + }, + + { + []int{1, 2, 3, 2, 1, 4, 4, 5}, + 6, + }, + + { + []int{58614, 72008, 68132, 35335, 91636, 89945, 33065, 74739, 909, 81635, 56486, 95230, 36319, 62571, 32300, 78278, 60070, 98747, 101, 14075, 4360, 12584, 92938, 94860, 48041, 94668, 81838, 77861, 74728, 18765, 54887, 42387, 94978, 17383, 16985, 65886, 15740, 11005, 50392, 79666, 60504, 75475, 26575, 28496, 42870, 99084, 71791, 94625, 53787, 55455, 99009, 18998, 78259, 79151, 84474, 75005, 15533, 66112, 92370, 56328, 36094, 94952, 56159, 41163, 61413, 80412, 22830, 1569, 52909, 94135, 68025, 63090, 62781, 49698, 73091, 24919, 89175, 27447, 94494, 92649, 7792, 44817, 74403, 44965, 50889, 80682, 70499, 95800, 16448, 92355, 92798, 63474, 94039, 25268, 88178, 77347, 60968, 9062, 3013, 1096, 25055, 76235, 38662, 77544, 62564, 38926, 88014, 3841, 46531, 82985, 12681, 71048, 32811, 2430, 47372, 52169, 4158, 56591, 34743, 449, 19077, 11081, 54062, 4312, 92813, 84506, 94529, 31480, 90526, 98431, 76473, 27508, 67088, 59566, 40420, 30609, 5984, 12538, 13395, 48089, 64189, 76406, 4671, 82375, 4347, 55494, 74414, 63122, 94967, 34469, 58588, 8279, 55979, 81329, 20160, 26096, 70040, 25388, 25924, 93551, 99854, 15519, 90016, 55272, 3860, 58550, 64154, 3379, 75769, 81780, 7164, 64839, 45654, 23872, 45867, 15938, 33366, 65520, 47648, 55592, 54344, 82059, 34338, 81296, 7998, 42773, 35232, 45158, 83350, 51239, 98724, 86146, 11884, 31689, 2272, 73375, 1920, 88593, 19334, 41383, 6203, 31125, 38951, 5223, 76755, 71134, 35788, 83519, 7742, 5400, 35498, 90184, 75646, 67231, 56273, 80376, 41222, 3068, 80240, 19049, 38765, 35760, 12336, 35078, 17708, 61601, 65343, 1364, 45647, 55405, 87166, 49603, 8045, 5172, 86210, 79072, 85844, 26224, 64799, 9571, 82657, 33361, 95514, 47138, 3306, 90905, 62553, 28708, 3680, 37668, 15686, 54828, 14688, 17461, 92086, 64012, 24258, 87889, 62471, 94559, 48291, 88790, 67844, 4416, 24029, 28157, 17001, 23818, 22604, 87834, 46289, 87651, 13799, 56491, 1346, 93030, 563, 38990, 80158, 99988, 1950, 82408, 51008, 3818, 77711, 11190, 61147, 77832, 67359, 37987, 2644, 43626, 91369, 33292, 24795, 13783, 51025, 53334, 7304, 40775, 65868, 96605, 43154, 43603, 47113, 22503, 39483, 64526, 39705, 58137, 83558, 99796, 88503, 37179, 2172, 61160, 47455, 23701, 4030, 32157, 79807, 96411, 10666, 87763, 4871, 71347, 2679, 42104, 87023, 39310, 92456, 71319, 60418, 16137, 34049, 41109, 59020, 99603, 28370, 50356, 93344, 34542, 62860, 76613, 63026, 75343, 19569, 95733, 17689, 58368, 29604, 63442, 29111, 43121, 68222, 26906, 72787, 34687, 13215, 61312, 16575, 43057, 39839, 7616, 71076, 68082, 77779, 54491, 55391, 16923, 20746, 22824, 52530, 81898, 35697, 88187, 73587, 71644, 33517, 11847, 96279, 85461, 40886, 86321, 89921, 34247, 50156, 33178, 69515, 91216, 98454, 74377, 30524, 88049, 99261, 34652, 94871, 51154, 96463, 99585, 81294, 68343, 15401, 491, 59547, 70445, 93553, 51711, 69684, 64735, 20492, 64430, 98172, 11118, 68854, 61430, 37585, 79334, 1048, 89241, 81736, 48070, 10813, 45262, 58425, 25388, 48653, 77572, 92273, 56164, 82724, 7793, 85636, 92081, 16800, 82748, 84956, 87865, 51713, 60825, 20808, 70813, 40501, 2116, 13426, 38821, 88517, 56494, 91625, 92948, 8679, 58821, 33452, 50679, 45552, 47994, 10180, 83316, 49027, 64498, 47267, 18101, 54100, 15953, 85217, 83160, 14363, 6884, 6849, 39324, 95304, 55614, 26552, 22964, 11087, 14107, 81186, 13863, 86406, 82299, 13680, 55872, 705, 86203, 55827, 75534, 49034, 69042, 93123, 55954, 87470, 34304, 9753, 514, 22665, 83858, 31149, 22461, 49563, 94690, 50897, 34087, 7750, 57366, 22625, 36749, 38116, 75818, 23162, 93589, 74238, 48111, 88047, 35916, 38433, 12936, 77855, 40119, 50025, 47096, 65618, 37393, 91586, 43192, 35921, 40087, 76629, 99305, 86651, 47972, 29135, 44598, 34401, 24353, 18694, 95587, 49930, 10997, 38390, 38871, 51353, 98004, 97663, 56589, 61809, 67562, 50222, 48667, 31452, 68392, 9189, 31714, 89097, 22737, 96758, 98416, 57538, 4043, 9347, 20030, 32681, 11310, 79721, 36415, 23373, 4369, 38267, 450, 11649, 60464, 93494, 19936, 74106, 19770, 149, 89653, 84610, 6677, 17713, 23430, 92832, 38192, 80738, 43581, 38124, 76534, 61576, 26931, 58281, 70385, 82707, 67717, 64074, 59590, 9205, 94518, 71484, 27287, 69235, 62081, 65885, 37890, 57317, 66002, 20165, 50801, 12034, 10553, 91106, 12454, 89326, 46979, 45490, 33981, 41621, 37723, 56498, 33559, 82197, 23356, 24847, 48055, 93508, 2391, 72341, 600, 40486, 76420, 44607, 42948, 25321, 47509, 22825, 28352, 65329, 59944, 92954, 96886, 52238, 8755, 29990, 51780, 67316, 94619, 15510, 3668, 87003, 80516, 76574, 46860, 67778, 41146, 19205, 39089, 78704, 80185, 96113, 88766, 68208, 52091, 72392, 18320, 92308, 71257, 59448, 43404, 63354, 61767, 89885, 57073, 21337, 44137, 24296, 90495, 84352, 55581, 19639, 4354, 13416, 44321, 67420, 22399, 68452, 86194, 75724, 42552, 64572, 98836, 88541, 33814, 68544, 16321, 55736, 35653, 43814, 43889, 66323, 84599, 46857, 14658, 75415, 75164, 95384, 39405, 46387, 54059, 89212, 70421, 2127, 20732, 85389, 58547, 87390, 41139, 21046, 414, 99605, 13638, 64296, 48970, 38014, 53720, 7828, 97003, 49273, 1528, 41934, 75720, 31208, 74502, 76736, 23912, 96797, 2788, 86360, 51264, 15337, 25839, 59351, 27845, 83842, 21952, 38406, 50681, 33977, 82414, 26388, 8897, 15478, 62694, 56356, 6329, 99304, 47944, 31943, 72916, 2429, 43424, 66441, 96213, 76163, 88515, 11890, 42977, 3179, 27199, 38429, 34382, 37374, 80308, 18954, 82449, 54192, 33874, 55223, 16142, 49545, 2195, 86297, 33158, 34404, 99515, 61345, 41765, 79065, 6766, 57050, 52070, 86122, 58620, 48527, 52022, 78189, 34732, 55778, 70739, 99555, 69368, 96187, 39903, 60878, 74529, 34841, 26917, 97283, 34853, 99990, 85227, 21606, 82821, 98362, 27682, 66445, 76958, 8328, 81933, 30836, 70638, 95013, 3510, 61171, 29240, 11465, 71185, 97904, 51271, 34634, 44908, 41461, 53190, 40917, 8037, 97942, 99670, 17413, 24103, 43695, 69873, 3134, 83549, 63843, 26929, 87086, 66120, 31692, 54784, 97923, 4843, 70846, 84941, 69231, 14001, 59714, 78595, 41859, 58242, 25346, 31274, 80857, 48949, 44881, 12288, 37447, 52072, 23101, 80793, 38370, 23848, 30829, 82446, 90414, 96029, 1519, 75389, 52548, 12456, 24653, 28169, 40421, 47072, 93678, 5835, 70916, 85410, 35729, 24921, 22130, 30083, 14529, 55167, 25039, 2725, 23263, 82063, 41737, 88353, 94361, 24334, 55997, 88106, 58142, 16800, 24795, 98762, 29938, 86770, 79501, 74198, 72194, 78998, 84740, 6236, 16780, 50552, 21248, 53321, 49318, 12677, 8596, 1165, 82503, 8174, 96156, 98383, 74569, 45038, 27578, 41245, 34529, 39629, 72619, 89252, 15771, 24267, 20989, 4534, 85420, 51127, 6703, 44625, 45061, 77795, 76139, 13448, 62687, 50968, 1349, 14773, 66684, 36702, 96368, 50175, 68828, 13361, 47944, 73412, 83348, 19960, 39690, 47352, 44037, 47544, 29590, 80872, 91307, 34900, 63786, 38070, 57875, 69553, 50151, 67458, 75714, 84329, 18880, 21638, 51437, 50965, 80772, 51738, 90005, 77760, 50631, 82632, 47585, 34171, 43342, 45620, 65053, 5215, 72950, 96823, 45881, 6877, 20125, 10321, 25635, 79390, 104, 87357}, + 965, + }, + + { + []int{10, 13, 12, 14, 15}, + 2, + }, + + { + []int{2, 3, 1, 1, 4}, + 3, + }, + + { + []int{5, 1, 3, 4, 2}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_oddEvenJumps(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, oddEvenJumps(tc.A), "输入:%v", tc) + } +} + +func Benchmark_oddEvenJumps(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + oddEvenJumps(tc.A) + } + } +} diff --git a/Algorithms/0976.largest-perimeter-triangle/README.md b/Algorithms/0976.largest-perimeter-triangle/README.md new file mode 100755 index 000000000..aea823662 --- /dev/null +++ b/Algorithms/0976.largest-perimeter-triangle/README.md @@ -0,0 +1,38 @@ +# [976. Largest Perimeter Triangle](https://leetcode.com/problems/largest-perimeter-triangle/) + +Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. + +If it is impossible to form any triangle of non-zero area, return 0. + +Example 1: + +```text +Input: [2,1,2] +Output: 5 +``` + +Example 2: + +```text +Input: [1,2,1] +Output: 0 +``` + +Example 3: + +```text +Input: [3,2,3,4] +Output: 10 +``` + +Example 4: + +```text +Input: [3,6,2,3] +Output: 8 +``` + +Note: + +- 3 <= A.length <= 10000 +- 1 <= A[i] <= 10^6 diff --git a/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle.go b/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle.go new file mode 100755 index 000000000..7dac04a60 --- /dev/null +++ b/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle.go @@ -0,0 +1,50 @@ +package problem0976 + +import "container/heap" + +func largestPerimeter(A []int) int { + size := len(A) + h := intHeap(A) + + heap.Init(&h) + + a := heap.Pop(&h).(int) + b := heap.Pop(&h).(int) + for i := size - 3; i >= 0; i-- { + c := heap.Pop(&h).(int) + if a < b+c { + return a + b + c + } + a, b = b, c + } + return 0 +} + +// intHeap 实现了 heap 的接口 +type intHeap []int + +func (h intHeap) Len() int { + return len(h) +} + +func (h intHeap) Less(i, j int) bool { + return h[i] > h[j] // NOTICE: Max is at the top +} + +func (h intHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} + +func (h *intHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *intHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[:len(*h)-1] + return res +} diff --git a/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle_test.go b/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle_test.go new file mode 100755 index 000000000..6383a7ead --- /dev/null +++ b/Algorithms/0976.largest-perimeter-triangle/largest-perimeter-triangle_test.go @@ -0,0 +1,74 @@ +package problem0976 + +import ( + "container/heap" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{757, 341, 254, 499, 96, 622, 685, 514, 482, 655, 680, 593, 407, 660, 330, 469, 841, 335, 53, 764, 341, 918, 290, 667, 47, 725, 319, 135, 118, 636, 145, 540, 363, 708, 658, 735, 999, 306, 531, 427, 393, 872, 30, 838, 873, 710, 438, 364, 95, 567, 737, 510, 961, 881, 37, 567, 464, 991, 587, 363, 25, 532, 565, 116, 876, 479, 805, 908, 71, 581, 262, 881, 657, 734, 60, 111, 718, 739, 950, 349, 588, 963, 947, 213, 356, 429, 446, 420, 706, 221, 709, 948, 855, 811, 763, 978, 704, 384, 601, 920, 170, 864, 785, 308, 983, 524, 711, 233, 537, 657, 682, 728, 37, 131, 521, 783, 130, 669, 574, 503, 453, 712, 216, 976, 764, 803, 921, 747, 261, 329, 500, 361, 485, 757, 173, 47, 211, 730, 171, 254, 115, 936, 111, 837, 35, 64, 244, 481, 385, 300, 450, 682, 339, 423, 927, 835, 332, 827, 624, 212, 180, 802, 873, 535, 528, 947, 882, 549, 574, 81, 415, 645, 307, 826, 924, 405, 800, 791, 620, 337, 517, 488, 981, 920, 131, 367, 39, 45, 686, 256, 781, 298, 303, 146, 478, 297, 33, 767, 247, 195, 664, 763, 65, 127, 790, 424, 678, 238, 810, 944, 285, 700, 595, 432, 968, 497, 288, 15, 995, 855, 541, 712, 635, 938, 855, 784, 638, 50, 584, 857, 620, 495, 337, 903, 1000, 407, 687, 520, 406, 447, 586, 209, 53, 869, 383, 80, 311, 928, 545, 916, 16, 219, 517, 226, 31, 201, 830, 753, 324, 989, 701, 976, 713, 228, 227, 391, 268, 301, 674, 690, 994, 224, 851, 638, 117, 341, 146, 235, 676, 172, 429, 744, 806, 899, 549, 633, 148, 181, 948, 381, 861, 93, 143, 974, 366, 901, 517, 161, 166, 492, 355, 441, 388, 407, 17, 34, 472, 592, 32, 184, 388, 156, 400, 764, 435, 968, 798, 130, 277, 687, 955, 476, 135, 644, 313, 303, 28, 635, 667, 817, 651, 341, 98, 637, 870, 141, 695, 425, 997, 467, 961, 622, 624, 987, 913, 256, 781, 338, 304, 144, 253, 137, 860, 377, 162, 476, 632, 181, 616, 671, 486, 900, 447, 697, 389, 787, 858, 495, 574, 329, 583, 423, 784, 382, 715, 939, 515, 476, 710, 558, 872, 52, 133, 524, 240, 792, 506, 958, 738, 138, 378, 836, 469, 238, 659, 54, 346, 458, 971, 536, 44, 34, 494, 224, 573, 443, 90, 804, 415, 90, 48, 690, 713, 302, 243, 276, 636, 611, 226, 933, 788, 147, 94, 691, 453, 414, 518, 322, 939, 961, 551, 338, 79, 1000, 186, 671, 404, 675, 653, 965, 218, 268, 410, 656, 793, 615, 884, 911, 55, 360, 297, 526, 913, 120, 301, 551, 604, 454, 545, 531, 3, 642, 85, 67, 394, 235, 731, 862, 599, 804, 574, 951, 981, 855, 226, 19, 336, 259, 441, 342, 305, 250, 727, 78, 985, 672, 110, 78, 719, 57, 375, 449, 750, 593, 497, 376, 930, 67, 822, 750, 10, 170, 371, 465, 5, 542, 965, 388, 508, 888, 873, 337, 590, 863, 425, 812, 347, 41, 306, 813, 413, 343, 613, 12, 978, 81, 227, 78, 560, 164, 921, 847, 279, 113, 663, 290, 474, 395, 390, 241, 206, 804, 568, 831, 391, 83, 501, 222, 823, 171, 1000, 290, 513, 343, 706, 444, 303, 606, 217, 25, 290, 619, 702, 935, 699, 27, 774, 916, 531, 682, 896, 834, 14, 729, 454, 372, 542, 189, 960, 958, 508, 710, 199, 981, 207, 158, 215, 904, 322, 302, 436, 922, 449, 627, 370, 409, 33, 138, 85, 470, 73, 177, 724, 723, 441, 278, 910, 2164, 14, 217, 310, 65, 606, 488, 477, 120, 894, 495, 149, 891, 481, 716, 297, 912, 89, 981, 414, 715, 398, 844, 890, 746, 970, 767, 821, 760, 291, 876, 423, 869, 845, 580, 959, 265, 882, 217, 966, 537, 526, 557, 911, 662, 991, 579, 358, 636, 405, 537, 913, 441, 267, 892, 376, 657, 627, 99, 664, 359, 549, 941, 520, 65, 759, 550, 198, 207, 284, 887, 853, 581, 23, 364, 394, 754, 936, 532, 480, 16203, 965, 531, 429, 72, 963, 640, 365, 797, 349, 219, 235, 571, 282, 732, 976, 625, 277, 298, 726, 619, 668, 917, 598, 895, 489, 128, 365, 701, 537, 68, 27, 32, 546, 169, 323, 548, 38, 819, 498, 276, 498, 520, 959, 95, 202, 615, 387, 451, 429, 255, 572, 19, 61, 496, 584, 142, 977, 1531, 45, 874, 442, 288, 66, 938, 929, 532, 786, 66, 734, 607, 405, 502, 597, 241, 669, 758, 445, 955, 708, 894, 875, 798, 993, 818, 336, 215, 631, 574, 661, 422, 489, 60, 23, 90, 51, 41, 526, 489, 231, 860, 635, 345, 865, 519, 350, 426, 755, 457, 999, 841, 942, 336, 943, 414, 526, 262, 393, 749, 967, 55, 115, 619, 446, 44, 184, 804, 910, 737, 599, 891, 851, 752, 327, 1000, 977, 543, 942, 985, 757, 106, 411, 343, 370, 623, 34, 625, 60, 754, 601, 434, 94, 187, 716, 451, 310, 379, 700, 362, 543, 528, 389, 454, 950, 83, 508, 729, 503, 688, 1000, 787, 3891, 903, 105, 482, 750, 843, 969, 841, 478, 136, 971, 260, 439, 753, 232, 233, 398, 134, 885, 342, 209, 253, 426, 656, 154, 299, 567, 74, 136, 630, 979, 884, 725, 472, 943, 78, 289, 962, 173, 535, 318, 157, 939, 39, 976, 443, 15, 107, 259, 269, 146, 690, 79, 506, 523, 546, 170, 776, 736, 721, 569, 962, 553, 507, 6, 311, 527, 300, 997, 553, 174, 877, 244, 540, 818, 673, 980, 518, 913, 257, 82, 962, 264, 130, 79, 425, 871, 808, 823, 627, 928, 461, 709, 218, 740, 822, 665, 729, 994, 614, 298, 36, 82, 601, 409, 488, 384, 869, 818, 74, 255, 11, 512, 75, 572, 78, 320, 868, 803, 49, 277, 439, 177, 378, 647, 290, 280, 923, 776, 622, 203, 523, 824, 179, 68, 867, 328, 646, 145, 114, 496, 234, 599, 335, 645, 221, 557, 561, 797, 188, 688, 697, 351, 91, 965, 285, 485, 207, 774, 33, 87, 167, 926, 249, 906, 989, 523, 985, 14, 188, 64, 507, 205, 450, 725, 282, 891, 677, 84, 955, 754, 810, 91, 492, 910, 383, 863, 941, 812, 859, 514, 757, 54, 126, 45, 413, 938, 647, 809, 620, 307, 225, 628, 41, 113, 757, 552, 578, 877, 607, 955, 192, 937, 901, 146, 815, 67, 144, 806, 240, 199, 705, 650, 60, 976, 917, 694, 548, 962, 985, 255, 785, 939, 530, 997, 400, 4, 832, 353, 202, 734, 605, 408, 927, 387, 947, 34, 712, 516, 896, 508, 513, 81, 862, 960, 931, 111667, 838, 569, 866, 270, 290, 396, 24, 496, 426, 826, 358, 859, 475, 88, 510, 902, 748, 648, 58, 351, 710, 885, 173, 247, 937, 874, 597, 487, 53, 365, 498, 352, 869, 659, 458, 50, 774, 251, 672, 930, 864, 367, 675, 548, 922, 860, 769, 472, 73, 933, 29, 259, 412, 161, 380, 82, 153, 832, 948, 257, 521, 671, 883, 173, 388, 639, 313, 485, 54, 951, 818, 994, 81, 51, 905, 959, 231, 543, 730, 954, 672, 73, 562, 157, 263, 10003, 596, 834, 690, 210, 231, 185, 180, 581, 883, 459, 238, 208, 98, 988, 418, 806, 321, 985, 183, 749, 427, 538, 491, 51, 74, 306, 722, 28, 399, 268, 611, 441, 10, 321, 849, 733, 228, 735, 411, 883, 345, 751, 753, 896, 91, 627, 737, 969, 529, 274, 56, 168, 716, 789, 132, 176, 616, 69, 319, 525, 284, 530, 68, 23, 214, 617, 628, 68, 718, 526, 408, 851, 636, 743, 142, 237, 930, 110, 199, 158, 598, 323, 847, 621, 392, 982, 112, 515, 309, 504, 129, 915, 328, 328, 677, 722, 427, 14, 608, 737, 865, 469, 961, 465, 413, 803, 875, 161, 561, 497, 114, 786, 293, 436, 999, 247, 410, 845, 575, 444, 454, 692, 746, 965, 423, 711, 579, 614, 405, 643, 132, 466, 347, 152, 474, 215, 645, 369, 369, 576, 603, 305, 807, 799, 720, 958, 845, 904, 292, 91, 764, 82, 99, 408, 816, 260, 982, 595, 437, 301, 261, 438, 871, 429, 864, 538, 765, 702, 380, 792, 713, 692, 103, 668, 554, 106, 448, 41, 514, 668, 847, 68, 812, 414, 666, 825, 548, 882, 531, 65, 260, 317, 85, 180772, 266, 585, 210, 13, 437, 436, 792, 653, 494, 156, 845, 29, 493, 994, 225, 184, 397, 48, 733, 851, 496, 42571, 34, 103, 686, 638, 666, 604, 99, 615, 481, 752, 508, 129, 445, 486, 528, 412, 803, 128, 63, 317, 796, 750, 394, 654, 739, 528, 869, 831, 341, 713, 638, 229, 329, 548, 641, 907, 288, 326, 202, 875, 867, 506, 494, 637, 840, 486, 150, 996, 991, 293, 170, 842, 790, 471, 707, 298, 269, 768, 961, 219, 679, 968, 955, 908, 458, 59, 640, 704, 785, 524, 427, 679, 857, 836, 917, 154, 24, 485, 565, 30, 776, 688, 54, 161, 158, 433, 211, 220, 947, 414, 819, 611, 873, 315, 334, 690, 888, 63, 487, 135, 608, 589, 121, 761, 394, 369, 177, 197, 101, 192, 363, 62, 330, 198, 485, 930, 693, 161, 214, 91, 395, 313, 1000, 949, 592, 65, 28, 886, 393, 359, 188, 698, 532, 824, 753, 506, 190, 409, 363, 13, 932, 630, 734, 84, 789, 523, 512, 593, 814, 324, 705, 814, 104, 579, 162, 648, 673, 974, 507, 882, 700, 714, 892, 41, 103, 129, 912, 491, 891, 5, 413, 233, 442, 997, 469, 141, 695, 680, 357, 449, 874, 421, 2, 351, 570, 319, 69, 814, 266, 540, 165, 443, 618, 980, 854, 18, 941, 565, 943, 110, 977, 255, 889, 810, 239, 216, 430, 566, 760, 236, 581, 808, 483, 926, 68, 368, 990, 987, 604, 926, 487, 197, 935, 502, 405, 639, 727, 385, 906, 762, 460, 148, 727, 270, 175, 546, 735, 160, 459, 828, 735, 915, 326, 102, 772, 405, 208, 35, 496, 691, 187, 851, 543, 63, 13, 393, 857, 14, 399, 668, 942, 554, 910, 411, 952, 620, 760, 103, 669, 416, 985, 408, 787, 830, 666, 570, 950, 944, 723, 791, 422, 448, 565, 549, 819, 221, 282, 872, 47, 850, 667, 159, 102, 223, 831, 330, 24, 470, 701, 312, 787, 111, 281, 432, 967, 551, 831, 604, 875, 467, 533, 773, 196, 365, 363, 688, 885, 951, 391, 370, 648, 824, 600, 177, 477, 811, 290, 882, 297, 128, 862, 714, 99, 578, 905, 214, 920, 810, 426, 915, 786, 233, 743, 115, 436, 559, 137, 651, 172, 691, 845, 257, 733, 179, 991, 730, 345, 691, 534, 220, 128, 143, 265, 156, 711, 833, 193, 301, 129, 407, 819, 480, 42, 992, 474, 746, 46, 230, 38, 208, 579, 886, 854, 62, 782, 469, 201, 709, 334, 214, 400, 294, 211, 933, 848, 503, 468, 179, 702, 452, 645, 569, 82, 965, 833, 33, 962, 941, 527, 467, 536, 243, 576, 775, 353, 954, 940, 984, 667, 104, 160, 467, 607, 703, 451, 68, 333, 780, 29, 912, 373, 993, 695, 845, 682, 176, 29, 869, 42, 846, 898, 144, 60, 327, 283, 568, 746, 498, 176, 251, 933, 37, 832, 189, 475, 983, 156, 836, 522, 579, 637, 249, 294, 609, 115, 634, 492, 764, 381, 831, 698, 682, 410, 854, 509, 754, 116, 857, 312, 774, 959, 918, 943, 8, 573, 733, 241, 831, 319, 783, 193, 510, 943, 455, 977, 899, 109, 741, 37, 90, 47, 258, 219, 150, 750, 91, 473, 440, 768, 21, 864, 125, 404, 888, 120, 552, 551, 576, 704, 357, 896, 516, 156, 952, 577, 900, 168, 931, 731, 893, 628, 524, 66, 884, 292525, 547, 735, 899, 975, 498, 406, 151, 564, 827, 363, 862, 607, 130, 573, 793, 332, 818, 762, 418, 988, 288, 480, 141, 319, 678, 278, 516, 105, 849, 319, 961, 908, 751, 118, 825, 132, 757, 631, 294, 156, 586, 704, 42, 837, 464, 807, 52, 454, 818, 58, 491, 654, 113, 218, 959, 488, 868, 799, 131, 154, 192, 390, 199, 424, 46, 782, 540, 108, 558, 403, 327, 312, 726, 184, 805, 194, 423, 383, 260, 242, 9, 723, 142, 608, 579, 879, 560, 378, 419, 452, 992, 626, 496, 739, 148, 265, 791, 966, 937, 623, 754, 166, 30, 338, 35, 48, 322, 868, 552, 820, 354, 70, 471, 350, 746, 469, 53, 705, 870, 22, 72, 227, 856, 311, 33, 282, 697, 400, 25, 472, 967, 207, 863, 753, 583, 569, 954, 608, 768, 579, 462, 473, 154, 581, 234, 83, 467, 386, 64, 731, 446, 91, 610, 856, 880, 770, 446, 3, 199, 413, 384, 476, 427, 574, 641, 455, 46, 221, 565, 985, 457, 971, 805, 248, 899, 195, 50, 885, 872, 27, 112, 545, 696, 537, 388, 698, 612, 647, 923, 399, 177, 920, 621, 627, 768, 442, 684, 288, 414, 537, 573, 231, 476, 356, 222, 923, 759, 633, 858, 247, 452, 273, 632, 133, 449, 504, 859, 826, 799, 728, 252, 665, 801, 453, 423, 247, 401, 607, 918, 967, 460, 328, 318, 141, 34, 572, 899, 392, 712, 584, 919, 294, 924, 229, 73, 675, 1, 193, 257, 908, 388, 448, 45, 726, 510, 652, 608, 552, 258, 723, 145, 608, 603, 644, 925, 1, 367, 62, 712, 740, 234, 37, 370, 875, 500, 969, 107, 657, 358, 201, 595, 937, 155, 972, 584, 462, 61, 798, 917, 500, 993, 346, 60, 29, 854, 504, 121, 949, 218, 301, 196, 819, 747, 66, 285, 215, 89, 233, 177, 123, 717, 100, 568, 376, 842, 563, 996, 878, 5, 886, 198, 717, 659, 532, 695, 150, 439, 789, 433, 871, 80, 680, 139, 557, 8, 561, 148, 678, 90, 480, 321, 93, 130, 666, 25, 6102, 428, 945, 947, 682, 128, 499, 172, 423, 511, 72, 370, 548, 599, 66, 879, 678, 559, 784, 4, 22, 745, 660, 812, 599, 218, 683, 638, 411, 227, 405, 387, 323, 568, 785, 637, 626, 211, 193, 142, 517, 525, 812, 159, 725, 214, 165, 505, 173, 489, 249, 789, 394, 944, 934, 451, 697, 660, 100, 259, 486, 626, 872, 183, 102, 24, 152, 27, 63, 676, 928, 17, 699, 859, 227, 500, 988, 106, 723, 284, 792, 685, 829, 847, 912, 547, 306, 195, 584, 256, 413, 40, 656, 903, 53, 182, 751, 403, 225, 715, 218, 195, 726, 79, 222, 497, 519, 769, 64, 651, 413, 570, 682, 232, 144, 619, 688, 51, 739, 694, 402, 719, 393, 639, 661, 926, 462, 654, 274, 163, 165, 107, 631, 589, 758, 944, 647, 402, 201, 826, 193, 907, 966, 961, 155, 829, 645, 865, 543, 68931, 643, 693, 484, 894, 823, 423, 764, 644, 70, 419, 465, 383, 755, 701, 517, 610, 323, 883, 808, 183, 562, 712, 401, 918, 848, 602, 648, 740, 115, 542, 947, 362, 712, 115, 565, 803, 821, 499, 356, 674, 436, 396, 831, 933, 444, 766078, 380, 782, 78, 809, 781, 514, 811, 976, 530, 213, 705, 951, 648, 882, 229, 573, 645, 313, 495, 676, 473, 375, 861, 66, 312, 213, 877, 366, 524, 763, 260, 441, 768, 694, 854, 328, 127, 531, 993, 293, 172, 312, 554, 414, 688, 326, 62, 319, 3, 18, 920, 633, 422, 153, 626, 563, 6, 483, 880, 414, 999, 278, 245, 727, 613, 462, 948, 396, 204, 452, 24, 265, 162, 241, 335, 960, 413, 947, 235, 509, 26, 90, 339, 805, 471, 630, 592, 802, 897, 100, 605, 664, 755, 196, 956, 408, 262, 918, 380, 803, 332, 386, 786, 51, 562, 743, 42, 802, 467, 133, 908, 492, 610, 861, 308, 846, 838, 980, 577, 560, 473489, 734, 827, 166, 738, 998, 329, 364, 783, 557, 686, 81, 41, 933, 652, 378, 648, 268, 294, 378, 331, 257, 822, 807, 460, 153, 207, 785, 868, 704, 295, 296, 841, 104, 391, 382, 452, 322, 430, 235, 239, 2, 297, 282, 825, 386, 236, 918, 323, 920, 51, 993, 330, 829, 28, 560, 683, 784, 916, 113, 634, 143, 864, 758, 598, 77, 965, 511, 767, 121, 202, 908, 887, 436, 483, 992, 82, 431, 775, 352, 551, 616, 738, 195, 821, 859, 17, 931, 616, 509, 557, 978, 261, 663, 783, 188, 567, 872, 983, 434, 924, 957, 474, 327, 642, 422, 416, 71, 651, 807, 982, 679, 433, 57, 408, 233, 423, 969, 963, 595, 484, 999, 787, 656, 609, 173, 568, 432, 874, 314, 624, 691, 991, 385, 397, 730, 127, 809, 152, 291, 93, 753, 620, 341, 503, 349, 265, 698, 600, 832, 577, 320, 830, 778, 900, 692, 525, 517, 230, 790, 958, 293, 534, 923, 147, 57, 529, 81, 471, 837, 934, 957, 34, 189, 117, 592, 400, 907, 482, 76, 810, 804, 411, 255, 132, 974, 833, 334, 484, 393, 101, 657, 744, 829, 345, 844, 313, 640, 725, 944, 111, 526, 737, 777, 574, 276, 765, 954, 210, 630, 678, 95, 54, 510, 329, 849, 532, 910, 404, 516, 825, 591, 204, 578, 384, 395, 966, 923, 618, 674, 308, 896, 920, 853, 492, 268, 934, 847, 615, 787, 193, 800, 67, 127, 180, 582, 403, 934, 762, 591, 699, 657, 772, 823, 127, 81, 666, 117, 328, 460, 902, 549, 489, 704, 774, 704, 185, 111, 517, 640, 872, 643, 868, 896, 483, 735, 561, 619, 174, 408, 645, 962, 863, 304, 68, 995, 336, 856, 210, 439, 373, 935, 340, 861, 755, 182, 543, 743, 342, 364, 975, 964, 82, 81, 880, 865, 381, 488, 653, 522, 539, 542, 160, 562, 933, 759, 96, 43, 989, 337, 627, 409, 594, 446, 187, 158, 956, 658, 628, 390, 308, 472, 178, 640, 283, 226, 364, 187, 16, 516, 590, 434, 260, 541, 733, 621, 294, 69, 664, 609, 565, 842, 348, 368, 961, 532, 544, 957, 974, 158, 455, 90, 328, 759, 735, 949, 881, 290, 523, 4, 804, 103, 668, 26317, 971, 772, 450, 362, 801, 317, 358, 946, 191, 674, 212, 72, 235}, + 4695, + }, + + { + []int{2, 1, 2}, + 5, + }, + + { + []int{1, 2, 1}, + 0, + }, + + { + []int{3, 2, 3, 4}, + 10, + }, + + { + []int{3, 6, 2, 3}, + 8, + }, + + // 可以有多个 testcase +} + +func Test_largestPerimeter(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largestPerimeter(tc.A), "输入:%v", tc) + } +} + +func Benchmark_largestPerimeter(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestPerimeter(tc.A) + } + } +} + +func Test_intHeap(t *testing.T) { + ast := assert.New(t) + + ih := new(intHeap) + heap.Init(ih) + + heap.Push(ih, 1) + heap.Pop(ih) + + begin, end := 10, 0 + for i := begin; i > end; i-- { + heap.Push(ih, i) + ast.Equal(begin, (*ih)[0], "插入 %d 后的最小值却是 %d,ih=%v", i, (*ih)[0], (*ih)) + } +} diff --git a/Algorithms/0977.squares-of-a-sorted-array/README.md b/Algorithms/0977.squares-of-a-sorted-array/README.md new file mode 100755 index 000000000..87de3ccc1 --- /dev/null +++ b/Algorithms/0977.squares-of-a-sorted-array/README.md @@ -0,0 +1,23 @@ +# [977. Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) + +Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. + +Example 1: + +```text +Input: [-4,-1,0,3,10] +Output: [0,1,9,16,100] +``` + +Example 2: + +```text +Input: [-7,-3,2,3,11] +Output: [4,9,9,49,121] +``` + +Note: + +- 1 <= A.length <= 10000 +- -10000 <= A[i] <= 10000 +- A is sorted in non-decreasing order. diff --git a/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array.go b/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array.go new file mode 100755 index 000000000..12cfbf849 --- /dev/null +++ b/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array.go @@ -0,0 +1,16 @@ +package problem0977 + +func sortedSquares(A []int) []int { + size := len(A) + res := make([]int, size) + for l, r, i := 0, size-1, size-1; l <= r; i-- { + if A[l]+A[r] < 0 { + res[i] = A[l] * A[l] + l++ + } else { + res[i] = A[r] * A[r] + r-- + } + } + return res +} diff --git a/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array_test.go b/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array_test.go new file mode 100755 index 000000000..26cb45044 --- /dev/null +++ b/Algorithms/0977.squares-of-a-sorted-array/squares-of-a-sorted-array_test.go @@ -0,0 +1,42 @@ +package problem0977 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans []int +}{ + + { + []int{-4, -1, 0, 3, 10}, + []int{0, 1, 9, 16, 100}, + }, + + { + []int{-7, -3, 2, 3, 11}, + []int{4, 9, 9, 49, 121}, + }, + + // 可以有多个 testcase +} + +func Test_sortedSquares(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, sortedSquares(tc.A), "输入:%v", tc) + } +} + +func Benchmark_sortedSquares(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sortedSquares(tc.A) + } + } +} diff --git a/Algorithms/0978.longest-turbulent-subarray/README.md b/Algorithms/0978.longest-turbulent-subarray/README.md new file mode 100755 index 000000000..365c4f042 --- /dev/null +++ b/Algorithms/0978.longest-turbulent-subarray/README.md @@ -0,0 +1,37 @@ +# [978. Longest Turbulent Subarray](https://leetcode.com/problems/longest-turbulent-subarray/) + +A subarray A[i], A[i+1], ..., A[j] of A is said to be turbulent if and only if: + +- For i <= k < j, A[k] > A[k+1] when k is odd, and A[k] < A[k+1] when k is even; +- OR, for i <= k < j, A[k] > A[k+1] when k is even, and A[k] < A[k+1] when k is odd. + +That is, the subarray is turbulent if the comparison sign flips between each adjacent pair of elements in the subarray. + +Return the length of a maximum size turbulent subarray of A. + +Example 1: + +```text +Input: [9,4,2,10,7,8,8,1,9] +Output: 5 +Explanation: (A[1] > A[2] < A[3] > A[4] < A[5]) +``` + +Example 2: + +```text +Input: [4,8,12,16] +Output: 2 +``` + +Example 3: + +```text +Input: [100] +Output: 1 +``` + +Note: + +- `1 <= A.length <= 40000` +- `0 <= A[i] <= 10^9` \ No newline at end of file diff --git a/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray.go b/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray.go new file mode 100755 index 000000000..2df153e8e --- /dev/null +++ b/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray.go @@ -0,0 +1,29 @@ +package problem0978 + +func maxTurbulenceSize(A []int) int { + size := len(A) + greater, less := 1, 1 + + res := 1 + for i := 1; i < size; i++ { + switch { + case A[i] > A[i-1]: + greater, less = less+1, 1 + res = max(res, greater) + case A[i] < A[i-1]: + greater, less = 1, greater+1 + res = max(res, less) + default: + greater, less = 1, 1 + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray_test.go b/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray_test.go new file mode 100755 index 000000000..01bf18622 --- /dev/null +++ b/Algorithms/0978.longest-turbulent-subarray/longest-turbulent-subarray_test.go @@ -0,0 +1,52 @@ +package problem0978 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{20139, 81378, 2481, 28634, 85929, 85544, 11925, 81989, 7988, 37255, 40179, 47403, 94119, 6931, 3304, 75116, 50953, 93923, 81930, 41072, 46267, 68680, 30665, 87113, 62556, 7249, 18549, 1108, 35840, 62910, 44416, 22825, 76705, 48168, 41182, 33930, 59080, 34150, 33752, 27250, 74819, 72764, 55778, 56126, 4923, 67219, 41218, 51928, 10800, 94338, 91010, 95816, 45597, 66196, 71747, 52922, 80013, 10182, 92174, 85162, 14454, 18610, 39339, 306, 8871, 10989, 88613, 53278, 72922, 36100, 87781, 69307, 13328, 98190, 42436, 13520, 64108, 64795, 4818, 91292, 13155, 3426, 96600, 85766, 41274, 79233, 82614, 62669, 97029, 81057, 48849, 97685, 49839, 10409, 29065, 20971, 30892, 61282, 98880, 67105, 28467, 80970, 66076, 18107, 3276, 79580, 14735, 36963, 91245, 85521, 45441, 95433, 20430, 13999, 46839, 78945, 32718, 33941, 48678, 15896, 22562, 95700, 26561, 25933, 34842, 98885, 67743, 11996, 66772, 5194, 38699, 45603, 45191, 98644, 92604, 33101, 20905, 75126, 85263, 24435, 61183, 54394, 80186, 29349, 29650, 57012, 90807, 88477, 27804, 79343, 40709, 42410, 62688, 69311, 39682, 40963, 6186, 90101, 34797, 5410, 716, 77274, 98522, 9160, 38232, 58672, 56217, 34966, 30595, 79824, 809, 6595, 26654, 42070, 35002, 7579, 62773, 70071, 8772, 41796, 8819, 14086, 56487, 41363, 69728, 31593, 80875, 56537, 17372, 58755, 19375, 12407, 79353, 535, 60473, 77764, 98245, 97424, 79759, 7828, 13750, 25941, 32374, 54229, 53714, 91022, 45100, 19214, 92129, 63116, 81637, 95268, 41570, 17715, 64053, 79299, 12488, 57232, 80971, 28074, 16441, 32193, 8294, 30185, 51114, 92038, 93200, 93357, 11902, 4217, 29573, 16439, 15088, 13456, 91914, 69965, 73598, 97441, 65685, 47628, 82870, 98093, 12624, 74031, 86151, 88050, 27629, 18618, 90372, 16509, 73908, 45923, 24820, 92050, 86334, 51169, 96130, 68862, 90565, 99035, 31139, 43080, 19527, 22126, 52570, 67275, 41297, 6841, 64025, 84302, 67465, 43908, 72003, 33119, 37463, 32594, 53008, 61277, 12135, 58373, 14786, 38086, 2409, 94779, 77012, 36251, 53924, 64455, 89145, 39912, 44422, 61621, 95925, 11694, 22307, 67557, 28283, 90177, 57970, 92925, 39727, 85606, 74021, 35409, 13675, 55752, 59754, 26485, 65186, 63562, 95981, 43829, 60831, 75901, 30843, 76193, 12673, 62257, 75911, 51253, 73307, 85258, 10560, 82780, 60264, 36420, 77372, 86750, 79009, 40498, 97559, 49100, 59836, 45574, 70547, 80846, 25848, 68446, 7010, 51820, 59259, 11797, 57183, 48446, 75342, 15858, 89528, 24695, 41419, 93599, 91731, 24959, 31037, 39878, 40782, 54487, 47934, 60543, 98867, 20184, 51586, 80185, 38564, 68384, 32141, 79869, 49773, 29870, 86621, 77913, 52300, 22461, 32280, 64883, 58425, 93513, 34571, 47020, 62967, 62712, 69321, 57617, 79972, 25874, 76169, 4861, 40785, 97328, 48078, 26060, 89027, 84068, 54302, 6611, 95452, 73801, 64327, 82294, 17874, 29691, 56774, 13041, 51381, 60067, 28985, 68765, 62969, 84317, 11595, 96079, 26155, 52199, 60927, 34067, 52257, 99249, 23139, 21073, 67338, 28650, 17358, 29576, 21963, 36531, 67171, 16919, 91135, 49328, 56508, 58782, 67571, 33131, 770, 82401, 70343, 69458, 1919, 28242, 55176, 30551, 31062, 6550, 27307, 97978, 69092, 46089, 75003, 65981, 26942, 17891, 88438, 4246, 18844, 90363, 2977, 66344, 43914, 4381, 67111, 3164, 98882, 91404, 32457, 97178, 65449, 32245, 81454, 52740, 39882, 22707, 64533, 339, 17746, 13391, 83531, 34339, 18509, 35441, 13839, 8171, 17351, 23950, 99939, 38085, 2109, 35990, 95542, 36995, 60809, 49967, 82694, 49709, 94552, 82415, 46432, 99104, 52606, 12130, 69340, 57495, 65080, 24299, 74950, 78718, 5435, 79494, 31201, 71679, 86026, 67747, 72258, 37981, 9688, 85010, 1502, 94475, 93644, 11139, 69555, 51447, 34953, 26662, 25419, 65371, 12880, 19043, 3964, 8336, 35820, 46590, 21988, 23248, 5364, 82818, 73406, 695, 55645, 56518, 59658, 34621, 63758, 85722, 20188, 4198, 49056, 73439, 12949, 289, 31196, 25091, 69448, 58028, 80680, 56125, 15674, 67118, 61294, 3862, 73116, 31820, 59603, 16544, 9089, 81244, 88506, 72150, 59579, 14687, 93785, 75583, 20946, 71087, 11674, 98081, 39599, 93460, 70077, 38979, 32410, 61753, 48637, 6954, 69955, 82836, 63285, 29290, 95643, 92897, 82369, 24412, 36913, 13115, 21376, 20964, 57305, 79406, 57722, 93586, 4504, 90900, 27551, 75142, 63237, 14041, 77415, 65666, 67419, 37078, 76698, 15348, 43514, 32368, 99733, 44548, 60610, 6389, 36541, 62252, 98414, 69623, 95400, 54341, 50210, 40190, 89464, 22708, 7095, 84440, 922, 97577, 82271, 15107, 50741, 46367, 73469, 68993, 6175, 43446, 70868, 28613, 22836, 33476, 30297, 87449, 85760, 9882, 7406, 63073, 28830, 4738, 91077, 55475, 77649, 4174, 42388, 52023, 79618, 50322, 17230, 20529, 17767, 66081, 53297, 18552, 86257, 33838, 18280, 49613, 67985, 81479, 448, 52160, 79004, 63067, 9618, 75765, 44260, 66192, 36524, 17567, 10397, 81169, 68445, 62018, 99910, 73379, 77054, 49780, 51559, 14687, 57187, 63379, 13994, 71408, 16989, 11855, 67869, 64592, 27893, 64456, 65298, 39117, 39198, 93968, 48419, 52532, 80370, 95860, 71813, 60456, 85372, 303, 3612, 18575, 47183, 44976, 62503, 9746, 63893, 83975, 23025, 89258, 92656, 46055, 16351, 88855, 98410, 15191, 34798, 38190, 90573, 58033, 54836, 28727, 9271, 63777, 84166, 95664, 58837, 91986, 93282, 30759, 62791, 96579, 28709, 47520, 11115, 86163, 76649, 50336, 46519, 79361, 17889, 64283, 64258, 15953, 43339, 4516, 16714, 24556, 59334, 49766, 28566, 86857, 63180, 74243, 24025, 5610, 46536, 24659, 44253, 62337, 6102, 28004, 90987, 66166, 98254, 96571, 35091, 78858, 75288, 72752, 72174, 41054, 93939, 67181, 51546, 42975, 50003, 43166, 71553, 88350, 41698, 91823, 19743, 66010, 92326, 48883, 94325, 32340, 71674, 66734, 99908, 68658, 85600, 2364, 8935, 51434, 73008, 51013, 91720, 68502, 38855, 30741, 3599, 98269, 55479, 61111, 21924, 86615, 38257, 60324, 12332, 5496, 59115, 98235, 75811, 80167, 59842, 55219, 61783, 78213, 68607, 45196, 99910, 12115, 74026, 65133, 85669, 58830, 7874, 52273, 905, 17113, 92318, 48665, 23757, 88982, 59104, 58854, 24440, 45818, 24233, 92150, 5163, 74797, 54739, 78398, 10427, 8588, 99036, 84902, 21853, 62113, 66871, 3056, 66940, 47871, 29681, 7525, 90227, 69785, 84291, 78045, 62721, 6455, 87153, 22132, 61421, 32966, 27617, 367, 76783, 4064, 40051, 38900, 23586, 9940, 33628, 94744, 1018, 74325, 20074, 38922, 85815, 21241, 78584, 90979, 43693, 31594, 16227, 87154, 37796, 52087, 90036, 88169, 33623, 6744, 58251, 7075, 71285, 81930, 98005, 99071, 28785, 57210, 4003, 47285, 72816, 21207, 83522, 11522, 97080, 95298, 73063, 17077, 53433, 39906, 75360, 80261, 32911, 34362, 91937, 76128, 5575, 76188, 79358, 20550, 49751, 80698, 65202, 71366, 57213, 24463, 35084, 78217, 68818, 74858, 89972, 72356, 47569, 46271, 67991, 94929, 55258, 66948, 65980, 76357, 88020, 6724, 91021, 85711, 39035, 23591, 1905, 99605, 86916, 50648, 58231, 12914, 74923, 41625, 25127, 75880, 73858, 25555, 21205, 96715, 35761, 20753, 86494, 19774, 23901, 86096, 74887, 43040, 45424, 29167, 97408, 14963, 51128, 73815, 90506, 11081, 32912, 78214, 56075, 42651, 77394, 76566}, + 15, + }, + + { + []int{9, 4, 2, 10, 7, 8, 8, 1, 9}, + 5, + }, + + { + []int{4, 8, 12, 16}, + 2, + }, + + { + []int{100}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_maxTurbulenceSize(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxTurbulenceSize(tc.A), "输入:%v", tc) + } +} + +func Benchmark_maxTurbulenceSize(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxTurbulenceSize(tc.A) + } + } +} diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/1.png b/Algorithms/0979.distribute-coins-in-binary-tree/1.png new file mode 100644 index 000000000..b351a843e Binary files /dev/null and b/Algorithms/0979.distribute-coins-in-binary-tree/1.png differ diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/2.png b/Algorithms/0979.distribute-coins-in-binary-tree/2.png new file mode 100644 index 000000000..840174598 Binary files /dev/null and b/Algorithms/0979.distribute-coins-in-binary-tree/2.png differ diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/3.png b/Algorithms/0979.distribute-coins-in-binary-tree/3.png new file mode 100644 index 000000000..add2ff713 Binary files /dev/null and b/Algorithms/0979.distribute-coins-in-binary-tree/3.png differ diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/4.png b/Algorithms/0979.distribute-coins-in-binary-tree/4.png new file mode 100644 index 000000000..c5c30f59e Binary files /dev/null and b/Algorithms/0979.distribute-coins-in-binary-tree/4.png differ diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/README.md b/Algorithms/0979.distribute-coins-in-binary-tree/README.md new file mode 100755 index 000000000..d215b654b --- /dev/null +++ b/Algorithms/0979.distribute-coins-in-binary-tree/README.md @@ -0,0 +1,50 @@ +# [979. Distribute Coins in Binary Tree](https://leetcode.com/problems/distribute-coins-in-binary-tree/) + +Given the root of a binary tree with N nodes, each node in the tree has node.val coins, and there are N coins total. + +In one move, we may choose two adjacent nodes and move one coin from one node to another. (The move may be from parent to child, or from child to parent.) + +Return the number of moves required to make every node have exactly one coin. + +Example 1: + +![1](1.png) + +```text +Input: [3,0,0] +Output: 2 +Explanation: From the root of the tree, we move one coin to its left child, and one coin to its right child. +``` + +Example 2: + +![2](2.png) + +```text +Input: [0,3,0] +Output: 3 +Explanation: From the left child of the root, we move two coins to the root [taking two moves]. Then, we move one coin from the root of the tree to the right child. +``` + +Example 3: + +![3](3.png) + +```text +Input: [1,0,2] +Output: 2 +``` + +Example 4: + +![4](4.png) + +```text +Input: [1,0,0,null,3] +Output: 4 +``` + +Note: + +- `1<= N <= 100` +- `0 <= node.val <= N` \ No newline at end of file diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree.go b/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree.go new file mode 100755 index 000000000..8524e891e --- /dev/null +++ b/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree.go @@ -0,0 +1,28 @@ +package problem0979 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func distributeCoins(root *TreeNode) int { + res := 0 + dfs(root, &res) + return res +} + +func dfs(node *TreeNode, res *int) int { + if node == nil { + return 0 + } + l, r := dfs(node.Left, res), dfs(node.Right, res) + *res += abs(l) + abs(r) + return l + r + node.Val - 1 +} + +func abs(a int) int { + if a < 0 { + return -a + } + return a +} diff --git a/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree_test.go b/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree_test.go new file mode 100755 index 000000000..8752bf634 --- /dev/null +++ b/Algorithms/0979.distribute-coins-in-binary-tree/distribute-coins-in-binary-tree_test.go @@ -0,0 +1,55 @@ +package problem0979 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans int +}{ + + { + []int{3, 0, 0}, + 2, + }, + + { + []int{0, 3, 0}, + 3, + }, + + { + []int{1, 0, 2}, + 2, + }, + + { + []int{1, 0, 0, kit.NULL, 3}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_distributeCoins(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, distributeCoins(root), "输入:%v", tc) + } +} + +func Benchmark_distributeCoins(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + distributeCoins(root) + } + } +} diff --git a/Algorithms/0980.unique-paths-iii/README.md b/Algorithms/0980.unique-paths-iii/README.md new file mode 100755 index 000000000..a64ad0c07 --- /dev/null +++ b/Algorithms/0980.unique-paths-iii/README.md @@ -0,0 +1,46 @@ +# [980. Unique Paths III](https://leetcode.com/problems/unique-paths-iii/) + +On a 2-dimensional `grid`, there are 4 types of squares: + +- `1` represents the starting square. There is exactly one starting square. +- `2` represents the ending square. There is exactly one ending square. +- `0` represents empty squares we can walk over. +- `-1` represents obstacles that we cannot walk over. + +Return the number of 4-directional walks from the starting square to the ending square, that **walk over every non-obstacle square exactly once**. + +Example 1: + +```text +Input: [[1,0,0,0],[0,0,0,0],[0,0,2,-1]] +Output: 2 +Explanation: We have the following two paths: +1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2) +2. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2) +``` + +Example 2: + +```text +Input: [[1,0,0,0],[0,0,0,0],[0,0,0,2]] +Output: 4 +Explanation: We have the following four paths: +1. (0,0),(0,1),(0,2),(0,3),(1,3),(1,2),(1,1),(1,0),(2,0),(2,1),(2,2),(2,3) +2. (0,0),(0,1),(1,1),(1,0),(2,0),(2,1),(2,2),(1,2),(0,2),(0,3),(1,3),(2,3) +3. (0,0),(1,0),(2,0),(2,1),(2,2),(1,2),(1,1),(0,1),(0,2),(0,3),(1,3),(2,3) +4. (0,0),(1,0),(2,0),(2,1),(1,1),(0,1),(0,2),(0,3),(1,3),(1,2),(2,2),(2,3) +``` + +Example 3: + +```text +Input: [[0,1],[2,0]] +Output: 0 +Explanation: +There is no path that walks over every empty square exactly once. +Note that the starting and ending square can be anywhere in the grid. +``` + +Note: + +1. `1 <= grid.length * grid[0].length <= 20` \ No newline at end of file diff --git a/Algorithms/0980.unique-paths-iii/unique-paths-iii.go b/Algorithms/0980.unique-paths-iii/unique-paths-iii.go new file mode 100755 index 000000000..ba03e707e --- /dev/null +++ b/Algorithms/0980.unique-paths-iii/unique-paths-iii.go @@ -0,0 +1,58 @@ +package problem0980 + +var dx = []int{0, 0, 1, -1} +var dy = []int{1, -1, 0, 0} + +func uniquePathsIII(grid [][]int) int { + m, n := len(grid), len(grid[0]) + + queue := make([][2]int, 0, m*n*10) + paths := make([]int, 0, m*n*10) + allWalked := 0 + + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + switch grid[i][j] { + case 0: + allWalked |= 1 << uint(i*n+j) + case 1: + allWalked |= 1 << uint(i*n+j) + queue = append(queue, [2]int{i, j}) + paths = append(paths, 1< 0 { + size := len(queue) + for s := 0; s < size; s++ { + x, y := queue[s][0], queue[s][1] + path := paths[s] + for k := 0; k < 4; k++ { + i, j := x+dx[k], y+dy[k] + if i < 0 || m <= i || + j < 0 || n <= j || + path&(1< b { + return a + } + return b +} + +func min(a, b, c int) int { + if a <= b && a <= c { + return a + } + if b <= a && b <= c { + return b + } + return c +} diff --git a/Algorithms/0983.minimum-cost-for-tickets/minimum-cost-for-tickets_test.go b/Algorithms/0983.minimum-cost-for-tickets/minimum-cost-for-tickets_test.go new file mode 100755 index 000000000..e21f4f514 --- /dev/null +++ b/Algorithms/0983.minimum-cost-for-tickets/minimum-cost-for-tickets_test.go @@ -0,0 +1,90 @@ +package problem0983 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + days []int + costs []int + ans int +}{ + + { + []int{1, 4, 6, 7, 8, 20}, + []int{7, 2, 15}, + 6, + }, + + { + []int{1, 4, 6, 7, 8, 20}, + []int{2, 7, 15}, + 11, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 30, 31}, + []int{2, 7, 15}, + 17, + }, + + // 可以有多个 testcase +} + +func Test_mincostTickets(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, mincostTickets(tc.days, tc.costs), "输入:%v", tc) + } +} + +func Benchmark_mincostTickets(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + mincostTickets(tc.days, tc.costs) + } + } +} + +func Test_min(t *testing.T) { + type args struct { + a int + b int + c int + } + tests := []struct { + name string + args args + want int + }{ + + { + "a 最小", + args{a: 0, b: 1, c: 2}, + 0, + }, + + { + "b 最小", + args{a: 1, b: 0, c: 2}, + 0, + }, + + { + "c 最小", + args{a: 2, b: 1, c: 0}, + 0, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := min(tt.args.a, tt.args.b, tt.args.c); got != tt.want { + t.Errorf("min() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/Algorithms/0984.string-without-aaa-or-bbb/README.md b/Algorithms/0984.string-without-aaa-or-bbb/README.md new file mode 100755 index 000000000..55efc24c0 --- /dev/null +++ b/Algorithms/0984.string-without-aaa-or-bbb/README.md @@ -0,0 +1,27 @@ +# [984. String Without AAA or BBB](https://leetcode.com/problems/string-without-aaa-or-bbb/) + +Given two integers A and B, return any string S such that: + +S has length A + B and contains exactly A 'a' letters, and exactly B 'b' letters; +The substring 'aaa' does not occur in S; +The substring 'bbb' does not occur in S. + +Example 1: + +```text +Input: A = 1, B = 2 +Output: "abb" +Explanation: "abb", "bab" and "bba" are all correct answers. +``` + +Example 2: + +```text +Input: A = 4, B = 1 +Output: "aabaa" + +Note: + +- 0 <= A <= 100 +- 0 <= B <= 100 +- It is guaranteed such an S exists for the given A and B. diff --git a/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb.go b/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb.go new file mode 100755 index 000000000..01314f328 --- /dev/null +++ b/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb.go @@ -0,0 +1,29 @@ +package problem0984 + +import "strings" + +func strWithout3a3b(A int, B int) string { + var sb strings.Builder + sb.Grow(A + B) + + a, b := byte('a'), byte('b') + if A < B { + A, B = B, A + a, b = b, a + } + + for A > 0 { + sb.WriteByte(a) + A-- + if A > B { + sb.WriteByte(a) + A-- + } + if B > 0 { + sb.WriteByte(b) + B-- + } + } + + return sb.String() +} diff --git a/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb_test.go b/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb_test.go new file mode 100755 index 000000000..953439c9e --- /dev/null +++ b/Algorithms/0984.string-without-aaa-or-bbb/string-without-aaa-or-bbb_test.go @@ -0,0 +1,78 @@ +package problem0984 + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A int + B int + ans string +}{ + + { + 1, + 2, + "abb", + }, + + { + 1, + 3, + "bbab", + }, + + { + 4, + 1, + "aabaa", + }, + + { + 2, + 5, + "bbabbab", + }, + + { + 2, + 6, + "bbabbabb", + }, + + // 可以有多个 testcase +} + +func isCorrect(A, B int, s string) bool { + if A+B != len(s) || + len(strings.Replace(s, "a", "", -1)) != B || + len(strings.Replace(s, "b", "", -1)) != A { + return false + } + if strings.Contains(s, "aaa") || + strings.Contains(s, "bbb") { + return false + } + return true +} + +func Test_strWithout3a3b(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + str := strWithout3a3b(tc.A, tc.B) + ast.True(isCorrect(tc.A, tc.B, str), "A = %d, B = %d, %s", tc.A, tc.B, str) + } +} + +func Benchmark_strWithout3a3b(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + strWithout3a3b(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0985.sum-of-even-numbers-after-queries/README.md b/Algorithms/0985.sum-of-even-numbers-after-queries/README.md new file mode 100755 index 000000000..b093d2deb --- /dev/null +++ b/Algorithms/0985.sum-of-even-numbers-after-queries/README.md @@ -0,0 +1,30 @@ +# [985. Sum of Even Numbers After Queries](https://leetcode.com/problems/sum-of-even-numbers-after-queries/) + +We have an array `A` of integers, and an array queries of queries. + +For the `i-th` query `val = queries[i][0]`, `index = queries[i][1]`, we add val to `A[index]`. Then, the answer to the `i-th` query is the sum of the even values of A. + +(Here, the given `index = queries[i][1]` is a 0-based index, and each query permanently modifies the array `A`.) + +Return the answer to all queries. Your `answer` array should have `answer[i]` as the answer to the i-th query. + +Example 1: + +```text +Input: A = [1,2,3,4], queries = [[1,0],[-3,1],[-4,0],[2,3]] +Output: [8,6,2,4] +Explanation: +At the beginning, the array is [1,2,3,4]. +After adding 1 to A[0], the array is [2,2,3,4], and the sum of even values is 2 + 2 + 4 = 8. +After adding -3 to A[1], the array is [2,-1,3,4], and the sum of even values is 2 + 4 = 6. +After adding -4 to A[0], the array is [-2,-1,3,4], and the sum of even values is -2 + 4 = 2. +After adding 2 to A[3], the array is [-2,-1,3,6], and the sum of even values is -2 + 6 = 4. +``` + +Note: + +- 1 <= A.length <= 10000 +- -10000 <= A[i] <= 10000 +- 1 <= queries.length <= 10000 +- -10000 <= queries[i][0] <= 10000 +- 0 <= queries[i][1] < A.length \ No newline at end of file diff --git a/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries.go b/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries.go new file mode 100755 index 000000000..5f1017442 --- /dev/null +++ b/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries.go @@ -0,0 +1,27 @@ +package problem0985 + +func sumEvenAfterQueries(A []int, queries [][]int) []int { + res := make([]int, 0, len(A)) + + sumEven := 0 + for _, v := range A { + if v%2 == 0 { + sumEven += v + } + } + + for _, q := range queries { + v, i := q[0], q[1] + old, new := A[i], A[i]+v + if old%2 == 0 { + sumEven -= old + } + if new%2 == 0 { + sumEven += new + } + res = append(res, sumEven) + A[i] = new + } + + return res +} diff --git a/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries_test.go b/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries_test.go new file mode 100755 index 000000000..e808210dd --- /dev/null +++ b/Algorithms/0985.sum-of-even-numbers-after-queries/sum-of-even-numbers-after-queries_test.go @@ -0,0 +1,39 @@ +package problem0985 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + queries [][]int + ans []int +}{ + + { + []int{1, 2, 3, 4}, + [][]int{{1, 0}, {-3, 1}, {-4, 0}, {2, 3}}, + []int{8, 6, 2, 4}, + }, + + // 可以有多个 testcase +} + +func Test_sumEvenAfterQueries(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, sumEvenAfterQueries(tc.A, tc.queries), "输入:%v", tc) + } +} + +func Benchmark_sumEvenAfterQueries(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sumEvenAfterQueries(tc.A, tc.queries) + } + } +} diff --git a/Algorithms/0986.interval-list-intersections/1.png b/Algorithms/0986.interval-list-intersections/1.png new file mode 100644 index 000000000..72102be2e Binary files /dev/null and b/Algorithms/0986.interval-list-intersections/1.png differ diff --git a/Algorithms/0986.interval-list-intersections/README.md b/Algorithms/0986.interval-list-intersections/README.md new file mode 100755 index 000000000..84a29a1cc --- /dev/null +++ b/Algorithms/0986.interval-list-intersections/README.md @@ -0,0 +1,23 @@ +# [986. Interval List Intersections](https://leetcode.com/problems/interval-list-intersections/) + +Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. + +Return the intersection of these two interval lists. + +(Formally, a closed interval [a, b] (with a <= b) denotes the set of real numbers x with a <= x <= b. The intersection of two closed intervals is a set of real numbers that is either empty, or can be represented as a closed interval. For example, the intersection of [1, 3] and [2, 4] is [2, 3].) + +Example 1: + +![1](1.png) + +```text +Input: A = [[0,2],[5,10],[13,23],[24,25]], B = [[1,5],[8,12],[15,24],[25,26]] +Output: [[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]] +Reminder: The inputs and the desired output are lists of Interval objects, and not arrays or lists. +``` + +Note: + +1. `0 <= A.length < 1000` +1. `0 <= B.length < 1000` +1. `0 <= A[i].start, A[i].end, B[i].start, B[i].end < 10^9` \ No newline at end of file diff --git a/Algorithms/0986.interval-list-intersections/interval-list-intersections.go b/Algorithms/0986.interval-list-intersections/interval-list-intersections.go new file mode 100755 index 000000000..b6e4364c3 --- /dev/null +++ b/Algorithms/0986.interval-list-intersections/interval-list-intersections.go @@ -0,0 +1,39 @@ +package problem0986 + +func intervalIntersection(A [][]int, B [][]int) [][]int { + sizeA, sizeB := len(A), len(B) + res := make([][]int, 0, sizeA+sizeB) + for i, j := 0, 0; i < sizeA && j < sizeB; { + switch { + case A[i][1] < B[j][0]: + i++ + case B[j][1] < A[i][0]: + j++ + default: + res = append(res, []int{ + max(A[i][0], B[j][0]), + min(A[i][1], B[j][1]), + }) + if A[i][1] < B[j][1] { + i++ + } else { + j++ + } + } + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0986.interval-list-intersections/interval-list-intersections_test.go b/Algorithms/0986.interval-list-intersections/interval-list-intersections_test.go new file mode 100755 index 000000000..4e47a3f02 --- /dev/null +++ b/Algorithms/0986.interval-list-intersections/interval-list-intersections_test.go @@ -0,0 +1,51 @@ +package problem0986 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + B [][]int + ans [][]int +}{ + + { + [][]int{{0, 2}, {5, 10}, {13, 23}, {24, 25}}, + [][]int{{1, 2}, {8, 12}, {15, 24}, {25, 26}}, + [][]int{{1, 2}, {8, 10}, {15, 23}, {24, 24}, {25, 25}}, + }, + + { + [][]int{{0, 2}, {5, 10}, {13, 23}, {24, 25}}, + [][]int{{1, 5}, {8, 12}, {15, 24}, {25, 26}}, + [][]int{{1, 2}, {5, 5}, {8, 10}, {15, 23}, {24, 24}, {25, 25}}, + }, + + { + [][]int{{0, 2}, {5, 10}, {13, 23}, {24, 25}}, + [][]int{{1, 1}, {8, 12}, {15, 24}, {25, 26}}, + [][]int{{1, 1}, {8, 10}, {15, 23}, {24, 24}, {25, 25}}, + }, + + // 可以有多个 testcase +} + +func Test_intervalIntersection(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, intervalIntersection(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_intervalIntersection(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + intervalIntersection(tc.A, tc.B) + } + } +} diff --git a/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/1.png b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/1.png new file mode 100644 index 000000000..f276f30b6 Binary files /dev/null and b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/1.png differ diff --git a/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/2.png b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/2.png new file mode 100644 index 000000000..bc09c349f Binary files /dev/null and b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/2.png differ diff --git a/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/README.md b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/README.md new file mode 100755 index 000000000..d3812867f --- /dev/null +++ b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/README.md @@ -0,0 +1,43 @@ +# [987. Vertical Order Traversal of a Binary Tree](https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/) + +Given a binary tree, return the vertical order traversal of its nodes values. + +For each node at position (X, Y), its left and right children respectively will be at positions (X-1, Y-1) and (X+1, Y-1). + +Running a vertical line from X = -infinity to X = +infinity, whenever the vertical line touches some nodes, we report the values of the nodes in order from top to bottom (decreasing Y coordinates). + +If two nodes have the same position, then the value of the node that is reported first is the value that is smaller. + +Return an list of non-empty reports in order of X coordinate. Every report will have a list of values of nodes. + +Example 1: + +![1](1.png) + +```text +Input: [3,9,20,null,null,15,7] +Output: [[9],[3,15],[20],[7]] +Explanation: +Without loss of generality, we can assume the root node is at position (0, 0): +Then, the node with value 9 occurs at position (-1, -1); +The nodes with values 3 and 15 occur at positions (0, 0) and (0, -2); +The node with value 20 occurs at position (1, -1); +The node with value 7 occurs at position (2, -2). +``` + +Example 2: + +![2](2.png) + +```text +Input: [1,2,3,4,5,6,7] +Output: [[4],[2],[1,5,6],[3],[7]] +Explanation: +The node with value 5 and the node with value 6 have the same position according to the given scheme. +However, in the report "[1,5,6]", the node value of 5 comes first since 5 is smaller than 6. +``` + +Note: + +- `The tree will have between 1 and 1000 nodes.` +- `Each node's value will be between 0 and 1000.` diff --git a/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.go b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.go new file mode 100755 index 000000000..13e8c900b --- /dev/null +++ b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.go @@ -0,0 +1,59 @@ +package problem0987 + +import ( + "sort" + + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func verticalTraversal(root *TreeNode) [][]int { + ds := make([]data, 0, 1024) + dfs(root, 0, 0, &ds) + + sort.Slice(ds, func(i int, j int) bool { + if ds[i].x == ds[j].x { + if ds[i].y == ds[j].y { + return ds[i].value < ds[j].value + } + return ds[i].y > ds[j].y + } + return ds[i].x < ds[j].x + }) + + res := make([][]int, 0, len(ds)) + + x := ds[0].x + values := make([]int, 0, 10) + for _, d := range ds { + if x == d.x { + values = append(values, d.value) + continue + } + res = append(res, values) + values = append(make([]int, 0, 10), d.value) + x = d.x + } + res = append(res, values) + + return res +} + +type data struct { + value, x, y int +} + +func dfs(node *TreeNode, x, y int, dataSlice *[]data) { + if node == nil { + return + } + dfs(node.Left, x-1, y-1, dataSlice) + *dataSlice = append(*dataSlice, data{ + value: node.Val, + x: x, + y: y, + }) + dfs(node.Right, x+1, y-1, dataSlice) +} diff --git a/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree_test.go b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree_test.go new file mode 100755 index 000000000..d14d8d057 --- /dev/null +++ b/Algorithms/0987.vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree_test.go @@ -0,0 +1,50 @@ +package problem0987 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans [][]int +}{ + + { + []int{0, 2, 1, 3, kit.NULL, kit.NULL, kit.NULL, 4, 5, kit.NULL, 7, 6, kit.NULL, 10, 8, 11, 9}, + [][]int{{4, 10, 11}, {3, 6, 7}, {2, 5, 8, 9}, {0}, {1}}, + }, + + { + []int{3, 9, 20, kit.NULL, kit.NULL, 15, 7}, + [][]int{{9}, {3, 15}, {20}, {7}}, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7}, + [][]int{{4}, {2}, {1, 5, 6}, {3}, {7}}, + }, + + // 可以有多个 testcase +} + +func Test_verticalTraversal(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, verticalTraversal(root), "输入:%v", tc) + } +} + +func Benchmark_verticalTraversal(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + verticalTraversal(root) + } + } +} diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/1.png b/Algorithms/0988.smallest-string-starting-from-leaf/1.png new file mode 100644 index 000000000..e858b9aa8 Binary files /dev/null and b/Algorithms/0988.smallest-string-starting-from-leaf/1.png differ diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/2.png b/Algorithms/0988.smallest-string-starting-from-leaf/2.png new file mode 100644 index 000000000..b38b85868 Binary files /dev/null and b/Algorithms/0988.smallest-string-starting-from-leaf/2.png differ diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/3.png b/Algorithms/0988.smallest-string-starting-from-leaf/3.png new file mode 100644 index 000000000..9d621d7a3 Binary files /dev/null and b/Algorithms/0988.smallest-string-starting-from-leaf/3.png differ diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/README.md b/Algorithms/0988.smallest-string-starting-from-leaf/README.md new file mode 100755 index 000000000..772c2e7a7 --- /dev/null +++ b/Algorithms/0988.smallest-string-starting-from-leaf/README.md @@ -0,0 +1,39 @@ +# [988. Smallest String Starting From Leaf](https://leetcode.com/problems/smallest-string-starting-from-leaf/) + +Given the root of a binary tree, each node has a value from 0 to 25 representing the letters 'a' to 'z': a value of 0 represents 'a', a value of 1 represents 'b', and so on. + +Find the lexicographically smallest string that starts at a leaf of this tree and ends at the root. + +(As a reminder, any shorter prefix of a string is lexicographically smaller: for example, "ab" is lexicographically smaller than "aba". A leaf of a node is a node that has no children.) + +Example 1: + +![1](1.png) + +```text +Input: [0,1,2,3,4,3,4] +Output: "dba" +``` + +Example 2: + +![2](2.png) + +```text +Input: [25,1,3,1,3,0,2] +Output: "adz" +``` + +Example 3: + +![3](3.png) + +```text +Input: [2,2,1,null,1,0,null,0] +Output: "abc" +``` + +Note: + +- The number of nodes in the given tree will be between 1 and 8500. +- Each node in the tree will have a value between 0 and 25. \ No newline at end of file diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf.go b/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf.go new file mode 100755 index 000000000..c017b0aee --- /dev/null +++ b/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf.go @@ -0,0 +1,38 @@ +package problem0988 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func smallestFromLeaf(root *TreeNode) string { + res := string('z' + 1) + dfs(root, "", &res) + return res +} + +func dfs(node *TreeNode, s string, res *string) { + s = string('a'+node.Val) + s + + if node.Left == nil && node.Right == nil { + *res = min(*res, s) + return + } + + if node.Left != nil { + dfs(node.Left, s, res) + } + + if node.Right != nil { + dfs(node.Right, s, res) + } +} + +func min(a, b string) string { + if a < b { + return a + } + return b +} diff --git a/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf_test.go b/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf_test.go new file mode 100755 index 000000000..9cc9f9684 --- /dev/null +++ b/Algorithms/0988.smallest-string-starting-from-leaf/smallest-string-starting-from-leaf_test.go @@ -0,0 +1,66 @@ +package problem0988 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans string +}{ + + { + + []int{25, 1, kit.NULL, 0, 0, 1, kit.NULL, kit.NULL, kit.NULL, 0}, + "ababz", + }, + + { + []int{4, 0, 1, 1}, + "bae", + }, + + { + []int{25, 1, 3, 1, 3, 0, 2}, + "adz", + }, + + { + []int{0, 1, 2, 3, 4, 3, 4}, + "dba", + }, + + { + []int{25, 1, 3, 1, 3, 0, 2}, + "adz", + }, + + { + []int{2, 2, 1, kit.NULL, 1, 0, kit.NULL, 0}, + "abc", + }, + + // 可以有多个 testcase +} + +func Test_smallestFromLeaf(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, smallestFromLeaf(root), "输入:%v", tc) + } +} + +func Benchmark_smallestFromLeaf(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + smallestFromLeaf(root) + } + } +} diff --git a/Algorithms/0989.add-to-array-form-of-integer/README.md b/Algorithms/0989.add-to-array-form-of-integer/README.md new file mode 100755 index 000000000..f490c8f03 --- /dev/null +++ b/Algorithms/0989.add-to-array-form-of-integer/README.md @@ -0,0 +1,44 @@ +# [989. Add to Array-Form of Integer](https://leetcode.com/problems/add-to-array-form-of-integer/) + +For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For example, if X = 1231, then the array form is [1,2,3,1]. + +Given the array-form A of a non-negative integer X, return the array-form of the integer X+K. + +Example 1: + +```text +Input: A = [1,2,0,0], K = 34 +Output: [1,2,3,4] +Explanation: 1200 + 34 = 1234 +``` + +Example 2: + +```text +Input: A = [2,7,4], K = 181 +Output: [4,5,5] +Explanation: 274 + 181 = 455 +``` + +Example 3: + +```text +Input: A = [2,1,5], K = 806 +Output: [1,0,2,1] +Explanation: 215 + 806 = 1021 +``` + +Example 4: + +```text +Input: A = [9,9,9,9,9,9,9,9,9,9], K = 1 +Output: [1,0,0,0,0,0,0,0,0,0,0] +Explanation: 9999999999 + 1 = 10000000000 +``` + +Note: + +- 1 <= A.length <= 10000 +- 0 <= A[i] <= 9 +- 0 <= K <= 10000 +- If A.length > 1, then A[0] != 0 \ No newline at end of file diff --git a/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer.go b/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer.go new file mode 100755 index 000000000..61c5372c0 --- /dev/null +++ b/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer.go @@ -0,0 +1,36 @@ +package problem0989 + +func addToArrayForm(A []int, K int) []int { + size := len(A) + A[size-1] += K + for i := size - 1; i > 0 && A[i] > 9; i-- { + A[i-1] += A[i] / 10 + A[i] %= 10 + } + + if A[0] < 10 { + return A + } + + A0 := num2ints(A[0]) + return append(A0, A[1:]...) +} + +func num2ints(n int) []int { + res := make([]int, 0, 8) + for n > 0 { + res = append(res, n%10) + n /= 10 + } + reverse(res) + return res +} + +func reverse(A []int) { + i, j := 0, len(A)-1 + for i < j { + A[i], A[j] = A[j], A[i] + i++ + j-- + } +} diff --git a/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer_test.go b/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer_test.go new file mode 100755 index 000000000..a4ad8fc61 --- /dev/null +++ b/Algorithms/0989.add-to-array-form-of-integer/add-to-array-form-of-integer_test.go @@ -0,0 +1,63 @@ +package problem0989 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans []int +}{ + + { + []int{1, 2, 6, 3, 0, 7, 1, 7, 1, 9, 7, 5, 6, 6, 4, 4, 0, 0, 6, 3}, + 516, + []int{1, 2, 6, 3, 0, 7, 1, 7, 1, 9, 7, 5, 6, 6, 4, 4, 0, 5, 7, 9}, + }, + + { + []int{1, 2, 0, 0}, + 34, + []int{1, 2, 3, 4}, + }, + + { + []int{2, 7, 4}, + 181, + []int{4, 5, 5}, + }, + + { + []int{2, 1, 5}, + 806, + []int{1, 0, 2, 1}, + }, + + { + []int{9, 9, 9, 9, 9, 9, 9, 9, 9, 9}, + 1, + []int{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_addToArrayForm(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, addToArrayForm(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_addToArrayForm(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + addToArrayForm(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0990.satisfiability-of-equality-equations/README.md b/Algorithms/0990.satisfiability-of-equality-equations/README.md new file mode 100755 index 000000000..d99679dea --- /dev/null +++ b/Algorithms/0990.satisfiability-of-equality-equations/README.md @@ -0,0 +1,50 @@ +# [990. Satisfiability of Equality Equations](https://leetcode.com/problems/satisfiability-of-equality-equations/) + +Given an array equations of strings that represent relationships between variables, each string equations[i] has length 4 and takes one of two different forms: "a==b" or "a!=b". Here, a and b are lowercase letters (not necessarily different) that represent one-letter variable names. + +Return true if and only if it is possible to assign integers to variable names so as to satisfy all the given equations. + +Example 1: + +```text +Input: ["a==b","b!=a"] +Output: false +Explanation: If we assign say, a = 1 and b = 1, then the first equation is satisfied, but not the second. There is no way to assign the variables to satisfy both equations. +``` + +Example 2: + +```text +Input: ["b==a","a==b"] +Output: true +Explanation: We could assign a = 1 and b = 1 to satisfy both equations. +``` + +Example 3: + +```text +Input: ["a==b","b==c","a==c"] +Output: true +``` + +Example 4: + +```text +Input: ["a==b","b!=c","c==a"] +Output: false +``` + +Example 5: + +```text +Input: ["c==c","b==d","x!=z"] +Output: true +``` + +Note: + +- `1 <= equations.length <= 500` +- `equations[i].length == 4` +- `equations[i][0] and equations[i][3] are lowercase letters` +- `equations[i][1] is either '=' or '!'` +- `equations[i][2] is '='` diff --git a/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations.go b/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations.go new file mode 100755 index 000000000..f0b226c24 --- /dev/null +++ b/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations.go @@ -0,0 +1,44 @@ +package problem0990 + +func equationsPossible(equations []string) bool { + u := newUnion(26) + + for _, e := range equations { + if e[1] == '=' { + u.unite(e[0]-'a', e[3]-'a') + } + } + + for _, e := range equations { + if e[1] == '!' && u.find(e[0]-'a') == u.find(e[3]-'a') { + return false + } + } + + return true +} + +type union struct { + parent []byte +} + +func newUnion(size int) *union { + parent := make([]byte, size) + for i := range parent { + parent[i] = byte(i) + } + return &union{ + parent: parent, + } +} + +func (u *union) find(i byte) byte { + if u.parent[i] != i { + u.parent[i] = u.find(u.parent[i]) + } + return u.parent[i] +} + +func (u *union) unite(x, y byte) { + u.parent[u.find(x)] = u.find(y) +} diff --git a/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations_test.go b/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations_test.go new file mode 100755 index 000000000..8a2bf76ab --- /dev/null +++ b/Algorithms/0990.satisfiability-of-equality-equations/satisfiability-of-equality-equations_test.go @@ -0,0 +1,67 @@ +package problem0990 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + equations []string + ans bool +}{ + + { + []string{"a==b", "b!=a"}, + false, + }, + + { + []string{"b==a", "a==b"}, + true, + }, + + { + []string{"a==b", "b==c", "a==c"}, + true, + }, + + { + []string{"b!=b"}, + false, + }, + + { + []string{"a==b", "b!=c", "c==a"}, + false, + }, + + { + []string{"c==c", "b==d", "x!=z"}, + true, + }, + + { + []string{"a==b", "c!=d"}, + true, + }, + + // 可以有多个 testcase +} + +func Test_equationsPossible(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, equationsPossible(tc.equations), "输入:%v", tc) + } +} + +func Benchmark_equationsPossible(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + equationsPossible(tc.equations) + } + } +} diff --git a/Algorithms/0991.broken-calculator/README.md b/Algorithms/0991.broken-calculator/README.md new file mode 100755 index 000000000..45be942de --- /dev/null +++ b/Algorithms/0991.broken-calculator/README.md @@ -0,0 +1,47 @@ +# [991. Broken Calculator](https://leetcode.com/problems/broken-calculator/) + +On a broken calculator that has a number showing on its display, we can perform two operations: + +- Double: Multiply the number on the display by 2, or; +- Decrement: Subtract 1 from the number on the display. + +Initially, the calculator is displaying the number X. + +Return the minimum number of operations needed to display the number Y. + +Example 1: + +```text +Input: X = 2, Y = 3 +Output: 2 +Explanation: Use double operation and then decrement operation {2 -> 4 -> 3}. +``` + +Example 2: + +```text +Input: X = 5, Y = 8 +Output: 2 +Explanation: Use decrement and then double {5 -> 4 -> 8}. +``` + +Example 3: + +```text +Input: X = 3, Y = 10 +Output: 3 +Explanation: Use double, decrement and double {3 -> 6 -> 5 -> 10}. +``` + +Example 4: + +```text +Input: X = 1024, Y = 1 +Output: 1023 +Explanation: Use decrement operations 1023 times. +``` + +Note: + +- `1 <= X <= 10^9` +- `1 <= Y <= 10^9` diff --git a/Algorithms/0991.broken-calculator/broken-calculator.go b/Algorithms/0991.broken-calculator/broken-calculator.go new file mode 100755 index 000000000..da645c50a --- /dev/null +++ b/Algorithms/0991.broken-calculator/broken-calculator.go @@ -0,0 +1,11 @@ +package problem0991 + +// ref: https://leetcode.com/problems/broken-calculator/discuss/234484/JavaC%2B%2BPython-Change-Y-to-X-in-1-Line +func brokenCalc(X int, Y int) int { + res := 0 + for X < Y { + res += Y%2 + 1 + Y = (Y + 1) / 2 + } + return res + X - Y +} diff --git a/Algorithms/0991.broken-calculator/broken-calculator_test.go b/Algorithms/0991.broken-calculator/broken-calculator_test.go new file mode 100755 index 000000000..7163dc6ce --- /dev/null +++ b/Algorithms/0991.broken-calculator/broken-calculator_test.go @@ -0,0 +1,69 @@ +package problem0991 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + X int + Y int + ans int +}{ + + { + 68, + 71, + 34, + }, + + { + 1, + 1000000000, + 39, + }, + + { + 2, + 3, + 2, + }, + + { + 5, + 8, + 2, + }, + + { + 3, + 10, + 3, + }, + + { + 1024, + 1, + 1023, + }, + + // 可以有多个 testcase +} + +func Test_brokenCalc(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, brokenCalc(tc.X, tc.Y), "输入:%v", tc) + } +} + +func Benchmark_brokenCalc(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + brokenCalc(tc.X, tc.Y) + } + } +} diff --git a/Algorithms/0992.subarrays-with-k-different-integers/README.md b/Algorithms/0992.subarrays-with-k-different-integers/README.md new file mode 100755 index 000000000..e3e2f463d --- /dev/null +++ b/Algorithms/0992.subarrays-with-k-different-integers/README.md @@ -0,0 +1,29 @@ +# [992. Subarrays with K Different Integers](https://leetcode.com/problems/subarrays-with-k-different-integers/) + +Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in that subarray is exactly K. + +(For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.) + +Return the number of good subarrays of A. + +Example 1: + +```text +Input: A = [1,2,1,2,3], K = 2 +Output: 7 +Explanation: Subarrays formed with exactly 2 different integers: [1,2], [2,1], [1,2], [2,3], [1,2,1], [2,1,2], [1,2,1,2]. +``` + +Example 2: + +```text +Input: A = [1,2,1,3,4], K = 3 +Output: 3 +Explanation: Subarrays formed with exactly 3 different integers: [1,2,1,3], [2,1,3], [1,3,4]. +``` + +Note: + +- `1 <= A.length <= 20000` +- `1 <= A[i] <= A.length` +- `1 <= K <= A.length` diff --git a/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers.go b/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers.go new file mode 100755 index 000000000..16f7c2a7d --- /dev/null +++ b/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers.go @@ -0,0 +1,28 @@ +package problem0992 + +// ref: https://leetcode.com/problems/subarrays-with-k-different-integers/discuss/234482/JavaC%2B%2BPython-Sliding-Window-with-Video +func subarraysWithKDistinct(A []int, K int) int { + return atMostK(A, K) - atMostK(A, K-1) +} + +func atMostK(A []int, K int) int { + count := [20001]int{} + res := 0 + for l, r := 0, 0; r < len(A); r++ { + if count[A[r]] == 0 { + K-- + } + count[A[r]]++ + for K < 0 { + count[A[l]]-- + if count[A[l]] == 0 { + K++ + } + l++ + } + // the number of distinct elements in A[i:r+1] (l<=i<=r) + // is NOT more than K + res += r + 1 - l + } + return res +} diff --git a/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers_test.go b/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers_test.go new file mode 100755 index 000000000..01aa9ba93 --- /dev/null +++ b/Algorithms/0992.subarrays-with-k-different-integers/subarrays-with-k-different-integers_test.go @@ -0,0 +1,63 @@ +package problem0992 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{ 2690,798,5800,94,2066,8611,5951,4576,5884,6357,3937,2533,3518,3237,1959,6006,1851,6262,7148,8002,8939,5855,6370,8250,1766,6669,8733,4627,6333,558,7446,3415,9345,7094,6585,5556,7562,9374,2503,9499,4497,176,6037,3330,7846,8605,9947,5395,7195,23,8055,2315,6214,5431,4695,2124,5555,7224,7906,5323,8848,810,880,1746,192,1504,685,2895,297,6978,8874,8452,8293,828,2780,3541,9221,9357,7195,4381,6121,4425,7220,4025,8009,6168,9752,8955,5567,6484,5451,7736,1211,6687,870,3979,8830,1627,2581,6288,3327,9216,377,281,6729,7113,3735,941,8891,423,8087,4804,4566,6653,8454,2876,7651,2386,7668,7095,8443,1874,6295,8955,5692,8989,5190,1744,3323,6615,1407,6789,605,7558,4338,3372,7452,279,2580,170,9608,3066,2173,2120,9651,9745,650,2644,7476,197,4315,6977,565,5393,6310,6034,5909,9653,6163,3363,4455,7316,8525,5696,4353,1526,5111,5596,878,7223,4501,7340,6205,9398,8015,8185,1631,2023,2690,482,5693,7458,3438,1079,5151,5617,2441,6463,7302,6630,7930,867,9635,6419,2751,449,8621,9503,8839,8522,5408,3048,7049,4196,8425,412,5932,5912,299,4686,1036,8821,9036,2632,7452,635,872,4243,9166,3729,1501,4080,3964,9840,8942,7858,3651,6422,3457,4258,819,2276,49,794,9216,1568,8844,6218,5140,4420,1333,1015,3211,9917,3635,6823,1861,1757,337,9798,3703,3529,9452,7155,650,8683,3144,3651,779,3057,1915,3806,7386,6460,81,173,5883,7139,7814,8610,5495,3357,5327,1632,9772,5946,2865,4447,857,5851,7320,9642,8883,1702,3410,3376,4435,3651,8994,6086,4326,6785,7149,6355,1435,8049,1392,7618,1673,9210,2120,564,9574,8388,7992,651,2465,9693,167,4817,8825,4215,4895,3071,9091,2663,4175,182,6968,8584,1514,7561,8468,3430,9862,9057,4793,2628,5662,8472,362,6294,4833,3854,5952,4232,2368,9368,4632,4693,4132,3003,2371,5120,8949,2997,9973,8223,8580,5813,711,6778,8002,9902,8454,5281,9015,584,7441,1444,2604,623,3646,3528,8129,5810,7845,5481,1512,5749,1748,9122,5448,2431,2969,3734,5707,173,5131,8923,704,1261,6018,8762,521,6964,8874,5441,3246,6313,2661,1872,73,3095,742,2319,8056,6703,2550,935,6735,3444,5394,6404,9075,9197,395,5658,47,5094,2501,5757,4691,2591,9400,1383,4032,8876,7714,2534,2045,3107,7012,7387,1525,449,2800,6172,2679,8069,2,1106,7381,932,484,7148,6533,1347,5335,2299,2003,528,5297,228,7117,3066,3082,4033,5557,7412,3742,8224,9011,7574,4990,258,241,348,4702,6861,717,5029,393,3275,3322,6837,9049,6697,7599,1091,1247,4873,6918,9036,2273,2896,2990,3918,6054,4296,8618,1790,7788,3359,4976,5347,4211,9815,6699,2600,7792,4260,6506,350,3611,6401,2911,4935,6705,1051,7664,6060,8386,3108,4297,1225,1012,9441,4935,1708,2894,733,8399,3449,9934,4052,2293,1992,6500,6457,1429,1429,8100,6240,7614,5488,3688,4724,2834,75,4348,194,712,8607,2096,3901,2890,3207,5002,2120,6151,8578,9457,9519,8002,5269,3427,3982,4353,3431,2992,2392,9967,5508,6172,8001,8666,5515,8433,4645,3861,5568,9291,6751,8376,4826,538,2786,4651,1430,531,9412,6031,242,5424,6366,4645,7251,9099,9597,1172,3680,4887,7076,8759,6500,8855,8808,1325,7680,4085,2866,9512,7958,6749,9121,8782,9471,9279,8613,4027,1654,2992,5781,189,651,8713,2970,2455,3490,5431,2882,9790,4657,9161,318,2655,3093,7990,9236,1687,6253,6500,7645,5817,2829,4146,5752,9868,2061,703,8998,5642,2248,2656,5180,2243,6494,5390,5732,8200,2114,2357,9212,2352,9660,4263,1157,9766,8407,9431,389,9528,2788,9391,7158,2618,9270,6730,2789,3169,5797,9738,9523,1129,8107,8867,1415,9184,9385,6846,6747,88,9907,8967,4363,1433,4080,7360,1721,8476,6507,6668,4603,9281,613,8420,8091,3242,8720,9926,9782,9886,5349,4033,3054,2375,4943,3450,6456,4564,4222,8841,4751,6280,1894,5501,7023,8873,1885,3764,9274,2802,9728,452,2167,1233,9358,2725,990,5497,9339,1365,8461,9218,6783,1090,5078,3700,981,9171,1535,5168,9820,1840,1184,9559,9817,2581,3864,9824,3299,8979,1897,1750,5030,2751,1944,3928,2097,9122,8910,8824,8056,6263,9081,701,2178,2831,4699,3440,5644,5904,4570,8434,8404,6210,6463,3077,3278,2337,5479,8655,7459,6686,3989,5290,8797,8750,1006,6246,7341,9337,2555,3190,2021,8588,1403,1263,4350,9288,7102,620,500,6064,1627,3676,228,3583,8827,2930,1941,3664,2203,7413,1900,9124,1198,9998,1766,6272,3977,8236,194,7404,9414,2675,6676,4213,4753,8712,2484,5803,6478,2023,2477,5428,1153,4158,9374,3735,2020,7743,3340,1506,3636,5842,8654,4869,9093,496,8224,4469,4762,2473,5489,1962,2189,783,3349,385,45,2777,8947,3146,9371,9345,9079,5387,6300,4854,8961,6683,6634,1611,5845,4488,4259,8422,1370,9682,5736,3682,6283,2237,127,3869,761,3843,1810,715,9542,4480,8398,5825,6747,8692,261,9962,2323,5460,1964,3398,6878,3418,4910,6294,3295,8192,3159,1634,4878,7049,5577,9155,8903,8313,9083,7577,2970,1847,2948,6421,9593,1522,4437,8016,7628,3897,9949,2819,2672,6850,7970,61,1332,8628,1439,177,6522,2300,7680,8740,6956,332,4215,2435,2325,5304,2891,3195,7220,1031,596,9567,4349,3144,2832,6615,1223,698,3249,1547,1310,3106,7373,4459,5442,5529,4397,1082,6455,7724,2958,7678,9844,2970,2115,2739,7988,8106,4224,2885,7319,2354,1073,8073,8898,7057,7617,6612,8219,662,9875,8802,9518,2934,3117,705,2843,9610,9704,4883,565,318,898,4832,5348,4324,5115,9665,9940,7567,7515,8742,7556,1048,4747,2897,4360,4733,7959,2937,8488,4429,9091,1224,2111,8253,6819,2446,3020,8678,5153,1083,4420,8340,4778,7976,9918,1176,2657,6975,1557,1303,1163,4767,7786,1050,2514,6233,688,6476,7571,8453,4446,7695,3903,7870,7152,1239,5325,6466,6583,3821,1654,563,5892,9597,1544,9448,9809,552,5941,1629,6808,3363,3633,9982,9177,9239,2374,3072,8377,3503,7427,4617,9278,9628,9561,4035,4452,3668,7549,3181,9595,191,9338,2169,4086,9529,9724,4159,4493,851,2965,8473,2572,3602,9899,3701,9378,8591,424,8407,1475,1061,2265,5604,4951,5285,2560,6247,5496,117,8274,4783,6056,4669,8186,5791,8345,1929,4756,2702,9858,1642,6771,2165,7281,8133,7627,4003,2788,3986,7511,8860,7198,2318,6100,678,6825,697,2436,746,8478,8313,8013,8089,686,2518,3800,2405,8445,748,1026,4563,8017,4460,7422,5296,6535,5626,6656,8601,6207,10000,4499,6561,5771,1690,245,1215,2596,4825,1926,7725,8181,3616,7565,3706,2174,5930,658,4777,8690,9122,5781,7776,2217,3064,9510,5546,8303,4995,4698,7973,2259,9642,9501,309,9961,7450,8906,1919,6137,9859,7621,4895,3773,8635,1986,6914,7607,5209,4043,6237,1816,8267,9613,6804,9002,1073,5019,611,5240,1247,2714,9545,7697,7055,9572,8056,5000,1069,5669,6711,9734,6601,7473,2592,6455,4392,7516,7714,3657,4948,9856,6032,848,775,9483,7263,8069,9572,6702,4476,2098,6174,9039,5892,3239,7151,56,8907,5609,9747,3989,3910,8846,6458,1930,6592,1649,953,1835,7321,2692,681,6178,7762,7945,3079,2397,2114,5833,1315,4398,4052,5549,2273,1609,9399,9767,7963,4697,8797,2874,4892,9579,4364,8702,3382,9633,7904,3069,3261,4576,4759,9161,411,3730,7779,916,5178,3765,5228,9541,8797,9019,3467,4650,9031,648,4160,7185,3585,5207,6222,7581,921,1381,6442,8599,5934,1028,5631,8091,6005,1834,9372,375,1319,9919,8020,8623,4368,9235,5357,6460,9202,3509,5922,7336,4336,3933,2209,1987,9187,2115,4718,9969,569,4949,3262,4650,6721,7653,349,3625,2512,4425,4921,1998,2031,2330,5140,5532,9786,1381,2069,3723,8082,5981,3320,3127,9100,2535,1306,3247,7777,476,8125,8135,252,650,7354,6166,2895,4740,6506,8329,8190,1022,8780,2702,5761,5681,1379,5162,2823,925,853,7044,5054,9778,4109,359,5612,8438,9849,7540,7849,4594,7196,7070,6642,7669,7149,7004,2296,159,855,9770,1391,103,2999,7000,3855,9446,4865,8617,5911,5514,5756,3062,1189,2756,9233,1257,2623,4138,5440,802,5373,7014,4522,8998,1436,3892,360,7130,6044,7912,6675,7772,4195,438,442,5659,5081,6904,127,2154,7482,8044,6170,6241,4231,8387,5700,8700,7445,1684,9309,3882,9612,214,9704,8015,6233,8761,1338,5122,7436,1710,4990,8400,4571,1114,1075,87,2205,5784,9820,8364,7296,1716,5759,7494,260,7376,6647,7968,1486,2738,3731,1739,6646,8388,9908,6873,2921,2147,6419,4147,6919,3697,9800,2516,4534,9364,3572,9964,4749,7268,7736,6223,7562,3297,1468,4387,6397,3162,7017,341,5387,1607,431,5973,2571,1200,1312,8293,8476,3075,2035,4766,654,6066,2594,2954,5332,5923,2060,8123,1416,78,3844,4387,3319,5123,8464,2538,6721,4961,970,3292,6538,9568,6323,9080,5340,6728,5675,7762,6099,7864,2538,1809,7279,4288,3611,8930,677,6998,7947,9299,7679,9669,1566,6297,4983,5610,1931,9274,5328,6454,8331,5236,2637,6334,1038,7188,9224,6110,2661,5856,3869,945,3257,9550,9420,3547,5203,6666,9290,5360,7666,4964,272,4826,5160,9472,6635,7526,9357,3732,8250,487,7051,9981,3348,2706,3392,1690,8895,865,5263,2735,8234,9009,6911,4580,916,1491,5050,5508,2002,2238,2415,7967,7021,5979,4241,584,2546,728,3207,599,8736,5958,2554,1127,4861,7627,1017,937,8562,449,1656,2432,7466,7845,9820,931,5943,2969,1345,5631,4077,1058,8548,3346,9925,5242,5834,337,1628,7407,183,4451,2497,3538,5416,9971,7834,3882,8250,2098,688,4639,3776,1986,94,8847,9345,6380,246,5291,4199,843,492,475,5473,6975,9353,2102,1233,1851,6985,5563,9231,1688,8461,572,2261,4848,5946,3341,162,6835,1160,2777,2647,3925,3957,7405,3820,9406,6543,8843,876,3257,9277,5353,20,5109,8839,5536,9496,8311,8825,2973,8703,3990,693,3506,930,9086,2686,8518,1297,4174,781,1105,3374,7898,239,1378,8831,425,5429,9577,7808,6023,114,5804,655,3877,7041,3830,47,4404,685,164,4293,1246,9223,5830,2670,4077,1732,9380,9399,7458,4268,1654,2819,1327,4764,4283,6281,4621,7845,2387,8900,1719,5979,7157,5681,1069,7334,9882,4868,3763,8628,3408,8835,4575,3125,6792,6441,9726,14,7127,8661,3375,9527,2345,5208,1110,6157,1130,6811,4203,1344,9755,535,9209,3414,7299,9274,4623,4150,2427,9705,5042,1470,5441,9512,89,6526,1142,5460,2448,3323,7568,1082,8310,4973,2985,1373,4350,3409,3150,6500,9810,7367,8848,1065,4923,8325,1446,9483,1914,1714,2218,4013,2291,5164,1223,6213,3229,5971,8882,6061,5971,4955,8878,8710,1605,2638,4758,6848,4024,2888,887,1508,7026,1193,3058,5882,751,7383,5519,3795,863,8137,8325,6832,4485,9453,5379,8136,8537,1746,2779,3766,8983,1247,9089,4393,1998,4491,6688,9283,7491,6930,4661,6219,5691,518,2290,7899,3076,8476,1756,6130,3884,1787,1006,9378,2152,2321,148,7235,1887,5581,1553,8543,7757,5862,2985,1924,817,7362,1415,4053,4270,6048,4873,4153,6894,4943,8335,2843,2490,9764,4879,5832,3955,3976,9284,7444,7389,7384,6554,5413,2639,9091,1108,8678,3204,1184,7079,9830,6044,8245,4844,2134,3788,7729,9714,2511,3962,131,7529,9946,3730,2896,216,8533,7923,529,2263,1381,2867,6258,6774,5326,1847,2469,3461,7293,3692,3469,7946,2671,4097,3220,6702,6871,9850,2885,3776,620,5343,5362,1888,9576,298,1711,9093,8586,6045,7637,2728,1125,7434,4112,8311,3199,5881,2050,4275,3315,6885,1086,9538,7183,575,797,397,2983,74,1756,2451,336,797,3020,5189,9414,4756,2161,3272,934,3856,9988,4870,6516,210,81,6301,3479,3860,2329,7358,8760,624,8785,383,1911,5894,7506,410,2886,8683,5975,2364,1180,405,4450,6870,4739,2320,7,3376,4697,5435,9662,929,3619,8268,3845,8600,8614,2696,5757,3654,413,8876,1128,6242,7990,3015,2962,8148,5204,3165,1829,442,8510,4917,6690,4294,8287,8780,911,8909,4580,9009,1220,8185,6033,2822,13,8793,8764,6773,6955,4716,9760,249,1699,6153,8172,129,637,7659,2242,7392,630,8189,5496,6704,5006,9794,7930,9866,3915,8543,7750,911,2149,383,3198,3475,5976,3790,3530,4252,8021,8095,4611,9959,4448,5159,9177,9972,9331,63,7231,7685,3802,5685,5257,7731,1990,9499,1861,5977,7930,9111,8559,4135,8561,7906,3371,1488,4902,297,6495,5484,3882,6191,8550,983,7009,9865,8622,9472,133,688,219,8155,7250,1763,8594,1935,3272,8834,6190,937,8781,4724,9567,872,1656,2386,6070,5326,5543,7066,8891,1397,5898,7613,327,3912,3461,8832,7290,4645,9954,6815,1622,4146,9613,6822,9842,4901,7638,8966,2120,299,9187,998,4951,4082,923,3279,9441,8318,5403,607,5950,9016,8245,8423,8504,4410,9085,8845,589,9124,7754,4187,5072,3163,3995,6334,6680,1028,2799,7655,7376,2749,1099,5982,1733,8485,2953,6202,731,4255,5907,7530,4457,3827,5628,4911,2152,3005,7495,9039,7527,5180,6926,6068,8730,6500,8044,4555,2711,9469,8963,8598,1816,641,6040,794,1387,3154,930,9170,7109,1874,3342,8026,3067,1048,4878,1924,8119,690,1957,9799,3177,8142,1452,875,7795,4847,6033,1854,2972,718,1555,994,8958,6183,9943,6316,585,7848,150,3559,9310,4197,8540,6623,9780,7239,8395,9767,5430,5976,5846,739,2978,2616,3638,7390,9004,2795,3721,5254,9305,1801,8926,8027,1909,7325,4090,2388,5821,6871,1078,25,4565,3610,9518,6314,2484,1918,1363,710,1699,3119,7914,8997,3650,2924,3564,9375,7251,9929,2660,5971,6349,2237,5252,8097,9002,7653,976,9168,8585,6287,9521,4105,6381,2336,7171,7737,3244,1807,2567,9475,5840,8279,8802,7132,7034,3849,4732,4334,9354,2440,2178,6645,8440,9451,3061,2565,3871,318,1513,2498,6924,3137,1655,2358,9827,2327,1483,4862,5130,7241,3270,5197,6685,7025,5277,696,5800,6527,1432,3609,6544,3047,4404,4477,8666,1009,9714,8422,5746,296,6117,7737,7174,3516,1976,3696,7481,5136,1638,1817,7104,8924,4864,5925,8888,8668,1659,9834,6670,5919,4703,8114,8165,4169,3753,7866,2452,9969,9433,4052,8501,2036,6293,2229,1272,3872,3653,6951,7614,234,6324,3752,798,4392,8789,2106,3235,5976,4156,6113,7547,3095,3025,8360,1674,9963,7025,1900,2613,4746,8668,7519,8584,7872,2952,966,3537,5533,1820,4444,610,6309,5686,781,9778,5246,9078,3339,4093,9861,8289,6221,7440,2906,9039,6459,4638,3583,2284,8707,8973,4668,6411,3335,777,8158,2254,1421,7537,4292,752,2158,8837,209,6555,4999,1262,3149,8850,3691,9926,4980,4105,2782,6619,1349,2567,5819,1425,1476,3483,6816,5229,9240,4228,2189,4954,5294,5480,5497,6696,6356,9790,3677,8680,1119,3252,6,5729,5493,6569,4967,2846,8932,9348,1909,3502,1145,8779,6745,4739,3130,77,9794,3508,9149,9769,6000,7322,8526,5892,9130,5430,4781,6407,7849,4666,4445,9791,4235,9900,8775,5292,6449,8774,7925,818,6241,7448,9303,9114,4420,7237,1505,4834,6361,6433,1435,9273,6769,3738,2912,5828,6641,1852,175,1788,3187,5339,6749,446,260,1565,4594,3081,8776,6125,8359,723,7970,1402,9374,9237,2684,5413,3562,5674,453,1479,4882,6292,8478,1544,7683,1735,1340,7065,5611,2604,4666,5851,2255,9632,2243,7766,6469,5538,6700,99,1051,6616,3032,2018,7886,5435,8594,2533,6260,2198,4919,9987,6051,3739,9913,6214,7047,2430,605,1741,2128,184,4398,7003,5953,7109,8696,7526,915,7910,6301,5865,3840,4160,5956,3074,7880,1020,2869,805,2575,293,6222,119,4477,9805,7713,403,8221,120,4819,3849,5838,8702,1215,7754,3973,6574,6337,6589,3097,8902,6716,2270,8598,3500,8324,9177,7691,6184,3573,8835,7180,8871,8362,2690,1888,2810,8038,7968,9971,5509,7503,3276,1654,7936,7342,8408,5802,5273,9296,1836,2857,7328,7416,5762,3341,5994,683,4760,4567,5663,2850,4161,3977,2236,9675,5524,3132,1506,9161,507,2379,2805,7840,838,2054,2061,7369,8998,3233,3336,2596,9330,3794,7062,4353,3477,8358,9180,3126,4653,6492,1106,8924,7646,792,4053,8962,6957,5746,4166,3865,6870,8661,5144,1542,8503,8848,6390,691,6834,8744,9659,9421,6111,8692,5095,2679,1303,2192,6001,7270,682,6011,8400,2756,9066,3864,5873,8734,6446,6065,9924,9814,1776,4463,8335,4673,9296,4323,4745,1065,1886,1265,4416,76,5587,7200,4548,5003,8233,4859,8633,5676,142,5746,2809,9161,886,4090,624,3951,4902,5497,6430,8912,9450,2747,3097,1057,959,1440,72,4125,4521,4891,6921,6064,6447,7236,2524,4316,8426,5911,6821,7015,9658,7715,8254,1115,5265,764,3090,757,3893,1306,324,8935,2450,3928,4006,2263,4166,1285,5906,2269,3236,1478,5621,4793,5266,8834,1406,1770,8058,8421,5684,8792,9917,5678,6845,8907,1563,2080,1720,4481,6844,8053,884,156,5498,8694,6134,3714,7189,2900,4760,4699,6942,3747,4676,1159,2508,9017,1805,3718,5146,468,1990,8253,7030,4497,6888,4232,8132,4502,8225,7058,474,5368,6672,8494,6945,4822,9194,9330,7978,8252,8600,999,7622,9297,7671,9754,5485,8506,8518,3214,3785,676,9019,9912,1800,3246,6927,2673,1373,3036,6621,9320,2142,6214,6807,2910,7128,9238,1393,8823,6871,7678,7684,3407,6191,672,6156,6371,8870,5604,6635,6596,8471,8581,9684,3688,8304,5316,8560,4745,9764,5940,8828,4019,8251,1468,7129,4842,9101,4664,9611,8178,1419,8136,299,4933,2118,4304,9781,561,7334,7575,9067,6519,580,2776,8624,8173,6624,771,1229,4109,4748,5357,959,3156,8126,2044,615,1300,9474,6460,6569,9042,7974,5100,3693,1416,2477,6866,434,708,1661,4979,1350,4952,3856,9324,2127,4104,5399,5436,6021,591,754,6663,5333,1114,7657,6116,4128,5643,38,1888,2809,935,1033,2762,4571,4729,6195,9140,9073,8013,91,296,5484,4277,796,9841,8833,6888,5973,638,3400,7246,903,2962,6542,405,7675,5494,2020,1791,698,8534,7997,8370,9074,5168,4532,3654,2792,5016,740,9339,8305,6919,3566,9392,4023,6327,9575,9069,1642,9497,1383,7626,876,2751,1674,7990,9012,9250,1875,8177,4524,9309,3109,33,7763,6240,2664,2993,9404,8942,5786,4638,8253,4335,4539,4281,321,3775,5711,5751,2695,813,4416,6692,4128,9597,5610,411,4084,726,3981,8528,3214,7813,6255,582,1388,2856,8903,1129,8896,4020,6035,8518,4833,8528,9123,4462,9227,1416,9995,9431,3547,4874,2709,3978,1396,8268,6733,5990,8204,8516,9699,3436,9359,7887,5885,8513,6411,9131,466,9055,1283,7260,8640,3267,2093,3451,8502,6049,4964,5810,3483,6972,9062,241,3061,8750,7574,6636,659,7206,1243,8395,6964,3509,7232,4041,5310,6432,7426,4166,9192,7473,9621,8405,6495,358,2655,6494,3797,2337,2539,5261,9837,1270,9336,1937,3409,8368,9816,5518,6156,1452,4673,4124,1697,1563,7439,8757,3842,2357,7952,4907,5753,4817,1894,3215,9890,6382,4281,8411,6303,8446,7059,3786,6371,5045,4866,4762,7352,398,4345,2401,3689,4438,2255,5765,4440,8255,4526,4755,7449,3167,7109,2201,5845,5886,4535,1563,9401,2460,1530,1682,2836,1512,9737,6680,8956,954,6259,2797,3930,4714,7177,5013,8809,6150,484,7608,7243,1920,6700,1553,3876,2990,7122,7776,8397,9001,5351,5784,7602,2398,2899,6177,8884,9584,2815,5639,3673,1395,2715,7225,167,1475,2377,2267,8204,9051,5295,9252,3353,8047,4698,2945,7426,514,6406,8480,7888,3088,726,7078,6511,9334,5682,8554,7120,645,788,7623,840,5587,5322,3870,8479,2073,4440,4113,9394,5462,7347,5466,8754,8650,4710,5090,3619,684,1873,218,4110,5029,2277,6629,5839,2467,1017,4732,9815,3223,6344,3977,5115,775,9793,3404,2291,8668,1222,9993,3996,1349,2397,8856,5031,611,6370,564,4568,1403,3571,765,2023,327,4402,3430,7666,5669,4471,8951,1881,1558,2716,9628,5665,3184,6175,8948,1314,3181,8691,5507,5993,9210,4639,9248,5975,6025,6669,4760,2751,2863,6780,8649,4380,3767,8303,1688,569,9421,9692,1179,7543,5587,510,7408,9850,3471,9364,9972,4940,9867,6223,6077,8729,3940,3240,6673,7010,4556,1688,2556,3242,393,4973,6014,444,1379,8779,2635,7346,9897,4041,2057,3023,6733,3920,4885,7799,5843,7664,7566,6130,5862,4795,5849,4316,1860,2760,2987,4152,1021,145,1026,1448,6839,5749,7853,2215,2093,1959,495,9199,955,8125,4688,195,8772,1122,3628,7895,7517,9844,3250,1186,2335,1526,2342,8819,3016,7327,4815,2841,9147,5498,3050,7162,9659,2260,8997,2653,452,5826,7909,6784,5059,3672,8032,6770,5432,8530,2580,9674,2747,2159,2414,6702,2533,7697,5860,6989,802,3566,8988,3990,5974,9138,3602,4798,7573,1627,4614,3055,6856,1532,7083,6739,3439,6762,8634,6749,5258,3026,3869,4112,6703,5201,5796,1030,6520,7514,6355,5610,5281,9284,290,2190,8942,7001,60,3750,4595,8329,6880,955,602,3989,6227,3226,6945,2820,5692,1922,9417,8705,871,2266,7112,9770,2147,4120,1592,8515,9924,7659,6934,7953,8065,9425,7107,5984,7895,8274,6231,6750,1476,2820,1545,7965,4301,7092,7640,9893,9496,3859,2421,1199,6643,6966,1174,811,7627,2982,9093,267,1830,702,6655,6950,6442,3328,3702,4086,5347,6144,864,3818,4337,4999,7957,6181,871,5025,6052,7901,7086,1424,5023,317,6224,1399,9466,9027,5021,9567,1664,8882,905,3141,9982,594,8316,1498,4454,699,6496,4034,6974,1342,4695,950,398,7660,1219,9218,3110,1596,1980,6759,7029,8201,3134,3034,451,9778,3608,9539,5544,249,8861,9167,1090,612,5911,4031,2772,5887,1951,7447,945,3736,9878,1711,9093,7218,3824,6037,2876,9315,3284,4874,4297,821,525,3216,5553,5272,76,354,7997,7983,8659,8461,8284,8863,3067,863,2046,6531,9279,4255,6762,5818,4223,7524,4649,231,7438,9660,9016,8865,9797,9863,8266,8097,3134,890,3460,3798,2089,7805,2272,4996,7290,6493,7258,7856,9129,8827,4438,1350,1472,266,1208,6548,7857,4853,4282,860,2670,4887,2442,5654,6239,2929,6921,8571,1760,4551,9869,7019,3343,5667,3455,8920,1762,2369,6526,9353,1136,4481,4843,2936,275,3497,8891,2020,3132,8208,696,4304,3199,9492,3536,6082,6594,9717,2644,4181,1091,2664,5083,1127,8671,9716,5404,7532,2764,5032,4663,1305,7936,7715,3277,8665,9319,731,8580,5372,6961,487,1764,6451,2705,6549,956,7366,5951,5621,2973,1358,4247,9067,2350,571,1464,7729,8151,3582,1270,3075,9446,5440,6105,7073,9725,202,1164,5408,5745,3083,718,3785,7037,2006,308,6313,7277,9760,7285,8288,1892,3574,813,5746,5926,8613,5899,6697,8142,9744,9282,304,7609,2526,444,3017,3322,2602,4690,4233,4772,1681,1413,2215,3987,4743,8281,3760,6803,5810,820,1910,5799,9934,644,1548,9892,5159,1414,2844,9635,5650,975,1313,3634,4196,9847,4013,2708,2409,4905,8356,7772,7919,8821,3887,662,1528,3471,4043,5199,6396,9917,9815,2984,356,1276,569,614,7936,1643,570,3109,3746,4174,373,9713,7201,4636,2412,3227,7623,7170,9683,6474,2036,1343,6227,7799,9928,1574,7384,3568,3020,7791,7732,4646,1802,3157,9578,7759,6881,4777,771,9028,8962,5486,2045,7444,853,9243,7638,63,1397,172,4405,957,6768,4785,8834,8181,9048,2558,4489,8166,2196,1593,7660,7537,5295,9424,8110,4172,1304,9456,792,4289,2177,9967,1639,5293,529,3378,6060,8209,6274,2791,4091,9989,4739,8317,7773,7056,2086,5799,1086,7105,7507,3118,9183,8057,436,4444,9861,8270,8839,593,4696,2810,9711,7377,7509,5226,7476,3187,173,800,6878,3492,6996,6322,4173,6562,4450,6824,3860,4626,7445,8929,7306,9819,845,3727,5336,8393,9727,4262,6445,7226,9523,8273,4413,1124,102,4830,2381,9501,1129,1453,9737,7394,4496,2900,5519,4785,6067,6862,9906,6942,4640,8023,7255,3170,1927,4498,6347,1127,845,2467,2379,7613,8730,3830,6442,2425,5131,7382,6879,8657,3520,3606,8628,9233,8015,7276,4552,1208,7935,5025,7726,8076,7774,690,4172,4754,3212,4994,3325,9799,590,5398,5007,8762,9707,5287,9286,3087,4978,8516,9207,4861,8371,2397,4734,5249,4961,4249,9848,2409,6694,3617,826,3754,9983,8610,9592,7915,5868,8447,1310,1192,3362,6653,2779,2399,5288,1734,9393,6,7213,4454,1175,8387,6112,7841,7319,4034,4119,475,9488,2708,265,6382,693,3578,1172,3224,6907,7454,9975,6170,8575,5194,2745,9530,8798,7822,9169,8786,4428,2094,9851,9423,7822,2594,8281,3266,1519,1877,1248,9058,8607,2343,8839,9385,6591,1355,8972,3987,9462,2937,2398,9522,8095,5453,4483,9740,873,2534,4772,6555,3222,232,9389,3132,6892,7739,5694,3841,6263,3817,5868,2079,6405,7076,5040,9841,24,2429,887,4291,4120,7678,8896,6759,7278,5906,9393,4355,8298,4871,6675,4193,63,1683,9377,6239,2593,3868,2525,6957,9150,654,7771,5521,146,329,916,3286,2721,7857,6037,3336,5633,3452,5965,1562,1693,248,4226,7872,3475,4994,4157,1845,9975,3519,153,6279,3934,9415,72,2038,3476,5781,5758,5912,3574,5449,4116,4072,6569,9510,3174,7634,4065,6708,3046,2761,4555,9919,3191,4562,8755,7174,2130,7158,5502,2365,2468,7780,5986,9467,6590,8700,8073,3725,5140,2757,8002,465,5231,7496,8128,4060,8011,8354,5177,1733,3465,6198,3256,7671,9678,7193,9611,7331,5986,8644,4373,2331,1491,5430,8685,2360,7199,6768,7630,8806,77,8630,5669,7043,4837,8052,6246,7859,9299,1015,1832,1519,904,880,260,4817,7033,8501,9258,2425,4494,5648,2411,4315,1572,8174,2496,9519,8380,1792,18,3072,9130,9645,9680,5454,3478,9055,4172,7084,8510,1121,3630,3570,9602,9256,8751,4204,8871,1991,2287,8601,3333,6217,193,476,7609,3803,4570,4831,6468,6478,3189,4491,7497,6954,9585,7506,7283,9894,3729,933,4509,9089,8939,3534,1160,4540,1578,344,2216,4718,989,4417,791,1743,8325,8991,1249,9197,826,5080,4103,3178,5271,7112,7260,4731,1402,3343,2219,2875,8997,5345,5455,646,6608,5140,3320,382,9252,4357,4509,7994,1473,2451,6485,6802,2553,4307,1901,5396,5571,1690,6901,4834,5977,5126,227,8770,2570,1462,974,540,3113,1933,5428,3328,5916,99,2660,2973,461,1604,8949,251,3581,3007,6590,1282,6396,4503,4891,3169,1330,7174,2543,792,2858,7301,6588,1822,961,4518,4588,2188,1611,2186,8988,7759,8479,5963,4508,4586,2022,1572,7552,658,8703,2243,1682,8528,5102,5134,2029,6531,8953,8027,2371,235,618,5958,4089,767,7088,3711,8054,6792,237,8905,1623,9348,6505,3917,30,6676,1486,2037,6814,2029,2714,9361,2977,8635,3504,7205,1826,1770,5351,2857,1763,4955,5945,3240,8089,3125,6117,8049,1595,9297,6206,4777,5478,4637,3851,3063,7580,3770,8101,2135,5824,5343,7515,3176,9707,9491,3681,270,4603,214,140,6704,9103,8825,1896,3003,1868,8065,6514,557,7563,2152,8639,9579,8920,892,4579,2347,5508,9343,7259,7563,3781,6629,9572,8120,8257,5129,7729,7096,5222,8936,8472,2209,6885,6676,502,9695,2034,3506,3367,1522,3942,6124,430,8269,2189,1457,4227,825,6297,704,7184,2863,5981,336,7892,6466,562,9963,3760,467,9989,5503,6508,1307,2247,4684,2883,6276,1740,6552,9890,5456,7133,2158,2541,4737,9350,7562,3723,7119,8216,7247,7365,502,6552,7505,7211,4373,4654,1659,7247,223,1239,1979,807,1038,1252,5249,6799,7499,2505,1188,6645,9671,2399,5500,3228,3494,610,5913,2457,2847,4659,811,7625,9037,4391,6631,5897,2161,6790,6377,460,5005,3469,1356,7529,5994,6236,548,4539,8419,8041,5252,9071,3336,380,760,3753,2252,1777,8397,1327,7416,3433,8324,396,4406,2680,4083,5983,2582,4616,3203,6585,6236,8149,7315,8499,1776,2048,3043,3894,1260,2220,650,5408,6930,5028,5393,4310,9908,2739,7990,6140,314,490,474,5791,7231,4653,8787,7596,5476,8694,4331,3286,5340,1537,8687,4932,9790,927,3936,1408,215,403,262,3625,9477,3448,1736,6146,6365,6024,5013,1553,7029,5366,4270,9504,3899,6438,8825,7728,2892,4528,5888,6353,5646,7376,2128,4667,2135,2953,7563,8409,675,3693,1318,1705,2802,8758,3003,4045,1511,5633,808,8172,7642,1470,4367,9569,8263,4321,6180,8923,5277,6308,1330,4668,7360,83,7446,9867,2392,5214,434,1890,32,730,4956,3008,311,9441,5900,2423,258,7421,2321,8735,8632,3601,8669,6610,8453,1216,4324,4446,3831,756,5282,9878,7252,8024,4818,5249,6146,3534,23,9818,8750,1339,5047,2862,3750,406,1978,9937,9679,9196,2720,6489,9759,3727,4024,3249,8659,9266,4682,7464,4603,3791,4558,5087,6249,4481,3155,3455,9398,5482,4425,7729,7309,7310,8391,8851,1102,8886,6534,3322,8588,3359,6979,1850,816,1000,5569,8352,6276,7976,8053,6681,2136,1061,6024,3224,2848,8445,7497,9540,3747,8257,7416,6823,4766,3029,4812,5712,1264,6498,6510,8690,1772,837,9900,6787,8841,9213,5991,6878,2933,4464,9669,9361,8350,7366,5232,3648,7128,7245,7892,8704,1898,5140,9269,493,8080,4528,9703,3252,9162,3737,2164,2889,3548,1358,1466,4931,5756,957,1962,27,9016,860,4458,8129,445,3075,7172,1271,9360,8495,3989,1283,4937,2913,4847,2353,9651,333,2455,2671,9150,4412,4359,7552,9773,1914,5597,8474,1993,2824,7003,5704,9499,5691,277,1752,4054,8491,5270,9837,8555,9973,6427,4302,5490,3226,3958,662,360,8446,5148,8754,3435,2201,5096,2694,6336,2377,1558,5880,1086,6127,3096,1683,5137,7693,5541,4166,6199,3966,2613,7475,5990,8782,8262,9376,5988,1182,9914,3449,7854,5602,5767,2572,674,5314,677,6635,7844,7948,8692,1582,2573,832,2819,8590,807,7699,6042,9803,1074,5565,6401,5031,5059,3051,2886,7865,7984,685,1164,9916,6277,5689,9798,2429,5553,5414,1888,752,5914,6994,1543,5371,8933,253,9675,7721,5551,6812,5220,104,391,8759,6954,5084,7025,4682,8524,3818,8596,9720,4650,9117,8541,4483,11,8101,282,1798,8872,2435,8896,5867,5759,1631,8294,8021,2321,2066,8295,7288,8868,3772,4340,1852,609,9391,4976,8013,9719,4338,9218,8990,3606,1711,2470,1505,9733,6165,5884,2816,1630,8566,472,9784,5036,9594,8592,8121,2115,7579,2130,3495,2504,1607,8635,9884,4741,7697,6016,3171,2423,5440,5545,7151,4208,8975,4225,5890,1221,6219,9944,3094,4160,5288,817,5560,319,2909,4964,8423,4723,1971,1581,538,483,5481,955,8935,3830,2019,5954,3581,172,3431,9177,8843,3846,5183,5597,1718,6154,8425,8124,3559,6256,8986,9579,7803,9383,4166,9489,7665,3952,5498,8202,8959,4498,3763,8580,494,8885,3876,4133,873,9367,2164,1635,3346,1370,7741,7498,2046,2324,4799,6426,5444,653,9098,7383,9569,1924,3592,5543,8246,6651,9825,4375,2617,4518,1044,7479,2464,1137,8261,1289,4777,4695,185,7670,2565,4059,3292,9481,5928,2035,9803,5618,6475,5863,794,2932,7274,8663,1728,6551,4231,7299,1990,2887,5861,9952,540,6771,4813,1530,8900,5135,2796,7740,4261,8786,3811,1193,5641,9385,8054,6023,9663,322,4302,9487,2986,7282,7351,9871,6991,4704,3522,5816,1867,6487,836,7647,76,8280,8742,8672,9587,981,8163,5574,6456,3383,269,3781,4053,5626,8535,8673,7226,124,5548,9316,1992,7233,7591,1308,2886,1009,3097,8298,7792,4153,2007,6100,7122,2150,8361,9619,8977,1709,3356,3206,9906,6566,4657,9966,3569,3388,7900,7552,6348,1439,6485,390,1686,8978,218,4302,9940,701,4636,4473,4099,3947,1901,7725,5280,1869,6408,1940,8878,3606,5689,5227,532,9934,3969,6036,796,1039,5844,724,3974,5707,2026,8725,7891,8467,6945,8517,8538,2129,5897,4870,1974,3680,3415,7452,37,6302,3699,3346,5995,1665,4697,9813,6285,4591,4412,263,7671,6804,4686,5933,7159,9040,9690,8450,319,2966,3051,3442,2806,895,7634,5648,264,3701,5491,4112,1810,5736,8152,6941,7191,5356,1005,2597,1741,1257,4034,3192,8544,8074,2909,5436,1167,1967,9493,6540,9786,395,8200,9460,7034,9622,3686,4599,1961,9660,883,7753,3797,9244,1737,7398,4546,1017,9075,9385,9733,6989,9380,4101,5065,4497,9086,1728,5486,5223,1355,4867,597,8256,7064,3083,3957,4166,3221,9835,6569,7923,966,8664,3072,120,245,6283,9180,7032,9517,9011,7620,9418,5472,4592,113,346,7523,8793,4948,4696,1533,3959,2143,5879,5883,6984,4472,6048,7135,2349,25,7469,3036,4892,3346,5214,716,8974,2886,1671,6634,7090,3993,2608,1033,8921,3961,1572,8059,3032,1506,9058,6186,5225,5704,2607,2882,7594,4241,1154,2917,2732,6728,5623,8134,2949,5340,5421,6270,5327,4046,2952,2411,6615,3255,7023,7068,3598,7599,559,3270,9323,679,8550,6658,5592,5696,9433,7740,3601,7266,5598,4886,4488,2630,1523,9523,1619,9740,629,1308,3260,1206,3834,5086,9888,8603,7608,6202,1425,5717,795,5492,1060,9219,1859,2165,8324,4648,2787,4249,1437,4570,867,8738,6225,6676,5983,19,7335,7636,6631,2485,2487,158,9981,9285,3663,4263,5449,788,4145,2938,2104,8678,595,4183,9321,964,1373,6399,9631,7258,62,3657,7570,4409,4488,2865,1758,9190,4384,9363,945,1417,2767,8660,3825,1007,3171,2698,9589,7449,9246,655,1479,2939,9510,7954,936,2414,964,5493,5356,1902,2197,3216,4442,7452,6700,2845,2413,3613,1854,2554,613,4505,2676,3978,1703,1613,5277,3700,89,5513,3081,8322,6471,5651,2607,9572,161,3891,3656,155,5034,4133,9585,7774,2299,1290,2701,7496,7646,8567,801,4999,9299,8820,3623,127,7582,9101,2859,565,6791,6373,6529,9829,8664,655,1917,3581,8771,3619,5817,7423,298,7839,6035,2595,9989,5139,5068,3922,5615,7956,7738,4236,4873,906,8950,5203,7574,801,4943,5326,8157,1836,5478,4455,3355,5517,80,9821,174,7487,1703,2563,2411,45,3033,4639,8024,3095,39,3052,9811,2180,6871,4792,9305,2875,3699,9351,6159,2424,712,158,77,3566,200,5593,2415,111,3592,8949,7042,5062,2707,198,6397,4045,6373,2243,8645,7799,2768,4789,2647,4727,7995,9612,2386,4391,8382,3946,6298,2723,6887,2789,7207,5403,7928,9753,4164,9636,1958,1636,8064,1080,1068,825,1184,6561,2486,4926,9387,8098,3718,8541,2429,5774,403,8854,868,4751,5397,9212,7894,9216,9770,8660,1305,8420,4468,8617,7258,5149,6121,6587,9847,3269,802,3499,2181,1225,28,9504,7674,2648,2762,3557,2675,4552,4768,6648,9968,5778,8314,8861,3235,9281,2307,730,7109,7111,4670,232,8737,4889,8897,2360,3191,686,3093,2811,2042,1315,56,3065,3091,6026,3498,2092,9564,5974,1731,1458,5685,6800,7276,7950,5122,8246,497,470,5594,294,5062,6567,7162,6520,1599,5613,5857,4817,4342,444,8305,8337,3080,4010,5972,1174,248,3874,8741,6422,4779,5586,2035,4090,5339,797,5361,9181,6341,8843,8297,2929,3578,180,4660,9306,9521,937,819,577,2132,3963,3146,9554,8894,7809,9615,3966,4996,7847,3119,4810,793,90,3178,6046,471,5948,6866,7016,8653,5590,9824,4118,5356,6545,4575,5215,793,4588,6927,4907,8095,3834,8099,4310,4538,1073,7572,1521,4604,891,9211,7473,1931,4344,5579,2030,8705,9163,8709,8533,251,2169,1857,5735,395,5149,3452,1048,599,1015,1012,7553,167,4872,3214,9902,4714,5351,6193,3328,9170,8687,5112,9419,5555,5071,6148,3978,5368,8168,3688,8039,3182,3827,3963,8467,3991,5641,6202,3764,2377,8008,2675,9345,4157,9797,4010,936,7504,5060,5256,6121,245,2482,5047,6473,2384,7196,9607,8784,1452,9781,5213,9723,5815,4884,3455,3226,9601,7923,7177,4995,9265,5713,9562,877,9583,353,9879,7558,7595,9865,2856,8846,8053,7860,1846,2250,6242,913,2372,7986,6638,1057,483,147,6804,8860,5499,5629,5176,4861,5161,1029,1070,9298,9115,5845,4832,6189,2598,8520,2299,3205,3393,3006,178,3190,6567,5374,9434,7069,8905,1967,8301,6108,3514,7709,4679,172,993,7067,9180,950,9898,1995,6704,5321,8645,7095,9549,4040,3046,2060,2977,5833,5923,5274,477,5894,9017,6805,1607,3216,9720,6311,1657,7703,7570,732,7135,8115,8896,1012,4701,3743,4733,1092,8791,280,2281,8693,6200,4770,9239,3092,7467,6835,1679,1552,6469,5030,4877,9264,8041,6506,6992,3258,5154,8593,9884,6189,8141,6737,8920,648,1484,1766,97,2208,5908,7182,3413,6062,9039,5579,137,3599,8603,485,9892,1538,1306,3702,5345,2878,7760,1948,8433,8793,3272,4986,4295,3666,7823,6167,6362,7544,9831,4141,518,2224,9414,5371,4283,5043,1268,1204,8765,9085,97,8814,9730,2848,4188,84,2967,7791,9597,4981,12,243,4140,3986,4003,3209,2743,7859,5925,9602,7857,3011,7805,8546,3741,3264,3610,1010,9191,8188,7698,1743,8075,3535,506,2552,5660,9506,9182,6483,5103,1429,8800,7768,8077,7674,8608,7749,9524,2311,1897,4008,8551,7689,2020,9976,1930,7276,995,4605,5414,9411,9528,611,9227,9222,7722,6636,9305,5247,247,1867,214,8636,6445,6345,7179,5505,1791,8419,3015,8979,5030,5514,5466,3917,2973,5954,4779,9647,9477,8643,3331,5850,7583,907,3328,709,6484,6875,3715,587,6992,2101,1890,2523,867,1925,6743,183,3679,2069,110,3269,461,8358,9739,8897,4792,5870,6306,9033,1759,389,6589,6303,4967,2759,9434,4171,7864,7781,3194,4247,4315,8755,9428,17,3986,4427,3727,1628,6320,1785,9083,687,3453,4782,6649,5876,7331,9726,5806,1930,5668,6913,3525,7220,4385,869,6986,7688,1428,2202,7487,7233,5495,8581,6170,5214,4155,8558,9589,9680,5971,3378,5902,4848,1046,3201,7284,1542,9472,8993,2576,4147,5313,2569,9801,312,8348,4663,8287,2285,2218,4971,5249,8219,3621,9849,3335,6210,4237,9579,9881,2180,9702,1661,4837,1832,552,463,8701,5144,9646,7079,1815,7683,5944,3612,6555,1084,1753,9388,2393,6729,5513,1383,608,8421,1651,3121,3800,6190,2888,532,2985,6391,3323,3068,4578,5031,3300,9401,2003,5145,9469,9712,227,6746,712,2490,682,9103,550,916,9384,9724,2529,670,3597,8813,819,1964,6958,7489,2701,3912,5447,794,6017,3773,2291,1982,6313,6686,134,697,558,3309,7940,9561,8705,7540,1687,4832,1957,1360,8940,3302,7122,5744,550,9525,5204,4875,1610,1547,3435,2311,4818,1035,5081,4403,7643,8076,8423,9390,6566,6344,1743,9085,6746,9167,6771,9097,3248,4578,3989,5710,6166,6280,7917,8638,7997,7404,3719,124,8603,1932,2402,6114,4122,444,1042,6987,2855,8593,7550,6681,996,4647,2,7824,3430,5452,879,8713,4071,2498,9670,4960,9141,7457,4961,5447,1905,1266,3530,5169,2978,3029,4930,7735,9648,5644,7468,3143,601,990,9311,3071,2158,6613,8007,4615,2807,336,9476,4004,6411,5618,2713,3062,9817,3073,2158,3867,2851,1176,1855,6025,7613,3941,620,984,8418,9963,871,7029,879,8225,2344,9233,8183,3602,6492,4080,8301,8908,8850,2507,8605,7969,2205,1742,7859,9512,7797,6586,2642,5644,1605,7300,8286,7772,7662,8356,802,1146,4243,7368,5996,3004,7403,9374,9340,510,7539,8029,3672,8078,3305,4973,811,7391,9154,9850,6738,1511,277,2533,4813,4224,269,4051,4948,8314,7530,9244,3471,3496,4865,4541,9805,7119,5432,3207,8462,2474,2939,7501,7321,7784,8842,2826,8183,8540,5576,1305,4118,2092,3997,2363,3079,9092,3205,6485,1455,9120,3568,1887,8666,2117,7360,3750,4788,3176,9165,8650,526,3669,3108,9009,7743,8474,2980,6514,720,9625,32,8875,6959,9226,8656,3420,8925,1894,6911,8522,3520,8765,2510,9501,754,8641,8736,1378,160,1865,7900,2777,7851,6239,655,5431,314,1570,4871,8566,7431,6949,4073,5825,1005,414,2891,9097,8097,3128,6570,8066,1350,5281,2310,2822,2327,5421,2337,2929,3713,1857,644,3667,1109,2808,2042,3793,1611,162,4243,3365,3034,7824,547,3673,4609,1177,2320,7744,690,3625,9655,1614,9969,9837,9143,3066,2841,3335,3732,5283,4887,2400,1366,6680,6365,3729,295,5583,992,4905,889,3119,3131,571,8894,7845,1674,9452,1214,4963,5280,3321,3284,5804,5585,5167,6785,2794,7352,8625,6504,8217,2211,5590,4496,5273,5458,4393,6598,655,7003,199,1944,7844,1097,4516,5962,7109,5256,614,6405,2993,9083,7960,323,9519,8519,9065,3829,4181,1301,347,3485,5506,6292,8500,4980,6821,6484,5232,7109,723,2140,1645,3456,565,8196,8733,6632,7799,9788,1128,1606,9131,1060,1703,4627,2932,6546,2858,2034,8891,5007,7155,6660,4078,1258,5097,1697,6892,1827,598,6518,8218,5409,8777,4353,9009,6221,8437,4023,4013,405,2720,7071,1279,4586,133,6693,6844,8306,4707,9016,4797,2822,1995,1707,4509,3765,4933,8920,7134,8704,6940,4008,8340,5932,7582,8220,6408,9827,4349,9928,1638,787,9312,4898,4399,2509,7090,1399,3976,7367,4770,8983,5497,4603,5138,6628,4576,1798,4329,9655,6123,9290,2561,8875,689,2732,9785,1920,2042,3158,1443,7097,2498,7414,9511,3246,1146,9485,9247,6267,1575,8834,8441,5743,225,9389,8152,3790,342,5756,3491,3952,7988,8897,3685,9136,2482,5457,987,6637,8744,6854,3657,5020,4162,8415,1462,8180,7425,7787,9243,3360,2810,6977,1031,6881,2213,6924,9982,4138,4127,8967,6709,6898,9400,9813,3896,4661,3878,7851,2309,1972,7537,9460,1086,6336,9284,9804,5787,1603,7410,8070,1926,5431,8095,2183,7965,1452,6771,6840,6115,1639,2667,3703,319,2381,7880,5782,6091,5292,189,315,214,8259,5365,7615,3267,6997,2490,3023,3496,2635,1359,8766,2288,5582,5176,3393,9673,2992,7709,625,1879,9972,7323,397,9871,5634,6674,885,6413,1893,1480,4816,782,2764,6692,7543,6583,8828,2100,3544,5484,1948,1624,6260,7465,2551,9732,7120,7261,7006,2898,5608,1834,7044,5278,4136,3863,7328,1368,1393,2238,1134,3605,5722,9758,3278,3583,6636,7738,1796,2208,517,3735,2422,1883,9862,9858,2321,4707,8629,6920,2037,9954,1468,2989,3908,5348,5704,9862,1991,3641,4731,1582,3945,3830,746,2421,6282,68,5023,300,4461,288,712,9274,4890,3370,3014,3258,6861,2470,2639,8107,37,9982,8317,607,8134,9949,1805,6284,7047,5221,6785,7102,2501,9642,6318,7331,6686,1910,1423,397,2807,1235,9984,4660,3319,5252,3203,5905,9577,4892,3615,8420,2654,8452,2492,2720,2121,8234,9528,3993,8577,5357,8101,9757,1442,3634,8440,6568,6604,4802,4620,8862,2387,4489,9437,6725,9405,3609,6590,3304,8311,6517,7619,5221,5057,5638,5911,7888,5037,858,2456,6398,1524,8367,7350,7595,9825,205,8808,5876,3267,553,3190,8222,7071,1123,3600,4141,4989,6089,6389,8782,8038,6465,9981,5869,8476,1347,4080,9103,7298,2093,7101,7194,7680,5086,9204,3016,3856,5931,2092,3896,564,3484,5550,4909,9790,5360,7175,1453,4149,1221,2554,8787,7015,6801,588,1277,2769,9884,3111,6750,537,8035,9879,5933,1637,6567,7472,7157,7313,8892,1718,355,9997,6650,5283,363,9037,784,8564,740,5143,5292,1452,8807,8744,8292,3505,1491,7952,6320,1690,9884,4305,3661,4439,3128,8564,4651,7897,6673,5556,1136,2213,3990,5952,8036,869,4409,5101,9075,1559,4786,3794,254,6284,1978,8747,1546,2890,9473,455,5743,5211,3162,8554,8794,4764,9129,4284,8443,7855,9148,4663,7688,3833,9359,9948,3224,3764,3030,6895,761,5534,7879,3591,6203,5593,4781,3871,275,1177,8327,4744,5657,2537,1718,6085,4698,3526,5122,7581,1830,8418,5622,4572,7027,5122,8320,2194,6376,9153,7218,1634,5907,8571,372,9829,8804,6354,2895,8053,6959,5613,6531,722,5294,580,994,5760,6733,9989,5715,2759,3404,178,1056,434,2465,7745,9608,4833,2819,3819,9486,4583,6144,3661,6183,4908,5768,3898,3040,8059,895,966,8743,2165,5535,1165,6541,157,9652,7754,3914,6507,3518,2560,1801,1641,9202,3957,3239,6664,2266,6018,9656,4860,3552,2980,6483,7820,7319,7198,6193,8355,7314,4373,4865,146,8395,9186,4199,7499,2222,5828,8777,7943,7787,9835,7617,5538,215,2478,8654,6874,5803,7894,5762,2979,6788,8753,2661,581,561,9424,3153,1372,7129,4857,6484,5048,5010,5861,2657,1947,8283,6307,8175,798,1363,7812,4600,5979,7279,9389,667,1972,5512,5528,3435,6027,1131,8803,8462,7800,1383,1951,4559,5975,9346,1106,2189,1271,1941,501,6282,1676,9915,8359,8668,9101,2790,9769,4463,8070,7498,9072,8256,2840,6128,7783,9972,3124,5493,8714,3295,8308,6456,8619,6430,5890,9807,9824,9790,6207,5698,2067,8818,3965,7919,1905,1168,6165,1173,4572,1557,6227,7097,5737,2973,933,7716,3603,811,8095,1570,422,6311,6009,9380,1844,9675,7023,8815,3044,5862,7856,2651,5582,2889,1585,2070,9920,8988,8183,9822,6732,4778,3040,5962,6839,7264,2539,7362,4540,2466,2155,4178,5639,4263,6984,8988,4635,4344,8125,8034,1005,9925,2779,3472,406,2320,1733,5840,6788,2639,722,6899,3897,9294,943,8943,4955,2843,2090,4924,9843,2841,8408,2086,5342,2397,1759,3102,2191,5460,1821,5609,2763,8011,399,9455,4939,9509,4395,5389,1325,8745,8183,2612,6196,5378,9903,3192,8420,9581,6355,1537,3382,4094,7046,8957,1242,6555,4240,7468,3440,5679,2237,6947,9838,2137,9021,298,2941,1882,8626,6366,8316,9099,644,3711,4716,3845,1312,8419,178,7894,4837,4337,7704,6147,5846,7367,3835,7136,4987,1205,4862,6746,3807,3120,8758,4094,2739,4512,2909,4335,2618,7986,2976,5475,7979,7542,8353,5511,1587,1330,9557,3095,6192,8029,3334,8647,8806,6565,3138,4493,350,5770,4410,2499,3810,5104,8036,8362,8611,129,1066,1426,5987,553,7801,611,7035,5768,8723,8856,9350,7060,9693,7039,9380,9252,3042,4826,8360,3174,7758,1056,1627,4841,8211,6588,8567,9828,7799,1389,5676,318,3524,565,5710,963,1959,3915,9205,9701,9906,5641,8683,3913,9531,110,1778,662,2682,5292,7708,8490,7983,3035,7521,6164,377,7189,5900,2555,208,904,5150,7237,7708,6167,9178,9361,123,6585,8071,2366,8287,3080,1938,9057,5086,2660,7001,4003,6209,3566,9584,9793,2229,3693,2256,970,6957,5452,8275,2485,3485,4986,602,4376,1217,72,2615,2402,4900,3439,419,4834,5209,1816,7641,5933,8534,5585,9993,9404,2532,5087,966,3099,5856,2534,7720,3868,9565,2323,6443,882,6992,803,9438,4246,9667,8185,9334,9158,9490,7436,1400,7921,401,8870,9186,6188,6707,4534,3954,7696,6948,2127,4749,3881,673,5671,5162,7720,2939,9753,2213,7411,5608,4259,8269,912,1154,2601,9045,5549,9526,1040,5734,4027,4549,2948,4828,5422,2422,4466,4021,991,7394,5038,8278,9482,7191,4415,7653,3888,4294,3534,5007,7782,9046,843,8788,2501,7678,2632,5894,2872,126,5803,1038,3761,2807,6528,2791,9107,734,1077,6433,1033,2829,4125,3775,5566,2,7598,9305,2436,4063,4707,5259,2061,1704,58,5108,405,6568,9158,6504,9990,1580,7710,2223,7569,2166,7453,3780,8124,4795,1808,9830,1711,7398,8523,7594,6998,6067,6180,1847,4338,6004,4230,3704,8872,1936,816,9294,4032,5087,3300,1452,4119,799,3592,2185,5405,2306,9320,6817,2584,1918,9746,836,7360,1451,2728,2198,7585,2153,3346,7549,1756,7591,4057,4215,3621,9517,8093,657,7638,5971,4464,8496,4555,6648,3705,5308,4901,2380,8147,8448,4327,21,8347,44,8572,9278,2725,3203,7791,1332,8071,4253,9361,5736,7660,8390,4678,5391,9314,3517,7576,6565,9517,3078,9331,9989,5906,4057,6263,7475,7948,2417,6634,1346,8811,2653,1379,6430,4592,1954,5360,3044,8019,1479,2785,4661,8893,903,5978,2183,4622,9955,5429,4147,72,4014,8078,2472,2081,1311,229,183,7094,1394,1375,8821,9971,5447,8278,6156,3259,6818,7812,9098,5606,2953,1500,1584,286,9449,9762,6580,1825,2626,4621,7727,5090,3526,5916,3648,1592,6350,9502,5368,3934,1717,7576,1340,1969,5771,5716,8134,7829,7315,7484,8164,4465,4789,8563,5992,2510,8765,7228,1526,5115,4474,1745,6793,3148,2096,9613,2542,6007,2822,6258,3846,5381,2313,6325,1417,3527,7623,9773,1358,6735,629,1095,3172,1666,8922,6789,3629,7613,1777,7402,7325,7789,9067,7839,6959,6277,1755,66,8480,8540,1384,7426,4514,6124,6990,7140,9835,7685,9885,9121,883,6503,3497,7701,4522,1532,9320,9106,5183,2732,807,3547,6202,5078,8182,2745,1507,3534,8183,954,2200,1321,723,1437,5515,802,9205,2775,7314,8889,5724,2945,5782,1855,7981,4151,9444,8092,4528,6842,2351,2585,4894,6287,5228,7222,1289,3215,7748,4373,8420,1285,9973,973,5415,5891,4162,5432,1180,5533,5422,5813,4405,1531,6645,3191,8147,2684,2164,3667,6128,2830,3756,5430,9175,9271,7571,2493,1302,3951,4594,8348,7459,1427,4376,5240,6724,2196,2469,1004,6869,9590,8320,1368,8998,6962,2786,9981,7403,5924,105,5586,6474,9229,3942,594,5632,1554,6559,9660,477,8763,6830,50,5491,9765,5263,826,8235,737,4454,3360,4768,1394,9559,5858,6385,2275,2380,6707,8067,7919,7203,8632,6141,151,3917,7502,6891,2784,1344,7026,5292,3426,5174,5367,4836,5962,5980,1044,4426,1672,3780,2131,2171,7346,2243,9732,8533,751,5412,4040,9197,2317,9251,5334,1594,7260,5906,4345,2295,4449,2375,5375,2005,1636,6828,4044,9158,2962,5502,4917,8132,971,543,5670,6968,3877,2149,4284,3507,951,4008,8604,5544,5631,6999,906,2432,2205,7092,7443,8517,2006,2659,308,1879,241,1023,6016,7626,8141,9302,29,8358,9530,1448,7767,8326,9755,4011,9980,9801,5658,6282,8287,4756,9940,5217,4966,2639,3065,8451,8220,8419,5117,6821,8639,8002,6730,6944,8915,4175,3500,210,8877,5522,8995,318,7384,7733,7205,1063,9668,9977,89,1449,2498,4002,2572,3713,6953,3031,2416,751,5748,1331,4873,11,2834,1815,7118,4046,933,5941,9182,2052,9331,9078,9736,4785,8536,966,7121,2889,1170,1827,9154,1717,7508,6401,2120,629,4788,6632,6291,2233,3804,5604,2695,9463,1116,2437,1069,3705,5430,9485,2643,2059,2561,1316,7560,9601,8616,5159,8465,2175,7704,6117,887,1519,4501,289,2247,2063,8757,9971,6592,7504,883,9783,232,1144,8718,9868,920,6785,2391,2117,1291,7144,7079,604,2947,6783,6982,3802,340,2379,5301,4049,5623,7718,7285,2626,1961,6094,5902,7431,2585,7460,3561,906,7389,879,646,1132,6606,6678,4583,4831,1047,9081,83,1340,810,7065,8228,623,9819,1836,9881,757,8851,6746,7013,3301,3934,8690,1134,9252,3789,6086,6175,6815,5093,3882,7990,2757,7727,5865,3527,3947,2982,5712,7815,6182,2380,9729,7857,9668,2469,5010,5029,2676,4921,9739,9300,3081,3366,652,6837,1083,8269,164,2068,2101,3153,4059,7629,3064,1243,2425,5733,5879,2616,6876,6018,2681,9481,8311,7774,9131,7537,2205,4280,5435,3867,5562,3730,974,4226,4106,1604,2586,9527,7088,8488,2093,3071,9025,396,6996,1570,9062,6979,8709,4317,5406,1428,1526,4721,6313,4201,9571,3538,1294,3810,9148,184,9910,112,724,3153,6286,2618,1779,5133,8169,8171,6709,2881,9724,9617,8073,7141,9969,9840,6612,134,4340,6237,11,5988,7833,4868,3516,9749,4660,7635,2854,4465,4639,4524,8124,787,9752,1351,9669,7742,2592,925,7103,2310,5261,958,2216,8147,6153,9644,2596,754,8128,8702,9114,883,8070,2238,9415,9276,8287,3339,3785,5604,7333,5640,6372,3833,8646,7755,4929,5803,1444,7039,7658,798,1363,8082,6400,3132,3405,5176,2837,8449,4369,6310,6914,2493,5664,3624,6162,7638,2560,3035,5125,883,4889,2211,4110,7138,2378,2263,9926,8307,5140,1904,4743,298,1774,6062,6849,6545,2880,659,3416,9859,6440,2821,5732,7427,4328,3536,3359,9699,7621,7778,4267,829,1530,2942,3562,302,2083,2602,100,8261,1843,5312,4,6729,4478,9120,7355,3808,6943,701,2700,4281,1636,6092,5198,6499,7165,1688,5470,2243,4656,1713,3066,9874,2456,2839,8902,6541,3281,5188,8283,4676,750,1120,5651,2859,52,1978,2415,7819,3180,1814,6369,7058,5636,9641,6914,287,8079,3807,7853,1367,8224,1574,4274,7395,5171,1008,2036,7504,4709,5397,9403,7981,7223,159,5795,9280,6079,4396,3451,8562,4678,3775,1111,494,7067,8526,2031,9734,2254,9030,1918,9710,6774,5603,1587,6399,7132,3673,6435,2197,2398,6574,6645,7490,5453,2381,4517,4921,1503,2996,3505,483,829,7302,3215,573,406,3803,1925,5816,9531,4011,8112,9880,321,8135,7774,5302,8194,544,5155,8750,1548,381,6632,6354,3120,106,2407,8357,6100,4804,817,9744,8626,1949,4616,6176,5751,3998,5589,8758,6548,5664,5747,8502,2929,8850,1554,472,3493,9415,1349,7611,2687,7653,9012,4365,4256,8630,5899,3684,7358,7914,9929,2072,4899,8324,2530,6118,972,6153,1710,847,2779,8996,3751,4566,6806,4037,4831,1190,4997,8941,1096,5658,3495,9043,506,9043,6286,9922,784,3894,1886,361,91,6683,6322,6329,3246,9551,6968,6539,1808,595,4896,7608,3277,5178,2272,8094,9237,8191,2291,8306,588,7197,7189,1912,2664,5669,4297,7773,8375,7771,7779,590,9654,4361,6575,3646,9946,203,3800,7428,9547,7650,6657,1722,4996,1665,6128,1327,1429,6403,7870,7894,1201,9187,9400,9429,1392,7522,7601,7239,4062,516,958,8571,4538,7107,8040,5122,8600,6315,6814,9796,8128,1868,3344,3644,1500,8780,2645,2344,5342,8562,2134,2410,5128,4348,6512,9273,5314,5402,8134,657,5463,416,7581,911,280,2504,3503,133,6247,494,5705,5820,2238,6162,7100,5021,1302,1834,4527,7943,1760,6253,283,4333,6720,1465,9214,2533,8188,5661,1145,8921,3073,1024,4546,5146,959,1816,2371,4856,7768,4164,8921,27,8213,4947,8085,7646,5617,395,6846,1646,9163,483,9246,2623,1049,8808,7937,4631,7504,5196,3657,945,6701,2642,8028,3580,9695,3076,6756,6986,5994,1021,8222,7265,4021,7055,3788,5389,5805,9967,499,156,1856,7796,3694,8288,3795,4523,7417,8769,8829,2102,8054,4729,7289,5368,7276,6422,6696,2347,5874,6475,5037,9642,9497,6495,6799,8583,7536,1548,906,3878,653,5329,9806,4704,9547,577,5182,1202,3830,8130,1379,7371,8593,2303,7063,8753,6752,3671,6042,5789,7070,7067,3713,8218,9817,1667,866,2890,7633,1386,3928,5953,5548,7454,901,8712,1781,9377,1803,9163,7928,9643,5138,9115,3304,309,470,5469,9194,4255,966,7914,6759,9675,9190,1581,4814,5023,1006,8,3471,6711,9592,2191,561,7298,5190,6219,3165,9056,2793,2856,6160,2074,9323,9879,4205,4074,7095,7229,3337,8670,4475,9234,7741,1130,9421,7475,1336,6707,1923,3057,7323,5396,5273,3120,8954,2685,287,1705,626,9951,1321,3944,8749,9073,4973,6062,5631,1918,1448,8272,5981,9269,922,1606,1025,5352,4421,6205,2328,7309,1826,7318,4707,5440,3003,9332,8841,2111,1378,6770,5956,6748,3513,1147,8976,9183,1208,6384,6143,5090,7595,7286,4775,4435,2113,3941,3330,7957,3614,4170,7805,7295,73,8597,5977,9323,9263,1036,8350,8552,3710,4967,3747,3577,4091,5826,3495,3028,301,6910,5419,5652,1551,7039,342,9784,9602,4767,4800,4801,7880,9898,8167,5272,1242,4272,5133,2725,308,7607,8311,9881,6052,4791,4976,6629,622,8235,8580,7729,7914,8774,3413,8934,7733,4492,634,6292,7500,5973,5899,7613,1412,7261,374,5736,3509,1863,3901,1359,2826,9765,3030,2097,402,4994,1497,6593,2066,6840,4278,4261,7857,7194,4332,8376,4699,620,2851,3464,2127,2213,2355,2712,1409,1716,8379,7007,1960,7960,635,2488,5681,9863,5082,736,5658,6168,8769,2860,3896,7881,877,2240,1426,1833,993,328,3251,7215,2178,4307,9084,385,4681,8355,8639,4782,6229,1470,1253,5125,4982,7616,5785,4411,467,2951,507,2730,9461,3333,767,3388,6490,3538,3995,8308,5635,9656,2940,9077,8502,6101,6625,7737,3324,540,8015,7531,6292,2484,1963,8589,8750,7191,1107,8755,1313,9141,7686,3910,8391,4063,3879,1907,2507,1068,4686,5497,7441,3511,7799,6015,2399,7902,4128,2651,428,6501,2335,2827,1336,6337,8283,5104,2004,4846,5150,6015,421,906,8313,3102,2981,9159,2896,4685,594,7885,5738,4314,8158,2421,3314,4299,6477,7039,9881,8489,5850,9101,353,9967,4578,8678,8003,9855,8039,7300,2170,8989,2414,7318,3894,4450,4465,207,7291,7818,2239,9925,623,998,1031,7651,4399,2779,5792,2087,426,9698,1284,2676,8980,5638,7921,8401,1317,2521,2919,169,7000,2831,8764,9994,333,2544,3275,4502,6983,9595,1776,8724,366,5966,942,5567,7021,2383,4921,1206,2053,5606,1900,3723,5849,1728,2597,7972,1008,5086,2436,2381,471,9300,2912,8212,4732,5834,7489,3308,5780,9310,5735,1355,373,9601,3842,1595,4621,8917,7479,5708,8729,7541,7826 }, +360, +10013, + }, + + { + []int{2, 1, 2, 1, 2}, + 1, + 5, + }, + + { + []int{2, 1, 2, 1, 2}, + 2, + 10, + }, + + { + []int{1, 2, 1, 2, 3}, + 2, + 7, + }, + + { + []int{1, 2, 1, 3, 4}, + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_subarraysWithKDistinct(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, subarraysWithKDistinct(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_subarraysWithKDistinct(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + subarraysWithKDistinct(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0993.cousins-in-binary-tree/1.png b/Algorithms/0993.cousins-in-binary-tree/1.png new file mode 100644 index 000000000..5d4c50ae4 Binary files /dev/null and b/Algorithms/0993.cousins-in-binary-tree/1.png differ diff --git a/Algorithms/0993.cousins-in-binary-tree/2.png b/Algorithms/0993.cousins-in-binary-tree/2.png new file mode 100644 index 000000000..56574fb43 Binary files /dev/null and b/Algorithms/0993.cousins-in-binary-tree/2.png differ diff --git a/Algorithms/0993.cousins-in-binary-tree/3.png b/Algorithms/0993.cousins-in-binary-tree/3.png new file mode 100644 index 000000000..e7a7aaf62 Binary files /dev/null and b/Algorithms/0993.cousins-in-binary-tree/3.png differ diff --git a/Algorithms/0993.cousins-in-binary-tree/README.md b/Algorithms/0993.cousins-in-binary-tree/README.md new file mode 100755 index 000000000..b3e3e6d85 --- /dev/null +++ b/Algorithms/0993.cousins-in-binary-tree/README.md @@ -0,0 +1,41 @@ +# [993. Cousins in Binary Tree](https://leetcode.com/problems/cousins-in-binary-tree/) + +In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. + +Two nodes of a binary tree are cousins if they have the same depth, but have different parents. + +We are given the root of a binary tree with unique values, and the values x and y of two different nodes in the tree. + +Return true if and only if the nodes corresponding to the values x and y are cousins. + +Example 1: + +![1](1.png) + +```text +Input: root = [1,2,3,4], x = 4, y = 3 +Output: false +``` + +Example 2: + +![2](2.png) + +```text +Input: root = [1,2,3,null,4,null,5], x = 5, y = 4 +Output: true +``` + +Example 3: + +![3](3.png) + +```text +Input: root = [1,2,3,null,4], x = 2, y = 3 +Output: false +``` + +Note: + +- The number of nodes in the tree will be between 2 and 100. +- Each node has a unique integer value from 1 to 100. \ No newline at end of file diff --git a/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree.go b/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree.go new file mode 100755 index 000000000..2695bbc3f --- /dev/null +++ b/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree.go @@ -0,0 +1,37 @@ +package problem0993 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is Pre-defined.... +type TreeNode = kit.TreeNode + +func isCousins(root *TreeNode, x int, y int) bool { + root = &TreeNode{Left: root} + px, dx := dfs(root, x) + py, dy := dfs(root, y) + return dx == dy && px != py +} + +// dfs do NOT check the first root +func dfs(root *TreeNode, x int) (*TreeNode, int) { + if root == nil { + return nil, 0 + } + + if (root.Left != nil && root.Left.Val == x) || + (root.Right != nil && root.Right.Val == x) { + return root, 1 + } + + if parent, depth := dfs(root.Left, x); depth > 0 { + return parent, depth + 1 + } + + if parent, depth := dfs(root.Right, x); depth > 0 { + return parent, depth + 1 + } + + return nil, 0 +} diff --git a/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree_test.go b/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree_test.go new file mode 100755 index 000000000..4b6a0ade2 --- /dev/null +++ b/Algorithms/0993.cousins-in-binary-tree/cousins-in-binary-tree_test.go @@ -0,0 +1,58 @@ +package problem0993 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + x int + y int + ans bool +}{ + + { + []int{1, 2, 3, 4}, + 4, + 3, + false, + }, + + { + []int{1, 2, 3, kit.NULL, 4, kit.NULL, 5}, + 5, + 4, + true, + }, + + { + []int{1, 2, 3, kit.NULL, 4}, + 2, + 3, + false, + }, + + // 可以有多个 testcase +} + +func Test_isCousins(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, isCousins(root, tc.x, tc.y), "输入:%v", tc) + } +} + +func Benchmark_isCousins(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + isCousins(root, tc.x, tc.y) + } + } +} diff --git a/Algorithms/0994.rotting-oranges/1.png b/Algorithms/0994.rotting-oranges/1.png new file mode 100644 index 000000000..ce69a318d Binary files /dev/null and b/Algorithms/0994.rotting-oranges/1.png differ diff --git a/Algorithms/0994.rotting-oranges/README.md b/Algorithms/0994.rotting-oranges/README.md new file mode 100755 index 000000000..40eb0e0a6 --- /dev/null +++ b/Algorithms/0994.rotting-oranges/README.md @@ -0,0 +1,42 @@ +# [994. Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) + +In a given grid, each cell can have one of three values: + +- the value 0 representing an empty cell; +- the value 1 representing a fresh orange; +- the value 2 representing a rotten orange. + +Every minute, any fresh orange that is adjacent (4-directionally) to a rotten orange becomes rotten. + +Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return -1 instead. + +![1](1.png) + +Example 1: + +```text +Input: [[2,1,1],[1,1,0],[0,1,1]] +Output: 4 +``` + +Example 2: + +```text +Input: [[2,1,1],[0,1,1],[1,0,1]] +Output: -1 +Explanation: The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally. +``` + +Example 3: + +```text +Input: [[0,2]] +Output: 0 +Explanation: Since there are already no fresh oranges at minute 0, the answer is just 0. +``` + +Note: + +- 1 <= grid.length <= 10 +- 1 <= grid[0].length <= 10 +- grid[i][j] is only 0, 1, or 2. diff --git a/Algorithms/0994.rotting-oranges/rotting-oranges.go b/Algorithms/0994.rotting-oranges/rotting-oranges.go new file mode 100755 index 000000000..0e43ba374 --- /dev/null +++ b/Algorithms/0994.rotting-oranges/rotting-oranges.go @@ -0,0 +1,51 @@ +package problem0994 + +var dx = [4]int{0, 0, -1, 1} +var dy = [4]int{-1, 1, 0, 0} + +func orangesRotting(grid [][]int) int { + m, n := len(grid), len(grid[0]) + + fresh := 0 + rottens := make([][2]int, 0, m*n) + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + switch grid[i][j] { + case 1: + fresh++ + case 2: + rottens = append(rottens, [2]int{i, j}) + } + } + } + + if fresh == 0 { // special case + return 0 + } + + count := -1 + for len(rottens) > 0 { + count++ + size := len(rottens) + for r := 0; r < size; r++ { + x, y := rottens[r][0], rottens[r][1] + for k := 0; k < 4; k++ { + i, j := x+dx[k], y+dy[k] + if i < 0 || m <= i || + j < 0 || n <= j || + grid[i][j] != 1 { + continue + } + grid[i][j] = 2 + fresh-- + rottens = append(rottens, [2]int{i, j}) + } + } + rottens = rottens[size:] + } + + if fresh > 0 { + return -1 + } + return count +} diff --git a/Algorithms/0994.rotting-oranges/rotting-oranges_test.go b/Algorithms/0994.rotting-oranges/rotting-oranges_test.go new file mode 100755 index 000000000..fc538e78b --- /dev/null +++ b/Algorithms/0994.rotting-oranges/rotting-oranges_test.go @@ -0,0 +1,52 @@ +package problem0994 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{2, 1, 1}, {1, 1, 0}, {0, 1, 1}}, + 4, + }, + + { + [][]int{{2, 1, 1}, {0, 1, 1}, {1, 0, 1}}, + -1, + }, + + { + [][]int{{0, 2}}, + 0, + }, + + { + [][]int{{0}}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_orangesRotting(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, orangesRotting(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_orangesRotting(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + orangesRotting(tc.grid) + } + } +} diff --git a/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/README.md b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/README.md new file mode 100755 index 000000000..5cbd4eeaa --- /dev/null +++ b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/README.md @@ -0,0 +1,37 @@ +# [995. Minimum Number of K Consecutive Bit Flips](https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips/) + +In an array A containing only 0s and 1s, a K-bit flip consists of choosing a (contiguous) subarray of length K and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to 0. + +Return the minimum number of K-bit flips required so that there is no 0 in the array. If it is not possible, return -1. + +Example 1: + +```text +Input: A = [0,1,0], K = 1 +Output: 2 +Explanation: Flip A[0], then flip A[2]. +``` + +Example 2: + +```text +Input: A = [1,1,0], K = 2 +Output: -1 +Explanation: No matter how we flip subarrays of size 2, we can't make the array become [1,1,1]. +``` + +Example 3: + +```text +Input: A = [0,0,0,1,0,1,1,0], K = 3 +Output: 3 +Explanation: +Flip A[0],A[1],A[2]: A becomes [1,1,1,1,0,1,1,0] +Flip A[4],A[5],A[6]: A becomes [1,1,1,1,1,0,0,0] +Flip A[5],A[6],A[7]: A becomes [1,1,1,1,1,1,1,1] +``` + +Note: + +- `1 <= A.length <= 30000` +- `1 <= K <= A.length` diff --git a/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips.go b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips.go new file mode 100755 index 000000000..a2d9fa1bb --- /dev/null +++ b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips.go @@ -0,0 +1,24 @@ +package problem0995 + +func minKBitFlips(A []int, K int) int { + size := len(A) + + swap := make([]int, size+1) + flag := 1 + + res := 0 + for i := 0; i < size; i++ { + flag ^= swap[i] + if A[i] == flag { + continue + } + if i+K > size { + return -1 + } + res++ + flag ^= 1 // swap flag + swap[i+K] = 1 // swap flag back when i+K + } + + return res +} diff --git a/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips_test.go b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips_test.go new file mode 100755 index 000000000..760303883 --- /dev/null +++ b/Algorithms/0995.minimum-number-of-k-consecutive-bit-flips/minimum-number-of-k-consecutive-bit-flips_test.go @@ -0,0 +1,57 @@ +package problem0995 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{0, 1, 0}, + 1, + 2, + }, + + { +[]int{ 0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,1,1,0,0,0,0,1,0,1,0,1,0,1,1,1,1,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,1,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,1,1,1,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,1,0,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,1,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,1,0,1,0,1,0,0,1,1,1,1,0,1,1,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,1,0,1,1,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,0,1,1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,1,0,1,0,0,1,0,1,1,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,0,0,1,1,0,0,1,1,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,0,1,1,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,0,1,0,1,0,0,1,1,0,1,1,1,1,0,0,1,1,0,1,0,0,1,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,1,0,0,1,1,0,1,1,1,1,1,0,0,0,0,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,1,0,1,1,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,0,0,0,1,0,0,1,0,0,1,1 }, +3693, +3152, + }, + + { + []int{0, 0, 0, 1, 0, 1, 1, 0}, + 3, + 3, + }, + + { + []int{1, 1, 0}, + 2, + -1, + }, + + // 可以有多个 testcase +} + +func Test_minKBitFlips(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minKBitFlips(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_minKBitFlips(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minKBitFlips(tc.A, tc.K) + } + } +} diff --git a/Algorithms/0996.number-of-squareful-arrays/README.md b/Algorithms/0996.number-of-squareful-arrays/README.md new file mode 100755 index 000000000..31eb6db9a --- /dev/null +++ b/Algorithms/0996.number-of-squareful-arrays/README.md @@ -0,0 +1,26 @@ +# [996. Number of Squareful Arrays](https://leetcode.com/problems/number-of-squareful-arrays/) + +Given an array A of non-negative integers, the array is squareful if for every pair of adjacent elements, their sum is a perfect square. + +Return the number of permutations of A that are squareful. Two permutations A1 and A2 differ if and only if there is some index i such that A1[i] != A2[i]. + +Example 1: + +```text +Input: [1,17,8] +Output: 2 +Explanation: +[1,8,17] and [17,8,1] are the valid permutations. +``` + +Example 2: + +```text +Input: [2,2,2] +Output: 1 +``` + +Note: + +- 1 <= A.length <= 12 +- 0 <= A[i] <= 1e9 diff --git a/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays.go b/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays.go new file mode 100755 index 000000000..8044c95c8 --- /dev/null +++ b/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays.go @@ -0,0 +1,49 @@ +package problem0996 + +import "math" + +// ref: https://leetcode.com/problems/number-of-squareful-arrays/discuss/238562/C%2B%2BPython-Backtracking +func numSquarefulPerms(A []int) int { + size := len(A) + + count := make(map[int]int, size) + for _, a := range A { + count[a]++ + } + + cands := make(map[int][]int, size) + for x := range count { + for y := range count { + if isSquare(x + y) { + cands[x] = append(cands[x], y) + } + } + } + + res := 0 + var dfs func(int, int) + dfs = func(x, remain int) { + if remain == 0 { + res++ + return + } + count[x]-- + for _, y := range cands[x] { + if count[y] > 0 { + dfs(y, remain-1) + } + } + count[x]++ + } + + for x := range count { + dfs(x, size-1) + } + + return res +} + +func isSquare(x int) bool { + root := int(math.Sqrt(float64(x))) + return root*root == x +} diff --git a/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays_test.go b/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays_test.go new file mode 100755 index 000000000..264dd55f7 --- /dev/null +++ b/Algorithms/0996.number-of-squareful-arrays/number-of-squareful-arrays_test.go @@ -0,0 +1,51 @@ +package problem0996 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{7, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, + 12, + }, + + { + []int{2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, + 1, + }, + + { + []int{1, 17, 8}, + 2, + }, + + { + []int{2, 2, 2}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_numSquarefulPerms(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + ast.Equal(tc.ans, numSquarefulPerms(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numSquarefulPerms(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSquarefulPerms(tc.A) + } + } +} diff --git a/Algorithms/0997.find-the-town-judge/README.md b/Algorithms/0997.find-the-town-judge/README.md new file mode 100755 index 000000000..12354b474 --- /dev/null +++ b/Algorithms/0997.find-the-town-judge/README.md @@ -0,0 +1,56 @@ +# [997. Find the Town Judge](https://leetcode.com/problems/find-the-town-judge/) + +In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. + +If the town judge exists, then: + +1. The town judge trusts nobody. +1. Everybody (except for the town judge) trusts the town judge. +1. There is exactly one person that satisfies properties 1 and 2. + +You are given trust, an array of pairs trust[i] = [a, b] representing that the person labelled a trusts the person labelled b. + +If the town judge exists and can be identified, return the label of the town judge. Otherwise, return -1. + +Example 1: + +```text +Input: N = 2, trust = [[1,2]] +Output: 2 +``` + +Example 2: + +```text +Input: N = 3, trust = [[1,3],[2,3]] +Output: 3 +``` + +Example 3: + +```text +Input: N = 3, trust = [[1,3],[2,3],[3,1]] +Output: -1 +``` + +Example 4: + +```text +Input: N = 3, trust = [[1,2],[2,3]] +Output: -1 +``` + +Example 5: + +```text +Input: N = 4, trust = [[1,3],[1,4],[2,3],[2,4],[4,3]] +Output: 3 +``` + +Note: + +- 1 <= N <= 1000 +- trust.length <= 10000 +- trust[i] are all different +- trust[i][0] != trust[i][1] +- 1 <= trust[i][0], trust[i][1] <= N diff --git a/Algorithms/0997.find-the-town-judge/find-the-town-judge.go b/Algorithms/0997.find-the-town-judge/find-the-town-judge.go new file mode 100755 index 000000000..2e1f685bb --- /dev/null +++ b/Algorithms/0997.find-the-town-judge/find-the-town-judge.go @@ -0,0 +1,18 @@ +package problem0997 + +func findJudge(N int, trust [][]int) int { + count := [1001]int{} + trustSomebody := [1001]bool{} + for _, t := range trust { + count[t[1]]++ + trustSomebody[t[0]] = true + } + + for i := 1; i <= N; i++ { + if count[i] == N-1 && !trustSomebody[i] { + return i + } + } + + return -1 +} diff --git a/Algorithms/0997.find-the-town-judge/find-the-town-judge_test.go b/Algorithms/0997.find-the-town-judge/find-the-town-judge_test.go new file mode 100755 index 000000000..9e0066d8e --- /dev/null +++ b/Algorithms/0997.find-the-town-judge/find-the-town-judge_test.go @@ -0,0 +1,69 @@ +package problem0997 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + trust [][]int + ans int +}{ + + { + 1, + [][]int{}, + 1, + }, + + { + 2, + [][]int{{1, 2}}, + 2, + }, + + { + 3, + [][]int{{1, 3}, {2, 3}}, + 3, + }, + + { + 3, + [][]int{{1, 3}, {2, 3}, {3, 1}}, + -1, + }, + + { + 3, + [][]int{{1, 2}, {2, 3}}, + -1, + }, + + { + 4, + [][]int{{1, 3}, {1, 4}, {2, 3}, {2, 4}, {4, 3}}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_findJudge(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, findJudge(tc.N, tc.trust), "输入:%v", tc) + } +} + +func Benchmark_findJudge(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findJudge(tc.N, tc.trust) + } + } +} diff --git a/Algorithms/0998.maximum-binary-tree-ii/1.1.png b/Algorithms/0998.maximum-binary-tree-ii/1.1.png new file mode 100644 index 000000000..feea0fe1e Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/1.1.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/1.2.png b/Algorithms/0998.maximum-binary-tree-ii/1.2.png new file mode 100644 index 000000000..c5d267cc0 Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/1.2.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/2.1.png b/Algorithms/0998.maximum-binary-tree-ii/2.1.png new file mode 100644 index 000000000..7d3e53c67 Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/2.1.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/2.2.png b/Algorithms/0998.maximum-binary-tree-ii/2.2.png new file mode 100644 index 000000000..f5f00c506 Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/2.2.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/3.1.png b/Algorithms/0998.maximum-binary-tree-ii/3.1.png new file mode 100644 index 000000000..9415518db Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/3.1.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/3.2.png b/Algorithms/0998.maximum-binary-tree-ii/3.2.png new file mode 100644 index 000000000..d91de6405 Binary files /dev/null and b/Algorithms/0998.maximum-binary-tree-ii/3.2.png differ diff --git a/Algorithms/0998.maximum-binary-tree-ii/README.md b/Algorithms/0998.maximum-binary-tree-ii/README.md new file mode 100755 index 000000000..1dd76eb54 --- /dev/null +++ b/Algorithms/0998.maximum-binary-tree-ii/README.md @@ -0,0 +1,54 @@ +# [998. Maximum Binary Tree II](https://leetcode.com/problems/maximum-binary-tree-ii/) + +We are given the root node of a maximum tree: a tree where every node has a value greater than any other value in its subtree. + +Just as in the [previous problem](https://leetcode.com/problems/maximum-binary-tree/), the given tree was constructed from an list A (root = Construct(A)) recursively with the following Construct(A) routine: + +- If A is empty, return null. +- Otherwise, let A[i] be the largest element of A. Create a root node with value A[i]. +- The left child of root will be Construct([A[0], A[1], ..., A[i-1]]) +- The right child of root will be Construct([A[i+1], A[i+2], ..., A[A.length - 1]]) +- Return root. + +Note that we were not given A directly, only a root node root = Construct(A). + +Suppose B is a copy of A with the value val appended to it. It is guaranteed that B has unique values. + +Return Construct(B). + +Example 1: + +![1.1](1.1.png) +![1.2](1.2.png) + +```text +Input: root = [4,1,3,null,null,2], val = 5 +Output: [5,4,null,1,3,null,null,2] +Explanation: A = [1,4,2,3], B = [1,4,2,3,5] +``` + +Example 2: + +![2.1](2.1.png) +![2.2](2.2.png) + +```text +Input: root = [5,2,4,null,1], val = 3 +Output: [5,2,4,null,1,null,3] +Explanation: A = [2,1,5,4], B = [2,1,5,4,3] +``` + +Example 3: + +![3.1](3.1.png) +![3.2](3.2.png) + +```text +Input: root = [5,2,3,null,1], val = 4 +Output: [5,2,4,null,1,3] +Explanation: A = [2,1,5,3], B = [2,1,5,3,4] +``` + +Note: + +- `1 <= B.length <= 100` diff --git a/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii.go b/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii.go new file mode 100755 index 000000000..a8a08b7ee --- /dev/null +++ b/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii.go @@ -0,0 +1,23 @@ +package problem0998 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func insertIntoMaxTree(root *TreeNode, val int) *TreeNode { + if root == nil { + return &TreeNode{Val: val} + } + + if val > root.Val { + return &TreeNode{ + Val: val, + Left: root, + } + } + + root.Right = insertIntoMaxTree(root.Right, val) + + return root +} diff --git a/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii_test.go b/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii_test.go new file mode 100755 index 000000000..7f8b9bc67 --- /dev/null +++ b/Algorithms/0998.maximum-binary-tree-ii/maximum-binary-tree-ii_test.go @@ -0,0 +1,55 @@ +package problem0998 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + val int + ans []int +}{ + + { + []int{4, 1, 3, kit.NULL, kit.NULL, 2}, + 5, + []int{5, 4, kit.NULL, 1, 3, kit.NULL, kit.NULL, 2}, + }, + + { + []int{5, 2, 4, kit.NULL, 1}, + 3, + []int{5, 2, 4, kit.NULL, 1, kit.NULL, 3}, + }, + + { + []int{5, 2, 3, kit.NULL, 1}, + 4, + []int{5, 2, 4, kit.NULL, 1, 3}, + }, + + // 可以有多个 testcase +} + +func Test_insertIntoMaxTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ans := kit.Ints2TreeNode(tc.ans) + ast.Equal(ans, insertIntoMaxTree(root, tc.val), "输入:%v", tc) + } +} + +func Benchmark_insertIntoMaxTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + insertIntoMaxTree(root, tc.val) + } + } +} diff --git a/Algorithms/0999.available-captures-for-rook/1.png b/Algorithms/0999.available-captures-for-rook/1.png new file mode 100644 index 000000000..24c6e6d39 Binary files /dev/null and b/Algorithms/0999.available-captures-for-rook/1.png differ diff --git a/Algorithms/0999.available-captures-for-rook/2.png b/Algorithms/0999.available-captures-for-rook/2.png new file mode 100644 index 000000000..404336b54 Binary files /dev/null and b/Algorithms/0999.available-captures-for-rook/2.png differ diff --git a/Algorithms/0999.available-captures-for-rook/3.png b/Algorithms/0999.available-captures-for-rook/3.png new file mode 100644 index 000000000..fee9ce4ca Binary files /dev/null and b/Algorithms/0999.available-captures-for-rook/3.png differ diff --git a/Algorithms/0999.available-captures-for-rook/README.md b/Algorithms/0999.available-captures-for-rook/README.md new file mode 100755 index 000000000..5ae04840f --- /dev/null +++ b/Algorithms/0999.available-captures-for-rook/README.md @@ -0,0 +1,70 @@ +# [999. Available Captures for Rook](https://leetcode.com/problems/available-captures-for-rook/) + +On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters 'R', '.', 'B', and 'p' respectively. Uppercase characters represent white pieces, and lowercase characters represent black pieces. + +The rook moves as in the rules of Chess: it chooses one of four cardinal directions (north, east, west, and south), then moves in that direction until it chooses to stop, reaches the edge of the board, or captures an opposite colored pawn by moving to the same square it occupies. Also, rooks cannot move into the same square as other friendly bishops. + +Return the number of pawns the rook can capture in one move. + +Example 1: + +![1](1.png) + +```text +Input: [ +[".",".",".",".",".",".",".","."], +[".",".",".","p",".",".",".","."], +[".",".",".","R",".",".",".","p"], +[".",".",".",".",".",".",".","."], +[".",".",".",".",".",".",".","."], +[".",".",".","p",".",".",".","."], +[".",".",".",".",".",".",".","."], +[".",".",".",".",".",".",".","."]] +Output: 3 +Explanation: +In this example the rook is able to capture all the pawns. +``` + +Example 2: + +![2](2.png) + +```text +Input: [ +[".",".",".",".",".",".",".","."], +[".","p","p","p","p","p",".","."], +[".","p","p","B","p","p",".","."], +[".","p","B","R","B","p",".","."], +[".","p","p","B","p","p",".","."], +[".","p","p","p","p","p",".","."], +[".",".",".",".",".",".",".","."], +[".",".",".",".",".",".",".","."]] +Output: 0 +Explanation: +Bishops are blocking the rook to capture any pawn. +``` + +Example 3: + +![3](3.png) + +```text +Input: [ +[".",".",".",".",".",".",".","."], +[".",".",".","p",".",".",".","."], +[".",".",".","p",".",".",".","."], +["p","p",".","R",".","p","B","."], +[".",".",".",".",".",".",".","."], +[".",".",".","B",".",".",".","."], +[".",".",".","p",".",".",".","."], +[".",".",".",".",".",".",".","."]] +Output: 3 +Explanation: +The rook can capture the pawns at positions b5, d6 and f5. +``` + +Note: + +- board.length == board[i].length == 8 +- board[i][j] is either 'R', '.', 'B', or 'p' +- There is exactly one cell with board[i][j] == 'R' \ No newline at end of file diff --git a/Algorithms/0999.available-captures-for-rook/available-captures-for-rook.go b/Algorithms/0999.available-captures-for-rook/available-captures-for-rook.go new file mode 100755 index 000000000..1decb2945 --- /dev/null +++ b/Algorithms/0999.available-captures-for-rook/available-captures-for-rook.go @@ -0,0 +1,35 @@ +package problem0999 + +var dx = [4]int{0, 0, -1, 1} +var dy = [4]int{-1, 1, 0, 0} + +func numRookCaptures(board [][]byte) int { + res := 0 + i, j := findRook(board) + // explore 4 direction + for k := 0; k < 4; k++ { + x, y := i+dx[k], j+dy[k] + for 0 <= x && x < 8 && + 0 <= y && y < 8 && + board[x][y] != 'B' { + if board[x][y] == 'p' { + res++ + break + } + x += dx[k] + y += dy[k] + } + } + return res +} + +func findRook(board [][]byte) (i, j int) { + for i = 0; i < 8; i++ { + for j = 0; j < 8; j++ { + if board[i][j] == 'R' { + return + } + } + } + panic("No Rook") +} diff --git a/Algorithms/0999.available-captures-for-rook/available-captures-for-rook_test.go b/Algorithms/0999.available-captures-for-rook/available-captures-for-rook_test.go new file mode 100755 index 000000000..cab30a3f7 --- /dev/null +++ b/Algorithms/0999.available-captures-for-rook/available-captures-for-rook_test.go @@ -0,0 +1,88 @@ +package problem0999 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + board [][]byte + ans int +}{ + + { + [][]byte{ + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', 'R', '.', '.', '.', 'p'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + }, + 3, + }, + + { + [][]byte{ + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'}, + {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'}, + {'.', 'p', 'B', 'R', 'B', 'p', '.', '.'}, + {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'}, + {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + }, + 0, + }, + + { + [][]byte{ + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'p', 'p', '.', 'R', '.', 'p', 'B', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'B', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + }, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numRookCaptures(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + ast.Equal(tc.ans, numRookCaptures(tc.board), "输入:%v", tc) + } +} + +func Test_numRookCaptures_NoRook(t *testing.T) { + ast := assert.New(t) + board := [][]byte{ + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'p', 'p', '.', '.', '.', 'p', 'B', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + {'.', '.', '.', 'B', '.', '.', '.', '.'}, + {'.', '.', '.', 'p', '.', '.', '.', '.'}, + {'.', '.', '.', '.', '.', '.', '.', '.'}, + } + ast.PanicsWithValue("No Rook", func() { numRookCaptures(board) }, "没有检测出不含 Rook 的 board") +} + +func Benchmark_numRookCaptures(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numRookCaptures(tc.board) + } + } +} diff --git a/Algorithms/1000.minimum-cost-to-merge-stones/README.md b/Algorithms/1000.minimum-cost-to-merge-stones/README.md new file mode 100755 index 000000000..ebb03ac1e --- /dev/null +++ b/Algorithms/1000.minimum-cost-to-merge-stones/README.md @@ -0,0 +1,46 @@ +# [1000. Minimum Cost to Merge Stones](https://leetcode.com/problems/minimum-cost-to-merge-stones/) + +There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. + +A move consists of merging exactly K consecutive piles into one pile, and the cost of this move is equal to the total number of stones in these K piles. + +Find the minimum cost to merge all piles of stones into one pile. If it is impossible, return -1. + +Example 1: + +```text +Input: stones = [3,2,4,1], K = 2 +Output: 20 +Explanation: +We start with [3, 2, 4, 1]. +We merge [3, 2] for a cost of 5, and we are left with [5, 4, 1]. +We merge [4, 1] for a cost of 5, and we are left with [5, 5]. +We merge [5, 5] for a cost of 10, and we are left with [10]. +The total cost was 20, and this is the minimum possible. +``` + +Example 2: + +```text +Input: stones = [3,2,4,1], K = 3 +Output: -1 +Explanation: After any merge operation, there are 2 piles left, and we can't merge anymore. So the task is impossible. +``` + +Example 3: + +```text +Input: stones = [3,5,1,2,6], K = 3 +Output: 25 +Explanation: +We start with [3, 5, 1, 2, 6]. +We merge [5, 1, 2] for a cost of 8, and we are left with [3, 8, 6]. +We merge [3, 8, 6] for a cost of 17, and we are left with [17]. +The total cost was 25, and this is the minimum possible. +``` + +Note: + +- `1 <= stones.length <= 30` +- `2 <= K <= 30` +- `1 <= stones[i] <= 100` diff --git a/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones.go b/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones.go new file mode 100755 index 000000000..d0756739a --- /dev/null +++ b/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones.go @@ -0,0 +1,49 @@ +package problem1000 + +// ref: https://leetcode.com/problems/minimum-cost-to-merge-stones/discuss/247567/JavaC%2B%2BPython-DP +func mergeStones(stones []int, K int) int { + size := len(stones) + if (size-1)%(K-1) != 0 { + return -1 + } + + sum := [31]int{} + for i := 0; i < size; i++ { + sum[i+1] = sum[i] + stones[i] + } + + dp := [31][31]int{} + // dp[l][r] 的含义是, + // stones[l:r+1] 完成**所有**合并后,所花费的最小费用。 + // 我着重强调了 **所有** 二字 + // dp[l][r] 在完成所有合并后,有两种可能 + // 1. 合并成一块石头 + // 2. 没有合并成一块石头 + + for width := K; width <= size; width++ { + for l := 0; l+width <= size; l++ { + r := l + width - 1 + dp[l][r] = 1 << 32 + for m := l; m < r; m += K - 1 { + dp[l][r] = min(dp[l][r], dp[l][m]+dp[m+1][r]) + // 把 dp[l][r] 分解成两个部分 + // dp[l][m] 代表了,能合并成一块石头的左边, + // dp[m+1][r] 代表了,剩下的右边。 + } + if (r-l)%(K-1) == 0 { + // 如果 dp[l][r] 的左边和右边还能够进行合并 + // 还要加上最后一次合并的费用 + dp[l][r] += sum[r+1] - sum[l] + } + } + } + + return dp[0][size-1] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones_test.go b/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones_test.go new file mode 100755 index 000000000..1c9ac0798 --- /dev/null +++ b/Algorithms/1000.minimum-cost-to-merge-stones/minimum-cost-to-merge-stones_test.go @@ -0,0 +1,51 @@ +package problem1000 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones []int + K int + ans int +}{ + + { + []int{3, 5, 1, 2, 6}, + 3, + 25, + }, + + { + []int{3, 2, 4, 1}, + 2, + 20, + }, + + { + []int{3, 2, 4, 1}, + 3, + -1, + }, + + // 可以有多个 testcase +} + +func Test_mergeStones(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, mergeStones(tc.stones, tc.K), "输入:%v", tc) + } +} + +func Benchmark_mergeStones(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + mergeStones(tc.stones, tc.K) + } + } +} diff --git a/Algorithms/1001.grid-illumination/README.md b/Algorithms/1001.grid-illumination/README.md new file mode 100755 index 000000000..171e2693a --- /dev/null +++ b/Algorithms/1001.grid-illumination/README.md @@ -0,0 +1,40 @@ +# [1001. Grid Illumination](https://leetcode.com/problems/grid-illumination/) + +On a N x N grid of cells, each cell (x, y) with 0 <= x < N and 0 <= y < N has a lamp. + +Initially, some number of lamps are on. lamps[i] tells us the location of the i-th lamp that is on. Each lamp that is on illuminates every square on its x-axis, y-axis, and both diagonals (similar to a Queen in chess). + +For the i-th query queries[i] = (x, y), the answer to the query is 1 if the cell (x, y) is illuminated, else 0. + +After each query (x, y) [in the order given by queries], we turn off any lamps that are at cell (x, y) or are adjacent 8-directionally (ie., share a corner or edge with cell (x, y).) + +Return an array of answers. Each value answer[i] should be equal to the answer of the i-th query queries[i]. + +Example 1: + +```text +Input: N = 5, lamps = [[0,0],[4,4]], queries = [[1,1],[1,0]] +Output: [1,0] +Explanation: +Before performing the first query we have both lamps [0,0] and [4,4] on. +The grid representing which cells are lit looks like this, where [0,0] is the top left corner, and [4,4] is the bottom right corner: +1 1 1 1 1 +1 1 0 0 1 +1 0 1 0 1 +1 0 0 1 1 +1 1 1 1 1 +Then the query at [1, 1] returns 1 because the cell is lit. After this query, the lamp at [0, 0] turns off, and the grid now looks like this: +1 0 0 0 1 +0 1 0 0 1 +0 0 1 0 1 +0 0 0 1 1 +1 1 1 1 1 +Before performing the second query we have only the lamp [4,4] on. Now the query at [1,0] returns 0, because the cell is no longer lit. +``` + +Note: + +- `1 <= N <= 10^9` +- `0 <= lamps.length <= 20000` +- `0 <= queries.length <= 20000` +- `lamps[i].length == queries[i].length == 2` diff --git a/Algorithms/1001.grid-illumination/grid-illumination.go b/Algorithms/1001.grid-illumination/grid-illumination.go new file mode 100755 index 000000000..1cb44cef5 --- /dev/null +++ b/Algorithms/1001.grid-illumination/grid-illumination.go @@ -0,0 +1,90 @@ +package problem1001 + +func gridIllumination(N int, lamps [][]int, queries [][]int) []int { + l := newLights(N) + for _, lamp := range lamps { + x, y := lamp[0], lamp[1] + l.turnOn(x, y) + } + + res := make([]int, 0, len(queries)) + for _, cell := range queries { + x, y := cell[0], cell[1] + res = append(res, l.checkIlluminated(x, y)) + } + + return res +} + +type lights struct { + h, v, ad, dd map[int]int + isOn map[int]bool + n int +} + +func newLights(N int) *lights { + return &lights{ + h: make(map[int]int, 1024), + v: make(map[int]int, 1024), + ad: make(map[int]int, 1024), + dd: make(map[int]int, 1024), + isOn: make(map[int]bool, 1024), + n: N, + } +} + +func (l *lights) turnOn(x, y int) { + l.h[x]++ + l.v[y]++ + l.ad[x+y]++ + l.dd[x-y]++ + l.isOn[x<<32+y] = true +} + +func (l *lights) turnOff(x, y int) { + if x < 0 || l.n <= x || + y < 0 || l.n <= y || + !l.isOn[x<<32+y] { + return + } + l.isOn[x<<32+y] = false + l.h[x]-- + l.v[y]-- + l.ad[x+y]-- + l.dd[x-y]-- +} + +func (l *lights) checkIlluminated(x, y int) int { + res := 0 + + if l.h[x] > 0 { // maybe [x,y-1] or [x,y] or [x,y+1] is On + res = 1 + l.turnOff(x, y-1) + l.turnOff(x, y+1) + // leave [x,y] in the end + } + + if l.v[y] > 0 { + res = 1 + l.turnOff(x-1, y) + l.turnOff(x+1, y) + } + + if l.ad[x+y] > 0 { + res = 1 + l.turnOff(x-1, y+1) + l.turnOff(x+1, y-1) + } + + if l.dd[x-y] > 0 { + res = 1 + l.turnOff(x-1, y-1) + l.turnOff(x+1, y+1) + } + + if res == 1 { + l.turnOff(x, y) + } + + return res +} diff --git a/Algorithms/1001.grid-illumination/grid-illumination_test.go b/Algorithms/1001.grid-illumination/grid-illumination_test.go new file mode 100755 index 000000000..766826b89 --- /dev/null +++ b/Algorithms/1001.grid-illumination/grid-illumination_test.go @@ -0,0 +1,48 @@ +package problem1001 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + lamps [][]int + queries [][]int + ans []int +}{ + + { + 5, + [][]int{{0, 0}, {4, 4}}, + [][]int{{1, 1}, {1, 0}}, + []int{1, 0}, + }, + + { + 10000, + [][]int{{6781, 8653}, {2624, 6531}, {7485, 1378}, {3819, 4964}, {7741, 343}, {9960, 5}, {83, 1173}, {9533, 9441}, {1763, 8712}, {2082, 6100}, {4538, 9471}, {9093, 9315}, {3415, 1120}, {8646, 7698}, {7660, 4705}, {6683, 9643}, {3665, 9248}, {685, 6302}, {8082, 4077}, {9369, 91}, {9404, 5771}, {7233, 9561}, {3236, 8674}, {6280, 3683}, {4672, 272}, {9098, 7894}, {9051, 7955}, {6721, 5461}, {1525, 4768}, {2305, 3189}, {1425, 1664}, {7277, 5281}, {5270, 94}, {9135, 1047}, {1423, 2026}, {9364, 2504}, {1387, 9993}, {4382, 9260}, {1981, 9858}, {7104, 6716}, {4844, 7154}, {1974, 1734}, {5252, 1305}, {122, 6845}, {6148, 6059}, {7072, 4871}, {5503, 9185}, {2443, 8877}, {6763, 4757}, {1733, 270}, {7044, 953}, {2843, 7884}, {3418, 7137}, {3455, 1437}, {8334, 1716}, {1941, 3179}, {5258, 2367}, {3446, 3109}, {1750, 4210}, {6160, 7724}, {995, 3633}, {2915, 5399}, {6484, 6788}, {2869, 1759}, {7072, 4567}, {7647, 5011}, {6274, 9931}, {2319, 6246}, {1785, 7459}, {2916, 7772}, {9800, 1224}, {1349, 3521}, {6343, 5734}, {7690, 3297}, {4464, 4156}, {4481, 4577}, {5123, 8000}, {9307, 5493}, {434, 3497}, {156, 2584}, {3350, 9427}, {9518, 8519}, {6584, 9086}, {8670, 3110}, {5609, 704}, {8206, 9545}, {234, 2094}, {2546, 5708}, {1748, 775}, {6867, 3292}, {418, 8985}, {2143, 8460}, {9026, 4618}, {6422, 8113}, {776, 7424}, {4863, 246}, {9547, 9529}, {7281, 3801}, {1158, 756}, {3594, 6972}, {2104, 8230}, {6284, 9381}, {8005, 663}, {4891, 7678}, {5986, 6802}, {7632, 5781}, {252, 1032}, {6553, 1117}, {6802, 2078}, {7254, 6108}, {8183, 6906}, {4270, 779}, {7025, 5290}, {8568, 3721}, {5037, 5117}, {3762, 936}, {5608, 7927}, {1806, 239}, {311, 7986}, {2336, 2070}, {5936, 3448}, {2625, 3869}, {3151, 3786}, {8015, 4709}, {9602, 3628}, {9979, 8901}, {1230, 4326}, {7385, 1126}, {4807, 8996}, {8851, 3992}, {8683, 4647}, {2647, 8763}, {8057, 7091}, {6324, 6119}, {2194, 6463}, {6001, 116}, {7471, 3912}, {695, 5827}, {1466, 2573}, {8290, 8915}, {6643, 964}, {6323, 2508}, {6348, 8692}, {65, 1256}, {3502, 9145}, {7699, 8757}, {7314, 1844}, {3271, 2660}, {1193, 632}, {5871, 6397}, {4997, 1054}, {2783, 2249}, {6893, 6290}, {7360, 102}, {1517, 627}, {3728, 1143}, {8739, 6919}, {9280, 5474}, {4628, 2357}, {228, 7040}, {501, 5529}, {2103, 816}, {1410, 3635}, {2532, 4676}, {9930, 1336}, {4702, 1074}, {1792, 4768}, {8121, 1924}, {332, 294}, {2014, 3097}, {6920, 8347}, {9979, 1698}, {1124, 1460}, {6289, 1525}, {2915, 7575}, {5605, 2174}, {8012, 6466}, {1183, 921}, {7881, 5492}, {3485, 3321}, {315, 5026}, {6193, 292}, {5492, 1956}, {2111, 7093}, {9995, 9861}, {9793, 7785}, {12, 9430}, {4259, 7394}, {3270, 8235}, {9558, 1799}, {3531, 460}, {6737, 322}, {2659, 7894}, {4699, 9552}, {1449, 3896}, {8499, 5173}, {396, 6550}, {1769, 198}, {6528, 4682}, {6130, 460}, {5227, 462}, {1143, 1800}, {3752, 8579}, {6214, 7897}, {9623, 4844}, {6368, 8903}, {5291, 6804}, {4505, 9788}, {458, 260}, {3388, 4934}, {6833, 4846}, {2436, 87}, {1086, 1797}, {3092, 7125}, {2628, 9746}, {5904, 2234}, {4650, 5985}, {5250, 9780}, {9164, 5137}, {6726, 4422}, {5561, 520}, {4030, 3670}, {6003, 3517}, {9966, 8589}, {6498, 636}, {97, 554}, {7217, 2598}, {9522, 6511}, {5071, 9806}, {7012, 3394}, {2384, 4573}, {3595, 3294}, {5002, 9070}, {2241, 5584}, {7704, 7891}, {6674, 7178}, {5770, 1054}, {4864, 4851}, {1795, 3449}, {6943, 116}, {8634, 639}, {9930, 8509}, {154, 7040}, {5772, 1086}, {7602, 9185}, {3224, 6686}, {3749, 9433}, {6626, 1384}, {490, 9302}, {5188, 5225}, {6477, 6470}, {7722, 6323}, {7165, 8446}, {9894, 5902}, {3324, 3383}, {4493, 8417}, {3042, 3611}, {8999, 6029}, {9498, 1661}, {8915, 1603}, {7364, 8270}, {2657, 2536}, {5777, 3673}, {3078, 8}, {9146, 5080}, {5627, 7425}, {2298, 4460}, {5071, 8675}, {1503, 9017}, {9393, 9495}, {445, 1479}, {7958, 837}, {2699, 3826}, {3961, 5356}, {3779, 7915}, {1413, 846}, {6134, 5782}, {5597, 1889}, {9750, 6650}, {2470, 8911}, {1835, 6724}, {4823, 9159}, {6015, 68}, {3007, 4122}, {5426, 5949}, {1791, 2750}, {6726, 2505}, {3916, 6447}, {3971, 9812}, {863, 1833}, {245, 2972}, {1684, 7871}, {7673, 8904}, {318, 5543}, {6260, 7149}, {2162, 3020}, {2588, 1706}, {3255, 2907}, {988, 2270}, {9372, 3622}, {4213, 2732}, {9602, 4788}, {4200, 2110}, {1310, 4719}, {5964, 7535}, {8105, 2500}, {5198, 8880}, {2048, 6247}, {9740, 7652}, {8931, 3532}, {7897, 8163}, {7546, 1375}, {6605, 2779}, {8731, 1869}, {5570, 458}, {3478, 2169}, {4984, 4294}, {778, 7288}, {3073, 1717}, {7404, 3605}, {3526, 3141}, {5623, 7086}, {2016, 6469}, {8791, 788}, {6063, 42}, {1501, 6271}, {2327, 4747}, {2158, 6952}, {8366, 6934}, {6196, 8766}, {2048, 537}, {9419, 8882}, {2699, 1465}, {6069, 90}, {6531, 2846}, {1559, 1665}, {2879, 5109}, {8458, 2757}, {9002, 7949}, {2091, 888}, {3379, 731}, {9819, 9121}, {4253, 758}, {9807, 5656}, {1312, 3355}, {5105, 7725}, {8134, 8266}, {541, 5857}, {3423, 2439}, {3573, 2907}, {7965, 9658}, {1518, 4452}, {8489, 559}, {1425, 27}, {4476, 4551}, {1130, 2435}, {7415, 8389}, {5212, 2528}, {6667, 8146}, {7084, 5134}, {7378, 6186}, {8498, 3450}, {20, 5565}, {5515, 758}, {5667, 2847}, {3977, 6921}, {6928, 6328}, {9137, 1581}, {4963, 4132}, {5452, 7456}, {3767, 6595}, {1527, 803}, {1483, 3482}, {915, 46}, {1794, 5649}, {8517, 3034}, {4308, 9060}, {3527, 1669}, {6091, 2994}, {9653, 2482}, {2087, 4577}, {7489, 3750}, {7354, 5719}, {4320, 332}, {7101, 3522}, {5531, 8162}, {5449, 9074}, {2831, 7322}, {5615, 8154}, {1821, 6090}, {6865, 3666}, {3194, 9916}, {1878, 7672}, {3456, 1615}, {7354, 8810}, {9820, 8548}, {9291, 2685}, {1166, 9665}, {5229, 5466}, {9324, 898}, {7015, 6267}, {3647, 9987}, {4612, 3779}, {5444, 5015}, {7812, 2419}, {5580, 6212}, {2024, 4262}, {7708, 4629}, {7529, 6246}, {9742, 3719}, {1345, 3956}, {2574, 572}, {7296, 5764}, {7535, 7323}, {4569, 4718}, {6804, 8445}, {9074, 5503}, {5030, 2626}, {5800, 4022}, {7268, 2570}, {8520, 87}, {8239, 1933}, {4823, 5979}, {2282, 3636}, {6428, 334}, {5712, 1325}, {9392, 8608}, {3197, 2394}, {69, 6421}, {2116, 1683}, {1628, 1621}, {8392, 2191}, {4557, 2476}, {6947, 7855}, {8483, 5211}, {7858, 8404}, {8429, 3125}, {2278, 3780}, {4415, 1443}, {8132, 4409}, {1631, 8065}, {3446, 1025}, {5720, 6030}, {4041, 3455}, {6554, 8496}, {1053, 2889}, {2056, 3502}, {104, 9720}, {4216, 4404}, {1923, 1595}, {3607, 450}, {107, 1444}, {8131, 9533}, {3953, 5001}, {7999, 1197}, {6747, 9860}, {4498, 9086}, {769, 6084}, {184, 2831}, {9984, 6442}, {735, 8677}, {9626, 4269}, {3132, 9705}, {3541, 2726}, {9620, 694}, {4040, 9332}, {339, 4012}, {8689, 9722}, {4392, 7520}, {849, 3020}, {215, 9738}, {701, 6102}, {4230, 229}, {2927, 8437}, {5152, 578}, {2100, 1291}, {9621, 4853}, {2124, 2991}, {3960, 5623}, {5837, 59}, {2559, 1426}, {9248, 9085}, {9031, 3224}, {1794, 9062}, {2446, 7485}, {4981, 5662}, {7495, 9944}, {4780, 5726}, {6185, 7062}, {1138, 1380}, {8560, 2631}, {5092, 4931}, {6891, 3631}, {4882, 8416}, {5612, 8966}, {658, 694}, {219, 3353}, {9021, 787}, {3172, 2423}, {6257, 3369}, {2980, 9236}, {5677, 9566}, {783, 8937}, {2776, 9980}, {1917, 850}, {4058, 833}, {617, 2159}, {1552, 8832}, {273, 3203}, {3517, 1183}, {5305, 2792}, {5092, 7799}, {2760, 7785}, {8591, 8919}, {5384, 6103}, {4507, 6209}, {874, 133}, {41, 396}, {624, 2028}, {991, 9392}, {2658, 2472}, {8837, 5917}, {3802, 1064}, {9337, 3044}, {5383, 7682}, {219, 7436}, {7022, 3740}, {3841, 4319}, {9924, 2068}, {9300, 5354}, {6357, 6890}, {3138, 6720}, {8337, 4385}, {634, 2952}, {6281, 9985}, {8483, 3579}, {8774, 3368}, {5765, 3143}, {7331, 4164}, {7662, 4750}, {3054, 7082}, {1470, 9351}, {6843, 387}, {5099, 7932}, {5169, 4010}, {6638, 5691}, {6299, 7519}, {9381, 38}, {183, 183}, {2223, 4947}, {7803, 6025}, {6851, 876}, {5067, 3842}, {9241, 1103}, {9412, 3986}, {5055, 2351}, {9301, 2109}, {405, 6305}, {3216, 3036}, {5329, 9696}, {6926, 8025}, {4428, 9866}, {952, 1974}, {2724, 9889}, {959, 7191}, {3992, 3275}, {2244, 6675}, {815, 6035}, {16, 6919}, {4401, 3365}, {8926, 6899}, {5276, 4517}, {3404, 3003}, {5648, 1545}, {8846, 5655}, {9028, 379}, {5371, 707}, {1167, 3576}, {5710, 7696}, {8879, 451}, {6646, 337}, {1350, 5554}, {5382, 6383}, {8887, 4528}, {1846, 4966}, {46, 2026}, {2464, 9477}, {5333, 9602}, {1332, 4930}, {1616, 463}, {9284, 7764}, {162, 8539}, {4296, 7591}, {629, 8804}, {604, 2043}, {919, 8459}, {637, 6310}, {3895, 8504}, {2048, 77}, {6028, 4756}, {1051, 5487}, {590, 2845}, {7178, 906}, {5243, 1110}, {1979, 5140}, {2548, 5732}, {2178, 9011}, {1869, 6098}, {918, 8517}, {2608, 702}, {3938, 4026}, {4683, 7977}, {4965, 7828}, {3773, 2779}, {6850, 9742}, {621, 3646}, {3169, 2434}, {1763, 7086}, {3020, 9153}, {3821, 287}, {7427, 7888}, {7052, 5063}, {649, 2613}, {420, 8495}, {388, 5406}, {5199, 4438}, {1425, 2058}, {4699, 2030}, {6477, 2221}, {8567, 477}, {8493, 7969}, {4762, 3262}, {3399, 432}, {2780, 1053}, {3351, 3835}, {5547, 7071}, {9243, 5430}, {728, 1159}, {855, 9305}, {3735, 8594}}, + [][]int{{930, 7824}, {1683, 1180}, {1207, 76}, {2087, 3113}, {6101, 8065}, {2438, 6525}, {7984, 5702}, {6964, 9156}, {5661, 1016}, {7498, 8283}, {4154, 166}, {6950, 8261}, {8276, 3574}, {5640, 9831}, {8302, 6271}, {8007, 8268}, {8289, 9069}, {9658, 6081}, {5238, 5905}, {288, 5178}, {8622, 3550}, {2584, 4508}, {9643, 5997}, {4825, 3137}, {5924, 6938}, {2188, 1015}, {501, 3236}, {1517, 1681}, {4924, 1777}, {6525, 388}, {6109, 6984}, {9523, 3291}, {9727, 4373}, {4454, 3268}, {8701, 824}, {7493, 1089}, {1863, 9558}, {3023, 8776}, {9662, 1127}, {5499, 7891}, {3899, 9958}, {3682, 4497}, {9368, 6229}, {6288, 483}, {4293, 934}, {3446, 608}, {1941, 5986}, {2283, 2561}, {1902, 7062}, {1446, 5637}, {3885, 3937}, {1206, 7103}, {576, 7416}, {42, 771}, {2442, 7651}, {6121, 6461}, {5906, 7773}, {1100, 2985}, {3188, 8679}, {3855, 7500}, {5438, 1253}, {7380, 3930}, {9605, 9087}, {5855, 9837}, {3054, 5330}, {4011, 1541}, {8853, 5869}, {5763, 1491}, {8281, 7828}, {7386, 6460}, {9085, 753}, {6532, 8956}, {6345, 9982}, {2586, 3280}, {7320, 7052}, {7402, 1803}, {5768, 2799}, {4965, 8690}, {348, 1583}, {6720, 720}, {2701, 216}, {9667, 4659}, {853, 5627}, {4797, 4749}, {6610, 3195}, {5437, 7987}, {9754, 5441}, {2059, 5058}, {1057, 7945}, {6445, 6773}, {2740, 7938}, {9250, 2144}, {9697, 8578}, {4043, 4312}, {4941, 7168}, {3597, 7017}, {6589, 712}, {8112, 2751}, {3165, 6811}, {3539, 3021}, {3580, 4684}, {1733, 3097}, {862, 3668}, {5070, 941}, {2905, 398}, {8052, 2088}, {8440, 8300}, {38, 5643}, {4059, 1376}, {4933, 8701}, {4773, 6772}, {4678, 1912}, {9037, 2739}, {1, 4649}, {7613, 3725}, {3125, 9187}, {1510, 1527}, {1026, 1149}, {7242, 9912}, {4205, 6448}, {3041, 3902}, {8239, 698}, {2005, 1687}, {5830, 7357}, {7493, 1896}, {4435, 4240}, {6694, 1578}, {6411, 5741}, {2413, 2967}, {1398, 1378}, {8278, 9394}, {2947, 1632}, {9937, 604}, {1682, 8703}, {7519, 2032}, {1800, 5176}, {3177, 7864}, {2031, 6153}, {5066, 9653}, {5219, 933}, {4848, 6475}, {6230, 785}, {6895, 7218}, {4444, 424}, {3453, 4758}, {192, 5480}, {4711, 8264}, {318, 6739}, {267, 6316}, {9591, 2495}, {668, 2169}, {64, 6726}, {2866, 2636}, {194, 6215}, {2471, 1013}, {8924, 5139}, {2314, 2055}, {9117, 9985}, {3248, 9948}, {9898, 9626}}, + []int{0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_gridIllumination(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, gridIllumination(tc.N, tc.lamps, tc.queries), "输入:%v", tc) + } +} + +func Benchmark_gridIllumination(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + gridIllumination(tc.N, tc.lamps, tc.queries) + } + } +} diff --git a/Algorithms/1002.find-common-characters/README.md b/Algorithms/1002.find-common-characters/README.md new file mode 100755 index 000000000..7869886c5 --- /dev/null +++ b/Algorithms/1002.find-common-characters/README.md @@ -0,0 +1,25 @@ +# [1002. Find Common Characters](https://leetcode.com/problems/find-common-characters/) + +Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including duplicates). For example, if a character occurs 3 times in all strings but not 4 times, you need to include that character three times in the final answer. + +You may return the answer in any order. + +Example 1: + +```text +Input: ["bella","label","roller"] +Output: ["e","l","l"] +``` + +Example 2: + +```text +Input: ["cool","lock","cook"] +Output: ["c","o"] +``` + +Note: + +- 1 <= A.length <= 100 +- 1 <= A[i].length <= 100 +- A[i][j] is a lowercase letter \ No newline at end of file diff --git a/Algorithms/1002.find-common-characters/find-common-characters.go b/Algorithms/1002.find-common-characters/find-common-characters.go new file mode 100755 index 000000000..b228ccf27 --- /dev/null +++ b/Algorithms/1002.find-common-characters/find-common-characters.go @@ -0,0 +1,26 @@ +package problem1002 + +import "strings" + +func commonChars(A []string) []string { + res := make([]string, 0, 128) + for i := 'a'; i <= 'z'; i++ { + sub := string(i) + count := strings.Count(A[0], sub) + for j := 1; j < len(A) && count > 0; j++ { + count = min(count, strings.Count(A[j], sub)) + } + for count > 0 { + res = append(res, sub) + count-- + } + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1002.find-common-characters/find-common-characters_test.go b/Algorithms/1002.find-common-characters/find-common-characters_test.go new file mode 100755 index 000000000..56f8e38de --- /dev/null +++ b/Algorithms/1002.find-common-characters/find-common-characters_test.go @@ -0,0 +1,50 @@ +package problem1002 + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []string + ans []string +}{ + + { + []string{"cxizlxaeicvxwiaqebzdzjfqmtjtrbnrehrisntpsmsntpsndsvjthgnubvekkxqwzknqqrcutenoeseqakkldnktsqpbhkklazy", "zohpatikncppgxcjpzazcwjaqbhuaokxabfvfrrbyvgjimfujzvsebjbvegwgapdixvzblrkqpzrdbtxlpultojuhwzqetvplpdf", "vutkluptjbjaahtaweadgtcvasaujlwgqrufojtakworsxlzlkkatwrnqxmtfbcmfjbbnpyitirnnvtmtlqxfzalycigeeeqtaqu", "intoasbpbflhukiroofoqzpeksolynoytjfbcmeoeamxxbnlfgdwjwpenhufllcrnjrxttbevqdxqmxyvvguuliqfvbdalpkbawy", "zizxutlyzcwwklwndwmgnquzfwaodungcpkhudujtfgcfpgsaatsflcxafskssjxhjhwexxgiwefozusudcxuwkroogopgcsjzgl", "lyesyttpoqgrplyxzpqqajqqafygvyuzkxwggpmpuvrlkgdzowyhhxjopcxtanieccgwzursvnvguwikgyszbybqthewgouzerpz", "msfudeekbpluzevvypmamrqhrdmjqclqsteprmpszzoigjuzrcofmtrasaokotykharcpddjufoufzoifrqlfpsfdemnptjxlaxv", "qcarngpdtsuakowbmkgnwmfjmjwmxkxeqpxyhcjnsrskuequgqlwppwwcgisepfnbxirpgynyymdqbzrbvmwupsvzdmylccylxkm", "opwvbicxbdcovfrlhxmqhytujlknkxazqooghibtajaojhssbbajzcqlyacbespfluawhygjwkfowcueylpogablbmmuhdkewhpv", "fuutvjfdwhhndlxuqxulutzepevejifzvkudvqqvkxhpkfixtrgugzyminanprvguibaocheuxqxhvxibyqjsomjdvnvxezmsorp", "myhbmytkraqvtvgygpmscwcqqtkzbhyyggprhovjpjyqijdrgunyxymksocskvurczbsmdelbusuqdpofskzamhklmhrrgdjqtge", "ynwjqmhdsstcahzioqwnlftajrnbhdembeitsczfqoztjhfaxkpojhawgtsokgzzjfyonkcsisvxqodducsnhgkclvgnyrbbfkuy", "qgigwnrfatzcrnrhvnczfnlcjratbkbcvnegnodqqbyuzghsbmieamvwqqlrkidicnmkjrlohjtrgkbitnpxzwsxqzbdidzaveyx", "bmfvderczfvirbashmriyzfrkwceebvwhpyjnlahoyzcuitkcezpnavgloycjxjaqrasckgfkwakplyyjkbzcdbhbrehwpjihngy", "ykcazotwzfalckzeyjxujrkvukxsjuxgilopctogqmrnvzhpsnseadhifhhjloawubvmiqvyzmynrvisnyjupjwgfzdhctrgmiov", "pukyolrguitgcnzddpwwpqxemttsujduonbjovqngzpbaifivisqojqztcyblerocqottjayafypdzzyvymlkrdihcvjqpawouiy", "ejuejeqynodrspsndrmpjkcixvjxogoprzjgyxnsctcovaubwbkqaajtfjvcmrnrkcmvspvnwesitvvnimezjcgyrjimcwnetmll", "xujtbtnnacezhqbzrpelbgbsnmwvuamfbvxxjjkcynsojrhlebzeptnloqgyxlfdnqcdwxfxazaxcmxkcrneiqheycgvsbgltvid", "qldmyynkbixpfjsdvlgfngzrhdijjxeehzebaquekjfpxofxvugnftclfcczvoqigfkievyvormswqpwvqbnobvhqjadiavgdqzw", "bncxmbpwuywvnaeecphfwvbpuvvknxkzsfeykeaejdrcitwtioyenzxjfsiagbsunnokmjclaffcoozgayuhjiypcmeijghndzjn", "rerjcjeqjvdyzzyybnbwzheozqrvjbjegzfvgwuepexsaimjtfcghoaxdsdlltahlkzneuevgnackjoohginvpqcbjxbexbqfgyc", "vgsskznernyntiwofhoqkntgeclhhgoyihgeeodumqnwxwrhqmgnhlubftwjwoijfymfwugxqsxwsytjctuqcxcxuhlzcllhyfri", "lgzsgpurzxthlzehntsvkycdavippybpnkbxjpkzdlkyxffllbydeziobquhotpbshtsoeuyoutytdyduoadxeancbnysuxzorad", "zjfekgidfvzzbhzoksizpcylqigaacvgqcgmzntxzrtmbucnmmrgbkbexuunvyqqnbrgnottufxpylvkbmqdocstubrfgwuqkdcn", "trlgbgboeszlfgadqoxwpjtkwpcrnticpxgdgyxmibjdhzrvkqzajqjhozzkiqffnwcqyuexdselwfumyyvvamiizwvztgimzgbp", "mlimwoskddyxunxgssfjgfcdrzbswtiyqdyamnikfhfdvfbhnltkgatdttxprfgafnufaqpzbdgmbnogesvuysqseuckbqcmpzdl", "nvlxantvgwrtmzzvutdjvsfftnjthfferdhejcfmhvvhunxzsijvyfigonnfrdzflvbsxnftjfxfczxoayrkouwycwvmhsfhfmyt", "oijzdasbaiylwkvqqmbklzbmajydkpwaglivwqqhvljvjxglkslutxjrivdgpazioaiaoobikvxlfjmizipgkhvughuoxowykuqr", "epyfwunrkauzbbsvuaoflozsaavyjkcuusjndiyqeatigykkbvoihfpuljqdjckemlslgdfkvmydateenrvzhavtsjrqobvvyaqo", "xxkfwqdzwffllyqczpnkulqzuokoogssiqyzaxehyomsgvaxzqnzflzwzzavnmibtzddwrlnuzljtojecrbbjucgyijjyinwozrj", "ywpjlyfbwsiognlmkszyzpxcglnlacldfjcuziemxtdeepbwewwlxfqquomlsfieomdmsiqavuqrftydpomufvewlbqvlojdmgfg", "xkceantgnjkiybxcvplnpxwimnprwbtwasjquwmqkrakctprjmnfdpsqjlwxuzwykuchddgsdlccgyqpolckeecgfvejderxtngo", "lvutlzkxcevzpqszqgdayhnyllkgrvbimougbdmgbqdzwtrddgxkwqczegfnkigphwghsosruryztixvqgrxoziiubxwoehtqoun", "pzorupuimoaxlyfrwweufewwucosqnrirupklqjekyktreaxgaxaqgncmwwkgwprybafuwtsagjyrawbpqeqztzdrmcpzhxcomjh", "eyzcwioqzvcmtxvtxxulcnxwewewbpgjyzpgcouplsctjipuwiutxhdtczetfxnnkifkvwhiamxjjppaubbwxvqrmpymzvgoevlg", "uasbblgcquaqcormaeupxgykzrjypwccgwbypsvxlnswbnwlixvjlzkirnlzzibkicrtlupwtoebxcemwvjkidvmlivouxiynnal", "nasxfhzdreqnspwuourravhdbjchfulzvgquccvevbodabeievzgvzegubfipdeoaffrgnyjdzshvtiotmjieezilwwkqhqlivts", "dimmqymdjhbsfkegyxfmejnczmfnmrajcxfuqymxexhmynyrxkjgpbdwmwdsckzcjymoasudsksobvebaefjngzvzqkplpoehfjh", "sejxqwviqhlkbartmgwsvuwruemjqpaepilbyaerwjziyecmmmeothvosfvxcyiecjxkdxfqfnmmzahndoduzhutzuhfpuszcuhv", "irhbaqsjmsjbwvnxhtqgocwhqqktfiquoveymoqlrussuizzmwipoudtlnrajonjmcmoqmvyqwbeznrqwrxkphozzplmnnwbygio", "nrvzlftzhwwfeckjtoknipjpokzwnbacdauzfnvebpapoqpyseaeyzicfsaljevtkwgivtxfjrrmocsmvimctfvrboawndjjgumy", "droxndceqfcpkqgmkrdeewtdxxmsgimnzsrzojkqwhavlzvpvmrtlttxhrtehcapcncxvfgxkpatabowpigzldstfbsiqwezvbww", "uapczwtmobvrzurhsxkodzgouxoeffgerxtxkvyaghvtzqzshqgmrrtwxkfxsisdhonyvmescqxqiltaumknxycdkzdijwkaaotg", "ijmsesoptcjvpducnyahcxsojqkrzjbcqwzzxfgacynhxknvkaosrnolagfiutvrwaqsxmrbofmduxrxxnxmxlaccxqzlbvrxjra", "veksvbkqchdgnkneqdlslicomlnnceijpsmgtaehnzsvghfabvdiwzjgdecjxsdcestuemlobekumtaxssdgzftxvjjrnhhdyfzj", "xtotdktrxgnvmqzxchalgdywlysribmxxjhgznotfjgtrxhilkrlsdofswlyflfzgxerykdgqdmxkyxjlopolafuznutdbzygzlx", "eiehlrjgmquyephjgqlmpvnxzbownzdazsyspurryzqribvlzyjigcszsuhxgtyycfwlakzaixmqorrzejooqkmrdggmkghbkesj", "ktataiirpttwjzyypfjsquylawvjnjtqpveynzftkxohlcwtprhvpohmrhhnhnjyjsgkgouiigliduyioqkaaavnyxpkabqehelc", "gacnwampmavvepmrnztqvmggpxcnbcioicwtqgalidjuqmzvobyrrnskhhccftqqxgakgwcsonkbasmpsyvixreqjyrjknwlxbdw", "mbvxwmfrudiujaxqnkvjwwexnphttfowstanntyfzgpztcqzzhxqhkvvqipbtqsbmjgjthyqnsbxnipvhpztlncvuevhkpbpwkxo", "udajfrqvjszwaqgzbblnuooxmvbtejsnhlllqajbjrgzzxooefazffzujkymnugfzxyaolprcksntajgvcbcycqzhqvvozvdoelh", "okqaorpeduegmjdalsmoybbdgnleozmvfvtnvzipghruarrzqqejzuzdflkjoewpzarevfrxhjoougnlccnztocotinvmebuwmtf", "dxrojfhlemlupcyjguhymianoxilfxgcxbfdqixvmgqeabpagmfgemhbeppewoowsljutsptrcvvtzaeyqffwbsoipwebjhssigj", "wssourljhoocgyrujbjgawbapexglevdtqkgdokwphlzyteycpzswblmxvxpwlkcjuiwgkppgbioyqngqjnasbofhbyrfxszhqdr", "hhvpfphtxnyiemyhynlwyyyjgtfsrljoglclidyxvvtrssqafossxmobcnvztpafkpuaruwzlsciirrdapmllqifqhyhaimsjrbz", "vjkpztaauscdovjvkyborqlaxcyjzsmgfourpyyyhtapxfxhbyyudjpdwtuwnlkfinmwghqwtvazsdkbzlzaamshyaubektppojw", "fjyxxtkawexosprbayitlqzyjisrdzueijomhbhlizxlnfkpapjpdyzpqemepwescbnfgghulgraenudwysqhsucjlqgujdcjjyr", "nsnwrrgffjtpjqufcuhndbukfpmelifvuasyyroamcjzrtvkzomxbkwlsrvmnzedhrwwgvvntxmmvzagugdzogrlxymtkdjzuhdq", "wcwvstsjugpaxdrlrqdctufwijfjstnwfdfgcixsvxynwrzxyojqwrmmgqqgrwumcfxgzifgdlrqdwoltdtfoyyalzlnyziblpek", "qgjnrxxigdlryhbknxmaqexsjabtrofromjudzyubsyxjcifjjyqchgomlgcpxwvxxdrrpcfbuuijxdwukwumdvunbnlkmobxcsc", "mueqpapmemzbrklixyhmubxhdxhzzhbakytecctcqahmruljqsleaedvqyybrkxmshliywgxlfuhxpbjmcwpoqrhbkrdlxuphncf", "djbzfihlhqeswuegjyxxthddepzqflfnhkyckjenevfcbxagwvxqplmajqctayqlbdnlgbptmaosepfbdcxkptkaxnntnxzqozxv", "jtvuxxetpjvdncairjsvzphhblrxvpvficztkgphkspptvzdhrqphhydgcnysuwzkxalsucwmfsqxbkgkxaxkajesiyywgecsxai", "cdpbumrfxufyzpxdhfkuogbgtuwoqwmxffomzkvfuicdahjvirwqkrnseiltuetvtbxkwmprbziietgrvbzwmgxxmsjrbvmyulks", "cyyktczgcgjxekttrkmigjqrawlnlpudzavedpsketuoerledqftnkrkralkpxtzvgetimtztwpqrwvwfsriwlemljgqqagokrus", "vlkzbmcrdvbrutlbtvntvdplgsdnxhjskvnptsjdepnuiivpefjnjhprqjssgsoemeiwuqrggchgkjabcqxrqaqohkruhbjnfcvt", "uaqbfmjjrnqfvvfsuybubxkkjgxacwnjbrwmnpcbbnlriyaqcfeekdosmaohfmplrltoxflmhnsmuatdvxwyzrwlszlvwxzgvvxg", "hkvdhjzwhykxsnqdlrhgfojcpwlughuqbpsznsgffzuergznmpdksgycrqmnruihbbavuosjvnwxxpmnautiudmgalztxoczqoka", "kpkbaedgiyzaroyxsfakegglmwgfxoreoaycxvjtjnzkdidjglzhlnzsgfoemkcdpkcuigafemvuvfjcdtqpfpkyjuneilabthcx", "ebycypouydpptxjsggahkbvnchwlegdfdclkremybnomyfjnnzjvwrgpxdymtwxhuvgajquqgfqcpdbrmfwwjpvxgrxcabewwqjn", "xnhqueqqpvsayorjsgudtghmdfgycbuakukmdequrezaqtuojmicaxcpfkfxsoctgrbziicpenckxitdsxevmgzctgsdhkbxjsfb", "podtoqisfeuuydukdjrhzjiafupdibkcbgrkzfafilrlwwvchfwksqyrwizakxxmquwjboqqkprdxwblzzgsrqviyeaxvckuqmxx", "jegfkvmxouyukzdpwnxdaovvfavxdmgfaotqbijxdwkyxzqjpggtwhiguefekcgqrzlyofodjoittschlurcdamlgjwwsvlhicfx", "omhmmohcfdmzkaahbmwwnmuclhvfnjsfozxcndelgyibfljbxldpjuprpsmjzfrcrdmeaqlnahcphjvionmidxuzwjziggsrymuq", "urtoodmqotufmyrgkvvlplcpqrmgjqtwnsxubzxzcdyrfurhlzhvycgoivncoteplodztiugoncputkbelracwgwqsmzumtnqazx", "zmjlpylrliiwbihsjsanaazofhsjagkunaanexpnrkxvwnmfneaficratlgvgmojwzonpczjbybynmiqsklagfyksrxveetmokxt", "saeqogjrdooixctqlgalayioezshxoxmzwuzgsbnkktlogfvvsajuwoepqvlpjwqcbgnsmmlbusgirlzzbngiiagzvwgxlureiyh", "bteycsnlukwjaxqgwxlqrcyxueykznnxjzpkpeafuoorjrymrqevfaqfczpabmolgamoegiprphpnuyswvmreruyacmqipwulphn", "jaboldifpcohlpigojohzlrokaqkjpawhylpzktmwsqqylfddjcobbhiudsuermrbfklqowvqshwgrhqqutovxdqujaxrapmgcvn", "guugpqwaktbjuowrwqprgmhlgmiqxifbjvjyfvhtmpydasmgitzzzcgnctyckzsohlwmfyopsdemdblrkhkjhubmqpcnqatijgdv", "ugvhvmurdhblohmvjxbdxemzqrwxekbbogjsfebjucoxxqmlzusvihpxuettmhjraroyklrxsjtwacwrfgxfvetcxribrshtbrzr", "luxgfrjcsqmurdlzkactiqvmximtiskkwzydehsthhyplbnhrcccczayczwolxszolqgouaftebwpapxukeqcyjokvvzlwpfnjlu", "izskskqbrrmvomzrcjezunmzchljddiqqznhqlgeycpzpdzkgwlqplewpqyfskitalevfsuyytdkvgfqzqgoxsbsleitmwpofwax", "wvkmmniagtilhzxyjdiygqbzanjqrhfxmmkzhdtkfebexdusgjszwamcvxyveansmqpnfmydczzpmxtlxkbpljcjxrtrrftiepsg", "oruykgciordgafzgnecforlmsffpvqwhciawolaxwqyxuhgrkzkkyacxxrcwtquaewnwssroctfbkuigrlutetjjejkbgnphtiwt", "uwympkgqzyevazokvbykabpmgfandumwsmqfiovjwougsglifctzeifnvgiikuereayvvilzrcwphkhhfxcxhnmuukwqrilpicxg", "iibipamzyznjhicfdibpdnbxynsazmtgszimvmnlkzeidzzjynoojcuuyfljdwsnjupoujuhwbprllxciruyijvxxhpzscgormur", "wcvtavkujkgsjvxqnmvoiocyxqcmvargirtngaeubransrjzynzqywtudugdwyeupnraptwjjffyonrqeuxeqgyreqhelkhvxebt", "cnqzxqrnztogafefllnooldvzdsuvqfgwwpouvgqcmmlxbksqgjddsouzupaxhafjogryatvnsrmgtlwgchdogdoupsbsbglhdzd", "ufnneunxpecjduyiwdzjrwirtgffhrwjiehhjblrcevtpvjxzpkrkprbxgcnvvqbayyrjvudrtgdhpugljpdbziqczwtrnuxlaht", "ljtbzjgnemfjdkrtzmtbypymrpwckgksaxvhivsylevfoznwnwbrjfknrrxgqfxvewhqxoiexlzgdcpanxfzupztzemkbezpjbpo", "cxirqwcyzjdjqqgotntbxyobemvskwwpfchskzuewaolcambienmubdanhkuxcgenkypzrdlxfsohmwnoynbehgcxztrnxrmfhst", "tihyhgzhskgzfhxatpronphslvsyhpcttwqqgdydcbzsmeoujlbhcnclaohphekvwuhqfquxpcktxqlxpfhfehksocgvfvxcwery", "btpuhxgofircivkkjqzdjxreazftdtnyylobbbxgswskewxyycnsivjdrwijzkzhpyucdfikwqshookugwrcedzafxheuhpichut", "tvqttikfjrbskmwjqtbyavmovyzeeagtjxxhklquyfruwurbsifvvywusfqiblokjpqbeqmawilxgmvhmmimyfrqfhomcbjsxvgd", "rgzrgbihpdckrqarsylkklmnevpgqhitnzyaigntuijzkxtncqhksmunyjrzmlwmldlhfthajvklatvlcgfoewzlrufmuipnzihm", "rewrgpzcfycoclwwzctcubmibztupbgbdsqpvgidgpyzsrplrzsftreapamshhchojthagpgyefgmnlmcactiapvnhnqhytmznvr", "smlywmmixzagjnyjyftddnajcwtxzsgzciqyzoojkutsagnmmwxfdbhqhyzvdufhfbpeqjvdakshjblgjdahpotznhuessuiklae", "vqwxiktrzpllggpfhyzxpvsadeteueapiixzmorruxheofxuzexbktrzyuehqwflufvwqisffnotrirxbcpaconyfdaykglfxavp", "airidyzwwudqytasdzwiexpiyzgnhgclzlyojxrzptucbkfksarxkcvqlhxurlzkjbarurxolakwihgspsiggyyvgiuhphkzezaw"}, + []string{"g", "z"}, + }, + + { + []string{"bella", "label", "roller"}, + []string{"e", "l", "l"}, + }, + + { + []string{"cool", "lock", "cook"}, + []string{"c", "o"}, + }, + + // 可以有多个 testcase +} + +func Test_commonChars(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := commonChars(tc.A) + sort.Strings(ans) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_commonChars(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + commonChars(tc.A) + } + } +} diff --git a/Algorithms/1003.check-if-word-is-valid-after-substitutions/README.md b/Algorithms/1003.check-if-word-is-valid-after-substitutions/README.md new file mode 100755 index 000000000..d1f4002a1 --- /dev/null +++ b/Algorithms/1003.check-if-word-is-valid-after-substitutions/README.md @@ -0,0 +1,48 @@ +# [1003. Check If Word Is Valid After Substitutions](https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/) + +We are given that the string "abc" is valid. + +From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated with Y) is equal to V. (X or Y may be empty.) Then, X + "abc" + Y is also valid. + +If for example S = "abc", then examples of valid strings are: "abc", "aabcbc", "abcabc", "abcabcababcc". Examples of invalid strings are: "abccba", "ab", "cababc", "bac". + +Return true if and only if the given string S is valid. + +Example 1: + +```text +Input: "aabcbc" +Output: true +Explanation: +We start with the valid string "abc". +Then we can insert another "abc" between "a" and "bc", resulting in "a" + "abc" + "bc" which is "aabcbc". +``` + +Example 2: + +```text +Input: "abcabcababcc" +Output: true +Explanation: +"abcabcabc" is valid after consecutive insertings of "abc". +Then we can insert "abc" before the last letter, resulting in "abcabcab" + "abc" + "c" which is "abcabcababcc". +``` + +Example 3: + +```text +Input: "abccba" +Output: false +``` + +Example 4: + +```text +Input: "cababc" +Output: false +``` + +Note: + +- 1 <= S.length <= 20000 +- S[i] is 'a', 'b', or 'c' diff --git a/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions.go b/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions.go new file mode 100755 index 000000000..8f27a8410 --- /dev/null +++ b/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions.go @@ -0,0 +1,27 @@ +package problem1003 + +func isValid(S string) bool { + bs := []byte(S) + stack := make([]byte, len(S)) + top := -1 + + for _, b := range bs { + top++ + stack[top] = b + switch top { + case 0: + if b != 'a' { + return false + } + case 1: + default: + if b == 'c' && + stack[top-1] == 'b' && + stack[top-2] == 'a' { + top -= 3 + } + } + } + + return top == -1 +} diff --git a/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions_test.go b/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions_test.go new file mode 100755 index 000000000..a15b3bf71 --- /dev/null +++ b/Algorithms/1003.check-if-word-is-valid-after-substitutions/check-if-word-is-valid-after-substitutions_test.go @@ -0,0 +1,57 @@ +package problem1003 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans bool +}{ + + { + "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", + true, + }, + + { + "aabcbc", + true, + }, + + { + "abcabcababcc", + true, + }, + + { + "abccba", + false, + }, + + { + "cababc", + false, + }, + + // 可以有多个 testcase +} + +func Test_isValid(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isValid(tc.S), "输入:%v", tc) + } +} + +func Benchmark_isValid(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isValid(tc.S) + } + } +} diff --git a/Algorithms/1004.max-consecutive-ones-iii/README.md b/Algorithms/1004.max-consecutive-ones-iii/README.md new file mode 100755 index 000000000..25a72f9c3 --- /dev/null +++ b/Algorithms/1004.max-consecutive-ones-iii/README.md @@ -0,0 +1,31 @@ +# [1004. Max Consecutive Ones III](https://leetcode.com/problems/max-consecutive-ones-iii/) + +Given an array A of 0s and 1s, we may change up to K values from 0 to 1. + +Return the length of the longest (contiguous) subarray that contains only 1s. + +Example 1: + +```text +Input: A = [1,1,1,0,0,0,1,1,1,1,0], K = 2 +Output: 6 +Explanation: +[1,1,1,0,0,1,1,1,1,1,1] +Bolded numbers were flipped from 0 to 1. The longest subarray is underlined. +``` + +Example 2: + +```text +Input: A = [0,0,1,1,0,0,1,1,1,0,1,1,0,0,0,1,1,1,1], K = 3 +Output: 10 +Explanation: +[0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1] +Bolded numbers were flipped from 0 to 1. The longest subarray is underlined. +``` + +Note: + +- 1 <= A.length <= 20000 +- 0 <= K <= A.length +- A[i] is 0 or 1 diff --git a/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii.go b/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii.go new file mode 100755 index 000000000..932cebcdd --- /dev/null +++ b/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii.go @@ -0,0 +1,16 @@ +package problem1004 + +// ref: https://leetcode.com/problems/max-consecutive-ones-iii/discuss/247564/JavaC%2B%2BPython-Sliding-Window +func longestOnes(A []int, K int) int { + left, right := 0, 0 + for right = range A { + K -= 1 ^ A[right] // 每次遇到 0 就会消耗一次 K + if K < 0 { // K 不够用的时候,就从左边回血 + K += 1 ^ A[left] + left++ + } + } + // A[left:right+1] 并不是真的 max-length-sliding-windows + // 把 right-left+1 当作是 A[:right+1] 中出现过的最长子数组的长度,更合适 + return right - left + 1 +} diff --git a/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii_test.go b/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii_test.go new file mode 100755 index 000000000..9421f306f --- /dev/null +++ b/Algorithms/1004.max-consecutive-ones-iii/max-consecutive-ones-iii_test.go @@ -0,0 +1,63 @@ +package problem1004 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{1, 1, 0, 0, 1, 1, 0, 0}, + 2, + 6, + }, + + { + []int{0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1}, + 3, + 10, + }, + + { + []int{1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1}, + 8, + 25, + }, + + { + []int{1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0}, + 100, + 11, + }, + + { + []int{1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0}, + 2, + 6, + }, + + // 可以有多个 testcase +} + +func Test_longestOnes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestOnes(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_longestOnes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestOnes(tc.A, tc.K) + } + } +} diff --git a/Algorithms/1005.maximize-sum-of-array-after-k-negations/README.md b/Algorithms/1005.maximize-sum-of-array-after-k-negations/README.md new file mode 100755 index 000000000..0404d95a0 --- /dev/null +++ b/Algorithms/1005.maximize-sum-of-array-after-k-negations/README.md @@ -0,0 +1,35 @@ +# [1005. Maximize Sum Of Array After K Negations](https://leetcode.com/problems/maximize-sum-of-array-after-k-negations/) + +Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i] with -A[i], and we repeat this process K times in total. (We may choose the same index i multiple times.) + +Return the largest possible sum of the array after modifying it in this way. + +Example 1: + +```text +Input: A = [4,2,3], K = 1 +Output: 5 +Explanation: Choose indices (1,) and A becomes [4,-2,3]. +``` + +Example 2: + +```text +Input: A = [3,-1,0,2], K = 3 +Output: 6 +Explanation: Choose indices (1, 2, 2) and A becomes [3,1,0,2]. +``` + +Example 3: + +```text +Input: A = [2,-3,-1,5,-4], K = 2 +Output: 13 +Explanation: Choose indices (1, 4) and A becomes [2,3,-1,5,4]. +``` + +Note: + +- 1 <= A.length <= 10000 +- 1 <= K <= 10000 +- -100 <= A[i] <= 100 \ No newline at end of file diff --git a/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations.go b/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations.go new file mode 100755 index 000000000..2b1a872e4 --- /dev/null +++ b/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations.go @@ -0,0 +1,57 @@ +package problem1005 + +import "sort" + +func largestSumAfterKNegations(A []int, K int) int { + size := len(A) + + i, j := 0, size-1 + minAbs := abs(A[0]) + for i <= j { + minAbs = min(minAbs, abs(A[i])) + if A[i] >= 0 { // move non-negative to right side + A[i], A[j] = A[j], A[i] + j-- + continue + } + i++ + } + + negatives := A[:j+1] + negSize := j + 1 + + sum := 0 + if K >= negSize { // all negative could convert to positive + if (K-negSize)&1 == 1 { // someone need keep as negative + sum -= minAbs * 2 // choose minAbs keep as negative + } + } else { + sort.Ints(negatives) + // min K negative could convert to positive + // sort make min K negative in negatives[:K] + } + + index := min(K, negSize) + for i := 0; i < index; i++ { + sum -= A[i] + } + for i := index; i < size; i++ { + sum += A[i] + } + + return sum +} + +func abs(a int) int { + if a < 0 { + return -a + } + return a +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations_test.go b/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations_test.go new file mode 100755 index 000000000..7b6d6f0b5 --- /dev/null +++ b/Algorithms/1005.maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations_test.go @@ -0,0 +1,57 @@ +package problem1005 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{-75, 44, -14, -80, 11, 81, 67, 73, 75, -77, -35, -77, 9, 22, 11, 93, -34, 5, 78, 80, 1, 0, 94, 56, 21, -79, 13, -54, 82, 19, -99, -19, 6, -18, 39, -19, 83, 96, -66, -75, -3, 54, 97, -4, 77, -66, 69, 14, 17, -59, 13, -32, -6, -52, 74, 73, 61, -26, -62, 89, 71, 22, -35, -61, -75, -10, 17, -54, -49, -78, 79, -79, 63, 27, 85, -66, -24, 2, -15, -42, -58, 60, -8, 6, 43, -33, -11, -52, -62, -79, 93, -78, -36, -80, -23, -72, 43, -96, -25, 60, 49, -48, 44, 54, 11, 13, 82, 73, 17, -22, -9, -16, -83, 23, 6, 83, 37, -93, -43, 5, 9, -25, -87, -69, -51, -10, 36, 77, 62, -92, 100, 13, 64, 84, 100, 30, 88, 50, -56, -55, 50, 57, 77, -40, 15, -25, 8, -87, 50, 13, 45, -49, -66, -65, -6, -90, -82, 68, -86, -25, 2, 72, 87, 69, 57, -43, -32, 54, -69, -42, 21, 0, -4, 82, 44, 84, -34, -44, 88, 92, 30, 66, 80, -68, 10, -15, -8, -87, -37, -49, 52, -59, 53, 21, -76, 32, -74, 87, 89, 58, 50, -47, 14, 64, 36, -84, 57, 58, -49, -15, -96, -64, 33, -100, -89, 76, -20, -79, -35, 6, 37, -90, 28, -14, 32, 16, -88, -32, -59, 40, -7, -51, 99, -31, -99, -100, -5, -19, 59, 83, -72, 59, -59, 50, 67, 56, 76, 67, -47, -16, -99, -87, -27, 80, -9, 45, 41, -42, 64, -28, 65, 56, 65, 27, -22, 37, -70, -35, -74, -69, 12, -37, 3, -76, 70, -100, 19, -3, -69, -15, -29, 98, -16, 19, -59, 38, -3, -39, -61, -26, -6, -73, -80, 41, -79, 42, 34, 98, -68, 97, 10, -16, 92, -21, 100, -75, 1, -74, 61, 41, 58, -96, -4, -93, -34, -32, 94, 60, 57, -56, -17, 5, 83, 22, -40, 51, 0, -61, 62, 25, -32, -56, -98, -55, -96, -92, 100, -50, 66, 7, 46, 23, -53, -41, -85, -71, 58, -47, -20, 9, -24, 36, 19, 22, -78, 56, -38, 53, -10, -72, 11, -92, 90, -45, -80, 100, -98, -85, 45, -18, -37, -15, -56, 28, -2, -11, 55, 18, 65, 18, -19, -43, 39, 31, -76, 89, -1, -97, 25, -96, -26, 34, 70, -80, -9, -97, -41, 43, 96, 82, 95, -67, -22, 60, 95, -41, -90, -34, 25, -35, 76, -26, -46, -20, 63, -41, -46, -6, -91, 8, -43, 93, -54, 80, -93, 41, -19, 63, 66, 47, 50, -3, -16, 46, -28, -100, -27, -76, -93, 19, 56, 64, 36, 53, -99, -5, -75, -91, -37, 78, -49, -92, -43, 8, -22, -90, -65, -55, 21, -13, 98, 38, 93, 65, -54, -77, -29, -50, 15, -4, 22, 17, -65, 17, 55, 74, 45, 78, -12, 20, -81, -72, 3, 19, -13, -93, 50, 21, -67, 17, 42, 99, 34, -53, -85, -40, -54, 92, -35, 10, 73, 9, 0, 56, -40, 0, -44, -2, -50, -33, 42, 64, -65, 92, 78, 42, 40, 41, 84, 27, 78, -59, -24, 42, 47, -24, 66, -1, -15, 32, -23, -90, -89, -38, 17, -82, -76, 43, 89, 37, 48, -13, 54, 64, -21, -27, 74, -4, 30, 19, -74, 42, 18, 64, 39, 29, 45, 15, -43, 13, 9, -39, -46, -92, 91, -23, -55, 63, 40, -12, -5, 80, -39, -80, 16, -78, 91, 75, -46, 25, 19, 71, 17, -32, -61, -65, -24, -94, 67, 45, 73, 89, 50, 2, 19, -33, -30, 14, -47, 67, -67, 59, -90, -58, -57, -37, 14, 22, 10, -82, -14, 82, 88, -41, 26, 61, 87, 66, 36, 93, -15, -96, -24, -3, 68, -58, -63, -58, -75, 82, -98, -50, 7, -29, 87, -5, 80, -23, -79, -64, -97, -61, -3, 50, -93, -82, -63, -13, -16, 40, -25, 28, -89, 55, -17, -22, 66, 26, 83, 31, 71, -66, -60, -69, -60, -54, 28, 87, 39, 87, 89, 32, -37, 10, 30, -69, -9, 29, 32, 89, 100, 62, 73, 26, -61, -70, 90, -34, 54, -49, -88, 60, -99, 78, 37, 98, 6, 75, 95, -91, 89, 22, -31, -49, 65, 11, 9, -94, 17, -25, -25, -79, 13, -8, -86, -92, 0, 21, -34, 36, 58, 94, 75, 82, 10, 83, -57, 48, 69, 34, -46, 24, -1, -19, -48, -82, -95, -54, 86, 90, -91, 52, -63, 50, 87, 100, 48, -33, 76, -77, -23, -86, 84, 38, -86, -84, 24, -32, 52, -10, -71, 9, -30, -82, 65, 79, 38, 95, 2, 86, 95, -56, 74, 87, 48, -28, -92, -9, 70, -75, 49, -84, 37, -25, -32, 93, 88, -63, -80, 96, -14, 13, -8, -40, 60, 14, -28, 98, -1, -34, 51, 23, 74, -85, 53, 62, -67, 80, 30, -22, 41, 93, -58, -62, -35, -79, 22, -76, -100, -38, -45, 15, -50, 43, -30, 44, -27, 55, -70, -80, 67, 2, 48, 45, 49, -61, -4, -89, -90, 84, -47, -8, 62, 61, 21, 31, 94, 40, 20, 98, -73, 46, -64, -61, -69, -44, -84, 24, 83, -93, -6, -48, -75, -20, 92, -28, -55, 24, -18, -9, 31, -84, -100, 89, 50, -36, -5, 67, -67, 20, -90, -33, -29, 53, 77, -19, 68, -51, -30, -41, 22, 91, 7, -74, 38, -39, 71, 6, 73, 50, 44, 85, 9, 74, -29, -27, -39, -6, 29, 83, -18, -42, 91, 69, 58, 3, -60, 93, -39, -21, -77, 7, 12, -81, -99, 94, 12, -6, -82, 99, -31, -15, 0, -57, -100, 1, 54, -19, 47, 4, 39, -63, 38, -85, 20, 62, 47, -24, -74, -73, 17, -89, -4, 49, 71, -83, 88, 36, 11, 100, -71, 35, -46, -74, 11, 47, -96, 82, 45, 69, -25, 86, -27, -33, 25, -86, 91, 10, 62, 7, -56, 38, 86, 62, -28, -31, 15, -17, -100, -61, 96, 61, 80, 78, -87, -13, -59, -79, 62, 35}, + 848, + 50592, + }, + + { + []int{4, 2, 3}, + 1, + 5, + }, + + { + []int{3, -1, 0, 2}, + 3, + 6, + }, + + { + []int{2, -3, -1, 5, -4}, + 2, + 13, + }, + + // 可以有多个 testcase +} + +func Test_largestSumAfterKNegations(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largestSumAfterKNegations(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_largestSumAfterKNegations(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestSumAfterKNegations(tc.A, tc.K) + } + } +} diff --git a/Algorithms/1006.clumsy-factorial/README.md b/Algorithms/1006.clumsy-factorial/README.md new file mode 100755 index 000000000..f89e884b0 --- /dev/null +++ b/Algorithms/1006.clumsy-factorial/README.md @@ -0,0 +1,32 @@ +# [1006. Clumsy Factorial](https://leetcode.com/problems/clumsy-factorial/) + +Normally, the factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1. + +We instead make a clumsy factorial: using the integers in decreasing order, we swap out the multiply operations for a fixed rotation of operations: multiply (*), divide (/), add (+) and subtract (-) in this order. + +For example, clumsy(10) = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1. However, these operations are still applied using the usual order of operations of arithmetic: we do all multiplication and division steps before any addition or subtraction steps, and multiplication and division steps are processed left to right. + +Additionally, the division that we use is floor division such that 10 * 9 / 8 equals 11. This guarantees the result is an integer. + +Implement the clumsy function as defined above: given an integer N, it returns the clumsy factorial of N. + +Example 1: + +```text +Input: 4 +Output: 7 +Explanation: 7 = 4 * 3 / 2 + 1 +``` + +Example 2: + +```text +Input: 10 +Output: 12 +Explanation: 12 = 10 * 9 / 8 + 7 - 6 * 5 / 4 + 3 - 2 * 1 +``` + +Note: + +- 1 <= N <= 10000 +- -2^31 <= answer <= 2^31 - 1 (The answer is guaranteed to fit within a 32-bit integer.) diff --git a/Algorithms/1006.clumsy-factorial/clumsy-factorial.go b/Algorithms/1006.clumsy-factorial/clumsy-factorial.go new file mode 100755 index 000000000..399031255 --- /dev/null +++ b/Algorithms/1006.clumsy-factorial/clumsy-factorial.go @@ -0,0 +1,22 @@ +package problem1006 + +var answers = []int{0, 1, 2, 6, 7} + +func clumsy(N int) int { + if N <= 4 { + return answers[N] + } + a := N*(N-1)/(N-2) + (N - 3) + b := (N - 4) * max(1, (N-5)) / max(1, (N-6)) + return a - 2*b + clumsy(N-4) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// go to look O(1) solution +// https://leetcode.com/problems/clumsy-factorial/discuss/252279/You-never-think-of-this-amazing-O(1)-solution diff --git a/Algorithms/1006.clumsy-factorial/clumsy-factorial_test.go b/Algorithms/1006.clumsy-factorial/clumsy-factorial_test.go new file mode 100755 index 000000000..88663297c --- /dev/null +++ b/Algorithms/1006.clumsy-factorial/clumsy-factorial_test.go @@ -0,0 +1,42 @@ +package problem1006 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 4, + 7, + }, + + { + 10, + 12, + }, + + // 可以有多个 testcase +} + +func Test_clumsy(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, clumsy(tc.N), "输入:%v", tc) + } +} + +func Benchmark_clumsy(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + clumsy(tc.N) + } + } +} diff --git a/Algorithms/1007.minimum-domino-rotations-for-equal-row/README.md b/Algorithms/1007.minimum-domino-rotations-for-equal-row/README.md new file mode 100755 index 000000000..145d1f437 --- /dev/null +++ b/Algorithms/1007.minimum-domino-rotations-for-equal-row/README.md @@ -0,0 +1,36 @@ +# [1007. Minimum Domino Rotations For Equal Row](https://leetcode.com/problems/minimum-domino-rotations-for-equal-row/) + +In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.) + +We may rotate the i-th domino, so that A[i] and B[i] swap values. + +Return the minimum number of rotations so that all the values in A are the same, or all the values in B are the same. + +If it cannot be done, return -1. + +Example 1: + +![domino](domino.png) + + +```text +Input: A = [2,1,2,4,2,2], B = [5,2,6,2,3,2] +Output: 2 +Explanation: +The first figure represents the dominoes as given by A and B: before we do any rotations. +If we rotate the second and fourth dominoes, we can make every value in the top row equal to 2, as indicated by the second figure. +``` + +Example 2: + +```text +Input: A = [3,5,1,2,3], B = [3,6,3,3,4] +Output: -1 +Explanation: +In this case, it is not possible to rotate the dominoes to make one row of values equal. +``` + +Note: + +- `1 <= A[i], B[i] <= 6` +- `2 <= A.length == B.length <= 20000` diff --git a/Algorithms/1007.minimum-domino-rotations-for-equal-row/domino.png b/Algorithms/1007.minimum-domino-rotations-for-equal-row/domino.png new file mode 100644 index 000000000..61f048ebb Binary files /dev/null and b/Algorithms/1007.minimum-domino-rotations-for-equal-row/domino.png differ diff --git a/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row.go b/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row.go new file mode 100755 index 000000000..08028e9f9 --- /dev/null +++ b/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row.go @@ -0,0 +1,32 @@ +package problem1007 + +func minDominoRotations(A []int, B []int) int { + if res, ok := check(A, B, A[0]); ok { + return res + } + if res, ok := check(A, B, B[0]); ok { + return res + } + return -1 +} + +func check(A, B []int, flag int) (int, bool) { + a, b := 0, 0 + i, n := 0, len(A) + for ; i < n && (A[i] == flag || B[i] == flag); i++ { + if A[i] != flag { // A needs a swap to be all flag + a++ + } + if B[i] != flag { // B needs a swap to be all flag + b++ + } + } + return min(a, b), i == n +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row_test.go b/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row_test.go new file mode 100755 index 000000000..00e63e9f9 --- /dev/null +++ b/Algorithms/1007.minimum-domino-rotations-for-equal-row/minimum-domino-rotations-for-equal-row_test.go @@ -0,0 +1,57 @@ +package problem1007 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans int +}{ + + { + []int{2, 1, 1, 3, 2, 1, 2, 2, 1}, + []int{3, 2, 3, 1, 3, 2, 3, 3, 2}, + -1, + }, + + { + []int{5, 2, 6, 2, 3, 2}, + []int{2, 1, 2, 4, 2, 2}, + 2, + }, + + { + []int{2, 1, 2, 4, 2, 2}, + []int{5, 2, 6, 2, 3, 2}, + 2, + }, + + { + []int{3, 5, 1, 2, 3}, + []int{3, 6, 3, 3, 4}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_minDominoRotations(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minDominoRotations(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_minDominoRotations(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minDominoRotations(tc.A, tc.B) + } + } +} diff --git a/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/1266.png b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/1266.png new file mode 100644 index 000000000..3423c8333 Binary files /dev/null and b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/1266.png differ diff --git a/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/README.md b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/README.md new file mode 100755 index 000000000..63f8ee576 --- /dev/null +++ b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/README.md @@ -0,0 +1,19 @@ +# [1008. Construct Binary Search Tree from Preorder Traversal](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/) + +Return the root node of a binary search tree that matches the given preorder traversal. + +(Recall that a binary search tree is a binary tree where for every node, any descendant of node.left has a value < node.val, and any descendant of node.right has a value > node.val. Also recall that a preorder traversal displays the value of the node first, then traverses node.left, then traverses node.right.) + +Example 1: + +![1266](1266.png) + +```text +Input: [8,5,1,7,10,12] +Output: [8,5,10,1,7,null,12] +``` + +Note: + +- 1 <= preorder.length <= 100 +- The values of preorder are distinct. diff --git a/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal.go b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal.go new file mode 100755 index 000000000..e114ef672 --- /dev/null +++ b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal.go @@ -0,0 +1,27 @@ +package problem1008 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +// ref: https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/discuss/252232/JavaC%2B%2BPython-O(N)-Solution +func bstFromPreorder(A []int) *TreeNode { + i, n := 0, len(A) + + var helper func(int) *TreeNode + helper = func(bound int) *TreeNode { + if i == n || A[i] > bound { + return nil + } + root := &TreeNode{ + Val: A[i], + } + i++ + root.Left = helper(root.Val) + root.Right = helper(bound) + return root + } + + return helper(1 << 32) +} diff --git a/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal_test.go b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal_test.go new file mode 100755 index 000000000..a3fcc53a1 --- /dev/null +++ b/Algorithms/1008.construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal_test.go @@ -0,0 +1,39 @@ +package problem1008 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + preorder []int + ans []int +}{ + + { + []int{8, 5, 1, 7, 10, 12}, + []int{8, 5, 10, 1, 7, kit.NULL, 12}, + }, + + // 可以有多个 testcase +} + +func Test_bstFromPreorder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := kit.Tree2ints(bstFromPreorder(tc.preorder)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_bstFromPreorder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + bstFromPreorder(tc.preorder) + } + } +} diff --git a/Algorithms/1009.complement-of-base-10-integer/README.md b/Algorithms/1009.complement-of-base-10-integer/README.md new file mode 100755 index 000000000..56b0ed2f2 --- /dev/null +++ b/Algorithms/1009.complement-of-base-10-integer/README.md @@ -0,0 +1,35 @@ +# [1009. Complement of Base 10 Integer](https://leetcode.com/problems/complement-of-base-10-integer/) + +Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on. Note that except for N = 0, there are no leading zeroes in any binary representation. + +The complement of a binary representation is the number in binary you get when changing every 1 to a 0 and 0 to a 1. For example, the complement of "101" in binary is "010" in binary. + +For a given number N in base-10, return the complement of it's binary representation as a base-10 integer. + +Example 1: + +```text +Input: 5 +Output: 2 +Explanation: 5 is "101" in binary, with complement "010" in binary, which is 2 in base-10. +``` + +Example 2: + +```text +Input: 7 +Output: 0 +Explanation: 7 is "111" in binary, with complement "000" in binary, which is 0 in base-10. +``` + +Example 3: + +```text +Input: 10 +Output: 5 +Explanation: 10 is "1010" in binary, with complement "0101" in binary, which is 5 in base-10. +``` + +Note: + +- 0 <= N < 10^9 diff --git a/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer.go b/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer.go new file mode 100755 index 000000000..b425470b7 --- /dev/null +++ b/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer.go @@ -0,0 +1,14 @@ +package problem1009 + +func bitwiseComplement(N int) int { + x := N + x |= 1 // when x is 0 + x |= x >> 1 + x |= x >> 2 + x |= x >> 4 + x |= x >> 8 + x |= x >> 16 + // if N is 000101011101 + // then x 000111111111 + return x ^ N +} diff --git a/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer_test.go b/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer_test.go new file mode 100755 index 000000000..b1f9b946a --- /dev/null +++ b/Algorithms/1009.complement-of-base-10-integer/complement-of-base-10-integer_test.go @@ -0,0 +1,67 @@ +package problem1009 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 2, + 1, + }, + + { + 1, + 0, + }, + + { + 0, + 1, + }, + + { + 5, + 2, + }, + + { + 7, + 0, + }, + + { + 10, + 5, + }, + + { + 87654321, + 46563406, + }, + + // 可以有多个 testcase +} + +func Test_bitwiseComplement(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, bitwiseComplement(tc.N), "输入:%v", tc) + } +} + +func Benchmark_bitwiseComplement(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + bitwiseComplement(tc.N) + } + } +} diff --git a/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/README.md b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/README.md new file mode 100755 index 000000000..df95c13df --- /dev/null +++ b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/README.md @@ -0,0 +1,29 @@ +# [1010. Pairs of Songs With Total Durations Divisible by 60](https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/) + +In a list of songs, the i-th song has a duration of time[i] seconds. + +Return the number of pairs of songs for which their total duration in seconds is divisible by 60. Formally, we want the number of indices i < j with (time[i] + time[j]) % 60 == 0. + +Example 1: + +```text +Input: [30,20,150,100,40] +Output: 3 +Explanation: Three pairs have a total duration divisible by 60: +(time[0] = 30, time[2] = 150): total duration 180 +(time[1] = 20, time[3] = 100): total duration 120 +(time[1] = 20, time[4] = 40): total duration 60 +``` + +Example 2: + +```text +Input: [60,60,60] +Output: 3 +Explanation: All three pairs have a total duration of 120, which is divisible by 60. +``` + +Note: + +- 1 <= time.length <= 60000 +- 1 <= time[i] <= 500 diff --git a/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60.go b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60.go new file mode 100755 index 000000000..0876d21a0 --- /dev/null +++ b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60.go @@ -0,0 +1,16 @@ +package problem1010 + +func numPairsDivisibleBy60(time []int) int { + rec := [60]int{} + for _, t := range time { + rec[t%60]++ + } + + res := rec[0] * (rec[0] - 1) / 2 + res += rec[30] * (rec[30] - 1) / 2 + for i := 1; i < 30; i++ { + res += rec[i] * rec[60-i] + } + + return res +} diff --git a/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60_test.go b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60_test.go new file mode 100755 index 000000000..50fd8e13a --- /dev/null +++ b/Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60/pairs-of-songs-with-total-durations-divisible-by-60_test.go @@ -0,0 +1,52 @@ +package problem1010 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + time []int + ans int +}{ + + { + []int{95, 51, 462, 476, 245, 271, 481, 257, 130, 314, 244, 215, 397, 60, 21, 60, 168, 213, 107, 394, 209, 223, 410, 220, 444, 337, 264, 417, 356, 409, 467, 23, 273, 236, 281, 478, 227, 69, 207, 255, 18, 133, 362, 161, 329, 66, 233, 487, 23, 315, 296, 60, 424, 370, 331, 305, 333, 218, 145, 379, 212, 413, 486, 111, 45, 239, 57, 395, 140, 405, 266, 212, 356, 28, 346, 358, 309, 263, 101, 46, 167, 352, 359, 381, 205, 308, 213, 390, 211, 142, 287, 476, 189, 164, 9, 5, 58, 206, 39, 248, 409, 189, 139, 128, 107, 342, 466, 143, 267, 372, 119, 172, 416, 5, 31, 77, 167, 133, 192, 182, 323, 238, 219, 140, 327, 275, 361, 435, 452, 489, 185, 468, 252, 144, 233, 7, 243, 83, 72, 35, 446, 188, 259, 185, 499, 141, 457, 33, 267, 238, 224, 121, 164, 436, 375, 259, 247, 136, 207, 391, 255, 182, 237, 451, 184, 407, 156, 386, 249, 351, 336, 110, 262, 119, 375, 302, 95, 236, 279, 172, 199, 346, 14, 291, 338, 102, 101, 182, 28, 321, 446, 384, 191, 71, 259, 410, 113, 160, 372, 260, 452, 246, 132, 416, 20, 113, 257, 113, 300, 222, 295, 10, 461, 449, 233, 73, 273, 91, 464, 452, 362, 477, 2, 435, 373, 139, 165, 20, 455, 361, 62, 253, 412, 281, 362, 94, 246, 475, 224, 176, 22, 388, 100, 255, 180, 340, 93, 245, 442, 420, 353, 25, 329, 232, 216, 2, 120, 450, 57, 133, 47, 309, 460, 354, 93, 259, 485, 339, 490, 56, 488, 311, 250, 217, 247, 420, 376, 329, 491, 165, 488, 251, 430, 470, 122, 111, 359, 343, 200, 480, 162, 353, 344, 349, 301, 145, 388, 456, 17, 455, 487, 324, 493, 248, 151, 53, 414, 396, 194, 170, 290, 349, 287, 242, 53, 77, 219, 280, 267, 384, 118, 314, 12, 189, 118, 379, 254, 160, 179, 29, 87, 274, 346, 228, 488, 481, 481, 56, 67, 3, 256, 463, 150, 399, 340, 464, 9, 28, 479, 250, 256, 21, 209, 87, 59, 7, 433, 189, 433, 22, 76, 45, 217, 301, 34, 98, 248, 265, 496, 319, 157, 69, 216, 46, 299, 233, 153, 310, 151, 299, 283, 206, 335, 220, 65, 195, 76, 213, 10, 150, 104, 488, 139, 360, 426, 14, 115, 136, 409, 36, 165, 488, 440, 111, 462, 369, 341, 234, 372, 226, 369, 136, 424, 125, 418, 215, 178, 291, 54, 183, 140, 82, 326, 92, 50, 82, 311, 12, 1, 9, 99, 106, 195, 153, 77, 108, 60, 211, 69, 194, 253, 246, 353, 273, 483, 452, 488, 229, 412, 333, 441, 39, 255, 190, 480, 280, 419, 19, 337, 252, 312, 154, 247, 380, 94, 70, 55, 320, 448, 328, 230, 18, 322, 309, 79, 477, 239, 314, 426, 19, 408, 151, 62, 495, 183, 401, 431, 396, 93, 336, 205, 423, 113, 369, 376, 217, 158, 389, 250, 271, 465, 5, 108, 221, 309, 148, 57, 500, 209, 259, 149, 479, 321, 368, 347, 358, 109, 23, 152, 114, 476, 428, 314, 78, 95, 16, 58, 317, 84, 108, 338, 386, 495, 128, 172, 459, 29, 385, 181, 102, 3, 8, 198, 359, 115, 149, 82, 88, 340, 416, 450, 472, 353, 495, 432, 404, 370, 74, 426, 121, 423, 406, 260, 84, 23, 459, 384, 156, 310, 66, 493, 108, 43, 248, 408, 134, 323, 416, 202, 110, 20, 425, 38, 257, 19, 334, 300, 362, 319, 12, 82, 200, 95, 316, 447, 221, 372, 285, 490, 245, 84, 386, 188, 109, 244, 411, 232, 473, 56, 351, 44, 278, 294, 145, 198, 65, 242, 340, 237, 242, 308, 385, 204, 2, 344, 220, 63, 250, 174, 79, 186, 289, 288, 82, 159, 285, 495, 129, 8, 478, 202, 74, 263, 474, 184, 212, 160, 476, 374, 345, 103, 106, 307, 436, 291, 435, 363, 332, 292, 425, 429, 184, 290, 332, 189, 20, 316, 317, 458, 287, 202, 79, 301, 431, 387, 178, 88, 94, 335, 295, 52, 53, 170, 305, 155, 268, 380, 395, 211, 379, 347, 284, 417, 32, 264, 318, 47, 318, 265, 191, 131, 331, 301, 399, 309, 476, 484, 348, 277, 136, 204, 1, 447, 124, 226, 100, 109, 106, 177, 43, 328, 33, 418, 410, 127, 3, 171, 75, 198, 307, 289, 73, 89, 95, 353, 483, 7, 412, 90, 254, 24, 253, 265, 162, 439, 283, 352, 169, 184, 272, 200, 234, 38, 495, 83, 212, 314, 341, 175, 368, 143, 380, 329, 391, 4, 255, 399, 13, 182, 3, 198, 251, 159, 417, 4, 410, 492, 149, 243, 22, 148, 229, 300, 112, 458, 228, 350, 36, 479, 83, 361, 276, 9, 11, 51, 111, 45, 345, 342, 47, 50, 465, 467, 219, 368, 92, 268, 390, 487, 450, 107, 282, 189, 409, 310, 70, 227, 212, 449, 380, 48, 148, 275, 452, 48, 274, 102, 415, 191, 391, 38, 324, 460, 31, 429, 171, 202, 383, 162, 245, 42, 179, 341, 281, 283, 4, 225, 259, 461, 307, 294, 167, 67, 408, 271, 154, 393, 396, 366, 354, 230, 60, 323, 9, 122, 28, 389, 26, 266, 417, 352, 459, 423, 495, 148, 28, 223, 231, 144, 179, 380, 2, 480, 26, 151, 304, 469, 88, 94, 382, 131, 284, 458, 452, 241, 72, 438, 296, 225, 172, 150, 130, 40, 273, 402, 122, 96, 374, 492, 377, 238, 262, 261, 179, 24, 251, 252, 190, 63, 169, 481, 114, 226, 93, 440, 320, 49, 7, 248, 124, 283, 425, 448, 206, 133, 257, 257, 204, 209, 235, 474, 426, 284, 272, 123, 133, 140, 100, 263, 484, 59, 397, 25, 362, 334, 86, 195, 43, 266, 117, 174, 62, 430, 281, 307, 122, 184, 133, 170, 121, 419, 103, 490, 458, 48, 314, 46, 201, 2, 128, 254, 166, 416, 181, 399, 201, 191, 262, 251, 81, 225, 311, 174, 216, 155, 285, 324, 325, 111, 272, 152, 246, 35, 167, 422, 398, 401, 55, 314, 84, 337, 300, 440, 494, 18, 124, 86, 472, 57, 433, 128, 246, 392, 227, 499, 409, 421, 180, 362, 147, 152, 415, 39, 170, 136, 2, 132, 477, 463, 195, 56, 491, 217, 398, 302, 54, 365, 254, 338, 465, 141, 252, 359, 319, 53, 187, 17, 426, 183, 50, 240, 196, 70, 488, 240, 121, 223, 484, 204, 151, 134, 367, 131, 281, 243, 96, 357, 77, 322, 79, 67, 250, 142, 405, 215, 82, 23, 58, 297, 346, 400, 352, 453, 133, 173, 145, 234, 152, 318, 469, 36, 292, 471, 314, 91, 7, 446, 1, 298, 287, 76, 196, 109, 434, 136, 262, 288, 461, 114, 385, 317, 284, 333, 441, 406, 464, 14, 442, 481, 78, 467, 138, 446, 265, 441, 175, 232, 419, 478, 78, 216, 61, 455, 243, 345, 106, 427, 435, 274, 136, 431, 66, 71, 135, 436, 209, 457, 7, 392, 437, 65, 59, 157, 141, 269, 257, 384, 197, 235, 63, 203, 426, 71, 29, 304, 402, 318, 384, 312, 490, 78, 121, 305, 139, 19, 340, 368, 24, 409, 218, 31, 356, 475, 59, 476, 465, 245, 316, 340, 69, 195, 34, 346, 292, 464, 261, 38, 373, 484, 82, 2, 413, 159, 106, 320, 39, 387, 281, 421, 251, 114, 99, 495, 330, 202, 362, 233, 71, 370, 319, 74, 289, 68, 420, 10, 467, 370, 328, 53, 110, 299, 203, 273, 223, 205, 214, 300, 419, 213, 41, 59, 200, 20, 172, 381, 263, 98, 309, 154, 368, 333, 484, 313, 240, 78, 106, 355, 244, 265, 475, 473, 411, 244, 268, 185, 468, 308, 9, 365, 129, 240, 464, 323, 249, 212, 496, 364, 119, 119, 195, 153, 17, 377, 181, 81, 326, 334, 395, 145, 13, 461, 57, 26, 163, 314, 71, 27, 248, 289, 148, 336, 339, 188, 202, 96, 310, 297, 200, 312, 235, 181, 61, 410, 169, 326, 445, 111, 464, 415, 199, 177}, + 14804, + }, + + { + []int{336, 24, 100, 342, 274, 11, 43, 22, 416, 138, 384, 386, 70, 265, 59, 253, 344, 435, 400, 296, 192, 143, 311, 424, 315, 63, 420, 254, 493, 431, 32, 394, 178, 51, 378, 335, 265, 92, 335, 325, 25, 355, 258, 298, 390, 399, 393, 114, 149, 62, 299, 471, 286, 204, 163, 214, 15, 272, 315, 212, 272, 437, 339, 193, 125, 394, 62, 188, 154, 150, 109, 294, 228, 200, 459, 42, 469, 132, 37, 460, 143, 1, 144, 127, 398, 82, 370, 464, 14, 85, 321, 358, 205, 14, 264, 289, 183, 93, 56, 126, 413, 140, 441, 446, 445, 378, 258, 119, 385, 226, 8, 93, 476, 265, 115, 86, 360, 92, 396, 407, 458, 58, 65, 397, 381, 32, 228, 37, 319, 220, 73, 328, 162, 458, 231, 219, 481, 387, 423, 256, 252, 36, 309, 395, 471, 4, 225, 146, 188, 182, 347, 82, 21, 292, 91, 144, 387, 263, 206, 452, 197, 192, 324, 257, 370, 28, 440, 180, 294}, + 245, + }, + + { + []int{30, 20, 150, 100, 40}, + 3, + }, + + { + []int{60, 60, 60}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_numPairsDivisibleBy60(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numPairsDivisibleBy60(tc.time), "输入:%v", tc) + } +} + +func Benchmark_numPairsDivisibleBy60(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numPairsDivisibleBy60(tc.time) + } + } +} diff --git a/Algorithms/1011.capacity-to-ship-packages-within-d-days/README.md b/Algorithms/1011.capacity-to-ship-packages-within-d-days/README.md new file mode 100755 index 000000000..858f6d2b9 --- /dev/null +++ b/Algorithms/1011.capacity-to-ship-packages-within-d-days/README.md @@ -0,0 +1,52 @@ +# [1011. Capacity To Ship Packages Within D Days](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/) + +A conveyor belt has packages that must be shipped from one port to another within D days. + +The i-th package on the conveyor belt has a weight of weights[i]. Each day, we load the ship with packages on the conveyor belt (in the order given by weights). We may not load more weight than the maximum weight capacity of the ship. + +Return the least weight capacity of the ship that will result in all the packages on the conveyor belt being shipped within D days. + +Example 1: + +```text +Input: weights = [1,2,3,4,5,6,7,8,9,10], D = 5 +Output: 15 +Explanation: +A ship capacity of 15 is the minimum to ship all the packages in 5 days like this: +1st day: 1, 2, 3, 4, 5 +2nd day: 6, 7 +3rd day: 8 +4th day: 9 +5th day: 10 + +Note that the cargo must be shipped in the order given, so using a ship of capacity 14 and splitting the packages into parts like (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) is not allowed. +``` + +Example 2: + +```text +Input: weights = [3,2,2,4,1,4], D = 3 +Output: 6 +Explanation: +A ship capacity of 6 is the minimum to ship all the packages in 3 days like this: +1st day: 3, 2 +2nd day: 2, 4 +3rd day: 1, 4 +``` + +Example 3: + +```text +Input: weights = [1,2,3,1,1], D = 4 +Output: 3 +Explanation: +1st day: 1 +2nd day: 2 +3rd day: 3 +4th day: 1, 1 +``` + +Note: + +- `1 <= D <= weights.length <= 50000` +- `1 <= weights[i] <= 500` diff --git a/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days.go b/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days.go new file mode 100755 index 000000000..50fc17390 --- /dev/null +++ b/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days.go @@ -0,0 +1,35 @@ +package problem1011 + +func shipWithinDays(weights []int, D int) int { + lo, hi := 0, 0 + for _, w := range weights { + lo = max(lo, w) + hi += w + } + + for lo < hi { + mid := (lo + hi) >> 1 + days, cur := 1, 0 + for _, w := range weights { + if cur+w > mid { + days++ + cur = 0 + } + cur += w + } + if days > D { + lo = mid + 1 + } else { + hi = mid + } + } + + return lo +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days_test.go b/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days_test.go new file mode 100755 index 000000000..823a23356 --- /dev/null +++ b/Algorithms/1011.capacity-to-ship-packages-within-d-days/capacity-to-ship-packages-within-d-days_test.go @@ -0,0 +1,75 @@ +package problem1011 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + weights []int + D int + ans int +}{ + + { + []int{59, 468, 1, 380, 122, 368, 175, 383, 398, 422, 175, 403, 11, 415, 62, 379, 418, 406, 485, 410, 440, 364, 329, 8, 235, 461, 308, 69, 347, 37, 450, 187, 382, 44, 209, 463, 393, 478, 162, 376, 88, 335, 70, 3, 233, 375, 54, 412, 270, 299, 155, 243, 195, 423, 402, 464, 6, 63, 473, 149, 62, 162, 320, 490, 27, 30, 226, 488, 451, 18, 85, 179, 303, 425, 333, 210, 128, 422, 334, 475, 387, 379, 81, 196, 310, 48, 16, 171, 472, 35, 103, 434, 61, 498, 195, 168, 167, 394, 254, 99, 190, 316, 393, 40, 397, 170, 437, 442, 291, 323, 415, 336, 143, 400, 352, 42, 201, 28, 233, 43, 142, 81, 24, 378, 384, 156, 250, 376, 172, 493, 179, 500, 89, 104, 69, 320, 108, 238, 89, 245, 478, 242, 344, 47, 112, 188, 383, 10, 488, 9, 471, 430, 129, 1, 154, 344, 235, 456, 29, 115, 9, 394, 192, 12, 349, 415, 101, 398, 383, 175, 465, 267, 206, 71, 113, 448, 205, 202, 254, 221, 336, 425, 470, 455, 344, 172, 425, 417, 291, 190, 24, 240, 14, 397, 61, 246, 128, 232, 189, 210, 186, 163, 33, 386, 258, 50, 326, 412, 134, 19, 141, 158, 459, 403, 124, 99, 344, 269, 383, 151, 419, 495, 44, 295, 331, 59, 71, 386, 408, 79, 214, 217, 425, 189, 134, 232, 294, 232, 444, 198, 488, 21, 457, 118, 471, 256, 95, 428, 447, 112, 238, 408, 391, 270, 335, 244, 13, 402, 69, 121, 357, 221, 463, 113, 329, 193, 483, 384, 182, 380, 178, 263, 458, 422, 265, 439, 252, 222, 138, 88, 47, 465, 117, 91, 291, 107, 391, 239, 19, 108, 443, 497, 357, 432, 12, 252, 457, 96, 264, 210, 118, 395, 116, 445, 60, 361, 193, 363, 448, 435, 245, 190, 263, 169, 376, 381, 168, 403, 196, 477, 281, 16, 33, 84, 138, 10, 213, 434, 373, 464, 413, 351, 167, 411, 54, 134, 90, 102, 46, 41, 25, 270, 252, 383, 380, 499, 3, 128, 17, 392, 144, 433, 447, 383, 219, 262, 363, 82, 463, 461, 214, 207, 255, 398, 104, 306, 469, 385, 36, 202, 490, 350, 370, 207, 156, 153, 396, 155, 219, 298, 430, 480, 1, 415, 278, 55, 418, 353, 60, 169, 164, 43, 91, 489, 1, 7, 309, 159, 208, 246, 283, 140, 247, 204, 387, 15, 412, 182, 409, 61, 431, 394, 147, 150, 62, 423, 165, 298, 333, 467, 293, 226, 291, 187, 188, 368, 483, 234, 459, 386, 103, 374, 302, 320, 492, 277, 25, 21, 36, 149, 178, 78, 359, 457, 101, 139, 491, 266, 64, 352, 353, 471, 55, 265, 105, 101, 281, 286, 5, 27, 165, 360, 114, 344, 262, 266, 290, 464, 451, 209, 265, 371, 59, 453, 224, 465, 463, 261, 1, 295, 475, 71, 308, 1, 53, 58, 355, 470, 222, 242, 364, 275, 223, 484, 294, 8, 125, 75, 155, 469, 141, 319, 377, 258, 161, 374, 89, 52, 165, 206, 366, 6}, + 256, + 682, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + 10, + 10, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + 1, + 55, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, + 5, + 15, + }, + + { + []int{1, 2, 3, 1, 1}, + 4, + 3, + }, + + { + []int{1, 1, 1}, + 3, + 1, + }, + + { + []int{3, 2, 2, 4, 1, 4}, + 3, + 6, + }, + + // 可以有多个 testcase +} + +func Test_shipWithinDays(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, shipWithinDays(tc.weights, tc.D), "输入:%v", tc) + } +} + +func Benchmark_shipWithinDays(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shipWithinDays(tc.weights, tc.D) + } + } +} diff --git a/Algorithms/1012.numbers-with-repeated-digits/README.md b/Algorithms/1012.numbers-with-repeated-digits/README.md new file mode 100755 index 000000000..5ff1827d3 --- /dev/null +++ b/Algorithms/1012.numbers-with-repeated-digits/README.md @@ -0,0 +1,30 @@ +# [1012. Numbers With Repeated Digits](https://leetcode.com/problems/numbers-with-repeated-digits/) + +Given a positive integer N, return the number of positive integers less than or equal to N that have at least 1 repeated digit. + +Example 1: + +```text +Input: 20 +Output: 1 +Explanation: The only positive number (<= 20) with at least 1 repeated digit is 11. +``` + +Example 2: + +```text +Input: 100 +Output: 10 +Explanation: The positive numbers (<= 100) with atleast 1 repeated digit are 11, 22, 33, 44, 55, 66, 77, 88, 99, and 100. +``` + +Example 3: + +```text +Input: 1000 +Output: 262 +``` + +Note: + +- `1 <= N <= 10^9` diff --git a/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits.go b/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits.go new file mode 100755 index 000000000..beb73bcde --- /dev/null +++ b/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits.go @@ -0,0 +1,73 @@ +package problem1012 + +// ref: https://leetcode.com/problems/numbers-with-repeated-digits/discuss/256725/JavaPython-Count-the-Number-Without-Repeated-Digit +func numDupDigitsAtMostN(N int) int { + digits := convert(N + 1) // +1 为为了把判别条件从 <= 简化成 < + bits := len(digits) + + noRepeat := 0 + // 统计宽度短于 N 的不含重复数字的数的个数 + for b := 1; b < bits; b++ { + noRepeat += 9 * count(9, b-1) + } + + // 统计和 N 具有相同高位的且不含重复数字的数的个数 + hasSeen := make(map[int]bool, 10) + for b := 0; b < bits; b++ { + d := 0 + if b == 0 { + d = 1 // 最高位上的数字不能为 0 + } + for ; d < digits[b]; d++ { + // 如果 hasSeen[d]=true + // 说明在更高位上已经出现过 d 了 + // 无论低位上再出现什么,都不是 noRepeat 了 + if !hasSeen[d] { + noRepeat += count(9-b, bits-b-1) + } + } + if hasSeen[digits[b]] { + // digits[:b+1] 中出现了重复的数字 + // 不可能再有 noRepeat 了 + break + } + hasSeen[digits[b]] = true + } + return N - noRepeat +} + +func convert(N int) []int { + res := make([]int, 0, 10) + for N > 0 { + res = append(res, N%10) + N /= 10 + } + swap(res) + return res +} + +func swap(A []int) { + i, j := 0, len(A)-1 + for i < j { + A[i], A[j] = A[j], A[i] + i++ + j-- + } +} + +// 统计了 m 个数字组成宽度为 n 的数值时, +// 不含重复数字的数值的个数。 +// 注意, +// 真正使用 count 的时候,是为了统计 n+1 位宽度的数值 +// 在 n+1 位的最高位上不放置 0 +// 就可以保证剩下的 n 位的宽度确实是 n +// 所以,count 在使用时,还需要乘上 n+1 位上可供选择的数字的个数 +// 例如, 9*count(9, i-1) 的实际含义才是,所有宽度为 i 且不包含重复数字的数值个数 +// 例如, count(8,i) 的实际含义是,以 X 开头所有宽度为 i+1 且不包含重复数字的数的个数 +// X 可以是任意一个数字 +func count(m, n int) int { + if n == 0 { + return 1 + } + return count(m, n-1) * (m - n + 1) +} diff --git a/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits_test.go b/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits_test.go new file mode 100755 index 000000000..e46cf8d20 --- /dev/null +++ b/Algorithms/1012.numbers-with-repeated-digits/numbers-with-repeated-digits_test.go @@ -0,0 +1,57 @@ +package problem1012 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans int +}{ + + { + 1000000000, + 994388230, + }, + + { + 888, + 230, + }, + + { + 20, + 1, + }, + + { + 100, + 10, + }, + + { + 1000, + 262, + }, + + // 可以有多个 testcase +} + +func Test_numDupDigitsAtMostN(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numDupDigitsAtMostN(tc.N), "输入:%v", tc) + } +} + +func Benchmark_numDupDigitsAtMostN(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numDupDigitsAtMostN(tc.N) + } + } +} diff --git a/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/README.md b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/README.md new file mode 100755 index 000000000..5d2e96662 --- /dev/null +++ b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/README.md @@ -0,0 +1,33 @@ +# [1013. Partition Array Into Three Parts With Equal Sum](https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/) + +Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with equal sums. + +Formally, we can partition the array if we can find indexes i+1 < j with (A[0] + A[1] + ... + A[i] == A[i+1] + A[i+2] + ... + A[j-1] == A[j] + A[j-1] + ... + A[A.length - 1]) + +Example 1: + +```text +Input: [0,2,1,-6,6,-7,9,1,2,0,1] +Output: true +Explanation: 0 + 2 + 1 = -6 + 6 - 7 + 9 + 1 = 2 + 0 + 1 +``` + +Example 2: + +```text +Input: [0,2,1,-6,6,7,9,-1,2,0,1] +Output: false +``` + +Example 3: + +```text +Input: [3,3,6,5,-2,2,5,1,-9,4] +Output: true +Explanation: 3 + 3 = 6 = 5 - 2 + 2 + 5 + 1 - 9 + 4 +``` + +Note: + +- `3 <= A.length <= 50000` +- `-10000 <= A[i] <= 10000` diff --git a/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum.go b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum.go new file mode 100755 index 000000000..1118b96d4 --- /dev/null +++ b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum.go @@ -0,0 +1,28 @@ +package problem1013 + +func canThreePartsEqualSum(A []int) bool { + n := len(A) + sums := make([]int, n) + s := 0 + for i := 0; i < n; i++ { + s += A[i] + sums[i] = s + } + if s%3 != 0 { + return false + } + + s /= 3 + i := 0 + for i < n && sums[i] != s { + i++ + } + + s *= 2 + j := n - 1 + for 0 <= j && sums[j] != s { + j-- + } + + return i < j +} diff --git a/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum_test.go b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum_test.go new file mode 100755 index 000000000..3529ca006 --- /dev/null +++ b/Algorithms/1013.partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum_test.go @@ -0,0 +1,57 @@ +package problem1013 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{6, 1, 1, 13, -1, 0, -10, 20}, + false, + }, + + { + []int{3, 3, 6, 5, -2, 2, 5, 1, -9, 4}, + true, + }, + + { + []int{0, 2, 1, -6, 6, -7, 9, 1, 2, 0, 1, 2}, + false, + }, + + { + []int{0, 2, 1, -6, 6, -7, 9, 1, 2, 0, 1}, + true, + }, + + { + []int{0, 2, 1, -6, 6, 7, 9, -1, 2, 0, 1}, + false, + }, + + // 可以有多个 testcase +} + +func Test_canThreePartsEqualSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, canThreePartsEqualSum(tc.A), "输入:%v", tc) + } +} + +func Benchmark_canThreePartsEqualSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canThreePartsEqualSum(tc.A) + } + } +} diff --git a/Algorithms/1014.best-sightseeing-pair/README.md b/Algorithms/1014.best-sightseeing-pair/README.md new file mode 100755 index 000000000..ed8e17eae --- /dev/null +++ b/Algorithms/1014.best-sightseeing-pair/README.md @@ -0,0 +1,20 @@ +# [1014. Best Sightseeing Pair](https://leetcode.com/problems/best-sightseeing-pair/) + +Given an array A of positive integers, A[i] represents the value of the i-th sightseeing spot, and two sightseeing spots i and j have distance j - i between them. + +The score of a pair (i < j) of sightseeing spots is (A[i] + A[j] + i - j) : the sum of the values of the sightseeing spots, minus the distance between them. + +Return the maximum score of a pair of sightseeing spots. + +Example 1: + +```text +Input: [8,1,5,2,6] +Output: 11 +Explanation: i = 0, j = 2, A[i] + A[j] + i - j = 8 + 5 + 0 - 2 = 11 +``` + +Note: + +- `2 <= A.length <= 50000` +- `1 <= A[i] <= 1000` diff --git a/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair.go b/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair.go new file mode 100755 index 000000000..bad3da607 --- /dev/null +++ b/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair.go @@ -0,0 +1,18 @@ +package problem1014 + +func maxScoreSightseeingPair(A []int) int { + a := A[0] // a is A[i]+i + res := 0 + for j := 1; j < len(A); j++ { + res = max(res, a+A[j]-j) + a = max(a, A[j]+j) + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair_test.go b/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair_test.go new file mode 100755 index 000000000..192a62a49 --- /dev/null +++ b/Algorithms/1014.best-sightseeing-pair/best-sightseeing-pair_test.go @@ -0,0 +1,42 @@ +package problem1014 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, 2}, + 2, + }, + + { + []int{8, 1, 5, 2, 6}, + 11, + }, + + // 可以有多个 testcase +} + +func Test_maxScoreSightseeingPair(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxScoreSightseeingPair(tc.A), "输入:%v", tc) + } +} + +func Benchmark_maxScoreSightseeingPair(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxScoreSightseeingPair(tc.A) + } + } +} diff --git a/Algorithms/1015.smallest-integer-divisible-by-k/README.md b/Algorithms/1015.smallest-integer-divisible-by-k/README.md new file mode 100755 index 000000000..00fc5ecbc --- /dev/null +++ b/Algorithms/1015.smallest-integer-divisible-by-k/README.md @@ -0,0 +1,33 @@ +# [1015. Smallest Integer Divisible by K](https://leetcode.com/problems/smallest-integer-divisible-by-k/) + +Given a positive integer K, you need find the smallest positive integer N such that N is divisible by K, and N only contains the digit 1. + +Return the length of N. If there is no such N, return -1. + +Example 1: + +```text +Input: 1 +Output: 1 +Explanation: The smallest answer is N = 1, which has length 1. +``` + +Example 2: + +```text +Input: 2 +Output: -1 +Explanation: There is no such positive integer N divisible by 2. +``` + +Example 3: + +```text +Input: 3 +Output: 3 +Explanation: The smallest answer is N = 111, which has length 3. +``` + +Note: + +- `1 <= K <= 10^5` diff --git a/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k.go b/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k.go new file mode 100755 index 000000000..a58cb66be --- /dev/null +++ b/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k.go @@ -0,0 +1,16 @@ +package problem1015 + +// ref: https://leetcode.com/problems/smallest-integer-divisible-by-k/discuss/260852/JavaC%2B%2BPython-O(1)-Space-with-Proves-of-Pigeon-Holes +func smallestRepunitDivByK(K int) int { + if K%2 == 0 || K%5 == 0 { + return -1 + } + + r, length := 1%K, 1 + for r != 0 && length <= K { + r = (r*10 + 1) % K + length++ + } + + return length +} diff --git a/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k_test.go b/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k_test.go new file mode 100755 index 000000000..66fd784a3 --- /dev/null +++ b/Algorithms/1015.smallest-integer-divisible-by-k/smallest-integer-divisible-by-k_test.go @@ -0,0 +1,57 @@ +package problem1015 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + K int + ans int +}{ + + { + 23, + 22, + }, + + { + 5, + -1, + }, + + { + 1, + 1, + }, + + { + 2, + -1, + }, + + { + 3, + 3, + }, + + // 可以有多个 testcase +} + +func Test_smallestRepunitDivByK(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, smallestRepunitDivByK(tc.K), "输入:%v", tc) + } +} + +func Benchmark_smallestRepunitDivByK(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestRepunitDivByK(tc.K) + } + } +} diff --git a/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/README.md b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/README.md new file mode 100755 index 000000000..b2390e571 --- /dev/null +++ b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/README.md @@ -0,0 +1,22 @@ +# [1016. Binary String With Substrings Representing 1 To N](https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n/) + +Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return true if and only if for every integer X from 1 to N, the binary representation of X is a substring of S. + +Example 1: + +```text +Input: S = "0110", N = 3 +Output: true +``` + +Example 2: + +```text +Input: S = "0110", N = 4 +Output: false +``` + +Note: + +- `1 <= S.length <= 1000` +- `1 <= N <= 10^9` diff --git a/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.go b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.go new file mode 100755 index 000000000..be4db217c --- /dev/null +++ b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n.go @@ -0,0 +1,33 @@ +package problem1016 + +import "strings" + +func queryString(S string, N int) bool { + end := N >> 1 + for N >= end { + if !strings.Contains(S, binaryString(N)) { + return false + } + N-- + } + return true +} + +func binaryString(n int) string { + B := make([]byte, 0, 30) + for n > 0 { + B = append(B, byte(n&1)+'0') + n >>= 1 + } + swap(B) + return string(B) +} + +func swap(B []byte) { + i, j := 0, len(B)-1 + for i < j { + B[i], B[j] = B[j], B[i] + i++ + j-- + } +} diff --git a/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n_test.go b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n_test.go new file mode 100755 index 000000000..bb5964ade --- /dev/null +++ b/Algorithms/1016.binary-string-with-substrings-representing-1-to-n/binary-string-with-substrings-representing-1-to-n_test.go @@ -0,0 +1,57 @@ +package problem1016 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + N int + ans bool +}{ + + { + "001111111000111011100110001001011100001101011001000100000001111100100001101100010010100111111100010101000000001010101011111001010111100000001110000001111000100001101010011010111101101000101101001110011000110110000110010111011100100101111000010011111001000001001000011011000111110010001010110101110011010000101001110000010111100001111011110000100000011000111111011101001011110111001110000011100100101001100001100111010010111111111000011110001110100010001000000101110000010100100111100010001111111110100001111000101001111110000011000001000001110011011011100010101010111110101110101110010111000110111110", + 30, + true, + }, + + { + "0110", + 3, + true, + }, + + { + "01010", + 4, + false, + }, + + { + "0110", + 4, + false, + }, + + // 可以有多个 testcase +} + +func Test_queryString(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, queryString(tc.S, tc.N), "输入:%v", tc) + } +} + +func Benchmark_queryString(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + queryString(tc.S, tc.N) + } + } +} diff --git a/Algorithms/1017.convert-to-base-2/README.md b/Algorithms/1017.convert-to-base-2/README.md new file mode 100755 index 000000000..9d7a8222c --- /dev/null +++ b/Algorithms/1017.convert-to-base-2/README.md @@ -0,0 +1,33 @@ +# [1017. Convert to Base -2](https://leetcode.com/problems/convert-to-base-2/) + +Given a number N, return a string consisting of "0"s and "1"s that represents its value in base -2 (negative two). + +The returned string must have no leading zeroes, unless the string is "0". + +Example 1: + +```text +Input: 2 +Output: "110" +Explanation: (-2) ^ 2 + (-2) ^ 1 = 2 +``` + +Example 2: + +```text +Input: 3 +Output: "111" +Explanation: (-2) ^ 2 + (-2) ^ 1 + (-2) ^ 0 = 3 +``` + +Example 3: + +```text +Input: 4 +Output: "100" +Explanation: (-2) ^ 2 = 4 +``` + +Note: + +- `0 <= N <= 10^9` diff --git a/Algorithms/1017.convert-to-base-2/convert-to-base-2.go b/Algorithms/1017.convert-to-base-2/convert-to-base-2.go new file mode 100755 index 000000000..a23fb11d0 --- /dev/null +++ b/Algorithms/1017.convert-to-base-2/convert-to-base-2.go @@ -0,0 +1,39 @@ +package problem1017 + +func baseNeg2(N int) string { + if N == 0 { + return "0" + } + + B := make([]byte, 0, 30) + for N > 0 { + switch N & 3 { + case 0, 1: + B = append(B, byte(N&1)+'0', '0') + default: // 2,3 + B = append(B, byte(N&1)+'0', '1') + N += 4 + // 2^(2n)-2^(2n-1) == 2^(2n-1) + // 所以,把 N 转换成二进制后,每在奇数位上看见 1 就在其左边的偶数位上加 1 + // 就可以转换成以 -2 为基的二进制了 + } + N >>= 2 + } + + swap(B) + + if B[0] == '0' { // no lead 0 except for N is 0 + B = B[1:] + } + + return string(B) +} + +func swap(B []byte) { + i, j := 0, len(B)-1 + for i < j { + B[i], B[j] = B[j], B[i] + i++ + j-- + } +} diff --git a/Algorithms/1017.convert-to-base-2/convert-to-base-2_test.go b/Algorithms/1017.convert-to-base-2/convert-to-base-2_test.go new file mode 100755 index 000000000..712dc1373 --- /dev/null +++ b/Algorithms/1017.convert-to-base-2/convert-to-base-2_test.go @@ -0,0 +1,57 @@ +package problem1017 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans string +}{ + + { + 0, + "0", + }, + + { + 6, + "11010", + }, + + { + 2, + "110", + }, + + { + 3, + "111", + }, + + { + 4, + "100", + }, + + // 可以有多个 testcase +} + +func Test_baseNeg2(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, baseNeg2(tc.N), "输入:%v", tc) + } +} + +func Benchmark_baseNeg2(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + baseNeg2(tc.N) + } + } +} diff --git a/Algorithms/1018.binary-prefix-divisible-by-5/README.md b/Algorithms/1018.binary-prefix-divisible-by-5/README.md new file mode 100755 index 000000000..4277120eb --- /dev/null +++ b/Algorithms/1018.binary-prefix-divisible-by-5/README.md @@ -0,0 +1,40 @@ +# [1018. Binary Prefix Divisible By 5](https://leetcode.com/problems/binary-prefix-divisible-by-5/) + +Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to least-significant-bit.) + +Return a list of booleans answer, where answer[i] is true if and only if N_i is divisible by 5. + +Example 1: + +```text +Input: [0,1,1] +Output: [true,false,false] +Explanation: +The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in base-10. Only the first number is divisible by 5, so answer[0] is true. +``` + +Example 2: + +```text +Input: [1,1,1] +Output: [false,false,false] +``` + +Example 3: + +```text +Input: [0,1,1,1,1,1] +Output: [true,false,false,false,true,false] +``` + +Example 4: + +```text +Input: [1,1,1,0,1] +Output: [false,false,false,false,false] +``` + +Note: + +- `1 <= A.length <= 30000` +- `A[i] is 0 or 1` diff --git a/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5.go b/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5.go new file mode 100755 index 000000000..aefb4e8b4 --- /dev/null +++ b/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5.go @@ -0,0 +1,11 @@ +package problem1018 + +func prefixesDivBy5(A []int) []bool { + res := make([]bool, len(A)) + r := 0 + for i, a := range A { + r = (r*2 + a) % 5 + res[i] = r == 0 + } + return res +} diff --git a/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5_test.go b/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5_test.go new file mode 100755 index 000000000..a2d8bd956 --- /dev/null +++ b/Algorithms/1018.binary-prefix-divisible-by-5/binary-prefix-divisible-by-5_test.go @@ -0,0 +1,57 @@ +package problem1018 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans []bool +}{ + + { + []int{1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1,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0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}, + []bool{false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, false, false, true, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, false, false, false, false, true, true, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, false, false, true, true, true, true, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, true, false, false, true, false, false, false, true, true, true, true, true, true, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, true, true, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, true, true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, false, false, true, false, false, true, true, false, false, false, true, true, false, false, false, false, false, false, false, true, false, false, false, true, true, true, true, true, true, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, false, false, false, true, true, true, true, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, true, true, true, true, false, false, true, false, false, false, false, false, false, true, false, false, false, true, true, true, true, true, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, true, true, true, false, false, true, false, false, false, false, false, false, false, false, true, true, true, true, true, true, false, false, false, false, false, false, true, true, false, false, true, true, true, false, false, true, false, false, false, true, false, false, true, true, true, false, false, false, false, true, true, false, false, true, true, false, false, false, false, false, false, true, false, false, false, false, false, false, false}, + }, + + { + []int{0, 1, 1}, + []bool{true, false, false}, + }, + + { + []int{1, 1, 1}, + []bool{false, false, false}, + }, + + { + []int{0, 1, 1, 1, 1, 1}, + []bool{true, false, false, false, true, false}, + }, + + { + []int{1, 1, 1, 0, 1}, + []bool{false, false, false, false, false}, + }, + + // 可以有多个 testcase +} + +func Test_prefixesDivBy5(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, prefixesDivBy5(tc.A), "输入:%v", tc) + } +} + +func Benchmark_prefixesDivBy5(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + prefixesDivBy5(tc.A) + } + } +} diff --git a/Algorithms/1019.next-greater-node-in-linked-list/README.md b/Algorithms/1019.next-greater-node-in-linked-list/README.md new file mode 100755 index 000000000..b4f82657c --- /dev/null +++ b/Algorithms/1019.next-greater-node-in-linked-list/README.md @@ -0,0 +1,35 @@ +# [1019. Next Greater Node In Linked List](https://leetcode.com/problems/next-greater-node-in-linked-list/) + +We are given a linked list with head as the first node. Let's number the nodes in the list: node_1, node_2, node_3, ... etc. + +Each node may have a next larger value: for node_i, next_larger(node_i) is the node_j.val such that j > i, node_j.val > node_i.val, and j is the smallest possible choice. If such a j does not exist, the next larger value is 0. + +Return an array of integers answer, where answer[i] = next_larger(node_{i+1}). + +Note that in the example inputs (not outputs) below, arrays such as [2,1,5] represent the serialization of a linked list with a head node value of 2, second node value of 1, and third node value of 5. + +Example 1: + +```text +Input: [2,1,5] +Output: [5,5,0] +``` + +Example 2: + +```text +Input: [2,7,4,3,5] +Output: [7,0,5,5,0] +``` + +Example 3: + +```text +Input: [1,7,5,1,9,2,5,1] +Output: [7,9,9,9,0,5,0,0] +``` + +Note: + +- 1 <= node.val <= 10^9 for each node in the linked list. +- The given list has length in the range [0, 10000]. diff --git a/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list.go b/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list.go new file mode 100755 index 000000000..cdb166f8f --- /dev/null +++ b/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list.go @@ -0,0 +1,30 @@ +package problem1019 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is pre-defined... +type ListNode = kit.ListNode + +func nextLargerNodes(head *ListNode) []int { + A := convert(head) + res := make([]int, len(A)) + stack, peek := make([]int, len(A)), -1 + for i := 0; i < len(A); i++ { + for peek >= 0 && A[stack[peek]] < A[i] { + res[stack[peek]] = A[i] + peek-- + } + peek++ + stack[peek] = i + } + return res +} + +func convert(head *ListNode) []int { + res := make([]int, 0, 1024) + for head != nil { + res = append(res, head.Val) + head = head.Next + } + return res +} diff --git a/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list_test.go b/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list_test.go new file mode 100755 index 000000000..aeab2d73e --- /dev/null +++ b/Algorithms/1019.next-greater-node-in-linked-list/next-greater-node-in-linked-list_test.go @@ -0,0 +1,56 @@ +package problem1019 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{225, 172, 286, 36, 70, 170, 19, 187, 206, 132, 239, 79, 58, 236, 117, 139, 278, 222, 257, 168, 152, 121, 205, 103, 130, 209, 220, 90, 263, 171, 116, 297, 165, 20, 246, 225, 205, 9, 103, 220, 14, 166, 269, 135, 214, 11, 297, 268, 214, 227, 256, 157, 106, 153, 261, 156, 165, 242, 297, 235, 297, 219, 215, 127, 258, 230, 47, 231, 7, 183, 150, 140, 288, 47, 269, 252, 41, 115, 13, 119, 273, 199, 149, 142, 175, 172, 107, 255, 53, 23, 270, 226, 146, 159, 170, 105, 5, 106, 238, 50, 210, 175, 258, 269, 272, 283, 1, 154, 269, 9, 81, 176, 252, 82, 272, 143, 66, 161, 238, 88, 251, 179, 8, 125, 37, 271, 22, 269, 268, 29, 50, 159, 151, 203, 127, 297, 275, 29, 299, 135, 219, 118, 94, 106, 89, 279, 178, 49, 159, 270, 263, 7, 85, 122, 249, 181, 276, 68, 56, 209, 128, 151, 218, 30, 70, 53, 11, 145, 153, 88, 51, 128, 101, 152, 102, 40, 115, 161, 177, 58, 276, 179, 242, 208, 269, 241, 4, 38, 217, 237, 4, 200, 189, 40, 8, 183, 196, 49, 57, 63, 157, 59, 203, 35, 269, 28, 231, 88, 272, 234, 128, 198, 122, 201, 289, 236, 1, 148, 21, 253, 111, 178, 279, 69, 122, 49, 2, 137, 221, 187, 290, 288, 296, 158, 250, 295, 44, 245, 66, 72, 129, 23, 34, 125, 288, 59, 26, 25, 135, 181, 171, 49, 80, 161, 193, 249, 284, 89, 125, 130, 81, 43, 15, 156, 228, 124, 62, 24, 83, 11, 117, 78, 146, 54, 95, 153, 189, 264, 282, 139, 82, 122, 49, 137, 88, 278, 56, 117, 105, 300, 14, 87, 243, 27, 113, 65, 30, 161, 91, 175}, + []int{286, 286, 297, 70, 170, 187, 187, 206, 239, 239, 278, 236, 236, 278, 139, 278, 297, 257, 263, 205, 205, 205, 209, 130, 209, 220, 263, 263, 297, 297, 297, 299, 246, 246, 269, 269, 220, 103, 220, 269, 166, 269, 297, 214, 297, 297, 299, 297, 227, 256, 261, 261, 153, 261, 297, 165, 242, 297, 299, 297, 299, 258, 258, 258, 288, 231, 231, 288, 183, 288, 288, 288, 297, 269, 273, 273, 115, 119, 119, 273, 283, 255, 175, 175, 255, 255, 255, 270, 270, 270, 272, 238, 159, 170, 238, 106, 106, 238, 258, 210, 258, 258, 269, 272, 283, 297, 154, 269, 272, 81, 176, 252, 272, 272, 297, 161, 161, 238, 251, 251, 271, 271, 125, 271, 271, 297, 269, 297, 297, 50, 159, 203, 203, 297, 297, 299, 299, 299, 300, 219, 279, 279, 106, 279, 279, 289, 270, 159, 270, 276, 276, 85, 122, 249, 276, 276, 289, 209, 209, 218, 151, 218, 276, 70, 145, 145, 145, 153, 161, 128, 128, 152, 152, 161, 115, 115, 161, 177, 276, 276, 289, 242, 269, 269, 272, 269, 38, 217, 237, 269, 200, 203, 196, 183, 183, 196, 203, 57, 63, 157, 203, 203, 269, 269, 272, 231, 272, 272, 289, 289, 198, 201, 201, 289, 290, 253, 148, 253, 253, 279, 178, 279, 290, 122, 137, 137, 137, 221, 290, 290, 296, 296, 300, 250, 295, 300, 245, 288, 72, 129, 288, 34, 125, 288, 300, 135, 135, 135, 181, 193, 193, 80, 161, 193, 249, 284, 300, 125, 130, 156, 156, 156, 156, 228, 264, 146, 83, 83, 117, 117, 146, 146, 153, 95, 153, 189, 264, 282, 300, 278, 122, 137, 137, 278, 278, 300, 117, 300, 300, 0, 87, 243, 0, 113, 161, 161, 161, 175, 175, 0}, + }, + + { + []int{2, 1, 5}, + []int{5, 5, 0}, + }, + + { + []int{2, 7, 4, 3, 5}, + []int{7, 0, 5, 5, 0}, + }, + + { + []int{1, 7, 5, 1, 9, 2, 5, 1}, + []int{7, 9, 9, 9, 0, 5, 0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_nextLargerNodes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + ast.Equal(tc.ans, nextLargerNodes(head), "输入:%v", tc) + } +} + +func Benchmark_nextLargerNodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + nextLargerNodes(head) + } + } +} diff --git a/Algorithms/1020.number-of-enclaves/README.md b/Algorithms/1020.number-of-enclaves/README.md new file mode 100755 index 000000000..be6c21183 --- /dev/null +++ b/Algorithms/1020.number-of-enclaves/README.md @@ -0,0 +1,32 @@ +# [1020. Number of Enclaves](https://leetcode.com/problems/number-of-enclaves/) + +Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land) + +A move consists of walking from one land square 4-directionally to another land square, or off the boundary of the grid. + +Return the number of land squares in the grid for which we cannot walk off the boundary of the grid in any number of moves. + +Example 1: + +```text +Input: [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]] +Output: 3 +Explanation: +There are three 1s that are enclosed by 0s, and one 1 that isn't enclosed because its on the boundary. +``` + +Example 2: + +```text +Input: [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]] +Output: 0 +Explanation: +All 1s are either on the boundary or can reach the boundary. +``` + +Note: + +- 1 <= A.length <= 500 +- 1 <= A[i].length <= 500 +- 0 <= A[i][j] <= 1 +- All rows have the same size. diff --git a/Algorithms/1020.number-of-enclaves/number-of-enclaves.go b/Algorithms/1020.number-of-enclaves/number-of-enclaves.go new file mode 100755 index 000000000..360588a7c --- /dev/null +++ b/Algorithms/1020.number-of-enclaves/number-of-enclaves.go @@ -0,0 +1,44 @@ +package problem1020 + +var dx = [4]int{-1, 1, 0, 0} +var dy = [4]int{0, 0, -1, 1} + +func numEnclaves(A [][]int) int { + m, n := len(A), len(A[0]) + + var dfs func(int, int) + dfs = func(x, y int) { + if x < 0 || m <= x || + y < 0 || n <= y || + A[x][y] == 0 { + return + } + A[x][y] = 0 + for i := 0; i < 4; i++ { + dfs(x+dx[i], y+dy[i]) + } + } + + line := func(i, di, j, dj int) { + for i < m && j < n { + dfs(i, j) + i += di + j += dj + } + } + + // search from the boundary + line(0, 0, 0, 1) // top + line(m-1, 0, 0, 1) // down + line(0, 1, 0, 0) // left + line(0, 1, n-1, 0) // right + + res := 0 + for i := 0; i < m; i++ { + for j := 0; j < n; j++ { + res += A[i][j] + } + } + + return res +} diff --git a/Algorithms/1020.number-of-enclaves/number-of-enclaves_test.go b/Algorithms/1020.number-of-enclaves/number-of-enclaves_test.go new file mode 100755 index 000000000..572f80e79 --- /dev/null +++ b/Algorithms/1020.number-of-enclaves/number-of-enclaves_test.go @@ -0,0 +1,42 @@ +package problem1020 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A [][]int + ans int +}{ + + { + [][]int{{0, 0, 0, 0}, {1, 0, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}}, + 3, + }, + + { + [][]int{{0, 1, 1, 0}, {0, 0, 1, 0}, {0, 0, 1, 0}, {0, 0, 0, 0}}, + 0, + }, + + // 可以有多个 testcase +} + +func Test_numEnclaves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numEnclaves(tc.A), "输入:%v", tc) + } +} + +func Benchmark_numEnclaves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numEnclaves(tc.A) + } + } +} diff --git a/Algorithms/1021.remove-outermost-parentheses/README.md b/Algorithms/1021.remove-outermost-parentheses/README.md new file mode 100755 index 000000000..835ba4e8e --- /dev/null +++ b/Algorithms/1021.remove-outermost-parentheses/README.md @@ -0,0 +1,45 @@ +# [1021. Remove Outermost Parentheses](https://leetcode.com/problems/remove-outermost-parentheses/) + +A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation. For example, "", "()", "(())()", and "(()(()))" are all valid parentheses strings. + +A valid parentheses string S is primitive if it is nonempty, and there does not exist a way to split it into S = A+B, with A and B nonempty valid parentheses strings. + +Given a valid parentheses string S, consider its primitive decomposition: S = P_1 + P_2 + ... + P_k, where P_i are primitive valid parentheses strings. + +Return S after removing the outermost parentheses of every primitive string in the primitive decomposition of S. + +Example 1: + +```text +Input: "(()())(())" +Output: "()()()" +Explanation: +The input string is "(()())(())", with primitive decomposition "(()())" + "(())". +After removing outer parentheses of each part, this is "()()" + "()" = "()()()". +``` + +Example 2: + +```text +Input: "(()())(())(()(()))" +Output: "()()()()(())" +Explanation: +The input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))". +After removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())". +``` + +Example 3: + +```text +Input: "()()" +Output: "" +Explanation: +The input string is "()()", with primitive decomposition "()" + "()". +After removing outer parentheses of each part, this is "" + "" = "". +``` + +Note: + +- S.length <= 10000 +- S[i] is "(" or ")" +- S is a valid parentheses string \ No newline at end of file diff --git a/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses.go b/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses.go new file mode 100755 index 000000000..62138882d --- /dev/null +++ b/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses.go @@ -0,0 +1,20 @@ +package problem1021 + +import "strings" + +func removeOuterParentheses(S string) string { + var sb strings.Builder + i, count, size := 0, 0, len(S) + for j := 0; j < size; j++ { + if S[j] == '(' { + count++ + continue + } + count-- + if count == 0 { // S[i] and S[j] are outer parentheses + sb.WriteString(S[i+1 : j]) + i = j + 1 + } + } + return sb.String() +} diff --git a/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses_test.go b/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses_test.go new file mode 100755 index 000000000..ecda02191 --- /dev/null +++ b/Algorithms/1021.remove-outermost-parentheses/remove-outermost-parentheses_test.go @@ -0,0 +1,52 @@ +package problem1021 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "((())())(())()((()))()()()()()((()())())()()(((()())))()(()())()(())()()()((()()(())))(((()())))()()()()()()()(())()(())(()())()((()))()()(())()(())()()()(())()()()()()()()()()()()()()(())()(((())))(())()(()(()))()()()((()()))()((()))()()()()()()()()()()()(())()()()(())()(())(())()()(())()()()()()()()()()()()()()()()()()()(()())()()(())(()())()()()()()()()((()))()()()(())(())()()()()(())((())())(())(())(()()())((()))()()()(())()()()()(())(())()((()))()((()))()((((())(())))())()(())()()()()((())())((())((()()()()())))()()()()(()())()()(()(()))()()()()()()(()(()(())((()))(())))(())(((()))(((()()()))))()(()()()())()((()()(())))()()()()(())()()()(())()()(((())))(())()(())()()()()()()()()()()()()()(())((((((()()))(())())())))()()(())()()()()()()()()((()))()()(())()()()(()())()()()()(())(())()()()()()()()()()()()((()((((()))()))))((()))(())()(()())(())(((()())())())(())(((())))()()()()()()()()()((((()((()))))())())()()()((()()(()()))((()()))()(()()))()(())(((())))()()()()((()()))(())(())()()", + "(())()()(())(()())()((()()))()()()(()()(()))((()()))()()()()(())()()()()((()))()()(())(()())(())()()()()()()()()()()(())()()()(())()()()()()()(())()()()(())(())(((())(())))()()(())()(())((()()()()()))()()()(())()(()(())((()))(()))()((()))(((()()())))()()()()(()()(()))()()((()))()()()(((((()()))(())())()))()(())()()()()()(()((((()))())))(())()()()()((()())())()()((()))(((()((()))))())()(()()(()()))((()()))()(()())()((()))(()())()()", + }, + + { + "(()())(())", + "()()()", + }, + + { + "(()())(())(()(()))", + "()()()()(())", + }, + + { + "()()", + "", + }, + + // 可以有多个 testcase +} + +func Test_removeOuterParentheses(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, removeOuterParentheses(tc.S), "输入:%v", tc) + } +} + +func Benchmark_removeOuterParentheses(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeOuterParentheses(tc.S) + } + } +} diff --git a/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/1.png b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/1.png new file mode 100644 index 000000000..eb175e7c6 Binary files /dev/null and b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/1.png differ diff --git a/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/README.md b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/README.md new file mode 100755 index 000000000..d05d018f3 --- /dev/null +++ b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/README.md @@ -0,0 +1,23 @@ +# [1022. Sum of Root To Leaf Binary Numbers](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/) + +Given a binary tree, each node has value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represent 01101 in binary, which is 13. + +For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. + +Return the sum of these numbers. + +Example 1: + +![1](1.png) + +```text +Input: [1,0,1,0,1,0,1] +Output: 22 +Explanation: (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22 +``` + +Note: + +1. The number of nodes in the tree is between 1 and 1000. +1. node.val is 0 or 1. +1. The answer will not exceed 2^31 - 1. diff --git a/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers.go b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers.go new file mode 100755 index 000000000..f6cf066aa --- /dev/null +++ b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers.go @@ -0,0 +1,26 @@ +package problem1022 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func sumRootToLeaf(root *TreeNode) int { + return dfs(root, 0) +} + +func dfs(node *TreeNode, b int) int { + if node == nil { + return 0 + } + b = b*2 + node.Val + if node.Left == node.Right { // both nil + return b + } + return dfs(node.Left, b) + dfs(node.Right, b) +} diff --git a/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers_test.go b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers_test.go new file mode 100755 index 000000000..f0ff2d1ee --- /dev/null +++ b/Algorithms/1022.sum-of-root-to-leaf-binary-numbers/sum-of-root-to-leaf-binary-numbers_test.go @@ -0,0 +1,51 @@ +package problem1022 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans int +}{ + + { + []int{1, kit.NULL, 0}, + 2, + }, + + { + []int{1, 1}, + 3, + }, + + { + []int{1, 0, 1, 0, 1, 0, 1}, + 22, + }, + + // 可以有多个 testcase +} + +func Test_sumRootToLeaf(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, sumRootToLeaf(root), "输入:%v", tc) + } +} + +func Benchmark_sumRootToLeaf(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + sumRootToLeaf(root) + } + } +} diff --git a/Algorithms/1023.camelcase-matching/README.md b/Algorithms/1023.camelcase-matching/README.md new file mode 100755 index 000000000..7bc5fe089 --- /dev/null +++ b/Algorithms/1023.camelcase-matching/README.md @@ -0,0 +1,42 @@ +# [1023. Camelcase Matching](https://leetcode.com/problems/camelcase-matching/) + +A query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.) + +Given a list of queries, and a pattern, return an answer list of booleans, where answer[i] is true if and only if queries[i] matches the pattern. + +Example 1: + +```text +Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB" +Output: [true,false,true,true,false] +Explanation: +"FooBar" can be generated like this "F" + "oo" + "B" + "ar". +"FootBall" can be generated like this "F" + "oot" + "B" + "all". +"FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer". +``` + +Example 2: + +```text +Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBa" +Output: [true,false,true,false,false] +Explanation: +"FooBar" can be generated like this "Fo" + "o" + "Ba" + "r". +"FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll". +``` + +Example 3: + +```text +Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBaT" +Output: [false,true,false,false,false] +Explanation: +"FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est". +``` + +Note: + +- 1 <= queries.length <= 100 +- 1 <= queries[i].length <= 100 +- 1 <= pattern.length <= 100 +- All strings consists only of lower and upper case English letters. diff --git a/Algorithms/1023.camelcase-matching/camelcase-matching.go b/Algorithms/1023.camelcase-matching/camelcase-matching.go new file mode 100755 index 000000000..93557de1b --- /dev/null +++ b/Algorithms/1023.camelcase-matching/camelcase-matching.go @@ -0,0 +1,25 @@ +package problem1023 + +func camelMatch(queries []string, pattern string) []bool { + pr, pn := []rune(pattern), len(pattern) + + check := func(q string) bool { + pi := 0 + for _, r := range q { + if pi < pn && pr[pi] == r { + pi++ + continue + } + if 'A' <= r && r <= 'Z' { + return false + } + } + return pi == pn + } + + res := make([]bool, len(queries)) + for i, q := range queries { + res[i] = check(q) + } + return res +} diff --git a/Algorithms/1023.camelcase-matching/camelcase-matching_test.go b/Algorithms/1023.camelcase-matching/camelcase-matching_test.go new file mode 100755 index 000000000..718afe7f3 --- /dev/null +++ b/Algorithms/1023.camelcase-matching/camelcase-matching_test.go @@ -0,0 +1,63 @@ +package problem1023 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + queries []string + pattern string + ans []bool +}{ + + { + []string{"IXfGawluvnCa", "IsXfGaxwulCa", "IXfGawlqtCva", "IXjfGawlmeCa", "IXfGnaynwlCa", "IXfGcamwelCa"}, + "IXfGawlCa", + []bool{true, true, true, true, true, true}, + }, + + { + []string{"CompetitiveProgramming", "CounterPick", "ControlPanel"}, + "CooP", + []bool{false, false, true}, + }, + + { + []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"}, + "FoBaT", + []bool{false, true, false, false, false}, + }, + + { + []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"}, + "FB", + []bool{true, false, true, true, false}, + }, + + { + []string{"FooBar", "FooBarTest", "FootBall", "FrameBuffer", "ForceFeedBack"}, + "FoBa", + []bool{true, false, true, false, false}, + }, + + // 可以有多个 testcase +} + +func Test_camelMatch(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, camelMatch(tc.queries, tc.pattern), "输入:%v", tc) + } +} + +func Benchmark_camelMatch(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + camelMatch(tc.queries, tc.pattern) + } + } +} diff --git a/Algorithms/1024.video-stitching/README.md b/Algorithms/1024.video-stitching/README.md new file mode 100755 index 000000000..b94b86865 --- /dev/null +++ b/Algorithms/1024.video-stitching/README.md @@ -0,0 +1,52 @@ +# [1024. Video Stitching](https://leetcode.com/problems/video-stitching/) + +You are given a series of video clips from a sporting event that lasted T seconds. These video clips can be overlapping with each other and have varied lengths. + +Each video clip clips[i] is an interval: it starts at time clips[i][0] and ends at time clips[i][1]. We can cut these clips into segments freely: for example, a clip [0, 7] can be cut into segments [0, 1] + [1, 3] + [3, 7]. + +Return the minimum number of clips needed so that we can cut the clips into segments that cover the entire sporting event ([0, T]). If the task is impossible, return -1. + +Example 1: + +```text +Input: clips = [[0,2],[4,6],[8,10],[1,9],[1,5],[5,9]], T = 10 +Output: 3 +Explanation: +We take the clips [0,2], [8,10], [1,9]; a total of 3 clips. +Then, we can reconstruct the sporting event as follows: +We cut [1,9] into segments [1,2] + [2,8] + [8,9]. +Now we have segments [0,2] + [2,8] + [8,10] which cover the sporting event [0, 10]. +``` + +Example 2: + +```text +Input: clips = [[0,1],[1,2]], T = 5 +Output: -1 +Explanation: +We can't cover [0,5] with only [0,1] and [0,2]. +``` + +Example 3: + +```text +Input: clips = [[0,1],[6,8],[0,2],[5,6],[0,4],[0,3],[6,7],[1,3],[4,7],[1,4],[2,5],[2,6],[3,4],[4,5],[5,7],[6,9]], T = 9 +Output: 3 +Explanation: +We can take clips [0,4], [4,7], and [6,9]. +``` + +Example 4: + +```text +Input: clips = [[0,4],[2,8]], T = 5 +Output: 2 +Explanation: +Notice you can have extra video after the event ends. +``` + +Note: + +- `1 <= clips.length <= 100` +- `0 <= clips[i][0], clips[i][1] <= 100` +- `0 <= T <= 100` diff --git a/Algorithms/1024.video-stitching/video-stitching.go b/Algorithms/1024.video-stitching/video-stitching.go new file mode 100755 index 000000000..2c1da3f0f --- /dev/null +++ b/Algorithms/1024.video-stitching/video-stitching.go @@ -0,0 +1,31 @@ +package problem1024 + +import "sort" + +func videoStitching(clips [][]int, T int) int { + sort.Slice(clips, func(i int, j int) bool { + return clips[i][0] < clips[j][0] + }) + + res := 0 + + for i, start, end := 0, 0, 0; start < T; start = end { + for i < len(clips) && clips[i][0] <= start { + end = max(end, clips[i][1]) + i++ + } + if start == end { + return -1 + } + res++ + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1024.video-stitching/video-stitching_test.go b/Algorithms/1024.video-stitching/video-stitching_test.go new file mode 100755 index 000000000..f3f130089 --- /dev/null +++ b/Algorithms/1024.video-stitching/video-stitching_test.go @@ -0,0 +1,69 @@ +package problem1024 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + clips [][]int + T int + ans int +}{ + + { + [][]int{{5, 7}, {1, 8}, {0, 0}, {2, 3}, {4, 5}, {0, 6}, {5, 10}, {7, 10}}, + 5, + 1, + }, + + { + [][]int{{0, 2}, {4, 6}, {8, 10}, {1, 9}, {1, 5}, {5, 9}}, + 10, + 3, + }, + + { + [][]int{{1, 1}, {1, 2}}, + 5, + -1, + }, + + { + [][]int{{0, 1}, {1, 2}}, + 5, + -1, + }, + + { + [][]int{{0, 1}, {6, 8}, {0, 2}, {5, 6}, {0, 4}, {0, 3}, {6, 7}, {1, 3}, {4, 7}, {1, 4}, {2, 5}, {2, 6}, {3, 4}, {4, 5}, {5, 7}, {6, 9}}, + 9, + 3, + }, + + { + [][]int{{0, 4}, {2, 8}}, + 5, + 2, + }, + + // 可以有多个 testcase +} + +func Test_videoStitching(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, videoStitching(tc.clips, tc.T), "输入:%v", tc) + } +} + +func Benchmark_videoStitching(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + videoStitching(tc.clips, tc.T) + } + } +} diff --git a/Algorithms/1025.divisor-game/README.md b/Algorithms/1025.divisor-game/README.md new file mode 100755 index 000000000..d314bfab9 --- /dev/null +++ b/Algorithms/1025.divisor-game/README.md @@ -0,0 +1,32 @@ +# [1025. Divisor Game](https://leetcode.com/problems/divisor-game/) + +Alice and Bob take turns playing a game, with Alice starting first. + +Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of: + +- Choosing any x with 0 < x < N and N % x == 0. +- Replacing the number N on the chalkboard with N - x. + +Also, if a player cannot make a move, they lose the game. + +Return True if and only if Alice wins the game, assuming both players play optimally. + +Example 1: + +```text +Input: 2 +Output: true +Explanation: Alice chooses 1, and Bob has no more moves. +``` + +Example 2: + +```text +Input: 3 +Output: false +Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves. +``` + +Note: + +1. `1 <= N <= 1000` diff --git a/Algorithms/1025.divisor-game/divisor-game.go b/Algorithms/1025.divisor-game/divisor-game.go new file mode 100755 index 000000000..cec01691b --- /dev/null +++ b/Algorithms/1025.divisor-game/divisor-game.go @@ -0,0 +1,7 @@ +package problem1025 + +func divisorGame(N int) bool { + return N%2 == 0 +} + +// proof: https://leetcode.com/problems/divisor-game/discuss/274606/JavaC%2B%2BPython-return-N-2-0 diff --git a/Algorithms/1025.divisor-game/divisor-game_test.go b/Algorithms/1025.divisor-game/divisor-game_test.go new file mode 100755 index 000000000..3c65a3b01 --- /dev/null +++ b/Algorithms/1025.divisor-game/divisor-game_test.go @@ -0,0 +1,47 @@ +package problem1025 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + ans bool +}{ + + { + 1000, + true, + }, + + { + 2, + true, + }, + + { + 3, + false, + }, + + // 可以有多个 testcase +} + +func Test_divisorGame(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, divisorGame(tc.N), "输入:%v", tc) + } +} + +func Benchmark_divisorGame(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + divisorGame(tc.N) + } + } +} diff --git a/Algorithms/1026.maximum-difference-between-node-and-ancestor/1.jpg b/Algorithms/1026.maximum-difference-between-node-and-ancestor/1.jpg new file mode 100644 index 000000000..d69738990 Binary files /dev/null and b/Algorithms/1026.maximum-difference-between-node-and-ancestor/1.jpg differ diff --git a/Algorithms/1026.maximum-difference-between-node-and-ancestor/README.md b/Algorithms/1026.maximum-difference-between-node-and-ancestor/README.md new file mode 100755 index 000000000..ab5c21e3a --- /dev/null +++ b/Algorithms/1026.maximum-difference-between-node-and-ancestor/README.md @@ -0,0 +1,26 @@ +# [1026. Maximum Difference Between Node and Ancestor](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/) + +Given the root of a binary tree, find the maximum value V for which there exists different nodes A and B where V = |A.val - B.val| and A is an ancestor of B. + +(A node A is an ancestor of B if either: any child of A is equal to B, or any child of A is an ancestor of B.) + +Example 1: + +![1](1.jpg) + +```text +Input: [8,3,10,1,6,null,14,null,null,4,7,13] +Output: 7 +Explanation: +We have various ancestor-node differences, some of which are given below : +|8 - 3| = 5 +|3 - 7| = 4 +|8 - 1| = 7 +|10 - 13| = 3 +Among all possible differences, the maximum value of 7 is obtained by |8 - 1| = 7. +``` + +Note: + +- The number of nodes in the tree is between 2 and 5000. +- Each node will have value between 0 and 100000. diff --git a/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor.go b/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor.go new file mode 100755 index 000000000..86c5e982e --- /dev/null +++ b/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor.go @@ -0,0 +1,38 @@ +package problem1026 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func maxAncestorDiff(root *TreeNode) int { + return dfs(root, root.Val, root.Val) +} + +func dfs(node *TreeNode, Max, Min int) int { + if node == nil { + return Max - Min + // Max 和 Min 都是 node 的父节点的值 + // 所以 + // Max 和 Min 所在的两个节点,肯定是父子关系 + } + + Max = max(Max, node.Val) + Min = min(Min, node.Val) + + return max(dfs(node.Left, Max, Min), dfs(node.Right, Max, Min)) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor_test.go b/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor_test.go new file mode 100755 index 000000000..2823fbdb5 --- /dev/null +++ b/Algorithms/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor_test.go @@ -0,0 +1,46 @@ +package problem1026 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans int +}{ + + { + []int{7, 5, 12, 11, 0, 2, kit.NULL, 4, 17, 6, 19, kit.NULL, 16, 18, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 9, 14, 10, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, kit.NULL, 3, 1, kit.NULL, kit.NULL, 8, kit.NULL, 13, kit.NULL, kit.NULL, 15}, + 19, + }, + + { + []int{8, 3, 10, 1, 6, kit.NULL, 14, kit.NULL, kit.NULL, 4, 7, 13}, + 7, + }, + + // 可以有多个 testcase +} + +func Test_maxAncestorDiff(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, maxAncestorDiff(root), "输入:%v", tc) + } +} + +func Benchmark_maxAncestorDiff(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + maxAncestorDiff(root) + } + } +} diff --git a/Algorithms/1027.longest-arithmetic-sequence/README.md b/Algorithms/1027.longest-arithmetic-sequence/README.md new file mode 100755 index 000000000..b4bcf91c0 --- /dev/null +++ b/Algorithms/1027.longest-arithmetic-sequence/README.md @@ -0,0 +1,37 @@ +# [1027. Longest Arithmetic Sequence](https://leetcode.com/problems/longest-arithmetic-sequence/) + +Given an array A of integers, return the length of the longest arithmetic subsequence in A. + +Recall that a subsequence of A is a list A[i_1], A[i_2], ..., A[i_k] with 0 <= i_1 < i_2 < ... < i_k <= A.length - 1, and that a sequence B is arithmetic if B[i+1] - B[i] are all the same value (for 0 <= i < B.length - 1). + +Example 1: + +```text +Input: [3,6,9,12] +Output: 4 +Explanation: +The whole array is an arithmetic sequence with steps of length = 3. +``` + +Example 2: + +```text +Input: [9,4,7,2,10] +Output: 3 +Explanation: +The longest arithmetic subsequence is [4,7,10]. +``` + +Example 3: + +```text +Input: [20,1,15,3,10,5,8] +Output: 4 +Explanation: +The longest arithmetic subsequence is [20,15,10,5]. +``` + +Note: + +- `2 <= A.length <= 2000` +- `0 <= A[i] <= 10000` diff --git a/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence.go b/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence.go new file mode 100755 index 000000000..36fde551a --- /dev/null +++ b/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence.go @@ -0,0 +1,41 @@ +package problem1027 + +func longestArithSeqLength(A []int) int { + n := len(A) + + indexes := [10001][]int{} + for i := 0; i < n; i++ { + indexes[A[i]] = append(indexes[A[i]], i) + } + + var dfs func(int, int) int + dfs = func(j, diff int) int { + next := A[j] + diff + if next < 0 || 10000 < next { + return 0 + } + for _, k := range indexes[next] { + if j < k { + return 1 + dfs(k, diff) + } + } + return 0 + } + + res := 0 + for i := 0; i < n; i++ { + for j := i + 1; j < n; j++ { + diff := A[j] - A[i] + res = max(res, 2+dfs(j, diff)) + } + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence_test.go b/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence_test.go new file mode 100755 index 000000000..84aab525c --- /dev/null +++ b/Algorithms/1027.longest-arithmetic-sequence/longest-arithmetic-sequence_test.go @@ -0,0 +1,57 @@ +package problem1027 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{9335, 8938, 9465, 1282, 4326, 2363, 290, 9711, 446, 7258, 9783, 8421, 172, 7241, 1736, 211, 1622, 2138, 9260, 8686, 3616, 669, 1588, 4763, 1746, 4735, 4091, 1926, 3895, 7134, 442, 8185, 3356, 4135, 1970, 7322, 8713, 2544, 33, 1356, 1623, 9852, 604, 3639, 6767, 7278, 2518, 1877, 9942, 3709, 8241, 4124, 7358, 5395, 951, 7447, 5246, 9616, 378, 3366, 2585, 1630, 6172, 1952, 9457, 883, 5240, 9981, 6892, 4926, 1613, 1967, 4740, 580, 9591, 5072, 1960, 7203, 8089, 5429, 9700, 6983, 5114, 1577, 5430, 2085, 6190, 247, 8673, 8377, 3410, 9676, 6819, 6336, 3154, 884, 2397, 6302, 195, 9775, 1420, 4734, 579, 4397, 1156, 2942, 2286, 6881, 3877, 3301, 4470, 9053, 8339, 9824, 3765, 1330, 8218, 9249, 3191, 9642, 4955, 7710, 1460, 3939, 9523, 1759, 2400, 4705, 9305, 863, 7087, 9811, 3057, 1593, 6093, 9352, 5002, 2291, 6204, 8748, 1234, 6182, 1372, 656, 5449, 3911, 7713, 262, 5351, 4804, 6798, 8818, 6761, 8460, 4579, 6234, 2883, 1788, 2943, 2134, 9228, 6400, 7862, 2162, 6852, 8452, 2240, 7287, 5999, 6503, 5025, 4626, 3841, 1432, 6316, 3907, 4362, 5458, 9396, 5906, 3731, 6521, 2011, 7222, 9284, 4235, 1742, 6307, 2758, 6674, 8471, 3079, 1297, 4923, 7536, 7676, 7444, 5698, 778, 9413, 1718, 7636, 6778, 7540, 4789, 9659, 1841, 6253, 9744, 2440, 6824, 6714, 8910, 464, 7434, 6297, 3148, 6094, 1637, 1532, 6173, 8335, 8269, 4637, 3126, 3087, 5875, 3261, 5625, 2553, 5928, 4689, 6016, 2549, 6866, 8724, 3872, 3788, 5797, 6302, 5807, 8668, 9725, 0, 7099, 2296, 5347, 7736, 7199, 2212, 6260, 3451, 7838, 2193, 144, 717, 527, 1841, 2334, 5123, 7909, 6161, 9780, 1853, 7309, 3244, 4193, 7064, 9702, 5082, 8875, 9587, 4791, 1850, 2212, 3745, 815, 8784, 5082, 5720, 34, 5039, 122, 6716, 8268, 4032, 4291, 7524, 5003, 8305, 6305, 6485, 5301, 2902, 9268, 6839, 6671, 8415, 2188, 6638, 1166, 9065, 6302, 5179, 2060, 1271, 3063, 7792, 6191, 2946, 9501, 7711, 6370, 1849, 4187, 5986, 4528, 561, 1792, 5375, 1957, 1159, 2938, 5663, 1647, 1746, 7978, 2093, 5636, 3819, 3404, 66, 8947, 4731, 8849, 3592, 1171, 3599, 8284, 6878, 5091, 2636, 9420, 4199, 7283, 3319, 2864, 1443, 9260, 3762, 1663, 7334, 3768, 2822, 8158, 624, 8319, 1434, 176, 4833, 5179, 2819, 469, 5570, 9179, 450, 6576, 724, 300, 4442, 2131, 7040, 8015, 2947, 4287, 1552, 9898, 2658, 7204, 6528, 4443, 4879, 1482, 6136, 6030, 5757, 8553, 3709, 7029, 2256, 7462, 6560, 2624, 6029, 6704, 2528, 1563, 6578, 3067, 6656, 3250, 299, 1699, 8638, 719, 4870, 4575, 114, 3874, 2361, 8271, 9473, 7385, 4829, 7048, 7588, 6534, 356, 5322, 7909, 6750, 4294, 435, 1170, 8000, 1334, 9829, 8486, 1591, 2630, 8521, 8851, 3836, 5852, 2416, 7585, 5709, 9479, 2328, 4010, 9319, 9201, 8279, 5065, 5798, 7814, 9942, 7593, 6276, 3383, 3401, 9741, 2465, 8317, 2508, 8379, 5353, 7878, 9394, 854, 1389, 3950, 5976, 6409, 9113, 1784, 7145, 3618, 2740, 5598, 6655, 7364, 7105, 971, 9575, 554, 5993, 7747, 8911, 729, 2180, 1032, 6178, 5201, 9941, 6054, 9675, 2761, 7377, 8788, 2361, 6556, 193, 9291, 2990, 7289, 6625, 3105, 9472, 8322, 9927, 3272, 6479, 852, 2109, 8630, 9605, 5942, 1363, 7093, 1817, 2890, 459, 1357, 3489, 3947, 5048, 4333, 9187, 4543, 7521, 1157, 427, 6625, 8979, 6877, 2492, 8667, 6413, 7865, 5041, 7902, 6910, 8628, 5527, 8692, 6988, 7623, 3094, 9098, 5858, 6869, 7916, 6812, 1826, 7689, 6270, 4319, 7932, 4319, 8920, 3392, 7610, 8372, 1202, 2951, 8875, 6576, 3329, 2789, 5323, 3596, 879, 2936, 5917, 502, 3864, 6787, 5770, 760, 8288, 6200, 4667, 2266, 9264, 6943, 4955, 2881, 3054, 6686, 4164, 1387, 5469, 8386, 8018, 4854, 4021, 649, 594, 1495, 3359, 5588, 7587, 8314, 7961, 8489, 4375, 5030, 4501, 4691, 1184, 6610, 4176, 2724, 7044, 3308, 967, 7114, 7663, 5328, 2761, 5822, 5044, 5677, 6736, 491, 5498, 6258, 1837, 5695, 3686, 1729, 8985, 8312, 4364, 2134, 6307, 1245, 3977, 3244, 6808, 4161, 5205, 6269, 9963, 4819, 359, 1616, 8619, 2837, 8717, 4402, 8795, 6468, 3837, 2783, 5151, 3394, 7725, 8915, 5216, 9901, 2026, 3209, 1238, 787, 8689, 3074, 7479, 9702, 213, 7609, 9523, 7997, 5422, 4225, 5283, 2974, 7570, 560, 6220, 9354, 9470, 5317, 7128, 8363, 1809, 3877, 1985, 8109, 8651, 2283, 8733, 2847, 4344, 971, 5062, 2599, 7647, 7399, 4068, 765, 6991, 8782, 3804, 8242, 1005, 3963, 964, 1104, 1987, 9710, 7305, 4806, 6434, 6664, 3934, 368, 75, 6902, 649, 9542, 1205, 6645, 8854, 388, 3267, 4254, 2701, 1271, 777, 1409, 3892, 3449, 4967, 3247, 102, 8015, 4541, 572, 6227, 1628, 9690, 9077, 2885, 511, 1747, 9630, 3113, 9509, 5298, 1415, 7406, 4127, 7448, 1591, 6762, 5740, 8915, 7857, 2506, 7275, 4357, 9182, 3441, 2577, 3512, 8575, 6055, 933, 8002, 9756, 1120, 2823, 1704, 2248, 4510, 7587, 2551, 4669, 2678, 2039, 119, 6264, 6923, 2811, 3366, 299, 3286, 8344, 3958, 2417, 1486, 7878, 4721, 6709, 2429, 6569, 9472, 562, 9857, 6239, 9034, 1325, 3799, 7265, 9010, 2120, 3271, 8492, 5894, 2864, 7101, 7272, 8913, 1500, 3034, 2286, 1422, 3191, 3431, 6730, 6711, 6077, 3729, 4688, 294, 2537, 1226, 7815, 5722, 3539, 9832, 1474, 6862, 41, 5952, 8796, 1112, 9615, 1564, 8047, 1661, 1799, 6289, 9957, 1687, 5977, 6354, 4931, 7786, 7007, 6939, 2205, 7634, 8410, 8995, 8490, 7449, 1853, 8889, 7059, 3241, 6379, 4429, 2883, 1669, 8472, 80, 7154, 7242, 1043, 634, 4543, 4721, 6874, 9637, 4436, 6365, 4097, 4224, 3450, 1756, 9381, 6779, 7299, 5061, 1960, 1494, 5468, 1388, 2050, 7493, 4899, 6337, 9755, 7353, 6392, 406, 9303, 3225, 8223, 1070, 6037, 7731, 5504, 8332, 1951, 9817, 1523, 8293, 6804, 4876, 3378, 230, 5630, 3568, 390, 2444, 7064, 6070, 4078, 5412, 667, 6305, 6241, 4813, 2925, 9379, 7045, 1926, 3908, 6001, 7540, 7922, 4115, 7490, 7532, 9836, 8081, 9833, 876, 7775, 3583, 9965, 5731, 2965, 7337, 6321, 1873, 9284, 2141, 7205, 608, 6089, 4794, 865, 3646, 3697, 217, 9916, 6219, 1879, 1866, 8372, 3565, 6830, 7266, 8994, 7673, 8769, 7168, 1656, 1709, 8363, 8353, 432, 3728, 7955, 8708, 8493, 9791, 9360, 3235, 8777, 2445, 6500, 423, 5001, 9507, 8578, 3401, 8483, 4807, 9553, 6951, 4932, 177, 4316, 8246, 1306, 1997, 8289, 5058, 8477, 6562, 8965, 1672, 367, 4104, 9027, 2036, 7915, 8927, 1613, 8218, 9212, 4476, 6216, 8334, 8206, 159, 4619, 8149, 1887, 8897, 8957, 3311, 6651, 7047, 4392, 9013, 6400, 9606, 9276, 9650, 8884, 238, 6240, 5102, 8573, 4789, 5390, 2435, 3831, 4761, 6195, 8585, 4594, 1106, 8779, 5601, 4913, 6938, 5604, 5237, 7402, 521, 3788, 3114, 3607, 2058, 5162, 1392, 5173, 8517, 2238, 3325, 4105, 5754, 132, 3315, 4123, 9264, 7091, 6601, 3077, 8703, 5344, 540, 5157, 988, 8775, 9797, 8987, 1145, 3004, 4243, 7801, 8749, 2521, 5296, 3238, 8231, 8969, 6931, 3930, 2768, 4488, 9531, 6863, 1093, 996, 8003, 7865, 4575, 8957, 1220, 8206, 8827, 735, 271, 7154, 3256, 9686, 5231, 2072, 1513, 7659, 6573, 6252, 8696, 7767, 4975, 3935, 8802, 6865, 8019, 756, 3511, 5069, 1633, 6358, 3408, 6058, 5311, 9416, 1884, 4805, 4687, 8007, 7006, 4864, 4597, 8916, 6260, 6541, 4027, 4109, 7085, 137, 7864, 1445, 9863, 8977, 4841, 3795, 4863, 5568, 1651, 9910, 475, 8854, 5089, 4608, 1026, 5176, 9140, 4223, 2753, 8595, 3680, 6371, 6554, 6538, 1521, 409, 5094, 461, 3423, 7467, 2467, 6811, 0, 2383, 4000, 2053, 2388, 1432, 1867, 3273, 8270, 8941, 7860, 4576, 2204, 8411, 3261, 4791, 1775, 1883, 8679, 7449, 2077, 4661, 8084, 2746, 1270, 9025, 2799, 8533, 8550, 9921, 3308, 8391, 5081, 9152, 8516, 7617, 9963, 7519, 6948, 1479, 1255, 568, 467, 4078, 5299, 3068, 6351, 4016, 1964, 5864, 1364, 9829, 341, 1842, 9670, 8545, 3360, 7274, 7709, 621, 2582, 204, 4209, 388, 3714, 6505, 5364, 7443, 6810, 4705, 8564, 2526, 5873, 6341, 638, 1253, 9897, 4662, 705, 9064, 2777, 7336, 3293, 5361, 7977, 1678, 2752, 622, 5023, 8245, 8405, 4004, 4893, 1321, 266, 8197, 4310, 5842, 6098, 7291, 1235, 2994, 3250, 3099, 4250, 3626, 8600, 7843, 5295, 6534, 3754, 1574, 7728, 3317, 3866, 8320, 858, 4511, 5473, 1932, 4825, 1482, 5793, 3197, 5998, 4853, 6688, 1418, 915, 8431, 2484, 9719, 4047, 1366, 3005, 3039, 8658, 8910, 277, 3625, 6308, 7605, 1069, 9874, 1965, 5225, 2586, 6612, 5225, 8850, 3534, 5816, 9795, 6761, 4778, 9459, 3503, 7819, 9954, 1173, 9088, 3394, 4200, 2140, 8098, 4190, 1992, 3255, 3619, 8741, 9104, 9648, 4044, 8378, 9678, 6096, 2344, 5221, 576, 3000, 3442, 4900, 5071, 4852, 5084, 5574, 1818, 2684, 5303, 7724, 2634, 5721, 220, 614, 1648, 5398, 1656, 7087, 2227, 2457, 9958, 8142, 7100, 7883, 1378, 7145, 6665, 3928, 3832, 8773, 7982, 8914, 4045, 5336, 101, 3228, 3302, 6154, 1791, 6224, 5093, 3809, 5771, 7648, 7245, 8613, 7517, 7759, 4495, 6336, 5484, 6164, 1649, 6345, 5031, 8999, 6873, 6350, 7587, 7429, 4825, 59, 4240, 6535, 3060, 7443, 4503, 101, 7606, 3842, 7540, 3840, 5110, 9082, 7345, 6665, 2302, 1767, 890, 6207, 7428, 2732, 3363, 7461, 2126, 7966, 3516, 5373, 4139, 1936, 9883, 2824, 7055, 5902, 5914, 5650, 2805, 3831, 3066, 3981, 7632, 3369, 9460, 7338, 7738, 4200, 8469, 3168, 564, 9693, 607, 8203, 2616, 6000, 7411, 2, 7963, 5548, 4096, 6147, 8774, 8751, 5210, 1072, 6855, 3326, 3412, 3634, 693, 4761, 4620, 7916, 5603, 7879, 7432, 9510, 4464, 218, 55, 3651, 2608, 774, 4602, 8253, 9700, 3969, 9204, 5571, 9285, 279, 1464, 3074, 3888, 3826, 6361, 2340, 3078, 733, 648, 3063, 140, 3140, 385, 7784, 3130, 5624, 7794, 5603, 6424, 2696, 8650, 5205, 7854, 4725, 1432, 58, 6588, 9711, 6126, 3240, 8943, 8111, 8540, 2383, 1288, 9721, 4374, 6030, 1259, 3959, 2624, 4743, 3057, 7947, 3944, 6133, 9450, 2065, 5984, 1644, 3835, 8685, 3960, 6058, 3560, 6018, 2646, 6503, 1149, 3125, 5394, 3871, 5151, 6515, 4585, 4993, 9209, 6241, 646, 9882, 3791, 8685, 8945, 218, 6788, 850, 2063, 6520, 9993, 3871, 4526, 4435, 7580, 9443, 9566, 9261, 3415, 3439, 3547, 8909, 6824, 6425, 8030, 8024, 1093, 6317, 2061, 2812, 2679, 165, 5780, 4055, 8428, 1147, 7137, 3815, 5615, 8156, 9892, 918, 3797, 8989, 9587, 9595, 6670, 6248, 5019, 7592, 3339, 1401, 9082, 5222, 6014, 8363, 7730, 1728, 2817, 2286, 4059, 7079, 1689, 1155, 7756, 9725, 7931, 2811, 2617, 9134, 3107, 4816, 5475, 2385, 5906, 3490, 3673, 1047, 2990, 6573, 1927, 699, 8191, 277, 6642, 6993, 2367, 1392, 2225, 6073, 8764, 9280, 8614, 6943, 114, 9207, 3488, 9714, 468, 1148, 6755, 8475, 9588, 4702, 5582, 9684, 2259, 5670, 1336, 4655, 7884, 1590, 1693, 1269, 8, 2607, 4976, 3339, 40, 6378, 7741, 2634, 8116, 5576, 4310, 1210, 7096, 5215, 5161, 6627, 7846, 2051, 4777, 4896, 7852, 8420, 9855, 9996, 6392, 7242, 7527, 4323, 4302, 1031, 3224, 6563, 1525, 8087, 8888, 7038, 8260, 4954, 6035, 5593, 1748, 669, 9850, 7814, 5490, 7700, 1823, 3944, 3317, 1911, 5130, 919, 972, 7614, 9702, 4075, 5588, 7405, 8184, 5635, 9887, 5545, 9982, 7653, 5616, 704, 3658, 8010, 4112, 5102, 7156, 2484, 3883, 8192, 2627, 8212, 5330, 9133, 8795, 7229, 3336, 2672, 8103, 7828, 4667, 4058, 5071, 8432, 2911, 2387, 133, 2315, 9072, 4157, 1522, 478, 367, 3737, 2457, 6367, 963, 6960, 4327, 6644, 1791, 3235, 964, 1618, 188, 8774, 7417, 3335, 3982, 3039, 5784, 3203, 9390, 1293, 6789, 7896, 4098, 7569, 2177, 9023, 8043, 6947, 4793, 7673, 1496, 8611, 1100, 1124, 8638, 8505, 3610, 604, 997, 5823, 1032, 3305, 1483, 3672, 5899, 6595, 2805, 2219, 6736, 600, 7543, 6785, 720, 5259, 7497, 4223, 5616, 8781, 215, 4377, 7522, 7030, 6732, 2552, 356, 321, 1356, 3003, 6120, 4674, 8412, 7652, 8021, 2235, 6585, 5635, 3839, 6603, 4314, 2422, 3716, 5722, 7249, 3640, 6202, 5952, 4043, 627, 1570, 6935, 5433, 404, 9560, 5588, 191, 8684, 6310, 3452, 4989, 311, 8225, 5445, 5354, 2950, 1920, 6058, 5742, 4191, 1123, 954, 9617, 3105, 7560, 5707, 3398, 5256, 9387, 5876, 7883, 532, 406, 7296, 4400, 3387, 7010, 1443, 4776, 4579, 6408, 3836, 5789, 3994, 2464, 2765, 1522, 8923, 2956, 6008, 1025, 5761, 107, 7419, 2941, 9850, 3535, 4922, 8571, 8422, 353, 4489, 4002, 1353, 298, 9288, 7327, 2509, 5833, 9622, 5689, 1061, 576, 237, 3732, 4319, 9425, 4670, 6338, 2881, 434, 6243, 2841, 8474, 5755, 5637, 1996, 6142, 24, 6337, 9643, 6153, 6263, 7355, 2569, 9920, 1354, 5638, 9102, 6311, 6832, 5277, 1283, 3283, 8388, 484, 9977, 4496, 1678, 6108, 708, 8446, 7397, 3150, 5383, 9514, 5467, 3458, 4032, 7428, 2744, 3910, 6860, 0, 1372, 8289, 1785, 5901, 6919}, + 6, + }, + + { + []int{44, 46, 22, 68, 45, 66, 43, 9, 37, 30, 50, 67, 32, 47, 44, 11, 15, 4, 11, 6, 20, 64, 54, 54, 61, 63, 23, 43, 3, 12, 51, 61, 16, 57, 14, 12, 55, 17, 18, 25, 19, 28, 45, 56, 29, 39, 52, 8, 1, 21, 17, 21, 23, 70, 51, 61, 21, 52, 25, 28}, + 6, + }, + + { + []int{3, 6, 9, 12}, + 4, + }, + + { + []int{9, 4, 7, 2, 10}, + 3, + }, + + { + []int{20, 1, 15, 3, 10, 5, 8}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_longestArithSeqLength(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestArithSeqLength(tc.A), "输入:%v", tc) + } +} + +func Benchmark_longestArithSeqLength(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestArithSeqLength(tc.A) + } + } +} diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/1.png b/Algorithms/1028.recover-a-tree-from-preorder-traversal/1.png new file mode 100644 index 000000000..48d777d2c Binary files /dev/null and b/Algorithms/1028.recover-a-tree-from-preorder-traversal/1.png differ diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/2.png b/Algorithms/1028.recover-a-tree-from-preorder-traversal/2.png new file mode 100644 index 000000000..ff925bad2 Binary files /dev/null and b/Algorithms/1028.recover-a-tree-from-preorder-traversal/2.png differ diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/3.png b/Algorithms/1028.recover-a-tree-from-preorder-traversal/3.png new file mode 100644 index 000000000..a133057e6 Binary files /dev/null and b/Algorithms/1028.recover-a-tree-from-preorder-traversal/3.png differ diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/README.md b/Algorithms/1028.recover-a-tree-from-preorder-traversal/README.md new file mode 100755 index 000000000..47845fbce --- /dev/null +++ b/Algorithms/1028.recover-a-tree-from-preorder-traversal/README.md @@ -0,0 +1,41 @@ +# [1028. Recover a Tree From Preorder Traversal](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/) + +We run a preorder depth first search on the root of a binary tree. + +At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node. (If the depth of a node is D, the depth of its immediate child is D+1. The depth of the root node is 0.) + +If a node has only one child, that child is guaranteed to be the left child. + +Given the output S of this traversal, recover the tree and return its root. + +Example 1: + +![1](1.png) + +```text +Input: "1-2--3--4-5--6--7" +Output: [1,2,5,3,4,6,7] +``` + +Example 2: + +![2](2.png) + +```text +Input: "1-2--3---4-5--6---7" +Output: [1,2,5,3,null,6,null,4,null,7] +``` + +Example 3: + +![3](3.png) + +```text +Input: "1-401--349---90--88" +Output: [1,401,null,349,88,90] +``` + +Note: + +- The number of nodes in the original tree is between 1 and 1000. +- Each node will have a value between 1 and 10^9. diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal.go b/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal.go new file mode 100755 index 000000000..af54f65be --- /dev/null +++ b/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal.go @@ -0,0 +1,46 @@ +package problem1028 + +import ( + "strconv" + + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +type TreeNode = kit.TreeNode + +func recoverFromPreorder(S string) *TreeNode { + next := func() (int, *TreeNode) { + level := 0 + for S[level] == '-' { + level++ + } + end := level + for end < len(S) && S[end] != '-' { + end++ + } + val, _ := strconv.Atoi(S[level:end]) + S = S[end:] + return level, &TreeNode{Val: val} + } + + stack, top := make([]*TreeNode, 1000), -1 + + for len(S) > 0 { + level, node := next() + for top >= level { // top is the level of stack[top] + top-- + } + if top >= 0 { + if stack[top].Left == nil { + stack[top].Left = node + } else { + stack[top].Right = node + } + } + top++ + stack[top] = node + } + + return stack[0] +} diff --git a/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal_test.go b/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal_test.go new file mode 100755 index 000000000..3062333d4 --- /dev/null +++ b/Algorithms/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal_test.go @@ -0,0 +1,54 @@ +package problem1028 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans []int +}{ + + { + "3", + []int{3}, + }, + + { + "1-2--3--4-5--6--7", + []int{1, 2, 5, 3, 4, 6, 7}, + }, + + { + "1-2--3---4-5--6---7", + []int{1, 2, 5, 3, kit.NULL, 6, kit.NULL, 4, kit.NULL, 7}, + }, + + { + "1-401--349---90--88", + []int{1, 401, kit.NULL, 349, 88, 90}, + }, + + // 可以有多个 testcase +} + +func Test_recoverFromPreorder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := recoverFromPreorder(tc.S) + ast.Equal(tc.ans, kit.Tree2ints(ans), "输入:%v", tc) + } +} + +func Benchmark_recoverFromPreorder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + recoverFromPreorder(tc.S) + } + } +} diff --git a/Algorithms/1029.two-city-scheduling/README.md b/Algorithms/1029.two-city-scheduling/README.md new file mode 100755 index 000000000..15916599f --- /dev/null +++ b/Algorithms/1029.two-city-scheduling/README.md @@ -0,0 +1,25 @@ +# [1029. Two City Scheduling](https://leetcode.com/problems/two-city-scheduling/) + +There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th person to city B is costs[i][1]. + +Return the minimum cost to fly every person to a city such that exactly N people arrive in each city. + +Example 1: + +```text +Input: [[10,20],[30,200],[400,50],[30,20]] +Output: 110 +Explanation: +The first person goes to city A for a cost of 10. +The second person goes to city A for a cost of 30. +The third person goes to city B for a cost of 50. +The fourth person goes to city B for a cost of 20. + +The total minimum cost is 10 + 30 + 50 + 20 = 110 to have half the people interviewing in each city. +``` + +Note: + +- `1 <= costs.length <= 100` +- It is guaranteed that costs.length is even. +- `1 <= costs[i][0], costs[i][1] <= 1000` diff --git a/Algorithms/1029.two-city-scheduling/two-city-scheduling.go b/Algorithms/1029.two-city-scheduling/two-city-scheduling.go new file mode 100755 index 000000000..2c2b5bbb7 --- /dev/null +++ b/Algorithms/1029.two-city-scheduling/two-city-scheduling.go @@ -0,0 +1,21 @@ +package problem1029 + +import "sort" + +func twoCitySchedCost(costs [][]int) int { + sort.Slice(costs, func(i int, j int) bool { + return costs[i][1]-costs[i][0] > costs[j][1]-costs[j][0] + // person i is either to A or to B + // c = costs[i][1]-costs[i][0] means + // if person i go to B, the cost have to be paid more. + // so, c is larger, person i is more should go to A. + // after sorting + // persion[:N] go to A, the others go to B. + }) + N := len(costs) / 2 + sum := 0 + for i := 0; i < N; i++ { + sum += costs[i][0] + costs[i+N][1] + } + return sum +} diff --git a/Algorithms/1029.two-city-scheduling/two-city-scheduling_test.go b/Algorithms/1029.two-city-scheduling/two-city-scheduling_test.go new file mode 100755 index 000000000..fcd664b82 --- /dev/null +++ b/Algorithms/1029.two-city-scheduling/two-city-scheduling_test.go @@ -0,0 +1,42 @@ +package problem1029 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + costs [][]int + ans int +}{ + + { + [][]int{{259, 770}, {448, 54}, {926, 667}, {184, 139}, {840, 118}, {577, 469}}, + 1859, + }, + + { + [][]int{{10, 20}, {30, 200}, {400, 50}, {30, 20}}, + 110, + }, + + // 可以有多个 testcase +} + +func Test_twoCitySchedCost(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, twoCitySchedCost(tc.costs), "输入:%v", tc) + } +} + +func Benchmark_twoCitySchedCost(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + twoCitySchedCost(tc.costs) + } + } +} diff --git a/Algorithms/1030.matrix-cells-in-distance-order/README.md b/Algorithms/1030.matrix-cells-in-distance-order/README.md new file mode 100755 index 000000000..95da5fd6f --- /dev/null +++ b/Algorithms/1030.matrix-cells-in-distance-order/README.md @@ -0,0 +1,40 @@ +# [1030. Matrix Cells in Distance Order](https://leetcode.com/problems/matrix-cells-in-distance-order/) + +We are given a matrix with R rows and C columns has cells with integer coordinates (r, c), where 0 <= r < R and 0 <= c < C. + +Additionally, we are given a cell in that matrix with coordinates (r0, c0). + +Return the coordinates of all cells in the matrix, sorted by their distance from (r0, c0) from smallest distance to largest distance. Here, the distance between two cells (r1, c1) and (r2, c2) is the Manhattan distance, |r1 - r2| + |c1 - c2|. (You may return the answer in any order that satisfies this condition.) + +Example 1: + +```text +Input: R = 1, C = 2, r0 = 0, c0 = 0 +Output: [[0,0],[0,1]] +Explanation: The distances from (r0, c0) to other cells are: [0,1] +``` + +Example 2: + +```text +Input: R = 2, C = 2, r0 = 0, c0 = 1 +Output: [[0,1],[0,0],[1,1],[1,0]] +Explanation: The distances from (r0, c0) to other cells are: [0,1,1,2] +The answer [[0,1],[1,1],[0,0],[1,0]] would also be accepted as correct. +``` + +Example 3: + +```text +Input: R = 2, C = 3, r0 = 1, c0 = 2 +Output: [[1,2],[0,2],[1,1],[0,1],[1,0],[0,0]] +Explanation: The distances from (r0, c0) to other cells are: [0,1,1,2,2,3] +There are other answers that would also be accepted as correct, such as [[1,2],[1,1],[0,2],[1,0],[0,1],[0,0]]. +``` + +Note: + +1. `1 <= R <= 100` +1. `1 <= C <= 100` +1. `0 <= r0 < R` +1. `0 <= c0 < C` diff --git a/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order.go b/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order.go new file mode 100755 index 000000000..02046c07f --- /dev/null +++ b/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order.go @@ -0,0 +1,26 @@ +package problem1030 + +var res = [10000][]int{} + +func allCellsDistOrder(R int, C int, r0 int, c0 int) [][]int { + dist := [200][][]int{} + for r := 0; r < R; r++ { + for c := 0; c < C; c++ { + d := abs(r-r0) + abs(c-c0) + dist[d] = append(dist[d], []int{r, c}) + } + } + begin, end := 0, 0 + for d := 0; len(dist[d]) > 0; d++ { + begin, end = end, end+len(dist[d]) + copy(res[begin:end], dist[d]) + } + return res[:end] +} + +func abs(n int) int { + if n < 0 { + return -n + } + return n +} diff --git a/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order_test.go b/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order_test.go new file mode 100755 index 000000000..9ed161edc --- /dev/null +++ b/Algorithms/1030.matrix-cells-in-distance-order/matrix-cells-in-distance-order_test.go @@ -0,0 +1,105 @@ +package problem1030 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + R int + C int + r0 int + c0 int + exp [][]int +}{ + + { + 10, + 10, + 5, + 9, + [][]int{{5, 9}, {4, 9}, {5, 8}, {6, 9}, {3, 9}, {4, 8}, {5, 7}, {6, 8}, {7, 9}, {2, 9}, {3, 8}, {4, 7}, {5, 6}, {6, 7}, {7, 8}, {8, 9}, {1, 9}, {2, 8}, {3, 7}, {4, 6}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {0, 9}, {1, 8}, {2, 7}, {3, 6}, {4, 5}, {5, 4}, {6, 5}, {7, 6}, {8, 7}, {9, 8}, {0, 8}, {1, 7}, {2, 6}, {3, 5}, {4, 4}, {5, 3}, {6, 4}, {7, 5}, {8, 6}, {9, 7}, {0, 7}, {1, 6}, {2, 5}, {3, 4}, {4, 3}, {5, 2}, {6, 3}, {7, 4}, {8, 5}, {9, 6}, {0, 6}, {1, 5}, {2, 4}, {3, 3}, {4, 2}, {5, 1}, {6, 2}, {7, 3}, {8, 4}, {9, 5}, {0, 5}, {1, 4}, {2, 3}, {3, 2}, {4, 1}, {5, 0}, {6, 1}, {7, 2}, {8, 3}, {9, 4}, {0, 4}, {1, 3}, {2, 2}, {3, 1}, {4, 0}, {6, 0}, {7, 1}, {8, 2}, {9, 3}, {0, 3}, {1, 2}, {2, 1}, {3, 0}, {7, 0}, {8, 1}, {9, 2}, {0, 2}, {1, 1}, {2, 0}, {8, 0}, {9, 1}, {0, 1}, {1, 0}, {9, 0}, {0, 0}}, + }, + + { + 2, + 2, + 0, + 1, + [][]int{{0, 1}, {0, 0}, {1, 1}, {1, 0}}, + }, + + { + 2, + 3, + 1, + 2, + [][]int{{1, 2}, {0, 2}, {1, 1}, {0, 1}, {1, 0}, {0, 0}}, + }, + + { + 1, + 2, + 0, + 0, + [][]int{{0, 0}, {0, 1}}, + }, + { + 2, + 2, + 0, + 1, + [][]int{{0, 1}, {0, 0}, {1, 1}, {1, 0}}, + }, + { + 2, + 3, + 1, + 2, + [][]int{{1, 2}, {0, 2}, {1, 1}, {0, 1}, {1, 0}, {0, 0}}, + }, + + // 可以有多个 testcase +} + +func Test_allCellsDistOrder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := allCellsDistOrder(tc.R, tc.C, tc.r0, tc.c0) + ast.Equal(tc.exp, ans, "输入:%v", tc) + } +} + +func Benchmark_allCellsDistOrder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + allCellsDistOrder(tc.R, tc.C, tc.r0, tc.c0) + } + } +} + +var limit = 10000 + +func Benchmark_abs_normal(b *testing.B) { + for i := 1; i < b.N; i++ { + for j := -limit; j <= limit; j++ { + abs(j) + } + } +} + +func absBit(n int) int { + x := n >> 63 + return (n ^ x) - x +} + +func Benchmark_absBit(b *testing.B) { + for i := 1; i < b.N; i++ { + for j := -limit; j <= limit; j++ { + absBit(j) + } + } +} diff --git a/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/README.md b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/README.md new file mode 100755 index 000000000..086c5a422 --- /dev/null +++ b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/README.md @@ -0,0 +1,39 @@ +# [1031. Maximum Sum of Two Non-Overlapping Subarrays](https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays/) + +Given an array A of non-negative integers, return the maximum sum of elements in two non-overlapping (contiguous) subarrays, which have lengths L and M. (For clarification, the L-length subarray could occur before or after the M-length subarray.) + +Formally, return the largest V for which V = (A[i] + A[i+1] + ... + A[i+L-1]) + (A[j] + A[j+1] + ... + A[j+M-1]) and either: + +- 0 <= i < i + L - 1 < j < j + M - 1 < A.length, or +- 0 <= j < j + M - 1 < i < i + L - 1 < A.length. + +Example 1: + +```text +Input: A = [0,6,5,2,2,5,1,9,4], L = 1, M = 2 +Output: 20 +Explanation: One choice of subarrays is [9] with length 1, and [6,5] with length 2. +``` + +Example 2: + +```text +Input: A = [3,8,1,3,2,1,8,9,0], L = 3, M = 2 +Output: 29 +Explanation: One choice of subarrays is [3,8,1] with length 3, and [8,9] with length 2. +``` + +Example 3: + +```text +Input: A = [2,1,5,6,0,9,5,0,3,8], L = 4, M = 3 +Output: 31 +Explanation: One choice of subarrays is [5,6,0,9] with length 4, and [3,8] with length 3. +``` + +Note: + +1. `L >= 1` +1. `M >= 1` +1. `L + M <= A.length <= 1000` +1. `0 <= A[i] <= 1000` diff --git a/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays.go b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays.go new file mode 100755 index 000000000..df14736c5 --- /dev/null +++ b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays.go @@ -0,0 +1,27 @@ +package problem1031 + +// ref: https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays/discuss/278251/JavaC%2B%2BPython-O(N)Time-O(1)-Space + +func maxSumTwoNoOverlap(A []int, L int, M int) int { + for i := 1; i < len(A); i++ { + A[i] += A[i-1] + } + // assume original A is A' + // now, A[i] = sum(A'[:i+1]) + res, lMax, mMax := A[L+M-1], A[L-1], A[M-1] + for i := L + M; i < len(A); i++ { + // lMax is max sum of contiguous L elements before the last M elements. + lMax = max(lMax, A[i-M]-A[i-L-M]) + // mMax is max sum of contiguous M elements before the last L elements. + mMax = max(mMax, A[i-L]-A[i-L-M]) + res = max(res, max(lMax+A[i]-A[i-M], mMax+A[i]-A[i-L])) + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays_test.go b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays_test.go new file mode 100755 index 000000000..fdf2567c5 --- /dev/null +++ b/Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays/maximum-sum-of-two-non-overlapping-subarrays_test.go @@ -0,0 +1,69 @@ +package problem1031 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + L int + M int + ans int +}{ + + { + []int{360, 629, 175, 292, 546, 681, 708, 458, 411, 596, 978, 592, 7, 830, 968, 589, 234, 743, 997, 542, 431, 496, 545, 97, 781, 978, 31, 531, 651, 855, 692, 852, 137, 706, 458, 47, 963, 993, 205, 223, 180, 661, 418, 458, 780, 365, 510, 344, 945, 988, 744, 498, 71, 927, 971, 240, 829, 546, 629, 944, 248, 116, 390, 667, 343, 390, 295, 701, 143, 197, 811, 608, 190, 858, 954, 905, 335, 373, 797, 598, 817, 965, 1000, 861, 612, 306, 783, 772, 755, 439, 256, 82, 993, 207, 695, 613, 930, 236, 0, 439, 348, 400, 825, 12, 306, 846, 792, 334, 339, 814, 631, 51, 633, 666, 852, 686, 939, 139, 264, 508, 675, 784, 60, 89, 730, 958, 879, 356, 550, 135, 755, 517, 390, 945, 536, 406, 383, 110, 389, 649, 802, 682, 257, 770, 420, 165, 101, 126, 475, 42, 714, 305, 547, 750, 640, 61, 914, 358, 617, 266, 69, 543, 771, 509, 162, 738, 806, 668, 734, 845, 718, 795, 956, 203, 368, 523, 440, 674, 586, 552, 928, 954, 414, 623, 960, 673, 279, 76, 814, 80, 881, 834, 377, 434, 84, 737, 166, 173, 429, 434, 925, 252, 1, 172, 209, 340, 242, 173, 460, 520, 632, 618, 260, 401, 300, 879, 74, 228, 5, 694, 976, 28, 448, 131, 431, 702, 217, 766, 841, 513, 647, 541, 48, 321, 986, 200, 998, 657, 338, 365, 276, 562, 897, 161, 586, 381, 775, 140, 355, 558, 237, 683, 953, 350, 122, 295, 606, 935, 736, 641, 239, 415, 999, 834, 935, 637, 940, 972, 670, 778, 257, 446, 118, 799, 28, 921, 987, 99, 415, 844, 827, 294, 454, 993, 58, 916, 312, 571, 217, 487, 619, 191, 616, 450, 68, 688, 270, 812, 468, 239, 762, 636, 267, 745, 560, 212, 228, 425, 364, 670, 231, 512, 639, 732, 450, 472, 78, 562, 145, 963, 331, 325, 323, 804, 476, 149, 247, 88, 237, 370, 82, 392, 399, 432, 135, 890, 731, 871, 601, 37, 124, 691, 249, 240, 518, 69, 430, 761, 963, 803, 397, 575, 535, 199, 311, 39, 312, 317, 123, 103, 249, 77, 131, 730, 712, 405, 134, 662, 489, 657, 846, 824, 788, 257, 332, 891, 31, 618, 584, 482, 141, 300, 915, 493, 760, 954, 308, 584, 704, 857, 464, 69, 601, 683, 918, 456, 24, 81, 39, 23, 829, 567, 402, 84, 619, 247, 437, 529, 190, 178, 195, 57, 818, 884, 498, 204, 509, 354, 86, 105, 663, 627, 913, 172, 330, 828, 763, 508, 306, 861, 962, 874, 806, 891, 304, 927, 700, 77, 811, 136, 459, 485, 29, 778, 344, 971, 377, 588, 601, 429, 282, 710, 794, 918, 312, 250, 950, 143, 947, 907, 392, 330, 270, 326, 439, 380, 155, 706, 962, 683, 877, 711, 459, 47, 317, 691, 132, 989, 816, 748, 765, 989, 970, 178, 546, 831, 572, 651, 664, 221, 424, 992, 90, 889, 418, 11, 278, 776, 570, 57, 970, 391, 623, 177, 797, 123, 693, 449, 662, 679, 296, 987, 475, 918, 486, 624, 218, 512, 185, 526, 831, 433, 927, 447, 381, 928, 754, 459, 607, 649, 273, 509, 163, 591, 734, 573, 664, 501, 607, 191, 675, 939, 185, 465, 644, 307, 695, 479, 674, 751, 922, 803, 860, 932, 768, 272, 294, 223, 977, 536, 150, 602, 612, 863, 768, 154, 477, 156, 331, 404, 345, 401, 4, 307, 606, 60, 75, 2, 295, 297, 848, 612, 661, 640, 635, 841, 800, 174, 366, 54, 539, 786, 879, 469, 322, 32, 588, 904, 411, 577, 97, 621, 32, 4, 784, 346, 791, 659, 62, 228, 422, 532, 961, 889, 859, 441, 978, 515, 311, 665, 728, 892, 299, 22, 573, 473, 963, 150, 831, 858, 156, 139, 472, 53, 579, 105, 337, 576, 83, 409, 762, 556, 906, 836, 782, 825, 380, 416, 2, 904, 676, 265, 637, 757, 970, 911, 62, 816, 784, 511, 372, 572, 889, 25, 94, 722, 514, 137, 147, 863, 674, 236, 494, 351, 706, 962, 192, 930, 833, 580, 992, 239, 14, 786, 749, 746, 166, 321, 951, 820, 387, 157, 852, 376, 258, 682, 882, 742, 995, 291, 304, 920, 131, 800, 78, 264, 164, 428, 301, 952, 510, 408, 336, 258, 442, 933, 866, 366, 991, 314, 323, 190, 326, 315, 195, 848, 583, 357, 462, 336, 417, 838, 208, 969, 559, 48, 938, 248, 702, 5, 928, 936, 378, 792, 325, 215, 240, 166, 643, 395, 3, 158, 89, 742, 448, 90, 348, 694, 797, 374, 886, 852, 19, 393, 202, 906, 693, 308, 227, 558, 379, 385, 691, 953, 881, 973, 762, 663, 539, 63, 983, 633, 310, 798, 389, 140, 411, 100, 40, 826, 328, 997, 856, 433, 586, 204, 724, 340, 773, 656, 694, 498, 257, 658, 468, 8, 486, 380, 118, 123, 901, 108, 539, 763, 461, 294, 327, 24, 46, 495, 744, 417, 823, 844, 511, 40, 245, 854, 1, 210, 386, 64, 688, 516, 461, 672, 371, 946, 155, 524, 56, 825, 23, 579, 580, 198, 312, 179, 445, 47, 644, 759, 89, 676, 314, 567, 298, 907, 555, 646, 544, 403, 643, 194, 485, 428, 139, 296, 808, 445, 343, 236, 51, 132, 945, 9, 928, 929, 90, 313, 458, 231, 429, 662, 707, 833, 407, 589, 708, 555, 762, 806, 638, 553, 489, 577, 497, 507, 905, 51, 204, 297, 575, 876, 849, 145, 363, 68, 431, 532, 881, 15, 355, 956, 575, 657, 809, 544, 343, 80, 641, 93, 619, 210, 834, 764, 26, 685, 312, 434, 974, 999, 384, 704, 590, 547, 234, 782, 448, 22, 866, 614, 683, 852, 564, 846, 430, 440, 899, 383, 244, 644, 809, 304, 651, 847, 314, 378, 495, 488, 418, 324, 838, 571, 800, 461, 2, 904, 83, 226, 836, 146, 667, 154, 603, 706, 336, 40, 802, 19, 449, 726, 539, 73, 511, 695, 527, 79, 69, 395, 876, 415, 943, 756, 398, 348, 900, 228, 953, 119}, + 204, + 648, + 434985, + }, + + { + []int{4, 5, 14, 16, 16, 20, 7, 13, 8, 15}, + 3, + 5, + 109, + }, + + { + []int{0, 6, 5, 2, 2, 5, 1, 9, 4}, + 1, + 2, + 20, + }, + + { + []int{3, 8, 1, 3, 2, 1, 8, 9, 0}, + 3, + 2, + 29, + }, + + { + []int{2, 1, 5, 6, 0, 9, 5, 0, 3, 8}, + 4, + 3, + 31, + }, + + // 可以有多个 testcase +} + +func Test_maxSumTwoNoOverlap(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxSumTwoNoOverlap(tc.A, tc.L, tc.M), "输入:%v", tc) + } +} + +func Benchmark_maxSumTwoNoOverlap(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSumTwoNoOverlap(tc.A, tc.L, tc.M) + } + } +} diff --git a/Algorithms/1032.stream-of-characters/README.md b/Algorithms/1032.stream-of-characters/README.md new file mode 100755 index 000000000..56ce79281 --- /dev/null +++ b/Algorithms/1032.stream-of-characters/README.md @@ -0,0 +1,32 @@ +# [1032. Stream of Characters](https://leetcode.com/problems/stream-of-characters/) + +Implement the StreamChecker class as follows: + +- StreamChecker(words): Constructor, init the data structure with the given words. +- query(letter): returns true if and only if for some k >= 1, the last k characters queried (in order from oldest to newest, including this letter just queried) spell one of the words in the given list. + +Example: + +```text +StreamChecker streamChecker = new StreamChecker(["cd","f","kl"]); // init the dictionary. +streamChecker.query('a'); // return false +streamChecker.query('b'); // return false +streamChecker.query('c'); // return false +streamChecker.query('d'); // return true, because 'cd' is in the wordlist +streamChecker.query('e'); // return false +streamChecker.query('f'); // return true, because 'f' is in the wordlist +streamChecker.query('g'); // return false +streamChecker.query('h'); // return false +streamChecker.query('i'); // return false +streamChecker.query('j'); // return false +streamChecker.query('k'); // return false +streamChecker.query('l'); // return true, because 'kl' is in the wordlist +``` + +Note: + +- 1 <= words.length <= 2000 +- 1 <= words[i].length <= 2000 +- Words will only consist of lowercase English letters. +- Queries will only consist of lowercase English letters. +- The number of queries is at most 40000. diff --git a/Algorithms/1032.stream-of-characters/stream-of-characters.go b/Algorithms/1032.stream-of-characters/stream-of-characters.go new file mode 100755 index 000000000..3206e00cb --- /dev/null +++ b/Algorithms/1032.stream-of-characters/stream-of-characters.go @@ -0,0 +1,63 @@ +package problem1032 + +// StreamChecker check letters +type StreamChecker struct { + trie *trie + stream []int8 +} + +// Constructor returns StreamChecker +func Constructor(words []string) StreamChecker { + m := 0 + t := &trie{} + for _, w := range words { + m = max(m, len(w)) + t.insert(w) + } + return StreamChecker{ + trie: t, + stream: make([]int8, 0, 1024), + } +} + +// Query returns true if letter in words +func (sc *StreamChecker) Query(letter byte) bool { + sc.stream = append(sc.stream, int8(letter-'a')) + n, t := len(sc.stream), sc.trie + for i := n - 1; i >= 0; i-- { + index := sc.stream[i] + if t.next[index] == nil { + return false + } + t = t.next[index] + if t.isWord { + return true + } + } + return false +} + +type trie struct { + next [26]*trie + isWord bool +} + +func (t *trie) insert(word string) { + n := len(word) + // reversely insert + for i := n - 1; i >= 0; i-- { + index := int(word[i] - 'a') + if t.next[index] == nil { + t.next[index] = &trie{} + } + t = t.next[index] + } + t.isWord = true +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1032.stream-of-characters/stream-of-characters_test.go b/Algorithms/1032.stream-of-characters/stream-of-characters_test.go new file mode 100755 index 000000000..83715a198 --- /dev/null +++ b/Algorithms/1032.stream-of-characters/stream-of-characters_test.go @@ -0,0 +1,107 @@ +package problem1032 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans StreamChecker +}{ + + // 可以有多个 testcase +} + +func Test_Case(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd", "f", "kl"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('a')) // return false + ast.False(streamChecker.Query('b')) // return false + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist + ast.False(streamChecker.Query('e')) // return false + ast.True(streamChecker.Query('f')) // return true, because 'f' is in the wordlist + ast.False(streamChecker.Query('g')) // return false + ast.False(streamChecker.Query('h')) // return false + ast.False(streamChecker.Query('i')) // return false + ast.False(streamChecker.Query('j')) // return false + ast.False(streamChecker.Query('k')) // return false + ast.True(streamChecker.Query('l')) // return true, because 'kl' is in the wordlist +} + +func Test_Case_2(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist + ast.False(streamChecker.Query('c')) // return false +} + +func Test_Case_3(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist + ast.False(streamChecker.Query('d')) // return false +} + +func Test_Case_4(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist +} + +func Test_Case_5(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd", "cdd"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('c')) // return false + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist + ast.True(streamChecker.Query('d')) // return true, because 'cd' is in the wordlist +} + +func Test_Case_6(t *testing.T) { + ast := assert.New(t) + // + words := []string{"abaa", "abaab", "aabbb", "bab", "ab"} + streamChecker := Constructor(words) + + querys := []byte{'a', 'a', 'b', 'b', 'b', 'a', 'a', 'b', 'b', 'a', 'a', 'a', 'a', 'b', 'a', 'b', 'b', 'b', 'a', 'b', 'b', 'b', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'b', 'b', 'b', 'a', 'a', 'b', 'b', 'b', 'a', 'b', 'a'} + expects := []bool{false, false, true, false, true, false, false, true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, false, false, false, false, true, false, true, false, false, false, false, true, false, true, false, true, false} + + ast.Equal(len(querys), len(expects)) + for i, q := range querys { + ast.Equal(expects[i], streamChecker.Query(q), "%d:%s", i, string(querys[:i+1])) + } +} + +func Test_Case_7(t *testing.T) { + ast := assert.New(t) + // + words := []string{"cd"} + streamChecker := Constructor(words) + // + ast.False(streamChecker.Query('c')) // return false + ast.False(streamChecker.Query('a')) // return false + ast.False(streamChecker.Query('d')) // return false +} diff --git a/Algorithms/1033.moving-stones-until-consecutive/README.md b/Algorithms/1033.moving-stones-until-consecutive/README.md new file mode 100755 index 000000000..c2a543b56 --- /dev/null +++ b/Algorithms/1033.moving-stones-until-consecutive/README.md @@ -0,0 +1,40 @@ +# [1033. Moving Stones Until Consecutive](https://leetcode.com/problems/moving-stones-until-consecutive/) + +Three stones are on a number line at positions a, b, and c. + +Each turn, you pick up a stone at an endpoint (ie., either the lowest or highest position stone), and move it to an unoccupied position between those endpoints. Formally, let's say the stones are currently at positions x, y, z with x < y < z. You pick up the stone at either position x or position z, and move that stone to an integer position k, with x < k < z and k != y. + +The game ends when you cannot make any more moves, ie. the stones are in consecutive positions. + +When the game ends, what is the minimum and maximum number of moves that you could have made? Return the answer as an length 2 array: `answer = [minimum_moves, maximum_moves]` + +Example 1: + +```text +Input: a = 1, b = 2, c = 5 +Output: [1,2] +Explanation: Move the stone from 5 to 3, or move the stone from 5 to 4 to 3. +``` + +Example 2: + +```text +Input: a = 4, b = 3, c = 2 +Output: [0,0] +Explanation: We cannot make any moves. +``` + +Example 3: + +```text +Input: a = 3, b = 5, c = 1 +Output: [1,2] +Explanation: Move the stone from 1 to 4; or move the stone from 1 to 2 to 4. +``` + +Note: + +1. `1 <= a <= 100` +1. `1 <= b <= 100` +1. `1 <= c <= 100` +1. `a != b, b != c, c != a` diff --git a/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive.go b/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive.go new file mode 100755 index 000000000..a703f9756 --- /dev/null +++ b/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive.go @@ -0,0 +1,35 @@ +package problem1033 + +var zerozero = []int{0, 0} + +func numMovesStones(a, b, c int) []int { + a, b, c = sort(a, b, c) + if c-a == 2 { + return zerozero + } + minM, maxM := 2, c-a-2 + if min(b-a, c-b) <= 2 { + minM = 1 + } + return []int{minM, maxM} +} + +func sort(a, b, c int) (int, int, int) { + if a > b { + a, b = b, a + } + if a > c { + a, c = c, a + } + if b > c { + b, c = c, b + } + return a, b, c +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive_test.go b/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive_test.go new file mode 100755 index 000000000..5cddac2a7 --- /dev/null +++ b/Algorithms/1033.moving-stones-until-consecutive/moving-stones-until-consecutive_test.go @@ -0,0 +1,55 @@ +package problem1033 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + a int + b int + c int + ans []int +}{ + + { + 1, + 2, + 5, + []int{1, 2}, + }, + + { + 4, + 3, + 2, + []int{0, 0}, + }, + + { + 3, + 5, + 1, + []int{1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_numMovesStones(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numMovesStones(tc.a, tc.b, tc.c), "输入:%v", tc) + } +} + +func Benchmark_numMovesStones(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numMovesStones(tc.a, tc.b, tc.c) + } + } +} diff --git a/Algorithms/1034.coloring-a-border/README.md b/Algorithms/1034.coloring-a-border/README.md new file mode 100755 index 000000000..aeaab48c2 --- /dev/null +++ b/Algorithms/1034.coloring-a-border/README.md @@ -0,0 +1,39 @@ +# [1034. Coloring A Border](https://leetcode.com/problems/coloring-a-border/) + +Given a 2-dimensional grid of integers, each value in the grid represents the color of the grid square at that location. + +Two squares belong to the same connected component if and only if they have the same color and are next to each other in any of the 4 directions. + +The border of a connected component is all the squares in the connected component that are either 4-directionally adjacent to a square not in the component, or on the boundary of the grid (the first or last row or column). + +Given a square at location (r0, c0) in the grid and a color, color the border of the connected component of that square with the given color, and return the final grid. + +Example 1: + +```text +Input: grid = [[1,1],[1,2]], r0 = 0, c0 = 0, color = 3 +Output: [[3, 3], [3, 2]] +``` + +Example 2: + +```text +Input: grid = [[1,2,2],[2,3,2]], r0 = 0, c0 = 1, color = 3 +Output: [[1, 3, 3], [2, 3, 3]] +``` + +Example 3: + +```text +Input: grid = [[1,1,1],[1,1,1],[1,1,1]], r0 = 1, c0 = 1, color = 2 +Output: [[2, 2, 2], [2, 1, 2], [2, 2, 2]] +``` + +Note: + +1. `1 <= grid.length <= 50` +1. `1 <= grid[0].length <= 50` +1. `1 <= grid[i][j] <= 1000` +1. `0 <= r0 < grid.length` +1. `0 <= c0 < grid[0].length` +1. `1 <= color <= 1000` diff --git a/Algorithms/1034.coloring-a-border/coloring-a-border.go b/Algorithms/1034.coloring-a-border/coloring-a-border.go new file mode 100755 index 000000000..a66158b22 --- /dev/null +++ b/Algorithms/1034.coloring-a-border/coloring-a-border.go @@ -0,0 +1,52 @@ +package problem1034 + +var dx = []int{0, 0, 1, -1} +var dy = []int{1, -1, 0, 0} + +func colorBorder(grid [][]int, x0 int, y0 int, color int) [][]int { + m, n := len(grid), len(grid[0]) + c := grid[x0][y0] + + isBorder := func(x, y int) bool { + return x == 0 || x == m-1 || + y == 0 || y == n-1 || + grid[x][y-1] != c || + grid[x][y+1] != c || + grid[x-1][y] != c || + grid[x+1][y] != c + } + + connected := make([][2]int, 1, 1024) + hasSeen := [51][51]bool{} + + connected[0] = [2]int{x0, y0} + hasSeen[x0][y0] = true + + borders := make([][2]int, 0, 1024) + for len(connected) > 0 { + size := len(connected) + for i := 0; i < size; i++ { + p := connected[i] + if isBorder(p[0], p[1]) { + borders = append(borders, p) + } + for k := 0; k < 4; k++ { + x, y := p[0]+dx[k], p[1]+dy[k] + if 0 <= x && x < m && + 0 <= y && y < n && + grid[x][y] == c && + !hasSeen[x][y] { + connected = append(connected, [2]int{x, y}) + hasSeen[x][y] = true + } + } + } + connected = connected[size:] + } + + for _, b := range borders { + grid[b[0]][b[1]] = color + } + + return grid +} diff --git a/Algorithms/1034.coloring-a-border/coloring-a-border_test.go b/Algorithms/1034.coloring-a-border/coloring-a-border_test.go new file mode 100755 index 000000000..818ad996f --- /dev/null +++ b/Algorithms/1034.coloring-a-border/coloring-a-border_test.go @@ -0,0 +1,95 @@ +package problem1034 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + r0 int + c0 int + color int + ans [][]int +}{ + + { + [][]int{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 3, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}, + 0, + 0, + 3, + [][]int{ + {3, 3, 3, 3, 3}, + {3, 1, 3, 1, 3}, + {3, 3, 3, 3, 3}, + {3, 1, 3, 1, 3}, + {3, 3, 3, 3, 3}, + }, + }, + + { + [][]int{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 3, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}, + 0, + 0, + 2, + [][]int{ + {2, 2, 2, 2, 2}, + {2, 1, 2, 1, 2}, + {2, 2, 3, 2, 2}, + {2, 1, 2, 1, 2}, + {2, 2, 2, 2, 2}, + }, + }, + + { + [][]int{{1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}}, + 2, + 2, + 2, + [][]int{{2, 2, 2, 2, 2}, {2, 1, 1, 1, 2}, {2, 1, 1, 1, 2}, {2, 1, 1, 1, 2}, {2, 2, 2, 2, 2}}, + }, + + { + [][]int{{1, 1}, {1, 2}}, + 0, + 0, + 3, + [][]int{{3, 3}, {3, 2}}, + }, + + { + [][]int{{1, 2, 2}, {2, 3, 2}}, + 0, + 1, + 3, + [][]int{{1, 3, 3}, {2, 3, 3}}, + }, + + { + [][]int{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, + 1, + 1, + 2, + [][]int{{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}, + }, + + // 可以有多个 testcase +} + +func Test_colorBorder(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, colorBorder(tc.grid, tc.r0, tc.c0, tc.color), "输入:%v", tc) + } +} + +func Benchmark_colorBorder(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + colorBorder(tc.grid, tc.r0, tc.c0, tc.color) + } + } +} diff --git a/Algorithms/1035.uncrossed-lines/1.png b/Algorithms/1035.uncrossed-lines/1.png new file mode 100644 index 000000000..c9f2f076e Binary files /dev/null and b/Algorithms/1035.uncrossed-lines/1.png differ diff --git a/Algorithms/1035.uncrossed-lines/README.md b/Algorithms/1035.uncrossed-lines/README.md new file mode 100755 index 000000000..b2fc5f696 --- /dev/null +++ b/Algorithms/1035.uncrossed-lines/README.md @@ -0,0 +1,43 @@ +# [1035. Uncrossed Lines](https://leetcode.com/problems/uncrossed-lines/) + +We write the integers of A and B (in the order they are given) on two separate horizontal lines. + +Now, we may draw connecting lines: a straight line connecting two numbers A[i] and B[j] such that: + +- `A[i] == B[j];` +- The line we draw does not intersect any other connecting (non-horizontal) line. + +Note that a connecting lines cannot intersect even at the endpoints: each number can only belong to one connecting line. + +Return the maximum number of connecting lines we can draw in this way. + +Example 1: + +![1](1.png) + +```text +Input: A = [1,4,2], B = [1,2,4] +Output: 2 +Explanation: We can draw 2 uncrossed lines as in the diagram. +We cannot draw 3 uncrossed lines, because the line from A[1]=4 to B[2]=4 will intersect the line from A[2]=2 to B[1]=2. +``` + +Example 2: + +```text +Input: A = [2,5,1,2,5], B = [10,5,2,1,5,2] +Output: 3 +``` + +Example 3: + +```text +Input: A = [1,3,7,1,7,5], B = [1,9,2,5,1] +Output: 2 +``` + +Note: + +1. `1 <= A.length <= 500` +1. `1 <= B.length <= 500` +1. `1 <= A[i], B[i] <= 2000` diff --git a/Algorithms/1035.uncrossed-lines/uncrossed-lines.go b/Algorithms/1035.uncrossed-lines/uncrossed-lines.go new file mode 100755 index 000000000..30aeec927 --- /dev/null +++ b/Algorithms/1035.uncrossed-lines/uncrossed-lines.go @@ -0,0 +1,26 @@ +package problem1035 + +// ref: https://leetcode.com/problems/uncrossed-lines/discuss/282842/JavaC%2B%2BPython-DP-The-Longest-Common-Subsequence +func maxUncrossedLines(A []int, B []int) int { + m, n := len(A), len(B) + dp := make([][]int, m+1) + dp[0] = make([]int, n+1) + for i := 1; i <= m; i++ { + dp[i] = make([]int, n+1) + for j := 1; j <= n; j++ { + if A[i-1] == B[j-1] { + dp[i][j] = 1 + dp[i-1][j-1] + } else { + dp[i][j] = max(dp[i][j-1], dp[i-1][j]) + } + } + } + return dp[m][n] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1035.uncrossed-lines/uncrossed-lines_test.go b/Algorithms/1035.uncrossed-lines/uncrossed-lines_test.go new file mode 100755 index 000000000..644fe8d7b --- /dev/null +++ b/Algorithms/1035.uncrossed-lines/uncrossed-lines_test.go @@ -0,0 +1,51 @@ +package problem1035 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans int +}{ + + { + []int{1, 4, 2}, + []int{1, 2, 4}, + 2, + }, + + { + []int{2, 5, 1, 2, 5}, + []int{10, 5, 2, 1, 5, 2}, + 3, + }, + + { + []int{1, 3, 7, 1, 7, 5}, + []int{1, 9, 2, 5, 1}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_maxUncrossedLines(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxUncrossedLines(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_maxUncrossedLines(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxUncrossedLines(tc.A, tc.B) + } + } +} diff --git a/Algorithms/1036.escape-a-large-maze/README.md b/Algorithms/1036.escape-a-large-maze/README.md new file mode 100755 index 000000000..befd8397b --- /dev/null +++ b/Algorithms/1036.escape-a-large-maze/README.md @@ -0,0 +1,34 @@ +# [1036. Escape a Large Maze](https://leetcode.com/problems/escape-a-large-maze/) + +In a 1 million by 1 million grid, the coordinates of each grid square are (x, y) with 0 <= x, y < 10^6. + +We start at the source square and want to reach the target square. Each move, we can walk to a 4-directionally adjacent square in the grid that isn't in the given list of blocked squares. + +Return true if and only if it is possible to reach the target square through a sequence of moves. + +Example 1: + +```text +Input: blocked = [[0,1],[1,0]], source = [0,0], target = [0,2] +Output: false +Explanation: +The target square is inaccessible starting from the source square, because we can't walk outside the grid. +``` + +Example 2: + +```text +Input: blocked = [], source = [0,0], target = [999999,999999] +Output: true +Explanation: +Because there are no blocked cells, it's possible to reach the target square. +``` + +Note: + +1. `0 <= blocked.length <= 200` +1. `blocked[i].length == 2` +1. `0 <= blocked[i][j] < 10^6` +1. `source.length == target.length == 2` +1. `0 <= source[i][j], target[i][j] < 10^6` +1. `source != target` diff --git a/Algorithms/1036.escape-a-large-maze/escape-a-large-maze.go b/Algorithms/1036.escape-a-large-maze/escape-a-large-maze.go new file mode 100755 index 000000000..575827977 --- /dev/null +++ b/Algorithms/1036.escape-a-large-maze/escape-a-large-maze.go @@ -0,0 +1,56 @@ +package problem1036 + +var dx = []int{0, 0, 1, -1} +var dy = []int{1, -1, 0, 0} + +// M is length and width of the large maze +const M = 1e6 + +// MAX is the largest number of points that can be enclosed by blocked +// because of len(blocked)<=200 +const MAX = 19900 + +func isEscapePossible(blocked [][]int, source []int, target []int) bool { + isBlocked := make(map[int]bool, len(blocked)) + for _, b := range blocked { + x, y := b[0], b[1] + isBlocked[x<<32+y] = true + } + // BFS + isOpen := func(source, target []int) bool { + tx, ty := target[0], target[1] + // + points := make([][]int, 0, MAX) + hasSeen := make(map[int]bool, MAX) + // + sx, sy := source[0], source[1] + points, hasSeen[sx<<32+sy] = append(points, source), true + // + for len(points) > 0 { + size := len(points) + for i := 0; i < size; i++ { + px, py := points[i][0], points[i][1] + for k := 0; k < 4; k++ { + x, y := px+dx[k], py+dy[k] + if x == tx && y == ty { + return true + } + p := x<<32 + y + if 0 <= x && x < M && + 0 <= y && y < M && + !isBlocked[p] && + !hasSeen[p] { + points, hasSeen[p] = append(points, []int{x, y}), true + } + } + } + if len(hasSeen) > MAX { + return true + } + points = points[size:] + } + return false + } + + return isOpen(source, target) && isOpen(target, source) +} diff --git a/Algorithms/1036.escape-a-large-maze/escape-a-large-maze_test.go b/Algorithms/1036.escape-a-large-maze/escape-a-large-maze_test.go new file mode 100755 index 000000000..1660c31ff --- /dev/null +++ b/Algorithms/1036.escape-a-large-maze/escape-a-large-maze_test.go @@ -0,0 +1,62 @@ +package problem1036 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + blocked [][]int + source []int + target []int + ans bool +}{ + + { + [][]int{{0, 199}, {1, 198}, {2, 197}, {3, 196}, {4, 195}, {5, 194}, {6, 193}, {7, 192}, {8, 191}, {9, 190}, {10, 189}, {11, 188}, {12, 187}, {13, 186}, {14, 185}, {15, 184}, {16, 183}, {17, 182}, {18, 181}, {19, 180}, {20, 179}, {21, 178}, {22, 177}, {23, 176}, {24, 175}, {25, 174}, {26, 173}, {27, 172}, {28, 171}, {29, 170}, {30, 169}, {31, 168}, {32, 167}, {33, 166}, {34, 165}, {35, 164}, {36, 163}, {37, 162}, {38, 161}, {39, 160}, {40, 159}, {41, 158}, {42, 157}, {43, 156}, {44, 155}, {45, 154}, {46, 153}, {47, 152}, {48, 151}, {49, 150}, {50, 149}, {51, 148}, {52, 147}, {53, 146}, {54, 145}, {55, 144}, {56, 143}, {57, 142}, {58, 141}, {59, 140}, {60, 139}, {61, 138}, {62, 137}, {63, 136}, {64, 135}, {65, 134}, {66, 133}, {67, 132}, {68, 131}, {69, 130}, {70, 129}, {71, 128}, {72, 127}, {73, 126}, {74, 125}, {75, 124}, {76, 123}, {77, 122}, {78, 121}, {79, 120}, {80, 119}, {81, 118}, {82, 117}, {83, 116}, {84, 115}, {85, 114}, {86, 113}, {87, 112}, {88, 111}, {89, 110}, {90, 109}, {91, 108}, {92, 107}, {93, 106}, {94, 105}, {95, 104}, {96, 103}, {97, 102}, {98, 101}, {99, 100}, {100, 99}, {101, 98}, {102, 97}, {103, 96}, {104, 95}, {105, 94}, {106, 93}, {107, 92}, {108, 91}, {109, 90}, {110, 89}, {111, 88}, {112, 87}, {113, 86}, {114, 85}, {115, 84}, {116, 83}, {117, 82}, {118, 81}, {119, 80}, {120, 79}, {121, 78}, {122, 77}, {123, 76}, {124, 75}, {125, 74}, {126, 73}, {127, 72}, {128, 71}, {129, 70}, {130, 69}, {131, 68}, {132, 67}, {133, 66}, {134, 65}, {135, 64}, {136, 63}, {137, 62}, {138, 61}, {139, 60}, {140, 59}, {141, 58}, {142, 57}, {143, 56}, {144, 55}, {145, 54}, {146, 53}, {147, 52}, {148, 51}, {149, 50}, {150, 49}, {151, 48}, {152, 47}, {153, 46}, {154, 45}, {155, 44}, {156, 43}, {157, 42}, {158, 41}, {159, 40}, {160, 39}, {161, 38}, {162, 37}, {163, 36}, {164, 35}, {165, 34}, {166, 33}, {167, 32}, {168, 31}, {169, 30}, {170, 29}, {171, 28}, {172, 27}, {173, 26}, {174, 25}, {175, 24}, {176, 23}, {177, 22}, {178, 21}, {179, 20}, {180, 19}, {181, 18}, {182, 17}, {183, 16}, {184, 15}, {185, 14}, {186, 13}, {187, 12}, {188, 11}, {189, 10}, {190, 9}, {191, 8}, {192, 7}, {193, 6}, {194, 5}, {195, 4}, {196, 3}, {197, 2}, {198, 1}, {199, 0}}, + []int{0, 0}, + []int{50, 50}, + true, + }, + + { + [][]int{{0, 199}, {1, 198}, {2, 197}, {3, 196}, {4, 195}, {5, 194}, {6, 193}, {7, 192}, {8, 191}, {9, 190}, {10, 189}, {11, 188}, {12, 187}, {13, 186}, {14, 185}, {15, 184}, {16, 183}, {17, 182}, {18, 181}, {19, 180}, {20, 179}, {21, 178}, {22, 177}, {23, 176}, {24, 175}, {25, 174}, {26, 173}, {27, 172}, {28, 171}, {29, 170}, {30, 169}, {31, 168}, {32, 167}, {33, 166}, {34, 165}, {35, 164}, {36, 163}, {37, 162}, {38, 161}, {39, 160}, {40, 159}, {41, 158}, {42, 157}, {43, 156}, {44, 155}, {45, 154}, {46, 153}, {47, 152}, {48, 151}, {49, 150}, {50, 149}, {51, 148}, {52, 147}, {53, 146}, {54, 145}, {55, 144}, {56, 143}, {57, 142}, {58, 141}, {59, 140}, {60, 139}, {61, 138}, {62, 137}, {63, 136}, {64, 135}, {65, 134}, {66, 133}, {67, 132}, {68, 131}, {69, 130}, {70, 129}, {71, 128}, {72, 127}, {73, 126}, {74, 125}, {75, 124}, {76, 123}, {77, 122}, {78, 121}, {79, 120}, {80, 119}, {81, 118}, {82, 117}, {83, 116}, {84, 115}, {85, 114}, {86, 113}, {87, 112}, {88, 111}, {89, 110}, {90, 109}, {91, 108}, {92, 107}, {93, 106}, {94, 105}, {95, 104}, {96, 103}, {97, 102}, {98, 101}, {99, 100}, {100, 99}, {101, 98}, {102, 97}, {103, 96}, {104, 95}, {105, 94}, {106, 93}, {107, 92}, {108, 91}, {109, 90}, {110, 89}, {111, 88}, {112, 87}, {113, 86}, {114, 85}, {115, 84}, {116, 83}, {117, 82}, {118, 81}, {119, 80}, {120, 79}, {121, 78}, {122, 77}, {123, 76}, {124, 75}, {125, 74}, {126, 73}, {127, 72}, {128, 71}, {129, 70}, {130, 69}, {131, 68}, {132, 67}, {133, 66}, {134, 65}, {135, 64}, {136, 63}, {137, 62}, {138, 61}, {139, 60}, {140, 59}, {141, 58}, {142, 57}, {143, 56}, {144, 55}, {145, 54}, {146, 53}, {147, 52}, {148, 51}, {149, 50}, {150, 49}, {151, 48}, {152, 47}, {153, 46}, {154, 45}, {155, 44}, {156, 43}, {157, 42}, {158, 41}, {159, 40}, {160, 39}, {161, 38}, {162, 37}, {163, 36}, {164, 35}, {165, 34}, {166, 33}, {167, 32}, {168, 31}, {169, 30}, {170, 29}, {171, 28}, {172, 27}, {173, 26}, {174, 25}, {175, 24}, {176, 23}, {177, 22}, {178, 21}, {179, 20}, {180, 19}, {181, 18}, {182, 17}, {183, 16}, {184, 15}, {185, 14}, {186, 13}, {187, 12}, {188, 11}, {189, 10}, {190, 9}, {191, 8}, {192, 7}, {193, 6}, {194, 5}, {195, 4}, {196, 3}, {197, 2}, {198, 1}, {199, 0}}, + []int{0, 0}, + []int{200, 200}, + false, + }, + + { + [][]int{{0, 1}, {1, 0}}, + []int{0, 0}, + []int{0, 2}, + false, + }, + + { + [][]int{}, + []int{0, 0}, + []int{999999, 999999}, + true, + }, + + // 可以有多个 testcase +} + +func Test_isEscapePossible(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isEscapePossible(tc.blocked, tc.source, tc.target), "输入:%v", tc) + } +} + +func Benchmark_isEscapePossible(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isEscapePossible(tc.blocked, tc.source, tc.target) + } + } +} diff --git a/Algorithms/1037.valid-boomerang/README.md b/Algorithms/1037.valid-boomerang/README.md new file mode 100755 index 000000000..001404bf1 --- /dev/null +++ b/Algorithms/1037.valid-boomerang/README.md @@ -0,0 +1,25 @@ +# [1037. Valid Boomerang](https://leetcode.com/problems/valid-boomerang/) + +A boomerang is a set of 3 points that are all distinct and not in a straight line. + +Given a list of three points in the plane, return whether these points are a boomerang. + +Example 1: + +```text +Input: [[1,1],[2,3],[3,2]] +Output: true +``` + +Example 2: + +```text +Input: [[1,1],[2,2],[3,3]] +Output: false +``` + +Note: + +1. `points.length == 3` +1. `points[i].length == 2` +1. `0 <= points[i][j] <= 100` diff --git a/Algorithms/1037.valid-boomerang/valid-boomerang.go b/Algorithms/1037.valid-boomerang/valid-boomerang.go new file mode 100755 index 000000000..3e7b20ec9 --- /dev/null +++ b/Algorithms/1037.valid-boomerang/valid-boomerang.go @@ -0,0 +1,8 @@ +package problem1037 + +func isBoomerang(p [][]int) bool { + x0, y0 := p[0][0], p[0][1] + x1, y1 := p[1][0], p[1][1] + x2, y2 := p[2][0], p[2][1] + return (x0-x2)*(y1-y2) != (y0-y2)*(x1-x2) +} diff --git a/Algorithms/1037.valid-boomerang/valid-boomerang_test.go b/Algorithms/1037.valid-boomerang/valid-boomerang_test.go new file mode 100755 index 000000000..15d316f90 --- /dev/null +++ b/Algorithms/1037.valid-boomerang/valid-boomerang_test.go @@ -0,0 +1,42 @@ +package problem1037 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + points [][]int + ans bool +}{ + + { + [][]int{{1, 1}, {2, 3}, {3, 2}}, + true, + }, + + { + [][]int{{1, 1}, {2, 2}, {3, 3}}, + false, + }, + + // 可以有多个 testcase +} + +func Test_isBoomerang(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isBoomerang(tc.points), "输入:%v", tc) + } +} + +func Benchmark_isBoomerang(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isBoomerang(tc.points) + } + } +} diff --git a/Algorithms/1038.binary-search-tree-to-greater-sum-tree/README.md b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/README.md new file mode 100755 index 000000000..a2147be40 --- /dev/null +++ b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/README.md @@ -0,0 +1,24 @@ +# [1038. Binary Search Tree to Greater Sum Tree](https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/) + +Given the root of a binary search tree with distinct values, modify it so that every node has a new value equal to the sum of the values of the original tree that are greater than or equal to node.val. + +As a reminder, a binary search tree is a tree that satisfies these constraints: + +- The left subtree of a node contains only nodes with keys less than the node's key. +- The right subtree of a node contains only nodes with keys greater than the node's key. +- Both the left and right subtrees must also be binary search trees. + +Example 1: + +![tree](tree.png) + +```text +Input: [4,1,6,0,2,5,7,null,null,null,3,null,null,null,8] +Output: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8] +``` + +Note: + +1. The number of nodes in the tree is between 1 and 100. +1. Each node will have value between 0 and 100. +1. The given tree is a binary search tree. diff --git a/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.go b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.go new file mode 100755 index 000000000..38a3e57b7 --- /dev/null +++ b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.go @@ -0,0 +1,24 @@ +package problem1038 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func bstToGst(root *TreeNode) *TreeNode { + dfs(root, 0) + return root +} + +func dfs(node *TreeNode, sum int) int { + if node == nil { + return sum + } + node.Val += dfs(node.Right, sum) + return dfs(node.Left, node.Val) +} diff --git a/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree_test.go b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree_test.go new file mode 100755 index 000000000..96267c8f9 --- /dev/null +++ b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree_test.go @@ -0,0 +1,41 @@ +package problem1038 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans []int +}{ + + { + []int{4, 1, 6, 0, 2, 5, 7, kit.NULL, kit.NULL, kit.NULL, 3, kit.NULL, kit.NULL, kit.NULL, 8}, + []int{30, 36, 21, 36, 35, 26, 15, kit.NULL, kit.NULL, kit.NULL, 33, kit.NULL, kit.NULL, kit.NULL, 8}, + }, + + // 可以有多个 testcase +} + +func Test_bstToGst(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := kit.Ints2TreeNode(tc.ans) + root := kit.Ints2TreeNode(tc.root) + ast.Equal(ans, bstToGst(root), "输入:%v", tc) + } +} + +func Benchmark_bstToGst(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + bstToGst(root) + } + } +} diff --git a/Algorithms/1038.binary-search-tree-to-greater-sum-tree/tree.png b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/tree.png new file mode 100644 index 000000000..fb2cfb543 Binary files /dev/null and b/Algorithms/1038.binary-search-tree-to-greater-sum-tree/tree.png differ diff --git a/Algorithms/1039.minimum-score-triangulation-of-polygon/2.png b/Algorithms/1039.minimum-score-triangulation-of-polygon/2.png new file mode 100644 index 000000000..e02318f5b Binary files /dev/null and b/Algorithms/1039.minimum-score-triangulation-of-polygon/2.png differ diff --git a/Algorithms/1039.minimum-score-triangulation-of-polygon/README.md b/Algorithms/1039.minimum-score-triangulation-of-polygon/README.md new file mode 100755 index 000000000..e0fa9b1ef --- /dev/null +++ b/Algorithms/1039.minimum-score-triangulation-of-polygon/README.md @@ -0,0 +1,38 @@ +# [1039. Minimum Score Triangulation of Polygon](https://leetcode.com/problems/minimum-score-triangulation-of-polygon/) + +Given N, consider a convex N-sided polygon with vertices labelled A[0], A[i], ..., A[N-1] in clockwise order. + +Suppose you triangulate the polygon into N-2 triangles. For each triangle, the value of that triangle is the product of the labels of the vertices, and the total score of the triangulation is the sum of these values over all N-2 triangles in the triangulation. + +Return the smallest possible total score that you can achieve with some triangulation of the polygon. + +Example 1: + +```text +Input: [1,2,3] +Output: 6 +Explanation: The polygon is already triangulated, and the score of the only triangle is 6. +``` + +Example 2: + +![2](2.png) + +```text +Input: [3,7,4,5] +Output: 144 +Explanation: There are two triangulations, with possible scores: 3*7*5 + 4*5*7 = 245, or 3*4*5 + 3*4*7 = 144. The minimum score is 144. +``` + +Example 3: + +```text +Input: [1,3,1,4,1,5] +Output: 13 +Explanation: The minimum score triangulation has score 1*1*3 + 1*1*4 + 1*1*5 + 1*1*1 = 13. +``` + +Note: + +1. `3 <= A.length <= 50` +1. `1 <= A[i] <= 100` diff --git a/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon.go b/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon.go new file mode 100755 index 000000000..218d93dec --- /dev/null +++ b/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon.go @@ -0,0 +1,23 @@ +package problem1039 + +func minScoreTriangulation(A []int) int { + n := len(A) + dp := [50][50]int{} + for d := 2; d < n; d++ { + for i := 0; i+d < n; i++ { + k := i + d + dp[i][k] = 1 << 30 + for j := i + 1; j < k; j++ { + dp[i][k] = min(dp[i][k], dp[i][j]+dp[j][k]+A[i]*A[j]*A[k]) + } + } + } + return dp[0][n-1] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon_test.go b/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon_test.go new file mode 100755 index 000000000..346d824ec --- /dev/null +++ b/Algorithms/1039.minimum-score-triangulation-of-polygon/minimum-score-triangulation-of-polygon_test.go @@ -0,0 +1,62 @@ +package problem1039 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans int +}{ + + { + []int{1, 2, 3, 4, 1, 6, 7, 8, 1, 10, 12}, + 255, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9}, + 238, + }, + + { + []int{2, 2, 2, 2, 1}, + 12, + }, + + { + []int{1, 3, 1, 4, 1, 5}, + 13, + }, + + { + []int{1, 2, 3}, + 6, + }, + + { + []int{3, 7, 4, 5}, + 144, + }, + + // 可以有多个 testcase +} + +func Test_minScoreTriangulation(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minScoreTriangulation(tc.A), "输入:%v", tc) + } +} + +func Benchmark_minScoreTriangulation(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minScoreTriangulation(tc.A) + } + } +} diff --git a/Algorithms/1040.moving-stones-until-consecutive-ii/README.md b/Algorithms/1040.moving-stones-until-consecutive-ii/README.md new file mode 100755 index 000000000..6464812d7 --- /dev/null +++ b/Algorithms/1040.moving-stones-until-consecutive-ii/README.md @@ -0,0 +1,44 @@ +# [1040. Moving Stones Until Consecutive II](https://leetcode.com/problems/moving-stones-until-consecutive-ii/) + +On an infinite number line, the position of the i-th stone is given by stones[i]. Call a stone an endpoint stone if it has the smallest or largest position. + +Each turn, you pick up an endpoint stone and move it to an unoccupied position so that it is no longer an endpoint stone. + +In particular, if the stones are at say, stones = [1,2,5], you cannot move the endpoint stone at position 5, since moving it to any position (such as 0, or 3) will still keep that stone as an endpoint stone. + +The game ends when you cannot make any more moves, ie. the stones are in consecutive positions. + +When the game ends, what is the minimum and maximum number of moves that you could have made? Return the answer as an length 2 array: answer = [minimum_moves, maximum_moves] + +Example 1: + +```text +Input: [7,4,9] +Output: [1,2] +Explanation: +We can move 4 -> 8 for one move to finish the game. +Or, we can move 9 -> 5, 4 -> 6 for two moves to finish the game. +``` + +Example 2: + +```text +Input: [6,5,4,3,10] +Output: [2,3] +We can move 3 -> 8 then 10 -> 7 to finish the game. +Or, we can move 3 -> 7, 4 -> 8, 5 -> 9 to finish the game. +Notice we cannot move 10 -> 2 to finish the game, because that would be an illegal move. +``` + +Example 3: + +```text +Input: [100,101,104,102,103] +Output: [0,0] +``` + +Note: + +1. `3 <= stones.length <= 10^4` +1. `1 <= stones[i] <= 10^9` +1. `stones[i] have distinct values.` diff --git a/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii.go b/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii.go new file mode 100755 index 000000000..542543e1c --- /dev/null +++ b/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii.go @@ -0,0 +1,42 @@ +package problem1040 + +import "sort" + +func numMovesStonesII(stones []int) []int { + sort.Ints(stones) + return []int{low(stones), high(stones)} +} + +func high(s []int) int { + n := len(s) + return max(s[n-1]-s[1], s[n-2]-s[0]) - n + 2 +} + +func low(s []int) int { + n := len(s) + // corner case + if (s[n-2]-s[0] == n-2 && s[n-1]-s[n-2] > 2) || + (s[n-1]-s[1] == n-2 && s[1]-s[0] > 2) { + return 2 + } + // sliding window is s[i:j] + width, i, j := 0, 0, 1 + for ; j < n; j++ { + if s[j]-s[i] < n { + continue + } + width = max(width, j-i) + i = j + } + width = max(width, j-i) + // finally, all stone move into maxWidth windows + // so need move n-width stones + return n - width +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii_test.go b/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii_test.go new file mode 100755 index 000000000..96044a14b --- /dev/null +++ b/Algorithms/1040.moving-stones-until-consecutive-ii/moving-stones-until-consecutive-ii_test.go @@ -0,0 +1,97 @@ +package problem1040 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones []int + ans []int +}{ + + { + []int{6, 5, 4, 3, 10}, + []int{2, 3}, + }, + + { + []int{1, 2, 3, 4, 5, 111, 112, 113, 114, 115}, + []int{5, 105}, + }, + + { + []int{1, 2, 3, 4, 5, 11, 12, 13, 14, 15}, + []int{5, 5}, + }, + + { + []int{1, 3, 900, 904, 1000}, + []int{3, 994}, + }, + + { + []int{1, 50, 900, 905, 170000}, + []int{4, 169947}, + }, + + { + []int{1, 50, 900, 904, 170000}, + []int{3, 169947}, + }, + + { + []int{1, 50, 900, 13000, 170000}, + []int{4, 169947}, + }, + + { + []int{4, 8, 9}, + []int{2, 3}, + }, + + { + []int{1, 5, 9}, + []int{2, 3}, + }, + + { + []int{1, 5, 9, 13}, + []int{3, 6}, + }, + + { + []int{1, 50, 900, 13000}, + []int{3, 12948}, + }, + + { + []int{7, 4, 9}, + []int{1, 2}, + }, + + { + []int{100, 101, 104, 102, 103}, + []int{0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_numMovesStonesII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numMovesStonesII(tc.stones), "输入:%v", tc) + } +} + +func Benchmark_numMovesStonesII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numMovesStonesII(tc.stones) + } + } +} diff --git a/Algorithms/1041.robot-bounded-in-circle/README.md b/Algorithms/1041.robot-bounded-in-circle/README.md new file mode 100755 index 000000000..a252229c2 --- /dev/null +++ b/Algorithms/1041.robot-bounded-in-circle/README.md @@ -0,0 +1,44 @@ +# [1041. Robot Bounded In Circle](https://leetcode.com/problems/robot-bounded-in-circle/) + +On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions: + +- "G": go straight 1 unit; +- "L": turn 90 degrees to the left; +- "R": turn 90 degrees to the right. + +The robot performs the instructions given in order, and repeats them forever. + +Return true if and only if there exists a circle in the plane such that the robot never leaves the circle. + +Example 1: + +```text +Input: "GGLLGG" +Output: true +Explanation: +The robot moves from (0,0) to (0,2), turns 180 degrees, and then returns to (0,0). +When repeating these instructions, the robot remains in the circle of radius 2 centered at the origin. +``` + +Example 2: + +```text +Input: "GG" +Output: false +Explanation: +The robot moves north indefinitely. +``` + +Example 3: + +```text +Input: "GL" +Output: true +Explanation: +The robot moves from (0, 0) -> (0, 1) -> (-1, 1) -> (-1, 0) -> (0, 0) -> ... +``` + +Note: + +1. `1 <= instructions.length <= 100` +1. `instructions[i] is in {'G', 'L', 'R'}` diff --git a/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle.go b/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle.go new file mode 100755 index 000000000..f48b6cc00 --- /dev/null +++ b/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle.go @@ -0,0 +1,61 @@ +package problem1041 + +func isRobotBounded(instructions string) bool { + print(north, east, south, west) + r := newRobot() + for _, i := range instructions { + r.receive(i) + } + return (r.x == 0 && r.y == 0) || // 每轮都会回到原点,就永远会回到原点 + (r.d != north) // 第一轮后,没有回到原点,但是方向改变,至多 4 轮后,还是会回到原点 +} + +type direction int + +const ( + north direction = iota + east + south + west +) + +type robot struct { + d direction + x, y int +} + +func newRobot() *robot { + return &robot{ + d: north, + } +} + +func (r *robot) receive(instruction rune) { + if instruction == 'G' { + r.move() + } else { + r.turn(instruction) + } +} + +func (r *robot) move() { + switch r.d { + case north: + r.y++ + case east: + r.x++ + case south: + r.y-- + case west: + r.x-- + } +} + +func (r *robot) turn(instruction rune) { + if instruction == 'R' { + r.d++ + } else { + r.d += 3 + } + r.d %= 4 +} diff --git a/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle_test.go b/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle_test.go new file mode 100755 index 000000000..71ccc6a85 --- /dev/null +++ b/Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle_test.go @@ -0,0 +1,62 @@ +package problem1041 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + instructions string + ans bool +}{ + + { + "GLRLLGLL", + true, + }, + + { + "GLGLGGLGL", + false, + }, + + { + "LL", + true, + }, + + { + "GGLLGG", + true, + }, + + { + "GG", + false, + }, + + { + "GL", + true, + }, + + // 可以有多个 testcase +} + +func Test_isRobotBounded(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, isRobotBounded(tc.instructions), "输入:%v", tc) + } +} + +func Benchmark_isRobotBounded(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + isRobotBounded(tc.instructions) + } + } +} diff --git a/Algorithms/1042.flower-planting-with-no-adjacent/README.md b/Algorithms/1042.flower-planting-with-no-adjacent/README.md new file mode 100755 index 000000000..22aa64e14 --- /dev/null +++ b/Algorithms/1042.flower-planting-with-no-adjacent/README.md @@ -0,0 +1,39 @@ +# [1042. Flower Planting With No Adjacent](https://leetcode.com/problems/flower-planting-with-no-adjacent/) + +You have N gardens, labelled 1 to N. In each garden, you want to plant one of 4 types of flowers. + +paths[i] = [x, y] describes the existence of a bidirectional path from garden x to garden y. + +Also, there is no garden that has more than 3 paths coming into or leaving it. + +Your task is to choose a flower type for each garden such that, for any two gardens connected by a path, they have different types of flowers. + +Return any such a choice as an array answer, where answer[i] is the type of flower planted in the (i+1)-th garden. The flower types are denoted 1, 2, 3, or 4. It is guaranteed an answer exists. + +Example 1: + +```text +Input: N = 3, paths = [[1,2],[2,3],[3,1]] +Output: [1,2,3] +``` + +Example 2: + +```text +Input: N = 4, paths = [[1,2],[3,4]] +Output: [1,2,1,2] +``` + +Example 3: + +```text +Input: N = 4, paths = [[1,2],[2,3],[3,4],[4,1],[1,3],[2,4]] +Output: [1,2,3,4] +``` + +Note: + +1. `1 <= N <= 10000` +1. `0 <= paths.size <= 20000` +1. `No garden has 4 or more paths coming into or leaving it.` +1. `It is guaranteed an answer exists.` diff --git a/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent.go b/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent.go new file mode 100755 index 000000000..f39b5df43 --- /dev/null +++ b/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent.go @@ -0,0 +1,24 @@ +package problem1042 + +func gardenNoAdj(N int, paths [][]int) []int { + connects := make([][]int, N) + for _, p := range paths { + i, j := p[0]-1, p[1]-1 // i,j = x-1, y-1 + connects[i] = append(connects[i], j) + connects[j] = append(connects[j], i) + } + res := make([]int, N) + for i := 0; i < N; i++ { + isUsed := [5]bool{} + for _, j := range connects[i] { + isUsed[res[j]] = true + } + for color := 1; color <= 4; color++ { + if !isUsed[color] { + res[i] = color + break + } + } + } + return res +} diff --git a/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent_test.go b/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent_test.go new file mode 100755 index 000000000..d3e49e841 --- /dev/null +++ b/Algorithms/1042.flower-planting-with-no-adjacent/flower-planting-with-no-adjacent_test.go @@ -0,0 +1,57 @@ +package problem1042 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + N int + paths [][]int + ans []int +}{ + + { + 5, + [][]int{{4, 1}, {4, 2}, {4, 3}, {2, 5}, {1, 2}, {1, 5}}, + []int{1, 2, 1, 3, 3}, + }, + + { + 3, + [][]int{{1, 2}, {2, 3}, {3, 1}}, + []int{1, 2, 3}, + }, + + { + 4, + [][]int{{1, 2}, {3, 4}}, + []int{1, 2, 1, 2}, + }, + + { + 4, + [][]int{{1, 2}, {2, 3}, {3, 4}, {4, 1}, {1, 3}, {2, 4}}, + []int{1, 2, 3, 4}, + }, + + // 可以有多个 testcase +} + +func Test_gardenNoAdj(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, gardenNoAdj(tc.N, tc.paths), "输入:%v", tc) + } +} + +func Benchmark_gardenNoAdj(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + gardenNoAdj(tc.N, tc.paths) + } + } +} diff --git a/Algorithms/1043.partition-array-for-maximum-sum/README.md b/Algorithms/1043.partition-array-for-maximum-sum/README.md new file mode 100755 index 000000000..e1c3a8e9b --- /dev/null +++ b/Algorithms/1043.partition-array-for-maximum-sum/README.md @@ -0,0 +1,18 @@ +# [1043. Partition Array for Maximum Sum](https://leetcode.com/problems/partition-array-for-maximum-sum/) + +Given an integer array A, you partition the array into (contiguous) subarrays of length at most K. After partitioning, each subarray has their values changed to become the maximum value of that subarray. + +Return the largest sum of the given array after partitioning. + +Example 1: + +```text +Input: A = [1,15,7,9,2,5,10], K = 3 +Output: 84 +Explanation: A becomes [15,15,15,9,10,10,10] +``` + +Note: + +1. `1 <= K <= A.length <= 500` +1. `0 <= A[i] <= 10^6` diff --git a/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum.go b/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum.go new file mode 100755 index 000000000..f38f2be4f --- /dev/null +++ b/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum.go @@ -0,0 +1,24 @@ +package problem1043 + +// ref: https://leetcode.com/problems/partition-array-for-maximum-sum/discuss/290863/JavaC%2B%2BPython-DP +func maxSumAfterPartitioning(A []int, K int) int { + n := len(A) + dp := make([]int, n+1) + // A's length grows up from 1 to n + for l := 1; l <= n; l++ { + m := 0 // max value of last k items in A[:l] + for k := 1; k <= K && 0 <= l-k; k++ { + m = max(m, A[l-k]) + sum := dp[l-k] + m*k + dp[l] = max(dp[l], sum) + } + } + return dp[n] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum_test.go b/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum_test.go new file mode 100755 index 000000000..fa09166f5 --- /dev/null +++ b/Algorithms/1043.partition-array-for-maximum-sum/partition-array-for-maximum-sum_test.go @@ -0,0 +1,57 @@ +package problem1043 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + K int + ans int +}{ + + { + []int{322257, 540837, 18171, 364098, 161511, 717990, 678976, 295957, 525576, 912910, 302841, 807371, 774141, 973354, 343843, 742131, 839995, 111282, 772395, 5921, 122534, 750377, 683899, 734664, 184593, 789400, 626212, 809214, 934136, 163420, 452442, 713789, 269552, 932607, 172046, 89529, 277733, 222352, 957023, 867042, 160651, 259497, 476642, 978097, 212742, 714383, 932052, 399211, 894147, 766649, 409010, 763214, 459126, 833028, 777826, 294076, 17566, 538156, 124552, 641, 606726, 429007, 507307, 360562, 133147, 833321, 496061, 966033, 801581, 695725, 323273, 888523, 260890, 835191, 305749, 410437, 505257, 235238, 535199, 66423, 63758, 654191, 288667, 760215, 837132, 41380, 256744, 474781, 302571, 486974, 93945, 417524, 733278, 338240, 165821, 938705, 722138, 676130, 887649, 130572, 585556, 126289, 508926, 355353, 812298, 138788, 751157, 20720, 832600, 562373, 529647, 819221, 57234, 345991, 129691, 240013, 224203, 436010, 969914, 320771, 512865, 735790, 299628, 724880, 359109, 295235, 352639, 514634, 527186, 352191, 958072, 281078, 286045, 983549, 222715, 419519, 234599, 439778, 344828, 901962, 266790, 572029, 551645, 775030, 433586, 852788, 654154, 709948, 707145, 940333, 434841, 548197, 535555, 302255, 99577, 468017, 258874, 244736, 779744, 582486, 66596, 582593, 206343, 571625, 543211, 948901, 259730, 720218, 391355, 4441, 512392, 256717, 264162, 689384, 108804, 743139, 456167, 622153, 34594, 642958, 682978, 492462, 960588, 544889, 59853, 618158, 826481, 46500, 848227, 441833, 60210, 971753, 993798, 106622, 265063, 323422, 150184, 927954, 7368, 233027, 803151, 715037, 741914, 576419, 862192, 47536, 876455, 190304, 672899, 263957, 308829, 925787, 99541, 311184, 654650, 247786, 236849, 372981, 976532, 975655, 893372, 744998, 33851, 914471, 790591, 958015, 559603, 597950, 283947, 386643, 168667, 867857, 105367, 528454, 73767, 928997, 534173, 723272, 416051, 878341, 753212, 446378, 375998, 65721, 866187, 33706, 449084, 397460, 850849, 111453, 747319, 501296, 115045, 712431, 34914, 744459, 665120, 548829, 680009, 889090, 804508, 1131, 216652, 592160, 619079, 250083, 451008, 387734, 221043, 34718, 503942, 807191, 890799, 403017, 558917, 187498, 753156, 161889, 326616, 748336, 753942, 648694, 225315, 388228, 418217, 916129, 435637, 152945, 353274, 51543, 819598, 320869, 329985, 708486, 555732, 291431, 566179, 195921, 708680, 723429, 62059, 617193, 713490, 839672, 427061, 787674, 658480, 758624, 426935, 87777, 146592, 143149, 691270, 228944, 21659, 912288, 405247, 274058, 156786, 742941, 346777, 474383, 355448, 568771, 666124, 677562, 765587, 858179, 528256, 961677, 611111, 818806, 897460, 208616, 659738, 64081, 207641, 889609, 892033, 133501, 266857, 621606, 794935, 396372, 567053, 52331, 582094, 104977, 569902, 496245, 390154, 550784, 55238, 641297, 23741, 860725, 861067, 283503, 924066, 404874, 392211, 897657, 46748, 490894, 304656, 751827, 221437, 730461, 421321, 695259, 158087, 259472, 14837, 744332, 850752, 149834, 924528, 43174, 374614, 567583, 410071, 636843, 783718, 844101, 951446, 703700, 201046, 511629, 145996, 54378, 241686, 285229, 2299, 992962, 948612, 215175, 710462, 977662, 184503, 939465, 439086, 18999, 536186, 659815, 203013, 965787, 255983, 456806, 840014, 261442, 770277, 955892, 940019, 884343, 686299, 676304, 716247, 11141, 236451, 124411, 478090, 680125, 175743, 178750, 461502, 633006, 694179, 47960, 21926, 320034, 524028, 732852, 603541, 799317, 334915, 276857, 253882, 262465, 828135, 394678, 384312, 922363, 222351, 746409, 20062, 157582, 131931, 252307, 626638, 78825, 767279, 505875, 153744, 975663, 64725, 826981, 427925, 926691, 748580, 289254, 3199, 561583, 109612, 470102, 130143, 583840, 224354, 775172, 609376, 235902, 351312, 271143, 575355, 324896, 787099, 855052, 748572, 999311, 926808, 139753, 866799, 537768, 788685, 199740, 950081, 835325, 162448, 518463, 781043, 752546, 985988, 237700, 801304, 846762, 254587, 448003, 91525, 308020, 237083, 12293}, + 30, + 483667362, + }, + + { + []int{322257, 540837, 18171, 364098, 161511, 717990, 678976, 295957, 525576, 912910, 302841, 807371, 774141, 973354, 343843, 742131, 839995, 111282, 772395, 5921, 122534, 750377, 683899, 734664, 184593, 789400, 626212, 809214, 934136, 163420, 452442, 713789, 269552, 932607, 172046, 89529, 277733, 222352, 957023, 867042, 160651, 259497, 476642, 978097, 212742, 714383, 932052, 399211, 894147, 766649, 409010, 763214, 459126, 833028, 777826, 294076, 17566, 538156, 124552, 641, 606726, 429007, 507307, 360562, 133147, 833321, 496061, 966033, 801581, 695725, 323273, 888523, 260890, 835191, 305749, 410437, 505257, 235238, 535199, 66423, 63758, 654191, 288667, 760215, 837132, 41380, 256744, 474781, 302571, 486974, 93945, 417524, 733278, 338240, 165821, 938705, 722138, 676130, 887649, 130572, 585556, 126289, 508926, 355353, 812298, 138788, 751157, 20720, 832600, 562373, 529647, 819221, 57234, 345991, 129691, 240013, 224203, 436010, 969914, 320771, 512865, 735790, 299628, 724880, 359109, 295235, 352639, 514634, 527186, 352191, 958072, 281078, 286045, 983549, 222715, 419519, 234599, 439778, 344828, 901962, 266790, 572029, 551645, 775030, 433586, 852788, 654154, 709948, 707145, 940333, 434841, 548197, 535555, 302255, 99577, 468017, 258874, 244736, 779744, 582486, 66596, 582593, 206343, 571625, 543211, 948901, 259730, 720218, 391355, 4441, 512392, 256717, 264162, 689384, 108804, 743139, 456167, 622153, 34594, 642958, 682978, 492462, 960588, 544889, 59853, 618158, 826481, 46500, 848227, 441833, 60210, 971753, 993798, 106622, 265063, 323422, 150184, 927954, 7368, 233027, 803151, 715037, 741914, 576419, 862192, 47536, 876455, 190304, 672899, 263957, 308829, 925787, 99541, 311184, 654650, 247786, 236849, 372981, 976532, 975655, 893372, 744998, 33851, 914471, 790591, 958015, 559603, 597950, 283947, 386643, 168667, 867857, 105367, 528454, 73767, 928997, 534173, 723272, 416051, 878341, 753212, 446378, 375998, 65721, 866187, 33706, 449084, 397460, 850849, 111453, 747319, 501296, 115045, 712431, 34914, 744459, 665120, 548829, 680009, 889090, 804508, 1131, 216652, 592160, 619079, 250083, 451008, 387734, 221043, 34718, 503942, 807191, 890799, 403017, 558917, 187498, 753156, 161889, 326616, 748336, 753942, 648694, 225315, 388228, 418217, 916129, 435637, 152945, 353274, 51543, 819598, 320869, 329985, 708486, 555732, 291431, 566179, 195921, 708680, 723429, 62059, 617193, 713490, 839672, 427061, 787674, 658480, 758624, 426935, 87777, 146592, 143149, 691270, 228944, 21659, 912288, 405247, 274058, 156786, 742941, 346777, 474383, 355448, 568771, 666124, 677562, 765587, 858179, 528256, 961677, 611111, 818806, 897460, 208616, 659738, 64081, 207641, 889609, 892033, 133501, 266857, 621606, 794935, 396372, 567053, 52331, 582094, 104977, 569902, 496245, 390154, 550784, 55238, 641297, 23741, 860725, 861067, 283503, 924066, 404874, 392211, 897657, 46748, 490894, 304656, 751827, 221437, 730461, 421321, 695259, 158087, 259472, 14837, 744332, 850752, 149834, 924528, 43174, 374614, 567583, 410071, 636843, 783718, 844101, 951446, 703700, 201046, 511629, 145996, 54378, 241686, 285229, 2299, 992962, 948612, 215175, 710462, 977662, 184503, 939465, 439086, 18999, 536186, 659815, 203013, 965787, 255983, 456806, 840014, 261442, 770277, 955892, 940019, 884343, 686299, 676304, 716247, 11141, 236451, 124411, 478090, 680125, 175743, 178750, 461502, 633006, 694179, 47960, 21926, 320034, 524028, 732852, 603541, 799317, 334915, 276857, 253882, 262465, 828135, 394678, 384312, 922363, 222351, 746409, 20062, 157582, 131931, 252307, 626638, 78825, 767279, 505875, 153744, 975663, 64725, 826981, 427925, 926691, 748580, 289254, 3199, 561583, 109612, 470102, 130143, 583840, 224354, 775172, 609376, 235902, 351312, 271143, 575355, 324896, 787099, 855052, 748572, 999311, 926808, 139753, 866799, 537768, 788685, 199740, 950081, 835325, 162448, 518463, 781043, 752546, 985988, 237700, 801304, 846762, 254587, 448003, 91525, 308020, 237083, 12293}, + 1, + 247363899, + }, + + { + []int{10, 9, 3, 2}, + 2, + 30, + }, + + { + []int{1, 15, 7, 9, 2, 5, 10}, + 3, + 84, + }, + + // 可以有多个 testcase +} + +func Test_maxSumAfterPartitioning(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxSumAfterPartitioning(tc.A, tc.K), "输入:%v", tc) + } +} + +func Benchmark_maxSumAfterPartitioning(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSumAfterPartitioning(tc.A, tc.K) + } + } +} diff --git a/Algorithms/1044.longest-duplicate-substring/README.md b/Algorithms/1044.longest-duplicate-substring/README.md new file mode 100755 index 000000000..68a307f75 --- /dev/null +++ b/Algorithms/1044.longest-duplicate-substring/README.md @@ -0,0 +1,24 @@ +# [1044. Longest Duplicate Substring](https://leetcode.com/problems/longest-duplicate-substring/) + +Given a string S, consider all duplicated substrings: (contiguous) substrings of S that occur 2 or more times. (The occurrences may overlap.) + +Return any duplicated substring that has the longest possible length. (If S does not have a duplicated substring, the answer is "".) + +Example 1: + +```text +Input: "banana" +Output: "ana" +``` + +Example 2: + +```text +Input: "abcd" +Output: "" +``` + +Note: + +1. `2 <= S.length <= 10^5` +1. `S consists of lowercase English letters.` diff --git a/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring.go b/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring.go new file mode 100755 index 000000000..c35d6f111 --- /dev/null +++ b/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring.go @@ -0,0 +1,30 @@ +package problem1044 + +func longestDupSubstring(S string) string { + res := "" + + isExist := func(L int) bool { + seen := make(map[string]bool, len(S)-L+2) + for i := 0; i+L <= len(S); i++ { + sub := S[i : i+L] + if seen[sub] { + res = sub + return true + } + seen[sub] = true + } + return false + } + + lo, hi := 0, len(S) + for lo < hi { + mi := (lo + hi + 1) / 2 + if isExist(mi) { + lo = mi + } else { + hi = mi - 1 + } + } + + return res +} diff --git a/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring_test.go b/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring_test.go new file mode 100755 index 000000000..c0ab83d4e --- /dev/null +++ b/Algorithms/1044.longest-duplicate-substring/longest-duplicate-substring_test.go @@ -0,0 +1,73 @@ +package problem1044 + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "baaaaaababbbbbaaababaaabbabbabbbaabaaaaabbbaaababaabbbabbbabaaabbaabbabbbbbbbaabbabbabababbabbabaababbaabababbabbaabbabaaabbaaaaaaabbaabaabbababbabbbbaaaaabaabaaaabbabaaaabbbbbabaaabbababbbbaabbaabbaaaabbbbaabbababbaaabbbbabbabaaaaabbabaaaabaabaabbbabababaaababaabaabbabbbbaabbabbabaaaababbbaabbbbaaabbabbbbabbbaaaabbbaabbaabaaabaaaaaabbbbbabbbbbbabaabbbaababaaabbaabbabbbbbbbbbaaabaababaaabbbabaaaabbbabaaaabbbbaaaaaabbaaaaabbaaaababaaaaaaababbaaabbbbaababbaabbaababaaabaabbababbbabaaaabbbbaabbabaabbbaaaaabbabbbbbbabaaaaaaaabbaaabbbbbaabbaaababbaaaababbaaabbbbbbabbbbaabbaabababbbbaaaaaaaabaababaabbbababaabbaaaaabbaaabaaababbabbbabbbaaabaaaabbaabbaaabababbbaaaaaababaaabaabaababaaabbbbbbbbbbbaaabaaaabbaabababbaabbbbabbaabbaabaaaabbabbbbbaaaaaabbaabbabaabbbbbaabaabaabbababbbaaaabaaabbabbaaaaababbaabbabaaabbbabbaaababaaabbaaabbabbaababaaabbbabbabbbbaaaabbbaababbbababababaaababaaaababaababbaababbaaabaaaaababaababbaaabbbabaababababbabaabaaabaababaabbbaabaaaabaaabbbaabbbbbaaaaaabaabbabaaaababababaabaabbabbabbbbbbbbabaaaababbbbbbbbaabaabbaaaabbaaaaabbbbaaabbaababbababbaaaaabaaaabaababaabbbbbbaaaababababaaabbabbbabaaaabbbaabaabbaabbaaaabaababaaaabbaabaaabbabaaabaaaabbabaabbbaabbaaaabbabaabbabaabaabbbbaabaabbbaaaabbbbbbbbaaaabbbbbbbbbabababaabbaabbaaaabaabbbbaaaabbababaaabbaaaaaaabbbbbaabaaaaaaabbabbbbaaabaababbaabbbbabaabbbaabbbabbbbbaaabbbabbaabbaabaababaaabbaabababbbaabbaabbbbbababbaaaabbababbaaaabbabbbaabbbbbaabaaaabaabaabbaabababbbabbabbabbbbaaaababbbbbbbbbababbaababbabaaabbabbaabbbbbbbbaaaabaaabaaababaaaabaaabbaaababbbabaaabaaabbababbbabbbbaaabbaaabaabbbaaaabbbaaabbaabbbbabababbaabbbaabaaaabbbabaabbbababbbbabbabbbbabaaaabaababbabaaabbbbbbaaabbbbaababbabbbbaabbaaabbaababbbbbabaaaaabbbbbbaabaaaaaaabbabbaabbbaabaaaaaabbbabbbbaabbbabababaabaaaaaaabaababaabbaaabbabababbababbbbbabaababbaaabbababbbaabaababbbaabbbabbbabaabaabbbbabbaaababaabbabaaabaaaaaabaabaabaabbbaaaaabbabbbbbaaaaabaabbabbbbbabaaabbaaaabbabbaabbbaabbabbbbaabbbabaabbaabbabaabaaaaaaabbaabbbababbaabbbbaaaabaaabbbaaaababababbbbabbbbbabaabaabbbbabaaaabbabbaabbabaaababaabbbbbbaabbbbbababaaabbbbbbaaaabaaaababbbaabaabbbabbabbbbbaabbbabaabbbbbbbababaabbbabbbbbbbabbabaabbbaabbbbababbabbbabababbabbabbaaaabbabbbbabbbaaabbbabaabbbabaaabbbbbabbaaaaaababbaaaababaaabbbaabbabbbababbbabbbbabbababababbbbabbbabbabbabbaaaabaabbabbabbaaaabaabaabaabbaaabbabbbbbbaabaabaabbabaaaaaabbababaababbbbaabbaababababbbaaabbabbbababbbbbbabaaabbbbbabbbbbbbbabaaaaaabababaaaabbaabbbbaaabbbaaaabaabbbaaaabaabbbaabbbbaababbbabbbababaaababababbbabbbbbbbbbaaaabababbbaaabaaaaabaaababbbabbabbbaaabbbaababbaaababbbbbbbaaabbbabaaaababbabbabaaababbababbbaabbbbbabaabbbbbabbbbbbabbbabbbaababbbababaaabbbbbaaabbaaaaaabbbbaabaabaabbabaaaaaaaabbbbaaaabaaabaaaabaabaaabaaaabbbaaaaaababbbababbbaaababaababbbaaaabaabbbbaababbbbbabbaabaaaababaababaaababbbabaabaaaabbbbabbbbaaabaaabaaabababaaabaaabaabaaaabbbbaabbaabaaabaaabaabbbbbbaaaaababbbbbabaaaabaaabbaabaababbbabbaababaaaabbbabbaabaaabaabbbaabbaaaababbbababaabbbbbababaaabbbaaabbaaabaabbabbbbbabbabaabaababababbabababbbabaaaabbbbabbaabaaaaaaaabbaaaaaaabaababbbbaababababbabbaababaabbabbbaaaabbaaabababbabbaabbbbabbbbbaaaaaaababaaaabbabbbbbbaabbbbbabbaababbbababbaaabbbbbabbbaaabababbaaabbaabaabbabaabbbbbaababbabbabbaabbbbbaaaabbbaaaabbaaaabaabaabbbabaabbabbbbaaabbbabbabbabaabbabbaabbabaaabaaabaabbabbaabbbabbbbaabbbbabaabaaaaabaaabbbbabbbaabbabbaabaabbabbbabbbbbbbbbabaabbbaabaaaaaaabaaaaababbabaabaaabbbbbabbbabbbbbaabbbabbaaaabababbbaaaaababbaabbbbaabbaabababbbabaabbbbbabaabbabaaabbabaabbabaaaaabaaaaaaabbbaabbbaaaababbaababbbbaabaababaaaabbbbabbbaaaaaababaaaabbaaaabbaababbabaaabbabababbbbaabbbbbbbbbbbbabbbbabababaaaaaaaababaaababbbbabaaaabababbbaabbaabbbbbaabaaabbbabaaaaaabaabbbbabbaaabbbaabbbababbabaabbbbbabaabbaababaababbbabaaaabaababaaabbabbbbbababbbbaaababbaaaabbababbbbaaabaabbbbbaaabaaabbbababbaabbabaaabbbbaaabbbaabbbaaabbbbbbabbaabbbbababaaabaabaabbbbabbabaaabaabaaabbbbbbabbaabbababbbaaaaabbaabaabbababbbbaabbabbaabbabbabbbabbabaaaabbbbabbbbaaabababbaabaaaaaabbbabbaaaababbbbbbaaaabbbbaaabbaabaaaabbaaabbabbbabbbaaabbaaaabaababaababbabaabbaabbabaabaabbbbbaabbaabbaabaaabbabbbabbabbbbbbaababbabbbbabababbbabbabbbbbaabaababbababbbaabbaaaabaabbbabbabbbaaabbaabbabbbababbabbbbabbbaababaaabbaabbabbbabbaabbababaabababaaaaaabbbaaabbaaaaaaaaabbbbaaabbbbbaabbbaaabaaaabbabaabbaabaababbbbaaaabababbbaabababbabaaabbabaabaabbbaaababbbaaabababaabbbaaaabbaabbbabbababbaabaababbabbaabbbbbabbbabaabbbabbabbaaababbaaababbbababaabaaaaabbaabaaaabbbbaabbabaabbbbabaabaaaabbbaabababaabaabbbaaabbabaabbabaabbbbbabababbababbaaabbabbabaaabaaabbbbaaabbaabaabaabbaabbbabaaaaaaaaabbbabbbaabaabbbbbabaabbbaaabaaaabbaababbbabaabaabbbbbababbababbbaaababaaabbaaabbbbaabaaaababbbbaabaaaabbbbbaaaabaaaaabaaaaababaaabaabbaaabaaaabbbabbbaabbaaababbabaaabaabbabaaaabababbbbabaabbbbabbabbabaaaaaababbababbbbbaabaabbabbaaabbbaababbbaabbaaababbbbabbaaabbabbbbabaaabbaababaaabbaabbaaaaabbabbaaaaabaabbbbbabbbabaaaaaabababbbabaabababbbbbbbbbaaaabbbbbaabbbbaababbbabababaabababbbbbabbbbaaabbabaabbaabaaaabbabaaaabababbbababbbbababababbabbabaabbbaabbaaaabaabaaaaaaabbbbbbabbbaabababaabbaababbbaabbababbababbaababbabbaabaaabbabbbbaaaabbaabaaabbabaaabbbbbababaabaabbababaaaabbaababaabbababbbbbbbaaabbbaababbaaabaaabbbbbbabbabbaabbababbbbbabbaaaaabbaaabbaabbaaabaaabbbaaabbbaabbabbbbbbabababbbbbabaabaabbbbbbabbabaababababbbaababaaaabbbaabbbababbaabaababbbbbabababbbabbbbbbbaaababbbbbbbaabababbabbbbaabaababbbabbababbabbbbbbbaaaabbaabaabbbabaabaaaabbbbababaaaaabbbababbbaababbbabbbaaabbaaaaabaaaabbabaabbabbaaaabbaabbaaaabbbaababaababababaabbbaababaaaabaabaaabaaaaabaabababbabaaabbbabbaabaaaaaabaababaaaabbbbaaababbbaaaaaaabbaaaaabaaaaaabbbbbababbababbaabbbabaaabbaaaaabbabbababbababaababbbbbbaabbabbbaabbabbbbaababbbbbababaaaaaaabbbbabbaababbabaaabbbabbbabbbaabbaabbaabbbbaabbbbbabaaaaababbaabbbabbabaaaaabaaabaababbaabababaaabaabbaabaababbbbaaaabbabbbabbaabbaabbbabbababbababaaaaaabbbaababaaaababbaaaaaaaaabbbabaaaabaaabbabbaabbbbaaaabbabbbbaabbabaabbaaaaabbbbaaabaabbaababababaabaabbaaabaabbbbbbabbabaaabbaabbaaabbbaabbaaabbbbbbbaaabbbabbbabbaabbbbbbbabbababbbbaababababbbbbaaaababbbbaabbbbabbbaaaabaabbabbabaabbbbbbbbbaaaaaabaaaabaaababaaaababbaaaabbaaaabaaabbbaaaabbbaabababbbbaaaaaababaababbabbaabbababababaaabaaabbaabaaabbbbbbbaaaaaabbaabaaabaabaabbaabbaaaabaaababababbaaaabbbbabbaabbbbaabaabaaaaaababababbaabaabbababbabbabbabbbabaabbabbaabaabbaaaabbbbbababbaabbbaaabbbbbbbbababbababbabbaaabbbaaabaababbbabbabbbabbababbabababbabbaabababbabbaaabababbababaaabaaabbbbbabbbaababbbaabaabababbabbbabaaabbaaaaabababbbaaaaabaaabbbabbaabbaaabbabaabbaaabbabbbabbbaabababbbbbaaaababbbabaababbabbbbbbbabbababbaaaababababaaaaabaabbabbbabbaabaaabbbbababbbbaabbbbbbbaabbaaaababbabbabbabaabaabbbbabbbbabbbbabbabbbaabaaaabbaaaaaabbbbaabaabbabbbaabbbbbbaabbbbbbbbbbbbaaabbbabbaabaababbabbaaaabbababbbabbbbbbbaabaabbabbaaaaabbaabbabbbbabababaaababbaaabaabbabbbbabaabbbabbaabbbaabaabaaaaaaaaababbbabababbbaaaaabbababbaaaababbbbbbaabbabbbabaaabaaabbabbabaaababbbbbaaaabaaabbbbaaabaabbbabbbaabaaaaaabbbbababbabaabbbaaabbaaaaaaaababaaabaaababbbababbbbbbabaaababaababbaababbbaabbbaaaabbabaaabbbabaabaabaabaabaaabbbaabbaabbbbabbbbbaaaaababbbbbbaaababaabbabaababaabbabbaaaaaabaabababbbbbaaabbaaaabbabbbabbaaababaabbaabbbbaabbbaababababbabbaabbbaabbaabbabbbbabababbbbbabaaaaaabbabbabbbabbbbabaaabbababaaaaaabbabaaabbbaabbbbaabaaababababbbbbabaaabaabbabbabaabbabaaaabababaaabbabaaabbabbaabbbabbbbaaabbaabbbbbaaaaaaaabaabbaaabaaabbabbbbbaaabbabaabababbbaabaaaaabbbbabbbaabbaabaabbbababbabaabbaaabaaaaaabbabbbabbbbaaabaabaabaaabbabbaabbabaaabbabaabbbbaababbbabbaaabaabaabaabaababaabbaabbbbabbababbbaabbbaaababababbabaabababaaabbbbbbbbabababbbaabbbaabbbbbaabaaabbaabbabababbaaaababbbaaaaabaabbbbabbaabbaabbabababbabaaaabbabbbbababaaaaaabababbaabaaabbababbbbababaaabbbbaaaaabaaabaaabbbaaabaaaabaabbbabbbabbaabbabbbbbbbabaabbbbaabbbaaaabaabaaabbaaabaababbbbaaaaabaaaaabbbabbaabababaabbbbaabaababbbababbbabbabbbaabbbabababbbabaaabbbbaabbabbaabbbabbaabbbaabbbbbbbabaabaaabaaaaaabbaaabbbbbabaabbbbbaabbaaabaaaaaaabaaabaaababaaaaabaaaaabbbbbbbbaababbbbaababaaabababababaabaaababbbaababbbabbbbbaabbabbbbbaaaababbbbabbbaababbabbbabaaabbaaaaabbababbaabbbaaabbabbaabaabaabbbaababbabbabbbbaaaabbaaaaabbaaabaabbbaaabaabbbbaaababbabbaaabbababaaaaabaabaabbbaaaaabbaabbbabaabbababbbaaabbbabbbbbbbbaaababbbaabaabbbbbbabbbaabbbbbaabbbaaabbbbababaabbbabbbbaabaabbaaababaabaababababaaabaaaabababbaaaabababbbaabbbbaaaababbabaaababababbaaabbbabaabaaabbbbabaaaaababbaaababbbababbaabaaaabbbbbababaababbbaaaababbabbbbbbabbaaabaabbabbbabbbbbbbabaabaaabbbaaababbbaaabaababaaaaaabbbbaaabaaabaabbbbaaaabbabbbbaaabbabaaaabbbbabaaabbaaababbabbbaaaabbbbbababbbaababbbaabbabababaabbabbbbbabbbbaaaaabbaaaabbababbabbabaaaaababababbbbaaababbaabbaabbbabbbbbabbbbaaabababababbbabbaabaabaaaaabaabbabbbbbbbabaaabaabbbaabaaaabbaaabaaabaaabaabababababaabaababbbbabbabbaaaaaabbbababbbbababbbaabaababbabaaaaabbabaabaabbbbbaabaaabaababaaaaaabbaabbbaababaaababbaaabbbbaaababbbbaababbabbbaaabaababbabaaabbaababbbabbabababaabaaabbbbbbabbaaaababbbbabbabbaabababbaabbaaaababbbbbbbbababaaaaaabbabaabaabababababaaabbbaabbaabaabababbaaaabbaaaabbbbabbbbaababbaababbaaaababbbbabbaabbbabbaabbabaabaababbaabababaabbababbbaabababaaababababbaabbabbaaaaaaaaabababababaababaabaaabbabaabbabbababbabbbaabbbababaababbaabababbaaabaaaaaababaabbaabbabbaaabbbaabaaaabbaaababbaaabaabaaaaabbbaaabaabaaabbaabbbababaabbbbbbbbbbaababbbbabbaabaabbabbbbbaaaaaabababaabbaababaaaaabababbaaaabbbababbabaabbbbababaaaaaaaaaabbbabbaabbaaababaaabbaababababbabaaabbbabaababaaaabbbababaabbbababbababababbbbbaabababbbbaabbbbabaabaabaabbbabaababaababbaabbabbabaabbaababbbbbaabaababaaabbbbbbbbaababbaaababbabbabaabbbaaaaabbabbaabaababbaaaabaababbbbaaaaaaaaabbbbabbbaabaaaaaaabbbbbaabbbbbabbbaabbbbbbaabaabaaabbaaabaabbabababbbaabbabbbbbabbaabaaaabbbababbbababbabaababaaaaabababaababaaaaababbaababbbabaabaabbabbabbabbbabaababaaaabbbbaaabbabaababababbbabaaaabbbabaabbbaabbbbaaaabbaaaabaababaabbbbaabbabbabbaaaababaabbabaabbbaaaabbbbbaaabbababaaaabaabbaaabbaabbbababababaabbbabbbbbabbaabbaababbbaabaababaaaaaaaaaaaabababaaabaabbbaaaaaabaabbabababbbaabaaaabbababbbbbbababaaabaaaaabaaabbbbbaabbababaabbbbaaaabaaaabababababbabaabaababbbbbbbbbbabbababbabbbbaabbbbbbbababaababaaabbbabababababbbababbbbbbbbbbbbbababbbabaaaaaaabbbbbabbbbbabbbbabababbbbaabaaababbaaaabbabbaabbbbabbbaaaaabbaabbabaaaaababababbaaabababbbabbbabbaabbabbbbabaabbbbbbabaabbababaabbbbabaaababaaababaabaababbbbbbaaabbbabaabaabaabaabaaabbbbbabbaababaababababaababaaaaaabbbaaaababbbabbbabbabababbabaabbabbabbbaaabbbbababaaaabbaabbabbaabbbaaababaaaaabbbaabbababaaaaababbbaaaabbbaaaabbabbabbababababbabbbbababaaabaabbaaabbbaaaaaaaaaabbbaaabaabbbbbbaaaaaabababbbbbbaabababbbaababbababbbbaaaaabaaabbbbababbaaaabbabbabaabbbaababababbbbababababbbaabaabbbaaaababbabaabbbbbaaabbabbbbaababbababbabbaababbabbababbbaabbbaababaabbaabaababbabbbabaaaabbabababbbabbabbbbbbabbbbbbbababbabbbababbbababaaaabbababaaabaaababbaabbabaaaabaaaabaabbaabaabbabbaabbbbbbaaabaaaababbaaabaaabbaaabaababbbaabbabababbaabbbaababbaaababbabaaaaabaaaabbaababbaabbbaaaaaabbaabbabaabababaaababbabababbaabbaabaabbaaabbbbbaaaaababababbaabaaaaababbaabaaabaabbaabbbbababbbbbbaaaabbaaabaaaaabaaaaaabbbbbaaabbaaaabaabbbbabbbaaaaaabbabbabbababaababaabbabbababbbbbababbabbaaababbbabbbbaaaababaabbaaabababbabbaabbababbbbaababaabbbaaaabbababaaababaaabababbbabbaaabbababbabbbaaaabbabaaabbabbbbabbbaabbbbaaabbaababaaabaabbaababbabbbaaaaabbbaabbbaaabbabbaabaabbabababaaababababbbbabaabbbbbbbabbaababbbabaabbbabaaaabababbaaabbabbbaaabbbbaabbbabaabbbbaaabbbbabbaabbaabaaabababbaabbbaababaabbaababaaaaabbaaabbaabaaabbaaabbababbbbbbaabbaabababbbbababbbbbbabaababaaabbbbaabaaaabbaababbabababaaaaabaabbbabaabbbbbaaaaabaaabbabbababbaabbabbabaabbbbbbaababbbabaabababaabaaaaaaaaababbbbabbbaaaabaaabbbabaaabbaabbbaaabaabababbbbaaaaabaaabbabbabababbaabbbaaabaabbaaababaabbaaababbabaabaaababbbbbbaaaababbabbbabbbaabbbbabbaaabbbabbaaabbabaabbbaabbaaabbaaaaabbbbababbbbbbbbaababaaababaaaababbababaaababbabaaaabaababbbabbaaabbaabababaabaaabbaaaababaaabaaaaabbbababbabaababbbababbbbaaaaabbaabaabaababaababbbabbbaabbabaabbbbababaabababbbbbaabbbababbaabbbbaaabbbabbbaaaabaabaaababbbbaaabaaaabababbbabbaaaaaabaaaabbbbabbbbbababaaaaaaababaaabbbbabbaabaabbabbaabbaaabbaaababbaabababaabaababaababbbabaabaabababbbaaaabaaabbaababababbababbbababbaaabbbbabababaabaabbbbbbabababaabbabaaababbbbaaaaabbbbbbabbaaaabbbaaaaaaabaaaabbbabbbbbbbbaabbaabaaaaababbbababbababbbabaaabaaaabaabbaaaabaabaabaabbbababbbababbbbaaaabbbbbaababaababaabbbbababbabbbbaaabbaaaaaabbabbaabaaaabbabbbbabbabbaaababbaaaaabbbbbbbabbaaabbaaaabaabbbaaaaaabaabbaaabbbbaabaaabbabbbbbbaabbbbbbababbbbbbbaaaaababaabbbabbbabaaaabbbbbababbaaabbbaaaabbbababababaabbbbbaaaabababbabbababababbbaabbabbaabaaaaaaaaaaaaaabaaaaababaaaabaaababababbbbbaaababbbababbabbabbbaaabbbbaaabaaabbbbaabaabbbbbabbabbabaaaaababbbaaabaabababaabaaabbabbaaaaabaabbabbabaabababbbbaaaaabaababbbababaabaabaabbaabbbbbabbbaabbaabbbaabaabaabaaaabbbaabaaababbbabababbaababbabaaaaaabbaababbbbbaababbbbbababbbbabaabbbbbaabababbabbbaaaabbbbaaabbabbbabbababaababaaabbabbbababaabaaaaaaaaaaababbbaabbbabbaaaaabaabababbbababaaaabaaabbaababaabbbaaaababbbaaaabbbaaabbaaababaabbabbabababababaaaabbaabaaaaaaaabaaabaabbaaababbaaaabbbaaababbabbaabbaaabaaaaaaabbbaaaaabbaaabaabaababaaababbabaababaaabbababaaabaaabbbaabbbbaabababbbabbaabbbaaabaaabbbabaabaabaaababbbbaabaaaababbbaabbbaaababaabbaabaaabaabbababbabaabbbaababbabaabbbbaaabbbbbbbbabbaabbaabbabaabaaaabaabbabbbbabaababbbbbaabbabbbbabbbabbbababbbaaaaaababbabaaabbbaabaaaaababbbbbbbbbaaabbaaaaabaaaaabbbababababaaaaabaaaaabaaababbaaaabaabbbbbabbbbaaabbbababbbbbbbbabaabbaaabbbbaaaaaaaabbbaabababbbaabbabababbabbaabbabbbbbababababababbbababaaabbbabbabbabbaaaaababbaabbbbbaaababaabbbabbbbaaaababaaabbbbbababbaabaabababbaabaaabbbaabaaabbbaaaabbabaabbbabaaababaaabaabababaaababaaaaabababbaaababaaaabbbaaabaaabbaaaaaaabbbbabaabbaaababbbbbaabaababbabaaaabbbaabaabbaaabaaaaaaabbbabbaabaaabaaaaaababbabbabbaaaababbbbbbbbaaabaaaaaaabbabaaaabaaaabbbabababbaabbbbababbbbababaaaababbaabaabbbabbaabbbababaaaaaabaabbabbababbabbabaabaabbbaababbaabbabaaaaaaabbbbaabbbabbabbaaabaabbbbaabbbaabaabbabaaabababbbabbbabaaaaabbaabbabbbabbababbbabaaaabbbbbbabbaaaaaababbaaaabaaababbaaaaabbbbaaabbaabaaaabbbaabaaaabbabaaaabbbababaaababbbbbabaabbabbbabaaaaabababaababbbbbabbbabaababbaababbbbbbaaaaabababaababbabbabaabbbbaaaaaaababbbaaaabbaabbbaabbbbabaabaabbbabbbbabbaaaaabbaabaabbbbbabaaabaaabaabbaabbababaaabbbbbabbbbabbaaaaaaaabbaabbaaababbabababbaaababbabbbbaaabbbbbbabbabaaaaaaaababaababaabbabbabaabaaaabbabbbbabbbababaaabaabbbaaabbaaaaaaaababbabbaaabbbbbaaaabbabbaaaababbbabbbbbabbaaababbbbbabbbaabbbaaabbbbabaaabbbaabaabbabbbabaabaababbabbbbaabbbaabbbbbaaabbbbbaabbbaabbbbbaabaaabababaaababbbbaaaaaaaabbbbaabbbababaaaabbbaaabaabaabbababbbabaaabaaabbbaaabaaaaaaaaabbaabaabbbbaabbbbaababaabbababbabababbbbbbbbbabbbbabababbbbabaaaabbaabaababbbaabbbaaabaaaaababbbaaabbabbaabbbbaababbbaababbabababbbabbbbabaabaaabbbaabbaababaababbbbababaaaabaaabaaaaabbaabbbbbabbbaabbabbaabbbaabbbbabbaaaababaabbbbbaabaaabaabbabababaaabaabbbbaabbabaabbbbaabababbbbababbabbababbbbbbababbbbbbaabbaababbbbbaaaaaaaababbaaabbaababbaabababbbbbbababbaaabaaabbaaababababbbbaaaaaaaaaabbbaaaabaaabbaaabbbaabaabbabbaaaabbbababaaaaabbaabbaaaabbaaababbbabaaabbbabaaabbbaaaaaaaaaabbabaaaaabbabbbabbabbbbabaaaabbabbbbbbabbbbaabbabaabaabaaabbbbaaaaabbaabaaaabaaaaabbbbbbbaabaabbaaabbaabaaaaaabbabbabbbbabbaaabbbabbbbbabbbbabbbabbaaaabbbaaaabbbabbaaabbbabaababaaaaabbbbaaabaabbbabaaabababbababbbaababaabababbbaaaaababaabaabbbaabbbbbaabbbbaaabbaabbabbbabbbbbaaabbbabbaaaababbbbbbaaaaabaabababbbbbbaaabbbaabaaabbaaababbbabaabaaaabbbabbababaabbbbabaababbbbababbbabaaaabbbbbaaaabaaabbaaaabababbabbababaabaaabaaaaabbbbbabaaaaabbabbabaabbbbbabbaaabbaaabbaababbbbaabbabaabaabbbaaaaabbabaaababbbbbbabbbbbababaababababbbabaaaaaaabbbbaabbaaabbaabababaabaaaabbbbabbbabbbbbbbbaaabaabbabababababaaabababaabaaabbbbaaabbaaabaaaaabbbbaabaabaaabaaaababbabaaaaababbbabbbbbababbbbbabababbaabaaaaabaaababaaababaabaabbaabaaabbabbaabbbbbaabbbabaaabbaaaabbaabaaabbaabaaabababbbbbabaaabababaaababbbabaaaaaaaabaabababbabbbbbbbbbaabaaababbbababababaaabbbbbbaababaaabbbabaaabbbbbbbbbaabaabaaaaaaabbbaabbbbabbaaabaaaaaaaaaababbaabababaaaabbaabbbbabababaabbbabbbaabaabbbaabbabbbabaaaababbbaaaaabbababbbabaabbbabaabaaabbabbbaabbaabaaabaabaaabbabbabbaaaabbbaababbabbabbbaaaabbabbbbaabbabbbaabbbaabaabababaaaababaaababbaaaabbbbbaabaaabbbbaaababbbaababbaaaabaaabbbbaabbababbabbabbbabbbbabaabbababababbababbbababbbabbaabbabbaabbbbbbbbaabbaababbaabbababbaabaabbbbbbbaaaababbbbababbbbabbabbaabbabbaaaaaaabaaaababaababaaaaaabababbaaabaababbababbbababbabbbbaaaabbbaababbaabbaaaaababbaaaababbbaababaababbbaaabbbbabbababbbaabbabaabbabbababababbbaababaaaabbabaabbababbbababbaabaaabaabbbbaaaabbbbabbbaaaabbabbaabbaaabaabababbbabaababbaabaabbbbbaaaaabbababbabbbaabbabbaabbaababaaabbbaaaaaaaabbbabaaaabaaabbababbbbabbaaaaaabaababaaaaaabbbbaaababaaaabbaaaaabaabbbababbabbbbbababbbababbbbaabbbabbbaabbbaaabbaaaabaabaaabaabbabaabbaabbbababbaabaababaabbababbbababbabbaaaaaaaababbbbbbbbaabbbbaaaabbabbbbbbaaabbaaaabbaaaabbbabbbbabbabbabbbbbaababbaaabaaaaaaaabaaaabbaabbababbbabaaabaaabbbababbaabbbbbaabbaaaabaabaabbbaaabbabbaabbbabaabbbabbabaaabaaabbaaabaabbbaabaaabaaaaabbaabbaabbbabbbaabbbbabbabaaaaaababbaaaaabaabbabaabbbbaaaabbaababaabaabbbbbbbbbaabbaabbaaababaaabaaaaabbbbbaaabbabaaaabbbbbbaabbabaababbbaaabaababaaabbababbbbaaabaaabbbabbababaaabbbbabaaaabaabbbaababbbaaabbaaabaabbaabbaababbbababbbbaaaabbbabbbbabaababaaabaabaabbabbbaabbaaaaababbabbabbbbbbababbaaabaaaaababbaaababbabbbbaabbbbabbbbbabaabbbabbbbabaabbabbbbbabbaaabaaaabaaaaaaaabbaaaabbbaaabaaaababbaababaaababbaababbabaabbbbaaaabbabaabababaaabbbaaababbaaaabbbaabaabbaababbaaaabbabbabbabaaaaaaaabbabbaababaaaaabbbbaabbbabbbbbbabbbbaaaaaaabaaaabbbbbbaaaaabbabbaabaaaaabbbabaaaabbababbbaaaababbaabaaaabbaabaaaabbaaabbabaaaaabaaabbabbbbbbaaaabbaabaaabbbbaaaaaaabbbbaaabbaabaaabaaabbabaabbabaaaaaaaababbaabababaaaaaaaabbbaabbbbabaabaaabaaabaaabbaaaaababababbbbbabbaaababaaaaaabbaabbaabaaaabbbbbaaaaaabbbabbaabbaaababbbabaabbabaabaaabbbbabababaabaabbbaaabbbbabaaabbbabaabbbaaababbaaabbababbaabbaaababaababbbabbbabbbabaabbbbbbaaaaabbabbaabbababababbbbbabbaaaabaaaaabbbbbaabbabbbabbabbabbbbaaabbbbbababbabbabbbbbaabbaabaaaababbbbbbaababbabbbabaabbbbbbaaabaababbbaaaabbabaabbbbbbbbbaabbaaabbabbbbbaabbaaaaaaababababababbbaabbbaababbbbaaaabbbbbbababbbbaaaabaabaabbbbbbaaabbaabbaaaababaaaaaaabbaaaaabbbbbbbaabababbbbbaabbaaaaabaaabbaaabbbbabbbabbabbbaaaaaabaabbaabaabbabbaabaababbabaaaaabaaababbbaabbabbaababaababbbabbaabaaabaabaabaaaababaaaaabaaababaababbabaababbaaaabbaabbaabaababbbbbabbabbabbaababababbaaaabbbbaabbbbabaababaaabbbababaaabbabababbbbbbbbbabaabaabbbaaabaaabbbabbbababbabbbbbaabbaaaabbabbaaaabaaaaabbbbbbbbbaaabaabaaaababaababbbbaaabbbaabbbbabbaabbbaaaabaaabababaabababaaabbabbbbbbbaababbaaababbaababaabaabbabbbaaabbabbaaababbaabaaabbabbbbbabbbaabbbbaaabbbbbbabaaaaaaabbaabaababbabbaabaaaaabbabbbabbbbbaaababbabaaaabaaababbbbbaabbbbabbbabbbaababbbbbaaabaaabbbabbbbbbabbaaaababaaaabbaaabbbababaabbbabaabababbbbbbbbaabbaaabbbbbbaabbabbbaaabaabaaabbbaabbabbaaaaaabaaaaabbbbbbbaabaabbbaabaababaabbbbabbbaaabbbbbaabbaaaabaababbabbbabbaabaabbabbbabbabbbbbbbabaaaaaaabbabbaabbaabaabaaaaaababbabbabbbabbabbabaaaababaabaabaaaaaaaaaaaabbbbbbaabaaaabbbbaaabbaabbaabbbbaababaaabbabababbbababbbabababbbabaaabbaaaabaabbaabbabbaaabaabbabbbaaabbabaaabaaaaaababaababbabaabbabbaabbbbbbbababbbbbaabbabbbabbaabbbaaabbababbababbbbbabbaababaaaaaabaaabaabbbbabbaaaababaaabbbbbbaabbababaabbaabbaaabbabbababbabaabaababbbbabbabbabaababbabaaaabaabababbaabbabaabbbbbaabbabbaaaaaaabbbbbaababaaaabbbbbbabbaaaabbaababaaaaabbbabbbbbabbabbaabaababbbaabaabbbbbbbbabaabaabbbbaaabbbbaaaabaabaaababaabababbaaaabaaabbbbbaabbbbbbaabababbbbbaaaabbaabbabababbaaabaabbbbbbbabaababbbbaaaabbbaaabaabbbbaabbbaaaabaaaaaabbaabbabaaababaabbaaaabbbbbbaababaabbbabbabaabbaababbababbaaaaababbbbabbabbababaaaaaabaaababababbaaabaaababaaabbbbaaabaaabaabbaabbbbaabbbaaabaaabbbbbaababbaabbbabbabaabaabbbaaaaabaaaaabbaaabbabbabbbbbaabbaabaabbabbabbaabbabaabaaabbabaaaabaababbbabbbbbbbbabbaaabaaabababaaabbaaaabbbbabbabbbaaaaaaababaaaabbbabbabaaaababaaaaabbbbbbaababbbbaabababababababbbbaabbbaababbaaaaabbaaabaaabbaababbaaababbaaaaababaabbbbabababbabbbabaababbabaabbbaababaaaaababbaaaaabbabbbbaabbbbabbbabababaabbbbbababbbbbbaabababaaabbabbbbabbbabababbabbabbabbbbabbbababbaaaaabbbabababbababbbbbbaabaaabaaabbaaabbbabbabbaaaaababaaabaabbabbaabaabbbabaabbabababbaabaabaaaababbbabaabaaabbabaababbabaababbaaaaaaaababbaaaaabbbaabaababbbabbaabbaaabababbabaaabbbabbbabaabbaaabbbaababbbbbbbaababababbbbbbbaaaaababababbbabaabaabbabbbbbbababbbbaabbaaabbaaabbabbaaaaabaabaabbaababbaabbabaaabababbbbbbbbbbbbaabbaaaabaabaababbbabababbaabbabababbbbbbbbabaaabbabbababbaaaabaaabbbbaaabbbbbbbbbbabbbabbabaaabbbaaaaababaaabbbaabbbabaaabababbaaaababbbabbaababababbbabbbaaabbbababbbabbaaaabababaaaabbbabbbaabbaabaabbbabbbaabbabaaaabaabbbbabbbaabababbabaabababbaabbbbabaaabaaabbababbbbababbababababaabaabbbbbaaaaaabababbbaaaaabaaabbaabbbaabaabaaaaabbbbbbbabbbbaaabbaabbbabbabbbbaaaababaaaaabbbaaaaaaaabaabaabbbaabbbabaaababaaabbaabbbbabaabbbaabaababababbaabababababbbbbbbbabbaaababbaaabaabbaaabbabbbbaaabbaabbabbaaaabbbabbbabbbababbabbbaabbbabaaaaaaabaabbbbbabbbaabbabaaaabaaabbbaababaaabbaaabaabababaaababbabbaababbaaaabaabbabaabbabaaaababbaabbabbbabaabaabaaabaabababbaababaabbabaababaabaabbabbabaaabbabbbbabaababbabbbbabbbababbbababbbaabaabbaabbaaaababaaabbbbbbbaaaaababbbbaabaababaababababababbbaabaaaabbbaababbbaaaaaabaababbbbbbbabbbbaaaaabababbaabaaabbbabbbabbabaaabababaabbabbbaabaabaabbbabbabbbbaaababbbbbaaabbabaababbbbabbbbaaabaaabbaaabababbbabbbbaabbbbaaabaabbaabbbababababaabbbbabbbbbbabaaabaabbaaaabbbbbbbabbaaabbabbababbabaaaabbbbaaababbaabbbbaaabbababbaabbbabbabbbbbaaaaabbaababbabbaababbbbbaabaaaabbbabbbbbaabbabbbabaaaabbbbabaaabaaabaaaabbaabbaabbabbabaabbbaababaabaabbaaababbbbbaabbabaaabbbababbbababaaaababbbbbbabaaaababbbaaabbbbaabbabaabaaababaababaaabbbbabbbaaaabababbbabaaababaaaaaaaabaaaababaabababbaabaabaabaaabbaaaabbaabbaabbababbbbaabbbbababbaabbabbbbaababaabbbbaabbabaabaaaababaabbabbbabbaababaabbaabbbbabaaabbbabbabbabaabbaababababaabaabaaababbbbaabaabbabaabaabbabbababbabaaabbaabbbaabaabaaaabaaabbbbaaababbbabababbabbabaabaaaaaabbbabbbabbabbbabbabbbbaabababbbbabbaaabbbbbaababbbbbababbaabbaabbabbbbbbbaabbaababbbbaaaababbaaabbabababaabbaaabababbbaabbbbaaaaaabbaaabbbaabaabbbbaabababbbbbabbbabaaaababbbbbabbbabbaaaaaaaababababbbaabbaaababaabbabbaaaaababaaababaaaababbbaaaaabbbbabbabaababaaabbbbabbbaaababaabaaababbaaabbbaaaaaabaaaaabbababaabbbbbbabbbababbabaabaabaabaaaaabaaaabaaababababbaababaabbbbaabbaabbaabaabaaabbabbababaabbbaababababbbbbbaaabbbbaabaaabaabaaabbabababbabbaabbbaabbbaaabbbaaaaabbabababaaaaaaaaaababaaabaaaabababbbbbabbbbabbbbabaabaaabbabbabbbabaabbaababbbabbaaaabababbbbabbaaaabbbbbabbaaabbbaaabbbaaaabbbbbaabbaaaaababbbbaaaaaaabbbbbaababaaaaabbabbaabbbbaaaabbbabbabbbbbbbabbabaaaabbbbaaabbababbbabababaaabbaabbababaabaabbbaaabaaabaaaabaaabaaabaaabbbaaabaabaababbbabbbaaaabababaabbaaaabbbbbbaaaabbaabaaaabaabaaabbbaaababbbbbbabbbbbbabbbbaabbbbbabbabbbabbaaaababbababbbbaaababbbabaabbbaaaabbabababbbbabababaaaaaabaabaaabaaaaabaaabababbabbbaaaaaaabaaabaaaaabbbbbbbaaabbbabaaababaabaaabaaabaaabbbbbbbaababaabbbbaabaaaababbbabbbbabbbbbababbbaababababaaaaaaabbabaabaabaaabaaaabbbbabbaaabbaabaabababaaabaabbaabbabaabaababbbbbbaabaaabaabbbabaaaaabaaaababbbabbabbaabbabaababaabaaabbbbabbbabbabbbbaaaabbaaaaaaaaababaaababaabaabaabaababaaaaabaabaaabaabaabbaaaabaabbaaabbbbaaababbaaabaabbaaabababaababaabbabaaabbbbbbbbbaabaaaaabbaaaaaaaabbabaaabababaabbbbabaaaaabbbaaabbbbbbabbbababbababaabaabbbabbbbababbaaaaaabaaabbabbabaabbbaabbbababbbbbbbabbbbabbaabbaaabbbbabaaaaaabbababbbabbaaabbabbbabbabbabbbabbaaabbaaaabbaabbababaaabbaaabbababaabababbbbaaababbaababbbaabaabaabbabbaaaabaaaabbbbbaababbabaaabababbbabaabbaabaabbabbaaaaabababaaabaabababbaabaabbabbbbabbbbbbbbbbaababbbabaabbbbabababbbbbababbababaabbababbaabbaaabaabbababaaabbbabbabaaababbbbaaabaabbbbaaabaabbaabbaaaaababbbbababbbbbaabaaabaaaababbbbbbbbaaabaaaabaabbabaaaaababbabbbbaaabbabaabbaaaabbababbbbbabbaabababbabaabababbabbaabbbbabbbbbaababaabbbabbbbabababbaababaabbbababbbaabababbbbbbbabbbababbbababbabaaaaaabbababbaabbbbababbbbabbaabbbbbabbbababaabbabbaabababbbbababbbaaabaaabaaaaabbbaaaaabaabaabaabbbbabaaababbabbaaabbbabbaabaabbaabbaabaaaaaababaababbbaaabaabbababbbabababababbbaaaaabbbbaaaabababbbbbbaabbaabaaabbababaaababaaaabaabbbbabaaabaaaabaabaaaabbbbbbababaaabbbbaababbabbaaaaaababbaaaabaabbaabaabbbbaaaabbabaabaabaabbaabbbbabbaabbbaabaaabbaabbbbbabababbaaaabbbbbbbaabaabbaabbabbabbabaabababaabbabbabaabbababbabaaabbabbaaababbaaaaabababbababaaaabaabbababbbaabbabbaaabbbbbbbbabaabbaabaabbbbbbabababbbbbbbaaababaabbbbbbbbaaabbbbbbabaababbbbaaaababbbbabbabbabaaababbabaaababbaababaaaaaaababbbabbbaabaaaaabaabbbaabababbabbaaabbaababbababbbbbaabbabbbbbabbabbabaababbbababbaabbaababbbbbbbaabaaabbbababbbbbbbaaaabbbbbabaabaaaaababaabbbabaababbabaabaaabbaaababbbbbbbbabbbbbaabbabbbbaabbaaaaaababaaaabbaaaabaaaaaabbbbbbbaabbabbbaabbabaabbbabaabbabaaaaabaabbaaaaabababababaabbabaaaababbbabbbbaabbbbaaaaaabaabbaaaabbbbbabaabbbaaabababaaababaabbaaaabbaabbaabababbabaaaaabbababbababbaaababbbaababbabbbaaabbbbabababaaabbaabababbabbbbbbbaaaabbbaaaaabaaaabbbbabbabbbbbbbbbbbabbbabaaabbaababbbbbaaabababaabaaababbaabbbbbbbbababaaabaabaabbabbbabbabaaabaaabbbbabaabbbaaabbbaabaabbaabaaabaaaaababababaaaabbbbbbbaabbbaababaabaabbabaaabbabbababbaabbababaababaababbabababaaabbbbaaaabababbaabbaababbabbaababaaaabbaaabbaabababaababaaabbaaaaaaababaaaaaaabbbbbbbaabbbabbbbbbabaabbabaabaaaaaababaababaabababaabbaaabaabbaabaaaaaabbabbabbabbbbaaaaabaaaabbabaaaaabbaabababbaabbbabababbabbbaabaabbabbaaababbabbbbbbbbabbbbaaabbaaaabaaabbbbbaaabbabbbbaaaabbaabababaababaaaaaabbabbabbbbabbaaaaabababbabbbaaaabbbaababbbabaabaaaabbbaabaaabaaababaabbabbbbabaaaaabbaabbbaaabbabbaaaaaaaababbbabaaaaababaaabbabbaaaaaabbaaaababbabbbbbaaaaabbbabaaaaaaabaabbabababbbaabbaabbbbaabbbabababbabbbbababbbaaabbbbaabbabababbaaaaaabaaabaabbbaaabaabbbaabaabaabbbbabbabaabbbbbbbbabaaaaaaaaaabaabbabbaaaaabbbaaabaaaabaabbbbabbabbabbbaaabbbaababaabbaaabbbabbaaabaaaaabababbbaaaabaaaaaabaaabaabababbaaaabaaabaaaaababbbabbbbabbbaaaaaaaaabaaabaabbbbaabaabbaabbbaabbbbbbbbaabbaabbbbbbabbaabbabbbaaababbbbbbaabbbbabaabababbabbbbabababbbbbbabbababababaaabbbabbbbaaaaabaaaaabbbbbaababaabbabbbabababbaaabaaaaaabbbaabbabbabbabaaababbaaaabababbbbaaaaaabbaaaaabbabbbbbbbbaaabbabbaaaabbbbbbaaaaababaaaaababaababbaababbbabaaaabbaabbabbbbaaaaabaabbbabbaaabbbabbaabbbaaabaabbbbaaaaaaabbbbaababaabbbabaaabbaaaaaaabbaaaaaabbbaaabbabbaaaababbaaaabbabaabbbabbaaaabaabbabbbaabaaaaaaabbaaabababababbaabbabaaaaaaabbbaabbabbaaaaababaaababababaaaaaabbbaaaaaaabaabbbabbbabbbbabbaaaabbbabbaaaaabababaabaababaabbbaaaabaabbabbabaaababababbbaabbababbaaaaaaabbababbbaabaabaaabababbbaaaaaabbabbabaababbbaaaaaabbaabbaaabaaabbbbabbbbbbaaababababbbbabbbbbbaaaaabababaabbbbbbbbbaaaaabaabbaabaaabbbabbbbbabbababbaaabaababaababbbabbababbabbaaabbbaaabbababbbaaabaaaabbaaababbabbbabbbabbbaaabababbaabbbaabbbabaababbbbaaaabababbbababbbbbbbbababbbabbbbabbbaaaababbabaaababaaaaabbaabaababaabbbbabaabbaabbabaaaaaabbaabbbbabaaaabbaaaabababbbabbaaaabbabbaabaabababbababbaabbabbbbbbaababbabbbaabbaaababababaabaaabbbbbbbabbabbbbbabbabaaaabbabbaaabbbbaaababbaaaabbbbabaababaabaabbabaaabbbaabaaaaabaaabaaabaaababbaabbabbabbaaabbbabbbbbaaaaabaaaaabaaaabbbababbbaabbbbaaabbaabaabababaaabababbbabababbbbbbbaaababbbbaabbbababbaaabbbabbbbbaabbbaaaabbaabbaababbbabbbbbbaaaabaaabaabbbabbbaababaabbbbbbbaabbaaaabbaabaabbaaaabaabbbabbaabbbaabbbabbbbabbababbababaaaababbabaaaaabbbaaaaabbabbbaababbbaababbbaaabaaabaaabbbbbababbbaabbabbaaababbbaabababaabbbaababbabbbbbabaaaaaabaaaaaaababaabbabbbaababbaababaaaaabbabbbbbaaaabaaabbaabaaaabbbaababbaabbbbbbbbababaabbbbaaabbbbaabbbaabbbbbbaaaaaaaabaabbaaabbabaabaabaabbaabaabbbbaaaabababbbbababbaaabaaababaaaaabbbaabaabbbbbabaaabaaabaabbabaaaabbaabaabbbbbaaabbabbabbbaababaabbaabaaabaaabbaaaaaaaaaabbbaaabbabababbbaaabbabbababbbabbabaaaabaaaaabbbaababaaaaaabaaabbabbbbaaabbabaabbbababaaabababaabbbabbbbbabbaabababaababaaaaaabaaabaaabbaaaaababbaabaaabbaabbaaabaaaababbbabaaaabaaaabbaaaaabbaabbaaabaaaabbaababbbaabaaaaaabaaabaabbabbaababaaabaabbabbababbbabaaaababbbbbaabbaabbbbaaaabababaabaaaaabaabbbabaabababaababbbbabbababbbbaaaaabbaaaabbaababbaabaaabbbaabbababbaabbababaaaaaaabbbababbabaaaaabbaabbbbaabbaaaaaaaaabbababbababbbabababaaabbbaaaabbabbbbaabbbbaaabbbabaaabbbbbaaaaaabbabaaaaababbabbaaaaaababbaabbaabbabaababbbababbaabbaaababbbaaaababbaaaaaaabbababbbabbaaaaaaabbbbbababbabaabababaaaabaaaaaabbbbabbbbaaaaababababbaabaaabbaaaaabaabbaaaabaaababababaababaabababbabbbbabababbbabaabbababbbababbababbabbbbbbbaabbbbaabbabbbbaaabbbbbbaababaababbaabaaaaaababbbbbbababbbbabbabbaaaabaaababaabbbababbababbabababbabbaabaabaaababbaabaaaabaabbaaaabababaababbbabaabbbaabaabbbaaababbbababbbbaabbabaaaababababaaabaaababbbbaabbbaaaabaabaabbabababbbabaabbabbbbbaaabaabbabbababbbabaabababbbbaabbaaaaabbbaabbbaabbaababbbbbbababbaabbabaaaaaaabbaabaabaaabaaaaabbbbbbbabaaababaabbabbbbbabbaaaabaaaaabbbbabaaaabbaaaaabaaaabaaabbbbbabbaaabaaabbbbbaaaabbabbabbababababbaabbbaabaababaaabbbababbbaaababbaaaaaaabaabbababbababbbbbaababaabaaaaaabbabbbabbabaaaabbbabaabababbbabaabbaababbabaabbabababbbaababaabababababbaabbbbabaabbabababbbbbbaabaaaaaabaaabbaabbaaabbbbabaaaaabbbbaaaabababbbbbaaaabbbabaaaabaababbaabbbabbabbaaaaaaababaaabbbaabbaabbaaababaabbaabbabbbaaababbbabbabbbaabbababaaababbbbbabbbaabbbabbaabbbbbaaaaaababbaaabbbabbbbaaabbbaaaaaabbaabbbbabbabaabbbabaabaabbaaaabbbaaabbbabbbbaaaabaaababbbaababababbbabbbaabbabaabababababaaaababbbababbaaabbbbbbbbbbbaabbaaaaaabbbaabaabbbbabbaabbabbbaaaababbbabaabbbbbaabbbbabaaaabbbbbbabbbbabbababababbabbbaaaaabaaabbbaabbaabbbbbababbbbbabbababababaaaaaaaaaaabaaaaabaaaaaaaabbbaaabaababaaabaabbaabbabaaaaababbbabbbaaaaabbaaaaaabaaaabaaabbbaabbaabbbbaabbbaaaaabbabbbbabbbbabbaabbbaaaaabbaabbbbaabbbababbabbaabaabbbbbababaabaaaaaababbbbabaaababbabaabbaaaaaababaabbaaabaaaabaaaaabbbbbbaaaabbaabbbbaaaaabaaaabbaaabbabbaabbaabababbbaaaabaabaabbbbbaaababbbbaaabbabbbababbaaaaabbabaababaababbaabababbabbbbbaababaababaaaabbabbaaabbaabababbbaabbbaababbaababbaaaabbbaaabbabbabbaabbbababaabaaabaaabbaaaabbbbbaabbaabbaaababaabbbbbaababababaaaabbbbbaaabbaabbbaaabbbbbbababbbbaaaabbabbabbaabbabbbbaabbbbbbbbabbbababaaaababbbbbbabbbbbbabaaaabbbabbbaabbbbabaababaaabaaaaaabbbababbbaabaaabbabaaabaaabbababbbbbbbbbabbbabaabbabaaabbabaaaaaaababbabbbbaabaaaaaababaabbabbababbbaaaabaaababaaabbaababbbabbababbaabbbababbabbaaabbbabbaaabbbbabbaabbabbbbabbabaaaaababbbbbbaaabbabaabbbaabbbbabbbabbabbaabaababaaabaababbaabaabbbbbabbaaabbbbaaabbbabaaaaaabbbbbbababbbbbbaabbbababbbabaaabbbaababbaaaabbaaabaaaabaaabbaaaabbabbabaababbaaaaabbbbaabababaaaaaaaaaabbbbabaabbbaabbbbaaaabaaaaabaaaababaaabaaabbbbaaabbabbaaabaaababbbabaabbabbbbbaababaabababaabbbbabbbbbaabbbabbbbaaabaaaabaaaaaaaabbaababaabbabbbaaaababbabaabaaaaaabaabaabbaabababababaabbbbabbaabaaababaaabbbbabbabbbaabaababbbbbbabbbbaaabbbbbbbaaababbaaaaaabbbbbabbbaababbbaaabaaabbaaaababaaaaabbbbabaabbbabaaaaaaaaaabbbaabaaaaabaaaabbbaabaabaaaabbaaaaaabbabaaaabaaabababaababbaabbbaaaaabbaaababbaabbbbbaabbaaaabbaababbbbaaabaaaabaaaaaabaabbabbbabababababbbababbaaabaabababbaabaaaabbbaabbbbabbbbaabbbbbaababbaaaaababbaabbababbbbbbbababaababaaaaabaabaaaabbbbbabbabababbbabbbbaabbabbbababbaaaaaabbbaabaaaabaaaabbaaaabaaaabbabbabababbaaabaaabaabbaaabaaaaabaababbbaabaaaaabbbabbaabababbaaaaabaabbbabbabbabbbbbabababbabbbabbabbaaaaaabbaaabbbabbaabbbabababbbabbbbababbaabbbbaaabaaababaabbabbbabaabaabbabaaaabaaaaaabbabababaabaabbabbbbabbabbbbbabaabaaabbaaaaaababbabaaaabaaaabbabbabababbbbbbaaabbbbaababbbabbbabbababbabbabaaabbbbabbabaabaaabbabaabbbabbabbaabbbbabaabaabbabbbaabaaaaaabaabbbbbbaabababbbaaabbbabbababbbaaaaabaaabaaaababbbbaabaaaabababaaaabbbabbaaaabbbbabababbaabbabaaababaaaaababbbaaababbbaababbababbaabaabbbbbbababaabbaaaababbbbabaaababaaaabbababababbbaaabbabaaabababbaaabaaabbbbaaabbbbaaabaaaabaaababaaabbbaaaaabbabbbabaabaabbbbbabbbabababaaaaaaababbbbbaababbbabaaabbaabbaaaaaabbababaaabaabbabaababaabbabaababbabbbbaaaabbbbabbaaaaaabbbaaabbbabaababbbbbbabaaaaababbbbaabbaabaababaaabababbaaabaabbbbaabbaabbbabaaaaabaabbbbaabbbaabbbbbaaababbabbaabbbababbaabbbbaaabaaaababbababbbbabaaabbabbabbbaaaaaaaaaabaabbaaaabbbbaaabaaaaaaabbaaaabaababbbaabaabbabbabaaababbbaaaabbaaaaabaabbbaaabaaaababababbbaabbababbaabbaaaaaabbabababbaaaabbbbbabbbababaababbbbabbbaababbbbbababaaabbababbabbbaaabbaaaaaabaabbbaaababbbababbbbbababbaabababaaabaabbbbaabbbbaaabaaabbbaaaaaaaaabbabbaaabbabbabaaaabbbbaabaaaabaaabbabbbaabbabaaaaaabaaabbbbbabbaabababaababbaababbaabbbbbababaababbaabaababaaaaaaabababbbabaabbaabbbabbaaabaabaabababbabbbaabababbbbabbabbaaabaabbbaababbbabbbbbbabbbabbaabaaabbaaabababbaaabbbaabaababbaaaababbbbbabbabababaaaababbaaaaaabbbbaaaaaaabaabaaaaabaaabbbbaabbbaabaabbbbaabaabbaaaababababaabbbbaabbbaabbbbbbbabbbbabbaaaaaabaaaaaababbabaaaaaabbabaaaabababbaabaababaababbababaabbaabaababbaabbbbbbbabbbbbabbbaaabbaaabbabaaabbbababbbbababbbbaaaabbaabbbaabaaaabbbaababababbaaabbbbabbababaaabbaaabbaaabaabbaaabbaaabaaabaabaaaaabbbbbbabbbbbbaaabbbabababbaaabbabbabbbaababbbbabaaaaababbbabbabaabbaabaaaaaababbbaaaaabbbaabbbbaaaabababaaabbabbbbbbabbbaabbbbbabbabbbabbabbabababbbaaababbbbaaabaaaaabbbbbbbbbbbbbaabbbbaaaaaaabbabbaaabababababbbbababbaaaaababbabababbbaaabbabaabbabaababbababbbabbbbbabbaabbbabbbbbaabaaabaabbbbbbaaabaaabbbaaaabbbbbbbbbabaaabbabbaaaaabbabbaababaaabbaaabbabbaaaaabbbaaababbababbbaaaaabbbabbbabbaabbabbbaababbbaaababbbaaabbaababbaaabbaaaaabaabaabbbaaabbabababbaaabaabbabbbbbbaaababaabbbbbabababbbabbabaabbaababaabbbbaabaaaababbbabbbbbaabbabbabbabbbbaabbabaaaaaaaaaaabbbbabaaaaaaabbabaabbbababaaaababbaababbbbabaaaababbbabbbbbbbbaaabbbbaaaabbaaabbbaaababaabbabbaaababaaabaabbbabbbaabaabaabaababaaabaaabbbaabaaabbbbbbbbababaaaaaabaabbbbbbabaabbabaabbabbbbbaababababbbababaabaabaababaaabababaabbaabaabbbaaaaaaababbbbbabaaabbbbbbbbaaabaaabbbbbaaabbaabbaabaabbababbabbaababababbabbbbaaabbabababaababaaaaaabababbabbaababbbbbabaaaababaababbabaaabbbbabbbbabbbbaaaabaaababaaabaabbbaaabbaaabbbbbaabaabaababbbbbbbbbabaaababbaabbbaabaaaaaabbaaaabaaaaabaabaaabbbbaabaaabbaaaaaaabbbbbbbababbaaabbababababababbababaaabbbabbaaabbaaababbaaabaaaabbabbbabaaaabbaaabbbaabbbababbaaababaabaabababaaaaaaaaaaaaabaaababbbbbbbabbbaabbbbbbaabbbbaababbbbbabbaabbbaaaabaabaabbababbaaabbbbbaabbbbbbaaaabbaaabaaabbbaaabbbbbbbbabbaababbaababaaabaaababbbbababbbaaabbbbbbabbabbbbaaaaababbaabaaaaaaabbbbababaabbabbabbabaaabbbbabbbbbbabbbbbbabbabaabaaabbbbbaabbaabbbaabaaababbabbababbbababbabbbbabbabbbbbabaaabaababaababbbaaabaabbaaababababaababbbabbabbbabbabbabaaabaabaababbabbbbbaabaaabaabbbbbbaabbbabbbabbbaaabbabbbaaabbbabbbaaaaababbbbababbbbaaaaaaabbbbbbaabbababbbaabbbbbaabbabbaabaaaaaaaababaaabbaaaababbababaaabbbaaaabbbaaabbabbaabababbbaabbababbabbbbababbaaabbaabbaababbbabaabbabaabaababbbaabaabbaaabaabbaabbbaaaabaabbaabbaabbbbbbbaaaaaabaabbaaaababbbaaabaaaaaabbbbbbaaaaaaaaabaabaabbbababaaaaaaaabbabaaabbaaabbabbbbbaabbabaabaabababbbbbaabaaaaabbabbaababbbabbbabbababbbaaabbbbabaaaabbbabbbbaababaaabaaabbabaaabbaaaabababbbabaabbbbabbaaaabbaaababbaabbbaababababbbbaabbbababaabbbbbabbbabababbbaabaabaaababaabbaaaaabbabbaaaaabaaababaabaaaaaabbbababbbbbbaabababbbbaaaababaababababbaaaaaaaabbbabaaaabaabaaaaaaaaaaaabbbaabaaaabaababaabbabaaabaaabbabaaaabbaabbabaabbabaaaabaaabaaabaaababbbbabbabaabaaaababbaaaaababbaabbaabbaabababaaababababbaabbababbbbaabbbbabbaaabbabaabaabaabaabaaaababaaaaababbaaabaaaaabababbaaaababaaaabbaabaaaaaaabbbaabbaaaabbabbbabaababbaabbaabaabbabaabbbababbabaabbbabbaaaaaababbbbababababaaaaabbbabbbabbaaabbbaaababbbabbaaabbaaaaaababaababbabbbaaabaaaaabaaababbbaaaabbaababbabbaaababbababaaaabbbbabbabaaabaababbbbbbbbbaabbaaabbbabbaaabbbbabbabbabaaabaabbbbbbaaabaaabbbbbabaaabbbbaabbababbaabbbaaabaaaabbbaabaaabbbabbbbbbbbbabbbaaaabbbaabbbaaabababaabaaabbbaaabababbbabbbbabbbabbababbbaabaaaabbababbbbbabbbababaaabbaaabaabbbaabaabaaaabaaabbbabaaabababaaabbbbabbabbbabaababaaaabaaabbabbaabaabaabaabbbbbbbbbaaabaaaaababbabbbaabaaaaabbbbbabbbaaaaabbbbabaabababbabaababaabbabaaabbbbbbbbbbbabaaabaaabbbbaaababbabbaabbaabbaaabaababbabaaabbaaaaaaabbaaaaababbbbbabbbbbaabababbbaabbbaabbaaaabbabbbaaaabaaababaaaaabbbaaababaabbbabbbbabaaababbbabaaaababbbbabbaaaabbbaabbbaaabbabbabbaabbbaabbbaaaabaababbabbbbbbabaaababbbbbbbaaabbbbbbaaabaabbabaabaabaaaabbbaababababbaaaaabbbbaaabbbaaaababababbaabaaabbaaaabbbbbbbabbaaaaaababbbbbbabbaaabbbabababbaaaaababbabbbbabbbabbaabbbbabbbaaaabbaaaabbbaababbbbbabbbbbaababaabaaaabbbbbbaabaabbbabbabaaaaaabaabaaaabbbbababaabababbaabbaabbabbaaaaaaaaabbbaaababababababaaaaaaaaabbaaabbbabbabaababbaaabbbabbbbaabababababbbabbabbbabbaabbababaababbaaaaabaabbbaaabbaabbbbbbbabaaabbbaabaabbbbabbabbaaaaabbbabbaaabbbaabbaababbaaabbaabbbaaaaaabaabbabbbaabababababbbbabaabaaababbaaababaabbbaabaaabbbbabbaabbabbabbbaaaaabbaaabbaababbababbabbbabbbabbbbabbabbbabbabababbbbabaababaaabbabababbabababbaabaabbbababababababbbbbbaababbaabbaaababbbbbaaababbaabbabbabbababbaaaaaabbbbbabaabbbaaabbaabbaaabbbaababbabaabababbabbbaababaaaaababaaabababaaabaaabaabbaaaabaabbaaabbbaabbaaaaaaabaabbbbababaaabbabababbababbbbabbabababaabbabbaabbabaaabbaabbabbbaaaaaaabaaaabababbaabaaabbbaabbaabbbbbbbabbbaaabbaababbabbababbbbbaabbaaabbbbbbaaababbaaaaabaababbbabbabbbbabaaaababaababaaabaaabaaaaabaababbabbbbaabbababaababbbbaabaabbabababaabbaaaaabaaabbabaabbabaabbbaabbbabaaaabbbbaaabbbababbaabbbbababbbaaaaabaaabaaaabbaaabaaaabaabaaaaabbaaabbbaababaabbababbbaaaaabbaaabaabbbaaabbaaababaabababaababbbaaabaaabbaaabbbaababbbabaabbabaabbaaababaabaaabbabaababbbbaaaaabbaabababababbabbbaaababbbbaabbaaaabbbbaaababaaabaaaaababbbbbbaaabaababbbbbbbaaaababbbaabbaabbbbbaaabaaabbaababbabbabaabaaabababbbbbaabbbabaababbbbbabbbaabbbbbbbbabaaaabbbaaaabbababbaabaabbaaaabbabbbbbbaaabaaaabababaabbbbaaabababaaaaabbbbaabbaabbaaaabaabaabbbabbabababaaaabaaabaaabbaabbbaabbbbbaabbabbbbaabbbabaabbbbabaaababaababbbabaaabaaabaabaaabbbbbbbabbabaabaabababbabbbbaababbabababbaabbbbabbbaabbbaabbbbbbaabaaaaabaaaaabaababbabbabbbbbababaabbababaabbbababaababaabaabababbaaaaaabbbaabbbbbaaaabbaababbbbabbbababaaaaaaabbbabbbbabbbaabababbbabaaabbabbabbaabaabbbabbbaababbabbaababababbaaaabbbbaababbbbabbaabbaabbbaabbbaabaaaabbaabaaabaaabbbababaaabaaaaababaaabbbbbabbbaababbbaabbaabaaaabaaabaabaababaaabababbabbbabaabbabbaaaabbababaaaabababbaaabbaabbbabbbbbbbaabbbbaaaabaabaaabbbababaaabbbaaababbaababaabbabbbbaaababaababababaaaaaabbbbbaabaabababaaaababaaaaaabbababaaaabbabbabbaaaaaabbabbaabbbabaabaaabaaaaaabaaabaaabbaaaaaaaabababaaaaaabbabaabbbbbbabaabbbbbbbabaaaaaaaaaaabbaaaaaabbbbbaaaabaabbabbbbbaaabbbabbbaaabbabbbbbbbabaabbbabbaabbaabaabaabbbabbaaaaaaaabbbbbbaaabaababaabbbabbbabaabbbbbabaabaaababbbabbaabbbabaaaaabaabbaabbaabbababaababbabbbbaaaabbaabbbbbbbaabababbabbbbbaaabbbbbbaaaaababbbababaabbaabaaaabaaaabbbbbabbaabbbaabbabbaabbaaaababbaabbbabbabaabaabbbaababbaaaaabbababababbabbbabaaaabaababbbbbabbbbababaabbabaabbababbaaaabbbbbaaaaabbabababbbabaaaaaaaaabaaabbbbaaabbabbaaabbbaabaaaaaaabbaaaabaaabbbababbbbaaabbabaabaababbbbaabaaabaabaaabbbaaabbbabbbbaaabbabaababbbabbbbbabaabbaabbbababbaababbaaaabbabbaabababbbababbbaababbbbbaaaababbabbabaaababbbbbabaaabbbbbbaaaabaabababababbababbbababbabbaaaabbbaaaaaaabababbbabbbbabbaabbbbbbbbbbababbbbaaaababaaaabbabbaaabaabbabababbaaaabbbbbabbaabbbbabaabbaabaabaaababbaabaaaaabbaababaabaaababbbbbaaaabbbaaaabbbabaabbbaaabbabbabbaabbaabababbbabbbabaaaabaabaababaabaabbbbabbaaaabbaaaababaabbbabbaaabababaabaabbabbabbbbaaabaaababbabbaabbaaaaaaaaabaababbabbbbbaaaaabbbaababaaabaaabbaabbabaaabbbaababbbbabaaabbaabbbbbbbbbbaabbbabbbbababaabaaabaabbbababababaaaaaabaaaaaabbbabaaabbabaabbababaabaababbbaaabaababbbabbbbbaaababbaaabbbaabaababaabaaabbbabaaaaaababbbaaabbbaababaababbbaabbabbbaabbabbababbbababbaaababaaabbbaabaaabaabbbabbbbbbbbabaaaababaaabaaaabbbaaabbabbbabbabbabbabaaaaababbbabbaaababaaaaaaabbbbbbaaabbaabbaabbbbabbabaaabbbabaabbbabaaaaabababaabaabaaaabaaaaaaabbaabaaaaaabbbbabababbbbbbbbbaabbabaabbbbaaababbababbbaaaabbbbbbbaababbaabaabababaaaabbbabbbabbaaaaabababaabbbbaababbbaabbbbaabaaaaabbbbaabbaababababaaabababaaabbaabbbbbaaaaaaabbbaabababaaaaababaabbbaabbbaaabbaaaaaaaabababaababbabbbbabbabbbaaaabbbaaabbbbabbaaabaabaabababaabaabbaaaaaaaabbbaabbabbbaaaabbbabbbabbbbaabbbaabaaabaaababababaaaaaaaabbbbabbababbbaaabbbabbababaabbaabbbbaababbbaabbaabaabaababbbabbbbbabbabaaabaaababababababaaabbabbababaaabaabbabababaaaaabbbbbbababbbbbaaaababbabaaabaaaaabbbbabbaabaabbbaabaabbababbabbaaaaabbbbbaababbabababaaaaababaabaabababbaabababbbbbabbbaaaabbaabbbaababaabbbaabbbaababbabaaaabbbaaaabbbabbabbabbbaabbaababbbbabbaabbaabbaaabaabaababbaabbaaaabbbababbbaabaabababbbbaababaaaaaaabbbaaaabbababbaaaabaaaababaabbaabaaaabaabbababbbabaabbabbaabaaabbabaaaaabaabbbaaaaabbbabbbbaabbaaabbabaaaabaaaabbababbababbaaaaabbabbbaaababaaabbababaabaabbbaaaaabaababbaabbbaaababaabbabaababbbabaaaabababbaaabbbaaaaabbaaaaabaabaaaabaaaaabbabbbbbaabbaaaabaabbaaaabaaaaabbaababaaabaababaabababbaaababbbbbaabbaabababbabbaaaaababaabbabbbaaaabbbbbaabbaaababbbaaaabaababaaaabaaaabaaaabbbabaaaaabbbbaabaabaaababbbaabaabaaabbbbabbabaababbbbaaabababbabaaabbaabbbbaabaabbbbbbbbaaaabbbbbabaaaaaabbbaabaababababaaaabbbabbbabaaaabbbbaabbbbaabbbbbbaaaababaaaabbaaaaabaabbbaabaaaaaaabaabaaaabbabababbbbbabbaaaaabaabbbbabbbaaabbabbaabaaabaaaababbaaabababbabbaabbaaababbabbbbbabbabbaaababaaaaabaaaaaabaaaaabaabbbbbabaaaaabababbaabbabbbaaaabaababbaaaaababbbbbababaababbbaaaaababbbbbbababbbaabaaaaabbbaabbbababababbbbaababababababaabababbbbbabbabaabbbabaababbbbbaaabbababbaaaababaaabaaaaaabaabbaabbaabababbbbaabbaaabbaaaabbabbbabbbaaabababbaaaaaaaababbbbbaababbabaaabaababaaabbaabababbbbbbbbbabbabaabbbabaabaabbababaaababaababbabababbbbbbabbabbaaabaabbbabbbbaabbbbbaabaaaabbaabbabbbaaaabbbbaababaabbaabaaabbaaabababbaaabbbbaabbbbaaabaaaaaaababbabbbaaaaaabbabaabbabbbbbaaaaaaabaabaabbaaababaabbabbabbbbbababbaaabaaabaaaaaabbbaaabbabbbbbaaabbbbabbabaaaabbbaaabbaaaabbabaababababbbbbaaaabababbbbababbbabbaaabaaaaabbaabaabaababbaabaaabaaababbbbbaaaabbabaabbabbbaababaabaababaabaabbbbbaaaaaaaabaabbababbabbbbabbababaaababbbbbabbbabbaabbbabaaaaabbaababbabbbbabaaaaaabbaaababaaababbaabbaaabaabbbabbabaaaabbbaaaababbaabbabaaabaaaabaaabbbaaaabbabbbbaabbaaaabbbbaaabbababaabbaabbababbbabbbbbbbbbaaababbbabbabaabbbabaabbbaaaabaaaabbabaabbbaabbbbbababaababbbbabbaabbbbbbaabaabbbabbaaabbbaaabbbaaaaaabbaabbabaaabbaaaabaaaababbbbaabaaaaaabbabaaababaaabbaabaababbabaaaabaabababbaababaaaabaaababbbbbbabbaaabaaabababbbaabbaaaabababbbbbaabbaabbbbbabbabbaaabaaaabbaabbbabbbbaabbbaababbabbbaaabaabaabbaaaaaaaaaaaaaaaabaaabaaaabbaaaabababaabbabbabbaaaaabbbbaabbabbbaabbaabbbaaabbbabbaaabaaabbbbabababbabbbaabababababaabbbbbbbaaaabbaaabbaaaaabbabbabbaaabababbabbabababbbaaabaaabaaababbbbabbbaaaababbaaabbaaaaaabbabbaabbbbaaaaaabbababbbbbaabbbabbabbaabaaaaabaabbbbaaabbaaaaaabbbaaababbabbbaabaaaaaabbabbbbaaaabaaaaaabbbabaaaabbabaaabaabaaabbbabbababbbbbbbaaabaaabababbbabaaabbabbbbaabaabaaaaaababbaabbaabbabaaababbaabbbaababaaaabbbbbabbbaababbabaaaaaaabababaaaabbaabbabbbababaabbabbaaabbababbbbabaaababaababaabbbbaaaabaaabaabbaababbaaabbbbababbabbaaaaabbaabaabaabbbaabababbabaaabbaaaaaaabbabababbaababaaaabaaaabababbabaabbaaaababbabbbabaababbaaababaaaabbabaaaabababbbabbababaabaaabaaabbbabbbbabbbaabbbbabaaabaabbaaababaaabbaabaaabbabbbababbbaaaabbbaaabbbababbbaaabbabbbaababbaaaaaaabbbbaaababbbbbabaabaaababbaababaaaaabaaabbbbbaaabbbaabbbbaaabaabbabbbbbbbabbbbbababaabaaabaaaaabaabaabbabbbabbaaaabaaabbaaaabaababababbbaabbbaaabaababaaababaaaaaabbbabbbbaaaaaababbabaabbaabbabbabaaabaabbaaaaaaaababbaabbaabbabbbbbbbbabbabaabbbbbaaaabbaaaabaaabbbabaaaabbbaabaabbbaaababbbaaaaaabbbaaaababaaababbbbaabaabaabaaababbabaabbbaaababaaabaababbaababaababbbbbbbabbbaaaabaabbbabaaaababbaababbbaaababbabababbbabbbbaaabaaaabababbbbaabbbbaaabbbaaabbbabaaabaabbabababbabbababbabbaabbbbbaaabbabbbaaababbbbaabbbbbbbbbbaabbabbaaaabbabbabaababaaaabaabbbbaabbbbbaababbaaabbbbbbaaaabbaaaaababbbbaabbabbbbaabbbabbababbbabbbbabbbbbaaaaabbbbababbaaababbababbaaaaababbaabbabbbbabaaaaabbbbbbbaaababaaaabaabbaabababaabbabbbaaaaaababbbabbaabbabbaababbbbbaabbaaabbbbbababbabaaababbabbbababaaaababababbbbbbabbabaaabbbabbabaabbabbbbabaaaabaabbababbabbabbbbaaaabbbabbabbbabbabbaabbbbbabbaaaabbabbaaaaabbabaabaaabaabaabaabbabaabaaaaaabaaabbbabaabbabbbabbaabaabaaaabaabababbbbbbaaaaaabaabaaabbabbbbbababbabbababaabbaaaaaabababbaaaaabaabababbbbbabbbbaabbabababaababaaabbbabababbaaabaaaaaaaaabbaaabbabbbaaaaabbaaabbababbbbaaabaaabbbabbaabaaabbbaabbababbaabaaabbabbbabbaabbbaabaaabbbbabbbbababbbbbbaababaabaaaaabbabbbabaaaabababbabbaababaaabababbababababaaabaabaabaababbbabbaaaababbaabaaabbbbbbabbababababbbbaaabbabaabaaaaababbabbaaabaaabababbaabbbabaababaaabaaababaaababaaaaabbbaaaabbababaaaabbabbaabbbbabbbaaaabbbbbabaaaabbbaabaabbbbbbbbbbabbaaabaabaabbbabaaababaabbbaabbaabbaabbbbbabbaababaababbaaabaaaaaabbbbabbbbbbabbabbaabababababbaaabaabbaaaaaabababbbabbaaaaaabbabbaaaaaababbbbabaabaababbbbababbaabaaabbaaabababaababaabbaabbabbbabbababbabbbbababababbabaaaabaaaabbaaabbbbbababaababbaabaaaabaabaaaababbabbabaaaaaabbbaababbaaabbbbbabbbbbbbabababbabbbaaaabbaaaaaabbbbaaaaabbabbbbbaaaaaabaabbbbbababaaabbaaabbaaabbbbabbbaababaababaaabababbbababaaabbbabaaaaabaabbaaaaaabbaaaaabbabaabbbbbbaaabbbbbbbaababbaabbbbaabaaabbbbbbbbaabbaabababaabbaaaaabaabaabbbabbbbbbbaabaabbaaabbabbababbaaaabbabbbbbabaaaabaaaabaababbbababaaabaabaababaabaaababbbbbaaaaaaaabbababbbabbabaaabaabbbbabaaaaababbaaabaabbababababaabaaaabaababbaabababbbbbaababaaaabbababbbabaaabbbababbbaaabbbbabbaabaabbabbbbbababbbbbbabaabbaabababbbabbabaabbaaaabaaabbbbabaaababbbbbbabaaaabbabbabaaaaababaabaabbbbbabaabbbabaaaaabbbbababaabaabbaaabaabbbabbbbaaabbaabaaaababbbbaabbbaabbaabbabbbabbabbababbabaaabaaaabbaabababbbaabbaaabababaabbaabaaaabbabbabbababaabaabbaaaabbabababbbbaaaaabbaaabaaaaaaaabaaabbbbbaaabbaaababaaabbabaaaabbbaabbbbbaaaabbabbaaabbaaabbabbbabbabaaabbabbaaaaaaabbabbbbbabbbbaabaababaababbaaaabababbaaaaabbaaaababaabaababbabbabbabaaabbaabaaaabbbbabbbbbababababaaabababbabbaabbaabbbabbbbbaaabbababbbbaaaaabbaaaaaaabbbaaaaaaabbbbabaaabbaabaabbbabbbaabbaabbabaaabaaaabbabaabababaaaabaabababbababaabababaabbaaabbbbbaabaabbaabbbababbaababbbabbabbabbbaaaabbbaabaaabbbaaaabbabaababbbbaabbbbaabaabbaaaaaaaabaabaababbaaaaabaababaabaabbbbabaaaaaababaaaabbaaabbaaababbabaaaabababbbbbbbababbbbbbbaaabbbbbbbbbabbaaaaaaaaabaabbbbbbabbaaabbabbabababbbabbabaaabbaabbabbbaabaababaabbababbabbaabaaaabaaababbaaabbbaaabbbbabbbbbaababbababbbaababbbabbbbbbabbbbabaabaaababbaabbaaabbbbbaabaaabaaaaaaabaaaaaaaabbaabbbaaabbbbbaabbabaaababbbababbaabbababbababbbaaaababaaaaabaabbaaaaabbbbaaabbaabaababbaabbbabbbabababaababaaaababbbbbbabaaaaaababaabbbabbbbaaabbabbaabababbabbaabaaaaaaabaaaabbabbabbbbbbbaaabbaaabbbbbaabaaaabbabbbaaabbababaabbabbabaaabaaaabaaabbbabababbaaabbbbabababbbaaabaabaaaaaabaaabbbbbbbaaaaabbbaabababbbaaababbabbbbabbabbbaababbbbabbbaabbabaabbbababaaabbaaaaaaabbababbabbbababaaabbaaabbbaabbabaabbabbbaaababbabaaaaaaaabaaabbbbabaabaabbbbaaaabbbaabbabbbabbbbabaabbbaaabbaabbaaababbbbbbaababbabbaaabbbbabbaabbbbbbaabbbabbbbbbabbbabbababbabababbbbaabbbabaaabbabbaaaabaabbbaaabbabbbaaaabaabababbabbbaaabbbaabbaaababbbbaaabbbbbbabbbabaabbababababbbbbabbababbbbaabbaaabaabbbbaababbababaabbbbbaabaaabbbaaabbbaaaaabbbabbabaaabaabaaaaaababbbbabbabbaaababbbabaabbabbaaaababaabaabaaaabaababbabbaaaaabaaaaaababababbbbaaaaaababaaabbbababbbaaaaaaababbaababbabbabaabbaabbbabaabbaaabaabaaabbbabaabbbbabbbaaababbaabbbbbabbbaabababbbbaababababaabbaabbbabbaababaaabababaaaabbbbaabbabaaaaabaaaabaabababaaabbbbabaabaaaaaaaabbbaaaaabbaaaabbabababaabaaabbbbaabbababaabbaaaaaaaaababbbbbaabbaaabaabbabaaabaabbbbbaaaabbaabaabaaabaabbbaaababbbaabbbabbabbbaaabbabbaabbabbaabbaaabbbabaababbaaaabbbabababbaabbabaabaaabaabbbababbabaaaaaabaabbaabbabbbabbaaaaaabbaaaabbababbababbbbbabbabbaaaabaababababaababbbbbaaaabababbaabbaaaabbaabbbaaaaaaaabaaaabbababaabbaabababaaaaababaabbaaabababbabaaaaaababbbbababbabaaababaabbbbbaabbbbbbbaaaaaababbaabbbabaabbabbaabaaaabaaabaabbabbbbbbbabaaaaabaaabaaababaaaabaababaaaaababbbbabbabbbbbaabbbabababaabababbababaabaababbabbaabbaabaabbbbbbbababbaabaabaababbaababbababbaabbaabaaaabbbaabbbaabaaaabaabbbabaabbbabaaabaababbaaaaabaaaaaaaaabbbbbbaabbbaaabaabaaabbbbaabbbabbabbbbbabbbaaaaaabbbbbabaabaababbabaabaabbaaabbaababbabaababababbbaaaabaabbaabbabbbababaaabaabbbaaaababaaabbbabbbbaabbbaaaaaaabbbabaabaaabbabbabaababababbbaabbbbababaaaaabbbaaabbbbababbabbbbbbbaaabbbabaaabbababbbbaaaabbbaaaababbbbaababbbaababbabaabbababbbabbabbbaaaabbbabbaabbbabaabbababbabbbbbaabbbaaaababaaaaabaaaaabbbabbaaababbbabbbbbbbabababaaabbaaabbaabbaaaabbbbbbbbabababaabbabbbaabbabaaabbbaaaaaababbbbbbabbbabaaabbbaaabababbbaabaababaabaaaaabaaaaabbbbbbabababbabbaaaaaaaabababaaaabaabaaabaabbbaabababbaaaababbaabbabaaaaaabaaabbababaaaaababbbbbbababbaabbbaabababbbabbbbbbaaabbbbabbaabbbabbaabbbaabaabbbaababbbbbbaabbaaaaaababbaaabbabbbbbbbabbbababbaaaababaaabbbaaaababbaababbbbabbbbbbaaaabbabbbbbaaaaababbbabbbababaabaaabaaabbbbababaaaabaaababbbaaabaaaabbaabbabbaaabaaabbbabaabaaabbaaaabbaabbbbabaaaabaabbababababaabaaaaaaaabaababbabaaaaabaaaabbbbbabababbabbbaabbabbabbabbbbbbaaabbbbabbbaabaabababbbbbaaaabaababbaaaabaababaabababbaabbaaaaaaaabbaaaabaabaaaabbbbaabaaabbabbbbabbaaaabaababbbbbbbbbaaaabbabbbbbaabbbababaaaaabababaabbbaabbabaaabbaabababaabaaaaabbbaabbbbbbbabaaaaababbbbbbabbabbbabaababaababbbbabaabbbbbbabaabaababbabbbaabbbababaaabbbbababbababbbbbbabaaaabaaaaaaabbabbaaabaaabaabbabbabaaaaabaabbbaabbabaabbbbabaababbbbbbaabaaaababaaabbabaaabbbbaabbaaaaabaaabbabababbaaabaaabbbaabbabbbaaaaaaabaabaaababababaabbaabaaabbaaabaabaabbabbabaaabaabbbaabaabbababababaaaaaaabbaaabbababbbbbbbbbbbbbbbaabbbaabbbbaaaabbaabaabbbaaabbbaaaaaaabaabbbabbabbabbabbabaabbaababbaaababbabbbaabaaabbaaaaababbbabbbaabbabaaabbbabaaabababbbaaabbaabbbaaabbaababbbbbaababaaabbabbbbbabbaababbababaabaaaabbbbaabbababbbaabbbbbbbaaabaababbabbabaaabbbbaaababbabaabbbaaaababbbbbabbbaabbabaababaaaaabbabbababaababbabbbbabbabaaaaaaabbbababbbbaaabbabbaabaaaabbabbbbbaabbaabaaabaabbbbabaabbbbaababbbabbaaaaabbabaabaababbaabaabbabaabaabaabaaabaaabbbbbabbabaabbabbbbbbabaabbbabbbbabbaaaaaaabbbabbbbaaabaaabaababaaabbaabbbbabbbaababaabbababbabaabbaabbbabbbaaaaabbbbabaabbabababbabaaaababbbbababababbabbbbababbaabaaababababaaaaaaabbabbbaababbbbaabbaaaaabaaababbbbbaaababababaaabbaabaababababbbaabbbaababababaabbbbaabbaabaabaabaaabbabbabaaabbabaaabbbaabababbabbbaabbbaaaaaabaabbbabbaabababaaabaaaaabababbaababbaabbaabaababababababbaabaaaabbbaaabbbbbaabbabaaabbbaababaaabbbababababbbaabbaaabaaaabbbabbabaaaaaaaaaaabbabbbbbaabaababaabaaabbbabbabbaaabbbbababaabaaabaababbaaaaabbabbbbabaaabbabbaabbabaaabbbbabbbaababaaaaababbbaabaabaabbbbbbaaaabbbbbbaababbbbbabbbbababbbabaaabaaabaaabababaaabaaabbbababaabaaaabaaaaaababbbbbaabbababbbbbabaabbbaaaaaabababababaaabbaaaabaabbbabbbbababbbabbaababaaaabbaaabbbaaaabaaabababaaaaaabbbbabbaabbbbbbbbbababbbbabaabbbbaaababbbabaababbababbbbabbbabaabbbaababbbaabababbbabbbababaaaabbbaaabaabbbabaabbbabbbaabbaaaaababbbabbabaaabbbbbbbabaabbbaababaabbaaabbababbbbabaaabbbaabbaabababbaaabababbaaaababbbbbaabaaaabaaaabaababaaaababaaaabaabaabbbbbbaabbbbaabaaabaabbabbabbbbabbbabababaabbabbabbbaaabaaaabbbbaaaababaababaabbbbabbaabaabbbbaaaabbabbabbabaaabbaaaabbbaaababbbbabbbabbbbbbaaaaabababbbbbaababbbabbabaabbaaabaabaabbaaaaabaaaabbaaababbbaababbbbabaabbaaababababbababbaabbbbbabbbaaaabababababbaabaaaaaaaabbbabaabbbaabbaabbbbaaaaabbbbaaaaaababababbbaaabbaabbbabbbabbbbaabababbbbabbbaabaababbbaabaaabaaaaababaaabbaaaabaabbaaabbbbbaaaaaaabbabaaaaabbabbaababaabbbaaabaabaaaaabbbbababbaaabbbabaabbbbaaabaabaaabbbbabaababaaabababbabbaaababaabbaababababaaaaaaaababaababababbaabaabaabbaabbbabaababaabbabababbbaaaabaaaaaaabababbababbbbbbaababaaaabbaababaaabaababbaabbaabbbbaababbbbbaaabaabaabbbabaaaabbabbbbbaabbaabababbbbbbbaabbaabbaaabbbbaabbaababbbaaabbaabbababaaabbbaababbbaabaabbbaabbbbaabbbabaabbbabbababaaababbaabbaaaaaaaabbaabaaababaabbaabababaaaabbabaaaabbbababbbbbabbabbababaaabaabbaaaaaaaaaababaaabbbbbaabaaaaaabbaababbbbbaababbbbaaaaabababababbbaaaabaaaaababbbababbabaababaababaabbaaaaaaaaaabbbbbbbaabaaabbbbbbabaaabbbaababbbbaabbabbaabaaaabbbaaabaaabbabbaabbabaababbbbababbbababbababababbaabbbbbbbbbbaaababbabababababaabbbaabbaabbaaabaaaaabbbbaabababbaabbbaabbbbbabbaaaabbbaabaabaaabaababbbbaaabbbbaabbaaaaaaaaababbbaabaabbbbabbabaaaaabaabbabbbabbbaababaabaabaaaaababbaaaaaaaabbbbabababaabbaabaabbaaaabbbaaaaabbaabababaababaaabababbababababbbbabbbbabbbaaabbababaaaabaabababbbbbbbaababbabbbbababbaabbabbbbbbbababaaaaaabbaaabbaabbbbaabbbabaaaaabaabaaabbaaaaabaaaaabbbbaabaaaaabbbabaaaabababbabaabaabbbabbabbbbaababbbbbbaaababaabaabbabaaabbbbaabbaaaaaabbbbbaabababaaabaababbbbaababababaabbaaababaaaaaaabbbabbbabaaabbaaaabaaaabbbbababbaabababbbabbbaaabbbabbbbabbabaabbbaaabbababaabaababbaaabbbaabaaabababaaabababababbababbabbabbbbbabbbbbaaabbbbabbbbbbbbbbbaababaababbaabbbabbaabbaaaaabababaaabaaaaabbbbbaaababbbaabbabaaaabbaabbabbbabababaaabbaabaaaabaabaaaaaabbaabbbbbaaaaaabbbbabbaaabbbabaabbbbbababbbaaaabbbaaaaaaabbaababbababbbbabaabaaabaabbabbabbaabbbabbaabbabbbabbbbbaaabaaababbababababbababbbbbbaaaaaabbaaaaabbabaabbbaaaaaaababaabababbaabaabbaaaabbbaabaaaabaaabaaaaababbbbabaaabbabaaabababababbbbbbaabaabaaabbbbbabbbabaababbabbabbbbbabababaababbbaaababbbababbabbbaaababaabababaabaaaabaaaaabbbbaaaabbbabaabbbbaabbaaabaaabbbabbaaaaabaaabbaaaabbbbbaabbaabbabbaaabaabbbbaabbbbaabbbbabaababaabbbababbaabbabbabaabbbaabbbaaaabbbabaaabbababaaabbbabbbbabbbaaaababbaabababbaaaabbabbbbbabbbabaaabbaaaaaabbabbbbbaaaaaaabbababbbaabaaaabbaaabbbabbbaababbabbabbaababaabbbbabbabaaabbbabaabbaaabaaaabbbbbbbaabbabbabaaabbbbaabbbaabababaabaaabbabaaabbbbbababbaabbaabbbbbabaabbabbabaaabbabbabaaaabaaaaababaabbaabbaaababbbbabbaabbaaaaababaaaaabaaabbaabababbabaaaaabbaababababbaaaabbbaabaaabaaabbaaabbbbbabababbbbaababbbaaabbaabbabbaaaabbaababaababbbabbbbabaababaabbababababaabbababaaaabbbabbbababbaabaaabbbaaaabaabababbbbababbbaaabbbbbbaabbbbaaaabaaabbbabbbaabbbbbbaabaaabbabbbbbabaabaabbbbaababaabbbaaaaaaabababbbbababbbbbbabbabbabbbabbbbbaabaabbbabbabbaaaababbbaababaaaaaaaaabaaaabaaababaabaababbaabaaaabbaabbaabaababbabbaabbabaababbbaaabaabaabbababaaabbabbbbbabaaaaabbabbbaaabbbbbbabaabbbbbbbbbbabbbbbbbbbaaababbbababaababaabaaaaabbababbbabbbabbbbbaaaaaabaabababbbaababaabbabbaaababbbabbbaabbbaabaabbabbabbaaaaabbbbbaaaaababbbbabaabaaaabbbabbaaabbbaabbababbbabaabbbaababaabbbbaababbbbbbaaababbababbabbbabbbabaabbaaabbbbaababbabbbaabaabbbaabbabaabaabaabbbababbaaabbbabbabbaaabbbbbbbabbbbbababaababaababaabbbbababbabbbbbaababaababbababbaaaabaaaaabaaabaabbababaaabbbbaabbaaaaabababbbbbbabbbbaaaabaabaaaabaabaabbbabababaabbbbbabbaaaababbaaababaabaabaabaabbbbbbaababaababbbbabbaaabbaababbabbbabbaaaabaabbaabaaaaabbabbbaabbaaabbbbabaaabaababbbbabbabbabbbbabbababaabbbabbaabbabaaaaabbabbbbabbbabababbbbbabababbbbaaabababbabbbabaabaabbaabaabaababaababbbbaabaaaabaabababbaaabbabaabaabbabbbabbbabbaaaababbabaaabbabababaabbbaababababbabbbbaabbbabbbababbaaabbbbaaabbaabbbabbaaaabababbabbbaabaaabaababbababaaaaabbbbaaabbabbabbbababaaabababaaabababbaababbaababbabaabababaaaaabbbbbbabbaabababbbbababaabbaaaaaaaaabbbaabbaabbbbbabaabbabbbabaaabaaabbbbbbaabbaabbabbbabbaaabbabbababbbaabaaaababaabababbbaabbaabbbaabaaabaabbaaabbbbaaababbbaaaabbbabaabbaaabbaabaaabbabaababaabaabaabbaababaaabaababbbababaabbabbbbbababababbabbbbabaaabbbbababaaabaaabbbbababbbaaaaaaaabaaabaabbaabaaaaabbbbaababbbbabbaaabbaababababbaaabaaabaaaaaaaaaababaaabaabbabaabbbaababbbbbbabbbbbaabbbabbbbbabbbbabbababbbaaaabbbbababbbbaabbaabaaaaaaaabaaabaabbbaababaaabbbaaabbababbabbbaabbbbbabbbbabbbaababbbabbbbaababbababbbaaabbbabababbaaaabbbaaaabbaabbababaababbabaaababbbaabaaaabaaabbabbababababaaaabbbbaaaaababbbbabbbbbaaababbbaaaaaabbaaaaabbbabbabaaaaaaabbaabaabbbaaabbaaababbbabaababaabbbbbaabbbbabababbaabbaabbabaaaababbbabaaaaababbaaabbabbbbabbbabbbbbaabbabbbbabaababbbbaabbabaaaababaabbabbbbaabbbbabbaaaaaabbabaaaaaababaabbabbbbabaabbbbbbbabbbbaaabaaabbaaabbaaabbbbbbaababaabaabaabbbbbbbabbbbbbbbaabaabababbaabababbaaaababaabbbbaaabbabaaaaababaababaababaabaabbbbbaaaaaaabaaaabbaabbaaabaaaaababbabbbaaababbaabbabbaabaaabaaababbaaaabbaaabbbabaabbbababaaaaaabbaabbbabbababbbabaabbabbbbaabababbabbaaaabbabbbaaabbaabababbbbbbabaaabababaabbbaaaaabaabbbabbbbbbababbbababbbaaaabbaabbbabaabbbaaaaabbabaabbbaabbaaabaabbbbaaaaaaaabbbaaaabbbbbaababaabaababababbbbbbabbbbbaabbbbbbbaabbaabaabbbaaaaaaaababbbaabaabbabbaaaaabaabaababbbaaaabbbbababbbaabbbbaababaabbaabbaaabababbbbbabaabbaaabbbbaabbbababaabbaababaaaaabbaaaabbbabbbbbabaaaaabbbbbbbaaabbbbbabbbbbaabaabaababbbbbbbabbbaabaabbbbbbaaabaababaaabbbaabbabbbbabababbbabbbbbbbbbbbbaabbbabbaabbbabaabbbbabbabbaaaaabbabbbbbbbabaaabaabbbbbabbababaaaabbbababbababaaabbbbaabbbababbbbabbbabbaabaabbabababbaabbbbaabababbabbbbaaaababbabaabaaaaaaaabbbaaabbbbababaabbaabbababbbbaabbaababbaabbaaabbbababaababbbaaaabbaabaabbbaaabbbbbbbbaaaaaabbbbbbbaabbbaaababbbaaaaabaaabbbaabbbbbaaabaaaabbbbaabbbaaabbbaabbabbbbabababbbbbaaaaababbabaaababbaabaabaabababbaabababbbbbbbaabaababbbbbbaabaaaaabababbabbabbabaaabbbbaaabaaababbbabbbabbabbaaababbbababababbbbbaaababaaabbbbbbbbbbaaaabbabbbbbbbbbbbabbaabbbbaaaabbabaaaabbaaabbabaabaaabbaaaaabbaaabbababaaaaaabaaabbabbabbbabbbabaaabbaababaabbaaabaaababaabbbbabbabaaaabababbaabbbabbbaabbabbaaaabaaaabbabbbaababaababababbbaababaaaaaababbbbabaaabaaaabbaaabbaaabaaabaabaabaabaaabaabaaabbaababababaaaaaabaaaabbbbbaabbbabbbbbaabababbabbaaaababbbbbabbaaabbababababaabbbbabaaabbaabbabbbbbabbbbababbbaabbababbbbbbaaaaaabbbbbabbbbabbbbbbabbabbaaabbababbbbabababbabaaaabbbbbabaaaaaaabbabbbababaaabbabaaaaaaabbaaababbabaaabaabbaababbabbaaaabbaababbbbabbabaaabaababaababbbaabaabaabbabbbbabbbaaaaaabbbbabbbabababaaabbaababbaaabbbbabbaababaaaaabbaaaaabababaaabababbbbaabbbaaaaaaaabbbabbabaabaabbaababaaaabbbabbbbbbababbbbbaaaaababbbbbabaabbbaaaabaabbaabbbaabbbabbabbaabbabbaaaaaabaabaaabbabbabaaaabbabbabbaaabaaabaabbababababaabbbbbbbbbbbabbbbbbabbaaabaaaabbbbaaaaababbaaabababbbbbbababbbbbbabaabbabbabbbbbbabbaabaaaabbabbaaabbabbbaaabaaabaaaabbaaaabaabbabbabaabbaaabbbbbaaaaaabbbabbbbababbabbbbbaaabababbabbbabbabaababbaaabaababababbabaaabbabaaaabbabbbaaabbbabbababababbbbabbabbaaaabbbbbbbabbbaababbaabbabbabbabbbbbaababbaabbababaaaabaabbaabaabaabbababbababaaaabbabbbabbaabbaabbbababbbbbaaabababbaaabaaabababaababbaabbbbbbabbbaaaababaabbbabbbbabaaaabaabbaaaaaaaaaaabbbbbbabbaaabababbbabbbabbababbbbaaabaaaaaaaabaabaaaabbbabaaaaaababbbabaabbbabaabbbbaababaaaaababababbabbabaaabbaabbbbbabbaabbabababbaaaaabaaabaaabaabbbababbbaaaabaaabbabaaabbabbabbbbaaabbababbbaabaaaabaaabbaababbbbbaabaaaababbababbbabbbabbbaabbbabaabaabbaabbbbbbbbaaaaaaaababbaabababaaaaaabababbaaabbbbabaabaabaabababbbaaaaaababbbaaabbaaaaababbbbbaaabbabbbaababaaabbbbbbbabbbbabbbbbbbaaabaabaababaaababbbaabbbbabbbaaababababbbaababbbbbabaabababbaabbabaaabbbbbababaaaaaaaaaaabbabbbbabbbabbabaabbbbbaabbabaaabbabbbbbbaaabbaaababbabbbabbaabbabaaaabaaaabbabbbaabaaaaaabbabbbbaaabaabbbbaabbbaabaaabbbabbabbaabaababababaaaababbababbbbbbbbababaababbbabaaabaabaaabbaabbbbbbbbbbabbbabbaabbbaaabaabbbaaabbbabbababaabbbbbbbaabbaaaabbbabbbbbabaaabbabbaaaabaaabbabbbaabababaaabaabbbabbbaaaaaaaabababbbbbbbabaaababaabbaabbbbaaabaababbababaaabaaaabbbaabaabbbaababaaaabaaababaabbaabbababababbaabbaabbaababbbabbabaaabaabbabaababaabbbabbbbaaabaabababababaaabbabbaabbabaabbbaaabbabbabbbbbabbaaaaaaaababbbabbbbbaabbbabbabaabaaaaaababaababbaaabbaabbbabbbbaabaaaabaabbbbabbbababbabaaaabbabaaabbbabbabaabaabaaaaabaababbaaaabaababbaabbaaaabbbaabbaababaaaabaabaababaaaaabababbbbbaaaabaabbbaaabbabbaabaabaaaabbabababaabaaaabbbbabaababbaabbbababaabaabbaaaaabbabbabbbbaabbbaaabbbaabaaaabbabbbbbabaaaaaabaabbaabbbaaabbabbaabbbabbabaaaaaababababbababbaaaaabbabaaabbababbbbbbaaaaaabaaaabbaabababbaababbabaaaaabbababaaabaaabbbabbaaabaaabbbbabbbbaababbbbbaabbbbbbbbabbaaabaaaaaaababbbbbbbaabaaababbaabbaababaabaaaaaaabbbbaabbbbbbbbbabbabbbababaabbbbaaaabaaabababbbabbbaaabababbababbbbabababbbbbabaaabaabaaaaabbbbabbabbaabbbbbbaabbabbabbabbaaabbbaabbabbbaabbabaaaabbbababbbaabbaaabbbaabaababbbabbbbbbbbabababaabaaaaabaababbababbabbbaaaabbabbababaabababababbbaaabbbabbbaaabbbababbaababaaabaababbbaaabbaaabbaabaabbababbabaaabbabbbbbaaabaabbabbababbbaaabbbbaaaabbbbababbbbbabbabbbbaaabbbaababbbbababaabbababaaababbababbbabababaaabaaabbbbbbbabababbbaaaabaabaaaaaaaababbaaabaaaaabaabaaaabaabbbbbaaabaaabbaabbbabbbbbbaabaaaaabbbbababbbbaabbbbaabbabaaaabbbaabbabbbbbaabbaaaabbbbaababbaaaaaaabbbbbabbaaaabaabbabbaaababaabbbbabaaaabbaaaababbabababaaaaaabababbbabbbbabbbababaaababaabababbbbabbbabbaababaaababbaabbababaaababbbbabaababaabaaaaabbbbabaabbaabaabbaaabbbaabbbbaaaaababbaababababbbaabababbaaaaaaaaaaaaabbbbaabbbabbabaaaabbabbbaaaabababaaabbabbbbaababaaabbbbbababaaaaabbaaaabbbbbaabbbaabaabbaaabaaaabbbbaabbabbaaaabbbbabaaaababbbaaaaabbbbaababaaaabaabbabbbaabababbaabbbaaaaabaaaaababbabbaababaababaabbbbbababbbbaabbbbbabbababaabbabaabaabaababbbbbbbabbbaabbbbbabababaabaabbbbababbbaabaaaaabababaaaabbbaabbabbabbabbaabaabbbababaabbbabbbbabbaaabbaaabbabbabbabababbbaabaabbaabaaabaabbabbbbbbbababbbbabaababbbabbaaaaabababaaaabaaababbabbabababaaabaaaabbabbbbbaaaabbbaaaabbababbbbaaabbbabbabaabbbbbabbaaabaaaabbbababaaaaabbbaabaabbaabbbbabbabaaaabbaabababaaabbabbbaababbaabaababbbababbaaabababaababbbabbabbbbaababaabbaaaaaaaaabbbbbabbbabbaabaabaaaaababaaabbabaabbaabbbaabbababaababbbabbabbbbabaaabbaabbbabbbbaabbbbababbbbababbababbaaaabbbbbaabaabaaabbbababbbbaaaabbbbbabbbabbabbaabbbabbabbbabbbababaabbbbabbbbbbbbbababaaabbabbbbababbbbbbaabaabaaabbabbbbaaabbbaababbababaabbabaabaaaabbbaabaaaaabaabbabbbaabaaaabbabbbbababbbbabbaababbaaabababbaabababaabaabaaabbabaabaabbabbabbaabbbbbbaaaaaabaabbaabbaaabaaaaabbbbbabbaabbbbababaabbbabbaabaaaaaaabbaabbaabaaabababbaaabbbaaabbbaaabaabaabaaaaababbabbbabbaababbbabbabaabbbaaabbabaabaabaabbaabaaababbabbaaaabaaaabaaaabbabbbbbbaabbbbbabbaaaaabbbbababaababbbbbbababaaaaabbaaababbaababaabaaabaabbaabbbbbabaaabbababaabbbabbababbababbbbbbabbabaabbaaababbbabbbbaaaabaababbaaababbabbabaababbbaabaaababaabbaabbbabbbaaabbabaabbbabaaaaabbaabbabababbabaabaababaaabbbabbbaababbbbababababaabbaaabaabaabbbaaabaaababbaaabaabbbbbabbbbabbaaaabbabbbabbbbabababbabababaaaabaabababbaaabaaabbabbabbaaaaaabaaababaaabbababbbaabbabaaaabbbaaaabbaaaabaabababaabbbababbbbbabbaabbbabbaaabbaaaaabaabaaabbabaabbaabbaaaabababbabbabaaaaaababaaaaaabaababaaababaaabababaaabbabbaaaabababaaabbaabbaabaababaababbaaaabbaaabbabaabaaabbbbaaabaaaaaaaabaaabbababbbbbbbaabbaaaababaaabbbaababaabababaabbaabbaabbababaabbbbaaaababaaabbbbabaabbbbbaabbabbbbbbaabbabbbbabaaabbababaabbabbbbaaabbaababaaabbabbbaabaabaaaaaabbaabbaabbabbbbbabbbabbaabababbaaabaababbaababbbbbbabbabaaaaaabbaabbababbbbbbbabaababbbbbbbbbaabbbbbababaaabbbbbbbaaaaaababaaabbaabaaaabaaaaabababaabbbabaaaabbbabbabaaaabaaaaaaaaaaabbabaaaabbbbbbbbbabaaabbabbaababbaaababababaaaaaaaaabaaabbabbbabaabbbbaabaabababbbbbabaabbabaabbabaaaaaaaaaabaaabaaabaaaaaabbbabbaabbbaaabbbbabbbbbbaabbababbababaaabbbabbabbbbabbaaaaaabbabaabaabababbbabaababbabababaaaaabaababbbbaaababbbabaaaaabaababaabaababbaababababbbaabbbaaaabaabbbaabaabbabbbbbabaaaabbbaabbbbaaaaaabbaaaaaabaabababababbabbaabbaabaaabaaaababbbababbbbbbbabababababbbabaaababbbaabbaaaaabbaabbbaaaabbababababbbabaabbbbbabbbbbaabaabbbbabaaaabbababbbabbaaabbaababaaaababaaabbaabaaaaababbabababaabababaaaabababbbbbabbbbabbaaabbbbbaaabbbbbbbbabbbbaabababbabbbaaaaababbaabbbbababbababbbaabbabaababaaabaaaabaaaaabbaaabaaabaabababbaabaababbbababbbabaaaaaaabaaabbbbaaabaaaaaaaaaabababaaababaabababbbabbbabaaabbabbaaababbbabaabbabaaabbbbaaababaababaabaabbabbbaabaabbabaabbaabaabababaabbabababaaaabbbaaababbbbabaabbaababbbabbbbabaaaababababbaabbbbbbababbbbbaaabbbbaababbbaabaabbaaababababbbabbbababbbababbbabbbbbabababbbabbabaaaabbbbabaaabaaaaabbbaaabaabbaabbbbabaaabaaaaaaabbabbbaaaaabbbaabaabaaabababbbbbbaabbbaaabaabaabaaaabbbbaaaaababaaabaabbbbabbbbaababaabbbbbaabaaaaaaaaabbabbababaabaabbbbbabaabbabaaabbabbabaaababbabbaabaababababaabaaabaabbababaaaaaaaabbbbaaabaaaabaabaababaaabbaaaaaababbbbbbabbbaabbbabbbbabbabbaaabaabbababbabbbabbbbabbbbbabababbbbbabbaaaababbaabaababbaaaababbabbbbbabbabbaabbbabbbbabbaaabababbabaababaaabbbabbbaabaabbbaaaaaaabaabababbbaabbbaabbabbbbbaabaaabbaaaabbbbbaaaabbbbbbabbabbaaabbaababbaabbabaababbbbbbabbaabbbbababaaaabaabaaabaabbababbbabbbbbaaaaaabaaabbbbaaabbbbababaaaababaabbaabababbbbaaaabbbbbabbbababaababaabbabaaababaaaabbaabababbbbbaabbbaaababaabaaabbbbaaabbbaaaaabaababbaaaaabbababbababbbbaabaaabbbbbbbaabbabbaaabaababbaababaabaabbaaabbabbbbbbbaabbbabbbaaabbbabbaabbabbaaaabbabbabbababbbbabaababbaaababababaaaabbabaaabaaaaaaabaaabaabbbbabaabaabbabbabaabbaaaaaaabbbbababaabbbabbababaabbbaaabaabbbaaaaabbaaabaaaabbbabbaabbbaabbabaaabbbbbbabaaababababaabababbaabbaabbbbbaaabbabbbbabaabbbaaaabbbbaababbbababaaabbaabaabbbaaababbbbbababbababbbabaabbabbababaabbabbabbbaababaabaabbbbbaabaabbbbbabaaabbababababaaabbaabaabaaabbbabbbbbbbaaaababaaabbabbaaabbbababababaaaabababbaaaaababbbabbbbbabbbaababbababbbaaaaaaabaaaaabbbaaababbaaaaabbaaaaabbbbbaaaaaaaaaabaaabbbababaabbaabbbbabbaabbaaaaabaabaaaaaabaaabaaaabbaaaabbbaababbbaaabaaabaabbbbabbbaabababbaaaaabbbaababbaabaabbbaabaaaabbbabbbbbaaabaabbbabababbbbbbbababbaabaabababbbaabaabbaabbbbabaaabbbbbbaabaabaabbaaaabaabbbaabaabbaabaabaabaabaaaabaabbabaabbbbababbbbbababbbabbbaaabbbbaaabaabbaabbaaabbaaabaaabbbbabbbbbaabbbabaaaaabbaaabaabbbbaabaaabbbaaababbbaabbabbabaabbbbbaaabaaababababaaabbbabaababbabbbaabbbaaabbbaaaabbabaababaababbbbaaaaaabbbaaabababababaaabbabababbbbbaabbabbbbabbbabbababbbbbabbabaabbaaababbbbabbaaaaabaaaabbabbbabbabbbbaabaabaaabbaabababbaaabbbbbaaabababababbbbbabaaaaababaaabbbabbabbbaabaabaabbbbbbabaaabaababaaaababaabbbabbbbbaaabbaaabaaaabbbaaabaaabbaaabaabbbbabbabaaaabbabbaababaababaabbbbbabbabbabbbbbabaaababaabbaaaaabbaaabbbababbbbababababaaaaabbbbbabbabbbbbbabaabbbaabbbabbbbababbabbabbabbabaabababbbbbbbaabbbabbaabbbbbabaabbbbabbbaabbabbbbabaabbbaaaabaabbaabbbabaabbabbbababababaabaaabbbbaabaaaabbabbabbaaabababbbbaaabbaabbabbbababbbaaaabbbbaaabaaabababaabbbbaabbabababbbbaaabaabbbbaabaaaaabaabaabbbabaaabbaaaaaaaaaaabaaaaaabaabbbbbaabababaaaabbbbaabaaabaaabbaaaaaaabbbbbaabbbbbaabbaababbaababbbbababbbbabbbbbbabaaabbabbaaaabaabaabbaabbbaaabaabbbaaababbbaaabaabbbabbaababaaabbbaabbbbbabaababbabbaababaaabababaabbbabbbbaabbbbaaaabaabaaaaaabbaabbbbaabaaaabbabbbabbaabaaaabbaabbbbbababaabbabbaaaabbaaaaaabaaabbbaabababababbbbbbbbaaaabbabbbababbaabbaabaaaabbaaabbbabaaabababbbbbaaaabababaababbaababbaaabbbababbaaaaabbababaaabbbabbbaabbabbbaababbaabbbbaaaaabaaaaabbaaaabababbaaabbbbbbaabbbbaabaababbabbabaaaabbaaabbbbbbabbbbbabaabbbbbbaaabbbaaabaabbbbbaabaaabaabbabbaabbbbbaababbaaabababbaaabaabbabababababaaaababaaababbbababaabbbbaaaabbaabaaaaabbabababbaaaaabbbababbbbbabbbaabbabaabaaaaaabaaaababababaabbbabbababaaaaababbbbababbaabbabbbaaabbbaaababbbaaaaaabbabaabbabaababbbbaaaaabaababaabbbaabaaababbabbaabbbbabbabaabbaabbbbbbbbbbabababbbbbabbaabbbbbbabbbabbaabbaaabbaaabaaabbbbaaabaababbabaababaabbaabaaaaababaaabbbbbbbbbbabaaaaabaabbbaaabaabaabbaaabbbaaaabbaabaaabbbbbababbaababbbaaaaaabaababbbabbaabbaaabbabbbbaaaaabaaaabaaaababbabbbababbabaaaaaabbababbaaabbaabaaababbbbaabbbababbaaabbbabbabaaaabaabbbbaaaabbbbbaaabbbababbaaaaababbbbaaaaaabaaaabbbabbbbbabbbbabbaaabaaaaaaababbbbabaaaaabaaaaaabbabababababbaabbaaaaaabbbaaabbaaaaabababbbbaabaaaabaaababbaaabbaababbbbbbbbabbbabbaaabbaababbaababbbaaaabbaababaabaabaaaabaaabbaaabbaabbbaaaabaabbabaaababbabbababbbabaababbababbabbbabbbbbbbababbabababbbaaabaabbababbbbaabaabbabaabbaaaaaabababbaabbbaaabbbababbabaaabaabaaaaaababbbabaabbabbbaaabbaaabbbaabaabbabbabbaabaaabbababbbbaabbabbaabaaabaaabbbabbaabbbbabaabaaaabbbabababababaaaaabbbaaabbaaaabbbabbbbbabbbabbbabaaaaabababababbbaaabaaabbaaaaaababbabbaabbaaabababbabbbbbbbbbababbbbbbbaaabbbabbabbaabaababbbbbaabbababbbabbbbaaaabaababbbabbbbbbbaaaabbbaaababaabbaabaaaaaababbbaaaabaababbbbbbabaaaaaababbbaababbbabbaaaababbabbbbbabbbbbabbbabbabbbaaababbbabaaaaababbbabbaaaababaaaababaaabbbaaaabbaaabaabaaabaabaaabbbabbaaaabbbabbabaabaaabaababbaaabbbbabababbababbbabbabbbbbbbbabbbababbabbbbbaaaababbbbbaabbbaabaababbaaaabaababaabaabababaabbaaabbbaabbbbabbaababbabbaaabbbaababbbabbaaabbaaaababbbabbbbabaabbbaababbbaaabaaaababbbbbaabbbbabbababaaaabbbbabaabaabbaababbabaabbbbbbabbabbbbbbaabaaaabbbbbabaaabaaaaaabbababbbbbabaabbaaabaaababbabbaababaabbbbabababbbabbabaaabaabbbababbbabaaabaaabaaaaabbabbabbaaaababbaaaaababbaaaababaaabbaabaaabbaabbaabbabbbabaabaabbaaaaaabbaaaaaaabbbbabaaabababaabbbaabbabaaaabbaaabbbbababbaababaabbabbabbbbabbabbabaaabbaabaababbbabaaaabbababbabbabbbabbaaaabbbbbbabababbaaaabbaaaabaaaabababbababbaaabbabababbbbbbabbbabbababbbbbaabbbbbabbbaaabbbbaabaaabaabbbabaabbaabbbbbbbababaabbbbabbbbbbbaabbbaabaabbaaaaaabaaaabaabbaabaaaaaaabaaabbabaaabbabbbbbababbaabaabbababbbaaabbababaaabbaaabbbaabbaabbbbbaabaaabaaabaaabbbaababbaaaabaababbbbbbbabaaaabbaabaabbbabaababbabbabaaabbbabbaabbbabbbbaababbaabaaabbaabbabaaaabaabaababbbaaabaabaaabaabbababbbbabbbababbabaabbbabaababbaabaababbbabaabbbbbabbbaabbabbbaaababaaababbbbbbbaaabababaaaabbaaaaaaabbabbbaabbbbbaaababbbbabaaabbbababababbaabaababbbababbabaaabbbaabaaaaaabbbbabbaabbababbbaaaabbbbabbaabbaaaabaabbbbababbaabbbaababbaabbbabbbbaaaababbbbaabbaaabbbbabbbbaababaaaabbbbaaabaabababbbabbabaaaaaaaabbbbbaaaabbbbbaabbabbbbabbbaaaabababbabbbaababbbaaaaaabbaabaabbaaabbbbaaabaabaaaaaabbabbbaabbbbbaaaaaaabbbbaaabaaabaaabaabbbababaababbbbbaaabaaaabbbaabaaaabaaabaabbaaabbaaaabbabbbababbabbbaaaaaaaaaababbaabbaaaaaabaaababaabbbaaaabbaaabbbababaaaaabbbabaabbabbbaaabababaabbaaaabbabaabbbabaabaababbaabaaaaaabbaaababbabbbaababbbabbbabaaaaabbaaaaaaababbabaaaabaaaaaabaabbbbbaabaababaaaaaaababbbbbabbbaabbabbabbbbbaaabbabbababaaababbabababbbbbbbbbabbbbbbabbbabbaabbbaaaabaaabbbbaaaaaaaabbabbbbbbbbbbaabbaabbbabaabaaaabaaabbaabbabbbaaabaabbbbbaabbaabaabaaababbbbabababbaaababbabbaababbbbaaababaaaaabbbbbabaaaaaabaabababbbabaabbbbabaababbbababbbbbaabbabbaabbabaaabbbbbbbabaaabaabbabbabbaabaaaaaaabaaabbaaabbabaababbabbbbbbabaabaaabbabbaaaaaaabbbabaaaababbbababbbaaaabaaaabaabaaabaaaabaabbaaabbbaabaaabaabaaaabbaabaabbaabbabaabbabbabbaabbbbbbaabbaaabbaaaabaabbbabaaabbbabaabaaaabbbbaaaaabababbbabbbabbaababbbbbabaabbbabbbaaaaabbbabbabbbbaababbbbaabbbbaaaaabaaaaababbabaababababbbbabbbabbaaaaaababbaabbbbaabaabbbababaaaabaabbbaaabaaaababaaababbbaabbbbaabaababbaaabbabababbbbaababaaabababbaabbbaabbabaabaaaaababbbbabbabaabbbaaabaabaabaaabbabaabaabbabaababaaaabaabbaabaabbbabbababbaaabbabaabaaabbbbbbbbaabbaabababbbbbbabbaabaaabbaabaaabbbaaaababaaaaabaabbabaaabbbbbaaaaaabbaabbaaabbaaaabbbbabbaaaababaabbbaabbbbaaababaaabbabbabaaabbbbabbababaaabaabbbabaababaabaabbabbbbaabbabbaabaaaaaabaaabaabaabbabbbaabaabbbaaababaabbabbaaaabbbbbbbaabababaaaabbbbbabbbbbababbbaaaabaabbaaababaabbabaababbbbabbaabbbabbabbbbabababbabababaaaaabbbabaabbbbababbbbbaaabaaabbabbabaabaabbbaaababaababaaababaaabababababbbbbaaaaaabbabaaaaabaabbbbbaababbabbabbabbbbabaabababbaaabaababbbaabababaabbabbababaababbbbaabbbbababbaabbbaabbbabbbaabbbaabaabbaabbbaaababbbbabbbbbabbabbbbaaabbbbbbbababbbabaaabbbabbbaabbbbaaabaaabbabbaaaabbabbababbaababbaaaabaabbabbbbbbaaaaaabbbabbbaabbbbbaaabbbaabaaaabbbabbabbbabbbbbaaaabbbaabbabababaaaabbabbaaaabbababbabbbaaabababbababbaabbabaaaabaabbabbaababbbbbaaaabababbbbaaaabbbabbaaaaaabababbabbabbbaaaabaaaababbbababbbbaaaaababbababaaababaabbbbbabaaabbaabababaaabbaaabbbaabaabaabaaaaabaabaabbababbbbabbaaabbababaabaabaababbababbbbbbbbaaabbabaabababbbaaabbababbaaaaaabaaabbaabbabaaabbaaabbbbababaaaabbabbaabbbbaabaaaabbbaabababbbaabbabbabbbababbbababaabababbbbabbabaabaabaaaaabbabbbbbaaabbabbbbaabaaaabbbaaaabaabbaaaabbbaaaabbbbabbbbabaabbaaababababbbabbbabbaababaaaaabaaaabbbbaaaabbbababbbababaaabbbaabaabbbbbbbbaaababaababbbabbaabbbababbbaabababaaabbabbbabbabbabbaabbaaababbaababbaabaababaaaaabbbaaaabaabababbbaaaaabaaabbabaaabbbababbaababbabbabbbbbabaaaaaaababaabaaaabbbbabbabaaabbbaaaabbaabaaaaabbbbaabbbbbbbbbbaaaabbbaaaaaaabbaabbabbaababbbbbbaabbaaaabaabaaabaaaaaabababbaabaabaaababaaabababbbabaabbabaabbbaaabbbaabbbabbbabbaaabbbaababbbbbbbabbaabbbaaaaabbaaaabbbbaabaaaabbbbbabbaaaabaaaaaabbbbbabbabababaababbabbbbbbbaabbaaabbaaaaabaaaaaaaabbaaaabbbbbbaabababbaabbbabaababaabbabbaababaaaabbbabbabbabababbbaaaababaaababbaabaabbbbbbabbbaabaabababbaaabaabbaabbabbaaabaabbbbaaaaabbbaaaabbbbabbaabaaaabaaabbbbbaaaaaabaaaabbbabbaaabaaaabbabaaaababbaabaabbabbbbabaaabbabbababaabbaaabbbaaabaaabbabbabaabaabaaaabbabaabbbbabbaaabaabbbaaabbbbabbaaabaaaaaabaaaaaaabababaaaaaabbbbbaaaabaaabbbbaababbabbbbaaababaaabbaabbabaabbbaaabbaaaaaaabaabababbbaabaaabbbbbbaaabbaabbbaabaabababbaaaabbababbbbaaaabbababbaababaaabbbaabaaaaaabbbaaabaabbbbabaababaaaaabbaaaaabbbbabbababbabbbbbbabbabbabaababaaabbbaaabbbabbbaaabbbaaaabbaabbbbaaabaabbaaabbbbaabbabbaaaabbaaaababaababbbbabbbbbababaabbaaababbabbbabaaaaabaabaaabaababbaaabbaaaaabbaaabbbababaabbabaababaabaaabaabbaababbbbbaabaaabaabbbbaaaaabbbbbabaababaabbaaabbaabababbbabbbbbabababbabaaaaabaabbbababbbabaababbbabbaaabaaaabababbaababaabbbbbaababbaabaaabbbabaabbabaaaabbabbbbbabbbababaaabbaabaaabbabababbbbaaababaababaaabbbbaaaabbabbbbaabbbabbabbabababbababbbaaabbbaabaabbababbaababbbbabbbbbaabbbabbbaaaabbaabaabaabbbaabbbabbbabbaaabbbbabbbabaabaababaababbaabbaababbabbabbaabaaabaaaababaababbbbaabbabababbabbbbbbaababbbbbbbbbabaababbbbababaaabbaabaaababbabbbaababbaabbbbabbbbbaaaabbbabaaabbbbbababababbbbbbaabaaaaaabbaaaaaaababbabbaabaabaaabaabbbbbbbbbbbbabaabbaabbbbaaaaabbaaaaababbaabbbbbbabaabaabbbabaabaababaabbbaaaaabbabababbbbbaaabbbbaababbaabaaabababaaabbaaabbbaaabbbabaaabbbbbbbbbbababaaabbbabbaaabaaababbbbabbaabbaaababbbbabbabababaaabbaaaaaaabbabbaaaabaababaaabbaabbbbaaabbaaababbbaabababaabbbbababbaaabbabbbabbabbaaaaabbabbaaaaaabababababaabbaabbabbaabaabababbaabaabbaaabaabbaaabababbbaabbaaaabbabbbbabbbbbbbbbaaaabbbaaabaabaabaaaaabbbaaabbababbaaabbaaaabbabaabababababbababaaabbbbbbbbbaaabaabbbbabbbaaabaaaaaaaabbaaaababbabbbbbaaabbbbbbbbbbbbbabaabaaabbbaaabaabababaabbababbababbbabbbabaaabbabbaabbbbaaabaabbbabbabbbbabbababbbaabbaabbabbabbababbbbbbabbbbbbabbabbbaaababbbaaaabaabbbbbbabbbbaabababbbbbbbbaababababaabbaaaaababaaababaabbabbbababaaabbbaabaaaabbabaabbaaababbabbbbaaabbbbbabaaaaabbbbaaaaaaabaaabbbbbbababababababbaabaaabaaabbbbabbbbaaabbbabbbabaaabbbbbabaaababbaabbbaabaaababbaabbaabbaabbabaabbbaaaababbbabbaabaaabbabbabbbababbbbaabbaabbbbbaababbaaabaaabbabbaabbbbbabaabaabbaaabbaabbbbabaabbbabbabbbabbaaaaababaababbaabaabbbbbabbababbabaaaaaabaabbabababbabbabbabaaaababbabbbaababaaaaabbbbbbaabaaaaabaaaabbbabababbaaabbbabaabaabbbaaaaaaaabbbbbbbbabbbabbbabbaabbabbaaabbbababaaaaaaaaabbbbaaabaaababbbbabaabaaabaaaabbaaaababbbbbbbaaabaaaabbaaabbaaaaabbaaabaaabbbbabbaababaabaaabbbabbbaabbbabbababaaabababbbbababaaabaabbabbbaababbaaababababaaaaaabaaaaaabbbaabbaabbbababbaaaaabbbabbabaabaaabababbbbabbbbabbaabbbaaaabaaabaabbaaabbabbbaaaaababbabbaabaababaabaababbbabaaaaaabbbabbababaabbbbabbbbbbaaabbbabbbaaaabababbaaabbabaaaabbaaaaabaaaabbbabbabaaaababaaabaabbbbbaabaaaaaaaaaaaaaabbbbabbaabbbbabbbaabbabbaababaabaababababababaaabbbbabaabbaaabaababababbbabbaaabaabbaaabababbabbbbbaabbbaabababaabaabbbbbbabbabbabbabaababaababaaabbabbaaabbabbabbababababababaababbbbababaaaabbbaabbaaabbabaabbaabaabbabbabbbbbbbbabbbbbabababababaababbaaaabbabbbabbababaababbaabbbababaaaabbaaabbababbaababbbababaaabaaaabababaaaaaabbbbbabbabbaaabbbbbbbbabbaabbabbaababbbbaababbaabbababbbaababaabaababbbabbabaabababaabaaaaababbbabbbababbbaabbabbbbaaaabbbaaabbbabaabababbabbbbbaabbaabbaaabaaaaaaabbaabaaaaaaabbbbababbababbbabbbbaabbbabaaaabbbabbbaababababbabaabbbaaaaaaaabbbbbbabaabaaaabbabaaaaababbaaabbabaabbabbaaaaaaaabbabbabaaaabaaabaababababbaababaaabaababababababbbbababbabbaababbbabbbbbbbaaaaaaaabbbbbbabaabbabbabbbaaaabbbbbaaaababbbaabbabbbaabbbabaabbabbbababbaabaaabbbbbbaababbaabbaabaabaaaaababaabbabaaaabbabaababbababaababaabbbabbbabbabbbbbaabbbababababaaaabbabaaaaaaabbbabababbaababaaabbbaaaaababbaaaababbbaaabababaaabaabbbbbbaaaabaaabbbbbbbbbababaabaabbbabaaaabbbbbbabaabbbaaaababbaabaababbbaabbaaaabbbaabbbbabbabbbaabbababbaaababaaabbaaababababbabbbbbbbbabaabbbbabaabbaabbaaaabbbabaabbbbaabbababbbbbabbabaaaaaabbbbbaaabbabaababbaabababbaaaaaaaabababbbbbbbababbabaaaabaababaabaabbbbaaabbbababaabaabbaaabbabbbbababaaababbbbaababbbbabbbabaababaababaabbabbabababbbabbbabbbaabaabbbabbbbbbbaabbbbbaaabaababaabaaabaaabaaaabaaaaabbaaaaaaababbbbababbaabbbbabababbaaaaaabaaaabbbbaaaabaaaabbabaaabbaaaababaaabbbbabababaabbaaabbabbaaabbaabbbbaaababbabbbbbbabbbbaabaabaaabbabbaaaaabbabaabbbbbbaaabbababbaaaabbaaabaabbababbbbaaababbbbababaaaabbabbaabaababbaaaabbbbababaaaaaabbaaaabaaaabbabbaaababaabbabbaaabbbbbbbbbaaabbaababbaababbaababaaabbbabbbaababababbabaabbababaaabbbbaabbabbbaaabbbababaaaabbabbbaababaabbbbbababbbbaabaaabababaabbbaaabbababbaaaabbaabbbabbaabbbbbaabaaaabaaababbabbbbaabaabaabaabbaabaaaaabbbabbbbaaaabbaabbbbaaaaabbbbaabbabbbabbbbabbabababbaaabbbaaaababbaababbbaabaaaabbabbabaaaaaaabaaababaabbaabaaaaaababbbbbbaabbaaabbbbaabbabaaabbbbababaaaaaabbbbbaabaaabaaaababbbbbbbabbbaaabbabababaabbaabbbbaaaabaaaababbbabbbbabaababaaabbbaababbaaabaabbbaabaaaabbbabaabaababbaabbbaaabaaaaaaaabbbaabaabbbabbbbbbbaaaababbbabbaababbbaabbbabaabaaabbaaaaaaababbaaaabaababbbabbaabbbbaaabaaabaaabababbaababaabbaaabbababbabbbabaabbaabaaaaaabbabbbbbbaabbbbabbabbabaabaaabaaabbabbbaaabbbabaaaabaaabaabbaaaababbaababbaaabaaaabbababaaaaaaaabaabbbbbbabbaabaaabbaaabbbabbabbbbababaaabaaabbbabbaabbbabaaaabbaabaabaaaababaaabaaabbaababbabaababaabbbbaabbbbabaabababbbbbaabbbaababbabbbabbbaabbbabbabaaabbbaabaaababbbbaaaaabaabaaababbbbbabaabaaaabbaaaaabbabbaabbaaaaabbbabaaabaaababbaabaabbabbbbaaabbaabbbabbbbabaabbaaabbabaaabaababbabbaabbbbaabbbbabbbaababbbbaabbbbbbbbbbbaaaabababbaabbbababaaabaaababbaababaabaaaaaaabababaabbbabbabbbbabaabbaaaabaabbababbbbbabbbaabaabbbbabaaabaaaaaabbbabbbaabbaaaaababaaabababbabbaaabbbaabbbabbaabaababaabbbbbababbbbbaaabaabaaaabbabaabaabbbbaabbaaabbaababbababaabababaabbbbbbabaabaababbaaabbbbababaabaaabbabaabaaaaaaaaabaabbaabbaaabbabbbbaabbbabbaababaabbaaabaabaababaabababbbbabbbabbbbabaaabababbababaaaaaababbbaabbbabaaabababbbbbabaaababaaaabaaaabbabbaaaababbbaabaabbaaabbbbbabaabababbaabbbbbaabbbbabaabbaaabaababbabababaaabbbbbaaaaaaaabbaaaabaaaabbbbaaabbabaabaabbaaabbaaaabaabaaababaaababaaaabbaabababbabbababbaabaabbabbaababbabbbaababaaaaababaaabaabaabbbabbaaaabbaabbababbaaaabaababbbbaababbbbbabaaaabaabaaabbaaabababbabbaaaaabbaabaaabbaaaaababbaaaababbaabaaaaaaabababbbbaaaaabaabbabaaaabaaaaabbbbabaabbaabbaabababbaaabaaababbabbbaabbbbabbabaabaaaaaabbbabaabbbbbaaaaaababbaabbaaaaabaaaabbaabaaabaabaabaababaaaaaababaaabbbbbbbaabaabbaababbabbaabbbaaabbabbbabbaaaaabbbaaabaabaabbbbabbaabaaaaaaabbaabbbbbabbbabaabbbaabbabbbbbbaabbbaaabbbabbbababaaabaababababbaaaababbbaaaaaaabbbabbaaabbabbabbbbaabbabbababbbaaaaaabbbbbbabbaabaabaaaaabaabaabbbbbbabaababbbbaabbabbbbaabaaababbbabaabbbababbbbaabbaaaaaabbbabbaabbbababbbbbaabaabbaaaabbabaaaaaaaabbbbabbbbbbbbbbaaaababbbbbaaaabbbaaababaababaabbababaaaabbaababbbbaababbbaaaaabbbbbaabbbabaabaaabbabbbaabbabbaaaaabbaaaaaabaababbbaabaaaaabbbabaababbaababbbabbaaabbbbabaabaabbaaabababbbbabbbbabaaabbaabbbabbabbabababaabaaaaabbabbabababaaaabbbabbaaabbbababaaaaaaaabaabababbababbbaaaabbabaaaaabbbbaabbaaaabaabbaababaabaaabbaaabbababaababbaaaaaaababaaaabaabbbbababbaaaaaaabaabaaaaaabbaaabbbaabaaaaaabbababaababbbbaabaabbbabbababbbaabbabbabbabbabbbaaabaabaababbbaabbbaababbaaabaabbabbbbaaaabbbabbbaababaababbbbbbabbabbababababbabbbababaababbbabaabababbabbbbbabbababbbbabaabaaabbaababbbaabbaaabaabbbbbaabbaabbbbabbabababbababaabaaaaababbbaaabbabbabbbabbabbaabaaabbaabbaababbbababaaabababaabaaaababbabbabbaaabaababbabaabbababbbaabaababbabaabaaabbbbabbabaaaabbbaabaabbbbabaababbaaabbbaaabbabbbbaabaaaaabababbbabbababbbababbabaaabbaabaabbbaaaaaababbaabbaabbabaabbabaaabaaabbabbbabbbaabbaabbbbaaabbbabaababbbbbbaaababaabbabbababbbbabbababbbbbbabaabbaaaaababbabaaaaabbaaaabaaabbbababaababbbbaaaabbabbaabbaabbaabbbaaababbbbbbaababaaabbaaaabbaabaaabaaababbbaabbbaaabbabaababaabbabbababaababaababaaaaaabbaaaababbbbbbabbaabaabbbabbabbabbbaaaababbaabbabaaaaabbbbabbbaaabababababbaaaabbabaabbabbbaaabbbbababbaaaabbabbbbbbbaaaabaaabababaaababaabbababaaabbbaaaaaaaaabbbabaabbaaaaaaaaabbbabaababaabababbbbabaababbabbbaaabbbbaaabaabaababaaaaabbbbbbbabaaabbaabbbbbabbaabbaabbaabbabaaaaaabbbbbbaababaabbabaabaababbaaababbaabababbbbabaaaabbbbaabbbabaaabaaababbaabbbaabbaabbaabbabbbababbabaaababaaabaaababaaaabbbbaabaaababaabbbaaabababbabbabbbbaabbaaabbbbababaabbaaaababbbbbabbabbbbbabbbbabaababbaaabbabaaabbabaabbbbaabbabbbbbabababababbaaaabbaabbbaabbabaabbabaaabbbabbababaabaababbabbaabaaabbaaaaaabaaabbbbbaaababbbabbaabbbbababbbaabbbaaaaaabbbbaabbababbbababbbabbbbaabbbbbbaabbbbababbaabaabbaaaaaabbbaabaaabbbbbbbbaabbbbaaabbbabaababbaabaababbbaaabababbaaaaaabbabbaaaabbbabaabaaabaabbaabbababbbbbbbaabbaaababaaaabbabbbbbbaaababaaabaabababaabbaaabbbaabbaababbabbabbbabbaabaabbbbbaaababbaaabbbaabababbabababaaabaaabaaaaabaabbaaabbabaabbbbaabbbabaaaaabaaabaaabaabbabbabaabbbabaabbaaaabbbbbaababbbbabbabbbbbaababbabababababbabababaabbaaaaabbabaaaababbbaaababababbbbbaabbbbaaaaabbbbabbbbbababaabbbabbbbabaaababbbbbabababbaaabaabbaaaaaaabbbbbbbabbbbababababbbbabbaababbabaaababbbababaaaabbbbbaabbaabbabaaabbbabbbabbaaabababaabaaabbabaaaaaaaabbabbababaaabbbaaaabbbbababbaaaababbbbababbbababbbababaababbaababaaababbabbbaaabaabaaabbabbbbbbbabbaabbbbabbaabbabaababaaaabbbabaaaababbbbbabbaaaabaabaaababaabaaabbaaaabbaabbaaaababababaabaabbaaaaababbabaabbbbaabaaabbabaabbbbbbbababbaaabbaaaaaabbbbbabbabbbaabbabaabbbabbabaaaaabbbbbbbabaaabaaababbaabbbbbaaabbaaaaaabbaabbabaaaabbabbbababababbaaaabababbaaababbaabbaabbabababbababbbbaababbbaababbababbabaaabbbbaaababbaabbbbbbbaababbbbabbbbabbabaababbbbaaaaaabbabbbbabaaaabbaababbaaaababbaaaabbbbbaaaababbaabababbabaaabaaabbbaaababbbabaaaaabaabbbbaaaaaabbbaaababaaaabbaaabbababaabababbababbabbaababbabaabbabbabbababbaaabbaabbbbbaabbabbabbabaabbbbbbbabaabaaababaaaaaabaababbaabbbbaaaaaabbbbbaaababaaaaabbbbbaabaabaaaaaaabbababbbabbbabbbabaabbbbabbbbbbbbaaaaababaaaabbbaaabaaabaaabbaaabbbbabbbbbbbaabbabbbbaababbaaaaabaaaaaaaababbbbababbbabbabaabbbbabbbabaabaaaaabbabababbaaaabbbaaaaaaaaaabaaabaabaaaabbbbbabaabbbaabbbaabbbbbbbaaaabbaaaaabbbbabbaababaaabbbaaaaababbbaabaabaaaaaaababaababababbabbababbbbabababaabaababbaabbaaababbbbbabaaabbbabbbabbaaaaaabaabbaaaaabaabbbbbbabaaaaabbbbaabbbaabbababaaaaabbaababbbbbbbbbabbabbabaabbababbababbaabbaabbaaaabaabbabaabaabbbbabbbbbbaabaabbbababaaabbabbbaababaaaabaaaaaaabababbbaabaaabaaaaaaababaaaaaabbaaabbabababbabaababaaaababaaabbbbaaabbbaaabaabababbaaabbaaaabbbbbbaaabbaaaababbabbbbaabbbbabbbbabbabbabaabaaabbabbbbbaaaababababbbaaabbbaaabbbbaaaabbbabbbaabaaaabbbbaaabaabbababbbabbabbbabbbbaaaaaabbaabbabbbbbaaabaababaabbbaaaaabaabaabaaaaaabbbbabbabaabbabbbaabababaaababbaaaabbaaaaabababbbbbbaaaabababbbababbabaabbbabbaabaaaaaabbabbbaaababbbbbbaabbbaabaabbaaaababbabbabbbabbbbaababababababababbbaaaaabababbbaabaaababbbabbaaaabaabbbbaaababbaabbaaabbbbabbaababbbbaaaabbbbabaabaabbaabbbbaaaababaaaaabbbbbababbbaabaabbbbaababbaaabbbaababbbbaaaabbbababbaabbbbbbabbbbaaabaabbbbabbbaabbbaaababbbabbabbbbbbbaabaaabbbabaabbbbbaaaaabaababaaabbaaaabbaaaaaabaaabaabbabbaabbaaaababbbabbbababbabbabbaabbbabaaaabbaabbbaabbabbaaaabbbaababbabbbbaabbbababbbbbbbaabaaabbbababbbabaaabbbbbbbbababbbbbbababbbbbbabbbbbaababbbbbbbabbabbaaababbbababbabbabaaabbbaabaababaabbababbbabbaaabbaabbabbabbbaaababbaabbaabbbbbababbaabbaaabaababaaabbbabaababbbbbbbbbbabaabbbbaababababbbaabbbabaabaabbaaaabaaaaaabbabbbabaabaaababbaababbbbbbbbbabbbabaaaaabababbbaaabaaabaabbaaaaababaaaababbaaaaaaaababbbbabbabaabaaaabbaaaaaababaabbbaaabbababbbbaababababababaababaabbbabbabaaabaaabbbbbbaaabaaabbbbbbaababaabbaaababbaaaababbaaabbbaaaaaabababbabaaabaaabbbbabaaaaaaaaabbaaaabbabbabaababaaaaababbbbaaaaaaaaaabbabbaaaabbbaaaaaabbabbbbaaaaaabbaabbbabbababbbaaaaaaaaabaaabababbabaabbaaaabababbbbbbbaaaabbabaaababbbbabaaaaaabbababbbababbbbbababbbaaababaabbbbaaabbbabaababbabbaaabbbbbbaabbbababbbabaababbbbaababbaaaaaaabaaabbbaabbaabbabbabbababbbbaaaababbbababababbaabbaabababaaabaabbbaaaabababababaaaabaaabbaaababbababbbbbabbbabaabbababaaaabaaaaaabaabbababababbabbabbababaabbbabababaabbbabaaabbbabaababaaaaaabbaaabaababbaaabbaababbbaabbbabbbbaaababaaabbbbbaabbaaaaaaabbabbabbababaababaaababbababbbbabaabaabaaaababaaaaabaaabbabbbaaababbbabbabababaaabbbabaaabaabaaababbbabaaabbaabaaaabaabaabbababbaaabaabaabaaababaaabbabbaaababaaabbabbaaabbabbabaaabaabbbbbbabbaaabaabaaabbbbababababbbabbaabaabbaaabaabababbbaaabbabaabaaaababbbaaabbabbbbaabbabbaabbabbbaabbaaabbbaabbbbaaabaabbabaaaababababbabababbbabaaaaabbbbbabaaaaabbbbbbabbbababbaaabbbaabbaaaaabaaaabbaabbabbbbabbaaabaaababaababaababbbababaabbbabbabbbaaabbbabbbaabaaabbaabbbaabbabbbabaabaaaaaaaabbbaabbbabbbabbbbababbbaabbbbabbbbbababaabbabbaabaabbababbbaabbabbbbaabbbabbabaaaababaaabaabababbaabbbaabaaababbaababababbabbaaaaaaaaaabaabbbabbabbaaaababbbababbabbbbbbabaaabbbababaabbbabbabaaaabababbbaaabaaaaabbaabbaabbaabbaabbabbbbbaabaabbabbaabaabaababaabaaabbabbaabbbbbaabbbbbbaabbbbaababbaabbbaaaabaabaabbbabaaababaaaaaabbaaababbaaababaaabbbaaaaaaaababbabbaaaababbbaaaaaababaabbaaabbbabbababbababaaaaabbbabababbaaaaaabbbabbbbabbbbbbbaabbbbbbbbaabbaaaabaabaabbaaabbabbaabbababaaaaaaabbaabbaabbabaabbbbaaaaaabbbbabbabbbbabbaabaaaabaaaababbaaaababaaabbabababaabaabbaaababbbbbaabbaaabbbbbbbbbababababaaaabababbbaaaabaabaaabbbaabababaaaabaabbbbbbaaaabababbaababbabaaabaabaababaababaaaabababbabbabbbababbbaabbaabbaabbabbbbbbaabaabaaaaaabaabbabababaaaabbbbbaaaaaaaabbaababaabaaabaabaaaababaabbbabaabbabbbabbbabbaaabbaababbaabbaabaabbababaabbbababbabbabbabbaababaaaabbbbbabaaaaaaaaaaabaabaabbabaababaaaaaaaabaaaabbbbbbbabababbbbaaabaaabbbbbbbbbaaaabbbaababababbbabbbabbababaabaabbbbabbbababababbbabaaabababbbaaabaabbbaababbaaabbbbababbabbbabbbaabbabbabaaaabaaabbaaabbabbabbbbaaaabbabbbbabbabbbbababbaaabbbbabbbbbaaaabbabbbaabbbababababaabbbabbbaaabaaaaaaabbaaaabababababbbbabbbaabaabbbbabbbbbabababbabbabbbbbbbbbbaaababbbabbbbbabbaaababaaabababaaaaaabbbbaabbbabbabbaababbaaaabababbbbaababababaabbbaabaabaaababbabbaabaabaabaaaaaabaababaaabaaaababaababaaabbaaabababbbaaaaaaaaabbaabaabbaaaababbabbbabbbabababbaabbabababababbbabbaaaabbaaabaabbbbaabbaaabbaaabbaaaabaabaaabaabbabbbbbbaaaaabbbbaaaabaaabbababaabbaabbaababbabaaabaaaabbbbaaaabbabbbbaabbbbababbbbbaabaaaaaaababbaabbabbaabaaababbbaaaabbaaabaabbbaababbaababbbbaabababaaababbaabaaaababbbbbbbabaabbbbaabbbbabbbabbaabbabaaababbaabbaabbabbaaaaabbbabaaababbaaaaabaabbabbbbbabbbbabbbabbabbbabaabbaaabaaabbabaaabbbababbbbaababbbbbbaabbbbbbbabaabbabbbaabaaabaaaaaabbbbbaabbaaabbaaabaaababbbaaaabbabaabaabbababbabbbbbaabaababaaaabaaababbbbbbabbabbbaaaaabbabbbabbbbbbbbabaaaabbbaaaaaababbbaababbbbabaabaaabbaaabbabbaabbaaaaabaabaabbbbbbbabbbabbaababbbbaaababbbbaabaaababbaabaababbababaabaabaaabbbaaaabaabbabaabbbaaabaabbaabababaabaabaabbbababbabbbbababbbaabbbaabbbaaababbabbbaabaabbaabababaabbbbaabbbaaaaabbbbbaaababbabaaaabaabaaaabbaaababbababbaabbabbabbaaabaabbaabababbbaaaaaaaabaabaaaaaabaababbbbbbbabbbabbaaaabaaaabbabaabaaaabbababaababbbaabbabaabbababbbbbbbbabbbbbbbababaabaaababbbabbabbbabbbbabaabbaaabbaaabbabaabaaaaabbaabbbbbbbabbbabbabaaababbabaaaaabaaaaaababaaaaaaaabbaabbabbaabaaabbbbabbababbbbbaabbababaabaabbbabaababababaaabbaaababbaaaabaaaaabbbabbbbaaaabbababbaaaaabaabbbbabbabbababaaabaaaabbbbbaabaaaababaaaaaaaabaabbaaaababaaaabbaaaaaababbbbbbaaaabbabbaabaabbabbaaaaababbbabbabaaabaaaaabbabbabaaabbabbbabbaaaabbaaabbbbbabaabbaaaaaabaaabaabbbabbaabbbabbaaaabbaababbbbbbabbabbaabbbbbaaaaaaabbaaaaabababbbabbbbaabaabbaaabababbbaaaabbbaaaabaaaabaaaaababaabbabbaabaababababbbaabababbababbaabababaababbabbabbabbbaaaabaababbbbaabbaaaabaabbaabbbbabbaabaaaababbbbaaababbbbaaaabbaabbaababababbababababbbaaaaabaabababbbbbbbabbbaaabbaaaabaabbbaaabaaaaabaabbaaababaaaaaabbabbbabbabbbaabaabbaabbbaaabaaaabbbbababaabbbbaabaaaaaabbbbaaaaabaaaabaabbaaababbbbbbabbbabbaabbbbabbbaaababababbbaaabaaaabbbbaabbbbbbaabbbabbbbbababbbbabbbaaabababaaababbbaaabbbabbaaababaaaaabaababaabbbbbbbaababbbabaaabbaabbbbabaaabaababbbbaaaaabaaabaabbababbabaabbbaabbbabbaaabbbabbbbbabbaaabaaabaabbbaaabbbabbbaaabaabbbbaabaabababbbabbbabababbababbbaaabaabaaaabbaabaaaaababaaaababaabbabbbaababababaaabaabaaaabaaabbabaabaaabbaaaaabbbbabbbabbaaaabbabbbabbbaabbbbbbaaaaaabbaaaabaaabababbaaaabaabbababaaaaabbbaaaaabbaabbbbaabaabaabaabbaaaababbaaabbaaaabbbbbababbaaabbababaabbabaaaaababbbbaabababaabababbbabbabbbaabaabaabbaaabbabababbaaaabbabaabbbaabbbbbaaababbbaabbaaabaababbbbbbabbabbbaabbbabaaabaabbaabaabbbaabaababaabbbaaaabbaaabbababbbabaabbaabbaabaabbbababaaaabbbbaaaaaaabaabababaababbbbabbababbbbabababaabababbaabbbbbaaaaabbaaabababbaabbbbaaababaaaabbbbabbababbabbbababbbbbbaaaaabbaabaaaaaabbbaaaaaaabaaabaabbaabbbbbaaabbbababbaabaababaabbabbbaabbabbabaabbbaababbbbaaaabbbabbbbababbbbabbabbbbaaaaaaaaabaaabbbaaaaabbbaabaabbaaabaababaabababaabababbbbbbaabaaaabbaabbbabbaababbabbbbaababbbaabababbbabaaaaaababbbabaaaababbbaabbabaababaaaabbbababbaaaaababaabaaabbbbbabbaababbbbbabaabbbbaaaaaabbababbbbbbabbabaaaabbaabbaaaaabaaabaaabbbbbaabbababbabbbabbabbbabbbaaababaaabaaaabaabaabbbaabaaabbaabbbbaabbbbaabbbaaaabaabbbaababababaaabababbbaabaaabbaaaaababbbabbbbaabababbabbbbaabbaabaabbababbaaaabbabbaabbbbbaaabbaabaabbaaabababbbbbbaababbbbaaaabbbaaaabaaabaabaababbaabbaaaababaaaaabaaaabababaaaabbbabaabbbababbbbbabbabbbbabbabbabaaabbbbbbaabbaaaaabbabbbbabbbaabaababaababaabbaabbaaaababaaaababbbabbababaabbabaabaabbbabbaaabbabbbbbbbaabaaaabbbbabbbabbbbaaaaababaaaaaabbababbbaaabbababaabbbabaababaabaabbabaaaaaabbaababaaababababbbbbaaabbbbbaabbbbbbabbaaaabbabbababaabbbbbaabaabaaaaaabbaabaaaaaaabbbaaabbabaaabbbabbbaabbaabbaaabaabbbabbbabaaababaabaaaaababaabbbbaabaabbaabaabbabaaabbababababbabaaaababbaaabbabbaabbaaabaaaaabaaabaaaabaaaabaabbaabaaabbaaabbbaababaaaabbaabbaaababbbaaabaabaabaabbababbaaaaababaaaababaabababbaababbbaaaaaaaaaaababbaabbbabaabaaaaaabaaaabababbbababbaaabbbbaaababbbbaaabbabbaaabbabbabaaabababbaabbabbbaaabbbbbaabbbbbbabaaabbaaababbaabbbabbaabbbbbaabbbbaabbbabbabbabbabaabaabbaababbabbaabbbbaabbbabaababaabaababaaababbbbababbabaaabbbbbbbabaabbbbbabaaaaaaaaaaabaaaabbbaabbabaabaabbbaaababaaaaabaabaabbbabbabbabbaabaaababbbabaabababababbabbbababaaaabbbbbabbbbbaaabbbbbbbabbabbaabbababbbaabaababaaabaaaabbbabababababababbaababababbbbaaabbbaaabbbbabbabbaaaaabaabaabbaabaaabaabbbbaabaaaabaabbaabbbbbaaaabbbbabaaaabbabaaabbaaababbbbbaabbaabbabbabbabaaaabaaaaabbbaababbaaababaaabaababaabbbabababababbbabababaaaabaaababbbbabababababaabbabbabbaabbbaabbbbbbbaaabaaabbbabbbaaaaababbabababaabbaababababaaaabbabbaaabbabaaabbbababbbbbbababbbbabababbababbbbaabbaabaabaabababbbbbbaaabbaaababababbaaaaaaaabbbaabaaaabbbabbaaaabbbabbbabbabbabbabbaabbbbbbbaaaaababbaabaaaaabaabaabbbbaaaaabaaaabaabbbbbbaabaaaababbabaaaabbabbababaaaaaabbabaabbbbabbaaaaabbaabbaabaaabaabaabbbbaaabbaababaaaaaaabaaabbbbbabaababbabaabaababaaaaaabbbaabbaabbabbaabbbaababaabaaaaaabbaabbababbabbbabbbabbbbabbabababaaababbaaaaababaabbaabaabbbbaaaaabaabaabbbaaaabbbbaaababaabaababbabbbbbaaaaabbabaabaabaaabbbaababbabaabaaaababbababbbababbbbabbbbbabbbabbbbbbbbbababbbaaaaaabaaababaaaaaaabaaabbbabbbababbabbbabbaaaaaaababbaaabbabbaabbbbbbababaabbbabbbbbababaaaaaaabbabbbbabaaabaaababbbbaaaaabaabbbaabaabbbaabaababaabaabaaabbabbababaabbbbaaaababbabbabbbbaaababbbaaaabbbababbbabbabaabaaabbabbbabbaaaabbaaabbbbabaababbaaabbbaaabaaabbababaaabaabaaabaabaaaaaababaaabbbaabbbbabaabaaababbaababbbaaabaabaaaabbaaabbbbbaaaaaabaaaabaababbbbaaaaababaaaaabaabbaaaabaababbaabbaabbbabababbaaaaaaabaabbaabaabaaabaabaaabaababbabbaabbaabaaaabaaababbabbabaabababbababaaabbaaaaaabbbabaaaabaabaaaabbabbaaaaaaabbbbbbabaaabababababbbabababaabaabaaaababaaaaaaababaaababbbbbbbabbbaaabaaabbabababbbbbaababaababbabaaabaababaaababaabababbbbaabaabbbbbbbabbaaabbaaababaaaabbbbabbaabbbbabaabbaabbbabaabbababaaabbabaaaabaaababbbbabbabbabababaaaaabbbbaaabaaabaabbbbbaabbbbaaaabbabbbabbbbaaaabbbabababaababbbbababaaabbbaaabaabbbbababababababbaaababbbbaaaaaaabbbbaaabbbbbbaaaabbaabbbbbaaaaaabbbbaabbaaabaaaaabbbbbbbbabababbaababbbbaaababaaabaaabbaababababaaabbbaabbbaaaabaaabbbaaaabbaababaaaabbbaaaaaaaaababbbabaababbbaabbabbabaaaaaababbbbbbaaabbbababaabababaabbbabaabaaaaabbbbaababbabbabaabbababaaabbabbbbaabbaaabbaaababaaabaaabbaaaaabbbbbaaabbabbbbabbbaaaaaaaabbbaababaaaabaaaaaabbbaababababababbbbaaabaabaabbaabbabaaabaabbbaabaaabbbbbbbbbbbaaaabbbbbbbbbbbbaabaaababaabababaabbbaaaabaaaaabbabbbaaabbbbbaaabaabaaabaabbaababababbabababaaaaaabbbabbaabaabbaaabaabbbababababbbbbbaabbbbaaabaababbaaabbbbbaababaabaaabbbbbabbabaabaabaabaabbabaabbaabbaaabbbbabbbbbabbabbbbbbaaaababbaababbbbabaaabaabaaabbbabbaaabbaaaababbbaabbaabaaaaabababbabbabbabaabbabbabbabbbbaaaaabbbababbbbaabbaaaabaaaaaabbbabaaabaaaabbbbaabbbaaababbabbbabbabababbbaaaaabbbbbaaabaabbaababbababaabaaabbaaaabbaaabbaaabbaabbbbbbababbabbbbbbbaabbbabbbabbbbbbbbbabbabbbabbbbbbbbbabbbbbaaabaabaaabbaabbabbbbbbbabbaaabbabaaabbbbbbbbbbbbbbabbaabbbaaaababaaaaaaabaabbbbabbbbbbbbbbaabababababbbbabbbbabbaaabaabbaaaaabbaaababbbaaaaaabbaaababbababaababbbabababbabbbabaaaaaaabaaabbbabababaabbabaaaabbbbbbaaaababaabbbbaabbaaaaaabaaabbaaaabaaaaabaaaabbbabababbabaaababbbaaaabbaaaabbababbaabaabbaababbababbababbbabaababbbaaaabbbbaabbbabbabaaaaaaaaaaaabababaaaabaaaaababbbbabbbbabaabaabbbbbbabbbaabaabbbabaaaaabbabbaabbbaaaabbbbaaaabbabbaabbaabaaabbbbbabbaababbaabaabababaaabbabbaabaaaaaaababbaabaaaabbaabbabbbaaaababaaaababbaabbbaaaabbbaaabaaabbbbbbabaabbbaaababababbbbbbabbabbbaaaaababbbaabaaaabababbbaaaabaaaabbabaaaaaababaabaabaaabaabaabbaaaaaabaaaababbbbbbbabbababaabaababaaaabbaabaabbaabbaaaaaabaababbaaaaaaababbbbabaabbbbaaabbbaabbbbaababbbaabaaababbbabababaabaaabbabbabbbabababbabbbaabaaaaaabaabaaaaaaaabbaaaabaaaabaabbaababbabaaabababbbaaaaaaaababaabaabaaabaaaabaaaaaabbbbbaaaaaababbabbbabbbaabbbaaaaababaabbbbaaababbaabaababaababaaabababaaaaabbbababbbbabbbabbabababbbbbababbaabbbbabbaabbbbabaababbabbbabbbbbbbaabababbbbabbbbaaababbbbbbbbaaaababaabaabbaabbabaabaaabaababaabbbabbbaaaabababbbaaabababbababbaababbbabaababaaabbbaaabbbbabbbabbaaababababbaaaaaababbaaabbbaabbabaabaaaabbabbbabbaaabbbaaabbbbbabbaabaabaabbbaaabaabbbbbaababbbbabbbbabaaaaabaabbbbbabbaababaabbbbbbbbbabaaaaabaabaabababbbababbabbbaabaaabaaabababaaababaaaabbbbbabbbbabbbababbabbabbaaaabbbbaababaabbaaaaababbbbabbbaabaabaabaababbbaaabaaabbbbbbbaabbabbbbbbbabbbbbbaaababaabbbabbbbababbaaabaabaaabbababbbbabbababbabbaababbbbbbbbaabaabbbbaababbaaaaababaaaaababababaabbbaabaabbabaaabaaaabaaaaabababababbababababbbbbbbaaabbbbbbbbaaaaabaaaaaaabbbbaaaabbbababaaababbababbbabababbababaabbaaababbbabbbbabbaaaaabaabaababaaaabbbabbbbabaaaaaaabbbaabbabbbbbbaabbaabaabbaabbaaaabbabbaabbbabbaaaaaaaaabbbbaaababbbaaaabbaabaaaabbabbabbbaabbbbbabababaaabbabaabbaabbbbaaaaaaaaababababbbabbaaabaabababababbbaabaaabaaaabaaabaaaabbbbbbbbbababaaaababbbbbababaaabbbabbbabbaabaaabaabbbbabbbbbbaaaabbaaaaababbaabaaaaaababbbbbabbaaaaabbbabbaababaaaaaabbababbabbbbaabbbbbbabaaaabababbaaabbbababababaabaaaaaababaaaababaaabaaabaaaaababaaabbabbbaabbabaabbabbbababbababbaaababbbbbaabbbabababbabbabbaabbaabaaaabbaaaabbaabaabbbbbabbababaaaabaabbabaabbaaaababbaaabbbbbbbababababbabbabbbbbababbbbbbaabbaabaabbababbbbabaaabbbaabbabbaabaabababbababababbaaaaaaaaaabbabaabaabbaabaaabbbaaaabbbbbaaabbaabaaababaabbabaaaababbabbaababaaabaaabbbabaabaabbbabbabaaaaabbaabaaaaabbaabbaababababbaabaaaaaabaaabbabaaaabbbabaabbabbaabbbaaabbbaaaababaaabbabbabaaaabaaabbaabbbaaaaabbababaabbbbaaabbbbbbaabbabbbbbabababbabbaaabaabbabbbabaaaaaaaaabababbabbabaaaaaabbaaaabbbbaaabbbbaaabbabaaababbaaabbaaabbbbaaabbbbbbbabaaabbbbaaababbaabaabbbbbabaababbaaaababaababababbaabbbaabbbabbbabababbabbabbbaababbaaaabbabbababbbbaabaaaaaabababbbbababaaabbbbbbbbbabbbbbbaaaabbaabbbbbaabbabaaabababaaabbbbbababbbabaaaaabbaaabaaabbbaababbbbaabababbabbbababaaababbbaaaabaabababbbaabaaaabaabababbaabbbaaabababbbabaabbbabbaabaaabbaabbababbbbababbaaaabaaaaabababaaaabbbabbbbaaabbaaabaaaaabaabbbbbbaaaaabbaaaaaabbbbbbbbaaaaaaabaabbbaababbbbabaaababbabababbbbaabababbbababbaabbbabbaaaabbabaabaabbbbbbabbbabababbbaaaaabbaaaabbabbbaaababbababaabababaabaabaabaaabaaabbaaaabbaaaaaababbabbababababbaababaaababbabbbabaabbbbabbaabaabababbbbabaabaaaabbaaaaaaaaabbbabbbbabbbabbabaaabbbabababbbabbbbbaabbabbabbbaababbaaaaaabaabbabaabaaaabbbababbbbaaaaaababaabaaaabbababbaaaaabbbaaaaaaabababbaaabaaabaababaaaababbaaabbbabaaaabbbbabbababbabbbababbbbaaaaaaabbbabbabaaaaababbaababaaabbaababbabbbaabbababbbabbaabbbbbabaaabaabbabbbaabbbbbabababaaaaabaabbabababbbbaababaaababaababbbbbabababbabaababaabaabbbabaabbbaabbabbbabbababaaaaabbbaaaabbbbabaaabaabaabbbaababbabbbbaaaabbbaaaabaaabbaabbbbbabbbababbbaaaabababaaaababbbbbaabaaaabbbaabbaaabbaabaaaabbbbbaababaabbababaaabbabaaaababbaabaabaaabaabbbaababbbbabbbaabaaaaabbabababaabaaaabbbababbbbabbbbaaaaaaabaaabaabbbbaaaaababbaaabbbbabbbbbabbaaabaaabaabaabaaabbaabbbaabbabaaaabbbaaaabbabaaaaaaaabbbabbbaaaaabbabaaaaabbabbaaabbbabbaabaaaabbaaabbabbbbaaabaabbbbbbbabababababbaaabaabaaabaaabbaaabbaabbabaaabaabbaabbabbbbbbbbaaababbbbabbababbababbbbabbabaabaaaaaaabbbabababbaabbaaabaabbaabbabaaaabaabbaaabaabbbababaaabbbabbabbababbaabbaaababbabaabaabbaababaabaabbaabbbbaaabaaabbabbaaaababababaaaabaababbbbbaabbabbaababbaabbbbaabababbabaabaaaaaaabbaabbabbaaabbbbbababbbbbbaaababaabbbabbababbaaaaaaabbaabbbbabbbbbaabaababbaabbbbbaaaabababbbbaaaaabbababbababababaababbbbbabbabaaaaabbbbabaabbaabbbabbbbbaaaaabbbaaabbbabbabbbababaaaabbaababababaabababbaabbaabaaaabbbabbbababababbbaabbabbbaababbbaaabababaaaabaababaaaababaabaaaaaaaabababbabaaaabaaabbbbbabaaabaababbbbaaaababaabaaaaababbaaabaabbaaaaababaabaabbabbabbbaababababbbaaababaaaaaabbbbaaaabbabbbbabababaabbaaabbbbaabbaabaaabbbbbaaabbabaababaaabbbaaaabbaaabbbabbbbaabbbabaaabbbabbbababaaabbbbaaabbabbbbbabbaaababbbbbbababbabbbbaaaabaaabbaabbaaabbabbaaaaabaabbabababbbabbabaaabbbaabaaabaaaaabababbbbaaaabbbbabbbaabbababbaababababbbaaababbabaaabababbababbabbabaabaabbbbaaabaabaaabababbabababababbbbaaaaabababbabababaabaaaaaabbbbaabbbaabaabaaaaaaabbaaabbababbaabaabbbaabbaabbbaabaaabbbbaaaababbbbbbbbabbaabababbbaaababbabababbbbbaaabbabbaabbbbaabbabaaaabaaababaabbbaaaabbabbbbbaabbbbbbaaaababbaaabbaabaaabbaabaaababbbaaabbbaaaabbabbaaaaaabaabaabbbabaaaaabbbaaabbbbbbbbbbbaabbbbbbabbaaababbbaaaabbabbaabbaaababaabaaabaabbaaabbbbbaaaaabbbbbbbaababbbbabbbaaabbabaaaabbabbaaaabaaabbaaababbbabbaaaababbbbabbabbabaabbbabbababaaaaabbaabbababaaabababbaaaaaabbbbaaaaabbababbababbbabababbabbbbaabbabbbbbabaabbaabbbabbababbbbababaabbbaabaaabaaaaabbabababaaaaaabaabbbaaabaababababbabbaaabaaabaabbbbabaaaaababaababababbababababbaaaababbabbabbbbbaabbababbbbbaaababbbababbaabbbaaabbbbabbbbbabbbaabbaaabbaabbaababbabaabbababbbbbbabaaabaabbbbabbbbabaaabbaabaabbabbaaaaaaaaaabbbbbbbbabbbaabbbabbbbbbbaababaababbaaaaaababaaabbbbbbaaabbbbbaabaaaababaabaabbbabbabbaaaababaaabaabbaababbbaababbbbaaabababbabbabababaabbbbbbbbbaababbaaaabaaabbbbbaabababbaaaaaaaaabbaabbababbbabbbbbaabaaabbaabbaaabbbaabbaaaababaabbbaabaabbaabbbaabbabbabbaaabaababbbaababaaaabbbaabbbbbabaaabbbbbbaaaaaabbaabbbbbbbbabbbbbbbaaaabbbabaaabbbbabbbbbbabbababaabaaabaabbabaabbababababbaaabbbbbaaabbabaabbabbaaaababbaabaaaaabbbbbbabaaabaaaaaaabbbbabaaaabbbababaabbbabbbbaaaababaababaaabbabbaaaabbabbabbabaaabaabbaaabbbababbabbbababbaabbaaabbaabbbbaaabbbabbbbaaaaabbaaabbabbaaaaaaaababbababbabaababbaaaabbbbaabaababbbbbbbbabbbbabbabaaababbbbaaaaababaaaabaaaabaabbaaaaaabbaabbaabbbbbabaaababbabbbaaabbababaaaaababbabbbbabaaaaabaababababaabbabbaabaaaabaabbbabbababbabbbabababaabbbbabbbbaabaaabaabbbabbaabaaababbbaabaabbabbbbabaaaabbbabbbabbaabbbabbaaababbabaaaabaaaaaabbbabaabababaabaabaabaabbbaaaabaabbaabaabbbbaababaabbbbbabbaabaaabaabbbbabbbbabbaaabbaaabbaaabaaaaaaaabaabaaaabaaababbababbbbaaababbbbababbbaaaabbbbaabbababbbabbaaabbaaaabbbbabbaabaaabbaababaabbaaaabaaaabbaaaaabaababbbabbababbbbababbbbaaabbbbabababbbbabbbbaaaaabbbaabbbaabaaaabaabbabbbaabaababbbbaaabbbbbbaababbbbbaaaaaababbabbbbabababbbabbbabbbaabaabbbbbabbabbbbbaabbbabaaabababaaaaaaabaabababbaaabbaabbbababaaabbaababaaaabbbbaabbbbaaabbbabaaaaaaaabaaabaaabababbaaaaaabaaabbbbbabbabbaabababbababababaaaababbabbaabbabbabaaaabaaabaabbbabaabbbbbaabaababaaabababaabbbabbbbbbbbbbaaababbbbbbababaaaabbaabbbbaabbbababababbbaaaaabbabaaaaabbaaaabababbabaabbabbababbbbbabaaabbbbbbbbbaaabaaababaaaaabaabbaaaabbaabbbbbabbaabaabbaaaababaabbbbbabbbaaabaabbabbaaaabaaaabaaaaaaaabaabbabbbaabbababbbabaaabaabaaabbaababbbababbaabaaaabbabbbbbaaababbaabbaababbaabbbbbbababbabbaabababbbabbbbbbabbbabababbbbabbbaaababbaaabbbaabaaaabaaaabaabbbababbbbbbbbaaababbaabaaabbaaabbbbbabbbabbbababaabaaaaaaaaaabbbbbaabbbabbbbbabbabaabbabbbaabbbbabbabbbaaabbaababbabababaabbbbbaabbbbaabbbabbaaaaaabaabbabbbbbaaababbabbbababbbbbaaabaabbaaaaaabaaaaaabbbaabbaaabaababbaaabbabaabbbaababbaabbbbbbabbbbabaababbbbbaababbabaabbbaaaaabbbbbababbaabbababaabbabbbabbaaaaaabaaabbababbaabbbabbbabbabaabbaaabbaabbbbabbbaaaaaaaaabaabbbbababaababbbbababbbaaabbabbaabbababbaabababaabbaaabaabbababbbaababababbbababaababaaaabbaabbbaabaabbabbaaaaaaaaabbbbbabbbabaaaabbabaaababbaabaababaaabbaabbabbbabbaaabaaabbbbaaabbbabbabababbbbbbbbbaaabaabbaababbabaaaababbbbbababbabaabbabababaaaaababbabaaabbaaabbbbbaabbabbababbaaabbbaabbabaabaababbaaabbbbbaabbaaaaabbaabbbaabbbbabbabbabaaabbbabaaaaaaaababaaaababaaaaababaaaabaaaaaaaaababaabbbababbbbaabaaaaabbbababbabbaabbaaabb", + "babaaaabbbbabbababbabbbababbbb", + }, + + { + "moplvidmaagmsiyyrkchbyhivlqwqsjcgtumqscmxrxrvwsnjjvygrelcbjgbpounhuyealllginkitfaiviraqcycjmskrozcdqylbuejrgfnquercvghppljmojfvylcxakyjxnampmakyjbqgwbyokaybcuklkaqzawageypfqhhasetugatdaxpvtevrigynxbqodiyioapgxqkndujeranxgebnpgsukybyowbxhgpkwjfdywfkpufcxzzqiuglkakibbkobonunnzwbjktykebfcbobxdflnyzngheatpcvnhdwkkhnlwnjdnrmjaevqopvinnzgacjkbhvsdsvuuwwhwesgtdzuctshytyfugdqswvxisyxcxoihfgzxnidnfadphwumtgdfmhjkaryjxvfquucltmuoosamjwqqzeleaiplwcbbxjxxvgsnonoivbnmiwbnijkzgoenohqncjqnckxbhpvreasdyvffrolobxzrmrbvwkpdbfvbwwyibydhndmpvqyfmqjwosclwxhgxmwjiksjvsnwupraojuatksjfqkvvfroqxsraskbdbgtppjrnzpfzabmcczlwynwomebvrihxugvjmtrkzdwuafozjcfqacenabmmxzcueyqwvbtslhjeiopgbrbvfbnpmvlnyexopoahgmwplwxnxqzhucdieyvbgtkfmdeocamzenecqlbhqmdfrvpsqyxvkkyfrbyolzvcpcbkdprttijkzcrgciidavsmrczbollxbkytqjwbiupvsorvkorfriajdtsowenhpmdtvamkoqacwwlkqfdzorjtepwlemunyrghwlvjgaxbzawmikfhtaniwviqiaeinbsqidetfsdbgsydkxgwoqyztaqmyeefaihmgrbxzyheoegawthcsyyrpyvnhysynoaikwtvmwathsomddhltxpeuxettpbeftmmyrqclnzwljlpxazrzzdosemwmthcvgwtxtinffopqxbufjwsvhqamxpydcnpekqhsovvqugqhbgweaiheeicmkdtxltkalexbeftuxvwnxmqqjeyourvbdfikqnzdipmmmiltjapovlhkpunxljeutwhenrxyfeufmzipqvergdkwptkilwzdxlydxbjoxjzxwcfmznfqgoaemrrxuwpfkftwejubxkgjlizljoynvidqwxnvhngqakmmehtvykbjwrrrjvwnrteeoxmtygiiygynedvfzwkvmffghuduspyyrnftyvsvjstfohwwyxhmlfmwguxxzgwdzwlnnltpjvnzswhmbzgdwzhvbgkiddhirgljbflgvyksxgnsvztcywpvutqryzdeerlildbzmtsgnebvsjetdnfgikrbsktbrdamfccvcptfaaklmcaqmglneebpdxkvcwwpndrjqnpqgbgihsfeotgggkdbvcdwfjanvafvxsvvhzyncwlmqqsmledzfnxxfyvcmhtjreykqlrfiqlsqzraqgtmocijejneeezqxbtomkwugapwesrinfiaxwxradnuvbyssqkznwwpsbgatlsxfhpcidfgzrc", + "akyj", + }, + + { + "banana", + "ana", + }, + + { + "abcd", + "", + }, + + // 可以有多个 testcase +} + +func Test_longestDupSubstring(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := longestDupSubstring(tc.S) + ast.Equal(len(tc.ans), len(ans), "输入:%v", tc) + ast.True(isDupsub(tc.S, ans) && isLongest(tc.S, ans)) + } +} + +func isDupsub(S, sub string) bool { + i := strings.Index(S, sub) + if i == -1 || strings.Index(S[i+1:], sub) == -1 { + return false + } + return true +} + +func isLongest(S, sub string) bool { + for b := 'a'; b <= 'z'; b++ { + if isDupsub(S, sub+string(b)) || + isDupsub(S, string(b)+sub) { + return false + } + } + return true +} + +func Benchmark_longestDupSubstring(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestDupSubstring(tc.S) + } + } +} diff --git a/Algorithms/1046.last-stone-weight/README.md b/Algorithms/1046.last-stone-weight/README.md new file mode 100755 index 000000000..f2efc9830 --- /dev/null +++ b/Algorithms/1046.last-stone-weight/README.md @@ -0,0 +1,27 @@ +# [1046. Last Stone Weight](https://leetcode.com/problems/last-stone-weight/) + +We have a collection of rocks, each rock has a positive integer weight. + +Each turn, we choose the two heaviest rocks and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is: + +- If x == y, both stones are totally destroyed; +- If x != y, the stone of weight x is totally destroyed, and the stone of weight y has new weight y-x. + +At the end, there is at most 1 stone left. Return the weight of this stone (or 0 if there are no stones left.) + +Example 1: + +```text +Input: [2,7,4,1,8,1] +Output: 1 +Explanation: +We combine 7 and 8 to get 1 so the array converts to [2,4,1,1,1] then, +we combine 2 and 4 to get 2 so the array converts to [2,1,1,1] then, +we combine 2 and 1 to get 1 so the array converts to [1,1,1] then, +we combine 1 and 1 to get 0 so the array converts to [1] then that's the value of last stone. +``` + +Note: + +1. `1 <= stones.length <= 30` +1. `1 <= stones[i] <= 1000` diff --git a/Algorithms/1046.last-stone-weight/last-stone-weight.go b/Algorithms/1046.last-stone-weight/last-stone-weight.go new file mode 100755 index 000000000..c67097b93 --- /dev/null +++ b/Algorithms/1046.last-stone-weight/last-stone-weight.go @@ -0,0 +1,41 @@ +package problem1046 + +import "container/heap" + +func lastStoneWeight(stones []int) int { + pq := PQ(stones) + heap.Init(&pq) + for len(pq) >= 2 { + a, b := heap.Pop(&pq).(int), heap.Pop(&pq).(int) + if a == b { + continue + } + heap.Push(&pq, a-b) + } + if len(pq) == 0 { + return 0 + } + return pq[0] +} + +// PQ implements heap.Interface and holds entries. +type PQ []int + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { return pq[i] > pq[j] } + +func (pq PQ) Swap(i, j int) { pq[i], pq[j] = pq[j], pq[i] } + +// Push 往 pq 中放 int +func (pq *PQ) Push(x interface{}) { + temp := x.(int) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 int +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + *pq = (*pq)[0 : len(*pq)-1] + return temp +} diff --git a/Algorithms/1046.last-stone-weight/last-stone-weight_test.go b/Algorithms/1046.last-stone-weight/last-stone-weight_test.go new file mode 100755 index 000000000..9fefa525b --- /dev/null +++ b/Algorithms/1046.last-stone-weight/last-stone-weight_test.go @@ -0,0 +1,42 @@ +package problem1046 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones []int + ans int +}{ + + { + []int{1, 1, 1, 1}, + 0, + }, + + { + []int{2, 7, 4, 1, 8, 1}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_lastStoneWeight(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, lastStoneWeight(tc.stones), "输入:%v", tc) + } +} + +func Benchmark_lastStoneWeight(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lastStoneWeight(tc.stones) + } + } +} diff --git a/Algorithms/1047.remove-all-adjacent-duplicates-in-string/README.md b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/README.md new file mode 100755 index 000000000..7d58c9107 --- /dev/null +++ b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/README.md @@ -0,0 +1,21 @@ +# [1047. Remove All Adjacent Duplicates In String](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/) + +Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. + +We repeatedly make duplicate removals on S until we no longer can. + +Return the final string after all such duplicate removals have been made. It is guaranteed the answer is unique. + +Example 1: + +```text +Input: "abbaca" +Output: "ca" +Explanation: +For example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move. The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca". +``` + +Note: + +1. `1 <= S.length <= 20000` +1. `S consists only of English lowercase letters.` diff --git a/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string.go b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string.go new file mode 100755 index 000000000..14b6b1bda --- /dev/null +++ b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string.go @@ -0,0 +1,15 @@ +package problem1047 + +func removeDuplicates(S string) string { + bs := []byte(S) + stack, top := make([]byte, len(S)), -1 + for _, b := range bs { + if top >= 0 && stack[top] == b { + top-- + } else { + top++ + stack[top] = b + } + } + return string(stack[:top+1]) +} diff --git a/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string_test.go b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string_test.go new file mode 100755 index 000000000..d27baa0c3 --- /dev/null +++ b/Algorithms/1047.remove-all-adjacent-duplicates-in-string/remove-all-adjacent-duplicates-in-string_test.go @@ -0,0 +1,37 @@ +package problem1047 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + S string + ans string +}{ + + { + "abbaca", + "ca", + }, + + // 可以有多个 testcase +} + +func Test_removeDuplicates(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, removeDuplicates(tc.S), "输入:%v", tc) + } +} + +func Benchmark_removeDuplicates(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + removeDuplicates(tc.S) + } + } +} diff --git a/Algorithms/1048.longest-string-chain/README.md b/Algorithms/1048.longest-string-chain/README.md new file mode 100755 index 000000000..9499a7e7a --- /dev/null +++ b/Algorithms/1048.longest-string-chain/README.md @@ -0,0 +1,23 @@ +# [1048. Longest String Chain](https://leetcode.com/problems/longest-string-chain/) + +Given a list of words, each word consists of English lowercase letters. + +Let's say word1 is a predecessor of word2 if and only if we can add exactly one letter anywhere in word1 to make it equal to word2. For example, "abc" is a predecessor of "abac". + +A word chain is a sequence of words [word_1, word_2, ..., word_k] with k >= 1, where word_1 is a predecessor of word_2, word_2 is a predecessor of word_3, and so on. + +Return the longest possible length of a word chain with words chosen from the given list of words. + +Example 1: + +```text +Input: ["a","b","ba","bca","bda","bdca"] +Output: 4 +Explanation: one of the longest word chain is "a","ba","bda","bdca". +``` + +Note: + +1. `1 <= words.length <= 1000` +1. `1 <= words[i].length <= 16` +1. `words[i] only consists of English lowercase letters.` diff --git a/Algorithms/1048.longest-string-chain/longest-string-chain.go b/Algorithms/1048.longest-string-chain/longest-string-chain.go new file mode 100755 index 000000000..48f2ffe95 --- /dev/null +++ b/Algorithms/1048.longest-string-chain/longest-string-chain.go @@ -0,0 +1,54 @@ +package problem1048 + +func longestStrChain(words []string) int { + indexs := make([][]int, 17) + count := make([]int, len(words)) + for i, word := range words { + l := len(word) + indexs[l] = append(indexs[l], i) + count[i] = 1 + } + + res := 1 + for length := 1; length+1 <= 16; length++ { + for _, i := range indexs[length] { + for _, j := range indexs[length+1] { + if count[j] > count[i] { + // because of isPredecessor is expensive + continue + } + if isPredecessor(words[i], words[j]) { + count[j] = count[i] + 1 + } + } + } + } + + for _, v := range count { + res = max(res, v) + } + return res +} + +func isPredecessor(w1, w2 string) bool { + n := len(w1) + diff := 0 + i, j := 0, 0 + for i < n && diff <= 1 { + if w1[i] != w2[j] { + diff++ + } else { + i++ + } + j++ + } + return diff == 1 || + i == j // w1[:i]==w2[:i] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1048.longest-string-chain/longest-string-chain_test.go b/Algorithms/1048.longest-string-chain/longest-string-chain_test.go new file mode 100755 index 000000000..a47b9e650 --- /dev/null +++ b/Algorithms/1048.longest-string-chain/longest-string-chain_test.go @@ -0,0 +1,47 @@ +package problem1048 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + ans int +}{ + + { + []string{"biltnzk", "jxwakrfxsifoj", "uzdwyaxvcsr", "sqqgkhwbf", "tnoftkolx", "ipmtvxcwe", "zsucxrqkhahuo", "qngglugvm", "kvohqyedig", "njoxacsnddwrg", "vwtnxw", "kjjourlrzpgeem", "xcs", "pfsgimurs", "lsifyg", "uzwyxcsr", "muzdwcyanxvcstr", "teqyrlhbvcv", "rkga", "tudezgzbnzb", "uzwyaxvcsr", "qvzkmgfulby", "x", "muzdwcyianxvcstr", "koqyig", "gl", "aqcacmy", "pmvwe", "eskofqduddkhykr", "pm", "saxxd", "ds", "iemm", "tudegzbz", "yipsawmxbp", "qyrlhbvcv", "yxuhwkzvoczoz", "zsucxqkahuo", "kga", "zwziivbijeiig", "wffaheemjnjahzdd", "zcxkahuo", "djjjsulms", "plxh", "ffpasoizwhtu", "zwziivijeii", "fyvpzegautteiv", "qszaitzfzv", "uwoghcy", "qqgkhwbf", "eteqyrllhbvcvg", "qknspkhngorof", "qwvzkmgfuljbyz", "grkte", "grikrnwezryi", "xjbpvekneaxn", "cy", "wnhnyqmpbsum", "m", "offqllgj", "plxhib", "omblqcoktkyf", "pasw", "prsngzx", "offlj", "rvvudgpixa", "djjjjsulmmrs", "gt", "mpfsgimurs", "cxkahuo", "ipmtvxcwue", "pqrbaoquxqemv", "prqqv", "tnoftfkolx", "jfzzaw", "rshquwmrboghccy", "ebqhvwewzzmqif", "rrd", "dvjjjjqsulmmrs", "pfsiurs", "crnruydj", "rvqgeqql", "djsums", "prbaquqemv", "bs", "dzytccvny", "kce", "llfv", "jfzaw", "qwvzkmgbfuljbyz", "kgieph", "hnympsum", "ewv", "vfgel", "rklga", "llzqbfv", "gte", "jckqurkg", "qngglugm", "tudgzbz", "ipmvcwe", "rr", "kkcev", "djjjjsulmrs", "llqbfv", "offqlgj", "paswu", "tlrlcnnrsrf", "jcckqurkg", "jjourlpgeem", "nvl", "shquwmrboghccy", "vncfgelm", "dgcdgjcksk", "vvhvmibflb", "juifgeqkaectlcj", "scvdl", "whcy", "yipswmbp", "wcy", "hbqq", "bsth", "etjurltvpsuy", "dzvytcccevnceyq", "apqrbaoquxqemv", "kvohuqyediyig", "lenybbukzftz", "ffpasoiuztwhtu", "lzlhzqibfv", "wfeemjnjahzdd", "djsulms", "xtudezgzbnzb", "eemjhzdd", "scavdil", "guchrvaqbe", "nvll", "sxzfpzjmxvu", "dytccvny", "grikrnjwezryi", "prng", "ntvmcwwpzo", "laqgcacyxmym", "mglosifyg", "nynvlqll", "vwtn", "lh", "zhhxducgelhy", "prg", "kghierph", "zsucxrqkhahuom", "kvohqydig", "eemjhzd", "offiqcdllgji", "dyc", "toflx", "dzvytccvney", "ghvb", "to", "guchrvab", "wyimthhfzndppwt", "elbqhvwewzzmqif", "hkghiyerph", "hkghiyejrph", "hlsioorugbsuu", "c", "kgierph", "bstbghj", "prbquqev", "mpfsdgimurs", "zfpjvu", "zfpvu", "yxuhwkzvoczfgoz", "gel", "ntvmcpzo", "ekofqduddkhykr", "ekofqdddhykr", "rqeql", "nhnympsum", "xhoqlfolk", "ipmtvxcwuje", "wgmhjhdmnqot", "bsh", "rvncfgelm", "hkahpbb", "lzlzqibfv", "xoqlfok", "tnoftfkogwgplx", "ekofqdddkhykr", "zwiieii", "ujfzzaw", "jfzw", "djsms", "scavdpilj", "tnoftfkoglx", "ps", "vwtnw", "scavhdpilj", "scayvhdpuilji", "pdrshqngzx", "crnrud", "wmhjhdmnqot", "wghmhjhdmnqot", "vbyipsawmxbp", "qknsapkhngorof", "wymthhfzndppwt", "wxcs", "dzvytccevney", "acacmy", "dycy", "teqyrllhbvcv", "uzwyxcs", "wmhjhdmnqt", "qvzkmgfulbyz", "qngglum", "zhhxgdyukcgelhy", "oj", "iljes", "bstbh", "laqcacxmy", "tofx", "ke", "yivkqoek", "djjjsulmrs", "lbirdzvttzze", "l", "zhhxgdukcgelhy", "grikvrnjwezryi", "bltz", "npynvlqll", "gvb", "okzrs", "urbarfkmnlxxn", "qsyzaixtzfazv", "dytcy", "h", "kohqyig", "hgri", "ojdxm", "ujfdfzzaw", "qyrhbvcv", "ebqhvwewzmqif", "uzwxcs", "lebzf", "ysijvkwqmoekromh", "wffaeemjnjahzdd", "crnrduyndj", "ujfdmfzzaw", "laqgcacyxmzgym", "jjourlrpgeem", "kvohqyediyig", "lebukzf", "zwiijeii", "guchrvb", "omoktkyf", "hpgt", "yikoek", "ysijvkwqoekromh", "tvpo", "ysijvkqoekromh", "xbgq", "d", "abmtk", "ors", "rnrd", "xzrugvlzduaxhzc", "njoxacjsnddwrg", "yipswmxbp", "xqsyzaixtzfazv", "urbrfknlxxn", "sxzfpjxvu", "prbaquxqemv", "dvjjjjsulmmrs", "kviahvqu", "urbfknx", "qvmgfulby", "yikqoek", "zsucxrqkhfahuomm", "koqyg", "djss", "moxpfsdgimlurs", "qeql", "urbrfknlxn", "kgieh", "qnspkhngorof", "plxyhib", "scyayvhdpuiljki", "vvhvmbflb", "lpzluhzqxibfv", "kkcbev", "hpzgty", "nyvlqll", "kvahvu", "rklgja", "ipmtavxcwuje", "lbirdzvvttzze", "psw", "fpasoiwhtu", "dgcdgjckk", "qknhsapkhngorof", "qszaixtzfazv", "tvp", "abmtvk", "uwrboghcy", "hbq", "crnruyd", "etjurltvsuy", "etjurltyvpsuy", "lenbukzf", "teqyrllhbvcvg", "ipmvwe", "o", "crnryduyndj", "lbirdzvvqfttzze", "tnoftfkowglx", "ipmtavxcwujre", "omlcoktkyf", "rnperyemtmqh", "bltnzk", "sxzfpzjxvu", "uzdwyaxvcstr", "bq", "rvvugpixa", "laqcacxmym", "wffeemjnjahzdd", "fpvu", "xjbpvekngeyaxbn", "dzvytccevncey", "qgly", "scavdl", "fw", "tox", "toftklx", "prbaoquxqemv", "ztrobzqiukdkcbv", "yivkqoekr", "feemjnjhzdd", "plxhi", "cp", "fyvpzgauttei", "prshqngzx", "kplxyrhib", "suwrboghcy", "kviahvu", "mvwe", "dzvytccvny", "hbqwq", "prbquqemv", "lzlhzqxibfv", "ll", "omblcoktkyf", "toftlx", "lpzlhzqxibfv", "tudegzbnz", "ddgcdgjcgkspk", "kgih", "xjbpvekneaxbn", "suwrboghccy", "zwiiijeii", "dytccy", "ympsum", "jxwakfxsifoj", "uwhcy", "yxuhwkzvoczfoz", "xzfpjvu", "lenybbukzft", "b", "llqfv", "laqgcacyxmgym", "xq", "scavdilj", "zwziivbijaeiig", "scyayvhdpuilji", "amvevfulhsd", "dss", "tlrlcnnrs", "uzwyaxcsr", "qspkhngorof", "etjurtvsuy", "wgqhmhjhhdmnqot", "tvmpo", "tnoftklx", "qgflby", "mlosifyg", "oqyg", "gchvb", "t", "offqcdllgj", "ziieii", "zwziivbijeii", "vp", "lpb", "fyvprzegauttejiv", "vtn", "amefulhsd", "llf", "muzdwyaxvcstr", "zucxqkahuo", "pfsgiurs", "obstbghj", "ipmqtavxcwuzjrbe", "djjsulms", "qvmgflby", "ljpzluhzqxibfv", "jjourlrzpgeem", "zrugvlduaxhzc", "xbpvkneaxn", "ljpzluhzgqyxibfv", "yivkqoekrh", "laqcacyxmym", "nyvll", "muzdwcyaxvcstr", "fyvpzegauttejiv", "offlgj", "vnfgelm", "eteiqyrllhbvcvg", "zsucxrqkhahuomm", "ibiltnzk", "rklgjae", "fpasoizwhtu", "t", "zhhxdukcgelhy", "fpasoiwu", "xzfpjxvu", "tlrlcnnrysrf", "ojx", "mpum", "lxh", "eturtvsuy", "rklgbjaae", "kahpbb", "qngglugmfvmp", "fielbqtcri", "xzruogvlzduaxhzc", "rshquwmrbtoghccy", "nyvlll", "lbirdzvvqttzze", "dgcdgjckspk", "vvhvmibfilb", "dzvytcccevncey", "g", "vwe", "zwxcs", "k", "jourlpgeem", "cpk", "cds", "tlrlcnnrsr", "ivemm", "fgel", "grktse", "urbfknlxn", "qwvzkmgfulbyz", "xjbpvekngeaxbn", "wphuutlgczfspyga", "xbq", "offqcdllgji", "vbyipsakwmxbp", "qyrhbvc", "ygzpztbno", "xhogqlfolk", "ujffzzaw", "xbnmgq", "uwohcy", "rnperyemqh", "prbqqev", "lenybukzf", "mxpfsdgimurs", "ga", "hpt", "moxpfsdgimurs", "vb", "offqcllgj", "rklgbjae", "lifg", "ztrobzzqiukdkcbv", "xoqok", "cs", "snaxxd", "cdds", "qknhsapkhngorohf", "rvqgeql", "rnperyemmqh", "scavhdpuilji", "urbfknlx", "rvvugixa", "ygzpztbndon", "zrugvlzduaxhzc", "shuwmrboghccy", "mlsifyg", "xhoqlfok", "wfeemjnjhzdd", "lbzf", "wythhfzndppwt", "mglqosifyg", "ojxm", "kvohuqyevdiyig", "grte", "prsngz", "eteeiqyrllhbvcvg", "dytccny", "qngglugfvmp", "kohqydig", "fu", "qgfly", "tvmcpzo", "tnoftfkowgplx", "zruglduaxzc", "yijvkqoekrh", "xqsyzaixtzfdazv", "ipmqtavxcwuzjre", "omloktkyf", "ympum", "lzlzqbfv", "pasowu", "rvqeql", "qngglugvmp", "hkghierph", "eemjhz", "feemnjhzdd", "c", "yxpuhwkzvoczfgoz", "dgcgjckk", "lbz", "yxuwkzvoczoz", "zrugvlduaxzc", "ntvmcwpzo", "fzw", "ygzpmztbndon", "rvncfgxelm", "mpm", "tudezgzbnz", "bltzk", "ffpasoiuzwhtu", "cd", "r", "okrs", "byipsawmxbp", "prsqngzx", "wnhnyqmpsum", "ipmqtavxcwujre", "w", "fpasoiwtu", "plxyrhib", "bstbhj", "xbnmrgq", "ipmtvcwe", "urbfkn", "nympsum", "qtngglugmfvmpt", "jckqurg", "hgr", "hpzgt", "rvvxudgpixa", "ysijvkqoekrh", "lebkzf", "guchvb", "kvohqyediyg", "amvefulhsd", "suwmrboghccy", "fvu", "ibdiltnzk", "rnrud", "iem", "urbarfknlxxn", "ygzpztbnon", "prsng", "zcxqkahuo", "ffpeasoiuztwhtu", "laqcacmy", "qszaitzfazv", "xbngq", "qvkmgfulby", "scavhdpuilj", "zsucxrqkahuo", "v", "qtngglugmfvmp", "ysijvkqoekrmh", "lfg", "prqqev", "pasoiwu", "p", "tvmcpo", "kcev", "im", "crnrduydj", "vfgelm", "ddgcdgjckspk", "ivqemm", "ljpzluhzgqxibfv", "lenybukzft", "nhnyqmpsum", "iljesr", "hp", "tqyrlhbvcv", "eemnjhzdd", "xbpvekneaxn", "wghmhjhhdmnqot", "uwboghcy", "guchrvabe", "xoqfok", "fyvpzgautteiv", "pg", "zwiivijeii", "qvgflby", "lsifg"}, + 16, + }, + + { + []string{"ksqvsyq", "ks", "kss", "czvh", "zczpzvdhx", "zczpzvh", "zczpzvhx", "zcpzvh", "zczvh", "gr", "grukmj", "ksqvsq", "gruj", "kssq", "ksqsq", "grukkmj", "grukj", "zczpzfvdhx", "gru"}, + 7, + }, + + { + []string{"a", "b", "ba", "bca", "bda", "bdca"}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_longestStrChain(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestStrChain(tc.words), "输入:%v", tc) + } +} + +func Benchmark_longestStrChain(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestStrChain(tc.words) + } + } +} diff --git a/Algorithms/1049.last-stone-weight-ii/README.md b/Algorithms/1049.last-stone-weight-ii/README.md new file mode 100755 index 000000000..3bd2d0fe2 --- /dev/null +++ b/Algorithms/1049.last-stone-weight-ii/README.md @@ -0,0 +1,27 @@ +# [1049. Last Stone Weight II](https://leetcode.com/problems/last-stone-weight-ii/) + +We have a collection of rocks, each rock has a positive integer weight. + +Each turn, we choose any two rocks and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is: + +- If x == y, both stones are totally destroyed; +- If x != y, the stone of weight x is totally destroyed, and the stone of weight y has new weight y-x. + +At the end, there is at most 1 stone left. Return the smallest possible weight of this stone (the weight is 0 if there are no stones left.) + +Example 1: + +```text +Input: [2,7,4,1,8,1] +Output: 1 +Explanation: +We can combine 2 and 4 to get 2 so the array converts to [2,7,1,8,1] then, +we can combine 7 and 8 to get 1 so the array converts to [2,1,1,1] then, +we can combine 2 and 1 to get 1 so the array converts to [1,1,1] then, +we can combine 1 and 1 to get 0 so the array converts to [1] then that's the optimal value. +``` + +Note: + +1. `1 <= stones.length <= 30` +1. `1 <= stones[i] <= 100` diff --git a/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii.go b/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii.go new file mode 100755 index 000000000..483039d37 --- /dev/null +++ b/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii.go @@ -0,0 +1,25 @@ +package problem1049 + +func lastStoneWeightII(stones []int) int { + hasSum := [3001]bool{} + hasSum[0] = true + sum := 0 + for _, s := range stones { + sum += s + for i := sum; i >= s; i-- { + // record all sum of any choose form stones + hasSum[i] = hasSum[i] || hasSum[i-s] + } + } + // now, sum is sum(stones) + // take stones to two group,weights are part and sum-part + // result is sum-part - part + // best is part = sum/2 + // if not, check part-- + // until part = 0 + part := sum / 2 + for part >= 0 && !hasSum[part] { + part-- + } + return sum - part - part +} diff --git a/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii_test.go b/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii_test.go new file mode 100755 index 000000000..9c37fe778 --- /dev/null +++ b/Algorithms/1049.last-stone-weight-ii/last-stone-weight-ii_test.go @@ -0,0 +1,62 @@ +package problem1049 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + stones []int + ans int +}{ + + { + []int{3}, + 3, + }, + + { + []int{1, 2, 3}, + 0, + }, + + { + []int{31, 26, 33, 21, 40}, + 5, + }, + + { + []int{21, 16, 23, 32, 25, 13, 20, 18, 22, 21, 84, 35, 33, 17, 27, 24, 10, 19, 31, 26, 94, 37, 31, 25, 24, 25, 15, 23, 17, 13}, + 1, + }, + + { + []int{3, 2, 1, 7, 3, 7}, + 1, + }, + + { + []int{2, 7, 4, 1, 8, 1}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_lastStoneWeightII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, lastStoneWeightII(tc.stones), "输入:%v", tc) + } +} + +func Benchmark_lastStoneWeightII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lastStoneWeightII(tc.stones) + } + } +} diff --git a/Algorithms/1051.height-checker/README.md b/Algorithms/1051.height-checker/README.md new file mode 100755 index 000000000..363d1868f --- /dev/null +++ b/Algorithms/1051.height-checker/README.md @@ -0,0 +1,19 @@ +# [1051. Height Checker](https://leetcode.com/problems/height-checker/) + +Students are asked to stand in non-decreasing order of heights for an annual photo. + +Return the minimum number of students not standing in the right positions. (This is the number of students that must move in order for all students to be standing in non-decreasing order of height.) + +Example 1: + +```text +Input: [1,1,4,2,1,3] +Output: 3 +Explanation: +Students with heights 4, 3 and the last 1 are not standing in the right positions. +``` + +Note: + +- 1 <= heights.length <= 100 +- 1 <= heights[i] <= 100 diff --git a/Algorithms/1051.height-checker/height-checker.go b/Algorithms/1051.height-checker/height-checker.go new file mode 100755 index 000000000..56c05acdb --- /dev/null +++ b/Algorithms/1051.height-checker/height-checker.go @@ -0,0 +1,16 @@ +package problem1051 + +import "sort" + +func heightChecker(heights []int) int { + sorted := make([]int, len(heights)) + copy(sorted, heights) + sort.Ints(sorted) + res := 0 + for i := 0; i < len(heights); i++ { + if heights[i] != sorted[i] { + res++ + } + } + return res +} diff --git a/Algorithms/1051.height-checker/height-checker_test.go b/Algorithms/1051.height-checker/height-checker_test.go new file mode 100755 index 000000000..892a666ec --- /dev/null +++ b/Algorithms/1051.height-checker/height-checker_test.go @@ -0,0 +1,37 @@ +package problem1051 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + heights []int + ans int +}{ + + { + []int{1, 1, 4, 2, 1, 3}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_heightChecker(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, heightChecker(tc.heights), "输入:%v", tc) + } +} + +func Benchmark_heightChecker(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + heightChecker(tc.heights) + } + } +} diff --git a/Algorithms/1052.grumpy-bookstore-owner/README.md b/Algorithms/1052.grumpy-bookstore-owner/README.md new file mode 100755 index 000000000..d09dc22c7 --- /dev/null +++ b/Algorithms/1052.grumpy-bookstore-owner/README.md @@ -0,0 +1,24 @@ +# [1052. Grumpy Bookstore Owner](https://leetcode.com/problems/grumpy-bookstore-owner/) + +Today, the bookstore owner has a store open for customers.length minutes. Every minute, some number of customers (customers[i]) enter the store, and all those customers leave after the end of that minute. + +On some minutes, the bookstore owner is grumpy. If the bookstore owner is grumpy on the i-th minute, grumpy[i] = 1, otherwise grumpy[i] = 0. When the bookstore owner is grumpy, the customers of that minute are not satisfied, otherwise they are satisfied. + +The bookstore owner knows a secret technique to keep themselves not grumpy for X minutes straight, but can only use it once. + +Return the maximum number of customers that can be satisfied throughout the day. + +Example 1: + +```text +Input: customers = [1,0,1,2,1,1,7,5], grumpy = [0,1,0,1,0,1,0,1], X = 3 +Output: 16 +Explanation: The bookstore owner keeps themselves not grumpy for the last 3 minutes. +The maximum number of customers that can be satisfied = 1 + 1 + 1 + 1 + 7 + 5 = 16. +``` + +Note: + +- `1 <= X <= customers.length == grumpy.length <= 20000` +- `0 <= customers[i] <= 1000` +- `0 <= grumpy[i] <= 1` diff --git a/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner.go b/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner.go new file mode 100755 index 000000000..6e992ad52 --- /dev/null +++ b/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner.go @@ -0,0 +1,25 @@ +package problem1052 + +func maxSatisfied(customers []int, grumpy []int, X int) int { + n := len(customers) + satisfied, dis, maxDis := 0, 0, 0 + for i := 0; i < n; i++ { + satisfied += customers[i] * (1 - grumpy[i]) + dis += customers[i] * grumpy[i] + if i-X >= 0 { + // NOTICE: len(A[i-X+1:i+1]) = X + // for keeping dis's length is X + // subscrip A[i-X]*grumpy[i-X] + dis -= customers[i-X] * grumpy[i-X] + } + maxDis = max(maxDis, dis) + } + return satisfied + maxDis +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner_test.go b/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner_test.go new file mode 100755 index 000000000..9d24a60df --- /dev/null +++ b/Algorithms/1052.grumpy-bookstore-owner/grumpy-bookstore-owner_test.go @@ -0,0 +1,41 @@ +package problem1052 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + customers []int + grumpy []int + X int + ans int +}{ + + { + []int{1, 0, 1, 2, 1, 1, 7, 5}, + []int{0, 1, 0, 1, 0, 1, 0, 1}, + 3, + 16, + }, + + // 可以有多个 testcase +} + +func Test_maxSatisfied(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxSatisfied(tc.customers, tc.grumpy, tc.X), "输入:%v", tc) + } +} + +func Benchmark_maxSatisfied(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxSatisfied(tc.customers, tc.grumpy, tc.X) + } + } +} diff --git a/Algorithms/1053.previous-permutation-with-one-swap/README.md b/Algorithms/1053.previous-permutation-with-one-swap/README.md new file mode 100755 index 000000000..cd64303ab --- /dev/null +++ b/Algorithms/1053.previous-permutation-with-one-swap/README.md @@ -0,0 +1,40 @@ +# [1053. Previous Permutation With One Swap](https://leetcode.com/problems/previous-permutation-with-one-swap/) + +Given an array A of positive integers (not necessarily distinct), return the lexicographically largest permutation that is smaller than A, that can be made with one swap (A swap exchanges the positions of two numbers A[i] and A[j]). If it cannot be done, then return the same array. + +Example 1: + +```text +Input: [3,2,1] +Output: [3,1,2] +Explanation: Swapping 2 and 1. +``` + +Example 2: + +```text +Input: [1,1,5] +Output: [1,1,5] +Explanation: This is already the smallest permutation. +``` + +Example 3: + +```text +Input: [1,9,4,6,7] +Output: [1,7,4,6,9] +Explanation: Swapping 9 and 7. +``` + +Example 4: + +```text +Input: [3,1,1,3] +Output: [1,3,1,3] +Explanation: Swapping 1 and 3. +``` + +Note: + +1. `1 <= A.length <= 10000` +1. `1 <= A[i] <= 10000` diff --git a/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap.go b/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap.go new file mode 100755 index 000000000..342701569 --- /dev/null +++ b/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap.go @@ -0,0 +1,25 @@ +package problem1053 + +func prevPermOpt1(A []int) []int { + n := len(A) + stack, top := make([]int, n), 0 + stack[top] = n - 1 + + for i := n - 2; i >= 0; i-- { + if A[i] <= A[stack[top]] { + top++ + stack[top] = i + continue + } + for top-1 >= 0 && + A[stack[top]] < A[stack[top-1]] && + A[stack[top-1]] < A[i] { + top-- + } + j := stack[top] + A[i], A[j] = A[j], A[i] + break + } + + return A +} diff --git a/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap_test.go b/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap_test.go new file mode 100755 index 000000000..1dc57a474 --- /dev/null +++ b/Algorithms/1053.previous-permutation-with-one-swap/previous-permutation-with-one-swap_test.go @@ -0,0 +1,57 @@ +package problem1053 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans []int +}{ + + { + []int{1, 1, 5}, + []int{1, 1, 5}, + }, + + { + []int{2, 1, 1}, + []int{1, 2, 1}, + }, + + { + []int{3, 2, 1}, + []int{3, 1, 2}, + }, + + { + []int{1, 9, 4, 6, 7}, + []int{1, 7, 4, 6, 9}, + }, + + { + []int{3, 1, 1, 3}, + []int{1, 3, 1, 3}, + }, + + // 可以有多个 testcase +} + +func Test_prevPermOpt1(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, prevPermOpt1(tc.A), "输入:%v", tc) + } +} + +func Benchmark_prevPermOpt1(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + prevPermOpt1(tc.A) + } + } +} diff --git a/Algorithms/1054.distant-barcodes/README.md b/Algorithms/1054.distant-barcodes/README.md new file mode 100755 index 000000000..38c5510bb --- /dev/null +++ b/Algorithms/1054.distant-barcodes/README.md @@ -0,0 +1,24 @@ +# [1054. Distant Barcodes](https://leetcode.com/problems/distant-barcodes/) + +In a warehouse, there is a row of barcodes, where the i-th barcode is barcodes[i]. + +Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists. + +Example 1: + +```text +Input: [1,1,1,2,2,2] +Output: [2,1,2,1,2,1] +``` + +Example 2: + +```text +Input: [1,1,1,1,2,2,3,3] +Output: [1,3,1,3,2,1,2,1] +``` + +Note: + +1. `1 <= barcodes.length <= 10000` +1. `1 <= barcodes[i] <= 10000` diff --git a/Algorithms/1054.distant-barcodes/distant-barcodes.go b/Algorithms/1054.distant-barcodes/distant-barcodes.go new file mode 100755 index 000000000..d976f23f7 --- /dev/null +++ b/Algorithms/1054.distant-barcodes/distant-barcodes.go @@ -0,0 +1,31 @@ +package problem1054 + +import "sort" + +func rearrangeBarcodes(A []int) []int { + n := len(A) + + count := [10001]int{} + for _, a := range A { + count[a]++ + } + + sort.Slice(A, func(i int, j int) bool { + if count[A[i]] == count[A[j]] { + return A[i] < A[j] + } + return count[A[i]] > count[A[j]] + }) + + res := make([]int, n) + i := 0 + for _, a := range A { + res[i] = a + i += 2 + if i >= n { + i = 1 + } + } + + return res +} diff --git a/Algorithms/1054.distant-barcodes/distant-barcodes_test.go b/Algorithms/1054.distant-barcodes/distant-barcodes_test.go new file mode 100755 index 000000000..50d0f7756 --- /dev/null +++ b/Algorithms/1054.distant-barcodes/distant-barcodes_test.go @@ -0,0 +1,59 @@ +package problem1054 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + barcodes []int +}{ + + { + []int{7, 7, 7, 8, 5, 7, 5, 5, 5, 8}, + }, + + { + []int{2, 2, 1, 3}, + }, + + { + []int{2, 1, 1}, + }, + + { + []int{1, 1, 1, 2, 2, 2}, + }, + + { + []int{1, 1, 1, 1, 2, 2, 3, 3}, + }, + + // 可以有多个 testcase +} + +func isDiff(A []int) bool { + for i := 1; i < len(A); i++ { + if A[i-1] == A[i] { + return false + } + } + return true +} + +func Test_rearrangeBarcodes(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + ast.True(isDiff(rearrangeBarcodes(tc.barcodes)), "输入:%v", tc) + } +} + +func Benchmark_rearrangeBarcodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + rearrangeBarcodes(tc.barcodes) + } + } +} diff --git a/Algorithms/1071.greatest-common-divisor-of-strings/README.md b/Algorithms/1071.greatest-common-divisor-of-strings/README.md new file mode 100755 index 000000000..c66ca16a5 --- /dev/null +++ b/Algorithms/1071.greatest-common-divisor-of-strings/README.md @@ -0,0 +1,32 @@ +# [1071. Greatest Common Divisor of Strings](https://leetcode.com/problems/greatest-common-divisor-of-strings/) + +For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or more times) + +Return the largest string X such that X divides str1 and X divides str2. + +Example 1: + +```text +Input: str1 = "ABCABC", str2 = "ABC" +Output: "ABC" +``` + +Example 2: + +```text +Input: str1 = "ABABAB", str2 = "ABAB" +Output: "AB" +``` + +Example 3: + +```text +Input: str1 = "LEET", str2 = "CODE" +Output: "" +``` + +Note: + +1. `1 <= str1.length <= 1000` +1. `1 <= str2.length <= 1000` +1. `str1[i] and str2[i] are English uppercase letters.` diff --git a/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings.go b/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings.go new file mode 100755 index 000000000..99929972b --- /dev/null +++ b/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings.go @@ -0,0 +1,36 @@ +package problem1071 + +import "strings" + +func gcdOfStrings(s1, s2 string) string { + l1, l2 := len(s1), len(s2) + d := gcd(max(l1, l2), min(l1, l2)) + p := s2[:d] + if s1 == strings.Repeat(p, l1/d) && + s2 == strings.Repeat(p, l2/d) { + return p + } + return "" +} + +// a >= b +func gcd(a, b int) int { + if b == 0 { + return a + } + return gcd(b, a%b) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings_test.go b/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings_test.go new file mode 100755 index 000000000..5282b94be --- /dev/null +++ b/Algorithms/1071.greatest-common-divisor-of-strings/greatest-common-divisor-of-strings_test.go @@ -0,0 +1,75 @@ +package problem1071 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + str1 string + str2 string + ans string +}{ + + { + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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+ }, + + { + "ABABAB", + "ABAB", + "AB", + }, + + { + "LEET", + "CODE", + "", + }, + + // 可以有多个 testcase +} + +func Test_gcdOfStrings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, gcdOfStrings(tc.str1, tc.str2), "输入:%v", tc) + } +} + +func Benchmark_gcdOfStrings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + gcdOfStrings(tc.str1, tc.str2) + } + } +} diff --git a/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/README.md b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/README.md new file mode 100755 index 000000000..264b55433 --- /dev/null +++ b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/README.md @@ -0,0 +1,36 @@ +# [1072. Flip Columns For Maximum Number of Equal Rows](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows/) + +Given a matrix consisting of 0s and 1s, we may choose any number of columns in the matrix and flip every cell in that column. Flipping a cell changes the value of that cell from 0 to 1 or from 1 to 0. + +Return the maximum number of rows that have all values equal after some number of flips. + +Example 1: + +```text +Input: [[0,1],[1,1]] +Output: 1 +Explanation: After flipping no values, 1 row has all values equal. +``` + +Example 2: + +```text +Input: [[0,1],[1,0]] +Output: 2 +Explanation: After flipping values in the first column, both rows have equal values. +``` + +Example 3: + +```text +Input: [[0,0,0],[0,0,1],[1,1,0]] +Output: 2 +Explanation: After flipping values in the first two columns, the last two rows have equal values. +``` + +Note: + +1. `1 <= matrix.length <= 300` +1. `1 <= matrix[i].length <= 300` +1. `All matrix[i].length's are equal` +1. `matrix[i][j] is 0 or 1` diff --git a/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.go b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.go new file mode 100755 index 000000000..b20c67935 --- /dev/null +++ b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows.go @@ -0,0 +1,31 @@ +package problem1072 + +import "strings" + +func maxEqualRowsAfterFlips(A [][]int) int { + count := make(map[string]int, 300) + var sb strings.Builder + for _, r := range A { + r0 := r[0] + for _, x := range r { + sb.WriteByte(byte(x ^ r0 + '0')) + } + count[sb.String()]++ + sb.Reset() + } + + res := 0 + + for _, c := range count { + res = max(res, c) + } + + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows_test.go b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows_test.go new file mode 100755 index 000000000..f6ec2d24d --- /dev/null +++ b/Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows/flip-columns-for-maximum-number-of-equal-rows_test.go @@ -0,0 +1,100 @@ +package problem1072 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + ans int +}{ + + { + [][]int{{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + 1, + }, + + { + [][]int{{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + 1, + }, + + { + [][]int{{0, 1}, {1, 1}}, + 1, + }, + + { + [][]int{{0, 1}, {1, 0}}, + 2, + }, + + { + [][]int{{0, 0, 1}, {1, 1, 0}, {0, 0, 0}}, + 2, + }, + + { + [][]int{{0, 0, 0}, {0, 0, 1}, {1, 1, 0}}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_maxEqualRowsAfterFlips(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxEqualRowsAfterFlips(tc.matrix), "输入:%v", tc) + } +} + +func Benchmark_maxEqualRowsAfterFlips(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxEqualRowsAfterFlips(tc.matrix) + } + } +} + +func Test_max(t *testing.T) { + type args struct { + a int + b int + } + tests := []struct { + name string + args args + want int + }{ + { + "a is bigger", + args{ + a: 1, + b: 0, + }, + 1, + }, + { + "b is bigger", + args{ + a: 1, + b: 2, + }, + 2, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := max(tt.args.a, tt.args.b); got != tt.want { + t.Errorf("max() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/Algorithms/1073.adding-two-negabinary-numbers/README.md b/Algorithms/1073.adding-two-negabinary-numbers/README.md new file mode 100755 index 000000000..48a121344 --- /dev/null +++ b/Algorithms/1073.adding-two-negabinary-numbers/README.md @@ -0,0 +1,23 @@ +# [1073. Adding Two Negabinary Numbers](https://leetcode.com/problems/adding-two-negabinary-numbers/) + +Given two numbers arr1 and arr2 in base -2, return the result of adding them together. + +Each number is given in array format: as an array of 0s and 1s, from most significant bit to least significant bit. For example, arr = [1,1,0,1] represents the number (-2)^3 + (-2)^2 + (-2)^0 = -3. A number arr in array format is also guaranteed to have no leading zeros: either arr == [0] or arr[0] == 1. + +Return the result of adding arr1 and arr2 in the same format: as an array of 0s and 1s with no leading zeros. + +Example 1: + +```text +Input: arr1 = [1,1,1,1,1], arr2 = [1,0,1] +Output: [1,0,0,0,0] +Explanation: arr1 represents 11, arr2 represents 5, the output represents 16. +``` + +Note: + +1. `1 <= arr1.length <= 1000` +1. `1 <= arr2.length <= 1000` +1. `arr1 and arr2 have no leading zeros` +1. `arr1[i] is 0 or 1` +1. `arr2[i] is 0 or 1` diff --git a/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers.go b/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers.go new file mode 100755 index 000000000..de035c93e --- /dev/null +++ b/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers.go @@ -0,0 +1,38 @@ +package problem1073 + +func addNegabinary(A, B []int) []int { + i, j := len(A)-1, len(B)-1 + res := make([]int, 0, i+j) + carry := 0 + for i >= 0 || j >= 0 || carry != 0 { + if i >= 0 { + carry += A[i] + i-- + } + if j >= 0 { + carry += B[j] + j-- + } + res = append(res, carry&1) + carry = -(carry >> 1) + } + + res = reverse(res) + + // cut leading zero + i, end := 0, len(res)-1 + for i < end && res[i] == 0 { + i++ + } + return res[i:] +} + +func reverse(A []int) []int { + i, j := 0, len(A)-1 + for i < j { + A[i], A[j] = A[j], A[i] + i++ + j-- + } + return A +} diff --git a/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers_test.go b/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers_test.go new file mode 100755 index 000000000..287ec39c9 --- /dev/null +++ b/Algorithms/1073.adding-two-negabinary-numbers/adding-two-negabinary-numbers_test.go @@ -0,0 +1,57 @@ +package problem1073 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr1 []int + arr2 []int + ans []int +}{ + + { + []int{1, 0, 0, 0, 0, 0, 0, 0}, + []int{1, 1, 0, 0, 0, 0, 0, 0, 0}, + []int{0}, + }, + + { + []int{1}, + []int{1, 1}, + []int{0}, + }, + + { + []int{1, 1, 1, 0, 1}, + []int{1, 0, 1}, + []int{1, 0, 1, 1, 0}, + }, + + { + []int{1, 1, 1, 1, 1}, + []int{1, 0, 1}, + []int{1, 0, 0, 0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_addNegabinary(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, addNegabinary(tc.arr1, tc.arr2), "输入:%v", tc) + } +} + +func Benchmark_addNegabinary(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + addNegabinary(tc.arr1, tc.arr2) + } + } +} diff --git a/Algorithms/1074.number-of-submatrices-that-sum-to-target/README.md b/Algorithms/1074.number-of-submatrices-that-sum-to-target/README.md new file mode 100755 index 000000000..e71735ea3 --- /dev/null +++ b/Algorithms/1074.number-of-submatrices-that-sum-to-target/README.md @@ -0,0 +1,30 @@ +# [1074. Number of Submatrices That Sum to Target](https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/) + +Given a matrix, and a target, return the number of non-empty submatrices that sum to target. + +A submatrix x1, y1, x2, y2 is the set of all cells matrix[x][y] with x1 <= x <= x2 and y1 <= y <= y2. + +Two submatrices (x1, y1, x2, y2) and (x1', y1', x2', y2') are different if they have some coordinate that is different: for example, if x1 != x1'. + +Example 1: + +```text +Input: matrix = [[0,1,0],[1,1,1],[0,1,0]], target = 0 +Output: 4 +Explanation: The four 1x1 submatrices that only contain 0. +``` + +Example 2: + +```text +Input: matrix = [[1,-1],[-1,1]], target = 0 +Output: 5 +Explanation: The two 1x2 submatrices, plus the two 2x1 submatrices, plus the 2x2 submatrix. +``` + +Note: + +1. `1 <= matrix.length <= 300` +1. `1 <= matrix[0].length <= 300` +1. `-1000 <= matrix[i] <= 1000` +1. `-10^8 <= target <= 10^8` diff --git a/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target.go b/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target.go new file mode 100755 index 000000000..052ca2755 --- /dev/null +++ b/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target.go @@ -0,0 +1,28 @@ +package problem1074 + +func numSubmatrixSumTarget(M [][]int, target int) int { + m, n := len(M), len(M[0]) + + S := [301][301]int{} + for i := 1; i <= m; i++ { + for j := 1; j <= n; j++ { + S[i][j] = S[i][j-1] + M[i-1][j-1] + } + } + + res := 0 + + for y1 := 0; y1 < n; y1++ { + for y2 := y1 + 1; y2 <= n; y2++ { + count := make(map[int]int, m) + sum := 0 + for x := 0; x <= m; x++ { + sum += S[x][y2] - S[x][y1] + res += count[sum-target] + count[sum]++ + } + } + } + + return res +} diff --git a/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target_test.go b/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target_test.go new file mode 100755 index 000000000..8635285d7 --- /dev/null +++ b/Algorithms/1074.number-of-submatrices-that-sum-to-target/number-of-submatrices-that-sum-to-target_test.go @@ -0,0 +1,152 @@ +package problem1074 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + matrix [][]int + target int + ans int +}{ + + { + [][]int{ + {1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 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, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0}, + {1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1}, + }, + 0, + 15691, + }, + + { + [][]int{{1, -1}, {-1, 1}}, + 0, + 5, + }, + + { + [][]int{{0, 1, 0}, {1, 1, 1}, {0, 1, 0}}, + 0, + 4, + }, + + // 可以有多个 testcase +} + +func Test_numSubmatrixSumTarget(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numSubmatrixSumTarget(tc.matrix, tc.target), "输入:%v", tc) + } +} + +func Benchmark_numSubmatrixSumTarget(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSubmatrixSumTarget(tc.matrix, tc.target) + } + } +} diff --git a/Algorithms/1078.occurrences-after-bigram/README.md b/Algorithms/1078.occurrences-after-bigram/README.md new file mode 100755 index 000000000..6049b7b03 --- /dev/null +++ b/Algorithms/1078.occurrences-after-bigram/README.md @@ -0,0 +1,26 @@ +# [1078. Occurrences After Bigram](https://leetcode.com/problems/occurrences-after-bigram/) + +Given words first and second, consider occurrences in some text of the form "first second third", where second comes immediately after first, and third comes immediately after second. + +For each such occurrence, add "third" to the answer, and return the answer. + +Example 1: + +```text +Input: text = "alice is a good girl she is a good student", first = "a", second = "good" +Output: ["girl","student"] +``` + +Example 2: + +```text +Input: text = "we will we will rock you", first = "we", second = "will" +Output: ["we","rock"] +``` + +Note: + +1. `1 <= text.length <= 1000` +1. `text consists of space separated words, where each word consists of lowercase English letters.` +1. `1 <= first.length, second.length <= 10` +1. `first and second consist of lowercase English letters.` diff --git a/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram.go b/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram.go new file mode 100755 index 000000000..8267aff9e --- /dev/null +++ b/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram.go @@ -0,0 +1,16 @@ +package problem1078 + +import "strings" + +func findOcurrences(text string, first string, second string) []string { + words := strings.Split(text, " ") + n := len(words) + res := make([]string, 0, n) + for i := 0; i+2 < n; i++ { + if words[i] == first && + words[i+1] == second { + res = append(res, words[i+2]) + } + } + return res +} diff --git a/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram_test.go b/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram_test.go new file mode 100755 index 000000000..a1fed2b4e --- /dev/null +++ b/Algorithms/1078.occurrences-after-bigram/occurrences-after-bigram_test.go @@ -0,0 +1,48 @@ +package problem1078 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + text string + first string + second string + ans []string +}{ + + { + "alice is a good girl she is a good student", + "a", + "good", + []string{"girl", "student"}, + }, + + { + "we will we will rock you", + "we", + "will", + []string{"we", "rock"}, + }, + + // 可以有多个 testcase +} + +func Test_findOcurrences(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, findOcurrences(tc.text, tc.first, tc.second), "输入:%v", tc) + } +} + +func Benchmark_findOcurrences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findOcurrences(tc.text, tc.first, tc.second) + } + } +} diff --git a/Algorithms/1079.letter-tile-possibilities/README.md b/Algorithms/1079.letter-tile-possibilities/README.md new file mode 100755 index 000000000..4628920ad --- /dev/null +++ b/Algorithms/1079.letter-tile-possibilities/README.md @@ -0,0 +1,23 @@ +# [1079. Letter Tile Possibilities](https://leetcode.com/problems/letter-tile-possibilities/) + +You have a set of tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty sequences of letters you can make. + +Example 1: + +```text +Input: "AAB" +Output: 8 +Explanation: The possible sequences are "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA". +``` + +Example 2: + +```text +Input: "AAABBC" +Output: 188 +``` + +Note: + +1. `1 <= tiles.length <= 7` +1. `tiles consists of uppercase English letters.` diff --git a/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities.go b/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities.go new file mode 100755 index 000000000..d7d0d96ab --- /dev/null +++ b/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities.go @@ -0,0 +1,25 @@ +package problem1079 + +func numTilePossibilities(tiles string) int { + count := [26]int{} + for _, t := range tiles { + count[t-'A']++ + } + + var dfs func() int + dfs = func() int { + sum := 0 + for i := 0; i < 26; i++ { + if count[i] == 0 { + continue + } + sum++ + count[i]-- + sum += dfs() + count[i]++ + } + return sum + } + + return dfs() +} diff --git a/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities_test.go b/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities_test.go new file mode 100755 index 000000000..20c1528fb --- /dev/null +++ b/Algorithms/1079.letter-tile-possibilities/letter-tile-possibilities_test.go @@ -0,0 +1,46 @@ +package problem1079 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + tiles string + ans int +}{ + + { + "ABCDEFG", + 13699, + }, + { + "AAB", + 8, + }, + + { + "AAABBC", + 188, + }, + + // 可以有多个 testcase +} + +func Test_numTilePossibilities(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numTilePossibilities(tc.tiles), "输入:%v", tc) + } +} + +func Benchmark_numTilePossibilities(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numTilePossibilities(tc.tiles) + } + } +} diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.input.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.input.png new file mode 100644 index 000000000..b2c4ad0c4 Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.input.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.output.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.output.png new file mode 100644 index 000000000..ec06a936b Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/1.output.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.input.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.input.png new file mode 100644 index 000000000..b6728d985 Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.input.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.output.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.output.png new file mode 100644 index 000000000..22afb59a2 Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/2.output.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.input.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.input.png new file mode 100644 index 000000000..21953a544 Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.input.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.output.png b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.output.png new file mode 100644 index 000000000..f504e9bac Binary files /dev/null and b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/3.output.png differ diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/README.md b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/README.md new file mode 100755 index 000000000..6fdf0ae09 --- /dev/null +++ b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/README.md @@ -0,0 +1,46 @@ +# [1080. Insufficient Nodes in Root to Leaf Paths](https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/) + +Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.) + +A node is insufficient if every such root to leaf path intersecting this node has sum strictly less than limit. + +Delete all insufficient nodes simultaneously, and return the root of the resulting binary tree. + +Example 1: + +![1.input](1.input.png) + +![1.output](1.output.png) + +```text +Input: root = [1,2,3,4,-99,-99,7,8,9,-99,-99,12,13,-99,14], limit = 1 +Output: [1,2,3,4,null,null,7,8,9,null,14] +``` + +Example 2: + +![2.input](2.input.png) + +![2.output](2.output.png) + +```text +Input: root = [5,4,8,11,null,17,4,7,1,null,null,5,3], limit = 22 +Output: [5,4,8,11,null,17,4,7,null,null,null,5] +``` + +Example 3: + +![3.input](3.input.png) + +![3.output](3.output.png) + +```text +Input: root = [1,2,-3,-5,null,4,null], limit = -1 +Output: [1,null,-3,4] +``` + +Note: + +1. `The given tree will have between 1 and 5000 nodes.` +1. `-10^5 <= node.val <= 10^5` +1. `-10^9 <= limit <= 10^9` diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths.go b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths.go new file mode 100755 index 000000000..24d7b63f9 --- /dev/null +++ b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths.go @@ -0,0 +1,32 @@ +package problem1080 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func sufficientSubset(root *TreeNode, limit int) *TreeNode { + if root == nil { + return nil + } + if root.Left == root.Right { // both nil + if root.Val < limit { + return nil + } + return root + } + limit -= root.Val + root.Left = sufficientSubset(root.Left, limit) + root.Right = sufficientSubset(root.Right, limit) + if root.Left == root.Right { // both nil + return nil + } + return root +} diff --git a/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths_test.go b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths_test.go new file mode 100755 index 000000000..500d7e446 --- /dev/null +++ b/Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths/insufficient-nodes-in-root-to-leaf-paths_test.go @@ -0,0 +1,60 @@ +package problem1080 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + limit int + ans []int +}{ + + { + []int{1, 2, -3, -5, kit.NULL, 4, kit.NULL}, + -1, + []int{1, kit.NULL, -3, 4}, + }, + + { + []int{1, 2, 3, 4, -99, -99, 7, 8, 9, -99, -99, 12, 13, -99, 14}, + 1, + []int{1, 2, 3, 4, kit.NULL, kit.NULL, 7, 8, 9, kit.NULL, 14}, + }, + + { + []int{5, 4, 8, 11, kit.NULL, 17, 4, 7, 1, kit.NULL, kit.NULL, 5, 3}, + 22, + []int{5, 4, 8, 11, kit.NULL, 17, 4, 7, kit.NULL, kit.NULL, kit.NULL, 5}, + }, + + { + []int{1, 2, -3, -5, kit.NULL, 4, kit.NULL}, + 100, + []int{}, + }, + + // 可以有多个 testcase +} + +func Test_sufficientSubset(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, kit.Tree2ints(sufficientSubset(root, tc.limit)), "输入:%v", tc) + } +} + +func Benchmark_sufficientSubset(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + sufficientSubset(root, tc.limit) + } + } +} diff --git a/Algorithms/1081.smallest-subsequence-of-distinct-characters/README.md b/Algorithms/1081.smallest-subsequence-of-distinct-characters/README.md new file mode 100755 index 000000000..8b5bfebe9 --- /dev/null +++ b/Algorithms/1081.smallest-subsequence-of-distinct-characters/README.md @@ -0,0 +1,36 @@ +# [1081. Smallest Subsequence of Distinct Characters](https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/) + +Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once. + +Example 1: + +```text +Input: "cdadabcc" +Output: "adbc" +``` + +Example 2: + +```text +Input: "abcd" +Output: "abcd" +``` + +Example 3: + +```text +Input: "ecbacba" +Output: "eacb" +``` + +Example 4: + +```text +Input: "leetcode" +Output: "letcod" +``` + +Note: + +1. `1 <= text.length <= 1000` +1. `text consists of lowercase English letters.` diff --git a/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters.go b/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters.go new file mode 100755 index 000000000..6be566f4b --- /dev/null +++ b/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters.go @@ -0,0 +1,39 @@ +package problem1081 + +import "strings" + +func smallestSubsequence(S string) string { + n := len(S) + + last := [26]int{} + for i, c := range S { + last[c-'a'] = i + } + + stack, top := make([]int, n), -1 + hasSeen := [26]bool{} + for i := 0; i < n; i++ { + c := int(S[i] - 'a') + if hasSeen[c] { + continue + } + for top >= 0 && + stack[top] > c && + i < last[stack[top]] { + pop := stack[top] + top-- + hasSeen[pop] = false + } + top++ + stack[top] = c + hasSeen[c] = true + } + + var sb strings.Builder + for i := 0; i <= top; i++ { + b := byte(stack[i] + 'a') + sb.WriteByte(b) + } + + return sb.String() +} diff --git a/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters_test.go b/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters_test.go new file mode 100755 index 000000000..a2ab7af1f --- /dev/null +++ b/Algorithms/1081.smallest-subsequence-of-distinct-characters/smallest-subsequence-of-distinct-characters_test.go @@ -0,0 +1,57 @@ +package problem1081 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + text string + ans string +}{ + + { + "fduxqmmeghmsrohvpclyjmhwwxipnvqxhfmgtqtcutsbjhbmuollkwocxxdmoswsnksdflwbxetsvbuvlwtxonpyhyrodjmdbvoopfxinkojyugqegbprgqxjpghojhymsoqpylrmelsonpqrtjmjgbgmmpqklfiiaacgurrbqtbqyylfqiefbrfyotiptqujknegwjiyqybldgomccdbiikfsfnqwcilblilfwcxyytnvdrppmcslildixlungoetlqvpvpwgmhqvwwjmllomtipfavbhbahclcfdyvgyqhpxebmtovgxqtjwdiwkqtvnlumwjgvubghkcjsvkrydpasdknkdclutjcqbretopqobivwfdkqkvmwkkufwnrngfgixlinerxcnrmsbiybcxmmndhhdrwykwmgckxqhlhnabppswwkxbjpvpeplcyyhcvhjulxvvgabddcurghjurledjdatsytdkqlfyrpnasrqiyecvjtkoiuigawvqfemwwnpkhapxvaqrlnncxdepunrnimqwcinnbnifvsjkwhufoawtbeghauvxiggajubybemfyeropjwvuhjrtiggsoaddpbgfcftppwnnlgnhbrdbhycslqlfkwdiswxntapahkpsyufkthkgmbvtmbnutyhrpjhotpndnldiugmmgxmtsdxqjojaqbedotgxlgaqyempwjlvtgifybqmxvcfbuonwivfhpqrmxfakrhjrsxovxgfwcteuadldgyghvcrjaaomwisvouyqqdmdbsbuvepcaxtkuqtsvqjbmejvptmbmbxasbxadvauepxicyjnydhmsvlohnnqoevhewwmxuqingvgbniqouikflimmxpuygutamkthmkydlwtvigyeutikpvnoqisehcgaylunxgwdvanwhsbjkukxahuviutenigfmkblniwdtqxxnswjoxhqqooaltrubgbqvqqdmdmrixidgukqx", + "abcdefghijklmnopqrstuvwxy", + }, + + { + "cdadabcc", + "adbc", + }, + + { + "abcd", + "abcd", + }, + + { + "ecbacba", + "eacb", + }, + + { + "leetcode", + "letcod", + }, + + // 可以有多个 testcase +} + +func Test_smallestSubsequence(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, smallestSubsequence(tc.text), "输入:%v", tc) + } +} + +func Benchmark_smallestSubsequence(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestSubsequence(tc.text) + } + } +} diff --git a/Algorithms/1089.duplicate-zeros/README.md b/Algorithms/1089.duplicate-zeros/README.md new file mode 100755 index 000000000..47ec664cf --- /dev/null +++ b/Algorithms/1089.duplicate-zeros/README.md @@ -0,0 +1,28 @@ +# [1089. Duplicate Zeros](https://leetcode.com/problems/duplicate-zeros/) + +Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. + +Note that elements beyond the length of the original array are not written. + +Do the above modifications to the input array in place, do not return anything from your function. + +Example 1: + +```text +Input: [1,0,2,3,0,4,5,0] +Output: null +Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4] +``` + +Example 2: + +```text +Input: [1,2,3] +Output: null +Explanation: After calling your function, the input array is modified to: [1,2,3] +``` + +Note: + +1. `1 <= arr.length <= 10000` +1. `0 <= arr[i] <= 9` diff --git a/Algorithms/1089.duplicate-zeros/duplicate-zeros.go b/Algorithms/1089.duplicate-zeros/duplicate-zeros.go new file mode 100755 index 000000000..b3d5b51f3 --- /dev/null +++ b/Algorithms/1089.duplicate-zeros/duplicate-zeros.go @@ -0,0 +1,29 @@ +package problem1089 + +func duplicateZeros(A []int) { + n := len(A) + // + count := 0 + for i := 0; i < n; i++ { + if A[i] == 0 { + count++ + } + } + // copy A[i] to A[j] + copy := func(i, j int) { + if j < n { + A[j] = A[i] + } + } + // + i, j := n-1, n+count-1 + for i < j { + copy(i, j) + if A[i] == 0 { + j-- + copy(i, j) + } + i-- + j-- + } +} diff --git a/Algorithms/1089.duplicate-zeros/duplicate-zeros_test.go b/Algorithms/1089.duplicate-zeros/duplicate-zeros_test.go new file mode 100755 index 000000000..a320ee76e --- /dev/null +++ b/Algorithms/1089.duplicate-zeros/duplicate-zeros_test.go @@ -0,0 +1,59 @@ +package problem1089 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans []int +}{ + + { + + []int{8, 4, 5, 0, 0, 0, 0, 7}, + []int{8, 4, 5, 0, 0, 0, 0, 0}, + }, + + { + []int{0, 0, 0, 0, 0, 0, 0, 0}, + []int{0, 0, 0, 0, 0, 0, 0, 0}, + }, + + { + []int{0, 0, 0, 0, 0, 0, 0}, + []int{0, 0, 0, 0, 0, 0, 0}, + }, + + { + []int{1, 0, 2, 3, 0, 4, 5, 0}, + []int{1, 0, 0, 2, 3, 0, 0, 4}, + }, + + { + []int{1, 2, 3}, + []int{1, 2, 3}, + }, + + // 可以有多个 testcase +} + +func Test_duplicateZeros(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + duplicateZeros(tc.arr) + ast.Equal(tc.ans, tc.arr, "输入:%v", tc) + } +} + +func Benchmark_duplicateZeros(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + duplicateZeros(tc.arr) + } + } +} diff --git a/Algorithms/1090.largest-values-from-labels/README.md b/Algorithms/1090.largest-values-from-labels/README.md new file mode 100755 index 000000000..8e1c8d2bc --- /dev/null +++ b/Algorithms/1090.largest-values-from-labels/README.md @@ -0,0 +1,48 @@ +# [1090. Largest Values From Labels](https://leetcode.com/problems/largest-values-from-labels/) + +We have a set of items: the i-th item has value values[i] and label labels[i]. + +Then, we choose a subset S of these items, such that: + +- |S| <= num_wanted +- For every label L, the number of items in S with label L is <= use_limit. + +Return the largest possible sum of the subset S. + +Example 1: + +```text +Input: values = [5,4,3,2,1], labels = [1,1,2,2,3], num_wanted = 3, use_limit = 1 +Output: 9 +Explanation: The subset chosen is the first, third, and fifth item. +``` + +Example 2: + +```text +Input: values = [5,4,3,2,1], labels = [1,3,3,3,2], num_wanted = 3, use_limit = 2 +Output: 12 +Explanation: The subset chosen is the first, second, and third item. +``` + +Example 3: + +```text +Input: values = [9,8,8,7,6], labels = [0,0,0,1,1], num_wanted = 3, use_limit = 1 +Output: 16 +Explanation: The subset chosen is the first and fourth item. +``` + +Example 4: + +```text +Input: values = [9,8,8,7,6], labels = [0,0,0,1,1], num_wanted = 3, use_limit = 2 +Output: 24 +Explanation: The subset chosen is the first, second, and fourth item. +``` + +Note: + +1. `1 <= values.length == labels.length <= 20000` +1. `0 <= values[i], labels[i] <= 20000` +1. `1 <= num_wanted, use_limit <= values.length` diff --git a/Algorithms/1090.largest-values-from-labels/largest-values-from-labels.go b/Algorithms/1090.largest-values-from-labels/largest-values-from-labels.go new file mode 100755 index 000000000..01d937a95 --- /dev/null +++ b/Algorithms/1090.largest-values-from-labels/largest-values-from-labels.go @@ -0,0 +1,29 @@ +package problem1090 + +import "sort" + +func largestValsFromLabels(values []int, labels []int, num_wanted int, use_limit int) int { + for i, v := range values { + values[i] = v<<16 + labels[i] + } + + sort.Slice(values, func(i int, j int) bool { + return values[i] > values[j] + }) + + count := [20001]int{} + res := 0 + for _, v := range values { + if count[v&0xFFFF] == use_limit { + continue + } + res += v >> 16 + count[v&0xFFFF]++ + num_wanted-- + if num_wanted == 0 { + break + } + } + + return res +} diff --git a/Algorithms/1090.largest-values-from-labels/largest-values-from-labels_test.go b/Algorithms/1090.largest-values-from-labels/largest-values-from-labels_test.go new file mode 100755 index 000000000..d334fa9a0 --- /dev/null +++ b/Algorithms/1090.largest-values-from-labels/largest-values-from-labels_test.go @@ -0,0 +1,67 @@ +package problem1090 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + values []int + labels []int + num_wanted int + use_limit int + ans int +}{ + + { + []int{5, 4, 3, 2, 1}, + []int{1, 1, 2, 2, 3}, + 3, + 1, + 9, + }, + + { + []int{5, 4, 3, 2, 1}, + []int{1, 3, 3, 3, 2}, + 3, + 2, + 12, + }, + + { + []int{9, 8, 8, 7, 6}, + []int{0, 0, 0, 1, 1}, + 3, + 1, + 16, + }, + + { + []int{9, 8, 8, 7, 6}, + []int{0, 0, 0, 1, 1}, + 3, + 2, + 24, + }, + + // 可以有多个 testcase +} + +func Test_largestValsFromLabels(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largestValsFromLabels(tc.values, tc.labels, tc.num_wanted, tc.use_limit), "输入:%v", tc) + } +} + +func Benchmark_largestValsFromLabels(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largestValsFromLabels(tc.values, tc.labels, tc.num_wanted, tc.use_limit) + } + } +} diff --git a/Algorithms/1091.shortest-path-in-binary-matrix/README.md b/Algorithms/1091.shortest-path-in-binary-matrix/README.md new file mode 100755 index 000000000..ee445c64e --- /dev/null +++ b/Algorithms/1091.shortest-path-in-binary-matrix/README.md @@ -0,0 +1,31 @@ +# [1091. Shortest Path in Binary Matrix](https://leetcode.com/problems/shortest-path-in-binary-matrix/) + +In an N by N square grid, each cell is either empty (0) or blocked (1). + +A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that: + +- Adjacent cells C_i and C_{i+1} are connected 8-directionally (ie., they are different and share an edge or corner) +- C_1 is at location (0, 0) (ie. has value grid[0][0]) +- C_k is at location (N-1, N-1) (ie. has value grid[N-1][N-1]) +- If C_i is located at (r, c), then grid[r][c] is empty (ie. grid[r][c] == 0). + +Return the length of the shortest such clear path from top-left to bottom-right. If such a path does not exist, return -1. + +Example 1: + +```text +Input: [[0,1],[1,0]] +Output: 2 +``` + +Example 2: + +```text +Input: [[0,0,0],[1,1,0],[1,1,0]] +Output: 4 +``` + +Note: + +1. `1 <= grid.length == grid[0].length <= 100` +2. `grid[r][c] is 0 or 1` diff --git a/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix.go b/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix.go new file mode 100755 index 000000000..d74666772 --- /dev/null +++ b/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix.go @@ -0,0 +1,41 @@ +package problem1091 + +var dx = []int{-1, -1, -1, 0, 1, 1, 1, 0} +var dy = []int{-1, 0, 1, 1, 1, 0, -1, -1} + +func shortestPathBinaryMatrix(grid [][]int) int { + if grid[0][0] == 1 { + return -1 + } + + N := len(grid) + + cells := make([][2]int, 1, N*N) + grid[0][0] = 1 + length := 1 + + for len(cells) > 0 { + size := len(cells) + for s := 0; s < size; s++ { + c := cells[s] + x, y := c[0], c[1] + if x == N-1 && y == N-1 { + return length + } + for k := 0; k < 8; k++ { + i, j := x+dx[k], y+dy[k] + if i < 0 || N <= i || + j < 0 || N <= j || + grid[i][j] == 1 { + continue + } + cells = append(cells, [2]int{i, j}) + grid[i][j] = 1 + } + } + length++ + cells = cells[size:] + } + + return -1 +} diff --git a/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix_test.go b/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix_test.go new file mode 100755 index 000000000..ea6ea9e4a --- /dev/null +++ b/Algorithms/1091.shortest-path-in-binary-matrix/shortest-path-in-binary-matrix_test.go @@ -0,0 +1,52 @@ +package problem1091 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{1, 0, 0}, {1, 1, 0}, {1, 1, 0}}, + -1, + }, + + { + [][]int{{0, 1}, {1, 0}}, + 2, + }, + + { + [][]int{{0, 1, 0}, {1, 1, 0}, {1, 1, 0}}, + -1, + }, + + { + [][]int{{0, 0, 0}, {1, 1, 0}, {1, 1, 0}}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_shortestPathBinaryMatrix(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, shortestPathBinaryMatrix(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_shortestPathBinaryMatrix(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestPathBinaryMatrix(tc.grid) + } + } +} diff --git a/Algorithms/1092.shortest-common-supersequence/README.md b/Algorithms/1092.shortest-common-supersequence/README.md new file mode 100755 index 000000000..5acbbe009 --- /dev/null +++ b/Algorithms/1092.shortest-common-supersequence/README.md @@ -0,0 +1,21 @@ +# [1092. Shortest Common Supersequence](https://leetcode.com/problems/shortest-common-supersequence/) + +Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If multiple answers exist, you may return any of them. + +(A string S is a subsequence of string T if deleting some number of characters from T (possibly 0, and the characters are chosen anywhere from T) results in the string S.) + +Example 1: + +```text +Input: str1 = "abac", str2 = "cab" +Output: "cabac" +Explanation: +str1 = "abac" is a substring of "cabac" because we can delete the first "c". +str2 = "cab" is a substring of "cabac" because we can delete the last "ac". +The answer provided is the shortest such string that satisfies these properties. +``` + +Note: + +1. `1 <= str1.length, str2.length <= 1000` +1. `str1 and str2 consist of lowercase English letters.` diff --git a/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence.go b/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence.go new file mode 100755 index 000000000..86c6404f4 --- /dev/null +++ b/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence.go @@ -0,0 +1,64 @@ +package problem1092 + +import "strings" + +func shortestCommonSupersequence(A, B string) string { + m, n := len(A), len(B) + // 解题思路, + // 先求出 A 和 B 的 LCS, + // 然后,在 LCS 上添加缺少的字母 + // 利用 dp 求解 LCS , + // dp[i][j]=k 表示 A[:i] 与 B[:j] 的 LCS 的长度为 k + // 在递归过程中,会出现三种情况: + // 1. A[i]=B[j], 则 dp[i][j]= dp[i-1][j-1]+1 + // 2. A[i]!=B[j] 且 dp[i-1][j] >= dp[i][j-1],则 dp[i][j]=dp[i-1][j] + // 3. A[i]!=B[j] 且 dp[i-1][j] < dp[i][j-1],则 dp[i][j]=dp[i][j+1] + + dp := [1001][1001]int{} + b := [1001][1001]int{} // 记录哪种情况发生了,以便添加字母 + + for i := 1; i <= m; i++ { + for j := 1; j <= n; j++ { + if A[i-1] == B[j-1] { + dp[i][j] = dp[i-1][j-1] + 1 + b[i][j] = 1 + } else if dp[i-1][j] >= dp[i][j-1] { + dp[i][j] = dp[i-1][j] + b[i][j] = 2 + } else { + dp[i][j] = dp[i][j-1] + b[i][j] = 3 + } + } + } + + var sb strings.Builder + var dfs func(int, int) + dfs = func(i, j int) { + if i == 0 { + sb.WriteString(B[:j]) + return + } + + if j == 0 { + sb.WriteString(A[:i]) + return + } + + switch b[i][j] { + case 1: + dfs(i-1, j-1) + sb.WriteByte(A[i-1]) + case 2: + dfs(i-1, j) + sb.WriteByte(A[i-1]) + case 3: + dfs(i, j-1) + sb.WriteByte(B[j-1]) + } + } + + dfs(m, n) + + return sb.String() +} diff --git a/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence_test.go b/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence_test.go new file mode 100755 index 000000000..3bd4038a8 --- /dev/null +++ b/Algorithms/1092.shortest-common-supersequence/shortest-common-supersequence_test.go @@ -0,0 +1,51 @@ +package problem1092 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + str1 string + str2 string + ans string +}{ + + { + "abaa", + "aaaa", + "aabaa", + }, + + { + "cab", + "abac", + "cabac", + }, + + { + "abac", + "cab", + "cabac", + }, + + // 可以有多个 testcase +} + +func Test_shortestCommonSupersequence(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, shortestCommonSupersequence(tc.str1, tc.str2), "输入:%v", tc) + } +} + +func Benchmark_shortestCommonSupersequence(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestCommonSupersequence(tc.str1, tc.str2) + } + } +} diff --git a/Algorithms/1093.statistics-from-a-large-sample/README.md b/Algorithms/1093.statistics-from-a-large-sample/README.md new file mode 100755 index 000000000..0b86349a9 --- /dev/null +++ b/Algorithms/1093.statistics-from-a-large-sample/README.md @@ -0,0 +1,31 @@ +# [1093. Statistics from a Large Sample](https://leetcode.com/problems/statistics-from-a-large-sample/) + +We sampled integers between 0 and 255, and stored the results in an array count: count[k] is the number of integers we sampled equal to k. + +Return the minimum, maximum, mean, median, and mode of the sample respectively, as an array of floating point numbers. The mode is guaranteed to be unique. + +(Recall that the median of a sample is: + +- The middle element, if the elements of the sample were sorted and the number of elements is odd; +- The average of the middle two elements, if the elements of the sample were sorted and the number of elements is even.) + +Example 1: + +```text +Input: count = [0,1,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +Output: [1.00000,3.00000,2.37500,2.50000,3.00000] +``` + +Example 2: + +```text +Input: count = [0,4,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +Output: [1.00000,4.00000,2.18182,2.00000,1.00000] +``` + +Constraints: + +1. `count.length == 256` +1. `1 <= sum(count) <= 10^9` +1. `The mode of the sample that count represents is unique.` +1. `Answers within 10^-5 of the true value will be accepted as correct.` diff --git a/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample.go b/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample.go new file mode 100755 index 000000000..c93b75726 --- /dev/null +++ b/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample.go @@ -0,0 +1,86 @@ +package problem1093 + +import "sort" + +func sampleStats(count []int) []float64 { + return []float64{ + minimum(count), + maximum(count), + mean(count), + median(count), + mode(count), + } +} + +// minimum:最小值 +func minimum(count []int) float64 { + i := 0 + for ; i < len(count); i++ { + if count[i] != 0 { + break + } + } + return float64(i) +} + +// maximum:最大值 +func maximum(count []int) float64 { + i := len(count) - 1 + for ; i >= 0; i-- { + if count[i] != 0 { + break + } + } + return float64(i) +} + +// mean :平均数 +func mean(count []int) float64 { + sum, c := 0, 0 + for i := 0; i < len(count); i++ { + if count[i] == 0 { + continue + } + sum += i * count[i] + c += count[i] + } + return float64(sum) / float64(c) +} + +// median :中位数,排序后,位于正中间的数。 +func median(count []int) float64 { + k := make([]int, 0, 256) + c := make([]int, 0, 256) + sum := 0 + for i := 0; i < len(count); i++ { + if count[i] == 0 { + continue + } + sum += count[i] + k = append(k, i) + c = append(c, sum) + } + if sum%2 == 1 { + h := sum/2 + 1 + i := sort.SearchInts(c, h) + return float64(k[i]) + } + h := sum / 2 + i := sort.SearchInts(c, h) + j := sort.SearchInts(c, h+1) + return float64(k[i]+k[j]) / 2 +} + +// mode :出现次数最多的数 +func mode(count []int) float64 { + k, c := -1, -1 + for i := 0; i < len(count); i++ { + if count[i] == 0 { + continue + } + if c < count[i] { + k, c = i, count[i] + } + } + return float64(k) +} diff --git a/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample_test.go b/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample_test.go new file mode 100755 index 000000000..8a8addc94 --- /dev/null +++ b/Algorithms/1093.statistics-from-a-large-sample/statistics-from-a-large-sample_test.go @@ -0,0 +1,48 @@ +package problem1093 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + count []int + ans []float64 +}{ + + { + []int{2725123, 2529890, 2612115, 3807943, 3002363, 3107290, 2767526, 981092, 896521, 2576757, 2808163, 3315813, 2004022, 2516900, 607052, 1203189, 2907162, 1849193, 1486120, 743035, 3621726, 3366475, 639843, 3836904, 462733, 2614577, 1881392, 85099, 709390, 3534613, 360309, 404975, 715871, 2258745, 1682843, 3725079, 564127, 1893839, 2793387, 2236577, 522108, 1183512, 859756, 3431566, 907265, 1272267, 2261055, 2234764, 1901434, 3023329, 863353, 2140290, 2221702, 623198, 955635, 304443, 282157, 3133971, 1985993, 1113476, 2092502, 2896781, 1245030, 2681380, 2286852, 3423914, 3549428, 2720176, 2832468, 3608887, 174642, 1437770, 1545228, 650920, 2357584, 3037465, 3674038, 2450617, 578392, 622803, 3206006, 3685232, 2687252, 1001246, 3865843, 2755767, 184888, 2543886, 2567950, 1755006, 249516, 3241670, 1422728, 809805, 955992, 415481, 26094, 2757283, 995334, 3713918, 2772540, 2719728, 1204666, 1590541, 2962447, 779517, 1322374, 1675147, 3146304, 2412486, 902468, 259007, 3161334, 1735554, 2623893, 1863961, 520352, 167827, 3654335, 3492218, 1449347, 1460253, 983079, 1135, 208617, 969433, 2669769, 284741, 1002734, 3694338, 2567646, 3042965, 3186843, 906766, 2755956, 2075889, 1241484, 3790012, 2037406, 2776032, 1123633, 2537866, 3028339, 3375304, 1621954, 2299012, 1518828, 1380554, 2083623, 3521053, 1291275, 180303, 1344232, 2122185, 2519290, 832389, 1711223, 2828198, 2747583, 789884, 2116590, 2294299, 1038729, 1996529, 600580, 184130, 3044375, 261274, 3041086, 3473202, 2318793, 2967147, 2506188, 127448, 290011, 3868450, 1659949, 3662189, 1720152, 25266, 1126602, 1015878, 2635566, 619797, 2898869, 3470795, 2226675, 2348104, 2914940, 1907109, 604482, 2574752, 1841777, 880254, 616721, 3786049, 2278898, 3797514, 1328854, 1881493, 1802018, 3034791, 3615171, 400080, 2277949, 221689, 1021253, 544372, 3101480, 1155691, 3730276, 1827138, 3621214, 2348383, 2305429, 313820, 36481, 2581470, 2794393, 902504, 2589859, 740480, 2387513, 2716342, 1914543, 3219912, 1865333, 2388350, 3525289, 3758988, 961406, 1539328, 448809, 1326527, 1339048, 2924378, 2715811, 376047, 3642811, 2973602, 389167, 1026011, 3633833, 2848596, 3353421, 1426817, 219995, 1503946, 2311246, 2618861, 1497325, 3758762, 2115273, 3238053, 2419849, 2545790}, + []float64{0, 255, 128.64187, 131, 175}, + }, + + { + []int{0, 1, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + []float64{1.00000, 4.00000, 2.18182, 2.00000, 1.00000}, + }, + + // 可以有多个 testcase +} + +func Test_sampleStats(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ans := sampleStats(tc.count) + ast.InDeltaSlice(tc.ans, ans, 0.00001, "输入:%v", tc) + } +} + +func Benchmark_sampleStats(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + sampleStats(tc.count) + } + } +} diff --git a/Algorithms/1094.car-pooling/README.md b/Algorithms/1094.car-pooling/README.md new file mode 100755 index 000000000..5a2d83522 --- /dev/null +++ b/Algorithms/1094.car-pooling/README.md @@ -0,0 +1,43 @@ +# [1094. Car Pooling](https://leetcode.com/problems/car-pooling/) + +You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around and drive west.) + +Given a list of trips, trip[i] = [num_passengers, start_location, end_location] contains information about the i-th trip: the number of passengers that must be picked up, and the locations to pick them up and drop them off. The locations are given as the number of kilometers due east from your vehicle's initial location. + +Return true if and only if it is possible to pick up and drop off all passengers for all the given trips. + +Example 1: + +```text +Input: trips = [[2,1,5],[3,3,7]], capacity = 4 +Output: false +``` + +Example 2: + +```text +Input: trips = [[2,1,5],[3,3,7]], capacity = 5 +Output: true +``` + +Example 3: + +```text +Input: trips = [[2,1,5],[3,5,7]], capacity = 3 +Output: true +``` + +Example 4: + +```text +Input: trips = [[3,2,7],[3,7,9],[8,3,9]], capacity = 11 +Output: true +``` + +Constraints: + +1. `trips.length <= 1000` +1. `trips[i].length == 3` +1. `1 <= trips[i][0] <= 100` +1. `0 <= trips[i][1] < trips[i][2] <= 1000` +1. `1 <= capacity <= 100000` diff --git a/Algorithms/1094.car-pooling/car-pooling.go b/Algorithms/1094.car-pooling/car-pooling.go new file mode 100755 index 000000000..c5254f4c5 --- /dev/null +++ b/Algorithms/1094.car-pooling/car-pooling.go @@ -0,0 +1,19 @@ +package problem1094 + +func carPooling(trips [][]int, capacity int) bool { + location := [1001]int{} + for _, t := range trips { + num, start, end := t[0], t[1], t[2] + location[start] += num + location[end] -= num + } + + p := 0 + for _, c := range location { + p += c + if p > capacity { + return false + } + } + return true +} diff --git a/Algorithms/1094.car-pooling/car-pooling_test.go b/Algorithms/1094.car-pooling/car-pooling_test.go new file mode 100755 index 000000000..579a95bee --- /dev/null +++ b/Algorithms/1094.car-pooling/car-pooling_test.go @@ -0,0 +1,57 @@ +package problem1094 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + trips [][]int + capacity int + ans bool +}{ + + { + [][]int{{2, 1, 5}, {3, 3, 7}}, + 4, + false, + }, + + { + [][]int{{2, 1, 5}, {3, 3, 7}}, + 5, + true, + }, + + { + [][]int{{2, 1, 5}, {3, 5, 7}}, + 3, + true, + }, + + { + [][]int{{3, 2, 7}, {3, 7, 9}, {8, 3, 9}}, + 11, + true, + }, + + // 可以有多个 testcase +} + +func Test_carPooling(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, carPooling(tc.trips, tc.capacity), "输入:%v", tc) + } +} + +func Benchmark_carPooling(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + carPooling(tc.trips, tc.capacity) + } + } +} diff --git a/Algorithms/1095.find-in-mountain-array/README.md b/Algorithms/1095.find-in-mountain-array/README.md new file mode 100755 index 000000000..fc5694978 --- /dev/null +++ b/Algorithms/1095.find-in-mountain-array/README.md @@ -0,0 +1,41 @@ +# [1095. Find in Mountain Array](https://leetcode.com/problems/find-in-mountain-array/) + +(This problem is an interactive problem.) + +You may recall that an array A is a mountain array if and only if: + +- A.length >= 3 +- There exists some i with 0 < i < A.length - 1 such that: + - A[0] < A[1] < ... A[i-1] < A[i] + - A[i] > A[i+1] > ... > A[A.length - 1] + +Given a mountain array mountainArr, return the minimum index such that mountainArr.get(index) == target. If such an index doesn't exist, return -1. + +You can't access the mountain array directly. You may only access the array using a MountainArray interface: + +- MountainArray.get(k) returns the element of the array at index k (0-indexed). +- MountainArray.length() returns the length of the array. + +Submissions making more than 100 calls to MountainArray.get will be judged Wrong Answer. Also, any solutions that attempt to circumvent the judge will result in disqualification. + +Example 1: + +```text +Input: array = [1,2,3,4,5,3,1], target = 3 +Output: 2 +Explanation: 3 exists in the array, at index=2 and index=5. Return the minimum index, which is 2. +``` + +Example 2: + +```text +Input: array = [0,1,2,4,2,1], target = 3 +Output: -1 +Explanation: 3 does not exist in the array, so we return -1. +``` + +Constraints: + +1. `3 <= mountain_arr.length() <= 10000` +1. `0 <= target <= 10^9` +1. `0 <= mountain_arr.get(index) <= 10^9` diff --git a/Algorithms/1095.find-in-mountain-array/find-in-mountain-array.go b/Algorithms/1095.find-in-mountain-array/find-in-mountain-array.go new file mode 100755 index 000000000..41c8b4b70 --- /dev/null +++ b/Algorithms/1095.find-in-mountain-array/find-in-mountain-array.go @@ -0,0 +1,74 @@ +package problem1095 + +// MountainArray is required +type MountainArray []int + +func (m *MountainArray) get(index int) int { + return (*m)[index] +} +func (m *MountainArray) length() int { + return len(*m) +} + +/** + * This is the MountainArray's API interface. + * You should not implement it, or speculate about its implementation + * type MountainArray struct { + * } + * + * func (this *MountainArray) get(index int) int {} + * func (this *MountainArray) length() int {} + */ + +func findInMountainArray(target int, ma *MountainArray) int { + n := ma.length() + + peak := searchPeak(0, n-1, ma) + + index := searchLeft(0, peak, target, ma) + if index != -1 { + return index + } + return searchRight(peak, n-1, target, ma) +} + +func searchPeak(lo, hi int, ma *MountainArray) int { + for lo < hi { + mid := (lo + hi - 1) / 2 + if ma.get(mid) < ma.get(mid+1) { + lo = mid + 1 + } else { + hi = mid + } + } + return lo +} + +func searchLeft(lo, hi, target int, ma *MountainArray) int { + less := func(a, b int) bool { + return a < b + } + return binarySearch(lo, hi, target, ma, less) +} + +func searchRight(lo, hi, target int, ma *MountainArray) int { + less := func(a, b int) bool { + return a > b + } + return binarySearch(lo, hi, target, ma, less) +} + +func binarySearch(lo, hi, target int, ma *MountainArray, less func(a, b int) bool) int { + for lo <= hi { + mid := (lo + hi) / 2 + m := ma.get(mid) + if m == target { + return mid + } else if less(m, target) { + lo = mid + 1 + } else { + hi = mid - 1 + } + } + return -1 +} diff --git a/Algorithms/1095.find-in-mountain-array/find-in-mountain-array_test.go b/Algorithms/1095.find-in-mountain-array/find-in-mountain-array_test.go new file mode 100755 index 000000000..75f0675f6 --- /dev/null +++ b/Algorithms/1095.find-in-mountain-array/find-in-mountain-array_test.go @@ -0,0 +1,59 @@ +package problem1095 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + target int + mountainArr []int + ans int +}{ + + { + 2, + []int{1, 5, 2}, + 2, + }, + + { + 2, + []int{1, 2, 3, 4, 5, 3, 1}, + 1, + }, + + { + 3, + []int{1, 2, 3, 4, 5, 3, 1}, + 2, + }, + + { + 3, + []int{0, 1, 2, 4, 2, 1}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_findInMountainArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + m := MountainArray(tc.mountainArr) + ast.Equal(tc.ans, findInMountainArray(tc.target, &m), "输入:%v", tc) + } +} + +func Benchmark_findInMountainArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + m := MountainArray(tc.mountainArr) + findInMountainArray(tc.target, &m) + } + } +} diff --git a/Algorithms/1096.brace-expansion-ii/README.md b/Algorithms/1096.brace-expansion-ii/README.md new file mode 100755 index 000000000..e13b35fca --- /dev/null +++ b/Algorithms/1096.brace-expansion-ii/README.md @@ -0,0 +1,44 @@ +# [1096. Brace Expansion II](https://leetcode.com/problems/brace-expansion-ii/) + +Under a grammar given below, strings can represent a set of lowercase words. Let's use R(expr) to denote the set of words the expression represents. + +Grammar can best be understood through simple examples: + +- Single letters represent a singleton set containing that word. + - R("a") = {"a"} + - R("w") = {"w"} +- When we take a comma delimited list of 2 or more expressions, we take the union of possibilities. + - R("{a,b,c}") = {"a","b","c"} + - R("{{a,b},{b,c}}") = {"a","b","c"} (notice the final set only contains each word at most once) +- When we concatenate two expressions, we take the set of possible concatenations between two words where the first word comes from the first expression and the second word comes from the second expression. + - R("{a,b}{c,d}") = {"ac","ad","bc","bd"} + - R("a{b,c}{d,e}f{g,h}") = {"abdfg", "abdfh", "abefg", "abefh", "acdfg", "acdfh", "acefg", "acefh"} + +Formally, the 3 rules for our grammar: + +- For every lowercase letter x, we have R(x) = {x} +- For expressions e_1, e_2, ... , e_k with k >= 2, we have R({e_1,e_2,...}) = R(e_1) ∪ R(e_2) ∪ ... +- For expressions e_1 and e_2, we have R(e_1 + e_2) = {a + b for (a, b) in R(e_1) × R(e_2)}, where + denotes concatenation, and × denotes the cartesian product. + +Given an expression representing a set of words under the given grammar, return the sorted list of words that the expression represents. + +Example 1: + +```text +Input: "{a,b}{c,{d,e}}" +Output: ["ac","ad","ae","bc","bd","be"] +``` + +Example 2: + +```text +Input: "{{a,z},a{b,c},{ab,z}}" +Output: ["a","ab","ac","z"] +Explanation: Each distinct word is written only once in the final answer. +``` + +Constraints: + +1. `1 <= expression.length <= 50` +1. `expression[i] consists of '{', '}', ','or lowercase English letters.` +1. `The given expression represents a set of words based on the grammar given in the description.` diff --git a/Algorithms/1096.brace-expansion-ii/brace-expansion-ii.go b/Algorithms/1096.brace-expansion-ii/brace-expansion-ii.go new file mode 100755 index 000000000..cd0d38a00 --- /dev/null +++ b/Algorithms/1096.brace-expansion-ii/brace-expansion-ii.go @@ -0,0 +1,141 @@ +package problem1096 + +import ( + "sort" + "strings" +) + +func braceExpansionII(exp string) []string { + n := len(exp) + + bytes := make([]byte, 1, n*2) + bytes[0] = exp[0] + pre := exp[0] + for i := 1; i < n; i++ { + cur := exp[i] + // add '*' symbol + if (isLetter(pre) && cur == '{') || + (pre == '}' && cur == '{') || + (pre == '}' && isLetter(cur)) { + bytes = append(bytes, '*') + } + // replace ',' with '+' symbol + if cur == ',' { + bytes = append(bytes, '+') + } else { + bytes = append(bytes, cur) + } + pre = cur + } + exp = string(bytes) + + return unique(doAdd(exp)) +} + +func isLetter(r byte) bool { + return 'a' <= r && r <= 'z' +} + +// split exp with symbol NOT in braces +// because braces change priority +func split(exp string, symbol byte) []string { + exp = removeOuterBrace(exp) + count := 0 + isInBraces := func() bool { + return count > 0 + } + bytes := []byte(exp) + for i, b := range bytes { + switch b { + case '{': + count++ + case '}': + count-- + case symbol: + if !isInBraces() { + bytes[i] = '@' + } + } + } + exp = string(bytes) + return strings.Split(exp, "@") +} + +func doAdd(exp string) []string { + if !strings.ContainsRune(exp, '*') { + exp = removeAllBraces(exp) + return strings.Split(exp, "+") + } + exps := split(exp, '+') + res := []string{} + for _, e := range exps { + res = add(res, doMultiply(e)) + } + return res +} + +func doMultiply(exp string) []string { + if !strings.ContainsRune(exp, '+') { + exp = removeAllBraces(exp) + exp = strings.Replace(exp, "*", "", -1) + return []string{exp} + } + exps := split(exp, '*') + res := []string{""} + for _, e := range exps { + res = multiply(res, doAdd(e)) + } + return res +} + +func removeAllBraces(exp string) string { + exp = strings.Replace(exp, "{", "", -1) + return strings.Replace(exp, "}", "", -1) +} + +func removeOuterBrace(exp string) string { + n := len(exp) + if exp[0] != '{' || + exp[n-1] != '}' { + return exp + } + count, i := 1, 1 + for ; i < n && count > 0; i++ { + if exp[i] == '{' { + count++ + } else if exp[i] == '}' { + count-- + } + } + if i == n { + return exp[1 : n-1] + } + return exp +} + +func add(A, B []string) []string { + return append(A, B...) +} + +func multiply(A, B []string) []string { + res := make([]string, 0, len(A)*len(B)) + for _, a := range A { + for _, b := range B { + res = append(res, a+b) + } + } + return res +} + +func unique(A []string) []string { + sort.Strings(A) + i, j, n := 0, 0, len(A) + for j < n { + if A[i] != A[j] { + i++ + A[i] = A[j] + } + j++ + } + return A[:i+1] +} diff --git a/Algorithms/1096.brace-expansion-ii/brace-expansion-ii_test.go b/Algorithms/1096.brace-expansion-ii/brace-expansion-ii_test.go new file mode 100755 index 000000000..fab62ffd2 --- /dev/null +++ b/Algorithms/1096.brace-expansion-ii/brace-expansion-ii_test.go @@ -0,0 +1,87 @@ +package problem1096 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + expression string + ans []string +}{ + + { + "{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}", + []string{"aaaaaaaaaa", "aaaaaaaaab", "aaaaaaaaba", "aaaaaaaabb", "aaaaaaabaa", "aaaaaaabab", "aaaaaaabba", "aaaaaaabbb", "aaaaaabaaa", "aaaaaabaab", "aaaaaababa", "aaaaaababb", "aaaaaabbaa", "aaaaaabbab", "aaaaaabbba", "aaaaaabbbb", "aaaaabaaaa", "aaaaabaaab", "aaaaabaaba", "aaaaabaabb", "aaaaababaa", "aaaaababab", "aaaaababba", "aaaaababbb", "aaaaabbaaa", "aaaaabbaab", "aaaaabbaba", "aaaaabbabb", "aaaaabbbaa", "aaaaabbbab", "aaaaabbbba", "aaaaabbbbb", "aaaabaaaaa", "aaaabaaaab", "aaaabaaaba", "aaaabaaabb", "aaaabaabaa", "aaaabaabab", "aaaabaabba", "aaaabaabbb", "aaaababaaa", "aaaababaab", "aaaabababa", "aaaabababb", "aaaababbaa", "aaaababbab", "aaaababbba", "aaaababbbb", "aaaabbaaaa", "aaaabbaaab", "aaaabbaaba", "aaaabbaabb", "aaaabbabaa", "aaaabbabab", "aaaabbabba", "aaaabbabbb", "aaaabbbaaa", "aaaabbbaab", "aaaabbbaba", "aaaabbbabb", "aaaabbbbaa", "aaaabbbbab", "aaaabbbbba", "aaaabbbbbb", "aaabaaaaaa", "aaabaaaaab", "aaabaaaaba", "aaabaaaabb", "aaabaaabaa", "aaabaaabab", "aaabaaabba", "aaabaaabbb", "aaabaabaaa", "aaabaabaab", "aaabaababa", "aaabaababb", "aaabaabbaa", "aaabaabbab", "aaabaabbba", "aaabaabbbb", "aaababaaaa", "aaababaaab", "aaababaaba", "aaababaabb", "aaabababaa", "aaabababab", "aaabababba", "aaabababbb", "aaababbaaa", "aaababbaab", "aaababbaba", "aaababbabb", "aaababbbaa", "aaababbbab", "aaababbbba", "aaababbbbb", "aaabbaaaaa", "aaabbaaaab", "aaabbaaaba", "aaabbaaabb", "aaabbaabaa", "aaabbaabab", "aaabbaabba", "aaabbaabbb", "aaabbabaaa", "aaabbabaab", "aaabbababa", "aaabbababb", "aaabbabbaa", "aaabbabbab", "aaabbabbba", "aaabbabbbb", "aaabbbaaaa", "aaabbbaaab", "aaabbbaaba", "aaabbbaabb", "aaabbbabaa", "aaabbbabab", "aaabbbabba", "aaabbbabbb", "aaabbbbaaa", "aaabbbbaab", "aaabbbbaba", "aaabbbbabb", "aaabbbbbaa", "aaabbbbbab", "aaabbbbbba", "aaabbbbbbb", "aabaaaaaaa", "aabaaaaaab", "aabaaaaaba", "aabaaaaabb", "aabaaaabaa", "aabaaaabab", "aabaaaabba", "aabaaaabbb", "aabaaabaaa", "aabaaabaab", "aabaaababa", "aabaaababb", "aabaaabbaa", "aabaaabbab", "aabaaabbba", "aabaaabbbb", "aabaabaaaa", "aabaabaaab", "aabaabaaba", "aabaabaabb", "aabaababaa", "aabaababab", "aabaababba", "aabaababbb", "aabaabbaaa", "aabaabbaab", "aabaabbaba", "aabaabbabb", "aabaabbbaa", "aabaabbbab", "aabaabbbba", "aabaabbbbb", "aababaaaaa", "aababaaaab", "aababaaaba", "aababaaabb", "aababaabaa", "aababaabab", "aababaabba", "aababaabbb", "aabababaaa", "aabababaab", "aababababa", "aababababb", "aabababbaa", "aabababbab", "aabababbba", "aabababbbb", "aababbaaaa", "aababbaaab", "aababbaaba", "aababbaabb", "aababbabaa", "aababbabab", "aababbabba", "aababbabbb", "aababbbaaa", "aababbbaab", "aababbbaba", "aababbbabb", "aababbbbaa", "aababbbbab", "aababbbbba", "aababbbbbb", "aabbaaaaaa", "aabbaaaaab", "aabbaaaaba", "aabbaaaabb", "aabbaaabaa", "aabbaaabab", "aabbaaabba", "aabbaaabbb", "aabbaabaaa", "aabbaabaab", "aabbaababa", "aabbaababb", "aabbaabbaa", "aabbaabbab", "aabbaabbba", "aabbaabbbb", "aabbabaaaa", "aabbabaaab", "aabbabaaba", "aabbabaabb", "aabbababaa", "aabbababab", "aabbababba", "aabbababbb", "aabbabbaaa", "aabbabbaab", "aabbabbaba", "aabbabbabb", "aabbabbbaa", "aabbabbbab", "aabbabbbba", "aabbabbbbb", "aabbbaaaaa", "aabbbaaaab", "aabbbaaaba", "aabbbaaabb", "aabbbaabaa", "aabbbaabab", "aabbbaabba", "aabbbaabbb", "aabbbabaaa", "aabbbabaab", "aabbbababa", "aabbbababb", "aabbbabbaa", "aabbbabbab", "aabbbabbba", "aabbbabbbb", "aabbbbaaaa", "aabbbbaaab", "aabbbbaaba", "aabbbbaabb", "aabbbbabaa", "aabbbbabab", "aabbbbabba", "aabbbbabbb", "aabbbbbaaa", "aabbbbbaab", "aabbbbbaba", "aabbbbbabb", "aabbbbbbaa", "aabbbbbbab", "aabbbbbbba", "aabbbbbbbb", "abaaaaaaaa", "abaaaaaaab", "abaaaaaaba", "abaaaaaabb", "abaaaaabaa", "abaaaaabab", "abaaaaabba", "abaaaaabbb", "abaaaabaaa", "abaaaabaab", "abaaaababa", "abaaaababb", "abaaaabbaa", "abaaaabbab", "abaaaabbba", "abaaaabbbb", "abaaabaaaa", "abaaabaaab", "abaaabaaba", "abaaabaabb", "abaaababaa", "abaaababab", "abaaababba", "abaaababbb", "abaaabbaaa", "abaaabbaab", "abaaabbaba", "abaaabbabb", "abaaabbbaa", "abaaabbbab", "abaaabbbba", "abaaabbbbb", "abaabaaaaa", "abaabaaaab", "abaabaaaba", "abaabaaabb", "abaabaabaa", "abaabaabab", "abaabaabba", "abaabaabbb", "abaababaaa", "abaababaab", "abaabababa", "abaabababb", "abaababbaa", "abaababbab", "abaababbba", "abaababbbb", "abaabbaaaa", "abaabbaaab", "abaabbaaba", "abaabbaabb", "abaabbabaa", "abaabbabab", "abaabbabba", "abaabbabbb", "abaabbbaaa", "abaabbbaab", "abaabbbaba", "abaabbbabb", "abaabbbbaa", "abaabbbbab", "abaabbbbba", "abaabbbbbb", "ababaaaaaa", "ababaaaaab", "ababaaaaba", "ababaaaabb", "ababaaabaa", "ababaaabab", "ababaaabba", "ababaaabbb", "ababaabaaa", "ababaabaab", "ababaababa", "ababaababb", "ababaabbaa", "ababaabbab", "ababaabbba", "ababaabbbb", "abababaaaa", "abababaaab", "abababaaba", "abababaabb", "ababababaa", "ababababab", "ababababba", "ababababbb", "abababbaaa", "abababbaab", "abababbaba", "abababbabb", "abababbbaa", "abababbbab", "abababbbba", "abababbbbb", "ababbaaaaa", "ababbaaaab", "ababbaaaba", "ababbaaabb", "ababbaabaa", "ababbaabab", "ababbaabba", "ababbaabbb", "ababbabaaa", "ababbabaab", "ababbababa", "ababbababb", "ababbabbaa", "ababbabbab", "ababbabbba", "ababbabbbb", "ababbbaaaa", "ababbbaaab", "ababbbaaba", "ababbbaabb", "ababbbabaa", "ababbbabab", "ababbbabba", "ababbbabbb", "ababbbbaaa", "ababbbbaab", "ababbbbaba", "ababbbbabb", "ababbbbbaa", "ababbbbbab", "ababbbbbba", "ababbbbbbb", "abbaaaaaaa", "abbaaaaaab", "abbaaaaaba", "abbaaaaabb", "abbaaaabaa", "abbaaaabab", "abbaaaabba", "abbaaaabbb", "abbaaabaaa", "abbaaabaab", "abbaaababa", "abbaaababb", "abbaaabbaa", "abbaaabbab", "abbaaabbba", "abbaaabbbb", "abbaabaaaa", "abbaabaaab", "abbaabaaba", "abbaabaabb", "abbaababaa", "abbaababab", "abbaababba", "abbaababbb", "abbaabbaaa", "abbaabbaab", "abbaabbaba", "abbaabbabb", "abbaabbbaa", "abbaabbbab", "abbaabbbba", "abbaabbbbb", "abbabaaaaa", "abbabaaaab", "abbabaaaba", "abbabaaabb", "abbabaabaa", "abbabaabab", "abbabaabba", "abbabaabbb", "abbababaaa", "abbababaab", "abbabababa", "abbabababb", "abbababbaa", "abbababbab", "abbababbba", "abbababbbb", "abbabbaaaa", "abbabbaaab", "abbabbaaba", "abbabbaabb", "abbabbabaa", "abbabbabab", "abbabbabba", "abbabbabbb", "abbabbbaaa", "abbabbbaab", "abbabbbaba", "abbabbbabb", "abbabbbbaa", "abbabbbbab", "abbabbbbba", "abbabbbbbb", "abbbaaaaaa", "abbbaaaaab", "abbbaaaaba", "abbbaaaabb", "abbbaaabaa", "abbbaaabab", "abbbaaabba", "abbbaaabbb", "abbbaabaaa", "abbbaabaab", "abbbaababa", "abbbaababb", "abbbaabbaa", "abbbaabbab", "abbbaabbba", "abbbaabbbb", "abbbabaaaa", "abbbabaaab", "abbbabaaba", "abbbabaabb", "abbbababaa", "abbbababab", "abbbababba", "abbbababbb", "abbbabbaaa", "abbbabbaab", "abbbabbaba", "abbbabbabb", "abbbabbbaa", "abbbabbbab", "abbbabbbba", "abbbabbbbb", "abbbbaaaaa", "abbbbaaaab", "abbbbaaaba", "abbbbaaabb", "abbbbaabaa", "abbbbaabab", "abbbbaabba", "abbbbaabbb", "abbbbabaaa", "abbbbabaab", "abbbbababa", "abbbbababb", "abbbbabbaa", "abbbbabbab", "abbbbabbba", "abbbbabbbb", "abbbbbaaaa", "abbbbbaaab", "abbbbbaaba", "abbbbbaabb", "abbbbbabaa", "abbbbbabab", "abbbbbabba", "abbbbbabbb", "abbbbbbaaa", "abbbbbbaab", "abbbbbbaba", "abbbbbbabb", "abbbbbbbaa", "abbbbbbbab", "abbbbbbbba", "abbbbbbbbb", "baaaaaaaaa", "baaaaaaaab", "baaaaaaaba", "baaaaaaabb", "baaaaaabaa", "baaaaaabab", "baaaaaabba", "baaaaaabbb", "baaaaabaaa", "baaaaabaab", "baaaaababa", "baaaaababb", "baaaaabbaa", "baaaaabbab", "baaaaabbba", "baaaaabbbb", "baaaabaaaa", "baaaabaaab", "baaaabaaba", "baaaabaabb", "baaaababaa", "baaaababab", "baaaababba", "baaaababbb", "baaaabbaaa", "baaaabbaab", "baaaabbaba", "baaaabbabb", "baaaabbbaa", "baaaabbbab", "baaaabbbba", "baaaabbbbb", "baaabaaaaa", "baaabaaaab", "baaabaaaba", "baaabaaabb", "baaabaabaa", "baaabaabab", "baaabaabba", "baaabaabbb", "baaababaaa", "baaababaab", "baaabababa", "baaabababb", "baaababbaa", "baaababbab", "baaababbba", "baaababbbb", "baaabbaaaa", "baaabbaaab", "baaabbaaba", "baaabbaabb", "baaabbabaa", "baaabbabab", "baaabbabba", "baaabbabbb", "baaabbbaaa", "baaabbbaab", "baaabbbaba", "baaabbbabb", "baaabbbbaa", "baaabbbbab", "baaabbbbba", "baaabbbbbb", "baabaaaaaa", "baabaaaaab", "baabaaaaba", "baabaaaabb", "baabaaabaa", "baabaaabab", "baabaaabba", "baabaaabbb", "baabaabaaa", "baabaabaab", "baabaababa", "baabaababb", "baabaabbaa", "baabaabbab", "baabaabbba", "baabaabbbb", "baababaaaa", "baababaaab", "baababaaba", "baababaabb", "baabababaa", "baabababab", "baabababba", "baabababbb", "baababbaaa", "baababbaab", "baababbaba", "baababbabb", "baababbbaa", "baababbbab", "baababbbba", "baababbbbb", "baabbaaaaa", "baabbaaaab", "baabbaaaba", "baabbaaabb", "baabbaabaa", "baabbaabab", "baabbaabba", "baabbaabbb", "baabbabaaa", "baabbabaab", "baabbababa", "baabbababb", "baabbabbaa", "baabbabbab", "baabbabbba", "baabbabbbb", "baabbbaaaa", "baabbbaaab", "baabbbaaba", "baabbbaabb", "baabbbabaa", "baabbbabab", "baabbbabba", "baabbbabbb", "baabbbbaaa", "baabbbbaab", "baabbbbaba", "baabbbbabb", "baabbbbbaa", "baabbbbbab", "baabbbbbba", "baabbbbbbb", "babaaaaaaa", "babaaaaaab", "babaaaaaba", "babaaaaabb", "babaaaabaa", "babaaaabab", "babaaaabba", "babaaaabbb", "babaaabaaa", "babaaabaab", "babaaababa", "babaaababb", "babaaabbaa", "babaaabbab", "babaaabbba", "babaaabbbb", "babaabaaaa", "babaabaaab", "babaabaaba", "babaabaabb", "babaababaa", "babaababab", "babaababba", "babaababbb", "babaabbaaa", "babaabbaab", "babaabbaba", "babaabbabb", "babaabbbaa", "babaabbbab", "babaabbbba", "babaabbbbb", "bababaaaaa", "bababaaaab", "bababaaaba", "bababaaabb", "bababaabaa", "bababaabab", "bababaabba", "bababaabbb", "babababaaa", "babababaab", "bababababa", "bababababb", "babababbaa", "babababbab", "babababbba", "babababbbb", "bababbaaaa", "bababbaaab", "bababbaaba", "bababbaabb", "bababbabaa", "bababbabab", "bababbabba", "bababbabbb", "bababbbaaa", "bababbbaab", "bababbbaba", "bababbbabb", "bababbbbaa", "bababbbbab", "bababbbbba", "bababbbbbb", "babbaaaaaa", "babbaaaaab", "babbaaaaba", "babbaaaabb", "babbaaabaa", "babbaaabab", "babbaaabba", "babbaaabbb", "babbaabaaa", "babbaabaab", "babbaababa", "babbaababb", "babbaabbaa", "babbaabbab", "babbaabbba", "babbaabbbb", "babbabaaaa", "babbabaaab", "babbabaaba", "babbabaabb", "babbababaa", "babbababab", "babbababba", "babbababbb", "babbabbaaa", "babbabbaab", "babbabbaba", "babbabbabb", "babbabbbaa", "babbabbbab", "babbabbbba", "babbabbbbb", "babbbaaaaa", "babbbaaaab", "babbbaaaba", "babbbaaabb", "babbbaabaa", "babbbaabab", "babbbaabba", "babbbaabbb", "babbbabaaa", "babbbabaab", "babbbababa", "babbbababb", "babbbabbaa", "babbbabbab", "babbbabbba", "babbbabbbb", "babbbbaaaa", "babbbbaaab", "babbbbaaba", "babbbbaabb", "babbbbabaa", "babbbbabab", "babbbbabba", "babbbbabbb", "babbbbbaaa", "babbbbbaab", "babbbbbaba", "babbbbbabb", "babbbbbbaa", "babbbbbbab", "babbbbbbba", "babbbbbbbb", "bbaaaaaaaa", "bbaaaaaaab", "bbaaaaaaba", "bbaaaaaabb", "bbaaaaabaa", "bbaaaaabab", "bbaaaaabba", "bbaaaaabbb", "bbaaaabaaa", "bbaaaabaab", "bbaaaababa", "bbaaaababb", "bbaaaabbaa", "bbaaaabbab", "bbaaaabbba", "bbaaaabbbb", "bbaaabaaaa", "bbaaabaaab", "bbaaabaaba", "bbaaabaabb", "bbaaababaa", "bbaaababab", "bbaaababba", "bbaaababbb", "bbaaabbaaa", "bbaaabbaab", "bbaaabbaba", "bbaaabbabb", "bbaaabbbaa", "bbaaabbbab", "bbaaabbbba", "bbaaabbbbb", "bbaabaaaaa", "bbaabaaaab", "bbaabaaaba", "bbaabaaabb", "bbaabaabaa", "bbaabaabab", "bbaabaabba", "bbaabaabbb", "bbaababaaa", "bbaababaab", "bbaabababa", "bbaabababb", "bbaababbaa", "bbaababbab", "bbaababbba", "bbaababbbb", "bbaabbaaaa", "bbaabbaaab", "bbaabbaaba", "bbaabbaabb", "bbaabbabaa", "bbaabbabab", "bbaabbabba", "bbaabbabbb", "bbaabbbaaa", "bbaabbbaab", "bbaabbbaba", "bbaabbbabb", "bbaabbbbaa", "bbaabbbbab", "bbaabbbbba", "bbaabbbbbb", "bbabaaaaaa", "bbabaaaaab", "bbabaaaaba", "bbabaaaabb", "bbabaaabaa", "bbabaaabab", "bbabaaabba", "bbabaaabbb", "bbabaabaaa", "bbabaabaab", "bbabaababa", "bbabaababb", "bbabaabbaa", "bbabaabbab", "bbabaabbba", "bbabaabbbb", "bbababaaaa", "bbababaaab", "bbababaaba", "bbababaabb", "bbabababaa", "bbabababab", "bbabababba", "bbabababbb", "bbababbaaa", "bbababbaab", "bbababbaba", "bbababbabb", "bbababbbaa", "bbababbbab", "bbababbbba", "bbababbbbb", "bbabbaaaaa", "bbabbaaaab", "bbabbaaaba", "bbabbaaabb", "bbabbaabaa", "bbabbaabab", "bbabbaabba", "bbabbaabbb", "bbabbabaaa", "bbabbabaab", "bbabbababa", "bbabbababb", "bbabbabbaa", "bbabbabbab", "bbabbabbba", "bbabbabbbb", "bbabbbaaaa", "bbabbbaaab", "bbabbbaaba", "bbabbbaabb", "bbabbbabaa", "bbabbbabab", "bbabbbabba", "bbabbbabbb", "bbabbbbaaa", "bbabbbbaab", "bbabbbbaba", "bbabbbbabb", "bbabbbbbaa", "bbabbbbbab", "bbabbbbbba", "bbabbbbbbb", "bbbaaaaaaa", "bbbaaaaaab", "bbbaaaaaba", "bbbaaaaabb", "bbbaaaabaa", "bbbaaaabab", "bbbaaaabba", "bbbaaaabbb", "bbbaaabaaa", "bbbaaabaab", "bbbaaababa", "bbbaaababb", "bbbaaabbaa", "bbbaaabbab", "bbbaaabbba", "bbbaaabbbb", "bbbaabaaaa", "bbbaabaaab", "bbbaabaaba", "bbbaabaabb", "bbbaababaa", "bbbaababab", "bbbaababba", "bbbaababbb", "bbbaabbaaa", "bbbaabbaab", "bbbaabbaba", "bbbaabbabb", "bbbaabbbaa", "bbbaabbbab", "bbbaabbbba", "bbbaabbbbb", "bbbabaaaaa", "bbbabaaaab", "bbbabaaaba", "bbbabaaabb", "bbbabaabaa", "bbbabaabab", "bbbabaabba", "bbbabaabbb", "bbbababaaa", "bbbababaab", "bbbabababa", "bbbabababb", "bbbababbaa", "bbbababbab", "bbbababbba", "bbbababbbb", "bbbabbaaaa", "bbbabbaaab", "bbbabbaaba", "bbbabbaabb", "bbbabbabaa", "bbbabbabab", "bbbabbabba", "bbbabbabbb", "bbbabbbaaa", "bbbabbbaab", "bbbabbbaba", "bbbabbbabb", "bbbabbbbaa", "bbbabbbbab", "bbbabbbbba", "bbbabbbbbb", "bbbbaaaaaa", "bbbbaaaaab", "bbbbaaaaba", "bbbbaaaabb", "bbbbaaabaa", "bbbbaaabab", "bbbbaaabba", "bbbbaaabbb", "bbbbaabaaa", "bbbbaabaab", "bbbbaababa", "bbbbaababb", "bbbbaabbaa", "bbbbaabbab", "bbbbaabbba", "bbbbaabbbb", "bbbbabaaaa", "bbbbabaaab", "bbbbabaaba", "bbbbabaabb", "bbbbababaa", "bbbbababab", "bbbbababba", "bbbbababbb", "bbbbabbaaa", "bbbbabbaab", "bbbbabbaba", "bbbbabbabb", "bbbbabbbaa", "bbbbabbbab", "bbbbabbbba", "bbbbabbbbb", "bbbbbaaaaa", "bbbbbaaaab", "bbbbbaaaba", "bbbbbaaabb", "bbbbbaabaa", "bbbbbaabab", "bbbbbaabba", "bbbbbaabbb", "bbbbbabaaa", "bbbbbabaab", "bbbbbababa", "bbbbbababb", "bbbbbabbaa", "bbbbbabbab", "bbbbbabbba", "bbbbbabbbb", "bbbbbbaaaa", "bbbbbbaaab", "bbbbbbaaba", "bbbbbbaabb", "bbbbbbabaa", "bbbbbbabab", "bbbbbbabba", "bbbbbbabbb", "bbbbbbbaaa", "bbbbbbbaab", "bbbbbbbaba", "bbbbbbbabb", "bbbbbbbbaa", "bbbbbbbbab", "bbbbbbbbba", "bbbbbbbbbb"}, + }, + + { + "a{b,c}{d,e}f{g,h},z", + []string{"abdfg", "abdfh", "abefg", "abefh", "acdfg", "acdfh", "acefg", "acefh", "z"}, + }, + + { + "{{a,b},{b,c}}", + []string{"a", "b", "c"}, + }, + + { + "a", + []string{"a"}, + }, + + { + "w", + []string{"w"}, + }, + + { + "{a,b,c}", + []string{"a", "b", "c"}, + }, + + { + "{a,b}{c,d}", + []string{"ac", "ad", "bc", "bd"}, + }, + + { + "a{b,c}{d,e}f{g,h}", + []string{"abdfg", "abdfh", "abefg", "abefh", "acdfg", "acdfh", "acefg", "acefh"}, + }, + + { + "ab{{{c}}}", + []string{"abc"}, + }, + + { + "{a,b}{c,{d,e}}", + []string{"ac", "ad", "ae", "bc", "bd", "be"}, + }, + + { + "{{a,z},a{b,c},{ab,z}}", + []string{"a", "ab", "ac", "z"}, + }, + + // 可以有多个 testcase +} + +func Test_braceExpansionII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, braceExpansionII(tc.expression), "输入:%v", tc) + } +} + +func Benchmark_braceExpansionII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + braceExpansionII(tc.expression) + } + } +} diff --git a/Algorithms/1103.distribute-candies-to-people/README.md b/Algorithms/1103.distribute-candies-to-people/README.md new file mode 100755 index 000000000..06394685d --- /dev/null +++ b/Algorithms/1103.distribute-candies-to-people/README.md @@ -0,0 +1,40 @@ +# [1103. Distribute Candies to People](https://leetcode.com/problems/distribute-candies-to-people/) + +We distribute some number of candies, to a row of n = num_people people in the following way: + +We then give 1 candy to the first person, 2 candies to the second person, and so on until we give n candies to the last person. + +Then, we go back to the start of the row, giving n + 1 candies to the first person, n + 2 candies to the second person, and so on until we give 2 * n candies to the last person. + +This process repeats (with us giving one more candy each time, and moving to the start of the row after we reach the end) until we run out of candies. The last person will receive all of our remaining candies (not necessarily one more than the previous gift). + +Return an array (of length num_people and sum candies) that represents the final distribution of candies. + +Example 1: + +```text +Input: candies = 7, num_people = 4 +Output: [1,2,3,1] +Explanation: +On the first turn, ans[0] += 1, and the array is [1,0,0,0]. +On the second turn, ans[1] += 2, and the array is [1,2,0,0]. +On the third turn, ans[2] += 3, and the array is [1,2,3,0]. +On the fourth turn, ans[3] += 1 (because there is only one candy left), and the final array is [1,2,3,1]. +``` + +Example 2: + +```text +Input: candies = 10, num_people = 3 +Output: [5,2,3] +Explanation: +On the first turn, ans[0] += 1, and the array is [1,0,0]. +On the second turn, ans[1] += 2, and the array is [1,2,0]. +On the third turn, ans[2] += 3, and the array is [1,2,3]. +On the fourth turn, ans[0] += 4, and the final array is [5,2,3]. +``` + +Constraints: + +1. `1 <= candies <= 10^9` +1. `1 <= num_people <= 1000` diff --git a/Algorithms/1103.distribute-candies-to-people/distribute-candies-to-people.go b/Algorithms/1103.distribute-candies-to-people/distribute-candies-to-people.go new file mode 100755 index 000000000..f2f53a500 --- /dev/null +++ b/Algorithms/1103.distribute-candies-to-people/distribute-candies-to-people.go @@ -0,0 +1,34 @@ +package problem1103 + +import "math" + +func distributeCandies(candies, people int) []int { + res := make([]int, people) + + k := root(candies) + + // res[i] = (i+1) + (i+1+p) + (i+1+p*2) + ... + (i+1+n*p) + // n = (k-i-1)/p , p = people + candiesOf := func(i int) int { + c0 := i + 1 + n := (k - c0) / people + cn := c0 + n*people + return (n + 1) * (c0 + cn) / 2 + } + + // i= 0 { + res[i] = label + label = sum - label/2 + sum /= 2 + i-- + } + return res +} diff --git a/Algorithms/1104.path-in-zigzag-labelled-binary-tree/path-in-zigzag-labelled-binary-tree_test.go b/Algorithms/1104.path-in-zigzag-labelled-binary-tree/path-in-zigzag-labelled-binary-tree_test.go new file mode 100755 index 000000000..2b454b03e --- /dev/null +++ b/Algorithms/1104.path-in-zigzag-labelled-binary-tree/path-in-zigzag-labelled-binary-tree_test.go @@ -0,0 +1,42 @@ +package problem1104 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + label int + ans []int +}{ + + { + 14, + []int{1, 3, 4, 14}, + }, + + { + 26, + []int{1, 2, 6, 10, 26}, + }, + + // 可以有多个 testcase +} + +func Test_pathInZigZagTree(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, pathInZigZagTree(tc.label), "输入:%v", tc) + } +} + +func Benchmark_pathInZigZagTree(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + pathInZigZagTree(tc.label) + } + } +} diff --git a/Algorithms/1104.path-in-zigzag-labelled-binary-tree/tree.png b/Algorithms/1104.path-in-zigzag-labelled-binary-tree/tree.png new file mode 100644 index 000000000..50408e518 Binary files /dev/null and b/Algorithms/1104.path-in-zigzag-labelled-binary-tree/tree.png differ diff --git a/Algorithms/1105.filling-bookcase-shelves/1105.png b/Algorithms/1105.filling-bookcase-shelves/1105.png new file mode 100644 index 000000000..897d408ce Binary files /dev/null and b/Algorithms/1105.filling-bookcase-shelves/1105.png differ diff --git a/Algorithms/1105.filling-bookcase-shelves/README.md b/Algorithms/1105.filling-bookcase-shelves/README.md new file mode 100755 index 000000000..3cfc032f1 --- /dev/null +++ b/Algorithms/1105.filling-bookcase-shelves/README.md @@ -0,0 +1,29 @@ +# [1105. Filling Bookcase Shelves](https://leetcode.com/problems/filling-bookcase-shelves/) + +We have a sequence of books: the i-th book has thickness books[i][0] and height books[i][1]. + +We want to place these books in order onto bookcase shelves that have total width shelf_width. + +We choose some of the books to place on this shelf (such that the sum of their thickness is <= shelf_width), then build another level of shelf of the bookcase so that the total height of the bookcase has increased by the maximum height of the books we just put down. We repeat this process until there are no more books to place. + +Note again that at each step of the above process, __the order of the books we place is the same order as the given sequence of books.__ For example, if we have an ordered list of 5 books, we might place the first and second book onto the first shelf, the third book on the second shelf, and the fourth and fifth book on the last shelf. + +Return the minimum possible height that the total bookshelf can be after placing shelves in this manner. + +Example 1: + +![1105](1105.png) + +```text +Input: books = [[1,1],[2,3],[2,3],[1,1],[1,1],[1,1],[1,2]], shelf_width = 4 +Output: 6 +Explanation: +The sum of the heights of the 3 shelves are 1 + 3 + 2 = 6. +Notice that book number 2 does not have to be on the first shelf. +``` + +Constraints: + +1. `1 <= books.length <= 1000` +1. `1 <= books[i][0] <= shelf_width <= 1000` +1. `1 <= books[i][1] <= 1000` diff --git a/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves.go b/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves.go new file mode 100755 index 000000000..1d7bc14d6 --- /dev/null +++ b/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves.go @@ -0,0 +1,37 @@ +package problem1105 + +func minHeightShelves(books [][]int, width int) int { + m := len(books) + dp := make([]int, m+1) + + for i := 1; i <= m; i++ { + dp[i] = 1000000 + k := 1 + w, h := books[i-k][0], books[i-k][1] + for w <= width { + dp[i] = min(dp[i], dp[i-k]+h) + k++ + if i-k < 0 { + break + } + w += books[i-k][0] + h = max(h, books[i-k][1]) + } + } + + return dp[m] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves_test.go b/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves_test.go new file mode 100755 index 000000000..28c3c8cf3 --- /dev/null +++ b/Algorithms/1105.filling-bookcase-shelves/filling-bookcase-shelves_test.go @@ -0,0 +1,45 @@ +package problem1105 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + books [][]int + shelfWidth int + ans int +}{ + + { + [][]int{{1, 1}, {3, 3}, {2, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 2}}, + 4, + 8, + }, + + { + [][]int{{1, 1}, {2, 3}, {2, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 2}}, + 4, + 6, + }, + + // 可以有多个 testcase +} + +func Test_minHeightShelves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, minHeightShelves(tc.books, tc.shelfWidth), "输入:%v", tc) + } +} + +func Benchmark_minHeightShelves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minHeightShelves(tc.books, tc.shelfWidth) + } + } +} diff --git a/Algorithms/1106.parsing-a-boolean-expression/README.md b/Algorithms/1106.parsing-a-boolean-expression/README.md new file mode 100755 index 000000000..e26307bb2 --- /dev/null +++ b/Algorithms/1106.parsing-a-boolean-expression/README.md @@ -0,0 +1,45 @@ +# [1106. Parsing A Boolean Expression](https://leetcode.com/problems/parsing-a-boolean-expression/) + +Return the result of evaluating a given boolean expression, represented as a string. + +An expression can either be: + +- "t", evaluating to True; +- "f", evaluating to False; +- "!(expr)", evaluating to the logical NOT of the inner expression expr; +- "&(expr1,expr2,...)", evaluating to the logical AND of 2 or more inner expressions expr1, expr2, ...; +- "|(expr1,expr2,...)", evaluating to the logical OR of 2 or more inner expressions expr1, expr2, ... + +Example 1: + +```text +Input: expression = "!(f)" +Output: true +``` + +Example 2: + +```text +Input: expression = "|(f,t)" +Output: true +``` + +Example 3: + +```text +Input: expression = "&(t,f)" +Output: false +``` + +Example 4: + +```text +Input: expression = "|(&(t,f,t),!(t))" +Output: false +``` + +Constraints: + +- 1 <= expression.length <= 20000 +- expression[i] consists of characters in {'(', ')', '&', '|', '!', 't', 'f', ','}. +- expression is a valid expression representing a boolean, as given in the description. diff --git a/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression.go b/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression.go new file mode 100755 index 000000000..f9dd4264c --- /dev/null +++ b/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression.go @@ -0,0 +1,63 @@ +package problem1106 + +import "strings" + +func parseBoolExpr(exp string) bool { + if exp == "t" || exp == "f" { + return exp == "t" + } + n := len(exp) + op, exp := exp[0], exp[2:n-1] + switch op { + case '&': + return and(split(exp)) + case '|': + return or(split(exp)) + default: // ! + return not(exp) + } +} + +func split(exp string) []string { + count := 0 + isUnbracketed := func() bool { + return count == 0 + } + bytes := []byte(exp) + for i, b := range bytes { + switch b { + case '(': + count++ + case ')': + count-- + case ',': + if isUnbracketed() { + bytes[i] = '@' + } + } + } + exp = string(bytes) + return strings.Split(exp, "@") +} + +func and(exps []string) bool { + for _, e := range exps { + if !parseBoolExpr(e) { + return false + } + } + return true +} + +func or(exps []string) bool { + for _, e := range exps { + if parseBoolExpr(e) { + return true + } + } + return false +} + +func not(exp string) bool { + return !parseBoolExpr(exp) +} diff --git a/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression_test.go b/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression_test.go new file mode 100755 index 000000000..7684b67d1 --- /dev/null +++ b/Algorithms/1106.parsing-a-boolean-expression/parsing-a-boolean-expression_test.go @@ -0,0 +1,67 @@ +package problem1106 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + expression string + ans bool +}{ + + { + "&(&(&(&(!(&(!(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t)))),&(&(!(t),!(|(f,f,t)),!(&(f))),!(|(f,f,t)),&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),!(t))),&(&(t,t,f),&(&(&(t,t,f),|(f,f,t),|(f)),&(&(!(&(f)),&(t),|(f,f,t)),&(t),&(t,t,f)),&(t,t,f)),!(&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))))),!(!(&(&(!(t),!(|(f,f,t)),!(&(f))),&(t),!(&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))))))))),!(&(&(!(&(f)),&(t),|(f,f,t)),&(t),&(t,t,f))),&(&(!(t),!(|(f,f,t)),!(&(f))),!(&(f)),&(!(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t)))),&(&(!(t),!(|(f,f,t)),!(&(f))),!(|(f,f,t)),&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),!(t)))),!(!(&(&(!(&(f)),&(t),|(f,f,t)),&(t),&(t,t,f)))),!(&(!(&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t))))),!(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))),&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f))))),&(!(&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))),&(!(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))),&(!(&(f)),&(t),|(f,f,t)),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(!(&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t))))),!(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))),&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f))),&(!(&(!(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t)))),&(&(!(t),!(|(f,f,t)),!(&(f))),!(|(f,f,t)),&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),!(t))),&(&(t,t,f),&(&(&(t,t,f),|(f,f,t),|(f)),&(&(!(&(f)),&(t),|(f,f,t)),&(t),&(t,t,f)),&(t,t,f)),!(&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))))),!(!(&(&(!(t),!(|(f,f,t)),!(&(f))),&(t),!(&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))))))))),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))))),&(&(&(!(t),!(|(f,f,t)),!(&(f))),!(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t)))),&(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(!(&(f)),&(t),|(f,f,t)),|(t),|(f,f,t)),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))))),&(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(!(&(&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t,t,f),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))),&(t,t,f),&(!(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))),&(!(&(f)),&(t),|(f,f,t)),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t))))),!(&(&(!(&(f)),&(t),|(f,f,t)),&(t),&(t,t,f))),&(f))),!(&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))),&(&(f),!(&(t)),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(!(|(f,f,t))),&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f))))),&(&(!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),!(!(&(f))),&(!(t),&(f),|(f))),!(&(&(!(&(f)),&(t),|(f,f,t)),|(t),|(f,f,t))),&(!(&(t)),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t))),!(&(f))))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))))", + false, + }, + + { + "&(&(|(f),&(&(&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)),&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))),&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f))),!(&(f)),&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t)))),!(!(&(&(t,t,f),|(f,f,t),|(f)))),&(&(t),&(&(&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))),&(&(&(!(&(f)),|(t),&(!(t),!(|(f,f,t)),!(&(f)))),!(|(f,f,t)),&(t,t,f)),&(f),&(&(t),&(!(t),!(|(f,f,t)),!(&(f))),|(f,f,t)))),&(&(&(t,t,f),|(f,f,t),|(f)),!(&(t)),!(&(|(f,f,t),&(&(f),&(!(t),&(f),|(f)),&(!(&(f)),&(t),|(f,f,t))),&(t))))))", + false, + }, + + { + "!(f)", + true, + }, + + { + "|(f,t)", + true, + }, + + { + "&(t,t,t,t,t,t)", + true, + }, + + { + "&(t,f)", + false, + }, + + { + "|(&(t,f,t),!(t))", + false, + }, + + // 可以有多个 testcase +} + +func Test_parseBoolExpr(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, parseBoolExpr(tc.expression), "输入:%v", tc) + } +} + +func Benchmark_parseBoolExpr(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + parseBoolExpr(tc.expression) + } + } +} diff --git a/Algorithms/1108.defanging-an-ip-address/README.md b/Algorithms/1108.defanging-an-ip-address/README.md new file mode 100755 index 000000000..01335c8f3 --- /dev/null +++ b/Algorithms/1108.defanging-an-ip-address/README.md @@ -0,0 +1,23 @@ +# [1108. Defanging an IP Address](https://leetcode.com/problems/defanging-an-ip-address/) + +Given a valid (IPv4) IP address, return a defanged version of that IP address. + +A defanged IP address replaces every period "." with "[.]". + +Example 1: + +```text +Input: address = "1.1.1.1" +Output: "1[.]1[.]1[.]1" +``` + +Example 2: + +```text +Input: address = "255.100.50.0" +Output: "255[.]100[.]50[.]0" +``` + +Constraints: + +1. The given address is a valid IPv4 address. diff --git a/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address.go b/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address.go new file mode 100755 index 000000000..e9f3b887d --- /dev/null +++ b/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address.go @@ -0,0 +1,7 @@ +package problem1108 + +import "strings" + +func defangIPaddr(address string) string { + return strings.Replace(address, ".", "[.]", -1) +} diff --git a/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address_test.go b/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address_test.go new file mode 100755 index 000000000..f027ea13a --- /dev/null +++ b/Algorithms/1108.defanging-an-ip-address/defanging-an-ip-address_test.go @@ -0,0 +1,42 @@ +package problem1108 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + address string + ans string +}{ + + { + "1.1.1.1", + "1[.]1[.]1[.]1", + }, + + { + "255.100.50.0", + "255[.]100[.]50[.]0", + }, + + // 可以有多个 testcase +} + +func Test_defangIPaddr(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, defangIPaddr(tc.address), "输入:%v", tc) + } +} + +func Benchmark_defangIPaddr(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + defangIPaddr(tc.address) + } + } +} diff --git a/Algorithms/1109.corporate-flight-bookings/README.md b/Algorithms/1109.corporate-flight-bookings/README.md new file mode 100755 index 000000000..dd7df9308 --- /dev/null +++ b/Algorithms/1109.corporate-flight-bookings/README.md @@ -0,0 +1,20 @@ +# [1109. Corporate Flight Bookings](https://leetcode.com/problems/corporate-flight-bookings/) + +There are n flights, and they are labeled from 1 to n. + +We have a list of flight bookings. The i-th booking bookings[i] = [i, j, k] means that we booked k seats from flights labeled i to j inclusive. + +Return an array answer of length n, representing the number of seats booked on each flight in order of their label. + +Example 1: + +```text +Input: bookings = [[1,2,10],[2,3,20],[2,5,25]], n = 5 +Output: [10,55,45,25,25] +``` + +Constraints: + +- `1 <= bookings.length <= 20000` +- `1 <= bookings[i][0] <= bookings[i][1] <= n <= 20000` +- `1 <= bookings[i][2] <= 10000` diff --git a/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings.go b/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings.go new file mode 100755 index 000000000..04462739f --- /dev/null +++ b/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings.go @@ -0,0 +1,16 @@ +package problem1109 + +func corpFlightBookings(bookings [][]int, n int) []int { + res := make([]int, n+1) + for _, b := range bookings { + i, j, k := b[0], b[1], b[2] + res[i-1] += k + res[j] -= k + } + + for i := 1; i < n; i++ { + res[i] += res[i-1] + } + + return res[:n] +} diff --git a/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings_test.go b/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings_test.go new file mode 100755 index 000000000..ca4092a2d --- /dev/null +++ b/Algorithms/1109.corporate-flight-bookings/corporate-flight-bookings_test.go @@ -0,0 +1,39 @@ +package problem1109 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + bookings [][]int + n int + ans []int +}{ + + { + [][]int{{1, 2, 10}, {2, 3, 20}, {2, 5, 25}}, + 5, + []int{10, 55, 45, 25, 25}, + }, + + // 可以有多个 testcase +} + +func Test_corpFlightBookings(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, corpFlightBookings(tc.bookings, tc.n), "输入:%v", tc) + } +} + +func Benchmark_corpFlightBookings(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + corpFlightBookings(tc.bookings, tc.n) + } + } +} diff --git a/Algorithms/1110.delete-nodes-and-return-forest/1.png b/Algorithms/1110.delete-nodes-and-return-forest/1.png new file mode 100644 index 000000000..385bb25aa Binary files /dev/null and b/Algorithms/1110.delete-nodes-and-return-forest/1.png differ diff --git a/Algorithms/1110.delete-nodes-and-return-forest/README.md b/Algorithms/1110.delete-nodes-and-return-forest/README.md new file mode 100755 index 000000000..06532c32a --- /dev/null +++ b/Algorithms/1110.delete-nodes-and-return-forest/README.md @@ -0,0 +1,23 @@ +# [1110. Delete Nodes And Return Forest](https://leetcode.com/problems/delete-nodes-and-return-forest/) + +Given the root of a binary tree, each node in the tree has a distinct value. + +After deleting all nodes with a value in to_delete, we are left with a forest (a disjoint union of trees). + +Return the roots of the trees in the remaining forest. You may return the result in any order. + +Example 1: + +![1](1.png) + +```text +Input: root = [1,2,3,4,5,6,7], to_delete = [3,5] +Output: [[1,2,null,4],[6],[7]] +``` + +Constraints: + +- The number of nodes in the given tree is at most 1000. +- Each node has a distinct value between 1 and 1000. +- to_delete.length <= 1000 +- to_delete contains distinct values between 1 and 1000. diff --git a/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest.go b/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest.go new file mode 100755 index 000000000..fe34366f6 --- /dev/null +++ b/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest.go @@ -0,0 +1,49 @@ +package problem1110 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined +type TreeNode = kit.TreeNode + +func delNodes(root *TreeNode, delete []int) []*TreeNode { + newRoot := &TreeNode{ + Val: 0, + Left: root, + } + + isDeleted := [10001]bool{} + isDeleted[0] = true + for _, d := range delete { + isDeleted[d] = true + } + + res := make([]*TreeNode, 0, 1000) + + var dfs func(*TreeNode) *TreeNode + dfs = func(node *TreeNode) *TreeNode { + if node == nil { + return nil + } + // + node.Left = dfs(node.Left) + node.Right = dfs(node.Right) + // + if !isDeleted[node.Val] { + return node + } + // + if node.Left != nil { + res = append(res, node.Left) + } + // + if node.Right != nil { + res = append(res, node.Right) + } + // + return nil + } + + dfs(newRoot) + + return res +} diff --git a/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest_test.go b/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest_test.go new file mode 100755 index 000000000..3708fc855 --- /dev/null +++ b/Algorithms/1110.delete-nodes-and-return-forest/delete-nodes-and-return-forest_test.go @@ -0,0 +1,47 @@ +package problem1110 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + delete []int + ans [][]int +}{ + + { + []int{1, 2, 3, 4, 5, 6, 7}, + []int{3, 5}, + [][]int{{6}, {7}, {1, 2, kit.NULL, 4}}, + }, + + // 可以有多个 testcase +} + +func Test_delNodes(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + tmps := delNodes(root, tc.delete) + ans := make([][]int, len(tmps)) + for i, t := range tmps { + ans[i] = kit.Tree2ints(t) + } + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_delNodes(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + delNodes(root, tc.delete) + } + } +} diff --git a/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/README.md b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/README.md new file mode 100755 index 000000000..d60e9c5c1 --- /dev/null +++ b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/README.md @@ -0,0 +1,39 @@ +# [1111. Maximum Nesting Depth of Two Valid Parentheses Strings](https://leetcode.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/) + +A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: + +- It is the empty string, or +- It can be written as AB (A concatenated with B), where A and B are VPS's, or +- It can be written as (A), where A is a VPS. + +We can similarly define the nesting depth depth(S) of any VPS S as follows: + +- depth("") = 0 +- depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's +- depth("(" + A + ")") = 1 + depth(A), where A is a VPS. + +For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's. + +Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length). + +Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value. + +Return an answer array (of length seq.length) that encodes such a choice of A and B: answer[i] = 0 if seq[i] is part of A, else answer[i] = 1. Note that even though multiple answers may exist, you may return any of them. + +Example 1: + +```text +Input: seq = "(()())" +Output: [0,1,1,1,1,0] +``` + +Example 2: + +```text +Input: seq = "()(())()" +Output: [0,0,0,1,1,0,1,1] +``` + +Constraints: + +- `1 <= seq.size <= 10000` diff --git a/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings.go b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings.go new file mode 100755 index 000000000..c537aab73 --- /dev/null +++ b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings.go @@ -0,0 +1,16 @@ +package problem1111 + +func maxDepthAfterSplit(seq string) []int { + res := make([]int, len(seq)) + stack, top := make([]int, len(seq)), -1 + for i, r := range seq { + if r == '(' { + top++ + stack[top], res[i] = i, top%2 + } else { + res[i] = res[stack[top]] + top-- + } + } + return res +} diff --git a/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings_test.go b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings_test.go new file mode 100755 index 000000000..9d533ff08 --- /dev/null +++ b/Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings/maximum-nesting-depth-of-two-valid-parentheses-strings_test.go @@ -0,0 +1,42 @@ +package problem1111 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + seq string + ans []int +}{ + + { + "(()())", + []int{0, 1, 1, 1, 1, 0}, + }, + + { + "()(())()", + []int{0, 0, 0, 1, 1, 0, 0, 0}, + }, + + // 可以有多个 testcase +} + +func Test_maxDepthAfterSplit(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxDepthAfterSplit(tc.seq), "输入:%v", tc) + } +} + +func Benchmark_maxDepthAfterSplit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxDepthAfterSplit(tc.seq) + } + } +} diff --git a/Algorithms/1122.relative-sort-array/README.md b/Algorithms/1122.relative-sort-array/README.md new file mode 100755 index 000000000..d5ee6bd0e --- /dev/null +++ b/Algorithms/1122.relative-sort-array/README.md @@ -0,0 +1,19 @@ +# [1122. Relative Sort Array](https://leetcode.com/problems/relative-sort-array/) + +Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. + +Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that don't appear in arr2 should be placed at the end of arr1 in ascending order. + +Example 1: + +```text +Input: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6] +Output: [2,2,2,1,4,3,3,9,6,7,19] +``` + +Constraints: + +- `arr1.length, arr2.length <= 1000` +- `0 <= arr1[i], arr2[i] <= 1000` +- `Each arr2[i] is distinct.` +- `Each arr2[i] is in arr1.` diff --git a/Algorithms/1122.relative-sort-array/relative-sort-array.go b/Algorithms/1122.relative-sort-array/relative-sort-array.go new file mode 100755 index 000000000..fb07ff0cc --- /dev/null +++ b/Algorithms/1122.relative-sort-array/relative-sort-array.go @@ -0,0 +1,24 @@ +package problem1122 + +func relativeSortArray(A, B []int) []int { + count := [1001]int{} + for _, a := range A { + count[a]++ + } + + res := make([]int, 0, len(A)) + for _, b := range B { + for count[b] > 0 { + res = append(res, b) + count[b]-- + } + } + for i := 0; i < 1001; i++ { + for count[i] > 0 { + res = append(res, i) + count[i]-- + } + } + + return res +} diff --git a/Algorithms/1122.relative-sort-array/relative-sort-array_test.go b/Algorithms/1122.relative-sort-array/relative-sort-array_test.go new file mode 100755 index 000000000..2ef8b13c1 --- /dev/null +++ b/Algorithms/1122.relative-sort-array/relative-sort-array_test.go @@ -0,0 +1,45 @@ +package problem1122 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr1 []int + arr2 []int + ans []int +}{ + + { + []int{940, 779, 194, 460, 545, 15, 143, 228, 733, 274, 652, 234, 831, 932, 939, 378, 159, 824, 614, 152, 989, 256, 919, 133, 922, 491, 208, 702, 503, 305, 906, 259, 346, 535, 683, 657, 929, 775, 384, 787, 966, 199, 623, 93, 507, 108, 643, 456, 897, 394, 628, 529, 277, 190, 438, 837, 341, 631, 988, 409, 629, 540, 98, 863, 678, 845, 452, 156, 600, 77, 360, 347, 522, 221, 325, 949, 162, 810, 688, 892, 665, 734, 475, 209, 816, 636, 421, 374, 792, 499, 386, 213, 442, 977, 310, 367, 379, 671, 626, 243, 482, 513, 128, 541, 705, 297, 290, 649, 265, 289, 762, 302, 418, 759, 204, 331, 288, 260, 389, 195, 60, 765, 107, 763, 441, 106, 743, 595, 461, 299, 616, 68, 19, 909, 978, 230, 925, 605, 27, 856, 180, 771, 361, 12, 911, 800, 655, 574, 3, 834, 6, 313, 84, 236, 923, 524, 884, 562, 86, 684, 757, 520, 927, 891, 240, 385, 565, 75, 33, 437, 1000, 537, 492, 607, 139, 877, 67, 53, 191, 263, 376, 741, 24, 487, 21, 687, 292, 92, 801, 161, 183, 716, 822, 231, 672, 189, 90, 343, 566, 8, 345, 865, 16, 560, 166, 575, 275, 878, 812, 739, 18, 531, 451, 171, 330, 679, 321, 89, 836, 550, 314, 425, 729, 309, 868, 916, 262, 176, 692, 711, 695, 797, 381, 375, 212, 814, 153, 366, 589, 690, 419, 738, 168, 337, 601, 899, 914, 453, 745, 145, 480, 23, 47, 510, 844, 71, 848, 114, 669, 157, 673, 591, 872, 205, 658, 774, 501, 323, 653, 606, 542, 434, 272, 901, 383, 39, 990, 728, 87, 693, 268, 890, 364, 70, 196, 617, 553, 766, 782, 273, 342, 188, 319, 704, 694, 584, 178, 430, 610, 650, 789, 903, 637, 455, 144, 536, 449, 339, 770, 777, 109, 724, 760, 737, 564, 250, 498, 284, 397, 357, 559, 829, 630, 594, 663, 353, 120, 618, 938, 767, 862, 577, 817, 276, 311, 576, 751, 28, 432, 833, 225, 468, 956, 710, 583, 5, 538, 363, 187, 700, 850, 502, 283, 459, 14, 981, 202, 484, 37, 422, 937, 736, 888, 490, 613, 373, 136, 568, 943, 344, 680, 900, 985, 995, 511, 44, 233, 134, 975, 883, 338, 497, 61, 905, 867, 110, 398, 917, 0, 298, 185, 644, 997, 244, 846, 137, 802, 926, 223, 62, 226, 315, 615, 138, 854, 852, 857, 725, 656, 703, 586, 744, 783, 318, 847, 301, 674, 219, 448, 48, 181, 882, 963, 20, 549, 116, 457, 602, 945, 111, 80, 586, 433, 184, 835, 991, 676, 181, 417, 944, 750, 494, 100, 640, 843, 963, 783, 819, 571, 670, 886, 493, 182, 796, 371, 933, 248, 639, 924, 706, 443, 635, 264, 611, 772, 875, 131, 755, 838, 387, 950, 660, 504, 662, 786, 76, 151, 206, 192, 349, 119, 295, 902, 124, 294, 532, 116, 329, 135, 63, 596, 971, 91, 286, 912, 698, 509, 72, 962, 994, 426, 95, 411, 151, 668, 980, 974, 474, 500, 555, 509, 830, 621, 783, 793, 898, 446, 640, 489, 556, 772, 201, 942, 113, 533, 619, 791, 552, 746, 675, 942, 251, 708, 908, 740, 521, 952, 380, 141, 554, 420, 494, 404, 676, 439, 619, 593, 668, 795, 942, 963, 279, 624, 380, 958, 224, 457, 172, 388, 764, 182, 454, 1, 151, 747, 970, 222, 130, 790, 983, 348, 332, 286, 840, 467, 388, 251, 811, 811, 11, 855, 718, 135, 718, 612, 462, 226, 372, 173, 828, 597, 640, 861, 40, 504, 962, 744, 543, 887, 509, 450, 830, 326, 329, 242, 532, 46, 192, 13, 436, 450, 241, 746, 436, 138, 556, 667, 561, 732, 570, 854, 539, 306, 10, 102, 445, 753, 740, 880, 224, 56, 795, 428, 101, 413, 586, 835, 973, 332, 348, 42, 132, 380, 291, 186, 382, 935, 885, 117, 112, 869, 115, 216, 485, 769, 732, 141, 596, 349, 462, 473, 731, 707, 410, 65, 838, 414, 355, 992, 570, 662, 790, 201, 95, 622, 795, 670, 206, 258, 811, 182, 281, 165, 572, 970, 352, 632, 968, 500, 232, 135, 795, 362, 755, 979, 116, 247, 847, 902, 744, 124, 924, 402, 428, 239, 29, 723, 13, 864, 65, 698, 805, 567, 785, 270, 910, 35, 526, 51, 406, 718, 307, 316, 13, 835, 588, 219, 320, 203, 908, 748, 443, 141, 612, 404, 160, 270, 982, 720, 193, 879, 849, 732, 962, 154, 181, 392, 886, 91, 252, 76, 681, 572, 876, 677, 328, 457, 951, 26, 880, 876, 252, 588, 457, 229, 426, 388, 721, 295, 481, 967, 934, 103, 308, 293, 326, 123, 76, 463, 715, 563, 993, 962, 296, 961, 94, 881, 151, 706, 179, 749, 660, 46, 544, 72, 443, 85, 715, 786, 278}, + []int{61, 153, 262, 606, 917, 434, 47, 409, 190, 899, 166, 503, 183, 156, 694, 911, 24, 765, 451, 244, 234, 480, 375, 438, 16, 290, 653, 511, 498, 814, 834, 128, 367, 688, 344, 501, 739, 339, 702, 687, 385, 939, 268, 27, 176, 468, 833, 204, 607, 421, 817, 87, 777, 824, 484, 724, 92, 455, 452, 692, 243, 779, 535, 789, 360, 628, 430, 679, 18, 460, 265, 600, 800, 8, 274, 644, 836, 196, 529, 774, 314, 575, 338, 977, 614, 110, 831, 381, 325, 995, 771, 613, 187, 848, 865, 273, 364, 39, 502, 705, 84, 845, 905, 704, 134, 292, 311, 925, 497, 671, 67, 566, 114, 693, 610, 510, 379, 975, 741, 762, 93, 213, 901, 678, 695, 751, 230, 492, 892, 212, 283, 161, 323, 536, 700, 914, 760, 297, 342, 309, 490, 6, 932, 792, 923, 199, 846, 345, 376, 816, 337, 331, 770, 98, 23, 862, 108, 711, 374, 966, 812, 649, 728, 617, 277, 903, 383, 194, 956, 574, 137, 595, 766, 185, 289, 168, 672, 346, 937, 856, 145, 658, 763, 343, 33, 171, 631, 545, 906, 542, 397, 900, 144, 456, 180, 21, 90, 441, 988, 537, 106, 208, 989, 366, 680, 890, 5, 652, 550, 298, 143, 629, 449, 782, 767, 276, 520, 710, 475, 940, 188, 442, 560, 341, 432, 883, 690, 891, 191, 231, 513, 373, 347, 12, 797, 288, 195, 386, 990, 636, 225, 884, 1000, 482, 487, 418, 319, 109, 863, 284, 745, 759, 801, 394, 829, 305, 363, 202, 259, 531, 616, 736, 44, 540, 321, 844, 152, 353, 565, 657, 802, 453, 663, 938, 68, 655, 729, 14, 491, 310, 228, 263, 605, 507, 637, 665, 205, 499, 949, 743, 589, 909, 878, 978, 53, 419, 330, 302, 256, 837, 757, 522, 221, 576, 240, 897, 981, 3, 15, 236, 524, 425, 583, 19, 60, 929, 716, 623, 107, 461, 684, 553, 868, 673, 361, 822, 275, 357, 422, 775, 926, 643, 594, 299, 398, 260, 71, 601, 538, 28, 564, 62, 922, 626, 568, 389, 120, 669, 162, 877, 810, 888, 133, 384, 541, 75, 139, 209, 70, 734, 733, 37, 159, 562, 916, 997, 683, 919, 927, 591, 787, 77, 136, 850, 189, 157, 559, 378, 738, 618, 233, 650, 584, 867, 86, 630, 985, 313, 0, 272, 250, 223, 943, 178, 437, 89, 737, 872, 577, 459}, + []int{61, 153, 262, 606, 917, 434, 47, 409, 190, 899, 166, 503, 183, 156, 694, 911, 24, 765, 451, 244, 234, 480, 375, 438, 16, 290, 653, 511, 498, 814, 834, 128, 367, 688, 344, 501, 739, 339, 702, 687, 385, 939, 268, 27, 176, 468, 833, 204, 607, 421, 817, 87, 777, 824, 484, 724, 92, 455, 452, 692, 243, 779, 535, 789, 360, 628, 430, 679, 18, 460, 265, 600, 800, 8, 274, 644, 836, 196, 529, 774, 314, 575, 338, 977, 614, 110, 831, 381, 325, 995, 771, 613, 187, 848, 865, 273, 364, 39, 502, 705, 84, 845, 905, 704, 134, 292, 311, 925, 497, 671, 67, 566, 114, 693, 610, 510, 379, 975, 741, 762, 93, 213, 901, 678, 695, 751, 230, 492, 892, 212, 283, 161, 323, 536, 700, 914, 760, 297, 342, 309, 490, 6, 932, 792, 923, 199, 846, 345, 376, 816, 337, 331, 770, 98, 23, 862, 108, 711, 374, 966, 812, 649, 728, 617, 277, 903, 383, 194, 956, 574, 137, 595, 766, 185, 289, 168, 672, 346, 937, 856, 145, 658, 763, 343, 33, 171, 631, 545, 906, 542, 397, 900, 144, 456, 180, 21, 90, 441, 988, 537, 106, 208, 989, 366, 680, 890, 5, 652, 550, 298, 143, 629, 449, 782, 767, 276, 520, 710, 475, 940, 188, 442, 560, 341, 432, 883, 690, 891, 191, 231, 513, 373, 347, 12, 797, 288, 195, 386, 990, 636, 225, 884, 1000, 482, 487, 418, 319, 109, 863, 284, 745, 759, 801, 394, 829, 305, 363, 202, 259, 531, 616, 736, 44, 540, 321, 844, 152, 353, 565, 657, 802, 453, 663, 938, 68, 655, 729, 14, 491, 310, 228, 263, 605, 507, 637, 665, 205, 499, 949, 743, 589, 909, 878, 978, 53, 419, 330, 302, 256, 837, 757, 522, 221, 576, 240, 897, 981, 3, 15, 236, 524, 425, 583, 19, 60, 929, 716, 623, 107, 461, 684, 553, 868, 673, 361, 822, 275, 357, 422, 775, 926, 643, 594, 299, 398, 260, 71, 601, 538, 28, 564, 62, 922, 626, 568, 389, 120, 669, 162, 877, 810, 888, 133, 384, 541, 75, 139, 209, 70, 734, 733, 37, 159, 562, 916, 997, 683, 919, 927, 591, 787, 77, 136, 850, 189, 157, 559, 378, 738, 618, 233, 650, 584, 867, 86, 630, 985, 313, 0, 272, 250, 223, 943, 178, 437, 89, 737, 872, 577, 459, 1, 10, 11, 13, 13, 13, 20, 26, 29, 35, 40, 42, 46, 46, 48, 51, 56, 63, 65, 65, 72, 72, 76, 76, 76, 80, 85, 91, 91, 94, 95, 95, 100, 101, 102, 103, 111, 112, 113, 115, 116, 116, 116, 117, 119, 123, 124, 124, 130, 131, 132, 135, 135, 135, 138, 138, 141, 141, 141, 151, 151, 151, 151, 154, 160, 165, 172, 173, 179, 181, 181, 181, 182, 182, 182, 184, 186, 192, 192, 193, 201, 201, 203, 206, 206, 216, 219, 219, 222, 224, 224, 226, 226, 229, 232, 239, 241, 242, 247, 248, 251, 251, 252, 252, 258, 264, 270, 270, 278, 279, 281, 286, 286, 291, 293, 294, 295, 295, 296, 301, 306, 307, 308, 315, 316, 318, 320, 326, 326, 328, 329, 329, 332, 332, 348, 348, 349, 349, 352, 355, 362, 371, 372, 380, 380, 380, 382, 387, 388, 388, 388, 392, 402, 404, 404, 406, 410, 411, 413, 414, 417, 420, 426, 426, 428, 428, 433, 436, 436, 439, 443, 443, 443, 445, 446, 448, 450, 450, 454, 457, 457, 457, 457, 462, 462, 463, 467, 473, 474, 481, 485, 489, 493, 494, 494, 500, 500, 504, 504, 509, 509, 509, 521, 526, 532, 532, 533, 539, 543, 544, 549, 552, 554, 555, 556, 556, 561, 563, 567, 570, 570, 571, 572, 572, 586, 586, 586, 588, 588, 593, 596, 596, 597, 602, 611, 612, 612, 615, 619, 619, 621, 622, 624, 632, 635, 639, 640, 640, 640, 656, 660, 660, 662, 662, 667, 668, 668, 670, 670, 674, 675, 676, 676, 677, 681, 698, 698, 703, 706, 706, 707, 708, 715, 715, 718, 718, 718, 720, 721, 723, 725, 731, 732, 732, 732, 740, 740, 744, 744, 744, 746, 746, 747, 748, 749, 750, 753, 755, 755, 764, 769, 772, 772, 783, 783, 783, 785, 786, 786, 790, 790, 791, 793, 795, 795, 795, 795, 796, 805, 811, 811, 811, 819, 828, 830, 830, 835, 835, 835, 838, 838, 840, 843, 847, 847, 849, 852, 854, 854, 855, 857, 861, 864, 869, 875, 876, 876, 879, 880, 880, 881, 882, 885, 886, 886, 887, 898, 902, 902, 908, 908, 910, 912, 924, 924, 933, 934, 935, 942, 942, 942, 944, 945, 950, 951, 952, 958, 961, 962, 962, 962, 962, 963, 963, 963, 967, 968, 970, 970, 971, 973, 974, 979, 980, 982, 983, 991, 992, 993, 994}, + }, + + { + []int{2, 3, 1, 3, 2, 4, 6, 7, 9, 2, 19}, + []int{2, 1, 4, 3, 9, 6}, + []int{2, 2, 2, 1, 4, 3, 3, 9, 6, 7, 19}, + }, + + // 可以有多个 testcase +} + +func Test_relativeSortArray(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, relativeSortArray(tc.arr1, tc.arr2), "输入:%v", tc) + } +} + +func Benchmark_relativeSortArray(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + relativeSortArray(tc.arr1, tc.arr2) + } + } +} diff --git a/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/README.md b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/README.md new file mode 100755 index 000000000..974e29ba3 --- /dev/null +++ b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/README.md @@ -0,0 +1,39 @@ +# [1123. Lowest Common Ancestor of Deepest Leaves](https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/) + +Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. + +Recall that: + +- The node of a binary tree is a leaf if and only if it has no children +- The depth of the root of the tree is 0, and if the depth of a node is d, the depth of each of its children is d+1. +- The lowest common ancestor of a set S of nodes is the node A with the largest depth such that every node in S is in the subtree with root A. + +Example 1: + +```text +Input: root = [1,2,3] +Output: [1,2,3] +Explanation: +The deepest leaves are the nodes with values 2 and 3. +The lowest common ancestor of these leaves is the node with value 1. +The answer returned is a TreeNode object (not an array) with serialization "[1,2,3]". +``` + +Example 2: + +```text +Input: root = [1,2,3,4] +Output: [4] +``` + +Example 3: + +```text +Input: root = [1,2,3,4,5] +Output: [2,4,5] +``` + +Constraints: + +- The given tree will have between 1 and 1000 nodes. +- Each node of the tree will have a distinct value between 1 and 1000. diff --git a/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.go b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.go new file mode 100755 index 000000000..60df58fa4 --- /dev/null +++ b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.go @@ -0,0 +1,35 @@ +package problem1123 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func lcaDeepestLeaves(root *TreeNode) *TreeNode { + res, _ := dfs(root) + return res +} + +func dfs(node *TreeNode) (*TreeNode, int) { + if node == nil { + return nil, 0 + } + + l, ld := dfs(node.Left) + r, rd := dfs(node.Right) + + if ld > rd { + return l, ld + 1 + } + + if rd > ld { + return r, rd + 1 + } + + return node, ld + 1 +} diff --git a/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves_test.go b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves_test.go new file mode 100755 index 000000000..39f491fd9 --- /dev/null +++ b/Algorithms/1123.lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves_test.go @@ -0,0 +1,56 @@ +package problem1123 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans []int +}{ + + { + []int{1, 2, 3}, + []int{1, 2, 3}, + }, + + { + []int{1, 2, 3, kit.NULL, kit.NULL, 4}, + []int{4}, + }, + + { + []int{1, 2, 3, 4}, + []int{4}, + }, + + { + []int{1, 2, 3, 4, 5}, + []int{2, 4, 5}, + }, + + // 可以有多个 testcase +} + +func Test_lcaDeepestLeaves(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ans := kit.Tree2ints(lcaDeepestLeaves(root)) + ast.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_lcaDeepestLeaves(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + lcaDeepestLeaves(root) + } + } +} diff --git a/Algorithms/1124.longest-well-performing-interval/README.md b/Algorithms/1124.longest-well-performing-interval/README.md new file mode 100755 index 000000000..9b8e3eb55 --- /dev/null +++ b/Algorithms/1124.longest-well-performing-interval/README.md @@ -0,0 +1,22 @@ +# [1124. Longest Well-Performing Interval](https://leetcode.com/problems/longest-well-performing-interval/) + +We are given hours, a list of the number of hours worked per day for a given employee. + +A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8. + +A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days. + +Return the length of the longest well-performing interval. + +Example 1: + +```text +Input: hours = [9,9,6,0,6,6,9] +Output: 3 +Explanation: The longest well-performing interval is [9,9,6]. +``` + +Constraints: + +- `1 <= hours.length <= 10000` +- `0 <= hours[i] <= 16` diff --git a/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval.go b/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval.go new file mode 100755 index 000000000..cd781df31 --- /dev/null +++ b/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval.go @@ -0,0 +1,32 @@ +package problem1124 + +func longestWPI(hours []int) int { + res, count := 0, 0 + rec := make([]int, len(hours)+2) + for i, h := range hours { + if h > 8 { + count++ + } else { + count-- + } + // + if count > 0 { + res = i + 1 + } else { + if rec[1-count] > 0 { + res = max(res, i-rec[1-count]+1) + } + if rec[-count] == 0 { + rec[-count] = i + 1 + } + } + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval_test.go b/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval_test.go new file mode 100755 index 000000000..889ddc2e2 --- /dev/null +++ b/Algorithms/1124.longest-well-performing-interval/longest-well-performing-interval_test.go @@ -0,0 +1,62 @@ +package problem1124 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + hours []int + ans int +}{ + + { + []int{9, 6, 6, 6, 9, 9}, + 3, + }, + + { + []int{6, 9, 6}, + 1, + }, + + { + []int{13, 8, 13, 4, 10, 11, 12, 5, 3, 0, 14, 16, 9, 2, 11, 12, 11, 10, 6, 14, 8, 6, 3, 6, 2, 4, 3, 3, 10, 5, 10, 13, 0, 5, 16, 6, 15, 12, 5, 3, 5, 9, 7, 2, 6, 14, 12, 12, 16, 13, 1, 7, 2, 6, 9, 5, 16, 5, 4, 15, 0, 12, 4, 13, 8, 10, 0, 4, 15, 5, 3, 2, 11, 6, 7, 5, 12, 6, 4, 15, 16, 1, 1, 11, 13, 10, 16, 2, 11, 15, 0, 1, 10, 5, 15, 16, 9, 6, 9, 10, 5, 0, 6, 11, 12, 12, 6, 14, 13, 3, 8, 16, 16, 10, 16, 0, 9, 2, 5, 5, 7, 11, 8, 5, 15, 6, 16, 14, 13, 4, 7, 7, 1, 12, 3, 10, 1, 8, 10, 0, 12, 15, 14, 0, 3, 1, 5, 15, 5, 8, 4, 8, 12, 16, 10, 6, 11, 8, 5, 11, 6, 11, 15, 15, 5, 11, 1, 11, 9, 8, 13, 10, 9, 3, 7, 7, 6, 6, 15, 1, 15, 15, 2, 9, 6, 0, 6, 10, 3, 1, 4, 8, 4, 3, 0, 15, 10, 10, 9, 3, 12, 0, 13, 6, 2, 12, 11, 14, 9, 9, 1, 15, 10, 3, 7, 0, 11, 3, 8, 1, 9, 5, 14, 9, 12, 7, 8, 12, 14, 0, 3, 14, 12, 6, 1, 14, 0, 1, 0, 8, 12, 2, 2, 6, 0, 4, 4, 11, 11, 3, 7, 1, 3, 11, 4, 14, 4, 11, 12, 1, 13, 4, 3, 6, 9, 7, 7, 10, 15, 3, 2, 16, 14, 6, 14, 13, 8, 7, 0, 10, 4, 15, 3, 0, 12, 14, 0, 1, 14, 13, 14, 12, 7, 1, 9, 10, 3, 7, 8, 7, 0, 12, 15, 10, 3, 2, 3, 4, 6, 0, 4, 4, 13, 13, 0, 14, 12, 1, 13, 13, 16, 11, 3, 15, 5, 0, 2, 10, 6, 14, 16, 11, 11, 11, 12, 8, 3, 16, 7, 13, 2, 1, 13, 14, 1, 9, 8, 5, 14, 4, 8, 2, 12, 7, 7, 11, 2, 15, 15, 12, 12, 9, 9, 13, 8, 0, 12, 8, 2, 14, 2, 6, 1, 3, 3, 0, 0, 6, 0, 16, 10, 10, 9, 4, 4, 5, 12, 0, 3, 16, 11, 10, 0, 16, 15, 14, 2, 0, 1, 6, 15, 7, 12, 3, 1, 5, 2, 0, 11, 16, 2, 16, 1, 14, 7, 12, 16, 1, 5, 5, 6, 4, 3, 3, 12, 8, 14, 0, 2, 14, 3, 7, 9, 1, 8, 16, 12, 4, 13, 13, 9, 14, 12, 6, 16, 16, 9, 4, 15, 0, 2, 13, 4, 7, 10, 8, 2, 10, 13, 5, 9, 16, 10, 4, 15, 1, 10, 8, 7, 5, 3, 7, 6, 14, 1, 5, 3, 15, 2, 13, 2, 12, 13, 13, 11, 5, 6, 11, 9, 14, 11, 5, 8, 10, 0, 0, 12, 0, 7, 4, 0, 9, 12, 14, 13, 6, 7, 1, 14, 5, 5, 2, 5, 11, 5, 14, 3, 6, 9, 14, 12, 7, 7, 6, 0, 12, 1, 4, 1, 12, 6, 4, 0, 2, 16, 3, 4, 1, 12, 15, 16, 14, 3, 15, 7, 10, 7, 10, 14, 3, 8, 14, 5, 9, 3, 9, 0, 7, 7, 2, 1, 14, 16, 10, 2, 16, 4, 2, 3, 9, 2, 8, 11, 2, 10, 13, 9, 0, 4, 0, 16, 6, 9, 9, 14, 1, 8, 10, 5, 12, 9, 10, 14, 0, 5, 3, 7, 15, 11, 9, 8, 2, 16, 6, 10, 12, 2, 0, 13, 16, 4, 11, 8, 2, 3, 15, 11, 4, 16, 1, 2, 0, 15, 15, 11, 14, 10, 8, 14, 2, 11, 11, 14, 10, 2, 6, 11, 0, 15, 15, 3, 0, 6, 9, 10, 7, 11, 15, 16, 14, 10, 15, 6, 10, 4, 1, 1, 11, 10, 3, 8, 8, 11, 6, 8, 2, 15, 11, 16, 2, 15, 4, 5, 5, 13, 12, 1, 9, 14, 9, 10, 7, 7, 9, 10, 9, 6, 12, 12, 1, 14, 16, 13, 5, 5, 8, 8, 14, 0, 16, 15, 8, 10, 9, 15, 4, 12, 15, 5, 4, 12, 5, 9, 9, 1, 6, 12, 12, 1, 8, 2, 15, 1, 11, 1, 1, 1, 1, 10, 14, 3, 10, 12, 5, 6, 12, 16, 12, 6, 7, 0, 9, 12, 8, 5, 11, 5, 11, 5, 11, 6, 14, 1, 0, 13, 0, 14, 6, 7, 13, 5, 14, 1, 13, 16, 12, 8, 15, 13, 16, 16, 2, 14, 3, 16, 2, 1, 14, 2, 3, 9, 3, 10, 5, 5, 1, 2, 2, 3, 8, 0, 16, 14, 11, 3, 8, 16, 16, 16, 13, 16, 15, 15, 11, 13, 15, 7, 12, 5, 5, 10, 7, 1, 3, 15, 10, 16, 14, 16, 2, 4, 0, 12, 1, 5, 5, 15, 11, 6, 12, 1, 8, 10, 1, 4, 0, 15, 10, 16, 6, 5, 1, 0, 7, 12, 15, 12, 5, 0, 2, 0, 9, 10, 6, 9, 5, 7, 0, 12, 15, 8, 11, 16, 12, 12, 3, 2, 14, 5, 16, 7, 8, 15, 0, 16, 16, 6, 3, 7, 13, 14, 5, 9, 12, 9, 9, 0, 0, 7, 11, 8, 4, 5, 16, 10, 5, 0, 9, 0, 12, 9, 2, 3, 4, 11, 5, 14, 11, 1, 7, 12, 2, 2, 13, 11, 11, 2, 2, 12, 7, 12, 9, 16, 11, 14, 13, 14, 15, 13, 9, 10, 12, 12, 7, 14, 7, 10, 0, 6, 10, 1, 1, 13, 16, 11, 12, 13, 3, 10, 7, 3, 16, 2, 5, 8, 2, 0, 7, 14, 8, 1, 11, 13, 9, 4, 2, 13, 13, 11, 11, 14, 15, 12, 4, 3, 12, 15, 14, 12, 2, 4, 3, 11, 12, 8, 15, 7, 11, 15, 15, 6, 8, 14, 13, 0, 14, 7, 5, 10, 4}, + 617, + }, + + { + []int{6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 6, 0, 6, 6, 9}, + 13, + }, + + { + []int{16, 15, 11, 2, 9, 3}, + 6, + }, + + { + []int{9, 9, 6, 0, 6, 6, 9}, + 3, + }, + + // 可以有多个 testcase +} + +func Test_longestWPI(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestWPI(tc.hours), "输入:%v", tc) + } +} + +func Benchmark_longestWPI(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestWPI(tc.hours) + } + } +} diff --git a/Algorithms/1125.smallest-sufficient-team/README.md b/Algorithms/1125.smallest-sufficient-team/README.md new file mode 100755 index 000000000..837d1387b --- /dev/null +++ b/Algorithms/1125.smallest-sufficient-team/README.md @@ -0,0 +1,33 @@ +# [1125. Smallest Sufficient Team](https://leetcode.com/problems/smallest-sufficient-team/) + +In a project, you have a list of required skills req_skills, and a list of people. The i-th person people[i] contains a list of skills that person has. + +Consider a sufficient team: a set of people such that for every required skill in req_skills, there is at least one person in the team who has that skill. We can represent these teams by the index of each person: for example, team = [0, 1, 3] represents the people with skills people[0], people[1], and people[3]. + +Return any sufficient team of the smallest possible size, represented by the index of each person. + +You may return the answer in any order. It is guaranteed an answer exists. + +Example 1: + +```text +Input: req_skills = ["java","nodejs","reactjs"], people = [["java"],["nodejs"],["nodejs","reactjs"]] +Output: [0,2] +``` + +Example 2: + +```text +Input: req_skills = ["algorithms","math","java","reactjs","csharp","aws"], people = [["algorithms","math","java"],["algorithms","math","reactjs"],["java","csharp","aws"],["reactjs","csharp"],["csharp","math"],["aws","java"]] +Output: [1,2] +``` + +Constraints: + +- `1 <= req_skills.length <= 16` +- `1 <= people.length <= 60` +- `1 <= people[i].length, req_skills[i].length, people[i][j].length <= 16` +- `Elements of req_skills and people[i] are (respectively) distinct.` +- `req_skills[i][j], people[i][j][k] are lowercase English letters.` +- `Every skill in people[i] is a skill in req_skills.` +- `It is guaranteed a sufficient team exists.` diff --git a/Algorithms/1125.smallest-sufficient-team/smallest-sufficient-team.go b/Algorithms/1125.smallest-sufficient-team/smallest-sufficient-team.go new file mode 100755 index 000000000..708af95ba --- /dev/null +++ b/Algorithms/1125.smallest-sufficient-team/smallest-sufficient-team.go @@ -0,0 +1,48 @@ +package problem1125 + +import "math" + +func smallestSufficientTeam(reqSkills []string, people [][]string) []int { + index := make(map[string]uint) + for i, skill := range reqSkills { + index[skill] = uint(i) + } + // encode person's skills to integer + personSkills := make([]int, len(people)) + // collect all candidates of a skill + cands := make([][]int, len(reqSkills)) + for i, p := range people { + skills := 0 + for _, skill := range p { + if _, ok := index[skill]; ok { + skills |= 1 << index[skill] + cands[index[skill]] = append(cands[index[skill]], i) + } + } + personSkills[i] = skills + } + + smallestTeam := map[int][]int{0: {}} + + var dfs func(int) []int + dfs = func(skills int) []int { + if team, ok := smallestTeam[skills]; ok { + return team + } + var minTeam []int + minTeamSize := 61 // people.length<=60 + skill := int(math.Log2(float64(skills & -skills))) + for _, c := range cands[skill] { + needSkills := skills & (^personSkills[c]) + team := dfs(needSkills) + if minTeamSize > len(team)+1 { + minTeamSize = len(team) + 1 + minTeam = append(team, c) + } + } + smallestTeam[skills] = minTeam + return minTeam + } + + return dfs(1< 0 { + size := len(nodes) + for k := 0; k < size; k++ { + i := nodes[k] + res[i] = min(res[i], count) + for _, j := range cur[i] { + if seenCur[j] { + continue + } + seenCur[j] = true + nodes = append(nodes, j) + } + } + nodes = nodes[size:] + count++ + // exchange colors + cur, next = next, cur + seenCur, seenNext = seenNext, seenCur + } + } + + red := trans(n, redEdges) + blue := trans(n, blueEdges) + + bfs(make([]int, 1, n*2), red, blue) + bfs(make([]int, 1, n*2), blue, red) + + for i := range res { + if res[i] == math.MaxInt64 { + res[i] = -1 + } + } + + return res +} + +// edge[i] contains all edges started form i +func trans(n int, edges [][]int) (edge [][]int) { + edge = make([][]int, n) + for _, e := range edges { + i, j := e[0], e[1] + edge[i] = append(edge[i], j) + } + return edge +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1129.shortest-path-with-alternating-colors/shortest-path-with-alternating-colors_test.go b/Algorithms/1129.shortest-path-with-alternating-colors/shortest-path-with-alternating-colors_test.go new file mode 100755 index 000000000..40f5fb657 --- /dev/null +++ b/Algorithms/1129.shortest-path-with-alternating-colors/shortest-path-with-alternating-colors_test.go @@ -0,0 +1,104 @@ +package problem1129 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + reds [][]int + blues [][]int + ans []int +}{ + + { + 3, + [][]int{{0, 1}, {1, 2}}, + [][]int{{1, 1}}, + []int{0, 1, 3}, + }, + + { + 9, + [][]int{{3, 1}, {2, 3}, {7, 6}, {5, 1}, {1, 3}, {8, 1}, {5, 4}, {8, 4}, {6, 3}, {4, 7}, {0, 1}, {7, 8}, {3, 8}}, + [][]int{{4, 1}, {5, 8}, {3, 7}, {7, 1}, {1, 8}, {8, 7}, {5, 4}}, + []int{0, 1, -1, 5, 3, -1, 7, 6, 2}, + }, + + { + 5, + [][]int{{0, 1}, {1, 3}, {2, 1}, {3, 1}, {2, 0}, {1, 0}, {0, 2}}, + [][]int{{1, 2}, {3, 2}, {2, 4}, {3, 3}, {0, 3}, {1, 4}, {0, 1}, {0, 2}, {0, 0}, {4, 1}}, + []int{0, 1, 1, 1, 2}, + }, + + { + 5, + [][]int{{0, 1}, {1, 2}, {2, 3}, {3, 4}}, + [][]int{{1, 2}, {2, 3}, {3, 1}}, + []int{0, 1, 2, 3, 7}, + }, + + { + 3, + [][]int{{1, 2}}, + [][]int{{0, 1}}, + []int{0, 1, 2}, + }, + + { + 3, + [][]int{{0, 1}}, + [][]int{{1, 2}}, + []int{0, 1, 2}, + }, + + { + 3, + [][]int{{0, 1}, {1, 2}}, + [][]int{}, + []int{0, 1, -1}, + }, + + { + 3, + [][]int{{0, 1}}, + [][]int{{2, 1}}, + []int{0, 1, -1}, + }, + + { + 3, + [][]int{{1, 0}}, + [][]int{{2, 1}}, + []int{0, -1, -1}, + }, + + { + 3, + [][]int{{0, 1}, {0, 2}}, + [][]int{{1, 0}}, + []int{0, 1, 1}, + }, + + // 可以有多个 testcase +} + +func Test_shortestAlternatingPaths(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, shortestAlternatingPaths(tc.n, tc.reds, tc.blues), "输入:%v", tc) + } +} + +func Benchmark_shortestAlternatingPaths(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + shortestAlternatingPaths(tc.n, tc.reds, tc.blues) + } + } +} diff --git a/Algorithms/1130.minimum-cost-tree-from-leaf-values/README.md b/Algorithms/1130.minimum-cost-tree-from-leaf-values/README.md new file mode 100755 index 000000000..630ed104a --- /dev/null +++ b/Algorithms/1130.minimum-cost-tree-from-leaf-values/README.md @@ -0,0 +1,30 @@ +# [1130. Minimum Cost Tree From Leaf Values](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/) + +Given an array arr of positive integers, consider all binary trees such that: + +- Each node has either 0 or 2 children; +- The values of arr correspond to the values of each leaf in an in-order traversal of the tree. (Recall that a node is a leaf if and only if it has 0 children.) +- The value of each non-leaf node is equal to the product of the largest leaf value in its left and right subtree respectively. + +Among all possible binary trees considered, return the smallest possible sum of the values of each non-leaf node. It is guaranteed this sum fits into a 32-bit integer. + +Example 1: + +```text +Input: arr = [6,2,4] +Output: 32 +Explanation: +There are two possible trees. The first has non-leaf node sum 36, and the second has non-leaf node sum 32. + + 24 24 + / \ / \ + 12 4 6 8 + / \ / \ +6 2 2 4 +``` + +Constraints: + +- `2 <= arr.length <= 40` +- `1 <= arr[i] <= 15` +- `It is guaranteed that the answer fits into a 32-bit signed integer (ie. it is less than 2^31).` diff --git a/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values.go b/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values.go new file mode 100755 index 000000000..9a8a3d772 --- /dev/null +++ b/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values.go @@ -0,0 +1,34 @@ +package problem1130 + +import "math" + +// ref: https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/discuss/339959/One-Pass-O(N)-Time-and-Space +func mctFromLeafValues(A []int) int { + n := len(A) + + stack, top, pop := make([]int, n+1), 0, 0 + stack[top] = math.MaxInt64 + + res := 0 + for _, a := range A { + for stack[top] <= a { + pop, top = stack[top], top-1 + res += pop * min(stack[top], a) + } + stack[top+1], top = a, top+1 + } + + for top >= 2 { + pop, top = stack[top], top-1 + res += pop * stack[top] + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values_test.go b/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values_test.go new file mode 100755 index 000000000..fcf634d2d --- /dev/null +++ b/Algorithms/1130.minimum-cost-tree-from-leaf-values/minimum-cost-tree-from-leaf-values_test.go @@ -0,0 +1,47 @@ +package problem1130 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans int +}{ + + { + []int{12, 4, 13, 8, 10, 1, 5, 14, 5, 4, 3, 11, 6, 7, 5, 12, 6, 4, 14, 15, 2, 2, 11, 13, 10, 15, 3, 11, 15, 1, 2, 10, 6, 14, 15, 9, 7, 9, 9, 5}, + 3898, + }, + + { + []int{1, 2, 3, 4, 5}, + 40, + }, + + { + []int{6, 2, 4}, + 32, + }, + + // 可以有多个 testcase +} + +func Test_mctFromLeafValues(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, mctFromLeafValues(tc.arr), "输入:%v", tc) + } +} + +func Benchmark_mctFromLeafValues(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + mctFromLeafValues(tc.arr) + } + } +} diff --git a/Algorithms/1131.maximum-of-absolute-value-expression/README.md b/Algorithms/1131.maximum-of-absolute-value-expression/README.md new file mode 100755 index 000000000..a21ca2183 --- /dev/null +++ b/Algorithms/1131.maximum-of-absolute-value-expression/README.md @@ -0,0 +1,26 @@ +# [1131. Maximum of Absolute Value Expression](https://leetcode.com/problems/maximum-of-absolute-value-expression/) + +Given two arrays of integers with equal lengths, return the maximum value of: + +|arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j| + +where the maximum is taken over all 0 <= i, j < arr1.length. + +Example 1: + +```text +Input: arr1 = [1,2,3,4], arr2 = [-1,4,5,6] +Output: 13 +``` + +Example 2: + +```text +Input: arr1 = [1,-2,-5,0,10], arr2 = [0,-2,-1,-7,-4] +Output: 20 +``` + +Constraints: + +- `2 <= arr1.length == arr2.length <= 40000` +- `-10^6 <= arr1[i], arr2[i] <= 10^6` diff --git a/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression.go b/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression.go new file mode 100755 index 000000000..32d74379d --- /dev/null +++ b/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression.go @@ -0,0 +1,35 @@ +package problem1131 + +// ref: https://leetcode.com/problems/maximum-of-absolute-value-expression/discuss/340070/topic + +func maxAbsValExpr(A, B []int) int { + Q := [2]int{-1, 1} + + n := len(A) + res := 0 + for _, a := range Q { + for _, b := range Q { + low := a*A[0] + b*B[0] + for i := 1; i < n; i++ { + cur := a*A[i] + b*B[i] + i + res = max(res, cur-low) + low = min(low, cur) + } + } + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression_test.go b/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression_test.go new file mode 100755 index 000000000..91332749c --- /dev/null +++ b/Algorithms/1131.maximum-of-absolute-value-expression/maximum-of-absolute-value-expression_test.go @@ -0,0 +1,45 @@ +package problem1131 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + B []int + ans int +}{ + + { + []int{1, 2, 3, 4}, + []int{-1, 4, 5, 6}, + 13, + }, + + { + []int{1, -2, -5, 0, 10}, + []int{0, -2, -1, -7, -4}, + 20, + }, + + // 可以有多个 testcase +} + +func Test_maxAbsValExpr(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxAbsValExpr(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_maxAbsValExpr(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxAbsValExpr(tc.A, tc.B) + } + } +} diff --git a/Algorithms/1137.n-th-tribonacci-number/README.md b/Algorithms/1137.n-th-tribonacci-number/README.md new file mode 100755 index 000000000..e9dcad992 --- /dev/null +++ b/Algorithms/1137.n-th-tribonacci-number/README.md @@ -0,0 +1,29 @@ +# [1137. N-th Tribonacci Number](https://leetcode.com/problems/n-th-tribonacci-number/) + +The Tribonacci sequence Tn is defined as follows: + +T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. + +Given n, return the value of Tn. + +Example 1: + +```text +Input: n = 4 +Output: 4 +Explanation: +T_3 = 0 + 1 + 1 = 2 +T_4 = 1 + 1 + 2 = 4 +``` + +Example 2: + +```text +Input: n = 25 +Output: 1389537 +``` + +Constraints: + +- `0 <= n <= 37` +- `The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.` diff --git a/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number.go b/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number.go new file mode 100755 index 000000000..d9e3b5462 --- /dev/null +++ b/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number.go @@ -0,0 +1,13 @@ +package problem1137 + +func tribonacci(n int) int { + if n < 2 { + return n + } + a, b, c := 0, 1, 1 + for n > 2 { + a, b, c = b, c, a+b+c + n-- + } + return c +} diff --git a/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number_test.go b/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number_test.go new file mode 100755 index 000000000..129175f09 --- /dev/null +++ b/Algorithms/1137.n-th-tribonacci-number/n-th-tribonacci-number_test.go @@ -0,0 +1,52 @@ +package problem1137 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 35, + 615693474, + }, + + { + 0, + 0, + }, + + { + 4, + 4, + }, + + { + 25, + 1389537, + }, + + // 可以有多个 testcase +} + +func Test_tribonacci(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, tribonacci(tc.n), "输入:%v", tc) + } +} + +func Benchmark_tribonacci(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + tribonacci(tc.n) + } + } +} diff --git a/Algorithms/1138.alphabet-board-path/1138.png b/Algorithms/1138.alphabet-board-path/1138.png new file mode 100644 index 000000000..db370622e Binary files /dev/null and b/Algorithms/1138.alphabet-board-path/1138.png differ diff --git a/Algorithms/1138.alphabet-board-path/README.md b/Algorithms/1138.alphabet-board-path/README.md new file mode 100755 index 000000000..43ad06f21 --- /dev/null +++ b/Algorithms/1138.alphabet-board-path/README.md @@ -0,0 +1,38 @@ +# [1138. Alphabet Board Path](https://leetcode.com/problems/alphabet-board-path/) + +On an alphabet board, we start at position (0, 0), corresponding to character board[0][0]. + +![1138](1138.png) + +Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"], as shown in the diagram below. + +We may make the following moves: + +- 'U' moves our position up one row, if the position exists on the board; +- 'D' moves our position down one row, if the position exists on the board; +- 'L' moves our position left one column, if the position exists on the board; +- 'R' moves our position right one column, if the position exists on the board; +- '!' adds the character board[r][c] at our current position (r, c) to the answer. + +(Here, the only positions that exist on the board are positions with letters on them.) + +Return a sequence of moves that makes our answer equal to target in the minimum number of moves. You may return any path that does so. + +Example 1: + +```text +Input: target = "leet" +Output: "DDR!UURRR!!DDD!" +``` + +Example 2: + +```text +Input: target = "code" +Output: "RR!DDRR!UUL!R!" +``` + +Constraints: + +- `1 <= target.length <= 100` +- `target consists only of English lowercase letters.` diff --git a/Algorithms/1138.alphabet-board-path/alphabet-board-path.go b/Algorithms/1138.alphabet-board-path/alphabet-board-path.go new file mode 100755 index 000000000..ded12f91b --- /dev/null +++ b/Algorithms/1138.alphabet-board-path/alphabet-board-path.go @@ -0,0 +1,44 @@ +package problem1138 + +import "strings" + +func alphabetBoardPath(target string) string { + var sb strings.Builder + + // form [x1,y1] move to [x2,y2] + move := func(x1, y1, x2, y2 int) { + for y1 > y2 { + y1-- + sb.WriteByte('L') + } + for x1 > x2 { + x1-- + sb.WriteByte('U') + } + for x1 < x2 { + x1++ + sb.WriteByte('D') + } + for y1 < y2 { + y1++ + sb.WriteByte('R') + } + return + } + + x1, y1 := 0, 0 + for _, r := range target { + x2, y2 := coordinate(r) + move(x1, y1, x2, y2) + sb.WriteByte('!') + x1, y1 = x2, y2 + } + + return sb.String() +} + +func coordinate(r rune) (x, y int) { + a := int(r - 'a') + x, y = a/5, a%5 + return +} diff --git a/Algorithms/1138.alphabet-board-path/alphabet-board-path_test.go b/Algorithms/1138.alphabet-board-path/alphabet-board-path_test.go new file mode 100755 index 000000000..22220cf38 --- /dev/null +++ b/Algorithms/1138.alphabet-board-path/alphabet-board-path_test.go @@ -0,0 +1,125 @@ +package problem1138 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + target string + ans string +}{ + + { + "dfdsfkjdfleiwllsgoidkjflsdfjdfierwsd", + "RRR!LLLD!URRR!DDD!LLLUU!D!URRRR!LU!LLLD!DR!UURRR!LD!LDDD!LUU!!DRR!LLUU!DRRR!LU!U!LLLDD!URRRR!LLLL!DR!DRR!UUU!LLLD!RRRR!LU!LLLD!RRR!UR!LLDDD!D!UR!UUU!", + }, + + { + "zz", + "DDDDD!!", + }, + + { + "zdz", + "DDDDD!UUUUURRR!LLLDDDDD!", + }, + + { + "zb", + "DDDDD!UUUUUR!", + }, + + { + "lazy", + "DDR!LUU!DDDDD!URRRR!", + }, + + { + "leet", + "DDR!UURRR!!DDD!", + }, + + { + "code", + "RR!DDRR!LUU!R!", + }, + + // 可以有多个 testcase +} + +func Test_alphabetBoardPath(t *testing.T) { + ast := assert.New(t) + for _, tc := range tcs { + ast.Equal(tc.ans, alphabetBoardPath(tc.target), "输入:%v", tc) + } +} + +func Benchmark_alphabetBoardPath(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + alphabetBoardPath(tc.target) + } + } +} + +func Test_coordinate(t *testing.T) { + type args struct { + r rune + } + tests := []struct { + name string + args args + wantX int + wantY int + }{ + { + "a 的坐标", + args{ + r: 'a', + }, + 0, 0, + }, + { + "z 的坐标", + args{ + r: 'z', + }, + 5, 0, + }, + { + "i 的坐标", + args{ + r: 'i', + }, + 1, 3, + }, + { + "m 的坐标", + args{ + r: 'm', + }, + 2, 2, + }, + { + "q 的坐标", + args{ + r: 'q', + }, + 3, 1, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotX, gotY := coordinate(tt.args.r) + if gotX != tt.wantX { + t.Errorf("coordinate() gotX = %v, want %v", gotX, tt.wantX) + } + if gotY != tt.wantY { + t.Errorf("coordinate() gotY = %v, want %v", gotY, tt.wantY) + } + }) + } +} diff --git a/Algorithms/1139.largest-1-bordered-square/README.md b/Algorithms/1139.largest-1-bordered-square/README.md new file mode 100755 index 000000000..c5b90f73a --- /dev/null +++ b/Algorithms/1139.largest-1-bordered-square/README.md @@ -0,0 +1,23 @@ +# [1139. Largest 1-Bordered Square](https://leetcode.com/problems/largest-1-bordered-square/) + +Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn't exist in the grid. + +Example 1: + +```text +Input: grid = [[1,1,1],[1,0,1],[1,1,1]] +Output: 9 +``` + +Example 2: + +```text +Input: grid = [[1,1,0,0]] +Output: 1 +``` + +Constraints: + +- `1 <= grid.length <= 100` +- `1 <= grid[0].length <= 100` +- `grid[i][j] is 0 or 1` diff --git a/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square.go b/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square.go new file mode 100755 index 000000000..19d9fb075 --- /dev/null +++ b/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square.go @@ -0,0 +1,39 @@ +package problem1139 + +func largest1BorderedSquare(A [][]int) int { + m, n := len(A), len(A[0]) + + h := [101][101]int{} + v := [101][101]int{} + + for i := 1; i <= m; i++ { + for j := 1; j <= n; j++ { + if A[i-1][j-1] == 1 { + h[i][j] = h[i][j-1] + 1 + v[i][j] = v[i-1][j] + 1 + } + } + } + + for w := min(m, n); w > 0; w-- { + for i := 1; i+w-1 <= m; i++ { + for j := 1; j+w-1 <= n; j++ { + if v[i+w-1][j] >= w && // left border + v[i+w-1][j+w-1] >= w && // right + h[i][j+w-1] >= w && // top + h[i+w-1][j+w-1] >= w { // buttom + return w * w + } + } + } + } + + return 0 +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square_test.go b/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square_test.go new file mode 100755 index 000000000..3ea7ebee1 --- /dev/null +++ b/Algorithms/1139.largest-1-bordered-square/largest-1-bordered-square_test.go @@ -0,0 +1,52 @@ +package problem1139 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{1, 1, 1, 1}, {1, 0, 0, 1}, {1, 1, 1, 1}}, + 1, + }, + + { + [][]int{{1, 1, 1}, {1, 0, 1}, {1, 1, 1}}, + 9, + }, + + { + [][]int{{0}}, + 0, + }, + + { + [][]int{{1, 1, 0, 0}}, + 1, + }, + + // 可以有多个 testcase +} + +func Test_largest1BorderedSquare(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, largest1BorderedSquare(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_largest1BorderedSquare(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + largest1BorderedSquare(tc.grid) + } + } +} diff --git a/Algorithms/1140.stone-game-ii/README.md b/Algorithms/1140.stone-game-ii/README.md new file mode 100755 index 000000000..c255a3408 --- /dev/null +++ b/Algorithms/1140.stone-game-ii/README.md @@ -0,0 +1,24 @@ +# [1140. Stone Game II](https://leetcode.com/problems/stone-game-ii/) + +Alex and Lee continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to end with the most stones. + +Alex and Lee take turns, with Alex starting first. Initially, M = 1. + +On each player's turn, that player can take all the stones in the first X remaining piles, where 1 <= X <= 2M. Then, we set M = max(M, X). + +The game continues until all the stones have been taken. + +Assuming Alex and Lee play optimally, return the maximum number of stones Alex can get. + +Example 1: + +```text +Input: piles = [2,7,9,4,4] +Output: 10 +Explanation: If Alex takes one pile at the beginning, Lee takes two piles, then Alex takes 2 piles again. Alex can get 2 + 4 + 4 = 10 piles in total. If Alex takes two piles at the beginning, then Lee can take all three piles left. In this case, Alex get 2 + 7 = 9 piles in total. So we return 10 since it's larger. +``` + +Constraints: + +- `1 <= piles.length <= 100` +- `1 <= piles[i] <= 10 ^ 4` diff --git a/Algorithms/1140.stone-game-ii/stone-game-ii.go b/Algorithms/1140.stone-game-ii/stone-game-ii.go new file mode 100755 index 000000000..2e1bd40a2 --- /dev/null +++ b/Algorithms/1140.stone-game-ii/stone-game-ii.go @@ -0,0 +1,41 @@ +package problem1140 + +func stoneGameII(A []int) int { + n := len(A) + + for i := n - 2; i >= 0; i-- { + A[i] += A[i+1] + } + + // new A[i] = sum of old A[i:] + + mem := [101][33]int{} + + var dp func(int, int) int + dp = func(i, m int) int { + if i+2*m >= n { + return A[i] + } + if mem[i][m] > 0 { + return mem[i][m] + } + res := 0 + for x := 1; x <= 2*m; x++ { + res = max( + res, + A[i]-dp(i+x, max(m, x)), + ) + } + mem[i][m] = res + return res + } + + return dp(0, 1) +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1140.stone-game-ii/stone-game-ii_test.go b/Algorithms/1140.stone-game-ii/stone-game-ii_test.go new file mode 100755 index 000000000..7cdcf7827 --- /dev/null +++ b/Algorithms/1140.stone-game-ii/stone-game-ii_test.go @@ -0,0 +1,47 @@ +package problem1140 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + piles []int + ans int +}{ + + { + []int{5819, 9551, 3626, 8100, 6991, 4067, 581, 3914, 895, 9859, 3463, 4463, 851, 1993, 6596, 408, 2950, 5818, 1433, 6552, 8416, 837, 7084, 5066, 1514, 6417, 9411, 9331, 5321, 7705, 1376, 6956, 6964, 2371, 5858, 9570, 6367, 9973, 7921, 2004, 8642, 8935, 861, 3857, 7807, 5708, 5020, 4558, 9641, 2286, 7931, 9637, 7542, 5899, 3814, 491, 6356, 9458, 9074, 8037, 7722, 5403, 7363, 8774, 9165, 3799, 7304, 2596, 2319, 5555, 3382, 8311, 6396, 7246, 2193, 7019, 3019, 4814, 6450, 1934, 9388, 4501, 909, 215, 1656, 3799, 6611, 8907, 739, 2678, 1342, 8707, 4648, 4223, 5271, 5970, 9702, 9413, 6121, 3915}, + 276186, + }, + + { + []int{8270, 7145, 575, 5156, 5126, 2905, 8793, 7817, 5532, 5726, 7071, 7730, 5200, 5369, 5763, 7148, 8287, 9449, 7567, 4850, 1385, 2135, 1737, 9511, 8065, 7063, 8023, 7729, 7084, 8407}, + 98008, + }, + + { + []int{2, 7, 9, 4, 4}, + 10, + }, + + // 可以有多个 testcase +} + +func Test_stoneGameII(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, stoneGameII(tc.piles), "输入:%v", tc) + } +} + +func Benchmark_stoneGameII(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + stoneGameII(tc.piles) + } + } +} diff --git a/Algorithms/1143.longest-common-subsequence/README.md b/Algorithms/1143.longest-common-subsequence/README.md new file mode 100755 index 000000000..e438e2e02 --- /dev/null +++ b/Algorithms/1143.longest-common-subsequence/README.md @@ -0,0 +1,37 @@ +# [1143. Longest Common Subsequence](https://leetcode.com/problems/longest-common-subsequence/) + +Given two strings text1 and text2, return the length of their longest common subsequence. + +A subsequence of a string is a new string generated from the original string with some characters(can be none) deleted without changing the relative order of the remaining characters. (eg, "ace" is a subsequence of "abcde" while "aec" is not). A common subsequence of two strings is a subsequence that is common to both strings. + +If there is no common subsequence, return 0. + +Example 1: + +```text +Input: text1 = "abcde", text2 = "ace" +Output: 3 +Explanation: The longest common subsequence is "ace" and its length is 3. +``` + +Example 2: + +```text +Input: text1 = "abc", text2 = "abc" +Output: 3 +Explanation: The longest common subsequence is "abc" and its length is 3. +``` + +Example 3: + +```text +Input: text1 = "abc", text2 = "def" +Output: 0 +Explanation: There is no such common subsequence, so the result is 0. +``` + +Constraints: + +- `1 <= text1.length <= 1000` +- `1 <= text2.length <= 1000` +- `The input strings consist of lowercase English characters only.` diff --git a/Algorithms/1143.longest-common-subsequence/longest-common-subsequence.go b/Algorithms/1143.longest-common-subsequence/longest-common-subsequence.go new file mode 100755 index 000000000..d6d14270f --- /dev/null +++ b/Algorithms/1143.longest-common-subsequence/longest-common-subsequence.go @@ -0,0 +1,29 @@ +package problem1143 + +func longestCommonSubsequence(s1, s2 string) int { + m, n := len(s1), len(s2) + A, B := []byte(s1), []byte(s2) + + cur := make([]int, m+1) + prev := make([]int, m+1) + + for j := 0; j < n; j++ { + for i := 0; i < m; i++ { + rec := max(prev[i+1], cur[i]) + if A[i] == B[j] { + cur[i+1] = max(rec, prev[i]+1) + } else { + cur[i+1] = rec + } + } + cur, prev = prev, cur + } + return prev[m] +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1143.longest-common-subsequence/longest-common-subsequence_test.go b/Algorithms/1143.longest-common-subsequence/longest-common-subsequence_test.go new file mode 100755 index 000000000..a3fe06f00 --- /dev/null +++ b/Algorithms/1143.longest-common-subsequence/longest-common-subsequence_test.go @@ -0,0 +1,51 @@ +package problem1143 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A string + B string + ans int +}{ + + { + "abcde", + "ace", + 3, + }, + + { + "abc", + "abc", + 3, + }, + + { + "abc", + "def", + 0, + }, + + // 可以有多个 testcase +} + +func Test_longestCommonSubsequence(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestCommonSubsequence(tc.A, tc.B), "输入:%v", tc) + } +} + +func Benchmark_longestCommonSubsequence(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestCommonSubsequence(tc.A, tc.B) + } + } +} diff --git a/Algorithms/1144.decrease-elements-to-make-array-zigzag/README.md b/Algorithms/1144.decrease-elements-to-make-array-zigzag/README.md new file mode 100755 index 000000000..4bed7bd5d --- /dev/null +++ b/Algorithms/1144.decrease-elements-to-make-array-zigzag/README.md @@ -0,0 +1,29 @@ +# [1144. Decrease Elements To Make Array Zigzag](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag/) + +Given an array nums of integers, a move consists of choosing any element and decreasing it by 1. + +An array A is a zigzag array if either: + +Every even-indexed element is greater than adjacent elements, ie. A[0] > A[1] < A[2] > A[3] < A[4] > ... +OR, every odd-indexed element is greater than adjacent elements, ie. A[0] < A[1] > A[2] < A[3] > A[4] < ... +Return the minimum number of moves to transform the given array nums into a zigzag array. + +Example 1: + +```text +Input: nums = [1,2,3] +Output: 2 +Explanation: We can decrease 2 to 0 or 3 to 1. +``` + +Example 2: + +```text +Input: nums = [9,6,1,6,2] +Output: 4 +``` + +Constraints: + +- `1 <= nums.length <= 1000` +- `1 <= nums[i] <= 1000` diff --git a/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag.go b/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag.go new file mode 100755 index 000000000..d35495747 --- /dev/null +++ b/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag.go @@ -0,0 +1,37 @@ +package problem1144 + +import "math" + +func movesToMakeZigzag(A []int) int { + return min( + move(math.MaxInt64, 0, A), + move(A[0], 1, A), + ) +} + +// decrease A[i] to satisfy A[i-1] > A[i] < A[i+1] +func move(left, i int, A []int) int { + n := len(A) + res := 0 + for i+1 < n { + right := A[i+1] + minVal := min(left, right) + if A[i] >= minVal { + res += A[i] - minVal + 1 + } + left = right + i += 2 + } + if i+1 == n && + A[i] >= left { + res += A[i] - left + 1 + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag_test.go b/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag_test.go new file mode 100755 index 000000000..029b90dd3 --- /dev/null +++ b/Algorithms/1144.decrease-elements-to-make-array-zigzag/decrease-elements-to-make-array-zigzag_test.go @@ -0,0 +1,47 @@ +package problem1144 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + nums []int + ans int +}{ + + { + []int{875, 303, 979, 293, 693, 803, 81, 17, 329, 262, 669, 10, 413, 142, 537, 82, 857, 283, 492, 779, 118, 216, 728, 920, 490, 258, 225, 109, 252, 292, 517, 653, 885, 680, 12, 2, 399, 286, 365, 234, 731, 927, 409, 325, 339, 416, 713, 946, 551, 122, 794, 308, 518, 505, 365, 285, 481, 167, 107, 861, 357, 299, 588, 669, 622, 520, 983, 728, 10, 995, 250, 790, 346, 34, 482, 551, 641, 376, 646, 561, 861, 311, 849, 231, 627, 810, 848, 840, 602, 872, 813, 818, 462, 990, 545, 936, 870, 745, 1, 654, 473, 517, 160, 245, 36, 445, 149, 968, 313, 488, 468, 625, 479, 256, 993, 127, 224, 558, 40, 450, 587, 400, 254, 830, 707, 300, 501, 86, 408, 448, 956, 658, 799, 669, 154, 226, 531, 907, 551, 713, 353, 245, 883, 683, 368, 777, 677, 597, 166, 226, 74, 208, 882, 940, 271, 586, 730, 346, 572, 742, 325, 293, 263, 617, 962, 781, 817, 73, 320, 41, 484, 849, 919, 266, 419, 685, 211, 240, 223, 596, 859, 662, 337, 14, 803, 476, 763, 62, 115, 491, 840, 623, 593, 22, 763, 145, 616, 115, 393, 51, 239, 264, 968, 998, 391, 49, 159, 297, 410, 807, 787, 510, 860, 769, 703, 834, 298, 249, 229, 960, 98, 849, 65, 704, 340, 60, 174, 263, 261, 38, 79, 661, 237, 853, 930, 205, 602, 498, 117, 461, 918, 540, 261, 71, 440, 476, 801, 455, 235, 346, 673, 385, 205, 379, 238, 443, 861, 844, 718, 451, 492, 708, 528, 219, 749, 500, 67, 219, 489, 966, 165, 403, 359, 684, 961, 547, 832, 678, 674, 446, 831, 804, 479, 696, 471, 164, 577, 482, 237, 557, 123, 669, 940, 809, 546, 120, 973, 835, 549, 958, 960, 494, 369, 496, 600, 594, 485, 517, 403, 174, 308, 705, 431, 644, 441, 220, 836, 919, 634, 542, 564, 763, 481, 993, 603, 300, 379, 990, 377, 631, 147, 185, 997, 244, 972, 482, 410, 97, 167, 103, 235, 316, 149, 894, 399, 706, 651, 881, 185, 683, 479, 791, 5, 161, 746, 34, 735, 151, 405, 616, 478, 372, 831, 798, 918, 218, 752, 368, 208, 852, 582, 496, 281, 789, 339, 887, 90, 447, 40, 156, 163, 242, 276, 159, 175, 122, 3, 403, 327, 168, 353, 634, 935, 144, 411, 321, 956, 931, 632, 548, 710, 932, 366, 820, 46, 113, 780, 637, 738, 64, 253, 129, 279, 885, 476, 493, 712, 410, 325, 85, 435, 552, 545, 936, 247, 598, 615, 546, 637, 582, 300, 571, 425, 180, 446, 552, 509, 109, 653, 404, 739, 387, 650, 535, 247, 590, 628, 455, 993, 19, 108, 513, 316, 975, 534, 375, 850, 911, 403, 476, 713, 426, 904, 934, 8, 306, 41, 517, 491, 744, 720, 517, 589, 21, 354, 954, 63, 922, 863, 687, 376, 421, 185, 988, 643, 96, 724, 210, 218, 612, 207, 437, 927, 728, 666, 598, 142, 670, 165, 561, 942, 447, 916, 363, 731, 441, 318, 613, 750, 108, 176, 472, 85, 855, 144, 635, 78, 115, 586, 209, 845, 149, 905, 891, 390, 921, 741, 874, 691, 212, 784, 580, 364, 324, 907, 830, 669, 204, 31, 340, 830, 7, 15, 742, 17, 197, 223, 615, 335, 684, 172, 685, 193, 44, 19, 669, 446, 525, 361, 591, 847, 900, 734, 928, 56, 939, 412, 488, 732, 186, 816, 165, 77, 564, 147, 376, 712, 82, 128, 726, 555, 72, 316, 983, 330, 219, 339, 30, 283, 557, 879, 774, 7, 372, 215, 106, 322, 207, 946, 389, 333, 348, 969, 730, 899, 95, 301, 489, 407, 688, 929, 438, 672, 513, 210, 533, 38, 604, 160, 541, 80, 932, 871, 510, 78, 450, 884, 306, 867, 466, 530, 766, 220, 907, 736, 571, 70, 380, 700, 216, 482, 414, 670, 47, 481, 389, 634, 199, 178, 455, 90, 579, 484, 988, 38, 160, 545, 21, 234, 712, 221, 813, 566, 847, 605, 183, 338, 513, 304, 667, 982, 426, 335, 982, 420, 956, 809, 809, 876, 118, 577, 276, 965, 944, 917, 383, 315, 518, 96, 376, 648, 247, 831, 61, 872, 146, 572, 446, 203, 243, 86, 791, 418, 629, 485, 306, 411, 539, 83, 126, 589, 119, 545, 580, 627, 15, 909, 135, 539, 15, 764, 58, 120, 595, 846, 687, 397, 969, 144, 179, 308, 867, 569, 202, 492, 581, 130, 111, 630, 966, 378, 463, 349, 589, 241, 423, 774, 54, 639, 594, 492, 974, 766, 744, 540, 301, 565, 139, 123, 110, 216, 539, 480, 656, 647, 63, 369, 847, 546, 623, 584, 786, 407, 289, 361, 792, 329, 782, 686, 132, 98, 343, 582, 999, 427, 310, 376, 254, 980, 397, 912, 975, 201, 636, 538, 883, 245, 505, 493, 894, 766, 772, 340, 458, 112, 128, 803, 395, 989, 558, 296, 94, 837, 653, 360, 866, 325, 675, 435, 93, 127, 199, 531, 165, 892, 80, 648, 496, 127, 253, 959, 703, 912, 216, 228, 615, 412, 868, 212, 768, 626, 827, 653, 77, 998, 148, 593, 745, 807, 917, 468, 289, 909, 267, 639, 649, 743, 527, 26, 591, 857, 997, 860, 83, 736, 412, 9, 293, 872, 792, 248, 755, 380, 401, 804, 15, 229, 196, 350, 760, 1, 433, 541, 626, 359, 271, 426, 20, 548, 24, 377, 326, 583, 89, 376, 342, 831, 629, 349, 317, 377, 401, 369, 852, 930, 286, 200, 170, 332, 316, 427, 425, 377, 325, 987, 599, 463, 127, 348, 519, 754, 361, 917, 176, 821, 7, 775, 346, 597, 369, 362, 646, 19, 926, 976, 28, 912, 209, 378, 671, 401, 627, 754, 50, 11, 143, 554, 810, 896, 586, 235, 293, 379, 628, 202, 606, 930, 807, 707, 530, 602, 219, 246, 229, 596, 481, 789, 429, 778, 379, 684, 474, 210, 2, 19, 874, 357, 247, 259, 334, 615, 667, 534, 578, 178, 743, 953, 399, 583, 689, 858, 536, 829, 661, 402, 401, 477, 859, 257, 92}, + 113084, + }, + + { + []int{1, 2, 3}, + 2, + }, + + { + []int{9, 6, 1, 6, 2}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_movesToMakeZigzag(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, movesToMakeZigzag(tc.nums), "输入:%v", tc) + } +} + +func Benchmark_movesToMakeZigzag(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + movesToMakeZigzag(tc.nums) + } + } +} diff --git a/Algorithms/1145.binary-tree-coloring-game/1.png b/Algorithms/1145.binary-tree-coloring-game/1.png new file mode 100644 index 000000000..e81767a8b Binary files /dev/null and b/Algorithms/1145.binary-tree-coloring-game/1.png differ diff --git a/Algorithms/1145.binary-tree-coloring-game/README.md b/Algorithms/1145.binary-tree-coloring-game/README.md new file mode 100755 index 000000000..1104833ed --- /dev/null +++ b/Algorithms/1145.binary-tree-coloring-game/README.md @@ -0,0 +1,27 @@ +# [1145. Binary Tree Coloring Game](https://leetcode.com/problems/binary-tree-coloring-game/) + +Two players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and each node has a distinct value from 1 to n. + +Initially, the first player names a value x with 1 <= x <= n, and the second player names a value y with 1 <= y <= n and y != x. The first player colors the node with value x red, and the second player colors the node with value y blue. + +Then, the players take turns starting with the first player. In each turn, that player chooses a node of their color (red if player 1, blue if player 2) and colors an uncolored neighbor of the chosen node (either the left child, right child, or parent of the chosen node.) + +If (and only if) a player cannot choose such a node in this way, they must pass their turn. If both players pass their turn, the game ends, and the winner is the player that colored more nodes. + +You are the second player. If it is possible to choose such a y to ensure you win the game, return true. If it is not possible, return false. + +Example 1: + +![1](1.png) + +```text +Input: root = [1,2,3,4,5,6,7,8,9,10,11], n = 11, x = 3 +Output: true +Explanation: The second player can choose the node with value 2. +``` + +Constraints: + +- `root is the root of a binary tree with n nodes and distinct node values from 1 to n.` +- `n is odd.` +- `1 <= x <= n <= 100` diff --git a/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game.go b/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game.go new file mode 100755 index 000000000..8c2e9adc4 --- /dev/null +++ b/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game.go @@ -0,0 +1,41 @@ +package problem1145 + +import ( + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func btreeGameWinningMove(root *TreeNode, n int, x int) bool { + var left, right int + + var dfs func(*TreeNode) int + dfs = func(node *TreeNode) int { + if node == nil { + return 0 + } + l, r := dfs(node.Left), dfs(node.Right) + if node.Val == x { + left, right = l, r + } + return l + r + 1 + } + + dfs(root) + + up := n - left - right - 1 + n /= 2 + + return left > n || right > n || up > n +} + +// node-x split tree into 3 parts: +// node-x.Left, node-x.Right and up(node-x parent plus node-x brother) +// second player must takes the biggest part +// second player win the game if his part > n/2 diff --git a/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game_test.go b/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game_test.go new file mode 100755 index 000000000..7fe661cec --- /dev/null +++ b/Algorithms/1145.binary-tree-coloring-game/binary-tree-coloring-game_test.go @@ -0,0 +1,58 @@ +package problem1145 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + n int + x int + ans bool +}{ + + { + []int{6, 3, kit.NULL, 7, 4, kit.NULL, kit.NULL, kit.NULL, 2, kit.NULL, 1, kit.NULL, 5}, + 7, + 3, + true, + }, + + { + []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + 11, + 3, + true, + }, + + { + []int{3, kit.NULL, 6, kit.NULL, 7, 4, kit.NULL, 1, 2, kit.NULL, kit.NULL, 5}, + 7, + 4, + false, + }, + + // 可以有多个 testcase +} + +func Test_btreeGameWinningMove(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, btreeGameWinningMove(root, tc.n, tc.x), "输入:%v", tc) + } +} + +func Benchmark_btreeGameWinningMove(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + btreeGameWinningMove(root, tc.n, tc.x) + } + } +} diff --git a/Algorithms/1146.snapshot-array/README.md b/Algorithms/1146.snapshot-array/README.md new file mode 100755 index 000000000..9fb14f90e --- /dev/null +++ b/Algorithms/1146.snapshot-array/README.md @@ -0,0 +1,30 @@ +# [1146. Snapshot Array](https://leetcode.com/problems/snapshot-array/) + +Implement a SnapshotArray that supports the following interface: + +- SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0. +- void set(index, val) sets the element at the given index to be equal to val. +- int snap() takes a snapshot of the array and returns the snap_id: the total number of times we called snap() minus 1. +- int get(index, snap_id) returns the value at the given index, at the time we took the snapshot with the given snap_id + +Example 1: + +```text +Input: ["SnapshotArray","set","snap","set","get"] +[[3],[0,5],[],[0,6],[0,0]] +Output: [null,null,0,null,5] +Explanation: +SnapshotArray snapshotArr = new SnapshotArray(3); // set the length to be 3 +snapshotArr.set(0,5); // Set array[0] = 5 +snapshotArr.snap(); // Take a snapshot, return snap_id = 0 +snapshotArr.set(0,6); +snapshotArr.get(0,0); // Get the value of array[0] with snap_id = 0, return 5 +``` + +Constraints: + +- `1 <= length <= 50000` +- `At most 50000 calls will be made to set, snap, and get.` +- `0 <= index < length` +- `0 <= snap_id < (the total number of times we call snap())` +- `0 <= val <= 10^9` diff --git a/Algorithms/1146.snapshot-array/snapshot-array.go b/Algorithms/1146.snapshot-array/snapshot-array.go new file mode 100755 index 000000000..c4611fe7d --- /dev/null +++ b/Algorithms/1146.snapshot-array/snapshot-array.go @@ -0,0 +1,43 @@ +package problem1146 + +// SnapshotArray can snap a array +type SnapshotArray struct { + snaps []map[int]int + current map[int]int + id int +} + +// Constructor resturn s a SnapshotArray +func Constructor(length int) SnapshotArray { + s := make([]map[int]int, 0, 128) + c := make(map[int]int, 32) + return SnapshotArray{ + snaps: s, + current: c, + id: 0, + } +} + +// Set val in index +func (sa *SnapshotArray) Set(index int, val int) { + sa.current[index] = val +} + +// Snap make snapshot +func (sa *SnapshotArray) Snap() int { + sa.snaps = append(sa.snaps, sa.current) + sa.current = make(map[int]int) + sa.id++ + return sa.id - 1 +} + +// Get returns val in the snap +func (sa *SnapshotArray) Get(index int, snap int) int { + for id := snap; id >= 0; id-- { + history := sa.snaps[id] + if t, ok := history[index]; ok { + return t + } + } + return 0 //default value +} diff --git a/Algorithms/1146.snapshot-array/snapshot-array_test.go b/Algorithms/1146.snapshot-array/snapshot-array_test.go new file mode 100755 index 000000000..5176c0821 --- /dev/null +++ b/Algorithms/1146.snapshot-array/snapshot-array_test.go @@ -0,0 +1,54 @@ +package problem1146 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_SnapshotArray(t *testing.T) { + ast := assert.New(t) + + sa := Constructor(3) + + sa.Set(0, 5) + + ast.Equal(0, sa.Snap()) + + sa.Set(0, 6) + + ast.Equal(5, sa.Get(0, 0)) + + sa.Set(1, 7) + + ast.Equal(0, sa.Get(1, 0)) + + ast.Equal(0, sa.Get(2, 0)) + +} + +func Test_SnapshotArray_2(t *testing.T) { + ast := assert.New(t) + + sa := Constructor(3) + + sa.Set(1, 14) + + ast.Equal(0, sa.Snap()) + ast.Equal(1, sa.Snap()) + ast.Equal(2, sa.Snap()) + + sa.Set(0, 14) + + ast.Equal(3, sa.Snap()) + ast.Equal(4, sa.Snap()) + + sa.Set(2, 0) + sa.Set(0, 5) + + ast.Equal(14, sa.Get(0, 3)) + + ast.Equal(5, sa.Snap()) + ast.Equal(6, sa.Snap()) + +} diff --git a/Algorithms/1147.longest-chunked-palindrome-decomposition/README.md b/Algorithms/1147.longest-chunked-palindrome-decomposition/README.md new file mode 100755 index 000000000..f517f5ce0 --- /dev/null +++ b/Algorithms/1147.longest-chunked-palindrome-decomposition/README.md @@ -0,0 +1,44 @@ +# [1147. Longest Chunked Palindrome Decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition/) + +Return the largest possible k such that there exists a_1, a_2, ..., a_k such that: + +- Each a_i is a non-empty string; +- Their concatenation a_1 + a_2 + ... + a_k is equal to text; +- For all 1 <= i <= k, a_i = a_{k+1 - i}. + +Example 1: + +```text +Input: text = "ghiabcdefhelloadamhelloabcdefghi" +Output: 7 +Explanation: We can split the string on "(ghi)(abcdef)(hello)(adam)(hello)(abcdef)(ghi)". +``` + +Example 2: + +```text +Input: text = "merchant" +Output: 1 +Explanation: We can split the string on "(merchant)". +``` + +Example 3: + +```text +Input: text = "antaprezatepzapreanta" +Output: 11 +Explanation: We can split the string on "(a)(nt)(a)(pre)(za)(tpe)(za)(pre)(a)(nt)(a)". +``` + +Example 4: + +```text +Input: text = "aaa" +Output: 3 +Explanation: We can split the string on "(a)(a)(a)". +``` + +Constraints: + +- `text consists only of lowercase English characters.` +- `1 <= text.length <= 1000` diff --git a/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition.go b/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition.go new file mode 100755 index 000000000..693971bba --- /dev/null +++ b/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition.go @@ -0,0 +1,17 @@ +package problem1147 + +import "strings" + +func longestDecomposition(S string) int { + if S == "" { + return 0 + } + n := len(S) + for i := 1; i*2 <= n; i++ { + left := S[:i] + if strings.HasSuffix(S, left) { + return 2 + longestDecomposition(S[i:n-i]) + } + } + return 1 +} diff --git a/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition_test.go b/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition_test.go new file mode 100755 index 000000000..16e24de99 --- /dev/null +++ b/Algorithms/1147.longest-chunked-palindrome-decomposition/longest-chunked-palindrome-decomposition_test.go @@ -0,0 +1,57 @@ +package problem1147 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + text string + ans int +}{ + + { + "ykpwikcghnoxoumuggqqybujrbkmnjlccsvjpoglirbrpgwkwxlmnfcpveijqluopugmksmmrfblaciqqtyidjxdrrefhoszhywhzjlvxmvfcmtszcclkhzkarheolcwikciixvarpffcdserxpzfpmrlxgmahxonomqzjfhjznvzbvsmwxfalcsdbaknspktjvydykivtfwvzicnausanqabozwcxpmimmldzpeiujilsixyrvxiisaeataeeydfodjqbpbserygikmcczluabsujnkfgemcdszftwkyteeagthkspkvkehlvdxkjnwuwmoyhdyksybqoqwdbrrabhkxuolvxrnyopxsqucilfakiiuwvwnhxclxnwvgxqsevcgdwuiaqtqbbkwporlsgbnotnhbcumfzzzvldzlqyiyhdfgsdqyifzyqecyesuygxynosctshoohumujzmrwfzaxjcjtubzugtiwekrtlluudmlqooqldmtlluuiwekrubzugtxjcjtzafjzmrwoohumutshynoscuygxesyqecydqyifzfgsyiyhdqdzlzzvlcumfzbhnotngblsbkwporiaqtqbvcgdwuqsenwvgxlxvwnhxciuwfakiluciqopxsvxrnykxuolrabhdbrqoqwybdyksuwmoyhdxkjnwehlvkpkvkseagthtwkytemcdszfnkfgeuabsujzlikmccgbseryodjqbpydfaeesaeatvxiisixyreiujilpldzmimmcxpqabozwnausanvzicfwdykivtpktjvyknsaalcsdbsmwxfnvzbvjfhjzqzommahxonxgmrlpzfpdserxffcxvarpikciwiheolchzkarzcclkfcmtsjlvxmvhywhzzsrefhojxdrqtyidaciqfblmrgmksmpuluoveijqpnfcmlpgwkwxbroglirvjpjlccskmnybujrbmuggqqnoxouikcghykpw", + 288, + }, + + { + "ghiabcdefhelloadamhelloabcdefghi", + 7, + }, + + { + "merchant", + 1, + }, + + { + "antaprezatepzapreanta", + 11, + }, + + { + "aaa", + 3, + }, + + // 可以有多个 testcase +} + +func Test_longestDecomposition(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, longestDecomposition(tc.text), "输入:%v", tc) + } +} + +func Benchmark_longestDecomposition(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + longestDecomposition(tc.text) + } + } +} diff --git a/Algorithms/1154.day-of-the-year/README.md b/Algorithms/1154.day-of-the-year/README.md new file mode 100755 index 000000000..2eafc7ee2 --- /dev/null +++ b/Algorithms/1154.day-of-the-year/README.md @@ -0,0 +1,38 @@ +# [1154. Day of the Year](https://leetcode.com/problems/day-of-the-year/) + +Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year. + +Example 1: + +```text +Input: date = "2019-01-09" +Output: 9 +Explanation: Given date is the 9th day of the year in 2019. +``` + +Example 2: + +```text +Input: date = "2019-02-10" +Output: 41 +``` + +Example 3: + +```text +Input: date = "2003-03-01" +Output: 60 +``` + +Example 4: + +```text +Input: date = "2004-03-01" +Output: 61 +``` + +Constraints: + +- date.length == 10 +- date[4] == date[7] == '-', and all other date[i]'s are digits +- date represents a calendar date between Jan 1st, 1900 and Dec 31, 2019. diff --git a/Algorithms/1154.day-of-the-year/day-of-the-year.go b/Algorithms/1154.day-of-the-year/day-of-the-year.go new file mode 100755 index 000000000..0685e7c95 --- /dev/null +++ b/Algorithms/1154.day-of-the-year/day-of-the-year.go @@ -0,0 +1,11 @@ +package problem1154 + +import "time" + +func dayOfYear(date string) int { + first := date[:4] + "-01-01" + firstDay, _ := time.Parse("2006-01-02", first) + dateDay, _ := time.Parse("2006-01-02", date) + duration := dateDay.Sub(firstDay) + return int(duration.Hours())/24 + 1 +} diff --git a/Algorithms/1154.day-of-the-year/day-of-the-year_test.go b/Algorithms/1154.day-of-the-year/day-of-the-year_test.go new file mode 100755 index 000000000..3496ed40d --- /dev/null +++ b/Algorithms/1154.day-of-the-year/day-of-the-year_test.go @@ -0,0 +1,52 @@ +package problem1154 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + date string + ans int +}{ + + { + "2019-01-09", + 9, + }, + + { + "2019-02-10", + 41, + }, + + { + "2003-03-01", + 60, + }, + + { + "2004-03-01", + 61, + }, + + // 可以有多个 testcase +} + +func Test_dayOfYear(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, dayOfYear(tc.date), "输入:%v", tc) + } +} + +func Benchmark_dayOfYear(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + dayOfYear(tc.date) + } + } +} diff --git a/Algorithms/1155.number-of-dice-rolls-with-target-sum/README.md b/Algorithms/1155.number-of-dice-rolls-with-target-sum/README.md new file mode 100755 index 000000000..8c4bdbe64 --- /dev/null +++ b/Algorithms/1155.number-of-dice-rolls-with-target-sum/README.md @@ -0,0 +1,56 @@ +# [1155. Number of Dice Rolls With Target Sum](https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/) + +You have d dice, and each die has f faces numbered 1, 2, ..., f. + +Return the number of possible ways (out of fd total ways) modulo 10^9 + 7 to roll the dice so the sum of the face up numbers equals target. + +Example 1: + +```text +Input: d = 1, f = 6, target = 3 +Output: 1 +Explanation: +You throw one die with 6 faces. There is only one way to get a sum of 3. +``` + +Example 2: + +```text +Input: d = 2, f = 6, target = 7 +Output: 6 +Explanation: +You throw two dice, each with 6 faces. There are 6 ways to get a sum of 7: +1+6, 2+5, 3+4, 4+3, 5+2, 6+1. +``` + +Example 3: + +```text +Input: d = 2, f = 5, target = 10 +Output: 1 +Explanation: +You throw two dice, each with 5 faces. There is only one way to get a sum of 10: 5+5. +``` + +Example 4: + +```text +Input: d = 1, f = 2, target = 3 +Output: 0 +Explanation: +You throw one die with 2 faces. There is no way to get a sum of 3. +``` + +Example 5: + +```text +Input: d = 30, f = 30, target = 500 +Output: 222616187 +Explanation: +The answer must be returned modulo 10^9 + 7. +``` + +Constraints: + +- `1 <= d, f <= 30` +- `1 <= target <= 1000` diff --git a/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum.go b/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum.go new file mode 100755 index 000000000..a001bcff3 --- /dev/null +++ b/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum.go @@ -0,0 +1,28 @@ +package problem1155 + +const mod = 1e9 + 7 + +func numRollsToTarget(dices, faces, target int) int { + dp := [31][1001]int{} + dp[0][0] = 1 + + for d := 1; d <= dices; d++ { + maxT := min(target, d*faces) + for t := d; t <= maxT; t++ { + maxF := min(faces, t) + for f := 1; f <= maxF; f++ { + dp[d][t] += dp[d-1][t-f] + } + dp[d][t] %= mod + } + } + + return dp[dices][target] +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum_test.go b/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum_test.go new file mode 100755 index 000000000..a6ec82ae2 --- /dev/null +++ b/Algorithms/1155.number-of-dice-rolls-with-target-sum/number-of-dice-rolls-with-target-sum_test.go @@ -0,0 +1,69 @@ +package problem1155 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + d int + f int + target int + ans int +}{ + + { + 1, + 6, + 3, + 1, + }, + + { + 2, + 6, + 7, + 6, + }, + + { + 2, + 5, + 10, + 1, + }, + + { + 1, + 2, + 3, + 0, + }, + + { + 30, + 30, + 500, + 222616187, + }, + + // 可以有多个 testcase +} + +func Test_numRollsToTarget(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, numRollsToTarget(tc.d, tc.f, tc.target), "输入:%v", tc) + } +} + +func Benchmark_numRollsToTarget(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numRollsToTarget(tc.d, tc.f, tc.target) + } + } +} diff --git a/Algorithms/1156.swap-for-longest-repeated-character-substring/README.md b/Algorithms/1156.swap-for-longest-repeated-character-substring/README.md new file mode 100755 index 000000000..9120a4b8d --- /dev/null +++ b/Algorithms/1156.swap-for-longest-repeated-character-substring/README.md @@ -0,0 +1,46 @@ +# [1156. Swap For Longest Repeated Character Substring](https://leetcode.com/problems/swap-for-longest-repeated-character-substring/) + +Given a string text, we are allowed to swap two of the characters in the string. Find the length of the longest substring with repeated characters. + +Example 1: + +```text +Input: text = "ababa" +Output: 3 +Explanation: We can swap the first 'b' with the last 'a', or the last 'b' with the first 'a'. Then, the longest repeated character substring is "aaa", which its length is 3. +``` + +Example 2: + +```text +Input: text = "aaabaaa" +Output: 6 +Explanation: Swap 'b' with the last 'a' (or the first 'a'), and we get longest repeated character substring "aaaaaa", which its length is 6. +``` + +Example 3: + +```text +Input: text = "aaabbaaa" +Output: 4 +``` + +Example 4: + +```text +Input: text = "aaaaa" +Output: 5 +Explanation: No need to swap, longest repeated character substring is "aaaaa", length is 5. +``` + +Example 5: + +```text +Input: text = "abcdef" +Output: 1 +``` + +Constraints: + +- `1 <= text.length <= 20000` +- `text consist of lowercase English characters only.` diff --git a/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring.go b/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring.go new file mode 100755 index 000000000..6856275a7 --- /dev/null +++ b/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring.go @@ -0,0 +1,66 @@ +package problem1156 + +import "strings" + +func maxRepOpt1(text string) int { + rec := [26][][3]int{} + segments, index := split(text), 0 + for _, s := range segments { + b, n := int(s[0]-'a'), len(s) + rec[b] = append(rec[b], [3]int{index, index + n + 1, n}) + index += n + } + + res := 0 + for _, r := range rec { + n := len(r) + if n == 0 { + continue + } + // extension a lonely segment + ext := 0 + if n > 1 { + ext = 1 + } + // connect two neighbor segments + con := 0 + if n > 2 { + con = 1 + } + prev := r[0] + res = max(res, ext+prev[2]) + for i := 1; i < len(r); i++ { + cur := r[i] + if prev[1] == cur[0] { + res = max(res, con+prev[2]+cur[2]) + } else { + res = max(res, ext+cur[2]) + } + prev = cur + } + } + + return res +} + +func split(s string) []string { + var sb strings.Builder + p := s[0] + sb.WriteByte(p) + for i := 1; i < len(s); i++ { + n := s[i] + if p != n { + sb.WriteByte('\n') + } + sb.WriteByte(n) + p = n + } + return strings.Split(sb.String(), "\n") +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring_test.go b/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring_test.go new file mode 100755 index 000000000..8fd057b0b --- /dev/null +++ b/Algorithms/1156.swap-for-longest-repeated-character-substring/swap-for-longest-repeated-character-substring_test.go @@ -0,0 +1,62 @@ +package problem1156 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + text string + ans int +}{ + + { + "ababa", + 3, + }, + + { + "aaabaaa", + 6, + }, + + { + "aaabbbbbaaa", + 5, + }, + + { + "aaabbaaa", + 4, + }, + + { + "aaaaa", + 5, + }, + + { + "abcdef", + 1, + }, + + // 可以有多个 testcase +} + +func Test_maxRepOpt1(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxRepOpt1(tc.text), "输入:%v", tc) + } +} + +func Benchmark_maxRepOpt1(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxRepOpt1(tc.text) + } + } +} diff --git a/Algorithms/1157.online-majority-element-in-subarray/README.md b/Algorithms/1157.online-majority-element-in-subarray/README.md new file mode 100755 index 000000000..64185a22b --- /dev/null +++ b/Algorithms/1157.online-majority-element-in-subarray/README.md @@ -0,0 +1,27 @@ +# [1157. Online Majority Element In Subarray](https://leetcode.com/problems/online-majority-element-in-subarray/) + +implementing the class MajorityChecker, which has the following API: + +- MajorityChecker(int[] arr) constructs an instance of MajorityChecker with the given array arr; +- int query(int left, int right, int threshold) has arguments such that: + - 0 <= left <= right < arr.length representing a subarray of arr; + - 2 * threshold > right - left + 1, ie. the threshold is always a strict majority of the length of the subarray + +Each query(...) returns the element in arr[left], arr[left+1], ..., arr[right] that occurs at least threshold times, or -1 if no such element exists. + +Example: + +```text +MajorityChecker majorityChecker = new MajorityChecker([1,1,2,2,1,1]); +majorityChecker.query(0,5,4); // returns 1 +majorityChecker.query(0,3,3); // returns -1 +majorityChecker.query(2,3,2); // returns 2 +``` + +Constraints: + +- `1 <= arr.length <= 20000` +- `1 <= arr[i] <= 20000` +- `For each query, 0 <= left <= right < len(arr)` +- `For each query, 2 * threshold > right - left + 1` +- `The number of queries is at most 10000` diff --git a/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray.go b/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray.go new file mode 100755 index 000000000..476199cc7 --- /dev/null +++ b/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray.go @@ -0,0 +1,42 @@ +package problem1157 + +import ( + "math/rand" + "sort" +) + +// ref: https://leetcode.com/problems/online-majority-element-in-subarray/discuss/355848/Python-Binary-Search-%2B-Find-the-Majority-Element + +// MajorityChecker is .. +type MajorityChecker struct { + arr []int + a2i map[int][]int +} + +// Constructor is ... +func Constructor(arr []int) MajorityChecker { + a2i := make(map[int][]int, 64) + for i, a := range arr { + a2i[a] = append(a2i[a], i) + } + return MajorityChecker{ + arr: arr, + a2i: a2i, + } +} + +// Query is ... +func (mc *MajorityChecker) Query(left int, right int, threshold int) int { + for i := 0; i < 20; i++ { + index := rand.Intn(right-left+1) + left + a := mc.arr[index] + a2i := mc.a2i[a] + n := len(a2i) + l := sort.Search(n, func(i int) bool { return a2i[i] >= left }) + r := sort.Search(n, func(i int) bool { return a2i[i] > right }) + if r-l >= threshold { + return a + } + } + return -1 +} diff --git a/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray_test.go b/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray_test.go new file mode 100755 index 000000000..53afe1986 --- /dev/null +++ b/Algorithms/1157.online-majority-element-in-subarray/online-majority-element-in-subarray_test.go @@ -0,0 +1,39 @@ +package problem1157 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_MajorityChecker(t *testing.T) { + a := assert.New(t) + // + arr := []int{1, 1, 2, 2, 1, 1} + mc := Constructor(arr) + tcs := []struct { + left, right, threshold, ans int + }{ + {0, 3, 3, -1}, + {0, 5, 4, 1}, + {2, 3, 2, 2}, + } + for _, tc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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + mc := Constructor(arr) + tcs := []struct { + left, right, threshold, ans int + }{ + {0, 19999, 13818, 1}, {0, 19999, 10332, 1}, {0, 19999, 10291, 1}, {0, 19999, 16784, 1}, {0, 19999, 15886, 1}, {0, 19999, 12386, 1}, {0, 19999, 12455, 1}, {0, 19999, 17788, 1}, {0, 19999, 17394, 1}, {0, 19999, 19738, 1}, {0, 19999, 19806, 1}, {0, 19999, 16961, 1}, {0, 19999, 13068, 1}, {0, 19999, 15500, 1}, {0, 19999, 10887, 1}, {0, 19999, 11200, 1}, {0, 19999, 18695, 1}, {0, 19999, 16869, 1}, {0, 19999, 14319, 1}, {0, 19999, 14091, 1}, {0, 19999, 14026, 1}, {0, 19999, 15299, 1}, {0, 19999, 15039, 1}, {0, 19999, 12617, 1}, {0, 19999, 10904, 1}, {0, 19999, 14778, 1}, {0, 19999, 10356, 1}, {0, 19999, 13095, 1}, {0, 19999, 16701, 1}, {0, 19999, 11881, 1}, {0, 19999, 18687, 1}, {0, 19999, 10917, 1}, {0, 19999, 17364, 1}, {0, 19999, 12395, 1}, {0, 19999, 18531, 1}, {0, 19999, 16709, 1}, {0, 19999, 11717, 1}, {0, 19999, 13149, 1}, {0, 19999, 18314, 1}, {0, 19999, 17058, 1}, {0, 19999, 14793, 1}, {0, 19999, 15061, 1}, {0, 19999, 15714, 1}, {0, 19999, 12135, 1}, {0, 19999, 18306, 1}, {0, 19999, 11725, 1}, {0, 19999, 19031, 1}, {0, 19999, 15090, 1}, {0, 19999, 17692, 1}, {0, 19999, 13478, 1}, {0, 19999, 17870, 1}, {0, 19999, 19275, 1}, {0, 19999, 13934, 1}, {0, 19999, 17035, 1}, {0, 19999, 19890, 1}, {0, 19999, 17442, 1}, {0, 19999, 15291, 1}, {0, 19999, 14468, 1}, {0, 19999, 11575, 1}, {0, 19999, 11538, 1}, {0, 19999, 13618, 1}, {0, 19999, 15670, 1}, {0, 19999, 15166, 1}, {0, 19999, 18451, 1}, {0, 19999, 15050, 1}, {0, 19999, 15797, 1}, {0, 19999, 14465, 1}, {0, 19999, 13155, 1}, {0, 19999, 11565, 1}, {0, 19999, 15656, 1}, {0, 19999, 10843, 1}, {0, 19999, 15821, 1}, {0, 19999, 14175, 1}, {0, 19999, 18029, 1}, {0, 19999, 10328, 1}, {0, 19999, 19796, 1}, {0, 19999, 11913, 1}, {0, 19999, 16466, 1}, {0, 19999, 10383, 1}, {0, 19999, 16003, 1}, {0, 19999, 19538, 1}, {0, 19999, 11910, 1}, {0, 19999, 15918, 1}, {0, 19999, 19290, 1}, {0, 19999, 15743, 1}, {0, 19999, 10506, 1}, {0, 19999, 10561, 1}, {0, 19999, 11523, 1}, {0, 19999, 10861, 1}, {0, 19999, 14599, 1}, {0, 19999, 15885, 1}, {0, 19999, 13906, 1}, {0, 19999, 17113, 1}, {0, 19999, 15518, 1}, {0, 19999, 16834, 1}, {0, 19999, 11849, 1}, {0, 19999, 15471, 1}, {0, 19999, 11251, 1}, {0, 19999, 10893, 1}, {0, 19999, 13640, 1}, {0, 19999, 16190, 1}, {0, 19999, 19535, 1}, {0, 19999, 11513, 1}, {0, 19999, 13176, 1}, {0, 19999, 14422, 1}, {0, 19999, 19033, 1}, {0, 19999, 14406, 1}, {0, 19999, 14995, 1}, {0, 19999, 11614, 1}, {0, 19999, 18921, 1}, {0, 19999, 10749, 1}, {0, 19999, 11106, 1}, {0, 19999, 14815, 1}, {0, 19999, 17077, 1}, {0, 19999, 14032, 1}, {0, 19999, 12689, 1}, {0, 19999, 19382, 1}, {0, 19999, 13879, 1}, {0, 19999, 17884, 1}, {0, 19999, 17391, 1}, {0, 19999, 17463, 1}, {0, 19999, 11403, 1}, {0, 19999, 10609, 1}, {0, 19999, 17538, 1}, {0, 19999, 19920, 1}, {0, 19999, 15474, 1}, {0, 19999, 12632, 1}, {0, 19999, 13808, 1}, {0, 19999, 16098, 1}, {0, 19999, 19476, 1}, {0, 19999, 18678, 1}, {0, 19999, 15869, 1}, {0, 19999, 17123, 1}, {0, 19999, 13306, 1}, {0, 19999, 12631, 1}, {0, 19999, 11092, 1}, {0, 19999, 17926, 1}, {0, 19999, 11834, 1}, {0, 19999, 12098, 1}, {0, 19999, 12305, 1}, {0, 19999, 15798, 1}, {0, 19999, 17897, 1}, {0, 19999, 18907, 1}, {0, 19999, 12132, 1}, {0, 19999, 17006, 1}, {0, 19999, 10959, 1}, {0, 19999, 18102, 1}, {0, 19999, 18112, 1}, {0, 19999, 15868, 1}, {0, 19999, 17073, 1}, {0, 19999, 10770, 1}, {0, 19999, 13272, 1}, {0, 19999, 16213, 1}, {0, 19999, 10147, 1}, {0, 19999, 11207, 1}, {0, 19999, 19900, 1}, {0, 19999, 10812, 1}, {0, 19999, 10941, 1}, {0, 19999, 14380, 1}, {0, 19999, 11454, 1}, {0, 19999, 17702, 1}, {0, 19999, 15877, 1}, {0, 19999, 17745, 1}, {0, 19999, 13484, 1}, {0, 19999, 13535, 1}, {0, 19999, 12423, 1}, {0, 19999, 11717, 1}, {0, 19999, 10217, 1}, {0, 19999, 18425, 1}, {0, 19999, 11984, 1}, {0, 19999, 18344, 1}, {0, 19999, 15288, 1}, {0, 19999, 10130, 1}, {0, 19999, 17944, 1}, {0, 19999, 11233, 1}, {0, 19999, 19633, 1}, {0, 19999, 11595, 1}, {0, 19999, 16062, 1}, {0, 19999, 15866, 1}, {0, 19999, 14899, 1}, {0, 19999, 17256, 1}, {0, 19999, 17772, 1}, {0, 19999, 18563, 1}, {0, 19999, 18140, 1}, {0, 19999, 17901, 1}, {0, 19999, 11598, 1}, {0, 19999, 17699, 1}, {0, 19999, 14176, 1}, {0, 19999, 11551, 1}, {0, 19999, 16119, 1}, {0, 19999, 13400, 1}, {0, 19999, 16324, 1}, {0, 19999, 13479, 1}, {0, 19999, 19180, 1}, {0, 19999, 12395, 1}, {0, 19999, 10810, 1}, {0, 19999, 19442, 1}, {0, 19999, 10202, 1}, {0, 19999, 13818, 1}, {0, 19999, 16180, 1}, {0, 19999, 19257, 1}, {0, 19999, 13049, 1}, {0, 19999, 17126, 1}, {0, 19999, 10637, 1}, {0, 19999, 11101, 1}, {0, 19999, 14244, 1}, {0, 19999, 14235, 1}, {0, 19999, 15896, 1}, {0, 19999, 17876, 1}, {0, 19999, 11161, 1}, {0, 19999, 18147, 1}, {0, 19999, 14399, 1}, {0, 19999, 15438, 1}, {0, 19999, 12013, 1}, {0, 19999, 16982, 1}, {0, 19999, 15552, 1}, {0, 19999, 14905, 1}, {0, 19999, 11355, 1}, {0, 19999, 12804, 1}, {0, 19999, 14722, 1}, {0, 19999, 17486, 1}, {0, 19999, 18031, 1}, {0, 19999, 16736, 1}, {0, 19999, 19704, 1}, {0, 19999, 19177, 1}, {0, 19999, 13090, 1}, {0, 19999, 12097, 1}, {0, 19999, 11991, 1}, {0, 19999, 13387, 1}, {0, 19999, 13911, 1}, {0, 19999, 10474, 1}, {0, 19999, 11339, 1}, {0, 19999, 12525, 1}, {0, 19999, 11392, 1}, {0, 19999, 16465, 1}, {0, 19999, 11124, 1}, {0, 19999, 11944, 1}, {0, 19999, 13209, 1}, {0, 19999, 10263, 1}, {0, 19999, 16138, 1}, {0, 19999, 10564, 1}, {0, 19999, 17117, 1}, {0, 19999, 12331, 1}, {0, 19999, 18662, 1}, {0, 19999, 19366, 1}, {0, 19999, 11874, 1}, {0, 19999, 17268, 1}, {0, 19999, 13854, 1}, {0, 19999, 12178, 1}, {0, 19999, 10215, 1}, {0, 19999, 15394, 1}, {0, 19999, 13166, 1}, {0, 19999, 10750, 1}, {0, 19999, 15890, 1}, {0, 19999, 12634, 1}, {0, 19999, 15395, 1}, {0, 19999, 14561, 1}, {0, 19999, 15033, 1}, {0, 19999, 13328, 1}, {0, 19999, 12049, 1}, {0, 19999, 15475, 1}, {0, 19999, 11508, 1}, {0, 19999, 15885, 1}, {0, 19999, 14781, 1}, {0, 19999, 17473, 1}, {0, 19999, 18050, 1}, {0, 19999, 14415, 1}, {0, 19999, 14552, 1}, {0, 19999, 13616, 1}, {0, 19999, 16698, 1}, {0, 19999, 14474, 1}, {0, 19999, 13855, 1}, {0, 19999, 10991, 1}, {0, 19999, 13721, 1}, {0, 19999, 12743, 1}, {0, 19999, 19526, 1}, {0, 19999, 12948, 1}, {0, 19999, 10257, 1}, {0, 19999, 19674, 1}, {0, 19999, 17884, 1}, {0, 19999, 15898, 1}, {0, 19999, 10753, 1}, {0, 19999, 19004, 1}, {0, 19999, 16084, 1}, {0, 19999, 15765, 1}, {0, 19999, 19384, 1}, {0, 19999, 17416, 1}, {0, 19999, 17339, 1}, {0, 19999, 19712, 1}, {0, 19999, 16064, 1}, {0, 19999, 11983, 1}, {0, 19999, 13984, 1}, {0, 19999, 12282, 1}, {0, 19999, 12138, 1}, {0, 19999, 12424, 1}, {0, 19999, 12331, 1}, {0, 19999, 11725, 1}, {0, 19999, 10748, 1}, {0, 19999, 11325, 1}, {0, 19999, 15581, 1}, {0, 19999, 17072, 1}, {0, 19999, 13285, 1}, {0, 19999, 14227, 1}, {0, 19999, 10999, 1}, {0, 19999, 12160, 1}, {0, 19999, 18037, 1}, {0, 19999, 17385, 1}, {0, 19999, 15294, 1}, {0, 19999, 11108, 1}, {0, 19999, 17625, 1}, {0, 19999, 13551, 1}, {0, 19999, 13276, 1}, {0, 19999, 19599, 1}, {0, 19999, 17090, 1}, {0, 19999, 15660, 1}, {0, 19999, 11369, 1}, {0, 19999, 19082, 1}, {0, 19999, 12525, 1}, {0, 19999, 14237, 1}, {0, 19999, 16996, 1}, {0, 19999, 14341, 1}, {0, 19999, 18233, 1}, {0, 19999, 18129, 1}, {0, 19999, 16340, 1}, {0, 19999, 13531, 1}, {0, 19999, 14865, 1}, {0, 19999, 18763, 1}, {0, 19999, 15991, 1}, {0, 19999, 17328, 1}, {0, 19999, 15752, 1}, {0, 19999, 15089, 1}, {0, 19999, 13357, 1}, {0, 19999, 19807, 1}, {0, 19999, 11039, 1}, {0, 19999, 14664, 1}, {0, 19999, 12356, 1}, {0, 19999, 16416, 1}, {0, 19999, 17332, 1}, {0, 19999, 15766, 1}, {0, 19999, 12321, 1}, {0, 19999, 17350, 1}, {0, 19999, 18652, 1}, {0, 19999, 19614, 1}, {0, 19999, 12415, 1}, {0, 19999, 13370, 1}, {0, 19999, 10507, 1}, {0, 19999, 18948, 1}, {0, 19999, 18705, 1}, {0, 19999, 14702, 1}, {0, 19999, 14591, 1}, {0, 19999, 10971, 1}, {0, 19999, 13551, 1}, {0, 19999, 19021, 1}, {0, 19999, 19594, 1}, {0, 19999, 10830, 1}, {0, 19999, 19236, 1}, {0, 19999, 16789, 1}, {0, 19999, 14060, 1}, {0, 19999, 11856, 1}, {0, 19999, 19780, 1}, {0, 19999, 15788, 1}, {0, 19999, 13393, 1}, {0, 19999, 19064, 1}, {0, 19999, 17935, 1}, {0, 19999, 16146, 1}, {0, 19999, 13412, 1}, {0, 19999, 14706, 1}, {0, 19999, 13204, 1}, {0, 19999, 15765, 1}, {0, 19999, 17434, 1}, {0, 19999, 13734, 1}, {0, 19999, 16037, 1}, {0, 19999, 11097, 1}, {0, 19999, 18012, 1}, {0, 19999, 18254, 1}, {0, 19999, 15800, 1}, {0, 19999, 19586, 1}, {0, 19999, 12212, 1}, {0, 19999, 13734, 1}, {0, 19999, 15042, 1}, {0, 19999, 15097, 1}, {0, 19999, 16469, 1}, {0, 19999, 18905, 1}, {0, 19999, 14437, 1}, {0, 19999, 10801, 1}, {0, 19999, 12793, 1}, {0, 19999, 10780, 1}, {0, 19999, 14010, 1}, {0, 19999, 14978, 1}, {0, 19999, 11561, 1}, {0, 19999, 15111, 1}, {0, 19999, 11611, 1}, {0, 19999, 15143, 1}, {0, 19999, 17386, 1}, {0, 19999, 17957, 1}, {0, 19999, 19578, 1}, {0, 19999, 11300, 1}, {0, 19999, 15678, 1}, {0, 19999, 12231, 1}, {0, 19999, 18067, 1}, {0, 19999, 17950, 1}, {0, 19999, 14506, 1}, {0, 19999, 13971, 1}, {0, 19999, 11174, 1}, {0, 19999, 13400, 1}, {0, 19999, 16788, 1}, {0, 19999, 15860, 1}, {0, 19999, 17802, 1}, {0, 19999, 14319, 1}, {0, 19999, 15836, 1}, {0, 19999, 10461, 1}, {0, 19999, 12335, 1}, {0, 19999, 13715, 1}, {0, 19999, 15289, 1}, {0, 19999, 10260, 1}, {0, 19999, 14687, 1}, {0, 19999, 15395, 1}, {0, 19999, 10994, 1}, {0, 19999, 10420, 1}, {0, 19999, 10502, 1}, {0, 19999, 18196, 1}, {0, 19999, 19220, 1}, {0, 19999, 13859, 1}, {0, 19999, 18437, 1}, {0, 19999, 18418, 1}, {0, 19999, 19045, 1}, {0, 19999, 15874, 1}, {0, 19999, 17910, 1}, {0, 19999, 19604, 1}, {0, 19999, 12212, 1}, {0, 19999, 17870, 1}, {0, 19999, 17323, 1}, {0, 19999, 17005, 1}, {0, 19999, 18549, 1}, {0, 19999, 12213, 1}, {0, 19999, 16499, 1}, {0, 19999, 12100, 1}, {0, 19999, 11594, 1}, {0, 19999, 16071, 1}, {0, 19999, 10211, 1}, {0, 19999, 19142, 1}, {0, 19999, 12787, 1}, {0, 19999, 17230, 1}, {0, 19999, 13283, 1}, {0, 19999, 10840, 1}, {0, 19999, 15506, 1}, {0, 19999, 10443, 1}, {0, 19999, 17254, 1}, {0, 19999, 10318, 1}, {0, 19999, 15462, 1}, {0, 19999, 13660, 1}, {0, 19999, 10119, 1}, {0, 19999, 14425, 1}, {0, 19999, 11614, 1}, {0, 19999, 19337, 1}, {0, 19999, 19652, 1}, {0, 19999, 15673, 1}, {0, 19999, 16954, 1}, {0, 19999, 10622, 1}, {0, 19999, 16511, 1}, {0, 19999, 12415, 1}, {0, 19999, 16185, 1}, {0, 19999, 14854, 1}, {0, 19999, 17393, 1}, {0, 19999, 13553, 1}, {0, 19999, 17139, 1}, {0, 19999, 10434, 1}, {0, 19999, 18397, 1}, {0, 19999, 16377, 1}, {0, 19999, 17115, 1}, {0, 19999, 14653, 1}, {0, 19999, 17849, 1}, {0, 19999, 10498, 1}, {0, 19999, 14193, 1}, {0, 19999, 12526, 1}, {0, 19999, 13510, 1}, {0, 19999, 13039, 1}, {0, 19999, 11288, 1}, {0, 19999, 12335, 1}, {0, 19999, 13830, 1}, {0, 19999, 14975, 1}, {0, 19999, 17768, 1}, {0, 19999, 17146, 1}, {0, 19999, 12635, 1}, {0, 19999, 10139, 1}, {0, 19999, 10177, 1}, {0, 19999, 11354, 1}, {0, 19999, 13990, 1}, {0, 19999, 16792, 1}, {0, 19999, 17881, 1}, {0, 19999, 11391, 1}, {0, 19999, 15235, 1}, {0, 19999, 19958, 1}, {0, 19999, 13225, 1}, {0, 19999, 12299, 1}, {0, 19999, 10182, 1}, {0, 19999, 13295, 1}, {0, 19999, 17087, 1}, {0, 19999, 17853, 1}, {0, 19999, 14113, 1}, {0, 19999, 16041, 1}, {0, 19999, 13620, 1}, {0, 19999, 12371, 1}, {0, 19999, 13267, 1}, {0, 19999, 14863, 1}, {0, 19999, 18378, 1}, {0, 19999, 10110, 1}, {0, 19999, 11228, 1}, {0, 19999, 17314, 1}, {0, 19999, 10943, 1}, {0, 19999, 17353, 1}, {0, 19999, 10212, 1}, {0, 19999, 17146, 1}, {0, 19999, 18011, 1}, {0, 19999, 18379, 1}, {0, 19999, 17995, 1}, {0, 19999, 11422, 1}, {0, 19999, 12764, 1}, {0, 19999, 18548, 1}, {0, 19999, 10650, 1}, {0, 19999, 16810, 1}, {0, 19999, 11774, 1}, {0, 19999, 13218, 1}, {0, 19999, 10907, 1}, {0, 19999, 17505, 1}, {0, 19999, 10914, 1}, {0, 19999, 12001, 1}, {0, 19999, 18031, 1}, {0, 19999, 19866, 1}, {0, 19999, 14532, 1}, {0, 19999, 16847, 1}, {0, 19999, 10319, 1}, {0, 19999, 18888, 1}, {0, 19999, 10804, 1}, {0, 19999, 11020, 1}, {0, 19999, 17911, 1}, {0, 19999, 13807, 1}, {0, 19999, 19712, 1}, {0, 19999, 14961, 1}, {0, 19999, 19023, 1}, {0, 19999, 15405, 1}, {0, 19999, 11243, 1}, {0, 19999, 14362, 1}, {0, 19999, 11766, 1}, {0, 19999, 18258, 1}, {0, 19999, 18858, 1}, {0, 19999, 10132, 1}, {0, 19999, 15706, 1}, {0, 19999, 17382, 1}, {0, 19999, 11055, 1}, {0, 19999, 13866, 1}, {0, 19999, 15013, 1}, {0, 19999, 10278, 1}, {0, 19999, 19239, 1}, {0, 19999, 19780, 1}, {0, 19999, 11606, 1}, {0, 19999, 10546, 1}, {0, 19999, 13507, 1}, {0, 19999, 16875, 1}, {0, 19999, 11953, 1}, {0, 19999, 10098, 1}, {0, 19999, 14712, 1}, {0, 19999, 18921, 1}, {0, 19999, 18921, 1}, {0, 19999, 15877, 1}, {0, 19999, 13416, 1}, {0, 19999, 15711, 1}, {0, 19999, 16385, 1}, {0, 19999, 19062, 1}, {0, 19999, 10032, 1}, {0, 19999, 18651, 1}, {0, 19999, 17999, 1}, {0, 19999, 17244, 1}, {0, 19999, 17420, 1}, {0, 19999, 11188, 1}, {0, 19999, 11581, 1}, {0, 19999, 15812, 1}, {0, 19999, 14048, 1}, {0, 19999, 12233, 1}, {0, 19999, 10857, 1}, {0, 19999, 18730, 1}, {0, 19999, 18513, 1}, {0, 19999, 15388, 1}, {0, 19999, 19484, 1}, {0, 19999, 13154, 1}, {0, 19999, 17750, 1}, {0, 19999, 17999, 1}, {0, 19999, 17166, 1}, {0, 19999, 17008, 1}, {0, 19999, 19917, 1}, {0, 19999, 12373, 1}, {0, 19999, 13112, 1}, {0, 19999, 14335, 1}, {0, 19999, 11202, 1}, {0, 19999, 15392, 1}, {0, 19999, 13772, 1}, {0, 19999, 17759, 1}, {0, 19999, 13578, 1}, {0, 19999, 19553, 1}, {0, 19999, 16859, 1}, {0, 19999, 16258, 1}, {0, 19999, 13184, 1}, {0, 19999, 19196, 1}, {0, 19999, 16925, 1}, {0, 19999, 10787, 1}, {0, 19999, 14158, 1}, {0, 19999, 11789, 1}, {0, 19999, 13003, 1}, {0, 19999, 10366, 1}, {0, 19999, 13316, 1}, {0, 19999, 17438, 1}, {0, 19999, 10783, 1}, {0, 19999, 10580, 1}, {0, 19999, 18755, 1}, {0, 19999, 16537, 1}, {0, 19999, 17987, 1}, {0, 19999, 13501, 1}, {0, 19999, 14079, 1}, {0, 19999, 12436, 1}, {0, 19999, 12892, 1}, {0, 19999, 10298, 1}, {0, 19999, 19474, 1}, {0, 19999, 17000, 1}, {0, 19999, 14496, 1}, {0, 19999, 11268, 1}, {0, 19999, 11860, 1}, {0, 19999, 16030, 1}, {0, 19999, 14088, 1}, {0, 19999, 14640, 1}, {0, 19999, 17041, 1}, {0, 19999, 13092, 1}, {0, 19999, 15215, 1}, {0, 19999, 12512, 1}, {0, 19999, 19271, 1}, {0, 19999, 16021, 1}, {0, 19999, 12609, 1}, {0, 19999, 11128, 1}, {0, 19999, 16590, 1}, {0, 19999, 13324, 1}, {0, 19999, 15110, 1}, {0, 19999, 12118, 1}, {0, 19999, 15779, 1}, {0, 19999, 12683, 1}, {0, 19999, 11294, 1}, {0, 19999, 15687, 1}, {0, 19999, 10547, 1}, {0, 19999, 16506, 1}, {0, 19999, 13196, 1}, {0, 19999, 15585, 1}, {0, 19999, 10409, 1}, {0, 19999, 15667, 1}, {0, 19999, 17219, 1}, {0, 19999, 18378, 1}, {0, 19999, 10863, 1}, {0, 19999, 18371, 1}, {0, 19999, 14542, 1}, {0, 19999, 15998, 1}, {0, 19999, 19533, 1}, {0, 19999, 12025, 1}, {0, 19999, 13854, 1}, {0, 19999, 16601, 1}, {0, 19999, 14403, 1}, {0, 19999, 14101, 1}, {0, 19999, 15323, 1}, {0, 19999, 19570, 1}, {0, 19999, 14811, 1}, {0, 19999, 11489, 1}, {0, 19999, 16828, 1}, {0, 19999, 15720, 1}, {0, 19999, 17955, 1}, {0, 19999, 15512, 1}, {0, 19999, 13307, 1}, {0, 19999, 13751, 1}, {0, 19999, 19237, 1}, {0, 19999, 11603, 1}, {0, 19999, 17844, 1}, {0, 19999, 17651, 1}, {0, 19999, 14734, 1}, {0, 19999, 11155, 1}, {0, 19999, 19376, 1}, {0, 19999, 18382, 1}, {0, 19999, 17639, 1}, {0, 19999, 13917, 1}, {0, 19999, 11323, 1}, {0, 19999, 12589, 1}, {0, 19999, 19947, 1}, {0, 19999, 11087, 1}, {0, 19999, 18263, 1}, {0, 19999, 13554, 1}, {0, 19999, 12731, 1}, {0, 19999, 17419, 1}, {0, 19999, 19302, 1}, {0, 19999, 16946, 1}, {0, 19999, 19229, 1}, {0, 19999, 17828, 1}, {0, 19999, 14528, 1}, {0, 19999, 19663, 1}, {0, 19999, 17371, 1}, {0, 19999, 12363, 1}, {0, 19999, 11086, 1}, {0, 19999, 18821, 1}, {0, 19999, 12564, 1}, {0, 19999, 17672, 1}, {0, 19999, 14725, 1}, {0, 19999, 13012, 1}, {0, 19999, 16746, 1}, {0, 19999, 11607, 1}, {0, 19999, 18447, 1}, {0, 19999, 15943, 1}, {0, 19999, 18234, 1}, {0, 19999, 18224, 1}, {0, 19999, 11506, 1}, {0, 19999, 15273, 1}, {0, 19999, 18171, 1}, {0, 19999, 10185, 1}, {0, 19999, 11766, 1}, {0, 19999, 17406, 1}, {0, 19999, 14529, 1}, {0, 19999, 11289, 1}, {0, 19999, 16594, 1}, {0, 19999, 13378, 1}, {0, 19999, 19675, 1}, {0, 19999, 16346, 1}, {0, 19999, 17247, 1}, {0, 19999, 11061, 1}, {0, 19999, 17721, 1}, {0, 19999, 13407, 1}, {0, 19999, 17726, 1}, {0, 19999, 13022, 1}, {0, 19999, 19272, 1}, {0, 19999, 14567, 1}, {0, 19999, 16168, 1}, {0, 19999, 13051, 1}, {0, 19999, 15002, 1}, {0, 19999, 11528, 1}, {0, 19999, 14186, 1}, {0, 19999, 19059, 1}, {0, 19999, 15869, 1}, {0, 19999, 13995, 1}, {0, 19999, 17636, 1}, {0, 19999, 18685, 1}, {0, 19999, 19521, 1}, {0, 19999, 19961, 1}, {0, 19999, 19088, 1}, {0, 19999, 17952, 1}, {0, 19999, 18399, 1}, {0, 19999, 17195, 1}, {0, 19999, 18309, 1}, {0, 19999, 17403, 1}, {0, 19999, 19186, 1}, {0, 19999, 18574, 1}, {0, 19999, 15067, 1}, {0, 19999, 12863, 1}, {0, 19999, 18107, 1}, {0, 19999, 13205, 1}, {0, 19999, 16603, 1}, {0, 19999, 16412, 1}, {0, 19999, 13664, 1}, {0, 19999, 14463, 1}, {0, 19999, 18715, 1}, {0, 19999, 19557, 1}, {0, 19999, 12312, 1}, {0, 19999, 17489, 1}, {0, 19999, 10987, 1}, {0, 19999, 16940, 1}, {0, 19999, 12173, 1}, {0, 19999, 15765, 1}, {0, 19999, 14801, 1}, {0, 19999, 13413, 1}, {0, 19999, 11705, 1}, {0, 19999, 16323, 1}, {0, 19999, 12141, 1}, {0, 19999, 11146, 1}, {0, 19999, 14043, 1}, {0, 19999, 12677, 1}, {0, 19999, 11723, 1}, {0, 19999, 12805, 1}, {0, 19999, 13797, 1}, {0, 19999, 17403, 1}, {0, 19999, 14682, 1}, {0, 19999, 17183, 1}, {0, 19999, 19210, 1}, {0, 19999, 18809, 1}, {0, 19999, 16282, 1}, {0, 19999, 19914, 1}, {0, 19999, 18322, 1}, {0, 19999, 19977, 1}, {0, 19999, 13708, 1}, {0, 19999, 10979, 1}, {0, 19999, 15439, 1}, {0, 19999, 16942, 1}, {0, 19999, 17420, 1}, {0, 19999, 17463, 1}, {0, 19999, 12849, 1}, {0, 19999, 12708, 1}, {0, 19999, 10215, 1}, {0, 19999, 14272, 1}, {0, 19999, 16753, 1}, {0, 19999, 10290, 1}, {0, 19999, 16745, 1}, {0, 19999, 11712, 1}, {0, 19999, 17739, 1}, {0, 19999, 14536, 1}, {0, 19999, 16067, 1}, {0, 19999, 19861, 1}, {0, 19999, 11346, 1}, {0, 19999, 18545, 1}, {0, 19999, 18170, 1}, {0, 19999, 12988, 1}, {0, 19999, 12524, 1}, {0, 19999, 15766, 1}, {0, 19999, 17560, 1}, {0, 19999, 16592, 1}, {0, 19999, 19991, 1}, {0, 19999, 11526, 1}, {0, 19999, 11072, 1}, {0, 19999, 18479, 1}, {0, 19999, 15064, 1}, {0, 19999, 16562, 1}, {0, 19999, 11574, 1}, {0, 19999, 17859, 1}, {0, 19999, 12536, 1}, {0, 19999, 13810, 1}, {0, 19999, 13840, 1}, {0, 19999, 14204, 1}, {0, 19999, 11749, 1}, {0, 19999, 17333, 1}, {0, 19999, 12832, 1}, {0, 19999, 19437, 1}, {0, 19999, 15046, 1}, {0, 19999, 17460, 1}, {0, 19999, 15570, 1}, {0, 19999, 13678, 1}, {0, 19999, 14802, 1}, {0, 19999, 10314, 1}, {0, 19999, 19131, 1}, {0, 19999, 10331, 1}, {0, 19999, 10840, 1}, {0, 19999, 15735, 1}, {0, 19999, 11356, 1}, {0, 19999, 15266, 1}, {0, 19999, 19793, 1}, {0, 19999, 17477, 1}, {0, 19999, 17630, 1}, {0, 19999, 15819, 1}, {0, 19999, 11809, 1}, {0, 19999, 15517, 1}, {0, 19999, 18509, 1}, {0, 19999, 19917, 1}, {0, 19999, 14985, 1}, {0, 19999, 15584, 1}, {0, 19999, 15914, 1}, {0, 19999, 10658, 1}, {0, 19999, 14415, 1}, {0, 19999, 14499, 1}, {0, 19999, 16466, 1}, {0, 19999, 15482, 1}, {0, 19999, 16984, 1}, {0, 19999, 11632, 1}, {0, 19999, 10465, 1}, {0, 19999, 19810, 1}, {0, 19999, 16108, 1}, {0, 19999, 16458, 1}, {0, 19999, 10910, 1}, {0, 19999, 14495, 1}, {0, 19999, 10630, 1}, {0, 19999, 19671, 1}, {0, 19999, 10384, 1}, {0, 19999, 13887, 1}, {0, 19999, 19827, 1}, {0, 19999, 16698, 1}, {0, 19999, 12289, 1}, {0, 19999, 14523, 1}, {0, 19999, 11160, 1}, {0, 19999, 16969, 1}, {0, 19999, 12298, 1}, {0, 19999, 18380, 1}, {0, 19999, 19293, 1}, {0, 19999, 15752, 1}, {0, 19999, 15186, 1}, {0, 19999, 16779, 1}, {0, 19999, 13720, 1}, {0, 19999, 11594, 1}, {0, 19999, 17321, 1}, {0, 19999, 16018, 1}, {0, 19999, 12772, 1}, {0, 19999, 19356, 1}, {0, 19999, 17621, 1}, {0, 19999, 10887, 1}, {0, 19999, 15804, 1}, {0, 19999, 12756, 1}, {0, 19999, 10771, 1}, {0, 19999, 16950, 1}, {0, 19999, 19232, 1}, {0, 19999, 19140, 1}, {0, 19999, 14188, 1}, {0, 19999, 12544, 1}, {0, 19999, 12516, 1}, {0, 19999, 12729, 1}, {0, 19999, 19883, 1}, {0, 19999, 19110, 1}, {0, 19999, 13699, 1}, {0, 19999, 11062, 1}, {0, 19999, 18107, 1}, {0, 19999, 11483, 1}, {0, 19999, 19571, 1}, {0, 19999, 17260, 1}, {0, 19999, 10636, 1}, {0, 19999, 18778, 1}, {0, 19999, 18320, 1}, {0, 19999, 14999, 1}, {0, 19999, 14219, 1}, {0, 19999, 10287, 1}, {0, 19999, 18901, 1}, {0, 19999, 15274, 1}, {0, 19999, 13093, 1}, {0, 19999, 11361, 1}, {0, 19999, 18006, 1}, {0, 19999, 13381, 1}, {0, 19999, 12105, 1}, {0, 19999, 15793, 1}, {0, 19999, 10386, 1}, {0, 19999, 11177, 1}, {0, 19999, 19096, 1}, {0, 19999, 13692, 1}, {0, 19999, 14114, 1}, {0, 19999, 15378, 1}, {0, 19999, 11250, 1}, {0, 19999, 11921, 1}, {0, 19999, 11878, 1}, {0, 19999, 13907, 1}, {0, 19999, 16550, 1}, {0, 19999, 15175, 1}, {0, 19999, 19624, 1}, {0, 19999, 18272, 1}, {0, 19999, 18484, 1}, {0, 19999, 18084, 1}, {0, 19999, 13666, 1}, {0, 19999, 16055, 1}, {0, 19999, 10401, 1}, {0, 19999, 14085, 1}, {0, 19999, 17328, 1}, {0, 19999, 17871, 1}, {0, 19999, 19458, 1}, {0, 19999, 12684, 1}, {0, 19999, 17321, 1}, {0, 19999, 15604, 1}, {0, 19999, 12806, 1}, {0, 19999, 18978, 1}, {0, 19999, 12976, 1}, {0, 19999, 19442, 1}, {0, 19999, 10316, 1}, {0, 19999, 19224, 1}, {0, 19999, 16182, 1}, {0, 19999, 18574, 1}, {0, 19999, 14187, 1}, {0, 19999, 10011, 1}, {0, 19999, 18649, 1}, {0, 19999, 12391, 1}, {0, 19999, 19424, 1}, {0, 19999, 14870, 1}, {0, 19999, 11180, 1}, {0, 19999, 15596, 1}, {0, 19999, 17326, 1}, {0, 19999, 19146, 1}, {0, 19999, 14385, 1}, {0, 19999, 14989, 1}, {0, 19999, 16839, 1}, {0, 19999, 12247, 1}, {0, 19999, 18275, 1}, {0, 19999, 17248, 1}, {0, 19999, 15562, 1}, {0, 19999, 16938, 1}, {0, 19999, 14081, 1}, {0, 19999, 14903, 1}, {0, 19999, 12308, 1}, {0, 19999, 13254, 1}, {0, 19999, 19823, 1}, {0, 19999, 15295, 1}, {0, 19999, 18938, 1}, {0, 19999, 12135, 1}, {0, 19999, 12001, 1}, {0, 19999, 15733, 1}, {0, 19999, 14621, 1}, {0, 19999, 15960, 1}, {0, 19999, 10758, 1}, {0, 19999, 17708, 1}, {0, 19999, 14076, 1}, {0, 19999, 18852, 1}, {0, 19999, 17167, 1}, {0, 19999, 14256, 1}, {0, 19999, 19232, 1}, {0, 19999, 19804, 1}, {0, 19999, 14523, 1}, {0, 19999, 18487, 1}, {0, 19999, 16812, 1}, {0, 19999, 15713, 1}, {0, 19999, 16538, 1}, {0, 19999, 14754, 1}, {0, 19999, 19857, 1}, {0, 19999, 19832, 1}, {0, 19999, 15710, 1}, {0, 19999, 11559, 1}, {0, 19999, 15812, 1}, {0, 19999, 17977, 1}, {0, 19999, 12443, 1}, {0, 19999, 18141, 1}, {0, 19999, 10145, 1}, {0, 19999, 17823, 1}, {0, 19999, 19797, 1}, {0, 19999, 11981, 1}, {0, 19999, 16336, 1}, {0, 19999, 17828, 1}, {0, 19999, 12936, 1}, {0, 19999, 10335, 1}, {0, 19999, 18557, 1}, {0, 19999, 14556, 1}, {0, 19999, 12200, 1}, {0, 19999, 13243, 1}, {0, 19999, 19903, 1}, {0, 19999, 15811, 1}, {0, 19999, 14393, 1}, {0, 19999, 16677, 1}, {0, 19999, 17789, 1}, {0, 19999, 12962, 1}, {0, 19999, 13140, 1}, {0, 19999, 12331, 1}, {0, 19999, 11031, 1}, {0, 19999, 10274, 1}, {0, 19999, 11395, 1}, {0, 19999, 13571, 1}, {0, 19999, 11891, 1}, {0, 19999, 15009, 1}, {0, 19999, 16180, 1}, {0, 19999, 19900, 1}, {0, 19999, 12735, 1}, {0, 19999, 14928, 1}, {0, 19999, 14088, 1}, {0, 19999, 11153, 1}, {0, 19999, 18977, 1}, {0, 19999, 10608, 1}, {0, 19999, 16945, 1}, {0, 19999, 19654, 1}, {0, 19999, 13625, 1}, {0, 19999, 11142, 1}, {0, 19999, 16733, 1}, {0, 19999, 12189, 1}, {0, 19999, 15140, 1}, {0, 19999, 12482, 1}, {0, 19999, 16290, 1}, {0, 19999, 12512, 1}, {0, 19999, 17482, 1}, {0, 19999, 18341, 1}, {0, 19999, 15935, 1}, {0, 19999, 10972, 1}, {0, 19999, 13815, 1}, {0, 19999, 18864, 1}, {0, 19999, 16720, 1}, {0, 19999, 13098, 1}, {0, 19999, 14779, 1}, {0, 19999, 13962, 1}, {0, 19999, 19182, 1}, {0, 19999, 11646, 1}, {0, 19999, 16628, 1}, {0, 19999, 12881, 1}, {0, 19999, 16308, 1}, {0, 19999, 19251, 1}, {0, 19999, 11389, 1}, {0, 19999, 18813, 1}, {0, 19999, 12778, 1}, {0, 19999, 16180, 1}, {0, 19999, 12759, 1}, {0, 19999, 15667, 1}, {0, 19999, 15390, 1}, {0, 19999, 19711, 1}, {0, 19999, 15204, 1}, {0, 19999, 14609, 1}, {0, 19999, 16671, 1}, {0, 19999, 11388, 1}, {0, 19999, 18183, 1}, {0, 19999, 12113, 1}, {0, 19999, 14325, 1}, {0, 19999, 19598, 1}, {0, 19999, 13748, 1}, {0, 19999, 17727, 1}, {0, 19999, 16704, 1}, {0, 19999, 19828, 1}, {0, 19999, 11960, 1}, {0, 19999, 17991, 1}, {0, 19999, 15275, 1}, {0, 19999, 13366, 1}, {0, 19999, 12757, 1}, {0, 19999, 10077, 1}, {0, 19999, 16706, 1}, {0, 19999, 17644, 1}, {0, 19999, 11979, 1}, {0, 19999, 14907, 1}, {0, 19999, 16265, 1}, {0, 19999, 17530, 1}, {0, 19999, 17992, 1}, {0, 19999, 15872, 1}, {0, 19999, 10693, 1}, {0, 19999, 18460, 1}, {0, 19999, 10025, 1}, {0, 19999, 18058, 1}, {0, 19999, 19883, 1}, {0, 19999, 16306, 1}, {0, 19999, 18877, 1}, {0, 19999, 15920, 1}, {0, 19999, 14185, 1}, {0, 19999, 19964, 1}, {0, 19999, 12836, 1}, {0, 19999, 15683, 1}, {0, 19999, 15188, 1}, {0, 19999, 19161, 1}, {0, 19999, 19286, 1}, {0, 19999, 13314, 1}, {0, 19999, 11036, 1}, {0, 19999, 16056, 1}, {0, 19999, 19374, 1}, {0, 19999, 13857, 1}, {0, 19999, 18618, 1}, {0, 19999, 10475, 1}, {0, 19999, 14822, 1}, {0, 19999, 15966, 1}, {0, 19999, 14129, 1}, {0, 19999, 19341, 1}, {0, 19999, 15500, 1}, {0, 19999, 18922, 1}, {0, 19999, 10079, 1}, {0, 19999, 18445, 1}, {0, 19999, 14050, 1}, {0, 19999, 16925, 1}, {0, 19999, 16366, 1}, {0, 19999, 12866, 1}, {0, 19999, 10114, 1}, {0, 19999, 19521, 1}, {0, 19999, 15955, 1}, {0, 19999, 16857, 1}, {0, 19999, 14931, 1}, {0, 19999, 13218, 1}, {0, 19999, 17783, 1}, {0, 19999, 14473, 1}, {0, 19999, 11876, 1}, {0, 19999, 17917, 1}, {0, 19999, 19135, 1}, {0, 19999, 12534, 1}, {0, 19999, 15487, 1}, {0, 19999, 15144, 1}, {0, 19999, 12257, 1}, {0, 19999, 14819, 1}, {0, 19999, 10094, 1}, {0, 19999, 14011, 1}, {0, 19999, 11656, 1}, {0, 19999, 16998, 1}, {0, 19999, 10843, 1}, {0, 19999, 14003, 1}, {0, 19999, 12149, 1}, {0, 19999, 10627, 1}, {0, 19999, 14596, 1}, {0, 19999, 15281, 1}, {0, 19999, 14093, 1}, {0, 19999, 18551, 1}, {0, 19999, 18723, 1}, {0, 19999, 18328, 1}, {0, 19999, 11911, 1}, {0, 19999, 16538, 1}, {0, 19999, 11049, 1}, {0, 19999, 12763, 1}, {0, 19999, 12713, 1}, {0, 19999, 17113, 1}, {0, 19999, 19278, 1}, {0, 19999, 16194, 1}, {0, 19999, 19317, 1}, {0, 19999, 18723, 1}, {0, 19999, 10210, 1}, {0, 19999, 10341, 1}, {0, 19999, 16191, 1}, {0, 19999, 15907, 1}, {0, 19999, 11810, 1}, {0, 19999, 15506, 1}, {0, 19999, 17828, 1}, {0, 19999, 18846, 1}, {0, 19999, 11644, 1}, {0, 19999, 17102, 1}, {0, 19999, 17611, 1}, {0, 19999, 15823, 1}, {0, 19999, 14723, 1}, {0, 19999, 14084, 1}, {0, 19999, 19295, 1}, {0, 19999, 15076, 1}, {0, 19999, 18321, 1}, {0, 19999, 18677, 1}, {0, 19999, 14706, 1}, {0, 19999, 18323, 1}, {0, 19999, 17614, 1}, {0, 19999, 11325, 1}, {0, 19999, 17498, 1}, {0, 19999, 12287, 1}, {0, 19999, 15282, 1}, {0, 19999, 10313, 1}, {0, 19999, 16545, 1}, {0, 19999, 10310, 1}, {0, 19999, 11477, 1}, {0, 19999, 17667, 1}, {0, 19999, 11728, 1}, {0, 19999, 19244, 1}, {0, 19999, 11596, 1}, {0, 19999, 16983, 1}, {0, 19999, 11272, 1}, {0, 19999, 12476, 1}, {0, 19999, 13926, 1}, {0, 19999, 18168, 1}, {0, 19999, 19928, 1}, {0, 19999, 11695, 1}, {0, 19999, 11878, 1}, {0, 19999, 19933, 1}, {0, 19999, 12753, 1}, {0, 19999, 19870, 1}, {0, 19999, 14504, 1}, {0, 19999, 17687, 1}, {0, 19999, 15821, 1}, {0, 19999, 13165, 1}, {0, 19999, 19420, 1}, {0, 19999, 13492, 1}, {0, 19999, 12277, 1}, {0, 19999, 13582, 1}, {0, 19999, 14568, 1}, {0, 19999, 15678, 1}, {0, 19999, 18575, 1}, {0, 19999, 18351, 1}, {0, 19999, 13606, 1}, {0, 19999, 10653, 1}, {0, 19999, 12896, 1}, {0, 19999, 11907, 1}, {0, 19999, 19682, 1}, {0, 19999, 12476, 1}, {0, 19999, 15275, 1}, {0, 19999, 19315, 1}, {0, 19999, 15669, 1}, {0, 19999, 13316, 1}, {0, 19999, 12385, 1}, {0, 19999, 16111, 1}, {0, 19999, 16484, 1}, {0, 19999, 19397, 1}, {0, 19999, 12791, 1}, {0, 19999, 10762, 1}, {0, 19999, 15789, 1}, {0, 19999, 13987, 1}, {0, 19999, 10543, 1}, {0, 19999, 10766, 1}, {0, 19999, 13284, 1}, {0, 19999, 10555, 1}, {0, 19999, 13985, 1}, {0, 19999, 18557, 1}, {0, 19999, 11485, 1}, {0, 19999, 17120, 1}, {0, 19999, 11564, 1}, {0, 19999, 12821, 1}, {0, 19999, 10239, 1}, {0, 19999, 19845, 1}, {0, 19999, 15723, 1}, {0, 19999, 18186, 1}, {0, 19999, 18603, 1}, {0, 19999, 15083, 1}, {0, 19999, 10496, 1}, {0, 19999, 18494, 1}, {0, 19999, 10141, 1}, {0, 19999, 17633, 1}, {0, 19999, 16514, 1}, {0, 19999, 12258, 1}, {0, 19999, 17761, 1}, {0, 19999, 18405, 1}, {0, 19999, 18950, 1}, {0, 19999, 14397, 1}, {0, 19999, 13469, 1}, {0, 19999, 19935, 1}, {0, 19999, 17376, 1}, {0, 19999, 13593, 1}, {0, 19999, 17499, 1}, {0, 19999, 15799, 1}, {0, 19999, 11795, 1}, {0, 19999, 19762, 1}, {0, 19999, 16736, 1}, {0, 19999, 15670, 1}, {0, 19999, 19794, 1}, {0, 19999, 10821, 1}, {0, 19999, 11189, 1}, {0, 19999, 11669, 1}, {0, 19999, 18532, 1}, {0, 19999, 12144, 1}, {0, 19999, 19582, 1}, {0, 19999, 19313, 1}, {0, 19999, 13555, 1}, {0, 19999, 10429, 1}, {0, 19999, 13361, 1}, {0, 19999, 12683, 1}, {0, 19999, 17767, 1}, {0, 19999, 19722, 1}, {0, 19999, 16623, 1}, {0, 19999, 15367, 1}, {0, 19999, 14233, 1}, {0, 19999, 16446, 1}, {0, 19999, 13610, 1}, {0, 19999, 15979, 1}, {0, 19999, 18222, 1}, {0, 19999, 15966, 1}, {0, 19999, 14458, 1}, {0, 19999, 16832, 1}, {0, 19999, 17859, 1}, {0, 19999, 15732, 1}, {0, 19999, 11983, 1}, {0, 19999, 16815, 1}, {0, 19999, 15068, 1}, {0, 19999, 12312, 1}, {0, 19999, 15532, 1}, {0, 19999, 17606, 1}, {0, 19999, 16940, 1}, {0, 19999, 13904, 1}, {0, 19999, 11811, 1}, {0, 19999, 16936, 1}, {0, 19999, 10747, 1}, {0, 19999, 10031, 1}, {0, 19999, 19245, 1}, {0, 19999, 11461, 1}, {0, 19999, 14086, 1}, {0, 19999, 10239, 1}, {0, 19999, 11995, 1}, {0, 19999, 17865, 1}, {0, 19999, 18452, 1}, {0, 19999, 10727, 1}, {0, 19999, 11677, 1}, {0, 19999, 14407, 1}, {0, 19999, 14769, 1}, {0, 19999, 17373, 1}, {0, 19999, 16393, 1}, {0, 19999, 12217, 1}, {0, 19999, 12799, 1}, {0, 19999, 10358, 1}, {0, 19999, 17949, 1}, {0, 19999, 19492, 1}, {0, 19999, 15881, 1}, {0, 19999, 14671, 1}, {0, 19999, 13503, 1}, {0, 19999, 15235, 1}, {0, 19999, 19945, 1}, {0, 19999, 12844, 1}, {0, 19999, 18497, 1}, {0, 19999, 18100, 1}, {0, 19999, 10262, 1}, {0, 19999, 19899, 1}, {0, 19999, 16019, 1}, {0, 19999, 18867, 1}, {0, 19999, 11057, 1}, {0, 19999, 19517, 1}, {0, 19999, 11520, 1}, {0, 19999, 11038, 1}, {0, 19999, 17637, 1}, {0, 19999, 18398, 1}, {0, 19999, 11837, 1}, {0, 19999, 10155, 1}, {0, 19999, 16242, 1}, {0, 19999, 15896, 1}, {0, 19999, 13570, 1}, {0, 19999, 14141, 1}, {0, 19999, 14363, 1}, {0, 19999, 19850, 1}, {0, 19999, 12815, 1}, {0, 19999, 15023, 1}, {0, 19999, 15652, 1}, {0, 19999, 19578, 1}, {0, 19999, 18146, 1}, {0, 19999, 19968, 1}, {0, 19999, 18117, 1}, {0, 19999, 18771, 1}, {0, 19999, 18013, 1}, {0, 19999, 16987, 1}, {0, 19999, 10894, 1}, {0, 19999, 17239, 1}, {0, 19999, 10155, 1}, {0, 19999, 13762, 1}, {0, 19999, 18718, 1}, {0, 19999, 14017, 1}, {0, 19999, 12771, 1}, {0, 19999, 18768, 1}, {0, 19999, 16011, 1}, {0, 19999, 11437, 1}, {0, 19999, 10897, 1}, {0, 19999, 11907, 1}, {0, 19999, 13206, 1}, {0, 19999, 13632, 1}, {0, 19999, 13105, 1}, {0, 19999, 10308, 1}, {0, 19999, 17657, 1}, {0, 19999, 12607, 1}, {0, 19999, 18610, 1}, {0, 19999, 16008, 1}, {0, 19999, 15069, 1}, {0, 19999, 11384, 1}, {0, 19999, 12921, 1}, {0, 19999, 12540, 1}, {0, 19999, 11350, 1}, {0, 19999, 13804, 1}, {0, 19999, 19061, 1}, {0, 19999, 17481, 1}, {0, 19999, 13456, 1}, {0, 19999, 10500, 1}, {0, 19999, 18952, 1}, {0, 19999, 19206, 1}, {0, 19999, 15573, 1}, {0, 19999, 10704, 1}, {0, 19999, 15105, 1}, {0, 19999, 16598, 1}, {0, 19999, 16473, 1}, {0, 19999, 19935, 1}, {0, 19999, 18715, 1}, {0, 19999, 19626, 1}, {0, 19999, 15478, 1}, {0, 19999, 17303, 1}, {0, 19999, 13190, 1}, {0, 19999, 14754, 1}, {0, 19999, 13442, 1}, {0, 19999, 11380, 1}, {0, 19999, 13930, 1}, {0, 19999, 17681, 1}, {0, 19999, 19026, 1}, {0, 19999, 16532, 1}, {0, 19999, 10670, 1}, {0, 19999, 11018, 1}, {0, 19999, 12310, 1}, {0, 19999, 11016, 1}, {0, 19999, 15498, 1}, {0, 19999, 16773, 1}, {0, 19999, 19763, 1}, {0, 19999, 15088, 1}, {0, 19999, 17259, 1}, {0, 19999, 19773, 1}, {0, 19999, 10482, 1}, {0, 19999, 19212, 1}, {0, 19999, 10233, 1}, {0, 19999, 10780, 1}, {0, 19999, 14196, 1}, {0, 19999, 16509, 1}, {0, 19999, 12907, 1}, {0, 19999, 12354, 1}, {0, 19999, 10482, 1}, {0, 19999, 17331, 1}, {0, 19999, 11041, 1}, {0, 19999, 11686, 1}, {0, 19999, 12524, 1}, {0, 19999, 15468, 1}, {0, 19999, 16881, 1}, {0, 19999, 17154, 1}, {0, 19999, 15309, 1}, {0, 19999, 19011, 1}, {0, 19999, 18212, 1}, {0, 19999, 17535, 1}, {0, 19999, 12412, 1}, {0, 19999, 16050, 1}, {0, 19999, 14894, 1}, {0, 19999, 10204, 1}, {0, 19999, 10137, 1}, {0, 19999, 15207, 1}, {0, 19999, 12426, 1}, {0, 19999, 18747, 1}, {0, 19999, 18621, 1}, {0, 19999, 17163, 1}, {0, 19999, 12731, 1}, {0, 19999, 19749, 1}, {0, 19999, 10252, 1}, {0, 19999, 11337, 1}, {0, 19999, 13885, 1}, {0, 19999, 10060, 1}, {0, 19999, 16903, 1}, {0, 19999, 10881, 1}, {0, 19999, 17027, 1}, {0, 19999, 19470, 1}, {0, 19999, 18918, 1}, {0, 19999, 19202, 1}, {0, 19999, 12185, 1}, {0, 19999, 10084, 1}, {0, 19999, 12657, 1}, {0, 19999, 10557, 1}, {0, 19999, 12592, 1}, {0, 19999, 17564, 1}, {0, 19999, 11061, 1}, {0, 19999, 17189, 1}, {0, 19999, 15615, 1}, {0, 19999, 13621, 1}, {0, 19999, 15850, 1}, {0, 19999, 18810, 1}, {0, 19999, 15975, 1}, {0, 19999, 16713, 1}, {0, 19999, 10976, 1}, {0, 19999, 10638, 1}, {0, 19999, 18024, 1}, {0, 19999, 14830, 1}, {0, 19999, 19077, 1}, {0, 19999, 14747, 1}, {0, 19999, 12106, 1}, {0, 19999, 13568, 1}, {0, 19999, 16805, 1}, {0, 19999, 12553, 1}, {0, 19999, 18866, 1}, {0, 19999, 15788, 1}, {0, 19999, 12640, 1}, {0, 19999, 12247, 1}, {0, 19999, 14599, 1}, {0, 19999, 11524, 1}, {0, 19999, 10745, 1}, {0, 19999, 16710, 1}, {0, 19999, 10462, 1}, {0, 19999, 12618, 1}, {0, 19999, 12615, 1}, {0, 19999, 11207, 1}, {0, 19999, 12812, 1}, {0, 19999, 13225, 1}, {0, 19999, 16013, 1}, {0, 19999, 13255, 1}, {0, 19999, 15926, 1}, {0, 19999, 18595, 1}, {0, 19999, 12501, 1}, {0, 19999, 19033, 1}, {0, 19999, 16819, 1}, {0, 19999, 17002, 1}, {0, 19999, 16212, 1}, {0, 19999, 11858, 1}, {0, 19999, 14421, 1}, {0, 19999, 11843, 1}, {0, 19999, 16617, 1}, {0, 19999, 19787, 1}, {0, 19999, 19097, 1}, {0, 19999, 16641, 1}, {0, 19999, 14280, 1}, {0, 19999, 16113, 1}, {0, 19999, 18890, 1}, {0, 19999, 18032, 1}, {0, 19999, 12994, 1}, {0, 19999, 10981, 1}, {0, 19999, 11957, 1}, {0, 19999, 15989, 1}, {0, 19999, 13242, 1}, {0, 19999, 12286, 1}, {0, 19999, 13596, 1}, {0, 19999, 10186, 1}, {0, 19999, 11762, 1}, {0, 19999, 10898, 1}, {0, 19999, 19049, 1}, {0, 19999, 18898, 1}, {0, 19999, 10360, 1}, {0, 19999, 11937, 1}, {0, 19999, 14041, 1}, {0, 19999, 13138, 1}, {0, 19999, 15366, 1}, {0, 19999, 14563, 1}, {0, 19999, 19562, 1}, {0, 19999, 16537, 1}, {0, 19999, 13275, 1}, {0, 19999, 18852, 1}, {0, 19999, 12339, 1}, {0, 19999, 17576, 1}, {0, 19999, 16502, 1}, {0, 19999, 17246, 1}, {0, 19999, 18289, 1}, {0, 19999, 19103, 1}, {0, 19999, 15334, 1}, {0, 19999, 16303, 1}, {0, 19999, 14546, 1}, {0, 19999, 15737, 1}, {0, 19999, 14918, 1}, {0, 19999, 18393, 1}, {0, 19999, 11612, 1}, {0, 19999, 17725, 1}, {0, 19999, 19615, 1}, {0, 19999, 15717, 1}, {0, 19999, 14756, 1}, {0, 19999, 19104, 1}, {0, 19999, 13359, 1}, {0, 19999, 12429, 1}, {0, 19999, 17661, 1}, {0, 19999, 13315, 1}, {0, 19999, 10990, 1}, {0, 19999, 11439, 1}, {0, 19999, 10508, 1}, {0, 19999, 18514, 1}, {0, 19999, 16385, 1}, {0, 19999, 17495, 1}, {0, 19999, 14175, 1}, {0, 19999, 13767, 1}, {0, 19999, 17183, 1}, {0, 19999, 15556, 1}, {0, 19999, 17202, 1}, {0, 19999, 15946, 1}, {0, 19999, 17101, 1}, {0, 19999, 11598, 1}, {0, 19999, 17615, 1}, {0, 19999, 12820, 1}, {0, 19999, 17834, 1}, {0, 19999, 18393, 1}, {0, 19999, 12738, 1}, {0, 19999, 16225, 1}, {0, 19999, 19154, 1}, {0, 19999, 14698, 1}, {0, 19999, 11251, 1}, {0, 19999, 11416, 1}, {0, 19999, 12936, 1}, {0, 19999, 18262, 1}, {0, 19999, 11363, 1}, {0, 19999, 19900, 1}, {0, 19999, 12813, 1}, {0, 19999, 18944, 1}, {0, 19999, 18584, 1}, {0, 19999, 19712, 1}, {0, 19999, 10530, 1}, {0, 19999, 11034, 1}, {0, 19999, 19827, 1}, {0, 19999, 13883, 1}, {0, 19999, 10807, 1}, {0, 19999, 17946, 1}, {0, 19999, 15654, 1}, {0, 19999, 17428, 1}, {0, 19999, 11147, 1}, {0, 19999, 13180, 1}, {0, 19999, 17561, 1}, {0, 19999, 10264, 1}, {0, 19999, 11198, 1}, {0, 19999, 17355, 1}, {0, 19999, 19021, 1}, {0, 19999, 17864, 1}, {0, 19999, 14193, 1}, {0, 19999, 13399, 1}, {0, 19999, 15727, 1}, {0, 19999, 18945, 1}, {0, 19999, 10585, 1}, {0, 19999, 16613, 1}, {0, 19999, 12177, 1}, {0, 19999, 18398, 1}, {0, 19999, 18661, 1}, {0, 19999, 13695, 1}, {0, 19999, 12774, 1}, {0, 19999, 15808, 1}, {0, 19999, 15901, 1}, {0, 19999, 19269, 1}, {0, 19999, 12427, 1}, {0, 19999, 15101, 1}, {0, 19999, 12626, 1}, {0, 19999, 12073, 1}, {0, 19999, 16914, 1}, {0, 19999, 12781, 1}, {0, 19999, 12590, 1}, {0, 19999, 12620, 1}, {0, 19999, 11809, 1}, {0, 19999, 16341, 1}, {0, 19999, 12661, 1}, {0, 19999, 13985, 1}, {0, 19999, 10486, 1}, {0, 19999, 13622, 1}, {0, 19999, 11332, 1}, {0, 19999, 10691, 1}, {0, 19999, 11715, 1}, {0, 19999, 15251, 1}, {0, 19999, 15565, 1}, {0, 19999, 18512, 1}, {0, 19999, 12493, 1}, {0, 19999, 16923, 1}, {0, 19999, 16951, 1}, {0, 19999, 17312, 1}, {0, 19999, 14211, 1}, {0, 19999, 19759, 1}, {0, 19999, 17185, 1}, {0, 19999, 14918, 1}, {0, 19999, 19847, 1}, {0, 19999, 12950, 1}, {0, 19999, 11180, 1}, {0, 19999, 14456, 1}, {0, 19999, 13353, 1}, {0, 19999, 10874, 1}, {0, 19999, 12703, 1}, {0, 19999, 14038, 1}, {0, 19999, 13927, 1}, {0, 19999, 17719, 1}, {0, 19999, 11192, 1}, {0, 19999, 18776, 1}, {0, 19999, 11446, 1}, {0, 19999, 11822, 1}, {0, 19999, 15642, 1}, {0, 19999, 13869, 1}, {0, 19999, 12957, 1}, {0, 19999, 13051, 1}, {0, 19999, 19653, 1}, {0, 19999, 13300, 1}, {0, 19999, 12657, 1}, {0, 19999, 10640, 1}, {0, 19999, 17312, 1}, {0, 19999, 15679, 1}, {0, 19999, 14761, 1}, {0, 19999, 19288, 1}, {0, 19999, 15084, 1}, {0, 19999, 16174, 1}, {0, 19999, 14482, 1}, {0, 19999, 19261, 1}, {0, 19999, 17572, 1}, {0, 19999, 14039, 1}, {0, 19999, 11390, 1}, {0, 19999, 17199, 1}, {0, 19999, 10316, 1}, {0, 19999, 14351, 1}, {0, 19999, 17817, 1}, {0, 19999, 14385, 1}, {0, 19999, 10228, 1}, {0, 19999, 18720, 1}, {0, 19999, 17083, 1}, {0, 19999, 12481, 1}, {0, 19999, 13281, 1}, {0, 19999, 12506, 1}, {0, 19999, 15543, 1}, {0, 19999, 13259, 1}, {0, 19999, 12357, 1}, {0, 19999, 16997, 1}, {0, 19999, 13620, 1}, {0, 19999, 12219, 1}, {0, 19999, 17771, 1}, {0, 19999, 11529, 1}, {0, 19999, 18842, 1}, {0, 19999, 16582, 1}, {0, 19999, 18876, 1}, {0, 19999, 16339, 1}, {0, 19999, 12570, 1}, {0, 19999, 14762, 1}, {0, 19999, 10399, 1}, {0, 19999, 15857, 1}, {0, 19999, 15401, 1}, {0, 19999, 19174, 1}, {0, 19999, 19159, 1}, {0, 19999, 11522, 1}, {0, 19999, 16582, 1}, {0, 19999, 11747, 1}, {0, 19999, 10010, 1}, {0, 19999, 11126, 1}, {0, 19999, 10021, 1}, {0, 19999, 15003, 1}, {0, 19999, 11489, 1}, {0, 19999, 13055, 1}, {0, 19999, 10200, 1}, {0, 19999, 12598, 1}, {0, 19999, 17664, 1}, {0, 19999, 11235, 1}, {0, 19999, 11986, 1}, {0, 19999, 17945, 1}, {0, 19999, 13829, 1}, {0, 19999, 13925, 1}, {0, 19999, 10975, 1}, {0, 19999, 14777, 1}, {0, 19999, 14337, 1}, {0, 19999, 18223, 1}, {0, 19999, 10337, 1}, {0, 19999, 18573, 1}, {0, 19999, 13988, 1}, {0, 19999, 14665, 1}, {0, 19999, 17403, 1}, {0, 19999, 17454, 1}, {0, 19999, 12713, 1}, {0, 19999, 12801, 1}, {0, 19999, 11831, 1}, {0, 19999, 15004, 1}, {0, 19999, 18896, 1}, {0, 19999, 12009, 1}, {0, 19999, 14733, 1}, {0, 19999, 12489, 1}, {0, 19999, 18295, 1}, {0, 19999, 17322, 1}, {0, 19999, 10904, 1}, {0, 19999, 10582, 1}, {0, 19999, 18229, 1}, {0, 19999, 13096, 1}, {0, 19999, 18997, 1}, {0, 19999, 18930, 1}, {0, 19999, 13859, 1}, {0, 19999, 14142, 1}, {0, 19999, 18416, 1}, {0, 19999, 13008, 1}, {0, 19999, 13927, 1}, {0, 19999, 17812, 1}, {0, 19999, 15329, 1}, {0, 19999, 12522, 1}, {0, 19999, 15301, 1}, {0, 19999, 17972, 1}, {0, 19999, 16524, 1}, {0, 19999, 16783, 1}, {0, 19999, 17496, 1}, {0, 19999, 14022, 1}, {0, 19999, 12691, 1}, {0, 19999, 12577, 1}, {0, 19999, 19454, 1}, {0, 19999, 15532, 1}, {0, 19999, 18601, 1}, {0, 19999, 14217, 1}, {0, 19999, 17424, 1}, {0, 19999, 15359, 1}, {0, 19999, 17501, 1}, {0, 19999, 15831, 1}, {0, 19999, 18924, 1}, {0, 19999, 18147, 1}, {0, 19999, 10936, 1}, {0, 19999, 13600, 1}, {0, 19999, 18084, 1}, {0, 19999, 19466, 1}, {0, 19999, 10459, 1}, {0, 19999, 10976, 1}, {0, 19999, 13808, 1}, {0, 19999, 13587, 1}, {0, 19999, 19694, 1}, {0, 19999, 17416, 1}, {0, 19999, 11186, 1}, {0, 19999, 19420, 1}, {0, 19999, 16965, 1}, {0, 19999, 13430, 1}, {0, 19999, 12017, 1}, {0, 19999, 16737, 1}, {0, 19999, 17863, 1}, {0, 19999, 18112, 1}, {0, 19999, 15384, 1}, {0, 19999, 12362, 1}, {0, 19999, 18139, 1}, {0, 19999, 17800, 1}, {0, 19999, 13925, 1}, {0, 19999, 16839, 1}, {0, 19999, 14834, 1}, {0, 19999, 16804, 1}, {0, 19999, 14465, 1}, {0, 19999, 19783, 1}, {0, 19999, 10389, 1}, {0, 19999, 18243, 1}, {0, 19999, 11075, 1}, {0, 19999, 10869, 1}, {0, 19999, 13183, 1}, {0, 19999, 15895, 1}, {0, 19999, 19374, 1}, {0, 19999, 12671, 1}, {0, 19999, 12487, 1}, {0, 19999, 17374, 1}, {0, 19999, 19221, 1}, {0, 19999, 17845, 1}, {0, 19999, 19302, 1}, {0, 19999, 16993, 1}, {0, 19999, 12818, 1}, {0, 19999, 13091, 1}, {0, 19999, 11494, 1}, {0, 19999, 13445, 1}, {0, 19999, 10452, 1}, {0, 19999, 17359, 1}, {0, 19999, 16150, 1}, {0, 19999, 11837, 1}, {0, 19999, 16158, 1}, {0, 19999, 18012, 1}, {0, 19999, 17492, 1}, {0, 19999, 16088, 1}, {0, 19999, 12576, 1}, {0, 19999, 12295, 1}, {0, 19999, 10341, 1}, {0, 19999, 17368, 1}, {0, 19999, 16482, 1}, {0, 19999, 16793, 1}, {0, 19999, 15689, 1}, {0, 19999, 19256, 1}, {0, 19999, 12649, 1}, {0, 19999, 17306, 1}, {0, 19999, 15140, 1}, {0, 19999, 14494, 1}, {0, 19999, 12148, 1}, {0, 19999, 17909, 1}, {0, 19999, 16555, 1}, {0, 19999, 13707, 1}, {0, 19999, 14727, 1}, {0, 19999, 10679, 1}, {0, 19999, 11248, 1}, {0, 19999, 14672, 1}, {0, 19999, 18173, 1}, {0, 19999, 10942, 1}, {0, 19999, 13228, 1}, {0, 19999, 15022, 1}, {0, 19999, 15878, 1}, {0, 19999, 13450, 1}, {0, 19999, 18959, 1}, {0, 19999, 13324, 1}, {0, 19999, 13731, 1}, {0, 19999, 13773, 1}, {0, 19999, 16500, 1}, {0, 19999, 15886, 1}, {0, 19999, 13518, 1}, {0, 19999, 19840, 1}, {0, 19999, 17839, 1}, {0, 19999, 12269, 1}, {0, 19999, 11185, 1}, {0, 19999, 15742, 1}, {0, 19999, 15448, 1}, {0, 19999, 14832, 1}, {0, 19999, 10290, 1}, {0, 19999, 18646, 1}, {0, 19999, 17794, 1}, {0, 19999, 13089, 1}, {0, 19999, 14551, 1}, {0, 19999, 14224, 1}, {0, 19999, 15726, 1}, {0, 19999, 10588, 1}, {0, 19999, 13023, 1}, {0, 19999, 19728, 1}, {0, 19999, 12917, 1}, {0, 19999, 16199, 1}, {0, 19999, 16840, 1}, {0, 19999, 10432, 1}, {0, 19999, 10705, 1}, {0, 19999, 12222, 1}, {0, 19999, 12852, 1}, {0, 19999, 16869, 1}, {0, 19999, 16008, 1}, {0, 19999, 17691, 1}, {0, 19999, 16439, 1}, {0, 19999, 12221, 1}, {0, 19999, 12534, 1}, {0, 19999, 15087, 1}, {0, 19999, 13020, 1}, {0, 19999, 19738, 1}, {0, 19999, 10790, 1}, {0, 19999, 18713, 1}, {0, 19999, 18636, 1}, {0, 19999, 11169, 1}, {0, 19999, 12401, 1}, {0, 19999, 14549, 1}, {0, 19999, 13224, 1}, {0, 19999, 19626, 1}, {0, 19999, 19135, 1}, {0, 19999, 19077, 1}, {0, 19999, 11559, 1}, {0, 19999, 12942, 1}, {0, 19999, 19000, 1}, {0, 19999, 18788, 1}, {0, 19999, 16109, 1}, {0, 19999, 14342, 1}, {0, 19999, 16885, 1}, {0, 19999, 17022, 1}, {0, 19999, 19546, 1}, {0, 19999, 14170, 1}, {0, 19999, 17975, 1}, {0, 19999, 19665, 1}, {0, 19999, 19953, 1}, {0, 19999, 10934, 1}, {0, 19999, 12334, 1}, {0, 19999, 16725, 1}, {0, 19999, 18049, 1}, {0, 19999, 18170, 1}, {0, 19999, 14631, 1}, {0, 19999, 11150, 1}, {0, 19999, 14707, 1}, {0, 19999, 13188, 1}, {0, 19999, 10753, 1}, {0, 19999, 17957, 1}, {0, 19999, 14383, 1}, {0, 19999, 14487, 1}, {0, 19999, 13774, 1}, {0, 19999, 18076, 1}, {0, 19999, 10726, 1}, {0, 19999, 16201, 1}, {0, 19999, 14079, 1}, {0, 19999, 12206, 1}, {0, 19999, 16895, 1}, {0, 19999, 10946, 1}, {0, 19999, 13831, 1}, {0, 19999, 13303, 1}, {0, 19999, 19141, 1}, {0, 19999, 10446, 1}, {0, 19999, 10983, 1}, {0, 19999, 11677, 1}, {0, 19999, 14389, 1}, {0, 19999, 15062, 1}, {0, 19999, 11422, 1}, {0, 19999, 14188, 1}, {0, 19999, 11634, 1}, {0, 19999, 14084, 1}, {0, 19999, 11745, 1}, {0, 19999, 11455, 1}, {0, 19999, 13924, 1}, {0, 19999, 18409, 1}, {0, 19999, 16797, 1}, {0, 19999, 18083, 1}, {0, 19999, 18287, 1}, {0, 19999, 18036, 1}, {0, 19999, 16251, 1}, {0, 19999, 19700, 1}, {0, 19999, 14579, 1}, {0, 19999, 15105, 1}, {0, 19999, 17803, 1}, {0, 19999, 19314, 1}, {0, 19999, 12099, 1}, {0, 19999, 14512, 1}, {0, 19999, 10664, 1}, {0, 19999, 13692, 1}, {0, 19999, 10951, 1}, {0, 19999, 12202, 1}, {0, 19999, 11626, 1}, {0, 19999, 16245, 1}, {0, 19999, 13904, 1}, {0, 19999, 19811, 1}, {0, 19999, 11240, 1}, {0, 19999, 13110, 1}, {0, 19999, 11827, 1}, {0, 19999, 13927, 1}, {0, 19999, 19702, 1}, {0, 19999, 16172, 1}, {0, 19999, 14081, 1}, {0, 19999, 15393, 1}, {0, 19999, 16400, 1}, {0, 19999, 16710, 1}, {0, 19999, 19970, 1}, {0, 19999, 18278, 1}, {0, 19999, 12754, 1}, {0, 19999, 14098, 1}, {0, 19999, 16565, 1}, {0, 19999, 12278, 1}, {0, 19999, 14380, 1}, {0, 19999, 14985, 1}, {0, 19999, 13968, 1}, {0, 19999, 17075, 1}, {0, 19999, 14892, 1}, {0, 19999, 14214, 1}, {0, 19999, 18729, 1}, {0, 19999, 16401, 1}, {0, 19999, 10868, 1}, {0, 19999, 17626, 1}, {0, 19999, 13131, 1}, {0, 19999, 14577, 1}, {0, 19999, 19417, 1}, {0, 19999, 13864, 1}, {0, 19999, 13391, 1}, {0, 19999, 18219, 1}, {0, 19999, 14904, 1}, {0, 19999, 10715, 1}, {0, 19999, 18274, 1}, {0, 19999, 14632, 1}, {0, 19999, 10169, 1}, {0, 19999, 16251, 1}, {0, 19999, 15180, 1}, {0, 19999, 12988, 1}, {0, 19999, 17748, 1}, {0, 19999, 10326, 1}, {0, 19999, 19619, 1}, {0, 19999, 14754, 1}, {0, 19999, 15742, 1}, {0, 19999, 17626, 1}, {0, 19999, 18644, 1}, {0, 19999, 17591, 1}, {0, 19999, 18267, 1}, {0, 19999, 16501, 1}, {0, 19999, 17232, 1}, {0, 19999, 10596, 1}, {0, 19999, 10275, 1}, {0, 19999, 17414, 1}, {0, 19999, 19526, 1}, {0, 19999, 10406, 1}, {0, 19999, 15164, 1}, {0, 19999, 19207, 1}, {0, 19999, 19392, 1}, {0, 19999, 16638, 1}, {0, 19999, 11601, 1}, {0, 19999, 12002, 1}, {0, 19999, 17638, 1}, {0, 19999, 17559, 1}, {0, 19999, 19630, 1}, {0, 19999, 14939, 1}, {0, 19999, 12573, 1}, {0, 19999, 19420, 1}, {0, 19999, 13782, 1}, {0, 19999, 12882, 1}, {0, 19999, 11901, 1}, {0, 19999, 11345, 1}, {0, 19999, 14769, 1}, {0, 19999, 17517, 1}, {0, 19999, 15793, 1}, {0, 19999, 12301, 1}, {0, 19999, 13149, 1}, {0, 19999, 18786, 1}, {0, 19999, 16892, 1}, {0, 19999, 11850, 1}, {0, 19999, 11172, 1}, {0, 19999, 18515, 1}, {0, 19999, 19407, 1}, {0, 19999, 16066, 1}, {0, 19999, 15875, 1}, {0, 19999, 11093, 1}, {0, 19999, 17721, 1}, {0, 19999, 14041, 1}, {0, 19999, 19706, 1}, {0, 19999, 15459, 1}, {0, 19999, 13264, 1}, {0, 19999, 12619, 1}, {0, 19999, 15531, 1}, {0, 19999, 10541, 1}, {0, 19999, 15337, 1}, {0, 19999, 19458, 1}, {0, 19999, 11102, 1}, {0, 19999, 14638, 1}, {0, 19999, 11571, 1}, {0, 19999, 12518, 1}, {0, 19999, 10635, 1}, {0, 19999, 13092, 1}, {0, 19999, 18933, 1}, {0, 19999, 19679, 1}, {0, 19999, 10346, 1}, {0, 19999, 14410, 1}, {0, 19999, 14397, 1}, {0, 19999, 19205, 1}, {0, 19999, 18718, 1}, {0, 19999, 14571, 1}, {0, 19999, 16810, 1}, {0, 19999, 16529, 1}, {0, 19999, 19768, 1}, {0, 19999, 19132, 1}, {0, 19999, 14423, 1}, {0, 19999, 17075, 1}, {0, 19999, 12923, 1}, {0, 19999, 18575, 1}, {0, 19999, 16448, 1}, {0, 19999, 10963, 1}, {0, 19999, 17281, 1}, {0, 19999, 13179, 1}, {0, 19999, 18777, 1}, {0, 19999, 13422, 1}, {0, 19999, 17437, 1}, {0, 19999, 16050, 1}, {0, 19999, 17380, 1}, {0, 19999, 14494, 1}, {0, 19999, 10266, 1}, {0, 19999, 18160, 1}, {0, 19999, 14998, 1}, {0, 19999, 14019, 1}, {0, 19999, 19808, 1}, {0, 19999, 19616, 1}, {0, 19999, 12788, 1}, {0, 19999, 18338, 1}, {0, 19999, 12397, 1}, {0, 19999, 19166, 1}, {0, 19999, 14622, 1}, {0, 19999, 14442, 1}, {0, 19999, 19778, 1}, {0, 19999, 11017, 1}, {0, 19999, 12778, 1}, {0, 19999, 13495, 1}, {0, 19999, 13671, 1}, {0, 19999, 17783, 1}, {0, 19999, 14722, 1}, {0, 19999, 14664, 1}, {0, 19999, 10114, 1}, {0, 19999, 19201, 1}, {0, 19999, 15725, 1}, {0, 19999, 16623, 1}, {0, 19999, 14892, 1}, {0, 19999, 17186, 1}, {0, 19999, 18332, 1}, {0, 19999, 14185, 1}, {0, 19999, 17023, 1}, {0, 19999, 11025, 1}, {0, 19999, 14559, 1}, {0, 19999, 16062, 1}, {0, 19999, 11827, 1}, {0, 19999, 16274, 1}, {0, 19999, 14440, 1}, {0, 19999, 18005, 1}, {0, 19999, 12672, 1}, {0, 19999, 10801, 1}, {0, 19999, 14955, 1}, {0, 19999, 18249, 1}, {0, 19999, 11982, 1}, {0, 19999, 19177, 1}, {0, 19999, 12819, 1}, {0, 19999, 15603, 1}, {0, 19999, 12036, 1}, {0, 19999, 18459, 1}, {0, 19999, 10850, 1}, {0, 19999, 16692, 1}, {0, 19999, 12486, 1}, {0, 19999, 17039, 1}, {0, 19999, 19625, 1}, {0, 19999, 17985, 1}, {0, 19999, 15043, 1}, {0, 19999, 12810, 1}, {0, 19999, 12087, 1}, {0, 19999, 18709, 1}, {0, 19999, 11919, 1}, {0, 19999, 18149, 1}, {0, 19999, 12186, 1}, {0, 19999, 17948, 1}, {0, 19999, 15876, 1}, {0, 19999, 18497, 1}, + } + for _, tc := range tcs { + a.Equal(tc.ans, mc.Query(tc.left, tc.right, tc.threshold)) + } +} diff --git a/Algorithms/1160.find-words-that-can-be-formed-by-characters/README.md b/Algorithms/1160.find-words-that-can-be-formed-by-characters/README.md new file mode 100755 index 000000000..26b097f48 --- /dev/null +++ b/Algorithms/1160.find-words-that-can-be-formed-by-characters/README.md @@ -0,0 +1,31 @@ +# [1160. Find Words That Can Be Formed by Characters](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/) + +You are given an array of strings words and a string chars. + +A string is good if it can be formed by characters from chars (each character can only be used once). + +Return the sum of lengths of all good strings in words. + +Example 1: + +```text +Input: words = ["cat","bt","hat","tree"], chars = "atach" +Output: 6 +Explanation: +The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6. +``` + +Example 2: + +```text +Input: words = ["hello","world","leetcode"], chars = "welldonehoneyr" +Output: 10 +Explanation: +The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10. +``` + +Note: + +- `1 <= words.length <= 1000` +- `1 <= words[i].length, chars.length <= 100` +- `All strings contain lowercase English letters only.` diff --git a/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters.go b/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters.go new file mode 100755 index 000000000..ba2c78afc --- /dev/null +++ b/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters.go @@ -0,0 +1,32 @@ +package problem1160 + +func countCharacters(words []string, chars string) int { + char := parse(chars) + res := 0 + for _, word := range words { + res += count(char, word) + } + return res +} + +func parse(s string) []int { + res := make([]int, 26) + for _, r := range s { + res[r-'a']++ + } + return res +} + +func count(char []int, word string) int { + res := 0 + w := make([]int, 26) + for _, r := range word { + b := r - 'a' + w[b]++ + if w[b] > char[b] { + return 0 + } + res++ + } + return res +} diff --git a/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters_test.go b/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters_test.go new file mode 100755 index 000000000..b31dc8265 --- /dev/null +++ b/Algorithms/1160.find-words-that-can-be-formed-by-characters/find-words-that-can-be-formed-by-characters_test.go @@ -0,0 +1,45 @@ +package problem1160 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + chars string + ans int +}{ + + { + []string{"cat", "bt", "hat", "tree"}, + "atach", + 6, + }, + + { + []string{"hello", "world", "leetcode"}, + "welldonehoneyr", + 10, + }, + + // 可以有多个 testcase +} + +func Test_countCharacters(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, countCharacters(tc.words, tc.chars), "输入:%v", tc) + } +} + +func Benchmark_countCharacters(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + countCharacters(tc.words, tc.chars) + } + } +} diff --git a/Algorithms/1161.maximum-level-sum-of-a-binary-tree/1.JPG b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/1.JPG new file mode 100644 index 000000000..f524e7484 Binary files /dev/null and b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/1.JPG differ diff --git a/Algorithms/1161.maximum-level-sum-of-a-binary-tree/README.md b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/README.md new file mode 100755 index 000000000..7c1a2a23b --- /dev/null +++ b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/README.md @@ -0,0 +1,24 @@ +# [1161. Maximum Level Sum of a Binary Tree](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/) + +Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. + +Return the smallest level X such that the sum of all the values of nodes at level X is maximal. + +Example 1: + +![1](1.JPG) + +```text +Input: [1,7,0,7,-8,null,null] +Output: 2 +Explanation: +Level 1 sum = 1. +Level 2 sum = 7 + 0 = 7. +Level 3 sum = 7 + -8 = -1. +So we return the level with the maximum sum which is level 2. +``` + +Note: + +- The number of nodes in the given tree is between 1 and 10^4. +- -10^5 <= node.val <= 10^5 diff --git a/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree.go b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree.go new file mode 100755 index 000000000..d7f4a82f4 --- /dev/null +++ b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree.go @@ -0,0 +1,47 @@ +package problem1161 + +import ( + "math" + + "github.com/aQuaYi/LeetCode-in-Go/kit" +) + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +func maxLevelSum(root *TreeNode) int { + queue := make([]*TreeNode, 1, 1<<10) + queue[0] = root + + res, max := 0, math.MinInt64 + level, sum := 1, 0 + // BFS + for len(queue) > 0 { + size := len(queue) + for i := 0; i < size; i++ { + node := queue[i] + sum += node.Val + if node.Left != nil { + queue = append(queue, node.Left) + } + if node.Right != nil { + queue = append(queue, node.Right) + } + } + + if max < sum { + res, max = level, sum + } + + level, sum = level+1, 0 + + queue = queue[size:] + } + + return res +} diff --git a/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree_test.go b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree_test.go new file mode 100755 index 000000000..b416e14f0 --- /dev/null +++ b/Algorithms/1161.maximum-level-sum-of-a-binary-tree/maximum-level-sum-of-a-binary-tree_test.go @@ -0,0 +1,40 @@ +package problem1161 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + root []int + ans int +}{ + + { + []int{1, 7, 0, 7, -8, kit.NULL, kit.NULL}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_maxLevelSum(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + ast.Equal(tc.ans, maxLevelSum(root), "输入:%v", tc) + } +} + +func Benchmark_maxLevelSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + root := kit.Ints2TreeNode(tc.root) + maxLevelSum(root) + } + } +} diff --git a/Algorithms/1162.as-far-from-land-as-possible/1.JPG b/Algorithms/1162.as-far-from-land-as-possible/1.JPG new file mode 100644 index 000000000..072ff73fb Binary files /dev/null and b/Algorithms/1162.as-far-from-land-as-possible/1.JPG differ diff --git a/Algorithms/1162.as-far-from-land-as-possible/2.JPG b/Algorithms/1162.as-far-from-land-as-possible/2.JPG new file mode 100644 index 000000000..337d4c4af Binary files /dev/null and b/Algorithms/1162.as-far-from-land-as-possible/2.JPG differ diff --git a/Algorithms/1162.as-far-from-land-as-possible/README.md b/Algorithms/1162.as-far-from-land-as-possible/README.md new file mode 100755 index 000000000..f2c4a66ff --- /dev/null +++ b/Algorithms/1162.as-far-from-land-as-possible/README.md @@ -0,0 +1,34 @@ +# [1162. As Far from Land as Possible](https://leetcode.com/problems/as-far-from-land-as-possible/) + +Given an N x N grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized and return the distance. + +The distance used in this problem is the Manhattan distance: the distance between two cells (x0, y0) and (x1, y1) is |x0 - x1| + |y0 - y1|. + +If no land or water exists in the grid, return -1. + +Example 1: + +![1](1.JPG) + +```text +Input: [[1,0,1],[0,0,0],[1,0,1]] +Output: 2 +Explanation: +The cell (1, 1) is as far as possible from all the land with distance 2. +``` + +Example 2: + +![2](2.JPG) + +```text +Input: [[1,0,0],[0,0,0],[0,0,0]] +Output: 4 +Explanation: +The cell (2, 2) is as far as possible from all the land with distance 4. +``` + +Note: + +- `1 <= grid.length == grid[0].length <= 100` +- `grid[i][j] is 0 or 1` diff --git a/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible.go b/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible.go new file mode 100755 index 000000000..db593af81 --- /dev/null +++ b/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible.go @@ -0,0 +1,45 @@ +package problem1162 + +var dx = []int{-1, 1, 0, 0} +var dy = []int{0, 0, -1, 1} + +func maxDistance(grid [][]int) int { + n := len(grid) + + lands := make([][2]int, 0, n) + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + if grid[i][j] == 1 { + lands = append(lands, [2]int{i, j}) + } + } + } + + if len(lands) == n*n { + return -1 + } + + dist := -1 + // BFS + for len(lands) > 0 { + dist++ + size := len(lands) + for s := 0; s < size; s++ { + g := lands[s] + x, y := g[0], g[1] + for k := 0; k < 4; k++ { + i, j := x+dx[k], y+dy[k] + if i < 0 || n <= i || + j < 0 || n <= j || + grid[i][j] == 1 { + continue + } + lands = append(lands, [2]int{i, j}) + grid[i][j] = 1 + } + } + lands = lands[size:] + } + + return dist +} diff --git a/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible_test.go b/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible_test.go new file mode 100755 index 000000000..3ad754c26 --- /dev/null +++ b/Algorithms/1162.as-far-from-land-as-possible/as-far-from-land-as-possible_test.go @@ -0,0 +1,47 @@ +package problem1162 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + grid [][]int + ans int +}{ + + { + [][]int{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, + -1, + }, + + { + [][]int{{1, 0, 1}, {0, 0, 0}, {1, 0, 1}}, + 2, + }, + + { + [][]int{{1, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + 4, + }, + + // 可以有多个 testcase +} + +func Test_maxDistance(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, maxDistance(tc.grid), "输入:%v", tc) + } +} + +func Benchmark_maxDistance(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxDistance(tc.grid) + } + } +} diff --git a/Algorithms/1163.last-substring-in-lexicographical-order/README.md b/Algorithms/1163.last-substring-in-lexicographical-order/README.md new file mode 100755 index 000000000..50a95369b --- /dev/null +++ b/Algorithms/1163.last-substring-in-lexicographical-order/README.md @@ -0,0 +1,23 @@ +# [1163. Last Substring in Lexicographical Order](https://leetcode.com/problems/last-substring-in-lexicographical-order/) + +Given a string s, return the last substring of s in lexicographical order. + +Example 1: + +```text +Input: "abab" +Output: "bab" +Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. The lexicographically maximum substring is "bab". +``` + +Example 2: + +```text +Input: "leetcode" +Output: "tcode" +``` + +Note: + +- `1 <= s.length <= 4 * 10^5` +- `s contains only lowercase English letters.` diff --git a/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order.go b/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order.go new file mode 100755 index 000000000..e67cbdc0a --- /dev/null +++ b/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order.go @@ -0,0 +1,31 @@ +package problem1163 + +func lastSubstring(s string) string { + last, n := 0, len(s) + for i := 1; i < n; i++ { + if s[i-1] == s[i] { + // all of s[last:i+1] are the same letter. + // 'i' has no chance to be the new 'last' + // the reason is + // 1. s[i+1] > s[i], 'i+1' is the new 'last' + // 2. s[i+1] < s[i], 'last' is still 'last' + // 3. s[i+1] = s[i], 'i+1' is the new 'i' + // like above, need a different letter to make decision + continue + } + for l := 0; i+l < n; l++ { + if s[last+l] < s[i+l] { + // s[i:] is bigger than s[last:] + // new begin is here + last = i + break + } + if s[last+l] > s[i+l] { + // s[last:] is bigger than s[i:] + // no need to compare continue + break + } + } + } + return s[last:] +} diff --git a/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order_test.go b/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order_test.go new file mode 100755 index 000000000..1a09b6f8e --- /dev/null +++ b/Algorithms/1163.last-substring-in-lexicographical-order/last-substring-in-lexicographical-order_test.go @@ -0,0 +1,57 @@ +package problem1163 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "abcdexyzfzz", + "zz", + }, + + { + "nodkzqossehfztonbzkejoemqrhkpqbmwquxkgxeuvtqeersrxhbeeqewmjfrkhbzureouvhwylolikewlttwgbyyvjfcatnfkuudtlftbakfdljklqcnudunbuxunebafbkauymfmosrvtkdddwlpbhtdfftuzaxtptqoqdisqevvnetxqpnfejwbpxbwmchfcvdwyfjcpixywqfzmrudaicmnxuzoapkfjrkcomvyzwtywsvkncjlzdycqfavckdjdnmdppthmarkirtloegoubetuygwsvppwjlguhkqninxuqbttcaawpooenkphiotyjxiwqybrasqxjulwplspovvffhzolifstzyhtdlfgsioxnriymcgdpxrhuqxidybiulypufciqezuuxwoxxtfeeeguaoathsdyqaotidoudsnimtncdifrpmsuaytsgooysemdcsddgflgntondsecxtlxoqqmbfzprpskgiwxghvdcutebvjpemijnmbkqiitecgykyglgjlaudothmegnaenpxawkfspspmbnozipqlgbraekfxsengmubullzqnzxevjnvnchldkciumsflnutzkvawmeujxtsylkzkpfotnczscqkrcumvjsgdjlpaxgzbhsnsxddupmetxdqnoqxknqtmlvtnpsbmzkviezndfgtilvyajcepkriphiyuvxewfwffrciyhkkgojgnmrhxhxredxvlkyogvqqvfhcbkwpxvfpisqvtcedxkcpaivpncqmvwbmifqtrqyccqkgordnlwgqxfvrojlrgstvxvfdnqjzvdkaxycekqhgjicuqqzzedjxoupdtqeshroabzjoffwpdocacyczjlrcfqdradlwvplzpduskdedrxdlsqdzfwuxtjzrmaswqltcagiytnzptqovzeimwwrlelzfxusnppijsgyxdsmwronsbbdalyiglnnwoaarixdrrliorrhbfsxdcbwzcgqpqhrgbxmlgrxbynsykbellcqrqyfiiupufulotnjbhezsqbqkbqxrzuasvcjxsmtmlptqbcnkzudjusaphgttqlmvybqipuyoyupwbwnduchdmcqgoffibvybivbzyteapzbiaqgwtcmrbdbpgucpeosepcaokgsnaamsxyikbeslpdlinvuwyutrmjbyormeogbyabrapzamqcyxjnqoxseziqauivcjrhfpodycxzfowqpwznxmzcrqhljdltkoxncezlxeptqojzrghgqmujeyzrvylejwvchklqlajemhgavoymnyivifwbmisdptswkxqdynsgescrezrojrjyumexfbznpswteafhzrekxuezeiijmfqhfiyodedlvkslnocayharrpmpgakrxfnkhsgygjdiuacdkglngdbinfyrbhhjasyaffierzfempsfotuuayffxbyzqhwewiowkerbomwghyutgtsvdnwqtytivfzjswsylyqlfrpamdqxfrpwgwfcxaemvcgymigppssgzbnnfyimhaeddsonsugyedwjzrodfjrcqmdhtteopovhclsdaldkbwhxsanfihumntkucdmunknsxeplvnzwrjfnflaqvmbproakjjleugpcxlhqsxetxgvtodrlxbcfxwmadnphdtbuwzuasyexlozznfumbjxszxygysmkihgbfkjddrbztsfjakgeoxebbbgqsomugtgmqadwcmffoxwbfwefhhniaibgspdegycrqmnilnmozrnxxynjxkxnuxqabqpnlursaicsmglugfgldullhufctzvnkkjvlmfunfzdulqpxsksidqjxsvtjgmffxdpmkjfyjwzfckvukoasbbndeaykmvegwanttuixyawyhnvbjrbefelysdvuqevugtnikixmhypjpdremfpnncrxaoyxfrojfwfdgxtukmkvuyfvtqqmuykoppqwmjcnfkomeacsmpmntogudjyikaeyeecnrzxwfpsrjawqottdhifclfiuezijertxnjzbnvsvfplbuqpznnpawltwrgyallojiilpwhmhvwretmgkfslfwccjtraegnwlzyemtrgesyhqazuvhonpieinoqtikhpaivfdwwuevvbptvjhaanzhnsxxwkgnhqcsnhmrakbxxckigjdceamrnfctrgqacexwhsscmewnxuhblxjyavqmulcmjcrkwrdjcrqdvezopgqnadkdydfvhauulvvqutmseqfagszlisvjxqzajmwgiincdvuuqoemjtrzodqwnkyoakbqwhehznpbvzkikbzyslldwfhxfhgiwvzawramcpstdwbjoceqbskbedlknywoaprzvelmkhxfxyhftptocbghvwpztkcldtkffzgrtvovnymfqvwphcgffvjtznnvjyfhdzbzeugcdpazdhztuixmptltnbphrnfvslvalbzfjjezychliguoorxqmnevhuaqgygkbwinaiilpylzyohrcqisimxckrcywvazboxtmudtmjxgqyxgtonzkxcugrbwdtjijxmicyulckrrtvdkzlnpmcjrkpqiqnxqzgyirupykzsujmgrxsssmjpngvbfxdpzfbausuuftytrtjetaddtkaoqgvqnkpkpzqbzvztjdbpqvinqmjcowckggjnbrputfoghwdzwhwshrzipnxhmyxdztdjonxgvujvgogpwselpnodyberataunukchhgkcnijvfmzirbgipjntgaoqxaetevgqhyxexwodzbwisqrcxeycedfnrhsckpkbgqsshehkbenmpuesvufnygqvwfiwygezmtghnoxieviuihkdnbkhrttzvbsurujkwryqtbvbgtzvqyiqlxebrccouxsthimrizexfgaexfyfvslmhpllpouitqviwwigkkzjxjnfxjxaefilkoendvqgftoaoaoyvjskckmcsoxcqpbazwsutounnexlzmtvgtzeaygzhzfuouvcxohnxieeqmauoxjnoqjjcrztwosfegtqrvateuvvjticygmdmsgcsmqanbtndylialjlxgfoujicoakrrnnjvfaqykthxuxipkcrbtgsdyjwtadhepzcddcihzjzvixdvgznifcrnjwtezjdkwxycltcpqmbxopqgdhsaeajsvzwkyalimkoayqoqeozfszuigbbcfayflyhubkxwprzuoeroyixpupexrldpsejihsczvtnxxehwpjmmwubkawjaolukgsrzkiygdudilesrdqaujfhammqckwvpsiweppuzwqzucnragzakdvihypckgkwozcpwzbxtihgcvtuqvulzibkbqwvkvwesvlrpofuinqdzotuaqhoaignmdeeqecjkygudzjjtmnflfozsburoglbdsjgnokmojlffjckuaktjenzqobtltwfgiedaqjdhnvtpciodlbowpehlgsduzanyosgnxfpsswicgwibemufuamefixcngpoienivpifsfrakwzqkrbwzeepvgwogpyzruabfbagrkjqosntkvewblwpuwbeldfbibrigbpddiougnarsfcbsasqndoufgmlswdwfchyiutygvdjoxryaxdgwhkrifvreouqvdzemrocsldsattrkwcngxehmnmrdaaxrzaghxaugxbgtcdlomvxgelwsfdrersnfyhalzfqwrfpwakfviazzjvypugkxuqutixayfyedhiasorqwbngobpyyqnypshdiglyykwjnnxqznyzihkxmizezdvunyulogeyekbvfztwrtrwtoesqvcsqubuezknjlamtlkcnmouwtarcbgakfocxbiiyotihvztqngndyuapcijlougcrzbytvnxwjfgaysptwmcjbjxajijnajzjvrkegweaabbrkvkmudbmqerukfsdpmpdypoenhdfoodazflzbsxvvpvxlzkdvlmdgcarrfcixskkwfdqmvfcjgmpqfgvdlextdbhgurywpgflnnysuadtmoyphysrzwivxxcekmddiaurwmtsptnvxjiazlsyzzsfxbgmpydavxwzijgrbrlvrxkuqvqldxqtpygerxmhkonjypupjfpjjrjajcrxkfzgrvjmwjzfdaufwutxgvyptcfgocthdnodybvdszyfazwdlnxllnftacvozfqmqqzopsonaekfgwpjoeqhsgekkenwplwpspnysokddawqblxgqivckiakvystcdzhsdgipcfiefypzahngiwjkclomegnsrtsbtnayesdkwjrqsicliquehnotkbzolgazqvzpjiwamsffrsywmqlxwhtdqndwzufwitcnvclznnmghxzgpogfeipnfmucgncpxbfebdnpthbcufysxhgcpjyzxxqystwusemztrqtviomovkzweppvlfgfzsmowhvxqtcsjksprgjqxyuqoiprtdklqktkdryequozipztzlijlgcuzsiqkzecsyxgsltsjcudykttbivbbrptykjdnlvbfkymojpelkdwieexathummapmteajbutqiniauckfrhgcrcvdpfikylelzwpqnpukbamidkinupowvghfyhhxpqyxwcnhubzhabnwydoupuunjqqyzuxqrkygrxembqwvdctmkcvvxobfmxnzyjmmyhvldkagbypkbiuydbpllozdhtomtqqtmngbhngmljwcsgqludkegypswsudappzdfrehgwcjzcoqhnjiplzwljazvxbfijdreohbvykkriwadrechjxzqpshtuslxrfaudqtylhnvgfobrmuivjjbgxcojrdfexkaqpdztohtesyigfxzcdkcnzzaggefbfznnzmbmhgfschdcfizrzgngfugdckzyzqsvpkwweytvgbpqmmvslmkuybacllxtkyutqnlmhukqidnxkrpoohzvvoesufbgwzrlqpnotoqnpaekjnwkheektwpokwnlhwghandgphwdfgddsxffvdadggvcoaytnrnnbzsxqezkpehkunwkofxbksbjhtoiecuxbhsabarpqbholycdquqhbattuvovljryxrjlzsfvwohvweiejlvotvbpbjxhmuabxlfmnjrprpepjxebkvvbqgvexegxskmldzemypmnfdvrlykniipjjpfbvmoivjpmxomnmrjnnfebvdnbeycfujddxfqslhvwehyikjpoalpwprdwywegcmsdhbnbhdkpajrwcpiholoqawovsucorsshtytwepfukzttbbuzotajlvdrucwqpsjyuutxlpgauywdeylktfbrgzdtxncuaxppxkjgyhnufhmxqeyneschgsdjdhgbbcqgixhnjrsnvulthscwntbougidklsyzrlaimzulzfeyktemcqboegvravxrldafiibuihwjzixfiwwipqpfryhmjffgngiuawwdfxuxqibvirksofvnjfwvdqstcgqhkgjdmfnnfatyxijvfavsanxgbeomzoaodteoopzyefdltpipnbrmqnqxikjywnktacxbmlmnmtykabdyvcdljxzqzywsxkcitavjqjneauydgtifnlpwonhsnbivdafbzwsrzgihjdegxftdogtlcojqxgbdlasxymagxwsyhiiwcyqyrujwsnfggdsyclurekgacgtkjfylqijktzrwcslnxbesrorqrwshqquxsjddnzhvmyocrdfrefehspgiyltogshpuododmdimdymzelwytdcdkftkvusdpzlocakcgwbufvpmrlyqghnewfbymjbekqdnspntclriodqleggxosqxdrskmgovugmrffzbmzhfdzdyvtlunvdbeoujaxnkyialgfmdqgdxmjdtdcgtikprxjwknpdezrdhqarjsvyzodgcoctvboyifziazgpovhhdffqpalavvuccyqznojybvrdrhpvazxajrijkvrjzfkzyvsnuyvwdzilwrtmbhpfjrovgpdmoatfgkqvczzkicsjmmtlnhgcrlvydcvvzocgazrixxjhspxjpexficklxsdolbzwbomvwezljvzayvmjfxhfxulanqbxmavbhbracvsmezlxkvakoghbsmfofuciooqxzojdxwgodnejtggxuqxrldxrujskrpkwuhqpzsaeexqdnrysqcppuggzeihyzkhiryillrntyggtgigqyvqtldiiemjbdtvxkbkzskrsnautaseweylekkrrbbtezlnaywuztiduamryjitphgutivxtgybctcaiflkeqbjlhggbenbrldmropztamvwaszkokeahqfpcwyicjrkuvbvmfyicxmgpzqjqhwliwweayoronpnidfjxopblxbfraxbimmxvfqorhjcpfdbgoqgyxdphmlbuhutpvimtzwddjqajxesvoihvkntlopaofliwthnctrojhswmxbverffzuqnnvnsyocvkntcuobwhxhotijxttzxuicafdsynfrgarvltnoccoklyctjfpwtrzqryozsngcsrlhyqwfwxounnonkcqkcobyonpivxplrfmxtvjiyhwhkdepkceqcgrxyghkmeafsgchrtjtmgyujqatfcyptoqqlrddtotlzfmrgemfmplhpckiqfdcmymqxstwimtbljrsuulyvclmmewwertwhcchuijrdosjlhghunusqoxoywvznjwushtfgfujcringndxgowisjbqcfhepmpwignmurozrsyazququjvyfqbemzqlbhahmrypoypzbhkmwbpmsqunwvpqbindujqtkanheqqarrcvyxpeemyubdvaldxypdemakeopjjxrhudbufkfjtymxotpwrkdbqjmlgretkfyvduwogqyhnvprvremzfyerdovqbotummmfvsjunairhfutbrfohdgxirvuyllrwsokeztesfzkbwacmoqrowxzkuqheteukovyyaawmhniiaaacmsyyscewfcwbfllqxwswhayrqathrwpyriuedebdyugyoinfkgjfrqgvyrqnnrnyfyjytdegowxxxcoikqeyawxoeiigymaxdbwqnausshykkmghcndwqkfoonqtmcuzycetnksuiqztdlvfewggzhytdpqbgawloedikpswliyxvwdbaecqjiwxatjlhvntekygzbdmzqcuxgvaleqendktvvhyefgrfuoqtrlbncgbkegbrqxjepywthorsaxxspfqunkxsjgogcxyocaogvktjmtejxhfpeuuiqtgvigkssllndkmxwufhyurbeaobmtljerhqgjakhrsfkygejokynhhdddzvqupjlpkasaumrhmvqzxmouflbovdlyfuajsoinublozzzkpcekddjufofbatmqcnznrjzukzmisorayxovhojvrkqncdyzxilladpvrqbkrfdoodykjazbyyyliqrgqwwjyuiddlzlgjgelzmacqbwvostpqhbcrhjbnczesjavyquprlnuaikomnhjbwzxpipiiotckbvrzrbxuerrqjhuxpcordrntzytzlbaagveylkrrjxszkyukvupifdqkgxcegifcdfpxvfwehtkkkfjuafldqkcvhnyyuecbfitwtkcavelkwskngnhdvuetgjzgfcnyolszagjldencrzmlttiqmlssnkypbqneotcikoxhuoxmymurzjvcfshovzfvbujnuxkjvtqhberonmxaiywjctkulvqiyfdzmauhtwqqljdcscsomjivwpikkffurxgblqqiheeotivcerklfenpmpgxkmrtqfatsuwiiofpuvwtqholvycjmljygsfenntrvhdhzfpxfpnfnetsfwvpntgpyfcuxfzlwqgxpvojtrncdpctnceuvngthpnpstcprevuomwwdxdunefncoglgfxwlynsemcppgckphvtvsbshhjbnndewmkxiqpyfhabyjauksvjsohkxvkixhzifhatzmtalztnanhgkdqernhfebgvmruvqyqnzcoyanmbqkwfgnkfrbifgodrbttdrhzvhfnpugiksuxbkcdhpcuqdqeskwxrtpxeeqcynbsyjnfrduljhyskbksgvxpjwrmstjshyjiyrxkehbhgjyyniwdyohqsvvtaxccmwfpuwxziveufkjkuxixrdjilethwxlqjibokpaustuhxfwdymdtxqslgvenwbdnndmgoworpzveputczzjmekeejjbvdiamjywzleuwbpqyaylhxykztizprvijfcabbmukbgebdxhamfmceasllqycnjzlabpwzllwychmdibjjmdpqlsmpkrgllxzujcwugrjhcwejubveejgictdtlptvygqnfziqsjijejadvcqwpgbpgaquqevjsgdsdfzbomnsumwulhdwgwwtjdufylyxpodpntleymyzgyeqggbwkrwkcjqzvvzdljemdyrutiyxkwwrzadlwavwuscrwrmhpbebzlopmyumdecxkasryqkrbvaealcinvkvtckczytnmzuqauqcbqjqinwlgwafzywasqymatxbwiyveuallqphzkfbxhkkqcnmcojjlvkqbluwtfisqegbnfdftrvctrpquaojylbjlerbqythpddjlddbcerjdbvefrieflpgenuddctkqevdiklucrqcgzpndpijciskjqnqpknuozpzxyetaclhvoigrlsqqyoxqzamkafaqnqoozlyelndtsjwubxzmuutabfluyfapuweddjkysscgljzsjpdbnvlexokvmvdpmjqdsbtnjipuajvbslkavgzdxrqxhwunxmpdjqignctpcgonolfjtmtwsxzzgcjoaqhomhvibhfmqztbknpydauteuxwwkydezvjcwhjbguchwytuhgtlvbnnkkjevsmymcztapegbzbemzkfnehskkaxbjaonbqqsppjvgfggqcidwztyfsmgaxsbrznwmbwgjmrsjrgsdamihtclrbyuaxffzhpqsiyptguloflsgtvbyghpetlqttydbzamczkkipawdvvbffwgxnfhfvybmmagkryhheumjdbjqqentthbfaxhvhovadevbldodmxtuivelawmdbefpokvslsgqtzdrxtuatsjxdggpyxhgppkqeichjrnewtqspzpjnnlnkhbcrmzfuczxfyegipwjviqvjvbnfvpjjwyztdvcqbfiiaraoqxfuagcpfwixmyltzdsicmsnjjapzxkyfaubdyjkykmvvvrtrjsqrganvutsoemdiwltmeypeojiqzulyjofrcrceifpyqcjsoukpvrvnhomwkjuapqwdlgthnbjkfzgdsglsgwqansopzyznsiijcmmidqrtewwwiqqbpufzthdwlwchtylmfjqwfcelzqxtvzvkgizkmdpjrnzttlnututtsxnpxhruftxzpchjdfxabhbixhbeeozzhvziiukrtmlckxeatutarkgdbcvsyaeltaoxkvyymfgoondpokmjecmjcaucyxpwidqlncncpcpozymqfnombginxaalhihgolbttzupooomsshwicumasqicqptihevclihzfrreijragnyyaxyaohinmntdirtbswncyhzjkgbkzkrjmymgmlmqblzivagutwfweiznjdrukpbejxhyftahddnuthudzikgdbhmlchhazqvvdbmtwkzsvyaovgqtjnziaysqappzxywfjwmsgikyahrpnsfyaqblzfyfonegnceqpxasrqvklaoxbaldotvddypyseabhfmibimpokclyboewkhnaqirclkcjqsmxapqonhtenzqksrkmmrpelaifjvhetdjcldovatfukvgvvwmxhbaqrivlwochqxygsrgkuvngvnydvhcnbtkaskdbqntezdntnkpssyqawxtixlskpdpuwtbzqfvjfykueaeyhnxdiqdyckmrusjtyrcyuznxzudhuwweahmtymtcddscxjozsiplqphdkynxuvxwltzgezsdtmgtwvgykkjlbjxssrqsybvflujuyjudqbicndokpkiqxunlvuykylnlasikbaxoxlblusczwqrtreqgsqwkfmmtfrkuhrkmwbsjllyatymucpwecnpnavdtjxrzhmqzusrvrshnohlptrrdzqunojxcovsvllrapgewemuatfzyfybbstftldetyfljlhjwrngkfyuvuadylyxdiqcoqbqoiaqxgujbzostijpvbakozwgllywaqdsfttfdtkwtiurhhhzljnwcpezpqkyoeskyttdvtvxxbbhkhyktmhtosshqyiaypajmcyuzgqdfseomzojoeuxqphjfcudezyuxeuwykmqvyrljhzozpltrjewsrtgomwixdnqrztsidoajddketzcworfytswkwkczeqlqdmimshmrzwbfxworgvkjovqtquwfsyouvgiipxaalqmxpkpmnfwqcfjqveguzetciautzvssgemxwjrqpyaztatumwboxgdymeqkhikdlraugdloptumvrecybqcgfpjunfesfozuglkumgdnnoepsjxvtboaweektbowchrejrnvflrrplxfkjczzhnlymspgusonsfoxujbjpyettwmiiwjecvwfsvgrnwijjkpadrzcemlxosxdayocfywzkhhzbinbzlistdyydfspdezwluqfgxbnwzzjapxvmtcoxwaariladlpctiwqqjnlouvapeaswesqwxpdbyqfrdbxrxiacvhyzkklrhhkoonvyyceogfylvvqsanbnpdvhaqvykxexnwqeqmansyhjqpmsmokhodnifqkrdrwzgtxiolktqoosbocnejamrycuckfimpkiesuqmczazhexkpggghtyplgtyszfvvyoqobqbvsdewncaoodtuewlpsirdkwsollezejtmxkowzllrcqgzdngedusdxpsggxmimrjvomxojolwoywgcrqzutojcgxxnqnjpvpjeptvoaajmttbrnvhjfjojlzurokqeavvgdhrcunjxllfidvdxkbxotojagnqgvijdhqlyrxipfstqixruizvdrgrzleodqosyfzktqoozwtwdvoqguvgiuosskefcvxltvxvimfpiljmnletdpnjzmdrgkqeorwovzmedpqyijovkspltmlmzbjtuzqdbtmqwghpmsetvkmbntqwxywkykjnjbagoerkmkyzyhligqbksacftfllxusmhzyiuqjrvzmlcpcsjjsxrzdcloaxqyjkdgxltsgrhptvgyztouljkjgjymnanmovszfarirrfydjpjnertgzqtwortyhxagkagcsrfknkoxuxmijeoopjfndbxunseyuxrogtijxgwrxkbsdliwarjammfiutzhlzyzgsbbmtmzfrevulwvjdyyjyfipqdtflzbaxzvvhhxbgszqrwgyretanggrtzzdgolgrdybrmwhnicbiehypuzzqkausjwlcwacczswarjqqzghbyqcwcukjvcucyglkikogcksdhkrmryibxrvspigtzygeblksojtyzfaqkgiwmotbsdokletehtecapjmskoabofowfvrvngiiqlpeepyhhecawyabmmhaekpjvxiqkdaueelnvdvngkvkphvxpexctsqraopaxlrexqgifcawybisyscpjlskozdpqpvhphwhyjzttqusynjcyapgdvtyezcqqhrfasopevgahblidspwfnzbamhcmxgsuctzdevjxjhynjpmwsplukbeerdnzuzyylqvxbfemgjqgskodxqtrfkgyxhccpywmpcxbiotgeregckgxmnvctkbwphcvmoivzdcfcbiohpadokqnkevltznkvmcsayhiqxgsdswtmvnagwurdwfzvzuxfwugvvelmqyyuqgrgvdxoyykdjqdrzbstkxwupgmnnrdmxqaadhexrthazpclksgzryzkgtnryrnxnmncbeeqmpdpvxkqczdobrammkznyoumvgptiqkofabgcxzfziywlfpgwywwhhjtplarxwdhvibdokvhlhcrsboxuinebevcpisqpbhrzxvidvfmfpmzfqdxyymxdpkqnrnrgenijcxrjdqsnrcvogdowsykcanuvkewdbybitsviatrxnzgobaodhermtnexyddvcckafymdorkxkaqzarogdsanlulwkcfbgsfulraxkeycwcnumlstmpxkplwxtbyoknxvwzoqhexgixjphzfawwyywgpjyxdurqflhwukwyemouoxwxvetfzcqkzoezkstobgucmghcmlkplajkpecmxsqhnoenrmlfsagiqcaxwjcpvpozlseovwiwnrhzvegjlgmznbhdckvfcqmacjmpyvubqhdurusdkxeqnbderojofhfsckcyvfemlgftjsvlrfcxaypafjkqmzlqyhvficxqpfvbglieufjhjlspdxknolkliqdudecsepbiehvgrfafbanqbszzhjlcspgpptsaqbodigkeupleclryklrntnvgjqtsstasaaiikpczokqqzpesuaatednqpabqkdsweithrrqasmjzvehztuloqgktpcihhvcfgiduffliqrhtwycowoajgpvxfldnupnoyoswtcmrsivetuajvcknwaeuhhapozdtlfzvfcqyceovlvjvulvuyzeyfdtmzfeqhpizxspqnjcqvwevnfhyvlbudjskajwcuoqrwzknihauxkvblvehnkjmpioypipfjljqsrmorwaeystlldmdlfwtsflexbqlryscyhedsfdvmumyzpcktvitdrlectdhvknsphojqqnfcrwdzmgajmsslwisjvxqdqkaqcmbanftngypptwtpflmlaekjgbbpigaogaqwxadorwsjsarcnewmpmzqanysldwcstdlljicydnifhornrajvqlymhzbzlexhhovbodaqvcjbzdkqyouywcdbjvdxtaacqnrwpvoutnkebpfvwsynxedkbjxvwelvencdiyakggxafpaifqhcxwsqvmjnzbkwoxasubbvrccekkogegvmbgcwxqxbnzbhmvagcefyrgxsmzyyupeefrkcgcjmhdgzssxljmxebvbijvkltdnysqxqzwzybuxdjeqfxsdtnbfzaighbmiwgzqhaurtvfuacmhlmxnijtwyeovqsqdtjhpxcukramcimixvbtkaumboidqtzskzrgkmkezztmerzaijsfghyjwqxbwfkvzmklkasxugkezruzyeqmmagvkcrvfykxeotziyurjbwaydtjgjcksbbbwebmqkiebalgtvxsglsfiymhtwsmiddcjdealkvexpquwnvliryporjuiuunsliqhfyrvtfggsqkzvqlbqafshyrkldriynkempvvlzvoynkfxacovceubfbyoqmxfidntimkcxyftmkqjrwqpmvrkpxabwshbiukyozurzokzkkbwyvddqhtuxzywcjotunjnzartlvqtfbkmqyoarcbkfoxgqhxudnmveslxnlffsmxguxyskwbjibcmrhpgzwtbuwsyhwjovtapkpqzunhjynzbbtmqjadvohudmkejcyqkpzpjcvelalegpjuehspjzalcpcyjsvvnnjcvxliflkzuqgtqomwvjxelcssjdhmwwxwkbycymufcepdagzwuejawhpjxogrvpaysdhtbhceknfilltkbeqflqsfkmgwnenrulriysvmnuaqgitukryahvpweezsnbfcxpciuztkzprhsxhdmntghhxsqoyjbpmyvwutafreoozuvspfljkbcouirfqjjfwwdlkxshfhgazczqrrcdpluaymhpaeypheyjmnmjuacjvtrxqkjqtgyjcpfsvzckgttrepwreorjndwytpauqpggfbkziqiqdpmbbftwkvjvrltmxetdflebptohrvtuafyfytcunqkltmnymqxckahivzybdxsgwdyqrsttujivzujyhmtucapawieavnedhniuyxtmhbbxgzavwqpsemvrthljiwnsmyrvywzhmusszjulacgfrqzxqcsdumndcjbgpggtemipmpmllunhgzzubyqeoizfugvczxutuqasugufojtyzxxdcujysavespgxvrsgzdomgnjaspxzmdnithykfcnvbomtmqpwlnbfpztelpjvxsiwryoerbmntqaoqvxkfnuyldxrsgdkijcclajzkxlocijrzweuoynknsnapazndcfmmqwnbjxcutjrbbknlqqtppjjmgidthelzedxbzmtjwkesppxjygmxvugdgoftwyemxvdcroosuiykbbbkdcorjjiluppxecffiqscziskdzqvfteskrxeimbarvywzxhmpmmwzndvnomcutzaywmtzrecbxvpqcquynoqksrzvjjjpaakqlpjloauthsjyjdgutiokxdvfhhbbonsykndhqkmpdivwtshapamlldwozwymxfxopgsperrpktzkbbmrgdcbopmfbrwycztzcpwtemooptfkqihoajyerlogyzgvvobpmnqmuffhfjnctiwsnvcycnxwncinitkswcaktqqthpywpqtcjmzthfewsbfyetjrjbkktdqrowzpvarqnjpcasojzbzvcwoxesycenkgqkeofoeingnbzbwzgmrlnqrrwlxyunznogigliltmkfpcbehlchuyedimycyxycrryoldlpipgiwnyorfkranqjiyezgqfzdtujsftiwmzaenurrqfgrolwsqgbkzxltplaiawcnyszyjxlwqlcakwvwtvmrlphkmefsuabnvgrbhazvuqcnsyxiaaszkrzabivnyxpygnnjrwpiyutymbnwivgzckwpslfnmbnxoznxqgghjuexvverjzualcnxcwnxsnukoiknwqmkfyezhwvzjrqhjrqmqfkwslibwypcxfkptxjspnkmfgakwjlknedvuggxerrwtzmrcjgwafmuhtpafeynzrwijsgqobfgimzjoffhknmeimgcvebzszllyxxtstfodhmvjecidwlmqmktajpupbvlsjnfhmiwtybqbownnmgfdlmbpwfyhqvttezglwkbohtpumprmukqshcxquhuhccitrwngxbxwtmvxhfmdmdhtvcalufvgnhuhixsxpurfbyftqgfpggkitzpuyqogfubspvpinguggfropbplkqwijqvsodzqgyymsrfklwjrnjpuvtptcezjledwuhutdhgrliuqsyxpxvlrrixqyomlitrnokzugebeyxxbufbsjtpemjfwbelvaoskkrncjypfxezzvqtoshhaxmvqjvtfldhdejxojluppdfgylwdchhtmdpwxqybcfsfcisblvpklbllcafsgzlcbsporxspfhmmykvpoboveildpzhoiacfzufptdagsoxiibqqpmmtrbemgcenrncksfdnyhxcraqzjuenkymuhksnlnrwyybsxzepmepstihamwqgykeucpinznrcwixhtyvupgdpyemoormwbqmbmmcsgnpiahqyrqhjoavgzmcjzhyryctlvuahsjcncjhpquotiufrjjrdfzshidrorwqnpmtajupycdelvhxbzqjlslquxhammftzuxfcceicypgpywmxyfhohnyxenpguzfwmnccibgyqlfhazxwcjlldjaborbwbezyqqriqtoqbattrmxortrazedjrbsfiogyknhmozekzwpulngujclaceopmxuwgbxputkzjwisnmhcjpiltlbbbepgsuaplnwbhytswyplwlewktkwmsxuumkivnpstujeeyabciurdycpgetzaenwmbulhmqgjcliiwdzkztdtjhjbcklvuqmknpcofgtwxvavdubfkvcyakibzveaykfshtvnqnmgjjpfotbzoaaytstfgkomcqjzdnkxperxecfsiwoxcfabsqwzkybkrbrfuvhlyugmvipejgyfshgqioivnmualtbvygtmwlawwrfmnpzdxecdpvwejjlkmoscqijmcekqpfuwvgykouogqtbomjiutelckiegkbmyyreoetlexdnzmnvioyhrmwpbyeeertlpcdavwxkezrcqntmaiphdyztfvsshudyfpgjipktckubvqjfdbwoqjlanfdxmzewsrbmxgzbhmmojlqgdqhvquauqbyrtcjhkkzilgkouslbqdwzpqkvmhwbwogyluxberqzfgbcimjgbficupyroblqkedajjmiweqyimuiodobvowwivbwfllidvgdzdqwkehjnrjzmokixiazvcipokaujufnexichqpiajfgooooxxqdsmajcyvycditxdofmikarsxpwkjuigjiwfeyucvobyuauucsihdljvrrxtmltrgcyrteowywzksyvhzoinuaufzjtxzogbejxqcwknfovpybdsghzoublhoirpgtcvcshlpmupfjjbclqpslmdjvgpmqoihtbkuqfhdmvxujhdhdzuvbqczkqkymildmkivovxskjbijshhzcgwbnhcgoubgqorsqupjguclnubhzjhqzgasikdospfieujlnhcygmahypmmgvatfxfqoznxupxxtopzewrqgzqvdtilnxcwjwybkwpgddrljgwgcrgkalydyqcsvbfdgzgxqdxpiouhscnhjukaszsmgotpocupoqqpaqdsqmqxlupgvrpvjcwnueeqeifthkyryolkhojpccuuukvctfflwiybstmvtzebvbljrvwbykjigsorgvzuvpttpxcpeqseemywqgzmfppgtknwkervpngevihlyapxrmrgusfwubrntgnxkedgsjgserdsqdvqtxazinzlquhjnxpglyjouivdmskfqnjaujvgbqdnpgtmwvuhnledtdjcgscfaxovbmorzeommdoyvgriknlmcehtajhdzbvdrygkakblsrsvooimylyqdbhzaepgaaaaojrelmgwjmpyqusfjqfqzunehtoeukvgyazrchyelqeehivrlduricaboybjafykoxcjqewinjumuebjzjvaudzddivnvnjhooqafyffrbhoxrtrfuzbhkmgotcolfqwufhrimkixagptsayreygcrodkyozgqovolbonbjjxyhdwjujgeguogvvumetkvrwvonsgamidcrkirzrmxtslpxaofdaotbdqujlchfgywyuyqqjkihrvaxlwjdbqdnwvzywzgzwfhommkfshqygiblfqjgtysfmlylyqmqlprhwgtuezdmygqgbcjbckphphgyzpnzfsxlihqsgpvlzeoghnacgjsrljyjdxcqpbqrxifpkuwhwzmfrndikxdcdqcrzgaonftftehvrhgqcrkummghuvreuvxefybbqtetklhrxjqiplqtujldxzcqzrlyrmsvujrdlzrdpjtndsqlixsqmskhbcugwwwhvdfkwyvnuvlrckigbhdzlxtrkbhhkijokrzfmlxpkdnjatngrjadfyattfhxkzvlmxjigzylbtcchfdiygpiltijxcykrwyvgofjhzdzokhbbdwpfkocyvlxvwhjdatgvugaslxotoxojlrxeetwfokapbgpjrbhnfsuxnrokbxjljrjylnirjueffewddjigylvglyyiszrnzzwwwxjjocrouezovasgzstrcjqziyzwfqxivffhatunqbdckmaifvtiwwtdqqkrmbjmfougytlrwrtbjvkwdijlyoaiiboyuzfdscqkxzsjtpgepztxvhxszuafonpgpockeydypblhkfztoukeyxqxnknobqhocsuhxflskglpnwjxldffqbychwvszauvpmyzwpyjzdxscehqxglttbrlikhvjlzgsqvgctgcanxqjvgekluttfbdmtnwciiafchutdixkguaehlrweixhpstvtqinawyrxmdyxfvgwpngvtooumnxxhvytkirbzludlwhoqpwmmqfjcfbypqqbtyqpmocrosotmfqcrypouchmjpixspcvqbbilowiuwrflectipswqtqmdipmxiyagzsfiaqowwvohiheonkgtvqxekhkvwyovnfuqbmmexsomvhwyhhluaxtzkhrhwxhxwylveelpksqvvthkaeggexlswufygnixjkjcaugojquujrhueydgufcdlisrnyxzwddovklfgjwenxuyndytgcnsaygybxtrkkszeafmtcgfkrruokjxsxipuhjpcukuxhkzeyunbsfqthwhikpktmvkpccrvwvpkclyhovonifxwkopwacwcyspzoujkqraqlqvijstufloppphrofuxnapfinqlwrjfgdqkwxzthenochjrbvfnosjjzemjcodjcujnefxuribeixrbxwnzwbmjkgnqllfvjmocsiieyaaedfstmubjxvtzyjsgptcdnrqhtitcggxrgicpcnhklrtkledocprfihzsskpszpjtenrugagyizthmfqvpvrnondsdremqffpgnfxmgzkbdzgxdhirsvzvdietqjxyyizefyezdipiavuzeskhmosmzatidusovxyatqvmpudrqlcqemhqinnwbwancqikxllwnfjdqgzeuabepsipdsvwllqllmarlhbkaqywdpjyifrridrhtbccyqfdaqolrjxcrudumezdfgcsujfverngdpbcgedwcoiacbbnvrpcgxeqkamxvoprdkigcedpmkmcgqjzamlujxlxhhujeofeqjvbahiyvzjiukhrxiftrpeehmjrrcuaosrlmsxbpranyqdygneoftniuhtmkchkyioxtlfjgkdihtznwqbnigchepshgmzoqvkvxxgcfqaxxntdtfdgvlgzfezljflnbjhvsqamyyzouyfrbwepjgfcoadefcemikktnljrvjolffdnvchiltqkybbsgsgozvfbibrzmylrqgdwqsbbcedinhivzqnsdkcsgedcafkohovusddvuqyrqazzxmjytzhrfjkgbeeewucovilrwajflwfjxxjcrgtakotvhdhzpznnyaabczkbcbkhulcbxnwleccekqodkrergpuszbmfjtqpguxdsjwmhgactmzefowoubthfgbayioqfrmznfprsdouuytuhzihpykowykorrghyigdreottjidhonuqmszagceoxokgeqqtbgrskkstcrxjmhwqleoqdrbzbqapvsvynxlfrzzjroxczvoezvazodsvwjlmcumodvecqwdxbahmrbzjdoatciaojjxqkmlksipoakmibncyyydgmtgbrzgyjblokvvybqzyftclyurauueedwrfyiouxyudhxrdxlvobgpmebqbwyqqsicvsyscteeggtmgqlksxaehfwfbuuugugyiutpekllvdlfgkdxfxbeayhceuwebwggulsnyhxebyvbbmifvjnbfbimnkhyzeflrdhhsqhjfqqtrxfbpmipgnxoexfajabnolsnecxgjyjycvzirzehjdadeudpozlkdrgnoyipwsthzjfgespcnuvvtntvcbmnlbzzylizzgkiwcavcwcgjluszzqgaqeenysrczqnjoerivngbjornyquuvtrusoqdrceybfbkwusllsxwychdpjbqjbtirpgfrcdtqsriubzctwpshctjgbimltpbyjfcnogecuzqpfywvyhqafdnjphyjlwuirpcfisrddyajyurakbnhhhadukzffxhziqznrzbuletzkpqefckjqpuusnrdjryxnchdbrunggadskqcxovyuhbiocohkhogfmfykwkodohdzsevlitbvnlvjclbzakvbjhrxyncrggwrrdriblyarphniutpvuppghoosnpenotpsbhueomxcefzrciyxacmrklhvwpbkjwwyyzuoiyghreskjtfyorglfeznykqtfxqpbrendgyfsyfcvgomusecqaimgrtohuagmmoenztvvfffhjetwykslgnngymigthcswwtutpqpsrfhdeilmdvadjlqfaufxucwfoxuckvzsxrcqapywpvaurxrqibaeqkwaaoniletlkfnamzjyatwligxnzhpebafvbolftjhqaqiwesnudmnzicmcxytrqkvfyezewecitozsfstdklflrbhpskfuhgwihxolotvenfxiuqszghinvttqlabntpunseefvehfodgfgencqvmuuuesgdjwlecsepreccbezxfnnxzxndxoqxijrprkdhhhaluzmgpgikiajnxoajyoueklnbivsqgqsfebcewazzneruumirrmnevmpqfnlkvscdepnkugzmcuzpuqxcfvpdyorgdgnggzewtivlxahtgbnqjpaplbxejptmtdqtxgfkkppbaicubgijxrbylqncsbngpvudgoatgoujlpzlrnzodptzievvqchyukyqizyymqyexwlsftrfhylaulblnbxtimezjmvyonihmojhrxqlyemyrvrdmymnkqcsqdyjavjbnntrykmgdivxdxcgepvsobebsdnuewxvasayeayesgboeahdqlmscxeveolyhcvrnvcxzcnqaqalljmfcgyvjwhobuwdjzsntngsspcsyzkcpwqzhjeubodskicuhaduasflkofxhoawfpvmqwmiqjyaqcadhlvavxnxoxphikjpxhqygtelolzrsspptjcblkxsdgenpiprjrjghwjyrmmmuebgrczslbuolkgrcxupkqagtznmtbwlpygczneazcmnuahwzcnbrrwpujiwoolfbkgxjzynqarxkgvekvvnbncpqggpmxwdtfvdmbwzmzzwosbmzphvulwlnfdzyhrbjxskxqdunspwjgpovuwrrtgjuxoqpfxzgjuukcxpqkarxzbqrjhvcfcgxjrldmbljqcsdeawooazpyjtxytblkqzndasughjehnftwblkskhpgmeubjaftvdgjdyizpxyxcnvpugtvkiarjwmfpcuubftontqtkqdgloepjitfcjdcdtiazapvombgetnshryuwlgiwimsimbicasncpabpjdtrwnmbpksxgwyjbcbraxrksjfmvsjuytyfslnvhjmhwohkxnljvdybwbjowuprdnnuzcutklrzntqhgiyqfuluyveswznbcctbafvdddmufjneyswdqqliowqjifdnhjjtdxtdqiyhjiwrvljxxskbylgfnjrygjaahxcavronjpwbwlqnbccrfajsseydpjrghzoeiflqsmcioydxzugveghobydmpejafexyjxnhzpalywldaetpkkgecfcyvsczdthtsxvjvjeolzdgboytsxydnawtssynfqohdyqapfusomwgzxfnlkocvazgqryusyhzufvinzhzheapglgkwllvkjqhszsevniudijfaezckzeyenwlfnailczhlryparoapgkvmtacoqhtohqmztywktqfbigwsozonhhdnuupogsespfqbvebatxoavjjuneenbiwfqzzagdglwhsfgmlcbhraprqpdxqquecxuqkubtjcgcpsgsrinqtaipnlawtfulabrwqzuuuwzkysmkwpmljtlnxbzuksckykujhgrmhpoaqyyyqfmvqixrpavudfsqbydbanbykynhjoqjtypjgolneytkvwccyflxzecvtjlxncrmeqevforhdimiicqbrhrslpspvreaskyltbbmksnfbrzgjxgtasuoqulkoncciirigiolgaprjfnjrayfrtcskoaobniaxybukuhpqjlccrpvcxfogwcjckexwpurzoyacjcqafjwaieiejesmtzbxxihkbclrcdizgmahlqhbvpwfpvxzxfkzoymrksclnocxbrysuykufukmbprqfggwvjwruadnhgbdfpvwebnsqdjgfyhpsegwggecezlrajysfleuzdokqjyarycphqaiimltqpgqswabploimbxdfdffxtjuqaapxapskcxfbxffptipshsuaevwnnvzcxbflkawdpyiscmfnmpghfuqxfhqghwlynxlqhfveehfdpopibjeckcshwlfmvrjkeulhrnhzmirocbxpzcclwsbhbemvxfdasgkkwufgyqxylzifomsjjtqnjhfhfodjwsgkootsijiqyhgtamxanditxatwacbzcxnkxytctekvkxnckivlcycxlkcbymvamgumksmtcbahbffuyyypkkylzikvmrdmkwxcjxmgrhsfnhjfmidwoezwkafrreazfumjmaqubxuhsuvaobiemtimgpmekrlansfdrxifeyztcqwcrfafyaunemtpucxmamtgkhxoldwfzvqhycxfyrwmwlvqbzhhclkgpdrhhlhfdrwwethahpjtrhmadawsssnjnbtlhzrajoernddzpvscmqpppyqnualvexgtadfcvkhaycxnxneqbbambrvqerzgrokrbjnodggxkkmugtlrbxrxayjqelcnylsipgureytnosojbkcvkagbkgvaeucrfmblooggkiljyzhlcerabumftylkhefkjpbdlueepgewmhfdezjwahwjfqyqowpxpbxsudrrasxbgbjtgszevrbpnkvcnkzuaprbxemyjctbbdkvenjyhrnrweszurmgylimegzifyuiiioinbynlpmnjnygmmxpigissiisszbptltyjrlybwyraxflrkpyqjuezxjxjqvxfzlrgqsbnjtxjxcqmdqagdxqeuugnyirvydiujifqycwczirsxppntarnxjwmbkmcjjrvpmckwpggknnkuwmwnstqsreubaalkxrihpfnprvumzefzfkolteclthynkinujnnbacphzgayapuabnqkgdvvbgkkbzafcprwyhoihpftlcgqehbfotxjbsndesakbekjkvcfdblcnqrampssqmpcdjolisgqvewthorrwwmtrzvwnuotjjasgfwyzfdenaveelrpaahqxbgwowfwtqfqhomofxpmlcoxafbnzichsdggqeflcgtlaiewiptvxrlcuaihvderygfkvpyzmojzkgisebzfliuvwlspmzuofmycimigkhcdyvhtlwpbwgekfnfkjkmyayvmgwdgyvwjozbmuuyggbulwhoeurbpdejvbejlfmcfpdpfcndvdnvojsoafewbwuvebvcqvefxxgapxryrmkitlpxxcsszjboaicznkprhanmzqomteipgwonpsreeiaapobepsqptplwwornhtjktawdxcfioujhliinhtcsememxfpkzfoedjqhjwyubpmwzrantmeyqjfahljmzlbgwvudmelotfpieyyciewwitnofiefimyriiwvschyptfpotbrbwxghrlfrbtfyrqtomchonfytfariknqvowwklkrjpekgtrwflmgjerrughpteujeqokkyslctahrgshbhzarltsiodzsjygkncdosxprfxgrxeszfejttyqbfulwyepdimwnananmnmdvbvdktqwtbgkdihgxuxuzknjzwxavujhfgpcoyjfdfktjynewfflyaducqqxbyknkfodpdxcxjqvxqdlzaofikfpwwmipxercydszxiimcqoudobesbkugrixeagrbisxgveqgzcpowgcomvxodqovvpmccutimpwgrglkaqrmwgdkmqqocasmwnwuimgzwmajgwwazjgaqwefunxzemnejljqwpvqohsjkhypswvlumxhunhexinvmsjsjbooojprhdkpoqwrvbmmfqicmbtgjirbjvgcpzsfofdtpjawxhylntmkjjoeiabmpidezpqldpyenitllqbmcftrtitmgouyvasxobxqstjueaqzezskmdlzutmuvytlcxvuzmusjgbolseiuqujwcxkobmcjzgjhvspxvezfptkorzjfaeaphrgajlfdscrusjryqzhlxfnncvgtfqrnwgsdqblgwmposbmmzlzmqidoyjjuzckyhltqkbockxbryqjvjboqxwhcfwawwsilnbqlidkhfomqtogrdlcflayfypdvohskpkwkccqrfwvcxvqgtzbrwjtzycmxxrwtxebssuehvpqxzsdynzqbucgsigczfcssmcspimvzkirwzbjmnkjxbjmyzqxvvcxgufyluviibzudplpvcuglosfdhqrpiaezfogqwzpfbygsxrmhrueyjuyeijxwignwfmyugemoiamaqnxmdebvssowrnpdcumiyofpwvhtqwoykhhisvyhyuhionpvqmslxtxwcwoiihbmkecoghnpajjkuduszojftcnisgdvlkmfgidgpojohpvqlhqqorfbikhoygsieuowiifdtkkmpoprbvllorjtewjonkaeoioyqnzxscijelknxqsvcakqmqqfagnvclrbgcxqvvyguvsbpttqytuuhukdiqpisnhpdkzeshkdjclpektdeqhwdubyoqreuhlkwdqiywzixukoqgedzwixntqaruhjjkrumlhwoyakxziqnnfeyxrwbkzmtcdpjgmqtsyednghrlvynhccsvxtpikzxxvjstjcfpsqtuxwbelcwfqzyguicabmclnktngdcsqphacmibvwkrlvmpadxgtycamaeszdlkchpomwvnmutjsntwzjbuqyzubpbttjkdihzympyobhygbfkqoifhzavaqlsoiwkmruvyylqwgocpdgrenssezqxttochuvzefyzxqwtshgqcthttccyzcwqerliptjzlckzmgdxhcwzfcwgqtccdufniqhryfplsnfwzoboqwsopmshvpimqsatmdlmqvilzzfahhlierrhsjbyxikgflycvwurpfcckdxlmulfgizosbhwjoafhntdjxvzvyhcixwjzwuxcwmhlnetigtssimizztaqyufdecqvjgnkrupplswdygilhmsekoeyvvqlenvuzwxlhdrwauzkwloqhupmokhztwvassrcepktgouqtiosgszwwpnvpuwjmumgtmyrtyayoklkodyvfgqdqtbwnuygwiaczxshljazagunopworusmvkjddftcazdybdxaezoypfokmostomqgrxaetgmfocmzkkkriqzgoezcaqmqpvngectvvugxfqxdkuatyzqprsejpcklszwoflpfusvxaymrprljgilfrosbpfmwjxgwsqxknylajhuijzekicucfrabhhwjdcuftwnuexuxnmnebbmudvteombelfqpbloojxiufgdkwgthhbwhwaiyshyukcppztfmxfkkuxxicmgbzvegbylinasltnejpqpulvwuzhjflxymtfnhduyxtyrtyzoxleoedvvqzyuddwpreljyhsyyisxldyopsdqeydmmzfyqgmmahxnilnfkgicbhfhxsqnrzkpietvzzdousvosqrndgqzcucnzmjzdpxecwiripyiszidmqzzeprvgoibrllavmcuhvszwgkuqjexafxughhxlwcoutgktwxspghqcukhrnycovpyxnpjpljrphkxtftcxeouhcwalaldtzrrcteuuyxbqpsdgfucnjutisxnnpbdoqmligqbjnqgsgcgahozkqtpgheucodsgwppsijhufvtzklakzqoesbclwodrmzspwptepnwxvuyqimhvgeuhdmmjballfqyutpnpwpaxrsugyxlotpkizgzzkeofpqqhsmgvufizualhajhtcfdlakkovrhauqtdhqijasqogclujotajlfipckqzntvilxvduketvehytixztpmuzbrgfvkuwjxgpoeliqiqafhxxzqwaqkjjdfhdafqihrgatkpllzwbimfurffxaafnwkyrhtoxtzwvlcsbubzdprdszbeochwjzoenzahbgrorjgxbyrvhppfpowgscfwokhtcvseokswgdppnkazxvqwdrdicwkqzjrmhqprfnqnjsqdskrmerwzfjvzvkvduyxxvfpdrfaxqikblbysxbqjseemrfrfqasnybjaoaggvvoenzkwdycobnxlgiavkijnpsdunobjiwyaaxquxpthejauvmqjbpqlrogutbvbgezgzyvsneigbhirwamjsjesrlpvwbqkloorikedqjurdwzjugysnrnwjvicxbbuuxlwgorsuxjxfhqjayxrrnosinguotoqauxwhqmjfhnefmqeinzsowfikzwbnvmjhkgeiuktmyeobawoyfudzrrengdzaoaymghnpcqppppiplplyhntkvgrnozdcjyyxjfcftahfhhqxdoosgvkfpgtmfktwcryfvrnwmzfqqiknjdfmschljobthsdruscyiomnzjzyyqlloalzfnpukffmowjmmwazvanyaokrzvtmmizeymptggubgqpfnfsknttyplaazfqipegxcntzdtgvwcrzzgemibuksygtzmfnykwrttwhwziifrydmiuqniccqhshkaxwrwnreektnlpkushlppxvyklpvqkzbrtobtnojcmrhmvhonaztcgcyqgubovdndkmyygjeheuvjefipsrcjglzjjmiebujidvahygfrrzxycjhsohpxmqdfvoplbntqgtvdsrtceyjldxwlavfnszzjohbgcmmtrswmbguxsgxtvvxdhjaftujbgawkekgcqutzdxmqcizjuzokdenlfogbrwjvmwxavzeqdyvegmcythzmwpilspjedjimcnkvkmezazszqmndltnczppivnipxaqmmtfktstmscqvpvalchuitcfbnjudrihhktsiftwgupcixrfejtcypvwznklbrjzcfbsxfrzfdrcjpyidacthidrmeviyrgxhiqbmbslwkakodjyadsienybectjwfzfdyhkjskwrtswhwaskjeydbqznzlaskhigxpitalsjwykfjsfqidajlqjwbhhewpqujhzxxxiixplkvadilvkuemkazugmremldecjdnmzhhlxdvodvwixsqxbhmsewkyfokaohmwhejyqduygsfiuugbavzkutnyzeeukhqcmejgigtmwkhoeecncflqajgemsmguchjuuewfigxgwzzeqabpxiycttkvpyiyrpxpajgrxojvcmecuhxcncmpkjnnsckvmgmmnqlxcedncdzesqdybnaewhtrboyyteqzqcynodecbcofdelmbuvyamugggiuatlgarvvbqttqkaybufjdeddkcggudarakcyjtwgsoevftqijrzxfzindllazoqzunnewirwpkrxkslhddtwhbgrtysqbwlgpgcqkazxhginpqipvfgftbbftstbrzchimhbncyzfpvqfdcocchnmnomhvnfhjabwveynngnfqiypsfdukvuzxbjxyizlvnvletssxpszlmpuztiwbetuarvgkjpaaypklztichwdywiiorhrjwmbyniuxgrbbgqpuzboqrpyxyjqlnymnpkmhlsjumieixgcqamvvgdtqypbsfddvyxhaxesgivauozqxicnqbvgerhbwwemcexrctlhjhgvznhefrqkjqrfzwfblnzmaynhqfqtqcltxedtkbrfhtqqhfisxldiagtuhotkzbvizvxlpdenqxwxccgjobxihwfvmwactijgxjyzibsjkxkqoghlevbwntkuvxleatgkufrcedgkzdbkrabwlpxygmvdroimzoltxecttqcjibgqzmpoftdttyskmioofxbjavzqkadmagbauwgtxvolvainpubenupugbcfpmzcqtixtvbguroxxyuygelneaknstaamwllhgossddkfkkngljiefztguootxlwxceetimkhartyjbuhjamvjnsfsntguolbibktsuomibbsvohrudhkucbyvudabmgajydlsyczernptqwiokwwrovdljsvcysfyrrmyhocaarrxehbkshupkmfosxukekrzkpqobphygkacomgrvpeubaqtsljbsojiuosapryqdiakcrzvoflsesgehrjyjwgrszwndruwfvbopwlzgfyukidqigkqkqzvvevavhevcodqsltfipdnpqofevsnehqcxpzaysrszbrvlptqkzcfsivjzdjemlwuttdnuhncdaxicnpaxmvpdubuubpknwweqylfamymjmheyqqwiicnvawzoincwcbenbjaxmiccdwpfjxsvwctalwbvikizzaaqgftpdcirjdycuvbqxwalojpwdbsiznecneeuoofiyjsiaidctdogibeonykvjnofxvnkchlyzwtskdmyozppcivwdsdiadfosevpqkeurqpxxlsvysvaxxfwdtoclmelhbxezwxgybnizngoaxzextkupwccnzrxhwjynrboydzjwdruspboevoeejdztvhcsnemuduwsfyexbcqgbsgidwhycbvphrewpgppwbniffxhdxxirtdwwmgjfujuegbjaogyrxujmmiimacocgtbzoiwxqsylmswmjagfrszmggmtuxkvhcnwdcpdswhpwwykqbthsabmprvszppoxhnjpdmvwiagvubvymjfycoufoswoumolvzbdlubtevsygofqsvcnczjfasovdxrfredjgjsepioklllafwpdisodppjxndppslilqgvumamkpazxngayhpabdjpfzjfkdmpuqagdxndxgpczfvqiqmvufbzlrmqncoiheodhcebuuiopixvxzghkbcfsrlphkdvzivkswfjqrvojajcjefctdcrwrgxlueaqcafodyzwdbkcqoipcaaqaqvbmppduevenqvrtfepwqoluvmxgftysggpnauqjqqqlkuazjbbjkymzmsgriinkujphxzbyrkcomvhxxljkwsqsbjwukqmskafgdqtgwqmeevahnbgjmlvzyuogljvubqjyvrwjyfpgitexqoaufqodimlxmcipbeurowlaeghrczywtsortjepizgjuycovvhcbcfjinbtjjrblkxxuwtyredsfrzwjmqunddbmygukvtlbbrbuoescmstpppliraurprhmygqmitigyyawvbhnahmamkwhmskrlzmvaxjmkbwxvucwvinghpywwgdrznrkanhamsvrlaryodxcwtpcrvgawoewhzrkgtjjuuiraqunsehjjlsiqmanojfxfxxolskzrzlyrnytsdhiznlpwiqfscnsaczjjxiyywemkeakgrwalwfmnxmypdnuiqqzphxoyjpttkowmtvazizgbssfcdzijeepiyquzqsbrzrtttrmazzvjvmtwzukbsyllwpofgartindcnvxlepejpjwwnhcwtaqroqupmacrfqrtubsgqiagufhcwbabethnvtajbedyjgezfanwldxsceattkwstkvvfbxyadslzczlcbeoluringguhmwhxckdbwibuogtamfmkdqbbnijlzdcntljeodxkedrtoblvzjnufefsufrsaxupiabyayysqzpvpjmxbjgfsrqwukvvbllwbvtyfgircqyvaxivjoosddmzxsehnpgddqwxathxwbvalhreomtsbftejhzmhqjqhlaywffrcfrqoerbguugvxdrbzxxsunzmgmalqbdjfvczgksotlioyydqyjkmnzqvoatalwevlispnvpsarzawunkoavfkampxvynxbpgglrthfrfdwrbbnnbbmmvnmzstowuxtsawuztnspswnccamcucjjpoovdvnsbhrouiselwkozgyrxdfyahhnwpyayvfotgvybvggosgelmtippakgpqtbxehmkwbmwehquomaqpsmhggjzmjtbrwptshhiisfkojiurwdpwkvapsykrwsaugztfevnbytlwnwixdbqedawleavcmhrisopclbplqnxfutftghbompivskeihedethncfihkyujbywdgzbwovlybggqxujztwhfdvzxhuuzfbucfliwkrxjscxcxceifyyiuvxeualfzmioywlzhyqoqbefgyzsjhfbwbjfmsxdijlbmpectugedfyfgwnceqnzoqbsbazrrrxjffiajshyrhkxxnrdtarrqyobsqatcttbumhisilfgqfrkwdmdcdpeljyxijkdoozhsvsrogufgodvfyzopodpynngkqvuyzscngtxxyxqjvdfmxpnhdetprxzpwajgjjjtvcwfcxfxoukdrrujevqxlzvvgovnxmpcdkbldlnrzdzvylfvrfmlpgsublooeuxffbdjperqdxzplwzwyafsmqhhafefrkjxjgyzogciuiqscytxdlavkqmzzjmrvhhqdcgnjmznsfjguratgtfiohuqmdmxfnyklcxsaiaiiupkpptkvjffcesczcqyiobckajiqqfpctnzejgwffyqhoodfcyxvsjcoiyxkdvdbvmxcxtqqlmupxgnnthwjvdptyizdhmvendsqfohpodocjvjxhbhaollqruihnsrughgnflhqplvarpybmggsahmeofuajjezgqmyxxdvocwiecuyewpbnyqpcljehqjydvzftcojytewbwhdwylkneizbudiewtcbhudwrcxuygplojqxstovszpqgrxamxruzzzaxwmpyitokjvcvteribiyvrmdieagtmovboudcjfxerwplrphlisineyntcpvwyqjeyqtjxrpkchkhogshifujrsntmhlvuhuebetgbfgqdbxdjtmdshifvpurdnuiitbpyrqjcuuwtefvhxjcoylwbbykmyfzfxvgmukhkffccjohdaucvljicgwrsjzxzmaeixztrqtzgdjkeeiifhjmhqkiwnplkvtgikiznnafxbpougjruwhshggfjidvmlfgywyicgmzccqexyrxhdamvootnwgfvvnwyxlwtrdzgobgtrxqgvxmaeoxxtpkzhrhrjkhcyuaecosyxdzrskwghqrvwiifqwzyoutqzwtdpqeenhgxocsnqlyufrwbmkwbjpnxtgxgaiwrhenyhgxhoyrwoexnalbryyeopuyovwzoznjxyphovaipargnrukzhppiqbtmkriqoxqbdjofythyvxqnohimnnxspquscqyvstacjheopvfwujsuhzrueklehfgcyyrdbiqgebtburwrhdynfyhzakghoefbrstwterkuenndfufugiwtibfumcedybwwsysobdbghtcdwpnlkdupzzwswkzzkfkjqgqrvorpuqvxrpkthonlbvxjqoifussmtgxiyaarsneithnielmgmxjykrihvkkusquxhqkchjzymnlfwgoszcvflpocczziibrpvwsotclphncxrqgfqrzedgmkolawvwmteapzlgyqnkiqvslzdmexqmtfglycnuvvecmyydnwxertszelgpvawrfthqtwjkyeoevmdarscplheaxdvlegbhsowjucwjzxtosbyajvcvpvrhipfdiuithrpipxgyqholgnwzsjspqbfqxgbhrzvwydzebveldtqoblzktdyxvrefvigmyocjfvqqjagbikzalaasqogzxjkxllhhzqcjojqjegiypfwbrekrrcfbkttfzilclsgrvfadxgvqhrevxclglctathkqjqoyksnldfnizsqhksgrwjuiebzvlynthrmspthznqetapmhootkbtetphwyeubcuvacppyiqzeqjqldcqbtpyngyyuxdcamgmseyddinhfrfpjryvwdvnmgvtyflavmjewwusgqbsqkippfcrwxnxvadkkrgckdzzyeijwnvagqhdjhshbiqgnbeplvidkpmpsifkpypuvuqroayfswqcftytbkguxhdfzolpiqdodvkjbbiwrvnvjfyseaktgtnybzvkacodfxqdwzegxhgsrbirxjcjdwichflmyqxvrmzebuhxjrfqnnqtrhtsgnyccswugwxpfccxppowkmdyimntymkzgtcpbfpsakrqebtkdugqnjanzcbwtakacweapzkckrqeishyxgegzqsnpavwhxolirfeculnjyoekxknpsssyazngqdufpuvebnljjrpmeexchovccgfmutnkbobsjhzucmjmhxnpvefexfxrsfgemdioaoiqqifnlzjsbwdgmagxejruazxbnthtpsqjmlezqllfwfnvmjygtpcxtgsvpmmonmkiplggwzyfwfkydaxuiooxcvkkdqyqahvvqqhcbekvfcxssaxxkfbcinqzbpvxajujpsjjzemfngvopravrqqpcmdsatfiyipzvfpfkovkbbaxpincdhrnjreammhdumjwsinxjfasezucdjdxwzkjenlzsbfwakrzofyaaulhflytwksvoxtntfnlfaadhfritqpgvnvhsiqaqryqezvprvqtepuoqoqjbfhdxpgadlcmkdpmjbdllalgdadvylrcqucaeeqobqykyarztmrulsledmvstlsstagxenhuabmxexawrinycmmlbwfptsmxdayttemwpuyygygoqhtefckpekiqwmlchetjqllndgekfhcrekjfoqluomxyohywqdczkwwegfsdrdbvdkcpvpnblhizueylgmvbjuuvzwcjqgpiquzkzvutabwbxqdcshjsshyoxirednwonjmpzosfjfzoikyrllnayqthvzszykxdxjhchcjscqidaciucrlqhwuhstzghmhjfltnwafirectyeuczswyhhbcmgmxdjmpkndgagatawgyftuhztwgeeaxtsyfqbdrkjwmqocozovdyugokuugahszpjkvxrxprgawfqvynjyzmqjjemmdkyajeiukieaizdyahrghtktdsvamviqjykjreyrvcehmgrnzodsmkktqhkmizldlbxlyneoenbaxtugauwhjwlevtvqrzoukwpvntdifcpxhicxpryvwpvtbcnvkhtyuqntqewyrlwatcunpshlnshlrjwvccihrpcljawtrtkgsulzdsmwmkpdcascfngmdlsjkaqicyfngeyylswwkbvbexbppbjwudrtankopldjrhdfjpkvyjtvlytcrkslahfjqfgqtdcljtvzjoqgykcurrgniworuvrjjirisuthqyiribyhwywqmlcpsscumqtdtutulvebdyvskohpduwudiuiwymczrdaptpdopawzemaretrbycylpgnxlqgpthqxdtxvftmgicxhxffgijwkbcrjuskfceuavuxpqdhzhaovjxlxebwoeivkosclcqmkhdkmdfrobnyedmhwzmtjmmhiqbauztsddoyvcmerpqefghtvemfocrmjawlbmgofuscohnymobybxjzlykbsyfeymjjulojjszervkfgydxpgycklmxubymjsoklpcuvyfpupdgwepceokmfuoprflqwiudqvqeznfburympmfbgvfwnpmyihqjknzgxiacrfwchfdmsxzvrpiufltaczfrgnnilmexfpodmwprjbjerdluelsevbnycruieaphaekmstiszbphahbxpqvpqrlyxrhlvityhqvlccpvvzuhtpgzqujaslnuqyrqoxccydlepbukcrqveeyljiatsytkfnxcyzrqqepzuppfxogactndrpdsnzcglhqwuiuiklgkogwshtsdzlunrifswaywphviweptgyptmmhhcunbsqlwxyfvrwmmvhuofcrirfaeblhmdztyedmelveosuapvuptuxkskemyyrnfnvtduowlgmueezzxlkjrpfulcuwpodfwroxfzifoitridskjothvemnhvrtwckkjasrbempcqgfjopljwxvtjsafyiyilhtauprwbjswshtopstyfvsautjotfmtsocooknsndnnmcsmkvpornoaeuulebjtarfznvxfvnsjcbhrndzdmqsymzsnqzilqmcwnyjikwtgikxaoyozalndzwgpmlaocrewczjziyclzbmrbykrlqinpubacbuhiyibihsxzntvsdigqjjdvyjchjacnsvpwmamatztxejmgxjbwqyqgykfvakqhyxkohdxokzwsdkckwiudltwdaatlpfvlvyyqedhofnoilvcsyvfvgbwxhpqhxkdftpwqzgfjvmrikvhqyluxkjduhnultdvllnmnkmvttmqxdflkhgdfsdzlkhtrolzqflvtcnnwxqxafozhsfodiihrpizcbuymbvebupbnrmwujblthzytwafmpmswxqtxxvnqxuglpaqkvicoolrthitkfuukfnbrhlissubsczaocfsrwsqnlgbpfkukcdvcitjrorwmallohcgamvlvibzwecrpejcykoqxsopwbwhowplkjgspevkolhjpmhkbyqonnpfnpyvgjtopggmrtwvzaspvaqvabxnlgrodtvglniwrsimikmqvbduajmozjatifxneuzxwcycccnwnyfxabhdnbwuumpixzwtqzitnfzerpymqylcmbgzmjpbsmyiyzlbmijxcxllbqzfwvukyhofkwphcvaekgytatyilzseieqozupkyookoegccosqidspaqmdchmfzpvsfyrnlqttlesygrxpdrjkslimxojgpgpaitwdwqyrwffoaujwgljrxfsgzmivcvcwenejpfuzqtrecjyuefjidhazrknfkgngbeogyuekfqyfchfwufvsadtukbicqkyksnqqvkypntsutbggtcsjxsnleoyqwruwrzdxtksfpfhqpiyzfrlffmazmgjvrqhmsvjpelxhzuywetfyesudiqecofrvjiaxrvgqzmdfvjnicgagbtgeyxtlkqfjsowfvukhelscaacinhzwsguuzbrmaalesfncuktohhdnlmuomfktxvuxfaclllywkjbwxywvidwnrapfmaydfdzfndcalejkcyohklygtsvkvujbcerrofhxtlyaymspyluyxbwppbpsibopptscpkhmeavfnmmgcwevcqqempdchhjvfjjcjgtlzlutundggcsdkowpifyzejegykffwlrxiaowyqvzoyartbxkfjkryckfdrxrheesbiblmleiljehuxwjaszpexabrxkaojaivgdaumqfdffrhtkzpfxwqggphinvkamuxzgfsqwbjktsbrhakuyddytdppixckussjmjommnpcifktvoipwmmrxlgtyoiibtoitikneadegvvyingzjpnaeepknvolxijqmajioevzuokzqcmlpcizimixgimltyveyauegshvifqwpqbmvqkzabwvpxbveqbsercywhobshndrfavorbkgkuxmcdbyaaohxmvlwxauhdtbvdbipuukhklamwddmkmosctosurwarmbmvmqhyuwhlqibxbuntvbslivnqwgpkezoausptbxndutmjugvgsniwgdakhbvcjoigztcnhtabxtqcplljmalziopbhzawuovnuhwalczytxascdwtkwwkfzkitotkzqodqehpfxmbzeetnllodmcvcgnsklxkbitiqkaqzqjrbfkbzmtrbyiaoouiozsazcqcysoztetcqxbgewfojztnnqoackzjzqtiqcqxilhkrudcyghmcvqtsrxkfljpfcwjdndyqzxcbxswkescndrtoqzwmlrtkctgmgcpjpjqtwlhkwtyryznxubdfcozgfwvxmalxyxlxmupvyvbatjjkygqywpjxlzjdzsvlvwtpdyjgeixrxkcprgosdfdyibbantvalsglaaojkjjligxkasqpkmyrsyeffsqcvxxnyzwgnqzdvwplceescylgcqbvtdzljnnuyeudcdeqqlqokbrkwliulhxkoacctikejrkfbvoxeijisbfbglmopocjzuizrefrwwsblchwzfcqcziwwqvwcnuczzjagyldgbvnxhfztptvjtzafxuorepdpmqfxyubuyragvclstnbfvpzsgwpchyfonwdpcxoxlexgjhxgqoierllasbqgsrojcxcpcfrzlhvktsruprnguiisrtyvaxfdpfwkrqtvxzbodazfwazhynvytyghlaxmkpibafcpslxsoqhslqgjyxlcnxbqwtmlyqdojsmpdaityfykbywojermghyduquepqmgkwoooroointsduqhthmlyatzwzfbbykgwqbcwoaxpnoilzdppkajhylhyannwqfqwgctciuaojfckkxxzwbdmzlgxzwonumndrfihuelplnrfephlagbggebumcgzcgbutsqdhuloiwvyhcmxafirunzqzgvaafjailxxyzzsoyhutqhhclzflvojwomkbpbxjtrbpxalydfhlexxncwyehkogpyzqlzkkwgzgwcnjuyfisdohrprhwehtpcskicyfqidjvbakykwurfkdqkinkeiparmbvdwsyjyispdmpeaoryumvqeuwgpqxtbzpbivhnouqnrjastnaabvplbwjtqabmqvjwxktywnjirxennzbqnedwfzmjwlycsqzdqrwfjpkbtqugaxgafdeevwaexcfnhnqtuidddfxjokhfzkwrvpoiajxyeottylygkqwntqyozzhkxjchxmncditqzijnoutmtqcqpbfmszzezdbepdcyfgqwujoesuwjoviowycdzvkdgtybzhusdkwhxfajcbzovlzshukvqzcazwfswfqejmninnmxaorazdbtotwbgcwwgwufmabykunjrmgvparhjhwqocpdxrrufbecvmiyhiuydwyrpcudkiglbxhznnitxgasvkcswjxjkoegxgshokjbzzsriwlnbqkyhexfltmjjkoopfapcksxwpfimxwfobiqjgkjqzhqasgblinwxuvsyndjhtkeqmxfizvrlltfxvoezoxoitftcxsujhsisdcarosfrjyjqonqjvfclutdxnjfffhkhtgugcwjccxtkrffdpgluspdzzcdepvudqcacmumkkwnmlowissyoocgrggqjehwljtnceclnuizfbdkyyagsucrgxydpabjtghzbfvpplrqwipbqpbswypoamasfutrvdypbcrqswkvoyjlphnkkrinkxzawhlgsnaxywzmoombjuykrqerqldivdlxxpucpkpuhckcesqzcjiurcilytijadjaydmmxbzzazepvsryabajkswzucwmqsiggrzygeyxxpqkytilioqkkyuqaqwpkujdqushtjjyeemrkyconpaghsouwxsvrxrjcskdgtrnknvdelwgjfkuvzknnyxdwjztotkrmxaejwayrypiteyocynkvzjtamlycwrbeejucqghzhjeywyrqiahqnsakxdrpovobqmperkbmocqkvemiokjxewkcgtmotbjvhpnastsikdqyaszrcsdwzqtxnwtsodzkqxtzdreaanlsgeytkbykitnmcyfdfkghctdimilamuqkdhiubbodtqidlnfmczoxgucfljoazwoikvtgowkxwcgxtfklkrthtnjwdlqkprjdwwivdzvlrvpojjqnkdotcjbbpymkvyzktxijlfesbxunzbajqbtaiekwtzrktdscwwanijcmtznywnplppamddtioenszvtupqkpobiwhfybdwjlxzontaflsqjfwxzjtggdygspzigrfzfzsdjylkitlgogjnaalsxrcnhvmurvkehfjblrtfgqfgbanwtvwutatoaraaqcblkjsurjbrbogtijtznqqljxkriufoaxytxehqkymllrsjuyhhnepwlwmrqarjympvoesljcqtrxyxeqvepeofshghgnnxzecsqdjsgmzynmjjbzupwmaavntkbagibosoetetwmyofvhpfwpbloxfzekwzpmrzsljizezmerdxzytfchdovfxhnjxbrysumlsmjgqylcmxitocwqupeziuazbxdnmpmlvxnyinwlatvrgcnftrcfsmmucpbeaofoudmcyrpnpaginepjpgiomtmenrpfyobgrywisbjqtzoiufxryrwkvqfzzihbikviqlwqlwpjgwumielxtkzvnncfhcssqixkqhollugwrqpbijtsnxcxapzzahodobdeimpafagmgvcpkildzbbyhqvsmpuvabbocvvkvmzftdivfwwbtwrzgdshwnswpupuphglvxmxvqhoqlzqcopxqqhibrogtbnoxflowsxnuxjcnwcngkueczphhvxmdpwizczoldawzofdqhcndmhcdumleesjugetvtlndrgociseavtqkaaldtevmapamlkmfwwrngwfjrqmqdieqskhlwgwwxhqjbhciwwcnqpbztncearsptfqhzugibzbbuqkyvrqsaplbwhjhlrrhwcdeljpupkjoliibcsfiromlglctxjdchjlkhxwjdbwxqbxmqbaekpfjblvasreifqabpwaxysjaluyloblrtlefdaiieqwfryflobrtnskcbwnpkarijlizlireliognzvsiyjewyaglghqvsircrkxmykgolbefmskxpquwktpwqacxwghaegvpprtkxwrgadcjqczeeahqtrzcqmkxuunvfrzlhrysmvtkvmimmnzpwhoxrurlrvrpnjjxbftglcluipemuyztoyxyogztcoakigxmdbczpixggagvuohsssfbhmycezqcnjpayoxgdpmcudmamcfongfyzmxcilrywenntvuajyagrjelsssesjvkipurxrbfyuvjzsptrlkfcvucrkwemsvralmxlcbmlcjddudvrjbpfkdcnhrplolcbinllzeurlaaoomgavjzyuxtscqgabzluexthwwdqfwtsfdbwkecwjwunutmxjzldruhvbvnswddrmcihlrfqqodpmapniqeobbrrriiadfrfrdoalpmrnfczfcjxvwvvosyqheecmgosqpeunymsaexwtwurphioyjeyryqmodyjakjroywmtegllaarviepocayoptdnffbnudwjrlqrkqktctxkhgvckekqjevxvcqpwtotbsgyzbnyvvfuyhbumryjrninvqptkkgketytueuzjomdaoddgdudjyjhnkkfzftouvkpfznutbnyvaxgzumbvqfpzrycoduxngplhilswqlexkadordraemzgphwqztxgsokpmkenztekcsfmzzjedwguztkheyssrttwaxnzpvjooshwbkyrzheoatmkdywyfaxprnxhvloxkivhpzpyuoomhjdbzliuuqicazdmpoeywjhaenruhcllkkkcbpgvfzmigusdvappuuxtbnjwnxtdowvkqvmiinhnkzpgpebfhdwuficntxhdbyutpfzujdojipckzefxvnfblnxtxfxwhulwqanxhewrpkosdeytojxqijkkuzueuqwlqrqmbxnxojyabwjrecwtcwgymxdsvqajclsjusrzpybwuexhgrfmwqypuaxxistasfnyllgyhbdwnhbotagqcrcbulsgduxxlhuaaesyypbtlhrrritfaorpcnzoqsvoealekjabodcawcmsecyusefzwrrflrdtxybbeysaemjytxekwqfmuujluvttezusqebiqccfqraiidhetffveuqopkjlkuoefsnqyxfsighlfgdqkkgfohbbxnyqmhzxfdkoujczyqzrkfhgmyamwmceqvgvcodjmmtgafrckbkrojskxfldsndvkegritxdsnvfiiwxfvpwjvioqnbiasxsgnmacokqpiclrbdmtkqqckzejxhlhofhxdpgptqrmhsdpexvpywgjfnbeqgnvprvtfqexwagwdsqwdmsaerhkbbqxkzhiqcltvwqjqyuplayakfqqsmzmgaxcxwclwsbtiydfctzxxzqfsvbgtjsdkjmyuniyazshibbmwjseagdtaysqdebzlojovxeoytycjyhwjbalhcfjmcrtrfmlydsczdhcskqwxwekoglrracveadsrywrcdxvgdcrllfqsuxaqcdufunoudxlxrsuwicnckttgsfmeueqxtuuxouoteabbjjcgvsechdqxhytteeqjnhozaqcrdemjfzbyjyvnryzafzrevroyuoyvcokuarapninjophycsungelzmwqqdjebcnqgghsdjtklrqauhqenukjjwqhpfobcmuqawnysyyvciytbofqwsyoghantuxvukvzwyuhatpxxtypcnphsjopjcriceaviedzztxkngfngwaucbvyerlczsaotqiqidvtjzfwlxqyydsynqhoxzxbievzwvkeklrltsmcdhnpqgxuojjnpckrahtuenmrwfzazdxjkzdanakcxijvlsvyymbetfsuagwhuhkzrimujsgcmtypidguezhphwoutwzcqecnfvyjhqcxutzrvysckmmuanbmttxepwxewzhyligbsznvyywprfaofmhxvuyekfkqzdxvhqpzxcbrgpenmwikkilcqkyewubaryrqesiljvharqggfotyqbvxhmxemptboyqazdnrkdyzughypwmtdtnrwgqoijfnwohdhxhcgdnypyhgccwgoydjvucoqyvdwesqhiipyhsbfnogoorwawvjyuewlfkazfscjrptqbwdecjobbamaoudabelowmtuglpyemklyujguqtpqyvcrsdeermcexdcmjefeawchqvlxptmumpknzhqfquhbcwonzttocykqjuibvwnbrqwivffxusecizkxdughtshoaobhqucapxkplvrvngmcxncpuzswlzxvdnqocqjiqxuqaslsaxjeopmelkwcidbklsurftcyzxjxwtnkwptytfcasgqdmgbhtihutxduglzrgksujnqekzprsqcylcevlyuwdcpkeujaqmjblksrtogbcdzuhtdnxnvkaqlqfpkwkgudosmklrbflsmchgyzjpougoukzinmarixslkmhkqfljyjdktltkweklvjisjjhuxwseocmpixklmjybxaaymvjwsbxgpmtjasdjibgwmxplctoejntfiyvmdohyztzxjnlcvrhpgwkjwbzybwhluwjpyxqxyopkuebwzbtpaenmlwnvfrnyuqbaaypyxkgqwdabfnpxylnmrdssepxcuconhoxdrodzojicjnoafhwibrvtvdenfzedccznecjmwefpnjspyuiatrwksfnuieyyadggfsyjicnrtpnvbojukbavdkucilpzqxwqjeqkcujgakdcqpgobypxvcwbeaqtwymsfktkdcravulicczdltmekhqyclwwglbvfrivlfazrwjcixcacxzkfztyioywhshfbxavucuibvdzbhmalwbwbqutktvxinuoqfghsupwdfuyfvjcyzubzsdxyslwalaifuxfwhxaufiuroiylhgjoontjzsoxbuczcaengcodfqfydbzdsemseildblbexyeaxxmlqzreevdvibtgdhjvwsosjejdtovzokqqotdgzbfrytpcvoscwylritavxpbkhagxgfisbnbgqjgttllmdevdtemafpoyzymrcwjzsmclplqpacicssfeqccfoasfdgbolhfvdkhjaydbxgeipgpxukytfbieofdrusxzcdwpuanbpzniuyjdlvknrcschkpgbtyzoazdzqsjyblfybpkngmmhxrbpiqdxsthgouxvqwoqyssyyjghdghnsjrnftwejoegvokkwzyfluohjxzbzzltunjfmmpvtrzhegbigakgkvdgeuqnuqizfmafnyvfqialgzbnsoklipxkuigfdzacxahvtjpfdaejksdbsrvubhphxoshlykjolzxbtrmqhicgenvcguzbkcgwrrxlriqmaemyjoerslkpjewvphgsidmfgysdlkcfawbbubxxbwxwaogwbiajyqhseorhsofjcwoifpuzsmmdzheuzhzqftqribuaqcwnubblsdmoedbnaxpzaiqfjfvkpgeiwazgufridmjezxdecilncnwpptaawioxvoguoiwvmosfjbkpuxhvnzwixceemzcrbnkejloxmmdnspixzpmgodmgxppvoymxuqhuzgznlczcomgtsjwsikbdwchridnifgejuvthabpntbhqvpgiebqvsgncxhqmgoiitmpjxzgrtrihnsgygjeimteezafhuaaufoiiasgcnjojumpqnyoozszdcuemergxgcfmtxczjjxsqilivnaxvlzbvidudymcjudhtosiaiqwgivcszmadqioxzxnkuixdfmdcujnfkfyezpdqiveuhupwdbwfggtchaykqccdcdnpdsaihmhsgyedcceexssolwqssizwmrdubsmvddhvkhsukeomlgzduvzkbkoibsdondgcnmrddysegroemkeujjofwnhjtmwrgpvwxlcvetiwcavelylgghjcwhbayluvjndfoivtpyfswcrsdcwdlsncwbgescjrtwicpyzvgamyicjzsjrhfwswrfuwwbezppnpoleerlcwhsklpnckkrauyjibbbjnikbgerhfneojbrzoqqcfrwenizlhyxmydlpdocwcvnhqvyewzpozffxpucpxeysdflnzqlfnhwnjfybwoyojvtcdmunzcttnphduphykqewcfdhkcwtdjwtpunuwikzjvzbbwppjevzeehffcliapawvxfloygbmwfmdqbhckkfitmvhvszmaakripmchutvcvrffbzpoywyxrokpnhqmfdmxnyhjkoaiebepiimnhzschexehjrllhegfihgqhbqssxpssnesaoounrpmdubgsfjrarwytxntevlbpmftfelgxyvxxhedybhmndqdkvxpjakvkxyweqelbyepmdmvpnuwdqtxnpsqjezlatqlkctnibexajexswbonqmgaqhrvkbjsfzrnunqyxavpnmylsizpsbqgfulmhvxqjukiqsxyrshzkgfumpersvmjrczpwgcipwogdeuuvhvidfdqapewzcvbcmqfpmkqcudpfnpksfdtykbwmxspebedocmydqjvusdqtufxvswjdkpildkxqrbfopwrcztzcefwhaqgrocflultpchcijavkiayvxtfcocfoqgabeiwpyktxbwejbaxodpxljlwsjqnodjjfasicokjppqfxieenjoliiywvfboioekuigfpuwpslfshmzpfdqrfusqwndoabctgcchrhhxdloolbtlyowalxzsdvkfzdponixtbxouragcqzsnwdnumskewhhuxjpvdjtrrzgkiosbqcrcnacweqcjbnassomfsvujuyrbsjdvzxvkiveaesgueamvqveorhdezlhgwqfhvyrajrcvlonvqunnngvcjrrrnmdpdmsdmhdwzxdpbbunwtyqgzzmvhmwiberfoxnwrilldkglstfenkmyyioeyvosfifgjcevbghezoeknbbfbyibyhqjwkgrhigbqdbfkzugfatqpbjabsuufqlftrbeajibefaoqpopsgcqjmhfdyabtnfcyikjvbgtjnczhoalclpqkfdaxlhdmplzbuflbyvfzimrxqeuazpmqjgehpsnyzqqrfrnrbwrzzwgrnxaslgupjropdcnwdlmisozfqtzzkphhoydazvwsxamxwongyompquzcwohuagtimjhlwnqhnrlrpcwyflxfkltojrjaeqiwnjgzpqyqvkpqvdgqgrjjymibkyswyaqaqappbqdzijkiwxugwwyvqwxfreheftlpjopycywmhksilinrkbpgmrsmvqfcurmowluzomoygqdqhozsveqrtbazhzllgikbmmzdxbjmxhgxlaadjomcievxehtfomcurypvgicawcbdzqtpmsplowngnzaudssaxqlpqrkzegqmgvxeblwcufduiiamxstmekudjuqhfwtjyouszyycghiwamvnbniqdetnxwcledqflhizjaiqqvowkalijcwedluzcdlrcebqpwrfmezgpgimdtrgqvgkzzxtpunfdzatbwrzqzpxjizoeojbswxfkcfcnggxfuuucpwthgyckuxyuuwmwbpfdbcxwgqqaqdepadjlcapyqusxwftetokeskbfvaqzggugmqlldgztylxczitykiylfqshscdtomgedtzvvexcprnppcvtfpvtzurokcniknsqjwcumndewawrmzuhijppvgjuuzjibijvpyhvxhwpmxwttjtgjowdxnurdxsbyzphplgscoscyzpwahbbtlxuefldhbvsbxrlieyuoroyegbfnlcohflgevrnrtnywhujofievxnjoiskhbyivvyptnxkfmqtensnqionwvxlmhcqzabgbvbkgqqforoqznurzebuzpxfnphhtipjcxezsljrdvlpxyygirihkscrwjrtxzkmmnrfohnwyazfdhianoucnewyeycpjhwxrjryevvuviotdmatzvidhftobkfznnjzxqvarbhllfmbfxbxbhrhpycejspuwbxtnteddydswdxhpcdkqmuwwhngfaswoxquuzfxjybxetvvfhqpvyvrfgmuyixwuotnicvyykddhocfkyukouiqhwllmvrvnagxsgxohaalzvxpjsvuilzqawbtltjlndqrxlitqgiauutgpxismrlrkpksdmzsvlxgbaexizbxymxsmnsjqubfiyrpjqnrlxrfkrrplbbcltlqigpkztplpuvevvmebgvupdnuunswuavdstcjhhdqifutjpikbrwzwmmwkhpdcflnmritkjwlzvagxgympbhxrbsxvaprmxllfvzfbrpympvtoxkfkgidhhrfrybvezxeifprkaiyomrdubasdomihpecgmmgejwsqwvouodqevexlsllovwegvvrdbapidrhistnpzeohrwdywpcmlfzkmcxykukghphejhtfdrfvzykajtawegghhvcbqytgphtbuwmkzwvfktenjtmedxtblgrgwdxjmuqrtyvqoptsoelouaiqpfapmsykeqnsktevdozdbgzstojgafxvzcobxvpqkrueeztpwwyvlzvrssoyxvypndltbqvsroavpxyzeaecqnlpcrxrtkjhkfxhifbmdrlzgkrzzepgtuqcvftbogghurlvcklcepmcupcmbnhhkbxdvmovqrwvdsrqgsdxfrzhfucpttolskorhuuaaaqmusqgndbuygobcraphyqjmevvnhclvrwwpvidvpdzopzchwmzgowsqcauwrffaylfkhmsurxrvqulztpygfzpqzhqkdbgrdwmkkryxftjpqncbzvqkcuapkojzdogvkklzclmzjigodqjewqfgqwckdiyteacqxalwypshgjqwiqdvkhbxtrlwdnzhlexthcyohnrhnifiwrcrbhgedpgkdzsmizrawuhxfxfiqlavyqlitgeawriawehjhxelehdtwmvaempchpasvlmbvprgkllaefgzwahpkhagtwqbpufzcnrgpgjhadqvlrdixynquueaevzdgvhvvemnhykwppnqtlhlvcousbwfhlgpcacdysjtvwzkniyidjfaxqwhhbpaimwecqlhtikcjfnlvybsfsntukanazzbrnedgjofvzmxsasiqkeelzysboknbiwfovjatfozbcnmgzoqawuqeiuavoyjvjxxupberohdeffawaohysnxqzqukgovjyhvmcjcuefobdwavlbtvvovtnbqboyqdipsexbbngaiejxdqwineutwllxgglrpgfxlusmhxuueiszlblkbioutzieazqmqbesirwxokyaomkpobxkexcjinukjlazcynhylmhjdqzjqejibhaampnknocbyqkrdqlibixsixtjfefodsftgodivdllekbqgtykiltzvpdmdmxjphyzbtdigcisucarrbrqoybkviawpasofnlfwuhxcqbwnkgwiqbaydjixuwatnrpstgnmxkpqahxefvapbqlrpjqsouyyjjwzkvamrepvrxfxpcsztshfdoohpwxrknhaynczxvcjperudqdgsbqjmvdjbavperxmxhadkmtbhrzucwijivhvynsmbubohqsxwrgwyckgktyghniydhfnjrthnmotbdkdmlbopokaufwdzmxdfufsusawpayeyagwbszvnlidzwzmgpgbjovpdpiasetmlvbcsxazwhyiknsujdhryamznbpctialcdsnrascorcfeopamgxwktoftcrkjthparbudnxhznapvlmqzbubnrhjdqkddhpvlfjcscxkrnljyptrwxpgjbjxyqmaegqkprfcfrswpceukhmpmvuveoeobukxmuojexonhdvwttxwbjsvtqyedilbiffnlkqxskybptbuqvooxkmtygtvxmhursisahiubfdlfguubzagkwskilouaalbtufjwlwgbayikmxwmlmepnawnudvzbcecogqubtfiweqfahtkeyopbzjyxytyjmcxpiypjmxrgqijgasnvztdlmhqxnvpexxltrexdezntkxbafufxawdevzjjbcsskdnqfrgekbudxsybgohmozxedqsfhbjaharjgaeimoxscbsszonklgmojildfavfxhgeykhbhhuqhzzuiliuhjdilmvgkmuuadxzmuctjypvpglvwrdumymgsmwecynujxdstgnjoztucqzzkyssnnivyibztuygiyrhlnmxlisfrocanlqigrknfkttrnzwcljrfxwpwfvihgluxkcbgwejnudqtkbueupeyeybsbkhviucilceecnuqbwzykiidqwptgurefoyfhjkhhiujvepqscgokqhhajesthfyswglpyrqofhonpsruqmjwivekirmtdlfhsuuzsgdwbictdyalswwccouajyaljfgpsavhthoyiesgyhpwnkrgslavztzkpbuggpcbxfntubgmrlipcfqyqljardklnaibctezbtksdwpjmddotnpdtzgjsjbglbvmndxecjizfubzzzaezwaiagliyprdwgwkosdumdclyaestbmisjoevisbtigcsncvynkiftveqpruuxzwsnwybphhefcmxsaftwkkoxbttyoatogcftpjebegmgqvkdnmykfwmlueczkvcdzlfyhssdaoqldywnxaxmhlmflvxnpuohdicsgosnjwlnqrewylnjxuqhtxunawkxacpsonyupddkvcjfhwweqvdtidqnwrororhkwhwdpvjtragxaotkcdvhskemhibdoityyxkgzzohqvaxlercvofzngdlahlykfuktvvwbjleqplmuwwwikwzggebdeahwlocroxdrufndmxnxjhzzsqnocygxjihtghoffynqctibnlvpcysebxwrrrggwgqmrkvwkwuidhgxuqmoqttwmdgdkhirgzztmgwwqmonjrexymlbnxgpxafanxpgzwtgjboqoeleoegwpvhhtobjvtbwdwaniuqwpzsywbisxtxoabjuxgnvlsojoarlhkilopaaqbkbyvazocvxveyuuicalgceleildjhhczdbdobcjjnumqrpemnmgghaidsyvwglqwpaxciusbywgdznvimjtjxemttjxicndatplejumszucxohkrvzuzbkbdcnotvmxpaofrpfjszjouiiclfofpprxuvjmwkndvsoubmptmmdnvsslrofuxtrwlgjyqfklbuctexcsmrausuzcudyshvpppemctxtcqbjowwgdortakllugyrqihoyjdurazprahoznisgxmghtrsftavoitpfoomjfzyzxoqvekzngohccurtkwaszznbnppooojaltvujkyukyocgfadzaevjrknppwloujbgplmzxipzxiirlvsrefarolgpkjugatzxsikdhqfllqwblivymadslapqslurpzbbqyefsvoubywwhterzwmbuyrdovmwzrzoveydyefvjxswmvhxroqnrhaneeujqeoyvbdeizygdibioxcvllsnvogoaqjjgvzoqsexhlbdbxlryvtceivzqcesnnfqmrqvwaonvyinfotdirotuztshsdkstgjnlkeflcrxdmutzvqmjkpioxyikppozfninlkithnbiehgmpnjcgomeebxlarjdhjbybbsrhqonztqcctlpsxpcjcuorcuynukhzvxybcnlwglysahufgstinzklwxcnjjdffuwydqholgfhwmzbundqacyspgsnvtvuofdmdcnymvbqilnpenagbztcuvtgyppkejqklzeqbdezbepodercpkplybzomkpdtfsgjtqqsyetwbscdvwfjzsqqusvrorejlfszzuuqzdvfujgsgxbaqqezhgkbxmeimnbbbvqtwvqaeqeneohrextbvvyapgdmkvivzjxfewdmzmdjmbrhbykjgpcjhiclxfhbtugqrrtkeirxdfjslzggpofkobbnydjjkdcczeyjruclxpvdqknmofkqcefcxrzmpmzbytijvgpxwekcdrgjlbzsqvyxkcybdcvywfmlquinwfgyycctonuofqwqecdwkrdankqjbdhslvxfazyxgcdpnqcowlklntekahuuofeydxkzprrkpjwodfglksfdibevqqhtcjdptcbwcxjoijlpyirjemgcdxlkqvtakgudnvurpcpsbkborovppeihpejvhcjofotsjeaiaszvgonnifclwobszhfqotamhemacldpyvesjrqpymgccyjumiojxzmmibsbhtyqwzujajjceswlrlogibuvlkvudqrhrzatpbvxlvkmslbsffjlanzglqjrlxaajixizhpdmbnlzcjuiivhrilgrtrpfidgekqvcavtndwfloqyuwyebptwygpeheboewzicbwzpsrksevcnepmswcuzbmqltlszwoxqxsavadmmndkzmkraiigppoocsnaguzaarenihepxbkrcgaghucbmpepebjwqmaknmubgifczfvzrfpvyuzcplohakqgivnxkwyxzgdcrdmzsmphhejfcvebvrndwwhueknyemfemqsyfykcwcudeqabthnhqhymokbuclvuxuzipvsbrzrvyqutcmqqdsbynnpreqykhjmcocbf", + "zzzkpcekddjufofbatmqcnznrjzukzmisorayxovhojvrkqncdyzxilladpvrqbkrfdoodykjazbyyyliqrgqwwjyuiddlzlgjgelzmacqbwvostpqhbcrhjbnczesjavyquprlnuaikomnhjbwzxpipiiotckbvrzrbxuerrqjhuxpcordrntzytzlbaagveylkrrjxszkyukvupifdqkgxcegifcdfpxvfwehtkkkfjuafldqkcvhnyyuecbfitwtkcavelkwskngnhdvuetgjzgfcnyolszagjldencrzmlttiqmlssnkypbqneotcikoxhuoxmymurzjvcfshovzfvbujnuxkjvtqhberonmxaiywjctkulvqiyfdzmauhtwqqljdcscsomjivwpikkffurxgblqqiheeotivcerklfenpmpgxkmrtqfatsuwiiofpuvwtqholvycjmljygsfenntrvhdhzfpxfpnfnetsfwvpntgpyfcuxfzlwqgxpvojtrncdpctnceuvngthpnpstcprevuomwwdxdunefncoglgfxwlynsemcppgckphvtvsbshhjbnndewmkxiqpyfhabyjauksvjsohkxvkixhzifhatzmtalztnanhgkdqernhfebgvmruvqyqnzcoyanmbqkwfgnkfrbifgodrbttdrhzvhfnpugiksuxbkcdhpcuqdqeskwxrtpxeeqcynbsyjnfrduljhyskbksgvxpjwrmstjshyjiyrxkehbhgjyyniwdyohqsvvtaxccmwfpuwxziveufkjkuxixrdjilethwxlqjibokpaustuhxfwdymdtxqslgvenwbdnndmgoworpzveputczzjmekeejjbvdiamjywzleuwbpqyaylhxykztizprvijfcabbmukbgebdxhamfmceasllqycnjzlabpwzllwychmdibjjmdpqlsmpkrgllxzujcwugrjhcwejubveejgictdtlptvygqnfziqsjijejadvcqwpgbpgaquqevjsgdsdfzbomnsumwulhdwgwwtjdufylyxpodpntleymyzgyeqggbwkrwkcjqzvvzdljemdyrutiyxkwwrzadlwavwuscrwrmhpbebzlopmyumdecxkasryqkrbvaealcinvkvtckczytnmzuqauqcbqjqinwlgwafzywasqymatxbwiyveuallqphzkfbxhkkqcnmcojjlvkqbluwtfisqegbnfdftrvctrpquaojylbjlerbqythpddjlddbcerjdbvefrieflpgenuddctkqevdiklucrqcgzpndpijciskjqnqpknuozpzxyetaclhvoigrlsqqyoxqzamkafaqnqoozlyelndtsjwubxzmuutabfluyfapuweddjkysscgljzsjpdbnvlexokvmvdpmjqdsbtnjipuajvbslkavgzdxrqxhwunxmpdjqignctpcgonolfjtmtwsxzzgcjoaqhomhvibhfmqztbknpydauteuxwwkydezvjcwhjbguchwytuhgtlvbnnkkjevsmymcztapegbzbemzkfnehskkaxbjaonbqqsppjvgfggqcidwztyfsmgaxsbrznwmbwgjmrsjrgsdamihtclrbyuaxffzhpqsiyptguloflsgtvbyghpetlqttydbzamczkkipawdvvbffwgxnfhfvybmmagkryhheumjdbjqqentthbfaxhvhovadevbldodmxtuivelawmdbefpokvslsgqtzdrxtuatsjxdggpyxhgppkqeichjrnewtqspzpjnnlnkhbcrmzfuczxfyegipwjviqvjvbnfvpjjwyztdvcqbfiiaraoqxfuagcpfwixmyltzdsicmsnjjapzxkyfaubdyjkykmvvvrtrjsqrganvutsoemdiwltmeypeojiqzulyjofrcrceifpyqcjsoukpvrvnhomwkjuapqwdlgthnbjkfzgdsglsgwqansopzyznsiijcmmidqrtewwwiqqbpufzthdwlwchtylmfjqwfcelzqxtvzvkgizkmdpjrnzttlnututtsxnpxhruftxzpchjdfxabhbixhbeeozzhvziiukrtmlckxeatutarkgdbcvsyaeltaoxkvyymfgoondpokmjecmjcaucyxpwidqlncncpcpozymqfnombginxaalhihgolbttzupooomsshwicumasqicqptihevclihzfrreijragnyyaxyaohinmntdirtbswncyhzjkgbkzkrjmymgmlmqblzivagutwfweiznjdrukpbejxhyftahddnuthudzikgdbhmlchhazqvvdbmtwkzsvyaovgqtjnziaysqappzxywfjwmsgikyahrpnsfyaqblzfyfonegnceqpxasrqvklaoxbaldotvddypyseabhfmibimpokclyboewkhnaqirclkcjqsmxapqonhtenzqksrkmmrpelaifjvhetdjcldovatfukvgvvwmxhbaqrivlwochqxygsrgkuvngvnydvhcnbtkaskdbqntezdntnkpssyqawxtixlskpdpuwtbzqfvjfykueaeyhnxdiqdyckmrusjtyrcyuznxzudhuwweahmtymtcddscxjozsiplqphdkynxuvxwltzgezsdtmgtwvgykkjlbjxssrqsybvflujuyjudqbicndokpkiqxunlvuykylnlasikbaxoxlblusczwqrtreqgsqwkfmmtfrkuhrkmwbsjllyatymucpwecnpnavdtjxrzhmqzusrvrshnohlptrrdzqunojxcovsvllrapgewemuatfzyfybbstftldetyfljlhjwrngkfyuvuadylyxdiqcoqbqoiaqxgujbzostijpvbakozwgllywaqdsfttfdtkwtiurhhhzljnwcpezpqkyoeskyttdvtvxxbbhkhyktmhtosshqyiaypajmcyuzgqdfseomzojoeuxqphjfcudezyuxeuwykmqvyrljhzozpltrjewsrtgomwixdnqrztsidoajddketzcworfytswkwkczeqlqdmimshmrzwbfxworgvkjovqtquwfsyouvgiipxaalqmxpkpmnfwqcfjqveguzetciautzvssgemxwjrqpyaztatumwboxgdymeqkhikdlraugdloptumvrecybqcgfpjunfesfozuglkumgdnnoepsjxvtboaweektbowchrejrnvflrrplxfkjczzhnlymspgusonsfoxujbjpyettwmiiwjecvwfsvgrnwijjkpadrzcemlxosxdayocfywzkhhzbinbzlistdyydfspdezwluqfgxbnwzzjapxvmtcoxwaariladlpctiwqqjnlouvapeaswesqwxpdbyqfrdbxrxiacvhyzkklrhhkoonvyyceogfylvvqsanbnpdvhaqvykxexnwqeqmansyhjqpmsmokhodnifqkrdrwzgtxiolktqoosbocnejamrycuckfimpkiesuqmczazhexkpggghtyplgtyszfvvyoqobqbvsdewncaoodtuewlpsirdkwsollezejtmxkowzllrcqgzdngedusdxpsggxmimrjvomxojolwoywgcrqzutojcgxxnqnjpvpjeptvoaajmttbrnvhjfjojlzurokqeavvgdhrcunjxllfidvdxkbxotojagnqgvijdhqlyrxipfstqixruizvdrgrzleodqosyfzktqoozwtwdvoqguvgiuosskefcvxltvxvimfpiljmnletdpnjzmdrgkqeorwovzmedpqyijovkspltmlmzbjtuzqdbtmqwghpmsetvkmbntqwxywkykjnjbagoerkmkyzyhligqbksacftfllxusmhzyiuqjrvzmlcpcsjjsxrzdcloaxqyjkdgxltsgrhptvgyztouljkjgjymnanmovszfarirrfydjpjnertgzqtwortyhxagkagcsrfknkoxuxmijeoopjfndbxunseyuxrogtijxgwrxkbsdliwarjammfiutzhlzyzgsbbmtmzfrevulwvjdyyjyfipqdtflzbaxzvvhhxbgszqrwgyretanggrtzzdgolgrdybrmwhnicbiehypuzzqkausjwlcwacczswarjqqzghbyqcwcukjvcucyglkikogcksdhkrmryibxrvspigtzygeblksojtyzfaqkgiwmotbsdokletehtecapjmskoabofowfvrvngiiqlpeepyhhecawyabmmhaekpjvxiqkdaueelnvdvngkvkphvxpexctsqraopaxlrexqgifcawybisyscpjlskozdpqpvhphwhyjzttqusynjcyapgdvtyezcqqhrfasopevgahblidspwfnzbamhcmxgsuctzdevjxjhynjpmwsplukbeerdnzuzyylqvxbfemgjqgskodxqtrfkgyxhccpywmpcxbiotgeregckgxmnvctkbwphcvmoivzdcfcbiohpadokqnkevltznkvmcsayhiqxgsdswtmvnagwurdwfzvzuxfwugvvelmqyyuqgrgvdxoyykdjqdrzbstkxwupgmnnrdmxqaadhexrthazpclksgzryzkgtnryrnxnmncbeeqmpdpvxkqczdobrammkznyoumvgptiqkofabgcxzfziywlfpgwywwhhjtplarxwdhvibdokvhlhcrsboxuinebevcpisqpbhrzxvidvfmfpmzfqdxyymxdpkqnrnrgenijcxrjdqsnrcvogdowsykcanuvkewdbybitsviatrxnzgobaodhermtnexyddvcckafymdorkxkaqzarogdsanlulwkcfbgsfulraxkeycwcnumlstmpxkplwxtbyoknxvwzoqhexgixjphzfawwyywgpjyxdurqflhwukwyemouoxwxvetfzcqkzoezkstobgucmghcmlkplajkpecmxsqhnoenrmlfsagiqcaxwjcpvpozlseovwiwnrhzvegjlgmznbhdckvfcqmacjmpyvubqhdurusdkxeqnbderojofhfsckcyvfemlgftjsvlrfcxaypafjkqmzlqyhvficxqpfvbglieufjhjlspdxknolkliqdudecsepbiehvgrfafbanqbszzhjlcspgpptsaqbodigkeupleclryklrntnvgjqtsstasaaiikpczokqqzpesuaatednqpabqkdsweithrrqasmjzvehztuloqgktpcihhvcfgiduffliqrhtwycowoajgpvxfldnupnoyoswtcmrsivetuajvcknwaeuhhapozdtlfzvfcqyceovlvjvulvuyzeyfdtmzfeqhpizxspqnjcqvwevnfhyvlbudjskajwcuoqrwzknihauxkvblvehnkjmpioypipfjljqsrmorwaeystlldmdlfwtsflexbqlryscyhedsfdvmumyzpcktvitdrlectdhvknsphojqqnfcrwdzmgajmsslwisjvxqdqkaqcmbanftngypptwtpflmlaekjgbbpigaogaqwxadorwsjsarcnewmpmzqanysldwcstdlljicydnifhornrajvqlymhzbzlexhhovbodaqvcjbzdkqyouywcdbjvdxtaacqnrwpvoutnkebpfvwsynxedkbjxvwelvencdiyakggxafpaifqhcxwsqvmjnzbkwoxasubbvrccekkogegvmbgcwxqxbnzbhmvagcefyrgxsmzyyupeefrkcgcjmhdgzssxljmxebvbijvkltdnysqxqzwzybuxdjeqfxsdtnbfzaighbmiwgzqhaurtvfuacmhlmxnijtwyeovqsqdtjhpxcukramcimixvbtkaumboidqtzskzrgkmkezztmerzaijsfghyjwqxbwfkvzmklkasxugkezruzyeqmmagvkcrvfykxeotziyurjbwaydtjgjcksbbbwebmqkiebalgtvxsglsfiymhtwsmiddcjdealkvexpquwnvliryporjuiuunsliqhfyrvtfggsqkzvqlbqafshyrkldriynkempvvlzvoynkfxacovceubfbyoqmxfidntimkcxyftmkqjrwqpmvrkpxabwshbiukyozurzokzkkbwyvddqhtuxzywcjotunjnzartlvqtfbkmqyoarcbkfoxgqhxudnmveslxnlffsmxguxyskwbjibcmrhpgzwtbuwsyhwjovtapkpqzunhjynzbbtmqjadvohudmkejcyqkpzpjcvelalegpjuehspjzalcpcyjsvvnnjcvxliflkzuqgtqomwvjxelcssjdhmwwxwkbycymufcepdagzwuejawhpjxogrvpaysdhtbhceknfilltkbeqflqsfkmgwnenrulriysvmnuaqgitukryahvpweezsnbfcxpciuztkzprhsxhdmntghhxsqoyjbpmyvwutafreoozuvspfljkbcouirfqjjfwwdlkxshfhgazczqrrcdpluaymhpaeypheyjmnmjuacjvtrxqkjqtgyjcpfsvzckgttrepwreorjndwytpauqpggfbkziqiqdpmbbftwkvjvrltmxetdflebptohrvtuafyfytcunqkltmnymqxckahivzybdxsgwdyqrsttujivzujyhmtucapawieavnedhniuyxtmhbbxgzavwqpsemvrthljiwnsmyrvywzhmusszjulacgfrqzxqcsdumndcjbgpggtemipmpmllunhgzzubyqeoizfugvczxutuqasugufojtyzxxdcujysavespgxvrsgzdomgnjaspxzmdnithykfcnvbomtmqpwlnbfpztelpjvxsiwryoerbmntqaoqvxkfnuyldxrsgdkijcclajzkxlocijrzweuoynknsnapazndcfmmqwnbjxcutjrbbknlqqtppjjmgidthelzedxbzmtjwkesppxjygmxvugdgoftwyemxvdcroosuiykbbbkdcorjjiluppxecffiqscziskdzqvfteskrxeimbarvywzxhmpmmwzndvnomcutzaywmtzrecbxvpqcquynoqksrzvjjjpaakqlpjloauthsjyjdgutiokxdvfhhbbonsykndhqkmpdivwtshapamlldwozwymxfxopgsperrpktzkbbmrgdcbopmfbrwycztzcpwtemooptfkqihoajyerlogyzgvvobpmnqmuffhfjnctiwsnvcycnxwncinitkswcaktqqthpywpqtcjmzthfewsbfyetjrjbkktdqrowzpvarqnjpcasojzbzvcwoxesycenkgqkeofoeingnbzbwzgmrlnqrrwlxyunznogigliltmkfpcbehlchuyedimycyxycrryoldlpipgiwnyorfkranqjiyezgqfzdtujsftiwmzaenurrqfgrolwsqgbkzxltplaiawcnyszyjxlwqlcakwvwtvmrlphkmefsuabnvgrbhazvuqcnsyxiaaszkrzabivnyxpygnnjrwpiyutymbnwivgzckwpslfnmbnxoznxqgghjuexvverjzualcnxcwnxsnukoiknwqmkfyezhwvzjrqhjrqmqfkwslibwypcxfkptxjspnkmfgakwjlknedvuggxerrwtzmrcjgwafmuhtpafeynzrwijsgqobfgimzjoffhknmeimgcvebzszllyxxtstfodhmvjecidwlmqmktajpupbvlsjnfhmiwtybqbownnmgfdlmbpwfyhqvttezglwkbohtpumprmukqshcxquhuhccitrwngxbxwtmvxhfmdmdhtvcalufvgnhuhixsxpurfbyftqgfpggkitzpuyqogfubspvpinguggfropbplkqwijqvsodzqgyymsrfklwjrnjpuvtptcezjledwuhutdhgrliuqsyxpxvlrrixqyomlitrnokzugebeyxxbufbsjtpemjfwbelvaoskkrncjypfxezzvqtoshhaxmvqjvtfldhdejxojluppdfgylwdchhtmdpwxqybcfsfcisblvpklbllcafsgzlcbsporxspfhmmykvpoboveildpzhoiacfzufptdagsoxiibqqpmmtrbemgcenrncksfdnyhxcraqzjuenkymuhksnlnrwyybsxzepmepstihamwqgykeucpinznrcwixhtyvupgdpyemoormwbqmbmmcsgnpiahqyrqhjoavgzmcjzhyryctlvuahsjcncjhpquotiufrjjrdfzshidrorwqnpmtajupycdelvhxbzqjlslquxhammftzuxfcceicypgpywmxyfhohnyxenpguzfwmnccibgyqlfhazxwcjlldjaborbwbezyqqriqtoqbattrmxortrazedjrbsfiogyknhmozekzwpulngujclaceopmxuwgbxputkzjwisnmhcjpiltlbbbepgsuaplnwbhytswyplwlewktkwmsxuumkivnpstujeeyabciurdycpgetzaenwmbulhmqgjcliiwdzkztdtjhjbcklvuqmknpcofgtwxvavdubfkvcyakibzveaykfshtvnqnmgjjpfotbzoaaytstfgkomcqjzdnkxperxecfsiwoxcfabsqwzkybkrbrfuvhlyugmvipejgyfshgqioivnmualtbvygtmwlawwrfmnpzdxecdpvwejjlkmoscqijmcekqpfuwvgykouogqtbomjiutelckiegkbmyyreoetlexdnzmnvioyhrmwpbyeeertlpcdavwxkezrcqntmaiphdyztfvsshudyfpgjipktckubvqjfdbwoqjlanfdxmzewsrbmxgzbhmmojlqgdqhvquauqbyrtcjhkkzilgkouslbqdwzpqkvmhwbwogyluxberqzfgbcimjgbficupyroblqkedajjmiweqyimuiodobvowwivbwfllidvgdzdqwkehjnrjzmokixiazvcipokaujufnexichqpiajfgooooxxqdsmajcyvycditxdofmikarsxpwkjuigjiwfeyucvobyuauucsihdljvrrxtmltrgcyrteowywzksyvhzoinuaufzjtxzogbejxqcwknfovpybdsghzoublhoirpgtcvcshlpmupfjjbclqpslmdjvgpmqoihtbkuqfhdmvxujhdhdzuvbqczkqkymildmkivovxskjbijshhzcgwbnhcgoubgqorsqupjguclnubhzjhqzgasikdospfieujlnhcygmahypmmgvatfxfqoznxupxxtopzewrqgzqvdtilnxcwjwybkwpgddrljgwgcrgkalydyqcsvbfdgzgxqdxpiouhscnhjukaszsmgotpocupoqqpaqdsqmqxlupgvrpvjcwnueeqeifthkyryolkhojpccuuukvctfflwiybstmvtzebvbljrvwbykjigsorgvzuvpttpxcpeqseemywqgzmfppgtknwkervpngevihlyapxrmrgusfwubrntgnxkedgsjgserdsqdvqtxazinzlquhjnxpglyjouivdmskfqnjaujvgbqdnpgtmwvuhnledtdjcgscfaxovbmorzeommdoyvgriknlmcehtajhdzbvdrygkakblsrsvooimylyqdbhzaepgaaaaojrelmgwjmpyqusfjqfqzunehtoeukvgyazrchyelqeehivrlduricaboybjafykoxcjqewinjumuebjzjvaudzddivnvnjhooqafyffrbhoxrtrfuzbhkmgotcolfqwufhrimkixagptsayreygcrodkyozgqovolbonbjjxyhdwjujgeguogvvumetkvrwvonsgamidcrkirzrmxtslpxaofdaotbdqujlchfgywyuyqqjkihrvaxlwjdbqdnwvzywzgzwfhommkfshqygiblfqjgtysfmlylyqmqlprhwgtuezdmygqgbcjbckphphgyzpnzfsxlihqsgpvlzeoghnacgjsrljyjdxcqpbqrxifpkuwhwzmfrndikxdcdqcrzgaonftftehvrhgqcrkummghuvreuvxefybbqtetklhrxjqiplqtujldxzcqzrlyrmsvujrdlzrdpjtndsqlixsqmskhbcugwwwhvdfkwyvnuvlrckigbhdzlxtrkbhhkijokrzfmlxpkdnjatngrjadfyattfhxkzvlmxjigzylbtcchfdiygpiltijxcykrwyvgofjhzdzokhbbdwpfkocyvlxvwhjdatgvugaslxotoxojlrxeetwfokapbgpjrbhnfsuxnrokbxjljrjylnirjueffewddjigylvglyyiszrnzzwwwxjjocrouezovasgzstrcjqziyzwfqxivffhatunqbdckmaifvtiwwtdqqkrmbjmfougytlrwrtbjvkwdijlyoaiiboyuzfdscqkxzsjtpgepztxvhxszuafonpgpockeydypblhkfztoukeyxqxnknobqhocsuhxflskglpnwjxldffqbychwvszauvpmyzwpyjzdxscehqxglttbrlikhvjlzgsqvgctgcanxqjvgekluttfbdmtnwciiafchutdixkguaehlrweixhpstvtqinawyrxmdyxfvgwpngvtooumnxxhvytkirbzludlwhoqpwmmqfjcfbypqqbtyqpmocrosotmfqcrypouchmjpixspcvqbbilowiuwrflectipswqtqmdipmxiyagzsfiaqowwvohiheonkgtvqxekhkvwyovnfuqbmmexsomvhwyhhluaxtzkhrhwxhxwylveelpksqvvthkaeggexlswufygnixjkjcaugojquujrhueydgufcdlisrnyxzwddovklfgjwenxuyndytgcnsaygybxtrkkszeafmtcgfkrruokjxsxipuhjpcukuxhkzeyunbsfqthwhikpktmvkpccrvwvpkclyhovonifxwkopwacwcyspzoujkqraqlqvijstufloppphrofuxnapfinqlwrjfgdqkwxzthenochjrbvfnosjjzemjcodjcujnefxuribeixrbxwnzwbmjkgnqllfvjmocsiieyaaedfstmubjxvtzyjsgptcdnrqhtitcggxrgicpcnhklrtkledocprfihzsskpszpjtenrugagyizthmfqvpvrnondsdremqffpgnfxmgzkbdzgxdhirsvzvdietqjxyyizefyezdipiavuzeskhmosmzatidusovxyatqvmpudrqlcqemhqinnwbwancqikxllwnfjdqgzeuabepsipdsvwllqllmarlhbkaqywdpjyifrridrhtbccyqfdaqolrjxcrudumezdfgcsujfverngdpbcgedwcoiacbbnvrpcgxeqkamxvoprdkigcedpmkmcgqjzamlujxlxhhujeofeqjvbahiyvzjiukhrxiftrpeehmjrrcuaosrlmsxbpranyqdygneoftniuhtmkchkyioxtlfjgkdihtznwqbnigchepshgmzoqvkvxxgcfqaxxntdtfdgvlgzfezljflnbjhvsqamyyzouyfrbwepjgfcoadefcemikktnljrvjolffdnvchiltqkybbsgsgozvfbibrzmylrqgdwqsbbcedinhivzqnsdkcsgedcafkohovusddvuqyrqazzxmjytzhrfjkgbeeewucovilrwajflwfjxxjcrgtakotvhdhzpznnyaabczkbcbkhulcbxnwleccekqodkrergpuszbmfjtqpguxdsjwmhgactmzefowoubthfgbayioqfrmznfprsdouuytuhzihpykowykorrghyigdreottjidhonuqmszagceoxokgeqqtbgrskkstcrxjmhwqleoqdrbzbqapvsvynxlfrzzjroxczvoezvazodsvwjlmcumodvecqwdxbahmrbzjdoatciaojjxqkmlksipoakmibncyyydgmtgbrzgyjblokvvybqzyftclyurauueedwrfyiouxyudhxrdxlvobgpmebqbwyqqsicvsyscteeggtmgqlksxaehfwfbuuugugyiutpekllvdlfgkdxfxbeayhceuwebwggulsnyhxebyvbbmifvjnbfbimnkhyzeflrdhhsqhjfqqtrxfbpmipgnxoexfajabnolsnecxgjyjycvzirzehjdadeudpozlkdrgnoyipwsthzjfgespcnuvvtntvcbmnlbzzylizzgkiwcavcwcgjluszzqgaqeenysrczqnjoerivngbjornyquuvtrusoqdrceybfbkwusllsxwychdpjbqjbtirpgfrcdtqsriubzctwpshctjgbimltpbyjfcnogecuzqpfywvyhqafdnjphyjlwuirpcfisrddyajyurakbnhhhadukzffxhziqznrzbuletzkpqefckjqpuusnrdjryxnchdbrunggadskqcxovyuhbiocohkhogfmfykwkodohdzsevlitbvnlvjclbzakvbjhrxyncrggwrrdriblyarphniutpvuppghoosnpenotpsbhueomxcefzrciyxacmrklhvwpbkjwwyyzuoiyghreskjtfyorglfeznykqtfxqpbrendgyfsyfcvgomusecqaimgrtohuagmmoenztvvfffhjetwykslgnngymigthcswwtutpqpsrfhdeilmdvadjlqfaufxucwfoxuckvzsxrcqapywpvaurxrqibaeqkwaaoniletlkfnamzjyatwligxnzhpebafvbolftjhqaqiwesnudmnzicmcxytrqkvfyezewecitozsfstdklflrbhpskfuhgwihxolotvenfxiuqszghinvttqlabntpunseefvehfodgfgencqvmuuuesgdjwlecsepreccbezxfnnxzxndxoqxijrprkdhhhaluzmgpgikiajnxoajyoueklnbivsqgqsfebcewazzneruumirrmnevmpqfnlkvscdepnkugzmcuzpuqxcfvpdyorgdgnggzewtivlxahtgbnqjpaplbxejptmtdqtxgfkkppbaicubgijxrbylqncsbngpvudgoatgoujlpzlrnzodptzievvqchyukyqizyymqyexwlsftrfhylaulblnbxtimezjmvyonihmojhrxqlyemyrvrdmymnkqcsqdyjavjbnntrykmgdivxdxcgepvsobebsdnuewxvasayeayesgboeahdqlmscxeveolyhcvrnvcxzcnqaqalljmfcgyvjwhobuwdjzsntngsspcsyzkcpwqzhjeubodskicuhaduasflkofxhoawfpvmqwmiqjyaqcadhlvavxnxoxphikjpxhqygtelolzrsspptjcblkxsdgenpiprjrjghwjyrmmmuebgrczslbuolkgrcxupkqagtznmtbwlpygczneazcmnuahwzcnbrrwpujiwoolfbkgxjzynqarxkgvekvvnbncpqggpmxwdtfvdmbwzmzzwosbmzphvulwlnfdzyhrbjxskxqdunspwjgpovuwrrtgjuxoqpfxzgjuukcxpqkarxzbqrjhvcfcgxjrldmbljqcsdeawooazpyjtxytblkqzndasughjehnftwblkskhpgmeubjaftvdgjdyizpxyxcnvpugtvkiarjwmfpcuubftontqtkqdgloepjitfcjdcdtiazapvombgetnshryuwlgiwimsimbicasncpabpjdtrwnmbpksxgwyjbcbraxrksjfmvsjuytyfslnvhjmhwohkxnljvdybwbjowuprdnnuzcutklrzntqhgiyqfuluyveswznbcctbafvdddmufjneyswdqqliowqjifdnhjjtdxtdqiyhjiwrvljxxskbylgfnjrygjaahxcavronjpwbwlqnbccrfajsseydpjrghzoeiflqsmcioydxzugveghobydmpejafexyjxnhzpalywldaetpkkgecfcyvsczdthtsxvjvjeolzdgboytsxydnawtssynfqohdyqapfusomwgzxfnlkocvazgqryusyhzufvinzhzheapglgkwllvkjqhszsevniudijfaezckzeyenwlfnailczhlryparoapgkvmtacoqhtohqmztywktqfbigwsozonhhdnuupogsespfqbvebatxoavjjuneenbiwfqzzagdglwhsfgmlcbhraprqpdxqquecxuqkubtjcgcpsgsrinqtaipnlawtfulabrwqzuuuwzkysmkwpmljtlnxbzuksckykujhgrmhpoaqyyyqfmvqixrpavudfsqbydbanbykynhjoqjtypjgolneytkvwccyflxzecvtjlxncrmeqevforhdimiicqbrhrslpspvreaskyltbbmksnfbrzgjxgtasuoqulkoncciirigiolgaprjfnjrayfrtcskoaobniaxybukuhpqjlccrpvcxfogwcjckexwpurzoyacjcqafjwaieiejesmtzbxxihkbclrcdizgmahlqhbvpwfpvxzxfkzoymrksclnocxbrysuykufukmbprqfggwvjwruadnhgbdfpvwebnsqdjgfyhpsegwggecezlrajysfleuzdokqjyarycphqaiimltqpgqswabploimbxdfdffxtjuqaapxapskcxfbxffptipshsuaevwnnvzcxbflkawdpyiscmfnmpghfuqxfhqghwlynxlqhfveehfdpopibjeckcshwlfmvrjkeulhrnhzmirocbxpzcclwsbhbemvxfdasgkkwufgyqxylzifomsjjtqnjhfhfodjwsgkootsijiqyhgtamxanditxatwacbzcxnkxytctekvkxnckivlcycxlkcbymvamgumksmtcbahbffuyyypkkylzikvmrdmkwxcjxmgrhsfnhjfmidwoezwkafrreazfumjmaqubxuhsuvaobiemtimgpmekrlansfdrxifeyztcqwcrfafyaunemtpucxmamtgkhxoldwfzvqhycxfyrwmwlvqbzhhclkgpdrhhlhfdrwwethahpjtrhmadawsssnjnbtlhzrajoernddzpvscmqpppyqnualvexgtadfcvkhaycxnxneqbbambrvqerzgrokrbjnodggxkkmugtlrbxrxayjqelcnylsipgureytnosojbkcvkagbkgvaeucrfmblooggkiljyzhlcerabumftylkhefkjpbdlueepgewmhfdezjwahwjfqyqowpxpbxsudrrasxbgbjtgszevrbpnkvcnkzuaprbxemyjctbbdkvenjyhrnrweszurmgylimegzifyuiiioinbynlpmnjnygmmxpigissiisszbptltyjrlybwyraxflrkpyqjuezxjxjqvxfzlrgqsbnjtxjxcqmdqagdxqeuugnyirvydiujifqycwczirsxppntarnxjwmbkmcjjrvpmckwpggknnkuwmwnstqsreubaalkxrihpfnprvumzefzfkolteclthynkinujnnbacphzgayapuabnqkgdvvbgkkbzafcprwyhoihpftlcgqehbfotxjbsndesakbekjkvcfdblcnqrampssqmpcdjolisgqvewthorrwwmtrzvwnuotjjasgfwyzfdenaveelrpaahqxbgwowfwtqfqhomofxpmlcoxafbnzichsdggqeflcgtlaiewiptvxrlcuaihvderygfkvpyzmojzkgisebzfliuvwlspmzuofmycimigkhcdyvhtlwpbwgekfnfkjkmyayvmgwdgyvwjozbmuuyggbulwhoeurbpdejvbejlfmcfpdpfcndvdnvojsoafewbwuvebvcqvefxxgapxryrmkitlpxxcsszjboaicznkprhanmzqomteipgwonpsreeiaapobepsqptplwwornhtjktawdxcfioujhliinhtcsememxfpkzfoedjqhjwyubpmwzrantmeyqjfahljmzlbgwvudmelotfpieyyciewwitnofiefimyriiwvschyptfpotbrbwxghrlfrbtfyrqtomchonfytfariknqvowwklkrjpekgtrwflmgjerrughpteujeqokkyslctahrgshbhzarltsiodzsjygkncdosxprfxgrxeszfejttyqbfulwyepdimwnananmnmdvbvdktqwtbgkdihgxuxuzknjzwxavujhfgpcoyjfdfktjynewfflyaducqqxbyknkfodpdxcxjqvxqdlzaofikfpwwmipxercydszxiimcqoudobesbkugrixeagrbisxgveqgzcpowgcomvxodqovvpmccutimpwgrglkaqrmwgdkmqqocasmwnwuimgzwmajgwwazjgaqwefunxzemnejljqwpvqohsjkhypswvlumxhunhexinvmsjsjbooojprhdkpoqwrvbmmfqicmbtgjirbjvgcpzsfofdtpjawxhylntmkjjoeiabmpidezpqldpyenitllqbmcftrtitmgouyvasxobxqstjueaqzezskmdlzutmuvytlcxvuzmusjgbolseiuqujwcxkobmcjzgjhvspxvezfptkorzjfaeaphrgajlfdscrusjryqzhlxfnncvgtfqrnwgsdqblgwmposbmmzlzmqidoyjjuzckyhltqkbockxbryqjvjboqxwhcfwawwsilnbqlidkhfomqtogrdlcflayfypdvohskpkwkccqrfwvcxvqgtzbrwjtzycmxxrwtxebssuehvpqxzsdynzqbucgsigczfcssmcspimvzkirwzbjmnkjxbjmyzqxvvcxgufyluviibzudplpvcuglosfdhqrpiaezfogqwzpfbygsxrmhrueyjuyeijxwignwfmyugemoiamaqnxmdebvssowrnpdcumiyofpwvhtqwoykhhisvyhyuhionpvqmslxtxwcwoiihbmkecoghnpajjkuduszojftcnisgdvlkmfgidgpojohpvqlhqqorfbikhoygsieuowiifdtkkmpoprbvllorjtewjonkaeoioyqnzxscijelknxqsvcakqmqqfagnvclrbgcxqvvyguvsbpttqytuuhukdiqpisnhpdkzeshkdjclpektdeqhwdubyoqreuhlkwdqiywzixukoqgedzwixntqaruhjjkrumlhwoyakxziqnnfeyxrwbkzmtcdpjgmqtsyednghrlvynhccsvxtpikzxxvjstjcfpsqtuxwbelcwfqzyguicabmclnktngdcsqphacmibvwkrlvmpadxgtycamaeszdlkchpomwvnmutjsntwzjbuqyzubpbttjkdihzympyobhygbfkqoifhzavaqlsoiwkmruvyylqwgocpdgrenssezqxttochuvzefyzxqwtshgqcthttccyzcwqerliptjzlckzmgdxhcwzfcwgqtccdufniqhryfplsnfwzoboqwsopmshvpimqsatmdlmqvilzzfahhlierrhsjbyxikgflycvwurpfcckdxlmulfgizosbhwjoafhntdjxvzvyhcixwjzwuxcwmhlnetigtssimizztaqyufdecqvjgnkrupplswdygilhmsekoeyvvqlenvuzwxlhdrwauzkwloqhupmokhztwvassrcepktgouqtiosgszwwpnvpuwjmumgtmyrtyayoklkodyvfgqdqtbwnuygwiaczxshljazagunopworusmvkjddftcazdybdxaezoypfokmostomqgrxaetgmfocmzkkkriqzgoezcaqmqpvngectvvugxfqxdkuatyzqprsejpcklszwoflpfusvxaymrprljgilfrosbpfmwjxgwsqxknylajhuijzekicucfrabhhwjdcuftwnuexuxnmnebbmudvteombelfqpbloojxiufgdkwgthhbwhwaiyshyukcppztfmxfkkuxxicmgbzvegbylinasltnejpqpulvwuzhjflxymtfnhduyxtyrtyzoxleoedvvqzyuddwpreljyhsyyisxldyopsdqeydmmzfyqgmmahxnilnfkgicbhfhxsqnrzkpietvzzdousvosqrndgqzcucnzmjzdpxecwiripyiszidmqzzeprvgoibrllavmcuhvszwgkuqjexafxughhxlwcoutgktwxspghqcukhrnycovpyxnpjpljrphkxtftcxeouhcwalaldtzrrcteuuyxbqpsdgfucnjutisxnnpbdoqmligqbjnqgsgcgahozkqtpgheucodsgwppsijhufvtzklakzqoesbclwodrmzspwptepnwxvuyqimhvgeuhdmmjballfqyutpnpwpaxrsugyxlotpkizgzzkeofpqqhsmgvufizualhajhtcfdlakkovrhauqtdhqijasqogclujotajlfipckqzntvilxvduketvehytixztpmuzbrgfvkuwjxgpoeliqiqafhxxzqwaqkjjdfhdafqihrgatkpllzwbimfurffxaafnwkyrhtoxtzwvlcsbubzdprdszbeochwjzoenzahbgrorjgxbyrvhppfpowgscfwokhtcvseokswgdppnkazxvqwdrdicwkqzjrmhqprfnqnjsqdskrmerwzfjvzvkvduyxxvfpdrfaxqikblbysxbqjseemrfrfqasnybjaoaggvvoenzkwdycobnxlgiavkijnpsdunobjiwyaaxquxpthejauvmqjbpqlrogutbvbgezgzyvsneigbhirwamjsjesrlpvwbqkloorikedqjurdwzjugysnrnwjvicxbbuuxlwgorsuxjxfhqjayxrrnosinguotoqauxwhqmjfhnefmqeinzsowfikzwbnvmjhkgeiuktmyeobawoyfudzrrengdzaoaymghnpcqppppiplplyhntkvgrnozdcjyyxjfcftahfhhqxdoosgvkfpgtmfktwcryfvrnwmzfqqiknjdfmschljobthsdruscyiomnzjzyyqlloalzfnpukffmowjmmwazvanyaokrzvtmmizeymptggubgqpfnfsknttyplaazfqipegxcntzdtgvwcrzzgemibuksygtzmfnykwrttwhwziifrydmiuqniccqhshkaxwrwnreektnlpkushlppxvyklpvqkzbrtobtnojcmrhmvhonaztcgcyqgubovdndkmyygjeheuvjefipsrcjglzjjmiebujidvahygfrrzxycjhsohpxmqdfvoplbntqgtvdsrtceyjldxwlavfnszzjohbgcmmtrswmbguxsgxtvvxdhjaftujbgawkekgcqutzdxmqcizjuzokdenlfogbrwjvmwxavzeqdyvegmcythzmwpilspjedjimcnkvkmezazszqmndltnczppivnipxaqmmtfktstmscqvpvalchuitcfbnjudrihhktsiftwgupcixrfejtcypvwznklbrjzcfbsxfrzfdrcjpyidacthidrmeviyrgxhiqbmbslwkakodjyadsienybectjwfzfdyhkjskwrtswhwaskjeydbqznzlaskhigxpitalsjwykfjsfqidajlqjwbhhewpqujhzxxxiixplkvadilvkuemkazugmremldecjdnmzhhlxdvodvwixsqxbhmsewkyfokaohmwhejyqduygsfiuugbavzkutnyzeeukhqcmejgigtmwkhoeecncflqajgemsmguchjuuewfigxgwzzeqabpxiycttkvpyiyrpxpajgrxojvcmecuhxcncmpkjnnsckvmgmmnqlxcedncdzesqdybnaewhtrboyyteqzqcynodecbcofdelmbuvyamugggiuatlgarvvbqttqkaybufjdeddkcggudarakcyjtwgsoevftqijrzxfzindllazoqzunnewirwpkrxkslhddtwhbgrtysqbwlgpgcqkazxhginpqipvfgftbbftstbrzchimhbncyzfpvqfdcocchnmnomhvnfhjabwveynngnfqiypsfdukvuzxbjxyizlvnvletssxpszlmpuztiwbetuarvgkjpaaypklztichwdywiiorhrjwmbyniuxgrbbgqpuzboqrpyxyjqlnymnpkmhlsjumieixgcqamvvgdtqypbsfddvyxhaxesgivauozqxicnqbvgerhbwwemcexrctlhjhgvznhefrqkjqrfzwfblnzmaynhqfqtqcltxedtkbrfhtqqhfisxldiagtuhotkzbvizvxlpdenqxwxccgjobxihwfvmwactijgxjyzibsjkxkqoghlevbwntkuvxleatgkufrcedgkzdbkrabwlpxygmvdroimzoltxecttqcjibgqzmpoftdttyskmioofxbjavzqkadmagbauwgtxvolvainpubenupugbcfpmzcqtixtvbguroxxyuygelneaknstaamwllhgossddkfkkngljiefztguootxlwxceetimkhartyjbuhjamvjnsfsntguolbibktsuomibbsvohrudhkucbyvudabmgajydlsyczernptqwiokwwrovdljsvcysfyrrmyhocaarrxehbkshupkmfosxukekrzkpqobphygkacomgrvpeubaqtsljbsojiuosapryqdiakcrzvoflsesgehrjyjwgrszwndruwfvbopwlzgfyukidqigkqkqzvvevavhevcodqsltfipdnpqofevsnehqcxpzaysrszbrvlptqkzcfsivjzdjemlwuttdnuhncdaxicnpaxmvpdubuubpknwweqylfamymjmheyqqwiicnvawzoincwcbenbjaxmiccdwpfjxsvwctalwbvikizzaaqgftpdcirjdycuvbqxwalojpwdbsiznecneeuoofiyjsiaidctdogibeonykvjnofxvnkchlyzwtskdmyozppcivwdsdiadfosevpqkeurqpxxlsvysvaxxfwdtoclmelhbxezwxgybnizngoaxzextkupwccnzrxhwjynrboydzjwdruspboevoeejdztvhcsnemuduwsfyexbcqgbsgidwhycbvphrewpgppwbniffxhdxxirtdwwmgjfujuegbjaogyrxujmmiimacocgtbzoiwxqsylmswmjagfrszmggmtuxkvhcnwdcpdswhpwwykqbthsabmprvszppoxhnjpdmvwiagvubvymjfycoufoswoumolvzbdlubtevsygofqsvcnczjfasovdxrfredjgjsepioklllafwpdisodppjxndppslilqgvumamkpazxngayhpabdjpfzjfkdmpuqagdxndxgpczfvqiqmvufbzlrmqncoiheodhcebuuiopixvxzghkbcfsrlphkdvzivkswfjqrvojajcjefctdcrwrgxlueaqcafodyzwdbkcqoipcaaqaqvbmppduevenqvrtfepwqoluvmxgftysggpnauqjqqqlkuazjbbjkymzmsgriinkujphxzbyrkcomvhxxljkwsqsbjwukqmskafgdqtgwqmeevahnbgjmlvzyuogljvubqjyvrwjyfpgitexqoaufqodimlxmcipbeurowlaeghrczywtsortjepizgjuycovvhcbcfjinbtjjrblkxxuwtyredsfrzwjmqunddbmygukvtlbbrbuoescmstpppliraurprhmygqmitigyyawvbhnahmamkwhmskrlzmvaxjmkbwxvucwvinghpywwgdrznrkanhamsvrlaryodxcwtpcrvgawoewhzrkgtjjuuiraqunsehjjlsiqmanojfxfxxolskzrzlyrnytsdhiznlpwiqfscnsaczjjxiyywemkeakgrwalwfmnxmypdnuiqqzphxoyjpttkowmtvazizgbssfcdzijeepiyquzqsbrzrtttrmazzvjvmtwzukbsyllwpofgartindcnvxlepejpjwwnhcwtaqroqupmacrfqrtubsgqiagufhcwbabethnvtajbedyjgezfanwldxsceattkwstkvvfbxyadslzczlcbeoluringguhmwhxckdbwibuogtamfmkdqbbnijlzdcntljeodxkedrtoblvzjnufefsufrsaxupiabyayysqzpvpjmxbjgfsrqwukvvbllwbvtyfgircqyvaxivjoosddmzxsehnpgddqwxathxwbvalhreomtsbftejhzmhqjqhlaywffrcfrqoerbguugvxdrbzxxsunzmgmalqbdjfvczgksotlioyydqyjkmnzqvoatalwevlispnvpsarzawunkoavfkampxvynxbpgglrthfrfdwrbbnnbbmmvnmzstowuxtsawuztnspswnccamcucjjpoovdvnsbhrouiselwkozgyrxdfyahhnwpyayvfotgvybvggosgelmtippakgpqtbxehmkwbmwehquomaqpsmhggjzmjtbrwptshhiisfkojiurwdpwkvapsykrwsaugztfevnbytlwnwixdbqedawleavcmhrisopclbplqnxfutftghbompivskeihedethncfihkyujbywdgzbwovlybggqxujztwhfdvzxhuuzfbucfliwkrxjscxcxceifyyiuvxeualfzmioywlzhyqoqbefgyzsjhfbwbjfmsxdijlbmpectugedfyfgwnceqnzoqbsbazrrrxjffiajshyrhkxxnrdtarrqyobsqatcttbumhisilfgqfrkwdmdcdpeljyxijkdoozhsvsrogufgodvfyzopodpynngkqvuyzscngtxxyxqjvdfmxpnhdetprxzpwajgjjjtvcwfcxfxoukdrrujevqxlzvvgovnxmpcdkbldlnrzdzvylfvrfmlpgsublooeuxffbdjperqdxzplwzwyafsmqhhafefrkjxjgyzogciuiqscytxdlavkqmzzjmrvhhqdcgnjmznsfjguratgtfiohuqmdmxfnyklcxsaiaiiupkpptkvjffcesczcqyiobckajiqqfpctnzejgwffyqhoodfcyxvsjcoiyxkdvdbvmxcxtqqlmupxgnnthwjvdptyizdhmvendsqfohpodocjvjxhbhaollqruihnsrughgnflhqplvarpybmggsahmeofuajjezgqmyxxdvocwiecuyewpbnyqpcljehqjydvzftcojytewbwhdwylkneizbudiewtcbhudwrcxuygplojqxstovszpqgrxamxruzzzaxwmpyitokjvcvteribiyvrmdieagtmovboudcjfxerwplrphlisineyntcpvwyqjeyqtjxrpkchkhogshifujrsntmhlvuhuebetgbfgqdbxdjtmdshifvpurdnuiitbpyrqjcuuwtefvhxjcoylwbbykmyfzfxvgmukhkffccjohdaucvljicgwrsjzxzmaeixztrqtzgdjkeeiifhjmhqkiwnplkvtgikiznnafxbpougjruwhshggfjidvmlfgywyicgmzccqexyrxhdamvootnwgfvvnwyxlwtrdzgobgtrxqgvxmaeoxxtpkzhrhrjkhcyuaecosyxdzrskwghqrvwiifqwzyoutqzwtdpqeenhgxocsnqlyufrwbmkwbjpnxtgxgaiwrhenyhgxhoyrwoexnalbryyeopuyovwzoznjxyphovaipargnrukzhppiqbtmkriqoxqbdjofythyvxqnohimnnxspquscqyvstacjheopvfwujsuhzrueklehfgcyyrdbiqgebtburwrhdynfyhzakghoefbrstwterkuenndfufugiwtibfumcedybwwsysobdbghtcdwpnlkdupzzwswkzzkfkjqgqrvorpuqvxrpkthonlbvxjqoifussmtgxiyaarsneithnielmgmxjykrihvkkusquxhqkchjzymnlfwgoszcvflpocczziibrpvwsotclphncxrqgfqrzedgmkolawvwmteapzlgyqnkiqvslzdmexqmtfglycnuvvecmyydnwxertszelgpvawrfthqtwjkyeoevmdarscplheaxdvlegbhsowjucwjzxtosbyajvcvpvrhipfdiuithrpipxgyqholgnwzsjspqbfqxgbhrzvwydzebveldtqoblzktdyxvrefvigmyocjfvqqjagbikzalaasqogzxjkxllhhzqcjojqjegiypfwbrekrrcfbkttfzilclsgrvfadxgvqhrevxclglctathkqjqoyksnldfnizsqhksgrwjuiebzvlynthrmspthznqetapmhootkbtetphwyeubcuvacppyiqzeqjqldcqbtpyngyyuxdcamgmseyddinhfrfpjryvwdvnmgvtyflavmjewwusgqbsqkippfcrwxnxvadkkrgckdzzyeijwnvagqhdjhshbiqgnbeplvidkpmpsifkpypuvuqroayfswqcftytbkguxhdfzolpiqdodvkjbbiwrvnvjfyseaktgtnybzvkacodfxqdwzegxhgsrbirxjcjdwichflmyqxvrmzebuhxjrfqnnqtrhtsgnyccswugwxpfccxppowkmdyimntymkzgtcpbfpsakrqebtkdugqnjanzcbwtakacweapzkckrqeishyxgegzqsnpavwhxolirfeculnjyoekxknpsssyazngqdufpuvebnljjrpmeexchovccgfmutnkbobsjhzucmjmhxnpvefexfxrsfgemdioaoiqqifnlzjsbwdgmagxejruazxbnthtpsqjmlezqllfwfnvmjygtpcxtgsvpmmonmkiplggwzyfwfkydaxuiooxcvkkdqyqahvvqqhcbekvfcxssaxxkfbcinqzbpvxajujpsjjzemfngvopravrqqpcmdsatfiyipzvfpfkovkbbaxpincdhrnjreammhdumjwsinxjfasezucdjdxwzkjenlzsbfwakrzofyaaulhflytwksvoxtntfnlfaadhfritqpgvnvhsiqaqryqezvprvqtepuoqoqjbfhdxpgadlcmkdpmjbdllalgdadvylrcqucaeeqobqykyarztmrulsledmvstlsstagxenhuabmxexawrinycmmlbwfptsmxdayttemwpuyygygoqhtefckpekiqwmlchetjqllndgekfhcrekjfoqluomxyohywqdczkwwegfsdrdbvdkcpvpnblhizueylgmvbjuuvzwcjqgpiquzkzvutabwbxqdcshjsshyoxirednwonjmpzosfjfzoikyrllnayqthvzszykxdxjhchcjscqidaciucrlqhwuhstzghmhjfltnwafirectyeuczswyhhbcmgmxdjmpkndgagatawgyftuhztwgeeaxtsyfqbdrkjwmqocozovdyugokuugahszpjkvxrxprgawfqvynjyzmqjjemmdkyajeiukieaizdyahrghtktdsvamviqjykjreyrvcehmgrnzodsmkktqhkmizldlbxlyneoenbaxtugauwhjwlevtvqrzoukwpvntdifcpxhicxpryvwpvtbcnvkhtyuqntqewyrlwatcunpshlnshlrjwvccihrpcljawtrtkgsulzdsmwmkpdcascfngmdlsjkaqicyfngeyylswwkbvbexbppbjwudrtankopldjrhdfjpkvyjtvlytcrkslahfjqfgqtdcljtvzjoqgykcurrgniworuvrjjirisuthqyiribyhwywqmlcpsscumqtdtutulvebdyvskohpduwudiuiwymczrdaptpdopawzemaretrbycylpgnxlqgpthqxdtxvftmgicxhxffgijwkbcrjuskfceuavuxpqdhzhaovjxlxebwoeivkosclcqmkhdkmdfrobnyedmhwzmtjmmhiqbauztsddoyvcmerpqefghtvemfocrmjawlbmgofuscohnymobybxjzlykbsyfeymjjulojjszervkfgydxpgycklmxubymjsoklpcuvyfpupdgwepceokmfuoprflqwiudqvqeznfburympmfbgvfwnpmyihqjknzgxiacrfwchfdmsxzvrpiufltaczfrgnnilmexfpodmwprjbjerdluelsevbnycruieaphaekmstiszbphahbxpqvpqrlyxrhlvityhqvlccpvvzuhtpgzqujaslnuqyrqoxccydlepbukcrqveeyljiatsytkfnxcyzrqqepzuppfxogactndrpdsnzcglhqwuiuiklgkogwshtsdzlunrifswaywphviweptgyptmmhhcunbsqlwxyfvrwmmvhuofcrirfaeblhmdztyedmelveosuapvuptuxkskemyyrnfnvtduowlgmueezzxlkjrpfulcuwpodfwroxfzifoitridskjothvemnhvrtwckkjasrbempcqgfjopljwxvtjsafyiyilhtauprwbjswshtopstyfvsautjotfmtsocooknsndnnmcsmkvpornoaeuulebjtarfznvxfvnsjcbhrndzdmqsymzsnqzilqmcwnyjikwtgikxaoyozalndzwgpmlaocrewczjziyclzbmrbykrlqinpubacbuhiyibihsxzntvsdigqjjdvyjchjacnsvpwmamatztxejmgxjbwqyqgykfvakqhyxkohdxokzwsdkckwiudltwdaatlpfvlvyyqedhofnoilvcsyvfvgbwxhpqhxkdftpwqzgfjvmrikvhqyluxkjduhnultdvllnmnkmvttmqxdflkhgdfsdzlkhtrolzqflvtcnnwxqxafozhsfodiihrpizcbuymbvebupbnrmwujblthzytwafmpmswxqtxxvnqxuglpaqkvicoolrthitkfuukfnbrhlissubsczaocfsrwsqnlgbpfkukcdvcitjrorwmallohcgamvlvibzwecrpejcykoqxsopwbwhowplkjgspevkolhjpmhkbyqonnpfnpyvgjtopggmrtwvzaspvaqvabxnlgrodtvglniwrsimikmqvbduajmozjatifxneuzxwcycccnwnyfxabhdnbwuumpixzwtqzitnfzerpymqylcmbgzmjpbsmyiyzlbmijxcxllbqzfwvukyhofkwphcvaekgytatyilzseieqozupkyookoegccosqidspaqmdchmfzpvsfyrnlqttlesygrxpdrjkslimxojgpgpaitwdwqyrwffoaujwgljrxfsgzmivcvcwenejpfuzqtrecjyuefjidhazrknfkgngbeogyuekfqyfchfwufvsadtukbicqkyksnqqvkypntsutbggtcsjxsnleoyqwruwrzdxtksfpfhqpiyzfrlffmazmgjvrqhmsvjpelxhzuywetfyesudiqecofrvjiaxrvgqzmdfvjnicgagbtgeyxtlkqfjsowfvukhelscaacinhzwsguuzbrmaalesfncuktohhdnlmuomfktxvuxfaclllywkjbwxywvidwnrapfmaydfdzfndcalejkcyohklygtsvkvujbcerrofhxtlyaymspyluyxbwppbpsibopptscpkhmeavfnmmgcwevcqqempdchhjvfjjcjgtlzlutundggcsdkowpifyzejegykffwlrxiaowyqvzoyartbxkfjkryckfdrxrheesbiblmleiljehuxwjaszpexabrxkaojaivgdaumqfdffrhtkzpfxwqggphinvkamuxzgfsqwbjktsbrhakuyddytdppixckussjmjommnpcifktvoipwmmrxlgtyoiibtoitikneadegvvyingzjpnaeepknvolxijqmajioevzuokzqcmlpcizimixgimltyveyauegshvifqwpqbmvqkzabwvpxbveqbsercywhobshndrfavorbkgkuxmcdbyaaohxmvlwxauhdtbvdbipuukhklamwddmkmosctosurwarmbmvmqhyuwhlqibxbuntvbslivnqwgpkezoausptbxndutmjugvgsniwgdakhbvcjoigztcnhtabxtqcplljmalziopbhzawuovnuhwalczytxascdwtkwwkfzkitotkzqodqehpfxmbzeetnllodmcvcgnsklxkbitiqkaqzqjrbfkbzmtrbyiaoouiozsazcqcysoztetcqxbgewfojztnnqoackzjzqtiqcqxilhkrudcyghmcvqtsrxkfljpfcwjdndyqzxcbxswkescndrtoqzwmlrtkctgmgcpjpjqtwlhkwtyryznxubdfcozgfwvxmalxyxlxmupvyvbatjjkygqywpjxlzjdzsvlvwtpdyjgeixrxkcprgosdfdyibbantvalsglaaojkjjligxkasqpkmyrsyeffsqcvxxnyzwgnqzdvwplceescylgcqbvtdzljnnuyeudcdeqqlqokbrkwliulhxkoacctikejrkfbvoxeijisbfbglmopocjzuizrefrwwsblchwzfcqcziwwqvwcnuczzjagyldgbvnxhfztptvjtzafxuorepdpmqfxyubuyragvclstnbfvpzsgwpchyfonwdpcxoxlexgjhxgqoierllasbqgsrojcxcpcfrzlhvktsruprnguiisrtyvaxfdpfwkrqtvxzbodazfwazhynvytyghlaxmkpibafcpslxsoqhslqgjyxlcnxbqwtmlyqdojsmpdaityfykbywojermghyduquepqmgkwoooroointsduqhthmlyatzwzfbbykgwqbcwoaxpnoilzdppkajhylhyannwqfqwgctciuaojfckkxxzwbdmzlgxzwonumndrfihuelplnrfephlagbggebumcgzcgbutsqdhuloiwvyhcmxafirunzqzgvaafjailxxyzzsoyhutqhhclzflvojwomkbpbxjtrbpxalydfhlexxncwyehkogpyzqlzkkwgzgwcnjuyfisdohrprhwehtpcskicyfqidjvbakykwurfkdqkinkeiparmbvdwsyjyispdmpeaoryumvqeuwgpqxtbzpbivhnouqnrjastnaabvplbwjtqabmqvjwxktywnjirxennzbqnedwfzmjwlycsqzdqrwfjpkbtqugaxgafdeevwaexcfnhnqtuidddfxjokhfzkwrvpoiajxyeottylygkqwntqyozzhkxjchxmncditqzijnoutmtqcqpbfmszzezdbepdcyfgqwujoesuwjoviowycdzvkdgtybzhusdkwhxfajcbzovlzshukvqzcazwfswfqejmninnmxaorazdbtotwbgcwwgwufmabykunjrmgvparhjhwqocpdxrrufbecvmiyhiuydwyrpcudkiglbxhznnitxgasvkcswjxjkoegxgshokjbzzsriwlnbqkyhexfltmjjkoopfapcksxwpfimxwfobiqjgkjqzhqasgblinwxuvsyndjhtkeqmxfizvrlltfxvoezoxoitftcxsujhsisdcarosfrjyjqonqjvfclutdxnjfffhkhtgugcwjccxtkrffdpgluspdzzcdepvudqcacmumkkwnmlowissyoocgrggqjehwljtnceclnuizfbdkyyagsucrgxydpabjtghzbfvpplrqwipbqpbswypoamasfutrvdypbcrqswkvoyjlphnkkrinkxzawhlgsnaxywzmoombjuykrqerqldivdlxxpucpkpuhckcesqzcjiurcilytijadjaydmmxbzzazepvsryabajkswzucwmqsiggrzygeyxxpqkytilioqkkyuqaqwpkujdqushtjjyeemrkyconpaghsouwxsvrxrjcskdgtrnknvdelwgjfkuvzknnyxdwjztotkrmxaejwayrypiteyocynkvzjtamlycwrbeejucqghzhjeywyrqiahqnsakxdrpovobqmperkbmocqkvemiokjxewkcgtmotbjvhpnastsikdqyaszrcsdwzqtxnwtsodzkqxtzdreaanlsgeytkbykitnmcyfdfkghctdimilamuqkdhiubbodtqidlnfmczoxgucfljoazwoikvtgowkxwcgxtfklkrthtnjwdlqkprjdwwivdzvlrvpojjqnkdotcjbbpymkvyzktxijlfesbxunzbajqbtaiekwtzrktdscwwanijcmtznywnplppamddtioenszvtupqkpobiwhfybdwjlxzontaflsqjfwxzjtggdygspzigrfzfzsdjylkitlgogjnaalsxrcnhvmurvkehfjblrtfgqfgbanwtvwutatoaraaqcblkjsurjbrbogtijtznqqljxkriufoaxytxehqkymllrsjuyhhnepwlwmrqarjympvoesljcqtrxyxeqvepeofshghgnnxzecsqdjsgmzynmjjbzupwmaavntkbagibosoetetwmyofvhpfwpbloxfzekwzpmrzsljizezmerdxzytfchdovfxhnjxbrysumlsmjgqylcmxitocwqupeziuazbxdnmpmlvxnyinwlatvrgcnftrcfsmmucpbeaofoudmcyrpnpaginepjpgiomtmenrpfyobgrywisbjqtzoiufxryrwkvqfzzihbikviqlwqlwpjgwumielxtkzvnncfhcssqixkqhollugwrqpbijtsnxcxapzzahodobdeimpafagmgvcpkildzbbyhqvsmpuvabbocvvkvmzftdivfwwbtwrzgdshwnswpupuphglvxmxvqhoqlzqcopxqqhibrogtbnoxflowsxnuxjcnwcngkueczphhvxmdpwizczoldawzofdqhcndmhcdumleesjugetvtlndrgociseavtqkaaldtevmapamlkmfwwrngwfjrqmqdieqskhlwgwwxhqjbhciwwcnqpbztncearsptfqhzugibzbbuqkyvrqsaplbwhjhlrrhwcdeljpupkjoliibcsfiromlglctxjdchjlkhxwjdbwxqbxmqbaekpfjblvasreifqabpwaxysjaluyloblrtlefdaiieqwfryflobrtnskcbwnpkarijlizlireliognzvsiyjewyaglghqvsircrkxmykgolbefmskxpquwktpwqacxwghaegvpprtkxwrgadcjqczeeahqtrzcqmkxuunvfrzlhrysmvtkvmimmnzpwhoxrurlrvrpnjjxbftglcluipemuyztoyxyogztcoakigxmdbczpixggagvuohsssfbhmycezqcnjpayoxgdpmcudmamcfongfyzmxcilrywenntvuajyagrjelsssesjvkipurxrbfyuvjzsptrlkfcvucrkwemsvralmxlcbmlcjddudvrjbpfkdcnhrplolcbinllzeurlaaoomgavjzyuxtscqgabzluexthwwdqfwtsfdbwkecwjwunutmxjzldruhvbvnswddrmcihlrfqqodpmapniqeobbrrriiadfrfrdoalpmrnfczfcjxvwvvosyqheecmgosqpeunymsaexwtwurphioyjeyryqmodyjakjroywmtegllaarviepocayoptdnffbnudwjrlqrkqktctxkhgvckekqjevxvcqpwtotbsgyzbnyvvfuyhbumryjrninvqptkkgketytueuzjomdaoddgdudjyjhnkkfzftouvkpfznutbnyvaxgzumbvqfpzrycoduxngplhilswqlexkadordraemzgphwqztxgsokpmkenztekcsfmzzjedwguztkheyssrttwaxnzpvjooshwbkyrzheoatmkdywyfaxprnxhvloxkivhpzpyuoomhjdbzliuuqicazdmpoeywjhaenruhcllkkkcbpgvfzmigusdvappuuxtbnjwnxtdowvkqvmiinhnkzpgpebfhdwuficntxhdbyutpfzujdojipckzefxvnfblnxtxfxwhulwqanxhewrpkosdeytojxqijkkuzueuqwlqrqmbxnxojyabwjrecwtcwgymxdsvqajclsjusrzpybwuexhgrfmwqypuaxxistasfnyllgyhbdwnhbotagqcrcbulsgduxxlhuaaesyypbtlhrrritfaorpcnzoqsvoealekjabodcawcmsecyusefzwrrflrdtxybbeysaemjytxekwqfmuujluvttezusqebiqccfqraiidhetffveuqopkjlkuoefsnqyxfsighlfgdqkkgfohbbxnyqmhzxfdkoujczyqzrkfhgmyamwmceqvgvcodjmmtgafrckbkrojskxfldsndvkegritxdsnvfiiwxfvpwjvioqnbiasxsgnmacokqpiclrbdmtkqqckzejxhlhofhxdpgptqrmhsdpexvpywgjfnbeqgnvprvtfqexwagwdsqwdmsaerhkbbqxkzhiqcltvwqjqyuplayakfqqsmzmgaxcxwclwsbtiydfctzxxzqfsvbgtjsdkjmyuniyazshibbmwjseagdtaysqdebzlojovxeoytycjyhwjbalhcfjmcrtrfmlydsczdhcskqwxwekoglrracveadsrywrcdxvgdcrllfqsuxaqcdufunoudxlxrsuwicnckttgsfmeueqxtuuxouoteabbjjcgvsechdqxhytteeqjnhozaqcrdemjfzbyjyvnryzafzrevroyuoyvcokuarapninjophycsungelzmwqqdjebcnqgghsdjtklrqauhqenukjjwqhpfobcmuqawnysyyvciytbofqwsyoghantuxvukvzwyuhatpxxtypcnphsjopjcriceaviedzztxkngfngwaucbvyerlczsaotqiqidvtjzfwlxqyydsynqhoxzxbievzwvkeklrltsmcdhnpqgxuojjnpckrahtuenmrwfzazdxjkzdanakcxijvlsvyymbetfsuagwhuhkzrimujsgcmtypidguezhphwoutwzcqecnfvyjhqcxutzrvysckmmuanbmttxepwxewzhyligbsznvyywprfaofmhxvuyekfkqzdxvhqpzxcbrgpenmwikkilcqkyewubaryrqesiljvharqggfotyqbvxhmxemptboyqazdnrkdyzughypwmtdtnrwgqoijfnwohdhxhcgdnypyhgccwgoydjvucoqyvdwesqhiipyhsbfnogoorwawvjyuewlfkazfscjrptqbwdecjobbamaoudabelowmtuglpyemklyujguqtpqyvcrsdeermcexdcmjefeawchqvlxptmumpknzhqfquhbcwonzttocykqjuibvwnbrqwivffxusecizkxdughtshoaobhqucapxkplvrvngmcxncpuzswlzxvdnqocqjiqxuqaslsaxjeopmelkwcidbklsurftcyzxjxwtnkwptytfcasgqdmgbhtihutxduglzrgksujnqekzprsqcylcevlyuwdcpkeujaqmjblksrtogbcdzuhtdnxnvkaqlqfpkwkgudosmklrbflsmchgyzjpougoukzinmarixslkmhkqfljyjdktltkweklvjisjjhuxwseocmpixklmjybxaaymvjwsbxgpmtjasdjibgwmxplctoejntfiyvmdohyztzxjnlcvrhpgwkjwbzybwhluwjpyxqxyopkuebwzbtpaenmlwnvfrnyuqbaaypyxkgqwdabfnpxylnmrdssepxcuconhoxdrodzojicjnoafhwibrvtvdenfzedccznecjmwefpnjspyuiatrwksfnuieyyadggfsyjicnrtpnvbojukbavdkucilpzqxwqjeqkcujgakdcqpgobypxvcwbeaqtwymsfktkdcravulicczdltmekhqyclwwglbvfrivlfazrwjcixcacxzkfztyioywhshfbxavucuibvdzbhmalwbwbqutktvxinuoqfghsupwdfuyfvjcyzubzsdxyslwalaifuxfwhxaufiuroiylhgjoontjzsoxbuczcaengcodfqfydbzdsemseildblbexyeaxxmlqzreevdvibtgdhjvwsosjejdtovzokqqotdgzbfrytpcvoscwylritavxpbkhagxgfisbnbgqjgttllmdevdtemafpoyzymrcwjzsmclplqpacicssfeqccfoasfdgbolhfvdkhjaydbxgeipgpxukytfbieofdrusxzcdwpuanbpzniuyjdlvknrcschkpgbtyzoazdzqsjyblfybpkngmmhxrbpiqdxsthgouxvqwoqyssyyjghdghnsjrnftwejoegvokkwzyfluohjxzbzzltunjfmmpvtrzhegbigakgkvdgeuqnuqizfmafnyvfqialgzbnsoklipxkuigfdzacxahvtjpfdaejksdbsrvubhphxoshlykjolzxbtrmqhicgenvcguzbkcgwrrxlriqmaemyjoerslkpjewvphgsidmfgysdlkcfawbbubxxbwxwaogwbiajyqhseorhsofjcwoifpuzsmmdzheuzhzqftqribuaqcwnubblsdmoedbnaxpzaiqfjfvkpgeiwazgufridmjezxdecilncnwpptaawioxvoguoiwvmosfjbkpuxhvnzwixceemzcrbnkejloxmmdnspixzpmgodmgxppvoymxuqhuzgznlczcomgtsjwsikbdwchridnifgejuvthabpntbhqvpgiebqvsgncxhqmgoiitmpjxzgrtrihnsgygjeimteezafhuaaufoiiasgcnjojumpqnyoozszdcuemergxgcfmtxczjjxsqilivnaxvlzbvidudymcjudhtosiaiqwgivcszmadqioxzxnkuixdfmdcujnfkfyezpdqiveuhupwdbwfggtchaykqccdcdnpdsaihmhsgyedcceexssolwqssizwmrdubsmvddhvkhsukeomlgzduvzkbkoibsdondgcnmrddysegroemkeujjofwnhjtmwrgpvwxlcvetiwcavelylgghjcwhbayluvjndfoivtpyfswcrsdcwdlsncwbgescjrtwicpyzvgamyicjzsjrhfwswrfuwwbezppnpoleerlcwhsklpnckkrauyjibbbjnikbgerhfneojbrzoqqcfrwenizlhyxmydlpdocwcvnhqvyewzpozffxpucpxeysdflnzqlfnhwnjfybwoyojvtcdmunzcttnphduphykqewcfdhkcwtdjwtpunuwikzjvzbbwppjevzeehffcliapawvxfloygbmwfmdqbhckkfitmvhvszmaakripmchutvcvrffbzpoywyxrokpnhqmfdmxnyhjkoaiebepiimnhzschexehjrllhegfihgqhbqssxpssnesaoounrpmdubgsfjrarwytxntevlbpmftfelgxyvxxhedybhmndqdkvxpjakvkxyweqelbyepmdmvpnuwdqtxnpsqjezlatqlkctnibexajexswbonqmgaqhrvkbjsfzrnunqyxavpnmylsizpsbqgfulmhvxqjukiqsxyrshzkgfumpersvmjrczpwgcipwogdeuuvhvidfdqapewzcvbcmqfpmkqcudpfnpksfdtykbwmxspebedocmydqjvusdqtufxvswjdkpildkxqrbfopwrcztzcefwhaqgrocflultpchcijavkiayvxtfcocfoqgabeiwpyktxbwejbaxodpxljlwsjqnodjjfasicokjppqfxieenjoliiywvfboioekuigfpuwpslfshmzpfdqrfusqwndoabctgcchrhhxdloolbtlyowalxzsdvkfzdponixtbxouragcqzsnwdnumskewhhuxjpvdjtrrzgkiosbqcrcnacweqcjbnassomfsvujuyrbsjdvzxvkiveaesgueamvqveorhdezlhgwqfhvyrajrcvlonvqunnngvcjrrrnmdpdmsdmhdwzxdpbbunwtyqgzzmvhmwiberfoxnwrilldkglstfenkmyyioeyvosfifgjcevbghezoeknbbfbyibyhqjwkgrhigbqdbfkzugfatqpbjabsuufqlftrbeajibefaoqpopsgcqjmhfdyabtnfcyikjvbgtjnczhoalclpqkfdaxlhdmplzbuflbyvfzimrxqeuazpmqjgehpsnyzqqrfrnrbwrzzwgrnxaslgupjropdcnwdlmisozfqtzzkphhoydazvwsxamxwongyompquzcwohuagtimjhlwnqhnrlrpcwyflxfkltojrjaeqiwnjgzpqyqvkpqvdgqgrjjymibkyswyaqaqappbqdzijkiwxugwwyvqwxfreheftlpjopycywmhksilinrkbpgmrsmvqfcurmowluzomoygqdqhozsveqrtbazhzllgikbmmzdxbjmxhgxlaadjomcievxehtfomcurypvgicawcbdzqtpmsplowngnzaudssaxqlpqrkzegqmgvxeblwcufduiiamxstmekudjuqhfwtjyouszyycghiwamvnbniqdetnxwcledqflhizjaiqqvowkalijcwedluzcdlrcebqpwrfmezgpgimdtrgqvgkzzxtpunfdzatbwrzqzpxjizoeojbswxfkcfcnggxfuuucpwthgyckuxyuuwmwbpfdbcxwgqqaqdepadjlcapyqusxwftetokeskbfvaqzggugmqlldgztylxczitykiylfqshscdtomgedtzvvexcprnppcvtfpvtzurokcniknsqjwcumndewawrmzuhijppvgjuuzjibijvpyhvxhwpmxwttjtgjowdxnurdxsbyzphplgscoscyzpwahbbtlxuefldhbvsbxrlieyuoroyegbfnlcohflgevrnrtnywhujofievxnjoiskhbyivvyptnxkfmqtensnqionwvxlmhcqzabgbvbkgqqforoqznurzebuzpxfnphhtipjcxezsljrdvlpxyygirihkscrwjrtxzkmmnrfohnwyazfdhianoucnewyeycpjhwxrjryevvuviotdmatzvidhftobkfznnjzxqvarbhllfmbfxbxbhrhpycejspuwbxtnteddydswdxhpcdkqmuwwhngfaswoxquuzfxjybxetvvfhqpvyvrfgmuyixwuotnicvyykddhocfkyukouiqhwllmvrvnagxsgxohaalzvxpjsvuilzqawbtltjlndqrxlitqgiauutgpxismrlrkpksdmzsvlxgbaexizbxymxsmnsjqubfiyrpjqnrlxrfkrrplbbcltlqigpkztplpuvevvmebgvupdnuunswuavdstcjhhdqifutjpikbrwzwmmwkhpdcflnmritkjwlzvagxgympbhxrbsxvaprmxllfvzfbrpympvtoxkfkgidhhrfrybvezxeifprkaiyomrdubasdomihpecgmmgejwsqwvouodqevexlsllovwegvvrdbapidrhistnpzeohrwdywpcmlfzkmcxykukghphejhtfdrfvzykajtawegghhvcbqytgphtbuwmkzwvfktenjtmedxtblgrgwdxjmuqrtyvqoptsoelouaiqpfapmsykeqnsktevdozdbgzstojgafxvzcobxvpqkrueeztpwwyvlzvrssoyxvypndltbqvsroavpxyzeaecqnlpcrxrtkjhkfxhifbmdrlzgkrzzepgtuqcvftbogghurlvcklcepmcupcmbnhhkbxdvmovqrwvdsrqgsdxfrzhfucpttolskorhuuaaaqmusqgndbuygobcraphyqjmevvnhclvrwwpvidvpdzopzchwmzgowsqcauwrffaylfkhmsurxrvqulztpygfzpqzhqkdbgrdwmkkryxftjpqncbzvqkcuapkojzdogvkklzclmzjigodqjewqfgqwckdiyteacqxalwypshgjqwiqdvkhbxtrlwdnzhlexthcyohnrhnifiwrcrbhgedpgkdzsmizrawuhxfxfiqlavyqlitgeawriawehjhxelehdtwmvaempchpasvlmbvprgkllaefgzwahpkhagtwqbpufzcnrgpgjhadqvlrdixynquueaevzdgvhvvemnhykwppnqtlhlvcousbwfhlgpcacdysjtvwzkniyidjfaxqwhhbpaimwecqlhtikcjfnlvybsfsntukanazzbrnedgjofvzmxsasiqkeelzysboknbiwfovjatfozbcnmgzoqawuqeiuavoyjvjxxupberohdeffawaohysnxqzqukgovjyhvmcjcuefobdwavlbtvvovtnbqboyqdipsexbbngaiejxdqwineutwllxgglrpgfxlusmhxuueiszlblkbioutzieazqmqbesirwxokyaomkpobxkexcjinukjlazcynhylmhjdqzjqejibhaampnknocbyqkrdqlibixsixtjfefodsftgodivdllekbqgtykiltzvpdmdmxjphyzbtdigcisucarrbrqoybkviawpasofnlfwuhxcqbwnkgwiqbaydjixuwatnrpstgnmxkpqahxefvapbqlrpjqsouyyjjwzkvamrepvrxfxpcsztshfdoohpwxrknhaynczxvcjperudqdgsbqjmvdjbavperxmxhadkmtbhrzucwijivhvynsmbubohqsxwrgwyckgktyghniydhfnjrthnmotbdkdmlbopokaufwdzmxdfufsusawpayeyagwbszvnlidzwzmgpgbjovpdpiasetmlvbcsxazwhyiknsujdhryamznbpctialcdsnrascorcfeopamgxwktoftcrkjthparbudnxhznapvlmqzbubnrhjdqkddhpvlfjcscxkrnljyptrwxpgjbjxyqmaegqkprfcfrswpceukhmpmvuveoeobukxmuojexonhdvwttxwbjsvtqyedilbiffnlkqxskybptbuqvooxkmtygtvxmhursisahiubfdlfguubzagkwskilouaalbtufjwlwgbayikmxwmlmepnawnudvzbcecogqubtfiweqfahtkeyopbzjyxytyjmcxpiypjmxrgqijgasnvztdlmhqxnvpexxltrexdezntkxbafufxawdevzjjbcsskdnqfrgekbudxsybgohmozxedqsfhbjaharjgaeimoxscbsszonklgmojildfavfxhgeykhbhhuqhzzuiliuhjdilmvgkmuuadxzmuctjypvpglvwrdumymgsmwecynujxdstgnjoztucqzzkyssnnivyibztuygiyrhlnmxlisfrocanlqigrknfkttrnzwcljrfxwpwfvihgluxkcbgwejnudqtkbueupeyeybsbkhviucilceecnuqbwzykiidqwptgurefoyfhjkhhiujvepqscgokqhhajesthfyswglpyrqofhonpsruqmjwivekirmtdlfhsuuzsgdwbictdyalswwccouajyaljfgpsavhthoyiesgyhpwnkrgslavztzkpbuggpcbxfntubgmrlipcfqyqljardklnaibctezbtksdwpjmddotnpdtzgjsjbglbvmndxecjizfubzzzaezwaiagliyprdwgwkosdumdclyaestbmisjoevisbtigcsncvynkiftveqpruuxzwsnwybphhefcmxsaftwkkoxbttyoatogcftpjebegmgqvkdnmykfwmlueczkvcdzlfyhssdaoqldywnxaxmhlmflvxnpuohdicsgosnjwlnqrewylnjxuqhtxunawkxacpsonyupddkvcjfhwweqvdtidqnwrororhkwhwdpvjtragxaotkcdvhskemhibdoityyxkgzzohqvaxlercvofzngdlahlykfuktvvwbjleqplmuwwwikwzggebdeahwlocroxdrufndmxnxjhzzsqnocygxjihtghoffynqctibnlvpcysebxwrrrggwgqmrkvwkwuidhgxuqmoqttwmdgdkhirgzztmgwwqmonjrexymlbnxgpxafanxpgzwtgjboqoeleoegwpvhhtobjvtbwdwaniuqwpzsywbisxtxoabjuxgnvlsojoarlhkilopaaqbkbyvazocvxveyuuicalgceleildjhhczdbdobcjjnumqrpemnmgghaidsyvwglqwpaxciusbywgdznvimjtjxemttjxicndatplejumszucxohkrvzuzbkbdcnotvmxpaofrpfjszjouiiclfofpprxuvjmwkndvsoubmptmmdnvsslrofuxtrwlgjyqfklbuctexcsmrausuzcudyshvpppemctxtcqbjowwgdortakllugyrqihoyjdurazprahoznisgxmghtrsftavoitpfoomjfzyzxoqvekzngohccurtkwaszznbnppooojaltvujkyukyocgfadzaevjrknppwloujbgplmzxipzxiirlvsrefarolgpkjugatzxsikdhqfllqwblivymadslapqslurpzbbqyefsvoubywwhterzwmbuyrdovmwzrzoveydyefvjxswmvhxroqnrhaneeujqeoyvbdeizygdibioxcvllsnvogoaqjjgvzoqsexhlbdbxlryvtceivzqcesnnfqmrqvwaonvyinfotdirotuztshsdkstgjnlkeflcrxdmutzvqmjkpioxyikppozfninlkithnbiehgmpnjcgomeebxlarjdhjbybbsrhqonztqcctlpsxpcjcuorcuynukhzvxybcnlwglysahufgstinzklwxcnjjdffuwydqholgfhwmzbundqacyspgsnvtvuofdmdcnymvbqilnpenagbztcuvtgyppkejqklzeqbdezbepodercpkplybzomkpdtfsgjtqqsyetwbscdvwfjzsqqusvrorejlfszzuuqzdvfujgsgxbaqqezhgkbxmeimnbbbvqtwvqaeqeneohrextbvvyapgdmkvivzjxfewdmzmdjmbrhbykjgpcjhiclxfhbtugqrrtkeirxdfjslzggpofkobbnydjjkdcczeyjruclxpvdqknmofkqcefcxrzmpmzbytijvgpxwekcdrgjlbzsqvyxkcybdcvywfmlquinwfgyycctonuofqwqecdwkrdankqjbdhslvxfazyxgcdpnqcowlklntekahuuofeydxkzprrkpjwodfglksfdibevqqhtcjdptcbwcxjoijlpyirjemgcdxlkqvtakgudnvurpcpsbkborovppeihpejvhcjofotsjeaiaszvgonnifclwobszhfqotamhemacldpyvesjrqpymgccyjumiojxzmmibsbhtyqwzujajjceswlrlogibuvlkvudqrhrzatpbvxlvkmslbsffjlanzglqjrlxaajixizhpdmbnlzcjuiivhrilgrtrpfidgekqvcavtndwfloqyuwyebptwygpeheboewzicbwzpsrksevcnepmswcuzbmqltlszwoxqxsavadmmndkzmkraiigppoocsnaguzaarenihepxbkrcgaghucbmpepebjwqmaknmubgifczfvzrfpvyuzcplohakqgivnxkwyxzgdcrdmzsmphhejfcvebvrndwwhueknyemfemqsyfykcwcudeqabthnhqhymokbuclvuxuzipvsbrzrvyqutcmqqdsbynnpreqykhjmcocbf", + }, + + { + "xbylisvborylklftlkcioajuxwdhahdgezvyjbgaznzayfwsaumeccpfwamfzmkinezzwobllyxktqeibfoupcpptncggrdqbkji", + "zzwobllyxktqeibfoupcpptncggrdqbkji", + }, + + { + "abab", + "bab", + }, + + { + "leetcode", + "tcode", + }, + + // 可以有多个 testcase +} + +func Test_lastSubstring(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, lastSubstring(tc.s), "输入:%v", tc) + } +} + +func Benchmark_lastSubstring(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + lastSubstring(tc.s) + } + } +} diff --git a/Algorithms/1169.invalid-transactions/README.md b/Algorithms/1169.invalid-transactions/README.md new file mode 100755 index 000000000..194e93ba0 --- /dev/null +++ b/Algorithms/1169.invalid-transactions/README.md @@ -0,0 +1,40 @@ +# [1169. Invalid Transactions](https://leetcode.com/problems/invalid-transactions/) + +A transaction is possibly invalid if: + +- the amount exceeds $1000, or; +- if it occurs within (and including) 60 minutes of another transaction with the same name in a different city. + +Each transaction string transactions[i] consists of comma separated values representing the name, time (in minutes), amount, and city of the transaction. + +Given a list of transactions, return a list of transactions that are possibly invalid. You may return the answer in any order. + +Example 1: + +```text +Input: transactions = ["alice,20,800,mtv","alice,50,100,beijing"] +Output: ["alice,20,800,mtv","alice,50,100,beijing"] +Explanation: The first transaction is invalid because the second transaction occurs within a difference of 60 minutes, have the same name and is in a different city. Similarly the second one is invalid too. +``` + +Example 2: + +```text +Input: transactions = ["alice,20,800,mtv","alice,50,1200,mtv"] +Output: ["alice,50,1200,mtv"] +``` + +Example 3: + +```text +Input: transactions = ["alice,20,800,mtv","bob,50,1200,mtv"] +Output: ["bob,50,1200,mtv"] +``` + +Constraints: + +- `transactions.length <= 1000` +- `Each transactions[i] takes the form "{name},{time},{amount},{city}"` +- `Each {name} and {city} consist of lowercase English letters, and have lengths between 1 and 10.` +- `Each {time} consist of digits, and represent an integer between 0 and 1000.` +- `Each {amount} consist of digits, and represent an integer between 0 and 2000.` diff --git a/Algorithms/1169.invalid-transactions/invalid-transactions.go b/Algorithms/1169.invalid-transactions/invalid-transactions.go new file mode 100755 index 000000000..129a40ca8 --- /dev/null +++ b/Algorithms/1169.invalid-transactions/invalid-transactions.go @@ -0,0 +1,72 @@ +package problem1169 + +import ( + "sort" + "strconv" + "strings" +) + +func invalidTransactions(transactions []string) []string { + n := len(transactions) + + isInvalid := make([]bool, n) + tps := make([]*trans, 0, n) + for i, t := range transactions { + tp := newTrans(i, t) + if tp.amount > 1000 { + isInvalid[i] = true + } + tps = append(tps, tp) + } + + sort.Slice(tps, func(i int, j int) bool { + return tps[i].time < tps[j].time + }) + + for i := 0; i < n; i++ { + for j := i + 1; j < n; j++ { + if tps[i].time+60 < tps[j].time { + break + } + if tps[i].name == tps[j].name && + tps[i].city != tps[j].city { + isInvalid[tps[i].index] = true + isInvalid[tps[j].index] = true + } + } + } + + res := make([]string, 0, n) + for i := range isInvalid { + if isInvalid[i] { + res = append(res, transactions[i]) + } + } + + return res +} + +type trans struct { + index, time, amount int + name, city string +} + +func newTrans(i int, t string) *trans { + name, time, amount, city := parse(t) + return &trans{ + index: i, + time: time, + amount: amount, + name: name, + city: city, + } +} + +func parse(t string) (name string, time, amount int, city string) { + items := strings.Split(t, ",") + name = items[0] + time, _ = strconv.Atoi(items[1]) + amount, _ = strconv.Atoi(items[2]) + city = items[3] + return +} diff --git a/Algorithms/1169.invalid-transactions/invalid-transactions_test.go b/Algorithms/1169.invalid-transactions/invalid-transactions_test.go new file mode 100755 index 000000000..23f7c11aa --- /dev/null +++ b/Algorithms/1169.invalid-transactions/invalid-transactions_test.go @@ -0,0 +1,52 @@ +package problem1169 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + transactions []string + ans []string +}{ + + { + []string{"alice,120,800,mtv", "alice,20,800,mtv", "alice,50,100,beijing"}, + []string{"alice,20,800,mtv", "alice,50,100,beijing"}, + }, + + { + []string{"alice,20,800,mtv", "alice,50,100,beijing"}, + []string{"alice,20,800,mtv", "alice,50,100,beijing"}, + }, + + { + []string{"alice,20,800,mtv", "alice,50,1200,mtv"}, + []string{"alice,50,1200,mtv"}, + }, + + { + []string{"alice,20,800,mtv", "bob,50,1200,mtv"}, + []string{"bob,50,1200,mtv"}, + }, + + // 可以有多个 testcase +} + +func Test_invalidTransactions(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, invalidTransactions(tc.transactions), "输入:%v", tc) + } +} + +func Benchmark_invalidTransactions(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + invalidTransactions(tc.transactions) + } + } +} diff --git a/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/README.md b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/README.md new file mode 100755 index 000000000..2b68a127c --- /dev/null +++ b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/README.md @@ -0,0 +1,28 @@ +# [1170. Compare Strings by Frequency of the Smallest Character](https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character/) + +Let's define a function f(s) over a non-empty string s, which calculates the frequency of the smallest character in s. For example, if s = "dcce" then f(s) = 2 because the smallest character is "c" and its frequency is 2. + +Now, given string arrays queries and words, return an integer array answer, where each answer[i] is the number of words such that f(queries[i]) < f(W), where W is a word in words. + +Example 1: + +```text +Input: queries = ["cbd"], words = ["zaaaz"] +Output: [1] +Explanation: On the first query we have f("cbd") = 1, f("zaaaz") = 3 so f("cbd") < f("zaaaz"). +``` + +Example 2: + +```text +Input: queries = ["bbb","cc"], words = ["a","aa","aaa","aaaa"] +Output: [1,2] +Explanation: On the first query only f("bbb") < f("aaaa"). On the second query both f("aaa") and f("aaaa") are both > f("cc"). +``` + +Constraints: + +- `1 <= queries.length <= 2000` +- `1 <= words.length <= 2000` +- `1 <= queries[i].length, words[i].length <= 10` +- `queries[i][j], words[i][j] are English lowercase letters.` diff --git a/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character.go b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character.go new file mode 100755 index 000000000..89777af68 --- /dev/null +++ b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character.go @@ -0,0 +1,32 @@ +package problem1170 + +import "sort" + +func numSmallerByFrequency(queries []string, words []string) []int { + n := len(words) + ws := make([]int, n) + for i, w := range words { + ws[i] = f(w) + } + sort.Ints(ws) + + res := make([]int, len(queries)) + for i, q := range queries { + fq := f(q) + res[i] = n - sort.Search(n, func(i int) bool { return fq < ws[i] }) + } + + return res +} + +func f(s string) int { + count := [26]int{} + for _, b := range s { + count[b-'a']++ + } + i := 0 + for count[i] == 0 { + i++ + } + return count[i] +} diff --git a/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character_test.go b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character_test.go new file mode 100755 index 000000000..a13768e6e --- /dev/null +++ b/Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character/compare-strings-by-frequency-of-the-smallest-character_test.go @@ -0,0 +1,45 @@ +package problem1170 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + queries []string + words []string + ans []int +}{ + + { + []string{"cbd"}, + []string{"zaaaz"}, + []int{1}, + }, + + { + []string{"bbb", "cc"}, + []string{"a", "aa", "aaa", "aaaa"}, + []int{1, 2}, + }, + + // 可以有多个 testcase +} + +func Test_numSmallerByFrequency(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, numSmallerByFrequency(tc.queries, tc.words), "输入:%v", tc) + } +} + +func Benchmark_numSmallerByFrequency(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numSmallerByFrequency(tc.queries, tc.words) + } + } +} diff --git a/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/README.md b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/README.md new file mode 100755 index 000000000..98cb8c065 --- /dev/null +++ b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/README.md @@ -0,0 +1,34 @@ +# [1171. Remove Zero Sum Consecutive Nodes from Linked List](https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list/) + +Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. + +After doing so, return the head of the final linked list. You may return any such answer. + +(Note that in the examples below, all sequences are serializations of ListNode objects.) + +Example 1: + +```text +Input: head = [1,2,-3,3,1] +Output: [3,1] +Note: The answer [1,2,1] would also be accepted. +``` + +Example 2: + +```text +Input: head = [1,2,3,-3,4] +Output: [1,2,4] +``` + +Example 3: + +```text +Input: head = [1,2,3,-3,-2] +Output: [1] +``` + +Constraints: + +- The given linked list will contain between 1 and 1000 nodes. +- Each node in the linked list has -1000 <= node.val <= 1000. diff --git a/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list.go b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list.go new file mode 100755 index 000000000..e36f6865d --- /dev/null +++ b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list.go @@ -0,0 +1,34 @@ +package problem1171 + +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// ListNode is ... +type ListNode = kit.ListNode + +func removeZeroSumSublists(head *ListNode) *ListNode { + headPre := &ListNode{ + Val: 2000000, // bigger than 1000*1000 + Next: head, + } + + node := make(map[int]*ListNode, 1000) + stack, top := make([]int, 1000), -1 + sum, cur := 0, headPre + for cur != nil { + sum += cur.Val + if node[sum] == nil { + node[sum] = cur + top++ + stack[top] = sum + } else { + node[sum].Next = cur.Next + for stack[top] != sum { + node[stack[top]] = nil + top-- + } + } + cur = cur.Next + } + + return headPre.Next +} diff --git a/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list_test.go b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list_test.go new file mode 100755 index 000000000..c878da450 --- /dev/null +++ b/Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list/remove-zero-sum-consecutive-nodes-from-linked-list_test.go @@ -0,0 +1,76 @@ +package problem1171 + +import ( + "testing" + + "github.com/aQuaYi/LeetCode-in-Go/kit" + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + head []int + ans []int +}{ + + { + []int{0, 1, 1, -3, 6, -3, 0, 1}, + []int{1, 1, 1}, + }, + + { + []int{0, 1, 1, -3, 6, -3, 1}, + []int{1, 1, 1}, + }, + + { + []int{1, 1, -3, 6, -3, 1}, + []int{1, 1, 1}, + }, + + { + []int{1, 2, -2, 5, -3, 1}, + []int{1, 5, -3, 1}, + }, + + { + []int{1, 2, -8, 3, 1}, + []int{1, 2, -8, 3, 1}, + }, + + { + []int{1, 2, -3, 3, 1}, + []int{3, 1}, + }, + + { + []int{1, 2, 3, -3, 4}, + []int{1, 2, 4}, + }, + + { + []int{1, 2, 3, -3, -2}, + []int{1}, + }, + + // 可以有多个 testcase +} + +func Test_removeZeroSumSublists(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + ans := kit.List2Ints(removeZeroSumSublists(head)) + a.Equal(tc.ans, ans, "输入:%v", tc) + } +} + +func Benchmark_removeZeroSumSublists(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + head := kit.Ints2List(tc.head) + removeZeroSumSublists(head) + } + } +} diff --git a/Algorithms/1172.dinner-plate-stacks/README.md b/Algorithms/1172.dinner-plate-stacks/README.md new file mode 100755 index 000000000..35d228749 --- /dev/null +++ b/Algorithms/1172.dinner-plate-stacks/README.md @@ -0,0 +1,61 @@ +# [1172. Dinner Plate Stacks](https://leetcode.com/problems/dinner-plate-stacks/) + +You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum capacity. + +Implement the DinnerPlates class: + +- DinnerPlates(int capacity) Initializes the object with the maximum capacity of the stacks. +- void push(int val) pushes the given positive integer val into the leftmost stack with size less than capacity. +- int pop() returns the value at the top of the rightmost non-empty stack and removes it from that stack, and returns -1 if all stacks are empty. +- int popAtStack(int index) returns the value at the top of the stack with the given index and removes it from that stack, and returns -1 if the stack with that given index is empty. + +Example: + +```text +Input: +["DinnerPlates","push","push","push","push","push","popAtStack","push","push","popAtStack","popAtStack","pop","pop","pop","pop","pop"] +[[2],[1],[2],[3],[4],[5],[0],[20],[21],[0],[2],[],[],[],[],[]] +Output: +[null,null,null,null,null,null,2,null,null,20,21,5,4,3,1,-1] + +Explanation: +DinnerPlates D = DinnerPlates(2); // Initialize with capacity = 2 +D.push(1); +D.push(2); +D.push(3); +D.push(4); +D.push(5); // The stacks are now: 2 4 + 1 3 5 + ﹈ ﹈ ﹈ +D.popAtStack(0); // Returns 2. The stacks are now: 4 + 1 3 5 + ﹈ ﹈ ﹈ +D.push(20); // The stacks are now: 20 4 + 1 3 5 + ﹈ ﹈ ﹈ +D.push(21); // The stacks are now: 20 4 21 + 1 3 5 + ﹈ ﹈ ﹈ +D.popAtStack(0); // Returns 20. The stacks are now: 4 21 + 1 3 5 + ﹈ ﹈ ﹈ +D.popAtStack(2); // Returns 21. The stacks are now: 4 + 1 3 5 + ﹈ ﹈ ﹈ +D.pop() // Returns 5. The stacks are now: 4 + 1 3 + ﹈ ﹈ +D.pop() // Returns 4. The stacks are now: 1 3 + ﹈ ﹈ +D.pop() // Returns 3. The stacks are now: 1 + ﹈ +D.pop() // Returns 1. There are no stacks. +D.pop() // Returns -1. There are still no stacks. +``` + +Constraints: + +- `1 <= capacity <= 20000` +- `1 <= val <= 20000` +- `0 <= index <= 100000` +- `At most 200000 calls will be made to push, pop, and popAtStack.` diff --git a/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks.go b/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks.go new file mode 100755 index 000000000..c77c7312f --- /dev/null +++ b/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks.go @@ -0,0 +1,110 @@ +package problem1172 + +// DinnerPlates is ... +type DinnerPlates struct { + cap int + // plate's index of next push + in int + // plate's index of next pop + // when out is -1, plates is empty, unable to pop + out int + plates []*plate +} + +// Constructor is ... +func Constructor(capacity int) DinnerPlates { + plates := make([]*plate, 1, 1024) + plates[0] = newPlate(capacity) + return DinnerPlates{ + cap: capacity, + in: 0, + out: -1, // not possible to pop at beginning + plates: plates, + } +} + +// Push is ... +func (d *DinnerPlates) Push(val int) { + d.plates[d.in].push(val) + // after push into a empty plate at end + // d.out need point to the last nonempty plate + if d.out < d.in { + d.out = d.in + } + // make d.in to be the index of left-most nonfull plate + for d.in < len(d.plates) && d.plates[d.in].isFull() { + d.in++ + } + // if no nonfull plate , create a new plate + // JUST NOW, d.out < d.in + if d.in == len(d.plates) { + d.plates = append(d.plates, newPlate(d.cap)) + } +} + +// Pop is a special condition of PopAtStack +func (d *DinnerPlates) Pop() int { + if d.out == -1 { + return -1 + } + return d.PopAtStack(d.out) +} + +// PopAtStack is ... +func (d *DinnerPlates) PopAtStack(i int) (res int) { + if len(d.plates) <= i { + return -1 + } + p := d.plates[i] + // set value and remove it from the plate + if p.isEmpty() { + return -1 + } + res = p.pop() + // make d.in to be the index of left-most nonfull plate + d.in = min(d.in, i) + // PopAtStack could make some empty plate in d.plates + // need jump over these holes + // make sure d.plates[d.out] have val to pop + for d.out >= 0 && d.plates[d.out].isEmpty() { + d.out-- + } + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +type plate struct { + cap int + stack []int +} + +func newPlate(cap int) *plate { + return &plate{ + cap: cap, + stack: make([]int, 0, cap), + } +} + +func (p *plate) push(val int) { + p.stack = append(p.stack, val) +} + +func (p *plate) pop() (res int) { + n := len(p.stack) + p.stack, res = p.stack[:n-1], p.stack[n-1] + return res +} + +func (p *plate) isEmpty() bool { + return len(p.stack) == 0 +} + +func (p *plate) isFull() bool { + return len(p.stack) == p.cap +} diff --git a/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks_test.go b/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks_test.go new file mode 100755 index 000000000..9980ae203 --- /dev/null +++ b/Algorithms/1172.dinner-plate-stacks/dinner-plate-stacks_test.go @@ -0,0 +1,70 @@ +package problem1172 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_1(t *testing.T) { + a := assert.New(t) + // + d := Constructor(2) + // + for i := 1; i <= 5; i++ { + d.Push(i) + } + // + a.Equal(2, d.PopAtStack(0)) + // + d.Push(20) + d.Push(21) + a.Equal(20, d.PopAtStack(0)) + a.Equal(21, d.PopAtStack(2)) + // + a.Equal(5, d.Pop()) + a.Equal(4, d.Pop()) + a.Equal(3, d.Pop()) + a.Equal(1, d.Pop()) + // + a.Equal(-1, d.Pop()) +} + +func Test_2(t *testing.T) { + a := assert.New(t) + // + d := Constructor(1) + // + for i := 1; i <= 3; i++ { + d.Push(i) + } + // + a.Equal(2, d.PopAtStack(1)) + // + // + a.Equal(3, d.Pop()) + a.Equal(1, d.Pop()) +} + +func Test_3(t *testing.T) { + a := assert.New(t) + // + d := Constructor(1) + // + for i := 1; i <= 2; i++ { + d.Push(i) + } + // + a.Equal(2, d.PopAtStack(1)) + a.Equal(-1, d.PopAtStack(1)) + a.Equal(-1, d.PopAtStack(8)) + // + a.Equal(1, d.Pop()) + // + for i := 1; i <= 2; i++ { + d.Push(i) + } + // + a.Equal(2, d.Pop()) + a.Equal(1, d.Pop()) +} diff --git a/Algorithms/1175.prime-arrangements/README.md b/Algorithms/1175.prime-arrangements/README.md new file mode 100755 index 000000000..dddd4d43e --- /dev/null +++ b/Algorithms/1175.prime-arrangements/README.md @@ -0,0 +1,26 @@ +# [1175. Prime Arrangements](https://leetcode.com/problems/prime-arrangements/) + +Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.) + +(Recall that an integer is prime if and only if it is greater than 1, and cannot be written as a product of two positive integers both smaller than it.) + +Since the answer may be large, return the answer modulo 10^9 + 7. + +Example 1: + +```text +Input: n = 5 +Output: 12 +Explanation: For example [1,2,5,4,3] is a valid permutation, but [5,2,3,4,1] is not because the prime number 5 is at index 1. +``` + +Example 2: + +```text +Input: n = 100 +Output: 682289015 +``` + +Constraints: + +- 1 <= n <= 100 diff --git a/Algorithms/1175.prime-arrangements/prime-arrangements.go b/Algorithms/1175.prime-arrangements/prime-arrangements.go new file mode 100755 index 000000000..3ab13c3a3 --- /dev/null +++ b/Algorithms/1175.prime-arrangements/prime-arrangements.go @@ -0,0 +1,25 @@ +package problem1175 + +import "sort" + +const mod = 1e9 + 7 + +var primes = []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} + +func numPrimeArrangements(n int) int { + c := count(n) + return factorial(c) * factorial(n-c) % mod +} + +func count(n int) int { + return sort.Search(25, func(i int) bool { + return primes[i] > n + }) +} + +func factorial(n int) int { + if n == 1 || n == 0 { + return 1 + } + return n * factorial(n-1) % mod +} diff --git a/Algorithms/1175.prime-arrangements/prime-arrangements_test.go b/Algorithms/1175.prime-arrangements/prime-arrangements_test.go new file mode 100755 index 000000000..619980bcc --- /dev/null +++ b/Algorithms/1175.prime-arrangements/prime-arrangements_test.go @@ -0,0 +1,47 @@ +package problem1175 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + n int + ans int +}{ + + { + 1, + 1, + }, + + { + 5, + 12, + }, + + { + 100, + 682289015, + }, + + // 可以有多个 testcase +} + +func Test_numPrimeArrangements(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, numPrimeArrangements(tc.n), "输入:%v", tc) + } +} + +func Benchmark_numPrimeArrangements(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + numPrimeArrangements(tc.n) + } + } +} diff --git a/Algorithms/1176.diet-plan-performance/README.md b/Algorithms/1176.diet-plan-performance/README.md new file mode 100755 index 000000000..f7370ce5f --- /dev/null +++ b/Algorithms/1176.diet-plan-performance/README.md @@ -0,0 +1,41 @@ +# [1176. Diet Plan Performance](https://leetcode.com/problems/diet-plan-performance/) + +A dieter consumes calories[i] calories on the i-th day. For every consecutive sequence of k days,they look at T, the total calories consumed during that sequence of k days: + +- If T < lower, they performed poorly on their diet and lose 1 point; +- If T > upper, they performed well on their diet and gain 1 point; +- Otherwise, they performed normally and there is no change in points. + +Return the total number of points the dieter has after all calories.length days. + +Note that: The total points could be negative. + +Example 1: + +```text +Input: calories = [1,2,3,4,5], k = 1, lower = 3, upper = 3 +Output: 0 +Explanation: calories[0], calories[1] < lower and calories[3], calories[4] > upper, total points = 0.` +``` + +Example 2: + +```text +Input: calories = [3,2], k = 2, lower = 0, upper = 1 +Output: 1 +Explanation: calories[0] + calories[1] > upper, total points = 1. +``` + +Example 3: + +```text +Input: calories = [6,5,0,0], k = 2, lower = 1, upper = 5 +Output: 0 +Explanation: calories[0] + calories[1] > upper, calories[2] + calories[3] < lower, total points = 0. +``` + +Constraints: + +- `1 <= k <= calories.length <= 10^5` +- `0 <= calories[i] <= 20000` +- `0 <= lower <= upper` diff --git a/Algorithms/1176.diet-plan-performance/diet-plan-performance.go b/Algorithms/1176.diet-plan-performance/diet-plan-performance.go new file mode 100755 index 000000000..3c3f78af8 --- /dev/null +++ b/Algorithms/1176.diet-plan-performance/diet-plan-performance.go @@ -0,0 +1,28 @@ +package problem1176 + +func dietPlanPerformance(calories []int, k int, lower int, upper int) int { + point := func(t int) int { + if t < lower { + return -1 + } + if t > upper { + return 1 + } + return 0 + } + + T := 0 + res := 0 + for i, c := range calories { + T += c + if i < k-1 { + continue + } + if i-k >= 0 { + T -= calories[i-k] + } + res += point(T) + } + + return res +} diff --git a/Algorithms/1176.diet-plan-performance/diet-plan-performance_test.go b/Algorithms/1176.diet-plan-performance/diet-plan-performance_test.go new file mode 100755 index 000000000..1f5e17286 --- /dev/null +++ b/Algorithms/1176.diet-plan-performance/diet-plan-performance_test.go @@ -0,0 +1,59 @@ +package problem1176 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + calories []int + k int + lower int + upper int + ans int +}{ + + { + []int{1, 2, 3, 4, 5}, + 1, + 3, + 3, + 0, + }, + + { + []int{3, 2}, + 2, + 0, + 1, + 1, + }, + + { + []int{6, 5, 0, 0}, + 2, + 1, + 5, + 0, + }, + + // 可以有多个 testcase +} + +func Test_dietPlanPerformance(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, dietPlanPerformance(tc.calories, tc.k, tc.lower, tc.upper), "输入:%v", tc) + } +} + +func Benchmark_dietPlanPerformance(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + dietPlanPerformance(tc.calories, tc.k, tc.lower, tc.upper) + } + } +} diff --git a/Algorithms/1177.can-make-palindrome-from-substring/README.md b/Algorithms/1177.can-make-palindrome-from-substring/README.md new file mode 100755 index 000000000..d6293a6f8 --- /dev/null +++ b/Algorithms/1177.can-make-palindrome-from-substring/README.md @@ -0,0 +1,31 @@ +# [1177. Can Make Palindrome from Substring](https://leetcode.com/problems/can-make-palindrome-from-substring/) + +Given a string s, we make queries on substrings of s. + +For each query queries[i] = [left, right, k], we may rearrange the substring s[left], ..., s[right], and then choose up to k of them to replace with any lowercase English letter. + +If the substring is possible to be a palindrome string after the operations above, the result of the query is true. Otherwise, the result is false. + +Return an array answer[], where answer[i] is the result of the i-th query queries[i]. + +Note that: Each letter is counted individually for replacement so if for example s[left..right] = "aaa", and k = 2, we can only replace two of the letters. (Also, note that the initial string s is never modified by any query.) + +Example : + +```text +Input: s = "abcda", queries = [[3,3,0],[1,2,0],[0,3,1],[0,3,2],[0,4,1]] +Output: [true,false,false,true,true] +Explanation: +queries[0] : substring = "d", is palindrome. +queries[1] : substring = "bc", is not palindrome. +queries[2] : substring = "abcd", is not palindrome after replacing only 1 character. +queries[3] : substring = "abcd", could be changed to "abba" which is palindrome. Also this can be changed to "baab" first rearrange it "bacd" then replace "cd" with "ab". +queries[4] : substring = "abcda", could be changed to "abcba" which is palindrome. +``` + +Constraints: + +- `1 <= s.length, queries.length <= 10^5` +- `0 <= queries[i][0] <= queries[i][1] < s.length` +- `0 <= queries[i][2] <= s.length` +- `s only contains lowercase English letters.` diff --git a/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring.go b/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring.go new file mode 100755 index 000000000..5ecd7e33e --- /dev/null +++ b/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring.go @@ -0,0 +1,36 @@ +package problem1177 + +// TODO: unaccepted. the biggest test case spent 4500 ms. Limit Time Exceeded. + +func canMakePaliQueries(s string, queries [][]int) []bool { + n := len(queries) + + cnt := make([]int, 1, n+1) + c := 0 + for _, l := range s { + c ^= 1 << uint(l-'a') + cnt = append(cnt, c) + } + + res := make([]bool, n) + for i, q := range queries { + lo, hi, k := q[0], q[1], q[2] + if k >= 13 { + res[i] = true + continue + } + remains := bits(cnt[hi+1] ^ cnt[lo]) + res[i] = remains/2 <= k + } + + return res +} + +func bits(n int) int { + res := 0 + for n > 0 { + res += n & 1 + n >>= 1 + } + return res +} diff --git a/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring_test.go b/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring_test.go new file mode 100755 index 000000000..07f611166 --- /dev/null +++ b/Algorithms/1177.can-make-palindrome-from-substring/can-make-palindrome-from-substring_test.go @@ -0,0 +1,45 @@ +package problem1177 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + queries [][]int + ans []bool +}{ + + { +"lybypsnwvozshezupkrubmrapgbsbininmjmjkbkjkvoxcpqrsvwfshmtulqrypyhofubmnylkrapqhgxgdofcvmrylqpejqbalahwryrkzavgdmdgtqpgpmjghexybyrgzczyhafcdqbgncrcbihkdmhunuzqrkzsnidwbunszulspmhwpazoxijwbqpapmretkborsrurgtinansnupotstmnkfcfavaxglyzebsbuxmtcfmtodclszghejevmhcvshclydqrulwbyhajgtargjctqvijshexyjcjcrepyzazexujqtsjebcnadahobwfuvirivwbkdijstyjgdahmtutavapazcdspcnolsvmlorqxazglyjqfmtclsfaxchgjavqrifqbkzspazwnczivetoxqjclwbwtibqvelwxsdazixefcvarevabmfabqfivodqfaluxqpcxwfkzyxabytijcnohgzgbchwpshwnufcvqfcnglshwpgxujwrylqzejmdubkxsbctsfwdelkdqzshupmrufyxklsjurevipyfobudkbgpqtadspgvinafefktctinyvgfkpurgrihwbkjsrybmnqrgnubufebatwberilmrejgzsbqpkdonytkbknstsxifofmrktcpqhklcrebcjipetgnmlqvijovmlgripwratarmtmvkpujoxebyvmjqbmbsrcvejqpodehsjingfetapqpypwrcjsjsfotqzcdmvmfinetotshixutorylcnqdmvsdopkvqvejijcdyxetuzonuhuzkpelmvabklgfivmpozinybwlovcnafqfybodkhabyrglsnenkbergfcfyzatglgdolydcxyfyrmjcxmrepqnulwjipqvqparqvqrgjqtehglapuxqbihovktgzgtijohgfabwbmvcnwrmxcfcxabkxcvgbozmpspsbenazglyxkpibgzqbmpmlstotylonkvmhqjyxmnqzctonqtobahcrcbibgzgxopmtqvejqvudezchsloxizynabehqbyzknunobehkzqtktsrwbovohkvqhwrwvizebsrszcxepqrenilmvadqxuncpwhedknkdizqxkdczafixidorgfcnkrirmhmzqbcfuvojsxwraxedulixqfgvipenkfubgtyxujixspoxmhgvahqdmzmlyhajerqzwhydynkfslsrmvyhonyjenyrenojofafmnafmfyhyjebwhqpwhctqdkfctanypmxqxktqfwfgnwjqpsbgpydovufgfqbyvqpufujypcbmdupybalwpkbidypqbwhefijytypwdwbsharqdurkrslqlqlajodcpirubsryvudgpwncrmtypatunqpkhehuhkdmbctyxghsfktazkvwrkharmnqpwxyhejgvybifmncdorglsfqlidupyvcnypwvglormjirmdqnwnelyturkdobypezwvonqpubedetansrkjgzyzgpuxajgdajizelohidwdcxilkvytazgfozonwrkbalcpizgtmzuhkbsfefshmtctuvcrwjmzoncvihmlmvgdujopwrajuxmjefonivyvkncnwnkjaxkritkporsjazopevefqpmvkvctwhgnivoxqlwrmfyrslyjqlufgxkponkbgpqtifyhgbgdsvqvkjmritatgzspyfwpozuzwpujqfctepatuponctwpejwzmbwzarojohergrwzsjgjmnwfwjyxyhafstetgbydobynmxabavodsfwbqbevozkjkpwvwpgrwlabutilctsrgbgxorwjezspgxwredqjklabwterwzyzstwpobwjujwjkbyvcxytipcbotezezipavebqxcbkxarahalozyhetotejkrehilazkzgbsngrmxcloxexmvqzmfcvunongdgxotqbirwlyxqfijwduhivclefufubetsvefotmvwhstufgfqlspqpidwrmjexifslkzobcjqvwlevghglynojchkvufqnwxixqnercbabmxuhadmbsbabqzirgrcxazcxypmjebgxyzmlepcdezwbsjkjalgdotcjavojehsvaxkbslkrchgpapizsxydmpcjmloxydgzmrujypqzsnmrspmjspwpczetwtctqrkxafktihwzupidotwrufgbiruzujyvaxypibobwnejcfohwnwtwnqjqzkpulklivgfmtctaxihchencvyjipqvgvsjapghwhmhqjclmpwrqfavchutgpajutqdiholadqnkpmpwdqbifqbunypwrsnyjerwzcjabufutofgbqnylglinkrubebaxuhmtobutovoxqlcvorypijudsfmzilqvsnilmjinmvmdohabuzyrorkbanijqfebkjydkxsvotanwpipypwjkxoxkdojctmlufqvshahytslodyhynoxglqdyjqbizidwhcdmjshobodgdytsbefaxmfczilgvslqlchgdmhslmjahcrevehypctavipchurmnqxwfubqryhcdmpyvuxslkpengranercjmrejcdmnodyrcdczehuhkrgxgxwzuxwpmloxkxanghalshgbqhwnmzmfwhafszirozoroxsxcpwbedqvuxujaxcfebwzghylytodqdaronqdmzgzyvqnixangpopidibchobmdspetqfgnaduvsdqrofazqlijulstufkpipydijwvwvwhylmbixevorifidopalcbobutkhabafmdavelsfejwhwdixqvqvcdoxypgxwpgvqhmdehensngpyjijyxkdyroxcpibgfmlibuxynulmnulaxoxyhsrmxifkxubwpizadmjobmdofazynoxsngxarqzapejmlelidsbuxkfgdkpaxotelsjgnwzgdkdkxinubehytirahinixidqnizyfclcjcdyjgvsjqjetclaxqpinodihmzubkbopmxenshejqhgbkhyrgbmjoxifcbslcrghizopkvonuhqdgtotkjijqfgxefknipklurolotqboduzubebwdmjmxmdozytidajmbcnydevclojqrmvanklyxyfqrktsxktafkhcvajolyvaxmnuhavcfobwlsbcnadgvmjmbunipavmvgpydobypabebilyfslalutklytypibijgrodofmtshajcnivmjkjklgxirolybqnmtsfslovstgjadszojufsbmpsnefodwzkzeretgpstkbivsbinsvghsfolutulszyxonwbubgdupmhidsvoruzchyritodwpahydqnmxktmpcdwngzqbalovalcrmribapk", +[][]int{{3193,3223,3},{1926,3311,517},{519,3172,1953},{2572,3043,96},{245,1456,676},{1282,2683,1343},{1731,2764,576},{456,999,51},{417,1647,1083},{2030,2907,650},{1487,2571,939},{1556,2839,483},{365,1311,287},{1002,3287,195},{1691,2497,797},{2640,3103,409},{2841,3407,259},{1462,2481,241},{2567,3091,283},{284,771,358},{2933,2970,14},{946,2799,1187},{579,1922,364},{1608,1983,120},{785,3325,1271},{126,1083,621},{1631,1840,192},{692,1987,314},{1165,1212,15},{2730,3265,98},{1259,2318,562},{1712,2223,247},{313,3062,2181},{3110,3387,88},{327,708,271},{1740,2547,10},{245,836,220},{2898,3189,46},{2179,2421,225},{2808,3071,88},{2785,3144,0},{1198,3191,1705},{3151,3342,120},{3252,3315,63},{1661,2547,831},{618,3161,1829},{939,2160,708},{1424,2879,237},{649,1043,315},{1334,3407,1954},{3207,3221,1},{2508,3239,613},{3061,3078,7},{2802,2805,2},{2195,2268,39},{1688,3079,1150},{2065,3123,499},{2718,2749,11},{2495,3132,493},{3044,3235,43},{989,2568,987},{10,821,627},{1195,2560,689},{1680,2607,423},{2633,2685,13},{1078,3301,477},{631,2370,939},{1260,2571,1238},{2741,3312,115},{1762,3029,104},{707,1963,655},{216,439,163},{2513,3362,833},{1982,2985,835},{2783,2940,58},{2628,3019,235},{909,2800,1369},{2314,2507,40},{1211,1254,43},{784,1823,511},{2313,2533,145},{2534,2729,30},{3239,3267,9},{1612,3351,964},{3269,3314,28},{2306,3311,834},{1715,2994,517},{2456,2839,257},{1233,1486,237},{1374,1795,316},{2271,2490,105},{3396,3399,0},{3277,3400,94},{1450,1491,10},{2923,2926,3},{384,1679,40},{809,2932,822},{2166,2825,529},{1687,2732,709},{572,1099,388},{3061,3257,17},{1346,3333,321},{2467,2607,11},{232,1023,566},{2945,3350,1},{1086,2883,354},{2943,3026,69},{404,2071,180},{3117,3132,6},{3226,3377,59},{3211,3340,21},{1744,2623,296},{2921,3113,59},{3190,3227,31},{1623,2368,712},{3340,3383,12},{453,2131,479},{2114,2175,50},{1859,1888,14},{1784,1951,7},{881,2210,93},{382,1427,419},{2111,2487,291},{1012,1671,363},{2029,2089,25},{1290,2099,571},{203,507,51},{240,2351,1676},{3401,3401,1},{2006,2797,656},{3255,3404,112},{1228,2451,974},{2517,3211,7},{2354,3097,398},{2675,3083,45},{3384,3399,15},{2225,2233,1},{1102,2219,234},{1279,2087,483},{1556,2179,198},{3149,3285,133},{2938,2947,6},{219,2604,859},{688,3359,1670},{3401,3402,2},{1878,2583,92},{599,1760,1089},{236,1191,740},{3013,3173,65},{434,1901,896},{2435,3096,455},{1880,2551,571},{2529,2955,123},{3326,3373,39},{2319,3325,793},{1364,1403,38},{1117,2555,407},{602,2109,828},{3211,3372,22},{2880,3023,131},{1129,3300,859},{2726,3365,613},{2391,3069,273},{2060,3319,274},{1253,2117,113},{1570,2877,371},{851,2883,371},{648,2399,755},{1985,2083,75},{2382,3091,705},{2367,2528,104},{1556,2607,690},{2717,2959,3},{1338,3115,1368},{2763,3240,247},{2048,2351,115},{2393,3323,607},{1302,2931,874},{2375,2801,373},{2124,2367,38},{1957,2172,90},{2914,3203,150},{3283,3287,5},{2712,3327,511},{3105,3167,43},{638,3339,1750},{1471,1855,171},{2644,3127,194},{509,1495,131},{2986,3039,7},{875,3311,2397},{2624,3279,274},{2393,3314,509},{1110,2033,98},{2039,3405,601},{924,1995,8},{1061,2940,420},{610,3327,1029},{3299,3399,67},{1720,2975,946},{785,1363,155},{270,2541,415},{1887,2441,489},{1636,2139,13},{1165,1248,36},{1434,2505,1004},{2651,2778,23},{128,1007,488},{329,480,7},{2534,2539,3},{2791,2810,20},{2940,2999,18},{1909,2451,159},{2978,3007,4},{819,3005,1425},{3256,3399,8},{2081,2965,741},{1662,1705,11},{1455,1476,15},{580,2263,89},{2301,2859,311},{2362,3189,703},{1691,3263,293},{1280,1855,523},{2217,2654,413},{2742,3307,269},{823,2241,1141},{2172,2263,50},{3157,3310,56},{2002,2531,509},{1555,2167,367},{888,1719,733},{2449,2733,245},{2510,3163,426},{2191,3178,135},{452,3307,481},{1725,1970,181},{298,1763,613},{2571,2631,51},{3104,3375,28},{409,2649,1005},{742,947,126},{1879,3193,149},{1068,2823,1178},{3077,3166,38},{1810,3005,705},{2723,3065,133},{2648,2687,12},{2449,2976,446},{1678,2417,576},{2255,3232,266},{2372,2403,31},{941,3291,1047},{778,2037,129},{1963,2606,499},{272,2927,1791},{1193,2656,235},{694,2023,714},{1607,1628,10},{2028,2095,32},{21,1511,279},{18,2309,468},{2995,3226,93},{1224,2847,798},{1345,1994,177},{2302,2443,22},{1151,1937,461},{468,2523,1523},{797,2432,1004},{3306,3375,34},{2971,3090,0},{2704,3359,143},{633,1283,359},{1638,2451,291},{3239,3289,21},{2780,3223,367},{3173,3270,48},{834,2103,962},{2691,3000,266},{1624,1639,13},{849,1755,271},{3102,3343,100},{63,227,109},{2084,2575,77},{669,1169,439},{2394,2435,22},{1931,2178,53},{1056,2895,209},{889,1932,525},{358,2533,1578},{3031,3398,252},{3308,3335,21},{3173,3219,15},{2098,2313,210},{2371,2668,155},{1544,2695,1106},{721,2206,319},{3390,3405,0},{1551,2333,617},{2404,2983,569},{2861,3219,159},{1498,2983,1127},{3355,3369,5},{2240,2895,120},{1929,1946,8},{1094,2827,1044},{583,3304,581},{1052,3087,990},{373,3318,12},{2002,2513,401},{2499,2755,45},{2312,2823,441},{2097,2465,359},{78,2523,2163},{367,2062,1032},{3044,3187,48},{877,2197,531},{778,1359,206},{1339,2107,281},{1088,2687,877},{2217,3351,35},{1350,2669,268},{983,2790,1780},{1820,2803,838},{2005,3164,893},{722,2487,981},{3,1088,425},{792,959,126},{977,1777,675},{1422,2325,749},{927,3323,59},{484,1939,106},{717,3180,142},{1770,3105,693},{2875,3250,291},{2384,3039,420},{1273,2654,290},{1670,2493,202},{2103,2259,89},{2268,3155,698},{2293,3252,946},{1346,1613,104},{2611,2816,84},{1320,1527,69},{561,2252,583},{1166,1593,428},{639,2525,1177},{564,3111,592},{2701,3063,191},{1978,2863,322},{2107,2734,393},{1664,2415,739},{1049,1927,211},{2550,2771,61},{711,2098,1121},{2764,3015,246},{2325,2844,68},{2338,2623,239},{2195,2573,161},{3016,3167,80},{353,1153,581},{1662,1769,102},{591,2905,561},{356,2203,1506},{2877,3269,195},{1930,3203,27},{1019,1790,624},{928,1551,568},{409,2571,1503},{2982,3043,49},{151,2192,1169},{3068,3083,4},{3333,3374,8},{2434,2485,49},{2947,3128,29},{1576,2223,263},{3361,3376,0},{2942,3383,424},{191,2525,537},{2820,3143,189},{3197,3252,32},{538,1955,1381},{2395,2682,30},{2976,3135,152},{1993,3017,139},{1142,1523,213},{3015,3329,133},{268,1743,1091},{1125,2018,293},{3282,3405,59},{2771,3355,353},{2856,3191,249},{81,764,256},{1038,2795,1579},{511,3009,1197},{404,535,10},{3197,3242,3},{2554,3263,98},{2011,2940,610},{192,303,21},{2025,2576,113},{1366,2883,486},{871,2808,1522},{1644,2023,45},{2981,3098,95},{2642,2861,9},{1587,1864,56},{2296,3087,449},{3137,3291,123},{1854,2477,153},{1887,3105,217},{1220,3039,788},{2765,2901,5},{2810,3117,276},{2411,2990,423},{656,1615,447},{441,1193,287},{1734,3369,365},{759,2289,717},{684,1831,182},{869,1488,70},{1746,2627,529},{2707,3100,86},{2488,2623,136},{161,2708,972},{3006,3101,17},{2815,3037,73},{1092,1895,322},{1021,3248,908},{330,3217,271},{2523,2862,238},{240,2911,2423},{2745,3015,195},{3350,3355,3},{3351,3358,3},{396,2251,1214},{2245,3377,591},{2338,3403,535},{2979,3112,114},{1672,3095,601},{1825,1851,15},{2094,2489,217},{95,2307,1617},{1988,2191,129},{1645,2158,47},{3322,3353,30},{2747,3392,587},{3216,3247,16},{2777,2891,71},{1894,2203,253},{1959,2884,69},{908,1303,249},{21,3110,619},{1186,1979,141},{1859,2238,178},{584,1975,325},{2017,2056,29},{2782,2861,34},{3039,3231,191},{2100,2403,205},{3085,3235,119},{2650,3321,490},{363,986,340},{2448,2463,14},{1609,3178,281},{934,2531,266},{231,2033,265},{332,3263,575},{2917,3360,205},{2434,2673,175},{995,1097,85},{2728,3407,316},{2833,3172,322},{2478,3071,272},{335,2612,812},{1156,2099,339},{3405,3407,3},{1962,3291,675},{1355,2034,108},{528,783,129},{617,2065,387},{2614,3285,503},{567,2333,817},{3244,3283,37},{3237,3312,41},{2,3303,2274},{1395,2485,1013},{3400,3407,5},{2609,3236,213},{862,2981,158},{415,1659,1197},{2836,3075,159},{125,1984,1292},{3226,3387,155},{1963,2693,193},{3264,3407,71},{57,456,112},{598,3031,917},{2119,2737,1},{2476,2771,128},{2837,3391,335},{2722,3215,64},{259,2426,356},{680,1655,746},{65,1139,495},{1246,2107,683},{207,1786,217},{3252,3347,50},{1629,2350,402},{1434,3349,572},{59,2157,1601},{1296,2351,106},{2121,2321,17},{1638,2099,47},{1959,3218,626},{1052,3239,208},{1621,3053,1099},{2930,2997,56},{787,2870,932},{936,1215,47},{1057,1071,11},{222,933,284},{1679,2029,169},{1892,3275,1183},{3341,3393,53},{42,2327,1380},{1259,2673,397},{1376,1679,273},{1417,2724,400},{2870,3159,245},{135,1058,59},{2940,3243,73},{2821,3099,151},{2066,2237,77},{675,2432,347},{2456,2511,26},{1761,2364,518},{526,1543,176},{831,3042,440},{1780,2659,1},{2157,3272,1024},{1850,2227,88},{2123,2182,37},{3120,3183,61},{2201,2210,7},{3190,3353,3},{1271,2888,350},{172,3111,1811},{2229,3006,249},{2242,2287,17},{339,3197,1757},{2312,3135,261},{561,1126,499},{1182,1215,20},{159,1338,1145},{2740,3151,201},{3005,3271,115},{3098,3101,4},{3371,3390,4},{2512,2559,3},{1913,3273,921},{1766,2769,124},{2215,3194,744},{2796,3255,259},{69,380,268},{994,1753,334},{1875,3044,923},{1096,3351,419},{1169,3026,1038},{1230,2573,88},{1151,1852,469},{1396,1899,292},{733,3001,2009},{650,3049,1327},{2283,3213,25},{1056,1471,408},{2425,2889,341},{406,1377,913},{7,173,65},{1228,2087,230},{1941,2002,45},{2322,2791,132},{195,2011,1031},{1256,2975,502},{2417,3234,6},{1038,3097,608},{1935,2771,531},{964,1487,230},{2685,3087,75},{234,2401,1534},{2907,3379,65},{3232,3295,55},{153,1294,175},{2662,2665,3},{567,2097,1165},{140,1915,602},{741,892,116},{2930,3365,90},{2819,2856,26},{536,1703,260},{2769,3185,383},{2254,2873,427},{2751,3007,179},{3332,3351,3},{2733,3397,145},{3290,3309,20},{1851,3012,488},{3328,3407,79},{2345,2783,323},{2262,3145,78},{2375,2791,33},{1532,1571,24},{661,3175,403},{1650,2291,423},{1235,1984,745},{2920,3039,11},{17,2384,90},{1390,2895,930},{1663,2819,919},{724,2675,1207},{2733,3158,66},{58,2537,1148},{635,2636,1291},{2624,3103,175},{1561,2738,651},{1126,2297,1084},{343,1330,416},{540,2275,468},{2133,2887,535},{2626,2949,279},{1475,1766,275},{3240,3367,72},{2913,3186,221},{430,2909,933},{2079,2423,301},{740,2091,674},{1709,2984,903},{2138,2255,116},{1947,2122,29},{2384,2927,430},{41,1490,139},{1622,2431,233},{871,1025,21},{2252,3115,22},{3285,3293,1},{370,1033,142},{1699,2006,125},{1112,1463,321},{3105,3369,179},{1390,2057,373},{655,3250,299},{628,1803,427},{3261,3375,95},{298,2415,1404},{539,3347,2515},{576,3343,1853},{3209,3295,19},{3078,3243,133},{1639,2786,519},{860,2167,1269},{1861,1952,79},{3362,3405,5},{2115,2813,485},{744,3087,2100},{1153,1820,579},{30,3119,2189},{1231,2679,989},{2596,3375,235},{1869,2161,207},{3258,3301,31},{331,1175,479},{976,1615,207},{2793,2872,13},{726,1733,600},{919,2086,494},{3356,3407,23},{3173,3222,1},{658,1291,398},{307,2149,645},{1048,1311,51},{2961,3066,60},{3150,3247,59},{1887,1947,35},{3396,3407,5},{2173,3190,625},{810,2805,962},{2843,3018,98},{1584,2815,311},{1705,2089,201},{1222,2045,718},{2247,2782,176},{572,2571,1882},{613,2199,519},{706,2279,776},{3363,3385,21},{1512,2695,245},{993,1900,676},{1406,2175,769},{223,413,89},{1988,2511,335},{1821,2231,151},{2730,3021,149},{1819,2587,309},{2240,2799,231},{73,822,163},{918,1835,229},{855,1597,209},{2412,2995,314},{2133,3155,751},{2770,3207,38},{1491,2861,849},{1672,3127,1112},{657,3032,1073},{1150,2011,231},{3119,3255,93},{2388,3215,129},{2029,3243,7},{1514,3253,163},{3067,3107,11},{2512,2655,127},{1881,2054,74},{1158,1223,40},{2231,2782,124},{476,2739,1421},{517,2743,607},{2994,3295,210},{2627,3319,641},{1240,3223,369},{705,2176,1451},{382,2035,1494},{1119,2914,347},{148,1995,374},{1069,3260,155},{58,1977,1727},{3131,3187,3},{928,2655,206},{2265,3348,713},{2886,3265,310},{2919,3249,1},{1596,2163,19},{2197,3020,330},{2594,2997,332},{2003,2007,3},{648,3071,1348},{2401,3156,580},{3150,3349,60},{2127,2511,195},{868,1911,797},{2285,2590,287},{10,2891,942},{2939,3195,257},{2400,2799,159},{3097,3257,5},{198,2923,446},{1687,2936,701},{2220,2347,71},{725,2865,841},{770,3191,2190},{1107,1599,253},{24,1847,730},{1345,3240,473},{430,2785,301},{1103,1524,378},{1988,2735,54},{1421,2618,700},{714,1033,166},{507,2760,701},{32,1471,752},{3193,3240,15},{518,877,242},{3111,3219,27},{2284,2699,76},{3365,3388,0},{978,1501,492},{211,2519,1177},{2472,2871,42},{1265,1370,83},{3054,3215,0},{2255,2482,65},{836,2899,118},{2605,2707,95},{2186,2799,423},{2923,3398,211},{2512,2591,42},{2713,3386,315},{2342,2999,516},{1911,1958,47},{2444,2455,10},{517,1539,991},{2770,3109,30},{2595,2930,200},{472,1599,278},{1809,1965,135},{1166,2635,1275},{2223,3112,342},{2660,2987,112},{1645,2970,686},{42,2615,2371},{2891,3060,44},{2288,2607,112},{2985,3192,87},{70,1769,1700},{2295,3082,594},{3068,3375,280},{1061,2500,215},{1138,1641,340},{835,1329,141},{840,1207,21},{2801,3017,5},{3054,3285,223},{1375,3110,1388},{2036,3115,997},{3277,3310,3},{1514,2027,339},{395,2858,2289},{1200,1279,77},{3225,3359,27},{2374,3339,67},{2871,3081,61},{1628,1635,5},{1653,2624,688},{994,1607,8},{2915,3123,17},{3064,3255,155},{3201,3290,5},{1006,1271,112},{2495,2927,37},{2484,2899,147},{3341,3376,15},{3130,3213,65},{2171,3324,391},{224,847,202},{1337,3222,768},{1414,1953,167},{1063,3091,81},{2764,3131,115},{3013,3137,27},{1394,1529,83},{3171,3384,89},{2104,2367,207},{2721,3264,106},{3102,3335,89},{895,966,10},{1684,2955,817},{1997,2362,112},{2458,2757,224},{2187,2818,538},{2768,3295,331},{617,2382,1143},{1414,3147,598},{71,1117,33},{1468,1591,76},{2389,2675,95},{3394,3403,2},{1315,2510,284},{552,1247,64},{1665,2865,967},{2254,2873,380},{3375,3387,7},{2804,3031,3},{3405,3406,0},{362,819,323},{2187,3287,139},{1840,2639,620},{1193,2383,467},{2086,2677,93},{2791,2838,28},{1532,3327,1284},{2085,2676,562},{2946,3089,87},{835,1844,694},{1192,1895,549},{2401,2975,315},{334,2501,1581},{655,2017,881},{2516,2547,9},{1533,1965,265},{1050,3213,628},{2507,2566,30},{880,2847,130},{3177,3254,12},{1302,3115,925},{2375,2922,378},{732,3379,1210},{1285,2621,895},{2514,2597,74},{1059,2935,375},{456,2479,904},{1825,2968,563},{2782,3405,257},{1407,2864,329},{2196,3259,614},{2733,3184,75},{2330,3385,994},{507,2705,389},{16,2287,207},{3129,3187,35},{2710,2779,55},{855,951,71},{220,1735,1440},{1541,2722,117},{882,2675,99},{2755,3018,70},{2744,3071,254},{2865,2897,31},{2174,2847,120},{2415,3292,812},{52,2779,2132},{2381,2535,23},{362,547,127},{555,2224,1530},{3072,3343,228},{2777,3367,163},{1622,1871,40},{2791,2811,7},{2876,3315,410},{1509,3250,1515},{1522,2325,755},{403,2166,1597},{1000,2271,227},{2449,2970,138},{3230,3353,86},{3375,3400,24},{1108,1827,551},{925,1221,41},{714,939,180},{2411,3219,665},{480,2303,1102},{2905,2947,15},{1350,1487,1},{2743,2961,185},{44,591,538},{1861,2643,719},{1218,2793,231},{3075,3293,193},{2792,3079,229},{209,1751,659},{1918,2565,162},{2319,2847,279},{180,843,513},{349,2373,1629},{3066,3195,107},{363,2299,229},{2864,3263,66},{1833,2673,773},{2438,2953,511},{1367,2354,335},{2124,2667,255},{277,2332,1669},{2146,3203,659},{2179,2794,480},{312,3135,2363},{49,1297,1077},{1230,1585,116},{1343,2950,1192},{2500,2715,83},{3389,3402,14},{1114,1709,518},{2555,3225,165},{816,1839,763},{505,774,70},{2950,3243,200},{2807,3170,66},{220,3239,1388},{1525,1950,312},{1874,1913,23},{2819,3009,125},{1816,2551,56},{353,2836,1762},{1262,2047,667},{751,2035,1257},{2228,2923,656},{77,1246,641},{2394,2423,3},{747,809,21},{1808,2591,25},{1513,2764,19},{3286,3311,10},{3319,3395,67},{1548,3263,1238},{85,1084,373},{1970,1989,20},{2531,3111,289},{952,1095,56},{945,2747,183},{1294,1443,91},{2911,3241,161},{3396,3403,8},{1117,2834,525},{634,2515,428},{2907,3390,429},{176,3279,2421},{2793,3039,59},{1670,3191,1092},{3031,3257,93},{1292,2583,226},{1669,2449,651},{274,2325,1898},{595,1570,677},{3320,3399,16},{609,3176,468},{3374,3381,5},{2367,2643,227},{1860,1879,19},{3309,3312,2},{1130,1629,477},{59,368,172},{2960,3263,53},{697,2682,1240},{550,3125,956},{1031,1828,623},{1676,2223,111},{1909,2121,25},{2994,3201,207},{2563,3059,221},{2936,2975,28},{961,1025,63},{1502,2045,19},{2303,3313,869},{1172,3379,1528},{1949,2835,375},{218,1015,565},{2715,3398,115},{544,2639,235},{3401,3404,3},{2598,3321,338},{1767,3082,631},{2156,3203,930},{981,2617,211},{3138,3399,146},{723,723,1},{2424,3295,654},{481,3036,1136},{2926,2969,28},{575,1391,163},{1716,2599,837},{3325,3363,7},{794,1235,385},{2779,2811,7},{2128,2591,156},{1913,3006,473},{2134,3257,469},{823,3261,1297},{1436,2607,529},{2757,2912,126},{1314,2595,137},{595,763,131},{1848,2671,66},{1713,2757,21},{3342,3357,5},{271,2351,835},{1604,2899,925},{1133,1735,491},{1354,1617,107},{427,456,8},{2368,2767,17},{153,1794,270},{54,739,56},{2407,3129,181},{3292,3347,28},{2517,3023,383},{1138,1449,289},{1827,2082,130},{696,1735,264},{1521,2641,545},{2126,2763,197},{2703,3070,105},{2788,2823,23},{2221,3057,5},{1418,2115,189},{939,2207,849},{2768,3071,79},{393,1555,931},{2806,2985,66},{2679,2826,111},{2956,3291,238},{1733,2852,880},{1906,2453,393},{2083,2233,69},{760,1999,478},{161,412,13},{3406,3407,2},{559,761,9},{692,2811,1989},{349,1009,463},{490,2361,1248},{2571,2910,166},{3040,3071,8},{2825,3203,287},{1862,1893,4},{1863,1928,58},{3196,3379,80},{1013,1869,89},{1570,2223,542},{755,2677,1337},{2200,2647,303},{2161,3155,467},{286,913,381},{1167,2205,601},{1956,2583,536},{557,1112,186},{2634,3213,152},{1595,3276,1033},{2784,3391,221},{2441,2707,135},{1366,3319,521},{2823,3230,28},{2876,3143,83},{1829,3145,23},{98,2127,1863},{2835,2848,7},{1896,2791,856},{2769,3107,67},{2366,3199,67},{1359,2571,231},{724,2215,455},{1805,3091,839},{2154,2979,821},{2939,3087,113},{864,2367,649},{2441,3337,147},{1286,1399,47},{855,911,45},{2412,2799,351},{453,2690,2218},{450,2361,235},{51,513,221},{648,927,278},{945,2935,51},{2590,3101,118},{2943,3033,45},{2740,2911,79},{2557,3021,379},{3002,3009,1},{2475,2582,40},{1984,2751,574},{953,2167,979},{902,2167,723},{1639,1671,25},{3340,3347,2},{3253,3393,47},{2450,2845,190},{2195,2403,59},{344,2687,509},{1265,3234,1024},{766,909,142},{3135,3201,33},{2612,2659,36},{2493,2600,20},{3226,3233,1},{331,1816,502},{3152,3183,15},{1849,2645,761},{630,967,192},{2519,2901,49},{364,2595,1067},{581,1314,2},{3058,3235,144},{3043,3326,121},{2712,3327,475},{17,534,355},{1054,2397,1003},{3231,3306,36},{580,587,0},{1709,2287,359},{1498,3249,430},{1835,2206,229},{2384,2463,80},{137,1120,936},{422,2929,671},{23,2743,1435},{2620,2643,4},{1813,2662,454},{818,1247,201},{211,617,245},{1880,2615,259},{2369,3284,149},{3006,3393,360},{3039,3358,305},{468,2991,1793},{3357,3400,0},{2442,2617,51},{2923,3127,61},{2880,3327,337},{185,1792,553},{310,3095,1534},{2391,2427,9},{1820,3047,291},{2469,2913,343},{1682,2727,904},{2851,3248,81},{2008,3247,589},{881,1448,399},{1054,1811,755},{2975,3131,89},{2100,2351,250},{2845,2870,25},{1866,3299,314},{923,1296,209},{800,3279,1450},{1097,3056,1543},{6,1455,1440},{775,1742,297},{2076,2551,357},{1973,2385,299},{434,1955,1018},{1587,2312,301},{3240,3375,72},{305,2530,118},{1118,1539,181},{367,2384,1100},{3060,3215,118},{941,2127,811},{954,1927,713},{59,2243,1073},{1024,1455,69},{2393,2575,155},{1910,2473,123},{231,1853,1121},{892,2123,1017},{1509,2491,687},{3250,3283,34},{1603,2242,370},{2200,2535,193},{1841,3321,1275},{2126,3161,143},{1663,3167,471},{276,2927,1641},{2077,3013,315},{90,1705,32},{1771,2181,277},{656,2271,688},{1689,3198,1217},{2902,3201,105},{1879,2158,120},{1324,2179,502},{565,823,159},{226,1733,1503},{147,2348,1794},{104,1231,343},{2673,3389,129},{478,2891,2379},{2367,2911,97},{3172,3299,20},{3101,3309,27},{618,2229,1046},{2107,2645,317},{3248,3343,91},{1033,1230,165},{1398,3131,71},{759,3259,273},{1436,2731,1031},{1125,2142,384},{2162,2739,297},{419,2827,473},{3320,3335,4},{1441,3388,1574},{750,2415,1402},{2687,2870,99},{1284,3359,135},{2749,3354,517},{2154,2663,172},{1979,3318,521},{2064,3071,316},{1689,2322,548},{438,2679,254},{519,3378,188},{860,1823,443},{2613,2914,280},{3074,3289,104},{3171,3344,155},{152,1055,228},{641,2524,348},{2894,3143,243},{431,3233,397},{1156,3263,317},{1901,3371,663},{1850,2159,309},{3115,3308,35},{960,3311,248},{2265,3252,600},{470,1203,652},{2327,3006,648},{1820,2891,833},{2645,2662,0},{2242,2263,17},{3331,3362,20},{776,2087,1197},{913,1414,163},{1182,2887,20},{2191,3052,627},{2388,3039,341},{1613,1722,13},{2282,2431,80},{1035,1136,67},{2848,3023,65},{649,665,17},{1830,2075,245},{1719,2722,825},{1372,2391,94},{3173,3282,55},{2402,3089,9},{659,1250,120},{1480,2063,459},{2817,2888,64},{1982,3091,906},{1999,2704,426},{1876,1911,20},{909,3031,415},{506,2351,1581},{827,1989,153},{2000,2383,286},{1145,2625,1315},{1126,1569,204},{3239,3378,5},{1852,2203,42},{3157,3382,35},{642,3013,768},{1763,2308,493},{552,3295,2395},{2257,2809,265},{1342,1459,66},{3343,3379,11},{3300,3331,28},{141,2825,1357},{1210,2947,1472},{3371,3398,21},{2704,2879,86},{2793,3253,409},{758,1865,180},{3111,3217,101},{2252,2303,49},{1557,2927,447},{3186,3309,116},{1491,2073,461},{1176,1767,512},{1921,3321,991},{2670,3219,34},{511,1932,193},{1124,3403,773},{1677,3286,1401},{2906,3403,494},{3179,3346,114},{464,3119,102},{2169,2737,323},{2838,2847,4},{2663,3198,83},{236,523,133},{1093,1366,139},{3250,3407,68},{1795,2288,438},{1592,3023,398},{305,3280,977},{1582,2045,312},{2751,2815,65},{996,2747,1098},{1101,2455,171},{266,2609,494},{2507,3040,186},{2400,2815,22},{1289,2087,563},{1046,1409,95},{2519,2983,397},{2524,3291,630},{1125,1887,167},{3250,3261,8},{3331,3372,21},{888,919,15},{1441,3249,171},{1262,1831,364},{2943,3221,89},{1108,1939,150},{1549,2287,599},{2314,2417,42},{779,1061,225},{3280,3343,14},{921,1443,135},{1430,1931,500},{3239,3359,75},{588,927,109},{2853,3250,210},{3170,3269,29},{1827,2628,339},{2904,3047,81},{1793,1855,59},{1518,1837,192},{3135,3207,51},{1876,3371,1255},{2061,2586,82},{1354,1993,83},{843,3175,1061},{2192,2751,138},{57,2304,833},{838,943,51},{3351,3406,36},{2636,3303,477},{3365,3404,12},{1634,3089,216},{3267,3364,87},{2232,2447,81},{225,753,29},{94,2639,1117},{1951,2038,66},{2212,2319,54},{973,1991,923},{1450,2587,965},{1179,1411,115},{2592,3215,439},{1881,2059,55},{1798,2675,840},{1127,3180,689},{236,1115,392},{837,2989,1035},{3378,3385,5},{963,1595,161},{3240,3351,36},{945,2148,1094},{1710,2641,740},{415,2027,439},{1220,3339,458},{1677,2068,350},{1962,2213,66},{2843,3321,117},{1840,2591,116},{1689,2589,751},{870,2245,1164},{1287,2719,669},{428,1147,540},{2853,3100,135},{914,1539,305},{707,2475,65},{1192,3223,1723},{145,167,11},{3278,3285,2},{623,699,49},{2980,3039,22},{509,584,42},{1162,1805,472},{1547,1928,270},{2128,3023,149},{345,1358,95},{2166,2991,131},{983,2896,1225},{636,1839,524},{325,2689,2337},{2306,2927,57},{1891,2767,133},{3048,3383,281},{1489,1749,255},{3006,3075,54},{735,845,73},{1844,2355,444},{1933,2858,734},{3114,3125,10},{1755,1858,41},{1136,3263,1431},{1305,1371,31},{1238,2153,496},{1271,1304,20},{2796,3279,121},{1461,3256,479},{1538,1655,47},{2147,2214,22},{3288,3295,4},{3393,3393,1},{1214,1993,357},{1615,2953,85}}, +[]bool{false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true}, + }, + + { + "abcda", + [][]int{{3, 3, 0}, {1, 2, 0}, {0, 3, 1}, {0, 3, 2}, {0, 4, 1}}, + []bool{true, false, false, true, true}, + }, + + // 可以有多个 testcase +} + +func Test_canMakePaliQueries(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, canMakePaliQueries(tc.s, tc.queries), "输入:%v", tc) + } +} + +func Benchmark_canMakePaliQueries(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + canMakePaliQueries(tc.s, tc.queries) + } + } +} diff --git a/Algorithms/1178.number-of-valid-words-for-each-puzzle/README.md b/Algorithms/1178.number-of-valid-words-for-each-puzzle/README.md new file mode 100755 index 000000000..b1261b482 --- /dev/null +++ b/Algorithms/1178.number-of-valid-words-for-each-puzzle/README.md @@ -0,0 +1,34 @@ +# [1178. Number of Valid Words for Each Puzzle](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle/) + +With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: + +- word contains the first letter of puzzle. +- For each letter in word, that letter is in puzzle. +- For example, if the puzzle is "abcdefg", then valid words are "faced", "cabbage", and "baggage"; while invalid words are "beefed" (doesn't include "a") and "based" (includes "s" which isn't in the puzzle). + +Return an array answer, where answer[i] is the number of words in the given word list words that are valid with respect to the puzzle puzzles[i]. + +Example : + +```text +Input: +words = ["aaaa","asas","able","ability","actt","actor","access"], +puzzles = ["aboveyz","abrodyz","abslute","absoryz","actresz","gaswxyz"] +Output: [1,1,3,2,4,0] +Explanation: +1 valid word for "aboveyz" : "aaaa" +1 valid word for "abrodyz" : "aaaa" +3 valid words for "abslute" : "aaaa", "asas", "able" +2 valid words for "absoryz" : "aaaa", "asas" +4 valid words for "actresz" : "aaaa", "asas", "actt", "access" +There're no valid words for "gaswxyz" cause none of the words in the list contains letter 'g'. +``` + +Constraints: + +- `1 <= words.length <= 10^5` +- `4 <= words[i].length <= 50` +- `1 <= puzzles.length <= 10^4` +- `puzzles[i].length == 7` +- `words[i][j], puzzles[i][j] are English lowercase letters.` +- `Each puzzles[i] doesn't contain repeated characters.` diff --git a/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle.go b/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle.go new file mode 100755 index 000000000..5adbd531f --- /dev/null +++ b/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle.go @@ -0,0 +1,40 @@ +package problem1178 + +func findNumOfValidWords(words []string, puzzles []string) []int { + count := make(map[int]int, len(words)) + for _, w := range words { + count[mask(w)]++ + } + + res := make([]int, len(puzzles)) + + for i, p := range puzzles { + subs := subsWithHead(p) + for _, s := range subs { + res[i] += count[s] + } + } + + return res +} + +func mask(w string) int { + res := 0 + for _, l := range w { + res |= 1 << uint(l-'a') + } + return res +} + +func subsWithHead(p string) []int { + n := len(p) + res := make([]int, 1, 128) + res[0] = 1 << uint(p[0]-'a') + for i := 1; i < n; i++ { + x := 1 << uint(p[i]-'a') + for _, r := range res { + res = append(res, r|x) + } + } + return res +} diff --git a/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle_test.go b/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle_test.go new file mode 100755 index 000000000..c7a3675f2 --- /dev/null +++ b/Algorithms/1178.number-of-valid-words-for-each-puzzle/number-of-valid-words-for-each-puzzle_test.go @@ -0,0 +1,39 @@ +package problem1178 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + words []string + puzzles []string + ans []int +}{ + + { + []string{"aaaa", "asas", "able", "ability", "actt", "actor", "access"}, + []string{"aboveyz", "abrodyz", "abslute", "absoryz", "actresz", "gaswxyz"}, + []int{1, 1, 3, 2, 4, 0}, + }, + + // 可以有多个 testcase +} + +func Test_findNumOfValidWords(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, findNumOfValidWords(tc.words, tc.puzzles), "输入:%v", tc) + } +} + +func Benchmark_findNumOfValidWords(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + findNumOfValidWords(tc.words, tc.puzzles) + } + } +} diff --git a/Algorithms/1184.distance-between-bus-stops/1.jpg b/Algorithms/1184.distance-between-bus-stops/1.jpg new file mode 100644 index 000000000..a7809665f Binary files /dev/null and b/Algorithms/1184.distance-between-bus-stops/1.jpg differ diff --git a/Algorithms/1184.distance-between-bus-stops/2.jpg b/Algorithms/1184.distance-between-bus-stops/2.jpg new file mode 100644 index 000000000..c51417365 Binary files /dev/null and b/Algorithms/1184.distance-between-bus-stops/2.jpg differ diff --git a/Algorithms/1184.distance-between-bus-stops/3.jpg b/Algorithms/1184.distance-between-bus-stops/3.jpg new file mode 100644 index 000000000..829a374fd Binary files /dev/null and b/Algorithms/1184.distance-between-bus-stops/3.jpg differ diff --git a/Algorithms/1184.distance-between-bus-stops/README.md b/Algorithms/1184.distance-between-bus-stops/README.md new file mode 100755 index 000000000..2fd71dacc --- /dev/null +++ b/Algorithms/1184.distance-between-bus-stops/README.md @@ -0,0 +1,44 @@ +# [1184. Distance Between Bus Stops](https://leetcode.com/problems/distance-between-bus-stops/) + +A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n. + +The bus goes along both directions i.e. clockwise and counterclockwise. + +Return the shortest distance between the given start and destination stops. + +Example 1: + +![1](1.jpg) + +```text +Input: distance = [1,2,3,4], start = 0, destination = 1 +Output: 1 +Explanation: Distance between 0 and 1 is 1 or 9, minimum is 1. +``` + +Example 2: + +![2](2.jpg) + +```text +Input: distance = [1,2,3,4], start = 0, destination = 2 +Output: 3 +Explanation: Distance between 0 and 2 is 3 or 7, minimum is 3. +``` + +Example 3: + +![3](3.jpg) + +```text +Input: distance = [1,2,3,4], start = 0, destination = 3 +Output: 4 +Explanation: Distance between 0 and 3 is 6 or 4, minimum is 4. +``` + +Constraints: + +- `1 <= n <= 10^4` +- `distance.length == n` +- `0 <= start, destination < n` +- `0 <= distance[i] <= 10^4` diff --git a/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops.go b/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops.go new file mode 100755 index 000000000..9af6767ee --- /dev/null +++ b/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops.go @@ -0,0 +1,24 @@ +package problem1184 + +func distanceBetweenBusStops(distance []int, start int, destination int) int { + if start > destination { + start, destination = destination, start + } + + total, part := 0, 0 + for i, d := range distance { + total += d + if start <= i && i < destination { + part += d + } + } + + return min(part, total-part) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops_test.go b/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops_test.go new file mode 100755 index 000000000..7465a3b49 --- /dev/null +++ b/Algorithms/1184.distance-between-bus-stops/distance-between-bus-stops_test.go @@ -0,0 +1,62 @@ +package problem1184 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + distance []int + start int + destination int + ans int +}{ + + { + []int{7, 10, 1, 12, 11, 14, 5, 0}, + 7, + 2, + 17, + }, + + { + []int{1, 2, 3, 4}, + 0, + 1, + 1, + }, + + { + []int{1, 2, 3, 4}, + 0, + 2, + 3, + }, + + { + []int{1, 2, 3, 4}, + 0, + 3, + 4, + }, + + // 可以有多个 testcase +} + +func Test_distanceBetweenBusStops(t *testing.T) { + ast := assert.New(t) + + for _, tc := range tcs { + ast.Equal(tc.ans, distanceBetweenBusStops(tc.distance, tc.start, tc.destination), "输入:%v", tc) + } +} + +func Benchmark_distanceBetweenBusStops(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + distanceBetweenBusStops(tc.distance, tc.start, tc.destination) + } + } +} diff --git a/Algorithms/1185.day-of-the-week/README.md b/Algorithms/1185.day-of-the-week/README.md new file mode 100755 index 000000000..3afceebea --- /dev/null +++ b/Algorithms/1185.day-of-the-week/README.md @@ -0,0 +1,32 @@ +# [1185. Day of the Week](https://leetcode.com/problems/day-of-the-week/) + +Given a date, return the corresponding day of the week for that date. + +The input is given as three integers representing the day, month and year respectively. + +Return the answer as one of the following values {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}. + +Example 1: + +```text +Input: day = 31, month = 8, year = 2019 +Output: "Saturday" +``` + +Example 2: + +```text +Input: day = 18, month = 7, year = 1999 +Output: "Sunday" +``` + +Example 3: + +```text +Input: day = 15, month = 8, year = 1993 +Output: "Sunday" +``` + +Constraints: + +- The given dates are valid dates between the years 1971 and 2100. diff --git a/Algorithms/1185.day-of-the-week/day-of-the-week.go b/Algorithms/1185.day-of-the-week/day-of-the-week.go new file mode 100755 index 000000000..a7cf9c5b0 --- /dev/null +++ b/Algorithms/1185.day-of-the-week/day-of-the-week.go @@ -0,0 +1,7 @@ +package problem1185 + +import "time" + +func dayOfTheWeek(day int, month int, year int) string { + return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.Local).Weekday().String() +} diff --git a/Algorithms/1185.day-of-the-week/day-of-the-week_test.go b/Algorithms/1185.day-of-the-week/day-of-the-week_test.go new file mode 100755 index 000000000..0afde4f7f --- /dev/null +++ b/Algorithms/1185.day-of-the-week/day-of-the-week_test.go @@ -0,0 +1,55 @@ +package problem1185 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + day int + month int + year int + ans string +}{ + + { + 31, + 8, + 2019, + "Saturday", + }, + + { + 18, + 7, + 1999, + "Sunday", + }, + + { + 15, + 8, + 1993, + "Sunday", + }, + + // 可以有多个 testcase +} + +func Test_dayOfTheWeek(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, dayOfTheWeek(tc.day, tc.month, tc.year), "输入:%v", tc) + } +} + +func Benchmark_dayOfTheWeek(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + dayOfTheWeek(tc.day, tc.month, tc.year) + } + } +} diff --git a/Algorithms/1186.maximum-subarray-sum-with-one-deletion/README.md b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/README.md new file mode 100755 index 000000000..f3a2e03dd --- /dev/null +++ b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/README.md @@ -0,0 +1,34 @@ +# [1186. Maximum Subarray Sum with One Deletion](https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/) + +Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to choose a subarray and optionally delete one element from it so that there is still at least one element left and the sum of the remaining elements is maximum possible. + +Note that the subarray needs to be non-empty after deleting one element. + +Example 1: + +```text +Input: arr = [1,-2,0,3] +Output: 4 +Explanation: Because we can choose [1, -2, 0, 3] and drop -2, thus the subarray [1, 0, 3] becomes the maximum value. +``` + +Example 2: + +```text +Input: arr = [1,-2,-2,3] +Output: 3 +Explanation: We just choose [3] and it's the maximum sum. +``` + +Example 3: + +```text +Input: arr = [-1,-1,-1,-1] +Output: -1 +Explanation: The final subarray needs to be non-empty. You can't choose [-1] and delete -1 from it, then get an empty subarray to make the sum equals to 0. +``` + +Constraints: + +- `1 <= arr.length <= 10^5` +- `-10^4 <= arr[i] <= 10^4` diff --git a/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion.go b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion.go new file mode 100755 index 000000000..015877f8e --- /dev/null +++ b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion.go @@ -0,0 +1,30 @@ +package problem1186 + +// ref: https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/discuss/377397/Intuitive-Java-Solution-With-Explanation + +func maximumSum(A []int) int { + n := len(A) + maxRightIs := make([]int, n) + maxLeftIs := make([]int, n) + maxRightIs[0] = A[0] + maxLeftIs[n-1] = A[n-1] + res := A[0] + for i := 1; i < n; i++ { + maxRightIs[i] = max(A[i], maxRightIs[i-1]+A[i]) + j := n - i - 1 + maxLeftIs[j] = max(A[j], A[j]+maxLeftIs[j+1]) + // 最大的子数组,也有可能是仅由一段组成 + res = max(res, maxRightIs[i]) + } + for i := 1; i < n-1; i++ { + res = max(res, maxRightIs[i-1]+maxLeftIs[i+1]) + } + return res +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion_test.go b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion_test.go new file mode 100755 index 000000000..49d35ee7c --- /dev/null +++ b/Algorithms/1186.maximum-subarray-sum-with-one-deletion/maximum-subarray-sum-with-one-deletion_test.go @@ -0,0 +1,72 @@ +package problem1186 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans int +}{ + +{ + []int{ -50 }, +-50, +}, + + { +[]int{ 1,-2,-2,3 }, +3, + }, + + { + []int{11, -10, -11, 8, 7, -6, 9, 4, 11, 6, 5, 0}, + 50, + }, + + { + []int{1, -4, -5, -2, 5, 0, -1, 2}, + 7, + }, + + { + []int{8, -1, 6, -7, -4, 5, -4, 7, -6}, + 17, + }, + + { + []int{1, -2, 0, 3}, + 4, + }, + + { + []int{1, -2, -2, 3}, + 3, + }, + + { + []int{-1, -1, -1, -1}, + -1, + }, + + // 可以有多个 testcase +} + +func Test_maximumSum(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, maximumSum(tc.arr), "输入:%v", tc) + } +} + +func Benchmark_maximumSum(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maximumSum(tc.arr) + } + } +} diff --git a/Algorithms/1189.maximum-number-of-balloons/1.jpeg b/Algorithms/1189.maximum-number-of-balloons/1.jpeg new file mode 100644 index 000000000..00c66e32e Binary files /dev/null and b/Algorithms/1189.maximum-number-of-balloons/1.jpeg differ diff --git a/Algorithms/1189.maximum-number-of-balloons/2.jpeg b/Algorithms/1189.maximum-number-of-balloons/2.jpeg new file mode 100644 index 000000000..1c5258c61 Binary files /dev/null and b/Algorithms/1189.maximum-number-of-balloons/2.jpeg differ diff --git a/Algorithms/1189.maximum-number-of-balloons/README.md b/Algorithms/1189.maximum-number-of-balloons/README.md new file mode 100755 index 000000000..4a5b872d9 --- /dev/null +++ b/Algorithms/1189.maximum-number-of-balloons/README.md @@ -0,0 +1,35 @@ +# [1189. Maximum Number of Balloons](https://leetcode.com/problems/maximum-number-of-balloons/) + +Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. + +You can use each character in text at most once. Return the maximum number of instances that can be formed. + +Example 1: + +![1](1.jpeg) + +```text +Input: text = "nlaebolko" +Output: 1 +``` + +Example 2: + +![2](2.jpeg) + +```text +Input: text = "loonbalxballpoon" +Output: 2 +``` + +Example 3: + +```text +Input: text = "leetcode" +Output: 0 +``` + +Constraints: + +- `1 <= text.length <= 10^4` +- `text consists of lower case English letters only.` diff --git a/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons.go b/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons.go new file mode 100755 index 000000000..2d4294709 --- /dev/null +++ b/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons.go @@ -0,0 +1,29 @@ +package problem1189 + +func maxNumberOfBalloons(text string) int { + b, a, l, o, n := 0, 0, 0, 0, 0 + for _, r := range text { + switch r { + case 'b': + b++ + case 'a': + a++ + case 'l': + l++ + case 'o': + o++ + case 'n': + n++ + } + } + res := min(b, min(a, n)) + res = min(res, min(l/2, o/2)) + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons_test.go b/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons_test.go new file mode 100755 index 000000000..f0f7c6d9a --- /dev/null +++ b/Algorithms/1189.maximum-number-of-balloons/maximum-number-of-balloons_test.go @@ -0,0 +1,52 @@ +package problem1189 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + text string + ans int +}{ + + { + "nlaeolko", + 0, + }, + + { + "nlaebolko", + 1, + }, + + { + "loonbalxballpoon", + 2, + }, + + { + "leetcode", + 0, + }, + + // 可以有多个 testcase +} + +func Test_maxNumberOfBalloons(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, maxNumberOfBalloons(tc.text), "输入:%v", tc) + } +} + +func Benchmark_maxNumberOfBalloons(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + maxNumberOfBalloons(tc.text) + } + } +} diff --git a/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/README.md b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/README.md new file mode 100755 index 000000000..f1d0bb5a2 --- /dev/null +++ b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/README.md @@ -0,0 +1,43 @@ +# [1190. Reverse Substrings Between Each Pair of Parentheses](https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/) + +You are given a string s that consists of lower case English letters and brackets. + +Reverse the strings in each pair of matching parentheses, starting from the innermost one. + +Your result should not contain any brackets. + +Example 1: + +```text +Input: s = "(abcd)" +Output: "dcba" +``` + +Example 2: + +```text +Input: s = "(u(love)i)" +Output: "iloveu" +Explanation: The substring "love" is reversed first, then the whole string is reversed. +``` + +Example 3: + +```text +Input: s = "(ed(et(oc))el)" +Output: "leetcode" +Explanation: First, we reverse the substring "oc", then "etco", and finally, the whole string. +``` + +Example 4: + +```text +Input: s = "a(bcdefghijkl(mno)p)q" +Output: "apmnolkjihgfedcbq" +``` + +Constraints: + +- 0 <= s.length <= 2000 +- s only contains lower case English characters and parentheses. +- It's guaranteed that all parentheses are balanced. diff --git a/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses.go b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses.go new file mode 100755 index 000000000..0693d3b04 --- /dev/null +++ b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses.go @@ -0,0 +1,35 @@ +package problem1190 + +import "strings" + +// ref: https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/discuss/383670/JavaC%2B%2BPython-Why-not-O(N) + +func reverseParentheses(s string) string { + n := len(s) + stack, top := make([]int, n), -1 + pair := make([]int, n) + + for i := 0; i < n; i++ { + switch s[i] { + case '(': + top++ + stack[top] = i + case ')': + j := stack[top] + top-- + pair[i], pair[j] = j, i + } + } + var sb strings.Builder + + for i, d := 0, 1; i < n; i += d { + if s[i] == '(' || s[i] == ')' { + i = pair[i] + d = -d + } else { + sb.WriteByte(s[i]) + } + } + + return sb.String() +} diff --git a/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses_test.go b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses_test.go new file mode 100755 index 000000000..b691d366d --- /dev/null +++ b/Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses/reverse-substrings-between-each-pair-of-parentheses_test.go @@ -0,0 +1,67 @@ +package problem1190 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans string +}{ + + { + "(x(ab)y(cd)z)", + "zcdyabx", + }, + + { + "(uoy(love)mi(hate)ko)", + "okhateimloveyou", + }, + + { + "(u(love)i(love)k)", + "kloveiloveu", + }, + + { + "(abcd)", + "dcba", + }, + + { + "(u(love)i)", + "iloveu", + }, + + { + "(ed(et(oc))el)", + "leetcode", + }, + + { + "a(bcdefghijkl(mno)p)q", + "apmnolkjihgfedcbq", + }, + + // 可以有多个 testcase +} + +func Test_reverseParentheses(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, reverseParentheses(tc.s), "输入:%v", tc) + } +} + +func Benchmark_reverseParentheses(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + reverseParentheses(tc.s) + } + } +} diff --git a/Algorithms/1200.minimum-absolute-difference/README.md b/Algorithms/1200.minimum-absolute-difference/README.md new file mode 100755 index 000000000..003216b21 --- /dev/null +++ b/Algorithms/1200.minimum-absolute-difference/README.md @@ -0,0 +1,36 @@ +# [1200. Minimum Absolute Difference](https://leetcode.com/problems/minimum-absolute-difference/) + +Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. + +Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows + +- a, b are from arr +- a < b +- b - a equals to the minimum absolute difference of any two elements in arr + +Example 1: + +```text +Input: arr = [4,2,1,3] +Output: [[1,2],[2,3],[3,4]] +Explanation: The minimum absolute difference is 1. List all pairs with difference equal to 1 in ascending order. +``` + +Example 2: + +```text +Input: arr = [1,3,6,10,15] +Output: [[1,3]] +``` + +Example 3: + +```text +Input: arr = [3,8,-10,23,19,-4,-14,27] +Output: [[-14,-10],[19,23],[23,27]] +``` + +Constraints: + +- `2 <= arr.length <= 10^5` +- `-10^6 <= arr[i] <= 10^6` diff --git a/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference.go b/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference.go new file mode 100755 index 000000000..1a5afda7b --- /dev/null +++ b/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference.go @@ -0,0 +1,33 @@ +package problem1200 + +import ( + "math" + "sort" +) + +func minimumAbsDifference(A []int) [][]int { + sort.Ints(A) + n := len(A) + + minDiff := math.MaxInt64 + for i := 1; i < n; i++ { + minDiff = min(minDiff, A[i]-A[i-1]) + } + + res := make([][]int, 0, n) + + for i := 1; i < n; i++ { + if A[i]-A[i-1] == minDiff { + res = append(res, []int{A[i-1], A[i]}) + } + } + + return res +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference_test.go b/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference_test.go new file mode 100755 index 000000000..d53f38683 --- /dev/null +++ b/Algorithms/1200.minimum-absolute-difference/minimum-absolute-difference_test.go @@ -0,0 +1,47 @@ +package problem1200 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + arr []int + ans [][]int +}{ + + { + []int{4, 2, 1, 3}, + [][]int{{1, 2}, {2, 3}, {3, 4}}, + }, + + { + []int{1, 3, 6, 10, 15}, + [][]int{{1, 3}}, + }, + + { + []int{3, 8, -10, 23, 19, -4, -14, 27}, + [][]int{{-14, -10}, {19, 23}, {23, 27}}, + }, + + // 可以有多个 testcase +} + +func Test_minimumAbsDifference(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, minimumAbsDifference(tc.arr), "输入:%v", tc) + } +} + +func Benchmark_minimumAbsDifference(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minimumAbsDifference(tc.arr) + } + } +} diff --git a/Algorithms/1202.smallest-string-with-swaps/README.md b/Algorithms/1202.smallest-string-with-swaps/README.md new file mode 100755 index 000000000..946ce063f --- /dev/null +++ b/Algorithms/1202.smallest-string-with-swaps/README.md @@ -0,0 +1,46 @@ +# [1202. Smallest String With Swaps](https://leetcode.com/problems/smallest-string-with-swaps/) + +You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string. + +You can swap the characters at any pair of indices in the given pairs any number of times. + +Return the lexicographically smallest string that s can be changed to after using the swaps. + +Example 1: + +```text +Input: s = "dcab", pairs = [[0,3],[1,2]] +Output: "bacd" +Explanation: +Swap s[0] and s[3], s = "bcad" +Swap s[1] and s[2], s = "bacd" +``` + +Example 2: + +```text +Input: s = "dcab", pairs = [[0,3],[1,2],[0,2]] +Output: "abcd" +Explanation: +Swap s[0] and s[3], s = "bcad" +Swap s[0] and s[2], s = "acbd" +Swap s[1] and s[2], s = "abcd" +``` + +Example 3: + +```text +Input: s = "cba", pairs = [[0,1],[1,2]] +Output: "abc" +Explanation: +Swap s[0] and s[1], s = "bca" +Swap s[1] and s[2], s = "bac" +Swap s[0] and s[1], s = "abc" +``` + +Constraints: + +- `1 <= s.length <= 10^5` +- `0 <= pairs.length <= 10^5` +- `0 <= pairs[i][0], pairs[i][1] < s.length` +- `s only contains lower case English letters.` diff --git a/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps.go b/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps.go new file mode 100755 index 000000000..96b1e9528 --- /dev/null +++ b/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps.go @@ -0,0 +1,64 @@ +package problem1202 + +import "sort" + +func smallestStringWithSwaps(s string, pairs [][]int) string { + n := len(s) + uf := newUnionFind(n) + + for _, p := range pairs { + uf.connect(p[0], p[1]) + } + + groups := make(map[int][]int, n) + for c, p := range uf.parent { + p = uf.find(p) + // 相连的索引值,全部放在一起 + groups[p] = append(groups[p], c) + } + + bytes := []byte(s) + res := make([]byte, n) + for _, g := range groups { + size := len(g) + a := make([]int, size) + copy(a, g) + // a 中的索引值,按照其在 bytes 中对应的字符大小来排序 + sort.Slice(a, func(i, j int) bool { + return bytes[a[i]] < bytes[a[j]] + }) + // g 中的索引值,按照其自身的大小排序 + sort.Ints(g) + // 越小的位置,放入的值也越小 + for i := 0; i < size; i++ { + res[g[i]] = bytes[a[i]] + } + } + + return string(res) +} + +type unionFind struct { + parent []int +} + +func newUnionFind(size int) *unionFind { + parent := make([]int, size) + for i := range parent { + parent[i] = i + } + return &unionFind{ + parent: parent, + } +} + +func (uf *unionFind) connect(x, y int) { + uf.parent[uf.find(x)] = uf.find(y) +} + +func (uf *unionFind) find(i int) int { + if uf.parent[i] != i { + uf.parent[i] = uf.find(uf.parent[i]) + } + return uf.parent[i] +} diff --git a/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps_test.go b/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps_test.go new file mode 100755 index 000000000..636b8d4ec --- /dev/null +++ b/Algorithms/1202.smallest-string-with-swaps/smallest-string-with-swaps_test.go @@ -0,0 +1,51 @@ +package problem1202 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + pairs [][]int + ans string +}{ + + { + "dcab", + [][]int{{0, 3}, {1, 2}}, + "bacd", + }, + + { + "dcab", + [][]int{{0, 3}, {1, 2}, {0, 2}}, + "abcd", + }, + + { + "cba", + [][]int{{0, 1}, {1, 2}}, + "abc", + }, + + // 可以有多个 testcase +} + +func Test_smallestStringWithSwaps(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, smallestStringWithSwaps(tc.s, tc.pairs), "输入:%v", tc) + } +} + +func Benchmark_smallestStringWithSwaps(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + smallestStringWithSwaps(tc.s, tc.pairs) + } + } +} diff --git a/Algorithms/1207.unique-number-of-occurrences/README.md b/Algorithms/1207.unique-number-of-occurrences/README.md new file mode 100755 index 000000000..09d7d3d16 --- /dev/null +++ b/Algorithms/1207.unique-number-of-occurrences/README.md @@ -0,0 +1,30 @@ +# [1207. Unique Number of Occurrences](https://leetcode.com/problems/unique-number-of-occurrences/) + +Given an array of integers arr, write a function that returns true if and only if the number of occurrences of each value in the array is unique. + +Example 1: + +```text +Input: arr = [1,2,2,1,1,3] +Output: true +Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences. +``` + +Example 2: + +```text +Input: arr = [1,2] +Output: false +``` + +Example 3: + +```text +Input: arr = [-3,0,1,-3,1,1,1,-3,10,0] +Output: true +``` + +Constraints: + +- `1 <= arr.length <= 1000` +- `-1000 <= arr[i] <= 1000` diff --git a/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences.go b/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences.go new file mode 100755 index 000000000..fc2c7e5e3 --- /dev/null +++ b/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences.go @@ -0,0 +1,16 @@ +package problem1207 + +func uniqueOccurrences(A []int) bool { + count := make(map[int]int, len(A)) + for _, a := range A { + count[a]++ + } + hasSeen := make(map[int]bool, len(count)) + for _, c := range count { + if hasSeen[c] { + return false + } + hasSeen[c] = true + } + return true +} diff --git a/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences_test.go b/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences_test.go new file mode 100755 index 000000000..63254aeeb --- /dev/null +++ b/Algorithms/1207.unique-number-of-occurrences/unique-number-of-occurrences_test.go @@ -0,0 +1,47 @@ +package problem1207 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + A []int + ans bool +}{ + + { + []int{1, 2, 2, 1, 1, 3}, + true, + }, + + { + []int{1, 2}, + false, + }, + + { + []int{-3, 0, 1, -3, 1, 1, 1, -3, 10, 0}, + true, + }, + + // 可以有多个 testcase +} + +func Test_uniqueOccurrences(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, uniqueOccurrences(tc.A), "输入:%v", tc) + } +} + +func Benchmark_uniqueOccurrences(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + uniqueOccurrences(tc.A) + } + } +} diff --git a/Algorithms/1217.play-with-chips/README.md b/Algorithms/1217.play-with-chips/README.md new file mode 100755 index 000000000..d083b1af3 --- /dev/null +++ b/Algorithms/1217.play-with-chips/README.md @@ -0,0 +1,32 @@ +# [1217. Play with Chips](https://leetcode.com/problems/play-with-chips/) + +There are some chips, and the i-th chip is at position chips[i]. + +You can perform any of the two following types of moves any number of times (possibly zero) on any chip: + +- Move the i-th chip by 2 units to the left or to the right with a cost of 0. +- Move the i-th chip by 1 unit to the left or to the right with a cost of 1. + +There can be two or more chips at the same position initially. + +Return the minimum cost needed to move all the chips to the same position (any position). + +Example 1: + +```text +Input: chips = [1,2,3] +Output: 1 +Explanation: Second chip will be moved to positon 3 with cost 1. First chip will be moved to position 3 with cost 0. Total cost is 1. +``` + +Example 2: + +```text +Input: chips = [2,2,2,3,3] +Output: 2 +Explanation: Both fourth and fifth chip will be moved to position two with cost 1. Total minimum cost will be 2. + +Constraints: + +- `1 <= chips.length <= 100` +- `1 <= chips[i] <= 10^9` diff --git a/Algorithms/1217.play-with-chips/play-with-chips.go b/Algorithms/1217.play-with-chips/play-with-chips.go new file mode 100755 index 000000000..3d0acab15 --- /dev/null +++ b/Algorithms/1217.play-with-chips/play-with-chips.go @@ -0,0 +1,20 @@ +package problem1217 + +func minCostToMoveChips(chips []int) int { + odd, even := 0, 0 + for _, p := range chips { + if p%2 == 0 { + even++ + } else { + odd++ + } + } + return min(odd, even) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/Algorithms/1217.play-with-chips/play-with-chips_test.go b/Algorithms/1217.play-with-chips/play-with-chips_test.go new file mode 100755 index 000000000..e9748d779 --- /dev/null +++ b/Algorithms/1217.play-with-chips/play-with-chips_test.go @@ -0,0 +1,42 @@ +package problem1217 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + chips []int + ans int +}{ + + { + []int{1, 2, 3}, + 1, + }, + + { + []int{2, 2, 2, 3, 3}, + 2, + }, + + // 可以有多个 testcase +} + +func Test_minCostToMoveChips(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, minCostToMoveChips(tc.chips), "输入:%v", tc) + } +} + +func Benchmark_minCostToMoveChips(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + minCostToMoveChips(tc.chips) + } + } +} diff --git a/Algorithms/1221.split-a-string-in-balanced-strings/README.md b/Algorithms/1221.split-a-string-in-balanced-strings/README.md new file mode 100755 index 000000000..6eadbaec3 --- /dev/null +++ b/Algorithms/1221.split-a-string-in-balanced-strings/README.md @@ -0,0 +1,36 @@ +# [1221. Split a String in Balanced Strings](https://leetcode.com/problems/split-a-string-in-balanced-strings/) + +Balanced strings are those who have equal quantity of 'L' and 'R' characters. + +Given a balanced string s split it in the maximum amount of balanced strings. + +Return the maximum amount of splitted balanced strings. + +Example 1: + +```text +Input: s = "RLRRLLRLRL" +Output: 4 +Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'. +``` + +Example 2: + +```text +Input: s = "RLLLLRRRLR" +Output: 3 +Explanation: s can be split into "RL", "LLLRRR", "LR", each substring contains same number of 'L' and 'R'. +``` + +Example 3: + +```text +Input: s = "LLLLRRRR" +Output: 1 +Explanation: s can be split into "LLLLRRRR". +``` + +Constraints: + +- `1 <= s.length <= 1000` +- `s[i] = 'L' or 'R'` diff --git a/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings.go b/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings.go new file mode 100755 index 000000000..4c6bf823a --- /dev/null +++ b/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings.go @@ -0,0 +1,16 @@ +package problem1221 + +func balancedStringSplit(s string) int { + res, count := 0, 0 + for _, b := range s { + if b == 'L' { + count++ + } else { + count-- + } + if count == 0 { + res++ + } + } + return res +} diff --git a/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings_test.go b/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings_test.go new file mode 100755 index 000000000..aa1084880 --- /dev/null +++ b/Algorithms/1221.split-a-string-in-balanced-strings/split-a-string-in-balanced-strings_test.go @@ -0,0 +1,47 @@ +package problem1221 + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +var tcs = []struct { + s string + ans int +}{ + + { + "RLRRLLRLRL", + 4, + }, + + { + "RLLLLRRRLR", + 3, + }, + + { + "LLLLRRRR", + 1, + }, + + // 可以有多个 testcase +} + +func Test_balancedStringSplit(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, balancedStringSplit(tc.s), "输入:%v", tc) + } +} + +func Benchmark_balancedStringSplit(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + balancedStringSplit(tc.s) + } + } +} diff --git a/Algorithms/go.mod b/Algorithms/go.mod new file mode 100644 index 000000000..c54be9340 --- /dev/null +++ b/Algorithms/go.mod @@ -0,0 +1,5 @@ +module github.com/aQuaYi/LeetCode-in-Go/Algorithms + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/Algorithms/go.sum b/Algorithms/go.sum new file mode 100644 index 000000000..e863f517e --- /dev/null +++ b/Algorithms/go.sum @@ -0,0 +1,10 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/Favorite.md b/Favorite.md new file mode 100755 index 000000000..fa6485fbb --- /dev/null +++ b/Favorite.md @@ -0,0 +1,350 @@ +# 我收藏的 345 题 + +|题号|题目|通过率|难度|收藏| +|:-:|:-|:-: | :-: | :-: | +|[0085](https://leetcode.com/problems/maximal-rectangle/)|[Maximal Rectangle](./Algorithms/0085.maximal-rectangle)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0087](https://leetcode.com/problems/scramble-string/)|[Scramble String](./Algorithms/0087.scramble-string)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0093](https://leetcode.com/problems/restore-ip-addresses/)|[Restore IP Addresses](./Algorithms/0093.restore-ip-addresses)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0095](https://leetcode.com/problems/unique-binary-search-trees-ii/)|[Unique Binary Search Trees II](./Algorithms/0095.unique-binary-search-trees-ii)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0097](https://leetcode.com/problems/interleaving-string/)|[Interleaving String](./Algorithms/0097.interleaving-string)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0098](https://leetcode.com/problems/validate-binary-search-tree/)|[Validate Binary Search Tree](./Algorithms/0098.validate-binary-search-tree)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0099](https://leetcode.com/problems/recover-binary-search-tree/)|[Recover Binary Search Tree](./Algorithms/0099.recover-binary-search-tree)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0101](https://leetcode.com/problems/symmetric-tree/)|[Symmetric Tree](./Algorithms/0101.symmetric-tree)|44%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0105](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)|[Construct Binary Tree from Preorder and Inorder Traversal](./Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0106](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)|[Construct Binary Tree from Inorder and Postorder Traversal](./Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0114](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)|[Flatten Binary Tree to Linked List](./Algorithms/0114.flatten-binary-tree-to-linked-list)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0115](https://leetcode.com/problems/distinct-subsequences/)|[Distinct Subsequences](./Algorithms/0115.distinct-subsequences)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0120](https://leetcode.com/problems/triangle/)|[Triangle](./Algorithms/0120.triangle)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0124](https://leetcode.com/problems/binary-tree-maximum-path-sum/)|[Binary Tree Maximum Path Sum](./Algorithms/0124.binary-tree-maximum-path-sum)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0126](https://leetcode.com/problems/word-ladder-ii/)|[Word Ladder II](./Algorithms/0126.word-ladder-ii)|19%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0127](https://leetcode.com/problems/word-ladder/)|[Word Ladder](./Algorithms/0127.word-ladder)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0130](https://leetcode.com/problems/surrounded-regions/)|[Surrounded Regions](./Algorithms/0130.surrounded-regions)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0131](https://leetcode.com/problems/palindrome-partitioning/)|[Palindrome Partitioning](./Algorithms/0131.palindrome-partitioning)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0132](https://leetcode.com/problems/palindrome-partitioning-ii/)|[Palindrome Partitioning II](./Algorithms/0132.palindrome-partitioning-ii)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0134](https://leetcode.com/problems/gas-station/)|[Gas Station](./Algorithms/0134.gas-station)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0139](https://leetcode.com/problems/word-break/)|[Word Break](./Algorithms/0139.word-break)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0140](https://leetcode.com/problems/word-break-ii/)|[Word Break II](./Algorithms/0140.word-break-ii)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0142](https://leetcode.com/problems/linked-list-cycle-ii/)|[Linked List Cycle II](./Algorithms/0142.linked-list-cycle-ii)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0143](https://leetcode.com/problems/reorder-list/)|[Reorder List](./Algorithms/0143.reorder-list)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0144](https://leetcode.com/problems/binary-tree-preorder-traversal/)|[Binary Tree Preorder Traversal](./Algorithms/0144.binary-tree-preorder-traversal)|53%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0146](https://leetcode.com/problems/lru-cache/)|[LRU Cache](./Algorithms/0146.lru-cache)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0147](https://leetcode.com/problems/insertion-sort-list/)|[Insertion Sort List](./Algorithms/0147.insertion-sort-list)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0148](https://leetcode.com/problems/sort-list/)|[Sort List](./Algorithms/0148.sort-list)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0149](https://leetcode.com/problems/max-points-on-a-line/)|[Max Points on a Line](./Algorithms/0149.max-points-on-a-line)|16%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0152](https://leetcode.com/problems/maximum-product-subarray/)|[Maximum Product Subarray](./Algorithms/0152.maximum-product-subarray)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0166](https://leetcode.com/problems/fraction-to-recurring-decimal/)|[Fraction to Recurring Decimal](./Algorithms/0166.fraction-to-recurring-decimal)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0168](https://leetcode.com/problems/excel-sheet-column-title/)|[Excel Sheet Column Title](./Algorithms/0168.excel-sheet-column-title)|29%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0169](https://leetcode.com/problems/majority-element/)|[Majority Element](./Algorithms/0169.majority-element)|54%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0173](https://leetcode.com/problems/binary-search-tree-iterator/)|[Binary Search Tree Iterator](./Algorithms/0173.binary-search-tree-iterator)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0174](https://leetcode.com/problems/dungeon-game/)|[Dungeon Game](./Algorithms/0174.dungeon-game)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0179](https://leetcode.com/problems/largest-number/)|[Largest Number](./Algorithms/0179.largest-number)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0188](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)|[Best Time to Buy and Sell Stock IV](./Algorithms/0188.best-time-to-buy-and-sell-stock-iv)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0198](https://leetcode.com/problems/house-robber/)|[House Robber](./Algorithms/0198.house-robber)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0201](https://leetcode.com/problems/bitwise-and-of-numbers-range/)|[Bitwise AND of Numbers Range](./Algorithms/0201.bitwise-and-of-numbers-range)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0204](https://leetcode.com/problems/count-primes/)|[Count Primes](./Algorithms/0204.count-primes)|30%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0205](https://leetcode.com/problems/isomorphic-strings/)|[Isomorphic Strings](./Algorithms/0205.isomorphic-strings)|38%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0207](https://leetcode.com/problems/course-schedule/)|[Course Schedule](./Algorithms/0207.course-schedule)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0208](https://leetcode.com/problems/implement-trie-prefix-tree/)|[Implement Trie (Prefix Tree)](./Algorithms/0208.implement-trie-prefix-tree)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0211](https://leetcode.com/problems/add-and-search-word-data-structure-design/)|[Add and Search Word - Data structure design](./Algorithms/0211.add-and-search-word-data-structure-design)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0212](https://leetcode.com/problems/word-search-ii/)|[Word Search II](./Algorithms/0212.word-search-ii)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0214](https://leetcode.com/problems/shortest-palindrome/)|[Shortest Palindrome](./Algorithms/0214.shortest-palindrome)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0215](https://leetcode.com/problems/kth-largest-element-in-an-array/)|[Kth Largest Element in an Array](./Algorithms/0215.kth-largest-element-in-an-array)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0218](https://leetcode.com/problems/the-skyline-problem/)|[The Skyline Problem](./Algorithms/0218.the-skyline-problem)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0220](https://leetcode.com/problems/contains-duplicate-iii/)|[Contains Duplicate III](./Algorithms/0220.contains-duplicate-iii)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0221](https://leetcode.com/problems/maximal-square/)|[Maximal Square](./Algorithms/0221.maximal-square)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0229](https://leetcode.com/problems/majority-element-ii/)|[Majority Element II](./Algorithms/0229.majority-element-ii)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0233](https://leetcode.com/problems/number-of-digit-one/)|[Number of Digit One](./Algorithms/0233.number-of-digit-one)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0235](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)|[Lowest Common Ancestor of a Binary Search Tree](./Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree)|46%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0236](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)|[Lowest Common Ancestor of a Binary Tree](./Algorithms/0236.lowest-common-ancestor-of-a-binary-tree)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0237](https://leetcode.com/problems/delete-node-in-a-linked-list/)|[Delete Node in a Linked List](./Algorithms/0237.delete-node-in-a-linked-list)|56%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0239](https://leetcode.com/problems/sliding-window-maximum/)|[Sliding Window Maximum](./Algorithms/0239.sliding-window-maximum)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0240](https://leetcode.com/problems/search-a-2d-matrix-ii/)|[Search a 2D Matrix II](./Algorithms/0240.search-a-2d-matrix-ii)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0260](https://leetcode.com/problems/single-number-iii/)|[Single Number III](./Algorithms/0260.single-number-iii)|58%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0264](https://leetcode.com/problems/ugly-number-ii/)|[Ugly Number II](./Algorithms/0264.ugly-number-ii)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0273](https://leetcode.com/problems/integer-to-english-words/)|[Integer to English Words](./Algorithms/0273.integer-to-english-words)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0275](https://leetcode.com/problems/h-index-ii/)|[H-Index II](./Algorithms/0275.h-index-ii)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0279](https://leetcode.com/problems/perfect-squares/)|[Perfect Squares](./Algorithms/0279.perfect-squares)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0282](https://leetcode.com/problems/expression-add-operators/)|[Expression Add Operators](./Algorithms/0282.expression-add-operators)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0287](https://leetcode.com/problems/find-the-duplicate-number/)|[Find the Duplicate Number](./Algorithms/0287.find-the-duplicate-number)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0289](https://leetcode.com/problems/game-of-life/)|[Game of Life](./Algorithms/0289.game-of-life)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0292](https://leetcode.com/problems/nim-game/)|[Nim Game](./Algorithms/0292.nim-game)|55%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0295](https://leetcode.com/problems/find-median-from-data-stream/)|[Find Median from Data Stream](./Algorithms/0295.find-median-from-data-stream)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0300](https://leetcode.com/problems/longest-increasing-subsequence/)|[Longest Increasing Subsequence](./Algorithms/0300.longest-increasing-subsequence)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0301](https://leetcode.com/problems/remove-invalid-parentheses/)|[Remove Invalid Parentheses](./Algorithms/0301.remove-invalid-parentheses)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0309](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/)|[Best Time to Buy and Sell Stock with Cooldown](./Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0312](https://leetcode.com/problems/burst-balloons/)|[Burst Balloons](./Algorithms/0312.burst-balloons)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0313](https://leetcode.com/problems/super-ugly-number/)|[Super Ugly Number](./Algorithms/0313.super-ugly-number)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0316](https://leetcode.com/problems/remove-duplicate-letters/)|[Remove Duplicate Letters](./Algorithms/0316.remove-duplicate-letters)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0318](https://leetcode.com/problems/maximum-product-of-word-lengths/)|[Maximum Product of Word Lengths](./Algorithms/0318.maximum-product-of-word-lengths)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0319](https://leetcode.com/problems/bulb-switcher/)|[Bulb Switcher](./Algorithms/0319.bulb-switcher)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0321](https://leetcode.com/problems/create-maximum-number/)|[Create Maximum Number](./Algorithms/0321.create-maximum-number)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0322](https://leetcode.com/problems/coin-change/)|[Coin Change](./Algorithms/0322.coin-change)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0326](https://leetcode.com/problems/power-of-three/)|[Power of Three](./Algorithms/0326.power-of-three)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0327](https://leetcode.com/problems/count-of-range-sum/)|[Count of Range Sum](./Algorithms/0327.count-of-range-sum)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0328](https://leetcode.com/problems/odd-even-linked-list/)|[Odd Even Linked List](./Algorithms/0328.odd-even-linked-list)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0329](https://leetcode.com/problems/longest-increasing-path-in-a-matrix/)|[Longest Increasing Path in a Matrix](./Algorithms/0329.longest-increasing-path-in-a-matrix)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0331](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/)|[Verify Preorder Serialization of a Binary Tree](./Algorithms/0331.verify-preorder-serialization-of-a-binary-tree)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0332](https://leetcode.com/problems/reconstruct-itinerary/)|[Reconstruct Itinerary](./Algorithms/0332.reconstruct-itinerary)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0334](https://leetcode.com/problems/increasing-triplet-subsequence/)|[Increasing Triplet Subsequence](./Algorithms/0334.increasing-triplet-subsequence)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0336](https://leetcode.com/problems/palindrome-pairs/)|[Palindrome Pairs](./Algorithms/0336.palindrome-pairs)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0337](https://leetcode.com/problems/house-robber-iii/)|[House Robber III](./Algorithms/0337.house-robber-iii)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0350](https://leetcode.com/problems/intersection-of-two-arrays-ii/)|[Intersection of Two Arrays II](./Algorithms/0350.intersection-of-two-arrays-ii)|49%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0354](https://leetcode.com/problems/russian-doll-envelopes/)|[Russian Doll Envelopes](./Algorithms/0354.russian-doll-envelopes)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0355](https://leetcode.com/problems/design-twitter/)|[Design Twitter](./Algorithms/0355.design-twitter)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0357](https://leetcode.com/problems/count-numbers-with-unique-digits/)|[Count Numbers with Unique Digits](./Algorithms/0357.count-numbers-with-unique-digits)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0363](https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/)|[Max Sum of Rectangle No Larger Than K](./Algorithms/0363.max-sum-of-rectangle-no-larger-than-k)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0365](https://leetcode.com/problems/water-and-jug-problem/)|[Water and Jug Problem](./Algorithms/0365.water-and-jug-problem)|29%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0368](https://leetcode.com/problems/largest-divisible-subset/)|[Largest Divisible Subset](./Algorithms/0368.largest-divisible-subset)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0371](https://leetcode.com/problems/sum-of-two-integers/)|[Sum of Two Integers](./Algorithms/0371.sum-of-two-integers)|50%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0373](https://leetcode.com/problems/find-k-pairs-with-smallest-sums/)|[Find K Pairs with Smallest Sums](./Algorithms/0373.find-k-pairs-with-smallest-sums)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0376](https://leetcode.com/problems/wiggle-subsequence/)|[Wiggle Subsequence](./Algorithms/0376.wiggle-subsequence)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0378](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/)|[Kth Smallest Element in a Sorted Matrix](./Algorithms/0378.kth-smallest-element-in-a-sorted-matrix)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0380](https://leetcode.com/problems/insert-delete-getrandom-o1/)|[Insert Delete GetRandom O(1)](./Algorithms/0380.insert-delete-getrandom-o1)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0381](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/)|[Insert Delete GetRandom O(1) - Duplicates allowed](./Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0384](https://leetcode.com/problems/shuffle-an-array/)|[Shuffle an Array](./Algorithms/0384.shuffle-an-array)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0385](https://leetcode.com/problems/mini-parser/)|[Mini Parser](./Algorithms/0385.mini-parser)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0390](https://leetcode.com/problems/elimination-game/)|[Elimination Game](./Algorithms/0390.elimination-game)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0392](https://leetcode.com/problems/is-subsequence/)|[Is Subsequence](./Algorithms/0392.is-subsequence)|47%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0393](https://leetcode.com/problems/utf-8-validation/)|[UTF-8 Validation](./Algorithms/0393.utf-8-validation)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0396](https://leetcode.com/problems/rotate-function/)|[Rotate Function](./Algorithms/0396.rotate-function)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0397](https://leetcode.com/problems/integer-replacement/)|[Integer Replacement](./Algorithms/0397.integer-replacement)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0399](https://leetcode.com/problems/evaluate-division/)|[Evaluate Division](./Algorithms/0399.evaluate-division)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0400](https://leetcode.com/problems/nth-digit/)|[Nth Digit](./Algorithms/0400.nth-digit)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0402](https://leetcode.com/problems/remove-k-digits/)|[Remove K Digits](./Algorithms/0402.remove-k-digits)|27%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0403](https://leetcode.com/problems/frog-jump/)|[Frog Jump](./Algorithms/0403.frog-jump)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0406](https://leetcode.com/problems/queue-reconstruction-by-height/)|[Queue Reconstruction by Height](./Algorithms/0406.queue-reconstruction-by-height)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0416](https://leetcode.com/problems/partition-equal-subset-sum/)|[Partition Equal Subset Sum](./Algorithms/0416.partition-equal-subset-sum)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0420](https://leetcode.com/problems/strong-password-checker/)|[Strong Password Checker](./Algorithms/0420.strong-password-checker)|16%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0421](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/)|[Maximum XOR of Two Numbers in an Array](./Algorithms/0421.maximum-xor-of-two-numbers-in-an-array)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0424](https://leetcode.com/problems/longest-repeating-character-replacement/)|[Longest Repeating Character Replacement](./Algorithms/0424.longest-repeating-character-replacement)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0432](https://leetcode.com/problems/all-oone-data-structure/)|[All O`one Data Structure](./Algorithms/0432.all-oone-data-structure)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0435](https://leetcode.com/problems/non-overlapping-intervals/)|[Non-overlapping Intervals](./Algorithms/0435.non-overlapping-intervals)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0437](https://leetcode.com/problems/path-sum-iii/)|[Path Sum III](./Algorithms/0437.path-sum-iii)|44%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0440](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/)|[K-th Smallest in Lexicographical Order](./Algorithms/0440.k-th-smallest-in-lexicographical-order)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0443](https://leetcode.com/problems/string-compression/)|[String Compression](./Algorithms/0443.string-compression)|38%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0445](https://leetcode.com/problems/add-two-numbers-ii/)|[Add Two Numbers II](./Algorithms/0445.add-two-numbers-ii)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0446](https://leetcode.com/problems/arithmetic-slices-ii-subsequence/)|[Arithmetic Slices II - Subsequence](./Algorithms/0446.arithmetic-slices-ii-subsequence)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0450](https://leetcode.com/problems/delete-node-in-a-bst/)|[Delete Node in a BST](./Algorithms/0450.delete-node-in-a-bst)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0456](https://leetcode.com/problems/132-pattern/)|[132 Pattern](./Algorithms/0456.132-pattern)|27%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0459](https://leetcode.com/problems/repeated-substring-pattern/)|[Repeated Substring Pattern](./Algorithms/0459.repeated-substring-pattern)|40%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0464](https://leetcode.com/problems/can-i-win/)|[Can I Win](./Algorithms/0464.can-i-win)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0466](https://leetcode.com/problems/count-the-repetitions/)|[Count The Repetitions](./Algorithms/0466.count-the-repetitions)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0467](https://leetcode.com/problems/unique-substrings-in-wraparound-string/)|[Unique Substrings in Wraparound String](./Algorithms/0467.unique-substrings-in-wraparound-string)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0470](https://leetcode.com/problems/implement-rand10-using-rand7/)|[Implement Rand10() Using Rand7()](./Algorithms/0470.implement-rand10-using-rand7)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0473](https://leetcode.com/problems/matchsticks-to-square/)|[Matchsticks to Square](./Algorithms/0473.matchsticks-to-square)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0477](https://leetcode.com/problems/total-hamming-distance/)|[Total Hamming Distance](./Algorithms/0477.total-hamming-distance)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0480](https://leetcode.com/problems/sliding-window-median/)|[Sliding Window Median](./Algorithms/0480.sliding-window-median)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0483](https://leetcode.com/problems/smallest-good-base/)|[Smallest Good Base](./Algorithms/0483.smallest-good-base)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0488](https://leetcode.com/problems/zuma-game/)|[Zuma Game](./Algorithms/0488.zuma-game)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0491](https://leetcode.com/problems/increasing-subsequences/)|[Increasing Subsequences](./Algorithms/0491.increasing-subsequences)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0492](https://leetcode.com/problems/construct-the-rectangle/)|[Construct the Rectangle](./Algorithms/0492.construct-the-rectangle)|48%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0494](https://leetcode.com/problems/target-sum/)|[Target Sum](./Algorithms/0494.target-sum)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0501](https://leetcode.com/problems/find-mode-in-binary-search-tree/)|[Find Mode in Binary Search Tree](./Algorithms/0501.find-mode-in-binary-search-tree)|40%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0503](https://leetcode.com/problems/next-greater-element-ii/)|[Next Greater Element II](./Algorithms/0503.next-greater-element-ii)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0516](https://leetcode.com/problems/longest-palindromic-subsequence/)|[Longest Palindromic Subsequence](./Algorithms/0516.longest-palindromic-subsequence)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0517](https://leetcode.com/problems/super-washing-machines/)|[Super Washing Machines](./Algorithms/0517.super-washing-machines)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0518](https://leetcode.com/problems/coin-change-2/)|[Coin Change 2](./Algorithms/0518.coin-change-2)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0523](https://leetcode.com/problems/continuous-subarray-sum/)|[Continuous Subarray Sum](./Algorithms/0523.continuous-subarray-sum)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0525](https://leetcode.com/problems/contiguous-array/)|[Contiguous Array](./Algorithms/0525.contiguous-array)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0526](https://leetcode.com/problems/beautiful-arrangement/)|[Beautiful Arrangement](./Algorithms/0526.beautiful-arrangement)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0530](https://leetcode.com/problems/minimum-absolute-difference-in-bst/)|[Minimum Absolute Difference in BST](./Algorithms/0530.minimum-absolute-difference-in-bst)|51%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0542](https://leetcode.com/problems/01-matrix/)|[01 Matrix](./Algorithms/0542.01-matrix)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0546](https://leetcode.com/problems/remove-boxes/)|[Remove Boxes](./Algorithms/0546.remove-boxes)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0547](https://leetcode.com/problems/friend-circles/)|[Friend Circles](./Algorithms/0547.friend-circles)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0552](https://leetcode.com/problems/student-attendance-record-ii/)|[Student Attendance Record II](./Algorithms/0552.student-attendance-record-ii)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0560](https://leetcode.com/problems/subarray-sum-equals-k/)|[Subarray Sum Equals K](./Algorithms/0560.subarray-sum-equals-k)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0572](https://leetcode.com/problems/subtree-of-another-tree/)|[Subtree of Another Tree](./Algorithms/0572.subtree-of-another-tree)|42%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0576](https://leetcode.com/problems/out-of-boundary-paths/)|[Out of Boundary Paths](./Algorithms/0576.out-of-boundary-paths)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0581](https://leetcode.com/problems/shortest-unsorted-continuous-subarray/)|[Shortest Unsorted Continuous Subarray](./Algorithms/0581.shortest-unsorted-continuous-subarray)|30%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0583](https://leetcode.com/problems/delete-operation-for-two-strings/)|[Delete Operation for Two Strings](./Algorithms/0583.delete-operation-for-two-strings)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0587](https://leetcode.com/problems/erect-the-fence/)|[Erect the Fence](./Algorithms/0587.erect-the-fence)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0591](https://leetcode.com/problems/tag-validator/)|[Tag Validator](./Algorithms/0591.tag-validator)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0600](https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/)|[Non-negative Integers without Consecutive Ones](./Algorithms/0600.non-negative-integers-without-consecutive-ones)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0605](https://leetcode.com/problems/can-place-flowers/)|[Can Place Flowers](./Algorithms/0605.can-place-flowers)|31%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0611](https://leetcode.com/problems/valid-triangle-number/)|[Valid Triangle Number](./Algorithms/0611.valid-triangle-number)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0621](https://leetcode.com/problems/task-scheduler/)|[Task Scheduler](./Algorithms/0621.task-scheduler)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0628](https://leetcode.com/problems/maximum-product-of-three-numbers/)|[Maximum Product of Three Numbers](./Algorithms/0628.maximum-product-of-three-numbers)|46%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0630](https://leetcode.com/problems/course-schedule-iii/)|[Course Schedule III](./Algorithms/0630.course-schedule-iii)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0636](https://leetcode.com/problems/exclusive-time-of-functions/)|[Exclusive Time of Functions](./Algorithms/0636.exclusive-time-of-functions)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0638](https://leetcode.com/problems/shopping-offers/)|[Shopping Offers](./Algorithms/0638.shopping-offers)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0641](https://leetcode.com/problems/design-circular-deque/)|[Design Circular Deque](./Algorithms/0641.design-circular-deque)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0645](https://leetcode.com/problems/set-mismatch/)|[Set Mismatch](./Algorithms/0645.set-mismatch)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0647](https://leetcode.com/problems/palindromic-substrings/)|[Palindromic Substrings](./Algorithms/0647.palindromic-substrings)|58%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0649](https://leetcode.com/problems/dota2-senate/)|[Dota2 Senate](./Algorithms/0649.dota2-senate)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0654](https://leetcode.com/problems/maximum-binary-tree/)|[Maximum Binary Tree](./Algorithms/0654.maximum-binary-tree)|77%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0658](https://leetcode.com/problems/find-k-closest-elements/)|[Find K Closest Elements](./Algorithms/0658.find-k-closest-elements)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0659](https://leetcode.com/problems/split-array-into-consecutive-subsequences/)|[Split Array into Consecutive Subsequences](./Algorithms/0659.split-array-into-consecutive-subsequences)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0664](https://leetcode.com/problems/strange-printer/)|[Strange Printer](./Algorithms/0664.strange-printer)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0670](https://leetcode.com/problems/maximum-swap/)|[Maximum Swap](./Algorithms/0670.maximum-swap)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0673](https://leetcode.com/problems/number-of-longest-increasing-subsequence/)|[Number of Longest Increasing Subsequence](./Algorithms/0673.number-of-longest-increasing-subsequence)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0675](https://leetcode.com/problems/cut-off-trees-for-golf-event/)|[Cut Off Trees for Golf Event](./Algorithms/0675.cut-off-trees-for-golf-event)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0677](https://leetcode.com/problems/map-sum-pairs/)|[Map Sum Pairs](./Algorithms/0677.map-sum-pairs)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0678](https://leetcode.com/problems/valid-parenthesis-string/)|[Valid Parenthesis String](./Algorithms/0678.valid-parenthesis-string)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0679](https://leetcode.com/problems/24-game/)|[24 Game](./Algorithms/0679.24-game)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0685](https://leetcode.com/problems/redundant-connection-ii/)|[Redundant Connection II](./Algorithms/0685.redundant-connection-ii)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0686](https://leetcode.com/problems/repeated-string-match/)|[Repeated String Match](./Algorithms/0686.repeated-string-match)|31%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0691](https://leetcode.com/problems/stickers-to-spell-word/)|[Stickers to Spell Word](./Algorithms/0691.stickers-to-spell-word)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0695](https://leetcode.com/problems/max-area-of-island/)|[Max Area of Island](./Algorithms/0695.max-area-of-island)|59%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0698](https://leetcode.com/problems/partition-to-k-equal-sum-subsets/)|[Partition to K Equal Sum Subsets](./Algorithms/0698.partition-to-k-equal-sum-subsets)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0707](https://leetcode.com/problems/design-linked-list/)|[Design Linked List](./Algorithms/0707.design-linked-list)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0710](https://leetcode.com/problems/random-pick-with-blacklist/)|[Random Pick with Blacklist](./Algorithms/0710.random-pick-with-blacklist)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0712](https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/)|[Minimum ASCII Delete Sum for Two Strings](./Algorithms/0712.minimum-ascii-delete-sum-for-two-strings)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0713](https://leetcode.com/problems/subarray-product-less-than-k/)|[Subarray Product Less Than K](./Algorithms/0713.subarray-product-less-than-k)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0714](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/)|[Best Time to Buy and Sell Stock with Transaction Fee](./Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0718](https://leetcode.com/problems/maximum-length-of-repeated-subarray/)|[Maximum Length of Repeated Subarray](./Algorithms/0718.maximum-length-of-repeated-subarray)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0719](https://leetcode.com/problems/find-k-th-smallest-pair-distance/)|[Find K-th Smallest Pair Distance](./Algorithms/0719.find-k-th-smallest-pair-distance)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0721](https://leetcode.com/problems/accounts-merge/)|[Accounts Merge](./Algorithms/0721.accounts-merge)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0722](https://leetcode.com/problems/remove-comments/)|[Remove Comments](./Algorithms/0722.remove-comments)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0726](https://leetcode.com/problems/number-of-atoms/)|[Number of Atoms](./Algorithms/0726.number-of-atoms)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0730](https://leetcode.com/problems/count-different-palindromic-subsequences/)|[Count Different Palindromic Subsequences](./Algorithms/0730.count-different-palindromic-subsequences)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0731](https://leetcode.com/problems/my-calendar-ii/)|[My Calendar II](./Algorithms/0731.my-calendar-ii)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0736](https://leetcode.com/problems/parse-lisp-expression/)|[Parse Lisp Expression](./Algorithms/0736.parse-lisp-expression)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0739](https://leetcode.com/problems/daily-temperatures/)|[Daily Temperatures](./Algorithms/0739.daily-temperatures)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0740](https://leetcode.com/problems/delete-and-earn/)|[Delete and Earn](./Algorithms/0740.delete-and-earn)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0752](https://leetcode.com/problems/open-the-lock/)|[Open the Lock](./Algorithms/0752.open-the-lock)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0753](https://leetcode.com/problems/cracking-the-safe/)|[Cracking the Safe](./Algorithms/0753.cracking-the-safe)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0754](https://leetcode.com/problems/reach-a-number/)|[Reach a Number](./Algorithms/0754.reach-a-number)|33%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0756](https://leetcode.com/problems/pyramid-transition-matrix/)|[Pyramid Transition Matrix](./Algorithms/0756.pyramid-transition-matrix)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0770](https://leetcode.com/problems/basic-calculator-iv/)|[Basic Calculator IV](./Algorithms/0770.basic-calculator-iv)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0784](https://leetcode.com/problems/letter-case-permutation/)|[Letter Case Permutation](./Algorithms/0784.letter-case-permutation)|59%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0785](https://leetcode.com/problems/is-graph-bipartite/)|[Is Graph Bipartite?](./Algorithms/0785.is-graph-bipartite)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0786](https://leetcode.com/problems/k-th-smallest-prime-fraction/)|[K-th Smallest Prime Fraction](./Algorithms/0786.k-th-smallest-prime-fraction)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0787](https://leetcode.com/problems/cheapest-flights-within-k-stops/)|[Cheapest Flights Within K Stops](./Algorithms/0787.cheapest-flights-within-k-stops)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0790](https://leetcode.com/problems/domino-and-tromino-tiling/)|[Domino and Tromino Tiling](./Algorithms/0790.domino-and-tromino-tiling)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0792](https://leetcode.com/problems/number-of-matching-subsequences/)|[Number of Matching Subsequences](./Algorithms/0792.number-of-matching-subsequences)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0793](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/)|[Preimage Size of Factorial Zeroes Function](./Algorithms/0793.preimage-size-of-factorial-zeroes-function)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0795](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/)|[Number of Subarrays with Bounded Maximum](./Algorithms/0795.number-of-subarrays-with-bounded-maximum)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0798](https://leetcode.com/problems/smallest-rotation-with-highest-score/)|[Smallest Rotation with Highest Score](./Algorithms/0798.smallest-rotation-with-highest-score)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0799](https://leetcode.com/problems/champagne-tower/)|[Champagne Tower](./Algorithms/0799.champagne-tower)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0801](https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/)|[Minimum Swaps To Make Sequences Increasing](./Algorithms/0801.minimum-swaps-to-make-sequences-increasing)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0802](https://leetcode.com/problems/find-eventual-safe-states/)|[Find Eventual Safe States](./Algorithms/0802.find-eventual-safe-states)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0803](https://leetcode.com/problems/bricks-falling-when-hit/)|[Bricks Falling When Hit](./Algorithms/0803.bricks-falling-when-hit)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0805](https://leetcode.com/problems/split-array-with-same-average/)|[Split Array With Same Average](./Algorithms/0805.split-array-with-same-average)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0810](https://leetcode.com/problems/chalkboard-xor-game/)|[Chalkboard XOR Game](./Algorithms/0810.chalkboard-xor-game)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0813](https://leetcode.com/problems/largest-sum-of-averages/)|[Largest Sum of Averages](./Algorithms/0813.largest-sum-of-averages)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0815](https://leetcode.com/problems/bus-routes/)|[Bus Routes](./Algorithms/0815.bus-routes)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0818](https://leetcode.com/problems/race-car/)|[Race Car](./Algorithms/0818.race-car)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0820](https://leetcode.com/problems/short-encoding-of-words/)|[Short Encoding of Words](./Algorithms/0820.short-encoding-of-words)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0826](https://leetcode.com/problems/most-profit-assigning-work/)|[Most Profit Assigning Work](./Algorithms/0826.most-profit-assigning-work)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0827](https://leetcode.com/problems/making-a-large-island/)|[Making A Large Island](./Algorithms/0827.making-a-large-island)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0828](https://leetcode.com/problems/unique-letter-string/)|[Unique Letter String](./Algorithms/0828.unique-letter-string)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0829](https://leetcode.com/problems/consecutive-numbers-sum/)|[Consecutive Numbers Sum](./Algorithms/0829.consecutive-numbers-sum)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0834](https://leetcode.com/problems/sum-of-distances-in-tree/)|[Sum of Distances in Tree](./Algorithms/0834.sum-of-distances-in-tree)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0837](https://leetcode.com/problems/new-21-game/)|[New 21 Game](./Algorithms/0837.new-21-game)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0838](https://leetcode.com/problems/push-dominoes/)|[Push Dominoes](./Algorithms/0838.push-dominoes)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0839](https://leetcode.com/problems/similar-string-groups/)|[Similar String Groups](./Algorithms/0839.similar-string-groups)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0843](https://leetcode.com/problems/guess-the-word/)|[Guess the Word](./Algorithms/0843.guess-the-word)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0846](https://leetcode.com/problems/hand-of-straights/)|[Hand of Straights](./Algorithms/0846.hand-of-straights)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0847](https://leetcode.com/problems/shortest-path-visiting-all-nodes/)|[Shortest Path Visiting All Nodes](./Algorithms/0847.shortest-path-visiting-all-nodes)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0849](https://leetcode.com/problems/maximize-distance-to-closest-person/)|[Maximize Distance to Closest Person](./Algorithms/0849.maximize-distance-to-closest-person)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0850](https://leetcode.com/problems/rectangle-area-ii/)|[Rectangle Area II](./Algorithms/0850.rectangle-area-ii)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0851](https://leetcode.com/problems/loud-and-rich/)|[Loud and Rich](./Algorithms/0851.loud-and-rich)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0852](https://leetcode.com/problems/peak-index-in-a-mountain-array/)|[Peak Index in a Mountain Array](./Algorithms/0852.peak-index-in-a-mountain-array)|70%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0854](https://leetcode.com/problems/k-similar-strings/)|[K-Similar Strings](./Algorithms/0854.k-similar-strings)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0857](https://leetcode.com/problems/minimum-cost-to-hire-k-workers/)|[Minimum Cost to Hire K Workers](./Algorithms/0857.minimum-cost-to-hire-k-workers)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0862](https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/)|[Shortest Subarray with Sum at Least K](./Algorithms/0862.shortest-subarray-with-sum-at-least-k)|22%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0863](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/)|[All Nodes Distance K in Binary Tree](./Algorithms/0863.all-nodes-distance-k-in-binary-tree)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0864](https://leetcode.com/problems/shortest-path-to-get-all-keys/)|[Shortest Path to Get All Keys](./Algorithms/0864.shortest-path-to-get-all-keys)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0866](https://leetcode.com/problems/prime-palindrome/)|[Prime Palindrome](./Algorithms/0866.prime-palindrome)|21%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0879](https://leetcode.com/problems/profitable-schemes/)|[Profitable Schemes](./Algorithms/0879.profitable-schemes)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0895](https://leetcode.com/problems/maximum-frequency-stack/)|[Maximum Frequency Stack](./Algorithms/0895.maximum-frequency-stack)|58%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0896](https://leetcode.com/problems/monotonic-array/)|[Monotonic Array](./Algorithms/0896.monotonic-array)|56%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0897](https://leetcode.com/problems/increasing-order-search-tree/)|[Increasing Order Search Tree](./Algorithms/0897.increasing-order-search-tree)|66%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0898](https://leetcode.com/problems/bitwise-ors-of-subarrays/)|[Bitwise ORs of Subarrays](./Algorithms/0898.bitwise-ors-of-subarrays)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0901](https://leetcode.com/problems/online-stock-span/)|[Online Stock Span](./Algorithms/0901.online-stock-span)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0903](https://leetcode.com/problems/valid-permutations-for-di-sequence/)|[Valid Permutations for DI Sequence](./Algorithms/0903.valid-permutations-for-di-sequence)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0904](https://leetcode.com/problems/fruit-into-baskets/)|[Fruit Into Baskets](./Algorithms/0904.fruit-into-baskets)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0907](https://leetcode.com/problems/sum-of-subarray-minimums/)|[Sum of Subarray Minimums](./Algorithms/0907.sum-of-subarray-minimums)|29%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0909](https://leetcode.com/problems/snakes-and-ladders/)|[Snakes and Ladders](./Algorithms/0909.snakes-and-ladders)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0910](https://leetcode.com/problems/smallest-range-ii/)|[Smallest Range II](./Algorithms/0910.smallest-range-ii)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0911](https://leetcode.com/problems/online-election/)|[Online Election](./Algorithms/0911.online-election)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0913](https://leetcode.com/problems/cat-and-mouse/)|[Cat and Mouse](./Algorithms/0913.cat-and-mouse)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0915](https://leetcode.com/problems/partition-array-into-disjoint-intervals/)|[Partition Array into Disjoint Intervals](./Algorithms/0915.partition-array-into-disjoint-intervals)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0918](https://leetcode.com/problems/maximum-sum-circular-subarray/)|[Maximum Sum Circular Subarray](./Algorithms/0918.maximum-sum-circular-subarray)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0919](https://leetcode.com/problems/complete-binary-tree-inserter/)|[Complete Binary Tree Inserter](./Algorithms/0919.complete-binary-tree-inserter)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0920](https://leetcode.com/problems/number-of-music-playlists/)|[Number of Music Playlists](./Algorithms/0920.number-of-music-playlists)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0921](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/)|[Minimum Add to Make Parentheses Valid](./Algorithms/0921.minimum-add-to-make-parentheses-valid)|70%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0923](https://leetcode.com/problems/3sum-with-multiplicity/)|[3Sum With Multiplicity](./Algorithms/0923.3sum-with-multiplicity)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0932](https://leetcode.com/problems/beautiful-array/)|[Beautiful Array](./Algorithms/0932.beautiful-array)|54%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0936](https://leetcode.com/problems/stamping-the-sequence/)|[Stamping The Sequence](./Algorithms/0936.stamping-the-sequence)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0939](https://leetcode.com/problems/minimum-area-rectangle/)|[Minimum Area Rectangle](./Algorithms/0939.minimum-area-rectangle)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0940](https://leetcode.com/problems/distinct-subsequences-ii/)|[Distinct Subsequences II](./Algorithms/0940.distinct-subsequences-ii)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0943](https://leetcode.com/problems/find-the-shortest-superstring/)|[Find the Shortest Superstring](./Algorithms/0943.find-the-shortest-superstring)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0945](https://leetcode.com/problems/minimum-increment-to-make-array-unique/)|[Minimum Increment to Make Array Unique](./Algorithms/0945.minimum-increment-to-make-array-unique)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0947](https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/)|[Most Stones Removed with Same Row or Column](./Algorithms/0947.most-stones-removed-with-same-row-or-column)|54%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0948](https://leetcode.com/problems/bag-of-tokens/)|[Bag of Tokens](./Algorithms/0948.bag-of-tokens)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0949](https://leetcode.com/problems/largest-time-for-given-digits/)|[Largest Time for Given Digits](./Algorithms/0949.largest-time-for-given-digits)|34%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0952](https://leetcode.com/problems/largest-component-size-by-common-factor/)|[Largest Component Size by Common Factor](./Algorithms/0952.largest-component-size-by-common-factor)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0955](https://leetcode.com/problems/delete-columns-to-make-sorted-ii/)|[Delete Columns to Make Sorted II](./Algorithms/0955.delete-columns-to-make-sorted-ii)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0956](https://leetcode.com/problems/tallest-billboard/)|[Tallest Billboard](./Algorithms/0956.tallest-billboard)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0960](https://leetcode.com/problems/delete-columns-to-make-sorted-iii/)|[Delete Columns to Make Sorted III](./Algorithms/0960.delete-columns-to-make-sorted-iii)|52%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0962](https://leetcode.com/problems/maximum-width-ramp/)|[Maximum Width Ramp](./Algorithms/0962.maximum-width-ramp)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0964](https://leetcode.com/problems/least-operators-to-express-number/)|[Least Operators to Express Number](./Algorithms/0964.least-operators-to-express-number)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0971](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/)|[Flip Binary Tree To Match Preorder Traversal](./Algorithms/0971.flip-binary-tree-to-match-preorder-traversal)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0972](https://leetcode.com/problems/equal-rational-numbers/)|[Equal Rational Numbers](./Algorithms/0972.equal-rational-numbers)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0974](https://leetcode.com/problems/subarray-sums-divisible-by-k/)|[Subarray Sums Divisible by K](./Algorithms/0974.subarray-sums-divisible-by-k)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0975](https://leetcode.com/problems/odd-even-jump/)|[Odd Even Jump](./Algorithms/0975.odd-even-jump)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0976](https://leetcode.com/problems/largest-perimeter-triangle/)|[Largest Perimeter Triangle](./Algorithms/0976.largest-perimeter-triangle)|57%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0978](https://leetcode.com/problems/longest-turbulent-subarray/)|[Longest Turbulent Subarray](./Algorithms/0978.longest-turbulent-subarray)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0979](https://leetcode.com/problems/distribute-coins-in-binary-tree/)|[Distribute Coins in Binary Tree](./Algorithms/0979.distribute-coins-in-binary-tree)|67%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0980](https://leetcode.com/problems/unique-paths-iii/)|[Unique Paths III](./Algorithms/0980.unique-paths-iii)|71%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0982](https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/)|[Triples with Bitwise AND Equal To Zero](./Algorithms/0982.triples-with-bitwise-and-equal-to-zero)|54%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0983](https://leetcode.com/problems/minimum-cost-for-tickets/)|[Minimum Cost For Tickets](./Algorithms/0983.minimum-cost-for-tickets)|57%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0986](https://leetcode.com/problems/interval-list-intersections/)|[Interval List Intersections](./Algorithms/0986.interval-list-intersections)|64%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0991](https://leetcode.com/problems/broken-calculator/)|[Broken Calculator](./Algorithms/0991.broken-calculator)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0992](https://leetcode.com/problems/subarrays-with-k-different-integers/)|[Subarrays with K Different Integers](./Algorithms/0992.subarrays-with-k-different-integers)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0996](https://leetcode.com/problems/number-of-squareful-arrays/)|[Number of Squareful Arrays](./Algorithms/0996.number-of-squareful-arrays)|47%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1000](https://leetcode.com/problems/minimum-cost-to-merge-stones/)|[Minimum Cost to Merge Stones](./Algorithms/1000.minimum-cost-to-merge-stones)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1001](https://leetcode.com/problems/grid-illumination/)|[Grid Illumination](./Algorithms/1001.grid-illumination)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1004](https://leetcode.com/problems/max-consecutive-ones-iii/)|[Max Consecutive Ones III](./Algorithms/1004.max-consecutive-ones-iii)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1009](https://leetcode.com/problems/complement-of-base-10-integer/)|[Complement of Base 10 Integer](./Algorithms/1009.complement-of-base-10-integer)|59%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1011](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/)|[Capacity To Ship Packages Within D Days](./Algorithms/1011.capacity-to-ship-packages-within-d-days)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1012](https://leetcode.com/problems/numbers-with-repeated-digits/)|[Numbers With Repeated Digits](./Algorithms/1012.numbers-with-repeated-digits)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1015](https://leetcode.com/problems/smallest-integer-divisible-by-k/)|[Smallest Integer Divisible by K](./Algorithms/1015.smallest-integer-divisible-by-k)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1019](https://leetcode.com/problems/next-greater-node-in-linked-list/)|[Next Greater Node In Linked List](./Algorithms/1019.next-greater-node-in-linked-list)|56%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1022](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/)|[Sum of Root To Leaf Binary Numbers](./Algorithms/1022.sum-of-root-to-leaf-binary-numbers)|61%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1024](https://leetcode.com/problems/video-stitching/)|[Video Stitching](./Algorithms/1024.video-stitching)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1025](https://leetcode.com/problems/divisor-game/)|[Divisor Game](./Algorithms/1025.divisor-game)|65%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1026](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/)|[Maximum Difference Between Node and Ancestor](./Algorithms/1026.maximum-difference-between-node-and-ancestor)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1027](https://leetcode.com/problems/longest-arithmetic-sequence/)|[Longest Arithmetic Sequence](./Algorithms/1027.longest-arithmetic-sequence)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1028](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/)|[Recover a Tree From Preorder Traversal](./Algorithms/1028.recover-a-tree-from-preorder-traversal)|69%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1030](https://leetcode.com/problems/matrix-cells-in-distance-order/)|[Matrix Cells in Distance Order](./Algorithms/1030.matrix-cells-in-distance-order)|64%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1031](https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays/)|[Maximum Sum of Two Non-Overlapping Subarrays](./Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1032](https://leetcode.com/problems/stream-of-characters/)|[Stream of Characters](./Algorithms/1032.stream-of-characters)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1035](https://leetcode.com/problems/uncrossed-lines/)|[Uncrossed Lines](./Algorithms/1035.uncrossed-lines)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1039](https://leetcode.com/problems/minimum-score-triangulation-of-polygon/)|[Minimum Score Triangulation of Polygon](./Algorithms/1039.minimum-score-triangulation-of-polygon)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1040](https://leetcode.com/problems/moving-stones-until-consecutive-ii/)|[Moving Stones Until Consecutive II](./Algorithms/1040.moving-stones-until-consecutive-ii)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1042](https://leetcode.com/problems/flower-planting-with-no-adjacent/)|[Flower Planting With No Adjacent](./Algorithms/1042.flower-planting-with-no-adjacent)|47%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1043](https://leetcode.com/problems/partition-array-for-maximum-sum/)|[Partition Array for Maximum Sum](./Algorithms/1043.partition-array-for-maximum-sum)|62%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1044](https://leetcode.com/problems/longest-duplicate-substring/)|[Longest Duplicate Substring](./Algorithms/1044.longest-duplicate-substring)|23%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1048](https://leetcode.com/problems/longest-string-chain/)|[Longest String Chain](./Algorithms/1048.longest-string-chain)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1049](https://leetcode.com/problems/last-stone-weight-ii/)|[Last Stone Weight II](./Algorithms/1049.last-stone-weight-ii)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1054](https://leetcode.com/problems/distant-barcodes/)|[Distant Barcodes](./Algorithms/1054.distant-barcodes)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1071](https://leetcode.com/problems/greatest-common-divisor-of-strings/)|[Greatest Common Divisor of Strings](./Algorithms/1071.greatest-common-divisor-of-strings)|53%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1072](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows/)|[Flip Columns For Maximum Number of Equal Rows](./Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows)|59%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1073](https://leetcode.com/problems/adding-two-negabinary-numbers/)|[Adding Two Negabinary Numbers](./Algorithms/1073.adding-two-negabinary-numbers)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1074](https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/)|[Number of Submatrices That Sum to Target](./Algorithms/1074.number-of-submatrices-that-sum-to-target)|58%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1079](https://leetcode.com/problems/letter-tile-possibilities/)|[Letter Tile Possibilities](./Algorithms/1079.letter-tile-possibilities)|74%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1080](https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/)|[Insufficient Nodes in Root to Leaf Paths](./Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1089](https://leetcode.com/problems/duplicate-zeros/)|[Duplicate Zeros](./Algorithms/1089.duplicate-zeros)|58%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1092](https://leetcode.com/problems/shortest-common-supersequence/)|[Shortest Common Supersequence](./Algorithms/1092.shortest-common-supersequence)|49%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1105](https://leetcode.com/problems/filling-bookcase-shelves/)|[Filling Bookcase Shelves](./Algorithms/1105.filling-bookcase-shelves)|56%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1125](https://leetcode.com/problems/smallest-sufficient-team/)|[Smallest Sufficient Team](./Algorithms/1125.smallest-sufficient-team)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1129](https://leetcode.com/problems/shortest-path-with-alternating-colors/)|[Shortest Path with Alternating Colors](./Algorithms/1129.shortest-path-with-alternating-colors)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1130](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/)|[Minimum Cost Tree From Leaf Values](./Algorithms/1130.minimum-cost-tree-from-leaf-values)|62%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1131](https://leetcode.com/problems/maximum-of-absolute-value-expression/)|[Maximum of Absolute Value Expression](./Algorithms/1131.maximum-of-absolute-value-expression)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1137](https://leetcode.com/problems/n-th-tribonacci-number/)|[N-th Tribonacci Number](./Algorithms/1137.n-th-tribonacci-number)|57%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1138](https://leetcode.com/problems/alphabet-board-path/)|[Alphabet Board Path](./Algorithms/1138.alphabet-board-path)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1139](https://leetcode.com/problems/largest-1-bordered-square/)|[Largest 1-Bordered Square](./Algorithms/1139.largest-1-bordered-square)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1140](https://leetcode.com/problems/stone-game-ii/)|[Stone Game II](./Algorithms/1140.stone-game-ii)|60%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1145](https://leetcode.com/problems/binary-tree-coloring-game/)|[Binary Tree Coloring Game](./Algorithms/1145.binary-tree-coloring-game)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1146](https://leetcode.com/problems/snapshot-array/)|[Snapshot Array](./Algorithms/1146.snapshot-array)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1155](https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/)|[Number of Dice Rolls With Target Sum](./Algorithms/1155.number-of-dice-rolls-with-target-sum)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1157](https://leetcode.com/problems/online-majority-element-in-subarray/)|[Online Majority Element In Subarray](./Algorithms/1157.online-majority-element-in-subarray)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1163](https://leetcode.com/problems/last-substring-in-lexicographical-order/)|[Last Substring in Lexicographical Order](./Algorithms/1163.last-substring-in-lexicographical-order)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1172](https://leetcode.com/problems/dinner-plate-stacks/)|[Dinner Plate Stacks](./Algorithms/1172.dinner-plate-stacks)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1177](https://leetcode.com/problems/can-make-palindrome-from-substring/)|[Can Make Palindrome from Substring](./Algorithms/1177.can-make-palindrome-from-substring)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1178](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle/)|[Number of Valid Words for Each Puzzle](./Algorithms/1178.number-of-valid-words-for-each-puzzle)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1186](https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/)|[Maximum Subarray Sum with One Deletion](./Algorithms/1186.maximum-subarray-sum-with-one-deletion)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1190](https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/)|[Reverse Substrings Between Each Pair of Parentheses](./Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses)|57%|Medium|[❤](https://leetcode.com/list/oussv5j)| + diff --git a/GoLand.png b/GoLand.png new file mode 100644 index 000000000..e940ca6d2 Binary files /dev/null and b/GoLand.png differ diff --git a/Helper/Makefile b/Helper/Makefile new file mode 100644 index 000000000..0af580075 --- /dev/null +++ b/Helper/Makefile @@ -0,0 +1,4 @@ +build: + @go build + @mv Helper ../helper + diff --git a/Helper/README.md b/Helper/README.md new file mode 100644 index 000000000..3c73ded9e --- /dev/null +++ b/Helper/README.md @@ -0,0 +1,13 @@ +# helper + +## 配置方法 + +1. 在`.gitignore`中,添加一行`*.toml` +1. 在`LeetCode-in-Go`目录下,添加文本文件`config.toml`。 +1. 把以下内容复制到`config.toml`中。 +1. 把`config.toml`中的`test`分别修改为你的 leetcode `用户名`和`密码`。 + +```toml +Login="test" +Password="test" +``` \ No newline at end of file diff --git a/Helper/buildProblemDir.go b/Helper/buildProblemDir.go new file mode 100644 index 000000000..c9172d7fd --- /dev/null +++ b/Helper/buildProblemDir.go @@ -0,0 +1,212 @@ +package main + +import ( + "fmt" + "log" + "os" + "os/exec" + "runtime/debug" + "strings" + "syscall" + + "github.com/aQuaYi/GoKit" +) + +func buildProblemDir(problemNum int) { + log.Printf("~~ 开始生成第 %d 题的文件夹 ~~\n", problemNum) + + // 获取 LeetCode 的记录文件 + lc := newLeetCode() + + // 检查 problemNum 的合法性 + if problemNum >= len(lc.Problems) { + log.Panicf("%d 超出题目范围,请核查题号。", problemNum) + } + if lc.Problems[problemNum].ID == 0 { + log.Panicf("%d 号题不存,请核查题号。", problemNum) + } + if lc.Problems[problemNum].IsPaid { + log.Panicf("%d 号题需要付费。如果已经订阅,请注释掉本代码。", problemNum) + } + if lc.Problems[problemNum].HasNoGoOption { + log.Panicf("%d 号题,没有提供 Go 解答选项。请核查后,修改 unavailable.json 中的记录。", problemNum) + } + + // 需要创建答题文件夹 + build(lc.Problems[problemNum]) + + log.Printf("~~ 第 %d 题的文件夹,已经生成 ~~\n", problemNum) +} + +func build(p problem) { + if GoKit.Exist(p.Dir()) { + log.Panicf("第 %d 题的文件夹已经存在,请 **移除** %s 文件夹后,再尝试。", p.ID, p.Dir()) + } + + defer func() { + if err := recover(); err != nil { + debug.PrintStack() + log.Println(err) + log.Println("清理不必要的文件") + os.RemoveAll(p.Dir()) + } + }() + + mask := syscall.Umask(0) + defer syscall.Umask(mask) + + // 创建目录 + err := os.Mkdir(p.Dir(), 0755) + if err != nil { + log.Panicf("无法创建目录,%s :%s", p.Dir(), err) + } + + log.Printf("开始创建 %d %s 的文件夹...\n", p.ID, p.Title) + + // 利用 chrome 打开题目页面 + go func() { + cmd := exec.Command("google-chrome", p.link()) + _, err = cmd.Output() + if err != nil { + panic(err.Error()) + } + }() + + fc := getFunction(p.link()) + + fcName, para, ans, fc := parseFunction(fc) + + creatGo(p, fc, ans) + + creatGoTest(p, fcName, para, ans) + + creatREADME(p) + + log.Printf("%d.%s 的文件夹,创建完毕。\n", p.ID, p.Title) +} + +var typeMap = map[string]string{ + "int": "0", + "float64": "0", + "string": "\"\"", + "bool": "false", +} + +func creatGo(p problem, function, ansType string) { + fileFormat := `package %s +%s +%s +` + + treeNodeDefine := "" + if strings.Contains(function, "*TreeNode") { + treeNodeDefine = ` +import "github.com/aQuaYi/LeetCode-in-Go/kit" + +// TreeNode is pre-defined... +// type TreeNode struct { +// Val int +// Left *TreeNode +// Right *TreeNode +// } +type TreeNode = kit.TreeNode + +` + } + + content := fmt.Sprintf(fileFormat, p.packageName(), treeNodeDefine, function) + + if v, ok := typeMap[ansType]; ok { + content = strings.Replace(content, "nil", v, 1) + } + + filename := fmt.Sprintf("%s/%s.go", p.Dir(), p.TitleSlug) + + write(filename, content) + + vscodeOpen(filename) +} + +func creatGoTest(p problem, fcName, para, ansType string) { + testCasesFormat := `var tcs = []struct { + %s + ans %s +}{ + + + + // 可以有多个 testcase +}` + + para = strings.Replace(para, ",", "\n", -1) + + testCases := fmt.Sprintf(testCasesFormat, para, ansType) + + testFuncFormat := ` +func Test_%s(t *testing.T) { + a := assert.New(t) + + for _, tc := range tcs { + a.Equal(tc.ans, %s(%s), "输入:%s", tc) + } +}` + tcPara := getTcPara(para) + testFunc := fmt.Sprintf(testFuncFormat, fcName, fcName, tcPara, `%v`) + + benchFuncFormat := ` +func Benchmark_%s(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, tc := range tcs { + %s(%s) + } + } +}` + benchFunc := fmt.Sprintf(benchFuncFormat, fcName, fcName, tcPara) + + fileFormat := `package %s + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// tcs is testcase slice +%s +%s +%s +` + + content := fmt.Sprintf(fileFormat, p.packageName(), testCases, testFunc, benchFunc) + + filename := fmt.Sprintf("%s/%s_test.go", p.Dir(), p.TitleSlug) + + write(filename, content) + + vscodeOpen(filename) + +} + +// 把 函数的参数 变成 tc 的参数 +func getTcPara(para string) string { + // 把 para 按行切分 + paras := strings.Split(para, "\n") + + // 把单个参数按空格,切分成参数名和参数类型 + temp := make([][]string, len(paras)) + for i := range paras { + temp[i] = strings.Split(strings.TrimSpace(paras[i]), ` `) + } + + // 在参数名称前添加 "tc." 并组合在一起 + res := "" + for i := 0; i < len(temp); i++ { + res += ", tc." + temp[i][0] + } + + return res[2:] +} + +func (p problem) packageName() string { + return fmt.Sprintf("problem%04d", p.ID) +} diff --git a/Helper/buildReadme.go b/Helper/buildReadme.go new file mode 100644 index 000000000..f5c5344f3 --- /dev/null +++ b/Helper/buildReadme.go @@ -0,0 +1,70 @@ +package main + +import ( + "bytes" + "html/template" + "io/ioutil" + "log" + "os" +) + +func buildReadme() { + log.Println("开始,重建 README 文档") + + lc := newLeetCode() + + makeReadmeFile(lc) + + makeMyFavoriteFile(lc) + + log.Println("完成,重建 README 文档") +} + +func makeReadmeFile(lc *leetcode) { + file := "README.md" + os.Remove(file) + + var b bytes.Buffer + + tmpl := template.Must(template.New("readme").Parse(readTMPL("template.markdown"))) + + err := tmpl.Execute(&b, lc) + if err != nil { + log.Fatal(err) + } + + // 保存 README.md 文件 + write(file, string(b.Bytes())) +} + +func readTMPL(path string) string { + file, err := os.Open(path) + if err != nil { + log.Fatal(err) + } + defer file.Close() + + data, err := ioutil.ReadAll(file) + if err != nil { + log.Fatal(err) + } + + return string(data) +} + +func makeMyFavoriteFile(lc *leetcode) { + file := "Favorite.md" + os.Remove(file) + + var b bytes.Buffer + + tmpl := template.Must(template.New("favorite").Parse(readTMPL("favorite.markdown"))) + + err := tmpl.Execute(&b, lc) + if err != nil { + log.Fatal(err) + } + + // 保存 README.md 文件 + write(file, string(b.Bytes())) +} diff --git a/Helper/cli.go b/Helper/cli.go new file mode 100644 index 000000000..8b482c7f1 --- /dev/null +++ b/Helper/cli.go @@ -0,0 +1,76 @@ +package main + +import ( + "flag" + "fmt" + "log" + + "os" +) + +const ( + // USAGE 说明了程序的使用方式 + USAGE = `使用方法: + helper readme + 重新生成项目的 README.md 文件 + helper prepare -number N + 生成第 N 题的答题文件夹 + helper task -prefix PRE -first FIRST -last LAST + 对于所有 [FIRST, LAST] 之内的题目,生成类似 + PRE - 770 - #hard - 43% - Basic Calculator IV + 的条目,并保存到文件 tasks.txt 中 +` +) + +// CLI 负责处理命令行参数 +type CLI struct{} + +func (c *CLI) printUsage() { + fmt.Println(USAGE) +} + +func (c *CLI) checkArgs() { + if len(os.Args) < 2 { + c.printUsage() + os.Exit(1) + } +} + +// Run parses command line arguments and processes commands +func (c *CLI) Run() { + c.checkArgs() + + readmeCmd := flag.NewFlagSet("readme", flag.ExitOnError) + + prepareCmd := flag.NewFlagSet("prepare", flag.ExitOnError) + problemNumber := prepareCmd.Int("number", 0, "请输入你想要准备的题目的题号") + + taskCmd := flag.NewFlagSet("task", flag.ExitOnError) + prefix := taskCmd.String("prefix", "", "答题任务的前缀") + first := taskCmd.Int("first", 0, "答题任务的最小题号") + last := taskCmd.Int("last", 0, "答题任务的最大题号") + + switch os.Args[1] { + case "readme": + err := readmeCmd.Parse(os.Args[2:]) + check(err) + buildReadme() + case "prepare": + err := prepareCmd.Parse(os.Args[2:]) + check(err) + buildProblemDir(*problemNumber) + case "task": + err := taskCmd.Parse(os.Args[2:]) + check(err) + makeTaskFile(*prefix, *first, *last) + default: + c.printUsage() + os.Exit(1) + } +} + +func check(err error) { + if err != nil { + log.Panic(err) + } +} diff --git a/Helper/config.go b/Helper/config.go new file mode 100644 index 000000000..b01103c76 --- /dev/null +++ b/Helper/config.go @@ -0,0 +1,48 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/toml" +) + +const ( + configTOML = "config.toml" +) + +type config struct { + Username string + Password string + + // 以下是电子邮件设置 + SMTP string + Port int + From string + To string + EmailPassword string +} + +func (c config) String() string { + format := "Username: %s, Password: %s, SMTP: %s, Port: %d, From: %s, To: %s, EmailPassword: %s " + return fmt.Sprintf(format, + c.Username, + c.Password, + c.SMTP, + c.Port, + c.From, + c.To, + c.EmailPassword) +} + +func getConfig() *config { + cfg := new(config) + + if _, err := toml.DecodeFile(configTOML, &cfg); err != nil { + log.Panicf(err.Error()) + } + + // log.Printf("get config: %s", cfg) + + return cfg +} diff --git a/Helper/dida.go b/Helper/dida.go new file mode 100644 index 000000000..a13a286a4 --- /dev/null +++ b/Helper/dida.go @@ -0,0 +1,84 @@ +package main + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "time" + + mail "gopkg.in/gomail.v2" +) + +const ( + didaTaskFile = "dida.task.txt" +) + +func dida(prefix string, p problem) { + // 不再往滴答清单中添加任务 + // task := p.didaTask(prefix) + // mailToDida(task) +} + +func mailToDida(task string) { + task += " ^LeetCode " + task = delay(task) + + cfg := getConfig() + if cfg.SMTP == "" || cfg.Port == 0 || cfg.EmailPassword == "" || + cfg.From == "" || cfg.To == "" { + log.Printf("%v, 没有配置 Email,无法发送任务", cfg) + saveLocal(task) + return + } + + m := mail.NewMessage() + m.SetHeader("From", cfg.From) + m.SetHeader("To", cfg.To) + m.SetHeader("Subject", task) + m.SetBody("text/plain", fmt.Sprintf("添加日期 %s", time.Now())) + d := mail.NewDialer(cfg.SMTP, cfg.Port, cfg.From, cfg.EmailPassword) + + if err := d.DialAndSend(m); err != nil { + log.Println("无法发送任务到 滴答清单:", err) + saveLocal(task) + return + } + + log.Printf("已经在滴答清单中添加任务: %s", task) +} + +func saveLocal(task string) { + ts, err := ioutil.ReadFile(didaTaskFile) + if err != nil { + if !os.IsNotExist(err) { + log.Panicf("无法读取 %s:%s\n", didaTaskFile, err) + } + f, _ := os.Create(didaTaskFile) + f.Close() + } + + ts = append(ts, []byte(task+"\n")...) + + err = ioutil.WriteFile(didaTaskFile, ts, 0755) + if err != nil { + log.Panicf("无法写入 %s: %s\n", didaTaskFile, err) + } + + log.Printf("新建任务已经写入 %s,请手动添加到滴答清单", didaTaskFile) +} + +var m = map[string]time.Duration{ + "#do": 15, + "#re": 90, + "#fa": 30, +} + +func delay(task string) string { + key := task[:3] + if day, ok := m[key]; ok { + task += time.Now().Add(time.Hour * 24 * day).Format("2006-01-02") + m[key] += 2 + } + return task +} diff --git a/Helper/leetcode-algorithms.go b/Helper/leetcode-algorithms.go new file mode 100644 index 000000000..37cc27218 --- /dev/null +++ b/Helper/leetcode-algorithms.go @@ -0,0 +1,59 @@ +package main + +import ( + "encoding/json" + "log" +) + +// algorithms 保存API信息 +type algorithms struct { + Name string `json:"category_slug"` + User string `json:"user_name"` + ACEasy int `json:"ac_easy"` + ACMedium int `json:"ac_medium"` + ACHard int `json:"ac_hard"` + AC int `json:"num_solved"` + Problems []problemStatus `json:"stat_status_pairs"` +} + +type problemStatus struct { + Status string `json:"status"` + State `json:"stat"` + IsFavor bool `json:"is_favor"` + IsPaid bool `json:"paid_only"` + Difficulty `json:"difficulty"` +} + +// State 保存单个问题的解答状态 +type State struct { + ACs int `json:"total_acs"` + Title string `json:"question__title"` + IsNew bool `json:"is_new_question"` + Submitted int `json:"total_submitted"` + ID int `json:"frontend_question_id"` + TitleSlug string `json:"question__title_slug"` +} + +// Difficulty 问题的难度 +type Difficulty struct { + Level int `json:"level"` +} + +func getAlgorithms() *algorithms { + URL := "https://leetcode.com/api/problems/Algorithms/" + + raw := getRaw(URL) + + res := new(algorithms) + if err := json.Unmarshal(raw, res); err != nil { + log.Panicf("无法把json转换成Category: %s\n", err.Error()) + } + + // 如果,没有登录的话,也能获取数据,但是用户名,就不是本人 + if res.User != getConfig().Username { + log.Printf("res.User = %s\n", res.User) + log.Fatal("没有获取到本人的数据") + } + + return res +} diff --git a/Helper/leetcode-get.go b/Helper/leetcode-get.go new file mode 100644 index 000000000..0b5cb3d4d --- /dev/null +++ b/Helper/leetcode-get.go @@ -0,0 +1,22 @@ +package main + +import ( + "io/ioutil" + "log" +) + +func getRaw(URL string) []byte { + log.Printf("开始下载 %s 的数据", URL) + + req := newReq() + resp, err := req.Get(URL) + if err != nil { + log.Fatal("getRaw: Get Error: " + err.Error()) + } + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + log.Fatal("getRaw: Read Error: " + err.Error()) + } + return body +} diff --git a/Helper/leetcode-getRanking.go b/Helper/leetcode-getRanking.go new file mode 100644 index 000000000..a5793bb62 --- /dev/null +++ b/Helper/leetcode-getRanking.go @@ -0,0 +1,49 @@ +package main + +import ( + "fmt" + "log" + "strconv" + "strings" +) + +// getRanking 让这个方法优雅一点 +func getRanking() int { + // 获取网页数据 + URL := fmt.Sprintf("https://leetcode.com/%s/", getConfig().Username) + data := getRaw(URL) + str := string(data) + + // 通过不断裁剪 str 获取排名信息 + + // fmt.Println(str) + + i := strings.Index(str, "ng-init") + j := i + strings.Index(str[i:], "ng-cloak") + str = str[i:j] + + i = strings.Index(str, "(") + j = strings.Index(str, ")") + str = str[i:j] + + // fmt.Println("2\n", str) + + strs := strings.Split(str, ",") + str = strs[6] + + // fmt.Println("1\n", str) + + i = strings.Index(str, "'") + j = 2 + strings.Index(str[2:], "'") + + // fmt.Println("0\n", str) + + str = str[i+1 : j] + + r, err := strconv.Atoi(str) + if err != nil { + log.Panicf("无法把 %s 转换成数字Ranking", str) + } + + return r +} diff --git a/Helper/leetcode-new.go b/Helper/leetcode-new.go new file mode 100644 index 000000000..de988a667 --- /dev/null +++ b/Helper/leetcode-new.go @@ -0,0 +1,68 @@ +package main + +import ( + "encoding/json" + "log" + "time" + + "github.com/aQuaYi/GoKit" +) + +const ( + unavailableFile = "unavailable.json" +) + +func getLeetCode() *leetcode { + probs, record := parseAlgs(getAlgorithms()) + lc := &leetcode{ + Username: getConfig().Username, + + Record: record, + Problems: *probs, + + Ranking: getRanking(), + Updated: time.Now(), + } + + return lc +} + +func parseAlgs(alg *algorithms) (*problems, record) { + hasNoGoOption := readUnavailable() + probs := &problems{} + r := record{} + + for _, ps := range alg.Problems { + p := newProblem(ps) + if hasNoGoOption[p.ID] { + p.HasNoGoOption = true + } + probs.add(p) + r.update(p) + } + + return probs, r +} + +func readUnavailable() map[int]bool { + type unavailable struct { + List []int + } + + if !GoKit.Exist(unavailableFile) { + log.Panicf("%s 不存在,没有不能解答的题目", unavailableFile) + } + + raw := read(unavailableFile) + u := unavailable{} + if err := json.Unmarshal(raw, &u); err != nil { + log.Panicf("获取 %s 失败:%s", unavailableFile, err) + } + + res := make(map[int]bool, len(u.List)) + for i := range u.List { + res[u.List[i]] = true + } + + return res +} diff --git a/Helper/leetcode.go b/Helper/leetcode.go new file mode 100644 index 000000000..fb7615a63 --- /dev/null +++ b/Helper/leetcode.go @@ -0,0 +1,166 @@ +package main + +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "log" + "os" + "time" +) + +const ( + leetCodeJSON = "leetcode.json" +) + +type leetcode struct { + Username string // 用户名 + Ranking int // 网站排名 + Updated time.Time // 数据更新时间 + + Record record // 已解答题目与全部题目的数量,按照难度统计 + Problems problems // 所有问题的集合 +} + +func newLeetCode() *leetcode { + log.Println("开始,获取 LeetCode 数据") + + lc, err := readLeetCode() + if err != nil { + log.Println("读取 LeetCode 的记录失败,正在重新生成 LeetCode 记录。失败原因:", err.Error()) + lc = getLeetCode() + } + + lc.refresh() + + lc.save() + + log.Println("获取 LeetCode 的最新数据") + return lc +} + +func readLeetCode() (*leetcode, error) { + data, err := ioutil.ReadFile(leetCodeJSON) + if err != nil { + return nil, errors.New("读取文件失败:" + err.Error()) + } + + lc := new(leetcode) + if err := json.Unmarshal(data, lc); err != nil { + return nil, errors.New("转换成 leetcode 时,失败:" + err.Error()) + } + + return lc, nil +} + +func (lc *leetcode) save() { + + if err := os.Remove(leetCodeJSON); err != nil { + log.Panicf("删除 %s 失败,原因是:%s", leetCodeJSON, err) + } + + raw, err := json.MarshalIndent(lc, "", "\t") + if err != nil { + log.Fatal("无法把Leetcode数据转换成[]bytes: ", err) + } + if err = ioutil.WriteFile(leetCodeJSON, raw, 0666); err != nil { + log.Fatal("无法把 Marshal 后的 lc 保存到文件: ", err) + } + log.Println("最新的 LeetCode 记录已经保存。") + return +} + +func (lc *leetcode) refresh() { + if time.Since(lc.Updated) < time.Minute { + log.Printf("LeetCode 数据在 %s 前刚刚更新过,跳过此次刷新\n", time.Since(lc.Updated)) + return + } + + log.Println("开始,刷新 LeetCode 数据") + newLC := getLeetCode() + + logDiff(lc, newLC) + + *lc = *newLC +} + +func logDiff(old, new *leetcode) { + // 对比 ranking + str := fmt.Sprintf("当前排名 %d", new.Ranking) + verb, delta := "进步", old.Ranking-new.Ranking + if new.Ranking > old.Ranking { + verb, delta = "后退", new.Ranking-old.Ranking + } + str += fmt.Sprintf(",%s了 %d 名", verb, delta) + log.Println(str) + + lenOld, lenNew := len(old.Problems), len(new.Problems) + hasNewFinished := false + + i := 0 + + // 检查新旧都有的问题 + for i < lenOld && i < lenNew { + o, n := old.Problems[i], new.Problems[i] + // 检查是 n 是否是新 完成 + if o.IsAccepted == false && n.IsAccepted == true { + log.Printf("~新完成~ %d - %s", n.ID, n.Title) + dida("re", n) + hasNewFinished = true + } + // 检查是 n 是否是新 收藏 + if o.IsFavor == false && n.IsFavor == true { + log.Printf("~新收藏~ %d - %s", n.ID, n.Title) + dida("fa", n) + } else if o.IsFavor == true && n.IsFavor == false { + log.Printf("~取消收藏~ %d - %s", o.ID, o.Title) + time.Sleep(time.Second) + } + + // 有时候,会在中间添加新题 + if o.Title == "" && n.Title != "" { + log.Printf("新题: %d - %s", new.Problems[i].ID, new.Problems[i].Title) + dida("do", n) + } + + i++ + } + + log.Printf("已经检查完了 %d 题\n", i) + + if !hasNewFinished { + log.Println("~ 没有新完成习题 ~") + } + + // 检查新添加的习题 + for i < lenNew { + if new.Problems[i].isAvailable() { + log.Printf("新题: %d - %s", new.Problems[i].ID, new.Problems[i].Title) + dida("do", new.Problems[i]) + } + i++ + } +} + +func (lc *leetcode) ProgressTable() string { + return lc.Record.progressTable() +} + +func (lc *leetcode) AvailableTable() string { + return lc.Problems.available().table() +} + +func (lc *leetcode) FavoriteTable() string { + return lc.Problems.favorite().table() +} + +func (lc *leetcode) FavoriteCount() int { + return len(lc.Problems.favorite()) +} + +func (lc *leetcode) UnavailableList() string { + res := lc.Problems.unavailable().list() + // 为了 README.md 文档的美观,需要删除最后一个换行符号 + return res[:len(res)-1] +} diff --git a/Helper/main.go b/Helper/main.go new file mode 100644 index 000000000..9c9f363dd --- /dev/null +++ b/Helper/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "log" +) + +// 程序辅助设置 +const ( + VERSION = "7.0.8" +) + +func main() { + log.Printf("Hi, %s. I'm %s\n", getConfig().Username, VERSION) + + cli := new(CLI) + cli.Run() +} diff --git a/Helper/problem.go b/Helper/problem.go new file mode 100644 index 000000000..36719621e --- /dev/null +++ b/Helper/problem.go @@ -0,0 +1,91 @@ +package main + +import ( + "fmt" + "strings" +) + +type problem struct { + ID int + Title string + TitleSlug string + PassRate string + Difficulty string + IsAccepted, IsPaid, IsFavor, IsNew bool + HasNoGoOption bool // 不能够使用 Go 语言解答 +} + +func newProblem(ps problemStatus) problem { + level := []string{"", "Easy", "Medium", "Hard"} + + p := problem{ + ID: ps.State.ID, + Title: ps.State.Title, + TitleSlug: ps.State.TitleSlug, + // p.Submitted + 1 是因为刚刚添加的新题的 submitted 为 0 + PassRate: fmt.Sprintf("%d%%", ps.ACs*100/(ps.Submitted+1)), + Difficulty: level[ps.Difficulty.Level], + IsAccepted: ps.Status == "ac", + IsPaid: ps.IsPaid, + IsFavor: ps.IsFavor, + IsNew: ps.State.IsNew, + } + + return p +} + +func (p problem) isAvailable() bool { + if p.ID == 0 || p.IsPaid || p.HasNoGoOption { + return false + } + return true +} + +func (p problem) Dir() string { + path := "Algorithms" + return fmt.Sprintf("./%s/%04d.%s", path, p.ID, p.TitleSlug) +} + +func (p problem) link() string { + return fmt.Sprintf("https://leetcode.com/problems/%s/", p.TitleSlug) +} + +func (p problem) tableLine() string { + // 题号 + res := fmt.Sprintf("|[%04d](%s)|", p.ID, p.link()) + + // 标题 + t := "" + if p.IsAccepted { + t = fmt.Sprintf(`[%s](%s)`, strings.TrimSpace(p.Title), p.Dir()) + } else { + t = fmt.Sprintf(` * %s`, p.Title) + } + if p.IsNew { + t += " :new: " + } + res += t + "|" + + // 通过率 + res += fmt.Sprintf("%s|", p.PassRate) + + // 难度 + res += fmt.Sprintf("%s|", p.Difficulty) + + // 收藏 + f := "" + if p.IsFavor { + f = "[❤](https://leetcode.com/list/oussv5j)" + } + res += fmt.Sprintf("%s|\n", f) + + return res +} + +func (p problem) listLine() string { + return fmt.Sprintf("- [%d.%s](%s)\n", p.ID, p.Title, p.link()) +} + +func (p problem) didaTask(prefix string) string { + return fmt.Sprintf("#%s - %04d - #%s - %s - %s - %s", prefix, p.ID, p.Difficulty, p.PassRate, p.Title, p.link()) +} diff --git a/Helper/problemGoFile.go b/Helper/problemGoFile.go new file mode 100644 index 000000000..6a039f86b --- /dev/null +++ b/Helper/problemGoFile.go @@ -0,0 +1,51 @@ +package main + +import ( + "bufio" + "fmt" + "log" + "os" + "strings" +) + +func parseFunction(fc string) (fcName, para, ansType, nfc string) { + log.Println("准备分解函数:", fc) + + defer func() { // 必须要先声明defer,否则不能捕获到panic异常 + if err := recover(); err != nil { + fcName = "myFunc" + para = "p int" + ansType = "int" + nfc = "func myFunc(p int) int {\n\nreturn nil\n}" + } + }() + + funcIndex := strings.Index(fc, "func ") + a := funcIndex + strings.Index(fc[funcIndex:], " ") + b := funcIndex + strings.Index(fc[funcIndex:], "(") + c := funcIndex + strings.Index(fc[funcIndex:], ")") + d := funcIndex + strings.Index(fc[funcIndex:], "{") + + fcName = fc[a+1 : b] + para = fc[b+1 : c] + ansType = strings.TrimSpace(fc[c+1 : d]) + nfc = fmt.Sprintf("func %s(%s) %s {\n\nreturn nil\n}", fcName, para, ansType) + + return +} + +func getFunction(url string) string { + inputReader := bufio.NewReader(os.Stdin) + var err error + fc := "" + for !strings.HasPrefix(fc, "func ") { + fmt.Print("请输入 Go 函数:") + fc, err = inputReader.ReadString('\n') + if err != nil { + log.Panicf("读取 Go 函数失败:%s", err) + } + } + + return fc + +} diff --git a/Helper/problemReadme.go b/Helper/problemReadme.go new file mode 100644 index 000000000..532a80847 --- /dev/null +++ b/Helper/problemReadme.go @@ -0,0 +1,129 @@ +package main + +import ( + "fmt" + "sort" + "strings" +) + +func creatREADME(p problem) { + fileFormat := `# [%d. %s](%s) + +%s +` + + questionDescription := strings.TrimSpace(getDescription(p.link())) + + content := fmt.Sprintf(fileFormat, p.ID, p.Title, p.link(), questionDescription) + + content = replaceCharacters(content) + + filename := fmt.Sprintf("%s/README.md", p.Dir()) + + write(filename, content) + + vscodeOpen(filename) + +} + +func replaceCharacters(s string) string { + changeMap := map[string]string{ + "&lt;": "<", + "&quot;": "\"", + "&nbsp;": " ", + "&#39;": "`", + """: "\"", + "<": "<", + ">": ">", + "≥": ">=", + " ": "`", + "&": "&", + "'": "'", + " \n": "\n", + " \n": "\n", + " \n": "\n", + "\n\n\n\n\n": "\n\n", + "\n\n\n\n": "\n\n", + "\n\n\n": "\n\n", + } + + olds := make([]string, 0, len(changeMap)) + for old := range changeMap { + olds = append(olds, old) + } + + sort.Strings(olds) + + news := make([]string, 0, len(olds)) + for _, old := range olds { + news = append(news, changeMap[old]) + } + + for i := len(olds) - 1; 0 <= i; i-- { + // 先替换长的,再替换短的 + old, new := olds[i], news[i] + s = strings.Replace(s, old, new, -1) + } + + return s + +} + +func getDescription(url string) string { + return "" +} + +// func getDescription(url string) string { +// var err error + +// // create context +// ctxt, cancel := context.WithCancel(context.Background()) +// defer cancel() + +// var options chromedp.Option +// options = chromedp.WithRunnerOptions( +// runner.Flag("headless", true), +// runner.Flag("no-sandbox", true), +// runner.Flag("disable-gpu", true), +// ) + +// log.Println("chromedp timeout:", chromedp.DefaultNewTargetTimeout) + +// // create chrome instance +// c, err := chromedp.New(ctxt, options) +// if err != nil { +// log.Fatal(err) +// } + +// // run task list +// var res string +// err = c.Run(ctxt, text(url, &res)) +// if err != nil { +// log.Fatal(err) +// } + +// // shutdown chrome +// err = c.Shutdown(ctxt) +// if err != nil { +// log.Fatal(err) +// } + +// // wait for chrome to finish +// err = c.Wait() +// if err != nil { +// log.Fatal(err) +// } + +// log.Println("Desc:", res) + +// return res +// } + +// func text(url string, res *string) chromedp.Tasks { +// sel := `div.content__eAC7` +// return chromedp.Tasks{ +// chromedp.Sleep(time.Second * 3), +// chromedp.Navigate(url), +// chromedp.Text(sel, res, chromedp.NodeVisible, chromedp.BySearch), +// } +// } diff --git a/Helper/problems.go b/Helper/problems.go new file mode 100644 index 000000000..b19fbd8d5 --- /dev/null +++ b/Helper/problems.go @@ -0,0 +1,71 @@ +package main + +type problems []problem + +func (ps *problems) add(p problem) { + if len(*ps) <= p.ID { + *ps = append(*ps, make([]problem, p.ID-len(*ps)+1)...) + } + (*ps)[p.ID] = p +} + +func (ps problems) accepted() problems { + res := make([]problem, 0, len(ps)) + for _, p := range ps { + if p.IsAccepted { + res = append(res, p) + } + } + return res +} + +func (ps problems) available() problems { + res := make([]problem, 0, len(ps)) + size := len(ps) + for i := size - 1; i >= 0; i-- { + p := ps[i] + if p.isAvailable() { + res = append(res, p) + } + } + return res +} + +func (ps problems) favorite() problems { + res := make([]problem, 0, len(ps)) + size := len(ps) + for i := 0; i < size; i++ { + p := ps[i] + if p.IsFavor { + res = append(res, p) + } + } + return res +} + +func (ps problems) unavailable() problems { + res := make([]problem, 0, len(ps)) + for _, p := range ps { + if p.HasNoGoOption { + res = append(res, p) + } + } + return res +} + +func (ps problems) table() string { + res := "|题号|题目|通过率|难度|收藏|\n" + res += "|:-:|:-|:-: | :-: | :-: |\n" + for _, p := range ps { + res += p.tableLine() + } + return res +} + +func (ps problems) list() string { + res := "" + for _, p := range ps { + res += p.listLine() + } + return res +} diff --git a/Helper/record.go b/Helper/record.go new file mode 100644 index 000000000..44cc4dd7d --- /dev/null +++ b/Helper/record.go @@ -0,0 +1,55 @@ +package main + +import "fmt" + +type record struct { + Easy, Medium, Hard, Total count +} + +type count struct { + Solved, Total int +} + +func (r *record) progressTable() string { + res := fmt.Sprintln("| |Easy|Medium|Hard|Total|") + res += fmt.Sprintln("|:---:|:---:|:---:|:---:|:---:|") + + res += fmt.Sprintf("|**Accepted**|%d|", r.Easy.Solved) + res += fmt.Sprintf("%d|", r.Medium.Solved) + res += fmt.Sprintf("%d|", r.Hard.Solved) + res += fmt.Sprintf("%d|\n", r.Total.Solved) + + res += fmt.Sprintf("|**Total**|%d|", r.Easy.Total) + res += fmt.Sprintf("%d|", r.Medium.Total) + res += fmt.Sprintf("%d|", r.Hard.Total) + res += fmt.Sprintf("%d|", r.Total.Total) + + return res +} + +func (r *record) update(p problem) { + if !p.isAvailable() { + return + } + switch p.Difficulty { + case "Easy": + r.Easy.Total++ + if p.IsAccepted { + r.Easy.Solved++ + } + case "Medium": + r.Medium.Total++ + if p.IsAccepted { + r.Medium.Solved++ + } + case "Hard": + r.Hard.Total++ + if p.IsAccepted { + r.Hard.Solved++ + } + } + r.Total.Total++ + if p.IsAccepted { + r.Total.Solved++ + } +} diff --git a/Helper/signin.go b/Helper/signin.go new file mode 100644 index 000000000..b630d8b3a --- /dev/null +++ b/Helper/signin.go @@ -0,0 +1,78 @@ +package main + +import ( + "log" + "net/http" + + "github.com/mozillazg/request" +) + +const ( + loginPageURL = "https://leetcode.com/accounts/login/" +) + +var req *request.Request + +func newReq() *request.Request { + if req == nil { + req = signin() + } + return req +} + +// 登录 leetcode +// 返回的 req 带有 cookie +func signin() *request.Request { + log.Println("正在登录中...") + cfg := getConfig() + + // 对 req 赋值 + req := request.NewRequest(new(http.Client)) + + // 配置request + req.Headers = map[string]string{ + "Accept-Encoding": "", + "Referer": "https://leetcode.com/", + } + + // login + csrfToken := getCSRFToken(req) + + log.Printf("csrfToken: %s", csrfToken) + + req.Data = map[string]string{ + "csrfmiddlewaretoken": csrfToken, + "login": cfg.Username, + "password": cfg.Password, + } + if err := login(req); err != nil { + log.Fatal(err) + } + + log.Println("成功登录") + + return req +} + +func getCSRFToken(req *request.Request) string { + resp, err := req.Get(loginPageURL) + if err != nil { + log.Panicf("无法 Get 到 %s: %s", loginPageURL, err) + } + + cookies := resp.Cookies() + + for _, ck := range cookies { + if ck.Name == "csrftoken" { + return ck.Value + } + } + + panic("无法在 Cookies 中找到 csrftoken") +} + +func login(req *request.Request) error { + resp, err := req.Post(loginPageURL) + defer resp.Body.Close() // **Don't forget close the response body** + return err +} diff --git a/Helper/task.go b/Helper/task.go new file mode 100644 index 000000000..8d150c761 --- /dev/null +++ b/Helper/task.go @@ -0,0 +1,56 @@ +package main + +import ( + "log" +) + +const ( + taskFile = "tasks.txt" // 任务输出文件夹名称 +) + +func makeTaskFile(prefix string, first, last int) { + log.Println("开始,生成新任务") + + res := "" + count := 0 + ps := newLeetCode().Problems + var isWanted func(int) bool + collect := func() { + for i := first; i <= last && i < len(ps); i++ { + if !isWanted(i) { + continue + } + res += ps[i].didaTask(prefix) + "\n" + count++ + } + } + + // 根据 prefix 的不同,设置不同的 isWanted + switch prefix { + case "do": // to do + isWanted = func(i int) bool { + return ps[i].ID > 0 && !ps[i].IsAccepted && !ps[i].IsPaid && !ps[i].HasNoGoOption + } + case "re": // review + isWanted = func(i int) bool { + return ps[i].ID > 0 && ps[i].IsAccepted && !ps[i].IsPaid + } + case "mi": // miss + isWanted = func(i int) bool { + return ps[i].ID > 0 && ps[i].IsAccepted && ps[i].HasNoGoOption + } + case "fa": // favor + isWanted = func(i int) bool { + return ps[i].ID > 0 && ps[i].IsFavor + } + default: + // 和 do 的一样 + isWanted = func(i int) bool { + return ps[i].ID > 0 && !ps[i].IsAccepted && !ps[i].IsPaid && !ps[i].HasNoGoOption + } + } + + collect() + log.Printf("完成,一共生成了 %d 条新任务\n", count) + write(taskFile, res) +} diff --git a/Helper/util.go b/Helper/util.go new file mode 100644 index 000000000..c55603e60 --- /dev/null +++ b/Helper/util.go @@ -0,0 +1,44 @@ +package main + +import ( + "io/ioutil" + "log" + "os" + "os/exec" +) + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +// read 负责读取文件 +// 这是一个通用的方法 +func read(path string) []byte { + file, err := os.Open(path) + if err != nil { + panic(err) + } + defer file.Close() + + data, err := ioutil.ReadAll(file) + return data +} + +func write(path, content string) { + err := ioutil.WriteFile(path, []byte(content), 0755) + if err != nil { + log.Fatal(err) + } +} + +// 利用 VSCode 打开文件 +func vscodeOpen(filename string) { + cmd := exec.Command("code", "-r", filename) + _, err := cmd.Output() + if err != nil { + panic(err.Error()) + } +} diff --git a/LICENSE b/LICENSE index e0edc9197..84084cb00 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 aQua +Copyright (c) 2018 aQua Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index b9ded5d2a..4570ec3af 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ run: - @./helper - git commit -am '更新README.md' + @./helper readme + git commit -am '更新 README.md' git push git checkout master git merge develop git push - git checkout develop \ No newline at end of file + git checkout develop + google-chrome https://github.com/aQuaYi/LeetCode-in-Go#leetcode-%E7%9A%84-go-%E8%A7%A3%E7%AD%94 \ No newline at end of file diff --git a/README.md b/README.md index 63e996923..4ae1b1098 100755 --- a/README.md +++ b/README.md @@ -1,205 +1,1013 @@ -# [LeetCode](https://leetcode.com)习题的Golang解答 -[![LeetCode](https://img.shields.io/badge/LeetCode-aQuaYi-blue.svg)](https://leetcode.com/aQuaYi/) -[![LeetCode Ranking](https://img.shields.io/badge/Ranking-35576-blue.svg)](https://leetcode.com/aQuaYi/) -[![Build Status](https://www.travis-ci.org/aQuaYi/LeetCode-in-Golang.svg?branch=master)](https://www.travis-ci.org/aQuaYi/LeetCode-in-Golang) -[![codecov](https://codecov.io/gh/aQuaYi/LeetCode-in-Golang/branch/master/graph/badge.svg)](https://codecov.io/gh/aQuaYi/LeetCode-in-Golang) +# [LeetCode](https://leetcode.com) 的 Go 解答 +[![LeetCode 排名](https://img.shields.io/badge/aQuaYi-646-blue.svg)](https://leetcode.com/aQuaYi/) +[![codecov](https://codecov.io/gh/aQuaYi/LeetCode-in-Go/branch/master/graph/badge.svg)](https://codecov.io/gh/aQuaYi/LeetCode-in-Go) +[![Build Status](https://www.travis-ci.org/aQuaYi/LeetCode-in-Go.svg?branch=master)](https://www.travis-ci.org/aQuaYi/LeetCode-in-Go) + [![Go](https://img.shields.io/badge/Go-1.13-blue.svg)](https://golang.google.cn) +## 进度 -## 答题进度:34% -> 仅含免费题 +> 统计规则:1.免费题,2.算法题,3.能提交 Go 解答 -|Category|Easy|Medium|Hard|Total| -|:--|:--:|:--:|:--:|:--:| -|**Algorithms**|53 / 145|84 / 250|32 / 93|169 / 488| -|**Draft**|0 / 1|0 / 3|0 / 0|0 / 4| -|**Total**|53 / 146|84 / 253|32 / 93|169 / 492| +| |Easy|Medium|Hard|Total| +|:---:|:---:|:---:|:---:|:---:| +|**Accepted**|265|456|187|908| +|**Total**|267|472|197|936| -## 参考解答 -|题号|题目|难度|总体通过率|收藏| +## 题解 + +|题号|题目|通过率|难度|收藏| |:-:|:-|:-: | :-: | :-: | -|1|[Two Sum](./Algorithms/0001.two-sum)|☆|35%|| -|2|[Add Two Numbers](./Algorithms/0002.add-two-numbers)|☆ ☆|27%|| -|3|[Longest Substring Without Repeating Characters](./Algorithms/0003.longest-substring-without-repeating-characters)|☆ ☆|24%|| -|4|[Median of Two Sorted Arrays](./Algorithms/0004.median-of-two-sorted-arrays)|☆ ☆ ☆|21%|| -|5|[Longest Palindromic Substring](./Algorithms/0005.longest-palindromic-substring)|☆ ☆|25%|| -|6|[ZigZag Conversion](./Algorithms/0006.zigzag-conversion)|☆ ☆|26%|| -|7|[Reverse Integer](./Algorithms/0007.reverse-integer)|☆|24%|| -|8|[String to Integer (atoi)](./Algorithms/0008.string-to-integer-atoi)|☆ ☆|13%|| -|9|[Palindrome Number](./Algorithms/0009.palindrome-number)|☆|35%|| -|10|[Regular Expression Matching](./Algorithms/0010.regular-expression-matching)|☆ ☆ ☆|24%|❤| -|11|[Container With Most Water](./Algorithms/0011.container-with-most-water)|☆ ☆|36%|| -|12|[Integer to Roman](./Algorithms/0012.integer-to-roman)|☆ ☆|45%|| -|13|[Roman to Integer](./Algorithms/0013.roman-to-integer)|☆|46%|| -|14|[Longest Common Prefix](./Algorithms/0014.longest-common-prefix)|☆|31%|| -|15|[3Sum](./Algorithms/0015.3sum)|☆ ☆|21%|| -|16|[3Sum Closest](./Algorithms/0016.3sum-closest)|☆ ☆|31%|| -|17|[Letter Combinations of a Phone Number](./Algorithms/0017.letter-combinations-of-a-phone-number)|☆ ☆|34%|| -|18|[4Sum](./Algorithms/0018.4sum)|☆ ☆|26%|| -|19|[Remove Nth Node From End of List](./Algorithms/0019.remove-nth-node-from-end-of-list)|☆ ☆|33%|| -|20|[Valid Parentheses](./Algorithms/0020.valid-parentheses)|☆|33%|| -|21|[Merge Two Sorted Lists](./Algorithms/0021.merge-two-sorted-lists)|☆|39%|| -|22|[Generate Parentheses](./Algorithms/0022.generate-parentheses)|☆ ☆|45%|❤| -|23|[Merge k Sorted Lists](./Algorithms/0023.merge-k-sorted-lists)|☆ ☆ ☆|27%|| -|24|[Swap Nodes in Pairs](./Algorithms/0024.swap-nodes-in-pairs)|☆ ☆|38%|❤| -|25|[Reverse Nodes in k-Group](./Algorithms/0025.reverse-nodes-in-k-group)|☆ ☆ ☆|30%|❤| -|26|[Remove Duplicates from Sorted Array](./Algorithms/0026.remove-duplicates-from-sorted-array)|☆|35%|❤| -|27|[Remove Element](./Algorithms/0027.remove-element)|☆|39%|| -|28|[Implement strStr()](./Algorithms/0028.implement-strstr)|☆|28%|| -|29|[Divide Two Integers](./Algorithms/0029.divide-two-integers)|☆ ☆|15%|| -|30|[Substring with Concatenation of All Words](./Algorithms/0030.substring-with-concatenation-of-all-words)|☆ ☆ ☆|22%|❤| -|31|[Next Permutation](./Algorithms/0031.next-permutation)|☆ ☆|28%|❤| -|32|[Longest Valid Parentheses](./Algorithms/0032.longest-valid-parentheses)|☆ ☆ ☆|23%|| -|33|[Search in Rotated Sorted Array](./Algorithms/0033.search-in-rotated-sorted-array)|☆ ☆|32%|❤| -|34|[Search for a Range](./Algorithms/0034.search-for-a-range)|☆ ☆|31%|| -|35|[Search Insert Position](./Algorithms/0035.search-insert-position)|☆|39%|| -|36|[Valid Sudoku](./Algorithms/0036.valid-sudoku)|☆ ☆|35%|❤| -|37|[Sudoku Solver](./Algorithms/0037.sudoku-solver)|☆ ☆ ☆|30%|❤| -|38|[Count and Say](./Algorithms/0038.count-and-say)|☆|34%|| -|39|[Combination Sum](./Algorithms/0039.combination-sum)|☆ ☆|39%|| -|40|[Combination Sum II](./Algorithms/0040.combination-sum-ii)|☆ ☆|34%|| -|41|[First Missing Positive](./Algorithms/0041.first-missing-positive)|☆ ☆ ☆|25%|| -|42|[Trapping Rain Water](./Algorithms/0042.trapping-rain-water)|☆ ☆ ☆|36%|| -|43|[Multiply Strings](./Algorithms/0043.multiply-strings)|☆ ☆|27%|| -|44|[Wildcard Matching](./Algorithms/0044.wildcard-matching)|☆ ☆ ☆|20%|❤| -|45|[Jump Game II](./Algorithms/0045.jump-game-ii)|☆ ☆ ☆|26%|| -|46|[Permutations](./Algorithms/0046.permutations)|☆ ☆|44%|| -|47|[Permutations II](./Algorithms/0047.permutations-ii)|☆ ☆|33%|| -|48|[Rotate Image](./Algorithms/0048.rotate-image)|☆ ☆|38%|| -|49|[Group Anagrams](./Algorithms/0049.group-anagrams)|☆ ☆|35%|❤| -|50|[Pow(x, n)](./Algorithms/0050.powx-n)|☆ ☆|26%|| -|51|[N-Queens](./Algorithms/0051.n-queens)|☆ ☆ ☆|31%|| -|52|[N-Queens II](./Algorithms/0052.n-queens-ii)|☆ ☆ ☆|45%|| -|53|[Maximum Subarray](./Algorithms/0053.maximum-subarray)|☆|39%|❤| -|54|[Spiral Matrix](./Algorithms/0054.spiral-matrix)|☆ ☆|26%|❤| -|55|[Jump Game](./Algorithms/0055.jump-game)|☆ ☆|29%|| -|56|[Merge Intervals](./Algorithms/0056.merge-intervals)|☆ ☆|30%|❤| -|57|[Insert Interval](./Algorithms/0057.insert-interval)|☆ ☆ ☆|27%|| -|58|[Length of Last Word](./Algorithms/0058.length-of-last-word)|☆|31%|| -|59|[Spiral Matrix II](./Algorithms/0059.spiral-matrix-ii)|☆ ☆|39%|❤| -|60|[Permutation Sequence](./Algorithms/0060.permutation-sequence)|☆ ☆|28%|| -|61|[Rotate List](./Algorithms/0061.rotate-list)|☆ ☆|24%|❤| -|62|[Unique Paths](./Algorithms/0062.unique-paths)|☆ ☆|41%|❤| -|63|[Unique Paths II](./Algorithms/0063.unique-paths-ii)|☆ ☆|31%|| -|64|[Minimum Path Sum](./Algorithms/0064.minimum-path-sum)|☆ ☆|38%|| -|65|[Valid Number](./Algorithms/0065.valid-number)|☆ ☆ ☆|12%|| -|66|[Plus One](./Algorithms/0066.plus-one)|☆|38%|| -|67|[Add Binary](./Algorithms/0067.add-binary)|☆|32%|| -|68|[Text Justification](./Algorithms/0068.text-justification)|☆ ☆ ☆|19%|| -|69|[Sqrt(x)](./Algorithms/0069.sqrtx)|☆|27%|| -|70|[Climbing Stairs](./Algorithms/0070.climbing-stairs)|☆|40%|| -|71|[Simplify Path](./Algorithms/0071.simplify-path)|☆ ☆|25%|| -|72|[Edit Distance](./Algorithms/0072.edit-distance)|☆ ☆ ☆|31%|❤| -|73|[Set Matrix Zeroes](./Algorithms/0073.set-matrix-zeroes)|☆ ☆|35%|❤| -|74|[Search a 2D Matrix](./Algorithms/0074.search-a-2d-matrix)|☆ ☆|34%|| -|75|[Sort Colors](./Algorithms/0075.sort-colors)|☆ ☆|38%|❤| -|76|[Minimum Window Substring](./Algorithms/0076.minimum-window-substring)|☆ ☆ ☆|25%|❤| -|77|[Combinations](./Algorithms/0077.combinations)|☆ ☆|39%|| -|78|[Subsets](./Algorithms/0078.subsets)|☆ ☆|41%|❤| -|79|[Word Search](./Algorithms/0079.word-search)|☆ ☆|26%|| -|80|[Remove Duplicates from Sorted Array II](./Algorithms/0080.remove-duplicates-from-sorted-array-ii)|☆ ☆|36%|❤| -|81|[Search in Rotated Sorted Array II](./Algorithms/0081.search-in-rotated-sorted-array-ii)|☆ ☆|32%|| -|82|[Remove Duplicates from Sorted List II](./Algorithms/0082.remove-duplicates-from-sorted-list-ii)|☆ ☆|29%|❤| -|83|[Remove Duplicates from Sorted List](./Algorithms/0083.remove-duplicates-from-sorted-list)|☆|39%|| -|84|[Largest Rectangle in Histogram](./Algorithms/0084.largest-rectangle-in-histogram)|☆ ☆ ☆|26%|❤| -|85|[Maximal Rectangle](./Algorithms/0085.maximal-rectangle)|☆ ☆ ☆|28%|❤| -|86|[Partition List](./Algorithms/0086.partition-list)|☆ ☆|32%|| -|87|[Scramble String](./Algorithms/0087.scramble-string)|☆ ☆ ☆|29%|❤| -|88|[Merge Sorted Array](./Algorithms/0088.merge-sorted-array)|☆|32%|| -|89|[Gray Code](./Algorithms/0089.gray-code)|☆ ☆|41%|| -|90|[Subsets II](./Algorithms/0090.subsets-ii)|☆ ☆|36%|❤| -|91|[Decode Ways](./Algorithms/0091.decode-ways)|☆ ☆|19%|❤| -|92|[Reverse Linked List II](./Algorithms/0092.reverse-linked-list-ii)|☆ ☆|30%|| -|93|[Restore IP Addresses](./Algorithms/0093.restore-ip-addresses)|☆ ☆|27%|❤| -|94|[Binary Tree Inorder Traversal](./Algorithms/0094.binary-tree-inorder-traversal)|☆ ☆|46%|| -|95|[Unique Binary Search Trees II](./Algorithms/0095.unique-binary-search-trees-ii)|☆ ☆|31%|❤| -|96|[Unique Binary Search Trees](./Algorithms/0096.unique-binary-search-trees)|☆ ☆|41%|| -|97|[Interleaving String](./Algorithms/0097.interleaving-string)|☆ ☆ ☆|24%|❤| -|98|[Validate Binary Search Tree](./Algorithms/0098.validate-binary-search-tree)|☆ ☆|23%|❤| -|99|[Recover Binary Search Tree](./Algorithms/0099.recover-binary-search-tree)|☆ ☆ ☆|29%|❤| -|100|[Same Tree](./Algorithms/0100.same-tree)|☆|46%|| -|101|[Symmetric Tree](./Algorithms/0101.symmetric-tree)|☆|38%|❤| -|102|[Binary Tree Level Order Traversal](./Algorithms/0102.binary-tree-level-order-traversal)|☆ ☆|40%|| -|103|[Binary Tree Zigzag Level Order Traversal](./Algorithms/0103.binary-tree-zigzag-level-order-traversal)|☆ ☆|34%|| -|104|[Maximum Depth of Binary Tree](./Algorithms/0104.maximum-depth-of-binary-tree)|☆|52%|| -|105|[Construct Binary Tree from Preorder and Inorder Traversal](./Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal)|☆ ☆|32%|❤| -|106|[Construct Binary Tree from Inorder and Postorder Traversal](./Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal)|☆ ☆|32%|❤| -|107|[Binary Tree Level Order Traversal II](./Algorithms/0107.binary-tree-level-order-traversal-ii)|☆|40%|| -|108|[Convert Sorted Array to Binary Search Tree](./Algorithms/0108.convert-sorted-array-to-binary-search-tree)|☆|42%|| -|109|[Convert Sorted List to Binary Search Tree](./Algorithms/0109.convert-sorted-list-to-binary-search-tree)|☆ ☆|34%|| -|110|[Balanced Binary Tree](./Algorithms/0110.balanced-binary-tree)|☆|37%|| -|111|[Minimum Depth of Binary Tree](./Algorithms/0111.minimum-depth-of-binary-tree)|☆|33%|| -|112|[Path Sum](./Algorithms/0112.path-sum)|☆|34%|| -|113|[Path Sum II](./Algorithms/0113.path-sum-ii)|☆ ☆|33%|| -|114|[Flatten Binary Tree to Linked List](./Algorithms/0114.flatten-binary-tree-to-linked-list)|☆ ☆|35%|❤| -|115|[Distinct Subsequences](./Algorithms/0115.distinct-subsequences)|☆ ☆ ☆|31%|❤| -|118|[Pascal's Triangle](./Algorithms/0118.pascals-triangle)|☆|38%|| -|119|[Pascal's Triangle II](./Algorithms/0119.pascals-triangle-ii)|☆|37%|| -|120|[Triangle](./Algorithms/0120.triangle)|☆ ☆|33%|❤| -|121|[Best Time to Buy and Sell Stock](./Algorithms/0121.best-time-to-buy-and-sell-stock)|☆|41%|| -|122|[Best Time to Buy and Sell Stock II](./Algorithms/0122.best-time-to-buy-and-sell-stock-ii)|☆|47%|| -|123|[Best Time to Buy and Sell Stock III](./Algorithms/0123.best-time-to-buy-and-sell-stock-iii)|☆ ☆ ☆|29%|| -|124|[Binary Tree Maximum Path Sum](./Algorithms/0124.binary-tree-maximum-path-sum)|☆ ☆ ☆|26%|❤| -|125|[Valid Palindrome](./Algorithms/0125.valid-palindrome)|☆|26%|| -|126|[Word Ladder II](./Algorithms/0126.word-ladder-ii)|☆ ☆ ☆|14%|❤| -|127|[Word Ladder](./Algorithms/0127.word-ladder)|☆ ☆|19%|| -|152|[Maximum Product Subarray](./Algorithms/0152.maximum-product-subarray)|☆ ☆|25%|❤| -|153|[Find Minimum in Rotated Sorted Array](./Algorithms/0153.find-minimum-in-rotated-sorted-array)|☆ ☆|40%|| -|154|[Find Minimum in Rotated Sorted Array II](./Algorithms/0154.find-minimum-in-rotated-sorted-array-ii)|☆ ☆ ☆|37%|| -|162|[Find Peak Element](./Algorithms/0162.find-peak-element)|☆ ☆|37%|| -|167|[Two Sum II - Input array is sorted](./Algorithms/0167.two-sum-ii-input-array-is-sorted)|☆|47%|| -|169|[Majority Element](./Algorithms/0169.majority-element)|☆|46%|❤| -|188|[Best Time to Buy and Sell Stock IV](./Algorithms/0188.best-time-to-buy-and-sell-stock-iv)|☆ ☆ ☆|24%|❤| -|189|[Rotate Array](./Algorithms/0189.rotate-array)|☆|24%|| -|206|[Reverse Linked List](./Algorithms/0206.reverse-linked-list)|☆|45%|| -|209|[Minimum Size Subarray Sum](./Algorithms/0209.minimum-size-subarray-sum)|☆ ☆|30%|| -|216|[Combination Sum III](./Algorithms/0216.combination-sum-iii)|☆ ☆|45%|| -|217|[Contains Duplicate](./Algorithms/0217.contains-duplicate)|☆|45%|| -|219|[Contains Duplicate II](./Algorithms/0219.contains-duplicate-ii)|☆|32%|| -|228|[Summary Ranges](./Algorithms/0228.summary-ranges)|☆ ☆|30%|| -|229|[Majority Element II](./Algorithms/0229.majority-element-ii)|☆ ☆|28%|❤| -|238|[Product of Array Except Self](./Algorithms/0238.product-of-array-except-self)|☆ ☆|49%|| -|268|[Missing Number](./Algorithms/0268.missing-number)|☆|44%|| -|283|[Move Zeroes](./Algorithms/0283.move-zeroes)|☆|50%|| -|287|[Find the Duplicate Number](./Algorithms/0287.find-the-duplicate-number)|☆ ☆|43%|❤| -|289|[Game of Life](./Algorithms/0289.game-of-life)|☆ ☆|37%|❤| -|380|[Insert Delete GetRandom O(1)](./Algorithms/0380.insert-delete-getrandom-o1)|☆ ☆|39%|❤| -|381|[Insert Delete GetRandom O(1) - Duplicates allowed](./Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed)|☆ ☆ ☆|28%|❤| -|414|[Third Maximum Number](./Algorithms/0414.third-maximum-number)|☆|27%|| -|437|[Path Sum III](./Algorithms/0437.path-sum-iii)|☆|39%|❤| -|442|[Find All Duplicates in an Array](./Algorithms/0442.find-all-duplicates-in-an-array)|☆ ☆|55%|| -|448|[Find All Numbers Disappeared in an Array](./Algorithms/0448.find-all-numbers-disappeared-in-an-array)|☆|51%|| -|485|[Max Consecutive Ones](./Algorithms/0485.max-consecutive-ones)|☆|53%|| -|495|[Teemo Attacking](./Algorithms/0495.teemo-attacking)|☆ ☆|51%|| -|526|[Beautiful Arrangement](./Algorithms/0526.beautiful-arrangement)|☆ ☆|54%|❤| -|532|[K-diff Pairs in an Array](./Algorithms/0532.k-diff-pairs-in-an-array)|☆|28%|| -|560|[Subarray Sum Equals K](./Algorithms/0560.subarray-sum-equals-k)|☆ ☆|40%|❤| -|561|[Array Partition I](./Algorithms/0561.array-partition-i)|☆|67%|| -|565|[Array Nesting](./Algorithms/0565.array-nesting)|☆ ☆|49%|| -|566|[Reshape the Matrix](./Algorithms/0566.reshape-the-matrix)|☆|58%|| -|581|[Shortest Unsorted Continuous Subarray](./Algorithms/0581.shortest-unsorted-continuous-subarray)|☆|29%|❤| -|605|[Can Place Flowers](./Algorithms/0605.can-place-flowers)|☆|30%|❤| -|611|[Valid Triangle Number](./Algorithms/0611.valid-triangle-number)|☆ ☆|41%|❤| -|621|[Task Scheduler](./Algorithms/0621.task-scheduler)|☆ ☆|42%|❤| -|628|[Maximum Product of Three Numbers](./Algorithms/0628.maximum-product-of-three-numbers)|☆|45%|❤| -|639|[Decode Ways II](./Algorithms/0639.decode-ways-ii)|☆ ☆ ☆|23%|| -|643|[Maximum Average Subarray I](./Algorithms/0643.maximum-average-subarray-i)|☆|37%|| -|661|[Image Smoother](./Algorithms/0661.image-smoother)|☆|46%|| -|667|[Beautiful Arrangement II](./Algorithms/0667.beautiful-arrangement-ii)|☆ ☆|51%|| - - - 以下题目,暂时不能使用 Golang 解答 -- [116. Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) -- [117. Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/) +|[1250](https://leetcode.com/problems/check-if-it-is-a-good-array/)| * Check If It Is a Good Array|46%|Hard|| +|[1249](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/)| * Minimum Remove to Make Valid Parentheses|55%|Medium|| +|[1248](https://leetcode.com/problems/count-number-of-nice-subarrays/)| * Count Number of Nice Subarrays|50%|Medium|| +|[1247](https://leetcode.com/problems/minimum-swaps-to-make-strings-equal/)| * Minimum Swaps to Make Strings Equal|56%|Medium|| +|[1240](https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/)| * Tiling a Rectangle with the Fewest Squares|48%|Hard|| +|[1239](https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters/)| * Maximum Length of a Concatenated String with Unique Characters|40%|Medium|| +|[1238](https://leetcode.com/problems/circular-permutation-in-binary-representation/)| * Circular Permutation in Binary Representation|57%|Medium|| +|[1237](https://leetcode.com/problems/find-positive-integer-solution-for-a-given-equation/)| * Find Positive Integer Solution for a Given Equation|65%|Easy|| +|[1235](https://leetcode.com/problems/maximum-profit-in-job-scheduling/)| * Maximum Profit in Job Scheduling|44%|Hard|| +|[1234](https://leetcode.com/problems/replace-the-substring-for-balanced-string/)| * Replace the Substring for Balanced String|29%|Medium|| +|[1233](https://leetcode.com/problems/remove-sub-folders-from-the-filesystem/)| * Remove Sub-Folders from the Filesystem|53%|Medium|| +|[1232](https://leetcode.com/problems/check-if-it-is-a-straight-line/)| * Check If It Is a Straight Line|47%|Easy|| +|[1227](https://leetcode.com/problems/airplane-seat-assignment-probability/)| * Airplane Seat Assignment Probability|61%|Medium|| +|[1224](https://leetcode.com/problems/maximum-equal-frequency/)| * Maximum Equal Frequency|31%|Hard|| +|[1223](https://leetcode.com/problems/dice-roll-simulation/)| * Dice Roll Simulation|42%|Medium|| +|[1222](https://leetcode.com/problems/queens-that-can-attack-the-king/)| * Queens That Can Attack the King|68%|Medium|| +|[1221](https://leetcode.com/problems/split-a-string-in-balanced-strings/)|[Split a String in Balanced Strings](./Algorithms/1221.split-a-string-in-balanced-strings)|78%|Easy|| +|[1220](https://leetcode.com/problems/count-vowels-permutation/)| * Count Vowels Permutation|51%|Hard|| +|[1219](https://leetcode.com/problems/path-with-maximum-gold/)| * Path with Maximum Gold|61%|Medium|| +|[1218](https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference/)| * Longest Arithmetic Subsequence of Given Difference|38%|Medium|| +|[1217](https://leetcode.com/problems/play-with-chips/)|[Play with Chips](./Algorithms/1217.play-with-chips)|63%|Easy|| +|[1210](https://leetcode.com/problems/minimum-moves-to-reach-target-with-rotations/)| * Minimum Moves to Reach Target with Rotations|43%|Hard|| +|[1209](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/)| * Remove All Adjacent Duplicates in String II|57%|Medium|| +|[1208](https://leetcode.com/problems/get-equal-substrings-within-budget/)| * Get Equal Substrings Within Budget|36%|Medium|| +|[1207](https://leetcode.com/problems/unique-number-of-occurrences/)|[Unique Number of Occurrences](./Algorithms/1207.unique-number-of-occurrences)|72%|Easy|| +|[1206](https://leetcode.com/problems/design-skiplist/)| * Design Skiplist|60%|Hard|| +|[1203](https://leetcode.com/problems/sort-items-by-groups-respecting-dependencies/)| * Sort Items by Groups Respecting Dependencies|45%|Hard|| +|[1202](https://leetcode.com/problems/smallest-string-with-swaps/)|[Smallest String With Swaps](./Algorithms/1202.smallest-string-with-swaps)|41%|Medium|| +|[1201](https://leetcode.com/problems/ugly-number-iii/)| * Ugly Number III|24%|Medium|| +|[1200](https://leetcode.com/problems/minimum-absolute-difference/)|[Minimum Absolute Difference](./Algorithms/1200.minimum-absolute-difference)|66%|Easy|| +|[1192](https://leetcode.com/problems/critical-connections-in-a-network/)| * Critical Connections in a Network|47%|Hard|| +|[1191](https://leetcode.com/problems/k-concatenation-maximum-sum/)| * K-Concatenation Maximum Sum|24%|Medium|| +|[1190](https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/)|[Reverse Substrings Between Each Pair of Parentheses](./Algorithms/1190.reverse-substrings-between-each-pair-of-parentheses)|57%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1189](https://leetcode.com/problems/maximum-number-of-balloons/)|[Maximum Number of Balloons](./Algorithms/1189.maximum-number-of-balloons)|61%|Easy|| +|[1187](https://leetcode.com/problems/make-array-strictly-increasing/)| * Make Array Strictly Increasing|40%|Hard|| +|[1186](https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/)|[Maximum Subarray Sum with One Deletion](./Algorithms/1186.maximum-subarray-sum-with-one-deletion)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1185](https://leetcode.com/problems/day-of-the-week/)|[Day of the Week](./Algorithms/1185.day-of-the-week)|64%|Easy|| +|[1184](https://leetcode.com/problems/distance-between-bus-stops/)|[Distance Between Bus Stops](./Algorithms/1184.distance-between-bus-stops)|56%|Easy|| +|[1178](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle/)|[Number of Valid Words for Each Puzzle](./Algorithms/1178.number-of-valid-words-for-each-puzzle)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1177](https://leetcode.com/problems/can-make-palindrome-from-substring/)|[Can Make Palindrome from Substring](./Algorithms/1177.can-make-palindrome-from-substring)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1175](https://leetcode.com/problems/prime-arrangements/)|[Prime Arrangements](./Algorithms/1175.prime-arrangements)|50%|Easy|| +|[1172](https://leetcode.com/problems/dinner-plate-stacks/)|[Dinner Plate Stacks](./Algorithms/1172.dinner-plate-stacks)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1171](https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list/)|[Remove Zero Sum Consecutive Nodes from Linked List](./Algorithms/1171.remove-zero-sum-consecutive-nodes-from-linked-list)|41%|Medium|| +|[1170](https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character/)|[Compare Strings by Frequency of the Smallest Character](./Algorithms/1170.compare-strings-by-frequency-of-the-smallest-character)|58%|Easy|| +|[1169](https://leetcode.com/problems/invalid-transactions/)|[Invalid Transactions](./Algorithms/1169.invalid-transactions)|28%|Medium|| +|[1163](https://leetcode.com/problems/last-substring-in-lexicographical-order/)|[Last Substring in Lexicographical Order](./Algorithms/1163.last-substring-in-lexicographical-order)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1162](https://leetcode.com/problems/as-far-from-land-as-possible/)|[As Far from Land as Possible](./Algorithms/1162.as-far-from-land-as-possible)|40%|Medium|| +|[1161](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/)|[Maximum Level Sum of a Binary Tree](./Algorithms/1161.maximum-level-sum-of-a-binary-tree)|70%|Medium|| +|[1160](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/)|[Find Words That Can Be Formed by Characters](./Algorithms/1160.find-words-that-can-be-formed-by-characters)|66%|Easy|| +|[1157](https://leetcode.com/problems/online-majority-element-in-subarray/)|[Online Majority Element In Subarray](./Algorithms/1157.online-majority-element-in-subarray)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1156](https://leetcode.com/problems/swap-for-longest-repeated-character-substring/)|[Swap For Longest Repeated Character Substring](./Algorithms/1156.swap-for-longest-repeated-character-substring)|46%|Medium|| +|[1155](https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/)|[Number of Dice Rolls With Target Sum](./Algorithms/1155.number-of-dice-rolls-with-target-sum)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1154](https://leetcode.com/problems/day-of-the-year/)|[Day of the Year](./Algorithms/1154.day-of-the-year)|48%|Easy|| +|[1147](https://leetcode.com/problems/longest-chunked-palindrome-decomposition/)|[Longest Chunked Palindrome Decomposition](./Algorithms/1147.longest-chunked-palindrome-decomposition)|58%|Hard|| +|[1146](https://leetcode.com/problems/snapshot-array/)|[Snapshot Array](./Algorithms/1146.snapshot-array)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1145](https://leetcode.com/problems/binary-tree-coloring-game/)|[Binary Tree Coloring Game](./Algorithms/1145.binary-tree-coloring-game)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1144](https://leetcode.com/problems/decrease-elements-to-make-array-zigzag/)|[Decrease Elements To Make Array Zigzag](./Algorithms/1144.decrease-elements-to-make-array-zigzag)|43%|Medium|| +|[1143](https://leetcode.com/problems/longest-common-subsequence/)|[Longest Common Subsequence](./Algorithms/1143.longest-common-subsequence)|57%|Medium|| +|[1140](https://leetcode.com/problems/stone-game-ii/)|[Stone Game II](./Algorithms/1140.stone-game-ii)|60%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1139](https://leetcode.com/problems/largest-1-bordered-square/)|[Largest 1-Bordered Square](./Algorithms/1139.largest-1-bordered-square)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1138](https://leetcode.com/problems/alphabet-board-path/)|[Alphabet Board Path](./Algorithms/1138.alphabet-board-path)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1137](https://leetcode.com/problems/n-th-tribonacci-number/)|[N-th Tribonacci Number](./Algorithms/1137.n-th-tribonacci-number)|57%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1131](https://leetcode.com/problems/maximum-of-absolute-value-expression/)|[Maximum of Absolute Value Expression](./Algorithms/1131.maximum-of-absolute-value-expression)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1130](https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/)|[Minimum Cost Tree From Leaf Values](./Algorithms/1130.minimum-cost-tree-from-leaf-values)|62%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1129](https://leetcode.com/problems/shortest-path-with-alternating-colors/)|[Shortest Path with Alternating Colors](./Algorithms/1129.shortest-path-with-alternating-colors)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1128](https://leetcode.com/problems/number-of-equivalent-domino-pairs/)|[Number of Equivalent Domino Pairs](./Algorithms/1128.number-of-equivalent-domino-pairs)|46%|Easy|| +|[1125](https://leetcode.com/problems/smallest-sufficient-team/)|[Smallest Sufficient Team](./Algorithms/1125.smallest-sufficient-team)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1124](https://leetcode.com/problems/longest-well-performing-interval/)|[Longest Well-Performing Interval](./Algorithms/1124.longest-well-performing-interval)|31%|Medium|| +|[1123](https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/)|[Lowest Common Ancestor of Deepest Leaves](./Algorithms/1123.lowest-common-ancestor-of-deepest-leaves)|64%|Medium|| +|[1122](https://leetcode.com/problems/relative-sort-array/)|[Relative Sort Array](./Algorithms/1122.relative-sort-array)|66%|Easy|| +|[1111](https://leetcode.com/problems/maximum-nesting-depth-of-two-valid-parentheses-strings/)|[Maximum Nesting Depth of Two Valid Parentheses Strings](./Algorithms/1111.maximum-nesting-depth-of-two-valid-parentheses-strings)|67%|Medium|| +|[1110](https://leetcode.com/problems/delete-nodes-and-return-forest/)|[Delete Nodes And Return Forest](./Algorithms/1110.delete-nodes-and-return-forest)|64%|Medium|| +|[1109](https://leetcode.com/problems/corporate-flight-bookings/)|[Corporate Flight Bookings](./Algorithms/1109.corporate-flight-bookings)|49%|Medium|| +|[1108](https://leetcode.com/problems/defanging-an-ip-address/)|[Defanging an IP Address](./Algorithms/1108.defanging-an-ip-address)|84%|Easy|| +|[1106](https://leetcode.com/problems/parsing-a-boolean-expression/)|[Parsing A Boolean Expression](./Algorithms/1106.parsing-a-boolean-expression)|57%|Hard|| +|[1105](https://leetcode.com/problems/filling-bookcase-shelves/)|[Filling Bookcase Shelves](./Algorithms/1105.filling-bookcase-shelves)|56%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1104](https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/)|[Path In Zigzag Labelled Binary Tree](./Algorithms/1104.path-in-zigzag-labelled-binary-tree)|70%|Medium|| +|[1103](https://leetcode.com/problems/distribute-candies-to-people/)|[Distribute Candies to People](./Algorithms/1103.distribute-candies-to-people)|59%|Easy|| +|[1096](https://leetcode.com/problems/brace-expansion-ii/)|[Brace Expansion II](./Algorithms/1096.brace-expansion-ii)|59%|Hard|| +|[1095](https://leetcode.com/problems/find-in-mountain-array/)|[Find in Mountain Array](./Algorithms/1095.find-in-mountain-array)|34%|Hard|| +|[1094](https://leetcode.com/problems/car-pooling/)|[Car Pooling](./Algorithms/1094.car-pooling)|57%|Medium|| +|[1093](https://leetcode.com/problems/statistics-from-a-large-sample/)|[Statistics from a Large Sample](./Algorithms/1093.statistics-from-a-large-sample)|44%|Medium|| +|[1092](https://leetcode.com/problems/shortest-common-supersequence/)|[Shortest Common Supersequence](./Algorithms/1092.shortest-common-supersequence)|49%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1091](https://leetcode.com/problems/shortest-path-in-binary-matrix/)|[Shortest Path in Binary Matrix](./Algorithms/1091.shortest-path-in-binary-matrix)|36%|Medium|| +|[1090](https://leetcode.com/problems/largest-values-from-labels/)|[Largest Values From Labels](./Algorithms/1090.largest-values-from-labels)|57%|Medium|| +|[1089](https://leetcode.com/problems/duplicate-zeros/)|[Duplicate Zeros](./Algorithms/1089.duplicate-zeros)|58%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1081](https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/)|[Smallest Subsequence of Distinct Characters](./Algorithms/1081.smallest-subsequence-of-distinct-characters)|44%|Medium|| +|[1080](https://leetcode.com/problems/insufficient-nodes-in-root-to-leaf-paths/)|[Insufficient Nodes in Root to Leaf Paths](./Algorithms/1080.insufficient-nodes-in-root-to-leaf-paths)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1079](https://leetcode.com/problems/letter-tile-possibilities/)|[Letter Tile Possibilities](./Algorithms/1079.letter-tile-possibilities)|74%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1078](https://leetcode.com/problems/occurrences-after-bigram/)|[Occurrences After Bigram](./Algorithms/1078.occurrences-after-bigram)|64%|Easy|| +|[1074](https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/)|[Number of Submatrices That Sum to Target](./Algorithms/1074.number-of-submatrices-that-sum-to-target)|58%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1073](https://leetcode.com/problems/adding-two-negabinary-numbers/)|[Adding Two Negabinary Numbers](./Algorithms/1073.adding-two-negabinary-numbers)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1072](https://leetcode.com/problems/flip-columns-for-maximum-number-of-equal-rows/)|[Flip Columns For Maximum Number of Equal Rows](./Algorithms/1072.flip-columns-for-maximum-number-of-equal-rows)|59%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1071](https://leetcode.com/problems/greatest-common-divisor-of-strings/)|[Greatest Common Divisor of Strings](./Algorithms/1071.greatest-common-divisor-of-strings)|53%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1054](https://leetcode.com/problems/distant-barcodes/)|[Distant Barcodes](./Algorithms/1054.distant-barcodes)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1053](https://leetcode.com/problems/previous-permutation-with-one-swap/)|[Previous Permutation With One Swap](./Algorithms/1053.previous-permutation-with-one-swap)|46%|Medium|| +|[1052](https://leetcode.com/problems/grumpy-bookstore-owner/)|[Grumpy Bookstore Owner](./Algorithms/1052.grumpy-bookstore-owner)|53%|Medium|| +|[1051](https://leetcode.com/problems/height-checker/)|[Height Checker](./Algorithms/1051.height-checker)|68%|Easy|| +|[1049](https://leetcode.com/problems/last-stone-weight-ii/)|[Last Stone Weight II](./Algorithms/1049.last-stone-weight-ii)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1048](https://leetcode.com/problems/longest-string-chain/)|[Longest String Chain](./Algorithms/1048.longest-string-chain)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1047](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/)|[Remove All Adjacent Duplicates In String](./Algorithms/1047.remove-all-adjacent-duplicates-in-string)|65%|Easy|| +|[1046](https://leetcode.com/problems/last-stone-weight/)|[Last Stone Weight](./Algorithms/1046.last-stone-weight)|62%|Easy|| +|[1044](https://leetcode.com/problems/longest-duplicate-substring/)|[Longest Duplicate Substring](./Algorithms/1044.longest-duplicate-substring)|23%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1043](https://leetcode.com/problems/partition-array-for-maximum-sum/)|[Partition Array for Maximum Sum](./Algorithms/1043.partition-array-for-maximum-sum)|62%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1042](https://leetcode.com/problems/flower-planting-with-no-adjacent/)|[Flower Planting With No Adjacent](./Algorithms/1042.flower-planting-with-no-adjacent)|47%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1041](https://leetcode.com/problems/robot-bounded-in-circle/)|[Robot Bounded In Circle](./Algorithms/1041.robot-bounded-in-circle)|46%|Medium|| +|[1040](https://leetcode.com/problems/moving-stones-until-consecutive-ii/)|[Moving Stones Until Consecutive II](./Algorithms/1040.moving-stones-until-consecutive-ii)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1039](https://leetcode.com/problems/minimum-score-triangulation-of-polygon/)|[Minimum Score Triangulation of Polygon](./Algorithms/1039.minimum-score-triangulation-of-polygon)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1038](https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/)|[Binary Search Tree to Greater Sum Tree](./Algorithms/1038.binary-search-tree-to-greater-sum-tree)|77%|Medium|| +|[1037](https://leetcode.com/problems/valid-boomerang/)|[Valid Boomerang](./Algorithms/1037.valid-boomerang)|37%|Easy|| +|[1036](https://leetcode.com/problems/escape-a-large-maze/)|[Escape a Large Maze](./Algorithms/1036.escape-a-large-maze)|34%|Hard|| +|[1035](https://leetcode.com/problems/uncrossed-lines/)|[Uncrossed Lines](./Algorithms/1035.uncrossed-lines)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1034](https://leetcode.com/problems/coloring-a-border/)|[Coloring A Border](./Algorithms/1034.coloring-a-border)|43%|Medium|| +|[1033](https://leetcode.com/problems/moving-stones-until-consecutive/)|[Moving Stones Until Consecutive](./Algorithms/1033.moving-stones-until-consecutive)|38%|Easy|| +|[1032](https://leetcode.com/problems/stream-of-characters/)|[Stream of Characters](./Algorithms/1032.stream-of-characters)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1031](https://leetcode.com/problems/maximum-sum-of-two-non-overlapping-subarrays/)|[Maximum Sum of Two Non-Overlapping Subarrays](./Algorithms/1031.maximum-sum-of-two-non-overlapping-subarrays)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1030](https://leetcode.com/problems/matrix-cells-in-distance-order/)|[Matrix Cells in Distance Order](./Algorithms/1030.matrix-cells-in-distance-order)|64%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1029](https://leetcode.com/problems/two-city-scheduling/)|[Two City Scheduling](./Algorithms/1029.two-city-scheduling)|55%|Easy|| +|[1028](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/)|[Recover a Tree From Preorder Traversal](./Algorithms/1028.recover-a-tree-from-preorder-traversal)|69%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1027](https://leetcode.com/problems/longest-arithmetic-sequence/)|[Longest Arithmetic Sequence](./Algorithms/1027.longest-arithmetic-sequence)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1026](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/)|[Maximum Difference Between Node and Ancestor](./Algorithms/1026.maximum-difference-between-node-and-ancestor)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1025](https://leetcode.com/problems/divisor-game/)|[Divisor Game](./Algorithms/1025.divisor-game)|65%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1024](https://leetcode.com/problems/video-stitching/)|[Video Stitching](./Algorithms/1024.video-stitching)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1023](https://leetcode.com/problems/camelcase-matching/)|[Camelcase Matching](./Algorithms/1023.camelcase-matching)|54%|Medium|| +|[1022](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/)|[Sum of Root To Leaf Binary Numbers](./Algorithms/1022.sum-of-root-to-leaf-binary-numbers)|61%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1021](https://leetcode.com/problems/remove-outermost-parentheses/)|[Remove Outermost Parentheses](./Algorithms/1021.remove-outermost-parentheses)|75%|Easy|| +|[1020](https://leetcode.com/problems/number-of-enclaves/)|[Number of Enclaves](./Algorithms/1020.number-of-enclaves)|54%|Medium|| +|[1019](https://leetcode.com/problems/next-greater-node-in-linked-list/)|[Next Greater Node In Linked List](./Algorithms/1019.next-greater-node-in-linked-list)|56%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1018](https://leetcode.com/problems/binary-prefix-divisible-by-5/)|[Binary Prefix Divisible By 5](./Algorithms/1018.binary-prefix-divisible-by-5)|46%|Easy|| +|[1017](https://leetcode.com/problems/convert-to-base-2/)|[Convert to Base -2](./Algorithms/1017.convert-to-base-2)|57%|Medium|| +|[1016](https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n/)|[Binary String With Substrings Representing 1 To N](./Algorithms/1016.binary-string-with-substrings-representing-1-to-n)|58%|Medium|| +|[1015](https://leetcode.com/problems/smallest-integer-divisible-by-k/)|[Smallest Integer Divisible by K](./Algorithms/1015.smallest-integer-divisible-by-k)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1014](https://leetcode.com/problems/best-sightseeing-pair/)|[Best Sightseeing Pair](./Algorithms/1014.best-sightseeing-pair)|51%|Medium|| +|[1013](https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/)|[Partition Array Into Three Parts With Equal Sum](./Algorithms/1013.partition-array-into-three-parts-with-equal-sum)|56%|Easy|| +|[1012](https://leetcode.com/problems/numbers-with-repeated-digits/)|[Numbers With Repeated Digits](./Algorithms/1012.numbers-with-repeated-digits)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1011](https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/)|[Capacity To Ship Packages Within D Days](./Algorithms/1011.capacity-to-ship-packages-within-d-days)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1010](https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/)|[Pairs of Songs With Total Durations Divisible by 60](./Algorithms/1010.pairs-of-songs-with-total-durations-divisible-by-60)|46%|Easy|| +|[1009](https://leetcode.com/problems/complement-of-base-10-integer/)|[Complement of Base 10 Integer](./Algorithms/1009.complement-of-base-10-integer)|59%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[1008](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/)|[Construct Binary Search Tree from Preorder Traversal](./Algorithms/1008.construct-binary-search-tree-from-preorder-traversal)|73%|Medium|| +|[1007](https://leetcode.com/problems/minimum-domino-rotations-for-equal-row/)|[Minimum Domino Rotations For Equal Row](./Algorithms/1007.minimum-domino-rotations-for-equal-row)|51%|Medium|| +|[1006](https://leetcode.com/problems/clumsy-factorial/)|[Clumsy Factorial](./Algorithms/1006.clumsy-factorial)|53%|Medium|| +|[1005](https://leetcode.com/problems/maximize-sum-of-array-after-k-negations/)|[Maximize Sum Of Array After K Negations](./Algorithms/1005.maximize-sum-of-array-after-k-negations)|50%|Easy|| +|[1004](https://leetcode.com/problems/max-consecutive-ones-iii/)|[Max Consecutive Ones III](./Algorithms/1004.max-consecutive-ones-iii)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[1003](https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/)|[Check If Word Is Valid After Substitutions](./Algorithms/1003.check-if-word-is-valid-after-substitutions)|53%|Medium|| +|[1002](https://leetcode.com/problems/find-common-characters/)|[Find Common Characters](./Algorithms/1002.find-common-characters)|65%|Easy|| +|[1001](https://leetcode.com/problems/grid-illumination/)|[Grid Illumination](./Algorithms/1001.grid-illumination)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[1000](https://leetcode.com/problems/minimum-cost-to-merge-stones/)|[Minimum Cost to Merge Stones](./Algorithms/1000.minimum-cost-to-merge-stones)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0999](https://leetcode.com/problems/available-captures-for-rook/)|[Available Captures for Rook](./Algorithms/0999.available-captures-for-rook)|65%|Easy|| +|[0998](https://leetcode.com/problems/maximum-binary-tree-ii/)|[Maximum Binary Tree II](./Algorithms/0998.maximum-binary-tree-ii)|61%|Medium|| +|[0997](https://leetcode.com/problems/find-the-town-judge/)|[Find the Town Judge](./Algorithms/0997.find-the-town-judge)|49%|Easy|| +|[0996](https://leetcode.com/problems/number-of-squareful-arrays/)|[Number of Squareful Arrays](./Algorithms/0996.number-of-squareful-arrays)|47%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0995](https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips/)|[Minimum Number of K Consecutive Bit Flips](./Algorithms/0995.minimum-number-of-k-consecutive-bit-flips)|46%|Hard|| +|[0994](https://leetcode.com/problems/rotting-oranges/)|[Rotting Oranges](./Algorithms/0994.rotting-oranges)|46%|Easy|| +|[0993](https://leetcode.com/problems/cousins-in-binary-tree/)|[Cousins in Binary Tree](./Algorithms/0993.cousins-in-binary-tree)|51%|Easy|| +|[0992](https://leetcode.com/problems/subarrays-with-k-different-integers/)|[Subarrays with K Different Integers](./Algorithms/0992.subarrays-with-k-different-integers)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0991](https://leetcode.com/problems/broken-calculator/)|[Broken Calculator](./Algorithms/0991.broken-calculator)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0990](https://leetcode.com/problems/satisfiability-of-equality-equations/)|[Satisfiability of Equality Equations](./Algorithms/0990.satisfiability-of-equality-equations)|41%|Medium|| +|[0989](https://leetcode.com/problems/add-to-array-form-of-integer/)|[Add to Array-Form of Integer](./Algorithms/0989.add-to-array-form-of-integer)|43%|Easy|| +|[0988](https://leetcode.com/problems/smallest-string-starting-from-leaf/)|[Smallest String Starting From Leaf](./Algorithms/0988.smallest-string-starting-from-leaf)|44%|Medium|| +|[0987](https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/)|[Vertical Order Traversal of a Binary Tree](./Algorithms/0987.vertical-order-traversal-of-a-binary-tree)|33%|Medium|| +|[0986](https://leetcode.com/problems/interval-list-intersections/)|[Interval List Intersections](./Algorithms/0986.interval-list-intersections)|64%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0985](https://leetcode.com/problems/sum-of-even-numbers-after-queries/)|[Sum of Even Numbers After Queries](./Algorithms/0985.sum-of-even-numbers-after-queries)|62%|Easy|| +|[0984](https://leetcode.com/problems/string-without-aaa-or-bbb/)|[String Without AAA or BBB](./Algorithms/0984.string-without-aaa-or-bbb)|34%|Medium|| +|[0983](https://leetcode.com/problems/minimum-cost-for-tickets/)|[Minimum Cost For Tickets](./Algorithms/0983.minimum-cost-for-tickets)|57%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0982](https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/)|[Triples with Bitwise AND Equal To Zero](./Algorithms/0982.triples-with-bitwise-and-equal-to-zero)|54%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0981](https://leetcode.com/problems/time-based-key-value-store/)|[Time Based Key-Value Store](./Algorithms/0981.time-based-key-value-store)|51%|Medium|| +|[0980](https://leetcode.com/problems/unique-paths-iii/)|[Unique Paths III](./Algorithms/0980.unique-paths-iii)|71%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0979](https://leetcode.com/problems/distribute-coins-in-binary-tree/)|[Distribute Coins in Binary Tree](./Algorithms/0979.distribute-coins-in-binary-tree)|67%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0978](https://leetcode.com/problems/longest-turbulent-subarray/)|[Longest Turbulent Subarray](./Algorithms/0978.longest-turbulent-subarray)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0977](https://leetcode.com/problems/squares-of-a-sorted-array/)|[Squares of a Sorted Array](./Algorithms/0977.squares-of-a-sorted-array)|71%|Easy|| +|[0976](https://leetcode.com/problems/largest-perimeter-triangle/)|[Largest Perimeter Triangle](./Algorithms/0976.largest-perimeter-triangle)|57%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0975](https://leetcode.com/problems/odd-even-jump/)|[Odd Even Jump](./Algorithms/0975.odd-even-jump)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0974](https://leetcode.com/problems/subarray-sums-divisible-by-k/)|[Subarray Sums Divisible by K](./Algorithms/0974.subarray-sums-divisible-by-k)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0973](https://leetcode.com/problems/k-closest-points-to-origin/)|[K Closest Points to Origin](./Algorithms/0973.k-closest-points-to-origin)|61%|Medium|| +|[0972](https://leetcode.com/problems/equal-rational-numbers/)|[Equal Rational Numbers](./Algorithms/0972.equal-rational-numbers)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0971](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/)|[Flip Binary Tree To Match Preorder Traversal](./Algorithms/0971.flip-binary-tree-to-match-preorder-traversal)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0970](https://leetcode.com/problems/powerful-integers/)|[Powerful Integers](./Algorithms/0970.powerful-integers)|39%|Easy|| +|[0969](https://leetcode.com/problems/pancake-sorting/)|[Pancake Sorting](./Algorithms/0969.pancake-sorting)|62%|Medium|| +|[0968](https://leetcode.com/problems/binary-tree-cameras/)|[Binary Tree Cameras](./Algorithms/0968.binary-tree-cameras)|36%|Hard|| +|[0967](https://leetcode.com/problems/numbers-with-same-consecutive-differences/)|[Numbers With Same Consecutive Differences](./Algorithms/0967.numbers-with-same-consecutive-differences)|38%|Medium|| +|[0966](https://leetcode.com/problems/vowel-spellchecker/)|[Vowel Spellchecker](./Algorithms/0966.vowel-spellchecker)|44%|Medium|| +|[0965](https://leetcode.com/problems/univalued-binary-tree/)|[Univalued Binary Tree](./Algorithms/0965.univalued-binary-tree)|66%|Easy|| +|[0964](https://leetcode.com/problems/least-operators-to-express-number/)|[Least Operators to Express Number](./Algorithms/0964.least-operators-to-express-number)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0963](https://leetcode.com/problems/minimum-area-rectangle-ii/)|[Minimum Area Rectangle II](./Algorithms/0963.minimum-area-rectangle-ii)|47%|Medium|| +|[0962](https://leetcode.com/problems/maximum-width-ramp/)|[Maximum Width Ramp](./Algorithms/0962.maximum-width-ramp)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0961](https://leetcode.com/problems/n-repeated-element-in-size-2n-array/)|[N-Repeated Element in Size 2N Array](./Algorithms/0961.n-repeated-element-in-size-2n-array)|72%|Easy|| +|[0960](https://leetcode.com/problems/delete-columns-to-make-sorted-iii/)|[Delete Columns to Make Sorted III](./Algorithms/0960.delete-columns-to-make-sorted-iii)|52%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0959](https://leetcode.com/problems/regions-cut-by-slashes/)|[Regions Cut By Slashes](./Algorithms/0959.regions-cut-by-slashes)|63%|Medium|| +|[0958](https://leetcode.com/problems/check-completeness-of-a-binary-tree/)|[Check Completeness of a Binary Tree](./Algorithms/0958.check-completeness-of-a-binary-tree)|50%|Medium|| +|[0957](https://leetcode.com/problems/prison-cells-after-n-days/)|[Prison Cells After N Days](./Algorithms/0957.prison-cells-after-n-days)|38%|Medium|| +|[0956](https://leetcode.com/problems/tallest-billboard/)|[Tallest Billboard](./Algorithms/0956.tallest-billboard)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0955](https://leetcode.com/problems/delete-columns-to-make-sorted-ii/)|[Delete Columns to Make Sorted II](./Algorithms/0955.delete-columns-to-make-sorted-ii)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0954](https://leetcode.com/problems/array-of-doubled-pairs/)|[Array of Doubled Pairs](./Algorithms/0954.array-of-doubled-pairs)|35%|Medium|| +|[0953](https://leetcode.com/problems/verifying-an-alien-dictionary/)|[Verifying an Alien Dictionary](./Algorithms/0953.verifying-an-alien-dictionary)|55%|Easy|| +|[0952](https://leetcode.com/problems/largest-component-size-by-common-factor/)|[Largest Component Size by Common Factor](./Algorithms/0952.largest-component-size-by-common-factor)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0951](https://leetcode.com/problems/flip-equivalent-binary-trees/)|[Flip Equivalent Binary Trees](./Algorithms/0951.flip-equivalent-binary-trees)|65%|Medium|| +|[0950](https://leetcode.com/problems/reveal-cards-in-increasing-order/)|[Reveal Cards In Increasing Order](./Algorithms/0950.reveal-cards-in-increasing-order)|72%|Medium|| +|[0949](https://leetcode.com/problems/largest-time-for-given-digits/)|[Largest Time for Given Digits](./Algorithms/0949.largest-time-for-given-digits)|34%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0948](https://leetcode.com/problems/bag-of-tokens/)|[Bag of Tokens](./Algorithms/0948.bag-of-tokens)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0947](https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/)|[Most Stones Removed with Same Row or Column](./Algorithms/0947.most-stones-removed-with-same-row-or-column)|54%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0946](https://leetcode.com/problems/validate-stack-sequences/)|[Validate Stack Sequences](./Algorithms/0946.validate-stack-sequences)|58%|Medium|| +|[0945](https://leetcode.com/problems/minimum-increment-to-make-array-unique/)|[Minimum Increment to Make Array Unique](./Algorithms/0945.minimum-increment-to-make-array-unique)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0944](https://leetcode.com/problems/delete-columns-to-make-sorted/)|[Delete Columns to Make Sorted](./Algorithms/0944.delete-columns-to-make-sorted)|69%|Easy|| +|[0943](https://leetcode.com/problems/find-the-shortest-superstring/)|[Find the Shortest Superstring](./Algorithms/0943.find-the-shortest-superstring)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0942](https://leetcode.com/problems/di-string-match/)|[DI String Match](./Algorithms/0942.di-string-match)|70%|Easy|| +|[0941](https://leetcode.com/problems/valid-mountain-array/)|[Valid Mountain Array](./Algorithms/0941.valid-mountain-array)|35%|Easy|| +|[0940](https://leetcode.com/problems/distinct-subsequences-ii/)|[Distinct Subsequences II](./Algorithms/0940.distinct-subsequences-ii)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0939](https://leetcode.com/problems/minimum-area-rectangle/)|[Minimum Area Rectangle](./Algorithms/0939.minimum-area-rectangle)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0938](https://leetcode.com/problems/range-sum-of-bst/)|[Range Sum of BST](./Algorithms/0938.range-sum-of-bst)|78%|Easy|| +|[0937](https://leetcode.com/problems/reorder-data-in-log-files/)|[Reorder Data in Log Files](./Algorithms/0937.reorder-data-in-log-files)|54%|Easy|| +|[0936](https://leetcode.com/problems/stamping-the-sequence/)|[Stamping The Sequence](./Algorithms/0936.stamping-the-sequence)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0935](https://leetcode.com/problems/knight-dialer/)|[Knight Dialer](./Algorithms/0935.knight-dialer)|42%|Medium|| +|[0934](https://leetcode.com/problems/shortest-bridge/)|[Shortest Bridge](./Algorithms/0934.shortest-bridge)|45%|Medium|| +|[0933](https://leetcode.com/problems/number-of-recent-calls/)|[Number of Recent Calls](./Algorithms/0933.number-of-recent-calls)|69%|Easy|| +|[0932](https://leetcode.com/problems/beautiful-array/)|[Beautiful Array](./Algorithms/0932.beautiful-array)|54%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0931](https://leetcode.com/problems/minimum-falling-path-sum/)|[Minimum Falling Path Sum](./Algorithms/0931.minimum-falling-path-sum)|59%|Medium|| +|[0930](https://leetcode.com/problems/binary-subarrays-with-sum/)|[Binary Subarrays With Sum](./Algorithms/0930.binary-subarrays-with-sum)|39%|Medium|| +|[0929](https://leetcode.com/problems/unique-email-addresses/)|[Unique Email Addresses](./Algorithms/0929.unique-email-addresses)|68%|Easy|| +|[0928](https://leetcode.com/problems/minimize-malware-spread-ii/)|[Minimize Malware Spread II](./Algorithms/0928.minimize-malware-spread-ii)|39%|Hard|| +|[0927](https://leetcode.com/problems/three-equal-parts/)|[Three Equal Parts](./Algorithms/0927.three-equal-parts)|31%|Hard|| +|[0926](https://leetcode.com/problems/flip-string-to-monotone-increasing/)|[Flip String to Monotone Increasing](./Algorithms/0926.flip-string-to-monotone-increasing)|51%|Medium|| +|[0925](https://leetcode.com/problems/long-pressed-name/)|[Long Pressed Name](./Algorithms/0925.long-pressed-name)|44%|Easy|| +|[0924](https://leetcode.com/problems/minimize-malware-spread/)|[Minimize Malware Spread](./Algorithms/0924.minimize-malware-spread)|40%|Hard|| +|[0923](https://leetcode.com/problems/3sum-with-multiplicity/)|[3Sum With Multiplicity](./Algorithms/0923.3sum-with-multiplicity)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0922](https://leetcode.com/problems/sort-array-by-parity-ii/)|[Sort Array By Parity II](./Algorithms/0922.sort-array-by-parity-ii)|67%|Easy|| +|[0921](https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/)|[Minimum Add to Make Parentheses Valid](./Algorithms/0921.minimum-add-to-make-parentheses-valid)|70%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0920](https://leetcode.com/problems/number-of-music-playlists/)|[Number of Music Playlists](./Algorithms/0920.number-of-music-playlists)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0919](https://leetcode.com/problems/complete-binary-tree-inserter/)|[Complete Binary Tree Inserter](./Algorithms/0919.complete-binary-tree-inserter)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0918](https://leetcode.com/problems/maximum-sum-circular-subarray/)|[Maximum Sum Circular Subarray](./Algorithms/0918.maximum-sum-circular-subarray)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0917](https://leetcode.com/problems/reverse-only-letters/)|[Reverse Only Letters](./Algorithms/0917.reverse-only-letters)|56%|Easy|| +|[0916](https://leetcode.com/problems/word-subsets/)|[Word Subsets](./Algorithms/0916.word-subsets)|45%|Medium|| +|[0915](https://leetcode.com/problems/partition-array-into-disjoint-intervals/)|[Partition Array into Disjoint Intervals](./Algorithms/0915.partition-array-into-disjoint-intervals)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0914](https://leetcode.com/problems/x-of-a-kind-in-a-deck-of-cards/)|[X of a Kind in a Deck of Cards](./Algorithms/0914.x-of-a-kind-in-a-deck-of-cards)|34%|Easy|| +|[0913](https://leetcode.com/problems/cat-and-mouse/)|[Cat and Mouse](./Algorithms/0913.cat-and-mouse)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0912](https://leetcode.com/problems/sort-an-array/)|[Sort an Array](./Algorithms/0912.sort-an-array)|62%|Medium|| +|[0911](https://leetcode.com/problems/online-election/)|[Online Election](./Algorithms/0911.online-election)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0910](https://leetcode.com/problems/smallest-range-ii/)|[Smallest Range II](./Algorithms/0910.smallest-range-ii)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0909](https://leetcode.com/problems/snakes-and-ladders/)|[Snakes and Ladders](./Algorithms/0909.snakes-and-ladders)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0908](https://leetcode.com/problems/smallest-range-i/)|[Smallest Range I](./Algorithms/0908.smallest-range-i)|64%|Easy|| +|[0907](https://leetcode.com/problems/sum-of-subarray-minimums/)|[Sum of Subarray Minimums](./Algorithms/0907.sum-of-subarray-minimums)|29%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0906](https://leetcode.com/problems/super-palindromes/)|[Super Palindromes](./Algorithms/0906.super-palindromes)|30%|Hard|| +|[0905](https://leetcode.com/problems/sort-array-by-parity/)|[Sort Array By Parity](./Algorithms/0905.sort-array-by-parity)|72%|Easy|| +|[0904](https://leetcode.com/problems/fruit-into-baskets/)|[Fruit Into Baskets](./Algorithms/0904.fruit-into-baskets)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0903](https://leetcode.com/problems/valid-permutations-for-di-sequence/)|[Valid Permutations for DI Sequence](./Algorithms/0903.valid-permutations-for-di-sequence)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0902](https://leetcode.com/problems/numbers-at-most-n-given-digit-set/)|[Numbers At Most N Given Digit Set](./Algorithms/0902.numbers-at-most-n-given-digit-set)|29%|Hard|| +|[0901](https://leetcode.com/problems/online-stock-span/)|[Online Stock Span](./Algorithms/0901.online-stock-span)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0900](https://leetcode.com/problems/rle-iterator/)|[RLE Iterator](./Algorithms/0900.rle-iterator)|51%|Medium|| +|[0899](https://leetcode.com/problems/orderly-queue/)|[Orderly Queue](./Algorithms/0899.orderly-queue)|49%|Hard|| +|[0898](https://leetcode.com/problems/bitwise-ors-of-subarrays/)|[Bitwise ORs of Subarrays](./Algorithms/0898.bitwise-ors-of-subarrays)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0897](https://leetcode.com/problems/increasing-order-search-tree/)|[Increasing Order Search Tree](./Algorithms/0897.increasing-order-search-tree)|66%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0896](https://leetcode.com/problems/monotonic-array/)|[Monotonic Array](./Algorithms/0896.monotonic-array)|56%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0895](https://leetcode.com/problems/maximum-frequency-stack/)|[Maximum Frequency Stack](./Algorithms/0895.maximum-frequency-stack)|58%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0894](https://leetcode.com/problems/all-possible-full-binary-trees/)|[All Possible Full Binary Trees](./Algorithms/0894.all-possible-full-binary-trees)|72%|Medium|| +|[0893](https://leetcode.com/problems/groups-of-special-equivalent-strings/)|[Groups of Special-Equivalent Strings](./Algorithms/0893.groups-of-special-equivalent-strings)|63%|Easy|| +|[0892](https://leetcode.com/problems/surface-area-of-3d-shapes/)|[Surface Area of 3D Shapes](./Algorithms/0892.surface-area-of-3d-shapes)|57%|Easy|| +|[0891](https://leetcode.com/problems/sum-of-subsequence-widths/)|[Sum of Subsequence Widths](./Algorithms/0891.sum-of-subsequence-widths)|30%|Hard|| +|[0890](https://leetcode.com/problems/find-and-replace-pattern/)|[Find and Replace Pattern](./Algorithms/0890.find-and-replace-pattern)|72%|Medium|| +|[0889](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/)|[Construct Binary Tree from Preorder and Postorder Traversal](./Algorithms/0889.construct-binary-tree-from-preorder-and-postorder-traversal)|62%|Medium|| +|[0888](https://leetcode.com/problems/fair-candy-swap/)|[Fair Candy Swap](./Algorithms/0888.fair-candy-swap)|56%|Easy|| +|[0887](https://leetcode.com/problems/super-egg-drop/)|[Super Egg Drop](./Algorithms/0887.super-egg-drop)|25%|Hard|| +|[0886](https://leetcode.com/problems/possible-bipartition/)|[Possible Bipartition](./Algorithms/0886.possible-bipartition)|41%|Medium|| +|[0885](https://leetcode.com/problems/spiral-matrix-iii/)|[Spiral Matrix III](./Algorithms/0885.spiral-matrix-iii)|66%|Medium|| +|[0884](https://leetcode.com/problems/uncommon-words-from-two-sentences/)|[Uncommon Words from Two Sentences](./Algorithms/0884.uncommon-words-from-two-sentences)|61%|Easy|| +|[0883](https://leetcode.com/problems/projection-area-of-3d-shapes/)|[Projection Area of 3D Shapes](./Algorithms/0883.projection-area-of-3d-shapes)|66%|Easy|| +|[0882](https://leetcode.com/problems/reachable-nodes-in-subdivided-graph/)|[Reachable Nodes In Subdivided Graph](./Algorithms/0882.reachable-nodes-in-subdivided-graph)|39%|Hard|| +|[0881](https://leetcode.com/problems/boats-to-save-people/)|[Boats to Save People](./Algorithms/0881.boats-to-save-people)|44%|Medium|| +|[0880](https://leetcode.com/problems/decoded-string-at-index/)|[Decoded String at Index](./Algorithms/0880.decoded-string-at-index)|23%|Medium|| +|[0879](https://leetcode.com/problems/profitable-schemes/)|[Profitable Schemes](./Algorithms/0879.profitable-schemes)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0878](https://leetcode.com/problems/nth-magical-number/)|[Nth Magical Number](./Algorithms/0878.nth-magical-number)|26%|Hard|| +|[0877](https://leetcode.com/problems/stone-game/)|[Stone Game](./Algorithms/0877.stone-game)|62%|Medium|| +|[0876](https://leetcode.com/problems/middle-of-the-linked-list/)|[Middle of the Linked List](./Algorithms/0876.middle-of-the-linked-list)|65%|Easy|| +|[0875](https://leetcode.com/problems/koko-eating-bananas/)|[Koko Eating Bananas](./Algorithms/0875.koko-eating-bananas)|48%|Medium|| +|[0874](https://leetcode.com/problems/walking-robot-simulation/)|[Walking Robot Simulation](./Algorithms/0874.walking-robot-simulation)|33%|Easy|| +|[0873](https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/)|[Length of Longest Fibonacci Subsequence](./Algorithms/0873.length-of-longest-fibonacci-subsequence)|47%|Medium|| +|[0872](https://leetcode.com/problems/leaf-similar-trees/)|[Leaf-Similar Trees](./Algorithms/0872.leaf-similar-trees)|64%|Easy|| +|[0871](https://leetcode.com/problems/minimum-number-of-refueling-stops/)|[Minimum Number of Refueling Stops](./Algorithms/0871.minimum-number-of-refueling-stops)|30%|Hard|| +|[0870](https://leetcode.com/problems/advantage-shuffle/)|[Advantage Shuffle](./Algorithms/0870.advantage-shuffle)|43%|Medium|| +|[0869](https://leetcode.com/problems/reordered-power-of-2/)|[Reordered Power of 2](./Algorithms/0869.reordered-power-of-2)|51%|Medium|| +|[0868](https://leetcode.com/problems/binary-gap/)|[Binary Gap](./Algorithms/0868.binary-gap)|59%|Easy|| +|[0867](https://leetcode.com/problems/transpose-matrix/)|[Transpose Matrix](./Algorithms/0867.transpose-matrix)|63%|Easy|| +|[0866](https://leetcode.com/problems/prime-palindrome/)|[Prime Palindrome](./Algorithms/0866.prime-palindrome)|21%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0865](https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/)|[Smallest Subtree with all the Deepest Nodes](./Algorithms/0865.smallest-subtree-with-all-the-deepest-nodes)|58%|Medium|| +|[0864](https://leetcode.com/problems/shortest-path-to-get-all-keys/)|[Shortest Path to Get All Keys](./Algorithms/0864.shortest-path-to-get-all-keys)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0863](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/)|[All Nodes Distance K in Binary Tree](./Algorithms/0863.all-nodes-distance-k-in-binary-tree)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0862](https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/)|[Shortest Subarray with Sum at Least K](./Algorithms/0862.shortest-subarray-with-sum-at-least-k)|22%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0861](https://leetcode.com/problems/score-after-flipping-matrix/)|[Score After Flipping Matrix](./Algorithms/0861.score-after-flipping-matrix)|70%|Medium|| +|[0860](https://leetcode.com/problems/lemonade-change/)|[Lemonade Change](./Algorithms/0860.lemonade-change)|50%|Easy|| +|[0859](https://leetcode.com/problems/buddy-strings/)|[Buddy Strings](./Algorithms/0859.buddy-strings)|27%|Easy|| +|[0858](https://leetcode.com/problems/mirror-reflection/)|[Mirror Reflection](./Algorithms/0858.mirror-reflection)|52%|Medium|| +|[0857](https://leetcode.com/problems/minimum-cost-to-hire-k-workers/)|[Minimum Cost to Hire K Workers](./Algorithms/0857.minimum-cost-to-hire-k-workers)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0856](https://leetcode.com/problems/score-of-parentheses/)|[Score of Parentheses](./Algorithms/0856.score-of-parentheses)|57%|Medium|| +|[0855](https://leetcode.com/problems/exam-room/)|[Exam Room](./Algorithms/0855.exam-room)|40%|Medium|| +|[0854](https://leetcode.com/problems/k-similar-strings/)|[K-Similar Strings](./Algorithms/0854.k-similar-strings)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0853](https://leetcode.com/problems/car-fleet/)|[Car Fleet](./Algorithms/0853.car-fleet)|41%|Medium|| +|[0852](https://leetcode.com/problems/peak-index-in-a-mountain-array/)|[Peak Index in a Mountain Array](./Algorithms/0852.peak-index-in-a-mountain-array)|70%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0851](https://leetcode.com/problems/loud-and-rich/)|[Loud and Rich](./Algorithms/0851.loud-and-rich)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0850](https://leetcode.com/problems/rectangle-area-ii/)|[Rectangle Area II](./Algorithms/0850.rectangle-area-ii)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0849](https://leetcode.com/problems/maximize-distance-to-closest-person/)|[Maximize Distance to Closest Person](./Algorithms/0849.maximize-distance-to-closest-person)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0848](https://leetcode.com/problems/shifting-letters/)|[Shifting Letters](./Algorithms/0848.shifting-letters)|42%|Medium|| +|[0847](https://leetcode.com/problems/shortest-path-visiting-all-nodes/)|[Shortest Path Visiting All Nodes](./Algorithms/0847.shortest-path-visiting-all-nodes)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0846](https://leetcode.com/problems/hand-of-straights/)|[Hand of Straights](./Algorithms/0846.hand-of-straights)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0845](https://leetcode.com/problems/longest-mountain-in-array/)|[Longest Mountain in Array](./Algorithms/0845.longest-mountain-in-array)|35%|Medium|| +|[0844](https://leetcode.com/problems/backspace-string-compare/)|[Backspace String Compare](./Algorithms/0844.backspace-string-compare)|46%|Easy|| +|[0843](https://leetcode.com/problems/guess-the-word/)|[Guess the Word](./Algorithms/0843.guess-the-word)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0842](https://leetcode.com/problems/split-array-into-fibonacci-sequence/)|[Split Array into Fibonacci Sequence](./Algorithms/0842.split-array-into-fibonacci-sequence)|35%|Medium|| +|[0841](https://leetcode.com/problems/keys-and-rooms/)|[Keys and Rooms](./Algorithms/0841.keys-and-rooms)|61%|Medium|| +|[0840](https://leetcode.com/problems/magic-squares-in-grid/)|[Magic Squares In Grid](./Algorithms/0840.magic-squares-in-grid)|36%|Easy|| +|[0839](https://leetcode.com/problems/similar-string-groups/)|[Similar String Groups](./Algorithms/0839.similar-string-groups)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0838](https://leetcode.com/problems/push-dominoes/)|[Push Dominoes](./Algorithms/0838.push-dominoes)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0837](https://leetcode.com/problems/new-21-game/)|[New 21 Game](./Algorithms/0837.new-21-game)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0836](https://leetcode.com/problems/rectangle-overlap/)|[Rectangle Overlap](./Algorithms/0836.rectangle-overlap)|47%|Easy|| +|[0835](https://leetcode.com/problems/image-overlap/)|[Image Overlap](./Algorithms/0835.image-overlap)|54%|Medium|| +|[0834](https://leetcode.com/problems/sum-of-distances-in-tree/)|[Sum of Distances in Tree](./Algorithms/0834.sum-of-distances-in-tree)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0833](https://leetcode.com/problems/find-and-replace-in-string/)|[Find And Replace in String](./Algorithms/0833.find-and-replace-in-string)|48%|Medium|| +|[0832](https://leetcode.com/problems/flipping-an-image/)|[Flipping an Image](./Algorithms/0832.flipping-an-image)|73%|Easy|| +|[0831](https://leetcode.com/problems/masking-personal-information/)|[Masking Personal Information](./Algorithms/0831.masking-personal-information)|42%|Medium|| +|[0830](https://leetcode.com/problems/positions-of-large-groups/)|[Positions of Large Groups](./Algorithms/0830.positions-of-large-groups)|48%|Easy|| +|[0829](https://leetcode.com/problems/consecutive-numbers-sum/)|[Consecutive Numbers Sum](./Algorithms/0829.consecutive-numbers-sum)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0828](https://leetcode.com/problems/unique-letter-string/)|[Unique Letter String](./Algorithms/0828.unique-letter-string)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0827](https://leetcode.com/problems/making-a-large-island/)|[Making A Large Island](./Algorithms/0827.making-a-large-island)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0826](https://leetcode.com/problems/most-profit-assigning-work/)|[Most Profit Assigning Work](./Algorithms/0826.most-profit-assigning-work)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0825](https://leetcode.com/problems/friends-of-appropriate-ages/)|[Friends Of Appropriate Ages](./Algorithms/0825.friends-of-appropriate-ages)|39%|Medium|| +|[0824](https://leetcode.com/problems/goat-latin/)|[Goat Latin](./Algorithms/0824.goat-latin)|59%|Easy|| +|[0823](https://leetcode.com/problems/binary-trees-with-factors/)|[Binary Trees With Factors](./Algorithms/0823.binary-trees-with-factors)|33%|Medium|| +|[0822](https://leetcode.com/problems/card-flipping-game/)|[Card Flipping Game](./Algorithms/0822.card-flipping-game)|41%|Medium|| +|[0821](https://leetcode.com/problems/shortest-distance-to-a-character/)|[Shortest Distance to a Character](./Algorithms/0821.shortest-distance-to-a-character)|64%|Easy|| +|[0820](https://leetcode.com/problems/short-encoding-of-words/)|[Short Encoding of Words](./Algorithms/0820.short-encoding-of-words)|48%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0819](https://leetcode.com/problems/most-common-word/)|[Most Common Word](./Algorithms/0819.most-common-word)|43%|Easy|| +|[0818](https://leetcode.com/problems/race-car/)|[Race Car](./Algorithms/0818.race-car)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0817](https://leetcode.com/problems/linked-list-components/)|[Linked List Components](./Algorithms/0817.linked-list-components)|55%|Medium|| +|[0816](https://leetcode.com/problems/ambiguous-coordinates/)|[Ambiguous Coordinates](./Algorithms/0816.ambiguous-coordinates)|45%|Medium|| +|[0815](https://leetcode.com/problems/bus-routes/)|[Bus Routes](./Algorithms/0815.bus-routes)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0814](https://leetcode.com/problems/binary-tree-pruning/)|[Binary Tree Pruning](./Algorithms/0814.binary-tree-pruning)|72%|Medium|| +|[0813](https://leetcode.com/problems/largest-sum-of-averages/)|[Largest Sum of Averages](./Algorithms/0813.largest-sum-of-averages)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0812](https://leetcode.com/problems/largest-triangle-area/)|[Largest Triangle Area](./Algorithms/0812.largest-triangle-area)|56%|Easy|| +|[0811](https://leetcode.com/problems/subdomain-visit-count/)|[Subdomain Visit Count](./Algorithms/0811.subdomain-visit-count)|66%|Easy|| +|[0810](https://leetcode.com/problems/chalkboard-xor-game/)|[Chalkboard XOR Game](./Algorithms/0810.chalkboard-xor-game)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0809](https://leetcode.com/problems/expressive-words/)|[Expressive Words](./Algorithms/0809.expressive-words)|45%|Medium|| +|[0808](https://leetcode.com/problems/soup-servings/)|[Soup Servings](./Algorithms/0808.soup-servings)|38%|Medium|| +|[0807](https://leetcode.com/problems/max-increase-to-keep-city-skyline/)|[Max Increase to Keep City Skyline](./Algorithms/0807.max-increase-to-keep-city-skyline)|82%|Medium|| +|[0806](https://leetcode.com/problems/number-of-lines-to-write-string/)|[Number of Lines To Write String](./Algorithms/0806.number-of-lines-to-write-string)|63%|Easy|| +|[0805](https://leetcode.com/problems/split-array-with-same-average/)|[Split Array With Same Average](./Algorithms/0805.split-array-with-same-average)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0804](https://leetcode.com/problems/unique-morse-code-words/)|[Unique Morse Code Words](./Algorithms/0804.unique-morse-code-words)|75%|Easy|| +|[0803](https://leetcode.com/problems/bricks-falling-when-hit/)|[Bricks Falling When Hit](./Algorithms/0803.bricks-falling-when-hit)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0802](https://leetcode.com/problems/find-eventual-safe-states/)|[Find Eventual Safe States](./Algorithms/0802.find-eventual-safe-states)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0801](https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/)|[Minimum Swaps To Make Sequences Increasing](./Algorithms/0801.minimum-swaps-to-make-sequences-increasing)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0799](https://leetcode.com/problems/champagne-tower/)|[Champagne Tower](./Algorithms/0799.champagne-tower)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0798](https://leetcode.com/problems/smallest-rotation-with-highest-score/)|[Smallest Rotation with Highest Score](./Algorithms/0798.smallest-rotation-with-highest-score)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0797](https://leetcode.com/problems/all-paths-from-source-to-target/)|[All Paths From Source to Target](./Algorithms/0797.all-paths-from-source-to-target)|72%|Medium|| +|[0796](https://leetcode.com/problems/rotate-string/)|[Rotate String](./Algorithms/0796.rotate-string)|49%|Easy|| +|[0795](https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/)|[Number of Subarrays with Bounded Maximum](./Algorithms/0795.number-of-subarrays-with-bounded-maximum)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0794](https://leetcode.com/problems/valid-tic-tac-toe-state/)|[Valid Tic-Tac-Toe State](./Algorithms/0794.valid-tic-tac-toe-state)|31%|Medium|| +|[0793](https://leetcode.com/problems/preimage-size-of-factorial-zeroes-function/)|[Preimage Size of Factorial Zeroes Function](./Algorithms/0793.preimage-size-of-factorial-zeroes-function)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0792](https://leetcode.com/problems/number-of-matching-subsequences/)|[Number of Matching Subsequences](./Algorithms/0792.number-of-matching-subsequences)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0791](https://leetcode.com/problems/custom-sort-string/)|[Custom Sort String](./Algorithms/0791.custom-sort-string)|63%|Medium|| +|[0790](https://leetcode.com/problems/domino-and-tromino-tiling/)|[Domino and Tromino Tiling](./Algorithms/0790.domino-and-tromino-tiling)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0789](https://leetcode.com/problems/escape-the-ghosts/)|[Escape The Ghosts](./Algorithms/0789.escape-the-ghosts)|56%|Medium|| +|[0788](https://leetcode.com/problems/rotated-digits/)|[Rotated Digits](./Algorithms/0788.rotated-digits)|55%|Easy|| +|[0787](https://leetcode.com/problems/cheapest-flights-within-k-stops/)|[Cheapest Flights Within K Stops](./Algorithms/0787.cheapest-flights-within-k-stops)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0786](https://leetcode.com/problems/k-th-smallest-prime-fraction/)|[K-th Smallest Prime Fraction](./Algorithms/0786.k-th-smallest-prime-fraction)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0785](https://leetcode.com/problems/is-graph-bipartite/)|[Is Graph Bipartite?](./Algorithms/0785.is-graph-bipartite)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0784](https://leetcode.com/problems/letter-case-permutation/)|[Letter Case Permutation](./Algorithms/0784.letter-case-permutation)|59%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0783](https://leetcode.com/problems/minimum-distance-between-bst-nodes/)|[Minimum Distance Between BST Nodes](./Algorithms/0783.minimum-distance-between-bst-nodes)|51%|Easy|| +|[0782](https://leetcode.com/problems/transform-to-chessboard/)|[Transform to Chessboard](./Algorithms/0782.transform-to-chessboard)|39%|Hard|| +|[0781](https://leetcode.com/problems/rabbits-in-forest/)|[Rabbits in Forest](./Algorithms/0781.rabbits-in-forest)|52%|Medium|| +|[0780](https://leetcode.com/problems/reaching-points/)|[Reaching Points](./Algorithms/0780.reaching-points)|28%|Hard|| +|[0779](https://leetcode.com/problems/k-th-symbol-in-grammar/)|[K-th Symbol in Grammar](./Algorithms/0779.k-th-symbol-in-grammar)|37%|Medium|| +|[0778](https://leetcode.com/problems/swim-in-rising-water/)|[Swim in Rising Water](./Algorithms/0778.swim-in-rising-water)|49%|Hard|| +|[0777](https://leetcode.com/problems/swap-adjacent-in-lr-string/)|[Swap Adjacent in LR String](./Algorithms/0777.swap-adjacent-in-lr-string)|34%|Medium|| +|[0775](https://leetcode.com/problems/global-and-local-inversions/)|[Global and Local Inversions](./Algorithms/0775.global-and-local-inversions)|40%|Medium|| +|[0773](https://leetcode.com/problems/sliding-puzzle/)|[Sliding Puzzle](./Algorithms/0773.sliding-puzzle)|55%|Hard|| +|[0771](https://leetcode.com/problems/jewels-and-stones/)|[Jewels and Stones](./Algorithms/0771.jewels-and-stones)|83%|Easy|| +|[0770](https://leetcode.com/problems/basic-calculator-iv/)|[Basic Calculator IV](./Algorithms/0770.basic-calculator-iv)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0769](https://leetcode.com/problems/max-chunks-to-make-sorted/)|[Max Chunks To Make Sorted](./Algorithms/0769.max-chunks-to-make-sorted)|52%|Medium|| +|[0768](https://leetcode.com/problems/max-chunks-to-make-sorted-ii/)|[Max Chunks To Make Sorted II](./Algorithms/0768.max-chunks-to-make-sorted-ii)|46%|Hard|| +|[0767](https://leetcode.com/problems/reorganize-string/)|[Reorganize String](./Algorithms/0767.reorganize-string)|44%|Medium|| +|[0766](https://leetcode.com/problems/toeplitz-matrix/)|[Toeplitz Matrix](./Algorithms/0766.toeplitz-matrix)|62%|Easy|| +|[0765](https://leetcode.com/problems/couples-holding-hands/)|[Couples Holding Hands](./Algorithms/0765.couples-holding-hands)|52%|Hard|| +|[0764](https://leetcode.com/problems/largest-plus-sign/)|[Largest Plus Sign](./Algorithms/0764.largest-plus-sign)|44%|Medium|| +|[0763](https://leetcode.com/problems/partition-labels/)|[Partition Labels](./Algorithms/0763.partition-labels)|72%|Medium|| +|[0762](https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/)|[Prime Number of Set Bits in Binary Representation](./Algorithms/0762.prime-number-of-set-bits-in-binary-representation)|60%|Easy|| +|[0761](https://leetcode.com/problems/special-binary-string/)|[Special Binary String](./Algorithms/0761.special-binary-string)|53%|Hard|| +|[0757](https://leetcode.com/problems/set-intersection-size-at-least-two/)|[Set Intersection Size At Least Two](./Algorithms/0757.set-intersection-size-at-least-two)|37%|Hard|| +|[0756](https://leetcode.com/problems/pyramid-transition-matrix/)|[Pyramid Transition Matrix](./Algorithms/0756.pyramid-transition-matrix)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0754](https://leetcode.com/problems/reach-a-number/)|[Reach a Number](./Algorithms/0754.reach-a-number)|33%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0753](https://leetcode.com/problems/cracking-the-safe/)|[Cracking the Safe](./Algorithms/0753.cracking-the-safe)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0752](https://leetcode.com/problems/open-the-lock/)|[Open the Lock](./Algorithms/0752.open-the-lock)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0749](https://leetcode.com/problems/contain-virus/)|[Contain Virus](./Algorithms/0749.contain-virus)|42%|Hard|| +|[0748](https://leetcode.com/problems/shortest-completing-word/)|[Shortest Completing Word](./Algorithms/0748.shortest-completing-word)|55%|Easy|| +|[0747](https://leetcode.com/problems/largest-number-at-least-twice-of-others/)|[Largest Number At Least Twice of Others](./Algorithms/0747.largest-number-at-least-twice-of-others)|40%|Easy|| +|[0746](https://leetcode.com/problems/min-cost-climbing-stairs/)|[Min Cost Climbing Stairs](./Algorithms/0746.min-cost-climbing-stairs)|48%|Easy|| +|[0745](https://leetcode.com/problems/prefix-and-suffix-search/)|[Prefix and Suffix Search](./Algorithms/0745.prefix-and-suffix-search)|32%|Hard|| +|[0744](https://leetcode.com/problems/find-smallest-letter-greater-than-target/)|[Find Smallest Letter Greater Than Target](./Algorithms/0744.find-smallest-letter-greater-than-target)|44%|Easy|| +|[0743](https://leetcode.com/problems/network-delay-time/)|[Network Delay Time](./Algorithms/0743.network-delay-time)|44%|Medium|| +|[0741](https://leetcode.com/problems/cherry-pickup/)|[Cherry Pickup](./Algorithms/0741.cherry-pickup)|31%|Hard|| +|[0740](https://leetcode.com/problems/delete-and-earn/)|[Delete and Earn](./Algorithms/0740.delete-and-earn)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0739](https://leetcode.com/problems/daily-temperatures/)|[Daily Temperatures](./Algorithms/0739.daily-temperatures)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0738](https://leetcode.com/problems/monotone-increasing-digits/)|[Monotone Increasing Digits](./Algorithms/0738.monotone-increasing-digits)|42%|Medium|| +|[0736](https://leetcode.com/problems/parse-lisp-expression/)|[Parse Lisp Expression](./Algorithms/0736.parse-lisp-expression)|45%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0735](https://leetcode.com/problems/asteroid-collision/)|[Asteroid Collision](./Algorithms/0735.asteroid-collision)|39%|Medium|| +|[0733](https://leetcode.com/problems/flood-fill/)|[Flood Fill](./Algorithms/0733.flood-fill)|52%|Easy|| +|[0732](https://leetcode.com/problems/my-calendar-iii/)|[My Calendar III](./Algorithms/0732.my-calendar-iii)|57%|Hard|| +|[0731](https://leetcode.com/problems/my-calendar-ii/)|[My Calendar II](./Algorithms/0731.my-calendar-ii)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0730](https://leetcode.com/problems/count-different-palindromic-subsequences/)|[Count Different Palindromic Subsequences](./Algorithms/0730.count-different-palindromic-subsequences)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0729](https://leetcode.com/problems/my-calendar-i/)|[My Calendar I](./Algorithms/0729.my-calendar-i)|49%|Medium|| +|[0728](https://leetcode.com/problems/self-dividing-numbers/)|[Self Dividing Numbers](./Algorithms/0728.self-dividing-numbers)|71%|Easy|| +|[0726](https://leetcode.com/problems/number-of-atoms/)|[Number of Atoms](./Algorithms/0726.number-of-atoms)|46%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0725](https://leetcode.com/problems/split-linked-list-in-parts/)|[Split Linked List in Parts](./Algorithms/0725.split-linked-list-in-parts)|50%|Medium|| +|[0724](https://leetcode.com/problems/find-pivot-index/)|[Find Pivot Index](./Algorithms/0724.find-pivot-index)|42%|Easy|| +|[0722](https://leetcode.com/problems/remove-comments/)|[Remove Comments](./Algorithms/0722.remove-comments)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0721](https://leetcode.com/problems/accounts-merge/)|[Accounts Merge](./Algorithms/0721.accounts-merge)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0720](https://leetcode.com/problems/longest-word-in-dictionary/)|[Longest Word in Dictionary](./Algorithms/0720.longest-word-in-dictionary)|46%|Easy|| +|[0719](https://leetcode.com/problems/find-k-th-smallest-pair-distance/)|[Find K-th Smallest Pair Distance](./Algorithms/0719.find-k-th-smallest-pair-distance)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0718](https://leetcode.com/problems/maximum-length-of-repeated-subarray/)|[Maximum Length of Repeated Subarray](./Algorithms/0718.maximum-length-of-repeated-subarray)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0717](https://leetcode.com/problems/1-bit-and-2-bit-characters/)|[1-bit and 2-bit Characters](./Algorithms/0717.1-bit-and-2-bit-characters)|49%|Easy|| +|[0715](https://leetcode.com/problems/range-module/)|[Range Module](./Algorithms/0715.range-module)|36%|Hard|| +|[0714](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/)|[Best Time to Buy and Sell Stock with Transaction Fee](./Algorithms/0714.best-time-to-buy-and-sell-stock-with-transaction-fee)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0713](https://leetcode.com/problems/subarray-product-less-than-k/)|[Subarray Product Less Than K](./Algorithms/0713.subarray-product-less-than-k)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0712](https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/)|[Minimum ASCII Delete Sum for Two Strings](./Algorithms/0712.minimum-ascii-delete-sum-for-two-strings)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0710](https://leetcode.com/problems/random-pick-with-blacklist/)|[Random Pick with Blacklist](./Algorithms/0710.random-pick-with-blacklist)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0709](https://leetcode.com/problems/to-lower-case/)|[To Lower Case](./Algorithms/0709.to-lower-case)|77%|Easy|| +|[0707](https://leetcode.com/problems/design-linked-list/)|[Design Linked List](./Algorithms/0707.design-linked-list)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0706](https://leetcode.com/problems/design-hashmap/)|[Design HashMap](./Algorithms/0706.design-hashmap)|57%|Easy|| +|[0705](https://leetcode.com/problems/design-hashset/)|[Design HashSet](./Algorithms/0705.design-hashset)|56%|Easy|| +|[0704](https://leetcode.com/problems/binary-search/)|[Binary Search](./Algorithms/0704.binary-search)|49%|Easy|| +|[0703](https://leetcode.com/problems/kth-largest-element-in-a-stream/)|[Kth Largest Element in a Stream](./Algorithms/0703.kth-largest-element-in-a-stream)|47%|Easy|| +|[0701](https://leetcode.com/problems/insert-into-a-binary-search-tree/)|[Insert into a Binary Search Tree](./Algorithms/0701.insert-into-a-binary-search-tree)|77%|Medium|| +|[0700](https://leetcode.com/problems/search-in-a-binary-search-tree/)|[Search in a Binary Search Tree](./Algorithms/0700.search-in-a-binary-search-tree)|69%|Easy|| +|[0699](https://leetcode.com/problems/falling-squares/)|[Falling Squares](./Algorithms/0699.falling-squares)|40%|Hard|| +|[0698](https://leetcode.com/problems/partition-to-k-equal-sum-subsets/)|[Partition to K Equal Sum Subsets](./Algorithms/0698.partition-to-k-equal-sum-subsets)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0697](https://leetcode.com/problems/degree-of-an-array/)|[Degree of an Array](./Algorithms/0697.degree-of-an-array)|51%|Easy|| +|[0696](https://leetcode.com/problems/count-binary-substrings/)|[Count Binary Substrings](./Algorithms/0696.count-binary-substrings)|54%|Easy|| +|[0695](https://leetcode.com/problems/max-area-of-island/)|[Max Area of Island](./Algorithms/0695.max-area-of-island)|59%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0693](https://leetcode.com/problems/binary-number-with-alternating-bits/)|[Binary Number with Alternating Bits](./Algorithms/0693.binary-number-with-alternating-bits)|58%|Easy|| +|[0692](https://leetcode.com/problems/top-k-frequent-words/)|[Top K Frequent Words](./Algorithms/0692.top-k-frequent-words)|47%|Medium|| +|[0691](https://leetcode.com/problems/stickers-to-spell-word/)|[Stickers to Spell Word](./Algorithms/0691.stickers-to-spell-word)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0689](https://leetcode.com/problems/maximum-sum-of-3-non-overlapping-subarrays/)|[Maximum Sum of 3 Non-Overlapping Subarrays](./Algorithms/0689.maximum-sum-of-3-non-overlapping-subarrays)|44%|Hard|| +|[0688](https://leetcode.com/problems/knight-probability-in-chessboard/)|[Knight Probability in Chessboard](./Algorithms/0688.knight-probability-in-chessboard)|46%|Medium|| +|[0687](https://leetcode.com/problems/longest-univalue-path/)|[Longest Univalue Path](./Algorithms/0687.longest-univalue-path)|34%|Easy|| +|[0686](https://leetcode.com/problems/repeated-string-match/)|[Repeated String Match](./Algorithms/0686.repeated-string-match)|31%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0685](https://leetcode.com/problems/redundant-connection-ii/)|[Redundant Connection II](./Algorithms/0685.redundant-connection-ii)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0684](https://leetcode.com/problems/redundant-connection/)|[Redundant Connection](./Algorithms/0684.redundant-connection)|54%|Medium|| +|[0682](https://leetcode.com/problems/baseball-game/)|[Baseball Game](./Algorithms/0682.baseball-game)|61%|Easy|| +|[0680](https://leetcode.com/problems/valid-palindrome-ii/)|[Valid Palindrome II](./Algorithms/0680.valid-palindrome-ii)|35%|Easy|| +|[0679](https://leetcode.com/problems/24-game/)|[24 Game](./Algorithms/0679.24-game)|44%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0678](https://leetcode.com/problems/valid-parenthesis-string/)|[Valid Parenthesis String](./Algorithms/0678.valid-parenthesis-string)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0677](https://leetcode.com/problems/map-sum-pairs/)|[Map Sum Pairs](./Algorithms/0677.map-sum-pairs)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0676](https://leetcode.com/problems/implement-magic-dictionary/)|[Implement Magic Dictionary](./Algorithms/0676.implement-magic-dictionary)|52%|Medium|| +|[0675](https://leetcode.com/problems/cut-off-trees-for-golf-event/)|[Cut Off Trees for Golf Event](./Algorithms/0675.cut-off-trees-for-golf-event)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0674](https://leetcode.com/problems/longest-continuous-increasing-subsequence/)|[Longest Continuous Increasing Subsequence](./Algorithms/0674.longest-continuous-increasing-subsequence)|44%|Easy|| +|[0673](https://leetcode.com/problems/number-of-longest-increasing-subsequence/)|[Number of Longest Increasing Subsequence](./Algorithms/0673.number-of-longest-increasing-subsequence)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0672](https://leetcode.com/problems/bulb-switcher-ii/)|[Bulb Switcher II](./Algorithms/0672.bulb-switcher-ii)|50%|Medium|| +|[0671](https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/)|[Second Minimum Node In a Binary Tree](./Algorithms/0671.second-minimum-node-in-a-binary-tree)|43%|Easy|| +|[0670](https://leetcode.com/problems/maximum-swap/)|[Maximum Swap](./Algorithms/0670.maximum-swap)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0669](https://leetcode.com/problems/trim-a-binary-search-tree/)|[Trim a Binary Search Tree](./Algorithms/0669.trim-a-binary-search-tree)|61%|Easy|| +|[0668](https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/)|[Kth Smallest Number in Multiplication Table](./Algorithms/0668.kth-smallest-number-in-multiplication-table)|43%|Hard|| +|[0667](https://leetcode.com/problems/beautiful-arrangement-ii/)|[Beautiful Arrangement II](./Algorithms/0667.beautiful-arrangement-ii)|52%|Medium|| +|[0665](https://leetcode.com/problems/non-decreasing-array/)|[Non-decreasing Array](./Algorithms/0665.non-decreasing-array)|19%|Easy|| +|[0664](https://leetcode.com/problems/strange-printer/)|[Strange Printer](./Algorithms/0664.strange-printer)|38%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0662](https://leetcode.com/problems/maximum-width-of-binary-tree/)|[Maximum Width of Binary Tree](./Algorithms/0662.maximum-width-of-binary-tree)|39%|Medium|| +|[0661](https://leetcode.com/problems/image-smoother/)|[Image Smoother](./Algorithms/0661.image-smoother)|49%|Easy|| +|[0659](https://leetcode.com/problems/split-array-into-consecutive-subsequences/)|[Split Array into Consecutive Subsequences](./Algorithms/0659.split-array-into-consecutive-subsequences)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0658](https://leetcode.com/problems/find-k-closest-elements/)|[Find K Closest Elements](./Algorithms/0658.find-k-closest-elements)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0657](https://leetcode.com/problems/robot-return-to-origin/)|[Robot Return to Origin](./Algorithms/0657.robot-return-to-origin)|72%|Easy|| +|[0655](https://leetcode.com/problems/print-binary-tree/)|[Print Binary Tree](./Algorithms/0655.print-binary-tree)|52%|Medium|| +|[0654](https://leetcode.com/problems/maximum-binary-tree/)|[Maximum Binary Tree](./Algorithms/0654.maximum-binary-tree)|77%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0653](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/)|[Two Sum IV - Input is a BST](./Algorithms/0653.two-sum-iv-input-is-a-bst)|53%|Easy|| +|[0652](https://leetcode.com/problems/find-duplicate-subtrees/)|[Find Duplicate Subtrees](./Algorithms/0652.find-duplicate-subtrees)|47%|Medium|| +|[0650](https://leetcode.com/problems/2-keys-keyboard/)|[2 Keys Keyboard](./Algorithms/0650.2-keys-keyboard)|47%|Medium|| +|[0649](https://leetcode.com/problems/dota2-senate/)|[Dota2 Senate](./Algorithms/0649.dota2-senate)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0648](https://leetcode.com/problems/replace-words/)|[Replace Words](./Algorithms/0648.replace-words)|53%|Medium|| +|[0647](https://leetcode.com/problems/palindromic-substrings/)|[Palindromic Substrings](./Algorithms/0647.palindromic-substrings)|58%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0646](https://leetcode.com/problems/maximum-length-of-pair-chain/)|[Maximum Length of Pair Chain](./Algorithms/0646.maximum-length-of-pair-chain)|49%|Medium|| +|[0645](https://leetcode.com/problems/set-mismatch/)|[Set Mismatch](./Algorithms/0645.set-mismatch)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0643](https://leetcode.com/problems/maximum-average-subarray-i/)|[Maximum Average Subarray I](./Algorithms/0643.maximum-average-subarray-i)|40%|Easy|| +|[0641](https://leetcode.com/problems/design-circular-deque/)|[Design Circular Deque](./Algorithms/0641.design-circular-deque)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0640](https://leetcode.com/problems/solve-the-equation/)|[Solve the Equation](./Algorithms/0640.solve-the-equation)|40%|Medium|| +|[0639](https://leetcode.com/problems/decode-ways-ii/)|[Decode Ways II](./Algorithms/0639.decode-ways-ii)|25%|Hard|| +|[0638](https://leetcode.com/problems/shopping-offers/)|[Shopping Offers](./Algorithms/0638.shopping-offers)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0637](https://leetcode.com/problems/average-of-levels-in-binary-tree/)|[Average of Levels in Binary Tree](./Algorithms/0637.average-of-levels-in-binary-tree)|60%|Easy|| +|[0636](https://leetcode.com/problems/exclusive-time-of-functions/)|[Exclusive Time of Functions](./Algorithms/0636.exclusive-time-of-functions)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0633](https://leetcode.com/problems/sum-of-square-numbers/)|[Sum of Square Numbers](./Algorithms/0633.sum-of-square-numbers)|32%|Easy|| +|[0632](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/)|[Smallest Range Covering Elements from K Lists](./Algorithms/0632.smallest-range-covering-elements-from-k-lists)|49%|Hard|| +|[0630](https://leetcode.com/problems/course-schedule-iii/)|[Course Schedule III](./Algorithms/0630.course-schedule-iii)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0629](https://leetcode.com/problems/k-inverse-pairs-array/)|[K Inverse Pairs Array](./Algorithms/0629.k-inverse-pairs-array)|29%|Hard|| +|[0628](https://leetcode.com/problems/maximum-product-of-three-numbers/)|[Maximum Product of Three Numbers](./Algorithms/0628.maximum-product-of-three-numbers)|46%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0623](https://leetcode.com/problems/add-one-row-to-tree/)|[Add One Row to Tree](./Algorithms/0623.add-one-row-to-tree)|47%|Medium|| +|[0622](https://leetcode.com/problems/design-circular-queue/)|[Design Circular Queue](./Algorithms/0622.design-circular-queue)|41%|Medium|| +|[0621](https://leetcode.com/problems/task-scheduler/)|[Task Scheduler](./Algorithms/0621.task-scheduler)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0617](https://leetcode.com/problems/merge-two-binary-trees/)|[Merge Two Binary Trees](./Algorithms/0617.merge-two-binary-trees)|71%|Easy|| +|[0611](https://leetcode.com/problems/valid-triangle-number/)|[Valid Triangle Number](./Algorithms/0611.valid-triangle-number)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0609](https://leetcode.com/problems/find-duplicate-file-in-system/)|[Find Duplicate File in System](./Algorithms/0609.find-duplicate-file-in-system)|56%|Medium|| +|[0606](https://leetcode.com/problems/construct-string-from-binary-tree/)|[Construct String from Binary Tree](./Algorithms/0606.construct-string-from-binary-tree)|52%|Easy|| +|[0605](https://leetcode.com/problems/can-place-flowers/)|[Can Place Flowers](./Algorithms/0605.can-place-flowers)|31%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0600](https://leetcode.com/problems/non-negative-integers-without-consecutive-ones/)|[Non-negative Integers without Consecutive Ones](./Algorithms/0600.non-negative-integers-without-consecutive-ones)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0599](https://leetcode.com/problems/minimum-index-sum-of-two-lists/)|[Minimum Index Sum of Two Lists](./Algorithms/0599.minimum-index-sum-of-two-lists)|48%|Easy|| +|[0598](https://leetcode.com/problems/range-addition-ii/)|[Range Addition II](./Algorithms/0598.range-addition-ii)|49%|Easy|| +|[0594](https://leetcode.com/problems/longest-harmonious-subsequence/)|[Longest Harmonious Subsequence](./Algorithms/0594.longest-harmonious-subsequence)|44%|Easy|| +|[0593](https://leetcode.com/problems/valid-square/)|[Valid Square](./Algorithms/0593.valid-square)|41%|Medium|| +|[0592](https://leetcode.com/problems/fraction-addition-and-subtraction/)|[Fraction Addition and Subtraction](./Algorithms/0592.fraction-addition-and-subtraction)|47%|Medium|| +|[0591](https://leetcode.com/problems/tag-validator/)|[Tag Validator](./Algorithms/0591.tag-validator)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0587](https://leetcode.com/problems/erect-the-fence/)|[Erect the Fence](./Algorithms/0587.erect-the-fence)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0583](https://leetcode.com/problems/delete-operation-for-two-strings/)|[Delete Operation for Two Strings](./Algorithms/0583.delete-operation-for-two-strings)|46%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0581](https://leetcode.com/problems/shortest-unsorted-continuous-subarray/)|[Shortest Unsorted Continuous Subarray](./Algorithms/0581.shortest-unsorted-continuous-subarray)|30%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0576](https://leetcode.com/problems/out-of-boundary-paths/)|[Out of Boundary Paths](./Algorithms/0576.out-of-boundary-paths)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0575](https://leetcode.com/problems/distribute-candies/)|[Distribute Candies](./Algorithms/0575.distribute-candies)|60%|Easy|| +|[0572](https://leetcode.com/problems/subtree-of-another-tree/)|[Subtree of Another Tree](./Algorithms/0572.subtree-of-another-tree)|42%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0567](https://leetcode.com/problems/permutation-in-string/)|[Permutation in String](./Algorithms/0567.permutation-in-string)|39%|Medium|| +|[0566](https://leetcode.com/problems/reshape-the-matrix/)|[Reshape the Matrix](./Algorithms/0566.reshape-the-matrix)|59%|Easy|| +|[0565](https://leetcode.com/problems/array-nesting/)|[Array Nesting](./Algorithms/0565.array-nesting)|53%|Medium|| +|[0564](https://leetcode.com/problems/find-the-closest-palindrome/)|[Find the Closest Palindrome](./Algorithms/0564.find-the-closest-palindrome)|19%|Hard|| +|[0563](https://leetcode.com/problems/binary-tree-tilt/)|[Binary Tree Tilt](./Algorithms/0563.binary-tree-tilt)|47%|Easy|| +|[0561](https://leetcode.com/problems/array-partition-i/)|[Array Partition I](./Algorithms/0561.array-partition-i)|70%|Easy|| +|[0560](https://leetcode.com/problems/subarray-sum-equals-k/)|[Subarray Sum Equals K](./Algorithms/0560.subarray-sum-equals-k)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0557](https://leetcode.com/problems/reverse-words-in-a-string-iii/)|[Reverse Words in a String III](./Algorithms/0557.reverse-words-in-a-string-iii)|66%|Easy|| +|[0556](https://leetcode.com/problems/next-greater-element-iii/)|[Next Greater Element III](./Algorithms/0556.next-greater-element-iii)|30%|Medium|| +|[0554](https://leetcode.com/problems/brick-wall/)|[Brick Wall](./Algorithms/0554.brick-wall)|48%|Medium|| +|[0553](https://leetcode.com/problems/optimal-division/)|[Optimal Division](./Algorithms/0553.optimal-division)|55%|Medium|| +|[0552](https://leetcode.com/problems/student-attendance-record-ii/)|[Student Attendance Record II](./Algorithms/0552.student-attendance-record-ii)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0551](https://leetcode.com/problems/student-attendance-record-i/)|[Student Attendance Record I](./Algorithms/0551.student-attendance-record-i)|46%|Easy|| +|[0547](https://leetcode.com/problems/friend-circles/)|[Friend Circles](./Algorithms/0547.friend-circles)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0546](https://leetcode.com/problems/remove-boxes/)|[Remove Boxes](./Algorithms/0546.remove-boxes)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0543](https://leetcode.com/problems/diameter-of-binary-tree/)|[Diameter of Binary Tree](./Algorithms/0543.diameter-of-binary-tree)|47%|Easy|| +|[0542](https://leetcode.com/problems/01-matrix/)|[01 Matrix](./Algorithms/0542.01-matrix)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0541](https://leetcode.com/problems/reverse-string-ii/)|[Reverse String II](./Algorithms/0541.reverse-string-ii)|46%|Easy|| +|[0540](https://leetcode.com/problems/single-element-in-a-sorted-array/)|[Single Element in a Sorted Array](./Algorithms/0540.single-element-in-a-sorted-array)|57%|Medium|| +|[0539](https://leetcode.com/problems/minimum-time-difference/)|[Minimum Time Difference](./Algorithms/0539.minimum-time-difference)|49%|Medium|| +|[0538](https://leetcode.com/problems/convert-bst-to-greater-tree/)|[Convert BST to Greater Tree](./Algorithms/0538.convert-bst-to-greater-tree)|52%|Easy|| +|[0537](https://leetcode.com/problems/complex-number-multiplication/)|[Complex Number Multiplication](./Algorithms/0537.complex-number-multiplication)|66%|Medium|| +|[0532](https://leetcode.com/problems/k-diff-pairs-in-an-array/)|[K-diff Pairs in an Array](./Algorithms/0532.k-diff-pairs-in-an-array)|30%|Easy|| +|[0530](https://leetcode.com/problems/minimum-absolute-difference-in-bst/)|[Minimum Absolute Difference in BST](./Algorithms/0530.minimum-absolute-difference-in-bst)|51%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0529](https://leetcode.com/problems/minesweeper/)|[Minesweeper](./Algorithms/0529.minesweeper)|55%|Medium|| +|[0528](https://leetcode.com/problems/random-pick-with-weight/)|[Random Pick with Weight](./Algorithms/0528.random-pick-with-weight)|43%|Medium|| +|[0526](https://leetcode.com/problems/beautiful-arrangement/)|[Beautiful Arrangement](./Algorithms/0526.beautiful-arrangement)|55%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0525](https://leetcode.com/problems/contiguous-array/)|[Contiguous Array](./Algorithms/0525.contiguous-array)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0524](https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/)|[Longest Word in Dictionary through Deleting](./Algorithms/0524.longest-word-in-dictionary-through-deleting)|46%|Medium|| +|[0523](https://leetcode.com/problems/continuous-subarray-sum/)|[Continuous Subarray Sum](./Algorithms/0523.continuous-subarray-sum)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0522](https://leetcode.com/problems/longest-uncommon-subsequence-ii/)|[Longest Uncommon Subsequence II](./Algorithms/0522.longest-uncommon-subsequence-ii)|33%|Medium|| +|[0521](https://leetcode.com/problems/longest-uncommon-subsequence-i/)|[Longest Uncommon Subsequence I](./Algorithms/0521.longest-uncommon-subsequence-i)|56%|Easy|| +|[0520](https://leetcode.com/problems/detect-capital/)|[Detect Capital](./Algorithms/0520.detect-capital)|52%|Easy|| +|[0519](https://leetcode.com/problems/random-flip-matrix/)|[Random Flip Matrix](./Algorithms/0519.random-flip-matrix)|34%|Medium|| +|[0518](https://leetcode.com/problems/coin-change-2/)|[Coin Change 2](./Algorithms/0518.coin-change-2)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0517](https://leetcode.com/problems/super-washing-machines/)|[Super Washing Machines](./Algorithms/0517.super-washing-machines)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0516](https://leetcode.com/problems/longest-palindromic-subsequence/)|[Longest Palindromic Subsequence](./Algorithms/0516.longest-palindromic-subsequence)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0515](https://leetcode.com/problems/find-largest-value-in-each-tree-row/)|[Find Largest Value in Each Tree Row](./Algorithms/0515.find-largest-value-in-each-tree-row)|58%|Medium|| +|[0514](https://leetcode.com/problems/freedom-trail/)|[Freedom Trail](./Algorithms/0514.freedom-trail)|41%|Hard|| +|[0513](https://leetcode.com/problems/find-bottom-left-tree-value/)|[Find Bottom Left Tree Value](./Algorithms/0513.find-bottom-left-tree-value)|59%|Medium|| +|[0509](https://leetcode.com/problems/fibonacci-number/)|[Fibonacci Number](./Algorithms/0509.fibonacci-number)|66%|Easy|| +|[0508](https://leetcode.com/problems/most-frequent-subtree-sum/)|[Most Frequent Subtree Sum](./Algorithms/0508.most-frequent-subtree-sum)|55%|Medium|| +|[0507](https://leetcode.com/problems/perfect-number/)|[Perfect Number](./Algorithms/0507.perfect-number)|35%|Easy|| +|[0506](https://leetcode.com/problems/relative-ranks/)|[Relative Ranks](./Algorithms/0506.relative-ranks)|49%|Easy|| +|[0504](https://leetcode.com/problems/base-7/)|[Base 7](./Algorithms/0504.base-7)|45%|Easy|| +|[0503](https://leetcode.com/problems/next-greater-element-ii/)|[Next Greater Element II](./Algorithms/0503.next-greater-element-ii)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0502](https://leetcode.com/problems/ipo/)|[IPO](./Algorithms/0502.ipo)|38%|Hard|| +|[0501](https://leetcode.com/problems/find-mode-in-binary-search-tree/)|[Find Mode in Binary Search Tree](./Algorithms/0501.find-mode-in-binary-search-tree)|40%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0500](https://leetcode.com/problems/keyboard-row/)|[Keyboard Row](./Algorithms/0500.keyboard-row)|63%|Easy|| +|[0498](https://leetcode.com/problems/diagonal-traverse/)|[Diagonal Traverse](./Algorithms/0498.diagonal-traverse)|46%|Medium|| +|[0497](https://leetcode.com/problems/random-point-in-non-overlapping-rectangles/)|[Random Point in Non-overlapping Rectangles](./Algorithms/0497.random-point-in-non-overlapping-rectangles)|36%|Medium|| +|[0496](https://leetcode.com/problems/next-greater-element-i/)|[Next Greater Element I](./Algorithms/0496.next-greater-element-i)|61%|Easy|| +|[0495](https://leetcode.com/problems/teemo-attacking/)|[Teemo Attacking](./Algorithms/0495.teemo-attacking)|52%|Medium|| +|[0494](https://leetcode.com/problems/target-sum/)|[Target Sum](./Algorithms/0494.target-sum)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0493](https://leetcode.com/problems/reverse-pairs/)|[Reverse Pairs](./Algorithms/0493.reverse-pairs)|23%|Hard|| +|[0492](https://leetcode.com/problems/construct-the-rectangle/)|[Construct the Rectangle](./Algorithms/0492.construct-the-rectangle)|48%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0491](https://leetcode.com/problems/increasing-subsequences/)|[Increasing Subsequences](./Algorithms/0491.increasing-subsequences)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0488](https://leetcode.com/problems/zuma-game/)|[Zuma Game](./Algorithms/0488.zuma-game)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0486](https://leetcode.com/problems/predict-the-winner/)|[Predict the Winner](./Algorithms/0486.predict-the-winner)|47%|Medium|| +|[0485](https://leetcode.com/problems/max-consecutive-ones/)|[Max Consecutive Ones](./Algorithms/0485.max-consecutive-ones)|55%|Easy|| +|[0483](https://leetcode.com/problems/smallest-good-base/)|[Smallest Good Base](./Algorithms/0483.smallest-good-base)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0482](https://leetcode.com/problems/license-key-formatting/)|[License Key Formatting](./Algorithms/0482.license-key-formatting)|41%|Easy|| +|[0481](https://leetcode.com/problems/magical-string/)|[Magical String](./Algorithms/0481.magical-string)|46%|Medium|| +|[0480](https://leetcode.com/problems/sliding-window-median/)|[Sliding Window Median](./Algorithms/0480.sliding-window-median)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0479](https://leetcode.com/problems/largest-palindrome-product/)|[Largest Palindrome Product](./Algorithms/0479.largest-palindrome-product)|27%|Hard|| +|[0478](https://leetcode.com/problems/generate-random-point-in-a-circle/)|[Generate Random Point in a Circle](./Algorithms/0478.generate-random-point-in-a-circle)|37%|Medium|| +|[0477](https://leetcode.com/problems/total-hamming-distance/)|[Total Hamming Distance](./Algorithms/0477.total-hamming-distance)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0476](https://leetcode.com/problems/number-complement/)|[Number Complement](./Algorithms/0476.number-complement)|62%|Easy|| +|[0475](https://leetcode.com/problems/heaters/)|[Heaters](./Algorithms/0475.heaters)|32%|Easy|| +|[0474](https://leetcode.com/problems/ones-and-zeroes/)|[Ones and Zeroes](./Algorithms/0474.ones-and-zeroes)|40%|Medium|| +|[0473](https://leetcode.com/problems/matchsticks-to-square/)|[Matchsticks to Square](./Algorithms/0473.matchsticks-to-square)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0472](https://leetcode.com/problems/concatenated-words/)|[Concatenated Words](./Algorithms/0472.concatenated-words)|37%|Hard|| +|[0470](https://leetcode.com/problems/implement-rand10-using-rand7/)|[Implement Rand10() Using Rand7()](./Algorithms/0470.implement-rand10-using-rand7)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0468](https://leetcode.com/problems/validate-ip-address/)|[Validate IP Address](./Algorithms/0468.validate-ip-address)|21%|Medium|| +|[0467](https://leetcode.com/problems/unique-substrings-in-wraparound-string/)|[Unique Substrings in Wraparound String](./Algorithms/0467.unique-substrings-in-wraparound-string)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0466](https://leetcode.com/problems/count-the-repetitions/)|[Count The Repetitions](./Algorithms/0466.count-the-repetitions)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0464](https://leetcode.com/problems/can-i-win/)|[Can I Win](./Algorithms/0464.can-i-win)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0463](https://leetcode.com/problems/island-perimeter/)|[Island Perimeter](./Algorithms/0463.island-perimeter)|62%|Easy|| +|[0462](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/)|[Minimum Moves to Equal Array Elements II](./Algorithms/0462.minimum-moves-to-equal-array-elements-ii)|52%|Medium|| +|[0461](https://leetcode.com/problems/hamming-distance/)|[Hamming Distance](./Algorithms/0461.hamming-distance)|70%|Easy|| +|[0460](https://leetcode.com/problems/lfu-cache/)|[LFU Cache](./Algorithms/0460.lfu-cache)|30%|Hard|| +|[0459](https://leetcode.com/problems/repeated-substring-pattern/)|[Repeated Substring Pattern](./Algorithms/0459.repeated-substring-pattern)|40%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0458](https://leetcode.com/problems/poor-pigs/)|[Poor Pigs](./Algorithms/0458.poor-pigs)|46%|Hard|| +|[0457](https://leetcode.com/problems/circular-array-loop/)|[Circular Array Loop](./Algorithms/0457.circular-array-loop)|28%|Medium|| +|[0456](https://leetcode.com/problems/132-pattern/)|[132 Pattern](./Algorithms/0456.132-pattern)|27%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0455](https://leetcode.com/problems/assign-cookies/)|[Assign Cookies](./Algorithms/0455.assign-cookies)|48%|Easy|| +|[0454](https://leetcode.com/problems/4sum-ii/)|[4Sum II](./Algorithms/0454.4sum-ii)|51%|Medium|| +|[0453](https://leetcode.com/problems/minimum-moves-to-equal-array-elements/)|[Minimum Moves to Equal Array Elements](./Algorithms/0453.minimum-moves-to-equal-array-elements)|49%|Easy|| +|[0452](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/)|[Minimum Number of Arrows to Burst Balloons](./Algorithms/0452.minimum-number-of-arrows-to-burst-balloons)|47%|Medium|| +|[0451](https://leetcode.com/problems/sort-characters-by-frequency/)|[Sort Characters By Frequency](./Algorithms/0451.sort-characters-by-frequency)|57%|Medium|| +|[0450](https://leetcode.com/problems/delete-node-in-a-bst/)|[Delete Node in a BST](./Algorithms/0450.delete-node-in-a-bst)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0448](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/)|[Find All Numbers Disappeared in an Array](./Algorithms/0448.find-all-numbers-disappeared-in-an-array)|54%|Easy|| +|[0447](https://leetcode.com/problems/number-of-boomerangs/)|[Number of Boomerangs](./Algorithms/0447.number-of-boomerangs)|50%|Easy|| +|[0446](https://leetcode.com/problems/arithmetic-slices-ii-subsequence/)|[Arithmetic Slices II - Subsequence](./Algorithms/0446.arithmetic-slices-ii-subsequence)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0445](https://leetcode.com/problems/add-two-numbers-ii/)|[Add Two Numbers II](./Algorithms/0445.add-two-numbers-ii)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0443](https://leetcode.com/problems/string-compression/)|[String Compression](./Algorithms/0443.string-compression)|38%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0442](https://leetcode.com/problems/find-all-duplicates-in-an-array/)|[Find All Duplicates in an Array](./Algorithms/0442.find-all-duplicates-in-an-array)|62%|Medium|| +|[0441](https://leetcode.com/problems/arranging-coins/)|[Arranging Coins](./Algorithms/0441.arranging-coins)|38%|Easy|| +|[0440](https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/)|[K-th Smallest in Lexicographical Order](./Algorithms/0440.k-th-smallest-in-lexicographical-order)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0438](https://leetcode.com/problems/find-all-anagrams-in-a-string/)|[Find All Anagrams in a String](./Algorithms/0438.find-all-anagrams-in-a-string)|39%|Medium|| +|[0437](https://leetcode.com/problems/path-sum-iii/)|[Path Sum III](./Algorithms/0437.path-sum-iii)|44%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0436](https://leetcode.com/problems/find-right-interval/)|[Find Right Interval](./Algorithms/0436.find-right-interval)|43%|Medium|| +|[0435](https://leetcode.com/problems/non-overlapping-intervals/)|[Non-overlapping Intervals](./Algorithms/0435.non-overlapping-intervals)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0434](https://leetcode.com/problems/number-of-segments-in-a-string/)|[Number of Segments in a String](./Algorithms/0434.number-of-segments-in-a-string)|37%|Easy|| +|[0433](https://leetcode.com/problems/minimum-genetic-mutation/)|[Minimum Genetic Mutation](./Algorithms/0433.minimum-genetic-mutation)|39%|Medium|| +|[0432](https://leetcode.com/problems/all-oone-data-structure/)|[All O`one Data Structure](./Algorithms/0432.all-oone-data-structure)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0424](https://leetcode.com/problems/longest-repeating-character-replacement/)|[Longest Repeating Character Replacement](./Algorithms/0424.longest-repeating-character-replacement)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0423](https://leetcode.com/problems/reconstruct-original-digits-from-english/)|[Reconstruct Original Digits from English](./Algorithms/0423.reconstruct-original-digits-from-english)|46%|Medium|| +|[0421](https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/)|[Maximum XOR of Two Numbers in an Array](./Algorithms/0421.maximum-xor-of-two-numbers-in-an-array)|52%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0420](https://leetcode.com/problems/strong-password-checker/)|[Strong Password Checker](./Algorithms/0420.strong-password-checker)|16%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0419](https://leetcode.com/problems/battleships-in-a-board/)|[Battleships in a Board](./Algorithms/0419.battleships-in-a-board)|66%|Medium|| +|[0417](https://leetcode.com/problems/pacific-atlantic-water-flow/)|[Pacific Atlantic Water Flow](./Algorithms/0417.pacific-atlantic-water-flow)|38%|Medium|| +|[0416](https://leetcode.com/problems/partition-equal-subset-sum/)|[Partition Equal Subset Sum](./Algorithms/0416.partition-equal-subset-sum)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0415](https://leetcode.com/problems/add-strings/)|[Add Strings](./Algorithms/0415.add-strings)|45%|Easy|| +|[0414](https://leetcode.com/problems/third-maximum-number/)|[Third Maximum Number](./Algorithms/0414.third-maximum-number)|29%|Easy|| +|[0413](https://leetcode.com/problems/arithmetic-slices/)|[Arithmetic Slices](./Algorithms/0413.arithmetic-slices)|56%|Medium|| +|[0412](https://leetcode.com/problems/fizz-buzz/)|[Fizz Buzz](./Algorithms/0412.fizz-buzz)|60%|Easy|| +|[0410](https://leetcode.com/problems/split-array-largest-sum/)|[Split Array Largest Sum](./Algorithms/0410.split-array-largest-sum)|43%|Hard|| +|[0409](https://leetcode.com/problems/longest-palindrome/)|[Longest Palindrome](./Algorithms/0409.longest-palindrome)|48%|Easy|| +|[0407](https://leetcode.com/problems/trapping-rain-water-ii/)|[Trapping Rain Water II](./Algorithms/0407.trapping-rain-water-ii)|40%|Hard|| +|[0406](https://leetcode.com/problems/queue-reconstruction-by-height/)|[Queue Reconstruction by Height](./Algorithms/0406.queue-reconstruction-by-height)|61%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0405](https://leetcode.com/problems/convert-a-number-to-hexadecimal/)|[Convert a Number to Hexadecimal](./Algorithms/0405.convert-a-number-to-hexadecimal)|42%|Easy|| +|[0404](https://leetcode.com/problems/sum-of-left-leaves/)|[Sum of Left Leaves](./Algorithms/0404.sum-of-left-leaves)|49%|Easy|| +|[0403](https://leetcode.com/problems/frog-jump/)|[Frog Jump](./Algorithms/0403.frog-jump)|37%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0402](https://leetcode.com/problems/remove-k-digits/)|[Remove K Digits](./Algorithms/0402.remove-k-digits)|27%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0401](https://leetcode.com/problems/binary-watch/)|[Binary Watch](./Algorithms/0401.binary-watch)|45%|Easy|| +|[0400](https://leetcode.com/problems/nth-digit/)|[Nth Digit](./Algorithms/0400.nth-digit)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0399](https://leetcode.com/problems/evaluate-division/)|[Evaluate Division](./Algorithms/0399.evaluate-division)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0398](https://leetcode.com/problems/random-pick-index/)|[Random Pick Index](./Algorithms/0398.random-pick-index)|51%|Medium|| +|[0397](https://leetcode.com/problems/integer-replacement/)|[Integer Replacement](./Algorithms/0397.integer-replacement)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0396](https://leetcode.com/problems/rotate-function/)|[Rotate Function](./Algorithms/0396.rotate-function)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0395](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/)|[Longest Substring with At Least K Repeating Characters](./Algorithms/0395.longest-substring-with-at-least-k-repeating-characters)|39%|Medium|| +|[0394](https://leetcode.com/problems/decode-string/)|[Decode String](./Algorithms/0394.decode-string)|47%|Medium|| +|[0393](https://leetcode.com/problems/utf-8-validation/)|[UTF-8 Validation](./Algorithms/0393.utf-8-validation)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0392](https://leetcode.com/problems/is-subsequence/)|[Is Subsequence](./Algorithms/0392.is-subsequence)|47%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0391](https://leetcode.com/problems/perfect-rectangle/)|[Perfect Rectangle](./Algorithms/0391.perfect-rectangle)|28%|Hard|| +|[0390](https://leetcode.com/problems/elimination-game/)|[Elimination Game](./Algorithms/0390.elimination-game)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0389](https://leetcode.com/problems/find-the-difference/)|[Find the Difference](./Algorithms/0389.find-the-difference)|53%|Easy|| +|[0388](https://leetcode.com/problems/longest-absolute-file-path/)|[Longest Absolute File Path](./Algorithms/0388.longest-absolute-file-path)|40%|Medium|| +|[0387](https://leetcode.com/problems/first-unique-character-in-a-string/)|[First Unique Character in a String](./Algorithms/0387.first-unique-character-in-a-string)|50%|Easy|| +|[0386](https://leetcode.com/problems/lexicographical-numbers/)|[Lexicographical Numbers](./Algorithms/0386.lexicographical-numbers)|48%|Medium|| +|[0385](https://leetcode.com/problems/mini-parser/)|[Mini Parser](./Algorithms/0385.mini-parser)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0384](https://leetcode.com/problems/shuffle-an-array/)|[Shuffle an Array](./Algorithms/0384.shuffle-an-array)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0383](https://leetcode.com/problems/ransom-note/)|[Ransom Note](./Algorithms/0383.ransom-note)|50%|Easy|| +|[0382](https://leetcode.com/problems/linked-list-random-node/)|[Linked List Random Node](./Algorithms/0382.linked-list-random-node)|50%|Medium|| +|[0381](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/)|[Insert Delete GetRandom O(1) - Duplicates allowed](./Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0380](https://leetcode.com/problems/insert-delete-getrandom-o1/)|[Insert Delete GetRandom O(1)](./Algorithms/0380.insert-delete-getrandom-o1)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0378](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/)|[Kth Smallest Element in a Sorted Matrix](./Algorithms/0378.kth-smallest-element-in-a-sorted-matrix)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0377](https://leetcode.com/problems/combination-sum-iv/)|[Combination Sum IV](./Algorithms/0377.combination-sum-iv)|44%|Medium|| +|[0376](https://leetcode.com/problems/wiggle-subsequence/)|[Wiggle Subsequence](./Algorithms/0376.wiggle-subsequence)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0375](https://leetcode.com/problems/guess-number-higher-or-lower-ii/)|[Guess Number Higher or Lower II](./Algorithms/0375.guess-number-higher-or-lower-ii)|38%|Medium|| +|[0373](https://leetcode.com/problems/find-k-pairs-with-smallest-sums/)|[Find K Pairs with Smallest Sums](./Algorithms/0373.find-k-pairs-with-smallest-sums)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0372](https://leetcode.com/problems/super-pow/)|[Super Pow](./Algorithms/0372.super-pow)|36%|Medium|| +|[0371](https://leetcode.com/problems/sum-of-two-integers/)|[Sum of Two Integers](./Algorithms/0371.sum-of-two-integers)|50%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0368](https://leetcode.com/problems/largest-divisible-subset/)|[Largest Divisible Subset](./Algorithms/0368.largest-divisible-subset)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0367](https://leetcode.com/problems/valid-perfect-square/)|[Valid Perfect Square](./Algorithms/0367.valid-perfect-square)|40%|Easy|| +|[0365](https://leetcode.com/problems/water-and-jug-problem/)|[Water and Jug Problem](./Algorithms/0365.water-and-jug-problem)|29%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0363](https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/)|[Max Sum of Rectangle No Larger Than K](./Algorithms/0363.max-sum-of-rectangle-no-larger-than-k)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0357](https://leetcode.com/problems/count-numbers-with-unique-digits/)|[Count Numbers with Unique Digits](./Algorithms/0357.count-numbers-with-unique-digits)|47%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0355](https://leetcode.com/problems/design-twitter/)|[Design Twitter](./Algorithms/0355.design-twitter)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0354](https://leetcode.com/problems/russian-doll-envelopes/)|[Russian Doll Envelopes](./Algorithms/0354.russian-doll-envelopes)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0352](https://leetcode.com/problems/data-stream-as-disjoint-intervals/)|[Data Stream as Disjoint Intervals](./Algorithms/0352.data-stream-as-disjoint-intervals)|44%|Hard|| +|[0350](https://leetcode.com/problems/intersection-of-two-arrays-ii/)|[Intersection of Two Arrays II](./Algorithms/0350.intersection-of-two-arrays-ii)|49%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0349](https://leetcode.com/problems/intersection-of-two-arrays/)|[Intersection of Two Arrays](./Algorithms/0349.intersection-of-two-arrays)|57%|Easy|| +|[0347](https://leetcode.com/problems/top-k-frequent-elements/)|[Top K Frequent Elements](./Algorithms/0347.top-k-frequent-elements)|57%|Medium|| +|[0345](https://leetcode.com/problems/reverse-vowels-of-a-string/)|[Reverse Vowels of a String](./Algorithms/0345.reverse-vowels-of-a-string)|42%|Easy|| +|[0344](https://leetcode.com/problems/reverse-string/)|[Reverse String](./Algorithms/0344.reverse-string)|64%|Easy|| +|[0343](https://leetcode.com/problems/integer-break/)|[Integer Break](./Algorithms/0343.integer-break)|48%|Medium|| +|[0342](https://leetcode.com/problems/power-of-four/)|[Power of Four](./Algorithms/0342.power-of-four)|40%|Easy|| +|[0338](https://leetcode.com/problems/counting-bits/)|[Counting Bits](./Algorithms/0338.counting-bits)|65%|Medium|| +|[0337](https://leetcode.com/problems/house-robber-iii/)|[House Robber III](./Algorithms/0337.house-robber-iii)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0336](https://leetcode.com/problems/palindrome-pairs/)|[Palindrome Pairs](./Algorithms/0336.palindrome-pairs)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0335](https://leetcode.com/problems/self-crossing/)|[Self Crossing](./Algorithms/0335.self-crossing)|27%|Hard|| +|[0334](https://leetcode.com/problems/increasing-triplet-subsequence/)|[Increasing Triplet Subsequence](./Algorithms/0334.increasing-triplet-subsequence)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0332](https://leetcode.com/problems/reconstruct-itinerary/)|[Reconstruct Itinerary](./Algorithms/0332.reconstruct-itinerary)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0331](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/)|[Verify Preorder Serialization of a Binary Tree](./Algorithms/0331.verify-preorder-serialization-of-a-binary-tree)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0330](https://leetcode.com/problems/patching-array/)|[Patching Array](./Algorithms/0330.patching-array)|33%|Hard|| +|[0329](https://leetcode.com/problems/longest-increasing-path-in-a-matrix/)|[Longest Increasing Path in a Matrix](./Algorithms/0329.longest-increasing-path-in-a-matrix)|41%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0328](https://leetcode.com/problems/odd-even-linked-list/)|[Odd Even Linked List](./Algorithms/0328.odd-even-linked-list)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0327](https://leetcode.com/problems/count-of-range-sum/)|[Count of Range Sum](./Algorithms/0327.count-of-range-sum)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0326](https://leetcode.com/problems/power-of-three/)|[Power of Three](./Algorithms/0326.power-of-three)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0324](https://leetcode.com/problems/wiggle-sort-ii/)|[Wiggle Sort II](./Algorithms/0324.wiggle-sort-ii)|28%|Medium|| +|[0322](https://leetcode.com/problems/coin-change/)|[Coin Change](./Algorithms/0322.coin-change)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0321](https://leetcode.com/problems/create-maximum-number/)|[Create Maximum Number](./Algorithms/0321.create-maximum-number)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0319](https://leetcode.com/problems/bulb-switcher/)|[Bulb Switcher](./Algorithms/0319.bulb-switcher)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0318](https://leetcode.com/problems/maximum-product-of-word-lengths/)|[Maximum Product of Word Lengths](./Algorithms/0318.maximum-product-of-word-lengths)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0316](https://leetcode.com/problems/remove-duplicate-letters/)|[Remove Duplicate Letters](./Algorithms/0316.remove-duplicate-letters)|33%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0315](https://leetcode.com/problems/count-of-smaller-numbers-after-self/)|[Count of Smaller Numbers After Self](./Algorithms/0315.count-of-smaller-numbers-after-self)|39%|Hard|| +|[0313](https://leetcode.com/problems/super-ugly-number/)|[Super Ugly Number](./Algorithms/0313.super-ugly-number)|42%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0312](https://leetcode.com/problems/burst-balloons/)|[Burst Balloons](./Algorithms/0312.burst-balloons)|48%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0310](https://leetcode.com/problems/minimum-height-trees/)|[Minimum Height Trees](./Algorithms/0310.minimum-height-trees)|31%|Medium|| +|[0309](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/)|[Best Time to Buy and Sell Stock with Cooldown](./Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown)|45%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0307](https://leetcode.com/problems/range-sum-query-mutable/)|[Range Sum Query - Mutable](./Algorithms/0307.range-sum-query-mutable)|30%|Medium|| +|[0306](https://leetcode.com/problems/additive-number/)|[Additive Number](./Algorithms/0306.additive-number)|28%|Medium|| +|[0304](https://leetcode.com/problems/range-sum-query-2d-immutable/)|[Range Sum Query 2D - Immutable](./Algorithms/0304.range-sum-query-2d-immutable)|34%|Medium|| +|[0303](https://leetcode.com/problems/range-sum-query-immutable/)|[Range Sum Query - Immutable](./Algorithms/0303.range-sum-query-immutable)|40%|Easy|| +|[0301](https://leetcode.com/problems/remove-invalid-parentheses/)|[Remove Invalid Parentheses](./Algorithms/0301.remove-invalid-parentheses)|40%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0300](https://leetcode.com/problems/longest-increasing-subsequence/)|[Longest Increasing Subsequence](./Algorithms/0300.longest-increasing-subsequence)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0299](https://leetcode.com/problems/bulls-and-cows/)|[Bulls and Cows](./Algorithms/0299.bulls-and-cows)|40%|Easy|| +|[0295](https://leetcode.com/problems/find-median-from-data-stream/)|[Find Median from Data Stream](./Algorithms/0295.find-median-from-data-stream)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0292](https://leetcode.com/problems/nim-game/)|[Nim Game](./Algorithms/0292.nim-game)|55%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0290](https://leetcode.com/problems/word-pattern/)|[Word Pattern](./Algorithms/0290.word-pattern)|35%|Easy|| +|[0289](https://leetcode.com/problems/game-of-life/)|[Game of Life](./Algorithms/0289.game-of-life)|49%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0287](https://leetcode.com/problems/find-the-duplicate-number/)|[Find the Duplicate Number](./Algorithms/0287.find-the-duplicate-number)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0283](https://leetcode.com/problems/move-zeroes/)|[Move Zeroes](./Algorithms/0283.move-zeroes)|55%|Easy|| +|[0282](https://leetcode.com/problems/expression-add-operators/)|[Expression Add Operators](./Algorithms/0282.expression-add-operators)|34%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0279](https://leetcode.com/problems/perfect-squares/)|[Perfect Squares](./Algorithms/0279.perfect-squares)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0275](https://leetcode.com/problems/h-index-ii/)|[H-Index II](./Algorithms/0275.h-index-ii)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0274](https://leetcode.com/problems/h-index/)|[H-Index](./Algorithms/0274.h-index)|34%|Medium|| +|[0273](https://leetcode.com/problems/integer-to-english-words/)|[Integer to English Words](./Algorithms/0273.integer-to-english-words)|25%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0268](https://leetcode.com/problems/missing-number/)|[Missing Number](./Algorithms/0268.missing-number)|49%|Easy|| +|[0264](https://leetcode.com/problems/ugly-number-ii/)|[Ugly Number II](./Algorithms/0264.ugly-number-ii)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0263](https://leetcode.com/problems/ugly-number/)|[Ugly Number](./Algorithms/0263.ugly-number)|41%|Easy|| +|[0260](https://leetcode.com/problems/single-number-iii/)|[Single Number III](./Algorithms/0260.single-number-iii)|58%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0258](https://leetcode.com/problems/add-digits/)|[Add Digits](./Algorithms/0258.add-digits)|55%|Easy|| +|[0257](https://leetcode.com/problems/binary-tree-paths/)|[Binary Tree Paths](./Algorithms/0257.binary-tree-paths)|47%|Easy|| +|[0242](https://leetcode.com/problems/valid-anagram/)|[Valid Anagram](./Algorithms/0242.valid-anagram)|54%|Easy|| +|[0241](https://leetcode.com/problems/different-ways-to-add-parentheses/)|[Different Ways to Add Parentheses](./Algorithms/0241.different-ways-to-add-parentheses)|52%|Medium|| +|[0240](https://leetcode.com/problems/search-a-2d-matrix-ii/)|[Search a 2D Matrix II](./Algorithms/0240.search-a-2d-matrix-ii)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0239](https://leetcode.com/problems/sliding-window-maximum/)|[Sliding Window Maximum](./Algorithms/0239.sliding-window-maximum)|39%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0238](https://leetcode.com/problems/product-of-array-except-self/)|[Product of Array Except Self](./Algorithms/0238.product-of-array-except-self)|57%|Medium|| +|[0237](https://leetcode.com/problems/delete-node-in-a-linked-list/)|[Delete Node in a Linked List](./Algorithms/0237.delete-node-in-a-linked-list)|56%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0236](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)|[Lowest Common Ancestor of a Binary Tree](./Algorithms/0236.lowest-common-ancestor-of-a-binary-tree)|40%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0235](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)|[Lowest Common Ancestor of a Binary Search Tree](./Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree)|46%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0234](https://leetcode.com/problems/palindrome-linked-list/)|[Palindrome Linked List](./Algorithms/0234.palindrome-linked-list)|37%|Easy|| +|[0233](https://leetcode.com/problems/number-of-digit-one/)|[Number of Digit One](./Algorithms/0233.number-of-digit-one)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0232](https://leetcode.com/problems/implement-queue-using-stacks/)|[Implement Queue using Stacks](./Algorithms/0232.implement-queue-using-stacks)|45%|Easy|| +|[0231](https://leetcode.com/problems/power-of-two/)|[Power of Two](./Algorithms/0231.power-of-two)|42%|Easy|| +|[0230](https://leetcode.com/problems/kth-smallest-element-in-a-bst/)|[Kth Smallest Element in a BST](./Algorithms/0230.kth-smallest-element-in-a-bst)|54%|Medium|| +|[0229](https://leetcode.com/problems/majority-element-ii/)|[Majority Element II](./Algorithms/0229.majority-element-ii)|33%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0228](https://leetcode.com/problems/summary-ranges/)|[Summary Ranges](./Algorithms/0228.summary-ranges)|37%|Medium|| +|[0227](https://leetcode.com/problems/basic-calculator-ii/)|[Basic Calculator II](./Algorithms/0227.basic-calculator-ii)|34%|Medium|| +|[0226](https://leetcode.com/problems/invert-binary-tree/)|[Invert Binary Tree](./Algorithms/0226.invert-binary-tree)|60%|Easy|| +|[0225](https://leetcode.com/problems/implement-stack-using-queues/)|[Implement Stack using Queues](./Algorithms/0225.implement-stack-using-queues)|41%|Easy|| +|[0224](https://leetcode.com/problems/basic-calculator/)|[Basic Calculator](./Algorithms/0224.basic-calculator)|34%|Hard|| +|[0223](https://leetcode.com/problems/rectangle-area/)|[Rectangle Area](./Algorithms/0223.rectangle-area)|36%|Medium|| +|[0222](https://leetcode.com/problems/count-complete-tree-nodes/)|[Count Complete Tree Nodes](./Algorithms/0222.count-complete-tree-nodes)|38%|Medium|| +|[0221](https://leetcode.com/problems/maximal-square/)|[Maximal Square](./Algorithms/0221.maximal-square)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0220](https://leetcode.com/problems/contains-duplicate-iii/)|[Contains Duplicate III](./Algorithms/0220.contains-duplicate-iii)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0219](https://leetcode.com/problems/contains-duplicate-ii/)|[Contains Duplicate II](./Algorithms/0219.contains-duplicate-ii)|36%|Easy|| +|[0218](https://leetcode.com/problems/the-skyline-problem/)|[The Skyline Problem](./Algorithms/0218.the-skyline-problem)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0217](https://leetcode.com/problems/contains-duplicate/)|[Contains Duplicate](./Algorithms/0217.contains-duplicate)|53%|Easy|| +|[0216](https://leetcode.com/problems/combination-sum-iii/)|[Combination Sum III](./Algorithms/0216.combination-sum-iii)|53%|Medium|| +|[0215](https://leetcode.com/problems/kth-largest-element-in-an-array/)|[Kth Largest Element in an Array](./Algorithms/0215.kth-largest-element-in-an-array)|50%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0214](https://leetcode.com/problems/shortest-palindrome/)|[Shortest Palindrome](./Algorithms/0214.shortest-palindrome)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0213](https://leetcode.com/problems/house-robber-ii/)|[House Robber II](./Algorithms/0213.house-robber-ii)|35%|Medium|| +|[0212](https://leetcode.com/problems/word-search-ii/)|[Word Search II](./Algorithms/0212.word-search-ii)|30%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0211](https://leetcode.com/problems/add-and-search-word-data-structure-design/)|[Add and Search Word - Data structure design](./Algorithms/0211.add-and-search-word-data-structure-design)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0210](https://leetcode.com/problems/course-schedule-ii/)|[Course Schedule II](./Algorithms/0210.course-schedule-ii)|36%|Medium|| +|[0209](https://leetcode.com/problems/minimum-size-subarray-sum/)|[Minimum Size Subarray Sum](./Algorithms/0209.minimum-size-subarray-sum)|35%|Medium|| +|[0208](https://leetcode.com/problems/implement-trie-prefix-tree/)|[Implement Trie (Prefix Tree)](./Algorithms/0208.implement-trie-prefix-tree)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0207](https://leetcode.com/problems/course-schedule/)|[Course Schedule](./Algorithms/0207.course-schedule)|39%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0206](https://leetcode.com/problems/reverse-linked-list/)|[Reverse Linked List](./Algorithms/0206.reverse-linked-list)|57%|Easy|| +|[0205](https://leetcode.com/problems/isomorphic-strings/)|[Isomorphic Strings](./Algorithms/0205.isomorphic-strings)|38%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0204](https://leetcode.com/problems/count-primes/)|[Count Primes](./Algorithms/0204.count-primes)|30%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0203](https://leetcode.com/problems/remove-linked-list-elements/)|[Remove Linked List Elements](./Algorithms/0203.remove-linked-list-elements)|36%|Easy|| +|[0202](https://leetcode.com/problems/happy-number/)|[Happy Number](./Algorithms/0202.happy-number)|47%|Easy|| +|[0201](https://leetcode.com/problems/bitwise-and-of-numbers-range/)|[Bitwise AND of Numbers Range](./Algorithms/0201.bitwise-and-of-numbers-range)|36%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0200](https://leetcode.com/problems/number-of-islands/)|[Number of Islands](./Algorithms/0200.number-of-islands)|43%|Medium|| +|[0199](https://leetcode.com/problems/binary-tree-right-side-view/)|[Binary Tree Right Side View](./Algorithms/0199.binary-tree-right-side-view)|50%|Medium|| +|[0198](https://leetcode.com/problems/house-robber/)|[House Robber](./Algorithms/0198.house-robber)|41%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0191](https://leetcode.com/problems/number-of-1-bits/)|[Number of 1 Bits](./Algorithms/0191.number-of-1-bits)|45%|Easy|| +|[0190](https://leetcode.com/problems/reverse-bits/)|[Reverse Bits](./Algorithms/0190.reverse-bits)|33%|Easy|| +|[0189](https://leetcode.com/problems/rotate-array/)|[Rotate Array](./Algorithms/0189.rotate-array)|31%|Easy|| +|[0188](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)|[Best Time to Buy and Sell Stock IV](./Algorithms/0188.best-time-to-buy-and-sell-stock-iv)|27%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0187](https://leetcode.com/problems/repeated-dna-sequences/)|[Repeated DNA Sequences](./Algorithms/0187.repeated-dna-sequences)|37%|Medium|| +|[0179](https://leetcode.com/problems/largest-number/)|[Largest Number](./Algorithms/0179.largest-number)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0174](https://leetcode.com/problems/dungeon-game/)|[Dungeon Game](./Algorithms/0174.dungeon-game)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0173](https://leetcode.com/problems/binary-search-tree-iterator/)|[Binary Search Tree Iterator](./Algorithms/0173.binary-search-tree-iterator)|51%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0172](https://leetcode.com/problems/factorial-trailing-zeroes/)|[Factorial Trailing Zeroes](./Algorithms/0172.factorial-trailing-zeroes)|37%|Easy|| +|[0171](https://leetcode.com/problems/excel-sheet-column-number/)|[Excel Sheet Column Number](./Algorithms/0171.excel-sheet-column-number)|52%|Easy|| +|[0169](https://leetcode.com/problems/majority-element/)|[Majority Element](./Algorithms/0169.majority-element)|54%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0168](https://leetcode.com/problems/excel-sheet-column-title/)|[Excel Sheet Column Title](./Algorithms/0168.excel-sheet-column-title)|29%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0167](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)|[Two Sum II - Input array is sorted](./Algorithms/0167.two-sum-ii-input-array-is-sorted)|51%|Easy|| +|[0166](https://leetcode.com/problems/fraction-to-recurring-decimal/)|[Fraction to Recurring Decimal](./Algorithms/0166.fraction-to-recurring-decimal)|20%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0165](https://leetcode.com/problems/compare-version-numbers/)|[Compare Version Numbers](./Algorithms/0165.compare-version-numbers)|25%|Medium|| +|[0164](https://leetcode.com/problems/maximum-gap/)|[Maximum Gap](./Algorithms/0164.maximum-gap)|33%|Hard|| +|[0162](https://leetcode.com/problems/find-peak-element/)|[Find Peak Element](./Algorithms/0162.find-peak-element)|42%|Medium|| +|[0160](https://leetcode.com/problems/intersection-of-two-linked-lists/)|[Intersection of Two Linked Lists](./Algorithms/0160.intersection-of-two-linked-lists)|36%|Easy|| +|[0155](https://leetcode.com/problems/min-stack/)|[Min Stack](./Algorithms/0155.min-stack)|39%|Easy|| +|[0154](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)|[Find Minimum in Rotated Sorted Array II](./Algorithms/0154.find-minimum-in-rotated-sorted-array-ii)|39%|Hard|| +|[0153](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)|[Find Minimum in Rotated Sorted Array](./Algorithms/0153.find-minimum-in-rotated-sorted-array)|43%|Medium|| +|[0152](https://leetcode.com/problems/maximum-product-subarray/)|[Maximum Product Subarray](./Algorithms/0152.maximum-product-subarray)|30%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0150](https://leetcode.com/problems/evaluate-reverse-polish-notation/)|[Evaluate Reverse Polish Notation](./Algorithms/0150.evaluate-reverse-polish-notation)|33%|Medium|| +|[0149](https://leetcode.com/problems/max-points-on-a-line/)|[Max Points on a Line](./Algorithms/0149.max-points-on-a-line)|16%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0148](https://leetcode.com/problems/sort-list/)|[Sort List](./Algorithms/0148.sort-list)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0147](https://leetcode.com/problems/insertion-sort-list/)|[Insertion Sort List](./Algorithms/0147.insertion-sort-list)|38%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0146](https://leetcode.com/problems/lru-cache/)|[LRU Cache](./Algorithms/0146.lru-cache)|28%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0145](https://leetcode.com/problems/binary-tree-postorder-traversal/)|[Binary Tree Postorder Traversal](./Algorithms/0145.binary-tree-postorder-traversal)|50%|Hard|| +|[0144](https://leetcode.com/problems/binary-tree-preorder-traversal/)|[Binary Tree Preorder Traversal](./Algorithms/0144.binary-tree-preorder-traversal)|53%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0143](https://leetcode.com/problems/reorder-list/)|[Reorder List](./Algorithms/0143.reorder-list)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0142](https://leetcode.com/problems/linked-list-cycle-ii/)|[Linked List Cycle II](./Algorithms/0142.linked-list-cycle-ii)|34%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0141](https://leetcode.com/problems/linked-list-cycle/)|[Linked List Cycle](./Algorithms/0141.linked-list-cycle)|38%|Easy|| +|[0140](https://leetcode.com/problems/word-break-ii/)|[Word Break II](./Algorithms/0140.word-break-ii)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0139](https://leetcode.com/problems/word-break/)|[Word Break](./Algorithms/0139.word-break)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0137](https://leetcode.com/problems/single-number-ii/)|[Single Number II](./Algorithms/0137.single-number-ii)|47%|Medium|| +|[0136](https://leetcode.com/problems/single-number/)|[Single Number](./Algorithms/0136.single-number)|61%|Easy|| +|[0135](https://leetcode.com/problems/candy/)|[Candy](./Algorithms/0135.candy)|29%|Hard|| +|[0134](https://leetcode.com/problems/gas-station/)|[Gas Station](./Algorithms/0134.gas-station)|35%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0132](https://leetcode.com/problems/palindrome-partitioning-ii/)|[Palindrome Partitioning II](./Algorithms/0132.palindrome-partitioning-ii)|28%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0131](https://leetcode.com/problems/palindrome-partitioning/)|[Palindrome Partitioning](./Algorithms/0131.palindrome-partitioning)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0130](https://leetcode.com/problems/surrounded-regions/)|[Surrounded Regions](./Algorithms/0130.surrounded-regions)|24%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0129](https://leetcode.com/problems/sum-root-to-leaf-numbers/)|[Sum Root to Leaf Numbers](./Algorithms/0129.sum-root-to-leaf-numbers)|44%|Medium|| +|[0128](https://leetcode.com/problems/longest-consecutive-sequence/)|[Longest Consecutive Sequence](./Algorithms/0128.longest-consecutive-sequence)|43%|Hard|| +|[0127](https://leetcode.com/problems/word-ladder/)|[Word Ladder](./Algorithms/0127.word-ladder)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0126](https://leetcode.com/problems/word-ladder-ii/)|[Word Ladder II](./Algorithms/0126.word-ladder-ii)|19%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0125](https://leetcode.com/problems/valid-palindrome/)|[Valid Palindrome](./Algorithms/0125.valid-palindrome)|32%|Easy|| +|[0124](https://leetcode.com/problems/binary-tree-maximum-path-sum/)|[Binary Tree Maximum Path Sum](./Algorithms/0124.binary-tree-maximum-path-sum)|31%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0123](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/)|[Best Time to Buy and Sell Stock III](./Algorithms/0123.best-time-to-buy-and-sell-stock-iii)|35%|Hard|| +|[0122](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/)|[Best Time to Buy and Sell Stock II](./Algorithms/0122.best-time-to-buy-and-sell-stock-ii)|53%|Easy|| +|[0121](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)|[Best Time to Buy and Sell Stock](./Algorithms/0121.best-time-to-buy-and-sell-stock)|48%|Easy|| +|[0120](https://leetcode.com/problems/triangle/)|[Triangle](./Algorithms/0120.triangle)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0119](https://leetcode.com/problems/pascals-triangle-ii/)|[Pascal's Triangle II](./Algorithms/0119.pascals-triangle-ii)|45%|Easy|| +|[0118](https://leetcode.com/problems/pascals-triangle/)|[Pascal's Triangle](./Algorithms/0118.pascals-triangle)|48%|Easy|| +|[0115](https://leetcode.com/problems/distinct-subsequences/)|[Distinct Subsequences](./Algorithms/0115.distinct-subsequences)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0114](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)|[Flatten Binary Tree to Linked List](./Algorithms/0114.flatten-binary-tree-to-linked-list)|44%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0113](https://leetcode.com/problems/path-sum-ii/)|[Path Sum II](./Algorithms/0113.path-sum-ii)|42%|Medium|| +|[0112](https://leetcode.com/problems/path-sum/)|[Path Sum](./Algorithms/0112.path-sum)|39%|Easy|| +|[0111](https://leetcode.com/problems/minimum-depth-of-binary-tree/)|[Minimum Depth of Binary Tree](./Algorithms/0111.minimum-depth-of-binary-tree)|36%|Easy|| +|[0110](https://leetcode.com/problems/balanced-binary-tree/)|[Balanced Binary Tree](./Algorithms/0110.balanced-binary-tree)|42%|Easy|| +|[0109](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)|[Convert Sorted List to Binary Search Tree](./Algorithms/0109.convert-sorted-list-to-binary-search-tree)|43%|Medium|| +|[0108](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)|[Convert Sorted Array to Binary Search Tree](./Algorithms/0108.convert-sorted-array-to-binary-search-tree)|53%|Easy|| +|[0107](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/)|[Binary Tree Level Order Traversal II](./Algorithms/0107.binary-tree-level-order-traversal-ii)|48%|Easy|| +|[0106](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)|[Construct Binary Tree from Inorder and Postorder Traversal](./Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal)|41%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0105](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)|[Construct Binary Tree from Preorder and Inorder Traversal](./Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal)|43%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0104](https://leetcode.com/problems/maximum-depth-of-binary-tree/)|[Maximum Depth of Binary Tree](./Algorithms/0104.maximum-depth-of-binary-tree)|62%|Easy|| +|[0103](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)|[Binary Tree Zigzag Level Order Traversal](./Algorithms/0103.binary-tree-zigzag-level-order-traversal)|43%|Medium|| +|[0102](https://leetcode.com/problems/binary-tree-level-order-traversal/)|[Binary Tree Level Order Traversal](./Algorithms/0102.binary-tree-level-order-traversal)|50%|Medium|| +|[0101](https://leetcode.com/problems/symmetric-tree/)|[Symmetric Tree](./Algorithms/0101.symmetric-tree)|44%|Easy|[❤](https://leetcode.com/list/oussv5j)| +|[0100](https://leetcode.com/problems/same-tree/)|[Same Tree](./Algorithms/0100.same-tree)|51%|Easy|| +|[0099](https://leetcode.com/problems/recover-binary-search-tree/)|[Recover Binary Search Tree](./Algorithms/0099.recover-binary-search-tree)|36%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0098](https://leetcode.com/problems/validate-binary-search-tree/)|[Validate Binary Search Tree](./Algorithms/0098.validate-binary-search-tree)|26%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0097](https://leetcode.com/problems/interleaving-string/)|[Interleaving String](./Algorithms/0097.interleaving-string)|29%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0096](https://leetcode.com/problems/unique-binary-search-trees/)|[Unique Binary Search Trees](./Algorithms/0096.unique-binary-search-trees)|48%|Medium|| +|[0095](https://leetcode.com/problems/unique-binary-search-trees-ii/)|[Unique Binary Search Trees II](./Algorithms/0095.unique-binary-search-trees-ii)|37%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0094](https://leetcode.com/problems/binary-tree-inorder-traversal/)|[Binary Tree Inorder Traversal](./Algorithms/0094.binary-tree-inorder-traversal)|59%|Medium|| +|[0093](https://leetcode.com/problems/restore-ip-addresses/)|[Restore IP Addresses](./Algorithms/0093.restore-ip-addresses)|32%|Medium|[❤](https://leetcode.com/list/oussv5j)| +|[0092](https://leetcode.com/problems/reverse-linked-list-ii/)|[Reverse Linked List II](./Algorithms/0092.reverse-linked-list-ii)|36%|Medium|| +|[0091](https://leetcode.com/problems/decode-ways/)|[Decode Ways](./Algorithms/0091.decode-ways)|23%|Medium|| +|[0090](https://leetcode.com/problems/subsets-ii/)|[Subsets II](./Algorithms/0090.subsets-ii)|44%|Medium|| +|[0089](https://leetcode.com/problems/gray-code/)|[Gray Code](./Algorithms/0089.gray-code)|47%|Medium|| +|[0088](https://leetcode.com/problems/merge-sorted-array/)|[Merge Sorted Array](./Algorithms/0088.merge-sorted-array)|37%|Easy|| +|[0087](https://leetcode.com/problems/scramble-string/)|[Scramble String](./Algorithms/0087.scramble-string)|32%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0086](https://leetcode.com/problems/partition-list/)|[Partition List](./Algorithms/0086.partition-list)|38%|Medium|| +|[0085](https://leetcode.com/problems/maximal-rectangle/)|[Maximal Rectangle](./Algorithms/0085.maximal-rectangle)|35%|Hard|[❤](https://leetcode.com/list/oussv5j)| +|[0084](https://leetcode.com/problems/largest-rectangle-in-histogram/)|[Largest Rectangle in Histogram](./Algorithms/0084.largest-rectangle-in-histogram)|32%|Hard|| +|[0083](https://leetcode.com/problems/remove-duplicates-from-sorted-list/)|[Remove Duplicates from Sorted List](./Algorithms/0083.remove-duplicates-from-sorted-list)|43%|Easy|| +|[0082](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)|[Remove Duplicates from Sorted List II](./Algorithms/0082.remove-duplicates-from-sorted-list-ii)|34%|Medium|| +|[0081](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/)|[Search in Rotated Sorted Array II](./Algorithms/0081.search-in-rotated-sorted-array-ii)|32%|Medium|| +|[0080](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)|[Remove Duplicates from Sorted Array II](./Algorithms/0080.remove-duplicates-from-sorted-array-ii)|41%|Medium|| +|[0079](https://leetcode.com/problems/word-search/)|[Word Search](./Algorithms/0079.word-search)|32%|Medium|| +|[0078](https://leetcode.com/problems/subsets/)|[Subsets](./Algorithms/0078.subsets)|56%|Medium|| +|[0077](https://leetcode.com/problems/combinations/)|[Combinations](./Algorithms/0077.combinations)|50%|Medium|| +|[0076](https://leetcode.com/problems/minimum-window-substring/)|[Minimum Window Substring](./Algorithms/0076.minimum-window-substring)|32%|Hard|| +|[0075](https://leetcode.com/problems/sort-colors/)|[Sort Colors](./Algorithms/0075.sort-colors)|43%|Medium|| +|[0074](https://leetcode.com/problems/search-a-2d-matrix/)|[Search a 2D Matrix](./Algorithms/0074.search-a-2d-matrix)|35%|Medium|| +|[0073](https://leetcode.com/problems/set-matrix-zeroes/)|[Set Matrix Zeroes](./Algorithms/0073.set-matrix-zeroes)|41%|Medium|| +|[0072](https://leetcode.com/problems/edit-distance/)|[Edit Distance](./Algorithms/0072.edit-distance)|40%|Hard|| +|[0071](https://leetcode.com/problems/simplify-path/)|[Simplify Path](./Algorithms/0071.simplify-path)|30%|Medium|| +|[0070](https://leetcode.com/problems/climbing-stairs/)|[Climbing Stairs](./Algorithms/0070.climbing-stairs)|45%|Easy|| +|[0069](https://leetcode.com/problems/sqrtx/)|[Sqrt(x)](./Algorithms/0069.sqrtx)|32%|Easy|| +|[0068](https://leetcode.com/problems/text-justification/)|[Text Justification](./Algorithms/0068.text-justification)|24%|Hard|| +|[0067](https://leetcode.com/problems/add-binary/)|[Add Binary](./Algorithms/0067.add-binary)|41%|Easy|| +|[0066](https://leetcode.com/problems/plus-one/)|[Plus One](./Algorithms/0066.plus-one)|41%|Easy|| +|[0065](https://leetcode.com/problems/valid-number/)|[Valid Number](./Algorithms/0065.valid-number)|14%|Hard|| +|[0064](https://leetcode.com/problems/minimum-path-sum/)|[Minimum Path Sum](./Algorithms/0064.minimum-path-sum)|49%|Medium|| +|[0063](https://leetcode.com/problems/unique-paths-ii/)|[Unique Paths II](./Algorithms/0063.unique-paths-ii)|33%|Medium|| +|[0062](https://leetcode.com/problems/unique-paths/)|[Unique Paths](./Algorithms/0062.unique-paths)|49%|Medium|| +|[0061](https://leetcode.com/problems/rotate-list/)|[Rotate List](./Algorithms/0061.rotate-list)|28%|Medium|| +|[0060](https://leetcode.com/problems/permutation-sequence/)|[Permutation Sequence](./Algorithms/0060.permutation-sequence)|34%|Medium|| +|[0059](https://leetcode.com/problems/spiral-matrix-ii/)|[Spiral Matrix II](./Algorithms/0059.spiral-matrix-ii)|49%|Medium|| +|[0058](https://leetcode.com/problems/length-of-last-word/)|[Length of Last Word](./Algorithms/0058.length-of-last-word)|32%|Easy|| +|[0057](https://leetcode.com/problems/insert-interval/)|[Insert Interval](./Algorithms/0057.insert-interval)|32%|Hard|| +|[0056](https://leetcode.com/problems/merge-intervals/)|[Merge Intervals](./Algorithms/0056.merge-intervals)|37%|Medium|| +|[0055](https://leetcode.com/problems/jump-game/)|[Jump Game](./Algorithms/0055.jump-game)|32%|Medium|| +|[0054](https://leetcode.com/problems/spiral-matrix/)|[Spiral Matrix](./Algorithms/0054.spiral-matrix)|31%|Medium|| +|[0053](https://leetcode.com/problems/maximum-subarray/)|[Maximum Subarray](./Algorithms/0053.maximum-subarray)|44%|Easy|| +|[0052](https://leetcode.com/problems/n-queens-ii/)|[N-Queens II](./Algorithms/0052.n-queens-ii)|54%|Hard|| +|[0051](https://leetcode.com/problems/n-queens/)|[N-Queens](./Algorithms/0051.n-queens)|42%|Hard|| +|[0050](https://leetcode.com/problems/powx-n/)|[Pow(x, n)](./Algorithms/0050.powx-n)|28%|Medium|| +|[0049](https://leetcode.com/problems/group-anagrams/)|[Group Anagrams](./Algorithms/0049.group-anagrams)|50%|Medium|| +|[0048](https://leetcode.com/problems/rotate-image/)|[Rotate Image](./Algorithms/0048.rotate-image)|51%|Medium|| +|[0047](https://leetcode.com/problems/permutations-ii/)|[Permutations II](./Algorithms/0047.permutations-ii)|42%|Medium|| +|[0046](https://leetcode.com/problems/permutations/)|[Permutations](./Algorithms/0046.permutations)|58%|Medium|| +|[0045](https://leetcode.com/problems/jump-game-ii/)|[Jump Game II](./Algorithms/0045.jump-game-ii)|29%|Hard|| +|[0044](https://leetcode.com/problems/wildcard-matching/)|[Wildcard Matching](./Algorithms/0044.wildcard-matching)|23%|Hard|| +|[0043](https://leetcode.com/problems/multiply-strings/)|[Multiply Strings](./Algorithms/0043.multiply-strings)|31%|Medium|| +|[0042](https://leetcode.com/problems/trapping-rain-water/)|[Trapping Rain Water](./Algorithms/0042.trapping-rain-water)|45%|Hard|| +|[0041](https://leetcode.com/problems/first-missing-positive/)|[First Missing Positive](./Algorithms/0041.first-missing-positive)|30%|Hard|| +|[0040](https://leetcode.com/problems/combination-sum-ii/)|[Combination Sum II](./Algorithms/0040.combination-sum-ii)|44%|Medium|| +|[0039](https://leetcode.com/problems/combination-sum/)|[Combination Sum](./Algorithms/0039.combination-sum)|51%|Medium|| +|[0038](https://leetcode.com/problems/count-and-say/)|[Count and Say](./Algorithms/0038.count-and-say)|42%|Easy|| +|[0037](https://leetcode.com/problems/sudoku-solver/)|[Sudoku Solver](./Algorithms/0037.sudoku-solver)|39%|Hard|| +|[0036](https://leetcode.com/problems/valid-sudoku/)|[Valid Sudoku](./Algorithms/0036.valid-sudoku)|45%|Medium|| +|[0035](https://leetcode.com/problems/search-insert-position/)|[Search Insert Position](./Algorithms/0035.search-insert-position)|41%|Easy|| +|[0034](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/)|[Find First and Last Position of Element in Sorted Array](./Algorithms/0034.find-first-and-last-position-of-element-in-sorted-array)|34%|Medium|| +|[0033](https://leetcode.com/problems/search-in-rotated-sorted-array/)|[Search in Rotated Sorted Array](./Algorithms/0033.search-in-rotated-sorted-array)|33%|Medium|| +|[0032](https://leetcode.com/problems/longest-valid-parentheses/)|[Longest Valid Parentheses](./Algorithms/0032.longest-valid-parentheses)|26%|Hard|| +|[0031](https://leetcode.com/problems/next-permutation/)|[Next Permutation](./Algorithms/0031.next-permutation)|31%|Medium|| +|[0030](https://leetcode.com/problems/substring-with-concatenation-of-all-words/)|[Substring with Concatenation of All Words](./Algorithms/0030.substring-with-concatenation-of-all-words)|24%|Hard|| +|[0029](https://leetcode.com/problems/divide-two-integers/)|[Divide Two Integers](./Algorithms/0029.divide-two-integers)|16%|Medium|| +|[0028](https://leetcode.com/problems/implement-strstr/)|[Implement strStr()](./Algorithms/0028.implement-strstr)|33%|Easy|| +|[0027](https://leetcode.com/problems/remove-element/)|[Remove Element](./Algorithms/0027.remove-element)|45%|Easy|| +|[0026](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)|[Remove Duplicates from Sorted Array](./Algorithms/0026.remove-duplicates-from-sorted-array)|42%|Easy|| +|[0025](https://leetcode.com/problems/reverse-nodes-in-k-group/)|[Reverse Nodes in k-Group](./Algorithms/0025.reverse-nodes-in-k-group)|38%|Hard|| +|[0024](https://leetcode.com/problems/swap-nodes-in-pairs/)|[Swap Nodes in Pairs](./Algorithms/0024.swap-nodes-in-pairs)|46%|Medium|| +|[0023](https://leetcode.com/problems/merge-k-sorted-lists/)|[Merge k Sorted Lists](./Algorithms/0023.merge-k-sorted-lists)|36%|Hard|| +|[0022](https://leetcode.com/problems/generate-parentheses/)|[Generate Parentheses](./Algorithms/0022.generate-parentheses)|57%|Medium|| +|[0021](https://leetcode.com/problems/merge-two-sorted-lists/)|[Merge Two Sorted Lists](./Algorithms/0021.merge-two-sorted-lists)|49%|Easy|| +|[0020](https://leetcode.com/problems/valid-parentheses/)|[Valid Parentheses](./Algorithms/0020.valid-parentheses)|37%|Easy|| +|[0019](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)|[Remove Nth Node From End of List](./Algorithms/0019.remove-nth-node-from-end-of-list)|34%|Medium|| +|[0018](https://leetcode.com/problems/4sum/)|[4Sum](./Algorithms/0018.4sum)|31%|Medium|| +|[0017](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)|[Letter Combinations of a Phone Number](./Algorithms/0017.letter-combinations-of-a-phone-number)|43%|Medium|| +|[0016](https://leetcode.com/problems/3sum-closest/)|[3Sum Closest](./Algorithms/0016.3sum-closest)|45%|Medium|| +|[0015](https://leetcode.com/problems/3sum/)|[3Sum](./Algorithms/0015.3sum)|25%|Medium|| +|[0014](https://leetcode.com/problems/longest-common-prefix/)|[Longest Common Prefix](./Algorithms/0014.longest-common-prefix)|34%|Easy|| +|[0013](https://leetcode.com/problems/roman-to-integer/)|[Roman to Integer](./Algorithms/0013.roman-to-integer)|53%|Easy|| +|[0012](https://leetcode.com/problems/integer-to-roman/)|[Integer to Roman](./Algorithms/0012.integer-to-roman)|52%|Medium|| +|[0011](https://leetcode.com/problems/container-with-most-water/)|[Container With Most Water](./Algorithms/0011.container-with-most-water)|47%|Medium|| +|[0010](https://leetcode.com/problems/regular-expression-matching/)|[Regular Expression Matching](./Algorithms/0010.regular-expression-matching)|25%|Hard|| +|[0009](https://leetcode.com/problems/palindrome-number/)|[Palindrome Number](./Algorithms/0009.palindrome-number)|45%|Easy|| +|[0008](https://leetcode.com/problems/string-to-integer-atoi/)|[String to Integer (atoi)](./Algorithms/0008.string-to-integer-atoi)|14%|Medium|| +|[0007](https://leetcode.com/problems/reverse-integer/)|[Reverse Integer](./Algorithms/0007.reverse-integer)|25%|Easy|| +|[0006](https://leetcode.com/problems/zigzag-conversion/)|[ZigZag Conversion](./Algorithms/0006.zigzag-conversion)|33%|Medium|| +|[0005](https://leetcode.com/problems/longest-palindromic-substring/)|[Longest Palindromic Substring](./Algorithms/0005.longest-palindromic-substring)|28%|Medium|| +|[0004](https://leetcode.com/problems/median-of-two-sorted-arrays/)|[Median of Two Sorted Arrays](./Algorithms/0004.median-of-two-sorted-arrays)|27%|Hard|| +|[0003](https://leetcode.com/problems/longest-substring-without-repeating-characters/)|[Longest Substring Without Repeating Characters](./Algorithms/0003.longest-substring-without-repeating-characters)|29%|Medium|| +|[0002](https://leetcode.com/problems/add-two-numbers/)|[Add Two Numbers](./Algorithms/0002.add-two-numbers)|32%|Medium|| +|[0001](https://leetcode.com/problems/two-sum/)|[Two Sum](./Algorithms/0001.two-sum)|44%|Easy|| + +以下免费的算法题,暂时不能提交 Go 解答 +- [116.Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) +- [117.Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/) +- [133.Clone Graph](https://leetcode.com/problems/clone-graph/) +- [138.Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/) +- [151.Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) +- [278.First Bad Version](https://leetcode.com/problems/first-bad-version/) +- [284.Peeking Iterator](https://leetcode.com/problems/peeking-iterator/) +- [297.Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) +- [341.Flatten Nested List Iterator](https://leetcode.com/problems/flatten-nested-list-iterator/) +- [374.Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) +- [426.Convert Binary Search Tree to Sorted Doubly Linked List](https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/) +- [427.Construct Quad Tree](https://leetcode.com/problems/construct-quad-tree/) +- [429.N-ary Tree Level Order Traversal](https://leetcode.com/problems/n-ary-tree-level-order-traversal/) +- [430.Flatten a Multilevel Doubly Linked List](https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/) +- [449.Serialize and Deserialize BST](https://leetcode.com/problems/serialize-and-deserialize-bst/) +- [535.Encode and Decode TinyURL](https://leetcode.com/problems/encode-and-decode-tinyurl/) +- [558.Quad Tree Intersection](https://leetcode.com/problems/quad-tree-intersection/) +- [559.Maximum Depth of N-ary Tree](https://leetcode.com/problems/maximum-depth-of-n-ary-tree/) +- [589.N-ary Tree Preorder Traversal](https://leetcode.com/problems/n-ary-tree-preorder-traversal/) +- [590.N-ary Tree Postorder Traversal](https://leetcode.com/problems/n-ary-tree-postorder-traversal/) +- [690.Employee Importance](https://leetcode.com/problems/employee-importance/) +- [708.Insert into a Cyclic Sorted List](https://leetcode.com/problems/insert-into-a-cyclic-sorted-list/) ## helper -[helper](./helper.v4)会帮助处理大部分琐碎的工作。 + +[helper](./Helper) 会处理大部分琐碎的工作。 ## notes -[notes](./notes)记录了我答题过程中,对知识点的总结。 + +[notes](./notes) 记录了我答题过程中,对知识点的总结。 ## kit -在[kit](./kit)中添加了LeetCode常用的数据结构和处理函数: -1. 为[*ListNode](./kit/ListNode.go)添加了与[]int相互转换的函数,方便添加单元测试。使用方式可以参考[21. Merge Two Sorted Lists](./Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go) -1. 为[*TreeNode](./kit/TreeNode.go)添加了与[]int相互转换的函数,方便添加单元测试。 + +针对 LeetCode 中经常出现的以下数据结构,在 [kit](./kit) 中进行了定义,并添加了与 []int 相互转换的函数。利用 Go 1.9 添加的 [type alias](https://github.com/golang/proposal/blob/master/design/18130-type-alias.md) 功能,易于添加单元测试。 + +- [Heap](./kit/Heap.go) +- [Interval](./kit/Interval.go) +- [ListNode](./kit/ListNode.go) +- [NestedInteger](./kit/NestedInteger.go) +- [PriorityQueue](./kit/PriorityQueue.go) +- [Queue](./kit/Queue.go) +- [Stack](./kit/Stack.go) +- [TreeNode](./kit/TreeNode.go) +- [Master](./kit/master.go) + +## 致谢 + +感谢所有贡献者的辛苦付出 + + + +感谢 JetBrains + +[![GoLand](GoLand.png)]( https://www.jetbrains.com/?from=LeetCode-in-Go) diff --git a/README_HEAD.md b/README_HEAD.md deleted file mode 100644 index 7bfeb3dc8..000000000 --- a/README_HEAD.md +++ /dev/null @@ -1,6 +0,0 @@ -# [LeetCode](https://leetcode.com)习题的Golang解答 -[![LeetCode](https://img.shields.io/badge/LeetCode-%s-blue.svg)](https://leetcode.com/%s/) -[![LeetCode Ranking](https://img.shields.io/badge/Ranking-%d-blue.svg)](https://leetcode.com/%s/) -[![Build Status](https://www.travis-ci.org/aQuaYi/LeetCode-in-Golang.svg?branch=master)](https://www.travis-ci.org/aQuaYi/LeetCode-in-Golang) -[![codecov](https://codecov.io/gh/aQuaYi/LeetCode-in-Golang/branch/master/graph/badge.svg)](https://codecov.io/gh/aQuaYi/LeetCode-in-Golang) - diff --git a/README_TAIL.md b/README_TAIL.md deleted file mode 100644 index 8ed100814..000000000 --- a/README_TAIL.md +++ /dev/null @@ -1,15 +0,0 @@ - 以下题目,暂时不能使用 Golang 解答 -- [116. Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) -- [117. Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/) - - -## helper -[helper](./helper.v4)会帮助处理大部分琐碎的工作。 - -## notes -[notes](./notes)记录了我答题过程中,对知识点的总结。 - -## kit -在[kit](./kit)中添加了LeetCode常用的数据结构和处理函数: -1. 为[*ListNode](./kit/ListNode.go)添加了与[]int相互转换的函数,方便添加单元测试。使用方式可以参考[21. Merge Two Sorted Lists](./Algorithms/0021.merge-two-sorted-lists/merge-two-sorted-lists_test.go) -1. 为[*TreeNode](./kit/TreeNode.go)添加了与[]int相互转换的函数,方便添加单元测试。 \ No newline at end of file diff --git a/dida.task.txt b/dida.task.txt new file mode 100644 index 000000000..e69de29bb diff --git a/favorite.markdown b/favorite.markdown new file mode 100755 index 000000000..166576ff0 --- /dev/null +++ b/favorite.markdown @@ -0,0 +1,3 @@ +# 我收藏的 {{.FavoriteCount}} 题 + +{{.FavoriteTable}} diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..03dd71d18 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/aQuaYi/LeetCode-in-Go + +go 1.13 + +require ( + github.com/BurntSushi/toml v0.3.1 + github.com/aQuaYi/GoKit v0.0.0-20170805152833-88827a405d9b + github.com/bitly/go-simplejson v0.5.0 // indirect + github.com/mozillazg/request v0.8.0 + golang.org/x/net v0.0.0-20191124235446-72fef5d5e266 // indirect + gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df +) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..15da7d953 --- /dev/null +++ b/go.sum @@ -0,0 +1,15 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/aQuaYi/GoKit v0.0.0-20170805152833-88827a405d9b h1:ETIKydTbnzwNUsIGDBiFl2EURPhMH3NnFHIDsnXc+o4= +github.com/aQuaYi/GoKit v0.0.0-20170805152833-88827a405d9b/go.mod h1:5MlpsreROJsVmgQHgk2nse+wA7lKTZWgu21Oat1JWcg= +github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/mozillazg/request v0.8.0 h1:TbXeQUdBWr1J1df5Z+lQczDFzX9JD71kTCl7Zu/9rNM= +github.com/mozillazg/request v0.8.0/go.mod h1:weoQ/mVFNbWgRBtivCGF1tUT9lwneFesues+CleXMWc= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20191124235446-72fef5d5e266 h1:QuOiA7GCO0OSDzlNlFyOWOywDsjuzW8M2yvBfCqw+cY= +golang.org/x/net v0.0.0-20191124235446-72fef5d5e266/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= diff --git a/helper.v4/Makefile b/helper.v4/Makefile deleted file mode 100644 index 67c3b113a..000000000 --- a/helper.v4/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -build: - @go build - @mv helper.v4 ../helper - -test: - @go build diff --git a/helper.v4/README.md b/helper.v4/README.md deleted file mode 100644 index 5f4b7cc9e..000000000 --- a/helper.v4/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# helper - -## 功能 -1. 按照程序中设置的模板,生成习题解答文件夹,包括: - 1. README.md - 1. [题目].go - 1. [题目]_test.go -1. 统计已经解答题目,在`LeetCode-in-Golang/README.md`中生成 - 1. 标题下的LeetCode主页和LeetCode排名图标 - 1. 统计报表 - 1. 已完成题目的目录 - -## 使用方式 -1. 在命令行的本目录下,运行`make`,会自动生成程序。 -1. 在命令行的`LeetCode-in-Golang`目录下,运行`./helper`,会自动重新生成项目的`README.md` -1. 在命令行的`LeetCode-in-Golang`目录下,运行`./helper [题号]`,会自动生成相应的答题文件夹。 - -## 配置方法 -1. 在`.gitignore`中,添加一行`*.toml`。 -1. 在`LeetCode-in-Golang`目录下,添加文件`leetcode.toml`。 -1. 把以下内容中的`test`分别修改为你的leetcode用户名和密码后,复制到`leetcode.toml`中。 -```toml -Login="test" -Password="test" -``` diff --git a/helper.v4/data.go b/helper.v4/data.go deleted file mode 100644 index 3c32cc0c9..000000000 --- a/helper.v4/data.go +++ /dev/null @@ -1,149 +0,0 @@ -package main - -import ( - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "log" - "sort" - - "github.com/aQuaYi/GoKit" -) - -func update(categories []string) *leetcode { - newLC := lastest(categories) - oldLC, err := readLeetCodeRecord() - if err != nil { - log.Println("LeetCode 记录读取失败,无法与新记录对比:", err) - } else { - diff(newLC, oldLC) - } - - saveLC(newLC) - - return newLC -} - -func lastest(categories []string) *leetcode { - lc := newLeetCode() - for _, c := range categories { - d := getData(c) - lc.update(d) - } - - lc.totalCategory() - lc.getRanking() - - sort.Sort(lc.Problems) - - return lc -} - -func readLeetCodeRecord() (*leetcode, error) { - if !GoKit.Exist(lcFile) { - msg := fmt.Sprintf("%s 不存在", lcFile) - return nil, errors.New(msg) - } - - raw := read(lcFile) - lc := leetcode{} - if err := json.Unmarshal(raw, &lc); err != nil { - msg := fmt.Sprintf("获取 %s 失败:%s", lcFile, err) - return nil, errors.New(msg) - } - - return &lc, nil -} - -func diff(new, old *leetcode) { - // 对比 ranking - nr, or := new.Ranking, old.Ranking - if nr > 0 && or > 0 { - v, delta := "进步了", or-nr - if nr > or { - v, delta = "后退了", nr-or - } - log.Printf("当前排名 %d,%s %d 名", nr, v, delta) - } else { - log.Printf("当前排名 %d", nr) - } - // 对比 已完成的问题 - lenNew := len(new.Problems) - lenOld := len(old.Problems) - // TODO: 处理数据错位问题 - // isOrderChanged := false - isChanged := false - - i := 0 - for i < lenOld { - n, o := new.Problems[i], old.Problems[i] - - if n.ID != o.ID { - log.Println(n, o) - log.Fatalln("LeetCode 的 Problems 数据出现错位。") - } - - if n.IsAccepted == true && o.IsAccepted == false { - log.Printf("新完成 %d %s", n.ID, n.Title) - isChanged = true - } - - i++ - } - - if !isChanged { - log.Println("~ 没有新完成习题 ~") - } - - for i < lenNew { - log.Printf("出现新题: %d %s", new.Problems[i].ID, new.Problems[i].Title) - i++ - } -} - -func saveLC(lc *leetcode) { - raw, err := json.Marshal(lc) - if err != nil { - log.Fatal("无法把Leetcode数据转换成[]bytes: ", err) - } - if err = ioutil.WriteFile(lcFile, raw, 0666); err != nil { - log.Fatal("无法把Marshal后的lc保存到文件: ", err) - } - - log.Println("最新的 LeetCode 记录已经保存。") -} - -// data 保存API信息 -type data struct { - Name string `json:"category_slug"` - User string `json:"user_name"` - ACEasy int `json:"ac_easy"` - ACMedium int `json:"ac_medium"` - ACHard int `json:"ac_hard"` - AC int `json:"num_solved"` - Problems []problemStatus `json:"stat_status_pairs"` -} - -type problemStatus struct { - Status string `json:"status"` - State `json:"stat"` - IsFavor bool `json:"is_favor"` - IsPaid bool `json:"paid_only"` - Difficulty `json:"difficulty"` -} - -// State 保存单个问题的解答状态 -type State struct { - Title string `json:"question__title"` - TitleSlug string `json:"question__title_slug"` - IsNew bool `json:"is_new_question"` - ID int `json:"question_id"` - ACs int `json:"total_acs"` - Submitted int `json:"total_submitted"` -} - -// Difficulty 问题的难度 -type Difficulty struct { - Level int `json:"level"` -} diff --git a/helper.v4/leetcode.go b/helper.v4/leetcode.go deleted file mode 100644 index e871e909c..000000000 --- a/helper.v4/leetcode.go +++ /dev/null @@ -1,213 +0,0 @@ -package main - -import ( - "fmt" - "log" - "sort" - "strconv" - "strings" -) - -type leetcode struct { - Username string - Ranking int - - Categories categories - Problems problems -} - -func newLeetCode() *leetcode { - return &leetcode{ - Username: cfg.Login, - } -} - -func (l *leetcode) getRanking() { - temp := getRanking(l.Username) - - r, err := strconv.Atoi(temp) - if err != nil { - log.Fatalf("无法把 %s 转换成数字Ranking", temp) - } - - l.Ranking = r -} - -func (l *leetcode) totalCategory() { - t := category{ - Name: "Total", - } - - for _, c := range l.Categories { - t.Easy.Solved += c.Easy.Solved - t.Easy.Total += c.Easy.Total - t.Medium.Solved += c.Medium.Solved - t.Medium.Total += c.Medium.Total - t.Hard.Solved += c.Hard.Solved - t.Hard.Total += c.Hard.Total - t.Total.Solved += c.Total.Solved - t.Total.Total += c.Total.Total - } - - l.Categories = append(l.Categories, t) -} - -func (l *leetcode) update(d *data) { - l.check(d) - ps, e, m, h := countData(d) - l.Problems = append(l.Problems, ps...) - c := newCategory(d, e, m, h) - l.Categories = append(l.Categories, c) -} - -func (l *leetcode) check(d *data) { - if d.User != l.Username { - log.Fatalln("下载了非本人的数据。") - } - log.Printf("%s 通过检查", d.Name) -} - -func countData(d *data) (ps []problem, e, m, h int) { - for _, p := range d.Problems { - - if p.IsPaid { - continue - } - - temp := problem{ - ID: p.ID, - Dir: fmt.Sprintf("./%s/%04d.%s", d.Name, p.ID, p.TitleSlug), - Title: p.Title, - TitleSlug: p.TitleSlug, - PassRate: fmt.Sprintf("%d%%", p.ACs*100/p.Submitted), - Difficulty: p.Difficulty.Level, - IsAccepted: p.Status == "ac", - IsFavor: p.IsFavor, - IsNew: p.IsNew, - } - ps = append(ps, temp) - switch temp.Difficulty { - case 1: - e++ - case 2: - m++ - case 3: - h++ - default: - log.Fatalln("题目出现了第4种难度", p.ID, p.Title) - } - } - return -} - -type category struct { - Name string - Easy, Medium, Hard, Total count -} - -func (c category) String() string { - res := fmt.Sprintf("|**%s**|", strings.Title(c.Name)) - res += fmt.Sprintf("%d / %d|", c.Easy.Solved, c.Easy.Total) - res += fmt.Sprintf("%d / %d|", c.Medium.Solved, c.Medium.Total) - res += fmt.Sprintf("%d / %d|", c.Hard.Solved, c.Hard.Total) - res += fmt.Sprintf("%d / %d|", c.Total.Solved, c.Total.Total) - return res -} - -type categories []category - -func (cs categories) String() string { - res := fmt.Sprintln("|Category|Easy|Medium|Hard|Total|") - res += fmt.Sprintln("|:--|:--:|:--:|:--:|:--:|") - for _, c := range cs { - res += fmt.Sprintln(c) - } - - return res -} -func newCategory(d *data, e, m, h int) category { - c := category{ - Name: d.Name, - } - - c.Easy.Solved = d.ACEasy - c.Easy.Total = e - - c.Medium.Solved = d.ACMedium - c.Medium.Total = m - - c.Hard.Solved = d.ACHard - c.Hard.Total = h - - c.Total.Solved = d.ACEasy + d.ACMedium + d.ACHard - c.Total.Total = e + m + h - - return c -} - -type count struct { - Solved, Total int -} - -type problems []problem - -func (ps problems) Len() int { - return len(ps) -} - -func (ps problems) Less(i, j int) bool { - return ps[i].ID < ps[j].ID -} - -func (ps problems) Swap(i, j int) { - ps[i], ps[j] = ps[j], ps[i] -} - -func (ps problems) acceptedString() string { - sort.Sort(ps) - res := "|题号|题目|难度|总体通过率|收藏|\n" - res += "|:-:|:-|:-: | :-: | :-: |\n" - for _, p := range ps { - if p.IsAccepted { - res += fmt.Sprintln(p) - } - } - return res -} - -type problem struct { - ID int - Dir string - Title, TitleSlug string - PassRate string - Difficulty int - IsAccepted, IsFavor, IsNew bool -} - -func (p problem) link() string { - return fmt.Sprintf("https://leetcode.com/problems/%s/", p.TitleSlug) -} - -func (p problem) String() string { - res := fmt.Sprintf("|%d|", p.ID) - res += fmt.Sprintf(`[%s](%s)|`, p.Title, p.Dir) - res += fmt.Sprintf("%s|", degrees[p.Difficulty]) - res += fmt.Sprintf("%s|", p.PassRate) - f := "" - if p.IsFavor { - f = "❤" - } - res += fmt.Sprintf("%s|", f) - return res -} - -var degrees = map[int]string{ - 1: `☆`, - 2: `☆ ☆`, - 3: `☆ ☆ ☆`, -} - -func (p problem) page() string { - format := "https://leetcode.com/problems/%s" - return fmt.Sprintf(format, p.TitleSlug) -} diff --git a/helper.v4/main.go b/helper.v4/main.go deleted file mode 100644 index 4d0de2d7e..000000000 --- a/helper.v4/main.go +++ /dev/null @@ -1,76 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "strconv" - - "github.com/BurntSushi/toml" -) - -// 程序辅助设置 -const ( - VERSION = "4.1.0" - USAGE = `使用方法: - 1. 运行 helper 会重新生成项目的README.md。 - 2. 运行 helper 123 会生成第123题的答题文件夹。` -) - -var problemNum int -var cfg config -var cfgFile = "leetcode.toml" -var lcFile = "leetcode.json" - -func init() { - // 启动时,导入配置 - if _, err := toml.DecodeFile(cfgFile, &cfg); err != nil { - log.Fatalf(err.Error()) - } - log.Printf("Hi, %s. \n", cfg.Login) - -} - -func main() { - if len(os.Args) > 1 { - switch os.Args[1] { - case "-v", "-version": - fmt.Printf("helper version %s\n", VERSION) - return - case "-h", "-help": - fmt.Println(USAGE) - return - } - - var err error - if problemNum, err = strconv.Atoi(os.Args[1]); err != nil { - log.Fatalln(err) - } - } - - // 由于网络原因,有时候 signin 比较慢 - signin() - - if problemNum > 0 { - lc, err := readLeetCodeRecord() - if err != nil { - log.Fatalln("读取 LeetCode 记录失败: ", err) - } - makeProblemDir(lc.Problems, problemNum) - return - } - - categories := []string{ - "Algorithms", - // "database", - "Draft", - // "operating-system", - // "shell", - // "system-design", - } - - lc := update(categories) - - makeREADME(lc) - -} diff --git a/helper.v4/net.go b/helper.v4/net.go deleted file mode 100644 index 0d83624ce..000000000 --- a/helper.v4/net.go +++ /dev/null @@ -1,133 +0,0 @@ -package main - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "log" - "net/http" - "regexp" - "strings" - - "github.com/mozillazg/request" -) - -const ( - loginPageURL = "https://leetcode.com/accounts/login/" -) - -// req 带有 cookie ,用来请求 leetcode 上的个人数据 -var req *request.Request - -// 登录 leetcode -func signin() { - log.Println("正在登录中...") - - // 对 req 赋值 - req = request.NewRequest(new(http.Client)) - // 配置request - req.Headers = map[string]string{ - "Accept-Encoding": "", - "Referer": "https://leetcode.com/", - } - - // login - csrfToken, err := getCSRFToken(req) - if err != nil { - log.Fatal(err) - } - req.Data = map[string]string{ - "csrfmiddlewaretoken": csrfToken, - "login": cfg.Login, - "password": cfg.Password, - } - if err = login(req); err != nil { - log.Fatal(err) - } - log.Println("成功登录") -} - -func getData(name string) *data { - URL := url(name) - - raw := getRaw(URL) - - res := new(data) - if err := json.Unmarshal(raw, res); err != nil { - log.Fatal("无法把json转换成Category: " + err.Error()) - } - - return res -} - -func url(s string) string { - format := "https://leetcode.com/api/problems/%s/" - return fmt.Sprintf(format, s) -} - -func getRanking(username string) string { - URL := fmt.Sprintf("https://leetcode.com/%s/", username) - - data := getRaw(URL) - str := string(data) - i := strings.Index(str, "ng-init") - j := i + strings.Index(str[i:], "ng-cloak") - str = str[i:j] - - i = strings.Index(str, "(") - j = strings.Index(str, ")") - str = str[i:j] - - strs := strings.Split(str, ",") - ans := strs[5] - i = strings.Index(ans, "'") - j = 2 + strings.Index(ans[2:], "'") - - return ans[i+1 : j] -} - -func getRaw(URL string) []byte { - log.Printf("开始下载 %s 的数据", URL) - resp, err := req.Get(URL) - if err != nil { - log.Fatal("getRaw: Get Error: " + err.Error()) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - log.Fatal("getRaw: Read Error: " + err.Error()) - } - return body -} - -func getCSRFToken(req *request.Request) (string, error) { - resp, err := req.Get(loginPageURL) - if err != nil { - return "", err - } - s, err := resp.Text() - if err != nil { - return "", err - } - - reInput := regexp.MustCompile( - `]*?name=['"]csrfmiddlewaretoken['"'][^>]*>`, - ) - input := reInput.FindString(s) - reValue := regexp.MustCompile(`value=['"]([^'"]+)['"]`) - csrfToken := reValue.FindStringSubmatch(input) - if len(csrfToken) < 2 { - return "", err - } - return csrfToken[1], err -} - -func login(req *request.Request) error { - resp, err := req.Post(loginPageURL) - defer resp.Body.Close() // **Don't forget close the response body** - return err -} - -type config struct { - Login, Password string -} diff --git a/helper.v4/problem.go b/helper.v4/problem.go deleted file mode 100644 index 756f085cf..000000000 --- a/helper.v4/problem.go +++ /dev/null @@ -1,216 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "log" - "os" - "strings" - "syscall" - - "github.com/aQuaYi/GoKit" - - "github.com/PuerkitoBio/goquery" -) - -func makeProblemDir(ps problems, problemNum int) { - var pb problem - var isFound bool - - // 根据题号,获取题目信息 - for _, p := range ps { - if p.ID == problemNum { - pb = p - isFound = true - break - } - } - - if !isFound { - log.Printf("没有发现 %d 题,存在以下可能:1.此题不存在;2.需要付费;3.不在已关注的种类中。", problemNum) - return - } - - build(pb) -} - -func build(p problem) { - if p.IsAccepted && GoKit.Exist(p.Dir) { - log.Fatalf("第 %d 题已经accepted,请**删除**或**重命名** %s 文件夹后,再尝试。", p.ID, p.Dir) - } - - // 对于没有 accepted 的题目,直接删除重建 - if err := os.RemoveAll(p.Dir); err != nil { - log.Fatalln("无法删除目录", p.Dir) - } - - mask := syscall.Umask(0) - defer syscall.Umask(mask) - - err := os.Mkdir(p.Dir, 0755) - if err != nil { - log.Fatalf("无法创建目录,%s :%s", p.Dir, err) - } - - log.Printf("开始创建 %d %s 的文件夹...\n", p.ID, p.Title) - - creatREADME(p) - - fc, fcName, para, ans := getFunction(p.link()) - creatGo(p, fc) - creatGoTest(p, fcName, para, ans) - - log.Printf("%d.%s 的文件夹,创建完毕。\n", p.ID, p.Title) -} - -func creatREADME(p problem) { - fileFormat := `# [%d. %s](%s) - -## 题目 -%s - -## 解题思路 - -见程序注释 -` - - questionDescription := getQuestionDescription(p.link()) - - content := fmt.Sprintf(fileFormat, p.ID, p.Title, p.link(), questionDescription) - - filename := fmt.Sprintf("%s/README.md", p.Dir) - - err := ioutil.WriteFile(filename, []byte(content), 0755) - if err != nil { - log.Fatal(err) - } -} - -func getQuestionDescription(URL string) string { - doc, err := goquery.NewDocument(URL) - - if err != nil { - log.Fatal(err) - } - - return strings.TrimSpace(doc.Find("div.question-description").Text()) -} - -func getFunction(URL string) (fc, fcName, para, ansType string) { - data := getRaw(URL) - str := string(data) - - i := strings.Index(str, "codeDefinition:") - j := i + strings.Index(str[i:], "enableTestMode:") - str = str[i:j] - - i = strings.Index(str, "'Go', 'defaultCode': ") + 21 - j = i + strings.Index(str[i:], "},") - str = str[i:j] - - i = strings.Index(str, "func") - str = "'" + str[i:] - - // fmt.Println("getFunction: ", str) - - i = strings.Index(str, "'") - j = 5 + strings.Index(str[5:], "'") - fc = str[i+1 : j] - - k := 0 - i0 := strings.Index(fc, " ") - i = strings.Index(fc, "(") - fcName = fc[i0+1 : i] - - j = strings.Index(fc, ")") - k = strings.Index(fc, "{") - para = strings.Replace(fc[i+1:j], ",", "\n", -1) - ansType = fc[j+1 : k] - - fc = fc[:k] + "{\n\n}" - - return -} - -func creatGo(p problem, function string) { - fileFormat := `package %s - -%s -` - content := fmt.Sprintf(fileFormat, p.packageName(), function) - filename := fmt.Sprintf("%s/%s.go", p.Dir, p.TitleSlug) - - err := ioutil.WriteFile(filename, []byte(content), 0755) - if err != nil { - log.Fatal(err) - } -} - -func creatGoTest(p problem, fcName, para, ansType string) { - fileFormat := `package %s - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" -) - -func Test_%s(t *testing.T) { - ast := assert.New(t) - - // tcs is testcase slice - tcs := []struct { - %s - ans %s - }{ - - { - - , - }, - - // 可以多个 testcase - } - - for _, tc := range tcs { - fmt.Printf("~~%s~~\n", tc) - - ast.Equal(tc.ans, %s(%s), "输入:%s", tc) - } -} -` - tcPara := getTcPara(para) - - content := fmt.Sprintf(fileFormat, p.packageName(), p.packageName(), para, ansType, `%v`, fcName, tcPara, `%v`) - filename := fmt.Sprintf("%s/%s_test.go", p.Dir, p.TitleSlug) - - err := ioutil.WriteFile(filename, []byte(content), 0755) - if err != nil { - log.Fatal(err) - } -} - -// 把 函数的参数 变成 tc 的参数 -func getTcPara(para string) string { - // 把 para 按行切分 - paras := strings.Split(para, "\n") - - // 把单个参数按空格,切分成参数名和参数类型 - temp := make([][]string, len(paras)) - for i := range paras { - temp[i] = strings.Split(strings.TrimSpace(paras[i]), ` `) - } - - // 在参数名称前添加 "tc." 并组合在一起 - res := "" - for i := 0; i < len(temp); i++ { - res += ", tc." + temp[i][0] - } - - return res[2:] -} - -func (p problem) packageName() string { - return fmt.Sprintf("Problem%04d", p.ID) -} diff --git a/helper.v4/readme.go b/helper.v4/readme.go deleted file mode 100644 index ca044d46a..000000000 --- a/helper.v4/readme.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "log" - "os" -) - -func makeREADME(lc *leetcode) { - file := "README.md" - os.Remove(file) - - template := `%s - -## 答题进度:%d%% -> 仅含免费题 - -%s -## 参考解答 -%s - -%s -` - headFormat := string(read("README_HEAD.md")) - head := fmt.Sprintf(headFormat, lc.Username, lc.Username, lc.Ranking, lc.Username) - - // 没有提供 Golang 解答方法的题目 - canNotSolve := 2 - acceptedPercent := lc.Categories[len(lc.Categories)-1].Total.Solved * 100 / (lc.Categories[len(lc.Categories)-1].Total.Total - canNotSolve) - - count := lc.Categories.String() - - accepted := lc.Problems.acceptedString() - - tail := read("README_TAIL.md") - content := fmt.Sprintf(template, head, acceptedPercent, count, accepted, tail) - - err := ioutil.WriteFile(file, []byte(content), 0755) - if err != nil { - log.Fatal(err) - } -} diff --git a/helper.v4/util.go b/helper.v4/util.go deleted file mode 100644 index d748dc2ab..000000000 --- a/helper.v4/util.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "io/ioutil" - "os" -) - -func read(path string) []byte { - file, err := os.Open(path) - if err != nil { - panic(err) - } - defer file.Close() - - data, err := ioutil.ReadAll(file) - return data -} diff --git a/kit/Heap.go b/kit/Heap.go new file mode 100644 index 000000000..995ecafd2 --- /dev/null +++ b/kit/Heap.go @@ -0,0 +1,30 @@ +package kit + +// intHeap 实现了 heap 的接口 +type intHeap []int + +func (h intHeap) Len() int { + return len(h) +} + +func (h intHeap) Less(i, j int) bool { + return h[i] < h[j] +} + +func (h intHeap) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} + +func (h *intHeap) Push(x interface{}) { + // Push 使用 *h,是因为 + // Push 增加了 h 的长度 + *h = append(*h, x.(int)) +} + +func (h *intHeap) Pop() interface{} { + // Pop 使用 *h ,是因为 + // Pop 减短了 h 的长度 + res := (*h)[len(*h)-1] + *h = (*h)[:len(*h)-1] + return res +} diff --git a/kit/Heap_test.go b/kit/Heap_test.go new file mode 100644 index 000000000..bf4f29c11 --- /dev/null +++ b/kit/Heap_test.go @@ -0,0 +1,30 @@ +package kit + +import ( + "container/heap" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_intHeap(t *testing.T) { + ast := assert.New(t) + + ih := new(intHeap) + heap.Init(ih) + + heap.Push(ih, 1) + heap.Pop(ih) + + begin, end := 0, 10 + for i := begin; i < end; i++ { + heap.Push(ih, i) + ast.Equal(0, (*ih)[0], "插入 %d 后的最小值却是 %d,ih=%v", i, (*ih)[0], (*ih)) + } + + for i := begin; i < end; i++ { + fmt.Println(i, *ih) + ast.Equal(i, heap.Pop(ih), "Pop 后 ih=%v", (*ih)) + } +} diff --git a/kit/Interval.go b/kit/Interval.go new file mode 100644 index 000000000..30f2c9f74 --- /dev/null +++ b/kit/Interval.go @@ -0,0 +1,30 @@ +package kit + +// Interval 提供区间表示 +type Interval struct { + Start int + End int +} + +// Interval2Ints 把 Interval 转换成 整型切片 +func Interval2Ints(i Interval) []int { + return []int{i.Start, i.End} +} + +// IntervalSlice2Intss 把 []Interval 转换成 [][]int +func IntervalSlice2Intss(is []Interval) [][]int { + res := make([][]int, 0, len(is)) + for i := range is { + res = append(res, Interval2Ints(is[i])) + } + return res +} + +// Intss2IntervalSlice 把 [][]int 转换成 []Interval +func Intss2IntervalSlice(intss [][]int) []Interval { + res := make([]Interval, 0, len(intss)) + for _, ints := range intss { + res = append(res, Interval{Start: ints[0], End: ints[1]}) + } + return res +} diff --git a/kit/Interval_test.go b/kit/Interval_test.go new file mode 100644 index 000000000..87a562e6c --- /dev/null +++ b/kit/Interval_test.go @@ -0,0 +1,59 @@ +package kit + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Interval2Ints(t *testing.T) { + ast := assert.New(t) + + actual := Interval2Ints(Interval{Start: 1, End: 2}) + expected := []int{1, 2} + ast.Equal(expected, actual) +} + +func Test_IntervalSlice2Intss(t *testing.T) { + ast := assert.New(t) + + actual := IntervalSlice2Intss( + []Interval{ + Interval{ + Start: 1, + End: 2, + }, + Interval{ + Start: 3, + End: 4, + }, + }, + ) + expected := [][]int{ + []int{1, 2}, + []int{3, 4}, + } + + ast.Equal(expected, actual) +} +func Test_Intss2IntervalSlice(t *testing.T) { + ast := assert.New(t) + + expected := []Interval{ + Interval{ + Start: 1, + End: 2, + }, + Interval{ + Start: 3, + End: 4, + }, + } + actual := Intss2IntervalSlice([][]int{ + []int{1, 2}, + []int{3, 4}, + }, + ) + + ast.Equal(expected, actual) +} diff --git a/kit/ListNode.go b/kit/ListNode.go index 6a3f092c4..a908fbb7d 100644 --- a/kit/ListNode.go +++ b/kit/ListNode.go @@ -11,8 +11,8 @@ type ListNode struct { Next *ListNode } -// List2Slice convert List to []int -func List2Slice(head *ListNode) []int { +// List2Ints convert List to []int +func List2Ints(head *ListNode) []int { // 链条深度限制,链条深度超出此限制,会 panic limit := 100 @@ -33,23 +33,46 @@ func List2Slice(head *ListNode) []int { return res } -// Slice2List convert []int to List -func Slice2List(nums []int) *ListNode { - if len(nums) == 0 { - return nil - } - - res := &ListNode{ - Val: nums[0], +// Ints2List convert []int to List +func Ints2List(nums []int) *ListNode { + l := &ListNode{} + t := l + for _, v := range nums { + t.Next = &ListNode{Val: v} + t = t.Next } + return l.Next +} - temp := res - for i := 1; i < len(nums); i++ { - temp.Next = &ListNode{ - Val: nums[i], +// GetNodeWith returns the first node with val +func (l *ListNode) GetNodeWith(val int) *ListNode { + res := l + for res != nil { + if res.Val == val { + break } - temp = temp.Next + res = res.Next } - return res } + +// Ints2ListWithCycle returns a list whose tail point to pos-indexed node +// head's index is 0 +// if pos = -1, no cycle +func Ints2ListWithCycle(nums []int, pos int) *ListNode { + head := Ints2List(nums) + if pos == -1 { + return head + } + c := head + for pos > 0 { + c = c.Next + pos-- + } + tail := c + for tail.Next != nil { + tail = tail.Next + } + tail.Next = c + return head +} diff --git a/kit/ListNode_test.go b/kit/ListNode_test.go index ba673abf4..64cc2a020 100644 --- a/kit/ListNode_test.go +++ b/kit/ListNode_test.go @@ -8,7 +8,7 @@ import ( func Test_l2s(t *testing.T) { ast := assert.New(t) - ast.Equal([]int{}, List2Slice(nil), "输入nil,没有返回[]int{}") + ast.Equal([]int{}, List2Ints(nil), "输入nil,没有返回[]int{}") one2three := &ListNode{ Val: 1, @@ -19,23 +19,50 @@ func Test_l2s(t *testing.T) { }, }, } - ast.Equal([]int{1, 2, 3}, List2Slice(one2three), "没有成功地转换成[]int") + ast.Equal([]int{1, 2, 3}, List2Ints(one2three), "没有成功地转换成[]int") limit := 100 - overLimitList := Slice2List(make([]int, limit+1)) - ast.Panics(func() { List2Slice(overLimitList) }, "转换深度超过 %d 限制的链条,没有 panic", limit) + overLimitList := Ints2List(make([]int, limit+1)) + ast.Panics(func() { List2Ints(overLimitList) }, "转换深度超过 %d 限制的链条,没有 panic", limit) } func Test_s2l(t *testing.T) { ast := assert.New(t) - ast.Nil(Slice2List([]int{}), "输入[]int{},没有返回nil") + ast.Nil(Ints2List([]int{}), "输入[]int{},没有返回nil") - ln := Slice2List([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}) + ln := Ints2List([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}) i := 1 for ln != nil { ast.Equal(i, ln.Val, "对应的值不对") - ln = ln.Next i++ } } + +func Test_getNodeWith(t *testing.T) { + ast := assert.New(t) + // + ln := Ints2List([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}) + val := 10 + node := &ListNode{ + Val: val, + } + tail := ln + for tail.Next != nil { + tail = tail.Next + } + tail.Next = node + expected := node + actual := ln.GetNodeWith(val) + ast.Equal(expected, actual) +} + +func Test_Ints2ListWithCycle(t *testing.T) { + ast := assert.New(t) + ints := []int{1, 2, 3} + l := Ints2ListWithCycle(ints, -1) + ast.Equal(ints, List2Ints(l)) + + l = Ints2ListWithCycle(ints, 1) + ast.Panics(func() { List2Ints(l) }) +} diff --git a/kit/NestedInteger.go b/kit/NestedInteger.go new file mode 100644 index 000000000..7c5c657b1 --- /dev/null +++ b/kit/NestedInteger.go @@ -0,0 +1,37 @@ +package kit + +// NestedInteger is the interface that allows for creating nested lists. +// You should not implement it, or speculate about its implementation +type NestedInteger struct { + Num int + Ns []*NestedInteger +} + +// IsInteger Return true if this NestedInteger holds a single integer, rather than a nested list. +func (n NestedInteger) IsInteger() bool { + return n.Ns == nil +} + +// GetInteger Return the single integer that this NestedInteger holds, if it holds a single integer +// The result is undefined if this NestedInteger holds a nested list +// So before calling this method, you should have a check +func (n NestedInteger) GetInteger() int { + return n.Num +} + +// SetInteger Set this NestedInteger to hold a single integer. +func (n *NestedInteger) SetInteger(value int) { + n.Num = value +} + +// Add Set this NestedInteger to hold a nested list and adds a nested integer to it. +func (n *NestedInteger) Add(elem NestedInteger) { + n.Ns = append(n.Ns, &elem) +} + +// GetList Return the nested list that this NestedInteger holds, if it holds a nested list +// The list length is zero if this NestedInteger holds a single integer +// You can access NestedInteger's List element directly if you want to modify it +func (n NestedInteger) GetList() []*NestedInteger { + return n.Ns +} diff --git a/kit/NestedInterger_test.go b/kit/NestedInterger_test.go new file mode 100644 index 000000000..8ce2701ad --- /dev/null +++ b/kit/NestedInterger_test.go @@ -0,0 +1,30 @@ +package kit + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_NestedInteger(t *testing.T) { + ast := assert.New(t) + + n := NestedInteger{} + + ast.True(n.IsInteger()) + + n.SetInteger(1) + ast.Equal(1, n.GetInteger()) + + elem := NestedInteger{Num: 1} + + expected := NestedInteger{ + Num: 1, + Ns: []*NestedInteger{&elem}, + } + n.Add(elem) + + ast.Equal(expected, n) + + ast.Equal(expected.Ns, n.GetList()) +} diff --git a/kit/Point.go b/kit/Point.go new file mode 100644 index 000000000..2b0cfc810 --- /dev/null +++ b/kit/Point.go @@ -0,0 +1,27 @@ +package kit + +// Point 定义了一个二维坐标点 +type Point struct { + X, Y int +} + +// Intss2Points 把 [][]int 转换成 []Point +func Intss2Points(points [][]int) []Point { + res := make([]Point, len(points)) + for i, p := range points { + res[i] = Point{ + X: p[0], + Y: p[1], + } + } + return res +} + +// Points2Intss 把 []Point 转换成 [][]int +func Points2Intss(points []Point) [][]int { + res := make([][]int, len(points)) + for i, p := range points { + res[i] = []int{p.X, p.Y} + } + return res +} diff --git a/kit/Point_test.go b/kit/Point_test.go new file mode 100644 index 000000000..9a2ce89fc --- /dev/null +++ b/kit/Point_test.go @@ -0,0 +1,78 @@ +package kit + +import ( + "reflect" + "testing" +) + +func Test_Intss2Points(t *testing.T) { + type args struct { + points [][]int + } + tests := []struct { + name string + args args + want []Point + }{ + { + "测试 [][]int 转换成 []Point ", + args{ + [][]int{ + {1, 0}, + {2, 0}, + {3, 0}, + {4, 0}, + {5, 0}, + }, + }, + []Point{ + Point{X: 1, Y: 0}, + Point{X: 2, Y: 0}, + Point{X: 3, Y: 0}, + Point{X: 4, Y: 0}, + Point{X: 5, Y: 0}, + }, + }, + } + for _, tt := range tests { + if got := Intss2Points(tt.args.points); !reflect.DeepEqual(got, tt.want) { + t.Errorf("%q. intss2Points() = %v, want %v", tt.name, got, tt.want) + } + } +} + +func Test_Points2Intss(t *testing.T) { + type args struct { + points []Point + } + tests := []struct { + name string + args args + want [][]int + }{ + { + "测试 [][]int 转换成 []Point ", + args{ + []Point{ + Point{X: 1, Y: 0}, + Point{X: 2, Y: 0}, + Point{X: 3, Y: 0}, + Point{X: 4, Y: 0}, + Point{X: 5, Y: 0}, + }, + }, + [][]int{ + {1, 0}, + {2, 0}, + {3, 0}, + {4, 0}, + {5, 0}, + }, + }, + } + for _, tt := range tests { + if got := Points2Intss(tt.args.points); !reflect.DeepEqual(got, tt.want) { + t.Errorf("%q. Points2Intss() = %v, want %v", tt.name, got, tt.want) + } + } +} diff --git a/kit/PriorityQueue.go b/kit/PriorityQueue.go new file mode 100644 index 000000000..9177cf602 --- /dev/null +++ b/kit/PriorityQueue.go @@ -0,0 +1,54 @@ +package kit + +// This example demonstrates a priority queue built using the heap interface. + +import ( + "container/heap" +) + +// entry 是 priorityQueue 中的元素 +type entry struct { + key string + priority int + // index 是 entry 在 heap 中的索引号 + // entry 加入 Priority Queue 后, Priority 会变化时,很有用 + // 如果 entry.priority 一直不变的话,可以删除 index + index int +} + +// PQ implements heap.Interface and holds entries. +type PQ []*entry + +func (pq PQ) Len() int { return len(pq) } + +func (pq PQ) Less(i, j int) bool { + return pq[i].priority < pq[j].priority +} + +func (pq PQ) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +// Push 往 pq 中放 entry +func (pq *PQ) Push(x interface{}) { + temp := x.(*entry) + temp.index = len(*pq) + *pq = append(*pq, temp) +} + +// Pop 从 pq 中取出最优先的 entry +func (pq *PQ) Pop() interface{} { + temp := (*pq)[len(*pq)-1] + temp.index = -1 // for safety + *pq = (*pq)[0 : len(*pq)-1] + return temp +} + +// update modifies the priority and value of an entry in the queue. +func (pq *PQ) update(entry *entry, value string, priority int) { + entry.key = value + entry.priority = priority + heap.Fix(pq, entry.index) +} diff --git a/kit/PriorityQueue_test.go b/kit/PriorityQueue_test.go new file mode 100644 index 000000000..576a521f2 --- /dev/null +++ b/kit/PriorityQueue_test.go @@ -0,0 +1,53 @@ +package kit + +import ( + "container/heap" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_priorityQueue(t *testing.T) { + ast := assert.New(t) + + // Some items and their priorities. + items := map[string]int{ + "banana": 2, "apple": 1, "pear": 3, + } + + // Create a priority queue, put the items in it, and + // establish the priority queue (heap) invariants. + pq := make(PQ, len(items)) + i := 0 + for value, priority := range items { + pq[i] = &entry{ + key: value, + priority: priority, + index: i, + } + i++ + } + heap.Init(&pq) + + // Insert a new item and then modify its priority. + it := &entry{ + key: "orange", + priority: 5, + } + heap.Push(&pq, it) + pq.update(it, it.key, 0) + + // Some items and their priorities. + expected := []string{ + "orange", + "apple", + "banana", + "pear", + } + + // Take the items out; they arrive in decreasing priority order. + for pq.Len() > 0 { + it := heap.Pop(&pq).(*entry) + ast.Equal(expected[it.priority], it.key) + } +} diff --git a/kit/Queue.go b/kit/Queue.go new file mode 100644 index 000000000..495d39661 --- /dev/null +++ b/kit/Queue.go @@ -0,0 +1,33 @@ +package kit + +// Queue 是用于存放 int 的队列 +type Queue struct { + nums []int +} + +// NewQueue 返回 *kit.Queue +func NewQueue() *Queue { + return &Queue{nums: []int{}} +} + +// Push 把 n 放入队列 +func (q *Queue) Push(n int) { + q.nums = append(q.nums, n) +} + +// Pop 从 q 中取出最先进入队列的值 +func (q *Queue) Pop() int { + res := q.nums[0] + q.nums = q.nums[1:] + return res +} + +// Len 返回 q 的长度 +func (q *Queue) Len() int { + return len(q.nums) +} + +// IsEmpty 反馈 q 是否为空 +func (q *Queue) IsEmpty() bool { + return q.Len() == 0 +} diff --git a/kit/Queue_test.go b/kit/Queue_test.go new file mode 100644 index 000000000..8fac7eb20 --- /dev/null +++ b/kit/Queue_test.go @@ -0,0 +1,27 @@ +package kit + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Queue(t *testing.T) { + ast := assert.New(t) + + q := NewQueue() + ast.True(q.IsEmpty(), "检查新建的 q 是否为空") + + start, end := 0, 100 + + for i := start; i < end; i++ { + q.Push(i) + ast.Equal(i-start+1, q.Len(), "Push 后检查 q 的长度。") + } + + for i := start; i < end; i++ { + ast.Equal(i, q.Pop(), "从 q 中 pop 出数来。") + } + + ast.True(q.IsEmpty(), "检查 Pop 完毕后的 q 是否为空") +} diff --git a/kit/Stack.go b/kit/Stack.go new file mode 100644 index 000000000..39d150350 --- /dev/null +++ b/kit/Stack.go @@ -0,0 +1,33 @@ +package kit + +// Stack 是用于存放 int 的 栈 +type Stack struct { + nums []int +} + +// NewStack 返回 *kit.Stack +func NewStack() *Stack { + return &Stack{nums: []int{}} +} + +// Push 把 n 放入 栈 +func (s *Stack) Push(n int) { + s.nums = append(s.nums, n) +} + +// Pop 从 s 中取出最后放入 栈 的值 +func (s *Stack) Pop() int { + res := s.nums[len(s.nums)-1] + s.nums = s.nums[:len(s.nums)-1] + return res +} + +// Len 返回 s 的长度 +func (s *Stack) Len() int { + return len(s.nums) +} + +// IsEmpty 反馈 s 是否为空 +func (s *Stack) IsEmpty() bool { + return s.Len() == 0 +} diff --git a/kit/Stack_test.go b/kit/Stack_test.go new file mode 100644 index 000000000..e6ebdcc0d --- /dev/null +++ b/kit/Stack_test.go @@ -0,0 +1,27 @@ +package kit + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Stack(t *testing.T) { + ast := assert.New(t) + + s := NewStack() + ast.True(s.IsEmpty(), "检查新建的 s 是否为空") + + start, end := 0, 100 + + for i := start; i < end; i++ { + s.Push(i) + ast.Equal(i-start+1, s.Len(), "Push 后检查 q 的长度。") + } + + for i := end - 1; i >= start; i-- { + ast.Equal(i, s.Pop(), "从 s 中 pop 出数来。") + } + + ast.True(s.IsEmpty(), "检查 Pop 完毕后的 s 是否为空") +} diff --git a/kit/TreeNode.go b/kit/TreeNode.go index a3c7f66c9..3e8c7bb99 100644 --- a/kit/TreeNode.go +++ b/kit/TreeNode.go @@ -11,6 +11,58 @@ type TreeNode struct { Right *TreeNode } +// NULL 方便添加测试数据 +var NULL = -1 << 63 + +// Ints2TreeNode 利用 []int 生成 *TreeNode +func Ints2TreeNode(ints []int) *TreeNode { + n := len(ints) + if n == 0 { + return nil + } + + root := &TreeNode{ + Val: ints[0], + } + + queue := make([]*TreeNode, 1, n*2) + queue[0] = root + + i := 1 + for i < n { + node := queue[0] + queue = queue[1:] + + if i < n && ints[i] != NULL { + node.Left = &TreeNode{Val: ints[i]} + queue = append(queue, node.Left) + } + i++ + + if i < n && ints[i] != NULL { + node.Right = &TreeNode{Val: ints[i]} + queue = append(queue, node.Right) + } + i++ + } + + return root +} + +// GetTargetNode 返回 Val = target 的 TreeNode +// root 中一定有 node.Val = target +func GetTargetNode(root *TreeNode, target int) *TreeNode { + if root == nil || root.Val == target { + return root + } + + res := GetTargetNode(root.Left, target) + if res != nil { + return res + } + return GetTargetNode(root.Right, target) +} + func indexOf(val int, nums []int) int { for i, v := range nums { if v == val { @@ -124,3 +176,44 @@ func Tree2Postorder(root *TreeNode) []int { return res } + +// Equal return ture if tn == a +func (tn *TreeNode) Equal(a *TreeNode) bool { + if tn == nil && a == nil { + return true + } + + if tn == nil || a == nil || tn.Val != a.Val { + return false + } + + return tn.Left.Equal(a.Left) && tn.Right.Equal(a.Right) +} + +// Tree2ints 把 *TreeNode 按照行还原成 []int +func Tree2ints(tn *TreeNode) []int { + res := make([]int, 0, 1024) + + queue := []*TreeNode{tn} + + for len(queue) > 0 { + size := len(queue) + for i := 0; i < size; i++ { + nd := queue[i] + if nd == nil { + res = append(res, NULL) + } else { + res = append(res, nd.Val) + queue = append(queue, nd.Left, nd.Right) + } + } + queue = queue[size:] + } + + i := len(res) + for i > 0 && res[i-1] == NULL { + i-- + } + + return res[:i] +} diff --git a/kit/TreeNode_test.go b/kit/TreeNode_test.go index bf61e5ca8..ab5d15a2d 100644 --- a/kit/TreeNode_test.go +++ b/kit/TreeNode_test.go @@ -1,17 +1,36 @@ package kit import ( + "reflect" "testing" "github.com/stretchr/testify/assert" ) var ( - preOrder = []int{1, 2, 4, 5, 3, 6, 7} - inOrder = []int{4, 2, 5, 1, 6, 3, 7} - postOrder = []int{4, 5, 2, 6, 7, 3, 1} + // 同一个 TreeNode 的不同表达方式 + // 1 + // / \ + // 2 3 + // / \ / \ + // 4 5 6 7 + LeetCodeOrder = []int{1, 2, 3, 4, 5, 6, 7} + preOrder = []int{1, 2, 4, 5, 3, 6, 7} + inOrder = []int{4, 2, 5, 1, 6, 3, 7} + postOrder = []int{4, 5, 2, 6, 7, 3, 1} ) +func Test_Ints2TreeNode(t *testing.T) { + ast := assert.New(t) + + expected := PreIn2Tree(preOrder, inOrder) + actual := Ints2TreeNode(LeetCodeOrder) + ast.Equal(expected, actual) + + actual = Ints2TreeNode([]int{}) + ast.Nil(actual) +} + func Test_preIn2Tree(t *testing.T) { ast := assert.New(t) @@ -57,3 +76,91 @@ func Test_indexOf(t *testing.T) { ast.Panics(func() { indexOf(0, []int{1, 2, 3}) }) } + +func Test_TreeNode_Equal(t *testing.T) { + type args struct { + a *TreeNode + } + tests := []struct { + name string + fields args + args args + want bool + }{ + + { + "相等", + args{Ints2TreeNode([]int{1, 2, 3, 4, 5})}, + args{Ints2TreeNode([]int{1, 2, 3, 4, 5})}, + true, + }, + + { + "不相等", + args{Ints2TreeNode([]int{1, 2, 3, 4, 5})}, + args{Ints2TreeNode([]int{1, 2, 3, NULL, 5})}, + false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tn := tt.fields.a + if got := tn.Equal(tt.args.a); got != tt.want { + t.Errorf("TreeNode.Equal() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_GetTargetNode(t *testing.T) { + ints := []int{3, 5, 1, 6, 2, 0, 8, NULL, NULL, 7, 4} + root := Ints2TreeNode(ints) + + type args struct { + root *TreeNode + target int + } + tests := []struct { + name string + args args + want *TreeNode + }{ + + { + "找到 root.Right.Right", + args{ + root: root, + target: 8, + }, + root.Right.Right, + }, + + { + "找到 root.Left.Left", + args{ + root: root, + target: 6, + }, + root.Left.Left, + }, + + // + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := GetTargetNode(tt.args.root, tt.args.target); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetTargetNode() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_Tree2ints(t *testing.T) { + ast := assert.New(t) + + root := PreIn2Tree(preOrder, inOrder) + actual := LeetCodeOrder + expected := Tree2ints(root) + ast.Equal(expected, actual) +} diff --git a/kit/master.go b/kit/master.go new file mode 100644 index 000000000..b94c38197 --- /dev/null +++ b/kit/master.go @@ -0,0 +1,38 @@ +package kit + +// Master 是 LeetCode 的结构体 +type Master struct { + Secret string + WordList []string + IsInWords map[string]bool + Count int +} + +// Guess word +func (m *Master) Guess(word string) int { + m.Count-- + if !m.IsInWords[word] { + return -1 + } + return matches(m.Secret, word) +} + +// a,b 总是一样长的 +func matches(a, b string) int { + size := len(a) + res := 0 + for i := 0; i < size; i++ { + if a[i] == b[i] { + res++ + } + } + return res +} + +// Update 更新了 m.IsInWords +func (m *Master) Update() { + m.IsInWords = make(map[string]bool, len(m.WordList)) + for _, w := range m.WordList { + m.IsInWords[w] = true + } +} diff --git a/kit/master_test.go b/kit/master_test.go new file mode 100644 index 000000000..1d57c4597 --- /dev/null +++ b/kit/master_test.go @@ -0,0 +1,170 @@ +package kit + +import ( + "testing" +) + +func Test_matches(t *testing.T) { + type args struct { + a string + b string + } + tests := []struct { + name string + args args + want int + }{ + + { + "没有一个字母一样", + args{ + "aaaaaaa", + "bbbbbbb", + }, + 0, + }, + + { + "a 和 b 只有 1 个字母一样", + args{ + "aaaaaaa", + "bbbbbba", + }, + 1, + }, + + { + "a 和 b 只有 2 个字母一样", + args{ + "aaaaaaa", + "bbbbbaa", + }, + 2, + }, + + { + "a 和 b 只有 3 个字母一样", + args{ + "aaaaaaa", + "bbbbaaa", + }, + 3, + }, + + { + "a 和 b 只有 4 个字母一样", + args{ + "aaaaaaa", + "bbbaaaa", + }, + 4, + }, + + { + "a 和 b 只有 5 个字母一样", + args{ + "aaaaaaa", + "bbaaaaa", + }, + 5, + }, + + { + "a 和 b 只有 6 个字母一样", + args{ + "aaaaaaa", + "baaaaaa", + }, + 6, + }, + + { + "一样的 a 和 b", + args{ + "aaaaaaa", + "aaaaaaa", + }, + 7, + }, + + // 添加参数 + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := matches(tt.args.a, tt.args.b); got != tt.want { + t.Errorf("matches() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestMaster_Guess(t *testing.T) { + m := &Master{ + Secret: "acckzz", + WordList: []string{"acckzz", "ccbazz", "eiowzz", "abcczz"}, + Count: 5, + } + + m.Update() + + tests := []struct { + name string + m *Master + word string + want int + count int + }{ + + { + "猜中了", + m, + "acckzz", + 6, + 4, + }, + + { + "猜 word list 中的单词", + m, + "aaaaaa", + -1, + 3, + }, + + { + "猜中了 3 个字母", + m, + "ccbazz", + 3, + 2, + }, + + { + "猜中了 2 个字母", + m, + "eiowzz", + 2, + 1, + }, + + { + "猜中了 4 个字母", + m, + "abcczz", + 4, + 0, + }, + + // 添加参数 + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.m.Guess(tt.word); got != tt.want { + t.Errorf("Master.Guess() = %v, want %v", got, tt.want) + } + if tt.m.Count != tt.count { + t.Errorf("tt.m.Count = %v, but tt.count = %v", tt.m.Count, tt.count) + } + }) + } +} diff --git a/leetcode.json b/leetcode.json index 06e2faa57..2d293697a 100644 --- a/leetcode.json +++ b/leetcode.json @@ -1 +1,15037 @@ -{"Username":"aQuaYi","Ranking":35576,"Categories":[{"Name":"Algorithms","Easy":{"Solved":53,"Total":145},"Medium":{"Solved":84,"Total":250},"Hard":{"Solved":32,"Total":93},"Total":{"Solved":169,"Total":488}},{"Name":"Draft","Easy":{"Solved":0,"Total":1},"Medium":{"Solved":0,"Total":3},"Hard":{"Solved":0,"Total":0},"Total":{"Solved":0,"Total":4}},{"Name":"Total","Easy":{"Solved":53,"Total":146},"Medium":{"Solved":84,"Total":253},"Hard":{"Solved":32,"Total":93},"Total":{"Solved":169,"Total":492}}],"Problems":[{"ID":1,"Dir":"./Algorithms/0001.two-sum","Title":"Two Sum","TitleSlug":"two-sum","PassRate":"35%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":2,"Dir":"./Algorithms/0002.add-two-numbers","Title":"Add Two Numbers","TitleSlug":"add-two-numbers","PassRate":"27%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":3,"Dir":"./Algorithms/0003.longest-substring-without-repeating-characters","Title":"Longest Substring Without Repeating Characters","TitleSlug":"longest-substring-without-repeating-characters","PassRate":"24%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":4,"Dir":"./Algorithms/0004.median-of-two-sorted-arrays","Title":"Median of Two Sorted Arrays","TitleSlug":"median-of-two-sorted-arrays","PassRate":"21%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":5,"Dir":"./Algorithms/0005.longest-palindromic-substring","Title":"Longest Palindromic Substring","TitleSlug":"longest-palindromic-substring","PassRate":"25%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":6,"Dir":"./Algorithms/0006.zigzag-conversion","Title":"ZigZag Conversion","TitleSlug":"zigzag-conversion","PassRate":"26%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":7,"Dir":"./Algorithms/0007.reverse-integer","Title":"Reverse Integer","TitleSlug":"reverse-integer","PassRate":"24%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":8,"Dir":"./Algorithms/0008.string-to-integer-atoi","Title":"String to Integer (atoi)","TitleSlug":"string-to-integer-atoi","PassRate":"13%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":9,"Dir":"./Algorithms/0009.palindrome-number","Title":"Palindrome Number","TitleSlug":"palindrome-number","PassRate":"35%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":10,"Dir":"./Algorithms/0010.regular-expression-matching","Title":"Regular Expression Matching","TitleSlug":"regular-expression-matching","PassRate":"24%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":11,"Dir":"./Algorithms/0011.container-with-most-water","Title":"Container With Most Water","TitleSlug":"container-with-most-water","PassRate":"36%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":12,"Dir":"./Algorithms/0012.integer-to-roman","Title":"Integer to Roman","TitleSlug":"integer-to-roman","PassRate":"45%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":13,"Dir":"./Algorithms/0013.roman-to-integer","Title":"Roman to Integer","TitleSlug":"roman-to-integer","PassRate":"46%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":14,"Dir":"./Algorithms/0014.longest-common-prefix","Title":"Longest Common Prefix","TitleSlug":"longest-common-prefix","PassRate":"31%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":15,"Dir":"./Algorithms/0015.3sum","Title":"3Sum","TitleSlug":"3sum","PassRate":"21%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":16,"Dir":"./Algorithms/0016.3sum-closest","Title":"3Sum Closest","TitleSlug":"3sum-closest","PassRate":"31%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":17,"Dir":"./Algorithms/0017.letter-combinations-of-a-phone-number","Title":"Letter Combinations of a Phone Number","TitleSlug":"letter-combinations-of-a-phone-number","PassRate":"34%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":18,"Dir":"./Algorithms/0018.4sum","Title":"4Sum","TitleSlug":"4sum","PassRate":"26%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":19,"Dir":"./Algorithms/0019.remove-nth-node-from-end-of-list","Title":"Remove Nth Node From End of List","TitleSlug":"remove-nth-node-from-end-of-list","PassRate":"33%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":20,"Dir":"./Algorithms/0020.valid-parentheses","Title":"Valid Parentheses","TitleSlug":"valid-parentheses","PassRate":"33%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":21,"Dir":"./Algorithms/0021.merge-two-sorted-lists","Title":"Merge Two Sorted Lists","TitleSlug":"merge-two-sorted-lists","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":22,"Dir":"./Algorithms/0022.generate-parentheses","Title":"Generate Parentheses","TitleSlug":"generate-parentheses","PassRate":"45%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":23,"Dir":"./Algorithms/0023.merge-k-sorted-lists","Title":"Merge k Sorted Lists","TitleSlug":"merge-k-sorted-lists","PassRate":"27%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":24,"Dir":"./Algorithms/0024.swap-nodes-in-pairs","Title":"Swap Nodes in Pairs","TitleSlug":"swap-nodes-in-pairs","PassRate":"38%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":25,"Dir":"./Algorithms/0025.reverse-nodes-in-k-group","Title":"Reverse Nodes in k-Group","TitleSlug":"reverse-nodes-in-k-group","PassRate":"30%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":26,"Dir":"./Algorithms/0026.remove-duplicates-from-sorted-array","Title":"Remove Duplicates from Sorted Array","TitleSlug":"remove-duplicates-from-sorted-array","PassRate":"35%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":27,"Dir":"./Algorithms/0027.remove-element","Title":"Remove Element","TitleSlug":"remove-element","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":28,"Dir":"./Algorithms/0028.implement-strstr","Title":"Implement strStr()","TitleSlug":"implement-strstr","PassRate":"28%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":29,"Dir":"./Algorithms/0029.divide-two-integers","Title":"Divide Two Integers","TitleSlug":"divide-two-integers","PassRate":"15%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":30,"Dir":"./Algorithms/0030.substring-with-concatenation-of-all-words","Title":"Substring with Concatenation of All Words","TitleSlug":"substring-with-concatenation-of-all-words","PassRate":"22%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":31,"Dir":"./Algorithms/0031.next-permutation","Title":"Next Permutation","TitleSlug":"next-permutation","PassRate":"28%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":32,"Dir":"./Algorithms/0032.longest-valid-parentheses","Title":"Longest Valid Parentheses","TitleSlug":"longest-valid-parentheses","PassRate":"23%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":33,"Dir":"./Algorithms/0033.search-in-rotated-sorted-array","Title":"Search in Rotated Sorted Array","TitleSlug":"search-in-rotated-sorted-array","PassRate":"32%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":34,"Dir":"./Algorithms/0034.search-for-a-range","Title":"Search for a Range","TitleSlug":"search-for-a-range","PassRate":"31%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":35,"Dir":"./Algorithms/0035.search-insert-position","Title":"Search Insert Position","TitleSlug":"search-insert-position","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":36,"Dir":"./Algorithms/0036.valid-sudoku","Title":"Valid Sudoku","TitleSlug":"valid-sudoku","PassRate":"35%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":37,"Dir":"./Algorithms/0037.sudoku-solver","Title":"Sudoku Solver","TitleSlug":"sudoku-solver","PassRate":"30%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":38,"Dir":"./Algorithms/0038.count-and-say","Title":"Count and Say","TitleSlug":"count-and-say","PassRate":"34%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":39,"Dir":"./Algorithms/0039.combination-sum","Title":"Combination Sum","TitleSlug":"combination-sum","PassRate":"39%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":40,"Dir":"./Algorithms/0040.combination-sum-ii","Title":"Combination Sum II","TitleSlug":"combination-sum-ii","PassRate":"34%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":41,"Dir":"./Algorithms/0041.first-missing-positive","Title":"First Missing Positive","TitleSlug":"first-missing-positive","PassRate":"25%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":42,"Dir":"./Algorithms/0042.trapping-rain-water","Title":"Trapping Rain Water","TitleSlug":"trapping-rain-water","PassRate":"36%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":43,"Dir":"./Algorithms/0043.multiply-strings","Title":"Multiply Strings","TitleSlug":"multiply-strings","PassRate":"27%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":44,"Dir":"./Algorithms/0044.wildcard-matching","Title":"Wildcard Matching","TitleSlug":"wildcard-matching","PassRate":"20%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":45,"Dir":"./Algorithms/0045.jump-game-ii","Title":"Jump Game II","TitleSlug":"jump-game-ii","PassRate":"26%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":46,"Dir":"./Algorithms/0046.permutations","Title":"Permutations","TitleSlug":"permutations","PassRate":"44%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":47,"Dir":"./Algorithms/0047.permutations-ii","Title":"Permutations II","TitleSlug":"permutations-ii","PassRate":"33%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":48,"Dir":"./Algorithms/0048.rotate-image","Title":"Rotate Image","TitleSlug":"rotate-image","PassRate":"38%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":49,"Dir":"./Algorithms/0049.group-anagrams","Title":"Group Anagrams","TitleSlug":"group-anagrams","PassRate":"35%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":50,"Dir":"./Algorithms/0050.powx-n","Title":"Pow(x, n)","TitleSlug":"powx-n","PassRate":"26%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":51,"Dir":"./Algorithms/0051.n-queens","Title":"N-Queens","TitleSlug":"n-queens","PassRate":"31%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":52,"Dir":"./Algorithms/0052.n-queens-ii","Title":"N-Queens II","TitleSlug":"n-queens-ii","PassRate":"45%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":53,"Dir":"./Algorithms/0053.maximum-subarray","Title":"Maximum Subarray","TitleSlug":"maximum-subarray","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":54,"Dir":"./Algorithms/0054.spiral-matrix","Title":"Spiral Matrix","TitleSlug":"spiral-matrix","PassRate":"26%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":55,"Dir":"./Algorithms/0055.jump-game","Title":"Jump Game","TitleSlug":"jump-game","PassRate":"29%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":56,"Dir":"./Algorithms/0056.merge-intervals","Title":"Merge Intervals","TitleSlug":"merge-intervals","PassRate":"30%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":57,"Dir":"./Algorithms/0057.insert-interval","Title":"Insert Interval","TitleSlug":"insert-interval","PassRate":"27%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":58,"Dir":"./Algorithms/0058.length-of-last-word","Title":"Length of Last Word","TitleSlug":"length-of-last-word","PassRate":"31%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":59,"Dir":"./Algorithms/0059.spiral-matrix-ii","Title":"Spiral Matrix II","TitleSlug":"spiral-matrix-ii","PassRate":"39%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":60,"Dir":"./Algorithms/0060.permutation-sequence","Title":"Permutation Sequence","TitleSlug":"permutation-sequence","PassRate":"28%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":61,"Dir":"./Algorithms/0061.rotate-list","Title":"Rotate List","TitleSlug":"rotate-list","PassRate":"24%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":62,"Dir":"./Algorithms/0062.unique-paths","Title":"Unique Paths","TitleSlug":"unique-paths","PassRate":"41%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":63,"Dir":"./Algorithms/0063.unique-paths-ii","Title":"Unique Paths II","TitleSlug":"unique-paths-ii","PassRate":"31%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":64,"Dir":"./Algorithms/0064.minimum-path-sum","Title":"Minimum Path Sum","TitleSlug":"minimum-path-sum","PassRate":"38%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":65,"Dir":"./Algorithms/0065.valid-number","Title":"Valid Number","TitleSlug":"valid-number","PassRate":"12%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":66,"Dir":"./Algorithms/0066.plus-one","Title":"Plus One","TitleSlug":"plus-one","PassRate":"38%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":67,"Dir":"./Algorithms/0067.add-binary","Title":"Add Binary","TitleSlug":"add-binary","PassRate":"32%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":68,"Dir":"./Algorithms/0068.text-justification","Title":"Text Justification","TitleSlug":"text-justification","PassRate":"19%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":69,"Dir":"./Algorithms/0069.sqrtx","Title":"Sqrt(x)","TitleSlug":"sqrtx","PassRate":"27%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":70,"Dir":"./Algorithms/0070.climbing-stairs","Title":"Climbing Stairs","TitleSlug":"climbing-stairs","PassRate":"40%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":71,"Dir":"./Algorithms/0071.simplify-path","Title":"Simplify Path","TitleSlug":"simplify-path","PassRate":"25%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":72,"Dir":"./Algorithms/0072.edit-distance","Title":"Edit Distance","TitleSlug":"edit-distance","PassRate":"31%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":73,"Dir":"./Algorithms/0073.set-matrix-zeroes","Title":"Set Matrix Zeroes","TitleSlug":"set-matrix-zeroes","PassRate":"35%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":74,"Dir":"./Algorithms/0074.search-a-2d-matrix","Title":"Search a 2D Matrix","TitleSlug":"search-a-2d-matrix","PassRate":"34%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":75,"Dir":"./Algorithms/0075.sort-colors","Title":"Sort Colors","TitleSlug":"sort-colors","PassRate":"38%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":76,"Dir":"./Algorithms/0076.minimum-window-substring","Title":"Minimum Window Substring","TitleSlug":"minimum-window-substring","PassRate":"25%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":77,"Dir":"./Algorithms/0077.combinations","Title":"Combinations","TitleSlug":"combinations","PassRate":"39%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":78,"Dir":"./Algorithms/0078.subsets","Title":"Subsets","TitleSlug":"subsets","PassRate":"41%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":79,"Dir":"./Algorithms/0079.word-search","Title":"Word Search","TitleSlug":"word-search","PassRate":"26%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":80,"Dir":"./Algorithms/0080.remove-duplicates-from-sorted-array-ii","Title":"Remove Duplicates from Sorted Array II","TitleSlug":"remove-duplicates-from-sorted-array-ii","PassRate":"36%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":81,"Dir":"./Algorithms/0081.search-in-rotated-sorted-array-ii","Title":"Search in Rotated Sorted Array II","TitleSlug":"search-in-rotated-sorted-array-ii","PassRate":"32%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":82,"Dir":"./Algorithms/0082.remove-duplicates-from-sorted-list-ii","Title":"Remove Duplicates from Sorted List II","TitleSlug":"remove-duplicates-from-sorted-list-ii","PassRate":"29%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":83,"Dir":"./Algorithms/0083.remove-duplicates-from-sorted-list","Title":"Remove Duplicates from Sorted List","TitleSlug":"remove-duplicates-from-sorted-list","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":84,"Dir":"./Algorithms/0084.largest-rectangle-in-histogram","Title":"Largest Rectangle in Histogram","TitleSlug":"largest-rectangle-in-histogram","PassRate":"26%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":85,"Dir":"./Algorithms/0085.maximal-rectangle","Title":"Maximal Rectangle","TitleSlug":"maximal-rectangle","PassRate":"28%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":86,"Dir":"./Algorithms/0086.partition-list","Title":"Partition List","TitleSlug":"partition-list","PassRate":"32%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":87,"Dir":"./Algorithms/0087.scramble-string","Title":"Scramble String","TitleSlug":"scramble-string","PassRate":"29%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":88,"Dir":"./Algorithms/0088.merge-sorted-array","Title":"Merge Sorted Array","TitleSlug":"merge-sorted-array","PassRate":"32%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":89,"Dir":"./Algorithms/0089.gray-code","Title":"Gray Code","TitleSlug":"gray-code","PassRate":"41%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":90,"Dir":"./Algorithms/0090.subsets-ii","Title":"Subsets II","TitleSlug":"subsets-ii","PassRate":"36%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":91,"Dir":"./Algorithms/0091.decode-ways","Title":"Decode Ways","TitleSlug":"decode-ways","PassRate":"19%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":92,"Dir":"./Algorithms/0092.reverse-linked-list-ii","Title":"Reverse Linked List II","TitleSlug":"reverse-linked-list-ii","PassRate":"30%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":93,"Dir":"./Algorithms/0093.restore-ip-addresses","Title":"Restore IP Addresses","TitleSlug":"restore-ip-addresses","PassRate":"27%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":94,"Dir":"./Algorithms/0094.binary-tree-inorder-traversal","Title":"Binary Tree Inorder Traversal","TitleSlug":"binary-tree-inorder-traversal","PassRate":"46%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":95,"Dir":"./Algorithms/0095.unique-binary-search-trees-ii","Title":"Unique Binary Search Trees II","TitleSlug":"unique-binary-search-trees-ii","PassRate":"31%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":96,"Dir":"./Algorithms/0096.unique-binary-search-trees","Title":"Unique Binary Search Trees","TitleSlug":"unique-binary-search-trees","PassRate":"41%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":97,"Dir":"./Algorithms/0097.interleaving-string","Title":"Interleaving String","TitleSlug":"interleaving-string","PassRate":"24%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":98,"Dir":"./Algorithms/0098.validate-binary-search-tree","Title":"Validate Binary Search Tree","TitleSlug":"validate-binary-search-tree","PassRate":"23%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":99,"Dir":"./Algorithms/0099.recover-binary-search-tree","Title":"Recover Binary Search Tree","TitleSlug":"recover-binary-search-tree","PassRate":"29%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":100,"Dir":"./Algorithms/0100.same-tree","Title":"Same Tree","TitleSlug":"same-tree","PassRate":"46%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":101,"Dir":"./Algorithms/0101.symmetric-tree","Title":"Symmetric Tree","TitleSlug":"symmetric-tree","PassRate":"38%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":102,"Dir":"./Algorithms/0102.binary-tree-level-order-traversal","Title":"Binary Tree Level Order Traversal","TitleSlug":"binary-tree-level-order-traversal","PassRate":"40%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":103,"Dir":"./Algorithms/0103.binary-tree-zigzag-level-order-traversal","Title":"Binary Tree Zigzag Level Order Traversal","TitleSlug":"binary-tree-zigzag-level-order-traversal","PassRate":"34%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":104,"Dir":"./Algorithms/0104.maximum-depth-of-binary-tree","Title":"Maximum Depth of Binary Tree","TitleSlug":"maximum-depth-of-binary-tree","PassRate":"52%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":105,"Dir":"./Algorithms/0105.construct-binary-tree-from-preorder-and-inorder-traversal","Title":"Construct Binary Tree from Preorder and Inorder Traversal","TitleSlug":"construct-binary-tree-from-preorder-and-inorder-traversal","PassRate":"32%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":106,"Dir":"./Algorithms/0106.construct-binary-tree-from-inorder-and-postorder-traversal","Title":"Construct Binary Tree from Inorder and Postorder Traversal","TitleSlug":"construct-binary-tree-from-inorder-and-postorder-traversal","PassRate":"32%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":107,"Dir":"./Algorithms/0107.binary-tree-level-order-traversal-ii","Title":"Binary Tree Level Order Traversal II","TitleSlug":"binary-tree-level-order-traversal-ii","PassRate":"40%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":108,"Dir":"./Algorithms/0108.convert-sorted-array-to-binary-search-tree","Title":"Convert Sorted Array to Binary Search Tree","TitleSlug":"convert-sorted-array-to-binary-search-tree","PassRate":"42%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":109,"Dir":"./Algorithms/0109.convert-sorted-list-to-binary-search-tree","Title":"Convert Sorted List to Binary Search Tree","TitleSlug":"convert-sorted-list-to-binary-search-tree","PassRate":"34%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":110,"Dir":"./Algorithms/0110.balanced-binary-tree","Title":"Balanced Binary Tree","TitleSlug":"balanced-binary-tree","PassRate":"37%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":111,"Dir":"./Algorithms/0111.minimum-depth-of-binary-tree","Title":"Minimum Depth of Binary Tree","TitleSlug":"minimum-depth-of-binary-tree","PassRate":"33%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":112,"Dir":"./Algorithms/0112.path-sum","Title":"Path Sum","TitleSlug":"path-sum","PassRate":"34%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":113,"Dir":"./Algorithms/0113.path-sum-ii","Title":"Path Sum II","TitleSlug":"path-sum-ii","PassRate":"33%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":114,"Dir":"./Algorithms/0114.flatten-binary-tree-to-linked-list","Title":"Flatten Binary Tree to Linked List","TitleSlug":"flatten-binary-tree-to-linked-list","PassRate":"35%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":115,"Dir":"./Algorithms/0115.distinct-subsequences","Title":"Distinct Subsequences","TitleSlug":"distinct-subsequences","PassRate":"31%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":116,"Dir":"./Algorithms/0116.populating-next-right-pointers-in-each-node","Title":"Populating Next Right Pointers in Each Node","TitleSlug":"populating-next-right-pointers-in-each-node","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":117,"Dir":"./Algorithms/0117.populating-next-right-pointers-in-each-node-ii","Title":"Populating Next Right Pointers in Each Node II","TitleSlug":"populating-next-right-pointers-in-each-node-ii","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":118,"Dir":"./Algorithms/0118.pascals-triangle","Title":"Pascal's Triangle","TitleSlug":"pascals-triangle","PassRate":"38%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":119,"Dir":"./Algorithms/0119.pascals-triangle-ii","Title":"Pascal's Triangle II","TitleSlug":"pascals-triangle-ii","PassRate":"37%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":120,"Dir":"./Algorithms/0120.triangle","Title":"Triangle","TitleSlug":"triangle","PassRate":"33%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":121,"Dir":"./Algorithms/0121.best-time-to-buy-and-sell-stock","Title":"Best Time to Buy and Sell Stock","TitleSlug":"best-time-to-buy-and-sell-stock","PassRate":"41%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":122,"Dir":"./Algorithms/0122.best-time-to-buy-and-sell-stock-ii","Title":"Best Time to Buy and Sell Stock II","TitleSlug":"best-time-to-buy-and-sell-stock-ii","PassRate":"47%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":123,"Dir":"./Algorithms/0123.best-time-to-buy-and-sell-stock-iii","Title":"Best Time to Buy and Sell Stock III","TitleSlug":"best-time-to-buy-and-sell-stock-iii","PassRate":"29%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":124,"Dir":"./Algorithms/0124.binary-tree-maximum-path-sum","Title":"Binary Tree Maximum Path Sum","TitleSlug":"binary-tree-maximum-path-sum","PassRate":"26%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":125,"Dir":"./Algorithms/0125.valid-palindrome","Title":"Valid Palindrome","TitleSlug":"valid-palindrome","PassRate":"26%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":126,"Dir":"./Algorithms/0126.word-ladder-ii","Title":"Word Ladder II","TitleSlug":"word-ladder-ii","PassRate":"14%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":127,"Dir":"./Algorithms/0127.word-ladder","Title":"Word Ladder","TitleSlug":"word-ladder","PassRate":"19%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":128,"Dir":"./Algorithms/0128.longest-consecutive-sequence","Title":"Longest Consecutive Sequence","TitleSlug":"longest-consecutive-sequence","PassRate":"37%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":129,"Dir":"./Algorithms/0129.sum-root-to-leaf-numbers","Title":"Sum Root to Leaf Numbers","TitleSlug":"sum-root-to-leaf-numbers","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":130,"Dir":"./Algorithms/0130.surrounded-regions","Title":"Surrounded Regions","TitleSlug":"surrounded-regions","PassRate":"18%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":131,"Dir":"./Algorithms/0131.palindrome-partitioning","Title":"Palindrome Partitioning","TitleSlug":"palindrome-partitioning","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":132,"Dir":"./Algorithms/0132.palindrome-partitioning-ii","Title":"Palindrome Partitioning II","TitleSlug":"palindrome-partitioning-ii","PassRate":"24%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":133,"Dir":"./Algorithms/0133.clone-graph","Title":"Clone Graph","TitleSlug":"clone-graph","PassRate":"25%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":134,"Dir":"./Algorithms/0134.gas-station","Title":"Gas Station","TitleSlug":"gas-station","PassRate":"29%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":135,"Dir":"./Algorithms/0135.candy","Title":"Candy","TitleSlug":"candy","PassRate":"24%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":136,"Dir":"./Algorithms/0136.single-number","Title":"Single Number","TitleSlug":"single-number","PassRate":"54%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":137,"Dir":"./Algorithms/0137.single-number-ii","Title":"Single Number II","TitleSlug":"single-number-ii","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":138,"Dir":"./Algorithms/0138.copy-list-with-random-pointer","Title":"Copy List with Random Pointer","TitleSlug":"copy-list-with-random-pointer","PassRate":"26%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":139,"Dir":"./Algorithms/0139.word-break","Title":"Word Break","TitleSlug":"word-break","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":140,"Dir":"./Algorithms/0140.word-break-ii","Title":"Word Break II","TitleSlug":"word-break-ii","PassRate":"23%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":141,"Dir":"./Algorithms/0141.linked-list-cycle","Title":"Linked List Cycle","TitleSlug":"linked-list-cycle","PassRate":"35%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":142,"Dir":"./Algorithms/0142.linked-list-cycle-ii","Title":"Linked List Cycle II","TitleSlug":"linked-list-cycle-ii","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":143,"Dir":"./Algorithms/0143.reorder-list","Title":"Reorder List","TitleSlug":"reorder-list","PassRate":"25%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":144,"Dir":"./Algorithms/0144.binary-tree-preorder-traversal","Title":"Binary Tree Preorder Traversal","TitleSlug":"binary-tree-preorder-traversal","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":145,"Dir":"./Algorithms/0145.binary-tree-postorder-traversal","Title":"Binary Tree Postorder Traversal","TitleSlug":"binary-tree-postorder-traversal","PassRate":"40%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":146,"Dir":"./Algorithms/0146.lru-cache","Title":"LRU Cache","TitleSlug":"lru-cache","PassRate":"17%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":147,"Dir":"./Algorithms/0147.insertion-sort-list","Title":"Insertion Sort List","TitleSlug":"insertion-sort-list","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":148,"Dir":"./Algorithms/0148.sort-list","Title":"Sort List","TitleSlug":"sort-list","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":149,"Dir":"./Algorithms/0149.max-points-on-a-line","Title":"Max Points on a Line","TitleSlug":"max-points-on-a-line","PassRate":"15%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":150,"Dir":"./Algorithms/0150.evaluate-reverse-polish-notation","Title":"Evaluate Reverse Polish Notation","TitleSlug":"evaluate-reverse-polish-notation","PassRate":"27%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":151,"Dir":"./Algorithms/0151.reverse-words-in-a-string","Title":"Reverse Words in a String","TitleSlug":"reverse-words-in-a-string","PassRate":"15%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":152,"Dir":"./Algorithms/0152.maximum-product-subarray","Title":"Maximum Product Subarray","TitleSlug":"maximum-product-subarray","PassRate":"25%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":153,"Dir":"./Algorithms/0153.find-minimum-in-rotated-sorted-array","Title":"Find Minimum in Rotated Sorted Array","TitleSlug":"find-minimum-in-rotated-sorted-array","PassRate":"40%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":154,"Dir":"./Algorithms/0154.find-minimum-in-rotated-sorted-array-ii","Title":"Find Minimum in Rotated Sorted Array II","TitleSlug":"find-minimum-in-rotated-sorted-array-ii","PassRate":"37%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":155,"Dir":"./Algorithms/0155.min-stack","Title":"Min Stack","TitleSlug":"min-stack","PassRate":"28%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":160,"Dir":"./Algorithms/0160.intersection-of-two-linked-lists","Title":"Intersection of Two Linked Lists","TitleSlug":"intersection-of-two-linked-lists","PassRate":"30%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":162,"Dir":"./Algorithms/0162.find-peak-element","Title":"Find Peak Element","TitleSlug":"find-peak-element","PassRate":"37%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":164,"Dir":"./Algorithms/0164.maximum-gap","Title":"Maximum Gap","TitleSlug":"maximum-gap","PassRate":"29%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":165,"Dir":"./Algorithms/0165.compare-version-numbers","Title":"Compare Version Numbers","TitleSlug":"compare-version-numbers","PassRate":"20%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":166,"Dir":"./Algorithms/0166.fraction-to-recurring-decimal","Title":"Fraction to Recurring Decimal","TitleSlug":"fraction-to-recurring-decimal","PassRate":"17%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":167,"Dir":"./Algorithms/0167.two-sum-ii-input-array-is-sorted","Title":"Two Sum II - Input array is sorted","TitleSlug":"two-sum-ii-input-array-is-sorted","PassRate":"47%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":168,"Dir":"./Algorithms/0168.excel-sheet-column-title","Title":"Excel Sheet Column Title","TitleSlug":"excel-sheet-column-title","PassRate":"26%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":169,"Dir":"./Algorithms/0169.majority-element","Title":"Majority Element","TitleSlug":"majority-element","PassRate":"46%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":171,"Dir":"./Algorithms/0171.excel-sheet-column-number","Title":"Excel Sheet Column Number","TitleSlug":"excel-sheet-column-number","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":172,"Dir":"./Algorithms/0172.factorial-trailing-zeroes","Title":"Factorial Trailing Zeroes","TitleSlug":"factorial-trailing-zeroes","PassRate":"36%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":173,"Dir":"./Algorithms/0173.binary-search-tree-iterator","Title":"Binary Search Tree Iterator","TitleSlug":"binary-search-tree-iterator","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":174,"Dir":"./Algorithms/0174.dungeon-game","Title":"Dungeon Game","TitleSlug":"dungeon-game","PassRate":"23%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":179,"Dir":"./Algorithms/0179.largest-number","Title":"Largest Number","TitleSlug":"largest-number","PassRate":"22%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":187,"Dir":"./Algorithms/0187.repeated-dna-sequences","Title":"Repeated DNA Sequences","TitleSlug":"repeated-dna-sequences","PassRate":"31%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":188,"Dir":"./Algorithms/0188.best-time-to-buy-and-sell-stock-iv","Title":"Best Time to Buy and Sell Stock IV","TitleSlug":"best-time-to-buy-and-sell-stock-iv","PassRate":"24%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":189,"Dir":"./Algorithms/0189.rotate-array","Title":"Rotate Array","TitleSlug":"rotate-array","PassRate":"24%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":190,"Dir":"./Algorithms/0190.reverse-bits","Title":"Reverse Bits","TitleSlug":"reverse-bits","PassRate":"29%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":191,"Dir":"./Algorithms/0191.number-of-1-bits","Title":"Number of 1 Bits","TitleSlug":"number-of-1-bits","PassRate":"39%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":198,"Dir":"./Algorithms/0198.house-robber","Title":"House Robber","TitleSlug":"house-robber","PassRate":"39%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":199,"Dir":"./Algorithms/0199.binary-tree-right-side-view","Title":"Binary Tree Right Side View","TitleSlug":"binary-tree-right-side-view","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":200,"Dir":"./Algorithms/0200.number-of-islands","Title":"Number of Islands","TitleSlug":"number-of-islands","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":201,"Dir":"./Algorithms/0201.bitwise-and-of-numbers-range","Title":"Bitwise AND of Numbers Range","TitleSlug":"bitwise-and-of-numbers-range","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":202,"Dir":"./Algorithms/0202.happy-number","Title":"Happy Number","TitleSlug":"happy-number","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":203,"Dir":"./Algorithms/0203.remove-linked-list-elements","Title":"Remove Linked List Elements","TitleSlug":"remove-linked-list-elements","PassRate":"32%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":204,"Dir":"./Algorithms/0204.count-primes","Title":"Count Primes","TitleSlug":"count-primes","PassRate":"26%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":205,"Dir":"./Algorithms/0205.isomorphic-strings","Title":"Isomorphic Strings","TitleSlug":"isomorphic-strings","PassRate":"33%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":206,"Dir":"./Algorithms/0206.reverse-linked-list","Title":"Reverse Linked List","TitleSlug":"reverse-linked-list","PassRate":"45%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":207,"Dir":"./Algorithms/0207.course-schedule","Title":"Course Schedule","TitleSlug":"course-schedule","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":208,"Dir":"./Algorithms/0208.implement-trie-prefix-tree","Title":"Implement Trie (Prefix Tree)","TitleSlug":"implement-trie-prefix-tree","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":209,"Dir":"./Algorithms/0209.minimum-size-subarray-sum","Title":"Minimum Size Subarray Sum","TitleSlug":"minimum-size-subarray-sum","PassRate":"30%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":210,"Dir":"./Algorithms/0210.course-schedule-ii","Title":"Course Schedule II","TitleSlug":"course-schedule-ii","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":211,"Dir":"./Algorithms/0211.add-and-search-word-data-structure-design","Title":"Add and Search Word - Data structure design","TitleSlug":"add-and-search-word-data-structure-design","PassRate":"23%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":212,"Dir":"./Algorithms/0212.word-search-ii","Title":"Word Search II","TitleSlug":"word-search-ii","PassRate":"23%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":213,"Dir":"./Algorithms/0213.house-robber-ii","Title":"House Robber II","TitleSlug":"house-robber-ii","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":214,"Dir":"./Algorithms/0214.shortest-palindrome","Title":"Shortest Palindrome","TitleSlug":"shortest-palindrome","PassRate":"24%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":215,"Dir":"./Algorithms/0215.kth-largest-element-in-an-array","Title":"Kth Largest Element in an Array","TitleSlug":"kth-largest-element-in-an-array","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":216,"Dir":"./Algorithms/0216.combination-sum-iii","Title":"Combination Sum III","TitleSlug":"combination-sum-iii","PassRate":"45%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":217,"Dir":"./Algorithms/0217.contains-duplicate","Title":"Contains Duplicate","TitleSlug":"contains-duplicate","PassRate":"45%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":218,"Dir":"./Algorithms/0218.the-skyline-problem","Title":"The Skyline Problem","TitleSlug":"the-skyline-problem","PassRate":"27%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":219,"Dir":"./Algorithms/0219.contains-duplicate-ii","Title":"Contains Duplicate II","TitleSlug":"contains-duplicate-ii","PassRate":"32%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":220,"Dir":"./Algorithms/0220.contains-duplicate-iii","Title":"Contains Duplicate III","TitleSlug":"contains-duplicate-iii","PassRate":"19%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":221,"Dir":"./Algorithms/0221.maximal-square","Title":"Maximal Square","TitleSlug":"maximal-square","PassRate":"29%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":222,"Dir":"./Algorithms/0222.count-complete-tree-nodes","Title":"Count Complete Tree Nodes","TitleSlug":"count-complete-tree-nodes","PassRate":"27%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":223,"Dir":"./Algorithms/0223.rectangle-area","Title":"Rectangle Area","TitleSlug":"rectangle-area","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":224,"Dir":"./Algorithms/0224.basic-calculator","Title":"Basic Calculator","TitleSlug":"basic-calculator","PassRate":"27%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":225,"Dir":"./Algorithms/0225.implement-stack-using-queues","Title":"Implement Stack using Queues","TitleSlug":"implement-stack-using-queues","PassRate":"33%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":226,"Dir":"./Algorithms/0226.invert-binary-tree","Title":"Invert Binary Tree","TitleSlug":"invert-binary-tree","PassRate":"52%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":227,"Dir":"./Algorithms/0227.basic-calculator-ii","Title":"Basic Calculator II","TitleSlug":"basic-calculator-ii","PassRate":"29%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":228,"Dir":"./Algorithms/0228.summary-ranges","Title":"Summary Ranges","TitleSlug":"summary-ranges","PassRate":"30%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":229,"Dir":"./Algorithms/0229.majority-element-ii","Title":"Majority Element II","TitleSlug":"majority-element-ii","PassRate":"28%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":230,"Dir":"./Algorithms/0230.kth-smallest-element-in-a-bst","Title":"Kth Smallest Element in a BST","TitleSlug":"kth-smallest-element-in-a-bst","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":231,"Dir":"./Algorithms/0231.power-of-two","Title":"Power of Two","TitleSlug":"power-of-two","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":232,"Dir":"./Algorithms/0232.implement-queue-using-stacks","Title":"Implement Queue using Stacks","TitleSlug":"implement-queue-using-stacks","PassRate":"36%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":233,"Dir":"./Algorithms/0233.number-of-digit-one","Title":"Number of Digit One","TitleSlug":"number-of-digit-one","PassRate":"28%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":234,"Dir":"./Algorithms/0234.palindrome-linked-list","Title":"Palindrome Linked List","TitleSlug":"palindrome-linked-list","PassRate":"32%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":235,"Dir":"./Algorithms/0235.lowest-common-ancestor-of-a-binary-search-tree","Title":"Lowest Common Ancestor of a Binary Search Tree","TitleSlug":"lowest-common-ancestor-of-a-binary-search-tree","PassRate":"39%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":236,"Dir":"./Algorithms/0236.lowest-common-ancestor-of-a-binary-tree","Title":"Lowest Common Ancestor of a Binary Tree","TitleSlug":"lowest-common-ancestor-of-a-binary-tree","PassRate":"29%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":237,"Dir":"./Algorithms/0237.delete-node-in-a-linked-list","Title":"Delete Node in a Linked List","TitleSlug":"delete-node-in-a-linked-list","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":238,"Dir":"./Algorithms/0238.product-of-array-except-self","Title":"Product of Array Except Self","TitleSlug":"product-of-array-except-self","PassRate":"49%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":239,"Dir":"./Algorithms/0239.sliding-window-maximum","Title":"Sliding Window Maximum","TitleSlug":"sliding-window-maximum","PassRate":"33%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":240,"Dir":"./Algorithms/0240.search-a-2d-matrix-ii","Title":"Search a 2D Matrix II","TitleSlug":"search-a-2d-matrix-ii","PassRate":"38%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":241,"Dir":"./Algorithms/0241.different-ways-to-add-parentheses","Title":"Different Ways to Add Parentheses","TitleSlug":"different-ways-to-add-parentheses","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":242,"Dir":"./Algorithms/0242.valid-anagram","Title":"Valid Anagram","TitleSlug":"valid-anagram","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":257,"Dir":"./Algorithms/0257.binary-tree-paths","Title":"Binary Tree Paths","TitleSlug":"binary-tree-paths","PassRate":"38%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":258,"Dir":"./Algorithms/0258.add-digits","Title":"Add Digits","TitleSlug":"add-digits","PassRate":"51%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":260,"Dir":"./Algorithms/0260.single-number-iii","Title":"Single Number III","TitleSlug":"single-number-iii","PassRate":"51%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":263,"Dir":"./Algorithms/0263.ugly-number","Title":"Ugly Number","TitleSlug":"ugly-number","PassRate":"39%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":264,"Dir":"./Algorithms/0264.ugly-number-ii","Title":"Ugly Number II","TitleSlug":"ugly-number-ii","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":268,"Dir":"./Algorithms/0268.missing-number","Title":"Missing Number","TitleSlug":"missing-number","PassRate":"44%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":273,"Dir":"./Algorithms/0273.integer-to-english-words","Title":"Integer to English Words","TitleSlug":"integer-to-english-words","PassRate":"22%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":274,"Dir":"./Algorithms/0274.h-index","Title":"H-Index","TitleSlug":"h-index","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":275,"Dir":"./Algorithms/0275.h-index-ii","Title":"H-Index II","TitleSlug":"h-index-ii","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":278,"Dir":"./Algorithms/0278.first-bad-version","Title":"First Bad Version","TitleSlug":"first-bad-version","PassRate":"25%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":279,"Dir":"./Algorithms/0279.perfect-squares","Title":"Perfect Squares","TitleSlug":"perfect-squares","PassRate":"37%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":282,"Dir":"./Algorithms/0282.expression-add-operators","Title":"Expression Add Operators","TitleSlug":"expression-add-operators","PassRate":"29%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":283,"Dir":"./Algorithms/0283.move-zeroes","Title":"Move Zeroes","TitleSlug":"move-zeroes","PassRate":"50%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":284,"Dir":"./Algorithms/0284.peeking-iterator","Title":"Peeking Iterator","TitleSlug":"peeking-iterator","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":287,"Dir":"./Algorithms/0287.find-the-duplicate-number","Title":"Find the Duplicate Number","TitleSlug":"find-the-duplicate-number","PassRate":"43%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":289,"Dir":"./Algorithms/0289.game-of-life","Title":"Game of Life","TitleSlug":"game-of-life","PassRate":"37%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":290,"Dir":"./Algorithms/0290.word-pattern","Title":"Word Pattern","TitleSlug":"word-pattern","PassRate":"33%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":292,"Dir":"./Algorithms/0292.nim-game","Title":"Nim Game","TitleSlug":"nim-game","PassRate":"55%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":295,"Dir":"./Algorithms/0295.find-median-from-data-stream","Title":"Find Median from Data Stream","TitleSlug":"find-median-from-data-stream","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":297,"Dir":"./Algorithms/0297.serialize-and-deserialize-binary-tree","Title":"Serialize and Deserialize Binary Tree","TitleSlug":"serialize-and-deserialize-binary-tree","PassRate":"33%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":299,"Dir":"./Algorithms/0299.bulls-and-cows","Title":"Bulls and Cows","TitleSlug":"bulls-and-cows","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":300,"Dir":"./Algorithms/0300.longest-increasing-subsequence","Title":"Longest Increasing Subsequence","TitleSlug":"longest-increasing-subsequence","PassRate":"38%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":301,"Dir":"./Algorithms/0301.remove-invalid-parentheses","Title":"Remove Invalid Parentheses","TitleSlug":"remove-invalid-parentheses","PassRate":"35%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":303,"Dir":"./Algorithms/0303.range-sum-query-immutable","Title":"Range Sum Query - Immutable","TitleSlug":"range-sum-query-immutable","PassRate":"29%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":304,"Dir":"./Algorithms/0304.range-sum-query-2d-immutable","Title":"Range Sum Query 2D - Immutable","TitleSlug":"range-sum-query-2d-immutable","PassRate":"25%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":306,"Dir":"./Algorithms/0306.additive-number","Title":"Additive Number","TitleSlug":"additive-number","PassRate":"27%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":307,"Dir":"./Algorithms/0307.range-sum-query-mutable","Title":"Range Sum Query - Mutable","TitleSlug":"range-sum-query-mutable","PassRate":"20%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":309,"Dir":"./Algorithms/0309.best-time-to-buy-and-sell-stock-with-cooldown","Title":"Best Time to Buy and Sell Stock with Cooldown","TitleSlug":"best-time-to-buy-and-sell-stock-with-cooldown","PassRate":"40%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":310,"Dir":"./Algorithms/0310.minimum-height-trees","Title":"Minimum Height Trees","TitleSlug":"minimum-height-trees","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":312,"Dir":"./Algorithms/0312.burst-balloons","Title":"Burst Balloons","TitleSlug":"burst-balloons","PassRate":"42%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":313,"Dir":"./Algorithms/0313.super-ugly-number","Title":"Super Ugly Number","TitleSlug":"super-ugly-number","PassRate":"37%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":315,"Dir":"./Algorithms/0315.count-of-smaller-numbers-after-self","Title":"Count of Smaller Numbers After Self","TitleSlug":"count-of-smaller-numbers-after-self","PassRate":"34%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":316,"Dir":"./Algorithms/0316.remove-duplicate-letters","Title":"Remove Duplicate Letters","TitleSlug":"remove-duplicate-letters","PassRate":"29%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":318,"Dir":"./Algorithms/0318.maximum-product-of-word-lengths","Title":"Maximum Product of Word Lengths","TitleSlug":"maximum-product-of-word-lengths","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":319,"Dir":"./Algorithms/0319.bulb-switcher","Title":"Bulb Switcher","TitleSlug":"bulb-switcher","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":321,"Dir":"./Algorithms/0321.create-maximum-number","Title":"Create Maximum Number","TitleSlug":"create-maximum-number","PassRate":"24%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":322,"Dir":"./Algorithms/0322.coin-change","Title":"Coin Change","TitleSlug":"coin-change","PassRate":"26%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":324,"Dir":"./Algorithms/0324.wiggle-sort-ii","Title":"Wiggle Sort II","TitleSlug":"wiggle-sort-ii","PassRate":"26%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":326,"Dir":"./Algorithms/0326.power-of-three","Title":"Power of Three","TitleSlug":"power-of-three","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":327,"Dir":"./Algorithms/0327.count-of-range-sum","Title":"Count of Range Sum","TitleSlug":"count-of-range-sum","PassRate":"29%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":328,"Dir":"./Algorithms/0328.odd-even-linked-list","Title":"Odd Even Linked List","TitleSlug":"odd-even-linked-list","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":329,"Dir":"./Algorithms/0329.longest-increasing-path-in-a-matrix","Title":"Longest Increasing Path in a Matrix","TitleSlug":"longest-increasing-path-in-a-matrix","PassRate":"36%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":330,"Dir":"./Algorithms/0330.patching-array","Title":"Patching Array","TitleSlug":"patching-array","PassRate":"32%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":331,"Dir":"./Algorithms/0331.verify-preorder-serialization-of-a-binary-tree","Title":"Verify Preorder Serialization of a Binary Tree","TitleSlug":"verify-preorder-serialization-of-a-binary-tree","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":332,"Dir":"./Algorithms/0332.reconstruct-itinerary","Title":"Reconstruct Itinerary","TitleSlug":"reconstruct-itinerary","PassRate":"29%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":334,"Dir":"./Algorithms/0334.increasing-triplet-subsequence","Title":"Increasing Triplet Subsequence","TitleSlug":"increasing-triplet-subsequence","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":335,"Dir":"./Algorithms/0335.self-crossing","Title":"Self Crossing","TitleSlug":"self-crossing","PassRate":"25%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":336,"Dir":"./Algorithms/0336.palindrome-pairs","Title":"Palindrome Pairs","TitleSlug":"palindrome-pairs","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":337,"Dir":"./Algorithms/0337.house-robber-iii","Title":"House Robber III","TitleSlug":"house-robber-iii","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":338,"Dir":"./Algorithms/0338.counting-bits","Title":"Counting Bits","TitleSlug":"counting-bits","PassRate":"61%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":341,"Dir":"./Algorithms/0341.flatten-nested-list-iterator","Title":"Flatten Nested List Iterator","TitleSlug":"flatten-nested-list-iterator","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":342,"Dir":"./Algorithms/0342.power-of-four","Title":"Power of Four","TitleSlug":"power-of-four","PassRate":"38%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":343,"Dir":"./Algorithms/0343.integer-break","Title":"Integer Break","TitleSlug":"integer-break","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":344,"Dir":"./Algorithms/0344.reverse-string","Title":"Reverse String","TitleSlug":"reverse-string","PassRate":"59%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":345,"Dir":"./Algorithms/0345.reverse-vowels-of-a-string","Title":"Reverse Vowels of a String","TitleSlug":"reverse-vowels-of-a-string","PassRate":"38%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":347,"Dir":"./Algorithms/0347.top-k-frequent-elements","Title":"Top K Frequent Elements","TitleSlug":"top-k-frequent-elements","PassRate":"48%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":349,"Dir":"./Algorithms/0349.intersection-of-two-arrays","Title":"Intersection of Two Arrays","TitleSlug":"intersection-of-two-arrays","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":350,"Dir":"./Algorithms/0350.intersection-of-two-arrays-ii","Title":"Intersection of Two Arrays II","TitleSlug":"intersection-of-two-arrays-ii","PassRate":"44%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":352,"Dir":"./Algorithms/0352.data-stream-as-disjoint-intervals","Title":"Data Stream as Disjoint Intervals","TitleSlug":"data-stream-as-disjoint-intervals","PassRate":"40%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":354,"Dir":"./Algorithms/0354.russian-doll-envelopes","Title":"Russian Doll Envelopes","TitleSlug":"russian-doll-envelopes","PassRate":"32%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":355,"Dir":"./Algorithms/0355.design-twitter","Title":"Design Twitter","TitleSlug":"design-twitter","PassRate":"25%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":357,"Dir":"./Algorithms/0357.count-numbers-with-unique-digits","Title":"Count Numbers with Unique Digits","TitleSlug":"count-numbers-with-unique-digits","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":363,"Dir":"./Algorithms/0363.max-sum-of-rectangle-no-larger-than-k","Title":"Max Sum of Rectangle No Larger Than K","TitleSlug":"max-sum-of-rectangle-no-larger-than-k","PassRate":"33%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":365,"Dir":"./Algorithms/0365.water-and-jug-problem","Title":"Water and Jug Problem","TitleSlug":"water-and-jug-problem","PassRate":"27%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":367,"Dir":"./Algorithms/0367.valid-perfect-square","Title":"Valid Perfect Square","TitleSlug":"valid-perfect-square","PassRate":"38%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":368,"Dir":"./Algorithms/0368.largest-divisible-subset","Title":"Largest Divisible Subset","TitleSlug":"largest-divisible-subset","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":371,"Dir":"./Algorithms/0371.sum-of-two-integers","Title":"Sum of Two Integers","TitleSlug":"sum-of-two-integers","PassRate":"51%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":372,"Dir":"./Algorithms/0372.super-pow","Title":"Super Pow","TitleSlug":"super-pow","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":373,"Dir":"./Algorithms/0373.find-k-pairs-with-smallest-sums","Title":"Find K Pairs with Smallest Sums","TitleSlug":"find-k-pairs-with-smallest-sums","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":374,"Dir":"./Algorithms/0374.guess-number-higher-or-lower","Title":"Guess Number Higher or Lower","TitleSlug":"guess-number-higher-or-lower","PassRate":"35%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":375,"Dir":"./Algorithms/0375.guess-number-higher-or-lower-ii","Title":"Guess Number Higher or Lower II","TitleSlug":"guess-number-higher-or-lower-ii","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":376,"Dir":"./Algorithms/0376.wiggle-subsequence","Title":"Wiggle Subsequence","TitleSlug":"wiggle-subsequence","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":377,"Dir":"./Algorithms/0377.combination-sum-iv","Title":"Combination Sum IV","TitleSlug":"combination-sum-iv","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":378,"Dir":"./Algorithms/0378.kth-smallest-element-in-a-sorted-matrix","Title":"Kth Smallest Element in a Sorted Matrix","TitleSlug":"kth-smallest-element-in-a-sorted-matrix","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":380,"Dir":"./Algorithms/0380.insert-delete-getrandom-o1","Title":"Insert Delete GetRandom O(1)","TitleSlug":"insert-delete-getrandom-o1","PassRate":"39%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":381,"Dir":"./Algorithms/0381.insert-delete-getrandom-o1-duplicates-allowed","Title":"Insert Delete GetRandom O(1) - Duplicates allowed","TitleSlug":"insert-delete-getrandom-o1-duplicates-allowed","PassRate":"28%","Difficulty":3,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":382,"Dir":"./Algorithms/0382.linked-list-random-node","Title":"Linked List Random Node","TitleSlug":"linked-list-random-node","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":383,"Dir":"./Algorithms/0383.ransom-note","Title":"Ransom Note","TitleSlug":"ransom-note","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":384,"Dir":"./Algorithms/0384.shuffle-an-array","Title":"Shuffle an Array","TitleSlug":"shuffle-an-array","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":385,"Dir":"./Algorithms/0385.mini-parser","Title":"Mini Parser","TitleSlug":"mini-parser","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":386,"Dir":"./Algorithms/0386.lexicographical-numbers","Title":"Lexicographical Numbers","TitleSlug":"lexicographical-numbers","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":387,"Dir":"./Algorithms/0387.first-unique-character-in-a-string","Title":"First Unique Character in a String","TitleSlug":"first-unique-character-in-a-string","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":388,"Dir":"./Algorithms/0388.longest-absolute-file-path","Title":"Longest Absolute File Path","TitleSlug":"longest-absolute-file-path","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":389,"Dir":"./Algorithms/0389.find-the-difference","Title":"Find the Difference","TitleSlug":"find-the-difference","PassRate":"50%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":390,"Dir":"./Algorithms/0390.elimination-game","Title":"Elimination Game","TitleSlug":"elimination-game","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":391,"Dir":"./Algorithms/0391.perfect-rectangle","Title":"Perfect Rectangle","TitleSlug":"perfect-rectangle","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":392,"Dir":"./Algorithms/0392.is-subsequence","Title":"Is Subsequence","TitleSlug":"is-subsequence","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":393,"Dir":"./Algorithms/0393.utf-8-validation","Title":"UTF-8 Validation","TitleSlug":"utf-8-validation","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":394,"Dir":"./Algorithms/0394.decode-string","Title":"Decode String","TitleSlug":"decode-string","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":395,"Dir":"./Algorithms/0395.longest-substring-with-at-least-k-repeating-characters","Title":"Longest Substring with At Least K Repeating Characters","TitleSlug":"longest-substring-with-at-least-k-repeating-characters","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":396,"Dir":"./Algorithms/0396.rotate-function","Title":"Rotate Function","TitleSlug":"rotate-function","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":397,"Dir":"./Algorithms/0397.integer-replacement","Title":"Integer Replacement","TitleSlug":"integer-replacement","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":398,"Dir":"./Algorithms/0398.random-pick-index","Title":"Random Pick Index","TitleSlug":"random-pick-index","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":399,"Dir":"./Algorithms/0399.evaluate-division","Title":"Evaluate Division","TitleSlug":"evaluate-division","PassRate":"40%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":400,"Dir":"./Algorithms/0400.nth-digit","Title":"Nth Digit","TitleSlug":"nth-digit","PassRate":"30%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":401,"Dir":"./Algorithms/0401.binary-watch","Title":"Binary Watch","TitleSlug":"binary-watch","PassRate":"44%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":402,"Dir":"./Algorithms/0402.remove-k-digits","Title":"Remove K Digits","TitleSlug":"remove-k-digits","PassRate":"26%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":403,"Dir":"./Algorithms/0403.frog-jump","Title":"Frog Jump","TitleSlug":"frog-jump","PassRate":"32%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":404,"Dir":"./Algorithms/0404.sum-of-left-leaves","Title":"Sum of Left Leaves","TitleSlug":"sum-of-left-leaves","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":405,"Dir":"./Algorithms/0405.convert-a-number-to-hexadecimal","Title":"Convert a Number to Hexadecimal","TitleSlug":"convert-a-number-to-hexadecimal","PassRate":"41%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":406,"Dir":"./Algorithms/0406.queue-reconstruction-by-height","Title":"Queue Reconstruction by Height","TitleSlug":"queue-reconstruction-by-height","PassRate":"55%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":407,"Dir":"./Algorithms/0407.trapping-rain-water-ii","Title":"Trapping Rain Water II","TitleSlug":"trapping-rain-water-ii","PassRate":"37%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":409,"Dir":"./Algorithms/0409.longest-palindrome","Title":"Longest Palindrome","TitleSlug":"longest-palindrome","PassRate":"45%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":410,"Dir":"./Algorithms/0410.split-array-largest-sum","Title":"Split Array Largest Sum","TitleSlug":"split-array-largest-sum","PassRate":"37%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":412,"Dir":"./Algorithms/0412.fizz-buzz","Title":"Fizz Buzz","TitleSlug":"fizz-buzz","PassRate":"58%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":413,"Dir":"./Algorithms/0413.arithmetic-slices","Title":"Arithmetic Slices","TitleSlug":"arithmetic-slices","PassRate":"54%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":414,"Dir":"./Algorithms/0414.third-maximum-number","Title":"Third Maximum Number","TitleSlug":"third-maximum-number","PassRate":"27%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":415,"Dir":"./Algorithms/0415.add-strings","Title":"Add Strings","TitleSlug":"add-strings","PassRate":"41%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":416,"Dir":"./Algorithms/0416.partition-equal-subset-sum","Title":"Partition Equal Subset Sum","TitleSlug":"partition-equal-subset-sum","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":417,"Dir":"./Algorithms/0417.pacific-atlantic-water-flow","Title":"Pacific Atlantic Water Flow","TitleSlug":"pacific-atlantic-water-flow","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":419,"Dir":"./Algorithms/0419.battleships-in-a-board","Title":"Battleships in a Board","TitleSlug":"battleships-in-a-board","PassRate":"61%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":420,"Dir":"./Algorithms/0420.strong-password-checker","Title":"Strong Password Checker","TitleSlug":"strong-password-checker","PassRate":"20%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":421,"Dir":"./Algorithms/0421.maximum-xor-of-two-numbers-in-an-array","Title":"Maximum XOR of Two Numbers in an Array","TitleSlug":"maximum-xor-of-two-numbers-in-an-array","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":423,"Dir":"./Algorithms/0423.reconstruct-original-digits-from-english","Title":"Reconstruct Original Digits from English","TitleSlug":"reconstruct-original-digits-from-english","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":424,"Dir":"./Algorithms/0424.longest-repeating-character-replacement","Title":"Longest Repeating Character Replacement","TitleSlug":"longest-repeating-character-replacement","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":432,"Dir":"./Algorithms/0432.all-oone-data-structure","Title":"All O`one Data Structure","TitleSlug":"all-oone-data-structure","PassRate":"28%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":433,"Dir":"./Draft/0433.minimum-genetic-mutation","Title":"Minimum Genetic Mutation","TitleSlug":"minimum-genetic-mutation","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":434,"Dir":"./Algorithms/0434.number-of-segments-in-a-string","Title":"Number of Segments in a String","TitleSlug":"number-of-segments-in-a-string","PassRate":"36%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":435,"Dir":"./Algorithms/0435.non-overlapping-intervals","Title":"Non-overlapping Intervals","TitleSlug":"non-overlapping-intervals","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":436,"Dir":"./Algorithms/0436.find-right-interval","Title":"Find Right Interval","TitleSlug":"find-right-interval","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":437,"Dir":"./Algorithms/0437.path-sum-iii","Title":"Path Sum III","TitleSlug":"path-sum-iii","PassRate":"39%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":438,"Dir":"./Algorithms/0438.find-all-anagrams-in-a-string","Title":"Find All Anagrams in a String","TitleSlug":"find-all-anagrams-in-a-string","PassRate":"33%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":440,"Dir":"./Algorithms/0440.k-th-smallest-in-lexicographical-order","Title":"K-th Smallest in Lexicographical Order","TitleSlug":"k-th-smallest-in-lexicographical-order","PassRate":"24%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":441,"Dir":"./Algorithms/0441.arranging-coins","Title":"Arranging Coins","TitleSlug":"arranging-coins","PassRate":"36%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":442,"Dir":"./Algorithms/0442.find-all-duplicates-in-an-array","Title":"Find All Duplicates in an Array","TitleSlug":"find-all-duplicates-in-an-array","PassRate":"55%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":445,"Dir":"./Algorithms/0445.add-two-numbers-ii","Title":"Add Two Numbers II","TitleSlug":"add-two-numbers-ii","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":446,"Dir":"./Algorithms/0446.arithmetic-slices-ii-subsequence","Title":"Arithmetic Slices II - Subsequence","TitleSlug":"arithmetic-slices-ii-subsequence","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":447,"Dir":"./Algorithms/0447.number-of-boomerangs","Title":"Number of Boomerangs","TitleSlug":"number-of-boomerangs","PassRate":"45%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":448,"Dir":"./Algorithms/0448.find-all-numbers-disappeared-in-an-array","Title":"Find All Numbers Disappeared in an Array","TitleSlug":"find-all-numbers-disappeared-in-an-array","PassRate":"51%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":449,"Dir":"./Algorithms/0449.serialize-and-deserialize-bst","Title":"Serialize and Deserialize BST","TitleSlug":"serialize-and-deserialize-bst","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":450,"Dir":"./Algorithms/0450.delete-node-in-a-bst","Title":"Delete Node in a BST","TitleSlug":"delete-node-in-a-bst","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":451,"Dir":"./Algorithms/0451.sort-characters-by-frequency","Title":"Sort Characters By Frequency","TitleSlug":"sort-characters-by-frequency","PassRate":"50%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":452,"Dir":"./Algorithms/0452.minimum-number-of-arrows-to-burst-balloons","Title":"Minimum Number of Arrows to Burst Balloons","TitleSlug":"minimum-number-of-arrows-to-burst-balloons","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":453,"Dir":"./Algorithms/0453.minimum-moves-to-equal-array-elements","Title":"Minimum Moves to Equal Array Elements","TitleSlug":"minimum-moves-to-equal-array-elements","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":454,"Dir":"./Algorithms/0454.4sum-ii","Title":"4Sum II","TitleSlug":"4sum-ii","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":455,"Dir":"./Algorithms/0455.assign-cookies","Title":"Assign Cookies","TitleSlug":"assign-cookies","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":456,"Dir":"./Algorithms/0456.132-pattern","Title":"132 Pattern","TitleSlug":"132-pattern","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":457,"Dir":"./Draft/0457.circular-array-loop","Title":"Circular Array Loop","TitleSlug":"circular-array-loop","PassRate":"20%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":458,"Dir":"./Draft/0458.poor-pigs","Title":"Poor Pigs","TitleSlug":"poor-pigs","PassRate":"39%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":459,"Dir":"./Algorithms/0459.repeated-substring-pattern","Title":"Repeated Substring Pattern","TitleSlug":"repeated-substring-pattern","PassRate":"37%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":460,"Dir":"./Algorithms/0460.lfu-cache","Title":"LFU Cache","TitleSlug":"lfu-cache","PassRate":"23%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":461,"Dir":"./Algorithms/0461.hamming-distance","Title":"Hamming Distance","TitleSlug":"hamming-distance","PassRate":"70%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":462,"Dir":"./Algorithms/0462.minimum-moves-to-equal-array-elements-ii","Title":"Minimum Moves to Equal Array Elements II","TitleSlug":"minimum-moves-to-equal-array-elements-ii","PassRate":"51%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":463,"Dir":"./Algorithms/0463.island-perimeter","Title":"Island Perimeter","TitleSlug":"island-perimeter","PassRate":"57%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":464,"Dir":"./Algorithms/0464.can-i-win","Title":"Can I Win","TitleSlug":"can-i-win","PassRate":"24%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":466,"Dir":"./Algorithms/0466.count-the-repetitions","Title":"Count The Repetitions","TitleSlug":"count-the-repetitions","PassRate":"28%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":467,"Dir":"./Algorithms/0467.unique-substrings-in-wraparound-string","Title":"Unique Substrings in Wraparound String","TitleSlug":"unique-substrings-in-wraparound-string","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":468,"Dir":"./Algorithms/0468.validate-ip-address","Title":"Validate IP Address","TitleSlug":"validate-ip-address","PassRate":"20%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":472,"Dir":"./Algorithms/0472.concatenated-words","Title":"Concatenated Words","TitleSlug":"concatenated-words","PassRate":"30%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":473,"Dir":"./Algorithms/0473.matchsticks-to-square","Title":"Matchsticks to Square","TitleSlug":"matchsticks-to-square","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":474,"Dir":"./Algorithms/0474.ones-and-zeroes","Title":"Ones and Zeroes","TitleSlug":"ones-and-zeroes","PassRate":"38%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":475,"Dir":"./Algorithms/0475.heaters","Title":"Heaters","TitleSlug":"heaters","PassRate":"29%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":476,"Dir":"./Algorithms/0476.number-complement","Title":"Number Complement","TitleSlug":"number-complement","PassRate":"60%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":477,"Dir":"./Algorithms/0477.total-hamming-distance","Title":"Total Hamming Distance","TitleSlug":"total-hamming-distance","PassRate":"47%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":479,"Dir":"./Algorithms/0479.largest-palindrome-product","Title":"Largest Palindrome Product","TitleSlug":"largest-palindrome-product","PassRate":"23%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":480,"Dir":"./Algorithms/0480.sliding-window-median","Title":"Sliding Window Median","TitleSlug":"sliding-window-median","PassRate":"31%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":481,"Dir":"./Algorithms/0481.magical-string","Title":"Magical String","TitleSlug":"magical-string","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":482,"Dir":"./Algorithms/0482.license-key-formatting","Title":"License Key Formatting","TitleSlug":"license-key-formatting","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":483,"Dir":"./Algorithms/0483.smallest-good-base","Title":"Smallest Good Base","TitleSlug":"smallest-good-base","PassRate":"33%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":485,"Dir":"./Algorithms/0485.max-consecutive-ones","Title":"Max Consecutive Ones","TitleSlug":"max-consecutive-ones","PassRate":"53%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":486,"Dir":"./Algorithms/0486.predict-the-winner","Title":"Predict the Winner","TitleSlug":"predict-the-winner","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":488,"Dir":"./Algorithms/0488.zuma-game","Title":"Zuma Game","TitleSlug":"zuma-game","PassRate":"37%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":491,"Dir":"./Algorithms/0491.increasing-subsequences","Title":"Increasing Subsequences","TitleSlug":"increasing-subsequences","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":492,"Dir":"./Algorithms/0492.construct-the-rectangle","Title":"Construct the Rectangle","TitleSlug":"construct-the-rectangle","PassRate":"48%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":493,"Dir":"./Algorithms/0493.reverse-pairs","Title":"Reverse Pairs","TitleSlug":"reverse-pairs","PassRate":"20%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":494,"Dir":"./Algorithms/0494.target-sum","Title":"Target Sum","TitleSlug":"target-sum","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":495,"Dir":"./Algorithms/0495.teemo-attacking","Title":"Teemo Attacking","TitleSlug":"teemo-attacking","PassRate":"51%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":496,"Dir":"./Algorithms/0496.next-greater-element-i","Title":"Next Greater Element I","TitleSlug":"next-greater-element-i","PassRate":"56%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":498,"Dir":"./Algorithms/0498.diagonal-traverse","Title":"Diagonal Traverse","TitleSlug":"diagonal-traverse","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":500,"Dir":"./Algorithms/0500.keyboard-row","Title":"Keyboard Row","TitleSlug":"keyboard-row","PassRate":"59%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":501,"Dir":"./Algorithms/0501.find-mode-in-binary-search-tree","Title":"Find Mode in Binary Search Tree","TitleSlug":"find-mode-in-binary-search-tree","PassRate":"37%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":502,"Dir":"./Algorithms/0502.ipo","Title":"IPO","TitleSlug":"ipo","PassRate":"36%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":503,"Dir":"./Algorithms/0503.next-greater-element-ii","Title":"Next Greater Element II","TitleSlug":"next-greater-element-ii","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":504,"Dir":"./Algorithms/0504.base-7","Title":"Base 7","TitleSlug":"base-7","PassRate":"44%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":506,"Dir":"./Algorithms/0506.relative-ranks","Title":"Relative Ranks","TitleSlug":"relative-ranks","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":507,"Dir":"./Algorithms/0507.perfect-number","Title":"Perfect Number","TitleSlug":"perfect-number","PassRate":"33%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":508,"Dir":"./Algorithms/0508.most-frequent-subtree-sum","Title":"Most Frequent Subtree Sum","TitleSlug":"most-frequent-subtree-sum","PassRate":"52%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":513,"Dir":"./Algorithms/0513.find-bottom-left-tree-value","Title":"Find Bottom Left Tree Value","TitleSlug":"find-bottom-left-tree-value","PassRate":"55%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":514,"Dir":"./Algorithms/0514.freedom-trail","Title":"Freedom Trail","TitleSlug":"freedom-trail","PassRate":"39%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":515,"Dir":"./Algorithms/0515.find-largest-value-in-each-tree-row","Title":"Find Largest Value in Each Tree Row","TitleSlug":"find-largest-value-in-each-tree-row","PassRate":"54%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":516,"Dir":"./Algorithms/0516.longest-palindromic-subsequence","Title":"Longest Palindromic Subsequence","TitleSlug":"longest-palindromic-subsequence","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":517,"Dir":"./Algorithms/0517.super-washing-machines","Title":"Super Washing Machines","TitleSlug":"super-washing-machines","PassRate":"36%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":518,"Dir":"./Draft/0518.coin-change-2","Title":"Coin Change 2","TitleSlug":"coin-change-2","PassRate":"32%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":520,"Dir":"./Algorithms/0520.detect-capital","Title":"Detect Capital","TitleSlug":"detect-capital","PassRate":"51%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":521,"Dir":"./Algorithms/0521.longest-uncommon-subsequence-i","Title":"Longest Uncommon Subsequence I ","TitleSlug":"longest-uncommon-subsequence-i","PassRate":"55%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":522,"Dir":"./Algorithms/0522.longest-uncommon-subsequence-ii","Title":"Longest Uncommon Subsequence II","TitleSlug":"longest-uncommon-subsequence-ii","PassRate":"31%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":523,"Dir":"./Algorithms/0523.continuous-subarray-sum","Title":"Continuous Subarray Sum","TitleSlug":"continuous-subarray-sum","PassRate":"22%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":524,"Dir":"./Algorithms/0524.longest-word-in-dictionary-through-deleting","Title":"Longest Word in Dictionary through Deleting","TitleSlug":"longest-word-in-dictionary-through-deleting","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":525,"Dir":"./Algorithms/0525.contiguous-array","Title":"Contiguous Array","TitleSlug":"contiguous-array","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":526,"Dir":"./Algorithms/0526.beautiful-arrangement","Title":"Beautiful Arrangement","TitleSlug":"beautiful-arrangement","PassRate":"54%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":529,"Dir":"./Algorithms/0529.minesweeper","Title":"Minesweeper","TitleSlug":"minesweeper","PassRate":"49%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":530,"Dir":"./Algorithms/0530.minimum-absolute-difference-in-bst","Title":"Minimum Absolute Difference in BST","TitleSlug":"minimum-absolute-difference-in-bst","PassRate":"47%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":532,"Dir":"./Algorithms/0532.k-diff-pairs-in-an-array","Title":"K-diff Pairs in an Array","TitleSlug":"k-diff-pairs-in-an-array","PassRate":"28%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":535,"Dir":"./Algorithms/0535.encode-and-decode-tinyurl","Title":"Encode and Decode TinyURL","TitleSlug":"encode-and-decode-tinyurl","PassRate":"74%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":537,"Dir":"./Algorithms/0537.complex-number-multiplication","Title":"Complex Number Multiplication","TitleSlug":"complex-number-multiplication","PassRate":"63%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":538,"Dir":"./Algorithms/0538.convert-bst-to-greater-tree","Title":"Convert BST to Greater Tree","TitleSlug":"convert-bst-to-greater-tree","PassRate":"49%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":539,"Dir":"./Algorithms/0539.minimum-time-difference","Title":"Minimum Time Difference","TitleSlug":"minimum-time-difference","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":540,"Dir":"./Algorithms/0540.single-element-in-a-sorted-array","Title":"Single Element in a Sorted Array","TitleSlug":"single-element-in-a-sorted-array","PassRate":"55%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":541,"Dir":"./Algorithms/0541.reverse-string-ii","Title":"Reverse String II","TitleSlug":"reverse-string-ii","PassRate":"43%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":542,"Dir":"./Algorithms/0542.01-matrix","Title":"01 Matrix","TitleSlug":"01-matrix","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":543,"Dir":"./Algorithms/0543.diameter-of-binary-tree","Title":"Diameter of Binary Tree","TitleSlug":"diameter-of-binary-tree","PassRate":"43%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":546,"Dir":"./Algorithms/0546.remove-boxes","Title":"Remove Boxes","TitleSlug":"remove-boxes","PassRate":"33%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":547,"Dir":"./Algorithms/0547.friend-circles","Title":"Friend Circles","TitleSlug":"friend-circles","PassRate":"49%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":551,"Dir":"./Algorithms/0551.student-attendance-record-i","Title":"Student Attendance Record I","TitleSlug":"student-attendance-record-i","PassRate":"43%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":552,"Dir":"./Algorithms/0552.student-attendance-record-ii","Title":"Student Attendance Record II","TitleSlug":"student-attendance-record-ii","PassRate":"31%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":553,"Dir":"./Algorithms/0553.optimal-division","Title":"Optimal Division","TitleSlug":"optimal-division","PassRate":"55%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":554,"Dir":"./Algorithms/0554.brick-wall","Title":"Brick Wall","TitleSlug":"brick-wall","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":556,"Dir":"./Algorithms/0556.next-greater-element-iii","Title":"Next Greater Element III","TitleSlug":"next-greater-element-iii","PassRate":"28%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":557,"Dir":"./Algorithms/0557.reverse-words-in-a-string-iii","Title":"Reverse Words in a String III","TitleSlug":"reverse-words-in-a-string-iii","PassRate":"59%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":560,"Dir":"./Algorithms/0560.subarray-sum-equals-k","Title":"Subarray Sum Equals K","TitleSlug":"subarray-sum-equals-k","PassRate":"40%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":561,"Dir":"./Algorithms/0561.array-partition-i","Title":"Array Partition I","TitleSlug":"array-partition-i","PassRate":"67%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":563,"Dir":"./Algorithms/0563.binary-tree-tilt","Title":"Binary Tree Tilt","TitleSlug":"binary-tree-tilt","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":564,"Dir":"./Algorithms/0564.find-the-closest-palindrome","Title":"Find the Closest Palindrome","TitleSlug":"find-the-closest-palindrome","PassRate":"17%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":565,"Dir":"./Algorithms/0565.array-nesting","Title":"Array Nesting","TitleSlug":"array-nesting","PassRate":"49%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":566,"Dir":"./Algorithms/0566.reshape-the-matrix","Title":"Reshape the Matrix","TitleSlug":"reshape-the-matrix","PassRate":"58%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":567,"Dir":"./Algorithms/0567.permutation-in-string","Title":"Permutation in String","TitleSlug":"permutation-in-string","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":572,"Dir":"./Algorithms/0572.subtree-of-another-tree","Title":"Subtree of Another Tree","TitleSlug":"subtree-of-another-tree","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":575,"Dir":"./Algorithms/0575.distribute-candies","Title":"Distribute Candies","TitleSlug":"distribute-candies","PassRate":"59%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":576,"Dir":"./Algorithms/0576.out-of-boundary-paths","Title":"Out of Boundary Paths","TitleSlug":"out-of-boundary-paths","PassRate":"31%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":581,"Dir":"./Algorithms/0581.shortest-unsorted-continuous-subarray","Title":"Shortest Unsorted Continuous Subarray","TitleSlug":"shortest-unsorted-continuous-subarray","PassRate":"29%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":583,"Dir":"./Algorithms/0583.delete-operation-for-two-strings","Title":"Delete Operation for Two Strings","TitleSlug":"delete-operation-for-two-strings","PassRate":"44%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":587,"Dir":"./Algorithms/0587.erect-the-fence","Title":"Erect the Fence","TitleSlug":"erect-the-fence","PassRate":"32%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":591,"Dir":"./Algorithms/0591.tag-validator","Title":"Tag Validator","TitleSlug":"tag-validator","PassRate":"28%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":592,"Dir":"./Algorithms/0592.fraction-addition-and-subtraction","Title":"Fraction Addition and Subtraction","TitleSlug":"fraction-addition-and-subtraction","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":593,"Dir":"./Algorithms/0593.valid-square","Title":"Valid Square","TitleSlug":"valid-square","PassRate":"39%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":594,"Dir":"./Algorithms/0594.longest-harmonious-subsequence","Title":"Longest Harmonious Subsequence","TitleSlug":"longest-harmonious-subsequence","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":598,"Dir":"./Algorithms/0598.range-addition-ii","Title":"Range Addition II","TitleSlug":"range-addition-ii","PassRate":"48%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":599,"Dir":"./Algorithms/0599.minimum-index-sum-of-two-lists","Title":"Minimum Index Sum of Two Lists","TitleSlug":"minimum-index-sum-of-two-lists","PassRate":"46%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":600,"Dir":"./Algorithms/0600.non-negative-integers-without-consecutive-ones","Title":"Non-negative Integers without Consecutive Ones","TitleSlug":"non-negative-integers-without-consecutive-ones","PassRate":"29%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":605,"Dir":"./Algorithms/0605.can-place-flowers","Title":"Can Place Flowers","TitleSlug":"can-place-flowers","PassRate":"30%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":606,"Dir":"./Algorithms/0606.construct-string-from-binary-tree","Title":"Construct String from Binary Tree","TitleSlug":"construct-string-from-binary-tree","PassRate":"49%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":609,"Dir":"./Algorithms/0609.find-duplicate-file-in-system","Title":"Find Duplicate File in System","TitleSlug":"find-duplicate-file-in-system","PassRate":"52%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":611,"Dir":"./Algorithms/0611.valid-triangle-number","Title":"Valid Triangle Number","TitleSlug":"valid-triangle-number","PassRate":"41%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":617,"Dir":"./Algorithms/0617.merge-two-binary-trees","Title":"Merge Two Binary Trees","TitleSlug":"merge-two-binary-trees","PassRate":"68%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":621,"Dir":"./Algorithms/0621.task-scheduler","Title":"Task Scheduler","TitleSlug":"task-scheduler","PassRate":"42%","Difficulty":2,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":623,"Dir":"./Algorithms/0623.add-one-row-to-tree","Title":"Add One Row to Tree","TitleSlug":"add-one-row-to-tree","PassRate":"46%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":628,"Dir":"./Algorithms/0628.maximum-product-of-three-numbers","Title":"Maximum Product of Three Numbers","TitleSlug":"maximum-product-of-three-numbers","PassRate":"45%","Difficulty":1,"IsAccepted":true,"IsFavor":true,"IsNew":false},{"ID":629,"Dir":"./Algorithms/0629.k-inverse-pairs-array","Title":"K Inverse Pairs Array","TitleSlug":"k-inverse-pairs-array","PassRate":"25%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":630,"Dir":"./Algorithms/0630.course-schedule-iii","Title":"Course Schedule III","TitleSlug":"course-schedule-iii","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":632,"Dir":"./Algorithms/0632.smallest-range","Title":"Smallest Range","TitleSlug":"smallest-range","PassRate":"42%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":633,"Dir":"./Algorithms/0633.sum-of-square-numbers","Title":"Sum of Square Numbers","TitleSlug":"sum-of-square-numbers","PassRate":"31%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":636,"Dir":"./Algorithms/0636.exclusive-time-of-functions","Title":"Exclusive Time of Functions","TitleSlug":"exclusive-time-of-functions","PassRate":"41%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":637,"Dir":"./Algorithms/0637.average-of-levels-in-binary-tree","Title":"Average of Levels in Binary Tree","TitleSlug":"average-of-levels-in-binary-tree","PassRate":"56%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":638,"Dir":"./Algorithms/0638.shopping-offers","Title":"Shopping Offers","TitleSlug":"shopping-offers","PassRate":"42%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":639,"Dir":"./Algorithms/0639.decode-ways-ii","Title":"Decode Ways II","TitleSlug":"decode-ways-ii","PassRate":"23%","Difficulty":3,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":640,"Dir":"./Algorithms/0640.solve-the-equation","Title":"Solve the Equation","TitleSlug":"solve-the-equation","PassRate":"38%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":643,"Dir":"./Algorithms/0643.maximum-average-subarray-i","Title":"Maximum Average Subarray I","TitleSlug":"maximum-average-subarray-i","PassRate":"37%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":645,"Dir":"./Algorithms/0645.set-mismatch","Title":"Set Mismatch","TitleSlug":"set-mismatch","PassRate":"40%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":646,"Dir":"./Algorithms/0646.maximum-length-of-pair-chain","Title":"Maximum Length of Pair Chain","TitleSlug":"maximum-length-of-pair-chain","PassRate":"47%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":647,"Dir":"./Algorithms/0647.palindromic-substrings","Title":"Palindromic Substrings","TitleSlug":"palindromic-substrings","PassRate":"55%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":648,"Dir":"./Algorithms/0648.replace-words","Title":"Replace Words","TitleSlug":"replace-words","PassRate":"47%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":649,"Dir":"./Algorithms/0649.dota2-senate","Title":"Dota2 Senate","TitleSlug":"dota2-senate","PassRate":"35%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":650,"Dir":"./Algorithms/0650.2-keys-keyboard","Title":"2 Keys Keyboard","TitleSlug":"2-keys-keyboard","PassRate":"43%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":652,"Dir":"./Algorithms/0652.find-duplicate-subtrees","Title":"Find Duplicate Subtrees","TitleSlug":"find-duplicate-subtrees","PassRate":"33%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":653,"Dir":"./Algorithms/0653.two-sum-iv-input-is-a-bst","Title":"Two Sum IV - Input is a BST","TitleSlug":"two-sum-iv-input-is-a-bst","PassRate":"50%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":654,"Dir":"./Algorithms/0654.maximum-binary-tree","Title":"Maximum Binary Tree","TitleSlug":"maximum-binary-tree","PassRate":"70%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":655,"Dir":"./Algorithms/0655.print-binary-tree","Title":"Print Binary Tree","TitleSlug":"print-binary-tree","PassRate":"50%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":657,"Dir":"./Algorithms/0657.judge-route-circle","Title":"Judge Route Circle","TitleSlug":"judge-route-circle","PassRate":"69%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":658,"Dir":"./Algorithms/0658.find-k-closest-elements","Title":"Find K Closest Elements","TitleSlug":"find-k-closest-elements","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":659,"Dir":"./Algorithms/0659.split-array-into-consecutive-subsequences","Title":"Split Array into Consecutive Subsequences","TitleSlug":"split-array-into-consecutive-subsequences","PassRate":"34%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":661,"Dir":"./Algorithms/0661.image-smoother","Title":"Image Smoother","TitleSlug":"image-smoother","PassRate":"46%","Difficulty":1,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":662,"Dir":"./Algorithms/0662.maximum-width-of-binary-tree","Title":"Maximum Width of Binary Tree","TitleSlug":"maximum-width-of-binary-tree","PassRate":"36%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":664,"Dir":"./Algorithms/0664.strange-printer","Title":"Strange Printer","TitleSlug":"strange-printer","PassRate":"30%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":665,"Dir":"./Algorithms/0665.non-decreasing-array","Title":"Non-decreasing Array","TitleSlug":"non-decreasing-array","PassRate":"21%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":667,"Dir":"./Algorithms/0667.beautiful-arrangement-ii","Title":"Beautiful Arrangement II","TitleSlug":"beautiful-arrangement-ii","PassRate":"51%","Difficulty":2,"IsAccepted":true,"IsFavor":false,"IsNew":false},{"ID":668,"Dir":"./Algorithms/0668.kth-smallest-number-in-multiplication-table","Title":"Kth Smallest Number in Multiplication Table","TitleSlug":"kth-smallest-number-in-multiplication-table","PassRate":"36%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":669,"Dir":"./Algorithms/0669.trim-a-binary-search-tree","Title":"Trim a Binary Search Tree","TitleSlug":"trim-a-binary-search-tree","PassRate":"59%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":670,"Dir":"./Algorithms/0670.maximum-swap","Title":"Maximum Swap","TitleSlug":"maximum-swap","PassRate":"37%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":671,"Dir":"./Algorithms/0671.second-minimum-node-in-a-binary-tree","Title":"Second Minimum Node In a Binary Tree","TitleSlug":"second-minimum-node-in-a-binary-tree","PassRate":"42%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":672,"Dir":"./Algorithms/0672.bulb-switcher-ii","Title":"Bulb Switcher II","TitleSlug":"bulb-switcher-ii","PassRate":"45%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":false},{"ID":673,"Dir":"./Algorithms/0673.number-of-longest-increasing-subsequence","Title":"Number of Longest Increasing Subsequence","TitleSlug":"number-of-longest-increasing-subsequence","PassRate":"30%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":true},{"ID":674,"Dir":"./Algorithms/0674.longest-continuous-increasing-subsequence","Title":"Longest Continuous Increasing Subsequence","TitleSlug":"longest-continuous-increasing-subsequence","PassRate":"44%","Difficulty":1,"IsAccepted":false,"IsFavor":false,"IsNew":true},{"ID":675,"Dir":"./Algorithms/0675.cut-off-trees-for-golf-event","Title":"Cut Off Trees for Golf Event","TitleSlug":"cut-off-trees-for-golf-event","PassRate":"26%","Difficulty":3,"IsAccepted":false,"IsFavor":false,"IsNew":true},{"ID":676,"Dir":"./Algorithms/0676.implement-magic-dictionary","Title":"Implement Magic Dictionary","TitleSlug":"implement-magic-dictionary","PassRate":"51%","Difficulty":2,"IsAccepted":false,"IsFavor":false,"IsNew":true}]} \ No newline at end of file +{ + "Username": "aQuaYi", + "Ranking": 646, + "Updated": "2019-11-05T09:46:35.236486142+08:00", + "Record": { + "Easy": { + "Solved": 265, + "Total": 267 + }, + "Medium": { + "Solved": 456, + "Total": 472 + }, + "Hard": { + "Solved": 187, + "Total": 197 + }, + "Total": { + "Solved": 908, + "Total": 936 + } + }, + "Problems": [ + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1, + "Title": "Two Sum", + "TitleSlug": "two-sum", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 2, + "Title": "Add Two Numbers", + "TitleSlug": "add-two-numbers", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 3, + "Title": "Longest Substring Without Repeating Characters", + "TitleSlug": "longest-substring-without-repeating-characters", + "PassRate": "29%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 4, + "Title": "Median of Two Sorted Arrays", + "TitleSlug": "median-of-two-sorted-arrays", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 5, + "Title": "Longest Palindromic Substring", + "TitleSlug": "longest-palindromic-substring", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 6, + "Title": "ZigZag Conversion", + "TitleSlug": "zigzag-conversion", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 7, + "Title": "Reverse Integer", + "TitleSlug": "reverse-integer", + "PassRate": "25%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 8, + "Title": "String to Integer (atoi)", + "TitleSlug": "string-to-integer-atoi", + "PassRate": "14%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 9, + "Title": "Palindrome Number", + "TitleSlug": "palindrome-number", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 10, + "Title": "Regular Expression Matching", + "TitleSlug": "regular-expression-matching", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 11, + "Title": "Container With Most Water", + "TitleSlug": "container-with-most-water", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 12, + "Title": "Integer to Roman", + "TitleSlug": "integer-to-roman", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 13, + "Title": "Roman to Integer", + "TitleSlug": "roman-to-integer", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 14, + "Title": "Longest Common Prefix", + "TitleSlug": "longest-common-prefix", + "PassRate": "34%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 15, + "Title": "3Sum", + "TitleSlug": "3sum", + "PassRate": "25%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 16, + "Title": "3Sum Closest", + "TitleSlug": "3sum-closest", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 17, + "Title": "Letter Combinations of a Phone Number", + "TitleSlug": "letter-combinations-of-a-phone-number", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 18, + "Title": "4Sum", + "TitleSlug": "4sum", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 19, + "Title": "Remove Nth Node From End of List", + "TitleSlug": "remove-nth-node-from-end-of-list", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 20, + "Title": "Valid Parentheses", + "TitleSlug": "valid-parentheses", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 21, + "Title": "Merge Two Sorted Lists", + "TitleSlug": "merge-two-sorted-lists", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 22, + "Title": "Generate Parentheses", + "TitleSlug": "generate-parentheses", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 23, + "Title": "Merge k Sorted Lists", + "TitleSlug": "merge-k-sorted-lists", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 24, + "Title": "Swap Nodes in Pairs", + "TitleSlug": "swap-nodes-in-pairs", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 25, + "Title": "Reverse Nodes in k-Group", + "TitleSlug": "reverse-nodes-in-k-group", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 26, + "Title": "Remove Duplicates from Sorted Array", + "TitleSlug": "remove-duplicates-from-sorted-array", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 27, + "Title": "Remove Element", + "TitleSlug": "remove-element", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 28, + "Title": "Implement strStr()", + "TitleSlug": "implement-strstr", + "PassRate": "33%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 29, + "Title": "Divide Two Integers", + "TitleSlug": "divide-two-integers", + "PassRate": "16%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 30, + "Title": "Substring with Concatenation of All Words", + "TitleSlug": "substring-with-concatenation-of-all-words", + "PassRate": "24%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 31, + "Title": "Next Permutation", + "TitleSlug": "next-permutation", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 32, + "Title": "Longest Valid Parentheses", + "TitleSlug": "longest-valid-parentheses", + "PassRate": "26%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 33, + "Title": "Search in Rotated Sorted Array", + "TitleSlug": "search-in-rotated-sorted-array", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 34, + "Title": "Find First and Last Position of Element in Sorted Array", + "TitleSlug": "find-first-and-last-position-of-element-in-sorted-array", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 35, + "Title": "Search Insert Position", + "TitleSlug": "search-insert-position", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 36, + "Title": "Valid Sudoku", + "TitleSlug": "valid-sudoku", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 37, + "Title": "Sudoku Solver", + "TitleSlug": "sudoku-solver", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 38, + "Title": "Count and Say", + "TitleSlug": "count-and-say", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 39, + "Title": "Combination Sum", + "TitleSlug": "combination-sum", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 40, + "Title": "Combination Sum II", + "TitleSlug": "combination-sum-ii", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 41, + "Title": "First Missing Positive", + "TitleSlug": "first-missing-positive", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 42, + "Title": "Trapping Rain Water", + "TitleSlug": "trapping-rain-water", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 43, + "Title": "Multiply Strings", + "TitleSlug": "multiply-strings", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 44, + "Title": "Wildcard Matching", + "TitleSlug": "wildcard-matching", + "PassRate": "23%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 45, + "Title": "Jump Game II", + "TitleSlug": "jump-game-ii", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 46, + "Title": "Permutations", + "TitleSlug": "permutations", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 47, + "Title": "Permutations II", + "TitleSlug": "permutations-ii", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 48, + "Title": "Rotate Image", + "TitleSlug": "rotate-image", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 49, + "Title": "Group Anagrams", + "TitleSlug": "group-anagrams", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 50, + "Title": "Pow(x, n)", + "TitleSlug": "powx-n", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 51, + "Title": "N-Queens", + "TitleSlug": "n-queens", + "PassRate": "42%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 52, + "Title": "N-Queens II", + "TitleSlug": "n-queens-ii", + "PassRate": "54%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 53, + "Title": "Maximum Subarray", + "TitleSlug": "maximum-subarray", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 54, + "Title": "Spiral Matrix", + "TitleSlug": "spiral-matrix", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 55, + "Title": "Jump Game", + "TitleSlug": "jump-game", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 56, + "Title": "Merge Intervals", + "TitleSlug": "merge-intervals", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 57, + "Title": "Insert Interval", + "TitleSlug": "insert-interval", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 58, + "Title": "Length of Last Word", + "TitleSlug": "length-of-last-word", + "PassRate": "32%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 59, + "Title": "Spiral Matrix II", + "TitleSlug": "spiral-matrix-ii", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 60, + "Title": "Permutation Sequence", + "TitleSlug": "permutation-sequence", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 61, + "Title": "Rotate List", + "TitleSlug": "rotate-list", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 62, + "Title": "Unique Paths", + "TitleSlug": "unique-paths", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 63, + "Title": "Unique Paths II", + "TitleSlug": "unique-paths-ii", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 64, + "Title": "Minimum Path Sum", + "TitleSlug": "minimum-path-sum", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 65, + "Title": "Valid Number", + "TitleSlug": "valid-number", + "PassRate": "14%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 66, + "Title": "Plus One", + "TitleSlug": "plus-one", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 67, + "Title": "Add Binary", + "TitleSlug": "add-binary", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 68, + "Title": "Text Justification", + "TitleSlug": "text-justification", + "PassRate": "24%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 69, + "Title": "Sqrt(x)", + "TitleSlug": "sqrtx", + "PassRate": "32%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 70, + "Title": "Climbing Stairs", + "TitleSlug": "climbing-stairs", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 71, + "Title": "Simplify Path", + "TitleSlug": "simplify-path", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 72, + "Title": "Edit Distance", + "TitleSlug": "edit-distance", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 73, + "Title": "Set Matrix Zeroes", + "TitleSlug": "set-matrix-zeroes", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 74, + "Title": "Search a 2D Matrix", + "TitleSlug": "search-a-2d-matrix", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 75, + "Title": "Sort Colors", + "TitleSlug": "sort-colors", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 76, + "Title": "Minimum Window Substring", + "TitleSlug": "minimum-window-substring", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 77, + "Title": "Combinations", + "TitleSlug": "combinations", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 78, + "Title": "Subsets", + "TitleSlug": "subsets", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 79, + "Title": "Word Search", + "TitleSlug": "word-search", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 80, + "Title": "Remove Duplicates from Sorted Array II", + "TitleSlug": "remove-duplicates-from-sorted-array-ii", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 81, + "Title": "Search in Rotated Sorted Array II", + "TitleSlug": "search-in-rotated-sorted-array-ii", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 82, + "Title": "Remove Duplicates from Sorted List II", + "TitleSlug": "remove-duplicates-from-sorted-list-ii", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 83, + "Title": "Remove Duplicates from Sorted List", + "TitleSlug": "remove-duplicates-from-sorted-list", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 84, + "Title": "Largest Rectangle in Histogram", + "TitleSlug": "largest-rectangle-in-histogram", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 85, + "Title": "Maximal Rectangle", + "TitleSlug": "maximal-rectangle", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 86, + "Title": "Partition List", + "TitleSlug": "partition-list", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 87, + "Title": "Scramble String", + "TitleSlug": "scramble-string", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 88, + "Title": "Merge Sorted Array", + "TitleSlug": "merge-sorted-array", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 89, + "Title": "Gray Code", + "TitleSlug": "gray-code", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 90, + "Title": "Subsets II", + "TitleSlug": "subsets-ii", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 91, + "Title": "Decode Ways", + "TitleSlug": "decode-ways", + "PassRate": "23%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 92, + "Title": "Reverse Linked List II", + "TitleSlug": "reverse-linked-list-ii", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 93, + "Title": "Restore IP Addresses", + "TitleSlug": "restore-ip-addresses", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 94, + "Title": "Binary Tree Inorder Traversal", + "TitleSlug": "binary-tree-inorder-traversal", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 95, + "Title": "Unique Binary Search Trees II", + "TitleSlug": "unique-binary-search-trees-ii", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 96, + "Title": "Unique Binary Search Trees", + "TitleSlug": "unique-binary-search-trees", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 97, + "Title": "Interleaving String", + "TitleSlug": "interleaving-string", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 98, + "Title": "Validate Binary Search Tree", + "TitleSlug": "validate-binary-search-tree", + "PassRate": "26%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 99, + "Title": "Recover Binary Search Tree", + "TitleSlug": "recover-binary-search-tree", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 100, + "Title": "Same Tree", + "TitleSlug": "same-tree", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 101, + "Title": "Symmetric Tree", + "TitleSlug": "symmetric-tree", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 102, + "Title": "Binary Tree Level Order Traversal", + "TitleSlug": "binary-tree-level-order-traversal", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 103, + "Title": "Binary Tree Zigzag Level Order Traversal", + "TitleSlug": "binary-tree-zigzag-level-order-traversal", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 104, + "Title": "Maximum Depth of Binary Tree", + "TitleSlug": "maximum-depth-of-binary-tree", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 105, + "Title": "Construct Binary Tree from Preorder and Inorder Traversal", + "TitleSlug": "construct-binary-tree-from-preorder-and-inorder-traversal", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 106, + "Title": "Construct Binary Tree from Inorder and Postorder Traversal", + "TitleSlug": "construct-binary-tree-from-inorder-and-postorder-traversal", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 107, + "Title": "Binary Tree Level Order Traversal II", + "TitleSlug": "binary-tree-level-order-traversal-ii", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 108, + "Title": "Convert Sorted Array to Binary Search Tree", + "TitleSlug": "convert-sorted-array-to-binary-search-tree", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 109, + "Title": "Convert Sorted List to Binary Search Tree", + "TitleSlug": "convert-sorted-list-to-binary-search-tree", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 110, + "Title": "Balanced Binary Tree", + "TitleSlug": "balanced-binary-tree", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 111, + "Title": "Minimum Depth of Binary Tree", + "TitleSlug": "minimum-depth-of-binary-tree", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 112, + "Title": "Path Sum", + "TitleSlug": "path-sum", + "PassRate": "39%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 113, + "Title": "Path Sum II", + "TitleSlug": "path-sum-ii", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 114, + "Title": "Flatten Binary Tree to Linked List", + "TitleSlug": "flatten-binary-tree-to-linked-list", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 115, + "Title": "Distinct Subsequences", + "TitleSlug": "distinct-subsequences", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 116, + "Title": "Populating Next Right Pointers in Each Node", + "TitleSlug": "populating-next-right-pointers-in-each-node", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 117, + "Title": "Populating Next Right Pointers in Each Node II", + "TitleSlug": "populating-next-right-pointers-in-each-node-ii", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 118, + "Title": "Pascal's Triangle", + "TitleSlug": "pascals-triangle", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 119, + "Title": "Pascal's Triangle II", + "TitleSlug": "pascals-triangle-ii", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 120, + "Title": "Triangle", + "TitleSlug": "triangle", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 121, + "Title": "Best Time to Buy and Sell Stock", + "TitleSlug": "best-time-to-buy-and-sell-stock", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 122, + "Title": "Best Time to Buy and Sell Stock II", + "TitleSlug": "best-time-to-buy-and-sell-stock-ii", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 123, + "Title": "Best Time to Buy and Sell Stock III", + "TitleSlug": "best-time-to-buy-and-sell-stock-iii", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 124, + "Title": "Binary Tree Maximum Path Sum", + "TitleSlug": "binary-tree-maximum-path-sum", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 125, + "Title": "Valid Palindrome", + "TitleSlug": "valid-palindrome", + "PassRate": "32%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 126, + "Title": "Word Ladder II", + "TitleSlug": "word-ladder-ii", + "PassRate": "19%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 127, + "Title": "Word Ladder", + "TitleSlug": "word-ladder", + "PassRate": "26%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 128, + "Title": "Longest Consecutive Sequence", + "TitleSlug": "longest-consecutive-sequence", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 129, + "Title": "Sum Root to Leaf Numbers", + "TitleSlug": "sum-root-to-leaf-numbers", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 130, + "Title": "Surrounded Regions", + "TitleSlug": "surrounded-regions", + "PassRate": "24%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 131, + "Title": "Palindrome Partitioning", + "TitleSlug": "palindrome-partitioning", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 132, + "Title": "Palindrome Partitioning II", + "TitleSlug": "palindrome-partitioning-ii", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 133, + "Title": "Clone Graph", + "TitleSlug": "clone-graph", + "PassRate": "29%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 134, + "Title": "Gas Station", + "TitleSlug": "gas-station", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 135, + "Title": "Candy", + "TitleSlug": "candy", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 136, + "Title": "Single Number", + "TitleSlug": "single-number", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 137, + "Title": "Single Number II", + "TitleSlug": "single-number-ii", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 138, + "Title": "Copy List with Random Pointer", + "TitleSlug": "copy-list-with-random-pointer", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 139, + "Title": "Word Break", + "TitleSlug": "word-break", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 140, + "Title": "Word Break II", + "TitleSlug": "word-break-ii", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 141, + "Title": "Linked List Cycle", + "TitleSlug": "linked-list-cycle", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 142, + "Title": "Linked List Cycle II", + "TitleSlug": "linked-list-cycle-ii", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 143, + "Title": "Reorder List", + "TitleSlug": "reorder-list", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 144, + "Title": "Binary Tree Preorder Traversal", + "TitleSlug": "binary-tree-preorder-traversal", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 145, + "Title": "Binary Tree Postorder Traversal", + "TitleSlug": "binary-tree-postorder-traversal", + "PassRate": "50%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 146, + "Title": "LRU Cache", + "TitleSlug": "lru-cache", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 147, + "Title": "Insertion Sort List", + "TitleSlug": "insertion-sort-list", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 148, + "Title": "Sort List", + "TitleSlug": "sort-list", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 149, + "Title": "Max Points on a Line", + "TitleSlug": "max-points-on-a-line", + "PassRate": "16%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 150, + "Title": "Evaluate Reverse Polish Notation", + "TitleSlug": "evaluate-reverse-polish-notation", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 151, + "Title": "Reverse Words in a String", + "TitleSlug": "reverse-words-in-a-string", + "PassRate": "18%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 152, + "Title": "Maximum Product Subarray", + "TitleSlug": "maximum-product-subarray", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 153, + "Title": "Find Minimum in Rotated Sorted Array", + "TitleSlug": "find-minimum-in-rotated-sorted-array", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 154, + "Title": "Find Minimum in Rotated Sorted Array II", + "TitleSlug": "find-minimum-in-rotated-sorted-array-ii", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 155, + "Title": "Min Stack", + "TitleSlug": "min-stack", + "PassRate": "39%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 156, + "Title": "Binary Tree Upside Down", + "TitleSlug": "binary-tree-upside-down", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 157, + "Title": "Read N Characters Given Read4", + "TitleSlug": "read-n-characters-given-read4", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 158, + "Title": "Read N Characters Given Read4 II - Call multiple times", + "TitleSlug": "read-n-characters-given-read4-ii-call-multiple-times", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 159, + "Title": "Longest Substring with At Most Two Distinct Characters", + "TitleSlug": "longest-substring-with-at-most-two-distinct-characters", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 160, + "Title": "Intersection of Two Linked Lists", + "TitleSlug": "intersection-of-two-linked-lists", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 161, + "Title": "One Edit Distance", + "TitleSlug": "one-edit-distance", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 162, + "Title": "Find Peak Element", + "TitleSlug": "find-peak-element", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 163, + "Title": "Missing Ranges", + "TitleSlug": "missing-ranges", + "PassRate": "23%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 164, + "Title": "Maximum Gap", + "TitleSlug": "maximum-gap", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 165, + "Title": "Compare Version Numbers", + "TitleSlug": "compare-version-numbers", + "PassRate": "25%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 166, + "Title": "Fraction to Recurring Decimal", + "TitleSlug": "fraction-to-recurring-decimal", + "PassRate": "20%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 167, + "Title": "Two Sum II - Input array is sorted", + "TitleSlug": "two-sum-ii-input-array-is-sorted", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 168, + "Title": "Excel Sheet Column Title", + "TitleSlug": "excel-sheet-column-title", + "PassRate": "29%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 169, + "Title": "Majority Element", + "TitleSlug": "majority-element", + "PassRate": "54%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 170, + "Title": "Two Sum III - Data structure design", + "TitleSlug": "two-sum-iii-data-structure-design", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 171, + "Title": "Excel Sheet Column Number", + "TitleSlug": "excel-sheet-column-number", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 172, + "Title": "Factorial Trailing Zeroes", + "TitleSlug": "factorial-trailing-zeroes", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 173, + "Title": "Binary Search Tree Iterator", + "TitleSlug": "binary-search-tree-iterator", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 174, + "Title": "Dungeon Game", + "TitleSlug": "dungeon-game", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 179, + "Title": "Largest Number", + "TitleSlug": "largest-number", + "PassRate": "26%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 186, + "Title": "Reverse Words in a String II", + "TitleSlug": "reverse-words-in-a-string-ii", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 187, + "Title": "Repeated DNA Sequences", + "TitleSlug": "repeated-dna-sequences", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 188, + "Title": "Best Time to Buy and Sell Stock IV", + "TitleSlug": "best-time-to-buy-and-sell-stock-iv", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 189, + "Title": "Rotate Array", + "TitleSlug": "rotate-array", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 190, + "Title": "Reverse Bits", + "TitleSlug": "reverse-bits", + "PassRate": "33%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 191, + "Title": "Number of 1 Bits", + "TitleSlug": "number-of-1-bits", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 198, + "Title": "House Robber", + "TitleSlug": "house-robber", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 199, + "Title": "Binary Tree Right Side View", + "TitleSlug": "binary-tree-right-side-view", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 200, + "Title": "Number of Islands", + "TitleSlug": "number-of-islands", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 201, + "Title": "Bitwise AND of Numbers Range", + "TitleSlug": "bitwise-and-of-numbers-range", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 202, + "Title": "Happy Number", + "TitleSlug": "happy-number", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 203, + "Title": "Remove Linked List Elements", + "TitleSlug": "remove-linked-list-elements", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 204, + "Title": "Count Primes", + "TitleSlug": "count-primes", + "PassRate": "30%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 205, + "Title": "Isomorphic Strings", + "TitleSlug": "isomorphic-strings", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 206, + "Title": "Reverse Linked List", + "TitleSlug": "reverse-linked-list", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 207, + "Title": "Course Schedule", + "TitleSlug": "course-schedule", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 208, + "Title": "Implement Trie (Prefix Tree)", + "TitleSlug": "implement-trie-prefix-tree", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 209, + "Title": "Minimum Size Subarray Sum", + "TitleSlug": "minimum-size-subarray-sum", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 210, + "Title": "Course Schedule II", + "TitleSlug": "course-schedule-ii", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 211, + "Title": "Add and Search Word - Data structure design", + "TitleSlug": "add-and-search-word-data-structure-design", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 212, + "Title": "Word Search II", + "TitleSlug": "word-search-ii", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 213, + "Title": "House Robber II", + "TitleSlug": "house-robber-ii", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 214, + "Title": "Shortest Palindrome", + "TitleSlug": "shortest-palindrome", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 215, + "Title": "Kth Largest Element in an Array", + "TitleSlug": "kth-largest-element-in-an-array", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 216, + "Title": "Combination Sum III", + "TitleSlug": "combination-sum-iii", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 217, + "Title": "Contains Duplicate", + "TitleSlug": "contains-duplicate", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 218, + "Title": "The Skyline Problem", + "TitleSlug": "the-skyline-problem", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 219, + "Title": "Contains Duplicate II", + "TitleSlug": "contains-duplicate-ii", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 220, + "Title": "Contains Duplicate III", + "TitleSlug": "contains-duplicate-iii", + "PassRate": "20%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 221, + "Title": "Maximal Square", + "TitleSlug": "maximal-square", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 222, + "Title": "Count Complete Tree Nodes", + "TitleSlug": "count-complete-tree-nodes", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 223, + "Title": "Rectangle Area", + "TitleSlug": "rectangle-area", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 224, + "Title": "Basic Calculator", + "TitleSlug": "basic-calculator", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 225, + "Title": "Implement Stack using Queues", + "TitleSlug": "implement-stack-using-queues", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 226, + "Title": "Invert Binary Tree", + "TitleSlug": "invert-binary-tree", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 227, + "Title": "Basic Calculator II", + "TitleSlug": "basic-calculator-ii", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 228, + "Title": "Summary Ranges", + "TitleSlug": "summary-ranges", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 229, + "Title": "Majority Element II", + "TitleSlug": "majority-element-ii", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 230, + "Title": "Kth Smallest Element in a BST", + "TitleSlug": "kth-smallest-element-in-a-bst", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 231, + "Title": "Power of Two", + "TitleSlug": "power-of-two", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 232, + "Title": "Implement Queue using Stacks", + "TitleSlug": "implement-queue-using-stacks", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 233, + "Title": "Number of Digit One", + "TitleSlug": "number-of-digit-one", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 234, + "Title": "Palindrome Linked List", + "TitleSlug": "palindrome-linked-list", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 235, + "Title": "Lowest Common Ancestor of a Binary Search Tree", + "TitleSlug": "lowest-common-ancestor-of-a-binary-search-tree", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 236, + "Title": "Lowest Common Ancestor of a Binary Tree", + "TitleSlug": "lowest-common-ancestor-of-a-binary-tree", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 237, + "Title": "Delete Node in a Linked List", + "TitleSlug": "delete-node-in-a-linked-list", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 238, + "Title": "Product of Array Except Self", + "TitleSlug": "product-of-array-except-self", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 239, + "Title": "Sliding Window Maximum", + "TitleSlug": "sliding-window-maximum", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 240, + "Title": "Search a 2D Matrix II", + "TitleSlug": "search-a-2d-matrix-ii", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 241, + "Title": "Different Ways to Add Parentheses", + "TitleSlug": "different-ways-to-add-parentheses", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 242, + "Title": "Valid Anagram", + "TitleSlug": "valid-anagram", + "PassRate": "54%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 243, + "Title": "Shortest Word Distance", + "TitleSlug": "shortest-word-distance", + "PassRate": "58%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 244, + "Title": "Shortest Word Distance II", + "TitleSlug": "shortest-word-distance-ii", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 245, + "Title": "Shortest Word Distance III", + "TitleSlug": "shortest-word-distance-iii", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 246, + "Title": "Strobogrammatic Number", + "TitleSlug": "strobogrammatic-number", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 247, + "Title": "Strobogrammatic Number II", + "TitleSlug": "strobogrammatic-number-ii", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 248, + "Title": "Strobogrammatic Number III", + "TitleSlug": "strobogrammatic-number-iii", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 249, + "Title": "Group Shifted Strings", + "TitleSlug": "group-shifted-strings", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 250, + "Title": "Count Univalue Subtrees", + "TitleSlug": "count-univalue-subtrees", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 251, + "Title": "Flatten 2D Vector", + "TitleSlug": "flatten-2d-vector", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 252, + "Title": "Meeting Rooms", + "TitleSlug": "meeting-rooms", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 253, + "Title": "Meeting Rooms II", + "TitleSlug": "meeting-rooms-ii", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 254, + "Title": "Factor Combinations", + "TitleSlug": "factor-combinations", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 255, + "Title": "Verify Preorder Sequence in Binary Search Tree", + "TitleSlug": "verify-preorder-sequence-in-binary-search-tree", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 256, + "Title": "Paint House", + "TitleSlug": "paint-house", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 257, + "Title": "Binary Tree Paths", + "TitleSlug": "binary-tree-paths", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 258, + "Title": "Add Digits", + "TitleSlug": "add-digits", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 259, + "Title": "3Sum Smaller", + "TitleSlug": "3sum-smaller", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 260, + "Title": "Single Number III", + "TitleSlug": "single-number-iii", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 261, + "Title": "Graph Valid Tree", + "TitleSlug": "graph-valid-tree", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 263, + "Title": "Ugly Number", + "TitleSlug": "ugly-number", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 264, + "Title": "Ugly Number II", + "TitleSlug": "ugly-number-ii", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 265, + "Title": "Paint House II", + "TitleSlug": "paint-house-ii", + "PassRate": "42%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 266, + "Title": "Palindrome Permutation", + "TitleSlug": "palindrome-permutation", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 267, + "Title": "Palindrome Permutation II", + "TitleSlug": "palindrome-permutation-ii", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 268, + "Title": "Missing Number", + "TitleSlug": "missing-number", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 269, + "Title": "Alien Dictionary", + "TitleSlug": "alien-dictionary", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 270, + "Title": "Closest Binary Search Tree Value", + "TitleSlug": "closest-binary-search-tree-value", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 271, + "Title": "Encode and Decode Strings", + "TitleSlug": "encode-and-decode-strings", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 272, + "Title": "Closest Binary Search Tree Value II", + "TitleSlug": "closest-binary-search-tree-value-ii", + "PassRate": "47%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 273, + "Title": "Integer to English Words", + "TitleSlug": "integer-to-english-words", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 274, + "Title": "H-Index", + "TitleSlug": "h-index", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 275, + "Title": "H-Index II", + "TitleSlug": "h-index-ii", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 276, + "Title": "Paint Fence", + "TitleSlug": "paint-fence", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 277, + "Title": "Find the Celebrity", + "TitleSlug": "find-the-celebrity", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 278, + "Title": "First Bad Version", + "TitleSlug": "first-bad-version", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 279, + "Title": "Perfect Squares", + "TitleSlug": "perfect-squares", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 280, + "Title": "Wiggle Sort", + "TitleSlug": "wiggle-sort", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 281, + "Title": "Zigzag Iterator", + "TitleSlug": "zigzag-iterator", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 282, + "Title": "Expression Add Operators", + "TitleSlug": "expression-add-operators", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 283, + "Title": "Move Zeroes", + "TitleSlug": "move-zeroes", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 284, + "Title": "Peeking Iterator", + "TitleSlug": "peeking-iterator", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 285, + "Title": "Inorder Successor in BST", + "TitleSlug": "inorder-successor-in-bst", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 286, + "Title": "Walls and Gates", + "TitleSlug": "walls-and-gates", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 287, + "Title": "Find the Duplicate Number", + "TitleSlug": "find-the-duplicate-number", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 288, + "Title": "Unique Word Abbreviation", + "TitleSlug": "unique-word-abbreviation", + "PassRate": "20%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 289, + "Title": "Game of Life", + "TitleSlug": "game-of-life", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 290, + "Title": "Word Pattern", + "TitleSlug": "word-pattern", + "PassRate": "35%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 291, + "Title": "Word Pattern II", + "TitleSlug": "word-pattern-ii", + "PassRate": "42%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 292, + "Title": "Nim Game", + "TitleSlug": "nim-game", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 293, + "Title": "Flip Game", + "TitleSlug": "flip-game", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 294, + "Title": "Flip Game II", + "TitleSlug": "flip-game-ii", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 295, + "Title": "Find Median from Data Stream", + "TitleSlug": "find-median-from-data-stream", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 296, + "Title": "Best Meeting Point", + "TitleSlug": "best-meeting-point", + "PassRate": "56%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 297, + "Title": "Serialize and Deserialize Binary Tree", + "TitleSlug": "serialize-and-deserialize-binary-tree", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 298, + "Title": "Binary Tree Longest Consecutive Sequence", + "TitleSlug": "binary-tree-longest-consecutive-sequence", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 299, + "Title": "Bulls and Cows", + "TitleSlug": "bulls-and-cows", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 300, + "Title": "Longest Increasing Subsequence", + "TitleSlug": "longest-increasing-subsequence", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 301, + "Title": "Remove Invalid Parentheses", + "TitleSlug": "remove-invalid-parentheses", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 302, + "Title": "Smallest Rectangle Enclosing Black Pixels", + "TitleSlug": "smallest-rectangle-enclosing-black-pixels", + "PassRate": "50%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 303, + "Title": "Range Sum Query - Immutable", + "TitleSlug": "range-sum-query-immutable", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 304, + "Title": "Range Sum Query 2D - Immutable", + "TitleSlug": "range-sum-query-2d-immutable", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 305, + "Title": "Number of Islands II", + "TitleSlug": "number-of-islands-ii", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 306, + "Title": "Additive Number", + "TitleSlug": "additive-number", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 307, + "Title": "Range Sum Query - Mutable", + "TitleSlug": "range-sum-query-mutable", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 308, + "Title": "Range Sum Query 2D - Mutable", + "TitleSlug": "range-sum-query-2d-mutable", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 309, + "Title": "Best Time to Buy and Sell Stock with Cooldown", + "TitleSlug": "best-time-to-buy-and-sell-stock-with-cooldown", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 310, + "Title": "Minimum Height Trees", + "TitleSlug": "minimum-height-trees", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 311, + "Title": "Sparse Matrix Multiplication", + "TitleSlug": "sparse-matrix-multiplication", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 312, + "Title": "Burst Balloons", + "TitleSlug": "burst-balloons", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 313, + "Title": "Super Ugly Number", + "TitleSlug": "super-ugly-number", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 314, + "Title": "Binary Tree Vertical Order Traversal", + "TitleSlug": "binary-tree-vertical-order-traversal", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 315, + "Title": "Count of Smaller Numbers After Self", + "TitleSlug": "count-of-smaller-numbers-after-self", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 316, + "Title": "Remove Duplicate Letters", + "TitleSlug": "remove-duplicate-letters", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 317, + "Title": "Shortest Distance from All Buildings", + "TitleSlug": "shortest-distance-from-all-buildings", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 318, + "Title": "Maximum Product of Word Lengths", + "TitleSlug": "maximum-product-of-word-lengths", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 319, + "Title": "Bulb Switcher", + "TitleSlug": "bulb-switcher", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 320, + "Title": "Generalized Abbreviation", + "TitleSlug": "generalized-abbreviation", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 321, + "Title": "Create Maximum Number", + "TitleSlug": "create-maximum-number", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 322, + "Title": "Coin Change", + "TitleSlug": "coin-change", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 323, + "Title": "Number of Connected Components in an Undirected Graph", + "TitleSlug": "number-of-connected-components-in-an-undirected-graph", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 324, + "Title": "Wiggle Sort II", + "TitleSlug": "wiggle-sort-ii", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 325, + "Title": "Maximum Size Subarray Sum Equals k", + "TitleSlug": "maximum-size-subarray-sum-equals-k", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 326, + "Title": "Power of Three", + "TitleSlug": "power-of-three", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 327, + "Title": "Count of Range Sum", + "TitleSlug": "count-of-range-sum", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 328, + "Title": "Odd Even Linked List", + "TitleSlug": "odd-even-linked-list", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 329, + "Title": "Longest Increasing Path in a Matrix", + "TitleSlug": "longest-increasing-path-in-a-matrix", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 330, + "Title": "Patching Array", + "TitleSlug": "patching-array", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 331, + "Title": "Verify Preorder Serialization of a Binary Tree", + "TitleSlug": "verify-preorder-serialization-of-a-binary-tree", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 332, + "Title": "Reconstruct Itinerary", + "TitleSlug": "reconstruct-itinerary", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 333, + "Title": "Largest BST Subtree", + "TitleSlug": "largest-bst-subtree", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 334, + "Title": "Increasing Triplet Subsequence", + "TitleSlug": "increasing-triplet-subsequence", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 335, + "Title": "Self Crossing", + "TitleSlug": "self-crossing", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 336, + "Title": "Palindrome Pairs", + "TitleSlug": "palindrome-pairs", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 337, + "Title": "House Robber III", + "TitleSlug": "house-robber-iii", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 338, + "Title": "Counting Bits", + "TitleSlug": "counting-bits", + "PassRate": "65%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 339, + "Title": "Nested List Weight Sum", + "TitleSlug": "nested-list-weight-sum", + "PassRate": "70%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 340, + "Title": "Longest Substring with At Most K Distinct Characters", + "TitleSlug": "longest-substring-with-at-most-k-distinct-characters", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 341, + "Title": "Flatten Nested List Iterator", + "TitleSlug": "flatten-nested-list-iterator", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 342, + "Title": "Power of Four", + "TitleSlug": "power-of-four", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 343, + "Title": "Integer Break", + "TitleSlug": "integer-break", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 344, + "Title": "Reverse String", + "TitleSlug": "reverse-string", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 345, + "Title": "Reverse Vowels of a String", + "TitleSlug": "reverse-vowels-of-a-string", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 346, + "Title": "Moving Average from Data Stream", + "TitleSlug": "moving-average-from-data-stream", + "PassRate": "68%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 347, + "Title": "Top K Frequent Elements", + "TitleSlug": "top-k-frequent-elements", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 348, + "Title": "Design Tic-Tac-Toe", + "TitleSlug": "design-tic-tac-toe", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 349, + "Title": "Intersection of Two Arrays", + "TitleSlug": "intersection-of-two-arrays", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 350, + "Title": "Intersection of Two Arrays II", + "TitleSlug": "intersection-of-two-arrays-ii", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 351, + "Title": "Android Unlock Patterns", + "TitleSlug": "android-unlock-patterns", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 352, + "Title": "Data Stream as Disjoint Intervals", + "TitleSlug": "data-stream-as-disjoint-intervals", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 353, + "Title": "Design Snake Game", + "TitleSlug": "design-snake-game", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 354, + "Title": "Russian Doll Envelopes", + "TitleSlug": "russian-doll-envelopes", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 355, + "Title": "Design Twitter", + "TitleSlug": "design-twitter", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 356, + "Title": "Line Reflection", + "TitleSlug": "line-reflection", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 357, + "Title": "Count Numbers with Unique Digits", + "TitleSlug": "count-numbers-with-unique-digits", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 358, + "Title": "Rearrange String k Distance Apart", + "TitleSlug": "rearrange-string-k-distance-apart", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 359, + "Title": "Logger Rate Limiter", + "TitleSlug": "logger-rate-limiter", + "PassRate": "67%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 360, + "Title": "Sort Transformed Array", + "TitleSlug": "sort-transformed-array", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 361, + "Title": "Bomb Enemy", + "TitleSlug": "bomb-enemy", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 362, + "Title": "Design Hit Counter", + "TitleSlug": "design-hit-counter", + "PassRate": "60%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 363, + "Title": "Max Sum of Rectangle No Larger Than K", + "TitleSlug": "max-sum-of-rectangle-no-larger-than-k", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 364, + "Title": "Nested List Weight Sum II", + "TitleSlug": "nested-list-weight-sum-ii", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 365, + "Title": "Water and Jug Problem", + "TitleSlug": "water-and-jug-problem", + "PassRate": "29%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 366, + "Title": "Find Leaves of Binary Tree", + "TitleSlug": "find-leaves-of-binary-tree", + "PassRate": "68%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 367, + "Title": "Valid Perfect Square", + "TitleSlug": "valid-perfect-square", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 368, + "Title": "Largest Divisible Subset", + "TitleSlug": "largest-divisible-subset", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 369, + "Title": "Plus One Linked List", + "TitleSlug": "plus-one-linked-list", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 370, + "Title": "Range Addition", + "TitleSlug": "range-addition", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 371, + "Title": "Sum of Two Integers", + "TitleSlug": "sum-of-two-integers", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 372, + "Title": "Super Pow", + "TitleSlug": "super-pow", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 373, + "Title": "Find K Pairs with Smallest Sums", + "TitleSlug": "find-k-pairs-with-smallest-sums", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 374, + "Title": "Guess Number Higher or Lower", + "TitleSlug": "guess-number-higher-or-lower", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 375, + "Title": "Guess Number Higher or Lower II", + "TitleSlug": "guess-number-higher-or-lower-ii", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 376, + "Title": "Wiggle Subsequence", + "TitleSlug": "wiggle-subsequence", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 377, + "Title": "Combination Sum IV", + "TitleSlug": "combination-sum-iv", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 378, + "Title": "Kth Smallest Element in a Sorted Matrix", + "TitleSlug": "kth-smallest-element-in-a-sorted-matrix", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 379, + "Title": "Design Phone Directory", + "TitleSlug": "design-phone-directory", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 380, + "Title": "Insert Delete GetRandom O(1)", + "TitleSlug": "insert-delete-getrandom-o1", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 381, + "Title": "Insert Delete GetRandom O(1) - Duplicates allowed", + "TitleSlug": "insert-delete-getrandom-o1-duplicates-allowed", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 382, + "Title": "Linked List Random Node", + "TitleSlug": "linked-list-random-node", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 383, + "Title": "Ransom Note", + "TitleSlug": "ransom-note", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 384, + "Title": "Shuffle an Array", + "TitleSlug": "shuffle-an-array", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 385, + "Title": "Mini Parser", + "TitleSlug": "mini-parser", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 386, + "Title": "Lexicographical Numbers", + "TitleSlug": "lexicographical-numbers", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 387, + "Title": "First Unique Character in a String", + "TitleSlug": "first-unique-character-in-a-string", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 388, + "Title": "Longest Absolute File Path", + "TitleSlug": "longest-absolute-file-path", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 389, + "Title": "Find the Difference", + "TitleSlug": "find-the-difference", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 390, + "Title": "Elimination Game", + "TitleSlug": "elimination-game", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 391, + "Title": "Perfect Rectangle", + "TitleSlug": "perfect-rectangle", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 392, + "Title": "Is Subsequence", + "TitleSlug": "is-subsequence", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 393, + "Title": "UTF-8 Validation", + "TitleSlug": "utf-8-validation", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 394, + "Title": "Decode String", + "TitleSlug": "decode-string", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 395, + "Title": "Longest Substring with At Least K Repeating Characters", + "TitleSlug": "longest-substring-with-at-least-k-repeating-characters", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 396, + "Title": "Rotate Function", + "TitleSlug": "rotate-function", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 397, + "Title": "Integer Replacement", + "TitleSlug": "integer-replacement", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 398, + "Title": "Random Pick Index", + "TitleSlug": "random-pick-index", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 399, + "Title": "Evaluate Division", + "TitleSlug": "evaluate-division", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 400, + "Title": "Nth Digit", + "TitleSlug": "nth-digit", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 401, + "Title": "Binary Watch", + "TitleSlug": "binary-watch", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 402, + "Title": "Remove K Digits", + "TitleSlug": "remove-k-digits", + "PassRate": "27%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 403, + "Title": "Frog Jump", + "TitleSlug": "frog-jump", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 404, + "Title": "Sum of Left Leaves", + "TitleSlug": "sum-of-left-leaves", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 405, + "Title": "Convert a Number to Hexadecimal", + "TitleSlug": "convert-a-number-to-hexadecimal", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 406, + "Title": "Queue Reconstruction by Height", + "TitleSlug": "queue-reconstruction-by-height", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 407, + "Title": "Trapping Rain Water II", + "TitleSlug": "trapping-rain-water-ii", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 408, + "Title": "Valid Word Abbreviation", + "TitleSlug": "valid-word-abbreviation", + "PassRate": "29%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 409, + "Title": "Longest Palindrome", + "TitleSlug": "longest-palindrome", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 410, + "Title": "Split Array Largest Sum", + "TitleSlug": "split-array-largest-sum", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 411, + "Title": "Minimum Unique Word Abbreviation", + "TitleSlug": "minimum-unique-word-abbreviation", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 412, + "Title": "Fizz Buzz", + "TitleSlug": "fizz-buzz", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 413, + "Title": "Arithmetic Slices", + "TitleSlug": "arithmetic-slices", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 414, + "Title": "Third Maximum Number", + "TitleSlug": "third-maximum-number", + "PassRate": "29%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 415, + "Title": "Add Strings", + "TitleSlug": "add-strings", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 416, + "Title": "Partition Equal Subset Sum", + "TitleSlug": "partition-equal-subset-sum", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 417, + "Title": "Pacific Atlantic Water Flow", + "TitleSlug": "pacific-atlantic-water-flow", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 418, + "Title": "Sentence Screen Fitting", + "TitleSlug": "sentence-screen-fitting", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 419, + "Title": "Battleships in a Board", + "TitleSlug": "battleships-in-a-board", + "PassRate": "66%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 420, + "Title": "Strong Password Checker", + "TitleSlug": "strong-password-checker", + "PassRate": "16%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 421, + "Title": "Maximum XOR of Two Numbers in an Array", + "TitleSlug": "maximum-xor-of-two-numbers-in-an-array", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 422, + "Title": "Valid Word Square", + "TitleSlug": "valid-word-square", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 423, + "Title": "Reconstruct Original Digits from English", + "TitleSlug": "reconstruct-original-digits-from-english", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 424, + "Title": "Longest Repeating Character Replacement", + "TitleSlug": "longest-repeating-character-replacement", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 425, + "Title": "Word Squares", + "TitleSlug": "word-squares", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 426, + "Title": "Convert Binary Search Tree to Sorted Doubly Linked List", + "TitleSlug": "convert-binary-search-tree-to-sorted-doubly-linked-list", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 427, + "Title": "Construct Quad Tree", + "TitleSlug": "construct-quad-tree", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 428, + "Title": "Serialize and Deserialize N-ary Tree", + "TitleSlug": "serialize-and-deserialize-n-ary-tree", + "PassRate": "56%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 429, + "Title": "N-ary Tree Level Order Traversal", + "TitleSlug": "n-ary-tree-level-order-traversal", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 430, + "Title": "Flatten a Multilevel Doubly Linked List", + "TitleSlug": "flatten-a-multilevel-doubly-linked-list", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 431, + "Title": "Encode N-ary Tree to Binary Tree", + "TitleSlug": "encode-n-ary-tree-to-binary-tree", + "PassRate": "66%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 432, + "Title": "All O`one Data Structure", + "TitleSlug": "all-oone-data-structure", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 433, + "Title": "Minimum Genetic Mutation", + "TitleSlug": "minimum-genetic-mutation", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 434, + "Title": "Number of Segments in a String", + "TitleSlug": "number-of-segments-in-a-string", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 435, + "Title": "Non-overlapping Intervals", + "TitleSlug": "non-overlapping-intervals", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 436, + "Title": "Find Right Interval", + "TitleSlug": "find-right-interval", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 437, + "Title": "Path Sum III", + "TitleSlug": "path-sum-iii", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 438, + "Title": "Find All Anagrams in a String", + "TitleSlug": "find-all-anagrams-in-a-string", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 439, + "Title": "Ternary Expression Parser", + "TitleSlug": "ternary-expression-parser", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 440, + "Title": "K-th Smallest in Lexicographical Order", + "TitleSlug": "k-th-smallest-in-lexicographical-order", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 441, + "Title": "Arranging Coins", + "TitleSlug": "arranging-coins", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 442, + "Title": "Find All Duplicates in an Array", + "TitleSlug": "find-all-duplicates-in-an-array", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 443, + "Title": "String Compression", + "TitleSlug": "string-compression", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 444, + "Title": "Sequence Reconstruction", + "TitleSlug": "sequence-reconstruction", + "PassRate": "20%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 445, + "Title": "Add Two Numbers II", + "TitleSlug": "add-two-numbers-ii", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 446, + "Title": "Arithmetic Slices II - Subsequence", + "TitleSlug": "arithmetic-slices-ii-subsequence", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 447, + "Title": "Number of Boomerangs", + "TitleSlug": "number-of-boomerangs", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 448, + "Title": "Find All Numbers Disappeared in an Array", + "TitleSlug": "find-all-numbers-disappeared-in-an-array", + "PassRate": "54%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 449, + "Title": "Serialize and Deserialize BST", + "TitleSlug": "serialize-and-deserialize-bst", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 450, + "Title": "Delete Node in a BST", + "TitleSlug": "delete-node-in-a-bst", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 451, + "Title": "Sort Characters By Frequency", + "TitleSlug": "sort-characters-by-frequency", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 452, + "Title": "Minimum Number of Arrows to Burst Balloons", + "TitleSlug": "minimum-number-of-arrows-to-burst-balloons", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 453, + "Title": "Minimum Moves to Equal Array Elements", + "TitleSlug": "minimum-moves-to-equal-array-elements", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 454, + "Title": "4Sum II", + "TitleSlug": "4sum-ii", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 455, + "Title": "Assign Cookies", + "TitleSlug": "assign-cookies", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 456, + "Title": "132 Pattern", + "TitleSlug": "132-pattern", + "PassRate": "27%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 457, + "Title": "Circular Array Loop", + "TitleSlug": "circular-array-loop", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 458, + "Title": "Poor Pigs", + "TitleSlug": "poor-pigs", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 459, + "Title": "Repeated Substring Pattern", + "TitleSlug": "repeated-substring-pattern", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 460, + "Title": "LFU Cache", + "TitleSlug": "lfu-cache", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 461, + "Title": "Hamming Distance", + "TitleSlug": "hamming-distance", + "PassRate": "70%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 462, + "Title": "Minimum Moves to Equal Array Elements II", + "TitleSlug": "minimum-moves-to-equal-array-elements-ii", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 463, + "Title": "Island Perimeter", + "TitleSlug": "island-perimeter", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 464, + "Title": "Can I Win", + "TitleSlug": "can-i-win", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 465, + "Title": "Optimal Account Balancing", + "TitleSlug": "optimal-account-balancing", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 466, + "Title": "Count The Repetitions", + "TitleSlug": "count-the-repetitions", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 467, + "Title": "Unique Substrings in Wraparound String", + "TitleSlug": "unique-substrings-in-wraparound-string", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 468, + "Title": "Validate IP Address", + "TitleSlug": "validate-ip-address", + "PassRate": "21%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 469, + "Title": "Convex Polygon", + "TitleSlug": "convex-polygon", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 470, + "Title": "Implement Rand10() Using Rand7()", + "TitleSlug": "implement-rand10-using-rand7", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 471, + "Title": "Encode String with Shortest Length", + "TitleSlug": "encode-string-with-shortest-length", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 472, + "Title": "Concatenated Words", + "TitleSlug": "concatenated-words", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 473, + "Title": "Matchsticks to Square", + "TitleSlug": "matchsticks-to-square", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 474, + "Title": "Ones and Zeroes", + "TitleSlug": "ones-and-zeroes", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 475, + "Title": "Heaters", + "TitleSlug": "heaters", + "PassRate": "32%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 476, + "Title": "Number Complement", + "TitleSlug": "number-complement", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 477, + "Title": "Total Hamming Distance", + "TitleSlug": "total-hamming-distance", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 478, + "Title": "Generate Random Point in a Circle", + "TitleSlug": "generate-random-point-in-a-circle", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 479, + "Title": "Largest Palindrome Product", + "TitleSlug": "largest-palindrome-product", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 480, + "Title": "Sliding Window Median", + "TitleSlug": "sliding-window-median", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 481, + "Title": "Magical String", + "TitleSlug": "magical-string", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 482, + "Title": "License Key Formatting", + "TitleSlug": "license-key-formatting", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 483, + "Title": "Smallest Good Base", + "TitleSlug": "smallest-good-base", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 484, + "Title": "Find Permutation", + "TitleSlug": "find-permutation", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 485, + "Title": "Max Consecutive Ones", + "TitleSlug": "max-consecutive-ones", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 486, + "Title": "Predict the Winner", + "TitleSlug": "predict-the-winner", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 487, + "Title": "Max Consecutive Ones II", + "TitleSlug": "max-consecutive-ones-ii", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 488, + "Title": "Zuma Game", + "TitleSlug": "zuma-game", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 489, + "Title": "Robot Room Cleaner", + "TitleSlug": "robot-room-cleaner", + "PassRate": "66%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 490, + "Title": "The Maze", + "TitleSlug": "the-maze", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 491, + "Title": "Increasing Subsequences", + "TitleSlug": "increasing-subsequences", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 492, + "Title": "Construct the Rectangle", + "TitleSlug": "construct-the-rectangle", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 493, + "Title": "Reverse Pairs", + "TitleSlug": "reverse-pairs", + "PassRate": "23%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 494, + "Title": "Target Sum", + "TitleSlug": "target-sum", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 495, + "Title": "Teemo Attacking", + "TitleSlug": "teemo-attacking", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 496, + "Title": "Next Greater Element I", + "TitleSlug": "next-greater-element-i", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 497, + "Title": "Random Point in Non-overlapping Rectangles", + "TitleSlug": "random-point-in-non-overlapping-rectangles", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 498, + "Title": "Diagonal Traverse", + "TitleSlug": "diagonal-traverse", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 499, + "Title": "The Maze III", + "TitleSlug": "the-maze-iii", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 500, + "Title": "Keyboard Row", + "TitleSlug": "keyboard-row", + "PassRate": "63%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 501, + "Title": "Find Mode in Binary Search Tree", + "TitleSlug": "find-mode-in-binary-search-tree", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 502, + "Title": "IPO", + "TitleSlug": "ipo", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 503, + "Title": "Next Greater Element II", + "TitleSlug": "next-greater-element-ii", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 504, + "Title": "Base 7", + "TitleSlug": "base-7", + "PassRate": "45%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 505, + "Title": "The Maze II", + "TitleSlug": "the-maze-ii", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 506, + "Title": "Relative Ranks", + "TitleSlug": "relative-ranks", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 507, + "Title": "Perfect Number", + "TitleSlug": "perfect-number", + "PassRate": "35%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 508, + "Title": "Most Frequent Subtree Sum", + "TitleSlug": "most-frequent-subtree-sum", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 509, + "Title": "Fibonacci Number", + "TitleSlug": "fibonacci-number", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 510, + "Title": "Inorder Successor in BST II", + "TitleSlug": "inorder-successor-in-bst-ii", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 513, + "Title": "Find Bottom Left Tree Value", + "TitleSlug": "find-bottom-left-tree-value", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 514, + "Title": "Freedom Trail", + "TitleSlug": "freedom-trail", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 515, + "Title": "Find Largest Value in Each Tree Row", + "TitleSlug": "find-largest-value-in-each-tree-row", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 516, + "Title": "Longest Palindromic Subsequence", + "TitleSlug": "longest-palindromic-subsequence", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 517, + "Title": "Super Washing Machines", + "TitleSlug": "super-washing-machines", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 518, + "Title": "Coin Change 2", + "TitleSlug": "coin-change-2", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 519, + "Title": "Random Flip Matrix", + "TitleSlug": "random-flip-matrix", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 520, + "Title": "Detect Capital", + "TitleSlug": "detect-capital", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 521, + "Title": "Longest Uncommon Subsequence I ", + "TitleSlug": "longest-uncommon-subsequence-i", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 522, + "Title": "Longest Uncommon Subsequence II", + "TitleSlug": "longest-uncommon-subsequence-ii", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 523, + "Title": "Continuous Subarray Sum", + "TitleSlug": "continuous-subarray-sum", + "PassRate": "24%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 524, + "Title": "Longest Word in Dictionary through Deleting", + "TitleSlug": "longest-word-in-dictionary-through-deleting", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 525, + "Title": "Contiguous Array", + "TitleSlug": "contiguous-array", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 526, + "Title": "Beautiful Arrangement", + "TitleSlug": "beautiful-arrangement", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 527, + "Title": "Word Abbreviation", + "TitleSlug": "word-abbreviation", + "PassRate": "51%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 528, + "Title": "Random Pick with Weight", + "TitleSlug": "random-pick-with-weight", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 529, + "Title": "Minesweeper", + "TitleSlug": "minesweeper", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 530, + "Title": "Minimum Absolute Difference in BST", + "TitleSlug": "minimum-absolute-difference-in-bst", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 531, + "Title": "Lonely Pixel I", + "TitleSlug": "lonely-pixel-i", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 532, + "Title": "K-diff Pairs in an Array", + "TitleSlug": "k-diff-pairs-in-an-array", + "PassRate": "30%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 533, + "Title": "Lonely Pixel II", + "TitleSlug": "lonely-pixel-ii", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 535, + "Title": "Encode and Decode TinyURL", + "TitleSlug": "encode-and-decode-tinyurl", + "PassRate": "78%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 536, + "Title": "Construct Binary Tree from String", + "TitleSlug": "construct-binary-tree-from-string", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 537, + "Title": "Complex Number Multiplication", + "TitleSlug": "complex-number-multiplication", + "PassRate": "66%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 538, + "Title": "Convert BST to Greater Tree", + "TitleSlug": "convert-bst-to-greater-tree", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 539, + "Title": "Minimum Time Difference", + "TitleSlug": "minimum-time-difference", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 540, + "Title": "Single Element in a Sorted Array", + "TitleSlug": "single-element-in-a-sorted-array", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 541, + "Title": "Reverse String II", + "TitleSlug": "reverse-string-ii", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 542, + "Title": "01 Matrix", + "TitleSlug": "01-matrix", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 543, + "Title": "Diameter of Binary Tree", + "TitleSlug": "diameter-of-binary-tree", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 544, + "Title": "Output Contest Matches", + "TitleSlug": "output-contest-matches", + "PassRate": "74%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 545, + "Title": "Boundary of Binary Tree", + "TitleSlug": "boundary-of-binary-tree", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 546, + "Title": "Remove Boxes", + "TitleSlug": "remove-boxes", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 547, + "Title": "Friend Circles", + "TitleSlug": "friend-circles", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 548, + "Title": "Split Array with Equal Sum", + "TitleSlug": "split-array-with-equal-sum", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 549, + "Title": "Binary Tree Longest Consecutive Sequence II", + "TitleSlug": "binary-tree-longest-consecutive-sequence-ii", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 551, + "Title": "Student Attendance Record I", + "TitleSlug": "student-attendance-record-i", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 552, + "Title": "Student Attendance Record II", + "TitleSlug": "student-attendance-record-ii", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 553, + "Title": "Optimal Division", + "TitleSlug": "optimal-division", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 554, + "Title": "Brick Wall", + "TitleSlug": "brick-wall", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 555, + "Title": "Split Concatenated Strings", + "TitleSlug": "split-concatenated-strings", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 556, + "Title": "Next Greater Element III", + "TitleSlug": "next-greater-element-iii", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 557, + "Title": "Reverse Words in a String III", + "TitleSlug": "reverse-words-in-a-string-iii", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 558, + "Title": "Quad Tree Intersection", + "TitleSlug": "quad-tree-intersection", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 559, + "Title": "Maximum Depth of N-ary Tree", + "TitleSlug": "maximum-depth-of-n-ary-tree", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 560, + "Title": "Subarray Sum Equals K", + "TitleSlug": "subarray-sum-equals-k", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 561, + "Title": "Array Partition I", + "TitleSlug": "array-partition-i", + "PassRate": "70%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 562, + "Title": "Longest Line of Consecutive One in Matrix", + "TitleSlug": "longest-line-of-consecutive-one-in-matrix", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 563, + "Title": "Binary Tree Tilt", + "TitleSlug": "binary-tree-tilt", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 564, + "Title": "Find the Closest Palindrome", + "TitleSlug": "find-the-closest-palindrome", + "PassRate": "19%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 565, + "Title": "Array Nesting", + "TitleSlug": "array-nesting", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 566, + "Title": "Reshape the Matrix", + "TitleSlug": "reshape-the-matrix", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 567, + "Title": "Permutation in String", + "TitleSlug": "permutation-in-string", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 568, + "Title": "Maximum Vacation Days", + "TitleSlug": "maximum-vacation-days", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 572, + "Title": "Subtree of Another Tree", + "TitleSlug": "subtree-of-another-tree", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 573, + "Title": "Squirrel Simulation", + "TitleSlug": "squirrel-simulation", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 575, + "Title": "Distribute Candies", + "TitleSlug": "distribute-candies", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 576, + "Title": "Out of Boundary Paths", + "TitleSlug": "out-of-boundary-paths", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 581, + "Title": "Shortest Unsorted Continuous Subarray", + "TitleSlug": "shortest-unsorted-continuous-subarray", + "PassRate": "30%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 582, + "Title": "Kill Process", + "TitleSlug": "kill-process", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 583, + "Title": "Delete Operation for Two Strings", + "TitleSlug": "delete-operation-for-two-strings", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 587, + "Title": "Erect the Fence", + "TitleSlug": "erect-the-fence", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 588, + "Title": "Design In-Memory File System", + "TitleSlug": "design-in-memory-file-system", + "PassRate": "42%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 589, + "Title": "N-ary Tree Preorder Traversal", + "TitleSlug": "n-ary-tree-preorder-traversal", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 590, + "Title": "N-ary Tree Postorder Traversal", + "TitleSlug": "n-ary-tree-postorder-traversal", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 591, + "Title": "Tag Validator", + "TitleSlug": "tag-validator", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 592, + "Title": "Fraction Addition and Subtraction", + "TitleSlug": "fraction-addition-and-subtraction", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 593, + "Title": "Valid Square", + "TitleSlug": "valid-square", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 594, + "Title": "Longest Harmonious Subsequence", + "TitleSlug": "longest-harmonious-subsequence", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 598, + "Title": "Range Addition II", + "TitleSlug": "range-addition-ii", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 599, + "Title": "Minimum Index Sum of Two Lists", + "TitleSlug": "minimum-index-sum-of-two-lists", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 600, + "Title": "Non-negative Integers without Consecutive Ones", + "TitleSlug": "non-negative-integers-without-consecutive-ones", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 604, + "Title": "Design Compressed String Iterator", + "TitleSlug": "design-compressed-string-iterator", + "PassRate": "35%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 605, + "Title": "Can Place Flowers", + "TitleSlug": "can-place-flowers", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 606, + "Title": "Construct String from Binary Tree", + "TitleSlug": "construct-string-from-binary-tree", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 609, + "Title": "Find Duplicate File in System", + "TitleSlug": "find-duplicate-file-in-system", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 611, + "Title": "Valid Triangle Number", + "TitleSlug": "valid-triangle-number", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 616, + "Title": "Add Bold Tag in String", + "TitleSlug": "add-bold-tag-in-string", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 617, + "Title": "Merge Two Binary Trees", + "TitleSlug": "merge-two-binary-trees", + "PassRate": "71%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 621, + "Title": "Task Scheduler", + "TitleSlug": "task-scheduler", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 622, + "Title": "Design Circular Queue", + "TitleSlug": "design-circular-queue", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 623, + "Title": "Add One Row to Tree", + "TitleSlug": "add-one-row-to-tree", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 624, + "Title": "Maximum Distance in Arrays", + "TitleSlug": "maximum-distance-in-arrays", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 625, + "Title": "Minimum Factorization", + "TitleSlug": "minimum-factorization", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 628, + "Title": "Maximum Product of Three Numbers", + "TitleSlug": "maximum-product-of-three-numbers", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 629, + "Title": "K Inverse Pairs Array", + "TitleSlug": "k-inverse-pairs-array", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 630, + "Title": "Course Schedule III", + "TitleSlug": "course-schedule-iii", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 631, + "Title": "Design Excel Sum Formula", + "TitleSlug": "design-excel-sum-formula", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 632, + "Title": "Smallest Range Covering Elements from K Lists", + "TitleSlug": "smallest-range-covering-elements-from-k-lists", + "PassRate": "49%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 633, + "Title": "Sum of Square Numbers", + "TitleSlug": "sum-of-square-numbers", + "PassRate": "32%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 634, + "Title": "Find the Derangement of An Array", + "TitleSlug": "find-the-derangement-of-an-array", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 635, + "Title": "Design Log Storage System", + "TitleSlug": "design-log-storage-system", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 636, + "Title": "Exclusive Time of Functions", + "TitleSlug": "exclusive-time-of-functions", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 637, + "Title": "Average of Levels in Binary Tree", + "TitleSlug": "average-of-levels-in-binary-tree", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 638, + "Title": "Shopping Offers", + "TitleSlug": "shopping-offers", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 639, + "Title": "Decode Ways II", + "TitleSlug": "decode-ways-ii", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 640, + "Title": "Solve the Equation", + "TitleSlug": "solve-the-equation", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 641, + "Title": "Design Circular Deque", + "TitleSlug": "design-circular-deque", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 642, + "Title": "Design Search Autocomplete System", + "TitleSlug": "design-search-autocomplete-system", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 643, + "Title": "Maximum Average Subarray I", + "TitleSlug": "maximum-average-subarray-i", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 644, + "Title": "Maximum Average Subarray II", + "TitleSlug": "maximum-average-subarray-ii", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 645, + "Title": "Set Mismatch", + "TitleSlug": "set-mismatch", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 646, + "Title": "Maximum Length of Pair Chain", + "TitleSlug": "maximum-length-of-pair-chain", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 647, + "Title": "Palindromic Substrings", + "TitleSlug": "palindromic-substrings", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 648, + "Title": "Replace Words", + "TitleSlug": "replace-words", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 649, + "Title": "Dota2 Senate", + "TitleSlug": "dota2-senate", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 650, + "Title": "2 Keys Keyboard", + "TitleSlug": "2-keys-keyboard", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 651, + "Title": "4 Keys Keyboard", + "TitleSlug": "4-keys-keyboard", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 652, + "Title": "Find Duplicate Subtrees", + "TitleSlug": "find-duplicate-subtrees", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 653, + "Title": "Two Sum IV - Input is a BST", + "TitleSlug": "two-sum-iv-input-is-a-bst", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 654, + "Title": "Maximum Binary Tree", + "TitleSlug": "maximum-binary-tree", + "PassRate": "77%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 655, + "Title": "Print Binary Tree", + "TitleSlug": "print-binary-tree", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 656, + "Title": "Coin Path", + "TitleSlug": "coin-path", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 657, + "Title": "Robot Return to Origin", + "TitleSlug": "robot-return-to-origin", + "PassRate": "72%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 658, + "Title": "Find K Closest Elements", + "TitleSlug": "find-k-closest-elements", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 659, + "Title": "Split Array into Consecutive Subsequences", + "TitleSlug": "split-array-into-consecutive-subsequences", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 660, + "Title": "Remove 9", + "TitleSlug": "remove-9", + "PassRate": "52%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 661, + "Title": "Image Smoother", + "TitleSlug": "image-smoother", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 662, + "Title": "Maximum Width of Binary Tree", + "TitleSlug": "maximum-width-of-binary-tree", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 663, + "Title": "Equal Tree Partition", + "TitleSlug": "equal-tree-partition", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 664, + "Title": "Strange Printer", + "TitleSlug": "strange-printer", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 665, + "Title": "Non-decreasing Array", + "TitleSlug": "non-decreasing-array", + "PassRate": "19%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 666, + "Title": "Path Sum IV", + "TitleSlug": "path-sum-iv", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 667, + "Title": "Beautiful Arrangement II", + "TitleSlug": "beautiful-arrangement-ii", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 668, + "Title": "Kth Smallest Number in Multiplication Table", + "TitleSlug": "kth-smallest-number-in-multiplication-table", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 669, + "Title": "Trim a Binary Search Tree", + "TitleSlug": "trim-a-binary-search-tree", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 670, + "Title": "Maximum Swap", + "TitleSlug": "maximum-swap", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 671, + "Title": "Second Minimum Node In a Binary Tree", + "TitleSlug": "second-minimum-node-in-a-binary-tree", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 672, + "Title": "Bulb Switcher II", + "TitleSlug": "bulb-switcher-ii", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 673, + "Title": "Number of Longest Increasing Subsequence", + "TitleSlug": "number-of-longest-increasing-subsequence", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 674, + "Title": "Longest Continuous Increasing Subsequence", + "TitleSlug": "longest-continuous-increasing-subsequence", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 675, + "Title": "Cut Off Trees for Golf Event", + "TitleSlug": "cut-off-trees-for-golf-event", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 676, + "Title": "Implement Magic Dictionary", + "TitleSlug": "implement-magic-dictionary", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 677, + "Title": "Map Sum Pairs", + "TitleSlug": "map-sum-pairs", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 678, + "Title": "Valid Parenthesis String", + "TitleSlug": "valid-parenthesis-string", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 679, + "Title": "24 Game", + "TitleSlug": "24-game", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 680, + "Title": "Valid Palindrome II", + "TitleSlug": "valid-palindrome-ii", + "PassRate": "35%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 681, + "Title": "Next Closest Time", + "TitleSlug": "next-closest-time", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 682, + "Title": "Baseball Game", + "TitleSlug": "baseball-game", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 683, + "Title": "K Empty Slots", + "TitleSlug": "k-empty-slots", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 684, + "Title": "Redundant Connection", + "TitleSlug": "redundant-connection", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 685, + "Title": "Redundant Connection II", + "TitleSlug": "redundant-connection-ii", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 686, + "Title": "Repeated String Match", + "TitleSlug": "repeated-string-match", + "PassRate": "31%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 687, + "Title": "Longest Univalue Path", + "TitleSlug": "longest-univalue-path", + "PassRate": "34%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 688, + "Title": "Knight Probability in Chessboard", + "TitleSlug": "knight-probability-in-chessboard", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 689, + "Title": "Maximum Sum of 3 Non-Overlapping Subarrays", + "TitleSlug": "maximum-sum-of-3-non-overlapping-subarrays", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 690, + "Title": "Employee Importance", + "TitleSlug": "employee-importance", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 691, + "Title": "Stickers to Spell Word", + "TitleSlug": "stickers-to-spell-word", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 692, + "Title": "Top K Frequent Words", + "TitleSlug": "top-k-frequent-words", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 693, + "Title": "Binary Number with Alternating Bits", + "TitleSlug": "binary-number-with-alternating-bits", + "PassRate": "58%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 694, + "Title": "Number of Distinct Islands", + "TitleSlug": "number-of-distinct-islands", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 695, + "Title": "Max Area of Island", + "TitleSlug": "max-area-of-island", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 696, + "Title": "Count Binary Substrings", + "TitleSlug": "count-binary-substrings", + "PassRate": "54%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 697, + "Title": "Degree of an Array", + "TitleSlug": "degree-of-an-array", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 698, + "Title": "Partition to K Equal Sum Subsets", + "TitleSlug": "partition-to-k-equal-sum-subsets", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 699, + "Title": "Falling Squares", + "TitleSlug": "falling-squares", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 700, + "Title": "Search in a Binary Search Tree", + "TitleSlug": "search-in-a-binary-search-tree", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 701, + "Title": "Insert into a Binary Search Tree", + "TitleSlug": "insert-into-a-binary-search-tree", + "PassRate": "77%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 702, + "Title": "Search in a Sorted Array of Unknown Size", + "TitleSlug": "search-in-a-sorted-array-of-unknown-size", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 703, + "Title": "Kth Largest Element in a Stream", + "TitleSlug": "kth-largest-element-in-a-stream", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 704, + "Title": "Binary Search", + "TitleSlug": "binary-search", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 705, + "Title": "Design HashSet", + "TitleSlug": "design-hashset", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 706, + "Title": "Design HashMap", + "TitleSlug": "design-hashmap", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 707, + "Title": "Design Linked List", + "TitleSlug": "design-linked-list", + "PassRate": "20%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 708, + "Title": "Insert into a Cyclic Sorted List", + "TitleSlug": "insert-into-a-cyclic-sorted-list", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": true + }, + { + "ID": 709, + "Title": "To Lower Case", + "TitleSlug": "to-lower-case", + "PassRate": "77%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 710, + "Title": "Random Pick with Blacklist", + "TitleSlug": "random-pick-with-blacklist", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 711, + "Title": "Number of Distinct Islands II", + "TitleSlug": "number-of-distinct-islands-ii", + "PassRate": "47%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 712, + "Title": "Minimum ASCII Delete Sum for Two Strings", + "TitleSlug": "minimum-ascii-delete-sum-for-two-strings", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 713, + "Title": "Subarray Product Less Than K", + "TitleSlug": "subarray-product-less-than-k", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 714, + "Title": "Best Time to Buy and Sell Stock with Transaction Fee", + "TitleSlug": "best-time-to-buy-and-sell-stock-with-transaction-fee", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 715, + "Title": "Range Module", + "TitleSlug": "range-module", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 716, + "Title": "Max Stack", + "TitleSlug": "max-stack", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 717, + "Title": "1-bit and 2-bit Characters", + "TitleSlug": "1-bit-and-2-bit-characters", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 718, + "Title": "Maximum Length of Repeated Subarray", + "TitleSlug": "maximum-length-of-repeated-subarray", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 719, + "Title": "Find K-th Smallest Pair Distance", + "TitleSlug": "find-k-th-smallest-pair-distance", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 720, + "Title": "Longest Word in Dictionary", + "TitleSlug": "longest-word-in-dictionary", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 721, + "Title": "Accounts Merge", + "TitleSlug": "accounts-merge", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 722, + "Title": "Remove Comments", + "TitleSlug": "remove-comments", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 723, + "Title": "Candy Crush", + "TitleSlug": "candy-crush", + "PassRate": "65%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 724, + "Title": "Find Pivot Index", + "TitleSlug": "find-pivot-index", + "PassRate": "42%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 725, + "Title": "Split Linked List in Parts", + "TitleSlug": "split-linked-list-in-parts", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 726, + "Title": "Number of Atoms", + "TitleSlug": "number-of-atoms", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 727, + "Title": "Minimum Window Subsequence", + "TitleSlug": "minimum-window-subsequence", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 728, + "Title": "Self Dividing Numbers", + "TitleSlug": "self-dividing-numbers", + "PassRate": "71%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 729, + "Title": "My Calendar I", + "TitleSlug": "my-calendar-i", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 730, + "Title": "Count Different Palindromic Subsequences", + "TitleSlug": "count-different-palindromic-subsequences", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 731, + "Title": "My Calendar II", + "TitleSlug": "my-calendar-ii", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 732, + "Title": "My Calendar III", + "TitleSlug": "my-calendar-iii", + "PassRate": "57%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 733, + "Title": "Flood Fill", + "TitleSlug": "flood-fill", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 734, + "Title": "Sentence Similarity", + "TitleSlug": "sentence-similarity", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 735, + "Title": "Asteroid Collision", + "TitleSlug": "asteroid-collision", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 736, + "Title": "Parse Lisp Expression", + "TitleSlug": "parse-lisp-expression", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 737, + "Title": "Sentence Similarity II", + "TitleSlug": "sentence-similarity-ii", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 738, + "Title": "Monotone Increasing Digits", + "TitleSlug": "monotone-increasing-digits", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 739, + "Title": "Daily Temperatures", + "TitleSlug": "daily-temperatures", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 740, + "Title": "Delete and Earn", + "TitleSlug": "delete-and-earn", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 741, + "Title": "Cherry Pickup", + "TitleSlug": "cherry-pickup", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 742, + "Title": "Closest Leaf in a Binary Tree", + "TitleSlug": "closest-leaf-in-a-binary-tree", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 743, + "Title": "Network Delay Time", + "TitleSlug": "network-delay-time", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 744, + "Title": "Find Smallest Letter Greater Than Target", + "TitleSlug": "find-smallest-letter-greater-than-target", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 745, + "Title": "Prefix and Suffix Search", + "TitleSlug": "prefix-and-suffix-search", + "PassRate": "32%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 746, + "Title": "Min Cost Climbing Stairs", + "TitleSlug": "min-cost-climbing-stairs", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 747, + "Title": "Largest Number At Least Twice of Others", + "TitleSlug": "largest-number-at-least-twice-of-others", + "PassRate": "40%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 748, + "Title": "Shortest Completing Word", + "TitleSlug": "shortest-completing-word", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 749, + "Title": "Contain Virus", + "TitleSlug": "contain-virus", + "PassRate": "42%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 750, + "Title": "Number Of Corner Rectangles", + "TitleSlug": "number-of-corner-rectangles", + "PassRate": "65%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 751, + "Title": "IP to CIDR", + "TitleSlug": "ip-to-cidr", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 752, + "Title": "Open the Lock", + "TitleSlug": "open-the-lock", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 753, + "Title": "Cracking the Safe", + "TitleSlug": "cracking-the-safe", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 754, + "Title": "Reach a Number", + "TitleSlug": "reach-a-number", + "PassRate": "33%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 755, + "Title": "Pour Water", + "TitleSlug": "pour-water", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 756, + "Title": "Pyramid Transition Matrix", + "TitleSlug": "pyramid-transition-matrix", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 757, + "Title": "Set Intersection Size At Least Two", + "TitleSlug": "set-intersection-size-at-least-two", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 758, + "Title": "Bold Words in String", + "TitleSlug": "bold-words-in-string", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 759, + "Title": "Employee Free Time", + "TitleSlug": "employee-free-time", + "PassRate": "63%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 760, + "Title": "Find Anagram Mappings", + "TitleSlug": "find-anagram-mappings", + "PassRate": "79%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 761, + "Title": "Special Binary String", + "TitleSlug": "special-binary-string", + "PassRate": "53%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 762, + "Title": "Prime Number of Set Bits in Binary Representation", + "TitleSlug": "prime-number-of-set-bits-in-binary-representation", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 763, + "Title": "Partition Labels", + "TitleSlug": "partition-labels", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 764, + "Title": "Largest Plus Sign", + "TitleSlug": "largest-plus-sign", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 765, + "Title": "Couples Holding Hands", + "TitleSlug": "couples-holding-hands", + "PassRate": "52%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 766, + "Title": "Toeplitz Matrix", + "TitleSlug": "toeplitz-matrix", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 767, + "Title": "Reorganize String", + "TitleSlug": "reorganize-string", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 768, + "Title": "Max Chunks To Make Sorted II", + "TitleSlug": "max-chunks-to-make-sorted-ii", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 769, + "Title": "Max Chunks To Make Sorted", + "TitleSlug": "max-chunks-to-make-sorted", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 770, + "Title": "Basic Calculator IV", + "TitleSlug": "basic-calculator-iv", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 771, + "Title": "Jewels and Stones", + "TitleSlug": "jewels-and-stones", + "PassRate": "83%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 772, + "Title": "Basic Calculator III", + "TitleSlug": "basic-calculator-iii", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 773, + "Title": "Sliding Puzzle", + "TitleSlug": "sliding-puzzle", + "PassRate": "55%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 774, + "Title": "Minimize Max Distance to Gas Station", + "TitleSlug": "minimize-max-distance-to-gas-station", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 775, + "Title": "Global and Local Inversions", + "TitleSlug": "global-and-local-inversions", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 776, + "Title": "Split BST", + "TitleSlug": "split-bst", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 777, + "Title": "Swap Adjacent in LR String", + "TitleSlug": "swap-adjacent-in-lr-string", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 778, + "Title": "Swim in Rising Water", + "TitleSlug": "swim-in-rising-water", + "PassRate": "49%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 779, + "Title": "K-th Symbol in Grammar", + "TitleSlug": "k-th-symbol-in-grammar", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 780, + "Title": "Reaching Points", + "TitleSlug": "reaching-points", + "PassRate": "28%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 781, + "Title": "Rabbits in Forest", + "TitleSlug": "rabbits-in-forest", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 782, + "Title": "Transform to Chessboard", + "TitleSlug": "transform-to-chessboard", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 783, + "Title": "Minimum Distance Between BST Nodes", + "TitleSlug": "minimum-distance-between-bst-nodes", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 784, + "Title": "Letter Case Permutation", + "TitleSlug": "letter-case-permutation", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 785, + "Title": "Is Graph Bipartite?", + "TitleSlug": "is-graph-bipartite", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 786, + "Title": "K-th Smallest Prime Fraction", + "TitleSlug": "k-th-smallest-prime-fraction", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 787, + "Title": "Cheapest Flights Within K Stops", + "TitleSlug": "cheapest-flights-within-k-stops", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 788, + "Title": "Rotated Digits", + "TitleSlug": "rotated-digits", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 789, + "Title": "Escape The Ghosts", + "TitleSlug": "escape-the-ghosts", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 790, + "Title": "Domino and Tromino Tiling", + "TitleSlug": "domino-and-tromino-tiling", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 791, + "Title": "Custom Sort String", + "TitleSlug": "custom-sort-string", + "PassRate": "63%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 792, + "Title": "Number of Matching Subsequences", + "TitleSlug": "number-of-matching-subsequences", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 793, + "Title": "Preimage Size of Factorial Zeroes Function", + "TitleSlug": "preimage-size-of-factorial-zeroes-function", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 794, + "Title": "Valid Tic-Tac-Toe State", + "TitleSlug": "valid-tic-tac-toe-state", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 795, + "Title": "Number of Subarrays with Bounded Maximum", + "TitleSlug": "number-of-subarrays-with-bounded-maximum", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 796, + "Title": "Rotate String", + "TitleSlug": "rotate-string", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 797, + "Title": "All Paths From Source to Target", + "TitleSlug": "all-paths-from-source-to-target", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 798, + "Title": "Smallest Rotation with Highest Score", + "TitleSlug": "smallest-rotation-with-highest-score", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 799, + "Title": "Champagne Tower", + "TitleSlug": "champagne-tower", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 800, + "Title": "Similar RGB Color", + "TitleSlug": "similar-rgb-color", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 801, + "Title": "Minimum Swaps To Make Sequences Increasing", + "TitleSlug": "minimum-swaps-to-make-sequences-increasing", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 802, + "Title": "Find Eventual Safe States", + "TitleSlug": "find-eventual-safe-states", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 803, + "Title": "Bricks Falling When Hit", + "TitleSlug": "bricks-falling-when-hit", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 804, + "Title": "Unique Morse Code Words", + "TitleSlug": "unique-morse-code-words", + "PassRate": "75%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 805, + "Title": "Split Array With Same Average", + "TitleSlug": "split-array-with-same-average", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 806, + "Title": "Number of Lines To Write String", + "TitleSlug": "number-of-lines-to-write-string", + "PassRate": "63%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 807, + "Title": "Max Increase to Keep City Skyline", + "TitleSlug": "max-increase-to-keep-city-skyline", + "PassRate": "82%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 808, + "Title": "Soup Servings", + "TitleSlug": "soup-servings", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 809, + "Title": "Expressive Words", + "TitleSlug": "expressive-words", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 810, + "Title": "Chalkboard XOR Game", + "TitleSlug": "chalkboard-xor-game", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 811, + "Title": "Subdomain Visit Count", + "TitleSlug": "subdomain-visit-count", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 812, + "Title": "Largest Triangle Area", + "TitleSlug": "largest-triangle-area", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 813, + "Title": "Largest Sum of Averages", + "TitleSlug": "largest-sum-of-averages", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 814, + "Title": "Binary Tree Pruning", + "TitleSlug": "binary-tree-pruning", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 815, + "Title": "Bus Routes", + "TitleSlug": "bus-routes", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 816, + "Title": "Ambiguous Coordinates", + "TitleSlug": "ambiguous-coordinates", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 817, + "Title": "Linked List Components", + "TitleSlug": "linked-list-components", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 818, + "Title": "Race Car", + "TitleSlug": "race-car", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 819, + "Title": "Most Common Word", + "TitleSlug": "most-common-word", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 820, + "Title": "Short Encoding of Words", + "TitleSlug": "short-encoding-of-words", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 821, + "Title": "Shortest Distance to a Character", + "TitleSlug": "shortest-distance-to-a-character", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 822, + "Title": "Card Flipping Game", + "TitleSlug": "card-flipping-game", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 823, + "Title": "Binary Trees With Factors", + "TitleSlug": "binary-trees-with-factors", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 824, + "Title": "Goat Latin", + "TitleSlug": "goat-latin", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 825, + "Title": "Friends Of Appropriate Ages", + "TitleSlug": "friends-of-appropriate-ages", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 826, + "Title": "Most Profit Assigning Work", + "TitleSlug": "most-profit-assigning-work", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 827, + "Title": "Making A Large Island", + "TitleSlug": "making-a-large-island", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 828, + "Title": "Unique Letter String", + "TitleSlug": "unique-letter-string", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 829, + "Title": "Consecutive Numbers Sum", + "TitleSlug": "consecutive-numbers-sum", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 830, + "Title": "Positions of Large Groups", + "TitleSlug": "positions-of-large-groups", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 831, + "Title": "Masking Personal Information", + "TitleSlug": "masking-personal-information", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 832, + "Title": "Flipping an Image", + "TitleSlug": "flipping-an-image", + "PassRate": "73%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 833, + "Title": "Find And Replace in String", + "TitleSlug": "find-and-replace-in-string", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 834, + "Title": "Sum of Distances in Tree", + "TitleSlug": "sum-of-distances-in-tree", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 835, + "Title": "Image Overlap", + "TitleSlug": "image-overlap", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 836, + "Title": "Rectangle Overlap", + "TitleSlug": "rectangle-overlap", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 837, + "Title": "New 21 Game", + "TitleSlug": "new-21-game", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 838, + "Title": "Push Dominoes", + "TitleSlug": "push-dominoes", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 839, + "Title": "Similar String Groups", + "TitleSlug": "similar-string-groups", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 840, + "Title": "Magic Squares In Grid", + "TitleSlug": "magic-squares-in-grid", + "PassRate": "36%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 841, + "Title": "Keys and Rooms", + "TitleSlug": "keys-and-rooms", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 842, + "Title": "Split Array into Fibonacci Sequence", + "TitleSlug": "split-array-into-fibonacci-sequence", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 843, + "Title": "Guess the Word", + "TitleSlug": "guess-the-word", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 844, + "Title": "Backspace String Compare", + "TitleSlug": "backspace-string-compare", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 845, + "Title": "Longest Mountain in Array", + "TitleSlug": "longest-mountain-in-array", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 846, + "Title": "Hand of Straights", + "TitleSlug": "hand-of-straights", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 847, + "Title": "Shortest Path Visiting All Nodes", + "TitleSlug": "shortest-path-visiting-all-nodes", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 848, + "Title": "Shifting Letters", + "TitleSlug": "shifting-letters", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 849, + "Title": "Maximize Distance to Closest Person", + "TitleSlug": "maximize-distance-to-closest-person", + "PassRate": "41%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 850, + "Title": "Rectangle Area II", + "TitleSlug": "rectangle-area-ii", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 851, + "Title": "Loud and Rich", + "TitleSlug": "loud-and-rich", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 852, + "Title": "Peak Index in a Mountain Array", + "TitleSlug": "peak-index-in-a-mountain-array", + "PassRate": "70%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 853, + "Title": "Car Fleet", + "TitleSlug": "car-fleet", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 854, + "Title": "K-Similar Strings", + "TitleSlug": "k-similar-strings", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 855, + "Title": "Exam Room", + "TitleSlug": "exam-room", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 856, + "Title": "Score of Parentheses", + "TitleSlug": "score-of-parentheses", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 857, + "Title": "Minimum Cost to Hire K Workers", + "TitleSlug": "minimum-cost-to-hire-k-workers", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 858, + "Title": "Mirror Reflection", + "TitleSlug": "mirror-reflection", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 859, + "Title": "Buddy Strings", + "TitleSlug": "buddy-strings", + "PassRate": "27%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 860, + "Title": "Lemonade Change", + "TitleSlug": "lemonade-change", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 861, + "Title": "Score After Flipping Matrix", + "TitleSlug": "score-after-flipping-matrix", + "PassRate": "70%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 862, + "Title": "Shortest Subarray with Sum at Least K", + "TitleSlug": "shortest-subarray-with-sum-at-least-k", + "PassRate": "22%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 863, + "Title": "All Nodes Distance K in Binary Tree", + "TitleSlug": "all-nodes-distance-k-in-binary-tree", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 864, + "Title": "Shortest Path to Get All Keys", + "TitleSlug": "shortest-path-to-get-all-keys", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 865, + "Title": "Smallest Subtree with all the Deepest Nodes", + "TitleSlug": "smallest-subtree-with-all-the-deepest-nodes", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 866, + "Title": "Prime Palindrome", + "TitleSlug": "prime-palindrome", + "PassRate": "21%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 867, + "Title": "Transpose Matrix", + "TitleSlug": "transpose-matrix", + "PassRate": "63%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 868, + "Title": "Binary Gap", + "TitleSlug": "binary-gap", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 869, + "Title": "Reordered Power of 2", + "TitleSlug": "reordered-power-of-2", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 870, + "Title": "Advantage Shuffle", + "TitleSlug": "advantage-shuffle", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 871, + "Title": "Minimum Number of Refueling Stops", + "TitleSlug": "minimum-number-of-refueling-stops", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 872, + "Title": "Leaf-Similar Trees", + "TitleSlug": "leaf-similar-trees", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 873, + "Title": "Length of Longest Fibonacci Subsequence", + "TitleSlug": "length-of-longest-fibonacci-subsequence", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 874, + "Title": "Walking Robot Simulation", + "TitleSlug": "walking-robot-simulation", + "PassRate": "33%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 875, + "Title": "Koko Eating Bananas", + "TitleSlug": "koko-eating-bananas", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 876, + "Title": "Middle of the Linked List", + "TitleSlug": "middle-of-the-linked-list", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 877, + "Title": "Stone Game", + "TitleSlug": "stone-game", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 878, + "Title": "Nth Magical Number", + "TitleSlug": "nth-magical-number", + "PassRate": "26%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 879, + "Title": "Profitable Schemes", + "TitleSlug": "profitable-schemes", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 880, + "Title": "Decoded String at Index", + "TitleSlug": "decoded-string-at-index", + "PassRate": "23%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 881, + "Title": "Boats to Save People", + "TitleSlug": "boats-to-save-people", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 882, + "Title": "Reachable Nodes In Subdivided Graph", + "TitleSlug": "reachable-nodes-in-subdivided-graph", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 883, + "Title": "Projection Area of 3D Shapes", + "TitleSlug": "projection-area-of-3d-shapes", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 884, + "Title": "Uncommon Words from Two Sentences", + "TitleSlug": "uncommon-words-from-two-sentences", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 885, + "Title": "Spiral Matrix III", + "TitleSlug": "spiral-matrix-iii", + "PassRate": "66%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 886, + "Title": "Possible Bipartition", + "TitleSlug": "possible-bipartition", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 887, + "Title": "Super Egg Drop", + "TitleSlug": "super-egg-drop", + "PassRate": "25%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 888, + "Title": "Fair Candy Swap", + "TitleSlug": "fair-candy-swap", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 889, + "Title": "Construct Binary Tree from Preorder and Postorder Traversal", + "TitleSlug": "construct-binary-tree-from-preorder-and-postorder-traversal", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 890, + "Title": "Find and Replace Pattern", + "TitleSlug": "find-and-replace-pattern", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 891, + "Title": "Sum of Subsequence Widths", + "TitleSlug": "sum-of-subsequence-widths", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 892, + "Title": "Surface Area of 3D Shapes", + "TitleSlug": "surface-area-of-3d-shapes", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 893, + "Title": "Groups of Special-Equivalent Strings", + "TitleSlug": "groups-of-special-equivalent-strings", + "PassRate": "63%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 894, + "Title": "All Possible Full Binary Trees", + "TitleSlug": "all-possible-full-binary-trees", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 895, + "Title": "Maximum Frequency Stack", + "TitleSlug": "maximum-frequency-stack", + "PassRate": "58%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 896, + "Title": "Monotonic Array", + "TitleSlug": "monotonic-array", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 897, + "Title": "Increasing Order Search Tree", + "TitleSlug": "increasing-order-search-tree", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 898, + "Title": "Bitwise ORs of Subarrays", + "TitleSlug": "bitwise-ors-of-subarrays", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 899, + "Title": "Orderly Queue", + "TitleSlug": "orderly-queue", + "PassRate": "49%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 900, + "Title": "RLE Iterator", + "TitleSlug": "rle-iterator", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 901, + "Title": "Online Stock Span", + "TitleSlug": "online-stock-span", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 902, + "Title": "Numbers At Most N Given Digit Set", + "TitleSlug": "numbers-at-most-n-given-digit-set", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 903, + "Title": "Valid Permutations for DI Sequence", + "TitleSlug": "valid-permutations-for-di-sequence", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 904, + "Title": "Fruit Into Baskets", + "TitleSlug": "fruit-into-baskets", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 905, + "Title": "Sort Array By Parity", + "TitleSlug": "sort-array-by-parity", + "PassRate": "72%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 906, + "Title": "Super Palindromes", + "TitleSlug": "super-palindromes", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 907, + "Title": "Sum of Subarray Minimums", + "TitleSlug": "sum-of-subarray-minimums", + "PassRate": "29%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 908, + "Title": "Smallest Range I", + "TitleSlug": "smallest-range-i", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 909, + "Title": "Snakes and Ladders", + "TitleSlug": "snakes-and-ladders", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 910, + "Title": "Smallest Range II", + "TitleSlug": "smallest-range-ii", + "PassRate": "24%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 911, + "Title": "Online Election", + "TitleSlug": "online-election", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 912, + "Title": "Sort an Array", + "TitleSlug": "sort-an-array", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 913, + "Title": "Cat and Mouse", + "TitleSlug": "cat-and-mouse", + "PassRate": "29%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 914, + "Title": "X of a Kind in a Deck of Cards", + "TitleSlug": "x-of-a-kind-in-a-deck-of-cards", + "PassRate": "34%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 915, + "Title": "Partition Array into Disjoint Intervals", + "TitleSlug": "partition-array-into-disjoint-intervals", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 916, + "Title": "Word Subsets", + "TitleSlug": "word-subsets", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 917, + "Title": "Reverse Only Letters", + "TitleSlug": "reverse-only-letters", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 918, + "Title": "Maximum Sum Circular Subarray", + "TitleSlug": "maximum-sum-circular-subarray", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 919, + "Title": "Complete Binary Tree Inserter", + "TitleSlug": "complete-binary-tree-inserter", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 920, + "Title": "Number of Music Playlists", + "TitleSlug": "number-of-music-playlists", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 921, + "Title": "Minimum Add to Make Parentheses Valid", + "TitleSlug": "minimum-add-to-make-parentheses-valid", + "PassRate": "70%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 922, + "Title": "Sort Array By Parity II", + "TitleSlug": "sort-array-by-parity-ii", + "PassRate": "67%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 923, + "Title": "3Sum With Multiplicity", + "TitleSlug": "3sum-with-multiplicity", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 924, + "Title": "Minimize Malware Spread", + "TitleSlug": "minimize-malware-spread", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 925, + "Title": "Long Pressed Name", + "TitleSlug": "long-pressed-name", + "PassRate": "44%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 926, + "Title": "Flip String to Monotone Increasing", + "TitleSlug": "flip-string-to-monotone-increasing", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 927, + "Title": "Three Equal Parts", + "TitleSlug": "three-equal-parts", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 928, + "Title": "Minimize Malware Spread II", + "TitleSlug": "minimize-malware-spread-ii", + "PassRate": "39%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 929, + "Title": "Unique Email Addresses", + "TitleSlug": "unique-email-addresses", + "PassRate": "68%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 930, + "Title": "Binary Subarrays With Sum", + "TitleSlug": "binary-subarrays-with-sum", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 931, + "Title": "Minimum Falling Path Sum", + "TitleSlug": "minimum-falling-path-sum", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 932, + "Title": "Beautiful Array", + "TitleSlug": "beautiful-array", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 933, + "Title": "Number of Recent Calls", + "TitleSlug": "number-of-recent-calls", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 934, + "Title": "Shortest Bridge", + "TitleSlug": "shortest-bridge", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 935, + "Title": "Knight Dialer", + "TitleSlug": "knight-dialer", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 936, + "Title": "Stamping The Sequence", + "TitleSlug": "stamping-the-sequence", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 937, + "Title": "Reorder Data in Log Files", + "TitleSlug": "reorder-data-in-log-files", + "PassRate": "54%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 938, + "Title": "Range Sum of BST", + "TitleSlug": "range-sum-of-bst", + "PassRate": "78%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 939, + "Title": "Minimum Area Rectangle", + "TitleSlug": "minimum-area-rectangle", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 940, + "Title": "Distinct Subsequences II", + "TitleSlug": "distinct-subsequences-ii", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 941, + "Title": "Valid Mountain Array", + "TitleSlug": "valid-mountain-array", + "PassRate": "35%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 942, + "Title": "DI String Match", + "TitleSlug": "di-string-match", + "PassRate": "70%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 943, + "Title": "Find the Shortest Superstring", + "TitleSlug": "find-the-shortest-superstring", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 944, + "Title": "Delete Columns to Make Sorted", + "TitleSlug": "delete-columns-to-make-sorted", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 945, + "Title": "Minimum Increment to Make Array Unique", + "TitleSlug": "minimum-increment-to-make-array-unique", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 946, + "Title": "Validate Stack Sequences", + "TitleSlug": "validate-stack-sequences", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 947, + "Title": "Most Stones Removed with Same Row or Column", + "TitleSlug": "most-stones-removed-with-same-row-or-column", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 948, + "Title": "Bag of Tokens", + "TitleSlug": "bag-of-tokens", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 949, + "Title": "Largest Time for Given Digits", + "TitleSlug": "largest-time-for-given-digits", + "PassRate": "34%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 950, + "Title": "Reveal Cards In Increasing Order", + "TitleSlug": "reveal-cards-in-increasing-order", + "PassRate": "72%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 951, + "Title": "Flip Equivalent Binary Trees", + "TitleSlug": "flip-equivalent-binary-trees", + "PassRate": "65%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 952, + "Title": "Largest Component Size by Common Factor", + "TitleSlug": "largest-component-size-by-common-factor", + "PassRate": "27%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 953, + "Title": "Verifying an Alien Dictionary", + "TitleSlug": "verifying-an-alien-dictionary", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 954, + "Title": "Array of Doubled Pairs", + "TitleSlug": "array-of-doubled-pairs", + "PassRate": "35%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 955, + "Title": "Delete Columns to Make Sorted II", + "TitleSlug": "delete-columns-to-make-sorted-ii", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 956, + "Title": "Tallest Billboard", + "TitleSlug": "tallest-billboard", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 957, + "Title": "Prison Cells After N Days", + "TitleSlug": "prison-cells-after-n-days", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 958, + "Title": "Check Completeness of a Binary Tree", + "TitleSlug": "check-completeness-of-a-binary-tree", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 959, + "Title": "Regions Cut By Slashes", + "TitleSlug": "regions-cut-by-slashes", + "PassRate": "63%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 960, + "Title": "Delete Columns to Make Sorted III", + "TitleSlug": "delete-columns-to-make-sorted-iii", + "PassRate": "52%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 961, + "Title": "N-Repeated Element in Size 2N Array", + "TitleSlug": "n-repeated-element-in-size-2n-array", + "PassRate": "72%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 962, + "Title": "Maximum Width Ramp", + "TitleSlug": "maximum-width-ramp", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 963, + "Title": "Minimum Area Rectangle II", + "TitleSlug": "minimum-area-rectangle-ii", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 964, + "Title": "Least Operators to Express Number", + "TitleSlug": "least-operators-to-express-number", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 965, + "Title": "Univalued Binary Tree", + "TitleSlug": "univalued-binary-tree", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 966, + "Title": "Vowel Spellchecker", + "TitleSlug": "vowel-spellchecker", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 967, + "Title": "Numbers With Same Consecutive Differences", + "TitleSlug": "numbers-with-same-consecutive-differences", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 968, + "Title": "Binary Tree Cameras", + "TitleSlug": "binary-tree-cameras", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 969, + "Title": "Pancake Sorting", + "TitleSlug": "pancake-sorting", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 970, + "Title": "Powerful Integers", + "TitleSlug": "powerful-integers", + "PassRate": "39%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 971, + "Title": "Flip Binary Tree To Match Preorder Traversal", + "TitleSlug": "flip-binary-tree-to-match-preorder-traversal", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 972, + "Title": "Equal Rational Numbers", + "TitleSlug": "equal-rational-numbers", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 973, + "Title": "K Closest Points to Origin", + "TitleSlug": "k-closest-points-to-origin", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 974, + "Title": "Subarray Sums Divisible by K", + "TitleSlug": "subarray-sums-divisible-by-k", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 975, + "Title": "Odd Even Jump", + "TitleSlug": "odd-even-jump", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 976, + "Title": "Largest Perimeter Triangle", + "TitleSlug": "largest-perimeter-triangle", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 977, + "Title": "Squares of a Sorted Array", + "TitleSlug": "squares-of-a-sorted-array", + "PassRate": "71%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 978, + "Title": "Longest Turbulent Subarray", + "TitleSlug": "longest-turbulent-subarray", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 979, + "Title": "Distribute Coins in Binary Tree", + "TitleSlug": "distribute-coins-in-binary-tree", + "PassRate": "67%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 980, + "Title": "Unique Paths III", + "TitleSlug": "unique-paths-iii", + "PassRate": "71%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 981, + "Title": "Time Based Key-Value Store", + "TitleSlug": "time-based-key-value-store", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 982, + "Title": "Triples with Bitwise AND Equal To Zero", + "TitleSlug": "triples-with-bitwise-and-equal-to-zero", + "PassRate": "54%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 983, + "Title": "Minimum Cost For Tickets", + "TitleSlug": "minimum-cost-for-tickets", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 984, + "Title": "String Without AAA or BBB", + "TitleSlug": "string-without-aaa-or-bbb", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 985, + "Title": "Sum of Even Numbers After Queries", + "TitleSlug": "sum-of-even-numbers-after-queries", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 986, + "Title": "Interval List Intersections", + "TitleSlug": "interval-list-intersections", + "PassRate": "64%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 987, + "Title": "Vertical Order Traversal of a Binary Tree", + "TitleSlug": "vertical-order-traversal-of-a-binary-tree", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 988, + "Title": "Smallest String Starting From Leaf", + "TitleSlug": "smallest-string-starting-from-leaf", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 989, + "Title": "Add to Array-Form of Integer", + "TitleSlug": "add-to-array-form-of-integer", + "PassRate": "43%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 990, + "Title": "Satisfiability of Equality Equations", + "TitleSlug": "satisfiability-of-equality-equations", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 991, + "Title": "Broken Calculator", + "TitleSlug": "broken-calculator", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 992, + "Title": "Subarrays with K Different Integers", + "TitleSlug": "subarrays-with-k-different-integers", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 993, + "Title": "Cousins in Binary Tree", + "TitleSlug": "cousins-in-binary-tree", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 994, + "Title": "Rotting Oranges", + "TitleSlug": "rotting-oranges", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 995, + "Title": "Minimum Number of K Consecutive Bit Flips", + "TitleSlug": "minimum-number-of-k-consecutive-bit-flips", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 996, + "Title": "Number of Squareful Arrays", + "TitleSlug": "number-of-squareful-arrays", + "PassRate": "47%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 997, + "Title": "Find the Town Judge", + "TitleSlug": "find-the-town-judge", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 998, + "Title": "Maximum Binary Tree II", + "TitleSlug": "maximum-binary-tree-ii", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 999, + "Title": "Available Captures for Rook", + "TitleSlug": "available-captures-for-rook", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1000, + "Title": "Minimum Cost to Merge Stones", + "TitleSlug": "minimum-cost-to-merge-stones", + "PassRate": "36%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1001, + "Title": "Grid Illumination", + "TitleSlug": "grid-illumination", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1002, + "Title": "Find Common Characters", + "TitleSlug": "find-common-characters", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1003, + "Title": "Check If Word Is Valid After Substitutions", + "TitleSlug": "check-if-word-is-valid-after-substitutions", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1004, + "Title": "Max Consecutive Ones III", + "TitleSlug": "max-consecutive-ones-iii", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1005, + "Title": "Maximize Sum Of Array After K Negations", + "TitleSlug": "maximize-sum-of-array-after-k-negations", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1006, + "Title": "Clumsy Factorial", + "TitleSlug": "clumsy-factorial", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1007, + "Title": "Minimum Domino Rotations For Equal Row", + "TitleSlug": "minimum-domino-rotations-for-equal-row", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1008, + "Title": "Construct Binary Search Tree from Preorder Traversal", + "TitleSlug": "construct-binary-search-tree-from-preorder-traversal", + "PassRate": "73%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1009, + "Title": "Complement of Base 10 Integer", + "TitleSlug": "complement-of-base-10-integer", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1010, + "Title": "Pairs of Songs With Total Durations Divisible by 60", + "TitleSlug": "pairs-of-songs-with-total-durations-divisible-by-60", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1011, + "Title": "Capacity To Ship Packages Within D Days", + "TitleSlug": "capacity-to-ship-packages-within-d-days", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1012, + "Title": "Numbers With Repeated Digits", + "TitleSlug": "numbers-with-repeated-digits", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1013, + "Title": "Partition Array Into Three Parts With Equal Sum", + "TitleSlug": "partition-array-into-three-parts-with-equal-sum", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1014, + "Title": "Best Sightseeing Pair", + "TitleSlug": "best-sightseeing-pair", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1015, + "Title": "Smallest Integer Divisible by K", + "TitleSlug": "smallest-integer-divisible-by-k", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1016, + "Title": "Binary String With Substrings Representing 1 To N", + "TitleSlug": "binary-string-with-substrings-representing-1-to-n", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1017, + "Title": "Convert to Base -2", + "TitleSlug": "convert-to-base-2", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1018, + "Title": "Binary Prefix Divisible By 5", + "TitleSlug": "binary-prefix-divisible-by-5", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1019, + "Title": "Next Greater Node In Linked List", + "TitleSlug": "next-greater-node-in-linked-list", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1020, + "Title": "Number of Enclaves", + "TitleSlug": "number-of-enclaves", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1021, + "Title": "Remove Outermost Parentheses", + "TitleSlug": "remove-outermost-parentheses", + "PassRate": "75%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1022, + "Title": "Sum of Root To Leaf Binary Numbers", + "TitleSlug": "sum-of-root-to-leaf-binary-numbers", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1023, + "Title": "Camelcase Matching", + "TitleSlug": "camelcase-matching", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1024, + "Title": "Video Stitching", + "TitleSlug": "video-stitching", + "PassRate": "47%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1025, + "Title": "Divisor Game", + "TitleSlug": "divisor-game", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1026, + "Title": "Maximum Difference Between Node and Ancestor", + "TitleSlug": "maximum-difference-between-node-and-ancestor", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1027, + "Title": "Longest Arithmetic Sequence", + "TitleSlug": "longest-arithmetic-sequence", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1028, + "Title": "Recover a Tree From Preorder Traversal", + "TitleSlug": "recover-a-tree-from-preorder-traversal", + "PassRate": "69%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1029, + "Title": "Two City Scheduling", + "TitleSlug": "two-city-scheduling", + "PassRate": "55%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1030, + "Title": "Matrix Cells in Distance Order", + "TitleSlug": "matrix-cells-in-distance-order", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1031, + "Title": "Maximum Sum of Two Non-Overlapping Subarrays", + "TitleSlug": "maximum-sum-of-two-non-overlapping-subarrays", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1032, + "Title": "Stream of Characters", + "TitleSlug": "stream-of-characters", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1033, + "Title": "Moving Stones Until Consecutive", + "TitleSlug": "moving-stones-until-consecutive", + "PassRate": "38%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1034, + "Title": "Coloring A Border", + "TitleSlug": "coloring-a-border", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1035, + "Title": "Uncrossed Lines", + "TitleSlug": "uncrossed-lines", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1036, + "Title": "Escape a Large Maze", + "TitleSlug": "escape-a-large-maze", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1037, + "Title": "Valid Boomerang", + "TitleSlug": "valid-boomerang", + "PassRate": "37%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1038, + "Title": "Binary Search Tree to Greater Sum Tree", + "TitleSlug": "binary-search-tree-to-greater-sum-tree", + "PassRate": "77%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1039, + "Title": "Minimum Score Triangulation of Polygon", + "TitleSlug": "minimum-score-triangulation-of-polygon", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1040, + "Title": "Moving Stones Until Consecutive II", + "TitleSlug": "moving-stones-until-consecutive-ii", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1041, + "Title": "Robot Bounded In Circle", + "TitleSlug": "robot-bounded-in-circle", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1042, + "Title": "Flower Planting With No Adjacent", + "TitleSlug": "flower-planting-with-no-adjacent", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1043, + "Title": "Partition Array for Maximum Sum", + "TitleSlug": "partition-array-for-maximum-sum", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1044, + "Title": "Longest Duplicate Substring", + "TitleSlug": "longest-duplicate-substring", + "PassRate": "23%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1046, + "Title": "Last Stone Weight", + "TitleSlug": "last-stone-weight", + "PassRate": "62%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1047, + "Title": "Remove All Adjacent Duplicates In String", + "TitleSlug": "remove-all-adjacent-duplicates-in-string", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1048, + "Title": "Longest String Chain", + "TitleSlug": "longest-string-chain", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1049, + "Title": "Last Stone Weight II", + "TitleSlug": "last-stone-weight-ii", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1051, + "Title": "Height Checker", + "TitleSlug": "height-checker", + "PassRate": "68%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1052, + "Title": "Grumpy Bookstore Owner", + "TitleSlug": "grumpy-bookstore-owner", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1053, + "Title": "Previous Permutation With One Swap", + "TitleSlug": "previous-permutation-with-one-swap", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1054, + "Title": "Distant Barcodes", + "TitleSlug": "distant-barcodes", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1055, + "Title": "Shortest Way to Form String", + "TitleSlug": "shortest-way-to-form-string", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1056, + "Title": "Confusing Number", + "TitleSlug": "confusing-number", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1057, + "Title": "Campus Bikes", + "TitleSlug": "campus-bikes", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1058, + "Title": "Minimize Rounding Error to Meet Target", + "TitleSlug": "minimize-rounding-error-to-meet-target", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1059, + "Title": "All Paths from Source Lead to Destination", + "TitleSlug": "all-paths-from-source-lead-to-destination", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1060, + "Title": "Missing Element in Sorted Array", + "TitleSlug": "missing-element-in-sorted-array", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1061, + "Title": "Lexicographically Smallest Equivalent String", + "TitleSlug": "lexicographically-smallest-equivalent-string", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1062, + "Title": "Longest Repeating Substring", + "TitleSlug": "longest-repeating-substring", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1063, + "Title": "Number of Valid Subarrays", + "TitleSlug": "number-of-valid-subarrays", + "PassRate": "71%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1064, + "Title": "Fixed Point", + "TitleSlug": "fixed-point", + "PassRate": "71%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1065, + "Title": "Index Pairs of a String", + "TitleSlug": "index-pairs-of-a-string", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1066, + "Title": "Campus Bikes II", + "TitleSlug": "campus-bikes-ii", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1067, + "Title": "Digit Count in Range", + "TitleSlug": "digit-count-in-range", + "PassRate": "38%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1071, + "Title": "Greatest Common Divisor of Strings", + "TitleSlug": "greatest-common-divisor-of-strings", + "PassRate": "53%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1072, + "Title": "Flip Columns For Maximum Number of Equal Rows", + "TitleSlug": "flip-columns-for-maximum-number-of-equal-rows", + "PassRate": "59%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1073, + "Title": "Adding Two Negabinary Numbers", + "TitleSlug": "adding-two-negabinary-numbers", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1074, + "Title": "Number of Submatrices That Sum to Target", + "TitleSlug": "number-of-submatrices-that-sum-to-target", + "PassRate": "58%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1078, + "Title": "Occurrences After Bigram", + "TitleSlug": "occurrences-after-bigram", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1079, + "Title": "Letter Tile Possibilities", + "TitleSlug": "letter-tile-possibilities", + "PassRate": "74%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1080, + "Title": "Insufficient Nodes in Root to Leaf Paths", + "TitleSlug": "insufficient-nodes-in-root-to-leaf-paths", + "PassRate": "45%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1081, + "Title": "Smallest Subsequence of Distinct Characters", + "TitleSlug": "smallest-subsequence-of-distinct-characters", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1085, + "Title": "Sum of Digits in the Minimum Number", + "TitleSlug": "sum-of-digits-in-the-minimum-number", + "PassRate": "74%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1086, + "Title": "High Five", + "TitleSlug": "high-five", + "PassRate": "75%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1087, + "Title": "Brace Expansion", + "TitleSlug": "brace-expansion", + "PassRate": "60%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1088, + "Title": "Confusing Number II", + "TitleSlug": "confusing-number-ii", + "PassRate": "37%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1089, + "Title": "Duplicate Zeros", + "TitleSlug": "duplicate-zeros", + "PassRate": "58%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1090, + "Title": "Largest Values From Labels", + "TitleSlug": "largest-values-from-labels", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1091, + "Title": "Shortest Path in Binary Matrix", + "TitleSlug": "shortest-path-in-binary-matrix", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1092, + "Title": "Shortest Common Supersequence ", + "TitleSlug": "shortest-common-supersequence", + "PassRate": "49%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1093, + "Title": "Statistics from a Large Sample", + "TitleSlug": "statistics-from-a-large-sample", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1094, + "Title": "Car Pooling", + "TitleSlug": "car-pooling", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1095, + "Title": "Find in Mountain Array", + "TitleSlug": "find-in-mountain-array", + "PassRate": "34%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1096, + "Title": "Brace Expansion II", + "TitleSlug": "brace-expansion-ii", + "PassRate": "59%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1099, + "Title": "Two Sum Less Than K", + "TitleSlug": "two-sum-less-than-k", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1100, + "Title": "Find K-Length Substrings With No Repeated Characters", + "TitleSlug": "find-k-length-substrings-with-no-repeated-characters", + "PassRate": "71%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1101, + "Title": "The Earliest Moment When Everyone Become Friends", + "TitleSlug": "the-earliest-moment-when-everyone-become-friends", + "PassRate": "65%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1102, + "Title": "Path With Maximum Minimum Value", + "TitleSlug": "path-with-maximum-minimum-value", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1103, + "Title": "Distribute Candies to People", + "TitleSlug": "distribute-candies-to-people", + "PassRate": "59%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1104, + "Title": "Path In Zigzag Labelled Binary Tree", + "TitleSlug": "path-in-zigzag-labelled-binary-tree", + "PassRate": "70%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1105, + "Title": "Filling Bookcase Shelves", + "TitleSlug": "filling-bookcase-shelves", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1106, + "Title": "Parsing A Boolean Expression", + "TitleSlug": "parsing-a-boolean-expression", + "PassRate": "57%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1108, + "Title": "Defanging an IP Address", + "TitleSlug": "defanging-an-ip-address", + "PassRate": "84%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1109, + "Title": "Corporate Flight Bookings", + "TitleSlug": "corporate-flight-bookings", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1110, + "Title": "Delete Nodes And Return Forest", + "TitleSlug": "delete-nodes-and-return-forest", + "PassRate": "64%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1111, + "Title": "Maximum Nesting Depth of Two Valid Parentheses Strings", + "TitleSlug": "maximum-nesting-depth-of-two-valid-parentheses-strings", + "PassRate": "67%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1118, + "Title": "Number of Days in a Month", + "TitleSlug": "number-of-days-in-a-month", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1119, + "Title": "Remove Vowels from a String", + "TitleSlug": "remove-vowels-from-a-string", + "PassRate": "87%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1120, + "Title": "Maximum Average Subtree", + "TitleSlug": "maximum-average-subtree", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1121, + "Title": "Divide Array Into Increasing Sequences", + "TitleSlug": "divide-array-into-increasing-sequences", + "PassRate": "54%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1122, + "Title": "Relative Sort Array", + "TitleSlug": "relative-sort-array", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1123, + "Title": "Lowest Common Ancestor of Deepest Leaves", + "TitleSlug": "lowest-common-ancestor-of-deepest-leaves", + "PassRate": "64%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1124, + "Title": "Longest Well-Performing Interval", + "TitleSlug": "longest-well-performing-interval", + "PassRate": "31%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1125, + "Title": "Smallest Sufficient Team", + "TitleSlug": "smallest-sufficient-team", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1128, + "Title": "Number of Equivalent Domino Pairs", + "TitleSlug": "number-of-equivalent-domino-pairs", + "PassRate": "46%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1129, + "Title": "Shortest Path with Alternating Colors", + "TitleSlug": "shortest-path-with-alternating-colors", + "PassRate": "37%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1130, + "Title": "Minimum Cost Tree From Leaf Values", + "TitleSlug": "minimum-cost-tree-from-leaf-values", + "PassRate": "62%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1131, + "Title": "Maximum of Absolute Value Expression", + "TitleSlug": "maximum-of-absolute-value-expression", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1133, + "Title": "Largest Unique Number", + "TitleSlug": "largest-unique-number", + "PassRate": "67%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1134, + "Title": "Armstrong Number", + "TitleSlug": "armstrong-number", + "PassRate": "77%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1135, + "Title": "Connecting Cities With Minimum Cost", + "TitleSlug": "connecting-cities-with-minimum-cost", + "PassRate": "54%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1136, + "Title": "Parallel Courses", + "TitleSlug": "parallel-courses", + "PassRate": "59%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1137, + "Title": "N-th Tribonacci Number", + "TitleSlug": "n-th-tribonacci-number", + "PassRate": "57%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1138, + "Title": "Alphabet Board Path", + "TitleSlug": "alphabet-board-path", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1139, + "Title": "Largest 1-Bordered Square", + "TitleSlug": "largest-1-bordered-square", + "PassRate": "44%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1140, + "Title": "Stone Game II", + "TitleSlug": "stone-game-ii", + "PassRate": "60%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1143, + "Title": "Longest Common Subsequence", + "TitleSlug": "longest-common-subsequence", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1144, + "Title": "Decrease Elements To Make Array Zigzag", + "TitleSlug": "decrease-elements-to-make-array-zigzag", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1145, + "Title": "Binary Tree Coloring Game", + "TitleSlug": "binary-tree-coloring-game", + "PassRate": "49%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1146, + "Title": "Snapshot Array", + "TitleSlug": "snapshot-array", + "PassRate": "34%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1147, + "Title": "Longest Chunked Palindrome Decomposition", + "TitleSlug": "longest-chunked-palindrome-decomposition", + "PassRate": "58%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1150, + "Title": "Check If a Number Is Majority Element in a Sorted Array", + "TitleSlug": "check-if-a-number-is-majority-element-in-a-sorted-array", + "PassRate": "60%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1151, + "Title": "Minimum Swaps to Group All 1's Together", + "TitleSlug": "minimum-swaps-to-group-all-1s-together", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1152, + "Title": "Analyze User Website Visit Pattern", + "TitleSlug": "analyze-user-website-visit-pattern", + "PassRate": "39%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1153, + "Title": "String Transforms Into Another String", + "TitleSlug": "string-transforms-into-another-string", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1154, + "Title": "Day of the Year", + "TitleSlug": "day-of-the-year", + "PassRate": "48%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1155, + "Title": "Number of Dice Rolls With Target Sum", + "TitleSlug": "number-of-dice-rolls-with-target-sum", + "PassRate": "48%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1156, + "Title": "Swap For Longest Repeated Character Substring", + "TitleSlug": "swap-for-longest-repeated-character-substring", + "PassRate": "46%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1157, + "Title": "Online Majority Element In Subarray", + "TitleSlug": "online-majority-element-in-subarray", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1160, + "Title": "Find Words That Can Be Formed by Characters", + "TitleSlug": "find-words-that-can-be-formed-by-characters", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1161, + "Title": "Maximum Level Sum of a Binary Tree", + "TitleSlug": "maximum-level-sum-of-a-binary-tree", + "PassRate": "70%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1162, + "Title": "As Far from Land as Possible", + "TitleSlug": "as-far-from-land-as-possible", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1163, + "Title": "Last Substring in Lexicographical Order", + "TitleSlug": "last-substring-in-lexicographical-order", + "PassRate": "30%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1165, + "Title": "Single-Row Keyboard", + "TitleSlug": "single-row-keyboard", + "PassRate": "84%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1166, + "Title": "Design File System", + "TitleSlug": "design-file-system", + "PassRate": "58%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1167, + "Title": "Minimum Cost to Connect Sticks", + "TitleSlug": "minimum-cost-to-connect-sticks", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1168, + "Title": "Optimize Water Distribution in a Village", + "TitleSlug": "optimize-water-distribution-in-a-village", + "PassRate": "56%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1169, + "Title": "Invalid Transactions", + "TitleSlug": "invalid-transactions", + "PassRate": "28%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1170, + "Title": "Compare Strings by Frequency of the Smallest Character", + "TitleSlug": "compare-strings-by-frequency-of-the-smallest-character", + "PassRate": "58%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1171, + "Title": "Remove Zero Sum Consecutive Nodes from Linked List", + "TitleSlug": "remove-zero-sum-consecutive-nodes-from-linked-list", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1172, + "Title": "Dinner Plate Stacks", + "TitleSlug": "dinner-plate-stacks", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1175, + "Title": "Prime Arrangements", + "TitleSlug": "prime-arrangements", + "PassRate": "50%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1176, + "Title": "Diet Plan Performance", + "TitleSlug": "diet-plan-performance", + "PassRate": "49%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1177, + "Title": "Can Make Palindrome from Substring", + "TitleSlug": "can-make-palindrome-from-substring", + "PassRate": "32%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1178, + "Title": "Number of Valid Words for Each Puzzle", + "TitleSlug": "number-of-valid-words-for-each-puzzle", + "PassRate": "35%", + "Difficulty": "Hard", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1180, + "Title": "Count Substrings with Only One Distinct Letter", + "TitleSlug": "count-substrings-with-only-one-distinct-letter", + "PassRate": "76%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1181, + "Title": "Before and After Puzzle", + "TitleSlug": "before-and-after-puzzle", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1182, + "Title": "Shortest Distance to Target Color", + "TitleSlug": "shortest-distance-to-target-color", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1183, + "Title": "Maximum Number of Ones", + "TitleSlug": "maximum-number-of-ones", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1184, + "Title": "Distance Between Bus Stops", + "TitleSlug": "distance-between-bus-stops", + "PassRate": "56%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1185, + "Title": "Day of the Week", + "TitleSlug": "day-of-the-week", + "PassRate": "64%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1186, + "Title": "Maximum Subarray Sum with One Deletion", + "TitleSlug": "maximum-subarray-sum-with-one-deletion", + "PassRate": "33%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1187, + "Title": "Make Array Strictly Increasing", + "TitleSlug": "make-array-strictly-increasing", + "PassRate": "40%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1189, + "Title": "Maximum Number of Balloons", + "TitleSlug": "maximum-number-of-balloons", + "PassRate": "61%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1190, + "Title": "Reverse Substrings Between Each Pair of Parentheses", + "TitleSlug": "reverse-substrings-between-each-pair-of-parentheses", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": true, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1191, + "Title": "K-Concatenation Maximum Sum", + "TitleSlug": "k-concatenation-maximum-sum", + "PassRate": "24%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1192, + "Title": "Critical Connections in a Network", + "TitleSlug": "critical-connections-in-a-network", + "PassRate": "47%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1196, + "Title": "How Many Apples Can You Put into the Basket", + "TitleSlug": "how-many-apples-can-you-put-into-the-basket", + "PassRate": "69%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1197, + "Title": "Minimum Knight Moves", + "TitleSlug": "minimum-knight-moves", + "PassRate": "30%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1198, + "Title": "Find Smallest Common Element in All Rows", + "TitleSlug": "find-smallest-common-element-in-all-rows", + "PassRate": "73%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1199, + "Title": "Minimum Time to Build Blocks", + "TitleSlug": "minimum-time-to-build-blocks", + "PassRate": "33%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1200, + "Title": "Minimum Absolute Difference", + "TitleSlug": "minimum-absolute-difference", + "PassRate": "66%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1201, + "Title": "Ugly Number III", + "TitleSlug": "ugly-number-iii", + "PassRate": "24%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1202, + "Title": "Smallest String With Swaps", + "TitleSlug": "smallest-string-with-swaps", + "PassRate": "41%", + "Difficulty": "Medium", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1203, + "Title": "Sort Items by Groups Respecting Dependencies", + "TitleSlug": "sort-items-by-groups-respecting-dependencies", + "PassRate": "45%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1206, + "Title": "Design Skiplist", + "TitleSlug": "design-skiplist", + "PassRate": "60%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1207, + "Title": "Unique Number of Occurrences", + "TitleSlug": "unique-number-of-occurrences", + "PassRate": "72%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1208, + "Title": "Get Equal Substrings Within Budget", + "TitleSlug": "get-equal-substrings-within-budget", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1209, + "Title": "Remove All Adjacent Duplicates in String II", + "TitleSlug": "remove-all-adjacent-duplicates-in-string-ii", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1210, + "Title": "Minimum Moves to Reach Target with Rotations", + "TitleSlug": "minimum-moves-to-reach-target-with-rotations", + "PassRate": "43%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1213, + "Title": "Intersection of Three Sorted Arrays", + "TitleSlug": "intersection-of-three-sorted-arrays", + "PassRate": "77%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1214, + "Title": "Two Sum BSTs", + "TitleSlug": "two-sum-bsts", + "PassRate": "64%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1215, + "Title": "Stepping Numbers", + "TitleSlug": "stepping-numbers", + "PassRate": "36%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1216, + "Title": "Valid Palindrome III", + "TitleSlug": "valid-palindrome-iii", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1217, + "Title": "Play with Chips", + "TitleSlug": "play-with-chips", + "PassRate": "63%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1218, + "Title": "Longest Arithmetic Subsequence of Given Difference", + "TitleSlug": "longest-arithmetic-subsequence-of-given-difference", + "PassRate": "38%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1219, + "Title": "Path with Maximum Gold", + "TitleSlug": "path-with-maximum-gold", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1220, + "Title": "Count Vowels Permutation", + "TitleSlug": "count-vowels-permutation", + "PassRate": "51%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1221, + "Title": "Split a String in Balanced Strings", + "TitleSlug": "split-a-string-in-balanced-strings", + "PassRate": "78%", + "Difficulty": "Easy", + "IsAccepted": true, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1222, + "Title": "Queens That Can Attack the King", + "TitleSlug": "queens-that-can-attack-the-king", + "PassRate": "68%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1223, + "Title": "Dice Roll Simulation", + "TitleSlug": "dice-roll-simulation", + "PassRate": "42%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1224, + "Title": "Maximum Equal Frequency", + "TitleSlug": "maximum-equal-frequency", + "PassRate": "31%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1227, + "Title": "Airplane Seat Assignment Probability", + "TitleSlug": "airplane-seat-assignment-probability", + "PassRate": "61%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1228, + "Title": "Missing Number In Arithmetic Progression", + "TitleSlug": "missing-number-in-arithmetic-progression", + "PassRate": "52%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1229, + "Title": "Meeting Scheduler", + "TitleSlug": "meeting-scheduler", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1230, + "Title": "Toss Strange Coins", + "TitleSlug": "toss-strange-coins", + "PassRate": "43%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1231, + "Title": "Divide Chocolate", + "TitleSlug": "divide-chocolate", + "PassRate": "49%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1232, + "Title": "Check If It Is a Straight Line", + "TitleSlug": "check-if-it-is-a-straight-line", + "PassRate": "47%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1233, + "Title": "Remove Sub-Folders from the Filesystem", + "TitleSlug": "remove-sub-folders-from-the-filesystem", + "PassRate": "53%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1234, + "Title": "Replace the Substring for Balanced String", + "TitleSlug": "replace-the-substring-for-balanced-string", + "PassRate": "29%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1235, + "Title": "Maximum Profit in Job Scheduling", + "TitleSlug": "maximum-profit-in-job-scheduling", + "PassRate": "44%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1236, + "Title": "Web Crawler", + "TitleSlug": "web-crawler", + "PassRate": "63%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1237, + "Title": "Find Positive Integer Solution for a Given Equation", + "TitleSlug": "find-positive-integer-solution-for-a-given-equation", + "PassRate": "65%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1238, + "Title": "Circular Permutation in Binary Representation", + "TitleSlug": "circular-permutation-in-binary-representation", + "PassRate": "57%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1239, + "Title": "Maximum Length of a Concatenated String with Unique Characters", + "TitleSlug": "maximum-length-of-a-concatenated-string-with-unique-characters", + "PassRate": "40%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1240, + "Title": "Tiling a Rectangle with the Fewest Squares", + "TitleSlug": "tiling-a-rectangle-with-the-fewest-squares", + "PassRate": "48%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 0, + "Title": "", + "TitleSlug": "", + "PassRate": "", + "Difficulty": "", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1243, + "Title": "Array Transformation", + "TitleSlug": "array-transformation", + "PassRate": "51%", + "Difficulty": "Easy", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1244, + "Title": "Design A Leaderboard", + "TitleSlug": "design-a-leaderboard", + "PassRate": "51%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1245, + "Title": "Tree Diameter", + "TitleSlug": "tree-diameter", + "PassRate": "52%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1246, + "Title": "Palindrome Removal", + "TitleSlug": "palindrome-removal", + "PassRate": "41%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": true, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1247, + "Title": "Minimum Swaps to Make Strings Equal", + "TitleSlug": "minimum-swaps-to-make-strings-equal", + "PassRate": "56%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1248, + "Title": "Count Number of Nice Subarrays", + "TitleSlug": "count-number-of-nice-subarrays", + "PassRate": "50%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1249, + "Title": "Minimum Remove to Make Valid Parentheses", + "TitleSlug": "minimum-remove-to-make-valid-parentheses", + "PassRate": "55%", + "Difficulty": "Medium", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + }, + { + "ID": 1250, + "Title": "Check If It Is a Good Array", + "TitleSlug": "check-if-it-is-a-good-array", + "PassRate": "46%", + "Difficulty": "Hard", + "IsAccepted": false, + "IsPaid": false, + "IsFavor": false, + "IsNew": false, + "HasNoGoOption": false + } + ] +} \ No newline at end of file diff --git a/routine/union-find/union-find.go b/routine/union-find/union-find.go new file mode 100644 index 000000000..6358430cf --- /dev/null +++ b/routine/union-find/union-find.go @@ -0,0 +1,28 @@ +package unionfind + +// leetcode 中需要 union 的集合都太小了,最普通的集合算法,就够用了 + +type unionFind struct { + parent []int +} + +func newUnionFind(size int) *unionFind { + parent := make([]int, size) + for i := range parent { + parent[i] = i + } + return &unionFind{ + parent: parent, + } +} + +func (u *unionFind) find(i int) int { + if u.parent[i] != i { + u.parent[i] = u.find(u.parent[i]) + } + return u.parent[i] +} + +func (u *unionFind) union(x, y int) { + u.parent[u.find(x)] = u.find(y) +} diff --git a/template.markdown b/template.markdown new file mode 100755 index 000000000..e04a1c7e9 --- /dev/null +++ b/template.markdown @@ -0,0 +1,51 @@ +# [LeetCode](https://leetcode.com) 的 Go 解答 {{- /* 本文件是用来生成 README.md 的模板 */}} + +[![LeetCode 排名](https://img.shields.io/badge/{{.Username}}-{{.Ranking}}-blue.svg)](https://leetcode.com/{{.Username}}/) +[![codecov](https://codecov.io/gh/aQuaYi/LeetCode-in-Go/branch/master/graph/badge.svg)](https://codecov.io/gh/aQuaYi/LeetCode-in-Go) +[![Build Status](https://www.travis-ci.org/aQuaYi/LeetCode-in-Go.svg?branch=master)](https://www.travis-ci.org/aQuaYi/LeetCode-in-Go) + [![Go](https://img.shields.io/badge/Go-1.13-blue.svg)](https://golang.google.cn) + +## 进度 + +> 统计规则:1.免费题,2.算法题,3.能提交 Go 解答 + +{{.ProgressTable}} + +## 题解 + +{{.AvailableTable}} +以下免费的算法题,暂时不能提交 Go 解答 + +{{.UnavailableList}} + +## helper + +[helper](./Helper) 会处理大部分琐碎的工作。 + +## notes + +[notes](./notes) 记录了我答题过程中,对知识点的总结。 + +## kit + +针对 LeetCode 中经常出现的以下数据结构,在 [kit](./kit) 中进行了定义,并添加了与 []int 相互转换的函数。利用 Go 1.9 添加的 [type alias](https://github.com/golang/proposal/blob/master/design/18130-type-alias.md) 功能,易于添加单元测试。 + +- [Heap](./kit/Heap.go) +- [Interval](./kit/Interval.go) +- [ListNode](./kit/ListNode.go) +- [NestedInteger](./kit/NestedInteger.go) +- [PriorityQueue](./kit/PriorityQueue.go) +- [Queue](./kit/Queue.go) +- [Stack](./kit/Stack.go) +- [TreeNode](./kit/TreeNode.go) +- [Master](./kit/master.go) + +## 致谢 + +感谢所有贡献者的辛苦付出 + + + +感谢 JetBrains + +[![GoLand](GoLand.png)]( https://www.jetbrains.com/?from=LeetCode-in-Go) diff --git a/test.sh b/test.sh index a2e5a9952..c279d1d95 100644 --- a/test.sh +++ b/test.sh @@ -3,7 +3,7 @@ set -e echo "" > coverage.txt -for d in $(go list ./... | grep -v vendor); do +for d in $(go list ./Algorithms/... | grep -v vendor); do echo $d go test -coverprofile=profile.out -covermode=atomic $d if [ -f profile.out ]; then diff --git a/unavailable.json b/unavailable.json new file mode 100644 index 000000000..63fa65539 --- /dev/null +++ b/unavailable.json @@ -0,0 +1,26 @@ +{ + "List": [ + 116, + 117, + 133, + 138, + 151, + 278, + 284, + 297, + 341, + 374, + 426, + 427, + 429, + 430, + 449, + 535, + 558, + 559, + 589, + 590, + 690, + 708 + ] +} \ No newline at end of file